@tap-payments/os-micro-frontend-shared 0.1.270 → 0.1.271-test.10
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/Chip/style.d.ts +0 -1
- package/build/components/CountBadge/style.d.ts +0 -1
- package/build/components/Dialog/style.d.ts +0 -1
- package/build/components/FlippingCard/style.d.ts +0 -1
- package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
- package/build/components/JSONViewer/style.d.ts +0 -1
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
- package/build/components/SearchButton/styles.d.ts +0 -1
- package/build/components/StatusBar/StatusBar.js +4 -3
- package/build/components/StatusBar/type.d.ts +1 -1
- package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
- package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/style.d.ts +0 -1
- package/build/components/TableHeader/FiltersRow.d.ts +1 -1
- package/build/components/TableHeader/FiltersRow.js +17 -4
- package/build/components/TableHeader/FiltersRowWrapper.d.ts +5 -0
- package/build/components/TableHeader/FiltersRowWrapper.js +18 -0
- package/build/components/TableHeader/TableHeader.d.ts +5 -4
- package/build/components/TableHeader/TableHeader.js +21 -6
- package/build/components/TableHeader/TableHeaderWrapper.d.ts +5 -0
- package/build/components/TableHeader/TableHeaderWrapper.js +18 -0
- package/build/components/TableHeader/TableModeButton.d.ts +9 -0
- package/build/components/TableHeader/TableModeButton.js +11 -0
- package/build/components/TableHeader/TableView/ColumnItem.d.ts +14 -0
- package/build/components/TableHeader/TableView/ColumnItem.js +29 -0
- package/build/components/TableHeader/TableView/CustomViews.d.ts +5 -0
- package/build/components/TableHeader/TableView/CustomViews.js +21 -0
- package/build/components/TableHeader/TableView/DefaultViews.d.ts +13 -0
- package/build/components/TableHeader/TableView/DefaultViews.js +22 -0
- package/build/components/TableHeader/TableView/TableView.d.ts +12 -0
- package/build/components/TableHeader/TableView/TableView.js +55 -0
- package/build/components/TableHeader/TableView/hooks/index.d.ts +3 -0
- package/build/components/TableHeader/TableView/hooks/index.js +3 -0
- package/build/components/TableHeader/TableView/hooks/useColumnItem.d.ts +21 -0
- package/build/components/TableHeader/TableView/hooks/useColumnItem.js +29 -0
- package/build/components/TableHeader/TableView/hooks/useSubMenu.d.ts +10 -0
- package/build/components/TableHeader/TableView/hooks/useSubMenu.js +31 -0
- package/build/components/TableHeader/TableView/hooks/useViewColumns.d.ts +13 -0
- package/build/components/TableHeader/TableView/hooks/useViewColumns.js +45 -0
- package/build/components/TableHeader/TableView/index.d.ts +3 -0
- package/build/components/TableHeader/TableView/index.js +3 -0
- package/build/components/TableHeader/TableView/style.d.ts +24 -0
- package/build/components/TableHeader/TableView/style.js +102 -0
- package/build/components/TableHeader/TableView/type.d.ts +10 -0
- package/build/components/TableHeader/TableView/type.js +1 -0
- package/build/components/TableHeader/data.d.ts +5 -0
- package/build/components/TableHeader/data.js +7 -0
- package/build/components/TableHeader/index.d.ts +6 -2
- package/build/components/TableHeader/index.js +6 -2
- package/build/components/TableHeader/style.d.ts +1 -1
- package/build/components/TableHeader/style.js +1 -1
- package/build/components/TableHeader/type.d.ts +19 -11
- package/build/components/TableHeader/type.js +0 -7
- package/build/components/Tooltip/Tooltip.js +3 -2
- package/build/components/VirtualTables/components/style.d.ts +0 -1
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/types/tsUtils.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
import { GetSourceAnimationFunction } from './type';
|
|
4
3
|
export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
4
|
variant?: import("./type").ChipVariant | undefined;
|
|
@@ -35,10 +35,11 @@ function StatusBar({ isFilteredIdsShown, availableStatuses, status, onStatusChan
|
|
|
35
35
|
}
|
|
36
36
|
}, buttonSx: buttonSx })));
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
if (!statusItems)
|
|
38
|
+
if (!s.status)
|
|
40
39
|
return null;
|
|
41
|
-
const
|
|
40
|
+
const statusItems = s.status;
|
|
41
|
+
const formattedStatuses = (statusItems.filter(Boolean).map((item) => (typeof item === 'string' ? { value: item } : item)) ||
|
|
42
|
+
[]);
|
|
42
43
|
const hasMatchingDropdownStatus = !!status && formattedStatuses.some((item) => (item === null || item === void 0 ? void 0 : item.value) === status);
|
|
43
44
|
const variant = hasMatchingDropdownStatus ? 'active' : 'inActive';
|
|
44
45
|
const selectedStatus = hasMatchingDropdownStatus ? status : (_b = formattedStatuses[0]) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -6,7 +6,7 @@ export type DetailedStatusItem<T> = {
|
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
};
|
|
8
8
|
export type AvailableStatus<T extends TableHeaderStatus | TableHeaderStatus[] = undefined> = StatusButtonProps & {
|
|
9
|
-
status?: T | DetailedStatusItem<T>[];
|
|
9
|
+
status?: T | T[] | DetailedStatusItem<T>[];
|
|
10
10
|
render?: <IStatus extends T>(controls: {
|
|
11
11
|
status: IStatus;
|
|
12
12
|
onChange: (selected?: T) => void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
import { TableMode } from '../../../../types/index.js';
|
|
4
3
|
export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
4
|
tableMode?: TableMode | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
|
|
5
4
|
hidden?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
3
|
export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
|
|
5
4
|
hidden?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
5
4
|
hidden?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
3
|
variant?: "Global" | "Regional" | "Local" | undefined;
|
|
5
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FilterRowProps } from './type';
|
|
2
|
-
export
|
|
2
|
+
export default function FiltersRow({ date, calendarMode, onDateChange, onCalendarModeSwitch, tableReportsComponent, tableFilterComponent, isReportsButtonVisible, onViewChange, onSearchChange, onToggleViewButtonClick, rightActions, leftActions, setTableViews, tableViews, resetTableViews, onToggleTextButtonClick, calendarGroupBy, onCalendarGroupChange, maxDateRange, searchPlaceholder, isAcceptance, tableMode, timezone, browserTimezone, defaultCountryTimezone, onChangeTimezone, segmentCountries, }: FilterRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { SearchButton, StyledButton, Icon, RangeCalender } from '../index.js';
|
|
4
|
+
import { viewIcon } from '../../constants/index.js';
|
|
5
|
+
import FiltersRowWrapper from './FiltersRowWrapper';
|
|
6
|
+
import TableView from './TableView';
|
|
7
|
+
import TableModeButton from './TableModeButton';
|
|
8
|
+
export default function FiltersRow({ date, calendarMode, onDateChange, onCalendarModeSwitch, tableReportsComponent, tableFilterComponent, isReportsButtonVisible, onViewChange, onSearchChange, onToggleViewButtonClick, rightActions, leftActions, setTableViews, tableViews, resetTableViews, onToggleTextButtonClick, calendarGroupBy, onCalendarGroupChange, maxDateRange = 31, searchPlaceholder, isAcceptance, tableMode = 'default', timezone, browserTimezone, defaultCountryTimezone, onChangeTimezone, segmentCountries, }) {
|
|
9
|
+
const [isViewVisible, setIsViewVisible] = useState(false);
|
|
10
|
+
const timezoneCountriesCodes = useMemo(() => segmentCountries.map(({ code }) => code), [segmentCountries]);
|
|
11
|
+
const tableModeButton = useMemo(() => _jsx(TableModeButton, { tableMode: tableMode, onToggle: onToggleTextButtonClick }), [tableMode, onToggleTextButtonClick]);
|
|
12
|
+
return (_jsxs(FiltersRowWrapper, { children: [leftActions && !isViewVisible && leftActions, !isViewVisible && (_jsxs(_Fragment, { children: [onSearchChange && _jsx(SearchButton, { onSearchChange: onSearchChange, placeholder: searchPlaceholder }), tableFilterComponent, onToggleTextButtonClick && !isAcceptance && tableModeButton, date && (_jsx(RangeCalender, { defaultDate: date, onDateChange: (newDate) => {
|
|
13
|
+
const [startDate, endDate] = newDate;
|
|
14
|
+
if (startDate && endDate) {
|
|
15
|
+
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange([startDate, endDate]);
|
|
16
|
+
}
|
|
17
|
+
}, mode: calendarMode, onCalendarModeSwitch: onCalendarModeSwitch, maxDateRange: maxDateRange, groupBy: calendarGroupBy, onCalendarGroupChange: onCalendarGroupChange, browserTimezone: browserTimezone, defaultCountryTimezone: defaultCountryTimezone, timezone: timezone, onChangeTimezone: onChangeTimezone, timezoneCountriesCodes: timezoneCountriesCodes })), isReportsButtonVisible && tableReportsComponent, onToggleTextButtonClick && isAcceptance && tableModeButton] })), onToggleViewButtonClick && (_jsx(StyledButton, { children: _jsx(Icon, { src: viewIcon, alt: "view", sx: { width: 14, height: 14 } }) })), onViewChange && (_jsx(TableView, { onViewChange: onViewChange, setIsViewVisible: setIsViewVisible, tableViews: tableViews, setTableViews: setTableViews, resetTableViews: resetTableViews })), rightActions && !isViewVisible && rightActions] }));
|
|
5
18
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import type { BoxProps } from '@mui/material/Box';
|
|
3
|
+
export type FiltersRowWrapperProps<T extends React.ElementType = 'aside'> = PropsWithChildren<BoxProps<T>>;
|
|
4
|
+
declare const FiltersRowWrapper: <T extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "aside">(props: Readonly<FiltersRowWrapperProps<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default FiltersRowWrapper;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { FiltersRowContainer } from './style';
|
|
14
|
+
const FiltersRowWrapper = (props) => {
|
|
15
|
+
const { children, component = 'aside' } = props, rest = __rest(props, ["children", "component"]);
|
|
16
|
+
return (_jsx(FiltersRowContainer, Object.assign({ component: component, "data-testid": "FiltersRow" }, rest, { children: children })));
|
|
17
|
+
};
|
|
18
|
+
export default FiltersRowWrapper;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare
|
|
4
|
-
|
|
1
|
+
import type { TableHeaderProps } from './type';
|
|
2
|
+
import { type TableHeaderStatus } from '../../types/index.js';
|
|
3
|
+
export declare function TableHeader<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined>({ date, status, availableStatuses, showMaximizedView, title, calendarMode, tableReportsComponent, tableFilterComponent, onStatusChange, onViewChange, onDateChange, onCalendarModeSwitch, filteredIds, onCancelFilteredIdsClick, isFilteredIdsShown, cardNumber, leftActions, rightActions, isReportsButtonVisible, onSearchChange, onToggleViewButtonClick, leftComponent, tableViews, setTableViews, resetTableViews, onToggleTextButtonClick, calendarGroupBy, onCalendarGroupChange, children, maxDateRange, isAcceptance, startComponent, searchPlaceholder, tableMode, timezone, browserTimezone, defaultCountryTimezone, onChangeTimezone, segmentCountries, ...StatusBarProps }: TableHeaderProps<IStatus>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const _default: typeof TableHeader;
|
|
5
|
+
export default _default;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
6
11
|
};
|
|
7
|
-
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { FilteredIds, StatusBar, TableHeaderWrapper } from '../index.js';
|
|
15
|
+
import FiltersRow from './FiltersRow';
|
|
16
|
+
import { StatusButtonsContainer, TitleContainer, TableHeaderTitle, TableHeaderRow } from './style';
|
|
17
|
+
export function TableHeader(_a) {
|
|
18
|
+
var { date, status, availableStatuses, showMaximizedView, title, calendarMode, tableReportsComponent, tableFilterComponent, onStatusChange, onViewChange, onDateChange, onCalendarModeSwitch, filteredIds, onCancelFilteredIdsClick, isFilteredIdsShown, cardNumber, leftActions, rightActions, isReportsButtonVisible, onSearchChange, onToggleViewButtonClick, leftComponent, tableViews, setTableViews, resetTableViews, onToggleTextButtonClick, calendarGroupBy, onCalendarGroupChange, children, maxDateRange, isAcceptance, startComponent, searchPlaceholder, tableMode, timezone, browserTimezone, defaultCountryTimezone, onChangeTimezone, segmentCountries = [] } = _a, StatusBarProps = __rest(_a, ["date", "status", "availableStatuses", "showMaximizedView", "title", "calendarMode", "tableReportsComponent", "tableFilterComponent", "onStatusChange", "onViewChange", "onDateChange", "onCalendarModeSwitch", "filteredIds", "onCancelFilteredIdsClick", "isFilteredIdsShown", "cardNumber", "leftActions", "rightActions", "isReportsButtonVisible", "onSearchChange", "onToggleViewButtonClick", "leftComponent", "tableViews", "setTableViews", "resetTableViews", "onToggleTextButtonClick", "calendarGroupBy", "onCalendarGroupChange", "children", "maxDateRange", "isAcceptance", "startComponent", "searchPlaceholder", "tableMode", "timezone", "browserTimezone", "defaultCountryTimezone", "onChangeTimezone", "segmentCountries"]);
|
|
19
|
+
const filtersRow = (_jsx(FiltersRow, { date: date, calendarMode: calendarMode, onDateChange: onDateChange, onCalendarModeSwitch: onCalendarModeSwitch, tableReportsComponent: tableReportsComponent, tableFilterComponent: tableFilterComponent, onViewChange: onViewChange, leftActions: leftActions, rightActions: rightActions, onSearchChange: onSearchChange, onToggleViewButtonClick: onToggleViewButtonClick, isReportsButtonVisible: isReportsButtonVisible, tableViews: tableViews, setTableViews: setTableViews, resetTableViews: resetTableViews, onToggleTextButtonClick: onToggleTextButtonClick, tableMode: tableMode, onCalendarGroupChange: onCalendarGroupChange, calendarGroupBy: calendarGroupBy, maxDateRange: maxDateRange, isAcceptance: isAcceptance, searchPlaceholder: searchPlaceholder, timezone: timezone, browserTimezone: browserTimezone, defaultCountryTimezone: defaultCountryTimezone, onChangeTimezone: onChangeTimezone, segmentCountries: segmentCountries }));
|
|
20
|
+
return (_jsxs(TableHeaderWrapper, { children: [showMaximizedView && (_jsxs(TitleContainer, { children: [_jsx("span", { children: !!title && _jsx(TableHeaderTitle, { children: title }) }), filtersRow] }, "TitleContainer")), _jsxs(TableHeaderRow, Object.assign({ as: "section" }, { children: [_jsxs(StatusButtonsContainer, Object.assign({ as: "aside" }, { children: [startComponent, _jsx(StatusBar, Object.assign({ status: status, availableStatuses: availableStatuses, onStatusChange: onStatusChange, isFilteredIdsShown: isFilteredIdsShown }, StatusBarProps)), leftComponent, isFilteredIdsShown && (_jsx(FilteredIds, { cardNumber: cardNumber, Ids: filteredIds, isShown: isFilteredIdsShown, onCancelClick: onCancelFilteredIdsClick }, "FilteredIds"))] })), !showMaximizedView && filtersRow] }), "FiltersWrapper"), children] }));
|
|
21
|
+
}
|
|
22
|
+
export default memo(TableHeader);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import type { BoxProps } from '@mui/material/Box';
|
|
3
|
+
export type TableHeaderWrapperProps<T extends React.ElementType = 'header'> = PropsWithChildren<BoxProps<T>>;
|
|
4
|
+
declare const TableHeaderWrapper: <T extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "header">(props: TableHeaderWrapperProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default TableHeaderWrapper;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { TableHeaderContainer } from './style';
|
|
14
|
+
const TableHeaderWrapper = (props) => {
|
|
15
|
+
const { children, component = 'header' } = props, rest = __rest(props, ["children", "component"]);
|
|
16
|
+
return (_jsx(TableHeaderContainer, Object.assign({ component: component, "data-testid": "TableHeader" }, rest, { children: children })));
|
|
17
|
+
};
|
|
18
|
+
export default TableHeaderWrapper;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableMode } from '../../types/index.js';
|
|
3
|
+
interface TableModeButtonProps {
|
|
4
|
+
tableMode: TableMode;
|
|
5
|
+
onToggle?: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare function TableModeButton({ tableMode, onToggle }: TableModeButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof TableModeButton>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { longWordsIcon, sheetViewIcon } from '../../constants/index.js';
|
|
4
|
+
import { Icon, StyledButton } from '../index.js';
|
|
5
|
+
import { isTableDefaultMode, isTableSheetMode } from '../../utils/index.js';
|
|
6
|
+
function TableModeButton({ tableMode, onToggle }) {
|
|
7
|
+
const isDefaultView = isTableDefaultMode(tableMode);
|
|
8
|
+
const isSheetView = isTableSheetMode(tableMode);
|
|
9
|
+
return (_jsx(StyledButton, Object.assign({ hasImageFilter: false, onClick: onToggle, isActive: !isDefaultView }, { children: _jsx(Icon, { src: isSheetView ? sheetViewIcon : longWordsIcon, alt: `${tableMode}-mode`, sx: { width: 14, height: 14 } }) })));
|
|
10
|
+
}
|
|
11
|
+
export default memo(TableModeButton);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ColumnViewProps } from '../../../types/index.js';
|
|
3
|
+
interface ColumnItemProps {
|
|
4
|
+
column: ColumnViewProps;
|
|
5
|
+
index: number;
|
|
6
|
+
openSubMenuName: string | null;
|
|
7
|
+
subMenuAnchorEl: HTMLElement | null;
|
|
8
|
+
toggleColumnSelection: (columnName: string) => void;
|
|
9
|
+
toggleSubmenuItem: (columnName: string, submenuItemName: string) => void;
|
|
10
|
+
handleSubMenuOpen: (event: React.MouseEvent<HTMLElement>, name: string) => void;
|
|
11
|
+
handleSubMenuClose: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare function ColumnItem({ column, index, openSubMenuName, subMenuAnchorEl, toggleColumnSelection, toggleSubmenuItem, handleSubMenuOpen, handleSubMenuClose, }: ColumnItemProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default ColumnItem;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import startCase from 'lodash/startCase';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import { useTheme } from '@mui/material/styles';
|
|
6
|
+
import { Menu, MenuItem } from '../../index.js';
|
|
7
|
+
import { rightArrow } from '../../../constants/index.js';
|
|
8
|
+
import { useColumnItem } from './hooks';
|
|
9
|
+
function ColumnItem({ column, index, openSubMenuName, subMenuAnchorEl, toggleColumnSelection, toggleSubmenuItem, handleSubMenuOpen, handleSubMenuClose, }) {
|
|
10
|
+
var _a;
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const { isIndeterminate, hasSubmenuItems, isSubmenuOpen, isFirstItem, handleColumnClick, handleMouseEnter, handleMouseLeave } = useColumnItem({
|
|
14
|
+
column,
|
|
15
|
+
index,
|
|
16
|
+
openSubMenuName,
|
|
17
|
+
toggleColumnSelection,
|
|
18
|
+
handleSubMenuOpen,
|
|
19
|
+
handleSubMenuClose,
|
|
20
|
+
});
|
|
21
|
+
const getDisplayLabel = (label) => {
|
|
22
|
+
var _a;
|
|
23
|
+
if (!label)
|
|
24
|
+
return '';
|
|
25
|
+
return (_a = t(label)) !== null && _a !== void 0 ? _a : startCase(label);
|
|
26
|
+
};
|
|
27
|
+
return (_jsxs(Box, Object.assign({ sx: Object.assign({ borderTop: `1px solid ${theme.palette.divider}` }, (isFirstItem && { borderTop: 'none', height: 33 })) }, { children: [_jsxs(MenuItem, Object.assign({ isIndeterminate: isIndeterminate, isSelected: column.selected, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onClick: handleColumnClick }, { children: [_jsx(Box, Object.assign({ sx: { flex: 1 } }, { children: getDisplayLabel(column.label) })), hasSubmenuItems && _jsx("img", { src: rightArrow, className: "arrow-icon", alt: "arrow" })] })), hasSubmenuItems && (_jsx(Menu, Object.assign({ open: isSubmenuOpen, anchorEl: subMenuAnchorEl, placement: "right-start", onMouseEnter: () => { }, onMouseLeave: handleSubMenuClose }, { children: (_a = column.menuItems) === null || _a === void 0 ? void 0 : _a.map((submenuItem) => (_jsx(MenuItem, Object.assign({ isSelected: submenuItem.selected, onClick: () => toggleSubmenuItem(column.name, submenuItem.name) }, { children: getDisplayLabel(submenuItem.label) }), submenuItem.name))) })))] }), column.name));
|
|
28
|
+
}
|
|
29
|
+
export default ColumnItem;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomViewsProps } from './type';
|
|
3
|
+
declare function CustomViews({ open, onSelect, setTableViews, tableViews, anchorEl, onClose }: Readonly<CustomViewsProps>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const _default: import("react").MemoExoticComponent<typeof CustomViews>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Reorder } from 'framer-motion';
|
|
5
|
+
import { CustomBackdrop, Menu } from '../../index.js';
|
|
6
|
+
import { downArrowIcon } from '../../../constants/index.js';
|
|
7
|
+
import { ButtonStyled, ListStyled, DropdownStyled } from './style';
|
|
8
|
+
import { useSubMenu, useViewColumns } from './hooks';
|
|
9
|
+
import ColumnItem from './ColumnItem';
|
|
10
|
+
function CustomViews({ open, onSelect, setTableViews, tableViews, anchorEl, onClose }) {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const columns = useMemo(() => tableViews || [], [tableViews]);
|
|
13
|
+
const columnNames = useMemo(() => columns.map((column) => column.name), [columns]);
|
|
14
|
+
const { reorderColumns, toggleColumnSelection, toggleSubmenuItem } = useViewColumns({
|
|
15
|
+
columns,
|
|
16
|
+
setTableViews,
|
|
17
|
+
});
|
|
18
|
+
const { subMenuAnchorEl, openSubMenuName, handleSubMenuClose, handleSubMenuOpen, handleMenuScroll } = useSubMenu(open, onClose);
|
|
19
|
+
return (_jsxs(DropdownStyled, Object.assign({ "data-testid": "TableView_CustomViews" }, { children: [_jsxs(ButtonStyled, Object.assign({ "data-testid": "TableView_CustomViews_Button", onClick: onSelect }, { children: [_jsx("div", { children: t('columns') }), _jsx("img", { src: downArrowIcon, alt: "arrow", style: Object.assign({}, (Boolean(open) && { transform: 'rotate(180deg)' })) })] })), _jsxs(Menu, Object.assign({ open: open, anchorEl: anchorEl, "data-testid": "TableView_CustomViews_Popper", sx: { padding: 0, marginTop: '8px', borderRadius: 1 } }, { children: [open && _jsx(CustomBackdrop, { onClick: onClose }), _jsx(ListStyled, Object.assign({ component: "article", "data-testid": "TableView_CustomViews_List" }, { children: _jsx(Reorder.Group, Object.assign({ as: "div", axis: "y", onReorder: reorderColumns, values: columnNames, style: { maxHeight: 500, overflowY: 'auto' }, onScroll: handleMenuScroll }, { children: columns.map((column, index) => (_jsx(ColumnItem, { column: column, index: index, openSubMenuName: openSubMenuName, subMenuAnchorEl: subMenuAnchorEl, toggleColumnSelection: toggleColumnSelection, toggleSubmenuItem: toggleSubmenuItem, handleSubMenuOpen: handleSubMenuOpen, handleSubMenuClose: handleSubMenuClose }, column.name))) })) }))] }))] })));
|
|
20
|
+
}
|
|
21
|
+
export default memo(CustomViews);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ViewOption } from '../type';
|
|
3
|
+
interface DefaultViewsProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
selectedViewInfo: ViewOption;
|
|
6
|
+
setSelectedViewInfo: (selectedView: ViewOption) => void;
|
|
7
|
+
onSelect: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
8
|
+
setViews?: (views: string[]) => void;
|
|
9
|
+
anchorEl: Element | null;
|
|
10
|
+
}
|
|
11
|
+
declare function DefaultViews({ open, selectedViewInfo, setSelectedViewInfo, onSelect, setViews, anchorEl }: Readonly<DefaultViewsProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const _default: React.MemoExoticComponent<typeof DefaultViews>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Popper from '@mui/material/Popper';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { downArrowIcon, checkIcon } from '../../../constants/index.js';
|
|
6
|
+
import { ButtonStyled, ListStyled, DropdownStyled, MenuItem, Space, SpaceAfter } from './style';
|
|
7
|
+
import { dummyViewList } from '../data';
|
|
8
|
+
function DefaultViews({ open, selectedViewInfo, setSelectedViewInfo, onSelect, setViews, anchorEl }) {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
return (_jsxs(DropdownStyled, Object.assign({ "data-testid": "TableView_DefaultViews" }, { children: [_jsxs(ButtonStyled, Object.assign({ onClick: (e) => {
|
|
11
|
+
onSelect(e);
|
|
12
|
+
} }, { children: [_jsx("div", { children: selectedViewInfo.label }), _jsx("img", { src: downArrowIcon, alt: "arrow", style: Object.assign({}, (Boolean(open) && { transform: 'rotate(180deg)' })) })] })), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start" }, { children: _jsxs(ListStyled, { children: [dummyViewList.map((item) => (_jsxs(MenuItem, Object.assign({ onClick: () => {
|
|
13
|
+
setSelectedViewInfo(item);
|
|
14
|
+
setViews === null || setViews === void 0 ? void 0 : setViews(item.columns);
|
|
15
|
+
} }, { children: [item.id === selectedViewInfo.id ? _jsx("img", { className: "check-icon", src: checkIcon, alt: "arrow" }) : _jsx(Space, {}), _jsx("span", { children: item.label }), _jsx(SpaceAfter, {})] }), item.id))), _jsxs(MenuItem, Object.assign({ sx: {
|
|
16
|
+
border: 'none',
|
|
17
|
+
}, onClick: (e) => {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
setSelectedViewInfo({ label: 'Custom view', id: 'custom' });
|
|
20
|
+
} }, { children: [selectedViewInfo.id === 'custom' ? _jsx("img", { className: "check-icon", src: checkIcon, alt: "arrow" }) : _jsx(Space, {}), _jsx("span", { children: t('createCustomView') }), _jsx(SpaceAfter, {})] }))] }) }))] })));
|
|
21
|
+
}
|
|
22
|
+
export default React.memo(DefaultViews);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TableHeaderProps } from '../type';
|
|
3
|
+
interface TableViewProps {
|
|
4
|
+
onViewChange?: TableHeaderProps['onViewChange'];
|
|
5
|
+
setIsViewVisible: (visible: boolean) => void;
|
|
6
|
+
setTableViews: TableHeaderProps['setTableViews'];
|
|
7
|
+
tableViews: TableHeaderProps['tableViews'];
|
|
8
|
+
resetTableViews: TableHeaderProps['resetTableViews'];
|
|
9
|
+
}
|
|
10
|
+
declare function TableView({ onViewChange, setIsViewVisible, setTableViews, tableViews, resetTableViews }: Readonly<TableViewProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const _default: import("react").MemoExoticComponent<typeof TableView>;
|
|
12
|
+
export default _default;
|