@formio/js 5.0.0-rc.20 → 5.0.0-rc.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.css +1 -39
- package/dist/formio.embed.js +2 -90
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +58 -36
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +59 -37
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +1 -0
- package/lib/cjs/Element.js +5 -0
- package/lib/cjs/Embed.d.ts +21 -1
- package/lib/cjs/Embed.js +211 -308
- package/lib/cjs/Form.d.ts +1 -1
- package/lib/cjs/Form.js +1 -1
- package/lib/cjs/Webform.d.ts +6 -6
- package/lib/cjs/Webform.js +6 -6
- package/lib/cjs/WebformBuilder.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +16 -6
- package/lib/cjs/components/_classes/component/Component.js +26 -6
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/cjs/components/address/Address.js +5 -0
- package/lib/cjs/components/button/Button.d.ts +1 -0
- package/lib/cjs/components/button/Button.js +3 -0
- package/lib/cjs/components/checkbox/Checkbox.d.ts +28 -0
- package/lib/cjs/components/checkbox/Checkbox.js +17 -2
- package/lib/cjs/components/columns/Columns.d.ts +1 -0
- package/lib/cjs/components/columns/Columns.js +3 -0
- package/lib/cjs/components/container/Container.js +3 -0
- package/lib/cjs/components/content/Content.d.ts +1 -0
- package/lib/cjs/components/content/Content.js +3 -0
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/cjs/components/datamap/DataMap.js +3 -0
- package/lib/cjs/components/datetime/DateTime.d.ts +19 -0
- package/lib/cjs/components/datetime/DateTime.js +9 -10
- package/lib/cjs/components/day/Day.d.ts +21 -0
- package/lib/cjs/components/day/Day.js +12 -10
- package/lib/cjs/components/day/fixtures/comp5.d.ts +29 -0
- package/lib/cjs/components/day/fixtures/comp5.js +32 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/fieldset/Fieldset.d.ts +1 -0
- package/lib/cjs/components/fieldset/Fieldset.js +3 -0
- package/lib/cjs/components/file/File.d.ts +21 -1
- package/lib/cjs/components/file/File.js +15 -7
- package/lib/cjs/components/form/Form.d.ts +1 -0
- package/lib/cjs/components/form/Form.js +5 -1
- package/lib/cjs/components/html/HTML.d.ts +1 -0
- package/lib/cjs/components/html/HTML.js +3 -0
- package/lib/cjs/components/number/Number.d.ts +20 -1
- package/lib/cjs/components/number/Number.js +10 -15
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +3 -0
- package/lib/cjs/components/radio/Radio.d.ts +19 -0
- package/lib/cjs/components/radio/Radio.js +30 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.js +3 -0
- package/lib/cjs/components/select/Select.d.ts +19 -1
- package/lib/cjs/components/select/Select.js +39 -4
- package/lib/cjs/components/select/fixtures/comp19.d.ts +23 -0
- package/lib/cjs/components/select/fixtures/comp19.js +36 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/select/fixtures/index.js +3 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +26 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.js +8 -1
- package/lib/cjs/components/signature/Signature.d.ts +21 -0
- package/lib/cjs/components/signature/Signature.js +9 -1
- package/lib/cjs/components/survey/Survey.d.ts +21 -0
- package/lib/cjs/components/survey/Survey.js +7 -1
- package/lib/cjs/components/table/Table.d.ts +1 -0
- package/lib/cjs/components/table/Table.js +3 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +1 -0
- package/lib/cjs/components/tabs/Tabs.js +3 -0
- package/lib/cjs/components/tags/Tags.d.ts +21 -0
- package/lib/cjs/components/tags/Tags.js +11 -1
- package/lib/cjs/components/tags/fixtures/comp6.d.ts +17 -0
- package/lib/cjs/components/tags/fixtures/comp6.js +20 -0
- package/lib/cjs/components/tags/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/tags/fixtures/index.js +3 -1
- package/lib/cjs/components/textfield/TextField.d.ts +21 -0
- package/lib/cjs/components/textfield/TextField.js +7 -1
- package/lib/cjs/components/time/Time.d.ts +8 -1
- package/lib/cjs/components/well/Well.d.ts +1 -0
- package/lib/cjs/components/well/Well.js +3 -0
- package/lib/cjs/formio.embed.d.ts +2 -1
- package/lib/cjs/formio.embed.js +96 -1
- package/lib/cjs/formio.form.d.ts +4 -3
- package/lib/cjs/formio.form.js +17 -8
- package/lib/cjs/licenses/Licenses.d.ts +7 -0
- package/lib/cjs/licenses/Licenses.js +22 -0
- package/lib/cjs/licenses/index.d.ts +2 -0
- package/lib/cjs/licenses/index.js +7 -0
- package/lib/cjs/utils/utils.d.ts +10 -0
- package/lib/cjs/utils/utils.js +21 -1
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +1 -0
- package/lib/mjs/Element.js +5 -0
- package/lib/mjs/Embed.d.ts +21 -1
- package/lib/mjs/Embed.js +208 -322
- package/lib/mjs/Form.d.ts +1 -1
- package/lib/mjs/Form.js +1 -1
- package/lib/mjs/Webform.d.ts +6 -6
- package/lib/mjs/Webform.js +6 -6
- package/lib/mjs/WebformBuilder.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +16 -6
- package/lib/mjs/components/_classes/component/Component.js +26 -6
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/mjs/components/address/Address.js +5 -0
- package/lib/mjs/components/button/Button.d.ts +1 -0
- package/lib/mjs/components/button/Button.js +4 -1
- package/lib/mjs/components/checkbox/Checkbox.d.ts +28 -0
- package/lib/mjs/components/checkbox/Checkbox.js +18 -3
- package/lib/mjs/components/columns/Columns.d.ts +1 -0
- package/lib/mjs/components/columns/Columns.js +3 -0
- package/lib/mjs/components/container/Container.js +4 -1
- package/lib/mjs/components/content/Content.d.ts +1 -0
- package/lib/mjs/components/content/Content.js +3 -0
- package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/mjs/components/datamap/DataMap.js +4 -1
- package/lib/mjs/components/datetime/DateTime.d.ts +19 -0
- package/lib/mjs/components/datetime/DateTime.js +11 -12
- package/lib/mjs/components/day/Day.d.ts +21 -0
- package/lib/mjs/components/day/Day.js +16 -14
- package/lib/mjs/components/day/fixtures/comp5.d.ts +29 -0
- package/lib/mjs/components/day/fixtures/comp5.js +30 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/fieldset/Fieldset.d.ts +1 -0
- package/lib/mjs/components/fieldset/Fieldset.js +3 -0
- package/lib/mjs/components/file/File.d.ts +21 -1
- package/lib/mjs/components/file/File.js +16 -8
- package/lib/mjs/components/form/Form.d.ts +1 -0
- package/lib/mjs/components/form/Form.js +6 -2
- package/lib/mjs/components/html/HTML.d.ts +1 -0
- package/lib/mjs/components/html/HTML.js +3 -0
- package/lib/mjs/components/number/Number.d.ts +20 -1
- package/lib/mjs/components/number/Number.js +11 -12
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +3 -0
- package/lib/mjs/components/radio/Radio.d.ts +19 -0
- package/lib/mjs/components/radio/Radio.js +34 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -0
- package/lib/mjs/components/recaptcha/ReCaptcha.js +3 -0
- package/lib/mjs/components/select/Select.d.ts +19 -1
- package/lib/mjs/components/select/Select.js +41 -6
- package/lib/mjs/components/select/fixtures/comp19.d.ts +23 -0
- package/lib/mjs/components/select/fixtures/comp19.js +34 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/select/fixtures/index.js +2 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +26 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.js +8 -1
- package/lib/mjs/components/signature/Signature.d.ts +21 -0
- package/lib/mjs/components/signature/Signature.js +9 -1
- package/lib/mjs/components/survey/Survey.d.ts +21 -0
- package/lib/mjs/components/survey/Survey.js +8 -2
- package/lib/mjs/components/table/Table.d.ts +1 -0
- package/lib/mjs/components/table/Table.js +3 -0
- package/lib/mjs/components/tabs/Tabs.d.ts +1 -0
- package/lib/mjs/components/tabs/Tabs.js +3 -0
- package/lib/mjs/components/tags/Tags.d.ts +21 -0
- package/lib/mjs/components/tags/Tags.js +12 -2
- package/lib/mjs/components/tags/fixtures/comp6.d.ts +17 -0
- package/lib/mjs/components/tags/fixtures/comp6.js +18 -0
- package/lib/mjs/components/tags/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/tags/fixtures/index.js +2 -1
- package/lib/mjs/components/textfield/TextField.d.ts +21 -0
- package/lib/mjs/components/textfield/TextField.js +8 -2
- package/lib/mjs/components/time/Time.d.ts +8 -1
- package/lib/mjs/components/well/Well.d.ts +1 -0
- package/lib/mjs/components/well/Well.js +3 -0
- package/lib/mjs/formio.embed.d.ts +2 -1
- package/lib/mjs/formio.embed.js +96 -2
- package/lib/mjs/formio.form.d.ts +4 -3
- package/lib/mjs/formio.form.js +16 -8
- package/lib/mjs/licenses/Licenses.d.ts +7 -0
- package/lib/mjs/licenses/Licenses.js +17 -0
- package/lib/mjs/licenses/index.d.ts +2 -0
- package/lib/mjs/licenses/index.js +2 -0
- package/lib/mjs/utils/utils.d.ts +10 -0
- package/lib/mjs/utils/utils.js +19 -0
- package/package.json +5 -1
- package/types/index.d.ts +1 -0
- package/types/licenses.d.ts +7 -0
- package/types/utils.d.ts +2 -0
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
6
|
+
exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
8
8
|
exports.comp1 = comp1_1.default;
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
@@ -12,3 +12,5 @@ const comp3_1 = __importDefault(require("./comp3"));
|
|
12
12
|
exports.comp3 = comp3_1.default;
|
13
13
|
const comp4_1 = __importDefault(require("./comp4"));
|
14
14
|
exports.comp4 = comp4_1.default;
|
15
|
+
const comp5_1 = __importDefault(require("./comp5"));
|
16
|
+
exports.comp5 = comp5_1.default;
|
@@ -7,6 +7,27 @@ export default class FileComponent extends Field {
|
|
7
7
|
weight: number;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get serverConditionSettings(): {
|
11
|
+
operators: string[];
|
12
|
+
constructor: Function;
|
13
|
+
toString(): string;
|
14
|
+
toLocaleString(): string;
|
15
|
+
valueOf(): Object;
|
16
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
17
|
+
isPrototypeOf(v: Object): boolean;
|
18
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
19
|
+
};
|
20
|
+
static get conditionOperatorsSettings(): {
|
21
|
+
operators: string[];
|
22
|
+
constructor: Function;
|
23
|
+
toString(): string;
|
24
|
+
toLocaleString(): string;
|
25
|
+
valueOf(): Object;
|
26
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
27
|
+
isPrototypeOf(v: Object): boolean;
|
28
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
29
|
+
};
|
30
|
+
static savedValueTypes(schema: any): string[];
|
10
31
|
support: {
|
11
32
|
filereader: boolean;
|
12
33
|
formdata: boolean;
|
@@ -54,7 +75,6 @@ export default class FileComponent extends Field {
|
|
54
75
|
validateMaxSize(file: any, val: any): boolean;
|
55
76
|
upload(files: any): void;
|
56
77
|
filesUploading: any[] | undefined;
|
57
|
-
abortUpload: any;
|
58
78
|
getFile(fileInfo: any): any;
|
59
79
|
focus(): void;
|
60
80
|
}
|
@@ -68,7 +68,14 @@ class FileComponent extends Field_1.default {
|
|
68
68
|
};
|
69
69
|
}
|
70
70
|
static get serverConditionSettings() {
|
71
|
-
return
|
71
|
+
return FileComponent.conditionOperatorsSettings;
|
72
|
+
}
|
73
|
+
static get conditionOperatorsSettings() {
|
74
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
|
75
|
+
}
|
76
|
+
static savedValueTypes(schema) {
|
77
|
+
schema = schema || {};
|
78
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
|
72
79
|
}
|
73
80
|
init() {
|
74
81
|
super.init();
|
@@ -354,8 +361,10 @@ class FileComponent extends Field_1.default {
|
|
354
361
|
this.refs.fileStatusRemove.forEach((fileStatusRemove, index) => {
|
355
362
|
this.addEventListener(fileStatusRemove, 'click', (event) => {
|
356
363
|
event.preventDefault();
|
357
|
-
|
358
|
-
|
364
|
+
const fileUpload = this.statuses[index];
|
365
|
+
lodash_1.default.pull(this.filesUploading, fileUpload.originalName);
|
366
|
+
if (fileUpload.abort) {
|
367
|
+
fileUpload.abort();
|
359
368
|
}
|
360
369
|
this.statuses.splice(index, 1);
|
361
370
|
this.redraw();
|
@@ -561,6 +570,7 @@ class FileComponent extends Field_1.default {
|
|
561
570
|
const fileName = (0, utils_1.uniqueName)(file.name, this.component.fileNameTemplate, this.evalContext());
|
562
571
|
const escapedFileName = file.name ? file.name.replaceAll('<', '<').replaceAll('>', '>') : file.name;
|
563
572
|
const fileUpload = {
|
573
|
+
abort: () => null,
|
564
574
|
originalName: escapedFileName,
|
565
575
|
name: fileName,
|
566
576
|
size: file.size,
|
@@ -680,7 +690,7 @@ class FileComponent extends Field_1.default {
|
|
680
690
|
}
|
681
691
|
}
|
682
692
|
}
|
683
|
-
fileUpload.message = this.t('Starting upload
|
693
|
+
fileUpload.message = this.t('Starting upload...');
|
684
694
|
this.redraw();
|
685
695
|
const filePromise = fileService.uploadFile(storage, processedFile || file, fileName, dir,
|
686
696
|
// Progress callback
|
@@ -693,9 +703,7 @@ class FileComponent extends Field_1.default {
|
|
693
703
|
// Upload start callback
|
694
704
|
() => {
|
695
705
|
this.emit('fileUploadingStart', filePromise);
|
696
|
-
},
|
697
|
-
// Abort upload callback
|
698
|
-
(abort) => this.abortUpload = abort).then((fileInfo) => {
|
706
|
+
}, (abort) => fileUpload.abort = abort).then((fileInfo) => {
|
699
707
|
const index = this.statuses.indexOf(fileUpload);
|
700
708
|
if (index !== -1) {
|
701
709
|
this.statuses.splice(index, 1);
|
@@ -33,6 +33,9 @@ class FormComponent extends Component_1.default {
|
|
33
33
|
schema: FormComponent.schema()
|
34
34
|
};
|
35
35
|
}
|
36
|
+
static savedValueTypes() {
|
37
|
+
return [utils_1.componentValueTypes.object];
|
38
|
+
}
|
36
39
|
init() {
|
37
40
|
super.init();
|
38
41
|
this.formObj = {
|
@@ -389,7 +392,8 @@ class FormComponent extends Component_1.default {
|
|
389
392
|
if (this.builderMode || this.isHidden() || (this.isSubFormLazyLoad() && !fromAttach)) {
|
390
393
|
return Promise.resolve();
|
391
394
|
}
|
392
|
-
if (this.hasLoadedForm && !this.isRevisionChanged
|
395
|
+
if (this.hasLoadedForm && !this.isRevisionChanged &&
|
396
|
+
!(this.options.pdf && this.useOriginalRevision && lodash_1.default.isNull(this.subForm) && !this.subFormLoading)) {
|
393
397
|
// Pass config down to sub forms.
|
394
398
|
if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {
|
395
399
|
this.formObj.config = this.root.form.config;
|
@@ -8,9 +8,28 @@ export default class NumberComponent extends Input {
|
|
8
8
|
schema: any;
|
9
9
|
};
|
10
10
|
static get serverConditionSettings(): {
|
11
|
-
operators:
|
11
|
+
operators: any[];
|
12
12
|
valueComponent(classComp: any): any;
|
13
|
+
constructor: Function;
|
14
|
+
toString(): string;
|
15
|
+
toLocaleString(): string;
|
16
|
+
valueOf(): Object;
|
17
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
18
|
+
isPrototypeOf(v: Object): boolean;
|
19
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
13
20
|
};
|
21
|
+
static get conditionOperatorsSettings(): {
|
22
|
+
operators: any[];
|
23
|
+
valueComponent(classComp: any): any;
|
24
|
+
constructor: Function;
|
25
|
+
toString(): string;
|
26
|
+
toLocaleString(): string;
|
27
|
+
valueOf(): Object;
|
28
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
29
|
+
isPrototypeOf(v: Object): boolean;
|
30
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
31
|
+
};
|
32
|
+
static savedValueTypes(schema: any): string[];
|
14
33
|
constructor(...args: any[]);
|
15
34
|
validators: string[];
|
16
35
|
delimiter: any;
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const text_mask_addons_1 = require("@formio/text-mask-addons");
|
7
7
|
const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
9
|
-
const utils_1 = require("../../utils/utils");
|
10
9
|
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
10
|
+
const utils_1 = require("../../utils/utils");
|
11
11
|
class NumberComponent extends Input_1.default {
|
12
12
|
static schema(...extend) {
|
13
13
|
return Input_1.default.schema({
|
@@ -33,21 +33,16 @@ class NumberComponent extends Input_1.default {
|
|
33
33
|
};
|
34
34
|
}
|
35
35
|
static get serverConditionSettings() {
|
36
|
-
return
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
'isEmpty',
|
41
|
-
'isNotEmpty',
|
42
|
-
'greaterThan',
|
43
|
-
'greaterThanOrEqual',
|
44
|
-
'lessThan',
|
45
|
-
'lessThanOrEqual',
|
46
|
-
],
|
47
|
-
valueComponent(classComp) {
|
36
|
+
return NumberComponent.conditionOperatorsSettings;
|
37
|
+
}
|
38
|
+
static get conditionOperatorsSettings() {
|
39
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: [...super.conditionOperatorsSettings.operators, 'lessThan', 'greaterThan', 'lessThanOrEqual', 'greaterThanOrEqual'], valueComponent(classComp) {
|
48
40
|
return Object.assign(Object.assign({}, classComp), { type: 'number' });
|
49
|
-
}
|
50
|
-
|
41
|
+
} });
|
42
|
+
}
|
43
|
+
static savedValueTypes(schema) {
|
44
|
+
schema = schema || {};
|
45
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.number];
|
51
46
|
}
|
52
47
|
constructor(...args) {
|
53
48
|
var _a, _b;
|
@@ -7,6 +7,25 @@ export default class RadioComponent extends ListComponent {
|
|
7
7
|
documentation: string;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get conditionOperatorsSettings(): {
|
11
|
+
valueComponent(classComp: any): {
|
12
|
+
type: string;
|
13
|
+
dataSrc: string;
|
14
|
+
valueProperty: string;
|
15
|
+
dataType: any;
|
16
|
+
data: {
|
17
|
+
custom(): any;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
constructor: Function;
|
21
|
+
toString(): string;
|
22
|
+
toLocaleString(): string;
|
23
|
+
valueOf(): Object;
|
24
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
25
|
+
isPrototypeOf(v: Object): boolean;
|
26
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
27
|
+
};
|
28
|
+
static savedValueTypes(schema: any): any[];
|
10
29
|
constructor(component: any, options: any, data: any);
|
11
30
|
previousValue: any;
|
12
31
|
get inputInfo(): {
|
@@ -31,6 +31,36 @@ class RadioComponent extends ListComponent_1.default {
|
|
31
31
|
schema: RadioComponent.schema()
|
32
32
|
};
|
33
33
|
}
|
34
|
+
static get conditionOperatorsSettings() {
|
35
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
|
36
|
+
return {
|
37
|
+
type: 'select',
|
38
|
+
dataSrc: 'custom',
|
39
|
+
valueProperty: 'value',
|
40
|
+
dataType: classComp.dataType || '',
|
41
|
+
data: {
|
42
|
+
custom() {
|
43
|
+
return classComp.values;
|
44
|
+
}
|
45
|
+
},
|
46
|
+
};
|
47
|
+
} });
|
48
|
+
}
|
49
|
+
static savedValueTypes(schema) {
|
50
|
+
const { boolean, string, number, object, array } = utils_1.componentValueTypes;
|
51
|
+
const { dataType } = schema;
|
52
|
+
const types = (0, utils_1.getComponentSavedTypes)(schema);
|
53
|
+
if (types) {
|
54
|
+
return types;
|
55
|
+
}
|
56
|
+
if (dataType === 'object') {
|
57
|
+
return [object, array];
|
58
|
+
}
|
59
|
+
if (utils_1.componentValueTypes[dataType]) {
|
60
|
+
return [utils_1.componentValueTypes[dataType]];
|
61
|
+
}
|
62
|
+
return [boolean, string, number, object, array];
|
63
|
+
}
|
34
64
|
constructor(component, options, data) {
|
35
65
|
super(component, options, data);
|
36
66
|
this.previousValue = this.dataValue || null;
|
@@ -9,8 +9,25 @@ export default class SelectComponent extends ListComponent {
|
|
9
9
|
};
|
10
10
|
static get serverConditionSettings(): {
|
11
11
|
valueComponent(classComp: any): any;
|
12
|
-
|
12
|
+
constructor: Function;
|
13
|
+
toString(): string;
|
14
|
+
toLocaleString(): string;
|
15
|
+
valueOf(): Object;
|
16
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
17
|
+
isPrototypeOf(v: Object): boolean;
|
18
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
13
19
|
};
|
20
|
+
static get conditionOperatorsSettings(): {
|
21
|
+
valueComponent(classComp: any): any;
|
22
|
+
constructor: Function;
|
23
|
+
toString(): string;
|
24
|
+
toLocaleString(): string;
|
25
|
+
valueOf(): Object;
|
26
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
27
|
+
isPrototypeOf(v: Object): boolean;
|
28
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
29
|
+
};
|
30
|
+
static savedValueTypes(schema: any): any[];
|
14
31
|
templateData: {} | undefined;
|
15
32
|
triggerUpdate: ((...args: any[]) => any) | undefined;
|
16
33
|
set itemsLoaded(arg: any);
|
@@ -40,6 +57,7 @@ export default class SelectComponent extends ListComponent {
|
|
40
57
|
get isSelectResource(): boolean;
|
41
58
|
get itemsFromUrl(): boolean;
|
42
59
|
get isInfiniteScrollProvided(): boolean;
|
60
|
+
get shouldInitialLoad(): any;
|
43
61
|
isEntireObjectDisplay(): boolean;
|
44
62
|
selectValueAndLabel(data: any): {
|
45
63
|
value: any;
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
7
|
const Formio_1 = require("../../Formio");
|
8
8
|
const ListComponent_1 = __importDefault(require("../_classes/list/ListComponent"));
|
9
|
+
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
9
10
|
const Form_1 = __importDefault(require("../../Form"));
|
10
11
|
const utils_1 = require("../../utils/utils");
|
11
12
|
const ChoicesWrapper_1 = __importDefault(require("../../utils/ChoicesWrapper"));
|
@@ -59,10 +60,31 @@ class SelectComponent extends ListComponent_1.default {
|
|
59
60
|
};
|
60
61
|
}
|
61
62
|
static get serverConditionSettings() {
|
62
|
-
return
|
63
|
+
return SelectComponent.conditionOperatorsSettings;
|
64
|
+
}
|
65
|
+
static get conditionOperatorsSettings() {
|
66
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
|
63
67
|
return Object.assign(Object.assign({}, classComp), { type: 'select' });
|
64
68
|
} });
|
65
69
|
}
|
70
|
+
static savedValueTypes(schema) {
|
71
|
+
const { boolean, string, number, object, array } = utils_1.componentValueTypes;
|
72
|
+
const { dataType, reference } = schema;
|
73
|
+
const types = (0, utils_1.getComponentSavedTypes)(schema);
|
74
|
+
if (types) {
|
75
|
+
return types;
|
76
|
+
}
|
77
|
+
if (reference) {
|
78
|
+
return [object];
|
79
|
+
}
|
80
|
+
if (dataType === 'object') {
|
81
|
+
return [object, array];
|
82
|
+
}
|
83
|
+
if (utils_1.componentValueTypes[dataType]) {
|
84
|
+
return [utils_1.componentValueTypes[dataType]];
|
85
|
+
}
|
86
|
+
return [boolean, string, number, object, array];
|
87
|
+
}
|
66
88
|
init() {
|
67
89
|
super.init();
|
68
90
|
this.templateData = {};
|
@@ -174,6 +196,15 @@ class SelectComponent extends ListComponent_1.default {
|
|
174
196
|
get shouldDisabled() {
|
175
197
|
return super.shouldDisabled || this.parentDisabled;
|
176
198
|
}
|
199
|
+
get shouldInitialLoad() {
|
200
|
+
if (this.component.widget === 'html5' &&
|
201
|
+
this.isEntireObjectDisplay() &&
|
202
|
+
this.component.searchField &&
|
203
|
+
this.dataValue) {
|
204
|
+
return false;
|
205
|
+
}
|
206
|
+
return super.shouldLoad;
|
207
|
+
}
|
177
208
|
isEntireObjectDisplay() {
|
178
209
|
return this.component.dataSrc === 'resource' && this.valueProperty === 'data';
|
179
210
|
}
|
@@ -482,7 +513,11 @@ class SelectComponent extends ListComponent_1.default {
|
|
482
513
|
});
|
483
514
|
// Add search capability.
|
484
515
|
if (this.component.searchField && search) {
|
485
|
-
const searchValue = Array.isArray(search)
|
516
|
+
const searchValue = Array.isArray(search)
|
517
|
+
? search.join(',')
|
518
|
+
: typeof search === 'object'
|
519
|
+
? JSON.stringify(search)
|
520
|
+
: search;
|
486
521
|
query[this.component.searchField] = this.component.searchField.endsWith('__regex')
|
487
522
|
? lodash_1.default.escapeRegExp(searchValue)
|
488
523
|
: searchValue;
|
@@ -774,7 +809,7 @@ class SelectComponent extends ListComponent_1.default {
|
|
774
809
|
this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
|
775
810
|
this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
|
776
811
|
}
|
777
|
-
|
812
|
+
Input_1.default.prototype.addFocusBlurEvents.call(this, this.focusableElement);
|
778
813
|
if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
|
779
814
|
this.scrollList = this.choices.choiceList.element;
|
780
815
|
this.addEventListener(this.scrollList, 'scroll', () => this.onScroll());
|
@@ -1167,7 +1202,7 @@ class SelectComponent extends ListComponent_1.default {
|
|
1167
1202
|
!this.active &&
|
1168
1203
|
!this.selectOptions.length &&
|
1169
1204
|
hasValue &&
|
1170
|
-
this.
|
1205
|
+
this.shouldInitialLoad &&
|
1171
1206
|
this.visible && (this.component.searchField || this.component.valueProperty);
|
1172
1207
|
}
|
1173
1208
|
setChoicesValue(value, hasPreviousValue, flags = {}) {
|
@@ -0,0 +1,23 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
const type: string;
|
3
|
+
const display: string;
|
4
|
+
const components: {
|
5
|
+
label: string;
|
6
|
+
widget: string;
|
7
|
+
tableView: boolean;
|
8
|
+
data: {
|
9
|
+
values: {
|
10
|
+
label: string;
|
11
|
+
value: string;
|
12
|
+
}[];
|
13
|
+
};
|
14
|
+
validateOn: string;
|
15
|
+
validate: {
|
16
|
+
custom: string;
|
17
|
+
};
|
18
|
+
key: string;
|
19
|
+
type: string;
|
20
|
+
input: boolean;
|
21
|
+
}[];
|
22
|
+
}
|
23
|
+
export default _default;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = {
|
4
|
+
type: 'form',
|
5
|
+
display: 'form',
|
6
|
+
components: [
|
7
|
+
{
|
8
|
+
label: 'Select',
|
9
|
+
widget: 'choicesjs',
|
10
|
+
tableView: true,
|
11
|
+
data: {
|
12
|
+
values: [
|
13
|
+
{
|
14
|
+
label: 'Banana',
|
15
|
+
value: 'banana'
|
16
|
+
},
|
17
|
+
{
|
18
|
+
label: 'Apple',
|
19
|
+
value: 'apple'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
label: 'Pineapple',
|
23
|
+
value: 'pineapple'
|
24
|
+
}
|
25
|
+
]
|
26
|
+
},
|
27
|
+
validateOn: 'blur',
|
28
|
+
validate: {
|
29
|
+
custom: "valid = data.select == 'apple' ? true : 'You must select an apple';"
|
30
|
+
},
|
31
|
+
key: 'select',
|
32
|
+
type: 'select',
|
33
|
+
input: true
|
34
|
+
},
|
35
|
+
]
|
36
|
+
};
|
@@ -15,5 +15,6 @@ import comp15 from './comp15';
|
|
15
15
|
import comp16 from './comp16';
|
16
16
|
import comp17 from './comp17';
|
17
17
|
import comp18 from './comp18';
|
18
|
-
|
18
|
+
import comp19 from './comp19';
|
19
|
+
export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19 };
|
19
20
|
export { multiSelect, multiSelectOptions } from "./comp3";
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.comp18 = exports.comp17 = exports.comp16 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp2 = exports.comp1 = exports.multiSelectOptions = exports.multiSelect = void 0;
|
6
|
+
exports.comp19 = exports.comp18 = exports.comp17 = exports.comp16 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp2 = exports.comp1 = exports.multiSelectOptions = exports.multiSelect = void 0;
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
8
8
|
exports.comp1 = comp1_1.default;
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
@@ -41,3 +41,5 @@ const comp17_1 = __importDefault(require("./comp17"));
|
|
41
41
|
exports.comp17 = comp17_1.default;
|
42
42
|
const comp18_1 = __importDefault(require("./comp18"));
|
43
43
|
exports.comp18 = comp18_1.default;
|
44
|
+
const comp19_1 = __importDefault(require("./comp19"));
|
45
|
+
exports.comp19 = comp19_1.default;
|
@@ -9,8 +9,33 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
9
9
|
custom: string;
|
10
10
|
};
|
11
11
|
};
|
12
|
-
|
12
|
+
constructor: Function;
|
13
|
+
toString(): string;
|
14
|
+
toLocaleString(): string;
|
15
|
+
valueOf(): Object;
|
16
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
17
|
+
isPrototypeOf(v: Object): boolean;
|
18
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
13
19
|
};
|
20
|
+
static get conditionOperatorsSettings(): {
|
21
|
+
valueComponent(classComp: any): {
|
22
|
+
type: string;
|
23
|
+
dataSrc: string;
|
24
|
+
valueProperty: string;
|
25
|
+
valueType: string;
|
26
|
+
data: {
|
27
|
+
custom: string;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
constructor: Function;
|
31
|
+
toString(): string;
|
32
|
+
toLocaleString(): string;
|
33
|
+
valueOf(): Object;
|
34
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
35
|
+
isPrototypeOf(v: Object): boolean;
|
36
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
37
|
+
};
|
38
|
+
static savedValueTypes(schema: any): string[];
|
14
39
|
constructor(...args: any[]);
|
15
40
|
validators: string[];
|
16
41
|
get emptyValue(): any;
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
|
+
const utils_1 = require("../../utils/utils");
|
7
8
|
const Radio_1 = __importDefault(require("../radio/Radio"));
|
8
9
|
class SelectBoxesComponent extends Radio_1.default {
|
9
10
|
static schema(...extend) {
|
@@ -25,7 +26,10 @@ class SelectBoxesComponent extends Radio_1.default {
|
|
25
26
|
};
|
26
27
|
}
|
27
28
|
static get serverConditionSettings() {
|
28
|
-
return
|
29
|
+
return SelectBoxesComponent.conditionOperatorsSettings;
|
30
|
+
}
|
31
|
+
static get conditionOperatorsSettings() {
|
32
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
|
29
33
|
return {
|
30
34
|
type: 'select',
|
31
35
|
dataSrc: 'custom',
|
@@ -37,6 +41,9 @@ class SelectBoxesComponent extends Radio_1.default {
|
|
37
41
|
};
|
38
42
|
} });
|
39
43
|
}
|
44
|
+
static savedValueTypes(schema) {
|
45
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
|
46
|
+
}
|
40
47
|
constructor(...args) {
|
41
48
|
super(...args);
|
42
49
|
this.validators = this.validators.concat('minSelectedCount', 'maxSelectedCount', 'availableValueProperty');
|
@@ -7,6 +7,27 @@ export default class SignatureComponent extends Input {
|
|
7
7
|
documentation: string;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get serverConditionSettings(): {
|
11
|
+
operators: string[];
|
12
|
+
constructor: Function;
|
13
|
+
toString(): string;
|
14
|
+
toLocaleString(): string;
|
15
|
+
valueOf(): Object;
|
16
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
17
|
+
isPrototypeOf(v: Object): boolean;
|
18
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
19
|
+
};
|
20
|
+
static get conditionOperatorsSettings(): {
|
21
|
+
operators: string[];
|
22
|
+
constructor: Function;
|
23
|
+
toString(): string;
|
24
|
+
toLocaleString(): string;
|
25
|
+
valueOf(): Object;
|
26
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
27
|
+
isPrototypeOf(v: Object): boolean;
|
28
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
29
|
+
};
|
30
|
+
static savedValueTypes(schema: any): string[];
|
10
31
|
currentWidth: any;
|
11
32
|
scale: any;
|
12
33
|
ratio: number | undefined;
|