@formio/js 5.0.0-dev.5770.0748fdc → 5.0.0-dev.5777.4ccabb1

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 (36) hide show
  1. package/Changelog.md +7 -0
  2. package/dist/formio.form.js +9 -9
  3. package/dist/formio.form.min.js +1 -1
  4. package/dist/formio.full.js +10 -10
  5. package/dist/formio.full.min.js +1 -1
  6. package/lib/cjs/PDFBuilder.js +2 -1
  7. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
  8. package/lib/cjs/components/_classes/multivalue/Multivalue.js +43 -25
  9. package/lib/cjs/components/datagrid/DataGrid.js +1 -1
  10. package/lib/cjs/components/day/Day.d.ts +1 -1
  11. package/lib/cjs/components/day/Day.js +28 -7
  12. package/lib/cjs/components/radio/Radio.d.ts +2 -18
  13. package/lib/cjs/components/radio/Radio.js +22 -21
  14. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  15. package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
  16. package/lib/cjs/components/select/Select.js +2 -2
  17. package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  18. package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
  19. package/lib/cjs/components/tags/Tags.js +3 -3
  20. package/lib/cjs/components/time/Time.js +0 -5
  21. package/lib/mjs/PDFBuilder.js +1 -1
  22. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
  23. package/lib/mjs/components/_classes/multivalue/Multivalue.js +43 -25
  24. package/lib/mjs/components/datagrid/DataGrid.js +1 -1
  25. package/lib/mjs/components/day/Day.d.ts +1 -1
  26. package/lib/mjs/components/day/Day.js +27 -7
  27. package/lib/mjs/components/radio/Radio.d.ts +2 -18
  28. package/lib/mjs/components/radio/Radio.js +25 -24
  29. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
  30. package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
  31. package/lib/mjs/components/select/Select.js +2 -2
  32. package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
  33. package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
  34. package/lib/mjs/components/tags/Tags.js +3 -3
  35. package/lib/mjs/components/time/Time.js +0 -11
  36. package/package.json +1 -1
@@ -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.
@@ -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) {
@@ -538,13 +538,13 @@ export default class SelectComponent extends ListComponent {
538
538
  skip,
539
539
  };
540
540
  // Allow for url interpolation.
541
- url = this.interpolate(url, {
541
+ url = this.sanitize(this.interpolate(url, {
542
542
  formioBase: Formio.getBaseUrl(),
543
543
  search,
544
544
  limit,
545
545
  skip,
546
546
  page: Math.abs(Math.floor(skip / limit))
547
- });
547
+ }), this.shouldSanitizeValue);
548
548
  // Add search capability.
549
549
  if (this.component.searchField && search) {
550
550
  const searchValue = Array.isArray(search)
@@ -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
  }
@@ -116,12 +116,12 @@ export default class TagsComponent extends Input {
116
116
  }
117
117
  normalizeValue(value) {
118
118
  if (this.component.storeas === 'string' && Array.isArray(value)) {
119
- return value.join(this.delimiter);
119
+ return super.normalizeValue(value.join(this.delimiter));
120
120
  }
121
121
  else if (this.component.storeas === 'array' && typeof value === 'string') {
122
- return value.split(this.delimiter).filter(result => result);
122
+ return super.normalizeValue(value.split(this.delimiter).filter(result => result));
123
123
  }
124
- return value;
124
+ return super.normalizeValue(value);
125
125
  }
126
126
  setValue(value, flags = {}) {
127
127
  const changed = super.setValue(value, flags);
@@ -13,17 +13,6 @@ export default class TimeComponent extends TextFieldComponent {
13
13
  dataFormat: defaultDataFormat,
14
14
  }, ...extend);
15
15
  }
16
- static get serverConditionSettings() {
17
- return {
18
- ...super.serverConditionSettings,
19
- valueComponent(classComp) {
20
- return {
21
- ...classComp,
22
- type: 'time',
23
- };
24
- },
25
- };
26
- }
27
16
  constructor(component, options, data) {
28
17
  super(component, options, data);
29
18
  const { edge: isEdgeBrowser, version: edgeVersion } = getBrowserInfo();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5770.0748fdc",
3
+ "version": "5.0.0-dev.5777.4ccabb1",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {