@formio/js 5.2.1-rc.4 → 5.2.1-rc.6

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.
@@ -20,7 +20,7 @@
20
20
 
21
21
  /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
22
22
 
23
- /*! formiojs v5.2.1-rc.4 | https://unpkg.com/formiojs@5.2.1-rc.4/LICENSE.txt */
23
+ /*! formiojs v5.2.1-rc.6 | https://unpkg.com/formiojs@5.2.1-rc.6/LICENSE.txt */
24
24
 
25
25
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
26
26
 
package/lib/cjs/Embed.js CHANGED
@@ -418,7 +418,7 @@ Formio.formioReady = new Promise((ready, reject) => {
418
418
  _a._formioReady = ready;
419
419
  _a._formioReadyReject = reject;
420
420
  });
421
- Formio.version = '5.2.1-rc.4';
421
+ Formio.version = '5.2.1-rc.6';
422
422
  // Create a report.
423
423
  Formio.Report = {
424
424
  create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
package/lib/cjs/Formio.js CHANGED
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
11
11
  const providers_1 = __importDefault(require("./providers"));
12
12
  sdk_1.Formio.cdn = new CDN_1.default();
13
13
  sdk_1.Formio.Providers = providers_1.default;
14
- sdk_1.Formio.version = '5.2.1-rc.4';
14
+ sdk_1.Formio.version = '5.2.1-rc.6';
15
15
  CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
16
16
  const isNil = (val) => val === null || val === undefined;
17
17
  sdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -351,6 +351,9 @@ class Webform extends NestedDataComponent_1.default {
351
351
  get shadowRoot() {
352
352
  return this.options.shadowRoot;
353
353
  }
354
+ get componentsMap() {
355
+ return this.childComponentsMap || {};
356
+ }
354
357
  /**
355
358
  * Add a language for translations
356
359
  * @param {string} code - The language code for the language being added.
@@ -558,12 +558,16 @@ class NestedComponent extends Field_1.default {
558
558
  * @param {boolean} [all] - If set to TRUE will cascade remove all components.
559
559
  */
560
560
  removeComponent(component, components, all = false) {
561
+ var _a, _b;
561
562
  components = components || this.components;
562
563
  component.destroy(all);
563
564
  lodash_1.default.remove(components, { id: component.id });
564
565
  if (this.componentsMap[component.path]) {
565
566
  delete this.componentsMap[component.path];
566
567
  }
568
+ if ((_a = this.root) === null || _a === void 0 ? void 0 : _a.componentsMap[component.path]) {
569
+ (_b = this.root) === null || _b === void 0 ? true : delete _b.componentsMap[component.path];
570
+ }
567
571
  }
568
572
  /**
569
573
  * Removes a component provided the API key of that component.
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const Formio_1 = require("../../Formio");
8
8
  const ListComponent_1 = __importDefault(require("../_classes/list/ListComponent"));
9
- const Input_1 = __importDefault(require("../_classes/input/Input"));
10
9
  const Form_1 = __importDefault(require("../../Form"));
11
10
  const utils_1 = require("../../utils");
12
11
  const ChoicesWrapper_1 = __importDefault(require("../../utils/ChoicesWrapper"));
@@ -849,7 +848,7 @@ class SelectComponent extends ListComponent_1.default {
849
848
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
850
849
  this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
851
850
  }
852
- Input_1.default.prototype.addFocusBlurEvents.call(this, this.focusableElement);
851
+ this.addFocusBlurEvents(this.choices.input.element);
853
852
  if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
854
853
  this.scrollList = this.choices.choiceList.element;
855
854
  this.addEventListener(this.scrollList, 'scroll', () => this.onScroll());
package/lib/mjs/Embed.js CHANGED
@@ -14,7 +14,7 @@ export class Formio {
14
14
  Formio._formioReady = ready;
15
15
  Formio._formioReadyReject = reject;
16
16
  });
17
- static version = '5.2.1-rc.4';
17
+ static version = '5.2.1-rc.6';
18
18
  static setLicense(license, norecurse = false) {
19
19
  Formio.license = license;
20
20
  if (!norecurse && Formio.FormioClass) {
package/lib/mjs/Formio.js CHANGED
@@ -4,7 +4,7 @@ import CDN from './CDN';
4
4
  import Providers from './providers';
5
5
  FormioCore.cdn = new CDN();
6
6
  FormioCore.Providers = Providers;
7
- FormioCore.version = '5.2.1-rc.4';
7
+ FormioCore.version = '5.2.1-rc.6';
8
8
  CDN.defaultCDN = FormioCore.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
9
9
  const isNil = (val) => val === null || val === undefined;
10
10
  FormioCore.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -323,6 +323,9 @@ export default class Webform extends NestedDataComponent {
323
323
  get shadowRoot() {
324
324
  return this.options.shadowRoot;
325
325
  }
326
+ get componentsMap() {
327
+ return this.childComponentsMap || {};
328
+ }
326
329
  /**
327
330
  * Add a language for translations
328
331
  * @param {string} code - The language code for the language being added.
@@ -560,6 +560,9 @@ export default class NestedComponent extends Field {
560
560
  if (this.componentsMap[component.path]) {
561
561
  delete this.componentsMap[component.path];
562
562
  }
563
+ if (this.root?.componentsMap[component.path]) {
564
+ delete this.root?.componentsMap[component.path];
565
+ }
563
566
  }
564
567
  /**
565
568
  * Removes a component provided the API key of that component.
@@ -1,7 +1,6 @@
1
1
  import _ from 'lodash';
2
2
  import { Formio } from '../../Formio';
3
3
  import ListComponent from '../_classes/list/ListComponent';
4
- import Input from '../_classes/input/Input';
5
4
  import Form from '../../Form';
6
5
  import { getRandomComponentId, boolValue, isPromise, componentValueTypes, getComponentSavedTypes, isSelectResourceWithObjectValue, removeHTML } from '../../utils';
7
6
  import Choices from '../../utils/ChoicesWrapper';
@@ -881,7 +880,7 @@ export default class SelectComponent extends ListComponent {
881
880
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
882
881
  this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
883
882
  }
884
- Input.prototype.addFocusBlurEvents.call(this, this.focusableElement);
883
+ this.addFocusBlurEvents(this.choices.input.element);
885
884
  if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
886
885
  this.scrollList = this.choices.choiceList.element;
887
886
  this.addEventListener(this.scrollList, 'scroll', () => this.onScroll());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.2.1-rc.4",
3
+ "version": "5.2.1-rc.6",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -79,8 +79,8 @@
79
79
  },
80
80
  "homepage": "https://github.com/formio/formio.js#readme",
81
81
  "dependencies": {
82
- "@formio/bootstrap": "3.1.2-rc.1",
83
- "@formio/core": "2.5.1-rc.4",
82
+ "@formio/bootstrap": "3.1.2-rc.2",
83
+ "@formio/core": "2.5.1-rc.6",
84
84
  "@formio/text-mask-addons": "^3.8.0-formio.4",
85
85
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
86
86
  "abortcontroller-polyfill": "^1.7.5",