@tap-payments/os-micro-frontend-shared 0.1.367-test.4 → 0.1.367-test.5
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 +1 -2
- 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 +1 -2
- package/build/components/AppWindowWrapper/headers/AccountHeader/type.d.ts +1 -2
- package/build/components/Toolbar/Toolbar.js +1 -1
- package/build/types/apps.d.ts +6 -5
- package/build/types/table.d.ts +1 -4
- package/build/types/tsUtils.d.ts +4 -0
- package/build/utils/navigation.d.ts +1 -1
- package/package.json +2 -2
|
@@ -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
|
|
3
|
+
declare function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton }: 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 }) {
|
|
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
|
|
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);
|
|
81
81
|
}
|
|
82
82
|
export default memo(Window);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface WindowProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
titleBar?: React.ReactNode;
|
|
@@ -6,5 +6,4 @@ export interface WindowProps {
|
|
|
6
6
|
mainAppIsMinimized?: boolean;
|
|
7
7
|
mainAppOrder?: number;
|
|
8
8
|
showSectionsButton?: boolean;
|
|
9
|
-
rightActions?: ReactNode;
|
|
10
9
|
}
|
|
@@ -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,
|
|
3
|
+
declare function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, }: 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, }) {
|
|
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 }) })));
|
|
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,
|
|
3
|
+
declare function AccountHeaderTitle({ title, onClose, onMaximize, maximized, id, onRequestClick, isSidebarExpanded, isHovered, onMouseHover, onMouseLeave, showSectionsButton, }: 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: "Sections" })))] })
|
|
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: "Sections" })))] }) }) })));
|
|
9
9
|
}
|
|
10
10
|
export default memo(AccountHeaderTitle);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { BoxProps } from '@mui/material/Box';
|
|
3
3
|
export interface AccountHeaderTitleProps extends BoxProps {
|
|
4
4
|
title: string;
|
|
@@ -11,5 +11,4 @@ export interface AccountHeaderTitleProps extends BoxProps {
|
|
|
11
11
|
isHovered?: boolean;
|
|
12
12
|
onMouseHover?: (e: SyntheticEvent) => void;
|
|
13
13
|
showSectionsButton?: boolean;
|
|
14
|
-
rightActions?: ReactNode;
|
|
15
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch,
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
export interface AccountHeaderProps {
|
|
3
3
|
isSidebarExpanded: boolean;
|
|
4
4
|
setIsSidebarExpanded: (value: boolean) => void;
|
|
@@ -9,5 +9,4 @@ export interface AccountHeaderProps {
|
|
|
9
9
|
onClose?: () => void;
|
|
10
10
|
title?: string;
|
|
11
11
|
showSectionsButton?: boolean;
|
|
12
|
-
rightActions?: ReactNode;
|
|
13
12
|
}
|
|
@@ -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("div", {})] })) })));
|
|
19
19
|
}
|
|
20
20
|
export default memo(Toolbar);
|
package/build/types/apps.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import type { i18n } from 'i18next';
|
|
|
4
4
|
import { Theme } from '@mui/material';
|
|
5
5
|
import { CalenderMode } from './theme';
|
|
6
6
|
import { Timezone } from './appConfig';
|
|
7
|
-
import { Brand, Entity, TableMode } from './index.js';
|
|
7
|
+
import { Brand, Entity, Override, TableMode } from './index.js';
|
|
8
8
|
import { TextAndLang } from './common';
|
|
9
|
-
export type AppPayload<TServiceCodes extends string = string> = {
|
|
9
|
+
export type AppPayload<TServiceCodes extends string = string, TOverrides extends Partial<DefaultServicePayload> = object> = {
|
|
10
10
|
services: {
|
|
11
|
-
[key in TServiceCodes]?: ServicePayload
|
|
11
|
+
[key in TServiceCodes]?: ServicePayload<TOverrides>;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type DefaultServicePayload = {
|
|
15
15
|
columnFilters?: Record<string, any>;
|
|
16
16
|
filteredIds?: string[];
|
|
17
17
|
dateRange?: [Date, Date];
|
|
@@ -21,7 +21,8 @@ export interface ServicePayload {
|
|
|
21
21
|
tableViews?: ColumnsView[];
|
|
22
22
|
calendarTimezone?: number;
|
|
23
23
|
reportTypes?: string[];
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
|
+
export type ServicePayload<TOverrides extends Partial<DefaultServicePayload> = object> = Override<DefaultServicePayload, TOverrides>;
|
|
25
26
|
export interface AppDetails {
|
|
26
27
|
id: string;
|
|
27
28
|
appCode: string;
|
package/build/types/table.d.ts
CHANGED
|
@@ -142,10 +142,7 @@ export interface IVirtualTable<R = any> {
|
|
|
142
142
|
footerComponent?: React.ReactNode;
|
|
143
143
|
customNoDataComponent?: React.ReactNode;
|
|
144
144
|
}
|
|
145
|
-
export type ColumnFilterValues = Record<string,
|
|
146
|
-
phone: string;
|
|
147
|
-
country: Country | undefined;
|
|
148
|
-
}>;
|
|
145
|
+
export type ColumnFilterValues = Record<string, any>;
|
|
149
146
|
export type IColumnFilter = ({
|
|
150
147
|
onConfirm?: (filterValues: ColumnFilterValues) => void;
|
|
151
148
|
onClear: (apiKeys: string[]) => void;
|
package/build/types/tsUtils.d.ts
CHANGED
|
@@ -6,3 +6,7 @@ export type PartialExcept<T, K extends keyof T> = Partial<Omit<T, K>> & Pick<T,
|
|
|
6
6
|
export type DeepPartial<T> = {
|
|
7
7
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
8
8
|
};
|
|
9
|
+
export type GeneralObject = Record<string, any>;
|
|
10
|
+
export type DeepExtendableObject<T> = T extends (...args: any[]) => any ? T : T extends readonly (infer U)[] ? ReadonlyArray<DeepExtendableObject<U>> : T extends GeneralObject ? {
|
|
11
|
+
[K in keyof T]: DeepExtendableObject<T[K]>;
|
|
12
|
+
} & GeneralObject : T;
|
|
@@ -6,7 +6,7 @@ export declare const openNewAppAttrs: ({ appCode, serviceCode, sandboxMode, payl
|
|
|
6
6
|
numberOfOpenedApps: number;
|
|
7
7
|
segmentId: string;
|
|
8
8
|
}) => {
|
|
9
|
-
payload?: (Record<string, any> & import("../types/index.js").
|
|
9
|
+
payload?: (Record<string, any> & Omit<import("../types/index.js").DefaultServicePayload, never> & object) | undefined;
|
|
10
10
|
segmentId: string;
|
|
11
11
|
appCode: string;
|
|
12
12
|
serviceCode: string;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.367-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.367-test.5",
|
|
5
|
+
"testVersion": 5,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|