@tap-payments/os-micro-frontend-shared 0.0.89 → 0.0.91
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/StatusBar/StatusBar.d.ts +12 -0
- package/build/components/StatusBar/StatusBar.js +32 -0
- package/build/components/StatusBar/index.d.ts +2 -0
- package/build/components/StatusBar/index.js +2 -0
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/package.json +4 -1
- package/build/components/RangeCalender/RangeCalender.d.ts +0 -20
- package/build/components/RangeCalender/RangeCalender.js +0 -92
- package/build/components/RangeCalender/components/CustomTimepicker/CustomTimepicker.d.ts +0 -11
- package/build/components/RangeCalender/components/CustomTimepicker/CustomTimepicker.js +0 -33
- package/build/components/RangeCalender/components/CustomTimepicker/index.d.ts +0 -2
- package/build/components/RangeCalender/components/CustomTimepicker/index.js +0 -2
- package/build/components/RangeCalender/components/CustomTimepicker/style.d.ts +0 -15
- package/build/components/RangeCalender/components/CustomTimepicker/style.js +0 -132
- package/build/components/RangeCalender/components/GroupBy/GroupBy.d.ts +0 -10
- package/build/components/RangeCalender/components/GroupBy/GroupBy.js +0 -33
- package/build/components/RangeCalender/components/GroupBy/index.d.ts +0 -2
- package/build/components/RangeCalender/components/GroupBy/index.js +0 -2
- package/build/components/RangeCalender/components/GroupBy/style.d.ts +0 -15
- package/build/components/RangeCalender/components/GroupBy/style.js +0 -39
- package/build/components/RangeCalender/components/Hijri/Hijri.d.ts +0 -7
- package/build/components/RangeCalender/components/Hijri/Hijri.js +0 -13
- package/build/components/RangeCalender/components/Hijri/index.d.ts +0 -2
- package/build/components/RangeCalender/components/Hijri/index.js +0 -2
- package/build/components/RangeCalender/components/Hijri/style.d.ts +0 -4
- package/build/components/RangeCalender/components/Hijri/style.js +0 -25
- package/build/components/RangeCalender/components/QuickFilters/QuickFilters.d.ts +0 -8
- package/build/components/RangeCalender/components/QuickFilters/QuickFilters.js +0 -47
- package/build/components/RangeCalender/components/QuickFilters/index.d.ts +0 -2
- package/build/components/RangeCalender/components/QuickFilters/index.js +0 -2
- package/build/components/RangeCalender/components/QuickFilters/style.d.ts +0 -7
- package/build/components/RangeCalender/components/QuickFilters/style.js +0 -27
- package/build/components/RangeCalender/components/RangeDatepicker/RangeDatepicker.d.ts +0 -12
- package/build/components/RangeCalender/components/RangeDatepicker/RangeDatepicker.js +0 -29
- package/build/components/RangeCalender/components/RangeDatepicker/index.d.ts +0 -2
- package/build/components/RangeCalender/components/RangeDatepicker/index.js +0 -2
- package/build/components/RangeCalender/components/RangeDatepicker/style.d.ts +0 -4
- package/build/components/RangeCalender/components/RangeDatepicker/style.js +0 -9
- package/build/components/RangeCalender/components/Timezone/Timezone.d.ts +0 -11
- package/build/components/RangeCalender/components/Timezone/Timezone.js +0 -32
- package/build/components/RangeCalender/components/Timezone/components/EntitiesTimezone.d.ts +0 -12
- package/build/components/RangeCalender/components/Timezone/components/EntitiesTimezone.js +0 -37
- package/build/components/RangeCalender/components/Timezone/components/UserTimezone.d.ts +0 -8
- package/build/components/RangeCalender/components/Timezone/components/UserTimezone.js +0 -14
- package/build/components/RangeCalender/components/Timezone/index.d.ts +0 -2
- package/build/components/RangeCalender/components/Timezone/index.js +0 -2
- package/build/components/RangeCalender/components/Timezone/style.d.ts +0 -21
- package/build/components/RangeCalender/components/Timezone/style.js +0 -61
- package/build/components/RangeCalender/index.d.ts +0 -2
- package/build/components/RangeCalender/index.js +0 -2
- package/build/components/RangeCalender/style.d.ts +0 -33
- package/build/components/RangeCalender/style.js +0 -189
- package/build/components/RangeCalender/type.d.ts +0 -2
- package/build/components/RangeCalender/type.js +0 -1
- package/build/components/RangeCalender/utils.d.ts +0 -6
- package/build/components/RangeCalender/utils.js +0 -15
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AvailableStatus } from '../TableHeader_V2';
|
|
3
|
+
import { TableHeaderStatus } from '../../types/index.js';
|
|
4
|
+
interface StatusBarProps {
|
|
5
|
+
status?: TableHeaderStatus;
|
|
6
|
+
availableStatuses?: AvailableStatus[];
|
|
7
|
+
isFilteredIdsShown?: boolean;
|
|
8
|
+
onStatusChange?: (status: TableHeaderStatus) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const _default: import("react").MemoExoticComponent<typeof StatusBar>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import { memo, useCallback } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { StatusButton } from '../TableHeader_V2';
|
|
6
|
+
function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status }) {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const getButtonStatus = useCallback((buttonStatus) => (buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive'), [status, isFilteredIdsShown]);
|
|
9
|
+
return (_jsx(_Fragment, { children: availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((s) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
if (!Array.isArray(s.status)) {
|
|
12
|
+
return (_createElement(StatusButton, Object.assign({}, s, { key: `status-button-array-${s.status}`, variant: getButtonStatus(s.status), onClick: () => {
|
|
13
|
+
if (!Array.isArray(s.status)) {
|
|
14
|
+
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(s.status);
|
|
15
|
+
}
|
|
16
|
+
} })));
|
|
17
|
+
}
|
|
18
|
+
const isCurrentStatusDropdown = (_a = s.status) === null || _a === void 0 ? void 0 : _a.includes(status || '');
|
|
19
|
+
const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
|
|
20
|
+
const statusLabel = isCurrentStatusDropdown ? status : s.status[0];
|
|
21
|
+
return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
|
|
22
|
+
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(buttonStatus);
|
|
23
|
+
}, dropdownOptions: s.status.map((stat) => ({
|
|
24
|
+
label: t(stat || ''),
|
|
25
|
+
onClick: () => {
|
|
26
|
+
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(stat);
|
|
27
|
+
},
|
|
28
|
+
status: stat,
|
|
29
|
+
})) })) }, (_b = s === null || s === void 0 ? void 0 : s.status) === null || _b === void 0 ? void 0 : _b[0]));
|
|
30
|
+
}) }));
|
|
31
|
+
}
|
|
32
|
+
export default memo(StatusBar);
|
|
@@ -85,6 +85,6 @@ export { default as OTPInput } from './OTPInput';
|
|
|
85
85
|
export { default as FlagDetails } from './FlagDetails';
|
|
86
86
|
export { default as TapLoader } from './Loaders';
|
|
87
87
|
export { default as Error } from './Error';
|
|
88
|
+
export { default as StatusBar } from './StatusBar';
|
|
88
89
|
export * from './Chip';
|
|
89
90
|
export * from './TableHeader_V2';
|
|
90
|
-
export { default as RangeCalender } from './RangeCalender';
|
|
@@ -85,6 +85,6 @@ export { default as OTPInput } from './OTPInput';
|
|
|
85
85
|
export { default as FlagDetails } from './FlagDetails';
|
|
86
86
|
export { default as TapLoader } from './Loaders';
|
|
87
87
|
export { default as Error } from './Error';
|
|
88
|
+
export { default as StatusBar } from './StatusBar';
|
|
88
89
|
export * from './Chip';
|
|
89
90
|
export * from './TableHeader_V2';
|
|
90
|
-
export { default as RangeCalender } from './RangeCalender';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.0.
|
|
4
|
+
"version": "0.0.91",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"module": "build/index.js",
|
|
@@ -125,5 +125,8 @@
|
|
|
125
125
|
"yarn run prettier:fix",
|
|
126
126
|
"yarn run lint"
|
|
127
127
|
]
|
|
128
|
+
},
|
|
129
|
+
"publishConfig": {
|
|
130
|
+
"registry": "https://registry.npmjs.org/"
|
|
128
131
|
}
|
|
129
132
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CalenderMode, Timezone } from '../../types/index.js';
|
|
2
|
-
interface RangeCalendarProps {
|
|
3
|
-
defaultDate: [Date, Date];
|
|
4
|
-
onDateChange: (date: [Date, Date], timezoneOffset?: number) => void;
|
|
5
|
-
mode?: CalenderMode;
|
|
6
|
-
onCalendarModeSwitch?: (mode: CalenderMode) => void;
|
|
7
|
-
numberOfMonths?: number;
|
|
8
|
-
noTimezone?: boolean;
|
|
9
|
-
noQuickFilter?: boolean;
|
|
10
|
-
maxDateRange?: number;
|
|
11
|
-
onCalendarGroupChange?: (value: string) => void;
|
|
12
|
-
groupBy?: string;
|
|
13
|
-
timezone: Timezone;
|
|
14
|
-
onChangeTimezoneHistory?: (timezone: Timezone) => void;
|
|
15
|
-
onChangeTimezone?: (timezone: Timezone) => void;
|
|
16
|
-
defaultTimezone: Timezone;
|
|
17
|
-
browserTimezone: string;
|
|
18
|
-
}
|
|
19
|
-
declare function RangeCalender({ defaultDate, onDateChange, mode, onCalendarModeSwitch, numberOfMonths, noTimezone, noQuickFilter, maxDateRange, onCalendarGroupChange, groupBy, timezone, onChangeTimezoneHistory, onChangeTimezone, defaultTimezone, browserTimezone, }: RangeCalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export default RangeCalender;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import Box from '@mui/material/Box';
|
|
4
|
-
import Collapse from '@mui/material/Collapse';
|
|
5
|
-
import Popper from '@mui/material/Popper';
|
|
6
|
-
import dayjs from 'dayjs';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { DateObject } from 'react-multi-date-picker';
|
|
9
|
-
import { CustomBackdrop, Error } from '../index.js';
|
|
10
|
-
import GroupBy from './components/GroupBy';
|
|
11
|
-
import Hijri from './components/Hijri';
|
|
12
|
-
import QuickFilters from './components/QuickFilters';
|
|
13
|
-
import RangeDatePicker from './components/RangeDatepicker';
|
|
14
|
-
import CustomTimezone from './components/Timezone';
|
|
15
|
-
import { ButtonsWrapper, CalenderWrapper, CancelButton, FiltersArea, Footer, Main, OkayButton, SelectedDate, TimeZone, Settings } from './style';
|
|
16
|
-
function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalendarModeSwitch, numberOfMonths, noTimezone, noQuickFilter, maxDateRange, onCalendarGroupChange, groupBy, timezone, onChangeTimezoneHistory, onChangeTimezone, defaultTimezone, browserTimezone, }) {
|
|
17
|
-
const [dates, setDates] = useState([new DateObject(defaultDate[0]), new DateObject(defaultDate[1])]);
|
|
18
|
-
const [values, setValues] = useState(dates);
|
|
19
|
-
const [selectedTimezone, setSelectedTimezone] = useState(timezone);
|
|
20
|
-
const [selectedGroupBy, setSelectedGroupBy] = useState(groupBy || 'day');
|
|
21
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
22
|
-
const open = Boolean(anchorEl);
|
|
23
|
-
const [isError, setIsError] = useState(false);
|
|
24
|
-
const { t } = useTranslation();
|
|
25
|
-
const calendarRef = useRef();
|
|
26
|
-
const isHijri = mode === 'hijri';
|
|
27
|
-
const onCloseCalender = () => {
|
|
28
|
-
setAnchorEl(null);
|
|
29
|
-
};
|
|
30
|
-
const onOpenCalender = (event) => {
|
|
31
|
-
setAnchorEl(event.currentTarget);
|
|
32
|
-
};
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!open) {
|
|
35
|
-
if (numberOfMonths === 1)
|
|
36
|
-
return;
|
|
37
|
-
setValues([new DateObject(defaultDate[0]), new DateObject(defaultDate[1])]);
|
|
38
|
-
}
|
|
39
|
-
}, [open]);
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
setSelectedTimezone(timezone);
|
|
42
|
-
}, [timezone, open]);
|
|
43
|
-
const updateTimezone = (newTimezone) => {
|
|
44
|
-
onChangeTimezone === null || onChangeTimezone === void 0 ? void 0 : onChangeTimezone(newTimezone);
|
|
45
|
-
onChangeTimezoneHistory === null || onChangeTimezoneHistory === void 0 ? void 0 : onChangeTimezoneHistory(newTimezone);
|
|
46
|
-
};
|
|
47
|
-
const formatDate = (date) => new Date(date.setHour(new Date().getHours()).setMinute(new Date().getMinutes()).setSecond(new Date().getSeconds()).toDate().toLocaleString('en-us', {
|
|
48
|
-
timeZone: selectedTimezone === null || selectedTimezone === void 0 ? void 0 : selectedTimezone.timezone,
|
|
49
|
-
}));
|
|
50
|
-
const submitDate = () => {
|
|
51
|
-
setDates(values);
|
|
52
|
-
onCloseCalender();
|
|
53
|
-
onDateChange([formatDate(values[0]), formatDate(values[1] || values[0])], timezone === null || timezone === void 0 ? void 0 : timezone.offset);
|
|
54
|
-
onCalendarGroupChange === null || onCalendarGroupChange === void 0 ? void 0 : onCalendarGroupChange(selectedGroupBy || 'day');
|
|
55
|
-
updateTimezone(selectedTimezone);
|
|
56
|
-
};
|
|
57
|
-
const getSelectedDate = () => {
|
|
58
|
-
const startSelectedTime = dates[0].format('MMM D');
|
|
59
|
-
const endSelectedTime = dates[1] ? dates[1].format('MMM D') : dates[0].format('MMM D');
|
|
60
|
-
return startSelectedTime === endSelectedTime && !noTimezone ? startSelectedTime : `${startSelectedTime} - ${endSelectedTime}`;
|
|
61
|
-
};
|
|
62
|
-
const onChange = (newDate) => {
|
|
63
|
-
if (newDate.length < 2 || !maxDateRange) {
|
|
64
|
-
setValues(newDate);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const startDate = newDate[0].toDate();
|
|
68
|
-
const endDate = newDate[1].toDate();
|
|
69
|
-
const numberOfDays = dayjs(endDate).diff(startDate, 'day');
|
|
70
|
-
if (numberOfDays <= maxDateRange) {
|
|
71
|
-
setValues(newDate);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
setIsError(true);
|
|
75
|
-
setValues([newDate[0], newDate[1].subtract(numberOfDays - maxDateRange, 'd')]);
|
|
76
|
-
setTimeout(() => {
|
|
77
|
-
setIsError(false);
|
|
78
|
-
}, 3000);
|
|
79
|
-
};
|
|
80
|
-
const onChangeQuickFilter = (newValues) => {
|
|
81
|
-
setValues(newValues);
|
|
82
|
-
if (calendarRef.current)
|
|
83
|
-
calendarRef.current.set({ date: newValues[0] });
|
|
84
|
-
};
|
|
85
|
-
return (_jsxs(Main, Object.assign({ "data-testid": "RangeCalender" }, { children: [_jsx(SelectedDate, Object.assign({ onClick: onOpenCalender, open: open }, { children: (dates[0] || dates[1]) && getSelectedDate() })), open && (_jsx(CustomBackdrop, { onClick: (e) => {
|
|
86
|
-
e.stopPropagation();
|
|
87
|
-
onCloseCalender();
|
|
88
|
-
} })), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-end", sx: { zIndex: 3 } }, { 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) => {
|
|
89
|
-
setSelectedGroupBy(group);
|
|
90
|
-
} })), _jsx(Hijri, { isHijri: isHijri, onCalendarModeSwitch: onCalendarModeSwitch })] })] })), _jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', justifyContent: 'space-between' } }, { children: [_jsx(RangeDatePicker, { values: values, onChange: onChange, isHijri: isHijri, ref: calendarRef, numberOfMonths: numberOfMonths }), _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') }))] })] }))] }))] }) }))] })));
|
|
91
|
-
}
|
|
92
|
-
export default RangeCalender;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DateObject } from 'react-multi-date-picker';
|
|
2
|
-
import { Dates } from '../../type';
|
|
3
|
-
interface CustomTimePickerProps {
|
|
4
|
-
values: Dates;
|
|
5
|
-
startTime: DateObject;
|
|
6
|
-
endTime: DateObject;
|
|
7
|
-
onChangeStartTime: (value: DateObject) => void;
|
|
8
|
-
onChangeEndTime: (value: DateObject) => void;
|
|
9
|
-
}
|
|
10
|
-
declare function CustomTimePicker({ values, onChangeStartTime, onChangeEndTime, startTime, endTime }: CustomTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default CustomTimePicker;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import DatePicker, { DateObject } from 'react-multi-date-picker';
|
|
5
|
-
import TimePicker from 'react-multi-date-picker/plugins/time_picker';
|
|
6
|
-
import { IOSSwitch } from '../../../index.js';
|
|
7
|
-
import { AllDayStyled, TimeArea, TimePickerWrapper, TimeAreaInner } from './style';
|
|
8
|
-
function CustomTimePicker({ values, onChangeStartTime, onChangeEndTime, startTime, endTime }) {
|
|
9
|
-
const [isAllDay, setIsAllDay] = useState(false);
|
|
10
|
-
const [lastTime, setLastTime] = useState([startTime, endTime]);
|
|
11
|
-
const { t } = useTranslation();
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (isAllDay)
|
|
14
|
-
setIsAllDay(new DateObject(values[0]).dayOfYear === new DateObject(values[1]).dayOfYear);
|
|
15
|
-
}, [values]);
|
|
16
|
-
return (_jsx(_Fragment, { children: new DateObject(values[0]).dayOfYear === new DateObject(values[1]).dayOfYear && (_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) => {
|
|
17
|
-
setIsAllDay(!isAllDay);
|
|
18
|
-
if (e.target.checked) {
|
|
19
|
-
setLastTime([startTime, endTime]);
|
|
20
|
-
onChangeStartTime(new DateObject().setHour(0).setMinute(0));
|
|
21
|
-
onChangeEndTime(new DateObject().setHour(23).setMinute(59));
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
onChangeStartTime(lastTime[0]);
|
|
25
|
-
onChangeEndTime(lastTime[1]);
|
|
26
|
-
}
|
|
27
|
-
} })] })), !isAllDay && (_jsxs(TimePickerWrapper, { children: [_jsx(DatePicker, { arrow: false, disableDayPicker: true, hideOnScroll: true, format: "hh:mma", value: startTime, onChange: (time) => {
|
|
28
|
-
onChangeStartTime(time);
|
|
29
|
-
}, type: "button", plugins: [_jsx(TimePicker, { position: "top", hideSeconds: true })] }), _jsx(DatePicker, { arrow: false, disableDayPicker: true, hideOnScroll: true, format: "hh:mma", value: endTime, onChange: (time) => {
|
|
30
|
-
onChangeEndTime(time);
|
|
31
|
-
}, type: "button", plugins: [_jsx(TimePicker, { position: "top", hideSeconds: true })] })] }))] }) })) }));
|
|
32
|
-
}
|
|
33
|
-
export default CustomTimePicker;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
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
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
|
-
isAllDay: boolean;
|
|
6
|
-
}, {}, {}>;
|
|
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
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
9
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
10
|
-
export declare const TimePickerWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
13
|
-
export declare const TimeAreaInner: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
15
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import Box from '@mui/material/Box';
|
|
2
|
-
import { styled } from '@mui/material/styles';
|
|
3
|
-
import { grayUpArrowIcon } from '../../../../constants/index.js';
|
|
4
|
-
export const AllDayStyled = styled(Box, { shouldForwardProp: (props) => props !== 'isAllDay' })(({ theme, isAllDay }) => (Object.assign({ display: 'flex', alignItems: 'center', gap: theme.spacing(1), position: 'relative', paddingInline: '5px', '.label': {
|
|
5
|
-
width: 'max-content',
|
|
6
|
-
} }, (!isAllDay && {
|
|
7
|
-
paddingRight: theme.spacing(1),
|
|
8
|
-
'&:after': {
|
|
9
|
-
content: '""',
|
|
10
|
-
position: 'absolute',
|
|
11
|
-
width: '1px',
|
|
12
|
-
background: theme.palette.divider,
|
|
13
|
-
right: 0,
|
|
14
|
-
height: 17,
|
|
15
|
-
},
|
|
16
|
-
}))));
|
|
17
|
-
export const TimeArea = styled(Box)(() => ({
|
|
18
|
-
width: 235,
|
|
19
|
-
}));
|
|
20
|
-
export const TimePickerWrapper = styled(Box)(({ theme }) => ({
|
|
21
|
-
display: 'flex',
|
|
22
|
-
gap: '4px',
|
|
23
|
-
'.rmdp-input': {
|
|
24
|
-
width: '64px',
|
|
25
|
-
borderRadius: '19px',
|
|
26
|
-
border: '1px solid',
|
|
27
|
-
borderColor: theme.palette.divider,
|
|
28
|
-
color: theme.palette.text.primary,
|
|
29
|
-
fontSize: '11px',
|
|
30
|
-
fontWeight: 500,
|
|
31
|
-
background: 'transparent',
|
|
32
|
-
cursor: 'pointer',
|
|
33
|
-
},
|
|
34
|
-
'.rmdp-input:focus': {
|
|
35
|
-
boxShadow: theme.shadows[7],
|
|
36
|
-
border: `1px solid ${theme.palette.info.dark}`,
|
|
37
|
-
borderRadius: '19px',
|
|
38
|
-
},
|
|
39
|
-
'.rmdp-time-picker': {
|
|
40
|
-
boxShadow: theme.shadows[5],
|
|
41
|
-
borderRadius: theme.spacing(1),
|
|
42
|
-
padding: theme.spacing(2),
|
|
43
|
-
minWidth: 'auto !important',
|
|
44
|
-
div: {
|
|
45
|
-
marginTop: 0,
|
|
46
|
-
display: 'block',
|
|
47
|
-
},
|
|
48
|
-
'> div': {
|
|
49
|
-
width: 32,
|
|
50
|
-
height: 64,
|
|
51
|
-
},
|
|
52
|
-
'.rmdp-arrow': {
|
|
53
|
-
borderColor: `${theme.palette.background.transparent[1]} !important`,
|
|
54
|
-
},
|
|
55
|
-
'.rmdp-arrow-container': {
|
|
56
|
-
justifyContent: 'center',
|
|
57
|
-
'&:hover': {
|
|
58
|
-
backgroundColor: 'transparent',
|
|
59
|
-
boxShadow: 'unset',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
input: {
|
|
63
|
-
borderRadius: '4px',
|
|
64
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
65
|
-
padding: 0,
|
|
66
|
-
width: 32,
|
|
67
|
-
height: 32,
|
|
68
|
-
fontSize: '11px',
|
|
69
|
-
color: theme.palette.text.primary,
|
|
70
|
-
fontWeight: 500,
|
|
71
|
-
'&:focus, &:focus-visible': {
|
|
72
|
-
border: `1px solid ${theme.palette.info.dark}`,
|
|
73
|
-
outline: 'unset',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
'.dvdr': {
|
|
77
|
-
margin: '7px 4px 0',
|
|
78
|
-
},
|
|
79
|
-
'.rmdp-am, .rmdp-pm': {
|
|
80
|
-
margin: 0,
|
|
81
|
-
width: 32,
|
|
82
|
-
height: 32,
|
|
83
|
-
flex: 'auto',
|
|
84
|
-
justifyContent: 'center',
|
|
85
|
-
fontSize: '11px',
|
|
86
|
-
color: theme.palette.text.primary,
|
|
87
|
-
fontWeight: 500,
|
|
88
|
-
display: 'flex',
|
|
89
|
-
cursor: 'default',
|
|
90
|
-
},
|
|
91
|
-
'> div:last-child': {
|
|
92
|
-
marginInlineStart: '4px',
|
|
93
|
-
display: 'block !important',
|
|
94
|
-
},
|
|
95
|
-
'.rmdp-down, .rmdp-up': {
|
|
96
|
-
position: 'relative',
|
|
97
|
-
i: {
|
|
98
|
-
display: 'none',
|
|
99
|
-
},
|
|
100
|
-
'&:before': {
|
|
101
|
-
content: '""',
|
|
102
|
-
position: 'absolute',
|
|
103
|
-
top: '5px',
|
|
104
|
-
width: '10px',
|
|
105
|
-
height: '10px',
|
|
106
|
-
backgroundImage: `url(${grayUpArrowIcon})`,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
'.rmdp-down:before': {
|
|
110
|
-
transform: 'rotate(180deg)',
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
'.rmdp-container': {
|
|
114
|
-
position: 'relative',
|
|
115
|
-
'> div': {
|
|
116
|
-
top: 'unset !important',
|
|
117
|
-
bottom: '28px',
|
|
118
|
-
transform: 'unset !important',
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
}));
|
|
122
|
-
export const TimeAreaInner = styled(Box)(({ theme }) => ({
|
|
123
|
-
display: 'flex',
|
|
124
|
-
gap: '8px',
|
|
125
|
-
alignItems: 'center',
|
|
126
|
-
borderRadius: '50px',
|
|
127
|
-
border: '1px solid',
|
|
128
|
-
borderColor: theme.palette.divider,
|
|
129
|
-
paddingInline: '5px',
|
|
130
|
-
width: 'fit-content',
|
|
131
|
-
height: 32,
|
|
132
|
-
}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BoxProps } from '@mui/material/Box';
|
|
3
|
-
interface GroupByProps extends BoxProps {
|
|
4
|
-
groupBy: string;
|
|
5
|
-
isCalenderOpen: boolean;
|
|
6
|
-
onUpdate?: (value: string) => void;
|
|
7
|
-
}
|
|
8
|
-
declare function GroupBy({ sx, groupBy, isCalenderOpen, onUpdate }: GroupByProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare const _default: import("react").MemoExoticComponent<typeof GroupBy>;
|
|
10
|
-
export default _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useState } from 'react';
|
|
3
|
-
import Box from '@mui/material/Box';
|
|
4
|
-
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
5
|
-
import Popper from '@mui/material/Popper';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { blackHeadingDownArrow } from '../../../../constants/index.js';
|
|
8
|
-
import { GroupByLabel, GroupByDropdownButton, GroupByDropdown, Option } from './style';
|
|
9
|
-
const groupByLabel = {
|
|
10
|
-
day: 'Day',
|
|
11
|
-
month: 'Month',
|
|
12
|
-
quarter: 'Quarter',
|
|
13
|
-
year: 'Year',
|
|
14
|
-
};
|
|
15
|
-
function GroupBy({ sx, groupBy, isCalenderOpen, onUpdate }) {
|
|
16
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
17
|
-
const open = Boolean(anchorEl) && isCalenderOpen;
|
|
18
|
-
const { t } = useTranslation();
|
|
19
|
-
const onClose = () => {
|
|
20
|
-
setAnchorEl(null);
|
|
21
|
-
};
|
|
22
|
-
const onOpen = (e) => {
|
|
23
|
-
setAnchorEl(e.currentTarget);
|
|
24
|
-
};
|
|
25
|
-
const onSelect = (value) => {
|
|
26
|
-
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(value);
|
|
27
|
-
onClose();
|
|
28
|
-
};
|
|
29
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onClose }, { children: _jsxs(Box, Object.assign({ sx: sx }, { children: [_jsx(GroupByLabel, { children: t('groupedBy') }), _jsxs(GroupByDropdownButton, Object.assign({ onClick: onOpen, open: open }, { children: [_jsx("span", { children: groupByLabel[groupBy] }), _jsx(Box, { component: "img", src: blackHeadingDownArrow, alt: "arrow", sx: Object.assign({}, (open && { transform: 'rotate(180deg)' })) })] })), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, sx: { zIndex: 3 } }, { children: _jsx(GroupByDropdown, Object.assign({ sx: { width: anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth } }, { children: Object.entries(groupByLabel).map(([key, value]) => (_jsx(Option, Object.assign({ onClick: () => {
|
|
30
|
-
onSelect(key);
|
|
31
|
-
}, className: groupBy === key ? 'active' : '' }, { children: value }), `${key}-groupedBy`))) })) }))] })) })));
|
|
32
|
-
}
|
|
33
|
-
export default memo(GroupBy);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const GroupByLabel: 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
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
|
-
export declare const GroupByDropdownButton: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
7
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
8
|
-
open: boolean;
|
|
9
|
-
}, {}, {}>;
|
|
10
|
-
export declare const GroupByDropdown: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
13
|
-
export declare const Option: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
15
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import Box from '@mui/material/Box';
|
|
2
|
-
import { styled } from '@mui/material/styles';
|
|
3
|
-
export const GroupByLabel = styled(Box)(({ theme }) => ({
|
|
4
|
-
color: theme.palette.grey[700],
|
|
5
|
-
fontSize: '9px',
|
|
6
|
-
fontWeight: 500,
|
|
7
|
-
marginBottom: '6px',
|
|
8
|
-
}));
|
|
9
|
-
export const GroupByDropdownButton = styled(Box, { shouldForwardProp: (props) => props !== 'open' })(({ theme, open }) => (Object.assign({ borderRadius: '4px', border: `1px solid ${theme.palette.divider}`, background: theme.palette.common.white, height: 32, padding: '8px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', cursor: 'pointer' }, (open && {
|
|
10
|
-
border: `1px solid ${theme.palette.info.dark}`,
|
|
11
|
-
background: theme.palette.common.white,
|
|
12
|
-
boxShadow: theme.shadows[7],
|
|
13
|
-
}))));
|
|
14
|
-
export const GroupByDropdown = styled(Box)(({ theme }) => ({
|
|
15
|
-
borderRadius: '8px',
|
|
16
|
-
background: theme.palette.common.white,
|
|
17
|
-
boxShadow: '0px 8px 36px 0px rgba(0, 0, 0, 0.15)',
|
|
18
|
-
textAlign: 'center',
|
|
19
|
-
color: theme.palette.grey[900],
|
|
20
|
-
fontSize: '12px',
|
|
21
|
-
fontWeight: 500,
|
|
22
|
-
lineHeight: '20px',
|
|
23
|
-
letterSpacing: '0.1px',
|
|
24
|
-
padding: '16px',
|
|
25
|
-
display: 'flex',
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
justifyContent: 'center',
|
|
28
|
-
gap: '12px',
|
|
29
|
-
flexDirection: 'column',
|
|
30
|
-
}));
|
|
31
|
-
export const Option = styled(Box)(({ theme }) => ({
|
|
32
|
-
width: 71,
|
|
33
|
-
padding: '4px 0',
|
|
34
|
-
cursor: 'pointer',
|
|
35
|
-
'&:hover, &.active': {
|
|
36
|
-
borderRadius: '100px',
|
|
37
|
-
background: theme.palette.info.light,
|
|
38
|
-
},
|
|
39
|
-
}));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CalenderMode } from '../../../../types/index.js';
|
|
2
|
-
interface CalenderSettingsProps {
|
|
3
|
-
isHijri: boolean;
|
|
4
|
-
onCalendarModeSwitch?: (mode: CalenderMode) => void;
|
|
5
|
-
}
|
|
6
|
-
export default function Hijri({ isHijri, onCalendarModeSwitch }: CalenderSettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Box from '@mui/material/Box';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { IOSSwitch } from '../../../index.js';
|
|
5
|
-
import { hijriIcon } from '../../../../constants/index.js';
|
|
6
|
-
import { CalenderSetting } from './style';
|
|
7
|
-
export default function Hijri({ isHijri, onCalendarModeSwitch }) {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
const onChange = () => {
|
|
10
|
-
onCalendarModeSwitch === null || onCalendarModeSwitch === void 0 ? void 0 : onCalendarModeSwitch(isHijri ? 'gregorian' : 'hijri');
|
|
11
|
-
};
|
|
12
|
-
return (_jsx(Box, { children: _jsxs(CalenderSetting, { children: [_jsxs(Box, { children: [_jsx("img", { src: hijriIcon, alt: "hijri" }), _jsx("span", { children: t('hijri') })] }), _jsx(IOSSwitch, { checked: isHijri, onChange: onChange })] }) }));
|
|
13
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const CalenderSetting: 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
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import Box from '@mui/material/Box';
|
|
2
|
-
import { styled } from '@mui/material/styles';
|
|
3
|
-
export const CalenderSetting = styled(Box)(({ theme }) => ({
|
|
4
|
-
border: '1px solid',
|
|
5
|
-
borderColor: theme.palette.divider,
|
|
6
|
-
borderRadius: '50px',
|
|
7
|
-
paddingInline: '6px 12px',
|
|
8
|
-
color: theme.palette.text.primary,
|
|
9
|
-
fontSize: '11px',
|
|
10
|
-
display: 'flex',
|
|
11
|
-
gap: '8px',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
justifyContent: 'space-between',
|
|
14
|
-
height: 32,
|
|
15
|
-
marginTop: '8px',
|
|
16
|
-
img: {
|
|
17
|
-
width: 16,
|
|
18
|
-
height: 16,
|
|
19
|
-
},
|
|
20
|
-
'& > div': {
|
|
21
|
-
display: 'flex',
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
gap: '2px',
|
|
24
|
-
},
|
|
25
|
-
}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DateObject } from 'react-multi-date-picker';
|
|
2
|
-
interface QuickFiltersProps {
|
|
3
|
-
onChange: (dates: [DateObject, DateObject]) => void;
|
|
4
|
-
isHijri: boolean;
|
|
5
|
-
isAr?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export default function QuickFilters({ onChange, isHijri, isAr }: QuickFiltersProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|