@tap-payments/os-micro-frontend-shared 0.1.108 → 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.
@@ -28,4 +28,5 @@ export declare const actionIcons: {
28
28
  users: string;
29
29
  brand: string;
30
30
  clipboard: string;
31
+ viewApi: string;
31
32
  };
@@ -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
  }, {}, {}>;
@@ -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 !== undefined && v !== null && 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 !== undefined && v !== null && v !== '');
11
+ return Object.values(value || {}).some((v) => !isEmptyValue(v));
11
12
  }
12
- return !!value;
13
+ return !isEmptyValue(value);
13
14
  }));
14
15
  }
@@ -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,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.108",
4
+ "version": "0.1.109",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",