@formio/js 5.2.0-rc.2 → 5.3.0-rc.2
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.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +12 -12
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +12 -12
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +5 -5
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +3 -3
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +0 -1
- package/lib/cjs/components/_classes/component/Component.js +6 -3
- package/lib/cjs/components/button/Button.d.ts +1 -1
- package/lib/cjs/components/button/Button.js +6 -10
- package/lib/cjs/components/datagrid/DataGrid.js +4 -0
- package/lib/cjs/components/file/File.js +4 -5
- package/lib/cjs/components/form/Form.js +13 -1
- package/lib/cjs/providers/storage/uploadAdapter.js +2 -2
- package/lib/cjs/templates/index.d.ts +1 -1
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +0 -1
- package/lib/mjs/components/_classes/component/Component.js +6 -3
- package/lib/mjs/components/button/Button.d.ts +1 -1
- package/lib/mjs/components/button/Button.js +6 -9
- package/lib/mjs/components/datagrid/DataGrid.js +5 -1
- package/lib/mjs/components/file/File.js +4 -5
- package/lib/mjs/components/form/Form.js +12 -1
- package/lib/mjs/providers/storage/uploadAdapter.js +2 -2
- package/lib/mjs/templates/index.d.ts +1 -1
- package/package.json +3 -3
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */
|
22
22
|
|
23
|
-
/*! formiojs v5.
|
23
|
+
/*! formiojs v5.3.0-rc.2 | https://unpkg.com/formiojs@5.3.0-rc.2/LICENSE.txt */
|
24
24
|
|
25
25
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
26
26
|
|
package/lib/cjs/Embed.js
CHANGED
@@ -418,7 +418,7 @@ Formio.formioReady = new Promise((ready, reject) => {
|
|
418
418
|
_a._formioReady = ready;
|
419
419
|
_a._formioReadyReject = reject;
|
420
420
|
});
|
421
|
-
Formio.version = '5.
|
421
|
+
Formio.version = '5.3.0-rc.2';
|
422
422
|
// Create a report.
|
423
423
|
Formio.Report = {
|
424
424
|
create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
package/lib/cjs/Formio.js
CHANGED
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
|
|
11
11
|
const providers_1 = __importDefault(require("./providers"));
|
12
12
|
sdk_1.Formio.cdn = new CDN_1.default();
|
13
13
|
sdk_1.Formio.Providers = providers_1.default;
|
14
|
-
sdk_1.Formio.version = '5.
|
14
|
+
sdk_1.Formio.version = '5.3.0-rc.2';
|
15
15
|
CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
|
16
16
|
const isNil = (val) => val === null || val === undefined;
|
17
17
|
sdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
|
@@ -165,7 +165,6 @@ declare class Component extends Element {
|
|
165
165
|
get componentsMap(): object;
|
166
166
|
/**
|
167
167
|
* Returns if the parent should conditionally clear.
|
168
|
-
*
|
169
168
|
* @returns {boolean} - If the parent should conditionally clear.
|
170
169
|
*/
|
171
170
|
parentShouldConditionallyClear(): boolean;
|
@@ -460,7 +460,6 @@ class Component extends Element_1.default {
|
|
460
460
|
}
|
461
461
|
/**
|
462
462
|
* Returns if the parent should conditionally clear.
|
463
|
-
*
|
464
463
|
* @returns {boolean} - If the parent should conditionally clear.
|
465
464
|
*/
|
466
465
|
parentShouldConditionallyClear() {
|
@@ -2714,13 +2713,16 @@ class Component extends Element_1.default {
|
|
2714
2713
|
}
|
2715
2714
|
const isArray = Array.isArray(value);
|
2716
2715
|
const valueInput = this.refs.fileLink || this.refs.input;
|
2716
|
+
const isFilelink = !!this.refs.fileLink;
|
2717
2717
|
if (isArray &&
|
2718
2718
|
Array.isArray(this.defaultValue) &&
|
2719
2719
|
this.refs.hasOwnProperty('input') &&
|
2720
2720
|
valueInput &&
|
2721
2721
|
(valueInput.length !== value.length) &&
|
2722
2722
|
this.visible) {
|
2723
|
-
|
2723
|
+
if (isFilelink || valueInput.length) {
|
2724
|
+
this.redraw();
|
2725
|
+
}
|
2724
2726
|
}
|
2725
2727
|
if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
|
2726
2728
|
this.redraw();
|
@@ -2919,7 +2921,8 @@ class Component extends Element_1.default {
|
|
2919
2921
|
if ((this.options.readOnly && !this.options.pdf && !this.component.calculateValue) ||
|
2920
2922
|
!(this.component.calculateValue || this.component.calculateValueVariable) ||
|
2921
2923
|
(this.options.server && !this.component.calculateServer) ||
|
2922
|
-
(flags.dataSourceInitialLoading && allowOverride)
|
2924
|
+
(flags.dataSourceInitialLoading && allowOverride) ||
|
2925
|
+
(this.options.readOnly && this.options.pdf && allowOverride && lodash_1.default.get(this.root, 'submission._id', false))) {
|
2923
2926
|
return false;
|
2924
2927
|
}
|
2925
2928
|
const dataValue = this.dataValue;
|
@@ -9,7 +9,7 @@ export default class ButtonComponent extends Field {
|
|
9
9
|
};
|
10
10
|
static savedValueTypes(schema: any): string[];
|
11
11
|
constructor(component: any, options: any, data: any);
|
12
|
-
filesUploading:
|
12
|
+
filesUploading: number;
|
13
13
|
get inputInfo(): any;
|
14
14
|
get labelInfo(): {
|
15
15
|
hidden: boolean;
|
@@ -39,7 +39,7 @@ class ButtonComponent extends Field_1.default {
|
|
39
39
|
}
|
40
40
|
constructor(component, options, data) {
|
41
41
|
super(component, options, data);
|
42
|
-
this.filesUploading =
|
42
|
+
this.filesUploading = 0;
|
43
43
|
}
|
44
44
|
get defaultSchema() {
|
45
45
|
return ButtonComponent.schema();
|
@@ -147,16 +147,13 @@ class ButtonComponent extends Field_1.default {
|
|
147
147
|
this.addClass(this.refs.buttonMessageContainer, 'has-error');
|
148
148
|
this.setContent(this.refs.buttonMessage, resultMessage);
|
149
149
|
}, true);
|
150
|
-
this.on('fileUploadingStart', (
|
151
|
-
this.filesUploading
|
150
|
+
this.on('fileUploadingStart', () => {
|
151
|
+
this.filesUploading++;
|
152
152
|
this.disabled = true;
|
153
153
|
this.setDisabled(this.refs.button, this.disabled);
|
154
154
|
}, true);
|
155
|
-
this.on('fileUploadingEnd', (
|
156
|
-
|
157
|
-
if (index !== -1) {
|
158
|
-
this.filesUploading.splice(index, 1);
|
159
|
-
}
|
155
|
+
this.on('fileUploadingEnd', () => {
|
156
|
+
this.filesUploading--;
|
160
157
|
this.disabled = this.shouldDisabled ? true : false;
|
161
158
|
this.setDisabled(this.refs.button, this.disabled);
|
162
159
|
}, true);
|
@@ -252,8 +249,7 @@ class ButtonComponent extends Field_1.default {
|
|
252
249
|
}
|
253
250
|
}
|
254
251
|
get shouldDisabled() {
|
255
|
-
|
256
|
-
return super.shouldDisabled || !!((_a = this.filesUploading) === null || _a === void 0 ? void 0 : _a.length) || this.isDisabledOnInvalid;
|
252
|
+
return super.shouldDisabled || this.filesUploading > 0 || this.isDisabledOnInvalid;
|
257
253
|
}
|
258
254
|
attach(element) {
|
259
255
|
this.loadRefs(element, {
|
@@ -492,6 +492,10 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
492
492
|
options.row = `${rowIndex}-${colIndex}`;
|
493
493
|
options.rowIndex = rowIndex;
|
494
494
|
options.onChange = (flags, changed, modified) => {
|
495
|
+
if (changed.component.type === 'form') {
|
496
|
+
const formComp = (0, utils_1.getComponent)(this.component.components, changed.component.key);
|
497
|
+
lodash_1.default.set(formComp, 'components', changed.component.components);
|
498
|
+
}
|
495
499
|
this.triggerChange({ modified });
|
496
500
|
};
|
497
501
|
let columnComponent;
|
@@ -905,17 +905,16 @@ class FileComponent extends Field_1.default {
|
|
905
905
|
}
|
906
906
|
uploadFile(fileToSync) {
|
907
907
|
return __awaiter(this, void 0, void 0, function* () {
|
908
|
-
|
908
|
+
return yield this.fileService.uploadFile(fileToSync.storage, fileToSync.file, fileToSync.name, fileToSync.dir,
|
909
909
|
// Progress callback
|
910
910
|
this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => {
|
911
|
-
this.emit('fileUploadingStart'
|
911
|
+
this.emit('fileUploadingStart');
|
912
912
|
},
|
913
913
|
// Abort upload callback
|
914
914
|
(abort) => this.abortUploads.push({
|
915
915
|
id: fileToSync.id,
|
916
916
|
abort,
|
917
917
|
}), this.getMultipartOptions(fileToSync));
|
918
|
-
return yield filePromise;
|
919
918
|
});
|
920
919
|
}
|
921
920
|
upload() {
|
@@ -937,7 +936,7 @@ class FileComponent extends Field_1.default {
|
|
937
936
|
fileToSync.message = this.t('succefullyUploaded');
|
938
937
|
fileInfo.originalName = fileToSync.originalName;
|
939
938
|
fileInfo.hash = fileToSync.hash;
|
940
|
-
this.emit('fileUploadingEnd'
|
939
|
+
this.emit('fileUploadingEnd');
|
941
940
|
}
|
942
941
|
catch (response) {
|
943
942
|
fileToSync.status = 'error';
|
@@ -947,7 +946,7 @@ class FileComponent extends Field_1.default {
|
|
947
946
|
: response.type === 'abort'
|
948
947
|
? this.t('Request was aborted')
|
949
948
|
: response.toString();
|
950
|
-
this.emit('fileUploadingEnd'
|
949
|
+
this.emit('fileUploadingEnd');
|
951
950
|
this.emit('fileUploadError', {
|
952
951
|
fileToSync,
|
953
952
|
response,
|
@@ -278,6 +278,9 @@ class FormComponent extends Component_1.default {
|
|
278
278
|
if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
|
279
279
|
this.createSubForm(true);
|
280
280
|
}
|
281
|
+
if (!this.subFormReady) {
|
282
|
+
return Promise.resolve();
|
283
|
+
}
|
281
284
|
return this.subFormReady.then(() => {
|
282
285
|
this.empty(element);
|
283
286
|
if (this.options.builder) {
|
@@ -408,13 +411,15 @@ class FormComponent extends Component_1.default {
|
|
408
411
|
}
|
409
412
|
// Render the form.
|
410
413
|
return (new Form_1.default(form, this.getSubOptions())).ready.then((instance) => {
|
414
|
+
var _a, _b;
|
411
415
|
this.subForm = instance;
|
412
416
|
this.subForm.currentForm = this;
|
413
417
|
this.subForm.parentVisible = this.visible;
|
414
418
|
const componentsMap = this.componentsMap;
|
415
419
|
const formComponentsMap = this.subForm.componentsMap;
|
416
420
|
lodash_1.default.assign(componentsMap, formComponentsMap);
|
417
|
-
this.component.components = this.subForm.
|
421
|
+
this.component.components = (_a = this.subForm._form) === null || _a === void 0 ? void 0 : _a.components;
|
422
|
+
this.component.display = (_b = this.subForm._form) === null || _b === void 0 ? void 0 : _b.display;
|
418
423
|
this.subForm.on('change', () => {
|
419
424
|
if (this.subForm && !this.shouldConditionallyClear()) {
|
420
425
|
this.dataValue = this.subForm.getValue();
|
@@ -699,6 +704,13 @@ class FormComponent extends Component_1.default {
|
|
699
704
|
}
|
700
705
|
return errors;
|
701
706
|
}
|
707
|
+
conditionallyHidden() {
|
708
|
+
const conditionallyHidden = super.conditionallyHidden();
|
709
|
+
if (this.subForm) {
|
710
|
+
this.subForm._conditionallyHidden = conditionallyHidden;
|
711
|
+
}
|
712
|
+
return conditionallyHidden;
|
713
|
+
}
|
702
714
|
updateSubFormVisibility() {
|
703
715
|
if (this.subForm) {
|
704
716
|
this.subForm.parentVisible = this.visible;
|
@@ -27,7 +27,7 @@ class FormioUploadAdapter {
|
|
27
27
|
null,
|
28
28
|
null
|
29
29
|
];
|
30
|
-
|
30
|
+
this.fileService.uploadFile(...uploadParams, () => this.component.emit('fileUploadingStart')).then((result) => {
|
31
31
|
return this.fileService.downloadFile(result);
|
32
32
|
}).then((result) => {
|
33
33
|
return resolve({
|
@@ -37,7 +37,7 @@ class FormioUploadAdapter {
|
|
37
37
|
console.warn('An Error occured while uploading file', err);
|
38
38
|
reject(err);
|
39
39
|
}).finally(() => {
|
40
|
-
this.component.emit('fileUploadingEnd'
|
40
|
+
this.component.emit('fileUploadingEnd');
|
41
41
|
});
|
42
42
|
}));
|
43
43
|
}
|
@@ -37,7 +37,7 @@ declare namespace _default {
|
|
37
37
|
};
|
38
38
|
transform(type: any, text: any, instance: any): any;
|
39
39
|
defaultIconset: string;
|
40
|
-
iconClass: (iconset:
|
40
|
+
iconClass: (iconset: "fa" | "bi", name: string, spinning: boolean) => string;
|
41
41
|
cssClasses: {
|
42
42
|
'border-default': string;
|
43
43
|
'formio-tab-panel-active': string;
|
package/lib/mjs/Embed.js
CHANGED
@@ -14,7 +14,7 @@ export class Formio {
|
|
14
14
|
Formio._formioReady = ready;
|
15
15
|
Formio._formioReadyReject = reject;
|
16
16
|
});
|
17
|
-
static version = '5.
|
17
|
+
static version = '5.3.0-rc.2';
|
18
18
|
static setLicense(license, norecurse = false) {
|
19
19
|
Formio.license = license;
|
20
20
|
if (!norecurse && Formio.FormioClass) {
|
package/lib/mjs/Formio.js
CHANGED
@@ -4,7 +4,7 @@ import CDN from './CDN';
|
|
4
4
|
import Providers from './providers';
|
5
5
|
FormioCore.cdn = new CDN();
|
6
6
|
FormioCore.Providers = Providers;
|
7
|
-
FormioCore.version = '5.
|
7
|
+
FormioCore.version = '5.3.0-rc.2';
|
8
8
|
CDN.defaultCDN = FormioCore.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
|
9
9
|
const isNil = (val) => val === null || val === undefined;
|
10
10
|
FormioCore.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
|
@@ -165,7 +165,6 @@ declare class Component extends Element {
|
|
165
165
|
get componentsMap(): object;
|
166
166
|
/**
|
167
167
|
* Returns if the parent should conditionally clear.
|
168
|
-
*
|
169
168
|
* @returns {boolean} - If the parent should conditionally clear.
|
170
169
|
*/
|
171
170
|
parentShouldConditionallyClear(): boolean;
|
@@ -424,7 +424,6 @@ export default class Component extends Element {
|
|
424
424
|
}
|
425
425
|
/**
|
426
426
|
* Returns if the parent should conditionally clear.
|
427
|
-
*
|
428
427
|
* @returns {boolean} - If the parent should conditionally clear.
|
429
428
|
*/
|
430
429
|
parentShouldConditionallyClear() {
|
@@ -2683,13 +2682,16 @@ export default class Component extends Element {
|
|
2683
2682
|
}
|
2684
2683
|
const isArray = Array.isArray(value);
|
2685
2684
|
const valueInput = this.refs.fileLink || this.refs.input;
|
2685
|
+
const isFilelink = !!this.refs.fileLink;
|
2686
2686
|
if (isArray &&
|
2687
2687
|
Array.isArray(this.defaultValue) &&
|
2688
2688
|
this.refs.hasOwnProperty('input') &&
|
2689
2689
|
valueInput &&
|
2690
2690
|
(valueInput.length !== value.length) &&
|
2691
2691
|
this.visible) {
|
2692
|
-
|
2692
|
+
if (isFilelink || valueInput.length) {
|
2693
|
+
this.redraw();
|
2694
|
+
}
|
2693
2695
|
}
|
2694
2696
|
if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
|
2695
2697
|
this.redraw();
|
@@ -2887,7 +2889,8 @@ export default class Component extends Element {
|
|
2887
2889
|
if ((this.options.readOnly && !this.options.pdf && !this.component.calculateValue) ||
|
2888
2890
|
!(this.component.calculateValue || this.component.calculateValueVariable) ||
|
2889
2891
|
(this.options.server && !this.component.calculateServer) ||
|
2890
|
-
(flags.dataSourceInitialLoading && allowOverride)
|
2892
|
+
(flags.dataSourceInitialLoading && allowOverride) ||
|
2893
|
+
(this.options.readOnly && this.options.pdf && allowOverride && _.get(this.root, 'submission._id', false))) {
|
2891
2894
|
return false;
|
2892
2895
|
}
|
2893
2896
|
const dataValue = this.dataValue;
|
@@ -9,7 +9,7 @@ export default class ButtonComponent extends Field {
|
|
9
9
|
};
|
10
10
|
static savedValueTypes(schema: any): string[];
|
11
11
|
constructor(component: any, options: any, data: any);
|
12
|
-
filesUploading:
|
12
|
+
filesUploading: number;
|
13
13
|
get inputInfo(): any;
|
14
14
|
get labelInfo(): {
|
15
15
|
hidden: boolean;
|
@@ -34,7 +34,7 @@ export default class ButtonComponent extends Field {
|
|
34
34
|
}
|
35
35
|
constructor(component, options, data) {
|
36
36
|
super(component, options, data);
|
37
|
-
this.filesUploading =
|
37
|
+
this.filesUploading = 0;
|
38
38
|
}
|
39
39
|
get defaultSchema() {
|
40
40
|
return ButtonComponent.schema();
|
@@ -142,16 +142,13 @@ export default class ButtonComponent extends Field {
|
|
142
142
|
this.addClass(this.refs.buttonMessageContainer, 'has-error');
|
143
143
|
this.setContent(this.refs.buttonMessage, resultMessage);
|
144
144
|
}, true);
|
145
|
-
this.on('fileUploadingStart', (
|
146
|
-
this.filesUploading
|
145
|
+
this.on('fileUploadingStart', () => {
|
146
|
+
this.filesUploading++;
|
147
147
|
this.disabled = true;
|
148
148
|
this.setDisabled(this.refs.button, this.disabled);
|
149
149
|
}, true);
|
150
|
-
this.on('fileUploadingEnd', (
|
151
|
-
|
152
|
-
if (index !== -1) {
|
153
|
-
this.filesUploading.splice(index, 1);
|
154
|
-
}
|
150
|
+
this.on('fileUploadingEnd', () => {
|
151
|
+
this.filesUploading--;
|
155
152
|
this.disabled = this.shouldDisabled ? true : false;
|
156
153
|
this.setDisabled(this.refs.button, this.disabled);
|
157
154
|
}, true);
|
@@ -247,7 +244,7 @@ export default class ButtonComponent extends Field {
|
|
247
244
|
}
|
248
245
|
}
|
249
246
|
get shouldDisabled() {
|
250
|
-
return super.shouldDisabled ||
|
247
|
+
return super.shouldDisabled || this.filesUploading > 0 || this.isDisabledOnInvalid;
|
251
248
|
}
|
252
249
|
attach(element) {
|
253
250
|
this.loadRefs(element, {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
|
3
|
-
import { fastCloneDeep, getFocusableElements } from '../../utils/utils';
|
3
|
+
import { fastCloneDeep, getFocusableElements, getComponent } from '../../utils/utils';
|
4
4
|
export default class DataGridComponent extends NestedArrayComponent {
|
5
5
|
static schema(...extend) {
|
6
6
|
return NestedArrayComponent.schema({
|
@@ -488,6 +488,10 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
488
488
|
options.row = `${rowIndex}-${colIndex}`;
|
489
489
|
options.rowIndex = rowIndex;
|
490
490
|
options.onChange = (flags, changed, modified) => {
|
491
|
+
if (changed.component.type === 'form') {
|
492
|
+
const formComp = getComponent(this.component.components, changed.component.key);
|
493
|
+
_.set(formComp, 'components', changed.component.components);
|
494
|
+
}
|
491
495
|
this.triggerChange({ modified });
|
492
496
|
};
|
493
497
|
let columnComponent;
|
@@ -903,17 +903,16 @@ export default class FileComponent extends Field {
|
|
903
903
|
} : false;
|
904
904
|
}
|
905
905
|
async uploadFile(fileToSync) {
|
906
|
-
|
906
|
+
return await this.fileService.uploadFile(fileToSync.storage, fileToSync.file, fileToSync.name, fileToSync.dir,
|
907
907
|
// Progress callback
|
908
908
|
this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => {
|
909
|
-
this.emit('fileUploadingStart'
|
909
|
+
this.emit('fileUploadingStart');
|
910
910
|
},
|
911
911
|
// Abort upload callback
|
912
912
|
(abort) => this.abortUploads.push({
|
913
913
|
id: fileToSync.id,
|
914
914
|
abort,
|
915
915
|
}), this.getMultipartOptions(fileToSync));
|
916
|
-
return await filePromise;
|
917
916
|
}
|
918
917
|
async upload() {
|
919
918
|
if (!this.filesToSync.filesToUpload.length) {
|
@@ -933,7 +932,7 @@ export default class FileComponent extends Field {
|
|
933
932
|
fileToSync.message = this.t('succefullyUploaded');
|
934
933
|
fileInfo.originalName = fileToSync.originalName;
|
935
934
|
fileInfo.hash = fileToSync.hash;
|
936
|
-
this.emit('fileUploadingEnd'
|
935
|
+
this.emit('fileUploadingEnd');
|
937
936
|
}
|
938
937
|
catch (response) {
|
939
938
|
fileToSync.status = 'error';
|
@@ -943,7 +942,7 @@ export default class FileComponent extends Field {
|
|
943
942
|
: response.type === 'abort'
|
944
943
|
? this.t('Request was aborted')
|
945
944
|
: response.toString();
|
946
|
-
this.emit('fileUploadingEnd'
|
945
|
+
this.emit('fileUploadingEnd');
|
947
946
|
this.emit('fileUploadError', {
|
948
947
|
fileToSync,
|
949
948
|
response,
|
@@ -274,6 +274,9 @@ export default class FormComponent extends Component {
|
|
274
274
|
if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
|
275
275
|
this.createSubForm(true);
|
276
276
|
}
|
277
|
+
if (!this.subFormReady) {
|
278
|
+
return Promise.resolve();
|
279
|
+
}
|
277
280
|
return this.subFormReady.then(() => {
|
278
281
|
this.empty(element);
|
279
282
|
if (this.options.builder) {
|
@@ -408,7 +411,8 @@ export default class FormComponent extends Component {
|
|
408
411
|
const componentsMap = this.componentsMap;
|
409
412
|
const formComponentsMap = this.subForm.componentsMap;
|
410
413
|
_.assign(componentsMap, formComponentsMap);
|
411
|
-
this.component.components = this.subForm.components
|
414
|
+
this.component.components = this.subForm._form?.components;
|
415
|
+
this.component.display = this.subForm._form?.display;
|
412
416
|
this.subForm.on('change', () => {
|
413
417
|
if (this.subForm && !this.shouldConditionallyClear()) {
|
414
418
|
this.dataValue = this.subForm.getValue();
|
@@ -688,6 +692,13 @@ export default class FormComponent extends Component {
|
|
688
692
|
}
|
689
693
|
return errors;
|
690
694
|
}
|
695
|
+
conditionallyHidden() {
|
696
|
+
const conditionallyHidden = super.conditionallyHidden();
|
697
|
+
if (this.subForm) {
|
698
|
+
this.subForm._conditionallyHidden = conditionallyHidden;
|
699
|
+
}
|
700
|
+
return conditionallyHidden;
|
701
|
+
}
|
691
702
|
updateSubFormVisibility() {
|
692
703
|
if (this.subForm) {
|
693
704
|
this.subForm.parentVisible = this.visible;
|
@@ -24,7 +24,7 @@ class FormioUploadAdapter {
|
|
24
24
|
null,
|
25
25
|
null
|
26
26
|
];
|
27
|
-
|
27
|
+
this.fileService.uploadFile(...uploadParams, () => this.component.emit('fileUploadingStart')).then((result) => {
|
28
28
|
return this.fileService.downloadFile(result);
|
29
29
|
}).then((result) => {
|
30
30
|
return resolve({
|
@@ -34,7 +34,7 @@ class FormioUploadAdapter {
|
|
34
34
|
console.warn('An Error occured while uploading file', err);
|
35
35
|
reject(err);
|
36
36
|
}).finally(() => {
|
37
|
-
this.component.emit('fileUploadingEnd'
|
37
|
+
this.component.emit('fileUploadingEnd');
|
38
38
|
});
|
39
39
|
}));
|
40
40
|
}
|
@@ -37,7 +37,7 @@ declare namespace _default {
|
|
37
37
|
};
|
38
38
|
transform(type: any, text: any, instance: any): any;
|
39
39
|
defaultIconset: string;
|
40
|
-
iconClass: (iconset:
|
40
|
+
iconClass: (iconset: "fa" | "bi", name: string, spinning: boolean) => string;
|
41
41
|
cssClasses: {
|
42
42
|
'border-default': string;
|
43
43
|
'formio-tab-panel-active': string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.3.0-rc.2",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -80,8 +80,8 @@
|
|
80
80
|
},
|
81
81
|
"homepage": "https://github.com/formio/formio.js#readme",
|
82
82
|
"dependencies": {
|
83
|
-
"@formio/bootstrap": "v3.2.0-rc.
|
84
|
-
"@formio/core": "v2.
|
83
|
+
"@formio/bootstrap": "v3.2.0-rc.2",
|
84
|
+
"@formio/core": "v2.6.0-rc.2",
|
85
85
|
"@formio/text-mask-addons": "3.8.0-formio.4",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|