@formio/js 5.0.0-dev.5723.99bf27e → 5.0.0-dev.5725.d52e1c4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/Changelog.md +33 -0
  2. package/dist/formio.embed.js +1 -1
  3. package/dist/formio.embed.min.js +1 -1
  4. package/dist/formio.form.js +53 -33
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +2 -0
  7. package/dist/formio.full.js +59 -39
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +2 -0
  10. package/dist/formio.js +1 -1
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.utils.js +24 -4
  13. package/dist/formio.utils.min.js +1 -1
  14. package/dist/formio.utils.min.js.LICENSE.txt +2 -0
  15. package/lib/cjs/CDN.js +1 -2
  16. package/lib/cjs/Form.d.ts +2 -2
  17. package/lib/cjs/Form.js +11 -5
  18. package/lib/cjs/PDF.js +1 -1
  19. package/lib/cjs/PDFBuilder.js +2 -1
  20. package/lib/cjs/Webform.js +0 -1
  21. package/lib/cjs/WebformBuilder.js +8 -2
  22. package/lib/cjs/Wizard.js +1 -1
  23. package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
  24. package/lib/cjs/components/_classes/component/Component.js +5 -4
  25. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
  26. package/lib/cjs/components/_classes/multivalue/Multivalue.js +43 -25
  27. package/lib/cjs/components/_classes/nested/NestedComponent.js +2 -1
  28. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  29. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
  30. package/lib/cjs/components/address/Address.d.ts +6 -0
  31. package/lib/cjs/components/address/Address.js +7 -1
  32. package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -1
  33. package/lib/cjs/components/datagrid/DataGrid.js +2 -9
  34. package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  35. package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
  36. package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
  37. package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
  38. package/lib/cjs/components/datamap/DataMap.js +1 -1
  39. package/lib/cjs/components/day/Day.d.ts +3 -4
  40. package/lib/cjs/components/day/Day.js +31 -10
  41. package/lib/cjs/components/editgrid/EditGrid.js +2 -5
  42. package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  43. package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
  44. package/lib/cjs/components/editgrid/fixtures/index.d.ts +8 -7
  45. package/lib/cjs/components/editgrid/fixtures/index.js +3 -1
  46. package/lib/cjs/components/file/File.d.ts +2 -2
  47. package/lib/cjs/components/file/File.js +13 -2
  48. package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
  49. package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
  50. package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
  51. package/lib/cjs/components/form/fixtures/index.js +3 -1
  52. package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  53. package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
  54. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  55. package/lib/cjs/components/panel/Panel.js +1 -0
  56. package/lib/cjs/components/radio/Radio.d.ts +2 -18
  57. package/lib/cjs/components/radio/Radio.js +29 -27
  58. package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
  59. package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
  60. package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
  61. package/lib/cjs/components/radio/fixtures/index.js +3 -1
  62. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  63. package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
  64. package/lib/cjs/components/select/Select.d.ts +38 -0
  65. package/lib/cjs/components/select/Select.js +13 -3
  66. package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
  67. package/lib/cjs/components/select/fixtures/comp25.js +66 -0
  68. package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
  69. package/lib/cjs/components/select/fixtures/comp26.js +59 -0
  70. package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
  71. package/lib/cjs/components/select/fixtures/index.js +5 -1
  72. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  73. package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
  74. package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  75. package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
  76. package/lib/cjs/components/tags/Tags.js +3 -3
  77. package/lib/cjs/components/time/Time.form.js +2 -2
  78. package/lib/cjs/components/time/Time.js +0 -5
  79. package/lib/cjs/templates/Templates.js +1 -1
  80. package/lib/cjs/translations/en.d.ts +1 -0
  81. package/lib/cjs/translations/en.js +1 -0
  82. package/lib/mjs/CDN.js +1 -2
  83. package/lib/mjs/Form.d.ts +2 -2
  84. package/lib/mjs/Form.js +11 -5
  85. package/lib/mjs/PDF.js +1 -1
  86. package/lib/mjs/PDFBuilder.js +1 -1
  87. package/lib/mjs/Webform.js +0 -1
  88. package/lib/mjs/WebformBuilder.js +7 -2
  89. package/lib/mjs/Wizard.js +1 -1
  90. package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
  91. package/lib/mjs/components/_classes/component/Component.js +2 -1
  92. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
  93. package/lib/mjs/components/_classes/multivalue/Multivalue.js +43 -25
  94. package/lib/mjs/components/_classes/nested/NestedComponent.js +2 -1
  95. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
  96. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
  97. package/lib/mjs/components/address/Address.d.ts +6 -0
  98. package/lib/mjs/components/address/Address.js +10 -1
  99. package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -1
  100. package/lib/mjs/components/datagrid/DataGrid.js +2 -9
  101. package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
  102. package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
  103. package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
  104. package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
  105. package/lib/mjs/components/datamap/DataMap.js +1 -1
  106. package/lib/mjs/components/day/Day.d.ts +3 -4
  107. package/lib/mjs/components/day/Day.js +30 -10
  108. package/lib/mjs/components/editgrid/EditGrid.js +2 -5
  109. package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  110. package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
  111. package/lib/mjs/components/editgrid/fixtures/index.d.ts +8 -7
  112. package/lib/mjs/components/editgrid/fixtures/index.js +2 -1
  113. package/lib/mjs/components/file/File.d.ts +2 -2
  114. package/lib/mjs/components/file/File.js +13 -2
  115. package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
  116. package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
  117. package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
  118. package/lib/mjs/components/form/fixtures/index.js +2 -1
  119. package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
  120. package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
  121. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  122. package/lib/mjs/components/panel/Panel.js +1 -0
  123. package/lib/mjs/components/radio/Radio.d.ts +2 -18
  124. package/lib/mjs/components/radio/Radio.js +32 -30
  125. package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
  126. package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
  127. package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
  128. package/lib/mjs/components/radio/fixtures/index.js +2 -1
  129. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  130. package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
  131. package/lib/mjs/components/select/Select.d.ts +38 -0
  132. package/lib/mjs/components/select/Select.js +16 -4
  133. package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
  134. package/lib/mjs/components/select/fixtures/comp25.js +64 -0
  135. package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
  136. package/lib/mjs/components/select/fixtures/comp26.js +57 -0
  137. package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
  138. package/lib/mjs/components/select/fixtures/index.js +3 -1
  139. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  140. package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
  141. package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
  142. package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
  143. package/lib/mjs/components/tags/Tags.js +3 -3
  144. package/lib/mjs/components/time/Time.form.js +2 -2
  145. package/lib/mjs/components/time/Time.js +0 -11
  146. package/lib/mjs/templates/Templates.js +1 -1
  147. package/lib/mjs/translations/en.d.ts +1 -0
  148. package/lib/mjs/translations/en.js +1 -0
  149. package/package.json +4 -4
@@ -4,6 +4,7 @@ export default class PanelComponent extends NestedComponent {
4
4
  icon: string;
5
5
  group: string;
6
6
  documentation: string;
7
+ showPreview: boolean;
7
8
  weight: number;
8
9
  schema: any;
9
10
  };
@@ -22,6 +22,7 @@ export default class PanelComponent extends NestedComponent {
22
22
  icon: 'list-alt',
23
23
  group: 'layout',
24
24
  documentation: '/userguide/form-building/layout-components#panel',
25
+ showPreview: false,
25
26
  weight: 30,
26
27
  schema: PanelComponent.schema()
27
28
  };
@@ -8,26 +8,10 @@ export default class RadioComponent extends ListComponent {
8
8
  schema: any;
9
9
  };
10
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
- };
11
+ valueComponent(classComp: any): any;
20
12
  };
21
13
  static get serverConditionSettings(): {
22
- valueComponent(classComp: any): {
23
- type: string;
24
- dataSrc: string;
25
- valueProperty: string;
26
- dataType: any;
27
- data: {
28
- custom: string;
29
- };
30
- };
14
+ valueComponent(classComp: any): any;
31
15
  };
32
16
  static savedValueTypes(schema: any): any[];
33
17
  constructor(component: any, options: any, data: any);
@@ -30,35 +30,26 @@ export default class RadioComponent extends ListComponent {
30
30
  return {
31
31
  ...super.conditionOperatorsSettings,
32
32
  valueComponent(classComp) {
33
- return {
34
- type: 'select',
35
- dataSrc: 'custom',
36
- valueProperty: 'value',
37
- dataType: classComp.dataType || '',
38
- data: {
39
- custom() {
40
- return classComp.values;
33
+ const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';
34
+ return isValuesSrc
35
+ ? {
36
+ type: 'select',
37
+ dataSrc: 'custom',
38
+ valueProperty: 'value',
39
+ dataType: classComp.dataType || '',
40
+ data: {
41
+ custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,
41
42
  }
42
- },
43
- };
43
+ }
44
+ : {
45
+ ...classComp,
46
+ type: 'select',
47
+ };
44
48
  }
45
49
  };
46
50
  }
47
51
  static get serverConditionSettings() {
48
- return {
49
- ...super.serverConditionSettings,
50
- valueComponent(classComp) {
51
- return {
52
- type: 'select',
53
- dataSrc: 'custom',
54
- valueProperty: 'value',
55
- dataType: classComp.dataType || '',
56
- data: {
57
- custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,
58
- },
59
- };
60
- },
61
- };
52
+ return RadioComponent.conditionOperatorsSettings;
62
53
  }
63
54
  static savedValueTypes(schema) {
64
55
  const { boolean, string, number, object, array } = componentValueTypes;
@@ -264,6 +255,16 @@ export default class RadioComponent extends ListComponent {
264
255
  if (method.toUpperCase() === 'GET') {
265
256
  body = null;
266
257
  }
258
+ const limit = this.component.limit || 100;
259
+ const skip = this.isScrollLoading ? this.selectOptions.length : 0;
260
+ // Allow for url interpolation.
261
+ url = this.sanitize(this.interpolate(url, {
262
+ formioBase: Formio.getBaseUrl(),
263
+ search,
264
+ limit,
265
+ skip,
266
+ page: Math.abs(Math.floor(skip / limit))
267
+ }), this.shouldSanitizeValue);
267
268
  // Set ignoreCache if it is
268
269
  options.ignoreCache = this.component.ignoreCache;
269
270
  // Make the request.
@@ -295,14 +296,15 @@ export default class RadioComponent extends ListComponent {
295
296
  setItems(items) {
296
297
  const listData = [];
297
298
  items?.forEach((item, i) => {
299
+ const valueAtProperty = _.get(item, this.component.valueProperty);
298
300
  this.loadedOptions[i] = {
299
- value: this.component.valueProperty ? item[this.component.valueProperty] : item,
300
- label: this.component.valueProperty ? this.itemTemplate(item, item[this.component.valueProperty]) : this.itemTemplate(item, item, i)
301
+ value: this.component.valueProperty ? valueAtProperty : item,
302
+ label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
301
303
  };
302
- listData.push(this.templateData[this.component.valueProperty ? item[this.component.valueProperty] : i]);
303
- if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(item[this.component.valueProperty]) ||
304
- (!this.isRadio && _.isObject(item[this.component.valueProperty])) ||
305
- (!this.isRadio && _.isBoolean(item[this.component.valueProperty])))) {
304
+ listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
305
+ if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(valueAtProperty) ||
306
+ (!this.isRadio && _.isObject(valueAtProperty)) ||
307
+ (!this.isRadio && _.isBoolean(valueAtProperty)))) {
306
308
  this.loadedOptions[i].invalid = true;
307
309
  }
308
310
  });
@@ -0,0 +1,29 @@
1
+ declare namespace _default {
2
+ let components: {
3
+ label: string;
4
+ optionsLabelPosition: string;
5
+ tableView: boolean;
6
+ dataSrc: string;
7
+ values: {
8
+ label: string;
9
+ value: string;
10
+ shortcut: string;
11
+ }[];
12
+ valueProperty: string;
13
+ validateWhenHidden: boolean;
14
+ key: string;
15
+ type: string;
16
+ data: {
17
+ url: string;
18
+ headers: {
19
+ key: string;
20
+ value: string;
21
+ }[];
22
+ };
23
+ template: string;
24
+ authenticate: boolean;
25
+ input: boolean;
26
+ inputType: string;
27
+ }[];
28
+ }
29
+ export default _default;
@@ -0,0 +1,34 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ "label": "Select Boxes",
5
+ "optionsLabelPosition": "right",
6
+ "tableView": false,
7
+ "dataSrc": "url",
8
+ "values": [
9
+ {
10
+ "label": "",
11
+ "value": "",
12
+ "shortcut": ""
13
+ }
14
+ ],
15
+ "valueProperty": "data.name",
16
+ "validateWhenHidden": false,
17
+ "key": "selectBoxes",
18
+ "type": "selectboxes",
19
+ "data": {
20
+ "url": "https://remote-dev.form.io/projectId/name/submission",
21
+ "headers": [
22
+ {
23
+ "key": "",
24
+ "value": ""
25
+ }
26
+ ]
27
+ },
28
+ "template": "<span>{{ item.data.name }}</span>",
29
+ "authenticate": true,
30
+ "input": true,
31
+ "inputType": "checkbox"
32
+ }
33
+ ]
34
+ };
@@ -9,4 +9,5 @@ import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
10
  import comp10 from './comp10';
11
11
  import comp11 from './comp11';
12
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11 };
12
+ import comp12 from './comp12';
13
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
@@ -9,4 +9,5 @@ import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
10
  import comp10 from './comp10';
11
11
  import comp11 from './comp11';
12
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11 };
12
+ import comp12 from './comp12';
13
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12 };
@@ -1,6 +1,12 @@
1
1
  export default class ReCaptchaComponent extends Component {
2
2
  static get builderInfo(): {};
3
3
  static savedValueTypes(): never[];
4
+ static get conditionOperatorsSettings(): {
5
+ operators: string[];
6
+ };
7
+ static get serverConditionSettings(): {
8
+ operators: string[];
9
+ };
4
10
  render(): string;
5
11
  recaptchaResult: any;
6
12
  createInput(): void;
@@ -17,6 +17,15 @@ export default class ReCaptchaComponent extends Component {
17
17
  static savedValueTypes() {
18
18
  return [];
19
19
  }
20
+ static get conditionOperatorsSettings() {
21
+ return {
22
+ ...super.conditionOperatorsSettings,
23
+ operators: ['isEmpty', 'isNotEmpty'],
24
+ };
25
+ }
26
+ static get serverConditionSettings() {
27
+ return ReCaptchaComponent.conditionOperatorsSettings;
28
+ }
20
29
  render() {
21
30
  this.recaptchaResult = null;
22
31
  if (this.builderMode) {
@@ -9,9 +9,47 @@ export default class SelectComponent extends ListComponent {
9
9
  };
10
10
  static get serverConditionSettings(): {
11
11
  valueComponent(classComp: any): any;
12
+ dataTypeOperators: {
13
+ number: string[];
14
+ };
15
+ dataTypeValueComponents: {
16
+ number: {
17
+ lessThan: () => {
18
+ type: string;
19
+ };
20
+ greaterThan: () => {
21
+ type: string;
22
+ };
23
+ lessThanOrEqual: () => {
24
+ type: string;
25
+ };
26
+ greaterThanOrEqual: () => {
27
+ type: string;
28
+ };
29
+ };
30
+ };
12
31
  };
13
32
  static get conditionOperatorsSettings(): {
14
33
  valueComponent(classComp: any): any;
34
+ dataTypeOperators: {
35
+ number: string[];
36
+ };
37
+ dataTypeValueComponents: {
38
+ number: {
39
+ lessThan: () => {
40
+ type: string;
41
+ };
42
+ greaterThan: () => {
43
+ type: string;
44
+ };
45
+ lessThanOrEqual: () => {
46
+ type: string;
47
+ };
48
+ greaterThanOrEqual: () => {
49
+ type: string;
50
+ };
51
+ };
52
+ };
15
53
  };
16
54
  static savedValueTypes(schema: any): any[];
17
55
  templateData: {} | undefined;
@@ -57,6 +57,7 @@ export default class SelectComponent extends ListComponent {
57
57
  return SelectComponent.conditionOperatorsSettings;
58
58
  }
59
59
  static get conditionOperatorsSettings() {
60
+ const numberType = () => ({ type: 'number' });
60
61
  return {
61
62
  ...super.conditionOperatorsSettings,
62
63
  valueComponent(classComp) {
@@ -73,7 +74,18 @@ export default class SelectComponent extends ListComponent {
73
74
  `;
74
75
  }
75
76
  return valueComp;
76
- }
77
+ },
78
+ dataTypeOperators: {
79
+ number: ['lessThan', 'greaterThan', 'lessThanOrEqual', 'greaterThanOrEqual'],
80
+ },
81
+ dataTypeValueComponents: {
82
+ number: {
83
+ lessThan: numberType,
84
+ greaterThan: numberType,
85
+ lessThanOrEqual: numberType,
86
+ greaterThanOrEqual: numberType,
87
+ },
88
+ },
77
89
  };
78
90
  }
79
91
  static savedValueTypes(schema) {
@@ -526,13 +538,13 @@ export default class SelectComponent extends ListComponent {
526
538
  skip,
527
539
  };
528
540
  // Allow for url interpolation.
529
- url = this.interpolate(url, {
541
+ url = this.sanitize(this.interpolate(url, {
530
542
  formioBase: Formio.getBaseUrl(),
531
543
  search,
532
544
  limit,
533
545
  skip,
534
546
  page: Math.abs(Math.floor(skip / limit))
535
- });
547
+ }), this.shouldSanitizeValue);
536
548
  // Add search capability.
537
549
  if (this.component.searchField && search) {
538
550
  const searchValue = Array.isArray(search)
@@ -1581,8 +1593,8 @@ export default class SelectComponent extends ListComponent {
1581
1593
  super.detach();
1582
1594
  }
1583
1595
  focus() {
1596
+ super.focus.call(this);
1584
1597
  if (this.focusableElement) {
1585
- super.focus.call(this);
1586
1598
  this.focusableElement.focus();
1587
1599
  }
1588
1600
  }
@@ -0,0 +1,59 @@
1
+ declare namespace _default {
2
+ let components: ({
3
+ label: string;
4
+ tableView: boolean;
5
+ modal: boolean;
6
+ rowDrafts: boolean;
7
+ key: string;
8
+ type: string;
9
+ displayAsTable: boolean;
10
+ input: boolean;
11
+ components: ({
12
+ label: string;
13
+ widget: string;
14
+ tableView: boolean;
15
+ data: {
16
+ values: {
17
+ label: string;
18
+ value: string;
19
+ }[];
20
+ };
21
+ validate: {
22
+ required: boolean;
23
+ };
24
+ key: string;
25
+ type: string;
26
+ input: boolean;
27
+ applyMaskOn?: undefined;
28
+ validateWhenHidden?: undefined;
29
+ } | {
30
+ label: string;
31
+ applyMaskOn: string;
32
+ tableView: boolean;
33
+ validate: {
34
+ required: boolean;
35
+ };
36
+ validateWhenHidden: boolean;
37
+ key: string;
38
+ type: string;
39
+ input: boolean;
40
+ widget?: undefined;
41
+ data?: undefined;
42
+ })[];
43
+ showValidations?: undefined;
44
+ saveOnEnter?: undefined;
45
+ } | {
46
+ label: string;
47
+ showValidations: boolean;
48
+ tableView: boolean;
49
+ key: string;
50
+ type: string;
51
+ input: boolean;
52
+ saveOnEnter: boolean;
53
+ modal?: undefined;
54
+ rowDrafts?: undefined;
55
+ displayAsTable?: undefined;
56
+ components?: undefined;
57
+ })[];
58
+ }
59
+ export default _default;
@@ -0,0 +1,64 @@
1
+ export default {
2
+ "components": [
3
+ {
4
+ "label": "Edit Grid",
5
+ "tableView": false,
6
+ "modal": true,
7
+ "rowDrafts": true,
8
+ "key": "editGrid",
9
+ "type": "editgrid",
10
+ "displayAsTable": false,
11
+ "input": true,
12
+ "components": [
13
+ {
14
+ "label": "Select",
15
+ "widget": "choicesjs",
16
+ "tableView": true,
17
+ "data": {
18
+ "values": [
19
+ {
20
+ "label": "a",
21
+ "value": "a"
22
+ },
23
+ {
24
+ "label": "b",
25
+ "value": "b"
26
+ },
27
+ {
28
+ "label": "c",
29
+ "value": "c"
30
+ }
31
+ ]
32
+ },
33
+ "validate": {
34
+ "required": true
35
+ },
36
+ "key": "select",
37
+ "type": "select",
38
+ "input": true
39
+ },
40
+ {
41
+ "label": "Text Field",
42
+ "applyMaskOn": "change",
43
+ "tableView": true,
44
+ "validate": {
45
+ "required": true
46
+ },
47
+ "validateWhenHidden": false,
48
+ "key": "textField",
49
+ "type": "textfield",
50
+ "input": true
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "label": "Submit",
56
+ "showValidations": false,
57
+ "tableView": false,
58
+ "key": "submit",
59
+ "type": "button",
60
+ "input": true,
61
+ "saveOnEnter": false
62
+ }
63
+ ]
64
+ };
@@ -0,0 +1,44 @@
1
+ declare namespace _default {
2
+ let title: string;
3
+ let name: string;
4
+ let path: string;
5
+ let type: string;
6
+ let display: string;
7
+ let components: ({
8
+ label: string;
9
+ widget: string;
10
+ tableView: boolean;
11
+ data: {
12
+ values: {
13
+ label: string;
14
+ value: string;
15
+ }[];
16
+ };
17
+ dataType: string;
18
+ key: string;
19
+ type: string;
20
+ input: boolean;
21
+ applyMaskOn?: undefined;
22
+ conditional?: undefined;
23
+ } | {
24
+ label: string;
25
+ applyMaskOn: string;
26
+ tableView: boolean;
27
+ key: string;
28
+ type: string;
29
+ input: boolean;
30
+ conditional: {
31
+ show: boolean;
32
+ conjunction: string;
33
+ conditions: {
34
+ component: string;
35
+ operator: string;
36
+ value: number;
37
+ }[];
38
+ };
39
+ widget?: undefined;
40
+ data?: undefined;
41
+ dataType?: undefined;
42
+ })[];
43
+ }
44
+ export default _default;
@@ -0,0 +1,57 @@
1
+ export default {
2
+ title: 'FIO-8072',
3
+ name: 'fio8072',
4
+ path: 'fio8072',
5
+ type: 'form',
6
+ display: 'form',
7
+ components: [
8
+ {
9
+ label: 'Select',
10
+ widget: 'choicesjs',
11
+ tableView: true,
12
+ data: {
13
+ values: [
14
+ {
15
+ label: 'A',
16
+ value: '1',
17
+ },
18
+ {
19
+ label: 'B',
20
+ value: '2',
21
+ },
22
+ {
23
+ label: 'C',
24
+ value: '10',
25
+ },
26
+ {
27
+ label: 'D',
28
+ value: '1d',
29
+ },
30
+ ],
31
+ },
32
+ dataType: 'number',
33
+ key: 'select',
34
+ type: 'select',
35
+ input: true,
36
+ },
37
+ {
38
+ label: 'Text Field',
39
+ applyMaskOn: 'change',
40
+ tableView: true,
41
+ key: 'textField',
42
+ type: 'textfield',
43
+ input: true,
44
+ conditional: {
45
+ show: true,
46
+ conjunction: 'all',
47
+ conditions: [
48
+ {
49
+ component: 'select',
50
+ operator: 'lessThan',
51
+ value: 5,
52
+ },
53
+ ],
54
+ },
55
+ },
56
+ ],
57
+ };
@@ -21,5 +21,7 @@ import comp21 from './comp21';
21
21
  import comp22 from './comp22';
22
22
  import comp23 from './comp23';
23
23
  import comp24 from './comp24';
24
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24 };
24
+ import comp25 from './comp25';
25
+ import comp26 from './comp26';
26
+ export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26 };
25
27
  export { multiSelect, multiSelectOptions } from "./comp3";
@@ -22,4 +22,6 @@ import comp21 from './comp21';
22
22
  import comp22 from './comp22';
23
23
  import comp23 from './comp23';
24
24
  import comp24 from './comp24';
25
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24 };
25
+ import comp25 from './comp25';
26
+ import comp26 from './comp26';
27
+ export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26 };
@@ -1,26 +1,4 @@
1
1
  export default class SelectBoxesComponent extends RadioComponent {
2
- static get serverConditionSettings(): {
3
- valueComponent(classComp: any): {
4
- type: string;
5
- dataSrc: string;
6
- valueProperty: string;
7
- dataType: string;
8
- data: {
9
- custom: string;
10
- };
11
- };
12
- };
13
- static get conditionOperatorsSettings(): {
14
- valueComponent(classComp: any): {
15
- type: string;
16
- dataSrc: string;
17
- valueProperty: string;
18
- dataType: string;
19
- data: {
20
- custom: string;
21
- };
22
- };
23
- };
24
2
  static savedValueTypes(schema: any): string[];
25
3
  constructor(...args: any[]);
26
4
  get emptyValue(): any;
@@ -27,15 +27,22 @@ export default class SelectBoxesComponent extends RadioComponent {
27
27
  return {
28
28
  ...super.conditionOperatorsSettings,
29
29
  valueComponent(classComp) {
30
- return {
31
- type: 'select',
32
- dataSrc: 'custom',
33
- valueProperty: 'value',
34
- dataType: 'string',
35
- data: {
36
- custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`
37
- },
38
- };
30
+ const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';
31
+ return isValuesSrc
32
+ ? {
33
+ type: 'select',
34
+ dataSrc: 'custom',
35
+ valueProperty: 'value',
36
+ dataType: 'string',
37
+ data: {
38
+ custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`
39
+ },
40
+ }
41
+ : {
42
+ ...classComp,
43
+ dataType: 'string',
44
+ type: 'select',
45
+ };
39
46
  }
40
47
  };
41
48
  }