@formio/js 5.0.0-dev.5620.dedc19b → 5.0.0-dev.5625.779293f

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 (74) hide show
  1. package/Changelog.md +5 -0
  2. package/dist/formio.builder.css +0 -4
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.form.css +0 -4
  5. package/dist/formio.form.js +54 -42
  6. package/dist/formio.form.min.css +1 -1
  7. package/dist/formio.form.min.js +1 -1
  8. package/dist/formio.full.css +0 -4
  9. package/dist/formio.full.js +58 -46
  10. package/dist/formio.full.min.css +1 -1
  11. package/dist/formio.full.min.js +1 -1
  12. package/dist/formio.js +2 -2
  13. package/dist/formio.min.js +1 -1
  14. package/dist/formio.utils.js +2 -2
  15. package/dist/formio.utils.min.js +1 -1
  16. package/lib/cjs/Formio.js +11 -0
  17. package/lib/cjs/Webform.d.ts +1 -1
  18. package/lib/cjs/Webform.js +14 -9
  19. package/lib/cjs/WebformBuilder.d.ts +1 -1
  20. package/lib/cjs/WebformBuilder.js +20 -19
  21. package/lib/cjs/components/_classes/component/Component.d.ts +5 -3
  22. package/lib/cjs/components/_classes/component/Component.js +2 -6
  23. package/lib/cjs/components/button/Button.d.ts +1 -1
  24. package/lib/cjs/components/button/Button.js +7 -7
  25. package/lib/cjs/components/form/Form.js +3 -2
  26. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -8
  27. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
  28. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +2 -2
  29. package/lib/cjs/components/recaptcha/ReCaptcha.js +1 -8
  30. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +28 -2
  31. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +10 -2
  32. package/lib/cjs/components/select/Select.js +1 -1
  33. package/lib/cjs/components/select/editForm/Select.edit.data.js +16 -2
  34. package/lib/cjs/components/select/fixtures/comp22.js +1 -1
  35. package/lib/cjs/components/select/fixtures/comp23.d.ts +26 -15
  36. package/lib/cjs/components/select/fixtures/comp23.js +28 -19
  37. package/lib/cjs/components/select/fixtures/comp24.d.ts +47 -0
  38. package/lib/cjs/components/select/fixtures/comp24.js +40 -0
  39. package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
  40. package/lib/cjs/components/select/fixtures/index.js +3 -1
  41. package/lib/cjs/translations/en.d.ts +1 -0
  42. package/lib/cjs/translations/en.js +1 -0
  43. package/lib/cjs/utils/utils.d.ts +6 -0
  44. package/lib/cjs/utils/utils.js +15 -4
  45. package/lib/mjs/Formio.js +11 -0
  46. package/lib/mjs/Webform.d.ts +1 -1
  47. package/lib/mjs/Webform.js +15 -10
  48. package/lib/mjs/WebformBuilder.d.ts +1 -1
  49. package/lib/mjs/WebformBuilder.js +20 -18
  50. package/lib/mjs/components/_classes/component/Component.d.ts +5 -3
  51. package/lib/mjs/components/_classes/component/Component.js +2 -6
  52. package/lib/mjs/components/button/Button.d.ts +1 -1
  53. package/lib/mjs/components/button/Button.js +7 -7
  54. package/lib/mjs/components/form/Form.js +3 -2
  55. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -8
  56. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
  57. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +2 -2
  58. package/lib/mjs/components/recaptcha/ReCaptcha.js +1 -8
  59. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +28 -2
  60. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +10 -2
  61. package/lib/mjs/components/select/Select.js +2 -2
  62. package/lib/mjs/components/select/editForm/Select.edit.data.js +16 -2
  63. package/lib/mjs/components/select/fixtures/comp22.js +1 -1
  64. package/lib/mjs/components/select/fixtures/comp23.d.ts +26 -15
  65. package/lib/mjs/components/select/fixtures/comp23.js +28 -19
  66. package/lib/mjs/components/select/fixtures/comp24.d.ts +47 -0
  67. package/lib/mjs/components/select/fixtures/comp24.js +38 -0
  68. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  69. package/lib/mjs/components/select/fixtures/index.js +2 -1
  70. package/lib/mjs/translations/en.d.ts +1 -0
  71. package/lib/mjs/translations/en.js +1 -0
  72. package/lib/mjs/utils/utils.d.ts +6 -0
  73. package/lib/mjs/utils/utils.js +12 -2
  74. package/package.json +2 -2
@@ -10,20 +10,30 @@ declare namespace _default {
10
10
  tableView: boolean;
11
11
  dataSrc: string;
12
12
  data: {
13
- resource: string;
14
- };
15
- template: string;
16
- validate: {
17
- select: boolean;
13
+ url: string;
14
+ headers: {
15
+ key: string;
16
+ value: string;
17
+ }[];
18
18
  };
19
+ multiple: boolean;
20
+ valueProperty: string;
21
+ validateWhenHidden: boolean;
19
22
  key: string;
20
23
  type: string;
21
- searchField: string;
22
24
  input: boolean;
25
+ defaultValue: string[];
26
+ selectValues: string;
27
+ disableLimit: boolean;
23
28
  noRefreshOnScroll: boolean;
24
- addResource: boolean;
25
- reference: boolean;
26
- valueProperty: string;
29
+ selectData: {
30
+ value1: {
31
+ label: string;
32
+ };
33
+ value3: {
34
+ label: string;
35
+ };
36
+ };
27
37
  disableOnInvalid?: undefined;
28
38
  } | {
29
39
  type: string;
@@ -35,13 +45,14 @@ declare namespace _default {
35
45
  widget?: undefined;
36
46
  dataSrc?: undefined;
37
47
  data?: undefined;
38
- template?: undefined;
39
- validate?: undefined;
40
- searchField?: undefined;
41
- noRefreshOnScroll?: undefined;
42
- addResource?: undefined;
43
- reference?: undefined;
48
+ multiple?: undefined;
44
49
  valueProperty?: undefined;
50
+ validateWhenHidden?: undefined;
51
+ defaultValue?: undefined;
52
+ selectValues?: undefined;
53
+ disableLimit?: undefined;
54
+ noRefreshOnScroll?: undefined;
55
+ selectData?: undefined;
45
56
  })[];
46
57
  }
47
58
  export default _default;
@@ -1,38 +1,47 @@
1
1
  export default {
2
- title: 'FIO-8234',
3
- name: 'fio8234',
4
- path: 'fio8234',
2
+ title: 'FIO-8281',
3
+ name: 'fio8281',
4
+ path: 'fio8281',
5
5
  type: 'form',
6
6
  display: 'form',
7
- components: [
8
- {
7
+ components: [{
9
8
  label: 'Select',
10
9
  widget: 'choicesjs',
11
10
  tableView: true,
12
- dataSrc: 'resource',
11
+ dataSrc: 'url',
13
12
  data: {
14
- resource: '665446284c9b0163c3e0c7e6',
15
- },
16
- template: '<span>{{ item.data.textField1 }}</span>',
17
- validate: {
18
- select: false,
13
+ url: 'https://fake_url.com',
14
+ headers: [
15
+ {
16
+ key: '',
17
+ value: ''
18
+ },
19
+ ],
19
20
  },
21
+ multiple: true,
22
+ valueProperty: 'value',
23
+ validateWhenHidden: false,
20
24
  key: 'select',
21
25
  type: 'select',
22
- searchField: 'data.textField2__regex',
23
26
  input: true,
27
+ defaultValue: ['value1', 'value3'],
28
+ selectValues: 'data',
29
+ disableLimit: false,
24
30
  noRefreshOnScroll: false,
25
- addResource: false,
26
- reference: false,
27
- valueProperty: 'data.textField2',
28
- },
29
- {
31
+ selectData: {
32
+ value1: {
33
+ label: 'Label 1',
34
+ },
35
+ value3: {
36
+ label: 'Label 3',
37
+ },
38
+ },
39
+ }, {
30
40
  type: 'button',
31
41
  label: 'Submit',
32
42
  key: 'submit',
33
43
  disableOnInvalid: true,
34
44
  input: true,
35
45
  tableView: false,
36
- },
37
- ],
46
+ }]
38
47
  };
@@ -0,0 +1,47 @@
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
+ dataSrc: string;
12
+ data: {
13
+ resource: string;
14
+ };
15
+ template: string;
16
+ validate: {
17
+ select: boolean;
18
+ };
19
+ key: string;
20
+ type: string;
21
+ searchField: string;
22
+ input: boolean;
23
+ noRefreshOnScroll: boolean;
24
+ addResource: boolean;
25
+ reference: boolean;
26
+ valueProperty: string;
27
+ disableOnInvalid?: undefined;
28
+ } | {
29
+ type: string;
30
+ label: string;
31
+ key: string;
32
+ disableOnInvalid: boolean;
33
+ input: boolean;
34
+ tableView: boolean;
35
+ widget?: undefined;
36
+ dataSrc?: undefined;
37
+ data?: undefined;
38
+ template?: undefined;
39
+ validate?: undefined;
40
+ searchField?: undefined;
41
+ noRefreshOnScroll?: undefined;
42
+ addResource?: undefined;
43
+ reference?: undefined;
44
+ valueProperty?: undefined;
45
+ })[];
46
+ }
47
+ export default _default;
@@ -0,0 +1,38 @@
1
+ export default {
2
+ title: 'FIO-8234',
3
+ name: 'fio8234',
4
+ path: 'fio8234',
5
+ type: 'form',
6
+ display: 'form',
7
+ components: [
8
+ {
9
+ label: 'Select',
10
+ widget: 'choicesjs',
11
+ tableView: true,
12
+ dataSrc: 'resource',
13
+ data: {
14
+ resource: '665446284c9b0163c3e0c7e6',
15
+ },
16
+ template: '<span>{{ item.data.textField1 }}</span>',
17
+ validate: {
18
+ select: false,
19
+ },
20
+ key: 'select',
21
+ type: 'select',
22
+ searchField: 'data.textField2__regex',
23
+ input: true,
24
+ noRefreshOnScroll: false,
25
+ addResource: false,
26
+ reference: false,
27
+ valueProperty: 'data.textField2',
28
+ },
29
+ {
30
+ type: 'button',
31
+ label: 'Submit',
32
+ key: 'submit',
33
+ disableOnInvalid: true,
34
+ input: true,
35
+ tableView: false,
36
+ },
37
+ ],
38
+ };
@@ -20,5 +20,6 @@ import comp20 from './comp20';
20
20
  import comp21 from './comp21';
21
21
  import comp22 from './comp22';
22
22
  import comp23 from './comp23';
23
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23 };
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
25
  export { multiSelect, multiSelectOptions } from "./comp3";
@@ -21,4 +21,5 @@ import comp20 from './comp20';
21
21
  import comp21 from './comp21';
22
22
  import comp22 from './comp22';
23
23
  import comp23 from './comp23';
24
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23 };
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 };
@@ -71,5 +71,6 @@ declare namespace _default {
71
71
  let submitButtonAriaLabel: string;
72
72
  let reCaptchaTokenValidationError: string;
73
73
  let reCaptchaTokenNotSpecifiedError: string;
74
+ let apiKey: string;
74
75
  }
75
76
  export default _default;
@@ -71,4 +71,5 @@ export default {
71
71
  submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
72
72
  reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
73
73
  reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
74
+ apiKey: 'API Key is not unique: {{key}}'
74
75
  };
@@ -107,6 +107,12 @@ export function checkCondition(component: any, row: any, data: any, form: any, i
107
107
  */
108
108
  export function checkTrigger(component: any, trigger: any, row: any, data: any, form: any, instance: any): mixed;
109
109
  export function setActionProperty(component: any, action: any, result: any, row: any, data: any, instance: any): any;
110
+ /**
111
+ * Removes HTML tags from string e.g. <div>Hello World</div> => Hello World
112
+ * @param {string} str
113
+ * @returns {string}
114
+ */
115
+ export function removeHTML(str: string): string;
110
116
  /**
111
117
  * Unescape HTML characters like &lt, &gt, &amp and etc.
112
118
  * @param str
@@ -395,6 +395,15 @@ export function setActionProperty(component, action, result, row, data, instance
395
395
  }
396
396
  return component;
397
397
  }
398
+ /**
399
+ * Removes HTML tags from string e.g. <div>Hello World</div> => Hello World
400
+ * @param {string} str
401
+ * @returns {string}
402
+ */
403
+ export function removeHTML(str) {
404
+ const doc = new window.DOMParser().parseFromString(str, 'text/html');
405
+ return (doc.body.textContent || '').trim();
406
+ }
398
407
  /**
399
408
  * Unescape HTML characters like &lt, &gt, &amp and etc.
400
409
  * @param str
@@ -404,8 +413,9 @@ export function unescapeHTML(str) {
404
413
  if (typeof window === 'undefined' || !('DOMParser' in window)) {
405
414
  return str;
406
415
  }
407
- const doc = new window.DOMParser().parseFromString(str, 'text/html');
408
- return doc.documentElement.textContent;
416
+ const elem = document.createElement('textarea');
417
+ elem.innerHTML = str;
418
+ return elem.value;
409
419
  }
410
420
  /**
411
421
  * Make HTML element from string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5620.dedc19b",
3
+ "version": "5.0.0-dev.5625.779293f",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -77,7 +77,7 @@
77
77
  "dependencies": {
78
78
  "@formio/bootstrap": "^3.0.0-rc.22",
79
79
  "@formio/choices.js": "^10.2.1",
80
- "@formio/core": "^2.1.0-dev.tt.2",
80
+ "@formio/core": "2.0.0-dev.102.df37631",
81
81
  "@formio/text-mask-addons": "^3.8.0-formio.2",
82
82
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
83
83
  "abortcontroller-polyfill": "^1.7.5",