@tap-payments/os-micro-frontend-shared 0.1.150 → 0.1.151

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 (21) hide show
  1. package/build/components/AppServices/AppServices.d.ts +1 -2
  2. package/build/components/AppServices/AppServices.js +4 -11
  3. package/build/components/AppServicesBar/AppServicesBar.js +1 -1
  4. package/build/components/TableCells/CustomCells/index.d.ts +0 -1
  5. package/build/components/TableCells/CustomCells/index.js +0 -1
  6. package/build/components/TableCells/SheetViewCells/PaymentAgreementCell/PaymentAgreementCell.d.ts +13 -0
  7. package/build/components/TableCells/{CustomCells/PaymentAgreementCell/PaymentAgreementCellSheet.js → SheetViewCells/PaymentAgreementCell/PaymentAgreementCell.js} +8 -3
  8. package/build/components/TableCells/SheetViewCells/PaymentAgreementCell/index.d.ts +1 -0
  9. package/build/components/TableCells/SheetViewCells/PaymentAgreementCell/index.js +1 -0
  10. package/build/components/TableCells/SheetViewCells/index.d.ts +1 -0
  11. package/build/components/TableCells/SheetViewCells/index.js +1 -0
  12. package/build/components/TableCells/index.d.ts +1 -0
  13. package/build/components/TableCells/index.js +1 -0
  14. package/package.json +2 -2
  15. package/build/components/TableCells/CustomCells/PaymentAgreementCell/PaymentAgreementCellSheet.d.ts +0 -3
  16. package/build/components/TableCells/CustomCells/PaymentAgreementCell/constant.d.ts +0 -6
  17. package/build/components/TableCells/CustomCells/PaymentAgreementCell/constant.js +0 -6
  18. package/build/components/TableCells/CustomCells/PaymentAgreementCell/index.d.ts +0 -1
  19. package/build/components/TableCells/CustomCells/PaymentAgreementCell/index.js +0 -1
  20. package/build/components/TableCells/CustomCells/PaymentAgreementCell/type.d.ts +0 -6
  21. package/build/components/TableCells/CustomCells/PaymentAgreementCell/type.js +0 -1
@@ -5,12 +5,11 @@ interface AppServicesProps extends Pick<ServiceItemProps, 'onClickServiceItem'>
5
5
  serviceCode: string;
6
6
  services: AppService[];
7
7
  isMaximized: boolean;
8
- appCode: string;
9
8
  dimensions: {
10
9
  width: string | number;
11
10
  };
12
11
  onChangeServiceCode?: (serviceCode: string) => void;
13
12
  }
14
- declare function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, onChangeServiceCode, onClickServiceItem, }: Readonly<AppServicesProps>): import("react/jsx-runtime").JSX.Element;
13
+ declare function AppServices({ isMaximized, serviceCode, dimensions, services, onChangeServiceCode, onClickServiceItem }: Readonly<AppServicesProps>): import("react/jsx-runtime").JSX.Element;
15
14
  declare const _default: React.MemoExoticComponent<typeof AppServices>;
16
15
  export default _default;
@@ -3,27 +3,20 @@ import React, { memo, useEffect, useRef, useState, useMemo } from 'react';
3
3
  import { Box } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { StyledIconForDropDown, StyledMenuTitle, StyledOption, StyledSelect, StyledSelectComponent } from '../index.js';
6
- import { APP_CODES, blackHeadingDownArrow, blueHeadingDropdownArrow } from '../../constants/index.js';
6
+ import { blackHeadingDownArrow, blueHeadingDropdownArrow } from '../../constants/index.js';
7
7
  import { getNameText } from '../../utils/index.js';
8
8
  import ServiceItem from './ServiceItem';
9
9
  import { Wrapper } from './style';
10
10
  const selectedIcon = (props) => {
11
11
  return (_jsx(StyledIconForDropDown, { src: props.className.includes('MuiSelect-iconOpen') ? blueHeadingDropdownArrow : blackHeadingDownArrow, alt: "dropdown" }));
12
12
  };
13
- function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, onChangeServiceCode, onClickServiceItem, }) {
13
+ function AppServices({ isMaximized, serviceCode, dimensions, services, onChangeServiceCode, onClickServiceItem }) {
14
14
  const [initServicesWidth, setInitServicesWidth] = useState(0);
15
15
  const [isDropdown, setIsDropdown] = useState(false);
16
16
  const [selectedOption, setSelectedOption] = useState('');
17
17
  const servicesRef = useRef(null);
18
18
  const [openDropdown, setOpenDropdown] = React.useState(false);
19
19
  const { i18n } = useTranslation();
20
- const servicesList = useMemo(() => {
21
- var _a;
22
- if (appCode === APP_CODES.account.code) {
23
- return (_a = services.filter((service) => service.code === APP_CODES.account.services.account.code)) !== null && _a !== void 0 ? _a : [];
24
- }
25
- return services !== null && services !== void 0 ? services : [];
26
- }, [appCode, services]);
27
20
  const handleChange = (event) => {
28
21
  setSelectedOption(event.target.value);
29
22
  };
@@ -34,8 +27,8 @@ function AppServices({ isMaximized, serviceCode, dimensions, appCode, services,
34
27
  // Revisit if issues arise with tab title updates during navigation.
35
28
  const activeTabTitle = useMemo(() => {
36
29
  var _a, _b;
37
- return getNameText((_b = (_a = servicesList.filter((service) => service.code.toLowerCase() === decodeURIComponent(serviceCode).toLowerCase())) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name, i18n.language);
38
- }, [servicesList, i18n.language, serviceCode]);
30
+ return getNameText((_b = (_a = services.filter((service) => service.code.toLowerCase() === decodeURIComponent(serviceCode).toLowerCase())) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name, i18n.language);
31
+ }, [services, i18n.language, serviceCode]);
39
32
  useEffect(() => {
40
33
  setSelectedOption(activeTabTitle);
41
34
  }, [activeTabTitle]);
@@ -13,6 +13,6 @@ function AppServicesBar({ appCode, services, isMaximized, dimensions, serviceCod
13
13
  };
14
14
  if (!appCode || !(services === null || services === void 0 ? void 0 : services.length))
15
15
  return null;
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: serviceCode, services: services, isMaximized: isMaximized, appCode: appCode, 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: serviceCode, services: services, isMaximized: isMaximized, onChangeServiceCode: onChangeServiceCode }) })));
17
17
  }
18
18
  export default memo(AppServicesBar);
@@ -49,4 +49,3 @@ export * from './AppsCell';
49
49
  export * from './type';
50
50
  export * from './style';
51
51
  export * from './LeadStatusCell';
52
- export * from './PaymentAgreementCell';
@@ -49,4 +49,3 @@ export * from './AppsCell';
49
49
  export * from './type';
50
50
  export * from './style';
51
51
  export * from './LeadStatusCell';
52
- export * from './PaymentAgreementCell';
@@ -0,0 +1,13 @@
1
+ import { StatusChipWithCopyProps } from '../../../StatusChipWithCopy';
2
+ interface PaymentAgreementCellProps extends Omit<StatusChipWithCopyProps, 'chipIndex'> {
3
+ type?: keyof typeof paymentAgreementTypes;
4
+ count?: number;
5
+ }
6
+ declare const paymentAgreementTypes: {
7
+ SAVED_CARD: string;
8
+ ORDER: string;
9
+ SUBSCRIPTION: string;
10
+ INSTALLMENT: string;
11
+ };
12
+ declare function PaymentAgreementCell({ type, count, ...props }: PaymentAgreementCellProps): import("react/jsx-runtime").JSX.Element;
13
+ export default PaymentAgreementCell;
@@ -12,10 +12,15 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Box } from '@mui/material';
14
14
  import { StatusChipWithCopy } from '../../../index.js';
15
- import { paymentAgreementTypes } from './constant';
16
- function PaymentAgreementCellSheet(_a) {
15
+ const paymentAgreementTypes = {
16
+ SAVED_CARD: 'Card Agreement',
17
+ ORDER: 'Order',
18
+ SUBSCRIPTION: 'Subscription',
19
+ INSTALLMENT: 'Installment',
20
+ };
21
+ function PaymentAgreementCell(_a) {
17
22
  var { type, count } = _a, props = __rest(_a, ["type", "count"]);
18
23
  const countText = count === null || count === void 0 ? void 0 : count.toString();
19
24
  return (_jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'row', gap: '4px' } }, { children: [_jsx(StatusChipWithCopy, Object.assign({ copyText: type, unknownText: "noPaymentAgreement" }, props, { chipIndex: 0 }, { children: type ? paymentAgreementTypes[type] : type })), countText && (_jsx(StatusChipWithCopy, Object.assign({ copyText: countText }, props, { chipIndex: 1, minWidth: "38px" }, { children: countText })))] })));
20
25
  }
21
- export default PaymentAgreementCellSheet;
26
+ export default PaymentAgreementCell;
@@ -0,0 +1 @@
1
+ export { default as PaymentAgreementCell } from './PaymentAgreementCell';
@@ -0,0 +1 @@
1
+ export { default as PaymentAgreementCell } from './PaymentAgreementCell';
@@ -0,0 +1 @@
1
+ export * from './PaymentAgreementCell';
@@ -0,0 +1 @@
1
+ export * from './PaymentAgreementCell';
@@ -1,3 +1,4 @@
1
1
  export { default as TableCell } from './TableCell';
2
2
  export * from './CustomCells';
3
+ export * from './SheetViewCells';
3
4
  export * from './type';
@@ -1,3 +1,4 @@
1
1
  export { default as TableCell } from './TableCell';
2
2
  export * from './CustomCells';
3
+ export * from './SheetViewCells';
3
4
  export * from './type';
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.150",
5
- "testVersion": 0,
4
+ "version": "0.1.151",
5
+ "testVersion": 2,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -1,3 +0,0 @@
1
- import { PaymentAgreementCellProps } from './type';
2
- declare function PaymentAgreementCellSheet({ type, count, ...props }: PaymentAgreementCellProps): import("react/jsx-runtime").JSX.Element;
3
- export default PaymentAgreementCellSheet;
@@ -1,6 +0,0 @@
1
- export declare const paymentAgreementTypes: {
2
- SAVED_CARD: string;
3
- ORDER: string;
4
- SUBSCRIPTION: string;
5
- INSTALLMENT: string;
6
- };
@@ -1,6 +0,0 @@
1
- export const paymentAgreementTypes = {
2
- SAVED_CARD: 'Card Agreement',
3
- ORDER: 'Order',
4
- SUBSCRIPTION: 'Subscription',
5
- INSTALLMENT: 'Installment',
6
- };
@@ -1 +0,0 @@
1
- export { default as PaymentAgreementCellSheet } from './PaymentAgreementCellSheet';
@@ -1 +0,0 @@
1
- export { default as PaymentAgreementCellSheet } from './PaymentAgreementCellSheet';
@@ -1,6 +0,0 @@
1
- import { paymentAgreementTypes } from './constant';
2
- import { StatusChipWithCopyProps } from '../../../StatusChipWithCopy';
3
- export interface PaymentAgreementCellProps extends Omit<StatusChipWithCopyProps, 'chipIndex'> {
4
- type?: keyof typeof paymentAgreementTypes;
5
- count?: number;
6
- }