@tap-payments/os-micro-frontend-shared 0.1.37 → 0.1.38
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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/MaskedText/MaskedText.d.ts +1 -1
- package/build/components/MaskedText/MaskedText.js +3 -3
- package/build/components/MaskedText/type.d.ts +2 -1
- package/build/components/StatusChip/StatusChip.d.ts +1 -1
- package/build/components/StatusChip/StatusChip.js +26 -5
- package/build/components/StatusChip/style.d.ts +13 -3
- package/build/components/StatusChip/style.js +31 -36
- package/build/components/StatusChip/type.d.ts +2 -0
- package/build/components/StatusChipWithCopy/StatusChipWithCopy.d.ts +11 -0
- package/build/components/StatusChipWithCopy/StatusChipWithCopy.js +23 -0
- package/build/components/StatusChipWithCopy/index.d.ts +4 -0
- package/build/components/StatusChipWithCopy/index.js +4 -0
- package/build/components/StatusChipWithCopy/utils.d.ts +4 -0
- package/build/components/StatusChipWithCopy/utils.js +4 -0
- package/build/components/StatusGroupChips/style.d.ts +1 -13
- package/build/components/StatusGroupChips/style.js +2 -2
- package/build/components/StatusGroupChips/type.d.ts +3 -3
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +8 -11
- package/build/components/TableCells/CustomCells/type.d.ts +2 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +3 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.d.ts +2 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.js +19 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts +7 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js +5 -3
- package/build/components/VirtualTables/components/TableRow.d.ts +4 -2
- package/build/components/VirtualTables/components/TableRow.js +17 -5
- package/build/components/VirtualTables/components/virtualScroll/ListItemWrapper.js +1 -1
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +7 -7
- package/build/constants/table/cell/chargeTableCellWidth.js +7 -7
- package/build/types/table.d.ts +10 -0
- package/build/utils/style.d.ts +6 -0
- package/build/utils/style.js +1 -1
- package/package.json +134 -134
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MaskedTextProps } from './type';
|
|
2
|
-
declare const MaskedText: ({ text, startLength, endLength }: MaskedTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MaskedText: ({ text, startLength, endLength, chipIndex, copyText, selectionProps }: MaskedTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MaskedText;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import StatusChipWithCopy from '../StatusChipWithCopy';
|
|
3
3
|
import { passwordDotsIcon } from '../../constants/index.js';
|
|
4
|
-
const MaskedText = ({ text, startLength = 8, endLength = 4 }) => {
|
|
4
|
+
const MaskedText = ({ text, startLength = 8, endLength = 4, chipIndex, copyText, selectionProps }) => {
|
|
5
5
|
const startText = text.slice(0, startLength);
|
|
6
6
|
const endText = text.slice(text.length - endLength);
|
|
7
|
-
return (_jsxs(
|
|
7
|
+
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, copyText: copyText, selectionProps: selectionProps }, { children: [startText, _jsx("img", { src: passwordDotsIcon, alt: "passwordDots" }), endText] })));
|
|
8
8
|
};
|
|
9
9
|
export default MaskedText;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { StatusChipWithCopyProps } from '../StatusChipWithCopy';
|
|
3
|
+
export interface MaskedTextProps extends StatusChipWithCopyProps {
|
|
3
4
|
text: string;
|
|
4
5
|
startLength?: number;
|
|
5
6
|
endLength?: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChipProps } from './type';
|
|
2
|
-
declare const StatusChip: ({ children, unknownText, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const StatusChip: ({ children, unknownText, copyText, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default StatusChip;
|
|
@@ -9,16 +9,37 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useState } from 'react';
|
|
13
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
16
|
+
import { copyText as copyTextHandler } from '../../utils/index.js';
|
|
17
|
+
import { blueCopyIcon, greenCheckIcon } from '../../constants/index.js';
|
|
14
18
|
import { unknownGeographyColors } from './constants';
|
|
15
|
-
import { ChipStyled } from './style';
|
|
19
|
+
import { ChipStyled, Wrapper, CopyWrapper } from './style';
|
|
16
20
|
const StatusChip = (_a) => {
|
|
17
|
-
var { children, unknownText } = _a, props = __rest(_a, ["children", "unknownText"]);
|
|
21
|
+
var { children, unknownText, copyText } = _a, props = __rest(_a, ["children", "unknownText", "copyText"]);
|
|
22
|
+
const [showCopy, setShowCopy] = useState(false);
|
|
18
23
|
const { t } = useTranslation();
|
|
24
|
+
const isSelected = props.isSelected;
|
|
19
25
|
if (!children) {
|
|
20
|
-
return (_jsx(ChipStyled, Object.assign({}, unknownGeographyColors, props, { children: unknownText ? t(unknownText) : t('unknown') })));
|
|
26
|
+
return (_jsx(ChipStyled, Object.assign({}, unknownGeographyColors, props, { isSelected: false }, { children: unknownText ? t(unknownText) : t('unknown') })));
|
|
21
27
|
}
|
|
22
|
-
|
|
28
|
+
const handleCopy = (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
if (copyText) {
|
|
31
|
+
setShowCopy(true);
|
|
32
|
+
copyTextHandler(copyText);
|
|
33
|
+
const timer = setTimeout(() => {
|
|
34
|
+
setShowCopy(false);
|
|
35
|
+
}, 2000);
|
|
36
|
+
return () => {
|
|
37
|
+
clearTimeout(timer);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return (_jsxs(motion.div, Object.assign({ style: { position: 'relative' }, animate: { zIndex: isSelected ? 3 : 0 } }, { children: [_jsx(ChipStyled, Object.assign({}, props, { sx: { visibility: 'hidden', pointerEvents: 'none' } }, { children: _jsx(Wrapper, { children: children }) })), _jsx(ChipStyled, Object.assign({}, props, { isSelected: isSelected, style: { position: 'absolute', top: 0, left: 0, zIndex: isSelected ? 3 : 0 } }, { children: _jsxs(motion.div, Object.assign({ layout: "size", style: { display: 'flex', gap: '4px' }, animate: {
|
|
42
|
+
paddingRight: isSelected && copyText ? 12 : 0,
|
|
43
|
+
}, transition: { delay: !isSelected ? 0.2 : 0 } }, { children: [_jsx(Wrapper, { children: children }), _jsx(AnimatePresence, { children: isSelected && copyText && (_jsx(CopyWrapper, { children: _jsx(motion.img, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: handleCopy, src: showCopy ? greenCheckIcon : blueCopyIcon, style: Object.assign({ height: 12, width: 12, objectFit: 'contain' }, (showCopy && { filter: 'none' })) }) })) })] })) }))] })));
|
|
23
44
|
};
|
|
24
45
|
export default StatusChip;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
|
+
export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
3
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
5
|
textColor?: string | undefined;
|
|
6
6
|
bgColor?: string | undefined;
|
|
7
7
|
borderColor?: string | undefined;
|
|
@@ -9,8 +9,18 @@ export declare const ChipStyled: import("@emotion/styled").StyledComponent<impor
|
|
|
9
9
|
padding?: string | undefined;
|
|
10
10
|
unknownText?: string | undefined;
|
|
11
11
|
maxWidth?: string | undefined;
|
|
12
|
+
isSelected?: boolean | undefined;
|
|
13
|
+
copyText?: string | undefined;
|
|
12
14
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
15
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
14
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & {
|
|
16
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & {
|
|
15
17
|
children?: import("react").ReactNode;
|
|
18
|
+
} & {
|
|
19
|
+
isSelected?: boolean | undefined;
|
|
16
20
|
}, {}, {}>;
|
|
21
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
22
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
23
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
24
|
+
export declare const CopyWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
25
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
26
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,38 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 { Box, styled } from '@mui/material';
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import { SELECTION_COLORS } from '../../utils/index.js';
|
|
13
4
|
export const ChipStyled = styled(Box, {
|
|
14
|
-
shouldForwardProp: (prop) => !['textColor', 'bgColor', 'borderColor', 'disabled', 'padding', 'maxWidth'].includes(prop),
|
|
15
|
-
})((
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
padding: padding || '0px 9.5px',
|
|
24
|
-
borderRadius: '30px',
|
|
25
|
-
border: `1px solid ${borderColor}`,
|
|
26
|
-
backgroundColor: bgColor,
|
|
27
|
-
color: textColor,
|
|
28
|
-
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
29
|
-
opacity: disabled ? 0.5 : 1,
|
|
30
|
-
whiteSpace: 'nowrap',
|
|
31
|
-
fontSize: '11px',
|
|
32
|
-
minWidth: '67px',
|
|
33
|
-
maxWidth: maxWidth || 'none',
|
|
34
|
-
overflow: 'hidden',
|
|
35
|
-
textOverflow: maxWidth ? 'ellipsis' : 'unset',
|
|
36
|
-
boxSizing: 'border-box',
|
|
37
|
-
};
|
|
5
|
+
shouldForwardProp: (prop) => !['textColor', 'bgColor', 'borderColor', 'disabled', 'padding', 'maxWidth', 'isSelected'].includes(prop),
|
|
6
|
+
})(({ theme, isSelected, textColor = theme.palette.text.primary, bgColor = '#EFF1F2', borderColor = '#EFF1F2', disabled = false, padding, maxWidth, }) => {
|
|
7
|
+
return Object.assign({ display: 'flex', alignItems: 'center', gap: '4px', height: '18px', padding: padding || '0px 9.5px', borderRadius: '30px', border: `1px solid ${borderColor}`, backgroundColor: bgColor, color: textColor, cursor: disabled ? 'not-allowed' : 'pointer', opacity: disabled ? 0.5 : 1, whiteSpace: 'nowrap', fontSize: '11px', minWidth: '67px', maxWidth: maxWidth || 'none', width: 'fit-content', overflow: 'hidden', textOverflow: maxWidth ? 'ellipsis' : 'unset', boxSizing: 'border-box' }, (isSelected && {
|
|
8
|
+
color: SELECTION_COLORS.primary,
|
|
9
|
+
borderColor: SELECTION_COLORS.primary,
|
|
10
|
+
img: {
|
|
11
|
+
filter: 'brightness(0) saturate(100%) invert(44%) sepia(54%) saturate(1203%) hue-rotate(170deg) brightness(91%) contrast(84%)',
|
|
12
|
+
},
|
|
13
|
+
}));
|
|
38
14
|
});
|
|
15
|
+
export const Wrapper = styled(Box)(() => ({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
gap: '4px',
|
|
20
|
+
minWidth: 46,
|
|
21
|
+
textAlign: 'center',
|
|
22
|
+
}));
|
|
23
|
+
export const CopyWrapper = styled(Box)(() => ({
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
right: '8px',
|
|
26
|
+
top: 0,
|
|
27
|
+
height: '100%',
|
|
28
|
+
width: '12px',
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StatusChipProps } from '../StatusChip';
|
|
3
|
+
import { SelectionProps } from '../../types/index.js';
|
|
4
|
+
export interface StatusChipWithCopyProps extends StatusChipProps {
|
|
5
|
+
copyText?: string;
|
|
6
|
+
chipIndex: number;
|
|
7
|
+
selectionProps: SelectionProps;
|
|
8
|
+
}
|
|
9
|
+
declare function StatusChipWithCopy({ children, copyText, chipIndex, selectionProps: { onClick, rowIndex, colIndex, selectedId }, ...reset }: StatusChipWithCopyProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<typeof StatusChipWithCopy>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { memo, useMemo } from 'react';
|
|
14
|
+
import StatusChip from '../StatusChip';
|
|
15
|
+
import { checkIsSelected } from './utils';
|
|
16
|
+
function StatusChipWithCopy(_a) {
|
|
17
|
+
var { children, copyText, chipIndex, selectionProps: { onClick, rowIndex, colIndex, selectedId } } = _a, reset = __rest(_a, ["children", "copyText", "chipIndex", "selectionProps"]);
|
|
18
|
+
const isSelected = useMemo(() => checkIsSelected({ rowIndex, colIndex, selectedId, chipIndex }), [rowIndex, colIndex, selectedId, chipIndex]);
|
|
19
|
+
return (_jsx(StatusChip, Object.assign({}, reset, { copyText: copyText, onClick: (e) => {
|
|
20
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e, chipIndex);
|
|
21
|
+
}, isSelected: isSelected }, { children: children })));
|
|
22
|
+
}
|
|
23
|
+
export default memo(StatusChipWithCopy);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const checkIsSelected = ({ chipIndex, rowIndex, colIndex, selectedId, }) => {
|
|
2
|
+
const [, selectedRowIndex, selectedColumnIndex, selectedChipIndex] = (selectedId !== null && selectedId !== void 0 ? selectedId : '').split('-');
|
|
3
|
+
return Number(selectedRowIndex) === rowIndex && Number(selectedColumnIndex) === colIndex && Number(selectedChipIndex) === chipIndex;
|
|
4
|
+
};
|
|
@@ -2,16 +2,4 @@
|
|
|
2
2
|
export declare const StyledContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
3
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
4
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
-
export declare const StyledStatusChip: import("@emotion/styled").StyledComponent<{
|
|
6
|
-
textColor?: string | undefined;
|
|
7
|
-
bgColor?: string | undefined;
|
|
8
|
-
borderColor?: string | undefined;
|
|
9
|
-
disabled?: boolean | undefined;
|
|
10
|
-
padding?: string | undefined;
|
|
11
|
-
unknownText?: string | undefined;
|
|
12
|
-
maxWidth?: string | undefined;
|
|
13
|
-
} & import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
15
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & {
|
|
16
|
-
children?: import("react").ReactNode;
|
|
17
|
-
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
+
export declare const StyledStatusChip: import("@emotion/styled").StyledComponent<import("../StatusChipWithCopy").StatusChipWithCopyProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { styled, Box } from '@mui/material';
|
|
2
|
-
import
|
|
2
|
+
import StatusChipWithCopy from '../StatusChipWithCopy';
|
|
3
3
|
export const StyledContainer = styled(Box)(() => ({
|
|
4
4
|
display: 'flex',
|
|
5
5
|
gap: '4px',
|
|
6
6
|
alignItems: 'center',
|
|
7
7
|
flexDirection: 'row',
|
|
8
8
|
}));
|
|
9
|
-
export const StyledStatusChip = styled(
|
|
9
|
+
export const StyledStatusChip = styled(StatusChipWithCopy)(() => ({
|
|
10
10
|
padding: '0.75px 12px',
|
|
11
11
|
overflow: 'hidden',
|
|
12
12
|
textOverflow: 'ellipsis',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { BoxProps } from '@mui/material';
|
|
3
|
-
|
|
2
|
+
import type { BoxProps } from '@mui/material/Box';
|
|
3
|
+
import { StatusChipWithCopyProps } from '../StatusChipWithCopy';
|
|
4
|
+
export interface ChipConfig extends Omit<StatusChipWithCopyProps, 'content'> {
|
|
4
5
|
key: string;
|
|
5
6
|
content: React.ReactNode;
|
|
6
7
|
sx?: object;
|
|
7
|
-
onClick?: (event: React.MouseEvent) => void;
|
|
8
8
|
}
|
|
9
9
|
export interface StatusGroupChipsProps extends Omit<BoxProps, 'children'> {
|
|
10
10
|
chips: ChipConfig[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DestinationCellProps } from '../type';
|
|
2
|
-
declare function DestinationCell({ destinationsCount, destinationsTooltip, isTextShown, destination, destinationsAmount, hidden, iconDirection, tableMode, ...props }: DestinationCellProps): import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
declare function DestinationCell({ destinationsCount, destinationsTooltip, isTextShown, destination, destinationsAmount, hidden, iconDirection, tableMode, selectionProps, ...props }: DestinationCellProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default DestinationCell;
|
|
@@ -10,16 +10,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
13
14
|
import Tooltip from '../../../Tooltip';
|
|
14
15
|
import { destinationSolidIcon } from '../../../../constants/index.js';
|
|
15
16
|
import { formatAmount } from '../../../../utils/index.js';
|
|
16
17
|
import { DestinationCellContainer, DestinationCount, StyledDestinationCell, StyledDestinationIcon } from './styled';
|
|
17
|
-
import TableCell from '../../TableCell';
|
|
18
18
|
import { TextLabel } from '../style';
|
|
19
19
|
import { CurrencyIcon, StatusGroupChips } from '../../../index.js';
|
|
20
20
|
function DestinationCell(_a) {
|
|
21
21
|
var _b, _c, _d, _e, _f;
|
|
22
|
-
var { destinationsCount, destinationsTooltip, isTextShown, destination, destinationsAmount, hidden, iconDirection, tableMode } = _a, props = __rest(_a, ["destinationsCount", "destinationsTooltip", "isTextShown", "destination", "destinationsAmount", "hidden", "iconDirection", "tableMode"]);
|
|
22
|
+
var { destinationsCount, destinationsTooltip, isTextShown, destination, destinationsAmount, hidden, iconDirection, tableMode, selectionProps } = _a, props = __rest(_a, ["destinationsCount", "destinationsTooltip", "isTextShown", "destination", "destinationsAmount", "hidden", "iconDirection", "tableMode", "selectionProps"]);
|
|
23
23
|
const destinations = (destination === null || destination === void 0 ? void 0 : destination.destination) || [];
|
|
24
24
|
const formattedAmount = formatAmount(destinationsAmount || 0);
|
|
25
25
|
const firstDestinationFormattedAmount = formatAmount(((_b = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _b === void 0 ? void 0 : _b.amount) || 0);
|
|
@@ -30,12 +30,12 @@ function DestinationCell(_a) {
|
|
|
30
30
|
return {
|
|
31
31
|
key: `destination-${(dest === null || dest === void 0 ? void 0 : dest.id) || index}`,
|
|
32
32
|
content: (_jsxs(_Fragment, { children: [_jsxs("div", { children: [dest === null || dest === void 0 ? void 0 : dest.id, " |"] }), _jsx(CurrencyIcon, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] })),
|
|
33
|
+
chipIndex: index,
|
|
34
|
+
selectionProps,
|
|
35
|
+
copyText: `${formattedDestAmount.integerAmount}.${formattedDestAmount.decimalAmount}`,
|
|
33
36
|
};
|
|
34
|
-
}, []);
|
|
35
|
-
return (_jsx(
|
|
36
|
-
width: 'fit-content',
|
|
37
|
-
overflow: 'visible',
|
|
38
|
-
} }, props, { children: _jsx(StatusGroupChips, { chips: sheetViewChips }) })));
|
|
37
|
+
}, [selectionProps]);
|
|
38
|
+
return (_jsx(Box, Object.assign({}, props, { children: _jsx(StatusGroupChips, { chips: sheetViewChips }) })));
|
|
39
39
|
}
|
|
40
40
|
if (!destinationsCount || hidden) {
|
|
41
41
|
return null;
|
|
@@ -45,9 +45,6 @@ function DestinationCell(_a) {
|
|
|
45
45
|
justifyContent: 'flex-start',
|
|
46
46
|
height: 'auto',
|
|
47
47
|
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (_c = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _c === void 0 ? void 0 : _c.id, " - ", _jsx(CurrencyIcon, { currency: (_d = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _d === void 0 ? void 0 : _d.currency }), ' ', firstDestinationFormattedAmount.integerAmount, ".", firstDestinationFormattedAmount.decimalAmount, " +", 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 }), " ", formattedAmount.integerAmount, ".", formattedAmount.decimalAmount] })) })));
|
|
48
|
-
return (_jsx(
|
|
49
|
-
width: 'fit-content',
|
|
50
|
-
overflow: 'visible',
|
|
51
|
-
} }, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children: !isTextShown ? (_jsxs(StyledDestinationCell, Object.assign({ tableMode: tableMode }, { children: [_jsx(StyledDestinationIcon, { src: destinationSolidIcon, pointLeft: iconDirection === 'left' }), destinationsCount > 1 && (_jsx(DestinationCellContainer, Object.assign({ destinationsCount: 1 }, { children: _jsx(DestinationCount, { children: destinationsCount }) })))] }))) : (textView) })) })));
|
|
48
|
+
return (_jsx(Box, Object.assign({}, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children: !isTextShown ? (_jsxs(StyledDestinationCell, Object.assign({ tableMode: tableMode }, { children: [_jsx(StyledDestinationIcon, { src: destinationSolidIcon, pointLeft: iconDirection === 'left' }), destinationsCount > 1 && (_jsx(DestinationCellContainer, Object.assign({ destinationsCount: 1 }, { children: _jsx(DestinationCount, { children: destinationsCount }) })))] }))) : (textView) })) })));
|
|
52
49
|
}
|
|
53
50
|
export default DestinationCell;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { TableCellProps } from '@mui/material';
|
|
3
|
-
import type { Charge, TableMode } from '../../../types/index.js';
|
|
3
|
+
import type { Charge, TableMode, SelectionProps } from '../../../types/index.js';
|
|
4
4
|
import type { ActionType, FlagType } from './ActionCell';
|
|
5
5
|
import { getGeographyBoxColor } from '../../../utils/index.js';
|
|
6
6
|
export type GeographyBoxVariant = keyof ReturnType<typeof getGeographyBoxColor>;
|
|
@@ -91,6 +91,7 @@ export interface DestinationCellProps extends TableCellProps {
|
|
|
91
91
|
};
|
|
92
92
|
iconDirection?: 'left' | 'right';
|
|
93
93
|
tableMode?: TableMode;
|
|
94
|
+
selectionProps: SelectionProps;
|
|
94
95
|
}
|
|
95
96
|
export interface ActionCellProps extends TableCellProps {
|
|
96
97
|
row?: unknown;
|
|
@@ -7,7 +7,7 @@ import { SheetViewVirtualTableWrapper } from './style';
|
|
|
7
7
|
import { usePinnedColumns, useSynchronizedScroll, useTableState, useTableData, useVirtualTableContainer, usePinnedColumnsWidths } from './hooks';
|
|
8
8
|
import { PinnedColumn, MainTable, LoadingMainTable, NoDataView, VirtualTable } from './components';
|
|
9
9
|
function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, rowHeight = 28, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableTitle, dragControls, onColumnPin, clearBackdropVisibilityTimeout = 100, isPinnable = false, tableMode, }) {
|
|
10
|
-
const { selectedCell, selectedColumn, showBackDrop, setShowBackdrop, handleCellClick, handleColumnClick } = useTableState();
|
|
10
|
+
const { selectedCell, selectedColumn, showBackDrop, setShowBackdrop, handleCellClick, handleColumnClick, handleChipClick, selectedChip } = useTableState();
|
|
11
11
|
const { isError, tableLoading, tableError, tableEmpty, hasTimeoutError, showNoDataView, lastItemIndex, areTotalRowsNotFillingHeight, itemsCount, isDelayedFetchingNextPage, } = useTableData({
|
|
12
12
|
rows,
|
|
13
13
|
isLoading,
|
|
@@ -29,7 +29,9 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
|
|
|
29
29
|
isError,
|
|
30
30
|
selectedCell,
|
|
31
31
|
selectedColumn,
|
|
32
|
+
selectedChip,
|
|
32
33
|
handleCellClick,
|
|
34
|
+
handleChipClick,
|
|
33
35
|
});
|
|
34
36
|
const onPointerDown = (e) => {
|
|
35
37
|
dragControls === null || dragControls === void 0 ? void 0 : dragControls.start(e);
|
|
@@ -8,7 +8,9 @@ export declare const useTableState: () => {
|
|
|
8
8
|
selectedCell: string | null;
|
|
9
9
|
selectedColumn: string | null;
|
|
10
10
|
showBackDrop: boolean;
|
|
11
|
+
selectedChip: string | null;
|
|
11
12
|
setShowBackdrop: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
13
|
+
handleChipClick: (rowIndex: number, columnIndex: number, event: React.MouseEvent, chipIndex: number, pinnedType?: 'start' | 'end') => void;
|
|
12
14
|
handleCellClick: (rowIndex: number, columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
|
|
13
15
|
handleColumnClick: (columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
|
|
14
16
|
resetSelection: () => void;
|
|
@@ -2,28 +2,47 @@ import { useState, useCallback } from 'react';
|
|
|
2
2
|
export const useTableState = () => {
|
|
3
3
|
const [selectedCell, setSelectedCell] = useState(null);
|
|
4
4
|
const [selectedColumn, setSelectedColumn] = useState(null);
|
|
5
|
+
const [selectedChip, setSelectedChip] = useState(null);
|
|
5
6
|
const [showBackDrop, setShowBackdrop] = useState(false);
|
|
7
|
+
const handleChipClick = useCallback((rowIndex, columnIndex, event, chipIndex, pinnedType) => {
|
|
8
|
+
event.stopPropagation();
|
|
9
|
+
const chipKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${rowIndex}-${columnIndex}-${chipIndex}`;
|
|
10
|
+
const cellKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${rowIndex}-${columnIndex}`;
|
|
11
|
+
const isChipAlreadySelected = selectedChip === chipKey;
|
|
12
|
+
if (isChipAlreadySelected) {
|
|
13
|
+
setSelectedChip(null);
|
|
14
|
+
setSelectedCell(null);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setSelectedChip(chipKey);
|
|
18
|
+
setSelectedCell(cellKey);
|
|
19
|
+
}, [selectedChip, setSelectedChip, setSelectedCell]);
|
|
6
20
|
const handleCellClick = useCallback((rowIndex, columnIndex, event, pinnedType) => {
|
|
7
21
|
event.stopPropagation();
|
|
8
22
|
const cellKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${rowIndex}-${columnIndex}`;
|
|
9
23
|
setSelectedCell((prev) => (prev === cellKey ? null : cellKey));
|
|
10
24
|
setSelectedColumn(null);
|
|
25
|
+
setSelectedChip(null);
|
|
11
26
|
}, []);
|
|
12
27
|
const handleColumnClick = useCallback((columnIndex, event, pinnedType) => {
|
|
13
28
|
event.stopPropagation();
|
|
14
29
|
const columnKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${columnIndex}`;
|
|
15
30
|
setSelectedColumn((prev) => (prev === columnKey ? null : columnKey));
|
|
16
31
|
setSelectedCell(null);
|
|
32
|
+
setSelectedChip(null);
|
|
17
33
|
}, []);
|
|
18
34
|
const resetSelection = useCallback(() => {
|
|
19
35
|
setSelectedCell(null);
|
|
20
36
|
setSelectedColumn(null);
|
|
37
|
+
setSelectedChip(null);
|
|
21
38
|
}, []);
|
|
22
39
|
return {
|
|
23
40
|
selectedCell,
|
|
24
41
|
selectedColumn,
|
|
25
42
|
showBackDrop,
|
|
43
|
+
selectedChip,
|
|
26
44
|
setShowBackdrop,
|
|
45
|
+
handleChipClick,
|
|
27
46
|
handleCellClick,
|
|
28
47
|
handleColumnClick,
|
|
29
48
|
resetSelection,
|
package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { IColumnProps } from '../../../../types/index.js';
|
|
2
|
+
import type { IColumnProps, TableChipProps } from '../../../../types/index.js';
|
|
3
3
|
import type { TableRowProps } from '@mui/material/TableRow';
|
|
4
|
-
interface UseVirtualTableContainerProps<T = unknown> {
|
|
4
|
+
interface UseVirtualTableContainerProps<T = unknown> extends TableChipProps {
|
|
5
5
|
rowHeight: number;
|
|
6
6
|
areAllRowsLoaded?: boolean;
|
|
7
7
|
rows: T[];
|
|
@@ -16,9 +16,11 @@ interface UseVirtualTableContainerProps<T = unknown> {
|
|
|
16
16
|
isError: boolean;
|
|
17
17
|
selectedCell: string | null;
|
|
18
18
|
selectedColumn: string | null;
|
|
19
|
+
selectedChip: string | null;
|
|
19
20
|
handleCellClick: (rowIndex: number, columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
|
|
21
|
+
handleChipClick: (rowIndex: number, columnIndex: number, event: React.MouseEvent, chipIndex: number, pinnedType?: 'start' | 'end') => void;
|
|
20
22
|
}
|
|
21
|
-
export declare const useVirtualTableContainer: <T = unknown>({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, handleCellClick, }: UseVirtualTableContainerProps<T>) => {
|
|
23
|
+
export declare const useVirtualTableContainer: <T = unknown>({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, selectedChip, handleCellClick, handleChipClick, }: UseVirtualTableContainerProps<T>) => {
|
|
22
24
|
getItemSize: (index: number, height: number) => number;
|
|
23
25
|
getItemDataForContainer: (columnsData: IColumnProps[], isPinnedColumn: boolean, height: number) => {
|
|
24
26
|
columns: any;
|
|
@@ -36,7 +38,9 @@ export declare const useVirtualTableContainer: <T = unknown>({ rowHeight, areAll
|
|
|
36
38
|
isPinned: any;
|
|
37
39
|
selectedCell: any;
|
|
38
40
|
selectedColumn: any;
|
|
41
|
+
selectedChip: any;
|
|
39
42
|
onCellClick: any;
|
|
43
|
+
onChipClick: any;
|
|
40
44
|
containerHeight: any;
|
|
41
45
|
rowHeight: any;
|
|
42
46
|
};
|
package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
import memoize from 'memoize-one';
|
|
3
|
-
const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, isPinned, selectedCell, selectedColumn, onCellClick, containerHeight, rowHeight) => ({
|
|
3
|
+
const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, isPinned, selectedCell, selectedColumn, selectedChip, onCellClick, onChipClick, containerHeight, rowHeight) => ({
|
|
4
4
|
columns,
|
|
5
5
|
isLoading,
|
|
6
6
|
rows,
|
|
@@ -16,11 +16,13 @@ const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToInde
|
|
|
16
16
|
isPinned,
|
|
17
17
|
selectedCell,
|
|
18
18
|
selectedColumn,
|
|
19
|
+
selectedChip,
|
|
19
20
|
onCellClick,
|
|
21
|
+
onChipClick,
|
|
20
22
|
containerHeight,
|
|
21
23
|
rowHeight,
|
|
22
24
|
}));
|
|
23
|
-
export const useVirtualTableContainer = ({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, handleCellClick, }) => {
|
|
25
|
+
export const useVirtualTableContainer = ({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, selectedChip, handleCellClick, handleChipClick, }) => {
|
|
24
26
|
const getItemSize = useCallback((index, height) => {
|
|
25
27
|
const isLastRow = areAllRowsLoaded && index === rows.length;
|
|
26
28
|
if (isLastRow) {
|
|
@@ -44,7 +46,7 @@ export const useVirtualTableContainer = ({ rowHeight, areAllRowsLoaded, rows, is
|
|
|
44
46
|
areAllRowsLoaded,
|
|
45
47
|
];
|
|
46
48
|
}, [isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount, isError, areAllRowsLoaded]);
|
|
47
|
-
const commonItemDataSuffix = useMemo(() => [selectedCell, selectedColumn, handleCellClick], [selectedCell, selectedColumn, handleCellClick]);
|
|
49
|
+
const commonItemDataSuffix = useMemo(() => [selectedCell, selectedColumn, selectedChip, handleCellClick, handleChipClick], [selectedCell, selectedColumn, selectedChip, handleCellClick, handleChipClick]);
|
|
48
50
|
const getItemDataForContainer = useCallback((columnsData, isPinnedColumn, height) => createItemData(columnsData, ...commonItemDataParams, isPinnedColumn, ...commonItemDataSuffix, height, rowHeight), [commonItemDataParams, commonItemDataSuffix, rowHeight]);
|
|
49
51
|
return {
|
|
50
52
|
getItemSize,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
2
|
+
import { type TableRowProps } from '@mui/material';
|
|
3
3
|
import type { IColumnProps } from '../../../types/index.js';
|
|
4
4
|
interface ITableRowProps<R = any> {
|
|
5
5
|
row: R;
|
|
@@ -13,9 +13,11 @@ interface ITableRowProps<R = any> {
|
|
|
13
13
|
isSheetView?: boolean;
|
|
14
14
|
selectedCell?: string | null;
|
|
15
15
|
selectedColumn?: string | null;
|
|
16
|
+
selectedChip?: string | null;
|
|
16
17
|
onCellClick?: (rowIndex: number, columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
|
|
18
|
+
onChipClick?: (rowIndex: number, columnIndex: number, event: React.MouseEvent, chipIndex: number, pinnedType?: 'start' | 'end') => void;
|
|
17
19
|
isLastRow?: boolean;
|
|
18
20
|
}
|
|
19
|
-
declare function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell, selectedColumn, onCellClick, isLastRow, }: Readonly<ITableRowProps>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell, selectedColumn, selectedChip, onCellClick, isLastRow, onChipClick, }: Readonly<ITableRowProps>): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
declare const _default: import("react").MemoExoticComponent<typeof TableRow>;
|
|
21
23
|
export default _default;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { memo, useMemo } from 'react';
|
|
4
|
+
import { Box } from '@mui/material';
|
|
4
5
|
import { areEqual } from 'react-window';
|
|
5
6
|
import { StyledCell, StyledTableRow } from './style';
|
|
6
7
|
import { getSelectionStyles } from '../../../utils/index.js';
|
|
7
|
-
function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = null, selectedColumn = null, onCellClick, isLastRow = false, }) {
|
|
8
|
-
const renderCell = (column) => {
|
|
8
|
+
function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = null, selectedColumn = null, selectedChip = null, onCellClick, isLastRow = false, onChipClick, }) {
|
|
9
|
+
const renderCell = (column, rowIndex, colIndex) => {
|
|
9
10
|
const { render, format, selector } = column;
|
|
11
|
+
const handleChipClick = (event, chipIndex) => {
|
|
12
|
+
onChipClick === null || onChipClick === void 0 ? void 0 : onChipClick(rowIndex, colIndex, event, chipIndex, column.pinned);
|
|
13
|
+
};
|
|
10
14
|
if (!(column === null || column === void 0 ? void 0 : column.id) || !row)
|
|
11
15
|
return null;
|
|
12
16
|
const value = selector ? selector({ row, index, value: row[column === null || column === void 0 ? void 0 : column.id] }) : row[column === null || column === void 0 ? void 0 : column.id];
|
|
13
17
|
const formattedValue = format ? format({ value, row, index }) : value;
|
|
14
|
-
return render ? render({
|
|
18
|
+
return render ? (render({
|
|
19
|
+
row,
|
|
20
|
+
column,
|
|
21
|
+
index,
|
|
22
|
+
value: row[column === null || column === void 0 ? void 0 : column.id],
|
|
23
|
+
selectionProps: { onClick: handleChipClick, rowIndex, colIndex, selectedId: selectedChip },
|
|
24
|
+
})) : (_jsx(_Fragment, { children: formattedValue }));
|
|
15
25
|
};
|
|
16
26
|
const content = useMemo(() => (_jsx(_Fragment, { children: columns.map((column, colIndex) => {
|
|
17
27
|
var _a, _b;
|
|
@@ -34,8 +44,10 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
|
|
|
34
44
|
effectiveFirst = isFirstColumn && column.pinned !== 'start';
|
|
35
45
|
effectiveLast = isLastColumn && column.pinned !== 'end';
|
|
36
46
|
}
|
|
37
|
-
return (_jsx(StyledCell, Object.assign({ component: "div", "data-testid": "TableRow_TableCell", "data-column-id": column.id, "data-column-width": column.width, "data-column-width-used": column.width, "data-column-align": column.align, "data-column-order": column.order, "data-column-header": typeof column.header === 'string' ? column.header : 'component', "data-column-sortable": !!column.sortable, "data-column-filterable": !!column.filter, isFirst: effectiveFirst, isLast: effectiveLast, onClick: (event) =>
|
|
38
|
-
|
|
47
|
+
return (_jsx(StyledCell, Object.assign({ component: "div", "data-testid": "TableRow_TableCell", "data-column-id": column.id, "data-column-width": column.width, "data-column-width-used": column.width, "data-column-align": column.align, "data-column-order": column.order, "data-column-header": typeof column.header === 'string' ? column.header : 'component', "data-column-sortable": !!column.sortable, "data-column-filterable": !!column.filter, isFirst: effectiveFirst, isLast: effectiveLast, onClick: (event) => {
|
|
48
|
+
onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(index, colIndex, event, column.pinned);
|
|
49
|
+
}, sx: Object.assign(Object.assign({ width: column.width, minWidth: column.width, textAlign: column.align, justifyContent: column.align === 'right' ? 'flex-end' : 'flex-start', cursor: onCellClick ? 'pointer' : 'default' }, selectionStyles), column.cellStyle), isSheetView: isSheetView, isSelected: isCellSelected }, { children: _jsx(Box, Object.assign({ sx: { position: 'relative', zIndex: 1, width: '100%' } }, { children: renderCell(column, index, colIndex) })) }), `${column.id}-${colIndex}`));
|
|
50
|
+
}) })), [columns, row, index, selectedCell, selectedColumn, onCellClick, isLastRow, selectedChip, isSheetView]);
|
|
39
51
|
return (_createElement(StyledTableRow, Object.assign({ "data-testid": "TableRow", onClick: rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick, showShadowHighlight: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showShadowHighlight, showLoadedStyle: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showLoadedStyle, component: "article" }, rowProps, { key: index, isSheetView: isSheetView }), content));
|
|
40
52
|
}
|
|
41
53
|
export default memo(TableRow, areEqual);
|
|
@@ -57,7 +57,7 @@ function ListItemWrapper(_a) {
|
|
|
57
57
|
const row = rows[index];
|
|
58
58
|
const isLoadingRow = isLoading && index === lastItemIndex + 1;
|
|
59
59
|
const isLoadedRow = index <= newLoadedRowsEndIndex;
|
|
60
|
-
const rowClickHandler = React.useCallback(createRowClickHandler(row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick), [row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick]);
|
|
60
|
+
const rowClickHandler = React.useCallback(() => createRowClickHandler(row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick), [row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick]);
|
|
61
61
|
const memoizedRowProps = React.useMemo(() => (Object.assign(Object.assign({ showShadowHighlight: scrollToIndex === index, showLoadedStyle: isLoadedRow }, rowProps), { onClick: rowClickHandler })), [scrollToIndex, index, isLoadedRow, rowProps, rowClickHandler]);
|
|
62
62
|
const renderSheetViewLoadingRow = React.useCallback((lastRowContent) => {
|
|
63
63
|
return (_jsx(Box, Object.assign({ sx: {
|
|
@@ -98,6 +98,7 @@ export { default as ScrollLoader } from './ScrollLoader';
|
|
|
98
98
|
export * from './ScrollLoader';
|
|
99
99
|
export * from './TooltipChip';
|
|
100
100
|
export * from './RightLeftExpandingCenterChip';
|
|
101
|
+
export { default as StatusChipWithCopy } from './StatusChipWithCopy';
|
|
101
102
|
export * from './RadioButton';
|
|
102
103
|
export * from './RadioGroup';
|
|
103
104
|
export * from './LeftPeekRightExpandingChip';
|
|
@@ -98,6 +98,7 @@ export { default as ScrollLoader } from './ScrollLoader';
|
|
|
98
98
|
export * from './ScrollLoader';
|
|
99
99
|
export * from './TooltipChip';
|
|
100
100
|
export * from './RightLeftExpandingCenterChip';
|
|
101
|
+
export { default as StatusChipWithCopy } from './StatusChipWithCopy';
|
|
101
102
|
export * from './RadioButton';
|
|
102
103
|
export * from './RadioGroup';
|
|
103
104
|
export * from './LeftPeekRightExpandingChip';
|
|
@@ -528,3 +528,4 @@ export const deactivatedCircle = `${lightUrl}/deactivatedCircle.svg`;
|
|
|
528
528
|
export const exclamationOutlinedCircle = `${lightUrl}/exclamationOutlinedCircle.svg`;
|
|
529
529
|
export const outlinedCircle = `${lightUrl}/outlinedCircle.svg`;
|
|
530
530
|
export const greenCheck2ACE00 = `${lightUrl}/greenCheck2ACE00.svg`;
|
|
531
|
+
export const blueCopyIcon = `${lightUrl}/blueCopyIcon.svg`;
|
|
@@ -12,7 +12,7 @@ export declare const chargeTableCellWidth: {
|
|
|
12
12
|
readonly id: {
|
|
13
13
|
readonly default: "225px";
|
|
14
14
|
readonly text: "225px";
|
|
15
|
-
readonly sheet: "
|
|
15
|
+
readonly sheet: "245px";
|
|
16
16
|
};
|
|
17
17
|
readonly product: {
|
|
18
18
|
readonly default: "85px";
|
|
@@ -92,7 +92,7 @@ export declare const chargeTableCellWidth: {
|
|
|
92
92
|
readonly eci: {
|
|
93
93
|
readonly default: "150px";
|
|
94
94
|
readonly text: "150px";
|
|
95
|
-
readonly sheet: "
|
|
95
|
+
readonly sheet: "100px";
|
|
96
96
|
};
|
|
97
97
|
readonly amount: {
|
|
98
98
|
readonly default: "170px";
|
|
@@ -152,7 +152,7 @@ export declare const chargeTableCellWidth: {
|
|
|
152
152
|
readonly receipt: {
|
|
153
153
|
readonly default: "85px";
|
|
154
154
|
readonly text: "150px";
|
|
155
|
-
readonly sheet: "
|
|
155
|
+
readonly sheet: "165px";
|
|
156
156
|
};
|
|
157
157
|
readonly fees: {
|
|
158
158
|
readonly default: "150px";
|
|
@@ -162,7 +162,7 @@ export declare const chargeTableCellWidth: {
|
|
|
162
162
|
readonly metadata: {
|
|
163
163
|
readonly default: "180px";
|
|
164
164
|
readonly text: "180px";
|
|
165
|
-
readonly sheet: "
|
|
165
|
+
readonly sheet: "275px";
|
|
166
166
|
};
|
|
167
167
|
readonly settlement: {
|
|
168
168
|
readonly default: "200px";
|
|
@@ -187,7 +187,7 @@ export declare const chargeTableCellWidth: {
|
|
|
187
187
|
readonly card_number: {
|
|
188
188
|
readonly default: "120px";
|
|
189
189
|
readonly text: "120px";
|
|
190
|
-
readonly sheet: "
|
|
190
|
+
readonly sheet: "155px";
|
|
191
191
|
};
|
|
192
192
|
readonly auth_code: {
|
|
193
193
|
readonly default: "80px";
|
|
@@ -202,12 +202,12 @@ export declare const chargeTableCellWidth: {
|
|
|
202
202
|
readonly device: {
|
|
203
203
|
readonly default: "70px";
|
|
204
204
|
readonly text: "190px";
|
|
205
|
-
readonly sheet: "
|
|
205
|
+
readonly sheet: "235px";
|
|
206
206
|
};
|
|
207
207
|
readonly card_no: {
|
|
208
208
|
readonly default: "120px";
|
|
209
209
|
readonly text: "120px";
|
|
210
|
-
readonly sheet: "
|
|
210
|
+
readonly sheet: "200px";
|
|
211
211
|
};
|
|
212
212
|
readonly meta: {
|
|
213
213
|
readonly default: "52px";
|
|
@@ -12,7 +12,7 @@ export const chargeTableCellWidth = {
|
|
|
12
12
|
id: {
|
|
13
13
|
default: '225px',
|
|
14
14
|
text: '225px',
|
|
15
|
-
sheet: '
|
|
15
|
+
sheet: '245px',
|
|
16
16
|
},
|
|
17
17
|
product: {
|
|
18
18
|
default: '85px',
|
|
@@ -92,7 +92,7 @@ export const chargeTableCellWidth = {
|
|
|
92
92
|
eci: {
|
|
93
93
|
default: '150px',
|
|
94
94
|
text: '150px',
|
|
95
|
-
sheet: '
|
|
95
|
+
sheet: '100px',
|
|
96
96
|
},
|
|
97
97
|
amount: {
|
|
98
98
|
default: '170px',
|
|
@@ -152,7 +152,7 @@ export const chargeTableCellWidth = {
|
|
|
152
152
|
receipt: {
|
|
153
153
|
default: '85px',
|
|
154
154
|
text: '150px',
|
|
155
|
-
sheet: '
|
|
155
|
+
sheet: '165px',
|
|
156
156
|
},
|
|
157
157
|
fees: {
|
|
158
158
|
default: '150px',
|
|
@@ -162,7 +162,7 @@ export const chargeTableCellWidth = {
|
|
|
162
162
|
metadata: {
|
|
163
163
|
default: '180px',
|
|
164
164
|
text: '180px',
|
|
165
|
-
sheet: '
|
|
165
|
+
sheet: '275px',
|
|
166
166
|
},
|
|
167
167
|
settlement: {
|
|
168
168
|
default: '200px',
|
|
@@ -187,7 +187,7 @@ export const chargeTableCellWidth = {
|
|
|
187
187
|
card_number: {
|
|
188
188
|
default: '120px',
|
|
189
189
|
text: '120px',
|
|
190
|
-
sheet: '
|
|
190
|
+
sheet: '155px',
|
|
191
191
|
},
|
|
192
192
|
auth_code: {
|
|
193
193
|
default: '80px',
|
|
@@ -202,12 +202,12 @@ export const chargeTableCellWidth = {
|
|
|
202
202
|
device: {
|
|
203
203
|
default: '70px',
|
|
204
204
|
text: '190px',
|
|
205
|
-
sheet: '
|
|
205
|
+
sheet: '235px',
|
|
206
206
|
},
|
|
207
207
|
card_no: {
|
|
208
208
|
default: '120px',
|
|
209
209
|
text: '120px',
|
|
210
|
-
sheet: '
|
|
210
|
+
sheet: '200px',
|
|
211
211
|
},
|
|
212
212
|
meta: {
|
|
213
213
|
default: '52px',
|
package/build/types/table.d.ts
CHANGED
|
@@ -47,11 +47,21 @@ export interface TableFooterProps extends BoxProps {
|
|
|
47
47
|
maximized?: boolean;
|
|
48
48
|
children?: React.ReactNode;
|
|
49
49
|
}
|
|
50
|
+
export interface TableChipProps {
|
|
51
|
+
onChipClick?: (rowIndex: number, columnIndex: number, event: React.MouseEvent, chipIndex: number, pinnedType?: 'start' | 'end') => void;
|
|
52
|
+
}
|
|
53
|
+
export interface SelectionProps {
|
|
54
|
+
onClick?: (event: React.MouseEvent, index: number) => void;
|
|
55
|
+
colIndex?: number;
|
|
56
|
+
rowIndex?: number;
|
|
57
|
+
selectedId?: string | null;
|
|
58
|
+
}
|
|
50
59
|
export interface IRenderAttr<R, C> {
|
|
51
60
|
row: R;
|
|
52
61
|
column: C;
|
|
53
62
|
index: number;
|
|
54
63
|
value: any;
|
|
64
|
+
selectionProps?: SelectionProps;
|
|
55
65
|
}
|
|
56
66
|
export interface IFormatAttr<R> {
|
|
57
67
|
value: string | Record<string, any> | number;
|
package/build/utils/style.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export declare const SELECTION_COLORS: {
|
|
2
|
+
readonly primary: "#1F88D0";
|
|
3
|
+
readonly background: "white";
|
|
4
|
+
readonly border: "#F2F2F2";
|
|
5
|
+
readonly transparent: "transparent";
|
|
6
|
+
};
|
|
1
7
|
interface GetSelectionStylesParams {
|
|
2
8
|
isSelected: boolean;
|
|
3
9
|
isCellSelected: boolean;
|
package/build/utils/style.js
CHANGED
package/package.json
CHANGED
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
-
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"testVersion": 1,
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "build/index.js",
|
|
8
|
-
"module": "build/index.js",
|
|
9
|
-
"types": "build/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./build/index.d.ts",
|
|
13
|
-
"import": "./build/index.js",
|
|
14
|
-
"require": "./build/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./constants": {
|
|
17
|
-
"types": "./build/constants/index.d.ts",
|
|
18
|
-
"import": "./build/constants/index.js",
|
|
19
|
-
"require": "./build/constants/index.js"
|
|
20
|
-
},
|
|
21
|
-
"./components": {
|
|
22
|
-
"types": "./build/components/index.d.ts",
|
|
23
|
-
"import": "./build/components/index.js",
|
|
24
|
-
"require": "./build/components/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./components/*": {
|
|
27
|
-
"types": "./build/components/*/index.d.ts",
|
|
28
|
-
"import": "./build/components/*/index.js",
|
|
29
|
-
"require": "./build/components/*/index.js"
|
|
30
|
-
},
|
|
31
|
-
"./hooks": {
|
|
32
|
-
"types": "./build/hooks/index.d.ts",
|
|
33
|
-
"import": "./build/hooks/index.js",
|
|
34
|
-
"require": "./build/hooks/index.js"
|
|
35
|
-
},
|
|
36
|
-
"./utils": {
|
|
37
|
-
"types": "./build/utils/index.d.ts",
|
|
38
|
-
"import": "./build/utils/index.js",
|
|
39
|
-
"require": "./build/utils/index.js"
|
|
40
|
-
},
|
|
41
|
-
"./theme": {
|
|
42
|
-
"types": "./build/theme/index.d.ts",
|
|
43
|
-
"import": "./build/theme/index.js",
|
|
44
|
-
"require": "./build/theme/index.js"
|
|
45
|
-
},
|
|
46
|
-
"./types": {
|
|
47
|
-
"types": "./build/types/index.d.ts",
|
|
48
|
-
"import": "./build/types/index.js",
|
|
49
|
-
"require": "./build/types/index.js"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"license": "MIT",
|
|
53
|
-
"author": {
|
|
54
|
-
"name": "Ahmed Sharkawy",
|
|
55
|
-
"email": "a.elsharkawy@tap.company"
|
|
56
|
-
},
|
|
57
|
-
"files": [
|
|
58
|
-
"build",
|
|
59
|
-
"readme.md"
|
|
60
|
-
],
|
|
61
|
-
"scripts": {
|
|
62
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
63
|
-
"push": "npm run ts:build && npm publish --access public",
|
|
64
|
-
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
65
|
-
"dev": "vite",
|
|
66
|
-
"build": "tsc -b && vite build ",
|
|
67
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
68
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
69
|
-
"lint": "eslint . --color",
|
|
70
|
-
"lint:fix": "eslint src --fix --color",
|
|
71
|
-
"preview": "vite preview",
|
|
72
|
-
"prepare": "husky"
|
|
73
|
-
},
|
|
74
|
-
"dependencies": {
|
|
75
|
-
"@emotion/react": "^11.11.0",
|
|
76
|
-
"@emotion/styled": "^11.11.0",
|
|
77
|
-
"@hookform/resolvers": "^3.3.1",
|
|
78
|
-
"@mui/material": "^5.12.3",
|
|
79
|
-
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
80
|
-
"axios": "^1.4.0",
|
|
81
|
-
"dayjs": "^1.11.8",
|
|
82
|
-
"framer-motion": "10.11.0",
|
|
83
|
-
"i18next": "^22.4.15",
|
|
84
|
-
"memoize-one": "^6.0.0",
|
|
85
|
-
"re-resizable": "^6.9.9",
|
|
86
|
-
"react": "^18.2.0",
|
|
87
|
-
"react-currency-input-field": "^3.6.11",
|
|
88
|
-
"react-dom": "^18.2.0",
|
|
89
|
-
"react-draggable": "^4.4.6",
|
|
90
|
-
"react-dropzone": "^14.2.3",
|
|
91
|
-
"react-hook-form": "^7.45.4",
|
|
92
|
-
"react-hot-toast": "^2.4.1",
|
|
93
|
-
"react-i18next": "^12.2.2",
|
|
94
|
-
"react-multi-date-picker": "^4.1.2",
|
|
95
|
-
"react-router-dom": "^7.7.0",
|
|
96
|
-
"react-virtualized-auto-sizer": "^1.0.20",
|
|
97
|
-
"react-window": "^1.8.9",
|
|
98
|
-
"react-window-infinite-loader": "^1.0.9",
|
|
99
|
-
"react18-input-otp": "^1.1.4",
|
|
100
|
-
"recharts": "^2.15.1"
|
|
101
|
-
},
|
|
102
|
-
"devDependencies": {
|
|
103
|
-
"@eslint/js": "^9.17.0",
|
|
104
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
105
|
-
"@types/lodash": "^4.17.15",
|
|
106
|
-
"@types/react": "^18.2.6",
|
|
107
|
-
"@types/react-dom": "^18.3.5",
|
|
108
|
-
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
109
|
-
"@types/react-window": "^1.8.5",
|
|
110
|
-
"@types/react-window-infinite-loader": "^1.0.6",
|
|
111
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
112
|
-
"eslint": "^9.17.0",
|
|
113
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
114
|
-
"eslint-plugin-react-refresh": "^0.4.16",
|
|
115
|
-
"globals": "^15.14.0",
|
|
116
|
-
"husky": "^8.0.3",
|
|
117
|
-
"lint-staged": "^13.2.2",
|
|
118
|
-
"prettier": "^2.8.8",
|
|
119
|
-
"tsc-alias": "^1.8.16",
|
|
120
|
-
"typescript": "5.0.2",
|
|
121
|
-
"typescript-eslint": "^8.18.2",
|
|
122
|
-
"vite": "6.0.5",
|
|
123
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
124
|
-
},
|
|
125
|
-
"lint-staged": {
|
|
126
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
127
|
-
"yarn run prettier:fix",
|
|
128
|
-
"yarn run lint"
|
|
129
|
-
]
|
|
130
|
-
},
|
|
131
|
-
"publishConfig": {
|
|
132
|
-
"registry": "https://registry.npmjs.org/"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
+
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
+
"version": "0.1.38",
|
|
5
|
+
"testVersion": 1,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "build/index.js",
|
|
8
|
+
"module": "build/index.js",
|
|
9
|
+
"types": "build/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./build/index.d.ts",
|
|
13
|
+
"import": "./build/index.js",
|
|
14
|
+
"require": "./build/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./constants": {
|
|
17
|
+
"types": "./build/constants/index.d.ts",
|
|
18
|
+
"import": "./build/constants/index.js",
|
|
19
|
+
"require": "./build/constants/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./components": {
|
|
22
|
+
"types": "./build/components/index.d.ts",
|
|
23
|
+
"import": "./build/components/index.js",
|
|
24
|
+
"require": "./build/components/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./components/*": {
|
|
27
|
+
"types": "./build/components/*/index.d.ts",
|
|
28
|
+
"import": "./build/components/*/index.js",
|
|
29
|
+
"require": "./build/components/*/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./hooks": {
|
|
32
|
+
"types": "./build/hooks/index.d.ts",
|
|
33
|
+
"import": "./build/hooks/index.js",
|
|
34
|
+
"require": "./build/hooks/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./utils": {
|
|
37
|
+
"types": "./build/utils/index.d.ts",
|
|
38
|
+
"import": "./build/utils/index.js",
|
|
39
|
+
"require": "./build/utils/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./theme": {
|
|
42
|
+
"types": "./build/theme/index.d.ts",
|
|
43
|
+
"import": "./build/theme/index.js",
|
|
44
|
+
"require": "./build/theme/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./types": {
|
|
47
|
+
"types": "./build/types/index.d.ts",
|
|
48
|
+
"import": "./build/types/index.js",
|
|
49
|
+
"require": "./build/types/index.js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"author": {
|
|
54
|
+
"name": "Ahmed Sharkawy",
|
|
55
|
+
"email": "a.elsharkawy@tap.company"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"build",
|
|
59
|
+
"readme.md"
|
|
60
|
+
],
|
|
61
|
+
"scripts": {
|
|
62
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
63
|
+
"push": "npm run ts:build && npm publish --access public",
|
|
64
|
+
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
65
|
+
"dev": "vite",
|
|
66
|
+
"build": "tsc -b && vite build ",
|
|
67
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
68
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
69
|
+
"lint": "eslint . --color",
|
|
70
|
+
"lint:fix": "eslint src --fix --color",
|
|
71
|
+
"preview": "vite preview",
|
|
72
|
+
"prepare": "husky"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"@emotion/react": "^11.11.0",
|
|
76
|
+
"@emotion/styled": "^11.11.0",
|
|
77
|
+
"@hookform/resolvers": "^3.3.1",
|
|
78
|
+
"@mui/material": "^5.12.3",
|
|
79
|
+
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
80
|
+
"axios": "^1.4.0",
|
|
81
|
+
"dayjs": "^1.11.8",
|
|
82
|
+
"framer-motion": "10.11.0",
|
|
83
|
+
"i18next": "^22.4.15",
|
|
84
|
+
"memoize-one": "^6.0.0",
|
|
85
|
+
"re-resizable": "^6.9.9",
|
|
86
|
+
"react": "^18.2.0",
|
|
87
|
+
"react-currency-input-field": "^3.6.11",
|
|
88
|
+
"react-dom": "^18.2.0",
|
|
89
|
+
"react-draggable": "^4.4.6",
|
|
90
|
+
"react-dropzone": "^14.2.3",
|
|
91
|
+
"react-hook-form": "^7.45.4",
|
|
92
|
+
"react-hot-toast": "^2.4.1",
|
|
93
|
+
"react-i18next": "^12.2.2",
|
|
94
|
+
"react-multi-date-picker": "^4.1.2",
|
|
95
|
+
"react-router-dom": "^7.7.0",
|
|
96
|
+
"react-virtualized-auto-sizer": "^1.0.20",
|
|
97
|
+
"react-window": "^1.8.9",
|
|
98
|
+
"react-window-infinite-loader": "^1.0.9",
|
|
99
|
+
"react18-input-otp": "^1.1.4",
|
|
100
|
+
"recharts": "^2.15.1"
|
|
101
|
+
},
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@eslint/js": "^9.17.0",
|
|
104
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
105
|
+
"@types/lodash": "^4.17.15",
|
|
106
|
+
"@types/react": "^18.2.6",
|
|
107
|
+
"@types/react-dom": "^18.3.5",
|
|
108
|
+
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
109
|
+
"@types/react-window": "^1.8.5",
|
|
110
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
111
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
112
|
+
"eslint": "^9.17.0",
|
|
113
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
114
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
115
|
+
"globals": "^15.14.0",
|
|
116
|
+
"husky": "^8.0.3",
|
|
117
|
+
"lint-staged": "^13.2.2",
|
|
118
|
+
"prettier": "^2.8.8",
|
|
119
|
+
"tsc-alias": "^1.8.16",
|
|
120
|
+
"typescript": "5.0.2",
|
|
121
|
+
"typescript-eslint": "^8.18.2",
|
|
122
|
+
"vite": "6.0.5",
|
|
123
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
124
|
+
},
|
|
125
|
+
"lint-staged": {
|
|
126
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
127
|
+
"yarn run prettier:fix",
|
|
128
|
+
"yarn run lint"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"publishConfig": {
|
|
132
|
+
"registry": "https://registry.npmjs.org/"
|
|
133
|
+
}
|
|
134
|
+
}
|