@formio/js 5.0.0-rc.52 → 5.0.0-rc.54

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +551 -541
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +3 -1
  7. package/dist/formio.full.js +553 -543
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +3 -1
  10. package/dist/formio.js +10 -10
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.js +14 -4
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +3 -1
  16. package/embed.d.ts +1 -0
  17. package/form.d.ts +1 -0
  18. package/lib/cjs/Form.d.ts +281 -10
  19. package/lib/cjs/Form.js +22 -35
  20. package/lib/cjs/FormBuilder.d.ts +187 -2
  21. package/lib/cjs/FormBuilder.js +29 -6
  22. package/lib/cjs/InlineEmbed.d.ts +7 -0
  23. package/lib/cjs/InlineEmbed.js +109 -0
  24. package/lib/cjs/PDF.d.ts +0 -1
  25. package/lib/cjs/Webform.d.ts +6 -6
  26. package/lib/cjs/Webform.js +2 -2
  27. package/lib/cjs/Wizard.d.ts +1 -1
  28. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -6
  29. package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -4
  30. package/lib/cjs/components/_classes/field/Field.d.ts +11 -2
  31. package/lib/cjs/components/_classes/field/Field.js +13 -1
  32. package/lib/cjs/components/_classes/input/Input.d.ts +4 -3
  33. package/lib/cjs/components/_classes/input/Input.js +2 -2
  34. package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +4 -5
  35. package/lib/cjs/components/_classes/list/ListComponent.form.js +3 -2
  36. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +42 -11
  37. package/lib/cjs/components/_classes/multivalue/Multivalue.js +37 -3
  38. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +127 -33
  39. package/lib/cjs/components/_classes/nested/NestedComponent.js +133 -15
  40. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +6 -0
  41. package/lib/cjs/components/address/Address.d.ts +2 -1
  42. package/lib/cjs/components/button/Button.d.ts +1 -1
  43. package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
  44. package/lib/cjs/components/columns/Columns.d.ts +1 -1
  45. package/lib/cjs/components/container/Container.d.ts +1 -0
  46. package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -1
  47. package/lib/cjs/components/day/Day.d.ts +1 -1
  48. package/lib/cjs/components/editgrid/EditGrid.d.ts +2 -0
  49. package/lib/cjs/components/file/File.d.ts +2 -2
  50. package/lib/cjs/components/number/Number.d.ts +1 -1
  51. package/lib/cjs/components/radio/Radio.d.ts +1 -1
  52. package/lib/cjs/components/radio/Radio.form.d.ts +1 -3
  53. package/lib/cjs/components/radio/Radio.js +3 -3
  54. package/lib/cjs/components/select/Select.d.ts +9 -14
  55. package/lib/cjs/components/select/Select.form.d.ts +1 -3
  56. package/lib/cjs/components/select/Select.js +11 -15
  57. package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +1 -3
  58. package/lib/cjs/components/survey/Survey.d.ts +1 -1
  59. package/lib/cjs/components/table/Table.d.ts +1 -1
  60. package/lib/cjs/components/tabs/Tabs.d.ts +1 -1
  61. package/lib/cjs/components/textfield/TextField.d.ts +1 -1
  62. package/lib/cjs/formio.embed.d.ts +1 -2
  63. package/lib/cjs/formio.embed.js +2 -100
  64. package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +1 -1
  65. package/lib/cjs/providers/address/NominatimAddressProvider.js +5 -1
  66. package/lib/cjs/providers/processor/fileProcessor.d.ts +7 -1
  67. package/lib/cjs/providers/processor/fileProcessor.js +6 -0
  68. package/lib/cjs/providers/storage/azure.d.ts +4 -15
  69. package/lib/cjs/providers/storage/azure.js +3 -2
  70. package/lib/cjs/providers/storage/base64.d.ts +3 -7
  71. package/lib/cjs/providers/storage/base64.js +2 -1
  72. package/lib/cjs/providers/storage/dropbox.d.ts +4 -6
  73. package/lib/cjs/providers/storage/dropbox.js +3 -2
  74. package/lib/cjs/providers/storage/googleDrive.d.ts +4 -6
  75. package/lib/cjs/providers/storage/googleDrive.js +3 -1
  76. package/lib/cjs/providers/storage/indexeddb.d.ts +3 -8
  77. package/lib/cjs/providers/storage/indexeddb.js +2 -1
  78. package/lib/cjs/providers/storage/s3.d.ts +4 -22
  79. package/lib/cjs/providers/storage/s3.js +3 -2
  80. package/lib/cjs/providers/storage/url.d.ts +3 -8
  81. package/lib/cjs/providers/storage/url.js +4 -3
  82. package/lib/cjs/providers/storage/util.d.ts +22 -6
  83. package/lib/cjs/providers/storage/util.js +16 -5
  84. package/lib/cjs/utils/builder.d.ts +9 -7
  85. package/lib/cjs/utils/builder.js +10 -5
  86. package/lib/cjs/utils/calendarUtils.d.ts +6 -10
  87. package/lib/cjs/utils/calendarUtils.js +7 -11
  88. package/lib/cjs/utils/formUtils.d.ts +4 -4
  89. package/lib/cjs/utils/formUtils.js +3 -3
  90. package/lib/cjs/utils/utils.d.ts +123 -121
  91. package/lib/cjs/utils/utils.js +99 -94
  92. package/lib/mjs/Form.d.ts +281 -10
  93. package/lib/mjs/Form.js +112 -28
  94. package/lib/mjs/FormBuilder.d.ts +187 -2
  95. package/lib/mjs/FormBuilder.js +31 -6
  96. package/lib/mjs/InlineEmbed.d.ts +7 -0
  97. package/lib/mjs/InlineEmbed.js +105 -0
  98. package/lib/mjs/PDF.d.ts +0 -1
  99. package/lib/mjs/Webform.d.ts +6 -6
  100. package/lib/mjs/Webform.js +3 -3
  101. package/lib/mjs/Wizard.d.ts +1 -1
  102. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -6
  103. package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -4
  104. package/lib/mjs/components/_classes/field/Field.d.ts +11 -2
  105. package/lib/mjs/components/_classes/field/Field.js +13 -1
  106. package/lib/mjs/components/_classes/input/Input.d.ts +4 -3
  107. package/lib/mjs/components/_classes/input/Input.js +2 -2
  108. package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +4 -5
  109. package/lib/mjs/components/_classes/list/ListComponent.form.js +3 -2
  110. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +42 -11
  111. package/lib/mjs/components/_classes/multivalue/Multivalue.js +37 -3
  112. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +127 -33
  113. package/lib/mjs/components/_classes/nested/NestedComponent.js +133 -15
  114. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +6 -0
  115. package/lib/mjs/components/address/Address.d.ts +2 -1
  116. package/lib/mjs/components/button/Button.d.ts +1 -1
  117. package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
  118. package/lib/mjs/components/columns/Columns.d.ts +1 -1
  119. package/lib/mjs/components/container/Container.d.ts +1 -0
  120. package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -1
  121. package/lib/mjs/components/day/Day.d.ts +1 -1
  122. package/lib/mjs/components/editgrid/EditGrid.d.ts +2 -0
  123. package/lib/mjs/components/file/File.d.ts +2 -2
  124. package/lib/mjs/components/number/Number.d.ts +1 -1
  125. package/lib/mjs/components/radio/Radio.d.ts +1 -1
  126. package/lib/mjs/components/radio/Radio.form.d.ts +1 -3
  127. package/lib/mjs/components/radio/Radio.js +3 -3
  128. package/lib/mjs/components/select/Select.d.ts +9 -14
  129. package/lib/mjs/components/select/Select.form.d.ts +1 -3
  130. package/lib/mjs/components/select/Select.js +11 -15
  131. package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +1 -3
  132. package/lib/mjs/components/survey/Survey.d.ts +1 -1
  133. package/lib/mjs/components/table/Table.d.ts +1 -1
  134. package/lib/mjs/components/tabs/Tabs.d.ts +1 -1
  135. package/lib/mjs/components/textfield/TextField.d.ts +1 -1
  136. package/lib/mjs/formio.embed.d.ts +1 -2
  137. package/lib/mjs/formio.embed.js +2 -99
  138. package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +1 -1
  139. package/lib/mjs/providers/address/NominatimAddressProvider.js +5 -1
  140. package/lib/mjs/providers/processor/fileProcessor.d.ts +7 -1
  141. package/lib/mjs/providers/processor/fileProcessor.js +6 -0
  142. package/lib/mjs/providers/storage/azure.d.ts +4 -15
  143. package/lib/mjs/providers/storage/azure.js +3 -2
  144. package/lib/mjs/providers/storage/base64.d.ts +3 -7
  145. package/lib/mjs/providers/storage/base64.js +2 -1
  146. package/lib/mjs/providers/storage/dropbox.d.ts +4 -6
  147. package/lib/mjs/providers/storage/dropbox.js +3 -2
  148. package/lib/mjs/providers/storage/googleDrive.d.ts +4 -6
  149. package/lib/mjs/providers/storage/googleDrive.js +3 -1
  150. package/lib/mjs/providers/storage/indexeddb.d.ts +3 -8
  151. package/lib/mjs/providers/storage/indexeddb.js +2 -1
  152. package/lib/mjs/providers/storage/s3.d.ts +4 -22
  153. package/lib/mjs/providers/storage/s3.js +3 -2
  154. package/lib/mjs/providers/storage/url.d.ts +3 -8
  155. package/lib/mjs/providers/storage/url.js +4 -3
  156. package/lib/mjs/providers/storage/util.d.ts +22 -6
  157. package/lib/mjs/providers/storage/util.js +16 -5
  158. package/lib/mjs/utils/builder.d.ts +9 -7
  159. package/lib/mjs/utils/builder.js +10 -5
  160. package/lib/mjs/utils/calendarUtils.d.ts +6 -10
  161. package/lib/mjs/utils/calendarUtils.js +7 -11
  162. package/lib/mjs/utils/formUtils.d.ts +4 -4
  163. package/lib/mjs/utils/formUtils.js +3 -3
  164. package/lib/mjs/utils/utils.d.ts +123 -121
  165. package/lib/mjs/utils/utils.js +99 -94
  166. package/package.json +17 -13
  167. package/sdk.d.ts +1 -0
  168. package/utils.d.ts +1 -0
@@ -1,16 +1,96 @@
1
+ /**
2
+ * NestedComponent class.
3
+ * @augments Field
4
+ */
1
5
  export default class NestedComponent extends Field {
2
6
  constructor(component: any, options: any, data: any);
3
7
  type: string;
4
- _collapsed: boolean;
8
+ /**
9
+ * The collapsed state of this NestedComponent.
10
+ * @type {boolean}
11
+ * @default false
12
+ * @private
13
+ */
14
+ private _collapsed;
15
+ /**
16
+ * Set collapsed state.
17
+ * @param {boolean} value - The collapsed state.
18
+ * @returns {void}
19
+ */
5
20
  set collapsed(value: boolean);
21
+ /**
22
+ * Get collapsed state.
23
+ * @returns {boolean} The collapsed state.
24
+ */
6
25
  get collapsed(): boolean;
7
- collapse(value: any): Promise<void>;
26
+ /**
27
+ * Set collapsed state.
28
+ * @param {boolean} value - The collapsed state.
29
+ * @returns {void}
30
+ */
31
+ collapse(value: boolean): void;
32
+ /**
33
+ * Set parent visibility.
34
+ * @param {boolean} value - The parent visibility.
35
+ * @returns {void}
36
+ */
37
+ set parentVisible(value: boolean);
38
+ /**
39
+ * Get parent visibility.
40
+ * @returns {boolean} The parent visibility.
41
+ */
42
+ get parentVisible(): boolean;
43
+ /**
44
+ * Get ready state from all components.
45
+ * @returns {Promise<Array>} - The promise that resolves when all components are ready.
46
+ */
8
47
  get ready(): Promise<any[]>;
9
- set rowIndex(value: any);
10
- get rowIndex(): any;
11
- _rowIndex: any;
12
- componentContext(): any;
13
- getComponents(): any;
48
+ /**
49
+ * Set currentForm object.
50
+ * @param {object} instance - The current form object.
51
+ * @returns {void}
52
+ */
53
+ set currentForm(instance: object);
54
+ /**
55
+ * Get currentForm object.
56
+ * @returns {object} - The current form object.
57
+ */
58
+ get currentForm(): object;
59
+ /**
60
+ * Set Row Index to row and update each component.
61
+ * @param {number} value - The row index.
62
+ * @returns {void}
63
+ */
64
+ set rowIndex(value: number);
65
+ /**
66
+ * Get Row Index.
67
+ * @returns {number} - The row index.
68
+ */
69
+ get rowIndex(): number;
70
+ _rowIndex: number | undefined;
71
+ /**
72
+ * Get Contextual data of the component.
73
+ * @returns {object} - The contextual data of the component.
74
+ * @override
75
+ */
76
+ override componentContext(): object;
77
+ /**
78
+ * Set the data of the component.
79
+ * @param {object} value - The data of the component.
80
+ * @returns {void}
81
+ */
82
+ override set data(value: object);
83
+ /**
84
+ * Get the data of the component.
85
+ * @returns {object} - The data of the component.
86
+ * @override
87
+ */
88
+ override get data(): object;
89
+ /**
90
+ * Get components array.
91
+ * @returns {Array} - The components array.
92
+ */
93
+ getComponents(): any[];
14
94
  /**
15
95
  * Perform a deep iteration over every component, including those
16
96
  * within other container based components.
@@ -18,8 +98,17 @@ export default class NestedComponent extends Field {
18
98
  * @param {any} options - The options to include with this everyComponent call.
19
99
  */
20
100
  everyComponent(fn: Function, options?: any): void;
21
- hasComponent(component: any): boolean;
22
- flattenComponents(): {};
101
+ /**
102
+ * Check if the component has a component.
103
+ * @param {import('@formio/core').Component} component - The component to check.
104
+ * @returns {boolean} - TRUE if the component has a component, FALSE otherwise.
105
+ */
106
+ hasComponent(component: import('@formio/core').Component): boolean;
107
+ /**
108
+ * Get the flattened components of this NestedComponent.
109
+ * @returns {object} - The flattened components of this NestedComponent.
110
+ */
111
+ flattenComponents(): object;
23
112
  /**
24
113
  * Perform an iteration over each component within this container component.
25
114
  * @param {Function} fn - Called for each component
@@ -44,13 +133,13 @@ export default class NestedComponent extends Field {
44
133
  /**
45
134
  * Create a new component and add it to the components array.
46
135
  * @param {import('@formio/core').Component} component - The component JSON schema to create.
47
- * @param {any} options - The options to create the component with.
48
- * @param {any} data - The submission data object to house the data for this component.
49
- * @param {*} [before] - The component before which to add this component.
50
- * @param {*} [replacedComp] - The component to replace with this component.
136
+ * @param {object} options - The options to create the component with.
137
+ * @param {import('@formio/core').DataObject} data - The submission data object to house the data for this component.
138
+ * @param {import('@formio/core').Component} [before] - The component before which to add this component.
139
+ * @param {import('@formio/core').Component} [replacedComp] - The component to replace with this component.
51
140
  * @returns {any} - The created component instance.
52
141
  */
53
- createComponent(component: import('@formio/core').Component, options: any, data: any, before?: any, replacedComp?: any): 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;
54
143
  getContainer(): any;
55
144
  get componentComponents(): any;
56
145
  get nestedKey(): string;
@@ -58,31 +147,36 @@ export default class NestedComponent extends Field {
58
147
  components: any;
59
148
  /**
60
149
  * Add a new component instance to the components array.
61
- * @param {any} [data] - The Submission data for this component.
62
- * @param {any} [options] - The options for this component.
150
+ * @param {import('@formio/core').DataObject} [data] - The Submission data for this component.
151
+ * @param {object} [options] - The options for this component.
63
152
  */
64
- addComponents(data?: any, options?: any): void;
153
+ addComponents(data?: import("@formio/core").DataObject | undefined, options?: object | undefined): void;
65
154
  /**
66
155
  * Add a new component to the components array.
67
- * @param {object} component - The component JSON schema to add.
156
+ * @param {import('@formio/core').Component} component - The component JSON schema to add.
68
157
  * @param {object} data - The submission data object to house the data for this component.
69
158
  * @param {HTMLElement} before - A DOM element to insert this element before.
70
159
  * @param {boolean} [noAdd] - A possibly extraneous boolean flag.
71
160
  * @returns {any} - The created component instance.
72
161
  */
73
- addComponent(component: object, data?: object, before?: HTMLElement, noAdd?: boolean | undefined): any;
162
+ addComponent(component: import('@formio/core').Component, data?: object, before?: HTMLElement, noAdd?: boolean | undefined): any;
74
163
  beforeFocus(): void;
164
+ render(children: any): Field;
75
165
  renderComponents(components: any): any;
76
166
  attach(element: any): Promise<[void, void]>;
77
- attachComponentsLogic(components: any): void;
167
+ /**
168
+ * Attach the logic to the components.
169
+ * @param {import('@formio/core').Component[]} components - The components to attach logic to.
170
+ */
171
+ attachComponentsLogic(components: import('@formio/core').Component[]): void;
78
172
  attachComponents(element: any, components: any, container: any): Promise<any>;
79
173
  /**
80
174
  * Remove a component from the components array and from the children object
81
- * @param {any} component - The component to remove from the components.
82
- * @param {Array<any>} components - An array of components to remove this component from.
175
+ * @param {import('@formio/core').Component} component - The component to remove from the components.
176
+ * @param {import('@formio/core').Component[]} components - An array of components to remove this component from.
83
177
  * @param {boolean} [all] - If set to TRUE will cascade remove all components.
84
178
  */
85
- removeComponent(component: any, components: Array<any>, all?: boolean | undefined): void;
179
+ removeComponent(component: import('@formio/core').Component, components: import('@formio/core').Component[], all?: boolean | undefined): void;
86
180
  /**
87
181
  * Removes a component provided the API key of that component.
88
182
  * @param {string} key - The API key of the component to remove.
@@ -125,27 +219,27 @@ export default class NestedComponent extends Field {
125
219
  }, flags: any): void;
126
220
  /**
127
221
  * Perform a validation on all child components of this nested component.
128
- * @param {*} components - The components to validate.
129
- * @param {*} data - The data to validate.
130
- * @param {*} flags - The flags to use when validating.
222
+ * @param {import('@formio/core').Component[]} components - The components to validate.
223
+ * @param {import('@formio/core').DataObject} data - The data to validate.
224
+ * @param {object} flags - The flags to use when validating.
131
225
  * @returns {Promise<Array>|Array} - The errors if any exist.
132
226
  */
133
- validateComponents(components?: any, data?: any, flags?: any): Promise<any[]> | any[];
227
+ validateComponents(components?: import('@formio/core').Component[], data?: import('@formio/core').DataObject, flags?: object): Promise<any[]> | any[];
134
228
  /**
135
229
  * Validate a nested component with data, or its own internal data.
136
- * @param {*} data - The data to validate.
137
- * @param {*} flags - The flags to use when validating.
138
- * @returns {*} - The errors if any exist.
230
+ * @param {import('@formio/core').DataObject} data - The data to validate.
231
+ * @param {object} flags - The flags to use when validating.
232
+ * @returns {Array} - The errors if any exist.
139
233
  */
140
- validate(data?: any, flags?: any): any;
234
+ validate(data?: import('@formio/core').DataObject, flags?: object): any[];
141
235
  checkComponentValidity(data?: null, dirty?: boolean, row?: null, flags?: {}, allErrors?: any[]): boolean;
142
236
  checkAsyncValidity(data?: null, dirty?: boolean, row?: null, silentCheck?: boolean): Promise<any>;
143
237
  setPristine(pristine: any): void;
144
- get isPristine(): any;
145
- get isDirty(): any;
238
+ get isDirty(): boolean | undefined;
146
239
  destroyComponents(all?: boolean): void;
147
240
  get visibleErrors(): any;
148
241
  get errors(): any;
242
+ getValue(): object;
149
243
  get dataReady(): Promise<any[]>;
150
244
  setNestedValue(component: any, value: any, flags?: {}): any;
151
245
  setValue(value: any, flags?: {}): any;
@@ -8,6 +8,10 @@ const Field_1 = __importDefault(require("../field/Field"));
8
8
  const Components_1 = __importDefault(require("../../Components"));
9
9
  const utils_1 = require("../../../utils/utils");
10
10
  const process_1 = require("@formio/core/process");
11
+ /**
12
+ * NestedComponent class.
13
+ * @augments Field
14
+ */
11
15
  class NestedComponent extends Field_1.default {
12
16
  static schema(...extend) {
13
17
  return Field_1.default.schema({
@@ -18,20 +22,40 @@ class NestedComponent extends Field_1.default {
18
22
  constructor(component, options, data) {
19
23
  super(component, options, data);
20
24
  this.type = 'components';
25
+ /**
26
+ * The collapsed state of this NestedComponent.
27
+ * @type {boolean}
28
+ * @default false
29
+ * @private
30
+ */
21
31
  this._collapsed = !!this.component.collapsed;
22
32
  }
23
33
  get defaultSchema() {
24
34
  return NestedComponent.schema();
25
35
  }
36
+ /**
37
+ * Get the schema for the NestedComponent.
38
+ * @returns {object} The schema for the NestedComponent.
39
+ * @override
40
+ */
26
41
  get schema() {
27
42
  const schema = super.schema;
28
43
  const components = lodash_1.default.uniqBy(this.getComponents(), 'component.key');
29
44
  schema.components = lodash_1.default.map(components, 'schema');
30
45
  return schema;
31
46
  }
47
+ /**
48
+ * Get collapsed state.
49
+ * @returns {boolean} The collapsed state.
50
+ */
32
51
  get collapsed() {
33
52
  return this._collapsed;
34
53
  }
54
+ /**
55
+ * Set collapsed state.
56
+ * @param {boolean} value - The collapsed state.
57
+ * @returns {void}
58
+ */
35
59
  collapse(value) {
36
60
  const promise = this.redraw();
37
61
  if (!value) {
@@ -39,10 +63,20 @@ class NestedComponent extends Field_1.default {
39
63
  }
40
64
  return promise;
41
65
  }
66
+ /**
67
+ * Set collapsed state.
68
+ * @param {boolean} value - The collapsed state.
69
+ * @returns {void}
70
+ */
42
71
  set collapsed(value) {
43
72
  this._collapsed = value;
44
73
  this.collapse(value);
45
74
  }
75
+ /**
76
+ * Set visible state of parent and each child component.
77
+ * @param {boolean} value - The visible state.
78
+ * @returns {void}
79
+ */
46
80
  set visible(value) {
47
81
  // DO NOT CALL super here. There is an issue where clearOnHide was getting triggered with
48
82
  // subcomponents because the "parentVisible" flag was set to false when it should really be
@@ -73,65 +107,136 @@ class NestedComponent extends Field_1.default {
73
107
  this.redraw();
74
108
  }
75
109
  }
110
+ /**
111
+ * Get visible state.
112
+ * @returns {boolean} The visible state.
113
+ */
76
114
  get visible() {
77
115
  return super.visible;
78
116
  }
117
+ /**
118
+ * Set parent visibility.
119
+ * @param {boolean} value - The parent visibility.
120
+ * @returns {void}
121
+ */
79
122
  set parentVisible(value) {
80
123
  super.parentVisible = value;
81
124
  this.components.forEach(component => component.parentVisible = this.visible);
82
125
  }
126
+ /**
127
+ * Get parent visibility.
128
+ * @returns {boolean} The parent visibility.
129
+ */
83
130
  get parentVisible() {
84
131
  return super.parentVisible;
85
132
  }
133
+ /**
134
+ * Get the disabled state.
135
+ * @returns {boolean} - The disabled state.
136
+ */
86
137
  get disabled() {
87
138
  return super.disabled;
88
139
  }
140
+ /**
141
+ * Set the disabled state.
142
+ * @param {boolean} disabled - The disabled state.
143
+ */
89
144
  set disabled(disabled) {
90
145
  super.disabled = disabled;
91
146
  this.components.forEach((component) => component.parentDisabled = disabled);
92
147
  }
148
+ /**
149
+ * Set parent disabled state.
150
+ * @param {boolean} value - The parent disabled state.
151
+ * @returns {void}
152
+ */
93
153
  set parentDisabled(value) {
94
154
  super.parentDisabled = value;
95
155
  this.components.forEach(component => {
96
156
  component.parentDisabled = this.disabled;
97
157
  });
98
158
  }
159
+ /**
160
+ * Get parent disabled state.
161
+ * @returns {boolean} The parent disabled state.
162
+ */
99
163
  get parentDisabled() {
100
164
  return super.parentDisabled;
101
165
  }
166
+ /**
167
+ * Get ready state from all components.
168
+ * @returns {Promise<Array>} - The promise that resolves when all components are ready.
169
+ */
102
170
  get ready() {
103
171
  return Promise.all(this.getComponents().map(component => component.ready));
104
172
  }
173
+ /**
174
+ * Get currentForm object.
175
+ * @returns {object} - The current form object.
176
+ */
105
177
  get currentForm() {
106
178
  return super.currentForm;
107
179
  }
180
+ /**
181
+ * Set currentForm object.
182
+ * @param {object} instance - The current form object.
183
+ * @returns {void}
184
+ */
108
185
  set currentForm(instance) {
109
186
  super.currentForm = instance;
110
187
  this.getComponents().forEach(component => {
111
188
  component.currentForm = instance;
112
189
  });
113
190
  }
191
+ /**
192
+ * Get Row Index.
193
+ * @returns {number} - The row index.
194
+ */
114
195
  get rowIndex() {
115
196
  return this._rowIndex;
116
197
  }
198
+ /**
199
+ * Set Row Index to row and update each component.
200
+ * @param {number} value - The row index.
201
+ * @returns {void}
202
+ */
117
203
  set rowIndex(value) {
118
204
  this._rowIndex = value;
119
205
  this.eachComponent((component) => {
120
206
  component.rowIndex = value;
121
207
  });
122
208
  }
209
+ /**
210
+ * Get Contextual data of the component.
211
+ * @returns {object} - The contextual data of the component.
212
+ * @override
213
+ */
123
214
  componentContext() {
124
215
  return this._data;
125
216
  }
217
+ /**
218
+ * Get the data of the component.
219
+ * @returns {object} - The data of the component.
220
+ * @override
221
+ */
126
222
  get data() {
127
223
  return this._data;
128
224
  }
225
+ /**
226
+ * Set the data of the component.
227
+ * @param {object} value - The data of the component.
228
+ * @returns {void}
229
+ */
129
230
  set data(value) {
130
231
  this._data = value;
131
232
  this.eachComponent((component) => {
132
233
  component.data = this.componentContext(component);
133
234
  });
134
235
  }
236
+ /**
237
+ * Get components array.
238
+ * @returns {Array} - The components array.
239
+ */
135
240
  getComponents() {
136
241
  return this.components || [];
137
242
  }
@@ -154,6 +259,11 @@ class NestedComponent extends Field_1.default {
154
259
  }
155
260
  });
156
261
  }
262
+ /**
263
+ * Check if the component has a component.
264
+ * @param {import('@formio/core').Component} component - The component to check.
265
+ * @returns {boolean} - TRUE if the component has a component, FALSE otherwise.
266
+ */
157
267
  hasComponent(component) {
158
268
  let result = false;
159
269
  this.everyComponent((comp) => {
@@ -164,6 +274,10 @@ class NestedComponent extends Field_1.default {
164
274
  });
165
275
  return result;
166
276
  }
277
+ /**
278
+ * Get the flattened components of this NestedComponent.
279
+ * @returns {object} - The flattened components of this NestedComponent.
280
+ */
167
281
  flattenComponents() {
168
282
  const result = {};
169
283
  this.everyComponent((component) => {
@@ -256,10 +370,10 @@ class NestedComponent extends Field_1.default {
256
370
  /**
257
371
  * Create a new component and add it to the components array.
258
372
  * @param {import('@formio/core').Component} component - The component JSON schema to create.
259
- * @param {any} options - The options to create the component with.
260
- * @param {any} data - The submission data object to house the data for this component.
261
- * @param {*} [before] - The component before which to add this component.
262
- * @param {*} [replacedComp] - The component to replace with this component.
373
+ * @param {object} options - The options to create the component with.
374
+ * @param {import('@formio/core').DataObject} data - The submission data object to house the data for this component.
375
+ * @param {import('@formio/core').Component} [before] - The component before which to add this component.
376
+ * @param {import('@formio/core').Component} [replacedComp] - The component to replace with this component.
263
377
  * @returns {any} - The created component instance.
264
378
  */
265
379
  createComponent(component, options, data, before, replacedComp) {
@@ -323,8 +437,8 @@ class NestedComponent extends Field_1.default {
323
437
  }
324
438
  /**
325
439
  * Add a new component instance to the components array.
326
- * @param {any} [data] - The Submission data for this component.
327
- * @param {any} [options] - The options for this component.
440
+ * @param {import('@formio/core').DataObject} [data] - The Submission data for this component.
441
+ * @param {object} [options] - The options for this component.
328
442
  */
329
443
  addComponents(data, options) {
330
444
  data = data || this.data;
@@ -340,7 +454,7 @@ class NestedComponent extends Field_1.default {
340
454
  }
341
455
  /**
342
456
  * Add a new component to the components array.
343
- * @param {object} component - The component JSON schema to add.
457
+ * @param {import('@formio/core').Component} component - The component JSON schema to add.
344
458
  * @param {object} data - The submission data object to house the data for this component.
345
459
  * @param {HTMLElement} before - A DOM element to insert this element before.
346
460
  * @param {boolean} [noAdd] - A possibly extraneous boolean flag.
@@ -407,6 +521,10 @@ class NestedComponent extends Field_1.default {
407
521
  childPromise,
408
522
  ]);
409
523
  }
524
+ /**
525
+ * Attach the logic to the components.
526
+ * @param {import('@formio/core').Component[]} components - The components to attach logic to.
527
+ */
410
528
  attachComponentsLogic(components) {
411
529
  components = components || this.components;
412
530
  lodash_1.default.each(components, (comp) => {
@@ -436,8 +554,8 @@ class NestedComponent extends Field_1.default {
436
554
  }
437
555
  /**
438
556
  * Remove a component from the components array and from the children object
439
- * @param {any} component - The component to remove from the components.
440
- * @param {Array<any>} components - An array of components to remove this component from.
557
+ * @param {import('@formio/core').Component} component - The component to remove from the components.
558
+ * @param {import('@formio/core').Component[]} components - An array of components to remove this component from.
441
559
  * @param {boolean} [all] - If set to TRUE will cascade remove all components.
442
560
  */
443
561
  removeComponent(component, components, all = false) {
@@ -575,9 +693,9 @@ class NestedComponent extends Field_1.default {
575
693
  }
576
694
  /**
577
695
  * Perform a validation on all child components of this nested component.
578
- * @param {*} components - The components to validate.
579
- * @param {*} data - The data to validate.
580
- * @param {*} flags - The flags to use when validating.
696
+ * @param {import('@formio/core').Component[]} components - The components to validate.
697
+ * @param {import('@formio/core').DataObject} data - The data to validate.
698
+ * @param {object} flags - The flags to use when validating.
581
699
  * @returns {Promise<Array>|Array} - The errors if any exist.
582
700
  */
583
701
  validateComponents(components = null, data = null, flags = {}) {
@@ -615,9 +733,9 @@ class NestedComponent extends Field_1.default {
615
733
  }
616
734
  /**
617
735
  * Validate a nested component with data, or its own internal data.
618
- * @param {*} data - The data to validate.
619
- * @param {*} flags - The flags to use when validating.
620
- * @returns {*} - The errors if any exist.
736
+ * @param {import('@formio/core').DataObject} data - The data to validate.
737
+ * @param {object} flags - The flags to use when validating.
738
+ * @returns {Array} - The errors if any exist.
621
739
  */
622
740
  validate(data = null, flags = {}) {
623
741
  data = data || this.rootValue;
@@ -3,9 +3,15 @@ export default class NestedDataComponent extends NestedComponent {
3
3
  hasChanged(newValue: any, oldValue: any): boolean;
4
4
  get allowData(): boolean;
5
5
  get emptyValue(): {};
6
+ componentContext(): any;
6
7
  getValueAsString(value: any, options: any): string;
7
8
  getDataValueAsTable(value: any, options: any): string;
8
9
  everyComponent(fn: any, options?: {}): void;
10
+ /**
11
+ * Get the value of this component.
12
+ * @returns {*}
13
+ */
14
+ getValue(): any;
9
15
  updateValue(value: any, flags?: {}): boolean;
10
16
  setValue(value: any, flags?: {}): boolean;
11
17
  }
@@ -54,7 +54,7 @@ export default class AddressComponent extends ContainerComponent {
54
54
  renderElement(value: any): any;
55
55
  renderRow(value: any, index: any): any;
56
56
  renderGrid(): any;
57
- render(): string;
57
+ render(): Field;
58
58
  onSelectAddress(address: any, element: any, index: any): void;
59
59
  addRow(): void;
60
60
  attach(element: any): Promise<void>;
@@ -65,3 +65,4 @@ export default class AddressComponent extends ContainerComponent {
65
65
  getValueAsString(value: any, options: any): any;
66
66
  }
67
67
  import ContainerComponent from '../container/Container';
68
+ import Field from '../_classes/field/Field';
@@ -21,7 +21,7 @@ export default class ButtonComponent extends Field {
21
21
  get clicked(): any;
22
22
  get defaultValue(): boolean;
23
23
  get oauthConfig(): any;
24
- render(): string;
24
+ render(): Field;
25
25
  attachButton(): void;
26
26
  hasError: boolean | undefined;
27
27
  isDisabledOnInvalid: any;
@@ -39,7 +39,7 @@ export default class CheckBoxComponent extends Field {
39
39
  get labelInfo(): {
40
40
  hidden: boolean;
41
41
  };
42
- render(): string;
42
+ render(): Field;
43
43
  attach(element: any): Promise<void>;
44
44
  input: any;
45
45
  detach(element: any): void;
@@ -14,7 +14,7 @@ export default class ColumnsComponent extends NestedComponent {
14
14
  get columnKey(): string;
15
15
  columns: any[] | undefined;
16
16
  labelIsHidden(): boolean;
17
- render(): string;
17
+ render(): import("../_classes/field/Field").default;
18
18
  justifyColumn(items: any, index: any): boolean;
19
19
  justify(): any;
20
20
  get gridSize(): number;
@@ -9,6 +9,7 @@ export default class ContainerComponent extends NestedDataComponent {
9
9
  schema: any;
10
10
  };
11
11
  constructor(...args: any[]);
12
+ addComponents(data: any, options: any): void;
12
13
  checkData(data: any, flags: any, row: any, components: any): void;
13
14
  focus(): void;
14
15
  }
@@ -54,7 +54,7 @@ export default class DataGridComponent extends NestedArrayComponent {
54
54
  hasTopSubmit(): any;
55
55
  hasBottomSubmit(): any;
56
56
  get canAddColumn(): boolean;
57
- render(): string;
57
+ render(): import("../_classes/field/Field").default;
58
58
  getRows(): {}[];
59
59
  getColumns(): any[];
60
60
  hasHeader(): any;
@@ -84,7 +84,7 @@ export default class DayComponent extends Field {
84
84
  }[] | undefined;
85
85
  setErrorClasses(elements: any, dirty: any, hasError: any): void;
86
86
  dayFirst: any;
87
- render(): string;
87
+ render(): Field;
88
88
  renderField(name: any): any;
89
89
  attach(element: any): Promise<void>;
90
90
  set disabled(disabled: any);
@@ -35,6 +35,8 @@ export default class EditGridComponent extends NestedArrayComponent {
35
35
  get inlineEditMode(): any;
36
36
  get saveEditMode(): boolean;
37
37
  get minLength(): any;
38
+ set data(value: any);
39
+ get data(): any;
38
40
  get displayAsTable(): any;
39
41
  get iteratableRows(): any;
40
42
  get defaultValue(): any[];
@@ -45,7 +45,7 @@ export default class FileComponent extends Field {
45
45
  type: number;
46
46
  actions: number;
47
47
  };
48
- render(): string;
48
+ render(): Field;
49
49
  getVideoStream(constraints: any): any;
50
50
  stopVideoStream(videoStream: any): void;
51
51
  getFrame(videoPlayer: any): Promise<any>;
@@ -130,7 +130,7 @@ export default class FileComponent extends Field {
130
130
  message: string;
131
131
  file?: undefined;
132
132
  } | {
133
- file: any;
133
+ file: FormData | null;
134
134
  status?: undefined;
135
135
  message?: undefined;
136
136
  }>;
@@ -19,7 +19,7 @@ export default class NumberComponent extends Input {
19
19
  constructor(...args: any[]);
20
20
  decimalSeparator: any;
21
21
  delimiter: any;
22
- decimalLimit: any;
22
+ decimalLimit: number;
23
23
  numberMask: any;
24
24
  /**
25
25
  * Creates the number mask for normal numbers.
@@ -43,7 +43,7 @@ export default class RadioComponent extends ListComponent {
43
43
  itemsLoadedResolve: ((value: any) => void) | undefined;
44
44
  optionsLoaded: boolean | undefined;
45
45
  loadedOptions: any[] | undefined;
46
- render(): string;
46
+ render(): import("../_classes/field/Field").default;
47
47
  attach(element: any): Promise<void>;
48
48
  detach(element: any): void;
49
49
  validateValueProperty(): boolean;