@tap-payments/os-micro-frontend-shared 0.0.30 → 0.0.31

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 (73) 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/constants/api.d.ts +3 -0
  56. package/build/constants/api.js +3 -0
  57. package/build/constants/apps.d.ts +3 -0
  58. package/build/constants/apps.js +9 -1
  59. package/build/constants/assets.d.ts +8 -0
  60. package/build/constants/assets.js +8 -0
  61. package/build/constants/table/cell/index.d.ts +1 -0
  62. package/build/constants/table/cell/index.js +1 -0
  63. package/build/constants/table/cell/merchantsTableCellWidth.d.ts +6 -2
  64. package/build/constants/table/cell/merchantsTableCellWidth.js +6 -2
  65. package/build/constants/table/cell/terminalsTableCellWidth.d.ts +46 -0
  66. package/build/constants/table/cell/terminalsTableCellWidth.js +46 -0
  67. package/build/theme/palette.js +1 -0
  68. package/build/types/cell.d.ts +5 -1
  69. package/build/types/table.d.ts +17 -7
  70. package/build/utils/string.d.ts +1 -0
  71. package/build/utils/string.js +1 -0
  72. package/build/utils/table.js +3 -1
  73. package/package.json +4 -4
@@ -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,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.30",
4
+ "version": "0.0.31",
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",