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