@tap-payments/os-micro-frontend-shared 0.1.369 → 0.1.371
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/AppWindowWrapper/AppWindow/AppWindow.d.ts +1 -1
- package/build/components/AppWindowWrapper/AppWindow/AppWindow.js +2 -2
- package/build/components/AppWindowWrapper/AppWindow/type.d.ts +2 -0
- package/build/components/AppWindowWrapper/headers/AccountHeader/AccountHeader.d.ts +1 -1
- package/build/components/AppWindowWrapper/headers/AccountHeader/AccountHeader.js +2 -2
- package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/AccountHeaderTitle.d.ts +1 -1
- package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/AccountHeaderTitle.js +2 -2
- package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/type.d.ts +3 -2
- package/build/components/AppWindowWrapper/headers/AccountHeader/type.d.ts +2 -1
- package/build/components/TableHeader/TableView/CustomViews.js +1 -1
- package/build/components/Toolbar/Toolbar.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WindowProps } from './type';
|
|
3
|
-
declare function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton }: WindowProps): import("react").ReactPortal;
|
|
3
|
+
declare function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton, rightActions }: WindowProps): import("react").ReactPortal;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof Window>;
|
|
5
5
|
export default _default;
|
|
@@ -9,7 +9,7 @@ import { AppWindowContext } from '../context';
|
|
|
9
9
|
import { isSafariBrowser } from '../../../utils/index.js';
|
|
10
10
|
import { animationDuration } from './constant';
|
|
11
11
|
import AccountHeader from '../headers/AccountHeader';
|
|
12
|
-
function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton = true }) {
|
|
12
|
+
function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton = true, rightActions }) {
|
|
13
13
|
const windowNodeRef = useRef(null);
|
|
14
14
|
const { dimensions, position, resizableRef, isMaximized, isOpen, onClose, viewerDefaultWidth, viewerDefaultHeight, windowZIndex, setPosition, setNewDimensions, isToolbarAnimationDisabled, fullWindowWidth, fullWindowHeight, setIsMaximized, setIsResized, isResized, setIsToolbarAnimationDisabled, setIsSidebarExpanded, isSidebarExpanded, } = useContext(AppWindowContext);
|
|
15
15
|
const isSafari = isSafariBrowser();
|
|
@@ -77,6 +77,6 @@ function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinim
|
|
|
77
77
|
position: 'relative',
|
|
78
78
|
})) }, { children: _jsxs(Box, Object.assign({ sx: {
|
|
79
79
|
height: '100%',
|
|
80
|
-
}, "data-testid": "AppWindow" }, { children: [titleBar !== null && titleBar !== void 0 ? titleBar : (_jsx(AccountHeader, { setIsToolbarAnimationDisabled: setIsToolbarAnimationDisabled, onClose: onClose, setIsMaximized: setIsMaximized, isToolbarAnimationDisabled: isToolbarAnimationDisabled, setIsSidebarExpanded: setIsSidebarExpanded, isSidebarExpanded: isSidebarExpanded, title: titleBarText, isMaximized: isMaximized, showSectionsButton: showSectionsButton })), children] })) })) })) })), document.body);
|
|
80
|
+
}, "data-testid": "AppWindow" }, { children: [titleBar !== null && titleBar !== void 0 ? titleBar : (_jsx(AccountHeader, { setIsToolbarAnimationDisabled: setIsToolbarAnimationDisabled, onClose: onClose, setIsMaximized: setIsMaximized, isToolbarAnimationDisabled: isToolbarAnimationDisabled, setIsSidebarExpanded: setIsSidebarExpanded, isSidebarExpanded: isSidebarExpanded, title: titleBarText, isMaximized: isMaximized, showSectionsButton: showSectionsButton, rightActions: rightActions })), children] })) })) })) })), document.body);
|
|
81
81
|
}
|
|
82
82
|
export default memo(Window);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
2
3
|
export interface WindowProps {
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
titleBar?: React.ReactNode;
|
|
@@ -6,4 +7,5 @@ export interface WindowProps {
|
|
|
6
7
|
mainAppIsMinimized?: boolean;
|
|
7
8
|
mainAppOrder?: number;
|
|
8
9
|
showSectionsButton?: boolean;
|
|
10
|
+
rightActions?: ReactNode;
|
|
9
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AccountHeaderProps } from './type';
|
|
3
|
-
declare function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, }: AccountHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, rightActions, }: AccountHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof AccountHeader>;
|
|
5
5
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import { motion } from 'framer-motion';
|
|
|
4
4
|
import { useMouseState } from '../../../../hooks/index.js';
|
|
5
5
|
import AccountHeaderTitle from './components/AccountHeaderTitle';
|
|
6
6
|
import { animationDuration } from '../../AppWindow/constant';
|
|
7
|
-
function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, }) {
|
|
7
|
+
function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, rightActions, }) {
|
|
8
8
|
const { isHovered, onMouseEnter, onMouseLeave } = useMouseState();
|
|
9
9
|
return (_jsx(motion.div, Object.assign({ style: Object.assign({}, (isMaximized && {
|
|
10
10
|
height: 0,
|
|
@@ -26,6 +26,6 @@ function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximi
|
|
|
26
26
|
}, maximized: isMaximized, id: "draggable-dialog-title", onRequestClick: () => {
|
|
27
27
|
setIsToolbarAnimationDisabled === null || setIsToolbarAnimationDisabled === void 0 ? void 0 : setIsToolbarAnimationDisabled(false);
|
|
28
28
|
setIsSidebarExpanded(!isSidebarExpanded);
|
|
29
|
-
}, isSidebarExpanded: isSidebarExpanded, isHovered: isHovered, onMouseHover: onMouseEnter, onMouseLeave: onMouseLeave }) })));
|
|
29
|
+
}, isSidebarExpanded: isSidebarExpanded, isHovered: isHovered, onMouseHover: onMouseEnter, onMouseLeave: onMouseLeave, rightActions: rightActions }) })));
|
|
30
30
|
}
|
|
31
31
|
export default memo(AccountHeader);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AccountHeaderTitleProps } from './type';
|
|
3
|
-
declare function AccountHeaderTitle({ title, onClose, onMaximize, maximized, id, onRequestClick, isSidebarExpanded, isHovered, onMouseHover, onMouseLeave, showSectionsButton, }: Readonly<AccountHeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function AccountHeaderTitle({ title, onClose, onMaximize, maximized, id, onRequestClick, isSidebarExpanded, isHovered, onMouseHover, onMouseLeave, showSectionsButton, rightActions, }: Readonly<AccountHeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof AccountHeaderTitle>;
|
|
5
5
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import Toolbar from '../../../../../Toolbar';
|
|
|
4
4
|
import { StyledHeaderWrapperStyled } from '../../../../../Toolbar/style';
|
|
5
5
|
import { CloseIcon, ExpandButton, MaximizeIcon } from '../../../../../ToolbarIcon';
|
|
6
6
|
import { teamWindowIcon } from '../../../../../../constants/index.js';
|
|
7
|
-
function AccountHeaderTitle({ title, onClose, onMaximize, maximized = false, id, onRequestClick, isSidebarExpanded = false, isHovered = false, onMouseHover, onMouseLeave, showSectionsButton, }) {
|
|
8
|
-
return (_jsx(StyledHeaderWrapperStyled, Object.assign({ id: id, "data-testid": "UserTitleBar", maximized: maximized || false }, { children: _jsx(Toolbar, { onMouseEnter: onMouseHover, onMouseLeave: onMouseLeave, isMaximized: maximized, isHovered: isHovered, title: title, icon: teamWindowIcon, leftActions: _jsxs(_Fragment, { children: [_jsx(CloseIcon, { onClick: onClose }), _jsx(MaximizeIcon, { isMaximized: maximized, onClick: onMaximize }), showSectionsButton && (_jsx(ExpandButton, Object.assign({ onClick: onRequestClick, isExpanded: isSidebarExpanded, isHovered: isHovered }, { children: "
|
|
7
|
+
function AccountHeaderTitle({ title, onClose, onMaximize, maximized = false, id, onRequestClick, isSidebarExpanded = false, isHovered = false, onMouseHover, onMouseLeave, showSectionsButton, rightActions, }) {
|
|
8
|
+
return (_jsx(StyledHeaderWrapperStyled, Object.assign({ id: id, "data-testid": "UserTitleBar", maximized: maximized || false }, { children: _jsx(Toolbar, { onMouseEnter: onMouseHover, onMouseLeave: onMouseLeave, isMaximized: maximized, isHovered: isHovered, title: title, icon: teamWindowIcon, leftActions: _jsxs(_Fragment, { children: [_jsx(CloseIcon, { onClick: onClose }), _jsx(MaximizeIcon, { isMaximized: maximized, onClick: onMaximize }), showSectionsButton && (_jsx(ExpandButton, Object.assign({ onClick: onRequestClick, isExpanded: !isSidebarExpanded, isHovered: isHovered }, { children: "Sidebar" })))] }), rightActions: rightActions }) })));
|
|
9
9
|
}
|
|
10
10
|
export default memo(AccountHeaderTitle);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SyntheticEvent } from 'react';
|
|
2
|
-
import { BoxProps } from '@mui/material/Box';
|
|
1
|
+
import type { ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import type { BoxProps } from '@mui/material/Box';
|
|
3
3
|
export interface AccountHeaderTitleProps extends BoxProps {
|
|
4
4
|
title: string;
|
|
5
5
|
onClose?: (e: SyntheticEvent) => void;
|
|
@@ -11,4 +11,5 @@ export interface AccountHeaderTitleProps extends BoxProps {
|
|
|
11
11
|
isHovered?: boolean;
|
|
12
12
|
onMouseHover?: (e: SyntheticEvent) => void;
|
|
13
13
|
showSectionsButton?: boolean;
|
|
14
|
+
rightActions?: ReactNode;
|
|
14
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
1
|
+
import type { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
export interface AccountHeaderProps {
|
|
3
3
|
isSidebarExpanded: boolean;
|
|
4
4
|
setIsSidebarExpanded: (value: boolean) => void;
|
|
@@ -9,4 +9,5 @@ export interface AccountHeaderProps {
|
|
|
9
9
|
onClose?: () => void;
|
|
10
10
|
title?: string;
|
|
11
11
|
showSectionsButton?: boolean;
|
|
12
|
+
rightActions?: ReactNode;
|
|
12
13
|
}
|
|
@@ -16,6 +16,6 @@ function CustomViews({ open, onSelect, setTableViews, tableViews, anchorEl, onCl
|
|
|
16
16
|
setTableViews,
|
|
17
17
|
});
|
|
18
18
|
const { subMenuAnchorEl, openSubMenuName, handleSubMenuClose, handleSubMenuOpen, handleMenuScroll } = useSubMenu(open, onClose);
|
|
19
|
-
return (_jsxs(DropdownStyled, Object.assign({ "data-testid": "TableView_CustomViews" }, { children: [_jsxs(ButtonStyled, Object.assign({ "data-testid": "TableView_CustomViews_Button", onClick: onSelect }, { children: [_jsx("div", { children: t('columns') }), _jsx("img", { src: downArrowIcon, alt: "arrow", style: Object.assign({}, (Boolean(open) && { transform: 'rotate(180deg)' })) })] })), _jsxs(Menu, Object.assign({ open: open, anchorEl: anchorEl, "data-testid": "TableView_CustomViews_Popper", sx: { padding: 0, marginTop: '8px', borderRadius: 1 } }, { children: [open && _jsx(CustomBackdrop, { onClick: onClose }), _jsx(ListStyled, Object.assign({ component: "article", "data-testid": "TableView_CustomViews_List" }, { children: _jsx(Reorder.Group, Object.assign({ as: "div", axis: "y", onReorder: reorderColumns, values: columnNames,
|
|
19
|
+
return (_jsxs(DropdownStyled, Object.assign({ "data-testid": "TableView_CustomViews" }, { children: [_jsxs(ButtonStyled, Object.assign({ "data-testid": "TableView_CustomViews_Button", onClick: onSelect }, { children: [_jsx("div", { children: t('columns') }), _jsx("img", { src: downArrowIcon, alt: "arrow", style: Object.assign({}, (Boolean(open) && { transform: 'rotate(180deg)' })) })] })), _jsxs(Menu, Object.assign({ open: open, anchorEl: anchorEl, "data-testid": "TableView_CustomViews_Popper", sx: { padding: 0, marginTop: '8px', borderRadius: 1 } }, { children: [open && _jsx(CustomBackdrop, { onClick: onClose }), _jsx(ListStyled, Object.assign({ component: "article", "data-testid": "TableView_CustomViews_List" }, { children: _jsx(Reorder.Group, Object.assign({ as: "div", axis: "y", onReorder: reorderColumns, values: columnNames, onScroll: handleMenuScroll }, { children: columns.map((column, index) => (_jsx(ColumnItem, { column: column, index: index, openSubMenuName: openSubMenuName, subMenuAnchorEl: subMenuAnchorEl, toggleColumnSelection: toggleColumnSelection, toggleSubmenuItem: toggleSubmenuItem, handleSubMenuOpen: handleSubMenuOpen, handleSubMenuClose: handleSubMenuClose }, column.name))) })) }))] }))] })));
|
|
20
20
|
}
|
|
21
21
|
export default memo(CustomViews);
|
|
@@ -15,6 +15,6 @@ import { ToolbarStyled, StyledBox, ActionsBox } from './style';
|
|
|
15
15
|
import WindowAppIcon from '../WindowAppIcon';
|
|
16
16
|
function Toolbar(_a) {
|
|
17
17
|
var { onMouseEnter, onMouseLeave, isMaximized, isHovered, children, rightActions, leftActions, title, icon } = _a, props = __rest(_a, ["onMouseEnter", "onMouseLeave", "isMaximized", "isHovered", "children", "rightActions", "leftActions", "title", "icon"]);
|
|
18
|
-
return (_jsx(ToolbarStyled, Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, maximized: isMaximized, id: "toolbar", isHovered: isHovered }, props, { children: _jsxs(StyledBox, Object.assign({ className: "toolbar-wrapper" }, { children: [leftActions ? _jsx(ActionsBox, Object.assign({ className: "action-box" }, { children: leftActions })) : _jsx("div", {}), _jsx(WindowAppIcon, { title: title, icon: icon }), rightActions
|
|
18
|
+
return (_jsx(ToolbarStyled, Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, maximized: isMaximized, id: "toolbar", isHovered: isHovered }, props, { children: _jsxs(StyledBox, Object.assign({ className: "toolbar-wrapper" }, { children: [leftActions ? _jsx(ActionsBox, Object.assign({ className: "action-box" }, { children: leftActions })) : _jsx("div", {}), _jsx(WindowAppIcon, { title: title, icon: icon }), rightActions ? _jsx(ActionsBox, Object.assign({ className: "action-box" }, { children: rightActions })) : _jsx("div", {})] })) })));
|
|
19
19
|
}
|
|
20
20
|
export default memo(Toolbar);
|
package/package.json
CHANGED