@luminati-io/uikit 3.7.6 → 3.7.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -169,5 +169,5 @@ to {
|
|
169
169
|
> * {
|
170
170
|
pointer-events: auto;
|
171
171
|
}
|
172
|
-
`,CZ=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:i,containerClassName:a})=>{let{toasts:u,handlers:s}=iZ(n);return l.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...i},className:a,onMouseEnter:s.startPause,onMouseLeave:s.endPause},u.map((n=>{let i=n.position||t,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:$Y()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(i,s.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return l.createElement(AZ,{id:n.id,key:n.id,onHeightUpdate:s.updateHeight,className:n.visible?PZ:"",style:a},"custom"===n.type?WY(n.message,n):o?o(n):l.createElement(kZ,{toast:n,position:i}))})))},MZ=nZ,SZ={maxToasts:2,position:"bottom-left"},EZ=c().createContext(SZ),jZ=u(1882),IZ=u.n(jZ),TZ=_().div.withConfig({displayName:"ToastAnimatedComp",componentId:"sc-1whlqk5-0"})(["display:flex;align-items:center;will-change:transform;max-width:350px;",";"],(function(e){var t=e.$position,n=e.$visible,r=t.includes("top")?1:-1;return n?(0,x.css)(["animation:"," 0.35s cubic-bezier(.21,1.02,.73,1) forwards;"],function(e){return(0,x.keyframes)(["0%{transform:translate3d(0,","%,0) scale(.6);opacity:.5;}100%{transform:translate3d(0,0,0) scale(1);opacity:1;}"],-200*e)}(r)):(0,x.css)(["animation:"," 0.4s forwards cubic-bezier(.06,.71,.55,1)"],function(e){return(0,x.keyframes)(["0%{transform:translate3d(0,0,-1px) scale(1);opacity:1;}100%{transform:translate3d(0,","%,-1px) scale(.6);opacity:0;}"],-150*e)}(r))}));TZ.defaultProps={$position:"bottom-left"},TZ.propTypes={$position:f().oneOf(ks),$visible:f().bool};var DZ=function(e){var t=e.toast,n=t.id,r=t.type,o=t.onClose,i=t.dismissToast,a=t.message,u=t.dismissible,s=t.notDismissible,d=t.onShow,f=t.onDismiss,p=t.visible,h=(0,l.useContext)(EZ).position,m=c().useCallback((function(){i(n),IZ()(o)&&o(t)}),[n]);return(0,l.useEffect)((function(){if(p)return IZ()(d)&&d(t),function(){IZ()(f)&&f(t)}}),[p]),c().createElement(TZ,{$position:t.position||h||"bottom-left",$visible:p},c().createElement(kY,{onClose:m,type:r,dismissible:u,notDismissible:s},WY(a,t)))},NZ=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c().createElement(DZ,{toast:e})},RZ={inset:24},zZ=function(e){var t=e.position,n=e.maxToasts,r=e.containerStyle,o=e.children;return c().createElement(EZ.Provider,{value:{maxToasts:n,position:t}},o,c().createElement(CZ,{position:t,toastOptions:{duration:5e3},containerStyle:r||RZ},NZ))};function LZ(e){return LZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LZ(e)}function BZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function FZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BZ(Object(n),!0).forEach((function(t){HZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function HZ(e,t,n){return t=function(e){var t=function(e,t){if("object"!=LZ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=LZ(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LZ(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}zZ.defaultProps={position:"bottom-left",maxToasts:2},zZ.propTypes={position:f().oneOf(ks),maxToasts:f().number};var qZ={error:{duration:1/0},warning:{duration:1/0},success:{duration:5e3},info:{duration:5e3},generic:{duration:5e3}},UZ=[],WZ=function(e){return e||(UZ.length=0),MZ.dismiss(e)},GZ=function(){var e=
|
172
|
+
`,CZ=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:i,containerClassName:a})=>{let{toasts:u,handlers:s}=iZ(n);return l.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...i},className:a,onMouseEnter:s.startPause,onMouseLeave:s.endPause},u.map((n=>{let i=n.position||t,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:$Y()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(i,s.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return l.createElement(AZ,{id:n.id,key:n.id,onHeightUpdate:s.updateHeight,className:n.visible?PZ:"",style:a},"custom"===n.type?WY(n.message,n):o?o(n):l.createElement(kZ,{toast:n,position:i}))})))},MZ=nZ,SZ={maxToasts:2,position:"bottom-left"},EZ=c().createContext(SZ),jZ=u(1882),IZ=u.n(jZ),TZ=c().memo(_().div.withConfig({displayName:"ToastAnimatedComp",componentId:"sc-1whlqk5-0"})(["display:flex;align-items:center;will-change:transform;max-width:350px;",";"],(function(e){var t=e.$position,n=e.$visible,r=t.includes("top")?1:-1;return n?(0,x.css)(["animation:"," 0.35s cubic-bezier(.21,1.02,.73,1) forwards;"],function(e){return(0,x.keyframes)(["0%{transform:translate3d(0,","%,0) scale(.6);opacity:.5;}100%{transform:translate3d(0,0,0) scale(1);opacity:1;}"],-200*e)}(r)):(0,x.css)(["animation:"," 0.4s forwards cubic-bezier(.06,.71,.55,1)"],function(e){return(0,x.keyframes)(["0%{transform:translate3d(0,0,-1px) scale(1);opacity:1;}100%{transform:translate3d(0,","%,-1px) scale(.6);opacity:0;}"],-150*e)}(r))})));TZ.defaultProps={$position:"bottom-left"},TZ.propTypes={$position:f().oneOf(ks),$visible:f().bool};var DZ=function(e){var t=e.toast,n=t.id,r=t.type,o=t.onClose,i=t.dismissToast,a=t.message,u=t.dismissible,s=t.notDismissible,d=t.onShow,f=t.onDismiss,p=t.visible,h=(0,l.useContext)(EZ).position,m=c().useCallback((function(){i(n),IZ()(o)&&o(t)}),[n]);return(0,l.useEffect)((function(){if(p)return IZ()(d)&&d(t),function(){IZ()(f)&&f(t)}}),[p]),c().createElement(TZ,{$position:t.position||h||"bottom-left",$visible:p},c().createElement(kY,{onClose:m,type:r,dismissible:u,notDismissible:s},WY(a,t)))},NZ=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c().createElement(DZ,{toast:e})},RZ={inset:24},zZ=function(e){var t=e.position,n=e.maxToasts,r=e.containerStyle,o=e.children;return c().createElement(EZ.Provider,{value:{maxToasts:n,position:t}},o,c().createElement(CZ,{position:t,toastOptions:{duration:5e3},containerStyle:r||RZ},NZ))};function LZ(e){return LZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LZ(e)}function BZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function FZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BZ(Object(n),!0).forEach((function(t){HZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function HZ(e,t,n){return t=function(e){var t=function(e,t){if("object"!=LZ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=LZ(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LZ(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}zZ.defaultProps={position:"bottom-left",maxToasts:2},zZ.propTypes={position:f().oneOf(ks),maxToasts:f().number};var qZ={error:{duration:1/0},warning:{duration:1/0},success:{duration:5e3},info:{duration:5e3},generic:{duration:5e3}},UZ=[],WZ=function(e){return e||(UZ.length=0),MZ.dismiss(e)},GZ=function(){var e=iZ().toasts,t=(0,l.useContext)(EZ),n=(0,l.useCallback)((function(){var n=e.filter((function(e){return e.visible}));if(!(n.length>=t.maxToasts||0==UZ.length)){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return VZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VZ(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(UZ.shift(),2),o=r[0],i=r[1];MZ.custom(o,i)}}),[e]),r=(0,l.useRef)(n);(0,l.useEffect)((function(){r.current=n}),[n]);var o=(0,l.useCallback)((function(e,t){var n=Date.now()+Math.random(),o=t.type||"generic",i=qZ[o]||qZ.generic;return UZ.push([e,FZ(FZ(FZ({id:n,type:o},i),t),{},{dismissToast:WZ})]),r.current(),t.id||n}),[]),i=(0,l.useCallback)((function(t){var n=e.find((function(e){return e.id==t}));return n?{id:t,active:!0}:(n=UZ.find((function(e){return e[1].id==t})),n?{id:t,active:!1}:null)}),[e]);(0,l.useEffect)((function(){n()}),[n]);var a=(0,l.useMemo)((function(){return{error:function(e,t){return o(e,FZ(FZ({},t),{},{type:"error"}))},warning:function(e,t){return o(e,FZ(FZ({},t),{},{type:"warning"}))},success:function(e,t){return o(e,FZ(FZ({},t),{},{type:"success"}))},info:function(e,t){return o(e,FZ(FZ({},t),{},{type:"info"}))},generic:function(e,t){return o(e,FZ(FZ({},t),{},{type:"generic"}))}}}),[o]);return{enqueueToast:o,dismissToast:WZ,toast:a,getToast:i}};const $Z=a})(),s.default})()));
|
173
173
|
//# sourceMappingURL=uikit.production.min.js.map
|