@tap-payments/os-micro-frontend-shared 0.0.28 → 0.0.31-dev-shared-migration-v1

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 (87) hide show
  1. package/build/components/Chip/Chip.d.ts +4 -0
  2. package/build/components/Chip/Chip.js +19 -0
  3. package/build/components/Chip/GroupIconChip.d.ts +3 -0
  4. package/build/components/Chip/GroupIconChip.js +11 -0
  5. package/build/components/Chip/GroupIconChips.d.ts +3 -0
  6. package/build/components/Chip/GroupIconChips.js +10 -0
  7. package/build/components/Chip/index.d.ts +4 -0
  8. package/build/components/Chip/index.js +4 -0
  9. package/build/components/Chip/style.d.ts +293 -0
  10. package/build/components/Chip/style.js +78 -0
  11. package/build/components/Chip/type.d.ts +13 -0
  12. package/build/components/Chip/type.js +1 -0
  13. package/build/components/MultiSelectDropdownButton/MultiSelectDropdownButton.js +3 -3
  14. package/build/components/TableHeader_V2/FiltersRow.d.ts +2 -0
  15. package/build/components/TableHeader_V2/FiltersRow.js +5 -0
  16. package/build/components/TableHeader_V2/TableHeader.d.ts +4 -0
  17. package/build/components/TableHeader_V2/TableHeader.js +7 -0
  18. package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.d.ts +2 -0
  19. package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.js +16 -0
  20. package/build/components/TableHeader_V2/components/StatusButtons/StatusButton.d.ts +3 -0
  21. package/build/components/TableHeader_V2/components/StatusButtons/StatusButton.js +54 -0
  22. package/build/components/TableHeader_V2/components/StatusButtons/StatusButtons.d.ts +11 -0
  23. package/build/components/TableHeader_V2/components/StatusButtons/StatusButtons.js +38 -0
  24. package/build/components/TableHeader_V2/components/StatusButtons/constant.d.ts +24 -0
  25. package/build/components/TableHeader_V2/components/StatusButtons/constant.js +25 -0
  26. package/build/components/TableHeader_V2/components/StatusButtons/index.d.ts +3 -0
  27. package/build/components/TableHeader_V2/components/StatusButtons/index.js +3 -0
  28. package/build/components/TableHeader_V2/components/StatusButtons/style.d.ts +35 -0
  29. package/build/components/TableHeader_V2/components/StatusButtons/style.js +74 -0
  30. package/build/components/TableHeader_V2/components/StatusButtons/type.d.ts +22 -0
  31. package/build/components/TableHeader_V2/components/StatusButtons/type.js +1 -0
  32. package/build/components/TableHeader_V2/components/TableView/CustomViews.d.ts +13 -0
  33. package/build/components/TableHeader_V2/components/TableView/CustomViews.js +78 -0
  34. package/build/components/TableHeader_V2/components/TableView/DefaultViews.d.ts +13 -0
  35. package/build/components/TableHeader_V2/components/TableView/DefaultViews.js +22 -0
  36. package/build/components/TableHeader_V2/components/TableView/TableView.d.ts +12 -0
  37. package/build/components/TableHeader_V2/components/TableView/TableView.js +55 -0
  38. package/build/components/TableHeader_V2/components/TableView/index.d.ts +3 -0
  39. package/build/components/TableHeader_V2/components/TableView/index.js +3 -0
  40. package/build/components/TableHeader_V2/components/TableView/style.d.ts +24 -0
  41. package/build/components/TableHeader_V2/components/TableView/style.js +102 -0
  42. package/build/components/TableHeader_V2/components/index.d.ts +2 -0
  43. package/build/components/TableHeader_V2/components/index.js +2 -0
  44. package/build/components/TableHeader_V2/data.d.ts +5 -0
  45. package/build/components/TableHeader_V2/data.js +7 -0
  46. package/build/components/TableHeader_V2/index.d.ts +5 -0
  47. package/build/components/TableHeader_V2/index.js +5 -0
  48. package/build/components/TableHeader_V2/style.d.ts +21 -0
  49. package/build/components/TableHeader_V2/style.js +43 -0
  50. package/build/components/TableHeader_V2/type.d.ts +67 -0
  51. package/build/components/TableHeader_V2/type.js +8 -0
  52. package/build/components/VirtualTable/components/ColumnFilter/ColumnFilter.js +16 -10
  53. package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.js +66 -14
  54. package/build/components/VirtualTable/components/ColumnFilter/List/List.js +1 -1
  55. package/build/components/VirtualTable/components/index.d.ts +1 -1
  56. package/build/components/VirtualTable/components/index.js +1 -1
  57. package/build/components/VirtualTable/index.d.ts +1 -0
  58. package/build/components/VirtualTable/index.js +1 -0
  59. package/build/components/index.d.ts +1 -1
  60. package/build/components/index.js +1 -1
  61. package/build/constants/api.d.ts +3 -0
  62. package/build/constants/api.js +3 -0
  63. package/build/constants/apps.d.ts +3 -0
  64. package/build/constants/apps.js +9 -1
  65. package/build/constants/assets.d.ts +8 -0
  66. package/build/constants/assets.js +8 -0
  67. package/build/constants/table/cell/index.d.ts +1 -0
  68. package/build/constants/table/cell/index.js +1 -0
  69. package/build/constants/table/cell/merchantsTableCellWidth.d.ts +6 -2
  70. package/build/constants/table/cell/merchantsTableCellWidth.js +6 -2
  71. package/build/constants/table/cell/terminalsTableCellWidth.d.ts +46 -0
  72. package/build/constants/table/cell/terminalsTableCellWidth.js +46 -0
  73. package/build/hooks/index.d.ts +0 -1
  74. package/build/hooks/index.js +0 -1
  75. package/build/theme/palette.js +1 -0
  76. package/build/types/cell.d.ts +5 -1
  77. package/build/types/table.d.ts +17 -7
  78. package/build/utils/index.d.ts +0 -1
  79. package/build/utils/index.js +0 -1
  80. package/build/utils/string.d.ts +1 -0
  81. package/build/utils/string.js +1 -0
  82. package/build/utils/table.js +3 -1
  83. package/package.json +4 -5
  84. package/build/hooks/useQueryCancel.d.ts +0 -3
  85. package/build/hooks/useQueryCancel.js +0 -15
  86. package/build/utils/reactQuery.d.ts +0 -3
  87. package/build/utils/reactQuery.js +0 -18
@@ -7,6 +7,5 @@ export * from './useCheckInternetConnection';
7
7
  export * from './useCheckUserLoggedIn';
8
8
  export * from './useDelayedUpdate';
9
9
  export * from './useIsParameterSelected';
10
- export * from './useQueryCancel';
11
10
  export * from './useStickyHeaderShadow';
12
11
  export * from './useThemeMode';
@@ -30,6 +30,7 @@ export const lightPalette = {
30
30
  A200: '#000014',
31
31
  A400: '#C1C1C1',
32
32
  A700: '#818181',
33
+ A800: '#1F222A',
33
34
  },
34
35
  primary: {
35
36
  light: '#FCFCFC',
@@ -1,4 +1,4 @@
1
- import { authenticationsTableCellWidth, authorizationTableCellWidth, walletTableCellWidth, walletStatementTableCellWidth, walletDetailsTableCellWidth, topupsTableCellWidth, tokensTableCellWidth, refundTableCellWidth, protectChargesTableCellWidth, payoutsTableCellWidth, ordersTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, intentsTableCellWidth, chargeTableCellWidth, protectAuthorizationsTableCellWidth, destinationsTableCellWidth, merchantsTableCellWidth } from '../constants/index.js';
1
+ import { authenticationsTableCellWidth, authorizationTableCellWidth, walletTableCellWidth, walletStatementTableCellWidth, walletDetailsTableCellWidth, topupsTableCellWidth, tokensTableCellWidth, refundTableCellWidth, protectChargesTableCellWidth, payoutsTableCellWidth, ordersTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, intentsTableCellWidth, chargeTableCellWidth, protectAuthorizationsTableCellWidth, destinationsTableCellWidth, merchantsTableCellWidth, terminalsTableCellWidth } from '../constants/index.js';
2
2
  import { IVirtualTable } from './index.js';
3
3
  export type AuthenticationsTableCellID = keyof typeof authenticationsTableCellWidth;
4
4
  export type AuthorizationTableCellID = keyof typeof authorizationTableCellWidth;
@@ -18,6 +18,7 @@ export type ChargeTableCellID = keyof typeof chargeTableCellWidth;
18
18
  export type ProtectAuthorizationsTableCellID = keyof typeof protectAuthorizationsTableCellWidth;
19
19
  export type DestinationsTableCellID = keyof typeof destinationsTableCellWidth;
20
20
  export type MerchantsTableCellID = keyof typeof merchantsTableCellWidth;
21
+ export type TerminalsTableCellID = keyof typeof terminalsTableCellWidth;
21
22
  export type TableCellWidthProps = {
22
23
  tableMode: NonNullable<IVirtualTable['tableMode']>;
23
24
  } & ({
@@ -74,4 +75,7 @@ export type TableCellWidthProps = {
74
75
  } | {
75
76
  table: 'merchants';
76
77
  cellID: MerchantsTableCellID;
78
+ } | {
79
+ table: 'terminals';
80
+ cellID: TerminalsTableCellID;
77
81
  });
@@ -3,6 +3,7 @@ import { BoxProps } from '@mui/material/Box';
3
3
  import { TableHeadProps } from '@mui/material/TableHead';
4
4
  import { TableRowProps } from '@mui/material/TableRow';
5
5
  import { DragControls } from 'framer-motion';
6
+ import { Country } from './appConfig';
6
7
  import { SortingOrder } from './sort';
7
8
  export interface TableFilters<T> {
8
9
  order: string;
@@ -71,10 +72,13 @@ export interface IColumnFilterOption {
71
72
  value: unknown;
72
73
  setValue: (value: unknown) => void;
73
74
  isDisabled?: boolean;
74
- getInputValue: (key: string) => string;
75
- isInputHasValue: boolean;
76
- onClickReset: () => void;
75
+ getInputValue: (key: string, type?: string) => string;
76
+ isInputHasValue: (key: string, type?: string) => boolean;
77
+ onClickReset: (key: string, type?: string) => void;
77
78
  }) => React.ReactNode;
79
+ type?: 'text' | 'phone';
80
+ countries?: Country[];
81
+ isCountriesLoading?: boolean;
78
82
  }
79
83
  export type IColumnListFilterOption = Omit<IColumnFilterOption, 'apiKey' | 'options'> & {
80
84
  value: string;
@@ -88,6 +92,8 @@ export interface IColumnFilterList {
88
92
  export interface IColumnFilterInputs {
89
93
  type: 'inputs';
90
94
  options?: IColumnFilterOption[];
95
+ countries?: Country[];
96
+ isCountriesLoading?: boolean;
91
97
  }
92
98
  export interface IColumnFilterCustom {
93
99
  type: 'custom';
@@ -127,9 +133,13 @@ export interface IVirtualTable<R = any> {
127
133
  };
128
134
  dragControls?: DragControls;
129
135
  }
130
- export type IColumnFilter = {
131
- onConfirm?: (filterValues: Record<string, string> | Record<string, string[]>) => void;
136
+ export type ColumnFilterValues = Record<string, string | string[] | {
137
+ phone: string;
138
+ country: Country | undefined;
139
+ }>;
140
+ export type IColumnFilter = ({
141
+ onConfirm?: (filterValues: ColumnFilterValues) => void;
132
142
  onClear: (apiKeys: string[]) => void;
133
- data?: Record<string, string> | Record<string, string[]>;
143
+ data?: ColumnFilterValues;
134
144
  isOnlyOneFilter?: boolean;
135
- } & (IColumnFilterList | IColumnFilterInputs | IColumnFilterCustom);
145
+ } & (IColumnFilterList | IColumnFilterInputs | IColumnFilterCustom));
@@ -6,7 +6,6 @@ export * from './number';
6
6
  export * from './color';
7
7
  export * from './currency';
8
8
  export * from './conversion';
9
- export * from './reactQuery';
10
9
  export * from './country';
11
10
  export * from './payout';
12
11
  export * from './table';
@@ -6,7 +6,6 @@ export * from './number';
6
6
  export * from './color';
7
7
  export * from './currency';
8
8
  export * from './conversion';
9
- export * from './reactQuery';
10
9
  export * from './country';
11
10
  export * from './payout';
12
11
  export * from './table';
@@ -6,3 +6,4 @@ export declare const generateUniqueUUID: () => `${string}-${string}-${string}-${
6
6
  export declare const copyText: (text: string) => void;
7
7
  export declare const capitalizeFirstLetter: (text: string) => string;
8
8
  export declare const percentageToNumber: (percentageStr: string) => number;
9
+ export declare const maskValue: (value: string) => string;
@@ -51,3 +51,4 @@ export const percentageToNumber = (percentageStr) => {
51
51
  const [number] = percentageStr.split('%');
52
52
  return parseFloat(number) || 0;
53
53
  };
54
+ export const maskValue = (value) => `••• ${value.slice(-4)}`;
@@ -1,4 +1,4 @@
1
- import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, } from '../constants/index.js';
1
+ import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, terminalsTableCellWidth, } from '../constants/index.js';
2
2
  export const getColumnWidthPercentage = (widthInPx, options) => {
3
3
  const { isFirst, isLast } = options || {};
4
4
  const paddingInPx = isFirst || isLast ? 0 : 0;
@@ -43,6 +43,8 @@ export const getCellWidth = ({ table, cellID, tableMode }) => {
43
43
  return walletStatementTableCellWidth[cellID][tableMode];
44
44
  case 'merchants':
45
45
  return merchantsTableCellWidth[cellID][tableMode];
46
+ case 'terminals':
47
+ return terminalsTableCellWidth[cellID][tableMode];
46
48
  default:
47
49
  return '100px';
48
50
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.28",
4
+ "version": "0.0.31-dev-shared-migration-v1",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",
@@ -23,9 +23,9 @@
23
23
  "types": "./build/components/index.d.ts"
24
24
  },
25
25
  "./components/*": {
26
- "import": "./build/components/*",
27
- "require": "./build/components/*",
28
- "types": "./build/components/*"
26
+ "import": "./build/components/*/index.js",
27
+ "require": "./build/components/*/index.js",
28
+ "types": "./build/components/*/index.d.ts"
29
29
  },
30
30
  "./hooks": {
31
31
  "import": "./build/hooks/index.js",
@@ -90,7 +90,6 @@
90
90
  "react-hot-toast": "^2.4.1",
91
91
  "react-i18next": "^12.2.2",
92
92
  "react-multi-date-picker": "^4.1.2",
93
- "react-query": "^3.39.3",
94
93
  "react-router-dom": "^6.14.2",
95
94
  "react-virtualized-auto-sizer": "^1.0.20",
96
95
  "react-window": "^1.8.9",
@@ -1,3 +0,0 @@
1
- export declare const useQueryCancel: (name: string, type?: 'query' | 'mutation') => {
2
- cancel: () => void;
3
- };
@@ -1,15 +0,0 @@
1
- import { useCallback, useEffect } from 'react';
2
- import { queryClient } from '../utils/index.js';
3
- export const useQueryCancel = (name, type = 'query') => {
4
- const cancel = useCallback(() => {
5
- if (type === 'query') {
6
- queryClient.cancelQueries(name);
7
- }
8
- }, [type, name]);
9
- useEffect(() => {
10
- return () => {
11
- cancel();
12
- };
13
- }, [cancel]);
14
- return { cancel };
15
- };
@@ -1,3 +0,0 @@
1
- import { QueryClient } from 'react-query';
2
- export declare const queryClient: QueryClient;
3
- export declare const removeQueries: (excludedKeys?: string[]) => void;
@@ -1,18 +0,0 @@
1
- import { QueryClient } from 'react-query';
2
- export const queryClient = new QueryClient({
3
- defaultOptions: {
4
- queries: {
5
- retry: false,
6
- refetchOnWindowFocus: false,
7
- staleTime: 1000 * 60 * 3,
8
- cacheTime: 1000 * 60 * 3,
9
- },
10
- },
11
- });
12
- export const removeQueries = (excludedKeys) => {
13
- queryClient.removeQueries({
14
- predicate: (query) => {
15
- return !(excludedKeys === null || excludedKeys === void 0 ? void 0 : excludedKeys.includes(query.queryKey[0]));
16
- },
17
- });
18
- };