@formio/js 5.0.0-dev.5641.6eb7b96 → 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,
@@ -163,6 +163,8 @@ class TextFieldComponent extends Input_1.default {
163
163
  const maskInput = this.refs.select ? this.refs.select[index] : null;
164
164
  const mask = this.getMaskPattern(value.maskName);
165
165
  if (textInput && maskInput && mask) {
166
+ // We need to set the maskInput (select dropdown) value before calling inputmask.setValue because, this
167
+ // function will trigger a "change" event, which was calling updateValue setting the mask type to an incorrect value.
166
168
  maskInput.value = value.maskName;
167
169
  if (textInput.inputmask) {
168
170
  this.setInputMask(textInput, mask);
@@ -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,
@@ -147,6 +147,8 @@ export default class TextFieldComponent extends Input {
147
147
  const maskInput = this.refs.select ? this.refs.select[index] : null;
148
148
  const mask = this.getMaskPattern(value.maskName);
149
149
  if (textInput && maskInput && mask) {
150
+ // We need to set the maskInput (select dropdown) value before calling inputmask.setValue because, this
151
+ // function will trigger a "change" event, which was calling updateValue setting the mask type to an incorrect value.
150
152
  maskInput.value = value.maskName;
151
153
  if (textInput.inputmask) {
152
154
  this.setInputMask(textInput, mask);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5641.6eb7b96",
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": {
@@ -79,9 +79,9 @@
79
79
  },
80
80
  "homepage": "https://github.com/formio/formio.js#readme",
81
81
  "dependencies": {
82
- "@formio/bootstrap": "^3.0.0-rc.25",
82
+ "@formio/bootstrap": "3.0.0-dev.98.17ba6ea",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "^2.1.0-dev.tt.13",
84
+ "@formio/core": "2.1.0-dev.104.42720ba",
85
85
  "@formio/text-mask-addons": "^3.8.0-formio.2",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",