@formio/js 5.1.0-dev.6048.569bfc1 → 5.1.0-dev.6049.6110ca0

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.
Files changed (230) hide show
  1. package/Changelog.md +99 -310
  2. package/README.md +7 -0
  3. package/dist/formio.builder.css +1 -0
  4. package/dist/formio.builder.min.css +1 -1
  5. package/dist/formio.form.css +1 -0
  6. package/dist/formio.form.js +658 -669
  7. package/dist/formio.form.min.css +1 -1
  8. package/dist/formio.form.min.js +1 -1
  9. package/dist/formio.form.min.js.LICENSE.txt +3 -1
  10. package/dist/formio.full.css +1 -0
  11. package/dist/formio.full.js +685 -696
  12. package/dist/formio.full.min.css +1 -1
  13. package/dist/formio.full.min.js +1 -1
  14. package/dist/formio.full.min.js.LICENSE.txt +3 -1
  15. package/dist/formio.js +90 -68
  16. package/dist/formio.min.js +1 -1
  17. package/dist/formio.utils.js +103 -81
  18. package/dist/formio.utils.min.js +1 -1
  19. package/dist/formio.utils.min.js.LICENSE.txt +3 -1
  20. package/lib/cjs/Element.d.ts +2 -1
  21. package/lib/cjs/Element.js +18 -39
  22. package/lib/cjs/EventEmitter.js +2 -25
  23. package/lib/cjs/Form.js +2 -25
  24. package/lib/cjs/PDF.js +1 -1
  25. package/lib/cjs/PDFBuilder.d.ts +1 -0
  26. package/lib/cjs/PDFBuilder.js +10 -11
  27. package/lib/cjs/Webform.d.ts +2 -2
  28. package/lib/cjs/Webform.js +14 -15
  29. package/lib/cjs/WebformBuilder.d.ts +2 -1
  30. package/lib/cjs/WebformBuilder.js +62 -20
  31. package/lib/cjs/Wizard.d.ts +2 -2
  32. package/lib/cjs/Wizard.js +40 -26
  33. package/lib/cjs/WizardBuilder.js +1 -1
  34. package/lib/cjs/components/_classes/component/Component.d.ts +44 -13
  35. package/lib/cjs/components/_classes/component/Component.js +156 -95
  36. package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
  37. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +19 -0
  38. package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
  39. package/lib/cjs/components/_classes/component/editForm/utils.js +1 -1
  40. package/lib/cjs/components/_classes/componentModal/ComponentModal.js +1 -1
  41. package/lib/cjs/components/_classes/input/Input.js +1 -1
  42. package/lib/cjs/components/_classes/list/ListComponent.js +3 -3
  43. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +13 -0
  44. package/lib/cjs/components/_classes/nested/NestedComponent.js +15 -8
  45. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  46. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +0 -2
  47. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -12
  48. package/lib/cjs/components/address/Address.d.ts +8 -0
  49. package/lib/cjs/components/address/Address.js +32 -9
  50. package/lib/cjs/components/address/editForm/Address.edit.display.d.ts +4 -0
  51. package/lib/cjs/components/address/editForm/Address.edit.display.js +1 -0
  52. package/lib/cjs/components/address/editForm/Address.edit.provider.js +8 -8
  53. package/lib/cjs/components/alert/Alert.js +1 -1
  54. package/lib/cjs/components/button/Button.d.ts +1 -1
  55. package/lib/cjs/components/button/Button.js +7 -11
  56. package/lib/cjs/components/checkbox/Checkbox.js +1 -1
  57. package/lib/cjs/components/container/Container.js +1 -1
  58. package/lib/cjs/components/content/editForm/Content.edit.display.js +8 -0
  59. package/lib/cjs/components/currency/Currency.js +1 -1
  60. package/lib/cjs/components/currency/editForm/Currency.edit.display.js +12 -0
  61. package/lib/cjs/components/datagrid/DataGrid.js +5 -1
  62. package/lib/cjs/components/datetime/DateTime.d.ts +1 -1
  63. package/lib/cjs/components/datetime/DateTime.js +15 -13
  64. package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.d.ts +66 -15
  65. package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.js +68 -47
  66. package/lib/cjs/components/day/Day.js +2 -2
  67. package/lib/cjs/components/day/editForm/Day.edit.display.js +8 -0
  68. package/lib/cjs/components/editgrid/EditGrid.js +4 -2
  69. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  70. package/lib/cjs/components/email/editForm/Email.edit.display.js +12 -0
  71. package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
  72. package/lib/cjs/components/file/File.js +6 -2
  73. package/lib/cjs/components/file/editForm/File.edit.file.d.ts +13 -0
  74. package/lib/cjs/components/file/editForm/File.edit.file.js +1 -0
  75. package/lib/cjs/components/form/Form.d.ts +0 -1
  76. package/lib/cjs/components/form/Form.js +31 -23
  77. package/lib/cjs/components/form/editForm/Form.edit.form.js +4 -3
  78. package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
  79. package/lib/cjs/components/html/editForm/HTML.edit.display.js +8 -0
  80. package/lib/cjs/components/number/Number.js +1 -1
  81. package/lib/cjs/components/number/editForm/Number.edit.display.js +12 -0
  82. package/lib/cjs/components/panel/Panel.js +1 -1
  83. package/lib/cjs/components/password/editForm/Password.edit.display.js +13 -1
  84. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -1
  85. package/lib/cjs/components/radio/Radio.d.ts +8 -0
  86. package/lib/cjs/components/radio/Radio.js +16 -6
  87. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
  88. package/lib/cjs/components/select/Select.d.ts +1 -0
  89. package/lib/cjs/components/select/Select.js +21 -5
  90. package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +68 -110
  91. package/lib/cjs/components/select/editForm/Select.edit.data.js +2 -37
  92. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +6 -0
  93. package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -1
  94. package/lib/cjs/components/signature/Signature.js +1 -1
  95. package/lib/cjs/components/survey/Survey.js +2 -2
  96. package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
  97. package/lib/cjs/components/tags/Tags.js +1 -1
  98. package/lib/cjs/components/textarea/TextArea.js +10 -2
  99. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
  100. package/lib/cjs/components/textfield/TextField.js +9 -32
  101. package/lib/cjs/components/time/Time.js +1 -1
  102. package/lib/cjs/components/unknown/Unknown.form.d.ts +2 -1
  103. package/lib/cjs/components/unknown/Unknown.form.js +13 -9
  104. package/lib/cjs/components/url/editForm/Url.edit.display.js +12 -0
  105. package/lib/cjs/components/well/editForm/Well.edit.display.js +8 -0
  106. package/lib/cjs/formio.form.js +5 -5
  107. package/lib/cjs/providers/storage/uploadAdapter.js +8 -6
  108. package/lib/cjs/translations/en.d.ts +1 -234
  109. package/lib/cjs/translations/en.js +4 -2
  110. package/lib/cjs/utils/Evaluator.d.ts +20 -6
  111. package/lib/cjs/utils/Evaluator.js +38 -15
  112. package/lib/cjs/utils/builder.js +5 -5
  113. package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
  114. package/lib/cjs/utils/formUtils.d.ts +2 -2
  115. package/lib/cjs/utils/index.d.ts +169 -2
  116. package/lib/cjs/utils/index.js +22 -2
  117. package/lib/cjs/utils/utils.d.ts +31 -37
  118. package/lib/cjs/utils/utils.js +80 -135
  119. package/lib/cjs/widgets/CalendarWidget.d.ts +1 -8
  120. package/lib/cjs/widgets/CalendarWidget.js +19 -40
  121. package/lib/mjs/Element.d.ts +2 -1
  122. package/lib/mjs/Element.js +11 -9
  123. package/lib/mjs/EventEmitter.js +2 -2
  124. package/lib/mjs/Form.js +1 -1
  125. package/lib/mjs/PDF.js +1 -1
  126. package/lib/mjs/PDFBuilder.d.ts +1 -0
  127. package/lib/mjs/PDFBuilder.js +9 -10
  128. package/lib/mjs/Webform.d.ts +2 -2
  129. package/lib/mjs/Webform.js +12 -13
  130. package/lib/mjs/WebformBuilder.d.ts +2 -1
  131. package/lib/mjs/WebformBuilder.js +53 -13
  132. package/lib/mjs/Wizard.d.ts +2 -2
  133. package/lib/mjs/Wizard.js +38 -24
  134. package/lib/mjs/WizardBuilder.js +1 -1
  135. package/lib/mjs/components/_classes/component/Component.d.ts +44 -13
  136. package/lib/mjs/components/_classes/component/Component.js +129 -45
  137. package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
  138. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +19 -0
  139. package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
  140. package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
  141. package/lib/mjs/components/_classes/componentModal/ComponentModal.js +1 -1
  142. package/lib/mjs/components/_classes/input/Input.js +1 -1
  143. package/lib/mjs/components/_classes/list/ListComponent.js +3 -3
  144. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +13 -0
  145. package/lib/mjs/components/_classes/nested/NestedComponent.js +15 -8
  146. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  147. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +0 -2
  148. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -12
  149. package/lib/mjs/components/address/Address.d.ts +8 -0
  150. package/lib/mjs/components/address/Address.js +32 -9
  151. package/lib/mjs/components/address/editForm/Address.edit.display.d.ts +4 -0
  152. package/lib/mjs/components/address/editForm/Address.edit.display.js +1 -0
  153. package/lib/mjs/components/address/editForm/Address.edit.provider.js +8 -8
  154. package/lib/mjs/components/alert/Alert.js +1 -1
  155. package/lib/mjs/components/button/Button.d.ts +1 -1
  156. package/lib/mjs/components/button/Button.js +7 -10
  157. package/lib/mjs/components/checkbox/Checkbox.js +1 -1
  158. package/lib/mjs/components/container/Container.js +1 -1
  159. package/lib/mjs/components/content/editForm/Content.edit.display.js +8 -0
  160. package/lib/mjs/components/currency/Currency.js +1 -1
  161. package/lib/mjs/components/currency/editForm/Currency.edit.display.js +12 -0
  162. package/lib/mjs/components/datagrid/DataGrid.js +5 -1
  163. package/lib/mjs/components/datetime/DateTime.d.ts +1 -1
  164. package/lib/mjs/components/datetime/DateTime.js +15 -13
  165. package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.d.ts +66 -15
  166. package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.js +68 -47
  167. package/lib/mjs/components/day/Day.js +2 -2
  168. package/lib/mjs/components/day/editForm/Day.edit.display.js +8 -0
  169. package/lib/mjs/components/editgrid/EditGrid.js +4 -2
  170. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  171. package/lib/mjs/components/email/editForm/Email.edit.display.js +12 -0
  172. package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
  173. package/lib/mjs/components/file/File.js +6 -2
  174. package/lib/mjs/components/file/editForm/File.edit.file.d.ts +13 -0
  175. package/lib/mjs/components/file/editForm/File.edit.file.js +1 -0
  176. package/lib/mjs/components/form/Form.d.ts +0 -1
  177. package/lib/mjs/components/form/Form.js +30 -23
  178. package/lib/mjs/components/form/editForm/Form.edit.form.js +3 -2
  179. package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
  180. package/lib/mjs/components/html/editForm/HTML.edit.display.js +8 -0
  181. package/lib/mjs/components/number/Number.js +1 -1
  182. package/lib/mjs/components/number/editForm/Number.edit.display.js +12 -0
  183. package/lib/mjs/components/panel/Panel.js +1 -1
  184. package/lib/mjs/components/password/editForm/Password.edit.display.js +13 -1
  185. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -1
  186. package/lib/mjs/components/radio/Radio.d.ts +8 -0
  187. package/lib/mjs/components/radio/Radio.js +16 -6
  188. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
  189. package/lib/mjs/components/select/Select.d.ts +1 -0
  190. package/lib/mjs/components/select/Select.js +21 -5
  191. package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +68 -110
  192. package/lib/mjs/components/select/editForm/Select.edit.data.js +2 -37
  193. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +6 -0
  194. package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -1
  195. package/lib/mjs/components/signature/Signature.js +1 -1
  196. package/lib/mjs/components/survey/Survey.js +2 -2
  197. package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
  198. package/lib/mjs/components/tags/Tags.js +1 -1
  199. package/lib/mjs/components/textarea/TextArea.js +10 -2
  200. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
  201. package/lib/mjs/components/textfield/TextField.js +3 -3
  202. package/lib/mjs/components/time/Time.js +1 -1
  203. package/lib/mjs/components/unknown/Unknown.form.d.ts +2 -1
  204. package/lib/mjs/components/unknown/Unknown.form.js +13 -9
  205. package/lib/mjs/components/url/editForm/Url.edit.display.js +12 -0
  206. package/lib/mjs/components/well/editForm/Well.edit.display.js +8 -0
  207. package/lib/mjs/formio.form.js +3 -3
  208. package/lib/mjs/providers/storage/uploadAdapter.js +8 -6
  209. package/lib/mjs/translations/en.d.ts +1 -234
  210. package/lib/mjs/translations/en.js +6 -47
  211. package/lib/mjs/utils/Evaluator.d.ts +20 -6
  212. package/lib/mjs/utils/Evaluator.js +31 -13
  213. package/lib/mjs/utils/builder.js +1 -1
  214. package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
  215. package/lib/mjs/utils/formUtils.d.ts +2 -2
  216. package/lib/mjs/utils/index.d.ts +169 -2
  217. package/lib/mjs/utils/index.js +18 -1
  218. package/lib/mjs/utils/utils.d.ts +31 -37
  219. package/lib/mjs/utils/utils.js +72 -109
  220. package/lib/mjs/widgets/CalendarWidget.d.ts +1 -8
  221. package/lib/mjs/widgets/CalendarWidget.js +19 -40
  222. package/package.json +8 -6
  223. package/lib/cjs/i18n.d.ts +0 -13
  224. package/lib/cjs/i18n.js +0 -19
  225. package/lib/cjs/utils/i18n.d.ts +0 -19
  226. package/lib/cjs/utils/i18n.js +0 -120
  227. package/lib/mjs/i18n.d.ts +0 -13
  228. package/lib/mjs/i18n.js +0 -14
  229. package/lib/mjs/utils/i18n.d.ts +0 -19
  230. package/lib/mjs/utils/i18n.js +0 -112
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -42,8 +19,8 @@ const lodash_1 = __importDefault(require("lodash"));
42
19
  const ismobilejs_1 = __importDefault(require("ismobilejs"));
43
20
  const process_1 = require("@formio/core/process");
44
21
  const Formio_1 = require("../../../Formio");
45
- const FormioUtils = __importStar(require("../../../utils/utils"));
46
- const utils_1 = require("../../../utils/utils");
22
+ const utils_1 = __importDefault(require("../../../utils"));
23
+ const utils_2 = require("../../../utils");
47
24
  const Element_1 = __importDefault(require("../../../Element"));
48
25
  const ComponentModal_1 = __importDefault(require("../componentModal/ComponentModal"));
49
26
  const widgets_1 = __importDefault(require("../../../widgets"));
@@ -51,7 +28,7 @@ const addons_1 = __importDefault(require("../../../addons"));
51
28
  const uploadAdapter_1 = require("../../../providers/storage/uploadAdapter");
52
29
  const en_1 = __importDefault(require("../../../translations/en"));
53
30
  const Templates_1 = __importDefault(require("../../../templates/Templates"));
54
- const isIEBrowser = FormioUtils.getBrowserInfo().ie;
31
+ const isIEBrowser = utils_1.default.getBrowserInfo().ie;
55
32
  /**
56
33
  * This is the Component class
57
34
  which all elements within the FormioForm derive from.
@@ -225,7 +202,7 @@ class Component extends Element_1.default {
225
202
  */
226
203
  static savedValueTypes(schema) {
227
204
  schema = schema || {};
228
- return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.any];
205
+ return utils_1.default.getComponentSavedTypes(schema) || [utils_1.default.componentValueTypes.any];
229
206
  }
230
207
  /**
231
208
  * Provides a table view for this component. Override if you wish to do something different than using getView
@@ -292,7 +269,7 @@ class Component extends Element_1.default {
292
269
  this.component.id = this.id;
293
270
  this.afterComponentAssign();
294
271
  // Save off the original component to be used in logic.
295
- this.originalComponent = (0, utils_1.fastCloneDeep)(this.component);
272
+ this.originalComponent = (0, utils_2.fastCloneDeep)(this.component);
296
273
  /**
297
274
  * If the component has been attached
298
275
  */
@@ -325,7 +302,7 @@ class Component extends Element_1.default {
325
302
  * Determines if this component is disabled, or not.
326
303
  * @type {boolean}
327
304
  */
328
- this._disabled = (0, utils_1.boolValue)(this.component.disabled) ? this.component.disabled : false;
305
+ this._disabled = (0, utils_2.boolValue)(this.component.disabled) ? this.component.disabled : false;
329
306
  /**
330
307
  * Points to the root component, usually the FormComponent.
331
308
  * @type {Component}
@@ -346,7 +323,7 @@ class Component extends Element_1.default {
346
323
  * The component paths for this component.
347
324
  * @type {import('@formio/core').ComponentPaths} - The component paths.
348
325
  */
349
- this.paths = FormioUtils.getComponentPaths(this.component, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.component, Object.assign(Object.assign({}, (_b = this.parent) === null || _b === void 0 ? void 0 : _b.paths), { dataIndex: this.options.rowIndex === undefined ? (_d = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.paths) === null || _d === void 0 ? void 0 : _d.dataIndex : this.options.rowIndex }));
326
+ this.paths = utils_1.default.getComponentPaths(this.component, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.component, Object.assign(Object.assign({}, (_b = this.parent) === null || _b === void 0 ? void 0 : _b.paths), { dataIndex: this.options.rowIndex === undefined ? (_d = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.paths) === null || _d === void 0 ? void 0 : _d.dataIndex : this.options.rowIndex }));
350
327
  this.options.name = this.options.name || 'data';
351
328
  this._path = '';
352
329
  // Needs for Nextgen Rules Engine
@@ -361,22 +338,6 @@ class Component extends Element_1.default {
361
338
  * The reference attribute name for this component
362
339
  */
363
340
  this._referenceAttributeName = 'ref';
364
- /**
365
- * Sometimes the customDefaultValue does not set the "value" within the script, but is just a script to execute. This
366
- * flag is used to determine if the customDefaultValue should be used to set the value of the component or not based on
367
- * if there is a "value=" within the script.
368
- */
369
- this.shouldSetCustomDefault = true;
370
- if (this.component.customDefaultValue && (typeof this.component.customDefaultValue === 'string')) {
371
- this.shouldSetCustomDefault = this.component.customDefaultValue.match(/value\s*=/);
372
- }
373
- /**
374
- * Same as customDefaultValue, but for calculateValue.
375
- */
376
- this.shouldSetCalculatedValue = true;
377
- if (this.component.calculateValue && (typeof this.component.calculateValue === 'string')) {
378
- this.shouldSetCalculatedValue = this.component.calculateValue.match(/value\s*=/);
379
- }
380
341
  /**
381
342
  * Used to trigger a new change in this component.
382
343
  * @type {Function} - Call to trigger a change in this component.
@@ -440,7 +401,7 @@ class Component extends Element_1.default {
440
401
  if (this.allowData && this.key) {
441
402
  this.options.name += `[${this.key}]`;
442
403
  // If component is visible or not set to clear on hide, set the default value.
443
- if (!(this.conditionallyHidden() && this.component.clearOnHide)) {
404
+ if (!this.shouldConditionallyClear()) {
444
405
  if (!this.hasValue()) {
445
406
  if (this.shouldAddDefaultValue) {
446
407
  this.dataValue = this.defaultValue;
@@ -474,10 +435,39 @@ class Component extends Element_1.default {
474
435
  var _a;
475
436
  return ((_a = this.root) === null || _a === void 0 ? void 0 : _a.childComponentsMap) || {};
476
437
  }
438
+ /**
439
+ * Returns if the parent should conditionally clear.
440
+ * @returns {boolean} - If the parent should conditionally clear.
441
+ */
442
+ parentShouldConditionallyClear() {
443
+ let currentParent = this.parent;
444
+ while (currentParent) {
445
+ if ((currentParent.allowData && currentParent._conditionallyClear) ||
446
+ (!currentParent.allowData && currentParent._conditionallyHidden)) {
447
+ return true;
448
+ }
449
+ currentParent = currentParent.parent;
450
+ }
451
+ return false;
452
+ }
477
453
  parentConditionallyHidden() {
478
454
  let currentParent = this.parent;
479
455
  while (currentParent) {
480
- if (currentParent.conditionallyHidden(true)) {
456
+ if (currentParent._conditionallyHidden) {
457
+ return true;
458
+ }
459
+ currentParent = currentParent.parent;
460
+ }
461
+ return false;
462
+ }
463
+ /**
464
+ * Returns true if any of the parents default their component "hidden" property to true.
465
+ * @returns {boolean} - If any parent defaults the hidden property to true.
466
+ */
467
+ anyParentDefaultsHidden() {
468
+ let currentParent = this.parent;
469
+ while (currentParent) {
470
+ if (currentParent.component.hidden) {
481
471
  return true;
482
472
  }
483
473
  currentParent = currentParent.parent;
@@ -510,7 +500,7 @@ class Component extends Element_1.default {
510
500
  label.labelPosition = this.component.labelPosition;
511
501
  label.tooltipClass = `${this.iconClass('question-sign')} text-muted`;
512
502
  const isPDFReadOnlyMode = this.isPDFReadOnlyMode;
513
- if (this.hasInput && this.component.validate && (0, utils_1.boolValue)(this.component.validate.required) && !isPDFReadOnlyMode) {
503
+ if (this.hasInput && this.component.validate && (0, utils_2.boolValue)(this.component.validate.required) && !isPDFReadOnlyMode) {
514
504
  label.className += ' field-required';
515
505
  }
516
506
  if (label.hidden) {
@@ -543,7 +533,7 @@ class Component extends Element_1.default {
543
533
  */
544
534
  set rowIndex(value) {
545
535
  var _a, _b;
546
- this.paths = FormioUtils.getComponentPaths(this.component, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.component, Object.assign(Object.assign({}, (((_b = this.parent) === null || _b === void 0 ? void 0 : _b.paths) || {})), { dataIndex: value }));
536
+ this.paths = utils_1.default.getComponentPaths(this.component, (_a = this.parent) === null || _a === void 0 ? void 0 : _a.component, Object.assign(Object.assign({}, (((_b = this.parent) === null || _b === void 0 ? void 0 : _b.paths) || {})), { dataIndex: value }));
547
537
  this._rowIndex = value;
548
538
  }
549
539
  afterComponentAssign() {
@@ -695,11 +685,58 @@ class Component extends Element_1.default {
695
685
  }
696
686
  return this._logicallyHidden;
697
687
  }
698
- conditionallyHidden(skipParent = false) {
699
- if (!this.hasCondition()) {
700
- return this.logicallyHidden || (skipParent ? false : this.parentConditionallyHidden());
688
+ /**
689
+ * Determines if the component should clear its value when the root form is pristine.
690
+ * @returns {boolean} - If the component should clear its value when the root form is pristine.
691
+ */
692
+ shouldConditionallyClearOnPristine() {
693
+ // If the form is pristine, we should NOT clear the value of a conditionally hidden child component
694
+ // of a layout component that defaults to hidden using the "hidden" component property.
695
+ return !this.anyParentDefaultsHidden();
696
+ }
697
+ /**
698
+ * Returns if the component should clear its value when conditionally hidden.
699
+ * @returns {boolean} - If the component should clear its value when conditionally hidden.
700
+ */
701
+ shouldConditionallyClear() {
702
+ // Skip if this component has clearOnHide set to false.
703
+ if (this.component.clearOnHide === false) {
704
+ this._conditionallyClear = false;
705
+ return this._conditionallyClear;
706
+ }
707
+ // If the component is logically hidden, then it is conditionally hidden and should clear.
708
+ if (this.logicallyHidden) {
709
+ this._conditionallyClear = true;
710
+ return this._conditionallyClear;
701
711
  }
702
- return !this.conditionallyVisible() || this.logicallyHidden || (skipParent ? false : this.parentConditionallyHidden());
712
+ // If we have a condition and it is not conditionally visible, the it should conditionally clear.
713
+ if (this.hasCondition() &&
714
+ !this.conditionallyVisible() &&
715
+ (!this.rootPristine || this.shouldConditionallyClearOnPristine())) {
716
+ this._conditionallyClear = true;
717
+ return this._conditionallyClear;
718
+ }
719
+ this._conditionallyClear = this.hasSetValue ? false : this.parentShouldConditionallyClear();
720
+ return this._conditionallyClear;
721
+ }
722
+ /**
723
+ * Returns if the component is conditionally hidden.
724
+ * @returns {boolean} - If the component is conditionally hidden.
725
+ */
726
+ conditionallyHidden() {
727
+ // If it is logically hidden, then it is conditionally hidden.
728
+ if (this.logicallyHidden) {
729
+ this._conditionallyHidden = true;
730
+ return this._conditionallyHidden;
731
+ }
732
+ // If it has a condition, and is not conditionally visible, then it is conditionally hidden.
733
+ if (this.hasCondition() && !this.conditionallyVisible()) {
734
+ this._conditionallyHidden = true;
735
+ return this._conditionallyHidden;
736
+ }
737
+ // It is conditionally hidden if its parent is conditionally hidden.
738
+ this._conditionallyHidden = this.parentConditionallyHidden();
739
+ return this._conditionallyHidden;
703
740
  }
704
741
  get currentForm() {
705
742
  return this._currentForm;
@@ -816,7 +853,7 @@ class Component extends Element_1.default {
816
853
  * @returns {object} - The JSON schema for this component.
817
854
  */
818
855
  get schema() {
819
- return (0, utils_1.fastCloneDeep)(this.getModifiedSchema(lodash_1.default.omit(this.component, 'id'), this.defaultSchema));
856
+ return (0, utils_2.fastCloneDeep)(this.getModifiedSchema(lodash_1.default.omit(this.component, 'id'), this.defaultSchema));
820
857
  }
821
858
  /**
822
859
  * Returns true if component is inside DataGrid
@@ -968,7 +1005,7 @@ class Component extends Element_1.default {
968
1005
  if (!this.shouldSanitizeValue && !forceSanitize) {
969
1006
  return dirty;
970
1007
  }
971
- return FormioUtils.sanitize(dirty, {
1008
+ return utils_1.default.sanitize(dirty, {
972
1009
  sanitizeConfig: lodash_1.default.merge(((_a = this.options) === null || _a === void 0 ? void 0 : _a.sanitizeConfig) || {}, options || {}),
973
1010
  });
974
1011
  }
@@ -1087,7 +1124,7 @@ class Component extends Element_1.default {
1087
1124
  return submissionTimezone;
1088
1125
  }
1089
1126
  // Return current timezone if none are provided.
1090
- return (0, utils_1.currentTimezone)();
1127
+ return (0, utils_2.currentTimezone)();
1091
1128
  }
1092
1129
  /**
1093
1130
  *
@@ -1392,7 +1429,7 @@ class Component extends Element_1.default {
1392
1429
  else {
1393
1430
  this.refreshOnChanged = true;
1394
1431
  }
1395
- this.refreshOnValue = (0, utils_1.fastCloneDeep)(value);
1432
+ this.refreshOnValue = (0, utils_2.fastCloneDeep)(value);
1396
1433
  if (this.refreshOnChanged) {
1397
1434
  if (this.component.clearOnRefresh) {
1398
1435
  this.setValue(null);
@@ -1634,7 +1671,7 @@ class Component extends Element_1.default {
1634
1671
  if (this.component.customClass) {
1635
1672
  className += this.component.customClass;
1636
1673
  }
1637
- if (this.hasInput && this.component.validate && (0, utils_1.boolValue)(this.component.validate.required)) {
1674
+ if (this.hasInput && this.component.validate && (0, utils_2.boolValue)(this.component.validate.required)) {
1638
1675
  className += ' required';
1639
1676
  }
1640
1677
  if (this.labelIsHidden()) {
@@ -1922,7 +1959,7 @@ class Component extends Element_1.default {
1922
1959
  if (this._hasCondition !== null) {
1923
1960
  return this._hasCondition;
1924
1961
  }
1925
- this._hasCondition = FormioUtils.hasCondition(this.component);
1962
+ this._hasCondition = utils_1.default.hasCondition(this.component);
1926
1963
  return this._hasCondition;
1927
1964
  }
1928
1965
  /**
@@ -1949,7 +1986,7 @@ class Component extends Element_1.default {
1949
1986
  * @returns {boolean} - True if the condition applies to this component.
1950
1987
  */
1951
1988
  checkCondition(row, data) {
1952
- return FormioUtils.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);
1989
+ return utils_1.default.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);
1953
1990
  }
1954
1991
  /**
1955
1992
  * Check for conditionals and hide/show the element based on those conditions.
@@ -2005,9 +2042,9 @@ class Component extends Element_1.default {
2005
2042
  if (logics.length === 0) {
2006
2043
  return;
2007
2044
  }
2008
- const newComponent = (0, utils_1.fastCloneDeep)(this.originalComponent);
2045
+ const newComponent = (0, utils_2.fastCloneDeep)(this.originalComponent);
2009
2046
  let changed = logics.reduce((changed, logic) => {
2010
- const result = FormioUtils.checkTrigger(newComponent, logic.trigger, row, data, this.root ? this.root._form : {}, this);
2047
+ const result = utils_1.default.checkTrigger(newComponent, logic.trigger, row, data, this.root ? this.root._form : {}, this);
2011
2048
  return (result ? this.applyActions(newComponent, logic.actions, result, row, data) : false) || changed;
2012
2049
  }, false);
2013
2050
  // If component definition changed, replace and mark as changed.
@@ -2074,7 +2111,7 @@ class Component extends Element_1.default {
2074
2111
  return actions.reduce((changed, action) => {
2075
2112
  switch (action.type) {
2076
2113
  case 'property': {
2077
- FormioUtils.setActionProperty(newComponent, action, result, row, data, this);
2114
+ utils_1.default.setActionProperty(newComponent, action, result, row, data, this);
2078
2115
  const property = action.property.value;
2079
2116
  if (!lodash_1.default.isEqual(lodash_1.default.get(this.component, property), lodash_1.default.get(newComponent, property))) {
2080
2117
  // Advanced Logic can modify the component's hidden property; because we track conditionally hidden state
@@ -2096,7 +2133,7 @@ class Component extends Element_1.default {
2096
2133
  component: newComponent,
2097
2134
  result,
2098
2135
  });
2099
- if (!lodash_1.default.isEqual(oldValue, newValue) && !(this.component.clearOnHide && this.conditionallyHidden())) {
2136
+ if (!lodash_1.default.isEqual(oldValue, newValue) && !this.shouldConditionallyClear()) {
2100
2137
  this.setValue(newValue);
2101
2138
  if (this.viewOnly) {
2102
2139
  this.dataValue = newValue;
@@ -2129,7 +2166,7 @@ class Component extends Element_1.default {
2129
2166
  component: newComponent,
2130
2167
  result,
2131
2168
  }, 'value');
2132
- if (!lodash_1.default.isEqual(oldValue, newValue) && !(this.component.clearOnHide && this.conditionallyHidden())) {
2169
+ if (!lodash_1.default.isEqual(oldValue, newValue) && !this.shouldConditionallyClear()) {
2133
2170
  this.setValue(newValue);
2134
2171
  if (this.viewOnly) {
2135
2172
  this.dataValue = newValue;
@@ -2235,7 +2272,7 @@ class Component extends Element_1.default {
2235
2272
  clearComponentOnHide() {
2236
2273
  // clearOnHide defaults to true for old forms (without the value set) so only trigger if the value is false.
2237
2274
  if (this.component.clearOnHide !== false && !this.options.readOnly && !this.options.showHiddenFields) {
2238
- if (this.conditionallyHidden()) {
2275
+ if (this.shouldConditionallyClear()) {
2239
2276
  this.deleteValue();
2240
2277
  }
2241
2278
  else if (!this.hasValue() && this.shouldAddDefaultValue) {
@@ -2552,16 +2589,30 @@ class Component extends Element_1.default {
2552
2589
  }
2553
2590
  getCustomDefaultValue(defaultValue) {
2554
2591
  if (this.component.customDefaultValue && !this.options.preview) {
2555
- const customDefaultValue = this.evaluate(this.component.customDefaultValue, { value: '' }, 'value');
2556
- if (this.shouldSetCustomDefault) {
2557
- defaultValue = customDefaultValue;
2558
- }
2592
+ defaultValue = this.evaluate(this.component.customDefaultValue, { value: this.dataValue }, 'value');
2559
2593
  }
2560
2594
  return defaultValue;
2561
2595
  }
2596
+ /**
2597
+ * Returns if a component has a default value set.
2598
+ * @returns {boolean} - TRUE if a default value is set.
2599
+ */
2600
+ get hasDefaultValue() {
2601
+ return this.component.customDefaultValue || (this.component.hasOwnProperty('defaultValue') &&
2602
+ (this.component.defaultValue !== null) &&
2603
+ (this.component.defaultValue !== undefined));
2604
+ }
2605
+ /**
2606
+ * Determine if we should add a default value for this component.
2607
+ * @returns {boolean} - TRUE if a default value should be set
2608
+ */
2562
2609
  get shouldAddDefaultValue() {
2563
- return !this.options.noDefaults || (this.component.defaultValue && !this.isEmpty(this.component.defaultValue)) || this.component.customDefaultValue;
2610
+ return this.pristine && this.allowData && (this.hasDefaultValue || !this.options.noDefaults);
2564
2611
  }
2612
+ /**
2613
+ * Get the default value of this component.
2614
+ * @returns {*} - The default value for this component.
2615
+ */
2565
2616
  get defaultValue() {
2566
2617
  let defaultValue = this.emptyValue;
2567
2618
  if (this.component.defaultValue) {
@@ -2573,7 +2624,7 @@ class Component extends Element_1.default {
2573
2624
  if (this.component.type !== 'textfield') {
2574
2625
  const placeholderChar = this.placeholderChar;
2575
2626
  value = (0, vanilla_text_mask_1.conformToMask)(value, this.defaultMask, { placeholderChar }).conformedValue;
2576
- if (!FormioUtils.matchInputMask(value, this.defaultMask)) {
2627
+ if (!utils_1.default.matchInputMask(value, this.defaultMask)) {
2577
2628
  value = '';
2578
2629
  }
2579
2630
  }
@@ -2639,13 +2690,16 @@ class Component extends Element_1.default {
2639
2690
  }
2640
2691
  const isArray = Array.isArray(value);
2641
2692
  const valueInput = this.refs.fileLink || this.refs.input;
2693
+ const isFilelink = !!this.refs.fileLink;
2642
2694
  if (isArray &&
2643
2695
  Array.isArray(this.defaultValue) &&
2644
2696
  this.refs.hasOwnProperty('input') &&
2645
2697
  valueInput &&
2646
2698
  (valueInput.length !== value.length) &&
2647
2699
  this.visible) {
2648
- this.redraw();
2700
+ if (isFilelink || valueInput.length) {
2701
+ this.redraw();
2702
+ }
2649
2703
  }
2650
2704
  if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
2651
2705
  this.redraw();
@@ -2815,7 +2869,7 @@ class Component extends Element_1.default {
2815
2869
  }
2816
2870
  doValueCalculation(dataValue, data, row) {
2817
2871
  var _a;
2818
- const calculatedValue = this.evaluate(this.component.calculateValue, {
2872
+ return this.evaluate(this.component.calculateValue, {
2819
2873
  value: dataValue,
2820
2874
  data,
2821
2875
  row: row || this.data,
@@ -2823,10 +2877,6 @@ class Component extends Element_1.default {
2823
2877
  data: this.rootValue
2824
2878
  }
2825
2879
  }, 'value');
2826
- if (this.shouldSetCalculatedValue) {
2827
- return calculatedValue;
2828
- }
2829
- return dataValue;
2830
2880
  }
2831
2881
  /* eslint-disable max-statements */
2832
2882
  calculateComponentValue(data, flags, row) {
@@ -2836,10 +2886,8 @@ class Component extends Element_1.default {
2836
2886
  }
2837
2887
  // If no calculated value or
2838
2888
  // hidden and set to clearOnHide (Don't calculate a value for a hidden field set to clear when hidden)
2839
- const { clearOnHide } = this.component;
2840
- const shouldBeCleared = this.conditionallyHidden() && clearOnHide;
2841
2889
  const allowOverride = lodash_1.default.get(this.component, 'allowCalculateOverride', false);
2842
- if (shouldBeCleared) {
2890
+ if (this.shouldConditionallyClear()) {
2843
2891
  // remove calculated value so that the value is recalculated once component becomes visible
2844
2892
  if (this.hasOwnProperty('calculatedValue') && allowOverride) {
2845
2893
  lodash_1.default.unset(this, 'calculatedValue');
@@ -2897,7 +2945,7 @@ class Component extends Element_1.default {
2897
2945
  }
2898
2946
  if (fromSubmission) {
2899
2947
  // If we set value from submission and it differs from calculated one, set the calculated value to prevent overriding dataValue in the next pass
2900
- this.calculatedValue = (0, utils_1.fastCloneDeep)(calculatedValue);
2948
+ this.calculatedValue = (0, utils_2.fastCloneDeep)(calculatedValue);
2901
2949
  return false;
2902
2950
  }
2903
2951
  // If this is the firstPass, and the dataValue is different than to the calculatedValue.
@@ -2906,7 +2954,7 @@ class Component extends Element_1.default {
2906
2954
  return true;
2907
2955
  }
2908
2956
  }
2909
- this.calculatedValue = (0, utils_1.fastCloneDeep)(calculatedValue);
2957
+ this.calculatedValue = (0, utils_2.fastCloneDeep)(calculatedValue);
2910
2958
  if (changed) {
2911
2959
  if (!flags.noPristineChangeOnModified && this.root.initialized) {
2912
2960
  this.pristine = false;
@@ -2960,12 +3008,14 @@ class Component extends Element_1.default {
2960
3008
  * @param {boolean} dirty - If the component is dirty.
2961
3009
  * @param {boolean} ignoreCondition - If conditions for the component should be ignored when checking validity.
2962
3010
  * @param {*} row - Contextual row data for this component.
3011
+ * @param {*} options - Additional options for validation.
2963
3012
  * @returns {string} - The message to show when the component is invalid.
2964
3013
  */
2965
- invalidMessage(data, dirty, ignoreCondition, row) {
3014
+ invalidMessage(data, dirty, ignoreCondition, row, options = {}) {
2966
3015
  var _a;
3016
+ const { local } = options;
2967
3017
  if (!row) {
2968
- row = (0, utils_1.getContextualRowData)(this.component, data, this.paths);
3018
+ row = (0, utils_2.getContextualRowData)(this.component, data, this.paths);
2969
3019
  }
2970
3020
  if (!ignoreCondition && !this.checkCondition(row, data)) {
2971
3021
  return '';
@@ -2983,6 +3033,7 @@ class Component extends Element_1.default {
2983
3033
  component: this.component,
2984
3034
  data,
2985
3035
  row,
3036
+ local,
2986
3037
  path: this.path || this.component.key,
2987
3038
  parent: (_a = this.parent) === null || _a === void 0 ? void 0 : _a.component,
2988
3039
  paths: this.paths,
@@ -2993,7 +3044,7 @@ class Component extends Element_1.default {
2993
3044
  ]
2994
3045
  });
2995
3046
  const errors = validationScope.errors;
2996
- const interpolatedErrors = FormioUtils.interpolateErrors(this.component, errors, this.t.bind(this));
3047
+ const interpolatedErrors = utils_1.default.interpolateErrors(this.component, errors, this.t.bind(this));
2997
3048
  return lodash_1.default.map(interpolatedErrors, 'message').join('\n\n');
2998
3049
  }
2999
3050
  /**
@@ -3024,7 +3075,7 @@ class Component extends Element_1.default {
3024
3075
  */
3025
3076
  interpolateErrors(errors) {
3026
3077
  var _a;
3027
- const interpolatedErrors = FormioUtils.interpolateErrors(this.component, errors, this.t.bind(this));
3078
+ const interpolatedErrors = utils_1.default.interpolateErrors(this.component, errors, this.t.bind(this));
3028
3079
  return ((_a = this.serverErrors) === null || _a === void 0 ? void 0 : _a.length) ? [...interpolatedErrors, ...this.serverErrors] : interpolatedErrors;
3029
3080
  }
3030
3081
  /**
@@ -3159,19 +3210,29 @@ class Component extends Element_1.default {
3159
3210
  data = data || this.rootValue;
3160
3211
  flags = flags || {};
3161
3212
  row = row || this.data;
3213
+ if (flags.noCheck) {
3214
+ return true;
3215
+ }
3216
+ // Some components (for legacy reasons) have calls to "checkData" in inappropriate places such
3217
+ // as setValue. Historically, this was bypassed by a series of cached states around the data model
3218
+ // which caused its own problems. We need to ensure that premium and custom components do not fall into
3219
+ // an infinite loop by only checking this component once.
3220
+ if (this.checkingData) {
3221
+ return;
3222
+ }
3223
+ this.checkingData = true;
3162
3224
  // Needs for Nextgen Rules Engine
3163
3225
  this.resetCaches();
3164
3226
  // Do not trigger refresh if change was triggered on blur event since components with Refresh on Blur have their own listeners
3165
3227
  if (!flags.fromBlur) {
3166
3228
  this.checkRefreshOn(flags.changes, flags);
3167
3229
  }
3168
- if (flags.noCheck) {
3169
- return true;
3170
- }
3171
3230
  this.checkComponentConditions(data, flags, row);
3172
3231
  if (this.id !== flags.triggeredComponentId) {
3173
3232
  this.calculateComponentValue(data, flags, row);
3174
3233
  }
3234
+ // We are done checking data.
3235
+ this.checkingData = false;
3175
3236
  }
3176
3237
  checkModal(errors = [], dirty = false) {
3177
3238
  const messages = errors.filter(error => !error.fromServer);
@@ -3234,7 +3295,7 @@ class Component extends Element_1.default {
3234
3295
  }
3235
3296
  });
3236
3297
  this.addEventListener(element, 'blur', () => {
3237
- this.root.pendingBlur = FormioUtils.delay(() => {
3298
+ this.root.pendingBlur = utils_1.default.delay(() => {
3238
3299
  this.emit('blur', this);
3239
3300
  if (this.component.validateOn === 'blur') {
3240
3301
  this.root.triggerChange({ fromBlur: true }, {
@@ -3482,7 +3543,7 @@ class Component extends Element_1.default {
3482
3543
  if (logic.trigger.type === 'event') {
3483
3544
  const event = this.interpolate(logic.trigger.event);
3484
3545
  this.on(event, (...args) => {
3485
- const newComponent = (0, utils_1.fastCloneDeep)(this.originalComponent);
3546
+ const newComponent = (0, utils_2.fastCloneDeep)(this.originalComponent);
3486
3547
  if (this.applyActions(newComponent, logic.actions, args)) {
3487
3548
  // If component definition changed, replace it.
3488
3549
  if (!lodash_1.default.isEqual(this.component, newComponent)) {
@@ -3617,7 +3678,7 @@ Component.requireLibrary = function (name, property, src, polling) {
3617
3678
  }.bind(Component.externalLibraries[name]);
3618
3679
  }
3619
3680
  // See if the plugin already exists.
3620
- const plugin = (0, utils_1.getScriptPlugin)(property);
3681
+ const plugin = (0, utils_2.getScriptPlugin)(property);
3621
3682
  if (plugin) {
3622
3683
  Component.externalLibraries[name].resolve(plugin);
3623
3684
  }
@@ -3660,7 +3721,7 @@ Component.requireLibrary = function (name, property, src, polling) {
3660
3721
  // if no callback is provided, then check periodically for the script.
3661
3722
  if (polling) {
3662
3723
  setTimeout(function checkLibrary() {
3663
- const plugin = (0, utils_1.getScriptPlugin)(property);
3724
+ const plugin = (0, utils_2.getScriptPlugin)(property);
3664
3725
  if (plugin) {
3665
3726
  Component.externalLibraries[name].resolve(plugin);
3666
3727
  }
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const utils_1 = __importDefault(require("./utils"));
7
- const utils_2 = require("../../../../utils/utils");
7
+ const utils_2 = require("../../../../utils");
8
8
  /* eslint-disable quotes, max-len */
9
9
  exports.default = [
10
10
  {
@@ -81,6 +81,25 @@ exports.default = [
81
81
  }
82
82
  ]
83
83
  },
84
+ {
85
+ name: 'hide',
86
+ trigger: {
87
+ type: 'javascript',
88
+ javascript: 'result = instance.root.options.editJson === false;'
89
+ },
90
+ actions: [
91
+ {
92
+ name: 'hide',
93
+ type: 'property',
94
+ property: {
95
+ label: 'Hidden',
96
+ value: 'hidden',
97
+ type: 'boolean'
98
+ },
99
+ state: true
100
+ }
101
+ ]
102
+ },
84
103
  {
85
104
  name: 'disabledToolTip',
86
105
  trigger: {
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const utils_1 = __importDefault(require("./utils"));
7
- const utils_2 = require("../../../../utils/utils");
7
+ const utils_2 = require("../../../../utils");
8
8
  /* eslint-disable quotes, max-len */
9
9
  exports.default = [
10
10
  {
@@ -11,7 +11,7 @@ const EditFormUtils = {
11
11
  },
12
12
  unifyComponents(objValue, srcValue) {
13
13
  if (objValue.key && srcValue.key) {
14
- if (objValue.skipMerge || srcValue.skipMerge) {
14
+ if ((objValue.skipMerge || srcValue.skipMerge) && !objValue.ignore) {
15
15
  return false;
16
16
  }
17
17
  if (objValue.key === srcValue.key) {
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
- const utils_1 = require("../../../utils/utils");
7
+ const utils_1 = require("../../../utils");
8
8
  class ComponentModal {
9
9
  static render(component, data, topLevel) {
10
10
  const children = component.renderTemplate('component', data, topLevel);
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Multivalue_1 = __importDefault(require("../multivalue/Multivalue"));
7
- const utils_1 = require("../../../utils/utils");
7
+ const utils_1 = require("../../../utils");
8
8
  const widgets_1 = __importDefault(require("../../../widgets"));
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  class Input extends Multivalue_1.default {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Field_1 = __importDefault(require("../field/Field"));
7
7
  const Formio_1 = require("../../../Formio");
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
- const utils_1 = require("../../../utils/utils");
9
+ const utils_1 = require("../../../utils");
10
10
  class ListComponent extends Field_1.default {
11
11
  static schema(...extend) {
12
12
  return Field_1.default.schema({
@@ -29,9 +29,9 @@ class ListComponent extends Field_1.default {
29
29
  get dataReady() {
30
30
  // If the root submission has been set, and we are still not attached, then assume
31
31
  // that our data is ready.
32
- if (this.root &&
32
+ if ((this.root &&
33
33
  this.root.submissionSet &&
34
- !this.attached) {
34
+ !this.attached) || !this.visible) {
35
35
  return Promise.resolve();
36
36
  }
37
37
  return this.itemsLoaded;