@tap-payments/os-micro-frontend-shared 0.1.133-test.2 → 0.1.134-test.1
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/DisplayAmount/DisplayAmount.d.ts +10 -0
- package/build/components/DisplayAmount/DisplayAmount.js +22 -0
- package/build/components/DisplayAmount/index.d.ts +2 -0
- package/build/components/DisplayAmount/index.js +2 -0
- package/build/components/DisplayAmount/style.d.ts +5 -0
- package/build/components/DisplayAmount/style.js +14 -0
- package/build/components/ErrorToast/ErrorToast.d.ts +3 -0
- package/build/components/ErrorToast/ErrorToast.js +7 -0
- package/build/components/ErrorToast/index.d.ts +2 -0
- package/build/components/ErrorToast/index.js +2 -0
- package/build/components/ErrorToast/style.d.ts +9 -0
- package/build/components/ErrorToast/style.js +33 -0
- package/build/components/ErrorToast/type.d.ts +10 -0
- package/build/components/ErrorToast/type.js +1 -0
- package/build/components/LanguageDropdown/LanguageDropdown.d.ts +6 -0
- package/build/components/LanguageDropdown/LanguageDropdown.js +24 -0
- package/build/components/LanguageDropdown/index.d.ts +2 -0
- package/build/components/LanguageDropdown/index.js +2 -0
- package/build/components/LanguageDropdown/style.d.ts +6 -0
- package/build/components/LanguageDropdown/style.js +5 -0
- package/build/components/ToggleView/ToggleView.d.ts +16 -0
- package/build/components/ToggleView/ToggleView.js +32 -0
- package/build/components/ToggleView/ToggleWrapper.d.ts +4 -0
- package/build/components/ToggleView/ToggleWrapper.js +8 -0
- package/build/components/ToggleView/index.d.ts +3 -0
- package/build/components/ToggleView/index.js +3 -0
- package/build/components/ToggleView/style.d.ts +14 -0
- package/build/components/ToggleView/style.js +31 -0
- package/build/components/ToggleView/types.d.ts +6 -0
- package/build/components/ToggleView/types.js +6 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +32 -64
- package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.js +1 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.js +1 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataView.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataView.js +1 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.js +1 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.js +12 -15
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.d.ts +0 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.js +0 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumns.js +35 -73
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.js +0 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts +23 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js +28 -32
- package/build/components/VirtualTables/SheetViewVirtualTable/types.d.ts +7 -14
- package/build/components/VirtualTables/components/ColumnFilter/ColumnFilter.js +1 -1
- package/build/components/VirtualTables/components/TableRow.js +18 -20
- package/build/components/VirtualTables/components/virtualScroll/ListItemWrapper.js +1 -1
- package/build/components/index.d.ts +4 -0
- package/build/components/index.js +4 -0
- package/build/constants/table/cell/terminalsTableCellWidth.d.ts +3 -3
- package/build/constants/table/cell/terminalsTableCellWidth.js +3 -3
- package/build/constants/table.d.ts +1 -1
- package/build/constants/table.js +1 -1
- package/build/types/entity.d.ts +5 -0
- package/build/utils/style.d.ts +2 -2
- package/build/utils/style.js +2 -2
- package/package.json +2 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePerformanceOptimizations.d.ts +0 -11
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePerformanceOptimizations.js +0 -37
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
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
import { Currency } from '../../types/index.js';
|
|
4
|
+
interface DisplayAmountI extends BoxProps {
|
|
5
|
+
amount: number;
|
|
6
|
+
selectedCurrency: Currency;
|
|
7
|
+
}
|
|
8
|
+
declare function DisplayAmount({ amount, selectedCurrency, ...props }: DisplayAmountI): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const _default: import("react").MemoExoticComponent<typeof DisplayAmount>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { formatAmountWithCurrency } from '../../utils/index.js';
|
|
15
|
+
import { DecimalSpan, CurrencySpan } from './style';
|
|
16
|
+
function DisplayAmount(_a) {
|
|
17
|
+
var _b;
|
|
18
|
+
var { amount, selectedCurrency } = _a, props = __rest(_a, ["amount", "selectedCurrency"]);
|
|
19
|
+
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, (_b = selectedCurrency === null || selectedCurrency === void 0 ? void 0 : selectedCurrency.code) === null || _b === void 0 ? void 0 : _b.english);
|
|
20
|
+
return (_jsxs(CurrencySpan, Object.assign({}, props, { children: [_jsx("span", { children: integerAmount }), _jsx("span", { children: "." }), _jsx(DecimalSpan, { children: decimalAmount })] })));
|
|
21
|
+
}
|
|
22
|
+
export default memo(DisplayAmount);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DecimalSpan: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
|
+
export declare const CurrencySpan: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
export const DecimalSpan = styled('span')(() => ({
|
|
4
|
+
fontWeight: 400,
|
|
5
|
+
}));
|
|
6
|
+
export const CurrencySpan = styled(Box)(() => ({
|
|
7
|
+
fontWeight: 700,
|
|
8
|
+
fontSize: '11px',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
cursor: 'default',
|
|
12
|
+
whiteSpace: 'nowrap',
|
|
13
|
+
overflow: 'auto',
|
|
14
|
+
}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { reloadIcon } from '../../constants/index.js';
|
|
3
|
+
import { ToastContainer, ToastIcon, ToastText } from './style';
|
|
4
|
+
function ErrorToast({ message = 'Something went wrong', onRetry, position = 'bottom-center', iconSrc }) {
|
|
5
|
+
return (_jsxs(ToastContainer, Object.assign({ toastPosition: position }, { children: [_jsx(ToastText, { children: message }), _jsx(ToastIcon, { onClick: onRetry, src: iconSrc || reloadIcon, alt: "toast-icon" })] })));
|
|
6
|
+
}
|
|
7
|
+
export default ErrorToast;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToastContainerProps } from './type';
|
|
3
|
+
export declare const ToastContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ToastContainerProps, {}, {}>;
|
|
6
|
+
export declare const ToastIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
7
|
+
export declare const ToastText: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
8
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
9
|
+
}, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "visibility" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "style" | "className" | "classes" | "children" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Box, styled, Typography } from '@mui/material';
|
|
2
|
+
export const ToastContainer = styled(Box, {
|
|
3
|
+
shouldForwardProp: (prop) => prop !== 'toastPosition',
|
|
4
|
+
})(({ theme, toastPosition }) => (Object.assign(Object.assign(Object.assign(Object.assign({ width: 160, position: 'absolute', bottom: 12, zIndex: 1000, display: 'flex', justifyContent: 'space-between', alignItems: 'center', backgroundColor: theme.palette.background.paper, height: 31, gap: theme.spacing(1), borderRadius: theme.shape.borderRadius, borderWidth: 1, padding: theme.spacing(1), border: `1px solid ${theme.palette.divider}`, boxShadow: '0px 0px 16px 0px #00000014', animation: 'slideIn 0.5s ease-out' }, (toastPosition === 'bottom-center' && {
|
|
5
|
+
left: '50%',
|
|
6
|
+
transform: 'translateX(-50%)',
|
|
7
|
+
})), (toastPosition === 'bottom-right' && {
|
|
8
|
+
right: 12,
|
|
9
|
+
transform: 'none',
|
|
10
|
+
})), (toastPosition === 'bottom-left' && {
|
|
11
|
+
left: 12,
|
|
12
|
+
transform: 'none',
|
|
13
|
+
})), { '@keyframes slideIn': {
|
|
14
|
+
'0%': {
|
|
15
|
+
opacity: 0,
|
|
16
|
+
transform: toastPosition === 'bottom-center' ? 'translate(-50%, 100%)' : toastPosition === 'bottom-right' ? 'translateX(100%)' : 'translateX(-100%)',
|
|
17
|
+
},
|
|
18
|
+
'100%': {
|
|
19
|
+
opacity: 1,
|
|
20
|
+
transform: toastPosition === 'bottom-center' ? 'translate(-50%, 0)' : 'translateX(0)',
|
|
21
|
+
},
|
|
22
|
+
} })));
|
|
23
|
+
export const ToastIcon = styled('img')({
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
});
|
|
26
|
+
export const ToastText = styled(Typography)(({ theme }) => ({
|
|
27
|
+
fontSize: 11,
|
|
28
|
+
fontWeight: 500,
|
|
29
|
+
color: theme.palette.text.primary,
|
|
30
|
+
overflow: 'hidden',
|
|
31
|
+
textOverflow: 'ellipsis',
|
|
32
|
+
whiteSpace: 'nowrap',
|
|
33
|
+
}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ToastPosition = 'bottom-center' | 'bottom-right' | 'bottom-left';
|
|
2
|
+
export interface ErrorToastProps {
|
|
3
|
+
message?: string;
|
|
4
|
+
onRetry?: () => void;
|
|
5
|
+
position?: ToastPosition;
|
|
6
|
+
iconSrc?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastContainerProps {
|
|
9
|
+
toastPosition: ToastPosition;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
|
+
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
5
|
+
import { Menu, MenuItem } from '../index.js';
|
|
6
|
+
import { Button } from './style';
|
|
7
|
+
const languages = ['EN', 'AR'];
|
|
8
|
+
export default function LanguageDropdown({ defaultLanguage = 'EN', onChange }) {
|
|
9
|
+
const [language, setLanguage] = useState(defaultLanguage);
|
|
10
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
|
+
const open = Boolean(anchorEl);
|
|
12
|
+
const onOpen = (event) => {
|
|
13
|
+
setAnchorEl(event.currentTarget);
|
|
14
|
+
};
|
|
15
|
+
const onCLose = () => {
|
|
16
|
+
setAnchorEl(null);
|
|
17
|
+
};
|
|
18
|
+
const onClick = (lang) => {
|
|
19
|
+
setLanguage(lang);
|
|
20
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(lang);
|
|
21
|
+
onCLose();
|
|
22
|
+
};
|
|
23
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onCLose }, { children: _jsxs(Box, { children: [_jsx(Button, Object.assign({ onClick: onOpen, open: open }, { children: _jsx(Box, Object.assign({ component: "span" }, { children: language })) })), _jsx(Menu, Object.assign({ open: open, anchorEl: anchorEl, sx: { marginTop: '8px', marginBottom: '8px', width: 31.8 } }, { children: languages.map((lang) => lang !== language && (_jsx(MenuItem, Object.assign({ onClick: () => onClick(lang) }, { children: lang }), lang))) }))] }) })));
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Button: 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
|
+
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
|
+
open?: boolean | undefined;
|
|
6
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
export const Button = styled(Box, { shouldForwardProp: (props) => props !== 'open' })(({ theme, open }) => (Object.assign({ backgroundColor: theme.palette.common.white, border: `1px solid ${theme.palette.divider}`, fontSize: '11px', color: theme.palette.text.primary, padding: '8px', borderRadius: '4px', display: 'flex', alignItems: 'center', height: 32, gap: '4px' }, (open && {
|
|
4
|
+
borderColor: theme.palette.info.dark,
|
|
5
|
+
}))));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToggleViews, ToggleViewsValues } from './types';
|
|
3
|
+
declare const DEFAULT_TOGGLE_VIEWS: {
|
|
4
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
value: ToggleViews;
|
|
6
|
+
}[];
|
|
7
|
+
export interface ToggleViewProps {
|
|
8
|
+
onToggleClick: (view: ToggleViewsValues) => void;
|
|
9
|
+
currentView: ToggleViewsValues;
|
|
10
|
+
getOverrideViews?: (defaultViews: typeof DEFAULT_TOGGLE_VIEWS) => {
|
|
11
|
+
icon: React.ReactNode;
|
|
12
|
+
value: ToggleViewsValues;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
declare const ToggleView: (props: ToggleViewProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export default ToggleView;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cardViewButtonIcon, listViewButtonIcon } from '../../constants/index.js';
|
|
3
|
+
import { ActiveOverlay, ViewButton } from './style';
|
|
4
|
+
import { ToggleViews } from './types';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import ToggleWrapper from './ToggleWrapper';
|
|
7
|
+
const DEFAULT_TOGGLE_VIEWS = [
|
|
8
|
+
{
|
|
9
|
+
icon: _jsx("img", { src: cardViewButtonIcon, alt: "card" }),
|
|
10
|
+
value: ToggleViews.CARDS,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
icon: _jsx("img", { src: listViewButtonIcon, alt: ToggleViews.LIST }),
|
|
14
|
+
value: ToggleViews.LIST,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
const ToggleView = (props) => {
|
|
18
|
+
const { currentView, onToggleClick, getOverrideViews } = props;
|
|
19
|
+
const views = useMemo(() => {
|
|
20
|
+
if (getOverrideViews)
|
|
21
|
+
return getOverrideViews(DEFAULT_TOGGLE_VIEWS);
|
|
22
|
+
return DEFAULT_TOGGLE_VIEWS;
|
|
23
|
+
}, [getOverrideViews]);
|
|
24
|
+
const viewIndex = useMemo(() => views.findIndex((view) => view.value === currentView), [views, currentView]);
|
|
25
|
+
if (!onToggleClick)
|
|
26
|
+
return null;
|
|
27
|
+
return (_jsxs(ToggleWrapper, { children: [views.map((view) => (_jsx(ViewButton, Object.assign({ onClick: () => onToggleClick(view.value), sx: {
|
|
28
|
+
height: '11.6px',
|
|
29
|
+
width: '11.6px',
|
|
30
|
+
}, isActive: currentView === view.value }, { children: view.icon }), view.value))), _jsx(ActiveOverlay, { activeIndex: viewIndex })] }));
|
|
31
|
+
};
|
|
32
|
+
export default ToggleView;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ToggleWrapperStyled } from './style';
|
|
4
|
+
const ToggleWrapper = (props) => {
|
|
5
|
+
const viewTogglers = React.Children.count(props.children) - 1;
|
|
6
|
+
return _jsx(ToggleWrapperStyled, Object.assign({}, props, { sx: { width: viewTogglers * 30 + 2 } }));
|
|
7
|
+
};
|
|
8
|
+
export default ToggleWrapper;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ToggleWrapperStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
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>, {}, {}>;
|
|
5
|
+
export declare const ViewButton: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").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
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const ActiveOverlay: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
13
|
+
activeIndex: number;
|
|
14
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Box, styled } from '@mui/material';
|
|
2
|
+
export const ToggleWrapperStyled = styled(Box)(({ theme }) => ({
|
|
3
|
+
height: '32px',
|
|
4
|
+
borderRadius: '4px',
|
|
5
|
+
backgroundColor: theme.palette.action.hover,
|
|
6
|
+
padding: '2px',
|
|
7
|
+
display: 'flex',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
position: 'relative',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
}));
|
|
12
|
+
export const ViewButton = styled(Box, { shouldForwardProp: (props) => props !== 'isActive' })(({ isActive }) => ({
|
|
13
|
+
flex: 1,
|
|
14
|
+
display: 'flex',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
position: 'relative',
|
|
18
|
+
zIndex: 2,
|
|
19
|
+
opacity: isActive ? 1 : 0.5,
|
|
20
|
+
}));
|
|
21
|
+
export const ActiveOverlay = styled(Box, { shouldForwardProp: (props) => props !== 'activeIndex' })(({ theme, activeIndex }) => ({
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
top: 2,
|
|
24
|
+
left: activeIndex * 30 + 2,
|
|
25
|
+
transition: 'all 0.25s ease-in-out',
|
|
26
|
+
width: '28px',
|
|
27
|
+
height: '28px',
|
|
28
|
+
backgroundColor: theme.palette.common.white,
|
|
29
|
+
borderRadius: '2px',
|
|
30
|
+
boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.20)',
|
|
31
|
+
}));
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useCallback
|
|
2
|
+
import { memo, useCallback } from 'react';
|
|
3
3
|
import { SHEET_VIEW_TABLE_THRESHOLD } from '../../../constants/index.js';
|
|
4
4
|
import TableFooter from '../components/TableFooter/TableFooter';
|
|
5
5
|
import { SheetViewTableContainer } from '../components/style';
|
|
6
6
|
import { SheetViewVirtualTableWrapper } from './style';
|
|
7
|
-
import { usePinnedColumns, useSynchronizedScroll, useTableState, useTableData, useVirtualTableContainer, usePinnedColumnsWidths
|
|
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 = SHEET_VIEW_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, overscanCount, }) {
|
|
10
|
-
const { stableColumns } = usePerformanceOptimizations(columns);
|
|
11
10
|
const { selectedCell, selectedColumn, selectedRow, showBackDrop, setShowBackdrop, handleCellClick, handleColumnClick, handleChipClick, selectedChip, } = useTableState();
|
|
12
11
|
const { isError, tableLoading, tableError, tableEmpty, hasTimeoutError, showNoDataView, lastItemIndex, areTotalRowsNotFillingHeight, itemsCount, isDelayedFetchingNextPage, } = useTableData({
|
|
13
12
|
rows,
|
|
@@ -16,7 +15,7 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
16
15
|
isFetchingNextPage,
|
|
17
16
|
areAllRowsLoaded,
|
|
18
17
|
});
|
|
19
|
-
const { pinnedStartColumns, pinnedEndColumns, handleColumnPin, pinnedStartColumnsData, pinnedEndColumnsData, unpinnedColumnsData, orderedColumns, lastColumnId, } = usePinnedColumns(
|
|
18
|
+
const { pinnedStartColumns, pinnedEndColumns, handleColumnPin, pinnedStartColumnsData, pinnedEndColumnsData, unpinnedColumnsData, orderedColumns, lastColumnId, } = usePinnedColumns(columns, isPinnable, onColumnPin);
|
|
20
19
|
const { pinnedStartVirtualListRef, scrollableVirtualListRef, pinnedEndVirtualListRef, handleScroll } = useSynchronizedScroll();
|
|
21
20
|
const { pinnedStartColumnsWidth, pinnedEndColumnsWidth } = usePinnedColumnsWidths(pinnedStartColumnsData, pinnedEndColumnsData);
|
|
22
21
|
const { getItemSize, getItemDataForContainer } = useVirtualTableContainer({
|
|
@@ -38,37 +37,41 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
38
37
|
const onPointerDown = (e) => {
|
|
39
38
|
dragControls === null || dragControls === void 0 ? void 0 : dragControls.start(e);
|
|
40
39
|
};
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onColumnClick: handleColumnClick,
|
|
52
|
-
tableTitle,
|
|
40
|
+
const createVirtualTableContainer = useCallback((columnsData, containerKey, isPinned = false, fixedWidth) => {
|
|
41
|
+
const listRef = containerKey === 'pinnedStart' ? pinnedStartVirtualListRef : containerKey === 'pinnedEnd' ? pinnedEndVirtualListRef : scrollableVirtualListRef;
|
|
42
|
+
const handleScrollCallback = (scrollProps) => {
|
|
43
|
+
const source = containerKey === 'pinnedStart' ? 'start' : containerKey === 'pinnedEnd' ? 'end' : 'scrollable';
|
|
44
|
+
handleScroll(scrollProps, source);
|
|
45
|
+
};
|
|
46
|
+
return (_jsx(VirtualTable, { columnsData: columnsData, itemCount: itemsCount, lastItemIndex: lastItemIndex, areAllRowsLoaded: areAllRowsLoaded, loadMoreItems: loadMoreItems, threshold: threshold, getItemSize: getItemSize, getItemData: getItemDataForContainer, isPinned: isPinned, fixedWidth: fixedWidth, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, onScroll: handleScrollCallback, setBackdropVisibility: setShowBackdrop, listRef: listRef, overscanCount: overscanCount }));
|
|
47
|
+
}, [
|
|
48
|
+
itemsCount,
|
|
49
|
+
lastItemIndex,
|
|
53
50
|
areAllRowsLoaded,
|
|
54
|
-
|
|
51
|
+
loadMoreItems,
|
|
52
|
+
threshold,
|
|
53
|
+
getItemSize,
|
|
54
|
+
getItemDataForContainer,
|
|
55
55
|
scrollToIndex,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
areTotalRowsNotFillingHeight,
|
|
57
|
+
clearBackdropVisibilityTimeout,
|
|
58
|
+
handleScroll,
|
|
59
|
+
setShowBackdrop,
|
|
60
|
+
pinnedStartVirtualListRef,
|
|
61
|
+
pinnedEndVirtualListRef,
|
|
62
|
+
scrollableVirtualListRef,
|
|
63
|
+
]);
|
|
64
|
+
const baseCommonProps = {
|
|
62
65
|
showHeader,
|
|
63
66
|
columnsSorting,
|
|
64
67
|
onColumnSort,
|
|
65
68
|
headerProps,
|
|
66
69
|
showBackDrop,
|
|
67
|
-
handleColumnPin,
|
|
70
|
+
onColumnPin: handleColumnPin,
|
|
68
71
|
isPinnable,
|
|
69
72
|
lastColumnId,
|
|
70
73
|
selectedColumn,
|
|
71
|
-
handleColumnClick,
|
|
74
|
+
onColumnClick: handleColumnClick,
|
|
72
75
|
tableTitle,
|
|
73
76
|
areAllRowsLoaded,
|
|
74
77
|
isFetchingNextPage,
|
|
@@ -78,44 +81,9 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
78
81
|
tableMode,
|
|
79
82
|
showNoDataView,
|
|
80
83
|
tableBodyStyles,
|
|
81
|
-
|
|
82
|
-
const commonPropsWithTableStates =
|
|
83
|
-
tableLoading })
|
|
84
|
-
|
|
85
|
-
itemCount: itemsCount,
|
|
86
|
-
lastItemIndex,
|
|
87
|
-
areAllRowsLoaded,
|
|
88
|
-
loadMoreItems,
|
|
89
|
-
threshold,
|
|
90
|
-
getItemSize,
|
|
91
|
-
getItemData: getItemDataForContainer,
|
|
92
|
-
scrollToIndex,
|
|
93
|
-
areTotalRowsNotFillingHeight,
|
|
94
|
-
clearBackdropVisibilityTimeout,
|
|
95
|
-
setBackdropVisibility: setShowBackdrop,
|
|
96
|
-
overscanCount,
|
|
97
|
-
}), [
|
|
98
|
-
itemsCount,
|
|
99
|
-
lastItemIndex,
|
|
100
|
-
areAllRowsLoaded,
|
|
101
|
-
loadMoreItems,
|
|
102
|
-
threshold,
|
|
103
|
-
getItemSize,
|
|
104
|
-
getItemDataForContainer,
|
|
105
|
-
scrollToIndex,
|
|
106
|
-
areTotalRowsNotFillingHeight,
|
|
107
|
-
clearBackdropVisibilityTimeout,
|
|
108
|
-
setShowBackdrop,
|
|
109
|
-
overscanCount,
|
|
110
|
-
]);
|
|
111
|
-
const createVirtualTableContainer = useCallback((columnsData, containerKey, isPinned = false, fixedWidth) => {
|
|
112
|
-
const listRef = containerKey === 'pinnedStart' ? pinnedStartVirtualListRef : containerKey === 'pinnedEnd' ? pinnedEndVirtualListRef : scrollableVirtualListRef;
|
|
113
|
-
const handleScrollCallback = (scrollProps) => {
|
|
114
|
-
const source = containerKey === 'pinnedStart' ? 'start' : containerKey === 'pinnedEnd' ? 'end' : 'scrollable';
|
|
115
|
-
handleScroll(scrollProps, source);
|
|
116
|
-
};
|
|
117
|
-
return (_jsx(VirtualTable, Object.assign({}, virtualTableBaseProps, { columnsData: columnsData, isPinned: isPinned, fixedWidth: fixedWidth, onScroll: handleScrollCallback, listRef: listRef })));
|
|
118
|
-
}, [virtualTableBaseProps, handleScroll, pinnedStartVirtualListRef, pinnedEndVirtualListRef, scrollableVirtualListRef]);
|
|
119
|
-
return (_jsxs(_Fragment, { children: [_jsx(SheetViewTableContainer, { children: showNoDataView ? (tableLoading ? (_jsxs(SheetViewVirtualTableWrapper, { children: [pinnedStartColumnsData.length > 0 && (_jsx(PinnedColumn, { position: "start", columnsData: pinnedStartColumnsData, columnsWidth: pinnedStartColumnsWidth, pinnedColumnsList: pinnedStartColumns, hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer, commonProps: commonPropsWithTableStates })), _jsx(LoadingMainTable, { hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, unpinnedColumnsData: unpinnedColumnsData, pinnedStartColumns: pinnedStartColumns, pinnedEndColumns: pinnedEndColumns, commonProps: commonPropsWithTableStates }), pinnedEndColumnsData.length > 0 && (_jsx(PinnedColumn, { position: "end", columnsData: pinnedEndColumnsData, columnsWidth: pinnedEndColumnsWidth, pinnedColumnsList: [...pinnedStartColumns, ...pinnedEndColumns], hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer, commonProps: commonPropsWithTableStates }))] })) : (_jsx(NoDataView, { tableLoading: tableLoading, tableError: tableError, tableEmpty: tableEmpty, hasTimeoutError: hasTimeoutError, orderedColumns: orderedColumns, error: error, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps, commonProps: baseCommonProps }))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [pinnedStartColumnsData.length > 0 && (_jsx(PinnedColumn, { position: "start", columnsData: pinnedStartColumnsData, columnsWidth: pinnedStartColumnsWidth, pinnedColumnsList: pinnedStartColumns, hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer, commonProps: commonPropsWithTableStates })), _jsx(MainTable, { hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, unpinnedColumnsData: unpinnedColumnsData, pinnedStartColumns: pinnedStartColumns, pinnedEndColumns: pinnedEndColumns, createVirtualTableContainer: createVirtualTableContainer, commonProps: commonPropsWithTableStates }), pinnedEndColumnsData.length > 0 && (_jsx(PinnedColumn, { position: "end", columnsData: pinnedEndColumnsData, columnsWidth: pinnedEndColumnsWidth, pinnedColumnsList: [...pinnedStartColumns, ...pinnedEndColumns], hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer, commonProps: commonPropsWithTableStates }))] })) }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
|
|
84
|
+
};
|
|
85
|
+
const commonPropsWithTableStates = Object.assign(Object.assign({}, baseCommonProps), { hasTimeoutError,
|
|
86
|
+
tableLoading });
|
|
87
|
+
return (_jsxs(_Fragment, { children: [_jsx(SheetViewTableContainer, { children: showNoDataView ? (tableLoading ? (_jsxs(SheetViewVirtualTableWrapper, { children: [pinnedStartColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "start", columnsData: pinnedStartColumnsData, columnsWidth: pinnedStartColumnsWidth, pinnedColumnsList: pinnedStartColumns, hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates))), _jsx(LoadingMainTable, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, unpinnedColumnsData: unpinnedColumnsData, pinnedStartColumns: pinnedStartColumns, pinnedEndColumns: pinnedEndColumns }, commonPropsWithTableStates)), pinnedEndColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "end", columnsData: pinnedEndColumnsData, columnsWidth: pinnedEndColumnsWidth, pinnedColumnsList: [...pinnedStartColumns, ...pinnedEndColumns], hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates)))] })) : (_jsx(NoDataView, Object.assign({ tableLoading: tableLoading, tableError: tableError, tableEmpty: tableEmpty, hasTimeoutError: hasTimeoutError, orderedColumns: orderedColumns, error: error, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }, baseCommonProps)))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [pinnedStartColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "start", columnsData: pinnedStartColumnsData, columnsWidth: pinnedStartColumnsWidth, pinnedColumnsList: pinnedStartColumns, hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates))), _jsx(MainTable, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, unpinnedColumnsData: unpinnedColumnsData, pinnedStartColumns: pinnedStartColumns, pinnedEndColumns: pinnedEndColumns, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates)), pinnedEndColumnsData.length > 0 && (_jsx(PinnedColumn, Object.assign({ position: "end", columnsData: pinnedEndColumnsData, columnsWidth: pinnedEndColumnsWidth, pinnedColumnsList: [...pinnedStartColumns, ...pinnedEndColumns], hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0, createVirtualTableContainer: createVirtualTableContainer }, commonPropsWithTableStates)))] })) }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
|
|
120
88
|
}
|
|
121
89
|
export default memo(SheetViewVirtualTable);
|
package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { LoadingMainTableProps } from '../types';
|
|
3
|
-
declare function LoadingMainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, pinnedStartColumns, pinnedEndColumns,
|
|
3
|
+
declare function LoadingMainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, }: LoadingMainTableProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof LoadingMainTable>;
|
|
5
5
|
export default _default;
|
|
@@ -5,9 +5,8 @@ import { StyledTableBox, TableWrapper, StyledBox } from '../../components/style'
|
|
|
5
5
|
import { MainTableWrapper, UnpinnedTableHeaderWrapper } from '../style';
|
|
6
6
|
import SheetViewTableHeader from './SheetViewTableHeader';
|
|
7
7
|
import SheetViewTableLoading from './SheetViewTableLoading';
|
|
8
|
-
function LoadingMainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, pinnedStartColumns, pinnedEndColumns,
|
|
8
|
+
function LoadingMainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, }) {
|
|
9
9
|
const theme = useTheme();
|
|
10
|
-
const { showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, } = commonProps;
|
|
11
10
|
return (_jsx(MainTableWrapper, Object.assign({ hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox_Loading", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_LoadingTableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_LoadingTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: onColumnClick, tablePosition: "scrollable", hasPinnedStart: hasPinnedStart, hasPinnedEnd: hasPinnedEnd }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_LoadingTableWrapper", sx: {
|
|
12
11
|
width: '100%',
|
|
13
12
|
minWidth: 'fit-content',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { MainTableProps } from '../types';
|
|
3
|
-
declare function MainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, pinnedStartColumns, pinnedEndColumns,
|
|
3
|
+
declare function MainTable({ hasPinnedStart, hasPinnedEnd, unpinnedColumnsData, showHeader, columnsSorting, onColumnSort, headerProps, showBackDrop, pinnedStartColumns, pinnedEndColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, tableTitle, areAllRowsLoaded, isFetchingNextPage, scrollToIndex, isLoading, isError, hasTimeoutError, tableMode, showNoDataView, tableBodyStyles, tableLoading, createVirtualTableContainer, }: MainTableProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof MainTable>;
|
|
5
5
|
export default _default;
|