@formio/js 5.5.1 → 5.6.0

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.
Files changed (67) hide show
  1. package/README.md +2 -2
  2. package/dist/formio.builder.css +26 -1
  3. package/dist/formio.builder.min.css +1 -1
  4. package/dist/formio.embed.js +1 -1
  5. package/dist/formio.embed.min.js +1 -1
  6. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  7. package/dist/formio.form.css +26 -1
  8. package/dist/formio.form.js +39 -215
  9. package/dist/formio.form.min.css +1 -1
  10. package/dist/formio.form.min.js +1 -1
  11. package/dist/formio.form.min.js.LICENSE.txt +2 -2
  12. package/dist/formio.full.css +26 -1
  13. package/dist/formio.full.js +41 -217
  14. package/dist/formio.full.min.css +1 -1
  15. package/dist/formio.full.min.js +1 -1
  16. package/dist/formio.full.min.js.LICENSE.txt +2 -2
  17. package/dist/formio.js +316 -185
  18. package/dist/formio.min.js +1 -1
  19. package/dist/formio.min.js.LICENSE.txt +12 -2
  20. package/dist/formio.utils.js +15 -15
  21. package/dist/formio.utils.min.js +1 -1
  22. package/dist/formio.utils.min.js.LICENSE.txt +2 -2
  23. package/lib/cjs/Embed.js +1 -1
  24. package/lib/cjs/Formio.js +1 -1
  25. package/lib/cjs/PDF.js +5 -0
  26. package/lib/cjs/Wizard.d.ts +5 -0
  27. package/lib/cjs/Wizard.js +22 -0
  28. package/lib/cjs/components/_classes/component/Component.js +2 -1
  29. package/lib/cjs/components/address/Address.js +5 -2
  30. package/lib/cjs/components/address/editForm/Address.edit.provider.d.ts +24 -0
  31. package/lib/cjs/components/address/editForm/Address.edit.provider.js +13 -0
  32. package/lib/cjs/components/datagrid/DataGrid.js +2 -1
  33. package/lib/cjs/components/file/File.js +17 -8
  34. package/lib/cjs/components/file/editForm/File.edit.file.d.ts +44 -0
  35. package/lib/cjs/components/file/editForm/File.edit.file.js +2 -1
  36. package/lib/cjs/components/form/Form.d.ts +7 -0
  37. package/lib/cjs/components/form/Form.js +24 -2
  38. package/lib/cjs/components/signature/Signature.js +2 -2
  39. package/lib/cjs/package.json +1 -1
  40. package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +9 -1
  41. package/lib/cjs/providers/address/GoogleAddressProvider.js +116 -32
  42. package/lib/cjs/providers/storage/indexeddb.js +2 -2
  43. package/lib/cjs/utils/utils.d.ts +2 -5
  44. package/lib/cjs/utils/utils.js +2 -13
  45. package/lib/mjs/Embed.js +1 -1
  46. package/lib/mjs/Formio.js +1 -1
  47. package/lib/mjs/PDF.js +4 -0
  48. package/lib/mjs/Wizard.d.ts +5 -0
  49. package/lib/mjs/Wizard.js +22 -0
  50. package/lib/mjs/components/_classes/component/Component.js +1 -1
  51. package/lib/mjs/components/address/Address.js +5 -2
  52. package/lib/mjs/components/address/editForm/Address.edit.provider.d.ts +24 -0
  53. package/lib/mjs/components/address/editForm/Address.edit.provider.js +13 -0
  54. package/lib/mjs/components/datagrid/DataGrid.js +2 -1
  55. package/lib/mjs/components/file/File.js +17 -8
  56. package/lib/mjs/components/file/editForm/File.edit.file.d.ts +44 -0
  57. package/lib/mjs/components/file/editForm/File.edit.file.js +2 -1
  58. package/lib/mjs/components/form/Form.d.ts +7 -0
  59. package/lib/mjs/components/form/Form.js +24 -2
  60. package/lib/mjs/components/signature/Signature.js +2 -2
  61. package/lib/mjs/package.json +1 -1
  62. package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +9 -1
  63. package/lib/mjs/providers/address/GoogleAddressProvider.js +94 -32
  64. package/lib/mjs/providers/storage/indexeddb.js +2 -2
  65. package/lib/mjs/utils/utils.d.ts +2 -5
  66. package/lib/mjs/utils/utils.js +3 -12
  67. package/package.json +7 -8
@@ -18,9 +18,9 @@
18
18
  * MIT licensed
19
19
  */
20
20
 
21
- /*! @license DOMPurify 3.4.12 | (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.12/LICENSE */
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.5.1 | https://unpkg.com/formiojs@5.5.1/LICENSE.txt */
23
+ /*! formiojs v5.6.0 | https://unpkg.com/formiojs@5.6.0/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.5.1';
503
+ Formio.version = '5.6.0';
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.5.1';
14
+ sdk_1.Formio.version = '5.6.0';
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';
package/lib/cjs/PDF.js CHANGED
@@ -183,6 +183,7 @@ class PDF extends Webform_1.default {
183
183
  return this.getSubmission().then(() => super.submitForm(options));
184
184
  }
185
185
  getSrc() {
186
+ var _a, _b;
186
187
  if (!this._form || !this._form.settings || !this._form.settings.pdf) {
187
188
  return '';
188
189
  }
@@ -200,6 +201,10 @@ class PDF extends Webform_1.default {
200
201
  if (this.builderMode) {
201
202
  params.push('builder=1');
202
203
  }
204
+ const parentIconset = this.options.iconset || ((_b = (_a = Formio_1.Formio.Templates) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.defaultIconset);
205
+ if (parentIconset && parentIconset !== 'bi') {
206
+ params.push(`iconset=${encodeURIComponent(parentIconset)}`);
207
+ }
203
208
  if (params.length) {
204
209
  iframeSrc += `?${params.join('&')}`;
205
210
  }
@@ -60,6 +60,11 @@ declare class Wizard extends Webform {
60
60
  */
61
61
  handleSaveOnEnter(event: KeyboardEvent): void;
62
62
  attachNav(): void;
63
+ /**
64
+ * Renders the submission result message under the navigation submit button, mirroring the
65
+ * behavior of the Button components.
66
+ */
67
+ attachSubmitMessage(): void;
63
68
  /**
64
69
  * Emits an event indicating that a wizard page has been selected.
65
70
  * @param {number} index - Index of the selected wizard page in the `pages` array.
package/lib/cjs/Wizard.js CHANGED
@@ -220,6 +220,8 @@ class Wizard extends Webform_1.default {
220
220
  [`${this.wizardKey}-previous`]: 'single',
221
221
  [`${this.wizardKey}-next`]: 'single',
222
222
  [`${this.wizardKey}-submit`]: 'single',
223
+ [`${this.wizardKey}-buttonMessageContainer`]: 'single',
224
+ [`${this.wizardKey}-buttonMessage`]: 'single',
223
225
  });
224
226
  this.attachNav();
225
227
  }
@@ -257,6 +259,8 @@ class Wizard extends Webform_1.default {
257
259
  [`${this.wizardKey}-previous`]: 'single',
258
260
  [`${this.wizardKey}-next`]: 'single',
259
261
  [`${this.wizardKey}-submit`]: 'single',
262
+ [`${this.wizardKey}-buttonMessageContainer`]: 'single',
263
+ [`${this.wizardKey}-buttonMessage`]: 'single',
260
264
  [`${this.wizardKey}-link`]: 'multiple',
261
265
  [`${this.wizardKey}-tooltip`]: 'multiple',
262
266
  });
@@ -271,6 +275,7 @@ class Wizard extends Webform_1.default {
271
275
  ]);
272
276
  this.attachNav();
273
277
  this.attachHeader();
278
+ this.attachSubmitMessage();
274
279
  return promises.then(() => {
275
280
  this.emit('render', { component: this.currentPage, page: this.page });
276
281
  if (this.component.scrollToTop) {
@@ -370,6 +375,23 @@ class Wizard extends Webform_1.default {
370
375
  });
371
376
  });
372
377
  }
378
+ /**
379
+ * Renders the submission result message under the navigation submit button, mirroring the
380
+ * behavior of the Button components.
381
+ */
382
+ attachSubmitMessage() {
383
+ this.on('submitDone', (message) => {
384
+ const messageContainer = this.refs[`${this.wizardKey}-buttonMessageContainer`];
385
+ const messageElement = this.refs[`${this.wizardKey}-buttonMessage`];
386
+ if (!messageElement) {
387
+ return;
388
+ }
389
+ const resultMessage = lodash_1.default.isString(message) ? message : this.t('complete');
390
+ this.addClass(messageContainer, 'has-success');
391
+ this.removeClass(messageContainer, 'has-error');
392
+ this.setContent(messageElement, resultMessage);
393
+ }, true);
394
+ }
373
395
  /**
374
396
  * Emits an event indicating that a wizard page has been selected.
375
397
  * @param {number} index - Index of the selected wizard page in the `pages` array.
@@ -925,11 +925,12 @@ class Component extends Element_1.default {
925
925
  * @returns {string} - The translated text.
926
926
  */
927
927
  t(text, params = {}, ...args) {
928
+ var _a;
928
929
  if (!text) {
929
930
  return '';
930
931
  }
931
932
  // Use _userInput: true to ignore translations from defaults
932
- if (text in en_1.default && params._userInput) {
933
+ if (((_a = this.i18next) === null || _a === void 0 ? void 0 : _a.language) === 'en' && text in en_1.default && params._userInput) {
933
934
  return text;
934
935
  }
935
936
  params.data = params.data || this.rootValue;
@@ -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.attachAutocomplete(element, index, this.onSelectAddress.bind(this))
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,
@@ -547,7 +547,8 @@ class DataGridComponent extends NestedArrayComponent_1.default {
547
547
  }, modified);
548
548
  this.triggerRootChange(flags, changed, modified);
549
549
  }
550
- this.processRow('checkData', null, Object.assign(Object.assign({}, flags), { changed }), row, lodash_1.default.toArray(this.rows[rowIndex]));
550
+ const rowData = this.dataValue[rowIndex];
551
+ this.processRow('checkData', null, Object.assign(Object.assign({}, flags), { changed }), rowData, lodash_1.default.toArray(this.rows[rowIndex]));
551
552
  };
552
553
  let columnComponent;
553
554
  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
- ? (this.component.urlRequestOptions || this.component.options)
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 ? 'fileWithDuplicatedNameInProgress' : 'fileWithDuplicatedNameLoaded'),
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
- ? (this.component.urlRequestOptions || this.component.options || {})
876
- : (this.component.options || {});
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
- ? (this.component.urlRequestOptions || this.component.options || {})
1075
- : (this.component.options || {});
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 ? Promise.reject(this.t('synchronizationFailed')) : Promise.resolve();
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
- (!this.component.hasOwnProperty('reference') || this.component.reference) &&
596
+ savesAsReference &&
575
597
  !this.shouldConditionallyClear() &&
576
- !(hiddenByJsonOnly && this.component.clearOnHide));
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;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "type": "commonjs",
3
- "version": "5.5.1"
3
+ "version": "5.6.0"
4
4
  }
@@ -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;