@formio/js 5.0.0-dev.5641.3b5157b → 5.0.0-dev.5641.706b225

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.
@@ -652,8 +652,7 @@ class FileComponent extends Field_1.default {
652
652
  // Check if file with the same name is being uploaded
653
653
  const fileWithSameNameUploading = this.filesToSync.filesToUpload
654
654
  .some(fileToSync => { var _a; return ((_a = fileToSync.file) === null || _a === void 0 ? void 0 : _a.name) === file.name; });
655
- const fileWithSameNameUploaded = this.dataValue
656
- .some(fileStatus => fileStatus.originalName === file.name);
655
+ const fileWithSameNameUploaded = lodash_1.default.some(this.dataValue, fileStatus => fileStatus.originalName === file.name);
657
656
  return fileWithSameNameUploaded || fileWithSameNameUploading
658
657
  ? {
659
658
  status: 'error',
@@ -433,7 +433,7 @@ class FormComponent extends Component_1.default {
433
433
  * @returns {Promise} - The promise that resolves when the subform is loaded.
434
434
  */
435
435
  loadSubForm(fromAttach) {
436
- var _a, _b, _c;
436
+ var _a, _b, _c, _d, _e;
437
437
  if (this.builderMode || this.isHidden() || (this.isSubFormLazyLoad() && !fromAttach)) {
438
438
  return Promise.resolve();
439
439
  }
@@ -447,7 +447,7 @@ class FormComponent extends Component_1.default {
447
447
  }
448
448
  else if (this.formSrc) {
449
449
  this.subFormLoading = true;
450
- const options = ((_b = this.root.formio) === null || _b === void 0 ? void 0 : _b.base) && ((_c = this.root.formio) === null || _c === void 0 ? void 0 : _c.projectUrl)
450
+ const options = ((_c = (_b = this.root) === null || _b === void 0 ? void 0 : _b.formio) === null || _c === void 0 ? void 0 : _c.base) && ((_e = (_d = this.root) === null || _d === void 0 ? void 0 : _d.formio) === null || _e === void 0 ? void 0 : _e.projectUrl)
451
451
  ? {
452
452
  base: this.root.formio.base,
453
453
  project: this.root.formio.projectUrl,
@@ -628,7 +628,7 @@ class FormComponent extends Component_1.default {
628
628
  return changed;
629
629
  }
630
630
  setSubFormValue(submission, flags) {
631
- var _a, _b;
631
+ var _a, _b, _c, _d;
632
632
  const shouldLoadSubmissionById = submission
633
633
  && submission._id
634
634
  && this.subForm.formio
@@ -637,7 +637,7 @@ class FormComponent extends Component_1.default {
637
637
  if (shouldLoadSubmissionById || shouldLoadDraftById) {
638
638
  const formId = submission.form || this.formObj.form || this.component.form;
639
639
  const submissionUrl = `${this.subForm.formio.formsUrl}/${formId}/submission/${submission._id || this.subForm.submission._id}`;
640
- const options = ((_a = this.root.formio) === null || _a === void 0 ? void 0 : _a.base) && ((_b = this.root.formio) === null || _b === void 0 ? void 0 : _b.projectUrl)
640
+ const options = ((_b = (_a = this.root) === null || _a === void 0 ? void 0 : _a.formio) === null || _b === void 0 ? void 0 : _b.base) && ((_d = (_c = this.root) === null || _c === void 0 ? void 0 : _c.formio) === null || _d === void 0 ? void 0 : _d.projectUrl)
641
641
  ? {
642
642
  base: this.root.formio.base,
643
643
  project: this.root.formio.projectUrl,
@@ -649,8 +649,7 @@ export default class FileComponent extends Field {
649
649
  // Check if file with the same name is being uploaded
650
650
  const fileWithSameNameUploading = this.filesToSync.filesToUpload
651
651
  .some(fileToSync => fileToSync.file?.name === file.name);
652
- const fileWithSameNameUploaded = this.dataValue
653
- .some(fileStatus => fileStatus.originalName === file.name);
652
+ const fileWithSameNameUploaded = _.some(this.dataValue, fileStatus => fileStatus.originalName === file.name);
654
653
  return fileWithSameNameUploaded || fileWithSameNameUploading
655
654
  ? {
656
655
  status: 'error',
@@ -442,7 +442,7 @@ export default class FormComponent extends Component {
442
442
  }
443
443
  else if (this.formSrc) {
444
444
  this.subFormLoading = true;
445
- const options = this.root.formio?.base && this.root.formio?.projectUrl
445
+ const options = this.root?.formio?.base && this.root?.formio?.projectUrl
446
446
  ? {
447
447
  base: this.root.formio.base,
448
448
  project: this.root.formio.projectUrl,
@@ -627,7 +627,7 @@ export default class FormComponent extends Component {
627
627
  if (shouldLoadSubmissionById || shouldLoadDraftById) {
628
628
  const formId = submission.form || this.formObj.form || this.component.form;
629
629
  const submissionUrl = `${this.subForm.formio.formsUrl}/${formId}/submission/${submission._id || this.subForm.submission._id}`;
630
- const options = this.root.formio?.base && this.root.formio?.projectUrl
630
+ const options = this.root?.formio?.base && this.root?.formio?.projectUrl
631
631
  ? {
632
632
  base: this.root.formio.base,
633
633
  project: this.root.formio.projectUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5641.3b5157b",
3
+ "version": "5.0.0-dev.5641.706b225",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {