@homefile/components-v2 2.24.25 → 2.24.26

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,16 +1,17 @@
1
1
  import { HomeDepot, Lowes, Walmart, DefaultReceipt } from '../../assets/images';
2
2
  export const receiptOrigins = {
3
- homeDepot: HomeDepot,
4
- HomeDepot: HomeDepot,
3
+ homedepot: HomeDepot,
5
4
  lowes: Lowes,
6
- Lowes: Lowes,
7
5
  walmart: Walmart,
8
- Walmart: Walmart,
9
6
  "": DefaultReceipt
10
7
  };
8
+ function normalize(input) {
9
+ return input.trim().toLowerCase().replace(/['\s]+/g, '');
10
+ }
11
11
  export const getReceiptOrigin = (key) => {
12
12
  var _a;
13
- return (_a = receiptOrigins[key]) !== null && _a !== void 0 ? _a : DefaultReceipt;
13
+ const normalizedKey = normalize(key);
14
+ return (_a = receiptOrigins[normalizedKey]) !== null && _a !== void 0 ? _a : DefaultReceipt;
14
15
  };
15
16
  export const receipts = [
16
17
  {
@@ -13,6 +13,7 @@ export declare const ReceiptDetailsComponent: {
13
13
  store: string;
14
14
  storePhone: string;
15
15
  name: string;
16
+ origin: string;
16
17
  total: string;
17
18
  onEdit: import("@storybook/addon-actions").HandlerFunction;
18
19
  onFileClick: () => void;
@@ -18,6 +18,7 @@ ReceiptDetailsComponent.args = {
18
18
  store: '8418',
19
19
  storePhone: '1234567890',
20
20
  name: 'Home Depot',
21
+ origin: "Home Depot",
21
22
  total: '41.65',
22
23
  onEdit: action('onEdit'),
23
24
  onFileClick: () => { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.24.25",
3
+ "version": "2.24.26",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -2,17 +2,19 @@ import { ReceiptCardItemI } from '@/interfaces'
2
2
  import { HomeDepot, Lowes, Walmart, DefaultReceipt } from '@/assets/images'
3
3
 
4
4
  export const receiptOrigins: Record<string, string> = {
5
- homeDepot: HomeDepot,
6
- HomeDepot: HomeDepot,
5
+ homedepot: HomeDepot,
7
6
  lowes: Lowes,
8
- Lowes: Lowes,
9
7
  walmart: Walmart,
10
- Walmart: Walmart,
11
8
  "" : DefaultReceipt
12
9
  }
13
10
 
11
+ function normalize(input: string) {
12
+ return input.trim().toLowerCase().replace(/['\s]+/g, '');
13
+ }
14
+
14
15
  export const getReceiptOrigin = (key: string): string => {
15
- return receiptOrigins[key] ?? DefaultReceipt;
16
+ const normalizedKey = normalize(key)
17
+ return receiptOrigins[normalizedKey] ?? DefaultReceipt;
16
18
  };
17
19
 
18
20
  export const receipts: ReceiptCardItemI[] = [
@@ -26,6 +26,7 @@ ReceiptDetailsComponent.args = {
26
26
  store: '8418',
27
27
  storePhone: '1234567890',
28
28
  name: 'Home Depot',
29
+ origin: "Home Depot",
29
30
  total: '41.65',
30
31
  onEdit: action('onEdit'),
31
32
  onFileClick: () => {}