@formio/js 5.0.0-rc.91 → 5.0.0-rc.93
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 +31 -31
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +32 -32
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +4 -4
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +12 -12
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Webform.js +7 -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 +7 -9
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/cjs/components/day/Day.d.ts +1 -1
- package/lib/cjs/components/day/Day.js +15 -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 +14 -7
- package/lib/cjs/components/editgrid/fixtures/comp19.d.ts +59 -0
- package/lib/cjs/components/editgrid/fixtures/comp19.js +73 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/cjs/components/form/editForm/Form.edit.data.js +1 -1
- package/lib/cjs/components/number/fixtures/comp11.d.ts +17 -0
- package/lib/cjs/components/number/fixtures/comp11.js +20 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/number/fixtures/index.js +3 -1
- 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/components/time/Time.js +0 -6
- package/lib/cjs/components/time/fixtures/timeForm2.js +9 -0
- 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/Webform.js +6 -1
- 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 +7 -9
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/mjs/components/day/Day.d.ts +1 -1
- package/lib/mjs/components/day/Day.js +15 -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 +14 -7
- package/lib/mjs/components/editgrid/fixtures/comp19.d.ts +59 -0
- package/lib/mjs/components/editgrid/fixtures/comp19.js +71 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +2 -1
- package/lib/mjs/components/form/editForm/Form.edit.data.js +1 -1
- package/lib/mjs/components/number/fixtures/comp11.d.ts +17 -0
- package/lib/mjs/components/number/fixtures/comp11.js +18 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/number/fixtures/index.js +2 -1
- 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/components/time/Time.js +0 -6
- package/lib/mjs/components/time/fixtures/timeForm2.js +9 -0
- 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
@@ -1,57 +1,64 @@
|
|
1
1
|
export default {
|
2
|
-
|
3
|
-
name: 'fio8072',
|
4
|
-
path: 'fio8072',
|
5
|
-
type: 'form',
|
6
|
-
display: 'form',
|
7
|
-
components: [
|
2
|
+
"components": [
|
8
3
|
{
|
9
|
-
label:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
"label": "Edit Grid",
|
5
|
+
"tableView": false,
|
6
|
+
"modal": true,
|
7
|
+
"rowDrafts": true,
|
8
|
+
"key": "editGrid",
|
9
|
+
"type": "editgrid",
|
10
|
+
"displayAsTable": false,
|
11
|
+
"input": true,
|
12
|
+
"components": [
|
13
|
+
{
|
14
|
+
"label": "Select",
|
15
|
+
"widget": "choicesjs",
|
16
|
+
"tableView": true,
|
17
|
+
"data": {
|
18
|
+
"values": [
|
19
|
+
{
|
20
|
+
"label": "a",
|
21
|
+
"value": "a"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"label": "b",
|
25
|
+
"value": "b"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"label": "c",
|
29
|
+
"value": "c"
|
30
|
+
}
|
31
|
+
]
|
17
32
|
},
|
18
|
-
{
|
19
|
-
|
20
|
-
value: '2',
|
33
|
+
"validate": {
|
34
|
+
"required": true
|
21
35
|
},
|
22
|
-
|
23
|
-
|
24
|
-
|
36
|
+
"key": "select",
|
37
|
+
"type": "select",
|
38
|
+
"input": true
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"label": "Text Field",
|
42
|
+
"applyMaskOn": "change",
|
43
|
+
"tableView": true,
|
44
|
+
"validate": {
|
45
|
+
"required": true
|
25
46
|
},
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
dataType: 'number',
|
33
|
-
key: 'select',
|
34
|
-
type: 'select',
|
35
|
-
input: true,
|
47
|
+
"validateWhenHidden": false,
|
48
|
+
"key": "textField",
|
49
|
+
"type": "textfield",
|
50
|
+
"input": true
|
51
|
+
}
|
52
|
+
]
|
36
53
|
},
|
37
54
|
{
|
38
|
-
label:
|
39
|
-
|
40
|
-
tableView:
|
41
|
-
key:
|
42
|
-
type:
|
43
|
-
input: true,
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
conditions: [
|
48
|
-
{
|
49
|
-
component: 'select',
|
50
|
-
operator: 'lessThan',
|
51
|
-
value: 5,
|
52
|
-
},
|
53
|
-
],
|
54
|
-
},
|
55
|
-
},
|
56
|
-
],
|
55
|
+
"label": "Submit",
|
56
|
+
"showValidations": false,
|
57
|
+
"tableView": false,
|
58
|
+
"key": "submit",
|
59
|
+
"type": "button",
|
60
|
+
"input": true,
|
61
|
+
"saveOnEnter": false
|
62
|
+
}
|
63
|
+
]
|
57
64
|
};
|
@@ -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,57 @@
|
|
1
|
+
export default {
|
2
|
+
title: 'FIO-8072',
|
3
|
+
name: 'fio8072',
|
4
|
+
path: 'fio8072',
|
5
|
+
type: 'form',
|
6
|
+
display: 'form',
|
7
|
+
components: [
|
8
|
+
{
|
9
|
+
label: 'Select',
|
10
|
+
widget: 'choicesjs',
|
11
|
+
tableView: true,
|
12
|
+
data: {
|
13
|
+
values: [
|
14
|
+
{
|
15
|
+
label: 'A',
|
16
|
+
value: '1',
|
17
|
+
},
|
18
|
+
{
|
19
|
+
label: 'B',
|
20
|
+
value: '2',
|
21
|
+
},
|
22
|
+
{
|
23
|
+
label: 'C',
|
24
|
+
value: '10',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
label: 'D',
|
28
|
+
value: '1d',
|
29
|
+
},
|
30
|
+
],
|
31
|
+
},
|
32
|
+
dataType: 'number',
|
33
|
+
key: 'select',
|
34
|
+
type: 'select',
|
35
|
+
input: true,
|
36
|
+
},
|
37
|
+
{
|
38
|
+
label: 'Text Field',
|
39
|
+
applyMaskOn: 'change',
|
40
|
+
tableView: true,
|
41
|
+
key: 'textField',
|
42
|
+
type: 'textfield',
|
43
|
+
input: true,
|
44
|
+
conditional: {
|
45
|
+
show: true,
|
46
|
+
conjunction: 'all',
|
47
|
+
conditions: [
|
48
|
+
{
|
49
|
+
component: 'select',
|
50
|
+
operator: 'lessThan',
|
51
|
+
value: 5,
|
52
|
+
},
|
53
|
+
],
|
54
|
+
},
|
55
|
+
},
|
56
|
+
],
|
57
|
+
};
|
@@ -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";
|
@@ -172,8 +172,14 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
172
172
|
return '';
|
173
173
|
}
|
174
174
|
if (this.isSelectURL) {
|
175
|
-
if (options.modalPreview
|
176
|
-
|
175
|
+
if (options.modalPreview || this.options.readOnly || this.inDataTable) {
|
176
|
+
const checkedItems = _.keys(_.pickBy(value, (val) => val));
|
177
|
+
if (this.selectData?.length === checkedItems.length) {
|
178
|
+
return this.selectData.map(item => this.itemTemplate(item)).join(', ');
|
179
|
+
}
|
180
|
+
else if (this.loadedOptions?.length) {
|
181
|
+
return this.loadedOptions.filter((option) => value[option.value]).map((option) => option.label).join(', ');
|
182
|
+
}
|
177
183
|
}
|
178
184
|
return _(value).pickBy((val) => val).keys().join(', ');
|
179
185
|
}
|
@@ -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;
|
@@ -305,10 +305,10 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
305
305
|
return this.component.as && this.component.as === 'json';
|
306
306
|
}
|
307
307
|
/**
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
308
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
309
|
+
* @param {*} value - The value to normalize
|
310
|
+
* @returns {*} - Returns the normalized value
|
311
|
+
*/
|
312
312
|
normalizeValue(value) {
|
313
313
|
if (this.component.multiple && Array.isArray(value)) {
|
314
314
|
return value.map((singleValue) => this.normalizeSingleValue(singleValue));
|
@@ -51,12 +51,6 @@ export default class TimeComponent extends TextFieldComponent {
|
|
51
51
|
}
|
52
52
|
return value;
|
53
53
|
}
|
54
|
-
get validationValue() {
|
55
|
-
if ((Array.isArray(this.rawData) && !this.rawData.length) || !this.rawData) {
|
56
|
-
return this.dataValue;
|
57
|
-
}
|
58
|
-
return this.rawData;
|
59
|
-
}
|
60
54
|
get inputInfo() {
|
61
55
|
const info = super.inputInfo;
|
62
56
|
info.attr.type = this.component.inputType;
|
@@ -12,6 +12,15 @@ export default {
|
|
12
12
|
'input': true,
|
13
13
|
'inputMask': '99:99'
|
14
14
|
},
|
15
|
+
{
|
16
|
+
'label': 'Multiple Time',
|
17
|
+
'inputType': 'text',
|
18
|
+
'tableView': true,
|
19
|
+
'key': 'multipleTime',
|
20
|
+
'type': 'time',
|
21
|
+
'input': true,
|
22
|
+
'inputMask': '99:99'
|
23
|
+
},
|
15
24
|
{
|
16
25
|
'label': 'Submit',
|
17
26
|
'showValidations': false,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import ConditionOperator from './ConditionOperator';
|
2
2
|
import _ from 'lodash';
|
3
|
-
import {
|
3
|
+
import { compareSelectResourceWithObjectTypeValues, isSelectResourceWithObjectValue } from '../utils';
|
4
4
|
export default class IsEqualTo extends ConditionOperator {
|
5
5
|
static get operatorKey() {
|
6
6
|
return 'isEqual';
|
@@ -21,15 +21,7 @@ export default class IsEqualTo extends ConditionOperator {
|
|
21
21
|
if (conditionTriggerComponent
|
22
22
|
&& isSelectResourceWithObjectValue(conditionTriggerComponent.component)
|
23
23
|
&& conditionTriggerComponent.component?.template) {
|
24
|
-
|
25
|
-
return false;
|
26
|
-
}
|
27
|
-
const { template, valueProperty } = conditionTriggerComponent.component;
|
28
|
-
if (valueProperty === 'data') {
|
29
|
-
value = { data: value };
|
30
|
-
comparedValue = { data: comparedValue };
|
31
|
-
}
|
32
|
-
return _.every(getItemTemplateKeys(template) || [], k => _.isEqual(_.get(value, k), _.get(comparedValue, k)));
|
24
|
+
return compareSelectResourceWithObjectTypeValues(value, comparedValue, conditionTriggerComponent.component);
|
33
25
|
}
|
34
26
|
}
|
35
27
|
//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';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Utils } from '@formio/core';
|
2
|
-
const { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty } = Utils;
|
2
|
+
const { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty, isSelectResourceWithObjectValue, compareSelectResourceWithObjectTypeValues, getItemTemplateKeys } = Utils;
|
3
3
|
/**
|
4
4
|
* Deprecated version of findComponents. Renamed to searchComponents.
|
5
5
|
* @param {import('@formio/core').Component[]} components - The components to find components within.
|
@@ -10,4 +10,4 @@ export function findComponents(components, query) {
|
|
10
10
|
console.warn('formio.js/utils findComponents is deprecated. Use searchComponents instead.');
|
11
11
|
return searchComponents(components, query);
|
12
12
|
}
|
13
|
-
export { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty };
|
13
|
+
export { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty, isSelectResourceWithObjectValue, compareSelectResourceWithObjectTypeValues, getItemTemplateKeys };
|
package/lib/mjs/utils/utils.d.ts
CHANGED
@@ -498,18 +498,6 @@ export function getFocusableElements(element: HTMLElement): NodeList<HTMLElement
|
|
498
498
|
* @returns {Array<string>|null} - The saved types for the component
|
499
499
|
*/
|
500
500
|
export function getComponentSavedTypes(fullSchema: import('@formio/core').Component): Array<string> | null;
|
501
|
-
/**
|
502
|
-
* Returns the template keys inside the template code.
|
503
|
-
* @param {string} template - The template to get the keys from.
|
504
|
-
* @returns {Array<string>} - The keys inside the template.
|
505
|
-
*/
|
506
|
-
export function getItemTemplateKeys(template: string): Array<string>;
|
507
|
-
/**
|
508
|
-
* Returns if the component is a select resource with an object for its value.
|
509
|
-
* @param {import('@formio/core').Component} comp - The component to check.
|
510
|
-
* @returns {boolean} - TRUE if the component is a select resource with an object for its value; FALSE otherwise.
|
511
|
-
*/
|
512
|
-
export function isSelectResourceWithObjectValue(comp?: import('@formio/core').Component): boolean;
|
513
501
|
export * from "./formUtils";
|
514
502
|
/**
|
515
503
|
* Map values through unfold and return first non-nil value.
|
package/lib/mjs/utils/utils.js
CHANGED
@@ -1587,33 +1587,3 @@ export const interpolateErrors = (component, errors, interpolateFn) => {
|
|
1587
1587
|
return { ...error, message: unescapeHTML(interpolateFn(toInterpolate, context)), context: { ...context } };
|
1588
1588
|
});
|
1589
1589
|
};
|
1590
|
-
/**
|
1591
|
-
* Returns the template keys inside the template code.
|
1592
|
-
* @param {string} template - The template to get the keys from.
|
1593
|
-
* @returns {Array<string>} - The keys inside the template.
|
1594
|
-
*/
|
1595
|
-
export function getItemTemplateKeys(template) {
|
1596
|
-
const templateKeys = [];
|
1597
|
-
if (!template) {
|
1598
|
-
return templateKeys;
|
1599
|
-
}
|
1600
|
-
const keys = template.match(/({{\s*(.*?)\s*}})/g);
|
1601
|
-
if (keys) {
|
1602
|
-
keys.forEach((key) => {
|
1603
|
-
const propKey = key.match(/{{\s*item\.(.*?)\s*}}/);
|
1604
|
-
if (propKey && propKey.length > 1) {
|
1605
|
-
templateKeys.push(propKey[1]);
|
1606
|
-
}
|
1607
|
-
});
|
1608
|
-
}
|
1609
|
-
return templateKeys;
|
1610
|
-
}
|
1611
|
-
/**
|
1612
|
-
* Returns if the component is a select resource with an object for its value.
|
1613
|
-
* @param {import('@formio/core').Component} comp - The component to check.
|
1614
|
-
* @returns {boolean} - TRUE if the component is a select resource with an object for its value; FALSE otherwise.
|
1615
|
-
*/
|
1616
|
-
export function isSelectResourceWithObjectValue(comp = {}) {
|
1617
|
-
const { reference, dataSrc, valueProperty } = comp;
|
1618
|
-
return reference || (dataSrc === 'resource' && (!valueProperty || valueProperty === 'data'));
|
1619
|
-
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.0.0-rc.
|
3
|
+
"version": "5.0.0-rc.93",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -79,9 +79,9 @@
|
|
79
79
|
},
|
80
80
|
"homepage": "https://github.com/formio/formio.js#readme",
|
81
81
|
"dependencies": {
|
82
|
-
"@formio/bootstrap": "3.0.0-rc.
|
82
|
+
"@formio/bootstrap": "3.0.0-rc.40",
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
84
|
-
"@formio/core": "2.3.0-rc.
|
84
|
+
"@formio/core": "2.3.0-rc.14",
|
85
85
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|