@homefile/components-v2 2.11.5 → 2.11.6
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/dist/components/folderPanel/displayFiles/GridFile.js +2 -2
- package/dist/components/folderPanel/displayFiles/ListFile.js +2 -2
- package/dist/mocks/folderPanel/DisplayFiles.mock.js +10 -0
- package/package.json +1 -1
- package/src/components/folderPanel/displayFiles/GridFile.tsx +2 -2
- package/src/components/folderPanel/displayFiles/ListFile.tsx +2 -2
- package/src/mocks/folderPanel/DisplayFiles.mock.ts +10 -0
|
@@ -16,7 +16,7 @@ import { DocIcon } from '../../../assets/images';
|
|
|
16
16
|
import { fileTypes, getFileExtension } from '../../../helpers';
|
|
17
17
|
export const GridFile = (_a) => {
|
|
18
18
|
var { menu = [], onClick, onMove } = _a, props = __rest(_a, ["menu", "onClick", "onMove"]);
|
|
19
|
-
const { _id, title, updatedAt, files = [], receipt } = props;
|
|
19
|
+
const { _id, title, updatedAt, files = [], receipt, report } = props;
|
|
20
20
|
const fileExtension = getFileExtension(files, !!receipt);
|
|
21
21
|
const itemForm = {
|
|
22
22
|
_id,
|
|
@@ -24,5 +24,5 @@ export const GridFile = (_a) => {
|
|
|
24
24
|
updatedAt,
|
|
25
25
|
icon: fileTypes[fileExtension] || DocIcon,
|
|
26
26
|
};
|
|
27
|
-
return (_jsxs(WrapItem, { maxW: "7rem", position: "relative", children: [_jsx(Box, { position: "absolute", top: "0", right: "1", zIndex: "docked", children: _jsx(IconMenuWithMove, { disabled: menu.length < 1 ? true : false, icon: _jsx(MoreHorizontal, { size: 28 }), itemForm: itemForm, menuItems: menu, onMove: () => onMove(itemForm) }) }), _jsx(Button, { variant: "folder", px: "base", pb: "base", pt: "6", onClick: () => onClick(props), children: _jsxs(Stack, { spacing: "1", align: "center", children: [_jsx(Image, { src: fileTypes[fileExtension] || DocIcon, w: "46px", h: "49px", alt: fileExtension, transition: "all 0.2s ease-in-out" }), _jsxs(Box, { children: [_jsx(Text, { isTruncated: true, maxWidth: "5rem", fontSize: "sm", children: title }), _jsx(Text, { variant: "date", children: updatedAt })] })] }) })] }));
|
|
27
|
+
return (_jsxs(WrapItem, { maxW: "7rem", position: "relative", children: [_jsx(Box, { position: "absolute", top: "0", right: "1", zIndex: "docked", children: _jsx(IconMenuWithMove, { disabled: menu.length < 1 ? true : false, icon: _jsx(MoreHorizontal, { size: 28 }), itemForm: itemForm, menuItems: menu, onMove: () => onMove(itemForm) }) }), _jsx(Button, { variant: "folder", px: "base", pb: "base", pt: "6", onClick: () => onClick(props), children: _jsxs(Stack, { spacing: "1", align: "center", children: [_jsx(Image, { src: (report && report.length > 0) ? DocIcon : fileTypes[fileExtension] || DocIcon, w: "46px", h: "49px", alt: fileExtension, transition: "all 0.2s ease-in-out" }), _jsxs(Box, { children: [_jsx(Text, { isTruncated: true, maxWidth: "5rem", fontSize: "sm", children: title }), _jsx(Text, { variant: "date", children: updatedAt })] })] }) })] }));
|
|
28
28
|
};
|
|
@@ -16,7 +16,7 @@ import { DocIcon } from '../../../assets/images';
|
|
|
16
16
|
import { fileTypes, getFileExtension } from '../../../helpers';
|
|
17
17
|
export const ListFile = (_a) => {
|
|
18
18
|
var { menu = [], onClick, onMove } = _a, props = __rest(_a, ["menu", "onClick", "onMove"]);
|
|
19
|
-
const { _id, title, updatedAt, files = [], receipt } = props;
|
|
19
|
+
const { _id, title, updatedAt, files = [], receipt, report } = props;
|
|
20
20
|
const fileExtension = getFileExtension(files, !!receipt);
|
|
21
21
|
const itemForm = {
|
|
22
22
|
_id,
|
|
@@ -24,5 +24,5 @@ export const ListFile = (_a) => {
|
|
|
24
24
|
updatedAt,
|
|
25
25
|
icon: fileTypes[fileExtension] || DocIcon,
|
|
26
26
|
};
|
|
27
|
-
return (_jsx(Box, { bg: "neutral.white", w: "100%", transition: "all 0.2s ease-in-out", _hover: { bg: 'lightGreen.1' }, children: _jsxs(Flex, { children: [_jsxs(Flex, { gap: "base", p: "base", as: "button", flex: "1", onClick: () => onClick(props), children: [_jsx(Image, { src: fileTypes[fileExtension] || DocIcon, minW: "32px", h: "auto", alt: fileExtension, transition: "all 0.2s ease-in-out" }), _jsxs(Box, { mt: "-1", children: [_jsx(Text, { variant: "date", textTransform: "uppercase", textAlign: "left", children: fileExtension === '' ? 'Doc' : fileExtension }), _jsx(Text, { textOverflow: "ellipsis", noOfLines: 1, fontSize: "sm", textAlign: "left", children: title })] })] }), _jsxs(Flex, { align: "center", gap: "2", h: "fit-content", p: "1", pr: "base", children: [_jsx(Text, { variant: "date", w: "fit-content", children: updatedAt }), _jsx(IconMenuWithMove, { disabled: menu.length < 1 ? true : false, icon: _jsx(MoreHorizontal, { size: 28 }), itemForm: itemForm, menuItems: menu, onMove: () => onMove(itemForm) })] })] }) }));
|
|
27
|
+
return (_jsx(Box, { bg: "neutral.white", w: "100%", transition: "all 0.2s ease-in-out", _hover: { bg: 'lightGreen.1' }, children: _jsxs(Flex, { children: [_jsxs(Flex, { gap: "base", p: "base", as: "button", flex: "1", onClick: () => onClick(props), children: [_jsx(Image, { src: (report && report.length > 0) ? DocIcon : fileTypes[fileExtension] || DocIcon, minW: "32px", h: "auto", alt: fileExtension, transition: "all 0.2s ease-in-out" }), _jsxs(Box, { mt: "-1", children: [_jsx(Text, { variant: "date", textTransform: "uppercase", textAlign: "left", children: fileExtension === '' ? 'Doc' : fileExtension }), _jsx(Text, { textOverflow: "ellipsis", noOfLines: 1, fontSize: "sm", textAlign: "left", children: title })] })] }), _jsxs(Flex, { align: "center", gap: "2", h: "fit-content", p: "1", pr: "base", children: [_jsx(Text, { variant: "date", w: "fit-content", children: updatedAt }), _jsx(IconMenuWithMove, { disabled: menu.length < 1 ? true : false, icon: _jsx(MoreHorizontal, { size: 28 }), itemForm: itemForm, menuItems: menu, onMove: () => onMove(itemForm) })] })] }) }));
|
|
28
28
|
};
|
|
@@ -23,6 +23,16 @@ export const DisplayFilesMock = [
|
|
|
23
23
|
],
|
|
24
24
|
updatedAt: '2021-08-01T00:00:00.000Z',
|
|
25
25
|
receipt: 'receipt',
|
|
26
|
+
// report: [
|
|
27
|
+
// {
|
|
28
|
+
// "name": "Brand/Manufacturer",
|
|
29
|
+
// "description": "",
|
|
30
|
+
// "comments": "",
|
|
31
|
+
// "value": "",
|
|
32
|
+
// "type": "text",
|
|
33
|
+
// "id": "10"
|
|
34
|
+
// }
|
|
35
|
+
// ]
|
|
26
36
|
},
|
|
27
37
|
// {
|
|
28
38
|
// _id: '2',
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ export const GridFile = ({
|
|
|
10
10
|
onMove,
|
|
11
11
|
...props
|
|
12
12
|
}: DisplayFileI) => {
|
|
13
|
-
const { _id, title, updatedAt, files = [], receipt } = props
|
|
13
|
+
const { _id, title, updatedAt, files = [], receipt, report } = props
|
|
14
14
|
|
|
15
15
|
const fileExtension = getFileExtension(files, !!receipt)
|
|
16
16
|
|
|
@@ -41,7 +41,7 @@ export const GridFile = ({
|
|
|
41
41
|
>
|
|
42
42
|
<Stack spacing="1" align="center">
|
|
43
43
|
<Image
|
|
44
|
-
src={fileTypes[fileExtension] || DocIcon}
|
|
44
|
+
src={(report && report.length > 0) ? DocIcon : fileTypes[fileExtension] || DocIcon}
|
|
45
45
|
w="46px"
|
|
46
46
|
h="49px"
|
|
47
47
|
alt={fileExtension}
|
|
@@ -10,7 +10,7 @@ export const ListFile = ({
|
|
|
10
10
|
onMove,
|
|
11
11
|
...props
|
|
12
12
|
}: DisplayFileI) => {
|
|
13
|
-
const { _id, title, updatedAt, files = [], receipt } = props
|
|
13
|
+
const { _id, title, updatedAt, files = [], receipt, report } = props
|
|
14
14
|
|
|
15
15
|
const fileExtension = getFileExtension(files, !!receipt)
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ export const ListFile = ({
|
|
|
37
37
|
onClick={() => onClick(props)}
|
|
38
38
|
>
|
|
39
39
|
<Image
|
|
40
|
-
src={fileTypes[fileExtension] || DocIcon}
|
|
40
|
+
src={(report && report.length > 0) ? DocIcon : fileTypes[fileExtension] || DocIcon}
|
|
41
41
|
minW="32px"
|
|
42
42
|
h="auto"
|
|
43
43
|
alt={fileExtension}
|
|
@@ -25,6 +25,16 @@ export const DisplayFilesMock: FileInfoI[] = [
|
|
|
25
25
|
],
|
|
26
26
|
updatedAt: '2021-08-01T00:00:00.000Z',
|
|
27
27
|
receipt: 'receipt',
|
|
28
|
+
// report: [
|
|
29
|
+
// {
|
|
30
|
+
// "name": "Brand/Manufacturer",
|
|
31
|
+
// "description": "",
|
|
32
|
+
// "comments": "",
|
|
33
|
+
// "value": "",
|
|
34
|
+
// "type": "text",
|
|
35
|
+
// "id": "10"
|
|
36
|
+
// }
|
|
37
|
+
// ]
|
|
28
38
|
},
|
|
29
39
|
// {
|
|
30
40
|
// _id: '2',
|