forstok-ui-lib 7.6.0 → 7.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/emoji/styles.ts +2 -2
- package/src/components/textarea/index.tsx +13 -1
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:
|
|
4160
|
-
height:
|
|
4159
|
+
width: 30px;
|
|
4160
|
+
height: 30px;
|
|
4161
4161
|
padding: .5em .675em;
|
|
4162
4162
|
&:hover {
|
|
4163
4163
|
background-color: var(--mt-clr-bg);
|
|
@@ -4187,7 +4187,7 @@ function L(e,t){if(!1===e||null==e)throw new Error(t)}function j(e,t){if(!e){"un
|
|
|
4187
4187
|
${({$isError:e})=>{if(e)return n`
|
|
4188
4188
|
border:1px solid var(--err-clr-ln);
|
|
4189
4189
|
`}}
|
|
4190
|
-
`,fo=r=>{var i,{$isError:n,reset:a,setReset:d,isForceUpdate:
|
|
4190
|
+
`,fo=r=>{var i,{$isError:n,reset:a,setReset:d,isForceUpdate:C,setForceUpdate:s,evChange:p,evBlur:h,isField:g,evChangeCustom:x,$isEmoji:m}=r,u=B(r,["$isError","reset","setReset","isForceUpdate","setForceUpdate","evChange","evBlur","isField","evChangeCustom","$isEmoji"]);const v=c(null),{name:w,defaultValue:F}=u,[f,y]=o(null!==(i=null==F?void 0:F.toString())&&void 0!==i?i:"");l((()=>{var e;C&&(y(null!==(e=null==F?void 0:F.toString())&&void 0!==e?e:""),s&&s(!1)),a&&(y(""),d&&d(!1))}),[C,s,a,d,F]);const A=e=>{const t=e.target.value;y(t)};let b=Object.assign({},u);return delete b.defaultValue,t("div",{style:{position:"relative"},children:[e(Fo,Object.assign({ref:v,$isError:n,value:f,onChange:e=>{A(e),p&&p(e)},onBlur:e=>{A(e),(e=>{h&&h(e),g&&w&&x&&x(w,e.target.value)})(e)}},b)),m?e(wo,{$mode:"textarea",evChange:e=>{var t;const r=f+e;if(y(r),w&&(null===(t=document.getElementsByName(w)[0])||void 0===t||t.focus()),v.current){const e={target:v.current,currentTarget:v.current};v.current.value=r,p&&p(e)}}}):null]})},yo=d(((r,i)=>{var{$isError:n,$isEmoji:a}=r,o=B(r,["$isError","$isEmoji"]);const l=c(null);h(i,(()=>l.current));return t("div",{style:{position:"relative"},children:[e(Fo,Object.assign({ref:l,$isError:n},o)),a?e(wo,{$mode:"textarea",evChange:e=>{l.current&&(l.current.value=l.current.value+e,l.current.focus())}}):null]})})),Ao=n`
|
|
4191
4191
|
align-items: center;
|
|
4192
4192
|
display: flex;
|
|
4193
4193
|
flex: 1;
|