@formio/js 5.0.0-rc.59 → 5.0.0-rc.60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. package/dist/formio.builder.css +8 -8
  2. package/dist/formio.builder.min.css +1 -1
  3. package/dist/formio.embed.js +1 -1
  4. package/dist/formio.embed.min.js +1 -1
  5. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  6. package/dist/formio.form.css +8 -8
  7. package/dist/formio.form.js +24 -24
  8. package/dist/formio.form.min.css +1 -1
  9. package/dist/formio.form.min.js +1 -1
  10. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  11. package/dist/formio.full.css +8 -8
  12. package/dist/formio.full.js +64 -64
  13. package/dist/formio.full.min.css +1 -1
  14. package/dist/formio.full.min.js +1 -1
  15. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  16. package/dist/formio.js +4 -4
  17. package/dist/formio.min.js +1 -1
  18. package/dist/formio.min.js.LICENSE.txt +1 -1
  19. package/dist/formio.utils.js +2 -2
  20. package/dist/formio.utils.min.js +1 -1
  21. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  22. package/lib/cjs/Element.d.ts +1 -1
  23. package/lib/cjs/Embed.d.ts +2 -2
  24. package/lib/cjs/Embed.js +10 -10
  25. package/lib/cjs/Form.d.ts +3 -3
  26. package/lib/cjs/FormBuilder.d.ts +42 -3
  27. package/lib/cjs/InlineEmbed.js +2 -2
  28. package/lib/cjs/PDF.d.ts +1 -1
  29. package/lib/cjs/Webform.d.ts +4 -3
  30. package/lib/cjs/Webform.js +2 -1
  31. package/lib/cjs/WebformBuilder.d.ts +1 -1
  32. package/lib/cjs/WebformBuilder.js +8 -2
  33. package/lib/cjs/components/_classes/component/Component.form.d.ts +1 -1
  34. package/lib/cjs/components/_classes/component/Component.form.js +1 -1
  35. package/lib/cjs/components/_classes/component/Component.js +2 -5
  36. package/lib/cjs/components/_classes/component/fixtures/comp6.d.ts +77 -0
  37. package/lib/cjs/components/_classes/component/fixtures/comp6.js +59 -0
  38. package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
  39. package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
  40. package/lib/cjs/components/_classes/input/Input.js +6 -4
  41. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +1 -1
  42. package/lib/cjs/components/_classes/list/ListComponent.form.js +1 -1
  43. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +7 -7
  44. package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +1 -1
  45. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +1 -1
  46. package/lib/cjs/components/address/Address.form.d.ts +1 -1
  47. package/lib/cjs/components/address/Address.form.js +1 -1
  48. package/lib/cjs/components/button/Button.form.d.ts +1 -1
  49. package/lib/cjs/components/button/Button.form.js +1 -1
  50. package/lib/cjs/components/checkbox/Checkbox.form.d.ts +1 -1
  51. package/lib/cjs/components/checkbox/Checkbox.form.js +1 -1
  52. package/lib/cjs/components/columns/Columns.form.d.ts +1 -1
  53. package/lib/cjs/components/columns/Columns.form.js +1 -1
  54. package/lib/cjs/components/container/Container.form.d.ts +1 -1
  55. package/lib/cjs/components/container/Container.form.js +1 -1
  56. package/lib/cjs/components/content/Content.form.d.ts +1 -1
  57. package/lib/cjs/components/content/Content.form.js +1 -1
  58. package/lib/cjs/components/currency/Currency.form.d.ts +1 -1
  59. package/lib/cjs/components/currency/Currency.form.js +1 -1
  60. package/lib/cjs/components/datagrid/DataGrid.form.d.ts +1 -1
  61. package/lib/cjs/components/datagrid/DataGrid.form.js +1 -1
  62. package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
  63. package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.js +36 -0
  64. package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
  65. package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
  66. package/lib/cjs/components/datamap/DataMap.form.d.ts +1 -1
  67. package/lib/cjs/components/datamap/DataMap.form.js +1 -1
  68. package/lib/cjs/components/datetime/DateTime.form.d.ts +1 -1
  69. package/lib/cjs/components/datetime/DateTime.form.js +1 -1
  70. package/lib/cjs/components/day/Day.d.ts +1 -1
  71. package/lib/cjs/components/day/Day.form.d.ts +1 -1
  72. package/lib/cjs/components/day/Day.form.js +1 -1
  73. package/lib/cjs/components/day/Day.js +1 -1
  74. package/lib/cjs/components/day/fixtures/comp7.d.ts +109 -0
  75. package/lib/cjs/components/day/fixtures/comp7.js +109 -0
  76. package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
  77. package/lib/cjs/components/day/fixtures/index.js +3 -1
  78. package/lib/cjs/components/editgrid/EditGrid.form.d.ts +1 -1
  79. package/lib/cjs/components/editgrid/EditGrid.form.js +1 -1
  80. package/lib/cjs/components/email/Email.form.d.ts +1 -1
  81. package/lib/cjs/components/email/Email.form.js +1 -1
  82. package/lib/cjs/components/fieldset/Fieldset.form.d.ts +1 -1
  83. package/lib/cjs/components/fieldset/Fieldset.form.js +1 -1
  84. package/lib/cjs/components/file/File.form.d.ts +1 -1
  85. package/lib/cjs/components/file/File.form.js +1 -1
  86. package/lib/cjs/components/file/File.js +1 -2
  87. package/lib/cjs/components/form/Form.form.d.ts +1 -1
  88. package/lib/cjs/components/form/Form.form.js +1 -1
  89. package/lib/cjs/components/form/Form.js +7 -6
  90. package/lib/cjs/components/hidden/Hidden.form.d.ts +1 -1
  91. package/lib/cjs/components/hidden/Hidden.form.js +1 -1
  92. package/lib/cjs/components/html/HTML.form.d.ts +1 -1
  93. package/lib/cjs/components/html/HTML.form.js +1 -1
  94. package/lib/cjs/components/number/Number.form.d.ts +1 -1
  95. package/lib/cjs/components/number/Number.form.js +1 -1
  96. package/lib/cjs/components/panel/Panel.form.d.ts +1 -1
  97. package/lib/cjs/components/panel/Panel.form.js +1 -1
  98. package/lib/cjs/components/password/Password.form.d.ts +1 -1
  99. package/lib/cjs/components/password/Password.form.js +1 -1
  100. package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +1 -1
  101. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +1 -1
  102. package/lib/cjs/components/radio/Radio.form.d.ts +1 -1
  103. package/lib/cjs/components/radio/Radio.form.js +1 -1
  104. package/lib/cjs/components/radio/Radio.js +3 -2
  105. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
  106. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +1 -1
  107. package/lib/cjs/components/select/Select.form.d.ts +1 -1
  108. package/lib/cjs/components/select/Select.form.js +1 -1
  109. package/lib/cjs/components/select/Select.js +1 -1
  110. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +1 -1
  111. package/lib/cjs/components/selectboxes/SelectBoxes.form.js +1 -1
  112. package/lib/cjs/components/signature/Signature.form.d.ts +1 -1
  113. package/lib/cjs/components/signature/Signature.form.js +1 -1
  114. package/lib/cjs/components/survey/Survey.form.d.ts +1 -1
  115. package/lib/cjs/components/survey/Survey.form.js +1 -1
  116. package/lib/cjs/components/table/Table.form.d.ts +1 -1
  117. package/lib/cjs/components/table/Table.form.js +1 -1
  118. package/lib/cjs/components/tabs/Tabs.form.d.ts +1 -1
  119. package/lib/cjs/components/tabs/Tabs.form.js +1 -1
  120. package/lib/cjs/components/tags/Tags.form.d.ts +1 -1
  121. package/lib/cjs/components/tags/Tags.form.js +1 -1
  122. package/lib/cjs/components/textarea/TextArea.form.d.ts +1 -1
  123. package/lib/cjs/components/textarea/TextArea.form.js +1 -1
  124. package/lib/cjs/components/textfield/TextField.form.d.ts +1 -1
  125. package/lib/cjs/components/textfield/TextField.form.js +1 -1
  126. package/lib/cjs/components/textfield/TextField.js +3 -1
  127. package/lib/cjs/components/time/Time.form.d.ts +1 -1
  128. package/lib/cjs/components/time/Time.form.js +1 -1
  129. package/lib/cjs/components/unknown/Unknown.form.js +1 -1
  130. package/lib/cjs/components/url/Url.form.d.ts +1 -1
  131. package/lib/cjs/components/url/Url.form.js +1 -1
  132. package/lib/cjs/components/well/Well.form.d.ts +1 -1
  133. package/lib/cjs/components/well/Well.form.js +1 -1
  134. package/lib/cjs/formio.form.js +3 -3
  135. package/lib/cjs/providers/address/AzureAddressProvider.d.ts +1 -1
  136. package/lib/cjs/providers/address/GoogleAddressProvider.js +1 -1
  137. package/lib/cjs/providers/storage/util.js +3 -4
  138. package/lib/cjs/templates/index.d.ts +14 -14
  139. package/lib/cjs/translations/en.d.ts +2 -0
  140. package/lib/cjs/translations/en.js +3 -1
  141. package/lib/cjs/utils/ChoicesWrapper.d.ts +1 -1
  142. package/lib/cjs/utils/ChoicesWrapper.js +13 -2
  143. package/lib/cjs/utils/calendarUtils.js +3 -3
  144. package/lib/cjs/utils/formUtils.d.ts +3 -3
  145. package/lib/cjs/utils/formUtils.js +2 -2
  146. package/lib/cjs/utils/utils.d.ts +20 -14
  147. package/lib/cjs/utils/utils.js +82 -72
  148. package/lib/mjs/Element.d.ts +1 -1
  149. package/lib/mjs/Embed.d.ts +2 -2
  150. package/lib/mjs/Form.d.ts +3 -3
  151. package/lib/mjs/FormBuilder.d.ts +42 -3
  152. package/lib/mjs/PDF.d.ts +1 -1
  153. package/lib/mjs/Webform.d.ts +4 -3
  154. package/lib/mjs/Webform.js +2 -1
  155. package/lib/mjs/WebformBuilder.d.ts +1 -1
  156. package/lib/mjs/WebformBuilder.js +8 -2
  157. package/lib/mjs/components/_classes/component/Component.form.d.ts +1 -1
  158. package/lib/mjs/components/_classes/component/Component.js +2 -5
  159. package/lib/mjs/components/_classes/component/fixtures/comp6.d.ts +77 -0
  160. package/lib/mjs/components/_classes/component/fixtures/comp6.js +57 -0
  161. package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
  162. package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
  163. package/lib/mjs/components/_classes/input/Input.js +6 -4
  164. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +1 -1
  165. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +7 -7
  166. package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +1 -1
  167. package/lib/mjs/components/address/Address.form.d.ts +1 -1
  168. package/lib/mjs/components/button/Button.form.d.ts +1 -1
  169. package/lib/mjs/components/checkbox/Checkbox.form.d.ts +1 -1
  170. package/lib/mjs/components/columns/Columns.form.d.ts +1 -1
  171. package/lib/mjs/components/container/Container.form.d.ts +1 -1
  172. package/lib/mjs/components/content/Content.form.d.ts +1 -1
  173. package/lib/mjs/components/currency/Currency.form.d.ts +1 -1
  174. package/lib/mjs/components/datagrid/DataGrid.form.d.ts +1 -1
  175. package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
  176. package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.js +34 -0
  177. package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
  178. package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
  179. package/lib/mjs/components/datamap/DataMap.form.d.ts +1 -1
  180. package/lib/mjs/components/datetime/DateTime.form.d.ts +1 -1
  181. package/lib/mjs/components/day/Day.d.ts +1 -1
  182. package/lib/mjs/components/day/Day.form.d.ts +1 -1
  183. package/lib/mjs/components/day/Day.js +1 -1
  184. package/lib/mjs/components/day/fixtures/comp7.d.ts +109 -0
  185. package/lib/mjs/components/day/fixtures/comp7.js +107 -0
  186. package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
  187. package/lib/mjs/components/day/fixtures/index.js +2 -1
  188. package/lib/mjs/components/editgrid/EditGrid.form.d.ts +1 -1
  189. package/lib/mjs/components/email/Email.form.d.ts +1 -1
  190. package/lib/mjs/components/fieldset/Fieldset.form.d.ts +1 -1
  191. package/lib/mjs/components/file/File.form.d.ts +1 -1
  192. package/lib/mjs/components/file/File.js +1 -2
  193. package/lib/mjs/components/form/Form.form.d.ts +1 -1
  194. package/lib/mjs/components/form/Form.js +5 -4
  195. package/lib/mjs/components/hidden/Hidden.form.d.ts +1 -1
  196. package/lib/mjs/components/html/HTML.form.d.ts +1 -1
  197. package/lib/mjs/components/number/Number.form.d.ts +1 -1
  198. package/lib/mjs/components/panel/Panel.form.d.ts +1 -1
  199. package/lib/mjs/components/password/Password.form.d.ts +1 -1
  200. package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +1 -1
  201. package/lib/mjs/components/radio/Radio.form.d.ts +1 -1
  202. package/lib/mjs/components/radio/Radio.js +3 -2
  203. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
  204. package/lib/mjs/components/select/Select.form.d.ts +1 -1
  205. package/lib/mjs/components/select/Select.js +2 -2
  206. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +1 -1
  207. package/lib/mjs/components/signature/Signature.form.d.ts +1 -1
  208. package/lib/mjs/components/survey/Survey.form.d.ts +1 -1
  209. package/lib/mjs/components/table/Table.form.d.ts +1 -1
  210. package/lib/mjs/components/tabs/Tabs.form.d.ts +1 -1
  211. package/lib/mjs/components/tags/Tags.form.d.ts +1 -1
  212. package/lib/mjs/components/textarea/TextArea.form.d.ts +1 -1
  213. package/lib/mjs/components/textfield/TextField.form.d.ts +1 -1
  214. package/lib/mjs/components/textfield/TextField.js +3 -1
  215. package/lib/mjs/components/time/Time.form.d.ts +1 -1
  216. package/lib/mjs/components/url/Url.form.d.ts +1 -1
  217. package/lib/mjs/components/well/Well.form.d.ts +1 -1
  218. package/lib/mjs/providers/address/AzureAddressProvider.d.ts +1 -1
  219. package/lib/mjs/providers/address/GoogleAddressProvider.js +1 -1
  220. package/lib/mjs/templates/index.d.ts +14 -14
  221. package/lib/mjs/translations/en.d.ts +2 -0
  222. package/lib/mjs/translations/en.js +3 -1
  223. package/lib/mjs/utils/ChoicesWrapper.d.ts +1 -1
  224. package/lib/mjs/utils/ChoicesWrapper.js +13 -2
  225. package/lib/mjs/utils/formUtils.d.ts +3 -3
  226. package/lib/mjs/utils/utils.d.ts +20 -14
  227. package/lib/mjs/utils/utils.js +12 -2
  228. package/package.json +11 -11
@@ -17,26 +17,44 @@ export default class FormBuilder extends Form {
17
17
  */
18
18
  /** @type {FormBuilderOptions} */
19
19
  static options: {
20
+ /**
21
+ * - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
22
+ */
20
23
  /**
21
24
  * - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
22
25
  */
23
26
  disabled?: string[] | undefined;
27
+ /**
28
+ * - When set to TRUE no modal is shown when a component is dragged onto the form.
29
+ */
24
30
  /**
25
31
  * - When set to TRUE no modal is shown when a component is dragged onto the form.
26
32
  */
27
33
  noNewEdit?: boolean | undefined;
34
+ /**
35
+ * - Set to TRUE to not include the default submit button in Webforms.
36
+ */
28
37
  /**
29
38
  * - Set to TRUE to not include the default submit button in Webforms.
30
39
  */
31
40
  noDefaultSubmitButton?: boolean | undefined;
41
+ /**
42
+ * - Set to TRUE to always require confirmation before removing a component.
43
+ */
32
44
  /**
33
45
  * - Set to TRUE to always require confirmation before removing a component.
34
46
  */
35
47
  alwaysConfirmComponentRemoval?: boolean | undefined;
48
+ /**
49
+ * - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
50
+ */
36
51
  /**
37
52
  * - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
38
53
  */
39
54
  formConfig?: object | undefined;
55
+ /**
56
+ * - The tag to use to query for the "Existing Resource Fields" section of the builder.
57
+ */
40
58
  /**
41
59
  * - The tag to use to query for the "Existing Resource Fields" section of the builder.
42
60
  */
@@ -44,27 +62,48 @@ export default class FormBuilder extends Form {
44
62
  /**
45
63
  * - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
46
64
  */
47
- editForm?: any;
65
+ /**
66
+ * - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
67
+ */
68
+ editForm?: import("./Form").FormOptions;
69
+ /**
70
+ * - The language to load into the form builder.
71
+ */
48
72
  /**
49
73
  * - The language to load into the form builder.
50
74
  */
51
75
  language?: string | undefined;
76
+ /**
77
+ * - The builder options to pass to the builder.
78
+ */
52
79
  /**
53
80
  * - The builder options to pass to the builder.
54
81
  */
55
82
  builder?: object | undefined;
83
+ /**
84
+ * - The display mode of the builder.
85
+ */
56
86
  /**
57
87
  * - The display mode of the builder.
58
88
  */
59
89
  display?: "form" | "pdf" | "wizard" | undefined;
90
+ /**
91
+ * - Filter applied to the resources that appear in the builder's Existing Resource Fields.
92
+ */
60
93
  /**
61
94
  * - Filter applied to the resources that appear in the builder's Existing Resource Fields.
62
95
  */
63
96
  resourceFilter?: string | undefined;
97
+ /**
98
+ * - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
99
+ */
64
100
  /**
65
101
  * - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
66
102
  */
67
103
  noSource?: boolean | undefined;
104
+ /**
105
+ * - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
106
+ */
68
107
  /**
69
108
  * - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
70
109
  */
@@ -105,7 +144,7 @@ export default class FormBuilder extends Form {
105
144
  /**
106
145
  * - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
107
146
  */
108
- editForm?: any;
147
+ editForm?: import("./Form").FormOptions;
109
148
  /**
110
149
  * - The language to load into the form builder.
111
150
  */
@@ -160,7 +199,7 @@ export default class FormBuilder extends Form {
160
199
  /**
161
200
  * - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
162
201
  */
163
- editForm?: any;
202
+ editForm?: import("./Form").FormOptions;
164
203
  /**
165
204
  * - The language to load into the form builder.
166
205
  */
package/lib/mjs/PDF.d.ts CHANGED
@@ -28,7 +28,7 @@ export default class PDF extends Webform {
28
28
  * @param {any} flags - The flags to use when setting the submission.
29
29
  * @returns {boolean} - If the value changed or not.
30
30
  */
31
- setValue(submission: import('@formio/core').Submission, flags?: any): boolean;
31
+ setValue(submission: import("@formio/core").Submission, flags?: any): boolean;
32
32
  postMessage(message: any): void;
33
33
  iframeFormSetUp: boolean | undefined;
34
34
  focusOnComponent(key: any): void;
@@ -89,11 +89,11 @@ declare class Webform extends NestedDataComponent {
89
89
  * @param {HTMLElement | object | import('Form').FormOptions} [elementOrOptions] - The DOM element to render this form within or the options to create this form instance.
90
90
  * @param {import('Form').FormOptions} [options] - The options to create a new form instance.
91
91
  */
92
- constructor(elementOrOptions?: HTMLElement | object | import('Form').FormOptions, options?: any);
92
+ constructor(elementOrOptions?: HTMLElement | object | import("Form").FormOptions, options?: import("Form").FormOptions);
93
93
  /**
94
94
  * @type {import('Form').FormOptions} - the options for this Webform.
95
95
  */
96
- options: any;
96
+ options: import("Form").FormOptions;
97
97
  _src: string;
98
98
  _loading: boolean;
99
99
  _form: {};
@@ -459,7 +459,7 @@ export default Webform;
459
459
  /**
460
460
  * Represents a JSON value.
461
461
  */
462
- export type JSON = (string | number | boolean | null | JSON[] | JSONObject);
462
+ export type JSON = (string | number | boolean | null | JSONArray | JSONObject);
463
463
  /**
464
464
  * Represents a JSON array.
465
465
  */
@@ -733,4 +733,5 @@ export type FormOptions = {
733
733
  zoom?: number | undefined;
734
734
  };
735
735
  import NestedDataComponent from "./components/_classes/nesteddata/NestedDataComponent";
736
+ import { Formio } from "./Formio";
736
737
  import EventEmitter from "./EventEmitter";
@@ -773,8 +773,9 @@ export default class Webform extends NestedDataComponent {
773
773
  formio
774
774
  .loadSubmissions({
775
775
  params: {
776
- state: "draft",
776
+ state: 'draft',
777
777
  owner: userId,
778
+ sort: '-created'
778
779
  },
779
780
  })
780
781
  .then((submissions) => {
@@ -59,7 +59,7 @@ export default class WebformBuilder extends Component {
59
59
  * @param {import('@formio/core').Component} component - The component to find the namespace root for.
60
60
  * @returns {import('@formio/core').Component[]} - The components root for this namespace.
61
61
  */
62
- findNamespaceRoot(component: import('@formio/core').Component): import('@formio/core').Component[];
62
+ findNamespaceRoot(component: import("@formio/core").Component): import("@formio/core").Component[];
63
63
  recurseNamespace(component: any): any;
64
64
  render(): any;
65
65
  attach(element: any): Promise<any>;
@@ -970,8 +970,14 @@ export default class WebformBuilder extends Component {
970
970
  else if (parent.formioComponent && parent.formioComponent.removeChildComponent) {
971
971
  parent.formioComponent.removeChildComponent(component);
972
972
  }
973
- if (component.input && componentInstance && componentInstance.parent) {
974
- _.unset(componentInstance._data, componentInstance.key);
973
+ if (component.input && componentInstance && parent.formioComponent) {
974
+ const parentDefaultValue = _.get(parent.formioComponent, 'component.defaultValue', null);
975
+ if (Array.isArray(parentDefaultValue)) {
976
+ parentDefaultValue.forEach(v => _.unset(v, componentInstance.key));
977
+ }
978
+ else if (typeof parentDefaultValue === 'object') {
979
+ _.unset(parentDefaultValue, componentInstance.key);
980
+ }
975
981
  }
976
982
  const rebuild = parent.formioComponent.rebuild() || Promise.resolve();
977
983
  rebuild.then(() => {
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -2045,9 +2045,6 @@ export default class Component extends Element {
2045
2045
  messages = _.uniqBy(messages, message => message.message);
2046
2046
  if (this.refs.messageContainer) {
2047
2047
  this.setContent(this.refs.messageContainer, messages.map((message) => {
2048
- if (message.message && typeof message.message === 'string') {
2049
- message.message = message.message.replaceAll('<', '&lt;').replaceAll('>', '&gt;');
2050
- }
2051
2048
  return this.renderTemplate('message', { ...message });
2052
2049
  }).join(''));
2053
2050
  }
@@ -2637,7 +2634,7 @@ export default class Component extends Element {
2637
2634
  */
2638
2635
  resetValue() {
2639
2636
  this.unset();
2640
- this.setValue(this.emptyValue, {
2637
+ this.setValue(this.defaultValue || this.emptyValue, {
2641
2638
  noUpdateEvent: true,
2642
2639
  noValidate: true,
2643
2640
  resetValue: true
@@ -2776,7 +2773,7 @@ export default class Component extends Element {
2776
2773
  }
2777
2774
  this.calculatedValue = fastCloneDeep(calculatedValue);
2778
2775
  if (changed) {
2779
- if (!flags.noPristineChangeOnModified) {
2776
+ if (!flags.noPristineChangeOnModified && this.root.initialized) {
2780
2777
  this.pristine = false;
2781
2778
  }
2782
2779
  flags.triggeredComponentId = this.id;
@@ -0,0 +1,77 @@
1
+ declare namespace _default {
2
+ let components: ({
3
+ label: string;
4
+ applyMaskOn: string;
5
+ tableView: boolean;
6
+ key: string;
7
+ type: string;
8
+ input: boolean;
9
+ defaultValue: string;
10
+ mask?: undefined;
11
+ delimiter?: undefined;
12
+ requireDecimal?: undefined;
13
+ inputFormat?: undefined;
14
+ truncateMultipleSpaces?: undefined;
15
+ widget?: undefined;
16
+ data?: undefined;
17
+ action?: undefined;
18
+ showValidations?: undefined;
19
+ } | {
20
+ label: string;
21
+ applyMaskOn: string;
22
+ mask: boolean;
23
+ tableView: boolean;
24
+ delimiter: boolean;
25
+ requireDecimal: boolean;
26
+ inputFormat: string;
27
+ truncateMultipleSpaces: boolean;
28
+ key: string;
29
+ type: string;
30
+ input: boolean;
31
+ defaultValue: number;
32
+ widget?: undefined;
33
+ data?: undefined;
34
+ action?: undefined;
35
+ showValidations?: undefined;
36
+ } | {
37
+ label: string;
38
+ widget: string;
39
+ tableView: boolean;
40
+ data: {
41
+ values: {
42
+ label: string;
43
+ value: string;
44
+ }[];
45
+ };
46
+ key: string;
47
+ type: string;
48
+ input: boolean;
49
+ defaultValue: string;
50
+ applyMaskOn?: undefined;
51
+ mask?: undefined;
52
+ delimiter?: undefined;
53
+ requireDecimal?: undefined;
54
+ inputFormat?: undefined;
55
+ truncateMultipleSpaces?: undefined;
56
+ action?: undefined;
57
+ showValidations?: undefined;
58
+ } | {
59
+ label: string;
60
+ action: string;
61
+ showValidations: boolean;
62
+ tableView: boolean;
63
+ key: string;
64
+ type: string;
65
+ input: boolean;
66
+ applyMaskOn?: undefined;
67
+ defaultValue?: undefined;
68
+ mask?: undefined;
69
+ delimiter?: undefined;
70
+ requireDecimal?: undefined;
71
+ inputFormat?: undefined;
72
+ truncateMultipleSpaces?: undefined;
73
+ widget?: undefined;
74
+ data?: undefined;
75
+ })[];
76
+ }
77
+ export default _default;
@@ -0,0 +1,57 @@
1
+ export default {
2
+ "components": [
3
+ {
4
+ "label": "Text Field",
5
+ "applyMaskOn": "change",
6
+ "tableView": true,
7
+ "key": "textField",
8
+ "type": "textfield",
9
+ "input": true,
10
+ "defaultValue": "test"
11
+ },
12
+ {
13
+ "label": "Number",
14
+ "applyMaskOn": "change",
15
+ "mask": false,
16
+ "tableView": false,
17
+ "delimiter": false,
18
+ "requireDecimal": false,
19
+ "inputFormat": "plain",
20
+ "truncateMultipleSpaces": false,
21
+ "key": "number",
22
+ "type": "number",
23
+ "input": true,
24
+ "defaultValue": 123
25
+ },
26
+ {
27
+ "label": "Select",
28
+ "widget": "choicesjs",
29
+ "tableView": true,
30
+ "data": {
31
+ "values": [
32
+ {
33
+ "label": "a",
34
+ "value": "a"
35
+ },
36
+ {
37
+ "label": "b",
38
+ "value": "b"
39
+ }
40
+ ]
41
+ },
42
+ "key": "select",
43
+ "type": "select",
44
+ "input": true,
45
+ "defaultValue": "a"
46
+ },
47
+ {
48
+ "label": "Reset",
49
+ "action": "reset",
50
+ "showValidations": false,
51
+ "tableView": false,
52
+ "key": "reset",
53
+ "type": "button",
54
+ "input": true
55
+ },
56
+ ]
57
+ };
@@ -3,4 +3,5 @@ import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
- export { comp1, comp2, comp3, comp4, comp5 };
6
+ import comp6 from './comp6';
7
+ export { comp1, comp2, comp3, comp4, comp5, comp6 };
@@ -3,4 +3,5 @@ import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
- export { comp1, comp2, comp3, comp4, comp5 };
6
+ import comp6 from './comp6';
7
+ export { comp1, comp2, comp3, comp4, comp5, comp6 };
@@ -146,13 +146,15 @@ export default class Input extends Multivalue {
146
146
  else {
147
147
  this.addClass(element, 'text-danger');
148
148
  }
149
- this.setContent(element, this.t(`{{ remaining }} ${type} remaining.`, {
150
- remaining: remaining
149
+ this.setContent(element, this.t(`typeRemaining`, {
150
+ remaining: remaining,
151
+ type: type
151
152
  }));
152
153
  }
153
154
  else {
154
- this.setContent(element, this.t(`{{ count }} ${type}`, {
155
- count: count
155
+ this.setContent(element, this.t(`typeCount`, {
156
+ count: count,
157
+ type: type
156
158
  }));
157
159
  }
158
160
  }
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -103,7 +103,7 @@ export default class NestedComponent extends Field {
103
103
  * @param {import('@formio/core').Component} component - The component to check.
104
104
  * @returns {boolean} - TRUE if the component has a component, FALSE otherwise.
105
105
  */
106
- hasComponent(component: import('@formio/core').Component): boolean;
106
+ hasComponent(component: import("@formio/core").Component): boolean;
107
107
  /**
108
108
  * Get the flattened components of this NestedComponent.
109
109
  * @returns {object} - The flattened components of this NestedComponent.
@@ -139,7 +139,7 @@ export default class NestedComponent extends Field {
139
139
  * @param {import('@formio/core').Component} [replacedComp] - The component to replace with this component.
140
140
  * @returns {any} - The created component instance.
141
141
  */
142
- createComponent(component: import('@formio/core').Component, options: object, data: import('@formio/core').DataObject, before?: import("@formio/core").Component | undefined, replacedComp?: import("@formio/core").Component | undefined): any;
142
+ createComponent(component: import("@formio/core").Component, options: object, data: import("@formio/core").DataObject, before?: import("@formio/core").Component | undefined, replacedComp?: import("@formio/core").Component | undefined): any;
143
143
  getContainer(): any;
144
144
  get componentComponents(): any;
145
145
  get nestedKey(): string;
@@ -159,7 +159,7 @@ export default class NestedComponent extends Field {
159
159
  * @param {boolean} [noAdd] - A possibly extraneous boolean flag.
160
160
  * @returns {any} - The created component instance.
161
161
  */
162
- addComponent(component: import('@formio/core').Component, data?: object, before?: HTMLElement, noAdd?: boolean | undefined): any;
162
+ addComponent(component: import("@formio/core").Component, data?: object, before?: HTMLElement, noAdd?: boolean | undefined): any;
163
163
  beforeFocus(): void;
164
164
  render(children: any): Field;
165
165
  renderComponents(components: any): any;
@@ -168,7 +168,7 @@ export default class NestedComponent extends Field {
168
168
  * Attach the logic to the components.
169
169
  * @param {import('@formio/core').Component[]} components - The components to attach logic to.
170
170
  */
171
- attachComponentsLogic(components: import('@formio/core').Component[]): void;
171
+ attachComponentsLogic(components: import("@formio/core").Component[]): void;
172
172
  attachComponents(element: any, components: any, container: any): Promise<any>;
173
173
  /**
174
174
  * Remove a component from the components array and from the children object
@@ -176,7 +176,7 @@ export default class NestedComponent extends Field {
176
176
  * @param {import('@formio/core').Component[]} components - An array of components to remove this component from.
177
177
  * @param {boolean} [all] - If set to TRUE will cascade remove all components.
178
178
  */
179
- removeComponent(component: import('@formio/core').Component, components: import('@formio/core').Component[], all?: boolean | undefined): void;
179
+ removeComponent(component: import("@formio/core").Component, components: import("@formio/core").Component[], all?: boolean | undefined): void;
180
180
  /**
181
181
  * Removes a component provided the API key of that component.
182
182
  * @param {string} key - The API key of the component to remove.
@@ -224,14 +224,14 @@ export default class NestedComponent extends Field {
224
224
  * @param {object} flags - The flags to use when validating.
225
225
  * @returns {Promise<Array>|Array} - The errors if any exist.
226
226
  */
227
- validateComponents(components?: import('@formio/core').Component[], data?: import('@formio/core').DataObject, flags?: object): Promise<any[]> | any[];
227
+ validateComponents(components?: import("@formio/core").Component[], data?: import("@formio/core").DataObject, flags?: object): Promise<any[]> | any[];
228
228
  /**
229
229
  * Validate a nested component with data, or its own internal data.
230
230
  * @param {import('@formio/core').DataObject} data - The data to validate.
231
231
  * @param {object} flags - The flags to use when validating.
232
232
  * @returns {Array} - The errors if any exist.
233
233
  */
234
- validate(data?: import('@formio/core').DataObject, flags?: object): any[];
234
+ validate(data?: import("@formio/core").DataObject, flags?: object): any[];
235
235
  checkComponentValidity(data?: null, dirty?: boolean, row?: null, flags?: {}, allErrors?: any[]): boolean;
236
236
  checkAsyncValidity(data?: null, dirty?: boolean, row?: null, silentCheck?: boolean): Promise<any>;
237
237
  setPristine(pristine: any): void;
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -0,0 +1,29 @@
1
+ declare namespace _default {
2
+ let label: string;
3
+ let reorder: boolean;
4
+ let addAnotherPosition: string;
5
+ let layoutFixed: boolean;
6
+ let enableRowGroups: boolean;
7
+ let initEmpty: boolean;
8
+ let tableView: boolean;
9
+ let defaultValue: {}[];
10
+ let key: string;
11
+ let type: string;
12
+ let input: boolean;
13
+ let components: {
14
+ label: string;
15
+ optionsLabelPosition: string;
16
+ inline: boolean;
17
+ tableView: boolean;
18
+ values: {
19
+ label: string;
20
+ value: string;
21
+ shortcut: string;
22
+ }[];
23
+ key: string;
24
+ type: string;
25
+ input: boolean;
26
+ inputType: string;
27
+ }[];
28
+ }
29
+ export default _default;
@@ -0,0 +1,34 @@
1
+ export default {
2
+ 'label': 'Data Grid',
3
+ 'reorder': false,
4
+ 'addAnotherPosition': 'bottom',
5
+ 'layoutFixed': false,
6
+ 'enableRowGroups': false,
7
+ 'initEmpty': false,
8
+ 'tableView': false,
9
+ 'defaultValue': [
10
+ {}
11
+ ],
12
+ 'key': 'dataGrid',
13
+ 'type': 'datagrid',
14
+ 'input': true,
15
+ 'components': [
16
+ {
17
+ 'label': 'Radio',
18
+ 'optionsLabelPosition': 'right',
19
+ 'inline': false,
20
+ 'tableView': false,
21
+ 'values': [
22
+ {
23
+ 'label': 'yes',
24
+ 'value': 'yes',
25
+ 'shortcut': ''
26
+ }
27
+ ],
28
+ 'key': 'radio',
29
+ 'type': 'radio',
30
+ 'input': true,
31
+ 'inputType': 'checkbox'
32
+ }
33
+ ]
34
+ };
@@ -14,4 +14,5 @@ import withRowGroupsAndDefValue from './comp-row-groups-with-def-value';
14
14
  import modalWithRequiredFields from './comp-modal-with-required-fields';
15
15
  import withAllowCalculateOverride from './comp-with-allow-calculate-override';
16
16
  import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
17
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride };
17
+ import withCheckboxes from './comp-with-checkboxes';
18
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
@@ -14,4 +14,5 @@ import withLogic from './comp-with-logic';
14
14
  import withCollapsibleRowGroups from './comp-with-collapsible-groups';
15
15
  import withAllowCalculateOverride from './comp-with-allow-calculate-override';
16
16
  import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
17
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride };
17
+ import withCheckboxes from './comp-with-checkboxes';
18
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -3,4 +3,4 @@
3
3
  * @param {...any} extend - The components that extend the edit form.
4
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
5
5
  */
6
- export default function _default(...extend: any[]): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import("@formio/core").Component[];
@@ -35,7 +35,7 @@ export default class DayComponent extends Field {
35
35
  id: string;
36
36
  class: string;
37
37
  type: string;
38
- placeholder: any;
38
+ placeholder: string;
39
39
  step: number;
40
40
  min: any;
41
41
  max: any;