@abgov/react-components 4.0.0-alpha.174 → 4.0.0-alpha.175
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dropdown/dropdown.d.ts +2 -0
- package/lib/popover/popover.d.ts +2 -0
- package/package.json +1 -1
- package/react-components.esm.js +36 -33
- package/react-components.umd.js +37 -34
|
@@ -15,6 +15,7 @@ interface WCProps extends Margins {
|
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
value?: string;
|
|
17
17
|
width?: string;
|
|
18
|
+
relative?: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare global {
|
|
20
21
|
namespace JSX {
|
|
@@ -39,6 +40,7 @@ interface Props extends Margins {
|
|
|
39
40
|
placeholder?: string;
|
|
40
41
|
testId?: string;
|
|
41
42
|
width?: string;
|
|
43
|
+
relative?: boolean;
|
|
42
44
|
}
|
|
43
45
|
export declare const GoADropdown: FC<Props>;
|
|
44
46
|
export default GoADropdown;
|
package/lib/popover/popover.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface WCProps extends Margins {
|
|
|
5
5
|
maxwidth?: string;
|
|
6
6
|
padded?: boolean;
|
|
7
7
|
position?: Position;
|
|
8
|
+
relative?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare global {
|
|
10
11
|
namespace JSX {
|
|
@@ -20,6 +21,7 @@ interface Props extends Margins {
|
|
|
20
21
|
padded?: boolean;
|
|
21
22
|
position?: Position;
|
|
22
23
|
children: ReactNode;
|
|
24
|
+
relative?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export declare const GoAPopover: FC<Props>;
|
|
25
27
|
export default GoAPopover;
|
package/package.json
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -153,41 +153,39 @@ function create_if_block_2$a(ctx){let div;let t;return {c(){div=element("div");t
|
|
|
153
153
|
goa-container--${/*type*/ctx[0]}
|
|
154
154
|
padding--${/*padding*/ctx[2]}
|
|
155
155
|
accent--${/*accent*/ctx[1]}
|
|
156
|
-
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$F($$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: 480px){.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$F,create_fragment$J,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);/* libs/web-components/src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$I(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$E($$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$E,create_fragment$I,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);/* libs/web-components/src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$H(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$D($$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$D,create_fragment$H,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);/* libs/web-components/src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[48]=list[i];child_ctx[52]=i;return child_ctx;}function get_each_context$7(ctx,list,i){const child_ctx=ctx.slice();child_ctx[48]=list[i];return child_ctx;}// (259:2) {:else}
|
|
157
|
-
function create_else_block$9(ctx){let slot;let t0;let goa_popover;let goa_input;let goa_input_arialabel_value;let goa_input_data_testid_value;let t1;let ul;let each_blocks=[];let each_1_lookup=new Map();let ul_style_value;let goa_popover_width_value;let mounted;let dispose;let each_value_1=/*_options*/ctx[
|
|
156
|
+
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$F($$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: 480px){.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$F,create_fragment$J,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);/* libs/web-components/src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$I(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$E($$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$E,create_fragment$I,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);/* libs/web-components/src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$H(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$D($$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$D,create_fragment$H,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);/* libs/web-components/src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[49]=list[i];child_ctx[53]=i;return child_ctx;}function get_each_context$7(ctx,list,i){const child_ctx=ctx.slice();child_ctx[49]=list[i];return child_ctx;}// (257:2) {:else}
|
|
157
|
+
function create_else_block$9(ctx){let slot;let t0;let goa_popover;let goa_input;let goa_input_arialabel_value;let goa_input_data_testid_value;let t1;let ul;let each_blocks=[];let each_1_lookup=new Map();let ul_style_value;let goa_popover_width_value;let mounted;let dispose;let each_value_1=/*_options*/ctx[13];const get_key=ctx=>/*index*/ctx[53];for(let i=0;i<each_value_1.length;i+=1){let child_ctx=get_each_context_1(ctx,each_value_1,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block_1(key,child_ctx));}return {c(){slot=element("slot");t0=space();goa_popover=element("goa-popover");goa_input=element("goa-input");t1=space();ul=element("ul");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}set_custom_element_data(goa_input,"slot","target");set_custom_element_data(goa_input,"error",/*error*/ctx[7]);set_custom_element_data(goa_input,"disabled",/*disabled*/ctx[6]);set_custom_element_data(goa_input,"leadingicon",/*leadingicon*/ctx[2]);set_custom_element_data(goa_input,"placeholder",/*placeholder*/ctx[4]);set_custom_element_data(goa_input,"aria-controls","menu");set_custom_element_data(goa_input,"aria-expanded",/*_isMenuVisible*/ctx[18]);set_custom_element_data(goa_input,"arialabel",goa_input_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);set_custom_element_data(goa_input,"data-testid",goa_input_data_testid_value=`${/*name*/ctx[0]}-dropdown-input`);set_custom_element_data(goa_input,"readonly","");set_custom_element_data(goa_input,"role","combobox");set_custom_element_data(goa_input,"trailingicon","chevron-down");set_custom_element_data(goa_input,"type","text");set_custom_element_data(goa_input,"value",/*_selectedLabel*/ctx[17]);set_custom_element_data(goa_input,"width","100%");set_custom_element_data(goa_input,"name",/*name*/ctx[0]);attr(ul,"id","menu");attr(ul,"role","listbox");attr(ul,"aria-activedescendant",/*_selectedLabel*/ctx[17]);attr(ul,"data-testid","dropdown-menu");attr(ul,"tabindex","0");attr(ul,"style",ul_style_value=`
|
|
158
158
|
overflow-y: auto;
|
|
159
159
|
max-height: ${/*maxheight*/ctx[3]};
|
|
160
|
-
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[
|
|
160
|
+
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[18]);set_custom_element_data(goa_popover,"padded","false");set_custom_element_data(goa_popover,"width",goa_popover_width_value=/*width*/ctx[5]||/*_computedWidth*/ctx[20]);},m(target,anchor){insert(target,slot,anchor);insert(target,t0,anchor);insert(target,goa_popover,anchor);append(goa_popover,goa_input);append(goa_popover,t1);append(goa_popover,ul);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(ul,null);}}/*ul_binding*/ctx[33](ul);if(!mounted){dispose=listen(goa_input,"click",/*showMenu*/ctx[25]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*error*/128){set_custom_element_data(goa_input,"error",/*error*/ctx[7]);}if(dirty[0]&/*disabled*/64){set_custom_element_data(goa_input,"disabled",/*disabled*/ctx[6]);}if(dirty[0]&/*leadingicon*/4){set_custom_element_data(goa_input,"leadingicon",/*leadingicon*/ctx[2]);}if(dirty[0]&/*placeholder*/16){set_custom_element_data(goa_input,"placeholder",/*placeholder*/ctx[4]);}if(dirty[0]&/*_isMenuVisible*/262144){set_custom_element_data(goa_input,"aria-expanded",/*_isMenuVisible*/ctx[18]);}if(dirty[0]&/*arialabel, name*/3&&goa_input_arialabel_value!==(goa_input_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){set_custom_element_data(goa_input,"arialabel",goa_input_arialabel_value);}if(dirty[0]&/*name*/1&&goa_input_data_testid_value!==(goa_input_data_testid_value=`${/*name*/ctx[0]}-dropdown-input`)){set_custom_element_data(goa_input,"data-testid",goa_input_data_testid_value);}if(dirty[0]&/*_selectedLabel*/131072){set_custom_element_data(goa_input,"value",/*_selectedLabel*/ctx[17]);}if(dirty[0]&/*name*/1){set_custom_element_data(goa_input,"name",/*name*/ctx[0]);}if(dirty[0]&/*_options, _values, _highlightedIndex, onSelect*/67706880){each_value_1=/*_options*/ctx[13];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,null,get_each_context_1);}if(dirty[0]&/*_selectedLabel*/131072){attr(ul,"aria-activedescendant",/*_selectedLabel*/ctx[17]);}if(dirty[0]&/*maxheight*/8&&ul_style_value!==(ul_style_value=`
|
|
161
161
|
overflow-y: auto;
|
|
162
162
|
max-height: ${/*maxheight*/ctx[3]};
|
|
163
|
-
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/64){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);}if(dirty[0]&/*_isMenuVisible*/
|
|
164
|
-
function create_if_block$l(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[
|
|
165
|
-
function create_each_block_1(key_1,ctx){let li;let t0_value=(/*option*/ctx[
|
|
166
|
-
function create_each_block$7(ctx){let option;let t0_value=/*option*/ctx[
|
|
167
|
-
${calculateMargin(/*mt*/ctx[
|
|
168
|
-
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[
|
|
169
|
-
`);toggle_class(div,"dropdown-native",/*_native*/ctx[
|
|
170
|
-
${calculateMargin(/*mt*/ctx[
|
|
171
|
-
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[
|
|
172
|
-
`)){attr(div,"style",div_style_value);}if(dirty[0]&/*_native*/
|
|
173
|
-
return rawValues.map(val=>`${val}`);}function instance$C($$self,$$props,$$invalidate){let _disabled;let _error;let _multiselect;let _native;let{name}=$$props;let{arialabel=""}=$$props;let{value=""}=$$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{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;// Private
|
|
163
|
+
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/64){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);}if(dirty[0]&/*relative*/256){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);}if(dirty[0]&/*_isMenuVisible*/262144){set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[18]);}if(dirty[0]&/*width, _computedWidth*/1048608&&goa_popover_width_value!==(goa_popover_width_value=/*width*/ctx[5]||/*_computedWidth*/ctx[20])){set_custom_element_data(goa_popover,"width",goa_popover_width_value);}},d(detaching){if(detaching)detach(slot);if(detaching)detach(t0);if(detaching)detach(goa_popover);for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].d();}/*ul_binding*/ctx[33](null);mounted=false;dispose();}};}// (238:2) {#if _native}
|
|
164
|
+
function create_if_block$l(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[13];let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$7(get_each_context$7(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();}select.disabled=/*_disabled*/ctx[23];attr(select,"aria-label",select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);toggle_class(select,"error",/*_error*/ctx[24]);},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[31](select);if(!mounted){dispose=listen(select,"change",/*onNativeSelect*/ctx[27]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*_options*/8192){each_value=/*_options*/ctx[13];let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$7(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$7(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]&/*_disabled*/8388608){select.disabled=/*_disabled*/ctx[23];}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]&/*_error*/16777216){toggle_class(select,"error",/*_error*/ctx[24]);}},d(detaching){if(detaching)detach(select);destroy_each(each_blocks,detaching);/*select_binding*/ctx[31](null);mounted=false;dispose();}};}// (296:8) {#each _options as option, index (index)}
|
|
165
|
+
function create_each_block_1(key_1,ctx){let li;let t0_value=(/*option*/ctx[49].label||/*option*/ctx[49].value)+"";let t0;let t1;let li_id_value;let li_aria_label_value;let li_aria_selected_value;let li_data_testid_value;let li_data_index_value;let li_data_value_value;let mounted;let dispose;function click_handler(){return(/*click_handler*/ctx[32](/*option*/ctx[49]));}return {key:key_1,first:null,c(){li=element("li");t0=text(t0_value);t1=space();attr(li,"id",li_id_value=/*option*/ctx[49].label);attr(li,"role","option");attr(li,"aria-label",li_aria_label_value=/*option*/ctx[49].label||/*option*/ctx[49].value);attr(li,"aria-selected",li_aria_selected_value=/*_values*/ctx[16].includes(/*option*/ctx[49].value)?"true":"false");attr(li,"class","dropdown-item");attr(li,"data-testid",li_data_testid_value=`dropdown-item-${/*option*/ctx[49].value}`);attr(li,"data-index",li_data_index_value=/*index*/ctx[53]);attr(li,"data-value",li_data_value_value=/*option*/ctx[49].value);set_style(li,"display","block");toggle_class(li,"dropdown-item--disabled",false);toggle_class(li,"dropdown-item--tabbed",/*index*/ctx[53]===/*_highlightedIndex*/ctx[19]);toggle_class(li,"dropdown-item--selected",/*_values*/ctx[16].includes(/*option*/ctx[49].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]&/*_options*/8192&&t0_value!==(t0_value=(/*option*/ctx[49].label||/*option*/ctx[49].value)+""))set_data(t0,t0_value);if(dirty[0]&/*_options*/8192&&li_id_value!==(li_id_value=/*option*/ctx[49].label)){attr(li,"id",li_id_value);}if(dirty[0]&/*_options*/8192&&li_aria_label_value!==(li_aria_label_value=/*option*/ctx[49].label||/*option*/ctx[49].value)){attr(li,"aria-label",li_aria_label_value);}if(dirty[0]&/*_values, _options*/73728&&li_aria_selected_value!==(li_aria_selected_value=/*_values*/ctx[16].includes(/*option*/ctx[49].value)?"true":"false")){attr(li,"aria-selected",li_aria_selected_value);}if(dirty[0]&/*_options*/8192&&li_data_testid_value!==(li_data_testid_value=`dropdown-item-${/*option*/ctx[49].value}`)){attr(li,"data-testid",li_data_testid_value);}if(dirty[0]&/*_options*/8192&&li_data_index_value!==(li_data_index_value=/*index*/ctx[53])){attr(li,"data-index",li_data_index_value);}if(dirty[0]&/*_options*/8192&&li_data_value_value!==(li_data_value_value=/*option*/ctx[49].value)){attr(li,"data-value",li_data_value_value);}if(dirty[0]&/*_options, _highlightedIndex*/532480){toggle_class(li,"dropdown-item--tabbed",/*index*/ctx[53]===/*_highlightedIndex*/ctx[19]);}if(dirty[0]&/*_values, _options*/73728){toggle_class(li,"dropdown-item--selected",/*_values*/ctx[16].includes(/*option*/ctx[49].value));}},d(detaching){if(detaching)detach(li);mounted=false;dispose();}};}// (247:6) {#each _options as option}
|
|
166
|
+
function create_each_block$7(ctx){let option;let t0_value=/*option*/ctx[49].label+"";let t0;let t1;let option_selected_value;let option_value_value;let option_aria_label_value;return {c(){option=element("option");t0=text(t0_value);t1=space();option.selected=option_selected_value=/*option*/ctx[49].selected;option.__value=option_value_value=/*option*/ctx[49].value;option.value=option.__value;attr(option,"aria-label",option_aria_label_value=/*option*/ctx[49].label);},m(target,anchor){insert(target,option,anchor);append(option,t0);append(option,t1);},p(ctx,dirty){if(dirty[0]&/*_options*/8192&&t0_value!==(t0_value=/*option*/ctx[49].label+""))set_data(t0,t0_value);if(dirty[0]&/*_options*/8192&&option_selected_value!==(option_selected_value=/*option*/ctx[49].selected)){option.selected=option_selected_value;}if(dirty[0]&/*_options*/8192&&option_value_value!==(option_value_value=/*option*/ctx[49].value)){option.__value=option_value_value;option.value=option.__value;}if(dirty[0]&/*_options*/8192&&option_aria_label_value!==(option_aria_label_value=/*option*/ctx[49].label)){attr(option,"aria-label",option_aria_label_value);}},d(detaching){if(detaching)detach(option);}};}function create_fragment$G(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$l;return create_else_block$9;}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=`
|
|
167
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])}
|
|
168
|
+
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[20]}
|
|
169
|
+
`);toggle_class(div,"dropdown-native",/*_native*/ctx[15]);},m(target,anchor){insert(target,div,anchor);if_block.m(div,null);/*div_binding*/ctx[34](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, _computedWidth*/1056288&&div_style_value!==(div_style_value=`
|
|
170
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])}
|
|
171
|
+
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[20]}
|
|
172
|
+
`)){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[34](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
|
|
173
|
+
return rawValues.map(val=>`${val}`);}function instance$C($$self,$$props,$$invalidate){let _disabled;let _error;let _multiselect;let _native;let{name}=$$props;let{arialabel=""}=$$props;let{value=""}=$$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;// Private
|
|
174
174
|
let _values=[];let _options=[];let _selectedLabel="";let _isMenuVisible=false;let _highlightedIndex=0;let _computedWidth;let _el;let _menuEl;let _selectEl;onMount(async()=>{// watch for DOM changes within the slot => dynamic binding
|
|
175
|
-
const slot=_el.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_e=>{$$invalidate(
|
|
175
|
+
const slot=_el.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_e=>{$$invalidate(17,_selectedLabel="");$$invalidate(16,_values=parseValues(value));$$invalidate(13,_options=getOptions());});});onDestroy(()=>{removeKeyboardEventListeners();});// Functions
|
|
176
176
|
function getChildren(){const slot=_el.querySelector("slot");if(slot){// default
|
|
177
177
|
return slot.assignedElements();}// unit tests
|
|
178
178
|
const el=_native?_selectEl:_el;return [...el.children];}// Create a list of the options based on the children within the slot
|
|
179
179
|
// The children don't have to be goa-dropdown-item elements. Any child element
|
|
180
180
|
// work as long as it has a value and label content
|
|
181
|
-
function getOptions(){const children=getChildren();return children.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||value;const selected=_values.includes(value);if(selected){$$invalidate(
|
|
182
|
-
function getCustomDropdownWidth(options){let width;let maxCount=0;if(options.length===0&&placeholder!==""){return `${placeholder.length+12}ch`;}options.forEach(option=>{const label=option.label||option.value||"";if(!width&&maxCount<label.length){maxCount=label.length;width=`${Math.max(20,maxCount+12)}ch`;}});return width;}function addKeyboardEventListeners(){_el.addEventListener("focus",onFocus,true);_el.addEventListener("blur",onBlur,true);}function removeKeyboardEventListeners(){_el.removeEventListener("focus",onFocus,true);_el.removeEventListener("blur",onBlur,true);}async function showMenu(){if(_disabled||_isMenuVisible){return;}$$invalidate(
|
|
181
|
+
function getOptions(){const children=getChildren();return children.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||value;const selected=_values.includes(value);if(selected){$$invalidate(17,_selectedLabel=label);$$invalidate(16,_values=[value]);}return {selected,value,label};});}// compute the required width to enure all children fit
|
|
182
|
+
function getCustomDropdownWidth(options){let width;let maxCount=0;if(options.length===0&&placeholder!==""){return `${placeholder.length+12}ch`;}options.forEach(option=>{const label=option.label||option.value||"";if(!width&&maxCount<label.length){maxCount=label.length;width=`${Math.max(20,maxCount+12)}ch`;}});return width;}function addKeyboardEventListeners(){_el.addEventListener("focus",onFocus,true);_el.addEventListener("blur",onBlur,true);}function removeKeyboardEventListeners(){_el.removeEventListener("focus",onFocus,true);_el.removeEventListener("blur",onBlur,true);}async function showMenu(){if(_disabled||_isMenuVisible){return;}$$invalidate(18,_isMenuVisible=true);await tick();// hide menu on blur
|
|
183
183
|
_menuEl.addEventListener("blur",closeMenu);// bind up/down arrows to navigate options
|
|
184
|
-
_menuEl.addEventListener("mouseover",onHighlight);}function closeMenu(){_menuEl.removeEventListener("blur",closeMenu);_menuEl.removeEventListener("mouseover",onHighlight);setHighlightedIndexToSelected();$$invalidate(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
*/function onSelect(value,label,close){if(_disabled)return;$$invalidate(16,_selectedLabel=label);let detail;if(_multiselect){_values.push(value);detail={name,values:_values};}else {$$invalidate(15,_values=[value]);detail={name,value};}_el.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));if(close){closeMenu();}}const onInputKeyDown=e=>{switch(e.key){case" ":case"Enter":_isMenuVisible?closeMenu():showMenu();_menuEl.focus();e.preventDefault();break;case"Escape":_isMenuVisible&&closeMenu();e.preventDefault();e.stopPropagation();break;case"ArrowDown":if(e.altKey){_isMenuVisible?closeMenu():showMenu();// set menu focus to allow arrow keys to trigger scrolling within option list
|
|
188
|
-
break;}_handleArrowDown();break;case"ArrowUp":if(e.altKey){_isMenuVisible?closeMenu():showMenu();break;}_handleArrowUp();break;}};function _handleArrowDown(){if(_highlightedIndex<_options.length-1){$$invalidate(18,_highlightedIndex++,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}function _handleArrowUp(){if(_highlightedIndex>0){$$invalidate(18,_highlightedIndex--,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}// add required bindings to component
|
|
184
|
+
_menuEl.addEventListener("mouseover",onHighlight);}function closeMenu(){_menuEl.removeEventListener("blur",closeMenu);_menuEl.removeEventListener("mouseover",onHighlight);setHighlightedIndexToSelected();$$invalidate(18,_isMenuVisible=false);}function setHighlightedIndexToSelected(){$$invalidate(19,_highlightedIndex=_options.findIndex(option=>_values.includes(option.value)));}// Event handlers
|
|
185
|
+
function onSelect(value,label,close){if(_disabled)return;$$invalidate(17,_selectedLabel=label);let detail;if(_multiselect){_values.push(value);detail={name,values:_values};}else {$$invalidate(16,_values=[value]);detail={name,value};}_el.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));if(close){closeMenu();}}const onInputKeyDown=e=>{switch(e.key){case" ":case"Enter":_isMenuVisible?closeMenu():showMenu();_menuEl.focus();e.preventDefault();break;case"Escape":_isMenuVisible&&closeMenu();e.preventDefault();e.stopPropagation();break;case"ArrowDown":if(e.altKey){_isMenuVisible?closeMenu():showMenu();// set menu focus to allow arrow keys to trigger scrolling within option list
|
|
186
|
+
break;}_handleArrowDown();break;case"ArrowUp":if(e.altKey){_isMenuVisible?closeMenu():showMenu();break;}_handleArrowUp();break;}};function _handleArrowDown(){if(_highlightedIndex<_options.length-1){$$invalidate(19,_highlightedIndex++,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}function _handleArrowUp(){if(_highlightedIndex>0){$$invalidate(19,_highlightedIndex--,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}// add required bindings to component
|
|
189
187
|
function onFocus(){_el.addEventListener("keydown",onInputKeyDown);}// remove all bindings from component
|
|
190
|
-
function onBlur(){_el.removeEventListener("keydown",onInputKeyDown);}function onHighlight(e){$$invalidate(
|
|
188
|
+
function onBlur(){_el.removeEventListener("keydown",onInputKeyDown);}function onHighlight(e){$$invalidate(19,_highlightedIndex=Number(e.target.dataset.index));}function onNativeSelect(e){const target=e.currentTarget;const option=_options[target.selectedIndex];onSelect(option.value,option.label);}function select_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_selectEl=$$value;$$invalidate(22,_selectEl);((($$invalidate(13,_options),$$invalidate(14,_el)),$$invalidate(28,value)),$$invalidate(15,_native)),$$invalidate(30,native);});}const click_handler=option=>onSelect(option.value,option.label,true);function ul_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_menuEl=$$value;$$invalidate(21,_menuEl);});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_el=$$value;$$invalidate(14,_el);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(0,name=$$props.name);if('arialabel'in $$props)$$invalidate(1,arialabel=$$props.arialabel);if('value'in $$props)$$invalidate(28,value=$$props.value);if('leadingicon'in $$props)$$invalidate(2,leadingicon=$$props.leadingicon);if('maxheight'in $$props)$$invalidate(3,maxheight=$$props.maxheight);if('placeholder'in $$props)$$invalidate(4,placeholder=$$props.placeholder);if('width'in $$props)$$invalidate(5,width=$$props.width);if('disabled'in $$props)$$invalidate(6,disabled=$$props.disabled);if('error'in $$props)$$invalidate(7,error=$$props.error);if('multiselect'in $$props)$$invalidate(29,multiselect=$$props.multiselect);if('native'in $$props)$$invalidate(30,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*/64){$$invalidate(23,_disabled=toBoolean(disabled));}if($$self.$$.dirty[0]&/*error*/128){$$invalidate(24,_error=toBoolean(error));}if($$self.$$.dirty[0]&/*multiselect*/536870912){_multiselect=toBoolean(multiselect);}if($$self.$$.dirty[0]&/*native*/1073741824){$$invalidate(15,_native=toBoolean(native));}if($$self.$$.dirty[0]&/*_el, value, _native, _options*/268492800){{if(_el){$$invalidate(16,_values=parseValues(value));$$invalidate(13,_options=getOptions());if(!_native){$$invalidate(20,_computedWidth=getCustomDropdownWidth(_options));addKeyboardEventListeners();setHighlightedIndexToSelected();}}}}};return [name,arialabel,leadingicon,maxheight,placeholder,width,disabled,error,relative,mt,mr,mb,ml,_options,_el,_native,_values,_selectedLabel,_isMenuVisible,_highlightedIndex,_computedWidth,_menuEl,_selectEl,_disabled,_error,showMenu,onSelect,onNativeSelect,value,multiselect,native,select_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;display:inline-block;width:var(--width, 100%)}.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--tabbed{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item--disabled{opacity:0.5;cursor:default}.dropdown-item--disabled:hover{cursor:default;color:var(--goa-color-greyscale-700)}.dropdown-item--selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item--tabbed.dropdown-item--selected,.dropdown-item--selected:hover{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{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;background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);appearance:none;padding:calc(var(--goa-space-xs) + 2px);padding-left:0.5rem;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$C,create_fragment$G,safe_not_equal,{name:0,arialabel:1,value:28,leadingicon:2,maxheight:3,placeholder:4,width:5,disabled:6,error:7,multiselect:29,native:30,relative:8,mt:9,mr:10,mb:11,ml:12},null,[-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","value","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 value(){return this.$$.ctx[28];}set value(value){this.$$set({value});flush();}get leadingicon(){return this.$$.ctx[2];}set leadingicon(leadingicon){this.$$set({leadingicon});flush();}get maxheight(){return this.$$.ctx[3];}set maxheight(maxheight){this.$$set({maxheight});flush();}get placeholder(){return this.$$.ctx[4];}set placeholder(placeholder){this.$$set({placeholder});flush();}get width(){return this.$$.ctx[5];}set width(width){this.$$set({width});flush();}get disabled(){return this.$$.ctx[6];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[7];}set error(error){this.$$set({error});flush();}get multiselect(){return this.$$.ctx[29];}set multiselect(multiselect){this.$$set({multiselect});flush();}get native(){return this.$$.ctx[30];}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);/* libs/web-components/src/components/dropdown/DropdownItem.svelte generated by Svelte v3.59.2 */function create_fragment$F(ctx){return {c(){this.c=noop;},m:noop,p:noop,i:noop,o:noop,d:noop};}class DropdownItem extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},null,create_fragment$F,safe_not_equal,{},null);if(options){if(options.target){insert(options.target,this,options.anchor);}}}}customElements.define("goa-dropdown-item",DropdownItem);/* libs/web-components/src/components/focus-trap/FocusTrap.svelte generated by Svelte v3.59.2 */function create_fragment$E(ctx){let div;return {c(){div=element("div");div.innerHTML=`<span data-tab-boundry="start" tabindex="0"></span>
|
|
191
189
|
<slot></slot>
|
|
192
190
|
|
|
193
191
|
<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){const element=node;const isTabbable=element.tabIndex>0||element.tabIndex===0&&element.getAttribute('tabIndex')!==null;if(isTabbable)return node;if(element["disabled"])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$B($$self,$$props,$$invalidate){let rootEl;let boundryStartEl;let boundryEndEl;let isShiftPressed;// Hooks
|
|
@@ -292,12 +290,13 @@ function goto(e,offset){const newPage=Number.parseInt(pagenumber+"")+offset;if(n
|
|
|
292
290
|
$$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumber,variant,mt,mr,mb,ml,pageDropdownEl,hiddenEl,_pageCount,goto,itemcount,perpagecount,input_binding,goa_dropdown_binding,click_handler,click_handler_1];}class Pagination extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`span{white-space:nowrap}.controls{display:flex;gap:1rem;flex-direction:column;align-items:center;width:100%}@media(min-width: 480px){.controls{flex-direction:row;justify-content:space-between}}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$n,create_fragment$q,safe_not_equal,{pagenumber:0,itemcount:10,perpagecount:11,variant:1,mt:2,mr:3,mb:4,ml:5},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["pagenumber","itemcount","perpagecount","variant","mt","mr","mb","ml"];}get pagenumber(){return this.$$.ctx[0];}set pagenumber(pagenumber){this.$$set({pagenumber});flush();}get itemcount(){return this.$$.ctx[10];}set itemcount(itemcount){this.$$set({itemcount});flush();}get perpagecount(){return this.$$.ctx[11];}set perpagecount(perpagecount){this.$$set({perpagecount});flush();}get variant(){return this.$$.ctx[1];}set variant(variant){this.$$set({variant});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();}}customElements.define("goa-pagination",Pagination);/* libs/web-components/src/components/popover/Popover.svelte generated by Svelte v3.59.2 */function create_if_block$b(ctx){let div0;let t;let div2;let section;let goa_focus_trap;let div1;let section_style_value;let mounted;let dispose;return {c(){div0=element("div");t=space();div2=element("div");section=element("section");goa_focus_trap=element("goa-focus-trap");div1=element("div");div1.innerHTML=`<slot></slot>`;attr(div0,"data-testid","popover-background");attr(div0,"class","popover-background");set_custom_element_data(goa_focus_trap,"open","true");attr(section,"data-testid","popover-content");attr(section,"class","popover-content");attr(section,"style",section_style_value=`
|
|
293
291
|
${cssVar("width",/*width*/ctx[2])}
|
|
294
292
|
max-width: ${/*maxwidth*/ctx[1]};
|
|
295
|
-
padding: ${/*_padded*/ctx[
|
|
296
|
-
`);attr(div2,"class","popover-container");},m(target,anchor){insert(target,div0,anchor);insert(target,t,anchor);insert(target,div2,anchor);append(div2,section);append(section,goa_focus_trap);append(goa_focus_trap,div1);/*div1_binding*/ctx[
|
|
293
|
+
padding: ${/*_padded*/ctx[18]?"var(--goa-space-m)":"0"};
|
|
294
|
+
`);attr(div2,"class","popover-container");},m(target,anchor){insert(target,div0,anchor);insert(target,t,anchor);insert(target,div2,anchor);append(div2,section);append(section,goa_focus_trap);append(goa_focus_trap,div1);/*div1_binding*/ctx[27](div1);/*section_binding*/ctx[28](section);if(!mounted){dispose=listen(div0,"click",/*closePopover*/ctx[20]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*width, maxwidth, _padded*/262150&§ion_style_value!==(section_style_value=`
|
|
297
295
|
${cssVar("width",/*width*/ctx[2])}
|
|
298
296
|
max-width: ${/*maxwidth*/ctx[1]};
|
|
299
|
-
padding: ${/*_padded*/ctx[
|
|
300
|
-
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[
|
|
297
|
+
padding: ${/*_padded*/ctx[18]?"var(--goa-space-m)":"0"};
|
|
298
|
+
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[27](null);/*section_binding*/ctx[28](null);mounted=false;dispose();}};}function create_fragment$p(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[12]&&create_if_block$b(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=`
|
|
299
|
+
${/*_relative*/ctx[17]&&"position: relative;"}
|
|
301
300
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
302
301
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
303
302
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -305,7 +304,8 @@ $$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumb
|
|
|
305
304
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
306
305
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
307
306
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
308
|
-
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[
|
|
307
|
+
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[26](div0);append(div1,t);if(if_block)if_block.m(div1,null);/*div1_binding_1*/ctx[29](div1);if(!mounted){dispose=listen(div0,"click",/*openPopover*/ctx[19]);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[12]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$b(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]&/*_relative, mt, mr, mb, ml, voffset, hoffset, focusborderwidth, borderradius*/135032&&div1_style_value!==(div1_style_value=`
|
|
308
|
+
${/*_relative*/ctx[17]&&"position: relative;"}
|
|
309
309
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
310
310
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
311
311
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -313,7 +313,7 @@ $$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumb
|
|
|
313
313
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
314
314
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
315
315
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
316
|
-
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[
|
|
316
|
+
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[26](null);if(if_block)if_block.d();/*div1_binding_1*/ctx[29](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$m($$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
|
|
317
317
|
let _rootEl;let _targetEl;let _popoverEl;let _focusTrapEl;let _initFocusedEl;// Hooks
|
|
318
318
|
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
|
|
319
319
|
children=[..._targetEl.children];}_initFocusedEl=children.find(el=>el.tabIndex>=0)||_targetEl;});// Functions
|
|
@@ -334,9 +334,9 @@ const spaceAbove=targetRect.top;const spaceBelow=window.innerHeight-targetRect.b
|
|
|
334
334
|
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
|
|
335
335
|
// account the scroll offset
|
|
336
336
|
const usingNoScroll=document.body.style.overflow==="hidden";const windowOffset=usingNoScroll?0:window.scrollY;// If there's more space above, display the popover above the target element
|
|
337
|
-
$$invalidate(15,_popoverEl.style.top=displayOnTop?`${rootRect.top-contentRect.height+windowOffset}px`:`${rootRect.top+rootRect.height+windowOffset}px`,_popoverEl)
|
|
338
|
-
const displayOnRight=document.body.clientWidth-targetRect.left<contentRect.width&&targetRect.left>contentRect.width
|
|
339
|
-
$$invalidate(
|
|
337
|
+
if(_relative){$$invalidate(15,_popoverEl.style.top=displayOnTop?`-${contentRect.height}px`:`${rootRect.height}px`,_popoverEl);}else {$$invalidate(15,_popoverEl.style.top=displayOnTop?`${rootRect.top-contentRect.height+windowOffset}px`:`${rootRect.top+rootRect.height+windowOffset}px`,_popoverEl);}// Move the popover to the left if it is too far to the right and only if there is space to the left
|
|
338
|
+
const displayOnRight=document.body.clientWidth-targetRect.left<contentRect.width&&targetRect.left>contentRect.width;if(_relative){if(displayOnRight){$$invalidate(15,_popoverEl.style.right="0",_popoverEl);}else {$$invalidate(15,_popoverEl.style.left="0",_popoverEl);}}else {$$invalidate(15,_popoverEl.style.left=displayOnRight?`${rootRect.left+targetRect.width-contentRect.width}px`:`${rootRect.left}px`,_popoverEl);}}function div0_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_targetEl=$$value;$$invalidate(14,_targetEl);});}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_focusTrapEl=$$value;$$invalidate(16,_focusTrapEl);});}function section_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_popoverEl=$$value;$$invalidate(15,_popoverEl);});}function div1_binding_1($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(13,_rootEl);});}$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('maxwidth'in $$props)$$invalidate(1,maxwidth=$$props.maxwidth);if('width'in $$props)$$invalidate(2,width=$$props.width);if('padded'in $$props)$$invalidate(21,padded=$$props.padded);if('position'in $$props)$$invalidate(22,position=$$props.position);if('relative'in $$props)$$invalidate(23,relative=$$props.relative);if('mt'in $$props)$$invalidate(3,mt=$$props.mt);if('mr'in $$props)$$invalidate(4,mr=$$props.mr);if('mb'in $$props)$$invalidate(5,mb=$$props.mb);if('ml'in $$props)$$invalidate(6,ml=$$props.ml);if('open'in $$props)$$invalidate(24,open=$$props.open);if('disabled'in $$props)$$invalidate(25,disabled=$$props.disabled);if('tabindex'in $$props)$$invalidate(7,tabindex=$$props.tabindex);if('voffset'in $$props)$$invalidate(8,voffset=$$props.voffset);if('hoffset'in $$props)$$invalidate(9,hoffset=$$props.hoffset);if('focusborderwidth'in $$props)$$invalidate(10,focusborderwidth=$$props.focusborderwidth);if('borderradius'in $$props)$$invalidate(11,borderradius=$$props.borderradius);};$$self.$$.update=()=>{if($$self.$$.dirty[0]&/*padded*/2097152){// Reactive
|
|
339
|
+
$$invalidate(18,_padded=toBoolean(padded));}if($$self.$$.dirty[0]&/*open*/16777216){$$invalidate(12,_open=toBoolean(open));}if($$self.$$.dirty[0]&/*disabled*/33554432){_disabled=toBoolean(disabled);}if($$self.$$.dirty[0]&/*relative*/8388608){$$invalidate(17,_relative=toBoolean(relative));}if($$self.$$.dirty[0]&/*_open*/4096){(async()=>_open&&(await setPopoverPosition()))();}if($$self.$$.dirty[0]&/*_open*/4096){{if(_open){window.addEventListener("popstate",handleUrlChange,true);}else {window.removeEventListener("popstate",handleUrlChange,true);}}}};return [testid,maxwidth,width,mt,mr,mb,ml,tabindex,voffset,hoffset,focusborderwidth,borderradius,_open,_rootEl,_targetEl,_popoverEl,_focusTrapEl,_relative,_padded,openPopover,closePopover,padded,position,relative,open,disabled,div0_binding,div1_binding,section_binding,div1_binding_1];}class Popover 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;align-items:center}.popover-target{width:fit-content;cursor:pointer}.popover-target:focus{outline:var(--focus-border-width) solid var(--goa-color-interactive-focus)}.popover-content{color:var(--goa-color-text-default);position:absolute;width:fit-content;max-width:260px;list-style-type:none;background:var(--goa-color-greyscale-white);border-radius:var(--border-radius);outline:none;filter:drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));z-index:99;width:max-content;margin-top:var(--offset-top, 3px);margin-bottom:var(--offset-bottom, 3px);margin-left:var(--offset-left, 0);margin-right:var(--offset-right, 0)}::slotted(ul){display:block;padding:0;margin:0;list-style-type:none;line-height:2rem}.popover-background{cursor:default;position:fixed;z-index:98;inset:0}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$m,create_fragment$p,safe_not_equal,{testid:0,maxwidth:1,width:2,padded:21,position:22,relative:23,mt:3,mr:4,mb:5,ml:6,open:24,disabled:25,tabindex:7,voffset:8,hoffset:9,focusborderwidth:10,borderradius:11},null,[-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 ["testid","maxwidth","width","padded","position","relative","mt","mr","mb","ml","open","disabled","tabindex","voffset","hoffset","focusborderwidth","borderradius"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get maxwidth(){return this.$$.ctx[1];}set maxwidth(maxwidth){this.$$set({maxwidth});flush();}get width(){return this.$$.ctx[2];}set width(width){this.$$set({width});flush();}get padded(){return this.$$.ctx[21];}set padded(padded){this.$$set({padded});flush();}get position(){return this.$$.ctx[22];}set position(position){this.$$set({position});flush();}get relative(){return this.$$.ctx[23];}set relative(relative){this.$$set({relative});flush();}get mt(){return this.$$.ctx[3];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[4];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[5];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[6];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[24];}set open(open){this.$$set({open});flush();}get disabled(){return this.$$.ctx[25];}set disabled(disabled){this.$$set({disabled});flush();}get tabindex(){return this.$$.ctx[7];}set tabindex(tabindex){this.$$set({tabindex});flush();}get voffset(){return this.$$.ctx[8];}set voffset(voffset){this.$$set({voffset});flush();}get hoffset(){return this.$$.ctx[9];}set hoffset(hoffset){this.$$set({hoffset});flush();}get focusborderwidth(){return this.$$.ctx[10];}set focusborderwidth(focusborderwidth){this.$$set({focusborderwidth});flush();}get borderradius(){return this.$$.ctx[11];}set borderradius(borderradius){this.$$set({borderradius});flush();}}customElements.define("goa-popover",Popover);/* libs/web-components/src/components/radio-group/RadioGroup.svelte generated by Svelte v3.59.2 */function get_each_context$3(ctx,list,i){const child_ctx=ctx.slice();child_ctx[22]=list[i];return child_ctx;}// (80:2) {#each options as option (option.value)}
|
|
340
340
|
function create_each_block$3(key_1,ctx){let label;let input;let input_value_value;let input_checked_value;let input_aria_label_value;let t0;let div;let t1;let span;let t2_value=(/*option*/ctx[22].label||/*option*/ctx[22].value)+"";let t2;let t3;let label_data_testid_value;let mounted;let dispose;function change_handler(){return(/*change_handler*/ctx[16](/*option*/ctx[22]));}return {key:key_1,first:null,c(){label=element("label");input=element("input");t0=space();div=element("div");t1=space();span=element("span");t2=text(t2_value);t3=space();attr(input,"type","radio");attr(input,"name",/*name*/ctx[1]);input.value=input_value_value=/*option*/ctx[22].value;input.disabled=/*isDisabled*/ctx[12];input.checked=input_checked_value=/*option*/ctx[22].value===/*value*/ctx[0];attr(input,"aria-label",input_aria_label_value=/*arialabel*/ctx[4]||/*name*/ctx[1]);attr(div,"class","goa-radio-icon");attr(span,"class","goa-radio-label");attr(label,"data-testid",label_data_testid_value="radio-option-"+/*option*/ctx[22].value);attr(label,"class","goa-radio");toggle_class(label,"goa-radio--disabled",/*isDisabled*/ctx[12]);toggle_class(label,"goa-radio--error",/*isError*/ctx[11]);this.first=label;},m(target,anchor){insert(target,label,anchor);append(label,input);append(label,t0);append(label,div);append(label,t1);append(label,span);append(span,t2);append(label,t3);if(!mounted){dispose=listen(input,"change",change_handler);mounted=true;}},p(new_ctx,dirty){ctx=new_ctx;if(dirty&/*name*/2){attr(input,"name",/*name*/ctx[1]);}if(dirty&/*options*/512&&input_value_value!==(input_value_value=/*option*/ctx[22].value)){input.value=input_value_value;}if(dirty&/*isDisabled*/4096){input.disabled=/*isDisabled*/ctx[12];}if(dirty&/*options, value*/513&&input_checked_value!==(input_checked_value=/*option*/ctx[22].value===/*value*/ctx[0])){input.checked=input_checked_value;}if(dirty&/*arialabel, name*/18&&input_aria_label_value!==(input_aria_label_value=/*arialabel*/ctx[4]||/*name*/ctx[1])){attr(input,"aria-label",input_aria_label_value);}if(dirty&/*options*/512&&t2_value!==(t2_value=(/*option*/ctx[22].label||/*option*/ctx[22].value)+""))set_data(t2,t2_value);if(dirty&/*options*/512&&label_data_testid_value!==(label_data_testid_value="radio-option-"+/*option*/ctx[22].value)){attr(label,"data-testid",label_data_testid_value);}if(dirty&/*isDisabled*/4096){toggle_class(label,"goa-radio--disabled",/*isDisabled*/ctx[12]);}if(dirty&/*isError*/2048){toggle_class(label,"goa-radio--error",/*isError*/ctx[11]);}},d(detaching){if(detaching)detach(label);mounted=false;dispose();}};}function create_fragment$o(ctx){let div;let slot;let t;let each_blocks=[];let each_1_lookup=new Map();let div_style_value;let div_class_value;let each_value=/*options*/ctx[9];const get_key=ctx=>/*option*/ctx[22].value;for(let i=0;i<each_value.length;i+=1){let child_ctx=get_each_context$3(ctx,each_value,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block$3(key,child_ctx));}return {c(){div=element("div");slot=element("slot");t=space();for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}this.c=noop;attr(div,"style",div_style_value=calculateMargin(/*mt*/ctx[5],/*mr*/ctx[6],/*mb*/ctx[7],/*ml*/ctx[8]));attr(div,"class",div_class_value=`goa-radio-group--${/*orientation*/ctx[2]}`);attr(div,"data-testid",/*testid*/ctx[3]);},m(target,anchor){insert(target,div,anchor);append(div,slot);append(div,t);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(div,null);}}/*div_binding*/ctx[17](div);},p(ctx,[dirty]){if(dirty&/*options, isDisabled, isError, name, value, arialabel, onChange*/14867){each_value=/*options*/ctx[9];each_blocks=update_keyed_each(each_blocks,dirty,get_key,1,ctx,each_value,each_1_lookup,div,destroy_block,create_each_block$3,null,get_each_context$3);}if(dirty&/*mt, mr, mb, ml*/480&&div_style_value!==(div_style_value=calculateMargin(/*mt*/ctx[5],/*mr*/ctx[6],/*mb*/ctx[7],/*ml*/ctx[8]))){attr(div,"style",div_style_value);}if(dirty&/*orientation*/4&&div_class_value!==(div_class_value=`goa-radio-group--${/*orientation*/ctx[2]}`)){attr(div,"class",div_class_value);}if(dirty&/*testid*/8){attr(div,"data-testid",/*testid*/ctx[3]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].d();}/*div_binding*/ctx[17](null);}};}function instance$l($$self,$$props,$$invalidate){let isDisabled;let isError;const[Orientations,validateOrientation]=typeValidator("Radio group orientation",["vertical","horizontal"]);let{name}=$$props;let{value}=$$props;let{orientation="vertical"}=$$props;let{disabled="false"}=$$props;let{error="false"}=$$props;let{testid=""}=$$props;let{arialabel=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let options=[];let el;onMount(async()=>{await tick();$$invalidate(9,options=getOptions());});/**
|
|
341
341
|
* Allows the child elements to be obtainable within unit tests
|
|
342
342
|
* @returns List of child elements
|
|
@@ -1275,7 +1275,8 @@ const GoADropdown = props => {
|
|
|
1275
1275
|
native: props.native,
|
|
1276
1276
|
placeholder: props.placeholder,
|
|
1277
1277
|
"data-testid": props.testId,
|
|
1278
|
-
width: props.width
|
|
1278
|
+
width: props.width,
|
|
1279
|
+
relative: props.relative
|
|
1279
1280
|
}, {
|
|
1280
1281
|
children: props.children
|
|
1281
1282
|
}), void 0);
|
|
@@ -2057,6 +2058,7 @@ const GoAPopover = ({
|
|
|
2057
2058
|
maxWidth,
|
|
2058
2059
|
padded,
|
|
2059
2060
|
position,
|
|
2061
|
+
relative,
|
|
2060
2062
|
children,
|
|
2061
2063
|
mt,
|
|
2062
2064
|
mr,
|
|
@@ -2068,6 +2070,7 @@ const GoAPopover = ({
|
|
|
2068
2070
|
maxwidth: maxWidth,
|
|
2069
2071
|
padded: padded,
|
|
2070
2072
|
position: position,
|
|
2073
|
+
relative: relative,
|
|
2071
2074
|
mt: mt,
|
|
2072
2075
|
mr: mr,
|
|
2073
2076
|
mb: mb,
|
package/react-components.umd.js
CHANGED
|
@@ -155,41 +155,39 @@
|
|
|
155
155
|
goa-container--${/*type*/ctx[0]}
|
|
156
156
|
padding--${/*padding*/ctx[2]}
|
|
157
157
|
accent--${/*accent*/ctx[1]}
|
|
158
|
-
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$F($$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: 480px){.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$F,create_fragment$J,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);/* libs/web-components/src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$I(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$E($$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$E,create_fragment$I,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);/* libs/web-components/src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$H(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$D($$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$D,create_fragment$H,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);/* libs/web-components/src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[48]=list[i];child_ctx[52]=i;return child_ctx;}function get_each_context$7(ctx,list,i){const child_ctx=ctx.slice();child_ctx[48]=list[i];return child_ctx;}// (259:2) {:else}
|
|
159
|
-
function create_else_block$9(ctx){let slot;let t0;let goa_popover;let goa_input;let goa_input_arialabel_value;let goa_input_data_testid_value;let t1;let ul;let each_blocks=[];let each_1_lookup=new Map();let ul_style_value;let goa_popover_width_value;let mounted;let dispose;let each_value_1=/*_options*/ctx[
|
|
158
|
+
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$F($$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: 480px){.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$F,create_fragment$J,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);/* libs/web-components/src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$I(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$E($$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$E,create_fragment$I,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);/* libs/web-components/src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$H(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$D($$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$D,create_fragment$H,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);/* libs/web-components/src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[49]=list[i];child_ctx[53]=i;return child_ctx;}function get_each_context$7(ctx,list,i){const child_ctx=ctx.slice();child_ctx[49]=list[i];return child_ctx;}// (257:2) {:else}
|
|
159
|
+
function create_else_block$9(ctx){let slot;let t0;let goa_popover;let goa_input;let goa_input_arialabel_value;let goa_input_data_testid_value;let t1;let ul;let each_blocks=[];let each_1_lookup=new Map();let ul_style_value;let goa_popover_width_value;let mounted;let dispose;let each_value_1=/*_options*/ctx[13];const get_key=ctx=>/*index*/ctx[53];for(let i=0;i<each_value_1.length;i+=1){let child_ctx=get_each_context_1(ctx,each_value_1,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block_1(key,child_ctx));}return {c(){slot=element("slot");t0=space();goa_popover=element("goa-popover");goa_input=element("goa-input");t1=space();ul=element("ul");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}set_custom_element_data(goa_input,"slot","target");set_custom_element_data(goa_input,"error",/*error*/ctx[7]);set_custom_element_data(goa_input,"disabled",/*disabled*/ctx[6]);set_custom_element_data(goa_input,"leadingicon",/*leadingicon*/ctx[2]);set_custom_element_data(goa_input,"placeholder",/*placeholder*/ctx[4]);set_custom_element_data(goa_input,"aria-controls","menu");set_custom_element_data(goa_input,"aria-expanded",/*_isMenuVisible*/ctx[18]);set_custom_element_data(goa_input,"arialabel",goa_input_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);set_custom_element_data(goa_input,"data-testid",goa_input_data_testid_value=`${/*name*/ctx[0]}-dropdown-input`);set_custom_element_data(goa_input,"readonly","");set_custom_element_data(goa_input,"role","combobox");set_custom_element_data(goa_input,"trailingicon","chevron-down");set_custom_element_data(goa_input,"type","text");set_custom_element_data(goa_input,"value",/*_selectedLabel*/ctx[17]);set_custom_element_data(goa_input,"width","100%");set_custom_element_data(goa_input,"name",/*name*/ctx[0]);attr(ul,"id","menu");attr(ul,"role","listbox");attr(ul,"aria-activedescendant",/*_selectedLabel*/ctx[17]);attr(ul,"data-testid","dropdown-menu");attr(ul,"tabindex","0");attr(ul,"style",ul_style_value=`
|
|
160
160
|
overflow-y: auto;
|
|
161
161
|
max-height: ${/*maxheight*/ctx[3]};
|
|
162
|
-
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[
|
|
162
|
+
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[18]);set_custom_element_data(goa_popover,"padded","false");set_custom_element_data(goa_popover,"width",goa_popover_width_value=/*width*/ctx[5]||/*_computedWidth*/ctx[20]);},m(target,anchor){insert(target,slot,anchor);insert(target,t0,anchor);insert(target,goa_popover,anchor);append(goa_popover,goa_input);append(goa_popover,t1);append(goa_popover,ul);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(ul,null);}}/*ul_binding*/ctx[33](ul);if(!mounted){dispose=listen(goa_input,"click",/*showMenu*/ctx[25]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*error*/128){set_custom_element_data(goa_input,"error",/*error*/ctx[7]);}if(dirty[0]&/*disabled*/64){set_custom_element_data(goa_input,"disabled",/*disabled*/ctx[6]);}if(dirty[0]&/*leadingicon*/4){set_custom_element_data(goa_input,"leadingicon",/*leadingicon*/ctx[2]);}if(dirty[0]&/*placeholder*/16){set_custom_element_data(goa_input,"placeholder",/*placeholder*/ctx[4]);}if(dirty[0]&/*_isMenuVisible*/262144){set_custom_element_data(goa_input,"aria-expanded",/*_isMenuVisible*/ctx[18]);}if(dirty[0]&/*arialabel, name*/3&&goa_input_arialabel_value!==(goa_input_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){set_custom_element_data(goa_input,"arialabel",goa_input_arialabel_value);}if(dirty[0]&/*name*/1&&goa_input_data_testid_value!==(goa_input_data_testid_value=`${/*name*/ctx[0]}-dropdown-input`)){set_custom_element_data(goa_input,"data-testid",goa_input_data_testid_value);}if(dirty[0]&/*_selectedLabel*/131072){set_custom_element_data(goa_input,"value",/*_selectedLabel*/ctx[17]);}if(dirty[0]&/*name*/1){set_custom_element_data(goa_input,"name",/*name*/ctx[0]);}if(dirty[0]&/*_options, _values, _highlightedIndex, onSelect*/67706880){each_value_1=/*_options*/ctx[13];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,null,get_each_context_1);}if(dirty[0]&/*_selectedLabel*/131072){attr(ul,"aria-activedescendant",/*_selectedLabel*/ctx[17]);}if(dirty[0]&/*maxheight*/8&&ul_style_value!==(ul_style_value=`
|
|
163
163
|
overflow-y: auto;
|
|
164
164
|
max-height: ${/*maxheight*/ctx[3]};
|
|
165
|
-
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/64){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);}if(dirty[0]&/*_isMenuVisible*/
|
|
166
|
-
function create_if_block$l(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[
|
|
167
|
-
function create_each_block_1(key_1,ctx){let li;let t0_value=(/*option*/ctx[
|
|
168
|
-
function create_each_block$7(ctx){let option;let t0_value=/*option*/ctx[
|
|
169
|
-
${calculateMargin(/*mt*/ctx[
|
|
170
|
-
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[
|
|
171
|
-
`);toggle_class(div,"dropdown-native",/*_native*/ctx[
|
|
172
|
-
${calculateMargin(/*mt*/ctx[
|
|
173
|
-
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[
|
|
174
|
-
`)){attr(div,"style",div_style_value);}if(dirty[0]&/*_native*/
|
|
175
|
-
return rawValues.map(val=>`${val}`);}function instance$C($$self,$$props,$$invalidate){const showMenu=_async(function(){if(_disabled||_isMenuVisible){return;}$$invalidate(
|
|
165
|
+
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/64){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[6]);}if(dirty[0]&/*relative*/256){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);}if(dirty[0]&/*_isMenuVisible*/262144){set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[18]);}if(dirty[0]&/*width, _computedWidth*/1048608&&goa_popover_width_value!==(goa_popover_width_value=/*width*/ctx[5]||/*_computedWidth*/ctx[20])){set_custom_element_data(goa_popover,"width",goa_popover_width_value);}},d(detaching){if(detaching)detach(slot);if(detaching)detach(t0);if(detaching)detach(goa_popover);for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].d();}/*ul_binding*/ctx[33](null);mounted=false;dispose();}};}// (238:2) {#if _native}
|
|
166
|
+
function create_if_block$l(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[13];let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$7(get_each_context$7(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();}select.disabled=/*_disabled*/ctx[23];attr(select,"aria-label",select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);toggle_class(select,"error",/*_error*/ctx[24]);},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[31](select);if(!mounted){dispose=listen(select,"change",/*onNativeSelect*/ctx[27]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*_options*/8192){each_value=/*_options*/ctx[13];let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$7(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$7(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]&/*_disabled*/8388608){select.disabled=/*_disabled*/ctx[23];}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]&/*_error*/16777216){toggle_class(select,"error",/*_error*/ctx[24]);}},d(detaching){if(detaching)detach(select);destroy_each(each_blocks,detaching);/*select_binding*/ctx[31](null);mounted=false;dispose();}};}// (296:8) {#each _options as option, index (index)}
|
|
167
|
+
function create_each_block_1(key_1,ctx){let li;let t0_value=(/*option*/ctx[49].label||/*option*/ctx[49].value)+"";let t0;let t1;let li_id_value;let li_aria_label_value;let li_aria_selected_value;let li_data_testid_value;let li_data_index_value;let li_data_value_value;let mounted;let dispose;function click_handler(){return(/*click_handler*/ctx[32](/*option*/ctx[49]));}return {key:key_1,first:null,c(){li=element("li");t0=text(t0_value);t1=space();attr(li,"id",li_id_value=/*option*/ctx[49].label);attr(li,"role","option");attr(li,"aria-label",li_aria_label_value=/*option*/ctx[49].label||/*option*/ctx[49].value);attr(li,"aria-selected",li_aria_selected_value=/*_values*/ctx[16].includes(/*option*/ctx[49].value)?"true":"false");attr(li,"class","dropdown-item");attr(li,"data-testid",li_data_testid_value=`dropdown-item-${/*option*/ctx[49].value}`);attr(li,"data-index",li_data_index_value=/*index*/ctx[53]);attr(li,"data-value",li_data_value_value=/*option*/ctx[49].value);set_style(li,"display","block");toggle_class(li,"dropdown-item--disabled",false);toggle_class(li,"dropdown-item--tabbed",/*index*/ctx[53]===/*_highlightedIndex*/ctx[19]);toggle_class(li,"dropdown-item--selected",/*_values*/ctx[16].includes(/*option*/ctx[49].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]&/*_options*/8192&&t0_value!==(t0_value=(/*option*/ctx[49].label||/*option*/ctx[49].value)+""))set_data(t0,t0_value);if(dirty[0]&/*_options*/8192&&li_id_value!==(li_id_value=/*option*/ctx[49].label)){attr(li,"id",li_id_value);}if(dirty[0]&/*_options*/8192&&li_aria_label_value!==(li_aria_label_value=/*option*/ctx[49].label||/*option*/ctx[49].value)){attr(li,"aria-label",li_aria_label_value);}if(dirty[0]&/*_values, _options*/73728&&li_aria_selected_value!==(li_aria_selected_value=/*_values*/ctx[16].includes(/*option*/ctx[49].value)?"true":"false")){attr(li,"aria-selected",li_aria_selected_value);}if(dirty[0]&/*_options*/8192&&li_data_testid_value!==(li_data_testid_value=`dropdown-item-${/*option*/ctx[49].value}`)){attr(li,"data-testid",li_data_testid_value);}if(dirty[0]&/*_options*/8192&&li_data_index_value!==(li_data_index_value=/*index*/ctx[53])){attr(li,"data-index",li_data_index_value);}if(dirty[0]&/*_options*/8192&&li_data_value_value!==(li_data_value_value=/*option*/ctx[49].value)){attr(li,"data-value",li_data_value_value);}if(dirty[0]&/*_options, _highlightedIndex*/532480){toggle_class(li,"dropdown-item--tabbed",/*index*/ctx[53]===/*_highlightedIndex*/ctx[19]);}if(dirty[0]&/*_values, _options*/73728){toggle_class(li,"dropdown-item--selected",/*_values*/ctx[16].includes(/*option*/ctx[49].value));}},d(detaching){if(detaching)detach(li);mounted=false;dispose();}};}// (247:6) {#each _options as option}
|
|
168
|
+
function create_each_block$7(ctx){let option;let t0_value=/*option*/ctx[49].label+"";let t0;let t1;let option_selected_value;let option_value_value;let option_aria_label_value;return {c(){option=element("option");t0=text(t0_value);t1=space();option.selected=option_selected_value=/*option*/ctx[49].selected;option.__value=option_value_value=/*option*/ctx[49].value;option.value=option.__value;attr(option,"aria-label",option_aria_label_value=/*option*/ctx[49].label);},m(target,anchor){insert(target,option,anchor);append(option,t0);append(option,t1);},p(ctx,dirty){if(dirty[0]&/*_options*/8192&&t0_value!==(t0_value=/*option*/ctx[49].label+""))set_data(t0,t0_value);if(dirty[0]&/*_options*/8192&&option_selected_value!==(option_selected_value=/*option*/ctx[49].selected)){option.selected=option_selected_value;}if(dirty[0]&/*_options*/8192&&option_value_value!==(option_value_value=/*option*/ctx[49].value)){option.__value=option_value_value;option.value=option.__value;}if(dirty[0]&/*_options*/8192&&option_aria_label_value!==(option_aria_label_value=/*option*/ctx[49].label)){attr(option,"aria-label",option_aria_label_value);}},d(detaching){if(detaching)detach(option);}};}function create_fragment$G(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$l;return create_else_block$9;}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=`
|
|
169
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])}
|
|
170
|
+
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[20]}
|
|
171
|
+
`);toggle_class(div,"dropdown-native",/*_native*/ctx[15]);},m(target,anchor){insert(target,div,anchor);if_block.m(div,null);/*div_binding*/ctx[34](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, _computedWidth*/1056288&&div_style_value!==(div_style_value=`
|
|
172
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])}
|
|
173
|
+
--width: ${/*width*/ctx[5]||/*_computedWidth*/ctx[20]}
|
|
174
|
+
`)){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[34](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
|
|
175
|
+
return rawValues.map(val=>`${val}`);}function instance$C($$self,$$props,$$invalidate){const showMenu=_async(function(){if(_disabled||_isMenuVisible){return;}$$invalidate(18,_isMenuVisible=true);return _call(tick,function(){// hide menu on blur
|
|
176
176
|
_menuEl.addEventListener("blur",closeMenu);// bind up/down arrows to navigate options
|
|
177
|
-
_menuEl.addEventListener("mouseover",onHighlight);});});let _disabled;let _error;let _multiselect;let _native;let{name}=$$props;let{arialabel=""}=$$props;let{value=""}=$$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{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;// Private
|
|
177
|
+
_menuEl.addEventListener("mouseover",onHighlight);});});let _disabled;let _error;let _multiselect;let _native;let{name}=$$props;let{arialabel=""}=$$props;let{value=""}=$$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;// Private
|
|
178
178
|
let _values=[];let _options=[];let _selectedLabel="";let _isMenuVisible=false;let _highlightedIndex=0;let _computedWidth;let _el;let _menuEl;let _selectEl;onMount(_async(function(){// watch for DOM changes within the slot => dynamic binding
|
|
179
|
-
const slot=_el.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_e=>{$$invalidate(
|
|
179
|
+
const slot=_el.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_e=>{$$invalidate(17,_selectedLabel="");$$invalidate(16,_values=parseValues(value));$$invalidate(13,_options=getOptions());});return _await();}));onDestroy(()=>{removeKeyboardEventListeners();});// Functions
|
|
180
180
|
function getChildren(){const slot=_el.querySelector("slot");if(slot){// default
|
|
181
181
|
return slot.assignedElements();}// unit tests
|
|
182
182
|
const el=_native?_selectEl:_el;return [...el.children];}// Create a list of the options based on the children within the slot
|
|
183
183
|
// The children don't have to be goa-dropdown-item elements. Any child element
|
|
184
184
|
// work as long as it has a value and label content
|
|
185
|
-
function getOptions(){const children=getChildren();return children.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||value;const selected=_values.includes(value);if(selected){$$invalidate(
|
|
186
|
-
function getCustomDropdownWidth(options){let width;let maxCount=0;if(options.length===0&&placeholder!==""){return `${placeholder.length+12}ch`;}options.forEach(option=>{const label=option.label||option.value||"";if(!width&&maxCount<label.length){maxCount=label.length;width=`${Math.max(20,maxCount+12)}ch`;}});return width;}function addKeyboardEventListeners(){_el.addEventListener("focus",onFocus,true);_el.addEventListener("blur",onBlur,true);}function removeKeyboardEventListeners(){_el.removeEventListener("focus",onFocus,true);_el.removeEventListener("blur",onBlur,true);}function closeMenu(){_menuEl.removeEventListener("blur",closeMenu);_menuEl.removeEventListener("mouseover",onHighlight);setHighlightedIndexToSelected();$$invalidate(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*/function onSelect(value,label,close){if(_disabled)return;$$invalidate(16,_selectedLabel=label);let detail;if(_multiselect){_values.push(value);detail={name,values:_values};}else {$$invalidate(15,_values=[value]);detail={name,value};}_el.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));if(close){closeMenu();}}const onInputKeyDown=e=>{switch(e.key){case" ":case"Enter":_isMenuVisible?closeMenu():showMenu();_menuEl.focus();e.preventDefault();break;case"Escape":_isMenuVisible&&closeMenu();e.preventDefault();e.stopPropagation();break;case"ArrowDown":if(e.altKey){_isMenuVisible?closeMenu():showMenu();// set menu focus to allow arrow keys to trigger scrolling within option list
|
|
190
|
-
break;}_handleArrowDown();break;case"ArrowUp":if(e.altKey){_isMenuVisible?closeMenu():showMenu();break;}_handleArrowUp();break;}};function _handleArrowDown(){if(_highlightedIndex<_options.length-1){$$invalidate(18,_highlightedIndex++,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}function _handleArrowUp(){if(_highlightedIndex>0){$$invalidate(18,_highlightedIndex--,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}// add required bindings to component
|
|
185
|
+
function getOptions(){const children=getChildren();return children.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||value;const selected=_values.includes(value);if(selected){$$invalidate(17,_selectedLabel=label);$$invalidate(16,_values=[value]);}return {selected,value,label};});}// compute the required width to enure all children fit
|
|
186
|
+
function getCustomDropdownWidth(options){let width;let maxCount=0;if(options.length===0&&placeholder!==""){return `${placeholder.length+12}ch`;}options.forEach(option=>{const label=option.label||option.value||"";if(!width&&maxCount<label.length){maxCount=label.length;width=`${Math.max(20,maxCount+12)}ch`;}});return width;}function addKeyboardEventListeners(){_el.addEventListener("focus",onFocus,true);_el.addEventListener("blur",onBlur,true);}function removeKeyboardEventListeners(){_el.removeEventListener("focus",onFocus,true);_el.removeEventListener("blur",onBlur,true);}function closeMenu(){_menuEl.removeEventListener("blur",closeMenu);_menuEl.removeEventListener("mouseover",onHighlight);setHighlightedIndexToSelected();$$invalidate(18,_isMenuVisible=false);}function setHighlightedIndexToSelected(){$$invalidate(19,_highlightedIndex=_options.findIndex(option=>_values.includes(option.value)));}// Event handlers
|
|
187
|
+
function onSelect(value,label,close){if(_disabled)return;$$invalidate(17,_selectedLabel=label);let detail;if(_multiselect){_values.push(value);detail={name,values:_values};}else {$$invalidate(16,_values=[value]);detail={name,value};}_el.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));if(close){closeMenu();}}const onInputKeyDown=e=>{switch(e.key){case" ":case"Enter":_isMenuVisible?closeMenu():showMenu();_menuEl.focus();e.preventDefault();break;case"Escape":_isMenuVisible&&closeMenu();e.preventDefault();e.stopPropagation();break;case"ArrowDown":if(e.altKey){_isMenuVisible?closeMenu():showMenu();// set menu focus to allow arrow keys to trigger scrolling within option list
|
|
188
|
+
break;}_handleArrowDown();break;case"ArrowUp":if(e.altKey){_isMenuVisible?closeMenu():showMenu();break;}_handleArrowUp();break;}};function _handleArrowDown(){if(_highlightedIndex<_options.length-1){$$invalidate(19,_highlightedIndex++,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}function _handleArrowUp(){if(_highlightedIndex>0){$$invalidate(19,_highlightedIndex--,_highlightedIndex);onSelect(_options[_highlightedIndex].value,_options[_highlightedIndex].label,false);}}// add required bindings to component
|
|
191
189
|
function onFocus(){_el.addEventListener("keydown",onInputKeyDown);}// remove all bindings from component
|
|
192
|
-
function onBlur(){_el.removeEventListener("keydown",onInputKeyDown);}function onHighlight(e){$$invalidate(
|
|
190
|
+
function onBlur(){_el.removeEventListener("keydown",onInputKeyDown);}function onHighlight(e){$$invalidate(19,_highlightedIndex=Number(e.target.dataset.index));}function onNativeSelect(e){const target=e.currentTarget;const option=_options[target.selectedIndex];onSelect(option.value,option.label);}function select_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_selectEl=$$value;$$invalidate(22,_selectEl);((($$invalidate(13,_options),$$invalidate(14,_el)),$$invalidate(28,value)),$$invalidate(15,_native)),$$invalidate(30,native);});}const click_handler=option=>onSelect(option.value,option.label,true);function ul_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_menuEl=$$value;$$invalidate(21,_menuEl);});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_el=$$value;$$invalidate(14,_el);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(0,name=$$props.name);if('arialabel'in $$props)$$invalidate(1,arialabel=$$props.arialabel);if('value'in $$props)$$invalidate(28,value=$$props.value);if('leadingicon'in $$props)$$invalidate(2,leadingicon=$$props.leadingicon);if('maxheight'in $$props)$$invalidate(3,maxheight=$$props.maxheight);if('placeholder'in $$props)$$invalidate(4,placeholder=$$props.placeholder);if('width'in $$props)$$invalidate(5,width=$$props.width);if('disabled'in $$props)$$invalidate(6,disabled=$$props.disabled);if('error'in $$props)$$invalidate(7,error=$$props.error);if('multiselect'in $$props)$$invalidate(29,multiselect=$$props.multiselect);if('native'in $$props)$$invalidate(30,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*/64){$$invalidate(23,_disabled=toBoolean(disabled));}if($$self.$$.dirty[0]&/*error*/128){$$invalidate(24,_error=toBoolean(error));}if($$self.$$.dirty[0]&/*multiselect*/536870912){_multiselect=toBoolean(multiselect);}if($$self.$$.dirty[0]&/*native*/1073741824){$$invalidate(15,_native=toBoolean(native));}if($$self.$$.dirty[0]&/*_el, value, _native, _options*/268492800){{if(_el){$$invalidate(16,_values=parseValues(value));$$invalidate(13,_options=getOptions());if(!_native){$$invalidate(20,_computedWidth=getCustomDropdownWidth(_options));addKeyboardEventListeners();setHighlightedIndexToSelected();}}}}};return [name,arialabel,leadingicon,maxheight,placeholder,width,disabled,error,relative,mt,mr,mb,ml,_options,_el,_native,_values,_selectedLabel,_isMenuVisible,_highlightedIndex,_computedWidth,_menuEl,_selectEl,_disabled,_error,showMenu,onSelect,onNativeSelect,value,multiselect,native,select_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;display:inline-block;width:var(--width, 100%)}.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--tabbed{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item--disabled{opacity:0.5;cursor:default}.dropdown-item--disabled:hover{cursor:default;color:var(--goa-color-greyscale-700)}.dropdown-item--selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item--tabbed.dropdown-item--selected,.dropdown-item--selected:hover{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{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;background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);appearance:none;padding:calc(var(--goa-space-xs) + 2px);padding-left:0.5rem;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$C,create_fragment$G,safe_not_equal,{name:0,arialabel:1,value:28,leadingicon:2,maxheight:3,placeholder:4,width:5,disabled:6,error:7,multiselect:29,native:30,relative:8,mt:9,mr:10,mb:11,ml:12},null,[-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","value","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 value(){return this.$$.ctx[28];}set value(value){this.$$set({value});flush();}get leadingicon(){return this.$$.ctx[2];}set leadingicon(leadingicon){this.$$set({leadingicon});flush();}get maxheight(){return this.$$.ctx[3];}set maxheight(maxheight){this.$$set({maxheight});flush();}get placeholder(){return this.$$.ctx[4];}set placeholder(placeholder){this.$$set({placeholder});flush();}get width(){return this.$$.ctx[5];}set width(width){this.$$set({width});flush();}get disabled(){return this.$$.ctx[6];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[7];}set error(error){this.$$set({error});flush();}get multiselect(){return this.$$.ctx[29];}set multiselect(multiselect){this.$$set({multiselect});flush();}get native(){return this.$$.ctx[30];}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);/* libs/web-components/src/components/dropdown/DropdownItem.svelte generated by Svelte v3.59.2 */function create_fragment$F(ctx){return {c(){this.c=noop;},m:noop,p:noop,i:noop,o:noop,d:noop};}class DropdownItem extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},null,create_fragment$F,safe_not_equal,{},null);if(options){if(options.target){insert(options.target,this,options.anchor);}}}}customElements.define("goa-dropdown-item",DropdownItem);/* libs/web-components/src/components/focus-trap/FocusTrap.svelte generated by Svelte v3.59.2 */function create_fragment$E(ctx){let div;return {c(){div=element("div");div.innerHTML=`<span data-tab-boundry="start" tabindex="0"></span>
|
|
193
191
|
<slot></slot>
|
|
194
192
|
|
|
195
193
|
<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){const element=node;const isTabbable=element.tabIndex>0||element.tabIndex===0&&element.getAttribute('tabIndex')!==null;if(isTabbable)return node;if(element["disabled"])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$B($$self,$$props,$$invalidate){let rootEl;let boundryStartEl;let boundryEndEl;let isShiftPressed;// Hooks
|
|
@@ -294,12 +292,13 @@
|
|
|
294
292
|
$$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumber,variant,mt,mr,mb,ml,pageDropdownEl,hiddenEl,_pageCount,goto,itemcount,perpagecount,input_binding,goa_dropdown_binding,click_handler,click_handler_1];}class Pagination extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`span{white-space:nowrap}.controls{display:flex;gap:1rem;flex-direction:column;align-items:center;width:100%}@media(min-width: 480px){.controls{flex-direction:row;justify-content:space-between}}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$n,create_fragment$q,safe_not_equal,{pagenumber:0,itemcount:10,perpagecount:11,variant:1,mt:2,mr:3,mb:4,ml:5},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["pagenumber","itemcount","perpagecount","variant","mt","mr","mb","ml"];}get pagenumber(){return this.$$.ctx[0];}set pagenumber(pagenumber){this.$$set({pagenumber});flush();}get itemcount(){return this.$$.ctx[10];}set itemcount(itemcount){this.$$set({itemcount});flush();}get perpagecount(){return this.$$.ctx[11];}set perpagecount(perpagecount){this.$$set({perpagecount});flush();}get variant(){return this.$$.ctx[1];}set variant(variant){this.$$set({variant});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();}}customElements.define("goa-pagination",Pagination);/* libs/web-components/src/components/popover/Popover.svelte generated by Svelte v3.59.2 */function create_if_block$b(ctx){let div0;let t;let div2;let section;let goa_focus_trap;let div1;let section_style_value;let mounted;let dispose;return {c(){div0=element("div");t=space();div2=element("div");section=element("section");goa_focus_trap=element("goa-focus-trap");div1=element("div");div1.innerHTML=`<slot></slot>`;attr(div0,"data-testid","popover-background");attr(div0,"class","popover-background");set_custom_element_data(goa_focus_trap,"open","true");attr(section,"data-testid","popover-content");attr(section,"class","popover-content");attr(section,"style",section_style_value=`
|
|
295
293
|
${cssVar("width",/*width*/ctx[2])}
|
|
296
294
|
max-width: ${/*maxwidth*/ctx[1]};
|
|
297
|
-
padding: ${/*_padded*/ctx[
|
|
298
|
-
`);attr(div2,"class","popover-container");},m(target,anchor){insert(target,div0,anchor);insert(target,t,anchor);insert(target,div2,anchor);append(div2,section);append(section,goa_focus_trap);append(goa_focus_trap,div1);/*div1_binding*/ctx[
|
|
295
|
+
padding: ${/*_padded*/ctx[18]?"var(--goa-space-m)":"0"};
|
|
296
|
+
`);attr(div2,"class","popover-container");},m(target,anchor){insert(target,div0,anchor);insert(target,t,anchor);insert(target,div2,anchor);append(div2,section);append(section,goa_focus_trap);append(goa_focus_trap,div1);/*div1_binding*/ctx[27](div1);/*section_binding*/ctx[28](section);if(!mounted){dispose=listen(div0,"click",/*closePopover*/ctx[20]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*width, maxwidth, _padded*/262150&§ion_style_value!==(section_style_value=`
|
|
299
297
|
${cssVar("width",/*width*/ctx[2])}
|
|
300
298
|
max-width: ${/*maxwidth*/ctx[1]};
|
|
301
|
-
padding: ${/*_padded*/ctx[
|
|
302
|
-
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[
|
|
299
|
+
padding: ${/*_padded*/ctx[18]?"var(--goa-space-m)":"0"};
|
|
300
|
+
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[27](null);/*section_binding*/ctx[28](null);mounted=false;dispose();}};}function create_fragment$p(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[12]&&create_if_block$b(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=`
|
|
301
|
+
${/*_relative*/ctx[17]&&"position: relative;"}
|
|
303
302
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
304
303
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
305
304
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -307,7 +306,8 @@
|
|
|
307
306
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
308
307
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
309
308
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
310
|
-
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[
|
|
309
|
+
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[26](div0);append(div1,t);if(if_block)if_block.m(div1,null);/*div1_binding_1*/ctx[29](div1);if(!mounted){dispose=listen(div0,"click",/*openPopover*/ctx[19]);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[12]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$b(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]&/*_relative, mt, mr, mb, ml, voffset, hoffset, focusborderwidth, borderradius*/135032&&div1_style_value!==(div1_style_value=`
|
|
310
|
+
${/*_relative*/ctx[17]&&"position: relative;"}
|
|
311
311
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
312
312
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
313
313
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -315,14 +315,14 @@
|
|
|
315
315
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
316
316
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
317
317
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
318
|
-
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[
|
|
318
|
+
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[26](null);if(if_block)if_block.d();/*div1_binding_1*/ctx[29](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$m($$self,$$props,$$invalidate){const setPopoverPosition=function setPopoverPosition(){return _call(tick,function(){// Get target and content rectangles
|
|
319
319
|
const rootRect=_rootEl.getBoundingClientRect();const targetRect=getBoundingClientRectWithMargins(_targetEl);const contentRect=getBoundingClientRectWithMargins(_popoverEl);// Calculate available space above and below the target element
|
|
320
320
|
const spaceAbove=targetRect.top;const spaceBelow=window.innerHeight-targetRect.bottom;// Determine if there's more space above or below the target element
|
|
321
321
|
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
|
|
322
322
|
// account the scroll offset
|
|
323
323
|
const usingNoScroll=document.body.style.overflow==="hidden";const windowOffset=usingNoScroll?0:window.scrollY;// If there's more space above, display the popover above the target element
|
|
324
|
-
$$invalidate(15,_popoverEl.style.top=displayOnTop?`${rootRect.top-contentRect.height+windowOffset}px`:`${rootRect.top+rootRect.height+windowOffset}px`,_popoverEl)
|
|
325
|
-
const displayOnRight=document.body.clientWidth-targetRect.left<contentRect.width&&targetRect.left>contentRect.width
|
|
324
|
+
if(_relative){$$invalidate(15,_popoverEl.style.top=displayOnTop?`-${contentRect.height}px`:`${rootRect.height}px`,_popoverEl);}else {$$invalidate(15,_popoverEl.style.top=displayOnTop?`${rootRect.top-contentRect.height+windowOffset}px`:`${rootRect.top+rootRect.height+windowOffset}px`,_popoverEl);}// Move the popover to the left if it is too far to the right and only if there is space to the left
|
|
325
|
+
const displayOnRight=document.body.clientWidth-targetRect.left<contentRect.width&&targetRect.left>contentRect.width;if(_relative){if(displayOnRight){$$invalidate(15,_popoverEl.style.right="0",_popoverEl);}else {$$invalidate(15,_popoverEl.style.left="0",_popoverEl);}}else {$$invalidate(15,_popoverEl.style.left=displayOnRight?`${rootRect.left+targetRect.width-contentRect.width}px`:`${rootRect.left}px`,_popoverEl);}});};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
|
|
326
326
|
let _rootEl;let _targetEl;let _popoverEl;let _focusTrapEl;let _initFocusedEl;// Hooks
|
|
327
327
|
onMount(function(){return _call(tick,function(){_targetEl.addEventListener("keydown",onTargetEvent);const slot=_targetEl.querySelector("slot");let children;if(slot){children=slot.assignedElements();}else {// for unit tests only
|
|
328
328
|
children=[..._targetEl.children];}_initFocusedEl=children.find(el=>el.tabIndex>=0)||_targetEl;});});// Functions
|
|
@@ -337,8 +337,8 @@
|
|
|
337
337
|
function openPopover(){if(_disabled)return;_async(function(){$$invalidate(12,_open=true);return _call(tick,function(){_focusTrapEl.addEventListener("keydown",onFocusTrapEvent,true);_rootEl.dispatchEvent(new CustomEvent("_open",{composed:true}));});})();}// Ensures that upon closing of the popover that the element that triggered
|
|
338
338
|
// the popover to be shown re-attains focus and that any window event binding
|
|
339
339
|
// is removed (it may not have been added if target was clicked)
|
|
340
|
-
function closePopover(){_initFocusedEl.focus();$$invalidate(12,_open=false);window.removeEventListener("popstate",handleUrlChange,true);_rootEl.dispatchEvent(new CustomEvent("_close",{composed:true}));}function div0_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_targetEl=$$value;$$invalidate(14,_targetEl);});}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_focusTrapEl=$$value;$$invalidate(16,_focusTrapEl);});}function section_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_popoverEl=$$value;$$invalidate(15,_popoverEl);});}function div1_binding_1($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(13,_rootEl);});}$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('maxwidth'in $$props)$$invalidate(1,maxwidth=$$props.maxwidth);if('width'in $$props)$$invalidate(2,width=$$props.width);if('padded'in $$props)$$invalidate(
|
|
341
|
-
$$invalidate(
|
|
340
|
+
function closePopover(){_initFocusedEl.focus();$$invalidate(12,_open=false);window.removeEventListener("popstate",handleUrlChange,true);_rootEl.dispatchEvent(new CustomEvent("_close",{composed:true}));}function div0_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_targetEl=$$value;$$invalidate(14,_targetEl);});}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_focusTrapEl=$$value;$$invalidate(16,_focusTrapEl);});}function section_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_popoverEl=$$value;$$invalidate(15,_popoverEl);});}function div1_binding_1($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(13,_rootEl);});}$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('maxwidth'in $$props)$$invalidate(1,maxwidth=$$props.maxwidth);if('width'in $$props)$$invalidate(2,width=$$props.width);if('padded'in $$props)$$invalidate(21,padded=$$props.padded);if('position'in $$props)$$invalidate(22,position=$$props.position);if('relative'in $$props)$$invalidate(23,relative=$$props.relative);if('mt'in $$props)$$invalidate(3,mt=$$props.mt);if('mr'in $$props)$$invalidate(4,mr=$$props.mr);if('mb'in $$props)$$invalidate(5,mb=$$props.mb);if('ml'in $$props)$$invalidate(6,ml=$$props.ml);if('open'in $$props)$$invalidate(24,open=$$props.open);if('disabled'in $$props)$$invalidate(25,disabled=$$props.disabled);if('tabindex'in $$props)$$invalidate(7,tabindex=$$props.tabindex);if('voffset'in $$props)$$invalidate(8,voffset=$$props.voffset);if('hoffset'in $$props)$$invalidate(9,hoffset=$$props.hoffset);if('focusborderwidth'in $$props)$$invalidate(10,focusborderwidth=$$props.focusborderwidth);if('borderradius'in $$props)$$invalidate(11,borderradius=$$props.borderradius);};$$self.$$.update=()=>{if($$self.$$.dirty[0]&/*padded*/2097152){// Reactive
|
|
341
|
+
$$invalidate(18,_padded=toBoolean(padded));}if($$self.$$.dirty[0]&/*open*/16777216){$$invalidate(12,_open=toBoolean(open));}if($$self.$$.dirty[0]&/*disabled*/33554432){_disabled=toBoolean(disabled);}if($$self.$$.dirty[0]&/*relative*/8388608){$$invalidate(17,_relative=toBoolean(relative));}if($$self.$$.dirty[0]&/*_open*/4096){_async(function(){const _open2=_open;return _open2&&setPopoverPosition();})();}if($$self.$$.dirty[0]&/*_open*/4096){{if(_open){window.addEventListener("popstate",handleUrlChange,true);}else {window.removeEventListener("popstate",handleUrlChange,true);}}}};return [testid,maxwidth,width,mt,mr,mb,ml,tabindex,voffset,hoffset,focusborderwidth,borderradius,_open,_rootEl,_targetEl,_popoverEl,_focusTrapEl,_relative,_padded,openPopover,closePopover,padded,position,relative,open,disabled,div0_binding,div1_binding,section_binding,div1_binding_1];}class Popover 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;align-items:center}.popover-target{width:fit-content;cursor:pointer}.popover-target:focus{outline:var(--focus-border-width) solid var(--goa-color-interactive-focus)}.popover-content{color:var(--goa-color-text-default);position:absolute;width:fit-content;max-width:260px;list-style-type:none;background:var(--goa-color-greyscale-white);border-radius:var(--border-radius);outline:none;filter:drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));z-index:99;width:max-content;margin-top:var(--offset-top, 3px);margin-bottom:var(--offset-bottom, 3px);margin-left:var(--offset-left, 0);margin-right:var(--offset-right, 0)}::slotted(ul){display:block;padding:0;margin:0;list-style-type:none;line-height:2rem}.popover-background{cursor:default;position:fixed;z-index:98;inset:0}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$m,create_fragment$p,safe_not_equal,{testid:0,maxwidth:1,width:2,padded:21,position:22,relative:23,mt:3,mr:4,mb:5,ml:6,open:24,disabled:25,tabindex:7,voffset:8,hoffset:9,focusborderwidth:10,borderradius:11},null,[-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 ["testid","maxwidth","width","padded","position","relative","mt","mr","mb","ml","open","disabled","tabindex","voffset","hoffset","focusborderwidth","borderradius"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get maxwidth(){return this.$$.ctx[1];}set maxwidth(maxwidth){this.$$set({maxwidth});flush();}get width(){return this.$$.ctx[2];}set width(width){this.$$set({width});flush();}get padded(){return this.$$.ctx[21];}set padded(padded){this.$$set({padded});flush();}get position(){return this.$$.ctx[22];}set position(position){this.$$set({position});flush();}get relative(){return this.$$.ctx[23];}set relative(relative){this.$$set({relative});flush();}get mt(){return this.$$.ctx[3];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[4];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[5];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[6];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[24];}set open(open){this.$$set({open});flush();}get disabled(){return this.$$.ctx[25];}set disabled(disabled){this.$$set({disabled});flush();}get tabindex(){return this.$$.ctx[7];}set tabindex(tabindex){this.$$set({tabindex});flush();}get voffset(){return this.$$.ctx[8];}set voffset(voffset){this.$$set({voffset});flush();}get hoffset(){return this.$$.ctx[9];}set hoffset(hoffset){this.$$set({hoffset});flush();}get focusborderwidth(){return this.$$.ctx[10];}set focusborderwidth(focusborderwidth){this.$$set({focusborderwidth});flush();}get borderradius(){return this.$$.ctx[11];}set borderradius(borderradius){this.$$set({borderradius});flush();}}customElements.define("goa-popover",Popover);/* libs/web-components/src/components/radio-group/RadioGroup.svelte generated by Svelte v3.59.2 */function get_each_context$3(ctx,list,i){const child_ctx=ctx.slice();child_ctx[22]=list[i];return child_ctx;}// (80:2) {#each options as option (option.value)}
|
|
342
342
|
function create_each_block$3(key_1,ctx){let label;let input;let input_value_value;let input_checked_value;let input_aria_label_value;let t0;let div;let t1;let span;let t2_value=(/*option*/ctx[22].label||/*option*/ctx[22].value)+"";let t2;let t3;let label_data_testid_value;let mounted;let dispose;function change_handler(){return(/*change_handler*/ctx[16](/*option*/ctx[22]));}return {key:key_1,first:null,c(){label=element("label");input=element("input");t0=space();div=element("div");t1=space();span=element("span");t2=text(t2_value);t3=space();attr(input,"type","radio");attr(input,"name",/*name*/ctx[1]);input.value=input_value_value=/*option*/ctx[22].value;input.disabled=/*isDisabled*/ctx[12];input.checked=input_checked_value=/*option*/ctx[22].value===/*value*/ctx[0];attr(input,"aria-label",input_aria_label_value=/*arialabel*/ctx[4]||/*name*/ctx[1]);attr(div,"class","goa-radio-icon");attr(span,"class","goa-radio-label");attr(label,"data-testid",label_data_testid_value="radio-option-"+/*option*/ctx[22].value);attr(label,"class","goa-radio");toggle_class(label,"goa-radio--disabled",/*isDisabled*/ctx[12]);toggle_class(label,"goa-radio--error",/*isError*/ctx[11]);this.first=label;},m(target,anchor){insert(target,label,anchor);append(label,input);append(label,t0);append(label,div);append(label,t1);append(label,span);append(span,t2);append(label,t3);if(!mounted){dispose=listen(input,"change",change_handler);mounted=true;}},p(new_ctx,dirty){ctx=new_ctx;if(dirty&/*name*/2){attr(input,"name",/*name*/ctx[1]);}if(dirty&/*options*/512&&input_value_value!==(input_value_value=/*option*/ctx[22].value)){input.value=input_value_value;}if(dirty&/*isDisabled*/4096){input.disabled=/*isDisabled*/ctx[12];}if(dirty&/*options, value*/513&&input_checked_value!==(input_checked_value=/*option*/ctx[22].value===/*value*/ctx[0])){input.checked=input_checked_value;}if(dirty&/*arialabel, name*/18&&input_aria_label_value!==(input_aria_label_value=/*arialabel*/ctx[4]||/*name*/ctx[1])){attr(input,"aria-label",input_aria_label_value);}if(dirty&/*options*/512&&t2_value!==(t2_value=(/*option*/ctx[22].label||/*option*/ctx[22].value)+""))set_data(t2,t2_value);if(dirty&/*options*/512&&label_data_testid_value!==(label_data_testid_value="radio-option-"+/*option*/ctx[22].value)){attr(label,"data-testid",label_data_testid_value);}if(dirty&/*isDisabled*/4096){toggle_class(label,"goa-radio--disabled",/*isDisabled*/ctx[12]);}if(dirty&/*isError*/2048){toggle_class(label,"goa-radio--error",/*isError*/ctx[11]);}},d(detaching){if(detaching)detach(label);mounted=false;dispose();}};}function create_fragment$o(ctx){let div;let slot;let t;let each_blocks=[];let each_1_lookup=new Map();let div_style_value;let div_class_value;let each_value=/*options*/ctx[9];const get_key=ctx=>/*option*/ctx[22].value;for(let i=0;i<each_value.length;i+=1){let child_ctx=get_each_context$3(ctx,each_value,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block$3(key,child_ctx));}return {c(){div=element("div");slot=element("slot");t=space();for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}this.c=noop;attr(div,"style",div_style_value=calculateMargin(/*mt*/ctx[5],/*mr*/ctx[6],/*mb*/ctx[7],/*ml*/ctx[8]));attr(div,"class",div_class_value=`goa-radio-group--${/*orientation*/ctx[2]}`);attr(div,"data-testid",/*testid*/ctx[3]);},m(target,anchor){insert(target,div,anchor);append(div,slot);append(div,t);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(div,null);}}/*div_binding*/ctx[17](div);},p(ctx,[dirty]){if(dirty&/*options, isDisabled, isError, name, value, arialabel, onChange*/14867){each_value=/*options*/ctx[9];each_blocks=update_keyed_each(each_blocks,dirty,get_key,1,ctx,each_value,each_1_lookup,div,destroy_block,create_each_block$3,null,get_each_context$3);}if(dirty&/*mt, mr, mb, ml*/480&&div_style_value!==(div_style_value=calculateMargin(/*mt*/ctx[5],/*mr*/ctx[6],/*mb*/ctx[7],/*ml*/ctx[8]))){attr(div,"style",div_style_value);}if(dirty&/*orientation*/4&&div_class_value!==(div_class_value=`goa-radio-group--${/*orientation*/ctx[2]}`)){attr(div,"class",div_class_value);}if(dirty&/*testid*/8){attr(div,"data-testid",/*testid*/ctx[3]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].d();}/*div_binding*/ctx[17](null);}};}function instance$l($$self,$$props,$$invalidate){let isDisabled;let isError;const[Orientations,validateOrientation]=typeValidator("Radio group orientation",["vertical","horizontal"]);let{name}=$$props;let{value}=$$props;let{orientation="vertical"}=$$props;let{disabled="false"}=$$props;let{error="false"}=$$props;let{testid=""}=$$props;let{arialabel=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let options=[];let el;onMount(function(){return _call(tick,function(){$$invalidate(9,options=getOptions());});});/**
|
|
343
343
|
* Allows the child elements to be obtainable within unit tests
|
|
344
344
|
* @returns List of child elements
|
|
@@ -1306,7 +1306,8 @@
|
|
|
1306
1306
|
native: props.native,
|
|
1307
1307
|
placeholder: props.placeholder,
|
|
1308
1308
|
"data-testid": props.testId,
|
|
1309
|
-
width: props.width
|
|
1309
|
+
width: props.width,
|
|
1310
|
+
relative: props.relative
|
|
1310
1311
|
}, {
|
|
1311
1312
|
children: props.children
|
|
1312
1313
|
}), void 0);
|
|
@@ -2050,6 +2051,7 @@
|
|
|
2050
2051
|
maxWidth = _a.maxWidth,
|
|
2051
2052
|
padded = _a.padded,
|
|
2052
2053
|
position = _a.position,
|
|
2054
|
+
relative = _a.relative,
|
|
2053
2055
|
children = _a.children,
|
|
2054
2056
|
mt = _a.mt,
|
|
2055
2057
|
mr = _a.mr,
|
|
@@ -2060,6 +2062,7 @@
|
|
|
2060
2062
|
maxwidth: maxWidth,
|
|
2061
2063
|
padded: padded,
|
|
2062
2064
|
position: position,
|
|
2065
|
+
relative: relative,
|
|
2063
2066
|
mt: mt,
|
|
2064
2067
|
mr: mr,
|
|
2065
2068
|
mb: mb,
|