@tap-payments/os-micro-frontend-shared 0.0.273-test.11 → 0.0.273-test.12

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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { BoxProps } from '@mui/material';
3
- declare function CustomBackdrop(props: BoxProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function CustomBackdrop(props: BoxProps): import("react").ReactPortal;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof CustomBackdrop>;
5
5
  export default _default;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
+ import ReactDOM from 'react-dom';
3
4
  import { CustomBackdropStyled } from './style';
4
5
  function CustomBackdrop(props) {
5
- return _jsx(CustomBackdropStyled, Object.assign({}, props));
6
+ return ReactDOM.createPortal(_jsx(CustomBackdropStyled, Object.assign({}, props)), document.body);
6
7
  }
7
8
  export default memo(CustomBackdrop);
@@ -5,5 +5,5 @@ export const CustomBackdropStyled = styled(Box)(() => ({
5
5
  bottom: 0,
6
6
  right: 0,
7
7
  left: 0,
8
- zIndex: 2,
8
+ zIndex: 999,
9
9
  }));
@@ -8,17 +8,8 @@ import { PinIconContainer, HeaderText } from '../../style';
8
8
  import ColumnSort from '../../../../VirtualTable/components/ColumnSort';
9
9
  function TableCell({ column: { header, id, align, headerStyle, sortable, filter, pinnable, width, order }, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, }) {
10
10
  const [columnFilterEl, setColumnFilterEl] = useState(null);
11
- const [anchorEl, setAnchorEl] = useState(null);
12
- const open = Boolean(anchorEl);
13
11
  const checkIsPanned = useCallback((columnId) => pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.includes(columnId), [pinnedColumns]);
14
12
  const isPinned = useMemo(() => checkIsPanned(id), [id, checkIsPanned]);
15
- const handleClose = () => {
16
- setAnchorEl(null);
17
- };
18
- const handleClick = (event) => {
19
- event.stopPropagation();
20
- setAnchorEl(event.currentTarget);
21
- };
22
13
  const handlePinClick = (columnId) => {
23
14
  if (checkIsPanned(columnId)) {
24
15
  onColumnPin === null || onColumnPin === void 0 ? void 0 : onColumnPin(columnId, 'unpin');
@@ -32,14 +23,6 @@ function TableCell({ column: { header, id, align, headerStyle, sortable, filter,
32
23
  }
33
24
  }
34
25
  };
35
- const handleSortingOption = (columnId, columnOrder) => {
36
- if (columnId) {
37
- onColumnSort === null || onColumnSort === void 0 ? void 0 : onColumnSort({
38
- [columnId]: columnOrder,
39
- });
40
- handleClose();
41
- }
42
- };
43
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) => {
44
27
  onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, event);
45
28
  setColumnFilterEl(event.currentTarget);
@@ -53,8 +53,6 @@ function ColumnFilter(filter) {
53
53
  }, [open, filter, anchorEl, setAnchorEl]);
54
54
  return (_jsxs(_Fragment, { children: [showClearIcon ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 }, onClick: openDropdown }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: () => {
55
55
  filter.onClear(filterApiKeys);
56
- } })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { cursor: 'pointer', marginTop: '2px' }, onClick: openDropdown })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start", sx: {
57
- zIndex: 9999,
58
- } }, { children: renderFilter }))] }));
56
+ } })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { cursor: 'pointer', marginTop: '2px' }, onClick: openDropdown })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start" }, { children: renderFilter }))] }));
59
57
  }
60
58
  export default memo(ColumnFilter);
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.0.273-test.11",
5
- "testVersion": 11,
4
+ "version": "0.0.273-test.12",
5
+ "testVersion": 12,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",