@crystaldesign/diva-backoffice 26.5.0-beta.2 → 26.5.0-beta.20
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 +941 -702
- package/build/types/backoffice/src/ui/Form/Fields/FormList/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/Presets/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/elements.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/types.d.ts +2 -1
- package/build/types/backoffice/src/ui/Form/types.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/useFormData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/{Catalogs.d.ts → CatalogVersions.d.ts} +5 -8
- package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/CatalogVersions.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/IdmCatalogs.d.ts +3 -4
- package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/IdmCatalogs.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/versionColumnDef.d.ts +67 -0
- package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/versionColumnDef.d.ts.map +1 -0
- package/build/types/backoffice/src/ui/IDMCatalogEditor/modules/TableCatalogs/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TablePackages/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Select/index.d.ts +3 -2
- package/build/types/backoffice/src/ui/Select/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Select/useSelectData.d.ts +5 -8
- package/build/types/backoffice/src/ui/Select/useSelectData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/SelectOrCreate/types.d.ts +2 -6
- package/build/types/backoffice/src/ui/SelectOrCreate/types.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Table/BaseTable/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Table/types.d.ts +18 -7
- package/build/types/backoffice/src/ui/Table/types.d.ts.map +1 -1
- package/build/types/backoffice/src/utils/applyMapping.d.ts.map +1 -1
- package/package.json +9 -9
- package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/Catalogs.d.ts.map +0 -1
package/build/esm/index.js
CHANGED
|
@@ -72,7 +72,6 @@ import SendOutlined from '@ant-design/icons/SendOutlined';
|
|
|
72
72
|
import ToolOutlined from '@ant-design/icons/ToolOutlined';
|
|
73
73
|
import cloneDeep from 'lodash/cloneDeep';
|
|
74
74
|
import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined';
|
|
75
|
-
import merge from 'lodash/merge';
|
|
76
75
|
import DivaUtils$1, { nanoid, DivaError as DivaError$1 } from '@crystaldesign/diva-utils';
|
|
77
76
|
import DeleteOutlined from '@ant-design/icons/DeleteOutlined';
|
|
78
77
|
import JSONEditor from 'jsoneditor';
|
|
@@ -99,7 +98,7 @@ import QuestionCircleOutlined from '@ant-design/icons/QuestionCircleOutlined';
|
|
|
99
98
|
import WarningTwoTone from '@ant-design/icons/WarningTwoTone';
|
|
100
99
|
import CheckOutlined from '@ant-design/icons/lib/icons/CheckOutlined';
|
|
101
100
|
import CloseOutlined from '@ant-design/icons/lib/icons/CloseOutlined';
|
|
102
|
-
import merge
|
|
101
|
+
import merge from 'deepmerge';
|
|
103
102
|
import { ContentBoxComponent } from '@crystaldesign/content-box';
|
|
104
103
|
import { AgCharts } from 'ag-charts-react';
|
|
105
104
|
import { Histogram } from '@crystaldesign/analytics';
|
|
@@ -168,8 +167,8 @@ import Select$2 from 'antd/es/select';
|
|
|
168
167
|
function _createForOfIteratorHelper$r(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$r(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
169
168
|
function _unsupportedIterableToArray$r(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$r(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$r(r, a) : void 0; } }
|
|
170
169
|
function _arrayLikeToArray$r(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
171
|
-
function ownKeys$
|
|
172
|
-
function _objectSpread$
|
|
170
|
+
function ownKeys$1l(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; }
|
|
171
|
+
function _objectSpread$1l(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1l(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1l(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
173
172
|
var LOG$g = getLogger('Backoffice', 'ApplyMapping');
|
|
174
173
|
function applyMapping (_ref) {
|
|
175
174
|
var mappable = _ref.mappable,
|
|
@@ -190,11 +189,10 @@ function applyMapping (_ref) {
|
|
|
190
189
|
var newValue = {};
|
|
191
190
|
newValue[newKey] = valueToAdd;
|
|
192
191
|
if ((startValue === null || startValue === void 0 ? void 0 : startValue[newKey]) != undefined) {
|
|
193
|
-
if (_typeof(startValue[newKey]) == 'object'
|
|
194
|
-
else startValue[newKey] = type == 'addToSourceValue' ? startValue[newKey] + valueToAdd : valueToAdd;
|
|
192
|
+
if (_typeof(startValue[newKey]) == 'object') startValue[newKey] = _objectSpread$1l(_objectSpread$1l({}, startValue[newKey]), valueToAdd);else startValue[newKey] = type == 'addToSourceValue' ? startValue[newKey] + valueToAdd : valueToAdd;
|
|
195
193
|
return startValue;
|
|
196
194
|
}
|
|
197
|
-
if (newIdx == 1) return _objectSpread$
|
|
195
|
+
if (newIdx == 1) return _objectSpread$1l(_objectSpread$1l({}, startValue), newValue);
|
|
198
196
|
return _getTarget(idx + 1, keys, startValue, newValue);
|
|
199
197
|
};
|
|
200
198
|
returnValue = _getTarget(0, key.split('.'), returnValue, value);
|
|
@@ -497,8 +495,8 @@ function getLeafColumns(columns) {
|
|
|
497
495
|
});
|
|
498
496
|
}
|
|
499
497
|
|
|
500
|
-
function ownKeys$
|
|
501
|
-
function _objectSpread$
|
|
498
|
+
function ownKeys$1k(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; }
|
|
499
|
+
function _objectSpread$1k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1k(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
502
500
|
var LOG$f = getLogger('Backoffice', 'ApiHandler');
|
|
503
501
|
var jp = require('jsonpath');
|
|
504
502
|
var _default$d = /*#__PURE__*/function () {
|
|
@@ -677,7 +675,7 @@ var _default$d = /*#__PURE__*/function () {
|
|
|
677
675
|
_context2.next = 20;
|
|
678
676
|
return fetch(finalUrl, {
|
|
679
677
|
method: this._updateMethod,
|
|
680
|
-
headers: _objectSpread$
|
|
678
|
+
headers: _objectSpread$1k(_objectSpread$1k({}, jwt ? {
|
|
681
679
|
Authorization: 'Bearer ' + jwt
|
|
682
680
|
} : {}), {}, {
|
|
683
681
|
'Content-Type': 'application/json'
|
|
@@ -770,7 +768,7 @@ var _default$d = /*#__PURE__*/function () {
|
|
|
770
768
|
rootStore: this._rootStore,
|
|
771
769
|
fallBackToParams: true
|
|
772
770
|
});
|
|
773
|
-
if (data) createData = _objectSpread$
|
|
771
|
+
if (data) createData = _objectSpread$1k({}, data);
|
|
774
772
|
} else if (data !== undefined) {
|
|
775
773
|
createData = applyMapping({
|
|
776
774
|
mappable: data,
|
|
@@ -1032,7 +1030,7 @@ var _default$d = /*#__PURE__*/function () {
|
|
|
1032
1030
|
throw new Error('Read List endpoint is missing in configuration.');
|
|
1033
1031
|
case 2:
|
|
1034
1032
|
jwt = (_this$_rootStore5 = this._rootStore) === null || _this$_rootStore5 === void 0 ? void 0 : _this$_rootStore5.dataStore.jwt;
|
|
1035
|
-
url = filterServerSide ? parseServersideFilters(_objectSpread$
|
|
1033
|
+
url = filterServerSide ? parseServersideFilters(_objectSpread$1k(_objectSpread$1k({}, filterServerSide), {}, {
|
|
1036
1034
|
columns: this._filterFields ? filterServerSide.columns : undefined,
|
|
1037
1035
|
baseUrl: this._readListUrl,
|
|
1038
1036
|
prefilter: prefilter
|
|
@@ -1052,7 +1050,7 @@ var _default$d = /*#__PURE__*/function () {
|
|
|
1052
1050
|
});
|
|
1053
1051
|
case 6:
|
|
1054
1052
|
response = _context8.sent;
|
|
1055
|
-
return _context8.abrupt("return", _objectSpread$
|
|
1053
|
+
return _context8.abrupt("return", _objectSpread$1k(_objectSpread$1k({}, response), {}, {
|
|
1056
1054
|
data: response.data.map(function (d) {
|
|
1057
1055
|
return _this2.aplyJsonPath(d, _this2._readJsonPath);
|
|
1058
1056
|
})
|
|
@@ -1076,7 +1074,7 @@ var _default$d = /*#__PURE__*/function () {
|
|
|
1076
1074
|
throw new Error('Read List endpoint is missing in configuration.');
|
|
1077
1075
|
}
|
|
1078
1076
|
(_this$_rootStore6 = this._rootStore) === null || _this$_rootStore6 === void 0 ? void 0 : _this$_rootStore6.dataStore.jwt;
|
|
1079
|
-
var url = filterServerSide ? parseServersideFilters(_objectSpread$
|
|
1077
|
+
var url = filterServerSide ? parseServersideFilters(_objectSpread$1k(_objectSpread$1k({}, filterServerSide), {}, {
|
|
1080
1078
|
columns: this._filterFields ? filterServerSide.columns : undefined,
|
|
1081
1079
|
baseUrl: this._readListUrl,
|
|
1082
1080
|
prefilter: prefilter
|
|
@@ -1283,8 +1281,8 @@ var _default$c = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1283
1281
|
}]);
|
|
1284
1282
|
}(_default$d);
|
|
1285
1283
|
|
|
1286
|
-
function ownKeys$
|
|
1287
|
-
function _objectSpread$
|
|
1284
|
+
function ownKeys$1j(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; }
|
|
1285
|
+
function _objectSpread$1j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1j(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1288
1286
|
function _callSuper$5(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1289
1287
|
function _isNativeReflectConstruct$5() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
1290
1288
|
var _default$b = /*#__PURE__*/function (_ApiHandler) {
|
|
@@ -1383,7 +1381,7 @@ var _default$b = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1383
1381
|
_context2.next = 5;
|
|
1384
1382
|
return fetch(this._createUrl + '?ref=true', {
|
|
1385
1383
|
method: this._createMethod,
|
|
1386
|
-
headers: _objectSpread$
|
|
1384
|
+
headers: _objectSpread$1j({}, jwt ? {
|
|
1387
1385
|
Authorization: 'Bearer ' + jwt
|
|
1388
1386
|
} : {}),
|
|
1389
1387
|
body: data
|
|
@@ -1890,8 +1888,8 @@ function replaceApiConfigPlaceholdersDeep(obj, apiConfig) {
|
|
|
1890
1888
|
}
|
|
1891
1889
|
}
|
|
1892
1890
|
|
|
1893
|
-
function ownKeys$
|
|
1894
|
-
function _objectSpread$
|
|
1891
|
+
function ownKeys$1i(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; }
|
|
1892
|
+
function _objectSpread$1i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1i(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1895
1893
|
var PROMPT_RESOLUTION_VALUE_STRINGS = promptAndAiTesterOptions.aiImageTester.resolutionOptions.map(function (o) {
|
|
1896
1894
|
return o.apiValue;
|
|
1897
1895
|
});
|
|
@@ -1932,7 +1930,7 @@ var _default$7 = /*#__PURE__*/function () {
|
|
|
1932
1930
|
var _i$permission;
|
|
1933
1931
|
return !i.permission || _this.root.actions.userHasPermission((_i$permission = i.permission) === null || _i$permission === void 0 ? void 0 : _i$permission.toLocaleLowerCase());
|
|
1934
1932
|
});
|
|
1935
|
-
config = _objectSpread$
|
|
1933
|
+
config = _objectSpread$1i(_objectSpread$1i({}, config), {}, {
|
|
1936
1934
|
items: filteredItems
|
|
1937
1935
|
});
|
|
1938
1936
|
}
|
|
@@ -4934,11 +4932,23 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
4934
4932
|
title: t('backoffice.table.translation.title')
|
|
4935
4933
|
}],
|
|
4936
4934
|
filter: {
|
|
4935
|
+
operation: 'eq',
|
|
4937
4936
|
select: {
|
|
4937
|
+
selectVariant: 'select',
|
|
4938
4938
|
settings: {
|
|
4939
|
+
mode: 'single',
|
|
4939
4940
|
search: true,
|
|
4941
|
+
selectMapping: {
|
|
4942
|
+
searchField: [{
|
|
4943
|
+
field: 'namespace',
|
|
4944
|
+
filter: 'contains'
|
|
4945
|
+
}]
|
|
4946
|
+
},
|
|
4940
4947
|
apiInterface: {
|
|
4941
|
-
read:
|
|
4948
|
+
read: {
|
|
4949
|
+
list: '${adminService}/v1/locales/namespaces',
|
|
4950
|
+
filterServerSide: true
|
|
4951
|
+
}
|
|
4942
4952
|
}
|
|
4943
4953
|
},
|
|
4944
4954
|
defaultValue: 'default',
|
|
@@ -8265,8 +8275,7 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
8265
8275
|
}, {
|
|
8266
8276
|
field: '_id',
|
|
8267
8277
|
filter: 'eq'
|
|
8268
|
-
}]
|
|
8269
|
-
prefilter: '[{parentType,eq,RETAILER}]'
|
|
8278
|
+
}]
|
|
8270
8279
|
},
|
|
8271
8280
|
apiInterface: {
|
|
8272
8281
|
read: {
|
|
@@ -9242,6 +9251,60 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
9242
9251
|
label: t('backoffice.form.organizationdetails.items.nein'),
|
|
9243
9252
|
value: false
|
|
9244
9253
|
}]
|
|
9254
|
+
}, {
|
|
9255
|
+
name: ['settings', 'versioningConfirmationEmails'],
|
|
9256
|
+
label: t('backoffice.form.organizationdetails.items.versioningConfirmationEmails'),
|
|
9257
|
+
permission: 'backoffice_admin_organizations',
|
|
9258
|
+
hidden: function hidden(data) {
|
|
9259
|
+
return (data === null || data === void 0 ? void 0 : data.type) !== 'RETAILER';
|
|
9260
|
+
},
|
|
9261
|
+
type: 'select',
|
|
9262
|
+
mode: 'tags',
|
|
9263
|
+
allowClear: true,
|
|
9264
|
+
selectMapping: {
|
|
9265
|
+
label: '${name} ${familyName} (${mainEmail})',
|
|
9266
|
+
value: 'mainEmail',
|
|
9267
|
+
searchField: [{
|
|
9268
|
+
field: 'name',
|
|
9269
|
+
filter: 'contains'
|
|
9270
|
+
}, {
|
|
9271
|
+
field: 'familyName',
|
|
9272
|
+
filter: 'contains'
|
|
9273
|
+
}, {
|
|
9274
|
+
field: 'mainEmail',
|
|
9275
|
+
filter: 'contains'
|
|
9276
|
+
}, {
|
|
9277
|
+
field: '_id',
|
|
9278
|
+
filter: 'eq'
|
|
9279
|
+
}],
|
|
9280
|
+
prefilterMapping: {
|
|
9281
|
+
type: 'query',
|
|
9282
|
+
map: [{
|
|
9283
|
+
targetField: 'organizationId',
|
|
9284
|
+
sourceValue: function sourceValue(data) {
|
|
9285
|
+
var _data$parentOrganizat6, _data$parentOrganizat7;
|
|
9286
|
+
return (_data$parentOrganizat6 = (_data$parentOrganizat7 = data.parentOrganizations) === null || _data$parentOrganizat7 === void 0 || (_data$parentOrganizat7 = _data$parentOrganizat7[0]) === null || _data$parentOrganizat7 === void 0 ? void 0 : _data$parentOrganizat7._id) !== null && _data$parentOrganizat6 !== void 0 ? _data$parentOrganizat6 : data._id;
|
|
9287
|
+
}
|
|
9288
|
+
}]
|
|
9289
|
+
}
|
|
9290
|
+
},
|
|
9291
|
+
apiInterface: {
|
|
9292
|
+
read: {
|
|
9293
|
+
list: '${authService}/v2/organizations/${organizationId}/members?hierarchy=true&fields={_id,mainEmail,name,familyName}',
|
|
9294
|
+
filterServerSide: true
|
|
9295
|
+
}
|
|
9296
|
+
},
|
|
9297
|
+
onSave: function onSave(newD) {
|
|
9298
|
+
if (!(newD !== null && newD !== void 0 && newD.settings)) return newD;
|
|
9299
|
+
var raw = newD.settings.versioningConfirmationEmails;
|
|
9300
|
+
if (!Array.isArray(raw)) return newD;
|
|
9301
|
+
newD.settings.versioningConfirmationEmails = raw.map(function (e) {
|
|
9302
|
+
return typeof e === 'string' ? e.trim() : e;
|
|
9303
|
+
}).filter(function (e) {
|
|
9304
|
+
return e != null && e !== '';
|
|
9305
|
+
});
|
|
9306
|
+
return newD;
|
|
9307
|
+
}
|
|
9245
9308
|
}, {
|
|
9246
9309
|
name: ['api2Location', 'vk'],
|
|
9247
9310
|
label: t('backoffice.form.organizationdetails.items.api2Location.vk'),
|
|
@@ -9353,8 +9416,8 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
9353
9416
|
return (data === null || data === void 0 ? void 0 : data.type) === 'ASSOCIATION' || (data === null || data === void 0 ? void 0 : data.type) === 'SUPPLIER' || (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER';
|
|
9354
9417
|
}
|
|
9355
9418
|
}, {
|
|
9356
|
-
name: '
|
|
9357
|
-
label: t('backoffice.form.organizationdetails.items.
|
|
9419
|
+
name: 'shareUrl',
|
|
9420
|
+
label: t('backoffice.form.organizationdetails.items.shareUrl'),
|
|
9358
9421
|
type: 'input',
|
|
9359
9422
|
permission: 'backoffice_admin_organizations',
|
|
9360
9423
|
hidden: function hidden(data) {
|
|
@@ -10856,7 +10919,10 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
10856
10919
|
type: 'select',
|
|
10857
10920
|
mode: 'single',
|
|
10858
10921
|
apiInterface: {
|
|
10859
|
-
read:
|
|
10922
|
+
read: {
|
|
10923
|
+
list: '${adminService}/v1/locales/namespaces',
|
|
10924
|
+
filterServerSide: true
|
|
10925
|
+
}
|
|
10860
10926
|
},
|
|
10861
10927
|
required: true,
|
|
10862
10928
|
allowCreate: true
|
|
@@ -11213,16 +11279,6 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
11213
11279
|
jsonPatch: true
|
|
11214
11280
|
}
|
|
11215
11281
|
},
|
|
11216
|
-
mapping: {
|
|
11217
|
-
type: 'body',
|
|
11218
|
-
map: [{
|
|
11219
|
-
sourceField: 'prompt._id',
|
|
11220
|
-
targetField: 'prompt'
|
|
11221
|
-
}, {
|
|
11222
|
-
sourceField: 'renderScene.id',
|
|
11223
|
-
targetField: 'renderScene'
|
|
11224
|
-
}]
|
|
11225
|
-
},
|
|
11226
11282
|
presetApiInterface: {
|
|
11227
11283
|
create: {
|
|
11228
11284
|
url: '${mediaService}/renderjobpresets',
|
|
@@ -11267,6 +11323,9 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
11267
11323
|
}, {
|
|
11268
11324
|
sourceField: 'doRenderDoubleResolution',
|
|
11269
11325
|
targetField: 'doRenderDoubleResolution'
|
|
11326
|
+
}, {
|
|
11327
|
+
sourceField: 'useTransparency',
|
|
11328
|
+
targetField: 'useTransparency'
|
|
11270
11329
|
}]
|
|
11271
11330
|
},
|
|
11272
11331
|
itemSelector: [{
|
|
@@ -11429,24 +11488,17 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
11429
11488
|
name: 'renderScene',
|
|
11430
11489
|
type: 'select',
|
|
11431
11490
|
mode: 'single',
|
|
11432
|
-
apiInterface: {
|
|
11433
|
-
read: {
|
|
11434
|
-
list: '${mediaService}/rooms/variants',
|
|
11435
|
-
filterServerSide: true
|
|
11436
|
-
}
|
|
11437
|
-
},
|
|
11438
11491
|
selectMapping: {
|
|
11439
|
-
label: '${
|
|
11440
|
-
value: '
|
|
11492
|
+
label: '${label}',
|
|
11493
|
+
value: 'value',
|
|
11441
11494
|
searchField: [{
|
|
11442
|
-
field: '
|
|
11495
|
+
field: 'label',
|
|
11443
11496
|
filter: 'contains'
|
|
11444
|
-
}],
|
|
11445
|
-
initField: [{
|
|
11446
|
-
field: 'id',
|
|
11447
|
-
filter: 'eq'
|
|
11448
11497
|
}]
|
|
11449
11498
|
},
|
|
11499
|
+
valueAsData: true,
|
|
11500
|
+
allowCreate: true,
|
|
11501
|
+
allowClear: true,
|
|
11450
11502
|
values: config.sceneNames,
|
|
11451
11503
|
label: t('backoffice.form.renderjob.items.renderScene'),
|
|
11452
11504
|
marker: true,
|
|
@@ -12343,6 +12395,7 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
12343
12395
|
label: t('backoffice.form.renderjob.prompt'),
|
|
12344
12396
|
type: 'select',
|
|
12345
12397
|
mode: 'single',
|
|
12398
|
+
valueAsData: true,
|
|
12346
12399
|
selectMapping: {
|
|
12347
12400
|
label: '${name}',
|
|
12348
12401
|
value: '_id',
|
|
@@ -13402,10 +13455,10 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
|
|
|
13402
13455
|
type: 'Form',
|
|
13403
13456
|
id: 'FormOrganizationDetails',
|
|
13404
13457
|
title: function title(data) {
|
|
13405
|
-
var _data$
|
|
13406
|
-
return [].concat(_toConsumableArray((_data$
|
|
13458
|
+
var _data$parentOrganizat8, _data$parentOrganizat9;
|
|
13459
|
+
return [].concat(_toConsumableArray((_data$parentOrganizat8 = (_data$parentOrganizat9 = data.parentOrganizations) === null || _data$parentOrganizat9 === void 0 ? void 0 : _data$parentOrganizat9.map(function (p) {
|
|
13407
13460
|
return p.displayName;
|
|
13408
|
-
})) !== null && _data$
|
|
13461
|
+
})) !== null && _data$parentOrganizat8 !== void 0 ? _data$parentOrganizat8 : []), [data.displayName]).join(' / ');
|
|
13409
13462
|
}
|
|
13410
13463
|
},
|
|
13411
13464
|
mapping: {
|
|
@@ -15445,8 +15498,8 @@ var ToolBarStore = /*#__PURE__*/function () {
|
|
|
15445
15498
|
}]);
|
|
15446
15499
|
}();
|
|
15447
15500
|
|
|
15448
|
-
function ownKeys$
|
|
15449
|
-
function _objectSpread$
|
|
15501
|
+
function ownKeys$1h(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; }
|
|
15502
|
+
function _objectSpread$1h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1h(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15450
15503
|
function _createForOfIteratorHelper$p(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$p(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
15451
15504
|
function _unsupportedIterableToArray$p(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$p(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$p(r, a) : void 0; } }
|
|
15452
15505
|
function _arrayLikeToArray$p(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -15587,7 +15640,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
15587
15640
|
if (index >= 0) {
|
|
15588
15641
|
this._additionalMenuElements[index] = {
|
|
15589
15642
|
key: key,
|
|
15590
|
-
element: _objectSpread$
|
|
15643
|
+
element: _objectSpread$1h(_objectSpread$1h({}, this._additionalMenuElements[index].element), {}, {
|
|
15591
15644
|
items: items,
|
|
15592
15645
|
selected: selected
|
|
15593
15646
|
})
|
|
@@ -15638,7 +15691,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
15638
15691
|
var path = this.getPath(element.menu, this._selectedMenuKeys, this.root.navigationState.searchParams);
|
|
15639
15692
|
this.root.navigate('/' + path);
|
|
15640
15693
|
}
|
|
15641
|
-
this._menuElement1 = _objectSpread$
|
|
15694
|
+
this._menuElement1 = _objectSpread$1h(_objectSpread$1h({}, this.menuElement1), {}, {
|
|
15642
15695
|
selected: this._selectedMenuKeys[0]
|
|
15643
15696
|
});
|
|
15644
15697
|
var menu2 = (_this$_menu$find = this._menu.find(function (element) {
|
|
@@ -15910,7 +15963,7 @@ var _default$6 = /*#__PURE__*/function () {
|
|
|
15910
15963
|
}
|
|
15911
15964
|
return !item.permission || hasPermission(item.permission.toLocaleLowerCase());
|
|
15912
15965
|
}).map(function (item) {
|
|
15913
|
-
return _objectSpread$
|
|
15966
|
+
return _objectSpread$1h(_objectSpread$1h({}, item), {}, {
|
|
15914
15967
|
items: item.items ? _this5.filterMenuByPermission(hasPermission, item.items) : undefined,
|
|
15915
15968
|
subMenu: item.subMenu ? _this5.filterMenuByPermission(hasPermission, item.subMenu) : undefined
|
|
15916
15969
|
});
|
|
@@ -16431,7 +16484,7 @@ var menu = [{
|
|
|
16431
16484
|
id: 'MetaCampaignJotformSync',
|
|
16432
16485
|
path: 'meta-campaign-jotform-sync',
|
|
16433
16486
|
label: 'backoffice.metaCampaignJotformSync.menu',
|
|
16434
|
-
permission: '
|
|
16487
|
+
permission: 'backoffice_admin_meta',
|
|
16435
16488
|
icon: 'CloudSyncOutlined'
|
|
16436
16489
|
}]
|
|
16437
16490
|
}]
|
|
@@ -17261,8 +17314,8 @@ var _default$2 = /*#__PURE__*/function (_ApiHandler) {
|
|
|
17261
17314
|
return _createClass(_default);
|
|
17262
17315
|
}(_default$d);
|
|
17263
17316
|
|
|
17264
|
-
function ownKeys$
|
|
17265
|
-
function _objectSpread$
|
|
17317
|
+
function ownKeys$1g(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; }
|
|
17318
|
+
function _objectSpread$1g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17266
17319
|
var LOG$d = getLogger('Backoffice', 'ContextStore');
|
|
17267
17320
|
|
|
17268
17321
|
/**
|
|
@@ -17297,7 +17350,7 @@ var ContextStore = /*#__PURE__*/function () {
|
|
|
17297
17350
|
key: "updateContext",
|
|
17298
17351
|
value: function updateContext(contextId, updates) {
|
|
17299
17352
|
var currentState = this.contexts.get(contextId) || {};
|
|
17300
|
-
var updatedState = _objectSpread$
|
|
17353
|
+
var updatedState = _objectSpread$1g(_objectSpread$1g({}, currentState), updates);
|
|
17301
17354
|
this.contexts.set(contextId, updatedState);
|
|
17302
17355
|
LOG$d.debug("Updated context ".concat(contextId), {
|
|
17303
17356
|
updatedState: updatedState
|
|
@@ -17931,8 +17984,8 @@ var MediaItem = /*#__PURE__*/function () {
|
|
|
17931
17984
|
}]);
|
|
17932
17985
|
}();
|
|
17933
17986
|
|
|
17934
|
-
function ownKeys$
|
|
17935
|
-
function _objectSpread$
|
|
17987
|
+
function ownKeys$1f(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; }
|
|
17988
|
+
function _objectSpread$1f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17936
17989
|
function _createForOfIteratorHelper$n(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$n(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
17937
17990
|
function _unsupportedIterableToArray$n(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$n(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$n(r, a) : void 0; } }
|
|
17938
17991
|
function _arrayLikeToArray$n(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -17991,6 +18044,7 @@ function useFormData (_ref) {
|
|
|
17991
18044
|
}, [configuration]);
|
|
17992
18045
|
var selectedItemsInitValues = [];
|
|
17993
18046
|
var selectedItemsInitIndex = [0, 0];
|
|
18047
|
+
var selectorSourceData = Array.isArray(inboundData) ? inboundData[0] : inboundData;
|
|
17994
18048
|
if (!Array.isArray(configuration.items[0])) {
|
|
17995
18049
|
selectedItemsInitValues = configuration.items;
|
|
17996
18050
|
} else if (configuration.itemSelector && configuration.itemSelectorDefautIndex !== undefined) {
|
|
@@ -18001,12 +18055,14 @@ function useFormData (_ref) {
|
|
|
18001
18055
|
var indices = [0, 0];
|
|
18002
18056
|
var _loop = function _loop() {
|
|
18003
18057
|
var is = selectorItems[idx];
|
|
18004
|
-
var val =
|
|
18058
|
+
var val = selectorSourceData === null || selectorSourceData === void 0 ? void 0 : selectorSourceData[is.name];
|
|
18005
18059
|
if (val) {
|
|
18006
18060
|
var valueIdx = is.values.findIndex(function (value) {
|
|
18007
18061
|
return value == val;
|
|
18008
18062
|
});
|
|
18009
|
-
|
|
18063
|
+
if (valueIdx >= 0) {
|
|
18064
|
+
indices[idx] = valueIdx;
|
|
18065
|
+
}
|
|
18010
18066
|
}
|
|
18011
18067
|
};
|
|
18012
18068
|
for (var idx = 0; idx < selectorItems.length; idx++) {
|
|
@@ -18069,7 +18125,7 @@ function useFormData (_ref) {
|
|
|
18069
18125
|
multipleEditingData = inboundData;
|
|
18070
18126
|
}
|
|
18071
18127
|
return {
|
|
18072
|
-
loadedData: _onLoadFields(_objectSpread$
|
|
18128
|
+
loadedData: _onLoadFields(_objectSpread$1f({}, dt)),
|
|
18073
18129
|
multipleEditingData: multipleEditingData
|
|
18074
18130
|
};
|
|
18075
18131
|
}, [inboundData]),
|
|
@@ -18096,7 +18152,7 @@ function useFormData (_ref) {
|
|
|
18096
18152
|
setFieldErrors = _useState20[1];
|
|
18097
18153
|
useEffect(function () {
|
|
18098
18154
|
var _loadedData$_id2;
|
|
18099
|
-
setState(_objectSpread$
|
|
18155
|
+
setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18100
18156
|
data: loadedData,
|
|
18101
18157
|
origData: JSON.parse(JSON.stringify(inboundData !== null && inboundData !== void 0 ? inboundData : {})),
|
|
18102
18158
|
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),
|
|
@@ -18194,11 +18250,19 @@ function useFormData (_ref) {
|
|
|
18194
18250
|
mediaHandler = _useDivaCore2.handler.mediaHandler;
|
|
18195
18251
|
var onSave = /*#__PURE__*/function () {
|
|
18196
18252
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(values) {
|
|
18253
|
+
var _state$data;
|
|
18197
18254
|
var newData, finalData, response, i, _configuration$additi, additional, additionalApi, data, errorCode, item;
|
|
18198
18255
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
18199
18256
|
while (1) switch (_context2.prev = _context2.next) {
|
|
18200
18257
|
case 0:
|
|
18201
|
-
|
|
18258
|
+
// lodash merge() merges arrays by index, which truncates or keeps stale elements when
|
|
18259
|
+
// lengths differ (e.g. tags / multi-select email lists). Prefer submitted array values in full.
|
|
18260
|
+
newData = mergeWith(cloneDeep((_state$data = state.data) !== null && _state$data !== void 0 ? _state$data : {}), values, function (_objValue, srcValue) {
|
|
18261
|
+
if (Array.isArray(srcValue)) {
|
|
18262
|
+
return srcValue;
|
|
18263
|
+
}
|
|
18264
|
+
return undefined;
|
|
18265
|
+
});
|
|
18202
18266
|
if (!skipApi) {
|
|
18203
18267
|
_context2.next = 3;
|
|
18204
18268
|
break;
|
|
@@ -18208,7 +18272,7 @@ function useFormData (_ref) {
|
|
|
18208
18272
|
root.actions.toggleLoading('saving_form');
|
|
18209
18273
|
_context2.prev = 4;
|
|
18210
18274
|
_context2.next = 7;
|
|
18211
|
-
return setDynamicFields(_objectSpread$
|
|
18275
|
+
return setDynamicFields(_objectSpread$1f({}, state.data), newData);
|
|
18212
18276
|
case 7:
|
|
18213
18277
|
newData = _context2.sent;
|
|
18214
18278
|
_context2.next = 10;
|
|
@@ -18223,7 +18287,7 @@ function useFormData (_ref) {
|
|
|
18223
18287
|
root.actions.toggleLoading('saving_form');
|
|
18224
18288
|
throw _context2.t0;
|
|
18225
18289
|
case 17:
|
|
18226
|
-
setState(_objectSpread$
|
|
18290
|
+
setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18227
18291
|
loading: true
|
|
18228
18292
|
}));
|
|
18229
18293
|
finalData = state.data;
|
|
@@ -18276,14 +18340,14 @@ function useFormData (_ref) {
|
|
|
18276
18340
|
_context2.next = 47;
|
|
18277
18341
|
break;
|
|
18278
18342
|
}
|
|
18279
|
-
setFieldErrors(_objectSpread$
|
|
18343
|
+
setFieldErrors(_objectSpread$1f(_objectSpread$1f({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
|
|
18280
18344
|
return _context2.abrupt("return", undefined);
|
|
18281
18345
|
case 47:
|
|
18282
18346
|
throw _context2.t1;
|
|
18283
18347
|
case 48:
|
|
18284
18348
|
_context2.prev = 48;
|
|
18285
18349
|
root.actions.toggleLoading('saving_form');
|
|
18286
|
-
setState(_objectSpread$
|
|
18350
|
+
setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18287
18351
|
data: finalData,
|
|
18288
18352
|
loading: false
|
|
18289
18353
|
}));
|
|
@@ -18313,7 +18377,7 @@ function useFormData (_ref) {
|
|
|
18313
18377
|
}
|
|
18314
18378
|
var updateHiddenRequiredDisabled = function updateHiddenRequiredDisabled(data, changedFields) {
|
|
18315
18379
|
if (!(selectedItems !== null && selectedItems !== void 0 && selectedItems.length)) return;
|
|
18316
|
-
var wholeData = Object.assign(_objectSpread$
|
|
18380
|
+
var wholeData = Object.assign(_objectSpread$1f({}, state.data), _objectSpread$1f({}, changedFields !== null && changedFields !== void 0 ? changedFields : data));
|
|
18317
18381
|
var newState = getHiddenRequiredDisabled(wholeData, selectedItems);
|
|
18318
18382
|
if (JSON.stringify(newState) !== JSON.stringify(hiddenRequiredDisabled)) {
|
|
18319
18383
|
setHiddenRequiredDisabled(newState);
|
|
@@ -18331,14 +18395,14 @@ function useFormData (_ref) {
|
|
|
18331
18395
|
var item = getItem(id !== null && id !== void 0 ? id : '');
|
|
18332
18396
|
item === null || item === void 0 || (_item$onValueChange = item.onValueChange) === null || _item$onValueChange === void 0 || _item$onValueChange.call(item, value, item, state.form);
|
|
18333
18397
|
}
|
|
18334
|
-
var data = d !== null && d !== void 0 ? d : mergeWith(_objectSpread$
|
|
18398
|
+
var data = d !== null && d !== void 0 ? d : mergeWith(_objectSpread$1f({}, state.data), state.form.getFieldsValue(), mergeCustomizer);
|
|
18335
18399
|
if (id) {
|
|
18336
18400
|
setFieldInObject(id, data, value);
|
|
18337
|
-
var newFieldErrors = _objectSpread$
|
|
18401
|
+
var newFieldErrors = _objectSpread$1f({}, fieldErrors);
|
|
18338
18402
|
delete newFieldErrors[id.toString()];
|
|
18339
18403
|
setFieldErrors(newFieldErrors);
|
|
18340
18404
|
}
|
|
18341
|
-
setState(_objectSpread$
|
|
18405
|
+
setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18342
18406
|
data: data
|
|
18343
18407
|
}));
|
|
18344
18408
|
return data;
|
|
@@ -18391,16 +18455,16 @@ function useFormData (_ref) {
|
|
|
18391
18455
|
var data = {};
|
|
18392
18456
|
if (Array.isArray(configuration.itemSelector)) {
|
|
18393
18457
|
configuration.itemSelector.forEach(function (is, idx) {
|
|
18394
|
-
if (is.type !=
|
|
18458
|
+
if (is.type != 'select') return;
|
|
18395
18459
|
data[is.name] = is.values[selectorIdx[idx]];
|
|
18396
18460
|
});
|
|
18397
18461
|
} else {
|
|
18398
18462
|
data[name] = val;
|
|
18399
18463
|
}
|
|
18400
|
-
if (configuration.itemSelectorReset) setState(_objectSpread$
|
|
18464
|
+
if (configuration.itemSelectorReset) setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18401
18465
|
data: data
|
|
18402
|
-
}));else setState(_objectSpread$
|
|
18403
|
-
data: _objectSpread$
|
|
18466
|
+
}));else setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18467
|
+
data: _objectSpread$1f(_objectSpread$1f({}, state.data), data)
|
|
18404
18468
|
}));
|
|
18405
18469
|
if (Array.isArray(configuration.items[selectorIdx[0]]) && Array.isArray(configuration.items[selectorIdx[0]][selectorIdx[1]])) {
|
|
18406
18470
|
setSelectedItemsIndex([selectorIdx[0], selectorIdx[1]]);
|
|
@@ -18433,12 +18497,12 @@ function useFormData (_ref) {
|
|
|
18433
18497
|
var val = _ref6.value;
|
|
18434
18498
|
if (value === val) {
|
|
18435
18499
|
if (configuration.itemSelectorReset) {
|
|
18436
|
-
setState(_objectSpread$
|
|
18500
|
+
setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18437
18501
|
data: _defineProperty({}, name, val)
|
|
18438
18502
|
}));
|
|
18439
18503
|
} else {
|
|
18440
|
-
setState(_objectSpread$
|
|
18441
|
-
data: _objectSpread$
|
|
18504
|
+
setState(_objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18505
|
+
data: _objectSpread$1f(_objectSpread$1f({}, state.data), {}, _defineProperty({}, name, val))
|
|
18442
18506
|
}));
|
|
18443
18507
|
}
|
|
18444
18508
|
setSelectedItemsIndex([selectedItemsIndex[0], idx]);
|
|
@@ -18611,7 +18675,7 @@ function useFormData (_ref) {
|
|
|
18611
18675
|
break;
|
|
18612
18676
|
}
|
|
18613
18677
|
_context5.next = 6;
|
|
18614
|
-
return mediaHandler.getRooms(scene
|
|
18678
|
+
return mediaHandler.getRooms(scene);
|
|
18615
18679
|
case 6:
|
|
18616
18680
|
room = _context5.sent[0];
|
|
18617
18681
|
if (room) {
|
|
@@ -18723,7 +18787,7 @@ function useFormData (_ref) {
|
|
|
18723
18787
|
for (var i = 0; i < configuration.tools.length; i++) {
|
|
18724
18788
|
var _tool$defaultOpen;
|
|
18725
18789
|
var tool = configuration.tools[i];
|
|
18726
|
-
tools.push(_objectSpread$
|
|
18790
|
+
tools.push(_objectSpread$1f(_objectSpread$1f({}, tool), {}, {
|
|
18727
18791
|
parameters: {
|
|
18728
18792
|
data: state.data,
|
|
18729
18793
|
formInstance: form,
|
|
@@ -18848,6 +18912,9 @@ function useFormData (_ref) {
|
|
|
18848
18912
|
setRemovedMedias([].concat(_toConsumableArray(removedMedias), [media]));
|
|
18849
18913
|
};
|
|
18850
18914
|
function trimStringsOfObject(ob, prevOb) {
|
|
18915
|
+
if (ob === null || ob === undefined) {
|
|
18916
|
+
return;
|
|
18917
|
+
}
|
|
18851
18918
|
if (typeof ob == 'string') {
|
|
18852
18919
|
ob = ob.trim();
|
|
18853
18920
|
return;
|
|
@@ -18873,7 +18940,7 @@ function useFormData (_ref) {
|
|
|
18873
18940
|
}
|
|
18874
18941
|
});
|
|
18875
18942
|
}
|
|
18876
|
-
return _objectSpread$
|
|
18943
|
+
return _objectSpread$1f(_objectSpread$1f({}, state), {}, {
|
|
18877
18944
|
getIsHidden: getIsHidden,
|
|
18878
18945
|
setUsedPreset: setUsedPreset,
|
|
18879
18946
|
configuration: configuration,
|
|
@@ -18991,8 +19058,8 @@ var JsonEditor$2 = function JsonEditor(_ref) {
|
|
|
18991
19058
|
};
|
|
18992
19059
|
|
|
18993
19060
|
var _excluded$9 = ["key", "name"];
|
|
18994
|
-
function ownKeys$
|
|
18995
|
-
function _objectSpread$
|
|
19061
|
+
function ownKeys$1e(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; }
|
|
19062
|
+
function _objectSpread$1e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18996
19063
|
var FormList$2 = function FormList(_ref) {
|
|
18997
19064
|
var _item$initialValue;
|
|
18998
19065
|
var value = _ref.value,
|
|
@@ -19055,7 +19122,7 @@ var FormList$2 = function FormList(_ref) {
|
|
|
19055
19122
|
var aName = [].concat(_toConsumableArray(Array.isArray(absoluteName) ? absoluteName : [absoluteName]), _toConsumableArray(n));
|
|
19056
19123
|
var hidden = state.getIsHidden(i, state.data, [].concat(_toConsumableArray(Array.isArray(absoluteName) ? absoluteName : [absoluteName]), [name]));
|
|
19057
19124
|
if (hidden) return /*#__PURE__*/jsx(Fragment, {});
|
|
19058
|
-
return /*#__PURE__*/createElement(Form$2.Item, _objectSpread$
|
|
19125
|
+
return /*#__PURE__*/createElement(Form$2.Item, _objectSpread$1e(_objectSpread$1e({}, restField), {}, {
|
|
19059
19126
|
id: n.join(),
|
|
19060
19127
|
key: n.join(),
|
|
19061
19128
|
name: n,
|
|
@@ -19067,7 +19134,7 @@ var FormList$2 = function FormList(_ref) {
|
|
|
19067
19134
|
validateStatus: !!state.fieldErrors[n.toString()] ? 'error' : undefined,
|
|
19068
19135
|
help: (_state$fieldErrors$n$ = state.fieldErrors[n.toString()]) !== null && _state$fieldErrors$n$ !== void 0 ? _state$fieldErrors$n$ : i.helpText,
|
|
19069
19136
|
hidden: hidden
|
|
19070
|
-
}), getElement(_objectSpread$
|
|
19137
|
+
}), getElement(_objectSpread$1e(_objectSpread$1e({}, i), {}, {
|
|
19071
19138
|
name: n
|
|
19072
19139
|
}), setCanSave, state, aName, state.onInputChanged, onError, root, form, hidden));
|
|
19073
19140
|
})
|
|
@@ -19301,8 +19368,8 @@ var buttonGroup = "button-group-GYt-T";
|
|
|
19301
19368
|
var css_248z$B = ".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";
|
|
19302
19369
|
styleInject(css_248z$B);
|
|
19303
19370
|
|
|
19304
|
-
function ownKeys$
|
|
19305
|
-
function _objectSpread$
|
|
19371
|
+
function ownKeys$1d(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; }
|
|
19372
|
+
function _objectSpread$1d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19306
19373
|
var SubTitle = function SubTitle(_ref) {
|
|
19307
19374
|
var _item$orientation, _item$buttonIds;
|
|
19308
19375
|
var item = _ref.item,
|
|
@@ -19311,7 +19378,7 @@ var SubTitle = function SubTitle(_ref) {
|
|
|
19311
19378
|
t = _useTranslation.t;
|
|
19312
19379
|
return /*#__PURE__*/jsx(Divider, {
|
|
19313
19380
|
orientation: (_item$orientation = item.orientation) !== null && _item$orientation !== void 0 ? _item$orientation : 'horizontal',
|
|
19314
|
-
style: _objectSpread$
|
|
19381
|
+
style: _objectSpread$1d({}, item.style),
|
|
19315
19382
|
children: /*#__PURE__*/jsxs("div", {
|
|
19316
19383
|
className: wrapper$7,
|
|
19317
19384
|
children: [Array.isArray(item.name) ? t(item.name[0].toString()) : t(item.name), ((_item$buttonIds = item.buttonIds) === null || _item$buttonIds === void 0 ? void 0 : _item$buttonIds.length) && item.buttonIds.map(function (b) {
|
|
@@ -19605,8 +19672,8 @@ var css_248z$A = ".wrapper-4xyke {\n display: flex;\n flex-direction: column;\
|
|
|
19605
19672
|
styleInject(css_248z$A);
|
|
19606
19673
|
|
|
19607
19674
|
var _excluded$8 = ["apiInterface", "selectMapping", "apiMapping", "onChange", "value", "search", "options", "autoSelectFirst", "title", "sharedState"];
|
|
19608
|
-
function ownKeys$
|
|
19609
|
-
function _objectSpread$
|
|
19675
|
+
function ownKeys$1c(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; }
|
|
19676
|
+
function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19610
19677
|
var SelectWrapper$1 = function SelectWrapper(_ref, ref) {
|
|
19611
19678
|
var apiInterface = _ref.apiInterface,
|
|
19612
19679
|
selectMapping = _ref.selectMapping,
|
|
@@ -19633,7 +19700,7 @@ var SelectWrapper$1 = function SelectWrapper(_ref, ref) {
|
|
|
19633
19700
|
return /*#__PURE__*/jsxs("div", {
|
|
19634
19701
|
ref: ref,
|
|
19635
19702
|
className: classnames(title ? wrapper$6 : undefined),
|
|
19636
|
-
children: [title, /*#__PURE__*/jsx(Select$1, _objectSpread$
|
|
19703
|
+
children: [title, /*#__PURE__*/jsx(Select$1, _objectSpread$1c(_objectSpread$1c({}, selectProps), {}, {
|
|
19637
19704
|
showSearch: search,
|
|
19638
19705
|
loading: state.loading,
|
|
19639
19706
|
options: state.options,
|
|
@@ -20250,8 +20317,8 @@ var _default = /*#__PURE__*/function (_ApiHandler) {
|
|
|
20250
20317
|
}]);
|
|
20251
20318
|
}(_default$d);
|
|
20252
20319
|
|
|
20253
|
-
function ownKeys$
|
|
20254
|
-
function _objectSpread$
|
|
20320
|
+
function ownKeys$1b(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; }
|
|
20321
|
+
function _objectSpread$1b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20255
20322
|
getLogger('Backoffice', 'SelectClientRelationCatalog');
|
|
20256
20323
|
function useSelectClientRelationCatalog (_ref) {
|
|
20257
20324
|
var onSelectedCatalog = _ref.onSelectedCatalog,
|
|
@@ -20420,7 +20487,7 @@ function useSelectClientRelationCatalog (_ref) {
|
|
|
20420
20487
|
case 22:
|
|
20421
20488
|
supplierData = _context2.sent;
|
|
20422
20489
|
case 23:
|
|
20423
|
-
onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$
|
|
20490
|
+
onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$1b(_objectSpread$1b({}, _selectedSupplier), {}, {
|
|
20424
20491
|
supplierGuid: catalogList === null || catalogList === void 0 || (_catalogList$ = catalogList[0]) === null || _catalogList$ === void 0 ? void 0 : _catalogList$.Subfolder
|
|
20425
20492
|
}), supplierData);
|
|
20426
20493
|
if (catalogId && catalogList.find(function (c) {
|
|
@@ -20653,8 +20720,8 @@ function SelectClientRelationCatalog (_ref) {
|
|
|
20653
20720
|
function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
20654
20721
|
function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$l(r, a) : void 0; } }
|
|
20655
20722
|
function _arrayLikeToArray$l(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20656
|
-
function ownKeys$
|
|
20657
|
-
function _objectSpread$
|
|
20723
|
+
function ownKeys$1a(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; }
|
|
20724
|
+
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20658
20725
|
function useSelectData (_ref) {
|
|
20659
20726
|
var data = _ref.data,
|
|
20660
20727
|
onChange = _ref.onChange,
|
|
@@ -20675,7 +20742,8 @@ function useSelectData (_ref) {
|
|
|
20675
20742
|
defaultValue = _ref.defaultValue,
|
|
20676
20743
|
useFirstValueAsDefault = _ref.useFirstValueAsDefault,
|
|
20677
20744
|
canSetToUndefined = _ref.canSetToUndefined,
|
|
20678
|
-
valueMapping = _ref.valueMapping
|
|
20745
|
+
valueMapping = _ref.valueMapping,
|
|
20746
|
+
useValueAsData = _ref.useValueAsData;
|
|
20679
20747
|
var root = useStore();
|
|
20680
20748
|
var _useTranslation = useTranslation(),
|
|
20681
20749
|
t = _useTranslation.t;
|
|
@@ -20714,43 +20782,48 @@ function useSelectData (_ref) {
|
|
|
20714
20782
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20715
20783
|
gettingDefaultValue = _useState2[0],
|
|
20716
20784
|
setGettingDefaultValue = _useState2[1];
|
|
20785
|
+
|
|
20786
|
+
/** Tags + labelInValue=false: values are primitives; selection may mix Option (from load) and strings. */
|
|
20787
|
+
function tagsSelectedValue(s) {
|
|
20788
|
+
if (typeof s === 'string') return s;
|
|
20789
|
+
return s.value;
|
|
20790
|
+
}
|
|
20717
20791
|
useEffect(function () {
|
|
20718
20792
|
if (!filterServerSide && apiHandler.canReadList) {
|
|
20719
20793
|
setFetching(true);
|
|
20720
20794
|
apiHandler.readList(mapping, wholeData).then(function (body) {
|
|
20721
20795
|
var result = body === null || body === void 0 ? void 0 : body.data.map(function (d) {
|
|
20722
|
-
return {
|
|
20796
|
+
return typeof d === 'string' ? {
|
|
20797
|
+
label: d,
|
|
20798
|
+
value: d,
|
|
20799
|
+
data: d
|
|
20800
|
+
} : {
|
|
20723
20801
|
label: selectMapping !== null && selectMapping !== void 0 && selectMapping.label ? getCombinedValues(d, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label) : _typeof(d) == 'object' ? d._id : d,
|
|
20724
20802
|
value: selectMapping !== null && selectMapping !== void 0 && selectMapping.value ? d[selectMapping.value] : _typeof(d) == 'object' ? d._id : d,
|
|
20725
20803
|
data: d
|
|
20726
20804
|
};
|
|
20727
20805
|
});
|
|
20728
|
-
var
|
|
20729
|
-
if (values) fixedOptions = values.map(function (value) {
|
|
20730
|
-
return {
|
|
20731
|
-
"label": value,
|
|
20732
|
-
"value": value,
|
|
20733
|
-
"data": {
|
|
20734
|
-
"id": value
|
|
20735
|
-
}
|
|
20736
|
-
}; // room fixed scenenames (id for map)
|
|
20737
|
-
});
|
|
20738
|
-
var opts = [].concat(_toConsumableArray(fixedOptions), _toConsumableArray(result.sort(function (a, b) {
|
|
20806
|
+
var opts = result.sort(function (a, b) {
|
|
20739
20807
|
return a.label.localeCompare(b.label);
|
|
20740
|
-
})
|
|
20808
|
+
});
|
|
20741
20809
|
setOptions(opts);
|
|
20742
20810
|
setInitOptions(opts);
|
|
20743
20811
|
setFetching(false);
|
|
20744
20812
|
});
|
|
20745
20813
|
} else if (values) {
|
|
20746
|
-
|
|
20814
|
+
var result = values.map(function (v) {
|
|
20747
20815
|
return {
|
|
20748
|
-
label: v,
|
|
20749
|
-
value: v,
|
|
20816
|
+
label: selectMapping !== null && selectMapping !== void 0 && selectMapping.label ? getCombinedValues(v, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label) : _typeof(v) == 'object' ? v._id : v,
|
|
20817
|
+
value: selectMapping !== null && selectMapping !== void 0 && selectMapping.value ? v[selectMapping.value] : _typeof(v) == 'object' ? v._id : v,
|
|
20750
20818
|
data: v,
|
|
20751
20819
|
disabled: false
|
|
20752
20820
|
};
|
|
20753
|
-
})
|
|
20821
|
+
});
|
|
20822
|
+
var opts = result.sort(function (a, b) {
|
|
20823
|
+
return String(a.label).localeCompare(String(b.label));
|
|
20824
|
+
});
|
|
20825
|
+
setOptions(opts);
|
|
20826
|
+
setInitOptions(opts);
|
|
20754
20827
|
} else if (hardOptions) {
|
|
20755
20828
|
setOptions(_toConsumableArray(hardOptions.map(function (v) {
|
|
20756
20829
|
return {
|
|
@@ -20772,14 +20845,23 @@ function useSelectData (_ref) {
|
|
|
20772
20845
|
setSelected([defaultValue]);
|
|
20773
20846
|
}
|
|
20774
20847
|
}, [defaultValue]);
|
|
20848
|
+
var findLabelInValues = function findLabelInValues(d) {
|
|
20849
|
+
var _found$label;
|
|
20850
|
+
var found = values === null || values === void 0 ? void 0 : values.find(function (v) {
|
|
20851
|
+
var val = selectMapping !== null && selectMapping !== void 0 && selectMapping.value && _typeof(v) == 'object' ? v[selectMapping.value] : _typeof(v) == 'object' ? v._id : v;
|
|
20852
|
+
return val == d;
|
|
20853
|
+
});
|
|
20854
|
+
if (!found) return undefined;
|
|
20855
|
+
return selectMapping !== null && selectMapping !== void 0 && selectMapping.label && _typeof(found) == 'object' ? getCombinedValues(found, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label) : _typeof(found) == 'object' ? (_found$label = found.label) !== null && _found$label !== void 0 ? _found$label : found._id : found;
|
|
20856
|
+
};
|
|
20775
20857
|
function doSetOptions() {
|
|
20776
20858
|
return _doSetOptions.apply(this, arguments);
|
|
20777
20859
|
}
|
|
20778
20860
|
function _doSetOptions() {
|
|
20779
20861
|
_doSetOptions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
20780
|
-
var newData, initData, value,
|
|
20781
|
-
return _regeneratorRuntime.wrap(function _callee2$(
|
|
20782
|
-
while (1) switch (
|
|
20862
|
+
var newData, initData, value, emails, optionByValue, _iterator2, _step2, _loop, optionsList, opt, _value$, _flow$value$0$value, _value$2, missingFields, flowData, _defaultValue2, changedData;
|
|
20863
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
20864
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
20783
20865
|
case 0:
|
|
20784
20866
|
newData = defaultValue;
|
|
20785
20867
|
if (data) {
|
|
@@ -20791,7 +20873,7 @@ function useSelectData (_ref) {
|
|
|
20791
20873
|
}) : data;
|
|
20792
20874
|
}
|
|
20793
20875
|
if (!(newData != undefined && (!Array.isArray(newData) || newData.length != 0))) {
|
|
20794
|
-
|
|
20876
|
+
_context3.next = 51;
|
|
20795
20877
|
break;
|
|
20796
20878
|
}
|
|
20797
20879
|
if (initalValue == undefined) {
|
|
@@ -20799,54 +20881,123 @@ function useSelectData (_ref) {
|
|
|
20799
20881
|
}
|
|
20800
20882
|
initData = Array.isArray(newData) ? newData : [newData];
|
|
20801
20883
|
value = initData.map(function (d) {
|
|
20802
|
-
var _d$data, _d$_id, _d$selectMapping$valu, _d$data2,
|
|
20884
|
+
var _d$data, _d$_id, _findLabelInValues, _d$selectMapping$valu, _d$data2, _ref4, _d$value, _d$data3;
|
|
20803
20885
|
return {
|
|
20804
|
-
label:
|
|
20805
|
-
value:
|
|
20886
|
+
label: selectMapping !== null && selectMapping !== void 0 && selectMapping.label && _typeof(d) == 'object' ? getCombinedValues((_d$data = d === null || d === void 0 ? void 0 : d.data) !== null && _d$data !== void 0 ? _d$data : d, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label) : _typeof(d) == 'object' ? (_d$_id = d._id) !== null && _d$_id !== void 0 ? _d$_id : d.label : (_findLabelInValues = findLabelInValues(d)) !== null && _findLabelInValues !== void 0 ? _findLabelInValues : translationPrefix ? t(translationPrefix + '.' + d) : d,
|
|
20887
|
+
value: selectMapping !== null && selectMapping !== void 0 && selectMapping.value && _typeof(d) == 'object' ? (_d$selectMapping$valu = d === null || d === void 0 ? void 0 : d[selectMapping.value]) !== null && _d$selectMapping$valu !== void 0 ? _d$selectMapping$valu : d === null || d === void 0 || (_d$data2 = d.data) === null || _d$data2 === void 0 ? void 0 : _d$data2[selectMapping.value] : _typeof(d) == 'object' ? (_ref4 = (_d$value = d === null || d === void 0 ? void 0 : d.value) !== null && _d$value !== void 0 ? _d$value : d === null || d === void 0 || (_d$data3 = d.data) === null || _d$data3 === void 0 ? void 0 : _d$data3.value) !== null && _ref4 !== void 0 ? _ref4 : d === null || d === void 0 ? void 0 : d._id : d,
|
|
20806
20888
|
data: d,
|
|
20807
20889
|
disabled: false
|
|
20808
20890
|
};
|
|
20809
20891
|
});
|
|
20810
|
-
if (!(apiInterface && typeof initData[0] ==
|
|
20811
|
-
|
|
20892
|
+
if (!(apiInterface && typeof initData[0] == 'string')) {
|
|
20893
|
+
_context3.next = 34;
|
|
20812
20894
|
break;
|
|
20813
20895
|
}
|
|
20814
|
-
|
|
20815
|
-
|
|
20816
|
-
|
|
20817
|
-
|
|
20818
|
-
|
|
20819
|
-
|
|
20896
|
+
if (!(mode === 'tags' && initData.length > 1)) {
|
|
20897
|
+
_context3.next = 30;
|
|
20898
|
+
break;
|
|
20899
|
+
}
|
|
20900
|
+
emails = initData;
|
|
20901
|
+
optionByValue = new Map();
|
|
20902
|
+
_iterator2 = _createForOfIteratorHelper$l(emails);
|
|
20903
|
+
_context3.prev = 11;
|
|
20904
|
+
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
20905
|
+
var email, list, opt;
|
|
20906
|
+
return _regeneratorRuntime.wrap(function _loop$(_context2) {
|
|
20907
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
20908
|
+
case 0:
|
|
20909
|
+
email = _step2.value;
|
|
20910
|
+
_context2.next = 3;
|
|
20911
|
+
return loadOptions(email);
|
|
20912
|
+
case 3:
|
|
20913
|
+
list = _context2.sent;
|
|
20914
|
+
opt = list === null || list === void 0 ? void 0 : list.find(function (o) {
|
|
20915
|
+
return String(o.value) === String(email);
|
|
20916
|
+
});
|
|
20917
|
+
if (opt) {
|
|
20918
|
+
optionByValue.set(String(opt.value), opt);
|
|
20919
|
+
}
|
|
20920
|
+
case 6:
|
|
20921
|
+
case "end":
|
|
20922
|
+
return _context2.stop();
|
|
20923
|
+
}
|
|
20924
|
+
}, _loop);
|
|
20925
|
+
});
|
|
20926
|
+
_iterator2.s();
|
|
20927
|
+
case 14:
|
|
20928
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
20929
|
+
_context3.next = 18;
|
|
20930
|
+
break;
|
|
20931
|
+
}
|
|
20932
|
+
return _context3.delegateYield(_loop(), "t0", 16);
|
|
20933
|
+
case 16:
|
|
20934
|
+
_context3.next = 14;
|
|
20935
|
+
break;
|
|
20936
|
+
case 18:
|
|
20937
|
+
_context3.next = 23;
|
|
20938
|
+
break;
|
|
20939
|
+
case 20:
|
|
20940
|
+
_context3.prev = 20;
|
|
20941
|
+
_context3.t1 = _context3["catch"](11);
|
|
20942
|
+
_iterator2.e(_context3.t1);
|
|
20943
|
+
case 23:
|
|
20944
|
+
_context3.prev = 23;
|
|
20945
|
+
_iterator2.f();
|
|
20946
|
+
return _context3.finish(23);
|
|
20947
|
+
case 26:
|
|
20948
|
+
setOptions(function (prev) {
|
|
20949
|
+
var m = new Map();
|
|
20950
|
+
prev.forEach(function (o) {
|
|
20951
|
+
return m.set(String(o.value), o);
|
|
20952
|
+
});
|
|
20953
|
+
optionByValue.forEach(function (o, k) {
|
|
20954
|
+
return m.set(k, o);
|
|
20955
|
+
});
|
|
20956
|
+
return Array.from(m.values());
|
|
20957
|
+
});
|
|
20958
|
+
// labelInValue=false: value is the raw token list; options supply member labels ("Name (email)")
|
|
20959
|
+
value = emails.map(String);
|
|
20960
|
+
_context3.next = 34;
|
|
20961
|
+
break;
|
|
20962
|
+
case 30:
|
|
20963
|
+
_context3.next = 32;
|
|
20964
|
+
return loadOptions(initData[0]);
|
|
20965
|
+
case 32:
|
|
20966
|
+
optionsList = _context3.sent;
|
|
20967
|
+
if (optionsList) {
|
|
20968
|
+
opt = optionsList.find(function (o) {
|
|
20820
20969
|
return o.value == initData[0];
|
|
20821
20970
|
});
|
|
20822
|
-
|
|
20823
|
-
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
|
|
20971
|
+
if (opt) {
|
|
20972
|
+
value = [{
|
|
20973
|
+
label: opt.label,
|
|
20974
|
+
value: opt.value,
|
|
20975
|
+
data: useValueAsData ? opt.value : opt.data,
|
|
20976
|
+
disabled: false
|
|
20977
|
+
}];
|
|
20978
|
+
}
|
|
20828
20979
|
}
|
|
20829
|
-
case
|
|
20980
|
+
case 34:
|
|
20830
20981
|
if (!(flow && initData.length)) {
|
|
20831
|
-
|
|
20982
|
+
_context3.next = 48;
|
|
20832
20983
|
break;
|
|
20833
20984
|
}
|
|
20834
20985
|
if (!(mode != 'single')) {
|
|
20835
|
-
|
|
20986
|
+
_context3.next = 37;
|
|
20836
20987
|
break;
|
|
20837
20988
|
}
|
|
20838
20989
|
throw new Error('Flow is only implemented for single mode');
|
|
20839
|
-
case
|
|
20990
|
+
case 37:
|
|
20840
20991
|
missingFields = verifySelection((_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.value);
|
|
20841
20992
|
if (!missingFields.length) {
|
|
20842
|
-
|
|
20993
|
+
_context3.next = 43;
|
|
20843
20994
|
break;
|
|
20844
20995
|
}
|
|
20845
20996
|
onError === null || onError === void 0 || onError((missingFields === null || missingFields === void 0 ? void 0 : missingFields.join(', ')) + ' not set or wrong value');
|
|
20846
|
-
return
|
|
20847
|
-
case
|
|
20997
|
+
return _context3.abrupt("return");
|
|
20998
|
+
case 43:
|
|
20848
20999
|
onError === null || onError === void 0 || onError('');
|
|
20849
|
-
case
|
|
21000
|
+
case 44:
|
|
20850
21001
|
flowData = (flow === null || flow === void 0 || (_flow$value$0$value = flow[(_value$2 = value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.value]) === null || _flow$value$0$value === void 0 ? void 0 : _flow$value$0$value.map(function (opt) {
|
|
20851
21002
|
return {
|
|
20852
21003
|
label: translationPrefix ? t(translationPrefix + '.' + opt) : opt.toString(),
|
|
@@ -20865,34 +21016,34 @@ function useSelectData (_ref) {
|
|
|
20865
21016
|
});
|
|
20866
21017
|
}
|
|
20867
21018
|
setOptions(_toConsumableArray(flowData));
|
|
20868
|
-
case
|
|
21019
|
+
case 48:
|
|
20869
21020
|
changedData = newData && data && JSON.stringify(newData) == JSON.stringify(data) ? data : newData;
|
|
20870
21021
|
onChange === null || onChange === void 0 || onChange(changedData, applyDefaultValue, defaultValue);
|
|
20871
21022
|
setSelected(value);
|
|
20872
|
-
case
|
|
21023
|
+
case 51:
|
|
20873
21024
|
case "end":
|
|
20874
|
-
return
|
|
21025
|
+
return _context3.stop();
|
|
20875
21026
|
}
|
|
20876
|
-
}, _callee2);
|
|
21027
|
+
}, _callee2, null, [[11, 20, 23, 26]]);
|
|
20877
21028
|
}));
|
|
20878
21029
|
return _doSetOptions.apply(this, arguments);
|
|
20879
21030
|
}
|
|
20880
21031
|
var loadOptions = /*#__PURE__*/function () {
|
|
20881
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(value
|
|
20882
|
-
var fetchId, newOptions,
|
|
21032
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(value) {
|
|
21033
|
+
var fetchId, newOptions, _selectMapping$search, serverSideParams;
|
|
20883
21034
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
20884
21035
|
while (1) switch (_context.prev = _context.next) {
|
|
20885
21036
|
case 0:
|
|
20886
21037
|
fetchRef.current += 1;
|
|
20887
21038
|
fetchId = fetchRef.current;
|
|
20888
21039
|
if (!filterServerSide) {
|
|
20889
|
-
_context.next =
|
|
21040
|
+
_context.next = 10;
|
|
20890
21041
|
break;
|
|
20891
21042
|
}
|
|
20892
21043
|
setFetching(true);
|
|
20893
21044
|
serverSideParams = {
|
|
20894
|
-
filters: selectMapping !== null && selectMapping !== void 0 && selectMapping.searchField ? (
|
|
20895
|
-
return _objectSpread$
|
|
21045
|
+
filters: selectMapping !== null && selectMapping !== void 0 && selectMapping.searchField ? (_selectMapping$search = selectMapping.searchField) === null || _selectMapping$search === void 0 ? void 0 : _selectMapping$search.reduce(function (filter, field) {
|
|
21046
|
+
return _objectSpread$1a(_objectSpread$1a({}, filter), value !== undefined ? _defineProperty({}, field.field, [value, field.filter, true]) : {});
|
|
20896
21047
|
}, {}) : {
|
|
20897
21048
|
_id: [value, 'contains']
|
|
20898
21049
|
},
|
|
@@ -20903,7 +21054,12 @@ function useSelectData (_ref) {
|
|
|
20903
21054
|
_context.next = 7;
|
|
20904
21055
|
return apiHandler.readList(selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.prefilterMapping, wholeData, serverSideParams, undefined, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.prefilter).then(function (body) {
|
|
20905
21056
|
return (body === null || body === void 0 ? void 0 : body.data.map(function (data) {
|
|
20906
|
-
return {
|
|
21057
|
+
return typeof data === 'string' ? {
|
|
21058
|
+
label: data,
|
|
21059
|
+
value: data,
|
|
21060
|
+
disabled: false,
|
|
21061
|
+
data: data
|
|
21062
|
+
} : {
|
|
20907
21063
|
label: selectMapping !== null && selectMapping !== void 0 && selectMapping.label ? getCombinedValues(data, selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.label) : data._id,
|
|
20908
21064
|
value: selectMapping !== null && selectMapping !== void 0 && selectMapping.value ? data[selectMapping.value] : data._id,
|
|
20909
21065
|
disabled: false,
|
|
@@ -20913,20 +21069,9 @@ function useSelectData (_ref) {
|
|
|
20913
21069
|
});
|
|
20914
21070
|
case 7:
|
|
20915
21071
|
newOptions = _context.sent;
|
|
20916
|
-
|
|
20917
|
-
if (values) fixedOptions = values.map(function (value) {
|
|
20918
|
-
return {
|
|
20919
|
-
"label": value,
|
|
20920
|
-
"value": value,
|
|
20921
|
-
"data": {
|
|
20922
|
-
"id": value
|
|
20923
|
-
}
|
|
20924
|
-
}; // room fixed scenenames (id for map)
|
|
20925
|
-
});
|
|
20926
|
-
newOptions = [].concat(_toConsumableArray(fixedOptions), _toConsumableArray(newOptions));
|
|
20927
|
-
_context.next = 15;
|
|
21072
|
+
_context.next = 12;
|
|
20928
21073
|
break;
|
|
20929
|
-
case
|
|
21074
|
+
case 10:
|
|
20930
21075
|
newOptions = initOptions.filter(function (opt) {
|
|
20931
21076
|
var _value$toLocaleLowerC;
|
|
20932
21077
|
return opt.label.toLocaleLowerCase().includes((_value$toLocaleLowerC = value === null || value === void 0 ? void 0 : value.toLocaleLowerCase()) !== null && _value$toLocaleLowerC !== void 0 ? _value$toLocaleLowerC : '');
|
|
@@ -20939,23 +21084,23 @@ function useSelectData (_ref) {
|
|
|
20939
21084
|
value: value
|
|
20940
21085
|
}];
|
|
20941
21086
|
}
|
|
20942
|
-
case
|
|
21087
|
+
case 12:
|
|
20943
21088
|
if (!(fetchId !== fetchRef.current)) {
|
|
20944
|
-
_context.next =
|
|
21089
|
+
_context.next = 14;
|
|
20945
21090
|
break;
|
|
20946
21091
|
}
|
|
20947
21092
|
return _context.abrupt("return");
|
|
20948
|
-
case
|
|
21093
|
+
case 14:
|
|
20949
21094
|
setOptions(newOptions);
|
|
20950
21095
|
setFetching(false);
|
|
20951
21096
|
return _context.abrupt("return", newOptions);
|
|
20952
|
-
case
|
|
21097
|
+
case 17:
|
|
20953
21098
|
case "end":
|
|
20954
21099
|
return _context.stop();
|
|
20955
21100
|
}
|
|
20956
21101
|
}, _callee);
|
|
20957
21102
|
}));
|
|
20958
|
-
return function loadOptions(_x
|
|
21103
|
+
return function loadOptions(_x) {
|
|
20959
21104
|
return _ref2.apply(this, arguments);
|
|
20960
21105
|
};
|
|
20961
21106
|
}();
|
|
@@ -21003,19 +21148,22 @@ function useSelectData (_ref) {
|
|
|
21003
21148
|
|
|
21004
21149
|
//state.configuration.dependencyRule.
|
|
21005
21150
|
var onSelect = function onSelect(data) {
|
|
21006
|
-
//! tags works without labelInValue;
|
|
21007
|
-
//because of a error in the typedefinition we have to cast it here
|
|
21151
|
+
//! tags works without labelInValue; Ant Design passes the chosen option value as a string (not {label,value})
|
|
21008
21152
|
var newSelected = data;
|
|
21009
21153
|
var sel = selected;
|
|
21154
|
+
var lookupVal = typeof data === 'string' ? data : newSelected === null || newSelected === void 0 ? void 0 : newSelected.value;
|
|
21010
21155
|
var option = options.find(function (o) {
|
|
21011
|
-
return o.value ==
|
|
21156
|
+
return o.value == lookupVal;
|
|
21012
21157
|
});
|
|
21158
|
+
if (option && mode === 'tags') {
|
|
21159
|
+
var next = [].concat(_toConsumableArray(sel.map(tagsSelectedValue)), [option.value]);
|
|
21160
|
+
onChange === null || onChange === void 0 || onChange(next, applyDefaultValue, defaultValue);
|
|
21161
|
+
setSelected(next);
|
|
21162
|
+
return;
|
|
21163
|
+
}
|
|
21013
21164
|
if (option) {
|
|
21014
|
-
if (mode == 'tags') {
|
|
21015
|
-
throw new Error('select with options is not yet supported for mode tags');
|
|
21016
|
-
}
|
|
21017
21165
|
if (mode == 'single') {
|
|
21018
|
-
var _option$data;
|
|
21166
|
+
var _option$value, _option$data;
|
|
21019
21167
|
if (flow) {
|
|
21020
21168
|
var _flow$option$value;
|
|
21021
21169
|
var missingFields = verifySelection(option.value);
|
|
@@ -21045,21 +21193,22 @@ function useSelectData (_ref) {
|
|
|
21045
21193
|
setOptions(_toConsumableArray(flowData));
|
|
21046
21194
|
}
|
|
21047
21195
|
//if it is single mode there can always only be one selected or one new entry
|
|
21048
|
-
onChange === null || onChange === void 0 || onChange((_option$data = option === null || option === void 0 ? void 0 : option.data) !== null && _option$data !== void 0 ? _option$data : option, applyDefaultValue, defaultValue);
|
|
21196
|
+
onChange === null || onChange === void 0 || onChange(useValueAsData ? (_option$value = option === null || option === void 0 ? void 0 : option.value) !== null && _option$value !== void 0 ? _option$value : option : (_option$data = option === null || option === void 0 ? void 0 : option.data) !== null && _option$data !== void 0 ? _option$data : option, applyDefaultValue, defaultValue);
|
|
21049
21197
|
setSelected([option]);
|
|
21050
21198
|
} else {
|
|
21051
|
-
|
|
21199
|
+
// multiple mode (tags with a matching option returns above)
|
|
21200
|
+
var selOptions = sel;
|
|
21201
|
+
var selectedList = [].concat(_toConsumableArray(selOptions), [option]);
|
|
21052
21202
|
setSelected(selectedList);
|
|
21053
21203
|
onChange === null || onChange === void 0 || onChange(selectedList.map(function (s) {
|
|
21054
|
-
return s.data;
|
|
21204
|
+
return useValueAsData ? s.value : s.data;
|
|
21055
21205
|
}), applyDefaultValue, defaultValue);
|
|
21056
21206
|
}
|
|
21057
21207
|
} else {
|
|
21058
21208
|
if (mode == 'tags' && typeof data === 'string') {
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
setSelected([].concat(_toConsumableArray(sel), [data]));
|
|
21209
|
+
var _next = [].concat(_toConsumableArray(sel.map(tagsSelectedValue)), [data]);
|
|
21210
|
+
onChange === null || onChange === void 0 || onChange(_next, applyDefaultValue, defaultValue);
|
|
21211
|
+
setSelected(_next);
|
|
21063
21212
|
} else {
|
|
21064
21213
|
throw new Error('select without options is not yet supported for modes other than tags');
|
|
21065
21214
|
}
|
|
@@ -21070,7 +21219,7 @@ function useSelectData (_ref) {
|
|
|
21070
21219
|
// at the 2. useEffect the options are loaded and set in state so we can set the first option
|
|
21071
21220
|
useEffect(function () {
|
|
21072
21221
|
if (useFirstValueAsDefault && !selected.length) {
|
|
21073
|
-
loadOptions(undefined
|
|
21222
|
+
loadOptions(undefined).then(function () {
|
|
21074
21223
|
return setGettingDefaultValue(true);
|
|
21075
21224
|
});
|
|
21076
21225
|
}
|
|
@@ -21079,28 +21228,32 @@ function useSelectData (_ref) {
|
|
|
21079
21228
|
if (gettingDefaultValue && options[0]) onSelect(options[0]);
|
|
21080
21229
|
}, [gettingDefaultValue]);
|
|
21081
21230
|
var onFocus = function onFocus() {
|
|
21082
|
-
loadOptions(undefined
|
|
21231
|
+
loadOptions(undefined);
|
|
21083
21232
|
};
|
|
21084
21233
|
var onRemove = function onRemove(data) {
|
|
21085
|
-
//because of a error in the typedefinition we have to cast it here
|
|
21086
21234
|
var removed = data;
|
|
21087
21235
|
var sel = selected;
|
|
21088
21236
|
var newSelected;
|
|
21089
|
-
if (removed) {
|
|
21237
|
+
if (removed !== undefined && removed !== null) {
|
|
21238
|
+
var removedVal = typeof removed === 'string' ? removed : removed.value;
|
|
21090
21239
|
var index = sel.findIndex(function (s) {
|
|
21091
|
-
return s
|
|
21240
|
+
return tagsSelectedValue(s) == removedVal;
|
|
21092
21241
|
});
|
|
21093
21242
|
newSelected = _toConsumableArray(sel);
|
|
21094
|
-
|
|
21243
|
+
if (index >= 0) {
|
|
21244
|
+
newSelected.splice(index, 1);
|
|
21245
|
+
}
|
|
21095
21246
|
} else {
|
|
21096
21247
|
newSelected = [];
|
|
21097
21248
|
}
|
|
21098
21249
|
setSelected(newSelected);
|
|
21099
21250
|
if (mode == 'single') {
|
|
21100
21251
|
onChange === null || onChange === void 0 || onChange(undefined, applyDefaultValue, defaultValue);
|
|
21252
|
+
} else if (mode === 'tags') {
|
|
21253
|
+
onChange === null || onChange === void 0 || onChange(newSelected.map(tagsSelectedValue), applyDefaultValue, defaultValue);
|
|
21101
21254
|
} else {
|
|
21102
21255
|
onChange === null || onChange === void 0 || onChange(newSelected.map(function (s) {
|
|
21103
|
-
return s.data;
|
|
21256
|
+
return useValueAsData ? s.value : s.data;
|
|
21104
21257
|
}), applyDefaultValue, defaultValue);
|
|
21105
21258
|
}
|
|
21106
21259
|
};
|
|
@@ -21142,7 +21295,8 @@ var SelectWrapper = function SelectWrapper(_ref) {
|
|
|
21142
21295
|
applyDefaultValue = _ref.applyDefaultValue,
|
|
21143
21296
|
useFirstValueAsDefault = _ref.useFirstValueAsDefault,
|
|
21144
21297
|
canSetToUndefined = _ref.canSetToUndefined,
|
|
21145
|
-
valueMapping = _ref.valueMapping
|
|
21298
|
+
valueMapping = _ref.valueMapping,
|
|
21299
|
+
useValueAsData = _ref.useValueAsData;
|
|
21146
21300
|
var state = useSelectData({
|
|
21147
21301
|
onChange: onChange,
|
|
21148
21302
|
onError: onError,
|
|
@@ -21162,7 +21316,8 @@ var SelectWrapper = function SelectWrapper(_ref) {
|
|
|
21162
21316
|
applyDefaultValue: applyDefaultValue,
|
|
21163
21317
|
useFirstValueAsDefault: useFirstValueAsDefault,
|
|
21164
21318
|
canSetToUndefined: canSetToUndefined,
|
|
21165
|
-
valueMapping: valueMapping
|
|
21319
|
+
valueMapping: valueMapping,
|
|
21320
|
+
useValueAsData: useValueAsData
|
|
21166
21321
|
});
|
|
21167
21322
|
var _useTranslation = useTranslation(),
|
|
21168
21323
|
t = _useTranslation.t;
|
|
@@ -21201,8 +21356,8 @@ var buttonsWrapper$1 = "buttons-wrapper-7ebR9";
|
|
|
21201
21356
|
var css_248z$x = ".wrapper-WStAk {\n display: flex;\n flex-direction: column;\n}\n.header-wrapper-gWQuH {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-left: 64px;\n}\n\n.buttons-wrapper-7ebR9 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-grow: 1;\n}\n";
|
|
21202
21357
|
styleInject(css_248z$x);
|
|
21203
21358
|
|
|
21204
|
-
function ownKeys$
|
|
21205
|
-
function _objectSpread$
|
|
21359
|
+
function ownKeys$19(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; }
|
|
21360
|
+
function _objectSpread$19(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$19(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$19(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21206
21361
|
var LOG$a = getLogger('Backoffice', 'Translation Form');
|
|
21207
21362
|
function useTranslationHook (item, state) {
|
|
21208
21363
|
var root = useStore();
|
|
@@ -21335,7 +21490,7 @@ function useTranslationHook (item, state) {
|
|
|
21335
21490
|
case 0:
|
|
21336
21491
|
_context2.next = 2;
|
|
21337
21492
|
return apiHandler.create({
|
|
21338
|
-
locales: _objectSpread$
|
|
21493
|
+
locales: _objectSpread$19({
|
|
21339
21494
|
de: {},
|
|
21340
21495
|
it: {},
|
|
21341
21496
|
fr: {},
|
|
@@ -21384,8 +21539,8 @@ function useTranslationHook (item, state) {
|
|
|
21384
21539
|
};
|
|
21385
21540
|
}
|
|
21386
21541
|
|
|
21387
|
-
function ownKeys$
|
|
21388
|
-
function _objectSpread$
|
|
21542
|
+
function ownKeys$18(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; }
|
|
21543
|
+
function _objectSpread$18(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$18(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$18(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21389
21544
|
var Translation = function Translation(_ref) {
|
|
21390
21545
|
var item = _ref.item,
|
|
21391
21546
|
state = _ref.state,
|
|
@@ -21436,7 +21591,7 @@ var Translation = function Translation(_ref) {
|
|
|
21436
21591
|
var hidden = state.getIsHidden(i, data);
|
|
21437
21592
|
var newAbsoluteName = absoluteName !== '' ? [].concat(_toConsumableArray(Array.isArray(absoluteName) ? absoluteName : [absoluteName]), _toConsumableArray(n)) : n;
|
|
21438
21593
|
return /*#__PURE__*/jsx(React.Fragment, {
|
|
21439
|
-
children: ['subTitle', 'array'].includes(i.type) ? getElement(_objectSpread$
|
|
21594
|
+
children: ['subTitle', 'array'].includes(i.type) ? getElement(_objectSpread$18(_objectSpread$18({}, i), {}, {
|
|
21440
21595
|
name: n
|
|
21441
21596
|
}), setCanSave, state, newAbsoluteName, state.onInputChanged, onError, root, form, hidden, currentLang) : /*#__PURE__*/jsx(Form$2.Item, {
|
|
21442
21597
|
id: idx.toString(),
|
|
@@ -21449,7 +21604,7 @@ var Translation = function Translation(_ref) {
|
|
|
21449
21604
|
validateStatus: !!state.fieldErrors[n.toString()] ? 'error' : undefined,
|
|
21450
21605
|
help: (_state$fieldErrors$n$ = state.fieldErrors[n.toString()]) !== null && _state$fieldErrors$n$ !== void 0 ? _state$fieldErrors$n$ : i.helpText,
|
|
21451
21606
|
hidden: hidden,
|
|
21452
|
-
children: getElement(_objectSpread$
|
|
21607
|
+
children: getElement(_objectSpread$18(_objectSpread$18({}, i), {}, {
|
|
21453
21608
|
name: n
|
|
21454
21609
|
}), setCanSave, state, newAbsoluteName, state.onInputChanged, onError, root, form, hidden)
|
|
21455
21610
|
})
|
|
@@ -21936,8 +22091,8 @@ function deltaFromColors(mainHex, valueHex) {
|
|
|
21936
22091
|
return avg;
|
|
21937
22092
|
}
|
|
21938
22093
|
|
|
21939
|
-
function ownKeys$
|
|
21940
|
-
function _objectSpread$
|
|
22094
|
+
function ownKeys$17(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; }
|
|
22095
|
+
function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$17(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$17(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21941
22096
|
function FormSlider(_ref) {
|
|
21942
22097
|
var item = _ref.item,
|
|
21943
22098
|
disabled = _ref.disabled,
|
|
@@ -21971,7 +22126,7 @@ function FormSlider(_ref) {
|
|
|
21971
22126
|
children: t('backoffice.form.slider.apiDefaultHint', {
|
|
21972
22127
|
defaultValue: 'Not set (Gemini API default, typically 1). Move the slider to set.'
|
|
21973
22128
|
})
|
|
21974
|
-
}) : null, /*#__PURE__*/jsx(Slider, _objectSpread$
|
|
22129
|
+
}) : null, /*#__PURE__*/jsx(Slider, _objectSpread$17(_objectSpread$17({
|
|
21975
22130
|
min: item.min,
|
|
21976
22131
|
max: item.max,
|
|
21977
22132
|
step: item.step
|
|
@@ -22002,8 +22157,8 @@ function FormSlider(_ref) {
|
|
|
22002
22157
|
function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
22003
22158
|
function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$k(r, a) : void 0; } }
|
|
22004
22159
|
function _arrayLikeToArray$k(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22005
|
-
function ownKeys$
|
|
22006
|
-
function _objectSpread$
|
|
22160
|
+
function ownKeys$16(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; }
|
|
22161
|
+
function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$16(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$16(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22007
22162
|
function getElement(item, setCanSave, state, absoluteName, _onChange, _onError, root, form, hidden, postFixName) {
|
|
22008
22163
|
var _isReadonly, _state$hiddenRequired, _state$data$_id, _state$data;
|
|
22009
22164
|
if (hidden) return /*#__PURE__*/jsx(Fragment, {});
|
|
@@ -22022,6 +22177,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
22022
22177
|
allowCreate: item.allowCreate,
|
|
22023
22178
|
flow: item.flow,
|
|
22024
22179
|
translationPrefix: item.translationPrefix,
|
|
22180
|
+
useValueAsData: item.valueAsData,
|
|
22025
22181
|
values: item.values,
|
|
22026
22182
|
search: item.search,
|
|
22027
22183
|
disabled: disabled,
|
|
@@ -22038,7 +22194,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
22038
22194
|
}
|
|
22039
22195
|
});
|
|
22040
22196
|
case 'selectSimple':
|
|
22041
|
-
return /*#__PURE__*/jsx(SimpleSelect, _objectSpread$
|
|
22197
|
+
return /*#__PURE__*/jsx(SimpleSelect, _objectSpread$16(_objectSpread$16({}, item), {}, {
|
|
22042
22198
|
disabled: disabled,
|
|
22043
22199
|
onChange: function onChange(value) {
|
|
22044
22200
|
_onChange(absoluteName, value);
|
|
@@ -22261,7 +22417,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
22261
22417
|
value: item.value,
|
|
22262
22418
|
options: item.options.map(function (o) {
|
|
22263
22419
|
var _o$disabled;
|
|
22264
|
-
return _objectSpread$
|
|
22420
|
+
return _objectSpread$16(_objectSpread$16({}, o), {}, {
|
|
22265
22421
|
disabled: (_o$disabled = o.disabled) === null || _o$disabled === void 0 ? void 0 : _o$disabled.call(o, state.data)
|
|
22266
22422
|
});
|
|
22267
22423
|
}),
|
|
@@ -22282,7 +22438,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
22282
22438
|
},
|
|
22283
22439
|
icon: item.icon,
|
|
22284
22440
|
callback: function callback(data) {
|
|
22285
|
-
return form === null || form === void 0 ? void 0 : form.setFieldsValue(_objectSpread$
|
|
22441
|
+
return form === null || form === void 0 ? void 0 : form.setFieldsValue(_objectSpread$16(_objectSpread$16({}, state.data), data));
|
|
22286
22442
|
}
|
|
22287
22443
|
});
|
|
22288
22444
|
case 'media':
|
|
@@ -22320,7 +22476,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
22320
22476
|
var DisplayInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
22321
22477
|
var _useTranslation = useTranslation(),
|
|
22322
22478
|
t = _useTranslation.t;
|
|
22323
|
-
return /*#__PURE__*/jsx(Input$1, _objectSpread$
|
|
22479
|
+
return /*#__PURE__*/jsx(Input$1, _objectSpread$16(_objectSpread$16({}, props), {}, {
|
|
22324
22480
|
ref: ref,
|
|
22325
22481
|
disabled: true,
|
|
22326
22482
|
value: t(props.translationPrefix + '.' + props.value)
|
|
@@ -22339,8 +22495,8 @@ function isReadonly(item, data) {
|
|
|
22339
22495
|
return false;
|
|
22340
22496
|
}
|
|
22341
22497
|
|
|
22342
|
-
function ownKeys$
|
|
22343
|
-
function _objectSpread$
|
|
22498
|
+
function ownKeys$15(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; }
|
|
22499
|
+
function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$15(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$15(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22344
22500
|
function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
22345
22501
|
function _unsupportedIterableToArray$j(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$j(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$j(r, a) : void 0; } }
|
|
22346
22502
|
function _arrayLikeToArray$j(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -22390,13 +22546,13 @@ var Presets = function Presets(_ref) {
|
|
|
22390
22546
|
} finally {
|
|
22391
22547
|
_iterator.f();
|
|
22392
22548
|
}
|
|
22393
|
-
var data = _objectSpread$
|
|
22549
|
+
var data = _objectSpread$15(_objectSpread$15({}, form.getFieldsValue(names)), {}, {
|
|
22394
22550
|
newPresetName: newPresetName
|
|
22395
22551
|
});
|
|
22396
22552
|
data.dpi = parseInt(data.dpi);
|
|
22397
22553
|
data.organization = root.getGlobalValue('organizationId');
|
|
22398
22554
|
apiHandler.create({}, state.configuration.createPresetMapping, data);
|
|
22399
|
-
var dt = _objectSpread$
|
|
22555
|
+
var dt = _objectSpread$15(_objectSpread$15({}, form.getFieldsValue(names)), {}, {
|
|
22400
22556
|
name: newPresetName
|
|
22401
22557
|
});
|
|
22402
22558
|
setPresets({
|
|
@@ -22492,8 +22648,8 @@ var Presets = function Presets(_ref) {
|
|
|
22492
22648
|
children: "Create"
|
|
22493
22649
|
}), /*#__PURE__*/jsx(Modal$2, {
|
|
22494
22650
|
title: "Create Preset",
|
|
22495
|
-
|
|
22496
|
-
onOk: function onOk(
|
|
22651
|
+
open: isModalVisible,
|
|
22652
|
+
onOk: function onOk() {
|
|
22497
22653
|
return savePreset();
|
|
22498
22654
|
},
|
|
22499
22655
|
onCancel: function onCancel() {
|
|
@@ -22530,8 +22686,8 @@ function ModalProgressBar(_ref) {
|
|
|
22530
22686
|
});
|
|
22531
22687
|
}
|
|
22532
22688
|
|
|
22533
|
-
function ownKeys$
|
|
22534
|
-
function _objectSpread$
|
|
22689
|
+
function ownKeys$14(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; }
|
|
22690
|
+
function _objectSpread$14(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$14(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$14(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22535
22691
|
function ItemSelector(_ref) {
|
|
22536
22692
|
var state = _ref.state,
|
|
22537
22693
|
setCanSave = _ref.setCanSave,
|
|
@@ -22548,7 +22704,7 @@ function ItemSelector(_ref) {
|
|
|
22548
22704
|
rules: state.getRules(itemSelector, state.data),
|
|
22549
22705
|
label: itemSelector.label ? t(itemSelector.label, itemSelector.label) : itemSelector.name,
|
|
22550
22706
|
valuePropName: itemSelector.type == 'checkbox' ? 'checked' : 'value',
|
|
22551
|
-
children: getElement(_objectSpread$
|
|
22707
|
+
children: getElement(_objectSpread$14(_objectSpread$14({}, itemSelector), {}, {
|
|
22552
22708
|
value: itemSelector.type == 'select' ? itemSelector.values[state.selectedItemsIndex[idx]] : undefined
|
|
22553
22709
|
}), setCanSave, state, itemSelector.name, state.onItemSelectorChanged, onErrorInternal)
|
|
22554
22710
|
}, itemSelector.name.toString());
|
|
@@ -22895,8 +23051,8 @@ function getLabel(item, t) {
|
|
|
22895
23051
|
}
|
|
22896
23052
|
var Form$1 = observer(/*#__PURE__*/React.forwardRef(FormWrapper$1));
|
|
22897
23053
|
|
|
22898
|
-
function ownKeys$
|
|
22899
|
-
function _objectSpread$
|
|
23054
|
+
function ownKeys$13(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; }
|
|
23055
|
+
function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$13(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$13(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22900
23056
|
function _createForOfIteratorHelper$i(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$i(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
22901
23057
|
function _unsupportedIterableToArray$i(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$i(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$i(r, a) : void 0; } }
|
|
22902
23058
|
function _arrayLikeToArray$i(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -23098,7 +23254,7 @@ function useRoleSelectorData (_ref) {
|
|
|
23098
23254
|
roles.forEach(function (r) {
|
|
23099
23255
|
//check if after the changes the role is selected
|
|
23100
23256
|
if (value.includes(r._id)) {
|
|
23101
|
-
var newValue = _objectSpread$
|
|
23257
|
+
var newValue = _objectSpread$13(_objectSpread$13({}, r), {}, {
|
|
23102
23258
|
selected: true
|
|
23103
23259
|
});
|
|
23104
23260
|
//add it to the new list as selected role
|
|
@@ -23134,7 +23290,7 @@ function useRoleSelectorData (_ref) {
|
|
|
23134
23290
|
}
|
|
23135
23291
|
}
|
|
23136
23292
|
} else {
|
|
23137
|
-
var _newValue = _objectSpread$
|
|
23293
|
+
var _newValue = _objectSpread$13(_objectSpread$13({}, r), {}, {
|
|
23138
23294
|
selected: false
|
|
23139
23295
|
});
|
|
23140
23296
|
//add it to the new list as unselected role
|
|
@@ -23338,7 +23494,7 @@ function _updateRoles() {
|
|
|
23338
23494
|
userRole = userRoles.find(function (r) {
|
|
23339
23495
|
return r._id == role._id;
|
|
23340
23496
|
});
|
|
23341
|
-
newRole = _objectSpread$
|
|
23497
|
+
newRole = _objectSpread$13({}, role);
|
|
23342
23498
|
if (userRole) {
|
|
23343
23499
|
newRole.selected = true;
|
|
23344
23500
|
newRole.inherited = userRole.inherited;
|
|
@@ -23558,7 +23714,7 @@ function _fetchOptions() {
|
|
|
23558
23714
|
case 4:
|
|
23559
23715
|
result = _context11.sent;
|
|
23560
23716
|
options = result.data.map(function (d) {
|
|
23561
|
-
return _objectSpread$
|
|
23717
|
+
return _objectSpread$13(_objectSpread$13({}, d), {}, {
|
|
23562
23718
|
label: d.displayName,
|
|
23563
23719
|
value: d._id,
|
|
23564
23720
|
isLeaf: !d.hasChildren
|
|
@@ -23662,8 +23818,8 @@ var infiniteScrollContainer = "infiniteScrollContainer-8G1wc";
|
|
|
23662
23818
|
var css_248z$v = ".permission-Button-XctsZ {\n position: relative;\n top: 25px;\n left: -30px;\n float: right;\n height: 20px;\n z-index: 1000;\n}\n.select-lzft- {\n width: 100%;\n}\n.loadingOption-qCkRw {\n margin-top: 11px;\n padding-left: 500px;\n}\n.scroller-lrdk9 {\n overflow: auto;\n flex: 1;\n min-height: 0;\n}\n\n.skeleton--xCI0 {\n padding-left: 25px;\n padding-bottom: 10px;\n}\n.filterField-1kU1O {\n display: flex;\n gap: 10px;\n}\n.filterField-1kU1O button {\n height: 32px;\n}\n.filterField-1kU1O div {\n height: 32px;\n}\n\n.parent-scroll-GmaL9 {\n overflow: hidden;\n padding: 24px;\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n.parent-NZJ3S {\n overflow: auto;\n padding: 24px;\n height: 100%;\n}\n\n.container--O28P {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n}\n\n.infiniteScrollContainer-8G1wc {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.infiniteScrollContainer-8G1wc .infinite-scroll-component__outerdiv {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.infiniteScrollContainer-8G1wc .infinite-scroll-component {\n flex: 1 !important;\n min-height: 0 !important;\n height: auto !important;\n display: flex !important;\n flex-direction: column !important;\n}\n";
|
|
23663
23819
|
styleInject(css_248z$v);
|
|
23664
23820
|
|
|
23665
|
-
function ownKeys$
|
|
23666
|
-
function _objectSpread$
|
|
23821
|
+
function ownKeys$12(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; }
|
|
23822
|
+
function _objectSpread$12(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$12(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$12(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23667
23823
|
function _createForOfIteratorHelper$h(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$h(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
23668
23824
|
function _unsupportedIterableToArray$h(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$h(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$h(r, a) : void 0; } }
|
|
23669
23825
|
function _arrayLikeToArray$h(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -23723,8 +23879,8 @@ function _generateCSV() {
|
|
|
23723
23879
|
break;
|
|
23724
23880
|
}
|
|
23725
23881
|
_context2.next = 21;
|
|
23726
|
-
return generateCSV(_objectSpread$
|
|
23727
|
-
mappingData: _objectSpread$
|
|
23882
|
+
return generateCSV(_objectSpread$12(_objectSpread$12({}, exportParams.children), {}, {
|
|
23883
|
+
mappingData: _objectSpread$12(_objectSpread$12({}, parent), {}, {
|
|
23728
23884
|
parentId: exportParams.mappingData._id
|
|
23729
23885
|
})
|
|
23730
23886
|
}), csvData);
|
|
@@ -23832,8 +23988,8 @@ function _downloadFile() {
|
|
|
23832
23988
|
return _downloadFile.apply(this, arguments);
|
|
23833
23989
|
}
|
|
23834
23990
|
|
|
23835
|
-
function ownKeys$
|
|
23836
|
-
function _objectSpread$
|
|
23991
|
+
function ownKeys$11(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; }
|
|
23992
|
+
function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$11(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$11(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23837
23993
|
function _createForOfIteratorHelper$g(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$g(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
23838
23994
|
function _unsupportedIterableToArray$g(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$g(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$g(r, a) : void 0; } }
|
|
23839
23995
|
function _arrayLikeToArray$g(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -24252,7 +24408,7 @@ function useRelationSelectorData (_ref) {
|
|
|
24252
24408
|
var activeItem = _step.value;
|
|
24253
24409
|
if ((activeItem === null || activeItem === void 0 ? void 0 : activeItem._id) === (addedData === null || addedData === void 0 ? void 0 : addedData._id)) {
|
|
24254
24410
|
addedObjects.push(addedData);
|
|
24255
|
-
getSplittedItems(_objectSpread$
|
|
24411
|
+
getSplittedItems(_objectSpread$11(_objectSpread$11({}, activeItem), {}, {
|
|
24256
24412
|
userId: data === null || data === void 0 ? void 0 : data._id
|
|
24257
24413
|
}));
|
|
24258
24414
|
ret = true;
|
|
@@ -24457,8 +24613,8 @@ function useRelationSelectorData (_ref) {
|
|
|
24457
24613
|
};
|
|
24458
24614
|
}
|
|
24459
24615
|
|
|
24460
|
-
function ownKeys$
|
|
24461
|
-
function _objectSpread$
|
|
24616
|
+
function ownKeys$10(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; }
|
|
24617
|
+
function _objectSpread$10(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$10(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$10(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24462
24618
|
function _createForOfIteratorHelper$f(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$f(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
24463
24619
|
function _unsupportedIterableToArray$f(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$f(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$f(r, a) : void 0; } }
|
|
24464
24620
|
function _arrayLikeToArray$f(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -24591,7 +24747,7 @@ function ActionButton (_ref) {
|
|
|
24591
24747
|
_iterator2.f();
|
|
24592
24748
|
}
|
|
24593
24749
|
_context.next = 19;
|
|
24594
|
-
return apiInterface.update(_objectSpread$
|
|
24750
|
+
return apiInterface.update(_objectSpread$10(_objectSpread$10({}, data), {}, {
|
|
24595
24751
|
state: toSwitch
|
|
24596
24752
|
}), data);
|
|
24597
24753
|
case 19:
|
|
@@ -24748,14 +24904,14 @@ function _simpleChangeValue() {
|
|
|
24748
24904
|
break;
|
|
24749
24905
|
}
|
|
24750
24906
|
for (i = 0; i < action.newValues.length; i++) {
|
|
24751
|
-
fieldsToUpdate = _objectSpread$
|
|
24907
|
+
fieldsToUpdate = _objectSpread$10(_objectSpread$10({}, fieldsToUpdate), {}, _defineProperty({}, action.newValues[i].field, action.newValues[i].value));
|
|
24752
24908
|
}
|
|
24753
24909
|
if (!apiInterface.canUpdate) {
|
|
24754
24910
|
_context2.next = 9;
|
|
24755
24911
|
break;
|
|
24756
24912
|
}
|
|
24757
24913
|
_context2.next = 7;
|
|
24758
|
-
return apiInterface.update(_objectSpread$
|
|
24914
|
+
return apiInterface.update(_objectSpread$10({}, fieldsToUpdate), data);
|
|
24759
24915
|
case 7:
|
|
24760
24916
|
response = _context2.sent;
|
|
24761
24917
|
return _context2.abrupt("return", response);
|
|
@@ -24770,7 +24926,7 @@ function _simpleChangeValue() {
|
|
|
24770
24926
|
return _simpleChangeValue.apply(this, arguments);
|
|
24771
24927
|
}
|
|
24772
24928
|
function A(props) {
|
|
24773
|
-
return /*#__PURE__*/jsx("a", _objectSpread$
|
|
24929
|
+
return /*#__PURE__*/jsx("a", _objectSpread$10({}, props));
|
|
24774
24930
|
}
|
|
24775
24931
|
|
|
24776
24932
|
function _createForOfIteratorHelper$e(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$e(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
@@ -24908,8 +25064,8 @@ var itemDesc = "item-desc-DBiiF";
|
|
|
24908
25064
|
var css_248z$u = ".diva-component-DIVA_BACKOFFICE_NEW .title-cl-ZAj2y {\n color: black;\n}\n.diva-component-DIVA_BACKOFFICE_NEW .description-m3mNY {\n color: grey;\n flex: 1 1 100%;\n margin-left: 25px;\n margin-top: -25px;\n}\n.diva-component-DIVA_BACKOFFICE_NEW .item-group-xWnj- {\n /* border-bottom: 1px solid black; */\n margin-bottom: 40px;\n}\n.diva-component-DIVA_BACKOFFICE_NEW .delete-item-otdSr {\n cursor: pointer;\n position: relative;\n float: right;\n top: 13px;\n margin-right: 20px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .newscroller-INKeD {\n overflow: auto;\n height: 400px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-collapse-header--6FgU div {\n flex-wrap: wrap !important;\n}\n.diva-component-DIVA_BACKOFFICE_NEW a .item-title--BTvC {\n padding: 0 0 0 30px;\n color: rgba(0, 0, 0, 0.85);\n}\n.diva-component-DIVA_BACKOFFICE_NEW .item-desc-DBiiF {\n padding: 0 0 0 30px;\n color: rgba(0, 0, 0, 0.45);\n}\n";
|
|
24909
25065
|
styleInject(css_248z$u);
|
|
24910
25066
|
|
|
24911
|
-
function ownKeys
|
|
24912
|
-
function _objectSpread
|
|
25067
|
+
function ownKeys$$(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; }
|
|
25068
|
+
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$$(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$$(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24913
25069
|
var DropDown = function DropDown(_ref) {
|
|
24914
25070
|
var _curItem$data$length;
|
|
24915
25071
|
var split = _ref.split,
|
|
@@ -24941,7 +25097,7 @@ var DropDown = function DropDown(_ref) {
|
|
|
24941
25097
|
});
|
|
24942
25098
|
return /*#__PURE__*/jsx(Collapse, {
|
|
24943
25099
|
onChange: function onChange() {
|
|
24944
|
-
return getSplittedItems(_objectSpread
|
|
25100
|
+
return getSplittedItems(_objectSpread$$(_objectSpread$$({}, item.item), {}, {
|
|
24945
25101
|
parentId: item.parentId
|
|
24946
25102
|
}), 0);
|
|
24947
25103
|
},
|
|
@@ -25201,8 +25357,8 @@ var RelationSelector = function RelationSelector(_ref, ref) {
|
|
|
25201
25357
|
};
|
|
25202
25358
|
var RelationSelector$1 = observer(/*#__PURE__*/React.forwardRef(RelationSelector));
|
|
25203
25359
|
|
|
25204
|
-
function ownKeys
|
|
25205
|
-
function _objectSpread
|
|
25360
|
+
function ownKeys$_(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; }
|
|
25361
|
+
function _objectSpread$_(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$_(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$_(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25206
25362
|
function useFormListData (_ref) {
|
|
25207
25363
|
var _configuration$defaul;
|
|
25208
25364
|
var id = _ref.id,
|
|
@@ -25282,7 +25438,7 @@ function useFormListData (_ref) {
|
|
|
25282
25438
|
if (updated.length == state.length) {
|
|
25283
25439
|
newState = state.map(function (s, i) {
|
|
25284
25440
|
var _updated$find;
|
|
25285
|
-
return _objectSpread
|
|
25441
|
+
return _objectSpread$_(_objectSpread$_({}, s), {}, {
|
|
25286
25442
|
data: (_updated$find = updated.find(function (u) {
|
|
25287
25443
|
return u.index == i;
|
|
25288
25444
|
})) === null || _updated$find === void 0 ? void 0 : _updated$find.data
|
|
@@ -25419,8 +25575,8 @@ var FormList = function FormList(_ref, ref) {
|
|
|
25419
25575
|
};
|
|
25420
25576
|
var FormList$1 = observer(/*#__PURE__*/React.forwardRef(FormList));
|
|
25421
25577
|
|
|
25422
|
-
function ownKeys$
|
|
25423
|
-
function _objectSpread$
|
|
25578
|
+
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; }
|
|
25579
|
+
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; }
|
|
25424
25580
|
var LOG$7 = getLogger('Backoffice', 'SelectOrCreate');
|
|
25425
25581
|
function useSelectOrCreateData (_ref) {
|
|
25426
25582
|
var id = _ref.id,
|
|
@@ -25517,7 +25673,7 @@ function useSelectOrCreateData (_ref) {
|
|
|
25517
25673
|
_context.next = 7;
|
|
25518
25674
|
return apiHandler.readList(configuration.readMapping, mappingData, {
|
|
25519
25675
|
filters: (_configuration$select3 = configuration.selectMapping) !== null && _configuration$select3 !== void 0 && _configuration$select3.searchField ? (_configuration$select4 = configuration.selectMapping) === null || _configuration$select4 === void 0 ? void 0 : _configuration$select4.searchField.reduce(function (filter, field) {
|
|
25520
|
-
return _objectSpread$
|
|
25676
|
+
return _objectSpread$Z(_objectSpread$Z({}, filter), {}, _defineProperty({}, field.field, [value, field.filter]));
|
|
25521
25677
|
}, {}) : {
|
|
25522
25678
|
_id: [value, 'contains']
|
|
25523
25679
|
},
|
|
@@ -25828,8 +25984,8 @@ var Multiple = function Multiple(_ref3) {
|
|
|
25828
25984
|
});
|
|
25829
25985
|
};
|
|
25830
25986
|
|
|
25831
|
-
function ownKeys$
|
|
25832
|
-
function _objectSpread$
|
|
25987
|
+
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; }
|
|
25988
|
+
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; }
|
|
25833
25989
|
function useListData (_ref) {
|
|
25834
25990
|
var id = _ref.id,
|
|
25835
25991
|
data = _ref.data;
|
|
@@ -25872,7 +26028,7 @@ function useListData (_ref) {
|
|
|
25872
26028
|
case 3:
|
|
25873
26029
|
result = _context.sent;
|
|
25874
26030
|
setListData(result.data.map(parseField));
|
|
25875
|
-
initData = _objectSpread$
|
|
26031
|
+
initData = _objectSpread$Y({}, data);
|
|
25876
26032
|
setUpdatedObject(initData);
|
|
25877
26033
|
setLoading(false);
|
|
25878
26034
|
case 8:
|
|
@@ -25913,7 +26069,7 @@ function useListData (_ref) {
|
|
|
25913
26069
|
});
|
|
25914
26070
|
(_configuration$itemMa7 = configuration.itemMapping.itemUpdate) === null || _configuration$itemMa7 === void 0 || _configuration$itemMa7.forEach(function (field) {
|
|
25915
26071
|
var parsedField = field.field.split('.');
|
|
25916
|
-
item.itemUpdate = _objectSpread$
|
|
26072
|
+
item.itemUpdate = _objectSpread$Y(_objectSpread$Y({}, field), {}, {
|
|
25917
26073
|
value: dataEntry[parsedField[parsedField.length - 1]]
|
|
25918
26074
|
});
|
|
25919
26075
|
});
|
|
@@ -25944,16 +26100,16 @@ function useListData (_ref) {
|
|
|
25944
26100
|
console.error('field with more than 2 parts not allowed');
|
|
25945
26101
|
return;
|
|
25946
26102
|
}
|
|
25947
|
-
var updObj = _objectSpread$
|
|
26103
|
+
var updObj = _objectSpread$Y({}, updatedObject);
|
|
25948
26104
|
if (fields.length === 1) {
|
|
25949
|
-
updObj = _objectSpread$
|
|
26105
|
+
updObj = _objectSpread$Y(_objectSpread$Y({}, updObj), {}, _defineProperty({}, fields[0], value));
|
|
25950
26106
|
} else if (fields.length === 2) {
|
|
25951
26107
|
var updatedField = updObj[fields[0]].find(function (v) {
|
|
25952
26108
|
return v.id === item.id.trim();
|
|
25953
26109
|
});
|
|
25954
26110
|
if (updatedField) {
|
|
25955
|
-
var updatedFieldCopy = _objectSpread$
|
|
25956
|
-
updObj = _objectSpread$
|
|
26111
|
+
var updatedFieldCopy = _objectSpread$Y(_objectSpread$Y({}, updatedField), {}, _defineProperty({}, fields[1], value));
|
|
26112
|
+
updObj = _objectSpread$Y(_objectSpread$Y({}, updObj), {}, _defineProperty({}, fields[0], updObj[fields[0]].map(function (v) {
|
|
25957
26113
|
return v.id === item.id.trim() ? updatedFieldCopy : v;
|
|
25958
26114
|
})));
|
|
25959
26115
|
}
|
|
@@ -25962,11 +26118,11 @@ function useListData (_ref) {
|
|
|
25962
26118
|
var acItems = listData;
|
|
25963
26119
|
for (var i = 0; i < acItems.length; i++) {
|
|
25964
26120
|
if (i == index) {
|
|
25965
|
-
acItems[i].itemUpdate = _objectSpread$
|
|
26121
|
+
acItems[i].itemUpdate = _objectSpread$Y(_objectSpread$Y({}, acItems[i].itemUpdate), {}, {
|
|
25966
26122
|
value: value
|
|
25967
26123
|
});
|
|
25968
26124
|
} else if (!acItems[i].itemUpdate.multiselect) {
|
|
25969
|
-
acItems[i].itemUpdate = _objectSpread$
|
|
26125
|
+
acItems[i].itemUpdate = _objectSpread$Y(_objectSpread$Y({}, acItems[i].itemUpdate), {}, {
|
|
25970
26126
|
value: !value
|
|
25971
26127
|
});
|
|
25972
26128
|
}
|
|
@@ -26480,8 +26636,8 @@ function calcNaturalCanvasSize(image, crop) {
|
|
|
26480
26636
|
};
|
|
26481
26637
|
}
|
|
26482
26638
|
|
|
26483
|
-
function ownKeys$
|
|
26484
|
-
function _objectSpread$
|
|
26639
|
+
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; }
|
|
26640
|
+
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; }
|
|
26485
26641
|
var ImageCropper = function ImageCropper(_ref, ref) {
|
|
26486
26642
|
var id = _ref.id,
|
|
26487
26643
|
data = _ref.data,
|
|
@@ -26589,12 +26745,12 @@ var ImageCropper = function ImageCropper(_ref, ref) {
|
|
|
26589
26745
|
}
|
|
26590
26746
|
function onEnter(e) {
|
|
26591
26747
|
if (e.key != 'Enter') return;
|
|
26592
|
-
setCrop(_objectSpread$
|
|
26748
|
+
setCrop(_objectSpread$X(_objectSpread$X({}, crop), {}, {
|
|
26593
26749
|
unit: 'px',
|
|
26594
26750
|
width: Number(widthInputElement.current.value),
|
|
26595
26751
|
height: Number(heightInputElement.current.value)
|
|
26596
26752
|
}));
|
|
26597
|
-
setCompletedCrop(_objectSpread$
|
|
26753
|
+
setCompletedCrop(_objectSpread$X(_objectSpread$X({}, crop), {}, {
|
|
26598
26754
|
unit: 'px',
|
|
26599
26755
|
width: Number(widthInputElement.current.value),
|
|
26600
26756
|
height: Number(heightInputElement.current.value)
|
|
@@ -26672,8 +26828,8 @@ var ImageCropper$1 = observer(/*#__PURE__*/React.forwardRef(ImageCropper));
|
|
|
26672
26828
|
function _createForOfIteratorHelper$d(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$d(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
26673
26829
|
function _unsupportedIterableToArray$d(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$d(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$d(r, a) : void 0; } }
|
|
26674
26830
|
function _arrayLikeToArray$d(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
26675
|
-
function ownKeys$
|
|
26676
|
-
function _objectSpread$
|
|
26831
|
+
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; }
|
|
26832
|
+
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; }
|
|
26677
26833
|
function useDescriptions (_ref) {
|
|
26678
26834
|
var id = _ref.id;
|
|
26679
26835
|
var root = useStore();
|
|
@@ -26766,7 +26922,7 @@ function _getDisplayData() {
|
|
|
26766
26922
|
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
26767
26923
|
while (1) switch (_context4.prev = _context4.next) {
|
|
26768
26924
|
case 0:
|
|
26769
|
-
displayData = _objectSpread$
|
|
26925
|
+
displayData = _objectSpread$W({}, data);
|
|
26770
26926
|
_iterator = _createForOfIteratorHelper$d(items);
|
|
26771
26927
|
_context4.prev = 2;
|
|
26772
26928
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
@@ -27042,8 +27198,8 @@ var FileUploadWrapper$1 = function FileUploadWrapper(_ref) {
|
|
|
27042
27198
|
};
|
|
27043
27199
|
var FileUploadBeta = observer(FileUploadWrapper$1);
|
|
27044
27200
|
|
|
27045
|
-
function ownKeys$
|
|
27046
|
-
function _objectSpread$
|
|
27201
|
+
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; }
|
|
27202
|
+
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; }
|
|
27047
27203
|
function useGridData (_ref) {
|
|
27048
27204
|
var id = _ref.id,
|
|
27049
27205
|
data = _ref.data;
|
|
@@ -27086,11 +27242,11 @@ function useGridData (_ref) {
|
|
|
27086
27242
|
function reducer(state, action) {
|
|
27087
27243
|
switch (action.type) {
|
|
27088
27244
|
case 'update':
|
|
27089
|
-
return _objectSpread$
|
|
27245
|
+
return _objectSpread$V(_objectSpread$V({}, state), {}, _defineProperty({}, action.data.divaNr, _objectSpread$V(_objectSpread$V({}, action.data), {}, {
|
|
27090
27246
|
buffer: Buffer.from(action.data.buffer)
|
|
27091
27247
|
})));
|
|
27092
27248
|
case 'delete':
|
|
27093
|
-
var newState = _objectSpread$
|
|
27249
|
+
var newState = _objectSpread$V({}, state);
|
|
27094
27250
|
delete newState[action.data.divaNr];
|
|
27095
27251
|
return newState;
|
|
27096
27252
|
default:
|
|
@@ -27177,8 +27333,8 @@ var Grid = function Grid(_ref) {
|
|
|
27177
27333
|
});
|
|
27178
27334
|
};
|
|
27179
27335
|
|
|
27180
|
-
function ownKeys$
|
|
27181
|
-
function _objectSpread$
|
|
27336
|
+
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; }
|
|
27337
|
+
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; }
|
|
27182
27338
|
var useMediaUpload = function useMediaUpload(_ref) {
|
|
27183
27339
|
var id = _ref.id;
|
|
27184
27340
|
var root = useStore();
|
|
@@ -27311,7 +27467,7 @@ var useMediaUpload = function useMediaUpload(_ref) {
|
|
|
27311
27467
|
onRemove: onRemove,
|
|
27312
27468
|
customRequest: customRequest,
|
|
27313
27469
|
fileList: fileList.map(function (f) {
|
|
27314
|
-
return _objectSpread$
|
|
27470
|
+
return _objectSpread$U(_objectSpread$U({}, f), {}, {
|
|
27315
27471
|
url: f.url
|
|
27316
27472
|
});
|
|
27317
27473
|
}),
|
|
@@ -27415,8 +27571,8 @@ var TableSummary = function TableSummary(_ref) {
|
|
|
27415
27571
|
});
|
|
27416
27572
|
};
|
|
27417
27573
|
|
|
27418
|
-
function ownKeys$
|
|
27419
|
-
function _objectSpread$
|
|
27574
|
+
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; }
|
|
27575
|
+
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; }
|
|
27420
27576
|
function getExpandedRowRenderer (config, root) {
|
|
27421
27577
|
return function (record) {
|
|
27422
27578
|
var data = record;
|
|
@@ -27438,7 +27594,7 @@ function customSubTable(columns, datasource) {
|
|
|
27438
27594
|
// map custom columns to antd columns
|
|
27439
27595
|
var antcols = columns.map(function (col) {
|
|
27440
27596
|
var _col$width;
|
|
27441
|
-
return _objectSpread$
|
|
27597
|
+
return _objectSpread$T(_objectSpread$T({}, col), {}, {
|
|
27442
27598
|
title: col.title,
|
|
27443
27599
|
dataIndex: col.field,
|
|
27444
27600
|
key: col.field,
|
|
@@ -27609,21 +27765,47 @@ function StringCell (_ref) {
|
|
|
27609
27765
|
});
|
|
27610
27766
|
}
|
|
27611
27767
|
}
|
|
27768
|
+
function matchesColorCondition(record, value, operation, field, onValue) {
|
|
27769
|
+
if (onValue === undefined) {
|
|
27770
|
+
return false;
|
|
27771
|
+
}
|
|
27772
|
+
var currentValue = field ? record === null || record === void 0 ? void 0 : record[field] : value;
|
|
27773
|
+
if (operation === 'ct') {
|
|
27774
|
+
var _JSON$stringify$inclu, _JSON$stringify;
|
|
27775
|
+
return (_JSON$stringify$inclu = (_JSON$stringify = JSON.stringify(currentValue)) === null || _JSON$stringify === void 0 ? void 0 : _JSON$stringify.includes(String(onValue))) !== null && _JSON$stringify$inclu !== void 0 ? _JSON$stringify$inclu : false;
|
|
27776
|
+
}
|
|
27777
|
+
return currentValue === onValue;
|
|
27778
|
+
}
|
|
27612
27779
|
function getColor(column, record, value) {
|
|
27613
27780
|
if (column.color && record) {
|
|
27614
27781
|
var _iterator = _createForOfIteratorHelper$b(column.color),
|
|
27615
27782
|
_step;
|
|
27616
27783
|
try {
|
|
27617
27784
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
27785
|
+
var _col$fields;
|
|
27618
27786
|
var col = _step.value;
|
|
27619
|
-
|
|
27620
|
-
var
|
|
27621
|
-
var
|
|
27622
|
-
|
|
27623
|
-
|
|
27624
|
-
|
|
27787
|
+
if ((_col$fields = col.fields) !== null && _col$fields !== void 0 && _col$fields.length) {
|
|
27788
|
+
var hasAllMatches = true;
|
|
27789
|
+
for (var idx = 0; idx < col.fields.length; idx++) {
|
|
27790
|
+
var _ref2, _col$operations$idx, _col$operations, _col$operations2, _col$onValues;
|
|
27791
|
+
var field = col.fields[idx];
|
|
27792
|
+
var operation = (_ref2 = (_col$operations$idx = (_col$operations = col.operations) === null || _col$operations === void 0 ? void 0 : _col$operations[idx]) !== null && _col$operations$idx !== void 0 ? _col$operations$idx : (_col$operations2 = col.operations) === null || _col$operations2 === void 0 ? void 0 : _col$operations2[0]) !== null && _ref2 !== void 0 ? _ref2 : 'eq';
|
|
27793
|
+
var onValue = (_col$onValues = col.onValues) === null || _col$onValues === void 0 ? void 0 : _col$onValues[idx];
|
|
27794
|
+
if (!field || !matchesColorCondition(record, value, operation, field, onValue)) {
|
|
27795
|
+
hasAllMatches = false;
|
|
27796
|
+
break;
|
|
27797
|
+
}
|
|
27798
|
+
}
|
|
27799
|
+
if (hasAllMatches) {
|
|
27625
27800
|
return col.color;
|
|
27626
|
-
}
|
|
27801
|
+
}
|
|
27802
|
+
continue;
|
|
27803
|
+
}
|
|
27804
|
+
for (var _idx = 0; _idx < col.onValues.length; _idx++) {
|
|
27805
|
+
var _ref3, _col$operations$_idx, _col$operations3, _col$operations4, _col$onValues2;
|
|
27806
|
+
var _operation = (_ref3 = (_col$operations$_idx = (_col$operations3 = col.operations) === null || _col$operations3 === void 0 ? void 0 : _col$operations3[_idx]) !== null && _col$operations$_idx !== void 0 ? _col$operations$_idx : (_col$operations4 = col.operations) === null || _col$operations4 === void 0 ? void 0 : _col$operations4[0]) !== null && _ref3 !== void 0 ? _ref3 : 'eq';
|
|
27807
|
+
var _onValue = (_col$onValues2 = col.onValues) === null || _col$onValues2 === void 0 ? void 0 : _col$onValues2[_idx];
|
|
27808
|
+
if (matchesColorCondition(record, value, _operation, undefined, _onValue)) {
|
|
27627
27809
|
return col.color;
|
|
27628
27810
|
}
|
|
27629
27811
|
}
|
|
@@ -28194,8 +28376,8 @@ function ArrayCell (_ref) {
|
|
|
28194
28376
|
|
|
28195
28377
|
var _excluded$7 = ["index"],
|
|
28196
28378
|
_excluded2 = ["children", "dataIndex", "record", "handleSave", "column"];
|
|
28197
|
-
function ownKeys$
|
|
28198
|
-
function _objectSpread$
|
|
28379
|
+
function ownKeys$S(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; }
|
|
28380
|
+
function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$S(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$S(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28199
28381
|
var LOG$5 = getLogger('Backoffice', 'CellRenderer');
|
|
28200
28382
|
var EditableContext = /*#__PURE__*/React.createContext(null);
|
|
28201
28383
|
var CustomRow = function CustomRow(_ref) {
|
|
@@ -28209,7 +28391,7 @@ var CustomRow = function CustomRow(_ref) {
|
|
|
28209
28391
|
component: false,
|
|
28210
28392
|
children: /*#__PURE__*/jsx(EditableContext.Provider, {
|
|
28211
28393
|
value: form,
|
|
28212
|
-
children: /*#__PURE__*/jsx("tr", _objectSpread$
|
|
28394
|
+
children: /*#__PURE__*/jsx("tr", _objectSpread$S({}, props))
|
|
28213
28395
|
})
|
|
28214
28396
|
});
|
|
28215
28397
|
};
|
|
@@ -28232,7 +28414,7 @@ var CustomCell = function CustomCell(_ref2) {
|
|
|
28232
28414
|
return form.validateFields();
|
|
28233
28415
|
case 3:
|
|
28234
28416
|
values = _context.sent;
|
|
28235
|
-
handleSave(merge
|
|
28417
|
+
handleSave(merge(record, values));
|
|
28236
28418
|
_context.next = 10;
|
|
28237
28419
|
break;
|
|
28238
28420
|
case 7:
|
|
@@ -28262,7 +28444,7 @@ var CustomCell = function CustomCell(_ref2) {
|
|
|
28262
28444
|
if ((record === null || record === void 0 ? void 0 : record.ItemField) == 'LongDescription') {
|
|
28263
28445
|
longDescriptionType = 'text';
|
|
28264
28446
|
}
|
|
28265
|
-
var modifiedColumn = _objectSpread$
|
|
28447
|
+
var modifiedColumn = _objectSpread$S(_objectSpread$S({}, column), {}, {
|
|
28266
28448
|
type: longDescriptionType || (column === null || column === void 0 ? void 0 : column.type)
|
|
28267
28449
|
});
|
|
28268
28450
|
if (column) {
|
|
@@ -28275,43 +28457,43 @@ var CustomCell = function CustomCell(_ref2) {
|
|
|
28275
28457
|
};
|
|
28276
28458
|
switch (modifiedColumn.type) {
|
|
28277
28459
|
case 'boolean':
|
|
28278
|
-
childNode = /*#__PURE__*/jsx(BooleanCell, _objectSpread$
|
|
28460
|
+
childNode = /*#__PURE__*/jsx(BooleanCell, _objectSpread$S({}, cellProps));
|
|
28279
28461
|
break;
|
|
28280
28462
|
case 'text':
|
|
28281
|
-
childNode = /*#__PURE__*/jsx(TextCell, _objectSpread$
|
|
28463
|
+
childNode = /*#__PURE__*/jsx(TextCell, _objectSpread$S({}, cellProps));
|
|
28282
28464
|
break;
|
|
28283
28465
|
case 'select':
|
|
28284
|
-
childNode = /*#__PURE__*/jsx(DropdownCell, _objectSpread$
|
|
28466
|
+
childNode = /*#__PURE__*/jsx(DropdownCell, _objectSpread$S({}, cellProps));
|
|
28285
28467
|
case 'media':
|
|
28286
|
-
childNode = /*#__PURE__*/jsx(MediaViewerCell, _objectSpread$
|
|
28468
|
+
childNode = /*#__PURE__*/jsx(MediaViewerCell, _objectSpread$S({}, cellProps));
|
|
28287
28469
|
break;
|
|
28288
28470
|
case 'mediaItem':
|
|
28289
|
-
childNode = /*#__PURE__*/jsx(MediaItemViewerCell, _objectSpread$
|
|
28471
|
+
childNode = /*#__PURE__*/jsx(MediaItemViewerCell, _objectSpread$S({}, cellProps));
|
|
28290
28472
|
break;
|
|
28291
28473
|
case 'unixTimeStamp':
|
|
28292
|
-
childNode = /*#__PURE__*/jsx(UnixTimeStampCell, _objectSpread$
|
|
28474
|
+
childNode = /*#__PURE__*/jsx(UnixTimeStampCell, _objectSpread$S({}, cellProps));
|
|
28293
28475
|
break;
|
|
28294
28476
|
case 'unixTimeStampCheck':
|
|
28295
|
-
childNode = /*#__PURE__*/jsx(UnixTimeStampCheckCell, _objectSpread$
|
|
28477
|
+
childNode = /*#__PURE__*/jsx(UnixTimeStampCheckCell, _objectSpread$S({}, cellProps));
|
|
28296
28478
|
break;
|
|
28297
28479
|
case 'icon':
|
|
28298
|
-
childNode = /*#__PURE__*/jsx(IconCell, _objectSpread$
|
|
28480
|
+
childNode = /*#__PURE__*/jsx(IconCell, _objectSpread$S({}, cellProps));
|
|
28299
28481
|
break;
|
|
28300
28482
|
case 'progress':
|
|
28301
|
-
childNode = /*#__PURE__*/jsx(ProgressCell, _objectSpread$
|
|
28483
|
+
childNode = /*#__PURE__*/jsx(ProgressCell, _objectSpread$S({}, cellProps));
|
|
28302
28484
|
break;
|
|
28303
28485
|
case 'link':
|
|
28304
|
-
childNode = /*#__PURE__*/jsx(LinkCell, _objectSpread$
|
|
28486
|
+
childNode = /*#__PURE__*/jsx(LinkCell, _objectSpread$S({}, cellProps));
|
|
28305
28487
|
break;
|
|
28306
28488
|
case 'array':
|
|
28307
|
-
childNode = /*#__PURE__*/jsx(ArrayCell, _objectSpread$
|
|
28489
|
+
childNode = /*#__PURE__*/jsx(ArrayCell, _objectSpread$S({}, cellProps));
|
|
28308
28490
|
break;
|
|
28309
28491
|
default:
|
|
28310
|
-
childNode = /*#__PURE__*/jsx(StringCell, _objectSpread$
|
|
28492
|
+
childNode = /*#__PURE__*/jsx(StringCell, _objectSpread$S({}, cellProps));
|
|
28311
28493
|
break;
|
|
28312
28494
|
}
|
|
28313
28495
|
}
|
|
28314
|
-
return /*#__PURE__*/jsx("td", _objectSpread$
|
|
28496
|
+
return /*#__PURE__*/jsx("td", _objectSpread$S(_objectSpread$S({}, restProps), {}, {
|
|
28315
28497
|
children: childNode
|
|
28316
28498
|
}));
|
|
28317
28499
|
};
|
|
@@ -28666,8 +28848,8 @@ var SMChart = function SMChart(props) {
|
|
|
28666
28848
|
function _createForOfIteratorHelper$8(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$8(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
28667
28849
|
function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$8(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$8(r, a) : void 0; } }
|
|
28668
28850
|
function _arrayLikeToArray$8(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
28669
|
-
function ownKeys$
|
|
28670
|
-
function _objectSpread$
|
|
28851
|
+
function ownKeys$R(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; }
|
|
28852
|
+
function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$R(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$R(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28671
28853
|
|
|
28672
28854
|
/**
|
|
28673
28855
|
* Props for the useTools hook
|
|
@@ -28707,7 +28889,7 @@ var useTools = function useTools(_ref) {
|
|
|
28707
28889
|
var packageId = enricherPackage === null || enricherPackage === void 0 ? void 0 : enricherPackage._id;
|
|
28708
28890
|
var isoLanguageIds = (catalog === null || catalog === void 0 ? void 0 : catalog.isoLanguageIds) || (enricherPackage === null || enricherPackage === void 0 ? void 0 : enricherPackage.isoLanguageIds);
|
|
28709
28891
|
var createTool = function createTool(tool) {
|
|
28710
|
-
return _objectSpread$
|
|
28892
|
+
return _objectSpread$R({
|
|
28711
28893
|
startWidth: 600,
|
|
28712
28894
|
defaultPinned: true,
|
|
28713
28895
|
defaultOpen: false
|
|
@@ -28738,7 +28920,7 @@ var useTools = function useTools(_ref) {
|
|
|
28738
28920
|
name: 'Konfigurator',
|
|
28739
28921
|
type: 'Configurator',
|
|
28740
28922
|
where: 'right',
|
|
28741
|
-
parameters: _objectSpread$
|
|
28923
|
+
parameters: _objectSpread$R({
|
|
28742
28924
|
catalogId: catalogId,
|
|
28743
28925
|
packageId: packageId,
|
|
28744
28926
|
isIDMData: !isApi2 ? '1' : undefined
|
|
@@ -28828,8 +29010,8 @@ function InformationButton(_ref) {
|
|
|
28828
29010
|
});
|
|
28829
29011
|
}
|
|
28830
29012
|
|
|
28831
|
-
function ownKeys$
|
|
28832
|
-
function _objectSpread$
|
|
29013
|
+
function ownKeys$Q(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; }
|
|
29014
|
+
function _objectSpread$Q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Q(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28833
29015
|
function _createForOfIteratorHelper$7(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
28834
29016
|
function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0; } }
|
|
28835
29017
|
function _arrayLikeToArray$7(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -28841,8 +29023,30 @@ dayjs.extend(weekOfYear);
|
|
|
28841
29023
|
dayjs.extend(weekYear);
|
|
28842
29024
|
Select$1.Option;
|
|
28843
29025
|
var LOG$4 = getLogger('Backoffice', 'BaseTable');
|
|
29026
|
+
|
|
29027
|
+
/** Maps full `Select` onChange payload (often `option.data`) to the filter field value. */
|
|
29028
|
+
function normalizeTableFilterSelectValue(selected, filterField) {
|
|
29029
|
+
if (selected == null) return undefined;
|
|
29030
|
+
var pick = function pick(item) {
|
|
29031
|
+
if (item != null && _typeof(item) === 'object' && filterField in item) {
|
|
29032
|
+
var v = item[filterField];
|
|
29033
|
+
return v != null ? String(v) : undefined;
|
|
29034
|
+
}
|
|
29035
|
+
if (typeof item === 'string' || typeof item === 'number') return String(item);
|
|
29036
|
+
return undefined;
|
|
29037
|
+
};
|
|
29038
|
+
if (Array.isArray(selected)) {
|
|
29039
|
+
var mapped = selected.map(pick).filter(function (v) {
|
|
29040
|
+
return v != null && v.length > 0;
|
|
29041
|
+
});
|
|
29042
|
+
return mapped.length ? mapped : undefined;
|
|
29043
|
+
}
|
|
29044
|
+
var one = pick(selected);
|
|
29045
|
+
if (one == null || !one.length) return undefined;
|
|
29046
|
+
return one;
|
|
29047
|
+
}
|
|
28844
29048
|
var TableWrapper = function TableWrapper(_ref) {
|
|
28845
|
-
var _state$configuration$, _toggleConfig$label, _toggleConfig$labelOf, _state$globalFilter, _state$configuration$
|
|
29049
|
+
var _state$configuration$, _state$configuration$2, _toggleConfig$label, _toggleConfig$labelOf, _state$globalFilter, _state$configuration$3, _state$configuration$4, _state$globalFilter2, _state$globalFilter3, _state$globalFilter4, _state$globalFilter5, _state$globalFilter$s, _state$globalFilter$s2, _state$configuration$5, _state$configuration$6, _state$configuration$7, _state$configuration$8, _state$configuration$9, _state$selected2, _state$configuration$10, _state$configuration$11, _state$configuration$12, _state$configuration$15, _state$configuration$16, _state$configuration$17;
|
|
28846
29050
|
var state = _ref.state;
|
|
28847
29051
|
var root = useStore();
|
|
28848
29052
|
var _useState = useState(0),
|
|
@@ -28929,7 +29133,7 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
28929
29133
|
if (data && data.length > 0) {
|
|
28930
29134
|
data = data.map(function (dt) {
|
|
28931
29135
|
var _ref2, _dt$catalogItem;
|
|
28932
|
-
return _objectSpread$
|
|
29136
|
+
return _objectSpread$Q(_objectSpread$Q({}, dt), {}, {
|
|
28933
29137
|
catalogItem: (_ref2 = (_dt$catalogItem = dt.catalogItem) !== null && _dt$catalogItem !== void 0 ? _dt$catalogItem : state.catalogItem) !== null && _ref2 !== void 0 ? _ref2 : null
|
|
28934
29138
|
});
|
|
28935
29139
|
});
|
|
@@ -28952,6 +29156,7 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
28952
29156
|
return root.actions.userHasPermission(permission);
|
|
28953
29157
|
}
|
|
28954
29158
|
var toggleConfig = (_state$configuration$ = state.configuration.filter) === null || _state$configuration$ === void 0 ? void 0 : _state$configuration$.toggle;
|
|
29159
|
+
var selectFilter = (_state$configuration$2 = state.configuration.filter) === null || _state$configuration$2 === void 0 ? void 0 : _state$configuration$2.select;
|
|
28955
29160
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
28956
29161
|
children: [(state.canDelete || state.configuration.createAction || state.title || state.configuration.canRefresh || state.configuration.clientRelations) && /*#__PURE__*/jsx(Fragment, {
|
|
28957
29162
|
children: /*#__PURE__*/jsx(Descriptions, {
|
|
@@ -29065,7 +29270,7 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
29065
29270
|
},
|
|
29066
29271
|
checked: !!((_state$globalFilter = state.globalFilter) !== null && _state$globalFilter !== void 0 && _state$globalFilter.toggle) != !!toggleConfig.inverted
|
|
29067
29272
|
})
|
|
29068
|
-
}), ((_state$configuration$
|
|
29273
|
+
}), ((_state$configuration$3 = state.configuration.filter) === null || _state$configuration$3 === void 0 ? void 0 : _state$configuration$3.search) && /*#__PURE__*/jsx(Input$1.Search, {
|
|
29069
29274
|
placeholder: t('filter.global'),
|
|
29070
29275
|
onSearch: function onSearch(v) {
|
|
29071
29276
|
return state.onGlobalFilterSearch(v);
|
|
@@ -29074,7 +29279,7 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
29074
29279
|
style: {
|
|
29075
29280
|
width: 200
|
|
29076
29281
|
}
|
|
29077
|
-
}), ((_state$configuration$
|
|
29282
|
+
}), ((_state$configuration$4 = state.configuration.filter) === null || _state$configuration$4 === void 0 ? void 0 : _state$configuration$4.period) && /*#__PURE__*/jsx(DatePicker.RangePicker, {
|
|
29078
29283
|
onCalendarChange: function onCalendarChange(values) {
|
|
29079
29284
|
if (values && values[0] && values[1]) {
|
|
29080
29285
|
state.onGlobalFilterPeriod(values[0].valueOf(), values[1].valueOf());
|
|
@@ -29084,32 +29289,38 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
29084
29289
|
// Convert to Dayjs
|
|
29085
29290
|
(_state$globalFilter4 = state.globalFilter) !== null && _state$globalFilter4 !== void 0 && (_state$globalFilter4 = _state$globalFilter4.timeStamp) !== null && _state$globalFilter4 !== void 0 && (_state$globalFilter4 = _state$globalFilter4['toTimeStamp']) !== null && _state$globalFilter4 !== void 0 && _state$globalFilter4[0] ? dayjs((_state$globalFilter5 = state.globalFilter) === null || _state$globalFilter5 === void 0 || (_state$globalFilter5 = _state$globalFilter5.timeStamp) === null || _state$globalFilter5 === void 0 || (_state$globalFilter5 = _state$globalFilter5['toTimeStamp']) === null || _state$globalFilter5 === void 0 ? void 0 : _state$globalFilter5[0]) : dayjs(new Date()) // Convert to Dayjs
|
|
29086
29291
|
]
|
|
29087
|
-
}),
|
|
29292
|
+
}), selectFilter && (selectFilter.selectVariant === 'select' ? /*#__PURE__*/jsx(Select, _objectSpread$Q(_objectSpread$Q({}, selectFilter.settings), {}, {
|
|
29293
|
+
minWidth: "200px",
|
|
29294
|
+
value: (_state$globalFilter$s = state.globalFilter.select) === null || _state$globalFilter$s === void 0 || (_state$globalFilter$s = _state$globalFilter$s[selectFilter.filterField]) === null || _state$globalFilter$s === void 0 ? void 0 : _state$globalFilter$s[0],
|
|
29295
|
+
onChange: function onChange(selected) {
|
|
29296
|
+
state.onGlobalFilterSelect(normalizeTableFilterSelectValue(selected, selectFilter.filterField));
|
|
29297
|
+
}
|
|
29298
|
+
})) : /*#__PURE__*/jsx(SimpleSelect, _objectSpread$Q(_objectSpread$Q({}, selectFilter.settings), {}, {
|
|
29088
29299
|
style: {
|
|
29089
29300
|
minWidth: '200px'
|
|
29090
29301
|
},
|
|
29091
|
-
value: (_state$globalFilter$
|
|
29302
|
+
value: (_state$globalFilter$s2 = state.globalFilter.select) === null || _state$globalFilter$s2 === void 0 || (_state$globalFilter$s2 = _state$globalFilter$s2[selectFilter.filterField]) === null || _state$globalFilter$s2 === void 0 ? void 0 : _state$globalFilter$s2[0],
|
|
29092
29303
|
onChange: function onChange(selected) {
|
|
29093
29304
|
state.onGlobalFilterSelect(selected);
|
|
29094
29305
|
}
|
|
29095
|
-
})), /*#__PURE__*/jsx(SelectionText, {
|
|
29306
|
+
}))), /*#__PURE__*/jsx(SelectionText, {
|
|
29096
29307
|
selected: state.selected
|
|
29097
29308
|
}), state.canDelete && /*#__PURE__*/jsx(DeleteButton, {
|
|
29098
29309
|
selected: state.selected,
|
|
29099
29310
|
total: state.pagination.total,
|
|
29100
|
-
min: (_state$configuration$
|
|
29311
|
+
min: (_state$configuration$5 = state.configuration.rules) === null || _state$configuration$5 === void 0 ? void 0 : _state$configuration$5.min,
|
|
29101
29312
|
deleting: state.deleting,
|
|
29102
29313
|
onDelete: state.onDelete,
|
|
29103
|
-
label: (_state$configuration$
|
|
29104
|
-
labelDialog: (_state$configuration$
|
|
29105
|
-
disabled: !!((_state$configuration$
|
|
29314
|
+
label: (_state$configuration$6 = state.configuration.deleteAction) === null || _state$configuration$6 === void 0 ? void 0 : _state$configuration$6.label,
|
|
29315
|
+
labelDialog: (_state$configuration$7 = state.configuration.deleteAction) === null || _state$configuration$7 === void 0 ? void 0 : _state$configuration$7.labelDialog,
|
|
29316
|
+
disabled: !!((_state$configuration$8 = state.configuration.deleteAction) !== null && _state$configuration$8 !== void 0 && (_state$configuration$9 = _state$configuration$8.disabled) !== null && _state$configuration$9 !== void 0 && _state$configuration$9.call(_state$configuration$8, ((_state$selected2 = state.selected) !== null && _state$selected2 !== void 0 ? _state$selected2 : []).map(function (id) {
|
|
29106
29317
|
return state.data.find(function (d) {
|
|
29107
29318
|
return d._id == id;
|
|
29108
29319
|
});
|
|
29109
29320
|
})))
|
|
29110
29321
|
}), state.configuration.copyAction !== undefined && /*#__PURE__*/jsx(CopyButton, {
|
|
29111
29322
|
state: state
|
|
29112
|
-
}), (_state$configuration$
|
|
29323
|
+
}), (_state$configuration$10 = state.configuration.bulkActions) === null || _state$configuration$10 === void 0 ? void 0 : _state$configuration$10.map(function (action) {
|
|
29113
29324
|
return /*#__PURE__*/jsx(BulkAction, {
|
|
29114
29325
|
action: action,
|
|
29115
29326
|
state: state,
|
|
@@ -29120,18 +29331,18 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
29120
29331
|
setProgressBarPercentage: setProgressBarPercentage
|
|
29121
29332
|
} : undefined
|
|
29122
29333
|
}, action.id);
|
|
29123
|
-
}), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && !((_state$configuration$
|
|
29334
|
+
}), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && !((_state$configuration$11 = (_state$configuration$12 = state.configuration.createAction).hidden) !== null && _state$configuration$11 !== void 0 && _state$configuration$11.call(_state$configuration$12, data)) && /*#__PURE__*/jsx(ActionButton, {
|
|
29124
29335
|
action: state.configuration.createAction,
|
|
29125
29336
|
callback: function callback(data) {
|
|
29126
|
-
var _state$onUpdate, _state$configuration$
|
|
29337
|
+
var _state$onUpdate, _state$configuration$13, _state$configuration$14;
|
|
29127
29338
|
(_state$onUpdate = state.onUpdate) === null || _state$onUpdate === void 0 || _state$onUpdate.call(state, data);
|
|
29128
|
-
(_state$configuration$
|
|
29339
|
+
(_state$configuration$13 = state.configuration.createAction) === null || _state$configuration$13 === void 0 || (_state$configuration$14 = _state$configuration$13.callback) === null || _state$configuration$14 === void 0 || _state$configuration$14.call(_state$configuration$13, data);
|
|
29129
29340
|
},
|
|
29130
29341
|
type: "Button",
|
|
29131
29342
|
id: 'create',
|
|
29132
29343
|
defaultLabel: t('backoffice.table.emailtemplates.createAction.title'),
|
|
29133
29344
|
isCreateButton: true,
|
|
29134
|
-
disabled: state.configuration.createAction.disableOnToggle === !!state.globalFilter.toggle || ((_state$configuration$
|
|
29345
|
+
disabled: state.configuration.createAction.disableOnToggle === !!state.globalFilter.toggle || ((_state$configuration$15 = (_state$configuration$16 = state.configuration.createAction).disabled) === null || _state$configuration$15 === void 0 ? void 0 : _state$configuration$15.call(_state$configuration$16, data)),
|
|
29135
29346
|
data: state.configuration.createActionMapping ? applyMapping({
|
|
29136
29347
|
mappable: {},
|
|
29137
29348
|
mapping: state.configuration.createActionMapping,
|
|
@@ -29179,13 +29390,13 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
29179
29390
|
className: "andt-table",
|
|
29180
29391
|
scroll: {
|
|
29181
29392
|
x: '100%',
|
|
29182
|
-
y: (_state$configuration$
|
|
29393
|
+
y: (_state$configuration$17 = state.configuration.height) !== null && _state$configuration$17 !== void 0 ? _state$configuration$17 : '95%'
|
|
29183
29394
|
},
|
|
29184
29395
|
rowClassName: editableRow,
|
|
29185
29396
|
components: cellRenderer,
|
|
29186
29397
|
rowKey: function rowKey(dataRow) {
|
|
29187
|
-
var _state$configuration$
|
|
29188
|
-
return goTroughObject(dataRow, (_state$configuration$
|
|
29398
|
+
var _state$configuration$18, _state$configuration$19;
|
|
29399
|
+
return goTroughObject(dataRow, (_state$configuration$18 = (_state$configuration$19 = state.configuration.rowKey) === null || _state$configuration$19 === void 0 ? void 0 : _state$configuration$19.split('.')) !== null && _state$configuration$18 !== void 0 ? _state$configuration$18 : ['_id'], 0);
|
|
29189
29400
|
},
|
|
29190
29401
|
dataSource: data,
|
|
29191
29402
|
loading: {
|
|
@@ -29194,7 +29405,7 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
29194
29405
|
root: tableLoadingSpin
|
|
29195
29406
|
}
|
|
29196
29407
|
},
|
|
29197
|
-
pagination: _objectSpread$
|
|
29408
|
+
pagination: _objectSpread$Q(_objectSpread$Q({}, state.pagination), {}, {
|
|
29198
29409
|
showTotal: function showTotal(total, range) {
|
|
29199
29410
|
return "".concat(range[0], "-").concat(range[1], " of ").concat(total, " Elements");
|
|
29200
29411
|
},
|
|
@@ -29275,7 +29486,7 @@ function DeleteButton(_ref4) {
|
|
|
29275
29486
|
});
|
|
29276
29487
|
}
|
|
29277
29488
|
function CopyButton(_ref5) {
|
|
29278
|
-
var _state$configuration$
|
|
29489
|
+
var _state$configuration$23;
|
|
29279
29490
|
var state = _ref5.state;
|
|
29280
29491
|
var root = useStore();
|
|
29281
29492
|
new _default$d({
|
|
@@ -29284,13 +29495,13 @@ function CopyButton(_ref5) {
|
|
|
29284
29495
|
}, root);
|
|
29285
29496
|
var onCopy = /*#__PURE__*/function () {
|
|
29286
29497
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
29287
|
-
var _state$configuration$
|
|
29498
|
+
var _state$configuration$20;
|
|
29288
29499
|
var copyAction, _iterator3, _step3, selectedRow;
|
|
29289
29500
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
29290
29501
|
while (1) switch (_context2.prev = _context2.next) {
|
|
29291
29502
|
case 0:
|
|
29292
29503
|
copyAction = state.configuration.copyAction;
|
|
29293
|
-
if (((_state$configuration$
|
|
29504
|
+
if (((_state$configuration$20 = state.configuration.copyAction) === null || _state$configuration$20 === void 0 ? void 0 : _state$configuration$20.apiInterface) != undefined) {
|
|
29294
29505
|
_iterator3 = _createForOfIteratorHelper$7(state.selected);
|
|
29295
29506
|
try {
|
|
29296
29507
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -29325,13 +29536,13 @@ function CopyButton(_ref5) {
|
|
|
29325
29536
|
}();
|
|
29326
29537
|
var onCopyAction = /*#__PURE__*/function () {
|
|
29327
29538
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
29328
|
-
var _state$configuration$
|
|
29539
|
+
var _state$configuration$21, _state$configuration$22;
|
|
29329
29540
|
var copyAction, id, data;
|
|
29330
29541
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
29331
29542
|
while (1) switch (_context4.prev = _context4.next) {
|
|
29332
29543
|
case 0:
|
|
29333
29544
|
copyAction = state.configuration.copyAction;
|
|
29334
|
-
if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$
|
|
29545
|
+
if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$21 = state.configuration.createAction) === null || _state$configuration$21 === void 0 ? void 0 : _state$configuration$21.actionType) != 'Detail')) {
|
|
29335
29546
|
_context4.next = 3;
|
|
29336
29547
|
break;
|
|
29337
29548
|
}
|
|
@@ -29355,7 +29566,7 @@ function CopyButton(_ref5) {
|
|
|
29355
29566
|
configurationId: copyAction === null || copyAction === void 0 ? void 0 : copyAction.id,
|
|
29356
29567
|
data: data.data[0],
|
|
29357
29568
|
type: copyAction === null || copyAction === void 0 ? void 0 : copyAction.type,
|
|
29358
|
-
mapping: (_state$configuration$
|
|
29569
|
+
mapping: (_state$configuration$22 = state.configuration.createAction) === null || _state$configuration$22 === void 0 ? void 0 : _state$configuration$22.mapping,
|
|
29359
29570
|
mappingData: data.data[0],
|
|
29360
29571
|
callback: function () {
|
|
29361
29572
|
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(e) {
|
|
@@ -29393,7 +29604,7 @@ function CopyButton(_ref5) {
|
|
|
29393
29604
|
return /*#__PURE__*/jsx(Button, {
|
|
29394
29605
|
type: "primary",
|
|
29395
29606
|
onClick: onCopy,
|
|
29396
|
-
disabled: state.selected.length == 0 || state.selected.length > 1 && ((_state$configuration$
|
|
29607
|
+
disabled: state.selected.length == 0 || state.selected.length > 1 && ((_state$configuration$23 = state.configuration.copyAction) === null || _state$configuration$23 === void 0 ? void 0 : _state$configuration$23.disableOnMultiselect),
|
|
29397
29608
|
children: t('backoffice.basetable.copy')
|
|
29398
29609
|
});
|
|
29399
29610
|
}
|
|
@@ -29514,7 +29725,7 @@ function BulkAction(_ref8) {
|
|
|
29514
29725
|
}
|
|
29515
29726
|
_context5.t0 = data;
|
|
29516
29727
|
_context5.next = 11;
|
|
29517
|
-
return apiInterface.update(_objectSpread$
|
|
29728
|
+
return apiInterface.update(_objectSpread$Q(_objectSpread$Q({}, dataEntry), updatedData), dataEntry, action.apiCallbackMapping);
|
|
29518
29729
|
case 11:
|
|
29519
29730
|
_context5.t1 = _context5.sent;
|
|
29520
29731
|
_context5.t0.push.call(_context5.t0, _context5.t1);
|
|
@@ -29627,8 +29838,8 @@ function SelectionText(_ref10) {
|
|
|
29627
29838
|
});
|
|
29628
29839
|
}
|
|
29629
29840
|
|
|
29630
|
-
function ownKeys$
|
|
29631
|
-
function _objectSpread$
|
|
29841
|
+
function ownKeys$P(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; }
|
|
29842
|
+
function _objectSpread$P(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$P(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$P(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29632
29843
|
function getColumnFilterProps (_ref) {
|
|
29633
29844
|
var filter = _ref.filter,
|
|
29634
29845
|
title = _ref.title;
|
|
@@ -29991,7 +30202,7 @@ var selectProps = function selectProps(title, filter) {
|
|
|
29991
30202
|
});
|
|
29992
30203
|
},
|
|
29993
30204
|
options: filter.map(function (f) {
|
|
29994
|
-
return _objectSpread$
|
|
30205
|
+
return _objectSpread$P(_objectSpread$P({}, f), {}, {
|
|
29995
30206
|
label: t(f.label)
|
|
29996
30207
|
});
|
|
29997
30208
|
})
|
|
@@ -30040,7 +30251,7 @@ var multiSelectProps = function multiSelectProps(title, filter) {
|
|
|
30040
30251
|
setDisplaySelectedvalues = _useState4[1];
|
|
30041
30252
|
var options = [];
|
|
30042
30253
|
options = filter.map(function (f) {
|
|
30043
|
-
return _objectSpread$
|
|
30254
|
+
return _objectSpread$P(_objectSpread$P({}, f), {}, {
|
|
30044
30255
|
label: t(f.label)
|
|
30045
30256
|
});
|
|
30046
30257
|
});
|
|
@@ -30114,8 +30325,8 @@ var multiSelectProps = function multiSelectProps(title, filter) {
|
|
|
30114
30325
|
};
|
|
30115
30326
|
};
|
|
30116
30327
|
|
|
30117
|
-
function ownKeys$
|
|
30118
|
-
function _objectSpread$
|
|
30328
|
+
function ownKeys$O(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; }
|
|
30329
|
+
function _objectSpread$O(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$O(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$O(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30119
30330
|
function mapColumns(configuration, userHasPermission, onUpdate, data, globalFilter) {
|
|
30120
30331
|
var columns = configuration.columns.filter(function (c) {
|
|
30121
30332
|
if (typeof c.hidden == 'boolean' && c.hidden) {
|
|
@@ -30168,7 +30379,7 @@ function mapColumns(configuration, userHasPermission, onUpdate, data, globalFilt
|
|
|
30168
30379
|
}
|
|
30169
30380
|
function mapColumn(column, onUpdate) {
|
|
30170
30381
|
var _column$field, _column$children;
|
|
30171
|
-
return _objectSpread$
|
|
30382
|
+
return _objectSpread$O(_objectSpread$O(_objectSpread$O({}, column), {}, {
|
|
30172
30383
|
hidden: false,
|
|
30173
30384
|
width: column.width || 100,
|
|
30174
30385
|
dataIndex: (_column$field = column.field) === null || _column$field === void 0 ? void 0 : _column$field.split('.'),
|
|
@@ -30218,8 +30429,8 @@ function updateData (_ref) {
|
|
|
30218
30429
|
};
|
|
30219
30430
|
}
|
|
30220
30431
|
|
|
30221
|
-
function ownKeys$
|
|
30222
|
-
function _objectSpread$
|
|
30432
|
+
function ownKeys$N(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; }
|
|
30433
|
+
function _objectSpread$N(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$N(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$N(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30223
30434
|
function applyFilterAndSortation (_ref) {
|
|
30224
30435
|
var data = _ref.data,
|
|
30225
30436
|
filters = _ref.filters,
|
|
@@ -30234,7 +30445,7 @@ function applyFilterAndSortation (_ref) {
|
|
|
30234
30445
|
processedData = sort(sorter || [], processedData);
|
|
30235
30446
|
return {
|
|
30236
30447
|
data: processedData,
|
|
30237
|
-
pagination: _objectSpread$
|
|
30448
|
+
pagination: _objectSpread$N(_objectSpread$N({}, pagination), {}, {
|
|
30238
30449
|
total: processedData.length
|
|
30239
30450
|
})
|
|
30240
30451
|
};
|
|
@@ -30319,8 +30530,8 @@ function filter(f, data) {
|
|
|
30319
30530
|
}
|
|
30320
30531
|
|
|
30321
30532
|
var _excluded$6 = ["_id"];
|
|
30322
|
-
function ownKeys$
|
|
30323
|
-
function _objectSpread$
|
|
30533
|
+
function ownKeys$M(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; }
|
|
30534
|
+
function _objectSpread$M(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$M(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$M(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30324
30535
|
function useTableData$1 (_ref) {
|
|
30325
30536
|
var _configuration$apiInt;
|
|
30326
30537
|
var id = _ref.id;
|
|
@@ -30375,7 +30586,7 @@ function useTableData$1 (_ref) {
|
|
|
30375
30586
|
var _configuration$create;
|
|
30376
30587
|
if (!dataRow) return;
|
|
30377
30588
|
var id = v4();
|
|
30378
|
-
var processedDataRow = unflatten(_objectSpread$
|
|
30589
|
+
var processedDataRow = unflatten(_objectSpread$M({
|
|
30379
30590
|
_id: id,
|
|
30380
30591
|
ID: id
|
|
30381
30592
|
}, dataRow));
|
|
@@ -30387,11 +30598,11 @@ function useTableData$1 (_ref) {
|
|
|
30387
30598
|
newData = _updateData.data;
|
|
30388
30599
|
_updateData.prevDataRow;
|
|
30389
30600
|
_updateData.index;
|
|
30390
|
-
var newState = _objectSpread$
|
|
30601
|
+
var newState = _objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30391
30602
|
data: newData
|
|
30392
30603
|
});
|
|
30393
30604
|
if (!filterServerSide) {
|
|
30394
|
-
var res = applyFilterAndSortation(_objectSpread$
|
|
30605
|
+
var res = applyFilterAndSortation(_objectSpread$M(_objectSpread$M({}, filterData), {}, {
|
|
30395
30606
|
data: newData
|
|
30396
30607
|
}));
|
|
30397
30608
|
newState.data = res.data;
|
|
@@ -30403,33 +30614,33 @@ function useTableData$1 (_ref) {
|
|
|
30403
30614
|
var formData = new FormData();
|
|
30404
30615
|
processedDataRow._id;
|
|
30405
30616
|
var value = _objectWithoutProperties(processedDataRow, _excluded$6);
|
|
30406
|
-
apiHandler.create(undefined, (_configuration$create = configuration.createMapping) !== null && _configuration$create !== void 0 ? _configuration$create : configuration.mapping, _objectSpread$
|
|
30617
|
+
apiHandler.create(undefined, (_configuration$create = configuration.createMapping) !== null && _configuration$create !== void 0 ? _configuration$create : configuration.mapping, _objectSpread$M(_objectSpread$M({}, catalogItem), {}, {
|
|
30407
30618
|
filterContex: filterContex,
|
|
30408
30619
|
value: JSON.stringify([value])
|
|
30409
30620
|
}), formData, catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.sessionGuid).then(function (d) {
|
|
30410
30621
|
if (d && d.Result && d.Result == 'Success') return;
|
|
30411
|
-
setState(_objectSpread$
|
|
30622
|
+
setState(_objectSpread$M({}, oldState));
|
|
30412
30623
|
});
|
|
30413
30624
|
}, [state, catalogItem, filterData]);
|
|
30414
30625
|
useEffect(function () {
|
|
30415
30626
|
if (!catalogItem) return;
|
|
30416
|
-
setState(_objectSpread$
|
|
30627
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30417
30628
|
loading: true,
|
|
30418
|
-
mappingData: _objectSpread$
|
|
30629
|
+
mappingData: _objectSpread$M(_objectSpread$M({}, catalogItem), {}, {
|
|
30419
30630
|
filterContex: filterContex
|
|
30420
30631
|
})
|
|
30421
30632
|
}));
|
|
30422
30633
|
if (!filterServerSide) {
|
|
30423
|
-
apiHandler.readList(configuration.mapping, _objectSpread$
|
|
30634
|
+
apiHandler.readList(configuration.mapping, _objectSpread$M(_objectSpread$M({}, catalogItem), {}, {
|
|
30424
30635
|
filterContex: filterContex
|
|
30425
30636
|
}), undefined, catalogItem.sessionGuid).then(function (data) {
|
|
30426
30637
|
var newData = data.data.map(function (d) {
|
|
30427
|
-
return _objectSpread$
|
|
30638
|
+
return _objectSpread$M(_objectSpread$M({}, d), {}, {
|
|
30428
30639
|
_id: d._id || d.ID || nanoid()
|
|
30429
30640
|
});
|
|
30430
30641
|
});
|
|
30431
30642
|
onChange({
|
|
30432
|
-
pagination: _objectSpread$
|
|
30643
|
+
pagination: _objectSpread$M({}, state.pagination),
|
|
30433
30644
|
filters: {},
|
|
30434
30645
|
sorter: mapColumns(configuration, root.actions.userHasPermission, onUpdate).filter(function (c) {
|
|
30435
30646
|
return c.defaultSortOrder;
|
|
@@ -30445,7 +30656,7 @@ function useTableData$1 (_ref) {
|
|
|
30445
30656
|
});
|
|
30446
30657
|
} else {
|
|
30447
30658
|
onChange({
|
|
30448
|
-
pagination: _objectSpread$
|
|
30659
|
+
pagination: _objectSpread$M({}, state.pagination),
|
|
30449
30660
|
filters: {},
|
|
30450
30661
|
sorter: mapColumns(configuration, root.actions.userHasPermission, onUpdate).filter(function (c) {
|
|
30451
30662
|
return c.defaultSortOrder;
|
|
@@ -30461,17 +30672,17 @@ function useTableData$1 (_ref) {
|
|
|
30461
30672
|
}
|
|
30462
30673
|
}, [filterContex, catalogItem]);
|
|
30463
30674
|
var onChange = function onChange(p, dataParam) {
|
|
30464
|
-
setState(_objectSpread$
|
|
30675
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30465
30676
|
loading: true
|
|
30466
30677
|
}));
|
|
30467
30678
|
if (!filterServerSide) {
|
|
30468
30679
|
var unfilteredData = dataParam ? dataParam : state.unfilteredData;
|
|
30469
|
-
var _applyFilterAndSortat = applyFilterAndSortation(_objectSpread$
|
|
30680
|
+
var _applyFilterAndSortat = applyFilterAndSortation(_objectSpread$M(_objectSpread$M({}, p), {}, {
|
|
30470
30681
|
data: unfilteredData
|
|
30471
30682
|
})),
|
|
30472
30683
|
data = _applyFilterAndSortat.data,
|
|
30473
30684
|
pagination = _applyFilterAndSortat.pagination;
|
|
30474
|
-
setState(_objectSpread$
|
|
30685
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30475
30686
|
data: data,
|
|
30476
30687
|
pagination: pagination,
|
|
30477
30688
|
loading: false,
|
|
@@ -30482,20 +30693,20 @@ function useTableData$1 (_ref) {
|
|
|
30482
30693
|
sorter: p.sorter
|
|
30483
30694
|
});
|
|
30484
30695
|
} else {
|
|
30485
|
-
apiHandler.readList(configuration.mapping, _objectSpread$
|
|
30696
|
+
apiHandler.readList(configuration.mapping, _objectSpread$M(_objectSpread$M({}, catalogItem), {}, {
|
|
30486
30697
|
filterContex: filterContex
|
|
30487
30698
|
}), p, catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.sessionGuid).then(function (data) {
|
|
30488
|
-
setState(_objectSpread$
|
|
30699
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30489
30700
|
data: data.data.map(function (dt) {
|
|
30490
|
-
return _objectSpread$
|
|
30701
|
+
return _objectSpread$M(_objectSpread$M({}, dt), {}, {
|
|
30491
30702
|
_id: dt._id || dt.ID || nanoid()
|
|
30492
30703
|
});
|
|
30493
30704
|
}),
|
|
30494
|
-
pagination: _objectSpread$
|
|
30705
|
+
pagination: _objectSpread$M(_objectSpread$M({}, p.pagination), {}, {
|
|
30495
30706
|
total: data.total
|
|
30496
30707
|
}),
|
|
30497
30708
|
loading: false,
|
|
30498
|
-
mappingData: _objectSpread$
|
|
30709
|
+
mappingData: _objectSpread$M(_objectSpread$M({}, catalogItem), {}, {
|
|
30499
30710
|
filterContex: filterContex
|
|
30500
30711
|
})
|
|
30501
30712
|
}));
|
|
@@ -30516,7 +30727,7 @@ function useTableData$1 (_ref) {
|
|
|
30516
30727
|
filters['_id'] = [id, 'eq', false];
|
|
30517
30728
|
_context.next = 4;
|
|
30518
30729
|
return apiHandler.readList(configuration.mapping, {
|
|
30519
|
-
pagination: _objectSpread$
|
|
30730
|
+
pagination: _objectSpread$M({}, state.pagination),
|
|
30520
30731
|
columns: configuration.columns,
|
|
30521
30732
|
filters: filters,
|
|
30522
30733
|
sorter: filterData.sorter
|
|
@@ -30535,7 +30746,7 @@ function useTableData$1 (_ref) {
|
|
|
30535
30746
|
};
|
|
30536
30747
|
}();
|
|
30537
30748
|
var onSelect = function onSelect(keys) {
|
|
30538
|
-
setState(_objectSpread$
|
|
30749
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30539
30750
|
selected: keys
|
|
30540
30751
|
}));
|
|
30541
30752
|
};
|
|
@@ -30545,7 +30756,7 @@ function useTableData$1 (_ref) {
|
|
|
30545
30756
|
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
30546
30757
|
while (1) switch (_context3.prev = _context3.next) {
|
|
30547
30758
|
case 0:
|
|
30548
|
-
setState(_objectSpread$
|
|
30759
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30549
30760
|
deleting: true
|
|
30550
30761
|
}));
|
|
30551
30762
|
newData = _toConsumableArray(state.data);
|
|
@@ -30560,7 +30771,7 @@ function useTableData$1 (_ref) {
|
|
|
30560
30771
|
mappingData = (_newData$filter = newData.filter(function (nd) {
|
|
30561
30772
|
return nd._id === state.selected[index];
|
|
30562
30773
|
})) === null || _newData$filter === void 0 ? void 0 : _newData$filter[0];
|
|
30563
|
-
mappingData = _objectSpread$
|
|
30774
|
+
mappingData = _objectSpread$M(_objectSpread$M({}, mappingData), state.mappingData);
|
|
30564
30775
|
_context2.next = 5;
|
|
30565
30776
|
return apiHandler["delete"](id, (_configuration$delete = configuration.deleteMapping) !== null && _configuration$delete !== void 0 ? _configuration$delete : configuration.mapping, mappingData, true, catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.sessionGuid);
|
|
30566
30777
|
case 5:
|
|
@@ -30610,7 +30821,7 @@ function useTableData$1 (_ref) {
|
|
|
30610
30821
|
}
|
|
30611
30822
|
_context3.next = 18;
|
|
30612
30823
|
return apiHandler.readList(configuration.mapping, {
|
|
30613
|
-
pagination: _objectSpread$
|
|
30824
|
+
pagination: _objectSpread$M(_objectSpread$M({}, state.pagination), {}, {
|
|
30614
30825
|
current: current
|
|
30615
30826
|
}),
|
|
30616
30827
|
columns: configuration.columns,
|
|
@@ -30622,11 +30833,11 @@ function useTableData$1 (_ref) {
|
|
|
30622
30833
|
newData = data.data;
|
|
30623
30834
|
total = data.total;
|
|
30624
30835
|
case 21:
|
|
30625
|
-
setState(_objectSpread$
|
|
30836
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30626
30837
|
selected: [],
|
|
30627
30838
|
deleting: false,
|
|
30628
30839
|
data: newData,
|
|
30629
|
-
pagination: _objectSpread$
|
|
30840
|
+
pagination: _objectSpread$M(_objectSpread$M({}, state.pagination), {}, {
|
|
30630
30841
|
current: current,
|
|
30631
30842
|
total: total
|
|
30632
30843
|
})
|
|
@@ -30642,12 +30853,12 @@ function useTableData$1 (_ref) {
|
|
|
30642
30853
|
};
|
|
30643
30854
|
}();
|
|
30644
30855
|
function setLoading() {
|
|
30645
|
-
setState(_objectSpread$
|
|
30856
|
+
setState(_objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30646
30857
|
loading: true
|
|
30647
30858
|
}));
|
|
30648
30859
|
}
|
|
30649
|
-
return _objectSpread$
|
|
30650
|
-
configuration: _objectSpread$
|
|
30860
|
+
return _objectSpread$M(_objectSpread$M({}, state), {}, {
|
|
30861
|
+
configuration: _objectSpread$M(_objectSpread$M({}, configuration), {}, {
|
|
30651
30862
|
title: undefined
|
|
30652
30863
|
}),
|
|
30653
30864
|
columns: mapColumns(configuration, root.actions.userHasPermission, onUpdate),
|
|
@@ -30743,8 +30954,8 @@ var translation = {
|
|
|
30743
30954
|
SUPPLIER: 'backoffice.translation.supplier'
|
|
30744
30955
|
};
|
|
30745
30956
|
|
|
30746
|
-
function ownKeys$
|
|
30747
|
-
function _objectSpread$
|
|
30957
|
+
function ownKeys$L(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; }
|
|
30958
|
+
function _objectSpread$L(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$L(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$L(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30748
30959
|
/**
|
|
30749
30960
|
* Route/menu-driven overrides for a single shared table module (e.g. list URL filter on `read.list`, default create payload).
|
|
30750
30961
|
*/
|
|
@@ -30752,10 +30963,10 @@ function mergeTableConfiguration(base, readListUrl, genericType) {
|
|
|
30752
30963
|
if (!readListUrl && !genericType) {
|
|
30753
30964
|
return base;
|
|
30754
30965
|
}
|
|
30755
|
-
var next = _objectSpread$
|
|
30966
|
+
var next = _objectSpread$L({}, base);
|
|
30756
30967
|
if (readListUrl && _typeof(next.apiInterface) === 'object' && next.apiInterface.read && _typeof(next.apiInterface.read) === 'object') {
|
|
30757
|
-
next.apiInterface = _objectSpread$
|
|
30758
|
-
read: _objectSpread$
|
|
30968
|
+
next.apiInterface = _objectSpread$L(_objectSpread$L({}, next.apiInterface), {}, {
|
|
30969
|
+
read: _objectSpread$L(_objectSpread$L({}, next.apiInterface.read), {}, {
|
|
30759
30970
|
list: readListUrl
|
|
30760
30971
|
})
|
|
30761
30972
|
});
|
|
@@ -30788,8 +30999,8 @@ function objectHash (obj) {
|
|
|
30788
30999
|
function _createForOfIteratorHelper$6(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$6(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
30789
31000
|
function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0; } }
|
|
30790
31001
|
function _arrayLikeToArray$6(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
30791
|
-
function ownKeys$
|
|
30792
|
-
function _objectSpread$
|
|
31002
|
+
function ownKeys$K(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; }
|
|
31003
|
+
function _objectSpread$K(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$K(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$K(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30793
31004
|
var LOG$3 = getLogger('Backoffice', 'TableData');
|
|
30794
31005
|
function useTableData (_ref) {
|
|
30795
31006
|
var _configuration$filter, _configuration$filter2, _configuration$filter3, _configuration$filter4, _configuration$bulkAc, _configuration$apiInt, _ref3, _configuration$readMa;
|
|
@@ -30812,8 +31023,8 @@ function useTableData (_ref) {
|
|
|
30812
31023
|
}
|
|
30813
31024
|
var base = baseConfiguration;
|
|
30814
31025
|
if (_typeof(base.apiInterface) === 'object' && base.apiInterface.read && _typeof(base.apiInterface.read) === 'object') {
|
|
30815
|
-
return root.getApiHandler(id, _objectSpread$
|
|
30816
|
-
read: _objectSpread$
|
|
31026
|
+
return root.getApiHandler(id, _objectSpread$K(_objectSpread$K({}, base.apiInterface), {}, {
|
|
31027
|
+
read: _objectSpread$K(_objectSpread$K({}, base.apiInterface.read), {}, {
|
|
30817
31028
|
list: readListUrlOverride
|
|
30818
31029
|
})
|
|
30819
31030
|
}));
|
|
@@ -30862,7 +31073,7 @@ function useTableData (_ref) {
|
|
|
30862
31073
|
var _useState13 = useState({
|
|
30863
31074
|
loading: true,
|
|
30864
31075
|
deleting: false,
|
|
30865
|
-
pagination: _objectSpread$
|
|
31076
|
+
pagination: _objectSpread$K({
|
|
30866
31077
|
current: 1,
|
|
30867
31078
|
pageSize: 20,
|
|
30868
31079
|
total: 0,
|
|
@@ -30871,7 +31082,7 @@ function useTableData (_ref) {
|
|
|
30871
31082
|
selected: [],
|
|
30872
31083
|
canDelete: !!apiHandler.canDelete,
|
|
30873
31084
|
canSelect: !!apiHandler.canDelete || !!((_configuration$bulkAc = configuration.bulkActions) !== null && _configuration$bulkAc !== void 0 && _configuration$bulkAc.length),
|
|
30874
|
-
mappingData: _objectSpread$
|
|
31085
|
+
mappingData: _objectSpread$K(_objectSpread$K({}, parentData), {}, {
|
|
30875
31086
|
prefilter: {
|
|
30876
31087
|
select: globalFilter.select
|
|
30877
31088
|
},
|
|
@@ -30882,7 +31093,7 @@ function useTableData (_ref) {
|
|
|
30882
31093
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
30883
31094
|
state = _useState14[0],
|
|
30884
31095
|
setState = _useState14[1];
|
|
30885
|
-
var mappingData = _objectSpread$
|
|
31096
|
+
var mappingData = _objectSpread$K(_objectSpread$K(_objectSpread$K({}, parentData), state.data), {}, {
|
|
30886
31097
|
catalogCodex: catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.codex,
|
|
30887
31098
|
sessionGuID: catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.sessionGuid
|
|
30888
31099
|
});
|
|
@@ -30922,7 +31133,7 @@ function useTableData (_ref) {
|
|
|
30922
31133
|
}
|
|
30923
31134
|
var dataArray = Array.isArray(data) ? data : [data];
|
|
30924
31135
|
var newInitData = initData;
|
|
30925
|
-
var newState = _objectSpread$
|
|
31136
|
+
var newState = _objectSpread$K({}, state);
|
|
30926
31137
|
var selected = [];
|
|
30927
31138
|
if (configuration.deselectOnUpdate == false) {
|
|
30928
31139
|
selected = state.selected;
|
|
@@ -30939,7 +31150,7 @@ function useTableData (_ref) {
|
|
|
30939
31150
|
dataRow: dataRow
|
|
30940
31151
|
}),
|
|
30941
31152
|
_data = _updateData.data;
|
|
30942
|
-
newState = _objectSpread$
|
|
31153
|
+
newState = _objectSpread$K(_objectSpread$K({}, newState), {}, {
|
|
30943
31154
|
data: _data,
|
|
30944
31155
|
selected: selected
|
|
30945
31156
|
});
|
|
@@ -30951,8 +31162,8 @@ function useTableData (_ref) {
|
|
|
30951
31162
|
dataRow: dataRow
|
|
30952
31163
|
}),
|
|
30953
31164
|
nextInitData = _updateData2.data;
|
|
30954
|
-
var _applyFilterAndSortat = applyFilterAndSortation(_objectSpread$
|
|
30955
|
-
filters: _objectSpread$
|
|
31165
|
+
var _applyFilterAndSortat = applyFilterAndSortation(_objectSpread$K(_objectSpread$K(_objectSpread$K({}, filterData), {}, {
|
|
31166
|
+
filters: _objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K({}, 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"])
|
|
30956
31167
|
}, 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 ? {
|
|
30957
31168
|
genericProps: globalFilter.toggle
|
|
30958
31169
|
} : undefined), {}, {
|
|
@@ -30962,7 +31173,7 @@ function useTableData (_ref) {
|
|
|
30962
31173
|
_data2 = _applyFilterAndSortat.data,
|
|
30963
31174
|
pagination = _applyFilterAndSortat.pagination;
|
|
30964
31175
|
newInitData = nextInitData;
|
|
30965
|
-
newState = _objectSpread$
|
|
31176
|
+
newState = _objectSpread$K(_objectSpread$K({}, newState), {}, {
|
|
30966
31177
|
pagination: pagination,
|
|
30967
31178
|
data: _data2,
|
|
30968
31179
|
selected: selected
|
|
@@ -30972,8 +31183,8 @@ function useTableData (_ref) {
|
|
|
30972
31183
|
if (apiHandler.canCreate) {
|
|
30973
31184
|
apiCreate(data).then(function (res) {
|
|
30974
31185
|
if (!res || (res === null || res === void 0 ? void 0 : res.Error) !== undefined) {
|
|
30975
|
-
initData && setInitData(_objectSpread$
|
|
30976
|
-
setState(_objectSpread$
|
|
31186
|
+
initData && setInitData(_objectSpread$K({}, initData));
|
|
31187
|
+
setState(_objectSpread$K({}, state));
|
|
30977
31188
|
}
|
|
30978
31189
|
});
|
|
30979
31190
|
}
|
|
@@ -30986,7 +31197,7 @@ function useTableData (_ref) {
|
|
|
30986
31197
|
var triggerRefresh = function triggerRefresh() {
|
|
30987
31198
|
var _configuration$filter8;
|
|
30988
31199
|
setError(undefined);
|
|
30989
|
-
var newGlobalFilter = _objectSpread$
|
|
31200
|
+
var newGlobalFilter = _objectSpread$K({}, globalFilter);
|
|
30990
31201
|
//on refresh update default filter, since global value can change
|
|
30991
31202
|
if ((_configuration$filter8 = configuration.filter) !== null && _configuration$filter8 !== void 0 && _configuration$filter8["default"]) {
|
|
30992
31203
|
var _configuration$filter9;
|
|
@@ -30997,7 +31208,7 @@ function useTableData (_ref) {
|
|
|
30997
31208
|
newGlobalFilter["default"] = _defaultFilter;
|
|
30998
31209
|
setGlobaFilter(newGlobalFilter);
|
|
30999
31210
|
}
|
|
31000
|
-
onChange(_objectSpread$
|
|
31211
|
+
onChange(_objectSpread$K({
|
|
31001
31212
|
pagination: state.pagination
|
|
31002
31213
|
}, filterData), newGlobalFilter, true);
|
|
31003
31214
|
};
|
|
@@ -31015,7 +31226,7 @@ function useTableData (_ref) {
|
|
|
31015
31226
|
order: c.defaultSortOrder
|
|
31016
31227
|
};
|
|
31017
31228
|
});
|
|
31018
|
-
if (configuration.initialCall === false && !catalogItem) setState(_objectSpread$
|
|
31229
|
+
if (configuration.initialCall === false && !catalogItem) setState(_objectSpread$K(_objectSpread$K({}, state), {}, {
|
|
31019
31230
|
loading: false
|
|
31020
31231
|
}));else {
|
|
31021
31232
|
onChange({
|
|
@@ -31058,7 +31269,7 @@ function useTableData (_ref) {
|
|
|
31058
31269
|
case 0:
|
|
31059
31270
|
filters = {};
|
|
31060
31271
|
filters['_id'] = [id, 'eq', false];
|
|
31061
|
-
ssf = _objectSpread$
|
|
31272
|
+
ssf = _objectSpread$K({
|
|
31062
31273
|
pagination: {
|
|
31063
31274
|
current: 1,
|
|
31064
31275
|
pageSize: 1
|
|
@@ -31069,7 +31280,7 @@ function useTableData (_ref) {
|
|
|
31069
31280
|
genericProps: globalFilter.toggle
|
|
31070
31281
|
} : undefined);
|
|
31071
31282
|
_context2.next = 5;
|
|
31072
|
-
return apiHandler.readList(readMapping, _objectSpread$
|
|
31283
|
+
return apiHandler.readList(readMapping, _objectSpread$K(_objectSpread$K({}, mappingData), state.mappingData), ssf);
|
|
31073
31284
|
case 5:
|
|
31074
31285
|
data = _context2.sent;
|
|
31075
31286
|
return _context2.abrupt("return", data);
|
|
@@ -31113,12 +31324,12 @@ function useTableData (_ref) {
|
|
|
31113
31324
|
refresh = _args3.length > 2 ? _args3[2] : undefined;
|
|
31114
31325
|
clearSelection = _args3.length > 3 ? _args3[3] : undefined;
|
|
31115
31326
|
overwriteMappingData = _args3.length > 4 ? _args3[4] : undefined;
|
|
31116
|
-
setState(_objectSpread$
|
|
31327
|
+
setState(_objectSpread$K(_objectSpread$K({}, state), {}, {
|
|
31117
31328
|
mappingData: overwriteMappingData !== null && overwriteMappingData !== void 0 ? overwriteMappingData : state.mappingData,
|
|
31118
31329
|
loading: true
|
|
31119
31330
|
}));
|
|
31120
31331
|
currentData = initData;
|
|
31121
|
-
filterData = _objectSpread$
|
|
31332
|
+
filterData = _objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K({}, prefilter.search), ((_configuration$filter11 = configuration.filter) === null || _configuration$filter11 === void 0 || (_configuration$filter11 = _configuration$filter11.select) === null || _configuration$filter11 === void 0 ? void 0 : _configuration$filter11.applyDefaultValue) !== false || ((_configuration$filter12 = configuration.filter) === null || _configuration$filter12 === void 0 || (_configuration$filter12 = _configuration$filter12.select) === null || _configuration$filter12 === void 0 ? void 0 : _configuration$filter12.defaultValue) !== ((_prefilter$select = prefilter.select) === null || _prefilter$select === void 0 || (_prefilter$select = _prefilter$select[(_configuration$filter13 = (_configuration$filter14 = configuration.filter) === null || _configuration$filter14 === void 0 || (_configuration$filter14 = _configuration$filter14.select) === null || _configuration$filter14 === void 0 ? void 0 : _configuration$filter14.filterField) !== null && _configuration$filter13 !== void 0 ? _configuration$filter13 : '']) === null || _prefilter$select === void 0 ? void 0 : _prefilter$select[0]) ? prefilter.select : undefined), prefilter.timeStamp), prefilter["default"]); //remove all null values
|
|
31122
31333
|
filterData = Object.fromEntries(Object.entries(filterData).filter(function (_ref7) {
|
|
31123
31334
|
var _ref8 = _slicedToArray(_ref7, 2);
|
|
31124
31335
|
_ref8[0];
|
|
@@ -31126,7 +31337,7 @@ function useTableData (_ref) {
|
|
|
31126
31337
|
return v != null;
|
|
31127
31338
|
}));
|
|
31128
31339
|
currentFilterHash = objectHash(filterData);
|
|
31129
|
-
currentPagination = _objectSpread$
|
|
31340
|
+
currentPagination = _objectSpread$K(_objectSpread$K({}, p.pagination), {}, {
|
|
31130
31341
|
current: currentFilterHash == filterHash.current ? p.pagination.current : 1
|
|
31131
31342
|
});
|
|
31132
31343
|
filterHash.current = currentFilterHash;
|
|
@@ -31134,7 +31345,7 @@ function useTableData (_ref) {
|
|
|
31134
31345
|
_context3.next = 21;
|
|
31135
31346
|
break;
|
|
31136
31347
|
}
|
|
31137
|
-
ssf = _objectSpread$
|
|
31348
|
+
ssf = _objectSpread$K({
|
|
31138
31349
|
pagination: currentPagination,
|
|
31139
31350
|
columns: configuration.columns,
|
|
31140
31351
|
filters: filterData,
|
|
@@ -31143,12 +31354,12 @@ function useTableData (_ref) {
|
|
|
31143
31354
|
genericProps: prefilter.toggle
|
|
31144
31355
|
} : undefined);
|
|
31145
31356
|
_context3.next = 15;
|
|
31146
|
-
return apiHandler.readList(readMapping, _objectSpread$
|
|
31357
|
+
return apiHandler.readList(readMapping, _objectSpread$K(_objectSpread$K({}, mappingData), overwriteMappingData), ssf, catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.sessionGuid, parseFilter(!(configuration !== null && configuration !== void 0 && (_configuration$filter16 = configuration.filter) !== null && _configuration$filter16 !== void 0 && (_configuration$filter16 = _configuration$filter16.toggle) !== null && _configuration$filter16 !== void 0 && _configuration$filter16.inQuery) ? (_prefilter$toggle = prefilter.toggle) !== null && _prefilter$toggle !== void 0 ? _prefilter$toggle : {} : {}, (_parseFilter = parseFilter(p.filters, undefined)) === null || _parseFilter === void 0 ? void 0 : _parseFilter.slice(1, -1)));
|
|
31147
31358
|
case 15:
|
|
31148
31359
|
data = _context3.sent;
|
|
31149
|
-
currentUrl = apiHandler.getReadListUrl(readMapping, _objectSpread$
|
|
31360
|
+
currentUrl = apiHandler.getReadListUrl(readMapping, _objectSpread$K(_objectSpread$K({}, mappingData), state.mappingData), ssf);
|
|
31150
31361
|
currentData = data.data;
|
|
31151
|
-
currentPagination = _objectSpread$
|
|
31362
|
+
currentPagination = _objectSpread$K(_objectSpread$K({}, currentPagination), {}, {
|
|
31152
31363
|
total: data.total
|
|
31153
31364
|
});
|
|
31154
31365
|
_context3.next = 30;
|
|
@@ -31165,7 +31376,7 @@ function useTableData (_ref) {
|
|
|
31165
31376
|
currentData = _data3.data;
|
|
31166
31377
|
setInitData(currentData);
|
|
31167
31378
|
case 27:
|
|
31168
|
-
_applyFilterAndSortat2 = applyFilterAndSortation(_objectSpread$
|
|
31379
|
+
_applyFilterAndSortat2 = applyFilterAndSortation(_objectSpread$K(_objectSpread$K({}, p), {}, {
|
|
31169
31380
|
pagination: currentPagination,
|
|
31170
31381
|
filters: filterData,
|
|
31171
31382
|
data: currentData,
|
|
@@ -31174,11 +31385,11 @@ function useTableData (_ref) {
|
|
|
31174
31385
|
currentData = _data4;
|
|
31175
31386
|
currentPagination = pagination;
|
|
31176
31387
|
case 30:
|
|
31177
|
-
setState(_objectSpread$
|
|
31388
|
+
setState(_objectSpread$K(_objectSpread$K({}, state), {}, {
|
|
31178
31389
|
loading: false,
|
|
31179
31390
|
data: currentData,
|
|
31180
31391
|
pagination: currentPagination,
|
|
31181
|
-
mappingData: _objectSpread$
|
|
31392
|
+
mappingData: _objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K({}, parentData), state.mappingData), overwriteMappingData), {}, {
|
|
31182
31393
|
prefilter: prefilter
|
|
31183
31394
|
}),
|
|
31184
31395
|
currentFetchUrl: currentUrl
|
|
@@ -31200,7 +31411,7 @@ function useTableData (_ref) {
|
|
|
31200
31411
|
};
|
|
31201
31412
|
}();
|
|
31202
31413
|
var onSelect = function onSelect(keys) {
|
|
31203
|
-
setState(_objectSpread$
|
|
31414
|
+
setState(_objectSpread$K(_objectSpread$K({}, state), {}, {
|
|
31204
31415
|
selected: keys
|
|
31205
31416
|
}));
|
|
31206
31417
|
};
|
|
@@ -31211,7 +31422,7 @@ function useTableData (_ref) {
|
|
|
31211
31422
|
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
31212
31423
|
while (1) switch (_context5.prev = _context5.next) {
|
|
31213
31424
|
case 0:
|
|
31214
|
-
setState(_objectSpread$
|
|
31425
|
+
setState(_objectSpread$K(_objectSpread$K({}, state), {}, {
|
|
31215
31426
|
deleting: true
|
|
31216
31427
|
}));
|
|
31217
31428
|
newData = _toConsumableArray(state.data);
|
|
@@ -31251,7 +31462,7 @@ function useTableData (_ref) {
|
|
|
31251
31462
|
} finally {
|
|
31252
31463
|
_iterator.f();
|
|
31253
31464
|
}
|
|
31254
|
-
mappingData = _objectSpread$
|
|
31465
|
+
mappingData = _objectSpread$K(_objectSpread$K(_objectSpread$K({}, mappingData), state.mappingData), mapToggle);
|
|
31255
31466
|
deleteResult = undefined;
|
|
31256
31467
|
_context4.prev = 7;
|
|
31257
31468
|
if (!(userPermissions && !root.actions.userHasPermission(userPermissions))) {
|
|
@@ -31341,12 +31552,12 @@ function useTableData (_ref) {
|
|
|
31341
31552
|
break;
|
|
31342
31553
|
}
|
|
31343
31554
|
_context5.next = 25;
|
|
31344
|
-
return apiHandler.readList(readMapping, _objectSpread$
|
|
31345
|
-
pagination: _objectSpread$
|
|
31555
|
+
return apiHandler.readList(readMapping, _objectSpread$K(_objectSpread$K({}, mappingData), state.mappingData), _objectSpread$K({
|
|
31556
|
+
pagination: _objectSpread$K(_objectSpread$K({}, state.pagination), {}, {
|
|
31346
31557
|
current: current
|
|
31347
31558
|
}),
|
|
31348
31559
|
columns: configuration.columns,
|
|
31349
|
-
filters: _objectSpread$
|
|
31560
|
+
filters: _objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K(_objectSpread$K({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter17 = configuration.filter) !== null && _configuration$filter17 !== void 0 && (_configuration$filter17 = _configuration$filter17.toggle) !== null && _configuration$filter17 !== void 0 && _configuration$filter17.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"]),
|
|
31350
31561
|
sorter: filterData.sorter
|
|
31351
31562
|
}, configuration !== null && configuration !== void 0 && (_configuration$filter18 = configuration.filter) !== null && _configuration$filter18 !== void 0 && (_configuration$filter18 = _configuration$filter18.toggle) !== null && _configuration$filter18 !== void 0 && _configuration$filter18.inQuery ? {
|
|
31352
31563
|
genericProps: globalFilter.toggle
|
|
@@ -31357,11 +31568,11 @@ function useTableData (_ref) {
|
|
|
31357
31568
|
total = data.total;
|
|
31358
31569
|
case 28:
|
|
31359
31570
|
setInitData(newInitData);
|
|
31360
|
-
setState(_objectSpread$
|
|
31571
|
+
setState(_objectSpread$K(_objectSpread$K({}, state), {}, {
|
|
31361
31572
|
selected: [],
|
|
31362
31573
|
deleting: false,
|
|
31363
31574
|
data: newData,
|
|
31364
|
-
pagination: _objectSpread$
|
|
31575
|
+
pagination: _objectSpread$K(_objectSpread$K({}, state.pagination), {}, {
|
|
31365
31576
|
current: current === 0 ? 1 : current,
|
|
31366
31577
|
total: total
|
|
31367
31578
|
})
|
|
@@ -31382,14 +31593,14 @@ function useTableData (_ref) {
|
|
|
31382
31593
|
LOG$3.error(new DivaError('No global select filter defiend'));
|
|
31383
31594
|
return;
|
|
31384
31595
|
}
|
|
31385
|
-
var newGlobalFilter = _objectSpread$
|
|
31596
|
+
var newGlobalFilter = _objectSpread$K({}, globalFilter);
|
|
31386
31597
|
if (value !== null && value !== void 0 && value.length) {
|
|
31387
31598
|
newGlobalFilter.select = _defineProperty({}, configuration.filter.select.filterField, Array.isArray(value) ? value : [value]);
|
|
31388
31599
|
} else {
|
|
31389
31600
|
newGlobalFilter.select = {};
|
|
31390
31601
|
}
|
|
31391
31602
|
setGlobaFilter(newGlobalFilter);
|
|
31392
|
-
onChange(_objectSpread$
|
|
31603
|
+
onChange(_objectSpread$K({
|
|
31393
31604
|
pagination: state.pagination
|
|
31394
31605
|
}, filterData), newGlobalFilter);
|
|
31395
31606
|
};
|
|
@@ -31400,16 +31611,16 @@ function useTableData (_ref) {
|
|
|
31400
31611
|
return;
|
|
31401
31612
|
}
|
|
31402
31613
|
var toggleFilter = {};
|
|
31403
|
-
var mappingData = _objectSpread$
|
|
31614
|
+
var mappingData = _objectSpread$K({}, state.mappingData);
|
|
31404
31615
|
configuration.filter.toggle.fields.forEach(function (f) {
|
|
31405
31616
|
mappingData[f] = !globalFilter.toggle && configuration.filter.toggle.globalValue ? root.getGlobalValue(configuration.filter.toggle.globalValue) : undefined;
|
|
31406
31617
|
toggleFilter[f] = [configuration.filter.toggle.globalValue ? root.getGlobalValue(configuration.filter.toggle.globalValue) : true, 'eq', !configuration.filter.toggle.isAnd];
|
|
31407
31618
|
});
|
|
31408
|
-
var newGlobalFilter = _objectSpread$
|
|
31619
|
+
var newGlobalFilter = _objectSpread$K(_objectSpread$K({}, globalFilter), {}, {
|
|
31409
31620
|
toggle: globalFilter.toggle ? undefined : toggleFilter
|
|
31410
31621
|
});
|
|
31411
31622
|
setGlobaFilter(newGlobalFilter);
|
|
31412
|
-
onChange(_objectSpread$
|
|
31623
|
+
onChange(_objectSpread$K({
|
|
31413
31624
|
pagination: state.pagination
|
|
31414
31625
|
}, filterData), newGlobalFilter, true, true, mappingData);
|
|
31415
31626
|
};
|
|
@@ -31422,44 +31633,45 @@ function useTableData (_ref) {
|
|
|
31422
31633
|
LOG$3.error(new DivaError('No global search filter defiend'));
|
|
31423
31634
|
return;
|
|
31424
31635
|
}
|
|
31425
|
-
var newGlobalFilter = _objectSpread$
|
|
31636
|
+
var newGlobalFilter = _objectSpread$K(_objectSpread$K({}, globalFilter), {}, {
|
|
31426
31637
|
search: {}
|
|
31427
31638
|
});
|
|
31428
31639
|
if (value) {
|
|
31429
31640
|
var _configuration$filter24;
|
|
31430
31641
|
(_configuration$filter24 = configuration.filter) === null || _configuration$filter24 === void 0 || _configuration$filter24.search.fields.forEach(function (f) {
|
|
31431
31642
|
if (typeof f == 'string') {
|
|
31432
|
-
|
|
31643
|
+
var _configuration$filter25, _configuration$filter26;
|
|
31644
|
+
newGlobalFilter.search[f] = [value, (_configuration$filter25 = (_configuration$filter26 = configuration.filter) === null || _configuration$filter26 === void 0 ? void 0 : _configuration$filter26.operation) !== null && _configuration$filter25 !== void 0 ? _configuration$filter25 : 'contains', 1]; //normally global search should be or, so 1
|
|
31433
31645
|
} else {
|
|
31434
31646
|
newGlobalFilter.search[f[0]] = [value, f[1], 1];
|
|
31435
31647
|
}
|
|
31436
31648
|
});
|
|
31437
31649
|
}
|
|
31438
31650
|
setGlobaFilter(newGlobalFilter);
|
|
31439
|
-
onChange(_objectSpread$
|
|
31651
|
+
onChange(_objectSpread$K({
|
|
31440
31652
|
pagination: state.pagination
|
|
31441
31653
|
}, filterData), newGlobalFilter);
|
|
31442
31654
|
};
|
|
31443
31655
|
var onGlobalFilterPeriod = function onGlobalFilterPeriod(from, to) {
|
|
31444
|
-
var _configuration$
|
|
31445
|
-
if (!((_configuration$
|
|
31656
|
+
var _configuration$filter27;
|
|
31657
|
+
if (!((_configuration$filter27 = configuration.filter) !== null && _configuration$filter27 !== void 0 && _configuration$filter27.period)) {
|
|
31446
31658
|
LOG$3.error(new DivaError('No global period filter defiend'));
|
|
31447
31659
|
return;
|
|
31448
31660
|
}
|
|
31449
|
-
var newGlobalFilter = _objectSpread$
|
|
31661
|
+
var newGlobalFilter = _objectSpread$K({}, globalFilter);
|
|
31450
31662
|
newGlobalFilter.timeStamp = {
|
|
31451
31663
|
fromTimeStamp: [from],
|
|
31452
31664
|
toTimeStamp: [to]
|
|
31453
31665
|
};
|
|
31454
31666
|
if (!configuration.filter.period.onlyAsMappingData) setGlobaFilter(newGlobalFilter);
|
|
31455
|
-
onChange(_objectSpread$
|
|
31667
|
+
onChange(_objectSpread$K({
|
|
31456
31668
|
pagination: state.pagination
|
|
31457
|
-
}, filterData), undefined, true, undefined, _objectSpread$
|
|
31669
|
+
}, filterData), undefined, true, undefined, _objectSpread$K(_objectSpread$K({}, state.mappingData), {}, {
|
|
31458
31670
|
from: from,
|
|
31459
31671
|
to: to
|
|
31460
31672
|
}));
|
|
31461
31673
|
};
|
|
31462
|
-
return _objectSpread$
|
|
31674
|
+
return _objectSpread$K(_objectSpread$K({}, state), {}, {
|
|
31463
31675
|
title: title,
|
|
31464
31676
|
configuration: configuration,
|
|
31465
31677
|
columns: mapColumns(configuration, root.actions.userHasPermission, onUpdate, selectedData, globalFilter),
|
|
@@ -31505,8 +31717,8 @@ function StandardTable (_ref) {
|
|
|
31505
31717
|
});
|
|
31506
31718
|
}
|
|
31507
31719
|
|
|
31508
|
-
function ownKeys$
|
|
31509
|
-
function _objectSpread$
|
|
31720
|
+
function ownKeys$J(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; }
|
|
31721
|
+
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$J(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$J(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31510
31722
|
function Table (props) {
|
|
31511
31723
|
var root = useStore();
|
|
31512
31724
|
var variant = useMemo(function () {
|
|
@@ -31514,15 +31726,15 @@ function Table (props) {
|
|
|
31514
31726
|
return config.variant;
|
|
31515
31727
|
}, [props.id]);
|
|
31516
31728
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
31517
|
-
children: [(variant == 'Standard' || !variant) && /*#__PURE__*/jsx(StandardTable, _objectSpread$
|
|
31729
|
+
children: [(variant == 'Standard' || !variant) && /*#__PURE__*/jsx(StandardTable, _objectSpread$J({}, props)), variant == 'CatalogTable' && /*#__PURE__*/jsx(CatalogTable, _objectSpread$J({}, props))]
|
|
31518
31730
|
});
|
|
31519
31731
|
}
|
|
31520
31732
|
|
|
31521
31733
|
function _createForOfIteratorHelper$5(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$5(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
31522
31734
|
function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; } }
|
|
31523
31735
|
function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
31524
|
-
function ownKeys$
|
|
31525
|
-
function _objectSpread$
|
|
31736
|
+
function ownKeys$I(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; }
|
|
31737
|
+
function _objectSpread$I(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$I(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$I(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31526
31738
|
function useAGGrid (_ref) {
|
|
31527
31739
|
var id = _ref.id,
|
|
31528
31740
|
filter = _ref.filter,
|
|
@@ -31616,7 +31828,7 @@ function useAGGrid (_ref) {
|
|
|
31616
31828
|
value = _ref3[1];
|
|
31617
31829
|
if (_idx == 0) {
|
|
31618
31830
|
var _supplierData$Options2, _supplierData$Options3, _supplierData$Optionv2, _supplierData$Optionv3;
|
|
31619
|
-
rdat.push(_objectSpread$
|
|
31831
|
+
rdat.push(_objectSpread$I(_objectSpread$I({}, rd), {}, {
|
|
31620
31832
|
grouping: [idx.toString()]
|
|
31621
31833
|
}));
|
|
31622
31834
|
var sp = key.split(':');
|
|
@@ -31759,8 +31971,8 @@ var value = "value-FCA-6";
|
|
|
31759
31971
|
var css_248z$n = ".overlay-lm0tm {\n position: absolute;\n z-index: 1;\n background-color: rgba(247,247,247,0.45882);\n height: 60vh;\n width: 100%;\n}\n.loader-LaXZy {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 50px;\n height: 50px;\n border: 3px solid rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n border-top-color: #fff;\n animation: spin-qUdpu 1s ease-in-out infinite;\n -webkit-animation: spin-qUdpu 1s ease-in-out infinite;\n}\n.flex-yQdda {\n display: flex;\n}\n\n.bar-Y663f {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n margin-top: 7%;\n}\n\n.value-FCA-6 {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: -moz-fit-content;\n width: fit-content;\n}\n@keyframes spin-qUdpu {\n to {\n -webkit-transform: rotate(360deg);\n }\n}\n";
|
|
31760
31972
|
styleInject(css_248z$n);
|
|
31761
31973
|
|
|
31762
|
-
function ownKeys$
|
|
31763
|
-
function _objectSpread$
|
|
31974
|
+
function ownKeys$H(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; }
|
|
31975
|
+
function _objectSpread$H(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$H(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$H(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31764
31976
|
var AGChart = function AGChart(_ref) {
|
|
31765
31977
|
var data = _ref.data;
|
|
31766
31978
|
var groupedData = [];
|
|
@@ -31768,11 +31980,11 @@ var AGChart = function AGChart(_ref) {
|
|
|
31768
31980
|
data.forEach(function (dt) {
|
|
31769
31981
|
if (dt.count == 0) return;
|
|
31770
31982
|
if (groupedData.length > dt.grouping[0]) {
|
|
31771
|
-
groupedData[dt.grouping[0]].push(_objectSpread$
|
|
31983
|
+
groupedData[dt.grouping[0]].push(_objectSpread$H(_objectSpread$H({}, dt), {}, {
|
|
31772
31984
|
count: Number(dt.count)
|
|
31773
31985
|
}));
|
|
31774
31986
|
} else {
|
|
31775
|
-
groupedData.push([_objectSpread$
|
|
31987
|
+
groupedData.push([_objectSpread$H(_objectSpread$H({}, dt), {}, {
|
|
31776
31988
|
count: Number(dt.count)
|
|
31777
31989
|
})]);
|
|
31778
31990
|
}
|
|
@@ -31813,8 +32025,8 @@ var AGChart = function AGChart(_ref) {
|
|
|
31813
32025
|
});
|
|
31814
32026
|
};
|
|
31815
32027
|
|
|
31816
|
-
function ownKeys$
|
|
31817
|
-
function _objectSpread$
|
|
32028
|
+
function ownKeys$G(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; }
|
|
32029
|
+
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; }
|
|
31818
32030
|
var AGGrid = /*#__PURE__*/memo(function (_ref) {
|
|
31819
32031
|
var id = _ref.id,
|
|
31820
32032
|
filter = _ref.filter,
|
|
@@ -31907,7 +32119,7 @@ var AGGrid = /*#__PURE__*/memo(function (_ref) {
|
|
|
31907
32119
|
});
|
|
31908
32120
|
});
|
|
31909
32121
|
}
|
|
31910
|
-
return _objectSpread$
|
|
32122
|
+
return _objectSpread$G(_objectSpread$G({}, column), {}, {
|
|
31911
32123
|
cellRenderer: renderer
|
|
31912
32124
|
});
|
|
31913
32125
|
});
|
|
@@ -32177,8 +32389,8 @@ var CustomText = function CustomText(_ref) {
|
|
|
32177
32389
|
};
|
|
32178
32390
|
var CustomText$1 = observer(CustomText);
|
|
32179
32391
|
|
|
32180
|
-
function ownKeys$
|
|
32181
|
-
function _objectSpread$
|
|
32392
|
+
function ownKeys$F(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; }
|
|
32393
|
+
function _objectSpread$F(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$F(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$F(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32182
32394
|
function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
32183
32395
|
function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
|
|
32184
32396
|
function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -32241,7 +32453,7 @@ function useFilterBoxData (id) {
|
|
|
32241
32453
|
} finally {
|
|
32242
32454
|
_iterator.f();
|
|
32243
32455
|
}
|
|
32244
|
-
return _objectSpread$
|
|
32456
|
+
return _objectSpread$F(_objectSpread$F({}, state), ob);
|
|
32245
32457
|
}
|
|
32246
32458
|
return {
|
|
32247
32459
|
configuration: configuration,
|
|
@@ -32255,8 +32467,8 @@ function useFilterBoxData (id) {
|
|
|
32255
32467
|
function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
32256
32468
|
function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
|
|
32257
32469
|
function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
32258
|
-
function ownKeys$
|
|
32259
|
-
function _objectSpread$
|
|
32470
|
+
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; }
|
|
32471
|
+
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; }
|
|
32260
32472
|
var FilterBox = /*#__PURE__*/memo(function (_ref) {
|
|
32261
32473
|
var id = _ref.id,
|
|
32262
32474
|
onChangeFilter = _ref.onChangeFilter,
|
|
@@ -32284,7 +32496,7 @@ var FilterBox = /*#__PURE__*/memo(function (_ref) {
|
|
|
32284
32496
|
}), /*#__PURE__*/jsx("br", {}), /*#__PURE__*/jsx(Select, {
|
|
32285
32497
|
mode: "single",
|
|
32286
32498
|
apiInterface: filter.requestOptions,
|
|
32287
|
-
wholeData: _objectSpread$
|
|
32499
|
+
wholeData: _objectSpread$E(_objectSpread$E({}, state.filter), {}, {
|
|
32288
32500
|
tab: tab
|
|
32289
32501
|
}),
|
|
32290
32502
|
mapping: filter.requestMapping,
|
|
@@ -32516,8 +32728,8 @@ var FilterBox = /*#__PURE__*/memo(function (_ref) {
|
|
|
32516
32728
|
return false;
|
|
32517
32729
|
});
|
|
32518
32730
|
|
|
32519
|
-
function ownKeys$
|
|
32520
|
-
function _objectSpread$
|
|
32731
|
+
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; }
|
|
32732
|
+
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; }
|
|
32521
32733
|
function useUIBuilderData (id) {
|
|
32522
32734
|
var save = undefined;
|
|
32523
32735
|
var root = useStore();
|
|
@@ -32549,7 +32761,7 @@ function useUIBuilderData (id) {
|
|
|
32549
32761
|
var configuration = _useMemo.configuration;
|
|
32550
32762
|
useEffect(function () {
|
|
32551
32763
|
root.dataStore.getApi2SessionGuid().then(function (res) {
|
|
32552
|
-
return setFilter(_objectSpread$
|
|
32764
|
+
return setFilter(_objectSpread$D(_objectSpread$D({}, filter), {}, {
|
|
32553
32765
|
sessionGuid: res
|
|
32554
32766
|
}));
|
|
32555
32767
|
});
|
|
@@ -32572,8 +32784,8 @@ function useUIBuilderData (id) {
|
|
|
32572
32784
|
};
|
|
32573
32785
|
}
|
|
32574
32786
|
|
|
32575
|
-
function ownKeys$
|
|
32576
|
-
function _objectSpread$
|
|
32787
|
+
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; }
|
|
32788
|
+
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; }
|
|
32577
32789
|
function UIBuilder(_ref) {
|
|
32578
32790
|
var id = _ref.id;
|
|
32579
32791
|
var state = useUIBuilderData(id);
|
|
@@ -32600,7 +32812,7 @@ function UIBuilder(_ref) {
|
|
|
32600
32812
|
override = {
|
|
32601
32813
|
value: newFilter[item.field],
|
|
32602
32814
|
setValue: function setValue(newVal) {
|
|
32603
|
-
var newFilter = _objectSpread$
|
|
32815
|
+
var newFilter = _objectSpread$C({}, state.filter);
|
|
32604
32816
|
newFilter[item.field] = newVal;
|
|
32605
32817
|
state.setFilter(newFilter);
|
|
32606
32818
|
}
|
|
@@ -32648,7 +32860,7 @@ function UIBuilder(_ref) {
|
|
|
32648
32860
|
case 'AGGrid':
|
|
32649
32861
|
return /*#__PURE__*/jsx(AGGrid, {
|
|
32650
32862
|
id: item.id,
|
|
32651
|
-
filter: _objectSpread$
|
|
32863
|
+
filter: _objectSpread$C({
|
|
32652
32864
|
optionCodices: JSON.stringify(state.data)
|
|
32653
32865
|
}, state.filter),
|
|
32654
32866
|
override: item.id == 'AGGridTopOptionValues' ? {
|
|
@@ -32812,8 +33024,8 @@ var OrgItem = function OrgItem(_ref) {
|
|
|
32812
33024
|
};
|
|
32813
33025
|
var OrgItem$1 = observer(OrgItem);
|
|
32814
33026
|
|
|
32815
|
-
function ownKeys$
|
|
32816
|
-
function _objectSpread$
|
|
33027
|
+
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; }
|
|
33028
|
+
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; }
|
|
32817
33029
|
function useTransformJson (_ref) {
|
|
32818
33030
|
var id = _ref.id;
|
|
32819
33031
|
var _useState = useState(),
|
|
@@ -32879,7 +33091,7 @@ function useTransformJson (_ref) {
|
|
|
32879
33091
|
}();
|
|
32880
33092
|
var _transformData = function transformData(data, itemChain, parentOrgId) {
|
|
32881
33093
|
var _data$children;
|
|
32882
|
-
return _objectSpread$
|
|
33094
|
+
return _objectSpread$B(_objectSpread$B({}, data), {}, {
|
|
32883
33095
|
label: /*#__PURE__*/jsx(OrgItem$1, {
|
|
32884
33096
|
data: data,
|
|
32885
33097
|
configuration: configuration,
|
|
@@ -33539,8 +33751,8 @@ function useCatalogEditor (id) {
|
|
|
33539
33751
|
};
|
|
33540
33752
|
}
|
|
33541
33753
|
|
|
33542
|
-
function ownKeys$
|
|
33543
|
-
function _objectSpread$
|
|
33754
|
+
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; }
|
|
33755
|
+
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; }
|
|
33544
33756
|
function DragDropUpload(_ref) {
|
|
33545
33757
|
var api2Params = _ref.api2Params,
|
|
33546
33758
|
catalogId = _ref.catalogId,
|
|
@@ -33648,7 +33860,7 @@ function DragDropUpload(_ref) {
|
|
|
33648
33860
|
children: [importStarted && /*#__PURE__*/jsx("p", {
|
|
33649
33861
|
children: t('backoffice.catalogeditor.classimportstarted')
|
|
33650
33862
|
}), !importStarted && /*#__PURE__*/jsxs(Fragment, {
|
|
33651
|
-
children: [/*#__PURE__*/jsxs(Dragger, _objectSpread$
|
|
33863
|
+
children: [/*#__PURE__*/jsxs(Dragger, _objectSpread$A(_objectSpread$A({}, props), {}, {
|
|
33652
33864
|
children: [/*#__PURE__*/jsx("p", {
|
|
33653
33865
|
className: "ant-upload-drag-icon",
|
|
33654
33866
|
children: /*#__PURE__*/jsx(InboxOutlined, {})
|
|
@@ -33865,8 +34077,8 @@ function CatalogEditor(_ref) {
|
|
|
33865
34077
|
}
|
|
33866
34078
|
var CatalogEditor$1 = observer(CatalogEditor);
|
|
33867
34079
|
|
|
33868
|
-
function ownKeys$
|
|
33869
|
-
function _objectSpread$
|
|
34080
|
+
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; }
|
|
34081
|
+
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; }
|
|
33870
34082
|
var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(props, ref) {
|
|
33871
34083
|
var _root$contentStore$bo, _root$contentStore$ri;
|
|
33872
34084
|
var root = useStore();
|
|
@@ -33881,7 +34093,7 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(pro
|
|
|
33881
34093
|
style: {
|
|
33882
34094
|
display: 'contents'
|
|
33883
34095
|
},
|
|
33884
|
-
children: /*#__PURE__*/jsx(Spreadsheet$1, _objectSpread$
|
|
34096
|
+
children: /*#__PURE__*/jsx(Spreadsheet$1, _objectSpread$z(_objectSpread$z({}, props), {}, {
|
|
33885
34097
|
ref: ref,
|
|
33886
34098
|
darkMode: root.contentStore.theme == 'darkmode',
|
|
33887
34099
|
jwt: root.dataStore.jwt,
|
|
@@ -33891,8 +34103,8 @@ var SpreadsheetWrapper = /*#__PURE__*/forwardRef(function SpreadsheetWrapper(pro
|
|
|
33891
34103
|
});
|
|
33892
34104
|
var Spreadsheet = observer(SpreadsheetWrapper);
|
|
33893
34105
|
|
|
33894
|
-
function ownKeys$
|
|
33895
|
-
function _objectSpread$
|
|
34106
|
+
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; }
|
|
34107
|
+
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; }
|
|
33896
34108
|
|
|
33897
34109
|
// Type definition for the context state
|
|
33898
34110
|
|
|
@@ -33914,14 +34126,14 @@ var useEnricherContext = function useEnricherContext() {
|
|
|
33914
34126
|
loading: loading,
|
|
33915
34127
|
setOptions: function setOptions(options) {
|
|
33916
34128
|
var state = root.contextStore.getContext('enricher');
|
|
33917
|
-
root.contextStore.updateContext('enricher', _defineProperty({}, stateKey, _objectSpread$
|
|
34129
|
+
root.contextStore.updateContext('enricher', _defineProperty({}, stateKey, _objectSpread$y(_objectSpread$y({}, state[stateKey]), {}, {
|
|
33918
34130
|
options: options,
|
|
33919
34131
|
loading: false
|
|
33920
34132
|
})));
|
|
33921
34133
|
},
|
|
33922
34134
|
setLoading: function setLoading(loading) {
|
|
33923
34135
|
var state = root.contextStore.getContext('enricher');
|
|
33924
|
-
root.contextStore.updateContext('enricher', _defineProperty({}, stateKey, _objectSpread$
|
|
34136
|
+
root.contextStore.updateContext('enricher', _defineProperty({}, stateKey, _objectSpread$y(_objectSpread$y({}, state[stateKey]), {}, {
|
|
33925
34137
|
loading: loading
|
|
33926
34138
|
})));
|
|
33927
34139
|
}
|
|
@@ -34032,7 +34244,7 @@ var useEnricherContext = function useEnricherContext() {
|
|
|
34032
34244
|
}, [urlPackageId, getContext().packageId, setSelectedPackage]);
|
|
34033
34245
|
|
|
34034
34246
|
// Return context + handlers
|
|
34035
|
-
return _objectSpread$
|
|
34247
|
+
return _objectSpread$y(_objectSpread$y({}, getContext()), {}, {
|
|
34036
34248
|
setSelectedSerie: setSelectedSerie,
|
|
34037
34249
|
setSelectedItem: setSelectedItem,
|
|
34038
34250
|
setSelectedFeature: setSelectedFeature,
|
|
@@ -35374,19 +35586,19 @@ var TablePackages = observer(function () {
|
|
|
35374
35586
|
},
|
|
35375
35587
|
action: function () {
|
|
35376
35588
|
var _action = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref4) {
|
|
35377
|
-
var _selectedNodes$0$data9;
|
|
35378
|
-
var selectedNodes, url, alertTimeout, _selectedNodes$0$
|
|
35589
|
+
var _selectedNodes$0$data9, _selectedNodes$0$data10, _selectedNodes$0$data11, _selectedNodes$0$data12, _selectedNodes$0$data13;
|
|
35590
|
+
var selectedNodes, url, alertTimeout, _selectedNodes$0$data14;
|
|
35379
35591
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
35380
35592
|
while (1) switch (_context.prev = _context.next) {
|
|
35381
35593
|
case 0:
|
|
35382
35594
|
selectedNodes = _ref4.selectedNodes;
|
|
35383
|
-
url = apiConfig.enricherService + '/packages/' + ((_selectedNodes$0$data9 = selectedNodes[0].data) === null || _selectedNodes$0$data9 === void 0 ? void 0 : _selectedNodes$0$data9._id) + '/catalog'; // Show modal if download takes more than 3 seconds
|
|
35595
|
+
url = apiConfig.enricherService + '/packages/' + ((_selectedNodes$0$data9 = selectedNodes[0].data) === null || _selectedNodes$0$data9 === void 0 ? void 0 : _selectedNodes$0$data9._id) + '/catalog/v' + ((_selectedNodes$0$data10 = (_selectedNodes$0$data11 = selectedNodes[0].data) === null || _selectedNodes$0$data11 === void 0 ? void 0 : _selectedNodes$0$data11.major) !== null && _selectedNodes$0$data10 !== void 0 ? _selectedNodes$0$data10 : '3') + '.' + ((_selectedNodes$0$data12 = (_selectedNodes$0$data13 = selectedNodes[0].data) === null || _selectedNodes$0$data13 === void 0 ? void 0 : _selectedNodes$0$data13.minor) !== null && _selectedNodes$0$data12 !== void 0 ? _selectedNodes$0$data12 : '0'); // Show modal if download takes more than 3 seconds
|
|
35384
35596
|
alertTimeout = setTimeout(function () {
|
|
35385
35597
|
showLoadingModal(t('backoffice.idmEnricher.export.modaltext'));
|
|
35386
35598
|
}, 3000);
|
|
35387
35599
|
_context.prev = 3;
|
|
35388
35600
|
_context.next = 6;
|
|
35389
|
-
return downloadFile(url, root.dataStore.jwt, 'application/zip', ((_selectedNodes$0$
|
|
35601
|
+
return downloadFile(url, root.dataStore.jwt, 'application/zip', ((_selectedNodes$0$data14 = selectedNodes[0].data) === null || _selectedNodes$0$data14 === void 0 ? void 0 : _selectedNodes$0$data14.name) + '.zip');
|
|
35390
35602
|
case 6:
|
|
35391
35603
|
closeModal();
|
|
35392
35604
|
_context.next = 12;
|
|
@@ -35697,6 +35909,20 @@ var TablePackages = observer(function () {
|
|
|
35697
35909
|
lockVisible: true,
|
|
35698
35910
|
suppressColumnsToolPanel: true,
|
|
35699
35911
|
defaultValue: '${organizationId}'
|
|
35912
|
+
}, {
|
|
35913
|
+
field: 'major',
|
|
35914
|
+
editable: false,
|
|
35915
|
+
hide: true,
|
|
35916
|
+
lockVisible: true,
|
|
35917
|
+
suppressColumnsToolPanel: true,
|
|
35918
|
+
defaultValue: '3'
|
|
35919
|
+
}, {
|
|
35920
|
+
field: 'minor',
|
|
35921
|
+
editable: false,
|
|
35922
|
+
hide: true,
|
|
35923
|
+
lockVisible: true,
|
|
35924
|
+
suppressColumnsToolPanel: true,
|
|
35925
|
+
defaultValue: '0'
|
|
35700
35926
|
}, {
|
|
35701
35927
|
field: 'organizationDisplayText',
|
|
35702
35928
|
editable: false,
|
|
@@ -37136,8 +37362,8 @@ function getConfig(t) {
|
|
|
37136
37362
|
};
|
|
37137
37363
|
}
|
|
37138
37364
|
|
|
37139
|
-
function ownKeys$
|
|
37140
|
-
function _objectSpread$
|
|
37365
|
+
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; }
|
|
37366
|
+
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; }
|
|
37141
37367
|
var ExclusivitySerie = function ExclusivitySerie() {
|
|
37142
37368
|
var _useTranslation = useTranslation(),
|
|
37143
37369
|
t = _useTranslation.t,
|
|
@@ -37290,7 +37516,7 @@ var ExclusivityTable = observer(function (_ref) {
|
|
|
37290
37516
|
if (type === 'eitems' && !selectedSerie) {
|
|
37291
37517
|
return oldDataRef.current;
|
|
37292
37518
|
}
|
|
37293
|
-
var newData = _objectSpread$
|
|
37519
|
+
var newData = _objectSpread$x(_objectSpread$x({}, baseApplicationData), {}, {
|
|
37294
37520
|
subTypeId: selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie._id
|
|
37295
37521
|
});
|
|
37296
37522
|
oldDataRef.current = newData;
|
|
@@ -37767,8 +37993,8 @@ var isDefaultValue = function isDefaultValue(value, type) {
|
|
|
37767
37993
|
return value === getDefaultValue(type);
|
|
37768
37994
|
};
|
|
37769
37995
|
|
|
37770
|
-
function ownKeys$
|
|
37771
|
-
function _objectSpread$
|
|
37996
|
+
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; }
|
|
37997
|
+
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; }
|
|
37772
37998
|
/**
|
|
37773
37999
|
* Custom hook to manage price factor state and logic
|
|
37774
38000
|
* @param props - Hook configuration
|
|
@@ -37805,7 +38031,7 @@ function usePriceFactor(_ref) {
|
|
|
37805
38031
|
var updateEntries = function updateEntries(newTypeEntries) {
|
|
37806
38032
|
setHasChangedCurrentType(true);
|
|
37807
38033
|
setEntries(function (prev) {
|
|
37808
|
-
return _objectSpread$
|
|
38034
|
+
return _objectSpread$w(_objectSpread$w({}, prev), {}, _defineProperty(_defineProperty({}, type, newTypeEntries), type === 'factor' ? 'discount' : 'factor', []));
|
|
37809
38035
|
});
|
|
37810
38036
|
};
|
|
37811
38037
|
var handleModalOpen = useCallback(function () {
|
|
@@ -37842,7 +38068,7 @@ function usePriceFactor(_ref) {
|
|
|
37842
38068
|
// Always ensure at least one entry when switching types
|
|
37843
38069
|
var newEntries = hasChangedCurrentType ? [] : entries[newType];
|
|
37844
38070
|
setEntries(function (prev) {
|
|
37845
|
-
return _objectSpread$
|
|
38071
|
+
return _objectSpread$w(_objectSpread$w({}, prev), {}, _defineProperty({}, newType, newEntries.length > 0 ? newEntries : [{
|
|
37846
38072
|
value: getDefaultValue(newType),
|
|
37847
38073
|
isValid: true
|
|
37848
38074
|
}]));
|
|
@@ -38278,8 +38504,8 @@ var css_248z$g = ".input-leHam {\n position: relative;\n width: 200px;\n heig
|
|
|
38278
38504
|
styleInject(css_248z$g);
|
|
38279
38505
|
|
|
38280
38506
|
var _excluded$5 = ["onSave", "value"];
|
|
38281
|
-
function ownKeys$
|
|
38282
|
-
function _objectSpread$
|
|
38507
|
+
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; }
|
|
38508
|
+
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; }
|
|
38283
38509
|
function PriceFactorInput(_ref) {
|
|
38284
38510
|
var _onSave = _ref.onSave,
|
|
38285
38511
|
value = _ref.value,
|
|
@@ -38295,7 +38521,7 @@ function PriceFactorInput(_ref) {
|
|
|
38295
38521
|
title: props.tooltip,
|
|
38296
38522
|
children: /*#__PURE__*/jsx("div", {
|
|
38297
38523
|
className: classnames(input, 'price-factor-input', props.className, _defineProperty({}, disabled$1, props.disabled)),
|
|
38298
|
-
children: /*#__PURE__*/jsx(PriceFactorCellRenderer, _objectSpread$
|
|
38524
|
+
children: /*#__PURE__*/jsx(PriceFactorCellRenderer, _objectSpread$v(_objectSpread$v({}, props), {}, {
|
|
38299
38525
|
isNotInAGGrid: true,
|
|
38300
38526
|
value: innerValue,
|
|
38301
38527
|
onSave: function onSave(data, value) {
|
|
@@ -38371,8 +38597,8 @@ function Setting(_ref) {
|
|
|
38371
38597
|
});
|
|
38372
38598
|
}
|
|
38373
38599
|
|
|
38374
|
-
function ownKeys$
|
|
38375
|
-
function _objectSpread$
|
|
38600
|
+
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; }
|
|
38601
|
+
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; }
|
|
38376
38602
|
var Prices = observer(function (_ref) {
|
|
38377
38603
|
var _pricelist$seriePrice;
|
|
38378
38604
|
var organizationId = _ref.organizationId,
|
|
@@ -38395,8 +38621,8 @@ var Prices = observer(function (_ref) {
|
|
|
38395
38621
|
if (!selectedSerie) return;
|
|
38396
38622
|
|
|
38397
38623
|
// Create copies of the objects to modify
|
|
38398
|
-
var newFactors = _objectSpread$
|
|
38399
|
-
var serieFactors = _objectSpread$
|
|
38624
|
+
var newFactors = _objectSpread$u({}, pricelist.pfgPricefactors);
|
|
38625
|
+
var serieFactors = _objectSpread$u({}, newFactors[selectedSerie.serieNo]);
|
|
38400
38626
|
if (value.length === 0) {
|
|
38401
38627
|
// Remove the empty price feature group
|
|
38402
38628
|
delete serieFactors[priceFeatureGroupItem];
|
|
@@ -38427,7 +38653,7 @@ var Prices = observer(function (_ref) {
|
|
|
38427
38653
|
var updatePfgPriority = useCallback(function (priceFeatureGroupItem, value) {
|
|
38428
38654
|
var _newPriority$selected;
|
|
38429
38655
|
if (!selectedSerie) return;
|
|
38430
|
-
var newPriority = _objectSpread$
|
|
38656
|
+
var newPriority = _objectSpread$u({}, pricelist.pfgPricefactorsPriority);
|
|
38431
38657
|
var seriesPriority = new Set((_newPriority$selected = newPriority[selectedSerie.serieNo]) !== null && _newPriority$selected !== void 0 ? _newPriority$selected : []);
|
|
38432
38658
|
if (value === true) {
|
|
38433
38659
|
seriesPriority.add(priceFeatureGroupItem);
|
|
@@ -38446,7 +38672,7 @@ var Prices = observer(function (_ref) {
|
|
|
38446
38672
|
var updatePgPriority = useCallback(function (priceFeatureGroupItem, value) {
|
|
38447
38673
|
var _newPriority$selected2;
|
|
38448
38674
|
if (!selectedSerie) return;
|
|
38449
|
-
var newPriority = _objectSpread$
|
|
38675
|
+
var newPriority = _objectSpread$u({}, pricelist.pgPricefactorsPriority);
|
|
38450
38676
|
var seriesPriority = new Set((_newPriority$selected2 = newPriority[selectedSerie.serieNo]) !== null && _newPriority$selected2 !== void 0 ? _newPriority$selected2 : []);
|
|
38451
38677
|
if (value === true) {
|
|
38452
38678
|
seriesPriority.add(priceFeatureGroupItem);
|
|
@@ -38466,8 +38692,8 @@ var Prices = observer(function (_ref) {
|
|
|
38466
38692
|
if (!selectedSerie) return;
|
|
38467
38693
|
|
|
38468
38694
|
// Create copies of the objects to modify
|
|
38469
|
-
var newFactors = _objectSpread$
|
|
38470
|
-
var serieFactors = _objectSpread$
|
|
38695
|
+
var newFactors = _objectSpread$u({}, pricelist.pgPricefactors);
|
|
38696
|
+
var serieFactors = _objectSpread$u({}, newFactors[selectedSerie.serieNo]);
|
|
38471
38697
|
if (value.length === 0) {
|
|
38472
38698
|
// Remove the empty price feature group
|
|
38473
38699
|
delete serieFactors[priceFeatureGroupItem];
|
|
@@ -38499,8 +38725,8 @@ var Prices = observer(function (_ref) {
|
|
|
38499
38725
|
if (!selectedSerie) return;
|
|
38500
38726
|
|
|
38501
38727
|
// Create copies of the objects to modify
|
|
38502
|
-
var newFactors = _objectSpread$
|
|
38503
|
-
var serieFactors = _objectSpread$
|
|
38728
|
+
var newFactors = _objectSpread$u({}, pricelist.articlePricefactors);
|
|
38729
|
+
var serieFactors = _objectSpread$u({}, newFactors[selectedSerie.serieNo]);
|
|
38504
38730
|
if (value.length === 0) {
|
|
38505
38731
|
// Remove the empty article price factor
|
|
38506
38732
|
delete serieFactors[typeNo];
|
|
@@ -38532,8 +38758,8 @@ var Prices = observer(function (_ref) {
|
|
|
38532
38758
|
if (!selectedSerie) return;
|
|
38533
38759
|
|
|
38534
38760
|
// Create copies of the objects to modify
|
|
38535
|
-
var newFactors = _objectSpread$
|
|
38536
|
-
var serieFactors = _objectSpread$
|
|
38761
|
+
var newFactors = _objectSpread$u({}, pricelist.typeKeyPricefactors);
|
|
38762
|
+
var serieFactors = _objectSpread$u({}, newFactors[selectedSerie.serieNo]);
|
|
38537
38763
|
if (value.length === 0) {
|
|
38538
38764
|
// Remove the empty article price factor
|
|
38539
38765
|
delete serieFactors[typeKey];
|
|
@@ -38565,7 +38791,7 @@ var Prices = observer(function (_ref) {
|
|
|
38565
38791
|
if (!selectedSerie) return;
|
|
38566
38792
|
|
|
38567
38793
|
// Create a copy of the object to modify
|
|
38568
|
-
var newFactors = _objectSpread$
|
|
38794
|
+
var newFactors = _objectSpread$u({}, pricelist.seriePricefactors);
|
|
38569
38795
|
if (value.length === 0) {
|
|
38570
38796
|
// Remove the empty serie price factor
|
|
38571
38797
|
delete newFactors[selectedSerie.serieNo];
|
|
@@ -39350,12 +39576,12 @@ function getFormItemProps(props) {
|
|
|
39350
39576
|
}
|
|
39351
39577
|
|
|
39352
39578
|
var _excluded$3 = ["disabled"];
|
|
39353
|
-
function ownKeys$
|
|
39354
|
-
function _objectSpread$
|
|
39579
|
+
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; }
|
|
39580
|
+
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; }
|
|
39355
39581
|
function Checkbox(_ref) {
|
|
39356
39582
|
var disabled = _ref.disabled,
|
|
39357
39583
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
39358
|
-
return /*#__PURE__*/jsx(Form$2.Item, _objectSpread$
|
|
39584
|
+
return /*#__PURE__*/jsx(Form$2.Item, _objectSpread$t(_objectSpread$t({}, getFormItemProps(props)), {}, {
|
|
39359
39585
|
valuePropName: "checked",
|
|
39360
39586
|
children: /*#__PURE__*/jsx(Checkbox$1, {
|
|
39361
39587
|
disabled: disabled
|
|
@@ -39364,13 +39590,13 @@ function Checkbox(_ref) {
|
|
|
39364
39590
|
}
|
|
39365
39591
|
|
|
39366
39592
|
var _excluded$2 = ["disabled", "placeholder"];
|
|
39367
|
-
function ownKeys$
|
|
39368
|
-
function _objectSpread$
|
|
39593
|
+
function ownKeys$s(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; }
|
|
39594
|
+
function _objectSpread$s(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$s(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$s(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39369
39595
|
function Input(_ref) {
|
|
39370
39596
|
var disabled = _ref.disabled,
|
|
39371
39597
|
placeholder = _ref.placeholder,
|
|
39372
39598
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
39373
|
-
return /*#__PURE__*/jsx(Form$2.Item, _objectSpread$
|
|
39599
|
+
return /*#__PURE__*/jsx(Form$2.Item, _objectSpread$s(_objectSpread$s({}, getFormItemProps(props)), {}, {
|
|
39374
39600
|
children: /*#__PURE__*/jsx(Input$1, {
|
|
39375
39601
|
disabled: disabled,
|
|
39376
39602
|
placeholder: placeholder
|
|
@@ -39382,8 +39608,8 @@ var uploadDraggerWrapper = "upload-dragger-wrapper-xZiDJ";
|
|
|
39382
39608
|
var css_248z$d = ".upload-dragger-wrapper-xZiDJ {\n min-height: 220px;\n}\n";
|
|
39383
39609
|
styleInject(css_248z$d);
|
|
39384
39610
|
|
|
39385
|
-
function ownKeys$
|
|
39386
|
-
function _objectSpread$
|
|
39611
|
+
function ownKeys$r(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; }
|
|
39612
|
+
function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$r(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$r(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39387
39613
|
/**
|
|
39388
39614
|
* Handles file selection and optional auto-zipping
|
|
39389
39615
|
*
|
|
@@ -39487,7 +39713,7 @@ function _validateFile() {
|
|
|
39487
39713
|
return _validateFile.apply(this, arguments);
|
|
39488
39714
|
}
|
|
39489
39715
|
function toUploadFile(file) {
|
|
39490
|
-
return _objectSpread$
|
|
39716
|
+
return _objectSpread$r(_objectSpread$r({}, file), {}, {
|
|
39491
39717
|
uid: file.name,
|
|
39492
39718
|
name: file.name,
|
|
39493
39719
|
status: 'done',
|
|
@@ -39559,8 +39785,8 @@ var DraggerComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
39559
39785
|
});
|
|
39560
39786
|
|
|
39561
39787
|
var _excluded$1 = ["acceptedFileTypes", "disabled", "autoZip", "required", "hint"];
|
|
39562
|
-
function ownKeys$
|
|
39563
|
-
function _objectSpread$
|
|
39788
|
+
function ownKeys$q(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; }
|
|
39789
|
+
function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39564
39790
|
function Dragger(_ref) {
|
|
39565
39791
|
var _props$rules;
|
|
39566
39792
|
var acceptedFileTypes = _ref.acceptedFileTypes,
|
|
@@ -39571,7 +39797,7 @@ function Dragger(_ref) {
|
|
|
39571
39797
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
39572
39798
|
var _useTranslation = useTranslation(),
|
|
39573
39799
|
t = _useTranslation.t;
|
|
39574
|
-
return /*#__PURE__*/jsx(Form$2.Item, _objectSpread$
|
|
39800
|
+
return /*#__PURE__*/jsx(Form$2.Item, _objectSpread$q(_objectSpread$q({}, getFormItemProps(props)), {}, {
|
|
39575
39801
|
rules: [].concat(_toConsumableArray((_props$rules = props.rules) !== null && _props$rules !== void 0 ? _props$rules : []), [{
|
|
39576
39802
|
validator: function validator(_, value) {
|
|
39577
39803
|
return validateFile(acceptedFileTypes, t, value);
|
|
@@ -39645,8 +39871,8 @@ function useForm(_ref) {
|
|
|
39645
39871
|
};
|
|
39646
39872
|
}
|
|
39647
39873
|
|
|
39648
|
-
function ownKeys$
|
|
39649
|
-
function _objectSpread$
|
|
39874
|
+
function ownKeys$p(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; }
|
|
39875
|
+
function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$p(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39650
39876
|
/**
|
|
39651
39877
|
* Form component that renders form fields based on configuration
|
|
39652
39878
|
*
|
|
@@ -39702,15 +39928,15 @@ function FormItem(_ref2) {
|
|
|
39702
39928
|
var field = _ref2.field;
|
|
39703
39929
|
switch (field.type) {
|
|
39704
39930
|
case 'dragger':
|
|
39705
|
-
return /*#__PURE__*/createElement(Dragger, _objectSpread$
|
|
39931
|
+
return /*#__PURE__*/createElement(Dragger, _objectSpread$p(_objectSpread$p({}, field), {}, {
|
|
39706
39932
|
key: field.name
|
|
39707
39933
|
}));
|
|
39708
39934
|
case 'checkbox':
|
|
39709
|
-
return /*#__PURE__*/createElement(Checkbox, _objectSpread$
|
|
39935
|
+
return /*#__PURE__*/createElement(Checkbox, _objectSpread$p(_objectSpread$p({}, field), {}, {
|
|
39710
39936
|
key: field.name
|
|
39711
39937
|
}));
|
|
39712
39938
|
case 'input':
|
|
39713
|
-
return /*#__PURE__*/createElement(Input, _objectSpread$
|
|
39939
|
+
return /*#__PURE__*/createElement(Input, _objectSpread$p(_objectSpread$p({}, field), {}, {
|
|
39714
39940
|
key: field.name
|
|
39715
39941
|
}));
|
|
39716
39942
|
default:
|
|
@@ -39933,8 +40159,8 @@ function useUploadModal(_ref) {
|
|
|
39933
40159
|
};
|
|
39934
40160
|
}
|
|
39935
40161
|
|
|
39936
|
-
function ownKeys$
|
|
39937
|
-
function _objectSpread$
|
|
40162
|
+
function ownKeys$o(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; }
|
|
40163
|
+
function _objectSpread$o(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$o(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$o(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39938
40164
|
var Panel = Collapse.Panel;
|
|
39939
40165
|
var Text$5 = Typography.Text;
|
|
39940
40166
|
/**
|
|
@@ -40000,7 +40226,7 @@ function ErrorDisplay(_ref) {
|
|
|
40000
40226
|
}
|
|
40001
40227
|
allFieldGroups.get(fieldName).push({
|
|
40002
40228
|
operationType: label,
|
|
40003
|
-
errors: [_objectSpread$
|
|
40229
|
+
errors: [_objectSpread$o(_objectSpread$o({}, error), {}, {
|
|
40004
40230
|
errorTexts: fieldError.errorTexts
|
|
40005
40231
|
})]
|
|
40006
40232
|
});
|
|
@@ -40013,7 +40239,7 @@ function ErrorDisplay(_ref) {
|
|
|
40013
40239
|
}
|
|
40014
40240
|
allFieldGroups.get(fieldName).push({
|
|
40015
40241
|
operationType: label,
|
|
40016
|
-
errors: [_objectSpread$
|
|
40242
|
+
errors: [_objectSpread$o(_objectSpread$o({}, error), {}, {
|
|
40017
40243
|
errorTexts: [error.error]
|
|
40018
40244
|
})]
|
|
40019
40245
|
});
|
|
@@ -40196,8 +40422,8 @@ function UploadModalFooter(_ref2) {
|
|
|
40196
40422
|
}
|
|
40197
40423
|
|
|
40198
40424
|
var _excluded = ["buttonText", "onClose"];
|
|
40199
|
-
function ownKeys$
|
|
40200
|
-
function _objectSpread$
|
|
40425
|
+
function ownKeys$n(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; }
|
|
40426
|
+
function _objectSpread$n(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$n(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$n(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40201
40427
|
/**
|
|
40202
40428
|
* Button component that opens an upload modal when clicked
|
|
40203
40429
|
*
|
|
@@ -40226,15 +40452,15 @@ function UploadModalButton(_ref) {
|
|
|
40226
40452
|
return setIsModalOpen(true);
|
|
40227
40453
|
},
|
|
40228
40454
|
children: buttonText
|
|
40229
|
-
}), /*#__PURE__*/jsx(UploadModal, _objectSpread$
|
|
40455
|
+
}), /*#__PURE__*/jsx(UploadModal, _objectSpread$n(_objectSpread$n({}, props), {}, {
|
|
40230
40456
|
isOpen: isModalOpen,
|
|
40231
40457
|
onClose: handleClose
|
|
40232
40458
|
}))]
|
|
40233
40459
|
});
|
|
40234
40460
|
}
|
|
40235
40461
|
|
|
40236
|
-
function ownKeys$
|
|
40237
|
-
function _objectSpread$
|
|
40462
|
+
function ownKeys$m(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; }
|
|
40463
|
+
function _objectSpread$m(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$m(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$m(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40238
40464
|
|
|
40239
40465
|
// Type definition for the context state
|
|
40240
40466
|
|
|
@@ -40256,14 +40482,14 @@ var useCatalogContext = function useCatalogContext() {
|
|
|
40256
40482
|
loading: loading,
|
|
40257
40483
|
setOptions: function setOptions(options) {
|
|
40258
40484
|
var state = root.contextStore.getContext('catalog');
|
|
40259
|
-
root.contextStore.updateContext('catalog', _defineProperty({}, stateKey, _objectSpread$
|
|
40485
|
+
root.contextStore.updateContext('catalog', _defineProperty({}, stateKey, _objectSpread$m(_objectSpread$m({}, state[stateKey]), {}, {
|
|
40260
40486
|
options: options,
|
|
40261
40487
|
loading: false
|
|
40262
40488
|
})));
|
|
40263
40489
|
},
|
|
40264
40490
|
setLoading: function setLoading(loading) {
|
|
40265
40491
|
var state = root.contextStore.getContext('catalog');
|
|
40266
|
-
root.contextStore.updateContext('catalog', _defineProperty({}, stateKey, _objectSpread$
|
|
40492
|
+
root.contextStore.updateContext('catalog', _defineProperty({}, stateKey, _objectSpread$m(_objectSpread$m({}, state[stateKey]), {}, {
|
|
40267
40493
|
loading: loading
|
|
40268
40494
|
})));
|
|
40269
40495
|
}
|
|
@@ -40377,7 +40603,7 @@ var useCatalogContext = function useCatalogContext() {
|
|
|
40377
40603
|
}, [urlCatalogId, getContext().catalogId, setSelectedCatalog]);
|
|
40378
40604
|
|
|
40379
40605
|
// Return context + handlers
|
|
40380
|
-
return _objectSpread$
|
|
40606
|
+
return _objectSpread$m(_objectSpread$m({}, getContext()), {}, {
|
|
40381
40607
|
setSelectedSerie: setSelectedSerie,
|
|
40382
40608
|
setSelectedItem: setSelectedItem,
|
|
40383
40609
|
setSelectedFeature: setSelectedFeature,
|
|
@@ -40387,37 +40613,152 @@ var useCatalogContext = function useCatalogContext() {
|
|
|
40387
40613
|
});
|
|
40388
40614
|
};
|
|
40389
40615
|
|
|
40390
|
-
function ownKeys$
|
|
40391
|
-
function _objectSpread$
|
|
40392
|
-
|
|
40393
|
-
|
|
40394
|
-
|
|
40395
|
-
|
|
40396
|
-
|
|
40397
|
-
|
|
40398
|
-
|
|
40399
|
-
|
|
40400
|
-
|
|
40401
|
-
|
|
40402
|
-
|
|
40403
|
-
|
|
40616
|
+
function ownKeys$l(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; }
|
|
40617
|
+
function _objectSpread$l(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$l(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$l(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40618
|
+
var IDM_VERSIONS = [{
|
|
40619
|
+
name: '3.0.0',
|
|
40620
|
+
value: '3.0.0'
|
|
40621
|
+
}, {
|
|
40622
|
+
name: '4.1.1',
|
|
40623
|
+
value: '4.1.1'
|
|
40624
|
+
}];
|
|
40625
|
+
function parseVersion(version) {
|
|
40626
|
+
var _version$split$map = version.split('.').map(Number),
|
|
40627
|
+
_version$split$map2 = _slicedToArray(_version$split$map, 3),
|
|
40628
|
+
_version$split$map2$ = _version$split$map2[0],
|
|
40629
|
+
major = _version$split$map2$ === void 0 ? 0 : _version$split$map2$,
|
|
40630
|
+
_version$split$map2$2 = _version$split$map2[1],
|
|
40631
|
+
minor = _version$split$map2$2 === void 0 ? 0 : _version$split$map2$2,
|
|
40632
|
+
_version$split$map2$3 = _version$split$map2[2],
|
|
40633
|
+
revision = _version$split$map2$3 === void 0 ? 0 : _version$split$map2$3;
|
|
40634
|
+
return {
|
|
40635
|
+
major: major,
|
|
40636
|
+
minor: minor,
|
|
40637
|
+
revision: revision
|
|
40638
|
+
};
|
|
40639
|
+
}
|
|
40640
|
+
|
|
40641
|
+
/**
|
|
40642
|
+
* Transforms a set filter on the combined version string into compound
|
|
40643
|
+
* major/minor/revision conditions the server can evaluate.
|
|
40644
|
+
*/
|
|
40645
|
+
function versionFilterModelParser(params) {
|
|
40646
|
+
var filterModel = params.filterModel;
|
|
40647
|
+
if (!filterModel) return undefined;
|
|
40648
|
+
return transformFilterNode(filterModel, params.column.getColId());
|
|
40649
|
+
}
|
|
40650
|
+
function transformFilterNode(node, versionColId) {
|
|
40651
|
+
if (node.filterType === 'join') {
|
|
40652
|
+
var joinNode = node;
|
|
40653
|
+
var conditions = joinNode.conditions.map(function (c) {
|
|
40654
|
+
return transformFilterNode(c, versionColId);
|
|
40655
|
+
}).filter(function (c) {
|
|
40656
|
+
return c !== undefined;
|
|
40657
|
+
});
|
|
40658
|
+
if (conditions.length === 0) return undefined;
|
|
40659
|
+
return _objectSpread$l(_objectSpread$l({}, joinNode), {}, {
|
|
40660
|
+
conditions: conditions
|
|
40661
|
+
});
|
|
40662
|
+
}
|
|
40663
|
+
if (node.colId !== versionColId) return node;
|
|
40664
|
+
if (node.filterType === 'set' && 'values' in node) {
|
|
40665
|
+
var values = node.values;
|
|
40666
|
+
if (!values || values.length === 0) return undefined;
|
|
40667
|
+
var versionConditions = values.map(function (v) {
|
|
40668
|
+
var _parseVersion = parseVersion(v),
|
|
40669
|
+
major = _parseVersion.major,
|
|
40670
|
+
minor = _parseVersion.minor,
|
|
40671
|
+
revision = _parseVersion.revision;
|
|
40672
|
+
return {
|
|
40673
|
+
filterType: 'join',
|
|
40674
|
+
type: 'AND',
|
|
40675
|
+
conditions: [{
|
|
40676
|
+
colId: 'major',
|
|
40677
|
+
filterType: 'number',
|
|
40678
|
+
type: 'equals',
|
|
40679
|
+
filter: major
|
|
40680
|
+
}, {
|
|
40681
|
+
colId: 'minor',
|
|
40682
|
+
filterType: 'number',
|
|
40683
|
+
type: 'equals',
|
|
40684
|
+
filter: minor
|
|
40685
|
+
}, {
|
|
40686
|
+
colId: 'revision',
|
|
40687
|
+
filterType: 'number',
|
|
40688
|
+
type: 'equals',
|
|
40689
|
+
filter: revision
|
|
40690
|
+
}]
|
|
40691
|
+
};
|
|
40692
|
+
});
|
|
40693
|
+
if (versionConditions.length === 1) return versionConditions[0];
|
|
40694
|
+
return {
|
|
40695
|
+
filterType: 'join',
|
|
40696
|
+
type: 'OR',
|
|
40697
|
+
conditions: versionConditions
|
|
40698
|
+
};
|
|
40699
|
+
}
|
|
40700
|
+
return node;
|
|
40701
|
+
}
|
|
40702
|
+
|
|
40703
|
+
/**
|
|
40704
|
+
* Creates column definitions for a combined version field (major.minor.revision).
|
|
40705
|
+
* Returns an array: the visible enum column + 3 hidden columns for the underlying fields.
|
|
40706
|
+
* Spread the result into the colDef or children array.
|
|
40707
|
+
*/
|
|
40708
|
+
function createVersionColumnDef(_ref) {
|
|
40709
|
+
var headerName = _ref.headerName,
|
|
40710
|
+
defaultVersion = _ref.defaultVersion;
|
|
40711
|
+
var _parseVersion2 = parseVersion(defaultVersion),
|
|
40712
|
+
major = _parseVersion2.major,
|
|
40713
|
+
minor = _parseVersion2.minor,
|
|
40714
|
+
revision = _parseVersion2.revision;
|
|
40715
|
+
return [{
|
|
40716
|
+
headerName: headerName,
|
|
40717
|
+
field: 'major',
|
|
40718
|
+
cellDataType: 'enum',
|
|
40719
|
+
required: true,
|
|
40720
|
+
defaultValue: major,
|
|
40721
|
+
editable: function editable(params) {
|
|
40722
|
+
var _params$data;
|
|
40723
|
+
return !((_params$data = params.data) !== null && _params$data !== void 0 && _params$data._id);
|
|
40724
|
+
},
|
|
40725
|
+
valueGetter: function valueGetter(params) {
|
|
40726
|
+
var _d$major, _d$minor, _d$revision;
|
|
40727
|
+
var d = params.data;
|
|
40728
|
+
if (!(d !== null && d !== void 0 && d.major)) return '';
|
|
40729
|
+
return "".concat((_d$major = d.major) !== null && _d$major !== void 0 ? _d$major : 0, ".").concat((_d$minor = d.minor) !== null && _d$minor !== void 0 ? _d$minor : 0, ".").concat((_d$revision = d.revision) !== null && _d$revision !== void 0 ? _d$revision : 0);
|
|
40730
|
+
},
|
|
40731
|
+
valueParser: function valueParser(params) {
|
|
40732
|
+
return parseVersion(params.newValue);
|
|
40733
|
+
},
|
|
40734
|
+
filterModelParser: versionFilterModelParser,
|
|
40735
|
+
customParams: {
|
|
40736
|
+
enumData: IDM_VERSIONS
|
|
40404
40737
|
}
|
|
40405
|
-
|
|
40406
|
-
|
|
40738
|
+
}, {
|
|
40739
|
+
field: 'minor',
|
|
40740
|
+
hide: true,
|
|
40741
|
+
lockVisible: true,
|
|
40742
|
+
suppressColumnsToolPanel: true,
|
|
40743
|
+
defaultValue: minor
|
|
40744
|
+
}, {
|
|
40745
|
+
field: 'revision',
|
|
40746
|
+
hide: true,
|
|
40747
|
+
lockVisible: true,
|
|
40748
|
+
suppressColumnsToolPanel: true,
|
|
40749
|
+
defaultValue: revision
|
|
40750
|
+
}];
|
|
40407
40751
|
}
|
|
40752
|
+
|
|
40408
40753
|
var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
40409
40754
|
var organizationId = _ref.organizationId,
|
|
40410
40755
|
apiConfig = _ref.apiConfig,
|
|
40411
|
-
|
|
40412
|
-
variant = _ref$variant === void 0 ? 'list' : _ref$variant,
|
|
40413
|
-
catalogIdProp = _ref.catalogId,
|
|
40756
|
+
catalog = _ref.catalog,
|
|
40414
40757
|
_ref$showApi = _ref.showApi2,
|
|
40415
40758
|
showApi2 = _ref$showApi === void 0 ? false : _ref$showApi,
|
|
40416
40759
|
setSelectedCatalog = _ref.setSelectedCatalog,
|
|
40417
|
-
onCatalogSelectionChange = _ref.onCatalogSelectionChange,
|
|
40418
40760
|
onActualChange = _ref.onActualChange,
|
|
40419
|
-
refreshTrigger = _ref.refreshTrigger
|
|
40420
|
-
catalogMajor = _ref.catalogMajor;
|
|
40761
|
+
refreshTrigger = _ref.refreshTrigger;
|
|
40421
40762
|
var root = useStore();
|
|
40422
40763
|
var _useTranslation = useTranslation(),
|
|
40423
40764
|
t = _useTranslation.t,
|
|
@@ -40427,36 +40768,12 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
40427
40768
|
showErrorModal = _useLoadingModal.showErrorModal,
|
|
40428
40769
|
closeModal = _useLoadingModal.closeModal,
|
|
40429
40770
|
contextHolder = _useLoadingModal.contextHolder;
|
|
40430
|
-
var isVersions = variant === 'versions';
|
|
40431
40771
|
var applicationData = useMemo(function () {
|
|
40432
|
-
return
|
|
40772
|
+
return {
|
|
40433
40773
|
organizationId: organizationId,
|
|
40434
|
-
_id:
|
|
40435
|
-
} : {
|
|
40436
|
-
organizationId: organizationId
|
|
40437
|
-
};
|
|
40438
|
-
}, [organizationId, catalogIdProp, isVersions]);
|
|
40439
|
-
var preFilter = useMemo(function () {
|
|
40440
|
-
if (isVersions) return undefined;
|
|
40441
|
-
var orgPreFilter = {
|
|
40442
|
-
colId: 'organizationId',
|
|
40443
|
-
filterType: 'text',
|
|
40444
|
-
type: 'equals',
|
|
40445
|
-
filter: organizationId
|
|
40774
|
+
_id: catalog._id
|
|
40446
40775
|
};
|
|
40447
|
-
|
|
40448
|
-
return {
|
|
40449
|
-
filterType: 'join',
|
|
40450
|
-
type: 'AND',
|
|
40451
|
-
conditions: [orgPreFilter, {
|
|
40452
|
-
colId: 'isApi',
|
|
40453
|
-
filterType: 'set',
|
|
40454
|
-
values: ['false']
|
|
40455
|
-
}]
|
|
40456
|
-
};
|
|
40457
|
-
}
|
|
40458
|
-
return orgPreFilter;
|
|
40459
|
-
}, [organizationId, showApi2, isVersions]);
|
|
40776
|
+
}, [organizationId, catalog._id]);
|
|
40460
40777
|
var rowActions = useMemo(function () {
|
|
40461
40778
|
if (!setSelectedCatalog) return [];
|
|
40462
40779
|
return [{
|
|
@@ -40582,6 +40899,12 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
40582
40899
|
}, {
|
|
40583
40900
|
name: t('backoffice.idmCatalogEditor.items.label.zubehoerhersteller'),
|
|
40584
40901
|
value: 'Z'
|
|
40902
|
+
}, {
|
|
40903
|
+
name: t('backoffice.idmCatalogEditor.items.label.living'),
|
|
40904
|
+
value: 'L'
|
|
40905
|
+
}, {
|
|
40906
|
+
name: t('backoffice.idmCatalogEditor.items.label.kitchen'),
|
|
40907
|
+
value: 'K'
|
|
40585
40908
|
}];
|
|
40586
40909
|
var catalogMark = [{
|
|
40587
40910
|
name: t('backoffice.idmCatalog.general.label.cm.K'),
|
|
@@ -40638,8 +40961,7 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
40638
40961
|
var colDef = [].concat(_toConsumableArray(showApi2 ? [{
|
|
40639
40962
|
headerName: 'backoffice.idmCatalog.catalogs.label.isApi',
|
|
40640
40963
|
field: 'isApi',
|
|
40641
|
-
cellDataType: 'boolean'
|
|
40642
|
-
editable: false
|
|
40964
|
+
cellDataType: 'boolean'
|
|
40643
40965
|
}] : []), [{
|
|
40644
40966
|
headerName: 'backoffice.idmCatalog.general.label.actual',
|
|
40645
40967
|
field: 'actual',
|
|
@@ -40660,13 +40982,11 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
40660
40982
|
}
|
|
40661
40983
|
}, {
|
|
40662
40984
|
headerName: 'backoffice.idmCatalog.general.label.filename',
|
|
40663
|
-
field: 'filename'
|
|
40664
|
-
editable: false
|
|
40985
|
+
field: 'filename'
|
|
40665
40986
|
}, {
|
|
40666
40987
|
headerName: 'backoffice.idmCatalog.general.label.filesize',
|
|
40667
40988
|
field: 'size',
|
|
40668
|
-
cellDataType: 'number'
|
|
40669
|
-
editable: false
|
|
40989
|
+
cellDataType: 'number'
|
|
40670
40990
|
}, {
|
|
40671
40991
|
headerName: 'backoffice.idmCatalog.catalogs.label.logo',
|
|
40672
40992
|
field: 'logo',
|
|
@@ -40732,7 +41052,7 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
40732
41052
|
children: [{
|
|
40733
41053
|
headerName: 'backoffice.idmCatalog.general.label.catalogNumber',
|
|
40734
41054
|
field: 'catalogNumber',
|
|
40735
|
-
required:
|
|
41055
|
+
required: catalog.major === 3
|
|
40736
41056
|
}, {
|
|
40737
41057
|
headerName: 'backoffice.idmCatalog.general.label.catalogName',
|
|
40738
41058
|
marryChildren: true,
|
|
@@ -40805,7 +41125,7 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
40805
41125
|
enumData: catalogMark,
|
|
40806
41126
|
displayLabelTemplate: '${name} (${value})'
|
|
40807
41127
|
},
|
|
40808
|
-
required:
|
|
41128
|
+
required: catalog.major === 3,
|
|
40809
41129
|
defaultValue: 'K'
|
|
40810
41130
|
}, {
|
|
40811
41131
|
headerName: 'backoffice.idmCatalog.general.label.catalogMergeType',
|
|
@@ -40872,16 +41192,14 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
40872
41192
|
cellDataType: 'number',
|
|
40873
41193
|
defaultValue: 1,
|
|
40874
41194
|
required: true
|
|
40875
|
-
}].concat(_toConsumableArray(
|
|
41195
|
+
}].concat(_toConsumableArray(catalog.major === 4 ? [{
|
|
40876
41196
|
headerName: 'backoffice.idmCatalog.general.label.catalogMajorNo',
|
|
40877
41197
|
field: 'catalogMajorNo',
|
|
40878
|
-
cellDataType: 'number'
|
|
40879
|
-
editable: false
|
|
41198
|
+
cellDataType: 'number'
|
|
40880
41199
|
}, {
|
|
40881
41200
|
headerName: 'backoffice.idmCatalog.general.label.catalogMinorNo',
|
|
40882
41201
|
field: 'catalogMinorNo',
|
|
40883
|
-
cellDataType: 'number'
|
|
40884
|
-
editable: false
|
|
41202
|
+
cellDataType: 'number'
|
|
40885
41203
|
}] : []))
|
|
40886
41204
|
}, {
|
|
40887
41205
|
headerName: 'backoffice.idmCatalog.general.label.supplier',
|
|
@@ -41169,28 +41487,10 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
41169
41487
|
}]
|
|
41170
41488
|
}, {
|
|
41171
41489
|
headerName: 'backoffice.idmCatalog.general.label.version',
|
|
41172
|
-
children: [{
|
|
41173
|
-
headerName: 'backoffice.idmCatalog.general.label.
|
|
41174
|
-
|
|
41175
|
-
|
|
41176
|
-
editable: false,
|
|
41177
|
-
defaultValue: 3,
|
|
41178
|
-
required: true
|
|
41179
|
-
}, {
|
|
41180
|
-
headerName: 'backoffice.idmCatalog.general.label.minor',
|
|
41181
|
-
field: 'minor',
|
|
41182
|
-
cellDataType: 'number',
|
|
41183
|
-
editable: false,
|
|
41184
|
-
defaultValue: 0,
|
|
41185
|
-
required: true
|
|
41186
|
-
}, {
|
|
41187
|
-
headerName: 'backoffice.idmCatalog.general.label.revision',
|
|
41188
|
-
field: 'revision',
|
|
41189
|
-
cellDataType: 'number',
|
|
41190
|
-
editable: false,
|
|
41191
|
-
defaultValue: 0,
|
|
41192
|
-
required: true
|
|
41193
|
-
}, {
|
|
41490
|
+
children: [].concat(_toConsumableArray(createVersionColumnDef({
|
|
41491
|
+
headerName: 'backoffice.idmCatalog.general.label.version',
|
|
41492
|
+
defaultVersion: "".concat(catalog.major, ".").concat(catalog.minor, ".").concat(catalog.revision)
|
|
41493
|
+
})), [{
|
|
41194
41494
|
headerName: 'backoffice.idmCatalog.general.label.format',
|
|
41195
41495
|
field: 'format',
|
|
41196
41496
|
cellDataType: 'enum',
|
|
@@ -41199,8 +41499,8 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
41199
41499
|
displayLabelTemplate: '${name} (${value})'
|
|
41200
41500
|
},
|
|
41201
41501
|
required: true,
|
|
41202
|
-
defaultValue: '
|
|
41203
|
-
}]
|
|
41502
|
+
defaultValue: 'L'
|
|
41503
|
+
}])
|
|
41204
41504
|
}, {
|
|
41205
41505
|
headerName: 'backoffice.idmCatalog.general.label._id',
|
|
41206
41506
|
field: '_id',
|
|
@@ -41218,19 +41518,18 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
41218
41518
|
suppressColumnsToolPanel: true,
|
|
41219
41519
|
defaultValue: '${organizationId}'
|
|
41220
41520
|
}]);
|
|
41221
|
-
var finalColDef = isVersions ? makeColDefEditableForVersions$1(colDef) : colDef;
|
|
41222
41521
|
return {
|
|
41223
41522
|
type: 'dotnetSSM',
|
|
41224
41523
|
apiInterface: apiInterface,
|
|
41225
41524
|
dateFormat: 'DD.MM.YYYY, HH:mm:ss',
|
|
41226
41525
|
floatingFilter: true,
|
|
41227
|
-
colDef:
|
|
41526
|
+
colDef: colDef
|
|
41228
41527
|
};
|
|
41229
|
-
}, [i18n.language, showApi2, t, apiConfig,
|
|
41528
|
+
}, [i18n.language, showApi2, t, apiConfig, catalog.major, catalog._id]);
|
|
41230
41529
|
var hooks = useMemo(function () {
|
|
41231
|
-
|
|
41232
|
-
|
|
41233
|
-
|
|
41530
|
+
if (!onActualChange) return undefined;
|
|
41531
|
+
return {
|
|
41532
|
+
onDataUpdated: function onDataUpdated(event) {
|
|
41234
41533
|
var _event$updates;
|
|
41235
41534
|
var actualChanged = (_event$updates = event.updates) === null || _event$updates === void 0 ? void 0 : _event$updates.some(function (u) {
|
|
41236
41535
|
var _oldData, _data;
|
|
@@ -41241,20 +41540,9 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
41241
41540
|
onActualChange();
|
|
41242
41541
|
ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 || (_current$refresh = _current.refresh) === null || _current$refresh === void 0 || _current$refresh.call(_current);
|
|
41243
41542
|
}
|
|
41244
|
-
}
|
|
41245
|
-
}
|
|
41246
|
-
|
|
41247
|
-
base.onCellSelectionChanged = function (event) {
|
|
41248
|
-
var _event$nodes$;
|
|
41249
|
-
if (event.nodes.length === 1 && ((_event$nodes$ = event.nodes[0]) === null || _event$nodes$ === void 0 || (_event$nodes$ = _event$nodes$.data) === null || _event$nodes$ === void 0 ? void 0 : _event$nodes$.catalogId) != null) {
|
|
41250
|
-
onCatalogSelectionChange(event.nodes[0].data);
|
|
41251
|
-
} else {
|
|
41252
|
-
onCatalogSelectionChange(null);
|
|
41253
|
-
}
|
|
41254
|
-
};
|
|
41255
|
-
}
|
|
41256
|
-
return Object.keys(base).length > 0 ? base : undefined;
|
|
41257
|
-
}, [isVersions, onCatalogSelectionChange, onActualChange, ref]);
|
|
41543
|
+
}
|
|
41544
|
+
};
|
|
41545
|
+
}, [onActualChange, ref]);
|
|
41258
41546
|
useEffect(function () {
|
|
41259
41547
|
var _refObj$current;
|
|
41260
41548
|
var refObj = ref;
|
|
@@ -41265,40 +41553,18 @@ var Catalogs = /*#__PURE__*/forwardRef(function Catalogs(_ref, ref) {
|
|
|
41265
41553
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
41266
41554
|
children: [/*#__PURE__*/jsx(Spreadsheet, {
|
|
41267
41555
|
ref: ref,
|
|
41268
|
-
gridId:
|
|
41556
|
+
gridId: "catalogs-versions-grid",
|
|
41269
41557
|
applicationData: applicationData,
|
|
41270
41558
|
rowActions: rowActions,
|
|
41271
|
-
preFilter: preFilter,
|
|
41272
41559
|
configuration: configuration,
|
|
41273
41560
|
hooks: hooks
|
|
41274
41561
|
}), contextHolder]
|
|
41275
41562
|
});
|
|
41276
41563
|
});
|
|
41277
41564
|
|
|
41278
|
-
function ownKeys$l(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; }
|
|
41279
|
-
function _objectSpread$l(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$l(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$l(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
41280
|
-
/** Recursively set editable: true on leaf columns for versions table, except system fields */
|
|
41281
|
-
function makeColDefEditableForVersions(colDef) {
|
|
41282
|
-
return colDef.map(function (col) {
|
|
41283
|
-
if (col.children) {
|
|
41284
|
-
return _objectSpread$l(_objectSpread$l({}, col), {}, {
|
|
41285
|
-
children: makeColDefEditableForVersions(col.children)
|
|
41286
|
-
});
|
|
41287
|
-
}
|
|
41288
|
-
if (col.field && !['_id', 'hash', 'organizationId', 'catalogId'].includes(col.field)) {
|
|
41289
|
-
return _objectSpread$l(_objectSpread$l({}, col), {}, {
|
|
41290
|
-
editable: true
|
|
41291
|
-
});
|
|
41292
|
-
}
|
|
41293
|
-
return col;
|
|
41294
|
-
});
|
|
41295
|
-
}
|
|
41296
41565
|
var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
41297
41566
|
var organizationId = _ref.organizationId,
|
|
41298
41567
|
apiConfig = _ref.apiConfig,
|
|
41299
|
-
_ref$variant = _ref.variant,
|
|
41300
|
-
variant = _ref$variant === void 0 ? 'list' : _ref$variant,
|
|
41301
|
-
catalogIdProp = _ref.catalogId,
|
|
41302
41568
|
_ref$showApi = _ref.showApi2,
|
|
41303
41569
|
showApi2 = _ref$showApi === void 0 ? false : _ref$showApi,
|
|
41304
41570
|
setSelectedCatalog = _ref.setSelectedCatalog,
|
|
@@ -41314,17 +41580,12 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41314
41580
|
showErrorModal = _useLoadingModal.showErrorModal,
|
|
41315
41581
|
closeModal = _useLoadingModal.closeModal,
|
|
41316
41582
|
contextHolder = _useLoadingModal.contextHolder;
|
|
41317
|
-
var isVersions = variant === 'versions';
|
|
41318
41583
|
var applicationData = useMemo(function () {
|
|
41319
|
-
return
|
|
41320
|
-
organizationId: organizationId,
|
|
41321
|
-
_id: catalogIdProp
|
|
41322
|
-
} : {
|
|
41584
|
+
return {
|
|
41323
41585
|
organizationId: organizationId
|
|
41324
41586
|
};
|
|
41325
|
-
}, [organizationId
|
|
41587
|
+
}, [organizationId]);
|
|
41326
41588
|
var preFilter = useMemo(function () {
|
|
41327
|
-
if (isVersions) return undefined;
|
|
41328
41589
|
var orgPreFilter = {
|
|
41329
41590
|
colId: 'organizationId',
|
|
41330
41591
|
filterType: 'text',
|
|
@@ -41343,7 +41604,7 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41343
41604
|
};
|
|
41344
41605
|
}
|
|
41345
41606
|
return orgPreFilter;
|
|
41346
|
-
}, [organizationId, showApi2
|
|
41607
|
+
}, [organizationId, showApi2]);
|
|
41347
41608
|
var rowActions = useMemo(function () {
|
|
41348
41609
|
if (!setSelectedCatalog) return [];
|
|
41349
41610
|
return [{
|
|
@@ -41533,28 +41794,10 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41533
41794
|
}, {
|
|
41534
41795
|
headerName: 'backoffice.idmCatalog.general.label.comment',
|
|
41535
41796
|
field: 'comment'
|
|
41536
|
-
}, {
|
|
41537
|
-
headerName: 'backoffice.idmCatalog.general.label.
|
|
41538
|
-
|
|
41539
|
-
|
|
41540
|
-
editable: false,
|
|
41541
|
-
defaultValue: 4,
|
|
41542
|
-
required: true
|
|
41543
|
-
}, {
|
|
41544
|
-
headerName: 'backoffice.idmCatalog.general.label.minor',
|
|
41545
|
-
field: 'minor',
|
|
41546
|
-
cellDataType: 'number',
|
|
41547
|
-
editable: false,
|
|
41548
|
-
defaultValue: 1,
|
|
41549
|
-
required: true
|
|
41550
|
-
}, {
|
|
41551
|
-
headerName: 'backoffice.idmCatalog.general.label.revision',
|
|
41552
|
-
field: 'revision',
|
|
41553
|
-
cellDataType: 'number',
|
|
41554
|
-
editable: false,
|
|
41555
|
-
defaultValue: 0,
|
|
41556
|
-
required: true
|
|
41557
|
-
}, {
|
|
41797
|
+
}], _toConsumableArray(createVersionColumnDef({
|
|
41798
|
+
headerName: 'backoffice.idmCatalog.general.label.version',
|
|
41799
|
+
defaultVersion: '4.1.1'
|
|
41800
|
+
})), [{
|
|
41558
41801
|
headerName: 'backoffice.idmCatalog.general.label.format',
|
|
41559
41802
|
field: 'format',
|
|
41560
41803
|
cellDataType: 'enum',
|
|
@@ -41625,15 +41868,14 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41625
41868
|
suppressColumnsToolPanel: true,
|
|
41626
41869
|
defaultValue: '${organizationId}'
|
|
41627
41870
|
}]);
|
|
41628
|
-
var finalColDef = isVersions ? makeColDefEditableForVersions(colDef) : colDef;
|
|
41629
41871
|
return {
|
|
41630
41872
|
type: 'dotnetSSM',
|
|
41631
41873
|
apiInterface: apiInterface,
|
|
41632
41874
|
dateFormat: 'DD.MM.YYYY, HH:mm:ss',
|
|
41633
41875
|
floatingFilter: true,
|
|
41634
|
-
colDef:
|
|
41876
|
+
colDef: colDef
|
|
41635
41877
|
};
|
|
41636
|
-
}, [i18n.language, showApi2, t, apiConfig
|
|
41878
|
+
}, [i18n.language, showApi2, t, apiConfig]);
|
|
41637
41879
|
var hooks = useMemo(function () {
|
|
41638
41880
|
var base = {};
|
|
41639
41881
|
if (onActualChange) {
|
|
@@ -41650,7 +41892,7 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41650
41892
|
}
|
|
41651
41893
|
};
|
|
41652
41894
|
}
|
|
41653
|
-
if (
|
|
41895
|
+
if (onCatalogSelectionChange) {
|
|
41654
41896
|
base.onCellSelectionChanged = function (event) {
|
|
41655
41897
|
var _event$nodes$;
|
|
41656
41898
|
if (event.nodes.length === 1 && ((_event$nodes$ = event.nodes[0]) === null || _event$nodes$ === void 0 || (_event$nodes$ = _event$nodes$.data) === null || _event$nodes$ === void 0 ? void 0 : _event$nodes$.catalogId) != null) {
|
|
@@ -41661,7 +41903,7 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41661
41903
|
};
|
|
41662
41904
|
}
|
|
41663
41905
|
return Object.keys(base).length > 0 ? base : undefined;
|
|
41664
|
-
}, [
|
|
41906
|
+
}, [onCatalogSelectionChange, onActualChange, ref]);
|
|
41665
41907
|
useEffect(function () {
|
|
41666
41908
|
var _refObj$current;
|
|
41667
41909
|
var refObj = ref;
|
|
@@ -41672,7 +41914,7 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41672
41914
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
41673
41915
|
children: [/*#__PURE__*/jsx(Spreadsheet, {
|
|
41674
41916
|
ref: ref,
|
|
41675
|
-
gridId:
|
|
41917
|
+
gridId: "idm-catalogs-grid",
|
|
41676
41918
|
applicationData: applicationData,
|
|
41677
41919
|
rowActions: rowActions,
|
|
41678
41920
|
preFilter: preFilter,
|
|
@@ -41683,7 +41925,6 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
|
|
|
41683
41925
|
});
|
|
41684
41926
|
|
|
41685
41927
|
var TableCatalogs = observer(function () {
|
|
41686
|
-
var _selectedCatalogRow$_;
|
|
41687
41928
|
var root = useStore();
|
|
41688
41929
|
var _useTranslation = useTranslation(),
|
|
41689
41930
|
t = _useTranslation.t;
|
|
@@ -41727,12 +41968,10 @@ var TableCatalogs = observer(function () {
|
|
|
41727
41968
|
elementProps: {
|
|
41728
41969
|
organizationId: root.dataStore.organizationId,
|
|
41729
41970
|
apiConfig: root.configurationStore.apiConfig,
|
|
41730
|
-
|
|
41731
|
-
catalogId: (_selectedCatalogRow$_ = selectedCatalogRow === null || selectedCatalogRow === void 0 ? void 0 : selectedCatalogRow._id) !== null && _selectedCatalogRow$_ !== void 0 ? _selectedCatalogRow$_ : '',
|
|
41971
|
+
catalog: selectedCatalogRow,
|
|
41732
41972
|
setSelectedCatalog: setSelectedCatalog,
|
|
41733
41973
|
onActualChange: onActualChange,
|
|
41734
|
-
refreshTrigger: refreshTrigger
|
|
41735
|
-
catalogMajor: selectedCatalogRow === null || selectedCatalogRow === void 0 ? void 0 : selectedCatalogRow.major
|
|
41974
|
+
refreshTrigger: refreshTrigger
|
|
41736
41975
|
},
|
|
41737
41976
|
condition: function condition() {
|
|
41738
41977
|
return (selectedCatalogRow === null || selectedCatalogRow === void 0 ? void 0 : selectedCatalogRow._id) != null;
|
|
@@ -43498,7 +43737,7 @@ var Options$1 = /*#__PURE__*/forwardRef(function Options(_ref, ref) {
|
|
|
43498
43737
|
filterCellType: 'number',
|
|
43499
43738
|
displayLabelTemplate: '${name} (${value})',
|
|
43500
43739
|
apiInterface: {
|
|
43501
|
-
read: apiConfig.idmService + '/catalogs/${catalogId}/
|
|
43740
|
+
read: apiConfig.idmService + '/catalogs/${catalogId}/allfeatures'
|
|
43502
43741
|
},
|
|
43503
43742
|
lookupValue: 'featureText',
|
|
43504
43743
|
lookupKey: 'featureNo',
|