@formio/js 5.0.0-rc.58 → 5.0.0-rc.59

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/dist/formio.builder.css +0 -4
  2. package/dist/formio.builder.min.css +1 -1
  3. package/dist/formio.embed.js +1 -1
  4. package/dist/formio.embed.min.js +1 -1
  5. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  6. package/dist/formio.form.css +0 -4
  7. package/dist/formio.form.js +26 -37
  8. package/dist/formio.form.min.css +1 -1
  9. package/dist/formio.form.min.js +1 -1
  10. package/dist/formio.form.min.js.LICENSE.txt +11 -3
  11. package/dist/formio.full.css +0 -4
  12. package/dist/formio.full.js +30 -41
  13. package/dist/formio.full.min.css +1 -1
  14. package/dist/formio.full.min.js +1 -1
  15. package/dist/formio.full.min.js.LICENSE.txt +11 -3
  16. package/dist/formio.js +3 -3
  17. package/dist/formio.min.js +1 -1
  18. package/dist/formio.min.js.LICENSE.txt +1 -1
  19. package/dist/formio.utils.js +15 -36
  20. package/dist/formio.utils.min.js +1 -1
  21. package/dist/formio.utils.min.js.LICENSE.txt +2 -4
  22. package/lib/cjs/Formio.js +11 -0
  23. package/lib/cjs/Webform.d.ts +1 -1
  24. package/lib/cjs/Webform.js +11 -9
  25. package/lib/cjs/WebformBuilder.d.ts +1 -1
  26. package/lib/cjs/WebformBuilder.js +12 -17
  27. package/lib/cjs/components/_classes/component/Component.js +2 -2
  28. package/lib/cjs/components/button/Button.d.ts +1 -1
  29. package/lib/cjs/components/button/Button.js +7 -7
  30. package/lib/cjs/components/radio/Radio.d.ts +1 -1
  31. package/lib/cjs/components/radio/Radio.js +5 -3
  32. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -8
  33. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +2 -1
  34. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +3 -2
  35. package/lib/cjs/components/recaptcha/ReCaptcha.js +1 -8
  36. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +33 -2
  37. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +13 -2
  38. package/lib/cjs/components/select/Select.js +6 -1
  39. package/lib/cjs/components/select/editForm/Select.edit.data.js +16 -2
  40. package/lib/cjs/components/select/fixtures/comp22.js +1 -1
  41. package/lib/cjs/components/select/fixtures/comp23.d.ts +58 -0
  42. package/lib/cjs/components/select/fixtures/comp23.js +49 -0
  43. package/lib/cjs/components/select/fixtures/comp24.d.ts +47 -0
  44. package/lib/cjs/components/select/fixtures/comp24.js +40 -0
  45. package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
  46. package/lib/cjs/components/select/fixtures/index.js +5 -1
  47. package/lib/cjs/components/selectboxes/SelectBoxes.js +4 -1
  48. package/lib/cjs/translations/en.d.ts +1 -0
  49. package/lib/cjs/translations/en.js +1 -0
  50. package/lib/cjs/utils/utils.d.ts +6 -0
  51. package/lib/cjs/utils/utils.js +16 -2
  52. package/lib/mjs/Formio.js +11 -0
  53. package/lib/mjs/Webform.d.ts +1 -1
  54. package/lib/mjs/Webform.js +12 -10
  55. package/lib/mjs/WebformBuilder.d.ts +1 -1
  56. package/lib/mjs/WebformBuilder.js +12 -16
  57. package/lib/mjs/components/_classes/component/Component.js +3 -3
  58. package/lib/mjs/components/button/Button.d.ts +1 -1
  59. package/lib/mjs/components/button/Button.js +7 -7
  60. package/lib/mjs/components/radio/Radio.d.ts +1 -1
  61. package/lib/mjs/components/radio/Radio.js +5 -3
  62. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -8
  63. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +2 -1
  64. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +3 -2
  65. package/lib/mjs/components/recaptcha/ReCaptcha.js +1 -8
  66. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +33 -2
  67. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +13 -2
  68. package/lib/mjs/components/select/Select.js +6 -1
  69. package/lib/mjs/components/select/editForm/Select.edit.data.js +16 -2
  70. package/lib/mjs/components/select/fixtures/comp22.js +1 -1
  71. package/lib/mjs/components/select/fixtures/comp23.d.ts +58 -0
  72. package/lib/mjs/components/select/fixtures/comp23.js +47 -0
  73. package/lib/mjs/components/select/fixtures/comp24.d.ts +47 -0
  74. package/lib/mjs/components/select/fixtures/comp24.js +38 -0
  75. package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
  76. package/lib/mjs/components/select/fixtures/index.js +3 -1
  77. package/lib/mjs/components/selectboxes/SelectBoxes.js +4 -1
  78. package/lib/mjs/translations/en.d.ts +1 -0
  79. package/lib/mjs/translations/en.js +1 -0
  80. package/lib/mjs/utils/utils.d.ts +6 -0
  81. package/lib/mjs/utils/utils.js +13 -0
  82. package/package.json +4 -4
@@ -0,0 +1,58 @@
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
+ url: string;
14
+ headers: {
15
+ key: string;
16
+ value: string;
17
+ }[];
18
+ };
19
+ multiple: boolean;
20
+ valueProperty: string;
21
+ validateWhenHidden: boolean;
22
+ key: string;
23
+ type: string;
24
+ input: boolean;
25
+ defaultValue: string[];
26
+ selectValues: string;
27
+ disableLimit: boolean;
28
+ noRefreshOnScroll: boolean;
29
+ selectData: {
30
+ value1: {
31
+ label: string;
32
+ };
33
+ value3: {
34
+ label: string;
35
+ };
36
+ };
37
+ disableOnInvalid?: undefined;
38
+ } | {
39
+ type: string;
40
+ label: string;
41
+ key: string;
42
+ disableOnInvalid: boolean;
43
+ input: boolean;
44
+ tableView: boolean;
45
+ widget?: undefined;
46
+ dataSrc?: undefined;
47
+ data?: undefined;
48
+ multiple?: undefined;
49
+ valueProperty?: undefined;
50
+ validateWhenHidden?: undefined;
51
+ defaultValue?: undefined;
52
+ selectValues?: undefined;
53
+ disableLimit?: undefined;
54
+ noRefreshOnScroll?: undefined;
55
+ selectData?: undefined;
56
+ })[];
57
+ }
58
+ export default _default;
@@ -0,0 +1,47 @@
1
+ export default {
2
+ title: 'FIO-8281',
3
+ name: 'fio8281',
4
+ path: 'fio8281',
5
+ type: 'form',
6
+ display: 'form',
7
+ components: [{
8
+ label: 'Select',
9
+ widget: 'choicesjs',
10
+ tableView: true,
11
+ dataSrc: 'url',
12
+ data: {
13
+ url: 'https://fake_url.com',
14
+ headers: [
15
+ {
16
+ key: '',
17
+ value: ''
18
+ },
19
+ ],
20
+ },
21
+ multiple: true,
22
+ valueProperty: 'value',
23
+ validateWhenHidden: false,
24
+ key: 'select',
25
+ type: 'select',
26
+ input: true,
27
+ defaultValue: ['value1', 'value3'],
28
+ selectValues: 'data',
29
+ disableLimit: false,
30
+ noRefreshOnScroll: false,
31
+ selectData: {
32
+ value1: {
33
+ label: 'Label 1',
34
+ },
35
+ value3: {
36
+ label: 'Label 3',
37
+ },
38
+ },
39
+ }, {
40
+ type: 'button',
41
+ label: 'Submit',
42
+ key: 'submit',
43
+ disableOnInvalid: true,
44
+ input: true,
45
+ tableView: false,
46
+ }]
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
+ };
@@ -19,5 +19,7 @@ import comp19 from './comp19';
19
19
  import comp20 from './comp20';
20
20
  import comp21 from './comp21';
21
21
  import comp22 from './comp22';
22
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22 };
22
+ import comp23 from './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 };
23
25
  export { multiSelect, multiSelectOptions } from "./comp3";
@@ -20,4 +20,6 @@ import comp19 from './comp19';
20
20
  import comp20 from './comp20';
21
21
  import comp21 from './comp21';
22
22
  import comp22 from './comp22';
23
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22 };
23
+ import comp23 from './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 };
@@ -160,11 +160,14 @@ export default class SelectBoxesComponent extends RadioComponent {
160
160
  }
161
161
  return changed;
162
162
  }
163
- getValueAsString(value) {
163
+ getValueAsString(value, options = {}) {
164
164
  if (!value) {
165
165
  return '';
166
166
  }
167
167
  if (this.isSelectURL) {
168
+ if (options.modalPreview && this.loadedOptions) {
169
+ return this.loadedOptions.filter((option) => value[option.value]).map((option) => option.label).join(', ');
170
+ }
168
171
  return _(value).pickBy((val) => val).keys().join(', ');
169
172
  }
170
173
  return _(this.component.values || [])
@@ -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
  };
@@ -31,6 +31,12 @@ export function getElementRect(element: HTMLElement): {
31
31
  width: number;
32
32
  height: number;
33
33
  };
34
+ /**
35
+ * Get non HTMLElement property in the window object
36
+ * @param {string} property - The window property to fetch the script plugin from.
37
+ * @returns {any | undefined} - The HTML Element property on the window object.
38
+ */
39
+ export function getScriptPlugin(property: string): any | undefined;
34
40
  /**
35
41
  * Determines the boolean value of a setting.
36
42
  * @param {string|boolean} value - A string or boolean value to convert to boolean.
@@ -85,6 +85,19 @@ export function getElementRect(element) {
85
85
  height: getPropertyValue(style, 'height')
86
86
  };
87
87
  }
88
+ /**
89
+ * Get non HTMLElement property in the window object
90
+ * @param {string} property - The window property to fetch the script plugin from.
91
+ * @returns {any | undefined} - The HTML Element property on the window object.
92
+ */
93
+ export function getScriptPlugin(property) {
94
+ const obj = window[property];
95
+ if (typeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2
96
+ obj && typeof obj === 'object' && true && obj.nodeType === 1 && typeof obj.nodeName === 'string') {
97
+ return undefined;
98
+ }
99
+ return obj;
100
+ }
88
101
  /**
89
102
  * Determines the boolean value of a setting.
90
103
  * @param {string|boolean} value - A string or boolean value to convert to boolean.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-rc.58",
3
+ "version": "5.0.0-rc.59",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -79,9 +79,9 @@
79
79
  },
80
80
  "homepage": "https://github.com/formio/formio.js#readme",
81
81
  "dependencies": {
82
- "@formio/bootstrap": "^3.0.0-rc.24",
82
+ "@formio/bootstrap": "^3.0.0-rc.25",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "^2.1.0-dev.tt.12",
84
+ "@formio/core": "^2.1.0-dev.tt.13",
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",
@@ -119,7 +119,7 @@
119
119
  "devDependencies": {
120
120
  "@typescript-eslint/eslint-plugin": "^7.9.0",
121
121
  "@typescript-eslint/parser": "^7.9.0",
122
- "ace-builds": "1.33.2",
122
+ "ace-builds": "1.34.2",
123
123
  "async-limiter": "^2.0.0",
124
124
  "bootstrap-icons": "^1.10.5",
125
125
  "bootswatch": "^5.3.3",