@formio/js 5.1.2-rc.4 → 5.1.2-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.1.2-rc.4 | https://unpkg.com/formiojs@5.1.2-rc.4/LICENSE.txt */
23
+ /*! formiojs v5.1.2-rc.6 | https://unpkg.com/formiojs@5.1.2-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.1.2-rc.4';
421
+ Formio.version = '5.1.2-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.1.2-rc.4';
14
+ sdk_1.Formio.version = '5.1.2-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) {
@@ -2661,13 +2661,16 @@ class Component extends Element_1.default {
2661
2661
  }
2662
2662
  const isArray = Array.isArray(value);
2663
2663
  const valueInput = this.refs.fileLink || this.refs.input;
2664
+ const isFilelink = !!this.refs.fileLink;
2664
2665
  if (isArray &&
2665
2666
  Array.isArray(this.defaultValue) &&
2666
2667
  this.refs.hasOwnProperty('input') &&
2667
2668
  valueInput &&
2668
2669
  (valueInput.length !== value.length) &&
2669
2670
  this.visible) {
2670
- this.redraw();
2671
+ if (isFilelink || valueInput.length) {
2672
+ this.redraw();
2673
+ }
2671
2674
  }
2672
2675
  if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
2673
2676
  this.redraw();
@@ -99,6 +99,7 @@ export default class FormComponent extends Component {
99
99
  */
100
100
  onSetSubFormValue(submission: object | null | undefined, flags: object | null | undefined): void;
101
101
  areAllComponentsEmpty(data: any): boolean;
102
+ conditionallyHidden(): boolean;
102
103
  updateSubFormVisibility(): void;
103
104
  /**
104
105
  * Determines if this form is a Nested Wizard
@@ -274,6 +274,9 @@ class FormComponent extends Component_1.default {
274
274
  if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
275
275
  this.createSubForm(true);
276
276
  }
277
+ if (!this.subFormReady) {
278
+ return Promise.resolve();
279
+ }
277
280
  return this.subFormReady.then(() => {
278
281
  this.empty(element);
279
282
  if (this.options.builder) {
@@ -402,13 +405,15 @@ class FormComponent extends Component_1.default {
402
405
  }
403
406
  // Render the form.
404
407
  return (new Form_1.default(form, this.getSubOptions())).ready.then((instance) => {
408
+ var _a, _b;
405
409
  this.subForm = instance;
406
410
  this.subForm.currentForm = this;
407
411
  this.subForm.parentVisible = this.visible;
408
412
  const componentsMap = this.componentsMap;
409
413
  const formComponentsMap = this.subForm.componentsMap;
410
414
  lodash_1.default.assign(componentsMap, formComponentsMap);
411
- this.component.components = this.subForm.components.map((comp) => comp.component);
415
+ this.component.components = (_a = this.subForm._form) === null || _a === void 0 ? void 0 : _a.components;
416
+ this.component.display = (_b = this.subForm._form) === null || _b === void 0 ? void 0 : _b.display;
412
417
  this.subForm.on('change', () => {
413
418
  if (this.subForm) {
414
419
  this.dataValue = this.subForm.getValue();
@@ -703,6 +708,13 @@ class FormComponent extends Component_1.default {
703
708
  }
704
709
  return errors;
705
710
  }
711
+ conditionallyHidden() {
712
+ const conditionallyHidden = super.conditionallyHidden();
713
+ if (this.subForm) {
714
+ this.subForm._conditionallyHidden = conditionallyHidden;
715
+ }
716
+ return conditionallyHidden;
717
+ }
706
718
  updateSubFormVisibility() {
707
719
  if (this.subForm) {
708
720
  this.subForm.parentVisible = this.visible;
@@ -37,7 +37,7 @@ declare namespace _default {
37
37
  };
38
38
  transform(type: any, text: any, instance: any): any;
39
39
  defaultIconset: string;
40
- iconClass: (iconset: any, name: any, spinning: any) => string;
40
+ iconClass: (iconset: "fa" | "bi", name: string, spinning: boolean) => string;
41
41
  cssClasses: {
42
42
  'border-default': string;
43
43
  'formio-tab-panel-active': string;
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.1.2-rc.4';
17
+ static version = '5.1.2-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.1.2-rc.4';
7
+ FormioCore.version = '5.1.2-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) {
@@ -2641,13 +2641,16 @@ export default class Component extends Element {
2641
2641
  }
2642
2642
  const isArray = Array.isArray(value);
2643
2643
  const valueInput = this.refs.fileLink || this.refs.input;
2644
+ const isFilelink = !!this.refs.fileLink;
2644
2645
  if (isArray &&
2645
2646
  Array.isArray(this.defaultValue) &&
2646
2647
  this.refs.hasOwnProperty('input') &&
2647
2648
  valueInput &&
2648
2649
  (valueInput.length !== value.length) &&
2649
2650
  this.visible) {
2650
- this.redraw();
2651
+ if (isFilelink || valueInput.length) {
2652
+ this.redraw();
2653
+ }
2651
2654
  }
2652
2655
  if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
2653
2656
  this.redraw();
@@ -99,6 +99,7 @@ export default class FormComponent extends Component {
99
99
  */
100
100
  onSetSubFormValue(submission: object | null | undefined, flags: object | null | undefined): void;
101
101
  areAllComponentsEmpty(data: any): boolean;
102
+ conditionallyHidden(): boolean;
102
103
  updateSubFormVisibility(): void;
103
104
  /**
104
105
  * Determines if this form is a Nested Wizard
@@ -271,6 +271,9 @@ export default class FormComponent extends Component {
271
271
  if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
272
272
  this.createSubForm(true);
273
273
  }
274
+ if (!this.subFormReady) {
275
+ return Promise.resolve();
276
+ }
274
277
  return this.subFormReady.then(() => {
275
278
  this.empty(element);
276
279
  if (this.options.builder) {
@@ -403,7 +406,8 @@ export default class FormComponent extends Component {
403
406
  const componentsMap = this.componentsMap;
404
407
  const formComponentsMap = this.subForm.componentsMap;
405
408
  _.assign(componentsMap, formComponentsMap);
406
- this.component.components = this.subForm.components.map((comp) => comp.component);
409
+ this.component.components = this.subForm._form?.components;
410
+ this.component.display = this.subForm._form?.display;
407
411
  this.subForm.on('change', () => {
408
412
  if (this.subForm) {
409
413
  this.dataValue = this.subForm.getValue();
@@ -693,6 +697,13 @@ export default class FormComponent extends Component {
693
697
  }
694
698
  return errors;
695
699
  }
700
+ conditionallyHidden() {
701
+ const conditionallyHidden = super.conditionallyHidden();
702
+ if (this.subForm) {
703
+ this.subForm._conditionallyHidden = conditionallyHidden;
704
+ }
705
+ return conditionallyHidden;
706
+ }
696
707
  updateSubFormVisibility() {
697
708
  if (this.subForm) {
698
709
  this.subForm.parentVisible = this.visible;
@@ -37,7 +37,7 @@ declare namespace _default {
37
37
  };
38
38
  transform(type: any, text: any, instance: any): any;
39
39
  defaultIconset: string;
40
- iconClass: (iconset: any, name: any, spinning: any) => string;
40
+ iconClass: (iconset: "fa" | "bi", name: string, spinning: boolean) => string;
41
41
  cssClasses: {
42
42
  'border-default': string;
43
43
  'formio-tab-panel-active': string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.2-rc.4",
3
+ "version": "5.1.2-rc.6",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -79,9 +79,9 @@
79
79
  },
80
80
  "homepage": "https://github.com/formio/formio.js#readme",
81
81
  "dependencies": {
82
- "@formio/bootstrap": "3.1.1-rc.2",
82
+ "@formio/bootstrap": "3.1.1-rc.3",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.4.1-rc.3",
84
+ "@formio/core": "2.4.1-rc.5",
85
85
  "@formio/text-mask-addons": "^3.8.0-formio.4",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",