mui-design-system 0.0.21 → 0.0.22
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/package.json +1 -1
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/index.js +0 -93
- package/dist/colors/type.d.ts +0 -5
- package/dist/colors/type.js +0 -1
- package/dist/components/checkbox-list/CheckboxList.d.ts +0 -21
- package/dist/components/checkbox-list/CheckboxList.js +0 -31
- package/dist/components/custom-auto-complete/CustomAutoComplete.d.ts +0 -27
- package/dist/components/custom-auto-complete/CustomAutoComplete.js +0 -75
- package/dist/components/custom-auto-complete/components/AutoCompleteInput.d.ts +0 -21
- package/dist/components/custom-auto-complete/components/AutoCompleteInput.js +0 -29
- package/dist/components/custom-auto-complete/components/ListBox.d.ts +0 -5
- package/dist/components/custom-auto-complete/components/ListBox.js +0 -62
- package/dist/components/custom-auto-complete/components/ListRow.d.ts +0 -2
- package/dist/components/custom-auto-complete/components/ListRow.js +0 -21
- package/dist/components/custom-auto-complete-advanced/CustomAutoComplete.d.ts +0 -28
- package/dist/components/custom-auto-complete-advanced/CustomAutoComplete.js +0 -92
- package/dist/components/custom-auto-complete-advanced/components/ListBox.d.ts +0 -6
- package/dist/components/custom-auto-complete-advanced/components/ListBox.js +0 -76
- package/dist/components/custom-auto-complete-advanced/components/ListRow.d.ts +0 -2
- package/dist/components/custom-auto-complete-advanced/components/ListRow.js +0 -17
- package/dist/components/custom-auto-complete-advanced/components/RenderInput.d.ts +0 -23
- package/dist/components/custom-auto-complete-advanced/components/RenderInput.js +0 -51
- package/dist/components/custom-auto-complete-advanced/components/RenderTags.d.ts +0 -9
- package/dist/components/custom-auto-complete-advanced/components/RenderTags.js +0 -22
- package/dist/components/custom-breadcrumbs/CustomBreadcrumbs.d.ts +0 -17
- package/dist/components/custom-breadcrumbs/CustomBreadcrumbs.js +0 -11
- package/dist/components/custom-card/CustomHorizontalCard.d.ts +0 -3
- package/dist/components/custom-card/CustomHorizontalCard.js +0 -9
- package/dist/components/custom-card/CustomVerticalCard.d.ts +0 -3
- package/dist/components/custom-card/CustomVerticalCard.js +0 -9
- package/dist/components/custom-chip/CustomChip.d.ts +0 -12
- package/dist/components/custom-chip/CustomChip.js +0 -10
- package/dist/components/custom-date-picker/CustomComponent.d.ts +0 -17
- package/dist/components/custom-date-picker/CustomComponent.js +0 -36
- package/dist/components/custom-date-picker/CustomDatePicker.d.ts +0 -14
- package/dist/components/custom-date-picker/CustomDatePicker.js +0 -55
- package/dist/components/custom-dialog/CustomDialog.d.ts +0 -41
- package/dist/components/custom-dialog/CustomDialog.js +0 -38
- package/dist/components/custom-input/CustomNumericInput.d.ts +0 -9
- package/dist/components/custom-input/CustomNumericInput.js +0 -32
- package/dist/components/custom-mobile-date-picker/CustomBottomSheet.d.ts +0 -9
- package/dist/components/custom-mobile-date-picker/CustomBottomSheet.js +0 -29
- package/dist/components/custom-mobile-date-picker/CustomMobileDatePicker.d.ts +0 -19
- package/dist/components/custom-mobile-date-picker/CustomMobileDatePicker.js +0 -98
- package/dist/components/custom-mobile-date-picker/DatePickerBottomSheet.d.ts +0 -19
- package/dist/components/custom-mobile-date-picker/DatePickerBottomSheet.js +0 -40
- package/dist/components/custom-mobile-date-picker/ItemPicker.d.ts +0 -10
- package/dist/components/custom-mobile-date-picker/ItemPicker.js +0 -72
- package/dist/components/custom-modal/CustomModal.d.ts +0 -21
- package/dist/components/custom-modal/CustomModal.js +0 -38
- package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.d.ts +0 -9
- package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.js +0 -13
- package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.d.ts +0 -20
- package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.js +0 -33
- package/dist/components/custom-progress/LinearBufferProgress.d.ts +0 -6
- package/dist/components/custom-progress/LinearBufferProgress.js +0 -14
- package/dist/components/custom-stepper/CustomStepper.d.ts +0 -31
- package/dist/components/custom-stepper/CustomStepper.js +0 -170
- package/dist/components/custom-table/CustomTable.d.ts +0 -55
- package/dist/components/custom-table/CustomTable.js +0 -50
- package/dist/components/custom-table/components/CustomTableBody.d.ts +0 -21
- package/dist/components/custom-table/components/CustomTableBody.js +0 -11
- package/dist/components/custom-table/components/CustomTableCell.d.ts +0 -8
- package/dist/components/custom-table/components/CustomTableCell.js +0 -23
- package/dist/components/custom-table/components/CustomTableHead.d.ts +0 -17
- package/dist/components/custom-table/components/CustomTableHead.js +0 -63
- package/dist/components/custom-table/components/CustomTableRow.d.ts +0 -26
- package/dist/components/custom-table/components/CustomTableRow.js +0 -102
- package/dist/components/custom-table/components/useTable.d.ts +0 -24
- package/dist/components/custom-table/components/useTable.js +0 -77
- package/dist/components/custom-tabs/CustomTabs.d.ts +0 -22
- package/dist/components/custom-tabs/CustomTabs.js +0 -70
- package/dist/components/custom-uploader/CustomUploader.d.ts +0 -23
- package/dist/components/custom-uploader/CustomUploader.js +0 -68
- package/dist/components/error boundary/ErrorComponent.d.ts +0 -7
- package/dist/components/error boundary/ErrorComponent.js +0 -6
- package/dist/components/error boundary/withErrorBoundary.d.ts +0 -7
- package/dist/components/error boundary/withErrorBoundary.js +0 -10
- package/dist/components/index.d.ts +0 -183
- package/dist/components/index.js +0 -70
- package/dist/components/input-list/Form.d.ts +0 -21
- package/dist/components/input-list/Form.js +0 -19
- package/dist/components/input-list/InputListWithUseForm.d.ts +0 -22
- package/dist/components/input-list/InputListWithUseForm.js +0 -22
- package/dist/components/input-list/UseFormInput.d.ts +0 -11
- package/dist/components/input-list/UseFormInput.js +0 -50
- package/dist/components/input-list/checkbox-list/CheckboxList.d.ts +0 -19
- package/dist/components/input-list/checkbox-list/CheckboxList.js +0 -30
- package/dist/components/input-list/components/UFAutoComplete.d.ts +0 -9
- package/dist/components/input-list/components/UFAutoComplete.js +0 -41
- package/dist/components/input-list/components/UFCheckbox.d.ts +0 -19
- package/dist/components/input-list/components/UFCheckbox.js +0 -21
- package/dist/components/input-list/components/UFCurrency.d.ts +0 -9
- package/dist/components/input-list/components/UFCurrency.js +0 -47
- package/dist/components/input-list/components/UFDatePicker.d.ts +0 -9
- package/dist/components/input-list/components/UFDatePicker.js +0 -17
- package/dist/components/input-list/components/UFDatePickerMobile.d.ts +0 -9
- package/dist/components/input-list/components/UFDatePickerMobile.js +0 -6
- package/dist/components/input-list/components/UFMultiCheckbox.d.ts +0 -9
- package/dist/components/input-list/components/UFMultiCheckbox.js +0 -17
- package/dist/components/input-list/components/UFMultiSelect.d.ts +0 -9
- package/dist/components/input-list/components/UFMultiSelect.js +0 -56
- package/dist/components/input-list/components/UFRadio.d.ts +0 -9
- package/dist/components/input-list/components/UFRadio.js +0 -19
- package/dist/components/input-list/components/UFSelect.d.ts +0 -9
- package/dist/components/input-list/components/UFSelect.js +0 -19
- package/dist/components/input-list/components/UFSwitch.d.ts +0 -19
- package/dist/components/input-list/components/UFSwitch.js +0 -99
- package/dist/components/input-list/components/UFTextArea.d.ts +0 -9
- package/dist/components/input-list/components/UFTextArea.js +0 -12
- package/dist/components/input-list/components/UFTextField.d.ts +0 -11
- package/dist/components/input-list/components/UFTextField.js +0 -29
- package/dist/components/input-list/components/UFTime.d.ts +0 -10
- package/dist/components/input-list/components/UFTime.js +0 -93
- package/dist/components/input-list/components/UFUploader.d.ts +0 -9
- package/dist/components/input-list/components/UFUploader.js +0 -41
- package/dist/components/input-list/type.d.ts +0 -165
- package/dist/components/input-list/type.js +0 -1
- package/dist/components/otp-input/OTPInput.d.ts +0 -19
- package/dist/components/otp-input/OTPInput.js +0 -161
- package/dist/components/rich-tooltip/RichTooltip.d.ts +0 -18
- package/dist/components/rich-tooltip/RichTooltip.js +0 -32
- package/dist/context/FormContext.d.ts +0 -16
- package/dist/context/FormContext.js +0 -8
- package/dist/icons/Add.d.ts +0 -7
- package/dist/icons/Add.js +0 -3
- package/dist/icons/ArrowDown.d.ts +0 -7
- package/dist/icons/ArrowDown.js +0 -3
- package/dist/icons/ArrowLeft1.d.ts +0 -7
- package/dist/icons/ArrowLeft1.js +0 -3
- package/dist/icons/ArrowRight1.d.ts +0 -7
- package/dist/icons/ArrowRight1.js +0 -3
- package/dist/icons/Calendar.d.ts +0 -7
- package/dist/icons/Calendar.js +0 -3
- package/dist/icons/CloseCircle.d.ts +0 -7
- package/dist/icons/CloseCircle.js +0 -3
- package/dist/icons/DocumentDownload.d.ts +0 -7
- package/dist/icons/DocumentDownload.js +0 -3
- package/dist/icons/Eye.d.ts +0 -7
- package/dist/icons/Eye.js +0 -3
- package/dist/icons/EyeSlash.d.ts +0 -7
- package/dist/icons/EyeSlash.js +0 -3
- package/dist/icons/FolderAdd.d.ts +0 -7
- package/dist/icons/FolderAdd.js +0 -3
- package/dist/icons/InfoCircle.d.ts +0 -7
- package/dist/icons/InfoCircle.js +0 -3
- package/dist/icons/Tick.d.ts +0 -7
- package/dist/icons/Tick.js +0 -3
- package/dist/icons/Trash.d.ts +0 -7
- package/dist/icons/Trash.js +0 -3
- package/dist/icons/Union.d.ts +0 -7
- package/dist/icons/Union.js +0 -3
- package/dist/icons/Warning2.d.ts +0 -7
- package/dist/icons/Warning2.js +0 -3
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -8
- package/dist/methods/debounce.d.ts +0 -3
- package/dist/methods/debounce.js +0 -20
- package/dist/methods/general.d.ts +0 -2
- package/dist/methods/general.js +0 -32
- package/dist/mui/Alert/Alert.d.ts +0 -2
- package/dist/mui/Alert/Alert.js +0 -13
- package/dist/mui/AutoComplete/MuiAutoComplete.d.ts +0 -2
- package/dist/mui/AutoComplete/MuiAutoComplete.js +0 -27
- package/dist/mui/BreadCrumbs/MuiBreadCrumbs.d.ts +0 -2
- package/dist/mui/BreadCrumbs/MuiBreadCrumbs.js +0 -31
- package/dist/mui/Button/MuiButton.d.ts +0 -7
- package/dist/mui/Button/MuiButton.js +0 -185
- package/dist/mui/Card/MuiCard.d.ts +0 -2
- package/dist/mui/Card/MuiCard.js +0 -7
- package/dist/mui/Checkbox/Checkbox.d.ts +0 -2
- package/dist/mui/Checkbox/Checkbox.js +0 -31
- package/dist/mui/Checkbox/assets/CheckedIcon.d.ts +0 -8
- package/dist/mui/Checkbox/assets/CheckedIcon.js +0 -12
- package/dist/mui/Checkbox/assets/IntermediateIcon.d.ts +0 -8
- package/dist/mui/Checkbox/assets/IntermediateIcon.js +0 -10
- package/dist/mui/Checkbox/assets/UnChekedIcon.d.ts +0 -7
- package/dist/mui/Checkbox/assets/UnChekedIcon.js +0 -9
- package/dist/mui/Chip/MuiChip.d.ts +0 -10
- package/dist/mui/Chip/MuiChip.js +0 -35
- package/dist/mui/Dialog/MuiDialog.d.ts +0 -7
- package/dist/mui/Dialog/MuiDialog.js +0 -22
- package/dist/mui/FormControl/MuiFormControlLabel.d.ts +0 -2
- package/dist/mui/FormControl/MuiFormControlLabel.js +0 -13
- package/dist/mui/IconButton/MuiIconButon.d.ts +0 -2
- package/dist/mui/IconButton/MuiIconButon.js +0 -7
- package/dist/mui/InputAdornment/MuiInputAdornment.d.ts +0 -2
- package/dist/mui/InputAdornment/MuiInputAdornment.js +0 -6
- package/dist/mui/InputLabel/MuiInputLabel.d.ts +0 -2
- package/dist/mui/InputLabel/MuiInputLabel.js +0 -43
- package/dist/mui/Pagination/MuiPagination.d.ts +0 -2
- package/dist/mui/Pagination/MuiPagination.js +0 -15
- package/dist/mui/Pagination/MuiPaginationItem.d.ts +0 -2
- package/dist/mui/Pagination/MuiPaginationItem.js +0 -15
- package/dist/mui/Radio/MuiRadio.d.ts +0 -2
- package/dist/mui/Radio/MuiRadio.js +0 -17
- package/dist/mui/Select/MuiSelect.d.ts +0 -2
- package/dist/mui/Select/MuiSelect.js +0 -47
- package/dist/mui/Switch/MuiSwitch.d.ts +0 -2
- package/dist/mui/Switch/MuiSwitch.js +0 -83
- package/dist/mui/Tabs/MuiTabs.d.ts +0 -2
- package/dist/mui/Tabs/MuiTabs.js +0 -21
- package/dist/mui/Tabs/Tab/MuiTab.d.ts +0 -2
- package/dist/mui/Tabs/Tab/MuiTab.js +0 -26
- package/dist/mui/TextField/MuiFilledInput.d.ts +0 -2
- package/dist/mui/TextField/MuiFilledInput.js +0 -91
- package/dist/mui/TextField/MuiOutlinedInput.d.ts +0 -2
- package/dist/mui/TextField/MuiOutlinedInput.js +0 -66
- package/dist/mui/TextField/TextField.d.ts +0 -2
- package/dist/mui/TextField/TextField.js +0 -78
- package/dist/mui/Tooltip/MuiTooltip.d.ts +0 -2
- package/dist/mui/Tooltip/MuiTooltip.js +0 -26
- package/dist/mui/Typography/MuiTypography.d.ts +0 -2
- package/dist/mui/Typography/MuiTypography.js +0 -9
- package/dist/mui/Typography/index.d.ts +0 -2
- package/dist/mui/Typography/index.js +0 -138
- package/dist/mui/accordion/MuiAccodrion.d.ts +0 -2
- package/dist/mui/accordion/MuiAccodrion.js +0 -13
- package/dist/mui/breakpoints/index.d.ts +0 -9
- package/dist/mui/breakpoints/index.js +0 -9
- package/dist/mui/menu/MuiMenu.d.ts +0 -2
- package/dist/mui/menu/MuiMenu.js +0 -8
- package/dist/mui/menu/MuiMenuItem.d.ts +0 -2
- package/dist/mui/menu/MuiMenuItem.js +0 -14
- package/dist/mui/mui-css-baseline/index.d.ts +0 -3
- package/dist/mui/mui-css-baseline/index.js +0 -37
- package/dist/mui/palette/dark/darkPalette.d.ts +0 -2
- package/dist/mui/palette/dark/darkPalette.js +0 -135
- package/dist/mui/palette/light/lightPalette.d.ts +0 -2
- package/dist/mui/palette/light/lightPalette.js +0 -135
- package/dist/nextjs/NextCacheProvider.d.ts +0 -7
- package/dist/nextjs/NextCacheProvider.js +0 -13
- package/dist/react/ReactCacheProvider.d.ts +0 -7
- package/dist/react/ReactCacheProvider.js +0 -15
- package/dist/theme/theme.d.ts +0 -3
- package/dist/theme/theme.js +0 -75
- package/dist/types/palette.d.ts +0 -60
- package/dist/types/palette.js +0 -1
- package/dist/types/types.d.ts +0 -102
- package/dist/types/types.js +0 -4
- package/dist/types/typography.d.ts +0 -71
- package/dist/types/typography.js +0 -1
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Box } from '@mui/material';
|
|
3
|
-
import BottomSheet from './CustomBottomSheet';
|
|
4
|
-
import ItemPicker from './ItemPicker';
|
|
5
|
-
import { DateObject } from 'react-multi-date-picker';
|
|
6
|
-
import { PERSIAN_CALENDARS } from './CustomMobileDatePicker';
|
|
7
|
-
const MAX_YEAR = 3000;
|
|
8
|
-
const DatePickerBottomSheet = ({ open, handleClose, label, dayOptions, handleChange, monthOptions, value, handleSubmit, defaultValue, }) => {
|
|
9
|
-
const lang = document.documentElement.lang;
|
|
10
|
-
const currentDate = new DateObject({
|
|
11
|
-
...(lang.includes('fa') && PERSIAN_CALENDARS),
|
|
12
|
-
date: new Date(Date.now()),
|
|
13
|
-
});
|
|
14
|
-
return (_jsxs(BottomSheet, { open: open, handleClose: handleClose, title: String(label), children: [_jsxs(Box, { display: 'flex', position: 'relative', children: [_jsx(ItemPicker, { getSelectedItem: (selectedDay) => handleChange((prev) => ({
|
|
15
|
-
month: prev?.month || null,
|
|
16
|
-
day: selectedDay,
|
|
17
|
-
year: prev?.year || null,
|
|
18
|
-
})), open: open, totalItems: dayOptions + 2, getRowItem: (idx) => idx === 0 || idx === dayOptions + 1 ? '' : String(idx), defaultValue: value?.day || defaultValue?.day || currentDate.day }, 'day-picker'), _jsx(ItemPicker, { getSelectedItem: (selectedMonth) => handleChange((prev) => ({
|
|
19
|
-
month: selectedMonth || null,
|
|
20
|
-
day: prev?.day || null,
|
|
21
|
-
year: prev?.year || null,
|
|
22
|
-
})), open: open, totalItems: monthOptions.length, getRowItem: (idx) => String(monthOptions[idx]?.name), defaultValue: value?.month ||
|
|
23
|
-
defaultValue?.month.number ||
|
|
24
|
-
currentDate.month.number }, 'month-picker'), _jsx(ItemPicker, { getSelectedItem: (selectedYear) => handleChange((prev) => ({
|
|
25
|
-
month: prev?.month || null,
|
|
26
|
-
day: prev?.day || null,
|
|
27
|
-
year: selectedYear ? selectedYear : null,
|
|
28
|
-
})), open: open, totalItems: MAX_YEAR, getRowItem: (idx) => String(idx), defaultValue: value?.year || defaultValue?.year || currentDate.year }, 'year-picker'), _jsx(Box, { sx: {
|
|
29
|
-
position: 'absolute',
|
|
30
|
-
top: 'calc(50% - 20px)',
|
|
31
|
-
left: 0,
|
|
32
|
-
width: '100%',
|
|
33
|
-
height: 40,
|
|
34
|
-
backgroundColor: 'primary.main',
|
|
35
|
-
borderRadius: '8px',
|
|
36
|
-
opacity: 0.1,
|
|
37
|
-
zIndex: -1,
|
|
38
|
-
} })] }), _jsx(Button, { fullWidth: true, onClick: handleSubmit, children: lang.includes('fa') ? 'تایید' : 'OK' })] }));
|
|
39
|
-
};
|
|
40
|
-
export default DatePickerBottomSheet;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
type TItemPickerProps = {
|
|
3
|
-
getSelectedItem: (item: number) => void;
|
|
4
|
-
totalItems: number;
|
|
5
|
-
getRowItem: (idx: number) => string;
|
|
6
|
-
defaultValue?: number | null;
|
|
7
|
-
open: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const ItemPicker: FC<TItemPickerProps>;
|
|
10
|
-
export default ItemPicker;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Stack, Typography } from '@mui/material';
|
|
3
|
-
import { createRef, useEffect, useRef, useState, } from 'react';
|
|
4
|
-
import { FixedSizeList as List } from 'react-window';
|
|
5
|
-
const ITEM_HEIGHT = 40;
|
|
6
|
-
const ItemPicker = ({ getSelectedItem, totalItems, getRowItem, defaultValue, open, }) => {
|
|
7
|
-
const listRef = createRef();
|
|
8
|
-
const [isScrolling, setIsScrolling] = useState(false);
|
|
9
|
-
const selectedItemRef = useRef(defaultValue || 0);
|
|
10
|
-
const handleScrollToItem = (isScrolling) => {
|
|
11
|
-
if (!isScrolling) {
|
|
12
|
-
if (selectedItemRef.current !== 2) {
|
|
13
|
-
listRef.current?.scrollToItem(selectedItemRef.current, selectedItemRef.current >= totalItems - 2 ? 'auto' : 'center');
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
//Because of react window bug for index "2"
|
|
17
|
-
listRef.current?.scrollTo(ITEM_HEIGHT);
|
|
18
|
-
}
|
|
19
|
-
setIsScrolling(false);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
setIsScrolling(true);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (!isScrolling && selectedItemRef.current > 0 && open) {
|
|
27
|
-
getSelectedItem(selectedItemRef.current);
|
|
28
|
-
}
|
|
29
|
-
}, [isScrolling, open]);
|
|
30
|
-
const Row = ({ index, isScrolling = false, style, }) => {
|
|
31
|
-
handleScrollToItem(isScrolling);
|
|
32
|
-
return (_jsx(Typography, { textAlign: 'inherit', sx: {
|
|
33
|
-
display: 'flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
width: '100%',
|
|
37
|
-
height: '100%',
|
|
38
|
-
userSelect: 'none',
|
|
39
|
-
transition: '0.3s ease all',
|
|
40
|
-
filter: selectedItemRef.current === index ? 'none' : 'blur(0.5px)',
|
|
41
|
-
fontSize: selectedItemRef.current === index ? 16 : 14,
|
|
42
|
-
...style,
|
|
43
|
-
}, variant: selectedItemRef.current === index ? 'caption2.bold' : 'caption2', children: getRowItem(index) }));
|
|
44
|
-
};
|
|
45
|
-
return (_jsxs(Stack, { sx: {
|
|
46
|
-
overflowY: 'hidden',
|
|
47
|
-
height: 120,
|
|
48
|
-
flexBasis: '33%',
|
|
49
|
-
}, children: [_jsx(Stack, { sx: {
|
|
50
|
-
width: '100%',
|
|
51
|
-
}, children: _jsx(List, { className: 'item-picker', height: ITEM_HEIGHT * 3, itemCount: totalItems, itemSize: ITEM_HEIGHT, width: '100%',
|
|
52
|
-
// -1 is because options array is zero based index
|
|
53
|
-
initialScrollOffset: (selectedItemRef.current - 1) * ITEM_HEIGHT, onScroll: (e) => {
|
|
54
|
-
// +1 is because item being in center of selector
|
|
55
|
-
selectedItemRef.current =
|
|
56
|
-
Math.round(e.scrollOffset / ITEM_HEIGHT) + 1;
|
|
57
|
-
}, style: {
|
|
58
|
-
textAlign: 'center',
|
|
59
|
-
transition: 'all ease 1s',
|
|
60
|
-
}, ref: listRef, useIsScrolling: true, children: Row }) }), _jsx("style", { children: css })] }));
|
|
61
|
-
};
|
|
62
|
-
export default ItemPicker;
|
|
63
|
-
const css = `
|
|
64
|
-
.item-picker::-webkit-scrollbar {
|
|
65
|
-
display: none;
|
|
66
|
-
}
|
|
67
|
-
.item-picker {
|
|
68
|
-
-ms-overflow-style: none;
|
|
69
|
-
scrollbar-width: none;
|
|
70
|
-
scroll-behavior: smooth;
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { BoxProps, ModalProps } from "@mui/material";
|
|
3
|
-
export interface CustomModalProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
onClose?: () => void;
|
|
6
|
-
title?: string;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
modalProps: Omit<ModalProps, "open">;
|
|
9
|
-
boxProps?: BoxProps;
|
|
10
|
-
leftTitle?: React.ReactNode;
|
|
11
|
-
withoutDivider?: boolean;
|
|
12
|
-
withoutHeader?: boolean;
|
|
13
|
-
scrollableProps?: BoxProps;
|
|
14
|
-
preventClose?: boolean;
|
|
15
|
-
onClickTopLeftBtn?: () => void;
|
|
16
|
-
topLeftBtnTitle?: string;
|
|
17
|
-
maxHeight?: string | number;
|
|
18
|
-
height?: string | number;
|
|
19
|
-
}
|
|
20
|
-
declare const CustomModal: FC<CustomModalProps>;
|
|
21
|
-
export default CustomModal;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
//@Mui
|
|
3
|
-
import Box from "@mui/material/Box";
|
|
4
|
-
import Stack from "@mui/material/Stack";
|
|
5
|
-
import Modal from "@mui/material/Modal";
|
|
6
|
-
import Divider from "@mui/material/Divider";
|
|
7
|
-
import Typography from "@mui/material/Typography";
|
|
8
|
-
import IconButton from "@mui/material/IconButton";
|
|
9
|
-
const CustomModal = ({ modalProps, open, children, boxProps, onClose, title, leftTitle, withoutDivider, withoutHeader, scrollableProps, preventClose, onClickTopLeftBtn, topLeftBtnTitle, maxHeight, height, }) => {
|
|
10
|
-
return (_jsx(Modal, { "aria-labelledby": "modal-modal-title", "aria-describedby": "modal-modal-description", open: open, sx: {
|
|
11
|
-
direction: "ltr",
|
|
12
|
-
backdropFilter: "blur(5px)",
|
|
13
|
-
"& .MuiBackdrop-root ": {
|
|
14
|
-
backgroundColor: "rgba(27, 38, 44, 0.1)",
|
|
15
|
-
},
|
|
16
|
-
}, onClose: () => {
|
|
17
|
-
if (onClose && !preventClose) {
|
|
18
|
-
onClose();
|
|
19
|
-
}
|
|
20
|
-
}, ...modalProps, children: _jsxs(Stack, { sx: {
|
|
21
|
-
width: { xs: "90%", md: "auto" },
|
|
22
|
-
minWidth: 300,
|
|
23
|
-
position: "absolute",
|
|
24
|
-
top: "50%",
|
|
25
|
-
left: "50%",
|
|
26
|
-
transform: "translate(-50%, -50%)",
|
|
27
|
-
backgroundColor: "background.4",
|
|
28
|
-
borderRadius: "10px",
|
|
29
|
-
py: 5,
|
|
30
|
-
px: { xs: 2, lg: 7 },
|
|
31
|
-
outline: "none",
|
|
32
|
-
...boxProps,
|
|
33
|
-
}, children: [!withoutHeader && (_jsxs(_Fragment, { children: [_jsxs(Box, { display: "flex", gap: 3, alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsxs(Box, { display: "flex", gap: 3, alignItems: "center", children: [_jsx(IconButton, { onClick: () => (onClose ? onClose() : ""), "data-cy": "close-modal", children: "x" }), _jsx(Typography, { fontWeight: 500, fontSize: 12, children: title })] }), _jsx(Box, { children: leftTitle }), topLeftBtnTitle && (_jsx(Box, { sx: { color: "primary.main", cursor: "pointer" }, onClick: onClickTopLeftBtn, children: topLeftBtnTitle }))] }), !withoutDivider && (_jsx(Divider, { sx: {
|
|
34
|
-
mb: 4,
|
|
35
|
-
borderColor: "background.1",
|
|
36
|
-
} }))] })), _jsx(Stack, { height: height || "100%", maxHeight: maxHeight || "73vh", children: children })] }) }));
|
|
37
|
-
};
|
|
38
|
-
export default CustomModal;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { BoxProps } from "@mui/material/Box";
|
|
3
|
-
import { ITablePagination } from "../../custom-table/CustomTable";
|
|
4
|
-
export interface CustomPagination1Props {
|
|
5
|
-
pagination: ITablePagination;
|
|
6
|
-
boxProps?: BoxProps;
|
|
7
|
-
}
|
|
8
|
-
declare const CustomPagination1: FC<CustomPagination1Props>;
|
|
9
|
-
export default CustomPagination1;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import Box from "@mui/material/Box";
|
|
3
|
-
import Pagination from "@mui/material/Pagination";
|
|
4
|
-
import PaginationItem from "@mui/material/PaginationItem";
|
|
5
|
-
const CustomPagination1 = ({ boxProps, pagination }) => {
|
|
6
|
-
const handleChangePage = (event, value) => {
|
|
7
|
-
if (pagination && pagination.onChangePage) {
|
|
8
|
-
pagination.onChangePage(value);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
return (_jsx(Box, { style: { direction: "ltr" }, display: "flex", justifyContent: "center", alignItems: "center", gap: 1, mt: 3, ...boxProps, children: _jsx(Pagination, { sx: { mb: 0.5, px: 2 }, size: "small", renderItem: (item) => _jsx(PaginationItem, { ...item }), count: pagination?.pageCounts, page: pagination?.pageIndex, onChange: handleChangePage, shape: "rounded" }) }));
|
|
12
|
-
};
|
|
13
|
-
export default CustomPagination1;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { BoxProps, SelectProps } from "@mui/material";
|
|
3
|
-
import { ITablePagination } from "../../custom-table/CustomTable";
|
|
4
|
-
export interface ITableFooterProps {
|
|
5
|
-
pagination: ITablePagination;
|
|
6
|
-
boxProps?: BoxProps;
|
|
7
|
-
selectProps?: SelectProps;
|
|
8
|
-
paginationBoxProps?: BoxProps;
|
|
9
|
-
iconBoxProps?: BoxProps;
|
|
10
|
-
withoutEndPageButton?: boolean;
|
|
11
|
-
dictionary?: {
|
|
12
|
-
pageSizeTitle?: string;
|
|
13
|
-
pageIndexTitle?: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export interface IIconBoxProps extends BoxProps {
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
}
|
|
19
|
-
declare const CustomPagination2: FC<ITableFooterProps>;
|
|
20
|
-
export default CustomPagination2;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Box from "@mui/material/Box";
|
|
3
|
-
import Typography from "@mui/material/Typography";
|
|
4
|
-
import { MenuItem, Select } from "@mui/material";
|
|
5
|
-
import SvgArrowLeft1 from "../../../icons/ArrowLeft1";
|
|
6
|
-
import SvgUnion from "../../../icons/Union";
|
|
7
|
-
import SvgArrowRight1 from "../../../icons/ArrowRight1";
|
|
8
|
-
const pageSizes = [5, 10, 20, 30, 50];
|
|
9
|
-
const CustomPagination2 = ({ pagination, boxProps, selectProps, paginationBoxProps, iconBoxProps, withoutEndPageButton, dictionary }) => {
|
|
10
|
-
const IconBox = ({ children, sx, disabled, ...rest }) => (_jsx(Box, { display: "flex", alignItems: "center", justifyContent: "center", bgcolor: "primary.1", width: 32, height: 32, borderRadius: 1, sx: {
|
|
11
|
-
transition: "0.2s ease transform",
|
|
12
|
-
":active": { transform: "scale(90%)" },
|
|
13
|
-
...sx,
|
|
14
|
-
opacity: disabled ? 0.5 : 1,
|
|
15
|
-
cursor: disabled ? "default" : "pointer",
|
|
16
|
-
pointerEvents: disabled ? "none" : "auto",
|
|
17
|
-
}, ...iconBoxProps, ...rest, children: children }));
|
|
18
|
-
return (_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", p: 4, bgcolor: "#EAEDFF", borderRadius: "0 0 8px 8px", ...boxProps, children: [_jsxs(Box, { display: "flex", gap: 2, dir: "rtl", children: [!withoutEndPageButton && (_jsx(IconBox, { onClick: () => pagination?.onChangePage
|
|
19
|
-
? pagination?.onChangePage(pagination?.pageCounts)
|
|
20
|
-
: {}, disabled: pagination && pagination?.pageIndex === pagination.pageCounts, children: _jsx(SvgUnion, { width: 18, height: 18, style: { transform: "scaleX(-1)" } }) })), _jsxs(Box, { display: "flex", gap: 2, justifyContent: "center", alignItems: "center", bgcolor: "background.1", borderRadius: 1, ...paginationBoxProps, children: [_jsx(IconBox, { onClick: () => pagination?.onChangePage(pagination?.pageIndex + 1), disabled: pagination && pagination?.pageIndex === pagination.pageCounts, children: _jsx(SvgArrowRight1, { width: 18, height: 18 }) }), _jsx(Typography, { dir: "ltr", variant: "caption2.medium", color: "text.13", width: 'auto', minWidth: 75, textAlign: "center", children: dictionary?.pageIndexTitle || `صفحه ${pagination?.pageIndex} از ${pagination?.pageCounts}` }), _jsx(IconBox, { onClick: () => pagination && pagination?.pageIndex > 1
|
|
21
|
-
? pagination?.onChangePage(pagination?.pageIndex - 1)
|
|
22
|
-
: {}, disabled: pagination && pagination?.pageIndex <= 1, children: _jsx(SvgArrowLeft1, { width: 18, height: 18 }) })] }), !withoutEndPageButton && (_jsx(IconBox, { onClick: () => pagination?.onChangePage(1), disabled: pagination && pagination?.pageIndex <= 1, children: _jsx(SvgUnion, { width: 18, height: 18 }) }))] }), _jsxs(Box, { display: "flex", gap: 2, alignItems: "center", justifyContent: "flex-end", flexGrow: 1, maxWidth: 240, children: [_jsx(Box, { width: "max-content", children: _jsx(Typography, { display: "block", width: "max-content", variant: "caption3", children: dictionary?.pageSizeTitle || "تعداد در هر صفحه" }) }), _jsx(Box, { children: _jsx(Select, { labelId: "demo-simple-select-label", id: "demo-simple-select", value: pagination?.pageSize || pageSizes[0], onChange: (e, v) => pagination?.onChangePageSize?.(e.target.value), sx: {
|
|
23
|
-
minHeight: 32,
|
|
24
|
-
height: 32,
|
|
25
|
-
"& > div": {
|
|
26
|
-
py: 2,
|
|
27
|
-
pr: '4px !important',
|
|
28
|
-
},
|
|
29
|
-
fontSize: "14px !important",
|
|
30
|
-
color: "text.primary",
|
|
31
|
-
}, variant: "filled", ...selectProps, children: pageSizes.map((pageSize) => (_jsx(MenuItem, { value: pageSize, sx: { fontSize: "14px !important" }, children: pageSize }, pageSize))) }) })] })] }));
|
|
32
|
-
};
|
|
33
|
-
export default CustomPagination2;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import Box from "@mui/material/Box";
|
|
4
|
-
import LinearProgress from "@mui/material/LinearProgress";
|
|
5
|
-
const LinearBufferProgress = ({ progress }) => {
|
|
6
|
-
const [buffer, setBuffer] = React.useState(10);
|
|
7
|
-
React.useEffect(() => {
|
|
8
|
-
const diff = Math.random() * 10;
|
|
9
|
-
const diff2 = Math.random() * 10;
|
|
10
|
-
setBuffer(progress + diff + diff2);
|
|
11
|
-
}, [progress]);
|
|
12
|
-
return (_jsx(Box, { sx: { width: "100%" }, children: _jsx(LinearProgress, { variant: "buffer", value: progress, valueBuffer: buffer }) }));
|
|
13
|
-
};
|
|
14
|
-
export default LinearBufferProgress;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ButtonProps, StepConnectorProps, StepIconProps, StepLabelProps, StepperProps, TypographyProps } from "@mui/material";
|
|
2
|
-
import { MouseEvent } from "react";
|
|
3
|
-
type step = {
|
|
4
|
-
label?: string;
|
|
5
|
-
error?: {
|
|
6
|
-
hasError?: boolean;
|
|
7
|
-
errorMessage?: string;
|
|
8
|
-
};
|
|
9
|
-
canSkipping?: boolean;
|
|
10
|
-
completed?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export interface ICustomStepper {
|
|
13
|
-
steps: step[];
|
|
14
|
-
activeStep: number;
|
|
15
|
-
orientation?: "vertical" | "horizontal";
|
|
16
|
-
alternativeLabel?: boolean;
|
|
17
|
-
stepperProps?: StepperProps;
|
|
18
|
-
stepConnectorProps?: StepConnectorProps;
|
|
19
|
-
stepLabelProps?: StepLabelProps;
|
|
20
|
-
errorTypographyProps?: TypographyProps;
|
|
21
|
-
stepButtonProps?: ButtonProps;
|
|
22
|
-
nonLinear?: boolean;
|
|
23
|
-
clickableItem?: boolean;
|
|
24
|
-
onClickItem?: (index: number, e?: MouseEvent<HTMLButtonElement>) => void;
|
|
25
|
-
completedIconComponent?: (props: StepIconProps) => JSX.Element;
|
|
26
|
-
activeIconComponent?: (props: StepIconProps) => JSX.Element;
|
|
27
|
-
errorIconComponent?: (props: StepIconProps) => JSX.Element;
|
|
28
|
-
defaultIconComponent?: (props: StepIconProps) => JSX.Element;
|
|
29
|
-
}
|
|
30
|
-
declare const CustomStepper: ({ steps, activeStep, orientation, alternativeLabel, nonLinear, clickableItem, errorTypographyProps, completedIconComponent, activeIconComponent, errorIconComponent, defaultIconComponent, stepperProps, stepConnectorProps, stepLabelProps, stepButtonProps, onClickItem, }: ICustomStepper) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export default CustomStepper;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Button, Step, StepConnector, StepLabel, Stepper, Typography, } from "@mui/material";
|
|
3
|
-
import SvgTick from "../../icons/Tick";
|
|
4
|
-
import SvgWarning2 from "../../icons/Warning2";
|
|
5
|
-
const CustomStepper = ({ steps, activeStep, orientation = "horizontal", alternativeLabel = false, nonLinear, clickableItem, errorTypographyProps, completedIconComponent, activeIconComponent, errorIconComponent, defaultIconComponent, stepperProps, stepConnectorProps, stepLabelProps, stepButtonProps, onClickItem, }) => {
|
|
6
|
-
const defaultStylesStepperConnectorHorizontal = {
|
|
7
|
-
backgroundColor: "text.5",
|
|
8
|
-
left: "calc(-50% + 10px)",
|
|
9
|
-
right: "calc(50% + 10px)",
|
|
10
|
-
"& .MuiStepConnector-line": {
|
|
11
|
-
borderColor: "text.9",
|
|
12
|
-
borderWidth: 2,
|
|
13
|
-
borderTopStyle: "dashed",
|
|
14
|
-
},
|
|
15
|
-
"&.Mui-completed": {
|
|
16
|
-
"& .MuiStepConnector-line": {
|
|
17
|
-
borderColor: "primary.5",
|
|
18
|
-
borderTopStyle: "solid",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
"&.Mui-active": {
|
|
22
|
-
"& .MuiStepConnector-line": {
|
|
23
|
-
borderColor: "primary.5",
|
|
24
|
-
borderTopStyle: "solid",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
const defaultStylesStepperConnectorVertical = {
|
|
29
|
-
backgroundColor: "text.5",
|
|
30
|
-
width: 2,
|
|
31
|
-
"& .MuiStepConnector-line": {
|
|
32
|
-
borderColor: "text.9",
|
|
33
|
-
borderWidth: 2,
|
|
34
|
-
borderLeftStyle: "dashed",
|
|
35
|
-
},
|
|
36
|
-
"&.Mui-completed": {
|
|
37
|
-
"& .MuiStepConnector-line": {
|
|
38
|
-
borderColor: "primary.5",
|
|
39
|
-
borderLeftStyle: "solid",
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
"&.Mui-active": {
|
|
43
|
-
"& .MuiStepConnector-line": {
|
|
44
|
-
borderColor: "primary.5",
|
|
45
|
-
borderLeftStyle: "solid",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
const defaultLabelStylesAlternative = {
|
|
50
|
-
"& .MuiStepLabel-label": {
|
|
51
|
-
fontSize: "12px",
|
|
52
|
-
fontWeight: "400 !important",
|
|
53
|
-
lineHeight: "21px",
|
|
54
|
-
marginTop: "8px !important",
|
|
55
|
-
color: "text.12",
|
|
56
|
-
},
|
|
57
|
-
"& .Mui-active": {
|
|
58
|
-
color: "gray.16",
|
|
59
|
-
},
|
|
60
|
-
"& .Mui-completed": {
|
|
61
|
-
color: "gray.16",
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
const defaultLabelStyles = {
|
|
65
|
-
"& .MuiStepLabel-label": {
|
|
66
|
-
fontSize: "12px",
|
|
67
|
-
fontWeight: "400 !important",
|
|
68
|
-
lineHeight: "21px",
|
|
69
|
-
color: "text.12",
|
|
70
|
-
},
|
|
71
|
-
"& .Mui-active": {
|
|
72
|
-
color: "gray.16",
|
|
73
|
-
},
|
|
74
|
-
"& .Mui-completed": {
|
|
75
|
-
color: "gray.16",
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
function StepIcons(props) {
|
|
79
|
-
const { completed, active, error, icon } = props;
|
|
80
|
-
return (_jsx(_Fragment, { children: completed ? (completedIconComponent ? (completedIconComponent(props)) : (_jsx(Box, { sx: {
|
|
81
|
-
width: 24,
|
|
82
|
-
height: 24,
|
|
83
|
-
display: "flex",
|
|
84
|
-
justifyContent: "center",
|
|
85
|
-
alignItems: "center",
|
|
86
|
-
backgroundColor: "primary.5",
|
|
87
|
-
borderRadius: "100%",
|
|
88
|
-
zIndex: 2,
|
|
89
|
-
}, children: _jsx(SvgTick, { primarycolor: "#fff", width: 24, height: 24 }) }))) : error ? (errorIconComponent ? (errorIconComponent(props)) : (_jsx(SvgWarning2, { primarycolor: "red", width: 24, height: 24 }))) : active ? (activeIconComponent ? (activeIconComponent(props)) : (_jsxs(Box, { sx: {
|
|
90
|
-
width: 24,
|
|
91
|
-
height: 24,
|
|
92
|
-
display: "flex",
|
|
93
|
-
justifyContent: "center",
|
|
94
|
-
alignItems: "center",
|
|
95
|
-
position: "relative",
|
|
96
|
-
backgroundColor: "text.5",
|
|
97
|
-
borderRadius: "100%",
|
|
98
|
-
zIndex: 2,
|
|
99
|
-
}, children: [_jsx(Typography, { variant: "caption2", color: "text.11", children: icon }), _jsx(Box, { sx: {
|
|
100
|
-
width: 34,
|
|
101
|
-
height: 34,
|
|
102
|
-
position: "absolute",
|
|
103
|
-
top: "50%",
|
|
104
|
-
left: "50%",
|
|
105
|
-
transform: "translate(-50%,-50%)",
|
|
106
|
-
borderRadius: "100%",
|
|
107
|
-
opacity: 0.3,
|
|
108
|
-
backgroundColor: "primary.3",
|
|
109
|
-
}, children: _jsx(Box, { sx: {
|
|
110
|
-
width: 12,
|
|
111
|
-
height: 12,
|
|
112
|
-
position: "absolute",
|
|
113
|
-
top: "50%",
|
|
114
|
-
left: "50%",
|
|
115
|
-
transform: "translate(-50%,-50%)",
|
|
116
|
-
backgroundColor: "primary.1",
|
|
117
|
-
borderRadius: "100%",
|
|
118
|
-
} }) })] }))) : defaultIconComponent ? (defaultIconComponent(props)) : (_jsx(Box, { sx: {
|
|
119
|
-
width: 24,
|
|
120
|
-
height: 24,
|
|
121
|
-
display: "flex",
|
|
122
|
-
justifyContent: "center",
|
|
123
|
-
alignItems: "center",
|
|
124
|
-
backgroundColor: "text.5",
|
|
125
|
-
borderRadius: "100%",
|
|
126
|
-
zIndex: 2,
|
|
127
|
-
}, children: _jsx(Typography, { variant: "caption2", color: "text.11", children: icon }) })) }));
|
|
128
|
-
}
|
|
129
|
-
return (_jsx(Stepper, { alternativeLabel: alternativeLabel, activeStep: activeStep, orientation: orientation, nonLinear: nonLinear, connector: _jsx(StepConnector, { ...stepConnectorProps, sx: [
|
|
130
|
-
orientation === "horizontal"
|
|
131
|
-
? defaultStylesStepperConnectorHorizontal
|
|
132
|
-
: defaultStylesStepperConnectorVertical,
|
|
133
|
-
...(Array.isArray(stepConnectorProps?.sx)
|
|
134
|
-
? stepConnectorProps.sx
|
|
135
|
-
: [stepConnectorProps?.sx]),
|
|
136
|
-
] }), ...stepperProps, children: steps.map((item, index) => {
|
|
137
|
-
return (_jsx(Step, { ...(nonLinear && {
|
|
138
|
-
completed: item.completed,
|
|
139
|
-
}), sx: {
|
|
140
|
-
display: "flex",
|
|
141
|
-
justifyContent: orientation === "horizontal" ? "center" : "flex-start",
|
|
142
|
-
}, children: nonLinear && clickableItem ? (_jsx(Button, { ...stepButtonProps, sx: [
|
|
143
|
-
{
|
|
144
|
-
width: "fit-content",
|
|
145
|
-
backgroundColor: "transparent",
|
|
146
|
-
"&:hover": {
|
|
147
|
-
backgroundColor: "transparent",
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
...(Array.isArray(stepButtonProps?.sx)
|
|
151
|
-
? stepButtonProps.sx
|
|
152
|
-
: [stepButtonProps?.sx]),
|
|
153
|
-
], onClick: (e) => onClickItem?.(index, e), children: _jsx(StepLabel, { StepIconComponent: StepIcons, error: item.error?.hasError, optional: item.error && (_jsx(Typography, { variant: "caption3", color: "error", ...errorTypographyProps, children: item.error?.errorMessage })), ...stepLabelProps, sx: [
|
|
154
|
-
alternativeLabel
|
|
155
|
-
? defaultLabelStylesAlternative
|
|
156
|
-
: defaultLabelStyles,
|
|
157
|
-
...(Array.isArray(stepLabelProps?.sx)
|
|
158
|
-
? stepLabelProps.sx
|
|
159
|
-
: [stepLabelProps?.sx]),
|
|
160
|
-
], children: item?.label }) })) : (_jsx(StepLabel, { StepIconComponent: StepIcons, error: item.error?.hasError, optional: item.error && (_jsx(Typography, { variant: "caption3", color: "error", ...errorTypographyProps, children: item.error.errorMessage })), ...stepLabelProps, sx: [
|
|
161
|
-
alternativeLabel
|
|
162
|
-
? defaultLabelStylesAlternative
|
|
163
|
-
: defaultLabelStyles,
|
|
164
|
-
...(Array.isArray(stepLabelProps?.sx)
|
|
165
|
-
? stepLabelProps.sx
|
|
166
|
-
: [stepLabelProps?.sx]),
|
|
167
|
-
], children: item?.label })) }, item.label));
|
|
168
|
-
}) }));
|
|
169
|
-
};
|
|
170
|
-
export default CustomStepper;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { StackProps } from '@mui/material/Stack';
|
|
3
|
-
import { TypographyProps } from '@mui/material/Typography';
|
|
4
|
-
import { Cell, Row, Table as TableType } from '@tanstack/react-table';
|
|
5
|
-
import { ITableFooterProps } from '../custom-pagination/custom-pagination-2/CustomPagination2';
|
|
6
|
-
import { SystemStyleObject } from '@mui/system';
|
|
7
|
-
import { RadioProps } from '@mui/material/Radio';
|
|
8
|
-
import { ICheckboxProps } from './components/CustomTableRow';
|
|
9
|
-
export interface ITablePagination {
|
|
10
|
-
pageIndex: number;
|
|
11
|
-
pageSize: number;
|
|
12
|
-
pageCounts: number;
|
|
13
|
-
onChangePage: (pageIndex: number) => void;
|
|
14
|
-
onChangePageSize?: (pageSize: number) => void;
|
|
15
|
-
}
|
|
16
|
-
export interface ITableRowStyle {
|
|
17
|
-
row: Row<any>;
|
|
18
|
-
hover?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface ITableCellsStyle {
|
|
21
|
-
row: Row<any>;
|
|
22
|
-
cell?: Cell<any, any>;
|
|
23
|
-
hover?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export type TRowStyle = (props: ITableRowStyle) => SystemStyleObject;
|
|
26
|
-
export type TCellsStyle = (props: ITableCellsStyle) => SystemStyleObject;
|
|
27
|
-
export type TCheckboxProps = ((props: {
|
|
28
|
-
row?: Row<any>;
|
|
29
|
-
table: TableType<any>;
|
|
30
|
-
}) => ICheckboxProps) | ICheckboxProps;
|
|
31
|
-
export interface ICustomTable {
|
|
32
|
-
id?: string;
|
|
33
|
-
pagination?: ITablePagination;
|
|
34
|
-
table: TableType<any>;
|
|
35
|
-
variant?: 'fill' | 'standard';
|
|
36
|
-
wrapperStackProps?: StackProps;
|
|
37
|
-
footerProps?: Omit<ITableFooterProps, 'pagination'>;
|
|
38
|
-
onClickRow?: (row: Row<any>) => void;
|
|
39
|
-
renderSubComponent?: any;
|
|
40
|
-
isLoading?: boolean;
|
|
41
|
-
isError?: boolean;
|
|
42
|
-
withRadio?: boolean;
|
|
43
|
-
withSelect?: boolean;
|
|
44
|
-
withIndex?: boolean;
|
|
45
|
-
rowStyle?: TRowStyle;
|
|
46
|
-
cellsStyle?: TCellsStyle;
|
|
47
|
-
headerStyle?: SystemStyleObject;
|
|
48
|
-
headerTypoProps?: TypographyProps;
|
|
49
|
-
checkboxProps?: TCheckboxProps;
|
|
50
|
-
radioProps?: RadioProps;
|
|
51
|
-
emptyListComponent?: string | ReactNode;
|
|
52
|
-
rowBorderRadius?: number;
|
|
53
|
-
}
|
|
54
|
-
declare const CustomTable: FC<ICustomTable>;
|
|
55
|
-
export default CustomTable;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
//------------------------------------------------------------------------------------
|
|
3
|
-
//@Mui
|
|
4
|
-
import Box from '@mui/material/Box';
|
|
5
|
-
import Skeleton from '@mui/material/Skeleton';
|
|
6
|
-
import TableBody from '@mui/material/TableBody';
|
|
7
|
-
import TableRow from '@mui/material/TableRow';
|
|
8
|
-
import TableCell from '@mui/material/TableCell';
|
|
9
|
-
import Stack from '@mui/material/Stack';
|
|
10
|
-
import Typography from '@mui/material/Typography';
|
|
11
|
-
import TableContainer from '@mui/material/TableContainer';
|
|
12
|
-
import Table from '@mui/material/Table';
|
|
13
|
-
import CustomTableHead from '../custom-table/components/CustomTableHead';
|
|
14
|
-
import CustomPagination2 from '../custom-pagination/custom-pagination-2/CustomPagination2';
|
|
15
|
-
import CustomTableBody from '../custom-table/components/CustomTableBody';
|
|
16
|
-
const CustomTable = ({ id, isLoading, variant, table, wrapperStackProps, footerProps, renderSubComponent, pagination, onClickRow, isError, withRadio, withSelect, withIndex, rowStyle, cellsStyle, headerStyle, headerTypoProps, checkboxProps, emptyListComponent, radioProps, rowBorderRadius, }) => {
|
|
17
|
-
const pageCounts = pagination?.pageCounts;
|
|
18
|
-
if (pagination && pageCounts && pagination?.pageIndex > pageCounts) {
|
|
19
|
-
pagination?.onChangePage(pageCounts);
|
|
20
|
-
}
|
|
21
|
-
return (_jsxs(Stack, { id: id, "data-cy": id, ...wrapperStackProps, sx: {
|
|
22
|
-
flexGrow: 1,
|
|
23
|
-
width: '100%',
|
|
24
|
-
borderRadius: 2,
|
|
25
|
-
...wrapperStackProps?.sx,
|
|
26
|
-
}, children: [_jsx(TableContainer, { sx: {
|
|
27
|
-
flexGrow: '1',
|
|
28
|
-
overflowX: 'unset',
|
|
29
|
-
overflowY: 'auto',
|
|
30
|
-
}, children: _jsxs(Table, { sx: { position: 'relative' }, children: [_jsx(CustomTableHead, { table: table, variant: variant, withRadio: withRadio, withSelect: withSelect, withIndex: withIndex, headerStyle: headerStyle, checkboxProps: checkboxProps, headerTypoProps: headerTypoProps }), isLoading ? (_jsx(TableBody, { sx: { height: '150px', width: '100%' }, children: _jsx(_Fragment, { children: Array.from({ length: 10 }).map((item, index) => (_jsx(TableRow, { children: table?.getHeaderGroups()[0]?.headers?.map((col, index) => (_jsx(TableCell, { children: _jsx(Box, { children: index === 0 ? (_jsx(Skeleton, { sx: { borderRadius: 1 }, animation: 'wave', width: '17px', height: '16px', variant: 'rectangular' })) : (_jsx(Skeleton, { sx: { borderRadius: 1 }, animation: 'wave', width: '100%', variant: 'rectangular' })) }) }, index))) }, index))) }) })) : isError ? (_jsx(TableBody, { sx: { height: '150px', width: '100%' }, children: _jsx(TableRow, { sx: {
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
width: '100%',
|
|
33
|
-
top: '47px',
|
|
34
|
-
mt: '16px',
|
|
35
|
-
textAlign: 'center',
|
|
36
|
-
display: 'flex',
|
|
37
|
-
flexDirection: 'column',
|
|
38
|
-
alignItems: 'center',
|
|
39
|
-
}, children: _jsx(TableCell, { children: _jsx(Typography, { variant: 'h4', fontWeight: 400, children: "\u062E\u0637\u0627\u06CC \u062F\u0631\u06CC\u0627\u0641\u062A \u0627\u0637\u0644\u0627\u0639\u0627\u062A" }) }) }) })) : table?.getRowModel()?.rows.length == 0 ? (_jsx(TableBody, { sx: { height: '150px', width: '100%' }, children: _jsx(TableRow, { sx: {
|
|
40
|
-
position: 'absolute',
|
|
41
|
-
width: '100%',
|
|
42
|
-
top: '47px',
|
|
43
|
-
mt: '16px',
|
|
44
|
-
textAlign: 'center',
|
|
45
|
-
display: 'flex',
|
|
46
|
-
flexDirection: 'column',
|
|
47
|
-
alignItems: 'center',
|
|
48
|
-
}, children: _jsx(TableCell, { children: emptyListComponent ?? (_jsx(Typography, { variant: 'h4', fontWeight: 400, children: "\u0628\u062F\u0648\u0646 \u062F\u06CC\u062A\u0627" })) }) }) })) : (_jsx(CustomTableBody, { table: table, withIndex: withIndex, withSelect: withSelect, withRadio: withRadio, onClickRow: onClickRow, renderSubComponent: renderSubComponent, pagination: pagination, rowStyle: rowStyle, cellsStyle: cellsStyle, checkboxProps: checkboxProps, radioProps: radioProps, rowBorderRadius: rowBorderRadius }))] }) }), pagination && (_jsx(CustomPagination2, { pagination: pagination, ...footerProps }))] }));
|
|
49
|
-
};
|
|
50
|
-
export default CustomTable;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { Row } from '@tanstack/react-table';
|
|
3
|
-
import { Table as TableType } from '@tanstack/table-core/build/lib/types';
|
|
4
|
-
import { ITablePagination, TCellsStyle, TCheckboxProps, TRowStyle } from '../CustomTable';
|
|
5
|
-
import { RadioProps } from '@mui/material/Radio';
|
|
6
|
-
interface CustomTableBodyProps {
|
|
7
|
-
table: TableType<any>;
|
|
8
|
-
onClickRow?: (row: Row<any>) => void;
|
|
9
|
-
renderSubComponent?: () => any;
|
|
10
|
-
withSelect?: boolean;
|
|
11
|
-
withIndex?: boolean;
|
|
12
|
-
withRadio?: boolean;
|
|
13
|
-
pagination?: ITablePagination;
|
|
14
|
-
rowStyle?: TRowStyle;
|
|
15
|
-
cellsStyle?: TCellsStyle;
|
|
16
|
-
checkboxProps?: TCheckboxProps;
|
|
17
|
-
radioProps?: RadioProps;
|
|
18
|
-
rowBorderRadius?: number;
|
|
19
|
-
}
|
|
20
|
-
declare const CustomTableBody: FC<CustomTableBodyProps>;
|
|
21
|
-
export default CustomTableBody;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
//-----------------------------------------------------------------------------------------
|
|
3
|
-
//@Mui
|
|
4
|
-
import { TableBody } from '@mui/material';
|
|
5
|
-
import CustomTableRow from '../../custom-table/components/CustomTableRow';
|
|
6
|
-
const CustomTableBody = ({ table, onClickRow, renderSubComponent, withSelect, withRadio, withIndex, pagination, rowStyle, cellsStyle, checkboxProps, radioProps, rowBorderRadius, }) => {
|
|
7
|
-
return (_jsx(TableBody, { children: table?.getRowModel()?.rows?.map((row, i) => {
|
|
8
|
-
return (_jsx(CustomTableRow, { row: row, onClickRow: onClickRow, renderSubComponent: renderSubComponent, withSelect: withSelect, withRadio: withRadio, withIndex: withIndex, pagination: pagination, rowStyle: rowStyle, cellsStyle: cellsStyle, checkboxProps: checkboxProps, radioProps: radioProps, rowBorderRadius: rowBorderRadius, table: table }, row.id));
|
|
9
|
-
}) }));
|
|
10
|
-
};
|
|
11
|
-
export default CustomTableBody;
|