@tap-payments/os-micro-frontend-shared 0.1.261-test.4 → 0.1.262
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 +1 -0
- package/build/components/CountBadge/style.d.ts +1 -0
- package/build/components/Customer/CustomerDropdown/CustomerDropdown.d.ts +8 -0
- package/build/components/Customer/CustomerDropdown/CustomerDropdown.js +39 -0
- package/build/components/Customer/CustomerDropdown/index.d.ts +1 -0
- package/build/components/Customer/CustomerDropdown/index.js +1 -0
- package/build/components/Customer/CustomerDropdown/style.d.ts +10 -0
- package/build/components/Customer/CustomerDropdown/style.js +30 -0
- package/build/components/Customer/CustomerForms/EmailForm.d.ts +12 -0
- package/build/components/Customer/CustomerForms/EmailForm.js +76 -0
- package/build/components/Customer/CustomerForms/FullInfo.d.ts +13 -0
- package/build/components/Customer/CustomerForms/FullInfo.js +72 -0
- package/build/components/Customer/CustomerForms/FullInfoForm.d.ts +12 -0
- package/build/components/Customer/CustomerForms/FullInfoForm.js +74 -0
- package/build/components/Customer/CustomerForms/PhoneNumberForm.d.ts +12 -0
- package/build/components/Customer/CustomerForms/PhoneNumberForm.js +71 -0
- package/build/components/Customer/CustomerForms/index.d.ts +9 -0
- package/build/components/Customer/CustomerForms/index.js +9 -0
- package/build/components/Customer/CustomerForms/style.d.ts +25 -0
- package/build/components/Customer/CustomerForms/style.js +71 -0
- package/build/components/Customer/CustomerForms/validation.d.ts +30 -0
- package/build/components/Customer/CustomerForms/validation.js +42 -0
- package/build/components/Customer/index.d.ts +1 -0
- package/build/components/Customer/index.js +1 -0
- package/build/components/Dialog/style.d.ts +1 -0
- package/build/components/Error/Error.d.ts +1 -1
- package/build/components/FlippingCard/style.d.ts +1 -0
- package/build/components/ImageWrapper/ImageWrapper.d.ts +1 -0
- package/build/components/Inputs/CountriesDropDown/CountriesDropdown.d.ts +5 -4
- package/build/components/Inputs/CountriesDropDown/CountriesDropdown.js +3 -3
- package/build/components/JSONViewer/style.d.ts +1 -0
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +1 -0
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +1 -0
- package/build/components/SearchButton/styles.d.ts +1 -0
- package/build/components/StatusIcons/AuthIcons/style.d.ts +1 -0
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +1 -0
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +1 -0
- package/build/components/StatusIcons/SourceIcons/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/style.d.ts +1 -0
- package/build/components/TableHeader/FiltersRow.d.ts +1 -1
- package/build/components/TableHeader/FiltersRow.js +4 -19
- package/build/components/TableHeader/TableHeader.d.ts +4 -5
- package/build/components/TableHeader/TableHeader.js +6 -21
- package/build/components/TableHeader/index.d.ts +2 -6
- package/build/components/TableHeader/index.js +2 -6
- package/build/components/TableHeader/style.d.ts +1 -1
- package/build/components/TableHeader/style.js +1 -1
- package/build/components/TableHeader/type.d.ts +10 -19
- package/build/components/TableHeader/type.js +7 -0
- package/build/components/VirtualTables/components/style.d.ts +1 -0
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/types/tsUtils.d.ts +0 -1
- package/package.json +20 -19
- package/build/components/TableHeader/FiltersRowWrapper.d.ts +0 -5
- package/build/components/TableHeader/FiltersRowWrapper.js +0 -18
- package/build/components/TableHeader/TableHeaderWrapper.d.ts +0 -5
- package/build/components/TableHeader/TableHeaderWrapper.js +0 -18
- package/build/components/TableHeader/TableView/ColumnItem.d.ts +0 -14
- package/build/components/TableHeader/TableView/ColumnItem.js +0 -29
- package/build/components/TableHeader/TableView/CustomViews.d.ts +0 -5
- package/build/components/TableHeader/TableView/CustomViews.js +0 -21
- package/build/components/TableHeader/TableView/DefaultViews.d.ts +0 -13
- package/build/components/TableHeader/TableView/DefaultViews.js +0 -22
- package/build/components/TableHeader/TableView/TableView.d.ts +0 -12
- package/build/components/TableHeader/TableView/TableView.js +0 -55
- package/build/components/TableHeader/TableView/hooks/index.d.ts +0 -3
- package/build/components/TableHeader/TableView/hooks/index.js +0 -3
- package/build/components/TableHeader/TableView/hooks/useColumnItem.d.ts +0 -21
- package/build/components/TableHeader/TableView/hooks/useColumnItem.js +0 -29
- package/build/components/TableHeader/TableView/hooks/useSubMenu.d.ts +0 -10
- package/build/components/TableHeader/TableView/hooks/useSubMenu.js +0 -31
- package/build/components/TableHeader/TableView/hooks/useViewColumns.d.ts +0 -13
- package/build/components/TableHeader/TableView/hooks/useViewColumns.js +0 -45
- package/build/components/TableHeader/TableView/index.d.ts +0 -3
- package/build/components/TableHeader/TableView/index.js +0 -3
- package/build/components/TableHeader/TableView/style.d.ts +0 -24
- package/build/components/TableHeader/TableView/style.js +0 -102
- package/build/components/TableHeader/TableView/type.d.ts +0 -10
- package/build/components/TableHeader/TableView/type.js +0 -1
- package/build/components/TableHeader/data.d.ts +0 -5
- package/build/components/TableHeader/data.js +0 -7
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as Yup from 'yup';
|
|
2
|
+
export const validationEmailFromSchema = Yup.object().shape({
|
|
3
|
+
email: Yup.string()
|
|
4
|
+
.matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, 'invalidEmail')
|
|
5
|
+
.required('requiredEmail'),
|
|
6
|
+
firstName: Yup.string().required('requiredFirstName').min(3, 'invalidFirstName'),
|
|
7
|
+
lastName: Yup.string().required('requiredLastName').min(3, 'invalidLastName'),
|
|
8
|
+
});
|
|
9
|
+
export const validationFullInfoSchema = (numberLen) => Yup.object()
|
|
10
|
+
.shape({
|
|
11
|
+
email: Yup.string()
|
|
12
|
+
.transform((value, originalValue) => {
|
|
13
|
+
if (originalValue === '')
|
|
14
|
+
return undefined;
|
|
15
|
+
return value;
|
|
16
|
+
})
|
|
17
|
+
.matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i, 'invalidEmail')
|
|
18
|
+
.optional(),
|
|
19
|
+
phoneNumber: Yup.string()
|
|
20
|
+
.transform((value, originalValue) => {
|
|
21
|
+
if (!originalValue)
|
|
22
|
+
return undefined;
|
|
23
|
+
return value;
|
|
24
|
+
})
|
|
25
|
+
.length(numberLen, `invalidMobile`)
|
|
26
|
+
.optional(),
|
|
27
|
+
firstName: Yup.string().min(3, 'invalidFirstName').required('requiredFirstName'),
|
|
28
|
+
lastName: Yup.string().min(3, 'invalidLastName').required('requiredLastName'),
|
|
29
|
+
})
|
|
30
|
+
.test('atLeastOne', 'atLeastOne', function testAtLeastOne(_, ctx) {
|
|
31
|
+
var _a;
|
|
32
|
+
const { email, phoneNumber } = (_a = this.originalValue) !== null && _a !== void 0 ? _a : {};
|
|
33
|
+
if (!email && !phoneNumber) {
|
|
34
|
+
return ctx.createError({ message: 'atLeastOne' });
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
});
|
|
38
|
+
export const validationPhoneNumberSchema = (numberLen) => Yup.object().shape({
|
|
39
|
+
firstName: Yup.string().required('requiredFirstName').min(3, 'invalidFirstName'),
|
|
40
|
+
lastName: Yup.string().required('requiredLastName').min(3, 'invalidLastName'),
|
|
41
|
+
phoneNumber: Yup.string().length(numberLen, `invalidMobile`).required('requiredMobile'),
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomerDropdown } from './CustomerDropdown';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomerDropdown } from './CustomerDropdown';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BoxProps } from '@mui/material/Box';
|
|
3
|
-
interface ErrorI extends BoxProps {
|
|
3
|
+
export interface ErrorI extends BoxProps {
|
|
4
4
|
error: string;
|
|
5
5
|
}
|
|
6
6
|
declare function Error({ error, ...props }: ErrorI): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Country } from '../../../types/index.js';
|
|
3
|
-
|
|
3
|
+
type CountriesDropdownProps = {
|
|
4
4
|
value?: Partial<Country>;
|
|
5
5
|
defaultCountry?: string;
|
|
6
6
|
onChangeCountry?: (country: Country) => void;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
countries: Country[];
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
declare
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare function CountriesDropdown({ defaultCountry, value: selectedCountry, onChangeCountry, required, countries, isLoading, }: Readonly<CountriesDropdownProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const _default: import("react").MemoExoticComponent<typeof CountriesDropdown>;
|
|
12
13
|
export default _default;
|
|
@@ -6,7 +6,7 @@ import Popper from '@mui/material/Popper';
|
|
|
6
6
|
import Skeleton from '@mui/material/Skeleton';
|
|
7
7
|
import { downArrowIcon, searchIcon } from '../../../constants/index.js';
|
|
8
8
|
import { CountryStyled, CountriesWrapper, CountriesList, InputStyled, CountryButton, Required } from './style';
|
|
9
|
-
function
|
|
9
|
+
function CountriesDropdown({ defaultCountry, value: selectedCountry, onChangeCountry, required, countries = [], isLoading = false, }) {
|
|
10
10
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
11
|
const [filteredCountries, setFilteredCountries] = useState([]);
|
|
12
12
|
const [searchValue, setSearchValue] = useState();
|
|
@@ -45,7 +45,7 @@ function CountriesCode({ defaultCountry, value: selectedCountry, onChangeCountry
|
|
|
45
45
|
}
|
|
46
46
|
setFilteredCountries(countries.filter((country) => country.idd_prefix.toString().startsWith(value.toString())));
|
|
47
47
|
};
|
|
48
|
-
if (
|
|
48
|
+
if (isLoading) {
|
|
49
49
|
return _jsx(Skeleton, { variant: "rectangular", width: 56.5, height: 20, sx: { borderRadius: '4px' } });
|
|
50
50
|
}
|
|
51
51
|
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: closeDropdown }, { children: _jsxs(Box, Object.assign({ "data-testid": "CountriesCode", sx: { position: 'relative' } }, { children: [_jsxs(CountryButton, Object.assign({ type: "button", onClick: openDropdown, sx: {
|
|
@@ -56,4 +56,4 @@ function CountriesCode({ defaultCountry, value: selectedCountry, onChangeCountry
|
|
|
56
56
|
selectNewCode(country);
|
|
57
57
|
} }, { children: [country.logo ? _jsx("img", { src: country.logo, alt: "c", className: "logo" }) : _jsx(Skeleton, { variant: "rectangular", className: "logo" }), _jsx("span", { children: `+${country.idd_prefix}` })] }), `country-code-${country.countryId}`))) })] })) }))] })) })));
|
|
58
58
|
}
|
|
59
|
-
export default memo(
|
|
59
|
+
export default memo(CountriesDropdown);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
import { TableMode } from '../../../../types/index.js';
|
|
3
4
|
export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
4
5
|
tableMode?: TableMode | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
3
4
|
export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
hidden?: boolean | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
4
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
5
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
3
4
|
variant?: "Global" | "Regional" | "Local" | undefined;
|
|
4
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FilterRowProps } from './type';
|
|
2
|
-
export
|
|
2
|
+
export declare function FiltersRow({ children }: FilterRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import FiltersRowWrapper from './FiltersRowWrapper';
|
|
6
|
-
import TableView from './TableView';
|
|
7
|
-
export default function FiltersRow({ date, calendarMode, onDateChange, onCalendarModeSwitch, tableReportsComponent, tableFilterComponent, isReportsButtonVisible, onViewChange, onSearchChange, onToggleViewButtonClick, rightActions, leftActions, setTableViews, tableViews, resetTableViews, onToggleTextButtonClick, isTextShown, calendarGroupBy, onCalendarGroupChange, maxDateRange = 31, searchPlaceholder, isAcceptance, tableMode, timezone, browserTimezone, defaultCountryTimezone, onChangeTimezone, segmentCountries, }) {
|
|
8
|
-
const [isViewVisible, setIsViewVisible] = useState(false);
|
|
9
|
-
const timezoneCountriesCodes = useMemo(() => segmentCountries.map(({ code }) => code), [segmentCountries]);
|
|
10
|
-
const textViewButton = useMemo(() => (_jsx(StyledButton, Object.assign({ hasImageFilter: false, "data-testid": "FiltersRow_TextViewButton", onClick: onToggleTextButtonClick, isActive: isTextShown }, { children: _jsx(Icon, { src: tableMode === 'sheet' ? sheetViewIcon : longWordsIcon, alt: "text-mode", sx: {
|
|
11
|
-
width: 14,
|
|
12
|
-
height: 14,
|
|
13
|
-
} }) }))), [isTextShown, onToggleTextButtonClick, tableMode]);
|
|
14
|
-
return (_jsxs(FiltersRowWrapper, { children: [leftActions && !isViewVisible && leftActions, !isViewVisible && (_jsxs(_Fragment, { children: [onSearchChange && _jsx(SearchButton, { onSearchChange: onSearchChange, placeholder: searchPlaceholder }), tableFilterComponent, onToggleTextButtonClick && !isAcceptance && textViewButton, date && (_jsx(RangeCalender, { defaultDate: date, onDateChange: (newDate) => {
|
|
15
|
-
const [startDate, endDate] = newDate;
|
|
16
|
-
if (startDate && endDate) {
|
|
17
|
-
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange([startDate, endDate]);
|
|
18
|
-
}
|
|
19
|
-
}, mode: calendarMode, onCalendarModeSwitch: onCalendarModeSwitch, maxDateRange: maxDateRange, groupBy: calendarGroupBy, onCalendarGroupChange: onCalendarGroupChange, browserTimezone: browserTimezone, defaultCountryTimezone: defaultCountryTimezone, timezone: timezone, onChangeTimezone: onChangeTimezone, timezoneCountriesCodes: timezoneCountriesCodes })), isReportsButtonVisible && tableReportsComponent, onToggleTextButtonClick && isAcceptance && textViewButton] })), 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] }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FiltersRowWrapper } from './style';
|
|
3
|
+
export function FiltersRow({ children }) {
|
|
4
|
+
return (_jsx(FiltersRowWrapper, Object.assign({ component: "aside", "data-testid": "FiltersRow" }, { children: children })));
|
|
20
5
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default _default;
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export type TableHeaderProps = PropsWithChildren<{}>;
|
|
3
|
+
declare const TableHeader: (props: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default TableHeader;
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TableHeaderContainer } from './style';
|
|
3
|
+
const TableHeader = (props) => {
|
|
4
|
+
const { children } = props;
|
|
5
|
+
return (_jsx(TableHeaderContainer, Object.assign({ as: "header", "data-testid": "TableHeader" }, { children: children })));
|
|
11
6
|
};
|
|
12
|
-
|
|
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, isTextShown, 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", "isTextShown", "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, isTextShown: isTextShown, 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);
|
|
7
|
+
export default TableHeader;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export default TableHeader;
|
|
3
|
-
export * from './TableHeader';
|
|
4
|
-
export { default as TableHeaderWrapper } from './TableHeaderWrapper';
|
|
5
|
-
export { default as FiltersRowWrapper } from './FiltersRowWrapper';
|
|
6
|
-
export { default as FiltersRow } from './FiltersRow';
|
|
1
|
+
export { default as TableHeader } from './TableHeader';
|
|
7
2
|
export * from './style';
|
|
8
3
|
export * from './type';
|
|
4
|
+
export { FiltersRow } from './FiltersRow';
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export default TableHeader;
|
|
3
|
-
export * from './TableHeader';
|
|
4
|
-
export { default as TableHeaderWrapper } from './TableHeaderWrapper';
|
|
5
|
-
export { default as FiltersRowWrapper } from './FiltersRowWrapper';
|
|
6
|
-
export { default as FiltersRow } from './FiltersRow';
|
|
1
|
+
export { default as TableHeader } from './TableHeader';
|
|
7
2
|
export * from './style';
|
|
8
3
|
export * from './type';
|
|
4
|
+
export { FiltersRow } from './FiltersRow';
|
|
@@ -16,6 +16,6 @@ export declare const TableHeaderRow: import("@emotion/styled").StyledComponent<i
|
|
|
16
16
|
export declare const StatusButtonsContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
17
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
18
18
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const FiltersRowWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
20
20
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
21
21
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -34,7 +34,7 @@ export const StatusButtonsContainer = styled(Box)(({ theme }) => ({
|
|
|
34
34
|
alignItems: 'center',
|
|
35
35
|
gap: theme.spacing(1),
|
|
36
36
|
}));
|
|
37
|
-
export const
|
|
37
|
+
export const FiltersRowWrapper = styled(Box)(() => ({
|
|
38
38
|
display: 'flex',
|
|
39
39
|
justifyContent: 'flex-start',
|
|
40
40
|
alignItems: 'center',
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import type { CalenderMode, TableHeaderStatus, ColumnViewProps
|
|
1
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import type { CalenderMode, TableHeaderStatus, ColumnViewProps } from '../../types/index.js';
|
|
3
3
|
import { AvailableStatus } from '../StatusBar/type';
|
|
4
|
-
|
|
5
|
-
type ViewsOptions = {
|
|
4
|
+
declare const viewsOptions: {
|
|
6
5
|
default: {};
|
|
7
6
|
developer: {};
|
|
8
7
|
marketing: {};
|
|
9
8
|
finance: {};
|
|
10
9
|
custom: {};
|
|
11
10
|
};
|
|
12
|
-
export type View = keyof
|
|
13
|
-
export interface TableHeaderProps
|
|
14
|
-
|
|
15
|
-
status?:
|
|
16
|
-
availableStatuses?: AvailableStatus<IStatus>[];
|
|
11
|
+
export type View = keyof typeof viewsOptions;
|
|
12
|
+
export interface TableHeaderProps {
|
|
13
|
+
availableStatuses?: AvailableStatus[];
|
|
14
|
+
status?: TableHeaderStatus;
|
|
17
15
|
search?: string;
|
|
18
16
|
view?: View;
|
|
19
17
|
date?: Date | [Date, Date];
|
|
20
18
|
showMaximizedView?: boolean;
|
|
21
19
|
title?: string | null;
|
|
22
20
|
calendarMode?: CalenderMode;
|
|
23
|
-
onStatusChange?: (status
|
|
21
|
+
onStatusChange?: (status: Partial<TableHeaderStatus>) => void;
|
|
24
22
|
onSearch?: (search: string) => void;
|
|
25
23
|
onViewChange?: () => void;
|
|
26
|
-
onDateChange?: (date: Date | [Date, Date]) => void;
|
|
24
|
+
onDateChange?: (date: Date | [Date, Date], timezoneOffset?: number) => void;
|
|
27
25
|
tableReportsComponent?: React.ReactNode;
|
|
28
26
|
tableFilterComponent?: React.ReactNode;
|
|
29
27
|
onCalendarModeSwitch: (mode: CalenderMode) => void;
|
|
@@ -51,15 +49,8 @@ export interface TableHeaderProps<IStatus extends TableHeaderStatus | TableHeade
|
|
|
51
49
|
onCalendarGroupChange?: (value: string) => void;
|
|
52
50
|
maxDateRange?: number;
|
|
53
51
|
isAcceptance?: boolean;
|
|
54
|
-
startComponent?: React.ReactNode;
|
|
55
|
-
searchPlaceholder?: string;
|
|
56
|
-
timezone: Timezone | null;
|
|
57
|
-
browserTimezone: string;
|
|
58
|
-
defaultCountryTimezone: Timezone;
|
|
59
|
-
onChangeTimezone: (newTimezone: Timezone) => void;
|
|
60
|
-
segmentCountries: SegmentCountry[];
|
|
61
52
|
}
|
|
62
|
-
export type FilterRowProps =
|
|
53
|
+
export type FilterRowProps = PropsWithChildren<{}>;
|
|
63
54
|
export interface Column {
|
|
64
55
|
label: string;
|
|
65
56
|
name: string;
|
|
@@ -92,7 +92,6 @@ export { default as StatusBar, type AvailableStatus } from './StatusBar';
|
|
|
92
92
|
export { default as MultiSelectStatusButton, type CurrencyOption, type MultiSelectStatusButtonProps } from './MultiSelectStatusButton';
|
|
93
93
|
export * from './Chip';
|
|
94
94
|
export * from './StatusGroupChips';
|
|
95
|
-
export { default as TableHeader } from './TableHeader';
|
|
96
95
|
export * from './TableHeader';
|
|
97
96
|
export { default as RangeCalender } from './RangeCalender';
|
|
98
97
|
export { default as AppServices } from './AppServices';
|
|
@@ -131,3 +130,4 @@ export * from './MerchantLogo';
|
|
|
131
130
|
export * from './FilterDropdown';
|
|
132
131
|
export { default as PhoneFilter } from './PhoneFilter';
|
|
133
132
|
export { default as CountryFilter } from './CountryFilter';
|
|
133
|
+
export * from './Customer';
|
|
@@ -92,7 +92,6 @@ export { default as StatusBar } from './StatusBar';
|
|
|
92
92
|
export { default as MultiSelectStatusButton } from './MultiSelectStatusButton';
|
|
93
93
|
export * from './Chip';
|
|
94
94
|
export * from './StatusGroupChips';
|
|
95
|
-
export { default as TableHeader } from './TableHeader';
|
|
96
95
|
export * from './TableHeader';
|
|
97
96
|
export { default as RangeCalender } from './RangeCalender';
|
|
98
97
|
export { default as AppServices } from './AppServices';
|
|
@@ -131,3 +130,4 @@ export * from './MerchantLogo';
|
|
|
131
130
|
export * from './FilterDropdown';
|
|
132
131
|
export { default as PhoneFilter } from './PhoneFilter';
|
|
133
132
|
export { default as CountryFilter } from './CountryFilter';
|
|
133
|
+
export * from './Customer';
|
package/build/types/tsUtils.d.ts
CHANGED