@formio/js 5.5.1 → 5.5.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.
Files changed (40) hide show
  1. package/dist/formio.builder.css +23 -1
  2. package/dist/formio.builder.min.css +1 -1
  3. package/dist/formio.embed.js +1 -1
  4. package/dist/formio.embed.min.js +1 -1
  5. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  6. package/dist/formio.form.css +23 -1
  7. package/dist/formio.form.js +18 -194
  8. package/dist/formio.form.min.css +1 -1
  9. package/dist/formio.form.min.js +1 -1
  10. package/dist/formio.form.min.js.LICENSE.txt +2 -2
  11. package/dist/formio.full.css +23 -1
  12. package/dist/formio.full.js +18 -194
  13. package/dist/formio.full.min.css +1 -1
  14. package/dist/formio.full.min.js +1 -1
  15. package/dist/formio.full.min.js.LICENSE.txt +2 -2
  16. package/dist/formio.js +311 -180
  17. package/dist/formio.min.js +1 -1
  18. package/dist/formio.min.js.LICENSE.txt +12 -2
  19. package/dist/formio.utils.js +7 -7
  20. package/dist/formio.utils.min.js +1 -1
  21. package/dist/formio.utils.min.js.LICENSE.txt +2 -2
  22. package/lib/cjs/Embed.js +1 -1
  23. package/lib/cjs/Formio.js +1 -1
  24. package/lib/cjs/PDF.js +5 -0
  25. package/lib/cjs/Wizard.d.ts +5 -0
  26. package/lib/cjs/Wizard.js +22 -0
  27. package/lib/cjs/package.json +1 -1
  28. package/lib/cjs/providers/storage/indexeddb.js +2 -2
  29. package/lib/cjs/utils/utils.d.ts +2 -5
  30. package/lib/cjs/utils/utils.js +2 -13
  31. package/lib/mjs/Embed.js +1 -1
  32. package/lib/mjs/Formio.js +1 -1
  33. package/lib/mjs/PDF.js +4 -0
  34. package/lib/mjs/Wizard.d.ts +5 -0
  35. package/lib/mjs/Wizard.js +22 -0
  36. package/lib/mjs/package.json +1 -1
  37. package/lib/mjs/providers/storage/indexeddb.js +2 -2
  38. package/lib/mjs/utils/utils.d.ts +2 -5
  39. package/lib/mjs/utils/utils.js +3 -12
  40. package/package.json +3 -4
@@ -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.5.2 | https://unpkg.com/formiojs@5.5.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
@@ -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.5.2';
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.5.2';
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.
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "type": "commonjs",
3
- "version": "5.5.1"
3
+ "version": "5.5.2"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const uuid_1 = require("uuid");
3
+ const utils_1 = require("../../utils/utils");
4
4
  /**
5
5
  * indexedDb provider for file storage.
6
6
  * @returns {import('./typedefs').FileProvider} The FileProvider interface defined in index.js.
@@ -29,7 +29,7 @@ function indexeddb() {
29
29
  return new Promise((resolve, reject) => {
30
30
  reader.onload = () => {
31
31
  const blobObject = new Blob([file], { type: file.type });
32
- const id = (0, uuid_1.v4)(blobObject);
32
+ const id = (0, utils_1.guid)();
33
33
  const data = {
34
34
  id,
35
35
  data: blobObject,
@@ -163,11 +163,6 @@ export function convertStringToHTMLElement(str: string, selector: string): HTMLE
163
163
  * @returns {string} - A unique filename.
164
164
  */
165
165
  export function uniqueName(name: string, template: string, evalContext: object): string;
166
- /**
167
- * Returns a GUID
168
- * @returns {string} - A GUID.
169
- */
170
- export function guid(): string;
171
166
  /**
172
167
  * Return a translated date setting.
173
168
  * @param {string|Date} date - The date to translate.
@@ -520,6 +515,7 @@ export function announceScreenReaderMessage(component: any, value: any, index?:
520
515
  * @param {string} text The text to output to screen readers
521
516
  */
522
517
  export function screenReaderSpeech(text: string): void;
518
+ export { guid };
523
519
  /**
524
520
  * Map values through unfold and return first non-nil value.
525
521
  * @param {Array<T>} collection - The collection to map through unfold.;
@@ -536,3 +532,4 @@ export namespace componentValueTypes {
536
532
  let any: string;
537
533
  }
538
534
  export function interpolateErrors(component: Component, errors: FieldError[], interpolateFn: Function): [];
535
+ import { guid } from './formUtils';
@@ -10,6 +10,7 @@ const moment_timezone_1 = __importDefault(require("moment-timezone/moment-timezo
10
10
  const jstimezonedetect_1 = __importDefault(require("jstimezonedetect"));
11
11
  const dompurify_1 = __importDefault(require("dompurify"));
12
12
  const formUtils_1 = require("./formUtils");
13
+ Object.defineProperty(exports, "guid", { enumerable: true, get: function () { return formUtils_1.guid; } });
13
14
  const Evaluator_1 = require("./Evaluator");
14
15
  const conditionOperators_1 = __importDefault(require("./conditionOperators"));
15
16
  const core_1 = require("@formio/core");
@@ -551,25 +552,13 @@ function uniqueName(name, template, evalContext) {
551
552
  fileName = fileName.substr(0, 100);
552
553
  evalContext = Object.assign(evalContext || {}, {
553
554
  fileName,
554
- guid: guid(),
555
+ guid: (0, formUtils_1.guid)(),
555
556
  });
556
557
  //only letters, numbers, dots, dashes, underscores and spaces are allowed. Anything else will be replaced with dash
557
558
  const uniqueName = `${Evaluator_1.Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\-_ ]/g, '-');
558
559
  return uniqueName;
559
560
  }
560
561
  exports.uniqueName = uniqueName;
561
- /**
562
- * Returns a GUID
563
- * @returns {string} - A GUID.
564
- */
565
- function guid() {
566
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
567
- const r = (Math.random() * 16) | 0;
568
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
569
- return v.toString(16);
570
- });
571
- }
572
- exports.guid = guid;
573
562
  /**
574
563
  * Return a translated date setting.
575
564
  * @param {string|Date} date - The date to translate.
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.5.1';
17
+ static version = '5.5.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.5.1';
7
+ FormioCore.version = '5.5.2';
8
8
  CDN.defaultCDN = FormioCore.version.includes('rc')
9
9
  ? 'https://cdn.test-form.io'
10
10
  : 'https://cdn.form.io';
package/lib/mjs/PDF.js CHANGED
@@ -194,6 +194,10 @@ export default class PDF extends Webform {
194
194
  if (this.builderMode) {
195
195
  params.push('builder=1');
196
196
  }
197
+ const parentIconset = this.options.iconset || Formio.Templates?.current?.defaultIconset;
198
+ if (parentIconset && parentIconset !== 'bi') {
199
+ params.push(`iconset=${encodeURIComponent(parentIconset)}`);
200
+ }
197
201
  if (params.length) {
198
202
  iframeSrc += `?${params.join('&')}`;
199
203
  }
@@ -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/mjs/Wizard.js CHANGED
@@ -214,6 +214,8 @@ export default class Wizard extends Webform {
214
214
  [`${this.wizardKey}-previous`]: 'single',
215
215
  [`${this.wizardKey}-next`]: 'single',
216
216
  [`${this.wizardKey}-submit`]: 'single',
217
+ [`${this.wizardKey}-buttonMessageContainer`]: 'single',
218
+ [`${this.wizardKey}-buttonMessage`]: 'single',
217
219
  });
218
220
  this.attachNav();
219
221
  }
@@ -250,6 +252,8 @@ export default class Wizard extends Webform {
250
252
  [`${this.wizardKey}-previous`]: 'single',
251
253
  [`${this.wizardKey}-next`]: 'single',
252
254
  [`${this.wizardKey}-submit`]: 'single',
255
+ [`${this.wizardKey}-buttonMessageContainer`]: 'single',
256
+ [`${this.wizardKey}-buttonMessage`]: 'single',
253
257
  [`${this.wizardKey}-link`]: 'multiple',
254
258
  [`${this.wizardKey}-tooltip`]: 'multiple',
255
259
  });
@@ -264,6 +268,7 @@ export default class Wizard extends Webform {
264
268
  ]);
265
269
  this.attachNav();
266
270
  this.attachHeader();
271
+ this.attachSubmitMessage();
267
272
  return promises.then(() => {
268
273
  this.emit('render', { component: this.currentPage, page: this.page });
269
274
  if (this.component.scrollToTop) {
@@ -360,6 +365,23 @@ export default class Wizard extends Webform {
360
365
  });
361
366
  });
362
367
  }
368
+ /**
369
+ * Renders the submission result message under the navigation submit button, mirroring the
370
+ * behavior of the Button components.
371
+ */
372
+ attachSubmitMessage() {
373
+ this.on('submitDone', (message) => {
374
+ const messageContainer = this.refs[`${this.wizardKey}-buttonMessageContainer`];
375
+ const messageElement = this.refs[`${this.wizardKey}-buttonMessage`];
376
+ if (!messageElement) {
377
+ return;
378
+ }
379
+ const resultMessage = _.isString(message) ? message : this.t('complete');
380
+ this.addClass(messageContainer, 'has-success');
381
+ this.removeClass(messageContainer, 'has-error');
382
+ this.setContent(messageElement, resultMessage);
383
+ }, true);
384
+ }
363
385
  /**
364
386
  * Emits an event indicating that a wizard page has been selected.
365
387
  * @param {number} index - Index of the selected wizard page in the `pages` array.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "5.5.1"
3
+ "version": "5.5.2"
4
4
 
5
5
  }
@@ -1,4 +1,4 @@
1
- import { v4 as uuidv4 } from 'uuid';
1
+ import { guid } from '../../utils/utils';
2
2
  /**
3
3
  * indexedDb provider for file storage.
4
4
  * @returns {import('./typedefs').FileProvider} The FileProvider interface defined in index.js.
@@ -27,7 +27,7 @@ function indexeddb() {
27
27
  return new Promise((resolve, reject) => {
28
28
  reader.onload = () => {
29
29
  const blobObject = new Blob([file], { type: file.type });
30
- const id = uuidv4(blobObject);
30
+ const id = guid();
31
31
  const data = {
32
32
  id,
33
33
  data: blobObject,
@@ -163,11 +163,6 @@ export function convertStringToHTMLElement(str: string, selector: string): HTMLE
163
163
  * @returns {string} - A unique filename.
164
164
  */
165
165
  export function uniqueName(name: string, template: string, evalContext: object): string;
166
- /**
167
- * Returns a GUID
168
- * @returns {string} - A GUID.
169
- */
170
- export function guid(): string;
171
166
  /**
172
167
  * Return a translated date setting.
173
168
  * @param {string|Date} date - The date to translate.
@@ -520,6 +515,7 @@ export function announceScreenReaderMessage(component: any, value: any, index?:
520
515
  * @param {string} text The text to output to screen readers
521
516
  */
522
517
  export function screenReaderSpeech(text: string): void;
518
+ export { guid };
523
519
  /**
524
520
  * Map values through unfold and return first non-nil value.
525
521
  * @param {Array<T>} collection - The collection to map through unfold.;
@@ -536,3 +532,4 @@ export namespace componentValueTypes {
536
532
  let any: string;
537
533
  }
538
534
  export function interpolateErrors(component: Component, errors: FieldError[], interpolateFn: Function): [];
535
+ import { guid } from './formUtils';
@@ -2,7 +2,7 @@ import _ from 'lodash';
2
2
  import moment from 'moment-timezone/moment-timezone';
3
3
  import jtz from 'jstimezonedetect';
4
4
  import dompurify from 'dompurify';
5
- import { getValue } from './formUtils';
5
+ import { getValue, guid } from './formUtils';
6
6
  import { Evaluator } from './Evaluator';
7
7
  import ConditionOperators from './conditionOperators';
8
8
  import { jsonLogic, convertShowToBoolean } from '@formio/core';
@@ -529,17 +529,8 @@ export function uniqueName(name, template, evalContext) {
529
529
  const uniqueName = `${Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\-_ ]/g, '-');
530
530
  return uniqueName;
531
531
  }
532
- /**
533
- * Returns a GUID
534
- * @returns {string} - A GUID.
535
- */
536
- export function guid() {
537
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
538
- const r = (Math.random() * 16) | 0;
539
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
540
- return v.toString(16);
541
- });
542
- }
532
+ // Re-export GUID generator from @formio/core to avoid duplication
533
+ export { guid };
543
534
  /**
544
535
  * Return a translated date setting.
545
536
  * @param {string|Date} date - The date to translate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.5.1",
3
+ "version": "5.5.2",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -88,10 +88,9 @@
88
88
  "signature_pad": "^4.2.0",
89
89
  "string-hash": "^1.1.3",
90
90
  "tippy.js": "^6.3.7",
91
- "uuid": "^9.0.0",
92
91
  "vanilla-picker": "^2.12.3",
93
- "@formio/bootstrap": "^4.0.4",
94
- "@formio/core": "^2.8.1"
92
+ "@formio/bootstrap": "^4.0.5",
93
+ "@formio/core": "^2.8.2"
95
94
  },
96
95
  "devDependencies": {
97
96
  "@types/node": "^22.15.19",