@tap-payments/os-micro-frontend-shared 0.1.96-test.16 → 0.1.96-test.17

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 (90) hide show
  1. package/build/components/AmountStatusChip/AmountStatusChip.d.ts +9 -0
  2. package/build/components/AmountStatusChip/AmountStatusChip.js +19 -0
  3. package/build/components/AmountStatusChip/index.d.ts +3 -0
  4. package/build/components/AmountStatusChip/index.js +2 -0
  5. package/build/components/AmountStatusChip/style.d.ts +3 -0
  6. package/build/components/AmountStatusChip/style.js +13 -0
  7. package/build/components/AppServicesBar/style.js +1 -1
  8. package/build/components/AuthenticationTypeChip/AuthenticationTypeChip.d.ts +9 -0
  9. package/build/components/AuthenticationTypeChip/AuthenticationTypeChip.js +21 -0
  10. package/build/components/AuthenticationTypeChip/constants.d.ts +16 -0
  11. package/build/components/AuthenticationTypeChip/constants.js +13 -0
  12. package/build/components/AuthenticationTypeChip/index.d.ts +3 -0
  13. package/build/components/AuthenticationTypeChip/index.js +2 -0
  14. package/build/components/ColorPicker/ColorPicker.d.ts +4 -1
  15. package/build/components/ColorPicker/ColorPicker.js +10 -43
  16. package/build/components/ColorPicker/ColorPickerPanel.d.ts +7 -0
  17. package/build/components/ColorPicker/ColorPickerPanel.js +41 -0
  18. package/build/components/ColorPicker/ColorSchemeSelect.d.ts +7 -0
  19. package/build/components/ColorPicker/ColorSchemeSelect.js +35 -0
  20. package/build/components/ColorPicker/HexaFields.d.ts +7 -0
  21. package/build/components/ColorPicker/HexaFields.js +79 -0
  22. package/build/components/ColorPicker/RGBAFields.d.ts +7 -0
  23. package/build/components/ColorPicker/RGBAFields.js +25 -0
  24. package/build/components/ColorPicker/style.d.ts +20 -9
  25. package/build/components/ColorPicker/style.js +49 -2
  26. package/build/components/ListLayout/ListLayout.js +1 -1
  27. package/build/components/RightLeftExpandingCenterChip/style.js +0 -2
  28. package/build/components/StatusChip/StatusChip.d.ts +1 -1
  29. package/build/components/StatusChip/StatusChip.js +13 -10
  30. package/build/components/StatusChip/style.d.ts +4 -0
  31. package/build/components/StatusChip/style.js +13 -5
  32. package/build/components/StatusChip/type.d.ts +4 -0
  33. package/build/components/StatusChipWithCopy/StatusChipWithCopy.d.ts +2 -1
  34. package/build/components/StatusChipWithCopy/StatusChipWithCopy.js +2 -2
  35. package/build/components/StatusIcons/AuthorizationAutoIcons/style.js +1 -1
  36. package/build/components/TableCells/CustomCells/ActionCell/constant.d.ts +1 -0
  37. package/build/components/TableCells/CustomCells/ActionCell/constant.js +2 -1
  38. package/build/components/TableCells/CustomCells/ActionCell/hooks/useActionCell.d.ts +1 -1
  39. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -1
  40. package/build/components/TableCells/CustomCells/ApplicationStatusCell/ApplicationStatusCell.js +4 -4
  41. package/build/components/TableCells/CustomCells/BalanceCell/style.js +1 -1
  42. package/build/components/TableCells/CustomCells/ProductsCell/style.js +1 -1
  43. package/build/components/TableCells/CustomCells/RefundChargeCell/style.js +1 -1
  44. package/build/components/TableCells/CustomCells/RefundStatusCell/style.js +1 -1
  45. package/build/components/TableCells/CustomCells/style.js +1 -1
  46. package/build/components/TableCells/SheetViewCells/PaymentAgreementCell/PaymentAgreementCell.d.ts +13 -0
  47. package/build/components/TableCells/SheetViewCells/PaymentAgreementCell/PaymentAgreementCell.js +26 -0
  48. package/build/components/TableCells/SheetViewCells/PaymentAgreementCell/index.d.ts +1 -0
  49. package/build/components/TableCells/SheetViewCells/PaymentAgreementCell/index.js +1 -0
  50. package/build/components/TableCells/SheetViewCells/index.d.ts +1 -0
  51. package/build/components/TableCells/SheetViewCells/index.js +1 -0
  52. package/build/components/TableCells/index.d.ts +1 -0
  53. package/build/components/TableCells/index.js +1 -0
  54. package/build/components/ToggleView/style.js +3 -3
  55. package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.js +2 -0
  56. package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.js +5 -1
  57. package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.js +5 -1
  58. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.js +38 -4
  59. package/build/components/VirtualTables/components/TableRow.js +2 -1
  60. package/build/components/VirtualTables/components/style.js +1 -1
  61. package/build/components/index.d.ts +6 -4
  62. package/build/components/index.js +6 -4
  63. package/build/constants/apps.d.ts +38 -0
  64. package/build/constants/apps.js +16 -2
  65. package/build/constants/chips/index.d.ts +1 -0
  66. package/build/constants/chips/index.js +1 -0
  67. package/build/{components/StatusChip/constants.d.ts → constants/chips/statusChips.d.ts} +1 -1
  68. package/build/{components/StatusChip/constants.js → constants/chips/statusChips.js} +1 -1
  69. package/build/constants/index.d.ts +1 -0
  70. package/build/constants/index.js +1 -0
  71. package/build/constants/table/cell/authenticationsTableCellWidth.d.ts +1 -1
  72. package/build/constants/table/cell/authenticationsTableCellWidth.js +1 -1
  73. package/build/constants/table/cell/authorizationTableCellWidth.d.ts +4 -4
  74. package/build/constants/table/cell/authorizationTableCellWidth.js +4 -4
  75. package/build/constants/table/cell/chargeTableCellWidth.d.ts +3 -3
  76. package/build/constants/table/cell/chargeTableCellWidth.js +3 -3
  77. package/build/constants/table/cell/destinationsTableCellWidth.d.ts +3 -3
  78. package/build/constants/table/cell/destinationsTableCellWidth.js +3 -3
  79. package/build/constants/table/cell/merchantsTableCellWidth.d.ts +1 -1
  80. package/build/constants/table/cell/merchantsTableCellWidth.js +1 -1
  81. package/build/constants/table/cell/refundTableCellWidth.d.ts +3 -3
  82. package/build/constants/table/cell/refundTableCellWidth.js +3 -3
  83. package/build/utils/color.d.ts +11 -0
  84. package/build/utils/color.js +27 -0
  85. package/build/utils/object.d.ts +1 -0
  86. package/build/utils/object.js +4 -3
  87. package/build/utils/style.js +0 -4
  88. package/build/utils/table.d.ts +3 -1
  89. package/build/utils/table.js +7 -1
  90. package/package.json +2 -2
@@ -14,6 +14,20 @@ export const SERVICE_COMMON_FUNCTIONS = {
14
14
  code: 'REPORTS',
15
15
  },
16
16
  };
17
+ export const BUSINESS_FUNCTIONS = {
18
+ updateEntity: {
19
+ code: 'UPDATE ENTITY',
20
+ },
21
+ updateBrand: {
22
+ code: 'UPDATE BRAND',
23
+ },
24
+ updateUsers: {
25
+ code: 'UPDATE USERS',
26
+ },
27
+ createUsers: {
28
+ code: 'CREATE USERS',
29
+ },
30
+ };
17
31
  export const APP_CODES = {
18
32
  tokens: {
19
33
  code: 'TOKEN',
@@ -40,11 +54,11 @@ export const APP_CODES = {
40
54
  services: {
41
55
  merchant: {
42
56
  code: 'MERCHANT',
43
- functions: Object.assign({}, SERVICE_COMMON_FUNCTIONS),
57
+ functions: Object.assign(Object.assign({}, SERVICE_COMMON_FUNCTIONS), BUSINESS_FUNCTIONS),
44
58
  },
45
59
  retailer: {
46
60
  code: 'RETAILER',
47
- functions: Object.assign({}, SERVICE_COMMON_FUNCTIONS),
61
+ functions: Object.assign(Object.assign({}, SERVICE_COMMON_FUNCTIONS), BUSINESS_FUNCTIONS),
48
62
  },
49
63
  },
50
64
  },
@@ -0,0 +1 @@
1
+ export * from './statusChips';
@@ -0,0 +1 @@
1
+ export * from './statusChips';
@@ -1,4 +1,4 @@
1
- export declare const unknownGeographyColors: {
1
+ export declare const emptyStatusChipColors: {
2
2
  bgColor: string;
3
3
  borderColor: string;
4
4
  textColor: string;
@@ -1,4 +1,4 @@
1
- export const unknownGeographyColors = {
1
+ export const emptyStatusChipColors = {
2
2
  bgColor: 'white',
3
3
  borderColor: '#F2F2F2',
4
4
  textColor: '#20232B33',
@@ -12,3 +12,4 @@ export * from './table';
12
12
  export * from './toggleOptions';
13
13
  export * from './payment';
14
14
  export * from './segment';
15
+ export * from './chips';
@@ -12,3 +12,4 @@ export * from './table';
12
12
  export * from './toggleOptions';
13
13
  export * from './payment';
14
14
  export * from './segment';
15
+ export * from './chips';
@@ -37,7 +37,7 @@ export declare const authenticationsTableCellWidth: {
37
37
  readonly payment_agreement: {
38
38
  readonly default: "50px";
39
39
  readonly text: "250px";
40
- readonly sheet: "250px";
40
+ readonly sheet: "165px";
41
41
  };
42
42
  readonly amount: {
43
43
  readonly default: "195px";
@@ -37,7 +37,7 @@ export const authenticationsTableCellWidth = {
37
37
  payment_agreement: {
38
38
  default: '50px',
39
39
  text: '250px',
40
- sheet: '250px',
40
+ sheet: '165px',
41
41
  },
42
42
  amount: {
43
43
  default: '195px',
@@ -57,12 +57,12 @@ export declare const authorizationTableCellWidth: {
57
57
  readonly payment_agreement: {
58
58
  readonly default: "50px";
59
59
  readonly text: "150px";
60
- readonly sheet: "170px";
60
+ readonly sheet: "230px";
61
61
  };
62
62
  readonly amount: {
63
63
  readonly default: "170px";
64
64
  readonly text: "195px";
65
- readonly sheet: "195px";
65
+ readonly sheet: "150px";
66
66
  };
67
67
  readonly destinations: {
68
68
  readonly default: "70px";
@@ -82,7 +82,7 @@ export declare const authorizationTableCellWidth: {
82
82
  readonly merchant: {
83
83
  readonly default: "110px";
84
84
  readonly text: "150px";
85
- readonly sheet: "215px";
85
+ readonly sheet: "138px";
86
86
  };
87
87
  readonly charge: {
88
88
  readonly default: "150px";
@@ -207,7 +207,7 @@ export declare const authorizationTableCellWidth: {
207
207
  readonly eci: {
208
208
  readonly default: "150px";
209
209
  readonly text: "150px";
210
- readonly sheet: "100px";
210
+ readonly sheet: "72px";
211
211
  };
212
212
  readonly acquirer_response: {
213
213
  readonly default: "70px";
@@ -57,12 +57,12 @@ export const authorizationTableCellWidth = {
57
57
  payment_agreement: {
58
58
  default: '50px',
59
59
  text: '150px',
60
- sheet: '170px',
60
+ sheet: '230px',
61
61
  },
62
62
  amount: {
63
63
  default: '170px',
64
64
  text: '195px',
65
- sheet: '195px',
65
+ sheet: '150px',
66
66
  },
67
67
  destinations: {
68
68
  default: '70px',
@@ -82,7 +82,7 @@ export const authorizationTableCellWidth = {
82
82
  merchant: {
83
83
  default: '110px',
84
84
  text: '150px',
85
- sheet: '215px',
85
+ sheet: '138px',
86
86
  },
87
87
  charge: {
88
88
  default: '150px',
@@ -207,7 +207,7 @@ export const authorizationTableCellWidth = {
207
207
  eci: {
208
208
  default: '150px',
209
209
  text: '150px',
210
- sheet: '100px',
210
+ sheet: '72px',
211
211
  },
212
212
  acquirer_response: {
213
213
  default: '70px',
@@ -92,7 +92,7 @@ export declare const chargeTableCellWidth: {
92
92
  readonly eci: {
93
93
  readonly default: "150px";
94
94
  readonly text: "150px";
95
- readonly sheet: "100px";
95
+ readonly sheet: "72px";
96
96
  };
97
97
  readonly amount: {
98
98
  readonly default: "170px";
@@ -132,7 +132,7 @@ export declare const chargeTableCellWidth: {
132
132
  readonly merchant: {
133
133
  readonly default: "100px";
134
134
  readonly text: "150px";
135
- readonly sheet: "215px";
135
+ readonly sheet: "138px";
136
136
  };
137
137
  readonly charge: {
138
138
  readonly default: "150px";
@@ -222,7 +222,7 @@ export declare const chargeTableCellWidth: {
222
222
  readonly consolidated_amount: {
223
223
  readonly default: "180px";
224
224
  readonly text: "180px";
225
- readonly sheet: "180px";
225
+ readonly sheet: "150px";
226
226
  };
227
227
  readonly customer_amount: {
228
228
  readonly default: "150px";
@@ -92,7 +92,7 @@ export const chargeTableCellWidth = {
92
92
  eci: {
93
93
  default: '150px',
94
94
  text: '150px',
95
- sheet: '100px',
95
+ sheet: '72px',
96
96
  },
97
97
  amount: {
98
98
  default: '170px',
@@ -132,7 +132,7 @@ export const chargeTableCellWidth = {
132
132
  merchant: {
133
133
  default: '100px',
134
134
  text: '150px',
135
- sheet: '215px',
135
+ sheet: '138px',
136
136
  },
137
137
  charge: {
138
138
  default: '150px',
@@ -222,7 +222,7 @@ export const chargeTableCellWidth = {
222
222
  consolidated_amount: {
223
223
  default: '180px',
224
224
  text: '180px',
225
- sheet: '180px',
225
+ sheet: '150px',
226
226
  },
227
227
  customer_amount: {
228
228
  default: '150px',
@@ -67,7 +67,7 @@ export declare const destinationsTableCellWidth: {
67
67
  readonly amount: {
68
68
  readonly default: "195px";
69
69
  readonly text: "195px";
70
- readonly sheet: "195px";
70
+ readonly sheet: "150px";
71
71
  };
72
72
  readonly status: {
73
73
  readonly default: "50px";
@@ -82,7 +82,7 @@ export declare const destinationsTableCellWidth: {
82
82
  readonly merchant: {
83
83
  readonly default: "100px";
84
84
  readonly text: "150px";
85
- readonly sheet: "215px";
85
+ readonly sheet: "138px";
86
86
  };
87
87
  readonly actions: {
88
88
  readonly default: "100px";
@@ -157,7 +157,7 @@ export declare const destinationsTableCellWidth: {
157
157
  readonly eci: {
158
158
  readonly default: "150px";
159
159
  readonly text: "150px";
160
- readonly sheet: "100px";
160
+ readonly sheet: "72px";
161
161
  };
162
162
  readonly payout_status: {
163
163
  readonly default: "120px";
@@ -67,7 +67,7 @@ export const destinationsTableCellWidth = {
67
67
  amount: {
68
68
  default: '195px',
69
69
  text: '195px',
70
- sheet: '195px',
70
+ sheet: '150px',
71
71
  },
72
72
  status: {
73
73
  default: '50px',
@@ -82,7 +82,7 @@ export const destinationsTableCellWidth = {
82
82
  merchant: {
83
83
  default: '100px',
84
84
  text: '150px',
85
- sheet: '215px',
85
+ sheet: '138px',
86
86
  },
87
87
  actions: {
88
88
  default: '100px',
@@ -157,7 +157,7 @@ export const destinationsTableCellWidth = {
157
157
  eci: {
158
158
  default: '150px',
159
159
  text: '150px',
160
- sheet: '100px',
160
+ sheet: '72px',
161
161
  },
162
162
  payout_status: {
163
163
  default: '120px',
@@ -72,6 +72,6 @@ export declare const merchantsTableCellWidth: {
72
72
  readonly merchant: {
73
73
  readonly default: "175px";
74
74
  readonly text: "180px";
75
- readonly sheet: "180px";
75
+ readonly sheet: "138px";
76
76
  };
77
77
  };
@@ -72,6 +72,6 @@ export const merchantsTableCellWidth = {
72
72
  merchant: {
73
73
  default: '175px',
74
74
  text: '180px',
75
- sheet: '180px',
75
+ sheet: '138px',
76
76
  },
77
77
  };
@@ -87,12 +87,12 @@ export declare const refundTableCellWidth: {
87
87
  readonly eci: {
88
88
  readonly default: "150px";
89
89
  readonly text: "150px";
90
- readonly sheet: "100px";
90
+ readonly sheet: "72px";
91
91
  };
92
92
  readonly amount: {
93
93
  readonly default: "195px";
94
94
  readonly text: "195px";
95
- readonly sheet: "180px";
95
+ readonly sheet: "150px";
96
96
  };
97
97
  readonly payouts: {
98
98
  readonly default: "195px";
@@ -122,7 +122,7 @@ export declare const refundTableCellWidth: {
122
122
  readonly merchant: {
123
123
  readonly default: "100px";
124
124
  readonly text: "150px";
125
- readonly sheet: "215px";
125
+ readonly sheet: "138px";
126
126
  };
127
127
  readonly reference: {
128
128
  readonly default: "95px";
@@ -87,12 +87,12 @@ export const refundTableCellWidth = {
87
87
  eci: {
88
88
  default: '150px',
89
89
  text: '150px',
90
- sheet: '100px',
90
+ sheet: '72px',
91
91
  },
92
92
  amount: {
93
93
  default: '195px',
94
94
  text: '195px',
95
- sheet: '180px',
95
+ sheet: '150px',
96
96
  },
97
97
  payouts: {
98
98
  default: '195px',
@@ -122,7 +122,7 @@ export const refundTableCellWidth = {
122
122
  merchant: {
123
123
  default: '100px',
124
124
  text: '150px',
125
- sheet: '215px',
125
+ sheet: '138px',
126
126
  },
127
127
  reference: {
128
128
  default: '95px',
@@ -1,2 +1,13 @@
1
+ import { ColorObject } from 'color';
1
2
  export declare function getRandomColor(): string;
2
3
  export declare function getRandomGradientColor(): string;
4
+ export declare const hexa2Rgba: (value: string) => {
5
+ value: {
6
+ r: number;
7
+ g: number;
8
+ b: number;
9
+ alpha: number;
10
+ };
11
+ stringified: string;
12
+ };
13
+ export declare const rgba2Hexa: (value: ColorObject) => string;
@@ -1,3 +1,4 @@
1
+ import Color from 'color';
1
2
  export function getRandomColor() {
2
3
  const colors = [
3
4
  '#D6D6D6',
@@ -36,3 +37,29 @@ export function getRandomGradientColor() {
36
37
  ];
37
38
  return colors[Math.trunc(Math.random() * colors.length)];
38
39
  }
40
+ const BLACK_RGBA_COLOR = {
41
+ r: 0,
42
+ g: 0,
43
+ b: 0,
44
+ alpha: 1,
45
+ };
46
+ export const hexa2Rgba = (value) => {
47
+ try {
48
+ const colorInstance = Color(value).rgb();
49
+ const { r, g, b, alpha = 1 } = colorInstance.object();
50
+ return {
51
+ value: { r, g, b, alpha },
52
+ stringified: `rgba(${r},${g},${b},${alpha})`,
53
+ };
54
+ }
55
+ catch (error) {
56
+ console.error(error);
57
+ console.warn(`Invalid hex color: "${value}". Falling back to black.`);
58
+ const { r, g, b, alpha } = BLACK_RGBA_COLOR;
59
+ return {
60
+ value: BLACK_RGBA_COLOR,
61
+ stringified: `rgba(${r},${g},${b},${alpha})`,
62
+ };
63
+ }
64
+ };
65
+ export const rgba2Hexa = (value) => Color(value).hexa();
@@ -1,6 +1,7 @@
1
1
  export declare function removeUndefinedValues(obj: Record<string, unknown>): {
2
2
  [k: string]: unknown;
3
3
  };
4
+ export declare const isEmptyValue: (value: unknown) => boolean;
4
5
  export declare function removeUndefinedArrayValues(obj: Record<string, unknown>): {
5
6
  [k: string]: unknown;
6
7
  };
@@ -1,14 +1,15 @@
1
1
  export function removeUndefinedValues(obj) {
2
2
  return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
3
3
  }
4
+ export const isEmptyValue = (value) => value === undefined || value === null || value === '';
4
5
  export function removeUndefinedArrayValues(obj) {
5
6
  return Object.fromEntries(Object.entries(obj).filter(([, value]) => {
6
7
  if (Array.isArray(value)) {
7
- return value.length > 0 && (value === null || value === void 0 ? void 0 : value.some((v) => !!v));
8
+ return value.length > 0 && (value === null || value === void 0 ? void 0 : value.some((v) => !isEmptyValue(v)));
8
9
  }
9
10
  if (typeof value === 'object') {
10
- return Object.values(value || {}).some((v) => !!v);
11
+ return Object.values(value || {}).some((v) => !isEmptyValue(v));
11
12
  }
12
- return !!value;
13
+ return !isEmptyValue(value);
13
14
  }));
14
15
  }
@@ -31,10 +31,6 @@ export const getSelectionStyles = ({ isSelected, isCellSelected, isColumnSelecte
31
31
  const getRowSelectionStyles = () => ({
32
32
  backgroundColor: SELECTION_COLORS.background,
33
33
  color: SELECTION_COLORS.primary,
34
- border: 'none',
35
- '&:before': {
36
- border: 'none',
37
- },
38
34
  });
39
35
  const getSingleCellSelectionStyles = () => ({
40
36
  border: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
@@ -6,4 +6,6 @@ export declare const getColumnWidthPercentage: (widthInPx: number, options?: {
6
6
  export declare const getCellWidth: ({ table, cellID, tableMode }: TableCellWidthProps) => string;
7
7
  export declare const calculateMaxAllowedRows: (isLoaded: boolean, isLoading: boolean) => number;
8
8
  export declare const isHeightNotFullyFilledByRows: (totalRows: number) => boolean;
9
- export declare const isTableDefaultMode: (tableMode?: TableMode) => boolean;
9
+ export declare const isTableDefaultMode: (tableMode: TableMode) => boolean;
10
+ export declare const isTableSheetMode: (tableMode: TableMode) => boolean;
11
+ export declare const isTableTextMode: (tableMode: TableMode) => boolean;
@@ -73,6 +73,12 @@ export const isHeightNotFullyFilledByRows = (totalRows) => {
73
73
  const allowedRows = maxRowsThatFit();
74
74
  return totalRows < allowedRows + 1;
75
75
  };
76
- export const isTableDefaultMode = (tableMode = 'default') => {
76
+ export const isTableDefaultMode = (tableMode) => {
77
77
  return tableMode === 'default';
78
78
  };
79
+ export const isTableSheetMode = (tableMode) => {
80
+ return tableMode === 'sheet';
81
+ };
82
+ export const isTableTextMode = (tableMode) => {
83
+ return tableMode === 'text';
84
+ };
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.16",
5
- "testVersion": 16,
4
+ "version": "0.1.96-test.17",
5
+ "testVersion": 17,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",