@formio/js 5.0.0-dev.5794.12ca15f → 5.0.0-dev.5798.beb3cc0

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 (42) hide show
  1. package/dist/formio.form.js +562 -570
  2. package/dist/formio.form.min.js +1 -1
  3. package/dist/formio.form.min.js.LICENSE.txt +0 -10
  4. package/dist/formio.full.js +562 -570
  5. package/dist/formio.full.min.js +1 -1
  6. package/dist/formio.full.min.js.LICENSE.txt +0 -10
  7. package/dist/formio.js +1 -1
  8. package/dist/formio.min.js +1 -1
  9. package/dist/formio.utils.js +50 -48
  10. package/dist/formio.utils.min.js +1 -1
  11. package/dist/formio.utils.min.js.LICENSE.txt +4 -4
  12. package/lib/cjs/Webform.js +2 -2
  13. package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
  14. package/lib/cjs/components/_classes/component/Component.js +7 -6
  15. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
  16. package/lib/cjs/components/_classes/multivalue/Multivalue.js +12 -10
  17. package/lib/cjs/components/day/Day.d.ts +0 -1
  18. package/lib/cjs/components/editgrid/fixtures/index.d.ts +7 -7
  19. package/lib/cjs/components/editgrid/fixtures/index.js +1 -1
  20. package/lib/cjs/components/select/Select.js +1 -1
  21. package/lib/cjs/components/select/fixtures/comp25.d.ts +43 -28
  22. package/lib/cjs/components/select/fixtures/comp25.js +56 -49
  23. package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
  24. package/lib/cjs/components/select/fixtures/comp26.js +59 -0
  25. package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
  26. package/lib/cjs/components/select/fixtures/index.js +3 -1
  27. package/lib/mjs/Webform.js +6 -2
  28. package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
  29. package/lib/mjs/components/_classes/component/Component.js +4 -3
  30. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
  31. package/lib/mjs/components/_classes/multivalue/Multivalue.js +12 -10
  32. package/lib/mjs/components/day/Day.d.ts +0 -1
  33. package/lib/mjs/components/editgrid/fixtures/index.d.ts +7 -7
  34. package/lib/mjs/components/editgrid/fixtures/index.js +1 -1
  35. package/lib/mjs/components/select/Select.js +1 -1
  36. package/lib/mjs/components/select/fixtures/comp25.d.ts +43 -28
  37. package/lib/mjs/components/select/fixtures/comp25.js +56 -49
  38. package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
  39. package/lib/mjs/components/select/fixtures/comp26.js +57 -0
  40. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  41. package/lib/mjs/components/select/fixtures/index.js +2 -1
  42. package/package.json +2 -2
@@ -4,37 +4,39 @@ export default class Multivalue extends Field {
4
4
  /**
5
5
  * Normalize values coming into updateValue.
6
6
  * @param {*} value - The value to normalize before setting.
7
+ * @param {Object} flags - Flags to use when normalizing the value.
8
+ * @param {*} emptyValue - The empty value for the field.
7
9
  * @returns {*} - The normalized value.
8
10
  */
9
- normalizeValue(value) {
11
+ normalizeValue(value, flags = {}, emptyValue = this.emptyValue) {
10
12
  if (this.component.multiple) {
11
13
  if (Array.isArray(value)) {
12
14
  if (value.length === 0) {
13
- return [this.emptyValue];
15
+ return [emptyValue];
14
16
  }
15
17
  if (this.component.storeas === 'array') {
16
- return super.normalizeValue([value]);
18
+ return super.normalizeValue([value], flags);
17
19
  }
18
- return super.normalizeValue(value);
20
+ return super.normalizeValue(value, flags);
19
21
  }
20
22
  else {
21
- return super.normalizeValue(value == null ? [this.emptyValue] : [value]);
23
+ return super.normalizeValue(value == null ? [emptyValue] : [value], flags);
22
24
  }
23
25
  }
24
26
  else {
25
- if (Array.isArray(value) && this.component.storeas !== 'array') {
27
+ if (Array.isArray(value) && !Array.isArray(emptyValue)) {
26
28
  if (this.component.storeas === 'string') {
27
- return super.normalizeValue(value.join(this.delimiter || ''));
29
+ return super.normalizeValue(value.join(this.delimiter || ''), flags);
28
30
  }
29
- return super.normalizeValue(value[0] || this.emptyValue);
31
+ return super.normalizeValue(value[0] || emptyValue, flags);
30
32
  }
31
33
  else {
32
- return super.normalizeValue(value);
34
+ return super.normalizeValue(value, flags);
33
35
  }
34
36
  }
35
37
  }
36
38
  get dataValue() {
37
- return super.dataValue;
39
+ return this.normalizeValue(super.dataValue);
38
40
  }
39
41
  set dataValue(value) {
40
42
  super.dataValue = value;
@@ -130,7 +130,6 @@ export default class DayComponent extends Field {
130
130
  * @returns {string|null} - The string value of the date.
131
131
  */
132
132
  getValueAsString(value: any): string | null;
133
- focus(field: any): void;
134
133
  isPartialDay(value: any): boolean;
135
134
  getValidationFormat(): string;
136
135
  }
@@ -1,22 +1,22 @@
1
1
  import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
- import comp10 from './comp10';
5
- import comp11 from './comp11';
6
- import comp12 from './comp12';
7
- import comp13 from './comp13';
8
- import comp14 from './comp14';
9
- import comp15 from './comp15';
10
4
  import comp4 from './comp4';
11
5
  import comp5 from './comp5';
12
6
  import comp6 from './comp6';
13
7
  import comp7 from './comp7';
14
8
  import comp8 from './comp8';
15
9
  import comp9 from './comp9';
10
+ import comp10 from './comp10';
11
+ import comp11 from './comp11';
12
+ import comp12 from './comp12';
13
+ import comp13 from './comp13';
14
+ import comp14 from './comp14';
15
+ import comp15 from './comp15';
16
16
  import comp16 from './comp16';
17
17
  import comp17 from './comp17';
18
18
  import compOpenWhenEmpty from './comp-openWhenEmpty';
19
19
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
20
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
21
21
  import compTestEvents from './comp-test-events';
22
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
22
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -19,4 +19,4 @@ import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenE
19
19
  import compOpenWhenEmpty from './comp-openWhenEmpty';
20
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
21
21
  import compTestEvents from './comp-test-events';
22
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
22
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -1593,8 +1593,8 @@ export default class SelectComponent extends ListComponent {
1593
1593
  super.detach();
1594
1594
  }
1595
1595
  focus() {
1596
+ super.focus.call(this);
1596
1597
  if (this.focusableElement) {
1597
- super.focus.call(this);
1598
1598
  this.focusableElement.focus();
1599
1599
  }
1600
1600
  }
@@ -1,44 +1,59 @@
1
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
2
  let components: ({
8
3
  label: string;
9
- widget: string;
10
4
  tableView: boolean;
11
- data: {
12
- values: {
13
- label: string;
14
- value: string;
15
- }[];
16
- };
17
- dataType: string;
5
+ modal: boolean;
6
+ rowDrafts: boolean;
18
7
  key: string;
19
8
  type: string;
9
+ displayAsTable: boolean;
20
10
  input: boolean;
21
- applyMaskOn?: undefined;
22
- conditional?: undefined;
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;
23
45
  } | {
24
46
  label: string;
25
- applyMaskOn: string;
47
+ showValidations: boolean;
26
48
  tableView: boolean;
27
49
  key: string;
28
50
  type: string;
29
51
  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;
52
+ saveOnEnter: boolean;
53
+ modal?: undefined;
54
+ rowDrafts?: undefined;
55
+ displayAsTable?: undefined;
56
+ components?: undefined;
42
57
  })[];
43
58
  }
44
59
  export default _default;
@@ -1,57 +1,64 @@
1
1
  export default {
2
- title: 'FIO-8072',
3
- name: 'fio8072',
4
- path: 'fio8072',
5
- type: 'form',
6
- display: 'form',
7
- components: [
2
+ "components": [
8
3
  {
9
- label: 'Select',
10
- widget: 'choicesjs',
11
- tableView: true,
12
- data: {
13
- values: [
14
- {
15
- label: 'A',
16
- value: '1',
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
+ ]
17
32
  },
18
- {
19
- label: 'B',
20
- value: '2',
33
+ "validate": {
34
+ "required": true
21
35
  },
22
- {
23
- label: 'C',
24
- value: '10',
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
25
46
  },
26
- {
27
- label: 'D',
28
- value: '1d',
29
- },
30
- ],
31
- },
32
- dataType: 'number',
33
- key: 'select',
34
- type: 'select',
35
- input: true,
47
+ "validateWhenHidden": false,
48
+ "key": "textField",
49
+ "type": "textfield",
50
+ "input": true
51
+ }
52
+ ]
36
53
  },
37
54
  {
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
- ],
55
+ "label": "Submit",
56
+ "showValidations": false,
57
+ "tableView": false,
58
+ "key": "submit",
59
+ "type": "button",
60
+ "input": true,
61
+ "saveOnEnter": false
62
+ }
63
+ ]
57
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
+ };
@@ -22,5 +22,6 @@ import comp22 from './comp22';
22
22
  import comp23 from './comp23';
23
23
  import comp24 from './comp24';
24
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
+ 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 };
26
27
  export { multiSelect, multiSelectOptions } from "./comp3";
@@ -23,4 +23,5 @@ import comp22 from './comp22';
23
23
  import comp23 from './comp23';
24
24
  import comp24 from './comp24';
25
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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5794.12ca15f",
3
+ "version": "5.0.0-dev.5798.beb3cc0",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@formio/bootstrap": "3.0.0-dev.98.17ba6ea",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.1.0-dev.105.1bff2e6",
84
+ "@formio/core": "2.1.0-dev.145.4491833",
85
85
  "@formio/text-mask-addons": "^3.8.0-formio.2",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",