@formio/js 5.1.0-dev.6230.da74478 → 5.1.0-dev.6231.bbaf317
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 +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Wizard.js +1 -5
- package/lib/cjs/components/Components.js +2 -1
- package/lib/cjs/utils/formUtils.d.ts +6 -0
- package/lib/cjs/utils/formUtils.js +11 -1
- package/lib/cjs/utils/index.d.ts +2 -0
- package/lib/mjs/Wizard.js +1 -5
- package/lib/mjs/components/Components.js +2 -1
- package/lib/mjs/utils/formUtils.d.ts +6 -0
- package/lib/mjs/utils/formUtils.js +10 -1
- package/lib/mjs/utils/index.d.ts +2 -0
- package/package.json +1 -1
package/lib/cjs/Wizard.js
CHANGED
@@ -879,11 +879,7 @@ class Wizard extends Webform_1.default {
|
|
879
879
|
var _a;
|
880
880
|
super.onChange(flags, changed, modified, changes);
|
881
881
|
// The onChange loop doesn't need all components for wizards
|
882
|
-
const errors =
|
883
|
-
? []
|
884
|
-
: this.submitted
|
885
|
-
? this.validate(this.localData, { dirty: true })
|
886
|
-
: this.validateCurrentPage();
|
882
|
+
const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
|
887
883
|
if (this.alert) {
|
888
884
|
this.showErrors(errors, true, true);
|
889
885
|
}
|
@@ -7,6 +7,7 @@ const Component_1 = __importDefault(require("./_classes/component/Component"));
|
|
7
7
|
const utils_1 = __importDefault(require("./_classes/component/editForm/utils"));
|
8
8
|
const Component_form_1 = __importDefault(require("./_classes/component/Component.form"));
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
10
|
+
const utils_2 = require("../utils");
|
10
11
|
class Components {
|
11
12
|
static set EditFormUtils(value) {
|
12
13
|
Components._editFormUtils = value;
|
@@ -72,7 +73,7 @@ class Components {
|
|
72
73
|
else {
|
73
74
|
comp = new Component_1.default(component, options, data);
|
74
75
|
}
|
75
|
-
if (comp.path) {
|
76
|
+
if (comp.path && (0, utils_2.isDataComponent)(comp.component)) {
|
76
77
|
comp.componentsMap[comp.path] = comp;
|
77
78
|
}
|
78
79
|
// Reset the componentMatches on the root element if any new component is created.
|
@@ -55,4 +55,10 @@ export const isComponentDataEmpty: typeof Utils.isComponentDataEmpty;
|
|
55
55
|
export const isSelectResourceWithObjectValue: typeof Utils.isSelectResourceWithObjectValue;
|
56
56
|
export const compareSelectResourceWithObjectTypeValues: typeof Utils.compareSelectResourceWithObjectTypeValues;
|
57
57
|
export const getItemTemplateKeys: typeof Utils.getItemTemplateKeys;
|
58
|
+
/**
|
59
|
+
* Checks if the component is expected to have data in submission object.
|
60
|
+
* @param {import('@formio/core').Component} component - The component to check.
|
61
|
+
* @returns {boolean} - TRUE if the component is a data component.
|
62
|
+
*/
|
63
|
+
export function isDataComponent(component: import('@formio/core').Component): boolean;
|
58
64
|
import { Utils } from '@formio/core';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getItemTemplateKeys = exports.compareSelectResourceWithObjectTypeValues = exports.isSelectResourceWithObjectValue = exports.isComponentDataEmpty = exports.getEmptyValue = exports.findComponent = exports.applyFormChanges = exports.generateFormChange = exports.getStrings = exports.getValue = exports.escapeRegExCharacters = exports.formatAsCurrency = exports.parseFloatExt = exports.hasCondition = exports.removeComponent = exports.searchComponents = exports.getComponent = exports.matchComponent = exports.isLayoutComponent = exports.getComponentActualValue = exports.getComponentData = exports.eachComponentAsync = exports.eachComponent = exports.componentInfo = exports.getContextualRowData = exports.getContextualRowPath = exports.getComponentKey = exports.eachComponentData = exports.eachComponentDataAsync = exports.findComponents = exports.getComponentValue = exports.getComponentFromPath = exports.getBestMatch = exports.componentMatches = exports.getComponentPaths = exports.componentPath = exports.isComponentNestedDataType = exports.resetComponentScope = exports.setComponentScope = exports.getComponentPath = exports.getModelType = exports.MODEL_TYPES_OF_KNOWN_COMPONENTS = exports.uniqueName = exports.guid = exports.flattenComponents = void 0;
|
3
|
+
exports.isDataComponent = exports.getItemTemplateKeys = exports.compareSelectResourceWithObjectTypeValues = exports.isSelectResourceWithObjectValue = exports.isComponentDataEmpty = exports.getEmptyValue = exports.findComponent = exports.applyFormChanges = exports.generateFormChange = exports.getStrings = exports.getValue = exports.escapeRegExCharacters = exports.formatAsCurrency = exports.parseFloatExt = exports.hasCondition = exports.removeComponent = exports.searchComponents = exports.getComponent = exports.matchComponent = exports.isLayoutComponent = exports.getComponentActualValue = exports.getComponentData = exports.eachComponentAsync = exports.eachComponent = exports.componentInfo = exports.getContextualRowData = exports.getContextualRowPath = exports.getComponentKey = exports.eachComponentData = exports.eachComponentDataAsync = exports.findComponents = exports.getComponentValue = exports.getComponentFromPath = exports.getBestMatch = exports.componentMatches = exports.getComponentPaths = exports.componentPath = exports.isComponentNestedDataType = exports.resetComponentScope = exports.setComponentScope = exports.getComponentPath = exports.getModelType = exports.MODEL_TYPES_OF_KNOWN_COMPONENTS = exports.uniqueName = exports.guid = exports.flattenComponents = void 0;
|
4
4
|
const core_1 = require("@formio/core");
|
5
5
|
const { flattenComponents, guid, uniqueName, MODEL_TYPES_OF_KNOWN_COMPONENTS, getModelType, getComponentPath, setComponentScope, resetComponentScope, isComponentNestedDataType, componentPath, getComponentPaths, componentMatches, getBestMatch, getComponentFromPath, getComponentValue, findComponents, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty, isSelectResourceWithObjectValue, compareSelectResourceWithObjectTypeValues, getItemTemplateKeys } = core_1.Utils;
|
6
6
|
exports.flattenComponents = flattenComponents;
|
@@ -48,3 +48,13 @@ exports.isComponentDataEmpty = isComponentDataEmpty;
|
|
48
48
|
exports.isSelectResourceWithObjectValue = isSelectResourceWithObjectValue;
|
49
49
|
exports.compareSelectResourceWithObjectTypeValues = compareSelectResourceWithObjectTypeValues;
|
50
50
|
exports.getItemTemplateKeys = getItemTemplateKeys;
|
51
|
+
/**
|
52
|
+
* Checks if the component is expected to have data in submission object.
|
53
|
+
* @param {import('@formio/core').Component} component - The component to check.
|
54
|
+
* @returns {boolean} - TRUE if the component is a data component.
|
55
|
+
*/
|
56
|
+
function isDataComponent(component) {
|
57
|
+
const modelType = getModelType(component);
|
58
|
+
return modelType !== 'none' && modelType !== 'content';
|
59
|
+
}
|
60
|
+
exports.isDataComponent = isDataComponent;
|
package/lib/cjs/utils/index.d.ts
CHANGED
@@ -66,6 +66,7 @@ declare const FormioUtils: {
|
|
66
66
|
isSelectResourceWithObjectValue: typeof import("@formio/core/lib/utils/formUtil").isSelectResourceWithObjectValue;
|
67
67
|
compareSelectResourceWithObjectTypeValues: typeof import("@formio/core/lib/utils/formUtil").compareSelectResourceWithObjectTypeValues;
|
68
68
|
getItemTemplateKeys: typeof import("@formio/core/lib/utils/formUtil").getItemTemplateKeys;
|
69
|
+
isDataComponent: typeof formUtils.isDataComponent;
|
69
70
|
evaluate(func: string | object | Function, args: any, ret: string, interpolate: boolean, options?: import("@formio/core").EvaluatorOptions): any;
|
70
71
|
getRandomComponentId(): string;
|
71
72
|
getPropertyValue(style: CSSStyleDeclaration, prop: string): number;
|
@@ -168,4 +169,5 @@ import { DefaultEvaluator } from './Evaluator';
|
|
168
169
|
import { registerEvaluator } from './Evaluator';
|
169
170
|
import { interpolate } from './Evaluator';
|
170
171
|
import moment from 'moment';
|
172
|
+
import * as formUtils from './formUtils';
|
171
173
|
export { FormioUtils as Utils, Evaluator, DefaultEvaluator, registerEvaluator };
|
package/lib/mjs/Wizard.js
CHANGED
@@ -867,11 +867,7 @@ export default class Wizard extends Webform {
|
|
867
867
|
onChange(flags, changed, modified, changes) {
|
868
868
|
super.onChange(flags, changed, modified, changes);
|
869
869
|
// The onChange loop doesn't need all components for wizards
|
870
|
-
const errors =
|
871
|
-
? []
|
872
|
-
: this.submitted
|
873
|
-
? this.validate(this.localData, { dirty: true })
|
874
|
-
: this.validateCurrentPage();
|
870
|
+
const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
|
875
871
|
if (this.alert) {
|
876
872
|
this.showErrors(errors, true, true);
|
877
873
|
}
|
@@ -2,6 +2,7 @@ import Component from './_classes/component/Component';
|
|
2
2
|
import EditFormUtils from './_classes/component/editForm/utils';
|
3
3
|
import BaseEditForm from './_classes/component/Component.form';
|
4
4
|
import _ from 'lodash';
|
5
|
+
import { isDataComponent } from '../utils';
|
5
6
|
export default class Components {
|
6
7
|
static _editFormUtils = EditFormUtils;
|
7
8
|
static _baseEditForm = BaseEditForm;
|
@@ -69,7 +70,7 @@ export default class Components {
|
|
69
70
|
else {
|
70
71
|
comp = new Component(component, options, data);
|
71
72
|
}
|
72
|
-
if (comp.path) {
|
73
|
+
if (comp.path && isDataComponent(comp.component)) {
|
73
74
|
comp.componentsMap[comp.path] = comp;
|
74
75
|
}
|
75
76
|
// Reset the componentMatches on the root element if any new component is created.
|
@@ -55,4 +55,10 @@ export const isComponentDataEmpty: typeof Utils.isComponentDataEmpty;
|
|
55
55
|
export const isSelectResourceWithObjectValue: typeof Utils.isSelectResourceWithObjectValue;
|
56
56
|
export const compareSelectResourceWithObjectTypeValues: typeof Utils.compareSelectResourceWithObjectTypeValues;
|
57
57
|
export const getItemTemplateKeys: typeof Utils.getItemTemplateKeys;
|
58
|
+
/**
|
59
|
+
* Checks if the component is expected to have data in submission object.
|
60
|
+
* @param {import('@formio/core').Component} component - The component to check.
|
61
|
+
* @returns {boolean} - TRUE if the component is a data component.
|
62
|
+
*/
|
63
|
+
export function isDataComponent(component: import('@formio/core').Component): boolean;
|
58
64
|
import { Utils } from '@formio/core';
|
@@ -1,3 +1,12 @@
|
|
1
1
|
import { Utils } from '@formio/core';
|
2
2
|
const { flattenComponents, guid, uniqueName, MODEL_TYPES_OF_KNOWN_COMPONENTS, getModelType, getComponentPath, setComponentScope, resetComponentScope, isComponentNestedDataType, componentPath, getComponentPaths, componentMatches, getBestMatch, getComponentFromPath, getComponentValue, findComponents, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty, isSelectResourceWithObjectValue, compareSelectResourceWithObjectTypeValues, getItemTemplateKeys } = Utils;
|
3
|
-
|
3
|
+
/**
|
4
|
+
* Checks if the component is expected to have data in submission object.
|
5
|
+
* @param {import('@formio/core').Component} component - The component to check.
|
6
|
+
* @returns {boolean} - TRUE if the component is a data component.
|
7
|
+
*/
|
8
|
+
function isDataComponent(component) {
|
9
|
+
const modelType = getModelType(component);
|
10
|
+
return modelType !== 'none' && modelType !== 'content';
|
11
|
+
}
|
12
|
+
export { flattenComponents, guid, uniqueName, MODEL_TYPES_OF_KNOWN_COMPONENTS, getModelType, getComponentPath, setComponentScope, resetComponentScope, isComponentNestedDataType, componentPath, getComponentPaths, componentMatches, getBestMatch, getComponentFromPath, getComponentValue, findComponents, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty, isSelectResourceWithObjectValue, compareSelectResourceWithObjectTypeValues, getItemTemplateKeys, isDataComponent };
|
package/lib/mjs/utils/index.d.ts
CHANGED
@@ -66,6 +66,7 @@ declare const FormioUtils: {
|
|
66
66
|
isSelectResourceWithObjectValue: typeof import("@formio/core/lib/utils/formUtil").isSelectResourceWithObjectValue;
|
67
67
|
compareSelectResourceWithObjectTypeValues: typeof import("@formio/core/lib/utils/formUtil").compareSelectResourceWithObjectTypeValues;
|
68
68
|
getItemTemplateKeys: typeof import("@formio/core/lib/utils/formUtil").getItemTemplateKeys;
|
69
|
+
isDataComponent: typeof formUtils.isDataComponent;
|
69
70
|
evaluate(func: string | object | Function, args: any, ret: string, interpolate: boolean, options?: import("@formio/core").EvaluatorOptions): any;
|
70
71
|
getRandomComponentId(): string;
|
71
72
|
getPropertyValue(style: CSSStyleDeclaration, prop: string): number;
|
@@ -168,4 +169,5 @@ import { DefaultEvaluator } from './Evaluator';
|
|
168
169
|
import { registerEvaluator } from './Evaluator';
|
169
170
|
import { interpolate } from './Evaluator';
|
170
171
|
import moment from 'moment';
|
172
|
+
import * as formUtils from './formUtils';
|
171
173
|
export { FormioUtils as Utils, Evaluator, DefaultEvaluator, registerEvaluator };
|