dga-ui-react 1.5.1 → 1.5.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/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -263,11 +263,11 @@
|
|
|
263
263
|
font-weight: 500;
|
|
264
264
|
.leadIcon {
|
|
265
265
|
margin-inline-end: 4px;
|
|
266
|
-
display:
|
|
267
|
-
alignitems: "center";
|
|
266
|
+
display: inline-flex;
|
|
268
267
|
}
|
|
269
268
|
.trailIcon {
|
|
270
269
|
margin-inline-start: 4px;
|
|
270
|
+
display: inline-flex;
|
|
271
271
|
}
|
|
272
272
|
`,xr={medium:{w:320,h:32,p:16,f:14},large:{w:320,h:40,p:16,f:16}},br=er.div`
|
|
273
273
|
direction: ${e=>e.$theme.direction};
|
|
@@ -863,8 +863,9 @@
|
|
|
863
863
|
transition: all 0.2s;
|
|
864
864
|
border-bottom-left-radius: 50px;
|
|
865
865
|
border-bottom-right-radius: 50px;
|
|
866
|
-
`,Gr=r=>{var{children:o,menuItems:n,disabled:i,keepOpenOnItemsClicked:a,onOpen:s,onClose:d}=r,
|
|
866
|
+
`,Gr=r=>{var{children:o,menuItems:n,disabled:i,keepOpenOnItemsClicked:a,onOpen:s,onClose:d,reverseOpeningDirection:p}=r,g=u(r,["children","menuItems","disabled","keepOpenOnItemsClicked","onOpen","onClose","reverseOpeningDirection"]);const h=c(),[m,A]=t.useState(!1),[f,x]=t.useState(""),[b,v]=t.useState({top:0,left:0}),y=t.useRef(null),C=t.useRef(null),w=t.useRef(null),$=()=>{const e=Math.max(document.documentElement.clientHeight,window.innerHeight);if(C.current&&w.current){const t=C.current.getBoundingClientRect();let r={top:t.bottom,left:"ltr"===h.direction?t.left:t.right-w.current.clientWidth};"ltr"===h.direction?r.left+w.current.clientWidth>window.innerWidth&&(r.left=window.innerWidth-w.current.clientWidth):r.left&&t.right-w.current.clientWidth<0&&(r.left=0),p&&(r={top:r.top,left:"ltr"===h.direction?t.right-w.current.clientWidth:t.left},r.left<0&&(r.left=0),t.left+w.current.clientWidth>innerWidth&&(r.left=innerWidth-w.current.clientWidth)),t.bottom+w.current.clientHeight>e&&(r.top=t.top-w.current.clientHeight),r.top<0&&(r.top=0),r.top>e&&(r.top=w.current.clientHeight),v(r)}};return t.useEffect((()=>{if(C.current){const e=()=>{$()},t=e=>{var t;(null===(t=y.current)||void 0===t?void 0:t.contains(e.target))||(null==d||d(e),A(!1))};return window.addEventListener("resize",e),window.addEventListener("click",t),()=>{window.removeEventListener("resize",e),window.removeEventListener("click",t)}}}),[C,p]),t.useEffect((()=>{const e=document.getElementsByTagName("body");e&&e[0]&&(e[0].style.overflow=m?"hidden":f)}),[m]),t.useEffect((()=>{var e,t,r;x(null===(r=null===(t=null===(e=document.getElementsByTagName("body"))||void 0===e?void 0:e[0])||void 0===t?void 0:t.style)||void 0===r?void 0:r.overflow)}),[]),e.jsxs(Wr,Object.assign({$theme:h},g,{className:l("dgaui dgaui_menu",g.className),ref:y,children:[e.jsx("div",{ref:C,onClick:e=>(e=>{m?(A(!1),null==d||d(e)):($(),A(!0),null==s||s(e))})(e),className:"menuChildren",children:o}),e.jsx("div",{ref:w,className:"menueItemsContainer dgaui_hiddenScrollbar "+(m?" slide-bottom":""),style:b,onClick:e=>{a||(A(!1),null==d||d(e))},children:n})]}))},Wr=er.div`
|
|
867
867
|
direction: ${e=>e.$theme.direction};
|
|
868
|
+
display: inline-block;
|
|
868
869
|
|
|
869
870
|
.menueItemsContainer {
|
|
870
871
|
width: max-content;
|