@formio/js 5.0.0-dev.5695.024ad9c → 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 +68 -124
- 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 +49 -29
- 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 +5 -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/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 +5 -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/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
|
@@ -5,4 +5,5 @@ import comp4 from './comp4';
|
|
|
5
5
|
import comp5 from './comp5';
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
|
-
|
|
8
|
+
import comp8 from './comp8';
|
|
9
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8 };
|
|
@@ -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.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
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"));
|
|
@@ -18,3 +18,5 @@ const comp6_1 = __importDefault(require("./comp6"));
|
|
|
18
18
|
exports.comp6 = comp6_1.default;
|
|
19
19
|
const comp7_1 = __importDefault(require("./comp7"));
|
|
20
20
|
exports.comp7 = comp7_1.default;
|
|
21
|
+
const comp8_1 = __importDefault(require("./comp8"));
|
|
22
|
+
exports.comp8 = comp8_1.default;
|
|
@@ -681,6 +681,11 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
681
681
|
}
|
|
682
682
|
},
|
|
683
683
|
}, this.component.saveRow || 'Save'));
|
|
684
|
+
this.emit('editGridOpenModal', {
|
|
685
|
+
component: this.component,
|
|
686
|
+
row: editRow,
|
|
687
|
+
instance: this,
|
|
688
|
+
});
|
|
684
689
|
return this.attachComponents(modalContent, components);
|
|
685
690
|
}
|
|
686
691
|
showDialog(rowIndex) {
|
|
@@ -738,6 +743,11 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
738
743
|
editRow.data = dataSnapshot;
|
|
739
744
|
this.restoreRowContext(editRow);
|
|
740
745
|
}
|
|
746
|
+
this.emit('editGridEditRow', {
|
|
747
|
+
component: this.component,
|
|
748
|
+
row: editRow,
|
|
749
|
+
instance: this,
|
|
750
|
+
});
|
|
741
751
|
if (this.component.modal) {
|
|
742
752
|
return this.addRowModal(rowIndex);
|
|
743
753
|
}
|
|
@@ -1091,7 +1101,8 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1091
1101
|
return false;
|
|
1092
1102
|
}
|
|
1093
1103
|
else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {
|
|
1094
|
-
this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1104
|
+
this._errors = this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1105
|
+
errors.push(...this._errors);
|
|
1095
1106
|
return false;
|
|
1096
1107
|
}
|
|
1097
1108
|
const message = this.invalid || this.invalidMessage(data, dirty, false, row);
|
|
@@ -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,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
_id: '669e1c88a40e327e67e7d1c5',
|
|
5
|
+
title: 'editGrid test',
|
|
6
|
+
name: 'editGridTest',
|
|
7
|
+
path: 'editgridtest',
|
|
8
|
+
type: 'form',
|
|
9
|
+
display: 'form',
|
|
10
|
+
owner: '637b2e6b48c1227e60b1f910',
|
|
11
|
+
components: [
|
|
12
|
+
{
|
|
13
|
+
label: 'Edit Grid',
|
|
14
|
+
tableView: false,
|
|
15
|
+
modal: false,
|
|
16
|
+
validateWhenHidden: false,
|
|
17
|
+
rowDrafts: false,
|
|
18
|
+
key: 'editGrid',
|
|
19
|
+
type: 'editgrid',
|
|
20
|
+
displayAsTable: false,
|
|
21
|
+
input: true,
|
|
22
|
+
components: [
|
|
23
|
+
{
|
|
24
|
+
label: 'Text Field',
|
|
25
|
+
applyMaskOn: 'change',
|
|
26
|
+
tableView: true,
|
|
27
|
+
validateWhenHidden: false,
|
|
28
|
+
key: 'textField',
|
|
29
|
+
type: 'textfield',
|
|
30
|
+
input: true,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'button',
|
|
36
|
+
label: 'Submit',
|
|
37
|
+
key: 'submit',
|
|
38
|
+
disableOnInvalid: true,
|
|
39
|
+
input: true,
|
|
40
|
+
tableView: false,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
pdfComponents: [],
|
|
44
|
+
settings: {},
|
|
45
|
+
properties: {},
|
|
46
|
+
project: '669e1c68a40e327e67e7cedd',
|
|
47
|
+
controller: '',
|
|
48
|
+
revisions: '',
|
|
49
|
+
submissionRevisions: '',
|
|
50
|
+
_vid: 0,
|
|
51
|
+
created: '2024-07-22T08:47:04.399Z',
|
|
52
|
+
modified: '2024-07-22T10:04:23.474Z',
|
|
53
|
+
machineName: 'authoring-qzdhayddccjauyr:editGridTest',
|
|
54
|
+
};
|
|
@@ -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,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
type: 'form',
|
|
5
|
+
display: 'wizard',
|
|
6
|
+
components: [
|
|
7
|
+
{
|
|
8
|
+
title: 'Page 1',
|
|
9
|
+
breadcrumbClickable: true,
|
|
10
|
+
buttonSettings: {
|
|
11
|
+
previous: true,
|
|
12
|
+
cancel: true,
|
|
13
|
+
next: true
|
|
14
|
+
},
|
|
15
|
+
collapsible: false,
|
|
16
|
+
tableView: false,
|
|
17
|
+
key: 'page3',
|
|
18
|
+
type: 'panel',
|
|
19
|
+
label: 'Page 2',
|
|
20
|
+
input: false,
|
|
21
|
+
components: [
|
|
22
|
+
{
|
|
23
|
+
label: 'Edit Grid',
|
|
24
|
+
tableView: true,
|
|
25
|
+
rowDrafts: false,
|
|
26
|
+
key: 'editGrid',
|
|
27
|
+
type: 'editgrid',
|
|
28
|
+
input: true,
|
|
29
|
+
components: [
|
|
30
|
+
{
|
|
31
|
+
label: 'Text Field',
|
|
32
|
+
tableView: true,
|
|
33
|
+
key: 'textField',
|
|
34
|
+
type: 'textfield',
|
|
35
|
+
input: true,
|
|
36
|
+
alwaysEnabled: false
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
alwaysEnabled: false
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
alwaysEnabled: false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: 'Page 2',
|
|
46
|
+
breadcrumbClickable: true,
|
|
47
|
+
buttonSettings: {
|
|
48
|
+
previous: true,
|
|
49
|
+
cancel: true,
|
|
50
|
+
next: true
|
|
51
|
+
},
|
|
52
|
+
collapsible: false,
|
|
53
|
+
tableView: false,
|
|
54
|
+
key: 'page2',
|
|
55
|
+
type: 'panel',
|
|
56
|
+
label: 'Page 1',
|
|
57
|
+
input: false,
|
|
58
|
+
alwaysEnabled: false,
|
|
59
|
+
components: []
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: 'Submit',
|
|
63
|
+
showValidations: false,
|
|
64
|
+
alwaysEnabled: false,
|
|
65
|
+
tableView: false,
|
|
66
|
+
key: 'submit',
|
|
67
|
+
type: 'button',
|
|
68
|
+
input: true
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
};
|
|
@@ -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 };
|
|
@@ -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.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp16 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = 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"));
|
|
@@ -34,9 +34,13 @@ const comp14_1 = __importDefault(require("./comp14"));
|
|
|
34
34
|
exports.comp14 = comp14_1.default;
|
|
35
35
|
const comp15_1 = __importDefault(require("./comp15"));
|
|
36
36
|
exports.comp15 = comp15_1.default;
|
|
37
|
+
const comp16_1 = __importDefault(require("./comp16"));
|
|
38
|
+
exports.comp16 = comp16_1.default;
|
|
37
39
|
const comp_with_conditions_and_openWhenEmpty_1 = __importDefault(require("./comp-with-conditions-and-openWhenEmpty"));
|
|
38
40
|
exports.withOpenWhenEmptyAndConditions = comp_with_conditions_and_openWhenEmpty_1.default;
|
|
39
41
|
const comp_openWhenEmpty_1 = __importDefault(require("./comp-openWhenEmpty"));
|
|
40
42
|
exports.compOpenWhenEmpty = comp_openWhenEmpty_1.default;
|
|
41
43
|
const comp_with_custom_default_value_1 = __importDefault(require("./comp-with-custom-default-value"));
|
|
42
44
|
exports.compWithCustomDefaultValue = comp_with_custom_default_value_1.default;
|
|
45
|
+
const comp_test_events_1 = __importDefault(require("./comp-test-events"));
|
|
46
|
+
exports.compTestEvents = comp_test_events_1.default;
|
|
@@ -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;
|
|
@@ -45,19 +45,19 @@ class NumberComponent extends Input_1.default {
|
|
|
45
45
|
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.number];
|
|
46
46
|
}
|
|
47
47
|
constructor(...args) {
|
|
48
|
-
var _a, _b;
|
|
48
|
+
var _a, _b, _c;
|
|
49
49
|
super(...args);
|
|
50
50
|
const separators = (0, utils_1.getNumberSeparators)(this.options.language || navigator.language);
|
|
51
51
|
this.decimalSeparator = this.options.decimalSeparator = this.component.decimalSymbol || this.options.decimalSeparator
|
|
52
52
|
|| ((_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.decimalSeparator)
|
|
53
53
|
|| separators.decimalSeparator;
|
|
54
54
|
if (this.component.delimiter) {
|
|
55
|
-
|
|
56
|
-
console.warn("Property 'thousandsSeparator' is deprecated. Please use i18n to specify delimiter.");
|
|
57
|
-
}
|
|
58
|
-
this.delimiter = ((_b = this.options.properties) === null || _b === void 0 ? void 0 : _b.thousandsSeparator) || this.options.thousandsSeparator || separators.delimiter;
|
|
55
|
+
this.delimiter = this.component.thousandsSeparator || ((_b = this.options.properties) === null || _b === void 0 ? void 0 : _b.thousandsSeparator) || this.options.thousandsSeparator || separators.delimiter;
|
|
59
56
|
}
|
|
60
57
|
else {
|
|
58
|
+
if (this.component.thousandsSeparator || ((_c = this.options.properties) === null || _c === void 0 ? void 0 : _c.thousandsSeparator) || this.options.thousandsSeparator) {
|
|
59
|
+
console.warn('In order for thousands separator to work properly, you must set the delimiter to true in the component json');
|
|
60
|
+
}
|
|
61
61
|
this.delimiter = '';
|
|
62
62
|
}
|
|
63
63
|
const requireDecimal = lodash_1.default.get(this.component, 'requireDecimal', false);
|
|
@@ -79,7 +79,7 @@ class NumberComponent extends Input_1.default {
|
|
|
79
79
|
prefix: '',
|
|
80
80
|
suffix: '',
|
|
81
81
|
requireDecimal: lodash_1.default.get(this.component, 'requireDecimal', false),
|
|
82
|
-
thousandsSeparatorSymbol:
|
|
82
|
+
thousandsSeparatorSymbol: this.delimiter || '',
|
|
83
83
|
decimalSymbol: lodash_1.default.get(this.component, 'decimalSymbol', this.decimalSeparator),
|
|
84
84
|
decimalLimit: lodash_1.default.get(this.component, 'decimalLimit', this.decimalLimit),
|
|
85
85
|
allowNegative: lodash_1.default.get(this.component, 'allowNegative', true),
|
|
@@ -91,6 +91,11 @@ class NumberComponent extends Input_1.default {
|
|
|
91
91
|
}
|
|
92
92
|
get defaultValue() {
|
|
93
93
|
let defaultValue = super.defaultValue;
|
|
94
|
+
if (typeof defaultValue === 'string') {
|
|
95
|
+
// Default value may be a string or have custom thousands separators or decimal symbols, so we need to call
|
|
96
|
+
// parseNumber on it
|
|
97
|
+
defaultValue = this.parseNumber(defaultValue);
|
|
98
|
+
}
|
|
94
99
|
if (!defaultValue && this.component.defaultValue === 0) {
|
|
95
100
|
defaultValue = this.component.defaultValue;
|
|
96
101
|
}
|
|
@@ -102,6 +107,12 @@ class NumberComponent extends Input_1.default {
|
|
|
102
107
|
isDecimalAllowed() {
|
|
103
108
|
return lodash_1.default.get(this.component, 'allowDecimal', !(this.component.validate && this.component.validate.integer));
|
|
104
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
|
|
112
|
+
* be processed by either parseInt or parseFloat
|
|
113
|
+
* @param {string} value the value to be parsed
|
|
114
|
+
* @returns {number} a parsed number
|
|
115
|
+
*/
|
|
105
116
|
parseNumber(value) {
|
|
106
117
|
// Remove delimiters and convert decimal separator to dot.
|
|
107
118
|
value = value.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
|
@@ -146,6 +157,15 @@ class NumberComponent extends Input_1.default {
|
|
|
146
157
|
setValueAt(index, value, flags = {}) {
|
|
147
158
|
return super.setValueAt(index, this.formatValue(this.parseValue(value)), flags);
|
|
148
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Converts a string to a floating point number, formats the number based on the parsed float function
|
|
162
|
+
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
|
|
163
|
+
* formatted number back as a string
|
|
164
|
+
* Example Input: "123.456,22"
|
|
165
|
+
* Example Output: "123456,22"
|
|
166
|
+
* @param {string | number} input the numeric string to parse
|
|
167
|
+
* @returns {string | null} a parsed string
|
|
168
|
+
*/
|
|
149
169
|
parseValue(input) {
|
|
150
170
|
if (typeof input === 'string') {
|
|
151
171
|
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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
"label": "Number",
|
|
7
|
+
"applyMaskOn": "change",
|
|
8
|
+
"mask": false,
|
|
9
|
+
"tableView": false,
|
|
10
|
+
"delimiter": false,
|
|
11
|
+
"requireDecimal": false,
|
|
12
|
+
"inputFormat": "plain",
|
|
13
|
+
"truncateMultipleSpaces": false,
|
|
14
|
+
"validateWhenHidden": false,
|
|
15
|
+
"key": "number",
|
|
16
|
+
"type": "number",
|
|
17
|
+
"input": true,
|
|
18
|
+
"defaultValue": "123.23"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
@@ -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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
"label": "Number",
|
|
7
|
+
"applyMaskOn": "change",
|
|
8
|
+
"mask": false,
|
|
9
|
+
"tableView": false,
|
|
10
|
+
"delimiter": true,
|
|
11
|
+
"requireDecimal": false,
|
|
12
|
+
"inputFormat": "plain",
|
|
13
|
+
"truncateMultipleSpaces": false,
|
|
14
|
+
"key": "number",
|
|
15
|
+
"type": "number",
|
|
16
|
+
"input": true,
|
|
17
|
+
"decimalSymbol": ",",
|
|
18
|
+
"thousandsSeparator": "."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
@@ -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 };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
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"));
|
|
@@ -20,3 +20,7 @@ const comp7_1 = __importDefault(require("./comp7"));
|
|
|
20
20
|
exports.comp7 = comp7_1.default;
|
|
21
21
|
const comp8_1 = __importDefault(require("./comp8"));
|
|
22
22
|
exports.comp8 = comp8_1.default;
|
|
23
|
+
const comp9_1 = __importDefault(require("./comp9"));
|
|
24
|
+
exports.comp9 = comp9_1.default;
|
|
25
|
+
const comp10_1 = __importDefault(require("./comp10"));
|
|
26
|
+
exports.comp10 = comp10_1.default;
|
|
@@ -295,14 +295,15 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
295
295
|
setItems(items) {
|
|
296
296
|
const listData = [];
|
|
297
297
|
items === null || items === void 0 ? void 0 : items.forEach((item, i) => {
|
|
298
|
+
const valueAtProperty = lodash_1.default.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) && (lodash_1.default.isUndefined(
|
|
304
|
-
(!this.isRadio && lodash_1.default.isObject(
|
|
305
|
-
(!this.isRadio && lodash_1.default.isBoolean(
|
|
303
|
+
listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
|
|
304
|
+
if ((this.component.valueProperty || !this.isRadio) && (lodash_1.default.isUndefined(valueAtProperty) ||
|
|
305
|
+
(!this.isRadio && lodash_1.default.isObject(valueAtProperty)) ||
|
|
306
|
+
(!this.isRadio && lodash_1.default.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,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
"label": "Select Boxes",
|
|
7
|
+
"optionsLabelPosition": "right",
|
|
8
|
+
"tableView": false,
|
|
9
|
+
"dataSrc": "url",
|
|
10
|
+
"values": [
|
|
11
|
+
{
|
|
12
|
+
"label": "",
|
|
13
|
+
"value": "",
|
|
14
|
+
"shortcut": ""
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"valueProperty": "data.name",
|
|
18
|
+
"validateWhenHidden": false,
|
|
19
|
+
"key": "selectBoxes",
|
|
20
|
+
"type": "selectboxes",
|
|
21
|
+
"data": {
|
|
22
|
+
"url": "https://remote-dev.form.io/projectId/name/submission",
|
|
23
|
+
"headers": [
|
|
24
|
+
{
|
|
25
|
+
"key": "",
|
|
26
|
+
"value": ""
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"template": "<span>{{ item.data.name }}</span>",
|
|
31
|
+
"authenticate": true,
|
|
32
|
+
"input": true,
|
|
33
|
+
"inputType": "checkbox"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
@@ -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 };
|
|
@@ -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.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.comp12 = 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"));
|
|
@@ -26,3 +26,5 @@ const comp10_1 = __importDefault(require("./comp10"));
|
|
|
26
26
|
exports.comp10 = comp10_1.default;
|
|
27
27
|
const comp11_1 = __importDefault(require("./comp11"));
|
|
28
28
|
exports.comp11 = comp11_1.default;
|
|
29
|
+
const comp12_1 = __importDefault(require("./comp12"));
|
|
30
|
+
exports.comp12 = comp12_1.default;
|