@formio/js 5.1.0-dev.5979.2bccb41 → 5.1.0-dev.5979.96c77b0
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/formio.form.js +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.js +6 -6
- package/lib/mjs/providers/address/GoogleAddressProvider.js +2 -2
- package/package.json +1 -1
@@ -194,16 +194,16 @@ class GoogleAddressProvider extends AddressProvider_1.AddressProvider {
|
|
194
194
|
* @param {ProviderOptions} options - The options for the provider.
|
195
195
|
*/
|
196
196
|
tryRemoveLibrary(options = {}) {
|
197
|
-
var _a, _b, _c
|
198
|
-
if (!Formio_1.Formio.libraries[this.getLibraryName()]) {
|
197
|
+
var _a, _b, _c;
|
198
|
+
if (!Formio_1.Formio.libraries[this.getLibraryName()] || !(document === null || document === void 0 ? void 0 : document.querySelector)) {
|
199
199
|
return;
|
200
200
|
}
|
201
|
-
const existingScript =
|
202
|
-
if (existingScript && ((
|
203
|
-
const googleMapsScripts = (
|
201
|
+
const existingScript = document.querySelector(`script[src^="${GOOGLE_MAPS_JS_URL}"]`);
|
202
|
+
if (existingScript && ((_a = options.params) === null || _a === void 0 ? void 0 : _a.key) && !existingScript.attributes.src.value.endsWith(options.params.key)) {
|
203
|
+
const googleMapsScripts = (_b = document.querySelectorAll(`script[src^="${GOOGLE_MAPS_BASE_URL}"]`)) !== null && _b !== void 0 ? _b : [];
|
204
204
|
googleMapsScripts.forEach(script => script.parentNode.removeChild(script));
|
205
205
|
delete Formio_1.Formio.libraries[this.getLibraryName()];
|
206
|
-
(
|
206
|
+
(_c = global === null || global === void 0 ? void 0 : global.google) === null || _c === void 0 ? true : delete _c.maps;
|
207
207
|
delete global[`${this.getLibraryName()}Callback`];
|
208
208
|
}
|
209
209
|
}
|
@@ -187,10 +187,10 @@ export class GoogleAddressProvider extends AddressProvider {
|
|
187
187
|
* @param {ProviderOptions} options - The options for the provider.
|
188
188
|
*/
|
189
189
|
tryRemoveLibrary(options = {}) {
|
190
|
-
if (!Formio.libraries[this.getLibraryName()]) {
|
190
|
+
if (!Formio.libraries[this.getLibraryName()] || !document?.querySelector) {
|
191
191
|
return;
|
192
192
|
}
|
193
|
-
const existingScript = document
|
193
|
+
const existingScript = document.querySelector(`script[src^="${GOOGLE_MAPS_JS_URL}"]`);
|
194
194
|
if (existingScript && options.params?.key && !existingScript.attributes.src.value.endsWith(options.params.key)) {
|
195
195
|
const googleMapsScripts = document.querySelectorAll(`script[src^="${GOOGLE_MAPS_BASE_URL}"]`) ?? [];
|
196
196
|
googleMapsScripts.forEach(script => script.parentNode.removeChild(script));
|