@tap-payments/os-micro-frontend-shared 0.1.62-test.3 → 0.1.63-test.3
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 +21 -21
- package/README.md +12 -12
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js +1 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useSynchronizedScroll.js +31 -14
- package/build/components/VirtualTables/components/virtualScroll/VirtualScrollList.js +21 -2
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/chargeTableCellWidth.js +1 -1
- package/build/constants/table/cell/refundTableCellWidth.d.ts +3 -3
- package/build/constants/table/cell/refundTableCellWidth.js +3 -3
- package/package.json +1 -1
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
|
+
```
|
package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js
CHANGED
|
@@ -44,9 +44,7 @@ function SheetViewTableHeaderCell({ column: { header, id, align, headerStyle, so
|
|
|
44
44
|
right: 0,
|
|
45
45
|
left: 0,
|
|
46
46
|
bottom: 0,
|
|
47
|
-
} }, headerStyle)) }, { children: _jsxs(TableHeaderInner, Object.assign({ onClick: handleHeaderInnerClick }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter &&
|
|
48
|
-
onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(colIndex, event, pinned);
|
|
49
|
-
} }))), sortable && (_jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, onClick: (e) => {
|
|
47
|
+
} }, headerStyle)) }, { children: _jsxs(TableHeaderInner, Object.assign({ onClick: handleHeaderInnerClick }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl })), sortable && (_jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, onClick: (e) => {
|
|
50
48
|
onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(colIndex, e, pinned);
|
|
51
49
|
} })), isPinnable && pinnable && !isDefaultPinned && !isLast && (_jsx(PinIconContainer, Object.assign({ onClick: (event) => {
|
|
52
50
|
event.stopPropagation();
|
|
@@ -1,26 +1,43 @@
|
|
|
1
|
-
import { useRef, useCallback } from 'react';
|
|
1
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
export const useSynchronizedScroll = () => {
|
|
3
3
|
const pinnedStartVirtualListRef = useRef(null);
|
|
4
4
|
const scrollableVirtualListRef = useRef(null);
|
|
5
5
|
const pinnedEndVirtualListRef = useRef(null);
|
|
6
6
|
const isScrollingSyncRef = useRef(false);
|
|
7
|
+
const lastScrollOffsetRef = useRef(0);
|
|
8
|
+
const syncTimeoutRef = useRef(null);
|
|
9
|
+
const clearSyncTimeout = useCallback(() => {
|
|
10
|
+
if (syncTimeoutRef.current) {
|
|
11
|
+
clearTimeout(syncTimeoutRef.current);
|
|
12
|
+
syncTimeoutRef.current = null;
|
|
13
|
+
}
|
|
14
|
+
}, []);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
return () => {
|
|
17
|
+
clearSyncTimeout();
|
|
18
|
+
};
|
|
19
|
+
}, [clearSyncTimeout]);
|
|
7
20
|
const handleScroll = useCallback(({ scrollOffset }, source) => {
|
|
8
21
|
if (isScrollingSyncRef.current)
|
|
9
22
|
return;
|
|
23
|
+
clearSyncTimeout();
|
|
24
|
+
lastScrollOffsetRef.current = scrollOffset;
|
|
10
25
|
isScrollingSyncRef.current = true;
|
|
11
|
-
|
|
12
|
-
pinnedStartVirtualListRef.current
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
pinnedEndVirtualListRef.current
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
scrollableVirtualListRef.current
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
syncTimeoutRef.current = setTimeout(() => {
|
|
27
|
+
if (source !== 'start' && pinnedStartVirtualListRef.current) {
|
|
28
|
+
pinnedStartVirtualListRef.current.scrollTo(scrollOffset);
|
|
29
|
+
}
|
|
30
|
+
if (source !== 'end' && pinnedEndVirtualListRef.current) {
|
|
31
|
+
pinnedEndVirtualListRef.current.scrollTo(scrollOffset);
|
|
32
|
+
}
|
|
33
|
+
if (source !== 'scrollable' && scrollableVirtualListRef.current) {
|
|
34
|
+
scrollableVirtualListRef.current.scrollTo(scrollOffset);
|
|
35
|
+
}
|
|
36
|
+
requestAnimationFrame(() => {
|
|
37
|
+
isScrollingSyncRef.current = false;
|
|
38
|
+
});
|
|
39
|
+
}, 0);
|
|
40
|
+
}, [clearSyncTimeout]);
|
|
24
41
|
return {
|
|
25
42
|
pinnedStartVirtualListRef,
|
|
26
43
|
scrollableVirtualListRef,
|
|
@@ -25,13 +25,16 @@ const VirtualScrollList = React.forwardRef((_a, ref) => {
|
|
|
25
25
|
const renderedScrollTopRef = useRef(0);
|
|
26
26
|
const scrollTopRef = useRef(undefined);
|
|
27
27
|
const scrollLocked = useRef(false);
|
|
28
|
+
const isExternalScroll = useRef(false);
|
|
28
29
|
const internalListRef = useRef(null);
|
|
29
30
|
const listRef = ref || externalListRef || internalListRef;
|
|
30
31
|
const scrollTo = useCallback(() => {
|
|
31
32
|
var _a, _b;
|
|
32
33
|
clearTimer();
|
|
33
34
|
if (scrollTopRef.current !== undefined && listRef.current) {
|
|
34
|
-
|
|
35
|
+
if (!isExternalScroll.current) {
|
|
36
|
+
scrollLocked.current = false;
|
|
37
|
+
}
|
|
35
38
|
renderedScrollTopRef.current = scrollTopRef.current;
|
|
36
39
|
scrollTopRef.current = undefined;
|
|
37
40
|
handleBackDropVisibility();
|
|
@@ -45,6 +48,7 @@ const VirtualScrollList = React.forwardRef((_a, ref) => {
|
|
|
45
48
|
scrollTopRef.current = event.currentTarget.scrollTop;
|
|
46
49
|
if (!scrollLocked.current) {
|
|
47
50
|
scrollLocked.current = true;
|
|
51
|
+
isExternalScroll.current = false;
|
|
48
52
|
scrollTo();
|
|
49
53
|
}
|
|
50
54
|
}, [scrollTo]);
|
|
@@ -57,7 +61,22 @@ const VirtualScrollList = React.forwardRef((_a, ref) => {
|
|
|
57
61
|
const itemDataInternal = React.useMemo(() => (Object.assign(Object.assign({}, itemData), { renderedScrollTopRef })), [itemData]);
|
|
58
62
|
const handleOnScroll = React.useCallback((props) => {
|
|
59
63
|
onScroll === null || onScroll === void 0 ? void 0 : onScroll(props);
|
|
60
|
-
|
|
64
|
+
const isExternal = onScroll !== undefined;
|
|
65
|
+
if (isExternal) {
|
|
66
|
+
isExternalScroll.current = true;
|
|
67
|
+
}
|
|
68
|
+
requestAnimationFrame(() => {
|
|
69
|
+
if (!isExternalScroll.current || scrollTopRef.current !== undefined) {
|
|
70
|
+
if (scrollTo()) {
|
|
71
|
+
if (isExternal) {
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
isExternalScroll.current = false;
|
|
74
|
+
scrollLocked.current = false;
|
|
75
|
+
}, 16);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
61
80
|
}, [scrollTo, onScroll]);
|
|
62
81
|
return (_jsx(VirtualScrollOuterProvider, Object.assign({ value: handleScroll }, { children: _jsx(VariableSizeList, Object.assign({ ref: listRef, "data-testid": "VirtualScrollList", itemData: itemDataInternal, outerElementType: VirtualScrollOuter, innerElementType: VirtualScrollInner }, restProps, { onScroll: handleOnScroll }, { children: children })) })));
|
|
63
82
|
});
|
|
@@ -70,9 +70,9 @@ export declare const refundTableCellWidth: {
|
|
|
70
70
|
readonly sheet: "100px";
|
|
71
71
|
};
|
|
72
72
|
readonly merchant: {
|
|
73
|
-
readonly default: "
|
|
74
|
-
readonly text: "
|
|
75
|
-
readonly sheet: "
|
|
73
|
+
readonly default: "100px";
|
|
74
|
+
readonly text: "100px";
|
|
75
|
+
readonly sheet: "100px";
|
|
76
76
|
};
|
|
77
77
|
readonly reference: {
|
|
78
78
|
readonly default: "95px";
|
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.1.
|
|
4
|
+
"version": "0.1.63-test.3",
|
|
5
5
|
"testVersion": 3,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|