@formio/js 5.0.0-rc.76 → 5.0.0-rc.77
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +8 -8
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +8 -8
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +43 -25
- 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/address/Address.d.ts +6 -0
- package/lib/cjs/components/address/Address.js +7 -1
- 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 +5 -1
- package/lib/cjs/components/editgrid/EditGrid.js +1 -0
- package/lib/cjs/components/tags/Tags.js +3 -3
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +43 -25
- 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/address/Address.d.ts +6 -0
- package/lib/mjs/components/address/Address.js +10 -1
- 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 +3 -1
- package/lib/mjs/components/editgrid/EditGrid.js +1 -0
- package/lib/mjs/components/tags/Tags.js +3 -3
- package/package.json +2 -2
@@ -20,7 +20,7 @@
|
|
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
|
-
/*! formiojs v5.0.0-rc.
|
23
|
+
/*! formiojs v5.0.0-rc.77 | https://unpkg.com/formiojs@5.0.0-rc.77/LICENSE.txt */
|
24
24
|
|
25
25
|
/**
|
26
26
|
* @license
|
@@ -6,12 +6,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Field_1 = __importDefault(require("../field/Field"));
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
8
8
|
class Multivalue extends Field_1.default {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
/**
|
10
|
+
* Normalize values coming into updateValue.
|
11
|
+
* @param {*} value - The value to normalize before setting.
|
12
|
+
* @returns {*} - The normalized value.
|
13
|
+
*/
|
14
|
+
normalizeValue(value) {
|
15
|
+
if (this.component.multiple) {
|
16
|
+
if (Array.isArray(value)) {
|
17
|
+
if (value.length === 0) {
|
18
|
+
return [this.emptyValue];
|
19
|
+
}
|
20
|
+
if (this.component.storeas === 'array') {
|
21
|
+
return super.normalizeValue([value]);
|
22
|
+
}
|
23
|
+
return super.normalizeValue(value);
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
return super.normalizeValue(value == null ? [this.emptyValue] : [value]);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
if (Array.isArray(value) && this.component.storeas !== 'array') {
|
31
|
+
if (this.component.storeas === 'string') {
|
32
|
+
return super.normalizeValue(value.join(this.delimiter || ''));
|
33
|
+
}
|
34
|
+
return super.normalizeValue(value[0] || this.emptyValue);
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
return super.normalizeValue(value);
|
38
|
+
}
|
13
39
|
}
|
14
|
-
|
40
|
+
}
|
41
|
+
get dataValue() {
|
42
|
+
return super.dataValue;
|
15
43
|
}
|
16
44
|
set dataValue(value) {
|
17
45
|
super.dataValue = value;
|
@@ -31,30 +59,20 @@ class Multivalue extends Field_1.default {
|
|
31
59
|
get addAnother() {
|
32
60
|
return this.t(this.component.addAnother || 'Add Another');
|
33
61
|
}
|
34
|
-
useWrapper() {
|
35
|
-
return this.component.hasOwnProperty('multiple') && this.component.multiple;
|
36
|
-
}
|
37
62
|
/**
|
38
63
|
* @returns {Field} - The created field.
|
39
64
|
*/
|
40
65
|
render() {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
}
|
52
|
-
// If multiple value field.
|
53
|
-
return super.render(this.renderTemplate('multiValueTable', {
|
54
|
-
rows: dataValue.map(this.renderRow.bind(this)).join(''),
|
55
|
-
disabled: this.disabled,
|
56
|
-
addAnother: this.addAnother,
|
57
|
-
}));
|
66
|
+
let dataValue = this.normalizeValue(this.dataValue);
|
67
|
+
return this.component.hasOwnProperty('multiple') && this.component.multiple
|
68
|
+
? super.render(this.renderTemplate('multiValueTable', {
|
69
|
+
rows: dataValue.map(this.renderRow.bind(this)).join(''),
|
70
|
+
disabled: this.disabled,
|
71
|
+
addAnother: this.addAnother,
|
72
|
+
}))
|
73
|
+
: super.render(`<div ${this._referenceAttributeName}="element">
|
74
|
+
${this.renderElement(this.component.type !== 'hidden' ? dataValue : '')}
|
75
|
+
</div>`);
|
58
76
|
}
|
59
77
|
renderElement() {
|
60
78
|
return '';
|
@@ -13,5 +13,6 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
13
13
|
getComponent(path: any, fn: any, originalPath: any): any;
|
14
14
|
everyComponent(fn: any, rowIndex: any, options?: {}): void;
|
15
15
|
getComponents(rowIndex: any): any;
|
16
|
+
removeSubmissionMetadataRow(index: any): void;
|
16
17
|
}
|
17
18
|
import NestedDataComponent from '../nesteddata/NestedDataComponent';
|
@@ -197,5 +197,11 @@ class NestedArrayComponent extends NestedDataComponent_1.default {
|
|
197
197
|
}
|
198
198
|
return super.getComponents();
|
199
199
|
}
|
200
|
+
removeSubmissionMetadataRow(index) {
|
201
|
+
const componentMetadata = lodash_1.default.get(this.root, `submission.metadata.selectData.${this.path}`, null);
|
202
|
+
if (lodash_1.default.isArray(componentMetadata)) {
|
203
|
+
componentMetadata.splice(index, 1);
|
204
|
+
}
|
205
|
+
}
|
200
206
|
}
|
201
207
|
exports.default = NestedArrayComponent;
|
@@ -11,6 +11,12 @@ export default class AddressComponent extends ContainerComponent {
|
|
11
11
|
weight: number;
|
12
12
|
schema: any;
|
13
13
|
};
|
14
|
+
static get serverConditionSettings(): {
|
15
|
+
operators: string[];
|
16
|
+
};
|
17
|
+
static get conditionOperatorsSettings(): {
|
18
|
+
operators: string[];
|
19
|
+
};
|
14
20
|
static get modeSwitcherRef(): string;
|
15
21
|
static get removeValueIconRef(): string;
|
16
22
|
static get searchInputRef(): string;
|
@@ -97,6 +97,12 @@ class AddressComponent extends Container_1.default {
|
|
97
97
|
schema: AddressComponent.schema(),
|
98
98
|
};
|
99
99
|
}
|
100
|
+
static get serverConditionSettings() {
|
101
|
+
return AddressComponent.conditionOperatorsSettings;
|
102
|
+
}
|
103
|
+
static get conditionOperatorsSettings() {
|
104
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
|
105
|
+
}
|
100
106
|
mergeSchema(component = {}) {
|
101
107
|
let { defaultSchema } = this;
|
102
108
|
if (component.components) {
|
@@ -188,7 +194,7 @@ class AddressComponent extends Container_1.default {
|
|
188
194
|
return (this.manualModeEnabled && this.dataValue) ? this.dataValue.address : this.dataValue;
|
189
195
|
}
|
190
196
|
set address(value) {
|
191
|
-
if (this.manualModeEnabled && !this.isMultiple) {
|
197
|
+
if (this.manualModeEnabled && !this.isMultiple && !lodash_1.default.isEqual(value, this.emptyValue)) {
|
192
198
|
this.dataValue.address = value;
|
193
199
|
}
|
194
200
|
else {
|
@@ -425,6 +425,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
425
425
|
this.splice(index, flags);
|
426
426
|
this.emit('dataGridDeleteRow', { index });
|
427
427
|
const [row] = this.rows.splice(index, 1);
|
428
|
+
this.removeSubmissionMetadataRow(index);
|
428
429
|
this.removeRowComponents(row);
|
429
430
|
this.updateRowsComponents(index);
|
430
431
|
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
|
+
};
|
@@ -7,6 +7,7 @@ import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
8
8
|
import comp8 from './comp8';
|
9
9
|
import comp9 from './comp9';
|
10
|
+
import comp11 from './comp11';
|
10
11
|
import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
11
12
|
import withConditionalFieldsAndValidations from './comp-with-conditional-components-and-validations';
|
12
13
|
import withDefValue from './comp-with-def-value';
|
@@ -17,4 +18,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
17
18
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
18
19
|
import withCheckboxes from './comp-with-checkboxes';
|
19
20
|
import withReorder from './comp-with-reorder';
|
20
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
21
|
+
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.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"));
|
@@ -22,6 +22,10 @@ const comp8_1 = __importDefault(require("./comp8"));
|
|
22
22
|
exports.comp8 = comp8_1.default;
|
23
23
|
const comp9_1 = __importDefault(require("./comp9"));
|
24
24
|
exports.comp9 = comp9_1.default;
|
25
|
+
const comp10_1 = __importDefault(require("./comp10"));
|
26
|
+
exports.comp10 = comp10_1.default;
|
27
|
+
const comp11_1 = __importDefault(require("./comp11"));
|
28
|
+
exports.comp11 = comp11_1.default;
|
25
29
|
const comp_with_def_value_1 = __importDefault(require("./comp-with-def-value"));
|
26
30
|
exports.withDefValue = comp_with_def_value_1.default;
|
27
31
|
const comp_row_groups_with_def_value_1 = __importDefault(require("./comp-row-groups-with-def-value"));
|
@@ -885,6 +885,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
885
885
|
}
|
886
886
|
this.clearErrors(rowIndex);
|
887
887
|
this.baseRemoveRow(rowIndex);
|
888
|
+
this.removeSubmissionMetadataRow(rowIndex);
|
888
889
|
this.splice(rowIndex);
|
889
890
|
this.emit('editGridDeleteRow', {
|
890
891
|
index: rowIndex
|
@@ -118,12 +118,12 @@ class TagsComponent extends Input_1.default {
|
|
118
118
|
}
|
119
119
|
normalizeValue(value) {
|
120
120
|
if (this.component.storeas === 'string' && Array.isArray(value)) {
|
121
|
-
return value.join(this.delimiter);
|
121
|
+
return super.normalizeValue(value.join(this.delimiter));
|
122
122
|
}
|
123
123
|
else if (this.component.storeas === 'array' && typeof value === 'string') {
|
124
|
-
return value.split(this.delimiter).filter(result => result);
|
124
|
+
return super.normalizeValue(value.split(this.delimiter).filter(result => result));
|
125
125
|
}
|
126
|
-
return value;
|
126
|
+
return super.normalizeValue(value);
|
127
127
|
}
|
128
128
|
setValue(value, flags = {}) {
|
129
129
|
const changed = super.setValue(value, flags);
|
@@ -1,12 +1,40 @@
|
|
1
1
|
import Field from '../field/Field';
|
2
2
|
import _ from 'lodash';
|
3
3
|
export default class Multivalue extends Field {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
/**
|
5
|
+
* Normalize values coming into updateValue.
|
6
|
+
* @param {*} value - The value to normalize before setting.
|
7
|
+
* @returns {*} - The normalized value.
|
8
|
+
*/
|
9
|
+
normalizeValue(value) {
|
10
|
+
if (this.component.multiple) {
|
11
|
+
if (Array.isArray(value)) {
|
12
|
+
if (value.length === 0) {
|
13
|
+
return [this.emptyValue];
|
14
|
+
}
|
15
|
+
if (this.component.storeas === 'array') {
|
16
|
+
return super.normalizeValue([value]);
|
17
|
+
}
|
18
|
+
return super.normalizeValue(value);
|
19
|
+
}
|
20
|
+
else {
|
21
|
+
return super.normalizeValue(value == null ? [this.emptyValue] : [value]);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
else {
|
25
|
+
if (Array.isArray(value) && this.component.storeas !== 'array') {
|
26
|
+
if (this.component.storeas === 'string') {
|
27
|
+
return super.normalizeValue(value.join(this.delimiter || ''));
|
28
|
+
}
|
29
|
+
return super.normalizeValue(value[0] || this.emptyValue);
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
return super.normalizeValue(value);
|
33
|
+
}
|
8
34
|
}
|
9
|
-
|
35
|
+
}
|
36
|
+
get dataValue() {
|
37
|
+
return super.dataValue;
|
10
38
|
}
|
11
39
|
set dataValue(value) {
|
12
40
|
super.dataValue = value;
|
@@ -26,30 +54,20 @@ export default class Multivalue extends Field {
|
|
26
54
|
get addAnother() {
|
27
55
|
return this.t(this.component.addAnother || 'Add Another');
|
28
56
|
}
|
29
|
-
useWrapper() {
|
30
|
-
return this.component.hasOwnProperty('multiple') && this.component.multiple;
|
31
|
-
}
|
32
57
|
/**
|
33
58
|
* @returns {Field} - The created field.
|
34
59
|
*/
|
35
60
|
render() {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
}
|
47
|
-
// If multiple value field.
|
48
|
-
return super.render(this.renderTemplate('multiValueTable', {
|
49
|
-
rows: dataValue.map(this.renderRow.bind(this)).join(''),
|
50
|
-
disabled: this.disabled,
|
51
|
-
addAnother: this.addAnother,
|
52
|
-
}));
|
61
|
+
let dataValue = this.normalizeValue(this.dataValue);
|
62
|
+
return this.component.hasOwnProperty('multiple') && this.component.multiple
|
63
|
+
? super.render(this.renderTemplate('multiValueTable', {
|
64
|
+
rows: dataValue.map(this.renderRow.bind(this)).join(''),
|
65
|
+
disabled: this.disabled,
|
66
|
+
addAnother: this.addAnother,
|
67
|
+
}))
|
68
|
+
: super.render(`<div ${this._referenceAttributeName}="element">
|
69
|
+
${this.renderElement(this.component.type !== 'hidden' ? dataValue : '')}
|
70
|
+
</div>`);
|
53
71
|
}
|
54
72
|
renderElement() {
|
55
73
|
return '';
|
@@ -13,5 +13,6 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
13
13
|
getComponent(path: any, fn: any, originalPath: any): any;
|
14
14
|
everyComponent(fn: any, rowIndex: any, options?: {}): void;
|
15
15
|
getComponents(rowIndex: any): any;
|
16
|
+
removeSubmissionMetadataRow(index: any): void;
|
16
17
|
}
|
17
18
|
import NestedDataComponent from '../nesteddata/NestedDataComponent';
|
@@ -192,4 +192,10 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
192
192
|
}
|
193
193
|
return super.getComponents();
|
194
194
|
}
|
195
|
+
removeSubmissionMetadataRow(index) {
|
196
|
+
const componentMetadata = _.get(this.root, `submission.metadata.selectData.${this.path}`, null);
|
197
|
+
if (_.isArray(componentMetadata)) {
|
198
|
+
componentMetadata.splice(index, 1);
|
199
|
+
}
|
200
|
+
}
|
195
201
|
}
|
@@ -11,6 +11,12 @@ export default class AddressComponent extends ContainerComponent {
|
|
11
11
|
weight: number;
|
12
12
|
schema: any;
|
13
13
|
};
|
14
|
+
static get serverConditionSettings(): {
|
15
|
+
operators: string[];
|
16
|
+
};
|
17
|
+
static get conditionOperatorsSettings(): {
|
18
|
+
operators: string[];
|
19
|
+
};
|
14
20
|
static get modeSwitcherRef(): string;
|
15
21
|
static get removeValueIconRef(): string;
|
16
22
|
static get searchInputRef(): string;
|
@@ -91,6 +91,15 @@ export default class AddressComponent extends ContainerComponent {
|
|
91
91
|
schema: AddressComponent.schema(),
|
92
92
|
};
|
93
93
|
}
|
94
|
+
static get serverConditionSettings() {
|
95
|
+
return AddressComponent.conditionOperatorsSettings;
|
96
|
+
}
|
97
|
+
static get conditionOperatorsSettings() {
|
98
|
+
return {
|
99
|
+
...super.conditionOperatorsSettings,
|
100
|
+
operators: ['isEmpty', 'isNotEmpty'],
|
101
|
+
};
|
102
|
+
}
|
94
103
|
mergeSchema(component = {}) {
|
95
104
|
let { defaultSchema } = this;
|
96
105
|
if (component.components) {
|
@@ -181,7 +190,7 @@ export default class AddressComponent extends ContainerComponent {
|
|
181
190
|
return (this.manualModeEnabled && this.dataValue) ? this.dataValue.address : this.dataValue;
|
182
191
|
}
|
183
192
|
set address(value) {
|
184
|
-
if (this.manualModeEnabled && !this.isMultiple) {
|
193
|
+
if (this.manualModeEnabled && !this.isMultiple && !_.isEqual(value, this.emptyValue)) {
|
185
194
|
this.dataValue.address = value;
|
186
195
|
}
|
187
196
|
else {
|
@@ -421,6 +421,7 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
421
421
|
this.splice(index, flags);
|
422
422
|
this.emit('dataGridDeleteRow', { index });
|
423
423
|
const [row] = this.rows.splice(index, 1);
|
424
|
+
this.removeSubmissionMetadataRow(index);
|
424
425
|
this.removeRowComponents(row);
|
425
426
|
this.updateRowsComponents(index);
|
426
427
|
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,53 @@
|
|
1
|
+
export default {
|
2
|
+
title: 'Select in Data Grid',
|
3
|
+
name: 'selectInDataGrid',
|
4
|
+
path: 'selectInDataGrid',
|
5
|
+
type: 'form',
|
6
|
+
display: 'form',
|
7
|
+
components: [
|
8
|
+
{
|
9
|
+
label: 'Data Grid',
|
10
|
+
reorder: false,
|
11
|
+
addAnotherPosition: 'bottom',
|
12
|
+
layoutFixed: false,
|
13
|
+
enableRowGroups: false,
|
14
|
+
initEmpty: false,
|
15
|
+
tableView: false,
|
16
|
+
key: 'dataGrid',
|
17
|
+
type: 'datagrid',
|
18
|
+
input: true,
|
19
|
+
components: [
|
20
|
+
{
|
21
|
+
label: 'Select',
|
22
|
+
widget: 'choicesjs',
|
23
|
+
tableView: true,
|
24
|
+
data: {
|
25
|
+
values: [
|
26
|
+
{
|
27
|
+
label: 'Individual',
|
28
|
+
value: 'individual'
|
29
|
+
},
|
30
|
+
{
|
31
|
+
label: 'Entity',
|
32
|
+
value: 'entity'
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
36
|
+
validateWhenHidden: false,
|
37
|
+
key: 'select',
|
38
|
+
type: 'select',
|
39
|
+
input: true,
|
40
|
+
defaultValue: 'entity'
|
41
|
+
},
|
42
|
+
]
|
43
|
+
},
|
44
|
+
{
|
45
|
+
type: 'button',
|
46
|
+
label: 'Submit',
|
47
|
+
key: 'submit',
|
48
|
+
disableOnInvalid: true,
|
49
|
+
input: true,
|
50
|
+
tableView: false
|
51
|
+
}
|
52
|
+
]
|
53
|
+
};
|
@@ -7,6 +7,7 @@ import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
8
8
|
import comp8 from './comp8';
|
9
9
|
import comp9 from './comp9';
|
10
|
+
import comp11 from './comp11';
|
10
11
|
import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
11
12
|
import withConditionalFieldsAndValidations from './comp-with-conditional-components-and-validations';
|
12
13
|
import withDefValue from './comp-with-def-value';
|
@@ -17,4 +18,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
17
18
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
18
19
|
import withCheckboxes from './comp-with-checkboxes';
|
19
20
|
import withReorder from './comp-with-reorder';
|
20
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
21
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
@@ -7,6 +7,8 @@ import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
8
8
|
import comp8 from './comp8';
|
9
9
|
import comp9 from './comp9';
|
10
|
+
import comp10 from './comp10';
|
11
|
+
import comp11 from './comp11';
|
10
12
|
import withDefValue from './comp-with-def-value';
|
11
13
|
import withRowGroupsAndDefValue from './comp-row-groups-with-def-value';
|
12
14
|
import modalWithRequiredFields from './comp-modal-with-required-fields';
|
@@ -17,4 +19,4 @@ import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
17
19
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
18
20
|
import withCheckboxes from './comp-with-checkboxes';
|
19
21
|
import withReorder from './comp-with-reorder';
|
20
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, 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 };
|