@formio/js 5.2.0-rc.8 → 5.2.0-rc.9
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 +2 -2
- 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/PDFBuilder.d.ts +1 -0
- package/lib/cjs/PDFBuilder.js +8 -8
- package/lib/cjs/WebformBuilder.d.ts +1 -1
- package/lib/cjs/WebformBuilder.js +20 -8
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/PDFBuilder.d.ts +1 -0
- package/lib/mjs/PDFBuilder.js +8 -8
- package/lib/mjs/WebformBuilder.d.ts +1 -1
- package/lib/mjs/WebformBuilder.js +19 -8
- 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.0-rc.
|
23
|
+
/*! formiojs v5.2.0-rc.9 | https://unpkg.com/formiojs@5.2.0-rc.9/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.0-rc.
|
23
|
+
/*! formiojs v5.2.0-rc.9 | https://unpkg.com/formiojs@5.2.0-rc.9/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.0-rc.
|
421
|
+
Formio.version = '5.2.0-rc.9';
|
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.0-rc.
|
14
|
+
sdk_1.Formio.version = '5.2.0-rc.9';
|
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) {
|
package/lib/cjs/PDFBuilder.d.ts
CHANGED
package/lib/cjs/PDFBuilder.js
CHANGED
@@ -451,21 +451,21 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
451
451
|
e.target.style.cursor = 'default';
|
452
452
|
}
|
453
453
|
highlightInvalidComponents() {
|
454
|
-
const
|
454
|
+
const repeatablePathsComps = this.findComponentsWithRepeatablePaths();
|
455
455
|
// update elements which path was duplicated if any pathes have been changed
|
456
|
-
if (!lodash_1.default.isEqual(this.
|
457
|
-
(0, utils_1.eachComponent)(this.webform.getComponents(), (comp
|
458
|
-
if (this.
|
456
|
+
if (!lodash_1.default.isEqual(this.repeatablePathsComps, repeatablePathsComps)) {
|
457
|
+
(0, utils_1.eachComponent)(this.webform.getComponents(), (comp) => {
|
458
|
+
if (this.repeatablePathsComps.includes(comp.component)) {
|
459
459
|
this.webform.postMessage({ name: 'updateElement', data: comp.component });
|
460
460
|
}
|
461
461
|
});
|
462
|
-
this.
|
462
|
+
this.repeatablePathsComps = repeatablePathsComps;
|
463
463
|
}
|
464
|
-
if (!
|
464
|
+
if (!repeatablePathsComps.length) {
|
465
465
|
return;
|
466
466
|
}
|
467
|
-
(0, utils_1.eachComponent)(this.webform.getComponents(), (comp
|
468
|
-
if (this.
|
467
|
+
(0, utils_1.eachComponent)(this.webform.getComponents(), (comp) => {
|
468
|
+
if (this.repeatablePathsComps.includes(comp)) {
|
469
469
|
this.webform.postMessage({
|
470
470
|
name: 'showBuilderErrors',
|
471
471
|
data: {
|
@@ -77,7 +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
|
-
|
80
|
+
findComponentsWithRepeatablePaths(): any[];
|
81
81
|
highlightInvalidComponents(): void;
|
82
82
|
/**
|
83
83
|
* Called when a new component is saved.
|
@@ -1126,25 +1126,37 @@ class WebformBuilder extends Component_1.default {
|
|
1126
1126
|
// Called when we update a component.
|
1127
1127
|
this.emit('updateComponent', component);
|
1128
1128
|
}
|
1129
|
-
|
1130
|
-
const repeatablePaths =
|
1129
|
+
findComponentsWithRepeatablePaths() {
|
1130
|
+
const repeatablePaths = {};
|
1131
1131
|
const keys = new Map();
|
1132
1132
|
(0, utils_1.eachComponent)(this.form.components, (comp, path, components, parent, paths) => {
|
1133
|
+
var _a, _b;
|
1134
|
+
const isRadioCheckbox = comp.type === 'checkbox' && comp.inputType === 'radio';
|
1133
1135
|
if (keys.has(paths.dataPath)) {
|
1134
|
-
repeatablePaths
|
1136
|
+
const onlyRadioCheckboxes = ((_a = repeatablePaths[paths.dataPath]) === null || _a === void 0 ? void 0 : _a.onlyRadioCheckboxes) === false ? false : isRadioCheckbox;
|
1137
|
+
repeatablePaths[paths.dataPath] = {
|
1138
|
+
comps: [...(((_b = repeatablePaths[paths.dataPath]) === null || _b === void 0 ? void 0 : _b.comps) || []), keys.get(paths.dataPath), comp],
|
1139
|
+
onlyRadioCheckboxes,
|
1140
|
+
};
|
1135
1141
|
}
|
1136
1142
|
else {
|
1137
|
-
keys.set(paths.dataPath,
|
1143
|
+
keys.set(paths.dataPath, comp);
|
1138
1144
|
}
|
1139
1145
|
}, true);
|
1140
|
-
|
1146
|
+
const componentsWithRepeatablePaths = [];
|
1147
|
+
Object.keys(repeatablePaths).forEach((path) => {
|
1148
|
+
const { comps, onlyRadioCheckboxes } = repeatablePaths[path];
|
1149
|
+
if (!onlyRadioCheckboxes) {
|
1150
|
+
componentsWithRepeatablePaths.push(...comps);
|
1151
|
+
}
|
1152
|
+
});
|
1153
|
+
return componentsWithRepeatablePaths;
|
1141
1154
|
}
|
1142
1155
|
highlightInvalidComponents() {
|
1143
|
-
const
|
1156
|
+
const repeatablePathsComps = this.findComponentsWithRepeatablePaths();
|
1144
1157
|
let hasInvalidComponents = false;
|
1145
1158
|
this.webform.everyComponent((comp) => {
|
1146
|
-
|
1147
|
-
if (repeatablePaths.includes(path)) {
|
1159
|
+
if (repeatablePathsComps.includes(comp.component)) {
|
1148
1160
|
comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
|
1149
1161
|
hasInvalidComponents = true;
|
1150
1162
|
}
|
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.0-rc.
|
17
|
+
static version = '5.2.0-rc.9';
|
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.0-rc.
|
7
|
+
FormioCore.version = '5.2.0-rc.9';
|
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) {
|
package/lib/mjs/PDFBuilder.d.ts
CHANGED
package/lib/mjs/PDFBuilder.js
CHANGED
@@ -444,21 +444,21 @@ export default class PDFBuilder extends WebformBuilder {
|
|
444
444
|
e.target.style.cursor = 'default';
|
445
445
|
}
|
446
446
|
highlightInvalidComponents() {
|
447
|
-
const
|
447
|
+
const repeatablePathsComps = this.findComponentsWithRepeatablePaths();
|
448
448
|
// update elements which path was duplicated if any pathes have been changed
|
449
|
-
if (!_.isEqual(this.
|
450
|
-
eachComponent(this.webform.getComponents(), (comp
|
451
|
-
if (this.
|
449
|
+
if (!_.isEqual(this.repeatablePathsComps, repeatablePathsComps)) {
|
450
|
+
eachComponent(this.webform.getComponents(), (comp) => {
|
451
|
+
if (this.repeatablePathsComps.includes(comp.component)) {
|
452
452
|
this.webform.postMessage({ name: 'updateElement', data: comp.component });
|
453
453
|
}
|
454
454
|
});
|
455
|
-
this.
|
455
|
+
this.repeatablePathsComps = repeatablePathsComps;
|
456
456
|
}
|
457
|
-
if (!
|
457
|
+
if (!repeatablePathsComps.length) {
|
458
458
|
return;
|
459
459
|
}
|
460
|
-
eachComponent(this.webform.getComponents(), (comp
|
461
|
-
if (this.
|
460
|
+
eachComponent(this.webform.getComponents(), (comp) => {
|
461
|
+
if (this.repeatablePathsComps.includes(comp)) {
|
462
462
|
this.webform.postMessage({
|
463
463
|
name: 'showBuilderErrors',
|
464
464
|
data: {
|
@@ -77,7 +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
|
-
|
80
|
+
findComponentsWithRepeatablePaths(): any[];
|
81
81
|
highlightInvalidComponents(): void;
|
82
82
|
/**
|
83
83
|
* Called when a new component is saved.
|
@@ -1110,25 +1110,36 @@ export default class WebformBuilder extends Component {
|
|
1110
1110
|
// Called when we update a component.
|
1111
1111
|
this.emit('updateComponent', component);
|
1112
1112
|
}
|
1113
|
-
|
1114
|
-
const repeatablePaths =
|
1113
|
+
findComponentsWithRepeatablePaths() {
|
1114
|
+
const repeatablePaths = {};
|
1115
1115
|
const keys = new Map();
|
1116
1116
|
eachComponent(this.form.components, (comp, path, components, parent, paths) => {
|
1117
|
+
const isRadioCheckbox = comp.type === 'checkbox' && comp.inputType === 'radio';
|
1117
1118
|
if (keys.has(paths.dataPath)) {
|
1118
|
-
repeatablePaths
|
1119
|
+
const onlyRadioCheckboxes = repeatablePaths[paths.dataPath]?.onlyRadioCheckboxes === false ? false : isRadioCheckbox;
|
1120
|
+
repeatablePaths[paths.dataPath] = {
|
1121
|
+
comps: [...(repeatablePaths[paths.dataPath]?.comps || []), keys.get(paths.dataPath), comp],
|
1122
|
+
onlyRadioCheckboxes,
|
1123
|
+
};
|
1119
1124
|
}
|
1120
1125
|
else {
|
1121
|
-
keys.set(paths.dataPath,
|
1126
|
+
keys.set(paths.dataPath, comp);
|
1122
1127
|
}
|
1123
1128
|
}, true);
|
1124
|
-
|
1129
|
+
const componentsWithRepeatablePaths = [];
|
1130
|
+
Object.keys(repeatablePaths).forEach((path) => {
|
1131
|
+
const { comps, onlyRadioCheckboxes } = repeatablePaths[path];
|
1132
|
+
if (!onlyRadioCheckboxes) {
|
1133
|
+
componentsWithRepeatablePaths.push(...comps);
|
1134
|
+
}
|
1135
|
+
});
|
1136
|
+
return componentsWithRepeatablePaths;
|
1125
1137
|
}
|
1126
1138
|
highlightInvalidComponents() {
|
1127
|
-
const
|
1139
|
+
const repeatablePathsComps = this.findComponentsWithRepeatablePaths();
|
1128
1140
|
let hasInvalidComponents = false;
|
1129
1141
|
this.webform.everyComponent((comp) => {
|
1130
|
-
|
1131
|
-
if (repeatablePaths.includes(path)) {
|
1142
|
+
if (repeatablePathsComps.includes(comp.component)) {
|
1132
1143
|
comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
|
1133
1144
|
hasInvalidComponents = true;
|
1134
1145
|
}
|