forstok-ui-lib 8.9.6 → 8.9.7

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
@@ -4520,7 +4520,7 @@ function Q(e,t){if(!1===e||null==e)throw new Error(t)}function P(e,t){if(!e){"un
4520
4520
  display: block;
4521
4521
  }
4522
4522
  }
4523
- `,Oo=i=>{var{children:r,title:n,subTitle:a,$externalWidth:o,$externalMinWidth:d,$internalWidth:s,$area:p,$openPosition:h,$placement:g,$top:m,onClick:x,$alias:u,type:v,portalId:w,$bottom:F,$isPopup:f}=i,y=O(i,["children","title","subTitle","$externalWidth","$externalMinWidth","$internalWidth","$area","$openPosition","$placement","$top","onClick","$alias","type","portalId","$bottom","$isPopup"]);const A=C(null),b=(e,t)=>{const i=Number.parseInt(e||"",10);return Number.isNaN(i)?t:i},D=()=>window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,E=()=>D()<768,B=e=>null==e?void 0:e.querySelector("._refDropdownWrapper"),k=(e,t)=>{if("top"===g)return"top";const i=e.getBoundingClientRect(),r=t.getBoundingClientRect().height||t.offsetHeight,n=b(m,40),a=b(F,35),o=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-i.bottom,l=i.top,d=r+Math.max(n-i.height,0),C=r+Math.max(a-i.height,0);return o>=d?"bottom":l>=C||l>o?"top":"bottom"},M=(e,t)=>{if("top"===t)return e.style.animation="none",e.style.top="auto",void(e.style.bottom=`${b(F,35)}px`);e.style.top=`${b(m,40)}px`,e.style.bottom="auto"},z=e=>{e.style.top="auto",e.style.bottom="0",e.style.left="0",e.style.right="auto",e.style.transform="none"},L=e=>{const t=B(e);t&&(t.style.top="",t.style.bottom="",t.style.left="",t.style.right="",t.style.transform="",t.style.visibility="",t.style.animation="")},I=(e,t)=>{const i=B(e);i&&(i.style.visibility=t)},j=e=>{if(!w)return;const t=document.querySelector(`#${w} ._refDropdownPortal`),i=B(t);if(!t||!i)return;if(E())return z(i),t.style.left="'-100%'",t.style.top="'-100%'",void(t.style.zIndex=f?"101":"8");const r=e.getBoundingClientRect(),n=k(e,i),a=i.getBoundingClientRect().width||i.offsetWidth,o=D();let l=r.left+r.width-a;"left"===h?l=r.left:"center"===h&&(l=r.left+r.width/2-a/2),l=Math.max(0,Math.min(l,Math.max(o-a,0))),i.style.left="0",i.style.right="auto",i.style.transform="none",M(i,n),t.style.left=`${l}px`,t.style.top=`${"top"===n?r.bottom:r.top}px`,t.style.zIndex=f?"101":"8"},Q=()=>{const e=document.getElementsByClassName("_refContainer is-shown")[0];e&&w&&j(e)},P=()=>{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"),L(e[t])}}const i=document.querySelector("._refScrollContainer");i&&i.removeEventListener("scroll",Q,!0),setTimeout((()=>{if(w){const e=document.getElementsByClassName("_refDropdownPortal is-shown");if(e.length)for(let t=0;t<e.length;t++)L(e[t]),e[t].style.left="'-100%'",e[t].style.top="'-100%'",e[t].classList.remove("is-shown")}}),10)},S=e=>{const t=A.current;if(t){const i=e.target.closest(`.${t.classList[0]}`);if(!i)return;const r=i.closest("._refContainer"),n=document.getElementsByTagName("BODY")[0];if(r){const t=r.querySelector("._refDropdownOverlay");r.classList.contains("is-shown")?(t.style.display="none",n.classList.remove("is-immuned"),r.classList.remove("is-shown"),setTimeout((()=>{if(w){const e=document.querySelector(`#${w} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer");e&&(L(e),e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%",t&&t.removeEventListener("scroll",Q,!0))}}),10),L(r)):(P(),t.style.display="block",n.classList.add("is-immuned"),w||I(r,"hidden"),r.classList.add("is-shown"),setTimeout((()=>{if(w){const e=document.querySelector(`#${w} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer");e&&(e.classList.add("is-shown"),setTimeout((()=>{j(r),t&&t.addEventListener("scroll",Q,!0)}),10))}else e=()=>{(e=>{const t=B(e);if(!t)return;if(E())return void z(t);const i=k(e,t);M(t,i)})(r),I(r,"visible")},window.requestAnimationFrame((()=>e()));var e}),10),x&&x(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="-100%",t.style.top="-100%"}))}),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="-100%",t.style.top="-100%"}),!0)})),[w]);const T=a?e(Do,{children:a}):null,Y=n?t(bo,{children:[n," ",T]}):null,H=r.filter((e=>c(e)?"control"===e.props["aria-label"]:null)),X=H&&c(H[0])?"hover"===v?t(yo,{children:[e(fo,Object.assign({className:"_refDropdownControl"},w&&{onMouseEnter:e=>{const t=A.current;if(t){const i=e.target.closest(`.${t.classList[0]}`);if(!i)return;const r=document.querySelectorAll("._refDropdownPortal");for(const e of r)e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%";const n=i.closest("._refContainer");if(n){const e=document.querySelector(`#${w} ._refDropdownPortal`);e&&(e.classList.add("is-shown"),setTimeout((()=>{j(n)}),10))}}},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")&&(L(e),e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%")}),150)}}},{children:H[0].props.children})),e(fo,{className:"_refDropdownControlMobile",ref:A,onClick:S,children:H[0].props.children})]}):e(fo,{ref:A,onClick:S,children:H[0].props.children}):null,V=r.filter((e=>c(e)?"body"===e.props["aria-label"]:null)),N=V&&c(V[0])?e(Eo,{$area:p,children:V[0].props.children}):null,q=r.filter((e=>c(e)?"action"===e.props["aria-label"]:null)),U=q&&c(q[0])?e(Bo,{$position:q[0].props["data-position"],className:q[0].props.className,children:q[0].props.children}):null,W=t(wo,Object.assign({className:"_refDropdownWrapper"},s&&{$internalWidth:s},m&&{$top:m},h&&{$openPosition:h},g&&{$placement:g},F&&{$bottom:F},{children:[Y,N,U]}));return t(Ao,Object.assign({className:"_refContainer "+(v?`_refContainer${v}`:"")},o&&{$externalWidth:o},d&&{$externalMinWidth:d},p&&{$area:p},m&&{$top:m},u&&{$alias:u},h&&{$openPosition:h},g&&{$placement:g},F&&{$bottom:F},y,{children:[X,e(Fo,{className:"_refDropdownOverlay",onClick:()=>{P()}}),w?e(vo,{wrapperId:w,children:e(ko,{className:"_refDropdownPortal "+("hover"===v?"_refHover":""),children:W})}):W]}))},Mo=n`
4523
+ `,Oo=i=>{var{children:r,title:n,subTitle:a,$externalWidth:o,$externalMinWidth:d,$internalWidth:s,$area:p,$openPosition:h,$placement:g,$top:m,onClick:x,$alias:u,type:v,portalId:w,$bottom:F,$isPopup:f}=i,y=O(i,["children","title","subTitle","$externalWidth","$externalMinWidth","$internalWidth","$area","$openPosition","$placement","$top","onClick","$alias","type","portalId","$bottom","$isPopup"]);const A=C(null),b=(e,t)=>{const i=Number.parseInt(e||"",10);return Number.isNaN(i)?t:i},D=()=>window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,E=()=>D()<768,B=e=>null==e?void 0:e.querySelector("._refDropdownWrapper"),k=(e,t)=>{if("top"===g)return"top";const i=e.getBoundingClientRect(),r=t.getBoundingClientRect().height||t.offsetHeight,n=b(m,40),a=b(F,35),o=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-i.bottom,l=i.top,d=r+Math.max(n-i.height,0),C=r+Math.max(a-i.height,0);return o>=d?"bottom":l>=C||l>o?"top":"bottom"},M=(e,t)=>{if("top"===t)return e.style.animation="none",e.style.top="auto",void(e.style.bottom=`${b(F,35)}px`);e.style.top=`${b(m,40)}px`,e.style.bottom="auto"},z=e=>{e.style.top="auto",e.style.bottom="0",e.style.left="0",e.style.right="auto",e.style.transform="none"},L=e=>{const t=B(e);t&&(t.style.top="",t.style.bottom="",t.style.left="",t.style.right="",t.style.transform="",t.style.visibility="",t.style.animation="")},I=(e,t)=>{const i=B(e);i&&(i.style.visibility=t)},j=e=>{if(!w)return;const t=document.querySelector(`#${w} ._refDropdownPortal`),i=B(t);if(!t||!i)return;if(E())return z(i),t.style.left="'-100%'",t.style.top="'-100%'",void(t.style.zIndex="101");const r=e.getBoundingClientRect(),n=k(e,i),a=i.getBoundingClientRect().width||i.offsetWidth,o=D();let l=r.left+r.width-a;"left"===h?l=r.left:"center"===h&&(l=r.left+r.width/2-a/2),l=Math.max(0,Math.min(l,Math.max(o-a,0))),i.style.left="0",i.style.right="auto",i.style.transform="none",M(i,n),t.style.left=`${l}px`,t.style.top=`${"top"===n?r.bottom:r.top}px`,t.style.zIndex=f?"101":"8"},Q=()=>{const e=document.getElementsByClassName("_refContainer is-shown")[0];e&&w&&j(e)},P=()=>{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"),L(e[t])}}const i=document.querySelector("._refScrollContainer");i&&i.removeEventListener("scroll",Q,!0),setTimeout((()=>{if(w){const e=document.getElementsByClassName("_refDropdownPortal is-shown");if(e.length)for(let t=0;t<e.length;t++)L(e[t]),e[t].style.left="'-100%'",e[t].style.top="'-100%'",e[t].classList.remove("is-shown")}}),10)},S=e=>{const t=A.current;if(t){const i=e.target.closest(`.${t.classList[0]}`);if(!i)return;const r=i.closest("._refContainer"),n=document.getElementsByTagName("BODY")[0];if(r){const t=r.querySelector("._refDropdownOverlay");r.classList.contains("is-shown")?(t.style.display="none",n.classList.remove("is-immuned"),r.classList.remove("is-shown"),setTimeout((()=>{if(w){const e=document.querySelector(`#${w} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer");e&&(L(e),e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%",t&&t.removeEventListener("scroll",Q,!0))}}),10),L(r)):(P(),t.style.display="block",n.classList.add("is-immuned"),w||I(r,"hidden"),r.classList.add("is-shown"),setTimeout((()=>{if(w){const e=document.querySelector(`#${w} ._refDropdownPortal`),t=document.querySelector("._refScrollContainer");e&&(e.classList.add("is-shown"),setTimeout((()=>{j(r),t&&t.addEventListener("scroll",Q,!0)}),10))}else e=()=>{(e=>{const t=B(e);if(!t)return;if(E())return void z(t);const i=k(e,t);M(t,i)})(r),I(r,"visible")},window.requestAnimationFrame((()=>e()));var e}),10),x&&x(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="-100%",t.style.top="-100%"}))}),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="-100%",t.style.top="-100%"}),!0)})),[w]);const T=a?e(Do,{children:a}):null,Y=n?t(bo,{children:[n," ",T]}):null,H=r.filter((e=>c(e)?"control"===e.props["aria-label"]:null)),X=H&&c(H[0])?"hover"===v?t(yo,{children:[e(fo,Object.assign({className:"_refDropdownControl"},w&&{onMouseEnter:e=>{const t=A.current;if(t){const i=e.target.closest(`.${t.classList[0]}`);if(!i)return;const r=document.querySelectorAll("._refDropdownPortal");for(const e of r)e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%";const n=i.closest("._refContainer");if(n){const e=document.querySelector(`#${w} ._refDropdownPortal`);e&&(e.classList.add("is-shown"),setTimeout((()=>{j(n)}),10))}}},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")&&(L(e),e.classList.remove("is-shown"),e.style.left="-100%",e.style.top="-100%")}),150)}}},{children:H[0].props.children})),e(fo,{className:"_refDropdownControlMobile",ref:A,onClick:S,children:H[0].props.children})]}):e(fo,{ref:A,onClick:S,children:H[0].props.children}):null,V=r.filter((e=>c(e)?"body"===e.props["aria-label"]:null)),N=V&&c(V[0])?e(Eo,{$area:p,children:V[0].props.children}):null,q=r.filter((e=>c(e)?"action"===e.props["aria-label"]:null)),U=q&&c(q[0])?e(Bo,{$position:q[0].props["data-position"],className:q[0].props.className,children:q[0].props.children}):null,W=t(wo,Object.assign({className:"_refDropdownWrapper"},s&&{$internalWidth:s},m&&{$top:m},h&&{$openPosition:h},g&&{$placement:g},F&&{$bottom:F},{children:[Y,N,U]}));return t(Ao,Object.assign({className:"_refContainer "+(v?`_refContainer${v}`:"")},o&&{$externalWidth:o},d&&{$externalMinWidth:d},p&&{$area:p},m&&{$top:m},u&&{$alias:u},h&&{$openPosition:h},g&&{$placement:g},F&&{$bottom:F},y,{children:[X,e(Fo,{className:"_refDropdownOverlay",onClick:()=>{P()}}),w?e(vo,{wrapperId:w,children:e(ko,{className:"_refDropdownPortal "+("hover"===v?"_refHover":""),children:W})}):W]}))},Mo=n`
4524
4524
  background-color: var(--mt-clr-bg__fc);
4525
4525
  width: 30px;
4526
4526
  height: 30px;