rebill-web-components-sdk 1.14.2 → 1.14.4
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/cjs/card-fields-wrapper_16.cjs.entry.js +10 -3
- package/dist/cjs/index-C-VTnc0I.js.map +1 -1
- package/dist/collection/components/checkout/address/address.js +10 -3
- package/dist/collection/components/checkout/address/address.js.map +1 -1
- package/dist/components/p-8BpuJ_V5.js.map +1 -1
- package/dist/components/{p-j9zJUw9-.js → p-BlDbUGnC.js} +12 -5
- package/dist/components/p-BlDbUGnC.js.map +1 -0
- package/dist/components/rebill-address.js +1 -1
- package/dist/components/rebill-change-card.js +1 -1
- package/dist/components/rebill-checkout.js +1 -1
- package/dist/components/rebill-renewal.js +1 -1
- package/dist/components/rebill-save-card.js +1 -1
- package/dist/esm/card-fields-wrapper_16.entry.js +10 -3
- package/dist/esm/index-D8cwEAmw.js.map +1 -1
- package/dist/rebill-web-components-sdk/p-0e15d2d3.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-0e15d2d3.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/p-D8cwEAmw.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
- package/dist/types/components/checkout/address/address.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/p-j9zJUw9-.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-997861c5.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-997861c5.entry.js.map +0 -1
|
@@ -308,6 +308,8 @@ const Address = class {
|
|
|
308
308
|
errors = null;
|
|
309
309
|
unsubscribeAddressStore;
|
|
310
310
|
unsubscribeSaveCardStore;
|
|
311
|
+
/** True cuando el cambio de país viene del autocompletado, para no borrar el estado */
|
|
312
|
+
isAutocompletingAddress = false;
|
|
311
313
|
translateError(errorKey) {
|
|
312
314
|
if (!errorKey)
|
|
313
315
|
return '';
|
|
@@ -386,6 +388,7 @@ const Address = class {
|
|
|
386
388
|
}
|
|
387
389
|
async handleAddressSelected(address) {
|
|
388
390
|
this.isLoadingAddress = true;
|
|
391
|
+
this.isAutocompletingAddress = true;
|
|
389
392
|
// Normalize text function for handling accents and special characters
|
|
390
393
|
const normalizeText = (text) => {
|
|
391
394
|
return text
|
|
@@ -454,6 +457,7 @@ const Address = class {
|
|
|
454
457
|
this.emitInputEventsForAddress(address);
|
|
455
458
|
setTimeout(() => {
|
|
456
459
|
this.isLoadingAddress = false;
|
|
460
|
+
this.isAutocompletingAddress = false;
|
|
457
461
|
}, 500);
|
|
458
462
|
});
|
|
459
463
|
}
|
|
@@ -547,8 +551,11 @@ const Address = class {
|
|
|
547
551
|
// If country changes, load states for the new country
|
|
548
552
|
if (field === 'country') {
|
|
549
553
|
await this.loadStatesForCountry(value);
|
|
550
|
-
//
|
|
551
|
-
|
|
554
|
+
// Solo limpiar el estado si el cambio de país lo hizo el usuario manualmente,
|
|
555
|
+
// no cuando viene de un autocompletado (que ya trae el estado correcto)
|
|
556
|
+
if (!this.isAutocompletingAddress) {
|
|
557
|
+
this.setBillingAddress({ state: '' });
|
|
558
|
+
}
|
|
552
559
|
}
|
|
553
560
|
}
|
|
554
561
|
renderAddressHeader() {
|
|
@@ -570,7 +577,7 @@ const Address = class {
|
|
|
570
577
|
})() }))));
|
|
571
578
|
}
|
|
572
579
|
render() {
|
|
573
|
-
return (index.h("div", { key: '
|
|
580
|
+
return (index.h("div", { key: '55df1c07fe984384561109f315cf2629d363f27a' }, this.renderAddressForm()));
|
|
574
581
|
}
|
|
575
582
|
};
|
|
576
583
|
Address.style = addressCss;
|