@tap-payments/os-micro-frontend-shared 0.1.222 → 0.1.224-test.1
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/RangeCalender/RangeCalender.d.ts +2 -26
- package/build/components/RangeCalender/RangeCalender.js +2 -2
- package/build/components/RangeCalender/components/Timezone/Timezone.d.ts +3 -2
- package/build/components/RangeCalender/components/Timezone/Timezone.js +4 -4
- package/build/components/RangeCalender/components/Timezone/components/EntitiesTimezone.d.ts +3 -6
- package/build/components/RangeCalender/components/Timezone/components/EntitiesTimezone.js +7 -6
- package/build/components/RangeCalender/type.d.ts +26 -0
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
- package/build/components/SearchButton/styles.d.ts +0 -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/BalanceCell.js +1 -1
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellSheet.d.ts +1 -1
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellSheet.js +2 -4
- package/build/components/TableCells/CustomCells/BalanceCell/index.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/index.js +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/type.d.ts +1 -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/VirtualTables/components/style.d.ts +0 -1
- package/build/constants/apps.js +3 -3
- package/build/constants/table/cell/authorizationTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/authorizationTableCellWidth.js +1 -1
- package/build/constants/table/cell/refundTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/refundTableCellWidth.js +1 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/timezone.d.ts +2 -0
- package/build/utils/timezone.js +3 -0
- package/package.json +3 -3
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellText.d.ts +0 -3
- package/build/components/TableCells/CustomCells/BalanceCell/BalanceCellText.js +0 -44
|
@@ -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;
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { SxProps } from '@mui/system';
|
|
4
|
-
import type { CalenderMode, Timezone } from '../../types/index.js';
|
|
5
|
-
import { RangeDatepickerProps } from './components/RangeDatepicker';
|
|
6
|
-
interface RangeCalendarProps {
|
|
7
|
-
defaultDate: [Date, Date];
|
|
8
|
-
onDateChange: (date: [Date, Date]) => void;
|
|
9
|
-
mode?: CalenderMode;
|
|
10
|
-
onCalendarModeSwitch?: (mode: CalenderMode) => void;
|
|
11
|
-
numberOfMonths?: number;
|
|
12
|
-
noTimezone?: boolean;
|
|
13
|
-
noQuickFilter?: boolean;
|
|
14
|
-
maxDateRange?: number;
|
|
15
|
-
onCalendarGroupChange?: (value: string) => void;
|
|
16
|
-
groupBy?: string;
|
|
17
|
-
timezone: Timezone | null;
|
|
18
|
-
onChangeTimezone?: (timezone: Timezone) => void;
|
|
19
|
-
defaultTimezone: Timezone;
|
|
20
|
-
browserTimezone: string;
|
|
21
|
-
renderCalendarButton?: (open: boolean, onOpenCalender: (event: MouseEvent<HTMLElement>) => void) => React.ReactNode;
|
|
22
|
-
mainSx?: SxProps;
|
|
23
|
-
popperProps?: Partial<PopperProps>;
|
|
24
|
-
rangeDatePickerProps?: Partial<RangeDatepickerProps>;
|
|
25
|
-
}
|
|
26
|
-
declare function RangeCalender({ defaultDate, onDateChange, mode, onCalendarModeSwitch, numberOfMonths, noTimezone, noQuickFilter, maxDateRange, onCalendarGroupChange, groupBy, timezone, onChangeTimezone, defaultTimezone, browserTimezone, renderCalendarButton, mainSx, popperProps, rangeDatePickerProps, }: RangeCalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { RangeCalendarProps } from './type';
|
|
2
|
+
declare function RangeCalender({ defaultDate, onDateChange, mode, onCalendarModeSwitch, numberOfMonths, noTimezone, noQuickFilter, maxDateRange, onCalendarGroupChange, groupBy, timezone, onChangeTimezone, browserTimezone, renderCalendarButton, mainSx, popperProps, rangeDatePickerProps, defaultCountryTimezone, timezoneCountriesCodes, }: RangeCalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
27
3
|
export default RangeCalender;
|
|
@@ -15,7 +15,7 @@ import CustomTimezone from './components/Timezone';
|
|
|
15
15
|
import { ButtonsWrapper, CalenderWrapper, CancelButton, FiltersArea, Footer, Main, OkayButton, SelectedDate, TimeZone, Settings } from './style';
|
|
16
16
|
import CustomTimePicker from './components/CustomTimepicker';
|
|
17
17
|
import { getDateRange, getEndOfDate, getStartOfDate } from './utils';
|
|
18
|
-
function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalendarModeSwitch, numberOfMonths, noTimezone, noQuickFilter, maxDateRange, onCalendarGroupChange, groupBy, timezone, onChangeTimezone,
|
|
18
|
+
function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalendarModeSwitch, numberOfMonths, noTimezone, noQuickFilter, maxDateRange, onCalendarGroupChange, groupBy, timezone, onChangeTimezone, browserTimezone, renderCalendarButton, mainSx, popperProps, rangeDatePickerProps, defaultCountryTimezone, timezoneCountriesCodes, }) {
|
|
19
19
|
const [dates, setDates] = useState(getDateRange(defaultDate));
|
|
20
20
|
const [values, setValues] = useState(dates);
|
|
21
21
|
const [selectedTimezone, setSelectedTimezone] = useState(timezone);
|
|
@@ -90,6 +90,6 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
|
|
|
90
90
|
onCloseCalender();
|
|
91
91
|
} })), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-end" }, popperProps, { children: _jsxs(CalenderWrapper, { children: [!noQuickFilter && (_jsxs(FiltersArea, { children: [_jsx(QuickFilters, { onChange: onChangeQuickFilter, isHijri: isHijri }), _jsxs(Settings, { children: [groupBy && (_jsx(GroupBy, { groupBy: selectedGroupBy, isCalenderOpen: open, onUpdate: (group) => {
|
|
92
92
|
setSelectedGroupBy(group);
|
|
93
|
-
} })), _jsx(Hijri, { isHijri: isHijri, onCalendarModeSwitch: onCalendarModeSwitch })] })] })), _jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', justifyContent: 'space-between' } }, { children: [_jsx(RangeDatePicker, Object.assign({ values: values, onChange: onChange, isHijri: isHijri, ref: calendarRef, numberOfMonths: numberOfMonths }, rangeDatePickerProps)), _jsx(Collapse, Object.assign({ in: isError && Boolean(maxDateRange) }, { children: _jsx(Error, { error: t('dateRangeError', { number: maxDateRange }), sx: { marginInline: '16px', marginBottom: '16px' } }) })), _jsxs(Footer, Object.assign({ sx: { borderBottomLeftRadius: '8px' } }, { children: [!noTimezone ? (_jsx(TimeZone, { children: _jsx(CustomTimezone, { onChange: setSelectedTimezone, selectedTimezone: selectedTimezone,
|
|
93
|
+
} })), _jsx(Hijri, { isHijri: isHijri, onCalendarModeSwitch: onCalendarModeSwitch })] })] })), _jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', justifyContent: 'space-between' } }, { children: [_jsx(RangeDatePicker, Object.assign({ values: values, onChange: onChange, isHijri: isHijri, ref: calendarRef, numberOfMonths: numberOfMonths }, rangeDatePickerProps)), _jsx(Collapse, Object.assign({ in: isError && Boolean(maxDateRange) }, { children: _jsx(Error, { error: t('dateRangeError', { number: maxDateRange }), sx: { marginInline: '16px', marginBottom: '16px' } }) })), _jsxs(Footer, Object.assign({ sx: { borderBottomLeftRadius: '8px' } }, { children: [!noTimezone ? (_jsx(TimeZone, { children: _jsx(CustomTimezone, { onChange: setSelectedTimezone, selectedTimezone: selectedTimezone, browserTimezone: browserTimezone, defaultCountryTimezone: defaultCountryTimezone, timezoneCountriesCodes: timezoneCountriesCodes }, String(open)) })) : (_jsx("div", {})), new DateObject(values[0]).dayOfYear === new DateObject(values[1]).dayOfYear && (_jsx(CustomTimePicker, { values: values, setValues: setValues })), _jsxs(ButtonsWrapper, { children: [_jsx(CancelButton, Object.assign({ variant: "contained", onClick: onCloseCalender }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ variant: "contained", onClick: submitDate }, { children: t('okay') }))] })] }))] }))] }) }))] })));
|
|
94
94
|
}
|
|
95
95
|
export default RangeCalender;
|
|
@@ -3,9 +3,10 @@ import type { Timezone } from '../../../../types/index.js';
|
|
|
3
3
|
interface CustomTimezoneProps {
|
|
4
4
|
onChange: (timezone: Timezone) => void;
|
|
5
5
|
selectedTimezone: Timezone | null;
|
|
6
|
-
|
|
6
|
+
defaultCountryTimezone: Timezone;
|
|
7
7
|
browserTimezone: string;
|
|
8
|
+
timezoneCountriesCodes: string[];
|
|
8
9
|
}
|
|
9
|
-
declare function CustomTimezone({ onChange, selectedTimezone,
|
|
10
|
+
declare function CustomTimezone({ onChange, selectedTimezone, browserTimezone, defaultCountryTimezone, timezoneCountriesCodes }: CustomTimezoneProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
declare const _default: import("react").MemoExoticComponent<typeof CustomTimezone>;
|
|
11
12
|
export default _default;
|
|
@@ -7,7 +7,7 @@ import { CountryFlag } from '../../../index.js';
|
|
|
7
7
|
import { TimezoneWrapper, TimezoneDropdown, SelectedTimezone } from './style';
|
|
8
8
|
import EntitiesTimezone from './components/EntitiesTimezone';
|
|
9
9
|
import UserTimezone from './components/UserTimezone';
|
|
10
|
-
function CustomTimezone({ onChange, selectedTimezone,
|
|
10
|
+
function CustomTimezone({ onChange, selectedTimezone, browserTimezone, defaultCountryTimezone, timezoneCountriesCodes }) {
|
|
11
11
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
12
12
|
const open = Boolean(anchorEl);
|
|
13
13
|
const onClose = () => {
|
|
@@ -23,10 +23,10 @@ function CustomTimezone({ onChange, selectedTimezone, defaultTimezone, browserTi
|
|
|
23
23
|
const selectedTimezoneIcon = useMemo(() => {
|
|
24
24
|
if (browserTimezone === (selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone))
|
|
25
25
|
return userTimezoneIcon;
|
|
26
|
-
if ((selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone) ===
|
|
26
|
+
if ((selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone) === defaultCountryTimezone.timezone)
|
|
27
27
|
return entityTimezoneIcon;
|
|
28
28
|
return savedTimezoneIcon;
|
|
29
|
-
}, [browserTimezone,
|
|
30
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onClose }, { children: _jsxs(TimezoneWrapper, Object.assign({ "data-testid": "CustomTimezone" }, { children: [_jsxs(SelectedTimezone, Object.assign({ open: open, onClick: onOpen }, { children: [_jsx("img", { src: selectedTimezoneIcon, alt: "timezone-icon" }), _jsx(CountryFlag, { code: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.countryCode }), _jsx("span", { children: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.label })] })), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "top-start", sx: { zIndex: 1400 } }, { children: _jsxs(TimezoneDropdown, Object.assign({ "data-testid": "CustomTimezone_dropdown" }, { children: [_jsx(EntitiesTimezone, { onChange: updateTimezone, selectedTimezone: selectedTimezone,
|
|
29
|
+
}, [browserTimezone, defaultCountryTimezone.timezone, selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone]);
|
|
30
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onClose }, { children: _jsxs(TimezoneWrapper, Object.assign({ "data-testid": "CustomTimezone" }, { children: [_jsxs(SelectedTimezone, Object.assign({ open: open, onClick: onOpen }, { children: [_jsx("img", { src: selectedTimezoneIcon, alt: "timezone-icon" }), _jsx(CountryFlag, { code: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.countryCode }), _jsx("span", { children: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.label })] })), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "top-start", sx: { zIndex: 1400 } }, { children: _jsxs(TimezoneDropdown, Object.assign({ "data-testid": "CustomTimezone_dropdown" }, { children: [_jsx(EntitiesTimezone, { onChange: updateTimezone, selectedTimezone: selectedTimezone, defaultCountryTimezone: defaultCountryTimezone, timezoneCountriesCodes: timezoneCountriesCodes }), _jsx(UserTimezone, { onChange: updateTimezone, selectedTimezone: selectedTimezone, browserTimezone: browserTimezone })] })) }))] })) })));
|
|
31
31
|
}
|
|
32
32
|
export default memo(CustomTimezone);
|
|
@@ -2,11 +2,8 @@ import type { Timezone } from '../../../../../types/index.js';
|
|
|
2
2
|
interface EntitiesTimezoneProps {
|
|
3
3
|
selectedTimezone: Timezone | null;
|
|
4
4
|
onChange: (selected: Timezone) => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
segmentCountries?: {
|
|
8
|
-
code: string;
|
|
9
|
-
}[];
|
|
5
|
+
timezoneCountriesCodes?: string[];
|
|
6
|
+
defaultCountryTimezone: Timezone;
|
|
10
7
|
}
|
|
11
|
-
export default function EntitiesTimezone({ selectedTimezone, onChange,
|
|
8
|
+
export default function EntitiesTimezone({ selectedTimezone, onChange, timezoneCountriesCodes, defaultCountryTimezone }: EntitiesTimezoneProps): import("react/jsx-runtime").JSX.Element;
|
|
12
9
|
export {};
|
|
@@ -3,8 +3,9 @@ import { useMemo, useState } from 'react';
|
|
|
3
3
|
import Popper from '@mui/material/Popper';
|
|
4
4
|
import { entityTimezoneIcon, smallBlueCheckIcon } from '../../../../../constants/index.js';
|
|
5
5
|
import { CountryFlag } from '../../../../index.js';
|
|
6
|
+
import { getTimezoneByCountryCode } from '../../../../../utils/index.js';
|
|
6
7
|
import { Label, Space, TimezoneDropdown, TimezoneElement } from '../style';
|
|
7
|
-
export default function EntitiesTimezone({ selectedTimezone, onChange,
|
|
8
|
+
export default function EntitiesTimezone({ selectedTimezone, onChange, timezoneCountriesCodes, defaultCountryTimezone }) {
|
|
8
9
|
const [entitiesEl, setEntitiesEl] = useState(null);
|
|
9
10
|
const onMouseEnter = (e) => {
|
|
10
11
|
if (!entitiesEl)
|
|
@@ -18,17 +19,17 @@ export default function EntitiesTimezone({ selectedTimezone, onChange, defaultTi
|
|
|
18
19
|
e.stopPropagation();
|
|
19
20
|
onChange(tz);
|
|
20
21
|
};
|
|
21
|
-
const availableTimezones = useMemo(() =>
|
|
22
|
+
const availableTimezones = useMemo(() => timezoneCountriesCodes === null || timezoneCountriesCodes === void 0 ? void 0 : timezoneCountriesCodes.map((code) => getTimezoneByCountryCode(code)), [timezoneCountriesCodes]);
|
|
22
23
|
const isSelectedTimezoneOneOFTheAvailable = useMemo(() => availableTimezones === null || availableTimezones === void 0 ? void 0 : availableTimezones.some((item) => (selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone) === (item === null || item === void 0 ? void 0 : item.timezone)), [availableTimezones, selectedTimezone]);
|
|
23
24
|
const entityTimezone = useMemo(() => {
|
|
24
25
|
if (!selectedTimezone)
|
|
25
|
-
return
|
|
26
|
-
return isSelectedTimezoneOneOFTheAvailable ? selectedTimezone :
|
|
27
|
-
}, [selectedTimezone,
|
|
26
|
+
return defaultCountryTimezone;
|
|
27
|
+
return isSelectedTimezoneOneOFTheAvailable ? selectedTimezone : defaultCountryTimezone;
|
|
28
|
+
}, [selectedTimezone, defaultCountryTimezone, isSelectedTimezoneOneOFTheAvailable]);
|
|
28
29
|
return (_jsxs(TimezoneElement, Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: () => {
|
|
29
30
|
if (selectedTimezone)
|
|
30
31
|
onChange(entityTimezone);
|
|
31
|
-
} }, { children: [isSelectedTimezoneOneOFTheAvailable ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx("img", { src: entityTimezoneIcon, alt: "entity-timezone" }), _jsx(CountryFlag, { code: entityTimezone === null || entityTimezone === void 0 ? void 0 : entityTimezone.countryCode }), _jsx(Label, Object.assign({ className: isSelectedTimezoneOneOFTheAvailable ? 'selected' : '' }, { children: isSelectedTimezoneOneOFTheAvailable ? selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.label :
|
|
32
|
+
} }, { children: [isSelectedTimezoneOneOFTheAvailable ? _jsx("img", { src: smallBlueCheckIcon, alt: "icon" }) : _jsx(Space, {}), _jsx("img", { src: entityTimezoneIcon, alt: "entity-timezone" }), _jsx(CountryFlag, { code: entityTimezone === null || entityTimezone === void 0 ? void 0 : entityTimezone.countryCode }), _jsx(Label, Object.assign({ className: isSelectedTimezoneOneOFTheAvailable ? 'selected' : '' }, { children: isSelectedTimezoneOneOFTheAvailable ? selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.label : defaultCountryTimezone === null || defaultCountryTimezone === void 0 ? void 0 : defaultCountryTimezone.label })), _jsx(Popper, Object.assign({ open: Boolean(entitiesEl), anchorEl: entitiesEl, placement: "right-start", sx: { zIndex: 3 }, disablePortal: true }, { children: _jsx(TimezoneDropdown, Object.assign({ sx: { maxHeight: 300 } }, { children: availableTimezones === null || availableTimezones === void 0 ? void 0 : availableTimezones.map((timeZone, idx) => {
|
|
32
33
|
const isActive = (timeZone === null || timeZone === void 0 ? void 0 : timeZone.timezone) === (selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone);
|
|
33
34
|
return (_jsxs(TimezoneElement, Object.assign({ onClick: (e) => {
|
|
34
35
|
onSelectTimezone(e, timeZone);
|
|
@@ -1,2 +1,28 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { PopperProps } from '@mui/material/Popper';
|
|
3
|
+
import { SxProps } from '@mui/system';
|
|
1
4
|
import type { DateObject } from 'react-multi-date-picker';
|
|
5
|
+
import type { CalenderMode, Timezone } from '../../types/index.js';
|
|
6
|
+
import { RangeDatepickerProps } from './components/RangeDatepicker';
|
|
2
7
|
export type Dates = [DateObject, DateObject];
|
|
8
|
+
export interface RangeCalendarProps {
|
|
9
|
+
defaultDate: [Date, Date];
|
|
10
|
+
onDateChange: (date: [Date, Date]) => void;
|
|
11
|
+
mode?: CalenderMode;
|
|
12
|
+
onCalendarModeSwitch?: (mode: CalenderMode) => void;
|
|
13
|
+
numberOfMonths?: number;
|
|
14
|
+
noTimezone?: boolean;
|
|
15
|
+
noQuickFilter?: boolean;
|
|
16
|
+
maxDateRange?: number;
|
|
17
|
+
onCalendarGroupChange?: (value: string) => void;
|
|
18
|
+
groupBy?: string;
|
|
19
|
+
timezone: Timezone | null;
|
|
20
|
+
onChangeTimezone?: (timezone: Timezone) => void;
|
|
21
|
+
defaultCountryTimezone: Timezone;
|
|
22
|
+
browserTimezone: string;
|
|
23
|
+
renderCalendarButton?: (open: boolean, onOpenCalender: (event: MouseEvent<HTMLElement>) => void) => React.ReactNode;
|
|
24
|
+
mainSx?: SxProps;
|
|
25
|
+
popperProps?: Partial<PopperProps>;
|
|
26
|
+
rangeDatePickerProps?: Partial<RangeDatepickerProps>;
|
|
27
|
+
timezoneCountriesCodes: string[];
|
|
28
|
+
}
|
|
@@ -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;
|
|
@@ -21,7 +21,7 @@ import { BalanceCellContainer, PercentageContainer } from './style';
|
|
|
21
21
|
import { formatPercentage } from './utils';
|
|
22
22
|
import { PiePercentage } from '../style';
|
|
23
23
|
function BalanceCell(_a) {
|
|
24
|
-
var { percentage, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
|
|
24
|
+
var { percentage = 0, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
|
|
27
27
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BalanceCellSheetProps } from './type';
|
|
2
|
-
declare function BalanceCellSheet({
|
|
2
|
+
declare function BalanceCellSheet({ remainingAmount, currency, selectionProps }: BalanceCellSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BalanceCellSheet;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CurrencyIcon, StatusChipWithCopy } from '../../../index.js';
|
|
3
3
|
import { formatAmountWithCurrency } from '../../../../utils/index.js';
|
|
4
|
-
function BalanceCellSheet({
|
|
4
|
+
function BalanceCellSheet({ remainingAmount, currency, selectionProps }) {
|
|
5
5
|
const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
|
|
6
6
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
|
|
7
7
|
const amount = `${integerAmount}.${decimalAmount}`;
|
|
8
|
-
|
|
9
|
-
return null;
|
|
10
|
-
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: 0, copyText: `${integerAmount}.${decimalAmount}`, selectionProps: selectionProps }, { children: [percentage, "% | Remaining balance - ", currencyIcon, " ", amount] })));
|
|
8
|
+
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: 0, copyText: `${integerAmount}.${decimalAmount}`, selectionProps: selectionProps }, { children: [currencyIcon, " ", amount] })));
|
|
11
9
|
}
|
|
12
10
|
export default BalanceCellSheet;
|
|
@@ -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>, {}>;
|
package/build/constants/apps.js
CHANGED
|
@@ -371,11 +371,11 @@ export const APP_DIMENSIONS = {
|
|
|
371
371
|
maxHeight: '100vh',
|
|
372
372
|
},
|
|
373
373
|
[APP_CODES.reports.code]: {
|
|
374
|
-
width:
|
|
375
|
-
minWidth:
|
|
374
|
+
width: 700,
|
|
375
|
+
minWidth: 700,
|
|
376
376
|
maxWidth: 'unset',
|
|
377
377
|
maxHeight: 'unset',
|
|
378
|
-
height:
|
|
378
|
+
height: 652,
|
|
379
379
|
},
|
|
380
380
|
[APP_CODES.billing.code]: {
|
|
381
381
|
minWidth: 856,
|
package/build/utils/index.d.ts
CHANGED
package/build/utils/index.js
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { COUNTRIES_TIMEZONES } from '../constants/index.js';
|
|
2
|
+
export const getTimezoneByCountryCode = (code) => { var _a; return (_a = COUNTRIES_TIMEZONES.find((country) => country.countryCode === code)) !== null && _a !== void 0 ? _a : COUNTRIES_TIMEZONES[0]; };
|
|
3
|
+
export const getTimezoneByTimezone = (timezone) => { var _a; return (_a = COUNTRIES_TIMEZONES.find((country) => country.timezone === timezone)) !== null && _a !== void 0 ? _a : COUNTRIES_TIMEZONES[0]; };
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.224-test.1",
|
|
5
|
+
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -163,4 +163,4 @@
|
|
|
163
163
|
"publishConfig": {
|
|
164
164
|
"registry": "https://registry.npmjs.org/"
|
|
165
165
|
}
|
|
166
|
-
}
|
|
166
|
+
}
|
|
@@ -1,44 +0,0 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useMemo } from 'react';
|
|
14
|
-
import { useTheme } from '@mui/material/styles';
|
|
15
|
-
import Tooltip from '../../../Tooltip';
|
|
16
|
-
import { TableCell } from '../../../TableCells';
|
|
17
|
-
import { CurrencyIcon } from '../../../index.js';
|
|
18
|
-
import { formatAmountWithCurrency } from '../../../../utils/index.js';
|
|
19
|
-
import { BalanceCellContainer } from './style';
|
|
20
|
-
import { TextLabel } from '../style';
|
|
21
|
-
function BalanceCellText(_a) {
|
|
22
|
-
var { percentage, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
|
|
23
|
-
const theme = useTheme();
|
|
24
|
-
const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
|
|
25
|
-
const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
|
|
26
|
-
const amount = `${integerAmount}.${decimalAmount}`;
|
|
27
|
-
const generatedTooltip = useMemo(() => {
|
|
28
|
-
return (_jsxs(_Fragment, { children: ["Remaining Authorized Balance - ", currencyIcon, " ", amount] }));
|
|
29
|
-
}, [remainingAmount, currency]);
|
|
30
|
-
if (percentage === 0)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx("div", Object.assign({ style: {
|
|
33
|
-
display: 'flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'flex-start',
|
|
36
|
-
gap: '8px',
|
|
37
|
-
} }, { children: _jsx(Tooltip, Object.assign({ title: generatedTooltip }, { children: _jsx(BalanceCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", sx: {
|
|
38
|
-
zIndex: 22,
|
|
39
|
-
height: 'auto',
|
|
40
|
-
padding: '0',
|
|
41
|
-
backgroundColor: `${theme.palette.grey.A700}1a`,
|
|
42
|
-
} }, { children: _jsxs(TextLabel, { children: [percentage, "%"] }) })) })) })) })));
|
|
43
|
-
}
|
|
44
|
-
export default BalanceCellText;
|