@crystaldesign/diva-backoffice 24.1.3 → 24.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/build/esm/index.js +513 -182
  2. package/build/types/backoffice/src/Configuration.d.ts +2 -1
  3. package/build/types/backoffice/src/Configuration.d.ts.map +1 -1
  4. package/build/types/backoffice/src/store/ConfigurationStore.d.ts +1 -1
  5. package/build/types/backoffice/src/store/ConfigurationStore.d.ts.map +1 -1
  6. package/build/types/backoffice/src/ui/CatalogEditor/DragDropUpload/index.d.ts.map +1 -1
  7. package/build/types/backoffice/src/ui/CatalogEditor/useCatalogEditor.d.ts +1 -1
  8. package/build/types/backoffice/src/ui/CatalogEditor/useCatalogEditor.d.ts.map +1 -1
  9. package/build/types/backoffice/src/ui/Description/types.d.ts +10 -2
  10. package/build/types/backoffice/src/ui/Description/types.d.ts.map +1 -1
  11. package/build/types/backoffice/src/ui/Description/useDescriptions.d.ts +1 -0
  12. package/build/types/backoffice/src/ui/Description/useDescriptions.d.ts.map +1 -1
  13. package/build/types/backoffice/src/ui/Form/index.d.ts.map +1 -1
  14. package/build/types/backoffice/src/ui/Form/types.d.ts +6 -2
  15. package/build/types/backoffice/src/ui/Form/types.d.ts.map +1 -1
  16. package/build/types/backoffice/src/ui/SelectSimple/index.d.ts +7 -0
  17. package/build/types/backoffice/src/ui/SelectSimple/index.d.ts.map +1 -0
  18. package/build/types/backoffice/src/ui/SelectSimple/types.d.ts +24 -0
  19. package/build/types/backoffice/src/ui/SelectSimple/types.d.ts.map +1 -0
  20. package/build/types/backoffice/src/ui/SelectSimple/useSelectSimpleData.d.ts +9 -0
  21. package/build/types/backoffice/src/ui/SelectSimple/useSelectSimpleData.d.ts.map +1 -0
  22. package/build/types/backoffice/src/utils/ApiHandler.d.ts +1 -0
  23. package/build/types/backoffice/src/utils/ApiHandler.d.ts.map +1 -1
  24. package/package.json +2 -2
@@ -31,13 +31,13 @@ import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined';
31
31
  import DeleteOutlined from '@ant-design/icons/DeleteOutlined';
32
32
  import JSONEditor from 'jsoneditor';
33
33
  import 'jsoneditor/dist/jsoneditor.css';
34
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
34
35
  import PlusOutlined from '@ant-design/icons/PlusOutlined';
35
36
  import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined';
36
37
  import DivaUtils$1, { nanoid } from '@crystaldesign/diva-utils';
37
38
  import ReloadOutlined from '@ant-design/icons/ReloadOutlined';
38
39
  import QuestionCircleOutlined from '@ant-design/icons/QuestionCircleOutlined';
39
40
  import WarningTwoTone from '@ant-design/icons/WarningTwoTone';
40
- import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
41
41
  import CheckOutlined from '@ant-design/icons/lib/icons/CheckOutlined';
42
42
  import CloseOutlined from '@ant-design/icons/lib/icons/CloseOutlined';
43
43
  import { ContentBoxComponent } from '@crystaldesign/content-box';
@@ -114,12 +114,12 @@ import RoomSelection from '@crystaldesign/room-selection';
114
114
  globalThis.process = { env:env };
115
115
  })();
116
116
 
117
- function _createForOfIteratorHelper$l(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$l(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
118
- function _unsupportedIterableToArray$l(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$l(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$l(o, minLen); }
119
- function _arrayLikeToArray$l(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
120
- function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
121
- function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
122
- var LOG$a = getLogger('Backoffice', 'AplyMapping');
117
+ function _createForOfIteratorHelper$m(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$m(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
118
+ function _unsupportedIterableToArray$m(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$m(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$m(o, minLen); }
119
+ function _arrayLikeToArray$m(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
120
+ function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
121
+ function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
122
+ var LOG$b = getLogger('Backoffice', 'AplyMapping');
123
123
  function aplyMapping (_ref) {
124
124
  var mapable = _ref.mapable,
125
125
  mappingData = _ref.mappingData,
@@ -139,10 +139,10 @@ function aplyMapping (_ref) {
139
139
  var newValue = {};
140
140
  newValue[newKey] = valueToAdd;
141
141
  if ((startValue === null || startValue === void 0 ? void 0 : startValue[newKey]) != undefined) {
142
- if (_typeof(startValue[newKey]) == 'object') startValue[newKey] = _objectSpread$D(_objectSpread$D({}, startValue[newKey]), valueToAdd);else startValue[newKey] = type == 'addToSourceValue' ? startValue[newKey] + valueToAdd : valueToAdd;
142
+ if (_typeof(startValue[newKey]) == 'object') startValue[newKey] = _objectSpread$E(_objectSpread$E({}, startValue[newKey]), valueToAdd);else startValue[newKey] = type == 'addToSourceValue' ? startValue[newKey] + valueToAdd : valueToAdd;
143
143
  return startValue;
144
144
  }
145
- if (newIdx == 1) return _objectSpread$D(_objectSpread$D({}, startValue), newValue);
145
+ if (newIdx == 1) return _objectSpread$E(_objectSpread$E({}, startValue), newValue);
146
146
  return getTarget(idx + 1, keys, startValue, newValue);
147
147
  };
148
148
  returnValue = getTarget(0, key.split('.'), returnValue, value);
@@ -151,7 +151,7 @@ function aplyMapping (_ref) {
151
151
  function meetsCondition(map) {
152
152
  if (!map.condition) return true;
153
153
  var value = mappingData[map.condition.field];
154
- var _iterator = _createForOfIteratorHelper$l(map.condition.values),
154
+ var _iterator = _createForOfIteratorHelper$m(map.condition.values),
155
155
  _step;
156
156
  try {
157
157
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -228,7 +228,7 @@ function aplyMapping (_ref) {
228
228
  }
229
229
  }
230
230
  }
231
- var _iterator2 = _createForOfIteratorHelper$l(_url.searchParams.entries()),
231
+ var _iterator2 = _createForOfIteratorHelper$m(_url.searchParams.entries()),
232
232
  _step2;
233
233
  try {
234
234
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -263,7 +263,7 @@ function aplyMapping (_ref) {
263
263
  }
264
264
  return returnValue;
265
265
  } catch (e) {
266
- LOG$a.debug('Mapabledata', mapable);
266
+ LOG$b.debug('Mapabledata', mapable);
267
267
  throw e;
268
268
  }
269
269
  }
@@ -405,9 +405,9 @@ function getLeafColumns(columns) {
405
405
  });
406
406
  }
407
407
 
408
- function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
409
- function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
410
- var LOG$9 = getLogger('Backoffice', 'ApiHandler');
408
+ function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
409
+ function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
410
+ var LOG$a = getLogger('Backoffice', 'ApiHandler');
411
411
  var jp = require('jsonpath');
412
412
  var _default$d = /*#__PURE__*/function () {
413
413
  function _default(configuration, _rootStore) {
@@ -426,6 +426,7 @@ var _default$d = /*#__PURE__*/function () {
426
426
  _defineProperty(this, "_readListUrl", void 0);
427
427
  _defineProperty(this, "_fallBackToParams", true);
428
428
  _defineProperty(this, "_readJsonPath", void 0);
429
+ _defineProperty(this, "_readPublicData", false);
429
430
  _defineProperty(this, "_filterFields", void 0);
430
431
  _defineProperty(this, "_socketUrl", void 0);
431
432
  _defineProperty(this, "_socket", undefined);
@@ -463,7 +464,7 @@ var _default$d = /*#__PURE__*/function () {
463
464
  this._readOneUrl = configuration.apiInterface.read;
464
465
  this._fallBackToParams = true;
465
466
  } else {
466
- var _configuration$apiInt10, _configuration$apiInt11, _configuration$apiInt12, _configuration$apiInt14, _configuration$apiInt15, _configuration$apiInt16;
467
+ var _configuration$apiInt10, _configuration$apiInt11, _configuration$apiInt12, _configuration$apiInt14, _configuration$apiInt15, _configuration$apiInt16, _configuration$apiInt17;
467
468
  this._readListUrl = (_configuration$apiInt10 = configuration.apiInterface.read) === null || _configuration$apiInt10 === void 0 ? void 0 : _configuration$apiInt10.list;
468
469
  this._readOneUrl = (_configuration$apiInt11 = configuration.apiInterface.read) === null || _configuration$apiInt11 === void 0 ? void 0 : _configuration$apiInt11.one;
469
470
 
@@ -485,6 +486,7 @@ var _default$d = /*#__PURE__*/function () {
485
486
  this._readJsonPath = (_configuration$apiInt14 = configuration.apiInterface.read) === null || _configuration$apiInt14 === void 0 ? void 0 : _configuration$apiInt14.jsonPath;
486
487
  this._filterFields = (_configuration$apiInt15 = configuration.apiInterface.read) === null || _configuration$apiInt15 === void 0 ? void 0 : _configuration$apiInt15.fields;
487
488
  this._fallBackToParams = !!((_configuration$apiInt16 = configuration.apiInterface.read) !== null && _configuration$apiInt16 !== void 0 && _configuration$apiInt16.fallBackToParams);
489
+ this._readPublicData = !!((_configuration$apiInt17 = configuration.apiInterface.read) !== null && _configuration$apiInt17 !== void 0 && _configuration$apiInt17["public"]);
488
490
  }
489
491
  this._socketUrl = configuration.apiInterface.socket;
490
492
  }
@@ -558,7 +560,7 @@ var _default$d = /*#__PURE__*/function () {
558
560
  _context2.next = 13;
559
561
  return fetch(finalUrl, {
560
562
  method: this._updateMethod,
561
- headers: _objectSpread$C(_objectSpread$C({}, jwt ? {
563
+ headers: _objectSpread$D(_objectSpread$D({}, jwt ? {
562
564
  Authorization: 'Bearer ' + jwt
563
565
  } : {}), {}, {
564
566
  'Content-Type': 'application/json'
@@ -649,7 +651,7 @@ var _default$d = /*#__PURE__*/function () {
649
651
  rootStore: this._rootStore,
650
652
  fallBackToParams: true
651
653
  });
652
- if (data) createData = _objectSpread$C({}, data);
654
+ if (data) createData = _objectSpread$D({}, data);
653
655
  } else if (data !== undefined) {
654
656
  createData = aplyMapping({
655
657
  mapable: data,
@@ -790,7 +792,7 @@ var _default$d = /*#__PURE__*/function () {
790
792
  _context6.next = 7;
791
793
  return fetch((_url = url) === null || _url === void 0 ? void 0 : _url.toString(), {
792
794
  method: isApi2 ? 'POST' : 'DELETE',
793
- headers: _objectSpread$C({}, jwt ? {
795
+ headers: _objectSpread$D({}, jwt ? {
794
796
  Authorization: 'Bearer ' + jwt
795
797
  } : {})
796
798
  }).then( /*#__PURE__*/function () {
@@ -906,7 +908,7 @@ var _default$d = /*#__PURE__*/function () {
906
908
  throw new Error('Read List endpoint is missing in configuration.');
907
909
  case 2:
908
910
  jwt = (_this$_rootStore5 = this._rootStore) === null || _this$_rootStore5 === void 0 ? void 0 : _this$_rootStore5.dataStore.jwt;
909
- url = filterServerSide ? parseServersideFilters(_objectSpread$C(_objectSpread$C({}, filterServerSide), {}, {
911
+ url = filterServerSide ? parseServersideFilters(_objectSpread$D(_objectSpread$D({}, filterServerSide), {}, {
910
912
  columns: this._filterFields ? filterServerSide.columns : undefined,
911
913
  baseUrl: this._readListUrl,
912
914
  prefilter: prefilter
@@ -926,7 +928,7 @@ var _default$d = /*#__PURE__*/function () {
926
928
  });
927
929
  case 6:
928
930
  response = _context8.sent;
929
- return _context8.abrupt("return", _objectSpread$C(_objectSpread$C({}, response), {}, {
931
+ return _context8.abrupt("return", _objectSpread$D(_objectSpread$D({}, response), {}, {
930
932
  data: response.data.map(function (d) {
931
933
  return _this2.aplyJsonPath(d, _this2._readJsonPath);
932
934
  })
@@ -950,7 +952,7 @@ var _default$d = /*#__PURE__*/function () {
950
952
  throw new Error('Read List endpoint is missing in configuration.');
951
953
  }
952
954
  (_this$_rootStore6 = this._rootStore) === null || _this$_rootStore6 === void 0 ? void 0 : _this$_rootStore6.dataStore.jwt;
953
- var url = filterServerSide ? parseServersideFilters(_objectSpread$C(_objectSpread$C({}, filterServerSide), {}, {
955
+ var url = filterServerSide ? parseServersideFilters(_objectSpread$D(_objectSpread$D({}, filterServerSide), {}, {
954
956
  columns: this._filterFields ? filterServerSide.columns : undefined,
955
957
  baseUrl: this._readListUrl,
956
958
  prefilter: prefilter
@@ -982,9 +984,11 @@ var _default$d = /*#__PURE__*/function () {
982
984
  headers = {
983
985
  'content-type': 'application/json'
984
986
  };
985
- if (sessionGuid) headers['SessionGuid'] = sessionGuid;
986
- if (jwt) headers['Authorization'] = 'Bearer ' + jwt;
987
- _context9.next = 6;
987
+ if (!this._readPublicData) {
988
+ if (sessionGuid) headers['SessionGuid'] = sessionGuid;
989
+ if (jwt) headers['Authorization'] = 'Bearer ' + jwt;
990
+ }
991
+ _context9.next = 5;
988
992
  return fetch(url.toString(), {
989
993
  headers: headers
990
994
  }).then(function (r) {
@@ -996,10 +1000,10 @@ var _default$d = /*#__PURE__*/function () {
996
1000
  return undefined;
997
1001
  }
998
1002
  });
999
- case 6:
1003
+ case 5:
1000
1004
  response = _context9.sent;
1001
1005
  return _context9.abrupt("return", response);
1002
- case 8:
1006
+ case 7:
1003
1007
  case "end":
1004
1008
  return _context9.stop();
1005
1009
  }
@@ -1049,16 +1053,16 @@ var _default$d = /*#__PURE__*/function () {
1049
1053
  }
1050
1054
  });
1051
1055
  this._socket.on('error', function (error) {
1052
- LOG$9.error('Error on connection!', error);
1056
+ LOG$a.error('Error on connection!', error);
1053
1057
  });
1054
1058
  this._socket.on('connect_error', function (error) {
1055
- LOG$9.log("connect_error due to ".concat(error.message));
1059
+ LOG$a.log("connect_error due to ".concat(error.message));
1056
1060
  });
1057
1061
  this._socket.on('connect', function () {
1058
- LOG$9.debug('Successfully connected to socket');
1062
+ LOG$a.debug('Successfully connected to socket');
1059
1063
  });
1060
1064
  this._socket.on('disconnect', function () {
1061
- LOG$9.debug('Disconnect from socket');
1065
+ LOG$a.debug('Disconnect from socket');
1062
1066
  });
1063
1067
  return this._socket;
1064
1068
  }
@@ -1156,8 +1160,8 @@ var _default$c = /*#__PURE__*/function (_ApiHandler) {
1156
1160
  return _default;
1157
1161
  }(_default$d);
1158
1162
 
1159
- function ownKeys$B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1160
- function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1163
+ function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1164
+ function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1161
1165
  function _callSuper$6(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
1162
1166
  function _isNativeReflectConstruct$6() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { return !!t; })(); }
1163
1167
  var _default$b = /*#__PURE__*/function (_ApiHandler) {
@@ -1256,7 +1260,7 @@ var _default$b = /*#__PURE__*/function (_ApiHandler) {
1256
1260
  _context2.next = 5;
1257
1261
  return fetch(this._createUrl + '?ref=true', {
1258
1262
  method: this._createMethod,
1259
- headers: _objectSpread$B({}, jwt ? {
1263
+ headers: _objectSpread$C({}, jwt ? {
1260
1264
  Authorization: 'Bearer ' + jwt
1261
1265
  } : {}),
1262
1266
  body: data
@@ -1636,8 +1640,8 @@ var _default$8 = /*#__PURE__*/function (_ApiHandler) {
1636
1640
  return _default;
1637
1641
  }(_default$d);
1638
1642
 
1639
- function ownKeys$A(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1640
- function _objectSpread$A(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$A(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$A(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1643
+ function ownKeys$B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1644
+ function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1641
1645
  var _default$7 = /*#__PURE__*/function () {
1642
1646
  function _default(root) {
1643
1647
  _classCallCheck(this, _default);
@@ -1664,7 +1668,7 @@ var _default$7 = /*#__PURE__*/function () {
1664
1668
  }
1665
1669
  if (config.type == 'Menu') {
1666
1670
  var filteredItems = filterMenuByPermission(this.root.actions.userHasPermission, config.items);
1667
- config = _objectSpread$A(_objectSpread$A({}, config), {}, {
1671
+ config = _objectSpread$B(_objectSpread$B({}, config), {}, {
1668
1672
  items: filteredItems
1669
1673
  });
1670
1674
  } else if (config.type == 'Group') {
@@ -1673,7 +1677,7 @@ var _default$7 = /*#__PURE__*/function () {
1673
1677
  var _i$permission;
1674
1678
  return !i.permission || _this.root.actions.userHasPermission((_i$permission = i.permission) === null || _i$permission === void 0 ? void 0 : _i$permission.toLocaleLowerCase());
1675
1679
  });
1676
- config = _objectSpread$A(_objectSpread$A({}, config), {}, {
1680
+ config = _objectSpread$B(_objectSpread$B({}, config), {}, {
1677
1681
  items: _filteredItems
1678
1682
  });
1679
1683
  }
@@ -1681,9 +1685,9 @@ var _default$7 = /*#__PURE__*/function () {
1681
1685
  }
1682
1686
  }, {
1683
1687
  key: "setConfiguration",
1684
- value: function setConfiguration(config, apiConfig, t) {
1688
+ value: function setConfiguration(config, apiConfig, t, lang) {
1685
1689
  this._apiConfig = apiConfig;
1686
- var configuration = loadConfiguration(t, this.root, config);
1690
+ var configuration = loadConfiguration(t, this.root, config, lang);
1687
1691
 
1688
1692
  //merge with configuration so everything can changed by config
1689
1693
  if (config.configuration) {
@@ -1744,14 +1748,14 @@ function filterMenuByPermission(hasPermission, items) {
1744
1748
  return items.filter(function (item) {
1745
1749
  return !item.permission || hasPermission(item.permission.toLocaleLowerCase());
1746
1750
  }).map(function (item) {
1747
- return _objectSpread$A(_objectSpread$A({}, item), {}, {
1751
+ return _objectSpread$B(_objectSpread$B({}, item), {}, {
1748
1752
  items: filterMenuByPermission(hasPermission, item.items)
1749
1753
  });
1750
1754
  }).filter(function (item) {
1751
1755
  return !item.items || item.items.length > 0;
1752
1756
  });
1753
1757
  }
1754
- function loadConfiguration(t, root, config) {
1758
+ function loadConfiguration(t, root, config, lang) {
1755
1759
  var _organization$setting, _organization$setting2, _organization$setting3, _organization$setting4, _parentOrganizations, _parentOrganizations2, _parentOrganizations3, _parentOrganizations4, _parentOrganizations5, _parentOrganizations6, _parentOrganizations7, _parentOrganizations8, _parentOrganizations9, _parentOrganizations10, _parentOrganizations11, _parentOrganizations12, _parentOrganizations13;
1756
1760
  var organization = toJS(root.dataStore.currentOrganization);
1757
1761
  return {
@@ -2738,62 +2742,61 @@ function loadConfiguration(t, root, config) {
2738
2742
  field: 'ArticleName',
2739
2743
  sorter: 1,
2740
2744
  filter: 'advanced',
2741
- width: 50
2745
+ width: 150
2742
2746
  }, {
2743
2747
  title: t('backoffice.table.partlists.columns.GroupName'),
2744
2748
  field: 'GroupName',
2745
2749
  sorter: 2,
2746
2750
  filter: 'advanced',
2747
- width: 150
2751
+ width: 100
2748
2752
  }, {
2749
2753
  title: t('backoffice.table.partlists.columns.ItemRefArticleCodex'),
2750
2754
  field: 'ItemRefArticleCodex',
2751
2755
  sorter: 3,
2752
2756
  filter: 'advanced',
2753
- width: 50
2757
+ width: 100
2754
2758
  }, {
2755
2759
  title: t('backoffice.table.partlists.columns.RefWidth'),
2756
2760
  field: 'RefWidth',
2757
2761
  sorter: 4,
2758
2762
  filter: 'advanced',
2759
- width: 50
2763
+ width: 60
2760
2764
  }, {
2761
2765
  title: t('backoffice.table.partlists.columns.RefHeight'),
2762
2766
  field: 'RefHeight',
2763
2767
  filter: 'advanced',
2764
2768
  sorter: 5,
2765
- width: 50
2769
+ width: 60
2766
2770
  }, {
2767
2771
  title: t('backoffice.table.partlists.columns.RefDepth'),
2768
2772
  field: 'RefDepth',
2769
2773
  sorter: 6,
2770
2774
  filter: 'advanced',
2771
- width: 50
2775
+ width: 60
2772
2776
  }, {
2773
2777
  title: t('backoffice.table.partlists.columns.GroupedFormula'),
2774
2778
  field: 'GroupedFormula',
2775
2779
  sorter: 7,
2776
- filter: 'advanced',
2777
- width: 200
2780
+ filter: 'advanced'
2778
2781
  }, {
2779
2782
  title: t('backoffice.table.partlists.columns.Formula'),
2780
2783
  field: 'Formula',
2781
2784
  sorter: 8,
2782
- filter: 'advanced',
2783
- width: 200
2785
+ filter: 'advanced'
2784
2786
  }, {
2785
2787
  title: t('backoffice.table.partlists.columns.RetailPrefix'),
2786
2788
  field: 'RetailPrefix',
2787
2789
  sorter: 9,
2788
2790
  filter: 'advanced',
2789
- width: 50
2791
+ width: 110
2790
2792
  }, {
2791
2793
  title: t('backoffice.table.partlists.columns.RetailArticleNr'),
2792
2794
  field: 'RetailArticleNr',
2793
2795
  editable: true,
2794
2796
  sorter: 9,
2795
2797
  filter: 'advanced',
2796
- width: 150
2798
+ width: 150,
2799
+ fixed: 'right'
2797
2800
  }],
2798
2801
  apiInterface: {
2799
2802
  read: {
@@ -6123,13 +6126,21 @@ function loadConfiguration(t, root, config) {
6123
6126
  }, {
6124
6127
  name: 'countryCode',
6125
6128
  label: t('backoffice.form.organizationdetails.items.countryCode'),
6126
- required: function required(data) {
6127
- return !((data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined);
6129
+ type: 'selectSimple',
6130
+ apiInterface: {
6131
+ read: {
6132
+ list: '/country_codes.json',
6133
+ "public": true
6134
+ }
6128
6135
  },
6129
- type: 'input',
6130
- hidden: function hidden(data) {
6131
- return (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined;
6132
- }
6136
+ selectMapping: {
6137
+ label: "${".concat(lang, "}"),
6138
+ value: '${code}',
6139
+ externalValue: 'value'
6140
+ },
6141
+ placeholder: t('backoffice.form.organizationdetails.items.selectCountryCode'),
6142
+ allowClear: true,
6143
+ search: true
6133
6144
  }, {
6134
6145
  name: 'contact',
6135
6146
  label: 'backoffice.organization.contact',
@@ -7732,10 +7743,11 @@ function loadConfiguration(t, root, config) {
7732
7743
  5: [10],
7733
7744
  6: [10],
7734
7745
  7: [8, 9, 10],
7735
- 8: [12, 9],
7736
- 9: [8, 2, 3, 10],
7737
- 10: [1, 2, 3],
7738
- 11: [2, 3, 10]
7746
+ 8: [12, 9, 7],
7747
+ 9: [8, 2, 3, 7, 10],
7748
+ 10: [1, 2, 3, 7],
7749
+ 11: [2, 3, 10],
7750
+ 12: [1, 2, 7]
7739
7751
  }
7740
7752
  }, {
7741
7753
  name: 'message',
@@ -8319,7 +8331,17 @@ function loadConfiguration(t, root, config) {
8319
8331
  }, {
8320
8332
  name: 'countryCode',
8321
8333
  label: t('backoffice.description.currentorg.items.countryCode'),
8322
- span: 2
8334
+ span: 2,
8335
+ value: {
8336
+ apiInterface: {
8337
+ read: {
8338
+ list: '/country_codes.json',
8339
+ "public": true
8340
+ }
8341
+ },
8342
+ label: "".concat(lang),
8343
+ value: 'code'
8344
+ }
8323
8345
  }, {
8324
8346
  name: 'contact',
8325
8347
  label: 'backoffice.organization.contact',
@@ -10031,9 +10053,9 @@ function loadConfiguration(t, root, config) {
10031
10053
  };
10032
10054
  }
10033
10055
 
10034
- function _createForOfIteratorHelper$k(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$k(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
10035
- function _unsupportedIterableToArray$k(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$k(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$k(o, minLen); }
10036
- function _arrayLikeToArray$k(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10056
+ function _createForOfIteratorHelper$l(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$l(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
10057
+ function _unsupportedIterableToArray$l(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$l(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$l(o, minLen); }
10058
+ function _arrayLikeToArray$l(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10037
10059
  function aplyRule(_ref) {
10038
10060
  var rules = _ref.rules,
10039
10061
  data = _ref.data,
@@ -10042,7 +10064,7 @@ function aplyRule(_ref) {
10042
10064
  //if or we start with false until the first time some result is true
10043
10065
  //if and we start with true until the frist time some result is false
10044
10066
  var result = !or;
10045
- var _iterator = _createForOfIteratorHelper$k(rules),
10067
+ var _iterator = _createForOfIteratorHelper$l(rules),
10046
10068
  _step;
10047
10069
  try {
10048
10070
  var _loop = function _loop() {
@@ -10095,7 +10117,7 @@ function aplyRules(_ref2) {
10095
10117
  rootStore = _ref2.rootStore,
10096
10118
  or = _ref2.or;
10097
10119
  if (!data || data.length == 0) return false;
10098
- var _iterator2 = _createForOfIteratorHelper$k(data),
10120
+ var _iterator2 = _createForOfIteratorHelper$l(data),
10099
10121
  _step2;
10100
10122
  try {
10101
10123
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -10438,10 +10460,10 @@ var _default$3 = /*#__PURE__*/function () {
10438
10460
  return _default;
10439
10461
  }();
10440
10462
 
10441
- function _createForOfIteratorHelper$j(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$j(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
10442
- function _unsupportedIterableToArray$j(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$j(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$j(o, minLen); }
10443
- function _arrayLikeToArray$j(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10444
- var LOG$8 = getLogger('Backoffice', 'DownloadStore');
10463
+ function _createForOfIteratorHelper$k(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$k(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
10464
+ function _unsupportedIterableToArray$k(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$k(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$k(o, minLen); }
10465
+ function _arrayLikeToArray$k(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10466
+ var LOG$9 = getLogger('Backoffice', 'DownloadStore');
10445
10467
  var DownloadStore = /*#__PURE__*/function () {
10446
10468
  function DownloadStore(_rootStore) {
10447
10469
  var _this = this;
@@ -10468,7 +10490,7 @@ var DownloadStore = /*#__PURE__*/function () {
10468
10490
  _context2.next = 23;
10469
10491
  break;
10470
10492
  }
10471
- _iterator = _createForOfIteratorHelper$j(action.download);
10493
+ _iterator = _createForOfIteratorHelper$k(action.download);
10472
10494
  _context2.prev = 8;
10473
10495
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
10474
10496
  var _download$params, _ref3, _data$fileUrl;
@@ -10657,7 +10679,7 @@ var DownloadStore = /*#__PURE__*/function () {
10657
10679
  _context5.next = 4;
10658
10680
  break;
10659
10681
  }
10660
- LOG$8.debug("The organization ".concat(data._id, " has no parentType of ").concat(validTypes.join(' or ')));
10682
+ LOG$9.debug("The organization ".concat(data._id, " has no parentType of ").concat(validTypes.join(' or ')));
10661
10683
  throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer, retailer channel or association' : 'supplier or dealer'));
10662
10684
  case 4:
10663
10685
  orgData = data;
@@ -10676,7 +10698,7 @@ var DownloadStore = /*#__PURE__*/function () {
10676
10698
  _context5.next = 14;
10677
10699
  break;
10678
10700
  }
10679
- LOG$8.debug("The organization ".concat(data._id, " has no type of ").concat(validTypes.join(' or '), " nor a parent organization"));
10701
+ LOG$9.debug("The organization ".concat(data._id, " has no type of ").concat(validTypes.join(' or '), " nor a parent organization"));
10680
10702
  throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer channel or association' : 'supplier or dealer'));
10681
10703
  case 14:
10682
10704
  _context5.prev = 14;
@@ -10796,7 +10818,7 @@ var DownloadStore = /*#__PURE__*/function () {
10796
10818
  break;
10797
10819
  }
10798
10820
  promises = [];
10799
- _iterator2 = _createForOfIteratorHelper$j(props.data);
10821
+ _iterator2 = _createForOfIteratorHelper$k(props.data);
10800
10822
  _context7.prev = 3;
10801
10823
  _iterator2.s();
10802
10824
  case 5:
@@ -11024,7 +11046,7 @@ var StoreProvider = function StoreProvider(_ref) {
11024
11046
  useEffect(function () {
11025
11047
  store.dataStore.setUserData(jwt, nToken, user);
11026
11048
  store.dataStore.setOrganizationData(organization);
11027
- store.configurationStore.setConfiguration(settings, apiConfig, t);
11049
+ store.configurationStore.setConfiguration(settings, apiConfig, t, i18n.language);
11028
11050
  }, [jwt, nToken, user, organization, settings, apiConfig, i18n.language]);
11029
11051
  useEffect(function () {
11030
11052
  store.updateHandlers(handler);
@@ -11042,8 +11064,35 @@ var useStore = function useStore() {
11042
11064
  return store;
11043
11065
  };
11044
11066
 
11045
- function ownKeys$z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11046
- function _objectSpread$z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$z(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11067
+ function _createForOfIteratorHelper$j(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$j(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
11068
+ function _unsupportedIterableToArray$j(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$j(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$j(o, minLen); }
11069
+ function _arrayLikeToArray$j(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11070
+ function getCombinedValues(data, pattern) {
11071
+ if (!pattern || !data) {
11072
+ return data;
11073
+ }
11074
+ var value = pattern;
11075
+ var _iterator = _createForOfIteratorHelper$j(pattern.matchAll(/\$\{(.*?)\}/g)),
11076
+ _step;
11077
+ try {
11078
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
11079
+ var _flatten$match$;
11080
+ var match = _step.value;
11081
+ value = value.replace(match[0], (_flatten$match$ = flat(data)[match[1]]) !== null && _flatten$match$ !== void 0 ? _flatten$match$ : '');
11082
+ }
11083
+ } catch (err) {
11084
+ _iterator.e(err);
11085
+ } finally {
11086
+ _iterator.f();
11087
+ }
11088
+ return value;
11089
+ }
11090
+
11091
+ function _createForOfIteratorHelper$i(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$i(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
11092
+ function _unsupportedIterableToArray$i(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$i(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$i(o, minLen); }
11093
+ function _arrayLikeToArray$i(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11094
+ function ownKeys$A(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11095
+ function _objectSpread$A(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$A(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$A(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11047
11096
  function useDescriptions (_ref) {
11048
11097
  var id = _ref.id;
11049
11098
  var root = useStore();
@@ -11055,39 +11104,168 @@ function useDescriptions (_ref) {
11055
11104
  }, []),
11056
11105
  apiHandler = _useMemo.apiHandler,
11057
11106
  configuration = _useMemo.configuration;
11058
- var _useState = useState({
11059
- loading: false
11060
- }),
11107
+ var _useState = useState(false),
11061
11108
  _useState2 = _slicedToArray(_useState, 2),
11062
- state = _useState2[0],
11063
- setState = _useState2[1];
11109
+ loading = _useState2[0],
11110
+ setLoading = _useState2[1];
11111
+ var _useState3 = useState({}),
11112
+ _useState4 = _slicedToArray(_useState3, 2),
11113
+ data = _useState4[0],
11114
+ setData = _useState4[1];
11115
+ var _useState5 = useState({}),
11116
+ _useState6 = _slicedToArray(_useState5, 2),
11117
+ displayData = _useState6[0],
11118
+ setDisplayData = _useState6[1];
11064
11119
  useEffect(function () {
11065
- setState(_objectSpread$z(_objectSpread$z({}, state), {}, {
11066
- loading: true
11067
- }));
11068
- apiHandler.read(configuration.mapping).then(function (data) {
11069
- setState(_objectSpread$z(_objectSpread$z({}, state), {}, {
11070
- loading: false,
11071
- data: data
11120
+ setLoading(true);
11121
+ apiHandler.read(configuration.mapping).then( /*#__PURE__*/function () {
11122
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
11123
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
11124
+ while (1) switch (_context.prev = _context.next) {
11125
+ case 0:
11126
+ _context.t0 = setDisplayData;
11127
+ _context.next = 3;
11128
+ return getDisplayData(configuration.items, data, root);
11129
+ case 3:
11130
+ _context.t1 = _context.sent;
11131
+ (0, _context.t0)(_context.t1);
11132
+ setData(data);
11133
+ setLoading(false);
11134
+ case 7:
11135
+ case "end":
11136
+ return _context.stop();
11137
+ }
11138
+ }, _callee);
11072
11139
  }));
11073
- });
11140
+ return function (_x) {
11141
+ return _ref2.apply(this, arguments);
11142
+ };
11143
+ }());
11074
11144
  }, [root.dataStore.selectedOrganizationId]);
11075
- var onUpdate = function onUpdate(data) {
11076
- setState(_objectSpread$z(_objectSpread$z({}, state), {}, {
11077
- data: data
11145
+ var onUpdate = /*#__PURE__*/function () {
11146
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
11147
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
11148
+ while (1) switch (_context2.prev = _context2.next) {
11149
+ case 0:
11150
+ setData(data);
11151
+ _context2.t0 = setDisplayData;
11152
+ _context2.next = 4;
11153
+ return getDisplayData(configuration.items, data, root);
11154
+ case 4:
11155
+ _context2.t1 = _context2.sent;
11156
+ (0, _context2.t0)(_context2.t1);
11157
+ case 6:
11158
+ case "end":
11159
+ return _context2.stop();
11160
+ }
11161
+ }, _callee2);
11078
11162
  }));
11079
- };
11080
- return _objectSpread$z(_objectSpread$z({}, state), {}, {
11163
+ return function onUpdate(_x2) {
11164
+ return _ref3.apply(this, arguments);
11165
+ };
11166
+ }();
11167
+ return {
11168
+ loading: loading,
11169
+ data: data,
11170
+ displayData: displayData,
11081
11171
  configuration: configuration,
11082
11172
  onUpdate: onUpdate
11083
- });
11173
+ };
11084
11174
  }
11085
11175
 
11086
- function ownKeys$y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11087
- function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11088
- function _createForOfIteratorHelper$i(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$i(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
11089
- function _unsupportedIterableToArray$i(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$i(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$i(o, minLen); }
11090
- function _arrayLikeToArray$i(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11176
+ /**
11177
+ * Apply the display value options to the data
11178
+ */
11179
+ function getDisplayData(_x3, _x4, _x5) {
11180
+ return _getDisplayData.apply(this, arguments);
11181
+ }
11182
+ function _getDisplayData() {
11183
+ _getDisplayData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(items, data, root) {
11184
+ var displayData, _iterator, _step, _loop;
11185
+ return _regeneratorRuntime.wrap(function _callee3$(_context4) {
11186
+ while (1) switch (_context4.prev = _context4.next) {
11187
+ case 0:
11188
+ displayData = _objectSpread$A({}, data);
11189
+ _iterator = _createForOfIteratorHelper$i(items);
11190
+ _context4.prev = 2;
11191
+ _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
11192
+ var item, itemWithMappingData, apiHandler, response, mappingData;
11193
+ return _regeneratorRuntime.wrap(function _loop$(_context3) {
11194
+ while (1) switch (_context3.prev = _context3.next) {
11195
+ case 0:
11196
+ item = _step.value;
11197
+ if (!(_typeof(item.value) == 'object')) {
11198
+ _context3.next = 13;
11199
+ break;
11200
+ }
11201
+ itemWithMappingData = item;
11202
+ apiHandler = new _default$d({
11203
+ type: 'Description',
11204
+ apiInterface: item.value.apiInterface
11205
+ }, root); // Only fetch the mapping data once
11206
+ if (itemWithMappingData.mappingData) {
11207
+ _context3.next = 9;
11208
+ break;
11209
+ }
11210
+ _context3.next = 7;
11211
+ return apiHandler.readList();
11212
+ case 7:
11213
+ response = _context3.sent;
11214
+ itemWithMappingData.mappingData = response.data;
11215
+ case 9:
11216
+ mappingData = itemWithMappingData.mappingData.find(function (mappingData) {
11217
+ return mappingData[item.value.value] == displayData[item.name];
11218
+ });
11219
+ displayData[item.name] = mappingData ? mappingData[item.value.label] : displayData[item.name];
11220
+ _context3.next = 14;
11221
+ break;
11222
+ case 13:
11223
+ if (typeof item.value == 'string') {
11224
+ displayData[item.name] = getCombinedValues(displayData === null || displayData === void 0 ? void 0 : displayData[item.name], item.value);
11225
+ }
11226
+ case 14:
11227
+ case "end":
11228
+ return _context3.stop();
11229
+ }
11230
+ }, _loop);
11231
+ });
11232
+ _iterator.s();
11233
+ case 5:
11234
+ if ((_step = _iterator.n()).done) {
11235
+ _context4.next = 9;
11236
+ break;
11237
+ }
11238
+ return _context4.delegateYield(_loop(), "t0", 7);
11239
+ case 7:
11240
+ _context4.next = 5;
11241
+ break;
11242
+ case 9:
11243
+ _context4.next = 14;
11244
+ break;
11245
+ case 11:
11246
+ _context4.prev = 11;
11247
+ _context4.t1 = _context4["catch"](2);
11248
+ _iterator.e(_context4.t1);
11249
+ case 14:
11250
+ _context4.prev = 14;
11251
+ _iterator.f();
11252
+ return _context4.finish(14);
11253
+ case 17:
11254
+ return _context4.abrupt("return", displayData);
11255
+ case 18:
11256
+ case "end":
11257
+ return _context4.stop();
11258
+ }
11259
+ }, _callee3, null, [[2, 11, 14, 17]]);
11260
+ }));
11261
+ return _getDisplayData.apply(this, arguments);
11262
+ }
11263
+
11264
+ function ownKeys$z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11265
+ function _objectSpread$z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$z(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11266
+ function _createForOfIteratorHelper$h(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$h(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
11267
+ function _unsupportedIterableToArray$h(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$h(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$h(o, minLen); }
11268
+ function _arrayLikeToArray$h(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11091
11269
  function ActionButton (_ref) {
11092
11270
  var action = _ref.action,
11093
11271
  callback = _ref.callback,
@@ -11107,7 +11285,7 @@ function ActionButton (_ref) {
11107
11285
  var ButtonType = type == 'Button' ? Button : A;
11108
11286
  var disable = false;
11109
11287
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
11110
- var _iterator = _createForOfIteratorHelper$i(ruleData !== null && ruleData !== void 0 ? ruleData : data),
11288
+ var _iterator = _createForOfIteratorHelper$h(ruleData !== null && ruleData !== void 0 ? ruleData : data),
11111
11289
  _step;
11112
11290
  try {
11113
11291
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -11213,7 +11391,7 @@ function ActionButton (_ref) {
11213
11391
  _context.next = 24;
11214
11392
  break;
11215
11393
  }
11216
- _iterator2 = _createForOfIteratorHelper$i(action.switchValues);
11394
+ _iterator2 = _createForOfIteratorHelper$h(action.switchValues);
11217
11395
  try {
11218
11396
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
11219
11397
  element = _step2.value;
@@ -11225,7 +11403,7 @@ function ActionButton (_ref) {
11225
11403
  _iterator2.f();
11226
11404
  }
11227
11405
  _context.next = 23;
11228
- return apiInterface.update(_objectSpread$y(_objectSpread$y({}, data), {}, {
11406
+ return apiInterface.update(_objectSpread$z(_objectSpread$z({}, data), {}, {
11229
11407
  state: toSwitch
11230
11408
  }), data);
11231
11409
  case 23:
@@ -11253,7 +11431,7 @@ function ActionButton (_ref) {
11253
11431
  switch (action.actionType) {
11254
11432
  case 'SwitchButton':
11255
11433
  var lable;
11256
- var _iterator3 = _createForOfIteratorHelper$i(action.switchLable),
11434
+ var _iterator3 = _createForOfIteratorHelper$h(action.switchLable),
11257
11435
  _step3;
11258
11436
  try {
11259
11437
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -11325,31 +11503,7 @@ function ActionButton (_ref) {
11325
11503
  }
11326
11504
  }
11327
11505
  function A(props) {
11328
- return /*#__PURE__*/jsx("a", _objectSpread$y({}, props));
11329
- }
11330
-
11331
- function _createForOfIteratorHelper$h(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$h(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
11332
- function _unsupportedIterableToArray$h(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$h(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$h(o, minLen); }
11333
- function _arrayLikeToArray$h(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11334
- function getCombinedValues(data, pattern) {
11335
- if (!pattern || !data) {
11336
- return data;
11337
- }
11338
- var value = pattern;
11339
- var _iterator = _createForOfIteratorHelper$h(pattern.matchAll(/\$\{(.*?)\}/g)),
11340
- _step;
11341
- try {
11342
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
11343
- var _flatten$match$;
11344
- var match = _step.value;
11345
- value = value.replace(match[0], (_flatten$match$ = flat(data)[match[1]]) !== null && _flatten$match$ !== void 0 ? _flatten$match$ : '');
11346
- }
11347
- } catch (err) {
11348
- _iterator.e(err);
11349
- } finally {
11350
- _iterator.f();
11351
- }
11352
- return value;
11506
+ return /*#__PURE__*/jsx("a", _objectSpread$z({}, props));
11353
11507
  }
11354
11508
 
11355
11509
  var DescriptionWrapper = function DescriptionWrapper(_ref) {
@@ -11381,11 +11535,11 @@ var DescriptionWrapper = function DescriptionWrapper(_ref) {
11381
11535
  }),
11382
11536
  bordered: true,
11383
11537
  children: state.configuration.items.map(function (item) {
11384
- var _state$data, _state$data2;
11538
+ var _state$displayData;
11385
11539
  return /*#__PURE__*/jsx(Descriptions.Item, {
11386
11540
  label: item.label ? t(item.label, item.label) : item.name,
11387
11541
  span: item.span,
11388
- children: item.value ? getCombinedValues((_state$data = state.data) === null || _state$data === void 0 ? void 0 : _state$data[item.name], item.value) : (_state$data2 = state.data) === null || _state$data2 === void 0 ? void 0 : _state$data2[item.name]
11542
+ children: (_state$displayData = state.displayData) === null || _state$displayData === void 0 ? void 0 : _state$displayData[item.name]
11389
11543
  }, item.name);
11390
11544
  })
11391
11545
  })
@@ -11396,8 +11550,8 @@ var Description = observer(DescriptionWrapper);
11396
11550
  function _createForOfIteratorHelper$g(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$g(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
11397
11551
  function _unsupportedIterableToArray$g(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$g(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$g(o, minLen); }
11398
11552
  function _arrayLikeToArray$g(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11399
- function ownKeys$x(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11400
- function _objectSpread$x(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$x(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$x(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11553
+ function ownKeys$y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11554
+ function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11401
11555
  function useSelectData (_ref) {
11402
11556
  var data = _ref.data,
11403
11557
  onChange = _ref.onChange,
@@ -11578,7 +11732,7 @@ function useSelectData (_ref) {
11578
11732
  setFetching(true);
11579
11733
  serverSideParams = {
11580
11734
  filters: selectMapping !== null && selectMapping !== void 0 && selectMapping.searchField ? selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.searchField.reduce(function (filter, field) {
11581
- return _objectSpread$x(_objectSpread$x({}, filter), value !== undefined ? _defineProperty({}, field.field, [value, field.filter, true]) : {});
11735
+ return _objectSpread$y(_objectSpread$y({}, filter), value !== undefined ? _defineProperty({}, field.field, [value, field.filter, true]) : {});
11582
11736
  }, {}) : {
11583
11737
  _id: [value, 'contains']
11584
11738
  },
@@ -11814,7 +11968,7 @@ function styleInject(css, ref) {
11814
11968
  var css_248z$j = ".darkmode .ant-select-selection-search-input {\n color: #fff;\n}\n";
11815
11969
  styleInject(css_248z$j);
11816
11970
 
11817
- var SelectWrapper = function SelectWrapper(_ref) {
11971
+ var SelectWrapper$1 = function SelectWrapper(_ref) {
11818
11972
  var onChange = _ref.onChange,
11819
11973
  onError = _ref.onError,
11820
11974
  value = _ref.value,
@@ -11889,7 +12043,7 @@ var SelectWrapper = function SelectWrapper(_ref) {
11889
12043
  })
11890
12044
  });
11891
12045
  };
11892
- var Select = observer(SelectWrapper, {
12046
+ var Select = observer(SelectWrapper$1, {
11893
12047
  forwardRef: true
11894
12048
  });
11895
12049
 
@@ -12076,8 +12230,8 @@ function removeEmpty(data) {
12076
12230
  return undefined;
12077
12231
  }
12078
12232
 
12079
- function ownKeys$w(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12080
- function _objectSpread$w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$w(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12233
+ function ownKeys$x(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12234
+ function _objectSpread$x(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$x(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$x(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12081
12235
  function _createForOfIteratorHelper$e(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$e(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
12082
12236
  function _unsupportedIterableToArray$e(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$e(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$e(o, minLen); }
12083
12237
  function _arrayLikeToArray$e(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -12170,7 +12324,7 @@ function useFormData (_ref) {
12170
12324
  multipleEditingData = inboundData;
12171
12325
  }
12172
12326
  return {
12173
- loadedData: onLoadFields(_objectSpread$w({}, dt)),
12327
+ loadedData: onLoadFields(_objectSpread$x({}, dt)),
12174
12328
  multipleEditingData: multipleEditingData
12175
12329
  };
12176
12330
  }, [inboundData, selectedItemsIndex]),
@@ -12207,7 +12361,7 @@ function useFormData (_ref) {
12207
12361
  setFieldErrors = _useState14[1];
12208
12362
  useEffect(function () {
12209
12363
  var _loadedData$_id2;
12210
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12364
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12211
12365
  data: loadedData,
12212
12366
  origData: JSON.parse(JSON.stringify(inboundData !== null && inboundData !== void 0 ? inboundData : {})),
12213
12367
  update: !!((_loadedData$_id2 = loadedData === null || loadedData === void 0 ? void 0 : loadedData._id) !== null && _loadedData$_id2 !== void 0 ? _loadedData$_id2 : loadedData === null || loadedData === void 0 ? void 0 : loadedData.ID),
@@ -12302,7 +12456,7 @@ function useFormData (_ref) {
12302
12456
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
12303
12457
  while (1) switch (_context2.prev = _context2.next) {
12304
12458
  case 0:
12305
- newData = _objectSpread$w({}, state.data);
12459
+ newData = _objectSpread$x({}, state.data);
12306
12460
  Object.keys(values).forEach(function (k) {
12307
12461
  var _values$k$value, _values$k;
12308
12462
  return newData[k] = (_values$k$value = (_values$k = values[k]) === null || _values$k === void 0 ? void 0 : _values$k.value) !== null && _values$k$value !== void 0 ? _values$k$value : values[k];
@@ -12314,12 +12468,12 @@ function useFormData (_ref) {
12314
12468
  return _context2.abrupt("return", newData);
12315
12469
  case 4:
12316
12470
  _context2.next = 6;
12317
- return setDynamicFields(_objectSpread$w({}, state.data), newData);
12471
+ return setDynamicFields(_objectSpread$x({}, state.data), newData);
12318
12472
  case 6:
12319
12473
  newData = _context2.sent;
12320
- newData = onSaveFields(_objectSpread$w({}, state.data), newData);
12474
+ newData = onSaveFields(_objectSpread$x({}, state.data), newData);
12321
12475
  newData = removeEmpty(newData);
12322
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12476
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12323
12477
  loading: true
12324
12478
  }));
12325
12479
  finalData = state.data;
@@ -12368,13 +12522,13 @@ function useFormData (_ref) {
12368
12522
  _context2.next = 38;
12369
12523
  break;
12370
12524
  }
12371
- setFieldErrors(_objectSpread$w(_objectSpread$w({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
12525
+ setFieldErrors(_objectSpread$x(_objectSpread$x({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
12372
12526
  return _context2.abrupt("return", undefined);
12373
12527
  case 38:
12374
12528
  throw _context2.t0;
12375
12529
  case 39:
12376
12530
  _context2.prev = 39;
12377
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12531
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12378
12532
  data: finalData,
12379
12533
  loading: false
12380
12534
  }));
@@ -12404,7 +12558,7 @@ function useFormData (_ref) {
12404
12558
  }
12405
12559
  var updateHiddenRequiredDisabled = function updateHiddenRequiredDisabled(data, changedFields) {
12406
12560
  if (!(selectedItems !== null && selectedItems !== void 0 && selectedItems.length)) return;
12407
- var wholeData = Object.assign(_objectSpread$w({}, state.data), _objectSpread$w({}, changedFields !== null && changedFields !== void 0 ? changedFields : data));
12561
+ var wholeData = Object.assign(_objectSpread$x({}, state.data), _objectSpread$x({}, changedFields !== null && changedFields !== void 0 ? changedFields : data));
12408
12562
  var newState = getHiddenRequredDisabled(wholeData, selectedItems);
12409
12563
  if (JSON.stringify(newState) !== JSON.stringify(hiddenRequiredDisabled)) {
12410
12564
  setHiddenRequiredDisabled(newState);
@@ -12417,12 +12571,12 @@ function useFormData (_ref) {
12417
12571
  }
12418
12572
  };
12419
12573
  var onInputChanged = function onInputChanged(id, value, d) {
12420
- var data = d !== null && d !== void 0 ? d : Object.assign(_objectSpread$w({}, state.data), _objectSpread$w({}, state.form.getFieldsValue()));
12574
+ var data = d !== null && d !== void 0 ? d : Object.assign(_objectSpread$x({}, state.data), _objectSpread$x({}, state.form.getFieldsValue()));
12421
12575
  setFieldInObject(id, data, value);
12422
- var newFieldErrors = _objectSpread$w({}, fieldErrors);
12576
+ var newFieldErrors = _objectSpread$x({}, fieldErrors);
12423
12577
  delete newFieldErrors[id.toString()];
12424
12578
  setFieldErrors(newFieldErrors);
12425
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12579
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12426
12580
  data: data
12427
12581
  }));
12428
12582
  return data;
@@ -12448,12 +12602,12 @@ function useFormData (_ref) {
12448
12602
  var _value$value;
12449
12603
  if (((_value$value = value === null || value === void 0 ? void 0 : value.value) !== null && _value$value !== void 0 ? _value$value : value) === val) {
12450
12604
  if (configuration.itemSelectorReset) {
12451
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12605
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12452
12606
  data: _defineProperty({}, name, val)
12453
12607
  }));
12454
12608
  } else {
12455
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12456
- data: _objectSpread$w(_objectSpread$w({}, state.data), {}, _defineProperty({}, name, val))
12609
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12610
+ data: _objectSpread$x(_objectSpread$x({}, state.data), {}, _defineProperty({}, name, val))
12457
12611
  }));
12458
12612
  }
12459
12613
  setSelectedItemsIndex(idx);
@@ -12463,12 +12617,12 @@ function useFormData (_ref) {
12463
12617
  var val = _ref6.value;
12464
12618
  if (value === val) {
12465
12619
  if (configuration.itemSelectorReset) {
12466
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12620
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12467
12621
  data: _defineProperty({}, name, val)
12468
12622
  }));
12469
12623
  } else {
12470
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12471
- data: _objectSpread$w(_objectSpread$w({}, state.data), {}, _defineProperty({}, name, val))
12624
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12625
+ data: _objectSpread$x(_objectSpread$x({}, state.data), {}, _defineProperty({}, name, val))
12472
12626
  }));
12473
12627
  }
12474
12628
  setSelectedItemsIndex(idx);
@@ -12582,7 +12736,7 @@ function useFormData (_ref) {
12582
12736
  }));
12583
12737
  return _setDynamicFields.apply(this, arguments);
12584
12738
  }
12585
- return _objectSpread$w(_objectSpread$w({}, state), {}, {
12739
+ return _objectSpread$x(_objectSpread$x({}, state), {}, {
12586
12740
  setUsedPreset: setUsedPreset,
12587
12741
  configuration: configuration,
12588
12742
  changedFields: changedFields,
@@ -12640,8 +12794,8 @@ function getData(id, data) {
12640
12794
  }
12641
12795
  }
12642
12796
 
12643
- function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12644
- function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12797
+ function ownKeys$w(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12798
+ function _objectSpread$w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$w(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12645
12799
  function _createForOfIteratorHelper$d(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$d(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
12646
12800
  function _unsupportedIterableToArray$d(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$d(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$d(o, minLen); }
12647
12801
  function _arrayLikeToArray$d(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -12691,13 +12845,13 @@ var Presets = function Presets(_ref) {
12691
12845
  } finally {
12692
12846
  _iterator.f();
12693
12847
  }
12694
- var data = _objectSpread$v(_objectSpread$v({}, form.getFieldsValue(names)), {}, {
12848
+ var data = _objectSpread$w(_objectSpread$w({}, form.getFieldsValue(names)), {}, {
12695
12849
  newPresetName: newPresetName
12696
12850
  });
12697
12851
  data.dpi = parseInt(data.dpi);
12698
12852
  data.organization = root.getGlobalValue('organizationId');
12699
12853
  apiHandler.create({}, state.configuration.createPresetMapping, data);
12700
- var dt = _objectSpread$v(_objectSpread$v({}, form.getFieldsValue(names)), {}, {
12854
+ var dt = _objectSpread$w(_objectSpread$w({}, form.getFieldsValue(names)), {}, {
12701
12855
  name: newPresetName
12702
12856
  });
12703
12857
  setPresets({
@@ -13080,8 +13234,8 @@ var buttonGroup = "button-group-GYt-T";
13080
13234
  var css_248z$h = ".wrapper-GVe2h {\n display: flex;\n flex-direction: row;\n gap: 12px;\n}\n\n.button-group-GYt-T {\n display: flex;\n flex-direction: row;\n gap: 12px;\n margin: 0 12px;\n}\n";
13081
13235
  styleInject(css_248z$h);
13082
13236
 
13083
- function ownKeys$u(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13084
- function _objectSpread$u(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$u(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$u(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13237
+ function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13238
+ function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13085
13239
  var SubTitle = function SubTitle(_ref) {
13086
13240
  var _item$orientation, _item$buttonIds;
13087
13241
  var item = _ref.item,
@@ -13090,7 +13244,7 @@ var SubTitle = function SubTitle(_ref) {
13090
13244
  t = _useTranslation.t;
13091
13245
  return /*#__PURE__*/jsx(Divider, {
13092
13246
  orientation: (_item$orientation = item.orientation) !== null && _item$orientation !== void 0 ? _item$orientation : 'left',
13093
- style: _objectSpread$u({}, item.style),
13247
+ style: _objectSpread$v({}, item.style),
13094
13248
  children: /*#__PURE__*/jsxs("div", {
13095
13249
  className: wrapper$2,
13096
13250
  children: [t(item.name), ((_item$buttonIds = item.buttonIds) === null || _item$buttonIds === void 0 ? void 0 : _item$buttonIds.length) && item.buttonIds.map(function (b) {
@@ -13768,8 +13922,8 @@ var _default = /*#__PURE__*/function (_ApiHandler) {
13768
13922
  return _default;
13769
13923
  }(_default$d);
13770
13924
 
13771
- function ownKeys$t(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13772
- function _objectSpread$t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$t(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13925
+ function ownKeys$u(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13926
+ function _objectSpread$u(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$u(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$u(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13773
13927
  getLogger('Backoffice', 'SelectClientRelationCatalog');
13774
13928
  function useSelectClientRelationCatalog (_ref) {
13775
13929
  var onSelectedCatalog = _ref.onSelectedCatalog,
@@ -13938,7 +14092,7 @@ function useSelectClientRelationCatalog (_ref) {
13938
14092
  case 22:
13939
14093
  _supplierData = _context2.sent;
13940
14094
  case 23:
13941
- onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$t(_objectSpread$t({}, _selectedSupplier), {}, {
14095
+ onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$u(_objectSpread$u({}, _selectedSupplier), {}, {
13942
14096
  supplierGuid: catalogList === null || catalogList === void 0 || (_catalogList$ = catalogList[0]) === null || _catalogList$ === void 0 ? void 0 : _catalogList$.Subfolder
13943
14097
  }), _supplierData);
13944
14098
  if (catalogId && catalogList.find(function (c) {
@@ -14156,6 +14310,165 @@ function SelectClientRelationCatalog (_ref) {
14156
14310
  });
14157
14311
  }
14158
14312
 
14313
+ var LOG$8 = getLogger('Backoffice', 'SelectSimple');
14314
+ function useSelectSimpleData (_ref) {
14315
+ var apiInterface = _ref.apiInterface,
14316
+ selectMapping = _ref.selectMapping,
14317
+ onChange = _ref.onChange,
14318
+ value = _ref.value;
14319
+ var root = useStore();
14320
+ var _useMemo = useMemo(function () {
14321
+ return {
14322
+ apiHandler: new _default$d({
14323
+ type: 'SelectSimple',
14324
+ apiInterface: apiInterface
14325
+ }, root)
14326
+ };
14327
+ }, []),
14328
+ apiHandler = _useMemo.apiHandler;
14329
+ var _useState = useState(false),
14330
+ _useState2 = _slicedToArray(_useState, 2),
14331
+ loading = _useState2[0],
14332
+ setLoading = _useState2[1];
14333
+ // used to skip the first render, because antd for some reason sets the value only on the second render
14334
+ var _useState3 = useState(true),
14335
+ _useState4 = _slicedToArray(_useState3, 2),
14336
+ skipOnRender = _useState4[0],
14337
+ setSkipOnRender = _useState4[1];
14338
+ var _useState5 = useState([]),
14339
+ _useState6 = _slicedToArray(_useState5, 2),
14340
+ options = _useState6[0],
14341
+ setOptions = _useState6[1];
14342
+ var _useState7 = useState(),
14343
+ _useState8 = _slicedToArray(_useState7, 2),
14344
+ selected = _useState8[0],
14345
+ setSelected = _useState8[1];
14346
+ var currentValue = useMemo(function () {
14347
+ if (!selected) return undefined;
14348
+ if (Array.isArray(selected)) return selected.map(function (item) {
14349
+ return item.value;
14350
+ });
14351
+ return selected.value;
14352
+ }, [selected]);
14353
+ useEffect(function () {
14354
+ if (skipOnRender) {
14355
+ setSkipOnRender(false);
14356
+ return;
14357
+ }
14358
+ if (!apiHandler.canReadList) throw Error('SelectSimple: apiInterface must have readList method');
14359
+ setLoading(true);
14360
+ apiHandler.readList().then(function (data) {
14361
+ var _data$data;
14362
+ if (_typeof((_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data[0]) == 'object' && !selectMapping) throw Error('SelectSimple: selectMapping is required when data is an object');
14363
+ var options = data.data.map(function (item) {
14364
+ return parseDataEntry(item, selectMapping);
14365
+ });
14366
+ setOptions(options);
14367
+ if (value) {
14368
+ setSelected(findByValue(value, options, selectMapping));
14369
+ }
14370
+ })["finally"](function () {
14371
+ setLoading(false);
14372
+ });
14373
+ }, [skipOnRender]);
14374
+ var onSelectionChanged = function onSelectionChanged(value, option) {
14375
+ setSelected(option);
14376
+ onChange === null || onChange === void 0 || onChange(parseReturnData(option, selectMapping));
14377
+ };
14378
+ var onClear = function onClear() {
14379
+ setSelected(undefined);
14380
+ onChange === null || onChange === void 0 || onChange(undefined);
14381
+ };
14382
+ return {
14383
+ loading: loading,
14384
+ options: options,
14385
+ value: currentValue,
14386
+ onChange: onSelectionChanged,
14387
+ onClear: onClear
14388
+ };
14389
+ }
14390
+
14391
+ /**
14392
+ * Returns the option(s) that match the given external value
14393
+ */
14394
+ function findByValue(value, options, selectMapping) {
14395
+ if (!value) return undefined;
14396
+ if (Array.isArray(value)) return value.map(function (item) {
14397
+ return findByValue(item, options, selectMapping);
14398
+ });
14399
+ // if the externalValue is value we can compare it directly, otherwise we have to parse both option.data and value with the selectMapping.value
14400
+ var option = options.find(function (option) {
14401
+ return (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? option.value == value : getCombinedValues(option.data, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.value) == getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.value);
14402
+ });
14403
+ if (!option) {
14404
+ LOG$8.debug('findByValue: option not found, add dummy option for current value', value, options);
14405
+ //TODO: if we and server side filtering, the dummy option must be handled differently
14406
+ option = {
14407
+ label: (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? value : getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label),
14408
+ value: (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? value : getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.value),
14409
+ data: value,
14410
+ isDummy: true
14411
+ };
14412
+ }
14413
+ return option;
14414
+ }
14415
+
14416
+ /**
14417
+ * Returns an option entry based on the selectMapping configuration
14418
+ */
14419
+ function parseDataEntry(item, selectMapping) {
14420
+ return {
14421
+ label: selectMapping ? getCombinedValues(item, selectMapping.label) : item,
14422
+ value: selectMapping ? getCombinedValues(item, selectMapping.value) : item,
14423
+ data: item
14424
+ };
14425
+ }
14426
+
14427
+ /**
14428
+ * Returns the data of the selected option(s) based on the selectMapping configuration
14429
+ */
14430
+ function parseReturnData(options, selectMapping) {
14431
+ if (Array.isArray(options)) return options.map(function (option) {
14432
+ return parseReturnData(option, selectMapping);
14433
+ });
14434
+ return (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? options.value : options.data;
14435
+ }
14436
+
14437
+ var _excluded$2 = ["apiInterface", "selectMapping", "onChange", "value", "search"];
14438
+ function ownKeys$t(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14439
+ function _objectSpread$t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$t(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14440
+ var SelectWrapper = function SelectWrapper(_ref) {
14441
+ var apiInterface = _ref.apiInterface,
14442
+ selectMapping = _ref.selectMapping,
14443
+ onChange = _ref.onChange,
14444
+ value = _ref.value,
14445
+ search = _ref.search,
14446
+ selectProps = _objectWithoutProperties(_ref, _excluded$2);
14447
+ var state = useSelectSimpleData({
14448
+ apiInterface: apiInterface,
14449
+ selectMapping: selectMapping,
14450
+ onChange: onChange,
14451
+ value: value,
14452
+ type: 'SelectSimple'
14453
+ });
14454
+ return /*#__PURE__*/jsx(Select$1, _objectSpread$t(_objectSpread$t({}, selectProps), {}, {
14455
+ showSearch: search,
14456
+ loading: state.loading,
14457
+ options: state.options,
14458
+ value: state.value,
14459
+ onChange: state.onChange,
14460
+ onClear: state.onClear,
14461
+ filterOption: filterOption
14462
+ }));
14463
+ };
14464
+ var SelectSimple = observer(SelectWrapper, {
14465
+ forwardRef: true
14466
+ });
14467
+ var filterOption = function filterOption(input, option) {
14468
+ var _option$label;
14469
+ return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
14470
+ };
14471
+
14159
14472
  function _createForOfIteratorHelper$c(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$c(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
14160
14473
  function _unsupportedIterableToArray$c(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$c(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$c(o, minLen); }
14161
14474
  function _arrayLikeToArray$c(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -14361,6 +14674,13 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
14361
14674
  return onErrorInternal(text, text);
14362
14675
  }
14363
14676
  }, state.selectedItemsIndex);
14677
+ case 'selectSimple':
14678
+ return /*#__PURE__*/jsx(SelectSimple, _objectSpread$s(_objectSpread$s({}, item), {}, {
14679
+ disabled: disabled,
14680
+ onChange: function onChange(value) {
14681
+ _onChange(item.name, value);
14682
+ }
14683
+ }));
14364
14684
  case 'textarea':
14365
14685
  return /*#__PURE__*/jsx(Input.TextArea, {
14366
14686
  disabled: disabled,
@@ -16048,7 +16368,7 @@ function StringCell (_ref) {
16048
16368
  width: column.width,
16049
16369
  paddingRight: 12
16050
16370
  },
16051
- children: column.translationPrefix && children[1] ? t(column.translationPrefix + '.' + children[1]) : children
16371
+ children: column.translationPrefix && typeof children[1] == 'number' ? t(column.translationPrefix + '.' + children[1]) : children
16052
16372
  })
16053
16373
  });
16054
16374
  }
@@ -21181,11 +21501,11 @@ function useCatalogEditor (id) {
21181
21501
  }));
21182
21502
  return _exportOptionTree.apply(this, arguments);
21183
21503
  }
21184
- function startImport(_x3, _x4, _x5) {
21504
+ function startImport(_x3, _x4, _x5, _x6) {
21185
21505
  return _startImport.apply(this, arguments);
21186
21506
  }
21187
21507
  function _startImport() {
21188
- _startImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileName, catalogId, deleteExistingOPVChilds) {
21508
+ _startImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileName, catalogId, deleteExistingOPVChilds, deleteDataNotExistingInExcel) {
21189
21509
  var formData;
21190
21510
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
21191
21511
  while (1) switch (_context3.prev = _context3.next) {
@@ -21195,7 +21515,8 @@ function useCatalogEditor (id) {
21195
21515
  formData.append('filename', fileName);
21196
21516
  formData.append('catalogGuid', catalogId);
21197
21517
  formData.append('deleteExistingOPVChilds', deleteExistingOPVChilds ? 'True' : 'False');
21198
- _context3.next = 7;
21518
+ formData.append('deleteDataNotExistingInExcel', deleteDataNotExistingInExcel ? 'True' : 'False');
21519
+ _context3.next = 8;
21199
21520
  return fetch("".concat(api2BaseUrl.replace('aspx', 'asmx'), "/ImportCatalogEditorExcel"), {
21200
21521
  method: 'POST',
21201
21522
  headers: {
@@ -21205,9 +21526,9 @@ function useCatalogEditor (id) {
21205
21526
  })["catch"](function (error) {
21206
21527
  return error;
21207
21528
  });
21208
- case 7:
21209
- return _context3.abrupt("return", true);
21210
21529
  case 8:
21530
+ return _context3.abrupt("return", true);
21531
+ case 9:
21211
21532
  case "end":
21212
21533
  return _context3.stop();
21213
21534
  }
@@ -21252,8 +21573,12 @@ function DragDropUpload(_ref) {
21252
21573
  setDeleteExistingOPVChilds = _useState6[1];
21253
21574
  var _useState7 = useState(false),
21254
21575
  _useState8 = _slicedToArray(_useState7, 2),
21255
- importStarted = _useState8[0],
21256
- setImportStarted = _useState8[1];
21576
+ deleteDataNotExistingInExcel = _useState8[0],
21577
+ setDeleteDataNotExistingInExcel = _useState8[1];
21578
+ var _useState9 = useState(false),
21579
+ _useState10 = _slicedToArray(_useState9, 2),
21580
+ importStarted = _useState10[0],
21581
+ setImportStarted = _useState10[1];
21257
21582
  var props = {
21258
21583
  name: 'file',
21259
21584
  multiple: false,
@@ -21297,7 +21622,7 @@ function DragDropUpload(_ref) {
21297
21622
  case 0:
21298
21623
  _context.prev = 0;
21299
21624
  _context.next = 3;
21300
- return startImport(fileName, catalogId, deleteExistingOPVChilds);
21625
+ return startImport(fileName, catalogId, deleteExistingOPVChilds, deleteDataNotExistingInExcel);
21301
21626
  case 3:
21302
21627
  result = _context.sent;
21303
21628
  if (result === true) {
@@ -21343,11 +21668,17 @@ function DragDropUpload(_ref) {
21343
21668
  children: t('backoffice.catalogeditor.classimport.acceptedfiles')
21344
21669
  })]
21345
21670
  })), /*#__PURE__*/jsx(Checkbox, {
21346
- value: deleteExistingOPVChilds,
21671
+ checked: deleteExistingOPVChilds,
21347
21672
  onChange: function onChange(e) {
21348
21673
  return setDeleteExistingOPVChilds(e.target.checked);
21349
21674
  },
21350
21675
  children: t('backoffice.catalogeditor.classexportdeleteopvchilds')
21676
+ }), /*#__PURE__*/jsx(Checkbox, {
21677
+ checked: deleteDataNotExistingInExcel,
21678
+ onChange: function onChange(e) {
21679
+ return setDeleteDataNotExistingInExcel(e.target.checked);
21680
+ },
21681
+ children: t('backoffice.catalogeditor.classexportdeletedatanotexistinginexcel')
21351
21682
  }), /*#__PURE__*/jsx(Button, {
21352
21683
  type: "primary",
21353
21684
  onClick: onClickImport,