@formio/js 5.1.0-dev.5978.4a62b82 → 5.1.0-dev.5979.2bccb41

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.
@@ -1530,7 +1530,7 @@ class Webform extends NestedDataComponent_1.default {
1530
1530
  }
1531
1531
  }
1532
1532
  triggerCaptcha() {
1533
- if (!this || !this.components || this.options.preview) {
1533
+ if (!this || !this.components) {
1534
1534
  return;
1535
1535
  }
1536
1536
  const captchaComponent = [];
@@ -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;
197
+ var _a, _b, _c, _d;
198
198
  if (!Formio_1.Formio.libraries[this.getLibraryName()]) {
199
199
  return;
200
200
  }
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 : [];
201
+ const existingScript = (_a = document === null || document === void 0 ? void 0 : document.querySelector) === null || _a === void 0 ? void 0 : _a.call(document, `script[src^="${GOOGLE_MAPS_JS_URL}"]`);
202
+ if (existingScript && ((_b = options.params) === null || _b === void 0 ? void 0 : _b.key) && !existingScript.attributes.src.value.endsWith(options.params.key)) {
203
+ const googleMapsScripts = (_c = document.querySelectorAll(`script[src^="${GOOGLE_MAPS_BASE_URL}"]`)) !== null && _c !== void 0 ? _c : [];
204
204
  googleMapsScripts.forEach(script => script.parentNode.removeChild(script));
205
205
  delete Formio_1.Formio.libraries[this.getLibraryName()];
206
- (_c = global === null || global === void 0 ? void 0 : global.google) === null || _c === void 0 ? true : delete _c.maps;
206
+ (_d = global === null || global === void 0 ? void 0 : global.google) === null || _d === void 0 ? true : delete _d.maps;
207
207
  delete global[`${this.getLibraryName()}Callback`];
208
208
  }
209
209
  }
@@ -1530,7 +1530,7 @@ export default class Webform extends NestedDataComponent {
1530
1530
  }
1531
1531
  }
1532
1532
  triggerCaptcha() {
1533
- if (!this || !this.components || this.options.preview) {
1533
+ if (!this || !this.components) {
1534
1534
  return;
1535
1535
  }
1536
1536
  const captchaComponent = [];
@@ -190,7 +190,7 @@ export class GoogleAddressProvider extends AddressProvider {
190
190
  if (!Formio.libraries[this.getLibraryName()]) {
191
191
  return;
192
192
  }
193
- const existingScript = document.querySelector(`script[src^="${GOOGLE_MAPS_JS_URL}"]`);
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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.5978.4a62b82",
3
+ "version": "5.1.0-dev.5979.2bccb41",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {