@applica-software-guru/react-admin 1.5.244 → 1.5.247

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/package.json CHANGED
@@ -115,5 +115,5 @@
115
115
  "type": "module",
116
116
  "types": "dist/index.d.ts",
117
117
  "typings": "dist/index.d.ts",
118
- "version": "1.5.244"
118
+ "version": "1.5.247"
119
119
  }
@@ -348,11 +348,12 @@ function useBreadcrumbs() {
348
348
  const menu = _.cloneDeep(_menu);
349
349
  let id = pathname;
350
350
  let menuItem = findInMenu(menu!, pathname);
351
- if (!menuItem) {
351
+
352
+ if (!menuItem || menuItem.type === 'collapse' || menuItem.type === 'group') {
352
353
  menuItem = findInMenu(menu!, pathArgs[pathArgs.length - 1]);
353
354
  id = menuItem ? menuItem.id : id;
354
355
  }
355
- if (!menuItem) {
356
+ if (!menuItem || menuItem.type === 'collapse' || menuItem.type === 'group') {
356
357
  for (let i = pathArgs.length; i >= 0; i--) {
357
358
  const path = pathArgs.slice(0, i).join('/');
358
359
  menuItem = findInMenu(menu!, path);
@@ -363,6 +364,7 @@ function useBreadcrumbs() {
363
364
  }
364
365
  }
365
366
 
367
+ console.log('menuItem:', menuItem);
366
368
  const urlParts = menuItem?.url?.split('/');
367
369
  const urlPartsLength = urlParts?.length || 0;
368
370
  if (pathArgs.length >= urlPartsLength) {
@@ -36,7 +36,7 @@ type ResponsiveButtonProps = CreateButtonProps &
36
36
  disableFloatingButton?: boolean;
37
37
  };
38
38
  function ResponsiveButton(props: ResponsiveButtonProps): JSX.Element {
39
- const { disableFloatingButton, startIcon = <PlusCircleOutlined />, ...rest } = props;
39
+ const { disableFloatingButton, label = 'ra.action.create', startIcon = <PlusCircleOutlined />, ...rest } = props;
40
40
  const handleClick = useCallback(
41
41
  (event: any) => {
42
42
  (event as Event).preventDefault();
@@ -45,12 +45,13 @@ function ResponsiveButton(props: ResponsiveButtonProps): JSX.Element {
45
45
  },
46
46
  [props]
47
47
  );
48
+
48
49
  return disableFloatingButton ? (
49
- <RaButton {...rest} onClick={handleClick}>
50
+ <RaButton {...rest} onClick={handleClick} label={label}>
50
51
  {startIcon as any}
51
52
  </RaButton>
52
53
  ) : (
53
- <CreateButton {...props} onClick={handleClick}>
54
+ <CreateButton {...props} onClick={handleClick} label={label}>
54
55
  {startIcon as any}
55
56
  </CreateButton>
56
57
  );
@@ -17,6 +17,7 @@ function walkChildren(children: ReactNode = [], callback: (el: ReactElement) =>
17
17
  const validChildren = _.filter(_children, (child) => isValidElement(child));
18
18
  _.each(validChildren, (child) => {
19
19
  callback(child);
20
+ // @ts-ignore @ts-expect-error Property 'children' does not exist on type '{}'.
20
21
  walkChildren(child?.props?.children ?? [], callback);
21
22
  });
22
23
  }