@formio/js 5.0.0-rc.82 → 5.0.0-rc.83
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.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +5 -5
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +6 -6
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/WebformBuilder.js +4 -1
- package/lib/cjs/components/_classes/component/Component.js +0 -3
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +3 -3
- package/lib/cjs/components/day/Day.js +3 -1
- package/lib/mjs/WebformBuilder.js +4 -1
- package/lib/mjs/components/_classes/component/Component.js +0 -3
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +3 -3
- package/lib/mjs/components/day/Day.js +3 -1
- package/package.json +1 -1
| @@ -20,7 +20,7 @@ | |
| 20 20 |  | 
| 21 21 | 
             
            /*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
         | 
| 22 22 |  | 
| 23 | 
            -
            /*! formiojs v5.0.0-rc. | 
| 23 | 
            +
            /*! formiojs v5.0.0-rc.83 | https://unpkg.com/formiojs@5.0.0-rc.83/LICENSE.txt */
         | 
| 24 24 |  | 
| 25 25 | 
             
            /**
         | 
| 26 26 | 
             
             * @license
         | 
| @@ -913,8 +913,11 @@ class WebformBuilder extends Component_1.default { | |
| 913 913 | 
             
                        keyboardActionsEnabled = keyboardActionsEnabled === 'true';
         | 
| 914 914 | 
             
                    }
         | 
| 915 915 | 
             
                    this.keyboardActionsEnabled = keyboardActionsEnabled;
         | 
| 916 | 
            +
                    const isSubmitButton = (comp) => {
         | 
| 917 | 
            +
                        return (comp.type === 'button') && ((comp.action === 'submit') || !comp.action);
         | 
| 918 | 
            +
                    };
         | 
| 916 919 | 
             
                    const isShowSubmitButton = !this.options.noDefaultSubmitButton
         | 
| 917 | 
            -
                        && (!form.components.length || !form.components.find(comp => comp | 
| 920 | 
            +
                        && (!form.components.length || !form.components.find(comp => isSubmitButton(comp)));
         | 
| 918 921 | 
             
                    // Ensure there is at least a submit button.
         | 
| 919 922 | 
             
                    if (isShowSubmitButton) {
         | 
| 920 923 | 
             
                        form.components.push({
         | 
| @@ -2618,9 +2618,6 @@ class Component extends Element_1.default { | |
| 2618 2618 | 
             
                 * @returns {*} - The normalized value.
         | 
| 2619 2619 | 
             
                 */
         | 
| 2620 2620 | 
             
                normalizeValue(value) {
         | 
| 2621 | 
            -
                    if (this.component.multiple && !Array.isArray(value)) {
         | 
| 2622 | 
            -
                        value = value ? [value] : [];
         | 
| 2623 | 
            -
                    }
         | 
| 2624 2621 | 
             
                    return value;
         | 
| 2625 2622 | 
             
                }
         | 
| 2626 2623 | 
             
                /**
         | 
| @@ -34,12 +34,12 @@ class Multivalue extends Field_1.default { | |
| 34 34 | 
             
                    }
         | 
| 35 35 | 
             
                    else {
         | 
| 36 36 | 
             
                        if (Array.isArray(value) && !underlyingValueShouldBeArray) {
         | 
| 37 | 
            +
                            if (core_1.Utils.getModelType(this.component) === 'any') {
         | 
| 38 | 
            +
                                return super.normalizeValue(value, flags);
         | 
| 39 | 
            +
                            }
         | 
| 37 40 | 
             
                            if (this.component.storeas === 'string') {
         | 
| 38 41 | 
             
                                return super.normalizeValue(value.join(this.delimiter || ''), flags);
         | 
| 39 42 | 
             
                            }
         | 
| 40 | 
            -
                            if (this.component.type === 'hidden' && value.length > 1) {
         | 
| 41 | 
            -
                                return super.normalizeValue(value, flags);
         | 
| 42 | 
            -
                            }
         | 
| 43 43 | 
             
                            return super.normalizeValue(value[0] || emptyValue, flags);
         | 
| 44 44 | 
             
                        }
         | 
| 45 45 | 
             
                        else {
         | 
| @@ -420,7 +420,9 @@ class DayComponent extends Field_1.default { | |
| 420 420 | 
             
                        DAY = null;
         | 
| 421 421 | 
             
                    }
         | 
| 422 422 | 
             
                    if (!this.showMonth) {
         | 
| 423 | 
            -
                         | 
| 423 | 
            +
                        if (!lodash_1.default.isNull(DAY)) {
         | 
| 424 | 
            +
                            DAY = DAY === 0 ? 0 : DAY - 1;
         | 
| 425 | 
            +
                        }
         | 
| 424 426 | 
             
                        YEAR = YEAR - 1;
         | 
| 425 427 | 
             
                        MONTH = null;
         | 
| 426 428 | 
             
                    }
         | 
| @@ -897,8 +897,11 @@ export default class WebformBuilder extends Component { | |
| 897 897 | 
             
                        keyboardActionsEnabled = keyboardActionsEnabled === 'true';
         | 
| 898 898 | 
             
                    }
         | 
| 899 899 | 
             
                    this.keyboardActionsEnabled = keyboardActionsEnabled;
         | 
| 900 | 
            +
                    const isSubmitButton = (comp) => {
         | 
| 901 | 
            +
                        return (comp.type === 'button') && ((comp.action === 'submit') || !comp.action);
         | 
| 902 | 
            +
                    };
         | 
| 900 903 | 
             
                    const isShowSubmitButton = !this.options.noDefaultSubmitButton
         | 
| 901 | 
            -
                        && (!form.components.length || !form.components.find(comp => comp | 
| 904 | 
            +
                        && (!form.components.length || !form.components.find(comp => isSubmitButton(comp)));
         | 
| 902 905 | 
             
                    // Ensure there is at least a submit button.
         | 
| 903 906 | 
             
                    if (isShowSubmitButton) {
         | 
| 904 907 | 
             
                        form.components.push({
         | 
| @@ -2587,9 +2587,6 @@ export default class Component extends Element { | |
| 2587 2587 | 
             
                 * @returns {*} - The normalized value.
         | 
| 2588 2588 | 
             
                 */
         | 
| 2589 2589 | 
             
                normalizeValue(value) {
         | 
| 2590 | 
            -
                    if (this.component.multiple && !Array.isArray(value)) {
         | 
| 2591 | 
            -
                        value = value ? [value] : [];
         | 
| 2592 | 
            -
                    }
         | 
| 2593 2590 | 
             
                    return value;
         | 
| 2594 2591 | 
             
                }
         | 
| 2595 2592 | 
             
                /**
         | 
| @@ -29,12 +29,12 @@ export default class Multivalue extends Field { | |
| 29 29 | 
             
                    }
         | 
| 30 30 | 
             
                    else {
         | 
| 31 31 | 
             
                        if (Array.isArray(value) && !underlyingValueShouldBeArray) {
         | 
| 32 | 
            +
                            if (Utils.getModelType(this.component) === 'any') {
         | 
| 33 | 
            +
                                return super.normalizeValue(value, flags);
         | 
| 34 | 
            +
                            }
         | 
| 32 35 | 
             
                            if (this.component.storeas === 'string') {
         | 
| 33 36 | 
             
                                return super.normalizeValue(value.join(this.delimiter || ''), flags);
         | 
| 34 37 | 
             
                            }
         | 
| 35 | 
            -
                            if (this.component.type === 'hidden' && value.length > 1) {
         | 
| 36 | 
            -
                                return super.normalizeValue(value, flags);
         | 
| 37 | 
            -
                            }
         | 
| 38 38 | 
             
                            return super.normalizeValue(value[0] || emptyValue, flags);
         | 
| 39 39 | 
             
                        }
         | 
| 40 40 | 
             
                        else {
         |