@monei-js/components 1.7.3 → 1.7.5

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.
@@ -1,5 +1,5 @@
1
- import { BizumProps } from './types';
2
1
  import { MoneiComponent } from '../../types/component';
3
- export * from './types';
2
+ import { BizumProps } from './types';
4
3
  export * from './modal';
4
+ export * from './types';
5
5
  export declare const Bizum: MoneiComponent<BizumProps>;
@@ -15609,24 +15609,28 @@ var options$4 = {
15609
15609
  type: zoid.PROP_TYPE.FUNCTION,
15610
15610
  required: false,
15611
15611
  value: function value(_ref2) {
15612
- var props = _ref2.props;
15613
- var shouldOpen = true;
15614
-
15615
- if (props.onBeforeOpen) {
15616
- shouldOpen = props.onBeforeOpen();
15617
- }
15618
-
15619
- if (!shouldOpen) return function () {};
15612
+ var props = _ref2.props,
15613
+ state = _ref2.state;
15620
15614
  var rootNode = document.createElement('div');
15621
15615
  document.body.appendChild(rootNode);
15622
15616
  return function (_ref3) {
15623
15617
  var amount = _ref3.amount,
15624
15618
  currency = _ref3.currency;
15619
+ if (state.isOpen) return;
15620
+ var shouldOpen = true;
15621
+
15622
+ if (props.onBeforeOpen) {
15623
+ shouldOpen = props.onBeforeOpen();
15624
+ }
15625
+
15626
+ if (!shouldOpen) return;
15627
+ state.isOpen = true;
15625
15628
  var bizumModal = new BizumModal(_extends({
15626
15629
  amount: amount,
15627
15630
  currency: currency
15628
15631
  }, props, {
15629
15632
  onClose: function onClose() {
15633
+ state.isOpen = false;
15630
15634
  window.onpopstate = null;
15631
15635
  document.body.style.overflow = '';
15632
15636
  },
@@ -15922,19 +15926,19 @@ var options$7 = {
15922
15926
  required: false,
15923
15927
  value: function value(_ref2) {
15924
15928
  var props = _ref2.props;
15925
- var shouldOpen = true;
15926
-
15927
- if (props.onBeforeOpen) {
15928
- shouldOpen = props.onBeforeOpen();
15929
- }
15930
-
15931
- if (!shouldOpen) return;
15932
15929
  var rootNode = document.createElement('div');
15933
15930
  document.body.appendChild(rootNode);
15934
15931
  return function (_ref3) {
15935
15932
  var amount = _ref3.amount,
15936
15933
  currency = _ref3.currency,
15937
15934
  accountId = _ref3.accountId;
15935
+ var shouldOpen = true;
15936
+
15937
+ if (props.onBeforeOpen) {
15938
+ shouldOpen = props.onBeforeOpen();
15939
+ }
15940
+
15941
+ if (!shouldOpen) return;
15938
15942
  var cofidisModal = new CofidisModal(_extends({}, props, {
15939
15943
  amount: amount,
15940
15944
  currency: currency,
@@ -16237,19 +16241,19 @@ var options$a = {
16237
16241
  required: false,
16238
16242
  value: function value(_ref2) {
16239
16243
  var props = _ref2.props;
16240
- var shouldOpen = true;
16241
-
16242
- if (props.onBeforeOpen) {
16243
- shouldOpen = props.onBeforeOpen();
16244
- }
16245
-
16246
- if (!shouldOpen) return;
16247
16244
  var rootNode = document.createElement('div');
16248
16245
  document.body.appendChild(rootNode);
16249
16246
  return function (_ref3) {
16250
16247
  var amount = _ref3.amount,
16251
16248
  currency = _ref3.currency,
16252
16249
  accountId = _ref3.accountId;
16250
+ var shouldOpen = true;
16251
+
16252
+ if (props.onBeforeOpen) {
16253
+ shouldOpen = props.onBeforeOpen();
16254
+ }
16255
+
16256
+ if (!shouldOpen) return;
16253
16257
  var cofidisModal = new CofidisLoanModal(_extends({}, props, {
16254
16258
  amount: amount,
16255
16259
  currency: currency,