@homefile/components-v2 2.27.0 → 2.27.1
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,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { DrawerBody, DrawerHeader, DrawerFooter, Box } from '@chakra-ui/react';
|
|
4
|
-
import { PanelHeader, FooterDrawer, ItemFormFooter, Overlay,
|
|
4
|
+
import { PanelHeader, FooterDrawer, ItemFormFooter, Overlay, } from '../../..';
|
|
5
5
|
export const ItemFormPanel = ({ children, onClose, onSubmitForm, panelIcon, panelTitle, showOverlay = false, onClearForm, onDuplicate, }) => {
|
|
6
6
|
const { firstChild, otherChildren } = useMemo(() => {
|
|
7
|
-
let firstChild =
|
|
7
|
+
let firstChild = _jsx(_Fragment, {});
|
|
8
8
|
let otherChildren = children;
|
|
9
9
|
if (Array.isArray(children) && children.length > 0) {
|
|
10
10
|
const header = children[0];
|
|
@@ -15,5 +15,5 @@ export const ItemFormPanel = ({ children, onClose, onSubmitForm, panelIcon, pane
|
|
|
15
15
|
}
|
|
16
16
|
return { firstChild, otherChildren };
|
|
17
17
|
}, [children]);
|
|
18
|
-
return (_jsxs(_Fragment, { children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: panelIcon, title: panelTitle }) }), _jsx(DrawerBody, { p: "0", overflowX: "hidden", bg: "lightBlue.1", children:
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: panelIcon, title: panelTitle }) }), _jsx(DrawerBody, { p: "0", overflowX: "hidden", bg: "lightBlue.1", children: _jsxs(_Fragment, { children: [firstChild, _jsxs(Box, { position: "relative", mb: "200px", children: [_jsx(Overlay, { showOverlay: showOverlay, position: "absolute", w: "inherit", h: "inherit", zIndex: "9" }), otherChildren] })] }) }), onSubmitForm && (_jsx(FooterDrawer, { isOpen: !showOverlay, children: _jsx(DrawerFooter, { w: "100%", py: "0", children: _jsx(ItemFormFooter, { onClearForm: onClearForm, onDuplicate: onDuplicate, onSave: onSubmitForm, onCancel: onClose }) }) }))] }));
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ export const ItemFormPanel = ({
|
|
|
20
20
|
onDuplicate,
|
|
21
21
|
}: PropsWithChildren<ItemFormPanelI>) => {
|
|
22
22
|
const { firstChild, otherChildren } = useMemo(() => {
|
|
23
|
-
let firstChild: ReactNode
|
|
23
|
+
let firstChild: ReactNode = <></>
|
|
24
24
|
let otherChildren: ReactNode = children
|
|
25
25
|
|
|
26
26
|
if (Array.isArray(children) && children.length > 0) {
|
|
@@ -45,23 +45,19 @@ export const ItemFormPanel = ({
|
|
|
45
45
|
</DrawerHeader>
|
|
46
46
|
|
|
47
47
|
<DrawerBody p="0" overflowX="hidden" bg="lightBlue.1">
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</>
|
|
62
|
-
) : (
|
|
63
|
-
<Loading />
|
|
64
|
-
)}
|
|
48
|
+
<>
|
|
49
|
+
{firstChild}
|
|
50
|
+
<Box position="relative" mb="200px">
|
|
51
|
+
<Overlay
|
|
52
|
+
showOverlay={showOverlay}
|
|
53
|
+
position="absolute"
|
|
54
|
+
w="inherit"
|
|
55
|
+
h="inherit"
|
|
56
|
+
zIndex="9"
|
|
57
|
+
/>
|
|
58
|
+
{otherChildren}
|
|
59
|
+
</Box>
|
|
60
|
+
</>
|
|
65
61
|
</DrawerBody>
|
|
66
62
|
{onSubmitForm && (
|
|
67
63
|
<FooterDrawer isOpen={!showOverlay}>
|