@formio/js 5.1.0-dev.6040.debc859 → 5.1.0-dev.6042.603237d

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 (236) 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 +661 -672
  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 +688 -699
  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.js +4 -5
  26. package/lib/cjs/Webform.d.ts +2 -2
  27. package/lib/cjs/Webform.js +14 -15
  28. package/lib/cjs/WebformBuilder.d.ts +1 -0
  29. package/lib/cjs/WebformBuilder.js +44 -14
  30. package/lib/cjs/Wizard.d.ts +2 -2
  31. package/lib/cjs/Wizard.js +41 -27
  32. package/lib/cjs/WizardBuilder.js +1 -1
  33. package/lib/cjs/components/_classes/component/Component.d.ts +49 -15
  34. package/lib/cjs/components/_classes/component/Component.js +188 -125
  35. package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
  36. package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +19 -0
  37. package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
  38. package/lib/cjs/components/_classes/component/editForm/utils.js +1 -1
  39. package/lib/cjs/components/_classes/componentModal/ComponentModal.js +1 -1
  40. package/lib/cjs/components/_classes/input/Input.js +1 -1
  41. package/lib/cjs/components/_classes/list/ListComponent.js +3 -3
  42. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +0 -1
  43. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +13 -0
  44. package/lib/cjs/components/_classes/nested/NestedComponent.js +17 -25
  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 +9 -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 -4
  62. package/lib/cjs/components/datamap/DataMap.js +2 -6
  63. package/lib/cjs/components/datetime/DateTime.d.ts +1 -1
  64. package/lib/cjs/components/datetime/DateTime.js +15 -13
  65. package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.d.ts +66 -15
  66. package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.js +68 -47
  67. package/lib/cjs/components/day/Day.js +2 -2
  68. package/lib/cjs/components/day/editForm/Day.edit.display.js +8 -0
  69. package/lib/cjs/components/editgrid/EditGrid.js +4 -14
  70. package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  71. package/lib/cjs/components/email/editForm/Email.edit.display.js +12 -0
  72. package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
  73. package/lib/cjs/components/file/File.js +6 -2
  74. package/lib/cjs/components/file/editForm/File.edit.file.d.ts +13 -0
  75. package/lib/cjs/components/file/editForm/File.edit.file.js +1 -0
  76. package/lib/cjs/components/form/Form.d.ts +0 -1
  77. package/lib/cjs/components/form/Form.js +32 -24
  78. package/lib/cjs/components/form/editForm/Form.edit.form.js +4 -3
  79. package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
  80. package/lib/cjs/components/html/HTML.js +1 -2
  81. package/lib/cjs/components/html/editForm/HTML.edit.display.js +8 -0
  82. package/lib/cjs/components/number/Number.js +1 -1
  83. package/lib/cjs/components/number/editForm/Number.edit.display.js +12 -0
  84. package/lib/cjs/components/panel/Panel.js +1 -1
  85. package/lib/cjs/components/password/editForm/Password.edit.display.js +13 -1
  86. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -1
  87. package/lib/cjs/components/radio/Radio.d.ts +8 -0
  88. package/lib/cjs/components/radio/Radio.js +17 -7
  89. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
  90. package/lib/cjs/components/select/Select.d.ts +1 -0
  91. package/lib/cjs/components/select/Select.js +21 -5
  92. package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +68 -110
  93. package/lib/cjs/components/select/editForm/Select.edit.data.js +3 -38
  94. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +6 -0
  95. package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -1
  96. package/lib/cjs/components/signature/Signature.js +1 -1
  97. package/lib/cjs/components/survey/Survey.js +2 -2
  98. package/lib/cjs/components/tabs/Tabs.js +1 -0
  99. package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
  100. package/lib/cjs/components/tags/Tags.js +1 -1
  101. package/lib/cjs/components/textarea/TextArea.js +10 -2
  102. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
  103. package/lib/cjs/components/textfield/TextField.js +9 -32
  104. package/lib/cjs/components/time/Time.js +1 -1
  105. package/lib/cjs/components/unknown/Unknown.form.d.ts +2 -1
  106. package/lib/cjs/components/unknown/Unknown.form.js +13 -9
  107. package/lib/cjs/components/url/editForm/Url.edit.display.js +12 -0
  108. package/lib/cjs/components/well/editForm/Well.edit.display.js +8 -0
  109. package/lib/cjs/formio.form.js +5 -5
  110. package/lib/cjs/providers/storage/uploadAdapter.js +8 -6
  111. package/lib/cjs/translations/en.d.ts +1 -234
  112. package/lib/cjs/translations/en.js +4 -2
  113. package/lib/cjs/utils/Evaluator.d.ts +20 -6
  114. package/lib/cjs/utils/Evaluator.js +38 -15
  115. package/lib/cjs/utils/builder.js +5 -5
  116. package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
  117. package/lib/cjs/utils/formUtils.d.ts +2 -2
  118. package/lib/cjs/utils/index.d.ts +169 -2
  119. package/lib/cjs/utils/index.js +22 -2
  120. package/lib/cjs/utils/utils.d.ts +31 -45
  121. package/lib/cjs/utils/utils.js +80 -156
  122. package/lib/cjs/widgets/CalendarWidget.d.ts +1 -8
  123. package/lib/cjs/widgets/CalendarWidget.js +19 -40
  124. package/lib/mjs/Element.d.ts +2 -1
  125. package/lib/mjs/Element.js +11 -9
  126. package/lib/mjs/EventEmitter.js +2 -2
  127. package/lib/mjs/Form.js +1 -1
  128. package/lib/mjs/PDF.js +1 -1
  129. package/lib/mjs/PDFBuilder.js +1 -2
  130. package/lib/mjs/Webform.d.ts +2 -2
  131. package/lib/mjs/Webform.js +12 -13
  132. package/lib/mjs/WebformBuilder.d.ts +1 -0
  133. package/lib/mjs/WebformBuilder.js +37 -8
  134. package/lib/mjs/Wizard.d.ts +2 -2
  135. package/lib/mjs/Wizard.js +39 -25
  136. package/lib/mjs/WizardBuilder.js +1 -1
  137. package/lib/mjs/components/_classes/component/Component.d.ts +49 -15
  138. package/lib/mjs/components/_classes/component/Component.js +161 -75
  139. package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
  140. package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +19 -0
  141. package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +1 -1
  142. package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
  143. package/lib/mjs/components/_classes/componentModal/ComponentModal.js +1 -1
  144. package/lib/mjs/components/_classes/input/Input.js +1 -1
  145. package/lib/mjs/components/_classes/list/ListComponent.js +3 -3
  146. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +0 -1
  147. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +13 -0
  148. package/lib/mjs/components/_classes/nested/NestedComponent.js +17 -25
  149. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  150. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +0 -2
  151. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -12
  152. package/lib/mjs/components/address/Address.d.ts +9 -0
  153. package/lib/mjs/components/address/Address.js +32 -9
  154. package/lib/mjs/components/address/editForm/Address.edit.display.d.ts +4 -0
  155. package/lib/mjs/components/address/editForm/Address.edit.display.js +1 -0
  156. package/lib/mjs/components/address/editForm/Address.edit.provider.js +8 -8
  157. package/lib/mjs/components/alert/Alert.js +1 -1
  158. package/lib/mjs/components/button/Button.d.ts +1 -1
  159. package/lib/mjs/components/button/Button.js +7 -10
  160. package/lib/mjs/components/checkbox/Checkbox.js +1 -1
  161. package/lib/mjs/components/container/Container.js +1 -1
  162. package/lib/mjs/components/content/editForm/Content.edit.display.js +8 -0
  163. package/lib/mjs/components/currency/Currency.js +1 -1
  164. package/lib/mjs/components/currency/editForm/Currency.edit.display.js +12 -0
  165. package/lib/mjs/components/datagrid/DataGrid.js +5 -4
  166. package/lib/mjs/components/datamap/DataMap.js +2 -6
  167. package/lib/mjs/components/datetime/DateTime.d.ts +1 -1
  168. package/lib/mjs/components/datetime/DateTime.js +15 -13
  169. package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.d.ts +66 -15
  170. package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.js +68 -47
  171. package/lib/mjs/components/day/Day.js +2 -2
  172. package/lib/mjs/components/day/editForm/Day.edit.display.js +8 -0
  173. package/lib/mjs/components/editgrid/EditGrid.js +4 -13
  174. package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
  175. package/lib/mjs/components/email/editForm/Email.edit.display.js +12 -0
  176. package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
  177. package/lib/mjs/components/file/File.js +6 -2
  178. package/lib/mjs/components/file/editForm/File.edit.file.d.ts +13 -0
  179. package/lib/mjs/components/file/editForm/File.edit.file.js +1 -0
  180. package/lib/mjs/components/form/Form.d.ts +0 -1
  181. package/lib/mjs/components/form/Form.js +31 -24
  182. package/lib/mjs/components/form/editForm/Form.edit.form.js +3 -2
  183. package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
  184. package/lib/mjs/components/html/HTML.js +1 -2
  185. package/lib/mjs/components/html/editForm/HTML.edit.display.js +8 -0
  186. package/lib/mjs/components/number/Number.js +1 -1
  187. package/lib/mjs/components/number/editForm/Number.edit.display.js +12 -0
  188. package/lib/mjs/components/panel/Panel.js +1 -1
  189. package/lib/mjs/components/password/editForm/Password.edit.display.js +13 -1
  190. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -1
  191. package/lib/mjs/components/radio/Radio.d.ts +8 -0
  192. package/lib/mjs/components/radio/Radio.js +17 -7
  193. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +1 -1
  194. package/lib/mjs/components/select/Select.d.ts +1 -0
  195. package/lib/mjs/components/select/Select.js +21 -5
  196. package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +68 -110
  197. package/lib/mjs/components/select/editForm/Select.edit.data.js +3 -38
  198. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +6 -0
  199. package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -1
  200. package/lib/mjs/components/signature/Signature.js +1 -1
  201. package/lib/mjs/components/survey/Survey.js +2 -2
  202. package/lib/mjs/components/tabs/Tabs.js +1 -0
  203. package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
  204. package/lib/mjs/components/tags/Tags.js +1 -1
  205. package/lib/mjs/components/textarea/TextArea.js +10 -2
  206. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
  207. package/lib/mjs/components/textfield/TextField.js +3 -3
  208. package/lib/mjs/components/time/Time.js +1 -1
  209. package/lib/mjs/components/unknown/Unknown.form.d.ts +2 -1
  210. package/lib/mjs/components/unknown/Unknown.form.js +13 -9
  211. package/lib/mjs/components/url/editForm/Url.edit.display.js +12 -0
  212. package/lib/mjs/components/well/editForm/Well.edit.display.js +8 -0
  213. package/lib/mjs/formio.form.js +3 -3
  214. package/lib/mjs/providers/storage/uploadAdapter.js +8 -6
  215. package/lib/mjs/translations/en.d.ts +1 -234
  216. package/lib/mjs/translations/en.js +6 -47
  217. package/lib/mjs/utils/Evaluator.d.ts +20 -6
  218. package/lib/mjs/utils/Evaluator.js +31 -13
  219. package/lib/mjs/utils/builder.js +1 -1
  220. package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
  221. package/lib/mjs/utils/formUtils.d.ts +2 -2
  222. package/lib/mjs/utils/index.d.ts +169 -2
  223. package/lib/mjs/utils/index.js +18 -1
  224. package/lib/mjs/utils/utils.d.ts +31 -45
  225. package/lib/mjs/utils/utils.js +72 -129
  226. package/lib/mjs/widgets/CalendarWidget.d.ts +1 -8
  227. package/lib/mjs/widgets/CalendarWidget.js +19 -40
  228. package/package.json +8 -6
  229. package/lib/cjs/i18n.d.ts +0 -13
  230. package/lib/cjs/i18n.js +0 -19
  231. package/lib/cjs/utils/i18n.d.ts +0 -19
  232. package/lib/cjs/utils/i18n.js +0 -120
  233. package/lib/mjs/i18n.d.ts +0 -13
  234. package/lib/mjs/i18n.js +0 -14
  235. package/lib/mjs/utils/i18n.d.ts +0 -19
  236. package/lib/mjs/utils/i18n.js +0 -112
@@ -1,5 +1,5 @@
1
1
  import _ from 'lodash';
2
- import { eachComponent } from '../../../utils/utils';
2
+ import { eachComponent } from '../../../utils';
3
3
  const calculateSingleSelectData = (context, defaultValue) => {
4
4
  const { instance, data } = context;
5
5
  const rawDefaultValue = instance.downloadedResources.find(resource => _.get(resource, data.valueProperty) === defaultValue);
@@ -56,42 +56,6 @@ export default [
56
56
  ],
57
57
  },
58
58
  },
59
- {
60
- type: 'textfield',
61
- weight: 10,
62
- input: true,
63
- key: 'indexeddb.database',
64
- label: 'Database name',
65
- tooltip: 'The name of the indexeddb database.',
66
- conditional: {
67
- json: { '===': [{ var: 'data.dataSrc' }, 'indexeddb'] },
68
- },
69
- },
70
- {
71
- type: 'textfield',
72
- input: true,
73
- key: 'indexeddb.table',
74
- label: 'Table name',
75
- weight: 16,
76
- tooltip: 'The name of table in the indexeddb database.',
77
- conditional: {
78
- json: { '===': [{ var: 'data.dataSrc' }, 'indexeddb'] },
79
- }
80
- },
81
- {
82
- type: 'textarea',
83
- as: 'json',
84
- editor: 'ace',
85
- weight: 18,
86
- input: true,
87
- key: 'indexeddb.filter',
88
- label: 'Row Filter',
89
- tooltip: 'Filter table items that match the object.',
90
- defaultValue: {},
91
- conditional: {
92
- json: { '===': [{ var: 'data.dataSrc' }, 'indexeddb'] },
93
- },
94
- },
95
59
  {
96
60
  type: 'textarea',
97
61
  as: 'json',
@@ -113,6 +77,7 @@ export default [
113
77
  key: 'lazyLoad',
114
78
  tooltip: 'When set, this will not fire off the request to the URL until this control is within focus. This can improve performance if you have many Select dropdowns on your form where the API\'s will only fire when the control is activated.',
115
79
  weight: 11,
80
+ defaultValue: true,
116
81
  conditional: {
117
82
  json: {
118
83
  and: [
@@ -202,7 +167,7 @@ export default [
202
167
  label: 'Value Property',
203
168
  key: 'valueProperty',
204
169
  skipMerge: true,
205
- clearOnHide: true,
170
+ clearOnHide: false,
206
171
  tooltip: 'The field to use as the value.',
207
172
  weight: 11,
208
173
  refreshOn: 'data.resource',
@@ -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
  }
@@ -1,5 +1,5 @@
1
1
  import _ from 'lodash';
2
- import { componentValueTypes, getComponentSavedTypes, boolValue, getComponent } from '../../utils/utils';
2
+ import { componentValueTypes, getComponentSavedTypes, boolValue, getComponent } from '../../utils';
3
3
  import RadioComponent from '../radio/Radio';
4
4
  export default class SelectBoxesComponent extends RadioComponent {
5
5
  static schema(...extend) {
@@ -66,6 +66,9 @@ export default class SelectBoxesComponent extends RadioComponent {
66
66
  info.attr.class = 'form-check-input';
67
67
  return info;
68
68
  }
69
+ get hasDefaultValue() {
70
+ return true;
71
+ }
69
72
  get emptyValue() {
70
73
  return this.component.values.reduce((prev, value) => {
71
74
  if (value.value) {
@@ -149,6 +152,9 @@ export default class SelectBoxesComponent extends RadioComponent {
149
152
  }
150
153
  }
151
154
  }
155
+ else if (_.isEmpty(this.loadedOptions) && !checkedValues.length) {
156
+ value = {};
157
+ }
152
158
  return value;
153
159
  }
154
160
  /**
@@ -1,7 +1,7 @@
1
1
  import SignaturePad from 'signature_pad';
2
2
  import Input from '../_classes/input/Input';
3
3
  import _ from 'lodash';
4
- import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
4
+ import { componentValueTypes, getComponentSavedTypes } from '../../utils';
5
5
  export default class SignatureComponent extends Input {
6
6
  static schema(...extend) {
7
7
  return Input.schema({
@@ -1,6 +1,6 @@
1
1
  import _ from 'lodash';
2
2
  import Field from '../_classes/field/Field';
3
- import { boolValue, componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
3
+ import { boolValue, componentValueTypes, getComponentSavedTypes } from '../../utils';
4
4
  export default class SurveyComponent extends Field {
5
5
  static schema(...extend) {
6
6
  return Field.schema({
@@ -118,7 +118,7 @@ export default class SurveyComponent extends Field {
118
118
  return this.component.questions.reduce((result, question) => result && Boolean(value[question.value]), true);
119
119
  }
120
120
  getInputName(question) {
121
- return `${this.options.name}[${question.value}]`;
121
+ return `${this.options.name}[${question.value}][${this.id}]`;
122
122
  }
123
123
  getValueAsString(value, options) {
124
124
  if (options?.email) {
@@ -138,6 +138,7 @@ export default class TabsComponent extends NestedComponent {
138
138
  this.addClass(this.refs[this.tabLinkKey][index], 'active');
139
139
  this.addClass(this.refs[this.tabLinkKey][index], 'formio-tab-link-active');
140
140
  }
141
+ this.setValue(this.data);
141
142
  this.triggerChange();
142
143
  }
143
144
  beforeFocus(component) {
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
@@ -1,4 +1,4 @@
1
- import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
1
+ import { componentValueTypes, getComponentSavedTypes } from '../../utils';
2
2
  import Input from '../_classes/input/Input';
3
3
  import Choices from 'choices.js';
4
4
  export default class TagsComponent extends Input {
@@ -1,7 +1,7 @@
1
1
  /* global Quill */
2
2
  import TextFieldComponent from '../textfield/TextField';
3
3
  import _ from 'lodash';
4
- import { uniqueName, getBrowserInfo } from '../../utils/utils';
4
+ import { uniqueName, getBrowserInfo } from '../../utils';
5
5
  export default class TextAreaComponent extends TextFieldComponent {
6
6
  static schema(...extend) {
7
7
  return TextFieldComponent.schema({
@@ -57,7 +57,15 @@ export default class TextAreaComponent extends TextFieldComponent {
57
57
  info.content = value;
58
58
  if ((this.options.readOnly || this.disabled) && !this.isHtmlRenderMode()) {
59
59
  const elementStyle = this.info.attr.style || '';
60
- const children = `<div ${this._referenceAttributeName}="input" class="formio-editor-read-only-content" ${elementStyle ? `style='${elementStyle}'` : ''}></div>`;
60
+ const children = `
61
+ <div ${this._referenceAttributeName}="input"
62
+ class="formio-editor-read-only-content"
63
+ ${elementStyle ? `style='${elementStyle}'` : ''}
64
+ role="textbox"
65
+ aria-multiline="true"
66
+ aria-readonly="true"
67
+ >
68
+ </div>`;
61
69
  return this.renderTemplate('well', {
62
70
  children,
63
71
  nestedKey: this.key,
@@ -9,10 +9,22 @@ export default [
9
9
  key: 'allowMultipleMasks',
10
10
  ignore: true
11
11
  },
12
+ {
13
+ key: 'inputMasks',
14
+ ignore: true
15
+ },
12
16
  {
13
17
  key: 'mask',
14
18
  ignore: true
15
19
  },
20
+ {
21
+ key: 'widget.type',
22
+ ignore: true
23
+ },
24
+ {
25
+ key: 'widget',
26
+ ignore: true
27
+ },
16
28
  {
17
29
  type: 'number',
18
30
  input: true,
@@ -1,7 +1,7 @@
1
1
  import Input from '../_classes/input/Input';
2
2
  import { conformToMask } from '@formio/vanilla-text-mask';
3
3
  import Inputmask from 'inputmask';
4
- import * as FormioUtils from '../../utils/utils';
4
+ import FormioUtils from '../../utils';
5
5
  import _ from 'lodash';
6
6
  export default class TextFieldComponent extends Input {
7
7
  static schema(...extend) {
@@ -86,8 +86,8 @@ export default class TextFieldComponent extends Input {
86
86
  locale: this.component.widget.locale || this.options.language,
87
87
  saveAs: 'text'
88
88
  };
89
- // update originalComponent to include widget settings after component initialization
90
- // originalComponent is used to restore the component (and widget) after evaluating field logic
89
+ // update originalComponent to include widget settings after component initialization
90
+ // originalComponent is used to restore the component (and widget) after evaluating field logic
91
91
  this.originalComponent = FormioUtils.fastCloneDeep(this.component);
92
92
  }
93
93
  }
@@ -1,6 +1,6 @@
1
1
  import moment from 'moment';
2
2
  import TextFieldComponent from '../textfield/TextField';
3
- import { getBrowserInfo } from '../../utils/utils';
3
+ import { getBrowserInfo } from '../../utils';
4
4
  const defaultDataFormat = 'HH:mm:ss';
5
5
  export default class TimeComponent extends TextFieldComponent {
6
6
  static schema(...extend) {
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Unknown Component schema.
3
+ * @param {...any} extend
3
4
  * @returns {object} - The Unknown Component edit form.
4
5
  */
5
- export default function _default(): object;
6
+ export default function _default(...extend: any[]): object;
@@ -1,22 +1,26 @@
1
+ import { unionWith } from 'lodash';
1
2
  import UnknownEditDisplay from './editForm/Unknown.edit.display';
3
+ import EditFormUtils from '../../components/_classes/component/editForm/utils';
2
4
  /**
3
5
  * Unknown Component schema.
6
+ * @param {...any} extend
4
7
  * @returns {object} - The Unknown Component edit form.
5
8
  */
6
- export default function () {
9
+ export default function (...extend) {
10
+ const components = [
11
+ {
12
+ label: 'Custom',
13
+ key: 'display',
14
+ weight: 0,
15
+ components: UnknownEditDisplay
16
+ }
17
+ ].concat(...extend);
7
18
  return {
8
19
  components: [
9
20
  {
10
21
  type: 'tabs',
11
22
  key: 'tabs',
12
- components: [
13
- {
14
- label: 'Custom',
15
- key: 'display',
16
- weight: 0,
17
- components: UnknownEditDisplay
18
- }
19
- ]
23
+ components: unionWith(components, EditFormUtils.unifyComponents)
20
24
  }
21
25
  ]
22
26
  };
@@ -7,6 +7,18 @@ export default [
7
7
  key: 'allowMultipleMasks',
8
8
  ignore: true
9
9
  },
10
+ {
11
+ key: 'inputMasks',
12
+ ignore: true
13
+ },
14
+ {
15
+ key: 'widget.type',
16
+ ignore: true
17
+ },
18
+ {
19
+ key: 'widget',
20
+ ignore: true
21
+ },
10
22
  {
11
23
  key: 'showWordCount',
12
24
  ignore: true,
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
@@ -8,11 +8,11 @@ import Providers from './providers';
8
8
  import Widgets from './widgets';
9
9
  import Form from './Form';
10
10
  import Utils from './utils';
11
- import { Evaluator } from './utils/Evaluator';
12
11
  import Licenses from './licenses';
13
12
  import EventEmitter from './EventEmitter';
14
13
  import Webform from './Webform';
15
- import { I18n } from './utils/i18n';
14
+ import { I18n } from '@formio/core';
15
+ import { Evaluator, registerEvaluator } from './utils';
16
16
  Formio.loadModules = (path = `${Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {
17
17
  Formio.requireLibrary(name, name, path, true)
18
18
  .then((modules) => {
@@ -83,7 +83,7 @@ export function registerModule(mod, defaultFn = null, options = {}) {
83
83
  Formio.Displays.addDisplays(mod.displays);
84
84
  break;
85
85
  case 'evaluator':
86
- Formio.Evaluator.registerEvaluator(mod.evaluator);
86
+ registerEvaluator(mod.evaluator);
87
87
  break;
88
88
  case 'translations':
89
89
  I18n.setDefaultTranslations(mod.translations);
@@ -1,4 +1,4 @@
1
- import { uniqueName } from '../../utils/utils';
1
+ import { uniqueName } from '../../utils';
2
2
  /**
3
3
  * UploadAdapter for CKEditor https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html
4
4
  */
@@ -24,7 +24,7 @@ class FormioUploadAdapter {
24
24
  null,
25
25
  null
26
26
  ];
27
- const uploadPromise = this.fileService.uploadFile(...uploadParams, () => this.component.emit('fileUploadingStart', uploadPromise)).then((result) => {
27
+ this.fileService.uploadFile(...uploadParams, () => this.component.emit('fileUploadingStart')).then((result) => {
28
28
  return this.fileService.downloadFile(result);
29
29
  }).then((result) => {
30
30
  return resolve({
@@ -34,7 +34,7 @@ class FormioUploadAdapter {
34
34
  console.warn('An Error occured while uploading file', err);
35
35
  reject(err);
36
36
  }).finally(() => {
37
- this.component.emit('fileUploadingEnd', uploadPromise);
37
+ this.component.emit('fileUploadingEnd');
38
38
  });
39
39
  }));
40
40
  }
@@ -46,9 +46,11 @@ class FormioUploadAdapter {
46
46
  }
47
47
  }
48
48
  }
49
- const getFormioUploadAdapterPlugin = (fileService, component) => (editor) => {
50
- editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {
51
- return new FormioUploadAdapter(loader, fileService, component);
49
+ const getFormioUploadAdapterPlugin = (fileService, component) => {
50
+ return function (editor) {
51
+ editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {
52
+ return new FormioUploadAdapter(loader, fileService, component);
53
+ };
52
54
  };
53
55
  };
54
56
  export { getFormioUploadAdapterPlugin };
@@ -1,235 +1,2 @@
1
- declare const _default: {
2
- unsavedRowsError: string;
3
- invalidRowsError: string;
4
- invalidRowError: string;
5
- invalidOption: string;
6
- invalidDay: string;
7
- alertMessageWithLabel: string;
8
- alertMessage: string;
9
- complete: string;
10
- error: string;
11
- errorListHotkey: string;
12
- errorsListNavigationMessage: string;
13
- submitError: string;
14
- required: string;
15
- unique: string;
16
- array: string;
17
- array_nonempty: string;
18
- nonarray: string;
19
- select: string;
20
- pattern: string;
21
- minLength: string;
22
- maxLength: string;
23
- minWords: string;
24
- maxWords: string;
25
- min: string;
26
- max: string;
27
- maxDate: string;
28
- minDate: string;
29
- maxYear: string;
30
- minYear: string;
31
- minSelectedCount: string;
32
- maxSelectedCount: string;
33
- invalid_email: string;
34
- invalid_url: string;
35
- invalid_regex: string;
36
- invalid_date: string;
37
- invalid_day: string;
38
- invalidValueProperty: string;
39
- mask: string;
40
- valueIsNotAvailable: string;
41
- stripe: string;
42
- month: string;
43
- day: string;
44
- year: string;
45
- january: string;
46
- february: string;
47
- march: string;
48
- april: string;
49
- may: string;
50
- june: string;
51
- july: string;
52
- august: string;
53
- september: string;
54
- october: string;
55
- november: string;
56
- december: string;
57
- next: string;
58
- previous: string;
59
- cancel: string;
60
- submit: string;
61
- confirmCancel: string;
62
- saveDraftInstanceError: string;
63
- saveDraftAuthError: string;
64
- restoreDraftInstanceError: string;
65
- saveDraftError: string;
66
- restoreDraftError: string;
67
- time: string;
68
- cancelButtonAriaLabel: string;
69
- previousButtonAriaLabel: string;
70
- nextButtonAriaLabel: string;
71
- submitButtonAriaLabel: string;
72
- reCaptchaTokenValidationError: string;
73
- reCaptchaTokenNotSpecifiedError: string;
74
- apiKey: string;
75
- typeRemaining: string;
76
- typeCount: string;
77
- requiredDayField: string;
78
- requiredDayEmpty: string;
79
- requiredMonthField: string;
80
- requiredYearField: string;
81
- formNotReady: string;
82
- noFormElement: string;
83
- notUniqueKey: string;
84
- newFormSchema: string;
85
- missingUrl: string;
86
- urlNotAttachedToBtn: string;
87
- loadingProjectSettingsError: string;
88
- sessionStorageSupportError: string;
89
- builderUniqueError: string;
90
- pageNotFound: string;
91
- noDragInfoError: string;
92
- addonSupportTypeError: string;
93
- setPathError: string;
94
- calculatedPathDeprecation: string;
95
- unknownTemplate: string;
96
- unknownComponent: string;
97
- renderTemplateFunctionDeprecation: string;
98
- whenReadyDeprecation: string;
99
- loadResourcesError: string;
100
- noSelectDataConfiguration: string;
101
- indexedDBSupportError: string;
102
- caretPositionSavingError: string;
103
- iteratableRowsError: string;
104
- checkRowDeprecation: string;
105
- noOAuthBtn: string;
106
- noOAuthConfiguration: string;
107
- oAuthErrorsTitle: string;
108
- noOAuthFormUrl: string;
109
- oAuthStateError: string;
110
- componentInvalidRowValidation: string;
111
- videoPlayerNotFound: string;
112
- synchronizationFailed: string;
113
- fileWithDuplicatedNameInProgress: string;
114
- fileWithDuplicatedNameLoaded: string;
115
- nestedForm: string;
116
- noDataProvided: string;
117
- subformSubmissionLoadingError: string;
118
- noDelimiterSet: string;
119
- noSiteKey: string;
120
- failedToNormalize: string;
121
- failedToCompareItems: string;
122
- editorFocusError: string;
123
- quillImageUploadFailed: string;
124
- noFilesSelected: string;
125
- needConfigurationForQuill: string;
126
- waitPdfConverting: string;
127
- uploading: string;
128
- pasteBelow: string;
129
- copy: string;
130
- move: string;
131
- edit: string;
132
- editJson: string;
133
- remove: string;
134
- clickToSetValue: string;
135
- words: string;
136
- characters: string;
137
- addAnother: string;
138
- yes: string;
139
- no: string;
140
- wantToClearData: string;
141
- yesDelete: string;
142
- waitFileProcessing: string;
143
- wrongFileType: string;
144
- fileTooSmall: string;
145
- fileTooBig: string;
146
- noFileService: string;
147
- fileProcessingFailed: string;
148
- readyForUpload: string;
149
- readyForRemovingFromStorage: string;
150
- preparingFileToRemove: string;
151
- succefullyRemoved: string;
152
- succefullyUploaded: string;
153
- maxSelectItems: string;
154
- minSelectItems: string;
155
- clickToSign: string;
156
- surveyQuestion: string;
157
- surveyQuestionValue: string;
158
- success: string;
159
- noResultsFound: string;
160
- noChoices: string;
161
- typeToSearch: string;
162
- loading: string;
163
- help: string;
164
- component: string;
165
- save: string;
166
- preview: string;
167
- dragAndDropComponent: string;
168
- searchFields: string;
169
- noMatchesFound: string;
170
- fileName: string;
171
- size: string;
172
- type: string;
173
- gallery: string;
174
- camera: string;
175
- dropFilesToAttach: string;
176
- useCamera: string;
177
- browse: string;
178
- takePicture: string;
179
- switchToFileUpload: string;
180
- completeStatus: string;
181
- noStorageSet: string;
182
- noFileApiSupport: string;
183
- noFormDataSupport: string;
184
- noProgressSupport: string;
185
- close: string;
186
- addResource: string;
187
- autocomplete: string;
188
- showPreview: string;
189
- hidePreview: string;
190
- createPage: string;
191
- page: string;
192
- closeBtnDescription: string;
193
- cancelBtnDescription: string;
194
- saveBtnDescription: string;
195
- addOrRemove: string;
196
- anyFileTypesAllowed: string;
197
- allowedFileTypes: string;
198
- syncing: string;
199
- syncNow: string;
200
- pressToOpen: string;
201
- browseToAttachFileFor: string;
202
- or: string;
203
- numericOnly: string;
204
- uploadPdfFile: string;
205
- dropToStart: string;
206
- expand: string;
207
- collapse: string;
208
- add: string;
209
- delete: string;
210
- revert: string;
211
- removeBtnPressToRemove: string;
212
- file: string;
213
- captureVideo: string;
214
- captureAudio: string;
215
- captureImage: string;
216
- browseFiles: string;
217
- noComponentsSetInGrid: string;
218
- sortAscending: string;
219
- sortDescending: string;
220
- filter: string;
221
- clear: string;
222
- showItemsWithValue: string;
223
- gridItemsPerPage: string;
224
- gridAllItems: string;
225
- recordsSelectedOnPage: string;
226
- recordsSelectedInTable: string;
227
- gridSelectAll: string;
228
- itemsInTable: string;
229
- clearSelection: string;
230
- editGridRow: string;
231
- deleteGridRow: string;
232
- selected: string;
233
- actions: string;
234
- };
1
+ declare const _default: any;
235
2
  export default _default;