@tap-payments/os-micro-frontend-shared 0.0.194 → 0.0.195
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/build/components/StatusGroupChips/StatusGroupChips.d.ts +3 -0
- package/build/components/StatusGroupChips/StatusGroupChips.js +26 -0
- package/build/components/StatusGroupChips/index.d.ts +2 -0
- package/build/components/StatusGroupChips/index.js +1 -0
- package/build/components/StatusGroupChips/type.d.ts +21 -0
- package/build/components/StatusGroupChips/type.js +1 -0
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +26 -8
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { StatusGroupChipsProps } from './type';
|
|
2
|
+
declare const StatusGroupChips: ({ chips, containerSx, gap, direction, alignItems, defaultChipSx, ...containerProps }: StatusGroupChipsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export default StatusGroupChips;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Box } from '@mui/material';
|
|
14
|
+
import StatusChip from '../StatusChip';
|
|
15
|
+
const StatusGroupChips = (_a) => {
|
|
16
|
+
var { chips, containerSx, gap = '4px', direction = 'row', alignItems = 'center', defaultChipSx } = _a, containerProps = __rest(_a, ["chips", "containerSx", "gap", "direction", "alignItems", "defaultChipSx"]);
|
|
17
|
+
if (!chips || chips.length === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(Box, Object.assign({ sx: Object.assign({ display: 'flex', gap,
|
|
21
|
+
alignItems, flexDirection: direction }, containerSx) }, containerProps, { children: chips.map((_a) => {
|
|
22
|
+
var { key, content, sx } = _a, chipProps = __rest(_a, ["key", "content", "sx"]);
|
|
23
|
+
return (_jsx(StatusChip, Object.assign({ sx: Object.assign(Object.assign({ padding: '0.75px 12px', maxWidth: '120px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', display: 'flex', alignItems: 'center', gap: '4px' }, defaultChipSx), sx) }, chipProps, { children: content }), key));
|
|
24
|
+
}) })));
|
|
25
|
+
};
|
|
26
|
+
export default StatusGroupChips;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StatusGroupChips } from './StatusGroupChips';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { BoxProps } from '@mui/material';
|
|
3
|
+
export interface ChipConfig {
|
|
4
|
+
key: string;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
sx?: object;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
bgColor?: string;
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
padding?: string;
|
|
12
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface StatusGroupChipsProps extends Omit<BoxProps, 'children'> {
|
|
15
|
+
chips: ChipConfig[];
|
|
16
|
+
containerSx?: object;
|
|
17
|
+
gap?: string | number;
|
|
18
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
19
|
+
alignItems?: 'center' | 'flex-start' | 'flex-end' | 'stretch' | 'baseline';
|
|
20
|
+
defaultChipSx?: object;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,28 +9,46 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import Tooltip from '../../../Tooltip';
|
|
14
14
|
import { destinationSolidIcon } from '../../../../constants/index.js';
|
|
15
15
|
import { formatAmount } from '../../../../utils/index.js';
|
|
16
16
|
import { DestinationCellContainer, DestinationCount, StyledDestinationCell, StyledDestinationIcon } from './styled';
|
|
17
17
|
import TableCell from '../../TableCell';
|
|
18
18
|
import { TextLabel } from '../style';
|
|
19
|
-
import { CurrencyIcon } from '../../../index.js';
|
|
19
|
+
import { CurrencyIcon, StatusGroupChips } from '../../../index.js';
|
|
20
20
|
function DestinationCell(_a) {
|
|
21
|
-
var _b, _c, _d, _e, _f;
|
|
21
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
22
22
|
var { destinationsCount, destinationsTooltip, isTextShown, destination, destinationsAmount, hidden, iconDirection, tableMode } = _a, props = __rest(_a, ["destinationsCount", "destinationsTooltip", "isTextShown", "destination", "destinationsAmount", "hidden", "iconDirection", "tableMode"]);
|
|
23
|
-
if (!destinationsCount || hidden) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
23
|
const destinations = (destination === null || destination === void 0 ? void 0 : destination.destination) || [];
|
|
27
24
|
const formattedAmount = formatAmount(destinationsAmount || 0);
|
|
28
25
|
const firstDestinationFormattedAmount = formatAmount(((_b = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _b === void 0 ? void 0 : _b.amount) || 0);
|
|
26
|
+
if (!destinationsCount || hidden) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (tableMode === 'sheet') {
|
|
30
|
+
const sheetViewChips = [
|
|
31
|
+
{
|
|
32
|
+
key: 'id',
|
|
33
|
+
content: (_c = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _c === void 0 ? void 0 : _c.id,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'amount',
|
|
37
|
+
content: (_jsxs(_Fragment, { children: [_jsx(CurrencyIcon, { currency: (_d = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _d === void 0 ? void 0 : _d.currency }), (destinationsCount || 0) > 1
|
|
38
|
+
? `${firstDestinationFormattedAmount.integerAmount}.${firstDestinationFormattedAmount.decimalAmount} +${(destinationsCount || 0) - 1}`
|
|
39
|
+
: `${formattedAmount.integerAmount}.${formattedAmount.decimalAmount}`] })),
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
return (_jsx(TableCell, Object.assign({ sx: {
|
|
43
|
+
width: 'fit-content',
|
|
44
|
+
overflow: 'visible',
|
|
45
|
+
} }, props, { children: _jsx(StatusGroupChips, { chips: sheetViewChips }) })));
|
|
46
|
+
}
|
|
29
47
|
const textView = (_jsx(TextLabel, Object.assign({ sx: {
|
|
30
48
|
textAlign: 'left',
|
|
31
49
|
justifyContent: 'flex-start',
|
|
32
|
-
height:
|
|
33
|
-
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (
|
|
50
|
+
height: 'auto',
|
|
51
|
+
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (_e = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _e === void 0 ? void 0 : _e.id, " - ", _jsx(CurrencyIcon, { currency: (_f = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _f === void 0 ? void 0 : _f.currency }), ' ', firstDestinationFormattedAmount.integerAmount, ".", firstDestinationFormattedAmount.decimalAmount, " +", destinationsCount - 1] })) : (_jsxs("div", { children: ["Destination ", (_g = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _g === void 0 ? void 0 : _g.id, " - ", _jsx(CurrencyIcon, { currency: (_h = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _h === void 0 ? void 0 : _h.currency }), " ", formattedAmount.integerAmount, ".", formattedAmount.decimalAmount] })) })));
|
|
34
52
|
return (_jsx(TableCell, Object.assign({ sx: {
|
|
35
53
|
width: 'fit-content',
|
|
36
54
|
overflow: 'visible',
|
|
@@ -90,6 +90,7 @@ export { default as Error } from './Error';
|
|
|
90
90
|
export { default as StatusBar } from './StatusBar';
|
|
91
91
|
export { default as MultiSelectStatusButton, type CurrencyOption, type MultiSelectStatusButtonProps } from './MultiSelectStatusButton';
|
|
92
92
|
export * from './Chip';
|
|
93
|
+
export * from './StatusGroupChips';
|
|
93
94
|
export * from './TableHeader';
|
|
94
95
|
export { default as RangeCalender } from './RangeCalender';
|
|
95
96
|
export { default as AppServices } from './AppServices';
|
|
@@ -90,6 +90,7 @@ export { default as Error } from './Error';
|
|
|
90
90
|
export { default as StatusBar } from './StatusBar';
|
|
91
91
|
export { default as MultiSelectStatusButton } from './MultiSelectStatusButton';
|
|
92
92
|
export * from './Chip';
|
|
93
|
+
export * from './StatusGroupChips';
|
|
93
94
|
export * from './TableHeader';
|
|
94
95
|
export { default as RangeCalender } from './RangeCalender';
|
|
95
96
|
export { default as AppServices } from './AppServices';
|
package/package.json
CHANGED