@tap-payments/os-micro-frontend-shared 0.1.106 → 0.1.109
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/build/components/TableCells/CustomCells/ActionCell/constant.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ActionCell/constant.js +2 -1
- package/build/components/TableCells/CustomCells/ActionCell/hooks/useActionCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -1
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +4 -3
- package/build/utils/table.d.ts +3 -1
- package/build/utils/table.js +7 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BadgeVariants } from '../../../CountBadge';
|
|
2
|
-
import { flagIcon, clockIcon, disputeIcon, redFlagIcon, cancelledIcon, closedFlagIcon, orangeFlagIcon, refundInitiatedIcon, viewInvoiceIcon, reverseActionIcon, voidedIcon, capturedDropdownIcon, destinationReversedTableIcon, brandPlaceholderIcon, usersIcon, clipboardIcon, } from '../../../../constants/index.js';
|
|
2
|
+
import { flagIcon, clockIcon, disputeIcon, redFlagIcon, cancelledIcon, closedFlagIcon, orangeFlagIcon, refundInitiatedIcon, viewInvoiceIcon, reverseActionIcon, voidedIcon, capturedDropdownIcon, destinationReversedTableIcon, brandPlaceholderIcon, usersIcon, clipboardIcon, jsonBlackIcon, } from '../../../../constants/index.js';
|
|
3
3
|
export const flags = {
|
|
4
4
|
GRAY: { icon: closedFlagIcon, color: '#CFCFCF' },
|
|
5
5
|
ORANGE: { icon: orangeFlagIcon, color: '#FFD503' },
|
|
@@ -24,4 +24,5 @@ export const actionIcons = {
|
|
|
24
24
|
users: usersIcon,
|
|
25
25
|
brand: brandPlaceholderIcon,
|
|
26
26
|
clipboard: clipboardIcon,
|
|
27
|
+
viewApi: jsonBlackIcon,
|
|
27
28
|
};
|
|
@@ -13,7 +13,7 @@ export declare function useActionCell({ actions, isDropdownShown, onCloseDropdow
|
|
|
13
13
|
label: string;
|
|
14
14
|
onClick: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
15
15
|
onRightClick?: ((e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void) | undefined;
|
|
16
|
-
icon: "brand" | "users" | "cancel" | "reverse" | "refund" | "destination" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard";
|
|
16
|
+
icon: "brand" | "users" | "cancel" | "reverse" | "refund" | "destination" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard" | "viewApi";
|
|
17
17
|
isLoading?: boolean | undefined;
|
|
18
18
|
isError?: boolean | undefined;
|
|
19
19
|
isSuccess?: boolean | undefined;
|
|
@@ -283,5 +283,5 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
|
|
|
283
283
|
fetchPriority?: "auto" | "high" | "low" | undefined;
|
|
284
284
|
srcSet?: string | undefined;
|
|
285
285
|
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
286
|
-
icon?: "brand" | "users" | "cancel" | "reverse" | "refund" | "destination" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard" | undefined;
|
|
286
|
+
icon?: "brand" | "users" | "cancel" | "reverse" | "refund" | "destination" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard" | "viewApi" | undefined;
|
|
287
287
|
}, {}, {}>;
|
package/build/utils/object.d.ts
CHANGED
|
@@ -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
|
};
|
package/build/utils/object.js
CHANGED
|
@@ -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
|
|
13
|
+
return !isEmptyValue(value);
|
|
13
14
|
}));
|
|
14
15
|
}
|
package/build/utils/table.d.ts
CHANGED
|
@@ -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
|
|
9
|
+
export declare const isTableDefaultMode: (tableMode: TableMode) => boolean;
|
|
10
|
+
export declare const isTableSheetMode: (tableMode: TableMode) => boolean;
|
|
11
|
+
export declare const isTableTextMode: (tableMode: TableMode) => boolean;
|
package/build/utils/table.js
CHANGED
|
@@ -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
|
|
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