@formio/js 5.0.0-dev.5621.91bd945 → 5.0.0-dev.5628.7520d42
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.
- package/Changelog.md +2 -0
- package/dist/formio.builder.css +1 -0
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.form.css +1 -0
- package/dist/formio.form.js +52 -40
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.css +1 -0
- package/dist/formio.full.js +56 -44
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Formio.js +11 -0
- package/lib/cjs/Webform.d.ts +1 -1
- package/lib/cjs/Webform.js +12 -8
- package/lib/cjs/WebformBuilder.d.ts +1 -1
- package/lib/cjs/WebformBuilder.js +12 -17
- package/lib/cjs/components/_classes/component/Component.d.ts +5 -3
- package/lib/cjs/components/_classes/component/Component.js +1 -2
- package/lib/cjs/components/button/Button.d.ts +1 -1
- package/lib/cjs/components/button/Button.js +7 -7
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -8
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +2 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.js +1 -8
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +28 -2
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +10 -2
- package/lib/cjs/components/select/Select.js +2 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.js +16 -2
- package/lib/cjs/components/select/fixtures/comp22.js +1 -1
- package/lib/cjs/components/select/fixtures/comp23.d.ts +58 -0
- package/lib/cjs/components/select/fixtures/comp23.js +49 -0
- package/lib/cjs/components/select/fixtures/comp24.d.ts +47 -0
- package/lib/cjs/components/select/fixtures/comp24.js +40 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- package/lib/cjs/translations/en.d.ts +1 -0
- package/lib/cjs/translations/en.js +1 -0
- package/lib/mjs/Formio.js +11 -0
- package/lib/mjs/Webform.d.ts +1 -1
- package/lib/mjs/Webform.js +13 -9
- package/lib/mjs/WebformBuilder.d.ts +1 -1
- package/lib/mjs/WebformBuilder.js +12 -16
- package/lib/mjs/components/_classes/component/Component.d.ts +5 -3
- package/lib/mjs/components/_classes/component/Component.js +1 -2
- package/lib/mjs/components/button/Button.d.ts +1 -1
- package/lib/mjs/components/button/Button.js +7 -7
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -8
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +2 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.js +1 -8
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +28 -2
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +10 -2
- package/lib/mjs/components/select/Select.js +2 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.js +16 -2
- package/lib/mjs/components/select/fixtures/comp22.js +1 -1
- package/lib/mjs/components/select/fixtures/comp23.d.ts +58 -0
- package/lib/mjs/components/select/fixtures/comp23.js +47 -0
- package/lib/mjs/components/select/fixtures/comp24.d.ts +47 -0
- package/lib/mjs/components/select/fixtures/comp24.js +38 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- package/lib/mjs/translations/en.d.ts +1 -0
- package/lib/mjs/translations/en.js +1 -0
- package/package.json +3 -3
package/lib/mjs/Formio.js
CHANGED
|
@@ -107,4 +107,15 @@ FormioCore.createForm = FormioEmbed.createForm;
|
|
|
107
107
|
FormioCore.submitDone = FormioEmbed.submitDone;
|
|
108
108
|
FormioCore.addLibrary = FormioEmbed.addLibrary;
|
|
109
109
|
FormioCore.addLoader = FormioEmbed.addLoader;
|
|
110
|
+
FormioCore.addToGlobal = (global) => {
|
|
111
|
+
if (typeof global === 'object' && !global.Formio) {
|
|
112
|
+
global.Formio = FormioCore;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
if (typeof global !== 'undefined') {
|
|
116
|
+
FormioCore.addToGlobal(global);
|
|
117
|
+
}
|
|
118
|
+
if (typeof window !== 'undefined') {
|
|
119
|
+
FormioCore.addToGlobal(window);
|
|
120
|
+
}
|
|
110
121
|
export { FormioCore as Formio };
|
package/lib/mjs/Webform.d.ts
CHANGED
|
@@ -471,7 +471,7 @@ declare class Webform extends NestedDataComponent {
|
|
|
471
471
|
*/
|
|
472
472
|
submit(before: boolean, options?: {}): Promise<any>;
|
|
473
473
|
submitUrl(URL: any, headers: any): void;
|
|
474
|
-
|
|
474
|
+
triggerCaptcha(): void;
|
|
475
475
|
_nosubmit: any;
|
|
476
476
|
get conditions(): any;
|
|
477
477
|
get variables(): any;
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -7,7 +7,7 @@ import i18nDefaults from './i18n';
|
|
|
7
7
|
import { Formio } from './Formio';
|
|
8
8
|
import Components from './components/Components';
|
|
9
9
|
import NestedDataComponent from './components/_classes/nesteddata/NestedDataComponent';
|
|
10
|
-
import { fastCloneDeep, currentTimezone, unescapeHTML, getStringFromComponentPath,
|
|
10
|
+
import { fastCloneDeep, currentTimezone, unescapeHTML, getStringFromComponentPath, convertStringToHTMLElement, getArrayFromComponentPath, } from './utils/utils';
|
|
11
11
|
import { eachComponent } from './utils/formUtils';
|
|
12
12
|
// Initialize the available forms.
|
|
13
13
|
Formio.forms = {};
|
|
@@ -657,7 +657,7 @@ export default class Webform extends NestedDataComponent {
|
|
|
657
657
|
const rebuild = this.rebuild() || Promise.resolve();
|
|
658
658
|
return rebuild.then(() => {
|
|
659
659
|
this.emit('formLoad', form);
|
|
660
|
-
this.
|
|
660
|
+
this.triggerCaptcha();
|
|
661
661
|
// Make sure to trigger onChange after a render event occurs to speed up form rendering.
|
|
662
662
|
setTimeout(() => {
|
|
663
663
|
this.onChange(flags);
|
|
@@ -834,7 +834,9 @@ export default class Webform extends NestedDataComponent {
|
|
|
834
834
|
};
|
|
835
835
|
}
|
|
836
836
|
// Metadata needs to be available before setValue
|
|
837
|
-
this._submission.metadata = submission.metadata
|
|
837
|
+
this._submission.metadata = submission.metadata
|
|
838
|
+
? _.cloneDeep(submission.metadata)
|
|
839
|
+
: {};
|
|
838
840
|
this.editing = !!submission._id;
|
|
839
841
|
// Set the timezone in the options if available.
|
|
840
842
|
if (!this.options.submissionTimezone &&
|
|
@@ -1489,16 +1491,18 @@ export default class Webform extends NestedDataComponent {
|
|
|
1489
1491
|
return console.warn('You should add a URL to this button.');
|
|
1490
1492
|
}
|
|
1491
1493
|
}
|
|
1492
|
-
|
|
1494
|
+
triggerCaptcha() {
|
|
1493
1495
|
if (!this || !this.components) {
|
|
1494
1496
|
return;
|
|
1495
1497
|
}
|
|
1496
|
-
const
|
|
1497
|
-
|
|
1498
|
-
|
|
1498
|
+
const captchaComponent = [];
|
|
1499
|
+
eachComponent(this.components, (component) => {
|
|
1500
|
+
if (/^(re)?captcha$/.test(component.type) && component.component.eventType === 'formLoad') {
|
|
1501
|
+
captchaComponent.push(component);
|
|
1502
|
+
}
|
|
1499
1503
|
});
|
|
1500
|
-
if (
|
|
1501
|
-
|
|
1504
|
+
if (captchaComponent.length > 0) {
|
|
1505
|
+
captchaComponent[0].verify(`${this.form.name ? this.form.name : 'form'}Load`);
|
|
1502
1506
|
}
|
|
1503
1507
|
}
|
|
1504
1508
|
set nosubmit(value) {
|
|
@@ -72,7 +72,7 @@ export default class WebformBuilder extends Component {
|
|
|
72
72
|
onDrop(element: any, target: any, source: any, sibling: any): any;
|
|
73
73
|
setForm(form: any): any;
|
|
74
74
|
keyboardActionsEnabled: any;
|
|
75
|
-
|
|
75
|
+
populateCaptchaSettings(form: any): void;
|
|
76
76
|
removeComponent(component: any, parent: any, original: any, componentInstance: any): boolean | undefined;
|
|
77
77
|
replaceDoubleQuotes(data: any, fieldsToRemoveDoubleQuotes?: any[]): any;
|
|
78
78
|
updateComponent(component: any, changed: any): void;
|
|
@@ -472,7 +472,7 @@ export default class WebformBuilder extends Component {
|
|
|
472
472
|
}
|
|
473
473
|
attach(element) {
|
|
474
474
|
this.on('change', (form) => {
|
|
475
|
-
this.
|
|
475
|
+
this.populateCaptchaSettings(form);
|
|
476
476
|
this.webform.setAlert(false);
|
|
477
477
|
});
|
|
478
478
|
return super.attach(element).then(() => {
|
|
@@ -923,24 +923,24 @@ export default class WebformBuilder extends Component {
|
|
|
923
923
|
}
|
|
924
924
|
return Promise.resolve(form);
|
|
925
925
|
}
|
|
926
|
-
|
|
927
|
-
//populate isEnabled for
|
|
928
|
-
let
|
|
926
|
+
populateCaptchaSettings(form) {
|
|
927
|
+
//populate isEnabled for captcha form settings
|
|
928
|
+
let isCaptchaEnabled = false;
|
|
929
929
|
if (this.form.components) {
|
|
930
930
|
eachComponent(form.components, component => {
|
|
931
|
-
if (
|
|
931
|
+
if (isCaptchaEnabled) {
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
|
-
if (component.type === '
|
|
935
|
-
|
|
934
|
+
if (component.type === 'captcha') {
|
|
935
|
+
isCaptchaEnabled = true;
|
|
936
936
|
return false;
|
|
937
937
|
}
|
|
938
938
|
});
|
|
939
|
-
if (
|
|
940
|
-
_.set(form, 'settings.
|
|
939
|
+
if (isCaptchaEnabled) {
|
|
940
|
+
_.set(form, 'settings.captcha.isEnabled', true);
|
|
941
941
|
}
|
|
942
|
-
else if (_.get(form, 'settings.
|
|
943
|
-
_.set(form, 'settings.
|
|
942
|
+
else if (_.get(form, 'settings.captcha.isEnabled')) {
|
|
943
|
+
_.set(form, 'settings.captcha.isEnabled', false);
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
946
|
}
|
|
@@ -1104,14 +1104,10 @@ export default class WebformBuilder extends Component {
|
|
|
1104
1104
|
let hasInvalidComponents = false;
|
|
1105
1105
|
this.webform.everyComponent((comp) => {
|
|
1106
1106
|
const path = comp.path;
|
|
1107
|
-
const errors = comp.visibleErrors || [];
|
|
1108
1107
|
if (repeatablePaths.includes(path)) {
|
|
1109
|
-
comp.setCustomValidity(
|
|
1108
|
+
comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
|
|
1110
1109
|
hasInvalidComponents = true;
|
|
1111
1110
|
}
|
|
1112
|
-
else if (errors.length && errors[0].message?.startsWith('API Key is not unique')) {
|
|
1113
|
-
comp.setCustomValidity('');
|
|
1114
|
-
}
|
|
1115
1111
|
});
|
|
1116
1112
|
this.emit('builderFormValidityChange', hasInvalidComponents);
|
|
1117
1113
|
}
|
|
@@ -492,10 +492,12 @@ declare class Component extends Element {
|
|
|
492
492
|
/**
|
|
493
493
|
* Add a new input error to this element.
|
|
494
494
|
*
|
|
495
|
-
* @param message
|
|
496
|
-
* @param dirty
|
|
495
|
+
* @param {{level: string, message: string}[]} messages
|
|
497
496
|
*/
|
|
498
|
-
addMessages(messages:
|
|
497
|
+
addMessages(messages: {
|
|
498
|
+
level: string;
|
|
499
|
+
message: string;
|
|
500
|
+
}[]): void;
|
|
499
501
|
setErrorClasses(elements: any, dirty: any, hasErrors: any, hasMessages: any, element?: any): void;
|
|
500
502
|
setElementInvalid(element: any, invalid: any): void;
|
|
501
503
|
clearOnHide(): void;
|
|
@@ -1795,8 +1795,7 @@ export default class Component extends Element {
|
|
|
1795
1795
|
/**
|
|
1796
1796
|
* Add a new input error to this element.
|
|
1797
1797
|
*
|
|
1798
|
-
* @param message
|
|
1799
|
-
* @param dirty
|
|
1798
|
+
* @param {{level: string, message: string}[]} messages
|
|
1800
1799
|
*/
|
|
1801
1800
|
addMessages(messages) {
|
|
1802
1801
|
if (!messages) {
|
|
@@ -262,7 +262,7 @@ export default class ButtonComponent extends Field {
|
|
|
262
262
|
super.detach();
|
|
263
263
|
}
|
|
264
264
|
onClick(event) {
|
|
265
|
-
this.
|
|
265
|
+
this.triggerCaptcha();
|
|
266
266
|
// Don't click if disabled or in builder mode.
|
|
267
267
|
if (this.disabled || this.options.attachMode === 'builder') {
|
|
268
268
|
return;
|
|
@@ -448,20 +448,20 @@ export default class ButtonComponent extends Field {
|
|
|
448
448
|
this.refs.button.focus();
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
|
|
451
|
+
triggerCaptcha() {
|
|
452
452
|
if (!this.root) {
|
|
453
453
|
return;
|
|
454
454
|
}
|
|
455
|
-
let
|
|
455
|
+
let captchaComponent;
|
|
456
456
|
this.root.everyComponent((component) => {
|
|
457
|
-
if (component.component.type
|
|
457
|
+
if (/^(re)?captcha$/.test(component.component.type) &&
|
|
458
458
|
component.component.eventType === 'buttonClick' &&
|
|
459
459
|
component.component.buttonKey === this.component.key) {
|
|
460
|
-
|
|
460
|
+
captchaComponent = component;
|
|
461
461
|
}
|
|
462
462
|
});
|
|
463
|
-
if (
|
|
464
|
-
|
|
463
|
+
if (captchaComponent) {
|
|
464
|
+
captchaComponent.verify(`${this.component.key}Click`);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
}
|
|
@@ -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(): any;
|
|
12
5
|
recaptchaResult: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Components from '../Components';
|
|
2
2
|
import ReCaptchaEditDisplay from './editForm/ReCaptcha.edit.display';
|
|
3
|
-
export default function () {
|
|
3
|
+
export default function (...extend) {
|
|
4
4
|
return Components.baseEditForm([
|
|
5
5
|
{
|
|
6
6
|
key: 'display',
|
|
@@ -22,5 +22,5 @@ export default function () {
|
|
|
22
22
|
key: 'logic',
|
|
23
23
|
ignore: true
|
|
24
24
|
},
|
|
25
|
-
]);
|
|
25
|
+
], ...extend);
|
|
26
26
|
}
|
|
@@ -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;
|
|
@@ -11,6 +28,9 @@ declare const _default: ({
|
|
|
11
28
|
required: boolean;
|
|
12
29
|
};
|
|
13
30
|
weight: number;
|
|
31
|
+
tag?: undefined;
|
|
32
|
+
className?: undefined;
|
|
33
|
+
content?: undefined;
|
|
14
34
|
input?: undefined;
|
|
15
35
|
dataSrc?: undefined;
|
|
16
36
|
valueProperty?: undefined;
|
|
@@ -30,18 +50,24 @@ declare const _default: ({
|
|
|
30
50
|
data: {
|
|
31
51
|
custom(context: any): any[];
|
|
32
52
|
};
|
|
53
|
+
tag?: undefined;
|
|
54
|
+
className?: undefined;
|
|
55
|
+
content?: undefined;
|
|
33
56
|
values?: undefined;
|
|
34
57
|
validate?: undefined;
|
|
35
58
|
ignore?: undefined;
|
|
36
59
|
} | {
|
|
37
60
|
key: string;
|
|
38
61
|
ignore: boolean;
|
|
62
|
+
weight?: undefined;
|
|
63
|
+
type?: undefined;
|
|
64
|
+
tag?: undefined;
|
|
65
|
+
className?: undefined;
|
|
66
|
+
content?: undefined;
|
|
39
67
|
label?: undefined;
|
|
40
68
|
tooltip?: undefined;
|
|
41
|
-
type?: undefined;
|
|
42
69
|
values?: undefined;
|
|
43
70
|
validate?: undefined;
|
|
44
|
-
weight?: undefined;
|
|
45
71
|
input?: undefined;
|
|
46
72
|
dataSrc?: undefined;
|
|
47
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
|
|
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
|
{
|
|
@@ -27,7 +35,7 @@ export default [
|
|
|
27
35
|
key: 'buttonKey',
|
|
28
36
|
dataSrc: 'custom',
|
|
29
37
|
valueProperty: 'value',
|
|
30
|
-
tooltip: 'Specify key of button on this form that this
|
|
38
|
+
tooltip: 'Specify key of button on this form that this CAPTCHA should react to',
|
|
31
39
|
weight: 660,
|
|
32
40
|
customConditional(context) {
|
|
33
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) {
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { eachComponent } from '../../../utils/utils';
|
|
3
|
-
const
|
|
3
|
+
const calculateSingleSelectData = (context, defaultValue) => {
|
|
4
4
|
const { instance, data } = context;
|
|
5
|
-
const rawDefaultValue = instance.downloadedResources.find(resource => _.get(resource, data.valueProperty) ===
|
|
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(() => {
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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 };
|
|
@@ -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
|
};
|