elseware-ui 2.20.6 → 2.20.7

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.
@@ -5,6 +5,11 @@ export interface EUIComponentDefaults {
5
5
  shape?: keyof typeof Shape;
6
6
  styles?: string;
7
7
  }
8
+ export interface EUIRoute {
9
+ path: string;
10
+ name: string;
11
+ }
8
12
  export interface EUIConfigs {
9
13
  global?: EUIComponentDefaults;
14
+ routes?: EUIRoute[];
10
15
  }
package/build/index.es.js CHANGED
@@ -141626,9 +141626,6 @@ function BreadcrumbItem(_a) {
141626
141626
  }) }, { children: title })));
141627
141627
  }
141628
141628
 
141629
- // ----------------------
141630
- // Utils
141631
- // ----------------------
141632
141629
  var matchRoute = function (routePath, currentPath) {
141633
141630
  var routeParts = routePath.split("/").filter(Boolean);
141634
141631
  var pathParts = currentPath.split("/").filter(Boolean);
@@ -141656,21 +141653,20 @@ var buildFromRoutes = function (routes, currentPath) {
141656
141653
  }
141657
141654
  return items;
141658
141655
  };
141659
- // ----------------------
141660
- // Component
141661
- // ----------------------
141662
141656
  var Breadcrumb = function (_a) {
141663
141657
  var _b;
141664
141658
  var _c = _a.gap, gap = _c === void 0 ? 1 : _c, _d = _a.seperator, seperator = _d === void 0 ? "/" : _d, _e = _a.data, data = _e === void 0 ? [] : _e, routes = _a.routes, currentPath = _a.currentPath, navigate = _a.navigate, styles = _a.styles;
141659
+ var config = useEUIConfig().config;
141665
141660
  var pathname = currentPath ||
141666
141661
  (typeof window !== "undefined" ? window.location.pathname : "/");
141667
- // 🔥 Decide source of truth
141662
+ var resolvedRoutes = routes || (config === null || config === void 0 ? void 0 : config.routes) || [];
141663
+ // Decide source of truth
141668
141664
  var resolvedData = useMemo$1(function () {
141669
- if (routes && routes.length > 0) {
141670
- return buildFromRoutes(routes, pathname);
141665
+ if (resolvedRoutes && resolvedRoutes.length > 0) {
141666
+ return buildFromRoutes(resolvedRoutes, pathname);
141671
141667
  }
141672
141668
  return data;
141673
- }, [routes, data, pathname]);
141669
+ }, [resolvedRoutes, data, pathname]);
141674
141670
  var childrenContent;
141675
141671
  if (resolvedData.length > 0) {
141676
141672
  var items = resolvedData.map(function (item, index) {
package/build/index.js CHANGED
@@ -141653,9 +141653,6 @@ function BreadcrumbItem(_a) {
141653
141653
  }) }, { children: title })));
141654
141654
  }
141655
141655
 
141656
- // ----------------------
141657
- // Utils
141658
- // ----------------------
141659
141656
  var matchRoute = function (routePath, currentPath) {
141660
141657
  var routeParts = routePath.split("/").filter(Boolean);
141661
141658
  var pathParts = currentPath.split("/").filter(Boolean);
@@ -141683,21 +141680,20 @@ var buildFromRoutes = function (routes, currentPath) {
141683
141680
  }
141684
141681
  return items;
141685
141682
  };
141686
- // ----------------------
141687
- // Component
141688
- // ----------------------
141689
141683
  var Breadcrumb = function (_a) {
141690
141684
  var _b;
141691
141685
  var _c = _a.gap, gap = _c === void 0 ? 1 : _c, _d = _a.seperator, seperator = _d === void 0 ? "/" : _d, _e = _a.data, data = _e === void 0 ? [] : _e, routes = _a.routes, currentPath = _a.currentPath, navigate = _a.navigate, styles = _a.styles;
141686
+ var config = useEUIConfig().config;
141692
141687
  var pathname = currentPath ||
141693
141688
  (typeof window !== "undefined" ? window.location.pathname : "/");
141694
- // 🔥 Decide source of truth
141689
+ var resolvedRoutes = routes || (config === null || config === void 0 ? void 0 : config.routes) || [];
141690
+ // Decide source of truth
141695
141691
  var resolvedData = React.useMemo(function () {
141696
- if (routes && routes.length > 0) {
141697
- return buildFromRoutes(routes, pathname);
141692
+ if (resolvedRoutes && resolvedRoutes.length > 0) {
141693
+ return buildFromRoutes(resolvedRoutes, pathname);
141698
141694
  }
141699
141695
  return data;
141700
- }, [routes, data, pathname]);
141696
+ }, [resolvedRoutes, data, pathname]);
141701
141697
  var childrenContent;
141702
141698
  if (resolvedData.length > 0) {
141703
141699
  var items = resolvedData.map(function (item, index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elseware-ui",
3
- "version": "2.20.6",
3
+ "version": "2.20.7",
4
4
  "private": false,
5
5
  "description": "A modern and customizable React UI component library by elseware Technology.",
6
6
  "keywords": [