@homefile/components-v2 2.24.13 → 2.24.15

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,2 +1,2 @@
1
1
  import { ReceiptI } from '../../../interfaces';
2
- export declare const GridReceipt: ({ assignStatus, _id, itemQuantity, menuItems, onClick, purchaseDate, receiptOrigin, total, }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const GridReceipt: ({ assignStatus, _id, itemQuantity, menuItems, onClick, purchaseDate, receiptOrigin, total, name }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ import { ReceiptBg } from '../../../assets/images';
5
5
  import { IconMenu, MoreHorizontal, TextBadge } from '../..';
6
6
  import { receiptOrigins } from '../../../helpers';
7
7
  import { formatDateTime } from '../../../utils';
8
- export const GridReceipt = ({ assignStatus = 'unfiled', _id, itemQuantity, menuItems, onClick, purchaseDate, receiptOrigin = 'homeDepot', total, }) => {
8
+ export const GridReceipt = ({ assignStatus = 'unfiled', _id, itemQuantity, menuItems, onClick, purchaseDate, receiptOrigin = 'homeDepot', total, name }) => {
9
9
  const storeImage = receiptOrigins[receiptOrigin];
10
10
  const handleClick = () => onClick(_id);
11
11
  const { formattedDate: date, formattedTime: time } = formatDateTime({
@@ -29,5 +29,5 @@ export const GridReceipt = ({ assignStatus = 'unfiled', _id, itemQuantity, menuI
29
29
  },
30
30
  };
31
31
  const { bgColor, text, width } = assignStatusMap[assignStatus];
32
- return (_jsx(ButtonGroup, { transition: "all 200ms linear", _hover: { boxShadow: 'xl' }, children: _jsxs(Box, { boxShadow: "md", minW: ['91px', '108px'], position: "relative", children: [!!bgColor && (_jsx(Box, { position: "absolute", top: "-5px", left: "0", children: _jsx(TextBadge, { bgColor: bgColor, text: text, width: width }) })), _jsx(Box, { bgImg: ReceiptBg, bgRepeat: "repeat-x", w: "100%", h: "10px" }), _jsxs(Stack, { spacing: "1", h: "fit-content", bg: "neutral.white", px: "2", pb: "2", align: "end", children: [_jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 26 }), menuItems: menuItems, disabled: (menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) === 0, itemForm: _id }), _jsxs(Stack, { as: "button", onClick: handleClick, spacing: "6", align: "end", w: "100%", children: [_jsxs(Flex, { justify: "space-between", align: "start", gap: "1", w: "100%", children: [_jsx(Img, { alt: "logo", src: storeImage, boxSize: ['20px', '30px'] }), _jsxs(Stack, { align: "end", spacing: "0", children: [_jsx(Text, { fontSize: "xxs", lineHeight: "1.1", children: date }), _jsx(Text, { fontSize: "xxs", lineHeight: "1.1", children: time })] })] }), _jsxs(Stack, { align: "end", spacing: "0", children: [_jsx(Text, { fontSize: "xs", fontFamily: "secondary", children: `${itemQuantity} ${t('receipts.items')}` }), _jsx(Text, { children: total })] })] })] })] }) }));
32
+ return (_jsx(ButtonGroup, { transition: "all 200ms linear", _hover: { boxShadow: 'xl' }, children: _jsxs(Box, { boxShadow: "md", minW: ['91px', '108px'], position: "relative", children: [!!bgColor && (_jsx(Box, { position: "absolute", top: "-5px", left: "0", children: _jsx(TextBadge, { bgColor: bgColor, text: text, width: width }) })), _jsx(Box, { bgImg: ReceiptBg, bgRepeat: "repeat-x", w: "100%", h: "10px" }), _jsxs(Stack, { spacing: "1", h: "fit-content", bg: "neutral.white", px: "2", pb: "2", align: "end", children: [_jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 26 }), menuItems: menuItems, disabled: (menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) === 0, itemForm: _id }), _jsxs(Stack, { as: "button", onClick: handleClick, spacing: "4", align: "end", w: "100%", children: [_jsx(Flex, { width: "100%", children: _jsx(Text, { isTruncated: true, maxW: "5.5rem", fontSize: "xxs", lineHeight: "1.1", children: !name || name === "" ? t('receipts.receipts') : name }) }), _jsxs(Flex, { justify: "space-between", align: "start", gap: "1", w: "100%", children: [_jsx(Img, { alt: "logo", src: storeImage, boxSize: ['20px', '30px'] }), _jsxs(Stack, { align: "end", spacing: "0", children: [_jsx(Text, { fontSize: "xxs", lineHeight: "1.1", textAlign: 'left', children: date }), _jsx(Text, { fontSize: "xxs", lineHeight: "1.1", children: time })] })] }), _jsxs(Stack, { align: "end", spacing: "0", children: [_jsx(Text, { fontSize: "xs", fontFamily: "secondary", children: `${itemQuantity} ${t('receipts.items')}` }), _jsx(Text, { children: total })] })] })] })] }) }));
33
33
  };
@@ -1,2 +1,2 @@
1
1
  import { ReceiptI } from '../../../interfaces';
2
- export declare const ListReceipt: ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, receiptOrigin, }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ListReceipt: ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, receiptOrigin, name }: ReceiptI) => import("react/jsx-runtime").JSX.Element;
@@ -4,11 +4,11 @@ import { Box, Flex, Img, Stack, Text } from '@chakra-ui/react';
4
4
  import { IconMenu, MoreHorizontal } from '../..';
5
5
  import { receiptOrigins } from '../../../helpers';
6
6
  import { formatDateTime } from '../../../utils';
7
- export const ListReceipt = ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, receiptOrigin = 'homeDepot', }) => {
7
+ export const ListReceipt = ({ menuItems, onClick, _id, total, store, itemQuantity, purchaseDate, receiptOrigin = 'homeDepot', name }) => {
8
8
  const storeImage = receiptOrigins[receiptOrigin];
9
9
  const handleClick = () => onClick(_id);
10
10
  const { formattedDate: date, formattedTime: time } = formatDateTime({
11
11
  date: purchaseDate,
12
12
  });
13
- return (_jsx(Box, { bg: "neutral.white", w: "100%", transition: "all 0.2s ease-in-out", _hover: { bg: 'lightGreen.1' }, children: _jsxs(Flex, { align: "center", p: "2", children: [_jsxs(Flex, { gap: "base", flex: "auto", as: "button", onClick: handleClick, align: "center", children: [_jsx(Img, { alt: "logo", src: storeImage, boxSize: "36px" }), _jsxs(Box, { children: [store && (_jsx(Text, { variant: "date", textTransform: "uppercase", textAlign: "left", children: store })), _jsx(Text, { textOverflow: "ellipsis", noOfLines: 1, fontSize: "sm", textAlign: "left", children: t('receipts.receipts') })] })] }), _jsxs(Flex, { align: "center", gap: "base", children: [_jsx(Box, { children: _jsx(Text, { fontSize: "xs", fontFamily: "secondary", children: `${itemQuantity} ${t('receipts.items')}` }) }), _jsxs(Flex, { align: "start", gap: "2", mt: "-1", children: [_jsxs(Stack, { align: "flex-end", mt: "1", spacing: "0", children: [_jsx(Text, { variant: "date", textAlign: "right", children: `${date} ${time}` }), _jsx(Text, { children: total })] }), _jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 26 }), menuItems: menuItems, disabled: (menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) === 0, itemForm: _id })] })] })] }) }));
13
+ return (_jsx(Box, { bg: "neutral.white", w: "100%", transition: "all 0.2s ease-in-out", _hover: { bg: 'lightGreen.1' }, children: _jsxs(Flex, { align: "center", p: "2", children: [_jsxs(Flex, { gap: "base", flex: "auto", as: "button", onClick: handleClick, align: "center", children: [_jsx(Img, { alt: "logo", src: storeImage, boxSize: "36px" }), _jsxs(Box, { children: [store && (_jsx(Text, { variant: "date", textTransform: "uppercase", textAlign: "left", children: store })), _jsx(Text, { textOverflow: "ellipsis", noOfLines: 1, fontSize: "sm", textAlign: "left", children: !name || name === "" ? t('receipts.receipts') : name })] })] }), _jsxs(Flex, { align: "center", gap: "base", children: [_jsx(Box, { children: _jsx(Text, { fontSize: "xs", fontFamily: "secondary", children: `${itemQuantity} ${t('receipts.items')}` }) }), _jsxs(Flex, { align: "start", gap: "2", mt: "-1", children: [_jsxs(Stack, { align: "flex-end", mt: "1", spacing: "0", children: [_jsx(Text, { variant: "date", textAlign: "right", children: `${date} ${time}` }), _jsx(Text, { children: total })] }), _jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 26 }), menuItems: menuItems, disabled: (menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) === 0, itemForm: _id })] })] })] }) }));
14
14
  };
@@ -10,6 +10,6 @@ export const ReceiptItems = ({ isSelectDisabled = true, leftOptions = [], onItem
10
10
  });
11
11
  return (_jsxs(Box, { mb: "10rem", children: [_jsxs(Stack, { bg: "lightBlue.2", px: "4", pb: "base", pt: "2", children: [_jsx(Text, { textTransform: "uppercase", variant: "home", children: title }), _jsxs(Flex, { gap: "base", align: "center", children: [_jsx(Checkbox, { onChange: handleSelectAll }), _jsx(DoubleSelects, { isSelectDisabled: isSelectDisabled, leftOptions: leftOptions, rightOptions: rightOptions, onLeftSelectChange: onLeftSelectChange, onRightSelectChange: onRightSelectChange })] })] }), receipts.map((receipt) => {
12
12
  const hasRoomType = !!(receipt === null || receipt === void 0 ? void 0 : receipt.roomType);
13
- return (_jsxs(Box, { children: [!hasRoomType && (_jsx(ReceiptItem, Object.assign({ onChange: () => handleItemSelect(receipt._id), isChecked: isItemSelected(receipt._id), onSelectedChange: onReceiptSelectedChange, onEditClick: () => onEditReceipt === null || onEditReceipt === void 0 ? void 0 : onEditReceipt(receipt.sku), selectItems: receiptOptions, variant: variant }, receipt))), hasRoomType && (_jsx(ReceiptItemAssigned, Object.assign({ onChange: () => handleItemSelect(receipt._id), onRoomClick: onRoomClick, isChecked: isItemSelected(receipt._id), onSelectedChange: onReceiptSelectedChange, initialSelectValue: receiptOptions === null || receiptOptions === void 0 ? void 0 : receiptOptions[1], selectItems: receiptOptions, variant: variant }, receipt)))] }, receipt._id));
13
+ return (_jsxs(Box, { children: [!hasRoomType && (_jsx(ReceiptItem, Object.assign({ onChange: () => handleItemSelect(receipt._id), isChecked: isItemSelected(receipt._id), onSelectedChange: onReceiptSelectedChange, onEditClick: () => onEditReceipt === null || onEditReceipt === void 0 ? void 0 : onEditReceipt(receipt._id), selectItems: receiptOptions, variant: variant }, receipt))), hasRoomType && (_jsx(ReceiptItemAssigned, Object.assign({ onChange: () => handleItemSelect(receipt._id), onRoomClick: onRoomClick, isChecked: isItemSelected(receipt._id), onSelectedChange: onReceiptSelectedChange, initialSelectValue: receiptOptions === null || receiptOptions === void 0 ? void 0 : receiptOptions[1], selectItems: receiptOptions, variant: variant }, receipt)))] }, receipt._id));
14
14
  })] }));
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.24.13",
3
+ "version": "2.24.15",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -15,6 +15,7 @@ export const GridReceipt = ({
15
15
  purchaseDate,
16
16
  receiptOrigin = 'homeDepot',
17
17
  total,
18
+ name
18
19
  }: ReceiptI) => {
19
20
  const storeImage = receiptOrigins[receiptOrigin]
20
21
 
@@ -70,14 +71,19 @@ export const GridReceipt = ({
70
71
  <Stack
71
72
  as="button"
72
73
  onClick={handleClick}
73
- spacing="6"
74
+ spacing="4"
74
75
  align="end"
75
76
  w="100%"
76
77
  >
78
+ <Flex width={"100%"}>
79
+ <Text isTruncated maxW={"5.5rem"} fontSize="xxs" lineHeight="1.1">
80
+ {!name || name === "" ? t('receipts.receipts') : name}
81
+ </Text>
82
+ </Flex>
77
83
  <Flex justify="space-between" align="start" gap="1" w="100%">
78
84
  <Img alt="logo" src={storeImage} boxSize={['20px', '30px']} />
79
85
  <Stack align="end" spacing="0">
80
- <Text fontSize="xxs" lineHeight="1.1">
86
+ <Text fontSize="xxs" lineHeight="1.1" textAlign={'left'}>
81
87
  {date}
82
88
  </Text>
83
89
  <Text fontSize="xxs" lineHeight="1.1">
@@ -14,6 +14,7 @@ export const ListReceipt = ({
14
14
  itemQuantity,
15
15
  purchaseDate,
16
16
  receiptOrigin = 'homeDepot',
17
+ name
17
18
  }: ReceiptI) => {
18
19
  const storeImage = receiptOrigins[receiptOrigin]
19
20
  const handleClick = () => onClick(_id)
@@ -48,7 +49,7 @@ export const ListReceipt = ({
48
49
  fontSize="sm"
49
50
  textAlign="left"
50
51
  >
51
- {t('receipts.receipts')}
52
+ {!name || name === "" ? t('receipts.receipts') : name}
52
53
  </Text>
53
54
  </Box>
54
55
  </Flex>
@@ -51,7 +51,7 @@ export const ReceiptItems = ({
51
51
  onChange={() => handleItemSelect(receipt._id)}
52
52
  isChecked={isItemSelected(receipt._id)}
53
53
  onSelectedChange={onReceiptSelectedChange}
54
- onEditClick={() => onEditReceipt?.(receipt.sku)}
54
+ onEditClick={() => onEditReceipt?.(receipt._id)}
55
55
  selectItems={receiptOptions}
56
56
  variant={variant}
57
57
  {...receipt}