@formio/js 5.0.0-dev.5894.b7db66e → 5.0.0-dev.5898.ffba52a
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 +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/components/radio/Radio.js +4 -3
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/cjs/utils/utils.js +4 -4
- package/lib/mjs/components/radio/Radio.js +4 -3
- package/lib/mjs/components/select/Select.js +1 -1
- package/lib/mjs/utils/utils.js +4 -4
- package/package.json +1 -1
|
@@ -312,12 +312,13 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
312
312
|
.then((response) => {
|
|
313
313
|
this.loading = false;
|
|
314
314
|
this.setItems(response);
|
|
315
|
-
this.optionsLoaded = true;
|
|
316
|
-
this.redraw();
|
|
317
315
|
})
|
|
318
316
|
.catch((err) => {
|
|
319
|
-
this.optionsLoaded = true;
|
|
320
317
|
this.handleLoadingError(err);
|
|
318
|
+
})
|
|
319
|
+
.finally(() => {
|
|
320
|
+
this.optionsLoaded = true;
|
|
321
|
+
this.redraw();
|
|
321
322
|
});
|
|
322
323
|
}
|
|
323
324
|
loadItemsFromMetadata() {
|
|
@@ -1239,7 +1239,7 @@ 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)) {
|
|
1242
|
+
if (flags.resetValue && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submission) && !this.options.readOnly) {
|
|
1243
1243
|
const submission = this.root.submission;
|
|
1244
1244
|
if (!submission.metadata) {
|
|
1245
1245
|
submission.metadata = {};
|
package/lib/cjs/utils/utils.js
CHANGED
|
@@ -295,12 +295,12 @@ exports.checkSimpleConditional = checkSimpleConditional;
|
|
|
295
295
|
*/
|
|
296
296
|
function getComponentActualValue(compPath, data, row) {
|
|
297
297
|
let value = null;
|
|
298
|
-
if (
|
|
299
|
-
value = (0, formUtils_1.getValue)({ data: row }, compPath);
|
|
300
|
-
}
|
|
301
|
-
if (data && lodash_1.default.isNil(value)) {
|
|
298
|
+
if (data) {
|
|
302
299
|
value = (0, formUtils_1.getValue)({ data }, compPath);
|
|
303
300
|
}
|
|
301
|
+
if (row && lodash_1.default.isNil(value)) {
|
|
302
|
+
value = (0, formUtils_1.getValue)({ data: row }, compPath);
|
|
303
|
+
}
|
|
304
304
|
// FOR-400 - Fix issue where falsey values were being evaluated as show=true
|
|
305
305
|
if (lodash_1.default.isNil(value) || (lodash_1.default.isObject(value) && lodash_1.default.isEmpty(value))) {
|
|
306
306
|
value = '';
|
|
@@ -312,12 +312,13 @@ export default class RadioComponent extends ListComponent {
|
|
|
312
312
|
.then((response) => {
|
|
313
313
|
this.loading = false;
|
|
314
314
|
this.setItems(response);
|
|
315
|
-
this.optionsLoaded = true;
|
|
316
|
-
this.redraw();
|
|
317
315
|
})
|
|
318
316
|
.catch((err) => {
|
|
319
|
-
this.optionsLoaded = true;
|
|
320
317
|
this.handleLoadingError(err);
|
|
318
|
+
})
|
|
319
|
+
.finally(() => {
|
|
320
|
+
this.optionsLoaded = true;
|
|
321
|
+
this.redraw();
|
|
321
322
|
});
|
|
322
323
|
}
|
|
323
324
|
loadItemsFromMetadata() {
|
|
@@ -1267,7 +1267,7 @@ 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) {
|
|
1270
|
+
if (flags.resetValue && this.root?.submission && !this.options.readOnly) {
|
|
1271
1271
|
const submission = this.root.submission;
|
|
1272
1272
|
if (!submission.metadata) {
|
|
1273
1273
|
submission.metadata = {};
|
package/lib/mjs/utils/utils.js
CHANGED
|
@@ -259,12 +259,12 @@ export function checkSimpleConditional(component, condition, row, data, instance
|
|
|
259
259
|
*/
|
|
260
260
|
export function getComponentActualValue(compPath, data, row) {
|
|
261
261
|
let value = null;
|
|
262
|
-
if (
|
|
263
|
-
value = getValue({ data: row }, compPath);
|
|
264
|
-
}
|
|
265
|
-
if (data && _.isNil(value)) {
|
|
262
|
+
if (data) {
|
|
266
263
|
value = getValue({ data }, compPath);
|
|
267
264
|
}
|
|
265
|
+
if (row && _.isNil(value)) {
|
|
266
|
+
value = getValue({ data: row }, compPath);
|
|
267
|
+
}
|
|
268
268
|
// FOR-400 - Fix issue where falsey values were being evaluated as show=true
|
|
269
269
|
if (_.isNil(value) || (_.isObject(value) && _.isEmpty(value))) {
|
|
270
270
|
value = '';
|