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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) 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 +58 -36
  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 +59 -37
  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/Element.js +5 -0
  20. package/lib/cjs/Embed.d.ts +21 -1
  21. package/lib/cjs/Embed.js +211 -308
  22. package/lib/cjs/Form.d.ts +1 -1
  23. package/lib/cjs/Form.js +1 -1
  24. package/lib/cjs/Webform.d.ts +6 -6
  25. package/lib/cjs/Webform.js +6 -6
  26. package/lib/cjs/WebformBuilder.js +1 -1
  27. package/lib/cjs/components/_classes/component/Component.d.ts +16 -6
  28. package/lib/cjs/components/_classes/component/Component.js +26 -6
  29. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
  30. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
  31. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
  32. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
  33. package/lib/cjs/components/address/Address.js +5 -0
  34. package/lib/cjs/components/button/Button.d.ts +1 -0
  35. package/lib/cjs/components/button/Button.js +3 -0
  36. package/lib/cjs/components/checkbox/Checkbox.d.ts +28 -0
  37. package/lib/cjs/components/checkbox/Checkbox.js +17 -2
  38. package/lib/cjs/components/columns/Columns.d.ts +1 -0
  39. package/lib/cjs/components/columns/Columns.js +3 -0
  40. package/lib/cjs/components/container/Container.js +3 -0
  41. package/lib/cjs/components/content/Content.d.ts +1 -0
  42. package/lib/cjs/components/content/Content.js +3 -0
  43. package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
  44. package/lib/cjs/components/datamap/DataMap.js +3 -0
  45. package/lib/cjs/components/datetime/DateTime.d.ts +19 -0
  46. package/lib/cjs/components/datetime/DateTime.js +9 -10
  47. package/lib/cjs/components/day/Day.d.ts +21 -0
  48. package/lib/cjs/components/day/Day.js +12 -10
  49. package/lib/cjs/components/day/fixtures/comp5.d.ts +29 -0
  50. package/lib/cjs/components/day/fixtures/comp5.js +32 -0
  51. package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
  52. package/lib/cjs/components/day/fixtures/index.js +3 -1
  53. package/lib/cjs/components/fieldset/Fieldset.d.ts +1 -0
  54. package/lib/cjs/components/fieldset/Fieldset.js +3 -0
  55. package/lib/cjs/components/file/File.d.ts +21 -1
  56. package/lib/cjs/components/file/File.js +15 -7
  57. package/lib/cjs/components/form/Form.d.ts +1 -0
  58. package/lib/cjs/components/form/Form.js +5 -1
  59. package/lib/cjs/components/html/HTML.d.ts +1 -0
  60. package/lib/cjs/components/html/HTML.js +3 -0
  61. package/lib/cjs/components/number/Number.d.ts +20 -1
  62. package/lib/cjs/components/number/Number.js +10 -15
  63. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  64. package/lib/cjs/components/panel/Panel.js +3 -0
  65. package/lib/cjs/components/radio/Radio.d.ts +19 -0
  66. package/lib/cjs/components/radio/Radio.js +30 -0
  67. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -0
  68. package/lib/cjs/components/recaptcha/ReCaptcha.js +3 -0
  69. package/lib/cjs/components/select/Select.d.ts +19 -1
  70. package/lib/cjs/components/select/Select.js +39 -4
  71. package/lib/cjs/components/select/fixtures/comp19.d.ts +23 -0
  72. package/lib/cjs/components/select/fixtures/comp19.js +36 -0
  73. package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
  74. package/lib/cjs/components/select/fixtures/index.js +3 -1
  75. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +26 -1
  76. package/lib/cjs/components/selectboxes/SelectBoxes.js +8 -1
  77. package/lib/cjs/components/signature/Signature.d.ts +21 -0
  78. package/lib/cjs/components/signature/Signature.js +9 -1
  79. package/lib/cjs/components/survey/Survey.d.ts +21 -0
  80. package/lib/cjs/components/survey/Survey.js +7 -1
  81. package/lib/cjs/components/table/Table.d.ts +1 -0
  82. package/lib/cjs/components/table/Table.js +3 -0
  83. package/lib/cjs/components/tabs/Tabs.d.ts +1 -0
  84. package/lib/cjs/components/tabs/Tabs.js +3 -0
  85. package/lib/cjs/components/tags/Tags.d.ts +21 -0
  86. package/lib/cjs/components/tags/Tags.js +11 -1
  87. package/lib/cjs/components/tags/fixtures/comp6.d.ts +17 -0
  88. package/lib/cjs/components/tags/fixtures/comp6.js +20 -0
  89. package/lib/cjs/components/tags/fixtures/index.d.ts +2 -1
  90. package/lib/cjs/components/tags/fixtures/index.js +3 -1
  91. package/lib/cjs/components/textfield/TextField.d.ts +21 -0
  92. package/lib/cjs/components/textfield/TextField.js +7 -1
  93. package/lib/cjs/components/time/Time.d.ts +8 -1
  94. package/lib/cjs/components/well/Well.d.ts +1 -0
  95. package/lib/cjs/components/well/Well.js +3 -0
  96. package/lib/cjs/formio.embed.d.ts +2 -1
  97. package/lib/cjs/formio.embed.js +96 -1
  98. package/lib/cjs/formio.form.d.ts +4 -3
  99. package/lib/cjs/formio.form.js +17 -8
  100. package/lib/cjs/licenses/Licenses.d.ts +7 -0
  101. package/lib/cjs/licenses/Licenses.js +22 -0
  102. package/lib/cjs/licenses/index.d.ts +2 -0
  103. package/lib/cjs/licenses/index.js +7 -0
  104. package/lib/cjs/utils/utils.d.ts +10 -0
  105. package/lib/cjs/utils/utils.js +21 -1
  106. package/lib/mjs/CDN.d.ts +1 -0
  107. package/lib/mjs/CDN.js +1 -0
  108. package/lib/mjs/Element.js +5 -0
  109. package/lib/mjs/Embed.d.ts +21 -1
  110. package/lib/mjs/Embed.js +208 -322
  111. package/lib/mjs/Form.d.ts +1 -1
  112. package/lib/mjs/Form.js +1 -1
  113. package/lib/mjs/Webform.d.ts +6 -6
  114. package/lib/mjs/Webform.js +6 -6
  115. package/lib/mjs/WebformBuilder.js +1 -1
  116. package/lib/mjs/components/_classes/component/Component.d.ts +16 -6
  117. package/lib/mjs/components/_classes/component/Component.js +26 -6
  118. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
  119. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
  120. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
  121. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
  122. package/lib/mjs/components/address/Address.js +5 -0
  123. package/lib/mjs/components/button/Button.d.ts +1 -0
  124. package/lib/mjs/components/button/Button.js +4 -1
  125. package/lib/mjs/components/checkbox/Checkbox.d.ts +28 -0
  126. package/lib/mjs/components/checkbox/Checkbox.js +18 -3
  127. package/lib/mjs/components/columns/Columns.d.ts +1 -0
  128. package/lib/mjs/components/columns/Columns.js +3 -0
  129. package/lib/mjs/components/container/Container.js +4 -1
  130. package/lib/mjs/components/content/Content.d.ts +1 -0
  131. package/lib/mjs/components/content/Content.js +3 -0
  132. package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
  133. package/lib/mjs/components/datamap/DataMap.js +4 -1
  134. package/lib/mjs/components/datetime/DateTime.d.ts +19 -0
  135. package/lib/mjs/components/datetime/DateTime.js +11 -12
  136. package/lib/mjs/components/day/Day.d.ts +21 -0
  137. package/lib/mjs/components/day/Day.js +16 -14
  138. package/lib/mjs/components/day/fixtures/comp5.d.ts +29 -0
  139. package/lib/mjs/components/day/fixtures/comp5.js +30 -0
  140. package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
  141. package/lib/mjs/components/day/fixtures/index.js +2 -1
  142. package/lib/mjs/components/fieldset/Fieldset.d.ts +1 -0
  143. package/lib/mjs/components/fieldset/Fieldset.js +3 -0
  144. package/lib/mjs/components/file/File.d.ts +21 -1
  145. package/lib/mjs/components/file/File.js +16 -8
  146. package/lib/mjs/components/form/Form.d.ts +1 -0
  147. package/lib/mjs/components/form/Form.js +6 -2
  148. package/lib/mjs/components/html/HTML.d.ts +1 -0
  149. package/lib/mjs/components/html/HTML.js +3 -0
  150. package/lib/mjs/components/number/Number.d.ts +20 -1
  151. package/lib/mjs/components/number/Number.js +11 -12
  152. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  153. package/lib/mjs/components/panel/Panel.js +3 -0
  154. package/lib/mjs/components/radio/Radio.d.ts +19 -0
  155. package/lib/mjs/components/radio/Radio.js +34 -1
  156. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -0
  157. package/lib/mjs/components/recaptcha/ReCaptcha.js +3 -0
  158. package/lib/mjs/components/select/Select.d.ts +19 -1
  159. package/lib/mjs/components/select/Select.js +41 -6
  160. package/lib/mjs/components/select/fixtures/comp19.d.ts +23 -0
  161. package/lib/mjs/components/select/fixtures/comp19.js +34 -0
  162. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  163. package/lib/mjs/components/select/fixtures/index.js +2 -1
  164. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +26 -1
  165. package/lib/mjs/components/selectboxes/SelectBoxes.js +8 -1
  166. package/lib/mjs/components/signature/Signature.d.ts +21 -0
  167. package/lib/mjs/components/signature/Signature.js +9 -1
  168. package/lib/mjs/components/survey/Survey.d.ts +21 -0
  169. package/lib/mjs/components/survey/Survey.js +8 -2
  170. package/lib/mjs/components/table/Table.d.ts +1 -0
  171. package/lib/mjs/components/table/Table.js +3 -0
  172. package/lib/mjs/components/tabs/Tabs.d.ts +1 -0
  173. package/lib/mjs/components/tabs/Tabs.js +3 -0
  174. package/lib/mjs/components/tags/Tags.d.ts +21 -0
  175. package/lib/mjs/components/tags/Tags.js +12 -2
  176. package/lib/mjs/components/tags/fixtures/comp6.d.ts +17 -0
  177. package/lib/mjs/components/tags/fixtures/comp6.js +18 -0
  178. package/lib/mjs/components/tags/fixtures/index.d.ts +2 -1
  179. package/lib/mjs/components/tags/fixtures/index.js +2 -1
  180. package/lib/mjs/components/textfield/TextField.d.ts +21 -0
  181. package/lib/mjs/components/textfield/TextField.js +8 -2
  182. package/lib/mjs/components/time/Time.d.ts +8 -1
  183. package/lib/mjs/components/well/Well.d.ts +1 -0
  184. package/lib/mjs/components/well/Well.js +3 -0
  185. package/lib/mjs/formio.embed.d.ts +2 -1
  186. package/lib/mjs/formio.embed.js +96 -2
  187. package/lib/mjs/formio.form.d.ts +4 -3
  188. package/lib/mjs/formio.form.js +16 -8
  189. package/lib/mjs/licenses/Licenses.d.ts +7 -0
  190. package/lib/mjs/licenses/Licenses.js +17 -0
  191. package/lib/mjs/licenses/index.d.ts +2 -0
  192. package/lib/mjs/licenses/index.js +2 -0
  193. package/lib/mjs/utils/utils.d.ts +10 -0
  194. package/lib/mjs/utils/utils.js +19 -0
  195. package/package.json +5 -1
  196. package/types/index.d.ts +1 -0
  197. package/types/licenses.d.ts +7 -0
  198. package/types/utils.d.ts +2 -0
package/lib/cjs/Form.js CHANGED
@@ -44,7 +44,7 @@ class Form extends Element_1.default {
44
44
  * @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.
45
45
  *
46
46
  * @example
47
- * import Form from 'formiojs/Form';
47
+ * import Form from '@formio/js/Form';
48
48
  * const form = new Form(document.getElementById('formio'), 'https://examples.form.io/example');
49
49
  * form.build();
50
50
  */
@@ -65,7 +65,7 @@ declare class Webform extends NestedDataComponent {
65
65
  * @type {Promise}
66
66
  *
67
67
  * @example
68
- * import Webform from 'formiojs/Webform';
68
+ * import Webform from '@formio/js/Webform';
69
69
  * let form = new Webform(document.getElementById('formio'));
70
70
  * form.formReady.then(() => {
71
71
  * console.log('The form is ready!');
@@ -90,7 +90,7 @@ declare class Webform extends NestedDataComponent {
90
90
  * @type {Promise}
91
91
  *
92
92
  * @example
93
- * import Webform from 'formiojs/Webform';
93
+ * import Webform from '@formio/js/Webform';
94
94
  * let form = new Webform(document.getElementById('formio'));
95
95
  * form.submissionReady.then(() => {
96
96
  * console.log('The submission is ready!');
@@ -140,7 +140,7 @@ declare class Webform extends NestedDataComponent {
140
140
  * @param {string} value - The value of the form embed url.
141
141
  *
142
142
  * @example
143
- * import Webform from 'formiojs/Webform';
143
+ * import Webform from '@formio/js/Webform';
144
144
  * let form = new Webform(document.getElementById('formio'));
145
145
  * form.formReady.then(() => {
146
146
  * console.log('The form is formReady!');
@@ -207,7 +207,7 @@ declare class Webform extends NestedDataComponent {
207
207
  * Sets the JSON schema for the form to be rendered.
208
208
  *
209
209
  * @example
210
- * import Webform from 'formiojs/Webform';
210
+ * import Webform from '@formio/js/Webform';
211
211
  * let form = new Webform(document.getElementById('formio'));
212
212
  * form.setForm({
213
213
  * components: [
@@ -257,7 +257,7 @@ declare class Webform extends NestedDataComponent {
257
257
  * Sets the submission of a form.
258
258
  *
259
259
  * @example
260
- * import Webform from 'formiojs/Webform';
260
+ * import Webform from '@formio/js/Webform';
261
261
  * let form = new Webform(document.getElementById('formio'));
262
262
  * form.src = 'https://examples.form.io/example';
263
263
  * form.submission = {data: {
@@ -372,7 +372,7 @@ declare class Webform extends NestedDataComponent {
372
372
  * Submits the form.
373
373
  *
374
374
  * @example
375
- * import Webform from 'formiojs/Webform';
375
+ * import Webform from '@formio/js/Webform';
376
376
  * let form = new Webform(document.getElementById('formio'));
377
377
  * form.src = 'https://examples.form.io/example';
378
378
  * form.submission = {data: {
@@ -163,7 +163,7 @@ class Webform extends NestedDataComponent_1.default {
163
163
  * @type {Promise}
164
164
  *
165
165
  * @example
166
- * import Webform from 'formiojs/Webform';
166
+ * import Webform from '@formio/js/Webform';
167
167
  * let form = new Webform(document.getElementById('formio'));
168
168
  * form.formReady.then(() => {
169
169
  * console.log('The form is ready!');
@@ -189,7 +189,7 @@ class Webform extends NestedDataComponent_1.default {
189
189
  * @type {Promise}
190
190
  *
191
191
  * @example
192
- * import Webform from 'formiojs/Webform';
192
+ * import Webform from '@formio/js/Webform';
193
193
  * let form = new Webform(document.getElementById('formio'));
194
194
  * form.submissionReady.then(() => {
195
195
  * console.log('The submission is ready!');
@@ -373,7 +373,7 @@ class Webform extends NestedDataComponent_1.default {
373
373
  * @param {string} value - The value of the form embed url.
374
374
  *
375
375
  * @example
376
- * import Webform from 'formiojs/Webform';
376
+ * import Webform from '@formio/js/Webform';
377
377
  * let form = new Webform(document.getElementById('formio'));
378
378
  * form.formReady.then(() => {
379
379
  * console.log('The form is formReady!');
@@ -478,7 +478,7 @@ class Webform extends NestedDataComponent_1.default {
478
478
  * Sets the JSON schema for the form to be rendered.
479
479
  *
480
480
  * @example
481
- * import Webform from 'formiojs/Webform';
481
+ * import Webform from '@formio/js/Webform';
482
482
  * let form = new Webform(document.getElementById('formio'));
483
483
  * form.setForm({
484
484
  * components: [
@@ -612,7 +612,7 @@ class Webform extends NestedDataComponent_1.default {
612
612
  * Sets the submission of a form.
613
613
  *
614
614
  * @example
615
- * import Webform from 'formiojs/Webform';
615
+ * import Webform from '@formio/js/Webform';
616
616
  * let form = new Webform(document.getElementById('formio'));
617
617
  * form.src = 'https://examples.form.io/example';
618
618
  * form.submission = {data: {
@@ -1342,7 +1342,7 @@ class Webform extends NestedDataComponent_1.default {
1342
1342
  * Submits the form.
1343
1343
  *
1344
1344
  * @example
1345
- * import Webform from 'formiojs/Webform';
1345
+ * import Webform from '@formio/js/Webform';
1346
1346
  * let form = new Webform(document.getElementById('formio'));
1347
1347
  * form.src = 'https://examples.form.io/example';
1348
1348
  * form.submission = {data: {
@@ -407,7 +407,7 @@ class WebformBuilder extends Component_1.default {
407
407
  premium: {
408
408
  title: 'Premium',
409
409
  weight: 40
410
- },
410
+ }
411
411
  };
412
412
  }
413
413
  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
  *
@@ -200,6 +200,31 @@ class Component extends Element_1.default {
200
200
  static get Validator() {
201
201
  return Validator_1.default;
202
202
  }
203
+ /**
204
+ * Return the simple condition settings as part of the component.
205
+ *
206
+ * @return {Object}
207
+ *
208
+ */
209
+ static get conditionOperatorsSettings() {
210
+ return {
211
+ operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],
212
+ valueComponent() {
213
+ return { type: 'textfield' };
214
+ }
215
+ };
216
+ }
217
+ /**
218
+ * Return the array of possible types of component value absed on its schema.
219
+ *
220
+ * @param schema
221
+ * @return {Array}
222
+ *
223
+ */
224
+ static savedValueTypes(schema) {
225
+ schema = schema || {};
226
+ return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.any];
227
+ }
203
228
  /**
204
229
  * Provides a table view for this component. Override if you wish to do something different than using getView
205
230
  * method of your instance.
@@ -1404,12 +1429,7 @@ class Component extends Element_1.default {
1404
1429
  return customCSS;
1405
1430
  }
1406
1431
  static get serverConditionSettings() {
1407
- return {
1408
- operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],
1409
- valueComponent() {
1410
- return { type: 'textfield' };
1411
- },
1412
- };
1432
+ return Component.conditionOperatorsSettings;
1413
1433
  }
1414
1434
  get isMobile() {
1415
1435
  return (0, ismobilejs_1.default)();
@@ -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;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
+ const utils_1 = require("../../../utils/utils");
7
8
  const Component_1 = __importDefault(require("../component/Component"));
8
9
  const NestedDataComponent_1 = __importDefault(require("../nesteddata/NestedDataComponent"));
9
10
  class NestedArrayComponent extends NestedDataComponent_1.default {
@@ -12,6 +13,9 @@ class NestedArrayComponent extends NestedDataComponent_1.default {
12
13
  disableAddingRemovingRows: false
13
14
  }, ...extend);
14
15
  }
16
+ static savedValueTypes() {
17
+ return [utils_1.componentValueTypes.array];
18
+ }
15
19
  componentContext(component) {
16
20
  return this.iteratableRows[component.rowIndex].data;
17
21
  }
@@ -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(): {};
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Component_1 = __importDefault(require("../component/Component"));
7
7
  const NestedComponent_1 = __importDefault(require("../nested/NestedComponent"));
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
+ const utils_1 = require("../../../utils/utils");
9
10
  class NestedDataComponent extends NestedComponent_1.default {
10
11
  hasChanged(newValue, oldValue) {
11
12
  // If we do not have a value and are getting set to anything other than undefined or null, then we changed.
@@ -16,6 +17,9 @@ class NestedDataComponent extends NestedComponent_1.default {
16
17
  }
17
18
  return !lodash_1.default.isEqual(newValue, oldValue);
18
19
  }
20
+ static savedValueTypes(schema) {
21
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
22
+ }
19
23
  get allowData() {
20
24
  return true;
21
25
  }
@@ -11,6 +11,7 @@ const GoogleAddressProvider_1 = require("../../providers/address/GoogleAddressPr
11
11
  const Field_1 = __importDefault(require("../_classes/field/Field"));
12
12
  const NestedComponent_1 = __importDefault(require("../_classes/nested/NestedComponent"));
13
13
  const Container_1 = __importDefault(require("../container/Container"));
14
+ const utils_1 = require("../../utils/utils");
14
15
  exports.AddressComponentMode = {
15
16
  Autocomplete: 'autocomplete',
16
17
  Manual: 'manual',
@@ -82,6 +83,10 @@ class AddressComponent extends Container_1.default {
82
83
  ],
83
84
  }, ...extend);
84
85
  }
86
+ static savedValueTypes(schema) {
87
+ schema = schema || {};
88
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
89
+ }
85
90
  static get builderInfo() {
86
91
  return {
87
92
  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(): {
@@ -34,6 +34,9 @@ class ButtonComponent extends Field_1.default {
34
34
  schema: ButtonComponent.schema()
35
35
  };
36
36
  }
37
+ static savedValueTypes(schema) {
38
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.boolean];
39
+ }
37
40
  constructor(component, options, data) {
38
41
  super(component, options, data);
39
42
  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;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
+ const utils_1 = require("../../utils/utils");
7
8
  const Field_1 = __importDefault(require("../_classes/field/Field"));
8
9
  class CheckBoxComponent extends Field_1.default {
9
10
  static schema(...extend) {
@@ -29,7 +30,10 @@ class CheckBoxComponent extends Field_1.default {
29
30
  };
30
31
  }
31
32
  static get serverConditionSettings() {
32
- return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: ['isEqual'], valueComponent() {
33
+ return CheckBoxComponent.conditionOperatorsSettings;
34
+ }
35
+ static get conditionOperatorsSettings() {
36
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEqual'], valueComponent() {
33
37
  return {
34
38
  valueType: 'boolean',
35
39
  data: {
@@ -38,10 +42,21 @@ class CheckBoxComponent extends Field_1.default {
38
42
  { label: 'Not Checked', value: 'false' },
39
43
  ]
40
44
  },
41
- type: 'select',
45
+ type: 'select'
42
46
  };
43
47
  } });
44
48
  }
49
+ static savedValueTypes(schema) {
50
+ schema = schema || {};
51
+ const types = (0, utils_1.getComponentSavedTypes)(schema);
52
+ if (lodash_1.default.isArray(types)) {
53
+ return types;
54
+ }
55
+ if (schema.inputType === 'radio') {
56
+ return [utils_1.componentValueTypes.string];
57
+ }
58
+ return [utils_1.componentValueTypes.boolean];
59
+ }
45
60
  get defaultSchema() {
46
61
  return CheckBoxComponent.schema();
47
62
  }
@@ -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;
@@ -33,6 +33,9 @@ class ColumnsComponent extends NestedComponent_1.default {
33
33
  schema: ColumnsComponent.schema()
34
34
  };
35
35
  }
36
+ static savedValueTypes() {
37
+ return [];
38
+ }
36
39
  constructor(component, options, data) {
37
40
  super(component, options, data);
38
41
  this.rows = [];
@@ -36,6 +36,9 @@ class ContainerComponent extends NestedDataComponent_1.default {
36
36
  super(...args);
37
37
  this.type = 'container';
38
38
  }
39
+ static savedValueTypes(schema) {
40
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
41
+ }
39
42
  addComponents(data, options) {
40
43
  return super.addComponents(this.dataValue, options);
41
44
  }
@@ -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;
@@ -26,6 +26,9 @@ class ContentComponent extends Component_1.default {
26
26
  schema: ContentComponent.schema()
27
27
  };
28
28
  }
29
+ static savedValueTypes() {
30
+ return [];
31
+ }
29
32
  get defaultSchema() {
30
33
  return ContentComponent.schema();
31
34
  }
@@ -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);
@@ -49,6 +49,9 @@ class DataMapComponent extends DataGrid_1.default {
49
49
  }
50
50
  return lodash_1.default.omit(schema, 'components');
51
51
  }
52
+ static savedValueTypes(schema) {
53
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
54
+ }
52
55
  constructor(component, options, data) {
53
56
  super(component, options, data);
54
57
  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;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const moment_1 = __importDefault(require("moment"));
8
8
  const utils_1 = __importDefault(require("../../utils"));
9
+ const utils_2 = require("../../utils/utils");
9
10
  const Input_1 = __importDefault(require("../_classes/input/Input"));
10
11
  class DateTimeComponent extends Input_1.default {
11
12
  static schema(...extend) {
@@ -56,19 +57,17 @@ class DateTimeComponent extends Input_1.default {
56
57
  };
57
58
  }
58
59
  static get serverConditionSettings() {
59
- return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: [
60
- 'isDateEqual',
61
- 'isNotDateEqual',
62
- 'isEmpty',
63
- 'isNotEmpty',
64
- 'dateLessThan',
65
- 'dateGreaterThan',
66
- 'dateLessThanOrEqual',
67
- 'dateGreaterThanOrEqual',
68
- ], valueComponent(classComp) {
60
+ return DateTimeComponent.conditionOperatorsSettings;
61
+ }
62
+ static get conditionOperatorsSettings() {
63
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual'], valueComponent(classComp) {
69
64
  return Object.assign(Object.assign({}, classComp), { type: 'datetime' });
70
65
  } });
71
66
  }
67
+ static savedValueTypes(schema) {
68
+ schema = schema || {};
69
+ return (0, utils_2.getComponentSavedTypes)(schema) || [utils_2.componentValueTypes.date];
70
+ }
72
71
  constructor(component, options, data) {
73
72
  super(component, options, data);
74
73
  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.
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const moment_1 = __importDefault(require("moment"));
8
8
  const Field_1 = __importDefault(require("../_classes/field/Field"));
9
+ const Input_1 = __importDefault(require("../_classes/input/Input"));
9
10
  const utils_1 = require("../../utils/utils");
10
11
  class DayComponent extends Field_1.default {
11
12
  static schema(...extend) {
@@ -43,6 +44,13 @@ class DayComponent extends Field_1.default {
43
44
  schema: DayComponent.schema()
44
45
  };
45
46
  }
47
+ static get conditionOperatorsSettings() {
48
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual'] });
49
+ }
50
+ static savedValueTypes(schema) {
51
+ schema = schema || {};
52
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.string];
53
+ }
46
54
  constructor(component, options, data) {
47
55
  if (component.maxDate) {
48
56
  component.maxDate = (0, moment_1.default)(component.maxDate, 'YYYY-MM-DD').toISOString();
@@ -53,16 +61,7 @@ class DayComponent extends Field_1.default {
53
61
  super(component, options, data);
54
62
  }
55
63
  static get serverConditionSettings() {
56
- return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: [
57
- 'isDateEqual',
58
- 'isNotDateEqual',
59
- 'isEmpty',
60
- 'isNotEmpty',
61
- 'dateLessThan',
62
- 'dateGreaterThan',
63
- 'dateLessThanOrEqual',
64
- 'dateGreaterThanOrEqual',
65
- ] });
64
+ return DayComponent.conditionOperatorsSettings;
66
65
  }
67
66
  /**
68
67
  * The empty value for day component.
@@ -293,6 +292,9 @@ class DayComponent extends Field_1.default {
293
292
  this.addEventListener(this.refs.input, this.info.changeEvent, () => this.updateValue(null, {
294
293
  modified: true
295
294
  }));
295
+ [this.refs.day, this.refs.month, this.refs.year].forEach((element) => {
296
+ Input_1.default.prototype.addFocusBlurEvents.call(this, element);
297
+ });
296
298
  }
297
299
  this.setValue(this.dataValue);
298
300
  // Force the disabled state with getters and setters.
@@ -0,0 +1,29 @@
1
+ declare namespace _default {
2
+ const type: string;
3
+ const display: string;
4
+ const components: {
5
+ label: string;
6
+ hideInputLabels: boolean;
7
+ inputsLabelPosition: string;
8
+ useLocaleSettings: boolean;
9
+ tableView: boolean;
10
+ fields: {
11
+ day: {
12
+ hide: boolean;
13
+ required: boolean;
14
+ };
15
+ month: {
16
+ hide: boolean;
17
+ };
18
+ year: {
19
+ hide: boolean;
20
+ };
21
+ };
22
+ validateOn: string;
23
+ key: string;
24
+ type: string;
25
+ input: boolean;
26
+ defaultValue: string;
27
+ }[];
28
+ }
29
+ export default _default;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ type: 'form',
5
+ display: 'form',
6
+ components: [
7
+ {
8
+ label: 'Day',
9
+ hideInputLabels: false,
10
+ inputsLabelPosition: 'top',
11
+ useLocaleSettings: false,
12
+ tableView: false,
13
+ fields: {
14
+ day: {
15
+ hide: false,
16
+ required: true
17
+ },
18
+ month: {
19
+ hide: false
20
+ },
21
+ year: {
22
+ hide: false
23
+ }
24
+ },
25
+ validateOn: 'blur',
26
+ key: 'day',
27
+ type: 'day',
28
+ input: true,
29
+ defaultValue: '00/00/0000'
30
+ },
31
+ ]
32
+ };
@@ -2,4 +2,5 @@ import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
- export { comp1, comp2, comp3, comp4 };
5
+ import comp5 from './comp5';
6
+ export { comp1, comp2, comp3, comp4, comp5 };