@formio/js 5.0.0-dev.5720.5431de8 → 5.0.0-dev.5721.5aa8849

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 (110) hide show
  1. package/Changelog.md +18 -0
  2. package/dist/formio.form.js +34 -24
  3. package/dist/formio.form.min.js +1 -1
  4. package/dist/formio.full.js +37 -27
  5. package/dist/formio.full.min.js +1 -1
  6. package/dist/formio.utils.js +12 -2
  7. package/dist/formio.utils.min.js +1 -1
  8. package/lib/cjs/Form.d.ts +2 -2
  9. package/lib/cjs/Form.js +9 -5
  10. package/lib/cjs/PDF.js +1 -1
  11. package/lib/cjs/Webform.js +1 -2
  12. package/lib/cjs/WebformBuilder.js +13 -3
  13. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
  14. package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
  15. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -0
  16. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +50 -29
  17. package/lib/cjs/components/currency/Currency.d.ts +1 -0
  18. package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -1
  19. package/lib/cjs/components/datagrid/DataGrid.js +0 -8
  20. package/lib/cjs/components/datamap/DataMap.js +1 -1
  21. package/lib/cjs/components/day/Day.d.ts +2 -2
  22. package/lib/cjs/components/day/Day.js +3 -3
  23. package/lib/cjs/components/editgrid/EditGrid.js +1 -5
  24. package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  25. package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
  26. package/lib/cjs/components/editgrid/fixtures/index.d.ts +2 -1
  27. package/lib/cjs/components/editgrid/fixtures/index.js +3 -1
  28. package/lib/cjs/components/file/File.js +4 -0
  29. package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
  30. package/lib/cjs/components/number/Number.d.ts +7 -1
  31. package/lib/cjs/components/number/Number.js +11 -0
  32. package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
  33. package/lib/cjs/components/number/fixtures/comp10.js +21 -0
  34. package/lib/cjs/components/number/fixtures/index.d.ts +2 -1
  35. package/lib/cjs/components/number/fixtures/index.js +3 -1
  36. package/lib/cjs/components/panel/Panel.d.ts +1 -0
  37. package/lib/cjs/components/panel/Panel.js +1 -0
  38. package/lib/cjs/components/radio/Radio.js +7 -6
  39. package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
  40. package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
  41. package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
  42. package/lib/cjs/components/radio/fixtures/index.js +3 -1
  43. package/lib/cjs/components/select/Select.d.ts +38 -0
  44. package/lib/cjs/components/select/Select.js +10 -0
  45. package/lib/cjs/components/select/fixtures/comp25.d.ts +44 -0
  46. package/lib/cjs/components/select/fixtures/comp25.js +59 -0
  47. package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
  48. package/lib/cjs/components/select/fixtures/index.js +3 -1
  49. package/lib/cjs/components/time/Time.d.ts +2 -2
  50. package/lib/cjs/components/time/Time.form.js +2 -2
  51. package/lib/cjs/components/time/Time.js +3 -2
  52. package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
  53. package/lib/cjs/components/time/fixtures/comp4.js +171 -0
  54. package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
  55. package/lib/cjs/components/time/fixtures/index.js +3 -1
  56. package/lib/cjs/templates/Templates.js +1 -1
  57. package/lib/cjs/translations/en.d.ts +1 -0
  58. package/lib/cjs/translations/en.js +1 -0
  59. package/lib/mjs/Form.d.ts +2 -2
  60. package/lib/mjs/Form.js +9 -5
  61. package/lib/mjs/PDF.js +1 -1
  62. package/lib/mjs/Webform.js +1 -2
  63. package/lib/mjs/WebformBuilder.js +12 -3
  64. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
  65. package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
  66. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -0
  67. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +51 -29
  68. package/lib/mjs/components/currency/Currency.d.ts +1 -0
  69. package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -1
  70. package/lib/mjs/components/datagrid/DataGrid.js +0 -8
  71. package/lib/mjs/components/datamap/DataMap.js +1 -1
  72. package/lib/mjs/components/day/Day.d.ts +2 -2
  73. package/lib/mjs/components/day/Day.js +3 -3
  74. package/lib/mjs/components/editgrid/EditGrid.js +1 -5
  75. package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
  76. package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
  77. package/lib/mjs/components/editgrid/fixtures/index.d.ts +2 -1
  78. package/lib/mjs/components/editgrid/fixtures/index.js +2 -1
  79. package/lib/mjs/components/file/File.js +4 -0
  80. package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
  81. package/lib/mjs/components/number/Number.d.ts +7 -1
  82. package/lib/mjs/components/number/Number.js +11 -0
  83. package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
  84. package/lib/mjs/components/number/fixtures/comp10.js +19 -0
  85. package/lib/mjs/components/number/fixtures/index.d.ts +2 -1
  86. package/lib/mjs/components/number/fixtures/index.js +2 -1
  87. package/lib/mjs/components/panel/Panel.d.ts +1 -0
  88. package/lib/mjs/components/panel/Panel.js +1 -0
  89. package/lib/mjs/components/radio/Radio.js +7 -6
  90. package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
  91. package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
  92. package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
  93. package/lib/mjs/components/radio/fixtures/index.js +2 -1
  94. package/lib/mjs/components/select/Select.d.ts +38 -0
  95. package/lib/mjs/components/select/Select.js +13 -1
  96. package/lib/mjs/components/select/fixtures/comp25.d.ts +44 -0
  97. package/lib/mjs/components/select/fixtures/comp25.js +57 -0
  98. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  99. package/lib/mjs/components/select/fixtures/index.js +2 -1
  100. package/lib/mjs/components/time/Time.d.ts +2 -2
  101. package/lib/mjs/components/time/Time.form.js +2 -2
  102. package/lib/mjs/components/time/Time.js +3 -2
  103. package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
  104. package/lib/mjs/components/time/fixtures/comp4.js +169 -0
  105. package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
  106. package/lib/mjs/components/time/fixtures/index.js +2 -1
  107. package/lib/mjs/templates/Templates.js +1 -1
  108. package/lib/mjs/translations/en.d.ts +1 -0
  109. package/lib/mjs/translations/en.js +1 -0
  110. package/package.json +3 -3
@@ -0,0 +1,80 @@
1
+ declare namespace _default {
2
+ let type: string;
3
+ let display: string;
4
+ let components: ({
5
+ label: string;
6
+ tableView: boolean;
7
+ rowDrafts: boolean;
8
+ key: string;
9
+ type: string;
10
+ input: boolean;
11
+ components: {
12
+ collapsible: boolean;
13
+ key: string;
14
+ type: string;
15
+ label: string;
16
+ input: boolean;
17
+ tableView: boolean;
18
+ components: {
19
+ label: string;
20
+ columns: ({
21
+ components: {
22
+ label: string;
23
+ optionsLabelPosition: string;
24
+ inline: boolean;
25
+ tableView: boolean;
26
+ values: {
27
+ label: string;
28
+ value: string;
29
+ shortcut: string;
30
+ }[];
31
+ key: string;
32
+ type: string;
33
+ input: boolean;
34
+ }[];
35
+ width: number;
36
+ offset: number;
37
+ push: number;
38
+ pull: number;
39
+ size: string;
40
+ currentWidth: number;
41
+ } | {
42
+ components: {
43
+ label: string;
44
+ applyMaskOn: string;
45
+ autoExpand: boolean;
46
+ tableView: boolean;
47
+ key: string;
48
+ conditional: {
49
+ show: boolean;
50
+ conjunction: string;
51
+ };
52
+ type: string;
53
+ input: boolean;
54
+ }[];
55
+ width: number;
56
+ offset: number;
57
+ push: number;
58
+ pull: number;
59
+ size: string;
60
+ currentWidth: number;
61
+ })[];
62
+ key: string;
63
+ type: string;
64
+ input: boolean;
65
+ tableView: boolean;
66
+ }[];
67
+ }[];
68
+ disableOnInvalid?: undefined;
69
+ } | {
70
+ type: string;
71
+ label: string;
72
+ key: string;
73
+ disableOnInvalid: boolean;
74
+ input: boolean;
75
+ tableView: boolean;
76
+ rowDrafts?: undefined;
77
+ components?: undefined;
78
+ })[];
79
+ }
80
+ export default _default;
@@ -0,0 +1,97 @@
1
+ export default {
2
+ type: 'form',
3
+ display: 'form',
4
+ components: [
5
+ {
6
+ label: 'Edit Grid',
7
+ tableView: false,
8
+ rowDrafts: false,
9
+ key: 'editGrid',
10
+ type: 'editgrid',
11
+ input: true,
12
+ components: [
13
+ {
14
+ collapsible: false,
15
+ key: 'panel',
16
+ type: 'panel',
17
+ label: 'Panel',
18
+ input: false,
19
+ tableView: false,
20
+ components: [
21
+ {
22
+ label: 'Columns',
23
+ columns: [
24
+ {
25
+ components: [
26
+ {
27
+ label: 'Radio',
28
+ optionsLabelPosition: 'right',
29
+ inline: false,
30
+ tableView: true,
31
+ values: [
32
+ {
33
+ label: 'yes',
34
+ value: 'yes',
35
+ shortcut: ''
36
+ },
37
+ {
38
+ label: 'no',
39
+ value: 'no',
40
+ shortcut: ''
41
+ }
42
+ ],
43
+ key: 'radio',
44
+ type: 'radio',
45
+ input: true
46
+ }
47
+ ],
48
+ width: 6,
49
+ offset: 0,
50
+ push: 0,
51
+ pull: 0,
52
+ size: 'md',
53
+ currentWidth: 6
54
+ },
55
+ {
56
+ components: [
57
+ {
58
+ label: 'Text Area',
59
+ applyMaskOn: 'change',
60
+ autoExpand: false,
61
+ tableView: true,
62
+ key: 'textArea',
63
+ conditional: {
64
+ show: true,
65
+ conjunction: 'all'
66
+ },
67
+ type: 'textarea',
68
+ input: true
69
+ }
70
+ ],
71
+ width: 6,
72
+ offset: 0,
73
+ push: 0,
74
+ pull: 0,
75
+ size: 'md',
76
+ currentWidth: 6
77
+ }
78
+ ],
79
+ key: 'columns',
80
+ type: 'columns',
81
+ input: false,
82
+ tableView: false
83
+ }
84
+ ]
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ type: 'button',
90
+ label: 'Submit',
91
+ key: 'submit',
92
+ disableOnInvalid: true,
93
+ input: true,
94
+ tableView: false
95
+ }
96
+ ]
97
+ };
@@ -14,8 +14,9 @@ import comp7 from './comp7';
14
14
  import comp8 from './comp8';
15
15
  import comp9 from './comp9';
16
16
  import comp16 from './comp16';
17
+ import comp17 from './comp17';
17
18
  import compOpenWhenEmpty from './comp-openWhenEmpty';
18
19
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
19
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
20
21
  import compTestEvents from './comp-test-events';
21
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
22
+ export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -14,8 +14,9 @@ import comp13 from './comp13';
14
14
  import comp14 from './comp14';
15
15
  import comp15 from './comp15';
16
16
  import comp16 from './comp16';
17
+ import comp17 from './comp17';
17
18
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
18
19
  import compOpenWhenEmpty from './comp-openWhenEmpty';
19
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
20
21
  import compTestEvents from './comp-test-events';
21
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
22
+ export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -931,6 +931,10 @@ export default class FileComponent extends Field {
931
931
  : response.type === 'abort'
932
932
  ? this.t('Request was aborted')
933
933
  : response.toString();
934
+ this.emit('fileUploadError', {
935
+ fileToSync,
936
+ response,
937
+ });
934
938
  }
935
939
  finally {
936
940
  delete fileToSync.progress;
@@ -44,7 +44,7 @@ export default [
44
44
  },
45
45
  searchField: 'title__regex',
46
46
  template: '<span>{{ item._vid }}</span>',
47
- valueProperty: '_id',
47
+ valueProperty: 'revisionId',
48
48
  authenticate: true,
49
49
  label: 'Form Revision',
50
50
  key: 'revision',
@@ -27,7 +27,13 @@ export default class NumberComponent extends Input {
27
27
  */
28
28
  createNumberMask(): any;
29
29
  isDecimalAllowed(): any;
30
- parseNumber(value: any): number;
30
+ /**
31
+ * parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
32
+ * be processed by either parseInt or parseFloat
33
+ * @param {string} value the value to be parsed
34
+ * @returns {number} a parsed number
35
+ */
36
+ parseNumber(value: string): number;
31
37
  setInputMask(input: any): void;
32
38
  getValueAt(index: any): number | null;
33
39
  setValueAt(index: any, value: any, flags?: {}): void;
@@ -89,6 +89,11 @@ export default class NumberComponent extends Input {
89
89
  }
90
90
  get defaultValue() {
91
91
  let defaultValue = super.defaultValue;
92
+ if (typeof defaultValue === 'string') {
93
+ // Default value may be a string or have custom thousands separators or decimal symbols, so we need to call
94
+ // parseNumber on it
95
+ defaultValue = this.parseNumber(defaultValue);
96
+ }
92
97
  if (!defaultValue && this.component.defaultValue === 0) {
93
98
  defaultValue = this.component.defaultValue;
94
99
  }
@@ -100,6 +105,12 @@ export default class NumberComponent extends Input {
100
105
  isDecimalAllowed() {
101
106
  return _.get(this.component, 'allowDecimal', !(this.component.validate && this.component.validate.integer));
102
107
  }
108
+ /**
109
+ * parses a numeric string by removing the delimiters and replacing the decimal separator back to '.' so that it can
110
+ * be processed by either parseInt or parseFloat
111
+ * @param {string} value the value to be parsed
112
+ * @returns {number} a parsed number
113
+ */
103
114
  parseNumber(value) {
104
115
  // Remove delimiters and convert decimal separator to dot.
105
116
  value = value.split(this.delimiter).join('').replace(this.decimalSeparator, '.');
@@ -0,0 +1,18 @@
1
+ declare namespace _default {
2
+ let components: {
3
+ label: string;
4
+ applyMaskOn: string;
5
+ mask: boolean;
6
+ tableView: boolean;
7
+ delimiter: boolean;
8
+ requireDecimal: boolean;
9
+ inputFormat: string;
10
+ truncateMultipleSpaces: boolean;
11
+ validateWhenHidden: boolean;
12
+ key: string;
13
+ type: string;
14
+ input: boolean;
15
+ defaultValue: string;
16
+ }[];
17
+ }
18
+ export default _default;
@@ -0,0 +1,19 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ "label": "Number",
5
+ "applyMaskOn": "change",
6
+ "mask": false,
7
+ "tableView": false,
8
+ "delimiter": false,
9
+ "requireDecimal": false,
10
+ "inputFormat": "plain",
11
+ "truncateMultipleSpaces": false,
12
+ "validateWhenHidden": false,
13
+ "key": "number",
14
+ "type": "number",
15
+ "input": true,
16
+ "defaultValue": "123.23"
17
+ }
18
+ ]
19
+ };
@@ -7,4 +7,5 @@ import comp6 from './comp6';
7
7
  import comp7 from './comp7';
8
8
  import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9 };
10
+ import comp10 from './comp10';
11
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 };
@@ -7,4 +7,5 @@ import comp6 from './comp6';
7
7
  import comp7 from './comp7';
8
8
  import comp8 from './comp8';
9
9
  import comp9 from './comp9';
10
- export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9 };
10
+ import comp10 from './comp10';
11
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10 };
@@ -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
  };
@@ -295,14 +295,15 @@ export default class RadioComponent extends ListComponent {
295
295
  setItems(items) {
296
296
  const listData = [];
297
297
  items?.forEach((item, i) => {
298
+ const valueAtProperty = _.get(item, this.component.valueProperty);
298
299
  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)
300
+ value: this.component.valueProperty ? valueAtProperty : item,
301
+ label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
301
302
  };
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])))) {
303
+ listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
304
+ if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(valueAtProperty) ||
305
+ (!this.isRadio && _.isObject(valueAtProperty)) ||
306
+ (!this.isRadio && _.isBoolean(valueAtProperty)))) {
306
307
  this.loadedOptions[i].invalid = true;
307
308
  }
308
309
  });
@@ -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 };
@@ -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) {
@@ -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,6 @@ 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
+ 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 };
25
26
  export { multiSelect, multiSelectOptions } from "./comp3";
@@ -22,4 +22,5 @@ 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
+ 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 };
@@ -1,12 +1,12 @@
1
1
  export default class TimeComponent extends TextFieldComponent {
2
- rawData: string | never[];
2
+ rawData: any;
3
3
  get dataFormat(): any;
4
4
  get skipMaskValidation(): boolean;
5
5
  isNotCompleteInput(value: any): any;
6
6
  removeValue(index: any): void;
7
7
  resetRawData(index: any): void;
8
8
  setRawValue(value: any, index: any): void;
9
- getRawValue(index: any): string | never[];
9
+ getRawValue(index: any): any;
10
10
  getValueAt(index: any): any;
11
11
  setValueAt(index: any, value: any): void;
12
12
  getStringAsValue(view: any): any;