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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) 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 +27 -38
  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 +31 -42
  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 +4 -4
  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/CDN.d.ts +1 -0
  23. package/lib/cjs/CDN.js +6 -3
  24. package/lib/cjs/Embed.d.ts +1 -1
  25. package/lib/cjs/Embed.js +41 -7
  26. package/lib/cjs/Formio.js +11 -0
  27. package/lib/cjs/InlineEmbed.js +3 -1
  28. package/lib/cjs/Webform.d.ts +1 -1
  29. package/lib/cjs/Webform.js +11 -9
  30. package/lib/cjs/WebformBuilder.d.ts +1 -1
  31. package/lib/cjs/WebformBuilder.js +12 -17
  32. package/lib/cjs/components/_classes/component/Component.js +2 -2
  33. package/lib/cjs/components/button/Button.d.ts +1 -1
  34. package/lib/cjs/components/button/Button.js +7 -7
  35. package/lib/cjs/components/radio/Radio.d.ts +1 -1
  36. package/lib/cjs/components/radio/Radio.js +5 -3
  37. package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -8
  38. package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +2 -1
  39. package/lib/cjs/components/recaptcha/ReCaptcha.form.js +3 -2
  40. package/lib/cjs/components/recaptcha/ReCaptcha.js +1 -8
  41. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +33 -2
  42. package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +13 -2
  43. package/lib/cjs/components/select/Select.js +6 -1
  44. package/lib/cjs/components/select/editForm/Select.edit.data.js +16 -2
  45. package/lib/cjs/components/select/fixtures/comp22.js +1 -1
  46. package/lib/cjs/components/select/fixtures/comp23.d.ts +58 -0
  47. package/lib/cjs/components/select/fixtures/comp23.js +49 -0
  48. package/lib/cjs/components/select/fixtures/comp24.d.ts +47 -0
  49. package/lib/cjs/components/select/fixtures/comp24.js +40 -0
  50. package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
  51. package/lib/cjs/components/select/fixtures/index.js +5 -1
  52. package/lib/cjs/components/selectboxes/SelectBoxes.js +4 -1
  53. package/lib/cjs/translations/en.d.ts +1 -0
  54. package/lib/cjs/translations/en.js +1 -0
  55. package/lib/cjs/utils/utils.d.ts +6 -0
  56. package/lib/cjs/utils/utils.js +16 -2
  57. package/lib/mjs/CDN.d.ts +1 -0
  58. package/lib/mjs/CDN.js +6 -3
  59. package/lib/mjs/Embed.d.ts +1 -1
  60. package/lib/mjs/Embed.js +41 -7
  61. package/lib/mjs/Formio.js +11 -0
  62. package/lib/mjs/InlineEmbed.js +3 -1
  63. package/lib/mjs/Webform.d.ts +1 -1
  64. package/lib/mjs/Webform.js +12 -10
  65. package/lib/mjs/WebformBuilder.d.ts +1 -1
  66. package/lib/mjs/WebformBuilder.js +12 -16
  67. package/lib/mjs/components/_classes/component/Component.js +3 -3
  68. package/lib/mjs/components/button/Button.d.ts +1 -1
  69. package/lib/mjs/components/button/Button.js +7 -7
  70. package/lib/mjs/components/radio/Radio.d.ts +1 -1
  71. package/lib/mjs/components/radio/Radio.js +5 -3
  72. package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -8
  73. package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +2 -1
  74. package/lib/mjs/components/recaptcha/ReCaptcha.form.js +3 -2
  75. package/lib/mjs/components/recaptcha/ReCaptcha.js +1 -8
  76. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +33 -2
  77. package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +13 -2
  78. package/lib/mjs/components/select/Select.js +6 -1
  79. package/lib/mjs/components/select/editForm/Select.edit.data.js +16 -2
  80. package/lib/mjs/components/select/fixtures/comp22.js +1 -1
  81. package/lib/mjs/components/select/fixtures/comp23.d.ts +58 -0
  82. package/lib/mjs/components/select/fixtures/comp23.js +47 -0
  83. package/lib/mjs/components/select/fixtures/comp24.d.ts +47 -0
  84. package/lib/mjs/components/select/fixtures/comp24.js +38 -0
  85. package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
  86. package/lib/mjs/components/select/fixtures/index.js +3 -1
  87. package/lib/mjs/components/selectboxes/SelectBoxes.js +4 -1
  88. package/lib/mjs/translations/en.d.ts +1 -0
  89. package/lib/mjs/translations/en.js +1 -0
  90. package/lib/mjs/utils/utils.d.ts +6 -0
  91. package/lib/mjs/utils/utils.js +13 -0
  92. package/package.json +4 -4
@@ -6,7 +6,7 @@ import isMobile from 'ismobilejs';
6
6
  import { processOne, processOneSync, validateProcessInfo } from '@formio/core/process';
7
7
  import { Formio } from '../../../Formio';
8
8
  import * as FormioUtils from '../../../utils/utils';
9
- import { fastCloneDeep, boolValue, getComponentPath, isInsideScopingComponent, currentTimezone } from '../../../utils/utils';
9
+ import { fastCloneDeep, boolValue, getComponentPath, isInsideScopingComponent, currentTimezone, getScriptPlugin } from '../../../utils/utils';
10
10
  import Element from '../../../Element';
11
11
  import ComponentModal from '../componentModal/ComponentModal';
12
12
  import Widgets from '../../../widgets';
@@ -3463,7 +3463,7 @@ Component.requireLibrary = function (name, property, src, polling) {
3463
3463
  }.bind(Component.externalLibraries[name]);
3464
3464
  }
3465
3465
  // See if the plugin already exists.
3466
- const plugin = _.get(window, property);
3466
+ const plugin = getScriptPlugin(property);
3467
3467
  if (plugin) {
3468
3468
  Component.externalLibraries[name].resolve(plugin);
3469
3469
  }
@@ -3506,7 +3506,7 @@ Component.requireLibrary = function (name, property, src, polling) {
3506
3506
  // if no callback is provided, then check periodically for the script.
3507
3507
  if (polling) {
3508
3508
  setTimeout(function checkLibrary() {
3509
- const plugin = _.get(window, property);
3509
+ const plugin = getScriptPlugin(property);
3510
3510
  if (plugin) {
3511
3511
  Component.externalLibraries[name].resolve(plugin);
3512
3512
  }
@@ -31,6 +31,6 @@ export default class ButtonComponent extends Field {
31
31
  openOauth(settings: any): void;
32
32
  get oauthComponentPath(): any;
33
33
  focus(): void;
34
- triggerReCaptcha(): void;
34
+ triggerCaptcha(): void;
35
35
  }
36
36
  import Field from '../_classes/field/Field';
@@ -267,7 +267,7 @@ export default class ButtonComponent extends Field {
267
267
  super.detach();
268
268
  }
269
269
  onClick(event) {
270
- this.triggerReCaptcha();
270
+ this.triggerCaptcha();
271
271
  // Don't click if disabled or in builder mode.
272
272
  if (this.disabled || this.options.attachMode === 'builder') {
273
273
  return;
@@ -453,20 +453,20 @@ export default class ButtonComponent extends Field {
453
453
  this.refs.button.focus();
454
454
  }
455
455
  }
456
- triggerReCaptcha() {
456
+ triggerCaptcha() {
457
457
  if (!this.root) {
458
458
  return;
459
459
  }
460
- let recaptchaComponent;
460
+ let captchaComponent;
461
461
  this.root.everyComponent((component) => {
462
- if (component.component.type === 'recaptcha' &&
462
+ if (/^(re)?captcha$/.test(component.component.type) &&
463
463
  component.component.eventType === 'buttonClick' &&
464
464
  component.component.buttonKey === this.component.key) {
465
- recaptchaComponent = component;
465
+ captchaComponent = component;
466
466
  }
467
467
  });
468
- if (recaptchaComponent) {
469
- recaptchaComponent.verify(`${this.component.key}Click`);
468
+ if (captchaComponent) {
469
+ captchaComponent.verify(`${this.component.key}Click`);
470
470
  }
471
471
  }
472
472
  }
@@ -48,7 +48,7 @@ export default class RadioComponent extends ListComponent {
48
48
  detach(element: any): void;
49
49
  validateValueProperty(): boolean;
50
50
  validateValueAvailability(setting: any, value: any): boolean;
51
- getValueAsString(value: any): any;
51
+ getValueAsString(value: any, options?: {}): any;
52
52
  setValueAt(index: any, value: any): void;
53
53
  loadItems(url: any, search: any, headers: any, options: any, method: any, body: any): void;
54
54
  loadItemsFromMetadata(): void;
@@ -226,17 +226,19 @@ export default class RadioComponent extends ListComponent {
226
226
  }
227
227
  return false;
228
228
  }
229
- getValueAsString(value) {
229
+ getValueAsString(value, options = {}) {
230
230
  if (_.isObject(value)) {
231
231
  value = JSON.stringify(value);
232
232
  }
233
233
  else if (!_.isString(value)) {
234
234
  value = _.toString(value);
235
235
  }
236
- if (this.component.dataSrc !== 'values') {
236
+ const isModalPreviewWithUrlDataSource = options.modalPreview && this.component.dataSrc === 'url';
237
+ if (this.component.dataSrc !== 'values' && !isModalPreviewWithUrlDataSource) {
237
238
  return value;
238
239
  }
239
- const option = _.find(this.component.values, (v) => v.value === value);
240
+ const values = isModalPreviewWithUrlDataSource ? this.loadedOptions : this.component.values;
241
+ const option = _.find(values, (v) => v.value === value);
240
242
  if (!value) {
241
243
  return _.get(option, 'label', '');
242
244
  }
@@ -1,12 +1,5 @@
1
1
  export default class ReCaptchaComponent extends Component {
2
- static get builderInfo(): {
3
- title: string;
4
- group: string;
5
- icon: string;
6
- documentation: string;
7
- weight: number;
8
- schema: any;
9
- };
2
+ static get builderInfo(): {};
10
3
  static savedValueTypes(): never[];
11
4
  render(): string;
12
5
  recaptchaResult: any;
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The Edit Form function.
3
+ * @param {...any} extend - The components that extend the edit form.
3
4
  * @returns {import('@formio/core').Component[]} - The edit form components.
4
5
  */
5
- export default function _default(): import('@formio/core').Component[];
6
+ export default function _default(...extend: any[]): import('@formio/core').Component[];
@@ -2,9 +2,10 @@ import Components from '../Components';
2
2
  import ReCaptchaEditDisplay from './editForm/ReCaptcha.edit.display';
3
3
  /**
4
4
  * The Edit Form function.
5
+ * @param {...any} extend - The components that extend the edit form.
5
6
  * @returns {import('@formio/core').Component[]} - The edit form components.
6
7
  */
7
- export default function () {
8
+ export default function (...extend) {
8
9
  return Components.baseEditForm([
9
10
  {
10
11
  key: 'display',
@@ -26,5 +27,5 @@ export default function () {
26
27
  key: 'logic',
27
28
  ignore: true
28
29
  },
29
- ]);
30
+ ], ...extend);
30
31
  }
@@ -12,14 +12,7 @@ export default class ReCaptchaComponent extends Component {
12
12
  }, ...extend);
13
13
  }
14
14
  static get builderInfo() {
15
- return {
16
- title: 'reCAPTCHA',
17
- group: 'premium',
18
- icon: 'refresh',
19
- documentation: '/userguide/form-building/premium-components#recaptcha',
20
- weight: 40,
21
- schema: ReCaptchaComponent.schema()
22
- };
15
+ return {};
23
16
  }
24
17
  static savedValueTypes() {
25
18
  return [];
@@ -1,4 +1,21 @@
1
1
  declare const _default: ({
2
+ key: string;
3
+ weight: number;
4
+ type: string;
5
+ tag: string;
6
+ className: string;
7
+ content: string;
8
+ label?: undefined;
9
+ tooltip?: undefined;
10
+ values?: undefined;
11
+ validate?: undefined;
12
+ input?: undefined;
13
+ dataSrc?: undefined;
14
+ valueProperty?: undefined;
15
+ customConditional?: undefined;
16
+ data?: undefined;
17
+ ignore?: undefined;
18
+ } | {
2
19
  key: string;
3
20
  label: string;
4
21
  tooltip: string;
@@ -7,7 +24,13 @@ declare const _default: ({
7
24
  label: string;
8
25
  value: string;
9
26
  }[];
27
+ validate: {
28
+ required: boolean;
29
+ };
10
30
  weight: number;
31
+ tag?: undefined;
32
+ className?: undefined;
33
+ content?: undefined;
11
34
  input?: undefined;
12
35
  dataSrc?: undefined;
13
36
  valueProperty?: undefined;
@@ -27,16 +50,24 @@ declare const _default: ({
27
50
  data: {
28
51
  custom(context: any): any[];
29
52
  };
53
+ tag?: undefined;
54
+ className?: undefined;
55
+ content?: undefined;
30
56
  values?: undefined;
57
+ validate?: undefined;
31
58
  ignore?: undefined;
32
59
  } | {
33
60
  key: string;
34
61
  ignore: boolean;
62
+ weight?: undefined;
63
+ type?: undefined;
64
+ tag?: undefined;
65
+ className?: undefined;
66
+ content?: undefined;
35
67
  label?: undefined;
36
68
  tooltip?: undefined;
37
- type?: undefined;
38
69
  values?: undefined;
39
- weight?: undefined;
70
+ validate?: undefined;
40
71
  input?: undefined;
41
72
  dataSrc?: undefined;
42
73
  valueProperty?: undefined;
@@ -1,9 +1,17 @@
1
1
  import { getContextButtons } from '../../../utils/utils';
2
2
  export default [
3
+ {
4
+ key: 'recaptchaInfo',
5
+ weight: -10,
6
+ type: 'htmlelement',
7
+ tag: 'div',
8
+ className: 'alert alert-danger',
9
+ content: 'This component has been deprecated and will be removed. Use the CAPTCHA component instead.',
10
+ },
3
11
  {
4
12
  key: 'eventType',
5
13
  label: 'Type of event',
6
- tooltip: 'Specify type of event that this reCAPTCHA would react to',
14
+ tooltip: 'Specify type of event that this CAPTCHA would react to. If Button Click is selected, then the CAPTCHA widget will be displayed and verification will occur after clicking on the button.',
7
15
  type: 'radio',
8
16
  values: [
9
17
  {
@@ -15,6 +23,9 @@ export default [
15
23
  value: 'buttonClick'
16
24
  }
17
25
  ],
26
+ validate: {
27
+ required: true
28
+ },
18
29
  weight: 650
19
30
  },
20
31
  {
@@ -24,7 +35,7 @@ export default [
24
35
  key: 'buttonKey',
25
36
  dataSrc: 'custom',
26
37
  valueProperty: 'value',
27
- tooltip: 'Specify key of button on this form that this reCAPTCHA should react to',
38
+ tooltip: 'Specify key of button on this form that this CAPTCHA should react to',
28
39
  weight: 660,
29
40
  customConditional(context) {
30
41
  return context.data.eventType === 'buttonClick';
@@ -226,9 +226,10 @@ export default class SelectComponent extends ListComponent {
226
226
  }
227
227
  selectValueAndLabel(data) {
228
228
  const value = this.getOptionValue((this.isEntireObjectDisplay() && !this.itemValue(data)) ? data : this.itemValue(data));
229
+ const readOnlyResourceLabelData = this.options.readOnly && (this.component.dataSrc === 'resource' || this.component.dataSrc === 'url') && this.selectData;
229
230
  return {
230
231
  value,
231
- label: this.itemTemplate((this.isEntireObjectDisplay() && !_.isObject(data.data)) ? { data: data } : data, value)
232
+ label: this.itemTemplate((this.isEntireObjectDisplay() && !_.isObject(data.data)) ? { data: data } : readOnlyResourceLabelData || data, value)
232
233
  };
233
234
  }
234
235
  itemTemplate(data, value) {
@@ -1492,6 +1493,10 @@ export default class SelectComponent extends ListComponent {
1492
1493
  }
1493
1494
  asString(value, options = {}) {
1494
1495
  value = value ?? this.getValue();
1496
+ if (options.modalPreview && this.selectData) {
1497
+ const { label } = this.selectValueAndLabel(value);
1498
+ return label;
1499
+ }
1495
1500
  //need to convert values to strings to be able to compare values with available options that are strings
1496
1501
  const convertToString = (data, valueProperty) => {
1497
1502
  if (valueProperty) {
@@ -1,14 +1,28 @@
1
1
  import _ from 'lodash';
2
2
  import { eachComponent } from '../../../utils/utils';
3
- const calculateSelectData = (context) => {
3
+ const calculateSingleSelectData = (context, defaultValue) => {
4
4
  const { instance, data } = context;
5
- const rawDefaultValue = instance.downloadedResources.find(resource => _.get(resource, data.valueProperty) === instance.getValue());
5
+ const rawDefaultValue = instance.downloadedResources.find(resource => _.get(resource, data.valueProperty) === defaultValue);
6
6
  const options = { data: {}, noeval: true };
7
7
  instance.interpolate(data.template, {
8
8
  item: rawDefaultValue,
9
9
  }, options);
10
10
  return options.data.item;
11
11
  };
12
+ const calculateSelectData = (context) => {
13
+ const { instance } = context;
14
+ const defaultValue = instance.getValue();
15
+ if (instance.component.multiple) {
16
+ const multiSelectData = {};
17
+ (defaultValue ?? []).forEach((defaultValueItem) => {
18
+ multiSelectData[defaultValueItem] = calculateSingleSelectData(context, defaultValueItem);
19
+ });
20
+ return multiSelectData;
21
+ }
22
+ else {
23
+ return calculateSingleSelectData(context, defaultValue);
24
+ }
25
+ };
12
26
  const setSelectData = (context) => {
13
27
  // Wait before downloadedResources will be set
14
28
  setTimeout(() => {
@@ -6,7 +6,7 @@ export default {
6
6
  display: 'form',
7
7
  components: [{
8
8
  label: 'Select',
9
- widget: 'choicesjs',
9
+ widget: 'html5',
10
10
  tableView: true,
11
11
  dataSrc: 'url',
12
12
  data: {
@@ -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.57",
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",