@formio/js 5.0.0-dev.5767.890ab86 → 5.0.0-dev.5768.bc1b46b

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.
@@ -436,7 +436,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
436
436
  }
437
437
  removeRow(index) {
438
438
  const makeEmpty = index === 0 && this.rows.length === 1;
439
- const flags = { isReordered: !makeEmpty, resetValue: makeEmpty };
439
+ const flags = { isReordered: !makeEmpty, resetValue: makeEmpty, modified: true };
440
440
  this.splice(index, flags);
441
441
  this.emit('dataGridDeleteRow', { index });
442
442
  const [row] = this.rows.splice(index, 1);
@@ -8,10 +8,26 @@ export default class RadioComponent extends ListComponent {
8
8
  schema: any;
9
9
  };
10
10
  static get conditionOperatorsSettings(): {
11
- valueComponent(classComp: any): any;
11
+ valueComponent(classComp: any): {
12
+ type: string;
13
+ dataSrc: string;
14
+ valueProperty: string;
15
+ dataType: any;
16
+ data: {
17
+ custom(): any;
18
+ };
19
+ };
12
20
  };
13
21
  static get serverConditionSettings(): {
14
- valueComponent(classComp: any): any;
22
+ valueComponent(classComp: any): {
23
+ type: string;
24
+ dataSrc: string;
25
+ valueProperty: string;
26
+ dataType: any;
27
+ data: {
28
+ custom: string;
29
+ };
30
+ };
15
31
  };
16
32
  static savedValueTypes(schema: any): any[];
17
33
  constructor(component: any, options: any, data: any);
@@ -33,22 +33,31 @@ class RadioComponent extends ListComponent_1.default {
33
33
  }
34
34
  static get conditionOperatorsSettings() {
35
35
  return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
36
- const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';
37
- return isValuesSrc
38
- ? {
39
- type: 'select',
40
- dataSrc: 'custom',
41
- valueProperty: 'value',
42
- dataType: classComp.dataType || '',
43
- data: {
44
- custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,
36
+ return {
37
+ type: 'select',
38
+ dataSrc: 'custom',
39
+ valueProperty: 'value',
40
+ dataType: classComp.dataType || '',
41
+ data: {
42
+ custom() {
43
+ return classComp.values;
45
44
  }
46
- }
47
- : Object.assign(Object.assign({}, classComp), { type: 'select' });
45
+ },
46
+ };
48
47
  } });
49
48
  }
50
49
  static get serverConditionSettings() {
51
- return RadioComponent.conditionOperatorsSettings;
50
+ return Object.assign(Object.assign({}, super.serverConditionSettings), { 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
+ } });
52
61
  }
53
62
  static savedValueTypes(schema) {
54
63
  const { boolean, string, number, object, array } = utils_1.componentValueTypes;
@@ -1,4 +1,26 @@
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
+ };
2
24
  static savedValueTypes(schema: any): string[];
3
25
  constructor(...args: any[]);
4
26
  get emptyValue(): any;
@@ -30,18 +30,15 @@ class SelectBoxesComponent extends Radio_1.default {
30
30
  }
31
31
  static get conditionOperatorsSettings() {
32
32
  return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
33
- const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';
34
- return isValuesSrc
35
- ? {
36
- type: 'select',
37
- dataSrc: 'custom',
38
- valueProperty: 'value',
39
- dataType: 'string',
40
- data: {
41
- custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`
42
- },
43
- }
44
- : Object.assign(Object.assign({}, classComp), { dataType: 'string', type: 'select' });
33
+ return {
34
+ type: 'select',
35
+ dataSrc: 'custom',
36
+ valueProperty: 'value',
37
+ dataType: 'string',
38
+ data: {
39
+ custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`
40
+ },
41
+ };
45
42
  } });
46
43
  }
47
44
  static savedValueTypes(schema) {
@@ -432,7 +432,7 @@ export default class DataGridComponent extends NestedArrayComponent {
432
432
  }
433
433
  removeRow(index) {
434
434
  const makeEmpty = index === 0 && this.rows.length === 1;
435
- const flags = { isReordered: !makeEmpty, resetValue: makeEmpty };
435
+ const flags = { isReordered: !makeEmpty, resetValue: makeEmpty, modified: true };
436
436
  this.splice(index, flags);
437
437
  this.emit('dataGridDeleteRow', { index });
438
438
  const [row] = this.rows.splice(index, 1);
@@ -8,10 +8,26 @@ export default class RadioComponent extends ListComponent {
8
8
  schema: any;
9
9
  };
10
10
  static get conditionOperatorsSettings(): {
11
- valueComponent(classComp: any): any;
11
+ valueComponent(classComp: any): {
12
+ type: string;
13
+ dataSrc: string;
14
+ valueProperty: string;
15
+ dataType: any;
16
+ data: {
17
+ custom(): any;
18
+ };
19
+ };
12
20
  };
13
21
  static get serverConditionSettings(): {
14
- valueComponent(classComp: any): any;
22
+ valueComponent(classComp: any): {
23
+ type: string;
24
+ dataSrc: string;
25
+ valueProperty: string;
26
+ dataType: any;
27
+ data: {
28
+ custom: string;
29
+ };
30
+ };
15
31
  };
16
32
  static savedValueTypes(schema: any): any[];
17
33
  constructor(component: any, options: any, data: any);
@@ -30,26 +30,35 @@ export default class RadioComponent extends ListComponent {
30
30
  return {
31
31
  ...super.conditionOperatorsSettings,
32
32
  valueComponent(classComp) {
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) : []}`,
33
+ return {
34
+ type: 'select',
35
+ dataSrc: 'custom',
36
+ valueProperty: 'value',
37
+ dataType: classComp.dataType || '',
38
+ data: {
39
+ custom() {
40
+ return classComp.values;
42
41
  }
43
- }
44
- : {
45
- ...classComp,
46
- type: 'select',
47
- };
42
+ },
43
+ };
48
44
  }
49
45
  };
50
46
  }
51
47
  static get serverConditionSettings() {
52
- return RadioComponent.conditionOperatorsSettings;
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
+ };
53
62
  }
54
63
  static savedValueTypes(schema) {
55
64
  const { boolean, string, number, object, array } = componentValueTypes;
@@ -1,4 +1,26 @@
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
+ };
2
24
  static savedValueTypes(schema: any): string[];
3
25
  constructor(...args: any[]);
4
26
  get emptyValue(): any;
@@ -27,22 +27,15 @@ export default class SelectBoxesComponent extends RadioComponent {
27
27
  return {
28
28
  ...super.conditionOperatorsSettings,
29
29
  valueComponent(classComp) {
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
- };
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
+ };
46
39
  }
47
40
  };
48
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5767.890ab86",
3
+ "version": "5.0.0-dev.5768.bc1b46b",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {