@crystaldesign/diva-backoffice 24.1.2-beta.1 → 24.1.2-beta.11

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 +507 -177
  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',
@@ -8319,7 +8330,17 @@ function loadConfiguration(t, root, config) {
8319
8330
  }, {
8320
8331
  name: 'countryCode',
8321
8332
  label: t('backoffice.description.currentorg.items.countryCode'),
8322
- span: 2
8333
+ span: 2,
8334
+ value: {
8335
+ apiInterface: {
8336
+ read: {
8337
+ list: '/country_codes.json',
8338
+ "public": true
8339
+ }
8340
+ },
8341
+ label: "".concat(lang),
8342
+ value: 'code'
8343
+ }
8323
8344
  }, {
8324
8345
  name: 'contact',
8325
8346
  label: 'backoffice.organization.contact',
@@ -10031,9 +10052,9 @@ function loadConfiguration(t, root, config) {
10031
10052
  };
10032
10053
  }
10033
10054
 
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; }
10055
+ 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; } } }; }
10056
+ 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); }
10057
+ 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
10058
  function aplyRule(_ref) {
10038
10059
  var rules = _ref.rules,
10039
10060
  data = _ref.data,
@@ -10042,7 +10063,7 @@ function aplyRule(_ref) {
10042
10063
  //if or we start with false until the first time some result is true
10043
10064
  //if and we start with true until the frist time some result is false
10044
10065
  var result = !or;
10045
- var _iterator = _createForOfIteratorHelper$k(rules),
10066
+ var _iterator = _createForOfIteratorHelper$l(rules),
10046
10067
  _step;
10047
10068
  try {
10048
10069
  var _loop = function _loop() {
@@ -10095,7 +10116,7 @@ function aplyRules(_ref2) {
10095
10116
  rootStore = _ref2.rootStore,
10096
10117
  or = _ref2.or;
10097
10118
  if (!data || data.length == 0) return false;
10098
- var _iterator2 = _createForOfIteratorHelper$k(data),
10119
+ var _iterator2 = _createForOfIteratorHelper$l(data),
10099
10120
  _step2;
10100
10121
  try {
10101
10122
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -10438,10 +10459,10 @@ var _default$3 = /*#__PURE__*/function () {
10438
10459
  return _default;
10439
10460
  }();
10440
10461
 
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');
10462
+ 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; } } }; }
10463
+ 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); }
10464
+ 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; }
10465
+ var LOG$9 = getLogger('Backoffice', 'DownloadStore');
10445
10466
  var DownloadStore = /*#__PURE__*/function () {
10446
10467
  function DownloadStore(_rootStore) {
10447
10468
  var _this = this;
@@ -10468,7 +10489,7 @@ var DownloadStore = /*#__PURE__*/function () {
10468
10489
  _context2.next = 23;
10469
10490
  break;
10470
10491
  }
10471
- _iterator = _createForOfIteratorHelper$j(action.download);
10492
+ _iterator = _createForOfIteratorHelper$k(action.download);
10472
10493
  _context2.prev = 8;
10473
10494
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
10474
10495
  var _download$params, _ref3, _data$fileUrl;
@@ -10657,7 +10678,7 @@ var DownloadStore = /*#__PURE__*/function () {
10657
10678
  _context5.next = 4;
10658
10679
  break;
10659
10680
  }
10660
- LOG$8.debug("The organization ".concat(data._id, " has no parentType of ").concat(validTypes.join(' or ')));
10681
+ LOG$9.debug("The organization ".concat(data._id, " has no parentType of ").concat(validTypes.join(' or ')));
10661
10682
  throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer, retailer channel or association' : 'supplier or dealer'));
10662
10683
  case 4:
10663
10684
  orgData = data;
@@ -10676,7 +10697,7 @@ var DownloadStore = /*#__PURE__*/function () {
10676
10697
  _context5.next = 14;
10677
10698
  break;
10678
10699
  }
10679
- LOG$8.debug("The organization ".concat(data._id, " has no type of ").concat(validTypes.join(' or '), " nor a parent organization"));
10700
+ LOG$9.debug("The organization ".concat(data._id, " has no type of ").concat(validTypes.join(' or '), " nor a parent organization"));
10680
10701
  throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer channel or association' : 'supplier or dealer'));
10681
10702
  case 14:
10682
10703
  _context5.prev = 14;
@@ -10796,7 +10817,7 @@ var DownloadStore = /*#__PURE__*/function () {
10796
10817
  break;
10797
10818
  }
10798
10819
  promises = [];
10799
- _iterator2 = _createForOfIteratorHelper$j(props.data);
10820
+ _iterator2 = _createForOfIteratorHelper$k(props.data);
10800
10821
  _context7.prev = 3;
10801
10822
  _iterator2.s();
10802
10823
  case 5:
@@ -11024,7 +11045,7 @@ var StoreProvider = function StoreProvider(_ref) {
11024
11045
  useEffect(function () {
11025
11046
  store.dataStore.setUserData(jwt, nToken, user);
11026
11047
  store.dataStore.setOrganizationData(organization);
11027
- store.configurationStore.setConfiguration(settings, apiConfig, t);
11048
+ store.configurationStore.setConfiguration(settings, apiConfig, t, i18n.language);
11028
11049
  }, [jwt, nToken, user, organization, settings, apiConfig, i18n.language]);
11029
11050
  useEffect(function () {
11030
11051
  store.updateHandlers(handler);
@@ -11042,8 +11063,35 @@ var useStore = function useStore() {
11042
11063
  return store;
11043
11064
  };
11044
11065
 
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; }
11066
+ 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; } } }; }
11067
+ 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); }
11068
+ 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; }
11069
+ function getCombinedValues(data, pattern) {
11070
+ if (!pattern || !data) {
11071
+ return data;
11072
+ }
11073
+ var value = pattern;
11074
+ var _iterator = _createForOfIteratorHelper$j(pattern.matchAll(/\$\{(.*?)\}/g)),
11075
+ _step;
11076
+ try {
11077
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
11078
+ var _flatten$match$;
11079
+ var match = _step.value;
11080
+ value = value.replace(match[0], (_flatten$match$ = flat(data)[match[1]]) !== null && _flatten$match$ !== void 0 ? _flatten$match$ : '');
11081
+ }
11082
+ } catch (err) {
11083
+ _iterator.e(err);
11084
+ } finally {
11085
+ _iterator.f();
11086
+ }
11087
+ return value;
11088
+ }
11089
+
11090
+ 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; } } }; }
11091
+ 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); }
11092
+ 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; }
11093
+ 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; }
11094
+ 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
11095
  function useDescriptions (_ref) {
11048
11096
  var id = _ref.id;
11049
11097
  var root = useStore();
@@ -11055,39 +11103,168 @@ function useDescriptions (_ref) {
11055
11103
  }, []),
11056
11104
  apiHandler = _useMemo.apiHandler,
11057
11105
  configuration = _useMemo.configuration;
11058
- var _useState = useState({
11059
- loading: false
11060
- }),
11106
+ var _useState = useState(false),
11061
11107
  _useState2 = _slicedToArray(_useState, 2),
11062
- state = _useState2[0],
11063
- setState = _useState2[1];
11108
+ loading = _useState2[0],
11109
+ setLoading = _useState2[1];
11110
+ var _useState3 = useState({}),
11111
+ _useState4 = _slicedToArray(_useState3, 2),
11112
+ data = _useState4[0],
11113
+ setData = _useState4[1];
11114
+ var _useState5 = useState({}),
11115
+ _useState6 = _slicedToArray(_useState5, 2),
11116
+ displayData = _useState6[0],
11117
+ setDisplayData = _useState6[1];
11064
11118
  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
11119
+ setLoading(true);
11120
+ apiHandler.read(configuration.mapping).then( /*#__PURE__*/function () {
11121
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
11122
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
11123
+ while (1) switch (_context.prev = _context.next) {
11124
+ case 0:
11125
+ _context.t0 = setDisplayData;
11126
+ _context.next = 3;
11127
+ return getDisplayData(configuration.items, data, root);
11128
+ case 3:
11129
+ _context.t1 = _context.sent;
11130
+ (0, _context.t0)(_context.t1);
11131
+ setData(data);
11132
+ setLoading(false);
11133
+ case 7:
11134
+ case "end":
11135
+ return _context.stop();
11136
+ }
11137
+ }, _callee);
11072
11138
  }));
11073
- });
11139
+ return function (_x) {
11140
+ return _ref2.apply(this, arguments);
11141
+ };
11142
+ }());
11074
11143
  }, [root.dataStore.selectedOrganizationId]);
11075
- var onUpdate = function onUpdate(data) {
11076
- setState(_objectSpread$z(_objectSpread$z({}, state), {}, {
11077
- data: data
11144
+ var onUpdate = /*#__PURE__*/function () {
11145
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
11146
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
11147
+ while (1) switch (_context2.prev = _context2.next) {
11148
+ case 0:
11149
+ setData(data);
11150
+ _context2.t0 = setDisplayData;
11151
+ _context2.next = 4;
11152
+ return getDisplayData(configuration.items, data, root);
11153
+ case 4:
11154
+ _context2.t1 = _context2.sent;
11155
+ (0, _context2.t0)(_context2.t1);
11156
+ case 6:
11157
+ case "end":
11158
+ return _context2.stop();
11159
+ }
11160
+ }, _callee2);
11078
11161
  }));
11079
- };
11080
- return _objectSpread$z(_objectSpread$z({}, state), {}, {
11162
+ return function onUpdate(_x2) {
11163
+ return _ref3.apply(this, arguments);
11164
+ };
11165
+ }();
11166
+ return {
11167
+ loading: loading,
11168
+ data: data,
11169
+ displayData: displayData,
11081
11170
  configuration: configuration,
11082
11171
  onUpdate: onUpdate
11083
- });
11172
+ };
11084
11173
  }
11085
11174
 
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; }
11175
+ /**
11176
+ * Apply the display value options to the data
11177
+ */
11178
+ function getDisplayData(_x3, _x4, _x5) {
11179
+ return _getDisplayData.apply(this, arguments);
11180
+ }
11181
+ function _getDisplayData() {
11182
+ _getDisplayData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(items, data, root) {
11183
+ var displayData, _iterator, _step, _loop;
11184
+ return _regeneratorRuntime.wrap(function _callee3$(_context4) {
11185
+ while (1) switch (_context4.prev = _context4.next) {
11186
+ case 0:
11187
+ displayData = _objectSpread$A({}, data);
11188
+ _iterator = _createForOfIteratorHelper$i(items);
11189
+ _context4.prev = 2;
11190
+ _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
11191
+ var item, itemWithMappingData, apiHandler, response, mappingData;
11192
+ return _regeneratorRuntime.wrap(function _loop$(_context3) {
11193
+ while (1) switch (_context3.prev = _context3.next) {
11194
+ case 0:
11195
+ item = _step.value;
11196
+ if (!(_typeof(item.value) == 'object')) {
11197
+ _context3.next = 13;
11198
+ break;
11199
+ }
11200
+ itemWithMappingData = item;
11201
+ apiHandler = new _default$d({
11202
+ type: 'Description',
11203
+ apiInterface: item.value.apiInterface
11204
+ }, root); // Only fetch the mapping data once
11205
+ if (itemWithMappingData.mappingData) {
11206
+ _context3.next = 9;
11207
+ break;
11208
+ }
11209
+ _context3.next = 7;
11210
+ return apiHandler.readList();
11211
+ case 7:
11212
+ response = _context3.sent;
11213
+ itemWithMappingData.mappingData = response.data;
11214
+ case 9:
11215
+ mappingData = itemWithMappingData.mappingData.find(function (mappingData) {
11216
+ return mappingData[item.value.value] == displayData[item.name];
11217
+ });
11218
+ displayData[item.name] = mappingData ? mappingData[item.value.label] : displayData[item.name];
11219
+ _context3.next = 14;
11220
+ break;
11221
+ case 13:
11222
+ if (typeof item.value == 'string') {
11223
+ displayData[item.name] = getCombinedValues(displayData === null || displayData === void 0 ? void 0 : displayData[item.name], item.value);
11224
+ }
11225
+ case 14:
11226
+ case "end":
11227
+ return _context3.stop();
11228
+ }
11229
+ }, _loop);
11230
+ });
11231
+ _iterator.s();
11232
+ case 5:
11233
+ if ((_step = _iterator.n()).done) {
11234
+ _context4.next = 9;
11235
+ break;
11236
+ }
11237
+ return _context4.delegateYield(_loop(), "t0", 7);
11238
+ case 7:
11239
+ _context4.next = 5;
11240
+ break;
11241
+ case 9:
11242
+ _context4.next = 14;
11243
+ break;
11244
+ case 11:
11245
+ _context4.prev = 11;
11246
+ _context4.t1 = _context4["catch"](2);
11247
+ _iterator.e(_context4.t1);
11248
+ case 14:
11249
+ _context4.prev = 14;
11250
+ _iterator.f();
11251
+ return _context4.finish(14);
11252
+ case 17:
11253
+ return _context4.abrupt("return", displayData);
11254
+ case 18:
11255
+ case "end":
11256
+ return _context4.stop();
11257
+ }
11258
+ }, _callee3, null, [[2, 11, 14, 17]]);
11259
+ }));
11260
+ return _getDisplayData.apply(this, arguments);
11261
+ }
11262
+
11263
+ 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; }
11264
+ 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; }
11265
+ 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; } } }; }
11266
+ 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); }
11267
+ 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
11268
  function ActionButton (_ref) {
11092
11269
  var action = _ref.action,
11093
11270
  callback = _ref.callback,
@@ -11107,7 +11284,7 @@ function ActionButton (_ref) {
11107
11284
  var ButtonType = type == 'Button' ? Button : A;
11108
11285
  var disable = false;
11109
11286
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
11110
- var _iterator = _createForOfIteratorHelper$i(ruleData !== null && ruleData !== void 0 ? ruleData : data),
11287
+ var _iterator = _createForOfIteratorHelper$h(ruleData !== null && ruleData !== void 0 ? ruleData : data),
11111
11288
  _step;
11112
11289
  try {
11113
11290
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -11213,7 +11390,7 @@ function ActionButton (_ref) {
11213
11390
  _context.next = 24;
11214
11391
  break;
11215
11392
  }
11216
- _iterator2 = _createForOfIteratorHelper$i(action.switchValues);
11393
+ _iterator2 = _createForOfIteratorHelper$h(action.switchValues);
11217
11394
  try {
11218
11395
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
11219
11396
  element = _step2.value;
@@ -11225,7 +11402,7 @@ function ActionButton (_ref) {
11225
11402
  _iterator2.f();
11226
11403
  }
11227
11404
  _context.next = 23;
11228
- return apiInterface.update(_objectSpread$y(_objectSpread$y({}, data), {}, {
11405
+ return apiInterface.update(_objectSpread$z(_objectSpread$z({}, data), {}, {
11229
11406
  state: toSwitch
11230
11407
  }), data);
11231
11408
  case 23:
@@ -11253,7 +11430,7 @@ function ActionButton (_ref) {
11253
11430
  switch (action.actionType) {
11254
11431
  case 'SwitchButton':
11255
11432
  var lable;
11256
- var _iterator3 = _createForOfIteratorHelper$i(action.switchLable),
11433
+ var _iterator3 = _createForOfIteratorHelper$h(action.switchLable),
11257
11434
  _step3;
11258
11435
  try {
11259
11436
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -11325,31 +11502,7 @@ function ActionButton (_ref) {
11325
11502
  }
11326
11503
  }
11327
11504
  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;
11505
+ return /*#__PURE__*/jsx("a", _objectSpread$z({}, props));
11353
11506
  }
11354
11507
 
11355
11508
  var DescriptionWrapper = function DescriptionWrapper(_ref) {
@@ -11381,11 +11534,11 @@ var DescriptionWrapper = function DescriptionWrapper(_ref) {
11381
11534
  }),
11382
11535
  bordered: true,
11383
11536
  children: state.configuration.items.map(function (item) {
11384
- var _state$data, _state$data2;
11537
+ var _state$displayData;
11385
11538
  return /*#__PURE__*/jsx(Descriptions.Item, {
11386
11539
  label: item.label ? t(item.label, item.label) : item.name,
11387
11540
  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]
11541
+ children: (_state$displayData = state.displayData) === null || _state$displayData === void 0 ? void 0 : _state$displayData[item.name]
11389
11542
  }, item.name);
11390
11543
  })
11391
11544
  })
@@ -11396,8 +11549,8 @@ var Description = observer(DescriptionWrapper);
11396
11549
  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
11550
  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
11551
  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; }
11552
+ 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; }
11553
+ 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
11554
  function useSelectData (_ref) {
11402
11555
  var data = _ref.data,
11403
11556
  onChange = _ref.onChange,
@@ -11578,7 +11731,7 @@ function useSelectData (_ref) {
11578
11731
  setFetching(true);
11579
11732
  serverSideParams = {
11580
11733
  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]) : {});
11734
+ return _objectSpread$y(_objectSpread$y({}, filter), value !== undefined ? _defineProperty({}, field.field, [value, field.filter, true]) : {});
11582
11735
  }, {}) : {
11583
11736
  _id: [value, 'contains']
11584
11737
  },
@@ -11814,7 +11967,7 @@ function styleInject(css, ref) {
11814
11967
  var css_248z$j = ".darkmode .ant-select-selection-search-input {\n color: #fff;\n}\n";
11815
11968
  styleInject(css_248z$j);
11816
11969
 
11817
- var SelectWrapper = function SelectWrapper(_ref) {
11970
+ var SelectWrapper$1 = function SelectWrapper(_ref) {
11818
11971
  var onChange = _ref.onChange,
11819
11972
  onError = _ref.onError,
11820
11973
  value = _ref.value,
@@ -11889,7 +12042,7 @@ var SelectWrapper = function SelectWrapper(_ref) {
11889
12042
  })
11890
12043
  });
11891
12044
  };
11892
- var Select = observer(SelectWrapper, {
12045
+ var Select = observer(SelectWrapper$1, {
11893
12046
  forwardRef: true
11894
12047
  });
11895
12048
 
@@ -12076,8 +12229,8 @@ function removeEmpty(data) {
12076
12229
  return undefined;
12077
12230
  }
12078
12231
 
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; }
12232
+ 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; }
12233
+ 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
12234
  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
12235
  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
12236
  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 +12323,7 @@ function useFormData (_ref) {
12170
12323
  multipleEditingData = inboundData;
12171
12324
  }
12172
12325
  return {
12173
- loadedData: onLoadFields(_objectSpread$w({}, dt)),
12326
+ loadedData: onLoadFields(_objectSpread$x({}, dt)),
12174
12327
  multipleEditingData: multipleEditingData
12175
12328
  };
12176
12329
  }, [inboundData, selectedItemsIndex]),
@@ -12207,7 +12360,7 @@ function useFormData (_ref) {
12207
12360
  setFieldErrors = _useState14[1];
12208
12361
  useEffect(function () {
12209
12362
  var _loadedData$_id2;
12210
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12363
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12211
12364
  data: loadedData,
12212
12365
  origData: JSON.parse(JSON.stringify(inboundData !== null && inboundData !== void 0 ? inboundData : {})),
12213
12366
  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 +12455,7 @@ function useFormData (_ref) {
12302
12455
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
12303
12456
  while (1) switch (_context2.prev = _context2.next) {
12304
12457
  case 0:
12305
- newData = _objectSpread$w({}, state.data);
12458
+ newData = _objectSpread$x({}, state.data);
12306
12459
  Object.keys(values).forEach(function (k) {
12307
12460
  var _values$k$value, _values$k;
12308
12461
  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 +12467,12 @@ function useFormData (_ref) {
12314
12467
  return _context2.abrupt("return", newData);
12315
12468
  case 4:
12316
12469
  _context2.next = 6;
12317
- return setDynamicFields(_objectSpread$w({}, state.data), newData);
12470
+ return setDynamicFields(_objectSpread$x({}, state.data), newData);
12318
12471
  case 6:
12319
12472
  newData = _context2.sent;
12320
- newData = onSaveFields(_objectSpread$w({}, state.data), newData);
12473
+ newData = onSaveFields(_objectSpread$x({}, state.data), newData);
12321
12474
  newData = removeEmpty(newData);
12322
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12475
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12323
12476
  loading: true
12324
12477
  }));
12325
12478
  finalData = state.data;
@@ -12368,13 +12521,13 @@ function useFormData (_ref) {
12368
12521
  _context2.next = 38;
12369
12522
  break;
12370
12523
  }
12371
- setFieldErrors(_objectSpread$w(_objectSpread$w({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
12524
+ setFieldErrors(_objectSpread$x(_objectSpread$x({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
12372
12525
  return _context2.abrupt("return", undefined);
12373
12526
  case 38:
12374
12527
  throw _context2.t0;
12375
12528
  case 39:
12376
12529
  _context2.prev = 39;
12377
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12530
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12378
12531
  data: finalData,
12379
12532
  loading: false
12380
12533
  }));
@@ -12404,7 +12557,7 @@ function useFormData (_ref) {
12404
12557
  }
12405
12558
  var updateHiddenRequiredDisabled = function updateHiddenRequiredDisabled(data, changedFields) {
12406
12559
  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));
12560
+ var wholeData = Object.assign(_objectSpread$x({}, state.data), _objectSpread$x({}, changedFields !== null && changedFields !== void 0 ? changedFields : data));
12408
12561
  var newState = getHiddenRequredDisabled(wholeData, selectedItems);
12409
12562
  if (JSON.stringify(newState) !== JSON.stringify(hiddenRequiredDisabled)) {
12410
12563
  setHiddenRequiredDisabled(newState);
@@ -12417,12 +12570,12 @@ function useFormData (_ref) {
12417
12570
  }
12418
12571
  };
12419
12572
  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()));
12573
+ var data = d !== null && d !== void 0 ? d : Object.assign(_objectSpread$x({}, state.data), _objectSpread$x({}, state.form.getFieldsValue()));
12421
12574
  setFieldInObject(id, data, value);
12422
- var newFieldErrors = _objectSpread$w({}, fieldErrors);
12575
+ var newFieldErrors = _objectSpread$x({}, fieldErrors);
12423
12576
  delete newFieldErrors[id.toString()];
12424
12577
  setFieldErrors(newFieldErrors);
12425
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12578
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12426
12579
  data: data
12427
12580
  }));
12428
12581
  return data;
@@ -12448,12 +12601,12 @@ function useFormData (_ref) {
12448
12601
  var _value$value;
12449
12602
  if (((_value$value = value === null || value === void 0 ? void 0 : value.value) !== null && _value$value !== void 0 ? _value$value : value) === val) {
12450
12603
  if (configuration.itemSelectorReset) {
12451
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12604
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12452
12605
  data: _defineProperty({}, name, val)
12453
12606
  }));
12454
12607
  } else {
12455
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12456
- data: _objectSpread$w(_objectSpread$w({}, state.data), {}, _defineProperty({}, name, val))
12608
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12609
+ data: _objectSpread$x(_objectSpread$x({}, state.data), {}, _defineProperty({}, name, val))
12457
12610
  }));
12458
12611
  }
12459
12612
  setSelectedItemsIndex(idx);
@@ -12463,12 +12616,12 @@ function useFormData (_ref) {
12463
12616
  var val = _ref6.value;
12464
12617
  if (value === val) {
12465
12618
  if (configuration.itemSelectorReset) {
12466
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12619
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12467
12620
  data: _defineProperty({}, name, val)
12468
12621
  }));
12469
12622
  } else {
12470
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12471
- data: _objectSpread$w(_objectSpread$w({}, state.data), {}, _defineProperty({}, name, val))
12623
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12624
+ data: _objectSpread$x(_objectSpread$x({}, state.data), {}, _defineProperty({}, name, val))
12472
12625
  }));
12473
12626
  }
12474
12627
  setSelectedItemsIndex(idx);
@@ -12582,7 +12735,7 @@ function useFormData (_ref) {
12582
12735
  }));
12583
12736
  return _setDynamicFields.apply(this, arguments);
12584
12737
  }
12585
- return _objectSpread$w(_objectSpread$w({}, state), {}, {
12738
+ return _objectSpread$x(_objectSpread$x({}, state), {}, {
12586
12739
  setUsedPreset: setUsedPreset,
12587
12740
  configuration: configuration,
12588
12741
  changedFields: changedFields,
@@ -12640,8 +12793,8 @@ function getData(id, data) {
12640
12793
  }
12641
12794
  }
12642
12795
 
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; }
12796
+ 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; }
12797
+ 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
12798
  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
12799
  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
12800
  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 +12844,13 @@ var Presets = function Presets(_ref) {
12691
12844
  } finally {
12692
12845
  _iterator.f();
12693
12846
  }
12694
- var data = _objectSpread$v(_objectSpread$v({}, form.getFieldsValue(names)), {}, {
12847
+ var data = _objectSpread$w(_objectSpread$w({}, form.getFieldsValue(names)), {}, {
12695
12848
  newPresetName: newPresetName
12696
12849
  });
12697
12850
  data.dpi = parseInt(data.dpi);
12698
12851
  data.organization = root.getGlobalValue('organizationId');
12699
12852
  apiHandler.create({}, state.configuration.createPresetMapping, data);
12700
- var dt = _objectSpread$v(_objectSpread$v({}, form.getFieldsValue(names)), {}, {
12853
+ var dt = _objectSpread$w(_objectSpread$w({}, form.getFieldsValue(names)), {}, {
12701
12854
  name: newPresetName
12702
12855
  });
12703
12856
  setPresets({
@@ -13080,8 +13233,8 @@ var buttonGroup = "button-group-GYt-T";
13080
13233
  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
13234
  styleInject(css_248z$h);
13082
13235
 
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; }
13236
+ 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; }
13237
+ 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
13238
  var SubTitle = function SubTitle(_ref) {
13086
13239
  var _item$orientation, _item$buttonIds;
13087
13240
  var item = _ref.item,
@@ -13090,7 +13243,7 @@ var SubTitle = function SubTitle(_ref) {
13090
13243
  t = _useTranslation.t;
13091
13244
  return /*#__PURE__*/jsx(Divider, {
13092
13245
  orientation: (_item$orientation = item.orientation) !== null && _item$orientation !== void 0 ? _item$orientation : 'left',
13093
- style: _objectSpread$u({}, item.style),
13246
+ style: _objectSpread$v({}, item.style),
13094
13247
  children: /*#__PURE__*/jsxs("div", {
13095
13248
  className: wrapper$2,
13096
13249
  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 +13921,8 @@ var _default = /*#__PURE__*/function (_ApiHandler) {
13768
13921
  return _default;
13769
13922
  }(_default$d);
13770
13923
 
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; }
13924
+ 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; }
13925
+ 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
13926
  getLogger('Backoffice', 'SelectClientRelationCatalog');
13774
13927
  function useSelectClientRelationCatalog (_ref) {
13775
13928
  var onSelectedCatalog = _ref.onSelectedCatalog,
@@ -13938,7 +14091,7 @@ function useSelectClientRelationCatalog (_ref) {
13938
14091
  case 22:
13939
14092
  _supplierData = _context2.sent;
13940
14093
  case 23:
13941
- onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$t(_objectSpread$t({}, _selectedSupplier), {}, {
14094
+ onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$u(_objectSpread$u({}, _selectedSupplier), {}, {
13942
14095
  supplierGuid: catalogList === null || catalogList === void 0 || (_catalogList$ = catalogList[0]) === null || _catalogList$ === void 0 ? void 0 : _catalogList$.Subfolder
13943
14096
  }), _supplierData);
13944
14097
  if (catalogId && catalogList.find(function (c) {
@@ -14156,6 +14309,165 @@ function SelectClientRelationCatalog (_ref) {
14156
14309
  });
14157
14310
  }
14158
14311
 
14312
+ var LOG$8 = getLogger('Backoffice', 'SelectSimple');
14313
+ function useSelectSimpleData (_ref) {
14314
+ var apiInterface = _ref.apiInterface,
14315
+ selectMapping = _ref.selectMapping,
14316
+ onChange = _ref.onChange,
14317
+ value = _ref.value;
14318
+ var root = useStore();
14319
+ var _useMemo = useMemo(function () {
14320
+ return {
14321
+ apiHandler: new _default$d({
14322
+ type: 'SelectSimple',
14323
+ apiInterface: apiInterface
14324
+ }, root)
14325
+ };
14326
+ }, []),
14327
+ apiHandler = _useMemo.apiHandler;
14328
+ var _useState = useState(false),
14329
+ _useState2 = _slicedToArray(_useState, 2),
14330
+ loading = _useState2[0],
14331
+ setLoading = _useState2[1];
14332
+ // used to skip the first render, because antd for some reason sets the value only on the second render
14333
+ var _useState3 = useState(true),
14334
+ _useState4 = _slicedToArray(_useState3, 2),
14335
+ skipOnRender = _useState4[0],
14336
+ setSkipOnRender = _useState4[1];
14337
+ var _useState5 = useState([]),
14338
+ _useState6 = _slicedToArray(_useState5, 2),
14339
+ options = _useState6[0],
14340
+ setOptions = _useState6[1];
14341
+ var _useState7 = useState(),
14342
+ _useState8 = _slicedToArray(_useState7, 2),
14343
+ selected = _useState8[0],
14344
+ setSelected = _useState8[1];
14345
+ var currentValue = useMemo(function () {
14346
+ if (!selected) return undefined;
14347
+ if (Array.isArray(selected)) return selected.map(function (item) {
14348
+ return item.value;
14349
+ });
14350
+ return selected.value;
14351
+ }, [selected]);
14352
+ useEffect(function () {
14353
+ if (skipOnRender) {
14354
+ setSkipOnRender(false);
14355
+ return;
14356
+ }
14357
+ if (!apiHandler.canReadList) throw Error('SelectSimple: apiInterface must have readList method');
14358
+ setLoading(true);
14359
+ apiHandler.readList().then(function (data) {
14360
+ var _data$data;
14361
+ 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');
14362
+ var options = data.data.map(function (item) {
14363
+ return parseDataEntry(item, selectMapping);
14364
+ });
14365
+ setOptions(options);
14366
+ if (value) {
14367
+ setSelected(findByValue(value, options, selectMapping));
14368
+ }
14369
+ })["finally"](function () {
14370
+ setLoading(false);
14371
+ });
14372
+ }, [skipOnRender]);
14373
+ var onSelectionChanged = function onSelectionChanged(value, option) {
14374
+ setSelected(option);
14375
+ onChange === null || onChange === void 0 || onChange(parseReturnData(option, selectMapping));
14376
+ };
14377
+ var onClear = function onClear() {
14378
+ setSelected(undefined);
14379
+ onChange === null || onChange === void 0 || onChange(undefined);
14380
+ };
14381
+ return {
14382
+ loading: loading,
14383
+ options: options,
14384
+ value: currentValue,
14385
+ onChange: onSelectionChanged,
14386
+ onClear: onClear
14387
+ };
14388
+ }
14389
+
14390
+ /**
14391
+ * Returns the option(s) that match the given external value
14392
+ */
14393
+ function findByValue(value, options, selectMapping) {
14394
+ if (!value) return undefined;
14395
+ if (Array.isArray(value)) return value.map(function (item) {
14396
+ return findByValue(item, options, selectMapping);
14397
+ });
14398
+ // if the externalValue is value we can compare it directly, otherwise we have to parse both option.data and value with the selectMapping.value
14399
+ var option = options.find(function (option) {
14400
+ 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);
14401
+ });
14402
+ if (!option) {
14403
+ LOG$8.debug('findByValue: option not found, add dummy option for current value', value, options);
14404
+ //TODO: if we and server side filtering, the dummy option must be handled differently
14405
+ option = {
14406
+ label: (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? value : getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label),
14407
+ value: (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? value : getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.value),
14408
+ data: value,
14409
+ isDummy: true
14410
+ };
14411
+ }
14412
+ return option;
14413
+ }
14414
+
14415
+ /**
14416
+ * Returns an option entry based on the selectMapping configuration
14417
+ */
14418
+ function parseDataEntry(item, selectMapping) {
14419
+ return {
14420
+ label: selectMapping ? getCombinedValues(item, selectMapping.label) : item,
14421
+ value: selectMapping ? getCombinedValues(item, selectMapping.value) : item,
14422
+ data: item
14423
+ };
14424
+ }
14425
+
14426
+ /**
14427
+ * Returns the data of the selected option(s) based on the selectMapping configuration
14428
+ */
14429
+ function parseReturnData(options, selectMapping) {
14430
+ if (Array.isArray(options)) return options.map(function (option) {
14431
+ return parseReturnData(option, selectMapping);
14432
+ });
14433
+ return (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? options.value : options.data;
14434
+ }
14435
+
14436
+ var _excluded$2 = ["apiInterface", "selectMapping", "onChange", "value", "search"];
14437
+ 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; }
14438
+ 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; }
14439
+ var SelectWrapper = function SelectWrapper(_ref) {
14440
+ var apiInterface = _ref.apiInterface,
14441
+ selectMapping = _ref.selectMapping,
14442
+ onChange = _ref.onChange,
14443
+ value = _ref.value,
14444
+ search = _ref.search,
14445
+ selectProps = _objectWithoutProperties(_ref, _excluded$2);
14446
+ var state = useSelectSimpleData({
14447
+ apiInterface: apiInterface,
14448
+ selectMapping: selectMapping,
14449
+ onChange: onChange,
14450
+ value: value,
14451
+ type: 'SelectSimple'
14452
+ });
14453
+ return /*#__PURE__*/jsx(Select$1, _objectSpread$t(_objectSpread$t({}, selectProps), {}, {
14454
+ showSearch: search,
14455
+ loading: state.loading,
14456
+ options: state.options,
14457
+ value: state.value,
14458
+ onChange: state.onChange,
14459
+ onClear: state.onClear,
14460
+ filterOption: filterOption
14461
+ }));
14462
+ };
14463
+ var SelectSimple = observer(SelectWrapper, {
14464
+ forwardRef: true
14465
+ });
14466
+ var filterOption = function filterOption(input, option) {
14467
+ var _option$label;
14468
+ return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
14469
+ };
14470
+
14159
14471
  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
14472
  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
14473
  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 +14673,13 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
14361
14673
  return onErrorInternal(text, text);
14362
14674
  }
14363
14675
  }, state.selectedItemsIndex);
14676
+ case 'selectSimple':
14677
+ return /*#__PURE__*/jsx(SelectSimple, _objectSpread$s(_objectSpread$s({}, item), {}, {
14678
+ disabled: disabled,
14679
+ onChange: function onChange(value) {
14680
+ _onChange(item.name, value);
14681
+ }
14682
+ }));
14364
14683
  case 'textarea':
14365
14684
  return /*#__PURE__*/jsx(Input.TextArea, {
14366
14685
  disabled: disabled,
@@ -21181,11 +21500,11 @@ function useCatalogEditor (id) {
21181
21500
  }));
21182
21501
  return _exportOptionTree.apply(this, arguments);
21183
21502
  }
21184
- function startImport(_x3, _x4, _x5) {
21503
+ function startImport(_x3, _x4, _x5, _x6) {
21185
21504
  return _startImport.apply(this, arguments);
21186
21505
  }
21187
21506
  function _startImport() {
21188
- _startImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileName, catalogId, deleteExistingOPVChilds) {
21507
+ _startImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileName, catalogId, deleteExistingOPVChilds, deleteDataNotExistingInExcel) {
21189
21508
  var formData;
21190
21509
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
21191
21510
  while (1) switch (_context3.prev = _context3.next) {
@@ -21195,7 +21514,8 @@ function useCatalogEditor (id) {
21195
21514
  formData.append('filename', fileName);
21196
21515
  formData.append('catalogGuid', catalogId);
21197
21516
  formData.append('deleteExistingOPVChilds', deleteExistingOPVChilds ? 'True' : 'False');
21198
- _context3.next = 7;
21517
+ formData.append('deleteDataNotExistingInExcel', deleteDataNotExistingInExcel ? 'True' : 'False');
21518
+ _context3.next = 8;
21199
21519
  return fetch("".concat(api2BaseUrl.replace('aspx', 'asmx'), "/ImportCatalogEditorExcel"), {
21200
21520
  method: 'POST',
21201
21521
  headers: {
@@ -21205,9 +21525,9 @@ function useCatalogEditor (id) {
21205
21525
  })["catch"](function (error) {
21206
21526
  return error;
21207
21527
  });
21208
- case 7:
21209
- return _context3.abrupt("return", true);
21210
21528
  case 8:
21529
+ return _context3.abrupt("return", true);
21530
+ case 9:
21211
21531
  case "end":
21212
21532
  return _context3.stop();
21213
21533
  }
@@ -21252,8 +21572,12 @@ function DragDropUpload(_ref) {
21252
21572
  setDeleteExistingOPVChilds = _useState6[1];
21253
21573
  var _useState7 = useState(false),
21254
21574
  _useState8 = _slicedToArray(_useState7, 2),
21255
- importStarted = _useState8[0],
21256
- setImportStarted = _useState8[1];
21575
+ deleteDataNotExistingInExcel = _useState8[0],
21576
+ setDeleteDataNotExistingInExcel = _useState8[1];
21577
+ var _useState9 = useState(false),
21578
+ _useState10 = _slicedToArray(_useState9, 2),
21579
+ importStarted = _useState10[0],
21580
+ setImportStarted = _useState10[1];
21257
21581
  var props = {
21258
21582
  name: 'file',
21259
21583
  multiple: false,
@@ -21297,7 +21621,7 @@ function DragDropUpload(_ref) {
21297
21621
  case 0:
21298
21622
  _context.prev = 0;
21299
21623
  _context.next = 3;
21300
- return startImport(fileName, catalogId, deleteExistingOPVChilds);
21624
+ return startImport(fileName, catalogId, deleteExistingOPVChilds, deleteDataNotExistingInExcel);
21301
21625
  case 3:
21302
21626
  result = _context.sent;
21303
21627
  if (result === true) {
@@ -21343,11 +21667,17 @@ function DragDropUpload(_ref) {
21343
21667
  children: t('backoffice.catalogeditor.classimport.acceptedfiles')
21344
21668
  })]
21345
21669
  })), /*#__PURE__*/jsx(Checkbox, {
21346
- value: deleteExistingOPVChilds,
21670
+ checked: deleteExistingOPVChilds,
21347
21671
  onChange: function onChange(e) {
21348
21672
  return setDeleteExistingOPVChilds(e.target.checked);
21349
21673
  },
21350
21674
  children: t('backoffice.catalogeditor.classexportdeleteopvchilds')
21675
+ }), /*#__PURE__*/jsx(Checkbox, {
21676
+ checked: deleteDataNotExistingInExcel,
21677
+ onChange: function onChange(e) {
21678
+ return setDeleteDataNotExistingInExcel(e.target.checked);
21679
+ },
21680
+ children: t('backoffice.catalogeditor.classexportdeletedatanotexistinginexcel')
21351
21681
  }), /*#__PURE__*/jsx(Button, {
21352
21682
  type: "primary",
21353
21683
  onClick: onClickImport,