@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
@@ -68,7 +68,14 @@ class FileComponent extends Field_1.default {
68
68
  };
69
69
  }
70
70
  static get serverConditionSettings() {
71
- return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: ['isEmpty', 'isNotEmpty'] });
71
+ return FileComponent.conditionOperatorsSettings;
72
+ }
73
+ static get conditionOperatorsSettings() {
74
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
75
+ }
76
+ static savedValueTypes(schema) {
77
+ schema = schema || {};
78
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
72
79
  }
73
80
  init() {
74
81
  super.init();
@@ -354,8 +361,10 @@ class FileComponent extends Field_1.default {
354
361
  this.refs.fileStatusRemove.forEach((fileStatusRemove, index) => {
355
362
  this.addEventListener(fileStatusRemove, 'click', (event) => {
356
363
  event.preventDefault();
357
- if (this.abortUpload) {
358
- this.abortUpload();
364
+ const fileUpload = this.statuses[index];
365
+ lodash_1.default.pull(this.filesUploading, fileUpload.originalName);
366
+ if (fileUpload.abort) {
367
+ fileUpload.abort();
359
368
  }
360
369
  this.statuses.splice(index, 1);
361
370
  this.redraw();
@@ -561,6 +570,7 @@ class FileComponent extends Field_1.default {
561
570
  const fileName = (0, utils_1.uniqueName)(file.name, this.component.fileNameTemplate, this.evalContext());
562
571
  const escapedFileName = file.name ? file.name.replaceAll('<', '&lt;').replaceAll('>', '&gt;') : file.name;
563
572
  const fileUpload = {
573
+ abort: () => null,
564
574
  originalName: escapedFileName,
565
575
  name: fileName,
566
576
  size: file.size,
@@ -680,7 +690,7 @@ class FileComponent extends Field_1.default {
680
690
  }
681
691
  }
682
692
  }
683
- fileUpload.message = this.t('Starting upload.');
693
+ fileUpload.message = this.t('Starting upload...');
684
694
  this.redraw();
685
695
  const filePromise = fileService.uploadFile(storage, processedFile || file, fileName, dir,
686
696
  // Progress callback
@@ -693,9 +703,7 @@ class FileComponent extends Field_1.default {
693
703
  // Upload start callback
694
704
  () => {
695
705
  this.emit('fileUploadingStart', filePromise);
696
- },
697
- // Abort upload callback
698
- (abort) => this.abortUpload = abort).then((fileInfo) => {
706
+ }, (abort) => fileUpload.abort = abort).then((fileInfo) => {
699
707
  const index = this.statuses.indexOf(fileUpload);
700
708
  if (index !== -1) {
701
709
  this.statuses.splice(index, 1);
@@ -7,6 +7,7 @@ export default class FormComponent extends Component {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static savedValueTypes(): string[];
10
11
  init(): any;
11
12
  formObj: any;
12
13
  valueChanged: boolean | undefined;
@@ -33,6 +33,9 @@ class FormComponent extends Component_1.default {
33
33
  schema: FormComponent.schema()
34
34
  };
35
35
  }
36
+ static savedValueTypes() {
37
+ return [utils_1.componentValueTypes.object];
38
+ }
36
39
  init() {
37
40
  super.init();
38
41
  this.formObj = {
@@ -8,6 +8,7 @@ export default class HTMLComponent extends Component {
8
8
  showPreview: boolean;
9
9
  schema: any;
10
10
  };
11
+ static savedValueTypes(): never[];
11
12
  get content(): any;
12
13
  get singleTags(): string[];
13
14
  checkRefreshOn(changed: any): void;
@@ -28,6 +28,9 @@ class HTMLComponent extends Component_1.default {
28
28
  schema: HTMLComponent.schema()
29
29
  };
30
30
  }
31
+ static savedValueTypes() {
32
+ return [];
33
+ }
31
34
  get defaultSchema() {
32
35
  return HTMLComponent.schema();
33
36
  }
@@ -8,9 +8,28 @@ export default class NumberComponent extends Input {
8
8
  schema: any;
9
9
  };
10
10
  static get serverConditionSettings(): {
11
- operators: string[];
11
+ operators: any[];
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: any[];
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
  constructor(...args: any[]);
15
34
  validators: string[];
16
35
  delimiter: any;
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const text_mask_addons_1 = require("@formio/text-mask-addons");
7
7
  const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
- const utils_1 = require("../../utils/utils");
10
9
  const Input_1 = __importDefault(require("../_classes/input/Input"));
10
+ const utils_1 = require("../../utils/utils");
11
11
  class NumberComponent extends Input_1.default {
12
12
  static schema(...extend) {
13
13
  return Input_1.default.schema({
@@ -33,21 +33,16 @@ class NumberComponent extends Input_1.default {
33
33
  };
34
34
  }
35
35
  static get serverConditionSettings() {
36
- return {
37
- operators: [
38
- 'isEqual',
39
- 'isNotEqual',
40
- 'isEmpty',
41
- 'isNotEmpty',
42
- 'greaterThan',
43
- 'greaterThanOrEqual',
44
- 'lessThan',
45
- 'lessThanOrEqual',
46
- ],
47
- valueComponent(classComp) {
36
+ return NumberComponent.conditionOperatorsSettings;
37
+ }
38
+ static get conditionOperatorsSettings() {
39
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: [...super.conditionOperatorsSettings.operators, 'lessThan', 'greaterThan', 'lessThanOrEqual', 'greaterThanOrEqual'], valueComponent(classComp) {
48
40
  return Object.assign(Object.assign({}, classComp), { type: 'number' });
49
- },
50
- };
41
+ } });
42
+ }
43
+ static savedValueTypes(schema) {
44
+ schema = schema || {};
45
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.number];
51
46
  }
52
47
  constructor(...args) {
53
48
  var _a, _b;
@@ -7,6 +7,7 @@ export default class PanelComponent extends NestedComponent {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static savedValueTypes(): never[];
10
11
  constructor(...args: any[]);
11
12
  noField: boolean;
12
13
  getComponent(path: any, fn: any, originalPath: any): Object;
@@ -38,6 +38,9 @@ class PanelComponent extends NestedComponent_1.default {
38
38
  get templateName() {
39
39
  return 'panel';
40
40
  }
41
+ static savedValueTypes() {
42
+ return [];
43
+ }
41
44
  constructor(...args) {
42
45
  super(...args);
43
46
  this.noField = true;
@@ -7,6 +7,25 @@ export default class RadioComponent extends ListComponent {
7
7
  documentation: string;
8
8
  schema: any;
9
9
  };
10
+ static get conditionOperatorsSettings(): {
11
+ valueComponent(classComp: any): {
12
+ type: string;
13
+ dataSrc: string;
14
+ valueProperty: string;
15
+ dataType: any;
16
+ data: {
17
+ custom(): any;
18
+ };
19
+ };
20
+ constructor: Function;
21
+ toString(): string;
22
+ toLocaleString(): string;
23
+ valueOf(): Object;
24
+ hasOwnProperty(v: PropertyKey): boolean;
25
+ isPrototypeOf(v: Object): boolean;
26
+ propertyIsEnumerable(v: PropertyKey): boolean;
27
+ };
28
+ static savedValueTypes(schema: any): any[];
10
29
  constructor(component: any, options: any, data: any);
11
30
  previousValue: any;
12
31
  get inputInfo(): {
@@ -31,6 +31,36 @@ class RadioComponent extends ListComponent_1.default {
31
31
  schema: RadioComponent.schema()
32
32
  };
33
33
  }
34
+ static get conditionOperatorsSettings() {
35
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
36
+ return {
37
+ type: 'select',
38
+ dataSrc: 'custom',
39
+ valueProperty: 'value',
40
+ dataType: classComp.dataType || '',
41
+ data: {
42
+ custom() {
43
+ return classComp.values;
44
+ }
45
+ },
46
+ };
47
+ } });
48
+ }
49
+ static savedValueTypes(schema) {
50
+ const { boolean, string, number, object, array } = utils_1.componentValueTypes;
51
+ const { dataType } = schema;
52
+ const types = (0, utils_1.getComponentSavedTypes)(schema);
53
+ if (types) {
54
+ return types;
55
+ }
56
+ if (dataType === 'object') {
57
+ return [object, array];
58
+ }
59
+ if (utils_1.componentValueTypes[dataType]) {
60
+ return [utils_1.componentValueTypes[dataType]];
61
+ }
62
+ return [boolean, string, number, object, array];
63
+ }
34
64
  constructor(component, options, data) {
35
65
  super(component, options, data);
36
66
  this.previousValue = this.dataValue || null;
@@ -7,6 +7,7 @@ export default class ReCaptchaComponent extends Component {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static savedValueTypes(): never[];
10
11
  render(): any;
11
12
  recaptchaResult: any;
12
13
  createInput(): void;
@@ -26,6 +26,9 @@ class ReCaptchaComponent extends Component_1.default {
26
26
  schema: ReCaptchaComponent.schema()
27
27
  };
28
28
  }
29
+ static savedValueTypes() {
30
+ return [];
31
+ }
29
32
  render() {
30
33
  this.recaptchaResult = null;
31
34
  if (this.builderMode) {
@@ -9,8 +9,25 @@ export default class SelectComponent extends ListComponent {
9
9
  };
10
10
  static get serverConditionSettings(): {
11
11
  valueComponent(classComp: any): any;
12
- 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;
13
19
  };
20
+ static get conditionOperatorsSettings(): {
21
+ valueComponent(classComp: any): any;
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): any[];
14
31
  templateData: {} | undefined;
15
32
  triggerUpdate: ((...args: any[]) => any) | undefined;
16
33
  set itemsLoaded(arg: any);
@@ -40,6 +57,7 @@ export default class SelectComponent extends ListComponent {
40
57
  get isSelectResource(): boolean;
41
58
  get itemsFromUrl(): boolean;
42
59
  get isInfiniteScrollProvided(): boolean;
60
+ get shouldInitialLoad(): any;
43
61
  isEntireObjectDisplay(): boolean;
44
62
  selectValueAndLabel(data: any): {
45
63
  value: any;
@@ -59,10 +59,31 @@ class SelectComponent extends ListComponent_1.default {
59
59
  };
60
60
  }
61
61
  static get serverConditionSettings() {
62
- return Object.assign(Object.assign({}, super.serverConditionSettings), { valueComponent(classComp) {
62
+ return SelectComponent.conditionOperatorsSettings;
63
+ }
64
+ static get conditionOperatorsSettings() {
65
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
63
66
  return Object.assign(Object.assign({}, classComp), { type: 'select' });
64
67
  } });
65
68
  }
69
+ static savedValueTypes(schema) {
70
+ const { boolean, string, number, object, array } = utils_1.componentValueTypes;
71
+ const { dataType, reference } = schema;
72
+ const types = (0, utils_1.getComponentSavedTypes)(schema);
73
+ if (types) {
74
+ return types;
75
+ }
76
+ if (reference) {
77
+ return [object];
78
+ }
79
+ if (dataType === 'object') {
80
+ return [object, array];
81
+ }
82
+ if (utils_1.componentValueTypes[dataType]) {
83
+ return [utils_1.componentValueTypes[dataType]];
84
+ }
85
+ return [boolean, string, number, object, array];
86
+ }
66
87
  init() {
67
88
  super.init();
68
89
  this.templateData = {};
@@ -174,6 +195,15 @@ class SelectComponent extends ListComponent_1.default {
174
195
  get shouldDisabled() {
175
196
  return super.shouldDisabled || this.parentDisabled;
176
197
  }
198
+ get shouldInitialLoad() {
199
+ if (this.component.widget === 'html5' &&
200
+ this.isEntireObjectDisplay() &&
201
+ this.component.searchField &&
202
+ this.dataValue) {
203
+ return false;
204
+ }
205
+ return super.shouldLoad;
206
+ }
177
207
  isEntireObjectDisplay() {
178
208
  return this.component.dataSrc === 'resource' && this.valueProperty === 'data';
179
209
  }
@@ -482,7 +512,11 @@ class SelectComponent extends ListComponent_1.default {
482
512
  });
483
513
  // Add search capability.
484
514
  if (this.component.searchField && search) {
485
- const searchValue = Array.isArray(search) ? search.join(',') : search;
515
+ const searchValue = Array.isArray(search)
516
+ ? search.join(',')
517
+ : typeof search === 'object'
518
+ ? JSON.stringify(search)
519
+ : search;
486
520
  query[this.component.searchField] = this.component.searchField.endsWith('__regex')
487
521
  ? lodash_1.default.escapeRegExp(searchValue)
488
522
  : searchValue;
@@ -1167,7 +1201,7 @@ class SelectComponent extends ListComponent_1.default {
1167
1201
  !this.active &&
1168
1202
  !this.selectOptions.length &&
1169
1203
  hasValue &&
1170
- this.shouldLoad &&
1204
+ this.shouldInitialLoad &&
1171
1205
  this.visible && (this.component.searchField || this.component.valueProperty);
1172
1206
  }
1173
1207
  setChoicesValue(value, hasPreviousValue, flags = {}) {
@@ -9,8 +9,33 @@ export default class SelectBoxesComponent extends RadioComponent {
9
9
  custom: string;
10
10
  };
11
11
  };
12
- 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;
13
19
  };
20
+ static get conditionOperatorsSettings(): {
21
+ valueComponent(classComp: any): {
22
+ type: string;
23
+ dataSrc: string;
24
+ valueProperty: string;
25
+ valueType: string;
26
+ data: {
27
+ custom: string;
28
+ };
29
+ };
30
+ constructor: Function;
31
+ toString(): string;
32
+ toLocaleString(): string;
33
+ valueOf(): Object;
34
+ hasOwnProperty(v: PropertyKey): boolean;
35
+ isPrototypeOf(v: Object): boolean;
36
+ propertyIsEnumerable(v: PropertyKey): boolean;
37
+ };
38
+ static savedValueTypes(schema: any): string[];
14
39
  constructor(...args: any[]);
15
40
  validators: string[];
16
41
  get emptyValue(): 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 Radio_1 = __importDefault(require("../radio/Radio"));
8
9
  class SelectBoxesComponent extends Radio_1.default {
9
10
  static schema(...extend) {
@@ -25,7 +26,10 @@ class SelectBoxesComponent extends Radio_1.default {
25
26
  };
26
27
  }
27
28
  static get serverConditionSettings() {
28
- return Object.assign(Object.assign({}, super.serverConditionSettings), { valueComponent(classComp) {
29
+ return SelectBoxesComponent.conditionOperatorsSettings;
30
+ }
31
+ static get conditionOperatorsSettings() {
32
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
29
33
  return {
30
34
  type: 'select',
31
35
  dataSrc: 'custom',
@@ -37,6 +41,9 @@ class SelectBoxesComponent extends Radio_1.default {
37
41
  };
38
42
  } });
39
43
  }
44
+ static savedValueTypes(schema) {
45
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
46
+ }
40
47
  constructor(...args) {
41
48
  super(...args);
42
49
  this.validators = this.validators.concat('minSelectedCount', 'maxSelectedCount', 'availableValueProperty');
@@ -7,6 +7,27 @@ export default class SignatureComponent extends Input {
7
7
  documentation: string;
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
  currentWidth: any;
11
32
  scale: any;
12
33
  ratio: number | undefined;
@@ -7,6 +7,7 @@ const signature_pad_1 = __importDefault(require("signature_pad"));
7
7
  const resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
8
8
  const Input_1 = __importDefault(require("../_classes/input/Input"));
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
+ const utils_1 = require("../../utils/utils");
10
11
  class SignatureComponent extends Input_1.default {
11
12
  static schema(...extend) {
12
13
  return Input_1.default.schema({
@@ -34,7 +35,14 @@ class SignatureComponent extends Input_1.default {
34
35
  };
35
36
  }
36
37
  static get serverConditionSettings() {
37
- return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: ['isEmpty', 'isNotEmpty'] });
38
+ return SignatureComponent.conditionOperatorsSettings;
39
+ }
40
+ static get conditionOperatorsSettings() {
41
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
42
+ }
43
+ static savedValueTypes(schema) {
44
+ schema = schema || {};
45
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.string];
38
46
  }
39
47
  init() {
40
48
  var _a, _b, _c, _d, _e;
@@ -7,6 +7,27 @@ export default class SurveyComponent extends Field {
7
7
  documentation: string;
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
  render(): any;
11
32
  setValue(value: any, flags?: {}): boolean;
12
33
  get emptyValue(): {};
@@ -27,7 +27,13 @@ class SurveyComponent extends Field_1.default {
27
27
  };
28
28
  }
29
29
  static get serverConditionSettings() {
30
- return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: ['isEmpty', 'isNotEmpty'] });
30
+ return SurveyComponent.conditionOperatorsSettings;
31
+ }
32
+ static get conditionOperatorsSettings() {
33
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
34
+ }
35
+ static savedValueTypes(schema) {
36
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
31
37
  }
32
38
  get defaultSchema() {
33
39
  return SurveyComponent.schema();
@@ -11,6 +11,7 @@ export default class TableComponent extends NestedComponent {
11
11
  showPreview: boolean;
12
12
  schema: any;
13
13
  };
14
+ static savedValueTypes(): never[];
14
15
  constructor(...args: any[]);
15
16
  get cellClassName(): string;
16
17
  get tableKey(): string;
@@ -48,6 +48,9 @@ class TableComponent extends NestedComponent_1.default {
48
48
  schema: TableComponent.schema()
49
49
  };
50
50
  }
51
+ static savedValueTypes() {
52
+ return [];
53
+ }
51
54
  get defaultSchema() {
52
55
  return TableComponent.schema();
53
56
  }
@@ -8,6 +8,7 @@ export default class TabsComponent extends NestedComponent {
8
8
  showPreview: boolean;
9
9
  schema: any;
10
10
  };
11
+ static savedValueTypes(): never[];
11
12
  constructor(...args: any[]);
12
13
  get tabKey(): string;
13
14
  get tabLikey(): string;
@@ -35,6 +35,9 @@ class TabsComponent extends NestedComponent_1.default {
35
35
  schema: TabsComponent.schema(),
36
36
  };
37
37
  }
38
+ static savedValueTypes() {
39
+ return [];
40
+ }
38
41
  get defaultSchema() {
39
42
  return TabsComponent.schema();
40
43
  }
@@ -7,6 +7,27 @@ export default class TagsComponent extends Input {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static get serverConditionSettings(): {
11
+ operators: any[];
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: any[];
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): any[];
10
31
  get emptyValue(): "" | never[];
11
32
  get delimiter(): any;
12
33
  attachElement(element: any, index: any): void;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("../../utils/utils");
6
7
  const Input_1 = __importDefault(require("../_classes/input/Input"));
7
8
  const choices_js_1 = __importDefault(require("@formio/choices.js"));
8
9
  class TagsComponent extends Input_1.default {
@@ -27,7 +28,14 @@ class TagsComponent extends Input_1.default {
27
28
  };
28
29
  }
29
30
  static get serverConditionSettings() {
30
- return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: [...super.serverConditionSettings.operators, 'includes', 'notIncludes'] });
31
+ return TagsComponent.conditionOperatorsSettings;
32
+ }
33
+ static get conditionOperatorsSettings() {
34
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: [...super.conditionOperatorsSettings.operators, 'includes', 'notIncludes'] });
35
+ }
36
+ static savedValueTypes(schema) {
37
+ schema = schema || {};
38
+ return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes[schema.storeas] || utils_1.componentValueTypes.string];
31
39
  }
32
40
  init() {
33
41
  super.init();
@@ -7,6 +7,27 @@ export default class TextFieldComponent extends Input {
7
7
  weight: number;
8
8
  schema: any;
9
9
  };
10
+ static get serverConditionSettings(): {
11
+ operators: any[];
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: any[];
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
  get emptyValue(): string;
11
32
  /**
12
33
  * Returns the mask value object.