@tap-payments/os-micro-frontend-shared 0.1.96-test.6 → 0.1.96-test.7
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/AppServices/AppServices.d.ts +2 -1
- package/build/components/AppServices/AppServices.js +1 -3
- package/build/components/AppServicesBar/AppServicesBar.d.ts +5 -3
- package/build/components/AppServicesBar/AppServicesBar.js +3 -6
- package/build/types/apps.d.ts +2 -1
- package/package.json +2 -2
|
@@ -9,8 +9,9 @@ interface AppServicesProps extends Pick<ServiceItemProps, 'onClickServiceItem'>
|
|
|
9
9
|
dimensions: {
|
|
10
10
|
width: string | number;
|
|
11
11
|
};
|
|
12
|
+
pathname: string;
|
|
12
13
|
onChangeServiceCode?: (serviceCode: string) => void;
|
|
13
14
|
}
|
|
14
|
-
declare function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, onChangeServiceCode, onClickServiceItem, }: Readonly<AppServicesProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, pathname, onChangeServiceCode, onClickServiceItem, }: Readonly<AppServicesProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
declare const _default: React.MemoExoticComponent<typeof AppServices>;
|
|
16
17
|
export default _default;
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { memo, useEffect, useRef, useState, useMemo } from 'react';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useLocation } from 'react-router';
|
|
6
5
|
import { StyledIconForDropDown, StyledMenuTitle, StyledOption, StyledSelect, StyledSelectComponent } from '../index.js';
|
|
7
6
|
import { APP_CODES, blackHeadingDownArrow, blueHeadingDropdownArrow } from '../../constants/index.js';
|
|
8
7
|
import { getNameText } from '../../utils/index.js';
|
|
@@ -11,13 +10,12 @@ import { Wrapper } from './style';
|
|
|
11
10
|
const selectedIcon = (props) => {
|
|
12
11
|
return (_jsx(StyledIconForDropDown, { src: props.className.includes('MuiSelect-iconOpen') ? blueHeadingDropdownArrow : blackHeadingDownArrow, alt: "dropdown" }));
|
|
13
12
|
};
|
|
14
|
-
function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, onChangeServiceCode, onClickServiceItem, }) {
|
|
13
|
+
function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, pathname, onChangeServiceCode, onClickServiceItem, }) {
|
|
15
14
|
const [initServicesWidth, setInitServicesWidth] = useState(0);
|
|
16
15
|
const [isDropdown, setIsDropdown] = useState(false);
|
|
17
16
|
const [selectedOption, setSelectedOption] = useState('');
|
|
18
17
|
const servicesRef = useRef(null);
|
|
19
18
|
const [openDropdown, setOpenDropdown] = React.useState(false);
|
|
20
|
-
const pathname = useLocation();
|
|
21
19
|
const { i18n } = useTranslation();
|
|
22
20
|
const servicesList = useMemo(() => {
|
|
23
21
|
var _a;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DragControls } from 'framer-motion';
|
|
3
3
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
-
import {
|
|
4
|
+
import { AppService } from '../../types/index.js';
|
|
5
5
|
export interface AppServicesBarProps {
|
|
6
|
-
|
|
6
|
+
appCode: string;
|
|
7
|
+
services: AppService[];
|
|
7
8
|
isMaximized: boolean;
|
|
8
9
|
dimensions: {
|
|
9
10
|
width: number | string;
|
|
@@ -15,10 +16,11 @@ export interface AppServicesBarProps {
|
|
|
15
16
|
ui: {
|
|
16
17
|
onStartDrag: DragControls['start'];
|
|
17
18
|
};
|
|
19
|
+
pathname: string;
|
|
18
20
|
onChangeServiceCode: (serviceCode: string) => void;
|
|
19
21
|
onClickServiceItem: (code: string) => void;
|
|
20
22
|
sx?: SxProps<Theme>;
|
|
21
23
|
}
|
|
22
|
-
declare function AppServicesBar({
|
|
24
|
+
declare function AppServicesBar({ appCode, services, isMaximized, dimensions, features: { initialServiceCode }, ui: { onStartDrag }, pathname, onChangeServiceCode, onClickServiceItem, sx, }: Readonly<AppServicesBarProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
23
25
|
declare const _default: import("react").MemoExoticComponent<typeof AppServicesBar>;
|
|
24
26
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useCallback, useState } from 'react';
|
|
3
3
|
import { AppServices } from '../index.js';
|
|
4
4
|
import { StyledAppHeaderWrapper } from '../Toolbar/style';
|
|
5
|
-
function AppServicesBar({
|
|
5
|
+
function AppServicesBar({ appCode, services, isMaximized, dimensions, features: { initialServiceCode }, ui: { onStartDrag }, pathname, onChangeServiceCode, onClickServiceItem, sx, }) {
|
|
6
6
|
const [isDragging, setIsDragging] = useState(false);
|
|
7
7
|
const onPointerDown = useCallback((e) => {
|
|
8
8
|
onStartDrag === null || onStartDrag === void 0 ? void 0 : onStartDrag(e);
|
|
@@ -11,11 +11,8 @@ function AppServicesBar({ app, isMaximized, dimensions, features: { initialServi
|
|
|
11
11
|
const onPointerUp = () => {
|
|
12
12
|
setIsDragging(false);
|
|
13
13
|
};
|
|
14
|
-
if (!
|
|
14
|
+
if (!appCode || !services.length)
|
|
15
15
|
return null;
|
|
16
|
-
|
|
17
|
-
if (!services.length)
|
|
18
|
-
return null;
|
|
19
|
-
return (_jsx(StyledAppHeaderWrapper, Object.assign({ id: "app-header-wrapper", onPointerDown: onPointerDown, onPointerUp: onPointerUp, isDragging: isDragging, sx: sx }, { children: _jsx(AppServices, { onClickServiceItem: onClickServiceItem, dimensions: { width: dimensions.width }, serviceCode: initialServiceCode !== null && initialServiceCode !== void 0 ? initialServiceCode : '', services: services, isMaximized: isMaximized, appCode: app.code, onChangeServiceCode: onChangeServiceCode }) })));
|
|
16
|
+
return (_jsx(StyledAppHeaderWrapper, Object.assign({ id: "app-header-wrapper", onPointerDown: onPointerDown, onPointerUp: onPointerUp, isDragging: isDragging, sx: sx }, { children: _jsx(AppServices, { onClickServiceItem: onClickServiceItem, dimensions: { width: dimensions.width }, serviceCode: initialServiceCode !== null && initialServiceCode !== void 0 ? initialServiceCode : '', services: services, isMaximized: isMaximized, appCode: appCode, onChangeServiceCode: onChangeServiceCode, pathname: pathname }) })));
|
|
20
17
|
}
|
|
21
18
|
export default memo(AppServicesBar);
|
package/build/types/apps.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Segment, SegmentCountry, TextAndLang } from './user';
|
|
|
3
3
|
import { BusinessMerchant } from './merchant';
|
|
4
4
|
import type { i18n } from 'i18next';
|
|
5
5
|
import type { DragControls } from 'framer-motion';
|
|
6
|
+
import type { Location } from 'react-router-dom';
|
|
6
7
|
import { Theme } from '@mui/material';
|
|
7
8
|
import { CalenderMode } from './theme';
|
|
8
9
|
import { Timezone } from './appConfig';
|
|
@@ -96,6 +97,7 @@ export type MFWidgetBaseProps = {
|
|
|
96
97
|
onSwitch: (mode: CalenderMode) => void;
|
|
97
98
|
};
|
|
98
99
|
navigation: {
|
|
100
|
+
location: Location;
|
|
99
101
|
openAppService: (navigation: {
|
|
100
102
|
id?: string;
|
|
101
103
|
appId?: string;
|
|
@@ -106,7 +108,6 @@ export type MFWidgetBaseProps = {
|
|
|
106
108
|
openApp: (app: Pick<AppDetails, 'appCode' | 'serviceCode' | 'payload'> & {
|
|
107
109
|
sandboxMode?: boolean;
|
|
108
110
|
}) => void;
|
|
109
|
-
modifyAppServiceCode: ({ id, serviceCode, appCode }: Pick<AppDetails, 'id' | 'serviceCode' | 'appCode'>) => void;
|
|
110
111
|
};
|
|
111
112
|
timezone: {
|
|
112
113
|
current?: Timezone | null;
|
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.96-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.96-test.7",
|
|
5
|
+
"testVersion": 7,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|