@tap-payments/os-micro-frontend-shared 0.1.15 → 0.1.17

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.
Files changed (34) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +12 -12
  3. package/build/components/Chip/Chip.d.ts +1 -1
  4. package/build/components/Chip/style.js +12 -12
  5. package/build/components/TableCells/CustomCells/TerminalsBrandCell/TerminalsBrandCell.d.ts +12 -0
  6. package/build/components/TableCells/CustomCells/TerminalsBrandCell/TerminalsBrandCell.js +20 -0
  7. package/build/components/TableCells/CustomCells/TerminalsBrandCell/index.d.ts +1 -0
  8. package/build/components/TableCells/CustomCells/TerminalsBrandCell/index.js +1 -0
  9. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.d.ts +12 -0
  10. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.js +19 -0
  11. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/index.d.ts +1 -0
  12. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/index.js +1 -0
  13. package/build/components/TableCells/CustomCells/index.d.ts +2 -0
  14. package/build/components/TableCells/CustomCells/index.js +2 -0
  15. package/build/components/TooltipChip/TooltipChip.d.ts +14 -0
  16. package/build/components/TooltipChip/TooltipChip.js +20 -0
  17. package/build/components/TooltipChip/index.d.ts +1 -0
  18. package/build/components/TooltipChip/index.js +1 -0
  19. package/build/components/TooltipChip/style.d.ts +9 -0
  20. package/build/components/TooltipChip/style.js +7 -0
  21. package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +5 -4
  22. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/SheetViewTableHeader.d.ts +1 -18
  23. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/SheetViewTableHeader.js +2 -1
  24. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/TableCell.d.ts +1 -1
  25. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/TableCell.js +4 -4
  26. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/type.d.ts +7 -4
  27. package/build/components/VirtualTables/components/TableRow.d.ts +1 -1
  28. package/build/components/VirtualTables/components/TableRow.js +4 -3
  29. package/build/components/index.d.ts +1 -0
  30. package/build/components/index.js +1 -0
  31. package/build/constants/table/cell/terminalsTableCellWidth.d.ts +3 -3
  32. package/build/constants/table/cell/terminalsTableCellWidth.js +3 -3
  33. package/build/types/user.d.ts +0 -2
  34. 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,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { ChipProps } from './type';
3
- declare const Chip: import("react").ForwardRefExoticComponent<Omit<ChipProps, "ref"> & import("react").RefAttributes<import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>>>;
3
+ declare const Chip: import("react").FC<ChipProps>;
4
4
  export default Chip;
@@ -19,18 +19,18 @@ export const ChipStyled = styled(forwardRef((props, ref) => {
19
19
  return _jsx(Box, Object.assign({ ref: ref }, restProps, { className: calcClassName }));
20
20
  }), {
21
21
  shouldForwardProp: (prop) => prop !== 'icon',
22
- })(({ theme, icon }) => {
23
- return Object.assign(Object.assign({ border: `1px solid ${theme.palette.divider}`, borderRadius: '30px', backgroundColor: theme.palette.background.paper, display: 'flex', alignItems: 'center', justifyContent: 'center' }, (icon && { justifyContent: 'flex-start', gap: theme.spacing(1) })), { '&.CustomVariant_text': {
24
- padding: `${theme.spacing(0.75)} ${theme.spacing(1)}`,
25
- height: '30px',
26
- maxWidth: '150px',
27
- }, '&.CustomVariant_circular': {
28
- height: 24,
29
- width: 24,
30
- }, '&.CustomVariant_pill-icon': {
31
- height: 24,
32
- width: 36,
33
- } });
22
+ })(({ theme, variant = 'text', icon }) => {
23
+ return Object.assign(Object.assign(Object.assign(Object.assign({ border: `1px solid ${theme.palette.divider}`, borderRadius: '30px', backgroundColor: theme.palette.background.paper, display: 'flex', alignItems: 'center', justifyContent: 'center' }, (icon && { justifyContent: 'flex-start', gap: theme.spacing(1) })), (variant === 'text' && {
24
+ padding: `${theme.spacing(0.75)} ${theme.spacing(1)}`,
25
+ height: '30px',
26
+ maxWidth: '150px',
27
+ })), (variant === 'circular' && {
28
+ height: 24,
29
+ width: 24,
30
+ })), (variant === 'pill-icon' && {
31
+ height: 24,
32
+ width: 36,
33
+ }));
34
34
  });
35
35
  export const StyledSourceCell = styled('span')(({ theme }) => ({
36
36
  display: 'flex',
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { TextAndLang } from '../../../../types/index.js';
3
+ type TerminalsBrandCellProps = {
4
+ name: TextAndLang[];
5
+ icon?: React.ReactNode;
6
+ displayRules: {
7
+ showIcon: boolean;
8
+ showLabel: boolean;
9
+ };
10
+ };
11
+ declare const TerminalsBrandCell: (props: TerminalsBrandCellProps) => import("react/jsx-runtime").JSX.Element | null;
12
+ export default TerminalsBrandCell;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTranslation } from 'react-i18next';
3
+ import Stack from '@mui/material/Stack';
4
+ import Typography from '@mui/material/Typography';
5
+ import { Chip, Tooltip } from '../../../index.js';
6
+ import { getNameText } from '../../../../utils/index.js';
7
+ const TerminalsBrandCell = (props) => {
8
+ const { name, icon, displayRules } = props;
9
+ const { i18n } = useTranslation();
10
+ if (!name && !icon)
11
+ return null;
12
+ const { showIcon, showLabel } = displayRules;
13
+ const brandName = name ? getNameText(name, i18n.language) : '';
14
+ const displayLabel = showLabel && !!brandName;
15
+ const displayIcon = showIcon && !!icon;
16
+ if (!displayIcon && !displayLabel)
17
+ return null;
18
+ return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsBrandCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, { children: [displayIcon && (_jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: brandName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: brandName })) })))] })));
19
+ };
20
+ export default TerminalsBrandCell;
@@ -0,0 +1 @@
1
+ export { default as TerminalsBrandCell } from './TerminalsBrandCell';
@@ -0,0 +1 @@
1
+ export { default as TerminalsBrandCell } from './TerminalsBrandCell';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { TextAndLang } from '../../../../types/index.js';
3
+ type TerminalsPlatformCellProps = {
4
+ name: TextAndLang[];
5
+ icon?: React.ReactNode;
6
+ displayRules?: {
7
+ showIcon?: boolean;
8
+ showLabel?: boolean;
9
+ };
10
+ };
11
+ declare const _default: import("react").MemoExoticComponent<({ name, icon, displayRules }: TerminalsPlatformCellProps) => import("react/jsx-runtime").JSX.Element | null>;
12
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import Stack from '@mui/material/Stack';
5
+ import Typography from '@mui/material/Typography';
6
+ import Box from '@mui/material/Box';
7
+ import { Chip, Tooltip } from '../../../index.js';
8
+ import { getNameText } from '../../../../utils/index.js';
9
+ const TerminalsPlatformCell = ({ name, icon, displayRules }) => {
10
+ const { i18n } = useTranslation();
11
+ const { showIcon = true, showLabel = true } = displayRules || {};
12
+ const platformName = getNameText(name, i18n.language);
13
+ const displayIcon = showIcon && !!icon;
14
+ const displayLabel = showLabel || !!platformName;
15
+ if (!displayIcon && !displayLabel)
16
+ return null;
17
+ return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsPlatformCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, { children: [displayIcon && (_jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: platformName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: platformName || (_jsx(Box, Object.assign({ component: "span", sx: { opacity: 0.2 } }, { children: "Unavailable" }))) })) })))] })));
18
+ };
19
+ export default memo(TerminalsPlatformCell);
@@ -0,0 +1 @@
1
+ export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';
@@ -0,0 +1 @@
1
+ export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';
@@ -44,5 +44,7 @@ export * from './MarketPlaceCell';
44
44
  export * from './IndividualsCell';
45
45
  export * from './BrandsCell';
46
46
  export * from './SalesChannelCell';
47
+ export * from './TerminalsBrandCell';
48
+ export * from './TerminalsPlatformCell';
47
49
  export * from './type';
48
50
  export * from './style';
@@ -44,5 +44,7 @@ export * from './MarketPlaceCell';
44
44
  export * from './IndividualsCell';
45
45
  export * from './BrandsCell';
46
46
  export * from './SalesChannelCell';
47
+ export * from './TerminalsBrandCell';
48
+ export * from './TerminalsPlatformCell';
47
49
  export * from './type';
48
50
  export * from './style';
@@ -0,0 +1,14 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import Tooltip from '../Tooltip';
3
+ import { type ChipProps } from '../Chip';
4
+ type TooltipChipProps = PropsWithChildren<{
5
+ title: React.ReactNode;
6
+ variant?: ChipProps['variant'];
7
+ slotProps?: {
8
+ tooltip?: React.ComponentProps<typeof Tooltip>;
9
+ chip?: Partial<ChipProps>;
10
+ };
11
+ children: React.ReactNode;
12
+ }>;
13
+ declare const TooltipChip: ({ title, slotProps, children }: TooltipChipProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default TooltipChip;
@@ -0,0 +1,20 @@
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 Tooltip from '../Tooltip';
14
+ import { StyledChip } from './style';
15
+ const TooltipChip = ({ title, slotProps = {}, children }) => {
16
+ const { chip = {}, tooltip = {} } = slotProps;
17
+ const { sx: chipSx } = chip, chipProps = __rest(chip, ["sx"]);
18
+ return (_jsx(Tooltip, Object.assign({}, tooltip, { title: title }, { children: _jsx(StyledChip, Object.assign({}, chipProps, { sx: Object.assign({ height: 24, display: 'inline-flex', color: 'text.primary' }, chipSx) }, { children: children })) })));
19
+ };
20
+ export default TooltipChip;
@@ -0,0 +1 @@
1
+ export { default as TooltipChip } from './TooltipChip';
@@ -0,0 +1 @@
1
+ export { default as TooltipChip } from './TooltipChip';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledChip: import("@emotion/styled").StyledComponent<{
3
+ variant?: import("../Chip").ChipVariant | undefined;
4
+ icon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactDOM | null | undefined;
5
+ } & import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & import("@mui/material/OverridableComponent").CommonProps & 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/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & {
8
+ children?: import("react").ReactNode;
9
+ } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -0,0 +1,7 @@
1
+ import { styled } from '@mui/material/styles';
2
+ import { Chip } from '../Chip';
3
+ export const StyledChip = styled(Chip)(({ theme }) => ({
4
+ color: theme.palette.text.primary,
5
+ '&.CustomVariant_text': { height: 24 },
6
+ display: 'inline-flex',
7
+ }));
@@ -51,15 +51,16 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
51
51
  const { pinnedStartVirtualListRef, scrollableVirtualListRef, pinnedEndVirtualListRef, handleScroll } = useSynchronizedScroll();
52
52
  const [selectedCell, setSelectedCell] = useState(null);
53
53
  const [selectedColumn, setSelectedColumn] = useState(null);
54
- const handleCellClick = useCallback((rowIndex, columnId, event) => {
54
+ const handleCellClick = useCallback((rowIndex, columnId, event, tableViewId) => {
55
55
  event.stopPropagation();
56
- const cellKey = `${rowIndex}-${columnId}`;
56
+ const cellKey = tableViewId ? `${rowIndex}-${columnId}-${tableViewId}` : `${rowIndex}-${columnId}`;
57
57
  setSelectedCell((prev) => (prev === cellKey ? null : cellKey));
58
58
  setSelectedColumn(null);
59
59
  }, []);
60
- const handleColumnClick = useCallback((columnId, event) => {
60
+ const handleColumnClick = useCallback((columnId, event, tableViewId) => {
61
61
  event.stopPropagation();
62
- setSelectedColumn((prev) => (prev === columnId ? null : columnId));
62
+ const columnKey = tableViewId ? `${columnId}-${tableViewId}` : columnId;
63
+ setSelectedColumn((prev) => (prev === columnKey ? null : columnKey));
63
64
  setSelectedCell(null);
64
65
  }, []);
65
66
  const onPointerDown = (e) => {
@@ -1,22 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { type TableHeadProps } from '@mui/material/TableHead';
3
- import type { IColumnProps, IVirtualTable, TablePosition } from '../../../../../types/index.js';
4
- interface SheetViewTableHeaderProps {
5
- columns: IColumnProps[];
6
- headerProps?: TableHeadProps;
7
- columnsSorting?: IVirtualTable['columnsSorting'];
8
- onColumnSort?: IVirtualTable['onColumnSort'];
9
- showBackDrop: boolean;
10
- pinnedColumns?: string[];
11
- onColumnPin?: (columnId: string, position: 'start' | 'end' | 'unpin') => void;
12
- isPinnable?: boolean;
13
- lastColumnId?: string | null;
14
- selectedColumn?: string | null;
15
- onColumnClick?: (columnId: string, event: React.MouseEvent) => void;
16
- tablePosition?: TablePosition;
17
- hasPinnedStart?: boolean;
18
- hasPinnedEnd?: boolean;
19
- }
2
+ import { SheetViewTableHeaderProps } from './type';
20
3
  declare function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns, onColumnPin, isPinnable, lastColumnId, selectedColumn, onColumnClick, }: SheetViewTableHeaderProps): import("react/jsx-runtime").JSX.Element;
21
4
  declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableHeader>;
22
5
  export default _default;
@@ -4,7 +4,8 @@ import { StyledHeader, StyledMUITableRow } from '../../style';
4
4
  import TableCell from './TableCell';
5
5
  function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns = [], onColumnPin, isPinnable = false, lastColumnId, selectedColumn = null, onColumnClick, }) {
6
6
  return (_jsx(StyledHeader, Object.assign({ component: "nav", "data-testid": "SheetViewVirtualTable_TableHeader_StyledHeader", showBackDrop: showBackDrop }, headerProps, { children: _jsx(StyledMUITableRow, Object.assign({ component: "section", "data-testid": "SheetViewVirtualTable_TableHeader_StyledMUITableRow" }, { children: columns.map((column, colIndex) => {
7
- return (_jsx(TableCell, { column: column, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, isDefaultPinned: !!column.isDefaultPinned, isSelected: selectedColumn === column.id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, pinnedColumns: pinnedColumns, onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, onColumnClick: onColumnClick }, `${column.id}-${colIndex}`));
7
+ const columnKey = column.tableViewId ? `${column.id}-${column.tableViewId}` : column.id;
8
+ return (_jsx(TableCell, { column: column, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, isDefaultPinned: !!column.isDefaultPinned, isSelected: selectedColumn === columnKey, onColumnSort: onColumnSort, columnsSorting: columnsSorting, pinnedColumns: pinnedColumns, onColumnPin: onColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, onColumnClick: onColumnClick }, `${column.id}-${colIndex}`));
8
9
  }) })) })));
9
10
  }
10
11
  export default memo(SheetViewTableHeader);
@@ -8,6 +8,6 @@ interface TableCellProps extends Pick<SheetViewTableHeaderProps, 'onColumnSort'
8
8
  isSelected: boolean;
9
9
  isDefaultPinned: boolean;
10
10
  }
11
- declare function TableCell({ column: { header, id, align, headerStyle, sortable, filter, pinnable, width, order }, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, }: TableCellProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function TableCell({ column: { header, id, align, headerStyle, sortable, filter, pinnable, width, order, tableViewId }, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, }: TableCellProps): import("react/jsx-runtime").JSX.Element;
12
12
  declare const _default: import("react").MemoExoticComponent<typeof TableCell>;
13
13
  export default _default;
@@ -6,7 +6,7 @@ import ColumnFilter from '../../../components/ColumnFilter';
6
6
  import { StyledCell } from '../../../components/style';
7
7
  import { PinIconContainer, HeaderText } from '../../style';
8
8
  import ColumnSort from '../../../../VirtualTables/components/ColumnSort';
9
- function TableCell({ column: { header, id, align, headerStyle, sortable, filter, pinnable, width, order }, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, }) {
9
+ function TableCell({ column: { header, id, align, headerStyle, sortable, filter, pinnable, width, order, tableViewId }, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, }) {
10
10
  const [columnFilterEl, setColumnFilterEl] = useState(null);
11
11
  const checkIsPanned = useCallback((columnId) => pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.includes(columnId), [pinnedColumns]);
12
12
  const isPinned = useMemo(() => checkIsPanned(id), [id, checkIsPanned]);
@@ -24,7 +24,7 @@ function TableCell({ column: { header, id, align, headerStyle, sortable, filter,
24
24
  }
25
25
  };
26
26
  return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell", "data-column-id": id, "data-column-width": width, "data-column-width-used": width, "data-column-align": align, "data-column-order": order, "data-column-header": typeof header === 'string' ? header : 'component', "data-column-sortable": !!sortable, "data-column-filterable": !!filter, "data-column-pinned": isPinned, isFirst: isFirst, isLast: isLast, isSheetView: true, onClick: (event) => {
27
- onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, event);
27
+ onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, event, tableViewId);
28
28
  setColumnFilterEl(event.currentTarget);
29
29
  }, sx: (theme) => (Object.assign({ display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width, textAlign: align, overflow: 'unset', cursor: 'pointer', boxSizing: 'border-box', border: isSelected ? '1px solid #1F88D0' : '1px solid #F2F2F2', backgroundColor: isSelected ? '#F2F2F2' : '#FCFCFC', minHeight: isSelected ? '28px' : 'auto', position: 'relative', '&:before': {
30
30
  content: '""',
@@ -35,9 +35,9 @@ function TableCell({ column: { header, id, align, headerStyle, sortable, filter,
35
35
  left: 0,
36
36
  bottom: 0,
37
37
  } }, headerStyle)) }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter && (_jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl, onClose: (event) => {
38
- onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, event);
38
+ onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, event, tableViewId);
39
39
  } }))), sortable && (_jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, onClick: (e) => {
40
- onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, e);
40
+ onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, e, tableViewId);
41
41
  } })), isPinnable && pinnable && !isDefaultPinned && !isLast && (_jsx(PinIconContainer, Object.assign({ onClick: (event) => {
42
42
  event.stopPropagation();
43
43
  handlePinClick(id);
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { TableHeaderProps } from '../../../../VirtualTables/components/TableHeader/type';
3
- import { IColumnProps, IVirtualTable } from '../../../../../types/index.js';
2
+ import { type TableHeadProps } from '@mui/material/TableHead';
3
+ import { IColumnProps, IVirtualTable, TablePosition } from '../../../../../types/index.js';
4
4
  export interface SheetViewTableHeaderProps {
5
5
  columns: IColumnProps[];
6
- headerProps?: TableHeaderProps;
6
+ headerProps?: TableHeadProps;
7
7
  columnsSorting?: IVirtualTable['columnsSorting'];
8
8
  onColumnSort?: IVirtualTable['onColumnSort'];
9
9
  showBackDrop: boolean;
@@ -12,5 +12,8 @@ export interface SheetViewTableHeaderProps {
12
12
  isPinnable?: boolean;
13
13
  lastColumnId?: string | null;
14
14
  selectedColumn?: string | null;
15
- onColumnClick?: (columnId: string, event: React.MouseEvent) => void;
15
+ onColumnClick?: (columnId: string, event: React.MouseEvent, tableViewId?: string) => void;
16
+ tablePosition?: TablePosition;
17
+ hasPinnedStart?: boolean;
18
+ hasPinnedEnd?: boolean;
16
19
  }
@@ -13,7 +13,7 @@ interface ITableRowProps<R = any> {
13
13
  isSheetView?: boolean;
14
14
  selectedCell?: string | null;
15
15
  selectedColumn?: string | null;
16
- onCellClick?: (rowIndex: number, columnId: string, event: React.MouseEvent) => void;
16
+ onCellClick?: (rowIndex: number, columnId: string, event: React.MouseEvent, tableViewId?: string) => void;
17
17
  isLastRow?: boolean;
18
18
  }
19
19
  declare function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell, selectedColumn, onCellClick, isLastRow, }: Readonly<ITableRowProps>): import("react/jsx-runtime").JSX.Element;
@@ -15,9 +15,10 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
15
15
  };
16
16
  const content = useMemo(() => (_jsx(_Fragment, { children: columns.map((column, colIndex) => {
17
17
  const columnIdStr = String(column.id);
18
- const cellKey = `${index}-${columnIdStr}`;
18
+ const cellKey = column.tableViewId ? `${index}-${columnIdStr}-${column.tableViewId}` : `${index}-${columnIdStr}`;
19
19
  const isCellSelected = selectedCell === cellKey;
20
- const isColumnSelected = selectedColumn === columnIdStr;
20
+ const columnKey = column.tableViewId ? `${columnIdStr}-${column.tableViewId}` : columnIdStr;
21
+ const isColumnSelected = selectedColumn === columnKey;
21
22
  const isSelected = isCellSelected || isColumnSelected;
22
23
  const selectionStyles = getSelectionStyles({
23
24
  isSelected,
@@ -33,7 +34,7 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
33
34
  effectiveFirst = isFirstColumn && column.pinned !== 'start';
34
35
  effectiveLast = isLastColumn && column.pinned !== 'end';
35
36
  }
36
- 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) => onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(index, columnIdStr, event), 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: renderCell(column) }), `${column.id}-${colIndex}`));
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) => onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(index, columnIdStr, event, column.tableViewId), 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: renderCell(column) }), `${column.id}-${colIndex}`));
37
38
  }) })), [columns, row, index, selectedCell, selectedColumn, onCellClick, isLastRow]);
38
39
  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));
39
40
  }
@@ -96,3 +96,4 @@ export { default as RangeCalender } from './RangeCalender';
96
96
  export { default as AppServices } from './AppServices';
97
97
  export { default as ScrollLoader } from './ScrollLoader';
98
98
  export * from './ScrollLoader';
99
+ export * from './TooltipChip';
@@ -96,3 +96,4 @@ export { default as RangeCalender } from './RangeCalender';
96
96
  export { default as AppServices } from './AppServices';
97
97
  export { default as ScrollLoader } from './ScrollLoader';
98
98
  export * from './ScrollLoader';
99
+ export * from './TooltipChip';
@@ -1,8 +1,8 @@
1
1
  export declare const terminalsTableCellWidth: {
2
2
  readonly device: {
3
- readonly default: "180px";
4
- readonly text: "180px";
5
- readonly sheet: "180px";
3
+ readonly default: "120px";
4
+ readonly text: "120px";
5
+ readonly sheet: "120px";
6
6
  };
7
7
  readonly terminalId: {
8
8
  readonly default: "100px";
@@ -1,8 +1,8 @@
1
1
  export const terminalsTableCellWidth = {
2
2
  device: {
3
- default: '180px',
4
- text: '180px',
5
- sheet: '180px',
3
+ default: '120px',
4
+ text: '120px',
5
+ sheet: '120px',
6
6
  },
7
7
  terminalId: {
8
8
  default: '100px',
@@ -78,8 +78,6 @@ export interface Segment {
78
78
  };
79
79
  };
80
80
  };
81
- is_business_segment?: boolean;
82
- is_segment_has_more_than_one_merchant?: boolean;
83
81
  }
84
82
  interface SegmentUserName {
85
83
  first: string;
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.15",
5
- "testVersion": 0,
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.17",
5
+ "testVersion": 0,
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
+ }