@formio/js 5.0.0-dev.5707.d029d4d → 5.0.0-dev.5708.6c19568
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/dist/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/currency/Currency.d.ts +0 -1
- package/lib/cjs/components/editgrid/EditGrid.js +2 -1
- 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 +2 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/cjs/components/number/Number.d.ts +1 -10
- package/lib/cjs/components/number/Number.js +6 -15
- package/lib/cjs/components/number/fixtures/index.d.ts +1 -2
- package/lib/cjs/components/number/fixtures/index.js +1 -3
- package/lib/mjs/components/currency/Currency.d.ts +0 -1
- package/lib/mjs/components/editgrid/EditGrid.js +2 -1
- 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 +2 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +2 -1
- package/lib/mjs/components/number/Number.d.ts +1 -10
- package/lib/mjs/components/number/Number.js +5 -14
- package/lib/mjs/components/number/fixtures/index.d.ts +1 -2
- package/lib/mjs/components/number/fixtures/index.js +1 -2
- package/package.json +1 -1
- package/lib/cjs/components/number/fixtures/comp9.d.ts +0 -18
- package/lib/cjs/components/number/fixtures/comp9.js +0 -21
- package/lib/mjs/components/number/fixtures/comp9.d.ts +0 -18
- package/lib/mjs/components/number/fixtures/comp9.js +0 -19
|
@@ -2,7 +2,6 @@ export default class CurrencyComponent extends NumberComponent {
|
|
|
2
2
|
constructor(component: any, options: any, data: any);
|
|
3
3
|
currencyPrefix: any;
|
|
4
4
|
currencySuffix: any;
|
|
5
|
-
parseValue(value: any): string | null;
|
|
6
5
|
addZerosAndFormatValue(value: any): any;
|
|
7
6
|
stripPrefixSuffix(value: any): any;
|
|
8
7
|
}
|
|
@@ -1101,7 +1101,8 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1101
1101
|
return false;
|
|
1102
1102
|
}
|
|
1103
1103
|
else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {
|
|
1104
|
-
this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1104
|
+
this._errors = this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1105
|
+
errors.push(...this._errors);
|
|
1105
1106
|
return false;
|
|
1106
1107
|
}
|
|
1107
1108
|
const message = this.invalid || this.invalidMessage(data, dirty, false, row);
|
|
@@ -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,8 +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';
|
|
20
|
-
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
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.compTestEvents = 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,6 +34,8 @@ 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"));
|
|
@@ -31,16 +31,7 @@ export default class NumberComponent extends Input {
|
|
|
31
31
|
setInputMask(input: any): void;
|
|
32
32
|
getValueAt(index: any): number | null;
|
|
33
33
|
setValueAt(index: any, value: any, flags?: {}): void;
|
|
34
|
-
|
|
35
|
-
* Converts a string to a floating point number, formats the number based on the parsed float function
|
|
36
|
-
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
|
|
37
|
-
* formatted number back as a string
|
|
38
|
-
* Example Input: "123.456,22"
|
|
39
|
-
* Example Output: "123456,22"
|
|
40
|
-
* @param {string | number} input the numeric string to parse
|
|
41
|
-
* @returns {string | null} a parsed string
|
|
42
|
-
*/
|
|
43
|
-
parseValue(input: string | number): string | null;
|
|
34
|
+
parseValue(input: any): number;
|
|
44
35
|
focus(): void;
|
|
45
36
|
getMaskedValue(value: any): any;
|
|
46
37
|
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;
|
|
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
|
-
|
|
55
|
+
if (this.options.hasOwnProperty('thousandsSeparator')) {
|
|
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;
|
|
56
59
|
}
|
|
57
60
|
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: this.
|
|
82
|
+
thousandsSeparatorSymbol: lodash_1.default.get(this.component, 'thousandsSeparator', 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),
|
|
@@ -146,15 +146,6 @@ class NumberComponent extends Input_1.default {
|
|
|
146
146
|
setValueAt(index, value, flags = {}) {
|
|
147
147
|
return super.setValueAt(index, this.formatValue(this.parseValue(value)), flags);
|
|
148
148
|
}
|
|
149
|
-
/**
|
|
150
|
-
* Converts a string to a floating point number, formats the number based on the parsed float function
|
|
151
|
-
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
|
|
152
|
-
* formatted number back as a string
|
|
153
|
-
* Example Input: "123.456,22"
|
|
154
|
-
* Example Output: "123456,22"
|
|
155
|
-
* @param {string | number} input the numeric string to parse
|
|
156
|
-
* @returns {string | null} a parsed string
|
|
157
|
-
*/
|
|
158
149
|
parseValue(input) {
|
|
159
150
|
if (typeof input === 'string') {
|
|
160
151
|
input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
|
@@ -6,5 +6,4 @@ import comp5 from './comp5';
|
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
|
-
|
|
10
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9 };
|
|
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.
|
|
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"));
|
|
@@ -20,5 +20,3 @@ 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;
|
|
@@ -2,7 +2,6 @@ export default class CurrencyComponent extends NumberComponent {
|
|
|
2
2
|
constructor(component: any, options: any, data: any);
|
|
3
3
|
currencyPrefix: any;
|
|
4
4
|
currencySuffix: any;
|
|
5
|
-
parseValue(value: any): string | null;
|
|
6
5
|
addZerosAndFormatValue(value: any): any;
|
|
7
6
|
stripPrefixSuffix(value: any): any;
|
|
8
7
|
}
|
|
@@ -1089,7 +1089,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1089
1089
|
return false;
|
|
1090
1090
|
}
|
|
1091
1091
|
else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {
|
|
1092
|
-
this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1092
|
+
this._errors = this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
|
|
1093
|
+
errors.push(...this._errors);
|
|
1093
1094
|
return false;
|
|
1094
1095
|
}
|
|
1095
1096
|
const message = this.invalid || this.invalidMessage(data, dirty, false, row);
|
|
@@ -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,8 +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';
|
|
20
|
-
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
21
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -13,8 +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';
|
|
20
|
-
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
21
|
+
export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -31,16 +31,7 @@ export default class NumberComponent extends Input {
|
|
|
31
31
|
setInputMask(input: any): void;
|
|
32
32
|
getValueAt(index: any): number | null;
|
|
33
33
|
setValueAt(index: any, value: any, flags?: {}): void;
|
|
34
|
-
|
|
35
|
-
* Converts a string to a floating point number, formats the number based on the parsed float function
|
|
36
|
-
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
|
|
37
|
-
* formatted number back as a string
|
|
38
|
-
* Example Input: "123.456,22"
|
|
39
|
-
* Example Output: "123456,22"
|
|
40
|
-
* @param {string | number} input the numeric string to parse
|
|
41
|
-
* @returns {string | null} a parsed string
|
|
42
|
-
*/
|
|
43
|
-
parseValue(input: string | number): string | null;
|
|
34
|
+
parseValue(input: any): number;
|
|
44
35
|
focus(): void;
|
|
45
36
|
getMaskedValue(value: any): any;
|
|
46
37
|
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
|
-
|
|
53
|
+
if (this.options.hasOwnProperty('thousandsSeparator')) {
|
|
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;
|
|
54
57
|
}
|
|
55
58
|
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: this.
|
|
80
|
+
thousandsSeparatorSymbol: _.get(this.component, 'thousandsSeparator', 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),
|
|
@@ -144,15 +144,6 @@ export default class NumberComponent extends Input {
|
|
|
144
144
|
setValueAt(index, value, flags = {}) {
|
|
145
145
|
return super.setValueAt(index, this.formatValue(this.parseValue(value)), flags);
|
|
146
146
|
}
|
|
147
|
-
/**
|
|
148
|
-
* Converts a string to a floating point number, formats the number based on the parsed float function
|
|
149
|
-
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) and then returns the
|
|
150
|
-
* formatted number back as a string
|
|
151
|
-
* Example Input: "123.456,22"
|
|
152
|
-
* Example Output: "123456,22"
|
|
153
|
-
* @param {string | number} input the numeric string to parse
|
|
154
|
-
* @returns {string | null} a parsed string
|
|
155
|
-
*/
|
|
156
147
|
parseValue(input) {
|
|
157
148
|
if (typeof input === 'string') {
|
|
158
149
|
input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
|
|
@@ -6,5 +6,4 @@ import comp5 from './comp5';
|
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
|
-
|
|
10
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9 };
|
|
9
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8 };
|
|
@@ -6,5 +6,4 @@ import comp5 from './comp5';
|
|
|
6
6
|
import comp6 from './comp6';
|
|
7
7
|
import comp7 from './comp7';
|
|
8
8
|
import comp8 from './comp8';
|
|
9
|
-
|
|
10
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9 };
|
|
9
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8 };
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
};
|