Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-datatrans-light-box

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-datatrans-light-box - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

lib/main.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.LightBox=t(require("react")):e.LightBox=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.scrollLock="\n html {\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n html body {\n width: 100%;\n height: 100%;\n overflow: visible;\n position: fixed;\n }\n",o=t.pageFrame={zIndex:9999,position:"fixed",right:0,bottom:0,left:0,top:0,overflow:"hidden",WebkitTransform:"translate3d(0, 0, 0)",transform:"translate3d(0, 0, 0)",display:"none"},a=t.iframe={border:0,margin:0,padding:0,width:"100%",height:"100%"};t.default={scrollLock:r,pageFrame:o,iframe:a}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u="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},s=n(0),c=r(s),f=n(7),d=r(f),p=n(3),h=["production","onCancelled","onLoaded","onError","version"],y=function(e,t){return t?"https://payment.datatrans.biz/upp/jsp/upStart.jsp?"+(0,p.toUrlParams)(e):"https://pilot.datatrans.biz/upp/jsp/upStart.jsp?"+(0,p.toUrlParams)(e)},m=function(e){return"undefined"!==u(e.data)&&"error"===e.data.type},v=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onMessage=n.onMessage.bind(n),n.onCancelled=n.onCancelled.bind(n),(0,p.lockScrolling)();var r=(0,p.filterProps)(n.props,h);return n.url=y(r,n.props.production),n.origin=(0,p.parseUrl)(n.url).origin,n.state={visible:!0},n}return i(t,e),l(t,[{key:"onMessage",value:function(e){if(e.origin===this.origin)return"cancel"===e.data?this.onCancelled():"frameReady"===e.data?this.props.onLoaded():m(e)?this.props.onError(e.data):void 0}},{key:"onCancelled",value:function(){this.setState({visible:!1}),(0,p.releaseLock)(),this.props.onCancelled()}},{key:"componentDidMount",value:function(){(0,p.addListener)("message",this.onMessage)}},{key:"componentWillUnmount",value:function(){(0,p.removeListener)("message",this.onMessage),(0,p.releaseLock)()}},{key:"render",value:function(){return this.state.visible?c.default.createElement(d.default,{url:this.url,showsPaymentPage:this.props.showsPaymentPage}):c.default.createElement("div",null," do not render me ")}}]),t}(s.Component);t.default=v,v.defaultProps={onCancelled:function(){},onLoaded:function(){},onError:function(){},production:!1,theme:"DT2015",version:"1.0.2",showsPaymentPage:!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.releaseLock=t.lockScrolling=t.addListener=t.removeListener=t.parseUrl=t.toUrlParams=t.set=t.filterProps=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o);t.filterProps=function(e,t){var n=r({},e);return t.forEach(function(e){return delete n[e]}),n},t.set=function(e,t,n){return e[t]=n,e},t.toUrlParams=function(e){return Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")},t.parseUrl=function(e){var t=document.createElement("a");return t.href=e,t},t.removeListener=removeEventListener||detachEvent,t.addListener=addEventListener||attachEvent,t.lockScrolling=function(){var e=document.createElement("style");e.innerHTML=a.default.scrollLock,e.id="scroll-lock",document.getElementsByTagName("head")[0].appendChild(e)},t.releaseLock=function(){var e=document.getElementById("scroll-lock");e&&(e.outerHTML="")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.withLightBox=t.LightBoxHoc=void 0;var o=n(2),a=r(o),i=n(5),l=r(i);a.default.Hoc=l.default,t.LightBoxHoc=l.default,t.withLightBox=l.default,t.default=a.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(2),d=r(f),p=n(3),h=function(){return new Error("payment page is not loaded yet.")},y={shouldLoad:!1,visible:!1,loaded:!1,error:null,cancelled:!1},m=function(e){return function(t){function n(e){o(this,n);var t=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.load=t.load.bind(t),t.show=t.show.bind(t),t.on=t.on.bind(t),t.onLoaded=t.onLoaded.bind(t),t.onCancelled=t.onCancelled.bind(t),t.onError=t.onError.bind(t),t.config={},t.state=l({},y,{load:t.load,show:t.show,on:t.on}),t.listeners={cancelled:[],error:[],loaded:[]},t}return i(n,t),u(n,[{key:"onCancelled",value:function(){this.listeners.cancelled.forEach(function(e){return e()}),this.setState(l({},y,{cancelled:!0}))}},{key:"onError",value:function(e){var t=this;this.setState(l({},y,{error:e}),function(){return t.listeners.error.forEach(function(t){return t(e)})})}},{key:"onLoaded",value:function(){var e=this;this.setState({loaded:!0},function(){return e.listeners.loaded.forEach(function(e){return e()})})}},{key:"on",value:function(e,t){var n=this.listeners[e];n&&n.push(t)}},{key:"load",value:function(e){this.config=e,this.setState({shouldLoad:!0})}},{key:"show",value:function(){if(!this.state.loaded)throw h();this.setState({visible:!0})}},{key:"render",value:function(){return c.default.createElement("div",null,this.state.shouldLoad&&c.default.createElement(d.default,l({},this.config,{onLoaded:this.onLoaded,showsPaymentPage:this.state.visible,onCancelled:this.onCancelled,onError:this.onError})),c.default.createElement(e,l({},this.props,{lightBox:(0,p.filterProps)(this.state,["shouldLoad"])})))}}]),n}(s.Component)};t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=r(o),i=n(1),l=r(i),u=function(e){return a.default.createElement("iframe",{src:e.url,style:l.default.iframe,id:"datatransPaymentFrame",name:"datatransPaymentFrame",frameBorder:0,allowTransparency:!0})};t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(0),i=r(a),l=n(6),u=r(l),s=n(1),c=r(s),f=function(e){var t=e.showsPaymentPage?o({},c.default.pageFrame,{display:"block"}):c.default.pageFrame;return i.default.createElement("div",{style:t},i.default.createElement(u.default,{url:e.url}))};t.default=f},function(e,t,n){e.exports=n(4)}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.LightBox=t(require("react")):e.LightBox=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.scrollLock="\n html {\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n html body {\n width: 100%;\n height: 100%;\n overflow: visible;\n position: fixed;\n }\n",o=t.pageFrame={zIndex:9999,position:"fixed",right:0,bottom:0,left:0,top:0,overflow:"hidden",WebkitTransform:"translate3d(0, 0, 0)",transform:"translate3d(0, 0, 0)",display:"none"},a=t.iframe={border:0,margin:0,padding:0,width:"100%",height:"100%"};t.default={scrollLock:r,pageFrame:o,iframe:a}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u="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},s=n(0),c=r(s),f=n(7),d=r(f),p=n(3),h=["production","onCancelled","onLoaded","onError","version"],y=function(e,t){return t?"https://payment.datatrans.biz/upp/jsp/upStart.jsp?"+(0,p.toUrlParams)(e):"https://pilot.datatrans.biz/upp/jsp/upStart.jsp?"+(0,p.toUrlParams)(e)},m=function(e){return"undefined"!==u(e.data)&&"error"===e.data.type},v=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.onMessage=n.onMessage.bind(n),n.onCancelled=n.onCancelled.bind(n),(0,p.lockScrolling)();var r=(0,p.filterProps)(n.props,h);return n.url=y(r,n.props.production),n.origin=(0,p.parseUrl)(n.url).origin,n.state={visible:!0},n}return i(t,e),l(t,[{key:"onMessage",value:function(e){if(e.origin===this.origin)return"cancel"===e.data?this.onCancelled():"frameReady"===e.data?this.props.onLoaded():m(e)?this.props.onError(e.data):void 0}},{key:"onCancelled",value:function(){this.setState({visible:!1}),(0,p.releaseLock)(),this.props.onCancelled()}},{key:"componentDidMount",value:function(){(0,p.addListener)("message",this.onMessage)}},{key:"componentWillUnmount",value:function(){(0,p.removeListener)("message",this.onMessage),(0,p.releaseLock)()}},{key:"render",value:function(){return this.state.visible?c.default.createElement(d.default,{url:this.url,showsPaymentPage:this.props.showsPaymentPage}):c.default.createElement("div",null," do not render me ")}}]),t}(s.Component);t.default=v,v.defaultProps={onCancelled:function(){},onLoaded:function(){},onError:function(){},production:!1,theme:"DT2015",version:"1.0.2",showsPaymentPage:!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.releaseLock=t.lockScrolling=t.addListener=t.removeListener=t.parseUrl=t.toUrlParams=t.set=t.filterProps=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o);t.filterProps=function(e,t){var n=r({},e);return t.forEach(function(e){return delete n[e]}),n},t.set=function(e,t,n){return e[t]=n,e},t.toUrlParams=function(e){return Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")},t.parseUrl=function(e){var t=document.createElement("a");return t.href=e,t},t.removeListener=window.removeEventListener||window.detachEvent,t.addListener=window.addEventListener||window.attachEvent,t.lockScrolling=function(){var e=document.createElement("style");e.innerHTML=a.default.scrollLock,e.id="scroll-lock",document.getElementsByTagName("head")[0].appendChild(e)},t.releaseLock=function(){var e=document.getElementById("scroll-lock");e&&(e.outerHTML="")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.withLightBox=t.LightBoxHoc=void 0;var o=n(2),a=r(o),i=n(5),l=r(i);a.default.Hoc=l.default,t.LightBoxHoc=l.default,t.withLightBox=l.default,t.default=a.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(2),d=r(f),p=n(3),h=function(){return new Error("payment page is not loaded yet.")},y={shouldLoad:!1,visible:!1,loaded:!1,error:null,cancelled:!1},m=function(e){return function(t){function n(e){o(this,n);var t=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.load=t.load.bind(t),t.show=t.show.bind(t),t.on=t.on.bind(t),t.onLoaded=t.onLoaded.bind(t),t.onCancelled=t.onCancelled.bind(t),t.onError=t.onError.bind(t),t.config={},t.state=l({},y,{load:t.load,show:t.show,on:t.on}),t.listeners={cancelled:[],error:[],loaded:[]},t}return i(n,t),u(n,[{key:"onCancelled",value:function(){this.listeners.cancelled.forEach(function(e){return e()}),this.setState(l({},y,{cancelled:!0}))}},{key:"onError",value:function(e){var t=this;this.setState(l({},y,{error:e}),function(){return t.listeners.error.forEach(function(t){return t(e)})})}},{key:"onLoaded",value:function(){var e=this;this.setState({loaded:!0},function(){return e.listeners.loaded.forEach(function(e){return e()})})}},{key:"on",value:function(e,t){var n=this.listeners[e];n&&n.push(t)}},{key:"load",value:function(e){this.config=e,this.setState({shouldLoad:!0})}},{key:"show",value:function(){if(!this.state.loaded)throw h();this.setState({visible:!0})}},{key:"render",value:function(){return c.default.createElement("div",null,this.state.shouldLoad&&c.default.createElement(d.default,l({},this.config,{onLoaded:this.onLoaded,showsPaymentPage:this.state.visible,onCancelled:this.onCancelled,onError:this.onError})),c.default.createElement(e,l({},this.props,{lightBox:(0,p.filterProps)(this.state,["shouldLoad"])})))}}]),n}(s.Component)};t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=r(o),i=n(1),l=r(i),u=function(e){return a.default.createElement("iframe",{src:e.url,style:l.default.iframe,id:"datatransPaymentFrame",name:"datatransPaymentFrame",frameBorder:0,allowTransparency:!0})};t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(0),i=r(a),l=n(6),u=r(l),s=n(1),c=r(s),f=function(e){var t=e.showsPaymentPage?o({},c.default.pageFrame,{display:"block"}):c.default.pageFrame;return i.default.createElement("div",{style:t},i.default.createElement(u.default,{url:e.url}))};t.default=f},function(e,t,n){e.exports=n(4)}])});
{
"name": "react-datatrans-light-box",
"version": "1.0.3",
"version": "1.0.4",
"description": "Datatrans light box component for react apps",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

@@ -28,4 +28,4 @@

export const removeListener = removeEventListener || detachEvent
export const addListener = addEventListener || attachEvent
export const removeListener = window.removeEventListener || window.detachEvent
export const addListener = window.addEventListener || window.attachEvent

@@ -32,0 +32,0 @@ export const lockScrolling = () => {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc