@tap-payments/os-micro-frontend-shared 0.1.206 → 0.1.208
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/Chip/style.d.ts +1 -0
- package/build/components/CountBadge/style.d.ts +1 -0
- package/build/components/Dialog/style.d.ts +1 -0
- package/build/components/FlippingCard/style.d.ts +1 -0
- package/build/components/ImageWrapper/ImageWrapper.d.ts +1 -0
- package/build/components/JSONViewer/style.d.ts +1 -0
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +1 -0
- package/build/components/Menu/Menu.d.ts +3 -3
- package/build/components/Menu/Menu.js +12 -8
- package/build/components/Menu/style.d.ts +1 -4
- package/build/components/Menu/style.js +8 -10
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +1 -0
- package/build/components/SearchButton/styles.d.ts +1 -0
- package/build/components/StatusIcons/AuthIcons/style.d.ts +1 -0
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +1 -0
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +1 -0
- package/build/components/StatusIcons/SourceIcons/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SalesChannelCell/SalesChannelCellSheet.js +18 -6
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.js +1 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/style.d.ts +1 -0
- package/build/components/VirtualTables/components/style.d.ts +1 -0
- package/build/components/Widget/useScrollWithShadow.js +3 -3
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
import { GetSourceAnimationFunction } from './type';
|
|
3
4
|
export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
5
|
variant?: import("./type").ChipVariant | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { PopperProps } from '@mui/material/Popper';
|
|
3
|
-
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { BoxProps, SxProps, Theme } from '@mui/material';
|
|
4
4
|
interface MenuProps extends PopperProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
popperSx?: SxProps<Theme>;
|
|
7
|
+
dropdownProps?: BoxProps;
|
|
7
8
|
}
|
|
8
|
-
declare
|
|
9
|
-
declare const _default: import("react").MemoExoticComponent<typeof Menu>;
|
|
9
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<MenuProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export default _default;
|
|
@@ -9,17 +9,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx
|
|
13
|
-
import { memo, Children, useMemo } from 'react';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { memo, Children, useMemo, forwardRef, useCallback } from 'react';
|
|
14
14
|
import Popper from '@mui/material/Popper';
|
|
15
15
|
import { useScrollWithShadow } from '../Widget/useScrollWithShadow';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var { open, anchorEl, children, sx, placement, popperSx } = _a, props = __rest(_a, ["open", "anchorEl", "children", "sx", "placement", "popperSx"]);
|
|
16
|
+
import { StyledDropdown } from './style';
|
|
17
|
+
const Menu = forwardRef((_a, ref) => {
|
|
18
|
+
var { open, anchorEl, children, sx, placement, popperSx, dropdownProps } = _a, props = __rest(_a, ["open", "anchorEl", "children", "sx", "placement", "popperSx", "dropdownProps"]);
|
|
20
19
|
const { onScrollHandler, showShadow } = useScrollWithShadow();
|
|
20
|
+
const _b = dropdownProps || {}, { onScroll } = _b, restDropdownProps = __rest(_b, ["onScroll"]);
|
|
21
21
|
const childrenCount = useMemo(() => Children.count(children), [children]);
|
|
22
22
|
const shouldShowShadow = childrenCount > 12 && showShadow;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const handleScroll = useCallback((e) => {
|
|
24
|
+
onScrollHandler(e);
|
|
25
|
+
onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);
|
|
26
|
+
}, [onScrollHandler, onScroll]);
|
|
27
|
+
return (_jsx(Popper, Object.assign({ ref: ref, open: open, anchorEl: anchorEl, placement: placement || 'bottom-start', sx: popperSx }, props, { children: _jsx(StyledDropdown, Object.assign({ showShadow: shouldShowShadow, onScroll: handleScroll, className: "MuiPopper-dropdown", sx: sx }, restDropdownProps, { children: children })) }), "menu"));
|
|
28
|
+
});
|
|
25
29
|
export default memo(Menu);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const StyledDropdown: 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/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
-
export declare const ShadowBackground: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
7
4
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
8
|
-
|
|
5
|
+
showShadow?: boolean | undefined;
|
|
9
6
|
}, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Box from '@mui/material/Box';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
export const StyledDropdown = styled(Box)(({ theme }) => ({
|
|
3
|
+
export const StyledDropdown = styled(Box, { shouldForwardProp: (prop) => prop !== 'showShadow' })(({ theme, showShadow }) => ({
|
|
4
4
|
borderRadius: theme.spacing(0.5),
|
|
5
5
|
background: theme.palette.background.default,
|
|
6
6
|
width: 'max-content',
|
|
@@ -13,13 +13,11 @@ export const StyledDropdown = styled(Box)(({ theme }) => ({
|
|
|
13
13
|
'.menu-item + .menu-item': {
|
|
14
14
|
borderTop: `1px solid ${theme.palette.divider}`,
|
|
15
15
|
},
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
pointerEvents: 'none',
|
|
24
|
-
zIndex: 999999,
|
|
16
|
+
'&::after': Object.assign({ content: '""', width: '100%', height: '34px', position: 'fixed', bottom: 0, pointerEvents: 'none', zIndex: 999999, background: 'linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%)', transition: theme.transitions.create('opacity', { duration: 250 }) }, (showShadow
|
|
17
|
+
? {
|
|
18
|
+
opacity: 1,
|
|
19
|
+
}
|
|
20
|
+
: {
|
|
21
|
+
opacity: 0,
|
|
22
|
+
})),
|
|
25
23
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
import { TableMode } from '../../../../types/index.js';
|
|
3
4
|
export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
4
5
|
tableMode?: TableMode | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
3
4
|
export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { StatusChipWithCopy } from '../../../index.js';
|
|
2
|
+
import { StatusChip, StatusChipWithCopy } from '../../../index.js';
|
|
3
3
|
import { Box, Popover } from '@mui/material';
|
|
4
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { StyledSheetContainer } from './style';
|
|
6
6
|
function SalesChannelCellSheet({ channels, selectionProps = {} }) {
|
|
7
7
|
const channelWrapperRef = useRef(null);
|
|
@@ -13,12 +13,24 @@ function SalesChannelCellSheet({ channels, selectionProps = {} }) {
|
|
|
13
13
|
setHasOverflow(channelWrapperRef.current.scrollHeight > 20);
|
|
14
14
|
}
|
|
15
15
|
}, [channels]);
|
|
16
|
-
|
|
16
|
+
const filteredChannels = useMemo(() => (channels || []).filter((s) => !!s.address), [channels]);
|
|
17
|
+
return (_jsxs(StyledSheetContainer, { children: [_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: hasOverflow ? '8px' : '4px' }, ref: channelWrapperRef }, { children: filteredChannels.map((channel, index) => {
|
|
17
18
|
var _a, _b;
|
|
18
|
-
return (_jsxs(StatusChipWithCopy, Object.assign({ copyText: `${(_a = channel.name) === null || _a === void 0 ? void 0 : _a.en}: ${channel.address}`, chipIndex: index + 1, selectionProps: selectionProps
|
|
19
|
+
return (_jsxs(StatusChipWithCopy, Object.assign({ copyText: `${(_a = channel.name) === null || _a === void 0 ? void 0 : _a.en}: ${channel.address}`, chipIndex: index + 1, selectionProps: selectionProps, maxWidth: "367px", sx: {
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
textOverflow: 'ellipsis',
|
|
22
|
+
whiteSpace: 'nowrap',
|
|
23
|
+
maxWidth: '367px',
|
|
24
|
+
'& div': {
|
|
25
|
+
overflow: 'hidden',
|
|
26
|
+
textOverflow: 'ellipsis',
|
|
27
|
+
whiteSpace: 'nowrap',
|
|
28
|
+
maxWidth: '367px',
|
|
29
|
+
},
|
|
30
|
+
} }, { children: [(_b = channel.name) === null || _b === void 0 ? void 0 : _b.en, ": ", channel.address] }), channel.id));
|
|
19
31
|
}) })), hasOverflow && (_jsx(Box, Object.assign({ onClick: (e) => {
|
|
20
32
|
setAnchorEl(e.currentTarget.parentElement);
|
|
21
|
-
}, sx: { height: '18px' } }, { children: _jsx(
|
|
33
|
+
}, 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: () => {
|
|
22
34
|
setAnchorEl(null);
|
|
23
35
|
}, anchorOrigin: {
|
|
24
36
|
vertical: 'top',
|
|
@@ -34,7 +46,7 @@ function SalesChannelCellSheet({ channels, selectionProps = {} }) {
|
|
|
34
46
|
marginTop: '22px',
|
|
35
47
|
},
|
|
36
48
|
},
|
|
37
|
-
} }, { children: _jsx(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '4px', padding: '4px' } }, { children:
|
|
49
|
+
} }, { children: _jsx(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '4px', padding: '4px' } }, { children: filteredChannels.map((channel, index) => {
|
|
38
50
|
var _a, _b;
|
|
39
51
|
return (_jsxs(StatusChipWithCopy, Object.assign({ copyText: `${(_a = channel.name) === null || _a === void 0 ? void 0 : _a.en}: ${channel.address}`, chipIndex: index + 1, selectionProps: selectionProps }, { children: [(_b = channel.name) === null || _b === void 0 ? void 0 : _b.en, ": ", channel.address] }), channel.id));
|
|
40
52
|
}) })) }))] }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -54,7 +54,7 @@ export const salesChannelAnimation = (index, xDelta, isLastChannel) => ({
|
|
|
54
54
|
export const StyledSheetContainer = styled(Box)(() => ({
|
|
55
55
|
display: 'flex',
|
|
56
56
|
gap: '4px',
|
|
57
|
-
maxWidth: '
|
|
57
|
+
maxWidth: '440px',
|
|
58
58
|
justifyContent: 'space-between',
|
|
59
59
|
height: '18px',
|
|
60
60
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
3
4
|
variant?: "Global" | "Regional" | "Local" | undefined;
|
|
4
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
2
|
export function useScrollWithShadow() {
|
|
3
3
|
const [scrollTop, setScrollTop] = useState(0);
|
|
4
4
|
const [scrollHeight, setScrollHeight] = useState(0);
|
|
5
5
|
const [clientHeight, setClientHeight] = useState(0);
|
|
6
|
-
const onScrollHandler = (event) => {
|
|
6
|
+
const onScrollHandler = useCallback((event) => {
|
|
7
7
|
const target = event.target;
|
|
8
8
|
setScrollTop(target.scrollTop);
|
|
9
9
|
setScrollHeight(target.scrollHeight);
|
|
10
10
|
setClientHeight(target.clientHeight);
|
|
11
|
-
};
|
|
11
|
+
}, []);
|
|
12
12
|
const showShadow = scrollTop === 0 || clientHeight < scrollHeight - scrollTop - 1;
|
|
13
13
|
return { onScrollHandler, showShadow };
|
|
14
14
|
}
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.208",
|
|
5
|
+
"testVersion": 11,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|