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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/build/esm/index.js +811 -235
  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/RelationSelector/types.d.ts +1 -1
  17. package/build/types/backoffice/src/ui/RelationSelector/types.d.ts.map +1 -1
  18. package/build/types/backoffice/src/ui/SelectSimple/index.d.ts +7 -0
  19. package/build/types/backoffice/src/ui/SelectSimple/index.d.ts.map +1 -0
  20. package/build/types/backoffice/src/ui/SelectSimple/types.d.ts +24 -0
  21. package/build/types/backoffice/src/ui/SelectSimple/types.d.ts.map +1 -0
  22. package/build/types/backoffice/src/ui/SelectSimple/useSelectSimpleData.d.ts +9 -0
  23. package/build/types/backoffice/src/ui/SelectSimple/useSelectSimpleData.d.ts.map +1 -0
  24. package/build/types/backoffice/src/ui/Table/BaseTable/index.d.ts.map +1 -1
  25. package/build/types/backoffice/src/ui/Table/CatalogTable/useTableData.d.ts.map +1 -1
  26. package/build/types/backoffice/src/ui/Table/StandardTable/useTableData.d.ts.map +1 -1
  27. package/build/types/backoffice/src/ui/Table/types.d.ts +8 -1
  28. package/build/types/backoffice/src/ui/Table/types.d.ts.map +1 -1
  29. package/build/types/backoffice/src/ui/Table/utils/getColumnFilterProps.d.ts.map +1 -1
  30. package/build/types/backoffice/src/utils/ApiHandler.d.ts +1 -0
  31. package/build/types/backoffice/src/utils/ApiHandler.d.ts.map +1 -1
  32. 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
  }
@@ -317,18 +317,27 @@ function parseFilter(filters, prefilter) {
317
317
  var ors = [];
318
318
  var ands = [];
319
319
  var res = '';
320
+
321
+ //parse filter so multiple filter for one field are possible. Now they are always with AND Operater related.
322
+
320
323
  Object.entries(filters).filter(function (f) {
321
324
  return f[1];
322
325
  }).map(function (filter) {
323
- var or = filter[1][2]; // [field, [value, operator, or?]]
324
- var index = or === true ? 0 : or;
325
- if (index == undefined || index === false) {
326
- ands.push(filter);
326
+ if (filter[1].length >= 4) {
327
+ for (var i = 0; i < filter[1].length; i += 2) {
328
+ ands.push([filter[0], [filter[1][i], filter[1][i + 1]]]);
329
+ }
327
330
  } else {
328
- while (ors.length <= index) {
329
- ors.push([]);
331
+ var or = filter[1][2]; // [field, [value, operator, or?]]
332
+ var index = or === true ? 0 : or;
333
+ if (index == undefined || index === false) {
334
+ ands.push(filter);
335
+ } else {
336
+ while (ors.length <= index) {
337
+ ors.push([]);
338
+ }
339
+ ors[index].push(filter);
330
340
  }
331
- ors[index].push(filter);
332
341
  }
333
342
  });
334
343
  if (ors.length) {
@@ -405,9 +414,9 @@ function getLeafColumns(columns) {
405
414
  });
406
415
  }
407
416
 
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');
417
+ 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; }
418
+ 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; }
419
+ var LOG$a = getLogger('Backoffice', 'ApiHandler');
411
420
  var jp = require('jsonpath');
412
421
  var _default$d = /*#__PURE__*/function () {
413
422
  function _default(configuration, _rootStore) {
@@ -426,6 +435,7 @@ var _default$d = /*#__PURE__*/function () {
426
435
  _defineProperty(this, "_readListUrl", void 0);
427
436
  _defineProperty(this, "_fallBackToParams", true);
428
437
  _defineProperty(this, "_readJsonPath", void 0);
438
+ _defineProperty(this, "_readPublicData", false);
429
439
  _defineProperty(this, "_filterFields", void 0);
430
440
  _defineProperty(this, "_socketUrl", void 0);
431
441
  _defineProperty(this, "_socket", undefined);
@@ -463,7 +473,7 @@ var _default$d = /*#__PURE__*/function () {
463
473
  this._readOneUrl = configuration.apiInterface.read;
464
474
  this._fallBackToParams = true;
465
475
  } else {
466
- var _configuration$apiInt10, _configuration$apiInt11, _configuration$apiInt12, _configuration$apiInt14, _configuration$apiInt15, _configuration$apiInt16;
476
+ var _configuration$apiInt10, _configuration$apiInt11, _configuration$apiInt12, _configuration$apiInt14, _configuration$apiInt15, _configuration$apiInt16, _configuration$apiInt17;
467
477
  this._readListUrl = (_configuration$apiInt10 = configuration.apiInterface.read) === null || _configuration$apiInt10 === void 0 ? void 0 : _configuration$apiInt10.list;
468
478
  this._readOneUrl = (_configuration$apiInt11 = configuration.apiInterface.read) === null || _configuration$apiInt11 === void 0 ? void 0 : _configuration$apiInt11.one;
469
479
 
@@ -485,6 +495,7 @@ var _default$d = /*#__PURE__*/function () {
485
495
  this._readJsonPath = (_configuration$apiInt14 = configuration.apiInterface.read) === null || _configuration$apiInt14 === void 0 ? void 0 : _configuration$apiInt14.jsonPath;
486
496
  this._filterFields = (_configuration$apiInt15 = configuration.apiInterface.read) === null || _configuration$apiInt15 === void 0 ? void 0 : _configuration$apiInt15.fields;
487
497
  this._fallBackToParams = !!((_configuration$apiInt16 = configuration.apiInterface.read) !== null && _configuration$apiInt16 !== void 0 && _configuration$apiInt16.fallBackToParams);
498
+ this._readPublicData = !!((_configuration$apiInt17 = configuration.apiInterface.read) !== null && _configuration$apiInt17 !== void 0 && _configuration$apiInt17["public"]);
488
499
  }
489
500
  this._socketUrl = configuration.apiInterface.socket;
490
501
  }
@@ -558,7 +569,7 @@ var _default$d = /*#__PURE__*/function () {
558
569
  _context2.next = 13;
559
570
  return fetch(finalUrl, {
560
571
  method: this._updateMethod,
561
- headers: _objectSpread$C(_objectSpread$C({}, jwt ? {
572
+ headers: _objectSpread$D(_objectSpread$D({}, jwt ? {
562
573
  Authorization: 'Bearer ' + jwt
563
574
  } : {}), {}, {
564
575
  'Content-Type': 'application/json'
@@ -649,7 +660,7 @@ var _default$d = /*#__PURE__*/function () {
649
660
  rootStore: this._rootStore,
650
661
  fallBackToParams: true
651
662
  });
652
- if (data) createData = _objectSpread$C({}, data);
663
+ if (data) createData = _objectSpread$D({}, data);
653
664
  } else if (data !== undefined) {
654
665
  createData = aplyMapping({
655
666
  mapable: data,
@@ -790,7 +801,7 @@ var _default$d = /*#__PURE__*/function () {
790
801
  _context6.next = 7;
791
802
  return fetch((_url = url) === null || _url === void 0 ? void 0 : _url.toString(), {
792
803
  method: isApi2 ? 'POST' : 'DELETE',
793
- headers: _objectSpread$C({}, jwt ? {
804
+ headers: _objectSpread$D({}, jwt ? {
794
805
  Authorization: 'Bearer ' + jwt
795
806
  } : {})
796
807
  }).then( /*#__PURE__*/function () {
@@ -906,7 +917,7 @@ var _default$d = /*#__PURE__*/function () {
906
917
  throw new Error('Read List endpoint is missing in configuration.');
907
918
  case 2:
908
919
  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), {}, {
920
+ url = filterServerSide ? parseServersideFilters(_objectSpread$D(_objectSpread$D({}, filterServerSide), {}, {
910
921
  columns: this._filterFields ? filterServerSide.columns : undefined,
911
922
  baseUrl: this._readListUrl,
912
923
  prefilter: prefilter
@@ -926,7 +937,7 @@ var _default$d = /*#__PURE__*/function () {
926
937
  });
927
938
  case 6:
928
939
  response = _context8.sent;
929
- return _context8.abrupt("return", _objectSpread$C(_objectSpread$C({}, response), {}, {
940
+ return _context8.abrupt("return", _objectSpread$D(_objectSpread$D({}, response), {}, {
930
941
  data: response.data.map(function (d) {
931
942
  return _this2.aplyJsonPath(d, _this2._readJsonPath);
932
943
  })
@@ -950,7 +961,7 @@ var _default$d = /*#__PURE__*/function () {
950
961
  throw new Error('Read List endpoint is missing in configuration.');
951
962
  }
952
963
  (_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), {}, {
964
+ var url = filterServerSide ? parseServersideFilters(_objectSpread$D(_objectSpread$D({}, filterServerSide), {}, {
954
965
  columns: this._filterFields ? filterServerSide.columns : undefined,
955
966
  baseUrl: this._readListUrl,
956
967
  prefilter: prefilter
@@ -982,9 +993,11 @@ var _default$d = /*#__PURE__*/function () {
982
993
  headers = {
983
994
  'content-type': 'application/json'
984
995
  };
985
- if (sessionGuid) headers['SessionGuid'] = sessionGuid;
986
- if (jwt) headers['Authorization'] = 'Bearer ' + jwt;
987
- _context9.next = 6;
996
+ if (!this._readPublicData) {
997
+ if (sessionGuid) headers['SessionGuid'] = sessionGuid;
998
+ if (jwt) headers['Authorization'] = 'Bearer ' + jwt;
999
+ }
1000
+ _context9.next = 5;
988
1001
  return fetch(url.toString(), {
989
1002
  headers: headers
990
1003
  }).then(function (r) {
@@ -996,10 +1009,10 @@ var _default$d = /*#__PURE__*/function () {
996
1009
  return undefined;
997
1010
  }
998
1011
  });
999
- case 6:
1012
+ case 5:
1000
1013
  response = _context9.sent;
1001
1014
  return _context9.abrupt("return", response);
1002
- case 8:
1015
+ case 7:
1003
1016
  case "end":
1004
1017
  return _context9.stop();
1005
1018
  }
@@ -1049,16 +1062,16 @@ var _default$d = /*#__PURE__*/function () {
1049
1062
  }
1050
1063
  });
1051
1064
  this._socket.on('error', function (error) {
1052
- LOG$9.error('Error on connection!', error);
1065
+ LOG$a.error('Error on connection!', error);
1053
1066
  });
1054
1067
  this._socket.on('connect_error', function (error) {
1055
- LOG$9.log("connect_error due to ".concat(error.message));
1068
+ LOG$a.log("connect_error due to ".concat(error.message));
1056
1069
  });
1057
1070
  this._socket.on('connect', function () {
1058
- LOG$9.debug('Successfully connected to socket');
1071
+ LOG$a.debug('Successfully connected to socket');
1059
1072
  });
1060
1073
  this._socket.on('disconnect', function () {
1061
- LOG$9.debug('Disconnect from socket');
1074
+ LOG$a.debug('Disconnect from socket');
1062
1075
  });
1063
1076
  return this._socket;
1064
1077
  }
@@ -1156,8 +1169,8 @@ var _default$c = /*#__PURE__*/function (_ApiHandler) {
1156
1169
  return _default;
1157
1170
  }(_default$d);
1158
1171
 
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; }
1172
+ 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; }
1173
+ 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
1174
  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
1175
  function _isNativeReflectConstruct$6() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { return !!t; })(); }
1163
1176
  var _default$b = /*#__PURE__*/function (_ApiHandler) {
@@ -1256,7 +1269,7 @@ var _default$b = /*#__PURE__*/function (_ApiHandler) {
1256
1269
  _context2.next = 5;
1257
1270
  return fetch(this._createUrl + '?ref=true', {
1258
1271
  method: this._createMethod,
1259
- headers: _objectSpread$B({}, jwt ? {
1272
+ headers: _objectSpread$C({}, jwt ? {
1260
1273
  Authorization: 'Bearer ' + jwt
1261
1274
  } : {}),
1262
1275
  body: data
@@ -1636,8 +1649,8 @@ var _default$8 = /*#__PURE__*/function (_ApiHandler) {
1636
1649
  return _default;
1637
1650
  }(_default$d);
1638
1651
 
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; }
1652
+ 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; }
1653
+ 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
1654
  var _default$7 = /*#__PURE__*/function () {
1642
1655
  function _default(root) {
1643
1656
  _classCallCheck(this, _default);
@@ -1664,7 +1677,7 @@ var _default$7 = /*#__PURE__*/function () {
1664
1677
  }
1665
1678
  if (config.type == 'Menu') {
1666
1679
  var filteredItems = filterMenuByPermission(this.root.actions.userHasPermission, config.items);
1667
- config = _objectSpread$A(_objectSpread$A({}, config), {}, {
1680
+ config = _objectSpread$B(_objectSpread$B({}, config), {}, {
1668
1681
  items: filteredItems
1669
1682
  });
1670
1683
  } else if (config.type == 'Group') {
@@ -1673,7 +1686,7 @@ var _default$7 = /*#__PURE__*/function () {
1673
1686
  var _i$permission;
1674
1687
  return !i.permission || _this.root.actions.userHasPermission((_i$permission = i.permission) === null || _i$permission === void 0 ? void 0 : _i$permission.toLocaleLowerCase());
1675
1688
  });
1676
- config = _objectSpread$A(_objectSpread$A({}, config), {}, {
1689
+ config = _objectSpread$B(_objectSpread$B({}, config), {}, {
1677
1690
  items: _filteredItems
1678
1691
  });
1679
1692
  }
@@ -1681,9 +1694,9 @@ var _default$7 = /*#__PURE__*/function () {
1681
1694
  }
1682
1695
  }, {
1683
1696
  key: "setConfiguration",
1684
- value: function setConfiguration(config, apiConfig, t) {
1697
+ value: function setConfiguration(config, apiConfig, t, lang) {
1685
1698
  this._apiConfig = apiConfig;
1686
- var configuration = loadConfiguration(t, this.root, config);
1699
+ var configuration = loadConfiguration(t, this.root, config, lang);
1687
1700
 
1688
1701
  //merge with configuration so everything can changed by config
1689
1702
  if (config.configuration) {
@@ -1744,14 +1757,14 @@ function filterMenuByPermission(hasPermission, items) {
1744
1757
  return items.filter(function (item) {
1745
1758
  return !item.permission || hasPermission(item.permission.toLocaleLowerCase());
1746
1759
  }).map(function (item) {
1747
- return _objectSpread$A(_objectSpread$A({}, item), {}, {
1760
+ return _objectSpread$B(_objectSpread$B({}, item), {}, {
1748
1761
  items: filterMenuByPermission(hasPermission, item.items)
1749
1762
  });
1750
1763
  }).filter(function (item) {
1751
1764
  return !item.items || item.items.length > 0;
1752
1765
  });
1753
1766
  }
1754
- function loadConfiguration(t, root, config) {
1767
+ function loadConfiguration(t, root, config, lang) {
1755
1768
  var _organization$setting, _organization$setting2, _organization$setting3, _organization$setting4, _parentOrganizations, _parentOrganizations2, _parentOrganizations3, _parentOrganizations4, _parentOrganizations5, _parentOrganizations6, _parentOrganizations7, _parentOrganizations8, _parentOrganizations9, _parentOrganizations10, _parentOrganizations11, _parentOrganizations12, _parentOrganizations13;
1756
1769
  var organization = toJS(root.dataStore.currentOrganization);
1757
1770
  return {
@@ -2738,62 +2751,61 @@ function loadConfiguration(t, root, config) {
2738
2751
  field: 'ArticleName',
2739
2752
  sorter: 1,
2740
2753
  filter: 'advanced',
2741
- width: 50
2754
+ width: 150
2742
2755
  }, {
2743
2756
  title: t('backoffice.table.partlists.columns.GroupName'),
2744
2757
  field: 'GroupName',
2745
2758
  sorter: 2,
2746
2759
  filter: 'advanced',
2747
- width: 150
2760
+ width: 100
2748
2761
  }, {
2749
2762
  title: t('backoffice.table.partlists.columns.ItemRefArticleCodex'),
2750
2763
  field: 'ItemRefArticleCodex',
2751
2764
  sorter: 3,
2752
2765
  filter: 'advanced',
2753
- width: 50
2766
+ width: 100
2754
2767
  }, {
2755
2768
  title: t('backoffice.table.partlists.columns.RefWidth'),
2756
2769
  field: 'RefWidth',
2757
2770
  sorter: 4,
2758
2771
  filter: 'advanced',
2759
- width: 50
2772
+ width: 60
2760
2773
  }, {
2761
2774
  title: t('backoffice.table.partlists.columns.RefHeight'),
2762
2775
  field: 'RefHeight',
2763
2776
  filter: 'advanced',
2764
2777
  sorter: 5,
2765
- width: 50
2778
+ width: 60
2766
2779
  }, {
2767
2780
  title: t('backoffice.table.partlists.columns.RefDepth'),
2768
2781
  field: 'RefDepth',
2769
2782
  sorter: 6,
2770
2783
  filter: 'advanced',
2771
- width: 50
2784
+ width: 60
2772
2785
  }, {
2773
2786
  title: t('backoffice.table.partlists.columns.GroupedFormula'),
2774
2787
  field: 'GroupedFormula',
2775
2788
  sorter: 7,
2776
- filter: 'advanced',
2777
- width: 200
2789
+ filter: 'advanced'
2778
2790
  }, {
2779
2791
  title: t('backoffice.table.partlists.columns.Formula'),
2780
2792
  field: 'Formula',
2781
2793
  sorter: 8,
2782
- filter: 'advanced',
2783
- width: 200
2794
+ filter: 'advanced'
2784
2795
  }, {
2785
2796
  title: t('backoffice.table.partlists.columns.RetailPrefix'),
2786
2797
  field: 'RetailPrefix',
2787
2798
  sorter: 9,
2788
2799
  filter: 'advanced',
2789
- width: 50
2800
+ width: 110
2790
2801
  }, {
2791
2802
  title: t('backoffice.table.partlists.columns.RetailArticleNr'),
2792
2803
  field: 'RetailArticleNr',
2793
2804
  editable: true,
2794
2805
  sorter: 9,
2795
2806
  filter: 'advanced',
2796
- width: 150
2807
+ width: 150,
2808
+ fixed: 'right'
2797
2809
  }],
2798
2810
  apiInterface: {
2799
2811
  read: {
@@ -3774,6 +3786,103 @@ function loadConfiguration(t, root, config) {
3774
3786
  }]
3775
3787
  }]
3776
3788
  },
3789
+ TableSubOrganizations: {
3790
+ title: t('backoffice.table.allsuborgs.title'),
3791
+ type: 'Table',
3792
+ canRefresh: true,
3793
+ rowKey: '_id',
3794
+ columns: [{
3795
+ title: 'ID',
3796
+ field: '_id',
3797
+ sorter: 1,
3798
+ filter: 'search',
3799
+ width: 200,
3800
+ hidden: true
3801
+ }, {
3802
+ title: t('backoffice.table.allorganizations.columns.name'),
3803
+ field: 'displayName',
3804
+ sorter: 2,
3805
+ filter: 'search',
3806
+ width: 200
3807
+ }, {
3808
+ title: t('backoffice.table.allorganizations.columns.typ'),
3809
+ field: 'type',
3810
+ sorter: 5,
3811
+ filter: 'search',
3812
+ hidden: true
3813
+ }, {
3814
+ title: t('backoffice.table.allorganizations.columns.description'),
3815
+ field: 'description',
3816
+ width: 200
3817
+ }, {
3818
+ title: t('backoffice.table.allorganizations.columns.adresse'),
3819
+ field: 'street',
3820
+ width: 200
3821
+ }, {
3822
+ title: t('backoffice.table.allorganizations.columns.zipCode'),
3823
+ field: 'zipCode',
3824
+ width: 200
3825
+ }, {
3826
+ title: t('backoffice.table.allorganizations.columns.city'),
3827
+ field: 'city',
3828
+ width: 200
3829
+ }, {
3830
+ title: t('backoffice.table.allorganizations.columns.region'),
3831
+ field: 'region',
3832
+ width: 200
3833
+ }, {
3834
+ title: t('backoffice.table.allorganizations.columns.countryCode'),
3835
+ field: 'countryCode',
3836
+ width: 200
3837
+ }, {
3838
+ title: t('backoffice.table.allorganizations.columns.phone'),
3839
+ field: 'phone',
3840
+ width: 200
3841
+ }, {
3842
+ title: t('backoffice.table.allorganizations.columns.internalid'),
3843
+ field: 'internalId',
3844
+ sorter: 2,
3845
+ filter: 'search',
3846
+ width: 200,
3847
+ hidden: true
3848
+ }, {
3849
+ field: 'parentType',
3850
+ title: 'parentType',
3851
+ hidden: true
3852
+ }, {
3853
+ title: t('backoffice.table.allorganizations.columns.created'),
3854
+ field: 'created',
3855
+ defaultSortOrder: 'descend',
3856
+ type: 'unixTimeStamp',
3857
+ sorter: 8,
3858
+ width: 150,
3859
+ filter: 'interval'
3860
+ }],
3861
+ apiInterface: {
3862
+ read: {
3863
+ list: '${authService}/v2/organizations',
3864
+ filterServerSide: true,
3865
+ fields: true
3866
+ }
3867
+ },
3868
+ mapping: {
3869
+ type: 'query',
3870
+ map: [{
3871
+ globalValue: 'organizationId',
3872
+ targetField: 'id'
3873
+ }]
3874
+ },
3875
+ filter: {
3876
+ "default": {
3877
+ globalValue: 'selectedOrganizationId',
3878
+ fields: ['parentOrganizations']
3879
+ }
3880
+ },
3881
+ downloadAction: {
3882
+ actionType: 'CsvExport',
3883
+ fileName: 'SubOrganizations'
3884
+ }
3885
+ },
3777
3886
  TableAllOrganizationUsers: {
3778
3887
  title: t('backoffice.table.allorgusers.title'),
3779
3888
  type: 'Table',
@@ -3811,6 +3920,10 @@ function loadConfiguration(t, root, config) {
3811
3920
  title: 'organizationId',
3812
3921
  field: 'organizationId',
3813
3922
  hidden: true
3923
+ }, {
3924
+ title: 'organizationsIdHirachy',
3925
+ field: 'organizationsIdHirachy',
3926
+ hidden: true
3814
3927
  }, {
3815
3928
  title: t('backoffice.table.allorgusers.organizationDisplayName'),
3816
3929
  field: 'organizationDisplayName',
@@ -3825,7 +3938,8 @@ function loadConfiguration(t, root, config) {
3825
3938
  defaultSortOrder: 'descend',
3826
3939
  type: 'unixTimeStamp',
3827
3940
  sorter: 8,
3828
- width: 150
3941
+ width: 150,
3942
+ filter: 'interval'
3829
3943
  }],
3830
3944
  filter: {
3831
3945
  toggle: {
@@ -6123,13 +6237,21 @@ function loadConfiguration(t, root, config) {
6123
6237
  }, {
6124
6238
  name: 'countryCode',
6125
6239
  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);
6240
+ type: 'selectSimple',
6241
+ apiInterface: {
6242
+ read: {
6243
+ list: '/country_codes.json',
6244
+ "public": true
6245
+ }
6128
6246
  },
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
- }
6247
+ selectMapping: {
6248
+ label: "${".concat(lang, "}"),
6249
+ value: '${code}',
6250
+ externalValue: 'value'
6251
+ },
6252
+ placeholder: t('backoffice.form.organizationdetails.items.selectCountryCode'),
6253
+ allowClear: true,
6254
+ search: true
6133
6255
  }, {
6134
6256
  name: 'contact',
6135
6257
  label: 'backoffice.organization.contact',
@@ -7732,10 +7854,11 @@ function loadConfiguration(t, root, config) {
7732
7854
  5: [10],
7733
7855
  6: [10],
7734
7856
  7: [8, 9, 10],
7735
- 8: [12, 9],
7736
- 9: [8, 2, 3, 10],
7737
- 10: [1, 2, 3],
7738
- 11: [2, 3, 10]
7857
+ 8: [12, 9, 7],
7858
+ 9: [8, 2, 3, 7, 10],
7859
+ 10: [1, 2, 3, 7],
7860
+ 11: [2, 3, 10],
7861
+ 12: [1, 2, 7]
7739
7862
  }
7740
7863
  }, {
7741
7864
  name: 'message',
@@ -8319,7 +8442,17 @@ function loadConfiguration(t, root, config) {
8319
8442
  }, {
8320
8443
  name: 'countryCode',
8321
8444
  label: t('backoffice.description.currentorg.items.countryCode'),
8322
- span: 2
8445
+ span: 2,
8446
+ value: {
8447
+ apiInterface: {
8448
+ read: {
8449
+ list: '/country_codes.json',
8450
+ "public": true
8451
+ }
8452
+ },
8453
+ label: "".concat(lang),
8454
+ value: 'code'
8455
+ }
8323
8456
  }, {
8324
8457
  name: 'contact',
8325
8458
  label: 'backoffice.organization.contact',
@@ -8374,6 +8507,9 @@ function loadConfiguration(t, root, config) {
8374
8507
  id: 'TableInvitations',
8375
8508
  type: 'Table',
8376
8509
  hide: config.hideInvitations
8510
+ }, {
8511
+ id: 'TableSubOrganizations',
8512
+ type: 'Table'
8377
8513
  }, {
8378
8514
  id: 'TableCurrentOrganizationAffilate',
8379
8515
  type: 'Table',
@@ -10031,9 +10167,9 @@ function loadConfiguration(t, root, config) {
10031
10167
  };
10032
10168
  }
10033
10169
 
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; }
10170
+ 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; } } }; }
10171
+ 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); }
10172
+ 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
10173
  function aplyRule(_ref) {
10038
10174
  var rules = _ref.rules,
10039
10175
  data = _ref.data,
@@ -10042,7 +10178,7 @@ function aplyRule(_ref) {
10042
10178
  //if or we start with false until the first time some result is true
10043
10179
  //if and we start with true until the frist time some result is false
10044
10180
  var result = !or;
10045
- var _iterator = _createForOfIteratorHelper$k(rules),
10181
+ var _iterator = _createForOfIteratorHelper$l(rules),
10046
10182
  _step;
10047
10183
  try {
10048
10184
  var _loop = function _loop() {
@@ -10095,7 +10231,7 @@ function aplyRules(_ref2) {
10095
10231
  rootStore = _ref2.rootStore,
10096
10232
  or = _ref2.or;
10097
10233
  if (!data || data.length == 0) return false;
10098
- var _iterator2 = _createForOfIteratorHelper$k(data),
10234
+ var _iterator2 = _createForOfIteratorHelper$l(data),
10099
10235
  _step2;
10100
10236
  try {
10101
10237
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -10438,10 +10574,10 @@ var _default$3 = /*#__PURE__*/function () {
10438
10574
  return _default;
10439
10575
  }();
10440
10576
 
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');
10577
+ 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; } } }; }
10578
+ 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); }
10579
+ 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; }
10580
+ var LOG$9 = getLogger('Backoffice', 'DownloadStore');
10445
10581
  var DownloadStore = /*#__PURE__*/function () {
10446
10582
  function DownloadStore(_rootStore) {
10447
10583
  var _this = this;
@@ -10468,7 +10604,7 @@ var DownloadStore = /*#__PURE__*/function () {
10468
10604
  _context2.next = 23;
10469
10605
  break;
10470
10606
  }
10471
- _iterator = _createForOfIteratorHelper$j(action.download);
10607
+ _iterator = _createForOfIteratorHelper$k(action.download);
10472
10608
  _context2.prev = 8;
10473
10609
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
10474
10610
  var _download$params, _ref3, _data$fileUrl;
@@ -10657,7 +10793,7 @@ var DownloadStore = /*#__PURE__*/function () {
10657
10793
  _context5.next = 4;
10658
10794
  break;
10659
10795
  }
10660
- LOG$8.debug("The organization ".concat(data._id, " has no parentType of ").concat(validTypes.join(' or ')));
10796
+ LOG$9.debug("The organization ".concat(data._id, " has no parentType of ").concat(validTypes.join(' or ')));
10661
10797
  throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer, retailer channel or association' : 'supplier or dealer'));
10662
10798
  case 4:
10663
10799
  orgData = data;
@@ -10676,7 +10812,7 @@ var DownloadStore = /*#__PURE__*/function () {
10676
10812
  _context5.next = 14;
10677
10813
  break;
10678
10814
  }
10679
- LOG$8.debug("The organization ".concat(data._id, " has no type of ").concat(validTypes.join(' or '), " nor a parent organization"));
10815
+ LOG$9.debug("The organization ".concat(data._id, " has no type of ").concat(validTypes.join(' or '), " nor a parent organization"));
10680
10816
  throw new Error("Current organization is no ".concat(type == 'RETAILER' ? 'retailer channel or association' : 'supplier or dealer'));
10681
10817
  case 14:
10682
10818
  _context5.prev = 14;
@@ -10796,7 +10932,7 @@ var DownloadStore = /*#__PURE__*/function () {
10796
10932
  break;
10797
10933
  }
10798
10934
  promises = [];
10799
- _iterator2 = _createForOfIteratorHelper$j(props.data);
10935
+ _iterator2 = _createForOfIteratorHelper$k(props.data);
10800
10936
  _context7.prev = 3;
10801
10937
  _iterator2.s();
10802
10938
  case 5:
@@ -11024,7 +11160,7 @@ var StoreProvider = function StoreProvider(_ref) {
11024
11160
  useEffect(function () {
11025
11161
  store.dataStore.setUserData(jwt, nToken, user);
11026
11162
  store.dataStore.setOrganizationData(organization);
11027
- store.configurationStore.setConfiguration(settings, apiConfig, t);
11163
+ store.configurationStore.setConfiguration(settings, apiConfig, t, i18n.language);
11028
11164
  }, [jwt, nToken, user, organization, settings, apiConfig, i18n.language]);
11029
11165
  useEffect(function () {
11030
11166
  store.updateHandlers(handler);
@@ -11042,8 +11178,35 @@ var useStore = function useStore() {
11042
11178
  return store;
11043
11179
  };
11044
11180
 
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; }
11181
+ 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; } } }; }
11182
+ 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); }
11183
+ 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; }
11184
+ function getCombinedValues(data, pattern) {
11185
+ if (!pattern || !data) {
11186
+ return data;
11187
+ }
11188
+ var value = pattern;
11189
+ var _iterator = _createForOfIteratorHelper$j(pattern.matchAll(/\$\{(.*?)\}/g)),
11190
+ _step;
11191
+ try {
11192
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
11193
+ var _flatten$match$;
11194
+ var match = _step.value;
11195
+ value = value.replace(match[0], (_flatten$match$ = flat(data)[match[1]]) !== null && _flatten$match$ !== void 0 ? _flatten$match$ : '');
11196
+ }
11197
+ } catch (err) {
11198
+ _iterator.e(err);
11199
+ } finally {
11200
+ _iterator.f();
11201
+ }
11202
+ return value;
11203
+ }
11204
+
11205
+ 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; } } }; }
11206
+ 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); }
11207
+ 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; }
11208
+ 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; }
11209
+ 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
11210
  function useDescriptions (_ref) {
11048
11211
  var id = _ref.id;
11049
11212
  var root = useStore();
@@ -11055,39 +11218,168 @@ function useDescriptions (_ref) {
11055
11218
  }, []),
11056
11219
  apiHandler = _useMemo.apiHandler,
11057
11220
  configuration = _useMemo.configuration;
11058
- var _useState = useState({
11059
- loading: false
11060
- }),
11221
+ var _useState = useState(false),
11061
11222
  _useState2 = _slicedToArray(_useState, 2),
11062
- state = _useState2[0],
11063
- setState = _useState2[1];
11223
+ loading = _useState2[0],
11224
+ setLoading = _useState2[1];
11225
+ var _useState3 = useState({}),
11226
+ _useState4 = _slicedToArray(_useState3, 2),
11227
+ data = _useState4[0],
11228
+ setData = _useState4[1];
11229
+ var _useState5 = useState({}),
11230
+ _useState6 = _slicedToArray(_useState5, 2),
11231
+ displayData = _useState6[0],
11232
+ setDisplayData = _useState6[1];
11064
11233
  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
11234
+ setLoading(true);
11235
+ apiHandler.read(configuration.mapping).then( /*#__PURE__*/function () {
11236
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
11237
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
11238
+ while (1) switch (_context.prev = _context.next) {
11239
+ case 0:
11240
+ _context.t0 = setDisplayData;
11241
+ _context.next = 3;
11242
+ return getDisplayData(configuration.items, data, root);
11243
+ case 3:
11244
+ _context.t1 = _context.sent;
11245
+ (0, _context.t0)(_context.t1);
11246
+ setData(data);
11247
+ setLoading(false);
11248
+ case 7:
11249
+ case "end":
11250
+ return _context.stop();
11251
+ }
11252
+ }, _callee);
11072
11253
  }));
11073
- });
11254
+ return function (_x) {
11255
+ return _ref2.apply(this, arguments);
11256
+ };
11257
+ }());
11074
11258
  }, [root.dataStore.selectedOrganizationId]);
11075
- var onUpdate = function onUpdate(data) {
11076
- setState(_objectSpread$z(_objectSpread$z({}, state), {}, {
11077
- data: data
11259
+ var onUpdate = /*#__PURE__*/function () {
11260
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
11261
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
11262
+ while (1) switch (_context2.prev = _context2.next) {
11263
+ case 0:
11264
+ setData(data);
11265
+ _context2.t0 = setDisplayData;
11266
+ _context2.next = 4;
11267
+ return getDisplayData(configuration.items, data, root);
11268
+ case 4:
11269
+ _context2.t1 = _context2.sent;
11270
+ (0, _context2.t0)(_context2.t1);
11271
+ case 6:
11272
+ case "end":
11273
+ return _context2.stop();
11274
+ }
11275
+ }, _callee2);
11078
11276
  }));
11079
- };
11080
- return _objectSpread$z(_objectSpread$z({}, state), {}, {
11277
+ return function onUpdate(_x2) {
11278
+ return _ref3.apply(this, arguments);
11279
+ };
11280
+ }();
11281
+ return {
11282
+ loading: loading,
11283
+ data: data,
11284
+ displayData: displayData,
11081
11285
  configuration: configuration,
11082
11286
  onUpdate: onUpdate
11083
- });
11287
+ };
11084
11288
  }
11085
11289
 
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; }
11290
+ /**
11291
+ * Apply the display value options to the data
11292
+ */
11293
+ function getDisplayData(_x3, _x4, _x5) {
11294
+ return _getDisplayData.apply(this, arguments);
11295
+ }
11296
+ function _getDisplayData() {
11297
+ _getDisplayData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(items, data, root) {
11298
+ var displayData, _iterator, _step, _loop;
11299
+ return _regeneratorRuntime.wrap(function _callee3$(_context4) {
11300
+ while (1) switch (_context4.prev = _context4.next) {
11301
+ case 0:
11302
+ displayData = _objectSpread$A({}, data);
11303
+ _iterator = _createForOfIteratorHelper$i(items);
11304
+ _context4.prev = 2;
11305
+ _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
11306
+ var item, itemWithMappingData, apiHandler, response, mappingData;
11307
+ return _regeneratorRuntime.wrap(function _loop$(_context3) {
11308
+ while (1) switch (_context3.prev = _context3.next) {
11309
+ case 0:
11310
+ item = _step.value;
11311
+ if (!(_typeof(item.value) == 'object')) {
11312
+ _context3.next = 13;
11313
+ break;
11314
+ }
11315
+ itemWithMappingData = item;
11316
+ apiHandler = new _default$d({
11317
+ type: 'Description',
11318
+ apiInterface: item.value.apiInterface
11319
+ }, root); // Only fetch the mapping data once
11320
+ if (itemWithMappingData.mappingData) {
11321
+ _context3.next = 9;
11322
+ break;
11323
+ }
11324
+ _context3.next = 7;
11325
+ return apiHandler.readList();
11326
+ case 7:
11327
+ response = _context3.sent;
11328
+ itemWithMappingData.mappingData = response.data;
11329
+ case 9:
11330
+ mappingData = itemWithMappingData.mappingData.find(function (mappingData) {
11331
+ return mappingData[item.value.value] == displayData[item.name];
11332
+ });
11333
+ displayData[item.name] = mappingData ? mappingData[item.value.label] : displayData[item.name];
11334
+ _context3.next = 14;
11335
+ break;
11336
+ case 13:
11337
+ if (typeof item.value == 'string') {
11338
+ displayData[item.name] = getCombinedValues(displayData === null || displayData === void 0 ? void 0 : displayData[item.name], item.value);
11339
+ }
11340
+ case 14:
11341
+ case "end":
11342
+ return _context3.stop();
11343
+ }
11344
+ }, _loop);
11345
+ });
11346
+ _iterator.s();
11347
+ case 5:
11348
+ if ((_step = _iterator.n()).done) {
11349
+ _context4.next = 9;
11350
+ break;
11351
+ }
11352
+ return _context4.delegateYield(_loop(), "t0", 7);
11353
+ case 7:
11354
+ _context4.next = 5;
11355
+ break;
11356
+ case 9:
11357
+ _context4.next = 14;
11358
+ break;
11359
+ case 11:
11360
+ _context4.prev = 11;
11361
+ _context4.t1 = _context4["catch"](2);
11362
+ _iterator.e(_context4.t1);
11363
+ case 14:
11364
+ _context4.prev = 14;
11365
+ _iterator.f();
11366
+ return _context4.finish(14);
11367
+ case 17:
11368
+ return _context4.abrupt("return", displayData);
11369
+ case 18:
11370
+ case "end":
11371
+ return _context4.stop();
11372
+ }
11373
+ }, _callee3, null, [[2, 11, 14, 17]]);
11374
+ }));
11375
+ return _getDisplayData.apply(this, arguments);
11376
+ }
11377
+
11378
+ 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; }
11379
+ 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; }
11380
+ 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; } } }; }
11381
+ 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); }
11382
+ 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
11383
  function ActionButton (_ref) {
11092
11384
  var action = _ref.action,
11093
11385
  callback = _ref.callback,
@@ -11107,7 +11399,7 @@ function ActionButton (_ref) {
11107
11399
  var ButtonType = type == 'Button' ? Button : A;
11108
11400
  var disable = false;
11109
11401
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
11110
- var _iterator = _createForOfIteratorHelper$i(ruleData !== null && ruleData !== void 0 ? ruleData : data),
11402
+ var _iterator = _createForOfIteratorHelper$h(ruleData !== null && ruleData !== void 0 ? ruleData : data),
11111
11403
  _step;
11112
11404
  try {
11113
11405
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -11213,7 +11505,7 @@ function ActionButton (_ref) {
11213
11505
  _context.next = 24;
11214
11506
  break;
11215
11507
  }
11216
- _iterator2 = _createForOfIteratorHelper$i(action.switchValues);
11508
+ _iterator2 = _createForOfIteratorHelper$h(action.switchValues);
11217
11509
  try {
11218
11510
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
11219
11511
  element = _step2.value;
@@ -11225,7 +11517,7 @@ function ActionButton (_ref) {
11225
11517
  _iterator2.f();
11226
11518
  }
11227
11519
  _context.next = 23;
11228
- return apiInterface.update(_objectSpread$y(_objectSpread$y({}, data), {}, {
11520
+ return apiInterface.update(_objectSpread$z(_objectSpread$z({}, data), {}, {
11229
11521
  state: toSwitch
11230
11522
  }), data);
11231
11523
  case 23:
@@ -11253,7 +11545,7 @@ function ActionButton (_ref) {
11253
11545
  switch (action.actionType) {
11254
11546
  case 'SwitchButton':
11255
11547
  var lable;
11256
- var _iterator3 = _createForOfIteratorHelper$i(action.switchLable),
11548
+ var _iterator3 = _createForOfIteratorHelper$h(action.switchLable),
11257
11549
  _step3;
11258
11550
  try {
11259
11551
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -11325,31 +11617,7 @@ function ActionButton (_ref) {
11325
11617
  }
11326
11618
  }
11327
11619
  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;
11620
+ return /*#__PURE__*/jsx("a", _objectSpread$z({}, props));
11353
11621
  }
11354
11622
 
11355
11623
  var DescriptionWrapper = function DescriptionWrapper(_ref) {
@@ -11381,11 +11649,11 @@ var DescriptionWrapper = function DescriptionWrapper(_ref) {
11381
11649
  }),
11382
11650
  bordered: true,
11383
11651
  children: state.configuration.items.map(function (item) {
11384
- var _state$data, _state$data2;
11652
+ var _state$displayData;
11385
11653
  return /*#__PURE__*/jsx(Descriptions.Item, {
11386
11654
  label: item.label ? t(item.label, item.label) : item.name,
11387
11655
  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]
11656
+ children: (_state$displayData = state.displayData) === null || _state$displayData === void 0 ? void 0 : _state$displayData[item.name]
11389
11657
  }, item.name);
11390
11658
  })
11391
11659
  })
@@ -11396,8 +11664,8 @@ var Description = observer(DescriptionWrapper);
11396
11664
  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
11665
  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
11666
  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; }
11667
+ 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; }
11668
+ 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
11669
  function useSelectData (_ref) {
11402
11670
  var data = _ref.data,
11403
11671
  onChange = _ref.onChange,
@@ -11578,7 +11846,7 @@ function useSelectData (_ref) {
11578
11846
  setFetching(true);
11579
11847
  serverSideParams = {
11580
11848
  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]) : {});
11849
+ return _objectSpread$y(_objectSpread$y({}, filter), value !== undefined ? _defineProperty({}, field.field, [value, field.filter, true]) : {});
11582
11850
  }, {}) : {
11583
11851
  _id: [value, 'contains']
11584
11852
  },
@@ -11814,7 +12082,7 @@ function styleInject(css, ref) {
11814
12082
  var css_248z$j = ".darkmode .ant-select-selection-search-input {\n color: #fff;\n}\n";
11815
12083
  styleInject(css_248z$j);
11816
12084
 
11817
- var SelectWrapper = function SelectWrapper(_ref) {
12085
+ var SelectWrapper$1 = function SelectWrapper(_ref) {
11818
12086
  var onChange = _ref.onChange,
11819
12087
  onError = _ref.onError,
11820
12088
  value = _ref.value,
@@ -11889,7 +12157,7 @@ var SelectWrapper = function SelectWrapper(_ref) {
11889
12157
  })
11890
12158
  });
11891
12159
  };
11892
- var Select = observer(SelectWrapper, {
12160
+ var Select = observer(SelectWrapper$1, {
11893
12161
  forwardRef: true
11894
12162
  });
11895
12163
 
@@ -12076,8 +12344,8 @@ function removeEmpty(data) {
12076
12344
  return undefined;
12077
12345
  }
12078
12346
 
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; }
12347
+ 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; }
12348
+ 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
12349
  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
12350
  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
12351
  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 +12438,7 @@ function useFormData (_ref) {
12170
12438
  multipleEditingData = inboundData;
12171
12439
  }
12172
12440
  return {
12173
- loadedData: onLoadFields(_objectSpread$w({}, dt)),
12441
+ loadedData: onLoadFields(_objectSpread$x({}, dt)),
12174
12442
  multipleEditingData: multipleEditingData
12175
12443
  };
12176
12444
  }, [inboundData, selectedItemsIndex]),
@@ -12207,7 +12475,7 @@ function useFormData (_ref) {
12207
12475
  setFieldErrors = _useState14[1];
12208
12476
  useEffect(function () {
12209
12477
  var _loadedData$_id2;
12210
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12478
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12211
12479
  data: loadedData,
12212
12480
  origData: JSON.parse(JSON.stringify(inboundData !== null && inboundData !== void 0 ? inboundData : {})),
12213
12481
  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 +12570,7 @@ function useFormData (_ref) {
12302
12570
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
12303
12571
  while (1) switch (_context2.prev = _context2.next) {
12304
12572
  case 0:
12305
- newData = _objectSpread$w({}, state.data);
12573
+ newData = _objectSpread$x({}, state.data);
12306
12574
  Object.keys(values).forEach(function (k) {
12307
12575
  var _values$k$value, _values$k;
12308
12576
  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 +12582,12 @@ function useFormData (_ref) {
12314
12582
  return _context2.abrupt("return", newData);
12315
12583
  case 4:
12316
12584
  _context2.next = 6;
12317
- return setDynamicFields(_objectSpread$w({}, state.data), newData);
12585
+ return setDynamicFields(_objectSpread$x({}, state.data), newData);
12318
12586
  case 6:
12319
12587
  newData = _context2.sent;
12320
- newData = onSaveFields(_objectSpread$w({}, state.data), newData);
12588
+ newData = onSaveFields(_objectSpread$x({}, state.data), newData);
12321
12589
  newData = removeEmpty(newData);
12322
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12590
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12323
12591
  loading: true
12324
12592
  }));
12325
12593
  finalData = state.data;
@@ -12368,13 +12636,13 @@ function useFormData (_ref) {
12368
12636
  _context2.next = 38;
12369
12637
  break;
12370
12638
  }
12371
- setFieldErrors(_objectSpread$w(_objectSpread$w({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
12639
+ setFieldErrors(_objectSpread$x(_objectSpread$x({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
12372
12640
  return _context2.abrupt("return", undefined);
12373
12641
  case 38:
12374
12642
  throw _context2.t0;
12375
12643
  case 39:
12376
12644
  _context2.prev = 39;
12377
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12645
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12378
12646
  data: finalData,
12379
12647
  loading: false
12380
12648
  }));
@@ -12404,7 +12672,7 @@ function useFormData (_ref) {
12404
12672
  }
12405
12673
  var updateHiddenRequiredDisabled = function updateHiddenRequiredDisabled(data, changedFields) {
12406
12674
  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));
12675
+ var wholeData = Object.assign(_objectSpread$x({}, state.data), _objectSpread$x({}, changedFields !== null && changedFields !== void 0 ? changedFields : data));
12408
12676
  var newState = getHiddenRequredDisabled(wholeData, selectedItems);
12409
12677
  if (JSON.stringify(newState) !== JSON.stringify(hiddenRequiredDisabled)) {
12410
12678
  setHiddenRequiredDisabled(newState);
@@ -12417,12 +12685,12 @@ function useFormData (_ref) {
12417
12685
  }
12418
12686
  };
12419
12687
  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()));
12688
+ var data = d !== null && d !== void 0 ? d : Object.assign(_objectSpread$x({}, state.data), _objectSpread$x({}, state.form.getFieldsValue()));
12421
12689
  setFieldInObject(id, data, value);
12422
- var newFieldErrors = _objectSpread$w({}, fieldErrors);
12690
+ var newFieldErrors = _objectSpread$x({}, fieldErrors);
12423
12691
  delete newFieldErrors[id.toString()];
12424
12692
  setFieldErrors(newFieldErrors);
12425
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12693
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12426
12694
  data: data
12427
12695
  }));
12428
12696
  return data;
@@ -12448,12 +12716,12 @@ function useFormData (_ref) {
12448
12716
  var _value$value;
12449
12717
  if (((_value$value = value === null || value === void 0 ? void 0 : value.value) !== null && _value$value !== void 0 ? _value$value : value) === val) {
12450
12718
  if (configuration.itemSelectorReset) {
12451
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12719
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12452
12720
  data: _defineProperty({}, name, val)
12453
12721
  }));
12454
12722
  } else {
12455
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12456
- data: _objectSpread$w(_objectSpread$w({}, state.data), {}, _defineProperty({}, name, val))
12723
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12724
+ data: _objectSpread$x(_objectSpread$x({}, state.data), {}, _defineProperty({}, name, val))
12457
12725
  }));
12458
12726
  }
12459
12727
  setSelectedItemsIndex(idx);
@@ -12463,12 +12731,12 @@ function useFormData (_ref) {
12463
12731
  var val = _ref6.value;
12464
12732
  if (value === val) {
12465
12733
  if (configuration.itemSelectorReset) {
12466
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12734
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12467
12735
  data: _defineProperty({}, name, val)
12468
12736
  }));
12469
12737
  } else {
12470
- setState(_objectSpread$w(_objectSpread$w({}, state), {}, {
12471
- data: _objectSpread$w(_objectSpread$w({}, state.data), {}, _defineProperty({}, name, val))
12738
+ setState(_objectSpread$x(_objectSpread$x({}, state), {}, {
12739
+ data: _objectSpread$x(_objectSpread$x({}, state.data), {}, _defineProperty({}, name, val))
12472
12740
  }));
12473
12741
  }
12474
12742
  setSelectedItemsIndex(idx);
@@ -12582,7 +12850,7 @@ function useFormData (_ref) {
12582
12850
  }));
12583
12851
  return _setDynamicFields.apply(this, arguments);
12584
12852
  }
12585
- return _objectSpread$w(_objectSpread$w({}, state), {}, {
12853
+ return _objectSpread$x(_objectSpread$x({}, state), {}, {
12586
12854
  setUsedPreset: setUsedPreset,
12587
12855
  configuration: configuration,
12588
12856
  changedFields: changedFields,
@@ -12640,8 +12908,8 @@ function getData(id, data) {
12640
12908
  }
12641
12909
  }
12642
12910
 
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; }
12911
+ 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; }
12912
+ 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
12913
  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
12914
  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
12915
  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 +12959,13 @@ var Presets = function Presets(_ref) {
12691
12959
  } finally {
12692
12960
  _iterator.f();
12693
12961
  }
12694
- var data = _objectSpread$v(_objectSpread$v({}, form.getFieldsValue(names)), {}, {
12962
+ var data = _objectSpread$w(_objectSpread$w({}, form.getFieldsValue(names)), {}, {
12695
12963
  newPresetName: newPresetName
12696
12964
  });
12697
12965
  data.dpi = parseInt(data.dpi);
12698
12966
  data.organization = root.getGlobalValue('organizationId');
12699
12967
  apiHandler.create({}, state.configuration.createPresetMapping, data);
12700
- var dt = _objectSpread$v(_objectSpread$v({}, form.getFieldsValue(names)), {}, {
12968
+ var dt = _objectSpread$w(_objectSpread$w({}, form.getFieldsValue(names)), {}, {
12701
12969
  name: newPresetName
12702
12970
  });
12703
12971
  setPresets({
@@ -13080,8 +13348,8 @@ var buttonGroup = "button-group-GYt-T";
13080
13348
  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
13349
  styleInject(css_248z$h);
13082
13350
 
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; }
13351
+ 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; }
13352
+ 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
13353
  var SubTitle = function SubTitle(_ref) {
13086
13354
  var _item$orientation, _item$buttonIds;
13087
13355
  var item = _ref.item,
@@ -13090,7 +13358,7 @@ var SubTitle = function SubTitle(_ref) {
13090
13358
  t = _useTranslation.t;
13091
13359
  return /*#__PURE__*/jsx(Divider, {
13092
13360
  orientation: (_item$orientation = item.orientation) !== null && _item$orientation !== void 0 ? _item$orientation : 'left',
13093
- style: _objectSpread$u({}, item.style),
13361
+ style: _objectSpread$v({}, item.style),
13094
13362
  children: /*#__PURE__*/jsxs("div", {
13095
13363
  className: wrapper$2,
13096
13364
  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 +14036,8 @@ var _default = /*#__PURE__*/function (_ApiHandler) {
13768
14036
  return _default;
13769
14037
  }(_default$d);
13770
14038
 
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; }
14039
+ 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; }
14040
+ 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
14041
  getLogger('Backoffice', 'SelectClientRelationCatalog');
13774
14042
  function useSelectClientRelationCatalog (_ref) {
13775
14043
  var onSelectedCatalog = _ref.onSelectedCatalog,
@@ -13938,7 +14206,7 @@ function useSelectClientRelationCatalog (_ref) {
13938
14206
  case 22:
13939
14207
  _supplierData = _context2.sent;
13940
14208
  case 23:
13941
- onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$t(_objectSpread$t({}, _selectedSupplier), {}, {
14209
+ onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$u(_objectSpread$u({}, _selectedSupplier), {}, {
13942
14210
  supplierGuid: catalogList === null || catalogList === void 0 || (_catalogList$ = catalogList[0]) === null || _catalogList$ === void 0 ? void 0 : _catalogList$.Subfolder
13943
14211
  }), _supplierData);
13944
14212
  if (catalogId && catalogList.find(function (c) {
@@ -14156,6 +14424,165 @@ function SelectClientRelationCatalog (_ref) {
14156
14424
  });
14157
14425
  }
14158
14426
 
14427
+ var LOG$8 = getLogger('Backoffice', 'SelectSimple');
14428
+ function useSelectSimpleData (_ref) {
14429
+ var apiInterface = _ref.apiInterface,
14430
+ selectMapping = _ref.selectMapping,
14431
+ onChange = _ref.onChange,
14432
+ value = _ref.value;
14433
+ var root = useStore();
14434
+ var _useMemo = useMemo(function () {
14435
+ return {
14436
+ apiHandler: new _default$d({
14437
+ type: 'SelectSimple',
14438
+ apiInterface: apiInterface
14439
+ }, root)
14440
+ };
14441
+ }, []),
14442
+ apiHandler = _useMemo.apiHandler;
14443
+ var _useState = useState(false),
14444
+ _useState2 = _slicedToArray(_useState, 2),
14445
+ loading = _useState2[0],
14446
+ setLoading = _useState2[1];
14447
+ // used to skip the first render, because antd for some reason sets the value only on the second render
14448
+ var _useState3 = useState(true),
14449
+ _useState4 = _slicedToArray(_useState3, 2),
14450
+ skipOnRender = _useState4[0],
14451
+ setSkipOnRender = _useState4[1];
14452
+ var _useState5 = useState([]),
14453
+ _useState6 = _slicedToArray(_useState5, 2),
14454
+ options = _useState6[0],
14455
+ setOptions = _useState6[1];
14456
+ var _useState7 = useState(),
14457
+ _useState8 = _slicedToArray(_useState7, 2),
14458
+ selected = _useState8[0],
14459
+ setSelected = _useState8[1];
14460
+ var currentValue = useMemo(function () {
14461
+ if (!selected) return undefined;
14462
+ if (Array.isArray(selected)) return selected.map(function (item) {
14463
+ return item.value;
14464
+ });
14465
+ return selected.value;
14466
+ }, [selected]);
14467
+ useEffect(function () {
14468
+ if (skipOnRender) {
14469
+ setSkipOnRender(false);
14470
+ return;
14471
+ }
14472
+ if (!apiHandler.canReadList) throw Error('SelectSimple: apiInterface must have readList method');
14473
+ setLoading(true);
14474
+ apiHandler.readList().then(function (data) {
14475
+ var _data$data;
14476
+ 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');
14477
+ var options = data.data.map(function (item) {
14478
+ return parseDataEntry(item, selectMapping);
14479
+ });
14480
+ setOptions(options);
14481
+ if (value) {
14482
+ setSelected(findByValue(value, options, selectMapping));
14483
+ }
14484
+ })["finally"](function () {
14485
+ setLoading(false);
14486
+ });
14487
+ }, [skipOnRender]);
14488
+ var onSelectionChanged = function onSelectionChanged(value, option) {
14489
+ setSelected(option);
14490
+ onChange === null || onChange === void 0 || onChange(parseReturnData(option, selectMapping));
14491
+ };
14492
+ var onClear = function onClear() {
14493
+ setSelected(undefined);
14494
+ onChange === null || onChange === void 0 || onChange(undefined);
14495
+ };
14496
+ return {
14497
+ loading: loading,
14498
+ options: options,
14499
+ value: currentValue,
14500
+ onChange: onSelectionChanged,
14501
+ onClear: onClear
14502
+ };
14503
+ }
14504
+
14505
+ /**
14506
+ * Returns the option(s) that match the given external value
14507
+ */
14508
+ function findByValue(value, options, selectMapping) {
14509
+ if (!value) return undefined;
14510
+ if (Array.isArray(value)) return value.map(function (item) {
14511
+ return findByValue(item, options, selectMapping);
14512
+ });
14513
+ // if the externalValue is value we can compare it directly, otherwise we have to parse both option.data and value with the selectMapping.value
14514
+ var option = options.find(function (option) {
14515
+ 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);
14516
+ });
14517
+ if (!option) {
14518
+ LOG$8.debug('findByValue: option not found, add dummy option for current value', value, options);
14519
+ //TODO: if we and server side filtering, the dummy option must be handled differently
14520
+ option = {
14521
+ label: (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? value : getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label),
14522
+ value: (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? value : getCombinedValues(value, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.value),
14523
+ data: value,
14524
+ isDummy: true
14525
+ };
14526
+ }
14527
+ return option;
14528
+ }
14529
+
14530
+ /**
14531
+ * Returns an option entry based on the selectMapping configuration
14532
+ */
14533
+ function parseDataEntry(item, selectMapping) {
14534
+ return {
14535
+ label: selectMapping ? getCombinedValues(item, selectMapping.label) : item,
14536
+ value: selectMapping ? getCombinedValues(item, selectMapping.value) : item,
14537
+ data: item
14538
+ };
14539
+ }
14540
+
14541
+ /**
14542
+ * Returns the data of the selected option(s) based on the selectMapping configuration
14543
+ */
14544
+ function parseReturnData(options, selectMapping) {
14545
+ if (Array.isArray(options)) return options.map(function (option) {
14546
+ return parseReturnData(option, selectMapping);
14547
+ });
14548
+ return (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? options.value : options.data;
14549
+ }
14550
+
14551
+ var _excluded$2 = ["apiInterface", "selectMapping", "onChange", "value", "search"];
14552
+ 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; }
14553
+ 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; }
14554
+ var SelectWrapper = function SelectWrapper(_ref) {
14555
+ var apiInterface = _ref.apiInterface,
14556
+ selectMapping = _ref.selectMapping,
14557
+ onChange = _ref.onChange,
14558
+ value = _ref.value,
14559
+ search = _ref.search,
14560
+ selectProps = _objectWithoutProperties(_ref, _excluded$2);
14561
+ var state = useSelectSimpleData({
14562
+ apiInterface: apiInterface,
14563
+ selectMapping: selectMapping,
14564
+ onChange: onChange,
14565
+ value: value,
14566
+ type: 'SelectSimple'
14567
+ });
14568
+ return /*#__PURE__*/jsx(Select$1, _objectSpread$t(_objectSpread$t({}, selectProps), {}, {
14569
+ showSearch: search,
14570
+ loading: state.loading,
14571
+ options: state.options,
14572
+ value: state.value,
14573
+ onChange: state.onChange,
14574
+ onClear: state.onClear,
14575
+ filterOption: filterOption
14576
+ }));
14577
+ };
14578
+ var SelectSimple = observer(SelectWrapper, {
14579
+ forwardRef: true
14580
+ });
14581
+ var filterOption = function filterOption(input, option) {
14582
+ var _option$label;
14583
+ return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
14584
+ };
14585
+
14159
14586
  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
14587
  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
14588
  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 +14788,13 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
14361
14788
  return onErrorInternal(text, text);
14362
14789
  }
14363
14790
  }, state.selectedItemsIndex);
14791
+ case 'selectSimple':
14792
+ return /*#__PURE__*/jsx(SelectSimple, _objectSpread$s(_objectSpread$s({}, item), {}, {
14793
+ disabled: disabled,
14794
+ onChange: function onChange(value) {
14795
+ _onChange(item.name, value);
14796
+ }
14797
+ }));
14364
14798
  case 'textarea':
14365
14799
  return /*#__PURE__*/jsx(Input.TextArea, {
14366
14800
  disabled: disabled,
@@ -16048,7 +16482,7 @@ function StringCell (_ref) {
16048
16482
  width: column.width,
16049
16483
  paddingRight: 12
16050
16484
  },
16051
- children: column.translationPrefix && children[1] ? t(column.translationPrefix + '.' + children[1]) : children
16485
+ children: column.translationPrefix && typeof children[1] == 'number' ? t(column.translationPrefix + '.' + children[1]) : children
16052
16486
  })
16053
16487
  });
16054
16488
  }
@@ -17808,20 +18242,42 @@ function getColumnFilterProps (_ref) {
17808
18242
  return searchProps(title, 'eq');
17809
18243
  case 'advanced':
17810
18244
  return advancedProps(title);
18245
+ case 'interval':
18246
+ return intervalProps();
17811
18247
  case undefined:
17812
18248
  return {};
17813
18249
  default:
17814
18250
  throw Error("".concat(filter, " is not a valid filter type."));
17815
18251
  }
17816
18252
  }
17817
- var advancedProps = function advancedProps(title) {
18253
+ var intervalProps = function intervalProps(title) {
17818
18254
  return {
17819
18255
  filterDropdown: function filterDropdown(_ref2) {
17820
18256
  var setSelectedKeys = _ref2.setSelectedKeys,
17821
- selectedKeys = _ref2.selectedKeys,
17822
18257
  confirm = _ref2.confirm,
17823
18258
  clearFilters = _ref2.clearFilters,
17824
18259
  visible = _ref2.visible;
18260
+ var _useState = useState({
18261
+ from: undefined,
18262
+ to: undefined
18263
+ }),
18264
+ _useState2 = _slicedToArray(_useState, 2),
18265
+ interval = _useState2[0],
18266
+ setInterval = _useState2[1];
18267
+ var _useTranslation = useTranslation(),
18268
+ t = _useTranslation.t;
18269
+ useEffect(function () {
18270
+ var newSelectedKeys = [];
18271
+ if (interval.from && !newSelectedKeys.includes(interval.from)) {
18272
+ newSelectedKeys.push(interval.from);
18273
+ newSelectedKeys.push('gte');
18274
+ }
18275
+ if (interval.to && !newSelectedKeys.includes(interval.to)) {
18276
+ newSelectedKeys.push(interval.to);
18277
+ newSelectedKeys.push('lte');
18278
+ }
18279
+ setSelectedKeys(newSelectedKeys);
18280
+ }, [interval]);
17825
18281
  var ref = useRef(null);
17826
18282
  useEffect(function () {
17827
18283
  if (visible) {
@@ -17829,6 +18285,110 @@ var advancedProps = function advancedProps(title) {
17829
18285
  (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.select();
17830
18286
  }
17831
18287
  }, [visible]);
18288
+ return /*#__PURE__*/jsx("div", {
18289
+ style: {
18290
+ padding: '8px'
18291
+ },
18292
+ children: /*#__PURE__*/jsxs(Space, {
18293
+ direction: "vertical",
18294
+ style: {
18295
+ width: '100%'
18296
+ },
18297
+ children: [/*#__PURE__*/jsxs("div", {
18298
+ style: {
18299
+ display: 'flex',
18300
+ justifyContent: 'space-between',
18301
+ alignItems: 'center',
18302
+ marginBottom: '8px'
18303
+ },
18304
+ children: [/*#__PURE__*/jsxs("span", {
18305
+ children: [t('filter.date.from'), ":"]
18306
+ }), /*#__PURE__*/jsx(DatePicker, {
18307
+ onChange: function onChange(value) {
18308
+ if (value) {
18309
+ setInterval({
18310
+ from: Math.floor(value.valueOf()),
18311
+ to: interval.to
18312
+ });
18313
+ }
18314
+ },
18315
+ style: {
18316
+ flexGrow: 1,
18317
+ marginLeft: '8px'
18318
+ }
18319
+ })]
18320
+ }), /*#__PURE__*/jsxs("div", {
18321
+ style: {
18322
+ display: 'flex',
18323
+ justifyContent: 'space-between',
18324
+ alignItems: 'center',
18325
+ marginBottom: '8px'
18326
+ },
18327
+ children: [/*#__PURE__*/jsxs("span", {
18328
+ children: [t('filter.date.to2'), ":"]
18329
+ }), /*#__PURE__*/jsx(DatePicker, {
18330
+ onChange: function onChange(value) {
18331
+ if (value) {
18332
+ setInterval({
18333
+ to: Math.floor(value.valueOf()),
18334
+ from: interval.from
18335
+ });
18336
+ }
18337
+ },
18338
+ style: {
18339
+ flexGrow: 1,
18340
+ marginLeft: '8px'
18341
+ }
18342
+ })]
18343
+ }), /*#__PURE__*/jsxs("div", {
18344
+ style: {
18345
+ display: 'flex',
18346
+ justifyContent: 'flex-end'
18347
+ },
18348
+ children: [/*#__PURE__*/jsx(Button, {
18349
+ type: "primary",
18350
+ onClick: function onClick() {
18351
+ return confirm();
18352
+ },
18353
+ icon: /*#__PURE__*/jsx(SearchOutlined, {}),
18354
+ size: "small",
18355
+ style: {
18356
+ width: '90px',
18357
+ marginRight: '8px'
18358
+ },
18359
+ children: "Filter"
18360
+ }), /*#__PURE__*/jsx(Button, {
18361
+ onClick: function onClick() {
18362
+ clearFilters === null || clearFilters === void 0 || clearFilters();
18363
+ confirm();
18364
+ },
18365
+ size: "small",
18366
+ style: {
18367
+ width: '90px'
18368
+ },
18369
+ children: "Reset"
18370
+ })]
18371
+ })]
18372
+ })
18373
+ });
18374
+ }
18375
+ };
18376
+ };
18377
+ var advancedProps = function advancedProps(title) {
18378
+ return {
18379
+ filterDropdown: function filterDropdown(_ref3) {
18380
+ var setSelectedKeys = _ref3.setSelectedKeys,
18381
+ selectedKeys = _ref3.selectedKeys,
18382
+ confirm = _ref3.confirm,
18383
+ clearFilters = _ref3.clearFilters,
18384
+ visible = _ref3.visible;
18385
+ var ref = useRef(null);
18386
+ useEffect(function () {
18387
+ if (visible) {
18388
+ var _ref$current2;
18389
+ (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.select();
18390
+ }
18391
+ }, [visible]);
17832
18392
  return /*#__PURE__*/jsx("div", {
17833
18393
  style: {
17834
18394
  padding: 8
@@ -17922,12 +18482,12 @@ var getSelectedKeysValue = function getSelectedKeysValue(value, filter) {
17922
18482
  };
17923
18483
  var searchProps = function searchProps(title, filter) {
17924
18484
  return {
17925
- filterDropdown: function filterDropdown(_ref3) {
17926
- var setSelectedKeys = _ref3.setSelectedKeys,
17927
- selectedKeys = _ref3.selectedKeys,
17928
- confirm = _ref3.confirm,
17929
- clearFilters = _ref3.clearFilters,
17930
- visible = _ref3.visible;
18485
+ filterDropdown: function filterDropdown(_ref4) {
18486
+ var setSelectedKeys = _ref4.setSelectedKeys,
18487
+ selectedKeys = _ref4.selectedKeys,
18488
+ confirm = _ref4.confirm,
18489
+ clearFilters = _ref4.clearFilters,
18490
+ visible = _ref4.visible;
17931
18491
  var ref = useRef(null);
17932
18492
  useEffect(function () {
17933
18493
  if (visible) {
@@ -17991,19 +18551,19 @@ var searchProps = function searchProps(title, filter) {
17991
18551
  };
17992
18552
  var selectProps = function selectProps(title, filter) {
17993
18553
  return {
17994
- filterDropdown: function filterDropdown(_ref4) {
17995
- var setSelectedKeys = _ref4.setSelectedKeys,
17996
- selectedKeys = _ref4.selectedKeys,
17997
- confirm = _ref4.confirm,
17998
- clearFilters = _ref4.clearFilters,
17999
- visible = _ref4.visible;
18000
- var _useTranslation = useTranslation(),
18001
- t = _useTranslation.t;
18554
+ filterDropdown: function filterDropdown(_ref5) {
18555
+ var setSelectedKeys = _ref5.setSelectedKeys,
18556
+ selectedKeys = _ref5.selectedKeys,
18557
+ confirm = _ref5.confirm,
18558
+ clearFilters = _ref5.clearFilters,
18559
+ visible = _ref5.visible;
18560
+ var _useTranslation2 = useTranslation(),
18561
+ t = _useTranslation2.t;
18002
18562
  var ref = useRef(null);
18003
18563
  useEffect(function () {
18004
18564
  if (visible) {
18005
- var _ref$current2;
18006
- (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.select();
18565
+ var _ref$current3;
18566
+ (_ref$current3 = ref.current) === null || _ref$current3 === void 0 || _ref$current3.select();
18007
18567
  }
18008
18568
  }, [visible]);
18009
18569
  return /*#__PURE__*/jsx("div", {
@@ -18673,7 +19233,7 @@ function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
18673
19233
  function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18674
19234
  var LOG$3 = getLogger('Backoffice', 'TableData');
18675
19235
  function useTableData (_ref) {
18676
- var _configuration$filter, _configuration$filter2, _configuration$filter3, _configuration$bulkAc, _configuration$apiInt;
19236
+ var _configuration$filter, _configuration$filter2, _configuration$filter3, _configuration$filter4, _configuration$bulkAc, _configuration$apiInt;
18677
19237
  var id = _ref.id,
18678
19238
  i18n = _ref.i18n,
18679
19239
  parentData = _ref.parentData,
@@ -18708,9 +19268,14 @@ function useTableData (_ref) {
18708
19268
  toggleConfig === null || toggleConfig === void 0 || toggleConfig.fields.forEach(function (f) {
18709
19269
  return toggleFilter[f] = [toggleConfig.globalValue ? root.getGlobalValue(toggleConfig.globalValue) : true, 'eq', 1];
18710
19270
  });
19271
+ var defaultFilter = {};
19272
+ (_configuration$filter2 = configuration.filter) === null || _configuration$filter2 === void 0 || (_configuration$filter2 = _configuration$filter2["default"]) === null || _configuration$filter2 === void 0 || _configuration$filter2.fields.forEach(function (f) {
19273
+ return defaultFilter[f] = [configuration.filter["default"].globalValue ? root.getGlobalValue(configuration.filter["default"].globalValue) : true, 'eq'];
19274
+ });
18711
19275
  var _useState9 = useState({
18712
- select: (_configuration$filter2 = configuration.filter) !== null && _configuration$filter2 !== void 0 && _configuration$filter2.select && ((_configuration$filter3 = configuration.filter) === null || _configuration$filter3 === void 0 ? void 0 : _configuration$filter3.select.applyDefaultValue) !== false ? _defineProperty({}, configuration.filter.select.filterField, [configuration.filter.select.defaultValue, 'eq']) : undefined,
18713
- toggle: toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.defaultChecked && !(toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.inverted) || !(toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.defaultChecked) && toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.inverted ? toggleFilter : undefined
19276
+ select: (_configuration$filter3 = configuration.filter) !== null && _configuration$filter3 !== void 0 && _configuration$filter3.select && ((_configuration$filter4 = configuration.filter) === null || _configuration$filter4 === void 0 ? void 0 : _configuration$filter4.select.applyDefaultValue) !== false ? _defineProperty({}, configuration.filter.select.filterField, [configuration.filter.select.defaultValue, 'eq']) : undefined,
19277
+ toggle: toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.defaultChecked && !(toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.inverted) || !(toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.defaultChecked) && toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.inverted ? toggleFilter : undefined,
19278
+ "default": defaultFilter ? defaultFilter : undefined
18714
19279
  }),
18715
19280
  _useState10 = _slicedToArray(_useState9, 2),
18716
19281
  globalFilter = _useState10[0],
@@ -18794,8 +19359,8 @@ function useTableData (_ref) {
18794
19359
  for (var i = 0; i < dataArray.length; i++) {
18795
19360
  var dataRow = dataArray[i];
18796
19361
  if (filterServerSide) {
18797
- var _configuration$filter4;
18798
- if ((_configuration$filter4 = configuration.filter) !== null && _configuration$filter4 !== void 0 && (_configuration$filter4 = _configuration$filter4.select) !== null && _configuration$filter4 !== void 0 && _configuration$filter4.filterField) {
19362
+ var _configuration$filter5;
19363
+ if ((_configuration$filter5 = configuration.filter) !== null && _configuration$filter5 !== void 0 && (_configuration$filter5 = _configuration$filter5.select) !== null && _configuration$filter5 !== void 0 && _configuration$filter5.filterField) {
18799
19364
  onGlobalFilterSelect(dataRow[configuration.filter.select.filterField]);
18800
19365
  } else {
18801
19366
  var _pagination;
@@ -18811,15 +19376,15 @@ function useTableData (_ref) {
18811
19376
  });
18812
19377
  }
18813
19378
  } else {
18814
- var _configuration$filter5, _configuration$filter6;
19379
+ var _configuration$filter6, _configuration$filter7;
18815
19380
  var _updateData2 = updateData({
18816
19381
  data: newInitData,
18817
19382
  dataRow: dataRow
18818
19383
  }),
18819
19384
  nextInitData = _updateData2.data;
18820
19385
  var _aplyFilterAndSortati = aplyFilterAndSortation(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData), {}, {
18821
- filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter5 = configuration.filter) !== null && _configuration$filter5 !== void 0 && (_configuration$filter5 = _configuration$filter5.toggle) !== null && _configuration$filter5 !== void 0 && _configuration$filter5.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp)
18822
- }, configuration !== null && configuration !== void 0 && (_configuration$filter6 = configuration.filter) !== null && _configuration$filter6 !== void 0 && (_configuration$filter6 = _configuration$filter6.toggle) !== null && _configuration$filter6 !== void 0 && _configuration$filter6.inQuery ? {
19386
+ filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter6 = configuration.filter) !== null && _configuration$filter6 !== void 0 && (_configuration$filter6 = _configuration$filter6.toggle) !== null && _configuration$filter6 !== void 0 && _configuration$filter6.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"])
19387
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter7 = configuration.filter) !== null && _configuration$filter7 !== void 0 && (_configuration$filter7 = _configuration$filter7.toggle) !== null && _configuration$filter7 !== void 0 && _configuration$filter7.inQuery ? {
18823
19388
  genericProps: globalFilter.toggle
18824
19389
  } : undefined), {}, {
18825
19390
  data: nextInitData,
@@ -18906,7 +19471,7 @@ function useTableData (_ref) {
18906
19471
  }, [configuration.title, parentData]);
18907
19472
  var onChange = /*#__PURE__*/function () {
18908
19473
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(p) {
18909
- var _configuration$filter7;
19474
+ var _configuration$filter8;
18910
19475
  var prefilter,
18911
19476
  refresh,
18912
19477
  currentData,
@@ -18914,7 +19479,7 @@ function useTableData (_ref) {
18914
19479
  currentFilterHash,
18915
19480
  currentPagination,
18916
19481
  currentUrl,
18917
- _configuration$filter8,
19482
+ _configuration$filter9,
18918
19483
  ssf,
18919
19484
  data,
18920
19485
  _data3,
@@ -18931,7 +19496,7 @@ function useTableData (_ref) {
18931
19496
  loading: true
18932
19497
  }));
18933
19498
  currentData = initData;
18934
- filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter7 = configuration.filter) !== null && _configuration$filter7 !== void 0 && (_configuration$filter7 = _configuration$filter7.toggle) !== null && _configuration$filter7 !== void 0 && _configuration$filter7.inQuery) ? prefilter.toggle : undefined), prefilter.select), prefilter.timeStamp); //remove all null values
19499
+ filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter8 = configuration.filter) !== null && _configuration$filter8 !== void 0 && (_configuration$filter8 = _configuration$filter8.toggle) !== null && _configuration$filter8 !== void 0 && _configuration$filter8.inQuery) ? prefilter.toggle : undefined), prefilter.select), prefilter.timeStamp), prefilter["default"]); //remove all null values
18935
19500
  filterData = Object.fromEntries(Object.entries(filterData).filter(function (_ref5) {
18936
19501
  var _ref6 = _slicedToArray(_ref5, 2);
18937
19502
  _ref6[0];
@@ -18952,7 +19517,7 @@ function useTableData (_ref) {
18952
19517
  columns: configuration.columns,
18953
19518
  filters: filterData,
18954
19519
  sorter: p.sorter
18955
- }, configuration !== null && configuration !== void 0 && (_configuration$filter8 = configuration.filter) !== null && _configuration$filter8 !== void 0 && (_configuration$filter8 = _configuration$filter8.toggle) !== null && _configuration$filter8 !== void 0 && _configuration$filter8.inQuery ? {
19520
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter9 = configuration.filter) !== null && _configuration$filter9 !== void 0 && (_configuration$filter9 = _configuration$filter9.toggle) !== null && _configuration$filter9 !== void 0 && _configuration$filter9.inQuery ? {
18956
19521
  genericProps: prefilter.toggle
18957
19522
  } : undefined);
18958
19523
  _context2.next = 13;
@@ -19018,7 +19583,7 @@ function useTableData (_ref) {
19018
19583
  var onDelete = /*#__PURE__*/function () {
19019
19584
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
19020
19585
  var _configuration$apiInt2;
19021
- var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$filter9, _configuration$filter10, data;
19586
+ var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$filter10, _configuration$filter11, data;
19022
19587
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
19023
19588
  while (1) switch (_context4.prev = _context4.next) {
19024
19589
  case 0:
@@ -19033,7 +19598,7 @@ function useTableData (_ref) {
19033
19598
  case 6:
19034
19599
  userPermissions = _context4.sent;
19035
19600
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(index) {
19036
- var _configuration$rowKey, _configuration$filter11, _configuration$filter12;
19601
+ var _configuration$rowKey, _configuration$filter12, _configuration$filter13;
19037
19602
  var id, _newData$filter, _newData$filter2, mapToggle, _iterator, _step, _globalFilter$toggle, field, _globalFilter$toggle2, _configuration$delete, _configuration$onErro, _configuration$onErro2, deletedIndex, initDeletedIndex;
19038
19603
  return _regeneratorRuntime.wrap(function _loop$(_context3) {
19039
19604
  while (1) switch (_context3.prev = _context3.next) {
@@ -19049,7 +19614,7 @@ function useTableData (_ref) {
19049
19614
  })) === null || _newData$filter2 === void 0 ? void 0 : _newData$filter2[0];
19050
19615
  }
19051
19616
  mapToggle = {};
19052
- _iterator = _createForOfIteratorHelper$7((_configuration$filter11 = (_configuration$filter12 = configuration.filter) === null || _configuration$filter12 === void 0 || (_configuration$filter12 = _configuration$filter12.toggle) === null || _configuration$filter12 === void 0 ? void 0 : _configuration$filter12.fields) !== null && _configuration$filter11 !== void 0 ? _configuration$filter11 : []);
19617
+ _iterator = _createForOfIteratorHelper$7((_configuration$filter12 = (_configuration$filter13 = configuration.filter) === null || _configuration$filter13 === void 0 || (_configuration$filter13 = _configuration$filter13.toggle) === null || _configuration$filter13 === void 0 ? void 0 : _configuration$filter13.fields) !== null && _configuration$filter12 !== void 0 ? _configuration$filter12 : []);
19053
19618
  try {
19054
19619
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
19055
19620
  field = _step.value;
@@ -19158,9 +19723,9 @@ function useTableData (_ref) {
19158
19723
  current: current
19159
19724
  }),
19160
19725
  columns: configuration.columns,
19161
- filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter9 = configuration.filter) !== null && _configuration$filter9 !== void 0 && (_configuration$filter9 = _configuration$filter9.toggle) !== null && _configuration$filter9 !== void 0 && _configuration$filter9.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp),
19726
+ filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter10 = configuration.filter) !== null && _configuration$filter10 !== void 0 && (_configuration$filter10 = _configuration$filter10.toggle) !== null && _configuration$filter10 !== void 0 && _configuration$filter10.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"]),
19162
19727
  sorter: filterData.sorter
19163
- }, configuration !== null && configuration !== void 0 && (_configuration$filter10 = configuration.filter) !== null && _configuration$filter10 !== void 0 && (_configuration$filter10 = _configuration$filter10.toggle) !== null && _configuration$filter10 !== void 0 && _configuration$filter10.inQuery ? {
19728
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter11 = configuration.filter) !== null && _configuration$filter11 !== void 0 && (_configuration$filter11 = _configuration$filter11.toggle) !== null && _configuration$filter11 !== void 0 && _configuration$filter11.inQuery ? {
19164
19729
  genericProps: globalFilter.toggle
19165
19730
  } : undefined));
19166
19731
  case 25:
@@ -19189,8 +19754,8 @@ function useTableData (_ref) {
19189
19754
  };
19190
19755
  }();
19191
19756
  var onGlobalFilterSelect = function onGlobalFilterSelect(value) {
19192
- var _configuration$filter13;
19193
- if (!((_configuration$filter13 = configuration.filter) !== null && _configuration$filter13 !== void 0 && _configuration$filter13.select)) {
19757
+ var _configuration$filter14;
19758
+ if (!((_configuration$filter14 = configuration.filter) !== null && _configuration$filter14 !== void 0 && _configuration$filter14.select)) {
19194
19759
  LOG$3.error('No global select filter defiend');
19195
19760
  return;
19196
19761
  }
@@ -19206,8 +19771,8 @@ function useTableData (_ref) {
19206
19771
  }, filterData), newGlobalFilter);
19207
19772
  };
19208
19773
  var onGlobalFilterToggle = function onGlobalFilterToggle() {
19209
- var _configuration$filter14;
19210
- if (!((_configuration$filter14 = configuration.filter) !== null && _configuration$filter14 !== void 0 && _configuration$filter14.toggle)) {
19774
+ var _configuration$filter15;
19775
+ if (!((_configuration$filter15 = configuration.filter) !== null && _configuration$filter15 !== void 0 && _configuration$filter15.toggle)) {
19211
19776
  LOG$3.error('No global toggle filter defiend');
19212
19777
  return;
19213
19778
  }
@@ -19224,8 +19789,8 @@ function useTableData (_ref) {
19224
19789
  }, filterData), newGlobalFilter);
19225
19790
  };
19226
19791
  var onGlobalFilterSearch = function onGlobalFilterSearch(value) {
19227
- var _configuration$filter15;
19228
- if (!((_configuration$filter15 = configuration.filter) !== null && _configuration$filter15 !== void 0 && _configuration$filter15.search)) {
19792
+ var _configuration$filter16;
19793
+ if (!((_configuration$filter16 = configuration.filter) !== null && _configuration$filter16 !== void 0 && _configuration$filter16.search)) {
19229
19794
  LOG$3.error('No global search filter defiend');
19230
19795
  return;
19231
19796
  }
@@ -19233,8 +19798,8 @@ function useTableData (_ref) {
19233
19798
  search: {}
19234
19799
  });
19235
19800
  if (value) {
19236
- var _configuration$filter16;
19237
- (_configuration$filter16 = configuration.filter) === null || _configuration$filter16 === void 0 || _configuration$filter16.search.fields.forEach(function (f) {
19801
+ var _configuration$filter17;
19802
+ (_configuration$filter17 = configuration.filter) === null || _configuration$filter17 === void 0 || _configuration$filter17.search.fields.forEach(function (f) {
19238
19803
  if (typeof f == 'string') {
19239
19804
  newGlobalFilter.search[f] = [value, 'contains', 0];
19240
19805
  } else {
@@ -19248,8 +19813,8 @@ function useTableData (_ref) {
19248
19813
  }, filterData), newGlobalFilter);
19249
19814
  };
19250
19815
  var onGlobalFilterPeriod = function onGlobalFilterPeriod(from, to) {
19251
- var _configuration$filter17;
19252
- if (!((_configuration$filter17 = configuration.filter) !== null && _configuration$filter17 !== void 0 && _configuration$filter17.period)) {
19816
+ var _configuration$filter18;
19817
+ if (!((_configuration$filter18 = configuration.filter) !== null && _configuration$filter18 !== void 0 && _configuration$filter18.period)) {
19253
19818
  LOG$3.error('No global period filter defiend');
19254
19819
  return;
19255
19820
  }
@@ -21181,11 +21746,11 @@ function useCatalogEditor (id) {
21181
21746
  }));
21182
21747
  return _exportOptionTree.apply(this, arguments);
21183
21748
  }
21184
- function startImport(_x3, _x4, _x5) {
21749
+ function startImport(_x3, _x4, _x5, _x6) {
21185
21750
  return _startImport.apply(this, arguments);
21186
21751
  }
21187
21752
  function _startImport() {
21188
- _startImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileName, catalogId, deleteExistingOPVChilds) {
21753
+ _startImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileName, catalogId, deleteExistingOPVChilds, deleteDataNotExistingInExcel) {
21189
21754
  var formData;
21190
21755
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
21191
21756
  while (1) switch (_context3.prev = _context3.next) {
@@ -21195,7 +21760,8 @@ function useCatalogEditor (id) {
21195
21760
  formData.append('filename', fileName);
21196
21761
  formData.append('catalogGuid', catalogId);
21197
21762
  formData.append('deleteExistingOPVChilds', deleteExistingOPVChilds ? 'True' : 'False');
21198
- _context3.next = 7;
21763
+ formData.append('deleteDataNotExistingInExcel', deleteDataNotExistingInExcel ? 'True' : 'False');
21764
+ _context3.next = 8;
21199
21765
  return fetch("".concat(api2BaseUrl.replace('aspx', 'asmx'), "/ImportCatalogEditorExcel"), {
21200
21766
  method: 'POST',
21201
21767
  headers: {
@@ -21205,9 +21771,9 @@ function useCatalogEditor (id) {
21205
21771
  })["catch"](function (error) {
21206
21772
  return error;
21207
21773
  });
21208
- case 7:
21209
- return _context3.abrupt("return", true);
21210
21774
  case 8:
21775
+ return _context3.abrupt("return", true);
21776
+ case 9:
21211
21777
  case "end":
21212
21778
  return _context3.stop();
21213
21779
  }
@@ -21252,8 +21818,12 @@ function DragDropUpload(_ref) {
21252
21818
  setDeleteExistingOPVChilds = _useState6[1];
21253
21819
  var _useState7 = useState(false),
21254
21820
  _useState8 = _slicedToArray(_useState7, 2),
21255
- importStarted = _useState8[0],
21256
- setImportStarted = _useState8[1];
21821
+ deleteDataNotExistingInExcel = _useState8[0],
21822
+ setDeleteDataNotExistingInExcel = _useState8[1];
21823
+ var _useState9 = useState(false),
21824
+ _useState10 = _slicedToArray(_useState9, 2),
21825
+ importStarted = _useState10[0],
21826
+ setImportStarted = _useState10[1];
21257
21827
  var props = {
21258
21828
  name: 'file',
21259
21829
  multiple: false,
@@ -21297,7 +21867,7 @@ function DragDropUpload(_ref) {
21297
21867
  case 0:
21298
21868
  _context.prev = 0;
21299
21869
  _context.next = 3;
21300
- return startImport(fileName, catalogId, deleteExistingOPVChilds);
21870
+ return startImport(fileName, catalogId, deleteExistingOPVChilds, deleteDataNotExistingInExcel);
21301
21871
  case 3:
21302
21872
  result = _context.sent;
21303
21873
  if (result === true) {
@@ -21343,11 +21913,17 @@ function DragDropUpload(_ref) {
21343
21913
  children: t('backoffice.catalogeditor.classimport.acceptedfiles')
21344
21914
  })]
21345
21915
  })), /*#__PURE__*/jsx(Checkbox, {
21346
- value: deleteExistingOPVChilds,
21916
+ checked: deleteExistingOPVChilds,
21347
21917
  onChange: function onChange(e) {
21348
21918
  return setDeleteExistingOPVChilds(e.target.checked);
21349
21919
  },
21350
21920
  children: t('backoffice.catalogeditor.classexportdeleteopvchilds')
21921
+ }), /*#__PURE__*/jsx(Checkbox, {
21922
+ checked: deleteDataNotExistingInExcel,
21923
+ onChange: function onChange(e) {
21924
+ return setDeleteDataNotExistingInExcel(e.target.checked);
21925
+ },
21926
+ children: t('backoffice.catalogeditor.classexportdeletedatanotexistinginexcel')
21351
21927
  }), /*#__PURE__*/jsx(Button, {
21352
21928
  type: "primary",
21353
21929
  onClick: onClickImport,