@formio/js 5.2.1-rc.11 → 5.2.1-rc.12
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.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +4 -4
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/WebformBuilder.d.ts +1 -0
- package/lib/cjs/WebformBuilder.js +14 -0
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/WebformBuilder.d.ts +1 -0
- package/lib/mjs/WebformBuilder.js +13 -0
- package/lib/mjs/components/select/Select.js +1 -1
- package/package.json +1 -1
@@ -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.
|
23
|
+
/*! formiojs v5.2.1-rc.12 | https://unpkg.com/formiojs@5.2.1-rc.12/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
|
|
@@ -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.
|
23
|
+
/*! formiojs v5.2.1-rc.12 | https://unpkg.com/formiojs@5.2.1-rc.12/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.
|
421
|
+
Formio.version = '5.2.1-rc.12';
|
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.
|
14
|
+
sdk_1.Formio.version = '5.2.1-rc.12';
|
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) {
|
@@ -77,6 +77,7 @@ export default class WebformBuilder extends Component {
|
|
77
77
|
removeComponent(component: any, parent: any, original: any, componentInstance: any): boolean | undefined;
|
78
78
|
replaceDoubleQuotes(data: any, fieldsToRemoveDoubleQuotes?: any[]): any;
|
79
79
|
updateComponent(component: any, changed: any): void;
|
80
|
+
originalDefaultValue: any;
|
80
81
|
findComponentsWithRepeatablePaths(): any[];
|
81
82
|
highlightInvalidComponents(): void;
|
82
83
|
/**
|
@@ -1089,6 +1089,17 @@ class WebformBuilder extends Component_1.default {
|
|
1089
1089
|
'fields.month.required',
|
1090
1090
|
'fields.year.required',
|
1091
1091
|
]));
|
1092
|
+
if (defaultValueComponent.component.components) {
|
1093
|
+
if (!this.originalDefaultValue) {
|
1094
|
+
this.originalDefaultValue = (0, utils_1.fastCloneDeep)(defaultValueComponent.component);
|
1095
|
+
}
|
1096
|
+
(0, utils_1.eachComponent)(defaultValueComponent.component.components, (comp => {
|
1097
|
+
var _a;
|
1098
|
+
if ((_a = comp.validate) === null || _a === void 0 ? void 0 : _a.required) {
|
1099
|
+
comp.validate.required = false;
|
1100
|
+
}
|
1101
|
+
}));
|
1102
|
+
}
|
1092
1103
|
const parentComponent = defaultValueComponent.parent;
|
1093
1104
|
let tabIndex = -1;
|
1094
1105
|
let index = -1;
|
@@ -1198,6 +1209,9 @@ class WebformBuilder extends Component_1.default {
|
|
1198
1209
|
if (index !== -1) {
|
1199
1210
|
let submissionData = this.editForm.submission.data;
|
1200
1211
|
submissionData = submissionData.componentJson || submissionData;
|
1212
|
+
if (submissionData.components && this.originalDefaultValue) {
|
1213
|
+
submissionData.components = this.originalDefaultValue.components;
|
1214
|
+
}
|
1201
1215
|
const fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];
|
1202
1216
|
this.replaceDoubleQuotes(submissionData, fieldsToRemoveDoubleQuotes);
|
1203
1217
|
this.hook('beforeSaveComponentSettings', submissionData);
|
@@ -1123,7 +1123,7 @@ class SelectComponent extends ListComponent_1.default {
|
|
1123
1123
|
}
|
1124
1124
|
// Choices will return undefined if nothing is selected. We really want '' to be empty.
|
1125
1125
|
if (value === undefined || value === null) {
|
1126
|
-
value =
|
1126
|
+
value = this.emptyValue;
|
1127
1127
|
}
|
1128
1128
|
return value;
|
1129
1129
|
}
|
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.
|
17
|
+
static version = '5.2.1-rc.12';
|
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.
|
7
|
+
FormioCore.version = '5.2.1-rc.12';
|
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) {
|
@@ -77,6 +77,7 @@ export default class WebformBuilder extends Component {
|
|
77
77
|
removeComponent(component: any, parent: any, original: any, componentInstance: any): boolean | undefined;
|
78
78
|
replaceDoubleQuotes(data: any, fieldsToRemoveDoubleQuotes?: any[]): any;
|
79
79
|
updateComponent(component: any, changed: any): void;
|
80
|
+
originalDefaultValue: any;
|
80
81
|
findComponentsWithRepeatablePaths(): any[];
|
81
82
|
highlightInvalidComponents(): void;
|
82
83
|
/**
|
@@ -1073,6 +1073,16 @@ export default class WebformBuilder extends Component {
|
|
1073
1073
|
'fields.month.required',
|
1074
1074
|
'fields.year.required',
|
1075
1075
|
]));
|
1076
|
+
if (defaultValueComponent.component.components) {
|
1077
|
+
if (!this.originalDefaultValue) {
|
1078
|
+
this.originalDefaultValue = fastCloneDeep(defaultValueComponent.component);
|
1079
|
+
}
|
1080
|
+
eachComponent(defaultValueComponent.component.components, (comp => {
|
1081
|
+
if (comp.validate?.required) {
|
1082
|
+
comp.validate.required = false;
|
1083
|
+
}
|
1084
|
+
}));
|
1085
|
+
}
|
1076
1086
|
const parentComponent = defaultValueComponent.parent;
|
1077
1087
|
let tabIndex = -1;
|
1078
1088
|
let index = -1;
|
@@ -1181,6 +1191,9 @@ export default class WebformBuilder extends Component {
|
|
1181
1191
|
if (index !== -1) {
|
1182
1192
|
let submissionData = this.editForm.submission.data;
|
1183
1193
|
submissionData = submissionData.componentJson || submissionData;
|
1194
|
+
if (submissionData.components && this.originalDefaultValue) {
|
1195
|
+
submissionData.components = this.originalDefaultValue.components;
|
1196
|
+
}
|
1184
1197
|
const fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];
|
1185
1198
|
this.replaceDoubleQuotes(submissionData, fieldsToRemoveDoubleQuotes);
|
1186
1199
|
this.hook('beforeSaveComponentSettings', submissionData);
|
@@ -1153,7 +1153,7 @@ export default class SelectComponent extends ListComponent {
|
|
1153
1153
|
}
|
1154
1154
|
// Choices will return undefined if nothing is selected. We really want '' to be empty.
|
1155
1155
|
if (value === undefined || value === null) {
|
1156
|
-
value =
|
1156
|
+
value = this.emptyValue;
|
1157
1157
|
}
|
1158
1158
|
return value;
|
1159
1159
|
}
|