@formio/js 5.0.0-rc.20 → 5.0.0-rc.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. package/dist/formio.embed.css +1 -39
  2. package/dist/formio.embed.js +2 -90
  3. package/dist/formio.embed.min.js +1 -1
  4. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  5. package/dist/formio.form.js +57 -35
  6. package/dist/formio.form.min.js +1 -1
  7. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  8. package/dist/formio.full.js +58 -36
  9. package/dist/formio.full.min.js +1 -1
  10. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  11. package/dist/formio.js +2 -2
  12. package/dist/formio.min.js +1 -1
  13. package/dist/formio.min.js.LICENSE.txt +1 -1
  14. package/dist/formio.utils.js +1 -1
  15. package/dist/formio.utils.min.js +1 -1
  16. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  17. package/lib/cjs/CDN.d.ts +1 -0
  18. package/lib/cjs/CDN.js +1 -0
  19. package/lib/cjs/Embed.d.ts +21 -1
  20. package/lib/cjs/Embed.js +211 -308
  21. package/lib/cjs/Form.d.ts +1 -1
  22. package/lib/cjs/Form.js +1 -1
  23. package/lib/cjs/Webform.d.ts +6 -6
  24. package/lib/cjs/Webform.js +6 -6
  25. package/lib/cjs/WebformBuilder.js +1 -1
  26. package/lib/cjs/components/_classes/component/Component.d.ts +16 -6
  27. package/lib/cjs/components/_classes/component/Component.js +26 -6
  28. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
  29. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
  30. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
  31. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
  32. package/lib/cjs/components/address/Address.js +5 -0
  33. package/lib/cjs/components/button/Button.d.ts +1 -0
  34. package/lib/cjs/components/button/Button.js +3 -0
  35. package/lib/cjs/components/checkbox/Checkbox.d.ts +28 -0
  36. package/lib/cjs/components/checkbox/Checkbox.js +17 -2
  37. package/lib/cjs/components/columns/Columns.d.ts +1 -0
  38. package/lib/cjs/components/columns/Columns.js +3 -0
  39. package/lib/cjs/components/container/Container.js +3 -0
  40. package/lib/cjs/components/content/Content.d.ts +1 -0
  41. package/lib/cjs/components/content/Content.js +3 -0
  42. package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
  43. package/lib/cjs/components/datamap/DataMap.js +3 -0
  44. package/lib/cjs/components/datetime/DateTime.d.ts +19 -0
  45. package/lib/cjs/components/datetime/DateTime.js +9 -10
  46. package/lib/cjs/components/day/Day.d.ts +21 -0
  47. package/lib/cjs/components/day/Day.js +8 -10
  48. package/lib/cjs/components/fieldset/Fieldset.d.ts +1 -0
  49. package/lib/cjs/components/fieldset/Fieldset.js +3 -0
  50. package/lib/cjs/components/file/File.d.ts +21 -1
  51. package/lib/cjs/components/file/File.js +15 -7
  52. package/lib/cjs/components/form/Form.d.ts +1 -0
  53. package/lib/cjs/components/form/Form.js +3 -0
  54. package/lib/cjs/components/html/HTML.d.ts +1 -0
  55. package/lib/cjs/components/html/HTML.js +3 -0
  56. package/lib/cjs/components/number/Number.d.ts +20 -1
  57. package/lib/cjs/components/number/Number.js +10 -15
  58. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  59. package/lib/cjs/components/panel/Panel.js +3 -0
  60. package/lib/cjs/components/radio/Radio.d.ts +19 -0
  61. package/lib/cjs/components/radio/Radio.js +30 -0
  62. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -0
  63. package/lib/cjs/components/recaptcha/ReCaptcha.js +3 -0
  64. package/lib/cjs/components/select/Select.d.ts +19 -1
  65. package/lib/cjs/components/select/Select.js +37 -3
  66. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +26 -1
  67. package/lib/cjs/components/selectboxes/SelectBoxes.js +8 -1
  68. package/lib/cjs/components/signature/Signature.d.ts +21 -0
  69. package/lib/cjs/components/signature/Signature.js +9 -1
  70. package/lib/cjs/components/survey/Survey.d.ts +21 -0
  71. package/lib/cjs/components/survey/Survey.js +7 -1
  72. package/lib/cjs/components/table/Table.d.ts +1 -0
  73. package/lib/cjs/components/table/Table.js +3 -0
  74. package/lib/cjs/components/tabs/Tabs.d.ts +1 -0
  75. package/lib/cjs/components/tabs/Tabs.js +3 -0
  76. package/lib/cjs/components/tags/Tags.d.ts +21 -0
  77. package/lib/cjs/components/tags/Tags.js +9 -1
  78. package/lib/cjs/components/textfield/TextField.d.ts +21 -0
  79. package/lib/cjs/components/textfield/TextField.js +7 -1
  80. package/lib/cjs/components/time/Time.d.ts +8 -1
  81. package/lib/cjs/components/well/Well.d.ts +1 -0
  82. package/lib/cjs/components/well/Well.js +3 -0
  83. package/lib/cjs/formio.embed.d.ts +2 -1
  84. package/lib/cjs/formio.embed.js +96 -1
  85. package/lib/cjs/formio.form.d.ts +4 -3
  86. package/lib/cjs/formio.form.js +17 -8
  87. package/lib/cjs/licenses/Licenses.d.ts +7 -0
  88. package/lib/cjs/licenses/Licenses.js +22 -0
  89. package/lib/cjs/licenses/index.d.ts +2 -0
  90. package/lib/cjs/licenses/index.js +7 -0
  91. package/lib/cjs/utils/utils.d.ts +10 -0
  92. package/lib/cjs/utils/utils.js +21 -1
  93. package/lib/mjs/CDN.d.ts +1 -0
  94. package/lib/mjs/CDN.js +1 -0
  95. package/lib/mjs/Embed.d.ts +21 -1
  96. package/lib/mjs/Embed.js +208 -322
  97. package/lib/mjs/Form.d.ts +1 -1
  98. package/lib/mjs/Form.js +1 -1
  99. package/lib/mjs/Webform.d.ts +6 -6
  100. package/lib/mjs/Webform.js +6 -6
  101. package/lib/mjs/WebformBuilder.js +1 -1
  102. package/lib/mjs/components/_classes/component/Component.d.ts +16 -6
  103. package/lib/mjs/components/_classes/component/Component.js +26 -6
  104. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
  105. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
  106. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
  107. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
  108. package/lib/mjs/components/address/Address.js +5 -0
  109. package/lib/mjs/components/button/Button.d.ts +1 -0
  110. package/lib/mjs/components/button/Button.js +4 -1
  111. package/lib/mjs/components/checkbox/Checkbox.d.ts +28 -0
  112. package/lib/mjs/components/checkbox/Checkbox.js +18 -3
  113. package/lib/mjs/components/columns/Columns.d.ts +1 -0
  114. package/lib/mjs/components/columns/Columns.js +3 -0
  115. package/lib/mjs/components/container/Container.js +4 -1
  116. package/lib/mjs/components/content/Content.d.ts +1 -0
  117. package/lib/mjs/components/content/Content.js +3 -0
  118. package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
  119. package/lib/mjs/components/datamap/DataMap.js +4 -1
  120. package/lib/mjs/components/datetime/DateTime.d.ts +19 -0
  121. package/lib/mjs/components/datetime/DateTime.js +11 -12
  122. package/lib/mjs/components/day/Day.d.ts +21 -0
  123. package/lib/mjs/components/day/Day.js +12 -14
  124. package/lib/mjs/components/fieldset/Fieldset.d.ts +1 -0
  125. package/lib/mjs/components/fieldset/Fieldset.js +3 -0
  126. package/lib/mjs/components/file/File.d.ts +21 -1
  127. package/lib/mjs/components/file/File.js +16 -8
  128. package/lib/mjs/components/form/Form.d.ts +1 -0
  129. package/lib/mjs/components/form/Form.js +4 -1
  130. package/lib/mjs/components/html/HTML.d.ts +1 -0
  131. package/lib/mjs/components/html/HTML.js +3 -0
  132. package/lib/mjs/components/number/Number.d.ts +20 -1
  133. package/lib/mjs/components/number/Number.js +11 -12
  134. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  135. package/lib/mjs/components/panel/Panel.js +3 -0
  136. package/lib/mjs/components/radio/Radio.d.ts +19 -0
  137. package/lib/mjs/components/radio/Radio.js +34 -1
  138. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -0
  139. package/lib/mjs/components/recaptcha/ReCaptcha.js +3 -0
  140. package/lib/mjs/components/select/Select.d.ts +19 -1
  141. package/lib/mjs/components/select/Select.js +39 -5
  142. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +26 -1
  143. package/lib/mjs/components/selectboxes/SelectBoxes.js +8 -1
  144. package/lib/mjs/components/signature/Signature.d.ts +21 -0
  145. package/lib/mjs/components/signature/Signature.js +9 -1
  146. package/lib/mjs/components/survey/Survey.d.ts +21 -0
  147. package/lib/mjs/components/survey/Survey.js +8 -2
  148. package/lib/mjs/components/table/Table.d.ts +1 -0
  149. package/lib/mjs/components/table/Table.js +3 -0
  150. package/lib/mjs/components/tabs/Tabs.d.ts +1 -0
  151. package/lib/mjs/components/tabs/Tabs.js +3 -0
  152. package/lib/mjs/components/tags/Tags.d.ts +21 -0
  153. package/lib/mjs/components/tags/Tags.js +10 -2
  154. package/lib/mjs/components/textfield/TextField.d.ts +21 -0
  155. package/lib/mjs/components/textfield/TextField.js +8 -2
  156. package/lib/mjs/components/time/Time.d.ts +8 -1
  157. package/lib/mjs/components/well/Well.d.ts +1 -0
  158. package/lib/mjs/components/well/Well.js +3 -0
  159. package/lib/mjs/formio.embed.d.ts +2 -1
  160. package/lib/mjs/formio.embed.js +96 -2
  161. package/lib/mjs/formio.form.d.ts +4 -3
  162. package/lib/mjs/formio.form.js +16 -8
  163. package/lib/mjs/licenses/Licenses.d.ts +7 -0
  164. package/lib/mjs/licenses/Licenses.js +17 -0
  165. package/lib/mjs/licenses/index.d.ts +2 -0
  166. package/lib/mjs/licenses/index.js +2 -0
  167. package/lib/mjs/utils/utils.d.ts +10 -0
  168. package/lib/mjs/utils/utils.js +19 -0
  169. package/package.json +5 -1
  170. package/types/index.d.ts +1 -0
  171. package/types/licenses.d.ts +7 -0
  172. package/types/utils.d.ts +2 -0
@@ -131,7 +131,7 @@ export default class Webform extends NestedDataComponent {
131
131
  * @type {Promise}
132
132
  *
133
133
  * @example
134
- * import Webform from 'formiojs/Webform';
134
+ * import Webform from '@formio/js/Webform';
135
135
  * let form = new Webform(document.getElementById('formio'));
136
136
  * form.formReady.then(() => {
137
137
  * console.log('The form is ready!');
@@ -157,7 +157,7 @@ export default class Webform extends NestedDataComponent {
157
157
  * @type {Promise}
158
158
  *
159
159
  * @example
160
- * import Webform from 'formiojs/Webform';
160
+ * import Webform from '@formio/js/Webform';
161
161
  * let form = new Webform(document.getElementById('formio'));
162
162
  * form.submissionReady.then(() => {
163
163
  * console.log('The submission is ready!');
@@ -368,7 +368,7 @@ export default class Webform extends NestedDataComponent {
368
368
  * @param {string} value - The value of the form embed url.
369
369
  *
370
370
  * @example
371
- * import Webform from 'formiojs/Webform';
371
+ * import Webform from '@formio/js/Webform';
372
372
  * let form = new Webform(document.getElementById('formio'));
373
373
  * form.formReady.then(() => {
374
374
  * console.log('The form is formReady!');
@@ -473,7 +473,7 @@ export default class Webform extends NestedDataComponent {
473
473
  * Sets the JSON schema for the form to be rendered.
474
474
  *
475
475
  * @example
476
- * import Webform from 'formiojs/Webform';
476
+ * import Webform from '@formio/js/Webform';
477
477
  * let form = new Webform(document.getElementById('formio'));
478
478
  * form.setForm({
479
479
  * components: [
@@ -606,7 +606,7 @@ export default class Webform extends NestedDataComponent {
606
606
  * Sets the submission of a form.
607
607
  *
608
608
  * @example
609
- * import Webform from 'formiojs/Webform';
609
+ * import Webform from '@formio/js/Webform';
610
610
  * let form = new Webform(document.getElementById('formio'));
611
611
  * form.src = 'https://examples.form.io/example';
612
612
  * form.submission = {data: {
@@ -1340,7 +1340,7 @@ export default class Webform extends NestedDataComponent {
1340
1340
  * Submits the form.
1341
1341
  *
1342
1342
  * @example
1343
- * import Webform from 'formiojs/Webform';
1343
+ * import Webform from '@formio/js/Webform';
1344
1344
  * let form = new Webform(document.getElementById('formio'));
1345
1345
  * form.src = 'https://examples.form.io/example';
1346
1346
  * form.submission = {data: {
@@ -393,7 +393,7 @@ export default class WebformBuilder extends Component {
393
393
  premium: {
394
394
  title: 'Premium',
395
395
  weight: 40
396
- },
396
+ }
397
397
  };
398
398
  }
399
399
  redraw() {
@@ -4,6 +4,21 @@
4
4
  */
5
5
  declare class Component extends Element {
6
6
  static schema(...sources: any[]): any;
7
+ /**
8
+ * Return the simple condition settings as part of the component.
9
+ *
10
+ * @return {Object}
11
+ *
12
+ */
13
+ static get conditionOperatorsSettings(): Object;
14
+ /**
15
+ * Return the array of possible types of component value absed on its schema.
16
+ *
17
+ * @param schema
18
+ * @return {Array}
19
+ *
20
+ */
21
+ static savedValueTypes(schema: any): any[];
7
22
  /**
8
23
  * Provides a table view for this component. Override if you wish to do something different than using getView
9
24
  * method of your instance.
@@ -12,12 +27,7 @@ declare class Component extends Element {
12
27
  * @param options
13
28
  */
14
29
  static tableView(value: any, options: any): void;
15
- static get serverConditionSettings(): {
16
- operators: string[];
17
- valueComponent(): {
18
- type: string;
19
- };
20
- };
30
+ static get serverConditionSettings(): Object;
21
31
  /**
22
32
  * Initialize a new Component.
23
33
  *
@@ -172,6 +172,31 @@ export default class Component extends Element {
172
172
  static get Validator() {
173
173
  return Validator;
174
174
  }
175
+ /**
176
+ * Return the simple condition settings as part of the component.
177
+ *
178
+ * @return {Object}
179
+ *
180
+ */
181
+ static get conditionOperatorsSettings() {
182
+ return {
183
+ operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],
184
+ valueComponent() {
185
+ return { type: 'textfield' };
186
+ }
187
+ };
188
+ }
189
+ /**
190
+ * Return the array of possible types of component value absed on its schema.
191
+ *
192
+ * @param schema
193
+ * @return {Array}
194
+ *
195
+ */
196
+ static savedValueTypes(schema) {
197
+ schema = schema || {};
198
+ return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.any];
199
+ }
175
200
  /**
176
201
  * Provides a table view for this component. Override if you wish to do something different than using getView
177
202
  * method of your instance.
@@ -1370,12 +1395,7 @@ export default class Component extends Element {
1370
1395
  return customCSS;
1371
1396
  }
1372
1397
  static get serverConditionSettings() {
1373
- return {
1374
- operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],
1375
- valueComponent() {
1376
- return { type: 'textfield' };
1377
- },
1378
- };
1398
+ return Component.conditionOperatorsSettings;
1379
1399
  }
1380
1400
  get isMobile() {
1381
1401
  return isMobile();
@@ -1,4 +1,5 @@
1
1
  export default class NestedArrayComponent extends NestedDataComponent {
2
+ static savedValueTypes(): string[];
2
3
  componentContext(component: any): any;
3
4
  get iteratableRows(): void;
4
5
  prevHasAddButton: any;
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  import _ from 'lodash';
3
+ import { componentValueTypes } from '../../../utils/utils';
3
4
  import Component from '../component/Component';
4
5
  import NestedDataComponent from '../nesteddata/NestedDataComponent';
5
6
  export default class NestedArrayComponent extends NestedDataComponent {
@@ -8,6 +9,9 @@ export default class NestedArrayComponent extends NestedDataComponent {
8
9
  disableAddingRemovingRows: false
9
10
  }, ...extend);
10
11
  }
12
+ static savedValueTypes() {
13
+ return [componentValueTypes.array];
14
+ }
11
15
  componentContext(component) {
12
16
  return this.iteratableRows[component.rowIndex].data;
13
17
  }
@@ -1,4 +1,5 @@
1
1
  export default class NestedDataComponent extends NestedComponent {
2
+ static savedValueTypes(schema: any): string[];
2
3
  hasChanged(newValue: any, oldValue: any): boolean;
3
4
  get allowData(): boolean;
4
5
  get emptyValue(): {};
@@ -2,6 +2,7 @@
2
2
  import Component from '../component/Component';
3
3
  import NestedComponent from '../nested/NestedComponent';
4
4
  import _ from 'lodash';
5
+ import { componentValueTypes, getComponentSavedTypes } from '../../../utils/utils';
5
6
  export default class NestedDataComponent extends NestedComponent {
6
7
  hasChanged(newValue, oldValue) {
7
8
  // If we do not have a value and are getting set to anything other than undefined or null, then we changed.
@@ -12,6 +13,9 @@ export default class NestedDataComponent extends NestedComponent {
12
13
  }
13
14
  return !_.isEqual(newValue, oldValue);
14
15
  }
16
+ static savedValueTypes(schema) {
17
+ return getComponentSavedTypes(schema) || [componentValueTypes.object];
18
+ }
15
19
  get allowData() {
16
20
  return true;
17
21
  }
@@ -5,6 +5,7 @@ import { GoogleAddressProvider } from '../../providers/address/GoogleAddressProv
5
5
  import Field from '../_classes/field/Field';
6
6
  import NestedComponent from '../_classes/nested/NestedComponent';
7
7
  import ContainerComponent from '../container/Container';
8
+ import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
8
9
  export const AddressComponentMode = {
9
10
  Autocomplete: 'autocomplete',
10
11
  Manual: 'manual',
@@ -76,6 +77,10 @@ export default class AddressComponent extends ContainerComponent {
76
77
  ],
77
78
  }, ...extend);
78
79
  }
80
+ static savedValueTypes(schema) {
81
+ schema = schema || {};
82
+ return getComponentSavedTypes(schema) || [componentValueTypes.object];
83
+ }
79
84
  static get builderInfo() {
80
85
  return {
81
86
  title: 'Address',
@@ -7,6 +7,7 @@ export default class ButtonComponent extends Field {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static savedValueTypes(schema: any): string[];
10
11
  constructor(component: any, options: any, data: any);
11
12
  filesUploading: any[];
12
13
  get inputInfo(): {
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import Field from '../_classes/field/Field';
3
3
  import Input from '../_classes/input/Input';
4
- import { eachComponent, getArrayFromComponentPath } from '../../utils/utils';
4
+ import { componentValueTypes, eachComponent, getArrayFromComponentPath, getComponentSavedTypes } from '../../utils/utils';
5
5
  export default class ButtonComponent extends Field {
6
6
  static schema(...extend) {
7
7
  return Input.schema({
@@ -29,6 +29,9 @@ export default class ButtonComponent extends Field {
29
29
  schema: ButtonComponent.schema()
30
30
  };
31
31
  }
32
+ static savedValueTypes(schema) {
33
+ return getComponentSavedTypes(schema) || [componentValueTypes.boolean];
34
+ }
32
35
  constructor(component, options, data) {
33
36
  super(component, options, data);
34
37
  this.filesUploading = [];
@@ -19,7 +19,35 @@ export default class CheckBoxComponent extends Field {
19
19
  };
20
20
  type: string;
21
21
  };
22
+ constructor: Function;
23
+ toString(): string;
24
+ toLocaleString(): string;
25
+ valueOf(): Object;
26
+ hasOwnProperty(v: PropertyKey): boolean;
27
+ isPrototypeOf(v: Object): boolean;
28
+ propertyIsEnumerable(v: PropertyKey): boolean;
22
29
  };
30
+ static get conditionOperatorsSettings(): {
31
+ operators: string[];
32
+ valueComponent(): {
33
+ valueType: string;
34
+ data: {
35
+ values: {
36
+ label: string;
37
+ value: string;
38
+ }[];
39
+ };
40
+ type: string;
41
+ };
42
+ constructor: Function;
43
+ toString(): string;
44
+ toLocaleString(): string;
45
+ valueOf(): Object;
46
+ hasOwnProperty(v: PropertyKey): boolean;
47
+ isPrototypeOf(v: Object): boolean;
48
+ propertyIsEnumerable(v: PropertyKey): boolean;
49
+ };
50
+ static savedValueTypes(schema: any): string[] | null;
23
51
  get labelClass(): string;
24
52
  get inputInfo(): {
25
53
  type: string;
@@ -1,4 +1,5 @@
1
1
  import _ from 'lodash';
2
+ import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
2
3
  import Field from '../_classes/field/Field';
3
4
  export default class CheckBoxComponent extends Field {
4
5
  static schema(...extend) {
@@ -24,8 +25,11 @@ export default class CheckBoxComponent extends Field {
24
25
  };
25
26
  }
26
27
  static get serverConditionSettings() {
28
+ return CheckBoxComponent.conditionOperatorsSettings;
29
+ }
30
+ static get conditionOperatorsSettings() {
27
31
  return {
28
- ...super.serverConditionSettings,
32
+ ...super.conditionOperatorsSettings,
29
33
  operators: ['isEqual'],
30
34
  valueComponent() {
31
35
  return {
@@ -36,11 +40,22 @@ export default class CheckBoxComponent extends Field {
36
40
  { label: 'Not Checked', value: 'false' },
37
41
  ]
38
42
  },
39
- type: 'select',
43
+ type: 'select'
40
44
  };
41
- },
45
+ }
42
46
  };
43
47
  }
48
+ static savedValueTypes(schema) {
49
+ schema = schema || {};
50
+ const types = getComponentSavedTypes(schema);
51
+ if (_.isArray(types)) {
52
+ return types;
53
+ }
54
+ if (schema.inputType === 'radio') {
55
+ return [componentValueTypes.string];
56
+ }
57
+ return [componentValueTypes.boolean];
58
+ }
44
59
  get defaultSchema() {
45
60
  return CheckBoxComponent.schema();
46
61
  }
@@ -8,6 +8,7 @@ export default class ColumnsComponent extends NestedComponent {
8
8
  weight: number;
9
9
  schema: any;
10
10
  };
11
+ static savedValueTypes(): never[];
11
12
  rows: any[];
12
13
  get columnKey(): string;
13
14
  columns: any[] | undefined;
@@ -28,6 +28,9 @@ export default class ColumnsComponent extends NestedComponent {
28
28
  schema: ColumnsComponent.schema()
29
29
  };
30
30
  }
31
+ static savedValueTypes() {
32
+ return [];
33
+ }
31
34
  constructor(component, options, data) {
32
35
  super(component, options, data);
33
36
  this.rows = [];
@@ -1,5 +1,5 @@
1
1
  import _ from 'lodash';
2
- import { getFocusableElements } from '../../utils/utils';
2
+ import { componentValueTypes, getComponentSavedTypes, getFocusableElements } from '../../utils/utils';
3
3
  import Component from '../_classes/component/Component';
4
4
  import Field from '../_classes/field/Field';
5
5
  import NestedDataComponent from '../_classes/nesteddata/NestedDataComponent';
@@ -31,6 +31,9 @@ export default class ContainerComponent extends NestedDataComponent {
31
31
  super(...args);
32
32
  this.type = 'container';
33
33
  }
34
+ static savedValueTypes(schema) {
35
+ return getComponentSavedTypes(schema) || [componentValueTypes.object];
36
+ }
34
37
  addComponents(data, options) {
35
38
  return super.addComponents(this.dataValue, options);
36
39
  }
@@ -8,6 +8,7 @@ export default class ContentComponent extends Component {
8
8
  weight: number;
9
9
  schema: any;
10
10
  };
11
+ static savedValueTypes(): never[];
11
12
  get content(): any;
12
13
  render(): any;
13
14
  get dataReady(): any;
@@ -21,6 +21,9 @@ export default class ContentComponent extends Component {
21
21
  schema: ContentComponent.schema()
22
22
  };
23
23
  }
24
+ static savedValueTypes() {
25
+ return [];
26
+ }
24
27
  get defaultSchema() {
25
28
  return ContentComponent.schema();
26
29
  }
@@ -1,4 +1,5 @@
1
1
  export default class DataMapComponent extends DataGridComponent {
2
+ static savedValueTypes(schema: any): string[];
2
3
  constructor(component: any, options: any, data: any);
3
4
  get emptyValue(): {};
4
5
  set dataValue(arg: any);
@@ -2,7 +2,7 @@ import Component from '../_classes/component/Component';
2
2
  import DataGridComponent from '../datagrid/DataGrid';
3
3
  import _ from 'lodash';
4
4
  import EventEmitter from 'eventemitter3';
5
- import { uniqueKey } from '../../utils/utils';
5
+ import { componentValueTypes, getComponentSavedTypes, uniqueKey } from '../../utils/utils';
6
6
  export default class DataMapComponent extends DataGridComponent {
7
7
  static schema(...extend) {
8
8
  return Component.schema({
@@ -44,6 +44,9 @@ export default class DataMapComponent extends DataGridComponent {
44
44
  }
45
45
  return _.omit(schema, 'components');
46
46
  }
47
+ static savedValueTypes(schema) {
48
+ return getComponentSavedTypes(schema) || [componentValueTypes.object];
49
+ }
47
50
  constructor(component, options, data) {
48
51
  super(component, options, data);
49
52
  this.type = 'datamap';
@@ -10,7 +10,26 @@ export default class DateTimeComponent extends Input {
10
10
  static get serverConditionSettings(): {
11
11
  operators: string[];
12
12
  valueComponent(classComp: any): any;
13
+ constructor: Function;
14
+ toString(): string;
15
+ toLocaleString(): string;
16
+ valueOf(): Object;
17
+ hasOwnProperty(v: PropertyKey): boolean;
18
+ isPrototypeOf(v: Object): boolean;
19
+ propertyIsEnumerable(v: PropertyKey): boolean;
13
20
  };
21
+ static get conditionOperatorsSettings(): {
22
+ operators: string[];
23
+ valueComponent(classComp: any): any;
24
+ constructor: Function;
25
+ toString(): string;
26
+ toLocaleString(): string;
27
+ valueOf(): Object;
28
+ hasOwnProperty(v: PropertyKey): boolean;
29
+ isPrototypeOf(v: Object): boolean;
30
+ propertyIsEnumerable(v: PropertyKey): boolean;
31
+ };
32
+ static savedValueTypes(schema: any): string[];
14
33
  get emptyValue(): string;
15
34
  get momentFormat(): string;
16
35
  createWrapper(): boolean;
@@ -1,6 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import moment from 'moment';
3
3
  import FormioUtils from '../../utils';
4
+ import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
4
5
  import Input from '../_classes/input/Input';
5
6
  export default class DateTimeComponent extends Input {
6
7
  static schema(...extend) {
@@ -51,26 +52,24 @@ export default class DateTimeComponent extends Input {
51
52
  };
52
53
  }
53
54
  static get serverConditionSettings() {
55
+ return DateTimeComponent.conditionOperatorsSettings;
56
+ }
57
+ static get conditionOperatorsSettings() {
54
58
  return {
55
- ...super.serverConditionSettings,
56
- operators: [
57
- 'isDateEqual',
58
- 'isNotDateEqual',
59
- 'isEmpty',
60
- 'isNotEmpty',
61
- 'dateLessThan',
62
- 'dateGreaterThan',
63
- 'dateLessThanOrEqual',
64
- 'dateGreaterThanOrEqual',
65
- ],
59
+ ...super.conditionOperatorsSettings,
60
+ operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual'],
66
61
  valueComponent(classComp) {
67
62
  return {
68
63
  ...classComp,
69
64
  type: 'datetime',
70
65
  };
71
- },
66
+ }
72
67
  };
73
68
  }
69
+ static savedValueTypes(schema) {
70
+ schema = schema || {};
71
+ return getComponentSavedTypes(schema) || [componentValueTypes.date];
72
+ }
74
73
  constructor(component, options, data) {
75
74
  super(component, options, data);
76
75
  const timezone = (this.component.timezone || this.options.timezone);
@@ -7,6 +7,27 @@ export default class DayComponent extends Field {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static get conditionOperatorsSettings(): {
11
+ operators: string[];
12
+ constructor: Function;
13
+ toString(): string;
14
+ toLocaleString(): string;
15
+ valueOf(): Object;
16
+ hasOwnProperty(v: PropertyKey): boolean;
17
+ isPrototypeOf(v: Object): boolean;
18
+ propertyIsEnumerable(v: PropertyKey): boolean;
19
+ };
20
+ static savedValueTypes(schema: any): string[];
21
+ static get serverConditionSettings(): {
22
+ operators: string[];
23
+ constructor: Function;
24
+ toString(): string;
25
+ toLocaleString(): string;
26
+ valueOf(): Object;
27
+ hasOwnProperty(v: PropertyKey): boolean;
28
+ isPrototypeOf(v: Object): boolean;
29
+ propertyIsEnumerable(v: PropertyKey): boolean;
30
+ };
10
31
  constructor(component: any, options: any, data: any);
11
32
  /**
12
33
  * The empty value for day component.
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import moment from 'moment';
3
3
  import Field from '../_classes/field/Field';
4
- import { boolValue, getLocaleDateFormatInfo } from '../../utils/utils';
4
+ import { boolValue, componentValueTypes, getComponentSavedTypes, getLocaleDateFormatInfo } from '../../utils/utils';
5
5
  export default class DayComponent extends Field {
6
6
  static schema(...extend) {
7
7
  return Field.schema({
@@ -38,6 +38,16 @@ export default class DayComponent extends Field {
38
38
  schema: DayComponent.schema()
39
39
  };
40
40
  }
41
+ static get conditionOperatorsSettings() {
42
+ return {
43
+ ...super.conditionOperatorsSettings,
44
+ operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual'],
45
+ };
46
+ }
47
+ static savedValueTypes(schema) {
48
+ schema = schema || {};
49
+ return getComponentSavedTypes(schema) || [componentValueTypes.string];
50
+ }
41
51
  constructor(component, options, data) {
42
52
  if (component.maxDate) {
43
53
  component.maxDate = moment(component.maxDate, 'YYYY-MM-DD').toISOString();
@@ -48,19 +58,7 @@ export default class DayComponent extends Field {
48
58
  super(component, options, data);
49
59
  }
50
60
  static get serverConditionSettings() {
51
- return {
52
- ...super.serverConditionSettings,
53
- operators: [
54
- 'isDateEqual',
55
- 'isNotDateEqual',
56
- 'isEmpty',
57
- 'isNotEmpty',
58
- 'dateLessThan',
59
- 'dateGreaterThan',
60
- 'dateLessThanOrEqual',
61
- 'dateGreaterThanOrEqual',
62
- ],
63
- };
61
+ return DayComponent.conditionOperatorsSettings;
64
62
  }
65
63
  /**
66
64
  * The empty value for day component.
@@ -8,6 +8,7 @@ export default class FieldsetComponent extends NestedComponent {
8
8
  weight: number;
9
9
  schema: any;
10
10
  };
11
+ static savedValueTypes(): never[];
11
12
  constructor(...args: any[]);
12
13
  noField: boolean;
13
14
  }
@@ -22,6 +22,9 @@ export default class FieldsetComponent extends NestedComponent {
22
22
  schema: FieldsetComponent.schema()
23
23
  };
24
24
  }
25
+ static savedValueTypes() {
26
+ return [];
27
+ }
25
28
  get defaultSchema() {
26
29
  return FieldsetComponent.schema();
27
30
  }
@@ -7,6 +7,27 @@ export default class FileComponent extends Field {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static get serverConditionSettings(): {
11
+ operators: string[];
12
+ constructor: Function;
13
+ toString(): string;
14
+ toLocaleString(): string;
15
+ valueOf(): Object;
16
+ hasOwnProperty(v: PropertyKey): boolean;
17
+ isPrototypeOf(v: Object): boolean;
18
+ propertyIsEnumerable(v: PropertyKey): boolean;
19
+ };
20
+ static get conditionOperatorsSettings(): {
21
+ operators: string[];
22
+ constructor: Function;
23
+ toString(): string;
24
+ toLocaleString(): string;
25
+ valueOf(): Object;
26
+ hasOwnProperty(v: PropertyKey): boolean;
27
+ isPrototypeOf(v: Object): boolean;
28
+ propertyIsEnumerable(v: PropertyKey): boolean;
29
+ };
30
+ static savedValueTypes(schema: any): string[];
10
31
  support: {
11
32
  filereader: boolean;
12
33
  formdata: boolean;
@@ -54,7 +75,6 @@ export default class FileComponent extends Field {
54
75
  validateMaxSize(file: any, val: any): boolean;
55
76
  upload(files: any): void;
56
77
  filesUploading: any[] | undefined;
57
- abortUpload: any;
58
78
  getFile(fileInfo: any): any;
59
79
  focus(): void;
60
80
  }