@formio/js 5.0.0-dev.5692.a9fe9c4 → 5.0.0-dev.5696.7642331
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 +14 -0
- package/dist/formio.builder.css +0 -1
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.form.css +0 -1
- package/dist/formio.form.js +69 -125
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.css +0 -1
- package/dist/formio.full.js +51 -31
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +57 -17
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +1 -0
- package/lib/cjs/Webform.js +1 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/cjs/components/_classes/component/Component.js +18 -0
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +4 -1
- package/lib/cjs/components/address/Address.js +4 -0
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
- package/lib/cjs/components/currency/Currency.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.js +38 -26
- package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -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/datamap/DataMap.js +2 -2
- package/lib/cjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/cjs/components/day/fixtures/comp8.js +40 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.js +12 -1
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.js +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.js +71 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
- package/lib/cjs/components/number/Number.d.ts +17 -2
- package/lib/cjs/components/number/Number.js +26 -6
- package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp10.js +21 -0
- package/lib/cjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp9.js +21 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/number/fixtures/index.js +5 -1
- package/lib/cjs/components/radio/Radio.js +7 -6
- package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
- package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/cjs/components/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.js +3 -2
- package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/cjs/components/time/fixtures/comp4.js +171 -0
- package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/time/fixtures/index.js +3 -1
- package/lib/cjs/translations/en.d.ts +3 -0
- package/lib/cjs/translations/en.js +4 -1
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +4 -3
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
- package/lib/cjs/utils/utils.d.ts +1 -10
- package/lib/cjs/utils/utils.js +59 -7
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +1 -0
- package/lib/mjs/Webform.js +1 -3
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/mjs/components/_classes/component/Component.js +7 -0
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +4 -1
- package/lib/mjs/components/address/Address.js +4 -0
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
- package/lib/mjs/components/currency/Currency.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.js +37 -25
- package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -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/datamap/DataMap.js +1 -1
- package/lib/mjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/mjs/components/day/fixtures/comp8.js +38 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.js +12 -1
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.js +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.js +69 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/mjs/components/number/Number.d.ts +17 -2
- package/lib/mjs/components/number/Number.js +25 -5
- package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp10.js +19 -0
- package/lib/mjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp9.js +19 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/number/fixtures/index.js +3 -1
- package/lib/mjs/components/radio/Radio.js +7 -6
- package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
- package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/lib/mjs/components/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.js +3 -2
- package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/mjs/components/time/fixtures/comp4.js +169 -0
- package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/time/fixtures/index.js +2 -1
- package/lib/mjs/translations/en.d.ts +3 -0
- package/lib/mjs/translations/en.js +4 -1
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +3 -3
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
- package/lib/mjs/utils/utils.d.ts +1 -10
- package/lib/mjs/utils/utils.js +58 -7
- package/package.json +2 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let _id: string;
|
|
3
|
+
let title: string;
|
|
4
|
+
let name: string;
|
|
5
|
+
let path: string;
|
|
6
|
+
let type: string;
|
|
7
|
+
let display: string;
|
|
8
|
+
let owner: string;
|
|
9
|
+
let components: ({
|
|
10
|
+
label: string;
|
|
11
|
+
tableView: boolean;
|
|
12
|
+
modal: boolean;
|
|
13
|
+
validateWhenHidden: boolean;
|
|
14
|
+
rowDrafts: boolean;
|
|
15
|
+
key: string;
|
|
16
|
+
type: string;
|
|
17
|
+
displayAsTable: boolean;
|
|
18
|
+
input: boolean;
|
|
19
|
+
components: {
|
|
20
|
+
label: string;
|
|
21
|
+
applyMaskOn: string;
|
|
22
|
+
tableView: boolean;
|
|
23
|
+
validateWhenHidden: boolean;
|
|
24
|
+
key: string;
|
|
25
|
+
type: string;
|
|
26
|
+
input: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
disableOnInvalid?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
type: string;
|
|
31
|
+
label: string;
|
|
32
|
+
key: string;
|
|
33
|
+
disableOnInvalid: boolean;
|
|
34
|
+
input: boolean;
|
|
35
|
+
tableView: boolean;
|
|
36
|
+
modal?: undefined;
|
|
37
|
+
validateWhenHidden?: undefined;
|
|
38
|
+
rowDrafts?: undefined;
|
|
39
|
+
displayAsTable?: undefined;
|
|
40
|
+
components?: undefined;
|
|
41
|
+
})[];
|
|
42
|
+
let pdfComponents: never[];
|
|
43
|
+
let settings: {};
|
|
44
|
+
let properties: {};
|
|
45
|
+
let project: string;
|
|
46
|
+
let controller: string;
|
|
47
|
+
let revisions: string;
|
|
48
|
+
let submissionRevisions: string;
|
|
49
|
+
let _vid: number;
|
|
50
|
+
let created: string;
|
|
51
|
+
let modified: string;
|
|
52
|
+
let machineName: string;
|
|
53
|
+
}
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
_id: '669e1c88a40e327e67e7d1c5',
|
|
3
|
+
title: 'editGrid test',
|
|
4
|
+
name: 'editGridTest',
|
|
5
|
+
path: 'editgridtest',
|
|
6
|
+
type: 'form',
|
|
7
|
+
display: 'form',
|
|
8
|
+
owner: '637b2e6b48c1227e60b1f910',
|
|
9
|
+
components: [
|
|
10
|
+
{
|
|
11
|
+
label: 'Edit Grid',
|
|
12
|
+
tableView: false,
|
|
13
|
+
modal: false,
|
|
14
|
+
validateWhenHidden: false,
|
|
15
|
+
rowDrafts: false,
|
|
16
|
+
key: 'editGrid',
|
|
17
|
+
type: 'editgrid',
|
|
18
|
+
displayAsTable: false,
|
|
19
|
+
input: true,
|
|
20
|
+
components: [
|
|
21
|
+
{
|
|
22
|
+
label: 'Text Field',
|
|
23
|
+
applyMaskOn: 'change',
|
|
24
|
+
tableView: true,
|
|
25
|
+
validateWhenHidden: false,
|
|
26
|
+
key: 'textField',
|
|
27
|
+
type: 'textfield',
|
|
28
|
+
input: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'button',
|
|
34
|
+
label: 'Submit',
|
|
35
|
+
key: 'submit',
|
|
36
|
+
disableOnInvalid: true,
|
|
37
|
+
input: true,
|
|
38
|
+
tableView: false,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
pdfComponents: [],
|
|
42
|
+
settings: {},
|
|
43
|
+
properties: {},
|
|
44
|
+
project: '669e1c68a40e327e67e7cedd',
|
|
45
|
+
controller: '',
|
|
46
|
+
revisions: '',
|
|
47
|
+
submissionRevisions: '',
|
|
48
|
+
_vid: 0,
|
|
49
|
+
created: '2024-07-22T08:47:04.399Z',
|
|
50
|
+
modified: '2024-07-22T10:04:23.474Z',
|
|
51
|
+
machineName: 'authoring-qzdhayddccjauyr:editGridTest',
|
|
52
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let type: string;
|
|
3
|
+
let display: string;
|
|
4
|
+
let components: ({
|
|
5
|
+
title: string;
|
|
6
|
+
breadcrumbClickable: boolean;
|
|
7
|
+
buttonSettings: {
|
|
8
|
+
previous: boolean;
|
|
9
|
+
cancel: boolean;
|
|
10
|
+
next: boolean;
|
|
11
|
+
};
|
|
12
|
+
collapsible: boolean;
|
|
13
|
+
tableView: boolean;
|
|
14
|
+
key: string;
|
|
15
|
+
type: string;
|
|
16
|
+
label: string;
|
|
17
|
+
input: boolean;
|
|
18
|
+
components: {
|
|
19
|
+
label: string;
|
|
20
|
+
tableView: boolean;
|
|
21
|
+
rowDrafts: boolean;
|
|
22
|
+
key: string;
|
|
23
|
+
type: string;
|
|
24
|
+
input: boolean;
|
|
25
|
+
components: {
|
|
26
|
+
label: string;
|
|
27
|
+
tableView: boolean;
|
|
28
|
+
key: string;
|
|
29
|
+
type: string;
|
|
30
|
+
input: boolean;
|
|
31
|
+
alwaysEnabled: boolean;
|
|
32
|
+
}[];
|
|
33
|
+
alwaysEnabled: boolean;
|
|
34
|
+
}[];
|
|
35
|
+
alwaysEnabled: boolean;
|
|
36
|
+
showValidations?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
label: string;
|
|
39
|
+
showValidations: boolean;
|
|
40
|
+
alwaysEnabled: boolean;
|
|
41
|
+
tableView: boolean;
|
|
42
|
+
key: string;
|
|
43
|
+
type: string;
|
|
44
|
+
input: boolean;
|
|
45
|
+
title?: undefined;
|
|
46
|
+
breadcrumbClickable?: undefined;
|
|
47
|
+
buttonSettings?: undefined;
|
|
48
|
+
collapsible?: undefined;
|
|
49
|
+
components?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
}
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: 'form',
|
|
3
|
+
display: 'wizard',
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
title: 'Page 1',
|
|
7
|
+
breadcrumbClickable: true,
|
|
8
|
+
buttonSettings: {
|
|
9
|
+
previous: true,
|
|
10
|
+
cancel: true,
|
|
11
|
+
next: true
|
|
12
|
+
},
|
|
13
|
+
collapsible: false,
|
|
14
|
+
tableView: false,
|
|
15
|
+
key: 'page3',
|
|
16
|
+
type: 'panel',
|
|
17
|
+
label: 'Page 2',
|
|
18
|
+
input: false,
|
|
19
|
+
components: [
|
|
20
|
+
{
|
|
21
|
+
label: 'Edit Grid',
|
|
22
|
+
tableView: true,
|
|
23
|
+
rowDrafts: false,
|
|
24
|
+
key: 'editGrid',
|
|
25
|
+
type: 'editgrid',
|
|
26
|
+
input: true,
|
|
27
|
+
components: [
|
|
28
|
+
{
|
|
29
|
+
label: 'Text Field',
|
|
30
|
+
tableView: true,
|
|
31
|
+
key: 'textField',
|
|
32
|
+
type: 'textfield',
|
|
33
|
+
input: true,
|
|
34
|
+
alwaysEnabled: false
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
alwaysEnabled: false
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
alwaysEnabled: false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: 'Page 2',
|
|
44
|
+
breadcrumbClickable: true,
|
|
45
|
+
buttonSettings: {
|
|
46
|
+
previous: true,
|
|
47
|
+
cancel: true,
|
|
48
|
+
next: true
|
|
49
|
+
},
|
|
50
|
+
collapsible: false,
|
|
51
|
+
tableView: false,
|
|
52
|
+
key: 'page2',
|
|
53
|
+
type: 'panel',
|
|
54
|
+
label: 'Page 1',
|
|
55
|
+
input: false,
|
|
56
|
+
alwaysEnabled: false,
|
|
57
|
+
components: []
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Submit',
|
|
61
|
+
showValidations: false,
|
|
62
|
+
alwaysEnabled: false,
|
|
63
|
+
tableView: false,
|
|
64
|
+
key: 'submit',
|
|
65
|
+
type: 'button',
|
|
66
|
+
input: true
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
};
|
|
@@ -13,7 +13,9 @@ import comp6 from './comp6';
|
|
|
13
13
|
import comp7 from './comp7';
|
|
14
14
|
import comp8 from './comp8';
|
|
15
15
|
import comp9 from './comp9';
|
|
16
|
+
import comp16 from './comp16';
|
|
16
17
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
17
18
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
18
19
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
19
|
-
|
|
20
|
+
import compTestEvents from './comp-test-events';
|
|
21
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -13,7 +13,9 @@ import comp12 from './comp12';
|
|
|
13
13
|
import comp13 from './comp13';
|
|
14
14
|
import comp14 from './comp14';
|
|
15
15
|
import comp15 from './comp15';
|
|
16
|
+
import comp16 from './comp16';
|
|
16
17
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
17
18
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
18
19
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
19
|
-
|
|
20
|
+
import compTestEvents from './comp-test-events';
|
|
21
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -27,11 +27,26 @@ export default class NumberComponent extends Input {
|
|
|
27
27
|
*/
|
|
28
28
|
createNumberMask(): any;
|
|
29
29
|
isDecimalAllowed(): any;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
|
|
32
|
+
* be processed by either parseInt or parseFloat
|
|
33
|
+
* @param {string} value the value to be parsed
|
|
34
|
+
* @returns {number} a parsed number
|
|
35
|
+
*/
|
|
36
|
+
parseNumber(value: string): number;
|
|
31
37
|
setInputMask(input: any): void;
|
|
32
38
|
getValueAt(index: any): number | null;
|
|
33
39
|
setValueAt(index: any, value: any, flags?: {}): void;
|
|
34
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Converts a string to a floating point number, formats the number based on the parsed float function
|
|
42
|
+
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
|
|
43
|
+
* formatted number back as a string
|
|
44
|
+
* Example Input: "123.456,22"
|
|
45
|
+
* Example Output: "123456,22"
|
|
46
|
+
* @param {string | number} input the numeric string to parse
|
|
47
|
+
* @returns {string | null} a parsed string
|
|
48
|
+
*/
|
|
49
|
+
parseValue(input: string | number): string | null;
|
|
35
50
|
focus(): void;
|
|
36
51
|
getMaskedValue(value: any): any;
|
|
37
52
|
getValueAsString(value: any, options: any): any;
|
|
@@ -50,12 +50,12 @@ export default class NumberComponent extends Input {
|
|
|
50
50
|
|| this.options.properties?.decimalSeparator
|
|
51
51
|
|| separators.decimalSeparator;
|
|
52
52
|
if (this.component.delimiter) {
|
|
53
|
-
|
|
54
|
-
console.warn("Property 'thousandsSeparator' is deprecated. Please use i18n to specify delimiter.");
|
|
55
|
-
}
|
|
56
|
-
this.delimiter = this.options.properties?.thousandsSeparator || this.options.thousandsSeparator || separators.delimiter;
|
|
53
|
+
this.delimiter = this.component.thousandsSeparator || this.options.properties?.thousandsSeparator || this.options.thousandsSeparator || separators.delimiter;
|
|
57
54
|
}
|
|
58
55
|
else {
|
|
56
|
+
if (this.component.thousandsSeparator || this.options.properties?.thousandsSeparator || this.options.thousandsSeparator) {
|
|
57
|
+
console.warn('In order for thousands separator to work properly, you must set the delimiter to true in the component json');
|
|
58
|
+
}
|
|
59
59
|
this.delimiter = '';
|
|
60
60
|
}
|
|
61
61
|
const requireDecimal = _.get(this.component, 'requireDecimal', false);
|
|
@@ -77,7 +77,7 @@ export default class NumberComponent extends Input {
|
|
|
77
77
|
prefix: '',
|
|
78
78
|
suffix: '',
|
|
79
79
|
requireDecimal: _.get(this.component, 'requireDecimal', false),
|
|
80
|
-
thousandsSeparatorSymbol:
|
|
80
|
+
thousandsSeparatorSymbol: this.delimiter || '',
|
|
81
81
|
decimalSymbol: _.get(this.component, 'decimalSymbol', this.decimalSeparator),
|
|
82
82
|
decimalLimit: _.get(this.component, 'decimalLimit', this.decimalLimit),
|
|
83
83
|
allowNegative: _.get(this.component, 'allowNegative', true),
|
|
@@ -89,6 +89,11 @@ export default class NumberComponent extends Input {
|
|
|
89
89
|
}
|
|
90
90
|
get defaultValue() {
|
|
91
91
|
let defaultValue = super.defaultValue;
|
|
92
|
+
if (typeof defaultValue === 'string') {
|
|
93
|
+
// Default value may be a string or have custom thousands separators or decimal symbols, so we need to call
|
|
94
|
+
// parseNumber on it
|
|
95
|
+
defaultValue = this.parseNumber(defaultValue);
|
|
96
|
+
}
|
|
92
97
|
if (!defaultValue && this.component.defaultValue === 0) {
|
|
93
98
|
defaultValue = this.component.defaultValue;
|
|
94
99
|
}
|
|
@@ -100,6 +105,12 @@ export default class NumberComponent extends Input {
|
|
|
100
105
|
isDecimalAllowed() {
|
|
101
106
|
return _.get(this.component, 'allowDecimal', !(this.component.validate && this.component.validate.integer));
|
|
102
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
|
|
110
|
+
* be processed by either parseInt or parseFloat
|
|
111
|
+
* @param {string} value the value to be parsed
|
|
112
|
+
* @returns {number} a parsed number
|
|
113
|
+
*/
|
|
103
114
|
parseNumber(value) {
|
|
104
115
|
// Remove delimiters and convert decimal separator to dot.
|
|
105
116
|
value = value.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
|
@@ -144,6 +155,15 @@ export default class NumberComponent extends Input {
|
|
|
144
155
|
setValueAt(index, value, flags = {}) {
|
|
145
156
|
return super.setValueAt(index, this.formatValue(this.parseValue(value)), flags);
|
|
146
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Converts a string to a floating point number, formats the number based on the parsed float function
|
|
160
|
+
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
|
|
161
|
+
* formatted number back as a string
|
|
162
|
+
* Example Input: "123.456,22"
|
|
163
|
+
* Example Output: "123456,22"
|
|
164
|
+
* @param {string | number} input the numeric string to parse
|
|
165
|
+
* @returns {string | null} a parsed string
|
|
166
|
+
*/
|
|
147
167
|
parseValue(input) {
|
|
148
168
|
if (typeof input === 'string') {
|
|
149
169
|
input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: {
|
|
3
|
+
label: string;
|
|
4
|
+
applyMaskOn: string;
|
|
5
|
+
mask: boolean;
|
|
6
|
+
tableView: boolean;
|
|
7
|
+
delimiter: boolean;
|
|
8
|
+
requireDecimal: boolean;
|
|
9
|
+
inputFormat: string;
|
|
10
|
+
truncateMultipleSpaces: boolean;
|
|
11
|
+
validateWhenHidden: boolean;
|
|
12
|
+
key: string;
|
|
13
|
+
type: string;
|
|
14
|
+
input: boolean;
|
|
15
|
+
defaultValue: string;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
components: [
|
|
3
|
+
{
|
|
4
|
+
"label": "Number",
|
|
5
|
+
"applyMaskOn": "change",
|
|
6
|
+
"mask": false,
|
|
7
|
+
"tableView": false,
|
|
8
|
+
"delimiter": false,
|
|
9
|
+
"requireDecimal": false,
|
|
10
|
+
"inputFormat": "plain",
|
|
11
|
+
"truncateMultipleSpaces": false,
|
|
12
|
+
"validateWhenHidden": false,
|
|
13
|
+
"key": "number",
|
|
14
|
+
"type": "number",
|
|
15
|
+
"input": true,
|
|
16
|
+
"defaultValue": "123.23"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: {
|
|
3
|
+
label: string;
|
|
4
|
+
applyMaskOn: string;
|
|
5
|
+
mask: boolean;
|
|
6
|
+
tableView: boolean;
|
|
7
|
+
delimiter: boolean;
|
|
8
|
+
requireDecimal: boolean;
|
|
9
|
+
inputFormat: string;
|
|
10
|
+
truncateMultipleSpaces: boolean;
|
|
11
|
+
key: string;
|
|
12
|
+
type: string;
|
|
13
|
+
input: boolean;
|
|
14
|
+
decimalSymbol: string;
|
|
15
|
+
thousandsSeparator: string;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
components: [
|
|
3
|
+
{
|
|
4
|
+
"label": "Number",
|
|
5
|
+
"applyMaskOn": "change",
|
|
6
|
+
"mask": false,
|
|
7
|
+
"tableView": false,
|
|
8
|
+
"delimiter": true,
|
|
9
|
+
"requireDecimal": false,
|
|
10
|
+
"inputFormat": "plain",
|
|
11
|
+
"truncateMultipleSpaces": false,
|
|
12
|
+
"key": "number",
|
|
13
|
+
"type": "number",
|
|
14
|
+
"input": true,
|
|
15
|
+
"decimalSymbol": ",",
|
|
16
|
+
"thousandsSeparator": "."
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
};
|
|
@@ -6,4 +6,6 @@ import comp5 from './comp5';
|
|
|
6
6
|
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
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 };
|
|
@@ -6,4 +6,6 @@ import comp5 from './comp5';
|
|
|
6
6
|
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
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 };
|
|
@@ -295,14 +295,15 @@ export default class RadioComponent extends ListComponent {
|
|
|
295
295
|
setItems(items) {
|
|
296
296
|
const listData = [];
|
|
297
297
|
items?.forEach((item, i) => {
|
|
298
|
+
const valueAtProperty = _.get(item, this.component.valueProperty);
|
|
298
299
|
this.loadedOptions[i] = {
|
|
299
|
-
value: this.component.valueProperty ?
|
|
300
|
-
label: this.component.valueProperty ? this.itemTemplate(item,
|
|
300
|
+
value: this.component.valueProperty ? valueAtProperty : item,
|
|
301
|
+
label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
|
|
301
302
|
};
|
|
302
|
-
listData.push(this.templateData[this.component.valueProperty ?
|
|
303
|
-
if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(
|
|
304
|
-
(!this.isRadio && _.isObject(
|
|
305
|
-
(!this.isRadio && _.isBoolean(
|
|
303
|
+
listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
|
|
304
|
+
if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(valueAtProperty) ||
|
|
305
|
+
(!this.isRadio && _.isObject(valueAtProperty)) ||
|
|
306
|
+
(!this.isRadio && _.isBoolean(valueAtProperty)))) {
|
|
306
307
|
this.loadedOptions[i].invalid = true;
|
|
307
308
|
}
|
|
308
309
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: {
|
|
3
|
+
label: string;
|
|
4
|
+
optionsLabelPosition: string;
|
|
5
|
+
tableView: boolean;
|
|
6
|
+
dataSrc: string;
|
|
7
|
+
values: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
shortcut: string;
|
|
11
|
+
}[];
|
|
12
|
+
valueProperty: string;
|
|
13
|
+
validateWhenHidden: boolean;
|
|
14
|
+
key: string;
|
|
15
|
+
type: string;
|
|
16
|
+
data: {
|
|
17
|
+
url: string;
|
|
18
|
+
headers: {
|
|
19
|
+
key: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
template: string;
|
|
24
|
+
authenticate: boolean;
|
|
25
|
+
input: boolean;
|
|
26
|
+
inputType: string;
|
|
27
|
+
}[];
|
|
28
|
+
}
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
components: [
|
|
3
|
+
{
|
|
4
|
+
"label": "Select Boxes",
|
|
5
|
+
"optionsLabelPosition": "right",
|
|
6
|
+
"tableView": false,
|
|
7
|
+
"dataSrc": "url",
|
|
8
|
+
"values": [
|
|
9
|
+
{
|
|
10
|
+
"label": "",
|
|
11
|
+
"value": "",
|
|
12
|
+
"shortcut": ""
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"valueProperty": "data.name",
|
|
16
|
+
"validateWhenHidden": false,
|
|
17
|
+
"key": "selectBoxes",
|
|
18
|
+
"type": "selectboxes",
|
|
19
|
+
"data": {
|
|
20
|
+
"url": "https://remote-dev.form.io/projectId/name/submission",
|
|
21
|
+
"headers": [
|
|
22
|
+
{
|
|
23
|
+
"key": "",
|
|
24
|
+
"value": ""
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"template": "<span>{{ item.data.name }}</span>",
|
|
29
|
+
"authenticate": true,
|
|
30
|
+
"input": true,
|
|
31
|
+
"inputType": "checkbox"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
};
|
|
@@ -9,4 +9,5 @@ import comp8 from './comp8';
|
|
|
9
9
|
import comp9 from './comp9';
|
|
10
10
|
import comp10 from './comp10';
|
|
11
11
|
import comp11 from './comp11';
|
|
12
|
-
|
|
12
|
+
import comp12 from './comp12';
|
|
13
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
|
|
@@ -9,4 +9,5 @@ import comp8 from './comp8';
|
|
|
9
9
|
import comp9 from './comp9';
|
|
10
10
|
import comp10 from './comp10';
|
|
11
11
|
import comp11 from './comp11';
|
|
12
|
-
|
|
12
|
+
import comp12 from './comp12';
|
|
13
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default class TimeComponent extends TextFieldComponent {
|
|
2
|
-
rawData:
|
|
2
|
+
rawData: any;
|
|
3
3
|
get dataFormat(): any;
|
|
4
4
|
get skipMaskValidation(): boolean;
|
|
5
5
|
isNotCompleteInput(value: any): any;
|
|
6
6
|
removeValue(index: any): void;
|
|
7
7
|
resetRawData(index: any): void;
|
|
8
8
|
setRawValue(value: any, index: any): void;
|
|
9
|
-
getRawValue(index: any):
|
|
9
|
+
getRawValue(index: any): any;
|
|
10
10
|
getValueAt(index: any): any;
|
|
11
11
|
setValueAt(index: any, value: any): void;
|
|
12
12
|
getStringAsValue(view: any): any;
|
|
@@ -31,7 +31,8 @@ export default class TimeComponent extends TextFieldComponent {
|
|
|
31
31
|
this.component.inputType = isEdgeBrowser && edgeVersion <= 18
|
|
32
32
|
? 'text'
|
|
33
33
|
: (this.component.inputType || 'time');
|
|
34
|
-
|
|
34
|
+
// If default value is given then the raw data needs to be set
|
|
35
|
+
this.rawData = this.component.multiple ? [] : this.getValueAsString(this.defaultValue) || this.emptyValue;
|
|
35
36
|
}
|
|
36
37
|
static get builderInfo() {
|
|
37
38
|
return {
|
|
@@ -62,7 +63,7 @@ export default class TimeComponent extends TextFieldComponent {
|
|
|
62
63
|
return value;
|
|
63
64
|
}
|
|
64
65
|
get validationValue() {
|
|
65
|
-
if (Array.isArray(this.rawData) && !this.rawData.length || !this.rawData) {
|
|
66
|
+
if ((Array.isArray(this.rawData) && !this.rawData.length) || !this.rawData) {
|
|
66
67
|
return this.dataValue;
|
|
67
68
|
}
|
|
68
69
|
return this.rawData;
|