@abgov/react-components 4.15.1 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/react-components.esm.js +73 -88
- package/react-components.umd.js +75 -90
package/react-components.esm.js
CHANGED
|
@@ -26,10 +26,6 @@ if(ownerNode)detach(ownerNode);});managed_styles.clear();});}let current_compone
|
|
|
26
26
|
*
|
|
27
27
|
* https://svelte.dev/docs#run-time-svelte-onmount
|
|
28
28
|
*/function onMount(fn){get_current_component().$$.on_mount.push(fn);}/**
|
|
29
|
-
* Schedules a callback to run immediately after the component has been updated.
|
|
30
|
-
*
|
|
31
|
-
* The first time the callback runs will be after the initial `onMount`
|
|
32
|
-
*/function afterUpdate(fn){get_current_component().$$.after_update.push(fn);}/**
|
|
33
29
|
* Schedules a callback to run immediately before the component is unmounted.
|
|
34
30
|
*
|
|
35
31
|
* Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the
|
|
@@ -106,11 +102,11 @@ if(!is_function(callback)){return noop;}const callbacks=this.$$.callbacks[type]|
|
|
|
106
102
|
function create_if_block_5$1(ctx){let a;let img0;let img0_src_value;let t0;let img1;let img1_src_value;let t1;let if_block=/*heading*/ctx[0]&&create_if_block_6$1(ctx);return {c(){a=element("a");img0=element("img");t0=space();img1=element("img");t1=space();if(if_block)if_block.c();attr(img0,"alt","GoA Logo");attr(img0,"class","image-mobile");if(!src_url_equal(img0.src,img0_src_value=_mobileLogo))attr(img0,"src",img0_src_value);attr(img1,"alt","GoA Logo");attr(img1,"class","image-desktop");if(!src_url_equal(img1.src,img1_src_value=_desktopLogo))attr(img1,"src",img1_src_value);attr(a,"href",/*url*/ctx[1]);attr(a,"class","header-logo-title-area");attr(a,"data-testid","url");},m(target,anchor){insert(target,a,anchor);append(a,img0);append(a,t0);append(a,img1);append(a,t1);if(if_block)if_block.m(a,null);},p(ctx,dirty){if(/*heading*/ctx[0]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block_6$1(ctx);if_block.c();if_block.m(a,null);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty&/*url*/2){attr(a,"href",/*url*/ctx[1]);}},d(detaching){if(detaching)detach(a);if(if_block)if_block.d();}};}// (102:8) {#if heading}
|
|
107
103
|
function create_if_block_7$1(ctx){let span;let t;return {c(){span=element("span");t=text(/*heading*/ctx[0]);attr(span,"data-testid","title");attr(span,"class","title");},m(target,anchor){insert(target,span,anchor);append(span,t);},p(ctx,dirty){if(dirty&/*heading*/1)set_data(t,/*heading*/ctx[0]);},d(detaching){if(detaching)detach(span);}};}// (94:8) {#if heading}
|
|
108
104
|
function create_if_block_6$1(ctx){let span;let t;return {c(){span=element("span");t=text(/*heading*/ctx[0]);attr(span,"data-testid","title");attr(span,"class","title");},m(target,anchor){insert(target,span,anchor);append(span,t);},p(ctx,dirty){if(dirty&/*heading*/1)set_data(t,/*heading*/ctx[0]);},d(detaching){if(detaching)detach(span);}};}// (109:4) {#if _showToggleMenu && _mobile}
|
|
109
|
-
function create_if_block_4$
|
|
110
|
-
function create_if_block_2$e(ctx){let goa_popover;let div;let button;let t0;let goa_icon;let goa_icon_type_value;let t1;let mounted;let dispose;let if_block=/*_showMenu*/ctx[8]&&create_if_block_3$
|
|
111
|
-
function create_if_block_3$
|
|
105
|
+
function create_if_block_4$4(ctx){let button;let t;let goa_icon;let goa_icon_type_value;let mounted;let dispose;return {c(){button=element("button");t=text("Menu ");goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"type",goa_icon_type_value=/*_showMenu*/ctx[8]?"chevron-up":"chevron-down");set_custom_element_data(goa_icon,"mt","1");attr(button,"class","menu-toggle-area");attr(button,"data-testid","menu-toggle");},m(target,anchor){insert(target,button,anchor);append(button,t);append(button,goa_icon);if(!mounted){dispose=listen(button,"click",/*toggleMenu*/ctx[11]);mounted=true;}},p(ctx,dirty){if(dirty&/*_showMenu*/256&&goa_icon_type_value!==(goa_icon_type_value=/*_showMenu*/ctx[8]?"chevron-up":"chevron-down")){set_custom_element_data(goa_icon,"type",goa_icon_type_value);}},d(detaching){if(detaching)detach(button);mounted=false;dispose();}};}// (116:4) {#if _showToggleMenu && _tablet}
|
|
106
|
+
function create_if_block_2$e(ctx){let goa_popover;let div;let button;let t0;let goa_icon;let goa_icon_type_value;let t1;let mounted;let dispose;let if_block=/*_showMenu*/ctx[8]&&create_if_block_3$b(ctx);return {c(){goa_popover=element("goa-popover");div=element("div");button=element("button");t0=text("Menu ");goa_icon=element("goa-icon");t1=space();if(if_block)if_block.c();set_custom_element_data(goa_icon,"type",goa_icon_type_value=/*_showMenu*/ctx[8]?"chevron-up":"chevron-down");set_custom_element_data(goa_icon,"mt","1");attr(button,"class","menu-toggle-area");attr(button,"data-testid","menu-toggle");attr(div,"slot","target");set_custom_element_data(goa_popover,"class","menu");set_custom_element_data(goa_popover,"open",/*_showMenu*/ctx[8]);set_custom_element_data(goa_popover,"context","app-header-menu");set_custom_element_data(goa_popover,"focusborderwidth","0");set_custom_element_data(goa_popover,"borderradius","0");set_custom_element_data(goa_popover,"padded","false");set_custom_element_data(goa_popover,"width","16rem");set_custom_element_data(goa_popover,"tabindex","-1");set_custom_element_data(goa_popover,"position","below");},m(target,anchor){insert(target,goa_popover,anchor);append(goa_popover,div);append(div,button);append(button,t0);append(button,goa_icon);append(goa_popover,t1);if(if_block)if_block.m(goa_popover,null);if(!mounted){dispose=[listen(button,"click",/*toggleMenu*/ctx[11]),listen(goa_popover,"_close",/*hideMenu*/ctx[12])];mounted=true;}},p(ctx,dirty){if(dirty&/*_showMenu*/256&&goa_icon_type_value!==(goa_icon_type_value=/*_showMenu*/ctx[8]?"chevron-up":"chevron-down")){set_custom_element_data(goa_icon,"type",goa_icon_type_value);}if(/*_showMenu*/ctx[8]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block_3$b(ctx);if_block.c();if_block.m(goa_popover,null);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty&/*_showMenu*/256){set_custom_element_data(goa_popover,"open",/*_showMenu*/ctx[8]);}},d(detaching){if(detaching)detach(goa_popover);if(if_block)if_block.d();mounted=false;run_all(dispose);}};}// (135:8) {#if _showMenu}
|
|
107
|
+
function create_if_block_3$b(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;attr(div,"data-testid","slot");},m(target,anchor){insert(target,div,anchor);/*div_binding*/ctx[14](div);},p:noop,d(detaching){if(detaching)detach(div);/*div_binding*/ctx[14](null);}};}// (148:4) {#if !_showMenu && (_mobile || _tablet)}
|
|
112
108
|
function create_if_block_1$i(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;set_style(div,"display","none");},m(target,anchor){insert(target,div,anchor);/*div_binding_1*/ctx[15](div);},p:noop,d(detaching){if(detaching)detach(div);/*div_binding_1*/ctx[15](null);}};}// (155:4) {#if _showMenu && _mobile || _desktop}
|
|
113
|
-
function create_if_block$v(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;attr(div,"data-testid","slot");attr(div,"class","content-area");},m(target,anchor){insert(target,div,anchor);/*div_binding_2*/ctx[16](div);},p:noop,d(detaching){if(detaching)detach(div);/*div_binding_2*/ctx[16](null);}};}function create_fragment$_(ctx){let div1;let div0;let t0;let t1;let t2;let t3;let div1_style_value;let mounted;let dispose;add_render_callback(/*onwindowresize*/ctx[13]);function select_block_type(ctx,dirty){if(/*url*/ctx[1])return create_if_block_5$1;return create_else_block$d;}let current_block_type=select_block_type(ctx);let if_block0=current_block_type(ctx);let if_block1=/*_showToggleMenu*/ctx[7]&&/*_mobile*/ctx[10]&&create_if_block_4$
|
|
109
|
+
function create_if_block$v(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;attr(div,"data-testid","slot");attr(div,"class","content-area");},m(target,anchor){insert(target,div,anchor);/*div_binding_2*/ctx[16](div);},p:noop,d(detaching){if(detaching)detach(div);/*div_binding_2*/ctx[16](null);}};}function create_fragment$_(ctx){let div1;let div0;let t0;let t1;let t2;let t3;let div1_style_value;let mounted;let dispose;add_render_callback(/*onwindowresize*/ctx[13]);function select_block_type(ctx,dirty){if(/*url*/ctx[1])return create_if_block_5$1;return create_else_block$d;}let current_block_type=select_block_type(ctx);let if_block0=current_block_type(ctx);let if_block1=/*_showToggleMenu*/ctx[7]&&/*_mobile*/ctx[10]&&create_if_block_4$4(ctx);let if_block2=/*_showToggleMenu*/ctx[7]&&/*_tablet*/ctx[9]&&create_if_block_2$e(ctx);let if_block3=!/*_showMenu*/ctx[8]&&(/*_mobile*/ctx[10]||/*_tablet*/ctx[9])&&create_if_block_1$i(ctx);let if_block4=(/*_showMenu*/ctx[8]&&/*_mobile*/ctx[10]||/*_desktop*/ctx[5])&&create_if_block$v(ctx);return {c(){div1=element("div");div0=element("div");if_block0.c();t0=space();if(if_block1)if_block1.c();t1=space();if(if_block2)if_block2.c();t2=space();if(if_block3)if_block3.c();t3=space();if(if_block4)if_block4.c();this.c=noop;attr(div0,"class","layout");attr(div1,"class","container");attr(div1,"data-testid",/*testid*/ctx[2]);attr(div1,"style",div1_style_value=`--max-content-width: ${/*maxcontentwidth*/ctx[3]||"100%"}`);toggle_class(div1,"show-menu",/*_showMenu*/ctx[8]);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);if_block0.m(div0,null);append(div0,t0);if(if_block1)if_block1.m(div0,null);append(div0,t1);if(if_block2)if_block2.m(div0,null);append(div0,t2);if(if_block3)if_block3.m(div0,null);append(div0,t3);if(if_block4)if_block4.m(div0,null);if(!mounted){dispose=listen(window_1$2,"resize",/*onwindowresize*/ctx[13]);mounted=true;}},p(ctx,[dirty]){if(current_block_type===(current_block_type=select_block_type(ctx))&&if_block0){if_block0.p(ctx,dirty);}else {if_block0.d(1);if_block0=current_block_type(ctx);if(if_block0){if_block0.c();if_block0.m(div0,t0);}}if(/*_showToggleMenu*/ctx[7]&&/*_mobile*/ctx[10]){if(if_block1){if_block1.p(ctx,dirty);}else {if_block1=create_if_block_4$4(ctx);if_block1.c();if_block1.m(div0,t1);}}else if(if_block1){if_block1.d(1);if_block1=null;}if(/*_showToggleMenu*/ctx[7]&&/*_tablet*/ctx[9]){if(if_block2){if_block2.p(ctx,dirty);}else {if_block2=create_if_block_2$e(ctx);if_block2.c();if_block2.m(div0,t2);}}else if(if_block2){if_block2.d(1);if_block2=null;}if(!/*_showMenu*/ctx[8]&&(/*_mobile*/ctx[10]||/*_tablet*/ctx[9])){if(if_block3){if_block3.p(ctx,dirty);}else {if_block3=create_if_block_1$i(ctx);if_block3.c();if_block3.m(div0,t3);}}else if(if_block3){if_block3.d(1);if_block3=null;}if(/*_showMenu*/ctx[8]&&/*_mobile*/ctx[10]||/*_desktop*/ctx[5]){if(if_block4){if_block4.p(ctx,dirty);}else {if_block4=create_if_block$v(ctx);if_block4.c();if_block4.m(div0,null);}}else if(if_block4){if_block4.d(1);if_block4=null;}if(dirty&/*testid*/4){attr(div1,"data-testid",/*testid*/ctx[2]);}if(dirty&/*maxcontentwidth*/8&&div1_style_value!==(div1_style_value=`--max-content-width: ${/*maxcontentwidth*/ctx[3]||"100%"}`)){attr(div1,"style",div1_style_value);}if(dirty&/*_showMenu*/256){toggle_class(div1,"show-menu",/*_showMenu*/ctx[8]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);if_block0.d();if(if_block1)if_block1.d();if(if_block2)if_block2.d();if(if_block3)if_block3.d();if(if_block4)if_block4.d();mounted=false;dispose();}};}const _mobileLogo="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='32' height='32' viewBox='0 0 16 16'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;%7D.b%7Bfill:%2300aad2;%7D.c%7Bclip-path:url(%23a);%7D.d%7Bfill:%23fff;%7D%3C/style%3E%3CclipPath id='a'%3E%3Crect class='a' width='14' height='14' transform='translate(-0.345 -0.21)'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg transform='translate(0 -0.135)'%3E%3Ccircle class='b' cx='8' cy='8' r='8' transform='translate(0 0.135)'/%3E%3Cg transform='translate(1.345 1.344)'%3E%3Cg class='c' transform='translate(0 0)'%3E%3Cpath class='d' d='M12.612,13.636a16.24,16.24,0,0,1-1.86-.822,13.436,13.436,0,0,0,1.6-.708,11.312,11.312,0,0,0,.264,1.53M16.032,7.3c-.266-.034-.128.091-.2.442a5.465,5.465,0,0,1-2.8,3.338,16.141,16.141,0,0,1,.249-4.84c.275-1,.6-.813.2-1.022-.427-.22-.887.071-1.258.813A27.247,27.247,0,0,1,7.4,13.522a2.141,2.141,0,0,1-2.918.461c-.206-.174-.282.095-.026.37a2.412,2.412,0,0,0,3.387-.082A32.715,32.715,0,0,0,12.219,7.51a23.541,23.541,0,0,0,.063,3.971,11.464,11.464,0,0,1-1.964.749c-.388.1-.628.26-.635.439-.007.2.253.363.63.541.67.318,2.633,1.246,3.117,1.527.414.24.616.053.739-.207.16-.338-.279-.533-.7-.661a13.175,13.175,0,0,1-.382-2.179,7.143,7.143,0,0,0,2.547-2.454,4.7,4.7,0,0,0,.4-1.133,2.125,2.125,0,0,0,.048-.742s-.007-.054-.048-.059' transform='translate(-3.51 -3.943)'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E";const _desktopLogo="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='149.351' height='42' viewBox='0 0 149.351 42'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;%7D.b%7Bclip-path:url(%23a);%7D.c%7Bfill:%2300aad2;%7D.d%7Bfill:%235f6a72;%7D%3C/style%3E%3CclipPath id='a'%3E%3Crect class='a' width='149.351' height='42'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg class='b'%3E%3Crect class='c' width='13.555' height='13.555' transform='translate(135.796 21.524)'/%3E%3Cpath class='d' d='M63.082,33.088c-1.383.138-2.835.277-4.357.346.553-4.357,2.835-10.373,5.671-9.405,1.66.553.761,5.671-1.314,9.059m-3.527,2.974a3.761,3.761,0,0,1-1.245,0,.851.851,0,0,0,.346-.692v-.553c.761,0,1.936-.138,3.389-.277a4.327,4.327,0,0,1-2.49,1.521M76.844,25.688c1.8-1.66,2.7-1.521,2.9-1.106.484.968-1.591,4.357-5.671,6.224a10.328,10.328,0,0,1,2.766-5.118m66.736,1.66c-.207-3.389-3.181-3.942-3.6-2.974-.138.346,1.106.207,1.106,2.628,0,3.942-4.011,9.129-9.129,9.129-5.532,0-6.985-4.357-7.261-6.432-.207-1.452.138-3.458-2.351-3.181-1.729.207-3.25,3.527-5.463,6.362-1.867,2.42-2.7,2.213-2.282.138.553-2.628,2.7-8.714,5.187-9.129,1.176-.207,1.591,1.8,2.075.553s.069-4.011-2.559-4.011c-1.8,0-3.942,1.936-5.74,4.08-1.521,1.936-9.336,13.416-12.656,10.927-1.521-1.176-1.383-5.878-.415-11.411,3.873-1.521,7.123-1.037,8.921-.138.9.415,1.037.346.622-.622-.553-1.452-3.665-3.734-8.575-2.7-.138,0-.207.069-.346.069.415-1.8.83-3.665,1.383-5.463.484-1.66,1.8-4.5-1.729-4.979-1.106-.207-.622.346-1.037,1.867-.692,2.766-1.521,6.362-2.144,10.028a19.745,19.745,0,0,0-7.538,8.091,38.59,38.59,0,0,0,.9-4.772,1.589,1.589,0,0,0-1.245-1.729c-.761-.207-1.729.138-2.628,1.452-2.144,3.043-4.841,7.815-8.99,9.82-2.974,1.452-4.288,0-4.357-2.282a9.869,9.869,0,0,0,1.521-.553c5.394-2.351,7.192-5.947,5.878-8.16-1.314-2.075-4.979-1.452-7.953,1.66a11.175,11.175,0,0,0-2.7,6.5c-1.245.277-2.628.484-4.219.692,2.49-4.08,2.282-9.613-1.383-10.581-4.288-1.106-6.432,3.043-7.331,6.5.346-3.873.9-7.745,1.591-11.549.346-1.66,1.452-4.5-2.075-4.979-1.106-.207-.968.346-.9,1.867.138,2.075-2.144,14.454-.968,19.848-1.521.484-2.144,1.66-.207,2.835,1.383.83,4.357,1.106,7.331-.346a9.3,9.3,0,0,0,2.766-2.144c1.8-.207,3.665-.553,5.394-.83.277,2.42,1.867,4.219,5.463,3.873,5.118-.484,9.682-6.777,11.411-9.82-.346,3.25-2.42,10.373,1.176,10.028,1.383-.138.83-.346.9-1.591.346-4.288,3.873-7.953,7.4-10.166-.622,5.256-.415,9.958,2.006,11.411,4.426,2.766,10.581-4.5,14.039-8.921-1.729,3.942-2.7,8.921-.138,9.682,3.043.9,5.463-4.219,8.3-8.091.346,2.766,2.213,7.607,9.682,7.607,8.022-.069,13.071-4.91,12.863-10.1m-108.3,8.645A66.439,66.439,0,0,1,27.4,32.534a59.168,59.168,0,0,0,6.777-2.974,54.453,54.453,0,0,0,1.106,6.432m20.4,3.873c-.069-.207-.622.069-1.106,0-1.452-.207-3.389-2.213-3.942-5.463-1.037-5.878-.415-11.687,1.314-20.332.346-1.66,1.452-4.5-2.075-5.048-1.106-.138-.553.415-.83,1.867C47.66,17.32,42.4,21.954,37.149,25.066,36.6,17.735,36.8,9.505,38.186,4.526c1.176-4.219,2.559-3.458.83-4.357s-3.734.277-5.325,3.458S24.839,23.89,13.221,35.439C7.273,41.317,1.879,38.274.842,37.375c-.9-.761-1.176.415-.138,1.591,4.772,5.256,11.826,2.282,14.384-.277,7.054-7.054,15.283-22.268,18.6-28.7a98.251,98.251,0,0,0,.277,16.874,50.129,50.129,0,0,1-8.3,3.181c-1.66.415-2.7,1.106-2.7,1.867s1.106,1.521,2.7,2.282c2.835,1.383,11.2,5.256,13.209,6.5,1.729,1.037,2.628.207,3.112-.9.692-1.452-1.176-2.282-2.974-2.766a60.545,60.545,0,0,1-1.66-9.267c4.219-2.628,8.437-6.086,10.788-10.443C47.522,20.916,46,33.3,49.873,38.482a5.451,5.451,0,0,0,4.564,2.213c.968-.069,1.383-.692,1.245-.83' transform='translate(-0.038 0.124)'/%3E%3C/g%3E%3C/svg%3E";function instance$U($$self,$$props,$$invalidate){let _mobile;let _tablet;let _desktop;let{heading=""}=$$props;let{url=""}=$$props;let{testid=""}=$$props;let{maxcontentwidth=""}=$$props;let _slotParentEl;let _windowWidth=window.innerWidth;let _showToggleMenu=false;let _showMenu=false;// Functions
|
|
114
110
|
const toggleMenu=()=>$$invalidate(8,_showMenu=!_showMenu);const hideMenu=()=>$$invalidate(8,_showMenu=false);// Hooks
|
|
115
111
|
onMount(()=>{window.addEventListener("popstate",()=>{// only hide menu for non-desktop screens
|
|
116
112
|
setCurrentLink();if(!_desktop){hideMenu();}},true);setCurrentLink();});// Update component if the current browser url matches one of this element's child links
|
|
@@ -151,10 +147,10 @@ return [name,text,value,testid,arialabel,description,mt,mr,mb,ml,_checkboxRef,_d
|
|
|
151
147
|
function create_if_block$q(ctx){let goa_icon;let goa_icon_fillcolor_value;let goa_icon_opacity_value;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","delete-icon");set_custom_element_data(goa_icon,"size","medium");set_custom_element_data(goa_icon,"theme","filled");set_custom_element_data(goa_icon,"type","close-circle");set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value=/*_error*/ctx[10]?"var(--goa-color-emergency-default)":/*_hovering*/ctx[9]?"var(--goa-color-interactive-hover)":"var(--goa-color-greyscale-700)");set_custom_element_data(goa_icon,"opacity",goa_icon_opacity_value=/*_error*/ctx[10]?/*_hovering*/ctx[9]?1:0.5:1);},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty&/*_error, _hovering*/1536&&goa_icon_fillcolor_value!==(goa_icon_fillcolor_value=/*_error*/ctx[10]?"var(--goa-color-emergency-default)":/*_hovering*/ctx[9]?"var(--goa-color-interactive-hover)":"var(--goa-color-greyscale-700)")){set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value);}if(dirty&/*_error, _hovering*/1536&&goa_icon_opacity_value!==(goa_icon_opacity_value=/*_error*/ctx[10]?/*_hovering*/ctx[9]?1:0.5:1)){set_custom_element_data(goa_icon,"opacity",goa_icon_opacity_value);}},d(detaching){if(detaching)detach(goa_icon);}};}function create_fragment$O(ctx){let div1;let t0;let div0;let t1;let t2;let div1_style_value;let mounted;let dispose;let if_block0=/*leadingicon*/ctx[4]&&create_if_block_1$e(ctx);let if_block1=/*_deletable*/ctx[11]&&create_if_block$q(ctx);return {c(){div1=element("div");if(if_block0)if_block0.c();t0=space();div0=element("div");t1=text(/*content*/ctx[5]);t2=space();if(if_block1)if_block1.c();this.c=noop;attr(div0,"class","text");attr(div1,"data-testid",/*testid*/ctx[7]);attr(div1,"class","chip");attr(div1,"style",div1_style_value=calculateMargin(/*mt*/ctx[0],/*mr*/ctx[1],/*mb*/ctx[2],/*ml*/ctx[3]));attr(div1,"tabindex","0");toggle_class(div1,"deletable",/*_deletable*/ctx[11]);toggle_class(div1,"error",/*_error*/ctx[10]);toggle_class(div1,"variant",/*variant*/ctx[6]);},m(target,anchor){insert(target,div1,anchor);if(if_block0)if_block0.m(div1,null);append(div1,t0);append(div1,div0);append(div0,t1);append(div1,t2);if(if_block1)if_block1.m(div1,null);/*div1_binding*/ctx[15](div1);if(!mounted){dispose=[listen(div1,"click",/*click_handler*/ctx[16]),listen(div1,"mouseover",/*mouseover_handler*/ctx[17]),listen(div1,"mouseout",/*mouseout_handler*/ctx[18]),listen(div1,"focus",/*focus_handler*/ctx[19]),listen(div1,"blur",/*blur_handler*/ctx[20])];mounted=true;}},p(ctx,[dirty]){if(/*leadingicon*/ctx[4]){if(if_block0){if_block0.p(ctx,dirty);}else {if_block0=create_if_block_1$e(ctx);if_block0.c();if_block0.m(div1,t0);}}else if(if_block0){if_block0.d(1);if_block0=null;}if(dirty&/*content*/32)set_data(t1,/*content*/ctx[5]);if(/*_deletable*/ctx[11]){if(if_block1){if_block1.p(ctx,dirty);}else {if_block1=create_if_block$q(ctx);if_block1.c();if_block1.m(div1,null);}}else if(if_block1){if_block1.d(1);if_block1=null;}if(dirty&/*testid*/128){attr(div1,"data-testid",/*testid*/ctx[7]);}if(dirty&/*mt, mr, mb, ml*/15&&div1_style_value!==(div1_style_value=calculateMargin(/*mt*/ctx[0],/*mr*/ctx[1],/*mb*/ctx[2],/*ml*/ctx[3]))){attr(div1,"style",div1_style_value);}if(dirty&/*_deletable*/2048){toggle_class(div1,"deletable",/*_deletable*/ctx[11]);}if(dirty&/*_error*/1024){toggle_class(div1,"error",/*_error*/ctx[10]);}if(dirty&/*variant*/64){toggle_class(div1,"variant",/*variant*/ctx[6]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);if(if_block0)if_block0.d();if(if_block1)if_block1.d();/*div1_binding*/ctx[15](null);mounted=false;run_all(dispose);}};}function instance$L($$self,$$props,$$invalidate){let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{leadingicon=null}=$$props;let{error="false"}=$$props;let{deletable="false"}=$$props;let{content}=$$props;let{variant}=$$props;let{testid=""}=$$props;let el;let _hovering=false;// booleans
|
|
152
148
|
let _error;let _deletable;function onDelete(e){el.dispatchEvent(new CustomEvent("_click",{composed:true,bubbles:true}));e.stopPropagation();}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{el=$$value;$$invalidate(8,el);});}const click_handler=e=>_deletable&&onDelete(e);const mouseover_handler=()=>$$invalidate(9,_hovering=true);const mouseout_handler=()=>$$invalidate(9,_hovering=false);const focus_handler=()=>$$invalidate(9,_hovering=false);const blur_handler=()=>$$invalidate(9,_hovering=false);$$self.$$set=$$props=>{if('mt'in $$props)$$invalidate(0,mt=$$props.mt);if('mr'in $$props)$$invalidate(1,mr=$$props.mr);if('mb'in $$props)$$invalidate(2,mb=$$props.mb);if('ml'in $$props)$$invalidate(3,ml=$$props.ml);if('leadingicon'in $$props)$$invalidate(4,leadingicon=$$props.leadingicon);if('error'in $$props)$$invalidate(13,error=$$props.error);if('deletable'in $$props)$$invalidate(14,deletable=$$props.deletable);if('content'in $$props)$$invalidate(5,content=$$props.content);if('variant'in $$props)$$invalidate(6,variant=$$props.variant);if('testid'in $$props)$$invalidate(7,testid=$$props.testid);};$$self.$$.update=()=>{if($$self.$$.dirty&/*error*/8192){$$invalidate(10,_error=toBoolean(error));}if($$self.$$.dirty&/*deletable*/16384){$$invalidate(11,_deletable=toBoolean(deletable));}};return [mt,mr,mb,ml,leadingicon,content,variant,testid,el,_hovering,_error,_deletable,onDelete,error,deletable,div1_binding,click_handler,mouseover_handler,mouseout_handler,focus_handler,blur_handler];}class Chip extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`.leading-icon{margin-left:-0.25rem}.chip{vertical-align:middle;align-items:center;background-color:var(--goa-color-greyscale-white);border-radius:99px;border:1px solid #949494;box-sizing:border-box;color:var(--goa-color-text-default);display:inline-flex;flex-direction:row;font-size:var(--goa-font-size-3);font-weight:var(--goa-font-weight-regular);gap:0.25rem;height:2rem;justify-content:center;padding:0 0.75rem;cursor:default}.text{padding-bottom:var(--font-valign-fix, 0)}.chip:focus{outline:2px solid var(--goa-color-interactive-focus);background-color:var(--goa-color-greyscale-white)}.chip:hover{background-color:var(--goa-color-greyscale-200)}.deletable{cursor:pointer}.delete-icon{margin-right:-0.25rem}.error,.error:hover{background-color:var(--goa-color-emergency-light)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$L,create_fragment$O,safe_not_equal,{mt:0,mr:1,mb:2,ml:3,leadingicon:4,error:13,deletable:14,content:5,variant:6,testid: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 ["mt","mr","mb","ml","leadingicon","error","deletable","content","variant","testid"];}get mt(){return this.$$.ctx[0];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[1];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[2];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[3];}set ml(ml){this.$$set({ml});flush();}get leadingicon(){return this.$$.ctx[4];}set leadingicon(leadingicon){this.$$set({leadingicon});flush();}get error(){return this.$$.ctx[13];}set error(error){this.$$set({error});flush();}get deletable(){return this.$$.ctx[14];}set deletable(deletable){this.$$set({deletable});flush();}get content(){return this.$$.ctx[5];}set content(content){this.$$set({content});flush();}get variant(){return this.$$.ctx[6];}set variant(variant){this.$$set({variant});flush();}get testid(){return this.$$.ctx[7];}set testid(testid){this.$$set({testid});flush();}}customElements.define("goa-chip",Chip);function cubicOut(t){const f=t-1.0;return f*f*f+1.0;}function quartOut(t){return Math.pow(t-1.0,3.0)*(1.0-t)+1.0;}function fade(node,{delay=0,duration=400,easing=identity}={}){const o=+getComputedStyle(node).opacity;return {delay,duration,easing,css:t=>`opacity: ${t*o}`};}function fly(node,{delay=0,duration=400,easing=cubicOut,x=0,y=0,opacity=0}={}){const style=getComputedStyle(node);const target_opacity=+style.opacity;const transform=style.transform==='none'?'':style.transform;const od=target_opacity*(1-opacity);const[xValue,xUnit]=split_css_unit(x);const[yValue,yUnit]=split_css_unit(y);return {delay,duration,easing,css:(t,u)=>`
|
|
153
149
|
transform: ${transform} translate(${(1-t)*xValue}${xUnit}, ${(1-t)*yValue}${yUnit});
|
|
154
|
-
opacity: ${target_opacity-od*u}`};}function noscroll(_node,opts){let toggledScrolling=false;function hideScrollbars(){if(!isScrollable()){return;}const scrollbarWidth=calculateScrollbarWidth();toggledScrolling=true;document.body.style.overflow="hidden";document.body.style.paddingRight=scrollbarWidth+"px";}function isScrollable(){return document.body.style.overflow!=="hidden";}function resetScrollbars(){if(!toggledScrolling){return;}toggledScrolling=false;setTimeout(()=>{document.body.style.overflow="";document.body.style.paddingRight="0";},200);}function calculateScrollbarWidth(){if(document.body.clientHeight<=document.documentElement.clientHeight){return 0;}const outer=document.createElement("div");outer.style.visibility="hidden";outer.style.overflow="scroll";document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;outer.parentNode.removeChild(outer);return scrollbarWidth;}if(opts.enable){hideScrollbars();}return {update(){if(!opts.enable){resetScrollbars();}},destroy(){resetScrollbars();}};}/* src/components/circular-progress/CircularProgress.svelte generated by Svelte v3.59.2 */function create_if_block$p(ctx){let current_block_type_index;let if_block;let if_block_anchor;let current;const if_block_creators=[create_if_block_1$d,create_if_block_3$
|
|
155
|
-
function create_if_block_3$
|
|
150
|
+
opacity: ${target_opacity-od*u}`};}function noscroll(_node,opts){let toggledScrolling=false;function hideScrollbars(){if(!isScrollable()){return;}const scrollbarWidth=calculateScrollbarWidth();toggledScrolling=true;document.body.style.overflow="hidden";document.body.style.paddingRight=scrollbarWidth+"px";}function isScrollable(){return document.body.style.overflow!=="hidden";}function resetScrollbars(){if(!toggledScrolling){return;}toggledScrolling=false;setTimeout(()=>{document.body.style.overflow="";document.body.style.paddingRight="0";},200);}function calculateScrollbarWidth(){if(document.body.clientHeight<=document.documentElement.clientHeight){return 0;}const outer=document.createElement("div");outer.style.visibility="hidden";outer.style.overflow="scroll";document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;outer.parentNode.removeChild(outer);return scrollbarWidth;}if(opts.enable){hideScrollbars();}return {update(){if(!opts.enable){resetScrollbars();}},destroy(){resetScrollbars();}};}/* src/components/circular-progress/CircularProgress.svelte generated by Svelte v3.59.2 */function create_if_block$p(ctx){let current_block_type_index;let if_block;let if_block_anchor;let current;const if_block_creators=[create_if_block_1$d,create_if_block_3$a];const if_blocks=[];function select_block_type(ctx,dirty){if(/*fullscreen*/ctx[3])return 0;if(/*inline*/ctx[4])return 1;return -1;}if(~(current_block_type_index=select_block_type(ctx))){if_block=if_blocks[current_block_type_index]=if_block_creators[current_block_type_index](ctx);}return {c(){if(if_block)if_block.c();if_block_anchor=empty();},m(target,anchor){if(~current_block_type_index){if_blocks[current_block_type_index].m(target,anchor);}insert(target,if_block_anchor,anchor);current=true;},p(ctx,dirty){let previous_block_index=current_block_type_index;current_block_type_index=select_block_type(ctx);if(current_block_type_index===previous_block_index){if(~current_block_type_index){if_blocks[current_block_type_index].p(ctx,dirty);}}else {if(if_block){group_outros();transition_out(if_blocks[previous_block_index],1,1,()=>{if_blocks[previous_block_index]=null;});check_outros();}if(~current_block_type_index){if_block=if_blocks[current_block_type_index];if(!if_block){if_block=if_blocks[current_block_type_index]=if_block_creators[current_block_type_index](ctx);if_block.c();}else {if_block.p(ctx,dirty);}transition_in(if_block,1);if_block.m(if_block_anchor.parentNode,if_block_anchor);}else {if_block=null;}}},i(local){if(current)return;transition_in(if_block);current=true;},o(local){transition_out(if_block);current=false;},d(detaching){if(~current_block_type_index){if_blocks[current_block_type_index].d(detaching);}if(detaching)detach(if_block_anchor);}};}// (43:19)
|
|
151
|
+
function create_if_block_3$a(ctx){let div;let goa_spinner;let t;let div_class_value;let if_block=/*message*/ctx[0]&&create_if_block_4$3(ctx);return {c(){div=element("div");goa_spinner=element("goa-spinner");t=space();if(if_block)if_block.c();set_custom_element_data(goa_spinner,"size",/*spinnerSize*/ctx[2]);set_custom_element_data(goa_spinner,"progress",/*progress*/ctx[1]);attr(div,"class",div_class_value="spinner-"+/*spinnerSize*/ctx[2]);toggle_class(div,"inline",/*inline*/ctx[4]);},m(target,anchor){insert(target,div,anchor);append(div,goa_spinner);append(div,t);if(if_block)if_block.m(div,null);},p(ctx,dirty){if(dirty&/*spinnerSize*/4){set_custom_element_data(goa_spinner,"size",/*spinnerSize*/ctx[2]);}if(dirty&/*progress*/2){set_custom_element_data(goa_spinner,"progress",/*progress*/ctx[1]);}if(/*message*/ctx[0]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block_4$3(ctx);if_block.c();if_block.m(div,null);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty&/*spinnerSize*/4&&div_class_value!==(div_class_value="spinner-"+/*spinnerSize*/ctx[2])){attr(div,"class",div_class_value);}if(dirty&/*spinnerSize, inline*/20){toggle_class(div,"inline",/*inline*/ctx[4]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);if(if_block)if_block.d();}};}// (32:2) {#if fullscreen}
|
|
156
152
|
function create_if_block_1$d(ctx){let div;let goa_spinner;let t;let div_transition;let current;let mounted;let dispose;let if_block=/*message*/ctx[0]&&create_if_block_2$b(ctx);return {c(){div=element("div");goa_spinner=element("goa-spinner");t=space();if(if_block)if_block.c();set_custom_element_data(goa_spinner,"size",/*spinnerSize*/ctx[2]);set_custom_element_data(goa_spinner,"progress",/*progress*/ctx[1]);toggle_class(div,"fullscreen",/*fullscreen*/ctx[3]);},m(target,anchor){insert(target,div,anchor);append(div,goa_spinner);append(div,t);if(if_block)if_block.m(div,null);current=true;if(!mounted){dispose=action_destroyer(noscroll.call(null,div,{enable:true}));mounted=true;}},p(ctx,dirty){if(!current||dirty&/*spinnerSize*/4){set_custom_element_data(goa_spinner,"size",/*spinnerSize*/ctx[2]);}if(!current||dirty&/*progress*/2){set_custom_element_data(goa_spinner,"progress",/*progress*/ctx[1]);}if(/*message*/ctx[0]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block_2$b(ctx);if_block.c();if_block.m(div,null);}}else if(if_block){if_block.d(1);if_block=null;}if(!current||dirty&/*fullscreen*/8){toggle_class(div,"fullscreen",/*fullscreen*/ctx[3]);}},i(local){if(current)return;add_render_callback(()=>{if(!current)return;if(!div_transition)div_transition=create_bidirectional_transition(div,fade,{duration:300},true);div_transition.run(1);});current=true;},o(local){if(!div_transition)div_transition=create_bidirectional_transition(div,fade,{duration:300},false);div_transition.run(0);current=false;},d(detaching){if(detaching)detach(div);if(if_block)if_block.d();if(detaching&&div_transition)div_transition.end();mounted=false;dispose();}};}// (46:6) {#if message}
|
|
157
|
-
function create_if_block_4$
|
|
153
|
+
function create_if_block_4$3(ctx){let div;let t;return {c(){div=element("div");t=text(/*message*/ctx[0]);attr(div,"class","message");},m(target,anchor){insert(target,div,anchor);append(div,t);},p(ctx,dirty){if(dirty&/*message*/1)set_data(t,/*message*/ctx[0]);},d(detaching){if(detaching)detach(div);}};}// (39:6) {#if message}
|
|
158
154
|
function create_if_block_2$b(ctx){let div;let t;return {c(){div=element("div");t=text(/*message*/ctx[0]);attr(div,"class","message");},m(target,anchor){insert(target,div,anchor);append(div,t);},p(ctx,dirty){if(dirty&/*message*/1)set_data(t,/*message*/ctx[0]);},d(detaching){if(detaching)detach(div);}};}function create_fragment$N(ctx){let if_block_anchor;let current;let if_block=/*isVisible*/ctx[5]&&create_if_block$p(ctx);return {c(){if(if_block)if_block.c();if_block_anchor=empty();this.c=noop;},m(target,anchor){if(if_block)if_block.m(target,anchor);insert(target,if_block_anchor,anchor);current=true;},p(ctx,[dirty]){if(/*isVisible*/ctx[5]){if(if_block){if_block.p(ctx,dirty);if(dirty&/*isVisible*/32){transition_in(if_block,1);}}else {if_block=create_if_block$p(ctx);if_block.c();transition_in(if_block,1);if_block.m(if_block_anchor.parentNode,if_block_anchor);}}else if(if_block){group_outros();transition_out(if_block,1,1,()=>{if_block=null;});check_outros();}},i(local){if(current)return;transition_in(if_block);current=true;},o(local){transition_out(if_block);current=false;},d(detaching){if(if_block)if_block.d(detaching);if(detaching)detach(if_block_anchor);}};}function instance$K($$self,$$props,$$invalidate){let isVisible;const[Variants,validateVariant]=typeValidator("Circular progress variant",["fullscreen","inline"]);const[Sizes,validateSize]=typeValidator("Button size",["small","large"]);let{variant="inline"}=$$props;let{size="large"}=$$props;let{message=""}=$$props;let{progress=-1}=$$props;let{visible="false"}=$$props;let spinnerSize;let fullscreen;let inline;onMount(async()=>{validateVariant(variant);validateSize(size);$$invalidate(2,spinnerSize=size==="small"?"large":"xlarge");$$invalidate(3,fullscreen=variant==="fullscreen");$$invalidate(4,inline=variant==="inline");});$$self.$$set=$$props=>{if('variant'in $$props)$$invalidate(6,variant=$$props.variant);if('size'in $$props)$$invalidate(7,size=$$props.size);if('message'in $$props)$$invalidate(0,message=$$props.message);if('progress'in $$props)$$invalidate(1,progress=$$props.progress);if('visible'in $$props)$$invalidate(8,visible=$$props.visible);};$$self.$$.update=()=>{if($$self.$$.dirty&/*visible*/256){$$invalidate(5,isVisible=toBoolean(visible));}};return [message,progress,spinnerSize,fullscreen,inline,isVisible,variant,size,visible];}class CircularProgress extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.fullscreen{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;flex-direction:column;background-color:rgba(255, 255, 255, 0.9)}.inline{margin:3.5rem;display:inline-flex;flex-direction:column;align-items:center;justify-content:center}.spinner-large .message{margin-top:1.5rem;font-size:1.2rem}.spinner-xlarge .message{margin-top:2rem;font-size:1.5rem}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$K,create_fragment$N,safe_not_equal,{variant:6,size:7,message:0,progress:1,visible:8},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["variant","size","message","progress","visible"];}get variant(){return this.$$.ctx[6];}set variant(variant){this.$$set({variant});flush();}get size(){return this.$$.ctx[7];}set size(size){this.$$set({size});flush();}get message(){return this.$$.ctx[0];}set message(message){this.$$set({message});flush();}get progress(){return this.$$.ctx[1];}set progress(progress){this.$$set({progress});flush();}get visible(){return this.$$.ctx[8];}set visible(visible){this.$$set({visible});flush();}}customElements.define("goa-circular-progress",CircularProgress);/* src/components/container/Container.svelte generated by Svelte v3.59.2 */function create_fragment$M(ctx){let div3;let header;let div0;let t0;let div1;let header_class_value;let t1;let div2;let div3_style_value;let div3_class_value;return {c(){div3=element("div");header=element("header");div0=element("div");div0.innerHTML=`<slot name="title"></slot>`;t0=space();div1=element("div");div1.innerHTML=`<slot name="actions"></slot>`;t1=space();div2=element("div");div2.innerHTML=`<slot></slot>`;this.c=noop;attr(div0,"class","title");attr(div1,"class","actions");attr(header,"class",header_class_value="heading--"+/*accent*/ctx[1]);attr(div2,"class","content");attr(div3,"data-testid",/*testid*/ctx[3]);attr(div3,"style",div3_style_value=calculateMargin(/*mt*/ctx[4],/*mr*/ctx[5],/*mb*/ctx[6],/*ml*/ctx[7]));attr(div3,"class",div3_class_value=`
|
|
159
155
|
goa-container
|
|
160
156
|
goa-container--${/*type*/ctx[0]}
|
|
@@ -165,86 +161,70 @@ function create_if_block_2$b(ctx){let div;let t;return {c(){div=element("div");t
|
|
|
165
161
|
goa-container--${/*type*/ctx[0]}
|
|
166
162
|
padding--${/*padding*/ctx[2]}
|
|
167
163
|
accent--${/*accent*/ctx[1]}
|
|
168
|
-
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$J($$self,$$props,$$invalidate){const[Types,validateType]=typeValidator("Container type",["interactive","info","error","success","important","non-interactive"]);const[Accents,validateAccent]=typeValidator("Container accent",["thick","thin","filled"]);const[Paddings,validatePadding]=typeValidator("Container padding",["relaxed","compact"]);let{type="interactive"}=$$props;let{accent="filled"}=$$props;let{padding="relaxed"}=$$props;let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;onMount(()=>{validateType(type);validateAccent(accent);validatePadding(padding);});$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('accent'in $$props)$$invalidate(1,accent=$$props.accent);if('padding'in $$props)$$invalidate(2,padding=$$props.padding);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('mt'in $$props)$$invalidate(4,mt=$$props.mt);if('mr'in $$props)$$invalidate(5,mr=$$props.mr);if('mb'in $$props)$$invalidate(6,mb=$$props.mb);if('ml'in $$props)$$invalidate(7,ml=$$props.ml);};return [type,accent,padding,testid,mt,mr,mb,ml];}class Container extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;flex:1 1 auto}.goa-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column}.goa-container *{box-sizing:border-box}header{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:var(--goa-font-size-4);border-width:1px;border-style:solid;border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.content{border-bottom:1px solid var(--goa-color-greyscale-200);border-left:1px solid var(--goa-color-greyscale-200);border-right:1px solid var(--goa-color-greyscale-200);border-bottom-left-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);display:flex;flex:1 1 auto;flex-direction:column}.content ::slotted(p:last-child){margin-bottom:0 !important}.goa-container--non-interactive.accent--filled .content{border-color:var(--goa-color-greyscale-200);background-color:var(--goa-color-greyscale-100)}.goa-container--important.accent--filled .content{border-color:var(--goa-color-warning-default);background-color:var(--goa-color-warning-background)}.goa-container--error.accent--filled .content{border-color:var(--goa-color-emergency-default);background-color:var(--goa-color-emergency-background)}.goa-container--success.accent--filled .content{border-color:var(--goa-color-success-default);background-color:var(--goa-color-success-background)}.goa-container--info.accent--filled .content{border-color:var(--goa-color-info-default);background-color:var(--goa-color-info-background)}.title,.actions{padding:0.5rem 0}.padding--relaxed header{padding:0 1.5rem}.padding--relaxed .content{padding:1.5rem}.padding--compact header,.padding--compact .content{padding:0 1rem}.padding--compact header{padding:0 1rem}.padding--compact .content{padding:1rem}@media screen and (max-width: 623px){.padding--relaxed header{padding:0 1rem}.padding--relaxed .content{padding:1rem}}.goa-container--non-interactive header{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black)}.goa-container--interactive header{background-color:var(--goa-color-brand-default);border-color:var(--goa-color-brand-default);color:var(--goa-color-greyscale-white)}.goa-container--info header{background-color:var(--goa-color-info-default);border-color:var(--goa-color-info-default);color:var(--goa-color-greyscale-white)}.goa-container--error header{background-color:var(--goa-color-emergency-default);border-color:var(--goa-color-emergency-default);color:var(--goa-color-greyscale-white)}.goa-container--success header{background-color:var(--goa-color-success-default);border-color:var(--goa-color-success-default);color:var(--goa-color-greyscale-white)}.goa-container--important header{background-color:var(--goa-color-warning-default);border-color:var(--goa-color-warning-default);color:var(--goa-color-greyscale-white)}.heading--thick{padding:0.5rem 1.5rem;max-height:3rem;min-height:1rem}.heading--thick .title{line-height:2rem}.heading--thin{height:0.5rem}.heading--filled{display:none}.heading--filled~.content{border-top:1px solid var(--goa-color-greyscale-200);border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.heading--thin .title,.heading--thin .actions{display:none}.actions{display:flex;align-items:center}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$J,create_fragment$M,safe_not_equal,{type:0,accent:1,padding:2,testid:3,mt:4,mr:5,mb:6,ml:7},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["type","accent","padding","testid","mt","mr","mb","ml"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get accent(){return this.$$.ctx[1];}set accent(accent){this.$$set({accent});flush();}get padding(){return this.$$.ctx[2];}set padding(padding){this.$$set({padding});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[4];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[5];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[6];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[7];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-container",Container);/* src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$L(ctx){let details;let summary;let goa_icon;let goa_icon_fillcolor_value;let t0;let span;let t1;let t2;let div;let details_style_value;let mounted;let dispose;return {c(){details=element("details");summary=element("summary");goa_icon=element("goa-icon");t0=space();span=element("span");t1=text(/*heading*/ctx[1]);t2=space();div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;set_custom_element_data(goa_icon,"mt","1");set_custom_element_data(goa_icon,"mr","2");set_custom_element_data(goa_icon,"type","chevron-forward");set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)");attr(div,"class","content");details.open=/*_isOpen*/ctx[9];attr(details,"style",details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));},m(target,anchor){insert(target,details,anchor);append(details,summary);append(summary,goa_icon);append(summary,t0);append(summary,span);append(span,t1);/*summary_binding*/ctx[10](summary);append(details,t2);append(details,div);/*details_binding*/ctx[11](details);if(!mounted){dispose=listen(details,"toggle",/*toggle_handler*/ctx[12]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*_isMouseOver*/64&&goa_icon_fillcolor_value!==(goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)")){set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value);}if(dirty&/*heading*/2)set_data(t1,/*heading*/ctx[1]);if(dirty&/*_isOpen*/512){details.open=/*_isOpen*/ctx[9];}if(dirty&/*mt, mr, mb, ml*/60&&details_style_value!==(details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(details,"style",details_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(details);/*summary_binding*/ctx[10](null);/*details_binding*/ctx[11](null);mounted=false;dispose();}};}function instance$I($$self,$$props,$$invalidate){let _isOpen;let{heading}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let _isMouseOver=false;let _summaryEl;let _detailsEl;onMount(()=>{validateRequired("Details",{heading});_summaryEl.addEventListener("mouseover",()=>{$$invalidate(6,_isMouseOver=true);});_summaryEl.addEventListener("mouseout",()=>{$$invalidate(6,_isMouseOver=false);});});function summary_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_summaryEl=$$value;$$invalidate(7,_summaryEl);});}function details_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_detailsEl=$$value;$$invalidate(8,_detailsEl);});}const toggle_handler=({target})=>$$invalidate(0,open=`${target.open}`);$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('mt'in $$props)$$invalidate(2,mt=$$props.mt);if('mr'in $$props)$$invalidate(3,mr=$$props.mr);if('mb'in $$props)$$invalidate(4,mb=$$props.mb);if('ml'in $$props)$$invalidate(5,ml=$$props.ml);if('open'in $$props)$$invalidate(0,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/1){$$invalidate(9,_isOpen=toBoolean(open));}};return [open,heading,mt,mr,mb,ml,_isMouseOver,_summaryEl,_detailsEl,_isOpen,summary_binding,details_binding,toggle_handler];}class Details extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font-family:var(--goa-font-family-sans)}details{max-width:75ch;position:relative}details ::slotted(*){font:var(--goa-typography-body-m)}summary{padding:0.5rem;margin-bottom:0.5rem;cursor:pointer;list-style:none;display:flex;align-items:flex-start}goa-icon{position:absolute}details[open] goa-icon{transform:translateX(-1px) rotate(90deg);top:0.75rem}details summary::-webkit-details-marker{display:none}summary{border-radius:var(--goa-border-radius-m)}summary:focus,summary:active{outline:3px solid var(--goa-color-interactive-focus);border-radius:var(--goa-border-radius-m);color:var(--goa-color-interactive-hover);background-color:var(--goa-color-greyscale-100)}summary:hover{background-color:var(--goa-color-greyscale-100)}summary span{margin-left:2rem;text-decoration:underline;color:var(--goa-color-interactive-default);padding-bottom:var(--font-valign-fix);line-height:var(--goa-line-height-3)}summary:hover span{color:var(--goa-color-interactive-hover)}.content{border-left:4px solid var(--goa-color-greyscale-200);padding:1rem;margin-left:1.1rem;margin-bottom:var(--goa-space-s)}.content ::slotted(p:last-child){margin-bottom:0 !important}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$I,create_fragment$L,safe_not_equal,{heading:1,mt:2,mr:3,mb:4,ml:5,open:0},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["heading","mt","mr","mb","ml","open"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get mt(){return this.$$.ctx[2];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[3];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[4];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[5];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[0];}set open(open){this.$$set({open});flush();}}customElements.define("goa-details",Details);/* src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$K(ctx){let hr;let hr_style_value;return {c(){hr=element("hr");this.c=noop;attr(hr,"data-testid",/*testid*/ctx[0]);attr(hr,"style",hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]));},m(target,anchor){insert(target,hr,anchor);},p(ctx,[dirty]){if(dirty&/*testid*/1){attr(hr,"data-testid",/*testid*/ctx[0]);}if(dirty&/*mt, mr, mb, ml*/30&&hr_style_value!==(hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]))){attr(hr,"style",hr_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(hr);}};}function instance$H($$self,$$props,$$invalidate){let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('mt'in $$props)$$invalidate(1,mt=$$props.mt);if('mr'in $$props)$$invalidate(2,mr=$$props.mr);if('mb'in $$props)$$invalidate(3,mb=$$props.mb);if('ml'in $$props)$$invalidate(4,ml=$$props.ml);};return [testid,mt,mr,mb,ml];}class Divider extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`hr{padding:0;margin:0;height:1px;background-color:var(--goa-color-greyscale-200);border:none}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$H,create_fragment$K,safe_not_equal,{testid:0,mt:1,mr:2,mb:3,ml:4},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["testid","mt","mr","mb","ml"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[1];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[2];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[3];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[4];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-divider",Divider);/* src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1$1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[69]=list[i];child_ctx[73]=i;return child_ctx;}function get_each_context$8(ctx,list,i){const child_ctx=ctx.slice();child_ctx[69]=list[i];return child_ctx;}// (509:2) {:else}
|
|
169
|
-
function create_else_block$a(ctx){let slot;let t0;let goa_popover;let div;let t1;let input;let input_style_value;let input_aria_controls_value;let input_aria_label_value;let
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$J($$self,$$props,$$invalidate){const[Types,validateType]=typeValidator("Container type",["interactive","info","error","success","important","non-interactive"]);const[Accents,validateAccent]=typeValidator("Container accent",["thick","thin","filled"]);const[Paddings,validatePadding]=typeValidator("Container padding",["relaxed","compact"]);let{type="interactive"}=$$props;let{accent="filled"}=$$props;let{padding="relaxed"}=$$props;let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;onMount(()=>{validateType(type);validateAccent(accent);validatePadding(padding);});$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('accent'in $$props)$$invalidate(1,accent=$$props.accent);if('padding'in $$props)$$invalidate(2,padding=$$props.padding);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('mt'in $$props)$$invalidate(4,mt=$$props.mt);if('mr'in $$props)$$invalidate(5,mr=$$props.mr);if('mb'in $$props)$$invalidate(6,mb=$$props.mb);if('ml'in $$props)$$invalidate(7,ml=$$props.ml);};return [type,accent,padding,testid,mt,mr,mb,ml];}class Container extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;flex:1 1 auto}.goa-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column}.goa-container *{box-sizing:border-box}header{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:var(--goa-font-size-4);border-width:1px;border-style:solid;border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.content{border-bottom:1px solid var(--goa-color-greyscale-200);border-left:1px solid var(--goa-color-greyscale-200);border-right:1px solid var(--goa-color-greyscale-200);border-bottom-left-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);display:flex;flex:1 1 auto;flex-direction:column}.content ::slotted(p:last-child){margin-bottom:0 !important}.goa-container--non-interactive.accent--filled .content{border-color:var(--goa-color-greyscale-200);background-color:var(--goa-color-greyscale-100)}.goa-container--important.accent--filled .content{border-color:var(--goa-color-warning-default);background-color:var(--goa-color-warning-background)}.goa-container--error.accent--filled .content{border-color:var(--goa-color-emergency-default);background-color:var(--goa-color-emergency-background)}.goa-container--success.accent--filled .content{border-color:var(--goa-color-success-default);background-color:var(--goa-color-success-background)}.goa-container--info.accent--filled .content{border-color:var(--goa-color-info-default);background-color:var(--goa-color-info-background)}.title,.actions{padding:0.5rem 0}.padding--relaxed header{padding:0 1.5rem}.padding--relaxed .content{padding:1.5rem}.padding--compact header,.padding--compact .content{padding:0 1rem}.padding--compact header{padding:0 1rem}.padding--compact .content{padding:1rem}@media screen and (max-width: 623px){.padding--relaxed header{padding:0 1rem}.padding--relaxed .content{padding:1rem}}.goa-container--non-interactive header{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black)}.goa-container--interactive header{background-color:var(--goa-color-brand-default);border-color:var(--goa-color-brand-default);color:var(--goa-color-greyscale-white)}.goa-container--info header{background-color:var(--goa-color-info-default);border-color:var(--goa-color-info-default);color:var(--goa-color-greyscale-white)}.goa-container--error header{background-color:var(--goa-color-emergency-default);border-color:var(--goa-color-emergency-default);color:var(--goa-color-greyscale-white)}.goa-container--success header{background-color:var(--goa-color-success-default);border-color:var(--goa-color-success-default);color:var(--goa-color-greyscale-white)}.goa-container--important header{background-color:var(--goa-color-warning-default);border-color:var(--goa-color-warning-default);color:var(--goa-color-greyscale-white)}.heading--thick{padding:0.5rem 1.5rem;max-height:3rem;min-height:1rem}.heading--thick .title{line-height:2rem}.heading--thin{height:0.5rem}.heading--filled{display:none}.heading--filled~.content{border-top:1px solid var(--goa-color-greyscale-200);border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.heading--thin .title,.heading--thin .actions{display:none}.actions{display:flex;align-items:center}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$J,create_fragment$M,safe_not_equal,{type:0,accent:1,padding:2,testid:3,mt:4,mr:5,mb:6,ml:7},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["type","accent","padding","testid","mt","mr","mb","ml"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get accent(){return this.$$.ctx[1];}set accent(accent){this.$$set({accent});flush();}get padding(){return this.$$.ctx[2];}set padding(padding){this.$$set({padding});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[4];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[5];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[6];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[7];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-container",Container);/* src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$L(ctx){let details;let summary;let goa_icon;let goa_icon_fillcolor_value;let t0;let span;let t1;let t2;let div;let details_style_value;let mounted;let dispose;return {c(){details=element("details");summary=element("summary");goa_icon=element("goa-icon");t0=space();span=element("span");t1=text(/*heading*/ctx[1]);t2=space();div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;set_custom_element_data(goa_icon,"mt","1");set_custom_element_data(goa_icon,"mr","2");set_custom_element_data(goa_icon,"type","chevron-forward");set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)");attr(div,"class","content");details.open=/*_isOpen*/ctx[9];attr(details,"style",details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));},m(target,anchor){insert(target,details,anchor);append(details,summary);append(summary,goa_icon);append(summary,t0);append(summary,span);append(span,t1);/*summary_binding*/ctx[10](summary);append(details,t2);append(details,div);/*details_binding*/ctx[11](details);if(!mounted){dispose=listen(details,"toggle",/*toggle_handler*/ctx[12]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*_isMouseOver*/64&&goa_icon_fillcolor_value!==(goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)")){set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value);}if(dirty&/*heading*/2)set_data(t1,/*heading*/ctx[1]);if(dirty&/*_isOpen*/512){details.open=/*_isOpen*/ctx[9];}if(dirty&/*mt, mr, mb, ml*/60&&details_style_value!==(details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(details,"style",details_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(details);/*summary_binding*/ctx[10](null);/*details_binding*/ctx[11](null);mounted=false;dispose();}};}function instance$I($$self,$$props,$$invalidate){let _isOpen;let{heading}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let _isMouseOver=false;let _summaryEl;let _detailsEl;onMount(()=>{validateRequired("Details",{heading});_summaryEl.addEventListener("mouseover",()=>{$$invalidate(6,_isMouseOver=true);});_summaryEl.addEventListener("mouseout",()=>{$$invalidate(6,_isMouseOver=false);});});function summary_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_summaryEl=$$value;$$invalidate(7,_summaryEl);});}function details_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_detailsEl=$$value;$$invalidate(8,_detailsEl);});}const toggle_handler=({target})=>$$invalidate(0,open=`${target.open}`);$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('mt'in $$props)$$invalidate(2,mt=$$props.mt);if('mr'in $$props)$$invalidate(3,mr=$$props.mr);if('mb'in $$props)$$invalidate(4,mb=$$props.mb);if('ml'in $$props)$$invalidate(5,ml=$$props.ml);if('open'in $$props)$$invalidate(0,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/1){$$invalidate(9,_isOpen=toBoolean(open));}};return [open,heading,mt,mr,mb,ml,_isMouseOver,_summaryEl,_detailsEl,_isOpen,summary_binding,details_binding,toggle_handler];}class Details extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font-family:var(--goa-font-family-sans)}details{max-width:75ch;position:relative}details ::slotted(*){font:var(--goa-typography-body-m)}summary{padding:0.5rem;margin-bottom:0.5rem;cursor:pointer;list-style:none;display:flex;align-items:flex-start}goa-icon{position:absolute}details[open] goa-icon{transform:translateX(-1px) rotate(90deg);top:0.75rem}details summary::-webkit-details-marker{display:none}summary{border-radius:var(--goa-border-radius-m)}summary:focus,summary:active{outline:3px solid var(--goa-color-interactive-focus);border-radius:var(--goa-border-radius-m);color:var(--goa-color-interactive-hover);background-color:var(--goa-color-greyscale-100)}summary:hover{background-color:var(--goa-color-greyscale-100)}summary span{margin-left:2rem;text-decoration:underline;color:var(--goa-color-interactive-default);padding-bottom:var(--font-valign-fix);line-height:var(--goa-line-height-3)}summary:hover span{color:var(--goa-color-interactive-hover)}.content{border-left:4px solid var(--goa-color-greyscale-200);padding:1rem;margin-left:1.1rem;margin-bottom:var(--goa-space-s)}.content ::slotted(p:last-child){margin-bottom:0 !important}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$I,create_fragment$L,safe_not_equal,{heading:1,mt:2,mr:3,mb:4,ml:5,open:0},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["heading","mt","mr","mb","ml","open"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get mt(){return this.$$.ctx[2];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[3];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[4];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[5];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[0];}set open(open){this.$$set({open});flush();}}customElements.define("goa-details",Details);/* src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$K(ctx){let hr;let hr_style_value;return {c(){hr=element("hr");this.c=noop;attr(hr,"data-testid",/*testid*/ctx[0]);attr(hr,"style",hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]));},m(target,anchor){insert(target,hr,anchor);},p(ctx,[dirty]){if(dirty&/*testid*/1){attr(hr,"data-testid",/*testid*/ctx[0]);}if(dirty&/*mt, mr, mb, ml*/30&&hr_style_value!==(hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]))){attr(hr,"style",hr_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(hr);}};}function instance$H($$self,$$props,$$invalidate){let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('mt'in $$props)$$invalidate(1,mt=$$props.mt);if('mr'in $$props)$$invalidate(2,mr=$$props.mr);if('mb'in $$props)$$invalidate(3,mb=$$props.mb);if('ml'in $$props)$$invalidate(4,ml=$$props.ml);};return [testid,mt,mr,mb,ml];}class Divider extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`hr{padding:0;margin:0;height:1px;background-color:var(--goa-color-greyscale-200);border:none}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$H,create_fragment$K,safe_not_equal,{testid:0,mt:1,mr:2,mb:3,ml:4},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["testid","mt","mr","mb","ml"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[1];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[2];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[3];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[4];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-divider",Divider);/* src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1$1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];child_ctx[65]=i;return child_ctx;}function get_each_context$8(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];return child_ctx;}// (444:2) {:else}
|
|
165
|
+
function create_else_block$a(ctx){let slot;let t0;let goa_popover;let div;let t1;let input;let input_style_value;let input_aria_controls_value;let input_aria_label_value;let input_aria_owns_value;let input_readonly_value;let t2;let div_style_value;let t3;let ul;let each_blocks=[];let each_1_lookup=new Map();let ul_id_value;let ul_aria_label_value;let ul_style_value;let mounted;let dispose;let if_block0=/*leadingicon*/ctx[4]&&create_if_block_2$a(ctx);function select_block_type_1(ctx,dirty){var _ctx$;if(/*_inputEl*/(_ctx$=ctx[23])!==null&&_ctx$!==void 0&&_ctx$.value&&/*_filterable*/ctx[24])return create_if_block_1$c;return create_else_block_2;}let current_block_type=select_block_type_1(ctx);let if_block1=current_block_type(ctx);let each_value_1=/*_filteredOptions*/ctx[15];const get_key=ctx=>/*index*/ctx[65];for(let i=0;i<each_value_1.length;i+=1){let child_ctx=get_each_context_1$1(ctx,each_value_1,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block_1$1(key,child_ctx));}let each_1_else=null;if(!each_value_1.length){each_1_else=create_else_block_1();}return {c(){slot=element("slot");t0=space();goa_popover=element("goa-popover");div=element("div");if(if_block0)if_block0.c();t1=space();input=element("input");t2=space();if_block1.c();t3=space();ul=element("ul");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}if(each_1_else){each_1_else.c();}attr(input,"style",input_style_value=`
|
|
166
|
+
cursor: ${!/*_disabled*/ctx[26]?/*_filterable*/ctx[24]?"auto":"pointer":"default"};
|
|
167
|
+
`);attr(input,"data-testid","input");attr(input,"type","text");attr(input,"role","combobox");attr(input,"autocomplete","off");attr(input,"aria-autocomplete","list");attr(input,"aria-controls",input_aria_controls_value=`menu-${/*name*/ctx[0]}`);attr(input,"aria-expanded",/*_isMenuVisible*/ctx[18]);attr(input,"aria-label",input_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(input,"aria-labelledby",/*arialabelledby*/ctx[2]);attr(input,"id",/*name*/ctx[0]);attr(input,"aria-activedescendant",/*_activeDescendantId*/ctx[25]);attr(input,"aria-disabled",/*_disabled*/ctx[26]);attr(input,"aria-owns",input_aria_owns_value=/*_isMenuVisible*/ctx[18]?`menu-${/*name*/ctx[0]}`:undefined);attr(input,"aria-haspopup","listbox");input.disabled=/*_disabled*/ctx[26];input.readOnly=input_readonly_value=!/*_filterable*/ctx[24];attr(input,"placeholder",/*placeholder*/ctx[6]);attr(input,"name",/*name*/ctx[0]);attr(div,"slot","target");attr(div,"style",div_style_value=cssVar("width",/*width*/ctx[7]));attr(div,"class","dropdown-input-group");toggle_class(div,"dropdown-input-group--disabled",/*_disabled*/ctx[26]);toggle_class(div,"error",/*_error*/ctx[27]);attr(ul,"id",ul_id_value=`menu-${/*name*/ctx[0]}`);attr(ul,"role","listbox");attr(ul,"tabindex","-1");attr(ul,"data-testid","dropdown-menu");attr(ul,"aria-label",ul_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(ul,"aria-labelledby",/*arialabelledby*/ctx[2]);attr(ul,"style",ul_style_value=`
|
|
168
|
+
width: ${/*_width*/ctx[19]};
|
|
172
169
|
outline: none;
|
|
173
170
|
overflow-y: auto;
|
|
174
171
|
max-height: ${/*maxheight*/ctx[5]};
|
|
175
|
-
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[8]);set_custom_element_data(goa_popover,"relative",/*relative*/ctx[9]);set_custom_element_data(goa_popover,"
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[8]);set_custom_element_data(goa_popover,"relative",/*relative*/ctx[9]);set_custom_element_data(goa_popover,"data-testid","option-list");set_custom_element_data(goa_popover,"maxwidth","1000px");set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[18]);set_custom_element_data(goa_popover,"padded","false");set_custom_element_data(goa_popover,"tabindex","-1");set_custom_element_data(goa_popover,"width",/*_width*/ctx[19]);},m(target,anchor){insert(target,slot,anchor);insert(target,t0,anchor);insert(target,goa_popover,anchor);append(goa_popover,div);if(if_block0)if_block0.m(div,null);append(div,t1);append(div,input);/*input_binding*/ctx[42](input);append(div,t2);if_block1.m(div,null);append(goa_popover,t3);append(goa_popover,ul);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(ul,null);}}if(each_1_else){each_1_else.m(ul,null);}/*ul_binding*/ctx[44](ul);if(!mounted){dispose=[listen(input,"keydown",/*onInputKeyDown*/ctx[32]),listen(input,"keyup",/*onInputKeyUp*/ctx[31]),listen(goa_popover,"_open",/*showMenu*/ctx[28]),listen(goa_popover,"_close",/*hideMenu*/ctx[29])];mounted=true;}},p(ctx,dirty){if(/*leadingicon*/ctx[4]){if(if_block0){if_block0.p(ctx,dirty);}else {if_block0=create_if_block_2$a(ctx);if_block0.c();if_block0.m(div,t1);}}else if(if_block0){if_block0.d(1);if_block0=null;}if(dirty[0]&/*_disabled, _filterable*/83886080&&input_style_value!==(input_style_value=`
|
|
173
|
+
cursor: ${!/*_disabled*/ctx[26]?/*_filterable*/ctx[24]?"auto":"pointer":"default"};
|
|
174
|
+
`)){attr(input,"style",input_style_value);}if(dirty[0]&/*name*/1&&input_aria_controls_value!==(input_aria_controls_value=`menu-${/*name*/ctx[0]}`)){attr(input,"aria-controls",input_aria_controls_value);}if(dirty[0]&/*_isMenuVisible*/262144){attr(input,"aria-expanded",/*_isMenuVisible*/ctx[18]);}if(dirty[0]&/*arialabel, name*/3&&input_aria_label_value!==(input_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(input,"aria-label",input_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(input,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*name*/1){attr(input,"id",/*name*/ctx[0]);}if(dirty[0]&/*_activeDescendantId*/33554432){attr(input,"aria-activedescendant",/*_activeDescendantId*/ctx[25]);}if(dirty[0]&/*_disabled*/67108864){attr(input,"aria-disabled",/*_disabled*/ctx[26]);}if(dirty[0]&/*_isMenuVisible, name*/262145&&input_aria_owns_value!==(input_aria_owns_value=/*_isMenuVisible*/ctx[18]?`menu-${/*name*/ctx[0]}`:undefined)){attr(input,"aria-owns",input_aria_owns_value);}if(dirty[0]&/*_disabled*/67108864){input.disabled=/*_disabled*/ctx[26];}if(dirty[0]&/*_filterable*/16777216&&input_readonly_value!==(input_readonly_value=!/*_filterable*/ctx[24])){input.readOnly=input_readonly_value;}if(dirty[0]&/*placeholder*/64){attr(input,"placeholder",/*placeholder*/ctx[6]);}if(dirty[0]&/*name*/1){attr(input,"name",/*name*/ctx[0]);}if(current_block_type===(current_block_type=select_block_type_1(ctx))&&if_block1){if_block1.p(ctx,dirty);}else {if_block1.d(1);if_block1=current_block_type(ctx);if(if_block1){if_block1.c();if_block1.m(div,null);}}if(dirty[0]&/*width*/128&&div_style_value!==(div_style_value=cssVar("width",/*width*/ctx[7]))){attr(div,"style",div_style_value);}if(dirty[0]&/*_disabled*/67108864){toggle_class(div,"dropdown-input-group--disabled",/*_disabled*/ctx[26]);}if(dirty[0]&/*_error*/134217728){toggle_class(div,"error",/*_error*/ctx[27]);}if(dirty[0]&/*_filteredOptions, _inputEl, _highlightedIndex, onSelect*/1082179584){each_value_1=/*_filteredOptions*/ctx[15];each_blocks=update_keyed_each(each_blocks,dirty,get_key,1,ctx,each_value_1,each_1_lookup,ul,destroy_block,create_each_block_1$1,null,get_each_context_1$1);if(!each_value_1.length&&each_1_else){each_1_else.p(ctx,dirty);}else if(!each_value_1.length){each_1_else=create_else_block_1();each_1_else.c();each_1_else.m(ul,null);}else if(each_1_else){each_1_else.d(1);each_1_else=null;}}if(dirty[0]&/*name*/1&&ul_id_value!==(ul_id_value=`menu-${/*name*/ctx[0]}`)){attr(ul,"id",ul_id_value);}if(dirty[0]&/*arialabel, name*/3&&ul_aria_label_value!==(ul_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(ul,"aria-label",ul_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(ul,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*_width, maxheight*/524320&&ul_style_value!==(ul_style_value=`
|
|
175
|
+
width: ${/*_width*/ctx[19]};
|
|
178
176
|
outline: none;
|
|
179
177
|
overflow-y: auto;
|
|
180
178
|
max-height: ${/*maxheight*/ctx[5]};
|
|
181
|
-
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/256){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[8]);}if(dirty[0]&/*relative*/512){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[9]);}if(dirty[0]&/*_isMenuVisible*/
|
|
182
|
-
function create_if_block$o(ctx){let select;let slot;let select_aria_label_value;let
|
|
183
|
-
function
|
|
184
|
-
function
|
|
185
|
-
function
|
|
186
|
-
function create_else_block_1(ctx){let li;return {c(){li=element("li");li.textContent="No matches found";attr(li,"class","dropdown-item");attr(li,"data-testid","dropdown-item-not-found");},m(target,anchor){insert(target,li,anchor);},p:noop,d(detaching){if(detaching)detach(li);}};}// (
|
|
187
|
-
function
|
|
188
|
-
function
|
|
189
|
-
|
|
179
|
+
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/256){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[8]);}if(dirty[0]&/*relative*/512){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[9]);}if(dirty[0]&/*_isMenuVisible*/262144){set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[18]);}if(dirty[0]&/*_width*/524288){set_custom_element_data(goa_popover,"width",/*_width*/ctx[19]);}},d(detaching){if(detaching)detach(slot);if(detaching)detach(t0);if(detaching)detach(goa_popover);if(if_block0)if_block0.d();/*input_binding*/ctx[42](null);if_block1.d();for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].d();}if(each_1_else)each_1_else.d();/*ul_binding*/ctx[44](null);mounted=false;run_all(dispose);}};}// (424:2) {#if _native}
|
|
180
|
+
function create_if_block$o(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[17];let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$8(get_each_context$8(ctx,each_value,i));}return {c(){select=element("select");slot=element("slot");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}attr(select,"name",/*name*/ctx[0]);attr(select,"aria-label",select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(select,"aria-labelledby",/*arialabelledby*/ctx[2]);select.disabled=/*_disabled*/ctx[26];attr(select,"id",/*name*/ctx[0]);toggle_class(select,"error",/*_error*/ctx[27]);},m(target,anchor){insert(target,select,anchor);append(select,slot);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(select,null);}}/*select_binding*/ctx[41](select);if(!mounted){dispose=listen(select,"change",/*onNativeSelect*/ctx[35]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*value, _options*/131080){each_value=/*_options*/ctx[17];let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$8(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$8(child_ctx);each_blocks[i].c();each_blocks[i].m(select,null);}}for(;i<each_blocks.length;i+=1){each_blocks[i].d(1);}each_blocks.length=each_value.length;}if(dirty[0]&/*name*/1){attr(select,"name",/*name*/ctx[0]);}if(dirty[0]&/*arialabel, name*/3&&select_aria_label_value!==(select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(select,"aria-label",select_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(select,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*_disabled*/67108864){select.disabled=/*_disabled*/ctx[26];}if(dirty[0]&/*name*/1){attr(select,"id",/*name*/ctx[0]);}if(dirty[0]&/*_error*/134217728){toggle_class(select,"error",/*_error*/ctx[27]);}},d(detaching){if(detaching)detach(select);destroy_each(each_blocks,detaching);/*select_binding*/ctx[41](null);mounted=false;dispose();}};}// (467:8) {#if leadingicon}
|
|
181
|
+
function create_if_block_2$a(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","dropdown-input--leading-icon");set_custom_element_data(goa_icon,"data-testid","leading-icon");set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty[0]&/*leadingicon*/16){set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);}},d(detaching){if(detaching)detach(goa_icon);}};}// (517:8) {:else}
|
|
182
|
+
function create_else_block_2(ctx){let goa_icon;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let goa_icon_type_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"tabindex","-1");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[18]));set_custom_element_data(goa_icon,"class","dropdown-icon--arrow");set_custom_element_data(goa_icon,"size","medium");set_custom_element_data(goa_icon,"type",goa_icon_type_value=/*_isMenuVisible*/ctx[18]?"chevron-up":"chevron-down");},m(target,anchor){insert(target,goa_icon,anchor);if(!mounted){dispose=listen(goa_icon,"click",/*onChevronClick*/ctx[36]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*name*/1){set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);}if(dirty[0]&/*arialabel, name*/3&&goa_icon_arialabel_value!==(goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value);}if(dirty[0]&/*name*/1&&goa_icon_ariacontrols_value!==(goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value);}if(dirty[0]&/*_isMenuVisible*/262144&&goa_icon_ariaexpanded_value!==(goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[18]))){set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value);}if(dirty[0]&/*_isMenuVisible*/262144&&goa_icon_type_value!==(goa_icon_type_value=/*_isMenuVisible*/ctx[18]?"chevron-up":"chevron-down")){set_custom_element_data(goa_icon,"type",goa_icon_type_value);}},d(detaching){if(detaching)detach(goa_icon);mounted=false;dispose();}};}// (502:8) {#if _inputEl?.value && _filterable}
|
|
183
|
+
function create_if_block_1$c(ctx){let goa_icon;let goa_icon_tabindex_value;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value=/*_disabled*/ctx[26]?-1:0);set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=`clear ${/*arialabel*/ctx[1]||/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[18]));set_custom_element_data(goa_icon,"class","dropdown-icon--clear");set_custom_element_data(goa_icon,"size","medium");set_custom_element_data(goa_icon,"type","close");toggle_class(goa_icon,"disabled",/*_disabled*/ctx[26]);},m(target,anchor){insert(target,goa_icon,anchor);if(!mounted){dispose=[listen(goa_icon,"click",stop_propagation(/*onClearIconClick*/ctx[34])),listen(goa_icon,"keydown",/*onClearIconKeyDown*/ctx[33])];mounted=true;}},p(ctx,dirty){if(dirty[0]&/*name*/1){set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);}if(dirty[0]&/*_disabled*/67108864&&goa_icon_tabindex_value!==(goa_icon_tabindex_value=/*_disabled*/ctx[26]?-1:0)){set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value);}if(dirty[0]&/*arialabel, name*/3&&goa_icon_arialabel_value!==(goa_icon_arialabel_value=`clear ${/*arialabel*/ctx[1]||/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value);}if(dirty[0]&/*name*/1&&goa_icon_ariacontrols_value!==(goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value);}if(dirty[0]&/*_isMenuVisible*/262144&&goa_icon_ariaexpanded_value!==(goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[18]))){set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value);}if(dirty[0]&/*_disabled*/67108864){toggle_class(goa_icon,"disabled",/*_disabled*/ctx[26]);}},d(detaching){if(detaching)detach(goa_icon);mounted=false;run_all(dispose);}};}// (565:8) {:else}
|
|
184
|
+
function create_else_block_1(ctx){let li;return {c(){li=element("li");li.textContent="No matches found\n ";attr(li,"class","dropdown-item");attr(li,"data-testid","dropdown-item-not-found");},m(target,anchor){insert(target,li,anchor);},p:noop,d(detaching){if(detaching)detach(li);}};}// (549:8) {#each _filteredOptions as option, index (index)}
|
|
185
|
+
function create_each_block_1$1(key_1,ctx){let li;let t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+"";let t0;let t1;let li_id_value;let li_aria_selected_value;let li_data_index_value;let li_data_testid_value;let li_data_value_value;let mounted;let dispose;function click_handler(){return(/*click_handler*/ctx[43](/*option*/ctx[61]));}return {key:key_1,first:null,c(){li=element("li");t0=text(t0_value);t1=space();attr(li,"id",li_id_value=/*option*/ctx[61].value);attr(li,"aria-selected",li_aria_selected_value=/*_inputEl*/ctx[23].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));attr(li,"class","dropdown-item");attr(li,"data-index",li_data_index_value=/*index*/ctx[65]);attr(li,"data-testid",li_data_testid_value=`dropdown-item-${/*option*/ctx[61].value}`);attr(li,"data-value",li_data_value_value=/*option*/ctx[61].value);attr(li,"role","option");set_style(li,"display","block");toggle_class(li,"dropdown-item--highlighted",/*index*/ctx[65]===/*_highlightedIndex*/ctx[14]);toggle_class(li,"selected",/*_inputEl*/ctx[23].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));this.first=li;},m(target,anchor){insert(target,li,anchor);append(li,t0);append(li,t1);if(!mounted){dispose=listen(li,"click",click_handler);mounted=true;}},p(new_ctx,dirty){ctx=new_ctx;if(dirty[0]&/*_filteredOptions*/32768&&t0_value!==(t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+""))set_data(t0,t0_value);if(dirty[0]&/*_filteredOptions*/32768&&li_id_value!==(li_id_value=/*option*/ctx[61].value)){attr(li,"id",li_id_value);}if(dirty[0]&/*_inputEl, _filteredOptions*/8421376&&li_aria_selected_value!==(li_aria_selected_value=/*_inputEl*/ctx[23].value===(/*option*/ctx[61].label||/*option*/ctx[61].value))){attr(li,"aria-selected",li_aria_selected_value);}if(dirty[0]&/*_filteredOptions*/32768&&li_data_index_value!==(li_data_index_value=/*index*/ctx[65])){attr(li,"data-index",li_data_index_value);}if(dirty[0]&/*_filteredOptions*/32768&&li_data_testid_value!==(li_data_testid_value=`dropdown-item-${/*option*/ctx[61].value}`)){attr(li,"data-testid",li_data_testid_value);}if(dirty[0]&/*_filteredOptions*/32768&&li_data_value_value!==(li_data_value_value=/*option*/ctx[61].value)){attr(li,"data-value",li_data_value_value);}if(dirty[0]&/*_filteredOptions, _highlightedIndex*/49152){toggle_class(li,"dropdown-item--highlighted",/*index*/ctx[65]===/*_highlightedIndex*/ctx[14]);}if(dirty[0]&/*_inputEl, _filteredOptions*/8421376){toggle_class(li,"selected",/*_inputEl*/ctx[23].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));}},d(detaching){if(detaching)detach(li);mounted=false;dispose();}};}// (436:6) {#each _options as option}
|
|
186
|
+
function create_each_block$8(ctx){let option;let t0_value=/*option*/ctx[61].label+"";let t0;let t1;let option_selected_value;let option_value_value;return {c(){option=element("option");t0=text(t0_value);t1=space();option.selected=option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value;option.__value=option_value_value=/*option*/ctx[61].value;option.value=option.__value;},m(target,anchor){insert(target,option,anchor);append(option,t0);append(option,t1);},p(ctx,dirty){if(dirty[0]&/*_options*/131072&&t0_value!==(t0_value=/*option*/ctx[61].label+""))set_data(t0,t0_value);if(dirty[0]&/*value, _options*/131080&&option_selected_value!==(option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value)){option.selected=option_selected_value;}if(dirty[0]&/*_options*/131072&&option_value_value!==(option_value_value=/*option*/ctx[61].value)){option.__value=option_value_value;option.value=option.__value;}},d(detaching){if(detaching)detach(option);}};}function create_fragment$J(ctx){let div;let div_data_testid_value;let div_style_value;function select_block_type(ctx,dirty){if(/*_native*/ctx[16])return create_if_block$o;return create_else_block$a;}let current_block_type=select_block_type(ctx);let if_block=current_block_type(ctx);return {c(){div=element("div");if_block.c();this.c=noop;attr(div,"data-testid",div_data_testid_value=`${/*name*/ctx[0]}-dropdown`);attr(div,"class","dropdown");attr(div,"style",div_style_value=`
|
|
187
|
+
--width: ${/*_width*/ctx[19]};
|
|
190
188
|
${calculateMargin(/*mt*/ctx[10],/*mr*/ctx[11],/*mb*/ctx[12],/*ml*/ctx[13])}
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
`);toggle_class(div,"dropdown-native",/*_native*/ctx[16]);},m(target,anchor){insert(target,div,anchor);if_block.m(div,null);/*div_binding*/ctx[45](div);},p(ctx,dirty){if(current_block_type===(current_block_type=select_block_type(ctx))&&if_block){if_block.p(ctx,dirty);}else {if_block.d(1);if_block=current_block_type(ctx);if(if_block){if_block.c();if_block.m(div,null);}}if(dirty[0]&/*name*/1&&div_data_testid_value!==(div_data_testid_value=`${/*name*/ctx[0]}-dropdown`)){attr(div,"data-testid",div_data_testid_value);}if(dirty[0]&/*_width, mt, mr, mb, ml*/539648&&div_style_value!==(div_style_value=`
|
|
190
|
+
--width: ${/*_width*/ctx[19]};
|
|
193
191
|
${calculateMargin(/*mt*/ctx[10],/*mr*/ctx[11],/*mb*/ctx[12],/*ml*/ctx[13])}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const slot=_el.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_e=>{_values=parseValues(value);$$invalidate(15,_options=getOptions());});});// Functions
|
|
211
|
-
function getChildren(){const slot=_el.querySelector("slot");if(slot){// default
|
|
192
|
+
`)){attr(div,"style",div_style_value);}if(dirty[0]&/*_native*/65536){toggle_class(div,"dropdown-native",/*_native*/ctx[16]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);if_block.d();/*div_binding*/ctx[45](null);}};}function parseValues(selectedValue){let rawValue;try{rawValue=JSON.parse(selectedValue||`[""]`);}catch(e){rawValue=[selectedValue];}const rawValues=typeof rawValue==="object"?rawValue:[rawValue];// convert all values to strings to avoid later type comparison issues
|
|
193
|
+
return rawValues.map(val=>`${val}`);}function isFilterMatch(option,filter){if(filter.length===0)return true;let value=option.filter||option.label||option.value;value=value.toLowerCase();filter=filter.toLowerCase();return value.startsWith(filter)||value.includes(" "+filter);}function instance$G($$self,$$props,$$invalidate){let _disabled;let _error;let _multiselect;let _native;let _filterable;let _activeDescendantId;let{name}=$$props;let{arialabel=""}=$$props;let{arialabelledby=""}=$$props;let{value=""}=$$props;let{filterable="false"}=$$props;let{leadingicon=null}=$$props;let{maxheight="276px"}=$$props;let{placeholder=""}=$$props;let{width=""}=$$props;let{disabled="false"}=$$props;let{error="false"}=$$props;let{multiselect="false"}=$$props;let{native="false"}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;//
|
|
194
|
+
// Private
|
|
195
|
+
//
|
|
196
|
+
let _options=[];let _isMenuVisible=false;let _highlightedIndex=-1;let _width;let _rootEl;let _menuEl;let _selectEl;let _inputEl;let _eventHandler;let _isDirty=false;let _filteredOptions=[];let _values=[];//
|
|
197
|
+
// Hooks
|
|
198
|
+
//
|
|
199
|
+
onMount(async()=>{var _a,_b;_eventHandler=_filterable?new ComboboxKeyUpHandler(_inputEl):new DropdownKeyUpHandler(_inputEl);// the following is required to appease the jest testing gods in that they don't respond
|
|
200
|
+
// to the slotchange event
|
|
201
|
+
$$invalidate(17,_options=getOptions());if(!_native){$$invalidate(23,_inputEl.value=(_b=(_a=_options.find(o=>o.value===value))===null||_a===void 0?void 0:_a.label)!==null&&_b!==void 0?_b:"",_inputEl);$$invalidate(19,_width=width||calculateWidth(_options));}syncFilteredOptions();// watch for DOM changes within the slot => dynamic binding
|
|
202
|
+
const slot=_rootEl.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_=>{var _a,_b;$$invalidate(17,_options=getOptions());syncFilteredOptions();$$invalidate(19,_width=width||calculateWidth(_options));if(!_native){$$invalidate(23,_inputEl.value=(_b=(_a=_options.find(o=>o.value===value))===null||_a===void 0?void 0:_a.label)!==null&&_b!==void 0?_b:"",_inputEl);}});});//
|
|
203
|
+
// Functions
|
|
204
|
+
//
|
|
205
|
+
// prevents unwanted reactive updates.
|
|
206
|
+
function setDisplayedValue(){var _a,_b;if(_inputEl){const option=_options.find(o=>o.value==_values[0]);// possible string number comparison
|
|
207
|
+
$$invalidate(23,_inputEl.value=(_b=(_a=option===null||option===void 0?void 0:option.label)!==null&&_a!==void 0?_a:option===null||option===void 0?void 0:option.value)!==null&&_b!==void 0?_b:"",_inputEl);}}function getChildren(){const slot=_rootEl.querySelector("slot");if(slot){// default
|
|
212
208
|
return slot.assignedElements();}// unit tests
|
|
213
|
-
const el=_native?_selectEl:
|
|
209
|
+
const el=_native?_selectEl:_rootEl;return [...el.children];}// Create a list of the options based on the children within the slot
|
|
214
210
|
// The children don't have to be goa-dropdown-item elements. Any child element
|
|
215
211
|
// work as long as it has a value and label content
|
|
216
|
-
function getOptions(){
|
|
217
|
-
function
|
|
212
|
+
function getOptions(){return getChildren().filter(child=>child.tagName==="GOA-DROPDOWN-ITEM").map(el=>{const option=el;const value=el.getAttribute("value")||option.value||"";const label=el.getAttribute("label")||option.label||el.innerHTML||value;const filter=el.getAttribute("filter")||label||value||"";return {value,label,filter};});}// compute the required width to ensure all children fit
|
|
213
|
+
function calculateWidth(options){// set width to longest item
|
|
218
214
|
const optionsWidth=options.map(option=>{const label=`${option.label}`||`${option.value}`||"";return label.length;}).sort((a,b)=>a>b?1:-1).pop();// longest one defines the width
|
|
219
215
|
let maxWidth=Math.max(optionsWidth,placeholder.length)+8;// compensate for icon width
|
|
220
|
-
if(leadingicon){maxWidth+=2;}return `${maxWidth}ch`;}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
*
|
|
232
|
-
* @param option
|
|
233
|
-
*/function updateInputValue(option){$$invalidate(17,_highlightedIndex=-1);$$invalidate(16,_inputValue=option?option.label:"");$$invalidate(0,value=option?option.value:"");if(!option){$$invalidate(29,_activeDescendantId=undefined);}}/**
|
|
234
|
-
* Keep track the component's local value based on new selected value
|
|
235
|
-
* @param newSelectedValue
|
|
236
|
-
*/function updateSelectedValue(newSelectedValue){if(_previousSelectedValue!==newSelectedValue){_previousSelectedValue=newSelectedValue;setSelectedOption(newSelectedValue);_values=[value];// Keep track _values, for multiSelect later
|
|
237
|
-
dispatchValue(value);}}function showMenu(){if(_disabled){return;}$$invalidate(23,_isMenuVisible=true);}function closeMenu(){$$invalidate(23,_isMenuVisible=false);}function dispatchValue(optionValue){const option=_options.find(item=>item.value===optionValue);const newValue=option?option.value:"";let detail;if(_multiselect){_values.push(newValue);detail={name,values:_values};}else {_values=[newValue];detail={name,value:newValue};}_el.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));}// Event handlers
|
|
238
|
-
function onSelect(option){if(_disabled)return;$$invalidate(0,value=option.value);_selectedOption=option;if(!_native){closeMenu();$$invalidate(16,_inputValue=option.label);_inputEl.focus();}}function ComboboxKeyDownHandler(){const handle=e=>{let stopPropagation=false;switch(e.key){case"Enter":onEnter();stopPropagation=true;break;case"Escape":case'Esc':closeMenu();removeSelectedValue();stopPropagation=true;break;case'Up':case"ArrowUp":onArrowUp();stopPropagation=true;break;case"Down":case"ArrowDown":onArrowDown();stopPropagation=true;break;case"Tab":closeMenu();break;case'Home':_inputEl.setSelectionRange(0,0);stopPropagation=true;break;case'End':_inputEl.setSelectionRange(_inputValue.length,_inputValue.length);stopPropagation=true;break;case'Backspace':if(_inputValue.length===0){// backspace should not open the filterable dropdown if input has no words
|
|
239
|
-
stopPropagation=true;return;}onBackspace();break;case' ':if(_inputValue.length===0){// space should not open the filterable dropdown if input has no words
|
|
240
|
-
stopPropagation=true;}break;default:if(isPrintableCharacter(e.key)){if(!_isMenuVisible){showMenu();}if(!_inputValue.length){removeSelectedValue();}}break;}if(stopPropagation){e.preventDefault();e.stopPropagation();}};const onEnter=()=>{$$invalidate(23,_isMenuVisible=!_isMenuVisible);if(_highlightedIndex<0){const matchedOption=_filteredOptions.find(option=>option.label.toLowerCase()===(_inputValue===null||_inputValue===void 0?void 0:_inputValue.toLowerCase()));selectOption(matchedOption);return;}const highlightedOption=_filteredOptions[_highlightedIndex];selectOption(highlightedOption);$$invalidate(17,_highlightedIndex=-1);// reset highlighted option
|
|
241
|
-
};const onArrowUp=()=>{showMenu();changeHighlightedOption(-1);};const onArrowDown=()=>{showMenu();changeHighlightedOption(1);};const onBackspace=()=>{showMenu();if(_inputValue.length===1){removeSelectedValue();}};const selectOption=option=>{closeMenu();if(option){$$invalidate(16,_inputValue=option.label);_selectedOption=option;$$invalidate(0,value=option.value);}};return {handle};}function DropdownKeyDownHandler(){const handle=e=>{let stopPropagation=false;switch(e.key){case" ":onSpace();stopPropagation=true;break;case"Enter":onEnter();stopPropagation=true;break;case"Escape":closeMenu();break;case"Up":case"ArrowUp":onArrowUp();stopPropagation=true;break;case"Down":case"ArrowDown":onArrowDown();stopPropagation=true;break;case"Tab":closeMenu();break;}if(stopPropagation){e.preventDefault();e.stopPropagation();}};const onSpace=()=>{$$invalidate(23,_isMenuVisible=!_isMenuVisible);// toggle menu
|
|
242
|
-
if(_highlightedIndex>-1&&_filteredOptions[_highlightedIndex].value!==value)$$invalidate(0,value=_filteredOptions[_highlightedIndex].value);};const onEnter=()=>{$$invalidate(23,_isMenuVisible=!_isMenuVisible);if(_highlightedIndex>-1&&_filteredOptions[_highlightedIndex].value!==value){$$invalidate(0,value=_filteredOptions[_highlightedIndex].value);closeMenu();}};const onArrowUp=()=>{if(!_isMenuVisible)showMenu();changeHighlightedOption(-1);};const onArrowDown=()=>{if(!_isMenuVisible)showMenu();changeHighlightedOption(1);};return {handle};}const comboboxHandler=ComboboxKeyDownHandler();const dropdownHandler=DropdownKeyDownHandler();const onInputKeyDown=e=>{if(_disabled)return;if(_filterable){comboboxHandler.handle(e);}else {dropdownHandler.handle(e);}};function onNativeSelect(e){const target=e.currentTarget;const option=_options[target.selectedIndex];onSelect(option);}function removeSelectedValue(){if(_disabled)return;_previousSelectedValue=null;_selectedOption=undefined;updateInputValue(_selectedOption);}async function onClick(){if(_disabled)return;showMenu();if(_filterable){await tick();_inputEl.focus();}}function onClear(){removeSelectedValue();_inputEl.focus();onClick();}function select_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_selectEl=$$value;$$invalidate(27,_selectEl);(((($$invalidate(15,_options),$$invalidate(18,_el)),$$invalidate(0,value)),$$invalidate(22,_native)),$$invalidate(7,width)),$$invalidate(41,native);});}function input_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_inputEl=$$value;$$invalidate(19,_inputEl);});}function input_input_handler(){_inputValue=this.value;$$invalidate(16,_inputValue);}const keydown_handler=e=>{if(e.key==='Enter'){// for keyboard accessibility to press the clear icon
|
|
243
|
-
onClear();}};const click_handler=option=>onSelect(option);function ul_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_menuEl=$$value;$$invalidate(26,_menuEl);});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_el=$$value;$$invalidate(18,_el);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(1,name=$$props.name);if('arialabel'in $$props)$$invalidate(2,arialabel=$$props.arialabel);if('arialabelledby'in $$props)$$invalidate(3,arialabelledby=$$props.arialabelledby);if('value'in $$props)$$invalidate(0,value=$$props.value);if('filterable'in $$props)$$invalidate(38,filterable=$$props.filterable);if('leadingicon'in $$props)$$invalidate(4,leadingicon=$$props.leadingicon);if('maxheight'in $$props)$$invalidate(5,maxheight=$$props.maxheight);if('placeholder'in $$props)$$invalidate(6,placeholder=$$props.placeholder);if('width'in $$props)$$invalidate(7,width=$$props.width);if('disabled'in $$props)$$invalidate(8,disabled=$$props.disabled);if('error'in $$props)$$invalidate(39,error=$$props.error);if('multiselect'in $$props)$$invalidate(40,multiselect=$$props.multiselect);if('native'in $$props)$$invalidate(41,native=$$props.native);if('relative'in $$props)$$invalidate(9,relative=$$props.relative);if('mt'in $$props)$$invalidate(10,mt=$$props.mt);if('mr'in $$props)$$invalidate(11,mr=$$props.mr);if('mb'in $$props)$$invalidate(12,mb=$$props.mb);if('ml'in $$props)$$invalidate(13,ml=$$props.ml);if('id'in $$props)$$invalidate(14,id=$$props.id);};$$self.$$.update=()=>{if($$self.$$.dirty[0]&/*disabled*/256){$$invalidate(28,_disabled=toBoolean(disabled));}if($$self.$$.dirty[1]&/*error*/256){$$invalidate(30,_error=toBoolean(error));}if($$self.$$.dirty[1]&/*multiselect*/512){_multiselect=toBoolean(multiselect);}if($$self.$$.dirty[1]&/*native*/1024){$$invalidate(22,_native=toBoolean(native));}if($$self.$$.dirty[0]&/*_native*/4194304|$$self.$$.dirty[1]&/*filterable*/128){$$invalidate(20,_filterable=toBoolean(filterable)&&!_native);// Will replace datalist for filterable true
|
|
244
|
-
}if($$self.$$.dirty[0]&/*_el, value, _native, width, _options*/4489345){// Reactive statement
|
|
245
|
-
if(_el){_values=parseValues(value);$$invalidate(15,_options=getOptions());if(!_native){$$invalidate(24,_width=width||getCustomDropdownWidth(_options));}if(_options.length){updateSelectedValue(value);}}}if($$self.$$.dirty[0]&/*_filterable, _options, _inputValue*/1146880){$$invalidate(21,_filteredOptions=_filterable?_options.filter(option=>isMatched(option,_inputValue)):_options);}if($$self.$$.dirty[0]&/*_filteredOptions, _highlightedIndex*/2228224){// Accessibility
|
|
246
|
-
$$invalidate(29,_activeDescendantId=_filteredOptions[_highlightedIndex]?_filteredOptions[_highlightedIndex].value:undefined);//To keep track of active descendant for the accessibility
|
|
247
|
-
}if($$self.$$.dirty[0]&/*_inputEl, _options*/557056){if(_inputEl&&_options.length){$$invalidate(25,_inputWidth=`${_inputEl.getBoundingClientRect().width}px`);}}};return [value,name,arialabel,arialabelledby,leadingicon,maxheight,placeholder,width,disabled,relative,mt,mr,mb,ml,id,_options,_inputValue,_highlightedIndex,_el,_inputEl,_filterable,_filteredOptions,_native,_isMenuVisible,_width,_inputWidth,_menuEl,_selectEl,_disabled,_activeDescendantId,_error,showMenu,closeMenu,onSelect,onInputKeyDown,onNativeSelect,onClick,onClear,filterable,error,multiselect,native,select_binding,input_binding,input_input_handler,keydown_handler,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-input-group{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;background-color:var(--goa-color-greyscale-white);cursor:pointer;width:100%}.dropdown-input-group:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}.dropdown-input-group:focus,.dropdown-input-group:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}@media screen and (max-width: 623px){@media not (max-color:2147477350){.dropdown-input-group{width:var(--width)}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.dropdown-input-group{width:var(--width)}}}.dropdown-input-group.error,.dropdown-input-group.error:hover{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 1px var(--goa-color-interactive-error)}.dropdown-input-group.error:focus-within,.dropdown-input-group.error:focus{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.dropdown-icon--arrow,.dropdown-icon--clear{margin-right:var(--goa-space-s)}.dropdown-icon--clear:focus:not(.disabled),.dropdown-icon--clear:active:not(.disabled){color:var(--goa-color-interactive-focus);outline:none}.dropdown-input--leading-icon{margin-left:0.75rem}.dropdown-input--leading-icon+input{padding-left:0.5rem}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-xs);padding-left:var(--goa-space-s);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans);z-index:1}input,input:focus,input:hover,input:active{outline:none;border:none}input[aria-disabled="true"]{color:var(--goa-color-text-secondary)}.dropdown-input-group--disabled,.dropdown-input-group--disabled:hover,.dropdown-input-group--disabled:active,.dropdown-input-group--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200) !important;cursor:default;box-shadow:none !important}ul[role="listbox"]{border-radius:var(--goa-border-radius-m)}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item:hover,.dropdown-item--highlighted{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item[aria-selected="true"]{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item[aria-selected="true"]:hover,.dropdown-item[aria-selected="true"].dropdown-item--highlighted{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{position:relative;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;font:var(--goa-font-family-sans);background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:calc(var(--goa-space-xs) + 1px);padding-left:var(--goa-space-s);padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$G,create_fragment$J,safe_not_equal,{name:1,arialabel:2,arialabelledby:3,value:0,filterable:38,leadingicon:4,maxheight:5,placeholder:6,width:7,disabled:8,error:39,multiselect:40,native:41,relative:9,mt:10,mr:11,mb:12,ml:13,id:14},null,[-1,-1,-1]);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","arialabel","arialabelledby","value","filterable","leadingicon","maxheight","placeholder","width","disabled","error","multiselect","native","relative","mt","mr","mb","ml","id"];}get name(){return this.$$.ctx[1];}set name(name){this.$$set({name});flush();}get arialabel(){return this.$$.ctx[2];}set arialabel(arialabel){this.$$set({arialabel});flush();}get arialabelledby(){return this.$$.ctx[3];}set arialabelledby(arialabelledby){this.$$set({arialabelledby});flush();}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get filterable(){return this.$$.ctx[38];}set filterable(filterable){this.$$set({filterable});flush();}get leadingicon(){return this.$$.ctx[4];}set leadingicon(leadingicon){this.$$set({leadingicon});flush();}get maxheight(){return this.$$.ctx[5];}set maxheight(maxheight){this.$$set({maxheight});flush();}get placeholder(){return this.$$.ctx[6];}set placeholder(placeholder){this.$$set({placeholder});flush();}get width(){return this.$$.ctx[7];}set width(width){this.$$set({width});flush();}get disabled(){return this.$$.ctx[8];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[39];}set error(error){this.$$set({error});flush();}get multiselect(){return this.$$.ctx[40];}set multiselect(multiselect){this.$$set({multiselect});flush();}get native(){return this.$$.ctx[41];}set native(native){this.$$set({native});flush();}get relative(){return this.$$.ctx[9];}set relative(relative){this.$$set({relative});flush();}get mt(){return this.$$.ctx[10];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[11];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[12];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[13];}set ml(ml){this.$$set({ml});flush();}get id(){return this.$$.ctx[14];}set id(id){this.$$set({id});flush();}}customElements.define("goa-dropdown",Dropdown);/* src/components/dropdown/DropdownItem.svelte generated by Svelte v3.59.2 */function create_fragment$I(ctx){return {c(){this.c=noop;},m:noop,p:noop,i:noop,o:noop,d:noop};}function instance$F($$self,$$props,$$invalidate){let{filter=""}=$$props;let{label=""}=$$props;let{value=""}=$$props;$$self.$$set=$$props=>{if('filter'in $$props)$$invalidate(0,filter=$$props.filter);if('label'in $$props)$$invalidate(1,label=$$props.label);if('value'in $$props)$$invalidate(2,value=$$props.value);};return [filter,label,value];}class DropdownItem extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$F,create_fragment$I,safe_not_equal,{filter:0,label:1,value:2},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["filter","label","value"];}get filter(){return this.$$.ctx[0];}set filter(filter){this.$$set({filter});flush();}get label(){return this.$$.ctx[1];}set label(label){this.$$set({label});flush();}get value(){return this.$$.ctx[2];}set value(value){this.$$set({value});flush();}}customElements.define("goa-dropdown-item",DropdownItem);/* src/components/focus-trap/FocusTrap.svelte generated by Svelte v3.59.2 */function create_fragment$H(ctx){let div;return {c(){div=element("div");div.innerHTML=`<span data-tab-boundry="start" tabindex="0"></span>
|
|
216
|
+
if(leadingicon){maxWidth+=2;}return `${maxWidth}ch`;}// Change the direction of highlighted options for Arrow up and down
|
|
217
|
+
function changeHighlightedOption(offset){let index=_highlightedIndex+offset;let items=!(_filteredOptions===null||_filteredOptions===void 0?void 0:_filteredOptions.length)?_options:_filteredOptions;if(items.length===0)return;// if index is out of scope
|
|
218
|
+
if(index<0){index=_filterable?items.length-1:0;}else if(index>=items.length){index=_filterable?0:items.length-1;}$$invalidate(14,_highlightedIndex=index);scrollToOption(index);}function scrollToOption(index){const liNode=_menuEl.querySelector(`li[data-index="${index}"]`);if(!liNode)return;const liOptionRect=liNode.getBoundingClientRect();const ulRect=_menuEl.getBoundingClientRect();const isInView=liOptionRect.top>=0&&liOptionRect.left>=0&&liOptionRect.bottom<=ulRect.height&&liOptionRect.right<=ulRect.width;if(isInView)return;liNode.scrollIntoView({behavior:"smooth",block:"nearest"});}function syncFilteredOptions(){$$invalidate(15,_filteredOptions=_filterable?_options.filter(option=>isFilterMatch(option,_inputEl.value)):_options);}function showMenu(){if(_disabled){return;}setTimeout(()=>{syncFilteredOptions();$$invalidate(18,_isMenuVisible=true);_inputEl.focus();},0);}function hideMenu(){$$invalidate(18,_isMenuVisible=false);}function dispatchValue(value){const detail=_multiselect?{name,values:[value,..._values]}:{name,value};setTimeout(()=>{_rootEl.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));_isDirty=false;},1);}//
|
|
219
|
+
// Event handlers
|
|
220
|
+
//
|
|
221
|
+
function onSelect(option){if(_disabled)return;if(!_native){_isDirty=true;hideMenu();$$invalidate(23,_inputEl.value=option.label,_inputEl);}dispatchValue(option.value);}function onInputKeyUp(e){if(_disabled)return;_eventHandler.handleKeyUp(e);}function onInputKeyDown(e){if(_disabled)return;_eventHandler.handleKeyDown(e);}function onClearIconKeyDown(e){if(e.key==="Enter"||e.key===" "){e.stopPropagation();reset();showMenu();}}function onClearIconClick(e){reset();showMenu();e.stopPropagation();}function onNativeSelect(e){const target=e.currentTarget;const option=_options[target.selectedIndex];onSelect(option);}function reset(){if(_disabled)return;$$invalidate(25,_activeDescendantId=undefined);$$invalidate(14,_highlightedIndex=-1);$$invalidate(23,_inputEl.value="",_inputEl);_isDirty=false;syncFilteredOptions();dispatchValue("");}function onChevronClick(e){showMenu();e.stopPropagation();}class ComboboxKeyUpHandler{constructor(input){this.input=input;input.addEventListener("blur",async function(e){if(!_isDirty)return;if(!_filterable)return;const input=e.target;const selectedOption=_filteredOptions.find(o=>o.label===input.value);if(!selectedOption){dispatchValue("");input.value="";}});}onEscape(e){reset();_inputEl.focus();e.preventDefault();e.stopPropagation();}onEnter(e){const option=_filteredOptions[_highlightedIndex];if(option){onSelect(option);}if(_inputEl.value){hideMenu();}else {showMenu();}e.stopPropagation();}onArrow(e,direction){if(!_isMenuVisible)showMenu();changeHighlightedOption(direction==="up"?-1:1);e.stopPropagation();}onTab(_){const matchedOption=_filteredOptions.find(option=>option.label.toLowerCase()===this.input.value.toLowerCase());if(matchedOption){onSelect(matchedOption);}hideMenu();}onKeyUp(_){showMenu();_isDirty=true;}handleKeyUp(e){switch(e.key){case"Enter":this.onEnter(e);break;case"ArrowUp":this.onArrow(e,"up");break;case"ArrowDown":this.onArrow(e,"down");break;case"Home":this.input.setSelectionRange(0,0);break;case"End":this.input.setSelectionRange(this.input.value.length,this.input.value.length);break;default:this.onKeyUp(e);break;}}handleKeyDown(e){switch(e.key){case"Escape":this.onEscape(e);break;case"Tab":this.onTab(e);break;}}}class DropdownKeyUpHandler{constructor(_input){}onEnter(e){if(_isMenuVisible){const option=_filteredOptions[_highlightedIndex];if(option){onSelect(option);}hideMenu();}else {showMenu();}e.preventDefault();e.stopPropagation();}onArrow(e,direction){if(!_isMenuVisible)showMenu();changeHighlightedOption(direction==="up"?-1:1);e.preventDefault();e.stopPropagation();}handleKeyDown(e){switch(e.key){case" ":case"Enter":this.onEnter(e);break;case"ArrowUp":this.onArrow(e,"up");break;case"ArrowDown":this.onArrow(e,"down");break;case"Tab":hideMenu();break;}return false;}handleKeyUp(e){switch(e.key){case"ArrowUp":case"ArrowDown":case" ":case"Enter":e.preventDefault();e.stopPropagation();}}}function select_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_selectEl=$$value;$$invalidate(22,_selectEl);$$invalidate(17,_options);});}function input_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_inputEl=$$value;$$invalidate(23,_inputEl);});}const click_handler=option=>onSelect(option);function ul_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_menuEl=$$value;$$invalidate(21,_menuEl);});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(20,_rootEl);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(0,name=$$props.name);if('arialabel'in $$props)$$invalidate(1,arialabel=$$props.arialabel);if('arialabelledby'in $$props)$$invalidate(2,arialabelledby=$$props.arialabelledby);if('value'in $$props)$$invalidate(3,value=$$props.value);if('filterable'in $$props)$$invalidate(37,filterable=$$props.filterable);if('leadingicon'in $$props)$$invalidate(4,leadingicon=$$props.leadingicon);if('maxheight'in $$props)$$invalidate(5,maxheight=$$props.maxheight);if('placeholder'in $$props)$$invalidate(6,placeholder=$$props.placeholder);if('width'in $$props)$$invalidate(7,width=$$props.width);if('disabled'in $$props)$$invalidate(8,disabled=$$props.disabled);if('error'in $$props)$$invalidate(38,error=$$props.error);if('multiselect'in $$props)$$invalidate(39,multiselect=$$props.multiselect);if('native'in $$props)$$invalidate(40,native=$$props.native);if('relative'in $$props)$$invalidate(9,relative=$$props.relative);if('mt'in $$props)$$invalidate(10,mt=$$props.mt);if('mr'in $$props)$$invalidate(11,mr=$$props.mr);if('mb'in $$props)$$invalidate(12,mb=$$props.mb);if('ml'in $$props)$$invalidate(13,ml=$$props.ml);};$$self.$$.update=()=>{if($$self.$$.dirty[0]&/*disabled*/256){//
|
|
222
|
+
// Reactive
|
|
223
|
+
//
|
|
224
|
+
$$invalidate(26,_disabled=toBoolean(disabled));}if($$self.$$.dirty[1]&/*error*/128){$$invalidate(27,_error=toBoolean(error));}if($$self.$$.dirty[1]&/*multiselect*/256){_multiselect=toBoolean(multiselect);}if($$self.$$.dirty[1]&/*native*/512){$$invalidate(16,_native=toBoolean(native));}if($$self.$$.dirty[0]&/*_native*/65536|$$self.$$.dirty[1]&/*filterable*/64){$$invalidate(24,_filterable=toBoolean(filterable)&&!_native);}if($$self.$$.dirty[0]&/*_filteredOptions, _highlightedIndex*/49152){// To keep track of active descendant for the accessibility
|
|
225
|
+
$$invalidate(25,_activeDescendantId=_filteredOptions[_highlightedIndex]?_filteredOptions[_highlightedIndex].value:undefined);}if($$self.$$.dirty[0]&/*value*/8){{_values=parseValues(value);// updating _inputEl.value is done within seperate function
|
|
226
|
+
// to prevent unwanted reactive updates.
|
|
227
|
+
setDisplayedValue();}}};return [name,arialabel,arialabelledby,value,leadingicon,maxheight,placeholder,width,disabled,relative,mt,mr,mb,ml,_highlightedIndex,_filteredOptions,_native,_options,_isMenuVisible,_width,_rootEl,_menuEl,_selectEl,_inputEl,_filterable,_activeDescendantId,_disabled,_error,showMenu,hideMenu,onSelect,onInputKeyUp,onInputKeyDown,onClearIconKeyDown,onClearIconClick,onNativeSelect,onChevronClick,filterable,error,multiselect,native,select_binding,input_binding,click_handler,ul_binding,div_binding];}class Dropdown extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.dropdown{cursor:pointer;display:inline-block;width:var(--width, 100%)}.dropdown-input-group{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;background-color:var(--goa-color-greyscale-white);cursor:pointer;width:100%}.dropdown-input-group:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}.dropdown-input-group:focus,.dropdown-input-group:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}@media screen and (max-width: 623px){@media not (max-color:2147477350){.dropdown-input-group{width:var(--width)}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.dropdown-input-group{width:var(--width)}}}.dropdown-input-group.error,.dropdown-input-group.error:hover{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 1px var(--goa-color-interactive-error)}.dropdown-input-group.error:focus-within,.dropdown-input-group.error:focus{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.dropdown-icon--arrow,.dropdown-icon--clear{margin-right:var(--goa-space-s)}.dropdown-icon--clear:focus:not(.disabled),.dropdown-icon--clear:active:not(.disabled){color:var(--goa-color-interactive-focus);outline:none}.dropdown-input--leading-icon{margin-left:0.75rem}.dropdown-input--leading-icon+input{padding-left:0.5rem}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-xs);padding-left:var(--goa-space-s);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans);z-index:1}input,input:focus,input:hover,input:active{outline:none;border:none}input[aria-disabled="true"]{color:var(--goa-color-text-secondary)}.dropdown-input-group--disabled,.dropdown-input-group--disabled:hover,.dropdown-input-group--disabled:active,.dropdown-input-group--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200) !important;cursor:default;box-shadow:none !important}ul[role="listbox"]{border-radius:var(--goa-border-radius-m)}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item:hover,.dropdown-item--highlighted{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item[aria-selected="true"]{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item[aria-selected="true"]:hover,.dropdown-item[aria-selected="true"].dropdown-item--highlighted{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{position:relative;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;font:var(--goa-font-family-sans);background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:calc(var(--goa-space-xs) + 1px);padding-left:var(--goa-space-s);padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$G,create_fragment$J,safe_not_equal,{name:0,arialabel:1,arialabelledby:2,value:3,filterable:37,leadingicon:4,maxheight:5,placeholder:6,width:7,disabled:8,error:38,multiselect:39,native:40,relative:9,mt:10,mr:11,mb:12,ml:13},null,[-1,-1,-1]);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","arialabel","arialabelledby","value","filterable","leadingicon","maxheight","placeholder","width","disabled","error","multiselect","native","relative","mt","mr","mb","ml"];}get name(){return this.$$.ctx[0];}set name(name){this.$$set({name});flush();}get arialabel(){return this.$$.ctx[1];}set arialabel(arialabel){this.$$set({arialabel});flush();}get arialabelledby(){return this.$$.ctx[2];}set arialabelledby(arialabelledby){this.$$set({arialabelledby});flush();}get value(){return this.$$.ctx[3];}set value(value){this.$$set({value});flush();}get filterable(){return this.$$.ctx[37];}set filterable(filterable){this.$$set({filterable});flush();}get leadingicon(){return this.$$.ctx[4];}set leadingicon(leadingicon){this.$$set({leadingicon});flush();}get maxheight(){return this.$$.ctx[5];}set maxheight(maxheight){this.$$set({maxheight});flush();}get placeholder(){return this.$$.ctx[6];}set placeholder(placeholder){this.$$set({placeholder});flush();}get width(){return this.$$.ctx[7];}set width(width){this.$$set({width});flush();}get disabled(){return this.$$.ctx[8];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[38];}set error(error){this.$$set({error});flush();}get multiselect(){return this.$$.ctx[39];}set multiselect(multiselect){this.$$set({multiselect});flush();}get native(){return this.$$.ctx[40];}set native(native){this.$$set({native});flush();}get relative(){return this.$$.ctx[9];}set relative(relative){this.$$set({relative});flush();}get mt(){return this.$$.ctx[10];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[11];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[12];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[13];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-dropdown",Dropdown);/* src/components/dropdown/DropdownItem.svelte generated by Svelte v3.59.2 */function create_fragment$I(ctx){return {c(){this.c=noop;},m:noop,p:noop,i:noop,o:noop,d:noop};}function instance$F($$self,$$props,$$invalidate){let{filter=""}=$$props;let{label=""}=$$props;let{value=""}=$$props;$$self.$$set=$$props=>{if('filter'in $$props)$$invalidate(0,filter=$$props.filter);if('label'in $$props)$$invalidate(1,label=$$props.label);if('value'in $$props)$$invalidate(2,value=$$props.value);};return [filter,label,value];}class DropdownItem extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$F,create_fragment$I,safe_not_equal,{filter:0,label:1,value:2},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["filter","label","value"];}get filter(){return this.$$.ctx[0];}set filter(filter){this.$$set({filter});flush();}get label(){return this.$$.ctx[1];}set label(label){this.$$set({label});flush();}get value(){return this.$$.ctx[2];}set value(value){this.$$set({value});flush();}}customElements.define("goa-dropdown-item",DropdownItem);/* src/components/focus-trap/FocusTrap.svelte generated by Svelte v3.59.2 */function create_fragment$H(ctx){let div;return {c(){div=element("div");div.innerHTML=`<span data-tab-boundry="start" tabindex="0"></span>
|
|
248
228
|
<slot></slot>
|
|
249
229
|
|
|
250
230
|
<span data-tab-boundry="end" tabindex="0"></span>`;this.c=noop;},m(target,anchor){insert(target,div,anchor);/*div_binding*/ctx[1](div);},p:noop,i:noop,o:noop,d(detaching){if(detaching)detach(div);/*div_binding*/ctx[1](null);}};}function isFocusable(node){var _a;const element=node;const isTabbable=element.tabIndex>0||element.tabIndex===0&&element.getAttribute('tabIndex')!==null;if(isTabbable)return node;if(element["disabled"])return null;if(element.tabIndex<0||((_a=element.getAttribute)===null||_a===void 0?void 0:_a.call(element,"tabindex"))==="-1")return null;switch(element.nodeName){case'A':{const el=element;if(!!el.href&&el.rel!=='ignore')return node;}case'INPUT':{const el=element;if(el.type!=='hidden'&&el.type!=='file')return node;}case'BUTTON':case'SELECT':case'TEXTAREA':return node;default:return null;}}function instance$E($$self,$$props,$$invalidate){let rootEl;let boundryStartEl;let boundryEndEl;let isShiftPressed;// Hooks
|
|
@@ -325,13 +305,13 @@ pageDropdownEl&&pageDropdownEl.addEventListener("_change",e=>{const page=Number.
|
|
|
325
305
|
function goto(e,offset){const newPage=Number.parseInt(pagenumber+"")+offset;if(newPage>0&&newPage<=_pageCount){e.target.dispatchEvent(new CustomEvent("_change",{composed:true,bubbles:true,detail:{page:newPage}}));}e.preventDefault();}function input_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{hiddenEl=$$value;$$invalidate(7,hiddenEl);});}function goa_dropdown_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{pageDropdownEl=$$value;$$invalidate(6,pageDropdownEl);});}const click_handler=e=>goto(e,-1);const click_handler_1=e=>goto(e,1);$$self.$$set=$$props=>{if('pagenumber'in $$props)$$invalidate(0,pagenumber=$$props.pagenumber);if('itemcount'in $$props)$$invalidate(10,itemcount=$$props.itemcount);if('perpagecount'in $$props)$$invalidate(11,perpagecount=$$props.perpagecount);if('variant'in $$props)$$invalidate(1,variant=$$props.variant);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);};$$self.$$.update=()=>{if($$self.$$.dirty&/*itemcount, perpagecount*/3072){// reactive
|
|
326
306
|
$$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 screen and (max-width: 623px){@media not (max-color:2147477350){.controls{flex-direction:row;justify-content:space-between}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.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$q,create_fragment$t,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);/* src/components/popover/Popover.svelte generated by Svelte v3.59.2 */function create_if_block$e(ctx){let div0;let t;let div2;let section;let goa_focus_trap;let div1;let section_style_value;let section_resize_listener;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=`
|
|
327
307
|
${cssVar("width",/*width*/ctx[2])}
|
|
328
|
-
max-width: ${/*maxwidth*/ctx[1]
|
|
308
|
+
max-width: ${/*maxwidth*/ctx[1]};
|
|
329
309
|
padding: ${/*_padded*/ctx[19]?"var(--goa-space-m)":"0"};
|
|
330
|
-
`);add_render_callback(()=>/*section_elementresize_handler*/ctx[
|
|
310
|
+
`);add_render_callback(()=>/*section_elementresize_handler*/ctx[29].call(section));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[28](div1);section_resize_listener=add_iframe_resize_listener(section,/*section_elementresize_handler*/ctx[29].bind(section));/*section_binding*/ctx[30](section);if(!mounted){dispose=listen(div0,"click",/*closePopover*/ctx[21]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*width, maxwidth, _padded*/524294&§ion_style_value!==(section_style_value=`
|
|
331
311
|
${cssVar("width",/*width*/ctx[2])}
|
|
332
|
-
max-width: ${/*maxwidth*/ctx[1]
|
|
312
|
+
max-width: ${/*maxwidth*/ctx[1]};
|
|
333
313
|
padding: ${/*_padded*/ctx[19]?"var(--goa-space-m)":"0"};
|
|
334
|
-
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[
|
|
314
|
+
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[28](null);section_resize_listener();/*section_binding*/ctx[30](null);mounted=false;dispose();}};}function create_fragment$s(ctx){let div1;let div0;let slot;let div0_tabindex_value;let t;let div1_style_value;let mounted;let dispose;let if_block=/*_open*/ctx[13]&&create_if_block$e(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=`
|
|
335
315
|
${/*_relative*/ctx[18]&&"position: relative;"}
|
|
336
316
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
337
317
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
@@ -341,7 +321,7 @@ $$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumb
|
|
|
341
321
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
342
322
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
343
323
|
${cssVar("width","100%")}
|
|
344
|
-
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[
|
|
324
|
+
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[27](div0);append(div1,t);if(if_block)if_block.m(div1,null);/*div1_binding_1*/ctx[31](div1);if(!mounted){dispose=listen(div0,"click",/*openPopover*/ctx[20]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*tabindex*/128&&div0_tabindex_value!==(div0_tabindex_value=+/*tabindex*/ctx[7])){attr(div0,"tabindex",div0_tabindex_value);}if(/*_open*/ctx[13]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$e(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*/266104&&div1_style_value!==(div1_style_value=`
|
|
345
325
|
${/*_relative*/ctx[18]&&"position: relative;"}
|
|
346
326
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
347
327
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
@@ -351,7 +331,7 @@ $$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumb
|
|
|
351
331
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
352
332
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
353
333
|
${cssVar("width","100%")}
|
|
354
|
-
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[
|
|
334
|
+
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[27](null);if(if_block)if_block.d();/*div1_binding_1*/ctx[31](null);mounted=false;dispose();}};}function getBoundingClientRectWithMargins(el){const rect=el.getBoundingClientRect();const style=window.getComputedStyle(el);const mTop=parseInt(style.marginTop,10)||0;const mRight=parseInt(style.marginRight,10)||0;const mBottom=parseInt(style.marginBottom,10)||0;const mLeft=parseInt(style.marginLeft,10)||0;return {top:rect.top-mTop,right:rect.right+mRight,bottom:rect.bottom+mBottom,left:rect.left-mLeft,width:rect.width+mLeft+mRight,height:rect.height+mTop+mBottom,x:rect.x-mLeft,y:rect.y-mTop};}function instance$p($$self,$$props,$$invalidate){let _padded;let _open;let _disabled;let _relative;let{testid="popover"}=$$props;let{maxwidth="320px"}=$$props;let{width=""}=$$props;let{padded="true"}=$$props;let{position="auto"}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let{disabled="false"}=$$props;let{tabindex="0"}=$$props;let{voffset=""}=$$props;let{hoffset=""}=$$props;let{focusborderwidth="var(--goa-border-width-l)"}=$$props;let{borderradius="var(--goa-border-radius-m)"}=$$props;// Private
|
|
355
335
|
let _rootEl;let _targetEl;let _popoverEl;let _focusTrapEl;let _initFocusedEl;let _sectionHeight;// Hooks
|
|
356
336
|
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
|
|
357
337
|
children=[..._targetEl.children];}_initFocusedEl=children.find(el=>el.tabIndex>=0)||_targetEl;});// Functions
|
|
@@ -372,8 +352,8 @@ const displayOnTop=position==="auto"?spaceBelow<contentRect.height&&spaceAbove>c
|
|
|
372
352
|
// account the scroll offset
|
|
373
353
|
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
|
|
374
354
|
if(_relative){$$invalidate(16,_popoverEl.style.top=displayOnTop?`-${contentRect.height}px`:`${rootRect.height}px`,_popoverEl);}else {$$invalidate(16,_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
|
|
375
|
-
const displayOnRight=document.body.clientWidth-targetRect.left<contentRect.width&&targetRect.left>contentRect.width;if(_relative){if(displayOnRight){$$invalidate(16,_popoverEl.style.right="0",_popoverEl);}else {$$invalidate(16,_popoverEl.style.left="0",_popoverEl);}}else {$$invalidate(16,_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(15,_targetEl);});}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_focusTrapEl=$$value;$$invalidate(17,_focusTrapEl);});}function section_elementresize_handler(){_sectionHeight=this.clientHeight;$$invalidate(12,_sectionHeight);}function section_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_popoverEl=$$value;$$invalidate(16,_popoverEl);});}function div1_binding_1($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(14,_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(22,padded=$$props.padded);if('position'in $$props)$$invalidate(23,position=$$props.position);if('relative'in $$props)$$invalidate(24,relative=$$props.relative);if('
|
|
376
|
-
$$invalidate(19,_padded=toBoolean(padded));}if($$self.$$.dirty[0]&/*open*/
|
|
355
|
+
const displayOnRight=document.body.clientWidth-targetRect.left<contentRect.width&&targetRect.left>contentRect.width;if(_relative){if(displayOnRight){$$invalidate(16,_popoverEl.style.right="0",_popoverEl);}else {$$invalidate(16,_popoverEl.style.left="0",_popoverEl);}}else {$$invalidate(16,_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(15,_targetEl);});}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_focusTrapEl=$$value;$$invalidate(17,_focusTrapEl);});}function section_elementresize_handler(){_sectionHeight=this.clientHeight;$$invalidate(12,_sectionHeight);}function section_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_popoverEl=$$value;$$invalidate(16,_popoverEl);});}function div1_binding_1($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(14,_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(22,padded=$$props.padded);if('position'in $$props)$$invalidate(23,position=$$props.position);if('relative'in $$props)$$invalidate(24,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(25,open=$$props.open);if('disabled'in $$props)$$invalidate(26,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*/4194304){// Reactive
|
|
356
|
+
$$invalidate(19,_padded=toBoolean(padded));}if($$self.$$.dirty[0]&/*open*/33554432){$$invalidate(13,_open=toBoolean(open));}if($$self.$$.dirty[0]&/*disabled*/67108864){_disabled=toBoolean(disabled);}if($$self.$$.dirty[0]&/*relative*/16777216){$$invalidate(18,_relative=toBoolean(relative));}if($$self.$$.dirty[0]&/*_open*/8192){(async()=>_open&&(await setPopoverPosition()))();}if($$self.$$.dirty[0]&/*_sectionHeight*/4096){(async()=>_sectionHeight&&(await setPopoverPosition()))();}if($$self.$$.dirty[0]&/*_open*/8192){{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,_sectionHeight,_open,_rootEl,_targetEl,_popoverEl,_focusTrapEl,_relative,_padded,openPopover,closePopover,padded,position,relative,open,disabled,div0_binding,div1_binding,section_elementresize_handler,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{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:-moz-fit-content;width:fit-content;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:-moz-max-content;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$p,create_fragment$s,safe_not_equal,{testid:0,maxwidth:1,width:2,padded:22,position:23,relative:24,mt:3,mr:4,mb:5,ml:6,open:25,disabled:26,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[22];}set padded(padded){this.$$set({padded});flush();}get position(){return this.$$.ctx[23];}set position(position){this.$$set({position});flush();}get relative(){return this.$$.ctx[24];}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[25];}set open(open){this.$$set({open});flush();}get disabled(){return this.$$.ctx[26];}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);/* src/components/radio-group/RadioGroup.svelte generated by Svelte v3.59.2 */function get_each_context$4(ctx,list,i){const child_ctx=ctx.slice();child_ctx[22]=list[i];child_ctx[24]=i;return child_ctx;}// (105:6) {#if option.description}
|
|
377
357
|
function create_if_block$d(ctx){let div;let t_value=/*option*/ctx[22].description+"";let t;let div_id_value;return {c(){div=element("div");t=text(t_value);attr(div,"class","goa-radio-description");attr(div,"id",div_id_value=`description-${/*name*/ctx[1]}-${/*index*/ctx[24]}`);},m(target,anchor){insert(target,div,anchor);append(div,t);},p(ctx,dirty){if(dirty&/*options*/512&&t_value!==(t_value=/*option*/ctx[22].description+""))set_data(t,t_value);if(dirty&/*name, options*/514&&div_id_value!==(div_id_value=`description-${/*name*/ctx[1]}-${/*index*/ctx[24]}`)){attr(div,"id",div_id_value);}},d(detaching){if(detaching)detach(div);}};}// (82:2) {#each options as option, index (option.value)}
|
|
378
358
|
function create_each_block$4(key_1,ctx){let div1;let label;let input;let input_value_value;let input_checked_value;let input_aria_label_value;let input_aria_describedby_value;let t0;let div0;let t1;let span;let t2_value=(/*option*/ctx[22].label||/*option*/ctx[22].value)+"";let t2;let label_data_testid_value;let t3;let t4;let mounted;let dispose;function change_handler(){return(/*change_handler*/ctx[16](/*option*/ctx[22]));}let if_block=/*option*/ctx[22].description&&create_if_block$d(ctx);return {key:key_1,first:null,c(){div1=element("div");label=element("label");input=element("input");t0=space();div0=element("div");t1=space();span=element("span");t2=text(t2_value);t3=space();if(if_block)if_block.c();t4=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(input,"aria-describedby",input_aria_describedby_value=`description-${/*name*/ctx[1]}-${/*index*/ctx[24]}`);attr(div0,"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]);attr(div1,"class","goa-radio-container");this.first=div1;},m(target,anchor){insert(target,div1,anchor);append(div1,label);append(label,input);append(label,t0);append(label,div0);append(label,t1);append(label,span);append(span,t2);append(div1,t3);if(if_block)if_block.m(div1,null);append(div1,t4);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&/*name, options*/514&&input_aria_describedby_value!==(input_aria_describedby_value=`description-${/*name*/ctx[1]}-${/*index*/ctx[24]}`)){attr(input,"aria-describedby",input_aria_describedby_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]);}if(/*option*/ctx[22].description){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$d(ctx);if_block.c();if_block.m(div1,t4);}}else if(if_block){if_block.d(1);if_block=null;}},d(detaching){if(detaching)detach(div1);if(if_block)if_block.d();mounted=false;dispose();}};}function create_fragment$r(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$4(ctx,each_value,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block$4(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&/*name, options, isDisabled, isError, 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$4,null,get_each_context$4);}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$o($$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());});/**
|
|
379
359
|
* Allows the child elements to be obtainable within unit tests
|
|
@@ -1416,7 +1396,7 @@ function create_each_block_4(ctx){let goa_dropdown_item;let goa_dropdown_item_va
|
|
|
1416
1396
|
function create_each_block_3(ctx){let goa_dropdown_item;let goa_dropdown_item_value_value;return {c(){goa_dropdown_item=element("goa-dropdown-item");set_custom_element_data(goa_dropdown_item,"value",goa_dropdown_item_value_value=/*year*/ctx[34]);},m(target,anchor){insert(target,goa_dropdown_item,anchor);},p(ctx,dirty){if(dirty[0]&/*_years*/16384&&goa_dropdown_item_value_value!==(goa_dropdown_item_value_value=/*year*/ctx[34])){set_custom_element_data(goa_dropdown_item,"value",goa_dropdown_item_value_value);}},d(detaching){if(detaching)detach(goa_dropdown_item);}};}// (232:4) {#each _previousMonthDays as d}
|
|
1417
1397
|
function create_each_block_2(ctx){let button;let div;let t_value=/*d*/ctx[27].getDate()+"";let t;let button_aria_label_value;let button_data_date_value;let button_data_day_value;let button_tabindex_value;let mounted;let dispose;return {c(){button=element("button");div=element("div");t=text(t_value);attr(div,"class","day-num");attr(div,"data-testid","date");attr(button,"aria-label",button_aria_label_value=format(/*d*/ctx[27],"PPPP"));attr(button,"data-date",button_data_date_value=format(/*d*/ctx[27],"T"));attr(button,"data-day",button_data_day_value=format(/*d*/ctx[27],"eee"));attr(button,"class","day other-month");attr(button,"tabindex",button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1);toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));},m(target,anchor){insert(target,button,anchor);append(button,div);append(div,t);if(!mounted){dispose=listen(button,"click",/*onDateClick*/ctx[19]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*_previousMonthDays*/4096&&t_value!==(t_value=/*d*/ctx[27].getDate()+""))set_data(t,t_value);if(dirty[0]&/*_previousMonthDays*/4096&&button_aria_label_value!==(button_aria_label_value=format(/*d*/ctx[27],"PPPP"))){attr(button,"aria-label",button_aria_label_value);}if(dirty[0]&/*_previousMonthDays*/4096&&button_data_date_value!==(button_data_date_value=format(/*d*/ctx[27],"T"))){attr(button,"data-date",button_data_date_value);}if(dirty[0]&/*_previousMonthDays*/4096&&button_data_day_value!==(button_data_day_value=format(/*d*/ctx[27],"eee"))){attr(button,"data-day",button_data_day_value);}if(dirty[0]&/*_previousMonthDays, _calendarDate*/4352&&button_tabindex_value!==(button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1)){attr(button,"tabindex",button_tabindex_value);}if(dirty[0]&/*_previousMonthDays, _min, _max*/5632){toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));}},d(detaching){if(detaching)detach(button);mounted=false;dispose();}};}// (245:4) {#each _monthDays as d}
|
|
1418
1398
|
function create_each_block_1(ctx){let button;let div;let t_value=/*d*/ctx[27].getDate()+"";let t;let button_aria_label_value;let button_data_date_value;let button_data_day_value;let button_tabindex_value;let mounted;let dispose;return {c(){button=element("button");div=element("div");t=text(t_value);attr(div,"class","day-num");attr(div,"data-testid","date");attr(button,"aria-label",button_aria_label_value=format(/*d*/ctx[27],"PPPP"));attr(button,"data-date",button_data_date_value=format(/*d*/ctx[27],"T"));attr(button,"data-day",button_data_day_value=format(/*d*/ctx[27],"eee"));attr(button,"class","day");attr(button,"tabindex",button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1);toggle_class(button,"today",isSameDay(/*d*/ctx[27],new Date()));toggle_class(button,"selected",/*value*/ctx[0]&&isSameDay(/*d*/ctx[27],/*_selectedDate*/ctx[7]));toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));},m(target,anchor){insert(target,button,anchor);append(button,div);append(div,t);if(!mounted){dispose=listen(button,"click",/*onDateClick*/ctx[19]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*_monthDays*/2048&&t_value!==(t_value=/*d*/ctx[27].getDate()+""))set_data(t,t_value);if(dirty[0]&/*_monthDays*/2048&&button_aria_label_value!==(button_aria_label_value=format(/*d*/ctx[27],"PPPP"))){attr(button,"aria-label",button_aria_label_value);}if(dirty[0]&/*_monthDays*/2048&&button_data_date_value!==(button_data_date_value=format(/*d*/ctx[27],"T"))){attr(button,"data-date",button_data_date_value);}if(dirty[0]&/*_monthDays*/2048&&button_data_day_value!==(button_data_day_value=format(/*d*/ctx[27],"eee"))){attr(button,"data-day",button_data_day_value);}if(dirty[0]&/*_monthDays, _calendarDate*/2304&&button_tabindex_value!==(button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1)){attr(button,"tabindex",button_tabindex_value);}if(dirty[0]&/*_monthDays*/2048){toggle_class(button,"today",isSameDay(/*d*/ctx[27],new Date()));}if(dirty[0]&/*value, _monthDays, _selectedDate*/2177){toggle_class(button,"selected",/*value*/ctx[0]&&isSameDay(/*d*/ctx[27],/*_selectedDate*/ctx[7]));}if(dirty[0]&/*_monthDays, _min, _max*/3584){toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));}},d(detaching){if(detaching)detach(button);mounted=false;dispose();}};}// (260:4) {#each _nextMonthDays as d}
|
|
1419
|
-
function create_each_block$1(ctx){let button;let div;let t0_value=/*d*/ctx[27].getDate()+"";let t0;let t1;let button_aria_label_value;let button_data_date_value;let button_data_day_value;let button_tabindex_value;let mounted;let dispose;return {c(){button=element("button");div=element("div");t0=text(t0_value);t1=space();attr(div,"class","day-num");attr(div,"data-testid","date");attr(button,"aria-label",button_aria_label_value=format(/*d*/ctx[27],"PPPP"));attr(button,"data-date",button_data_date_value=format(/*d*/ctx[27],"T"));attr(button,"data-day",button_data_day_value=format(/*d*/ctx[27],"eee"));attr(button,"class","day other-month");attr(button,"tabindex",button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1);toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));},m(target,anchor){insert(target,button,anchor);append(button,div);append(div,t0);append(button,t1);if(!mounted){dispose=listen(button,"click",/*onDateClick*/ctx[19]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*_nextMonthDays*/8192&&t0_value!==(t0_value=/*d*/ctx[27].getDate()+""))set_data(t0,t0_value);if(dirty[0]&/*_nextMonthDays*/8192&&button_aria_label_value!==(button_aria_label_value=format(/*d*/ctx[27],"PPPP"))){attr(button,"aria-label",button_aria_label_value);}if(dirty[0]&/*_nextMonthDays*/8192&&button_data_date_value!==(button_data_date_value=format(/*d*/ctx[27],"T"))){attr(button,"data-date",button_data_date_value);}if(dirty[0]&/*_nextMonthDays*/8192&&button_data_day_value!==(button_data_day_value=format(/*d*/ctx[27],"eee"))){attr(button,"data-day",button_data_day_value);}if(dirty[0]&/*_nextMonthDays, _calendarDate*/8448&&button_tabindex_value!==(button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1)){attr(button,"tabindex",button_tabindex_value);}if(dirty[0]&/*_nextMonthDays, _min, _max*/9728){toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));}},d(detaching){if(detaching)detach(button);mounted=false;dispose();}};}function create_fragment$b(ctx){let div1;let goa_block;let goa_form_item0;let goa_dropdown0;let goa_dropdown0_arialabel_value;let goa_dropdown0_value_value;let t0;let goa_form_item1;let goa_dropdown1;let goa_dropdown1_arialabel_value;let goa_dropdown1_value_value;let t1;let div0;let h50;let t3;let h51;let t5;let h52;let t7;let h53;let t9;let h54;let t11;let h55;let t13;let h56;let t15;let t16;let t17;let div1_style_value;let mounted;let dispose;let each_value_4=/*_months*/ctx[16];let each_blocks_4=[];for(let i=0;i<each_value_4.length;i+=1){each_blocks_4[i]=create_each_block_4(get_each_context_4(ctx,each_value_4,i));}let each_value_3=/*_years*/ctx[14];let each_blocks_3=[];for(let i=0;i<each_value_3.length;i+=1){each_blocks_3[i]=create_each_block_3(get_each_context_3(ctx,each_value_3,i));}let each_value_2=/*_previousMonthDays*/ctx[12];let each_blocks_2=[];for(let i=0;i<each_value_2.length;i+=1){each_blocks_2[i]=create_each_block_2(get_each_context_2(ctx,each_value_2,i));}let each_value_1=/*_monthDays*/ctx[11];let each_blocks_1=[];for(let i=0;i<each_value_1.length;i+=1){each_blocks_1[i]=create_each_block_1(get_each_context_1(ctx,each_value_1,i));}let each_value=/*_nextMonthDays*/ctx[13];let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$1(get_each_context$1(ctx,each_value,i));}return {c(){var _ctx$,_ctx$2;div1=element("div");goa_block=element("goa-block");goa_form_item0=element("goa-form-item");goa_dropdown0=element("goa-dropdown");for(let i=0;i<each_blocks_4.length;i+=1){each_blocks_4[i].c();}t0=space();goa_form_item1=element("goa-form-item");goa_dropdown1=element("goa-dropdown");for(let i=0;i<each_blocks_3.length;i+=1){each_blocks_3[i].c();}t1=space();div0=element("div");h50=element("h5");h50.textContent="Sun";t3=space();h51=element("h5");h51.textContent="Mon";t5=space();h52=element("h5");h52.textContent="Tue";t7=space();h53=element("h5");h53.textContent="Wed";t9=space();h54=element("h5");h54.textContent="Thu";t11=space();h55=element("h5");h55.textContent="Fri";t13=space();h56=element("h5");h56.textContent="Sat";t15=space();for(let i=0;i<each_blocks_2.length;i+=1){each_blocks_2[i].c();}t16=space();for(let i=0;i<each_blocks_1.length;i+=1){each_blocks_1[i].c();}t17=space();for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}this.c=noop;set_custom_element_data(goa_dropdown0,"arialabel",goa_dropdown0_arialabel_value=`${/*name*/ctx[1]} month`);set_custom_element_data(goa_dropdown0,"data-testid","months");set_custom_element_data(goa_dropdown0,"width","calc(314px / 2 - 1.5rem)");set_custom_element_data(goa_dropdown0,"relative","true");set_custom_element_data(goa_dropdown0,"value",goa_dropdown0_value_value=/*_calendarDate*/(_ctx$=ctx[8])===null||_ctx$===void 0?void 0:_ctx$.getMonth());set_custom_element_data(goa_form_item0,"label","Month");set_custom_element_data(goa_form_item0,"mt","0");set_custom_element_data(goa_dropdown1,"arialabel",goa_dropdown1_arialabel_value=`${/*name*/ctx[1]} year`);set_custom_element_data(goa_dropdown1,"data-testid","years");set_custom_element_data(goa_dropdown1,"width","calc(314px / 2 - 1.5rem)");set_custom_element_data(goa_dropdown1,"relative","true");set_custom_element_data(goa_dropdown1,"value",goa_dropdown1_value_value=/*_calendarDate*/(_ctx$2=ctx[8])===null||_ctx$2===void 0?void 0:_ctx$2.getFullYear());set_custom_element_data(goa_form_item1,"label","Year");set_custom_element_data(goa_form_item1,"mt","0");set_custom_element_data(goa_block,"mb","m");attr(div0,"data-testid","calendar");attr(div0,"class","calendar");attr(div1,"style",div1_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));toggle_class(div1,"bordered",/*bordered*/ctx[6]==="true");},m(target,anchor){insert(target,div1,anchor);append(div1,goa_block);append(goa_block,goa_form_item0);append(goa_form_item0,goa_dropdown0);for(let i=0;i<each_blocks_4.length;i+=1){if(each_blocks_4[i]){each_blocks_4[i].m(goa_dropdown0,null);}}append(goa_block,t0);append(goa_block,goa_form_item1);append(goa_form_item1,goa_dropdown1);for(let i=0;i<each_blocks_3.length;i+=1){if(each_blocks_3[i]){each_blocks_3[i].m(goa_dropdown1,null);}}append(div1,t1);append(div1,div0);append(div0,h50);append(div0,t3);append(div0,h51);append(div0,t5);append(div0,h52);append(div0,t7);append(div0,h53);append(div0,t9);append(div0,h54);append(div0,t11);append(div0,h55);append(div0,t13);append(div0,h56);append(div0,t15);for(let i=0;i<each_blocks_2.length;i+=1){if(each_blocks_2[i]){each_blocks_2[i].m(div0,null);}}append(div0,t16);for(let i=0;i<each_blocks_1.length;i+=1){if(each_blocks_1[i]){each_blocks_1[i].m(div0,null);}}append(div0,t17);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(div0,null);}}/*div0_binding*/ctx[22](div0);if(!mounted){dispose=[listen(goa_dropdown0,"_change",/*setMonth*/ctx[17]),listen(goa_dropdown1,"_change",/*setYear*/ctx[18])];mounted=true;}},p(ctx,dirty){var _ctx$3,_ctx$4;if(dirty[0]&/*_months*/65536){each_value_4=/*_months*/ctx[16];let i;for(i=0;i<each_value_4.length;i+=1){const child_ctx=get_each_context_4(ctx,each_value_4,i);if(each_blocks_4[i]){each_blocks_4[i].p(child_ctx,dirty);}else {each_blocks_4[i]=create_each_block_4(child_ctx);each_blocks_4[i].c();each_blocks_4[i].m(goa_dropdown0,null);}}for(;i<each_blocks_4.length;i+=1){each_blocks_4[i].d(1);}each_blocks_4.length=each_value_4.length;}if(dirty[0]&/*name*/2&&goa_dropdown0_arialabel_value!==(goa_dropdown0_arialabel_value=`${/*name*/ctx[1]} month`)){set_custom_element_data(goa_dropdown0,"arialabel",goa_dropdown0_arialabel_value);}if(dirty[0]&/*_calendarDate*/256&&goa_dropdown0_value_value!==(goa_dropdown0_value_value=/*_calendarDate*/(_ctx$3=ctx[8])===null||_ctx$3===void 0?void 0:_ctx$3.getMonth())){set_custom_element_data(goa_dropdown0,"value",goa_dropdown0_value_value);}if(dirty[0]&/*_years*/16384){each_value_3=/*_years*/ctx[14];let i;for(i=0;i<each_value_3.length;i+=1){const child_ctx=get_each_context_3(ctx,each_value_3,i);if(each_blocks_3[i]){each_blocks_3[i].p(child_ctx,dirty);}else {each_blocks_3[i]=create_each_block_3(child_ctx);each_blocks_3[i].c();each_blocks_3[i].m(goa_dropdown1,null);}}for(;i<each_blocks_3.length;i+=1){each_blocks_3[i].d(1);}each_blocks_3.length=each_value_3.length;}if(dirty[0]&/*name*/2&&goa_dropdown1_arialabel_value!==(goa_dropdown1_arialabel_value=`${/*name*/ctx[1]} year`)){set_custom_element_data(goa_dropdown1,"arialabel",goa_dropdown1_arialabel_value);}if(dirty[0]&/*_calendarDate*/256&&goa_dropdown1_value_value!==(goa_dropdown1_value_value=/*_calendarDate*/(_ctx$4=ctx[8])===null||_ctx$4===void 0?void 0:_ctx$4.getFullYear())){set_custom_element_data(goa_dropdown1,"value",goa_dropdown1_value_value);}if(dirty[0]&/*_previousMonthDays, _calendarDate, _min, _max, onDateClick*/530176){each_value_2=/*_previousMonthDays*/ctx[12];let i;for(i=0;i<each_value_2.length;i+=1){const child_ctx=get_each_context_2(ctx,each_value_2,i);if(each_blocks_2[i]){each_blocks_2[i].p(child_ctx,dirty);}else {each_blocks_2[i]=create_each_block_2(child_ctx);each_blocks_2[i].c();each_blocks_2[i].m(div0,t16);}}for(;i<each_blocks_2.length;i+=1){each_blocks_2[i].d(1);}each_blocks_2.length=each_value_2.length;}if(dirty[0]&/*_monthDays, _calendarDate, value, _selectedDate, _min, _max, onDateClick*/528257){each_value_1=/*_monthDays*/ctx[11];let i;for(i=0;i<each_value_1.length;i+=1){const child_ctx=get_each_context_1(ctx,each_value_1,i);if(each_blocks_1[i]){each_blocks_1[i].p(child_ctx,dirty);}else {each_blocks_1[i]=create_each_block_1(child_ctx);each_blocks_1[i].c();each_blocks_1[i].m(div0,t17);}}for(;i<each_blocks_1.length;i+=1){each_blocks_1[i].d(1);}each_blocks_1.length=each_value_1.length;}if(dirty[0]&/*_nextMonthDays, _calendarDate, _min, _max, onDateClick*/534272){each_value=/*_nextMonthDays*/ctx[13];let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$1(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$1(child_ctx);each_blocks[i].c();each_blocks[i].m(div0,null);}}for(;i<each_blocks.length;i+=1){each_blocks[i].d(1);}each_blocks.length=each_value.length;}if(dirty[0]&/*mt, mr, mb, ml*/60&&div1_style_value!==(div1_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(div1,"style",div1_style_value);}if(dirty[0]&/*bordered*/64){toggle_class(div1,"bordered",/*bordered*/ctx[6]==="true");}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);destroy_each(each_blocks_4,detaching);destroy_each(each_blocks_3,detaching);destroy_each(each_blocks_2,detaching);destroy_each(each_blocks_1,detaching);destroy_each(each_blocks,detaching);/*div0_binding*/ctx[22](null);mounted=false;run_all(dispose);}};}function instance$b($$self,$$props,$$invalidate){let{name=""}=$$props;let{value=""}=$$props;let{min=""}=$$props;let{max=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{bordered="true"}=$$props;// ********
|
|
1399
|
+
function create_each_block$1(ctx){let button;let div;let t0_value=/*d*/ctx[27].getDate()+"";let t0;let t1;let button_aria_label_value;let button_data_date_value;let button_data_day_value;let button_tabindex_value;let mounted;let dispose;return {c(){button=element("button");div=element("div");t0=text(t0_value);t1=space();attr(div,"class","day-num");attr(div,"data-testid","date");attr(button,"aria-label",button_aria_label_value=format(/*d*/ctx[27],"PPPP"));attr(button,"data-date",button_data_date_value=format(/*d*/ctx[27],"T"));attr(button,"data-day",button_data_day_value=format(/*d*/ctx[27],"eee"));attr(button,"class","day other-month");attr(button,"tabindex",button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1);toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));},m(target,anchor){insert(target,button,anchor);append(button,div);append(div,t0);append(button,t1);if(!mounted){dispose=listen(button,"click",/*onDateClick*/ctx[19]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*_nextMonthDays*/8192&&t0_value!==(t0_value=/*d*/ctx[27].getDate()+""))set_data(t0,t0_value);if(dirty[0]&/*_nextMonthDays*/8192&&button_aria_label_value!==(button_aria_label_value=format(/*d*/ctx[27],"PPPP"))){attr(button,"aria-label",button_aria_label_value);}if(dirty[0]&/*_nextMonthDays*/8192&&button_data_date_value!==(button_data_date_value=format(/*d*/ctx[27],"T"))){attr(button,"data-date",button_data_date_value);}if(dirty[0]&/*_nextMonthDays*/8192&&button_data_day_value!==(button_data_day_value=format(/*d*/ctx[27],"eee"))){attr(button,"data-day",button_data_day_value);}if(dirty[0]&/*_nextMonthDays, _calendarDate*/8448&&button_tabindex_value!==(button_tabindex_value=isSameDay(/*d*/ctx[27],/*_calendarDate*/ctx[8])?0:-1)){attr(button,"tabindex",button_tabindex_value);}if(dirty[0]&/*_nextMonthDays, _min, _max*/9728){toggle_class(button,"disabled",isBefore(/*d*/ctx[27],/*_min*/ctx[9])||isAfter(/*d*/ctx[27],/*_max*/ctx[10]));}},d(detaching){if(detaching)detach(button);mounted=false;dispose();}};}function create_fragment$b(ctx){let div1;let goa_block;let goa_form_item0;let goa_dropdown0;let goa_dropdown0_arialabel_value;let goa_dropdown0_value_value;let t0;let goa_form_item1;let goa_dropdown1;let goa_dropdown1_arialabel_value;let goa_dropdown1_value_value;let t1;let div0;let h50;let t3;let h51;let t5;let h52;let t7;let h53;let t9;let h54;let t11;let h55;let t13;let h56;let t15;let t16;let t17;let div1_style_value;let mounted;let dispose;let each_value_4=/*_months*/ctx[16];let each_blocks_4=[];for(let i=0;i<each_value_4.length;i+=1){each_blocks_4[i]=create_each_block_4(get_each_context_4(ctx,each_value_4,i));}let each_value_3=/*_years*/ctx[14];let each_blocks_3=[];for(let i=0;i<each_value_3.length;i+=1){each_blocks_3[i]=create_each_block_3(get_each_context_3(ctx,each_value_3,i));}let each_value_2=/*_previousMonthDays*/ctx[12];let each_blocks_2=[];for(let i=0;i<each_value_2.length;i+=1){each_blocks_2[i]=create_each_block_2(get_each_context_2(ctx,each_value_2,i));}let each_value_1=/*_monthDays*/ctx[11];let each_blocks_1=[];for(let i=0;i<each_value_1.length;i+=1){each_blocks_1[i]=create_each_block_1(get_each_context_1(ctx,each_value_1,i));}let each_value=/*_nextMonthDays*/ctx[13];let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$1(get_each_context$1(ctx,each_value,i));}return {c(){var _ctx$2,_ctx$3;div1=element("div");goa_block=element("goa-block");goa_form_item0=element("goa-form-item");goa_dropdown0=element("goa-dropdown");for(let i=0;i<each_blocks_4.length;i+=1){each_blocks_4[i].c();}t0=space();goa_form_item1=element("goa-form-item");goa_dropdown1=element("goa-dropdown");for(let i=0;i<each_blocks_3.length;i+=1){each_blocks_3[i].c();}t1=space();div0=element("div");h50=element("h5");h50.textContent="Sun";t3=space();h51=element("h5");h51.textContent="Mon";t5=space();h52=element("h5");h52.textContent="Tue";t7=space();h53=element("h5");h53.textContent="Wed";t9=space();h54=element("h5");h54.textContent="Thu";t11=space();h55=element("h5");h55.textContent="Fri";t13=space();h56=element("h5");h56.textContent="Sat";t15=space();for(let i=0;i<each_blocks_2.length;i+=1){each_blocks_2[i].c();}t16=space();for(let i=0;i<each_blocks_1.length;i+=1){each_blocks_1[i].c();}t17=space();for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}this.c=noop;set_custom_element_data(goa_dropdown0,"arialabel",goa_dropdown0_arialabel_value=`${/*name*/ctx[1]} month`);set_custom_element_data(goa_dropdown0,"data-testid","months");set_custom_element_data(goa_dropdown0,"width","calc(314px / 2 - 1.5rem)");set_custom_element_data(goa_dropdown0,"relative","true");set_custom_element_data(goa_dropdown0,"value",goa_dropdown0_value_value=/*_calendarDate*/(_ctx$2=ctx[8])===null||_ctx$2===void 0?void 0:_ctx$2.getMonth());set_custom_element_data(goa_form_item0,"label","Month");set_custom_element_data(goa_form_item0,"mt","0");set_custom_element_data(goa_dropdown1,"arialabel",goa_dropdown1_arialabel_value=`${/*name*/ctx[1]} year`);set_custom_element_data(goa_dropdown1,"data-testid","years");set_custom_element_data(goa_dropdown1,"width","calc(314px / 2 - 1.5rem)");set_custom_element_data(goa_dropdown1,"relative","true");set_custom_element_data(goa_dropdown1,"value",goa_dropdown1_value_value=/*_calendarDate*/(_ctx$3=ctx[8])===null||_ctx$3===void 0?void 0:_ctx$3.getFullYear());set_custom_element_data(goa_form_item1,"label","Year");set_custom_element_data(goa_form_item1,"mt","0");set_custom_element_data(goa_block,"mb","m");attr(div0,"data-testid","calendar");attr(div0,"class","calendar");attr(div1,"style",div1_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));toggle_class(div1,"bordered",/*bordered*/ctx[6]==="true");},m(target,anchor){insert(target,div1,anchor);append(div1,goa_block);append(goa_block,goa_form_item0);append(goa_form_item0,goa_dropdown0);for(let i=0;i<each_blocks_4.length;i+=1){if(each_blocks_4[i]){each_blocks_4[i].m(goa_dropdown0,null);}}append(goa_block,t0);append(goa_block,goa_form_item1);append(goa_form_item1,goa_dropdown1);for(let i=0;i<each_blocks_3.length;i+=1){if(each_blocks_3[i]){each_blocks_3[i].m(goa_dropdown1,null);}}append(div1,t1);append(div1,div0);append(div0,h50);append(div0,t3);append(div0,h51);append(div0,t5);append(div0,h52);append(div0,t7);append(div0,h53);append(div0,t9);append(div0,h54);append(div0,t11);append(div0,h55);append(div0,t13);append(div0,h56);append(div0,t15);for(let i=0;i<each_blocks_2.length;i+=1){if(each_blocks_2[i]){each_blocks_2[i].m(div0,null);}}append(div0,t16);for(let i=0;i<each_blocks_1.length;i+=1){if(each_blocks_1[i]){each_blocks_1[i].m(div0,null);}}append(div0,t17);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(div0,null);}}/*div0_binding*/ctx[22](div0);if(!mounted){dispose=[listen(goa_dropdown0,"_change",/*setMonth*/ctx[17]),listen(goa_dropdown1,"_change",/*setYear*/ctx[18])];mounted=true;}},p(ctx,dirty){var _ctx$4,_ctx$5;if(dirty[0]&/*_months*/65536){each_value_4=/*_months*/ctx[16];let i;for(i=0;i<each_value_4.length;i+=1){const child_ctx=get_each_context_4(ctx,each_value_4,i);if(each_blocks_4[i]){each_blocks_4[i].p(child_ctx,dirty);}else {each_blocks_4[i]=create_each_block_4(child_ctx);each_blocks_4[i].c();each_blocks_4[i].m(goa_dropdown0,null);}}for(;i<each_blocks_4.length;i+=1){each_blocks_4[i].d(1);}each_blocks_4.length=each_value_4.length;}if(dirty[0]&/*name*/2&&goa_dropdown0_arialabel_value!==(goa_dropdown0_arialabel_value=`${/*name*/ctx[1]} month`)){set_custom_element_data(goa_dropdown0,"arialabel",goa_dropdown0_arialabel_value);}if(dirty[0]&/*_calendarDate*/256&&goa_dropdown0_value_value!==(goa_dropdown0_value_value=/*_calendarDate*/(_ctx$4=ctx[8])===null||_ctx$4===void 0?void 0:_ctx$4.getMonth())){set_custom_element_data(goa_dropdown0,"value",goa_dropdown0_value_value);}if(dirty[0]&/*_years*/16384){each_value_3=/*_years*/ctx[14];let i;for(i=0;i<each_value_3.length;i+=1){const child_ctx=get_each_context_3(ctx,each_value_3,i);if(each_blocks_3[i]){each_blocks_3[i].p(child_ctx,dirty);}else {each_blocks_3[i]=create_each_block_3(child_ctx);each_blocks_3[i].c();each_blocks_3[i].m(goa_dropdown1,null);}}for(;i<each_blocks_3.length;i+=1){each_blocks_3[i].d(1);}each_blocks_3.length=each_value_3.length;}if(dirty[0]&/*name*/2&&goa_dropdown1_arialabel_value!==(goa_dropdown1_arialabel_value=`${/*name*/ctx[1]} year`)){set_custom_element_data(goa_dropdown1,"arialabel",goa_dropdown1_arialabel_value);}if(dirty[0]&/*_calendarDate*/256&&goa_dropdown1_value_value!==(goa_dropdown1_value_value=/*_calendarDate*/(_ctx$5=ctx[8])===null||_ctx$5===void 0?void 0:_ctx$5.getFullYear())){set_custom_element_data(goa_dropdown1,"value",goa_dropdown1_value_value);}if(dirty[0]&/*_previousMonthDays, _calendarDate, _min, _max, onDateClick*/530176){each_value_2=/*_previousMonthDays*/ctx[12];let i;for(i=0;i<each_value_2.length;i+=1){const child_ctx=get_each_context_2(ctx,each_value_2,i);if(each_blocks_2[i]){each_blocks_2[i].p(child_ctx,dirty);}else {each_blocks_2[i]=create_each_block_2(child_ctx);each_blocks_2[i].c();each_blocks_2[i].m(div0,t16);}}for(;i<each_blocks_2.length;i+=1){each_blocks_2[i].d(1);}each_blocks_2.length=each_value_2.length;}if(dirty[0]&/*_monthDays, _calendarDate, value, _selectedDate, _min, _max, onDateClick*/528257){each_value_1=/*_monthDays*/ctx[11];let i;for(i=0;i<each_value_1.length;i+=1){const child_ctx=get_each_context_1(ctx,each_value_1,i);if(each_blocks_1[i]){each_blocks_1[i].p(child_ctx,dirty);}else {each_blocks_1[i]=create_each_block_1(child_ctx);each_blocks_1[i].c();each_blocks_1[i].m(div0,t17);}}for(;i<each_blocks_1.length;i+=1){each_blocks_1[i].d(1);}each_blocks_1.length=each_value_1.length;}if(dirty[0]&/*_nextMonthDays, _calendarDate, _min, _max, onDateClick*/534272){each_value=/*_nextMonthDays*/ctx[13];let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$1(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$1(child_ctx);each_blocks[i].c();each_blocks[i].m(div0,null);}}for(;i<each_blocks.length;i+=1){each_blocks[i].d(1);}each_blocks.length=each_value.length;}if(dirty[0]&/*mt, mr, mb, ml*/60&&div1_style_value!==(div1_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(div1,"style",div1_style_value);}if(dirty[0]&/*bordered*/64){toggle_class(div1,"bordered",/*bordered*/ctx[6]==="true");}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);destroy_each(each_blocks_4,detaching);destroy_each(each_blocks_3,detaching);destroy_each(each_blocks_2,detaching);destroy_each(each_blocks_1,detaching);destroy_each(each_blocks,detaching);/*div0_binding*/ctx[22](null);mounted=false;run_all(dispose);}};}function instance$b($$self,$$props,$$invalidate){let{name=""}=$$props;let{value=""}=$$props;let{min=""}=$$props;let{max=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{bordered="true"}=$$props;// ********
|
|
1420
1400
|
// Privates
|
|
1421
1401
|
// ********
|
|
1422
1402
|
let _selectedDate;// date set by the user
|
|
@@ -1435,7 +1415,12 @@ if(!isSameMonth(newDate,_calendarDate)){renderCalendar({type:"date",value:newDat
|
|
|
1435
1415
|
// Event Handlers
|
|
1436
1416
|
// **************
|
|
1437
1417
|
function setMonth(e){renderCalendar({type:"month",value:+e.detail.value});e.preventDefault();e.stopPropagation();}function setYear(e){renderCalendar({type:"year",value:+e.detail.value});e.preventDefault();e.stopPropagation();}function onDateClick(e){const newDate=new Date(+e.target.dataset.date);if(newDate<_min||newDate>_max){return;}// re-initialize calendar days if user clicked on day outside current month
|
|
1438
|
-
if(!isSameMonth(newDate,_calendarDate)){renderCalendar({type:"date",value:newDate});}$$invalidate(7,_selectedDate=$$invalidate(8,_calendarDate=newDate));dispatchValue();}function div0_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_calendarEl=$$value;$$invalidate(15,_calendarEl);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(1,name=$$props.name);if('value'in $$props)$$invalidate(0,value=$$props.value);if('min'in $$props)$$invalidate(20,min=$$props.min);if('max'in $$props)$$invalidate(21,max=$$props.max);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('bordered'in $$props)$$invalidate(6,bordered=$$props.bordered);};return [value,name,mt,mr,mb,ml,bordered,_selectedDate,_calendarDate,_min,_max,_monthDays,_previousMonthDays,_nextMonthDays,_years,_calendarEl,_months,setMonth,setYear,onDateClick,min,max,div0_binding];}class Calendar extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font:var(--goa-typography-body-s)}.bordered{display:inline-block;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);padding:1rem}.calendar{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:2px 0;width:280px;font:var(--goa-typography-body-s)}h5{margin:0;font:var(--goa-typography-heading-xs)}.day{align-items:center;background:var(--goa-color-white);border:none;border-radius:var(--goa-border-radius-m);color:var(--goa-color-greyscale-black);display:inline-flex;font:var(--goa-typography-body-s);height:2.5rem;justify-content:center;margin:0;width:2.5rem}.day.other-month{color:var(--goa-color-greyscale-400)}.day.today{font-weight:var(--goa-font-weight-bold)}.day:focus-within{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.day.selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.day:hover{background:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black);cursor:pointer}.day.selected:hover{background:var(--goa-color-interactive-hover);text-decoration-color:var(--goa-color-white);color:var(--goa-color-greyscale-white)}.day.today.selected:hover{background:var(--goa-color-interactive-hover);text-decoration-color:var(--goa-color-white);color:var(--goa-color-greyscale-white)}.day.disabled{color:var(--goa-color-greyscale-400);cursor:default}.day.disabled:hover{background:var(--goa-color-white)}.day-num{width:100%;margin:0 6px;pointer-events:none;padding-bottom:2px}.selected .day-num{border-bottom:none;padding-bottom:0;width:1.5rem}.today .day-num{border-bottom:3px solid var(--goa-color-interactive-default)}.today.selected .day-num{border-bottom:3px solid var(--goa-color-greyscale-white)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$b,create_fragment$b,safe_not_equal,{name:1,value:0,min:20,max:21,mt:2,mr:3,mb:4,ml:5,bordered:6},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","value","min","max","mt","mr","mb","ml","bordered"];}get name(){return this.$$.ctx[1];}set name(name){this.$$set({name});flush();}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get min(){return this.$$.ctx[20];}set min(min){this.$$set({min});flush();}get max(){return this.$$.ctx[21];}set max(max){this.$$set({max});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 bordered(){return this.$$.ctx[6];}set bordered(bordered){this.$$set({bordered});flush();}}customElements.define("goa-calendar",Calendar);/* src/components/date-picker/DatePicker.svelte generated by Svelte v3.59.2 */function create_fragment$a(ctx){let goa_popover;let goa_input;let goa_input_value_value;let t;let goa_calendar;let mounted;let dispose;return {c(){goa_popover=element("goa-popover");goa_input=element("goa-input");t=space();goa_calendar=element("goa-calendar");this.c=noop;set_custom_element_data(goa_input,"slot","target");set_custom_element_data(goa_input,"readonly","true");set_custom_element_data(goa_input,"trailingicon","calendar");set_custom_element_data(goa_input,"value",goa_input_value_value=/*formatDate*/ctx[13](/*_date*/ctx[9]));set_custom_element_data(goa_calendar,"value",/*value*/ctx[0]);set_custom_element_data(goa_calendar,"min",/*min*/ctx[1]);set_custom_element_data(goa_calendar,"max",/*max*/ctx[2]);set_custom_element_data(goa_calendar,"bordered","false");set_custom_element_data(goa_popover,"tabindex","-1");set_custom_element_data(goa_popover,"relative",/*relative*/ctx[3]);set_custom_element_data(goa_popover,"mt",/*mt*/ctx[4]);set_custom_element_data(goa_popover,"mb",/*mb*/ctx[6]);set_custom_element_data(goa_popover,"ml",/*ml*/ctx[7]);set_custom_element_data(goa_popover,"mr",/*mr*/ctx[5]);set_custom_element_data(goa_popover,"open",/*_showPopover*/ctx[10]);},m(target,anchor){insert(target,goa_popover,anchor);append(goa_popover,goa_input);append(goa_popover,t);append(goa_popover,goa_calendar);/*goa_popover_binding*/ctx[16](goa_popover);if(!mounted){dispose=[listen(goa_input,"click",/*showCalendar*/ctx[14]),listen(goa_input,"keydown",/*handleKeyDown*/ctx[15]),listen(goa_calendar,"_change",/*onCalendarChange*/ctx[11]),listen(goa_popover,"_close",/*close_handler*/ctx[17])];mounted=true;}},p(ctx,[dirty]){if(dirty&/*_date*/512&&goa_input_value_value!==(goa_input_value_value=/*formatDate*/ctx[13](/*_date*/ctx[9]))){set_custom_element_data(goa_input,"value",goa_input_value_value);}if(dirty&/*value*/1){set_custom_element_data(goa_calendar,"value",/*value*/ctx[0]);}if(dirty&/*min*/2){set_custom_element_data(goa_calendar,"min",/*min*/ctx[1]);}if(dirty&/*max*/4){set_custom_element_data(goa_calendar,"max",/*max*/ctx[2]);}if(dirty&/*relative*/8){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[3]);}if(dirty&/*mt*/16){set_custom_element_data(goa_popover,"mt",/*mt*/ctx[4]);}if(dirty&/*mb*/64){set_custom_element_data(goa_popover,"mb",/*mb*/ctx[6]);}if(dirty&/*ml*/128){set_custom_element_data(goa_popover,"ml",/*ml*/ctx[7]);}if(dirty&/*mr*/32){set_custom_element_data(goa_popover,"mr",/*mr*/ctx[5]);}if(dirty&/*_showPopover*/1024){set_custom_element_data(goa_popover,"open",/*_showPopover*/ctx[10]);}},i:noop,o:noop,d(detaching){if(detaching)detach(goa_popover);/*goa_popover_binding*/ctx[16](null);mounted=false;run_all(dispose);}};}function instance$a($$self,$$props,$$invalidate){let{value=""}=$$props;let{min=""}=$$props;let{max=""}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let _rootEl;let _date;let _showPopover=false;onMount(async()=>{$$invalidate(9,_date=value&&startOfDay(new Date(value)));if(value&&!isValid(_date)){console.error(`${value} is not a valid date`);}});function onCalendarChange(e){$$invalidate(9,_date=e.detail.value);hideCalendar();e.stopPropagation();e.preventDefault();}function dispatchValue(date){if(!date)return;_rootEl.dispatchEvent(new CustomEvent("_change",{composed:true,bubbles:true,detail:{type:"date",value:date}}));}function formatDate(d){if(!d)return "";if(typeof d==="string"){return format(new Date(d),"PPP");}return format(d,"PPP");}function hideCalendar(){$$invalidate(10,_showPopover=false);}function showCalendar(){$$invalidate(10,_showPopover=true);}function handleKeyDown(e){if(!_date)return;if(["Space","Enter"].includes(e.key)){showCalendar();return;}switch(e.key){case"ArrowLeft":$$invalidate(9,_date=addDays(_date,-1));break;case"ArrowRight":$$invalidate(9,_date=addDays(_date,1));break;case"ArrowDown":$$invalidate(9,_date=addDays(_date,7));break;case"ArrowUp":$$invalidate(9,_date=addDays(_date,-7));break;case"PageUp":$$invalidate(9,_date=e.shiftKey?addYears(_date,-1):addMonths(_date,-1));break;case"PageDown":$$invalidate(9,_date=e.shiftKey?addYears(_date,1):addMonths(_date,1));break;}dispatchValue(_date);}function goa_popover_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(8,_rootEl);});}const close_handler=()=>dispatchValue(_date);$$self.$$set=$$props=>{if('value'in $$props)$$invalidate(0,value=$$props.value);if('min'in $$props)$$invalidate(1,min=$$props.min);if('max'in $$props)$$invalidate(2,max=$$props.max);if('relative'in $$props)$$invalidate(3,relative=$$props.relative);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 [value,min,max,relative,mt,mr,mb,ml,_rootEl,_date,_showPopover,onCalendarChange,dispatchValue,formatDate,showCalendar,handleKeyDown,goa_popover_binding,close_handler];}class DatePicker extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$a,create_fragment$a,safe_not_equal,{value:0,min:1,max:2,relative: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 ["value","min","max","relative","mt","mr","mb","ml"];}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get min(){return this.$$.ctx[1];}set min(min){this.$$set({min});flush();}get max(){return this.$$.ctx[2];}set max(max){this.$$set({max});flush();}get relative(){return this.$$.ctx[3];}set relative(relative){this.$$set({relative});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-date-picker",DatePicker);/* src/components/file-upload-card/FileUploadCard.svelte generated by Svelte v3.59.2 */function create_else_block$2(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","fileicon");set_custom_element_data(goa_icon,"data-testid","icon");set_custom_element_data(goa_icon,"type","goa-file");set_custom_element_data(goa_icon,"fillcolor","#dcdcdc");set_custom_element_data(goa_icon,"size","xlarge");},m(target,anchor){insert(target,goa_icon,anchor);},p:noop,d(detaching){if(detaching)detach(goa_icon);}};}// (71:4) {#if _status === "uploaded"}
|
|
1418
|
+
if(!isSameMonth(newDate,_calendarDate)){renderCalendar({type:"date",value:newDate});}$$invalidate(7,_selectedDate=$$invalidate(8,_calendarDate=newDate));dispatchValue();}function div0_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_calendarEl=$$value;$$invalidate(15,_calendarEl);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(1,name=$$props.name);if('value'in $$props)$$invalidate(0,value=$$props.value);if('min'in $$props)$$invalidate(20,min=$$props.min);if('max'in $$props)$$invalidate(21,max=$$props.max);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('bordered'in $$props)$$invalidate(6,bordered=$$props.bordered);};return [value,name,mt,mr,mb,ml,bordered,_selectedDate,_calendarDate,_min,_max,_monthDays,_previousMonthDays,_nextMonthDays,_years,_calendarEl,_months,setMonth,setYear,onDateClick,min,max,div0_binding];}class Calendar extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font:var(--goa-typography-body-s)}.bordered{display:inline-block;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);padding:1rem}.calendar{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:2px 0;width:280px;font:var(--goa-typography-body-s)}h5{margin:0;font:var(--goa-typography-heading-xs)}.day{align-items:center;background:var(--goa-color-white);border:none;border-radius:var(--goa-border-radius-m);color:var(--goa-color-greyscale-black);display:inline-flex;font:var(--goa-typography-body-s);height:2.5rem;justify-content:center;margin:0;width:2.5rem}.day.other-month{color:var(--goa-color-greyscale-400)}.day.today{font-weight:var(--goa-font-weight-bold)}.day:focus-within{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.day.selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.day:hover{background:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black);cursor:pointer}.day.selected:hover{background:var(--goa-color-interactive-hover);text-decoration-color:var(--goa-color-white);color:var(--goa-color-greyscale-white)}.day.today.selected:hover{background:var(--goa-color-interactive-hover);text-decoration-color:var(--goa-color-white);color:var(--goa-color-greyscale-white)}.day.disabled{color:var(--goa-color-greyscale-400);cursor:default}.day.disabled:hover{background:var(--goa-color-white)}.day-num{width:100%;margin:0 6px;pointer-events:none;padding-bottom:2px}.selected .day-num{border-bottom:none;padding-bottom:0;width:1.5rem}.today .day-num{border-bottom:3px solid var(--goa-color-interactive-default)}.today.selected .day-num{border-bottom:3px solid var(--goa-color-greyscale-white)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$b,create_fragment$b,safe_not_equal,{name:1,value:0,min:20,max:21,mt:2,mr:3,mb:4,ml:5,bordered:6},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","value","min","max","mt","mr","mb","ml","bordered"];}get name(){return this.$$.ctx[1];}set name(name){this.$$set({name});flush();}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get min(){return this.$$.ctx[20];}set min(min){this.$$set({min});flush();}get max(){return this.$$.ctx[21];}set max(max){this.$$set({max});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 bordered(){return this.$$.ctx[6];}set bordered(bordered){this.$$set({bordered});flush();}}customElements.define("goa-calendar",Calendar);/* src/components/date-picker/DatePicker.svelte generated by Svelte v3.59.2 */function create_fragment$a(ctx){let goa_popover;let goa_input;let goa_input_value_value;let t;let goa_calendar;let mounted;let dispose;return {c(){goa_popover=element("goa-popover");goa_input=element("goa-input");t=space();goa_calendar=element("goa-calendar");this.c=noop;set_custom_element_data(goa_input,"slot","target");set_custom_element_data(goa_input,"readonly","true");set_custom_element_data(goa_input,"trailingicon","calendar");set_custom_element_data(goa_input,"value",goa_input_value_value=/*formatDate*/ctx[13](/*_date*/ctx[9]));set_custom_element_data(goa_calendar,"value",/*value*/ctx[0]);set_custom_element_data(goa_calendar,"min",/*min*/ctx[1]);set_custom_element_data(goa_calendar,"max",/*max*/ctx[2]);set_custom_element_data(goa_calendar,"bordered","false");set_custom_element_data(goa_popover,"tabindex","-1");set_custom_element_data(goa_popover,"relative",/*relative*/ctx[3]);set_custom_element_data(goa_popover,"mt",/*mt*/ctx[4]);set_custom_element_data(goa_popover,"mb",/*mb*/ctx[6]);set_custom_element_data(goa_popover,"ml",/*ml*/ctx[7]);set_custom_element_data(goa_popover,"mr",/*mr*/ctx[5]);set_custom_element_data(goa_popover,"open",/*_showPopover*/ctx[10]);},m(target,anchor){insert(target,goa_popover,anchor);append(goa_popover,goa_input);append(goa_popover,t);append(goa_popover,goa_calendar);/*goa_popover_binding*/ctx[16](goa_popover);if(!mounted){dispose=[listen(goa_input,"click",/*showCalendar*/ctx[14]),listen(goa_input,"keydown",/*handleKeyDown*/ctx[15]),listen(goa_calendar,"_change",/*onCalendarChange*/ctx[11]),listen(goa_popover,"_close",/*close_handler*/ctx[17])];mounted=true;}},p(ctx,[dirty]){if(dirty&/*_date*/512&&goa_input_value_value!==(goa_input_value_value=/*formatDate*/ctx[13](/*_date*/ctx[9]))){set_custom_element_data(goa_input,"value",goa_input_value_value);}if(dirty&/*value*/1){set_custom_element_data(goa_calendar,"value",/*value*/ctx[0]);}if(dirty&/*min*/2){set_custom_element_data(goa_calendar,"min",/*min*/ctx[1]);}if(dirty&/*max*/4){set_custom_element_data(goa_calendar,"max",/*max*/ctx[2]);}if(dirty&/*relative*/8){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[3]);}if(dirty&/*mt*/16){set_custom_element_data(goa_popover,"mt",/*mt*/ctx[4]);}if(dirty&/*mb*/64){set_custom_element_data(goa_popover,"mb",/*mb*/ctx[6]);}if(dirty&/*ml*/128){set_custom_element_data(goa_popover,"ml",/*ml*/ctx[7]);}if(dirty&/*mr*/32){set_custom_element_data(goa_popover,"mr",/*mr*/ctx[5]);}if(dirty&/*_showPopover*/1024){set_custom_element_data(goa_popover,"open",/*_showPopover*/ctx[10]);}},i:noop,o:noop,d(detaching){if(detaching)detach(goa_popover);/*goa_popover_binding*/ctx[16](null);mounted=false;run_all(dispose);}};}function instance$a($$self,$$props,$$invalidate){let{value=""}=$$props;let{min=""}=$$props;let{max=""}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let _rootEl;let _date;let _showPopover=false;onMount(async()=>{$$invalidate(9,_date=value&&startOfDay(new Date(value)));if(value&&!isValid(_date)){console.error(`${value} is not a valid date`);}});function onCalendarChange(e){$$invalidate(9,_date=e.detail.value);hideCalendar();e.stopPropagation();e.preventDefault();}function dispatchValue(date){if(!date)return;_rootEl.dispatchEvent(new CustomEvent("_change",{composed:true,bubbles:true,detail:{type:"date",value:date}}));}function formatDate(d){if(!d)return "";if(typeof d==="string"){return format(new Date(d),"PPP");}return format(d,"PPP");}function hideCalendar(){$$invalidate(10,_showPopover=false);}function showCalendar(){$$invalidate(10,_showPopover=true);}function handleKeyDown(e){if(["Space","Enter"].includes(e.key)){showCalendar();return;}// in the key event handling below the first line `_date ||= ...` is to initialize the date, if
|
|
1419
|
+
// it hasn't yet been set to 1 unit opposite of what the keybinding does ex. if ArrowDown is
|
|
1420
|
+
// clicked, which moves the datepicker one week ahead, the date is initialize one week before.
|
|
1421
|
+
// This is to allow the starting date displayed to be that of today no matter what key is
|
|
1422
|
+
// pressed.
|
|
1423
|
+
switch(e.key){case"ArrowLeft":_date||$$invalidate(9,_date=addDays(new Date(),1));$$invalidate(9,_date=addDays(_date,-1));break;case"ArrowRight":_date||$$invalidate(9,_date=addDays(new Date(),-1));$$invalidate(9,_date=addDays(_date,1));break;case"ArrowDown":_date||$$invalidate(9,_date=addDays(new Date(),-7));$$invalidate(9,_date=addDays(_date,7));break;case"ArrowUp":_date||$$invalidate(9,_date=addDays(new Date(),7));$$invalidate(9,_date=addDays(_date,-7));break;case"PageUp":_date||$$invalidate(9,_date=e.shiftKey?addYears(new Date(),1):addMonths(new Date(),1));$$invalidate(9,_date=e.shiftKey?addYears(_date,-1):addMonths(_date,-1));break;case"PageDown":_date||$$invalidate(9,_date=e.shiftKey?addYears(new Date(),-1):addMonths(new Date(),-1));$$invalidate(9,_date=e.shiftKey?addYears(_date,1):addMonths(_date,1));break;default:return;}dispatchValue(_date);e.preventDefault();e.stopPropagation();}function goa_popover_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(8,_rootEl);});}const close_handler=()=>dispatchValue(_date);$$self.$$set=$$props=>{if('value'in $$props)$$invalidate(0,value=$$props.value);if('min'in $$props)$$invalidate(1,min=$$props.min);if('max'in $$props)$$invalidate(2,max=$$props.max);if('relative'in $$props)$$invalidate(3,relative=$$props.relative);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 [value,min,max,relative,mt,mr,mb,ml,_rootEl,_date,_showPopover,onCalendarChange,dispatchValue,formatDate,showCalendar,handleKeyDown,goa_popover_binding,close_handler];}class DatePicker extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$a,create_fragment$a,safe_not_equal,{value:0,min:1,max:2,relative: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 ["value","min","max","relative","mt","mr","mb","ml"];}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get min(){return this.$$.ctx[1];}set min(min){this.$$set({min});flush();}get max(){return this.$$.ctx[2];}set max(max){this.$$set({max});flush();}get relative(){return this.$$.ctx[3];}set relative(relative){this.$$set({relative});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-date-picker",DatePicker);/* src/components/file-upload-card/FileUploadCard.svelte generated by Svelte v3.59.2 */function create_else_block$2(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","fileicon");set_custom_element_data(goa_icon,"data-testid","icon");set_custom_element_data(goa_icon,"type","goa-file");set_custom_element_data(goa_icon,"fillcolor","#dcdcdc");set_custom_element_data(goa_icon,"size","xlarge");},m(target,anchor){insert(target,goa_icon,anchor);},p:noop,d(detaching){if(detaching)detach(goa_icon);}};}// (71:4) {#if _status === "uploaded"}
|
|
1439
1424
|
function create_if_block_7(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","fileicon");set_custom_element_data(goa_icon,"data-testid","icon");set_custom_element_data(goa_icon,"type",/*_fileIcon*/ctx[6]);set_custom_element_data(goa_icon,"fillcolor","#0070c4");set_custom_element_data(goa_icon,"size","xlarge");},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty&/*_fileIcon*/64){set_custom_element_data(goa_icon,"type",/*_fileIcon*/ctx[6]);}},d(detaching){if(detaching)detach(goa_icon);}};}// (78:6) {#if _status !== "error"}
|
|
1440
1425
|
function create_if_block_6(ctx){let div;let t_value=formatFileSize(/*size*/ctx[1])+"";let t;return {c(){div=element("div");t=text(t_value);attr(div,"class","filesize");attr(div,"data-testid","filesize");},m(target,anchor){insert(target,div,anchor);append(div,t);},p(ctx,dirty){if(dirty&/*size*/2&&t_value!==(t_value=formatFileSize(/*size*/ctx[1])+""))set_data(t,t_value);},d(detaching){if(detaching)detach(div);}};}// (89:36)
|
|
1441
1426
|
function create_if_block_5(ctx){let div;let goa_icon;let t0;let t1;return {c(){div=element("div");goa_icon=element("goa-icon");t0=space();t1=text(/*error*/ctx[3]);set_custom_element_data(goa_icon,"type","warning");set_custom_element_data(goa_icon,"size","small");set_custom_element_data(goa_icon,"theme","filled");attr(div,"class","error-msg");attr(div,"data-testid","error");},m(target,anchor){insert(target,div,anchor);append(div,goa_icon);append(div,t0);append(div,t1);},p(ctx,dirty){if(dirty&/*error*/8)set_data(t1,/*error*/ctx[3]);},d(detaching){if(detaching)detach(div);}};}// (85:39)
|