@formio/js 5.0.0-dev.5863.a2bd4af → 5.0.0-dev.5865.8754bf3
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/Changelog.md +15 -14
- package/dist/formio.form.js +16 -16
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +17 -17
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +11 -11
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/cjs/components/form/editForm/Form.edit.data.js +1 -1
- package/lib/cjs/components/select/Select.d.ts +1 -1
- package/lib/cjs/components/select/Select.js +5 -12
- package/lib/cjs/components/time/Time.js +0 -6
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/mjs/components/form/editForm/Form.edit.data.js +1 -1
- package/lib/mjs/components/select/Select.d.ts +1 -1
- package/lib/mjs/components/select/Select.js +4 -11
- package/lib/mjs/components/time/Time.js +0 -6
- package/package.json +2 -2
|
@@ -50,6 +50,6 @@ exports.default = [
|
|
|
50
50
|
},
|
|
51
51
|
utils_1.default.javaScriptValue('Advanced Conditions', 'customConditional', 'conditional.json', 110, '<p>You must assign the <strong>show</strong> variable a boolean result.</p>' +
|
|
52
52
|
'<p><strong>Note: Advanced Conditional logic will override the results of the Simple Conditional logic.</strong></p>' +
|
|
53
|
-
'<h5>Example</h5><pre>show = !!data.showMe;</pre>', '<p><a href="
|
|
53
|
+
'<h5>Example</h5><pre>show = !!data.showMe;</pre>', '<p><a href="https://help.form.io/userguide/form-building/logic-and-conditions" target="_blank" rel="noopener noreferrer">Click here for an example</a></p>')
|
|
54
54
|
];
|
|
55
55
|
/* eslint-enable quotes, max-len */
|
|
@@ -140,7 +140,7 @@ exports.default = [
|
|
|
140
140
|
input: true
|
|
141
141
|
},
|
|
142
142
|
utils_1.default.javaScriptValue('Custom Default Value', 'customDefaultValue', 'customDefaultValue', 1000, '<p><h4>Example:</h4><pre>value = data.firstName + " " + data.lastName;</pre></p>', '<p><h4>Example:</h4><pre>{"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}</pre>'),
|
|
143
|
-
utils_1.default.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 1100, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="
|
|
143
|
+
utils_1.default.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 1100, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="https://help.form.io/userguide/form-building/logic-and-conditions#calculated-values" target="_blank" rel="noopener noreferrer">Click here for an example</a></p>', '<tr><th>token</th><td>The decoded JWT token for the authenticated user.</td></tr>'),
|
|
144
144
|
{
|
|
145
145
|
type: 'checkbox',
|
|
146
146
|
input: true,
|
|
@@ -55,7 +55,7 @@ const EditFormUtils = {
|
|
|
55
55
|
'<tr><th>value</th><td>The current value of the component.</td></tr>' +
|
|
56
56
|
'<tr><th>moment</th><td>The moment.js library for date manipulation.</td></tr>' +
|
|
57
57
|
'<tr><th>_</th><td>An instance of <a href="https://lodash.com/docs/" target="_blank" rel="noopener noreferrer">Lodash</a>.</td></tr>' +
|
|
58
|
-
'<tr><th>utils</th><td>An instance of the <a href="
|
|
58
|
+
'<tr><th>utils</th><td>An instance of the <a href="https://help.form.io/developers/javascript-development/javascript-utilities" target="_blank" rel="noopener noreferrer">FormioUtils</a> object.</td></tr>' +
|
|
59
59
|
'<tr><th>util</th><td>An alias for "utils".</td></tr>' +
|
|
60
60
|
'</table><br/>'
|
|
61
61
|
/* eslint-enable prefer-template */
|
|
@@ -7,7 +7,7 @@ const utils_1 = __importDefault(require("../../_classes/component/editForm/utils
|
|
|
7
7
|
/* eslint-disable max-len */
|
|
8
8
|
exports.default = [
|
|
9
9
|
utils_1.default.javaScriptValue('Custom Default Value', 'customDefaultValue', 'customDefaultValue', 120, '<p><h4>Example:</h4><pre>value = data.firstName + " " + data.lastName;</pre></p>', '<p><h4>Example:</h4><pre>{"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}</pre>'),
|
|
10
|
-
utils_1.default.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 130, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="
|
|
10
|
+
utils_1.default.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 130, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="https://help.form.io/userguide/form-building/logic-and-conditions#calculated-values" target="_blank" rel="noopener noreferrer">Click here for an example</a></p>'),
|
|
11
11
|
{
|
|
12
12
|
weight: 140,
|
|
13
13
|
type: 'checkbox',
|
|
@@ -131,7 +131,7 @@ export default class SelectComponent extends ListComponent {
|
|
|
131
131
|
addCurrentChoices(values: any, items: any, keyValue: any): any;
|
|
132
132
|
getValueAsString(data: any, options: any): any;
|
|
133
133
|
normalizeSingleValue(value: any): any;
|
|
134
|
-
setMetadata(value: any
|
|
134
|
+
setMetadata(value: any): any;
|
|
135
135
|
updateValue(value: any, flags: any): boolean;
|
|
136
136
|
undoValueTyping(value: any): any;
|
|
137
137
|
setValue(value: any, flags?: {}): boolean;
|
|
@@ -1204,8 +1204,8 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
return super.normalizeValue(this.normalizeSingleValue(value));
|
|
1206
1206
|
}
|
|
1207
|
-
setMetadata(value
|
|
1208
|
-
var _a
|
|
1207
|
+
setMetadata(value) {
|
|
1208
|
+
var _a;
|
|
1209
1209
|
if (lodash_1.default.isNil(value)) {
|
|
1210
1210
|
return;
|
|
1211
1211
|
}
|
|
@@ -1239,22 +1239,15 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
lodash_1.default.set(submission.metadata.selectData, this.path, templateData);
|
|
1241
1241
|
}
|
|
1242
|
-
if (flags.resetValue && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submission)) {
|
|
1243
|
-
const submission = this.root.submission;
|
|
1244
|
-
if (!submission.metadata) {
|
|
1245
|
-
submission.metadata = {};
|
|
1246
|
-
}
|
|
1247
|
-
submission.metadata.selectData = {};
|
|
1248
|
-
}
|
|
1249
1242
|
}
|
|
1250
1243
|
updateValue(value, flags) {
|
|
1251
1244
|
const changed = super.updateValue(value, flags);
|
|
1252
|
-
if (changed || !this.selectMetadata
|
|
1245
|
+
if (changed || !this.selectMetadata) {
|
|
1253
1246
|
if (this.component.multiple && Array.isArray(this.dataValue)) {
|
|
1254
|
-
this.dataValue.forEach(singleValue => this.setMetadata(singleValue
|
|
1247
|
+
this.dataValue.forEach(singleValue => this.setMetadata(singleValue));
|
|
1255
1248
|
}
|
|
1256
1249
|
else {
|
|
1257
|
-
this.setMetadata(this.dataValue
|
|
1250
|
+
this.setMetadata(this.dataValue);
|
|
1258
1251
|
}
|
|
1259
1252
|
}
|
|
1260
1253
|
return changed;
|
|
@@ -56,12 +56,6 @@ class TimeComponent extends TextField_1.default {
|
|
|
56
56
|
}
|
|
57
57
|
return value;
|
|
58
58
|
}
|
|
59
|
-
get validationValue() {
|
|
60
|
-
if ((Array.isArray(this.rawData) && !this.rawData.length) || !this.rawData) {
|
|
61
|
-
return this.dataValue;
|
|
62
|
-
}
|
|
63
|
-
return this.rawData;
|
|
64
|
-
}
|
|
65
59
|
get inputInfo() {
|
|
66
60
|
const info = super.inputInfo;
|
|
67
61
|
info.attr.type = this.component.inputType;
|
|
@@ -45,6 +45,6 @@ export default [
|
|
|
45
45
|
},
|
|
46
46
|
EditFormUtils.javaScriptValue('Advanced Conditions', 'customConditional', 'conditional.json', 110, '<p>You must assign the <strong>show</strong> variable a boolean result.</p>' +
|
|
47
47
|
'<p><strong>Note: Advanced Conditional logic will override the results of the Simple Conditional logic.</strong></p>' +
|
|
48
|
-
'<h5>Example</h5><pre>show = !!data.showMe;</pre>', '<p><a href="
|
|
48
|
+
'<h5>Example</h5><pre>show = !!data.showMe;</pre>', '<p><a href="https://help.form.io/userguide/form-building/logic-and-conditions" target="_blank" rel="noopener noreferrer">Click here for an example</a></p>')
|
|
49
49
|
];
|
|
50
50
|
/* eslint-enable quotes, max-len */
|
|
@@ -135,7 +135,7 @@ export default [
|
|
|
135
135
|
input: true
|
|
136
136
|
},
|
|
137
137
|
EditFormUtils.javaScriptValue('Custom Default Value', 'customDefaultValue', 'customDefaultValue', 1000, '<p><h4>Example:</h4><pre>value = data.firstName + " " + data.lastName;</pre></p>', '<p><h4>Example:</h4><pre>{"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}</pre>'),
|
|
138
|
-
EditFormUtils.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 1100, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="
|
|
138
|
+
EditFormUtils.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 1100, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="https://help.form.io/userguide/form-building/logic-and-conditions#calculated-values" target="_blank" rel="noopener noreferrer">Click here for an example</a></p>', '<tr><th>token</th><td>The decoded JWT token for the authenticated user.</td></tr>'),
|
|
139
139
|
{
|
|
140
140
|
type: 'checkbox',
|
|
141
141
|
input: true,
|
|
@@ -50,7 +50,7 @@ const EditFormUtils = {
|
|
|
50
50
|
'<tr><th>value</th><td>The current value of the component.</td></tr>' +
|
|
51
51
|
'<tr><th>moment</th><td>The moment.js library for date manipulation.</td></tr>' +
|
|
52
52
|
'<tr><th>_</th><td>An instance of <a href="https://lodash.com/docs/" target="_blank" rel="noopener noreferrer">Lodash</a>.</td></tr>' +
|
|
53
|
-
'<tr><th>utils</th><td>An instance of the <a href="
|
|
53
|
+
'<tr><th>utils</th><td>An instance of the <a href="https://help.form.io/developers/javascript-development/javascript-utilities" target="_blank" rel="noopener noreferrer">FormioUtils</a> object.</td></tr>' +
|
|
54
54
|
'<tr><th>util</th><td>An alias for "utils".</td></tr>' +
|
|
55
55
|
'</table><br/>'
|
|
56
56
|
/* eslint-enable prefer-template */
|
|
@@ -2,7 +2,7 @@ import EditFormUtils from '../../_classes/component/editForm/utils';
|
|
|
2
2
|
/* eslint-disable max-len */
|
|
3
3
|
export default [
|
|
4
4
|
EditFormUtils.javaScriptValue('Custom Default Value', 'customDefaultValue', 'customDefaultValue', 120, '<p><h4>Example:</h4><pre>value = data.firstName + " " + data.lastName;</pre></p>', '<p><h4>Example:</h4><pre>{"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}</pre>'),
|
|
5
|
-
EditFormUtils.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 130, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="
|
|
5
|
+
EditFormUtils.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 130, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="https://help.form.io/userguide/form-building/logic-and-conditions#calculated-values" target="_blank" rel="noopener noreferrer">Click here for an example</a></p>'),
|
|
6
6
|
{
|
|
7
7
|
weight: 140,
|
|
8
8
|
type: 'checkbox',
|
|
@@ -131,7 +131,7 @@ export default class SelectComponent extends ListComponent {
|
|
|
131
131
|
addCurrentChoices(values: any, items: any, keyValue: any): any;
|
|
132
132
|
getValueAsString(data: any, options: any): any;
|
|
133
133
|
normalizeSingleValue(value: any): any;
|
|
134
|
-
setMetadata(value: any
|
|
134
|
+
setMetadata(value: any): any;
|
|
135
135
|
updateValue(value: any, flags: any): boolean;
|
|
136
136
|
undoValueTyping(value: any): any;
|
|
137
137
|
setValue(value: any, flags?: {}): boolean;
|
|
@@ -1233,7 +1233,7 @@ export default class SelectComponent extends ListComponent {
|
|
|
1233
1233
|
}
|
|
1234
1234
|
return super.normalizeValue(this.normalizeSingleValue(value));
|
|
1235
1235
|
}
|
|
1236
|
-
setMetadata(value
|
|
1236
|
+
setMetadata(value) {
|
|
1237
1237
|
if (_.isNil(value)) {
|
|
1238
1238
|
return;
|
|
1239
1239
|
}
|
|
@@ -1267,22 +1267,15 @@ export default class SelectComponent extends ListComponent {
|
|
|
1267
1267
|
}
|
|
1268
1268
|
_.set(submission.metadata.selectData, this.path, templateData);
|
|
1269
1269
|
}
|
|
1270
|
-
if (flags.resetValue && this.root?.submission) {
|
|
1271
|
-
const submission = this.root.submission;
|
|
1272
|
-
if (!submission.metadata) {
|
|
1273
|
-
submission.metadata = {};
|
|
1274
|
-
}
|
|
1275
|
-
submission.metadata.selectData = {};
|
|
1276
|
-
}
|
|
1277
1270
|
}
|
|
1278
1271
|
updateValue(value, flags) {
|
|
1279
1272
|
const changed = super.updateValue(value, flags);
|
|
1280
|
-
if (changed || !this.selectMetadata
|
|
1273
|
+
if (changed || !this.selectMetadata) {
|
|
1281
1274
|
if (this.component.multiple && Array.isArray(this.dataValue)) {
|
|
1282
|
-
this.dataValue.forEach(singleValue => this.setMetadata(singleValue
|
|
1275
|
+
this.dataValue.forEach(singleValue => this.setMetadata(singleValue));
|
|
1283
1276
|
}
|
|
1284
1277
|
else {
|
|
1285
|
-
this.setMetadata(this.dataValue
|
|
1278
|
+
this.setMetadata(this.dataValue);
|
|
1286
1279
|
}
|
|
1287
1280
|
}
|
|
1288
1281
|
return changed;
|
|
@@ -51,12 +51,6 @@ export default class TimeComponent extends TextFieldComponent {
|
|
|
51
51
|
}
|
|
52
52
|
return value;
|
|
53
53
|
}
|
|
54
|
-
get validationValue() {
|
|
55
|
-
if ((Array.isArray(this.rawData) && !this.rawData.length) || !this.rawData) {
|
|
56
|
-
return this.dataValue;
|
|
57
|
-
}
|
|
58
|
-
return this.rawData;
|
|
59
|
-
}
|
|
60
54
|
get inputInfo() {
|
|
61
55
|
const info = super.inputInfo;
|
|
62
56
|
info.attr.type = this.component.inputType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formio/js",
|
|
3
|
-
"version": "5.0.0-dev.
|
|
3
|
+
"version": "5.0.0-dev.5865.8754bf3",
|
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@formio/bootstrap": "3.0.0-dev.98.17ba6ea",
|
|
84
84
|
"@formio/choices.js": "^10.2.1",
|
|
85
|
-
"@formio/core": "
|
|
85
|
+
"@formio/core": "2.3.0-dev.160.cabaa43",
|
|
86
86
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
|
87
87
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
|
88
88
|
"abortcontroller-polyfill": "^1.7.5",
|