formiojs-eorion 0.1.21 → 0.1.22

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 (44) hide show
  1. package/Formio.js +1 -1
  2. package/components/Chart/Chart.js +9 -16
  3. package/components/CustomCheckBox/CustomCheckBox.js +7 -14
  4. package/components/CustomFile/CustomFile.js +65 -72
  5. package/components/CustomRadio/CustomRadio.js +13 -21
  6. package/components/CustomSelect/CustomSelect.js +32 -40
  7. package/components/CustomTable/CustomTable.js +7 -15
  8. package/components/CustomTextArea/CustomTextArea.js +4 -3
  9. package/components/CustomTextField/CustomTextField.js +7 -14
  10. package/components/Data/Data.js +15 -23
  11. package/components/DataChinaGrid/Data.js +2 -1
  12. package/components/DataChinaGridRow/Data.js +2 -1
  13. package/components/DataSource/DataSource.js +2 -1
  14. package/components/Department/Department.js +10 -17
  15. package/components/LocationInputTextField/LocationInputTextField.js +7 -14
  16. package/components/NocodbFile/NocodbFile.js +65 -72
  17. package/components/QrCode/QrCode.js +6 -13
  18. package/components/ScanInputTextField/ScanInputTextField.js +7 -14
  19. package/components/TaskCalendar/TaskCalendar.js +8 -16
  20. package/components/_classes/Department/Department.js +10 -17
  21. package/components/button/Button.js +2 -1
  22. package/components/echarts/ECharts.js +2 -1
  23. package/components/file/File.js +63 -71
  24. package/components/iconButton/IconButton.js +2 -1
  25. package/components/map/Map.js +14 -22
  26. package/components/progress/Progress.js +2 -1
  27. package/components/radio/Radio.js +45 -53
  28. package/components/select/Select.js +102 -110
  29. package/components/tree/Tree.js +10 -17
  30. package/dist/formio.contrib.js +2 -2
  31. package/dist/formio.contrib.min.js +1 -1
  32. package/dist/formio.contrib.min.js.LICENSE.txt +1 -1
  33. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  34. package/dist/formio.form.js +27 -27
  35. package/dist/formio.form.min.js +1 -1
  36. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  37. package/dist/formio.full.js +27 -27
  38. package/dist/formio.full.min.js +1 -1
  39. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  40. package/dist/formio.js +1 -1
  41. package/dist/formio.min.js +1 -1
  42. package/dist/formio.min.js.LICENSE.txt +1 -1
  43. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  44. package/package.json +1 -1
@@ -18,12 +18,12 @@ Object.defineProperty(exports, "__esModule", {
18
18
  value: true
19
19
  });
20
20
  exports.default = void 0;
21
- require("core-js/modules/es.object.to-string.js");
22
21
  require("core-js/modules/es.regexp.exec.js");
23
22
  require("core-js/modules/es.string.replace.js");
24
23
  require("core-js/modules/es.string.trim.js");
25
24
  require("core-js/modules/es.array.concat.js");
26
25
  require("core-js/modules/es.array.find.js");
26
+ require("core-js/modules/es.object.to-string.js");
27
27
  require("core-js/modules/es.regexp.to-string.js");
28
28
  require("core-js/modules/es.array.map.js");
29
29
  require("core-js/modules/es.array.join.js");
@@ -87,26 +87,18 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
87
87
  return _super.apply(this, arguments);
88
88
  }
89
89
  _createClass(SelectComponent, [{
90
- key: "get",
91
- value: function get(path, obj) {
92
- var fb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "${".concat(path, "}");
93
- return path.split('.').reduce(function (res, key) {
94
- return res[key] || fb;
95
- }, obj);
96
- }
97
- }, {
98
90
  key: "parseTpl",
99
- value: function parseTpl(template, map, fallback) {
100
- var _this = this;
91
+ value: function parseTpl(template, map) {
101
92
  return template.replace(/\$\{.+?}/g, function (match) {
93
+ var _$get;
102
94
  var path = match.substr(2, match.length - 3).trim();
103
- return _this.get(path, map, fallback);
95
+ return (_$get = _lodash.default.get(map, path)) !== null && _$get !== void 0 ? _$get : '--';
104
96
  });
105
97
  }
106
98
  }, {
107
99
  key: "init",
108
100
  value: function init() {
109
- var _this2 = this;
101
+ var _this = this;
110
102
  _get(_getPrototypeOf(SelectComponent.prototype), "init", this).call(this);
111
103
  this.templateData = {};
112
104
  this.validators = this.validators.concat(['select', 'onlyAvailableItems']);
@@ -118,15 +110,15 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
118
110
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
119
111
  args[_key] = arguments[_key];
120
112
  }
121
- return _this2.updateItems.apply(_this2, args);
113
+ return _this.updateItems.apply(_this, args);
122
114
  }, 100);
123
115
  this.triggerUpdate = function () {
124
116
  // Make sure we always resolve the previous promise before reassign it
125
- if (typeof _this2.itemsLoadedResolve === 'function') {
126
- _this2.itemsLoadedResolve();
117
+ if (typeof _this.itemsLoadedResolve === 'function') {
118
+ _this.itemsLoadedResolve();
127
119
  }
128
- _this2.itemsLoaded = new _nativePromiseOnly.default(function (resolve) {
129
- _this2.itemsLoadedResolve = resolve;
120
+ _this.itemsLoaded = new _nativePromiseOnly.default(function (resolve) {
121
+ _this.itemsLoadedResolve = resolve;
130
122
  });
131
123
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
132
124
  args[_key2] = arguments[_key2];
@@ -151,7 +143,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
151
143
  // If this component has been activated.
152
144
  this.activated = false;
153
145
  this.itemsLoaded = new _nativePromiseOnly.default(function (resolve) {
154
- _this2.itemsLoadedResolve = resolve;
146
+ _this.itemsLoadedResolve = resolve;
155
147
  });
156
148
  this.shouldPositionDropdown = this.hasDataGridAncestor();
157
149
  if (this.isHtmlRenderMode()) {
@@ -381,7 +373,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
381
373
  }, {
382
374
  key: "setItems",
383
375
  value: function setItems(items, fromSearch) {
384
- var _this3 = this,
376
+ var _this2 = this,
385
377
  _this$choices,
386
378
  _this$choices$input;
387
379
  // If the items is a string, then parse as JSON.
@@ -434,7 +426,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
434
426
  if (!_lodash.default.isEmpty(this.dataValue) && this.component.idPath) {
435
427
  var selectedOptionId = _lodash.default.get(this.dataValue, this.component.idPath, null);
436
428
  var newOptionWithSameId = !_lodash.default.isNil(selectedOptionId) && items.find(function (item) {
437
- var itemId = _lodash.default.get(item, _this3.component.idPath);
429
+ var itemId = _lodash.default.get(item, _this2.component.idPath);
438
430
  return itemId === selectedOptionId;
439
431
  });
440
432
  if (newOptionWithSameId) {
@@ -454,9 +446,9 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
454
446
  // Iterate through each of the items.
455
447
  _lodash.default.each(items, function (item, index) {
456
448
  // preventing references of the components inside the form to the parent form when building forms
457
- if (_this3.root && _this3.root.options.editForm && _this3.root.options.editForm._id && _this3.root.options.editForm._id === item._id) return;
458
- var itemValueAndLabel = _this3.selectValueAndLabel(item);
459
- _this3.addOption(itemValueAndLabel.value, itemValueAndLabel.label, {}, _lodash.default.get(item, _this3.component.idPath, String(index)));
449
+ if (_this2.root && _this2.root.options.editForm && _this2.root.options.editForm._id && _this2.root.options.editForm._id === item._id) return;
450
+ var itemValueAndLabel = _this2.selectValueAndLabel(item);
451
+ _this2.addOption(itemValueAndLabel.value, itemValueAndLabel.label, {}, _lodash.default.get(item, _this2.component.idPath, String(index)));
460
452
  });
461
453
  if (this.choices) {
462
454
  this.choices.setChoices(this.selectOptions, 'value', 'label', true);
@@ -503,13 +495,13 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
503
495
  }, {
504
496
  key: "itemValueForHTMLMode",
505
497
  value: function itemValueForHTMLMode(value) {
506
- var _this4 = this;
498
+ var _this3 = this;
507
499
  if (!this.isHtmlRenderMode()) {
508
500
  return _get(_getPrototypeOf(SelectComponent.prototype), "itemValueForHTMLMode", this).call(this, value);
509
501
  }
510
502
  if (Array.isArray(value)) {
511
503
  var values = value.map(function (item) {
512
- return Array.isArray(item) ? _this4.itemValueForHTMLMode(item) : _this4.getSingleItemValueForHTMLMode(item);
504
+ return Array.isArray(item) ? _this3.itemValueForHTMLMode(item) : _this3.getSingleItemValueForHTMLMode(item);
513
505
  });
514
506
  return values.join(', ');
515
507
  }
@@ -529,7 +521,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
529
521
  }, {
530
522
  key: "getTemplateKeys",
531
523
  value: function getTemplateKeys() {
532
- var _this5 = this;
524
+ var _this4 = this;
533
525
  this.templateKeys = [];
534
526
  if (this.options.readOnly && this.component.template) {
535
527
  var keys = this.component.template.match(/({{\s*(.*?)\s*}})/g);
@@ -537,7 +529,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
537
529
  keys.forEach(function (key) {
538
530
  var propKey = key.match(/{{\s*item\.(.*?)\s*}}/);
539
531
  if (propKey && propKey.length > 1) {
540
- _this5.templateKeys.push(propKey[1]);
532
+ _this4.templateKeys.push(propKey[1]);
541
533
  }
542
534
  });
543
535
  }
@@ -582,7 +574,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
582
574
  }, {
583
575
  key: "loadItems",
584
576
  value: function loadItems(url, search, headers, options, method, body) {
585
- var _this6 = this;
577
+ var _this5 = this;
586
578
  options = options || {};
587
579
 
588
580
  // See if we should load items or not.
@@ -655,7 +647,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
655
647
  if (!_lodash.default.isEmpty(query)) {
656
648
  // Add the query string.
657
649
  url += (!url.includes('?') ? '?' : '&') + _Formio.GlobalFormio.serialize(query, function (item) {
658
- return _this6.interpolate(item);
650
+ return _this5.interpolate(item);
659
651
  });
660
652
  }
661
653
 
@@ -675,19 +667,19 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
675
667
  url: url
676
668
  }), {
677
669
  data: this.rootValue
678
- }, null)).url;
670
+ })).url;
679
671
  } catch (e) {}
680
672
  _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {
681
- _this6.loading = false;
682
- _this6.error = null;
683
- _this6.setItems(response, !!search);
673
+ _this5.loading = false;
674
+ _this5.error = null;
675
+ _this5.setItems(response, !!search);
684
676
  }).catch(function (err) {
685
- if (_this6.itemsFromUrl) {
686
- _this6.setItems([]);
687
- _this6.disableInfiniteScroll();
677
+ if (_this5.itemsFromUrl) {
678
+ _this5.setItems([]);
679
+ _this5.disableInfiniteScroll();
688
680
  }
689
- _this6.isScrollLoading = false;
690
- _this6.handleLoadingError(err);
681
+ _this5.isScrollLoading = false;
682
+ _this5.handleLoadingError(err);
691
683
  });
692
684
  }
693
685
  }, {
@@ -710,7 +702,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
710
702
  }, {
711
703
  key: "requestHeaders",
712
704
  get: function get() {
713
- var _this7 = this;
705
+ var _this6 = this;
714
706
  // Create the headers object.
715
707
  var headers = new _Formio.GlobalFormio.Headers();
716
708
 
@@ -719,7 +711,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
719
711
  try {
720
712
  _lodash.default.each(this.component.data.headers, function (header) {
721
713
  if (header.key) {
722
- headers.set(header.key, _this7.interpolate(header.value));
714
+ headers.set(header.key, _this6.interpolate(header.value));
723
715
  }
724
716
  });
725
717
  } catch (err) {
@@ -748,7 +740,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
748
740
  }, {
749
741
  key: "updateCustomItems",
750
742
  value: function updateCustomItems(forceUpdate) {
751
- var _this8 = this;
743
+ var _this7 = this;
752
744
  if (this.asyncCustomValues()) {
753
745
  if (!forceUpdate && !this.active) {
754
746
  this.itemsLoadedResolve();
@@ -756,10 +748,10 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
756
748
  }
757
749
  this.loading = true;
758
750
  this.getCustomItems().then(function (items) {
759
- _this8.loading = false;
760
- _this8.setItems(items || []);
751
+ _this7.loading = false;
752
+ _this7.setItems(items || []);
761
753
  }).catch(function (err) {
762
- _this8.handleLoadingError(err);
754
+ _this7.handleLoadingError(err);
763
755
  });
764
756
  } else {
765
757
  this.setItems(this.getCustomItems() || []);
@@ -942,7 +934,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
942
934
  }, {
943
935
  key: "attach",
944
936
  value: function attach(element) {
945
- var _this9 = this,
937
+ var _this8 = this,
946
938
  _this$choices2,
947
939
  _this$choices2$contai,
948
940
  _this$choices2$contai2;
@@ -956,7 +948,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
956
948
  var autocompleteInput = this.refs.autocompleteInput;
957
949
  if (autocompleteInput) {
958
950
  this.addEventListener(autocompleteInput, 'change', function (event) {
959
- _this9.setValue(event.target.value);
951
+ _this8.setValue(event.target.value);
960
952
  });
961
953
  }
962
954
  var input = this.refs.selectContainer;
@@ -964,7 +956,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
964
956
  return;
965
957
  }
966
958
  this.addEventListener(input, this.inputInfo.changeEvent, function () {
967
- return _this9.updateValue(null, {
959
+ return _this8.updateValue(null, {
968
960
  modified: true
969
961
  });
970
962
  });
@@ -977,12 +969,12 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
977
969
  }
978
970
  this.focusableElement = input;
979
971
  this.addEventListener(input, 'focus', function () {
980
- return _this9.update();
972
+ return _this8.update();
981
973
  });
982
974
  this.addEventListener(input, 'keydown', function (event) {
983
975
  var key = event.key;
984
976
  if (['Backspace', 'Delete'].includes(key)) {
985
- _this9.setValue(_this9.emptyValue);
977
+ _this8.setValue(_this8.emptyValue);
986
978
  }
987
979
  });
988
980
  return;
@@ -1010,20 +1002,20 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1010
1002
  this.focusableElement = this.choices.containerInner.element;
1011
1003
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
1012
1004
  this.addEventListener(this.choices.containerOuter.element, 'focus', function () {
1013
- return _this9.focusableElement.focus();
1005
+ return _this8.focusableElement.focus();
1014
1006
  });
1015
1007
  }
1016
1008
  this.addFocusBlurEvents(this.focusableElement);
1017
1009
  if (this.itemsFromUrl) {
1018
1010
  this.scrollList = this.choices.choiceList.element;
1019
1011
  this.addEventListener(this.scrollList, 'scroll', function () {
1020
- return _this9.onScroll();
1012
+ return _this8.onScroll();
1021
1013
  });
1022
1014
  }
1023
1015
  }
1024
1016
  if (window && this.choices && this.shouldPositionDropdown) {
1025
1017
  this.addEventListener(window.document, 'scroll', function () {
1026
- _this9.positionDropdown(true);
1018
+ _this8.positionDropdown(true);
1027
1019
  }, false, true);
1028
1020
  }
1029
1021
  this.focusableElement.setAttribute('tabIndex', tabIndex);
@@ -1033,53 +1025,53 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1033
1025
  // Make sure to clear the search when no value is provided.
1034
1026
  if (this.choices && this.choices.input && this.choices.input.element) {
1035
1027
  this.addEventListener(this.choices.input.element, 'input', function (event) {
1036
- _this9.isFromSearch = !!event.target.value;
1028
+ _this8.isFromSearch = !!event.target.value;
1037
1029
  if (!event.target.value) {
1038
- _this9.triggerUpdate();
1030
+ _this8.triggerUpdate();
1039
1031
  } else {
1040
- _this9.serverCount = null;
1041
- _this9.downloadedResources = [];
1032
+ _this8.serverCount = null;
1033
+ _this8.downloadedResources = [];
1042
1034
  }
1043
1035
  });
1044
1036
  }
1045
1037
  this.addEventListener(input, 'choice', function () {
1046
- if (_this9.component.multiple && _this9.component.dataSrc === 'resource' && _this9.isFromSearch) {
1047
- _this9.triggerUpdate();
1038
+ if (_this8.component.multiple && _this8.component.dataSrc === 'resource' && _this8.isFromSearch) {
1039
+ _this8.triggerUpdate();
1048
1040
  }
1049
- _this9.isFromSearch = false;
1041
+ _this8.isFromSearch = false;
1050
1042
  });
1051
1043
  // avoid spamming the resource/url endpoint when we have server side filtering enabled.
1052
1044
  var debounceTimeout = (this.component.searchField || this.component.data.noco_db_conditions && this.component.data.noco_db_conditions.length > 0 && this.component.data.noco_db_conditions[0].name.length > 0) && (this.isSelectResource || this.isSelectURL) ? (this.component.searchDebounce === 0 ? 0 : this.component.searchDebounce || this.defaultSchema.searchDebounce) * 1000 : 0;
1053
1045
  var updateComponent = function updateComponent(evt) {
1054
- _this9.triggerUpdate(evt.detail.value);
1046
+ _this8.triggerUpdate(evt.detail.value);
1055
1047
  };
1056
1048
  this.addEventListener(input, 'search', _lodash.default.debounce(function (e) {
1057
1049
  updateComponent(e);
1058
- _this9.positionDropdown();
1050
+ _this8.positionDropdown();
1059
1051
  }, debounceTimeout));
1060
1052
  this.addEventListener(input, 'stopSearch', function () {
1061
- return _this9.triggerUpdate();
1053
+ return _this8.triggerUpdate();
1062
1054
  });
1063
1055
  this.addEventListener(input, 'hideDropdown', function () {
1064
- if (_this9.choices && _this9.choices.input && _this9.choices.input.element) {
1065
- _this9.choices.input.element.value = '';
1056
+ if (_this8.choices && _this8.choices.input && _this8.choices.input.element) {
1057
+ _this8.choices.input.element.value = '';
1066
1058
  }
1067
- _this9.updateItems(null, true);
1059
+ _this8.updateItems(null, true);
1068
1060
  });
1069
1061
  }
1070
1062
  this.addEventListener(input, 'showDropdown', function () {
1071
- _this9.update();
1072
- _this9.positionDropdown();
1063
+ _this8.update();
1064
+ _this8.positionDropdown();
1073
1065
  });
1074
1066
  if (this.shouldPositionDropdown) {
1075
1067
  this.addEventListener(input, 'highlightChoice', function () {
1076
- _this9.positionDropdown();
1068
+ _this8.positionDropdown();
1077
1069
  });
1078
1070
  }
1079
1071
  if (this.choices && choicesOptions.placeholderValue && this.choices._isSelectOneElement) {
1080
1072
  this.addPlaceholderItem(choicesOptions.placeholderValue);
1081
1073
  this.addEventListener(input, 'removeItem', function () {
1082
- _this9.addPlaceholderItem(choicesOptions.placeholderValue);
1074
+ _this8.addPlaceholderItem(choicesOptions.placeholderValue);
1083
1075
  });
1084
1076
  }
1085
1077
 
@@ -1089,19 +1081,19 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1089
1081
  if (this.isSelectResource && this.refs.addResource) {
1090
1082
  this.addEventListener(this.refs.addResource, 'click', function (event) {
1091
1083
  event.preventDefault();
1092
- var formioForm = _this9.ce('div');
1093
- var dialog = _this9.createModal(formioForm);
1094
- var projectUrl = _lodash.default.get(_this9.root, 'formio.projectUrl', _Formio.GlobalFormio.getProjectUrl());
1095
- var formUrl = "".concat(projectUrl, "/form/").concat(_this9.component.data.resource);
1084
+ var formioForm = _this8.ce('div');
1085
+ var dialog = _this8.createModal(formioForm);
1086
+ var projectUrl = _lodash.default.get(_this8.root, 'formio.projectUrl', _Formio.GlobalFormio.getProjectUrl());
1087
+ var formUrl = "".concat(projectUrl, "/form/").concat(_this8.component.data.resource);
1096
1088
  new _Form.default(formioForm, formUrl, {}).ready.then(function (form) {
1097
1089
  form.on('submit', function (submission) {
1098
1090
  // If valueProperty is set, replace the submission with the corresponding value
1099
- var value = _this9.valueProperty ? _lodash.default.get(submission, _this9.valueProperty) : submission;
1100
- if (_this9.component.multiple) {
1101
- value = [].concat(_toConsumableArray(_this9.dataValue), [value]);
1091
+ var value = _this8.valueProperty ? _lodash.default.get(submission, _this8.valueProperty) : submission;
1092
+ if (_this8.component.multiple) {
1093
+ value = [].concat(_toConsumableArray(_this8.dataValue), [value]);
1102
1094
  }
1103
- _this9.setValue(value);
1104
- _this9.triggerUpdate();
1095
+ _this8.setValue(value);
1096
+ _this8.triggerUpdate();
1105
1097
  dialog.close();
1106
1098
  });
1107
1099
  });
@@ -1149,13 +1141,13 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1149
1141
  key: "positionDropdown",
1150
1142
  value: function positionDropdown(scroll) {
1151
1143
  var _this$choices$dropdow,
1152
- _this10 = this;
1144
+ _this9 = this;
1153
1145
  if (!this.shouldPositionDropdown || !this.choices || !((_this$choices$dropdow = this.choices.dropdown) !== null && _this$choices$dropdow !== void 0 && _this$choices$dropdow.isActive) && scroll) {
1154
1146
  return;
1155
1147
  }
1156
1148
  this.setDropdownPosition();
1157
1149
  this.itemsLoaded.then(function () {
1158
- _this10.setDropdownPosition();
1150
+ _this9.setDropdownPosition();
1159
1151
  });
1160
1152
  }
1161
1153
  }, {
@@ -1175,10 +1167,10 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1175
1167
  }, {
1176
1168
  key: "attachRefreshOnBlur",
1177
1169
  value: function attachRefreshOnBlur() {
1178
- var _this11 = this;
1170
+ var _this10 = this;
1179
1171
  if (this.component.refreshOnBlur) {
1180
1172
  this.on('blur', function (instance) {
1181
- _this11.checkRefreshOn([{
1173
+ _this10.checkRefreshOn([{
1182
1174
  instance: instance,
1183
1175
  value: instance.dataValue
1184
1176
  }], {
@@ -1254,7 +1246,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1254
1246
  }, {
1255
1247
  key: "addCurrentChoices",
1256
1248
  value: function addCurrentChoices(values, items, keyValue) {
1257
- var _this12 = this;
1249
+ var _this11 = this;
1258
1250
  if (!values) {
1259
1251
  return false;
1260
1252
  }
@@ -1271,14 +1263,14 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1271
1263
  // `this.addOption` method, we assume that items has
1272
1264
  // 'label' and 'value' properties. This assumption allows
1273
1265
  // us to read correct value from the item.
1274
- var isSelectOptions = items === _this12.selectOptions;
1266
+ var isSelectOptions = items === _this11.selectOptions;
1275
1267
  if (items && items.length) {
1276
1268
  _lodash.default.each(items, function (choice) {
1277
1269
  if (choice._id && value._id && choice._id === value._id) {
1278
1270
  found = true;
1279
1271
  return false;
1280
1272
  }
1281
- var itemValue = keyValue ? choice.value : _this12.itemValue(choice, isSelectOptions);
1273
+ var itemValue = keyValue ? choice.value : _this11.itemValue(choice, isSelectOptions);
1282
1274
  found |= _lodash.default.isEqual(itemValue, value);
1283
1275
  return found ? false : true;
1284
1276
  });
@@ -1286,7 +1278,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1286
1278
 
1287
1279
  // Add the default option if no item is found.
1288
1280
  if (!found) {
1289
- notFoundValuesToAdd.push(_this12.selectValueAndLabel(value));
1281
+ notFoundValuesToAdd.push(_this11.selectValueAndLabel(value));
1290
1282
  return true;
1291
1283
  }
1292
1284
  return found || defaultAdded;
@@ -1296,7 +1288,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1296
1288
  this.choices.setChoices(notFoundValuesToAdd, 'value', 'label');
1297
1289
  }
1298
1290
  notFoundValuesToAdd.map(function (notFoundValue) {
1299
- _this12.addOption(notFoundValue.value, notFoundValue.label);
1291
+ _this11.addOption(notFoundValue.value, notFoundValue.label);
1300
1292
  });
1301
1293
  }
1302
1294
  return added;
@@ -1353,7 +1345,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1353
1345
  }, {
1354
1346
  key: "normalizeSingleValue",
1355
1347
  value: function normalizeSingleValue(value, retainObject) {
1356
- var _this13 = this;
1348
+ var _this12 = this;
1357
1349
  if (_lodash.default.isNil(value)) {
1358
1350
  return;
1359
1351
  }
@@ -1381,8 +1373,8 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1381
1373
  var dataValue = this.dataValue;
1382
1374
  if (dataValue && dataValue.length) {
1383
1375
  dataValue.forEach(function (dataValueItem) {
1384
- var dataValueItemValue = _this13.component.reference ? dataValueItem._id.toString() : dataValueItem;
1385
- templateData[dataValueItemValue] = _this13.templateData[dataValueItemValue];
1376
+ var dataValueItemValue = _this12.component.reference ? dataValueItem._id.toString() : dataValueItem;
1377
+ templateData[dataValueItemValue] = _this12.templateData[dataValueItemValue];
1386
1378
  });
1387
1379
  }
1388
1380
  }
@@ -1443,10 +1435,10 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1443
1435
  }, {
1444
1436
  key: "normalizeValue",
1445
1437
  value: function normalizeValue(value) {
1446
- var _this14 = this;
1438
+ var _this13 = this;
1447
1439
  if (this.component.multiple && Array.isArray(value)) {
1448
1440
  return value.map(function (singleValue) {
1449
- return _this14.normalizeSingleValue(singleValue, true);
1441
+ return _this13.normalizeSingleValue(singleValue, true);
1450
1442
  });
1451
1443
  }
1452
1444
  return _get(_getPrototypeOf(SelectComponent.prototype), "normalizeValue", this).call(this, this.normalizeSingleValue(value, true));
@@ -1454,7 +1446,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1454
1446
  }, {
1455
1447
  key: "setValue",
1456
1448
  value: function setValue(value) {
1457
- var _this15 = this;
1449
+ var _this14 = this;
1458
1450
  var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1459
1451
  var previousValue = this.dataValue;
1460
1452
  if (this.component.widget === 'html5' && (_lodash.default.isEqual(value, previousValue) || _lodash.default.isEqual(previousValue, {}) && _lodash.default.isEqual(flags, {}))) {
@@ -1480,7 +1472,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1480
1472
  }
1481
1473
  if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
1482
1474
  this.itemsLoaded.then(function () {
1483
- _this15.redraw();
1475
+ _this14.redraw();
1484
1476
  });
1485
1477
  return changed;
1486
1478
  }
@@ -1501,8 +1493,8 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1501
1493
 
1502
1494
  // Add the value options.
1503
1495
  this.itemsLoaded.then(function () {
1504
- _this15.addValueOptions();
1505
- _this15.setChoicesValue(value, hasPreviousValue, flags);
1496
+ _this14.addValueOptions();
1497
+ _this14.setChoicesValue(value, hasPreviousValue, flags);
1506
1498
  });
1507
1499
  return changed;
1508
1500
  }
@@ -1572,7 +1564,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1572
1564
  }, {
1573
1565
  key: "validateValueAvailability",
1574
1566
  value: function validateValueAvailability(setting, value) {
1575
- var _this16 = this;
1567
+ var _this15 = this;
1576
1568
  if (!(0, _utils.boolValue)(setting) || !value) {
1577
1569
  return true;
1578
1570
  }
@@ -1580,7 +1572,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1580
1572
  if (values) {
1581
1573
  if (_lodash.default.isObject(value)) {
1582
1574
  var compareComplexValues = function compareComplexValues(optionValue) {
1583
- var normalizedOptionValue = _this16.normalizeSingleValue(optionValue, true);
1575
+ var normalizedOptionValue = _this15.normalizeSingleValue(optionValue, true);
1584
1576
  if (!_lodash.default.isObject(normalizedOptionValue)) {
1585
1577
  return false;
1586
1578
  }
@@ -1596,7 +1588,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1596
1588
  }) !== -1;
1597
1589
  }
1598
1590
  return values.findIndex(function (optionValue) {
1599
- return _this16.normalizeSingleValue(optionValue) === value;
1591
+ return _this15.normalizeSingleValue(optionValue) === value;
1600
1592
  }) !== -1;
1601
1593
  }
1602
1594
  return false;
@@ -1621,7 +1613,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1621
1613
  }, {
1622
1614
  key: "getOptionsValues",
1623
1615
  value: function getOptionsValues() {
1624
- var _this17 = this;
1616
+ var _this16 = this;
1625
1617
  var rawItems = [];
1626
1618
  switch (this.component.dataSrc) {
1627
1619
  case 'values':
@@ -1646,7 +1638,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1646
1638
  return;
1647
1639
  }
1648
1640
  return rawItems.map(function (item) {
1649
- return _this17.getOptionValue(_this17.itemValue(item));
1641
+ return _this16.getOptionValue(_this16.itemValue(item));
1650
1642
  });
1651
1643
  }
1652
1644
 
@@ -1686,14 +1678,14 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1686
1678
  }, {
1687
1679
  key: "getNormalizedValues",
1688
1680
  value: function getNormalizedValues() {
1689
- var _this18 = this;
1681
+ var _this17 = this;
1690
1682
  if (!this.component || !this.component.data || !this.component.data.values) {
1691
1683
  return;
1692
1684
  }
1693
1685
  return this.component.data.values.map(function (value) {
1694
1686
  return {
1695
1687
  label: value.label,
1696
- value: String(_this18.normalizeSingleValue(value.value))
1688
+ value: String(_this17.normalizeSingleValue(value.value))
1697
1689
  };
1698
1690
  });
1699
1691
  }
@@ -1701,7 +1693,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1701
1693
  key: "asString",
1702
1694
  value: function asString(value) {
1703
1695
  var _value3,
1704
- _this19 = this;
1696
+ _this18 = this;
1705
1697
  value = (_value3 = value) !== null && _value3 !== void 0 ? _value3 : this.getValue();
1706
1698
  //need to convert values to strings to be able to compare values with available options that are strings
1707
1699
  var convertToString = function convertToString(data, valueProperty) {
@@ -1715,14 +1707,14 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1715
1707
  }
1716
1708
  return data;
1717
1709
  }
1718
- if (_this19.isBooleanOrNumber(data)) {
1710
+ if (_this18.isBooleanOrNumber(data)) {
1719
1711
  data = data.toString();
1720
1712
  }
1721
1713
  if (Array.isArray(data) && data.some(function (item) {
1722
- return _this19.isBooleanOrNumber(item);
1714
+ return _this18.isBooleanOrNumber(item);
1723
1715
  })) {
1724
1716
  data = data.map(function (item) {
1725
- if (_this19.isBooleanOrNumber(item)) {
1717
+ if (_this18.isBooleanOrNumber(item)) {
1726
1718
  item = item.toString();
1727
1719
  }
1728
1720
  });
@@ -1743,7 +1735,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1743
1735
  valueProperty = _ref4.valueProperty;
1744
1736
  var getFromValues = function getFromValues() {
1745
1737
  var initialValue = _lodash.default.find(items, [valueProperty, value]);
1746
- var values = _this19.defaultSchema.data.values || [];
1738
+ var values = _this18.defaultSchema.data.values || [];
1747
1739
  return _lodash.default.isEqual(initialValue, values[0]) ? '-' : initialValue;
1748
1740
  };
1749
1741
  value = this.component.multiple && Array.isArray(value) ? _lodash.default.filter(items, function (item) {
@@ -1759,7 +1751,7 @@ var SelectComponent = /*#__PURE__*/function (_ListComponent) {
1759
1751
  if (Array.isArray(value)) {
1760
1752
  var _items = [];
1761
1753
  value.forEach(function (item) {
1762
- return _items.push(_this19.itemTemplate(item));
1754
+ return _items.push(_this18.itemTemplate(item));
1763
1755
  });
1764
1756
  return _items.length > 0 ? _items.join('<br />') : '-';
1765
1757
  }