@tap-payments/os-micro-frontend-shared 0.1.96-test.3 → 0.1.97-test.2

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Tap Payments
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tap Payments
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # os-micro-frontend-shared
2
-
3
- ## Publishing Workflow
4
-
5
- 1. Update version in package.json
6
- 2. Commit changes
7
- 3. Create and push a tag:
8
-
9
- ```bash
10
- npm version patch # or minor, major
11
- git push origin main --tags
12
- ```
1
+ # os-micro-frontend-shared
2
+
3
+ ## Publishing Workflow
4
+
5
+ 1. Update version in package.json
6
+ 2. Commit changes
7
+ 3. Create and push a tag:
8
+
9
+ ```bash
10
+ npm version patch # or minor, major
11
+ git push origin main --tags
12
+ ```
@@ -7,10 +7,7 @@ interface ISheetViewTableLoadingProps {
7
7
  isLoading?: boolean;
8
8
  rowsCount?: number;
9
9
  isPinned?: boolean;
10
- tableType?: string;
11
- containerHeight?: number;
12
- isCompact?: boolean;
13
10
  }
14
- declare function SheetViewTableLoading({ columns, isLoaded, animationType, isPinned, containerHeight }: ISheetViewTableLoadingProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function SheetViewTableLoading({ columns, isLoaded, animationType, isLoading, rowsCount, isPinned, }: ISheetViewTableLoadingProps): import("react/jsx-runtime").JSX.Element;
15
12
  declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableLoading>;
16
13
  export default _default;
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import { styled } from '@mui/material/styles';
4
4
  import uniqueId from 'lodash/uniqueId';
5
- import { calculateSheetViewMaxRows, getSheetViewRowHeight } from '../../../../utils/index.js';
5
+ import { calculateMaxAllowedRows } from '../../../../utils/index.js';
6
6
  import SheetViewTableRowLoading from './SheetViewTableRowLoading';
7
7
  const Wrapper = styled('section')(({ isLoaded = false, isPinned = false }) => ({
8
8
  overflow: 'hidden',
@@ -11,11 +11,9 @@ const Wrapper = styled('section')(({ isLoaded = false, isPinned = false }) => ({
11
11
  filter: isLoaded && !isPinned ? 'blur(8px)' : 'none',
12
12
  marginTop: isLoaded && !isPinned ? '1rem' : '0',
13
13
  }));
14
- function SheetViewTableLoading({ columns, isLoaded = false, animationType, isPinned = false, containerHeight }) {
15
- const availableHeight = containerHeight || window.innerHeight * 0.8;
16
- const rowHeight = getSheetViewRowHeight();
17
- const maxAllowedRows = calculateSheetViewMaxRows(availableHeight, rowHeight);
18
- console.log({ maxAllowedRows, availableHeight, rowHeight, containerHeight });
14
+ function SheetViewTableLoading({ columns, isLoaded = false, animationType, isLoading = false, rowsCount, isPinned = false, }) {
15
+ let maxAllowedRows = rowsCount || calculateMaxAllowedRows(isLoaded, isLoading);
16
+ maxAllowedRows = rowsCount || Math.max(maxAllowedRows, 25);
19
17
  return (_jsx(Wrapper, Object.assign({ isLoaded: isLoaded, isPinned: isPinned, "data-testid": "SheetViewTableLoading" }, { children: [...Array(maxAllowedRows)].map((_, index) => (_jsx(SheetViewTableRowLoading, { columns: columns, animationType: animationType, rowIndex: index, useTableBackground: !isPinned }, `i-${uniqueId('SheetViewTableLoadingRow_')}`))) })));
20
18
  }
21
19
  export default memo(SheetViewTableLoading);
@@ -146,7 +146,7 @@ export const SheetViewTableContainer = styled(Box)(() => ({
146
146
  position: 'relative',
147
147
  display: 'flex',
148
148
  flexDirection: 'column',
149
- height: '100%',
149
+ height: 'calc(100vh - 300px)',
150
150
  paddingInline: '28px',
151
151
  borderRadius: '8px',
152
152
  marginBottom: '16px !important',
@@ -84,6 +84,18 @@ export declare const APP_CODES: {
84
84
  merchant: {
85
85
  code: string;
86
86
  functions: {
87
+ updateEntity: {
88
+ code: string;
89
+ };
90
+ updateBrand: {
91
+ code: string;
92
+ };
93
+ updateUsers: {
94
+ code: string;
95
+ };
96
+ createUsers: {
97
+ code: string;
98
+ };
87
99
  view: {
88
100
  code: string;
89
101
  };
@@ -40,7 +40,15 @@ export const APP_CODES = {
40
40
  services: {
41
41
  merchant: {
42
42
  code: 'MERCHANT',
43
- functions: Object.assign({}, SERVICE_COMMON_FUNCTIONS),
43
+ functions: Object.assign(Object.assign({}, SERVICE_COMMON_FUNCTIONS), { updateEntity: {
44
+ code: 'UPDATE ENTITY',
45
+ }, updateBrand: {
46
+ code: 'UPDATE BRAND',
47
+ }, updateUsers: {
48
+ code: 'UPDATE USERS',
49
+ }, createUsers: {
50
+ code: 'CREATE USERS',
51
+ } }),
44
52
  },
45
53
  retailer: {
46
54
  code: 'RETAILER',
@@ -31,6 +31,10 @@ 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
+ },
34
38
  });
35
39
  const getSingleCellSelectionStyles = () => ({
36
40
  border: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
@@ -6,9 +6,4 @@ 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 calculateSheetViewHeight: (totalRows: number, rowHeight?: number) => number;
10
- export declare const calculateSheetViewMaxRows: (availableHeight: number, rowHeight?: number) => number;
11
- export declare const isSheetViewScrollable: (totalRows: number, containerHeight: number, rowHeight?: number) => boolean;
12
- export declare const getSheetViewRowHeight: () => number;
13
- export declare const calculateSheetViewOptimalHeight: (totalRows: number, tableType: string, maxHeightPercentage?: number) => number;
14
9
  export declare const isTableDefaultMode: (tableMode?: TableMode) => boolean;
@@ -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, terminalsTableCellWidth, SHEET_VIEW_TABLE_ROW_HEIGHT, } 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;
@@ -73,38 +73,6 @@ export const isHeightNotFullyFilledByRows = (totalRows) => {
73
73
  const allowedRows = maxRowsThatFit();
74
74
  return totalRows < allowedRows + 1;
75
75
  };
76
- export const calculateSheetViewHeight = (totalRows, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
77
- const headerHeight = 56;
78
- const padding = 16;
79
- const calculatedHeight = headerHeight + totalRows * rowHeight + padding;
80
- const minHeight = 200;
81
- const maxHeight = window.innerHeight * 0.8;
82
- return Math.max(minHeight, Math.min(calculatedHeight, maxHeight));
83
- };
84
- export const calculateSheetViewMaxRows = (availableHeight, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
85
- const headerHeight = 56;
86
- const padding = 16;
87
- const availableContentHeight = availableHeight - headerHeight - padding;
88
- return Math.floor(availableContentHeight / rowHeight);
89
- };
90
- export const isSheetViewScrollable = (totalRows, containerHeight, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
91
- const headerHeight = 56;
92
- const padding = 16;
93
- const contentHeight = headerHeight + totalRows * rowHeight + padding;
94
- return contentHeight > containerHeight;
95
- };
96
- export const getSheetViewRowHeight = () => {
97
- const baseRowHeight = SHEET_VIEW_TABLE_ROW_HEIGHT;
98
- return baseRowHeight * 0.8;
99
- };
100
- export const calculateSheetViewOptimalHeight = (totalRows, tableType, maxHeightPercentage = 0.8) => {
101
- const rowHeight = getSheetViewRowHeight();
102
- const headerHeight = 56;
103
- const padding = 16;
104
- const calculatedHeight = headerHeight + totalRows * rowHeight + padding;
105
- const maxHeight = window.innerHeight * maxHeightPercentage;
106
- return Math.min(calculatedHeight, maxHeight);
107
- };
108
76
  export const isTableDefaultMode = (tableMode = 'default') => {
109
77
  return tableMode === 'default';
110
78
  };
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.3",
5
- "testVersion": 3,
4
+ "version": "0.1.97-test.2",
5
+ "testVersion": 2,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",