@homefile/components-v2 2.8.30 → 2.8.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.
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { ItemFormPanelI } from '../../../../interfaces';
3
- export declare const ItemFormPanel: ({ children, onClose, onSubmitForm, panelIcon, panelTitle, showOverlay, }: PropsWithChildren<ItemFormPanelI>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const ItemFormPanel: ({ children, onClose, onSubmitForm, panelIcon, panelTitle, showOverlay, }: PropsWithChildren<ItemFormPanelI>) => import("react/jsx-runtime").JSX.Element | null;
@@ -6,10 +6,12 @@ export const ItemFormPanel = ({ children, onClose, onSubmitForm, panelIcon, pane
6
6
  let otherChildren = children;
7
7
  if (Array.isArray(children) && children.length > 0) {
8
8
  const header = children[0];
9
- if (header.props.id === 'item-name-header') {
9
+ if (header.props && header.props.id === 'item-name-header') {
10
10
  firstChild = header;
11
11
  otherChildren = children.slice(1);
12
12
  }
13
13
  }
14
+ if (!firstChild)
15
+ return null;
14
16
  return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: panelIcon, title: panelTitle }) }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", bg: "lightBlue.1", children: [firstChild, _jsxs(Box, { position: "relative", mb: "200px", children: [_jsx(Overlay, { showOverlay: showOverlay, position: "absolute", w: "inherit", h: "inherit", zIndex: "9" }), otherChildren] })] }), _jsx(FooterDrawer, { isOpen: !showOverlay, children: _jsx(DrawerFooter, { w: "100%", py: "0", children: _jsx(ItemFormFooter, { onSave: onSubmitForm, onCancel: onClose }) }) })] }));
15
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.8.30",
3
+ "version": "2.8.31",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -27,12 +27,14 @@ export const ItemFormPanel = ({
27
27
 
28
28
  if (Array.isArray(children) && children.length > 0) {
29
29
  const header = children[0]
30
- if (header.props.id === 'item-name-header') {
30
+ if (header.props && header.props.id === 'item-name-header') {
31
31
  firstChild = header
32
32
  otherChildren = children.slice(1)
33
33
  }
34
34
  }
35
35
 
36
+ if (!firstChild) return null
37
+
36
38
  return (
37
39
  <DrawerContent bg="lightBlue.1">
38
40
  <DrawerHeader p="0">