@singularsystems/neo-core 1.5.0 → 1.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Neo core changelog
2
2
 
3
+ ## Version 1.6.0 (23 June 2026)
4
+
5
+ - Minor routing changes to support changes in neo-react.
6
+
7
+ ## Version 1.5.1 (28 May 2026)
8
+
9
+ - Moved `exact` from `IRoute` to `IMenuRoute`.
10
+
3
11
  ## Version 1.5.0 (20 May 2026)
4
12
 
5
13
  - Better offline support (see wiki "PWA Offline" guide for more details).
@@ -15,4 +15,9 @@ export interface IMenuRoute extends IRoute {
15
15
  children?: IMenuRoute[];
16
16
  /** Icon to show on the menu. */
17
17
  icon?: any;
18
+ /**
19
+ * Should this menu item appear active only on an exact path match (instead of a startsWith match)?
20
+ * Set this to true if this is a parent menu item which has sub menu items.
21
+ */
22
+ exact?: boolean;
18
23
  }
@@ -10,8 +10,6 @@ export interface IRoute {
10
10
  role?: string;
11
11
  /** User must have 1 of these roles to view this route. */
12
12
  anyRoles?: string[];
13
- /** Match on exact path? Set this to true if this is a parent route which has sub routes. */
14
- exact?: boolean;
15
13
  /**
16
14
  * Path which will be used for links on a menu component.
17
15
  * If you specify parameters here, you must also specify `basePath`.
@@ -23,9 +21,9 @@ export interface IRoute {
23
21
  basePath?: string;
24
22
  /** Component to display in route view on master page */
25
23
  component?: any;
26
- /** True if this item should be displayed in it's childrens' breadcrumbs. Only applies if name, path and component are also specified. */
24
+ /** False if this item should *not* be displayed in its childrens' breadcrumbs. Only applies if name, path and component are also specified. */
27
25
  showInBreadCrumb?: boolean;
28
- /** Parent item to show in this item's breadcrumb. */
26
+ /** Parent item to show in this item's breadcrumb. Will be set automatically if `showInBreadCrumb` is not false. */
29
27
  breadCrumbParent?: IRoute;
30
28
  /** Child routes which must not show in a menu. The breadCrumbParent property of each child will be set to this route. */
31
29
  routeChildren?: IRoute[];
@@ -1,4 +1,4 @@
1
- import { __assign, __decorate, __metadata, __param } from "tslib";
1
+ import { __decorate, __metadata, __param } from "tslib";
2
2
  import { injectable, inject } from 'inversify';
3
3
  import NeoTypes from '../AppServices/NeoTypes';
4
4
  var MenuItemProvider = /** @class */ (function () {
@@ -11,21 +11,21 @@ var MenuItemProvider = /** @class */ (function () {
11
11
  * @param defaults Defaults to apply to menu items.
12
12
  */
13
13
  MenuItemProvider.prototype.processRoutes = function (routeItems, defaults) {
14
+ var _a, _b;
14
15
  if (defaults === void 0) { defaults = { hideWhenEmpty: true, collapseSingle: true }; }
15
16
  var filtered = [];
16
17
  for (var _i = 0, routeItems_1 = routeItems; _i < routeItems_1.length; _i++) {
17
- var route = routeItems_1[_i];
18
- var menuItem = __assign(__assign({}, defaults), route);
18
+ var menuItem = routeItems_1[_i];
19
19
  var canShow = this.canShowItem(menuItem);
20
20
  if (canShow) {
21
21
  if (menuItem.children) {
22
- menuItem.children = this.processRoutes(menuItem.children);
22
+ menuItem.children = this.processRoutes(menuItem.children, defaults);
23
23
  if (!menuItem.path) {
24
- if (menuItem.children.length === 0 && menuItem.hideWhenEmpty !== false) {
24
+ if (menuItem.children.length === 0 && ((_a = menuItem.hideWhenEmpty) !== null && _a !== void 0 ? _a : defaults.hideWhenEmpty) !== false) {
25
25
  // Hide empty nodes with no path of their own
26
26
  canShow = false;
27
27
  }
28
- else if (menuItem.children.length == 1 && menuItem.collapseSingle !== false) {
28
+ else if (menuItem.children.length == 1 && ((_b = menuItem.collapseSingle) !== null && _b !== void 0 ? _b : defaults.collapseSingle) !== false) {
29
29
  // Merge single node into parent if parent has no path of it's own.
30
30
  menuItem = menuItem.children[0];
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-core",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Core functionality for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",