@cleartrip/ct-platform-drawer 2.3.0 → 2.5.0-beta.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":"
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../packages/components/Drawer/src/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAuIjC,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;
|
|
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,YAAY,CAAC,EAAE,OAAO,CAAA;CACzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react
|
|
1
|
+
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),d=require("react-dom"),i=require("classnames"),r=require("@cleartrip/ct-design-icons"),t=require("@cleartrip/ct-platform-utils");function _(e){return e&&e.__esModule?e:{default:e}}var l=_(d),a=_(i);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(e&&"undefined"!=typeof document){var d=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&d.firstChild?d.insertBefore(i,d.firstChild):d.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.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(d){var i,_=d.isOpen,s=d.handleClose,c=d.onClose,m=d.children,x=d.direction,f=void 0===x?"left":x,p=d.showClose,v=void 0!==p&&p,h=d.overlay,y=void 0===h||h,b=d.outsideClick,w=void 0!==b&&b,g=o.useRef(null),j=o.useRef(null),A=o.useRef(null);!t.isServer()&&window&&document&&(g.current=document.querySelector("body"));var N=o.useCallback((function(){if(!t.isServer()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}),[]);if(!t.isServer()&&window&&document){var k=document.getElementById("drawer-parent");j.current=k||N()}o.useEffect((function(){var e;null===(e=null==g?void 0:g.current)||void 0===e||e.appendChild(null==j?void 0:j.current);var n=null==j?void 0:j.current,o=null==g?void 0:g.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),o.useEffect((function(){g&&g.current&&(g.current.style.overflow=_?"hidden":"unset")}),[_]);var C=function(e,n){var d=o.useState(!1),i=d[0],r=d[1];return o.useEffect((function(){var o;return e&&!i?r(!0):!e&&i&&(o=setTimeout((function(){return r(!1)}),n)),function(){clearTimeout(o)}}),[n,e,i]),i}(_,500);return C||_?n.jsx(n.Fragment,{children:l.default.createPortal(n.jsxs("div",e.__assign({"aria-hidden":_?"false":"true",className:a.default(u.modal__container,(i={},i[u.open]=_,i[u["transition-end"]]=C,i)),onClick:function(e){var n;w&&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:[v&&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(r.Cross,{className:u["close-icon"],crossColor:"#1A1A1A"})}))})),m]})),y&&n.jsx("div",{"aria-hidden":_?"false":"true",className:"".concat(u.overlay),ref:A})]})),null==j?void 0:j.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","bodyRef","useRef","isServer","window","querySelector","
|
|
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","outsideClick","bodyRef","useRef","portalParentRef","modalRef","isServer","window","current","querySelector","createPortalParent","useCallback","drawerParent","setAttribute","parentElement","getElementById","useEffect","portal","bodyEl","remove","overflow","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,GAAKF,GAA2B,oBAAbG,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,k2ECZsC,SAACe,SACnCC,WACAC,EAAWF,EAAAE,YACXC,EAAOH,EAAAG,Q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I,GAAmB,IACXH,GAAaD,IACrBK,EAAYC,YACR,WAAM,OAAAF,GAAmB,EAAnB,GACNF,IAGD,WACHK,aAAaF,EACjB,CACH,GAAE,CAACH,EAAcD,EAAWD,IAEtBA,CACX,CD+D4BQ,CAAmBvC,EAAQ,KACnD,OAAK+B,GAAoB/B,EAKrBwC,EACKC,IAAAC,EAAAC,SAAA,CAAAxC,SAAAyC,EAAQC,QAACC,aACNC,EAAAA,KACiB,MAAAC,WAAA,CAAA,cAAAhD,EAAS,QAAU,OAChCiD,UAAWC,EAAUL,QAACM,EAAyB,kBAACC,EAAA,CAAA,EAC5CA,EAACD,EAAa,MAAInD,EAClBoD,EAACD,EAAO,mBAAoBpB,MAEhCsB,QAAS,SAACC,SAEF3C,GACAI,EAASG,UACS,QAAlBnB,EAAAgB,EAASG,eAAS,IAAAnB,OAAA,EAAAA,EAAAwD,SAASD,EAAME,UAEjCvD,GAER,cAEA8C,EAAAA,KACI,MAAAC,EAAAA,SAAA,CAAAC,UAAWC,EAAUL,QACjBM,EAAc,MACdA,EAAO9C,IAEXoD,KAAK,UAAQ,CAAAtD,SAAA,CAEZI,GACGiC,wBAAKS,UAAWE,EAAO,kBACnB,CAAAhD,SAAAqC,EAAAC,IAAA,SAAAO,EAAAA,SAAA,CACIC,UACIE,EAAO,+BAEXE,QAAS,SAACK,GACNzD,EAAYyD,GACZxD,GACH,GAED,CAAAC,SAAAqC,EAAAC,IAACkB,QAAK,CACFV,UAAWE,EAAO,cAClBS,WAAW,kBAK1BzD,MAEJM,GACG+B,EAAAC,IAAA,MAAA,CAAA,cACiBzC,EAAS,QAAU,OAChCiD,UAAW,GAAAY,OAAGV,EAAgB,SAC9BlE,IAAK8B,QAIjBD,aAAA,EAAAA,EAAiBI,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 d}from"react/jsx-runtime";import t from"react
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,Fragment as o,jsxs as d}from"react/jsx-runtime";import{useState as i,useEffect as t,useRef as r,useCallback as _}from"react";import l from"react-dom";import a from"classnames";import{Cross as u}from"@cleartrip/ct-design-icons";import{isServer as m}from"@cleartrip/ct-platform-utils";var c={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(e&&"undefined"!=typeof document){var d=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&d.firstChild?d.insertBefore(i,d.firstChild):d.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.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 s=function(s){var x,f=s.isOpen,p=s.handleClose,v=s.onClose,h=s.children,y=s.direction,b=void 0===y?"left":y,w=s.showClose,g=void 0!==w&&w,A=s.overlay,N=void 0===A||A,k=s.outsideClick,j=void 0!==k&&k,C=r(null),I=r(null),L=r(null);!m()&&window&&document&&(C.current=document.querySelector("body"));var E=_((function(){if(!m()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}),[]);if(!m()&&window&&document){var G=document.getElementById("drawer-parent");I.current=G||E()}t((function(){var e;null===(e=null==C?void 0:C.current)||void 0===e||e.appendChild(null==I?void 0:I.current);var n=null==I?void 0:I.current,o=null==C?void 0:C.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),t((function(){C&&C.current&&(C.current.style.overflow=f?"hidden":"unset")}),[f]);var F=function(e,n){var o=i(!1),d=o[0],r=o[1];return t((function(){var o;return e&&!d?r(!0):!e&&d&&(o=setTimeout((function(){return r(!1)}),n)),function(){clearTimeout(o)}}),[n,e,d]),d}(f,500);return F||f?n(o,{children:l.createPortal(d("div",e({"aria-hidden":f?"false":"true",className:a(c.modal__container,(x={},x[c.open]=f,x[c["transition-end"]]=F,x)),onClick:function(e){var n;j&&L.current&&(null===(n=L.current)||void 0===n?void 0:n.contains(e.target))&&p()}},{children:[d("div",e({className:a(c.modal,c[b]),role:"dialog"},{children:[g&&n("div",e({className:c["drawer-header"]},{children:n("button",e({className:c["drawer-close-btn__container"],onClick:function(e){p(e),v()}},{children:n(u,{className:c["close-icon"],crossColor:"#1A1A1A"})}))})),h]})),N&&n("div",{"aria-hidden":f?"false":"true",className:"".concat(c.overlay),ref:L})]})),null==I?void 0:I.current)}):null};export{s 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","
|
|
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","outsideClick","bodyRef","useRef","portalParentRef","modalRef","isServer","window","current","querySelector","createPortalParent","useCallback","drawerParent","setAttribute","parentElement","getElementById","useEffect","portal","bodyEl","remove","overflow","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":"i2BAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,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,GAG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awer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-beta.0",
|
|
4
4
|
"description": "Drawer Component",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/ct-platform-drawer.cjs.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@cleartrip/ct-design-icons": "7.0.0",
|
|
14
14
|
"classnames": "^2.5.1",
|
|
15
15
|
"styled-components": "^5.3.11",
|
|
16
|
-
"@cleartrip/ct-platform-utils": "2.
|
|
16
|
+
"@cleartrip/ct-platform-utils": "2.2.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=16.8.0",
|