@mozaic-ds/web-components 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/package.json +3 -3
  2. package/public/adeo/components/autocomplete/Autocomplete.js +1 -1
  3. package/public/adeo/components/autocomplete/Autocomplete.js.map +1 -1
  4. package/public/adeo/components/autocomplete/Autocomplete.svelte +34 -15
  5. package/public/adeo/components/button/Button.js +1 -1
  6. package/public/adeo/components/button/Button.js.map +1 -1
  7. package/public/adeo/components/button/Button.svelte +2 -1
  8. package/public/adeo/components/checkbox/Checkbox.js +1 -1
  9. package/public/adeo/components/checkboxgroup/checkboxGroup.js +1 -1
  10. package/public/adeo/components/field/Field.js +1 -1
  11. package/public/adeo/components/radiogroup/RadioGroup.js +1 -1
  12. package/public/adeo/components/tabs/Tabs.js +1 -1
  13. package/public/adeo/components/tabs/Tabs.nested.js +1 -1
  14. package/public/adeo/components/tabs/Tabs.nested.js.map +1 -1
  15. package/public/adeo/components/tag/Tag.js +1 -1
  16. package/public/adeo/components/tag/Tag.js.map +1 -1
  17. package/public/adeo/components/tag/Tag.nested.js +1 -1
  18. package/public/adeo/components/tag/Tag.nested.js.map +1 -1
  19. package/public/adeo/components/tag/Tag.nested.svelte +5 -5
  20. package/public/adeo/components/tag/Tag.svelte +5 -5
  21. package/public/adeo/components/textarea/Textarea.js +1 -1
  22. package/public/adeo/components/textinput/Textinput.js +1 -1
  23. package/public/adeo/components/textinput/Textinput.nested.js +1 -1
  24. package/public/adeo/components/textinput/Textinput.nested.js.map +1 -1
  25. package/public/bricoman/components/autocomplete/Autocomplete.js +1 -1
  26. package/public/bricoman/components/autocomplete/Autocomplete.js.map +1 -1
  27. package/public/bricoman/components/autocomplete/Autocomplete.svelte +34 -15
  28. package/public/bricoman/components/button/Button.js +1 -1
  29. package/public/bricoman/components/button/Button.js.map +1 -1
  30. package/public/bricoman/components/button/Button.svelte +2 -1
  31. package/public/bricoman/components/checkbox/Checkbox.js +1 -1
  32. package/public/bricoman/components/checkboxgroup/checkboxGroup.js +1 -1
  33. package/public/bricoman/components/field/Field.js +1 -1
  34. package/public/bricoman/components/radiogroup/RadioGroup.js +1 -1
  35. package/public/bricoman/components/tabs/Tabs.js +1 -1
  36. package/public/bricoman/components/tabs/Tabs.nested.js +1 -1
  37. package/public/bricoman/components/tabs/Tabs.nested.js.map +1 -1
  38. package/public/bricoman/components/tag/Tag.js +1 -1
  39. package/public/bricoman/components/tag/Tag.js.map +1 -1
  40. package/public/bricoman/components/tag/Tag.nested.js +1 -1
  41. package/public/bricoman/components/tag/Tag.nested.js.map +1 -1
  42. package/public/bricoman/components/tag/Tag.nested.svelte +5 -5
  43. package/public/bricoman/components/tag/Tag.svelte +5 -5
  44. package/public/bricoman/components/textarea/Textarea.js +1 -1
  45. package/public/bricoman/components/textinput/Textinput.js +1 -1
  46. package/public/bricoman/components/textinput/Textinput.nested.js +1 -1
  47. package/public/bricoman/components/textinput/Textinput.nested.js.map +1 -1
  48. package/public/components/autocomplete/Autocomplete.js +1 -1
  49. package/public/components/autocomplete/Autocomplete.js.map +1 -1
  50. package/public/components/autocomplete/Autocomplete.svelte +34 -15
  51. package/public/components/button/Button.js +1 -1
  52. package/public/components/button/Button.js.map +1 -1
  53. package/public/components/button/Button.svelte +2 -1
  54. package/public/components/checkbox/Checkbox.js +1 -1
  55. package/public/components/checkboxgroup/checkboxGroup.js +1 -1
  56. package/public/components/field/Field.js +1 -1
  57. package/public/components/radiogroup/RadioGroup.js +1 -1
  58. package/public/components/tabs/Tabs.js +1 -1
  59. package/public/components/tabs/Tabs.nested.js +1 -1
  60. package/public/components/tabs/Tabs.nested.js.map +1 -1
  61. package/public/components/tag/Tag.js +1 -1
  62. package/public/components/tag/Tag.js.map +1 -1
  63. package/public/components/tag/Tag.nested.js +1 -1
  64. package/public/components/tag/Tag.nested.js.map +1 -1
  65. package/public/components/tag/Tag.nested.svelte +5 -5
  66. package/public/components/tag/Tag.svelte +5 -5
  67. package/public/components/textarea/Textarea.js +1 -1
  68. package/public/components/textinput/Textinput.js +1 -1
  69. package/public/components/textinput/Textinput.nested.js +1 -1
  70. package/public/components/textinput/Textinput.nested.js.map +1 -1
@@ -1,2 +1,2 @@
1
- import{S as t,i as e,a as l,b as a,f as s,s as i,v as n,w as o,c as r,e as c,d,x as m,n as u,g as p,y as h,h as g,z as $,j as x,A as b,B as f,l as w,C as v,D as y,E as _,F as k,m as z,o as q,G as j,H as S,p as C,r as N,q as O,I as T,J as E,K as J,L,M as H,N as M,O as R}from"../../index-c33b3772.js";import{E as Y}from"../../EventHandler-02058705.js";import{c as A}from"../../ClickOutside-63071e7a.js";import U from"../tag/Tag.nested.js";import B from"../loader/Loader.nested.js";import D from"../textinput/Textinput.nested.js";import F from"../listbox/Listbox.nested.js";function G(t,e,l){const a=t.slice();return a[70]=e[l],a}function I(t,e,l){const a=t.slice();return a[70]=e[l],a[74]=l,a}function K(t){let e,l,a={id:t[1]?t[1]:`autocompleteTag-${t[31]}`,class:"mc-autocomplete__tag",label:t[30](),size:"s",type:"removable",dark:!1,disabled:!1,href:"",name:"",value:"",selected:!1};return e=new U({props:a}),t[49](e),e.$on("tag-removed",t[32]),{c(){m(e.$$.fragment)},m(t,a){b(e,t,a),l=!0},p(t,l){const a={};2&l[0]&&(a.id=t[1]?t[1]:`autocompleteTag-${t[31]}`),1073741824&l[0]&&(a.label=t[30]()),e.$set(a)},i(t){l||(v(e.$$.fragment,t),l=!0)},o(t){y(e.$$.fragment,t),l=!1},d(l){t[49](null),j(e,l)}}}function W(t){let e,l;return e=new B({props:{size:"s",theme:"primary",text:"",class:"mc-autocomplete__loader"}}),{c(){m(e.$$.fragment)},m(t,a){b(e,t,a),l=!0},i(t){l||(v(e.$$.fragment,t),l=!0)},o(t){y(e.$$.fragment,t),l=!1},d(t){j(e,t)}}}function P(t){let e,l,s;return{c(){e=c("button"),e.innerHTML='<navigation-control-tag--cross-24px></navigation-control-tag--cross-24px> \n <span class="mc-autocomplete__clear-text">Clear</span>',p(e,"class","mc-autocomplete__clear"),p(e,"type","button")},m(i,n){a(i,e,n),l||(s=w(e,"click",T(t[54])),l=!0)},p:u,d(t){t&&q(e),l=!1,s()}}}function Q(t){let e,l,s=t[26],i=[];for(let e=0;e<s.length;e+=1)i[e]=X(I(t,s,e));let n=t[19].length>t[15]&&Z(t);return{c(){e=c("div");for(let t=0;t<i.length;t+=1)i[t].c();l=d(),n&&n.c(),p(e,"class","tags-selected")},m(t,s){a(t,e,s);for(let t=0;t<i.length;t+=1)i[t]&&i[t].m(e,null);x(e,l),n&&n.m(e,null)},p(t,a){if(67141632&a[0]|512&a[1]){let n;for(s=t[26],n=0;n<s.length;n+=1){const o=I(t,s,n);i[n]?i[n].p(o,a):(i[n]=X(o),i[n].c(),i[n].m(e,l))}for(;n<i.length;n+=1)i[n].d(1);i.length=s.length}t[19].length>t[15]?n?n.p(t,a):(n=Z(t),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(t){t&&q(e),E(i,t),n&&n.d()}}}function V(t){let e,l,s,i,n,o;function r(){return t[56](t[70])}return{c(){e=c("div"),l=c("m-tag"),L(l,"id",s=t[70].id),L(l,"label",i=t[70].label),L(l,"size","s"),L(l,"type","removable"),p(e,"class","tag-selected")},m(t,s){a(t,e,s),x(e,l),n||(o=w(l,"tag-removed",r),n=!0)},p(e,a){t=e,67108864&a[0]&&s!==(s=t[70].id)&&L(l,"id",s),67108864&a[0]&&i!==(i=t[70].label)&&L(l,"label",i)},d(t){t&&q(e),n=!1,o()}}}function X(t){let e,l=t[74]<t[15]&&V(t);return{c(){l&&l.c(),e=J()},m(t,s){l&&l.m(t,s),a(t,e,s)},p(t,a){t[74]<t[15]?l?l.p(t,a):(l=V(t),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(t){l&&l.d(t),t&&q(e)}}}function Z(t){let e,l,s,i,n;return{c(){e=c("div"),l=c("m-tag"),L(l,"id","id-tag"),L(l,"label",s="("+t[19].length+") "+t[14]+" "),L(l,"size","s"),L(l,"type","link"),p(e,"class","tag-selected")},m(s,o){a(s,e,o),x(e,l),i||(n=w(l,"tag-selected",t[57]),i=!0)},p(t,e){540672&e[0]&&s!==(s="("+t[19].length+") "+t[14]+" ")&&L(l,"label",s)},d(t){t&&q(e),i=!1,n()}}}function tt(t){let e,l,s,i,n,o,r=t[26],d=[];for(let e=0;e<r.length;e+=1)d[e]=et(G(t,r,e));return{c(){e=c("div"),l=c("m-layer"),s=c("small"),i=c("div");for(let t=0;t<d.length;t+=1)d[t].c();p(i,"class","tags-selected"),p(s,"slot","content"),L(l,"title",t[13]),L(l,"layertitletag","h3"),L(l,"isopen",t[27])},m(r,c){a(r,e,c),x(e,l),x(l,s),x(s,i);for(let t=0;t<d.length;t+=1)d[t]&&d[t].m(i,null);n||(o=w(l,"layer-closed",t[59]),n=!0)},p(t,e){if(67108864&e[0]|512&e[1]){let l;for(r=t[26],l=0;l<r.length;l+=1){const a=G(t,r,l);d[l]?d[l].p(a,e):(d[l]=et(a),d[l].c(),d[l].m(i,null))}for(;l<d.length;l+=1)d[l].d(1);d.length=r.length}8192&e[0]&&L(l,"title",t[13]),134217728&e[0]&&L(l,"isopen",t[27])},d(t){t&&q(e),E(d,t),n=!1,o()}}}function et(t){let e,l,s,i,n,o,r;function m(){return t[58](t[70])}return{c(){e=c("div"),l=c("m-tag"),n=d(),L(l,"id",s=t[70].id),L(l,"label",i=t[70].label),L(l,"size","s"),L(l,"type","removable"),p(e,"class","tag-selected")},m(t,s){a(t,e,s),x(e,l),x(e,n),o||(r=w(l,"tag-removed",m),o=!0)},p(e,a){t=e,67108864&a[0]&&s!==(s=t[70].id)&&L(l,"id",s),67108864&a[0]&&i!==(i=t[70].label)&&L(l,"label",i)},d(t){t&&q(e),o=!1,r()}}}function lt(t){let e,l,s,i,C,N,O,T,E,J,L,M,R,Y,U,B,G,I,V,X,Z,et=t[9]&&t[19].length>0&&!t[16]&&K(t);function lt(e){t[50](e)}let at={classinput:"mc-autocomplete__trigger",name:t[6],placeholder:t[2],inputtype:"text",isinvalid:t[5],disabled:t[3],size:t[4],required:t[8],iconname:"navigation-display-search-24px",rightalign:!1,isvalid:!1,min:"",max:""};void 0!==t[28]&&(at.value=t[28]),i=new D({props:at}),n.push((()=>o(i,"value",lt))),i.$on("input",t[37]),i.$on("click",t[51]),i.$on("change",t[52]),i.$on("blur",t[53]);let st=t[7]&&W(),it=null!=t[28]&&""!=t[28]&&P(t);function nt(e){t[55](e)}let ot={items:JSON.stringify(t[29]),open:t[21],multiple:t[9],isfiltered:t[25],emptysearchlabel:t[10],maxwidth:t[0],datatextexpr:t[11],datavalueexpr:t[12],selectall:t[17],labelselectall:t[18]};void 0!==t[19]&&(ot.value=t[19]),J=new F({props:ot}),n.push((()=>o(J,"value",nt))),J.$on("change",t[34]),J.$on("scrollend",t[38]),J.$on("select-all",t[39]);let rt=t[9]&&t[16]&&Q(t),ct=t[9]&&t[16]&&tt(t),dt=[{class:"mc-autocomplete"},{style:I="--autocomplete-tag-width: "+t[24]+"; --autocomplete-width: "+t[0]+";"},t[22]],mt={};for(let t=0;t<dt.length;t+=1)mt=r(mt,dt[t]);return{c(){e=c("div"),l=c("div"),et&&et.c(),s=d(),m(i.$$.fragment),N=d(),O=c("div"),st&&st.c(),T=d(),it&&it.c(),E=d(),m(J.$$.fragment),M=d(),rt&&rt.c(),R=d(),Y=c("span"),U=d(),B=c("span"),G=d(),ct&&ct.c(),this.c=u,p(O,"class","mc-autocomplete__tools"),p(l,"class","mc-autocomplete__main"),p(Y,"class","mc-autocomplete__loader"),h(Y,"display","none"),p(B,"class","mc-text-input mc-autocomplete__trigger"),h(B,"display","none"),g(e,mt),$(e,"mc-autocomplete--multi",t[9])},m(n,o){a(n,e,o),x(e,l),et&&et.m(l,null),x(l,s),b(i,l,null),x(l,N),x(l,O),st&&st.m(O,null),x(O,T),it&&it.m(O,null),x(e,E),b(J,e,null),x(e,M),rt&&rt.m(e,null),x(e,R),x(e,Y),x(e,U),x(e,B),x(e,G),ct&&ct.m(e,null),V=!0,X||(Z=[f(A.call(null,e)),w(e,"outclick",t[33])],X=!0)},p(t,a){t[9]&&t[19].length>0&&!t[16]?et?(et.p(t,a),590336&a[0]&&v(et,1)):(et=K(t),et.c(),v(et,1),et.m(l,s)):et&&(H(),y(et,1,1,(()=>{et=null})),_());const n={};64&a[0]&&(n.name=t[6]),4&a[0]&&(n.placeholder=t[2]),32&a[0]&&(n.isinvalid=t[5]),8&a[0]&&(n.disabled=t[3]),16&a[0]&&(n.size=t[4]),256&a[0]&&(n.required=t[8]),!C&&268435456&a[0]&&(C=!0,n.value=t[28],k((()=>C=!1))),i.$set(n),t[7]?st?128&a[0]&&v(st,1):(st=W(),st.c(),v(st,1),st.m(O,T)):st&&(H(),y(st,1,1,(()=>{st=null})),_()),null!=t[28]&&""!=t[28]?it?it.p(t,a):(it=P(t),it.c(),it.m(O,null)):it&&(it.d(1),it=null);const o={};536870912&a[0]&&(o.items=JSON.stringify(t[29])),2097152&a[0]&&(o.open=t[21]),512&a[0]&&(o.multiple=t[9]),33554432&a[0]&&(o.isfiltered=t[25]),1024&a[0]&&(o.emptysearchlabel=t[10]),1&a[0]&&(o.maxwidth=t[0]),2048&a[0]&&(o.datatextexpr=t[11]),4096&a[0]&&(o.datavalueexpr=t[12]),131072&a[0]&&(o.selectall=t[17]),262144&a[0]&&(o.labelselectall=t[18]),!L&&524288&a[0]&&(L=!0,o.value=t[19],k((()=>L=!1))),J.$set(o),t[9]&&t[16]?rt?rt.p(t,a):(rt=Q(t),rt.c(),rt.m(e,R)):rt&&(rt.d(1),rt=null),t[9]&&t[16]?ct?ct.p(t,a):(ct=tt(t),ct.c(),ct.m(e,null)):ct&&(ct.d(1),ct=null),g(e,mt=z(dt,[{class:"mc-autocomplete"},(!V||16777217&a[0]&&I!==(I="--autocomplete-tag-width: "+t[24]+"; --autocomplete-width: "+t[0]+";"))&&{style:I},4194304&a[0]&&t[22]])),$(e,"mc-autocomplete--multi",t[9])},i(t){V||(v(et),v(i.$$.fragment,t),v(st),v(J.$$.fragment,t),V=!0)},o(t){y(et),y(i.$$.fragment,t),y(st),y(J.$$.fragment,t),V=!1},d(t){t&&q(e),et&&et.d(),j(i),st&&st.d(),it&&it.d(),j(J),rt&&rt.d(),ct&&ct.d(),X=!1,S(Z)}}}function at(t,e,l){let a,s,i,o,c,d,m;const u=["maxwidth","tagid","taglabel","placeholder","filter","disabled","size","isinvalid","inputvalue","id","loading","required","items","value","open","multiple","emptysearchlabel","datatextexpr","datavalueexpr","nosort","layertitle","showmoretagslabel","maxnumbertoshowtags","alltags","selectall","labelselectall"];let p=C(e,u),{maxwidth:h="100%"}=e,{tagid:g}=e,{taglabel:$=""}=e,{placeholder:x}=e,{filter:b=!0}=e,{disabled:f=!1}=e,{size:w="m"}=e,{isinvalid:v}=e,{inputvalue:y}=e,{id:_}=e,{loading:k=!1}=e,{required:z=!1}=e,{items:q}=e,{value:j}=e,{open:S=!1}=e,{multiple:T=!1}=e,{emptysearchlabel:E="No results found"}=e,{datatextexpr:J="label"}=e,{datavalueexpr:L="value"}=e,{nosort:H=!1}=e,{layertitle:A="Title layer"}=e,{showmoretagslabel:U="Show more"}=e,{maxnumbertoshowtags:B=12}=e,{alltags:D=!1}=e,{selectall:F=!1}=e,{labelselectall:G="Select all"}=e;const I=N(),K=Math.random();let W,P,Q,V=new Y,X="0px",Z=!1,tt=[],et=null;function lt(){l(19,o=T?[]:""),at(),V.dispatch("clear",!0)}function at(){l(21,d=!1),T&&!H?function(){Q=s;const t=st();Q.sort(((e,l)=>{const a=t.includes(e),s=t.includes(l);return a===s?e[L]-l[L]:a<s?1:-1})),l(29,i=Q)}():l(29,i=s)}function st(t){const e=t||o;return s.filter((t=>T?e.includes(t[L]):e===t[L]))}function it(){l(27,et=!0)}function nt(){l(27,et=null)}function ot(t){l(19,o=o.filter((e=>e!==t))),V.dispatch("onchange",o)}return t.$$set=t=>{e=r(r({},e),O(t)),l(69,p=C(e,u)),"maxwidth"in t&&l(0,h=t.maxwidth),"tagid"in t&&l(1,g=t.tagid),"taglabel"in t&&l(41,$=t.taglabel),"placeholder"in t&&l(2,x=t.placeholder),"filter"in t&&l(42,b=t.filter),"disabled"in t&&l(3,f=t.disabled),"size"in t&&l(4,w=t.size),"isinvalid"in t&&l(5,v=t.isinvalid),"inputvalue"in t&&l(43,y=t.inputvalue),"id"in t&&l(6,_=t.id),"loading"in t&&l(7,k=t.loading),"required"in t&&l(8,z=t.required),"items"in t&&l(44,q=t.items),"value"in t&&l(45,j=t.value),"open"in t&&l(46,S=t.open),"multiple"in t&&l(9,T=t.multiple),"emptysearchlabel"in t&&l(10,E=t.emptysearchlabel),"datatextexpr"in t&&l(11,J=t.datatextexpr),"datavalueexpr"in t&&l(12,L=t.datavalueexpr),"nosort"in t&&l(47,H=t.nosort),"layertitle"in t&&l(13,A=t.layertitle),"showmoretagslabel"in t&&l(14,U=t.showmoretagslabel),"maxnumbertoshowtags"in t&&l(15,B=t.maxnumbertoshowtags),"alltags"in t&&l(16,D=t.alltags),"selectall"in t&&l(17,F=t.selectall),"labelselectall"in t&&l(18,G=t.labelselectall)},t.$$.update=()=>{if(4096&t.$$.dirty[1]&&l(28,a=y),8192&t.$$.dirty[1]&&l(20,s=q?JSON.parse(q):[]),1048576&t.$$.dirty[0]&&l(29,i=s),512&t.$$.dirty[0]|16384&t.$$.dirty[1]&&l(19,o=!j&&T?[]:j?JSON.parse(j):j),524288&t.$$.dirty[0]|1024&t.$$.dirty[1]&&l(30,c=()=>o.length.toString()+" "+$),524288&t.$$.dirty[0]&&async function(t){if(await M(),l(26,tt=st(t)),T)l(48,P=t);else{const t=tt.map((t=>t[J]));l(28,a=t.join(", "))}}(o),131072&t.$$.dirty[1]&&async function(t){await M(),l(24,X=W&&t&&t.length?`${I.shadowRoot.querySelector(".mc-tag-removable").clientWidth}px`:"0px")}(P),32768&t.$$.dirty[1]&&l(21,d=S),2097152&t.$$.dirty[0]){const t=d?"open":"close";V.dispatch(t,d)}l(22,m=Object.assign({},p)),4194304&t.$$.dirty[0]&&delete m.class},[h,g,x,f,w,v,_,k,z,T,E,J,L,A,U,B,D,F,G,o,s,d,m,W,X,Z,tt,et,a,i,c,K,lt,at,function(){V.dispatch("onchange",o),T||at()},it,nt,function(t){const e=t.target.value;!function(t){V.dispatch("oninput",t)}(e),function(t){b&&(t.length?l(29,i=s.filter((e=>e[J].toUpperCase().includes(t.toUpperCase())))):l(29,i=s),l(25,Z=!i.length),V.dispatch("onfilter",i))}(e)},function(){V.dispatch("scrollend",!0)},function(t){V.dispatch("select-all",t.detail)},ot,$,b,y,q,j,S,H,P,function(t){n[t?"unshift":"push"]((()=>{W=t,l(23,W)}))},function(t){a=t,l(28,a),l(43,y)},()=>l(21,d=!0),function(e){R.call(this,t,e)},function(e){R.call(this,t,e)},()=>{l(28,a=""),l(29,i=s),l(25,Z=!1),T||lt()},function(t){o=t,l(19,o),l(45,j),l(9,T)},t=>ot(t.id),()=>it(),t=>ot(t.id),()=>nt()]}class st extends t{constructor(t){super();const n=document.createElement("style");n.textContent=".mc-autocomplete{-ms-flex-item-align:start;align-self:start;position:relative;min-width:18rem;max-width:var(--autocomplete-width, auto);width:100%}.mc-autocomplete__main{position:relative}.mc-autocomplete__tag,.mc-autocomplete__tools{position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);z-index:2}.mc-autocomplete__tag{left:2.75rem}.mc-autocomplete__trigger{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.mc-autocomplete__tools{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#ffffff;display:-webkit-box;display:-ms-flexbox;display:flex;gap:0.5rem;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;right:0.75rem}.mc-autocomplete__clear{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;-webkit-transition:-webkit-box-shadow 150ms ease;transition:-webkit-box-shadow 150ms ease;-o-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease;transition:box-shadow 150ms ease, -webkit-box-shadow 150ms ease;background:none;border-radius:50%}.mc-autocomplete__clear:focus{-webkit-box-shadow:0 0 0 2px #0b96cc;box-shadow:0 0 0 2px #0b96cc}.mc-autocomplete__clear,.mc-autocomplete__clear-icon{height:1.5rem;width:1.5rem}.mc-autocomplete__clear-icon{fill:#666666}.mc-autocomplete__clear-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.mc-autocomplete__error{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-autocomplete--multi .mc-autocomplete__trigger{padding-left:calc(2.9375rem + var(--autocomplete-tag-width, 0px))}.mc-autocomplete__tag{position:absolute !important}.mc-autocomplete--multi .mc-autocomplete__trigger{padding-left:calc(2.9375rem + var(--autocomplete-tag-width)) !important}.tags-selected{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.tag-selected{margin-top:1em;margin-left:5px;margin-right:5px}",this.shadowRoot.appendChild(n),e(this,{target:this.shadowRoot,props:l(this.attributes),customElement:!0},at,lt,i,{maxwidth:0,tagid:1,taglabel:41,placeholder:2,filter:42,disabled:3,size:4,isinvalid:5,inputvalue:43,id:6,loading:7,required:8,items:44,value:45,open:46,multiple:9,emptysearchlabel:10,datatextexpr:11,datavalueexpr:12,nosort:47,layertitle:13,showmoretagslabel:14,maxnumbertoshowtags:15,alltags:16,selectall:17,labelselectall:18},null,[-1,-1,-1]),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),s()))}static get observedAttributes(){return["maxwidth","tagid","taglabel","placeholder","filter","disabled","size","isinvalid","inputvalue","id","loading","required","items","value","open","multiple","emptysearchlabel","datatextexpr","datavalueexpr","nosort","layertitle","showmoretagslabel","maxnumbertoshowtags","alltags","selectall","labelselectall"]}get maxwidth(){return this.$$.ctx[0]}set maxwidth(t){this.$$set({maxwidth:t}),s()}get tagid(){return this.$$.ctx[1]}set tagid(t){this.$$set({tagid:t}),s()}get taglabel(){return this.$$.ctx[41]}set taglabel(t){this.$$set({taglabel:t}),s()}get placeholder(){return this.$$.ctx[2]}set placeholder(t){this.$$set({placeholder:t}),s()}get filter(){return this.$$.ctx[42]}set filter(t){this.$$set({filter:t}),s()}get disabled(){return this.$$.ctx[3]}set disabled(t){this.$$set({disabled:t}),s()}get size(){return this.$$.ctx[4]}set size(t){this.$$set({size:t}),s()}get isinvalid(){return this.$$.ctx[5]}set isinvalid(t){this.$$set({isinvalid:t}),s()}get inputvalue(){return this.$$.ctx[43]}set inputvalue(t){this.$$set({inputvalue:t}),s()}get id(){return this.$$.ctx[6]}set id(t){this.$$set({id:t}),s()}get loading(){return this.$$.ctx[7]}set loading(t){this.$$set({loading:t}),s()}get required(){return this.$$.ctx[8]}set required(t){this.$$set({required:t}),s()}get items(){return this.$$.ctx[44]}set items(t){this.$$set({items:t}),s()}get value(){return this.$$.ctx[45]}set value(t){this.$$set({value:t}),s()}get open(){return this.$$.ctx[46]}set open(t){this.$$set({open:t}),s()}get multiple(){return this.$$.ctx[9]}set multiple(t){this.$$set({multiple:t}),s()}get emptysearchlabel(){return this.$$.ctx[10]}set emptysearchlabel(t){this.$$set({emptysearchlabel:t}),s()}get datatextexpr(){return this.$$.ctx[11]}set datatextexpr(t){this.$$set({datatextexpr:t}),s()}get datavalueexpr(){return this.$$.ctx[12]}set datavalueexpr(t){this.$$set({datavalueexpr:t}),s()}get nosort(){return this.$$.ctx[47]}set nosort(t){this.$$set({nosort:t}),s()}get layertitle(){return this.$$.ctx[13]}set layertitle(t){this.$$set({layertitle:t}),s()}get showmoretagslabel(){return this.$$.ctx[14]}set showmoretagslabel(t){this.$$set({showmoretagslabel:t}),s()}get maxnumbertoshowtags(){return this.$$.ctx[15]}set maxnumbertoshowtags(t){this.$$set({maxnumbertoshowtags:t}),s()}get alltags(){return this.$$.ctx[16]}set alltags(t){this.$$set({alltags:t}),s()}get selectall(){return this.$$.ctx[17]}set selectall(t){this.$$set({selectall:t}),s()}get labelselectall(){return this.$$.ctx[18]}set labelselectall(t){this.$$set({labelselectall:t}),s()}}export{st as default};
1
+ import{S as t,i as e,a as l,b as a,f as i,s,v as n,w as o,c as r,e as c,d,x as u,n as m,g as p,y as h,h as g,z as $,j as x,A as b,B as f,l as w,C as v,D as y,E as _,F as k,m as z,o as q,G as j,H as S,p as C,r as N,q as O,I as T,J as E,K as J,L,M as H,N as M,O as R}from"../../index-c33b3772.js";import{E as Y}from"../../EventHandler-02058705.js";import{c as A}from"../../ClickOutside-63071e7a.js";import U from"../tag/Tag.nested.js";import B from"../loader/Loader.nested.js";import D from"../textinput/Textinput.nested.js";import F from"../listbox/Listbox.nested.js";function G(t,e,l){const a=t.slice();return a[70]=e[l],a}function I(t,e,l){const a=t.slice();return a[70]=e[l],a[74]=l,a}function K(t){let e,l,a={id:t[1]?t[1]:`autocompleteTag-${t[31]}`,class:"mc-autocomplete__tag",label:t[30](),size:"s",type:"removable",dark:!1,disabled:!1,href:"",name:"",value:"",selected:!1};return e=new U({props:a}),t[49](e),e.$on("tag-removed",t[32]),{c(){u(e.$$.fragment)},m(t,a){b(e,t,a),l=!0},p(t,l){const a={};2&l[0]&&(a.id=t[1]?t[1]:`autocompleteTag-${t[31]}`),1073741824&l[0]&&(a.label=t[30]()),e.$set(a)},i(t){l||(v(e.$$.fragment,t),l=!0)},o(t){y(e.$$.fragment,t),l=!1},d(l){t[49](null),j(e,l)}}}function W(t){let e,l;return e=new B({props:{size:"s",theme:"primary",text:"",class:"mc-autocomplete__loader"}}),{c(){u(e.$$.fragment)},m(t,a){b(e,t,a),l=!0},i(t){l||(v(e.$$.fragment,t),l=!0)},o(t){y(e.$$.fragment,t),l=!1},d(t){j(e,t)}}}function P(t){let e,l,i;return{c(){e=c("button"),e.innerHTML='<navigation-control-tag--cross-24px></navigation-control-tag--cross-24px> \n <span class="mc-autocomplete__clear-text">Clear</span>',p(e,"class","mc-autocomplete__clear"),p(e,"type","button")},m(s,n){a(s,e,n),l||(i=w(e,"click",T(t[54])),l=!0)},p:m,d(t){t&&q(e),l=!1,i()}}}function Q(t){let e,l,i=t[26],s=[];for(let e=0;e<i.length;e+=1)s[e]=tt(I(t,i,e));let n=t[19].length>t[15]&&et(t);return{c(){e=c("div");for(let t=0;t<s.length;t+=1)s[t].c();l=d(),n&&n.c(),p(e,"class","tags-selected")},m(t,i){a(t,e,i);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(e,null);x(e,l),n&&n.m(e,null)},p(t,a){if(67141640&a[0]|512&a[1]){let n;for(i=t[26],n=0;n<i.length;n+=1){const o=I(t,i,n);s[n]?s[n].p(o,a):(s[n]=tt(o),s[n].c(),s[n].m(e,l))}for(;n<s.length;n+=1)s[n].d(1);s.length=i.length}t[19].length>t[15]?n?n.p(t,a):(n=et(t),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(t){t&&q(e),E(s,t),n&&n.d()}}}function V(t){let e;function l(t,e){return t[3]?Z:X}let i=l(t),s=i(t);return{c(){e=c("div"),s.c(),p(e,"class","tag-selected")},m(t,l){a(t,e,l),s.m(e,null)},p(t,a){i===(i=l(t))&&s?s.p(t,a):(s.d(1),s=i(t),s&&(s.c(),s.m(e,null)))},d(t){t&&q(e),s.d()}}}function X(t){let e,l,i,s,n;function o(){return t[56](t[70])}return{c(){e=c("m-tag"),L(e,"id",l=t[70].id),L(e,"label",i=t[70].label),L(e,"size","s"),L(e,"type","removable")},m(t,l){a(t,e,l),s||(n=w(e,"tag-removed",o),s=!0)},p(a,s){t=a,67108864&s[0]&&l!==(l=t[70].id)&&L(e,"id",l),67108864&s[0]&&i!==(i=t[70].label)&&L(e,"label",i)},d(t){t&&q(e),s=!1,n()}}}function Z(t){let e,l,i;return{c(){e=c("m-tag"),L(e,"type","link"),L(e,"id",l=t[70].id),L(e,"label",i=t[70].label),L(e,"size","s"),L(e,"dark",!0)},m(t,l){a(t,e,l)},p(t,a){67108864&a[0]&&l!==(l=t[70].id)&&L(e,"id",l),67108864&a[0]&&i!==(i=t[70].label)&&L(e,"label",i)},d(t){t&&q(e)}}}function tt(t){let e,l=t[74]<t[15]&&V(t);return{c(){l&&l.c(),e=J()},m(t,i){l&&l.m(t,i),a(t,e,i)},p(t,a){t[74]<t[15]?l?l.p(t,a):(l=V(t),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(t){l&&l.d(t),t&&q(e)}}}function et(t){let e,l,i,s,n;return{c(){e=c("div"),l=c("m-tag"),L(l,"id","id-tag"),L(l,"label",i="("+t[19].length+") "+t[14]+" "),L(l,"size","s"),L(l,"type","link"),p(e,"class","tag-selected")},m(i,o){a(i,e,o),x(e,l),s||(n=w(l,"tag-selected",t[57]),s=!0)},p(t,e){540672&e[0]&&i!==(i="("+t[19].length+") "+t[14]+" ")&&L(l,"label",i)},d(t){t&&q(e),s=!1,n()}}}function lt(t){let e,l,i,s,n,o,r=t[26],d=[];for(let e=0;e<r.length;e+=1)d[e]=st(G(t,r,e));return{c(){e=c("div"),l=c("m-layer"),i=c("small"),s=c("div");for(let t=0;t<d.length;t+=1)d[t].c();p(s,"class","tags-selected"),p(i,"slot","content"),L(l,"title",t[13]),L(l,"layertitletag","h3"),L(l,"isopen",t[27])},m(r,c){a(r,e,c),x(e,l),x(l,i),x(i,s);for(let t=0;t<d.length;t+=1)d[t]&&d[t].m(s,null);n||(o=w(l,"layer-closed",t[59]),n=!0)},p(t,e){if(67108872&e[0]|512&e[1]){let l;for(r=t[26],l=0;l<r.length;l+=1){const a=G(t,r,l);d[l]?d[l].p(a,e):(d[l]=st(a),d[l].c(),d[l].m(s,null))}for(;l<d.length;l+=1)d[l].d(1);d.length=r.length}8192&e[0]&&L(l,"title",t[13]),134217728&e[0]&&L(l,"isopen",t[27])},d(t){t&&q(e),E(d,t),n=!1,o()}}}function at(t){let e,l,i,s,n;function o(){return t[58](t[70])}return{c(){e=c("m-tag"),L(e,"id",l=t[70].id),L(e,"label",i=t[70].label),L(e,"size","s"),L(e,"type","removable")},m(t,l){a(t,e,l),s||(n=w(e,"tag-removed",o),s=!0)},p(a,s){t=a,67108864&s[0]&&l!==(l=t[70].id)&&L(e,"id",l),67108864&s[0]&&i!==(i=t[70].label)&&L(e,"label",i)},d(t){t&&q(e),s=!1,n()}}}function it(t){let e,l,i;return{c(){e=c("m-tag"),L(e,"type","text"),L(e,"id",l=t[70].id),L(e,"label",i=t[70].label),L(e,"size","s")},m(t,l){a(t,e,l)},p(t,a){67108864&a[0]&&l!==(l=t[70].id)&&L(e,"id",l),67108864&a[0]&&i!==(i=t[70].label)&&L(e,"label",i)},d(t){t&&q(e)}}}function st(t){let e,l;function i(t,e){return t[3]?it:at}let s=i(t),n=s(t);return{c(){e=c("div"),n.c(),l=d(),p(e,"class","tag-selected")},m(t,i){a(t,e,i),n.m(e,null),x(e,l)},p(t,a){s===(s=i(t))&&n?n.p(t,a):(n.d(1),n=s(t),n&&(n.c(),n.m(e,l)))},d(t){t&&q(e),n.d()}}}function nt(t){let e,l,i,s,C,N,O,T,E,J,L,M,R,Y,U,B,G,I,V,X,Z,tt=t[9]&&t[19].length>0&&!t[16]&&K(t);function et(e){t[50](e)}let at={classinput:"mc-autocomplete__trigger",name:t[6],placeholder:t[2],inputtype:"text",isinvalid:t[5],disabled:t[3],size:t[4],required:t[8],iconname:"navigation-display-search-24px",rightalign:!1,isvalid:!1,min:"",max:""};void 0!==t[28]&&(at.value=t[28]),s=new D({props:at}),n.push((()=>o(s,"value",et))),s.$on("input",t[37]),s.$on("click",t[51]),s.$on("change",t[52]),s.$on("blur",t[53]);let it=t[7]&&W(),st=null!=t[28]&&""!=t[28]&&!t[3]&&P(t);function nt(e){t[55](e)}let ot={items:JSON.stringify(t[29]),open:t[21],multiple:t[9],isfiltered:t[25],emptysearchlabel:t[10],maxwidth:t[0],datatextexpr:t[11],datavalueexpr:t[12],selectall:t[17],labelselectall:t[18]};void 0!==t[19]&&(ot.value=t[19]),J=new F({props:ot}),n.push((()=>o(J,"value",nt))),J.$on("change",t[34]),J.$on("scrollend",t[38]),J.$on("select-all",t[39]);let rt=t[9]&&t[16]&&Q(t),ct=t[9]&&t[16]&&lt(t),dt=[{class:"mc-autocomplete"},{style:I="--autocomplete-tag-width: "+t[24]+"; --autocomplete-width: "+t[0]+";"},t[22]],ut={};for(let t=0;t<dt.length;t+=1)ut=r(ut,dt[t]);return{c(){e=c("div"),l=c("div"),tt&&tt.c(),i=d(),u(s.$$.fragment),N=d(),O=c("div"),it&&it.c(),T=d(),st&&st.c(),E=d(),u(J.$$.fragment),M=d(),rt&&rt.c(),R=d(),Y=c("span"),U=d(),B=c("span"),G=d(),ct&&ct.c(),this.c=m,p(O,"class","mc-autocomplete__tools"),p(l,"class","mc-autocomplete__main"),p(Y,"class","mc-autocomplete__loader"),h(Y,"display","none"),p(B,"class","mc-text-input mc-autocomplete__trigger"),h(B,"display","none"),g(e,ut),$(e,"mc-autocomplete--multi",t[9])},m(n,o){a(n,e,o),x(e,l),tt&&tt.m(l,null),x(l,i),b(s,l,null),x(l,N),x(l,O),it&&it.m(O,null),x(O,T),st&&st.m(O,null),x(e,E),b(J,e,null),x(e,M),rt&&rt.m(e,null),x(e,R),x(e,Y),x(e,U),x(e,B),x(e,G),ct&&ct.m(e,null),V=!0,X||(Z=[f(A.call(null,e)),w(e,"outclick",t[33])],X=!0)},p(t,a){t[9]&&t[19].length>0&&!t[16]?tt?(tt.p(t,a),590336&a[0]&&v(tt,1)):(tt=K(t),tt.c(),v(tt,1),tt.m(l,i)):tt&&(H(),y(tt,1,1,(()=>{tt=null})),_());const n={};64&a[0]&&(n.name=t[6]),4&a[0]&&(n.placeholder=t[2]),32&a[0]&&(n.isinvalid=t[5]),8&a[0]&&(n.disabled=t[3]),16&a[0]&&(n.size=t[4]),256&a[0]&&(n.required=t[8]),!C&&268435456&a[0]&&(C=!0,n.value=t[28],k((()=>C=!1))),s.$set(n),t[7]?it?128&a[0]&&v(it,1):(it=W(),it.c(),v(it,1),it.m(O,T)):it&&(H(),y(it,1,1,(()=>{it=null})),_()),null==t[28]||""==t[28]||t[3]?st&&(st.d(1),st=null):st?st.p(t,a):(st=P(t),st.c(),st.m(O,null));const o={};536870912&a[0]&&(o.items=JSON.stringify(t[29])),2097152&a[0]&&(o.open=t[21]),512&a[0]&&(o.multiple=t[9]),33554432&a[0]&&(o.isfiltered=t[25]),1024&a[0]&&(o.emptysearchlabel=t[10]),1&a[0]&&(o.maxwidth=t[0]),2048&a[0]&&(o.datatextexpr=t[11]),4096&a[0]&&(o.datavalueexpr=t[12]),131072&a[0]&&(o.selectall=t[17]),262144&a[0]&&(o.labelselectall=t[18]),!L&&524288&a[0]&&(L=!0,o.value=t[19],k((()=>L=!1))),J.$set(o),t[9]&&t[16]?rt?rt.p(t,a):(rt=Q(t),rt.c(),rt.m(e,R)):rt&&(rt.d(1),rt=null),t[9]&&t[16]?ct?ct.p(t,a):(ct=lt(t),ct.c(),ct.m(e,null)):ct&&(ct.d(1),ct=null),g(e,ut=z(dt,[{class:"mc-autocomplete"},(!V||16777217&a[0]&&I!==(I="--autocomplete-tag-width: "+t[24]+"; --autocomplete-width: "+t[0]+";"))&&{style:I},4194304&a[0]&&t[22]])),$(e,"mc-autocomplete--multi",t[9])},i(t){V||(v(tt),v(s.$$.fragment,t),v(it),v(J.$$.fragment,t),V=!0)},o(t){y(tt),y(s.$$.fragment,t),y(it),y(J.$$.fragment,t),V=!1},d(t){t&&q(e),tt&&tt.d(),j(s),it&&it.d(),st&&st.d(),j(J),rt&&rt.d(),ct&&ct.d(),X=!1,S(Z)}}}function ot(t,e,l){let a,i,s,o,c,d,u;const m=["maxwidth","tagid","taglabel","placeholder","filter","disabled","size","isinvalid","inputvalue","id","loading","required","items","value","open","multiple","emptysearchlabel","datatextexpr","datavalueexpr","nosort","layertitle","showmoretagslabel","maxnumbertoshowtags","alltags","selectall","labelselectall"];let p=C(e,m),{maxwidth:h="100%"}=e,{tagid:g}=e,{taglabel:$=""}=e,{placeholder:x}=e,{filter:b=!0}=e,{disabled:f=!1}=e,{size:w="m"}=e,{isinvalid:v}=e,{inputvalue:y}=e,{id:_}=e,{loading:k=!1}=e,{required:z=!1}=e,{items:q}=e,{value:j}=e,{open:S=!1}=e,{multiple:T=!1}=e,{emptysearchlabel:E="No results found"}=e,{datatextexpr:J="label"}=e,{datavalueexpr:L="value"}=e,{nosort:H=!1}=e,{layertitle:A="Title layer"}=e,{showmoretagslabel:U="Show more"}=e,{maxnumbertoshowtags:B=12}=e,{alltags:D=!1}=e,{selectall:F=!1}=e,{labelselectall:G="Select all"}=e;const I=N(),K=Math.random();let W,P,Q,V=new Y,X="0px",Z=!1,tt=[],et=null;function lt(){l(19,o=T?[]:""),at(),V.dispatch("clear",!0)}function at(){l(21,d=!1),T&&!H?function(){Q=i;const t=it();Q.sort(((e,l)=>{const a=t.includes(e),i=t.includes(l);return a===i?e[L]-l[L]:a<i?1:-1})),l(29,s=Q)}():l(29,s=i)}function it(t){const e=t||o;return i.filter((t=>T?e.includes(t[L]):e===t[L]))}function st(){l(27,et=!0)}function nt(){l(27,et=null)}function ot(t){l(19,o=o.filter((e=>e!==t))),V.dispatch("onchange",o)}return t.$$set=t=>{e=r(r({},e),O(t)),l(69,p=C(e,m)),"maxwidth"in t&&l(0,h=t.maxwidth),"tagid"in t&&l(1,g=t.tagid),"taglabel"in t&&l(41,$=t.taglabel),"placeholder"in t&&l(2,x=t.placeholder),"filter"in t&&l(42,b=t.filter),"disabled"in t&&l(3,f=t.disabled),"size"in t&&l(4,w=t.size),"isinvalid"in t&&l(5,v=t.isinvalid),"inputvalue"in t&&l(43,y=t.inputvalue),"id"in t&&l(6,_=t.id),"loading"in t&&l(7,k=t.loading),"required"in t&&l(8,z=t.required),"items"in t&&l(44,q=t.items),"value"in t&&l(45,j=t.value),"open"in t&&l(46,S=t.open),"multiple"in t&&l(9,T=t.multiple),"emptysearchlabel"in t&&l(10,E=t.emptysearchlabel),"datatextexpr"in t&&l(11,J=t.datatextexpr),"datavalueexpr"in t&&l(12,L=t.datavalueexpr),"nosort"in t&&l(47,H=t.nosort),"layertitle"in t&&l(13,A=t.layertitle),"showmoretagslabel"in t&&l(14,U=t.showmoretagslabel),"maxnumbertoshowtags"in t&&l(15,B=t.maxnumbertoshowtags),"alltags"in t&&l(16,D=t.alltags),"selectall"in t&&l(17,F=t.selectall),"labelselectall"in t&&l(18,G=t.labelselectall)},t.$$.update=()=>{if(4096&t.$$.dirty[1]&&l(28,a=y),8192&t.$$.dirty[1]&&l(20,i=q?JSON.parse(q):[]),1048576&t.$$.dirty[0]&&l(29,s=i),512&t.$$.dirty[0]|16384&t.$$.dirty[1]&&l(19,o=!j&&T?[]:j?JSON.parse(j):j),524288&t.$$.dirty[0]|1024&t.$$.dirty[1]&&l(30,c=()=>o.length.toString()+" "+$),524288&t.$$.dirty[0]&&async function(t){if(await M(),l(26,tt=it(t)),T)l(48,P=t);else{const t=tt.map((t=>t[J]));l(28,a=t.join(", "))}}(o),131072&t.$$.dirty[1]&&async function(t){await M(),l(24,X=W&&t&&t.length?`${I.shadowRoot.querySelector(".mc-tag-removable").clientWidth}px`:"0px")}(P),32768&t.$$.dirty[1]&&l(21,d=S),2097152&t.$$.dirty[0]){const t=d?"open":"close";V.dispatch(t,d)}l(22,u=Object.assign({},p)),4194304&t.$$.dirty[0]&&delete u.class},[h,g,x,f,w,v,_,k,z,T,E,J,L,A,U,B,D,F,G,o,i,d,u,W,X,Z,tt,et,a,s,c,K,lt,at,function(){V.dispatch("onchange",o),T||at()},st,nt,function(t){const e=t.target.value;!function(t){V.dispatch("oninput",t)}(e),function(t){b&&(t.length?l(29,s=i.filter((e=>e[J].toUpperCase().includes(t.toUpperCase())))):l(29,s=i),l(25,Z=!s.length),V.dispatch("onfilter",s))}(e)},function(){V.dispatch("scrollend",!0)},function(t){V.dispatch("select-all",t.detail)},ot,$,b,y,q,j,S,H,P,function(t){n[t?"unshift":"push"]((()=>{W=t,l(23,W)}))},function(t){a=t,l(28,a),l(43,y)},()=>l(21,d=!0),function(e){R.call(this,t,e)},function(e){R.call(this,t,e)},()=>{l(28,a=""),l(29,s=i),l(25,Z=!1),T||lt()},function(t){o=t,l(19,o),l(45,j),l(9,T)},t=>ot(t.id),()=>st(),t=>ot(t.id),()=>nt()]}class rt extends t{constructor(t){super();const n=document.createElement("style");n.textContent=".mc-autocomplete{-ms-flex-item-align:start;align-self:start;position:relative;min-width:18rem;max-width:var(--autocomplete-width, auto);width:100%}.mc-autocomplete__main{position:relative}.mc-autocomplete__tag,.mc-autocomplete__tools{position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);z-index:2}.mc-autocomplete__tag{left:2.75rem}.mc-autocomplete__trigger{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.mc-autocomplete__tools{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#ffffff;display:-webkit-box;display:-ms-flexbox;display:flex;gap:0.5rem;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;right:0.75rem}.mc-autocomplete__clear{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;-webkit-transition:-webkit-box-shadow 150ms ease;transition:-webkit-box-shadow 150ms ease;-o-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease;transition:box-shadow 150ms ease, -webkit-box-shadow 150ms ease;background:none;border-radius:50%}.mc-autocomplete__clear:focus{-webkit-box-shadow:0 0 0 2px #0b96cc;box-shadow:0 0 0 2px #0b96cc}.mc-autocomplete__clear,.mc-autocomplete__clear-icon{height:1.5rem;width:1.5rem}.mc-autocomplete__clear-icon{fill:#666666}.mc-autocomplete__clear-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.mc-autocomplete__error{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-autocomplete--multi .mc-autocomplete__trigger{padding-left:calc(2.9375rem + var(--autocomplete-tag-width, 0px))}.mc-autocomplete__tag{position:absolute !important}.mc-autocomplete--multi .mc-autocomplete__trigger{padding-left:calc(2.9375rem + var(--autocomplete-tag-width)) !important}.tags-selected{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.tag-selected{margin-top:1em;margin-left:5px;margin-right:5px}",this.shadowRoot.appendChild(n),e(this,{target:this.shadowRoot,props:l(this.attributes),customElement:!0},ot,nt,s,{maxwidth:0,tagid:1,taglabel:41,placeholder:2,filter:42,disabled:3,size:4,isinvalid:5,inputvalue:43,id:6,loading:7,required:8,items:44,value:45,open:46,multiple:9,emptysearchlabel:10,datatextexpr:11,datavalueexpr:12,nosort:47,layertitle:13,showmoretagslabel:14,maxnumbertoshowtags:15,alltags:16,selectall:17,labelselectall:18},null,[-1,-1,-1]),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),i()))}static get observedAttributes(){return["maxwidth","tagid","taglabel","placeholder","filter","disabled","size","isinvalid","inputvalue","id","loading","required","items","value","open","multiple","emptysearchlabel","datatextexpr","datavalueexpr","nosort","layertitle","showmoretagslabel","maxnumbertoshowtags","alltags","selectall","labelselectall"]}get maxwidth(){return this.$$.ctx[0]}set maxwidth(t){this.$$set({maxwidth:t}),i()}get tagid(){return this.$$.ctx[1]}set tagid(t){this.$$set({tagid:t}),i()}get taglabel(){return this.$$.ctx[41]}set taglabel(t){this.$$set({taglabel:t}),i()}get placeholder(){return this.$$.ctx[2]}set placeholder(t){this.$$set({placeholder:t}),i()}get filter(){return this.$$.ctx[42]}set filter(t){this.$$set({filter:t}),i()}get disabled(){return this.$$.ctx[3]}set disabled(t){this.$$set({disabled:t}),i()}get size(){return this.$$.ctx[4]}set size(t){this.$$set({size:t}),i()}get isinvalid(){return this.$$.ctx[5]}set isinvalid(t){this.$$set({isinvalid:t}),i()}get inputvalue(){return this.$$.ctx[43]}set inputvalue(t){this.$$set({inputvalue:t}),i()}get id(){return this.$$.ctx[6]}set id(t){this.$$set({id:t}),i()}get loading(){return this.$$.ctx[7]}set loading(t){this.$$set({loading:t}),i()}get required(){return this.$$.ctx[8]}set required(t){this.$$set({required:t}),i()}get items(){return this.$$.ctx[44]}set items(t){this.$$set({items:t}),i()}get value(){return this.$$.ctx[45]}set value(t){this.$$set({value:t}),i()}get open(){return this.$$.ctx[46]}set open(t){this.$$set({open:t}),i()}get multiple(){return this.$$.ctx[9]}set multiple(t){this.$$set({multiple:t}),i()}get emptysearchlabel(){return this.$$.ctx[10]}set emptysearchlabel(t){this.$$set({emptysearchlabel:t}),i()}get datatextexpr(){return this.$$.ctx[11]}set datatextexpr(t){this.$$set({datatextexpr:t}),i()}get datavalueexpr(){return this.$$.ctx[12]}set datavalueexpr(t){this.$$set({datavalueexpr:t}),i()}get nosort(){return this.$$.ctx[47]}set nosort(t){this.$$set({nosort:t}),i()}get layertitle(){return this.$$.ctx[13]}set layertitle(t){this.$$set({layertitle:t}),i()}get showmoretagslabel(){return this.$$.ctx[14]}set showmoretagslabel(t){this.$$set({showmoretagslabel:t}),i()}get maxnumbertoshowtags(){return this.$$.ctx[15]}set maxnumbertoshowtags(t){this.$$set({maxnumbertoshowtags:t}),i()}get alltags(){return this.$$.ctx[16]}set alltags(t){this.$$set({alltags:t}),i()}get selectall(){return this.$$.ctx[17]}set selectall(t){this.$$set({selectall:t}),i()}get labelselectall(){return this.$$.ctx[18]}set labelselectall(t){this.$$set({labelselectall:t}),i()}}export{rt as default};
2
2
  //# sourceMappingURL=Autocomplete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.js","sources":["../../../../src/components/autocomplete/Autocomplete.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { tick } from 'svelte';\n import { get_current_component } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n import { clickOutside } from '../../utilities/ClickOutside';\n import type { ListboxItems } from '../listbox/listbox.types';\n import type { TextInputSize } from '../textinput/textinput.types';\n\n import Tag from '../tag/Tag.nested.svelte';\n import Loader from '../loader/Loader.nested.svelte';\n import TextInput from '../textinput/Textinput.nested.svelte';\n import Listbox from '../listbox/Listbox.nested.svelte';\n\n export let maxwidth = '100%';\n export let tagid: string;\n export let taglabel = '';\n export let placeholder: string;\n export let filter = true;\n export let disabled = false;\n export let size: TextInputSize = 'm';\n export let isinvalid: boolean;\n export let inputvalue: string;\n export let id: string;\n export let loading = false;\n export let required = false;\n export let items: string;\n export let value: any;\n export let open = false;\n export let multiple = false;\n export let emptysearchlabel = 'No results found';\n export let datatextexpr = 'label';\n export let datavalueexpr = 'value';\n export let nosort = false;\n export let layertitle = 'Title layer';\n export let showmoretagslabel = 'Show more';\n export let maxnumbertoshowtags = 12;\n export let alltags = false;\n export let selectall = false;\n export let labelselectall = 'Select all';\n\n const component: any = get_current_component();\n const uuid = Math.random();\n let eventHandler = new EventHandler();\n let tag: any;\n let tagWidth = '0px';\n let tagValue: any;\n let sortedListItems: any;\n let isfiltered = false;\n let selectedItems: ListboxItems[] = [];\n let openLayer: any = null;\n\n $: localInputValue = inputvalue;\n $: parsedItems = items ? (JSON.parse(items) as ListboxItems[]) : [];\n $: localItems = parsedItems;\n $: listboxValue = !value && multiple ? [] : value ? JSON.parse(value) : value;\n $: setTagLabel = () => {\n return listboxValue.length.toString() + ' ' + taglabel;\n };\n $: watchListboxValue(listboxValue);\n $: setTagWidth(tagValue);\n $: openState = open;\n $: {\n const eventName = openState ? 'open' : 'close';\n eventHandler.dispatch(eventName, openState);\n }\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n function clearListbox() {\n listboxValue = multiple ? [] : '';\n closeListBox();\n eventHandler.dispatch('clear', true);\n }\n\n function closeListBox() {\n openState = false;\n\n if (multiple && !nosort) {\n sortItems();\n } else {\n localItems = parsedItems;\n }\n }\n\n function onChange() {\n eventHandler.dispatch('onchange', listboxValue);\n\n if (!multiple) {\n closeListBox();\n }\n }\n\n function getSelectedItems(val?: string) {\n const value = val ? val : listboxValue;\n\n const selectedItems = parsedItems.filter((item: ListboxItems) => {\n return multiple\n ? value.includes(item[datavalueexpr])\n : value === item[datavalueexpr];\n });\n return selectedItems;\n }\n\n function sortItems() {\n sortedListItems = parsedItems;\n const selectedItems = getSelectedItems();\n\n sortedListItems.sort((a: any, b: any) => {\n const hasItemA = selectedItems.includes(a);\n const hasItemB = selectedItems.includes(b);\n\n if (hasItemA === hasItemB) {\n return a[datavalueexpr] - b[datavalueexpr];\n } else if (hasItemA < hasItemB) {\n return 1;\n } else {\n return -1;\n }\n });\n\n localItems = sortedListItems;\n }\n\n function openLayerFn() {\n openLayer = true;\n }\n\n function closeLayerFn() {\n openLayer = null;\n }\n\n function handleInputValue(value: any) {\n eventHandler.dispatch('oninput', value);\n }\n\n function filterListbox(value: any) {\n if (!filter) {\n return;\n }\n\n if (value.length) {\n localItems = parsedItems.filter((item: any) =>\n item[datatextexpr].toUpperCase().includes(value.toUpperCase()),\n );\n } else {\n localItems = parsedItems;\n }\n\n isfiltered = !localItems.length;\n\n eventHandler.dispatch('onfilter', localItems);\n }\n\n function onInput(e: Event) {\n const value = (e.target as HTMLInputElement).value;\n handleInputValue(value);\n filterListbox(value);\n }\n\n function onScrollEnd() {\n eventHandler.dispatch('scrollend', true);\n }\n\n function onSelectAll(e: CustomEvent) {\n eventHandler.dispatch('select-all', e.detail);\n }\n\n function removeTagSelected(itemSelectedId: any) {\n listboxValue = listboxValue.filter(\n (value: any) => value !== itemSelectedId,\n );\n eventHandler.dispatch('onchange', listboxValue);\n }\n\n // Watch Functions\n async function watchListboxValue(value: any) {\n await tick();\n selectedItems = getSelectedItems(value);\n if (!multiple) {\n const seletedLabels = selectedItems.map((item) => item[datatextexpr]);\n localInputValue = seletedLabels.join(', ');\n } else {\n tagValue = value;\n }\n }\n\n async function setTagWidth(tagValue: any) {\n await tick();\n\n tagWidth =\n tag && tagValue && tagValue.length\n ? `${\n component.shadowRoot.querySelector('.mc-tag-removable').clientWidth\n }px`\n : '0px';\n }\n</script>\n\n<div\n class=\"mc-autocomplete\"\n class:mc-autocomplete--multi={multiple}\n style=\"--autocomplete-tag-width: {tagWidth}; --autocomplete-width: {maxwidth};\"\n use:clickOutside\n on:outclick={closeListBox}\n {...attributes}\n>\n <div class=\"mc-autocomplete__main\">\n <!-- TAG REMOVABLE -->\n {#if multiple && listboxValue.length > 0 && !alltags}\n <Tag\n id={tagid ? tagid : `autocompleteTag-${uuid}`}\n class=\"mc-autocomplete__tag\"\n label={setTagLabel()}\n size=\"s\"\n type=\"removable\"\n dark={false}\n disabled={false}\n href=\"\"\n name=\"\"\n value=\"\"\n selected={false}\n bind:this={tag}\n on:tag-removed={clearListbox}\n />\n {/if}\n\n <!-- TEXT INPUT -->\n <TextInput\n classinput=\"mc-autocomplete__trigger\"\n name={id}\n bind:value={localInputValue}\n {placeholder}\n inputtype=\"text\"\n {isinvalid}\n {disabled}\n {size}\n {required}\n iconname=\"navigation-display-search-24px\"\n rightalign={false}\n isvalid={false}\n min=\"\"\n max=\"\"\n on:input={onInput}\n on:click={() => (openState = true)}\n on:change\n on:blur\n />\n\n <div class=\"mc-autocomplete__tools\">\n <!-- LOADER -->\n {#if loading}\n <Loader\n size=\"s\"\n theme=\"primary\"\n text=\"\"\n class=\"mc-autocomplete__loader\"\n />\n {/if}\n\n <!-- CLEAR BUTTON -->\n {#if localInputValue != null && localInputValue != ''}\n <button\n class=\"mc-autocomplete__clear\"\n type=\"button\"\n on:click|stopPropagation={() => {\n localInputValue = '';\n localItems = parsedItems;\n isfiltered = false;\n if (!multiple) {\n clearListbox();\n }\n }}\n >\n <navigation-control-tag--cross-24px />\n <span class=\"mc-autocomplete__clear-text\">Clear</span>\n </button>\n {/if}\n </div>\n </div>\n\n <!-- LISTBOX -->\n <Listbox\n items={JSON.stringify(localItems)}\n open={openState}\n {multiple}\n {isfiltered}\n {emptysearchlabel}\n {maxwidth}\n {datatextexpr}\n {datavalueexpr}\n {selectall}\n {labelselectall}\n bind:value={listboxValue}\n on:change={onChange}\n on:scrollend={onScrollEnd}\n on:select-all={onSelectAll}\n />\n\n {#if multiple && alltags}\n <div class=\"tags-selected\">\n {#each selectedItems as selectedItem, index}\n {#if index < maxnumbertoshowtags}\n <div class=\"tag-selected\">\n <m-tag\n id={selectedItem.id}\n label={selectedItem.label}\n size=\"s\"\n type=\"removable\"\n on:tag-removed={() => removeTagSelected(selectedItem.id)}\n />\n </div>\n {/if}\n {/each}\n {#if listboxValue.length > maxnumbertoshowtags}\n <div class=\"tag-selected\">\n <m-tag\n id=\"id-tag\"\n label=\"({listboxValue.length}) {showmoretagslabel} \"\n size=\"s\"\n type=\"link\"\n on:tag-selected={() => openLayerFn()}\n />\n </div>\n {/if}\n </div>\n {/if}\n\n <!-- <span class=\"mc-autocomplete__tag\" style=\"display:none;\" /> -->\n <span class=\"mc-autocomplete__loader\" style=\"display:none;\" />\n <span class=\"mc-text-input mc-autocomplete__trigger\" style=\"display:none;\" />\n\n {#if multiple && alltags}\n <div>\n <m-layer\n title={layertitle}\n layertitletag=\"h3\"\n isopen={openLayer}\n on:layer-closed={() => closeLayerFn()}\n >\n <small slot=\"content\">\n <div class=\"tags-selected\">\n {#each selectedItems as selectedItem}\n <div class=\"tag-selected\">\n <m-tag\n id={selectedItem.id}\n label={selectedItem.label}\n size=\"s\"\n type=\"removable\"\n on:tag-removed={() => removeTagSelected(selectedItem.id)}\n />\n </div>\n {/each}\n </div>\n </small>\n </m-layer>\n </div>\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.autocomplete';\n\n // Autocomplete\n // NOTE: These styles with the \"!important\" allow to overload the edge effects\n // due to the scoping applied by Svelte on the CSS selectors\n .mc-autocomplete {\n &__tag {\n position: absolute !important; // due to the Svelte CSS scope\n }\n\n &--multi {\n .mc-autocomplete__trigger {\n padding-left: calc(\n 2.9375rem + var(--autocomplete-tag-width)\n ) !important;\n }\n }\n }\n\n // Selected Tags\n .tags-selected {\n display: flex;\n flex-wrap: wrap;\n }\n\n .tag-selected {\n margin-top: 1em;\n margin-left: 5px;\n margin-right: 5px;\n }\n</style>\n"],"names":["ctx","insert","target","button","anchor","length","i","create_if_block_2","div","set_custom_element_data","m_tag","m_tag_id_value","id","m_tag_label_value","label","append","dirty","if_block","create_if_block_3","div1","m_layer","small","div0","if_block0","create_if_block_6","create_if_block_5","if_block2","create_if_block_4","JSON","stringify","if_block3","create_if_block_1","if_block4","create_if_block","style","div2_style_value","div2","span0","span1","current","maxwidth","$$props","tagid","taglabel","placeholder","filter","disabled","size","isinvalid","inputvalue","loading","required","items","value","open","multiple","emptysearchlabel","datatextexpr","datavalueexpr","nosort","layertitle","showmoretagslabel","maxnumbertoshowtags","alltags","selectall","labelselectall","component","get_current_component","uuid","Math","random","tag","tagValue","sortedListItems","eventHandler","EventHandler","tagWidth","isfiltered","selectedItems","openLayer","clearListbox","listboxValue","closeListBox","dispatch","$$invalidate","openState","parsedItems","getSelectedItems","sort","a","b","hasItemA","includes","hasItemB","localItems","sortItems","val","item","openLayerFn","closeLayerFn","removeTagSelected","itemSelectedId","localInputValue","parse","setTagLabel","toString","async","tick","seletedLabels","map","join","watchListboxValue","shadowRoot","querySelector","clientWidth","setTagWidth","eventName","attributes","Object","assign","$$restProps","class","e","handleInputValue","toUpperCase","filterListbox","detail","$$value","value$1","selectedItem"],"mappings":"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"}
1
+ {"version":3,"file":"Autocomplete.js","sources":["../../../../src/components/autocomplete/Autocomplete.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { tick } from 'svelte';\n import { get_current_component } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n import { clickOutside } from '../../utilities/ClickOutside';\n import type { ListboxItems } from '../listbox/listbox.types';\n import type { TextInputSize } from '../textinput/textinput.types';\n\n import Tag from '../tag/Tag.nested.svelte';\n import Loader from '../loader/Loader.nested.svelte';\n import TextInput from '../textinput/Textinput.nested.svelte';\n import Listbox from '../listbox/Listbox.nested.svelte';\n\n export let maxwidth = '100%';\n export let tagid: string;\n export let taglabel = '';\n export let placeholder: string;\n export let filter = true;\n export let disabled = false;\n export let size: TextInputSize = 'm';\n export let isinvalid: boolean;\n export let inputvalue: string;\n export let id: string;\n export let loading = false;\n export let required = false;\n export let items: string;\n export let value: any;\n export let open = false;\n export let multiple = false;\n export let emptysearchlabel = 'No results found';\n export let datatextexpr = 'label';\n export let datavalueexpr = 'value';\n export let nosort = false;\n export let layertitle = 'Title layer';\n export let showmoretagslabel = 'Show more';\n export let maxnumbertoshowtags = 12;\n export let alltags = false;\n export let selectall = false;\n export let labelselectall = 'Select all';\n\n const component: any = get_current_component();\n const uuid = Math.random();\n let eventHandler = new EventHandler();\n let tag: any;\n let tagWidth = '0px';\n let tagValue: any;\n let sortedListItems: any;\n let isfiltered = false;\n let selectedItems: ListboxItems[] = [];\n let openLayer: any = null;\n\n $: localInputValue = inputvalue;\n $: parsedItems = items ? (JSON.parse(items) as ListboxItems[]) : [];\n $: localItems = parsedItems;\n $: listboxValue = !value && multiple ? [] : value ? JSON.parse(value) : value;\n $: setTagLabel = () => {\n return listboxValue.length.toString() + ' ' + taglabel;\n };\n $: watchListboxValue(listboxValue);\n $: setTagWidth(tagValue);\n $: openState = open;\n $: {\n const eventName = openState ? 'open' : 'close';\n eventHandler.dispatch(eventName, openState);\n }\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n function clearListbox() {\n listboxValue = multiple ? [] : '';\n closeListBox();\n eventHandler.dispatch('clear', true);\n }\n\n function closeListBox() {\n openState = false;\n\n if (multiple && !nosort) {\n sortItems();\n } else {\n localItems = parsedItems;\n }\n }\n\n function onChange() {\n eventHandler.dispatch('onchange', listboxValue);\n\n if (!multiple) {\n closeListBox();\n }\n }\n\n function getSelectedItems(val?: string) {\n const value = val ? val : listboxValue;\n\n const selectedItems = parsedItems.filter((item: ListboxItems) => {\n return multiple\n ? value.includes(item[datavalueexpr])\n : value === item[datavalueexpr];\n });\n return selectedItems;\n }\n\n function sortItems() {\n sortedListItems = parsedItems;\n const selectedItems = getSelectedItems();\n\n sortedListItems.sort((a: any, b: any) => {\n const hasItemA = selectedItems.includes(a);\n const hasItemB = selectedItems.includes(b);\n\n if (hasItemA === hasItemB) {\n return a[datavalueexpr] - b[datavalueexpr];\n } else if (hasItemA < hasItemB) {\n return 1;\n } else {\n return -1;\n }\n });\n\n localItems = sortedListItems;\n }\n\n function openLayerFn() {\n openLayer = true;\n }\n\n function closeLayerFn() {\n openLayer = null;\n }\n\n function handleInputValue(value: any) {\n eventHandler.dispatch('oninput', value);\n }\n\n function filterListbox(value: any) {\n if (!filter) {\n return;\n }\n\n if (value.length) {\n localItems = parsedItems.filter((item: any) =>\n item[datatextexpr].toUpperCase().includes(value.toUpperCase()),\n );\n } else {\n localItems = parsedItems;\n }\n\n isfiltered = !localItems.length;\n\n eventHandler.dispatch('onfilter', localItems);\n }\n\n function onInput(e: Event) {\n const value = (e.target as HTMLInputElement).value;\n handleInputValue(value);\n filterListbox(value);\n }\n\n function onScrollEnd() {\n eventHandler.dispatch('scrollend', true);\n }\n\n function onSelectAll(e: CustomEvent) {\n eventHandler.dispatch('select-all', e.detail);\n }\n\n function removeTagSelected(itemSelectedId: any) {\n listboxValue = listboxValue.filter(\n (value: any) => value !== itemSelectedId,\n );\n eventHandler.dispatch('onchange', listboxValue);\n }\n\n // Watch Functions\n async function watchListboxValue(value: any) {\n await tick();\n selectedItems = getSelectedItems(value);\n if (!multiple) {\n const seletedLabels = selectedItems.map((item) => item[datatextexpr]);\n localInputValue = seletedLabels.join(', ');\n } else {\n tagValue = value;\n }\n }\n\n async function setTagWidth(tagValue: any) {\n await tick();\n\n tagWidth =\n tag && tagValue && tagValue.length\n ? `${\n component.shadowRoot.querySelector('.mc-tag-removable').clientWidth\n }px`\n : '0px';\n }\n</script>\n\n<div\n class=\"mc-autocomplete\"\n class:mc-autocomplete--multi={multiple}\n style=\"--autocomplete-tag-width: {tagWidth}; --autocomplete-width: {maxwidth};\"\n use:clickOutside\n on:outclick={closeListBox}\n {...attributes}\n>\n <div class=\"mc-autocomplete__main\">\n <!-- TAG REMOVABLE -->\n {#if multiple && listboxValue.length > 0 && !alltags}\n <Tag\n id={tagid ? tagid : `autocompleteTag-${uuid}`}\n class=\"mc-autocomplete__tag\"\n label={setTagLabel()}\n size=\"s\"\n type=\"removable\"\n dark={false}\n disabled={false}\n href=\"\"\n name=\"\"\n value=\"\"\n selected={false}\n bind:this={tag}\n on:tag-removed={clearListbox}\n />\n {/if}\n\n <!-- TEXT INPUT -->\n <TextInput\n classinput=\"mc-autocomplete__trigger\"\n name={id}\n bind:value={localInputValue}\n {placeholder}\n inputtype=\"text\"\n {isinvalid}\n {disabled}\n {size}\n {required}\n iconname=\"navigation-display-search-24px\"\n rightalign={false}\n isvalid={false}\n min=\"\"\n max=\"\"\n on:input={onInput}\n on:click={() => (openState = true)}\n on:change\n on:blur\n />\n\n <div class=\"mc-autocomplete__tools\">\n <!-- LOADER -->\n {#if loading}\n <Loader\n size=\"s\"\n theme=\"primary\"\n text=\"\"\n class=\"mc-autocomplete__loader\"\n />\n {/if}\n\n <!-- CLEAR BUTTON -->\n {#if localInputValue != null && localInputValue != '' && !disabled}\n <button\n class=\"mc-autocomplete__clear\"\n type=\"button\"\n on:click|stopPropagation={() => {\n localInputValue = '';\n localItems = parsedItems;\n isfiltered = false;\n if (!multiple) {\n clearListbox();\n }\n }}\n >\n <navigation-control-tag--cross-24px />\n <span class=\"mc-autocomplete__clear-text\">Clear</span>\n </button>\n {/if}\n </div>\n </div>\n\n <!-- LISTBOX -->\n <Listbox\n items={JSON.stringify(localItems)}\n open={openState}\n {multiple}\n {isfiltered}\n {emptysearchlabel}\n {maxwidth}\n {datatextexpr}\n {datavalueexpr}\n {selectall}\n {labelselectall}\n bind:value={listboxValue}\n on:change={onChange}\n on:scrollend={onScrollEnd}\n on:select-all={onSelectAll}\n />\n\n {#if multiple && alltags}\n <div class=\"tags-selected\">\n {#each selectedItems as selectedItem, index}\n {#if index < maxnumbertoshowtags}\n <div class=\"tag-selected\">\n {#if disabled}\n <m-tag\n type=\"link\"\n id={selectedItem.id}\n label={selectedItem.label}\n size=\"s\"\n dark={true}\n />\n {:else}\n <m-tag\n id={selectedItem.id}\n label={selectedItem.label}\n size=\"s\"\n type=\"removable\"\n on:tag-removed={() => removeTagSelected(selectedItem.id)}\n />\n {/if}\n </div>\n {/if}\n {/each}\n {#if listboxValue.length > maxnumbertoshowtags}\n <div class=\"tag-selected\">\n <m-tag\n id=\"id-tag\"\n label=\"({listboxValue.length}) {showmoretagslabel} \"\n size=\"s\"\n type=\"link\"\n on:tag-selected={() => openLayerFn()}\n />\n </div>\n {/if}\n </div>\n {/if}\n\n <!-- <span class=\"mc-autocomplete__tag\" style=\"display:none;\" /> -->\n <span class=\"mc-autocomplete__loader\" style=\"display:none;\" />\n <span class=\"mc-text-input mc-autocomplete__trigger\" style=\"display:none;\" />\n\n {#if multiple && alltags}\n <div>\n <m-layer\n title={layertitle}\n layertitletag=\"h3\"\n isopen={openLayer}\n on:layer-closed={() => closeLayerFn()}\n >\n <small slot=\"content\">\n <div class=\"tags-selected\">\n {#each selectedItems as selectedItem}\n <div class=\"tag-selected\">\n {#if disabled}\n <m-tag\n type=\"text\"\n id={selectedItem.id}\n label={selectedItem.label}\n size=\"s\"\n />\n {:else}\n <m-tag\n id={selectedItem.id}\n label={selectedItem.label}\n size=\"s\"\n type=\"removable\"\n on:tag-removed={() => removeTagSelected(selectedItem.id)}\n />\n {/if}\n </div>\n {/each}\n </div>\n </small>\n </m-layer>\n </div>\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.autocomplete';\n\n // Autocomplete\n // NOTE: These styles with the \"!important\" allow to overload the edge effects\n // due to the scoping applied by Svelte on the CSS selectors\n .mc-autocomplete {\n &__tag {\n position: absolute !important; // due to the Svelte CSS scope\n }\n\n &--multi {\n .mc-autocomplete__trigger {\n padding-left: calc(\n 2.9375rem + var(--autocomplete-tag-width)\n ) !important;\n }\n }\n }\n\n // Selected Tags\n .tags-selected {\n display: flex;\n flex-wrap: wrap;\n }\n\n .tag-selected {\n margin-top: 1em;\n margin-left: 5px;\n margin-right: 5px;\n }\n</style>\n"],"names":["ctx","insert","target","button","anchor","length","i","create_if_block_3","div","create_if_block_5","set_custom_element_data","m_tag","m_tag_id_value","id","m_tag_label_value","label","dirty","if_block","create_if_block_4","append","div1","m_layer","small","div0","create_if_block_1","if_block0","create_if_block_8","create_if_block_7","if_block2","create_if_block_6","JSON","stringify","if_block3","create_if_block_2","if_block4","create_if_block","style","div2_style_value","div2","span0","span1","current","maxwidth","$$props","tagid","taglabel","placeholder","filter","disabled","size","isinvalid","inputvalue","loading","required","items","value","open","multiple","emptysearchlabel","datatextexpr","datavalueexpr","nosort","layertitle","showmoretagslabel","maxnumbertoshowtags","alltags","selectall","labelselectall","component","get_current_component","uuid","Math","random","tag","tagValue","sortedListItems","eventHandler","EventHandler","tagWidth","isfiltered","selectedItems","openLayer","clearListbox","listboxValue","closeListBox","dispatch","$$invalidate","openState","parsedItems","getSelectedItems","sort","a","b","hasItemA","includes","hasItemB","localItems","sortItems","val","item","openLayerFn","closeLayerFn","removeTagSelected","itemSelectedId","localInputValue","parse","setTagLabel","toString","async","tick","seletedLabels","map","join","watchListboxValue","shadowRoot","querySelector","clientWidth","setTagWidth","eventName","attributes","Object","assign","$$restProps","class","e","handleInputValue","toUpperCase","filterListbox","detail","$$value","value$1","selectedItem"],"mappings":"2sBAoNYA,EAAK,GAAGA,EAAK,sBAAsBA,EAAI,yCAEpCA,EAAW,sCAGZ,YACI,qCAIA,0DAEMA,EAAY,kFAZxBA,EAAK,GAAGA,EAAK,sBAAsBA,EAAI,iCAEpCA,EAAW,ymBAiDlBC,EAcQC,EAAAC,EAAAC,0FAyBHJ,EAAa,yBAAlBK,OAAIC,GAAA,0BAuBDN,EAAY,IAACK,OAASL,EAAmB,KAAAO,GAAAP,kHAxBhDC,EAmCKC,EAAAM,EAAAJ,yHAlCIJ,EAAa,YAAlBK,OAAIC,GAAA,EAAA,+GAAJD,OAuBGL,EAAY,IAACK,OAASL,EAAmB,yIApBnCA,EAAQ,GAAAS,sFADfR,EAkBKC,EAAAM,EAAAJ,kMAPKM,EAAAC,EAAA,KAAAC,EAAAZ,MAAaa,IACVH,EAAAC,EAAA,QAAAG,EAAAd,MAAae,uDAFtBd,EAMCC,EAAAS,EAAAP,gDALK,SAAAY,EAAA,IAAAJ,KAAAA,EAAAZ,MAAaa,iBACV,SAAAG,EAAA,IAAAF,KAAAA,EAAAd,MAAae,mHARhBL,EAAAC,EAAA,KAAAC,EAAAZ,MAAaa,IACVH,EAAAC,EAAA,QAAAG,EAAAd,MAAae,mCAEd,WALRd,EAMCC,EAAAS,EAAAP,WAJK,SAAAY,EAAA,IAAAJ,KAAAA,EAAAZ,MAAaa,iBACV,SAAAG,EAAA,IAAAF,KAAAA,EAAAd,MAAae,4DANvBE,EAAAjB,MAAQA,EAAmB,KAAAkB,EAAAlB,kEAA3BA,MAAQA,EAAmB,oMA0BnBA,EAAY,IAACK,OAAM,KAAIL,EAAiB,IAAA,4EAHrDC,EAQKC,EAAAM,EAAAJ,GAPHe,EAMCX,EAAAG,yEAJUX,EAAY,IAACK,OAAM,KAAIL,EAAiB,IAAA,+EAwB1CA,EAAa,yBAAlBK,OAAIC,GAAA,qLAPHN,EAAU,4CAETA,EAAS,aAJrBC,EAgCKC,EAAAkB,EAAAhB,GA/BHe,EA8BSC,EAAAC,GAxBPF,EAuBOE,EAAAC,GAtBLH,EAqBKG,EAAAC,yIApBIvB,EAAa,YAAlBK,OAAIC,GAAA,EAAA,kHAAJD,8BAPCL,EAAU,kCAETA,EAAS,2HAgBDU,EAAAC,EAAA,KAAAC,EAAAZ,MAAaa,IACVH,EAAAC,EAAA,QAAAG,EAAAd,MAAae,uDAFtBd,EAMCC,EAAAS,EAAAP,gDALK,SAAAY,EAAA,IAAAJ,KAAAA,EAAAZ,MAAaa,iBACV,SAAAG,EAAA,IAAAF,KAAAA,EAAAd,MAAae,oHAPhBL,EAAAC,EAAA,KAAAC,EAAAZ,MAAaa,IACVH,EAAAC,EAAA,QAAAG,EAAAd,MAAae,+BAHtBd,EAKCC,EAAAS,EAAAP,WAHK,SAAAY,EAAA,IAAAJ,KAAAA,EAAAZ,MAAaa,iBACV,SAAAG,EAAA,IAAAF,KAAAA,EAAAd,MAAae,qFAJnBf,EAAQ,GAAAwB,8FADfvB,EAiBKC,EAAAM,EAAAJ,8KAjKVqB,GAAAzB,MAAYA,EAAY,IAACK,OAAS,IAAML,EAAO,KAAA0B,EAAA1B,8EAqB5CA,EAAE,gJASI,WACH,sBATkB,IAAfA,EAAe,eAAfA,EAAe,qEAYjBA,EAAO,2EAQZA,EAAO,IAAA2B,IAUPC,GAAmB,MAAnB5B,OAA8C,IAAnBA,EAAmB,MAAOA,EAAQ,IAAA6B,EAAA7B,yCAsB7D8B,KAAKC,UAAU/B,EAAU,UAC1BA,EAAS,0JASS,IAAZA,EAAY,eAAZA,EAAY,sEACbA,EAAQ,uBACLA,EAAW,wBACVA,EAAW,KAGvB,IAAAgC,GAAAhC,MAAYA,EAAO,KAAAiC,EAAAjC,GA2CnBkC,GAAAlC,MAAYA,EAAO,KAAAmC,GAAAnC,kCA5IUoC,MAAAC,EAAA,6BAAArC,iCAAkCA,EAAQ,GAAA,KAGxEA,EAAU,sgBAJgBA,EAAQ,YAFxCC,EAkLKC,EAAAoC,EAAAlC,GA1KHe,EAwEKmB,EAAAlB,8CA9BHD,EA6BKC,EAAAG,8FA6DPJ,EAA6DmB,EAAAC,UAC7DpB,EAA4EmB,EAAAE,wEAxI/DxC,EAAY,oBAKlBA,MAAYA,EAAY,IAACK,OAAS,IAAML,EAAO,+IAqB5CA,EAAE,4KACIA,EAAe,6BAoBtBA,EAAO,kGAUY,MAAnBA,OAA8C,IAAnBA,EAAmB,KAAOA,EAAQ,wGAsB7D8B,KAAKC,UAAU/B,EAAU,4BAC1BA,EAAS,gTASHA,EAAY,6BAMrBA,MAAYA,EAAO,kEA2CnBA,MAAYA,EAAO,+GA5IUyC,GAAA,SAAAzB,EAAA,IAAAqB,KAAAA,EAAA,6BAAArC,iCAAkCA,EAAQ,GAAA,OAAA,CAAAoC,MAAAC,iBAGxErC,EAAU,oCAJgBA,EAAQ,glBA3L3B0C,SAAAA,EAAW,QAAMC,SACjBC,GAAaD,GACbE,SAAAA,EAAW,IAAEF,eACbG,GAAmBH,GACnBI,OAAAA,GAAS,GAAIJ,GACbK,SAAAA,GAAW,GAAKL,GAChBM,KAAAA,EAAsB,KAAGN,aACzBO,GAAkBP,cAClBQ,GAAkBR,MAClB9B,GAAU8B,GACVS,QAAAA,GAAU,GAAKT,GACfU,SAAAA,GAAW,GAAKV,SAChBW,GAAaX,SACbY,GAAUZ,GACVa,KAAAA,GAAO,GAAKb,GACZc,SAAAA,GAAW,GAAKd,GAChBe,iBAAAA,EAAmB,oBAAkBf,GACrCgB,aAAAA,EAAe,SAAOhB,GACtBiB,cAAAA,EAAgB,SAAOjB,GACvBkB,OAAAA,GAAS,GAAKlB,GACdmB,WAAAA,EAAa,eAAanB,GAC1BoB,kBAAAA,EAAoB,aAAWpB,GAC/BqB,oBAAAA,EAAsB,IAAErB,GACxBsB,QAAAA,GAAU,GAAKtB,GACfuB,UAAAA,GAAY,GAAKvB,GACjBwB,eAAAA,EAAiB,cAAYxB,EAElC,MAAAyB,EAAiBC,IACjBC,EAAOC,KAAKC,SACd,IACAC,EAEAC,EACAC,EAJAC,MAAmBC,EAEnBC,EAAW,MAGXC,GAAa,EACbC,GAAa,GACbC,GAAiB,cAmBZC,UACPC,EAAe1B,EAAQ,GAAQ,IAC/B2B,KACAR,EAAaS,SAAS,SAAS,YAGxBD,KACPE,EAAA,GAAAC,GAAY,GAER9B,IAAaI,aA2BjBc,EAAkBa,EACZ,MAAAR,EAAgBS,KAEtBd,EAAgBe,MAAM,CAAAC,EAAQC,KACtB,MAAAC,EAAWb,EAAcc,SAASH,GAClCI,EAAWf,EAAcc,SAASF,GAEpC,OAAAC,IAAaE,EACRJ,EAAE/B,GAAiBgC,EAAEhC,GACnBiC,EAAWE,EACb,GAEC,KAIZT,EAAA,GAAAU,EAAarB,GA1CXsB,GAEAX,EAAA,GAAAU,EAAaR,GAYR,SAAAC,GAAiBS,GAClB,MAAA3C,EAAQ2C,GAAYf,SAEJK,EAAYzC,QAAQoD,GACjC1C,EACHF,EAAMuC,SAASK,EAAKvC,IACpBL,IAAU4C,EAAKvC,cAyBdwC,KACPd,EAAA,GAAAL,IAAY,YAGLoB,KACPf,EAAA,GAAAL,GAAY,MAuCL,SAAAqB,GAAkBC,QACzBpB,EAAeA,EAAapC,QACzBQ,GAAeA,IAAUgD,KAE5B3B,EAAaS,SAAS,WAAYF,khCAxHnCG,EAAA,GAAEkB,EAAkBrD,uBACpBmC,EAAA,GAAEE,EAAclC,EAASxB,KAAK2E,MAAMnD,GAAK,2BACzCgC,EAAA,GAAEU,EAAaR,0CACbF,EAAA,GAAAH,GAAgB5B,GAASE,KAAgBF,EAAQzB,KAAK2E,MAAMlD,GAASA,iDACrEmD,EAAW,IACLvB,EAAa9E,OAAOsG,WAAa,IAAM9D,yBAuHjC+D,eAAkBrD,YACzBsD,SACN7B,GAAgBS,GAAiBlC,IAC5BE,EAIH6B,EAAA,GAAAZ,EAAWnB,OAJA,OACLuD,EAAgB9B,GAAc+B,KAAKZ,GAASA,EAAKxC,KACvD2B,EAAA,GAAAkB,EAAkBM,EAAcE,KAAK,QA1HtCC,CAAkB9B,yBAgINyB,eAAYlC,SACnBmC,IAENvB,EAAA,GAAAR,EACEL,GAAOC,GAAYA,EAASrE,OAEtB,GAAA+D,EAAU8C,WAAWC,cAAc,qBAAqBC,gBAE1D,OAvILC,CAAY3C,wBACdY,EAAA,GAAEC,EAAY/B,yBACd,CACO,MAAA8D,EAAY/B,EAAY,OAAS,QACvCX,EAAaS,SAASiC,EAAW/B,QAEhCgC,EAALC,OAAAC,UAAuBC,kCACXH,EAAWI,2FAmBnB/C,EAAaS,SAAS,WAAYF,GAE7B1B,GACH2B,YAiEK,SAAQwC,GACT,MAAArE,EAASqE,EAAE1H,OAA4BqD,OAvBtC,SAAiBA,GACxBqB,EAAaS,SAAS,UAAW9B,GAuBjCsE,CAAiBtE,GApBV,SAAcA,GAChBR,IAIDQ,EAAMlD,OACRiF,EAAA,GAAAU,EAAaR,EAAYzC,QAAQoD,GAC/BA,EAAKxC,GAAcmE,cAAchC,SAASvC,EAAMuE,kBAGlDxC,EAAA,GAAAU,EAAaR,QAGfT,GAAciB,EAAW3F,QAEzBuE,EAAaS,SAAS,WAAYW,IAMlC+B,CAAcxE,eAIdqB,EAAaS,SAAS,aAAa,IAG5B,SAAYuC,GACnBhD,EAAaS,SAAS,aAAcuC,EAAEI,oEAyDvBvD,EAAGwD,0BASJzB,EAAejD,mBAaV,IAAA+B,EAAA,GAAAC,GAAY,oEAsBvBD,EAAA,GAAAkB,EAAkB,IAClBlB,EAAA,GAAAU,EAAaR,GACbF,EAAA,GAAAP,GAAa,GACRtB,GACHyB,kBAuBEC,EAAY+C,6BAyBU5B,GAAkB6B,EAAatH,QAalCuF,QAoCOE,GAAkB6B,EAAatH,QAnB1CwF"}
@@ -260,7 +260,7 @@
260
260
  {/if}
261
261
 
262
262
  <!-- CLEAR BUTTON -->
263
- {#if localInputValue != null && localInputValue != ''}
263
+ {#if localInputValue != null && localInputValue != '' && !disabled}
264
264
  <button
265
265
  class="mc-autocomplete__clear"
266
266
  type="button"
@@ -303,13 +303,23 @@
303
303
  {#each selectedItems as selectedItem, index}
304
304
  {#if index < maxnumbertoshowtags}
305
305
  <div class="tag-selected">
306
- <m-tag
307
- id={selectedItem.id}
308
- label={selectedItem.label}
309
- size="s"
310
- type="removable"
311
- on:tag-removed={() => removeTagSelected(selectedItem.id)}
312
- />
306
+ {#if disabled}
307
+ <m-tag
308
+ type="link"
309
+ id={selectedItem.id}
310
+ label={selectedItem.label}
311
+ size="s"
312
+ dark={true}
313
+ />
314
+ {:else}
315
+ <m-tag
316
+ id={selectedItem.id}
317
+ label={selectedItem.label}
318
+ size="s"
319
+ type="removable"
320
+ on:tag-removed={() => removeTagSelected(selectedItem.id)}
321
+ />
322
+ {/if}
313
323
  </div>
314
324
  {/if}
315
325
  {/each}
@@ -343,13 +353,22 @@
343
353
  <div class="tags-selected">
344
354
  {#each selectedItems as selectedItem}
345
355
  <div class="tag-selected">
346
- <m-tag
347
- id={selectedItem.id}
348
- label={selectedItem.label}
349
- size="s"
350
- type="removable"
351
- on:tag-removed={() => removeTagSelected(selectedItem.id)}
352
- />
356
+ {#if disabled}
357
+ <m-tag
358
+ type="text"
359
+ id={selectedItem.id}
360
+ label={selectedItem.label}
361
+ size="s"
362
+ />
363
+ {:else}
364
+ <m-tag
365
+ id={selectedItem.id}
366
+ label={selectedItem.label}
367
+ size="s"
368
+ type="removable"
369
+ on:tag-removed={() => removeTagSelected(selectedItem.id)}
370
+ />
371
+ {/if}
353
372
  </div>
354
373
  {/each}
355
374
  </div>
@@ -1,2 +1,2 @@
1
- import{S as t,i as o,a as e,b as i,f as n,s as r,c as m,e as c,d as l,n as d,h as a,j as s,B as b,C as u,D as h,E as f,m as g,o as p,p as x,r as w,q as _,g as $,M as y,Z as v,K as k,x as z,A as j,G as E,t as q,k as C}from"../../index-c33b3772.js";import{c as N}from"../../EventForward-8492ff62.js";import S from"../loader/Loader.nested.js";function A(t){let o,e,n,r;const m=[M,L],l=[];function d(t,o){return t[13]&&"left"===t[12]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),$(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(y(),h(l[r],1,1,(()=>{l[r]=null})),f(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),u(n,1),n.m(o,null))},i(t){r||(u(n),r=!0)},o(t){h(n),r=!1},d(t){t&&p(o),l[e].d()}}}function L(t){let o,e,n=`<${H(t[2],t[6],t[5])} />`;return{c(){o=new v(!1),e=k(),o.a=e},m(t,r){o.m(n,t,r),i(t,e,r)},p(t,e){100&e&&n!==(n=`<${H(t[2],t[6],t[5])} />`)&&o.p(n)},i:d,o:d,d(t){t&&p(e),t&&o.d()}}}function M(t){let o,e;return o=new S({props:{size:"s",theme:t[11],text:"TEST"}}),{c(){z(o.$$.fragment)},m(t,i){j(o,t,i),e=!0},p(t,e){const i={};2048&e&&(i.theme=t[11]),o.$set(i)},i(t){e||(u(o.$$.fragment,t),e=!0)},o(t){h(o.$$.fragment,t),e=!1},d(t){E(o,t)}}}function O(t){let o,e,n,r,m,d,a=t[13]&&"left"===t[12]&&!t[5]&&T(t),b=t[13]&&"right"===t[12]&&!t[5]&&B(t);return{c(){a&&a.c(),o=l(),e=c("span"),n=q(t[4]),r=l(),b&&b.c(),m=k(),$(e,"class","mc-button__label")},m(t,c){a&&a.m(t,c),i(t,o,c),i(t,e,c),s(e,n),i(t,r,c),b&&b.m(t,c),i(t,m,c),d=!0},p(t,e){t[13]&&"left"===t[12]&&!t[5]?a?(a.p(t,e),12320&e&&u(a,1)):(a=T(t),a.c(),u(a,1),a.m(o.parentNode,o)):a&&(y(),h(a,1,1,(()=>{a=null})),f()),(!d||16&e)&&C(n,t[4]),t[13]&&"right"===t[12]&&!t[5]?b?(b.p(t,e),12320&e&&u(b,1)):(b=B(t),b.c(),u(b,1),b.m(m.parentNode,m)):b&&(y(),h(b,1,1,(()=>{b=null})),f())},i(t){d||(u(a),u(b),d=!0)},o(t){h(a),h(b),d=!1},d(t){a&&a.d(t),t&&p(o),t&&p(e),t&&p(r),b&&b.d(t),t&&p(m)}}}function R(t){let o,e,n,r;const m=[F,D],l=[];function d(t,o){return t[13]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),$(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(y(),h(l[r],1,1,(()=>{l[r]=null})),f(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),u(n,1),n.m(o,null))},i(t){r||(u(n),r=!0)},o(t){h(n),r=!1},d(t){t&&p(o),l[e].d()}}}function T(t){let o,e,n;return e=new S({props:{size:"s",theme:t[11],text:""}}),{c(){o=c("span"),z(e.$$.fragment),$(o,"class","mc-button__icon")},m(t,r){i(t,o,r),j(e,o,null),n=!0},p(t,o){const i={};2048&o&&(i.theme=t[11]),e.$set(i)},i(t){n||(u(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){t&&p(o),E(e)}}}function B(t){let o,e,n;return e=new S({props:{size:"s",theme:t[11],text:""}}),{c(){o=c("span"),z(e.$$.fragment),$(o,"class","mc-button__icon")},m(t,r){i(t,o,r),j(e,o,null),n=!0},p(t,o){const i={};2048&o&&(i.theme=t[11]),e.$set(i)},i(t){n||(u(e.$$.fragment,t),n=!0)},o(t){h(e.$$.fragment,t),n=!1},d(t){t&&p(o),E(e)}}}function D(t){let o,e,n=`<${H(t[2],t[6],t[5])} size="100%" />`;return{c(){o=new v(!1),e=k(),o.a=e},m(t,r){o.m(n,t,r),i(t,e,r)},p(t,e){100&e&&n!==(n=`<${H(t[2],t[6],t[5])} size="100%" />`)&&o.p(n)},i:d,o:d,d(t){t&&p(e),t&&o.d()}}}function F(t){let o,e;return o=new S({props:{size:"m",theme:t[11],text:""}}),{c(){z(o.$$.fragment)},m(t,i){j(o,t,i),e=!0},p(t,e){const i={};2048&e&&(i.theme=t[11]),o.$set(i)},i(t){e||(u(o.$$.fragment,t),e=!0)},o(t){h(o.$$.fragment,t),e=!1},d(t){E(o,t)}}}function G(t){let o,e,n,r;const m=[K,J],l=[];function d(t,o){return t[13]&&"right"===t[12]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),$(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(y(),h(l[r],1,1,(()=>{l[r]=null})),f(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),u(n,1),n.m(o,null))},i(t){r||(u(n),r=!0)},o(t){h(n),r=!1},d(t){t&&p(o),l[e].d()}}}function J(t){let o,e,n=`<${H(t[2],t[6],t[5])} />`;return{c(){o=new v(!1),e=k(),o.a=e},m(t,r){o.m(n,t,r),i(t,e,r)},p(t,e){100&e&&n!==(n=`<${H(t[2],t[6],t[5])} />`)&&o.p(n)},i:d,o:d,d(t){t&&p(e),t&&o.d()}}}function K(t){let o,e;return o=new S({props:{size:"s",theme:t[11],text:""}}),{c(){z(o.$$.fragment)},m(t,i){j(o,t,i),e=!0},p(t,e){const i={};2048&e&&(i.theme=t[11]),o.$set(i)},i(t){e||(u(o.$$.fragment,t),e=!0)},o(t){h(o.$$.fragment,t),e=!1},d(t){E(o,t)}}}function Z(t){let o,e,n,r,x,w,_,$,v,k=t[5]&&"left"===t[6]&&A(t);const z=[R,O],j=[];function E(t,o){return t[5]&&"only"===t[6]?0:1}n=E(t),r=j[n]=z[n](t);let q=t[5]&&"right"===t[6]&&G(t),C=[{type:t[8]},{class:w=t[15](t[1],t[0],t[2],t[3])+" "+t[10]},{disabled:t[7]},t[9]],N={};for(let t=0;t<C.length;t+=1)N=m(N,C[t]);return{c(){o=c("button"),k&&k.c(),e=l(),r.c(),x=l(),q&&q.c(),this.c=d,a(o,N)},m(r,m){i(r,o,m),k&&k.m(o,null),s(o,e),j[n].m(o,null),s(o,x),q&&q.m(o,null),o.autofocus&&o.focus(),_=!0,$||(v=b(t[14].call(null,o)),$=!0)},p(t,[i]){t[5]&&"left"===t[6]?k?(k.p(t,i),96&i&&u(k,1)):(k=A(t),k.c(),u(k,1),k.m(o,e)):k&&(y(),h(k,1,1,(()=>{k=null})),f());let m=n;n=E(t),n===m?j[n].p(t,i):(y(),h(j[m],1,1,(()=>{j[m]=null})),f(),r=j[n],r?r.p(t,i):(r=j[n]=z[n](t),r.c()),u(r,1),r.m(o,x)),t[5]&&"right"===t[6]?q?(q.p(t,i),96&i&&u(q,1)):(q=G(t),q.c(),u(q,1),q.m(o,null)):q&&(y(),h(q,1,1,(()=>{q=null})),f()),a(o,N=g(C,[(!_||256&i)&&{type:t[8]},(!_||1039&i&&w!==(w=t[15](t[1],t[0],t[2],t[3])+" "+t[10]))&&{class:w},(!_||128&i)&&{disabled:t[7]},512&i&&t[9]]))},i(t){_||(u(k),u(r),u(q),_=!0)},o(t){h(k),h(r),h(q),_=!1},d(t){t&&p(o),k&&k.d(),j[n].d(),q&&q.d(),$=!1,v()}}}function H(t,o,e){const i="only"===o;let n;switch(t){case"s":n="24px";break;case"m":n=i?"32px":"24px";break;case"l":n=i?"100%":"32px"}return`${e} size="${n}" class="no"`}function I(t,o,e){let i,n,r,c,l,d;const a=["bordered","theme","size","full","label","iconname","iconmode","disabled","responsivesize","responsivewidth","type","loader"];let s=x(o,a);var b,u,h;let{bordered:f=!1}=o,{theme:g}=o,{size:p="m"}=o,{full:$=!1}=o,{label:y}=o,{iconname:v}=o,{iconmode:k}=o,{disabled:z=!1}=o,{responsivesize:j}=o,{responsivewidth:E}=o,{type:q="button"}=o,{loader:C}=o;const S=N(w());return t.$$set=t=>{e(24,o=m(m({},o),_(t))),e(23,s=x(o,a)),"bordered"in t&&e(0,f=t.bordered),"theme"in t&&e(1,g=t.theme),"size"in t&&e(2,p=t.size),"full"in t&&e(3,$=t.full),"label"in t&&e(4,y=t.label),"iconname"in t&&e(5,v=t.iconname),"iconmode"in t&&e(6,k=t.iconmode),"disabled"in t&&e(7,z=t.disabled),"responsivesize"in t&&e(16,j=t.responsivesize),"responsivewidth"in t&&e(17,E=t.responsivewidth),"type"in t&&e(8,q=t.type),"loader"in t&&e(18,C=t.loader)},t.$$.update=()=>{262144&t.$$.dirty&&e(22,i=C?JSON.parse(C):void 0),4718592&t.$$.dirty&&e(13,n=null!==e(19,b=null==i?void 0:i.enabled)&&void 0!==b&&b),5242880&t.$$.dirty&&e(12,r=null!==e(20,u=null==i?void 0:i.position)&&void 0!==u?u:"left"),6291456&t.$$.dirty&&e(11,c=null!==e(21,h=null==i?void 0:i.theme)&&void 0!==h?h:"primary"),e(10,l=o.class),e(9,d=Object.assign({},s)),512&t.$$.dirty&&delete d.class},o=_(o),[f,g,p,$,y,v,k,z,q,d,l,c,r,n,S,function(t,o,e,i){const n=["mc-button"],r=function(t,o){if(!o&&!t)return"";const e=o?"bordered":"solid";return t?`mc-button--${e}-${t}`:`mc-button--${e}`}(t,o);return r&&n.push(r),e&&n.push(`mc-button--${e}`),i?n.push("mc-button--full"):n.push("mc-button--fit"),"only"===k&&n.push("mc-button--square"),j&&n.push(`mc-button--${j}`),E&&n.push(`mc-button--${E}`),n.join(" ")},j,E,C,b,u,h,i]}class P extends t{constructor(t){super();const m=document.createElement("style");m.textContent='.mc-button{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;color:#ffffff;background-color:#120949;font-family:"LeroyMerlin", sans-serif;font-weight:600;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;fill:currentColor}.mc-button.is-hover,.mc-button:hover{background-color:#161cb6;color:#ffffff}.mc-button.is-active,.mc-button:active{background-color:#161cb6}.mc-button:disabled,.mc-button.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button .mc-button__icon:first-child,.mc-button .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button.is-focus,.mc-button:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-button--s{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s .mc-button__icon:first-child,.mc-button--s .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m .mc-button__icon:first-child,.mc-button--m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l .mc-button__icon{width:2rem;height:2rem}.mc-button--l .mc-button__icon:first-child,.mc-button--l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:0;padding:0}.mc-button__icon{-ms-flex-negative:0;flex-shrink:0}.mc-button__icon:last-child{margin-left:0.5rem;margin-right:-0.25rem}.mc-button__icon:first-child{margin-right:0.5rem;margin-left:-0.25rem}.mc-button__icon:only-child{margin:0}.mc-button__label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;pointer-events:none}.mc-button--solid-primary-02{background-color:#ff5800}.mc-button--solid-primary-02.is-hover,.mc-button--solid-primary-02:hover{background-color:#b83f00}.mc-button--solid-primary-02.is-active,.mc-button--solid-primary-02:active{background-color:#421700}.mc-button--solid-primary-02:disabled,.mc-button--solid-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-neutral{background-color:#333333}.mc-button--solid-neutral.is-hover,.mc-button--solid-neutral:hover{background-color:#191919}.mc-button--solid-neutral.is-active,.mc-button--solid-neutral:active{background-color:#333333}.mc-button--solid-neutral:disabled,.mc-button--solid-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-danger{background-color:#c61112}.mc-button--solid-danger.is-hover,.mc-button--solid-danger:hover{background-color:#8c0003}.mc-button--solid-danger.is-active,.mc-button--solid-danger:active{background-color:#8c0003}.mc-button--solid-danger:disabled,.mc-button--solid-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered{color:#120949;border-color:#120949;background-color:#ffffff}.mc-button--bordered.is-hover,.mc-button--bordered:hover{background-color:#e5e7fa;color:#161cb6}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#b8bef4;color:#130f7b}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#b8bef4;color:#130f7b}.mc-button--bordered:disabled,.mc-button--bordered.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-primary-02{color:#ff5800;border-color:#ff5800;background-color:#ffffff}.mc-button--bordered-primary-02.is-hover,.mc-button--bordered-primary-02:hover{background-color:#ffe1d1;color:#ff5800}.mc-button--bordered-primary-02.is-active,.mc-button--bordered-primary-02:active{background-color:#ffab80}.mc-button--bordered-primary-02:disabled,.mc-button--bordered-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-neutral{color:#333333;border-color:#333333;background-color:#ffffff}.mc-button--bordered-neutral.is-hover,.mc-button--bordered-neutral:hover{background-color:#e6e6e6;color:#333333}.mc-button--bordered-neutral.is-active,.mc-button--bordered-neutral:active{background-color:#cccccc}.mc-button--bordered-neutral:disabled,.mc-button--bordered-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-danger{color:#c61112;border-color:#c61112;background-color:#ffffff}.mc-button--bordered-danger.is-hover,.mc-button--bordered-danger:hover{background-color:#fdeaea;color:#8c0003}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger:disabled,.mc-button--bordered-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}@media screen and (min-width: 680px){.mc-button--s\\@from-m{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-m .mc-button__icon:first-child,.mc-button--s\\@from-m .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-m .mc-button__icon:first-child,.mc-button--m\\@from-m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-m{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-m .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-m .mc-button__icon:first-child,.mc-button--l\\@from-m .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-m{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-m{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-m{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1024px){.mc-button--s\\@from-l{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-l .mc-button__icon:first-child,.mc-button--s\\@from-l .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-l{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-l .mc-button__icon:first-child,.mc-button--m\\@from-l .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-l .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-l .mc-button__icon:first-child,.mc-button--l\\@from-l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-l{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-l{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-l{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{padding:0}}@media screen and (min-width: 1280px){.mc-button--s\\@from-xl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xl .mc-button__icon:first-child,.mc-button--s\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl .mc-button__icon:first-child,.mc-button--m\\@from-xl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xl .mc-button__icon:first-child,.mc-button--l\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1920px){.mc-button--s\\@from-xxl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xxl .mc-button__icon:first-child,.mc-button--s\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl .mc-button__icon:first-child,.mc-button--m\\@from-xxl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xxl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xxl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xxl .mc-button__icon:first-child,.mc-button--l\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xxl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xxl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xxl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}.mc-button__icon{pointer-events:none}',this.shadowRoot.appendChild(m),o(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},I,Z,r,{bordered:0,theme:1,size:2,full:3,label:4,iconname:5,iconmode:6,disabled:7,responsivesize:16,responsivewidth:17,type:8,loader:18},null),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),n()))}static get observedAttributes(){return["bordered","theme","size","full","label","iconname","iconmode","disabled","responsivesize","responsivewidth","type","loader"]}get bordered(){return this.$$.ctx[0]}set bordered(t){this.$$set({bordered:t}),n()}get theme(){return this.$$.ctx[1]}set theme(t){this.$$set({theme:t}),n()}get size(){return this.$$.ctx[2]}set size(t){this.$$set({size:t}),n()}get full(){return this.$$.ctx[3]}set full(t){this.$$set({full:t}),n()}get label(){return this.$$.ctx[4]}set label(t){this.$$set({label:t}),n()}get iconname(){return this.$$.ctx[5]}set iconname(t){this.$$set({iconname:t}),n()}get iconmode(){return this.$$.ctx[6]}set iconmode(t){this.$$set({iconmode:t}),n()}get disabled(){return this.$$.ctx[7]}set disabled(t){this.$$set({disabled:t}),n()}get responsivesize(){return this.$$.ctx[16]}set responsivesize(t){this.$$set({responsivesize:t}),n()}get responsivewidth(){return this.$$.ctx[17]}set responsivewidth(t){this.$$set({responsivewidth:t}),n()}get type(){return this.$$.ctx[8]}set type(t){this.$$set({type:t}),n()}get loader(){return this.$$.ctx[18]}set loader(t){this.$$set({loader:t}),n()}}export{P as default};
1
+ import{S as t,i as o,a as e,b as i,f as n,s as r,c as m,e as c,d as l,n as d,h as a,z as s,j as b,B as u,C as h,D as f,E as g,m as p,o as x,p as w,r as _,q as $,g as y,M as v,Z as k,K as z,x as j,A as q,G as C,t as E,k as N}from"../../index-c33b3772.js";import{c as A}from"../../EventForward-8492ff62.js";import L from"../loader/Loader.nested.js";function M(t){let o,e,n,r;const m=[R,O],l=[];function d(t,o){return t[13]&&"left"===t[12]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),y(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(v(),f(l[r],1,1,(()=>{l[r]=null})),g(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),h(n,1),n.m(o,null))},i(t){r||(h(n),r=!0)},o(t){f(n),r=!1},d(t){t&&x(o),l[e].d()}}}function O(t){let o,e,n=`<${P(t[2],t[6],t[5])} />`;return{c(){o=new k(!1),e=z(),o.a=e},m(t,r){o.m(n,t,r),i(t,e,r)},p(t,e){100&e&&n!==(n=`<${P(t[2],t[6],t[5])} />`)&&o.p(n)},i:d,o:d,d(t){t&&x(e),t&&o.d()}}}function R(t){let o,e;return o=new L({props:{size:"s",theme:t[11],text:""}}),{c(){j(o.$$.fragment)},m(t,i){q(o,t,i),e=!0},p(t,e){const i={};2048&e&&(i.theme=t[11]),o.$set(i)},i(t){e||(h(o.$$.fragment,t),e=!0)},o(t){f(o.$$.fragment,t),e=!1},d(t){C(o,t)}}}function S(t){let o,e,n,r,m,d,a=t[13]&&"left"===t[12]&&!t[5]&&D(t),s=t[13]&&"right"===t[12]&&!t[5]&&F(t);return{c(){a&&a.c(),o=l(),e=c("span"),n=E(t[4]),r=l(),s&&s.c(),m=z(),y(e,"class","mc-button__label")},m(t,c){a&&a.m(t,c),i(t,o,c),i(t,e,c),b(e,n),i(t,r,c),s&&s.m(t,c),i(t,m,c),d=!0},p(t,e){t[13]&&"left"===t[12]&&!t[5]?a?(a.p(t,e),12320&e&&h(a,1)):(a=D(t),a.c(),h(a,1),a.m(o.parentNode,o)):a&&(v(),f(a,1,1,(()=>{a=null})),g()),(!d||16&e)&&N(n,t[4]),t[13]&&"right"===t[12]&&!t[5]?s?(s.p(t,e),12320&e&&h(s,1)):(s=F(t),s.c(),h(s,1),s.m(m.parentNode,m)):s&&(v(),f(s,1,1,(()=>{s=null})),g())},i(t){d||(h(a),h(s),d=!0)},o(t){f(a),f(s),d=!1},d(t){a&&a.d(t),t&&x(o),t&&x(e),t&&x(r),s&&s.d(t),t&&x(m)}}}function B(t){let o,e,n,r;const m=[J,G],l=[];function d(t,o){return t[13]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),y(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(v(),f(l[r],1,1,(()=>{l[r]=null})),g(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),h(n,1),n.m(o,null))},i(t){r||(h(n),r=!0)},o(t){f(n),r=!1},d(t){t&&x(o),l[e].d()}}}function D(t){let o,e,n;return e=new L({props:{size:"s",theme:t[11],text:""}}),{c(){o=c("span"),j(e.$$.fragment),y(o,"class","mc-button__icon")},m(t,r){i(t,o,r),q(e,o,null),n=!0},p(t,o){const i={};2048&o&&(i.theme=t[11]),e.$set(i)},i(t){n||(h(e.$$.fragment,t),n=!0)},o(t){f(e.$$.fragment,t),n=!1},d(t){t&&x(o),C(e)}}}function F(t){let o,e,n;return e=new L({props:{size:"s",theme:t[11],text:""}}),{c(){o=c("span"),j(e.$$.fragment),y(o,"class","mc-button__icon")},m(t,r){i(t,o,r),q(e,o,null),n=!0},p(t,o){const i={};2048&o&&(i.theme=t[11]),e.$set(i)},i(t){n||(h(e.$$.fragment,t),n=!0)},o(t){f(e.$$.fragment,t),n=!1},d(t){t&&x(o),C(e)}}}function G(t){let o,e,n=`<${P(t[2],t[6],t[5])} size="100%" />`;return{c(){o=new k(!1),e=z(),o.a=e},m(t,r){o.m(n,t,r),i(t,e,r)},p(t,e){100&e&&n!==(n=`<${P(t[2],t[6],t[5])} size="100%" />`)&&o.p(n)},i:d,o:d,d(t){t&&x(e),t&&o.d()}}}function J(t){let o,e;return o=new L({props:{size:"m",theme:t[11],text:""}}),{c(){j(o.$$.fragment)},m(t,i){q(o,t,i),e=!0},p(t,e){const i={};2048&e&&(i.theme=t[11]),o.$set(i)},i(t){e||(h(o.$$.fragment,t),e=!0)},o(t){f(o.$$.fragment,t),e=!1},d(t){C(o,t)}}}function K(t){let o,e,n,r;const m=[H,Z],l=[];function d(t,o){return t[13]&&"right"===t[12]?0:1}return e=d(t),n=l[e]=m[e](t),{c(){o=c("span"),n.c(),y(o,"class","mc-button__icon")},m(t,n){i(t,o,n),l[e].m(o,null),r=!0},p(t,i){let r=e;e=d(t),e===r?l[e].p(t,i):(v(),f(l[r],1,1,(()=>{l[r]=null})),g(),n=l[e],n?n.p(t,i):(n=l[e]=m[e](t),n.c()),h(n,1),n.m(o,null))},i(t){r||(h(n),r=!0)},o(t){f(n),r=!1},d(t){t&&x(o),l[e].d()}}}function Z(t){let o,e,n=`<${P(t[2],t[6],t[5])} />`;return{c(){o=new k(!1),e=z(),o.a=e},m(t,r){o.m(n,t,r),i(t,e,r)},p(t,e){100&e&&n!==(n=`<${P(t[2],t[6],t[5])} />`)&&o.p(n)},i:d,o:d,d(t){t&&x(e),t&&o.d()}}}function H(t){let o,e;return o=new L({props:{size:"s",theme:t[11],text:""}}),{c(){j(o.$$.fragment)},m(t,i){q(o,t,i),e=!0},p(t,e){const i={};2048&e&&(i.theme=t[11]),o.$set(i)},i(t){e||(h(o.$$.fragment,t),e=!0)},o(t){f(o.$$.fragment,t),e=!1},d(t){C(o,t)}}}function I(t){let o,e,n,r,w,_,$,y,k,z=t[5]&&"left"===t[6]&&M(t);const j=[B,S],q=[];function C(t,o){return t[5]&&"only"===t[6]?0:1}n=C(t),r=q[n]=j[n](t);let E=t[5]&&"right"===t[6]&&K(t),N=[{type:t[8]},{class:_=t[15](t[1],t[0],t[2],t[3])+" "+t[10]},{disabled:t[7]},t[9]],A={};for(let t=0;t<N.length;t+=1)A=m(A,N[t]);return{c(){o=c("button"),z&&z.c(),e=l(),r.c(),w=l(),E&&E.c(),this.c=d,a(o,A),s(o,"mc-button--square",t[6])},m(r,m){i(r,o,m),z&&z.m(o,null),b(o,e),q[n].m(o,null),b(o,w),E&&E.m(o,null),o.autofocus&&o.focus(),$=!0,y||(k=u(t[14].call(null,o)),y=!0)},p(t,[i]){t[5]&&"left"===t[6]?z?(z.p(t,i),96&i&&h(z,1)):(z=M(t),z.c(),h(z,1),z.m(o,e)):z&&(v(),f(z,1,1,(()=>{z=null})),g());let m=n;n=C(t),n===m?q[n].p(t,i):(v(),f(q[m],1,1,(()=>{q[m]=null})),g(),r=q[n],r?r.p(t,i):(r=q[n]=j[n](t),r.c()),h(r,1),r.m(o,w)),t[5]&&"right"===t[6]?E?(E.p(t,i),96&i&&h(E,1)):(E=K(t),E.c(),h(E,1),E.m(o,null)):E&&(v(),f(E,1,1,(()=>{E=null})),g()),a(o,A=p(N,[(!$||256&i)&&{type:t[8]},(!$||1039&i&&_!==(_=t[15](t[1],t[0],t[2],t[3])+" "+t[10]))&&{class:_},(!$||128&i)&&{disabled:t[7]},512&i&&t[9]])),s(o,"mc-button--square",t[6])},i(t){$||(h(z),h(r),h(E),$=!0)},o(t){f(z),f(r),f(E),$=!1},d(t){t&&x(o),z&&z.d(),q[n].d(),E&&E.d(),y=!1,k()}}}function P(t,o,e){const i="only"===o;let n;switch(t){case"s":n="24px";break;case"m":n=i?"32px":"24px";break;case"l":n=i?"100%":"32px"}return`${e} size="${n}" class="no"`}function Q(t,o,e){let i,n,r,c,l,d;const a=["bordered","theme","size","full","label","iconname","iconmode","disabled","responsivesize","responsivewidth","type","loader"];let s=w(o,a);var b,u,h;let{bordered:f=!1}=o,{theme:g}=o,{size:p="m"}=o,{full:x=!1}=o,{label:y}=o,{iconname:v}=o,{iconmode:k}=o,{disabled:z=!1}=o,{responsivesize:j}=o,{responsivewidth:q}=o,{type:C="button"}=o,{loader:E}=o;const N=A(_());return t.$$set=t=>{e(24,o=m(m({},o),$(t))),e(23,s=w(o,a)),"bordered"in t&&e(0,f=t.bordered),"theme"in t&&e(1,g=t.theme),"size"in t&&e(2,p=t.size),"full"in t&&e(3,x=t.full),"label"in t&&e(4,y=t.label),"iconname"in t&&e(5,v=t.iconname),"iconmode"in t&&e(6,k=t.iconmode),"disabled"in t&&e(7,z=t.disabled),"responsivesize"in t&&e(16,j=t.responsivesize),"responsivewidth"in t&&e(17,q=t.responsivewidth),"type"in t&&e(8,C=t.type),"loader"in t&&e(18,E=t.loader)},t.$$.update=()=>{262144&t.$$.dirty&&e(22,i=E?JSON.parse(E):void 0),4718592&t.$$.dirty&&e(13,n=null!==e(19,b=null==i?void 0:i.enabled)&&void 0!==b&&b),5242880&t.$$.dirty&&e(12,r=null!==e(20,u=null==i?void 0:i.position)&&void 0!==u?u:"left"),6291456&t.$$.dirty&&e(11,c=null!==e(21,h=null==i?void 0:i.theme)&&void 0!==h?h:"primary"),e(10,l=o.class),e(9,d=Object.assign({},s)),512&t.$$.dirty&&delete d.class},o=$(o),[f,g,p,x,y,v,k,z,C,d,l,c,r,n,N,function(t,o,e,i){const n=["mc-button"],r=function(t,o){if(!o&&!t)return"";const e=o?"bordered":"solid";return t?`mc-button--${e}-${t}`:`mc-button--${e}`}(t,o);return r&&n.push(r),e&&n.push(`mc-button--${e}`),i?n.push("mc-button--full"):n.push("mc-button--fit"),"only"===k&&n.push("mc-button--square"),j&&n.push(`mc-button--${j}`),q&&n.push(`mc-button--${q}`),n.join(" ")},j,q,E,b,u,h,i]}class T extends t{constructor(t){super();const m=document.createElement("style");m.textContent='.mc-button{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;color:#ffffff;background-color:#120949;font-family:"LeroyMerlin", sans-serif;font-weight:600;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;fill:currentColor}.mc-button.is-hover,.mc-button:hover{background-color:#161cb6;color:#ffffff}.mc-button.is-active,.mc-button:active{background-color:#161cb6}.mc-button:disabled,.mc-button.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button .mc-button__icon:first-child,.mc-button .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button.is-focus,.mc-button:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-button--s{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s .mc-button__icon:first-child,.mc-button--s .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m .mc-button__icon:first-child,.mc-button--m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l .mc-button__icon{width:2rem;height:2rem}.mc-button--l .mc-button__icon:first-child,.mc-button--l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:0;padding:0}.mc-button__icon{-ms-flex-negative:0;flex-shrink:0}.mc-button__icon:last-child{margin-left:0.5rem;margin-right:-0.25rem}.mc-button__icon:first-child{margin-right:0.5rem;margin-left:-0.25rem}.mc-button__icon:only-child{margin:0}.mc-button__label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;pointer-events:none}.mc-button--solid-primary-02{background-color:#ff5800}.mc-button--solid-primary-02.is-hover,.mc-button--solid-primary-02:hover{background-color:#b83f00}.mc-button--solid-primary-02.is-active,.mc-button--solid-primary-02:active{background-color:#421700}.mc-button--solid-primary-02:disabled,.mc-button--solid-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-neutral{background-color:#333333}.mc-button--solid-neutral.is-hover,.mc-button--solid-neutral:hover{background-color:#191919}.mc-button--solid-neutral.is-active,.mc-button--solid-neutral:active{background-color:#333333}.mc-button--solid-neutral:disabled,.mc-button--solid-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--solid-danger{background-color:#c61112}.mc-button--solid-danger.is-hover,.mc-button--solid-danger:hover{background-color:#8c0003}.mc-button--solid-danger.is-active,.mc-button--solid-danger:active{background-color:#8c0003}.mc-button--solid-danger:disabled,.mc-button--solid-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered{color:#120949;border-color:#120949;background-color:#ffffff}.mc-button--bordered.is-hover,.mc-button--bordered:hover{background-color:#e5e7fa;color:#161cb6}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#b8bef4;color:#130f7b}.mc-button--bordered.is-active,.mc-button--bordered:active{background-color:#b8bef4;color:#130f7b}.mc-button--bordered:disabled,.mc-button--bordered.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-primary-02{color:#ff5800;border-color:#ff5800;background-color:#ffffff}.mc-button--bordered-primary-02.is-hover,.mc-button--bordered-primary-02:hover{background-color:#ffe1d1;color:#ff5800}.mc-button--bordered-primary-02.is-active,.mc-button--bordered-primary-02:active{background-color:#ffab80}.mc-button--bordered-primary-02:disabled,.mc-button--bordered-primary-02.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-neutral{color:#333333;border-color:#333333;background-color:#ffffff}.mc-button--bordered-neutral.is-hover,.mc-button--bordered-neutral:hover{background-color:#e6e6e6;color:#333333}.mc-button--bordered-neutral.is-active,.mc-button--bordered-neutral:active{background-color:#cccccc}.mc-button--bordered-neutral:disabled,.mc-button--bordered-neutral.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-button--bordered-danger{color:#c61112;border-color:#c61112;background-color:#ffffff}.mc-button--bordered-danger.is-hover,.mc-button--bordered-danger:hover{background-color:#fdeaea;color:#8c0003}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger.is-active,.mc-button--bordered-danger:active{background-color:#f8bcbb;color:#530000}.mc-button--bordered-danger:disabled,.mc-button--bordered-danger.is-disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}@media screen and (min-width: 680px){.mc-button--s\\@from-m{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-m .mc-button__icon:first-child,.mc-button--s\\@from-m .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-m{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-m .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-m .mc-button__icon:first-child,.mc-button--m\\@from-m .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-m{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-m .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-m .mc-button__icon:first-child,.mc-button--l\\@from-m .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-m .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-m{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-m{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-m{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1024px){.mc-button--s\\@from-l{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-l .mc-button__icon:first-child,.mc-button--s\\@from-l .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-l{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-l .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-l .mc-button__icon:first-child,.mc-button--m\\@from-l .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-l{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-l .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-l .mc-button__icon:first-child,.mc-button--l\\@from-l .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-l .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-l{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-l{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-l{width:-webkit-fill-available;width:-moz-available;width:stretch}}.mc-button--square{padding:0}}@media screen and (min-width: 1280px){.mc-button--s\\@from-xl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xl .mc-button__icon:first-child,.mc-button--s\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xl .mc-button__icon:first-child,.mc-button--m\\@from-xl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xl .mc-button__icon:first-child,.mc-button--l\\@from-xl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}@media screen and (min-width: 1920px){.mc-button--s\\@from-xxl{font-size:0.875rem;line-height:1.2857142857;padding:0.3125rem 1rem;min-height:2rem;min-width:2rem}.mc-button--s\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--s\\@from-xxl .mc-button__icon:first-child,.mc-button--s\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.1875rem;margin-top:-0.1875rem}.mc-button--s\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl{font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem}.mc-button--m\\@from-xxl .mc-button__icon{width:1.5rem;height:1.5rem}.mc-button--m\\@from-xxl .mc-button__icon:first-child,.mc-button--m\\@from-xxl .mc-button__icon:last-child{margin-bottom:-1px;margin-top:-1px}.mc-button--m\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--l\\@from-xxl{font-size:1.125rem;line-height:1.3333333333;padding:0.875rem 1.5rem;min-height:3.5rem;min-width:3.5rem}.mc-button--l\\@from-xxl .mc-button__icon{width:2rem;height:2rem}.mc-button--l\\@from-xxl .mc-button__icon:first-child,.mc-button--l\\@from-xxl .mc-button__icon:last-child{margin-bottom:-0.25rem;margin-top:-0.25rem}.mc-button--l\\@from-xxl .mc-button__icon:only-child{margin-bottom:0;margin-top:0;width:2rem;height:2rem}.mc-button--fit\\@from-xxl{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:auto}.mc-button--full\\@from-xxl{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}@supports (width: -webkit-fill-available) or (width: -moz-available) or (width: stretch){.mc-button--full\\@from-xxl{width:-webkit-fill-available;width:-moz-available;width:stretch}}}.mc-button__icon{pointer-events:none}',this.shadowRoot.appendChild(m),o(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},Q,I,r,{bordered:0,theme:1,size:2,full:3,label:4,iconname:5,iconmode:6,disabled:7,responsivesize:16,responsivewidth:17,type:8,loader:18},null),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),n()))}static get observedAttributes(){return["bordered","theme","size","full","label","iconname","iconmode","disabled","responsivesize","responsivewidth","type","loader"]}get bordered(){return this.$$.ctx[0]}set bordered(t){this.$$set({bordered:t}),n()}get theme(){return this.$$.ctx[1]}set theme(t){this.$$set({theme:t}),n()}get size(){return this.$$.ctx[2]}set size(t){this.$$set({size:t}),n()}get full(){return this.$$.ctx[3]}set full(t){this.$$set({full:t}),n()}get label(){return this.$$.ctx[4]}set label(t){this.$$set({label:t}),n()}get iconname(){return this.$$.ctx[5]}set iconname(t){this.$$set({iconname:t}),n()}get iconmode(){return this.$$.ctx[6]}set iconmode(t){this.$$set({iconmode:t}),n()}get disabled(){return this.$$.ctx[7]}set disabled(t){this.$$set({disabled:t}),n()}get responsivesize(){return this.$$.ctx[16]}set responsivesize(t){this.$$set({responsivesize:t}),n()}get responsivewidth(){return this.$$.ctx[17]}set responsivewidth(t){this.$$set({responsivewidth:t}),n()}get type(){return this.$$.ctx[8]}set type(t){this.$$set({type:t}),n()}get loader(){return this.$$.ctx[18]}set loader(t){this.$$set({loader:t}),n()}}export{T as default};
2
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../src/components/button/Button.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { get_current_component } from 'svelte/internal';\n import { createEventForwarder } from '../../utilities/EventForward';\n import Loader from '../loader/Loader.nested.svelte';\n import type {\n ButtonIconMode,\n ButtonSize,\n ButtonTheme,\n ButtonResponsiveSize,\n ButtonResponsiveWidth,\n ButtonType,\n ButtonLoader,\n } from './button.types';\n\n export let bordered = false;\n export let theme: ButtonTheme | undefined = undefined;\n export let size: ButtonSize = 'm';\n export let full = false;\n export let label: string;\n export let iconname: string | undefined;\n export let iconmode: ButtonIconMode | undefined;\n export let disabled = false;\n export let responsivesize: ButtonResponsiveSize = undefined;\n export let responsivewidth: ButtonResponsiveWidth = undefined;\n export let type: ButtonType = 'button';\n export let loader: string;\n\n const forwardEvents = createEventForwarder(get_current_component());\n\n $: loaderOpts = loader ? (JSON.parse(loader) as ButtonLoader) : undefined;\n $: isLoading = loaderOpts?.enabled ?? false;\n $: loaderPosition = loaderOpts?.position ?? 'left';\n $: loaderTheme = loaderOpts?.theme ?? 'primary';\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n function generateIconName(\n size: ButtonSize,\n iconMode: ButtonIconMode,\n iconName: string,\n ): string {\n const isIconOnly = iconMode === 'only';\n let iconSize: string;\n\n switch (size) {\n case 's':\n iconSize = '24px';\n break;\n case 'm':\n iconSize = isIconOnly ? '32px' : '24px';\n break;\n case 'l':\n iconSize = isIconOnly ? '100%' : '32px';\n break;\n }\n\n return `${iconName} size=\"${iconSize}\" class=\"no\"`;\n }\n\n function getAppearanceClass(theme: ButtonTheme, isBordered: boolean): string {\n if (!isBordered && !theme) {\n return '';\n }\n\n const type = isBordered ? 'bordered' : 'solid';\n\n if (theme) {\n return `mc-button--${type}-${theme}`;\n }\n return `mc-button--${type}`;\n }\n\n function getClasses(\n theme: ButtonTheme,\n isBordered: boolean,\n size: ButtonSize,\n isFull: boolean,\n ): string {\n const classes = ['mc-button'];\n\n const appearanceClass = getAppearanceClass(theme, isBordered);\n if (appearanceClass) {\n classes.push(appearanceClass);\n }\n\n if (size) {\n classes.push(`mc-button--${size}`);\n }\n\n if (isFull) {\n classes.push(`mc-button--full`);\n } else {\n classes.push(`mc-button--fit`);\n }\n\n if (iconmode === 'only') {\n classes.push('mc-button--square');\n }\n\n if (responsivesize) {\n classes.push(`mc-button--${responsivesize}`);\n }\n\n if (responsivewidth) {\n classes.push(`mc-button--${responsivewidth}`);\n }\n\n return classes.join(' ');\n }\n</script>\n\n<button\n use:forwardEvents\n {type}\n class=\"{getClasses(theme, bordered, size, full)} {userClass}\"\n {disabled}\n {...attributes}\n>\n {#if iconname && iconmode === 'left'}\n <span class=\"mc-button__icon\">\n {#if isLoading && loaderPosition === 'left'}\n <Loader size=\"s\" theme={loaderTheme} text=\"TEST\" />\n {:else}\n {@html `<${generateIconName(size, iconmode, iconname)} />`}\n {/if}\n </span>\n {/if}\n\n {#if iconname && iconmode === 'only'}\n <span class=\"mc-button__icon\">\n {#if isLoading}\n <Loader size=\"m\" theme={loaderTheme} text=\"\" />\n {:else}\n {@html `<${generateIconName(size, iconmode, iconname)} size=\"100%\" />`}\n {/if}\n </span>\n {:else}\n {#if isLoading && loaderPosition === 'left' && !iconname}\n <span class=\"mc-button__icon\">\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n </span>\n {/if}\n <span class=\"mc-button__label\">{label}</span>\n {#if isLoading && loaderPosition === 'right' && !iconname}\n <span class=\"mc-button__icon\">\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n </span>\n {/if}\n {/if}\n\n {#if iconname && iconmode === 'right'}\n <span class=\"mc-button__icon\">\n {#if isLoading && loaderPosition === 'right'}\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n {:else}\n {@html `<${generateIconName(size, iconmode, iconname)} />`}\n {/if}\n </span>\n {/if}\n</button>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.button';\n\n .mc-button__icon {\n pointer-events: none;\n }\n</style>\n"],"names":["ctx","insert","target","span","anchor","raw_value","generateIconName","dirty","html_tag","p","if_block0","create_if_block_5","if_block1","create_if_block_4","create_if_block_6","create_if_block","button","class","button_class_value","size","iconMode","iconName","isIconOnly","iconSize","_a","_b","_c","bordered","$$props","theme","full","label","iconname","iconmode","disabled","responsivesize","responsivewidth","type","loader","forwardEvents","createEventForwarder","get_current_component","$$invalidate","loaderOpts","JSON","parse","undefined","isLoading","enabled","loaderPosition","position","loaderTheme","userClass","attributes","Object","assign","$$restProps","isBordered","isFull","classes","appearanceClass","getAppearanceClass","push","join"],"mappings":"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"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../src/components/button/Button.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { get_current_component } from 'svelte/internal';\n import { createEventForwarder } from '../../utilities/EventForward';\n import Loader from '../loader/Loader.nested.svelte';\n import type {\n ButtonIconMode,\n ButtonSize,\n ButtonTheme,\n ButtonResponsiveSize,\n ButtonResponsiveWidth,\n ButtonType,\n ButtonLoader,\n } from './button.types';\n\n export let bordered = false;\n export let theme: ButtonTheme | undefined = undefined;\n export let size: ButtonSize = 'm';\n export let full = false;\n export let label: string;\n export let iconname: string | undefined;\n export let iconmode: ButtonIconMode | undefined;\n export let disabled = false;\n export let responsivesize: ButtonResponsiveSize = undefined;\n export let responsivewidth: ButtonResponsiveWidth = undefined;\n export let type: ButtonType = 'button';\n export let loader: string;\n\n const forwardEvents = createEventForwarder(get_current_component());\n\n $: loaderOpts = loader ? (JSON.parse(loader) as ButtonLoader) : undefined;\n $: isLoading = loaderOpts?.enabled ?? false;\n $: loaderPosition = loaderOpts?.position ?? 'left';\n $: loaderTheme = loaderOpts?.theme ?? 'primary';\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n function generateIconName(\n size: ButtonSize,\n iconMode: ButtonIconMode,\n iconName: string,\n ): string {\n const isIconOnly = iconMode === 'only';\n let iconSize: string;\n\n switch (size) {\n case 's':\n iconSize = '24px';\n break;\n case 'm':\n iconSize = isIconOnly ? '32px' : '24px';\n break;\n case 'l':\n iconSize = isIconOnly ? '100%' : '32px';\n break;\n }\n\n return `${iconName} size=\"${iconSize}\" class=\"no\"`;\n }\n\n function getAppearanceClass(theme: ButtonTheme, isBordered: boolean): string {\n if (!isBordered && !theme) {\n return '';\n }\n\n const type = isBordered ? 'bordered' : 'solid';\n\n if (theme) {\n return `mc-button--${type}-${theme}`;\n }\n return `mc-button--${type}`;\n }\n\n function getClasses(\n theme: ButtonTheme,\n isBordered: boolean,\n size: ButtonSize,\n isFull: boolean,\n ): string {\n const classes = ['mc-button'];\n\n const appearanceClass = getAppearanceClass(theme, isBordered);\n if (appearanceClass) {\n classes.push(appearanceClass);\n }\n\n if (size) {\n classes.push(`mc-button--${size}`);\n }\n\n if (isFull) {\n classes.push(`mc-button--full`);\n } else {\n classes.push(`mc-button--fit`);\n }\n\n if (iconmode === 'only') {\n classes.push('mc-button--square');\n }\n\n if (responsivesize) {\n classes.push(`mc-button--${responsivesize}`);\n }\n\n if (responsivewidth) {\n classes.push(`mc-button--${responsivewidth}`);\n }\n\n return classes.join(' ');\n }\n</script>\n\n<button\n use:forwardEvents\n {type}\n class=\"{getClasses(theme, bordered, size, full)} {userClass}\"\n class:mc-button--square={iconmode}\n {disabled}\n {...attributes}\n>\n {#if iconname && iconmode === 'left'}\n <span class=\"mc-button__icon\">\n {#if isLoading && loaderPosition === 'left'}\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n {:else}\n {@html `<${generateIconName(size, iconmode, iconname)} />`}\n {/if}\n </span>\n {/if}\n\n {#if iconname && iconmode === 'only'}\n <span class=\"mc-button__icon\">\n {#if isLoading}\n <Loader size=\"m\" theme={loaderTheme} text=\"\" />\n {:else}\n {@html `<${generateIconName(size, iconmode, iconname)} size=\"100%\" />`}\n {/if}\n </span>\n {:else}\n {#if isLoading && loaderPosition === 'left' && !iconname}\n <span class=\"mc-button__icon\">\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n </span>\n {/if}\n <span class=\"mc-button__label\">{label}</span>\n {#if isLoading && loaderPosition === 'right' && !iconname}\n <span class=\"mc-button__icon\">\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n </span>\n {/if}\n {/if}\n\n {#if iconname && iconmode === 'right'}\n <span class=\"mc-button__icon\">\n {#if isLoading && loaderPosition === 'right'}\n <Loader size=\"s\" theme={loaderTheme} text=\"\" />\n {:else}\n {@html `<${generateIconName(size, iconmode, iconname)} />`}\n {/if}\n </span>\n {/if}\n</button>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.button';\n\n .mc-button__icon {\n pointer-events: none;\n }\n</style>\n"],"names":["ctx","insert","target","span","anchor","raw_value","generateIconName","dirty","html_tag","p","if_block0","create_if_block_5","if_block1","create_if_block_4","create_if_block_6","create_if_block","button","class","button_class_value","size","iconMode","iconName","isIconOnly","iconSize","_a","_b","_c","bordered","$$props","theme","full","label","iconname","iconmode","disabled","responsivesize","responsivewidth","type","loader","forwardEvents","createEventForwarder","get_current_component","$$invalidate","loaderOpts","JSON","parse","undefined","isLoading","enabled","loaderPosition","position","loaderTheme","userClass","attributes","Object","assign","$$restProps","isBordered","isFull","classes","appearanceClass","getAppearanceClass","push","join"],"mappings":"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"}
@@ -116,13 +116,14 @@
116
116
  use:forwardEvents
117
117
  {type}
118
118
  class="{getClasses(theme, bordered, size, full)} {userClass}"
119
+ class:mc-button--square={iconmode}
119
120
  {disabled}
120
121
  {...attributes}
121
122
  >
122
123
  {#if iconname && iconmode === 'left'}
123
124
  <span class="mc-button__icon">
124
125
  {#if isLoading && loaderPosition === 'left'}
125
- <Loader size="s" theme={loaderTheme} text="TEST" />
126
+ <Loader size="s" theme={loaderTheme} text="" />
126
127
  {:else}
127
128
  {@html `<${generateIconName(size, iconmode, iconname)} />`}
128
129
  {/if}
@@ -1,2 +1,2 @@
1
- import{S as e,i,a as c,b as t,f as n,s as o,c as a,e as r,d as s,n as l,g as d,h as m,j as h,B as b,l as p,I as f,m as u,o as k,H as _,p as x,r as g,q as v,t as w,k as $}from"../../index-c33b3772.js";import{E as y}from"../../EventHandler-02058705.js";import{c as E}from"../../EventForward-8492ff62.js";function C(e){let i,c;return{c(){i=r("label"),c=w(e[5]),d(i,"for",e[0]),d(i,"class","mc-checkbox__label")},m(e,n){t(e,i,n),h(i,c)},p(e,t){32&t&&$(c,e[5]),1&t&&d(i,"for",e[0])},d(e){e&&k(i)}}}function z(e){let i,c,n,o,x,g,v,w=e[5]&&C(e),$=[{class:x="mc-checkbox "+e[7]},e[6]],y={};for(let e=0;e<$.length;e+=1)y=a(y,$[e]);return{c(){i=r("div"),c=r("input"),o=s(),w&&w.c(),this.c=l,d(c,"id",e[0]),d(c,"type","checkbox"),d(c,"class",n="mc-checkbox__input "+(e[4]?" is-invalid":"")),d(c,"aria-invalid",e[4]),d(c,"name",e[0]),c.checked=e[1],c.disabled=e[3],c.indeterminate=e[2],m(i,y)},m(n,a){t(n,i,a),h(i,c),h(i,o),w&&w.m(i,null),g||(v=[b(e[8].call(null,c)),p(c,"change",f(e[9]))],g=!0)},p(e,[t]){1&t&&d(c,"id",e[0]),16&t&&n!==(n="mc-checkbox__input "+(e[4]?" is-invalid":""))&&d(c,"class",n),16&t&&d(c,"aria-invalid",e[4]),1&t&&d(c,"name",e[0]),2&t&&(c.checked=e[1]),8&t&&(c.disabled=e[3]),4&t&&(c.indeterminate=e[2]),e[5]?w?w.p(e,t):(w=C(e),w.c(),w.m(i,null)):w&&(w.d(1),w=null),m(i,y=u($,[128&t&&x!==(x="mc-checkbox "+e[7])&&{class:x},64&t&&e[6]]))},i:l,o:l,d(e){e&&k(i),w&&w.d(),g=!1,_(v)}}}function j(e,i,c){let t,n,o;const r=["name","checked","indeterminate","disabled","isinvalid","label"];let s=x(i,r),{name:l}=i,{checked:d}=i,{indeterminate:m}=i,{disabled:h=!1}=i,{isinvalid:b=!1}=i,{label:p}=i;const f=E(g());let u=new y;return e.$$set=e=>{c(13,i=a(a({},i),v(e))),c(12,s=x(i,r)),"name"in e&&c(0,l=e.name),"checked"in e&&c(1,d=e.checked),"indeterminate"in e&&c(2,m=e.indeterminate),"disabled"in e&&c(3,h=e.disabled),"isinvalid"in e&&c(4,b=e.isinvalid),"label"in e&&c(5,p=e.label)},e.$$.update=()=>{2&e.$$.dirty&&(t=!!d),c(7,n=i.class),c(6,o=Object.assign({},s)),64&e.$$.dirty&&delete o.class},i=v(i),[l,d,m,h,b,p,o,n,f,function(){t=!t,u.dispatch("change",t)}]}class B extends e{constructor(e){super();const a=document.createElement("style");a.textContent="@charset \"UTF-8\";.mc-checkbox{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.mc-checkbox__label{font-size:1rem;line-height:1.125;cursor:pointer;margin-left:0.5rem;color:#000000}.mc-checkbox__input{font-family:\"LeroyMerlin\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;min-width:20px;min-height:20px;width:1.25rem;height:1.25rem;border-radius:4px;border:2px solid #808080;background-color:#ffffff;position:relative;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;cursor:pointer}.mc-checkbox__input[type=number]::-webkit-inner-spin-button,.mc-checkbox__input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.mc-checkbox__input[type=number]{-moz-appearance:textfield}.mc-checkbox__input[type=search]::-webkit-search-decoration:hover,.mc-checkbox__input[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-checkbox__input::-ms-check{background-color:#ffffff;border:2px solid #808080;border-radius:4px;color:#ffffff}.mc-checkbox__input.is-hover,.mc-checkbox__input:hover{border-color:#191919}.mc-checkbox__input.is-hover::-ms-check,.mc-checkbox__input:hover::-ms-check{border-color:#191919}.mc-checkbox__input.is-focus,.mc-checkbox__input:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input.is-focus::-ms-check,.mc-checkbox__input:focus::-ms-check{box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input:checked,.mc-checkbox__input:indeterminate{background-color:#ff5800;border-color:#ff5800;background-size:1rem 1rem}.mc-checkbox__input:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");background-position:center center}.mc-checkbox__input:checked::-ms-check{background-color:#ff5800;border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled){border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled)::-ms-check{border-color:#ff5800}.mc-checkbox__input:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled{background-color:#e6e6e6;border-color:#e6e6e6;cursor:not-allowed}.mc-checkbox__input:disabled::-ms-check{background-color:#e6e6e6;border-color:#e6e6e6}.mc-checkbox__input:disabled:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled+.mc-checkbox__label{color:#808080}.mc-checkbox__input.is-invalid{border-color:#c61112}.mc-checkbox__input.is-invalid::-ms-check{border-color:#c61112}.mc-checkbox__input.is-invalid.is-hover,.mc-checkbox__input.is-invalid:hover{border-color:#530000}.mc-checkbox__input.is-invalid.is-hover::-ms-check,.mc-checkbox__input.is-invalid:hover::-ms-check{border-color:#530000}.mc-field__label,.mc-field__legend{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#333333}.mc-field__legend{padding-left:0;padding-right:0}.mc-field__requirement,.mc-field__help{font-size:0.75rem;line-height:1.3333333333;font-weight:400;color:#666666}.mc-field__requirement::before{content:\" - \"}.mc-field__help{display:block;margin-top:0.125rem}@media screen and (min-width: 769px){.mc-field__container--inline{display:-webkit-box;display:-ms-flexbox;display:flex}}@media screen and (min-width: 769px){}@media screen and (min-width: 1024px){}.mc-field__item:not(:last-child){margin-bottom:1rem}.mc-field__error-message{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-field--group{border:none;margin-left:0;margin-right:0;padding:0}",this.shadowRoot.appendChild(a),i(this,{target:this.shadowRoot,props:c(this.attributes),customElement:!0},j,z,o,{name:0,checked:1,indeterminate:2,disabled:3,isinvalid:4,label:5},null),e&&(e.target&&t(e.target,this,e.anchor),e.props&&(this.$set(e.props),n()))}static get observedAttributes(){return["name","checked","indeterminate","disabled","isinvalid","label"]}get name(){return this.$$.ctx[0]}set name(e){this.$$set({name:e}),n()}get checked(){return this.$$.ctx[1]}set checked(e){this.$$set({checked:e}),n()}get indeterminate(){return this.$$.ctx[2]}set indeterminate(e){this.$$set({indeterminate:e}),n()}get disabled(){return this.$$.ctx[3]}set disabled(e){this.$$set({disabled:e}),n()}get isinvalid(){return this.$$.ctx[4]}set isinvalid(e){this.$$set({isinvalid:e}),n()}get label(){return this.$$.ctx[5]}set label(e){this.$$set({label:e}),n()}}export{B as default};
1
+ import{S as e,i,a as c,b as t,f as n,s as o,c as a,e as r,d as s,n as l,g as d,h as m,j as h,B as b,l as f,I as p,m as u,o as k,H as _,p as x,r as g,q as v,t as w,k as $}from"../../index-c33b3772.js";import{E as y}from"../../EventHandler-02058705.js";import{c as E}from"../../EventForward-8492ff62.js";function C(e){let i,c;return{c(){i=r("label"),c=w(e[5]),d(i,"for",e[0]),d(i,"class","mc-checkbox__label")},m(e,n){t(e,i,n),h(i,c)},p(e,t){32&t&&$(c,e[5]),1&t&&d(i,"for",e[0])},d(e){e&&k(i)}}}function z(e){let i,c,n,o,x,g,v,w=e[5]&&C(e),$=[{class:x="mc-checkbox "+e[7]},e[6]],y={};for(let e=0;e<$.length;e+=1)y=a(y,$[e]);return{c(){i=r("div"),c=r("input"),o=s(),w&&w.c(),this.c=l,d(c,"id",e[0]),d(c,"type","checkbox"),d(c,"class",n="mc-checkbox__input "+(e[4]?" is-invalid":"")),d(c,"aria-invalid",e[4]),d(c,"name",e[0]),c.checked=e[1],c.disabled=e[3],c.indeterminate=e[2],m(i,y)},m(n,a){t(n,i,a),h(i,c),h(i,o),w&&w.m(i,null),g||(v=[b(e[8].call(null,c)),f(c,"change",p(e[9]))],g=!0)},p(e,[t]){1&t&&d(c,"id",e[0]),16&t&&n!==(n="mc-checkbox__input "+(e[4]?" is-invalid":""))&&d(c,"class",n),16&t&&d(c,"aria-invalid",e[4]),1&t&&d(c,"name",e[0]),2&t&&(c.checked=e[1]),8&t&&(c.disabled=e[3]),4&t&&(c.indeterminate=e[2]),e[5]?w?w.p(e,t):(w=C(e),w.c(),w.m(i,null)):w&&(w.d(1),w=null),m(i,y=u($,[128&t&&x!==(x="mc-checkbox "+e[7])&&{class:x},64&t&&e[6]]))},i:l,o:l,d(e){e&&k(i),w&&w.d(),g=!1,_(v)}}}function j(e,i,c){let t,n,o;const r=["name","checked","indeterminate","disabled","isinvalid","label"];let s=x(i,r),{name:l}=i,{checked:d}=i,{indeterminate:m}=i,{disabled:h=!1}=i,{isinvalid:b=!1}=i,{label:f}=i;const p=E(g());let u=new y;return e.$$set=e=>{c(13,i=a(a({},i),v(e))),c(12,s=x(i,r)),"name"in e&&c(0,l=e.name),"checked"in e&&c(1,d=e.checked),"indeterminate"in e&&c(2,m=e.indeterminate),"disabled"in e&&c(3,h=e.disabled),"isinvalid"in e&&c(4,b=e.isinvalid),"label"in e&&c(5,f=e.label)},e.$$.update=()=>{2&e.$$.dirty&&(t=!!d),c(7,n=i.class),c(6,o=Object.assign({},s)),64&e.$$.dirty&&delete o.class},i=v(i),[l,d,m,h,b,f,o,n,p,function(){t=!t,u.dispatch("change",t)}]}class B extends e{constructor(e){super();const a=document.createElement("style");a.textContent="@charset \"UTF-8\";.mc-checkbox{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.mc-checkbox__label{font-size:1rem;line-height:1.125;cursor:pointer;margin-left:0.5rem;color:#000000}.mc-checkbox__input{font-family:\"LeroyMerlin\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;min-width:20px;min-height:20px;width:1.25rem;height:1.25rem;border-radius:4px;border:2px solid #808080;background-color:#ffffff;position:relative;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;cursor:pointer}.mc-checkbox__input[type=number]::-webkit-inner-spin-button,.mc-checkbox__input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.mc-checkbox__input[type=number]{-moz-appearance:textfield}.mc-checkbox__input[type=search]::-webkit-search-decoration:hover,.mc-checkbox__input[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-checkbox__input::-ms-check{background-color:#ffffff;border:2px solid #808080;border-radius:4px;color:#ffffff}.mc-checkbox__input.is-hover,.mc-checkbox__input:hover{border-color:#191919}.mc-checkbox__input.is-hover::-ms-check,.mc-checkbox__input:hover::-ms-check{border-color:#191919}.mc-checkbox__input.is-focus,.mc-checkbox__input:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input.is-focus::-ms-check,.mc-checkbox__input:focus::-ms-check{box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input:checked,.mc-checkbox__input:indeterminate{background-color:#ff5800;border-color:#ff5800;background-size:1rem 1rem}.mc-checkbox__input:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");background-position:center center}.mc-checkbox__input:checked::-ms-check{background-color:#ff5800;border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled){border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled)::-ms-check{border-color:#ff5800}.mc-checkbox__input:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled{background-color:#e6e6e6;border-color:#e6e6e6;cursor:not-allowed}.mc-checkbox__input:disabled::-ms-check{background-color:#e6e6e6;border-color:#e6e6e6}.mc-checkbox__input:disabled:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled+.mc-checkbox__label{color:#808080}.mc-checkbox__input.is-invalid{border-color:#c61112}.mc-checkbox__input.is-invalid::-ms-check{border-color:#c61112}.mc-checkbox__input.is-invalid.is-hover,.mc-checkbox__input.is-invalid:hover{border-color:#530000}.mc-checkbox__input.is-invalid.is-hover::-ms-check,.mc-checkbox__input.is-invalid:hover::-ms-check{border-color:#530000}.mc-field__label,.mc-field__legend{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#333333}.mc-field__legend{padding-left:0;padding-right:0}.mc-field__requirement,.mc-field__help{font-size:0.75rem;line-height:1.3333333333;font-weight:400;color:#666666}.mc-field__requirement::before{content:\" - \"}.mc-field__help{display:block;margin-top:0.125rem}@media screen and (min-width: 769px){.mc-field__container--inline,.mc-field__element--inline{display:-webkit-box;display:-ms-flexbox;display:flex}}@media screen and (min-width: 769px){}@media screen and (min-width: 1024px){}.mc-field__item:not(:last-child){margin-bottom:1rem}.mc-field__error-message{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-field--group{border:none;margin-left:0;margin-right:0;padding:0}",this.shadowRoot.appendChild(a),i(this,{target:this.shadowRoot,props:c(this.attributes),customElement:!0},j,z,o,{name:0,checked:1,indeterminate:2,disabled:3,isinvalid:4,label:5},null),e&&(e.target&&t(e.target,this,e.anchor),e.props&&(this.$set(e.props),n()))}static get observedAttributes(){return["name","checked","indeterminate","disabled","isinvalid","label"]}get name(){return this.$$.ctx[0]}set name(e){this.$$set({name:e}),n()}get checked(){return this.$$.ctx[1]}set checked(e){this.$$set({checked:e}),n()}get indeterminate(){return this.$$.ctx[2]}set indeterminate(e){this.$$set({indeterminate:e}),n()}get disabled(){return this.$$.ctx[3]}set disabled(e){this.$$set({disabled:e}),n()}get isinvalid(){return this.$$.ctx[4]}set isinvalid(e){this.$$set({isinvalid:e}),n()}get label(){return this.$$.ctx[5]}set label(e){this.$$set({label:e}),n()}}export{B as default};
2
2
  //# sourceMappingURL=Checkbox.js.map
@@ -1,2 +1,2 @@
1
- import{S as e,i,a as c,b as t,f as n,s as o,c as r,e as l,d as a,n as s,g as d,h as m,j as h,a2 as b,m as f,o as p,p as _,a1 as g,q as u,t as k,k as x,l as w,a3 as v}from"../../index-c33b3772.js";import{E as $}from"../../EventHandler-02058705.js";function y(e,i,c){const t=e.slice();return t[10]=i[c],t}function E(e){let i,c;return{c(){i=l("legend"),c=k(e[1]),d(i,"class","mc-field__legend")},m(e,n){t(e,i,n),h(i,c)},p(e,i){2&i&&x(c,e[1])},d(e){e&&p(i)}}}function C(e){let i,c,n,o=e[10].label+"";return{c(){i=l("label"),c=k(o),d(i,"for",n=e[10].id),d(i,"class","mc-checkbox__label")},m(e,n){t(e,i,n),h(i,c)},p(e,t){8&t&&o!==(o=e[10].label+"")&&x(c,o),8&t&&n!==(n=e[10].id)&&d(i,"for",n)},d(e){e&&p(i)}}}function z(e,i){let c,n,o,r,s,m,b,f,_,g,u,k,x,v;function $(){return i[7](i[10])}let y=i[10].label&&C(i);return{key:e,first:null,c(){c=l("div"),n=l("input"),g=a(),y&&y.c(),u=a(),d(n,"type","checkbox"),d(n,"class",o="mc-checkbox__input "+(i[10].isinvalid?" is-invalid":"")),d(n,"id",r=i[10].id),d(n,"name",s=i[10].name),n.checked=m=i[10].checked,n.disabled=b=i[10].disabled,n.indeterminate=f=i[10].indeterminate,d(n,"aria-invalid",_=i[10].isinvalid),d(c,"class",k="mc-checkbox mc-field__item "+i[5].class),this.first=c},m(e,i){t(e,c,i),h(c,n),h(c,g),y&&y.m(c,null),h(c,u),x||(v=w(n,"click",$),x=!0)},p(e,t){i=e,8&t&&o!==(o="mc-checkbox__input "+(i[10].isinvalid?" is-invalid":""))&&d(n,"class",o),8&t&&r!==(r=i[10].id)&&d(n,"id",r),8&t&&s!==(s=i[10].name)&&d(n,"name",s),8&t&&m!==(m=i[10].checked)&&(n.checked=m),8&t&&b!==(b=i[10].disabled)&&(n.disabled=b),8&t&&f!==(f=i[10].indeterminate)&&(n.indeterminate=f),8&t&&_!==(_=i[10].isinvalid)&&d(n,"aria-invalid",_),i[10].label?y?y.p(i,t):(y=C(i),y.c(),y.m(c,u)):y&&(y.d(1),y=null),32&t&&k!==(k="mc-checkbox mc-field__item "+i[5].class)&&d(c,"class",k)},d(e){e&&p(c),y&&y.d(),x=!1,v()}}}function j(e){let i,c,n,o,_=[],g=new Map,u=e[1]&&e[1].length&&E(e),k=e[3];const x=e=>e[10].id;for(let i=0;i<k.length;i+=1){let c=y(e,k,i),t=x(c);g.set(t,_[i]=z(t,c))}let w=[{id:e[0]},{class:"checkbox-group-container"},e[2]],$={};for(let e=0;e<w.length;e+=1)$=r($,w[e]);return{c(){i=l("div"),c=l("fieldset"),u&&u.c(),n=a(),o=l("div");for(let e=0;e<_.length;e+=1)_[e].c();this.c=s,d(o,"class","mc-field__container"),d(c,"class","mc-field mc-field--group"),m(i,$)},m(e,r){t(e,i,r),h(i,c),u&&u.m(c,null),h(c,n),h(c,o);for(let e=0;e<_.length;e+=1)_[e]&&_[e].m(o,null)},p(e,[t]){e[1]&&e[1].length?u?u.p(e,t):(u=E(e),u.c(),u.m(c,n)):u&&(u.d(1),u=null),56&t&&(k=e[3],_=b(_,t,x,1,e,k,g,o,v,z,null,y)),m(i,$=f(w,[1&t&&{id:e[0]},{class:"checkbox-group-container"},4&t&&e[2]]))},i:s,o:s,d(e){e&&p(i),u&&u.d();for(let e=0;e<_.length;e+=1)_[e].d()}}}function M(e,i,c){let t,n;const o=["id","options","legend"];let l=_(i,o),{id:a}=i,{options:s}=i,{legend:d}=i,m=new $;function h(e){t&&t.length&&(c(3,t=t.map((i=>{const c=i.value===e?!i.checked:i.checked;return Object.assign(Object.assign({},i),{checked:c})}))),m.dispatch("change",e))}g((()=>{h("")}));return e.$$set=e=>{c(5,i=r(r({},i),u(e))),c(9,l=_(i,o)),"id"in e&&c(0,a=e.id),"options"in e&&c(6,s=e.options),"legend"in e&&c(1,d=e.legend)},e.$$.update=()=>{64&e.$$.dirty&&c(3,t=s?JSON.parse(s):[]),c(2,n=Object.assign({},l)),4&e.$$.dirty&&delete n.class},i=u(i),[a,d,n,t,h,i,s,e=>h(e.value)]}class B extends e{constructor(e){super();const r=document.createElement("style");r.textContent="@charset \"UTF-8\";.mc-checkbox{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.mc-checkbox__label{font-size:1rem;line-height:1.125;cursor:pointer;margin-left:0.5rem;color:#000000}.mc-checkbox__input{font-family:\"LeroyMerlin\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;min-width:20px;min-height:20px;width:1.25rem;height:1.25rem;border-radius:4px;border:2px solid #808080;background-color:#ffffff;position:relative;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;cursor:pointer}.mc-checkbox__input[type=number]::-webkit-inner-spin-button,.mc-checkbox__input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.mc-checkbox__input[type=number]{-moz-appearance:textfield}.mc-checkbox__input[type=search]::-webkit-search-decoration:hover,.mc-checkbox__input[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-checkbox__input::-ms-check{background-color:#ffffff;border:2px solid #808080;border-radius:4px;color:#ffffff}.mc-checkbox__input.is-hover,.mc-checkbox__input:hover{border-color:#191919}.mc-checkbox__input.is-hover::-ms-check,.mc-checkbox__input:hover::-ms-check{border-color:#191919}.mc-checkbox__input.is-focus,.mc-checkbox__input:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input.is-focus::-ms-check,.mc-checkbox__input:focus::-ms-check{box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input:checked,.mc-checkbox__input:indeterminate{background-color:#ff5800;border-color:#ff5800;background-size:1rem 1rem}.mc-checkbox__input:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");background-position:center center}.mc-checkbox__input:checked::-ms-check{background-color:#ff5800;border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled){border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled)::-ms-check{border-color:#ff5800}.mc-checkbox__input:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled{background-color:#e6e6e6;border-color:#e6e6e6;cursor:not-allowed}.mc-checkbox__input:disabled::-ms-check{background-color:#e6e6e6;border-color:#e6e6e6}.mc-checkbox__input:disabled:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled+.mc-checkbox__label{color:#808080}.mc-checkbox__input.is-invalid{border-color:#c61112}.mc-checkbox__input.is-invalid::-ms-check{border-color:#c61112}.mc-checkbox__input.is-invalid.is-hover,.mc-checkbox__input.is-invalid:hover{border-color:#530000}.mc-checkbox__input.is-invalid.is-hover::-ms-check,.mc-checkbox__input.is-invalid:hover::-ms-check{border-color:#530000}.mc-field__label,.mc-field__legend{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#333333}.mc-field__legend{padding-left:0;padding-right:0}.mc-field__legend+.mc-field__container,.mc-field__help+.mc-field__container{margin-top:1rem}.mc-field__requirement,.mc-field__help{font-size:0.75rem;line-height:1.3333333333;font-weight:400;color:#666666}.mc-field__requirement::before{content:\" - \"}.mc-field__help{display:block;margin-top:0.125rem}.mc-field .mc-field__input,.mc-field .mc-field__element{margin-top:0.5rem}@media screen and (min-width: 769px){.mc-field__container--inline{display:-webkit-box;display:-ms-flexbox;display:flex}}@media screen and (min-width: 769px){.mc-field__container--inline .mc-field__item:not(:last-child){margin-bottom:0;margin-right:1rem}}@media screen and (min-width: 1024px){.mc-field__container--inline .mc-field__item:not(:last-child){margin-right:2rem}}.mc-field__item:not(:last-child){margin-bottom:1rem}.mc-field__error-message{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-field--group{border:none;margin-left:0;margin-right:0;padding:0}.mc-field--group .mc-field__error-message{margin-top:0.5rem}",this.shadowRoot.appendChild(r),i(this,{target:this.shadowRoot,props:c(this.attributes),customElement:!0},M,j,o,{id:0,options:6,legend:1},null),e&&(e.target&&t(e.target,this,e.anchor),e.props&&(this.$set(e.props),n()))}static get observedAttributes(){return["id","options","legend"]}get id(){return this.$$.ctx[0]}set id(e){this.$$set({id:e}),n()}get options(){return this.$$.ctx[6]}set options(e){this.$$set({options:e}),n()}get legend(){return this.$$.ctx[1]}set legend(e){this.$$set({legend:e}),n()}}export{B as default};
1
+ import{S as e,i,a as c,b as t,f as n,s as o,c as r,e as l,d as a,n as s,g as d,h as m,j as h,a2 as f,m as b,o as p,p as _,a1 as g,q as u,t as k,k as x,l as w,a3 as v}from"../../index-c33b3772.js";import{E as $}from"../../EventHandler-02058705.js";function y(e,i,c){const t=e.slice();return t[10]=i[c],t}function E(e){let i,c;return{c(){i=l("legend"),c=k(e[1]),d(i,"class","mc-field__legend")},m(e,n){t(e,i,n),h(i,c)},p(e,i){2&i&&x(c,e[1])},d(e){e&&p(i)}}}function C(e){let i,c,n,o=e[10].label+"";return{c(){i=l("label"),c=k(o),d(i,"for",n=e[10].id),d(i,"class","mc-checkbox__label")},m(e,n){t(e,i,n),h(i,c)},p(e,t){8&t&&o!==(o=e[10].label+"")&&x(c,o),8&t&&n!==(n=e[10].id)&&d(i,"for",n)},d(e){e&&p(i)}}}function z(e,i){let c,n,o,r,s,m,f,b,_,g,u,k,x,v;function $(){return i[7](i[10])}let y=i[10].label&&C(i);return{key:e,first:null,c(){c=l("div"),n=l("input"),g=a(),y&&y.c(),u=a(),d(n,"type","checkbox"),d(n,"class",o="mc-checkbox__input "+(i[10].isinvalid?" is-invalid":"")),d(n,"id",r=i[10].id),d(n,"name",s=i[10].name),n.checked=m=i[10].checked,n.disabled=f=i[10].disabled,n.indeterminate=b=i[10].indeterminate,d(n,"aria-invalid",_=i[10].isinvalid),d(c,"class",k="mc-checkbox mc-field__item "+i[5].class),this.first=c},m(e,i){t(e,c,i),h(c,n),h(c,g),y&&y.m(c,null),h(c,u),x||(v=w(n,"click",$),x=!0)},p(e,t){i=e,8&t&&o!==(o="mc-checkbox__input "+(i[10].isinvalid?" is-invalid":""))&&d(n,"class",o),8&t&&r!==(r=i[10].id)&&d(n,"id",r),8&t&&s!==(s=i[10].name)&&d(n,"name",s),8&t&&m!==(m=i[10].checked)&&(n.checked=m),8&t&&f!==(f=i[10].disabled)&&(n.disabled=f),8&t&&b!==(b=i[10].indeterminate)&&(n.indeterminate=b),8&t&&_!==(_=i[10].isinvalid)&&d(n,"aria-invalid",_),i[10].label?y?y.p(i,t):(y=C(i),y.c(),y.m(c,u)):y&&(y.d(1),y=null),32&t&&k!==(k="mc-checkbox mc-field__item "+i[5].class)&&d(c,"class",k)},d(e){e&&p(c),y&&y.d(),x=!1,v()}}}function j(e){let i,c,n,o,_=[],g=new Map,u=e[1]&&e[1].length&&E(e),k=e[3];const x=e=>e[10].id;for(let i=0;i<k.length;i+=1){let c=y(e,k,i),t=x(c);g.set(t,_[i]=z(t,c))}let w=[{id:e[0]},{class:"checkbox-group-container"},e[2]],$={};for(let e=0;e<w.length;e+=1)$=r($,w[e]);return{c(){i=l("div"),c=l("fieldset"),u&&u.c(),n=a(),o=l("div");for(let e=0;e<_.length;e+=1)_[e].c();this.c=s,d(o,"class","mc-field__container"),d(c,"class","mc-field mc-field--group"),m(i,$)},m(e,r){t(e,i,r),h(i,c),u&&u.m(c,null),h(c,n),h(c,o);for(let e=0;e<_.length;e+=1)_[e]&&_[e].m(o,null)},p(e,[t]){e[1]&&e[1].length?u?u.p(e,t):(u=E(e),u.c(),u.m(c,n)):u&&(u.d(1),u=null),56&t&&(k=e[3],_=f(_,t,x,1,e,k,g,o,v,z,null,y)),m(i,$=b(w,[1&t&&{id:e[0]},{class:"checkbox-group-container"},4&t&&e[2]]))},i:s,o:s,d(e){e&&p(i),u&&u.d();for(let e=0;e<_.length;e+=1)_[e].d()}}}function M(e,i,c){let t,n;const o=["id","options","legend"];let l=_(i,o),{id:a}=i,{options:s}=i,{legend:d}=i,m=new $;function h(e){t&&t.length&&(c(3,t=t.map((i=>{const c=i.value===e?!i.checked:i.checked;return Object.assign(Object.assign({},i),{checked:c})}))),m.dispatch("change",e))}g((()=>{h("")}));return e.$$set=e=>{c(5,i=r(r({},i),u(e))),c(9,l=_(i,o)),"id"in e&&c(0,a=e.id),"options"in e&&c(6,s=e.options),"legend"in e&&c(1,d=e.legend)},e.$$.update=()=>{64&e.$$.dirty&&c(3,t=s?JSON.parse(s):[]),c(2,n=Object.assign({},l)),4&e.$$.dirty&&delete n.class},i=u(i),[a,d,n,t,h,i,s,e=>h(e.value)]}class B extends e{constructor(e){super();const r=document.createElement("style");r.textContent="@charset \"UTF-8\";.mc-checkbox{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.mc-checkbox__label{font-size:1rem;line-height:1.125;cursor:pointer;margin-left:0.5rem;color:#000000}.mc-checkbox__input{font-family:\"LeroyMerlin\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;-webkit-box-shadow:none;box-shadow:none;border:none;min-width:20px;min-height:20px;width:1.25rem;height:1.25rem;border-radius:4px;border:2px solid #808080;background-color:#ffffff;position:relative;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;cursor:pointer}.mc-checkbox__input[type=number]::-webkit-inner-spin-button,.mc-checkbox__input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.mc-checkbox__input[type=number]{-moz-appearance:textfield}.mc-checkbox__input[type=search]::-webkit-search-decoration:hover,.mc-checkbox__input[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-checkbox__input::-ms-check{background-color:#ffffff;border:2px solid #808080;border-radius:4px;color:#ffffff}.mc-checkbox__input.is-hover,.mc-checkbox__input:hover{border-color:#191919}.mc-checkbox__input.is-hover::-ms-check,.mc-checkbox__input:hover::-ms-check{border-color:#191919}.mc-checkbox__input.is-focus,.mc-checkbox__input:focus{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input.is-focus::-ms-check,.mc-checkbox__input:focus::-ms-check{box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-checkbox__input:checked,.mc-checkbox__input:indeterminate{background-color:#ff5800;border-color:#ff5800;background-size:1rem 1rem}.mc-checkbox__input:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\");background-position:center center}.mc-checkbox__input:checked::-ms-check{background-color:#ff5800;border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled){border-color:#ff5800}.mc-checkbox__input:checked:hover:not(:disabled)::-ms-check{border-color:#ff5800}.mc-checkbox__input:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled{background-color:#e6e6e6;border-color:#e6e6e6;cursor:not-allowed}.mc-checkbox__input:disabled::-ms-check{background-color:#e6e6e6;border-color:#e6e6e6}.mc-checkbox__input:disabled:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled:indeterminate{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E\")}.mc-checkbox__input:disabled+.mc-checkbox__label{color:#808080}.mc-checkbox__input.is-invalid{border-color:#c61112}.mc-checkbox__input.is-invalid::-ms-check{border-color:#c61112}.mc-checkbox__input.is-invalid.is-hover,.mc-checkbox__input.is-invalid:hover{border-color:#530000}.mc-checkbox__input.is-invalid.is-hover::-ms-check,.mc-checkbox__input.is-invalid:hover::-ms-check{border-color:#530000}.mc-field__label,.mc-field__legend{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#333333}.mc-field__legend{padding-left:0;padding-right:0}.mc-field__legend+.mc-field__container,.mc-field__help+.mc-field__container{margin-top:1rem}.mc-field__requirement,.mc-field__help{font-size:0.75rem;line-height:1.3333333333;font-weight:400;color:#666666}.mc-field__requirement::before{content:\" - \"}.mc-field__help{display:block;margin-top:0.125rem}.mc-field .mc-field__input,.mc-field .mc-field__element{margin-top:0.5rem}@media screen and (min-width: 769px){.mc-field__container--inline,.mc-field__element--inline{display:-webkit-box;display:-ms-flexbox;display:flex}}@media screen and (min-width: 769px){.mc-field__container--inline .mc-field__item:not(:last-child),.mc-field__element--inline .mc-field__item:not(:last-child){margin-bottom:0;margin-right:1rem}}@media screen and (min-width: 1024px){.mc-field__container--inline .mc-field__item:not(:last-child),.mc-field__element--inline .mc-field__item:not(:last-child){margin-right:2rem}}.mc-field__item:not(:last-child){margin-bottom:1rem}.mc-field__error-message{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-field--group{border:none;margin-left:0;margin-right:0;padding:0}.mc-field--group .mc-field__error-message{margin-top:0.5rem}",this.shadowRoot.appendChild(r),i(this,{target:this.shadowRoot,props:c(this.attributes),customElement:!0},M,j,o,{id:0,options:6,legend:1},null),e&&(e.target&&t(e.target,this,e.anchor),e.props&&(this.$set(e.props),n()))}static get observedAttributes(){return["id","options","legend"]}get id(){return this.$$.ctx[0]}set id(e){this.$$set({id:e}),n()}get options(){return this.$$.ctx[6]}set options(e){this.$$set({options:e}),n()}get legend(){return this.$$.ctx[1]}set legend(e){this.$$set({legend:e}),n()}}export{B as default};
2
2
  //# sourceMappingURL=checkboxGroup.js.map
@@ -1,2 +1,2 @@
1
- import{S as e,i as t,a as i,b as r,f as s,s as l,c as n,e as d,t as a,d as m,n as o,g as c,h,j as p,k as u,m as g,o as f,p as $,q as x}from"../../index-c33b3772.js";function _(e){let t,i;return{c(){t=d("span"),i=a(e[2]),c(t,"class","mc-field__requirement"),c(t,"aria-hidden","true")},m(e,s){r(e,t,s),p(t,i)},p(e,t){4&t&&u(i,e[2])},d(e){e&&f(t)}}}function b(e){let t,i;return{c(){t=d("span"),i=a(e[4]),c(t,"id",e[3]),c(t,"class","mc-field__help")},m(e,s){r(e,t,s),p(t,i)},p(e,r){16&r&&u(i,e[4]),8&r&&c(t,"id",e[3])},d(e){e&&f(t)}}}function q(e){let t,i;return{c(){t=d("span"),i=a(e[6]),c(t,"id",e[5]),c(t,"class","mc-field__error-message")},m(e,s){r(e,t,s),p(t,i)},p(e,r){64&r&&u(i,e[6]),32&r&&c(t,"id",e[5])},d(e){e&&f(t)}}}function v(e){let t,i,s,l,$,x,v,w,y=e[2]&&_(e),k=e[3]&&e[4]&&b(e),j=e[7]&&q(e),z=[{class:"mc-field"},e[8]],C={};for(let e=0;e<z.length;e+=1)C=n(C,z[e]);return{c(){t=d("div"),i=d("label"),s=a(e[1]),l=m(),y&&y.c(),$=m(),k&&k.c(),x=m(),v=d("slot"),w=m(),j&&j.c(),this.c=o,c(i,"for",e[0]),c(i,"class","mc-field__label"),h(t,C)},m(e,n){r(e,t,n),p(t,i),p(i,s),p(i,l),y&&y.m(i,null),p(t,$),k&&k.m(t,null),p(t,x),p(t,v),p(t,w),j&&j.m(t,null)},p(e,[r]){2&r&&u(s,e[1]),e[2]?y?y.p(e,r):(y=_(e),y.c(),y.m(i,null)):y&&(y.d(1),y=null),1&r&&c(i,"for",e[0]),e[3]&&e[4]?k?k.p(e,r):(k=b(e),k.c(),k.m(t,x)):k&&(k.d(1),k=null),e[7]?j?j.p(e,r):(j=q(e),j.c(),j.m(t,null)):j&&(j.d(1),j=null),h(t,C=g(z,[{class:"mc-field"},256&r&&e[8]]))},i:o,o:o,d(e){e&&f(t),y&&y.d(),k&&k.d(),j&&j.d()}}}function w(e,t,i){let r;const s=["id","label","requirementtext","helpid","helptext","errorid","errormessage","isinvalid"];let l=$(t,s),{id:d}=t,{label:a}=t,{requirementtext:m}=t,{helpid:o}=t,{helptext:c}=t,{errorid:h}=t,{errormessage:p}=t,{isinvalid:u=!1}=t;return e.$$set=e=>{t=n(n({},t),x(e)),i(9,l=$(t,s)),"id"in e&&i(0,d=e.id),"label"in e&&i(1,a=e.label),"requirementtext"in e&&i(2,m=e.requirementtext),"helpid"in e&&i(3,o=e.helpid),"helptext"in e&&i(4,c=e.helptext),"errorid"in e&&i(5,h=e.errorid),"errormessage"in e&&i(6,p=e.errormessage),"isinvalid"in e&&i(7,u=e.isinvalid)},e.$$.update=()=>{i(8,r=Object.assign({},l)),256&e.$$.dirty&&delete r.class},[d,a,m,o,c,h,p,u,r]}class y extends e{constructor(e){super();const n=document.createElement("style");n.textContent='@charset "UTF-8";.mc-field__label,.mc-field__legend{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#333333}.mc-field__legend{padding-left:0;padding-right:0}.mc-field__requirement,.mc-field__help{font-size:0.75rem;line-height:1.3333333333;font-weight:400;color:#666666}.mc-field__requirement::before{content:" - "}.mc-field__help{display:block;margin-top:0.125rem}@media screen and (min-width: 769px){.mc-field__container--inline{display:-webkit-box;display:-ms-flexbox;display:flex}}@media screen and (min-width: 769px){}@media screen and (min-width: 1024px){}.mc-field__item:not(:last-child){margin-bottom:1rem}.mc-field__error-message{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-field--group{border:none;margin-left:0;margin-right:0;padding:0}.mc-field--group .mc-field__error-message{margin-top:0.5rem}',this.shadowRoot.appendChild(n),t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},w,v,l,{id:0,label:1,requirementtext:2,helpid:3,helptext:4,errorid:5,errormessage:6,isinvalid:7},null),e&&(e.target&&r(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["id","label","requirementtext","helpid","helptext","errorid","errormessage","isinvalid"]}get id(){return this.$$.ctx[0]}set id(e){this.$$set({id:e}),s()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),s()}get requirementtext(){return this.$$.ctx[2]}set requirementtext(e){this.$$set({requirementtext:e}),s()}get helpid(){return this.$$.ctx[3]}set helpid(e){this.$$set({helpid:e}),s()}get helptext(){return this.$$.ctx[4]}set helptext(e){this.$$set({helptext:e}),s()}get errorid(){return this.$$.ctx[5]}set errorid(e){this.$$set({errorid:e}),s()}get errormessage(){return this.$$.ctx[6]}set errormessage(e){this.$$set({errormessage:e}),s()}get isinvalid(){return this.$$.ctx[7]}set isinvalid(e){this.$$set({isinvalid:e}),s()}}export{y as default};
1
+ import{S as e,i as t,a as i,b as r,f as s,s as l,c as n,e as d,t as a,d as m,n as o,g as c,h,j as p,k as u,m as g,o as f,p as $,q as x}from"../../index-c33b3772.js";function _(e){let t,i;return{c(){t=d("span"),i=a(e[2]),c(t,"class","mc-field__requirement"),c(t,"aria-hidden","true")},m(e,s){r(e,t,s),p(t,i)},p(e,t){4&t&&u(i,e[2])},d(e){e&&f(t)}}}function b(e){let t,i;return{c(){t=d("span"),i=a(e[4]),c(t,"id",e[3]),c(t,"class","mc-field__help")},m(e,s){r(e,t,s),p(t,i)},p(e,r){16&r&&u(i,e[4]),8&r&&c(t,"id",e[3])},d(e){e&&f(t)}}}function q(e){let t,i;return{c(){t=d("span"),i=a(e[6]),c(t,"id",e[5]),c(t,"class","mc-field__error-message")},m(e,s){r(e,t,s),p(t,i)},p(e,r){64&r&&u(i,e[6]),32&r&&c(t,"id",e[5])},d(e){e&&f(t)}}}function v(e){let t,i,s,l,$,x,v,w,y=e[2]&&_(e),k=e[3]&&e[4]&&b(e),j=e[7]&&q(e),z=[{class:"mc-field"},e[8]],C={};for(let e=0;e<z.length;e+=1)C=n(C,z[e]);return{c(){t=d("div"),i=d("label"),s=a(e[1]),l=m(),y&&y.c(),$=m(),k&&k.c(),x=m(),v=d("slot"),w=m(),j&&j.c(),this.c=o,c(i,"for",e[0]),c(i,"class","mc-field__label"),h(t,C)},m(e,n){r(e,t,n),p(t,i),p(i,s),p(i,l),y&&y.m(i,null),p(t,$),k&&k.m(t,null),p(t,x),p(t,v),p(t,w),j&&j.m(t,null)},p(e,[r]){2&r&&u(s,e[1]),e[2]?y?y.p(e,r):(y=_(e),y.c(),y.m(i,null)):y&&(y.d(1),y=null),1&r&&c(i,"for",e[0]),e[3]&&e[4]?k?k.p(e,r):(k=b(e),k.c(),k.m(t,x)):k&&(k.d(1),k=null),e[7]?j?j.p(e,r):(j=q(e),j.c(),j.m(t,null)):j&&(j.d(1),j=null),h(t,C=g(z,[{class:"mc-field"},256&r&&e[8]]))},i:o,o:o,d(e){e&&f(t),y&&y.d(),k&&k.d(),j&&j.d()}}}function w(e,t,i){let r;const s=["id","label","requirementtext","helpid","helptext","errorid","errormessage","isinvalid"];let l=$(t,s),{id:d}=t,{label:a}=t,{requirementtext:m}=t,{helpid:o}=t,{helptext:c}=t,{errorid:h}=t,{errormessage:p}=t,{isinvalid:u=!1}=t;return e.$$set=e=>{t=n(n({},t),x(e)),i(9,l=$(t,s)),"id"in e&&i(0,d=e.id),"label"in e&&i(1,a=e.label),"requirementtext"in e&&i(2,m=e.requirementtext),"helpid"in e&&i(3,o=e.helpid),"helptext"in e&&i(4,c=e.helptext),"errorid"in e&&i(5,h=e.errorid),"errormessage"in e&&i(6,p=e.errormessage),"isinvalid"in e&&i(7,u=e.isinvalid)},e.$$.update=()=>{i(8,r=Object.assign({},l)),256&e.$$.dirty&&delete r.class},[d,a,m,o,c,h,p,u,r]}class y extends e{constructor(e){super();const n=document.createElement("style");n.textContent='@charset "UTF-8";.mc-field__label,.mc-field__legend{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#333333}.mc-field__legend{padding-left:0;padding-right:0}.mc-field__requirement,.mc-field__help{font-size:0.75rem;line-height:1.3333333333;font-weight:400;color:#666666}.mc-field__requirement::before{content:" - "}.mc-field__help{display:block;margin-top:0.125rem}@media screen and (min-width: 769px){.mc-field__container--inline,.mc-field__element--inline{display:-webkit-box;display:-ms-flexbox;display:flex}}@media screen and (min-width: 769px){}@media screen and (min-width: 1024px){}.mc-field__item:not(:last-child){margin-bottom:1rem}.mc-field__error-message{font-size:0.875rem;line-height:1.2857142857;color:#c61112;display:inline-block;margin-top:0.25rem}.mc-field--group{border:none;margin-left:0;margin-right:0;padding:0}.mc-field--group .mc-field__error-message{margin-top:0.5rem}',this.shadowRoot.appendChild(n),t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},w,v,l,{id:0,label:1,requirementtext:2,helpid:3,helptext:4,errorid:5,errormessage:6,isinvalid:7},null),e&&(e.target&&r(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["id","label","requirementtext","helpid","helptext","errorid","errormessage","isinvalid"]}get id(){return this.$$.ctx[0]}set id(e){this.$$set({id:e}),s()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),s()}get requirementtext(){return this.$$.ctx[2]}set requirementtext(e){this.$$set({requirementtext:e}),s()}get helpid(){return this.$$.ctx[3]}set helpid(e){this.$$set({helpid:e}),s()}get helptext(){return this.$$.ctx[4]}set helptext(e){this.$$set({helptext:e}),s()}get errorid(){return this.$$.ctx[5]}set errorid(e){this.$$set({errorid:e}),s()}get errormessage(){return this.$$.ctx[6]}set errormessage(e){this.$$set({errormessage:e}),s()}get isinvalid(){return this.$$.ctx[7]}set isinvalid(e){this.$$set({isinvalid:e}),s()}}export{y as default};
2
2
  //# sourceMappingURL=Field.js.map