@formio/js 5.0.0-rc.20 → 5.0.0-rc.21
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/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 +57 -35
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +58 -36
- 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/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 +8 -10
- 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 +3 -0
- 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 +37 -3
- 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 +9 -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/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 +12 -14
- 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 +4 -1
- 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 +39 -5
- 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 +10 -2
- 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
|
@@ -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);
|
|
@@ -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;
|
|
@@ -59,10 +59,31 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
static get serverConditionSettings() {
|
|
62
|
-
return
|
|
62
|
+
return SelectComponent.conditionOperatorsSettings;
|
|
63
|
+
}
|
|
64
|
+
static get conditionOperatorsSettings() {
|
|
65
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {
|
|
63
66
|
return Object.assign(Object.assign({}, classComp), { type: 'select' });
|
|
64
67
|
} });
|
|
65
68
|
}
|
|
69
|
+
static savedValueTypes(schema) {
|
|
70
|
+
const { boolean, string, number, object, array } = utils_1.componentValueTypes;
|
|
71
|
+
const { dataType, reference } = schema;
|
|
72
|
+
const types = (0, utils_1.getComponentSavedTypes)(schema);
|
|
73
|
+
if (types) {
|
|
74
|
+
return types;
|
|
75
|
+
}
|
|
76
|
+
if (reference) {
|
|
77
|
+
return [object];
|
|
78
|
+
}
|
|
79
|
+
if (dataType === 'object') {
|
|
80
|
+
return [object, array];
|
|
81
|
+
}
|
|
82
|
+
if (utils_1.componentValueTypes[dataType]) {
|
|
83
|
+
return [utils_1.componentValueTypes[dataType]];
|
|
84
|
+
}
|
|
85
|
+
return [boolean, string, number, object, array];
|
|
86
|
+
}
|
|
66
87
|
init() {
|
|
67
88
|
super.init();
|
|
68
89
|
this.templateData = {};
|
|
@@ -174,6 +195,15 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
174
195
|
get shouldDisabled() {
|
|
175
196
|
return super.shouldDisabled || this.parentDisabled;
|
|
176
197
|
}
|
|
198
|
+
get shouldInitialLoad() {
|
|
199
|
+
if (this.component.widget === 'html5' &&
|
|
200
|
+
this.isEntireObjectDisplay() &&
|
|
201
|
+
this.component.searchField &&
|
|
202
|
+
this.dataValue) {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
return super.shouldLoad;
|
|
206
|
+
}
|
|
177
207
|
isEntireObjectDisplay() {
|
|
178
208
|
return this.component.dataSrc === 'resource' && this.valueProperty === 'data';
|
|
179
209
|
}
|
|
@@ -482,7 +512,11 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
482
512
|
});
|
|
483
513
|
// Add search capability.
|
|
484
514
|
if (this.component.searchField && search) {
|
|
485
|
-
const searchValue = Array.isArray(search)
|
|
515
|
+
const searchValue = Array.isArray(search)
|
|
516
|
+
? search.join(',')
|
|
517
|
+
: typeof search === 'object'
|
|
518
|
+
? JSON.stringify(search)
|
|
519
|
+
: search;
|
|
486
520
|
query[this.component.searchField] = this.component.searchField.endsWith('__regex')
|
|
487
521
|
? lodash_1.default.escapeRegExp(searchValue)
|
|
488
522
|
: searchValue;
|
|
@@ -1167,7 +1201,7 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
1167
1201
|
!this.active &&
|
|
1168
1202
|
!this.selectOptions.length &&
|
|
1169
1203
|
hasValue &&
|
|
1170
|
-
this.
|
|
1204
|
+
this.shouldInitialLoad &&
|
|
1171
1205
|
this.visible && (this.component.searchField || this.component.valueProperty);
|
|
1172
1206
|
}
|
|
1173
1207
|
setChoicesValue(value, hasPreviousValue, flags = {}) {
|
|
@@ -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;
|
|
@@ -7,6 +7,7 @@ const signature_pad_1 = __importDefault(require("signature_pad"));
|
|
|
7
7
|
const resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
|
|
8
8
|
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
+
const utils_1 = require("../../utils/utils");
|
|
10
11
|
class SignatureComponent extends Input_1.default {
|
|
11
12
|
static schema(...extend) {
|
|
12
13
|
return Input_1.default.schema({
|
|
@@ -34,7 +35,14 @@ class SignatureComponent extends Input_1.default {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
static get serverConditionSettings() {
|
|
37
|
-
return
|
|
38
|
+
return SignatureComponent.conditionOperatorsSettings;
|
|
39
|
+
}
|
|
40
|
+
static get conditionOperatorsSettings() {
|
|
41
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
|
|
42
|
+
}
|
|
43
|
+
static savedValueTypes(schema) {
|
|
44
|
+
schema = schema || {};
|
|
45
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.string];
|
|
38
46
|
}
|
|
39
47
|
init() {
|
|
40
48
|
var _a, _b, _c, _d, _e;
|
|
@@ -7,6 +7,27 @@ export default class SurveyComponent extends Field {
|
|
|
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
|
render(): any;
|
|
11
32
|
setValue(value: any, flags?: {}): boolean;
|
|
12
33
|
get emptyValue(): {};
|
|
@@ -27,7 +27,13 @@ class SurveyComponent extends Field_1.default {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
static get serverConditionSettings() {
|
|
30
|
-
return
|
|
30
|
+
return SurveyComponent.conditionOperatorsSettings;
|
|
31
|
+
}
|
|
32
|
+
static get conditionOperatorsSettings() {
|
|
33
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
|
|
34
|
+
}
|
|
35
|
+
static savedValueTypes(schema) {
|
|
36
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
|
|
31
37
|
}
|
|
32
38
|
get defaultSchema() {
|
|
33
39
|
return SurveyComponent.schema();
|
|
@@ -7,6 +7,27 @@ export default class TagsComponent extends Input {
|
|
|
7
7
|
weight: number;
|
|
8
8
|
schema: any;
|
|
9
9
|
};
|
|
10
|
+
static get serverConditionSettings(): {
|
|
11
|
+
operators: any[];
|
|
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: 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[];
|
|
10
31
|
get emptyValue(): "" | never[];
|
|
11
32
|
get delimiter(): any;
|
|
12
33
|
attachElement(element: any, index: any): void;
|
|
@@ -3,6 +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
|
+
const utils_1 = require("../../utils/utils");
|
|
6
7
|
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
|
7
8
|
const choices_js_1 = __importDefault(require("@formio/choices.js"));
|
|
8
9
|
class TagsComponent extends Input_1.default {
|
|
@@ -27,7 +28,14 @@ class TagsComponent extends Input_1.default {
|
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
static get serverConditionSettings() {
|
|
30
|
-
return
|
|
31
|
+
return TagsComponent.conditionOperatorsSettings;
|
|
32
|
+
}
|
|
33
|
+
static get conditionOperatorsSettings() {
|
|
34
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: [...super.conditionOperatorsSettings.operators, 'includes', 'notIncludes'] });
|
|
35
|
+
}
|
|
36
|
+
static savedValueTypes(schema) {
|
|
37
|
+
schema = schema || {};
|
|
38
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes[schema.storeas] || utils_1.componentValueTypes.string];
|
|
31
39
|
}
|
|
32
40
|
init() {
|
|
33
41
|
super.init();
|
|
@@ -7,6 +7,27 @@ export default class TextFieldComponent extends Input {
|
|
|
7
7
|
weight: number;
|
|
8
8
|
schema: any;
|
|
9
9
|
};
|
|
10
|
+
static get serverConditionSettings(): {
|
|
11
|
+
operators: any[];
|
|
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: 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): string[];
|
|
10
31
|
get emptyValue(): string;
|
|
11
32
|
/**
|
|
12
33
|
* Returns the mask value object.
|