forstok-ui-lib 7.6.1 → 7.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4156,8 +4156,8 @@ function L(e,t){if(!1===e||null==e)throw new Error(t)}function j(e,t){if(!e){"un
4156
4156
  }
4157
4157
  `,mo=r=>{var{children:i,title:n,subTitle:a,$externalWidth:o,$externalMinWidth:d,$internalWidth:C,$area:p,$openPosition:h,$placement:g,$top:x,onClick:m,$alias:u,type:v,portalId:w,$bottom:F,$isPopup:f}=r,y=B(r,["children","title","subTitle","$externalWidth","$externalMinWidth","$internalWidth","$area","$openPosition","$placement","$top","onClick","$alias","type","portalId","$bottom","$isPopup"]);const A=c(null),b=()=>{const e=document.getElementsByClassName("_refContainer is-shown")[0];if(e){const t=e.getBoundingClientRect(),r=document.querySelector(`#${w} ._refDropdownPortal`);if(r){const e=r.querySelector("._refDropdownWrapper"),i=t.left+t.width-e.getBoundingClientRect().width;r.style.left=(i>0?i:t.left)+"px",r.style.top=t.top+parseInt(x||"0")-32+"px"}}},D=()=>{const e=document.getElementsByClassName("_refContainer is-shown"),t=document.getElementsByTagName("BODY")[0];if(e.length){t.classList.remove("is-immuned");for(let t=0;t<e.length;t++){e[t].querySelector("._refDropdownOverlay").style.display="none",e[t].classList.remove("is-shown")}}const r=document.querySelector("._refScrollContainer");r&&r.removeEventListener("scroll",b,!0),setTimeout((()=>{if(w){const e=document.getElementsByClassName("_refDropdownPortal is-shown");if(e.length)for(let t=0;t<e.length;t++)e[t].style.left="0",e[t].style.top="0",e[t].classList.remove("is-shown")}}),10)},E=e=>{const t=A.current;if(t){const r=e.target.closest(`.${t.classList[0]}`);if(!r)return;const i=r.closest("._refContainer"),n=document.getElementsByTagName("BODY")[0];if(i){const t=i.querySelector("._refDropdownOverlay"),r=i.classList.contains("is-shown"),a=i.getBoundingClientRect();r?(t.style.display="none",n.classList.remove("is-immuned"),i.classList.remove("is-shown"),setTimeout((()=>{if(w){const e=document.querySelector(`#${w} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer"),r=e.querySelector("._refDropdownWrapper");e&&(e.classList.remove("is-shown"),e.style.left="0px",e.style.top="0px",r&&t&&t.removeEventListener("scroll",b,!0))}}),10)):(D(),t.style.display="block",n.classList.add("is-immuned"),i.classList.add("is-shown"),setTimeout((()=>{if(w){const e=document.querySelector(`#${w} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer"),r=e.querySelector("._refDropdownWrapper");e&&(a&&(r?setTimeout((()=>{r.style.right="auto";const i=a.left+a.width-r.getBoundingClientRect().width;e.style.left=(i>0?i:a.left)+"px",e.style.top=a.top+parseInt(x||"0")-32+"px",e.style.zIndex=f?"101":"8",t&&t.addEventListener("scroll",b,!0)}),10):(e.style.left=a.left+(parseInt(C||"0")+a.width)/2+"px",e.style.top=a.top+a.height+"px")),e.classList.add("is-shown"))}}),10),m&&m(e))}}};l((()=>(setTimeout((()=>{const e=document.querySelectorAll("._refDropdownPortal._refHover");for(let t of e)t&&t.addEventListener("mouseenter",(e=>{const t=e.target;t.classList.add("is-shown"),t.classList.add("unhiddenable")})),t&&t.addEventListener("mouseleave",(e=>{const t=e.target;t.classList.remove("is-shown"),t.classList.remove("unhiddenable"),t.style.left="0",t.style.top="0"}))}),1),()=>{const e=document.querySelectorAll("._refDropdownPortal._refHover");for(let t of e)t&&t.removeEventListener("mouseenter",(e=>{const t=e.target;t.classList.add("is-shown"),t.classList.add("unhiddenable")}),!0),t&&t.removeEventListener("mouseleave",(e=>{const t=e.target;t.classList.remove("is-shown"),t.classList.remove("unhiddenable"),t.style.left="0",t.style.top="0"}),!0)})),[w]);const k=a?e(po,{children:a}):null,O=n?t(so,{children:[n," ",k]}):null,z=i.filter((e=>s(e)?"control"===e.props["aria-label"]:null)),M=z&&s(z[0])?"hover"===v?t(co,{children:[e(lo,Object.assign({className:"_refDropdownControl"},w&&{onMouseEnter:e=>{const t=A.current;if(t){const r=e.target.closest(`.${t.classList[0]}`);if(!r)return;const i=document.querySelectorAll("._refDropdownPortal");for(const e of i)e.classList.remove("is-shown"),e.style.left="0",e.style.top="0";const n=r.closest("._refContainer");if(n){const e=n.getBoundingClientRect(),t=document.querySelector(`#${w} ._refDropdownPortal`);if(t){if(e){t.style.left=e.left+(parseInt(C||"0")+e.width)/2+"px";let r=e.top+e.height;const i=t.querySelector("._refDropdownWrapper");i&&(i.style.display="block",r+i.clientHeight>=document.body.clientHeight&&(r=e.top-i.clientHeight-10)),t.style.top=r+"px"}t.classList.add("is-shown")}}}},onMouseLeave:e=>{const t=A.current;if(t){if(!e.target.closest(`.${t.classList[0]}`))return;setTimeout((()=>{const e=document.querySelector(`#${w} ._refDropdownPortal`);e&&!e.classList.contains("unhiddenable")&&(e.classList.remove("is-shown"),e.style.left="0",e.style.top="0")}),150)}}},{children:z[0].props.children})),e(lo,{className:"_refDropdownControlMobile",ref:A,onClick:E,children:z[0].props.children})]}):e(lo,{ref:A,onClick:E,children:z[0].props.children}):null,I=i.filter((e=>s(e)?"body"===e.props["aria-label"]:null)),L=I&&s(I[0])?e(ho,{$area:p,children:I[0].props.children}):null,j=i.filter((e=>s(e)?"action"===e.props["aria-label"]:null)),Q=j&&s(j[0])?e(go,{$position:j[0].props["data-position"],className:j[0].props.className,children:j[0].props.children}):null,P=t(ao,Object.assign({className:"_refDropdownWrapper"},C&&{$internalWidth:C},x&&{$top:x},h&&{$openPosition:h},g&&{$placement:g},F&&{$bottom:F},{children:[O,L,Q]}));return t(Co,Object.assign({className:"_refContainer "+(v?`_refContainer${v}`:"")},o&&{$externalWidth:o},d&&{$externalMinWidth:d},p&&{$area:p},x&&{$top:x},u&&{$alias:u},h&&{$openPosition:h},g&&{$placement:g},F&&{$bottom:F},y,{children:[M,e(oo,{className:"_refDropdownOverlay",onClick:()=>{D()}}),w?e(no,{wrapperId:w,children:e(xo,{className:"_refDropdownPortal "+("hover"===v?"_refHover":""),children:P})}):P]}))},uo=n`
4158
4158
  background-color: var(--mt-clr-bg__fc);
4159
- width: 32px;
4160
- height: 32px;
4159
+ width: 30px;
4160
+ height: 30px;
4161
4161
  padding: .5em .675em;
4162
4162
  &:hover {
4163
4163
  background-color: var(--mt-clr-bg);
@@ -4495,7 +4495,7 @@ function L(e,t){if(!1===e||null==e)throw new Error(t)}function j(e,t){if(!e){"un
4495
4495
  }
4496
4496
  }
4497
4497
  `}}
4498
- `,Ko=r=>{var{children:i,$mode:n,evChange:a}=r,o=B(r,["children","$mode","evChange"]);const{id:l}=o;return e(Go,{children:t("label",{htmlFor:l,children:[e(Ro,Object.assign({type:"radio",id:l,$mode:n,onChange:e=>{a&&a(e)}},o)),e(Zo,Object.assign({$mode:n},o["data-qa-id"]&&{"data-qa-id":o["data-qa-id"]},{children:i}))]})})},Jo=i.div`
4498
+ `,Ko=r=>{var{children:i,$mode:n,evChange:a,reset:d,setReset:c,isForceUpdate:C,setForceUpdate:s}=r,p=B(r,["children","$mode","evChange","reset","setReset","isForceUpdate","setForceUpdate"]);const{id:h,defaultChecked:g}=p,[x,m]=o(g||!1);l((()=>{C&&(m(g||!1),s&&s(!1)),d&&(m(!1),c&&c(!1))}),[C,s,d,c,g,m]);let u=Object.assign({},p);return delete u.defaultChecked,e(Go,{children:t("label",{htmlFor:h,children:[e(Ro,Object.assign({type:"radio",id:h,$mode:n,checked:x,onChange:e=>{a&&a(e)}},u)),e(Zo,Object.assign({$mode:n},p["data-qa-id"]&&{"data-qa-id":p["data-qa-id"]},{children:i}))]})})},Jo=i.div`
4499
4499
  > input:checked + label::after {
4500
4500
  left: 16px;
4501
4501
  }