@formio/js 5.0.0-dev.5705.fda3511 → 5.0.0-dev.5708.6c19568

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.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const NestedArrayComponent_1 = __importDefault(require("../_classes/nestedarray/NestedArrayComponent"));
8
8
  const utils_1 = require("../../utils/utils");
9
- const Components_1 = __importDefault(require("../Components"));
9
+ const Components_1 = require("../Components");
10
10
  const dragula_1 = __importDefault(require("dragula"));
11
11
  class DataGridComponent extends NestedArrayComponent_1.default {
12
12
  static schema(...extend) {
@@ -422,7 +422,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
422
422
  }
423
423
  component.rowIndex = rowIndex;
424
424
  component.row = `${rowIndex}-${colIndex}`;
425
- component.path = Components_1.default.getComponentPath(component);
425
+ component.path = Components_1.Components.getComponentPath(component);
426
426
  });
427
427
  }
428
428
  updateRowsComponents(rowIndex) {
@@ -8,7 +8,7 @@ const DataGrid_1 = __importDefault(require("../datagrid/DataGrid"));
8
8
  const lodash_1 = __importDefault(require("lodash"));
9
9
  const eventemitter3_1 = __importDefault(require("eventemitter3"));
10
10
  const utils_1 = require("../../utils/utils");
11
- const Components_1 = __importDefault(require("../Components"));
11
+ const Components_1 = require("../Components");
12
12
  class DataMapComponent extends DataGrid_1.default {
13
13
  static schema(...extend) {
14
14
  return Component_1.default.schema({
@@ -241,7 +241,7 @@ class DataMapComponent extends DataGrid_1.default {
241
241
  delete dataValue[key];
242
242
  const comp = components[this.valueKey];
243
243
  comp.component.key = newKey;
244
- comp.path = Components_1.default.calculateComponentPath(comp);
244
+ comp.path = Components_1.Components.calculateComponentPath(comp);
245
245
  key = newKey;
246
246
  });
247
247
  const valueComponent = lodash_1.default.clone(this.component.valueComponent);
@@ -1101,7 +1101,8 @@ class EditGridComponent extends NestedArrayComponent_1.default {
1101
1101
  return false;
1102
1102
  }
1103
1103
  else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {
1104
- this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
1104
+ this._errors = this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
1105
+ errors.push(...this._errors);
1105
1106
  return false;
1106
1107
  }
1107
1108
  const message = this.invalid || this.invalidMessage(data, dirty, false, row);
@@ -0,0 +1,52 @@
1
+ declare namespace _default {
2
+ let type: string;
3
+ let display: string;
4
+ let components: ({
5
+ title: string;
6
+ breadcrumbClickable: boolean;
7
+ buttonSettings: {
8
+ previous: boolean;
9
+ cancel: boolean;
10
+ next: boolean;
11
+ };
12
+ collapsible: boolean;
13
+ tableView: boolean;
14
+ key: string;
15
+ type: string;
16
+ label: string;
17
+ input: boolean;
18
+ components: {
19
+ label: string;
20
+ tableView: boolean;
21
+ rowDrafts: boolean;
22
+ key: string;
23
+ type: string;
24
+ input: boolean;
25
+ components: {
26
+ label: string;
27
+ tableView: boolean;
28
+ key: string;
29
+ type: string;
30
+ input: boolean;
31
+ alwaysEnabled: boolean;
32
+ }[];
33
+ alwaysEnabled: boolean;
34
+ }[];
35
+ alwaysEnabled: boolean;
36
+ showValidations?: undefined;
37
+ } | {
38
+ label: string;
39
+ showValidations: boolean;
40
+ alwaysEnabled: boolean;
41
+ tableView: boolean;
42
+ key: string;
43
+ type: string;
44
+ input: boolean;
45
+ title?: undefined;
46
+ breadcrumbClickable?: undefined;
47
+ buttonSettings?: undefined;
48
+ collapsible?: undefined;
49
+ components?: undefined;
50
+ })[];
51
+ }
52
+ export default _default;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ type: 'form',
5
+ display: 'wizard',
6
+ components: [
7
+ {
8
+ title: 'Page 1',
9
+ breadcrumbClickable: true,
10
+ buttonSettings: {
11
+ previous: true,
12
+ cancel: true,
13
+ next: true
14
+ },
15
+ collapsible: false,
16
+ tableView: false,
17
+ key: 'page3',
18
+ type: 'panel',
19
+ label: 'Page 2',
20
+ input: false,
21
+ components: [
22
+ {
23
+ label: 'Edit Grid',
24
+ tableView: true,
25
+ rowDrafts: false,
26
+ key: 'editGrid',
27
+ type: 'editgrid',
28
+ input: true,
29
+ components: [
30
+ {
31
+ label: 'Text Field',
32
+ tableView: true,
33
+ key: 'textField',
34
+ type: 'textfield',
35
+ input: true,
36
+ alwaysEnabled: false
37
+ }
38
+ ],
39
+ alwaysEnabled: false
40
+ }
41
+ ],
42
+ alwaysEnabled: false
43
+ },
44
+ {
45
+ title: 'Page 2',
46
+ breadcrumbClickable: true,
47
+ buttonSettings: {
48
+ previous: true,
49
+ cancel: true,
50
+ next: true
51
+ },
52
+ collapsible: false,
53
+ tableView: false,
54
+ key: 'page2',
55
+ type: 'panel',
56
+ label: 'Page 1',
57
+ input: false,
58
+ alwaysEnabled: false,
59
+ components: []
60
+ },
61
+ {
62
+ label: 'Submit',
63
+ showValidations: false,
64
+ alwaysEnabled: false,
65
+ tableView: false,
66
+ key: 'submit',
67
+ type: 'button',
68
+ input: true
69
+ }
70
+ ]
71
+ };
@@ -13,8 +13,9 @@ import comp6 from './comp6';
13
13
  import comp7 from './comp7';
14
14
  import comp8 from './comp8';
15
15
  import comp9 from './comp9';
16
+ import comp16 from './comp16';
16
17
  import compOpenWhenEmpty from './comp-openWhenEmpty';
17
18
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
18
19
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
19
20
  import compTestEvents from './comp-test-events';
20
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
21
+ export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -3,7 +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
- exports.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
6
+ exports.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp16 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
7
7
  const comp1_1 = __importDefault(require("./comp1"));
8
8
  exports.comp1 = comp1_1.default;
9
9
  const comp2_1 = __importDefault(require("./comp2"));
@@ -34,6 +34,8 @@ const comp14_1 = __importDefault(require("./comp14"));
34
34
  exports.comp14 = comp14_1.default;
35
35
  const comp15_1 = __importDefault(require("./comp15"));
36
36
  exports.comp15 = comp15_1.default;
37
+ const comp16_1 = __importDefault(require("./comp16"));
38
+ exports.comp16 = comp16_1.default;
37
39
  const comp_with_conditions_and_openWhenEmpty_1 = __importDefault(require("./comp-with-conditions-and-openWhenEmpty"));
38
40
  exports.withOpenWhenEmptyAndConditions = comp_with_conditions_and_openWhenEmpty_1.default;
39
41
  const comp_openWhenEmpty_1 = __importDefault(require("./comp-openWhenEmpty"));
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
3
3
  import { fastCloneDeep, getFocusableElements } from '../../utils/utils';
4
- import Components from '../Components';
4
+ import { Components } from '../Components';
5
5
  import dragula from 'dragula';
6
6
  export default class DataGridComponent extends NestedArrayComponent {
7
7
  static schema(...extend) {
@@ -3,7 +3,7 @@ import DataGridComponent from '../datagrid/DataGrid';
3
3
  import _ from 'lodash';
4
4
  import EventEmitter from 'eventemitter3';
5
5
  import { componentValueTypes, getComponentSavedTypes, uniqueKey } from '../../utils/utils';
6
- import Components from '../Components';
6
+ import { Components } from '../Components';
7
7
  export default class DataMapComponent extends DataGridComponent {
8
8
  static schema(...extend) {
9
9
  return Component.schema({
@@ -1089,7 +1089,8 @@ export default class EditGridComponent extends NestedArrayComponent {
1089
1089
  return false;
1090
1090
  }
1091
1091
  else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {
1092
- this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
1092
+ this._errors = this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);
1093
+ errors.push(...this._errors);
1093
1094
  return false;
1094
1095
  }
1095
1096
  const message = this.invalid || this.invalidMessage(data, dirty, false, row);
@@ -0,0 +1,52 @@
1
+ declare namespace _default {
2
+ let type: string;
3
+ let display: string;
4
+ let components: ({
5
+ title: string;
6
+ breadcrumbClickable: boolean;
7
+ buttonSettings: {
8
+ previous: boolean;
9
+ cancel: boolean;
10
+ next: boolean;
11
+ };
12
+ collapsible: boolean;
13
+ tableView: boolean;
14
+ key: string;
15
+ type: string;
16
+ label: string;
17
+ input: boolean;
18
+ components: {
19
+ label: string;
20
+ tableView: boolean;
21
+ rowDrafts: boolean;
22
+ key: string;
23
+ type: string;
24
+ input: boolean;
25
+ components: {
26
+ label: string;
27
+ tableView: boolean;
28
+ key: string;
29
+ type: string;
30
+ input: boolean;
31
+ alwaysEnabled: boolean;
32
+ }[];
33
+ alwaysEnabled: boolean;
34
+ }[];
35
+ alwaysEnabled: boolean;
36
+ showValidations?: undefined;
37
+ } | {
38
+ label: string;
39
+ showValidations: boolean;
40
+ alwaysEnabled: boolean;
41
+ tableView: boolean;
42
+ key: string;
43
+ type: string;
44
+ input: boolean;
45
+ title?: undefined;
46
+ breadcrumbClickable?: undefined;
47
+ buttonSettings?: undefined;
48
+ collapsible?: undefined;
49
+ components?: undefined;
50
+ })[];
51
+ }
52
+ export default _default;
@@ -0,0 +1,69 @@
1
+ export default {
2
+ type: 'form',
3
+ display: 'wizard',
4
+ components: [
5
+ {
6
+ title: 'Page 1',
7
+ breadcrumbClickable: true,
8
+ buttonSettings: {
9
+ previous: true,
10
+ cancel: true,
11
+ next: true
12
+ },
13
+ collapsible: false,
14
+ tableView: false,
15
+ key: 'page3',
16
+ type: 'panel',
17
+ label: 'Page 2',
18
+ input: false,
19
+ components: [
20
+ {
21
+ label: 'Edit Grid',
22
+ tableView: true,
23
+ rowDrafts: false,
24
+ key: 'editGrid',
25
+ type: 'editgrid',
26
+ input: true,
27
+ components: [
28
+ {
29
+ label: 'Text Field',
30
+ tableView: true,
31
+ key: 'textField',
32
+ type: 'textfield',
33
+ input: true,
34
+ alwaysEnabled: false
35
+ }
36
+ ],
37
+ alwaysEnabled: false
38
+ }
39
+ ],
40
+ alwaysEnabled: false
41
+ },
42
+ {
43
+ title: 'Page 2',
44
+ breadcrumbClickable: true,
45
+ buttonSettings: {
46
+ previous: true,
47
+ cancel: true,
48
+ next: true
49
+ },
50
+ collapsible: false,
51
+ tableView: false,
52
+ key: 'page2',
53
+ type: 'panel',
54
+ label: 'Page 1',
55
+ input: false,
56
+ alwaysEnabled: false,
57
+ components: []
58
+ },
59
+ {
60
+ label: 'Submit',
61
+ showValidations: false,
62
+ alwaysEnabled: false,
63
+ tableView: false,
64
+ key: 'submit',
65
+ type: 'button',
66
+ input: true
67
+ }
68
+ ]
69
+ };
@@ -13,8 +13,9 @@ import comp6 from './comp6';
13
13
  import comp7 from './comp7';
14
14
  import comp8 from './comp8';
15
15
  import comp9 from './comp9';
16
+ import comp16 from './comp16';
16
17
  import compOpenWhenEmpty from './comp-openWhenEmpty';
17
18
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
18
19
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
19
20
  import compTestEvents from './comp-test-events';
20
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
21
+ export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -13,8 +13,9 @@ import comp12 from './comp12';
13
13
  import comp13 from './comp13';
14
14
  import comp14 from './comp14';
15
15
  import comp15 from './comp15';
16
+ import comp16 from './comp16';
16
17
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
17
18
  import compOpenWhenEmpty from './comp-openWhenEmpty';
18
19
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
19
20
  import compTestEvents from './comp-test-events';
20
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
21
+ export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp4, comp5, comp6, comp7, comp8, comp9, comp16, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5705.fda3511",
3
+ "version": "5.0.0-dev.5708.6c19568",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {