@monei-js/components 1.7.6 → 1.7.7
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/components.cjs.development.js +20 -5
- package/dist/components.cjs.development.js.map +1 -1
- package/dist/components.cjs.production.min.js +1 -1
- package/dist/components.cjs.production.min.js.map +1 -1
- package/dist/components.esm.js +20 -5
- package/dist/components.esm.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
|
@@ -830,7 +830,7 @@ var loadScript = function loadScript(src, nonce, dataset, forceReload) {
|
|
|
830
830
|
if (forceReload) {
|
|
831
831
|
existingScript.remove();
|
|
832
832
|
} else {
|
|
833
|
-
resolve();
|
|
833
|
+
resolve(existingScript);
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
836
|
}
|
|
@@ -839,7 +839,7 @@ var loadScript = function loadScript(src, nonce, dataset, forceReload) {
|
|
|
839
839
|
script.src = src;
|
|
840
840
|
|
|
841
841
|
script.onload = function () {
|
|
842
|
-
return resolve();
|
|
842
|
+
return resolve(script);
|
|
843
843
|
};
|
|
844
844
|
|
|
845
845
|
script.onerror = function (error) {
|
|
@@ -15165,7 +15165,7 @@ var namespace = 'monei-paypal';
|
|
|
15165
15165
|
|
|
15166
15166
|
var onLoadPaypal = /*#__PURE__*/function () {
|
|
15167
15167
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(props, state, src) {
|
|
15168
|
-
var defaultStyle, token;
|
|
15168
|
+
var script, defaultStyle, token;
|
|
15169
15169
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
15170
15170
|
while (1) {
|
|
15171
15171
|
switch (_context2.prev = _context2.next) {
|
|
@@ -15177,12 +15177,14 @@ var onLoadPaypal = /*#__PURE__*/function () {
|
|
|
15177
15177
|
}, true);
|
|
15178
15178
|
|
|
15179
15179
|
case 2:
|
|
15180
|
+
script = _context2.sent;
|
|
15181
|
+
state.__scriptId = script.dataset.uidAuto;
|
|
15180
15182
|
defaultStyle = {
|
|
15181
15183
|
layout: 'horizontal',
|
|
15182
15184
|
tagline: false
|
|
15183
15185
|
};
|
|
15184
15186
|
props.onLoad == null ? void 0 : props.onLoad(true);
|
|
15185
|
-
_context2.next =
|
|
15187
|
+
_context2.next = 8;
|
|
15186
15188
|
return window[namespace].Buttons({
|
|
15187
15189
|
createOrder: function () {
|
|
15188
15190
|
var _createOrder = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
@@ -15251,7 +15253,7 @@ var onLoadPaypal = /*#__PURE__*/function () {
|
|
|
15251
15253
|
style: _extends({}, defaultStyle, props.style)
|
|
15252
15254
|
}).render(state.__container);
|
|
15253
15255
|
|
|
15254
|
-
case
|
|
15256
|
+
case 8:
|
|
15255
15257
|
case "end":
|
|
15256
15258
|
return _context2.stop();
|
|
15257
15259
|
}
|
|
@@ -15279,6 +15281,9 @@ var options$2 = {
|
|
|
15279
15281
|
return undefined;
|
|
15280
15282
|
},
|
|
15281
15283
|
containerTemplate: function containerTemplate$1(params) {
|
|
15284
|
+
console.log({
|
|
15285
|
+
params: params
|
|
15286
|
+
});
|
|
15282
15287
|
params.state.__container = params.container;
|
|
15283
15288
|
|
|
15284
15289
|
if (!params.props.accountId && !params.props.paymentId) {
|
|
@@ -15288,9 +15293,19 @@ var options$2 = {
|
|
|
15288
15293
|
var container = containerTemplate(params);
|
|
15289
15294
|
|
|
15290
15295
|
params.event.on(zoid.EVENT.DESTROY, function () {
|
|
15296
|
+
console.log('destroy');
|
|
15291
15297
|
window[namespace].Buttons.instances.forEach(function (instance) {
|
|
15292
15298
|
instance.close();
|
|
15293
15299
|
});
|
|
15300
|
+
var scriptId = params.state.__scriptId;
|
|
15301
|
+
|
|
15302
|
+
if (scriptId) {
|
|
15303
|
+
var script = document.querySelector("script[data-uid-auto=\"" + scriptId + "\"]");
|
|
15304
|
+
|
|
15305
|
+
if (script) {
|
|
15306
|
+
script.remove();
|
|
15307
|
+
}
|
|
15308
|
+
}
|
|
15294
15309
|
});
|
|
15295
15310
|
return container;
|
|
15296
15311
|
},
|