@formio/js 5.0.0-rc.92 → 5.0.0-rc.94
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 +92 -92
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +92 -92
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +11 -11
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +69 -69
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/cjs/components/_classes/component/Component.js +5 -7
- package/lib/cjs/components/day/Day.d.ts +1 -1
- package/lib/cjs/components/day/Day.js +12 -0
- package/lib/cjs/components/day/fixtures/comp5.d.ts +18 -2
- package/lib/cjs/components/day/fixtures/comp5.js +6 -0
- package/lib/cjs/components/editgrid/EditGrid.d.ts +2 -2
- package/lib/cjs/components/editgrid/EditGrid.js +6 -5
- package/lib/cjs/components/radio/Radio.d.ts +1 -0
- package/lib/cjs/components/radio/Radio.js +13 -4
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/cjs/components/select/fixtures/comp25.d.ts +43 -28
- package/lib/cjs/components/select/fixtures/comp25.js +56 -49
- package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp26.js +59 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +1 -0
- package/lib/cjs/components/selectboxes/SelectBoxes.js +9 -2
- package/lib/cjs/components/textarea/TextArea.d.ts +4 -4
- package/lib/cjs/components/textarea/TextArea.js +4 -4
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +1 -9
- package/lib/cjs/utils/formUtils.d.ts +3 -0
- package/lib/cjs/utils/formUtils.js +5 -2
- package/lib/cjs/utils/utils.d.ts +0 -12
- package/lib/cjs/utils/utils.js +1 -33
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/mjs/components/_classes/component/Component.js +5 -7
- package/lib/mjs/components/day/Day.d.ts +1 -1
- package/lib/mjs/components/day/Day.js +12 -0
- package/lib/mjs/components/day/fixtures/comp5.d.ts +18 -2
- package/lib/mjs/components/day/fixtures/comp5.js +6 -0
- package/lib/mjs/components/editgrid/EditGrid.d.ts +2 -2
- package/lib/mjs/components/editgrid/EditGrid.js +6 -5
- package/lib/mjs/components/radio/Radio.d.ts +1 -0
- package/lib/mjs/components/radio/Radio.js +13 -4
- package/lib/mjs/components/select/Select.js +1 -1
- package/lib/mjs/components/select/fixtures/comp25.d.ts +43 -28
- package/lib/mjs/components/select/fixtures/comp25.js +56 -49
- package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp26.js +57 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +1 -0
- package/lib/mjs/components/selectboxes/SelectBoxes.js +8 -2
- package/lib/mjs/components/textarea/TextArea.d.ts +4 -4
- package/lib/mjs/components/textarea/TextArea.js +4 -4
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +2 -10
- package/lib/mjs/utils/formUtils.d.ts +3 -0
- package/lib/mjs/utils/formUtils.js +2 -2
- package/lib/mjs/utils/utils.d.ts +0 -12
- package/lib/mjs/utils/utils.js +0 -30
- package/package.json +3 -3
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
/*! @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 */
|
22
22
|
|
23
|
-
/*! formiojs v5.0.0-rc.
|
23
|
+
/*! formiojs v5.0.0-rc.94 | https://unpkg.com/formiojs@5.0.0-rc.94/LICENSE.txt */
|
24
24
|
|
25
25
|
/**
|
26
26
|
* @license
|
package/lib/cjs/Wizard.js
CHANGED
@@ -916,7 +916,7 @@ class Wizard extends Webform_1.default {
|
|
916
916
|
const components = !currentPageOnly || this.isLastPage()
|
917
917
|
? this.getComponents()
|
918
918
|
: this.currentPage.components;
|
919
|
-
return components.reduce((check, comp) => comp.checkValidity(data, dirty, row, childErrors) && check, true);
|
919
|
+
return components.reduce((check, comp) => comp.checkValidity(data, dirty, row, currentPageOnly, childErrors) && check, true);
|
920
920
|
}
|
921
921
|
get errors() {
|
922
922
|
if (!this.isLastPage()) {
|
@@ -1067,7 +1067,7 @@ declare class Component extends Element {
|
|
1067
1067
|
elementInfo(): any;
|
1068
1068
|
autofocus(): void;
|
1069
1069
|
scrollIntoView(element: any, verticalOnly: any): void;
|
1070
|
-
focus(index
|
1070
|
+
focus(index: any): void;
|
1071
1071
|
/**
|
1072
1072
|
* Get `Formio` instance for working with files
|
1073
1073
|
* @returns {import('@formio/core').Formio} - The Formio instance file service.
|
@@ -2934,14 +2934,12 @@ class Component extends Element_1.default {
|
|
2934
2934
|
if (flags.silentCheck) {
|
2935
2935
|
return [];
|
2936
2936
|
}
|
2937
|
+
let isDirty = this.dirty || flags.dirty;
|
2937
2938
|
if (this.options.alwaysDirty) {
|
2938
|
-
|
2939
|
+
isDirty = true;
|
2939
2940
|
}
|
2940
|
-
|
2941
|
-
|
2942
|
-
}
|
2943
|
-
this.setDirty(flags.dirty);
|
2944
|
-
return this.setComponentValidity(errors, flags.dirty, flags.silentCheck, flags.fromSubmission);
|
2941
|
+
this.setDirty(isDirty);
|
2942
|
+
return this.setComponentValidity(errors, isDirty, flags.silentCheck, flags.fromSubmission);
|
2945
2943
|
}
|
2946
2944
|
/**
|
2947
2945
|
* Perform a component validation.
|
@@ -3436,7 +3434,7 @@ class Component extends Element_1.default {
|
|
3436
3434
|
const { left, top } = element.getBoundingClientRect();
|
3437
3435
|
window.scrollTo(verticalOnly ? window.scrollX : left + window.scrollX, top + window.scrollY);
|
3438
3436
|
}
|
3439
|
-
focus(index
|
3437
|
+
focus(index) {
|
3440
3438
|
var _a, _b, _c, _d;
|
3441
3439
|
if ('beforeFocus' in this.parent) {
|
3442
3440
|
this.parent.beforeFocus(this);
|
@@ -11,6 +11,7 @@ export default class DayComponent extends Field {
|
|
11
11
|
operators: string[];
|
12
12
|
};
|
13
13
|
static savedValueTypes(schema: any): string[];
|
14
|
+
static oldEmptyValue: string;
|
14
15
|
static get serverConditionSettings(): {
|
15
16
|
operators: string[];
|
16
17
|
};
|
@@ -135,7 +136,6 @@ export default class DayComponent extends Field {
|
|
135
136
|
* @returns {string|null} - The string value of the date.
|
136
137
|
*/
|
137
138
|
getValueAsString(value: any): string | null;
|
138
|
-
focus(field: any): void;
|
139
139
|
isPartialDay(value: any): boolean;
|
140
140
|
getValidationFormat(): string;
|
141
141
|
}
|
@@ -104,6 +104,12 @@ class DayComponent extends Field_1.default {
|
|
104
104
|
info.changeEvent = 'input';
|
105
105
|
return info;
|
106
106
|
}
|
107
|
+
isEmpty(value = this.dataValue) {
|
108
|
+
if (value === DayComponent.oldEmptyValue) {
|
109
|
+
return true;
|
110
|
+
}
|
111
|
+
return super.isEmpty(value);
|
112
|
+
}
|
107
113
|
inputDefinition(name) {
|
108
114
|
let min, max;
|
109
115
|
if (name === 'day') {
|
@@ -337,6 +343,10 @@ class DayComponent extends Field_1.default {
|
|
337
343
|
}
|
338
344
|
}
|
339
345
|
normalizeValue(value) {
|
346
|
+
// Adjust the value from old to new format
|
347
|
+
if (value === DayComponent.oldEmptyValue) {
|
348
|
+
value = '';
|
349
|
+
}
|
340
350
|
if (!value || this.valueMask.test(value)) {
|
341
351
|
return value;
|
342
352
|
}
|
@@ -643,4 +653,6 @@ class DayComponent extends Field_1.default {
|
|
643
653
|
return validationFormat;
|
644
654
|
}
|
645
655
|
}
|
656
|
+
// Empty value used before 9.3.x
|
657
|
+
DayComponent.oldEmptyValue = '00/00/0000';
|
646
658
|
exports.default = DayComponent;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
declare namespace _default {
|
2
2
|
let type: string;
|
3
3
|
let display: string;
|
4
|
-
let components: {
|
4
|
+
let components: ({
|
5
5
|
label: string;
|
6
6
|
hideInputLabels: boolean;
|
7
7
|
inputsLabelPosition: string;
|
@@ -24,6 +24,22 @@ declare namespace _default {
|
|
24
24
|
type: string;
|
25
25
|
input: boolean;
|
26
26
|
defaultValue: string;
|
27
|
-
|
27
|
+
action?: undefined;
|
28
|
+
theme?: undefined;
|
29
|
+
} | {
|
30
|
+
type: string;
|
31
|
+
action: string;
|
32
|
+
label: string;
|
33
|
+
theme: string;
|
34
|
+
hideInputLabels?: undefined;
|
35
|
+
inputsLabelPosition?: undefined;
|
36
|
+
useLocaleSettings?: undefined;
|
37
|
+
tableView?: undefined;
|
38
|
+
fields?: undefined;
|
39
|
+
validateOn?: undefined;
|
40
|
+
key?: undefined;
|
41
|
+
input?: undefined;
|
42
|
+
defaultValue?: undefined;
|
43
|
+
})[];
|
28
44
|
}
|
29
45
|
export default _default;
|
@@ -89,8 +89,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
89
89
|
hasOpenRows(): any;
|
90
90
|
getAttachedData(data?: null): any;
|
91
91
|
shouldValidateDraft(editRow: any): any;
|
92
|
-
shouldValidateRow(editRow: any, dirty: any): any;
|
93
|
-
validateRow(editRow: any, dirty: any, forceSilentCheck: any): any;
|
92
|
+
shouldValidateRow(editRow: any, dirty: any, fromSubmission: any): any;
|
93
|
+
validateRow(editRow: any, dirty: any, forceSilentCheck: any, fromSubmission: any): any;
|
94
94
|
showRowErrorAlerts(editRow: any, errors: any): void;
|
95
95
|
/**
|
96
96
|
* @returns {boolean} - Return that this component processes its own validation.
|
@@ -973,17 +973,18 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
973
973
|
!this.hasOpenRows()) ||
|
974
974
|
((_b = this.root) === null || _b === void 0 ? void 0 : _b.submitted);
|
975
975
|
}
|
976
|
-
shouldValidateRow(editRow, dirty) {
|
976
|
+
shouldValidateRow(editRow, dirty, fromSubmission) {
|
977
977
|
return this.shouldValidateDraft(editRow) ||
|
978
978
|
editRow.state === EditRowState.Saving ||
|
979
979
|
editRow.state === EditRowState.Editing ||
|
980
980
|
editRow.alerts ||
|
981
|
+
fromSubmission ||
|
981
982
|
dirty;
|
982
983
|
}
|
983
|
-
validateRow(editRow, dirty, forceSilentCheck) {
|
984
|
+
validateRow(editRow, dirty, forceSilentCheck, fromSubmission) {
|
984
985
|
var _a;
|
985
986
|
editRow.errors = [];
|
986
|
-
if (this.shouldValidateRow(editRow, dirty)) {
|
987
|
+
if (this.shouldValidateRow(editRow, dirty, fromSubmission)) {
|
987
988
|
const silentCheck = (this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck;
|
988
989
|
const rootValue = (0, utils_1.fastCloneDeep)(this.rootValue);
|
989
990
|
const editGridValue = lodash_1.default.get(rootValue, this.path, []);
|
@@ -1055,7 +1056,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
1055
1056
|
}
|
1056
1057
|
checkComponentValidity(data, dirty, row, options = {}, errors = []) {
|
1057
1058
|
var _a, _b;
|
1058
|
-
const { silentCheck } = options;
|
1059
|
+
const { silentCheck, fromSubmission } = options;
|
1059
1060
|
const superValid = super.checkComponentValidity(data, dirty, row, options, errors);
|
1060
1061
|
// If super tells us that component invalid and there is no need to update alerts, just return false
|
1061
1062
|
if (!superValid && (!this.alert && !this.hasOpenRows())) {
|
@@ -1065,7 +1066,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
1065
1066
|
const allRowErrors = [];
|
1066
1067
|
this.editRows.forEach((editRow, index) => {
|
1067
1068
|
// Trigger all errors on the row.
|
1068
|
-
const rowErrors = this.validateRow(editRow, dirty, silentCheck);
|
1069
|
+
const rowErrors = this.validateRow(editRow, dirty, silentCheck, fromSubmission);
|
1069
1070
|
errors.push(...rowErrors);
|
1070
1071
|
allRowErrors.push(...rowErrors);
|
1071
1072
|
if (this.rowRefs) {
|
@@ -21,6 +21,7 @@ export default class RadioComponent extends ListComponent {
|
|
21
21
|
get isRadio(): boolean;
|
22
22
|
get optionSelectedClass(): string;
|
23
23
|
get listData(): any;
|
24
|
+
get selectMetadata(): any;
|
24
25
|
templateData: {} | undefined;
|
25
26
|
triggerUpdate: ((...args: any[]) => any) | undefined;
|
26
27
|
itemsLoadedResolve: ((value: any) => void) | undefined;
|
@@ -109,6 +109,12 @@ class RadioComponent extends ListComponent_1.default {
|
|
109
109
|
const listData = lodash_1.default.get(this.root, 'submission.metadata.listData', {});
|
110
110
|
return lodash_1.default.get(listData, this.path);
|
111
111
|
}
|
112
|
+
get selectMetadata() {
|
113
|
+
return super.selectData;
|
114
|
+
}
|
115
|
+
get selectData() {
|
116
|
+
return this.selectMetadata || this.component.selectData;
|
117
|
+
}
|
112
118
|
init() {
|
113
119
|
super.init();
|
114
120
|
this.templateData = {};
|
@@ -244,12 +250,15 @@ class RadioComponent extends ListComponent_1.default {
|
|
244
250
|
else if (!lodash_1.default.isString(value)) {
|
245
251
|
value = lodash_1.default.toString(value);
|
246
252
|
}
|
247
|
-
const
|
248
|
-
|
253
|
+
const shouldUseSelectData = (options.modalPreview || this.inDataTable)
|
254
|
+
&& this.component.dataSrc === 'url' && (this.loadedOptions.length || this.selectData);
|
255
|
+
if (this.component.dataSrc !== 'values' && !shouldUseSelectData) {
|
249
256
|
return value;
|
250
257
|
}
|
251
|
-
const values =
|
252
|
-
const option =
|
258
|
+
const values = shouldUseSelectData ? this.loadedOptions : this.component.values;
|
259
|
+
const option = !(values === null || values === void 0 ? void 0 : values.length) && shouldUseSelectData ? {
|
260
|
+
label: this.itemTemplate(this.selectData),
|
261
|
+
} : lodash_1.default.find(values, (v) => v.value === value);
|
253
262
|
if (!value) {
|
254
263
|
return lodash_1.default.get(option, 'label', '');
|
255
264
|
}
|
@@ -1563,8 +1563,8 @@ class SelectComponent extends ListComponent_1.default {
|
|
1563
1563
|
super.detach();
|
1564
1564
|
}
|
1565
1565
|
focus() {
|
1566
|
+
super.focus.call(this);
|
1566
1567
|
if (this.focusableElement) {
|
1567
|
-
super.focus.call(this);
|
1568
1568
|
this.focusableElement.focus();
|
1569
1569
|
}
|
1570
1570
|
}
|
@@ -1,44 +1,59 @@
|
|
1
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
2
|
let components: ({
|
8
3
|
label: string;
|
9
|
-
widget: string;
|
10
4
|
tableView: boolean;
|
11
|
-
|
12
|
-
|
13
|
-
label: string;
|
14
|
-
value: string;
|
15
|
-
}[];
|
16
|
-
};
|
17
|
-
dataType: string;
|
5
|
+
modal: boolean;
|
6
|
+
rowDrafts: boolean;
|
18
7
|
key: string;
|
19
8
|
type: string;
|
9
|
+
displayAsTable: boolean;
|
20
10
|
input: boolean;
|
21
|
-
|
22
|
-
|
11
|
+
components: ({
|
12
|
+
label: string;
|
13
|
+
widget: string;
|
14
|
+
tableView: boolean;
|
15
|
+
data: {
|
16
|
+
values: {
|
17
|
+
label: string;
|
18
|
+
value: string;
|
19
|
+
}[];
|
20
|
+
};
|
21
|
+
validate: {
|
22
|
+
required: boolean;
|
23
|
+
};
|
24
|
+
key: string;
|
25
|
+
type: string;
|
26
|
+
input: boolean;
|
27
|
+
applyMaskOn?: undefined;
|
28
|
+
validateWhenHidden?: undefined;
|
29
|
+
} | {
|
30
|
+
label: string;
|
31
|
+
applyMaskOn: string;
|
32
|
+
tableView: boolean;
|
33
|
+
validate: {
|
34
|
+
required: boolean;
|
35
|
+
};
|
36
|
+
validateWhenHidden: boolean;
|
37
|
+
key: string;
|
38
|
+
type: string;
|
39
|
+
input: boolean;
|
40
|
+
widget?: undefined;
|
41
|
+
data?: undefined;
|
42
|
+
})[];
|
43
|
+
showValidations?: undefined;
|
44
|
+
saveOnEnter?: undefined;
|
23
45
|
} | {
|
24
46
|
label: string;
|
25
|
-
|
47
|
+
showValidations: boolean;
|
26
48
|
tableView: boolean;
|
27
49
|
key: string;
|
28
50
|
type: string;
|
29
51
|
input: boolean;
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
operator: string;
|
36
|
-
value: number;
|
37
|
-
}[];
|
38
|
-
};
|
39
|
-
widget?: undefined;
|
40
|
-
data?: undefined;
|
41
|
-
dataType?: undefined;
|
52
|
+
saveOnEnter: boolean;
|
53
|
+
modal?: undefined;
|
54
|
+
rowDrafts?: undefined;
|
55
|
+
displayAsTable?: undefined;
|
56
|
+
components?: undefined;
|
42
57
|
})[];
|
43
58
|
}
|
44
59
|
export default _default;
|
@@ -1,59 +1,66 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.default = {
|
4
|
-
|
5
|
-
name: 'fio8072',
|
6
|
-
path: 'fio8072',
|
7
|
-
type: 'form',
|
8
|
-
display: 'form',
|
9
|
-
components: [
|
4
|
+
"components": [
|
10
5
|
{
|
11
|
-
label:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
6
|
+
"label": "Edit Grid",
|
7
|
+
"tableView": false,
|
8
|
+
"modal": true,
|
9
|
+
"rowDrafts": true,
|
10
|
+
"key": "editGrid",
|
11
|
+
"type": "editgrid",
|
12
|
+
"displayAsTable": false,
|
13
|
+
"input": true,
|
14
|
+
"components": [
|
15
|
+
{
|
16
|
+
"label": "Select",
|
17
|
+
"widget": "choicesjs",
|
18
|
+
"tableView": true,
|
19
|
+
"data": {
|
20
|
+
"values": [
|
21
|
+
{
|
22
|
+
"label": "a",
|
23
|
+
"value": "a"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"label": "b",
|
27
|
+
"value": "b"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"label": "c",
|
31
|
+
"value": "c"
|
32
|
+
}
|
33
|
+
]
|
19
34
|
},
|
20
|
-
{
|
21
|
-
|
22
|
-
value: '2',
|
35
|
+
"validate": {
|
36
|
+
"required": true
|
23
37
|
},
|
24
|
-
|
25
|
-
|
26
|
-
|
38
|
+
"key": "select",
|
39
|
+
"type": "select",
|
40
|
+
"input": true
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"label": "Text Field",
|
44
|
+
"applyMaskOn": "change",
|
45
|
+
"tableView": true,
|
46
|
+
"validate": {
|
47
|
+
"required": true
|
27
48
|
},
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
dataType: 'number',
|
35
|
-
key: 'select',
|
36
|
-
type: 'select',
|
37
|
-
input: true,
|
49
|
+
"validateWhenHidden": false,
|
50
|
+
"key": "textField",
|
51
|
+
"type": "textfield",
|
52
|
+
"input": true
|
53
|
+
}
|
54
|
+
]
|
38
55
|
},
|
39
56
|
{
|
40
|
-
label:
|
41
|
-
|
42
|
-
tableView:
|
43
|
-
key:
|
44
|
-
type:
|
45
|
-
input: true,
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
conditions: [
|
50
|
-
{
|
51
|
-
component: 'select',
|
52
|
-
operator: 'lessThan',
|
53
|
-
value: 5,
|
54
|
-
},
|
55
|
-
],
|
56
|
-
},
|
57
|
-
},
|
58
|
-
],
|
57
|
+
"label": "Submit",
|
58
|
+
"showValidations": false,
|
59
|
+
"tableView": false,
|
60
|
+
"key": "submit",
|
61
|
+
"type": "button",
|
62
|
+
"input": true,
|
63
|
+
"saveOnEnter": false
|
64
|
+
}
|
65
|
+
]
|
59
66
|
};
|
@@ -0,0 +1,44 @@
|
|
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
|
+
widget: string;
|
10
|
+
tableView: boolean;
|
11
|
+
data: {
|
12
|
+
values: {
|
13
|
+
label: string;
|
14
|
+
value: string;
|
15
|
+
}[];
|
16
|
+
};
|
17
|
+
dataType: string;
|
18
|
+
key: string;
|
19
|
+
type: string;
|
20
|
+
input: boolean;
|
21
|
+
applyMaskOn?: undefined;
|
22
|
+
conditional?: undefined;
|
23
|
+
} | {
|
24
|
+
label: string;
|
25
|
+
applyMaskOn: string;
|
26
|
+
tableView: boolean;
|
27
|
+
key: string;
|
28
|
+
type: string;
|
29
|
+
input: boolean;
|
30
|
+
conditional: {
|
31
|
+
show: boolean;
|
32
|
+
conjunction: string;
|
33
|
+
conditions: {
|
34
|
+
component: string;
|
35
|
+
operator: string;
|
36
|
+
value: number;
|
37
|
+
}[];
|
38
|
+
};
|
39
|
+
widget?: undefined;
|
40
|
+
data?: undefined;
|
41
|
+
dataType?: undefined;
|
42
|
+
})[];
|
43
|
+
}
|
44
|
+
export default _default;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = {
|
4
|
+
title: 'FIO-8072',
|
5
|
+
name: 'fio8072',
|
6
|
+
path: 'fio8072',
|
7
|
+
type: 'form',
|
8
|
+
display: 'form',
|
9
|
+
components: [
|
10
|
+
{
|
11
|
+
label: 'Select',
|
12
|
+
widget: 'choicesjs',
|
13
|
+
tableView: true,
|
14
|
+
data: {
|
15
|
+
values: [
|
16
|
+
{
|
17
|
+
label: 'A',
|
18
|
+
value: '1',
|
19
|
+
},
|
20
|
+
{
|
21
|
+
label: 'B',
|
22
|
+
value: '2',
|
23
|
+
},
|
24
|
+
{
|
25
|
+
label: 'C',
|
26
|
+
value: '10',
|
27
|
+
},
|
28
|
+
{
|
29
|
+
label: 'D',
|
30
|
+
value: '1d',
|
31
|
+
},
|
32
|
+
],
|
33
|
+
},
|
34
|
+
dataType: 'number',
|
35
|
+
key: 'select',
|
36
|
+
type: 'select',
|
37
|
+
input: true,
|
38
|
+
},
|
39
|
+
{
|
40
|
+
label: 'Text Field',
|
41
|
+
applyMaskOn: 'change',
|
42
|
+
tableView: true,
|
43
|
+
key: 'textField',
|
44
|
+
type: 'textfield',
|
45
|
+
input: true,
|
46
|
+
conditional: {
|
47
|
+
show: true,
|
48
|
+
conjunction: 'all',
|
49
|
+
conditions: [
|
50
|
+
{
|
51
|
+
component: 'select',
|
52
|
+
operator: 'lessThan',
|
53
|
+
value: 5,
|
54
|
+
},
|
55
|
+
],
|
56
|
+
},
|
57
|
+
},
|
58
|
+
],
|
59
|
+
};
|
@@ -22,6 +22,7 @@ import comp22 from './comp22';
|
|
22
22
|
import comp23 from './comp23';
|
23
23
|
import comp24 from './comp24';
|
24
24
|
import comp25 from './comp25';
|
25
|
+
import comp26 from './comp26';
|
25
26
|
import comp27 from './comp27';
|
26
27
|
export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26, comp27 };
|
27
28
|
export { multiSelect, multiSelectOptions } from "./comp3";
|
@@ -166,12 +166,19 @@ class SelectBoxesComponent extends Radio_1.default {
|
|
166
166
|
return changed;
|
167
167
|
}
|
168
168
|
getValueAsString(value, options = {}) {
|
169
|
+
var _a, _b;
|
169
170
|
if (!value) {
|
170
171
|
return '';
|
171
172
|
}
|
172
173
|
if (this.isSelectURL) {
|
173
|
-
if (options.modalPreview
|
174
|
-
|
174
|
+
if (options.modalPreview || this.options.readOnly || this.inDataTable) {
|
175
|
+
const checkedItems = lodash_1.default.keys(lodash_1.default.pickBy(value, (val) => val));
|
176
|
+
if (((_a = this.selectData) === null || _a === void 0 ? void 0 : _a.length) === checkedItems.length) {
|
177
|
+
return this.selectData.map(item => this.itemTemplate(item)).join(', ');
|
178
|
+
}
|
179
|
+
else if ((_b = this.loadedOptions) === null || _b === void 0 ? void 0 : _b.length) {
|
180
|
+
return this.loadedOptions.filter((option) => value[option.value]).map((option) => option.label).join(', ');
|
181
|
+
}
|
175
182
|
}
|
176
183
|
return (0, lodash_1.default)(value).pickBy((val) => val).keys().join(', ');
|
177
184
|
}
|
@@ -20,10 +20,10 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
20
20
|
setReadOnlyValue(value: any, index: any): void;
|
21
21
|
get isJsonValue(): any;
|
22
22
|
/**
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
24
|
+
* @param {*} value - The value to normalize
|
25
|
+
* @returns {*} - Returns the normalized value
|
26
|
+
*/
|
27
27
|
normalizeValue(value: any): any;
|
28
28
|
normalizeSingleValue(value: any): any;
|
29
29
|
setConvertedValue(value: any, index: any): any;
|
@@ -310,10 +310,10 @@ class TextAreaComponent extends TextField_1.default {
|
|
310
310
|
return this.component.as && this.component.as === 'json';
|
311
311
|
}
|
312
312
|
/**
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
313
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
314
|
+
* @param {*} value - The value to normalize
|
315
|
+
* @returns {*} - Returns the normalized value
|
316
|
+
*/
|
317
317
|
normalizeValue(value) {
|
318
318
|
if (this.component.multiple && Array.isArray(value)) {
|
319
319
|
return value.map((singleValue) => this.normalizeSingleValue(singleValue));
|
@@ -27,15 +27,7 @@ class IsEqualTo extends ConditionOperator_1.default {
|
|
27
27
|
if (conditionTriggerComponent
|
28
28
|
&& (0, utils_1.isSelectResourceWithObjectValue)(conditionTriggerComponent.component)
|
29
29
|
&& ((_b = conditionTriggerComponent.component) === null || _b === void 0 ? void 0 : _b.template)) {
|
30
|
-
|
31
|
-
return false;
|
32
|
-
}
|
33
|
-
const { template, valueProperty } = conditionTriggerComponent.component;
|
34
|
-
if (valueProperty === 'data') {
|
35
|
-
value = { data: value };
|
36
|
-
comparedValue = { data: comparedValue };
|
37
|
-
}
|
38
|
-
return lodash_1.default.every((0, utils_1.getItemTemplateKeys)(template) || [], k => lodash_1.default.isEqual(lodash_1.default.get(value, k), lodash_1.default.get(comparedValue, k)));
|
30
|
+
return (0, utils_1.compareSelectResourceWithObjectTypeValues)(value, comparedValue, conditionTriggerComponent.component);
|
39
31
|
}
|
40
32
|
}
|
41
33
|
//special check for select boxes
|
@@ -41,4 +41,7 @@ export const applyFormChanges: typeof Utils.applyFormChanges;
|
|
41
41
|
export const findComponent: typeof Utils.findComponent;
|
42
42
|
export const getEmptyValue: typeof Utils.getEmptyValue;
|
43
43
|
export const isComponentDataEmpty: typeof Utils.isComponentDataEmpty;
|
44
|
+
export const isSelectResourceWithObjectValue: typeof Utils.isSelectResourceWithObjectValue;
|
45
|
+
export const compareSelectResourceWithObjectTypeValues: typeof Utils.compareSelectResourceWithObjectTypeValues;
|
46
|
+
export const getItemTemplateKeys: typeof Utils.getItemTemplateKeys;
|
44
47
|
import { Utils } from '@formio/core';
|