@crystaldesign/diva-backoffice 24.9.0-rc.8 → 24.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/index.js +41 -37
- package/package.json +3 -3
package/build/esm/index.js
CHANGED
|
@@ -10,8 +10,8 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
|
10
10
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
11
11
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
12
12
|
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
13
|
-
import _get from '@babel/runtime/helpers/get';
|
|
14
13
|
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
14
|
+
import _get from '@babel/runtime/helpers/get';
|
|
15
15
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
16
16
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
17
17
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
@@ -152,7 +152,7 @@ function aplyMapping (_ref) {
|
|
|
152
152
|
if (isFormData) {
|
|
153
153
|
returnValue.set(key, value);
|
|
154
154
|
} else {
|
|
155
|
-
var
|
|
155
|
+
var _getTarget = function getTarget(idx, keys, startValue, valueToAdd) {
|
|
156
156
|
var newIdx = keys.length - idx;
|
|
157
157
|
var newKey = keys[newIdx - 1];
|
|
158
158
|
var newValue = {};
|
|
@@ -162,9 +162,9 @@ function aplyMapping (_ref) {
|
|
|
162
162
|
return startValue;
|
|
163
163
|
}
|
|
164
164
|
if (newIdx == 1) return _objectSpread$J(_objectSpread$J({}, startValue), newValue);
|
|
165
|
-
return
|
|
165
|
+
return _getTarget(idx + 1, keys, startValue, newValue);
|
|
166
166
|
};
|
|
167
|
-
returnValue =
|
|
167
|
+
returnValue = _getTarget(0, key.split('.'), returnValue, value);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
function meetsCondition(map) {
|
|
@@ -1139,6 +1139,7 @@ var _default$d = /*#__PURE__*/function () {
|
|
|
1139
1139
|
|
|
1140
1140
|
function _callSuper$7(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1141
1141
|
function _isNativeReflectConstruct$7() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
1142
|
+
function _superPropGet$3(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }
|
|
1142
1143
|
var _default$c = /*#__PURE__*/function (_ApiHandler) {
|
|
1143
1144
|
function _default(configuration, root) {
|
|
1144
1145
|
_classCallCheck(this, _default);
|
|
@@ -1163,7 +1164,7 @@ var _default$c = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1163
1164
|
element = data[index];
|
|
1164
1165
|
_context.t0 = result;
|
|
1165
1166
|
_context.next = 7;
|
|
1166
|
-
return
|
|
1167
|
+
return _superPropGet$3(_default, "update", this, 3)([element]);
|
|
1167
1168
|
case 7:
|
|
1168
1169
|
_context.t1 = _context.sent;
|
|
1169
1170
|
_context.t0.push.call(_context.t0, _context.t1);
|
|
@@ -1202,7 +1203,7 @@ var _default$c = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1202
1203
|
element = data[index];
|
|
1203
1204
|
_context2.t0 = result;
|
|
1204
1205
|
_context2.next = 7;
|
|
1205
|
-
return
|
|
1206
|
+
return _superPropGet$3(_default, "create", this, 3)([element, mapping, mappingData]);
|
|
1206
1207
|
case 7:
|
|
1207
1208
|
_context2.t1 = _context2.sent;
|
|
1208
1209
|
_context2.t0.push.call(_context2.t0, _context2.t1);
|
|
@@ -1445,6 +1446,7 @@ var _default$a = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1445
1446
|
|
|
1446
1447
|
function _callSuper$4(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1447
1448
|
function _isNativeReflectConstruct$4() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
1449
|
+
function _superPropGet$2(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }
|
|
1448
1450
|
var _default$9 = /*#__PURE__*/function (_ApiHandler) {
|
|
1449
1451
|
function _default(configuration, rootStore) {
|
|
1450
1452
|
var _this;
|
|
@@ -1485,7 +1487,7 @@ var _default$9 = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1485
1487
|
}, {
|
|
1486
1488
|
key: "readList",
|
|
1487
1489
|
value: function readList(mapping, mappingData) {
|
|
1488
|
-
return
|
|
1490
|
+
return _superPropGet$2(_default, "readList", this, 3)([mapping, mappingData, {
|
|
1489
1491
|
pagination: {
|
|
1490
1492
|
pageSize: 1000
|
|
1491
1493
|
},
|
|
@@ -1493,13 +1495,14 @@ var _default$9 = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1493
1495
|
field: '_id',
|
|
1494
1496
|
title: '_id'
|
|
1495
1497
|
}]
|
|
1496
|
-
});
|
|
1498
|
+
}]);
|
|
1497
1499
|
}
|
|
1498
1500
|
}]);
|
|
1499
1501
|
}(_default$d);
|
|
1500
1502
|
|
|
1501
1503
|
function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1502
1504
|
function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
1505
|
+
function _superPropGet$1(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }
|
|
1503
1506
|
var _default$8 = /*#__PURE__*/function (_ApiHandler) {
|
|
1504
1507
|
function _default(configuration, rootStore) {
|
|
1505
1508
|
var _this;
|
|
@@ -1588,7 +1591,7 @@ var _default$8 = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1588
1591
|
break;
|
|
1589
1592
|
}
|
|
1590
1593
|
_context.next = 27;
|
|
1591
|
-
return
|
|
1594
|
+
return _superPropGet$1(_default, "create", this, 3)([newEntries[index]]);
|
|
1592
1595
|
case 27:
|
|
1593
1596
|
index++;
|
|
1594
1597
|
_context.next = 24;
|
|
@@ -1638,7 +1641,7 @@ var _default$8 = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1638
1641
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1639
1642
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1640
1643
|
case 0:
|
|
1641
|
-
return _context3.abrupt("return",
|
|
1644
|
+
return _context3.abrupt("return", _superPropGet$1(_default, "read", this, 3)([mapping, mappingData]));
|
|
1642
1645
|
case 1:
|
|
1643
1646
|
case "end":
|
|
1644
1647
|
return _context3.stop();
|
|
@@ -1657,7 +1660,7 @@ var _default$8 = /*#__PURE__*/function (_ApiHandler) {
|
|
|
1657
1660
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1658
1661
|
while (1) switch (_context4.prev = _context4.next) {
|
|
1659
1662
|
case 0:
|
|
1660
|
-
return _context4.abrupt("return",
|
|
1663
|
+
return _context4.abrupt("return", _superPropGet$1(_default, "readList", this, 3)([mapping, mappingData, filterServerSide]));
|
|
1661
1664
|
case 1:
|
|
1662
1665
|
case "end":
|
|
1663
1666
|
return _context4.stop();
|
|
@@ -7349,7 +7352,7 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
7349
7352
|
name: 'organizationId',
|
|
7350
7353
|
hidden: true
|
|
7351
7354
|
}];
|
|
7352
|
-
var
|
|
7355
|
+
var _getItemsByContent = function getItemsByContent(content, path) {
|
|
7353
7356
|
for (var i = 0; i < content.length; i++) {
|
|
7354
7357
|
var item = content[i];
|
|
7355
7358
|
var p = [].concat(_toConsumableArray(path), [i]);
|
|
@@ -7512,12 +7515,12 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
7512
7515
|
name: [].concat(_toConsumableArray(p), ['style']),
|
|
7513
7516
|
hidden: true
|
|
7514
7517
|
});
|
|
7515
|
-
|
|
7518
|
+
_getItemsByContent(item.content, [].concat(_toConsumableArray(p), ['content']));
|
|
7516
7519
|
break;
|
|
7517
7520
|
}
|
|
7518
7521
|
}
|
|
7519
7522
|
};
|
|
7520
|
-
|
|
7523
|
+
_getItemsByContent(data.content, ['content']);
|
|
7521
7524
|
return result;
|
|
7522
7525
|
},
|
|
7523
7526
|
apiInterface: {
|
|
@@ -12609,15 +12612,15 @@ var DownloadStore = /*#__PURE__*/function () {
|
|
|
12609
12612
|
var link = document.createElement('a');
|
|
12610
12613
|
link.href = url;
|
|
12611
12614
|
link.download = name;
|
|
12612
|
-
var
|
|
12615
|
+
var _clickHandler = function clickHandler() {
|
|
12613
12616
|
setTimeout(function () {
|
|
12614
12617
|
URL.revokeObjectURL(url);
|
|
12615
|
-
removeEventListener('click',
|
|
12618
|
+
removeEventListener('click', _clickHandler);
|
|
12616
12619
|
document.body.removeChild(link);
|
|
12617
12620
|
}, 150);
|
|
12618
12621
|
};
|
|
12619
12622
|
document.body.appendChild(link);
|
|
12620
|
-
link.addEventListener('click',
|
|
12623
|
+
link.addEventListener('click', _clickHandler, false);
|
|
12621
12624
|
link.click();
|
|
12622
12625
|
}
|
|
12623
12626
|
}, {
|
|
@@ -14430,6 +14433,7 @@ var InputComponent$1 = observer(InputComponent, {
|
|
|
14430
14433
|
|
|
14431
14434
|
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14432
14435
|
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14436
|
+
function _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }
|
|
14433
14437
|
var _default = /*#__PURE__*/function (_ApiHandler) {
|
|
14434
14438
|
function _default(configuration, rootStore) {
|
|
14435
14439
|
var _this;
|
|
@@ -14712,13 +14716,13 @@ var _default = /*#__PURE__*/function (_ApiHandler) {
|
|
|
14712
14716
|
break;
|
|
14713
14717
|
case 9:
|
|
14714
14718
|
_context5.next = 11;
|
|
14715
|
-
return
|
|
14719
|
+
return _superPropGet(_default, "read", this, 3)([{
|
|
14716
14720
|
map: [{
|
|
14717
14721
|
targetField: 'organizationId',
|
|
14718
14722
|
sourceValue: organizationId
|
|
14719
14723
|
}],
|
|
14720
14724
|
type: 'query'
|
|
14721
|
-
});
|
|
14725
|
+
}]);
|
|
14722
14726
|
case 11:
|
|
14723
14727
|
organization = _context5.sent;
|
|
14724
14728
|
if (!(!organization || !((_organization$api2Loc = organization.api2Location) !== null && _organization$api2Loc !== void 0 && _organization$api2Loc.ek) && !((_organization$api2Loc2 = organization.api2Location) !== null && _organization$api2Loc2 !== void 0 && _organization$api2Loc2.vk))) {
|
|
@@ -15636,7 +15640,7 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
15636
15640
|
form.resetFields();
|
|
15637
15641
|
}
|
|
15638
15642
|
}, [state.data]);
|
|
15639
|
-
var
|
|
15643
|
+
var _trimStringsOfObject = function trimStringsOfObject(ob, prevOb) {
|
|
15640
15644
|
if (typeof ob == 'string') {
|
|
15641
15645
|
ob = ob.trim();
|
|
15642
15646
|
return;
|
|
@@ -15650,10 +15654,10 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
15650
15654
|
var ar = value;
|
|
15651
15655
|
for (var i = 0; i < ar.length; i++) {
|
|
15652
15656
|
var pO = prevOb === null || prevOb === void 0 ? void 0 : prevOb[key];
|
|
15653
|
-
|
|
15657
|
+
_trimStringsOfObject(ar[i], pO === null || pO === void 0 ? void 0 : pO[i]);
|
|
15654
15658
|
}
|
|
15655
15659
|
} else {
|
|
15656
|
-
|
|
15660
|
+
_trimStringsOfObject(value, prevOb === null || prevOb === void 0 ? void 0 : prevOb[key]);
|
|
15657
15661
|
}
|
|
15658
15662
|
} else if (typeof value == 'string') {
|
|
15659
15663
|
if (ob[key] !== (prevOb === null || prevOb === void 0 ? void 0 : prevOb[key])) {
|
|
@@ -15671,7 +15675,7 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
|
|
|
15671
15675
|
_context.prev = 0;
|
|
15672
15676
|
//normalize data before safing
|
|
15673
15677
|
if (_typeof(values) == 'object' && values !== null) {
|
|
15674
|
-
|
|
15678
|
+
_trimStringsOfObject(values, state.data);
|
|
15675
15679
|
}
|
|
15676
15680
|
Object.entries(values).forEach(function (_ref5, idx) {
|
|
15677
15681
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
@@ -21802,7 +21806,7 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
21802
21806
|
type: "default",
|
|
21803
21807
|
size: 'middle',
|
|
21804
21808
|
onClick: function onClick() {
|
|
21805
|
-
return setAnalyticsVisible(
|
|
21809
|
+
return !analyticsVisible ? setAnalyticsVisible(true) : undefined;
|
|
21806
21810
|
},
|
|
21807
21811
|
children: /*#__PURE__*/jsx(SMChart, {
|
|
21808
21812
|
field: state.configuration.histogram.field,
|
|
@@ -25454,12 +25458,12 @@ function useTransformJson (_ref) {
|
|
|
25454
25458
|
useEffect(function () {
|
|
25455
25459
|
if (!data) return;
|
|
25456
25460
|
var flat = [];
|
|
25457
|
-
|
|
25461
|
+
_getFlatData(data, flat);
|
|
25458
25462
|
setFlatData(flat);
|
|
25459
|
-
var _getItemsChain =
|
|
25463
|
+
var _getItemsChain = _getItemsChain3(data, []),
|
|
25460
25464
|
c = _getItemsChain.itemChain;
|
|
25461
25465
|
setItemChain(c);
|
|
25462
|
-
setTransformedData(
|
|
25466
|
+
setTransformedData(_transformData(data, c));
|
|
25463
25467
|
}, [data, root.dataStore.selectedOrganizationId]);
|
|
25464
25468
|
var _useMemo = useMemo(function () {
|
|
25465
25469
|
return {
|
|
@@ -25486,7 +25490,7 @@ function useTransformJson (_ref) {
|
|
|
25486
25490
|
return _ref2.apply(this, arguments);
|
|
25487
25491
|
};
|
|
25488
25492
|
}();
|
|
25489
|
-
var
|
|
25493
|
+
var _transformData = function transformData(data, itemChain, parentOrgId) {
|
|
25490
25494
|
var _data$children;
|
|
25491
25495
|
return _objectSpread$6(_objectSpread$6({}, data), {}, {
|
|
25492
25496
|
label: /*#__PURE__*/jsx(OrgItem$1, {
|
|
@@ -25498,11 +25502,11 @@ function useTransformJson (_ref) {
|
|
|
25498
25502
|
parentOrgId: parentOrgId
|
|
25499
25503
|
}, data.id + '1'),
|
|
25500
25504
|
children: (_data$children = data.children) === null || _data$children === void 0 ? void 0 : _data$children.map(function (c) {
|
|
25501
|
-
return
|
|
25505
|
+
return _transformData(c, itemChain, data.id);
|
|
25502
25506
|
})
|
|
25503
25507
|
});
|
|
25504
25508
|
};
|
|
25505
|
-
var
|
|
25509
|
+
var _getItemsChain3 = function getItemsChain(data, itemChain) {
|
|
25506
25510
|
if (root.dataStore.selectedOrganizationId == data.id) return {
|
|
25507
25511
|
found: true,
|
|
25508
25512
|
itemChain: [].concat(_toConsumableArray(itemChain), [data])
|
|
@@ -25510,7 +25514,7 @@ function useTransformJson (_ref) {
|
|
|
25510
25514
|
if (data.children) {
|
|
25511
25515
|
for (var i = 0; i < ((_data$children2 = data.children) === null || _data$children2 === void 0 ? void 0 : _data$children2.length); i++) {
|
|
25512
25516
|
var _data$children2;
|
|
25513
|
-
var _getItemsChain2 =
|
|
25517
|
+
var _getItemsChain2 = _getItemsChain3(data.children[i], [].concat(_toConsumableArray(itemChain), [data])),
|
|
25514
25518
|
found = _getItemsChain2.found,
|
|
25515
25519
|
newChain = _getItemsChain2.itemChain;
|
|
25516
25520
|
if (found) return {
|
|
@@ -25524,14 +25528,14 @@ function useTransformJson (_ref) {
|
|
|
25524
25528
|
itemChain: itemChain
|
|
25525
25529
|
};
|
|
25526
25530
|
};
|
|
25527
|
-
var
|
|
25531
|
+
var _getFlatData = function getFlatData(data, flat) {
|
|
25528
25532
|
flat.push({
|
|
25529
25533
|
label: data.displayName,
|
|
25530
25534
|
value: data.id
|
|
25531
25535
|
});
|
|
25532
25536
|
for (var i = 0; i < ((_data$children3 = data.children) !== null && _data$children3 !== void 0 ? _data$children3 : []).length; i++) {
|
|
25533
25537
|
var _data$children3;
|
|
25534
|
-
|
|
25538
|
+
_getFlatData(data.children[i], flat);
|
|
25535
25539
|
}
|
|
25536
25540
|
};
|
|
25537
25541
|
return {
|
|
@@ -30574,21 +30578,21 @@ function Router() {
|
|
|
30574
30578
|
if (!root.configurationStore.hasConfig) {
|
|
30575
30579
|
return [];
|
|
30576
30580
|
}
|
|
30577
|
-
var
|
|
30581
|
+
var _flat = function flat(menu, path) {
|
|
30578
30582
|
return menu.flatMap(function (item) {
|
|
30579
30583
|
var newPath = item.path ? "".concat(path, "/").concat(item.path) : path;
|
|
30580
30584
|
if (item.items) {
|
|
30581
|
-
return
|
|
30585
|
+
return _flat(item.items, newPath);
|
|
30582
30586
|
}
|
|
30583
30587
|
if (item.subMenu) {
|
|
30584
|
-
return
|
|
30588
|
+
return _flat(item.subMenu, newPath);
|
|
30585
30589
|
}
|
|
30586
30590
|
return [_objectSpread$1(_objectSpread$1({}, item), {}, {
|
|
30587
30591
|
path: newPath
|
|
30588
30592
|
})];
|
|
30589
30593
|
});
|
|
30590
30594
|
};
|
|
30591
|
-
return
|
|
30595
|
+
return _flat(menu, '');
|
|
30592
30596
|
}, [root.configurationStore.hasConfig]);
|
|
30593
30597
|
return /*#__PURE__*/jsx(Fragment, {
|
|
30594
30598
|
children: !!routes.length && /*#__PURE__*/jsx(Routes, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/diva-backoffice",
|
|
3
|
-
"version": "24.9.0
|
|
3
|
+
"version": "24.9.0",
|
|
4
4
|
"license": "COMMERCIAL",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@testing-library/jest-dom": "^5.15.0",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@ant-design/icons": "5.0.1",
|
|
17
17
|
"@babel/runtime": "7.18.0",
|
|
18
|
-
"@crystaldesign/spreadsheet": "24.9.0
|
|
18
|
+
"@crystaldesign/spreadsheet": "24.9.0",
|
|
19
19
|
"@google/model-viewer": "3.4.0",
|
|
20
20
|
"@tinymce/tinymce-react": "^3.13.0",
|
|
21
21
|
"ag-charts-community": "^9.3.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
},
|
|
52
52
|
"module": "build/esm/index.js",
|
|
53
53
|
"types": "./build/types/backoffice/src/index.d.ts",
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "0e66603a4345b77fa571e1d9f6a6f979ec5c5ce4"
|
|
55
55
|
}
|