@formio/js 5.0.0-dev.5672.279701a → 5.0.0-dev.5673.ae99c16
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 +63 -1
- 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 +648 -596
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -9
- package/dist/formio.full.css +0 -1
- package/dist/formio.full.js +635 -603
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -9
- package/dist/formio.js +4 -4
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +102 -40
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +5 -3
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Form.d.ts +2 -2
- package/lib/cjs/Form.js +11 -5
- package/lib/cjs/Formio.js +1 -0
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/PDFBuilder.js +2 -1
- package/lib/cjs/Webform.d.ts +1 -1
- package/lib/cjs/Webform.js +11 -6
- package/lib/cjs/WebformBuilder.js +13 -3
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +4 -3
- package/lib/cjs/components/_classes/component/Component.js +31 -8
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.js +86 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/_classes/input/Input.js +23 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +8 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +45 -25
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
- package/lib/cjs/components/address/Address.d.ts +6 -0
- package/lib/cjs/components/address/Address.js +11 -1
- 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 +11 -1
- package/lib/cjs/components/datagrid/DataGrid.js +59 -36
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +139 -0
- 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/comp11.d.ts +50 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.js +44 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +9 -1
- package/lib/cjs/components/datamap/DataMap.js +2 -2
- package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
- package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/cjs/components/datetime/fixtures/index.js +3 -1
- package/lib/cjs/components/day/Day.d.ts +3 -4
- package/lib/cjs/components/day/Day.js +31 -10
- 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 +16 -8
- 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/comp17.d.ts +80 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
- package/lib/cjs/components/file/File.d.ts +2 -2
- package/lib/cjs/components/file/File.js +13 -2
- package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/cjs/components/form/Form.d.ts +1 -1
- package/lib/cjs/components/form/Form.js +1 -1
- package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/form/fixtures/index.js +3 -1
- package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
- package/lib/cjs/components/html/HTML.js +1 -1
- package/lib/cjs/components/number/Number.d.ts +17 -2
- package/lib/cjs/components/number/Number.js +27 -7
- 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/comp8.d.ts +32 -0
- package/lib/cjs/components/number/fixtures/comp8.js +28 -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 +4 -1
- package/lib/cjs/components/number/fixtures/index.js +7 -1
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +1 -0
- package/lib/cjs/components/radio/Radio.d.ts +2 -18
- package/lib/cjs/components/radio/Radio.js +29 -27
- 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/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
- package/lib/cjs/components/select/Select.d.ts +38 -0
- package/lib/cjs/components/select/Select.js +14 -5
- package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/cjs/components/select/fixtures/comp25.js +66 -0
- 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 +3 -1
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
- package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/cjs/components/tags/Tags.js +3 -3
- package/lib/cjs/components/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.form.js +2 -2
- package/lib/cjs/components/time/Time.js +3 -7
- 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/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/cjs/providers/address/GoogleAddressProvider.js +23 -1
- package/lib/cjs/templates/Templates.js +1 -1
- package/lib/cjs/translations/en.d.ts +4 -0
- package/lib/cjs/translations/en.js +5 -1
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +2 -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 +2 -11
- package/lib/cjs/utils/utils.js +60 -24
- package/lib/cjs/widgets/CalendarWidget.js +24 -10
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Form.d.ts +2 -2
- package/lib/mjs/Form.js +11 -5
- package/lib/mjs/Formio.js +1 -0
- package/lib/mjs/PDF.js +1 -1
- package/lib/mjs/PDFBuilder.js +1 -1
- package/lib/mjs/Webform.d.ts +1 -1
- package/lib/mjs/Webform.js +15 -6
- package/lib/mjs/WebformBuilder.js +12 -3
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +4 -3
- package/lib/mjs/components/_classes/component/Component.js +17 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.js +84 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/_classes/input/Input.js +22 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +8 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +45 -25
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
- package/lib/mjs/components/address/Address.d.ts +6 -0
- package/lib/mjs/components/address/Address.js +14 -1
- 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 +11 -1
- package/lib/mjs/components/datagrid/DataGrid.js +58 -35
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +137 -0
- 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/comp11.d.ts +50 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.js +42 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +5 -1
- package/lib/mjs/components/datamap/DataMap.js +2 -2
- package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
- package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/mjs/components/datetime/fixtures/index.js +2 -1
- package/lib/mjs/components/day/Day.d.ts +3 -4
- package/lib/mjs/components/day/Day.js +30 -10
- 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 +16 -8
- 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/comp17.d.ts +80 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
- package/lib/mjs/components/file/File.d.ts +2 -2
- package/lib/mjs/components/file/File.js +13 -2
- package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/mjs/components/form/Form.d.ts +1 -1
- package/lib/mjs/components/form/Form.js +1 -1
- package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/form/fixtures/index.js +2 -1
- package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
- package/lib/mjs/components/html/HTML.js +1 -1
- package/lib/mjs/components/number/Number.d.ts +17 -2
- package/lib/mjs/components/number/Number.js +26 -6
- 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/comp8.d.ts +32 -0
- package/lib/mjs/components/number/fixtures/comp8.js +26 -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 +4 -1
- package/lib/mjs/components/number/fixtures/index.js +4 -1
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +1 -0
- package/lib/mjs/components/radio/Radio.d.ts +2 -18
- package/lib/mjs/components/radio/Radio.js +32 -30
- 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/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
- package/lib/mjs/components/select/Select.d.ts +38 -0
- package/lib/mjs/components/select/Select.js +17 -6
- package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/mjs/components/select/fixtures/comp25.js +64 -0
- 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 +3 -1
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
- package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/mjs/components/tags/Tags.js +3 -3
- package/lib/mjs/components/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.form.js +2 -2
- package/lib/mjs/components/time/Time.js +3 -13
- 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/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/mjs/providers/address/GoogleAddressProvider.js +22 -1
- package/lib/mjs/templates/Templates.js +1 -1
- package/lib/mjs/translations/en.d.ts +4 -0
- package/lib/mjs/translations/en.js +5 -1
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +1 -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 +2 -11
- package/lib/mjs/utils/utils.js +59 -13
- package/lib/mjs/widgets/CalendarWidget.js +24 -10
- package/package.json +5 -6
|
@@ -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
|
-
this.decimalSeparator = this.options.decimalSeparator = this.options.decimalSeparator
|
|
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,32 @@
|
|
|
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
|
+
disableOnInvalid?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
type: string;
|
|
18
|
+
label: string;
|
|
19
|
+
key: string;
|
|
20
|
+
disableOnInvalid: boolean;
|
|
21
|
+
input: boolean;
|
|
22
|
+
tableView: boolean;
|
|
23
|
+
applyMaskOn?: undefined;
|
|
24
|
+
mask?: undefined;
|
|
25
|
+
delimiter?: undefined;
|
|
26
|
+
requireDecimal?: undefined;
|
|
27
|
+
inputFormat?: undefined;
|
|
28
|
+
truncateMultipleSpaces?: undefined;
|
|
29
|
+
decimalSymbol?: undefined;
|
|
30
|
+
})[];
|
|
31
|
+
}
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
"key": "number",
|
|
15
|
+
"type": "number",
|
|
16
|
+
"input": true,
|
|
17
|
+
"decimalSymbol": "-"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "button",
|
|
21
|
+
"label": "Submit",
|
|
22
|
+
"key": "submit",
|
|
23
|
+
"disableOnInvalid": true,
|
|
24
|
+
"input": true,
|
|
25
|
+
"tableView": false
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -5,4 +5,7 @@ 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
|
+
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.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"));
|
|
@@ -18,3 +18,9 @@ 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;
|
|
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;
|
|
@@ -8,26 +8,10 @@ export default class RadioComponent extends ListComponent {
|
|
|
8
8
|
schema: any;
|
|
9
9
|
};
|
|
10
10
|
static get conditionOperatorsSettings(): {
|
|
11
|
-
valueComponent(classComp: any):
|
|
12
|
-
type: string;
|
|
13
|
-
dataSrc: string;
|
|
14
|
-
valueProperty: string;
|
|
15
|
-
dataType: any;
|
|
16
|
-
data: {
|
|
17
|
-
custom(): any;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
11
|
+
valueComponent(classComp: any): any;
|
|
20
12
|
};
|
|
21
13
|
static get serverConditionSettings(): {
|
|
22
|
-
valueComponent(classComp: any):
|
|
23
|
-
type: string;
|
|
24
|
-
dataSrc: string;
|
|
25
|
-
valueProperty: string;
|
|
26
|
-
dataType: any;
|
|
27
|
-
data: {
|
|
28
|
-
custom: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
14
|
+
valueComponent(classComp: any): any;
|
|
31
15
|
};
|
|
32
16
|
static savedValueTypes(schema: any): any[];
|
|
33
17
|
constructor(component: any, options: any, data: any);
|
|
@@ -33,31 +33,22 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
33
33
|
}
|
|
34
34
|
static get conditionOperatorsSettings() {
|
|
35
35
|
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';
|
|
37
|
+
return isValuesSrc
|
|
38
|
+
? {
|
|
39
|
+
type: 'select',
|
|
40
|
+
dataSrc: 'custom',
|
|
41
|
+
valueProperty: 'value',
|
|
42
|
+
dataType: classComp.dataType || '',
|
|
43
|
+
data: {
|
|
44
|
+
custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,
|
|
44
45
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
46
|
+
}
|
|
47
|
+
: Object.assign(Object.assign({}, classComp), { type: 'select' });
|
|
47
48
|
} });
|
|
48
49
|
}
|
|
49
50
|
static get serverConditionSettings() {
|
|
50
|
-
return
|
|
51
|
-
return {
|
|
52
|
-
type: 'select',
|
|
53
|
-
dataSrc: 'custom',
|
|
54
|
-
valueProperty: 'value',
|
|
55
|
-
dataType: classComp.dataType || '',
|
|
56
|
-
data: {
|
|
57
|
-
custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
} });
|
|
51
|
+
return RadioComponent.conditionOperatorsSettings;
|
|
61
52
|
}
|
|
62
53
|
static savedValueTypes(schema) {
|
|
63
54
|
const { boolean, string, number, object, array } = utils_1.componentValueTypes;
|
|
@@ -264,6 +255,16 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
264
255
|
if (method.toUpperCase() === 'GET') {
|
|
265
256
|
body = null;
|
|
266
257
|
}
|
|
258
|
+
const limit = this.component.limit || 100;
|
|
259
|
+
const skip = this.isScrollLoading ? this.selectOptions.length : 0;
|
|
260
|
+
// Allow for url interpolation.
|
|
261
|
+
url = this.sanitize(this.interpolate(url, {
|
|
262
|
+
formioBase: Formio_1.Formio.getBaseUrl(),
|
|
263
|
+
search,
|
|
264
|
+
limit,
|
|
265
|
+
skip,
|
|
266
|
+
page: Math.abs(Math.floor(skip / limit))
|
|
267
|
+
}), this.shouldSanitizeValue);
|
|
267
268
|
// Set ignoreCache if it is
|
|
268
269
|
options.ignoreCache = this.component.ignoreCache;
|
|
269
270
|
// Make the request.
|
|
@@ -295,14 +296,15 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
295
296
|
setItems(items) {
|
|
296
297
|
const listData = [];
|
|
297
298
|
items === null || items === void 0 ? void 0 : items.forEach((item, i) => {
|
|
299
|
+
const valueAtProperty = lodash_1.default.get(item, this.component.valueProperty);
|
|
298
300
|
this.loadedOptions[i] = {
|
|
299
|
-
value: this.component.valueProperty ?
|
|
300
|
-
label: this.component.valueProperty ? this.itemTemplate(item,
|
|
301
|
+
value: this.component.valueProperty ? valueAtProperty : item,
|
|
302
|
+
label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
|
|
301
303
|
};
|
|
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(
|
|
304
|
+
listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
|
|
305
|
+
if ((this.component.valueProperty || !this.isRadio) && (lodash_1.default.isUndefined(valueAtProperty) ||
|
|
306
|
+
(!this.isRadio && lodash_1.default.isObject(valueAtProperty)) ||
|
|
307
|
+
(!this.isRadio && lodash_1.default.isBoolean(valueAtProperty)))) {
|
|
306
308
|
this.loadedOptions[i].invalid = true;
|
|
307
309
|
}
|
|
308
310
|
});
|
|
@@ -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;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export default class ReCaptchaComponent extends Component {
|
|
2
2
|
static get builderInfo(): {};
|
|
3
3
|
static savedValueTypes(): never[];
|
|
4
|
+
static get conditionOperatorsSettings(): {
|
|
5
|
+
operators: string[];
|
|
6
|
+
};
|
|
7
|
+
static get serverConditionSettings(): {
|
|
8
|
+
operators: string[];
|
|
9
|
+
};
|
|
4
10
|
render(): string;
|
|
5
11
|
recaptchaResult: any;
|
|
6
12
|
createInput(): void;
|
|
@@ -31,6 +31,12 @@ class ReCaptchaComponent extends Component_1.default {
|
|
|
31
31
|
static savedValueTypes() {
|
|
32
32
|
return [];
|
|
33
33
|
}
|
|
34
|
+
static get conditionOperatorsSettings() {
|
|
35
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
|
|
36
|
+
}
|
|
37
|
+
static get serverConditionSettings() {
|
|
38
|
+
return ReCaptchaComponent.conditionOperatorsSettings;
|
|
39
|
+
}
|
|
34
40
|
render() {
|
|
35
41
|
this.recaptchaResult = null;
|
|
36
42
|
if (this.builderMode) {
|
|
@@ -9,9 +9,47 @@ export default class SelectComponent extends ListComponent {
|
|
|
9
9
|
};
|
|
10
10
|
static get serverConditionSettings(): {
|
|
11
11
|
valueComponent(classComp: any): any;
|
|
12
|
+
dataTypeOperators: {
|
|
13
|
+
number: string[];
|
|
14
|
+
};
|
|
15
|
+
dataTypeValueComponents: {
|
|
16
|
+
number: {
|
|
17
|
+
lessThan: () => {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
greaterThan: () => {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
lessThanOrEqual: () => {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
greaterThanOrEqual: () => {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
12
31
|
};
|
|
13
32
|
static get conditionOperatorsSettings(): {
|
|
14
33
|
valueComponent(classComp: any): any;
|
|
34
|
+
dataTypeOperators: {
|
|
35
|
+
number: string[];
|
|
36
|
+
};
|
|
37
|
+
dataTypeValueComponents: {
|
|
38
|
+
number: {
|
|
39
|
+
lessThan: () => {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
greaterThan: () => {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
lessThanOrEqual: () => {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
greaterThanOrEqual: () => {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
15
53
|
};
|
|
16
54
|
static savedValueTypes(schema: any): any[];
|
|
17
55
|
templateData: {} | undefined;
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
7
|
const Formio_1 = require("../../Formio");
|
|
8
8
|
const ListComponent_1 = __importDefault(require("../_classes/list/ListComponent"));
|
|
9
|
-
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
|
10
9
|
const Form_1 = __importDefault(require("../../Form"));
|
|
11
10
|
const utils_1 = require("../../utils/utils");
|
|
12
11
|
const ChoicesWrapper_1 = __importDefault(require("../../utils/ChoicesWrapper"));
|
|
@@ -63,6 +62,7 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
63
62
|
return SelectComponent.conditionOperatorsSettings;
|
|
64
63
|
}
|
|
65
64
|
static get conditionOperatorsSettings() {
|
|
65
|
+
const numberType = () => ({ type: 'number' });
|
|
66
66
|
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
|
|
67
67
|
const valueComp = Object.assign(Object.assign({}, classComp), { type: 'select' });
|
|
68
68
|
if ((0, utils_1.isSelectResourceWithObjectValue)(classComp)) {
|
|
@@ -77,6 +77,15 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
77
77
|
`;
|
|
78
78
|
}
|
|
79
79
|
return valueComp;
|
|
80
|
+
}, dataTypeOperators: {
|
|
81
|
+
number: ['lessThan', 'greaterThan', 'lessThanOrEqual', 'greaterThanOrEqual'],
|
|
82
|
+
}, dataTypeValueComponents: {
|
|
83
|
+
number: {
|
|
84
|
+
lessThan: numberType,
|
|
85
|
+
greaterThan: numberType,
|
|
86
|
+
lessThanOrEqual: numberType,
|
|
87
|
+
greaterThanOrEqual: numberType,
|
|
88
|
+
},
|
|
80
89
|
} });
|
|
81
90
|
}
|
|
82
91
|
static savedValueTypes(schema) {
|
|
@@ -527,13 +536,13 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
527
536
|
skip,
|
|
528
537
|
};
|
|
529
538
|
// Allow for url interpolation.
|
|
530
|
-
url = this.interpolate(url, {
|
|
539
|
+
url = this.sanitize(this.interpolate(url, {
|
|
531
540
|
formioBase: Formio_1.Formio.getBaseUrl(),
|
|
532
541
|
search,
|
|
533
542
|
limit,
|
|
534
543
|
skip,
|
|
535
544
|
page: Math.abs(Math.floor(skip / limit))
|
|
536
|
-
});
|
|
545
|
+
}), this.shouldSanitizeValue);
|
|
537
546
|
// Add search capability.
|
|
538
547
|
if (this.component.searchField && search) {
|
|
539
548
|
const searchValue = Array.isArray(search)
|
|
@@ -834,7 +843,7 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
834
843
|
this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
|
|
835
844
|
this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
|
|
836
845
|
}
|
|
837
|
-
|
|
846
|
+
this.addFocusBlurEvents(this.choices.input.element);
|
|
838
847
|
if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
|
|
839
848
|
this.scrollList = this.choices.choiceList.element;
|
|
840
849
|
this.addEventListener(this.scrollList, 'scroll', () => this.onScroll());
|
|
@@ -1558,8 +1567,8 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
1558
1567
|
super.detach();
|
|
1559
1568
|
}
|
|
1560
1569
|
focus() {
|
|
1570
|
+
super.focus.call(this);
|
|
1561
1571
|
if (this.focusableElement) {
|
|
1562
|
-
super.focus.call(this);
|
|
1563
1572
|
this.focusableElement.focus();
|
|
1564
1573
|
}
|
|
1565
1574
|
}
|