@formio/js 5.0.0-dev.5749.8f49547 → 5.0.0-dev.5754.c86e9f5
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 +9 -0
- package/dist/formio.form.js +35 -15
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -0
- package/dist/formio.full.js +37 -17
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -0
- package/dist/formio.utils.js +24 -4
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -0
- package/lib/cjs/Form.js +2 -2
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +6 -0
- package/lib/cjs/components/datagrid/DataGrid.js +1 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.js +1 -0
- package/lib/cjs/components/file/File.d.ts +1 -1
- package/lib/cjs/components/file/File.js +6 -1
- package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/form/fixtures/index.js +3 -1
- package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
- package/lib/cjs/components/time/Time.form.js +2 -2
- package/lib/mjs/Form.js +2 -2
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +6 -0
- package/lib/mjs/components/datagrid/DataGrid.js +1 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.js +1 -0
- package/lib/mjs/components/file/File.d.ts +1 -1
- package/lib/mjs/components/file/File.js +6 -1
- package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/form/fixtures/index.js +2 -1
- package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
- package/lib/mjs/components/time/Time.form.js +2 -2
- package/package.json +4 -4
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
/*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */
|
|
22
22
|
|
|
23
|
+
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
|
|
24
|
+
|
|
23
25
|
/*! formiojs v5.0.0-rc.59 | https://unpkg.com/formiojs@5.0.0-rc.59/LICENSE.txt */
|
|
24
26
|
|
|
25
27
|
/**
|
package/lib/cjs/Form.js
CHANGED
|
@@ -65,13 +65,13 @@ class Form extends Element_1.default {
|
|
|
65
65
|
else {
|
|
66
66
|
this.element = null;
|
|
67
67
|
}
|
|
68
|
+
this.options = formOptions;
|
|
69
|
+
this.options.events = this.events;
|
|
68
70
|
if (form) {
|
|
69
71
|
this.setForm(form)
|
|
70
72
|
.then(() => this.readyResolve(this.instance))
|
|
71
73
|
.catch(this.readyReject);
|
|
72
74
|
}
|
|
73
|
-
this.options = formOptions;
|
|
74
|
-
this.options.events = this.events;
|
|
75
75
|
this.display = '';
|
|
76
76
|
}
|
|
77
77
|
createElement(tag, attrs, children) {
|
package/lib/cjs/Wizard.js
CHANGED
|
@@ -18,7 +18,7 @@ class Wizard extends Webform_1.default {
|
|
|
18
18
|
*/
|
|
19
19
|
constructor(elementOrOptions = undefined, _options = undefined) {
|
|
20
20
|
let element, options;
|
|
21
|
-
if (elementOrOptions instanceof HTMLElement ||
|
|
21
|
+
if (elementOrOptions instanceof HTMLElement || _options) {
|
|
22
22
|
element = elementOrOptions;
|
|
23
23
|
options = _options || {};
|
|
24
24
|
}
|
|
@@ -15,5 +15,6 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
|
15
15
|
_getEmailTableHeader(options: any): string;
|
|
16
16
|
_getEmailTableBody(options: any): string;
|
|
17
17
|
getComponents(rowIndex: any): any;
|
|
18
|
+
removeSubmissionMetadataRow(index: any): void;
|
|
18
19
|
}
|
|
19
20
|
import NestedDataComponent from '../nesteddata/NestedDataComponent';
|
|
@@ -218,5 +218,11 @@ class NestedArrayComponent extends NestedDataComponent_1.default {
|
|
|
218
218
|
}
|
|
219
219
|
return super.getComponents();
|
|
220
220
|
}
|
|
221
|
+
removeSubmissionMetadataRow(index) {
|
|
222
|
+
const componentMetadata = lodash_1.default.get(this.root, `submission.metadata.selectData.${this.path}`, null);
|
|
223
|
+
if (lodash_1.default.isArray(componentMetadata)) {
|
|
224
|
+
componentMetadata.splice(index, 1);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
221
227
|
}
|
|
222
228
|
exports.default = NestedArrayComponent;
|
|
@@ -440,6 +440,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
|
440
440
|
this.splice(index, flags);
|
|
441
441
|
this.emit('dataGridDeleteRow', { index });
|
|
442
442
|
const [row] = this.rows.splice(index, 1);
|
|
443
|
+
this.removeSubmissionMetadataRow(index);
|
|
443
444
|
this.removeRowComponents(row);
|
|
444
445
|
this.updateRowsComponents(index);
|
|
445
446
|
this.setValue(this.dataValue, flags);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let title: string;
|
|
3
|
+
let name: string;
|
|
4
|
+
let path: string;
|
|
5
|
+
let type: string;
|
|
6
|
+
let display: string;
|
|
7
|
+
let components: ({
|
|
8
|
+
label: string;
|
|
9
|
+
reorder: boolean;
|
|
10
|
+
addAnotherPosition: string;
|
|
11
|
+
layoutFixed: boolean;
|
|
12
|
+
enableRowGroups: boolean;
|
|
13
|
+
initEmpty: boolean;
|
|
14
|
+
tableView: boolean;
|
|
15
|
+
key: string;
|
|
16
|
+
type: string;
|
|
17
|
+
input: boolean;
|
|
18
|
+
components: {
|
|
19
|
+
label: string;
|
|
20
|
+
widget: string;
|
|
21
|
+
tableView: boolean;
|
|
22
|
+
data: {
|
|
23
|
+
values: {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
validateWhenHidden: boolean;
|
|
29
|
+
key: string;
|
|
30
|
+
type: string;
|
|
31
|
+
input: boolean;
|
|
32
|
+
defaultValue: string;
|
|
33
|
+
}[];
|
|
34
|
+
disableOnInvalid?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
type: string;
|
|
37
|
+
label: string;
|
|
38
|
+
key: string;
|
|
39
|
+
disableOnInvalid: boolean;
|
|
40
|
+
input: boolean;
|
|
41
|
+
tableView: boolean;
|
|
42
|
+
reorder?: undefined;
|
|
43
|
+
addAnotherPosition?: undefined;
|
|
44
|
+
layoutFixed?: undefined;
|
|
45
|
+
enableRowGroups?: undefined;
|
|
46
|
+
initEmpty?: undefined;
|
|
47
|
+
components?: undefined;
|
|
48
|
+
})[];
|
|
49
|
+
}
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
title: 'Select in Data Grid',
|
|
5
|
+
name: 'selectInDataGrid',
|
|
6
|
+
path: 'selectInDataGrid',
|
|
7
|
+
type: 'form',
|
|
8
|
+
display: 'form',
|
|
9
|
+
components: [
|
|
10
|
+
{
|
|
11
|
+
label: 'Data Grid',
|
|
12
|
+
reorder: false,
|
|
13
|
+
addAnotherPosition: 'bottom',
|
|
14
|
+
layoutFixed: false,
|
|
15
|
+
enableRowGroups: false,
|
|
16
|
+
initEmpty: false,
|
|
17
|
+
tableView: false,
|
|
18
|
+
key: 'dataGrid',
|
|
19
|
+
type: 'datagrid',
|
|
20
|
+
input: true,
|
|
21
|
+
components: [
|
|
22
|
+
{
|
|
23
|
+
label: 'Select',
|
|
24
|
+
widget: 'choicesjs',
|
|
25
|
+
tableView: true,
|
|
26
|
+
data: {
|
|
27
|
+
values: [
|
|
28
|
+
{
|
|
29
|
+
label: 'Individual',
|
|
30
|
+
value: 'individual'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: 'Entity',
|
|
34
|
+
value: 'entity'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
validateWhenHidden: false,
|
|
39
|
+
key: 'select',
|
|
40
|
+
type: 'select',
|
|
41
|
+
input: true,
|
|
42
|
+
defaultValue: 'entity'
|
|
43
|
+
},
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 'button',
|
|
48
|
+
label: 'Submit',
|
|
49
|
+
key: 'submit',
|
|
50
|
+
disableOnInvalid: true,
|
|
51
|
+
input: true,
|
|
52
|
+
tableView: false
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
};
|
|
@@ -8,6 +8,7 @@ import comp7 from './comp7';
|
|
|
8
8
|
import comp8 from './comp8';
|
|
9
9
|
import comp9 from './comp9';
|
|
10
10
|
import comp10 from './comp10';
|
|
11
|
+
import comp11 from './comp11';
|
|
11
12
|
import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
|
12
13
|
import withConditionalFieldsAndValidations from './comp-with-conditional-components-and-validations';
|
|
13
14
|
import withDefValue from './comp-with-def-value';
|
|
@@ -18,4 +19,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
|
18
19
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
19
20
|
import withCheckboxes from './comp-with-checkboxes';
|
|
20
21
|
import withReorder from './comp-with-reorder';
|
|
21
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
22
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
@@ -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.withReorder = exports.withCheckboxes = exports.twoWithAllowCalculatedOverride = exports.withAllowCalculateOverride = exports.modalWithRequiredFields = exports.withRowGroupsAndDefValue = exports.withLogic = exports.withDefValue = exports.withConditionalFieldsAndValidations = exports.withCollapsibleRowGroups = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.withReorder = exports.withCheckboxes = exports.twoWithAllowCalculatedOverride = exports.withAllowCalculateOverride = exports.modalWithRequiredFields = exports.withRowGroupsAndDefValue = exports.withLogic = exports.withDefValue = exports.withConditionalFieldsAndValidations = exports.withCollapsibleRowGroups = exports.comp11 = exports.comp10 = exports.comp9 = 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"));
|
|
@@ -24,6 +24,8 @@ const comp9_1 = __importDefault(require("./comp9"));
|
|
|
24
24
|
exports.comp9 = comp9_1.default;
|
|
25
25
|
const comp10_1 = __importDefault(require("./comp10"));
|
|
26
26
|
exports.comp10 = comp10_1.default;
|
|
27
|
+
const comp11_1 = __importDefault(require("./comp11"));
|
|
28
|
+
exports.comp11 = comp11_1.default;
|
|
27
29
|
const comp_with_def_value_1 = __importDefault(require("./comp-with-def-value"));
|
|
28
30
|
exports.withDefValue = comp_with_def_value_1.default;
|
|
29
31
|
const comp_row_groups_with_def_value_1 = __importDefault(require("./comp-row-groups-with-def-value"));
|
|
@@ -895,6 +895,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
895
895
|
}
|
|
896
896
|
this.clearErrors(rowIndex);
|
|
897
897
|
this.baseRemoveRow(rowIndex);
|
|
898
|
+
this.removeSubmissionMetadataRow(rowIndex);
|
|
898
899
|
this.splice(rowIndex);
|
|
899
900
|
this.emit('editGridDeleteRow', {
|
|
900
901
|
index: rowIndex
|
|
@@ -33,7 +33,7 @@ export default class FileComponent extends Field {
|
|
|
33
33
|
get dataReady(): Promise<any>;
|
|
34
34
|
loadImage(fileInfo: any): any;
|
|
35
35
|
get emptyValue(): never[];
|
|
36
|
-
getValueAsString(value: any): any;
|
|
36
|
+
getValueAsString(value: any, options: any): any;
|
|
37
37
|
get defaultValue(): any[];
|
|
38
38
|
get hasTypes(): any;
|
|
39
39
|
_fileBrowseHidden: any;
|
|
@@ -114,7 +114,12 @@ class FileComponent extends Field_1.default {
|
|
|
114
114
|
get emptyValue() {
|
|
115
115
|
return [];
|
|
116
116
|
}
|
|
117
|
-
getValueAsString(value) {
|
|
117
|
+
getValueAsString(value, options) {
|
|
118
|
+
if ((options === null || options === void 0 ? void 0 : options.review) && !this.component.uploadOnly) {
|
|
119
|
+
return lodash_1.default.map(value, (val, index) => {
|
|
120
|
+
return `<a href="${val.url || '#'}" target="_blank" data-path='${this.path}' data-fileindex='${index}'>${val.originalName}</a>`;
|
|
121
|
+
}).join(', ');
|
|
122
|
+
}
|
|
118
123
|
if (lodash_1.default.isArray(value)) {
|
|
119
124
|
return lodash_1.default.map(value, 'originalName').join(', ');
|
|
120
125
|
}
|
|
@@ -7,4 +7,5 @@ import comp5 from './comp5';
|
|
|
7
7
|
import comp6 from './comp6';
|
|
8
8
|
import comp7 from './comp7';
|
|
9
9
|
import comp8 from './comp8';
|
|
10
|
-
|
|
10
|
+
import nestedWizardForm from './nestedWizardForm';
|
|
11
|
+
export { formModalEdit, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, nestedWizardForm };
|
|
@@ -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.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = exports.formModalEdit = void 0;
|
|
6
|
+
exports.nestedWizardForm = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = exports.formModalEdit = void 0;
|
|
7
7
|
const formModalEdit_1 = __importDefault(require("./formModalEdit"));
|
|
8
8
|
exports.formModalEdit = formModalEdit_1.default;
|
|
9
9
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
@@ -22,3 +22,5 @@ const comp7_1 = __importDefault(require("./comp7"));
|
|
|
22
22
|
exports.comp7 = comp7_1.default;
|
|
23
23
|
const comp8_1 = __importDefault(require("./comp8"));
|
|
24
24
|
exports.comp8 = comp8_1.default;
|
|
25
|
+
const nestedWizardForm_1 = __importDefault(require("./nestedWizardForm"));
|
|
26
|
+
exports.nestedWizardForm = nestedWizardForm_1.default;
|