@formio/js 5.0.0-dev.5936.905c79f → 5.0.0-dev.5940.cf4089b

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/Changelog.md CHANGED
@@ -8,15 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
8
8
  ### Changed
9
9
  - FIO-8270: panel component closing on logic event trigger
10
10
  - FIO-8575: Added ability to reload google maps library with correct API key
11
- - FIO-8659: no modal edit in display tab
12
- - Removing fetch ponyfill since it is no longer needed
13
- - FIO-8652: DataGrid does not reorder
14
11
  - Fixing the submitOnEnter where it will show the loader for the submit
15
- - Fixing the formioReady promise to always resolve if you load it from the full source instead of the embed code
16
12
  - FIO-8126: Fixed select component emitting blur on click
17
13
  - FIO-8304: allow for multivalue masks to have blank input mask option
18
- - FIO-8570: fixed decimal symbol property on number component
19
14
  - 5.x - FIO-8426: changes required for eSignature
15
+ -
20
16
  - FIO-8596: added the editGridEditRow and editGridOpenModal events for editGrid
21
17
  - FIO-7733 remove form min height
22
18
  - FIO-8414 | FIO-8403 | FIO-8389: Fixes 5x validations and conditionals for array data components
@@ -118,6 +114,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
118
114
  - FIO-9347: fixed select preview issue in form builder
119
115
  - FIO-8518: fixed adding checkbox with radio type to pdf design page
120
116
 
117
+ # Change Log
118
+ All notable changes to this project will be documented in this file
119
+
120
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
121
+ and this project adheres to [Semantic Versioning](http://semver.org/).
122
+
123
+ ## 5.0.0
124
+ ### Changed
125
+ - Official Release
126
+ - Updated @formio/bootstrap@3.0.0
127
+ - Updated @formio/core@2.3.0
128
+
121
129
  ### New Features
122
130
 
123
131
  #### New package name
@@ -167,7 +175,7 @@ This is a **Breaking Change** so please see the section below for more informati
167
175
  The 5.x renderer incorporates our new Core validation engine found @ https://github.com/formio/core/tree/master/src/process. This process can be briefly described within the pull request notes @ https://github.com/formio/formio.js/pull/5317. This will also improve our Iso-morphic behavior for our renderer validation and significantly improve memory and processor consumption for server-side form validations. This feature does have a **Breaking Change** which is described below.
168
176
 
169
177
  #### Core SDK
170
- With the 5.x renderer, the Formio SDK is now part of our Core library found @ https://github.com/formio/core/tree/master/src/sdk. It is now imported directly into the @formio/js library and is re-exported to support reverse compatability. Because of this, there should not be any code upgrade involved.
178
+ With the 5.x renderer, the Formio SDK is now part of our Core library found @ https://github.com/formio/core/tree/master/src/sdk. It is now imported directly into the @formio/js library and is re-exported to support reverse compatability. Because of this, there should not be any code upgrade involved.
171
179
 
172
180
  For example, the following code still works.
173
181
 
@@ -208,7 +216,7 @@ With the 5.x version of the renderer/builder, there has been much effort into re
208
216
  - formio.form.min.js ~ 1.4mb => ~30% size reduction
209
217
  - formio.min.js (SDK) ~ 235k => ~50% size reduction
210
218
 
211
- #### New lazy-loading Embedding method.
219
+ #### New lazy-loading Embedding method.
212
220
  One of the more exciting new additions to the 5.x renderer is the new lazy-loading process for adding the renderer to your application. There is a new file that is included with the 5.x renderer called "formio.embed.js". This file is tiny coming in at ~10kb. What this file does, however, is make it so that you can bundle a lazy-loading renderer within your application without increasing the build sizes of your application.
213
221
 
214
222
  To use the new lazy-loading features, you will need to change your imports from the following to the new embed source as the following illustrates.
@@ -280,7 +288,6 @@ Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/e
280
288
  ```
281
289
 
282
290
  ### Breaking Changes
283
- - Sketchpad imageType is being removed. All image types are now treated the same. You no longer need the imageType property in your form json
284
291
  - Bootstrap 5 Default Template - With the 5.x version of the renderer, the default template is now **Bootstrap 5** and is found @ https://github.com/formio/bootstrap repo.
285
292
  - Bootstrap Icons - Now, instead of Font Awesome being the default icon set for our renderer, we are using Bootstrap Icons as the default icon set which is compatible with Bootstrap 5. Of course, you can always change out icon sets, but this is now the default.
286
293
  - This version implements a new validation system. Within this, there are some changes that you should be aware of.
@@ -304,7 +311,7 @@ Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/e
304
311
  ```js
305
312
  const isValid = form.getComponent('editgrid').validateRow().length === 0;
306
313
  ```
307
-
314
+
308
315
  - In the 5.x renderer, the errors array will always be populated if there are errors in the form. They may not be displayed depending on the "pristine" state of the rendered form, but the error is always populated if there are form errors. This is different in 4.x where the error property would only contain and error if an error is VISIBLE on the form. This means that it is difficult to determine if a form has errors without executing the checkValidity() method with the dirty flag set to "true". You no longer need to do this in the 5.x renderer.
309
316
 
310
317
  **4.x Renderer**
@@ -333,7 +340,289 @@ Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/e
333
340
  console.log(textField.visibleErrors); // This is the equivalent of the 4.x renderer "errors" array.
334
341
  ```
335
342
 
336
- - With the 5.x renderer, all templates are now stored within a separate repo, and are included as a dependency for this renderer.
343
+ - With the 5.x renderer, all templates are now stored within a separate repo, and are included as a dependency for this renderer.
344
+
345
+
346
+ ## 5.0.0-rc.102
347
+ ### Changed
348
+ - Updated @formio/core@2.3.0-rc.23
349
+
350
+ ## 5.0.0-rc.101
351
+ ### Changed
352
+ - FIO-9361: Fix showing extra submit buttons
353
+ - FIO-9327: Fixed an issue where select boxes default values would become messed up during builder mode.
354
+ - FIO-9350 Wizard: Show form-level errors after failed submission on subsequent form interaction when current page has no errors
355
+
356
+ ## 5.0.0-rc.100
357
+ ### Changed
358
+ - FIO-8423: change default parent tag from p to div
359
+ - FIO-9347: Fixed select preview issue in form builder
360
+ - FIO-9329: update tooltip for validateWhenHidden
361
+ - FIO-9386: fixed an issue where configured logic prevents the component settings saving because of validation configured in logic
362
+ - FIO-9360: validate current page only on wizard change
363
+
364
+ ## 5.0.0-rc.99
365
+ ### Changed
366
+ - Updated @formio/core@2.3.0-rc.22
367
+ - FIO-9329: validateWhenHidden respects both conditionally hidden and intentionally hidden
368
+ - FIO-9354: Fix custom translation not applied to error message
369
+
370
+ ## 5.0.0-rc.98
371
+ ### Changed
372
+ - FIO-9280 fixed validation for select boxes with valid values and when value property is not set
373
+
374
+ ## 5.0.0-rc.97
375
+ ### Changed
376
+ - Updated @formio/core@2.3.0-rc.21
377
+ - FIO-9290: fixed an issue where infinite loader is shown when radio/selectboxes with url type is failed to load options
378
+ - FIO-9280 fixed value property validation
379
+
380
+ ### Changed
381
+ - FIO-9283: fixed an issue where select with resource dataSrc does not display values in readOnly mode
382
+
383
+ ## 5.0.0-rc.96
384
+ ### Changed
385
+ - Updated @formio/core@2.3.0-rc.18
386
+ - FIO-9259 fixed errors list for parent wizard with nested wizard
387
+ - FIO-9176: updated instance.component.path
388
+ - FIO-9205: fixed labels in select filter feature
389
+
390
+ ## 5.0.0-rc.95
391
+ ### Changed
392
+ - Updated @formio/core@2.3.0-rc.17
393
+ - FIO-9205: fixed an issue where Select Filter feature does not work
394
+ - FIO-9173: Allow Scientific Notations
395
+ - FIO-9247 fixed triggering custom validation inside Edit Grid
396
+
397
+
398
+ ## 5.0.0-rc.94
399
+ ### Changed
400
+ - Updated @formio/bootstrap@3.0.0-rc.41
401
+ - Updated @formio/core@2.3.0-rc.16
402
+
403
+ ## 5.0.0-rc.93
404
+ ### Changed
405
+ - Updated @formio/bootstrap@3.0.0-rc.40
406
+ - Updated @formio/core@2.3.0-rc.14
407
+ - FIO-9197: Fix Day component triggered required validation when loading form
408
+ - FIO-7195: Fixes an issue where Radio/SelectBoxes will show values instead of labels on View tab and in DataTable
409
+ - FIO-7778: validation link does not open modal
410
+ - FIO-9072: removed setting dirty flag to true on set submission and changed tests
411
+ - FIO-9189: moved some methods to core
412
+ - FIO-9228: fixed an issue where error messages are duplicated in error list for nested wizard
413
+
414
+ ## 5.0.0-rc.92
415
+ ### Changed
416
+ - Updated @formio/bootstrap@3.0.0-rc.39
417
+ - Updated @formio/core@2.3.0-rc.13
418
+ - FIO-9196: Fixed issue with getting default value instead of requested value in Day component
419
+ - FIO-9208: Changing the links to go to help.form.io instead of github page.
420
+ - FIO-8510: changes in nested forms trigger modified change in the parent
421
+ - FIO-9086: time component default value validation
422
+ - FIO-9186: added test for the issue reated to validation inside layout components insode editGrid
423
+ - FIO-9184: Fixed edit grid row validation for new row
424
+ - FIO-9144 Fix cursor jump in number component
425
+
426
+ ## 5.0.0-rc.91
427
+ ### Changed
428
+ - Updated @formio/bootstrap@3.0.0-rc.38
429
+ - Updated @formio/core@2.3.0-rc.10
430
+ - FIO-7195/FIO-8234: Fixes an issue where Select renders value properties instead of labels in DataTable
431
+ - FIO-9158: fixed password component error in Edit page
432
+ - FIO-9153: fixed an issue where tagpad components skip front-end validation before submission
433
+
434
+ ## 5.0.0-rc.90
435
+ ### Changed
436
+ - Updated @formio/core@2.3.0-rc.9
437
+ - FIO-9127 fixed saving empty values for Day component with hidden fields
438
+
439
+ ## 5.0.0-rc.89
440
+ ### Changed
441
+ - Updated @formio/core@2.3.0-rc.8
442
+ - FIO-8914: fixed an issue where select url does not work properly when url value has whitespaces at the end
443
+ - FIO-8990: fixed incorrect moment export
444
+ - FIO-9056: Fix enabling multiple values for address component
445
+ - FIO-9147: fixed an issue where the simple conditionally visible component is not validated on change
446
+ - FIO-9126 fixed display of value for Day component with hidden fields
447
+ - FIO-9120: Fix issue with unchecking radio default value
448
+ - FIO-9158: fixed an issue where Password component error message persists to displayed in Edit page
449
+ - FIO-9127 fixed saving an empty value for day component after deleting values
450
+ - FIO-9153-9154: fixed console errors when navigating tagpad validation errors
451
+ - FIO-8948-8950: fixed an issue where radio and select boxes with url type do not display in PDF download
452
+ - FIO-9080 checkbox radio validation error
453
+ - FIO-9148: Fixed duplicated revision versions
454
+
455
+ ## 5.0.0-rc.88
456
+ ### Changed
457
+ - Updated @formio/core@2.3.0-rc.7
458
+
459
+ ## 5.0.0-rc.87
460
+ ### Changed
461
+ - FIO-9059: fixed an issue where the value for textarea with json datatype is not normalized and set correctly
462
+
463
+ ## 5.0.0-rc.86
464
+ ### Changed
465
+ - Updated @formio/core@2.3.0-rc.6
466
+
467
+ - FIO-9075: fixed an issue where the form cannot be resubmitted if it has server errors
468
+ - FIO-8414 | FIO-8403 | FIO-8389: Fixes 5x validations and conditionals for array data components
469
+ - FIO-9097 fixed navigation through the errors list
470
+
471
+ ## 5.0.0-rc.85
472
+ ### Changed
473
+ - Updated @formio/core@2.3.0-rc.4
474
+
475
+ ### Changed
476
+ - FIO-8719 fixed error message display for nested wizard components
477
+ - FIO-8962 Fixed screen shifting when validation errors pop up in an embedded Wizard form
478
+ - Bugfix: allow paths for valueProperty
479
+
480
+ ## 5.0.0-rc.84
481
+
482
+ ## 5.0.0-rc.83
483
+ ### Changed
484
+ - FIO-9010: tighten up multivalue normalization by covering 'any' type models
485
+ - FIO-8986 fixed setting default value for day ,component with hidden day and month
486
+ - FIO-9034 fixed creating extra submit button
487
+
488
+ ## 5.0.0-rc.82
489
+ ### Changed
490
+ - FIO-8234/FIO-7195: Fixes an issue where value properties are shown instead of labels for Select component with Resource/URL data sources in read only mode and for modal preview
491
+
492
+ ## 5.0.0-rc.81
493
+ ### Changed
494
+ - Updated @formio/core@2.3.0-rc.3
495
+ - FIO-8991: fixed an issue where select value (when it is array with numbers) does not display in submission grid
496
+ - FIO-8951: Updated conditions for selectData and added logic to clear selectData
497
+ - FIO-9010 fixed disappearance of components inside Columns after editing
498
+ - FIO-8938 fixed label display for multiple select with dataSrc resource
499
+ - FIO-8908: Fix error message appears when saving not fully filled conditionals tab
500
+
501
+ ## 5.0.0-rc.80
502
+ ### Changed
503
+ - Updated @formio/core@2.2.3-rc.2
504
+
505
+ ## 5.0.0-rc.79
506
+ ### Changed
507
+ - Updated @formio/core@2.2.3-rc.1
508
+ - FIO-8914: fixed an issue where errors list doesnot appear when submitting a PDF form
509
+ - FIO-8954 previously selected option is displayed in metadata with data source = url
510
+ - FIO-8920 fixed errors list for the form with nested wizard
511
+ - FIO-8986 fixed setting up of default value with hidden fields
512
+ - FIO-8912: fix normalization in submission
513
+ - Fixed an issue where the 'root' may be the component that does not have a getComponent method
514
+ - FIO-8972 fixed display of select componet with custom dataSrc on Data Tab
515
+ - FIO-8912 update to model types
516
+
517
+ ## 5.0.0-rc.78
518
+ ### Changed
519
+ - FIO-8072: Added conditional operators for select component with number data type
520
+
521
+ ## 5.0.0-rc.77
522
+ ### Changed
523
+ - Updated @formio/core@2.2.2
524
+ - FIO-8900-8899: made only 2 operators available for address component in conditionals ui and fixed setting an empty value for address
525
+ - FIO-8912: consolidate normalization for multivalue components
526
+ - FIO-8795 fixed selected data after removing row
527
+
528
+ ## 5.0.0-rc.76
529
+ ### Changed
530
+ - Updated @formio/core@2.2.2-rc.5
531
+ - FIO-8874: fixed conditional value field for time component
532
+ - FIO-8849: fixed an issue where value of the selctboxes/radio with URL data source are not available in simple conditons UI
533
+ - FIO-8931: Disable file synchronization feature
534
+ - FIO-8866-8864: fixed simple conditions operators for recaptcha
535
+ - FIO-8921: fixed an issue where newly created PDF-form cannot be saved in builder after adding some components in it
536
+ - FIO-8798: updated shape of the data of day component with hidden fields
537
+
538
+ ## 5.0.0-rc.75
539
+ ### Changed
540
+ - Updated @formio/core@2.2.2-rc.3
541
+
542
+ ## 5.0.0-rc.74
543
+ ### Changed
544
+ - Updated @formio/core@2.2.2-rc.2
545
+ - FIO-8799 updated conditional tab for Time Component
546
+ - FIO-8797: set empty day component value to the empty string
547
+
548
+ - FIO-8760: Fixes an issue where nested form is not getting all the options
549
+ - FIO-8789: Fixing issues where the wrong urls are used for CDN on remote environments
550
+
551
+ ## 5.0.0-rc.73
552
+ ### Changed
553
+ - FIO-8729: fixed an issue where the rollback to default templates does not work correctly and unknown template message is shown
554
+
555
+ ## 5.0.0-rc.72
556
+ ### Changed
557
+ - Updated @formio/core@2.2.2-rc.1
558
+ - FIO-8684: Fixes cannot attach more than one component to the PDF form
559
+ - Bugfix/submission metadata nullish
560
+ - FIO-8765: fixed an issue where dataMap thows an error
561
+ - FIO-8719 fixed validation for Data Grid component inside nested wizard
562
+
563
+ ### Changed
564
+ - FIO-8621: error event on file upload adding
565
+ - FIO-8783: Fixed the issue when validation messages disappear after collapse and expand the panel
566
+
567
+ ## 5.0.0-rc.71
568
+ ### Changed
569
+ - Updated @formio/bootstrap@3.0.0-rc.37
570
+
571
+ ## 5.0.0-rc.70
572
+ ### Changed
573
+ - Updated @formio/core@2.2.0-rc.9
574
+ - FIO-8759 fixed validation for the default value component
575
+ - FIO-8752: coerced keyboard actions to a boolean value
576
+ - FIO-8389: Fix conditional logic for Edit Grid
577
+ - FIO-8647,8721: validation not triggered for each row after the first one in data and edit grid
578
+ - FIO-8720: fixed errors occurring with valid time and number components
579
+ - FIO-8719 fixed validation for nested wizard fields
580
+ - FIO-5748 Fixed preview not working correctly after hiding/showing it
581
+
582
+ ## 5.0.0-rc.69
583
+ ### Changed
584
+ - Updated @formio/core@2.2.0-rc.7
585
+ - FIO-8570: fixed decimal symbol property on number component
586
+ - FIO-8570: fixed thousandSeparator problem and decimal symbol problem
587
+
588
+ ## 5.0.0-rc.68
589
+ ### Changed
590
+ - Updated @formio/core@2.2.0-rc.6
591
+ - FIO-7733 remove form min height
592
+ - FIO-8710: fixed incorrect Components import that causes errors when interacting with form components
593
+ - FIO-8716 fixed unsavedRows validation for Edit Grid
594
+ - FIO-7478: fixed and isse where dataGrod reordering does not work in 5.x and fixed reordering with select component
595
+
596
+ ## 5.0.0-rc.67
597
+ ### Changed
598
+ - Updated @formio/core@2.2.0-rc.5
599
+ - FIO-8633 fixed icon name for Edit Grid
600
+ - FIO-8645: day component required validation error not correct
601
+ - FIO-8688 fixed 'global is not defined' error message
602
+ - FIO-8639 fixed error when adding address component
603
+
604
+ ## 5.0.0-rc.66
605
+ ### Changed
606
+ - FIO-8652: DataGrid does not reorder
607
+ - FIO-8659: no modal edit in display tab
608
+
609
+ ## 5.0.0-rc.65
610
+ ### Changed
611
+ - Updated @formio/core@2.2.0-rc.4
612
+
613
+ ## 5.0.0-rc.64
614
+ ### Changed
615
+ - Removing fetch ponyfill since it is no longer needed.
616
+
617
+ ## 5.0.0-rc.63
618
+ ### Changed
619
+ - Fixing the formioReady promise to always resolve if you load it from the full source instead of the embed code.
620
+
621
+ ## 5.0.0-rc.62
622
+ ### Changed
623
+ - Updated @formio/bootstrap@3.0.0-rc.36
624
+
625
+
337
626
 
338
627
  ### Fixed
339
628
  - FIO-7525: fixed an issue where new conditional logic based on select boxes does not work
@@ -417,6 +706,8 @@ Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/e
417
706
  - FIO-8496: added loading=async for Google Maps JavaScript API
418
707
  - FIO-8445: Fixed searchbar not focusing when navigating using up and down arrows
419
708
  - FIO-7936: showCounter messages not translating
709
+ - FIO-7775: reset value event resets component values to their default values
710
+ - FIO-6710: added translation for day component placeholder
420
711
 
421
712
  ## 5.0.0-rc.37
422
713
  ### Fixed
@@ -5314,7 +5314,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
5314
5314
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5315
5315
 
5316
5316
  "use strict";
5317
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst ListComponent_1 = __importDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/cjs/components/_classes/list/ListComponent.js\"));\nconst Formio_1 = __webpack_require__(/*! ../../Formio */ \"./lib/cjs/Formio.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst uuid_1 = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/commonjs-browser/index.js\");\nclass RadioComponent extends ListComponent_1.default {\n static schema(...extend) {\n return ListComponent_1.default.schema({\n type: 'radio',\n inputType: 'radio',\n label: 'Radio',\n key: 'radio',\n values: [{ label: '', value: '' }],\n data: {\n url: '',\n },\n fieldSet: false\n }, ...extend);\n }\n static get builderInfo() {\n return {\n title: 'Radio',\n group: 'basic',\n icon: 'dot-circle-o',\n weight: 80,\n documentation: '/userguide/form-building/form-components#radio',\n schema: RadioComponent.schema()\n };\n }\n static get conditionOperatorsSettings() {\n return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {\n const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';\n return isValuesSrc\n ? {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: classComp.dataType || '',\n data: {\n custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,\n }\n }\n : Object.assign(Object.assign({}, classComp), { type: 'select' });\n } });\n }\n static get serverConditionSettings() {\n return RadioComponent.conditionOperatorsSettings;\n }\n static savedValueTypes(schema) {\n const { boolean, string, number, object, array } = utils_1.componentValueTypes;\n const { dataType } = schema;\n const types = (0, utils_1.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (utils_1.componentValueTypes[dataType]) {\n return [utils_1.componentValueTypes[dataType]];\n }\n return [boolean, string, number, object, array];\n }\n constructor(component, options, data) {\n super(component, options, data);\n this.previousValue = this.dataValue || null;\n }\n get defaultSchema() {\n return RadioComponent.schema();\n }\n get defaultValue() {\n let defaultValue = super.defaultValue;\n if (!defaultValue && this.component.defaultValue === false) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n resetValue() {\n this.unset();\n this.setValue(this.emptyValue, {\n noUpdateEvent: true,\n noValidate: true,\n resetValue: true\n });\n }\n get inputInfo() {\n var _a;\n const info = super.elementInfo();\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr.class = 'form-check-input';\n info.attr.name = info.attr.name += `[${(_a = this.root) === null || _a === void 0 ? void 0 : _a.id}-${this.id}]`;\n return info;\n }\n get emptyValue() {\n return '';\n }\n get isRadio() {\n return this.component.inputType === 'radio';\n }\n get optionSelectedClass() {\n return 'radio-selected';\n }\n get listData() {\n const listData = lodash_1.default.get(this.root, 'submission.metadata.listData', {});\n return lodash_1.default.get(listData, this.path);\n }\n get selectMetadata() {\n return super.selectData;\n }\n get selectData() {\n return this.selectMetadata || this.component.selectData;\n }\n init() {\n super.init();\n this.templateData = {};\n // Trigger an update.//\n let updateArgs = [];\n const triggerUpdate = lodash_1.default.debounce((...args) => {\n updateArgs = [];\n return this.updateItems.apply(this, args);\n }, 100);\n this.triggerUpdate = (...args) => {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof this.itemsLoadedResolve === 'function') {\n this.itemsLoadedResolve();\n }\n this.itemsLoaded = new Promise((resolve) => {\n this.itemsLoadedResolve = resolve;\n });\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate(...updateArgs);\n };\n this.itemsLoaded = new Promise((resolve) => {\n this.itemsLoadedResolve = resolve;\n });\n this.optionsLoaded = !this.component.dataSrc || this.component.dataSrc === 'values';\n this.loadedOptions = [];\n this.valuesMap = new Map();\n if (!this.visible) {\n this.itemsLoadedResolve();\n }\n // Get the template keys for this radio component.\n this.getTemplateKeys();\n }\n beforeSubmit() {\n return new Promise(res => {\n this.dataReady.then(() => res(true));\n });\n }\n render() {\n if (!this.optionsLoaded) {\n return super.render(this.renderTemplate('loader'));\n }\n return super.render(this.renderTemplate('radio', {\n input: this.inputInfo,\n inline: this.component.inline,\n values: this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions,\n value: this.dataValue,\n row: this.row,\n }));\n }\n attach(element) {\n this.loadRefs(element, { input: 'multiple', wrapper: 'multiple' });\n this.refs.input.forEach((input, index) => {\n this.addEventListener(input, this.inputInfo.changeEvent, () => {\n this.updateValue(null, {\n modified: true,\n });\n });\n if (this.component.values[index]) {\n this.addShortcut(input, this.component.values[index].shortcut);\n }\n if (this.isRadio) {\n let dataValue = this.dataValue;\n if (!lodash_1.default.isString(this.dataValue)) {\n dataValue = lodash_1.default.toString(this.dataValue);\n }\n if (this.isSelectURL) {\n const valueKey = this.loadedOptions[index].value;\n const optionValue = this.valuesMap.has(valueKey)\n ? this.valuesMap.get(valueKey)\n : valueKey;\n input.checked = lodash_1.default.isEqual(this.normalizeValue(optionValue), this.dataValue);\n }\n else {\n input.checked = (dataValue === input.value && (input.value || this.component.dataSrc !== 'url'));\n }\n this.addEventListener(input, 'keyup', (event) => {\n if (event.key === ' ' && dataValue === input.value) {\n event.preventDefault();\n this.updateValue(null, {\n modified: true,\n });\n }\n });\n }\n });\n this.triggerUpdate();\n this.setSelectedClasses();\n return super.attach(element);\n }\n detach(element) {\n if (element && this.refs.input) {\n this.refs.input.forEach((input, index) => {\n if (this.component.values[index]) {\n this.removeShortcut(input, this.component.values[index].shortcut);\n }\n });\n }\n super.detach();\n }\n getValue() {\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n // If the input type of the component is checkbox the value should be determined by the checkboxes checked property\n let value = this.component.inputType === 'checkbox' ? '' : this.dataValue;\n this.refs.input.forEach((input, index) => {\n if (input.checked) {\n if (!this.isSelectURL) {\n value = input.value;\n return;\n }\n const optionValue = this.loadedOptions[index].value;\n value = this.valuesMap.has(optionValue)\n ? this.valuesMap.get(optionValue)\n : optionValue;\n }\n });\n return value;\n }\n validateValueProperty() {\n if (this.component.dataSrc === 'values') {\n return true;\n }\n return !lodash_1.default.some(this.refs.wrapper, (wrapper, index) => this.refs.input[index].checked && this.loadedOptions[index].invalid);\n }\n validateValueAvailability(setting, value) {\n if (!(0, utils_1.boolValue)(setting) || !value) {\n return true;\n }\n const values = this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions;\n if (values) {\n return values.findIndex(({ value: optionValue }) => this.normalizeValue(optionValue) === value) !== -1;\n }\n return false;\n }\n getValueAsString(value, options = {}) {\n if (lodash_1.default.isObject(value)) {\n value = JSON.stringify(value);\n }\n else if (!lodash_1.default.isString(value)) {\n value = lodash_1.default.toString(value);\n }\n const shouldUseSelectData = (options.modalPreview || this.inDataTable)\n && this.component.dataSrc === 'url' && (this.loadedOptions.length || this.selectData);\n if (this.component.dataSrc !== 'values' && !shouldUseSelectData) {\n return value;\n }\n const values = shouldUseSelectData ? this.loadedOptions : this.component.values;\n const option = !(values === null || values === void 0 ? void 0 : values.length) && shouldUseSelectData ? {\n label: this.itemTemplate(this.selectData),\n } : lodash_1.default.find(values, (v) => v.value === value);\n if (!value) {\n return lodash_1.default.get(option, 'label', '');\n }\n return lodash_1.default.get(option, 'label', '');\n }\n setValueAt(index, value) {\n if (this.refs.input && this.refs.input[index] && value !== null && value !== undefined) {\n const inputValue = this.getValueByInput(this.refs.input[index]);\n this.refs.input[index].checked = lodash_1.default.isEqual(inputValue, value);\n }\n }\n get shouldLoad() {\n // do not load options if the value is empty in readOnly and we have options available in metadata\n if (this.options.readOnly && this.isEmpty() && this.listData) {\n return false;\n }\n return super.shouldLoad;\n }\n prepareValue(item, options = {}) {\n const value = this.component.valueProperty && !options.skipValueProperty\n ? lodash_1.default.get(item, this.component.valueProperty)\n : item;\n if (this.component.type === 'radio' && typeof value !== 'string') {\n const uuid = (0, uuid_1.v4)();\n this.valuesMap.set(uuid, value);\n return uuid;\n }\n return value;\n }\n getValueByInput(input) {\n const inputValue = input.value;\n return this.valuesMap.has(inputValue)\n ? this.valuesMap.get(inputValue)\n : inputValue;\n }\n loadItems(url, search, headers, options, method, body) {\n if (this.optionsLoaded) {\n this.itemsLoadedResolve();\n return;\n }\n if (!this.shouldLoad && this.listData) {\n this.loadItemsFromMetadata();\n this.itemsLoadedResolve();\n this.optionsLoaded = true;\n return;\n }\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n const limit = this.component.limit || 100;\n const skip = this.isScrollLoading ? this.selectOptions.length : 0;\n // Allow for url interpolation.\n url = this.sanitize(this.interpolate(url, {\n formioBase: Formio_1.Formio.getBaseUrl(),\n search,\n limit,\n skip,\n page: Math.abs(Math.floor(skip / limit))\n }), this.shouldSanitizeValue);\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n // Make the request.\n options.header = headers;\n this.loading = true;\n Formio_1.Formio.makeRequest(this.options.formio, 'select', url, method, body, options)\n .then((response) => {\n this.loading = false;\n this.setItems(response);\n })\n .catch((err) => {\n this.handleLoadingError(err);\n })\n .finally(() => {\n this.optionsLoaded = true;\n this.redraw();\n });\n }\n loadItemsFromMetadata() {\n this.listData.forEach((item, i) => {\n this.loadedOptions[i] = {\n label: this.itemTemplate(item)\n };\n if (lodash_1.default.isEqual(item, this.selectData || lodash_1.default.pick(this.dataValue, lodash_1.default.keys(item)))) {\n this.loadedOptions[i].value = this.prepareValue(this.dataValue, { skipValueProperty: true });\n }\n });\n this.optionsLoaded = true;\n this.redraw();\n }\n setItems(items) {\n const listData = [];\n items === null || items === void 0 ? void 0 : items.forEach((item, i) => {\n const valueAtProperty = lodash_1.default.get(item, this.component.valueProperty);\n const value = this.prepareValue(item);\n const label = this.component.valueProperty\n ? this.itemTemplate(item, valueAtProperty, i)\n : this.itemTemplate(item, item, i);\n this.loadedOptions[i] = { label, value };\n listData.push(this.templateData[i]);\n if (this.valuesMap.has(value)) {\n this.templateData[value] = this.templateData[i];\n }\n if (!this.isRadio && (lodash_1.default.isObject(value) || lodash_1.default.isBoolean(value) || lodash_1.default.isUndefined(value))) {\n this.loadedOptions[i].invalid = true;\n }\n });\n if (this.isSelectURL) {\n const submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.listData) {\n submission.metadata.listData = {};\n }\n lodash_1.default.set(submission.metadata.listData, this.path, listData);\n }\n this.itemsLoadedResolve();\n }\n setSelectedClasses() {\n if (this.refs.wrapper) {\n //add/remove selected option class\n const value = this.dataValue;\n this.refs.wrapper.forEach((wrapper, index) => {\n const input = this.refs.input[index];\n const checked = (input.type === 'checkbox')\n ? value[input.value] || input.checked\n : lodash_1.default.isEqual(this.normalizeValue(this.getValueByInput(input)), value);\n if (checked) {\n //add class to container when selected\n this.addClass(wrapper, this.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n }\n else {\n this.removeClass(wrapper, this.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n setMetadata(value) {\n let key = value;\n if (typeof value !== 'string') {\n const checkedInput = Array.prototype.find.call(this.refs.input, (input => input.type === 'radio' && input.getAttribute('checked')));\n key = (checkedInput === null || checkedInput === void 0 ? void 0 : checkedInput.value) || key;\n }\n if (this.isSelectURL && this.templateData && this.templateData[key]) {\n const submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n lodash_1.default.set(submission.metadata.selectData, this.path, this.templateData[key]);\n }\n }\n updateValue(value, flags) {\n const changed = super.updateValue(value, flags);\n if (changed) {\n this.setSelectedClasses();\n this.setMetadata(this.dataValue);\n }\n if (!flags || !flags.modified || !this.isRadio) {\n if (changed) {\n this.previousValue = this.dataValue;\n }\n return changed;\n }\n // If they clicked on the radio that is currently selected, it needs to reset the value.\n this.currentValue = this.dataValue;\n const shouldResetValue = flags && flags.modified && !flags.noUpdateEvent && this.previousValue === this.currentValue;\n if (shouldResetValue) {\n this.resetValue();\n this.triggerChange(flags);\n this.setSelectedClasses();\n }\n this.previousValue = this.dataValue;\n return changed;\n }\n /**\n * Normalize values coming into updateValue. For example, depending on the configuration, string value `\"true\"` will be normalized to boolean `true`.\n * @param {*} value - The value to normalize\n * @returns {*} - Returns the normalized value\n */\n normalizeValue(value) {\n const dataType = this.component.dataType || 'auto';\n if (value === this.emptyValue) {\n return value;\n }\n switch (dataType) {\n case 'auto':\n if (!isNaN(parseFloat(value)) && isFinite(value) && lodash_1.default.toString(value) === Number(value).toString()) {\n value = +value;\n }\n if (value === 'true') {\n value = true;\n }\n if (value === 'false') {\n value = false;\n }\n break;\n case 'number':\n value = +value;\n break;\n case 'string':\n if (typeof value === 'object') {\n value = JSON.stringify(value);\n }\n else {\n value = String(value);\n }\n break;\n case 'boolean':\n value = !(!value || value.toString() === 'false');\n break;\n }\n return super.normalizeValue(value);\n }\n isSingleInputValue() {\n return true;\n }\n}\nexports[\"default\"] = RadioComponent;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/components/radio/Radio.js?");
5317
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst ListComponent_1 = __importDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/cjs/components/_classes/list/ListComponent.js\"));\nconst Formio_1 = __webpack_require__(/*! ../../Formio */ \"./lib/cjs/Formio.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nclass RadioComponent extends ListComponent_1.default {\n static schema(...extend) {\n return ListComponent_1.default.schema({\n type: 'radio',\n inputType: 'radio',\n label: 'Radio',\n key: 'radio',\n values: [{ label: '', value: '' }],\n data: {\n url: '',\n },\n fieldSet: false\n }, ...extend);\n }\n static get builderInfo() {\n return {\n title: 'Radio',\n group: 'basic',\n icon: 'dot-circle-o',\n weight: 80,\n documentation: '/userguide/form-building/form-components#radio',\n schema: RadioComponent.schema()\n };\n }\n static get conditionOperatorsSettings() {\n return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { valueComponent(classComp) {\n const isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';\n return isValuesSrc\n ? {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: classComp.dataType || '',\n data: {\n custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`,\n }\n }\n : Object.assign(Object.assign({}, classComp), { type: 'select' });\n } });\n }\n static get serverConditionSettings() {\n return RadioComponent.conditionOperatorsSettings;\n }\n static savedValueTypes(schema) {\n const { boolean, string, number, object, array } = utils_1.componentValueTypes;\n const { dataType } = schema;\n const types = (0, utils_1.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (utils_1.componentValueTypes[dataType]) {\n return [utils_1.componentValueTypes[dataType]];\n }\n return [boolean, string, number, object, array];\n }\n constructor(component, options, data) {\n super(component, options, data);\n this.previousValue = this.dataValue || null;\n }\n get defaultSchema() {\n return RadioComponent.schema();\n }\n get defaultValue() {\n let defaultValue = super.defaultValue;\n if (!defaultValue && this.component.defaultValue === false) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n resetValue() {\n this.unset();\n this.setValue(this.emptyValue, {\n noUpdateEvent: true,\n noValidate: true,\n resetValue: true\n });\n }\n get inputInfo() {\n var _a;\n const info = super.elementInfo();\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr.class = 'form-check-input';\n info.attr.name = info.attr.name += `[${(_a = this.root) === null || _a === void 0 ? void 0 : _a.id}-${this.id}]`;\n return info;\n }\n get emptyValue() {\n return '';\n }\n get isRadio() {\n return this.component.inputType === 'radio';\n }\n get optionSelectedClass() {\n return 'radio-selected';\n }\n get listData() {\n const listData = lodash_1.default.get(this.root, 'submission.metadata.listData', {});\n return lodash_1.default.get(listData, this.path);\n }\n get selectMetadata() {\n return super.selectData;\n }\n get selectData() {\n return this.selectMetadata || this.component.selectData;\n }\n init() {\n super.init();\n this.templateData = {};\n // Trigger an update.//\n let updateArgs = [];\n const triggerUpdate = lodash_1.default.debounce((...args) => {\n updateArgs = [];\n return this.updateItems.apply(this, args);\n }, 100);\n this.triggerUpdate = (...args) => {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof this.itemsLoadedResolve === 'function') {\n this.itemsLoadedResolve();\n }\n this.itemsLoaded = new Promise((resolve) => {\n this.itemsLoadedResolve = resolve;\n });\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate(...updateArgs);\n };\n this.itemsLoaded = new Promise((resolve) => {\n this.itemsLoadedResolve = resolve;\n });\n this.optionsLoaded = !this.component.dataSrc || this.component.dataSrc === 'values';\n this.loadedOptions = [];\n if (!this.visible) {\n this.itemsLoadedResolve();\n }\n // Get the template keys for this radio component.\n this.getTemplateKeys();\n }\n beforeSubmit() {\n return new Promise(res => {\n this.dataReady.then(() => res(true));\n });\n }\n render() {\n if (!this.optionsLoaded) {\n return super.render(this.renderTemplate('loader'));\n }\n return super.render(this.renderTemplate('radio', {\n input: this.inputInfo,\n inline: this.component.inline,\n values: this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions,\n value: this.dataValue,\n row: this.row,\n }));\n }\n attach(element) {\n this.loadRefs(element, { input: 'multiple', wrapper: 'multiple' });\n this.refs.input.forEach((input, index) => {\n this.addEventListener(input, this.inputInfo.changeEvent, () => {\n this.updateValue(null, {\n modified: true,\n });\n });\n if (this.component.values[index]) {\n this.addShortcut(input, this.component.values[index].shortcut);\n }\n if (this.isRadio) {\n let dataValue = this.dataValue;\n if (!lodash_1.default.isString(this.dataValue)) {\n dataValue = lodash_1.default.toString(this.dataValue);\n }\n if (this.isSelectURL && lodash_1.default.isObject(this.loadedOptions[index].value)) {\n const optionValue = this.component.dataType === 'string' ? JSON.stringify(this.loadedOptions[index].value) : this.loadedOptions[index].value;\n input.checked = lodash_1.default.isEqual(optionValue, this.dataValue);\n }\n else {\n input.checked = (dataValue === input.value && (input.value || this.component.dataSrc !== 'url'));\n }\n this.addEventListener(input, 'keyup', (event) => {\n if (event.key === ' ' && dataValue === input.value) {\n event.preventDefault();\n this.updateValue(null, {\n modified: true,\n });\n }\n });\n }\n });\n this.triggerUpdate();\n this.setSelectedClasses();\n return super.attach(element);\n }\n detach(element) {\n if (element && this.refs.input) {\n this.refs.input.forEach((input, index) => {\n if (this.component.values[index]) {\n this.removeShortcut(input, this.component.values[index].shortcut);\n }\n });\n }\n super.detach();\n }\n getValue() {\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n // If the input type of the component is checkbox the value should be determined by the checkboxes checked property\n let value = this.component.inputType === 'checkbox' ? '' : this.dataValue;\n this.refs.input.forEach((input, index) => {\n if (input.checked) {\n value = (this.isSelectURL && lodash_1.default.isObject(this.loadedOptions[index].value)) ?\n this.loadedOptions[index].value :\n input.value;\n }\n });\n return value;\n }\n validateValueProperty() {\n if (this.component.dataSrc === 'values') {\n return true;\n }\n return !lodash_1.default.some(this.refs.wrapper, (wrapper, index) => this.refs.input[index].checked && this.loadedOptions[index].invalid);\n }\n validateValueAvailability(setting, value) {\n if (!(0, utils_1.boolValue)(setting) || !value) {\n return true;\n }\n const values = this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions;\n if (values) {\n return values.findIndex(({ value: optionValue }) => this.normalizeValue(optionValue) === value) !== -1;\n }\n return false;\n }\n getValueAsString(value, options = {}) {\n if (lodash_1.default.isObject(value)) {\n value = JSON.stringify(value);\n }\n else if (!lodash_1.default.isString(value)) {\n value = lodash_1.default.toString(value);\n }\n const shouldUseSelectData = (options.modalPreview || this.inDataTable)\n && this.component.dataSrc === 'url' && (this.loadedOptions.length || this.selectData);\n if (this.component.dataSrc !== 'values' && !shouldUseSelectData) {\n return value;\n }\n const values = shouldUseSelectData ? this.loadedOptions : this.component.values;\n const option = !(values === null || values === void 0 ? void 0 : values.length) && shouldUseSelectData ? {\n label: this.itemTemplate(this.selectData),\n } : lodash_1.default.find(values, (v) => v.value === value);\n if (!value) {\n return lodash_1.default.get(option, 'label', '');\n }\n return lodash_1.default.get(option, 'label', '');\n }\n setValueAt(index, value) {\n if (this.refs.input && this.refs.input[index] && value !== null && value !== undefined) {\n const inputValue = this.refs.input[index].value;\n this.refs.input[index].checked = (inputValue === value.toString());\n }\n }\n get shouldLoad() {\n // do not load options if the value is empty in readOnly and we have options available in metadata\n if (this.options.readOnly && this.isEmpty() && this.listData) {\n return false;\n }\n return super.shouldLoad;\n }\n loadItems(url, search, headers, options, method, body) {\n if (this.optionsLoaded) {\n this.itemsLoadedResolve();\n return;\n }\n if (!this.shouldLoad && this.listData) {\n this.loadItemsFromMetadata();\n this.itemsLoadedResolve();\n this.optionsLoaded = true;\n return;\n }\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n const limit = this.component.limit || 100;\n const skip = this.isScrollLoading ? this.selectOptions.length : 0;\n // Allow for url interpolation.\n url = this.sanitize(this.interpolate(url, {\n formioBase: Formio_1.Formio.getBaseUrl(),\n search,\n limit,\n skip,\n page: Math.abs(Math.floor(skip / limit))\n }), this.shouldSanitizeValue);\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n // Make the request.\n options.header = headers;\n this.loading = true;\n Formio_1.Formio.makeRequest(this.options.formio, 'select', url, method, body, options)\n .then((response) => {\n this.loading = false;\n this.setItems(response);\n })\n .catch((err) => {\n this.handleLoadingError(err);\n })\n .finally(() => {\n this.optionsLoaded = true;\n this.redraw();\n });\n }\n loadItemsFromMetadata() {\n this.listData.forEach((item, i) => {\n this.loadedOptions[i] = {\n label: this.itemTemplate(item)\n };\n if (lodash_1.default.isEqual(item, this.selectData || lodash_1.default.pick(this.dataValue, lodash_1.default.keys(item)))) {\n this.loadedOptions[i].value = this.dataValue;\n }\n });\n this.optionsLoaded = true;\n this.redraw();\n }\n setItems(items) {\n const listData = [];\n items === null || items === void 0 ? void 0 : items.forEach((item, i) => {\n const valueAtProperty = lodash_1.default.get(item, this.component.valueProperty);\n this.loadedOptions[i] = {\n value: this.component.valueProperty ? valueAtProperty : item,\n label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)\n };\n listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);\n const value = this.loadedOptions[i].value;\n if (!this.isRadio && (lodash_1.default.isObject(value) || lodash_1.default.isBoolean(value) || lodash_1.default.isUndefined(value))) {\n this.loadedOptions[i].invalid = true;\n }\n });\n if (this.isSelectURL) {\n const submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.listData) {\n submission.metadata.listData = {};\n }\n lodash_1.default.set(submission.metadata.listData, this.path, listData);\n }\n this.itemsLoadedResolve();\n }\n setSelectedClasses() {\n if (this.refs.wrapper) {\n //add/remove selected option class\n const value = this.dataValue;\n this.refs.wrapper.forEach((wrapper, index) => {\n const input = this.refs.input[index];\n const checked = (input.type === 'checkbox') ? value[input.value] || input.checked : (input.value.toString() === value.toString());\n if (checked) {\n //add class to container when selected\n this.addClass(wrapper, this.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n }\n else {\n this.removeClass(wrapper, this.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n updateValue(value, flags) {\n const changed = super.updateValue(value, flags);\n if (changed) {\n this.setSelectedClasses();\n }\n if (!flags || !flags.modified || !this.isRadio) {\n if (changed) {\n this.previousValue = this.dataValue;\n }\n return changed;\n }\n // If they clicked on the radio that is currently selected, it needs to reset the value.\n this.currentValue = this.dataValue;\n const shouldResetValue = flags && flags.modified && !flags.noUpdateEvent && this.previousValue === this.currentValue;\n if (shouldResetValue) {\n this.resetValue();\n this.triggerChange(flags);\n this.setSelectedClasses();\n }\n this.previousValue = this.dataValue;\n return changed;\n }\n /**\n * Normalize values coming into updateValue. For example, depending on the configuration, string value `\"true\"` will be normalized to boolean `true`.\n * @param {*} value - The value to normalize\n * @returns {*} - Returns the normalized value\n */\n normalizeValue(value) {\n const dataType = this.component.dataType || 'auto';\n if (value === this.emptyValue) {\n return value;\n }\n switch (dataType) {\n case 'auto':\n if (!isNaN(parseFloat(value)) && isFinite(value) && lodash_1.default.toString(value) === Number(value).toString()) {\n value = +value;\n }\n if (value === 'true') {\n value = true;\n }\n if (value === 'false') {\n value = false;\n }\n break;\n case 'number':\n value = +value;\n break;\n case 'string':\n if (typeof value === 'object') {\n value = JSON.stringify(value);\n }\n else {\n value = String(value);\n }\n break;\n case 'boolean':\n value = !(!value || value.toString() === 'false');\n break;\n }\n if (this.isSelectURL && this.templateData && this.templateData[value]) {\n const submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n lodash_1.default.set(submission.metadata.selectData, this.path, this.templateData[value]);\n }\n return super.normalizeValue(value);\n }\n}\nexports[\"default\"] = RadioComponent;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/components/radio/Radio.js?");
5318
5318
 
5319
5319
  /***/ }),
5320
5320
 
@@ -5501,7 +5501,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
5501
5501
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5502
5502
 
5503
5503
  "use strict";
5504
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Webform = exports.EventEmitter = exports.Licenses = exports.Formio = exports.Form = exports.Utils = exports.Templates = exports.Widgets = exports.Providers = exports.Displays = exports.Components = exports.FormioCore = exports.useModule = exports.registerModule = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Formio_1 = __webpack_require__(/*! ./Formio */ \"./lib/cjs/Formio.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return Formio_1.Formio; } }));\nconst components_1 = __importDefault(__webpack_require__(/*! ./components */ \"./lib/cjs/components/index.js\"));\nconst Components_1 = __importDefault(__webpack_require__(/*! ./components/Components */ \"./lib/cjs/components/Components.js\"));\nexports.Components = Components_1.default;\nconst Displays_1 = __importDefault(__webpack_require__(/*! ./displays/Displays */ \"./lib/cjs/displays/Displays.js\"));\nexports.Displays = Displays_1.default;\nconst Templates_1 = __importDefault(__webpack_require__(/*! ./templates/Templates */ \"./lib/cjs/templates/Templates.js\"));\nexports.Templates = Templates_1.default;\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nexports.Providers = providers_1.default;\nconst widgets_1 = __importDefault(__webpack_require__(/*! ./widgets */ \"./lib/cjs/widgets/index.js\"));\nexports.Widgets = widgets_1.default;\nconst Form_1 = __importDefault(__webpack_require__(/*! ./Form */ \"./lib/cjs/Form.js\"));\nexports.Form = Form_1.default;\nconst utils_1 = __importDefault(__webpack_require__(/*! ./utils */ \"./lib/cjs/utils/index.js\"));\nexports.Utils = utils_1.default;\nconst Evaluator_1 = __webpack_require__(/*! ./utils/Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\nconst licenses_1 = __importDefault(__webpack_require__(/*! ./licenses */ \"./lib/cjs/licenses/index.js\"));\nexports.Licenses = licenses_1.default;\nconst EventEmitter_1 = __importDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/cjs/EventEmitter.js\"));\nexports.EventEmitter = EventEmitter_1.default;\nconst Webform_1 = __importDefault(__webpack_require__(/*! ./Webform */ \"./lib/cjs/Webform.js\"));\nexports.Webform = Webform_1.default;\nFormio_1.Formio.loadModules = (path = `${Formio_1.Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {\n Formio_1.Formio.requireLibrary(name, name, path, true)\n .then((modules) => {\n Formio_1.Formio.use(modules);\n });\n};\n// This is needed to maintain correct imports using the \"dist\" file.\nFormio_1.Formio.isRenderer = true;\nFormio_1.Formio.Components = Components_1.default;\nFormio_1.Formio.Templates = Templates_1.default;\nFormio_1.Formio.Utils = utils_1.default;\nFormio_1.Formio.Form = Form_1.default;\nFormio_1.Formio.Displays = Displays_1.default;\nFormio_1.Formio.Providers = providers_1.default;\nFormio_1.Formio.Widgets = widgets_1.default;\nFormio_1.Formio.Evaluator = Evaluator_1.Evaluator;\nFormio_1.Formio.AllComponents = components_1.default;\nFormio_1.Formio.Licenses = licenses_1.default;\n// This is strange, but is needed for \"premium\" components to import correctly.\nFormio_1.Formio.Formio = Formio_1.Formio;\nFormio_1.Formio.Components.setComponents(components_1.default);\n/**\n * Register a module\n * @param {any} mod - The module object to register. This can also be a function which accepts Formio as an argument.\n * @param {Function|null} [defaultFn] - The default function to call if the module does not have a known key.\n * @param {any} options - Options for the module.\n * @returns {void}\n */\nfunction registerModule(mod, defaultFn = null, options = {}) {\n if (typeof mod === 'function') {\n return registerModule(mod(Formio_1.Formio), defaultFn, options);\n }\n if (typeof mod !== 'object') {\n return;\n }\n for (const key of Object.keys(mod)) {\n const current = mod.framework || Formio_1.Formio.Templates.framework || 'bootstrap';\n switch (key) {\n case 'options':\n Formio_1.Formio.options = lodash_1.default.merge(Formio_1.Formio.options, mod.options);\n break;\n case 'templates':\n for (const framework of Object.keys(mod.templates)) {\n Formio_1.Formio.Templates.extendTemplate(framework, mod.templates[framework]);\n }\n if (mod.templates[current]) {\n Formio_1.Formio.Templates.current = mod.templates[current];\n }\n break;\n case 'components':\n Formio_1.Formio.Components.setComponents(mod.components);\n break;\n case 'framework':\n Formio_1.Formio.Templates.framework = mod.framework;\n break;\n case 'fetch':\n for (const name of Object.keys(mod.fetch)) {\n Formio_1.Formio.registerPlugin(mod.fetch[name], name);\n }\n break;\n case 'providers':\n for (const type of Object.keys(mod.providers)) {\n Formio_1.Formio.Providers.addProviders(type, mod.providers[type]);\n }\n break;\n case 'displays':\n Formio_1.Formio.Displays.addDisplays(mod.displays);\n break;\n case 'evaluator':\n Formio_1.Formio.Evaluator.registerEvaluator(mod.evaluator);\n break;\n case 'library':\n options.license\n ? Formio_1.Formio.Licenses.addLicense(mod.library, options.license)\n : Formio_1.Formio.Licenses.removeLicense(mod.library);\n break;\n default:\n if (defaultFn) {\n if (!defaultFn(key, mod)) {\n console.warn('Unknown module option', key);\n }\n break;\n }\n console.log('Unknown module option', key);\n }\n }\n}\nexports.registerModule = registerModule;\n/**\n * @param {Function|null} defaultFn - The default function to call if the module does not have a known key.\n * @returns {void}\n */\nfunction useModule(defaultFn = null) {\n return (plugins, options = {}) => {\n plugins = lodash_1.default.isArray(plugins) ? plugins : [plugins];\n plugins.forEach((plugin) => {\n if (Array.isArray(plugin)) {\n plugin.forEach(p => registerModule(p, defaultFn, options));\n }\n else {\n registerModule(plugin, defaultFn, options);\n }\n });\n };\n}\nexports.useModule = useModule;\n/**\n * Allows passing in plugins as an array of plugins or a single plugin.\n *\n * Formio.plugins(plugin1, options);\n * Formio.plugins([plugin1, plugin2, etc], options);\n */\nFormio_1.Formio.use = useModule();\nvar Formio_2 = __webpack_require__(/*! ./Formio */ \"./lib/cjs/Formio.js\");\nObject.defineProperty(exports, \"FormioCore\", ({ enumerable: true, get: function () { return Formio_2.Formio; } }));\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/formio.form.js?");
5504
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Webform = exports.EventEmitter = exports.Licenses = exports.Formio = exports.Form = exports.Utils = exports.Templates = exports.Widgets = exports.Providers = exports.Displays = exports.Components = exports.FormioCore = exports.useModule = exports.registerModule = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Formio_1 = __webpack_require__(/*! ./Formio */ \"./lib/cjs/Formio.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return Formio_1.Formio; } }));\nconst components_1 = __importDefault(__webpack_require__(/*! ./components */ \"./lib/cjs/components/index.js\"));\nconst Components_1 = __importDefault(__webpack_require__(/*! ./components/Components */ \"./lib/cjs/components/Components.js\"));\nexports.Components = Components_1.default;\nconst Displays_1 = __importDefault(__webpack_require__(/*! ./displays/Displays */ \"./lib/cjs/displays/Displays.js\"));\nexports.Displays = Displays_1.default;\nconst Templates_1 = __importDefault(__webpack_require__(/*! ./templates/Templates */ \"./lib/cjs/templates/Templates.js\"));\nexports.Templates = Templates_1.default;\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nexports.Providers = providers_1.default;\nconst widgets_1 = __importDefault(__webpack_require__(/*! ./widgets */ \"./lib/cjs/widgets/index.js\"));\nexports.Widgets = widgets_1.default;\nconst Form_1 = __importDefault(__webpack_require__(/*! ./Form */ \"./lib/cjs/Form.js\"));\nexports.Form = Form_1.default;\nconst utils_1 = __importDefault(__webpack_require__(/*! ./utils */ \"./lib/cjs/utils/index.js\"));\nexports.Utils = utils_1.default;\nconst Evaluator_1 = __webpack_require__(/*! ./utils/Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\nconst licenses_1 = __importDefault(__webpack_require__(/*! ./licenses */ \"./lib/cjs/licenses/index.js\"));\nexports.Licenses = licenses_1.default;\nconst EventEmitter_1 = __importDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/cjs/EventEmitter.js\"));\nexports.EventEmitter = EventEmitter_1.default;\nconst Webform_1 = __importDefault(__webpack_require__(/*! ./Webform */ \"./lib/cjs/Webform.js\"));\nexports.Webform = Webform_1.default;\nFormio_1.Formio.loadModules = (path = `${Formio_1.Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {\n Formio_1.Formio.requireLibrary(name, name, path, true)\n .then((modules) => {\n Formio_1.Formio.use(modules);\n });\n};\n// This is needed to maintain correct imports using the \"dist\" file.\nFormio_1.Formio.isRenderer = true;\nFormio_1.Formio.Components = Components_1.default;\nFormio_1.Formio.Templates = Templates_1.default;\nFormio_1.Formio.Utils = utils_1.default;\nFormio_1.Formio.Form = Form_1.default;\nFormio_1.Formio.Displays = Displays_1.default;\nFormio_1.Formio.Providers = providers_1.default;\nFormio_1.Formio.Widgets = widgets_1.default;\nFormio_1.Formio.Evaluator = Evaluator_1.Evaluator;\nFormio_1.Formio.AllComponents = components_1.default;\nFormio_1.Formio.Licenses = licenses_1.default;\n// This is strange, but is needed for \"premium\" components to import correctly.\nFormio_1.Formio.Formio = Formio_1.Formio;\nFormio_1.Formio.Components.setComponents(components_1.default);\n/**\n * Register a module\n * @param {any} mod - The module object to register. This can also be a function which accepts Formio as an argument.\n * @param {Function|null} [defaultFn] - The default function to call if the module does not have a known key.\n * @param {any} options - Options for the module.\n * @returns {void}\n */\nfunction registerModule(mod, defaultFn = null, options = {}) {\n if (typeof mod === 'function') {\n return registerModule(mod(Formio_1.Formio), defaultFn, options);\n }\n if (typeof mod !== 'object') {\n return;\n }\n for (const key of Object.keys(mod)) {\n const current = mod.framework || Formio_1.Formio.Templates.framework || 'bootstrap';\n switch (key) {\n case 'options':\n Formio_1.Formio.options = lodash_1.default.merge(Formio_1.Formio.options, mod.options);\n break;\n case 'templates':\n for (const framework of Object.keys(mod.templates)) {\n Formio_1.Formio.Templates.extendTemplate(framework, mod.templates[framework]);\n Formio_1.Formio.Templates.defaultTemplates = lodash_1.default.defaults(mod.templates[framework], Formio_1.Formio.Templates.defaultTemplates);\n }\n if (mod.templates[current]) {\n Formio_1.Formio.Templates.current = mod.templates[current];\n }\n break;\n case 'components':\n Formio_1.Formio.Components.setComponents(mod.components);\n break;\n case 'framework':\n Formio_1.Formio.Templates.framework = mod.framework;\n break;\n case 'fetch':\n for (const name of Object.keys(mod.fetch)) {\n Formio_1.Formio.registerPlugin(mod.fetch[name], name);\n }\n break;\n case 'providers':\n for (const type of Object.keys(mod.providers)) {\n Formio_1.Formio.Providers.addProviders(type, mod.providers[type]);\n }\n break;\n case 'displays':\n Formio_1.Formio.Displays.addDisplays(mod.displays);\n break;\n case 'evaluator':\n Formio_1.Formio.Evaluator.registerEvaluator(mod.evaluator);\n break;\n case 'library':\n options.license\n ? Formio_1.Formio.Licenses.addLicense(mod.library, options.license)\n : Formio_1.Formio.Licenses.removeLicense(mod.library);\n break;\n default:\n if (defaultFn) {\n if (!defaultFn(key, mod)) {\n console.warn('Unknown module option', key);\n }\n break;\n }\n console.log('Unknown module option', key);\n }\n }\n}\nexports.registerModule = registerModule;\n/**\n * @param {Function|null} defaultFn - The default function to call if the module does not have a known key.\n * @returns {void}\n */\nfunction useModule(defaultFn = null) {\n return (plugins, options = {}) => {\n plugins = lodash_1.default.isArray(plugins) ? plugins : [plugins];\n plugins.forEach((plugin) => {\n if (Array.isArray(plugin)) {\n plugin.forEach(p => registerModule(p, defaultFn, options));\n }\n else {\n registerModule(plugin, defaultFn, options);\n }\n });\n };\n}\nexports.useModule = useModule;\n/**\n * Allows passing in plugins as an array of plugins or a single plugin.\n *\n * Formio.plugins(plugin1, options);\n * Formio.plugins([plugin1, plugin2, etc], options);\n */\nFormio_1.Formio.use = useModule();\nvar Formio_2 = __webpack_require__(/*! ./Formio */ \"./lib/cjs/Formio.js\");\nObject.defineProperty(exports, \"FormioCore\", ({ enumerable: true, get: function () { return Formio_2.Formio; } }));\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/formio.form.js?");
5505
5505
 
5506
5506
  /***/ }),
5507
5507