@homefile/components-v2 2.24.20 → 2.24.21
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/assets/locales/en/index.json +1 -1
- package/dist/components/receipts/receipt/PdfButton.js +3 -1
- package/dist/components/receipts/receipt/ReceiptDetails.d.ts +2 -1
- package/dist/components/receipts/receipt/ReceiptDetails.js +3 -3
- package/dist/stories/receipts/receipt/ReceiptDetails.stories.d.ts +1 -0
- package/dist/stories/receipts/receipt/ReceiptDetails.stories.js +1 -0
- package/package.json +1 -1
- package/src/assets/locales/en/index.json +1 -1
- package/src/components/receipts/receipt/PdfButton.tsx +1 -1
- package/src/components/receipts/receipt/ReceiptDetails.tsx +10 -2
- package/src/stories/receipts/receipt/ReceiptDetails.stories.tsx +1 -0
|
@@ -834,7 +834,7 @@
|
|
|
834
834
|
"totalReceipts": "Total Receipts Received",
|
|
835
835
|
"totalItems": "Total Items Identified",
|
|
836
836
|
"totalItemsAdded": "Total Items Added",
|
|
837
|
-
"viewPdf": "View receipt
|
|
837
|
+
"viewPdf": "View receipt File",
|
|
838
838
|
"whereItsAt": "Where it's at"
|
|
839
839
|
},
|
|
840
840
|
"registration": {
|
|
@@ -3,5 +3,7 @@ import { t } from 'i18next';
|
|
|
3
3
|
import { Text, Image, Flex } from '@chakra-ui/react';
|
|
4
4
|
import { PdfIcon } from '../../../assets/images';
|
|
5
5
|
export const PdfButton = ({ onClick }) => {
|
|
6
|
-
return (_jsxs(Flex, { align: "center", gap: "base", as: "button", minW: "fit-content", bg: "neutral.white",
|
|
6
|
+
return (_jsxs(Flex, { align: "center", gap: "base", as: "button", minW: "fit-content", bg: "neutral.white",
|
|
7
|
+
// pr="base"
|
|
8
|
+
onClick: onClick, children: [_jsx(Text, { variant: "home", color: "blue.2", fontWeight: "medium", textTransform: "capitalize", children: t('receipts.viewPdf') }), _jsx(Image, { src: PdfIcon, h: "23px", w: "auto" })] }));
|
|
7
9
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReceiptDetailsDBI } from '../../../interfaces';
|
|
2
|
-
export declare const ReceiptDetails: ({ name, cashier, itemQuantity, paymentMethod, purchaseDate, tax, store, origin, storePhone, total, onEdit, }: Partial<ReceiptDetailsDBI> & {
|
|
2
|
+
export declare const ReceiptDetails: ({ name, cashier, itemQuantity, paymentMethod, purchaseDate, tax, store, origin, storePhone, total, onEdit, onFileClick }: Partial<ReceiptDetailsDBI> & {
|
|
3
3
|
onEdit?: () => void;
|
|
4
|
+
onFileClick?: () => void;
|
|
4
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Box, Divider, Flex, IconButton, Image, Text } from '@chakra-ui/react';
|
|
4
4
|
import { formatDate } from '../../../utils';
|
|
5
|
-
import { DetailsColumn, Edit } from '../..';
|
|
5
|
+
import { DetailsColumn, Edit, PdfButton } from '../..';
|
|
6
6
|
import { getReceiptOrigin } from '../../../helpers';
|
|
7
|
-
export const ReceiptDetails = ({ name, cashier = '', itemQuantity, paymentMethod, purchaseDate, tax, store, origin = "", storePhone = '', total, onEdit, }) => {
|
|
7
|
+
export const ReceiptDetails = ({ name, cashier = '', itemQuantity, paymentMethod, purchaseDate, tax, store, origin = "", storePhone = '', total, onEdit, onFileClick }) => {
|
|
8
8
|
const storeImage = getReceiptOrigin(origin);
|
|
9
9
|
const leftLabels = t('receipts.columnLeft').split(',');
|
|
10
10
|
const rightLabels = t('receipts.columnRight').split(',');
|
|
@@ -44,5 +44,5 @@ export const ReceiptDetails = ({ name, cashier = '', itemQuantity, paymentMethod
|
|
|
44
44
|
value: paymentMethod,
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
|
-
return (_jsxs(Box, { boxShadow: "md", minW: "108px", bg: "lightBlue.2", borderBottom: "1px solid", borderColor: "lightBlue.2", children: [onEdit && (_jsxs(Flex, { align: "center", justify: "space-between", p: "base", children: [_jsx(Text, { children: name }), _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, {}), onClick: onEdit })] })), _jsx(Box, { w: "100%", h: "10px", bg: "lightBlue.2", overflow: "hidden", position: "relative", children: _jsxs("svg", { width: "100%", height: "8", viewBox: "0 0 100 10", preserveAspectRatio: "none", style: { display: 'block', position: 'absolute', bottom: 0, left: 0 }, children: [_jsx("defs", { children: _jsx("pattern", { id: "triangle", width: "4", height: "10", patternUnits: "userSpaceOnUse", children: _jsx("polygon", { points: "0,10 2,0 4,10", fill: "white" }) }) }), _jsx("rect", { width: "100%", height: "10", fill: "url(#triangle)" })] }) }),
|
|
47
|
+
return (_jsxs(Box, { boxShadow: "md", minW: "108px", bg: "lightBlue.2", borderBottom: "1px solid", borderColor: "lightBlue.2", children: [onEdit && (_jsxs(Flex, { align: "center", justify: "space-between", p: "base", children: [_jsx(Text, { children: name }), _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, {}), onClick: onEdit })] })), _jsx(Box, { w: "100%", h: "10px", bg: "lightBlue.2", overflow: "hidden", position: "relative", children: _jsxs("svg", { width: "100%", height: "8", viewBox: "0 0 100 10", preserveAspectRatio: "none", style: { display: 'block', position: 'absolute', bottom: 0, left: 0 }, children: [_jsx("defs", { children: _jsx("pattern", { id: "triangle", width: "4", height: "10", patternUnits: "userSpaceOnUse", children: _jsx("polygon", { points: "0,10 2,0 4,10", fill: "white" }) }) }), _jsx("rect", { width: "100%", height: "10", fill: "url(#triangle)" })] }) }), _jsxs(Box, { bg: "neutral.white", px: "2", p: "base", children: [_jsxs(Flex, { align: "center", gap: "base", children: [_jsx(Image, { src: storeImage, w: "75px", h: "75px", fit: "cover" }), _jsxs(Flex, { align: "center", gap: "2", flex: "auto", children: [_jsx(DetailsColumn, { details: leftColumn }), _jsx(Divider, { orientation: "vertical", bg: "lightBlue.2", h: "63px", mr: "6" }), _jsx(DetailsColumn, { align: "right", details: rightColumn })] })] }), _jsx(Flex, { justifyContent: 'flex-end', pt: '.5rem', children: onFileClick && (_jsx(PdfButton, { onClick: onFileClick })) })] })] }));
|
|
48
48
|
};
|
package/package.json
CHANGED
|
@@ -834,7 +834,7 @@
|
|
|
834
834
|
"totalReceipts": "Total Receipts Received",
|
|
835
835
|
"totalItems": "Total Items Identified",
|
|
836
836
|
"totalItemsAdded": "Total Items Added",
|
|
837
|
-
"viewPdf": "View receipt
|
|
837
|
+
"viewPdf": "View receipt File",
|
|
838
838
|
"whereItsAt": "Where it's at"
|
|
839
839
|
},
|
|
840
840
|
"registration": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t } from 'i18next'
|
|
2
2
|
import { Box, Divider, Flex, IconButton, Image, Text } from '@chakra-ui/react'
|
|
3
3
|
import { formatDate } from '@/utils'
|
|
4
|
-
import { DetailsColumn, Edit } from '@/components'
|
|
4
|
+
import { DetailsColumn, Edit, PdfButton } from '@/components'
|
|
5
5
|
import { ColumnDetailsType, ReceiptDetailsDBI } from '@/interfaces'
|
|
6
6
|
import { getReceiptOrigin } from '@/helpers'
|
|
7
7
|
|
|
@@ -17,7 +17,8 @@ export const ReceiptDetails = ({
|
|
|
17
17
|
storePhone = '',
|
|
18
18
|
total,
|
|
19
19
|
onEdit,
|
|
20
|
-
|
|
20
|
+
onFileClick
|
|
21
|
+
}: Partial<ReceiptDetailsDBI> & { onEdit?: () => void, onFileClick?: () => void }) => {
|
|
21
22
|
const storeImage = getReceiptOrigin(origin)
|
|
22
23
|
const leftLabels = t('receipts.columnLeft').split(',')
|
|
23
24
|
const rightLabels = t('receipts.columnRight').split(',')
|
|
@@ -115,6 +116,13 @@ export const ReceiptDetails = ({
|
|
|
115
116
|
<DetailsColumn align="right" details={rightColumn} />
|
|
116
117
|
</Flex>
|
|
117
118
|
</Flex>
|
|
119
|
+
<Flex justifyContent={'flex-end'} pt={'.5rem'}>
|
|
120
|
+
{
|
|
121
|
+
onFileClick && (
|
|
122
|
+
<PdfButton onClick={onFileClick}/>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
</Flex>
|
|
118
126
|
</Box>
|
|
119
127
|
</Box>
|
|
120
128
|
)
|