@tap-payments/os-micro-frontend-shared 0.1.365-test.16 → 0.1.365-test.17
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,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
interface FilterDropdownProps extends BoxProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
onConfirm: () => void;
|
|
5
6
|
onCancel: () => void;
|
|
@@ -8,5 +9,5 @@ interface FilterDropdownProps {
|
|
|
8
9
|
icon?: string;
|
|
9
10
|
title?: string;
|
|
10
11
|
}
|
|
11
|
-
export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled, children, isDisabled, icon, title }: Readonly<FilterDropdownProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled, children, isDisabled, icon, title, ...props }: Readonly<FilterDropdownProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useState, useEffect } from 'react';
|
|
2
14
|
import Box from '@mui/material/Box';
|
|
15
|
+
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
3
16
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useState, useEffect } from 'react';
|
|
5
|
-
import { ClickAwayListener } from '@mui/material';
|
|
6
17
|
import { darkFilterIcon } from '../../constants/index.js';
|
|
7
18
|
import { Menu, CustomBackdrop } from '../index.js';
|
|
8
19
|
import { CancelButton, FilterButton, Footer, OkayButton, TitleStyled } from './style';
|
|
9
|
-
export default function FilterDropdown(
|
|
20
|
+
export default function FilterDropdown(_a) {
|
|
21
|
+
var { onConfirm, onCancel, isOkayButDisabled, children, isDisabled, icon, title } = _a, props = __rest(_a, ["onConfirm", "onCancel", "isOkayButDisabled", "children", "isDisabled", "icon", "title"]);
|
|
10
22
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
23
|
const open = Boolean(anchorEl);
|
|
12
24
|
const { t } = useTranslation();
|
|
@@ -50,5 +62,5 @@ export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled,
|
|
|
50
62
|
onConfirm();
|
|
51
63
|
onClose();
|
|
52
64
|
};
|
|
53
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: handleCancel }, { children: _jsxs(Box, { children: [_jsx(FilterButton, Object.assign({ isActive: open, onClick: onOpen, sx: Object.assign({}, (isDisabled && { pointerEvents: 'none', opacity: 0.5 })) }, { children: _jsx(Box, { component: "img", src: icon !== null && icon !== void 0 ? icon : darkFilterIcon, alt: "filter" }) })), _jsxs(Menu, Object.assign({ anchorEl: anchorEl, open: open, sx: { marginTop: '8px', marginBottom: '8px', width: 193 }, placement: "bottom-end" }, { children: [_jsx(TitleStyled, Object.assign({ component: "span" }, { children: title !== null && title !== void 0 ? title : t('filterBy') })), children, _jsxs(Footer, { children: [_jsx(CancelButton, Object.assign({ onClick: handleCancel }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ disabled: isOkayButDisabled, onClick: handleConfirm }, { children: t('okay') }))] })] })), open && _jsx(CustomBackdrop, { onClick: onClose })] }) })));
|
|
65
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: handleCancel }, { children: _jsxs(Box, Object.assign({}, props, { children: [_jsx(FilterButton, Object.assign({ className: "filter-button", isActive: open, onClick: onOpen, sx: Object.assign({}, (isDisabled && Object.assign({ pointerEvents: 'none', opacity: 0.5 }, props.sx))) }, { children: _jsx(Box, { component: "img", src: icon !== null && icon !== void 0 ? icon : darkFilterIcon, alt: "filter" }) })), _jsxs(Menu, Object.assign({ anchorEl: anchorEl, open: open, sx: { marginTop: '8px', marginBottom: '8px', width: 193 }, placement: "bottom-end" }, { children: [_jsx(TitleStyled, Object.assign({ component: "span" }, { children: title !== null && title !== void 0 ? title : t('filterBy') })), children, _jsxs(Footer, { children: [_jsx(CancelButton, Object.assign({ onClick: handleCancel }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ disabled: isOkayButDisabled, onClick: handleConfirm }, { children: t('okay') }))] })] })), open && _jsx(CustomBackdrop, { onClick: onClose })] })) })));
|
|
54
66
|
}
|
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.365-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.365-test.17",
|
|
5
|
+
"testVersion": 17,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|