@formio/js 5.1.0-dev.6123.055aa35 → 5.1.0-dev.6125.181c4f5

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.
@@ -1129,11 +1129,14 @@ class WebformBuilder extends Component_1.default {
1129
1129
  const repeatablePaths = [];
1130
1130
  const keys = new Map();
1131
1131
  (0, utils_1.eachComponent)(this.form.components, (comp, path, components, parent, paths) => {
1132
- if (keys.has(paths.dataPath)) {
1133
- repeatablePaths.push(paths.dataPath);
1134
- }
1135
- else {
1136
- keys.set(paths.dataPath, true);
1132
+ const isLayout = (0, utils_1.componentInfo)(comp).layout;
1133
+ if (!isLayout) {
1134
+ if (keys.has(paths.dataPath)) {
1135
+ repeatablePaths.push(paths.dataPath);
1136
+ }
1137
+ else {
1138
+ keys.set(paths.dataPath, true);
1139
+ }
1137
1140
  }
1138
1141
  }, true);
1139
1142
  return repeatablePaths;
@@ -1147,6 +1150,9 @@ class WebformBuilder extends Component_1.default {
1147
1150
  comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
1148
1151
  hasInvalidComponents = true;
1149
1152
  }
1153
+ else {
1154
+ comp.setCustomValidity();
1155
+ }
1150
1156
  });
1151
1157
  this.emit('builderFormValidityChange', hasInvalidComponents);
1152
1158
  }
@@ -11,4 +11,5 @@ export class DefaultEvaluator extends CoreEvaluator {
11
11
  interpolate(rawTemplate: any, data: any, _options: any): any;
12
12
  }
13
13
  export let Evaluator: DefaultEvaluator;
14
+ export function interpolate(rawTemplate: any, data: any, _options: any): any;
14
15
  import { DefaultEvaluator as CoreEvaluator } from '@formio/core';
@@ -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.registerEvaluator = exports.Evaluator = exports.DefaultEvaluator = void 0;
6
+ exports.registerEvaluator = exports.interpolate = exports.Evaluator = exports.DefaultEvaluator = void 0;
7
7
  const lodash_1 = __importDefault(require("lodash"));
8
8
  const string_hash_1 = __importDefault(require("string-hash"));
9
9
  const core_1 = require("@formio/core");
@@ -61,6 +61,8 @@ class DefaultEvaluator extends core_1.DefaultEvaluator {
61
61
  }
62
62
  exports.DefaultEvaluator = DefaultEvaluator;
63
63
  exports.Evaluator = new DefaultEvaluator();
64
+ // preserve the standalone interpolate function for backwards compatibility
65
+ exports.interpolate = exports.Evaluator.interpolate;
64
66
  /**
65
67
  * Set the evaluator to use for evaluating expressions.
66
68
  * @param {CoreEvaluator} override - The new evaluator instance to use.
@@ -3,6 +3,7 @@ export * from "./formUtils";
3
3
  export default FormioUtils;
4
4
  declare const FormioUtils: {
5
5
  Evaluator: import("./Evaluator").DefaultEvaluator;
6
+ interpolate: (rawTemplate: any, data: any, _options: any) => any;
6
7
  flattenComponents: typeof import("@formio/core/lib/utils/formUtil").flattenComponents;
7
8
  guid: typeof import("@formio/core/lib/utils/formUtil").guid;
8
9
  uniqueName: typeof import("@formio/core/lib/utils/formUtil").uniqueName;
@@ -32,7 +32,8 @@ const formUtils = __importStar(require("./formUtils"));
32
32
  const Evaluator_1 = require("./Evaluator");
33
33
  Object.defineProperty(exports, "Evaluator", { enumerable: true, get: function () { return Evaluator_1.Evaluator; } });
34
34
  Object.defineProperty(exports, "registerEvaluator", { enumerable: true, get: function () { return Evaluator_1.registerEvaluator; } });
35
- const FormioUtils = Object.assign(Object.assign(Object.assign({}, utils), formUtils), { Evaluator: Evaluator_1.Evaluator });
35
+ const FormioUtils = Object.assign(Object.assign(Object.assign({}, utils), formUtils), { Evaluator: Evaluator_1.Evaluator,
36
+ interpolate: Evaluator_1.interpolate });
36
37
  exports.Utils = FormioUtils;
37
38
  if (typeof global === 'object') {
38
39
  global.FormioUtils = FormioUtils;
@@ -3,7 +3,7 @@ import Component from './components/_classes/component/Component';
3
3
  import tippy from 'tippy.js';
4
4
  import Components from './components/Components';
5
5
  import { Formio } from './Formio';
6
- import { fastCloneDeep, bootstrapVersion, getArrayFromComponentPath, getStringFromComponentPath, eachComponent, getComponent, } from './utils';
6
+ import { fastCloneDeep, bootstrapVersion, getArrayFromComponentPath, getStringFromComponentPath, eachComponent, getComponent, componentInfo } from './utils';
7
7
  import BuilderUtils from './utils/builder';
8
8
  import _ from 'lodash';
9
9
  import autoScroll from 'dom-autoscroller';
@@ -1112,11 +1112,14 @@ export default class WebformBuilder extends Component {
1112
1112
  const repeatablePaths = [];
1113
1113
  const keys = new Map();
1114
1114
  eachComponent(this.form.components, (comp, path, components, parent, paths) => {
1115
- if (keys.has(paths.dataPath)) {
1116
- repeatablePaths.push(paths.dataPath);
1117
- }
1118
- else {
1119
- keys.set(paths.dataPath, true);
1115
+ const isLayout = componentInfo(comp).layout;
1116
+ if (!isLayout) {
1117
+ if (keys.has(paths.dataPath)) {
1118
+ repeatablePaths.push(paths.dataPath);
1119
+ }
1120
+ else {
1121
+ keys.set(paths.dataPath, true);
1122
+ }
1120
1123
  }
1121
1124
  }, true);
1122
1125
  return repeatablePaths;
@@ -1130,6 +1133,9 @@ export default class WebformBuilder extends Component {
1130
1133
  comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
1131
1134
  hasInvalidComponents = true;
1132
1135
  }
1136
+ else {
1137
+ comp.setCustomValidity();
1138
+ }
1133
1139
  });
1134
1140
  this.emit('builderFormValidityChange', hasInvalidComponents);
1135
1141
  }
@@ -11,4 +11,5 @@ export class DefaultEvaluator extends CoreEvaluator {
11
11
  interpolate(rawTemplate: any, data: any, _options: any): any;
12
12
  }
13
13
  export let Evaluator: DefaultEvaluator;
14
+ export function interpolate(rawTemplate: any, data: any, _options: any): any;
14
15
  import { DefaultEvaluator as CoreEvaluator } from '@formio/core';
@@ -51,6 +51,8 @@ export class DefaultEvaluator extends CoreEvaluator {
51
51
  }
52
52
  }
53
53
  export let Evaluator = new DefaultEvaluator();
54
+ // preserve the standalone interpolate function for backwards compatibility
55
+ export const interpolate = Evaluator.interpolate;
54
56
  /**
55
57
  * Set the evaluator to use for evaluating expressions.
56
58
  * @param {CoreEvaluator} override - The new evaluator instance to use.
@@ -3,6 +3,7 @@ export * from "./formUtils";
3
3
  export default FormioUtils;
4
4
  declare const FormioUtils: {
5
5
  Evaluator: import("./Evaluator").DefaultEvaluator;
6
+ interpolate: (rawTemplate: any, data: any, _options: any) => any;
6
7
  flattenComponents: typeof import("@formio/core/lib/utils/formUtil").flattenComponents;
7
8
  guid: typeof import("@formio/core/lib/utils/formUtil").guid;
8
9
  uniqueName: typeof import("@formio/core/lib/utils/formUtil").uniqueName;
@@ -1,10 +1,11 @@
1
1
  import * as utils from './utils';
2
2
  import * as formUtils from './formUtils';
3
- import { Evaluator, registerEvaluator } from './Evaluator';
3
+ import { Evaluator, registerEvaluator, interpolate } from './Evaluator';
4
4
  const FormioUtils = {
5
5
  ...utils,
6
6
  ...formUtils,
7
7
  Evaluator,
8
+ interpolate
8
9
  };
9
10
  if (typeof global === 'object') {
10
11
  global.FormioUtils = FormioUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6123.055aa35",
3
+ "version": "5.1.0-dev.6125.181c4f5",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -81,7 +81,7 @@
81
81
  "homepage": "https://github.com/formio/formio.js#readme",
82
82
  "dependencies": {
83
83
  "@formio/bootstrap": "v3.0.0-dev.121.085d187",
84
- "@formio/core": "2.4.0-dev.245.326cac7",
84
+ "@formio/core": "v2.4.0-dev.255.7fab6ff",
85
85
  "@formio/text-mask-addons": "3.8.0-formio.4",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",
@@ -176,7 +176,8 @@
176
176
  "webpack-bundle-analyzer": "^4.10.2",
177
177
  "webpack-cli": "^5.1.1",
178
178
  "webpack-node-externals": "^3.0.0",
179
- "webpack-stream": "^7.0.0"
179
+ "webpack-stream": "^7.0.0",
180
+ "zx": "^8.5.4"
180
181
  },
181
182
  "nyc": {
182
183
  "check-coverage": true,