@tap-payments/os-micro-frontend-shared 0.1.176 → 0.1.178-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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/RangeCalender/RangeCalender.d.ts +2 -2
- package/build/components/RangeCalender/RangeCalender.js +17 -8
- package/build/components/RangeCalender/components/CustomTimepicker/CustomTimepicker.d.ts +2 -6
- package/build/components/RangeCalender/components/CustomTimepicker/CustomTimepicker.js +33 -27
- package/build/components/RangeCalender/components/CustomTimepicker/style.d.ts +1 -1
- package/build/components/RangeCalender/components/RangeDatepicker/RangeDatepicker.d.ts +1 -9
- package/build/components/RangeCalender/components/RangeDatepicker/index.d.ts +1 -0
- package/build/components/RangeCalender/components/RangeDatepicker/index.js +1 -0
- package/build/components/RangeCalender/components/RangeDatepicker/type.d.ts +9 -0
- package/build/components/RangeCalender/components/RangeDatepicker/type.js +1 -0
- package/build/components/RangeCalender/utils.d.ts +5 -1
- package/build/components/RangeCalender/utils.js +11 -0
- package/build/components/StatusChip/StatusChip.d.ts +1 -1
- package/build/components/StatusChip/StatusChip.js +2 -2
- package/build/components/StatusChip/style.d.ts +1 -0
- package/build/components/StatusChip/type.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SegmentsCell/SegmentsCell.js +2 -1
- package/build/components/Timepicker/Timepicker.d.ts +2 -1
- package/build/components/Timepicker/Timepicker.js +2 -2
- package/build/components/Timepicker/index.d.ts +1 -0
- package/build/components/Timepicker/index.js +1 -0
- package/build/components/Timepicker/style.d.ts +1 -0
- package/build/components/Timepicker/style.js +1 -1
- package/build/constants/table/cell/merchantsTableCellWidth.d.ts +7 -7
- package/build/constants/table/cell/merchantsTableCellWidth.js +7 -7
- package/package.json +166 -166
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { PopperProps } from '@mui/material/Popper';
|
|
3
|
-
import type { CalenderMode, Timezone } from '../../types/index.js';
|
|
4
3
|
import { SxProps } from '@mui/system';
|
|
5
|
-
import {
|
|
4
|
+
import type { CalenderMode, Timezone } from '../../types/index.js';
|
|
5
|
+
import { RangeDatepickerProps } from './components/RangeDatepicker';
|
|
6
6
|
interface RangeCalendarProps {
|
|
7
7
|
defaultDate: [Date, Date];
|
|
8
8
|
onDateChange: (date: [Date, Date], timezoneOffset?: number) => void;
|
|
@@ -13,8 +13,10 @@ import QuickFilters from './components/QuickFilters';
|
|
|
13
13
|
import RangeDatePicker from './components/RangeDatepicker';
|
|
14
14
|
import CustomTimezone from './components/Timezone';
|
|
15
15
|
import { ButtonsWrapper, CalenderWrapper, CancelButton, FiltersArea, Footer, Main, OkayButton, SelectedDate, TimeZone, Settings } from './style';
|
|
16
|
+
import CustomTimePicker from './components/CustomTimepicker';
|
|
17
|
+
import { getDateRange, getEndOfDate, getStartOfDate } from './utils';
|
|
16
18
|
function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalendarModeSwitch, numberOfMonths, noTimezone, noQuickFilter, maxDateRange, onCalendarGroupChange, groupBy, timezone, onChangeTimezoneHistory, onChangeTimezone, defaultTimezone, browserTimezone, renderCalendarButton, mainSx, popperProps, rangeDatePickerProps, }) {
|
|
17
|
-
const [dates, setDates] = useState(
|
|
19
|
+
const [dates, setDates] = useState(getDateRange(defaultDate));
|
|
18
20
|
const [values, setValues] = useState(dates);
|
|
19
21
|
const [selectedTimezone, setSelectedTimezone] = useState(timezone);
|
|
20
22
|
const [selectedGroupBy, setSelectedGroupBy] = useState(groupBy || 'day');
|
|
@@ -35,7 +37,7 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
|
|
|
35
37
|
if (!open) {
|
|
36
38
|
if (numberOfMonths === 1)
|
|
37
39
|
return;
|
|
38
|
-
setValues([new DateObject(defaultDate[0]), new DateObject(defaultDate[1])]);
|
|
40
|
+
setValues([new DateObject(defaultDate === null || defaultDate === void 0 ? void 0 : defaultDate[0]), new DateObject(defaultDate === null || defaultDate === void 0 ? void 0 : defaultDate[1])]);
|
|
39
41
|
}
|
|
40
42
|
}, [open]);
|
|
41
43
|
useEffect(() => {
|
|
@@ -45,13 +47,20 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
|
|
|
45
47
|
onChangeTimezone === null || onChangeTimezone === void 0 ? void 0 : onChangeTimezone(newTimezone);
|
|
46
48
|
onChangeTimezoneHistory === null || onChangeTimezoneHistory === void 0 ? void 0 : onChangeTimezoneHistory(newTimezone);
|
|
47
49
|
};
|
|
48
|
-
const formatDate = (date) => new Date(date.
|
|
50
|
+
const formatDate = (date) => new Date(date.toDate().toLocaleString('en-us', {
|
|
49
51
|
timeZone: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone,
|
|
50
52
|
}));
|
|
51
53
|
const submitDate = () => {
|
|
52
54
|
setDates(values);
|
|
53
55
|
onCloseCalender();
|
|
54
|
-
|
|
56
|
+
let newDates;
|
|
57
|
+
if (values[0].dayOfYear === values[1].dayOfYear) {
|
|
58
|
+
newDates = [formatDate(values[0]), formatDate(values[1])];
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
newDates = [formatDate(getStartOfDate(values[0])), formatDate(getEndOfDate(values[1]))];
|
|
62
|
+
}
|
|
63
|
+
onDateChange([newDates[0], newDates[1]], timezone === null || timezone === void 0 ? void 0 : timezone.offset);
|
|
55
64
|
onCalendarGroupChange === null || onCalendarGroupChange === void 0 ? void 0 : onCalendarGroupChange(selectedGroupBy || 'day');
|
|
56
65
|
updateTimezone(selectedTimezone);
|
|
57
66
|
};
|
|
@@ -65,8 +74,8 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
|
|
|
65
74
|
setValues(newDate);
|
|
66
75
|
return;
|
|
67
76
|
}
|
|
68
|
-
const startDate = newDate[0].toDate();
|
|
69
|
-
const endDate = newDate[1].toDate();
|
|
77
|
+
const startDate = getStartOfDate(newDate[0]).toDate();
|
|
78
|
+
const endDate = getEndOfDate(newDate[1]).toDate();
|
|
70
79
|
const numberOfDays = dayjs(endDate).diff(startDate, 'day');
|
|
71
80
|
if (numberOfDays <= maxDateRange) {
|
|
72
81
|
setValues(newDate);
|
|
@@ -79,7 +88,7 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
|
|
|
79
88
|
}, 3000);
|
|
80
89
|
};
|
|
81
90
|
const onChangeQuickFilter = (newValues) => {
|
|
82
|
-
setValues(newValues);
|
|
91
|
+
setValues([getStartOfDate(newValues[0]), getEndOfDate(newValues[1])]);
|
|
83
92
|
if (calendarRef.current)
|
|
84
93
|
calendarRef.current.set({ date: newValues[0] });
|
|
85
94
|
};
|
|
@@ -88,6 +97,6 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
|
|
|
88
97
|
onCloseCalender();
|
|
89
98
|
} })), _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) => {
|
|
90
99
|
setSelectedGroupBy(group);
|
|
91
|
-
} })), _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, defaultTimezone: defaultTimezone, browserTimezone: browserTimezone }, String(open)) })) : (_jsx("div", {})), _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') }))] })] }))] }))] }) }))] })));
|
|
100
|
+
} })), _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, defaultTimezone: defaultTimezone, browserTimezone: browserTimezone }, 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') }))] })] }))] }))] }) }))] })));
|
|
92
101
|
}
|
|
93
102
|
export default RangeCalender;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { DateObject } from 'react-multi-date-picker';
|
|
2
1
|
import { Dates } from '../../type';
|
|
3
2
|
interface CustomTimePickerProps {
|
|
4
3
|
values: Dates;
|
|
5
|
-
|
|
6
|
-
endTime: DateObject;
|
|
7
|
-
onChangeStartTime: (value: DateObject) => void;
|
|
8
|
-
onChangeEndTime: (value: DateObject) => void;
|
|
4
|
+
setValues: (values: Dates) => void;
|
|
9
5
|
}
|
|
10
|
-
declare function CustomTimePicker({ values,
|
|
6
|
+
declare function CustomTimePicker({ values, setValues }: CustomTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
7
|
export default CustomTimePicker;
|
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import { useState
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import
|
|
5
|
-
import TimePicker from 'react-multi-date-picker/plugins/time_picker';
|
|
4
|
+
import { DateObject } from 'react-multi-date-picker';
|
|
6
5
|
import { IOSSwitch } from '../../../index.js';
|
|
6
|
+
import TimePicker, { convertTo12Hour, maxHour } from '../../../Timepicker';
|
|
7
7
|
import { AllDayStyled, TimeArea, TimePickerWrapper, TimeAreaInner } from './style';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const [lastTime, setLastTime] = useState([startTime, endTime]);
|
|
8
|
+
import { getEndOfDate, getStartOfDate } from '../../utils';
|
|
9
|
+
function CustomTimePicker({ values, setValues }) {
|
|
11
10
|
const { t } = useTranslation();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
const startDate = new DateObject(values[0]);
|
|
12
|
+
const endDate = new DateObject(values[1]);
|
|
13
|
+
const [isAllDay, setIsAllDay] = useState(startDate.dayOfYear === endDate.dayOfYear && startDate.hour === 0 && startDate.minute === 0 && endDate.hour === 23 && endDate.minute === 59);
|
|
14
|
+
const formatHour = ({ period, hour }) => period === 'PM' && hour !== 12 ? hour + 12 : period === 'AM' && hour === 12 ? 0 : hour;
|
|
15
|
+
const onChangeStartTime = ({ hour, minute, period }) => {
|
|
16
|
+
setValues([startDate.setHour(formatHour({ hour, period })).setMinute(minute).setSecond(0), endDate]);
|
|
17
|
+
};
|
|
18
|
+
const onChangeEndTime = ({ hour, minute, period }) => {
|
|
19
|
+
setValues([startDate, endDate.setHour(formatHour({ hour, period })).setMinute(minute).setSecond(0)]);
|
|
20
|
+
};
|
|
21
|
+
return (_jsx(TimeArea, { children: _jsxs(TimeAreaInner, { children: [_jsxs(AllDayStyled, Object.assign({ isAllDay: isAllDay }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: t('allDay') })), _jsx(IOSSwitch, { checked: isAllDay, onChange: (e) => {
|
|
22
|
+
setIsAllDay(!isAllDay);
|
|
23
|
+
if (e.target.checked) {
|
|
24
|
+
setValues([getStartOfDate(values[0]), getEndOfDate(values[1])]);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
setValues(values);
|
|
28
|
+
}
|
|
29
|
+
} })] })), !isAllDay && (_jsxs(TimePickerWrapper, { children: [_jsx(TimePicker, { defaultTime: {
|
|
30
|
+
hour: convertTo12Hour(startDate.hour),
|
|
31
|
+
minute: startDate.minute,
|
|
32
|
+
period: startDate.hour >= maxHour ? 'PM' : 'AM',
|
|
33
|
+
}, size: "small", onChange: onChangeStartTime, enableRealTimeChange: true }, `${values[0].toString()}-start`), _jsx(TimePicker, { defaultTime: {
|
|
34
|
+
hour: convertTo12Hour(endDate.hour),
|
|
35
|
+
minute: endDate.minute,
|
|
36
|
+
period: endDate.hour >= maxHour ? 'PM' : 'AM',
|
|
37
|
+
}, size: "small", onChange: onChangeEndTime, enableRealTimeChange: true }, `${values[1].toString()}-end`)] }))] }) }));
|
|
32
38
|
}
|
|
33
39
|
export default CustomTimePicker;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const AllDayStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
3
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
4
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
|
-
isAllDay
|
|
5
|
+
isAllDay?: boolean | undefined;
|
|
6
6
|
}, {}, {}>;
|
|
7
7
|
export declare const TimeArea: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
8
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Dates } from '../../type';
|
|
4
|
-
export interface RangeDatepickerProps extends Omit<CalendarProps, 'onChange'> {
|
|
5
|
-
isAr?: boolean;
|
|
6
|
-
isHijri: boolean;
|
|
7
|
-
values: Dates;
|
|
8
|
-
onChange: (v: Dates) => void;
|
|
9
|
-
numberOfMonths?: number;
|
|
10
|
-
}
|
|
2
|
+
import { RangeDatepickerProps } from './type';
|
|
11
3
|
declare const _default: React.ForwardRefExoticComponent<Omit<RangeDatepickerProps, "ref"> & React.RefAttributes<unknown>>;
|
|
12
4
|
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CalendarProps } from 'react-multi-date-picker';
|
|
2
|
+
import { Dates } from '../../type';
|
|
3
|
+
export interface RangeDatepickerProps extends Omit<CalendarProps, 'onChange'> {
|
|
4
|
+
isAr?: boolean;
|
|
5
|
+
isHijri: boolean;
|
|
6
|
+
values: Dates;
|
|
7
|
+
onChange: (v: Dates) => void;
|
|
8
|
+
numberOfMonths?: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import DateObject from 'react-date-object';
|
|
2
|
+
import { Dates } from './type';
|
|
2
3
|
export declare const getLocale: ({ isHijri, isAr }: {
|
|
3
4
|
isHijri: boolean;
|
|
4
5
|
isAr?: boolean | undefined;
|
|
5
6
|
}) => import("react-date-object").Locale;
|
|
6
7
|
export declare const getCalender: (isHijri: boolean) => import("react-date-object").Calendar;
|
|
8
|
+
export declare const getStartOfDate: (date: DateObject) => DateObject;
|
|
9
|
+
export declare const getEndOfDate: (date: DateObject) => DateObject;
|
|
10
|
+
export declare const getDateRange: (dates: [Date, Date]) => Dates;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import DateObject from 'react-date-object';
|
|
1
2
|
import arabic from 'react-date-object/calendars/arabic';
|
|
2
3
|
import gregorian from 'react-date-object/calendars/gregorian';
|
|
3
4
|
import arabicAr from 'react-date-object/locales/arabic_ar';
|
|
4
5
|
import arabicEn from 'react-date-object/locales/arabic_en';
|
|
5
6
|
import gregorianAr from 'react-date-object/locales/gregorian_ar';
|
|
6
7
|
import gregorianEn from 'react-date-object/locales/gregorian_en';
|
|
8
|
+
import { getDefaultDateRange } from '../../utils/index.js';
|
|
7
9
|
export const getLocale = ({ isHijri, isAr = false }) => {
|
|
8
10
|
if (isHijri) {
|
|
9
11
|
return isAr ? arabicAr : arabicEn;
|
|
@@ -13,3 +15,12 @@ export const getLocale = ({ isHijri, isAr = false }) => {
|
|
|
13
15
|
export const getCalender = (isHijri) => {
|
|
14
16
|
return isHijri ? arabic : gregorian;
|
|
15
17
|
};
|
|
18
|
+
export const getStartOfDate = (date) => date.setHour(0).setMinute(0).setSecond(0);
|
|
19
|
+
export const getEndOfDate = (date) => date.setHour(23).setMinute(59).setSecond(59);
|
|
20
|
+
export const getDateRange = (dates) => {
|
|
21
|
+
if (!((dates === null || dates === void 0 ? void 0 : dates[0]) instanceof Date) || !((dates === null || dates === void 0 ? void 0 : dates[1]) instanceof Date)) {
|
|
22
|
+
const [startDate, endDate] = getDefaultDateRange();
|
|
23
|
+
return [new DateObject(startDate), new DateObject(endDate)];
|
|
24
|
+
}
|
|
25
|
+
return [new DateObject(dates === null || dates === void 0 ? void 0 : dates[0]), new DateObject(dates === null || dates === void 0 ? void 0 : dates[1])];
|
|
26
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChipProps } from './type';
|
|
2
|
-
declare const StatusChip: ({ children, unknownText, copyText, expandDirection, chipStyles, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const StatusChip: ({ children, unknownText, copyText, expandDirection, chipStyles, containerStyles, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default StatusChip;
|
|
@@ -18,7 +18,7 @@ import { copyIcon, greenCheckIcon } from '../../constants/index.js';
|
|
|
18
18
|
import { ChipStyled, Wrapper, CopyWrapper } from './style';
|
|
19
19
|
import { emptyStatusChipColors } from '../../constants/index.js';
|
|
20
20
|
const StatusChip = (_a) => {
|
|
21
|
-
var { children, unknownText, copyText, expandDirection = 'right', chipStyles } = _a, props = __rest(_a, ["children", "unknownText", "copyText", "expandDirection", "chipStyles"]);
|
|
21
|
+
var { children, unknownText, copyText, expandDirection = 'right', chipStyles, containerStyles } = _a, props = __rest(_a, ["children", "unknownText", "copyText", "expandDirection", "chipStyles", "containerStyles"]);
|
|
22
22
|
const [showCopy, setShowCopy] = useState(false);
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const isSelected = props.isSelected;
|
|
@@ -39,7 +39,7 @@ const StatusChip = (_a) => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
const isCopyActive = isSelected && copyText;
|
|
42
|
-
return (_jsxs(motion.div, Object.assign({ style: { position: 'relative' }, animate: { zIndex: isSelected ? 3 : 0 } }, { children: [_jsx(ChipStyled, Object.assign({}, props, { sx: { visibility: 'hidden', pointerEvents: 'none' } }, { children: _jsx(Wrapper, { children: children }) })), _jsx(motion.div, Object.assign({ style: { position: 'absolute', top: 0, zIndex: isSelected ? 3 : 0 }, animate: {
|
|
42
|
+
return (_jsxs(motion.div, Object.assign({ style: Object.assign({ position: 'relative' }, containerStyles), animate: { zIndex: isSelected ? 3 : 0 } }, { children: [_jsx(ChipStyled, Object.assign({}, props, { sx: { visibility: 'hidden', pointerEvents: 'none' } }, { children: _jsx(Wrapper, { children: children }) })), _jsx(motion.div, Object.assign({ style: { position: 'absolute', top: 0, zIndex: isSelected ? 3 : 0 }, animate: {
|
|
43
43
|
left: isCopyActive && expandDirection === 'left' ? -12 : 0,
|
|
44
44
|
}, transition: { delay: isSelected ? 0 : 0.2, duration: 0.2 } }, { children: _jsx(ChipStyled, Object.assign({}, props, { isSelected: isSelected }, chipStyles, { children: _jsxs(motion.div, Object.assign({ layout: "size", style: { display: 'flex', gap: '4px' }, animate: {
|
|
45
45
|
paddingRight: isCopyActive ? 12 : 0,
|
|
@@ -15,6 +15,7 @@ export declare const ChipStyled: import("@emotion/styled").StyledComponent<impor
|
|
|
15
15
|
expandDirection?: "left" | "right" | undefined;
|
|
16
16
|
chipStyles?: object | undefined;
|
|
17
17
|
disableAnimation?: boolean | undefined;
|
|
18
|
+
containerStyles?: object | undefined;
|
|
18
19
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
20
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
20
21
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & {
|
|
@@ -19,6 +19,7 @@ import { TableCell } from '../../../TableCells';
|
|
|
19
19
|
import { segmentsIcons } from './constant';
|
|
20
20
|
import { ReferenceTextLabel, ReferenceTextWrapper, ReferenceSourcesContainer, StyledSourceCell, referenceSourceAnimation } from './style';
|
|
21
21
|
import IconWithBadge from '../../../IconWithBadge';
|
|
22
|
+
import { getSegmentTooltip } from './utils';
|
|
22
23
|
function SegmentsCell(_a) {
|
|
23
24
|
var { isTextShown, segments } = _a, props = __rest(_a, ["isTextShown", "segments"]);
|
|
24
25
|
const [isTooltipOpen, setIsTooltipOpen] = useState(false);
|
|
@@ -26,7 +27,7 @@ function SegmentsCell(_a) {
|
|
|
26
27
|
const ReferenceSources = useMemo(() => segments === null || segments === void 0 ? void 0 : segments.filter((segment) => !!segment.name).map((segment, index) => {
|
|
27
28
|
var _a, _b;
|
|
28
29
|
const isPlatformSegment = (_b = (_a = segment.type) === null || _a === void 0 ? void 0 : _a.toLowerCase) === null || _b === void 0 ? void 0 : _b.call(_a).includes('platform');
|
|
29
|
-
const sourceTooltip = segment.tooltip || segment
|
|
30
|
+
const sourceTooltip = segment.tooltip || getSegmentTooltip(segment);
|
|
30
31
|
const segmentType = segment.type;
|
|
31
32
|
const icon = isPlatformSegment ? segmentsIcons.platform : segmentsIcons[segmentType];
|
|
32
33
|
return (_jsx(Tooltip, Object.assign({ onOpen: () => {
|
|
@@ -7,6 +7,7 @@ interface TimePickerProps {
|
|
|
7
7
|
defaultTime?: Time;
|
|
8
8
|
onChange?: (time: Time) => void;
|
|
9
9
|
enableRealTimeChange?: boolean;
|
|
10
|
+
size?: 'large' | 'small';
|
|
10
11
|
}
|
|
11
|
-
export declare function TimePicker({ onChange, defaultTime, enableRealTimeChange }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function TimePicker({ onChange, defaultTime, enableRealTimeChange, size }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -8,7 +8,7 @@ import { greyUpArrowIcon, greyDownArrowIcon } from '../../constants/index.js';
|
|
|
8
8
|
import { Arrow, Button, Period, PeriodWrapper, Wrapper, Time, TimeWrapper, Input } from './style';
|
|
9
9
|
import { getDefaultHour, getDefaultMinute } from './utils';
|
|
10
10
|
import { maxHour, maxMinute, periodList } from './constant';
|
|
11
|
-
export function TimePicker({ onChange, defaultTime, enableRealTimeChange }) {
|
|
11
|
+
export function TimePicker({ onChange, defaultTime, enableRealTimeChange, size = 'large' }) {
|
|
12
12
|
var _a, _b, _c;
|
|
13
13
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
14
14
|
const [period, setPeriod] = useState((_a = defaultTime === null || defaultTime === void 0 ? void 0 : defaultTime.period) !== null && _a !== void 0 ? _a : (new Date().getHours() >= maxHour ? 'PM' : 'AM'));
|
|
@@ -80,7 +80,7 @@ export function TimePicker({ onChange, defaultTime, enableRealTimeChange }) {
|
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
const formatTime = useCallback((time) => (time < 10 ? `0${time}` : time), []);
|
|
83
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onClose }, { children: _jsxs(Box, { children: [_jsx(Button, Object.assign({ open: open, onClick: onOpen }, { children: `${formatTime(hours)}:${formatTime(minutes)}${period.toLowerCase()}` })), _jsx(Menu, Object.assign({ open: open, anchorEl: anchorEl, placement: "top-start", sx: { marginTop: '8px', marginBottom: '8px' } }, { children: _jsxs(Wrapper, { children: [_jsxs(TimeWrapper, { children: [_jsxs(Time, { children: [_jsx(Arrow, Object.assign({ onClick: onIncreaseHours }, { children: _jsx("img", { src: greyUpArrowIcon, alt: "arrow" }) })), _jsx(Input, { value: formatTime(hours), onChange: onChangeHours }), _jsx(Arrow, Object.assign({ onClick: onDecreaseHours }, { children: _jsx("img", { src: greyDownArrowIcon, alt: "arrow" }) }))] }), _jsx(Text, { children: ":" }), _jsxs(Time, { children: [_jsx(Arrow, Object.assign({ onClick: onIncreaseMinutes }, { children: _jsx("img", { src: greyUpArrowIcon, alt: "arrow" }) })), _jsx(Input, { value: formatTime(minutes), onChange: onChangeMinutes }), _jsx(Arrow, Object.assign({ onClick: onDecreaseMinutes }, { children: _jsx("img", { src: greyDownArrowIcon, alt: "arrow" }) }))] })] }), _jsx(PeriodWrapper, { children: periodList.map((item) => (_jsx(Period, Object.assign({ onClick: () => {
|
|
83
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onClose }, { children: _jsxs(Box, { children: [_jsx(Button, Object.assign({ size: size, open: open, onClick: onOpen }, { children: `${formatTime(hours)}:${formatTime(minutes)}${period.toLowerCase()}` })), _jsx(Menu, Object.assign({ open: open, anchorEl: anchorEl, placement: "top-start", sx: { marginTop: '8px', marginBottom: '8px' } }, { children: _jsxs(Wrapper, { children: [_jsxs(TimeWrapper, { children: [_jsxs(Time, { children: [_jsx(Arrow, Object.assign({ onClick: onIncreaseHours }, { children: _jsx("img", { src: greyUpArrowIcon, alt: "arrow" }) })), _jsx(Input, { value: formatTime(hours), onChange: onChangeHours }), _jsx(Arrow, Object.assign({ onClick: onDecreaseHours }, { children: _jsx("img", { src: greyDownArrowIcon, alt: "arrow" }) }))] }), _jsx(Text, { children: ":" }), _jsxs(Time, { children: [_jsx(Arrow, Object.assign({ onClick: onIncreaseMinutes }, { children: _jsx("img", { src: greyUpArrowIcon, alt: "arrow" }) })), _jsx(Input, { value: formatTime(minutes), onChange: onChangeMinutes }), _jsx(Arrow, Object.assign({ onClick: onDecreaseMinutes }, { children: _jsx("img", { src: greyDownArrowIcon, alt: "arrow" }) }))] })] }), _jsx(PeriodWrapper, { children: periodList.map((item) => (_jsx(Period, Object.assign({ onClick: () => {
|
|
84
84
|
onClickPeriod(item);
|
|
85
85
|
}, selected: period === item }, { children: item }), item))) })] }) }))] }) })));
|
|
86
86
|
}
|
|
@@ -8,6 +8,7 @@ export declare const Button: import("@emotion/styled").StyledComponent<import("@
|
|
|
8
8
|
component?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
10
10
|
open: boolean;
|
|
11
|
+
size: 'large' | 'small';
|
|
11
12
|
}, {}, {}>;
|
|
12
13
|
export declare const Arrow: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
14
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -10,7 +10,7 @@ export const Wrapper = styled(Box)(() => ({
|
|
|
10
10
|
justifyContent: 'center',
|
|
11
11
|
gap: '16px',
|
|
12
12
|
}));
|
|
13
|
-
export const Button = styled(Text, { shouldForwardProp: (props) => props !== 'open' })(({ theme, open }) => (Object.assign({ fontSize: '11px', fontWeight: 500, background: theme.palette.common.white, border: `1px solid ${theme.palette.divider}`, borderRadius: '19px', height: 32, width: 74, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer' }, (open && { boxShadow: '0px 0px 4px 0px #1F88D080', borderColor: theme.palette.info.dark }))));
|
|
13
|
+
export const Button = styled(Text, { shouldForwardProp: (props) => props !== 'open' && props !== 'size' })(({ theme, open, size }) => (Object.assign({ fontSize: '11px', fontWeight: 500, background: theme.palette.common.white, border: `1px solid ${theme.palette.divider}`, borderRadius: '19px', height: size === 'large' ? 32 : 24, width: size === 'large' ? 74 : 58, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer' }, (open && { boxShadow: '0px 0px 4px 0px #1F88D080', borderColor: theme.palette.info.dark }))));
|
|
14
14
|
export const Arrow = styled(Box)(() => ({
|
|
15
15
|
textAlign: 'center',
|
|
16
16
|
cursor: 'pointer',
|
|
@@ -7,7 +7,7 @@ export declare const merchantsTableCellWidth: {
|
|
|
7
7
|
readonly entity: {
|
|
8
8
|
readonly default: "137px";
|
|
9
9
|
readonly text: "180px";
|
|
10
|
-
readonly sheet: "
|
|
10
|
+
readonly sheet: "235px";
|
|
11
11
|
};
|
|
12
12
|
readonly created: {
|
|
13
13
|
readonly default: "144px";
|
|
@@ -17,7 +17,7 @@ export declare const merchantsTableCellWidth: {
|
|
|
17
17
|
readonly brands: {
|
|
18
18
|
readonly default: "131px";
|
|
19
19
|
readonly text: "140px";
|
|
20
|
-
readonly sheet: "
|
|
20
|
+
readonly sheet: "170px";
|
|
21
21
|
};
|
|
22
22
|
readonly marketplace: {
|
|
23
23
|
readonly default: "110px";
|
|
@@ -27,7 +27,7 @@ export declare const merchantsTableCellWidth: {
|
|
|
27
27
|
readonly individuals: {
|
|
28
28
|
readonly default: "147px";
|
|
29
29
|
readonly text: "185px";
|
|
30
|
-
readonly sheet: "
|
|
30
|
+
readonly sheet: "200px";
|
|
31
31
|
};
|
|
32
32
|
readonly segments: {
|
|
33
33
|
readonly default: "70px";
|
|
@@ -42,7 +42,7 @@ export declare const merchantsTableCellWidth: {
|
|
|
42
42
|
readonly status: {
|
|
43
43
|
readonly default: "55px";
|
|
44
44
|
readonly text: "100px";
|
|
45
|
-
readonly sheet: "
|
|
45
|
+
readonly sheet: "172px";
|
|
46
46
|
};
|
|
47
47
|
readonly partners: {
|
|
48
48
|
readonly default: "88px";
|
|
@@ -52,7 +52,7 @@ export declare const merchantsTableCellWidth: {
|
|
|
52
52
|
readonly actions: {
|
|
53
53
|
readonly default: "100px";
|
|
54
54
|
readonly text: "100px";
|
|
55
|
-
readonly sheet: "
|
|
55
|
+
readonly sheet: "36px";
|
|
56
56
|
};
|
|
57
57
|
readonly avatar: {
|
|
58
58
|
readonly default: "40px";
|
|
@@ -67,11 +67,11 @@ export declare const merchantsTableCellWidth: {
|
|
|
67
67
|
readonly channels: {
|
|
68
68
|
readonly default: "94px";
|
|
69
69
|
readonly text: "120px";
|
|
70
|
-
readonly sheet: "
|
|
70
|
+
readonly sheet: "510px";
|
|
71
71
|
};
|
|
72
72
|
readonly merchant: {
|
|
73
73
|
readonly default: "175px";
|
|
74
74
|
readonly text: "180px";
|
|
75
|
-
readonly sheet: "
|
|
75
|
+
readonly sheet: "235px";
|
|
76
76
|
};
|
|
77
77
|
};
|
|
@@ -7,7 +7,7 @@ export const merchantsTableCellWidth = {
|
|
|
7
7
|
entity: {
|
|
8
8
|
default: '137px',
|
|
9
9
|
text: '180px',
|
|
10
|
-
sheet: '
|
|
10
|
+
sheet: '235px',
|
|
11
11
|
},
|
|
12
12
|
created: {
|
|
13
13
|
default: '144px',
|
|
@@ -17,7 +17,7 @@ export const merchantsTableCellWidth = {
|
|
|
17
17
|
brands: {
|
|
18
18
|
default: '131px',
|
|
19
19
|
text: '140px',
|
|
20
|
-
sheet: '
|
|
20
|
+
sheet: '170px',
|
|
21
21
|
},
|
|
22
22
|
marketplace: {
|
|
23
23
|
default: '110px',
|
|
@@ -27,7 +27,7 @@ export const merchantsTableCellWidth = {
|
|
|
27
27
|
individuals: {
|
|
28
28
|
default: '147px',
|
|
29
29
|
text: '185px',
|
|
30
|
-
sheet: '
|
|
30
|
+
sheet: '200px',
|
|
31
31
|
},
|
|
32
32
|
segments: {
|
|
33
33
|
default: '70px',
|
|
@@ -42,7 +42,7 @@ export const merchantsTableCellWidth = {
|
|
|
42
42
|
status: {
|
|
43
43
|
default: '55px',
|
|
44
44
|
text: '100px',
|
|
45
|
-
sheet: '
|
|
45
|
+
sheet: '172px',
|
|
46
46
|
},
|
|
47
47
|
partners: {
|
|
48
48
|
default: '88px',
|
|
@@ -52,7 +52,7 @@ export const merchantsTableCellWidth = {
|
|
|
52
52
|
actions: {
|
|
53
53
|
default: '100px',
|
|
54
54
|
text: '100px',
|
|
55
|
-
sheet: '
|
|
55
|
+
sheet: '36px',
|
|
56
56
|
},
|
|
57
57
|
avatar: {
|
|
58
58
|
default: '40px',
|
|
@@ -67,11 +67,11 @@ export const merchantsTableCellWidth = {
|
|
|
67
67
|
channels: {
|
|
68
68
|
default: '94px',
|
|
69
69
|
text: '120px',
|
|
70
|
-
sheet: '
|
|
70
|
+
sheet: '510px',
|
|
71
71
|
},
|
|
72
72
|
merchant: {
|
|
73
73
|
default: '175px',
|
|
74
74
|
text: '180px',
|
|
75
|
-
sheet: '
|
|
75
|
+
sheet: '235px',
|
|
76
76
|
},
|
|
77
77
|
};
|
package/package.json
CHANGED
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
-
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"testVersion":
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "build/index.js",
|
|
8
|
-
"module": "build/index.js",
|
|
9
|
-
"types": "build/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
"./package.json": "./package.json",
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./build/index.d.ts",
|
|
14
|
-
"import": "./build/index.js",
|
|
15
|
-
"require": "./build/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./constants": {
|
|
18
|
-
"types": "./build/constants/index.d.ts",
|
|
19
|
-
"import": "./build/constants/index.js",
|
|
20
|
-
"require": "./build/constants/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./components": {
|
|
23
|
-
"types": "./build/components/index.d.ts",
|
|
24
|
-
"import": "./build/components/index.js",
|
|
25
|
-
"require": "./build/components/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./components/*": {
|
|
28
|
-
"types": "./build/components/*/index.d.ts",
|
|
29
|
-
"import": "./build/components/*/index.js",
|
|
30
|
-
"require": "./build/components/*/index.js"
|
|
31
|
-
},
|
|
32
|
-
"./hooks": {
|
|
33
|
-
"types": "./build/hooks/index.d.ts",
|
|
34
|
-
"import": "./build/hooks/index.js",
|
|
35
|
-
"require": "./build/hooks/index.js"
|
|
36
|
-
},
|
|
37
|
-
"./utils": {
|
|
38
|
-
"types": "./build/utils/index.d.ts",
|
|
39
|
-
"import": "./build/utils/index.js",
|
|
40
|
-
"require": "./build/utils/index.js"
|
|
41
|
-
},
|
|
42
|
-
"./theme": {
|
|
43
|
-
"types": "./build/theme/index.d.ts",
|
|
44
|
-
"import": "./build/theme/index.js",
|
|
45
|
-
"require": "./build/theme/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./types": {
|
|
48
|
-
"types": "./build/types/index.d.ts",
|
|
49
|
-
"import": "./build/types/index.js",
|
|
50
|
-
"require": "./build/types/index.js"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"license": "MIT",
|
|
54
|
-
"author": {
|
|
55
|
-
"name": "Ahmed Sharkawy",
|
|
56
|
-
"email": "a.elsharkawy@tap.company"
|
|
57
|
-
},
|
|
58
|
-
"files": [
|
|
59
|
-
"build",
|
|
60
|
-
"readme.md"
|
|
61
|
-
],
|
|
62
|
-
"scripts": {
|
|
63
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
64
|
-
"push:local": "yarn ts:build && yalc publish --push",
|
|
65
|
-
"push": "npm run ts:build && npm publish --access public",
|
|
66
|
-
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
67
|
-
"dev": "vite",
|
|
68
|
-
"build": "tsc -b && vite build ",
|
|
69
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
70
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
71
|
-
"lint": "eslint . --color",
|
|
72
|
-
"lint:fix": "eslint src --fix --color",
|
|
73
|
-
"preview": "vite preview",
|
|
74
|
-
"prepare": "husky"
|
|
75
|
-
},
|
|
76
|
-
"dependencies": {
|
|
77
|
-
"@emotion/react": "^11.11.0",
|
|
78
|
-
"@emotion/styled": "^11.11.0",
|
|
79
|
-
"@hookform/resolvers": "^3.3.1",
|
|
80
|
-
"@mui/material": "^5.12.3",
|
|
81
|
-
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
82
|
-
"axios": "^1.4.0",
|
|
83
|
-
"color": "^5.0.0",
|
|
84
|
-
"dayjs": "^1.11.8",
|
|
85
|
-
"framer-motion": "10.11.0",
|
|
86
|
-
"i18next": "^22.4.15",
|
|
87
|
-
"memoize-one": "^6.0.0",
|
|
88
|
-
"re-resizable": "^6.9.9",
|
|
89
|
-
"react": "^18.2.0",
|
|
90
|
-
"react-colorful": "^5.6.1",
|
|
91
|
-
"react-currency-input-field": "^3.6.11",
|
|
92
|
-
"react-dom": "^18.2.0",
|
|
93
|
-
"react-draggable": "^4.4.6",
|
|
94
|
-
"react-dropzone": "^14.2.3",
|
|
95
|
-
"react-hook-form": "^7.45.4",
|
|
96
|
-
"react-hot-toast": "^2.4.1",
|
|
97
|
-
"react-i18next": "^12.2.2",
|
|
98
|
-
"react-lazy-load-image-component": "^1.6.3",
|
|
99
|
-
"react-multi-date-picker": "^4.1.2",
|
|
100
|
-
"react-router-dom": "^7.7.0",
|
|
101
|
-
"react-virtualized-auto-sizer": "^1.0.20",
|
|
102
|
-
"react-window": "^1.8.9",
|
|
103
|
-
"react-window-infinite-loader": "^1.0.9",
|
|
104
|
-
"react18-input-otp": "^1.1.4",
|
|
105
|
-
"recharts": "^2.15.1"
|
|
106
|
-
},
|
|
107
|
-
"devDependencies": {
|
|
108
|
-
"@eslint/js": "^9.17.0",
|
|
109
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
110
|
-
"@types/lodash": "^4.17.15",
|
|
111
|
-
"@types/react": "^18.2.6",
|
|
112
|
-
"@types/react-dom": "^18.3.5",
|
|
113
|
-
"@types/react-lazy-load-image-component": "^1.6.4",
|
|
114
|
-
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
115
|
-
"@types/react-window": "^1.8.5",
|
|
116
|
-
"@types/react-window-infinite-loader": "^1.0.6",
|
|
117
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
118
|
-
"eslint": "^9.17.0",
|
|
119
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
120
|
-
"eslint-plugin-react-refresh": "^0.4.16",
|
|
121
|
-
"globals": "^15.14.0",
|
|
122
|
-
"husky": "^8.0.3",
|
|
123
|
-
"lint-staged": "^13.2.2",
|
|
124
|
-
"prettier": "^2.8.8",
|
|
125
|
-
"tsc-alias": "^1.8.16",
|
|
126
|
-
"typescript": "5.0.2",
|
|
127
|
-
"typescript-eslint": "^8.18.2",
|
|
128
|
-
"vite": "6.0.5",
|
|
129
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
130
|
-
},
|
|
131
|
-
"peerDependencies": {
|
|
132
|
-
"react": "^18",
|
|
133
|
-
"react-dom": "^18",
|
|
134
|
-
"@mui/material": "^5",
|
|
135
|
-
"@emotion/react": "^11",
|
|
136
|
-
"@emotion/styled": "^11",
|
|
137
|
-
"framer-motion": "^10",
|
|
138
|
-
"react-hook-form": "^7",
|
|
139
|
-
"@hookform/resolvers": "^3",
|
|
140
|
-
"react-router-dom": "^7",
|
|
141
|
-
"i18next": "^22",
|
|
142
|
-
"react-i18next": "^12",
|
|
143
|
-
"react-multi-date-picker": "^4",
|
|
144
|
-
"dayjs": "^1",
|
|
145
|
-
"react-dropzone": "^14",
|
|
146
|
-
"react-hot-toast": "^2",
|
|
147
|
-
"recharts": "^2",
|
|
148
|
-
"react-window": "^1.8",
|
|
149
|
-
"react-window-infinite-loader": "^1",
|
|
150
|
-
"react-virtualized-auto-sizer": "^1",
|
|
151
|
-
"re-resizable": "^6",
|
|
152
|
-
"react-draggable": "^4",
|
|
153
|
-
"react-currency-input-field": "^3",
|
|
154
|
-
"react18-input-otp": "^1",
|
|
155
|
-
"@uiw/react-json-view": "^2.0.0-alpha"
|
|
156
|
-
},
|
|
157
|
-
"lint-staged": {
|
|
158
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
159
|
-
"yarn run prettier:fix",
|
|
160
|
-
"yarn run lint"
|
|
161
|
-
]
|
|
162
|
-
},
|
|
163
|
-
"publishConfig": {
|
|
164
|
-
"registry": "https://registry.npmjs.org/"
|
|
165
|
-
}
|
|
166
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
+
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
+
"version": "0.1.178-test.1",
|
|
5
|
+
"testVersion": 1,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "build/index.js",
|
|
8
|
+
"module": "build/index.js",
|
|
9
|
+
"types": "build/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
"./package.json": "./package.json",
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./build/index.d.ts",
|
|
14
|
+
"import": "./build/index.js",
|
|
15
|
+
"require": "./build/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./constants": {
|
|
18
|
+
"types": "./build/constants/index.d.ts",
|
|
19
|
+
"import": "./build/constants/index.js",
|
|
20
|
+
"require": "./build/constants/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./components": {
|
|
23
|
+
"types": "./build/components/index.d.ts",
|
|
24
|
+
"import": "./build/components/index.js",
|
|
25
|
+
"require": "./build/components/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./components/*": {
|
|
28
|
+
"types": "./build/components/*/index.d.ts",
|
|
29
|
+
"import": "./build/components/*/index.js",
|
|
30
|
+
"require": "./build/components/*/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./hooks": {
|
|
33
|
+
"types": "./build/hooks/index.d.ts",
|
|
34
|
+
"import": "./build/hooks/index.js",
|
|
35
|
+
"require": "./build/hooks/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./utils": {
|
|
38
|
+
"types": "./build/utils/index.d.ts",
|
|
39
|
+
"import": "./build/utils/index.js",
|
|
40
|
+
"require": "./build/utils/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./theme": {
|
|
43
|
+
"types": "./build/theme/index.d.ts",
|
|
44
|
+
"import": "./build/theme/index.js",
|
|
45
|
+
"require": "./build/theme/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./types": {
|
|
48
|
+
"types": "./build/types/index.d.ts",
|
|
49
|
+
"import": "./build/types/index.js",
|
|
50
|
+
"require": "./build/types/index.js"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"author": {
|
|
55
|
+
"name": "Ahmed Sharkawy",
|
|
56
|
+
"email": "a.elsharkawy@tap.company"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"build",
|
|
60
|
+
"readme.md"
|
|
61
|
+
],
|
|
62
|
+
"scripts": {
|
|
63
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
64
|
+
"push:local": "yarn ts:build && yalc publish --push",
|
|
65
|
+
"push": "npm run ts:build && npm publish --access public",
|
|
66
|
+
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
67
|
+
"dev": "vite",
|
|
68
|
+
"build": "tsc -b && vite build ",
|
|
69
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
70
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
71
|
+
"lint": "eslint . --color",
|
|
72
|
+
"lint:fix": "eslint src --fix --color",
|
|
73
|
+
"preview": "vite preview",
|
|
74
|
+
"prepare": "husky"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@emotion/react": "^11.11.0",
|
|
78
|
+
"@emotion/styled": "^11.11.0",
|
|
79
|
+
"@hookform/resolvers": "^3.3.1",
|
|
80
|
+
"@mui/material": "^5.12.3",
|
|
81
|
+
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
82
|
+
"axios": "^1.4.0",
|
|
83
|
+
"color": "^5.0.0",
|
|
84
|
+
"dayjs": "^1.11.8",
|
|
85
|
+
"framer-motion": "10.11.0",
|
|
86
|
+
"i18next": "^22.4.15",
|
|
87
|
+
"memoize-one": "^6.0.0",
|
|
88
|
+
"re-resizable": "^6.9.9",
|
|
89
|
+
"react": "^18.2.0",
|
|
90
|
+
"react-colorful": "^5.6.1",
|
|
91
|
+
"react-currency-input-field": "^3.6.11",
|
|
92
|
+
"react-dom": "^18.2.0",
|
|
93
|
+
"react-draggable": "^4.4.6",
|
|
94
|
+
"react-dropzone": "^14.2.3",
|
|
95
|
+
"react-hook-form": "^7.45.4",
|
|
96
|
+
"react-hot-toast": "^2.4.1",
|
|
97
|
+
"react-i18next": "^12.2.2",
|
|
98
|
+
"react-lazy-load-image-component": "^1.6.3",
|
|
99
|
+
"react-multi-date-picker": "^4.1.2",
|
|
100
|
+
"react-router-dom": "^7.7.0",
|
|
101
|
+
"react-virtualized-auto-sizer": "^1.0.20",
|
|
102
|
+
"react-window": "^1.8.9",
|
|
103
|
+
"react-window-infinite-loader": "^1.0.9",
|
|
104
|
+
"react18-input-otp": "^1.1.4",
|
|
105
|
+
"recharts": "^2.15.1"
|
|
106
|
+
},
|
|
107
|
+
"devDependencies": {
|
|
108
|
+
"@eslint/js": "^9.17.0",
|
|
109
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
110
|
+
"@types/lodash": "^4.17.15",
|
|
111
|
+
"@types/react": "^18.2.6",
|
|
112
|
+
"@types/react-dom": "^18.3.5",
|
|
113
|
+
"@types/react-lazy-load-image-component": "^1.6.4",
|
|
114
|
+
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
115
|
+
"@types/react-window": "^1.8.5",
|
|
116
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
117
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
118
|
+
"eslint": "^9.17.0",
|
|
119
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
120
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
121
|
+
"globals": "^15.14.0",
|
|
122
|
+
"husky": "^8.0.3",
|
|
123
|
+
"lint-staged": "^13.2.2",
|
|
124
|
+
"prettier": "^2.8.8",
|
|
125
|
+
"tsc-alias": "^1.8.16",
|
|
126
|
+
"typescript": "5.0.2",
|
|
127
|
+
"typescript-eslint": "^8.18.2",
|
|
128
|
+
"vite": "6.0.5",
|
|
129
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
130
|
+
},
|
|
131
|
+
"peerDependencies": {
|
|
132
|
+
"react": "^18",
|
|
133
|
+
"react-dom": "^18",
|
|
134
|
+
"@mui/material": "^5",
|
|
135
|
+
"@emotion/react": "^11",
|
|
136
|
+
"@emotion/styled": "^11",
|
|
137
|
+
"framer-motion": "^10",
|
|
138
|
+
"react-hook-form": "^7",
|
|
139
|
+
"@hookform/resolvers": "^3",
|
|
140
|
+
"react-router-dom": "^7",
|
|
141
|
+
"i18next": "^22",
|
|
142
|
+
"react-i18next": "^12",
|
|
143
|
+
"react-multi-date-picker": "^4",
|
|
144
|
+
"dayjs": "^1",
|
|
145
|
+
"react-dropzone": "^14",
|
|
146
|
+
"react-hot-toast": "^2",
|
|
147
|
+
"recharts": "^2",
|
|
148
|
+
"react-window": "^1.8",
|
|
149
|
+
"react-window-infinite-loader": "^1",
|
|
150
|
+
"react-virtualized-auto-sizer": "^1",
|
|
151
|
+
"re-resizable": "^6",
|
|
152
|
+
"react-draggable": "^4",
|
|
153
|
+
"react-currency-input-field": "^3",
|
|
154
|
+
"react18-input-otp": "^1",
|
|
155
|
+
"@uiw/react-json-view": "^2.0.0-alpha"
|
|
156
|
+
},
|
|
157
|
+
"lint-staged": {
|
|
158
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
159
|
+
"yarn run prettier:fix",
|
|
160
|
+
"yarn run lint"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"publishConfig": {
|
|
164
|
+
"registry": "https://registry.npmjs.org/"
|
|
165
|
+
}
|
|
166
|
+
}
|