@tap-payments/os-micro-frontend-shared 0.0.297 → 0.0.299

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.
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import Skeleton from '@mui/material/Skeleton';
2
4
  import Box from '@mui/material/Box';
3
- import { Container, BadgeBox } from './style';
4
5
  import { brandPlaceholderIcon } from '../../constants/index.js';
6
+ import { Container, BadgeBox } from './style';
5
7
  import Tooltip from '../Tooltip';
6
- import { useState } from 'react';
7
- import Skeleton from '@mui/material/Skeleton';
8
8
  export default function IconWithBadge({ mainIcon, overlayIcon, mainIconAlt = 'main icon', mainIconSize = 20, containerSize = 24, overlayPosition = { top: 10, left: 17 }, borderColor = '#F2F2F2', label = '', sx, onError, }) {
9
9
  const [isLoading, setIsLoading] = useState(true);
10
10
  return (_jsx(Tooltip, Object.assign({ title: label }, { children: _jsx(Box, Object.assign({ display: "flex", alignItems: "center", gap: 1, sx: { position: 'relative' } }, { children: _jsxs(Container, Object.assign({ style: {
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
13
13
  import Tooltip from '../../../Tooltip';
14
14
  import { destinationSolidIcon } from '../../../../constants/index.js';
15
15
  import { formatAmount } from '../../../../utils/index.js';
@@ -25,19 +25,12 @@ function DestinationCell(_a) {
25
25
  const firstDestinationFormattedAmount = formatAmount(((_b = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _b === void 0 ? void 0 : _b.amount) || 0);
26
26
  const isSheetView = tableMode === 'sheet';
27
27
  if (isSheetView) {
28
- const sheetViewChips = destinations === null || destinations === void 0 ? void 0 : destinations.reduce((acc, dest) => {
28
+ const sheetViewChips = destinations === null || destinations === void 0 ? void 0 : destinations.map((dest) => {
29
29
  const formattedDestAmount = formatAmount((dest === null || dest === void 0 ? void 0 : dest.amount) || 0);
30
- return [
31
- ...acc,
32
- {
33
- key: 'id',
34
- content: dest === null || dest === void 0 ? void 0 : dest.id,
35
- },
36
- {
37
- key: 'amount',
38
- content: (_jsxs(_Fragment, { children: [_jsx(CurrencyIcon, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] })),
39
- },
40
- ];
30
+ return {
31
+ key: 'destination',
32
+ content: (_jsxs(_Fragment, { children: [_jsxs("div", { children: [dest === null || dest === void 0 ? void 0 : dest.id, " |"] }), _jsx(CurrencyIcon, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] })),
33
+ };
41
34
  }, []);
42
35
  return (_jsx(TableCell, Object.assign({ sx: {
43
36
  width: 'fit-content',
@@ -4,5 +4,5 @@ interface InputsI {
4
4
  onCloseDropdown: (e: MouseEvent<HTMLElement>) => void;
5
5
  filter: IColumnFilter & IColumnFilterInputs;
6
6
  }
7
- declare function Inputs({ onCloseDropdown, filter: { options, onConfirm, data, isOnlyOneFilter, onColumnFilterClearClick, wrapperSx } }: InputsI): import("react/jsx-runtime").JSX.Element;
7
+ declare function Inputs({ onCloseDropdown, filter: { options, onConfirm, data, isOnlyOneFilter, onClearFilterFields, wrapperSx } }: InputsI): import("react/jsx-runtime").JSX.Element;
8
8
  export default Inputs;
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
7
7
  import { grayCloseIcon, searchIcon } from '../../../../../constants/index.js';
8
8
  import { Wrapper, Text, InputStyled, InputsWrapper, ClearButton, ClearWrapper } from './style';
9
9
  import { CancelButton, Footer, OkayButton } from '../style';
10
- function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOnlyOneFilter, onColumnFilterClearClick, wrapperSx } }) {
10
+ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOnlyOneFilter, onClearFilterFields, wrapperSx } }) {
11
11
  const [values, setValues] = useState({});
12
12
  useEffect(() => {
13
13
  setValues((options || []).reduce((acc, { apiKey }) => { var _a; return (Object.assign(Object.assign({}, acc), { [apiKey]: (_a = data === null || data === void 0 ? void 0 : data[apiKey]) !== null && _a !== void 0 ? _a : '' })); }, {}));
@@ -21,7 +21,7 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
21
21
  onCloseDropdown(e);
22
22
  };
23
23
  const onClickClear = () => {
24
- onColumnFilterClearClick === null || onColumnFilterClearClick === void 0 ? void 0 : onColumnFilterClearClick();
24
+ onClearFilterFields === null || onClearFilterFields === void 0 ? void 0 : onClearFilterFields();
25
25
  setValues(options.reduce((acc, { apiKey }) => (Object.assign(Object.assign({}, acc), { [apiKey]: '' })), {}));
26
26
  };
27
27
  const isInputHasValue = (key) => values[key] !== undefined && values[key].length > 0;
@@ -136,7 +136,7 @@ export type ColumnFilterValues = Record<string, string | string[] | Record<strin
136
136
  export type IColumnFilter = ({
137
137
  onConfirm?: (filterValues: ColumnFilterValues) => void;
138
138
  onClear: (apiKeys: string[]) => void;
139
- onColumnFilterClearClick?: () => void;
139
+ onClearFilterFields?: () => void;
140
140
  data?: ColumnFilterValues;
141
141
  isOnlyOneFilter?: boolean;
142
142
  wrapperSx?: SxProps;
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.0.297",
4
+ "version": "0.0.299",
5
5
  "testVersion": 9,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
@@ -131,4 +131,4 @@
131
131
  "publishConfig": {
132
132
  "registry": "https://registry.npmjs.org/"
133
133
  }
134
- }
134
+ }