@formio/js 5.0.0-dev.5643.9c5173a → 5.0.0-dev.5647.4cf82e8
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 +6 -0
- package/dist/formio.form.js +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +4 -4
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/WebformBuilder.js +8 -2
- package/lib/cjs/components/_classes/component/Component.js +1 -1
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +1 -2
- package/lib/cjs/components/datagrid/fixtures/index.js +1 -3
- package/lib/cjs/components/form/Form.js +4 -4
- package/lib/cjs/components/radio/Radio.js +1 -2
- package/lib/mjs/WebformBuilder.js +8 -2
- package/lib/mjs/components/_classes/component/Component.js +1 -1
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +1 -2
- package/lib/mjs/components/datagrid/fixtures/index.js +1 -2
- package/lib/mjs/components/form/Form.js +2 -2
- package/lib/mjs/components/radio/Radio.js +1 -1
- package/package.json +1 -1
- package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +0 -29
- package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.js +0 -36
- package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +0 -29
- package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.js +0 -34
|
@@ -986,8 +986,14 @@ class WebformBuilder extends Component_1.default {
|
|
|
986
986
|
else if (parent.formioComponent && parent.formioComponent.removeChildComponent) {
|
|
987
987
|
parent.formioComponent.removeChildComponent(component);
|
|
988
988
|
}
|
|
989
|
-
if (component.input && componentInstance &&
|
|
990
|
-
lodash_1.default.
|
|
989
|
+
if (component.input && componentInstance && parent.formioComponent) {
|
|
990
|
+
const parentDefaultValue = lodash_1.default.get(parent.formioComponent, 'component.defaultValue', null);
|
|
991
|
+
if (Array.isArray(parentDefaultValue)) {
|
|
992
|
+
parentDefaultValue.forEach(v => lodash_1.default.unset(v, componentInstance.key));
|
|
993
|
+
}
|
|
994
|
+
else if (typeof parentDefaultValue === 'object') {
|
|
995
|
+
lodash_1.default.unset(parentDefaultValue, componentInstance.key);
|
|
996
|
+
}
|
|
991
997
|
}
|
|
992
998
|
const rebuild = parent.formioComponent.rebuild() || Promise.resolve();
|
|
993
999
|
rebuild.then(() => {
|
|
@@ -2559,7 +2559,7 @@ class Component extends Element_1.default {
|
|
|
2559
2559
|
}
|
|
2560
2560
|
this.calculatedValue = (0, utils_1.fastCloneDeep)(calculatedValue);
|
|
2561
2561
|
if (changed) {
|
|
2562
|
-
if (!flags.noPristineChangeOnModified) {
|
|
2562
|
+
if (!flags.noPristineChangeOnModified && this.root.initialized) {
|
|
2563
2563
|
this.pristine = false;
|
|
2564
2564
|
}
|
|
2565
2565
|
flags.triggeredComponentId = this.id;
|
|
@@ -14,5 +14,4 @@ import withRowGroupsAndDefValue from './comp-row-groups-with-def-value';
|
|
|
14
14
|
import modalWithRequiredFields from './comp-modal-with-required-fields';
|
|
15
15
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
16
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
|
-
|
|
18
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
17
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.twoWithAllowCalculatedOverride = exports.withAllowCalculateOverride = exports.modalWithRequiredFields = exports.withRowGroupsAndDefValue = exports.withLogic = exports.withDefValue = exports.withConditionalFieldsAndValidations = exports.withCollapsibleRowGroups = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
8
8
|
exports.comp1 = comp1_1.default;
|
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
|
@@ -36,5 +36,3 @@ const comp_with_allow_calculate_override_1 = __importDefault(require("./comp-wit
|
|
|
36
36
|
exports.withAllowCalculateOverride = comp_with_allow_calculate_override_1.default;
|
|
37
37
|
const two_comp_with_allow_calculate_override_1 = __importDefault(require("./two-comp-with-allow-calculate-override"));
|
|
38
38
|
exports.twoWithAllowCalculatedOverride = two_comp_with_allow_calculate_override_1.default;
|
|
39
|
-
const comp_with_checkboxes_1 = __importDefault(require("./comp-with-checkboxes"));
|
|
40
|
-
exports.withCheckboxes = comp_with_checkboxes_1.default;
|
|
@@ -431,7 +431,7 @@ class FormComponent extends Component_1.default {
|
|
|
431
431
|
* Load the subform.
|
|
432
432
|
*/
|
|
433
433
|
loadSubForm(fromAttach) {
|
|
434
|
-
var _a, _b, _c;
|
|
434
|
+
var _a, _b, _c, _d, _e;
|
|
435
435
|
if (this.builderMode || this.isHidden() || (this.isSubFormLazyLoad() && !fromAttach)) {
|
|
436
436
|
return Promise.resolve();
|
|
437
437
|
}
|
|
@@ -445,7 +445,7 @@ class FormComponent extends Component_1.default {
|
|
|
445
445
|
}
|
|
446
446
|
else if (this.formSrc) {
|
|
447
447
|
this.subFormLoading = true;
|
|
448
|
-
const options = ((_b = this.root
|
|
448
|
+
const options = ((_c = (_b = this.root) === null || _b === void 0 ? void 0 : _b.formio) === null || _c === void 0 ? void 0 : _c.base) && ((_e = (_d = this.root) === null || _d === void 0 ? void 0 : _d.formio) === null || _e === void 0 ? void 0 : _e.projectUrl)
|
|
449
449
|
? {
|
|
450
450
|
base: this.root.formio.base,
|
|
451
451
|
project: this.root.formio.projectUrl,
|
|
@@ -625,7 +625,7 @@ class FormComponent extends Component_1.default {
|
|
|
625
625
|
return changed;
|
|
626
626
|
}
|
|
627
627
|
setSubFormValue(submission, flags) {
|
|
628
|
-
var _a, _b;
|
|
628
|
+
var _a, _b, _c, _d;
|
|
629
629
|
const shouldLoadSubmissionById = submission
|
|
630
630
|
&& submission._id
|
|
631
631
|
&& this.subForm.formio
|
|
@@ -634,7 +634,7 @@ class FormComponent extends Component_1.default {
|
|
|
634
634
|
if (shouldLoadSubmissionById || shouldLoadDraftById) {
|
|
635
635
|
const formId = submission.form || this.formObj.form || this.component.form;
|
|
636
636
|
const submissionUrl = `${this.subForm.formio.formsUrl}/${formId}/submission/${submission._id || this.subForm.submission._id}`;
|
|
637
|
-
const options = ((_a = this.root
|
|
637
|
+
const options = ((_b = (_a = this.root) === null || _a === void 0 ? void 0 : _a.formio) === null || _b === void 0 ? void 0 : _b.base) && ((_d = (_c = this.root) === null || _c === void 0 ? void 0 : _c.formio) === null || _d === void 0 ? void 0 : _d.projectUrl)
|
|
638
638
|
? {
|
|
639
639
|
base: this.root.formio.base,
|
|
640
640
|
project: this.root.formio.projectUrl,
|
|
@@ -321,9 +321,8 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
321
321
|
//add/remove selected option class
|
|
322
322
|
const value = this.dataValue;
|
|
323
323
|
this.refs.wrapper.forEach((wrapper, index) => {
|
|
324
|
-
var _a;
|
|
325
324
|
const input = this.refs.input[index];
|
|
326
|
-
const checked = (input.type === 'checkbox') ? value[input.value]
|
|
325
|
+
const checked = (input.type === 'checkbox') ? value[input.value] : (input.value.toString() === value.toString());
|
|
327
326
|
if (checked) {
|
|
328
327
|
//add class to container when selected
|
|
329
328
|
this.addClass(wrapper, this.optionSelectedClass);
|
|
@@ -970,8 +970,14 @@ export default class WebformBuilder extends Component {
|
|
|
970
970
|
else if (parent.formioComponent && parent.formioComponent.removeChildComponent) {
|
|
971
971
|
parent.formioComponent.removeChildComponent(component);
|
|
972
972
|
}
|
|
973
|
-
if (component.input && componentInstance &&
|
|
974
|
-
_.
|
|
973
|
+
if (component.input && componentInstance && parent.formioComponent) {
|
|
974
|
+
const parentDefaultValue = _.get(parent.formioComponent, 'component.defaultValue', null);
|
|
975
|
+
if (Array.isArray(parentDefaultValue)) {
|
|
976
|
+
parentDefaultValue.forEach(v => _.unset(v, componentInstance.key));
|
|
977
|
+
}
|
|
978
|
+
else if (typeof parentDefaultValue === 'object') {
|
|
979
|
+
_.unset(parentDefaultValue, componentInstance.key);
|
|
980
|
+
}
|
|
975
981
|
}
|
|
976
982
|
const rebuild = parent.formioComponent.rebuild() || Promise.resolve();
|
|
977
983
|
rebuild.then(() => {
|
|
@@ -2527,7 +2527,7 @@ export default class Component extends Element {
|
|
|
2527
2527
|
}
|
|
2528
2528
|
this.calculatedValue = fastCloneDeep(calculatedValue);
|
|
2529
2529
|
if (changed) {
|
|
2530
|
-
if (!flags.noPristineChangeOnModified) {
|
|
2530
|
+
if (!flags.noPristineChangeOnModified && this.root.initialized) {
|
|
2531
2531
|
this.pristine = false;
|
|
2532
2532
|
}
|
|
2533
2533
|
flags.triggeredComponentId = this.id;
|
|
@@ -14,5 +14,4 @@ import withRowGroupsAndDefValue from './comp-row-groups-with-def-value';
|
|
|
14
14
|
import modalWithRequiredFields from './comp-modal-with-required-fields';
|
|
15
15
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
16
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
|
-
|
|
18
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
17
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride };
|
|
@@ -14,5 +14,4 @@ import withLogic from './comp-with-logic';
|
|
|
14
14
|
import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
|
15
15
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
16
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
|
-
|
|
18
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
17
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride };
|
|
@@ -440,7 +440,7 @@ export default class FormComponent extends Component {
|
|
|
440
440
|
}
|
|
441
441
|
else if (this.formSrc) {
|
|
442
442
|
this.subFormLoading = true;
|
|
443
|
-
const options = this.root
|
|
443
|
+
const options = this.root?.formio?.base && this.root?.formio?.projectUrl
|
|
444
444
|
? {
|
|
445
445
|
base: this.root.formio.base,
|
|
446
446
|
project: this.root.formio.projectUrl,
|
|
@@ -624,7 +624,7 @@ export default class FormComponent extends Component {
|
|
|
624
624
|
if (shouldLoadSubmissionById || shouldLoadDraftById) {
|
|
625
625
|
const formId = submission.form || this.formObj.form || this.component.form;
|
|
626
626
|
const submissionUrl = `${this.subForm.formio.formsUrl}/${formId}/submission/${submission._id || this.subForm.submission._id}`;
|
|
627
|
-
const options = this.root
|
|
627
|
+
const options = this.root?.formio?.base && this.root?.formio?.projectUrl
|
|
628
628
|
? {
|
|
629
629
|
base: this.root.formio.base,
|
|
630
630
|
project: this.root.formio.projectUrl,
|
|
@@ -322,7 +322,7 @@ export default class RadioComponent extends ListComponent {
|
|
|
322
322
|
const value = this.dataValue;
|
|
323
323
|
this.refs.wrapper.forEach((wrapper, index) => {
|
|
324
324
|
const input = this.refs.input[index];
|
|
325
|
-
const checked = (input.type === 'checkbox') ? value[input.value]
|
|
325
|
+
const checked = (input.type === 'checkbox') ? value[input.value] : (input.value.toString() === value.toString());
|
|
326
326
|
if (checked) {
|
|
327
327
|
//add class to container when selected
|
|
328
328
|
this.addClass(wrapper, this.optionSelectedClass);
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
let label: string;
|
|
3
|
-
let reorder: boolean;
|
|
4
|
-
let addAnotherPosition: string;
|
|
5
|
-
let layoutFixed: boolean;
|
|
6
|
-
let enableRowGroups: boolean;
|
|
7
|
-
let initEmpty: boolean;
|
|
8
|
-
let tableView: boolean;
|
|
9
|
-
let defaultValue: {}[];
|
|
10
|
-
let key: string;
|
|
11
|
-
let type: string;
|
|
12
|
-
let input: boolean;
|
|
13
|
-
let components: {
|
|
14
|
-
label: string;
|
|
15
|
-
optionsLabelPosition: string;
|
|
16
|
-
inline: boolean;
|
|
17
|
-
tableView: boolean;
|
|
18
|
-
values: {
|
|
19
|
-
label: string;
|
|
20
|
-
value: string;
|
|
21
|
-
shortcut: string;
|
|
22
|
-
}[];
|
|
23
|
-
key: string;
|
|
24
|
-
type: string;
|
|
25
|
-
input: boolean;
|
|
26
|
-
inputType: string;
|
|
27
|
-
}[];
|
|
28
|
-
}
|
|
29
|
-
export default _default;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
'label': 'Data Grid',
|
|
5
|
-
'reorder': false,
|
|
6
|
-
'addAnotherPosition': 'bottom',
|
|
7
|
-
'layoutFixed': false,
|
|
8
|
-
'enableRowGroups': false,
|
|
9
|
-
'initEmpty': false,
|
|
10
|
-
'tableView': false,
|
|
11
|
-
'defaultValue': [
|
|
12
|
-
{}
|
|
13
|
-
],
|
|
14
|
-
'key': 'dataGrid',
|
|
15
|
-
'type': 'datagrid',
|
|
16
|
-
'input': true,
|
|
17
|
-
'components': [
|
|
18
|
-
{
|
|
19
|
-
'label': 'Radio',
|
|
20
|
-
'optionsLabelPosition': 'right',
|
|
21
|
-
'inline': false,
|
|
22
|
-
'tableView': false,
|
|
23
|
-
'values': [
|
|
24
|
-
{
|
|
25
|
-
'label': 'yes',
|
|
26
|
-
'value': 'yes',
|
|
27
|
-
'shortcut': ''
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
'key': 'radio',
|
|
31
|
-
'type': 'radio',
|
|
32
|
-
'input': true,
|
|
33
|
-
'inputType': 'checkbox'
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
let label: string;
|
|
3
|
-
let reorder: boolean;
|
|
4
|
-
let addAnotherPosition: string;
|
|
5
|
-
let layoutFixed: boolean;
|
|
6
|
-
let enableRowGroups: boolean;
|
|
7
|
-
let initEmpty: boolean;
|
|
8
|
-
let tableView: boolean;
|
|
9
|
-
let defaultValue: {}[];
|
|
10
|
-
let key: string;
|
|
11
|
-
let type: string;
|
|
12
|
-
let input: boolean;
|
|
13
|
-
let components: {
|
|
14
|
-
label: string;
|
|
15
|
-
optionsLabelPosition: string;
|
|
16
|
-
inline: boolean;
|
|
17
|
-
tableView: boolean;
|
|
18
|
-
values: {
|
|
19
|
-
label: string;
|
|
20
|
-
value: string;
|
|
21
|
-
shortcut: string;
|
|
22
|
-
}[];
|
|
23
|
-
key: string;
|
|
24
|
-
type: string;
|
|
25
|
-
input: boolean;
|
|
26
|
-
inputType: string;
|
|
27
|
-
}[];
|
|
28
|
-
}
|
|
29
|
-
export default _default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
'label': 'Data Grid',
|
|
3
|
-
'reorder': false,
|
|
4
|
-
'addAnotherPosition': 'bottom',
|
|
5
|
-
'layoutFixed': false,
|
|
6
|
-
'enableRowGroups': false,
|
|
7
|
-
'initEmpty': false,
|
|
8
|
-
'tableView': false,
|
|
9
|
-
'defaultValue': [
|
|
10
|
-
{}
|
|
11
|
-
],
|
|
12
|
-
'key': 'dataGrid',
|
|
13
|
-
'type': 'datagrid',
|
|
14
|
-
'input': true,
|
|
15
|
-
'components': [
|
|
16
|
-
{
|
|
17
|
-
'label': 'Radio',
|
|
18
|
-
'optionsLabelPosition': 'right',
|
|
19
|
-
'inline': false,
|
|
20
|
-
'tableView': false,
|
|
21
|
-
'values': [
|
|
22
|
-
{
|
|
23
|
-
'label': 'yes',
|
|
24
|
-
'value': 'yes',
|
|
25
|
-
'shortcut': ''
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
'key': 'radio',
|
|
29
|
-
'type': 'radio',
|
|
30
|
-
'input': true,
|
|
31
|
-
'inputType': 'checkbox'
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
};
|