@cleartrip/ct-platform-drawer 4.3.35 → 4.4.0-SNAPSHOT-drawer-body-lock.0
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/Drawer.d.ts.map +1 -1
- package/dist/Drawer.types.d.ts +1 -0
- package/dist/Drawer.types.d.ts.map +1 -1
- package/dist/ct-platform-drawer.cjs.js +1 -1
- package/dist/ct-platform-drawer.cjs.js.map +1 -1
- package/dist/ct-platform-drawer.esm.js +1 -1
- package/dist/ct-platform-drawer.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/Drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../packages/components/Drawer/src/Drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAkB7C,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../packages/components/Drawer/src/Drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAkB7C,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyIjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/Drawer.types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.types.d.ts","sourceRoot":"","sources":["../packages/components/Drawer/src/Drawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,WAAW;IAIxB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAI5C,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Drawer.types.d.ts","sourceRoot":"","sources":["../packages/components/Drawer/src/Drawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,WAAW;IAIxB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAI5C,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAK9B,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react-dom"),r=require("classnames"),t=require("react"),d=require("@cleartrip/ct-design-icons"),i=require("@cleartrip/ct-platform-utils");function l(e){return e&&e.__esModule?e:{default:e}}var _=l(o),a=l(r);var u={modal__container:"index-module_modal__container__srA-N",modal:"index-module_modal__3imuM",left:"index-module_left__jAupb",right:"index-module_right__n7i2S",top:"index-module_top__3q-P0",bottom:"index-module_bottom__I5s6E",overlay:"index-module_overlay__-8Le1","transition-end":"index-module_transition-end__ydkLj",open:"index-module_open__30JoF","drawer-header":"index-module_drawer-header__IGV4R","drawer-close-btn__container":"index-module_drawer-close-btn__container__a0chH","close-icon":"index-module_close-icon__G49OX"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===o&&r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}}(".index-module_modal__container__srA-N .index-module_modal__3imuM{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_left__jAupb{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_right__n7i2S{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_top__3q-P0{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_bottom__I5s6E{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__srA-N .index-module_overlay__-8Le1{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_left__jAupb,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_right__n7i2S{transform:translateX(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_bottom__I5s6E,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_top__3q-P0{transform:translateY(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_overlay__-8Le1{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__IGV4R{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH:hover{background:#fff}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH .index-module_close-icon__G49OX{height:24px;width:24px}");exports.Drawer=function(o){var r,l=o.isOpen,s=o.handleClose,c=o.onClose,m=o.children,x=o.direction,f=void 0===x?"left":x,v=o.showClose,p=void 0!==v&&v,h=o.overlay,y=void 0===h||h,w=o.closeOnOutsideClick,g=void 0!==w&&w,b=t.useRef(null),
|
|
1
|
+
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react-dom"),r=require("classnames"),t=require("react"),d=require("@cleartrip/ct-design-icons"),i=require("@cleartrip/ct-platform-utils");function l(e){return e&&e.__esModule?e:{default:e}}var _=l(o),a=l(r);var u={modal__container:"index-module_modal__container__srA-N",modal:"index-module_modal__3imuM",left:"index-module_left__jAupb",right:"index-module_right__n7i2S",top:"index-module_top__3q-P0",bottom:"index-module_bottom__I5s6E",overlay:"index-module_overlay__-8Le1","transition-end":"index-module_transition-end__ydkLj",open:"index-module_open__30JoF","drawer-header":"index-module_drawer-header__IGV4R","drawer-close-btn__container":"index-module_drawer-close-btn__container__a0chH","close-icon":"index-module_close-icon__G49OX"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===o&&r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}}(".index-module_modal__container__srA-N .index-module_modal__3imuM{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_left__jAupb{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_right__n7i2S{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_top__3q-P0{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_bottom__I5s6E{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__srA-N .index-module_overlay__-8Le1{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_left__jAupb,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_right__n7i2S{transform:translateX(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_bottom__I5s6E,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_top__3q-P0{transform:translateY(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_overlay__-8Le1{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__IGV4R{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH:hover{background:#fff}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH .index-module_close-icon__G49OX{height:24px;width:24px}");exports.Drawer=function(o){var r,l=o.isOpen,s=o.handleClose,c=o.onClose,m=o.children,x=o.direction,f=void 0===x?"left":x,v=o.showClose,p=void 0!==v&&v,h=o.overlay,y=void 0===h||h,w=o.closeOnOutsideClick,g=void 0!==w&&w,b=o.useBodyLock,j=void 0===b||b,A=t.useRef(null),N=t.useRef(null),k=t.useRef(null),C=t.useRef(null);if(!i.isServer()&&window&&document&&(N.current=document.querySelector("body"),k.current=document.querySelector("#root, #__next")),!i.isServer()&&window&&document){var q=document.getElementById("drawer-parent");C.current=q||function(){if(!i.isServer()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}t.useEffect((function(){var e;null===(e=null==N?void 0:N.current)||void 0===e||e.appendChild(null==C?void 0:C.current);var n=null==C?void 0:C.current,o=null==N?void 0:N.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),t.useEffect((function(){if(j){N&&N.current&&(l?(N.current.style.overflow="hidden",(null==k?void 0:k.current)&&(k.current.style.overflow="hidden",k.current.style.height=window.innerHeight+"px")):(N.current.style.overflow="unset",(null==k?void 0:k.current)&&(k.current.style.overflow="unset",k.current.style.height="unset")))}}),[l,j]);var S=function(e,n){var o=t.useState(!1),r=o[0],d=o[1];return t.useEffect((function(){var o;return e&&!r?d(!0):!e&&r&&(o=setTimeout((function(){return d(!1)}),n)),function(){clearTimeout(o)}}),[n,e,r]),r}(l,500);return S||l?n.jsx(n.Fragment,{children:_.default.createPortal(n.jsxs("div",e.__assign({"aria-hidden":l?"false":"true",className:a.default(u.modal__container,(r={},r[u.open]=l,r[u["transition-end"]]=S,r)),onClick:function(e){var n;g&&A.current&&(null===(n=A.current)||void 0===n?void 0:n.contains(e.target))&&s()}},{children:[n.jsxs("div",e.__assign({className:a.default(u.modal,u[f]),role:"dialog"},{children:[p&&n.jsx("div",e.__assign({className:u["drawer-header"]},{children:n.jsx("button",e.__assign({className:u["drawer-close-btn__container"],onClick:function(e){s(e),c()}},{children:n.jsx(d.Cross,{className:u["close-icon"],crossColor:"#1A1A1A"})}))})),m]})),y&&n.jsx("div",{"aria-hidden":l?"false":"true",className:"".concat(u.overlay),ref:A})]})),null==C?void 0:C.current)}):null};
|
|
2
2
|
//# sourceMappingURL=ct-platform-drawer.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-platform-drawer.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/Drawer.tsx","../packages/components/Drawer/src/useMountTransition.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","modalRef","useRef","bodyRef","innerDiv","portalParentRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","height","innerHeight","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","jsx","_Fragment","Fragment","ReactDOM","default","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"izBAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,k2ECEsC,SAACe,SACnCC,
|
|
1
|
+
{"version":3,"file":"ct-platform-drawer.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/Drawer.tsx","../packages/components/Drawer/src/useMountTransition.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","_g","useBodyLock","modalRef","useRef","bodyRef","innerDiv","portalParentRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","height","innerHeight","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","jsx","_Fragment","Fragment","ReactDOM","default","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"izBAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,k2ECEsC,SAACe,SACnCC,EAAMD,EAAAC,OACNC,EAAWF,EAAAE,YACXC,EAAOH,EAAAG,QACPC,EAAQJ,EAAAI,SACRC,EAAkBL,EAAAM,UAAlBA,OAAY,IAAAD,EAAA,SACZE,EAAAP,EAAAQ,UAAAA,OAAS,IAAAD,GAAQA,EACjBE,YAAAC,cAAcD,EACdE,EAA2BX,EAAAY,oBAA3BA,OAAsB,IAAAD,KACtBE,EAAAb,EAAAc,YAAAA,OAAW,IAAAD,GAAOA,EAEZE,EAAWC,SAAuB,MAClCC,EAAUD,SAA+B,MACzCE,EAAWF,SAA+B,MAC1CG,EAAkBH,SAA2B,MAOnD,IALKI,EAAQA,YAAMC,QAAUjC,WACzB6B,EAAQK,QAAUlC,SAASmC,cAAc,QACzCL,EAASI,QAAUlC,SAASmC,cAAc,oBAGzCH,EAAQA,YAAMC,QAAUjC,SAAU,CACnC,IAAMoC,EAAgBpC,SAASqC,eAAe,iBAE1CN,EA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mC,GAAoBnC,EAKrB4C,EACKC,IAAAC,EAAAC,SAAA,CAAA5C,SAAA6C,EAAQC,QAACC,aACNC,EAAAA,KACiB,MAAAC,WAAA,CAAA,cAAApD,EAAS,QAAU,OAChCqD,UAAWC,EAAUL,QAACM,EAAyB,kBAACC,EAAA,CAAA,EAC5CA,EAACD,EAAa,MAAIvD,EAClBwD,EAACD,EAAO,mBAAoBpB,MAEhCsB,QAAS,SAACC,SAEF/C,GACAG,EAASO,UACS,QAAlBtB,EAAAe,EAASO,eAAS,IAAAtB,OAAA,EAAAA,EAAA4D,SAASD,EAAME,UAEjC3D,GAER,cAEAkD,EAAAA,KACI,MAAAC,EAAAA,SAAA,CAAAC,UAAWC,EAAUL,QACjBM,EAAc,MACdA,EAAOlD,IAEXwD,KAAK,UAAQ,CAAA1D,SAAA,CAEZI,GACGqC,wBAAKS,UAAWE,EAAO,kBACnB,CAAApD,SAAAyC,EAAAC,IAAA,SAAAO,EAAAA,SAAA,CACIC,UACIE,EAAO,+BAEXE,QAAS,SAACK,GACN7D,EAAY6D,GACZ5D,GACH,GAED,CAAAC,SAAAyC,EAAAC,IAACkB,QAAK,CACFV,UAAWE,EAAO,cAClBS,WAAW,kBAK1B7D,MAEJM,GACGmC,EAAAC,IAAA,MAAA,CAAA,cACiB7C,EAAS,QAAU,OAChCqD,UAAW,GAAAY,OAAGV,EAAgB,SAC9BtE,IAAK6B,QAIjBI,aAAA,EAAAA,EAAiBG,WAzDlB,IA6Df","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,Fragment as o,jsxs as t}from"react/jsx-runtime";import d from"react-dom";import r from"classnames";import{useState as i,useEffect as l,useRef as _}from"react";import{Cross as a}from"@cleartrip/ct-design-icons";import{isServer as u}from"@cleartrip/ct-platform-utils";var m={modal__container:"index-module_modal__container__srA-N",modal:"index-module_modal__3imuM",left:"index-module_left__jAupb",right:"index-module_right__n7i2S",top:"index-module_top__3q-P0",bottom:"index-module_bottom__I5s6E",overlay:"index-module_overlay__-8Le1","transition-end":"index-module_transition-end__ydkLj",open:"index-module_open__30JoF","drawer-header":"index-module_drawer-header__IGV4R","drawer-close-btn__container":"index-module_drawer-close-btn__container__a0chH","close-icon":"index-module_close-icon__G49OX"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css","top"===o&&t.firstChild?t.insertBefore(d,t.firstChild):t.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e))}}(".index-module_modal__container__srA-N .index-module_modal__3imuM{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_left__jAupb{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_right__n7i2S{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_top__3q-P0{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_bottom__I5s6E{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__srA-N .index-module_overlay__-8Le1{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_left__jAupb,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_right__n7i2S{transform:translateX(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_bottom__I5s6E,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_top__3q-P0{transform:translateY(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_overlay__-8Le1{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__IGV4R{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH:hover{background:#fff}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH .index-module_close-icon__G49OX{height:24px;width:24px}");var c=function(c){var s,x=c.isOpen,f=c.handleClose,p=c.onClose,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,Fragment as o,jsxs as t}from"react/jsx-runtime";import d from"react-dom";import r from"classnames";import{useState as i,useEffect as l,useRef as _}from"react";import{Cross as a}from"@cleartrip/ct-design-icons";import{isServer as u}from"@cleartrip/ct-platform-utils";var m={modal__container:"index-module_modal__container__srA-N",modal:"index-module_modal__3imuM",left:"index-module_left__jAupb",right:"index-module_right__n7i2S",top:"index-module_top__3q-P0",bottom:"index-module_bottom__I5s6E",overlay:"index-module_overlay__-8Le1","transition-end":"index-module_transition-end__ydkLj",open:"index-module_open__30JoF","drawer-header":"index-module_drawer-header__IGV4R","drawer-close-btn__container":"index-module_drawer-close-btn__container__a0chH","close-icon":"index-module_close-icon__G49OX"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css","top"===o&&t.firstChild?t.insertBefore(d,t.firstChild):t.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e))}}(".index-module_modal__container__srA-N .index-module_modal__3imuM{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_left__jAupb{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_right__n7i2S{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_top__3q-P0{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_bottom__I5s6E{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__srA-N .index-module_overlay__-8Le1{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_left__jAupb,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_right__n7i2S{transform:translateX(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_bottom__I5s6E,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_top__3q-P0{transform:translateY(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_overlay__-8Le1{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__IGV4R{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH:hover{background:#fff}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH .index-module_close-icon__G49OX{height:24px;width:24px}");var c=function(c){var s,x=c.isOpen,f=c.handleClose,p=c.onClose,v=c.children,h=c.direction,y=void 0===h?"left":h,w=c.showClose,b=void 0!==w&&w,g=c.overlay,A=void 0===g||g,N=c.closeOnOutsideClick,k=void 0!==N&&N,j=c.useBodyLock,C=void 0===j||j,L=_(null),I=_(null),E=_(null),G=_(null);if(!u()&&window&&document&&(I.current=document.querySelector("body"),E.current=document.querySelector("#root, #__next")),!u()&&window&&document){var S=document.getElementById("drawer-parent");G.current=S||function(){if(!u()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}l((function(){var e;null===(e=null==I?void 0:I.current)||void 0===e||e.appendChild(null==G?void 0:G.current);var n=null==G?void 0:G.current,o=null==I?void 0:I.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),l((function(){if(C){I&&I.current&&(x?(I.current.style.overflow="hidden",(null==E?void 0:E.current)&&(E.current.style.overflow="hidden",E.current.style.height=window.innerHeight+"px")):(I.current.style.overflow="unset",(null==E?void 0:E.current)&&(E.current.style.overflow="unset",E.current.style.height="unset")))}}),[x,C]);var F=function(e,n){var o=i(!1),t=o[0],d=o[1];return l((function(){var o;return e&&!t?d(!0):!e&&t&&(o=setTimeout((function(){return d(!1)}),n)),function(){clearTimeout(o)}}),[n,e,t]),t}(x,500);return F||x?n(o,{children:d.createPortal(t("div",e({"aria-hidden":x?"false":"true",className:r(m.modal__container,(s={},s[m.open]=x,s[m["transition-end"]]=F,s)),onClick:function(e){var n;k&&L.current&&(null===(n=L.current)||void 0===n?void 0:n.contains(e.target))&&f()}},{children:[t("div",e({className:r(m.modal,m[y]),role:"dialog"},{children:[b&&n("div",e({className:m["drawer-header"]},{children:n("button",e({className:m["drawer-close-btn__container"],onClick:function(e){f(e),p()}},{children:n(a,{className:m["close-icon"],crossColor:"#1A1A1A"})}))})),v]})),A&&n("div",{"aria-hidden":x?"false":"true",className:"".concat(m.overlay),ref:L})]})),null==G?void 0:G.current)}):null};export{c as Drawer};
|
|
2
2
|
//# sourceMappingURL=ct-platform-drawer.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-platform-drawer.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/useMountTransition.tsx","../packages/components/Drawer/src/Drawer.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","Drawer","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","modalRef","useRef","bodyRef","innerDiv","portalParentRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","height","innerHeight","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","_Fragment","ReactDOM","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"g1BAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,m1ECvBA,ICyBMe,EAAgC,SAACC,SACnCC,
|
|
1
|
+
{"version":3,"file":"ct-platform-drawer.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/useMountTransition.tsx","../packages/components/Drawer/src/Drawer.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","Drawer","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","_g","useBodyLock","modalRef","useRef","bodyRef","innerDiv","portalParentRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","height","innerHeight","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","_Fragment","ReactDOM","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"g1BAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,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AAvD,SAAA,CAEZI,GACGqC,WAAKM,UAAWE,EAAO,kBACnB,CAAAjD,SAAAyC,EAAA,SAAAK,EAAA,CACIC,UACIE,EAAO,+BAEXE,QAAS,SAACK,GACN1D,EAAY0D,GACZzD,GACH,GAED,CAAAC,SAAAyC,EAACgB,EAAK,CACFV,UAAWE,EAAO,cAClBS,WAAW,kBAK1B1D,MAEJM,GACGmC,EAAA,MAAA,CAAA,cACiB5C,EAAS,QAAU,OAChCkD,UAAW,GAAAY,OAAGV,EAAgB,SAC9BpE,IAAK8B,QAIjBI,aAAA,EAAAA,EAAiBG,WAzDlB,IA6Df","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-platform-drawer",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-SNAPSHOT-drawer-body-lock.0",
|
|
4
4
|
"description": "Drawer Component",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/ct-platform-drawer.cjs.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@cleartrip/ct-design-icons": "7.0.0",
|
|
14
14
|
"classnames": "^2.5.1",
|
|
15
|
-
"@cleartrip/ct-platform-utils": "4.
|
|
15
|
+
"@cleartrip/ct-platform-utils": "4.4.0-SNAPSHOT-drawer-body-lock.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=16.8.0",
|