@tap-payments/os-micro-frontend-shared 0.1.338-test.1 → 0.1.338-test.3
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,14 +1,22 @@
|
|
|
1
1
|
import { SelectionProps } from '../../../../types/index.js';
|
|
2
2
|
interface Item {
|
|
3
3
|
id: string;
|
|
4
|
-
|
|
5
|
-
quantity: number;
|
|
6
|
-
amount: number;
|
|
4
|
+
product_id: string;
|
|
7
5
|
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
image: string;
|
|
8
|
+
currency: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
quantity: number;
|
|
11
|
+
discount: {
|
|
12
|
+
type: string;
|
|
13
|
+
value: number;
|
|
14
|
+
};
|
|
15
|
+
merchant_id: string;
|
|
8
16
|
}
|
|
9
17
|
interface OrdersCellSheetProps {
|
|
10
18
|
selectionProps?: SelectionProps;
|
|
11
19
|
items: Item[];
|
|
12
20
|
}
|
|
13
|
-
export declare function OrdersCellSheet({ items, selectionProps }: OrdersCellSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function OrdersCellSheet({ items, selectionProps }: OrdersCellSheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
22
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import StatusChip from '../../../StatusChip';
|
|
3
|
-
import StatusChipWithCopy from '../../../StatusChipWithCopy';
|
|
4
|
-
import Text from '../../../Text';
|
|
5
|
-
import { Popover } from '@mui/material';
|
|
6
|
-
import Box from '@mui/material/Box';
|
|
7
2
|
import { useCallback, useState } from 'react';
|
|
3
|
+
import Popover from '@mui/material/Popover';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import { StatusChip, StatusChipWithCopy, Text } from '../../../index.js';
|
|
8
6
|
export function OrdersCellSheet({ items, selectionProps = {} }) {
|
|
9
7
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
10
8
|
const open = Boolean(anchorEl);
|
|
9
|
+
const orderLabel = useCallback((order) => `Qty ${(order === null || order === void 0 ? void 0 : order.quantity) || ''} ${(order === null || order === void 0 ? void 0 : order.name) || ''} - ${(order === null || order === void 0 ? void 0 : order.currency) || ''} ${(order === null || order === void 0 ? void 0 : order.amount) || ''}`, []);
|
|
10
|
+
if (!items || !items.length)
|
|
11
|
+
return null;
|
|
11
12
|
const [firstOrder, ...resetOrders] = items;
|
|
12
|
-
|
|
13
|
-
return (_jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '4px', alignItems: 'center' } }, { children: [_jsx(StatusChipWithCopy, Object.assign({ chipIndex: 0, selectionProps: selectionProps }, { children: _jsx(Text, Object.assign({ noWrap: true, sx: { maxWidth: 170, fontSize: 11 } }, { children: orderLabel(firstOrder) })) })), items.length > 1 && (_jsx(Box, Object.assign({ onClick: (e) => {
|
|
13
|
+
return (_jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '4px', alignItems: 'center' } }, { children: [_jsx(StatusChipWithCopy, Object.assign({ chipIndex: 0, selectionProps: selectionProps }, { children: _jsx(Text, Object.assign({ noWrap: true, sx: { maxWidth: 190, fontSize: 11 } }, { children: orderLabel(firstOrder) })) })), items.length > 1 && (_jsx(Box, Object.assign({ onClick: (e) => {
|
|
14
14
|
setAnchorEl(e.currentTarget.parentElement);
|
|
15
15
|
}, sx: { height: '18px' } }, { children: _jsx(StatusChip, Object.assign({ minWidth: "25", sx: { borderRadius: '24px', overflow: 'hidden' }, copyText: "..." }, { children: "..." })) }))), _jsx(Popover, Object.assign({ open: open, anchorEl: anchorEl, sx: { minWidth: anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth }, onClose: () => {
|
|
16
16
|
setAnchorEl(null);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.338-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.338-test.3",
|
|
5
|
+
"testVersion": 3,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|