@crystaldesign/diva-backoffice 24.5.6 → 24.5.7-rc.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.
Files changed (2) hide show
  1. package/build/esm/index.js +39 -46
  2. package/package.json +2 -2
@@ -11132,7 +11132,7 @@ var DownloadStore = /*#__PURE__*/function () {
11132
11132
  }
11133
11133
  }, _callee, null, [[8, 17, 20, 23]]);
11134
11134
  }));
11135
- return function (_x3) {
11135
+ return function (_x) {
11136
11136
  return _ref2.apply(this, arguments);
11137
11137
  };
11138
11138
  }());
@@ -11174,7 +11174,7 @@ var DownloadStore = /*#__PURE__*/function () {
11174
11174
  }
11175
11175
  }, _callee2, this);
11176
11176
  }));
11177
- function donwloadFile(_x4, _x5) {
11177
+ function donwloadFile(_x2, _x3) {
11178
11178
  return _donwloadFile.apply(this, arguments);
11179
11179
  }
11180
11180
  return donwloadFile;
@@ -11214,7 +11214,7 @@ var DownloadStore = /*#__PURE__*/function () {
11214
11214
  }
11215
11215
  }, _callee3, this);
11216
11216
  }));
11217
- function connectionFile(_x6, _x7, _x8, _x9, _x10) {
11217
+ function connectionFile(_x4, _x5, _x6, _x7, _x8) {
11218
11218
  return _connectionFile.apply(this, arguments);
11219
11219
  }
11220
11220
  return connectionFile;
@@ -11278,23 +11278,15 @@ var DownloadStore = /*#__PURE__*/function () {
11278
11278
  }
11279
11279
  }, _callee4, this, [[14, 22]]);
11280
11280
  }));
11281
- function getConnectionData(_x11, _x12) {
11281
+ function getConnectionData(_x9, _x10) {
11282
11282
  return _getConnectionData.apply(this, arguments);
11283
11283
  }
11284
11284
  return getConnectionData;
11285
11285
  }()
11286
11286
  }, {
11287
11287
  key: "downloadRequest",
11288
- value: function (_downloadRequest) {
11289
- function downloadRequest(_x, _x2) {
11290
- return _downloadRequest.apply(this, arguments);
11291
- }
11292
- downloadRequest.toString = function () {
11293
- return _downloadRequest.toString();
11294
- };
11295
- return downloadRequest;
11296
- }( /*#__PURE__*/function () {
11297
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(download, data) {
11288
+ value: function () {
11289
+ var _downloadRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(download, data) {
11298
11290
  var _this$_rootStore2;
11299
11291
  var url, result, base64File, a, mimeType, res;
11300
11292
  return _regeneratorRuntime.wrap(function _callee5$(_context6) {
@@ -11344,10 +11336,11 @@ var DownloadStore = /*#__PURE__*/function () {
11344
11336
  }
11345
11337
  }, _callee5, this);
11346
11338
  }));
11347
- return function (_x13, _x14) {
11348
- return _ref4.apply(this, arguments);
11349
- };
11350
- }())
11339
+ function downloadRequest(_x11, _x12) {
11340
+ return _downloadRequest.apply(this, arguments);
11341
+ }
11342
+ return downloadRequest;
11343
+ }()
11351
11344
  }, {
11352
11345
  key: "checkCondition",
11353
11346
  value: function checkCondition(download, data) {
@@ -11423,7 +11416,7 @@ var DownloadStore = /*#__PURE__*/function () {
11423
11416
  }
11424
11417
  }, _callee6, this, [[3, 16, 19, 22]]);
11425
11418
  }));
11426
- function openDownload(_x15) {
11419
+ function openDownload(_x13) {
11427
11420
  return _openDownload.apply(this, arguments);
11428
11421
  }
11429
11422
  return openDownload;
@@ -13084,7 +13077,7 @@ function useFormData (_ref) {
13084
13077
  mediaHandler = _useDivaCore2.handler.mediaHandler;
13085
13078
  var onSave = /*#__PURE__*/function () {
13086
13079
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(values) {
13087
- var newData, finalData, response, i, _configuration$additi, additional, additionalApi, _data2, errorCode, item;
13080
+ var newData, finalData, response, i, _configuration$additi, additional, additionalApi, data, errorCode, item;
13088
13081
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
13089
13082
  while (1) switch (_context2.prev = _context2.next) {
13090
13083
  case 0:
@@ -13125,12 +13118,12 @@ function useFormData (_ref) {
13125
13118
  additionalApi = new _default$d({
13126
13119
  apiInterface: additional.apiInterface
13127
13120
  }, root);
13128
- _data2 = {};
13121
+ data = {};
13129
13122
  if (additional.addBaseUrl) {
13130
- _data2[additional.addBaseUrl] = window.location.origin;
13123
+ data[additional.addBaseUrl] = window.location.origin;
13131
13124
  }
13132
13125
  _context2.next = 23;
13133
- return additionalApi.create(_data2, additional.mapping, response);
13126
+ return additionalApi.create(data, additional.mapping, response);
13134
13127
  case 23:
13135
13128
  i++;
13136
13129
  _context2.next = 16;
@@ -13619,9 +13612,9 @@ var JsonEditor$2 = function JsonEditor(_ref) {
13619
13612
  mode: 'code',
13620
13613
  onChange: function onChange() {
13621
13614
  try {
13622
- var _e = jsonEditor.current.get();
13615
+ var e = jsonEditor.current.get();
13623
13616
  jsonEditor.current.validate();
13624
- _onChange === null || _onChange === void 0 || _onChange(_e);
13617
+ _onChange === null || _onChange === void 0 || _onChange(e);
13625
13618
  setCanSave(savable);
13626
13619
  } catch (_unused) {
13627
13620
  setCanSave(false);
@@ -13727,7 +13720,7 @@ function useButtonData (_ref) {
13727
13720
  }, [loading]);
13728
13721
  var onClick = /*#__PURE__*/function () {
13729
13722
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
13730
- var _result, _ref3, _result$error, newData;
13723
+ var result, _ref3, _result$error, newData;
13731
13724
  return _regeneratorRuntime.wrap(function _callee$(_context) {
13732
13725
  while (1) switch (_context.prev = _context.next) {
13733
13726
  case 0:
@@ -13736,21 +13729,21 @@ function useButtonData (_ref) {
13736
13729
  _context.next = 4;
13737
13730
  return apiHandler.create({}, configuration.mapping, data);
13738
13731
  case 4:
13739
- _result = _context.sent;
13740
- if (!_result || _result.error || _result.Error) {
13732
+ result = _context.sent;
13733
+ if (!result || result.error || result.Error) {
13741
13734
  configuration.resultTranslation && setActionResult({
13742
13735
  type: 'error',
13743
- message: configuration.resultTranslation ? t(configuration.resultTranslation.failed) : (_ref3 = (_result$error = _result.error) !== null && _result$error !== void 0 ? _result$error : _result.Error) !== null && _ref3 !== void 0 ? _ref3 : 'Failed'
13736
+ message: configuration.resultTranslation ? t(configuration.resultTranslation.failed) : (_ref3 = (_result$error = result.error) !== null && _result$error !== void 0 ? _result$error : result.Error) !== null && _ref3 !== void 0 ? _ref3 : 'Failed'
13744
13737
  });
13745
13738
  } else {
13746
13739
  configuration.resultTranslation && setActionResult({
13747
13740
  type: 'success',
13748
- message: configuration.resultTranslation ? t(configuration.resultTranslation.success) : _result !== null && _result !== void 0 && _result.result ? _result.result : 'Success'
13741
+ message: configuration.resultTranslation ? t(configuration.resultTranslation.success) : result !== null && result !== void 0 && result.result ? result.result : 'Success'
13749
13742
  });
13750
13743
  if (callback) {
13751
13744
  newData = aplyMapping({
13752
13745
  mapable: {},
13753
- mappingData: _result,
13746
+ mappingData: result,
13754
13747
  mapping: configuration.resultMapping,
13755
13748
  rootStore: root,
13756
13749
  fallBackToParams: true
@@ -14671,7 +14664,7 @@ function useSelectClientRelationCatalog (_ref) {
14671
14664
  }, [supplier]);
14672
14665
  var onSelectSupplier = /*#__PURE__*/function () {
14673
14666
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, catalogId) {
14674
- var _catalogList$, _selectedSupplier, catalogList, _supplierData;
14667
+ var _catalogList$, _selectedSupplier, catalogList, supplierData;
14675
14668
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
14676
14669
  while (1) switch (_context2.prev = _context2.next) {
14677
14670
  case 0:
@@ -14721,11 +14714,11 @@ function useSelectClientRelationCatalog (_ref) {
14721
14714
  _context2.next = 22;
14722
14715
  return apiHandler.readSupplierData(id);
14723
14716
  case 22:
14724
- _supplierData = _context2.sent;
14717
+ supplierData = _context2.sent;
14725
14718
  case 23:
14726
14719
  onSelectedSupplier === null || onSelectedSupplier === void 0 || onSelectedSupplier(_objectSpread$u(_objectSpread$u({}, _selectedSupplier), {}, {
14727
14720
  supplierGuid: catalogList === null || catalogList === void 0 || (_catalogList$ = catalogList[0]) === null || _catalogList$ === void 0 ? void 0 : _catalogList$.Subfolder
14728
- }), _supplierData);
14721
+ }), supplierData);
14729
14722
  if (catalogId && catalogList.find(function (c) {
14730
14723
  return c._id == catalogId;
14731
14724
  })) setSelectedCatalog(catalogId);
@@ -16259,9 +16252,9 @@ function useSelectOrCreateData (_ref) {
16259
16252
  var index = selected.findIndex(function (s) {
16260
16253
  return s.value == removed.value;
16261
16254
  });
16262
- var _newSelected = _toConsumableArray(selected);
16263
- _newSelected.splice(index, 1);
16264
- setSelected(_newSelected);
16255
+ var newSelected = _toConsumableArray(selected);
16256
+ newSelected.splice(index, 1);
16257
+ setSelected(newSelected);
16265
16258
  } else {
16266
16259
  setSelected([]);
16267
16260
  }
@@ -16569,25 +16562,25 @@ function useProcess (_ref) {
16569
16562
  }();
16570
16563
  var save = /*#__PURE__*/function () {
16571
16564
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(state) {
16572
- var newState, _index;
16565
+ var newState, index;
16573
16566
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
16574
16567
  while (1) switch (_context2.prev = _context2.next) {
16575
16568
  case 0:
16576
16569
  newState = [];
16577
- _index = 0;
16570
+ index = 0;
16578
16571
  case 2:
16579
- if (!(_index < state.length)) {
16572
+ if (!(index < state.length)) {
16580
16573
  _context2.next = 11;
16581
16574
  break;
16582
16575
  }
16583
16576
  _context2.t0 = newState;
16584
16577
  _context2.next = 6;
16585
- return saveData(state[_index], newState);
16578
+ return saveData(state[index], newState);
16586
16579
  case 6:
16587
16580
  _context2.t1 = _context2.sent;
16588
16581
  _context2.t0.push.call(_context2.t0, _context2.t1);
16589
16582
  case 8:
16590
- _index++;
16583
+ index++;
16591
16584
  _context2.next = 2;
16592
16585
  break;
16593
16586
  case 11:
@@ -25076,7 +25069,7 @@ function useJsonEditorData (id, setCanSave, onChange, onError) {
25076
25069
  }
25077
25070
  function _save() {
25078
25071
  _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(original) {
25079
- var _data;
25072
+ var data;
25080
25073
  return _regeneratorRuntime.wrap(function _callee$(_context) {
25081
25074
  while (1) switch (_context.prev = _context.next) {
25082
25075
  case 0:
@@ -25088,7 +25081,7 @@ function useJsonEditorData (id, setCanSave, onChange, onError) {
25088
25081
  _context.next = 4;
25089
25082
  return apiHandler.update(curData, original);
25090
25083
  case 4:
25091
- _data = _context.sent;
25084
+ data = _context.sent;
25092
25085
  _context.next = 11;
25093
25086
  break;
25094
25087
  case 7:
@@ -25099,9 +25092,9 @@ function useJsonEditorData (id, setCanSave, onChange, onError) {
25099
25092
  _context.next = 10;
25100
25093
  return apiHandler.create(curData);
25101
25094
  case 10:
25102
- _data = _context.sent;
25095
+ data = _context.sent;
25103
25096
  case 11:
25104
- onChange === null || onChange === void 0 || onChange(_data);
25097
+ onChange === null || onChange === void 0 || onChange(data);
25105
25098
  _context.next = 18;
25106
25099
  break;
25107
25100
  case 14:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "24.5.6",
3
+ "version": "24.5.7-rc.0",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^5.15.0",
@@ -50,5 +50,5 @@
50
50
  },
51
51
  "module": "build/esm/index.js",
52
52
  "types": "./build/types/backoffice/src/index.d.ts",
53
- "gitHead": "0619da92b3c23678f86d296471860632f3b9a74c"
53
+ "gitHead": "08596adcc76dd4f0178bb2e886f56e2fd98e65da"
54
54
  }