@formio/js 5.0.0-dev.5891.01a1c3a → 5.0.0-dev.5894.b7db66e
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/radio/Radio.js +3 -4
- package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -0
- package/lib/mjs/components/radio/Radio.js +3 -4
- package/lib/mjs/components/selectboxes/SelectBoxes.js +13 -1
- package/package.json +1 -1
|
@@ -312,13 +312,12 @@ 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();
|
|
315
317
|
})
|
|
316
318
|
.catch((err) => {
|
|
317
|
-
this.handleLoadingError(err);
|
|
318
|
-
})
|
|
319
|
-
.finally(() => {
|
|
320
319
|
this.optionsLoaded = true;
|
|
321
|
-
this.
|
|
320
|
+
this.handleLoadingError(err);
|
|
322
321
|
});
|
|
323
322
|
}
|
|
324
323
|
loadItemsFromMetadata() {
|
|
@@ -257,6 +257,18 @@ class SelectBoxesComponent extends Radio_1.default {
|
|
|
257
257
|
}
|
|
258
258
|
return super.checkComponentValidity(data, dirty, rowData, options, errors);
|
|
259
259
|
}
|
|
260
|
+
setCustomValidity(messages, dirty, external) {
|
|
261
|
+
if (this.options.building && lodash_1.default.find(messages, { ruleName: 'invalidValueProperty' })) {
|
|
262
|
+
setTimeout(() => {
|
|
263
|
+
this.root && (0, utils_1.getComponent)(this.root.components, 'valueProperty').setCustomValidity(messages, dirty);
|
|
264
|
+
}, 0);
|
|
265
|
+
return super.setCustomValidity(lodash_1.default.filter(messages, (message) => message.ruleName !== 'invalidValueProperty'), dirty, external);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
return super.setCustomValidity(messages, dirty, external);
|
|
269
|
+
}
|
|
270
|
+
;
|
|
271
|
+
}
|
|
260
272
|
validateValueAvailability(setting, value) {
|
|
261
273
|
if (!(0, utils_1.boolValue)(setting) || !value) {
|
|
262
274
|
return true;
|
|
@@ -312,13 +312,12 @@ 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();
|
|
315
317
|
})
|
|
316
318
|
.catch((err) => {
|
|
317
|
-
this.handleLoadingError(err);
|
|
318
|
-
})
|
|
319
|
-
.finally(() => {
|
|
320
319
|
this.optionsLoaded = true;
|
|
321
|
-
this.
|
|
320
|
+
this.handleLoadingError(err);
|
|
322
321
|
});
|
|
323
322
|
}
|
|
324
323
|
loadItemsFromMetadata() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import { componentValueTypes, getComponentSavedTypes, boolValue } from '../../utils/utils';
|
|
2
|
+
import { componentValueTypes, getComponentSavedTypes, boolValue, getComponent } from '../../utils/utils';
|
|
3
3
|
import RadioComponent from '../radio/Radio';
|
|
4
4
|
export default class SelectBoxesComponent extends RadioComponent {
|
|
5
5
|
static schema(...extend) {
|
|
@@ -258,6 +258,18 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
|
258
258
|
}
|
|
259
259
|
return super.checkComponentValidity(data, dirty, rowData, options, errors);
|
|
260
260
|
}
|
|
261
|
+
setCustomValidity(messages, dirty, external) {
|
|
262
|
+
if (this.options.building && _.find(messages, { ruleName: 'invalidValueProperty' })) {
|
|
263
|
+
setTimeout(() => {
|
|
264
|
+
this.root && getComponent(this.root.components, 'valueProperty').setCustomValidity(messages, dirty);
|
|
265
|
+
}, 0);
|
|
266
|
+
return super.setCustomValidity(_.filter(messages, (message) => message.ruleName !== 'invalidValueProperty'), dirty, external);
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
return super.setCustomValidity(messages, dirty, external);
|
|
270
|
+
}
|
|
271
|
+
;
|
|
272
|
+
}
|
|
261
273
|
validateValueAvailability(setting, value) {
|
|
262
274
|
if (!boolValue(setting) || !value) {
|
|
263
275
|
return true;
|