@crystaldesign/diva-backoffice 25.3.0-beta.30 → 25.3.0-beta.31

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.
@@ -13226,16 +13226,24 @@ var _default$6 = /*#__PURE__*/function () {
13226
13226
  }, {
13227
13227
  key: "fillSelectedUntilFistLeaf",
13228
13228
  value: function fillSelectedUntilFistLeaf(menu, selected, pos, key) {
13229
+ var _this3 = this;
13229
13230
  var newSelected = selected.slice(0, pos);
13230
13231
  newSelected.push(key);
13231
13232
  var currentMenuItem = menu.find(function (element) {
13232
13233
  return element.id === key[0];
13233
13234
  });
13234
13235
  while ((_currentMenuItem = currentMenuItem) !== null && _currentMenuItem !== void 0 && (_currentMenuItem = _currentMenuItem.subMenu) !== null && _currentMenuItem !== void 0 && _currentMenuItem.length) {
13235
- var _currentMenuItem, _currentMenuItem$subM;
13236
- var keys = [currentMenuItem.subMenu[0].id];
13237
- if ((_currentMenuItem$subM = currentMenuItem.subMenu[0].items) !== null && _currentMenuItem$subM !== void 0 && _currentMenuItem$subM.length) {
13238
- keys.unshift(currentMenuItem.subMenu[0].items[0].id);
13236
+ var _currentMenuItem, _item$items;
13237
+ var item = currentMenuItem.subMenu.find(function (subMenu) {
13238
+ return !subMenu.rules || applyRule({
13239
+ rules: subMenu.rules,
13240
+ data: undefined,
13241
+ rootStore: _this3.root
13242
+ });
13243
+ });
13244
+ var keys = [item === null || item === void 0 ? void 0 : item.id];
13245
+ if (item !== null && item !== void 0 && (_item$items = item.items) !== null && _item$items !== void 0 && _item$items.length) {
13246
+ keys.unshift(item.items[0].id);
13239
13247
  }
13240
13248
  newSelected.push(keys);
13241
13249
  currentMenuItem = currentMenuItem.subMenu[0];
@@ -13248,7 +13256,7 @@ var _default$6 = /*#__PURE__*/function () {
13248
13256
  var path = [];
13249
13257
  var currentMenu = menu;
13250
13258
  var _loop = function _loop() {
13251
- var _currentMenuItem$subM2, _currentMenuItem$item;
13259
+ var _currentMenuItem$subM, _currentMenuItem$item;
13252
13260
  var keys = selected[i];
13253
13261
  var currentMenuItem = currentMenu.find(function (element) {
13254
13262
  return element.id === keys[keys.length - 1];
@@ -13257,7 +13265,7 @@ var _default$6 = /*#__PURE__*/function () {
13257
13265
  throw new Error('Menu item not found');
13258
13266
  }
13259
13267
  path.push(currentMenuItem.path);
13260
- if ((_currentMenuItem$subM2 = currentMenuItem.subMenu) !== null && _currentMenuItem$subM2 !== void 0 && _currentMenuItem$subM2.length) {
13268
+ if ((_currentMenuItem$subM = currentMenuItem.subMenu) !== null && _currentMenuItem$subM !== void 0 && _currentMenuItem$subM.length) {
13261
13269
  currentMenu = currentMenuItem.subMenu;
13262
13270
  } else if ((_currentMenuItem$item = currentMenuItem.items) !== null && _currentMenuItem$item !== void 0 && _currentMenuItem$item.length) {
13263
13271
  var items = currentMenuItem.items;
@@ -13302,7 +13310,7 @@ var _default$6 = /*#__PURE__*/function () {
13302
13310
  var pathParts = path.split('/').slice(1);
13303
13311
  var currentKeys = [];
13304
13312
  for (var i = 0; i < pathParts.length; i++) {
13305
- var _currentKeys, _currentMenuItem$item3, _currentMenuItem$subM3;
13313
+ var _currentKeys, _currentMenuItem$item3, _currentMenuItem$subM2;
13306
13314
  var found = this.flatFindMenuItem(currentMenu, pathParts[i]);
13307
13315
  if (!found) {
13308
13316
  break;
@@ -13311,7 +13319,7 @@ var _default$6 = /*#__PURE__*/function () {
13311
13319
  var currentMenuItem = found.item;
13312
13320
  if ((_currentMenuItem$item3 = currentMenuItem.items) !== null && _currentMenuItem$item3 !== void 0 && _currentMenuItem$item3.length) {
13313
13321
  currentMenu = currentMenuItem.items;
13314
- } else if ((_currentMenuItem$subM3 = currentMenuItem.subMenu) !== null && _currentMenuItem$subM3 !== void 0 && _currentMenuItem$subM3.length) {
13322
+ } else if ((_currentMenuItem$subM2 = currentMenuItem.subMenu) !== null && _currentMenuItem$subM2 !== void 0 && _currentMenuItem$subM2.length) {
13315
13323
  currentMenu = currentMenuItem.subMenu;
13316
13324
  selectedkeys.push(currentKeys);
13317
13325
  currentKeys = [];
@@ -13355,7 +13363,7 @@ var _default$6 = /*#__PURE__*/function () {
13355
13363
  }, {
13356
13364
  key: "getMenuItem",
13357
13365
  value: function getMenuItem(item) {
13358
- var _this3 = this;
13366
+ var _this4 = this;
13359
13367
  if (item.items) {
13360
13368
  var disabled = item.rules ? !applyRule({
13361
13369
  rules: item.rules,
@@ -13371,7 +13379,7 @@ var _default$6 = /*#__PURE__*/function () {
13371
13379
  disabled: disabled,
13372
13380
  icon: getIcon(item.icon),
13373
13381
  children: item.items.map(function (i) {
13374
- return _this3.getMenuItem(i);
13382
+ return _this4.getMenuItem(i);
13375
13383
  })
13376
13384
  };
13377
13385
  return menuItem;
@@ -13406,7 +13414,7 @@ var _default$6 = /*#__PURE__*/function () {
13406
13414
  }, {
13407
13415
  key: "filterMenuByPermission",
13408
13416
  value: function filterMenuByPermission(hasPermission, items) {
13409
- var _this4 = this;
13417
+ var _this5 = this;
13410
13418
  if (!items) {
13411
13419
  return [];
13412
13420
  }
@@ -13414,8 +13422,8 @@ var _default$6 = /*#__PURE__*/function () {
13414
13422
  return !item.permission || hasPermission(item.permission.toLocaleLowerCase());
13415
13423
  }).map(function (item) {
13416
13424
  return _objectSpread$R(_objectSpread$R({}, item), {}, {
13417
- items: item.items ? _this4.filterMenuByPermission(hasPermission, item.items) : undefined,
13418
- subMenu: item.subMenu ? _this4.filterMenuByPermission(hasPermission, item.subMenu) : undefined
13425
+ items: item.items ? _this5.filterMenuByPermission(hasPermission, item.items) : undefined,
13426
+ subMenu: item.subMenu ? _this5.filterMenuByPermission(hasPermission, item.subMenu) : undefined
13419
13427
  });
13420
13428
  }).filter(function (item) {
13421
13429
  return !item.items && !item.subMenu || item.items && item.items.length || item.subMenu && item.subMenu.length;
@@ -1 +1 @@
1
- {"version":3,"file":"ContentStore.d.ts","sourceRoot":"","sources":["../../../../../src/store/ContentStore.ts"],"names":[],"mappings":"AAAA,OAAO,EA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xC,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;QAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,CAAC,EAAE,IAAI;IA+BjG,uBAAuB,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,GAAG,MAAM;IAWjD;;;;;;;;;OASG;IACH,OAAO,CAAC,yBAAyB;IAmBjC,OAAO,CAAC,OAAO;IAiCf;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAwBpB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAyBnB;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;CAa/B;AAED,eAAO,MAAM,IAAI,EAAE,QAAQ,EAygB1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "25.3.0-beta.30",
3
+ "version": "25.3.0-beta.31",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^6.5.0",
@@ -15,13 +15,13 @@
15
15
  "dependencies": {
16
16
  "@ant-design/icons": "5.4.0",
17
17
  "@babel/runtime": "7.24.7",
18
- "@crystaldesign/content-box": "25.3.0-beta.30",
19
- "@crystaldesign/content-item": "25.3.0-beta.30",
20
- "@crystaldesign/diva-core": "25.3.0-beta.30",
21
- "@crystaldesign/diva-utils": "25.3.0-beta.30",
22
- "@crystaldesign/media-upload": "25.3.0-beta.30",
23
- "@crystaldesign/rtf-editor": "25.3.0-beta.30",
24
- "@crystaldesign/spreadsheet": "25.3.0-beta.30",
18
+ "@crystaldesign/content-box": "25.3.0-beta.31",
19
+ "@crystaldesign/content-item": "25.3.0-beta.31",
20
+ "@crystaldesign/diva-core": "25.3.0-beta.31",
21
+ "@crystaldesign/diva-utils": "25.3.0-beta.31",
22
+ "@crystaldesign/media-upload": "25.3.0-beta.31",
23
+ "@crystaldesign/rtf-editor": "25.3.0-beta.31",
24
+ "@crystaldesign/spreadsheet": "25.3.0-beta.31",
25
25
  "@google/model-viewer": "3.5.0",
26
26
  "ag-charts-community": "^10.1.0",
27
27
  "ag-charts-react": "^10.1.0",
@@ -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": "5b373ae47c7cd86ee139fef851b3eca2f8829d93"
54
+ "gitHead": "4e02d7922c3894835caaf0619ae30776098aeb6b"
55
55
  }