@tap-payments/os-micro-frontend-shared 0.1.9-test.1 → 0.1.9-test.51

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 (74) hide show
  1. package/build/components/ActionMenu/style.d.ts +1 -1
  2. package/build/components/Chip/style.d.ts +1 -1
  3. package/build/components/CountBadge/style.d.ts +1 -1
  4. package/build/components/Dialog/style.d.ts +1 -1
  5. package/build/components/FlippingCard/style.d.ts +1 -1
  6. package/build/components/ImageWrapper/ImageWrapper.d.ts +1 -1
  7. package/build/components/JSONViewer/style.d.ts +2 -2
  8. package/build/components/SearchButton/styles.d.ts +3 -3
  9. package/build/components/StatusIcons/AuthIcons/style.d.ts +2 -2
  10. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +1 -1
  11. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +6 -6
  12. package/build/components/StatusIcons/SourceIcons/style.d.ts +1 -1
  13. package/build/components/TableCells/CustomCells/ActionCell/hooks/useActionCell.d.ts +1 -1
  14. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +2 -2
  15. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +1 -1
  16. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +2 -2
  17. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +5 -5
  18. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +5 -5
  19. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +1 -1
  20. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +1 -1
  21. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +1 -1
  22. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +5 -5
  23. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +1 -1
  24. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +2 -2
  25. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +1 -1
  26. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +1 -1
  27. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +5 -5
  28. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +1 -1
  29. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -1
  30. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +2 -2
  31. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -1
  32. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +1 -1
  33. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -1
  34. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +1 -1
  35. package/build/components/TableCells/CustomCells/SourceMergedCell/SourceMergedCell.js +1 -1
  36. package/build/components/TableCells/CustomCells/SourceMergedCell/style.d.ts +6 -6
  37. package/build/components/TableCells/CustomCells/SourceMergedCell/type.d.ts +1 -1
  38. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +6 -6
  39. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +5 -5
  40. package/build/components/TableCells/CustomCells/style.d.ts +1 -1
  41. package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +28 -174
  42. package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataSection.d.ts +32 -0
  43. package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataSection.js +30 -0
  44. package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumnSection.d.ts +49 -0
  45. package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumnSection.js +20 -0
  46. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/SheetViewTableHeader.js +1 -1
  47. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/TableCell.js +1 -1
  48. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.js +1 -1
  49. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableNoData.js +1 -1
  50. package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualListSection.d.ts +32 -0
  51. package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualListSection.js +72 -0
  52. package/build/components/VirtualTables/SheetViewVirtualTable/components/index.d.ts +3 -0
  53. package/build/components/VirtualTables/SheetViewVirtualTable/components/index.js +3 -0
  54. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedWidths.d.ts +5 -0
  55. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedWidths.js +12 -0
  56. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useSelection.d.ts +6 -0
  57. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useSelection.js +17 -0
  58. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useSheetViewStates.d.ts +14 -0
  59. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useSheetViewStates.js +20 -0
  60. package/build/components/VirtualTables/SheetViewVirtualTable/style.d.ts +0 -2
  61. package/build/components/VirtualTables/SheetViewVirtualTable/style.js +0 -10
  62. package/build/components/VirtualTables/VirtualTable/VirtualTable.d.ts +1 -1
  63. package/build/components/VirtualTables/VirtualTable/VirtualTable.js +19 -79
  64. package/build/components/VirtualTables/VirtualTable/VirtualTableList.d.ts +19 -0
  65. package/build/components/VirtualTables/VirtualTable/VirtualTableList.js +27 -0
  66. package/build/components/VirtualTables/VirtualTable/useVirtualTable.d.ts +31 -0
  67. package/build/components/VirtualTables/VirtualTable/useVirtualTable.js +70 -0
  68. package/build/components/VirtualTables/components/TableRow.js +1 -1
  69. package/build/components/VirtualTables/components/style.d.ts +1 -1
  70. package/build/components/Window/style.d.ts +2 -2
  71. package/build/types/table.d.ts +0 -1
  72. package/package.json +2 -2
  73. /package/build/components/VirtualTables/{utils/getSelectionStyles.d.ts → components/utils.d.ts} +0 -0
  74. /package/build/components/VirtualTables/{utils/getSelectionStyles.js → components/utils.js} +0 -0
@@ -0,0 +1,70 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
11
+ import memoize from 'memoize-one';
12
+ import { useDelayToSetValue } from '../../../hooks/index.js';
13
+ import { hasError, isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError } from '../../../utils/index.js';
14
+ const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded) => ({
15
+ columns,
16
+ isLoading,
17
+ rows,
18
+ rowProps,
19
+ scrollToIndex,
20
+ totalCount,
21
+ lastItemIndex,
22
+ isError,
23
+ areAllRowsLoaded,
24
+ }));
25
+ export function useVirtualTable({ columns, rows, rowProps, footerProps, isLoading, error, isFetchingNextPage, scrollToIndex, areAllRowsLoaded = false, loadMoreItems, }) {
26
+ var _a;
27
+ const isDelayedFetchingNextPage = !!useDelayToSetValue({ value: isFetchingNextPage, delay: 1000 });
28
+ const [showBackDrop, setShowBackdrop] = useState(false);
29
+ const isError = hasError(error);
30
+ const tableLoading = isLoading !== null && isLoading !== void 0 ? isLoading : true;
31
+ const tableError = !isLoading && rows.length === 0 && isError && !isNotFoundError(error);
32
+ const tableEmpty = !isLoading && rows.length === 0;
33
+ const hasTimeoutError = isTimeoutError(error);
34
+ const lastItemIndex = rows.length - 1;
35
+ const shownColumns = useMemo(() => columns.filter((column) => !column.hidden), [columns]);
36
+ const orderedColumns = useMemo(() => shownColumns.slice().sort((a, b) => { var _a, _b; return ((_a = a === null || a === void 0 ? void 0 : a.order) !== null && _a !== void 0 ? _a : 1000000) - ((_b = b === null || b === void 0 ? void 0 : b.order) !== null && _b !== void 0 ? _b : 1000000); }), [shownColumns]);
37
+ const areTotalRowsNotFillingHeight = isHeightNotFullyFilledByRows(rows.length) && !tableLoading;
38
+ const itemsCount = isDelayedFetchingNextPage || (areAllRowsLoaded && !areTotalRowsNotFillingHeight) ? rows.length + 1 : rows.length;
39
+ const itemData = createItemData(orderedColumns, isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, lastItemIndex, (_a = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _a !== void 0 ? _a : 0, isError, areAllRowsLoaded && !areTotalRowsNotFillingHeight);
40
+ const listRef = useRef(null);
41
+ useEffect(() => {
42
+ if (listRef.current && typeof listRef.current.resetAfterIndex === 'function') {
43
+ listRef.current.resetAfterIndex(0, true);
44
+ }
45
+ }, []);
46
+ const setBackdropVisibility = useCallback((isVisible) => {
47
+ setShowBackdrop(isVisible);
48
+ }, []);
49
+ const loadMoreItemsSafe = useCallback(() => __awaiter(this, void 0, void 0, function* () {
50
+ yield (loadMoreItems === null || loadMoreItems === void 0 ? void 0 : loadMoreItems());
51
+ }), [loadMoreItems]);
52
+ const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
53
+ return {
54
+ isDelayedFetchingNextPage,
55
+ isError,
56
+ tableLoading,
57
+ tableError,
58
+ tableEmpty,
59
+ hasTimeoutError,
60
+ showNoDataView,
61
+ orderedColumns,
62
+ areTotalRowsNotFillingHeight,
63
+ itemsCount,
64
+ itemData,
65
+ listRef,
66
+ showBackDrop,
67
+ setBackdropVisibility,
68
+ loadMoreItemsSafe,
69
+ };
70
+ }
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
3
  import { memo, useMemo } from 'react';
4
4
  import { areEqual } from 'react-window';
5
5
  import { StyledCell, StyledTableRow } from './style';
6
- import { getSelectionStyles } from '../utils/getSelectionStyles';
6
+ import { getSelectionStyles } from './utils';
7
7
  function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = null, selectedColumn = null, onCellClick, isLastRow = false, }) {
8
8
  const renderCell = (column) => {
9
9
  const { render, format, selector } = column;
@@ -114,7 +114,7 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
114
114
  "aria-description"?: string | undefined;
115
115
  "aria-details"?: string | undefined;
116
116
  "aria-disabled"?: (boolean | "false" | "true") | undefined;
117
- "aria-dropeffect"?: "none" | "copy" | "link" | "move" | "execute" | "popup" | undefined;
117
+ "aria-dropeffect"?: "none" | "link" | "copy" | "move" | "execute" | "popup" | undefined;
118
118
  "aria-errormessage"?: string | undefined;
119
119
  "aria-expanded"?: (boolean | "false" | "true") | undefined;
120
120
  "aria-flowto"?: string | undefined;
@@ -70,7 +70,7 @@ export declare const ContentWrapper: import("@emotion/styled").StyledComponent<{
70
70
  "aria-description"?: string | undefined;
71
71
  "aria-details"?: string | undefined;
72
72
  "aria-disabled"?: (boolean | "false" | "true") | undefined;
73
- "aria-dropeffect"?: "none" | "copy" | "link" | "move" | "execute" | "popup" | undefined;
73
+ "aria-dropeffect"?: "none" | "link" | "copy" | "move" | "execute" | "popup" | undefined;
74
74
  "aria-errormessage"?: string | undefined;
75
75
  "aria-expanded"?: (boolean | "false" | "true") | undefined;
76
76
  "aria-flowto"?: string | undefined;
@@ -337,7 +337,7 @@ export declare const AppContainerContainer: import("@emotion/styled").StyledComp
337
337
  "aria-description"?: string | undefined;
338
338
  "aria-details"?: string | undefined;
339
339
  "aria-disabled"?: (boolean | "false" | "true") | undefined;
340
- "aria-dropeffect"?: "none" | "copy" | "link" | "move" | "execute" | "popup" | undefined;
340
+ "aria-dropeffect"?: "none" | "link" | "copy" | "move" | "execute" | "popup" | undefined;
341
341
  "aria-errormessage"?: string | undefined;
342
342
  "aria-expanded"?: (boolean | "false" | "true") | undefined;
343
343
  "aria-flowto"?: string | undefined;
@@ -126,7 +126,6 @@ export interface IVirtualTable<R = any> {
126
126
  width: string | number;
127
127
  };
128
128
  dragControls?: DragControls;
129
- isSheetView?: boolean;
130
129
  }
131
130
  export type ColumnFilterValues = Record<string, string | string[] | Record<string, boolean> | {
132
131
  phone: string;
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.9-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.9-test.51",
5
+ "testVersion": 51,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",