@formio/js 5.5.2 → 5.6.1
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/README.md +2 -2
- package/dist/formio.builder.css +3 -0
- package/dist/formio.builder.min.css +1 -1
- 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.css +3 -0
- package/dist/formio.form.js +29 -29
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.css +3 -0
- package/dist/formio.full.js +31 -31
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +14 -14
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +12 -12
- 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/Components.js +1 -5
- package/lib/cjs/components/_classes/component/Component.d.ts +14 -0
- package/lib/cjs/components/_classes/component/Component.js +35 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +6 -8
- package/lib/cjs/components/address/Address.js +5 -2
- package/lib/cjs/components/address/editForm/Address.edit.provider.d.ts +24 -0
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +13 -0
- package/lib/cjs/components/datagrid/DataGrid.js +4 -7
- package/lib/cjs/components/file/File.js +17 -8
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +44 -0
- package/lib/cjs/components/file/editForm/File.edit.file.js +2 -1
- package/lib/cjs/components/form/Form.d.ts +7 -0
- package/lib/cjs/components/form/Form.js +24 -2
- package/lib/cjs/components/signature/Signature.js +2 -2
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +9 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.js +116 -32
- package/lib/cjs/utils/formUtils.d.ts +3 -0
- package/lib/cjs/utils/formUtils.js +5 -2
- package/lib/cjs/utils/index.d.ts +3 -0
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/components/Components.js +1 -5
- package/lib/mjs/components/_classes/component/Component.d.ts +14 -0
- package/lib/mjs/components/_classes/component/Component.js +34 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +6 -8
- package/lib/mjs/components/address/Address.js +5 -2
- package/lib/mjs/components/address/editForm/Address.edit.provider.d.ts +24 -0
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +13 -0
- package/lib/mjs/components/datagrid/DataGrid.js +4 -7
- package/lib/mjs/components/file/File.js +17 -8
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +44 -0
- package/lib/mjs/components/file/editForm/File.edit.file.js +2 -1
- package/lib/mjs/components/form/Form.d.ts +7 -0
- package/lib/mjs/components/form/Form.js +24 -2
- package/lib/mjs/components/signature/Signature.js +2 -2
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +9 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.js +94 -32
- package/lib/mjs/utils/formUtils.d.ts +3 -0
- package/lib/mjs/utils/formUtils.js +2 -2
- package/lib/mjs/utils/index.d.ts +3 -0
- package/package.json +7 -7
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */
|
|
22
22
|
|
|
23
|
-
/*! formiojs v5.
|
|
23
|
+
/*! formiojs v5.6.1 | https://unpkg.com/formiojs@5.6.1/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
|
@@ -500,7 +500,7 @@ Formio.formioReady = new Promise((ready, reject) => {
|
|
|
500
500
|
_a._formioReady = ready;
|
|
501
501
|
_a._formioReadyReject = reject;
|
|
502
502
|
});
|
|
503
|
-
Formio.version = '5.
|
|
503
|
+
Formio.version = '5.6.1';
|
|
504
504
|
// Create a report.
|
|
505
505
|
Formio.Report = {
|
|
506
506
|
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.6.1';
|
|
15
15
|
CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc')
|
|
16
16
|
? 'https://cdn.test-form.io'
|
|
17
17
|
: 'https://cdn.form.io';
|
|
@@ -68,11 +68,7 @@ class Components {
|
|
|
68
68
|
else {
|
|
69
69
|
comp = new Component_1.default(component, options, data);
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
comp.eachRootChildComponentsMap((map) => {
|
|
73
|
-
map[comp.path] = comp;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
71
|
+
comp.registerComponentInstance();
|
|
76
72
|
// Reset the componentMatches on the root element if any new component is created.
|
|
77
73
|
let parent = comp.parent;
|
|
78
74
|
while (parent) {
|
|
@@ -171,6 +171,20 @@ declare class Component extends Element {
|
|
|
171
171
|
* @param {(map: object) => void} fn - Called once per root that exposes a `childComponentsMap`.
|
|
172
172
|
*/
|
|
173
173
|
eachRootChildComponentsMap(fn: (map: object) => void): void;
|
|
174
|
+
/**
|
|
175
|
+
* Registers this instance in every root's `childComponentsMap`. Several components can resolve
|
|
176
|
+
* to one data path — see `getSharedPathKey` in `@formio/core` for the rule this follows.
|
|
177
|
+
* @returns {void}
|
|
178
|
+
*/
|
|
179
|
+
registerComponentInstance(): void;
|
|
180
|
+
sharedPathKey: string | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Removes this instance from every root's `childComponentsMap`.
|
|
183
|
+
* @param {string} [path] - The path this instance was registered under, when it has since
|
|
184
|
+
* been re-keyed (a DataGrid row index change regenerates paths before unregistering).
|
|
185
|
+
* @returns {void}
|
|
186
|
+
*/
|
|
187
|
+
unregisterComponentInstance(path?: string | undefined): void;
|
|
174
188
|
/**
|
|
175
189
|
* Returns if the parent should conditionally clear.
|
|
176
190
|
*
|
|
@@ -441,6 +441,39 @@ class Component extends Element_1.default {
|
|
|
441
441
|
currentRoot = currentRoot.root;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Registers this instance in every root's `childComponentsMap`. Several components can resolve
|
|
446
|
+
* to one data path — see `getSharedPathKey` in `@formio/core` for the rule this follows.
|
|
447
|
+
* @returns {void}
|
|
448
|
+
*/
|
|
449
|
+
registerComponentInstance() {
|
|
450
|
+
const path = this.path;
|
|
451
|
+
if (!path) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
// Recorded on every instance, not just the ones that lose the race for the path: it names
|
|
455
|
+
// this registration for `unregisterComponentInstance()`, which can run after `path` changed.
|
|
456
|
+
this.sharedPathKey = utils_1.default.getSharedPathKey(path, this.component.key);
|
|
457
|
+
this.eachRootChildComponentsMap((map) => {
|
|
458
|
+
utils_1.default.registerInstanceAtPath(map, path, this.component.key, this);
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Removes this instance from every root's `childComponentsMap`.
|
|
463
|
+
* @param {string} [path] - The path this instance was registered under, when it has since
|
|
464
|
+
* been re-keyed (a DataGrid row index change regenerates paths before unregistering).
|
|
465
|
+
* @returns {void}
|
|
466
|
+
*/
|
|
467
|
+
unregisterComponentInstance(path = this.path) {
|
|
468
|
+
this.eachRootChildComponentsMap((map) => {
|
|
469
|
+
if (map[path] === this) {
|
|
470
|
+
delete map[path];
|
|
471
|
+
}
|
|
472
|
+
if (this.sharedPathKey && map[this.sharedPathKey] === this) {
|
|
473
|
+
delete map[this.sharedPathKey];
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
444
477
|
/**
|
|
445
478
|
* Returns if the parent should conditionally clear.
|
|
446
479
|
*
|
|
@@ -925,11 +958,12 @@ class Component extends Element_1.default {
|
|
|
925
958
|
* @returns {string} - The translated text.
|
|
926
959
|
*/
|
|
927
960
|
t(text, params = {}, ...args) {
|
|
961
|
+
var _a;
|
|
928
962
|
if (!text) {
|
|
929
963
|
return '';
|
|
930
964
|
}
|
|
931
965
|
// Use _userInput: true to ignore translations from defaults
|
|
932
|
-
if (text in en_1.default && params._userInput) {
|
|
966
|
+
if (((_a = this.i18next) === null || _a === void 0 ? void 0 : _a.language) === 'en' && text in en_1.default && params._userInput) {
|
|
933
967
|
return text;
|
|
934
968
|
}
|
|
935
969
|
params.data = params.data || this.rootValue;
|
|
@@ -557,11 +557,7 @@ class NestedComponent extends Field_1.default {
|
|
|
557
557
|
components = components || this.components;
|
|
558
558
|
component.destroy(all);
|
|
559
559
|
lodash_1.default.remove(components, { id: component.id });
|
|
560
|
-
component.
|
|
561
|
-
if (map[component.path]) {
|
|
562
|
-
delete map[component.path];
|
|
563
|
-
}
|
|
564
|
-
});
|
|
560
|
+
component.unregisterComponentInstance();
|
|
565
561
|
}
|
|
566
562
|
/**
|
|
567
563
|
* Removes a component provided the API key of that component.
|
|
@@ -671,9 +667,11 @@ class NestedComponent extends Field_1.default {
|
|
|
671
667
|
var _a;
|
|
672
668
|
const { dirty } = flags;
|
|
673
669
|
if (this.root && this.root.hasSubWizards && this.page !== this.root.page) {
|
|
674
|
-
instance
|
|
675
|
-
|
|
676
|
-
|
|
670
|
+
// `instance` was resolved by @formio/core against this very map, shared-path rule and
|
|
671
|
+
// all, so only fill in what that lookup cannot reach: components keyed by their data
|
|
672
|
+
// path where core looked under a full path, and components absent from the map.
|
|
673
|
+
instance =
|
|
674
|
+
instance || ((_a = this.componentsMap) === null || _a === void 0 ? void 0 : _a[paths.dataPath]) || this.getComponent(paths.dataPath);
|
|
677
675
|
}
|
|
678
676
|
if (!instance) {
|
|
679
677
|
return;
|
|
@@ -417,8 +417,12 @@ class AddressComponent extends Container_1.default {
|
|
|
417
417
|
this.searchInput.forEach((element, index) => {
|
|
418
418
|
if (!this.builderMode && element && this.provider) {
|
|
419
419
|
if (this.component.provider === 'google') {
|
|
420
|
+
if (this.component.enableNewPlacesApi) {
|
|
421
|
+
this.provider.options.version = 'newPlacesApi';
|
|
422
|
+
}
|
|
420
423
|
this.googlePlacesCleanups = [];
|
|
421
|
-
this.provider
|
|
424
|
+
this.provider
|
|
425
|
+
.attachAutocomplete(element, index, this.onSelectAddress.bind(this), this.disabled)
|
|
422
426
|
.then((cleanup) => {
|
|
423
427
|
if (typeof cleanup === 'function') {
|
|
424
428
|
this.googlePlacesCleanups.push(cleanup);
|
|
@@ -514,7 +518,6 @@ class AddressComponent extends Container_1.default {
|
|
|
514
518
|
if (this.autocompleterWidget && typeof this.autocompleterWidget.destroy === 'function') {
|
|
515
519
|
this.autocompleterWidget.destroy();
|
|
516
520
|
}
|
|
517
|
-
;
|
|
518
521
|
(this.googlePlacesCleanups || []).forEach((cleanup) => {
|
|
519
522
|
cleanup();
|
|
520
523
|
});
|
|
@@ -118,6 +118,30 @@ declare const _default: ({
|
|
|
118
118
|
validate?: undefined;
|
|
119
119
|
defaultValue?: undefined;
|
|
120
120
|
description?: undefined;
|
|
121
|
+
} | {
|
|
122
|
+
weight: number;
|
|
123
|
+
type: string;
|
|
124
|
+
input: boolean;
|
|
125
|
+
key: string;
|
|
126
|
+
label: string;
|
|
127
|
+
tooltip: string;
|
|
128
|
+
conditional: {
|
|
129
|
+
json: {
|
|
130
|
+
'===': (string | {
|
|
131
|
+
var: string;
|
|
132
|
+
})[];
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
placeholder?: undefined;
|
|
136
|
+
valueProperty?: undefined;
|
|
137
|
+
dataSrc?: undefined;
|
|
138
|
+
data?: undefined;
|
|
139
|
+
validate?: undefined;
|
|
140
|
+
defaultValue?: undefined;
|
|
141
|
+
rows?: undefined;
|
|
142
|
+
editor?: undefined;
|
|
143
|
+
as?: undefined;
|
|
144
|
+
description?: undefined;
|
|
121
145
|
} | {
|
|
122
146
|
type: string;
|
|
123
147
|
input: boolean;
|
|
@@ -141,6 +141,19 @@ exports.default = [
|
|
|
141
141
|
},
|
|
142
142
|
},
|
|
143
143
|
},
|
|
144
|
+
{
|
|
145
|
+
weight: 10,
|
|
146
|
+
type: 'checkbox',
|
|
147
|
+
input: true,
|
|
148
|
+
key: 'enableNewPlacesApi',
|
|
149
|
+
label: 'Places API (New)',
|
|
150
|
+
tooltip: 'Enable the new Google Places API instead of the legacy version.',
|
|
151
|
+
conditional: {
|
|
152
|
+
json: {
|
|
153
|
+
'===': [{ var: 'data.provider' }, 'google'],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
144
157
|
{
|
|
145
158
|
type: 'textarea',
|
|
146
159
|
input: true,
|
|
@@ -436,12 +436,8 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
|
436
436
|
component.rowIndex = rowIndex;
|
|
437
437
|
component.row = `${rowIndex}-${colIndex}`;
|
|
438
438
|
entries.forEach(({ instance, oldPath }) => {
|
|
439
|
-
instance.
|
|
440
|
-
|
|
441
|
-
delete map[oldPath];
|
|
442
|
-
}
|
|
443
|
-
map[instance.paths.dataPath] = instance;
|
|
444
|
-
});
|
|
439
|
+
instance.unregisterComponentInstance(oldPath);
|
|
440
|
+
instance.registerComponentInstance();
|
|
445
441
|
});
|
|
446
442
|
});
|
|
447
443
|
}
|
|
@@ -547,7 +543,8 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
|
547
543
|
}, modified);
|
|
548
544
|
this.triggerRootChange(flags, changed, modified);
|
|
549
545
|
}
|
|
550
|
-
|
|
546
|
+
const rowData = this.dataValue[rowIndex];
|
|
547
|
+
this.processRow('checkData', null, Object.assign(Object.assign({}, flags), { changed }), rowData, lodash_1.default.toArray(this.rows[rowIndex]));
|
|
551
548
|
};
|
|
552
549
|
let columnComponent;
|
|
553
550
|
if (this.builderMode) {
|
|
@@ -103,6 +103,11 @@ class FileComponent extends Field_1.default {
|
|
|
103
103
|
this.abortUploads = [];
|
|
104
104
|
this.pendingfiles = [];
|
|
105
105
|
this.resolvedFiles = [];
|
|
106
|
+
const imageSize = Number(this.component.imageSize);
|
|
107
|
+
const isValidImageSize = imageSize > 0;
|
|
108
|
+
if (!isValidImageSize) {
|
|
109
|
+
this.component.imageSize = '200';
|
|
110
|
+
}
|
|
106
111
|
}
|
|
107
112
|
get dataReady() {
|
|
108
113
|
return this.filesReady || Promise.resolve();
|
|
@@ -637,7 +642,7 @@ class FileComponent extends Field_1.default {
|
|
|
637
642
|
fileKey: this.component.fileKey || 'file',
|
|
638
643
|
storage: this.component.storage,
|
|
639
644
|
options: this.component.storage === 'url'
|
|
640
|
-
?
|
|
645
|
+
? this.component.urlRequestOptions || this.component.options
|
|
641
646
|
: this.component.options,
|
|
642
647
|
file,
|
|
643
648
|
size: file.size,
|
|
@@ -673,7 +678,9 @@ class FileComponent extends Field_1.default {
|
|
|
673
678
|
return fileWithSameNameUploaded || fileWithSameNameUploading
|
|
674
679
|
? {
|
|
675
680
|
status: 'error',
|
|
676
|
-
message: this.t(fileWithSameNameUploading
|
|
681
|
+
message: this.t(fileWithSameNameUploading
|
|
682
|
+
? 'fileWithDuplicatedNameInProgress'
|
|
683
|
+
: 'fileWithDuplicatedNameLoaded'),
|
|
677
684
|
}
|
|
678
685
|
: {};
|
|
679
686
|
}
|
|
@@ -872,8 +879,8 @@ class FileComponent extends Field_1.default {
|
|
|
872
879
|
deleteFile(fileInfo) {
|
|
873
880
|
return __awaiter(this, void 0, void 0, function* () {
|
|
874
881
|
const options = this.component.storage === 'url'
|
|
875
|
-
?
|
|
876
|
-
:
|
|
882
|
+
? this.component.urlRequestOptions || this.component.options || {}
|
|
883
|
+
: this.component.options || {};
|
|
877
884
|
if (fileInfo &&
|
|
878
885
|
['url', 'indexeddb', 's3', 'azure', 'googledrive'].includes(this.component.storage)) {
|
|
879
886
|
const { fileService } = this;
|
|
@@ -1013,7 +1020,7 @@ class FileComponent extends Field_1.default {
|
|
|
1013
1020
|
delete fileToSync.progress;
|
|
1014
1021
|
this.redraw();
|
|
1015
1022
|
if (fileInfo) {
|
|
1016
|
-
const fileExists = this.resolvedFiles.find(x => x.fileInfo.originalName === fileToSync.originalName);
|
|
1023
|
+
const fileExists = this.resolvedFiles.find((x) => x.fileInfo.originalName === fileToSync.originalName);
|
|
1017
1024
|
if (!fileExists && fileToSync.status !== 'error') {
|
|
1018
1025
|
this.resolvedFiles.push({ fileToSync, fileInfo });
|
|
1019
1026
|
}
|
|
@@ -1071,8 +1078,8 @@ class FileComponent extends Field_1.default {
|
|
|
1071
1078
|
}
|
|
1072
1079
|
getFile(fileInfo) {
|
|
1073
1080
|
const options = this.component.storage === 'url'
|
|
1074
|
-
?
|
|
1075
|
-
:
|
|
1081
|
+
? this.component.urlRequestOptions || this.component.options || {}
|
|
1082
|
+
: this.component.options || {};
|
|
1076
1083
|
const { fileService } = this;
|
|
1077
1084
|
if (!fileService) {
|
|
1078
1085
|
return alert(this.t('noFileService'));
|
|
@@ -1113,7 +1120,9 @@ class FileComponent extends Field_1.default {
|
|
|
1113
1120
|
return Promise.resolve();
|
|
1114
1121
|
}
|
|
1115
1122
|
yield this.syncFiles();
|
|
1116
|
-
return this.shouldSyncFiles
|
|
1123
|
+
return this.shouldSyncFiles
|
|
1124
|
+
? Promise.reject(this.t('synchronizationFailed'))
|
|
1125
|
+
: Promise.resolve();
|
|
1117
1126
|
}
|
|
1118
1127
|
catch (error) {
|
|
1119
1128
|
return Promise.reject(error.message);
|
|
@@ -18,6 +18,7 @@ declare const _default: ({
|
|
|
18
18
|
editor?: undefined;
|
|
19
19
|
as?: undefined;
|
|
20
20
|
logic?: undefined;
|
|
21
|
+
clearOnHide?: undefined;
|
|
21
22
|
optionsLabelPosition?: undefined;
|
|
22
23
|
inline?: undefined;
|
|
23
24
|
defaultValue?: undefined;
|
|
@@ -48,6 +49,7 @@ declare const _default: ({
|
|
|
48
49
|
editor?: undefined;
|
|
49
50
|
as?: undefined;
|
|
50
51
|
logic?: undefined;
|
|
52
|
+
clearOnHide?: undefined;
|
|
51
53
|
optionsLabelPosition?: undefined;
|
|
52
54
|
inline?: undefined;
|
|
53
55
|
defaultValue?: undefined;
|
|
@@ -95,6 +97,7 @@ declare const _default: ({
|
|
|
95
97
|
editor?: undefined;
|
|
96
98
|
as?: undefined;
|
|
97
99
|
logic?: undefined;
|
|
100
|
+
clearOnHide?: undefined;
|
|
98
101
|
optionsLabelPosition?: undefined;
|
|
99
102
|
inline?: undefined;
|
|
100
103
|
defaultValue?: undefined;
|
|
@@ -125,6 +128,7 @@ declare const _default: ({
|
|
|
125
128
|
editor?: undefined;
|
|
126
129
|
as?: undefined;
|
|
127
130
|
logic?: undefined;
|
|
131
|
+
clearOnHide?: undefined;
|
|
128
132
|
optionsLabelPosition?: undefined;
|
|
129
133
|
inline?: undefined;
|
|
130
134
|
defaultValue?: undefined;
|
|
@@ -161,6 +165,7 @@ declare const _default: ({
|
|
|
161
165
|
editor?: undefined;
|
|
162
166
|
as?: undefined;
|
|
163
167
|
logic?: undefined;
|
|
168
|
+
clearOnHide?: undefined;
|
|
164
169
|
optionsLabelPosition?: undefined;
|
|
165
170
|
inline?: undefined;
|
|
166
171
|
defaultValue?: undefined;
|
|
@@ -191,6 +196,7 @@ declare const _default: ({
|
|
|
191
196
|
tableView?: undefined;
|
|
192
197
|
components?: undefined;
|
|
193
198
|
logic?: undefined;
|
|
199
|
+
clearOnHide?: undefined;
|
|
194
200
|
optionsLabelPosition?: undefined;
|
|
195
201
|
inline?: undefined;
|
|
196
202
|
defaultValue?: undefined;
|
|
@@ -237,6 +243,7 @@ declare const _default: ({
|
|
|
237
243
|
rows?: undefined;
|
|
238
244
|
editor?: undefined;
|
|
239
245
|
as?: undefined;
|
|
246
|
+
clearOnHide?: undefined;
|
|
240
247
|
optionsLabelPosition?: undefined;
|
|
241
248
|
inline?: undefined;
|
|
242
249
|
defaultValue?: undefined;
|
|
@@ -259,6 +266,7 @@ declare const _default: ({
|
|
|
259
266
|
editor?: undefined;
|
|
260
267
|
as?: undefined;
|
|
261
268
|
logic?: undefined;
|
|
269
|
+
clearOnHide?: undefined;
|
|
262
270
|
optionsLabelPosition?: undefined;
|
|
263
271
|
inline?: undefined;
|
|
264
272
|
defaultValue?: undefined;
|
|
@@ -281,6 +289,7 @@ declare const _default: ({
|
|
|
281
289
|
editor?: undefined;
|
|
282
290
|
as?: undefined;
|
|
283
291
|
logic?: undefined;
|
|
292
|
+
clearOnHide?: undefined;
|
|
284
293
|
optionsLabelPosition?: undefined;
|
|
285
294
|
inline?: undefined;
|
|
286
295
|
defaultValue?: undefined;
|
|
@@ -311,6 +320,7 @@ declare const _default: ({
|
|
|
311
320
|
editor?: undefined;
|
|
312
321
|
as?: undefined;
|
|
313
322
|
logic?: undefined;
|
|
323
|
+
clearOnHide?: undefined;
|
|
314
324
|
optionsLabelPosition?: undefined;
|
|
315
325
|
inline?: undefined;
|
|
316
326
|
defaultValue?: undefined;
|
|
@@ -323,6 +333,7 @@ declare const _default: ({
|
|
|
323
333
|
placeholder: string;
|
|
324
334
|
tooltip: string;
|
|
325
335
|
weight: number;
|
|
336
|
+
clearOnHide: boolean;
|
|
326
337
|
conditional: {
|
|
327
338
|
json: {
|
|
328
339
|
'==': (boolean | {
|
|
@@ -345,6 +356,37 @@ declare const _default: ({
|
|
|
345
356
|
inline?: undefined;
|
|
346
357
|
defaultValue?: undefined;
|
|
347
358
|
values?: undefined;
|
|
359
|
+
} | {
|
|
360
|
+
type: string;
|
|
361
|
+
input: boolean;
|
|
362
|
+
key: string;
|
|
363
|
+
label: string;
|
|
364
|
+
placeholder: string;
|
|
365
|
+
tooltip: string;
|
|
366
|
+
weight: number;
|
|
367
|
+
conditional: {
|
|
368
|
+
json: {
|
|
369
|
+
'==': (boolean | {
|
|
370
|
+
var: string;
|
|
371
|
+
})[];
|
|
372
|
+
'==='?: undefined;
|
|
373
|
+
in?: undefined;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
valueProperty?: undefined;
|
|
377
|
+
dataSrc?: undefined;
|
|
378
|
+
data?: undefined;
|
|
379
|
+
tableView?: undefined;
|
|
380
|
+
components?: undefined;
|
|
381
|
+
rows?: undefined;
|
|
382
|
+
editor?: undefined;
|
|
383
|
+
as?: undefined;
|
|
384
|
+
logic?: undefined;
|
|
385
|
+
clearOnHide?: undefined;
|
|
386
|
+
optionsLabelPosition?: undefined;
|
|
387
|
+
inline?: undefined;
|
|
388
|
+
defaultValue?: undefined;
|
|
389
|
+
values?: undefined;
|
|
348
390
|
} | {
|
|
349
391
|
type: string;
|
|
350
392
|
input: boolean;
|
|
@@ -370,6 +412,7 @@ declare const _default: ({
|
|
|
370
412
|
editor?: undefined;
|
|
371
413
|
as?: undefined;
|
|
372
414
|
logic?: undefined;
|
|
415
|
+
clearOnHide?: undefined;
|
|
373
416
|
} | {
|
|
374
417
|
type: string;
|
|
375
418
|
input: boolean;
|
|
@@ -393,6 +436,7 @@ declare const _default: ({
|
|
|
393
436
|
editor?: undefined;
|
|
394
437
|
as?: undefined;
|
|
395
438
|
logic?: undefined;
|
|
439
|
+
clearOnHide?: undefined;
|
|
396
440
|
optionsLabelPosition?: undefined;
|
|
397
441
|
inline?: undefined;
|
|
398
442
|
defaultValue?: undefined;
|
|
@@ -295,8 +295,9 @@ exports.default = [
|
|
|
295
295
|
key: 'imageSize',
|
|
296
296
|
label: 'Image Size',
|
|
297
297
|
placeholder: '100',
|
|
298
|
-
tooltip: 'The image size for previewing images.',
|
|
298
|
+
tooltip: 'The image size, in square pixels, for previewing images.',
|
|
299
299
|
weight: 40,
|
|
300
|
+
clearOnHide: false,
|
|
300
301
|
conditional: {
|
|
301
302
|
json: {
|
|
302
303
|
'==': [{ var: 'data.image' }, true],
|
|
@@ -63,6 +63,13 @@ export default class FormComponent extends Component {
|
|
|
63
63
|
checkComponentConditions(data: any, flags: any, row: any): any;
|
|
64
64
|
calculateValue(data: any, flags: any, row: any): any;
|
|
65
65
|
setPristine(pristine: any): void;
|
|
66
|
+
/**
|
|
67
|
+
* Determine if an ancestor is hidden by the `hidden` JSON flag alone. An ancestor that has its
|
|
68
|
+
* own condition is governed by that condition instead and is left to `parentConditionallyHidden`
|
|
69
|
+
* — the `hidden` flag and conditionally-hidden are distinct states (FIO-11691).
|
|
70
|
+
* @returns {boolean} - TRUE if an ancestor is hidden in the JSON and has no condition.
|
|
71
|
+
*/
|
|
72
|
+
hasAncestorHiddenInJsonOnly(): boolean;
|
|
66
73
|
/**
|
|
67
74
|
* Determine if the subform should be submitted.
|
|
68
75
|
* @returns {*|boolean} - TRUE if the subform should be submitted, FALSE if it should not.
|
|
@@ -564,16 +564,38 @@ class FormComponent extends Component_1.default {
|
|
|
564
564
|
this.subForm.setPristine(pristine);
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
+
/**
|
|
568
|
+
* Determine if an ancestor is hidden by the `hidden` JSON flag alone. An ancestor that has its
|
|
569
|
+
* own condition is governed by that condition instead and is left to `parentConditionallyHidden`
|
|
570
|
+
* — the `hidden` flag and conditionally-hidden are distinct states (FIO-11691).
|
|
571
|
+
* @returns {boolean} - TRUE if an ancestor is hidden in the JSON and has no condition.
|
|
572
|
+
*/
|
|
573
|
+
hasAncestorHiddenInJsonOnly() {
|
|
574
|
+
let currentParent = this.parent;
|
|
575
|
+
while (currentParent) {
|
|
576
|
+
if (currentParent.component.hidden && !currentParent.hasCondition()) {
|
|
577
|
+
return true;
|
|
578
|
+
}
|
|
579
|
+
currentParent = currentParent.parent;
|
|
580
|
+
}
|
|
581
|
+
return false;
|
|
582
|
+
}
|
|
567
583
|
/**
|
|
568
584
|
* Determine if the subform should be submitted.
|
|
569
585
|
* @returns {*|boolean} - TRUE if the subform should be submitted, FALSE if it should not.
|
|
570
586
|
*/
|
|
571
587
|
get shouldSubmit() {
|
|
588
|
+
const savesAsReference = !this.component.hasOwnProperty('reference') || this.component.reference;
|
|
572
589
|
const hiddenByJsonOnly = !this.hasCondition() && this.component.hidden;
|
|
590
|
+
// Layout ancestors (fieldset, panel, tabs...) hide us without appearing in our data path, so
|
|
591
|
+
// their hidden state is only reachable by walking the instance chain (FIO-9879).
|
|
592
|
+
const hiddenByAncestor = this.hasAncestorHiddenInJsonOnly() || this.parentConditionallyHidden();
|
|
593
|
+
// Gate on our own clearOnHide, never an ancestor's.
|
|
594
|
+
const clearedWhileHidden = (hiddenByJsonOnly || hiddenByAncestor) && this.component.clearOnHide;
|
|
573
595
|
return (this.subFormReady &&
|
|
574
|
-
|
|
596
|
+
savesAsReference &&
|
|
575
597
|
!this.shouldConditionallyClear() &&
|
|
576
|
-
!
|
|
598
|
+
!clearedWhileHidden);
|
|
577
599
|
}
|
|
578
600
|
/**
|
|
579
601
|
* Returns the data for the subform.
|
|
@@ -203,7 +203,7 @@ class SignatureComponent extends Input_1.default {
|
|
|
203
203
|
penColor: this.component.penColor,
|
|
204
204
|
backgroundColor: this.component.backgroundColor,
|
|
205
205
|
});
|
|
206
|
-
this.signaturePad.addEventListener('endStroke', () => this.setValue(this.signaturePad.toDataURL()));
|
|
206
|
+
this.signaturePad.addEventListener('endStroke', () => this.setValue(this.signaturePad.toDataURL(), { modified: true }));
|
|
207
207
|
this.refs.signatureImage.setAttribute('src', this.signaturePad.toDataURL());
|
|
208
208
|
this.onDisabled();
|
|
209
209
|
// Ensure the signature is always the size of its container.
|
|
@@ -232,7 +232,7 @@ class SignatureComponent extends Input_1.default {
|
|
|
232
232
|
event.preventDefault();
|
|
233
233
|
this.showCanvas(true);
|
|
234
234
|
this.signaturePad.clear();
|
|
235
|
-
this.setValue(this.defaultValue);
|
|
235
|
+
this.setValue(this.defaultValue, { modified: true });
|
|
236
236
|
});
|
|
237
237
|
this.setValue(this.dataValue);
|
|
238
238
|
return superAttach;
|
package/lib/cjs/package.json
CHANGED
|
@@ -39,6 +39,14 @@ export class GoogleAddressProvider extends AddressProvider {
|
|
|
39
39
|
* @returns {string} The alternative property to use for display value.
|
|
40
40
|
*/
|
|
41
41
|
get alternativeDisplayValueProperty(): string;
|
|
42
|
+
/**
|
|
43
|
+
* @returns {string} The property to use for display value on places returned by the new Places API.
|
|
44
|
+
*/
|
|
45
|
+
get newApiDisplayValueProperty(): string;
|
|
46
|
+
/**
|
|
47
|
+
* @returns {boolean} Whether the provider is configured to use the new Places API.
|
|
48
|
+
*/
|
|
49
|
+
get usesNewPlacesApi(): boolean;
|
|
42
50
|
/**
|
|
43
51
|
* @param {AutocompleteOptions} options - The autocomplete options.
|
|
44
52
|
*/
|
|
@@ -78,7 +86,7 @@ export class GoogleAddressProvider extends AddressProvider {
|
|
|
78
86
|
*/
|
|
79
87
|
addRequiredProviderOptions(options: AutocompleteOptions): void;
|
|
80
88
|
filterPlace(place: any): {};
|
|
81
|
-
attachAutocomplete(elem: any, index: any, onSelectAddress: any): any;
|
|
89
|
+
attachAutocomplete(elem: any, index: any, onSelectAddress: any, disable?: boolean): any;
|
|
82
90
|
search(): Promise<void>;
|
|
83
91
|
makeRequest(): Promise<void>;
|
|
84
92
|
getDisplayValue(address: any): any;
|