@formio/js 5.0.0-dev.5863.a2bd4af → 5.0.0-dev.5864.1cff328
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.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/day/Day.d.ts +1 -0
- package/lib/cjs/components/day/Day.js +12 -0
- package/lib/cjs/components/select/Select.d.ts +1 -1
- package/lib/cjs/components/select/Select.js +5 -12
- package/lib/mjs/components/day/Day.d.ts +1 -0
- package/lib/mjs/components/day/Day.js +12 -0
- package/lib/mjs/components/select/Select.d.ts +1 -1
- package/lib/mjs/components/select/Select.js +4 -11
- package/package.json +1 -1
|
@@ -104,6 +104,12 @@ class DayComponent extends Field_1.default {
|
|
|
104
104
|
info.changeEvent = 'input';
|
|
105
105
|
return info;
|
|
106
106
|
}
|
|
107
|
+
isEmpty(value = this.dataValue) {
|
|
108
|
+
if (value === DayComponent.oldEmptyValue) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
return super.isEmpty(value);
|
|
112
|
+
}
|
|
107
113
|
inputDefinition(name) {
|
|
108
114
|
let min, max;
|
|
109
115
|
if (name === 'day') {
|
|
@@ -337,6 +343,10 @@ class DayComponent extends Field_1.default {
|
|
|
337
343
|
}
|
|
338
344
|
}
|
|
339
345
|
normalizeValue(value) {
|
|
346
|
+
// Adjust the value from old to new format
|
|
347
|
+
if (value === DayComponent.oldEmptyValue) {
|
|
348
|
+
value = '';
|
|
349
|
+
}
|
|
340
350
|
if (!value || this.valueMask.test(value)) {
|
|
341
351
|
return value;
|
|
342
352
|
}
|
|
@@ -643,4 +653,6 @@ class DayComponent extends Field_1.default {
|
|
|
643
653
|
return validationFormat;
|
|
644
654
|
}
|
|
645
655
|
}
|
|
656
|
+
// Empty value used before 9.3.x
|
|
657
|
+
DayComponent.oldEmptyValue = '00/00/0000';
|
|
646
658
|
exports.default = DayComponent;
|
|
@@ -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;
|
|
@@ -49,6 +49,8 @@ export default class DayComponent extends Field {
|
|
|
49
49
|
schema = schema || {};
|
|
50
50
|
return getComponentSavedTypes(schema) || [componentValueTypes.string];
|
|
51
51
|
}
|
|
52
|
+
// Empty value used before 9.3.x
|
|
53
|
+
static oldEmptyValue = '00/00/0000';
|
|
52
54
|
constructor(component, options, data) {
|
|
53
55
|
if (component.maxDate && component.maxDate.indexOf('moment(') === -1) {
|
|
54
56
|
component.maxDate = moment(component.maxDate, 'YYYY-MM-DD').toISOString();
|
|
@@ -102,6 +104,12 @@ export default class DayComponent extends Field {
|
|
|
102
104
|
info.changeEvent = 'input';
|
|
103
105
|
return info;
|
|
104
106
|
}
|
|
107
|
+
isEmpty(value = this.dataValue) {
|
|
108
|
+
if (value === DayComponent.oldEmptyValue) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
return super.isEmpty(value);
|
|
112
|
+
}
|
|
105
113
|
inputDefinition(name) {
|
|
106
114
|
let min, max;
|
|
107
115
|
if (name === 'day') {
|
|
@@ -335,6 +343,10 @@ export default class DayComponent extends Field {
|
|
|
335
343
|
}
|
|
336
344
|
}
|
|
337
345
|
normalizeValue(value) {
|
|
346
|
+
// Adjust the value from old to new format
|
|
347
|
+
if (value === DayComponent.oldEmptyValue) {
|
|
348
|
+
value = '';
|
|
349
|
+
}
|
|
338
350
|
if (!value || this.valueMask.test(value)) {
|
|
339
351
|
return value;
|
|
340
352
|
}
|
|
@@ -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;
|