@abgov/react-components 4.17.0-alpha.1 → 4.17.0-alpha.2
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
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -299,7 +299,7 @@ function close(e){if(!_isClosable){return;}_rootEl===null||_rootEl===void 0?void
|
|
|
299
299
|
}}function header_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_headerEl=$$value;($$invalidate(6,_headerEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}function goa_scrollable_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_scrollEl=$$value;($$invalidate(5,_scrollEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}function div2_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_contentEl=$$value;($$invalidate(4,_contentEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}function div6_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;($$invalidate(8,_rootEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('closable'in $$props)$$invalidate(14,closable=$$props.closable);if('open'in $$props)$$invalidate(2,open=$$props.open);if('transition'in $$props)$$invalidate(15,transition=$$props.transition);if('calloutvariant'in $$props)$$invalidate(3,calloutvariant=$$props.calloutvariant);if('maxwidth'in $$props)$$invalidate(0,maxwidth=$$props.maxwidth);if('width'in $$props)$$invalidate(16,width=$$props.width);};$$self.$$.update=()=>{if($$self.$$.dirty&/*closable*/16384){// Reactive
|
|
300
300
|
$$invalidate(9,_isClosable=toBoolean(closable));}if($$self.$$.dirty&/*open*/4){setTimeout(()=>$$invalidate(7,_isOpen=toBoolean(open)),1);}if($$self.$$.dirty&/*_isOpen*/128){if(!_isOpen){// prevent null issues
|
|
301
301
|
$$invalidate(4,_contentEl=$$invalidate(5,_scrollEl=$$invalidate(8,_rootEl=$$invalidate(6,_headerEl=null))));window.removeEventListener('keydown',onInputKeyDown);}}if($$self.$$.dirty&/*_isOpen, _scrollEl, _contentEl*/176){if(_isOpen&&_scrollEl&&_contentEl){const hasScroll=_scrollEl.scrollHeight>_scrollEl.offsetHeight;if(hasScroll){_contentEl.classList.add("scroll-top");}}}if($$self.$$.dirty&/*_isOpen, _contentEl, _headerEl*/208){if(_isOpen&&_contentEl){window.addEventListener('keydown',onInputKeyDown);const children=getChildren();if(_headerEl.querySelector("div.modal-title").textContent||_headerEl.querySelector("div.modal-close")||children.length){_headerEl.classList.add("has-content");}}}if($$self.$$.dirty&/*transition*/32768){$$invalidate(11,_transitionTime=transition==="none"?0:transition==="slow"?400:200);}if($$self.$$.dirty&/*calloutvariant*/8){$$invalidate(10,_iconType=calloutvariant==="emergency"?"warning":calloutvariant==="important"?"alert-circle":calloutvariant==="information"?"information-circle":calloutvariant==="success"?"checkmark-circle":calloutvariant==="event"?"calendar":"");}};return [maxwidth,heading,open,calloutvariant,_contentEl,_scrollEl,_headerEl,_isOpen,_rootEl,_isClosable,_iconType,_transitionTime,close,handleScroll,closable,transition,width,header_binding,goa_scrollable_binding,div2_binding,div6_binding];}class Modal extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}:host *{box-sizing:border-box}.modal{font-family:var(--goa-font-family-sans);position:fixed;inset:0;display:flex;align-items:center;justify-content:center;height:100vh;width:100%;z-index:100}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.2);z-index:1000}.emergency{background-color:var(--goa-color-emergency-default)}.important{background-color:var(--goa-color-warning-default)}.information{background-color:var(--goa-color-info-default)}.event{background-color:var(--goa-color-info-default)}.success{background-color:var(--goa-color-success-default)}.callout-bar{flex:0 0 3rem;text-align:center;padding-top:2rem;border-radius:4px 0px 0px 4px}.content{flex:1 1 auto;width:100%;margin:var(--goa-space-xl)}.content header{display:flex;justify-content:space-between}.content header.has-content{margin-bottom:var(--goa-space-l)}@media screen and (max-width: 623px){.content{margin:var(--goa-space-l)}.content header.has-content{margin-bottom:var(--goa-space-m)}.modal-actions ::slotted(*){padding:var(--goa-space-l) 0 0}}@media screen and (min-width: 1024px){.modal-pane{max-width:var(--maxwidth)}}.modal-pane{background-color:#fff;z-index:1001;width:90%;display:flex;box-shadow:var(--goa-shadow-modal);border-radius:4px;border:1px solid var(--goa-color-greyscale-700)}.modal-actions ::slotted(*){padding:var(--goa-space-xl) 0 0}.modal-content{margin:0 -2rem;line-height:1.75rem}.modal-content ::slotted(:last-child){margin-bottom:0 !important}.modal-title{font:var(--goa-typography-heading-m)}.modal-close{padding-left:var(--goa-space-m);margin-top:var(--goa-space-2xs)}.scroll-top{box-shadow:inset 0px -8px 6px -6px rgba(0, 0, 0, 0.1)}.scroll-middle{box-shadow:inset 0px -8px 6px -6px rgba(0, 0, 0, 0.1), inset 0px 8px 6px -6px rgba(0, 0, 0, 0.1)}.scroll-bottom{box-shadow:inset 0px 8px 6px -6px rgba(0, 0, 0, 0.1)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$t,create_fragment$w,safe_not_equal,{heading:1,closable:14,open:2,transition:15,calloutvariant:3,maxwidth:0,width:16},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","closable","open","transition","calloutvariant","maxwidth","width"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get closable(){return this.$$.ctx[14];}set closable(closable){this.$$set({closable});flush();}get open(){return this.$$.ctx[2];}set open(open){this.$$set({open});flush();}get transition(){return this.$$.ctx[15];}set transition(transition){this.$$set({transition});flush();}get calloutvariant(){return this.$$.ctx[3];}set calloutvariant(calloutvariant){this.$$set({calloutvariant});flush();}get maxwidth(){return this.$$.ctx[0];}set maxwidth(maxwidth){this.$$set({maxwidth});flush();}get width(){return this.$$.ctx[16];}set width(width){this.$$set({width});flush();}}customElements.define("goa-modal",Modal);/* src/components/notification/Notification.svelte generated by Svelte v3.59.2 */function create_if_block$g(ctx){let div4;let div3;let div0;let goa_icon0;let goa_icon0_inverted_value;let t0;let div1;let t1;let div2;let button;let goa_icon1;let goa_icon1_inverted_value;let div4_class_value;let div4_style_value;let div4_transition;let current;let mounted;let dispose;return {c(){div4=element("div");div3=element("div");div0=element("div");goa_icon0=element("goa-icon");t0=space();div1=element("div");div1.innerHTML=`<slot></slot>`;t1=space();div2=element("div");button=element("button");goa_icon1=element("goa-icon");set_custom_element_data(goa_icon0,"type",/*iconType*/ctx[4]);set_custom_element_data(goa_icon0,"inverted",goa_icon0_inverted_value=/*type*/ctx[0]==="important"?"false":"true");attr(div0,"class","icon");attr(div1,"class","content");set_custom_element_data(goa_icon1,"type","close");set_custom_element_data(goa_icon1,"inverted",goa_icon1_inverted_value=/*type*/ctx[0]==="important"?"false":"true");attr(button,"class",/*type*/ctx[0]);attr(div2,"class","close");attr(div3,"class","content-container");attr(div3,"role","alert");attr(div3,"aria-live",/*arialive*/ctx[2]);attr(div3,"aria-atomic","true");attr(div4,"class",div4_class_value="notification "+/*type*/ctx[0]);attr(div4,"style",div4_style_value=`--max-content-width: ${/*maxcontentwidth*/ctx[1]}`);},m(target,anchor){insert(target,div4,anchor);append(div4,div3);append(div3,div0);append(div0,goa_icon0);append(div3,t0);append(div3,div1);append(div3,t1);append(div3,div2);append(div2,button);append(button,goa_icon1);current=true;if(!mounted){dispose=listen(button,"click",/*close*/ctx[5]);mounted=true;}},p(ctx,dirty){if(!current||dirty&/*iconType*/16){set_custom_element_data(goa_icon0,"type",/*iconType*/ctx[4]);}if(!current||dirty&/*type*/1&&goa_icon0_inverted_value!==(goa_icon0_inverted_value=/*type*/ctx[0]==="important"?"false":"true")){set_custom_element_data(goa_icon0,"inverted",goa_icon0_inverted_value);}if(!current||dirty&/*type*/1&&goa_icon1_inverted_value!==(goa_icon1_inverted_value=/*type*/ctx[0]==="important"?"false":"true")){set_custom_element_data(goa_icon1,"inverted",goa_icon1_inverted_value);}if(!current||dirty&/*type*/1){attr(button,"class",/*type*/ctx[0]);}if(!current||dirty&/*arialive*/4){attr(div3,"aria-live",/*arialive*/ctx[2]);}if(!current||dirty&/*type*/1&&div4_class_value!==(div4_class_value="notification "+/*type*/ctx[0])){attr(div4,"class",div4_class_value);}if(!current||dirty&/*maxcontentwidth*/2&&div4_style_value!==(div4_style_value=`--max-content-width: ${/*maxcontentwidth*/ctx[1]}`)){attr(div4,"style",div4_style_value);}},i(local){if(current)return;add_render_callback(()=>{if(!current)return;if(!div4_transition)div4_transition=create_bidirectional_transition(div4,fade,{},true);div4_transition.run(1);});current=true;},o(local){if(!div4_transition)div4_transition=create_bidirectional_transition(div4,fade,{},false);div4_transition.run(0);current=false;},d(detaching){if(detaching)detach(div4);if(detaching&&div4_transition)div4_transition.end();mounted=false;dispose();}};}function create_fragment$v(ctx){let if_block_anchor;let current;let if_block=/*show*/ctx[3]&&create_if_block$g(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(/*show*/ctx[3]){if(if_block){if_block.p(ctx,dirty);if(dirty&/*show*/8){transition_in(if_block,1);}}else {if_block=create_if_block$g(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$s($$self,$$props,$$invalidate){let iconType;const[Types,validateType]=typeValidator("Notification type",["emergency","important","information","event"],true);const[AriaLiveTypes,validateAriaLiveType]=typeValidator("Aria-Live type",["assertive","off","polite"],true);let{type=""}=$$props;let{maxcontentwidth="100%"}=$$props;let{arialive="polite"}=$$props;let show=true;onMount(()=>{validateAriaLiveType(arialive);setTimeout(()=>validateType(type),1);});function close(e){$$invalidate(3,show=false);e.target.dispatchEvent(new CustomEvent("_dismiss",{composed:true}));e.stopPropagation();}$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('maxcontentwidth'in $$props)$$invalidate(1,maxcontentwidth=$$props.maxcontentwidth);if('arialive'in $$props)$$invalidate(2,arialive=$$props.arialive);};$$self.$$.update=()=>{if($$self.$$.dirty&/*type*/1){$$invalidate(4,iconType=type==="emergency"?"warning":type==="important"?"alert-circle":type==="information"?"information-circle":type==="event"?"calendar":"");}};return [type,maxcontentwidth,arialive,show,iconType,close];}class Notification extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.notification{padding:var(--goa-space-l) var(--goa-space-m);display:flex}@media screen and (max-width: 623px){@media not (max-color:2147477350){.notification{padding:var(--goa-space-l) var(--goa-space-xl)}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.notification{padding:var(--goa-space-l) var(--goa-space-xl)}}}@media screen and (min-width: 1024px){.notification{padding:var(--goa-space-l) calc(3 * var(--goa-space-l))}}.emergency{background-color:var(--goa-color-emergency-default);color:var(--goa-color-text-light)}.important{background-color:var(--goa-color-warning-default);color:var(--goa-color-text-default)}.information,.event{background-color:var(--goa-color-info-default);color:var(--goa-color-text-light)}.icon{flex:0 0 auto}.content-container{display:flex;flex-direction:row;flex:1 1 auto;gap:var(--goa-space-m);margin:0 auto;max-width:min(var(--max-content-width), 100%)}.content{flex:1 1 auto}::slotted(a){color:unset !important;outline:unset !important}::slotted(a:focus){outline:auto!important;border-radius:var(--goa-border-radius-m)}.notification.important ::slotted(a:focus){outline:unset!important;box-shadow:0 0 0 3px var(--goa-color-greyscale-black);border-radius:var(--goa-border-radius-m)}.close{flex:0 0 auto}.close button{background-color:transparent;border:none;cursor:pointer;padding:var(--goa-space-2xs);margin:0;outline:none;border-radius:var(--goa-border-radius-m);display:inline-flex}.close button.information:hover,.close button.information:focus,.close button.event:hover,.close button.event:focus{background-color:var(--goa-color-info-dark)}.close button.information:focus,.close button.event:focus{box-shadow:0 0 0 3px var(--goa-color-greyscale-white)}.close button.important:hover,.close button.important:focus{background-color:var(--goa-color-warning-dark)}.close button.important:focus{box-shadow:0 0 0 3px var(--goa-color-greyscale-black)}.close button.emergency:hover,.close button.emergency:focus{background-color:var(--goa-color-emergency-dark)}.close button.emergency:focus{box-shadow:0 0 0 3px var(--goa-color-greyscale-white)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$s,create_fragment$v,safe_not_equal,{type:0,maxcontentwidth:1,arialive: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 ["type","maxcontentwidth","arialive"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get maxcontentwidth(){return this.$$.ctx[1];}set maxcontentwidth(maxcontentwidth){this.$$set({maxcontentwidth});flush();}get arialive(){return this.$$.ctx[2];}set arialive(arialive){this.$$set({arialive});flush();}}customElements.define("goa-notification",Notification);const dimensionRegex=/^[1-9]+[0-9]*(px|em|rem|ch|vh|vw|%)$/;function isValidDimension(value){return dimensionRegex.test(value);}/* src/components/page-block/PageBlock.svelte generated by Svelte v3.59.2 */function create_fragment$u(ctx){let div;let slot;let div_style_value;return {c(){div=element("div");slot=element("slot");this.c=noop;attr(div,"class","page-content");attr(div,"style",div_style_value=`--max-width: ${/*_width*/ctx[0]}`);},m(target,anchor){insert(target,div,anchor);append(div,slot);},p(ctx,[dirty]){if(dirty&/*_width*/1&&div_style_value!==(div_style_value=`--max-width: ${/*_width*/ctx[0]}`)){attr(div,"style",div_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);}};}function instance$r($$self,$$props,$$invalidate){const Sizes={"full":"100%"};let{width}=$$props;let{_width}=$$props;function isValidSize(value){if(["full"].includes(width))return true;if(isValidDimension(value))return true;return false;}onMount(()=>{if(!isValidSize(width)){console.error("Invalid PageBlock width");}$$invalidate(0,_width=Sizes[width]||width);});$$self.$$set=$$props=>{if('width'in $$props)$$invalidate(1,width=$$props.width);if('_width'in $$props)$$invalidate(0,_width=$$props._width);};return [_width,width];}class PageBlock extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.page-content{max-width:var(--max-width);margin:0 auto;padding:0 1rem}@media screen and (max-width: 623px){@media not (max-color:2147477350){.page-content{padding:0 2rem}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.page-content{padding:0 2rem}}}@media screen and (min-width: 1024px){.page-content{padding:0 4.5rem}}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$r,create_fragment$u,safe_not_equal,{width:1,_width: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 ["width","_width"];}get width(){return this.$$.ctx[1];}set width(width){this.$$set({width});flush();}get _width(){return this.$$.ctx[0];}set _width(_width){this.$$set({_width});flush();}}customElements.define("goa-page-block",PageBlock);/* src/components/pagination/Pagination.svelte generated by Svelte v3.59.2 */function get_each_context$5(ctx,list,i){const child_ctx=ctx.slice();child_ctx[18]=list[i];child_ctx[20]=i;return child_ctx;}// (78:4) {#if variant === "all"}
|
|
302
|
-
function create_if_block$f(ctx){let goa_block;let span0;let t1;let input;let t2;let goa_dropdown;let t3;let span1;let t4;let t5;let each_value={length:/*_pageCount*/ctx[8]};let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$5(get_each_context$5(ctx,each_value,i));}return {c(){goa_block=element("goa-block");span0=element("span");span0.textContent="Page";t1=space();input=element("input");t2=space();goa_dropdown=element("goa-dropdown");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}t3=space();span1=element("span");t4=text("of ");t5=text(/*_pageCount*/ctx[8]);attr(input,"type","hidden");set_custom_element_data(goa_dropdown,"value",/*pagenumber*/ctx[0]);set_custom_element_data(
|
|
302
|
+
function create_if_block$f(ctx){let goa_block;let span0;let t1;let input;let t2;let goa_dropdown;let t3;let span1;let t4;let t5;let each_value={length:/*_pageCount*/ctx[8]};let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$5(get_each_context$5(ctx,each_value,i));}return {c(){goa_block=element("goa-block");span0=element("span");span0.textContent="Page";t1=space();input=element("input");t2=space();goa_dropdown=element("goa-dropdown");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}t3=space();span1=element("span");t4=text("of ");t5=text(/*_pageCount*/ctx[8]);attr(input,"type","hidden");set_custom_element_data(goa_dropdown,"value",/*pagenumber*/ctx[0]);set_custom_element_data(goa_block,"data-testid","page-selector");set_custom_element_data(goa_block,"alignment","center");set_custom_element_data(goa_block,"gap","s");},m(target,anchor){insert(target,goa_block,anchor);append(goa_block,span0);append(goa_block,t1);append(goa_block,input);/*input_binding*/ctx[12](input);append(goa_block,t2);append(goa_block,goa_dropdown);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(goa_dropdown,null);}}/*goa_dropdown_binding*/ctx[13](goa_dropdown);append(goa_block,t3);append(goa_block,span1);append(span1,t4);append(span1,t5);},p(ctx,dirty){if(dirty&/*_pageCount*/256){each_value={length:/*_pageCount*/ctx[8]};let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$5(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$5(child_ctx);each_blocks[i].c();each_blocks[i].m(goa_dropdown,null);}}for(;i<each_blocks.length;i+=1){each_blocks[i].d(1);}each_blocks.length=each_value.length;}if(dirty&/*pagenumber*/1){set_custom_element_data(goa_dropdown,"value",/*pagenumber*/ctx[0]);}if(dirty&/*_pageCount*/256)set_data(t5,/*_pageCount*/ctx[8]);},d(detaching){if(detaching)detach(goa_block);/*input_binding*/ctx[12](null);destroy_each(each_blocks,detaching);/*goa_dropdown_binding*/ctx[13](null);}};}// (83:10) {#each {length: _pageCount} as _, i}
|
|
303
303
|
function create_each_block$5(ctx){let goa_dropdown_item;return {c(){goa_dropdown_item=element("goa-dropdown-item");set_custom_element_data(goa_dropdown_item,"value",/*i*/ctx[20]+1);set_custom_element_data(goa_dropdown_item,"label",/*i*/ctx[20]+1);},m(target,anchor){insert(target,goa_dropdown_item,anchor);},p:noop,d(detaching){if(detaching)detach(goa_dropdown_item);}};}function create_fragment$t(ctx){let goa_block1;let div;let t0;let goa_block0;let goa_button0;let t1;let goa_button0_disabled_value;let t2;let goa_button1;let t3;let goa_button1_disabled_value;let mounted;let dispose;let if_block=/*variant*/ctx[1]==="all"&&create_if_block$f(ctx);return {c(){goa_block1=element("goa-block");div=element("div");if(if_block)if_block.c();t0=space();goa_block0=element("goa-block");goa_button0=element("goa-button");t1=text("Previous");t2=space();goa_button1=element("goa-button");t3=text("Next");this.c=noop;set_custom_element_data(goa_button0,"type","tertiary");set_custom_element_data(goa_button0,"leadingicon","arrow-back");set_custom_element_data(goa_button0,"disabled",goa_button0_disabled_value=/*pagenumber*/ctx[0]==1?"true":"false");set_custom_element_data(goa_button1,"type","tertiary");set_custom_element_data(goa_button1,"trailingicon","arrow-forward");set_custom_element_data(goa_button1,"disabled",goa_button1_disabled_value=/*pagenumber*/ctx[0]==/*_pageCount*/ctx[8]?"true":"false");set_custom_element_data(goa_block0,"alignment","center");set_custom_element_data(goa_block0,"gap","m");set_custom_element_data(goa_block0,"data-testid","page-links");attr(div,"class","controls");set_custom_element_data(goa_block1,"id","root");set_custom_element_data(goa_block1,"ml",/*ml*/ctx[5]);set_custom_element_data(goa_block1,"mr",/*mr*/ctx[3]);set_custom_element_data(goa_block1,"mb",/*mb*/ctx[4]);set_custom_element_data(goa_block1,"mt",/*mt*/ctx[2]);},m(target,anchor){insert(target,goa_block1,anchor);append(goa_block1,div);if(if_block)if_block.m(div,null);append(div,t0);append(div,goa_block0);append(goa_block0,goa_button0);append(goa_button0,t1);append(goa_block0,t2);append(goa_block0,goa_button1);append(goa_button1,t3);if(!mounted){dispose=[listen(goa_button0,"click",/*click_handler*/ctx[14]),listen(goa_button1,"click",/*click_handler_1*/ctx[15])];mounted=true;}},p(ctx,[dirty]){if(/*variant*/ctx[1]==="all"){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$f(ctx);if_block.c();if_block.m(div,t0);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty&/*pagenumber*/1&&goa_button0_disabled_value!==(goa_button0_disabled_value=/*pagenumber*/ctx[0]==1?"true":"false")){set_custom_element_data(goa_button0,"disabled",goa_button0_disabled_value);}if(dirty&/*pagenumber, _pageCount*/257&&goa_button1_disabled_value!==(goa_button1_disabled_value=/*pagenumber*/ctx[0]==/*_pageCount*/ctx[8]?"true":"false")){set_custom_element_data(goa_button1,"disabled",goa_button1_disabled_value);}if(dirty&/*ml*/32){set_custom_element_data(goa_block1,"ml",/*ml*/ctx[5]);}if(dirty&/*mr*/8){set_custom_element_data(goa_block1,"mr",/*mr*/ctx[3]);}if(dirty&/*mb*/16){set_custom_element_data(goa_block1,"mb",/*mb*/ctx[4]);}if(dirty&/*mt*/4){set_custom_element_data(goa_block1,"mt",/*mt*/ctx[2]);}},i:noop,o:noop,d(detaching){if(detaching)detach(goa_block1);if(if_block)if_block.d();mounted=false;run_all(dispose);}};}function instance$q($$self,$$props,$$invalidate){let _pageCount;const[Variants,validateVariant]=typeValidator("Pagination variant",["all","links-only"]);let{pagenumber}=$$props;let{itemcount}=$$props;let{perpagecount=10}=$$props;let{variant="all"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;// private
|
|
304
304
|
let pageDropdownEl=null;let hiddenEl=null;// needed to allow the inputEl's event to be cancelled
|
|
305
305
|
// hooks
|
package/react-components.umd.js
CHANGED
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
}}function header_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_headerEl=$$value;($$invalidate(6,_headerEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}function goa_scrollable_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_scrollEl=$$value;($$invalidate(5,_scrollEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}function div2_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_contentEl=$$value;($$invalidate(4,_contentEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}function div6_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;($$invalidate(8,_rootEl),$$invalidate(7,_isOpen)),$$invalidate(2,open);});}$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('closable'in $$props)$$invalidate(14,closable=$$props.closable);if('open'in $$props)$$invalidate(2,open=$$props.open);if('transition'in $$props)$$invalidate(15,transition=$$props.transition);if('calloutvariant'in $$props)$$invalidate(3,calloutvariant=$$props.calloutvariant);if('maxwidth'in $$props)$$invalidate(0,maxwidth=$$props.maxwidth);if('width'in $$props)$$invalidate(16,width=$$props.width);};$$self.$$.update=()=>{if($$self.$$.dirty&/*closable*/16384){// Reactive
|
|
302
302
|
$$invalidate(9,_isClosable=toBoolean(closable));}if($$self.$$.dirty&/*open*/4){setTimeout(()=>$$invalidate(7,_isOpen=toBoolean(open)),1);}if($$self.$$.dirty&/*_isOpen*/128){if(!_isOpen){// prevent null issues
|
|
303
303
|
$$invalidate(4,_contentEl=$$invalidate(5,_scrollEl=$$invalidate(8,_rootEl=$$invalidate(6,_headerEl=null))));window.removeEventListener('keydown',onInputKeyDown);}}if($$self.$$.dirty&/*_isOpen, _scrollEl, _contentEl*/176){if(_isOpen&&_scrollEl&&_contentEl){const hasScroll=_scrollEl.scrollHeight>_scrollEl.offsetHeight;if(hasScroll){_contentEl.classList.add("scroll-top");}}}if($$self.$$.dirty&/*_isOpen, _contentEl, _headerEl*/208){if(_isOpen&&_contentEl){window.addEventListener('keydown',onInputKeyDown);const children=getChildren();if(_headerEl.querySelector("div.modal-title").textContent||_headerEl.querySelector("div.modal-close")||children.length){_headerEl.classList.add("has-content");}}}if($$self.$$.dirty&/*transition*/32768){$$invalidate(11,_transitionTime=transition==="none"?0:transition==="slow"?400:200);}if($$self.$$.dirty&/*calloutvariant*/8){$$invalidate(10,_iconType=calloutvariant==="emergency"?"warning":calloutvariant==="important"?"alert-circle":calloutvariant==="information"?"information-circle":calloutvariant==="success"?"checkmark-circle":calloutvariant==="event"?"calendar":"");}};return [maxwidth,heading,open,calloutvariant,_contentEl,_scrollEl,_headerEl,_isOpen,_rootEl,_isClosable,_iconType,_transitionTime,close,handleScroll,closable,transition,width,header_binding,goa_scrollable_binding,div2_binding,div6_binding];}class Modal extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}:host *{box-sizing:border-box}.modal{font-family:var(--goa-font-family-sans);position:fixed;inset:0;display:flex;align-items:center;justify-content:center;height:100vh;width:100%;z-index:100}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.2);z-index:1000}.emergency{background-color:var(--goa-color-emergency-default)}.important{background-color:var(--goa-color-warning-default)}.information{background-color:var(--goa-color-info-default)}.event{background-color:var(--goa-color-info-default)}.success{background-color:var(--goa-color-success-default)}.callout-bar{flex:0 0 3rem;text-align:center;padding-top:2rem;border-radius:4px 0px 0px 4px}.content{flex:1 1 auto;width:100%;margin:var(--goa-space-xl)}.content header{display:flex;justify-content:space-between}.content header.has-content{margin-bottom:var(--goa-space-l)}@media screen and (max-width: 623px){.content{margin:var(--goa-space-l)}.content header.has-content{margin-bottom:var(--goa-space-m)}.modal-actions ::slotted(*){padding:var(--goa-space-l) 0 0}}@media screen and (min-width: 1024px){.modal-pane{max-width:var(--maxwidth)}}.modal-pane{background-color:#fff;z-index:1001;width:90%;display:flex;box-shadow:var(--goa-shadow-modal);border-radius:4px;border:1px solid var(--goa-color-greyscale-700)}.modal-actions ::slotted(*){padding:var(--goa-space-xl) 0 0}.modal-content{margin:0 -2rem;line-height:1.75rem}.modal-content ::slotted(:last-child){margin-bottom:0 !important}.modal-title{font:var(--goa-typography-heading-m)}.modal-close{padding-left:var(--goa-space-m);margin-top:var(--goa-space-2xs)}.scroll-top{box-shadow:inset 0px -8px 6px -6px rgba(0, 0, 0, 0.1)}.scroll-middle{box-shadow:inset 0px -8px 6px -6px rgba(0, 0, 0, 0.1), inset 0px 8px 6px -6px rgba(0, 0, 0, 0.1)}.scroll-bottom{box-shadow:inset 0px 8px 6px -6px rgba(0, 0, 0, 0.1)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$t,create_fragment$w,safe_not_equal,{heading:1,closable:14,open:2,transition:15,calloutvariant:3,maxwidth:0,width:16},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","closable","open","transition","calloutvariant","maxwidth","width"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get closable(){return this.$$.ctx[14];}set closable(closable){this.$$set({closable});flush();}get open(){return this.$$.ctx[2];}set open(open){this.$$set({open});flush();}get transition(){return this.$$.ctx[15];}set transition(transition){this.$$set({transition});flush();}get calloutvariant(){return this.$$.ctx[3];}set calloutvariant(calloutvariant){this.$$set({calloutvariant});flush();}get maxwidth(){return this.$$.ctx[0];}set maxwidth(maxwidth){this.$$set({maxwidth});flush();}get width(){return this.$$.ctx[16];}set width(width){this.$$set({width});flush();}}customElements.define("goa-modal",Modal);/* src/components/notification/Notification.svelte generated by Svelte v3.59.2 */function create_if_block$g(ctx){let div4;let div3;let div0;let goa_icon0;let goa_icon0_inverted_value;let t0;let div1;let t1;let div2;let button;let goa_icon1;let goa_icon1_inverted_value;let div4_class_value;let div4_style_value;let div4_transition;let current;let mounted;let dispose;return {c(){div4=element("div");div3=element("div");div0=element("div");goa_icon0=element("goa-icon");t0=space();div1=element("div");div1.innerHTML=`<slot></slot>`;t1=space();div2=element("div");button=element("button");goa_icon1=element("goa-icon");set_custom_element_data(goa_icon0,"type",/*iconType*/ctx[4]);set_custom_element_data(goa_icon0,"inverted",goa_icon0_inverted_value=/*type*/ctx[0]==="important"?"false":"true");attr(div0,"class","icon");attr(div1,"class","content");set_custom_element_data(goa_icon1,"type","close");set_custom_element_data(goa_icon1,"inverted",goa_icon1_inverted_value=/*type*/ctx[0]==="important"?"false":"true");attr(button,"class",/*type*/ctx[0]);attr(div2,"class","close");attr(div3,"class","content-container");attr(div3,"role","alert");attr(div3,"aria-live",/*arialive*/ctx[2]);attr(div3,"aria-atomic","true");attr(div4,"class",div4_class_value="notification "+/*type*/ctx[0]);attr(div4,"style",div4_style_value=`--max-content-width: ${/*maxcontentwidth*/ctx[1]}`);},m(target,anchor){insert(target,div4,anchor);append(div4,div3);append(div3,div0);append(div0,goa_icon0);append(div3,t0);append(div3,div1);append(div3,t1);append(div3,div2);append(div2,button);append(button,goa_icon1);current=true;if(!mounted){dispose=listen(button,"click",/*close*/ctx[5]);mounted=true;}},p(ctx,dirty){if(!current||dirty&/*iconType*/16){set_custom_element_data(goa_icon0,"type",/*iconType*/ctx[4]);}if(!current||dirty&/*type*/1&&goa_icon0_inverted_value!==(goa_icon0_inverted_value=/*type*/ctx[0]==="important"?"false":"true")){set_custom_element_data(goa_icon0,"inverted",goa_icon0_inverted_value);}if(!current||dirty&/*type*/1&&goa_icon1_inverted_value!==(goa_icon1_inverted_value=/*type*/ctx[0]==="important"?"false":"true")){set_custom_element_data(goa_icon1,"inverted",goa_icon1_inverted_value);}if(!current||dirty&/*type*/1){attr(button,"class",/*type*/ctx[0]);}if(!current||dirty&/*arialive*/4){attr(div3,"aria-live",/*arialive*/ctx[2]);}if(!current||dirty&/*type*/1&&div4_class_value!==(div4_class_value="notification "+/*type*/ctx[0])){attr(div4,"class",div4_class_value);}if(!current||dirty&/*maxcontentwidth*/2&&div4_style_value!==(div4_style_value=`--max-content-width: ${/*maxcontentwidth*/ctx[1]}`)){attr(div4,"style",div4_style_value);}},i(local){if(current)return;add_render_callback(()=>{if(!current)return;if(!div4_transition)div4_transition=create_bidirectional_transition(div4,fade,{},true);div4_transition.run(1);});current=true;},o(local){if(!div4_transition)div4_transition=create_bidirectional_transition(div4,fade,{},false);div4_transition.run(0);current=false;},d(detaching){if(detaching)detach(div4);if(detaching&&div4_transition)div4_transition.end();mounted=false;dispose();}};}function create_fragment$v(ctx){let if_block_anchor;let current;let if_block=/*show*/ctx[3]&&create_if_block$g(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(/*show*/ctx[3]){if(if_block){if_block.p(ctx,dirty);if(dirty&/*show*/8){transition_in(if_block,1);}}else {if_block=create_if_block$g(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$s($$self,$$props,$$invalidate){let iconType;const[Types,validateType]=typeValidator("Notification type",["emergency","important","information","event"],true);const[AriaLiveTypes,validateAriaLiveType]=typeValidator("Aria-Live type",["assertive","off","polite"],true);let{type=""}=$$props;let{maxcontentwidth="100%"}=$$props;let{arialive="polite"}=$$props;let show=true;onMount(()=>{validateAriaLiveType(arialive);setTimeout(()=>validateType(type),1);});function close(e){$$invalidate(3,show=false);e.target.dispatchEvent(new CustomEvent("_dismiss",{composed:true}));e.stopPropagation();}$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('maxcontentwidth'in $$props)$$invalidate(1,maxcontentwidth=$$props.maxcontentwidth);if('arialive'in $$props)$$invalidate(2,arialive=$$props.arialive);};$$self.$$.update=()=>{if($$self.$$.dirty&/*type*/1){$$invalidate(4,iconType=type==="emergency"?"warning":type==="important"?"alert-circle":type==="information"?"information-circle":type==="event"?"calendar":"");}};return [type,maxcontentwidth,arialive,show,iconType,close];}class Notification extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.notification{padding:var(--goa-space-l) var(--goa-space-m);display:flex}@media screen and (max-width: 623px){@media not (max-color:2147477350){.notification{padding:var(--goa-space-l) var(--goa-space-xl)}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.notification{padding:var(--goa-space-l) var(--goa-space-xl)}}}@media screen and (min-width: 1024px){.notification{padding:var(--goa-space-l) calc(3 * var(--goa-space-l))}}.emergency{background-color:var(--goa-color-emergency-default);color:var(--goa-color-text-light)}.important{background-color:var(--goa-color-warning-default);color:var(--goa-color-text-default)}.information,.event{background-color:var(--goa-color-info-default);color:var(--goa-color-text-light)}.icon{flex:0 0 auto}.content-container{display:flex;flex-direction:row;flex:1 1 auto;gap:var(--goa-space-m);margin:0 auto;max-width:min(var(--max-content-width), 100%)}.content{flex:1 1 auto}::slotted(a){color:unset !important;outline:unset !important}::slotted(a:focus){outline:auto!important;border-radius:var(--goa-border-radius-m)}.notification.important ::slotted(a:focus){outline:unset!important;box-shadow:0 0 0 3px var(--goa-color-greyscale-black);border-radius:var(--goa-border-radius-m)}.close{flex:0 0 auto}.close button{background-color:transparent;border:none;cursor:pointer;padding:var(--goa-space-2xs);margin:0;outline:none;border-radius:var(--goa-border-radius-m);display:inline-flex}.close button.information:hover,.close button.information:focus,.close button.event:hover,.close button.event:focus{background-color:var(--goa-color-info-dark)}.close button.information:focus,.close button.event:focus{box-shadow:0 0 0 3px var(--goa-color-greyscale-white)}.close button.important:hover,.close button.important:focus{background-color:var(--goa-color-warning-dark)}.close button.important:focus{box-shadow:0 0 0 3px var(--goa-color-greyscale-black)}.close button.emergency:hover,.close button.emergency:focus{background-color:var(--goa-color-emergency-dark)}.close button.emergency:focus{box-shadow:0 0 0 3px var(--goa-color-greyscale-white)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$s,create_fragment$v,safe_not_equal,{type:0,maxcontentwidth:1,arialive: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 ["type","maxcontentwidth","arialive"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get maxcontentwidth(){return this.$$.ctx[1];}set maxcontentwidth(maxcontentwidth){this.$$set({maxcontentwidth});flush();}get arialive(){return this.$$.ctx[2];}set arialive(arialive){this.$$set({arialive});flush();}}customElements.define("goa-notification",Notification);const dimensionRegex=/^[1-9]+[0-9]*(px|em|rem|ch|vh|vw|%)$/;function isValidDimension(value){return dimensionRegex.test(value);}/* src/components/page-block/PageBlock.svelte generated by Svelte v3.59.2 */function create_fragment$u(ctx){let div;let slot;let div_style_value;return {c(){div=element("div");slot=element("slot");this.c=noop;attr(div,"class","page-content");attr(div,"style",div_style_value=`--max-width: ${/*_width*/ctx[0]}`);},m(target,anchor){insert(target,div,anchor);append(div,slot);},p(ctx,[dirty]){if(dirty&/*_width*/1&&div_style_value!==(div_style_value=`--max-width: ${/*_width*/ctx[0]}`)){attr(div,"style",div_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);}};}function instance$r($$self,$$props,$$invalidate){const Sizes={"full":"100%"};let{width}=$$props;let{_width}=$$props;function isValidSize(value){if(["full"].includes(width))return true;if(isValidDimension(value))return true;return false;}onMount(()=>{if(!isValidSize(width)){console.error("Invalid PageBlock width");}$$invalidate(0,_width=Sizes[width]||width);});$$self.$$set=$$props=>{if('width'in $$props)$$invalidate(1,width=$$props.width);if('_width'in $$props)$$invalidate(0,_width=$$props._width);};return [_width,width];}class PageBlock extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.page-content{max-width:var(--max-width);margin:0 auto;padding:0 1rem}@media screen and (max-width: 623px){@media not (max-color:2147477350){.page-content{padding:0 2rem}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.page-content{padding:0 2rem}}}@media screen and (min-width: 1024px){.page-content{padding:0 4.5rem}}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$r,create_fragment$u,safe_not_equal,{width:1,_width: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 ["width","_width"];}get width(){return this.$$.ctx[1];}set width(width){this.$$set({width});flush();}get _width(){return this.$$.ctx[0];}set _width(_width){this.$$set({_width});flush();}}customElements.define("goa-page-block",PageBlock);/* src/components/pagination/Pagination.svelte generated by Svelte v3.59.2 */function get_each_context$5(ctx,list,i){const child_ctx=ctx.slice();child_ctx[18]=list[i];child_ctx[20]=i;return child_ctx;}// (78:4) {#if variant === "all"}
|
|
304
|
-
function create_if_block$f(ctx){let goa_block;let span0;let t1;let input;let t2;let goa_dropdown;let t3;let span1;let t4;let t5;let each_value={length:/*_pageCount*/ctx[8]};let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$5(get_each_context$5(ctx,each_value,i));}return {c(){goa_block=element("goa-block");span0=element("span");span0.textContent="Page";t1=space();input=element("input");t2=space();goa_dropdown=element("goa-dropdown");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}t3=space();span1=element("span");t4=text("of ");t5=text(/*_pageCount*/ctx[8]);attr(input,"type","hidden");set_custom_element_data(goa_dropdown,"value",/*pagenumber*/ctx[0]);set_custom_element_data(
|
|
304
|
+
function create_if_block$f(ctx){let goa_block;let span0;let t1;let input;let t2;let goa_dropdown;let t3;let span1;let t4;let t5;let each_value={length:/*_pageCount*/ctx[8]};let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$5(get_each_context$5(ctx,each_value,i));}return {c(){goa_block=element("goa-block");span0=element("span");span0.textContent="Page";t1=space();input=element("input");t2=space();goa_dropdown=element("goa-dropdown");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}t3=space();span1=element("span");t4=text("of ");t5=text(/*_pageCount*/ctx[8]);attr(input,"type","hidden");set_custom_element_data(goa_dropdown,"value",/*pagenumber*/ctx[0]);set_custom_element_data(goa_block,"data-testid","page-selector");set_custom_element_data(goa_block,"alignment","center");set_custom_element_data(goa_block,"gap","s");},m(target,anchor){insert(target,goa_block,anchor);append(goa_block,span0);append(goa_block,t1);append(goa_block,input);/*input_binding*/ctx[12](input);append(goa_block,t2);append(goa_block,goa_dropdown);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(goa_dropdown,null);}}/*goa_dropdown_binding*/ctx[13](goa_dropdown);append(goa_block,t3);append(goa_block,span1);append(span1,t4);append(span1,t5);},p(ctx,dirty){if(dirty&/*_pageCount*/256){each_value={length:/*_pageCount*/ctx[8]};let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$5(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$5(child_ctx);each_blocks[i].c();each_blocks[i].m(goa_dropdown,null);}}for(;i<each_blocks.length;i+=1){each_blocks[i].d(1);}each_blocks.length=each_value.length;}if(dirty&/*pagenumber*/1){set_custom_element_data(goa_dropdown,"value",/*pagenumber*/ctx[0]);}if(dirty&/*_pageCount*/256)set_data(t5,/*_pageCount*/ctx[8]);},d(detaching){if(detaching)detach(goa_block);/*input_binding*/ctx[12](null);destroy_each(each_blocks,detaching);/*goa_dropdown_binding*/ctx[13](null);}};}// (83:10) {#each {length: _pageCount} as _, i}
|
|
305
305
|
function create_each_block$5(ctx){let goa_dropdown_item;return {c(){goa_dropdown_item=element("goa-dropdown-item");set_custom_element_data(goa_dropdown_item,"value",/*i*/ctx[20]+1);set_custom_element_data(goa_dropdown_item,"label",/*i*/ctx[20]+1);},m(target,anchor){insert(target,goa_dropdown_item,anchor);},p:noop,d(detaching){if(detaching)detach(goa_dropdown_item);}};}function create_fragment$t(ctx){let goa_block1;let div;let t0;let goa_block0;let goa_button0;let t1;let goa_button0_disabled_value;let t2;let goa_button1;let t3;let goa_button1_disabled_value;let mounted;let dispose;let if_block=/*variant*/ctx[1]==="all"&&create_if_block$f(ctx);return {c(){goa_block1=element("goa-block");div=element("div");if(if_block)if_block.c();t0=space();goa_block0=element("goa-block");goa_button0=element("goa-button");t1=text("Previous");t2=space();goa_button1=element("goa-button");t3=text("Next");this.c=noop;set_custom_element_data(goa_button0,"type","tertiary");set_custom_element_data(goa_button0,"leadingicon","arrow-back");set_custom_element_data(goa_button0,"disabled",goa_button0_disabled_value=/*pagenumber*/ctx[0]==1?"true":"false");set_custom_element_data(goa_button1,"type","tertiary");set_custom_element_data(goa_button1,"trailingicon","arrow-forward");set_custom_element_data(goa_button1,"disabled",goa_button1_disabled_value=/*pagenumber*/ctx[0]==/*_pageCount*/ctx[8]?"true":"false");set_custom_element_data(goa_block0,"alignment","center");set_custom_element_data(goa_block0,"gap","m");set_custom_element_data(goa_block0,"data-testid","page-links");attr(div,"class","controls");set_custom_element_data(goa_block1,"id","root");set_custom_element_data(goa_block1,"ml",/*ml*/ctx[5]);set_custom_element_data(goa_block1,"mr",/*mr*/ctx[3]);set_custom_element_data(goa_block1,"mb",/*mb*/ctx[4]);set_custom_element_data(goa_block1,"mt",/*mt*/ctx[2]);},m(target,anchor){insert(target,goa_block1,anchor);append(goa_block1,div);if(if_block)if_block.m(div,null);append(div,t0);append(div,goa_block0);append(goa_block0,goa_button0);append(goa_button0,t1);append(goa_block0,t2);append(goa_block0,goa_button1);append(goa_button1,t3);if(!mounted){dispose=[listen(goa_button0,"click",/*click_handler*/ctx[14]),listen(goa_button1,"click",/*click_handler_1*/ctx[15])];mounted=true;}},p(ctx,[dirty]){if(/*variant*/ctx[1]==="all"){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$f(ctx);if_block.c();if_block.m(div,t0);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty&/*pagenumber*/1&&goa_button0_disabled_value!==(goa_button0_disabled_value=/*pagenumber*/ctx[0]==1?"true":"false")){set_custom_element_data(goa_button0,"disabled",goa_button0_disabled_value);}if(dirty&/*pagenumber, _pageCount*/257&&goa_button1_disabled_value!==(goa_button1_disabled_value=/*pagenumber*/ctx[0]==/*_pageCount*/ctx[8]?"true":"false")){set_custom_element_data(goa_button1,"disabled",goa_button1_disabled_value);}if(dirty&/*ml*/32){set_custom_element_data(goa_block1,"ml",/*ml*/ctx[5]);}if(dirty&/*mr*/8){set_custom_element_data(goa_block1,"mr",/*mr*/ctx[3]);}if(dirty&/*mb*/16){set_custom_element_data(goa_block1,"mb",/*mb*/ctx[4]);}if(dirty&/*mt*/4){set_custom_element_data(goa_block1,"mt",/*mt*/ctx[2]);}},i:noop,o:noop,d(detaching){if(detaching)detach(goa_block1);if(if_block)if_block.d();mounted=false;run_all(dispose);}};}function instance$q($$self,$$props,$$invalidate){let _pageCount;const[Variants,validateVariant]=typeValidator("Pagination variant",["all","links-only"]);let{pagenumber}=$$props;let{itemcount}=$$props;let{perpagecount=10}=$$props;let{variant="all"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;// private
|
|
306
306
|
let pageDropdownEl=null;let hiddenEl=null;// needed to allow the inputEl's event to be cancelled
|
|
307
307
|
// hooks
|