@formio/js 5.1.0-dev.6109.79f22ad → 5.1.0-dev.6112.1314654

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 (180) hide show
  1. package/README.md +7 -0
  2. package/dist/formio.builder.css +1 -0
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.form.css +1 -0
  5. package/dist/formio.form.js +119 -152
  6. package/dist/formio.form.min.css +1 -1
  7. package/dist/formio.form.min.js +1 -1
  8. package/dist/formio.full.css +1 -0
  9. package/dist/formio.full.js +126 -159
  10. package/dist/formio.full.min.css +1 -1
  11. package/dist/formio.full.min.js +1 -1
  12. package/dist/formio.js +66 -55
  13. package/dist/formio.min.js +1 -1
  14. package/dist/formio.utils.js +76 -76
  15. package/dist/formio.utils.min.js +1 -1
  16. package/lib/cjs/Element.d.ts +2 -1
  17. package/lib/cjs/Element.js +18 -39
  18. package/lib/cjs/EventEmitter.js +2 -25
  19. package/lib/cjs/Form.js +2 -25
  20. package/lib/cjs/PDF.js +1 -1
  21. package/lib/cjs/PDFBuilder.d.ts +1 -0
  22. package/lib/cjs/PDFBuilder.js +10 -11
  23. package/lib/cjs/Webform.d.ts +2 -2
  24. package/lib/cjs/Webform.js +10 -10
  25. package/lib/cjs/WebformBuilder.d.ts +1 -1
  26. package/lib/cjs/WebformBuilder.js +45 -21
  27. package/lib/cjs/Wizard.d.ts +1 -2
  28. package/lib/cjs/Wizard.js +18 -24
  29. package/lib/cjs/WizardBuilder.js +1 -1
  30. package/lib/cjs/components/Components.js +7 -1
  31. package/lib/cjs/components/_classes/component/Component.d.ts +0 -1
  32. package/lib/cjs/components/_classes/component/Component.js +70 -64
  33. package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
  34. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +7 -0
  35. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +1 -0
  36. package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
  37. package/lib/cjs/components/_classes/componentModal/ComponentModal.js +1 -1
  38. package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
  39. package/lib/cjs/components/_classes/input/Input.js +3 -3
  40. package/lib/cjs/components/_classes/list/ListComponent.js +1 -1
  41. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +1 -0
  42. package/lib/cjs/components/_classes/nested/NestedComponent.js +19 -9
  43. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  44. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
  45. package/lib/cjs/components/address/Address.js +2 -2
  46. package/lib/cjs/components/alert/Alert.js +1 -1
  47. package/lib/cjs/components/button/Button.js +1 -1
  48. package/lib/cjs/components/checkbox/Checkbox.js +1 -1
  49. package/lib/cjs/components/container/Container.js +1 -1
  50. package/lib/cjs/components/currency/Currency.js +1 -1
  51. package/lib/cjs/components/datagrid/DataGrid.js +5 -1
  52. package/lib/cjs/components/datamap/DataMap.js +7 -2
  53. package/lib/cjs/components/datetime/DateTime.d.ts +1 -1
  54. package/lib/cjs/components/datetime/DateTime.js +15 -13
  55. package/lib/cjs/components/day/Day.js +2 -2
  56. package/lib/cjs/components/editgrid/EditGrid.d.ts +0 -1
  57. package/lib/cjs/components/editgrid/EditGrid.js +1 -9
  58. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  59. package/lib/cjs/components/fieldset/Fieldset.js +1 -0
  60. package/lib/cjs/components/file/File.js +1 -1
  61. package/lib/cjs/components/form/Form.js +14 -2
  62. package/lib/cjs/components/form/editForm/Form.edit.form.js +4 -3
  63. package/lib/cjs/components/number/Number.js +1 -1
  64. package/lib/cjs/components/panel/Panel.js +1 -1
  65. package/lib/cjs/components/radio/Radio.d.ts +9 -0
  66. package/lib/cjs/components/radio/Radio.js +20 -10
  67. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
  68. package/lib/cjs/components/select/Select.js +7 -3
  69. package/lib/cjs/components/select/editForm/Select.edit.data.js +1 -1
  70. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +6 -0
  71. package/lib/cjs/components/selectboxes/SelectBoxes.js +1 -1
  72. package/lib/cjs/components/signature/Signature.js +1 -1
  73. package/lib/cjs/components/survey/Survey.js +1 -1
  74. package/lib/cjs/components/tags/Tags.js +1 -1
  75. package/lib/cjs/components/textarea/TextArea.js +9 -4
  76. package/lib/cjs/components/textfield/TextField.js +13 -31
  77. package/lib/cjs/components/time/Time.js +1 -1
  78. package/lib/cjs/formio.form.js +5 -5
  79. package/lib/cjs/providers/storage/uploadAdapter.js +1 -1
  80. package/lib/cjs/providers/storage/url.js +7 -3
  81. package/lib/cjs/translations/en.d.ts +1 -232
  82. package/lib/cjs/translations/en.js +4 -2
  83. package/lib/cjs/utils/Evaluator.d.ts +20 -6
  84. package/lib/cjs/utils/Evaluator.js +38 -15
  85. package/lib/cjs/utils/builder.js +5 -5
  86. package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
  87. package/lib/cjs/utils/formUtils.d.ts +2 -2
  88. package/lib/cjs/utils/index.d.ts +169 -2
  89. package/lib/cjs/utils/index.js +22 -2
  90. package/lib/cjs/utils/utils.d.ts +22 -37
  91. package/lib/cjs/utils/utils.js +63 -138
  92. package/lib/cjs/widgets/CalendarWidget.d.ts +1 -8
  93. package/lib/cjs/widgets/CalendarWidget.js +17 -43
  94. package/lib/mjs/Element.d.ts +2 -1
  95. package/lib/mjs/Element.js +11 -9
  96. package/lib/mjs/EventEmitter.js +2 -2
  97. package/lib/mjs/Form.js +1 -1
  98. package/lib/mjs/PDF.js +1 -1
  99. package/lib/mjs/PDFBuilder.d.ts +1 -0
  100. package/lib/mjs/PDFBuilder.js +9 -10
  101. package/lib/mjs/Webform.d.ts +2 -2
  102. package/lib/mjs/Webform.js +8 -8
  103. package/lib/mjs/WebformBuilder.d.ts +1 -1
  104. package/lib/mjs/WebformBuilder.js +36 -13
  105. package/lib/mjs/Wizard.d.ts +1 -2
  106. package/lib/mjs/Wizard.js +17 -23
  107. package/lib/mjs/WizardBuilder.js +1 -1
  108. package/lib/mjs/components/Components.js +7 -1
  109. package/lib/mjs/components/_classes/component/Component.d.ts +0 -1
  110. package/lib/mjs/components/_classes/component/Component.js +42 -13
  111. package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
  112. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +7 -0
  113. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +1 -0
  114. package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
  115. package/lib/mjs/components/_classes/componentModal/ComponentModal.js +1 -1
  116. package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
  117. package/lib/mjs/components/_classes/input/Input.js +3 -3
  118. package/lib/mjs/components/_classes/list/ListComponent.js +1 -1
  119. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +1 -0
  120. package/lib/mjs/components/_classes/nested/NestedComponent.js +19 -9
  121. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  122. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
  123. package/lib/mjs/components/address/Address.js +2 -2
  124. package/lib/mjs/components/alert/Alert.js +1 -1
  125. package/lib/mjs/components/button/Button.js +1 -1
  126. package/lib/mjs/components/checkbox/Checkbox.js +1 -1
  127. package/lib/mjs/components/container/Container.js +1 -1
  128. package/lib/mjs/components/currency/Currency.js +1 -1
  129. package/lib/mjs/components/datagrid/DataGrid.js +5 -1
  130. package/lib/mjs/components/datamap/DataMap.js +7 -2
  131. package/lib/mjs/components/datetime/DateTime.d.ts +1 -1
  132. package/lib/mjs/components/datetime/DateTime.js +15 -13
  133. package/lib/mjs/components/day/Day.js +2 -2
  134. package/lib/mjs/components/editgrid/EditGrid.d.ts +0 -1
  135. package/lib/mjs/components/editgrid/EditGrid.js +1 -9
  136. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  137. package/lib/mjs/components/fieldset/Fieldset.js +1 -0
  138. package/lib/mjs/components/file/File.js +1 -1
  139. package/lib/mjs/components/form/Form.js +13 -2
  140. package/lib/mjs/components/form/editForm/Form.edit.form.js +3 -2
  141. package/lib/mjs/components/number/Number.js +1 -1
  142. package/lib/mjs/components/panel/Panel.js +1 -1
  143. package/lib/mjs/components/radio/Radio.d.ts +9 -0
  144. package/lib/mjs/components/radio/Radio.js +20 -10
  145. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
  146. package/lib/mjs/components/select/Select.js +7 -3
  147. package/lib/mjs/components/select/editForm/Select.edit.data.js +1 -1
  148. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +6 -0
  149. package/lib/mjs/components/selectboxes/SelectBoxes.js +1 -1
  150. package/lib/mjs/components/signature/Signature.js +1 -1
  151. package/lib/mjs/components/survey/Survey.js +1 -1
  152. package/lib/mjs/components/tags/Tags.js +1 -1
  153. package/lib/mjs/components/textarea/TextArea.js +9 -4
  154. package/lib/mjs/components/textfield/TextField.js +7 -2
  155. package/lib/mjs/components/time/Time.js +1 -1
  156. package/lib/mjs/formio.form.js +3 -3
  157. package/lib/mjs/providers/storage/uploadAdapter.js +1 -1
  158. package/lib/mjs/providers/storage/url.js +7 -3
  159. package/lib/mjs/translations/en.d.ts +1 -232
  160. package/lib/mjs/translations/en.js +8 -47
  161. package/lib/mjs/utils/Evaluator.d.ts +20 -6
  162. package/lib/mjs/utils/Evaluator.js +31 -13
  163. package/lib/mjs/utils/builder.js +1 -1
  164. package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
  165. package/lib/mjs/utils/formUtils.d.ts +2 -2
  166. package/lib/mjs/utils/index.d.ts +169 -2
  167. package/lib/mjs/utils/index.js +18 -1
  168. package/lib/mjs/utils/utils.d.ts +22 -37
  169. package/lib/mjs/utils/utils.js +57 -113
  170. package/lib/mjs/widgets/CalendarWidget.d.ts +1 -8
  171. package/lib/mjs/widgets/CalendarWidget.js +17 -43
  172. package/package.json +5 -3
  173. package/lib/cjs/i18n.d.ts +0 -13
  174. package/lib/cjs/i18n.js +0 -19
  175. package/lib/cjs/utils/i18n.d.ts +0 -19
  176. package/lib/cjs/utils/i18n.js +0 -120
  177. package/lib/mjs/i18n.d.ts +0 -13
  178. package/lib/mjs/i18n.js +0 -14
  179. package/lib/mjs/utils/i18n.d.ts +0 -19
  180. package/lib/mjs/utils/i18n.js +0 -112
@@ -7,7 +7,7 @@ const lodash_1 = __importDefault(require("lodash"));
7
7
  const Formio_1 = require("../../Formio");
8
8
  const ListComponent_1 = __importDefault(require("../_classes/list/ListComponent"));
9
9
  const Form_1 = __importDefault(require("../../Form"));
10
- const utils_1 = require("../../utils/utils");
10
+ const utils_1 = require("../../utils");
11
11
  const ChoicesWrapper_1 = __importDefault(require("../../utils/ChoicesWrapper"));
12
12
  class SelectComponent extends ListComponent_1.default {
13
13
  static schema(...extend) {
@@ -915,8 +915,9 @@ class SelectComponent extends ListComponent_1.default {
915
915
  });
916
916
  }
917
917
  // Add value options.
918
+ const value = this.undoValueTyping(this.dataValue);
918
919
  this.addValueOptions();
919
- this.setChoicesValue(this.dataValue);
920
+ this.setChoicesValue(value);
920
921
  if (this.isSelectResource && this.refs.addResource) {
921
922
  this.addEventListener(this.refs.addResource, 'click', (event) => {
922
923
  event.preventDefault();
@@ -1231,7 +1232,7 @@ class SelectComponent extends ListComponent_1.default {
1231
1232
  }
1232
1233
  lodash_1.default.set(submission.metadata.selectData, this.path, templateData);
1233
1234
  }
1234
- if (flags.resetValue && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submission) && !this.options.readOnly) {
1235
+ if (flags.resetValue && !flags.fromSubmission && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submission) && !this.options.readOnly) {
1235
1236
  const submission = this.root.submission;
1236
1237
  if (!submission.metadata) {
1237
1238
  submission.metadata = {};
@@ -1295,6 +1296,9 @@ class SelectComponent extends ListComponent_1.default {
1295
1296
  this.lazyLoadInit = true;
1296
1297
  const searchProperty = this.component.searchField || this.component.valueProperty;
1297
1298
  this.triggerUpdate(lodash_1.default.get(value.data || value, searchProperty, value), true);
1299
+ this.itemsLoaded.then(() => {
1300
+ this.setChoicesValue(value, hasPreviousValue, flags);
1301
+ });
1298
1302
  return changed;
1299
1303
  }
1300
1304
  // Add the value options.
@@ -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
  const calculateSingleSelectData = (context, defaultValue) => {
9
9
  const { instance, data } = context;
10
10
  const rawDefaultValue = instance.downloadedResources.find(resource => lodash_1.default.get(resource, data.valueProperty) === defaultValue);
@@ -8,6 +8,12 @@ export default class SelectBoxesComponent extends RadioComponent {
8
8
  * @returns {boolean} - If the value is empty.
9
9
  */
10
10
  isEmpty(value?: any): boolean;
11
+ /**
12
+ * Normalize values coming into updateValue.
13
+ * @param {any} value - The value to normalize.
14
+ * @returns {*} - The normalized value
15
+ */
16
+ normalizeValue(value: any): any;
11
17
  setInputsDisabled(value: any, onlyUnchecked: any): void;
12
18
  checkComponentValidity(data: any, dirty: any, rowData: any, options: any, errors?: any[]): boolean;
13
19
  }
@@ -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
  const Radio_1 = __importDefault(require("../radio/Radio"));
9
9
  class SelectBoxesComponent extends Radio_1.default {
10
10
  static schema(...extend) {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const signature_pad_1 = __importDefault(require("signature_pad"));
7
7
  const Input_1 = __importDefault(require("../_classes/input/Input"));
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
- const utils_1 = require("../../utils/utils");
9
+ const utils_1 = require("../../utils");
10
10
  class SignatureComponent extends Input_1.default {
11
11
  static schema(...extend) {
12
12
  return Input_1.default.schema({
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const Field_1 = __importDefault(require("../_classes/field/Field"));
8
- const utils_1 = require("../../utils/utils");
8
+ const utils_1 = require("../../utils");
9
9
  class SurveyComponent extends Field_1.default {
10
10
  static schema(...extend) {
11
11
  return Field_1.default.schema({
@@ -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
- const utils_1 = require("../../utils/utils");
6
+ const utils_1 = require("../../utils");
7
7
  const Input_1 = __importDefault(require("../_classes/input/Input"));
8
8
  const choices_js_1 = __importDefault(require("choices.js"));
9
9
  class TagsComponent extends Input_1.default {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  /* global Quill */
7
7
  const TextField_1 = __importDefault(require("../textfield/TextField"));
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
- const utils_1 = require("../../utils/utils");
9
+ const utils_1 = require("../../utils");
10
10
  class TextAreaComponent extends TextField_1.default {
11
11
  static schema(...extend) {
12
12
  return TextField_1.default.schema({
@@ -63,8 +63,8 @@ class TextAreaComponent extends TextField_1.default {
63
63
  if ((this.options.readOnly || this.disabled) && !this.isHtmlRenderMode()) {
64
64
  const elementStyle = this.info.attr.style || '';
65
65
  const children = `
66
- <div ${this._referenceAttributeName}="input"
67
- class="formio-editor-read-only-content"
66
+ <div ${this._referenceAttributeName}="input"
67
+ class="formio-editor-read-only-content"
68
68
  ${elementStyle ? `style='${elementStyle}'` : ''}
69
69
  role="textbox"
70
70
  aria-multiline="true"
@@ -193,7 +193,12 @@ class TextAreaComponent extends TextField_1.default {
193
193
  const editorHeight = (numRows * 31) + 14;
194
194
  editor.ui.view.editable.editableElement.style.height = `${(editorHeight)}px`;
195
195
  }
196
- editor.isReadOnly = isReadOnly;
196
+ if (isReadOnly) {
197
+ editor.enableReadOnlyMode(this.id);
198
+ }
199
+ else {
200
+ editor.disableReadOnlyMode(this.id);
201
+ }
197
202
  editor.data.set(value);
198
203
  }
199
204
  editorReady(editor);
@@ -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 __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
@@ -29,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
6
  const Input_1 = __importDefault(require("../_classes/input/Input"));
30
7
  const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
31
8
  const inputmask_1 = __importDefault(require("inputmask"));
32
- const FormioUtils = __importStar(require("../../utils/utils"));
9
+ const utils_1 = __importDefault(require("../../utils"));
33
10
  const lodash_1 = __importDefault(require("lodash"));
34
11
  class TextFieldComponent extends Input_1.default {
35
12
  static schema(...extend) {
@@ -71,7 +48,7 @@ class TextFieldComponent extends Input_1.default {
71
48
  } });
72
49
  }
73
50
  static savedValueTypes(schema) {
74
- return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.string];
51
+ return utils_1.default.getComponentSavedTypes(schema) || [utils_1.default.componentValueTypes.string];
75
52
  }
76
53
  get defaultSchema() {
77
54
  return TextFieldComponent.schema();
@@ -104,7 +81,7 @@ class TextFieldComponent extends Input_1.default {
104
81
  displayInTimezone, locale: this.component.widget.locale || this.options.language, saveAs: 'text' });
105
82
  // update originalComponent to include widget settings after component initialization
106
83
  // originalComponent is used to restore the component (and widget) after evaluating field logic
107
- this.originalComponent = FormioUtils.fastCloneDeep(this.component);
84
+ this.originalComponent = utils_1.default.fastCloneDeep(this.component);
108
85
  }
109
86
  }
110
87
  attach(element) {
@@ -130,7 +107,12 @@ class TextFieldComponent extends Input_1.default {
130
107
  // If no value is provided, then set the defaultValue.
131
108
  if (!value.value) {
132
109
  const defaultValue = flags.noDefault ? this.emptyValue : this.defaultValue;
133
- value.value = Array.isArray(defaultValue) ? defaultValue[0] : defaultValue;
110
+ if (Array.isArray(defaultValue)) {
111
+ value.value = lodash_1.default.isObject(defaultValue[0]) ? defaultValue[0].value : defaultValue;
112
+ }
113
+ else {
114
+ value.value = lodash_1.default.isObject(defaultValue) ? defaultValue.value : defaultValue;
115
+ }
134
116
  }
135
117
  return value;
136
118
  }
@@ -175,7 +157,7 @@ class TextFieldComponent extends Input_1.default {
175
157
  }
176
158
  else {
177
159
  const placeholderChar = this.placeholderChar;
178
- textInput.value = (0, vanilla_text_mask_1.conformToMask)(textValue, FormioUtils.getInputMask(mask), { placeholderChar }).conformedValue;
160
+ textInput.value = (0, vanilla_text_mask_1.conformToMask)(textValue, utils_1.default.getInputMask(mask), { placeholderChar }).conformedValue;
179
161
  }
180
162
  }
181
163
  else {
@@ -183,8 +165,8 @@ class TextFieldComponent extends Input_1.default {
183
165
  }
184
166
  }
185
167
  unmaskValue(value, format = this.component.displayMask) {
186
- const mask = FormioUtils.getInputMask(format, this.placeholderChar);
187
- return FormioUtils.unmaskValue(value, mask, this.placeholderChar);
168
+ const mask = utils_1.default.getInputMask(format, this.placeholderChar);
169
+ return utils_1.default.unmaskValue(value, mask, this.placeholderChar);
188
170
  }
189
171
  /**
190
172
  * Returns the value at this index.
@@ -245,7 +227,7 @@ class TextFieldComponent extends Input_1.default {
245
227
  return;
246
228
  }
247
229
  inputMask = inputMask || this.component.displayMask || this.component.inputMask;
248
- const mask = FormioUtils.getInputMask(inputMask, this.placeholderChar);
230
+ const mask = utils_1.default.getInputMask(inputMask, this.placeholderChar);
249
231
  this.defaultMask = mask;
250
232
  if (input && inputMask) {
251
233
  try {
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const moment_1 = __importDefault(require("moment"));
7
7
  const TextField_1 = __importDefault(require("../textfield/TextField"));
8
- const utils_1 = require("../../utils/utils");
8
+ const utils_1 = require("../../utils");
9
9
  const defaultDataFormat = 'HH:mm:ss';
10
10
  class TimeComponent extends TextField_1.default {
11
11
  static schema(...extend) {
@@ -22,14 +22,14 @@ const Form_1 = __importDefault(require("./Form"));
22
22
  exports.Form = Form_1.default;
23
23
  const utils_1 = __importDefault(require("./utils"));
24
24
  exports.Utils = utils_1.default;
25
- const Evaluator_1 = require("./utils/Evaluator");
26
25
  const licenses_1 = __importDefault(require("./licenses"));
27
26
  exports.Licenses = licenses_1.default;
28
27
  const EventEmitter_1 = __importDefault(require("./EventEmitter"));
29
28
  exports.EventEmitter = EventEmitter_1.default;
30
29
  const Webform_1 = __importDefault(require("./Webform"));
31
30
  exports.Webform = Webform_1.default;
32
- const i18n_1 = require("./utils/i18n");
31
+ const core_1 = require("@formio/core");
32
+ const utils_2 = require("./utils");
33
33
  Formio_1.Formio.loadModules = (path = `${Formio_1.Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {
34
34
  Formio_1.Formio.requireLibrary(name, name, path, true)
35
35
  .then((modules) => {
@@ -45,7 +45,7 @@ Formio_1.Formio.Form = Form_1.default;
45
45
  Formio_1.Formio.Displays = Displays_1.default;
46
46
  Formio_1.Formio.Providers = providers_1.default;
47
47
  Formio_1.Formio.Widgets = widgets_1.default;
48
- Formio_1.Formio.Evaluator = Evaluator_1.Evaluator;
48
+ Formio_1.Formio.Evaluator = utils_2.Evaluator;
49
49
  Formio_1.Formio.AllComponents = components_1.default;
50
50
  Formio_1.Formio.Licenses = licenses_1.default;
51
51
  // This is strange, but is needed for "premium" components to import correctly.
@@ -100,10 +100,10 @@ function registerModule(mod, defaultFn = null, options = {}) {
100
100
  Formio_1.Formio.Displays.addDisplays(mod.displays);
101
101
  break;
102
102
  case 'evaluator':
103
- Formio_1.Formio.Evaluator.registerEvaluator(mod.evaluator);
103
+ (0, utils_2.registerEvaluator)(mod.evaluator);
104
104
  break;
105
105
  case 'translations':
106
- i18n_1.I18n.setDefaultTranslations(mod.translations);
106
+ core_1.I18n.setDefaultTranslations(mod.translations);
107
107
  break;
108
108
  case 'library':
109
109
  options.license
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getFormioUploadAdapterPlugin = void 0;
4
- const utils_1 = require("../../utils/utils");
4
+ const utils_1 = require("../../utils");
5
5
  /**
6
6
  * UploadAdapter for CKEditor https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html
7
7
  */
@@ -127,13 +127,17 @@ function url(formio) {
127
127
  deleteFile(fileInfo, options) {
128
128
  return new Promise((resolve, reject) => {
129
129
  const xhr = new XMLHttpRequest();
130
- xhr.open('DELETE', fileInfo.url, true);
130
+ xhr.open("DELETE", fileInfo.url, true);
131
+ const token = formio.getToken();
132
+ if (token) {
133
+ xhr.setRequestHeader("x-jwt-token", token);
134
+ }
131
135
  xhr.onload = () => {
132
136
  if (xhr.status >= 200 && xhr.status < 300) {
133
- resolve('File deleted');
137
+ resolve("File deleted");
134
138
  }
135
139
  else {
136
- reject(xhr.response || 'Unable to delete file');
140
+ reject(xhr.response || "Unable to delete file");
137
141
  }
138
142
  };
139
143
  if (options) {
@@ -1,233 +1,2 @@
1
- declare const _default: {
2
- unsavedRowsError: string;
3
- invalidRowsError: string;
4
- invalidRowError: string;
5
- invalidOption: string;
6
- invalidDay: string;
7
- complete: string;
8
- error: string;
9
- errorListHotkey: string;
10
- errorsListNavigationMessage: string;
11
- submitError: string;
12
- required: string;
13
- unique: string;
14
- array: string;
15
- array_nonempty: string;
16
- nonarray: string;
17
- select: string;
18
- pattern: string;
19
- minLength: string;
20
- maxLength: string;
21
- minWords: string;
22
- maxWords: string;
23
- min: string;
24
- max: string;
25
- maxDate: string;
26
- minDate: string;
27
- maxYear: string;
28
- minYear: string;
29
- minSelectedCount: string;
30
- maxSelectedCount: string;
31
- invalid_email: string;
32
- invalid_url: string;
33
- invalid_regex: string;
34
- invalid_date: string;
35
- invalid_day: string;
36
- invalidValueProperty: string;
37
- mask: string;
38
- valueIsNotAvailable: string;
39
- stripe: string;
40
- month: string;
41
- day: string;
42
- year: string;
43
- january: string;
44
- february: string;
45
- march: string;
46
- april: string;
47
- may: string;
48
- june: string;
49
- july: string;
50
- august: string;
51
- september: string;
52
- october: string;
53
- november: string;
54
- december: string;
55
- next: string;
56
- previous: string;
57
- cancel: string;
58
- submit: string;
59
- confirmCancel: string;
60
- saveDraftInstanceError: string;
61
- saveDraftAuthError: string;
62
- restoreDraftInstanceError: string;
63
- saveDraftError: string;
64
- restoreDraftError: string;
65
- time: string;
66
- cancelButtonAriaLabel: string;
67
- previousButtonAriaLabel: string;
68
- nextButtonAriaLabel: string;
69
- submitButtonAriaLabel: string;
70
- reCaptchaTokenValidationError: string;
71
- reCaptchaTokenNotSpecifiedError: string;
72
- apiKey: string;
73
- typeRemaining: string;
74
- typeCount: string;
75
- requiredDayField: string;
76
- requiredDayEmpty: string;
77
- requiredMonthField: string;
78
- requiredYearField: string;
79
- formNotReady: string;
80
- noFormElement: string;
81
- notUniqueKey: string;
82
- newFormSchema: string;
83
- missingUrl: string;
84
- urlNotAttachedToBtn: string;
85
- loadingProjectSettingsError: string;
86
- sessionStorageSupportError: string;
87
- builderUniqueError: string;
88
- pageNotFound: string;
89
- noDragInfoError: string;
90
- addonSupportTypeError: string;
91
- setPathError: string;
92
- calculatedPathDeprecation: string;
93
- unknownTemplate: string;
94
- unknownComponent: string;
95
- renderTemplateFunctionDeprecation: string;
96
- whenReadyDeprecation: string;
97
- loadResourcesError: string;
98
- noSelectDataConfiguration: string;
99
- indexedDBSupportError: string;
100
- caretPositionSavingError: string;
101
- iteratableRowsError: string;
102
- checkRowDeprecation: string;
103
- noOAuthBtn: string;
104
- noOAuthConfiguration: string;
105
- oAuthErrorsTitle: string;
106
- noOAuthFormUrl: string;
107
- oAuthStateError: string;
108
- componentInvalidRowValidation: string;
109
- videoPlayerNotFound: string;
110
- synchronizationFailed: string;
111
- fileWithDuplicatedNameInProgress: string;
112
- fileWithDuplicatedNameLoaded: string;
113
- nestedForm: string;
114
- noDataProvided: string;
115
- subformSubmissionLoadingError: string;
116
- noDelimiterSet: string;
117
- noSiteKey: string;
118
- failedToNormalize: string;
119
- failedToCompareItems: string;
120
- editorFocusError: string;
121
- quillImageUploadFailed: string;
122
- noFilesSelected: string;
123
- needConfigurationForQuill: string;
124
- waitPdfConverting: string;
125
- uploading: string;
126
- pasteBelow: string;
127
- copy: string;
128
- move: string;
129
- edit: string;
130
- editJson: string;
131
- remove: string;
132
- clickToSetValue: string;
133
- words: string;
134
- characters: string;
135
- addAnother: string;
136
- yes: string;
137
- no: string;
138
- wantToClearData: string;
139
- yesDelete: string;
140
- waitFileProcessing: string;
141
- wrongFileType: string;
142
- fileTooSmall: string;
143
- fileTooBig: string;
144
- noFileService: string;
145
- fileProcessingFailed: string;
146
- readyForUpload: string;
147
- readyForRemovingFromStorage: string;
148
- preparingFileToRemove: string;
149
- succefullyRemoved: string;
150
- succefullyUploaded: string;
151
- maxSelectItems: string;
152
- minSelectItems: string;
153
- clickToSign: string;
154
- surveyQuestion: string;
155
- surveyQuestionValue: string;
156
- success: string;
157
- noResultsFound: string;
158
- noChoices: string;
159
- typeToSearch: string;
160
- loading: string;
161
- help: string;
162
- component: string;
163
- save: string;
164
- preview: string;
165
- dragAndDropComponent: string;
166
- searchFields: string;
167
- noMatchesFound: string;
168
- fileName: string;
169
- size: string;
170
- type: string;
171
- gallery: string;
172
- camera: string;
173
- dropFilesToAttach: string;
174
- useCamera: string;
175
- browse: string;
176
- takePicture: string;
177
- switchToFileUpload: string;
178
- completeStatus: string;
179
- noStorageSet: string;
180
- noFileApiSupport: string;
181
- noFormDataSupport: string;
182
- noProgressSupport: string;
183
- close: string;
184
- addResource: string;
185
- autocomplete: string;
186
- showPreview: string;
187
- hidePreview: string;
188
- createPage: string;
189
- page: string;
190
- closeBtnDescription: string;
191
- cancelBtnDescription: string;
192
- saveBtnDescription: string;
193
- addOrRemove: string;
194
- anyFileTypesAllowed: string;
195
- allowedFileTypes: string;
196
- syncing: string;
197
- syncNow: string;
198
- pressToOpen: string;
199
- browseToAttachFileFor: string;
200
- or: string;
201
- numericOnly: string;
202
- uploadPdfFile: string;
203
- dropToStart: string;
204
- expand: string;
205
- collapse: string;
206
- add: string;
207
- delete: string;
208
- revert: string;
209
- removeBtnPressToRemove: string;
210
- file: string;
211
- captureVideo: string;
212
- captureAudio: string;
213
- captureImage: string;
214
- browseFiles: string;
215
- noComponentsSetInGrid: string;
216
- sortAscending: string;
217
- sortDescending: string;
218
- filter: string;
219
- clear: string;
220
- showItemsWithValue: string;
221
- gridItemsPerPage: string;
222
- gridAllItems: string;
223
- recordsSelectedOnPage: string;
224
- recordsSelectedInTable: string;
225
- gridSelectAll: string;
226
- itemsInTable: string;
227
- clearSelection: string;
228
- editGridRow: string;
229
- deleteGridRow: string;
230
- selected: string;
231
- actions: string;
232
- };
1
+ declare const _default: any;
233
2
  export default _default;
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const bootstrap_1 = __importDefault(require("@formio/bootstrap"));
8
- exports.default = Object.assign(Object.assign({}, (((_a = bootstrap_1.default === null || bootstrap_1.default === void 0 ? void 0 : bootstrap_1.default.translations) === null || _a === void 0 ? void 0 : _a.en) || {})), { unsavedRowsError: 'Please save all rows before proceeding.', invalidRowsError: 'Please correct invalid rows before proceeding.', invalidRowError: 'Invalid row. Please correct it or delete.', invalidOption: '{{field}} is an invalid value.', invalidDay: '{{field}} is not a valid day.', complete: 'Submission Complete', error: 'Please fix the following errors before submitting.', errorListHotkey: 'Press Ctrl + Alt + X to go back to the error list.', errorsListNavigationMessage: 'Click to navigate to the field with following error.', submitError: 'Please check the form and correct all errors before submitting.', required: '{{field}} is required', unique: '{{field}} must be unique', array: '{{field}} must be an array', array_nonempty: '{{field}} must be a non-empty array', nonarray: '{{field}} must not be an array', select: '{{field}} contains an invalid selection', pattern: '{{field}} does not match the pattern {{pattern}}', minLength: '{{field}} must have at least {{length}} characters.', maxLength: '{{field}} must have no more than {{length}} characters.', minWords: '{{field}} must have at least {{length}} words.', maxWords: '{{field}} must have no more than {{length}} words.', min: '{{field}} cannot be less than {{min}}.', max: '{{field}} cannot be greater than {{max}}.', maxDate: '{{field}} should not contain date after {{maxDate}}', minDate: '{{field}} should not contain date before {{minDate}}', maxYear: '{{field}} should not contain year greater than {{maxYear}}', minYear: '{{field}} should not contain year less than {{minYear}}', minSelectedCount: 'You must select at least {{minCount}} items', maxSelectedCount: 'You may only select up to {{maxCount}} items', invalid_email: '{{field}} must be a valid email.', invalid_url: '{{field}} must be a valid url.', invalid_regex: '{{field}} does not match the pattern {{regex}}.', invalid_date: '{{field}} is not a valid date.', invalid_day: '{{field}} is not a valid day.', invalidValueProperty: 'Invalid Value Property', mask: '{{field}} does not match the mask.', valueIsNotAvailable: '{{ field }} is an invalid value.', stripe: '{{stripe}}', month: 'Month', day: 'Day', year: 'Year', january: 'January', february: 'February', march: 'March', april: 'April', may: 'May', june: 'June', july: 'July', august: 'August', september: 'September', october: 'October', november: 'November', december: 'December', next: 'Next', previous: 'Previous', cancel: 'Cancel', submit: 'Submit Form', confirmCancel: 'Are you sure you want to cancel?', saveDraftInstanceError: 'Cannot save draft because there is no formio instance.', saveDraftAuthError: 'Cannot save draft unless a user is authenticated.', restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.', saveDraftError: 'Unable to save draft.', restoreDraftError: 'Unable to restore draft.', time: 'Invalid time', cancelButtonAriaLabel: 'Cancel button. Click to reset the form', previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab', nextButtonAriaLabel: 'Next button. Click to go to the next tab', submitButtonAriaLabel: 'Submit Form button. Click to submit the form', reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error', reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission', apiKey: 'API Key is not unique: {{key}}', typeRemaining: '{{ remaining }} {{ type }} remaining.', typeCount: '{{ count }} {{ type }}', requiredDayField: '{{ field }} is required', requiredDayEmpty: '{{ field }} is required', requiredMonthField: '{{ field }} is required', requiredYearField: '{{ field }} is required', formNotReady: 'Form not ready. Use form.ready promise', noFormElement: 'No DOM element for form.', notUniqueKey: 'API Key is not unique', newFormSchema: 'Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.', missingUrl: 'Missing URL argument', urlNotAttachedToBtn: 'You should add a URL to this button.', loadingProjectSettingsError: 'Could not load project settings', sessionStorageSupportError: 'Session storage is not supported in this browser.', builderUniqueError: `You cannot add more than one {{componentKeyOrTitle}} component to one page.`, pageNotFound: 'Page not found', noDragInfoError: 'There is no Drag Info available for either dragged or sibling element', addonSupportTypeError: 'Addon {{label}} does not support component of type {{type}}', setPathError: 'Should not be setting the path of a component.', calculatedPathDeprecation: 'component.calculatedPath was deprecated, use component.path instead.', unknownTemplate: 'Unknown template: {{name}}', unknownComponent: 'Unknown component: {{type}}', renderTemplateFunctionDeprecation: `Form.io 'render' template function is deprecated.
8
+ const core_1 = require("@formio/core");
9
+ const lodash_1 = __importDefault(require("lodash"));
10
+ exports.default = Object.assign(Object.assign(Object.assign({}, (((_a = bootstrap_1.default === null || bootstrap_1.default === void 0 ? void 0 : bootstrap_1.default.translations) === null || _a === void 0 ? void 0 : _a.en) || {})), lodash_1.default.omit(core_1.coreEnTranslation, ['maxDate', 'minDate'])), { unsavedRowsError: 'Please save all rows before proceeding.', invalidRowsError: 'Please correct invalid rows before proceeding.', invalidRowError: 'Invalid row. Please correct it or delete.', invalidOption: '{{field}} is an invalid value.', invalidDay: '{{field}} is not a valid day.', alertMessageWithLabel: '{{label}}: {{message}}', alertMessage: '{{message}}', complete: 'Submission Complete', error: 'Please fix the following errors before submitting.', errorListHotkey: 'Press Ctrl + Alt + X to go back to the error list.', errorsListNavigationMessage: 'Click to navigate to the field with following error.', submitError: 'Please check the form and correct all errors before submitting.', maxDate: '{{field}} should not contain date after {{maxDate}}', minDate: '{{field}} should not contain date before {{minDate}}', stripe: '{{stripe}}', next: 'Next', previous: 'Previous', cancel: 'Cancel', submit: 'Submit Form', confirmCancel: 'Are you sure you want to cancel?', saveDraftInstanceError: 'Cannot save draft because there is no formio instance.', saveDraftAuthError: 'Cannot save draft unless a user is authenticated.', restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.', saveDraftError: 'Unable to save draft.', restoreDraftError: 'Unable to restore draft.', time: 'Invalid time', cancelButtonAriaLabel: 'Cancel button. Click to reset the form', previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab', nextButtonAriaLabel: 'Next button. Click to go to the next tab', submitButtonAriaLabel: 'Submit Form button. Click to submit the form', reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error', reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission', apiKey: 'API Key is not unique: {{key}}', apiKeyNotValid: 'API Key is not valid: {{key}}', typeRemaining: '{{ remaining }} {{ type }} remaining.', typeCount: '{{ count }} {{ type }}', requiredDayEmpty: '{{ field }} is required', formNotReady: 'Form not ready. Use form.ready promise', noFormElement: 'No DOM element for form.', notUniqueKey: 'API Key is not unique', newFormSchema: 'Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.', missingUrl: 'Missing URL argument', urlNotAttachedToBtn: 'You should add a URL to this button.', loadingProjectSettingsError: 'Could not load project settings', sessionStorageSupportError: 'Session storage is not supported in this browser.', builderUniqueError: `You cannot add more than one {{componentKeyOrTitle}} component to one page.`, pageNotFound: 'Page not found', noDragInfoError: 'There is no Drag Info available for either dragged or sibling element', addonSupportTypeError: 'Addon {{label}} does not support component of type {{type}}', setPathError: 'Should not be setting the path of a component.', calculatedPathDeprecation: 'component.calculatedPath was deprecated, use component.path instead.', unknownTemplate: 'Unknown template: {{name}}', unknownComponent: 'Unknown component: {{type}}', renderTemplateFunctionDeprecation: `Form.io 'render' template function is deprecated.
9
11
  If you need to render template (template A) inside of another template (template B),
10
- pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B`, whenReadyDeprecation: 'The whenReady() method has been deprecated. Please use the dataReady property instead.', loadResourcesError: 'Unable to load resources for {{componentKey}}', noSelectDataConfiguration: 'Select component {{componentKey}} does not have data configuration.', indexedDBSupportError: "Your browser doesn't support current version of indexedDB", caretPositionSavingError: 'An error occurred while trying to save caret position', iteratableRowsError: 'Getter #iteratableRows() is not implemented', checkRowDeprecation: 'Deprecation Warning: checkRow method has been replaced with processRow', noOAuthBtn: 'You must add the OAuth button to a form for it to function properly', noOAuthConfiguration: 'OAuth not configured. You must configure oauth for your project before it will work.', oAuthErrorsTitle: 'The Following Error Has Occured', noOAuthFormUrl: 'You must attach a Form API url to your form in order to use OAuth buttons.', oAuthStateError: 'OAuth state does not match. Please try logging in again.', componentInvalidRowValidation: 'Invalid row validation for {{componentKey}}', videoPlayerNotFound: 'Video player not found in template.', synchronizationFailed: 'Synchronization is failed', fileWithDuplicatedNameInProgress: 'File with the same name is already being uploaded', fileWithDuplicatedNameLoaded: 'File with the same name is already uploaded', nestedForm: 'Nested form', noDataProvided: 'No data provided', subformSubmissionLoadingError: 'Unable to load subform submission {{submissionId}}:', noDelimiterSet: 'In order for thousands separator to work properly, you must set the delimiter to true in the component json', noSiteKey: 'There is no Site Key specified in settings in form JSON', failedToNormalize: 'Failed to normalize value', failedToCompareItems: 'Error while comparing items', editorFocusError: 'An editor did not initialize properly when trying to focus:', quillImageUploadFailed: 'Quill image upload failed', noFilesSelected: 'No files selected', needConfigurationForQuill: 'The WYSIWYG settings are configured for CKEditor. For this renderer, you will need to use configurations for the Quill Editor. See https://quilljs.com/docs/configuration for more information.', waitPdfConverting: 'Converting PDF. Please wait.', uploading: 'Uploading', pasteBelow: 'Paste below', copy: 'Copy', move: 'Move', edit: 'Edit', editJson: 'Edit JSON', remove: 'Remove', clickToSetValue: 'Click to set value', words: 'words', characters: 'characters', addAnother: 'Add Another', yes: 'Yes', no: 'No', wantToClearData: 'Do you want to clear data?', yesDelete: 'Yes, delete it', waitFileProcessing: 'Processing file. Please wait...', wrongFileType: 'File is the wrong type; it must be {{ pattern }}', fileTooSmall: 'File is too small; it must be at least {{ size }}', fileTooBig: 'File is too big; it must be at most {{ size }}', noFileService: 'File Service not provided.', fileProcessingFailed: 'File processing has been failed.', readyForUpload: 'Ready to be uploaded into storage', readyForRemovingFromStorage: 'Ready to be removed from storage', preparingFileToRemove: 'Preparing file to remove', succefullyRemoved: 'Succefully removed', succefullyUploaded: 'Succefully uploaded', maxSelectItems: 'You may only select up to {{maxCount}} items', minSelectItems: 'You must select at least {{minCount}} items', clickToSign: 'Click to Sign', surveyQuestion: 'Question', surveyQuestionValue: 'Value', success: 'Success', noResultsFound: 'No results found', noChoices: 'No choices to choose from', typeToSearch: 'Type to search', loading: 'Loading' });
12
+ pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B`, whenReadyDeprecation: 'The whenReady() method has been deprecated. Please use the dataReady property instead.', loadResourcesError: 'Unable to load resources for {{componentKey}}', noSelectDataConfiguration: 'Select component {{componentKey}} does not have data configuration.', indexedDBSupportError: "Your browser doesn't support current version of indexedDB", caretPositionSavingError: 'An error occurred while trying to save caret position', iteratableRowsError: 'Getter #iteratableRows() is not implemented', checkRowDeprecation: 'Deprecation Warning: checkRow method has been replaced with processRow', noOAuthBtn: 'You must add the OAuth button to a form for it to function properly', noOAuthConfiguration: 'OAuth not configured. You must configure oauth for your project before it will work.', oAuthErrorsTitle: 'The Following Error Has Occured', noOAuthFormUrl: 'You must attach a Form API url to your form in order to use OAuth buttons.', oAuthStateError: 'OAuth state does not match. Please try logging in again.', componentInvalidRowValidation: 'Invalid row validation for {{componentKey}}', videoPlayerNotFound: 'Video player not found in template.', synchronizationFailed: 'Synchronization is failed', fileWithDuplicatedNameInProgress: 'File with the same name is already being uploaded', fileWithDuplicatedNameLoaded: 'File with the same name is already uploaded', nestedForm: 'Nested form', noDataProvided: 'No data provided', subformSubmissionLoadingError: 'Unable to load subform submission {{submissionId}}:', noDelimiterSet: 'In order for thousands separator to work properly, you must set the delimiter to true in the component json', noSiteKey: 'There is no Site Key specified in settings in form JSON', failedToNormalize: 'Failed to normalize value', failedToCompareItems: 'Error while comparing items', editorFocusError: 'An editor did not initialize properly when trying to focus:', quillImageUploadFailed: 'Quill image upload failed', noFilesSelected: 'No files selected', needConfigurationForQuill: 'The WYSIWYG settings are configured for CKEditor. For this renderer, you will need to use configurations for the Quill Editor. See https://quilljs.com/docs/configuration for more information.', waitPdfConverting: 'Converting PDF. Please wait.', uploading: 'Uploading', pasteBelow: 'Paste below', copy: 'Copy', move: 'Move', edit: 'Edit', editJson: 'Edit JSON', remove: 'Remove', clickToSetValue: 'Click to set value', words: 'words', characters: 'characters', addAnother: 'Add Another', wantToClearData: 'Do you want to clear data?', yesDelete: 'Yes, delete it', waitFileProcessing: 'Processing file. Please wait...', wrongFileType: 'File is the wrong type; it must be {{ pattern }}', fileTooSmall: 'File is too small; it must be at least {{ size }}', fileTooBig: 'File is too big; it must be at most {{ size }}', noFileService: 'File Service not provided.', fileProcessingFailed: 'File processing has been failed.', readyForUpload: 'Ready to be uploaded into storage', readyForRemovingFromStorage: 'Ready to be removed from storage', preparingFileToRemove: 'Preparing file to remove', succefullyRemoved: 'Succefully removed', succefullyUploaded: 'Succefully uploaded', maxSelectItems: 'You may only select up to {{maxCount}} items', minSelectItems: 'You must select at least {{minCount}} items', clickToSign: 'Click to Sign', success: 'Success', noResultsFound: 'No results found', noChoices: 'No choices to choose from', typeToSearch: 'Type to search', loading: 'Loading' });
@@ -1,7 +1,21 @@
1
- export class Evaluator {
2
- static cache: {};
3
- static protectedEval: boolean;
4
- static noeval: boolean;
5
- static template(template: any, hash: any): any;
6
- static interpolate(rawTemplate: any, data: any, _options: any): any;
1
+ /**
2
+ * For backwards compatibility we a standalone interpolate function. This merely calls the
3
+ * global mutable Evaluator instance's interpolate function.
4
+ * @param {...any} args - interpolate arguments, typically "rawTemplate", "data", and "options"
5
+ * @returns {any} the interpolation result.
6
+ */
7
+ export function interpolate(...args: any[]): any;
8
+ /**
9
+ * Set the evaluator to use for evaluating expressions.
10
+ * @param {CoreEvaluator} override - The new evaluator instance to use.
11
+ * @returns {void}
12
+ */
13
+ export function registerEvaluator(override: CoreEvaluator): void;
14
+ export class DefaultEvaluator extends CoreEvaluator {
15
+ cache: {};
16
+ protectedEval: boolean;
17
+ template(template: any, hash: any): any;
18
+ interpolate(rawTemplate: any, data: any, _options: any): any;
7
19
  }
20
+ export let Evaluator: DefaultEvaluator;
21
+ import { DefaultEvaluator as CoreEvaluator } from '@formio/core';