@formio/js 5.1.1-rc.1 → 5.1.1
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 +528 -528
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +528 -528
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +5 -5
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +4 -4
- package/dist/formio.utils.min.js +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/components/_classes/component/Component.js +1 -1
- package/lib/cjs/components/number/Number.js +4 -11
- package/lib/cjs/components/radio/Radio.js +0 -10
- package/lib/cjs/components/select/Select.js +2 -2
- package/lib/cjs/components/signature/Signature.js +1 -3
- package/lib/cjs/utils/utils.js +1 -2
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/components/_classes/component/Component.js +1 -1
- package/lib/mjs/components/number/Number.js +4 -11
- package/lib/mjs/components/radio/Radio.js +0 -10
- package/lib/mjs/components/select/Select.js +2 -2
- package/lib/mjs/components/signature/Signature.js +1 -3
- package/lib/mjs/utils/utils.js +1 -2
- package/package.json +3 -3
@@ -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.1
|
23
|
+
/*! formiojs v5.1.1 | https://unpkg.com/formiojs@5.1.1/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.1
|
421
|
+
Formio.version = '5.1.1';
|
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.1
|
14
|
+
sdk_1.Formio.version = '5.1.1';
|
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) {
|
@@ -2605,7 +2605,7 @@ class Component extends Element_1.default {
|
|
2605
2605
|
}
|
2606
2606
|
return value;
|
2607
2607
|
};
|
2608
|
-
if (
|
2608
|
+
if (this.defaultMask) {
|
2609
2609
|
if (Array.isArray(defaultValue)) {
|
2610
2610
|
defaultValue = defaultValue.map(checkMask);
|
2611
2611
|
}
|
@@ -170,21 +170,14 @@ class NumberComponent extends Input_1.default {
|
|
170
170
|
if (typeof input === 'string') {
|
171
171
|
input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
172
172
|
}
|
173
|
-
let value;
|
174
|
-
if (!lodash_1.default.isNaN(
|
173
|
+
let value = parseFloat(input);
|
174
|
+
if (!lodash_1.default.isNaN(value)) {
|
175
175
|
// Format scientific notation
|
176
|
-
if (/
|
177
|
-
// Convert to exponential notation will depend on the decimal limit set in the component
|
178
|
-
// Example: 1.23e-5 will be converted to 1.23e-5 if decimal limit is set to 2
|
179
|
-
// Example: 1.23e5 will be converted to 1.23e+5 if decimal limit is set to 2
|
180
|
-
// if decimal limit is 3, 1.23e5 will be converted to 1.230e+5
|
181
|
-
// if decimal limit is not set, 1.23e5 will be converted to 1.23000000000000000000e+5
|
182
|
-
value = parseFloat(input);
|
176
|
+
if (/e/i.test(String(value))) {
|
183
177
|
value = value.toExponential(this.decimalLimit);
|
184
178
|
}
|
185
179
|
else {
|
186
|
-
value =
|
187
|
-
value = !lodash_1.default.isNaN(value) ? String(value).replace('.', this.decimalSeparator) : null;
|
180
|
+
value = String(value).replace('.', this.decimalSeparator);
|
188
181
|
}
|
189
182
|
}
|
190
183
|
else {
|
@@ -293,16 +293,6 @@ class RadioComponent extends ListComponent_1.default {
|
|
293
293
|
if (method.toUpperCase() === 'GET') {
|
294
294
|
body = null;
|
295
295
|
}
|
296
|
-
const limit = this.component.limit || 100;
|
297
|
-
const skip = this.isScrollLoading ? this.selectOptions.length : 0;
|
298
|
-
// Allow for url interpolation.
|
299
|
-
url = this.sanitize(this.interpolate(url, {
|
300
|
-
formioBase: Formio_1.Formio.getBaseUrl(),
|
301
|
-
search,
|
302
|
-
limit,
|
303
|
-
skip,
|
304
|
-
page: Math.abs(Math.floor(skip / limit))
|
305
|
-
}), this.shouldSanitizeValue);
|
306
296
|
// Set ignoreCache if it is
|
307
297
|
options.ignoreCache = this.component.ignoreCache;
|
308
298
|
// Make the request.
|
@@ -530,13 +530,13 @@ class SelectComponent extends ListComponent_1.default {
|
|
530
530
|
skip,
|
531
531
|
};
|
532
532
|
// Allow for url interpolation.
|
533
|
-
url = this.
|
533
|
+
url = this.interpolate(url, {
|
534
534
|
formioBase: Formio_1.Formio.getBaseUrl(),
|
535
535
|
search,
|
536
536
|
limit,
|
537
537
|
skip,
|
538
538
|
page: Math.abs(Math.floor(skip / limit))
|
539
|
-
})
|
539
|
+
});
|
540
540
|
// Add search capability.
|
541
541
|
if (this.component.searchField && search) {
|
542
542
|
const searchValue = Array.isArray(search)
|
package/lib/cjs/utils/utils.js
CHANGED
@@ -34,7 +34,6 @@ const Evaluator_1 = require("./Evaluator");
|
|
34
34
|
Object.defineProperty(exports, "Evaluator", { enumerable: true, get: function () { return Evaluator_1.Evaluator; } });
|
35
35
|
const conditionOperators_1 = __importDefault(require("./conditionOperators"));
|
36
36
|
exports.ConditionOperators = conditionOperators_1.default;
|
37
|
-
const core_1 = require("@formio/core");
|
38
37
|
const interpolate = Evaluator_1.Evaluator.interpolate;
|
39
38
|
exports.interpolate = interpolate;
|
40
39
|
__exportStar(require("./formUtils"), exports);
|
@@ -272,7 +271,7 @@ function checkSimpleConditional(component, condition, row, data, instance) {
|
|
272
271
|
default:
|
273
272
|
result = lodash_1.default.every(conditionsResult.flat(), res => !!res);
|
274
273
|
}
|
275
|
-
return
|
274
|
+
return show ? result : !result;
|
276
275
|
}
|
277
276
|
}
|
278
277
|
exports.checkSimpleConditional = checkSimpleConditional;
|
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.1
|
17
|
+
static version = '5.1.1';
|
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.1
|
7
|
+
FormioCore.version = '5.1.1';
|
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) {
|
@@ -2585,7 +2585,7 @@ export default class Component extends Element {
|
|
2585
2585
|
}
|
2586
2586
|
return value;
|
2587
2587
|
};
|
2588
|
-
if (
|
2588
|
+
if (this.defaultMask) {
|
2589
2589
|
if (Array.isArray(defaultValue)) {
|
2590
2590
|
defaultValue = defaultValue.map(checkMask);
|
2591
2591
|
}
|
@@ -168,21 +168,14 @@ export default class NumberComponent extends Input {
|
|
168
168
|
if (typeof input === 'string') {
|
169
169
|
input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
170
170
|
}
|
171
|
-
let value;
|
172
|
-
if (!_.isNaN(
|
171
|
+
let value = parseFloat(input);
|
172
|
+
if (!_.isNaN(value)) {
|
173
173
|
// Format scientific notation
|
174
|
-
if (/
|
175
|
-
// Convert to exponential notation will depend on the decimal limit set in the component
|
176
|
-
// Example: 1.23e-5 will be converted to 1.23e-5 if decimal limit is set to 2
|
177
|
-
// Example: 1.23e5 will be converted to 1.23e+5 if decimal limit is set to 2
|
178
|
-
// if decimal limit is 3, 1.23e5 will be converted to 1.230e+5
|
179
|
-
// if decimal limit is not set, 1.23e5 will be converted to 1.23000000000000000000e+5
|
180
|
-
value = parseFloat(input);
|
174
|
+
if (/e/i.test(String(value))) {
|
181
175
|
value = value.toExponential(this.decimalLimit);
|
182
176
|
}
|
183
177
|
else {
|
184
|
-
value =
|
185
|
-
value = !_.isNaN(value) ? String(value).replace('.', this.decimalSeparator) : null;
|
178
|
+
value = String(value).replace('.', this.decimalSeparator);
|
186
179
|
}
|
187
180
|
}
|
188
181
|
else {
|
@@ -293,16 +293,6 @@ export default class RadioComponent extends ListComponent {
|
|
293
293
|
if (method.toUpperCase() === 'GET') {
|
294
294
|
body = null;
|
295
295
|
}
|
296
|
-
const limit = this.component.limit || 100;
|
297
|
-
const skip = this.isScrollLoading ? this.selectOptions.length : 0;
|
298
|
-
// Allow for url interpolation.
|
299
|
-
url = this.sanitize(this.interpolate(url, {
|
300
|
-
formioBase: Formio.getBaseUrl(),
|
301
|
-
search,
|
302
|
-
limit,
|
303
|
-
skip,
|
304
|
-
page: Math.abs(Math.floor(skip / limit))
|
305
|
-
}), this.shouldSanitizeValue);
|
306
296
|
// Set ignoreCache if it is
|
307
297
|
options.ignoreCache = this.component.ignoreCache;
|
308
298
|
// Make the request.
|
@@ -532,13 +532,13 @@ export default class SelectComponent extends ListComponent {
|
|
532
532
|
skip,
|
533
533
|
};
|
534
534
|
// Allow for url interpolation.
|
535
|
-
url = this.
|
535
|
+
url = this.interpolate(url, {
|
536
536
|
formioBase: Formio.getBaseUrl(),
|
537
537
|
search,
|
538
538
|
limit,
|
539
539
|
skip,
|
540
540
|
page: Math.abs(Math.floor(skip / limit))
|
541
|
-
})
|
541
|
+
});
|
542
542
|
// Add search capability.
|
543
543
|
if (this.component.searchField && search) {
|
544
544
|
const searchValue = Array.isArray(search)
|
@@ -156,9 +156,7 @@ export default class SignatureComponent extends Input {
|
|
156
156
|
if (this.dataValue) {
|
157
157
|
this.setDataToSigaturePad();
|
158
158
|
}
|
159
|
-
|
160
|
-
this.showCanvas(true);
|
161
|
-
}
|
159
|
+
this.showCanvas(true);
|
162
160
|
}
|
163
161
|
}
|
164
162
|
renderElement(value, index) {
|
package/lib/mjs/utils/utils.js
CHANGED
@@ -8,7 +8,6 @@ import dompurify from 'dompurify';
|
|
8
8
|
import { getValue } from './formUtils';
|
9
9
|
import { Evaluator } from './Evaluator';
|
10
10
|
import ConditionOperators from './conditionOperators';
|
11
|
-
import { convertShowToBoolean } from '@formio/core';
|
12
11
|
const interpolate = Evaluator.interpolate;
|
13
12
|
export * from './formUtils';
|
14
13
|
// Configure JsonLogic
|
@@ -237,7 +236,7 @@ export function checkSimpleConditional(component, condition, row, data, instance
|
|
237
236
|
default:
|
238
237
|
result = _.every(conditionsResult.flat(), res => !!res);
|
239
238
|
}
|
240
|
-
return
|
239
|
+
return show ? result : !result;
|
241
240
|
}
|
242
241
|
}
|
243
242
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.1.1
|
3
|
+
"version": "5.1.1",
|
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.
|
82
|
+
"@formio/bootstrap": "3.1.0",
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
84
|
-
"@formio/core": "2.4.
|
84
|
+
"@formio/core": "2.4.0",
|
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",
|