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.
Files changed (243) hide show
  1. package/package.json +1 -1
  2. package/dist/colors/index.d.ts +0 -4
  3. package/dist/colors/index.js +0 -93
  4. package/dist/colors/type.d.ts +0 -5
  5. package/dist/colors/type.js +0 -1
  6. package/dist/components/checkbox-list/CheckboxList.d.ts +0 -21
  7. package/dist/components/checkbox-list/CheckboxList.js +0 -31
  8. package/dist/components/custom-auto-complete/CustomAutoComplete.d.ts +0 -27
  9. package/dist/components/custom-auto-complete/CustomAutoComplete.js +0 -75
  10. package/dist/components/custom-auto-complete/components/AutoCompleteInput.d.ts +0 -21
  11. package/dist/components/custom-auto-complete/components/AutoCompleteInput.js +0 -29
  12. package/dist/components/custom-auto-complete/components/ListBox.d.ts +0 -5
  13. package/dist/components/custom-auto-complete/components/ListBox.js +0 -62
  14. package/dist/components/custom-auto-complete/components/ListRow.d.ts +0 -2
  15. package/dist/components/custom-auto-complete/components/ListRow.js +0 -21
  16. package/dist/components/custom-auto-complete-advanced/CustomAutoComplete.d.ts +0 -28
  17. package/dist/components/custom-auto-complete-advanced/CustomAutoComplete.js +0 -92
  18. package/dist/components/custom-auto-complete-advanced/components/ListBox.d.ts +0 -6
  19. package/dist/components/custom-auto-complete-advanced/components/ListBox.js +0 -76
  20. package/dist/components/custom-auto-complete-advanced/components/ListRow.d.ts +0 -2
  21. package/dist/components/custom-auto-complete-advanced/components/ListRow.js +0 -17
  22. package/dist/components/custom-auto-complete-advanced/components/RenderInput.d.ts +0 -23
  23. package/dist/components/custom-auto-complete-advanced/components/RenderInput.js +0 -51
  24. package/dist/components/custom-auto-complete-advanced/components/RenderTags.d.ts +0 -9
  25. package/dist/components/custom-auto-complete-advanced/components/RenderTags.js +0 -22
  26. package/dist/components/custom-breadcrumbs/CustomBreadcrumbs.d.ts +0 -17
  27. package/dist/components/custom-breadcrumbs/CustomBreadcrumbs.js +0 -11
  28. package/dist/components/custom-card/CustomHorizontalCard.d.ts +0 -3
  29. package/dist/components/custom-card/CustomHorizontalCard.js +0 -9
  30. package/dist/components/custom-card/CustomVerticalCard.d.ts +0 -3
  31. package/dist/components/custom-card/CustomVerticalCard.js +0 -9
  32. package/dist/components/custom-chip/CustomChip.d.ts +0 -12
  33. package/dist/components/custom-chip/CustomChip.js +0 -10
  34. package/dist/components/custom-date-picker/CustomComponent.d.ts +0 -17
  35. package/dist/components/custom-date-picker/CustomComponent.js +0 -36
  36. package/dist/components/custom-date-picker/CustomDatePicker.d.ts +0 -14
  37. package/dist/components/custom-date-picker/CustomDatePicker.js +0 -55
  38. package/dist/components/custom-dialog/CustomDialog.d.ts +0 -41
  39. package/dist/components/custom-dialog/CustomDialog.js +0 -38
  40. package/dist/components/custom-input/CustomNumericInput.d.ts +0 -9
  41. package/dist/components/custom-input/CustomNumericInput.js +0 -32
  42. package/dist/components/custom-mobile-date-picker/CustomBottomSheet.d.ts +0 -9
  43. package/dist/components/custom-mobile-date-picker/CustomBottomSheet.js +0 -29
  44. package/dist/components/custom-mobile-date-picker/CustomMobileDatePicker.d.ts +0 -19
  45. package/dist/components/custom-mobile-date-picker/CustomMobileDatePicker.js +0 -98
  46. package/dist/components/custom-mobile-date-picker/DatePickerBottomSheet.d.ts +0 -19
  47. package/dist/components/custom-mobile-date-picker/DatePickerBottomSheet.js +0 -40
  48. package/dist/components/custom-mobile-date-picker/ItemPicker.d.ts +0 -10
  49. package/dist/components/custom-mobile-date-picker/ItemPicker.js +0 -72
  50. package/dist/components/custom-modal/CustomModal.d.ts +0 -21
  51. package/dist/components/custom-modal/CustomModal.js +0 -38
  52. package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.d.ts +0 -9
  53. package/dist/components/custom-pagination/custom-pagination-1/CustomPagination1.js +0 -13
  54. package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.d.ts +0 -20
  55. package/dist/components/custom-pagination/custom-pagination-2/CustomPagination2.js +0 -33
  56. package/dist/components/custom-progress/LinearBufferProgress.d.ts +0 -6
  57. package/dist/components/custom-progress/LinearBufferProgress.js +0 -14
  58. package/dist/components/custom-stepper/CustomStepper.d.ts +0 -31
  59. package/dist/components/custom-stepper/CustomStepper.js +0 -170
  60. package/dist/components/custom-table/CustomTable.d.ts +0 -55
  61. package/dist/components/custom-table/CustomTable.js +0 -50
  62. package/dist/components/custom-table/components/CustomTableBody.d.ts +0 -21
  63. package/dist/components/custom-table/components/CustomTableBody.js +0 -11
  64. package/dist/components/custom-table/components/CustomTableCell.d.ts +0 -8
  65. package/dist/components/custom-table/components/CustomTableCell.js +0 -23
  66. package/dist/components/custom-table/components/CustomTableHead.d.ts +0 -17
  67. package/dist/components/custom-table/components/CustomTableHead.js +0 -63
  68. package/dist/components/custom-table/components/CustomTableRow.d.ts +0 -26
  69. package/dist/components/custom-table/components/CustomTableRow.js +0 -102
  70. package/dist/components/custom-table/components/useTable.d.ts +0 -24
  71. package/dist/components/custom-table/components/useTable.js +0 -77
  72. package/dist/components/custom-tabs/CustomTabs.d.ts +0 -22
  73. package/dist/components/custom-tabs/CustomTabs.js +0 -70
  74. package/dist/components/custom-uploader/CustomUploader.d.ts +0 -23
  75. package/dist/components/custom-uploader/CustomUploader.js +0 -68
  76. package/dist/components/error boundary/ErrorComponent.d.ts +0 -7
  77. package/dist/components/error boundary/ErrorComponent.js +0 -6
  78. package/dist/components/error boundary/withErrorBoundary.d.ts +0 -7
  79. package/dist/components/error boundary/withErrorBoundary.js +0 -10
  80. package/dist/components/index.d.ts +0 -183
  81. package/dist/components/index.js +0 -70
  82. package/dist/components/input-list/Form.d.ts +0 -21
  83. package/dist/components/input-list/Form.js +0 -19
  84. package/dist/components/input-list/InputListWithUseForm.d.ts +0 -22
  85. package/dist/components/input-list/InputListWithUseForm.js +0 -22
  86. package/dist/components/input-list/UseFormInput.d.ts +0 -11
  87. package/dist/components/input-list/UseFormInput.js +0 -50
  88. package/dist/components/input-list/checkbox-list/CheckboxList.d.ts +0 -19
  89. package/dist/components/input-list/checkbox-list/CheckboxList.js +0 -30
  90. package/dist/components/input-list/components/UFAutoComplete.d.ts +0 -9
  91. package/dist/components/input-list/components/UFAutoComplete.js +0 -41
  92. package/dist/components/input-list/components/UFCheckbox.d.ts +0 -19
  93. package/dist/components/input-list/components/UFCheckbox.js +0 -21
  94. package/dist/components/input-list/components/UFCurrency.d.ts +0 -9
  95. package/dist/components/input-list/components/UFCurrency.js +0 -47
  96. package/dist/components/input-list/components/UFDatePicker.d.ts +0 -9
  97. package/dist/components/input-list/components/UFDatePicker.js +0 -17
  98. package/dist/components/input-list/components/UFDatePickerMobile.d.ts +0 -9
  99. package/dist/components/input-list/components/UFDatePickerMobile.js +0 -6
  100. package/dist/components/input-list/components/UFMultiCheckbox.d.ts +0 -9
  101. package/dist/components/input-list/components/UFMultiCheckbox.js +0 -17
  102. package/dist/components/input-list/components/UFMultiSelect.d.ts +0 -9
  103. package/dist/components/input-list/components/UFMultiSelect.js +0 -56
  104. package/dist/components/input-list/components/UFRadio.d.ts +0 -9
  105. package/dist/components/input-list/components/UFRadio.js +0 -19
  106. package/dist/components/input-list/components/UFSelect.d.ts +0 -9
  107. package/dist/components/input-list/components/UFSelect.js +0 -19
  108. package/dist/components/input-list/components/UFSwitch.d.ts +0 -19
  109. package/dist/components/input-list/components/UFSwitch.js +0 -99
  110. package/dist/components/input-list/components/UFTextArea.d.ts +0 -9
  111. package/dist/components/input-list/components/UFTextArea.js +0 -12
  112. package/dist/components/input-list/components/UFTextField.d.ts +0 -11
  113. package/dist/components/input-list/components/UFTextField.js +0 -29
  114. package/dist/components/input-list/components/UFTime.d.ts +0 -10
  115. package/dist/components/input-list/components/UFTime.js +0 -93
  116. package/dist/components/input-list/components/UFUploader.d.ts +0 -9
  117. package/dist/components/input-list/components/UFUploader.js +0 -41
  118. package/dist/components/input-list/type.d.ts +0 -165
  119. package/dist/components/input-list/type.js +0 -1
  120. package/dist/components/otp-input/OTPInput.d.ts +0 -19
  121. package/dist/components/otp-input/OTPInput.js +0 -161
  122. package/dist/components/rich-tooltip/RichTooltip.d.ts +0 -18
  123. package/dist/components/rich-tooltip/RichTooltip.js +0 -32
  124. package/dist/context/FormContext.d.ts +0 -16
  125. package/dist/context/FormContext.js +0 -8
  126. package/dist/icons/Add.d.ts +0 -7
  127. package/dist/icons/Add.js +0 -3
  128. package/dist/icons/ArrowDown.d.ts +0 -7
  129. package/dist/icons/ArrowDown.js +0 -3
  130. package/dist/icons/ArrowLeft1.d.ts +0 -7
  131. package/dist/icons/ArrowLeft1.js +0 -3
  132. package/dist/icons/ArrowRight1.d.ts +0 -7
  133. package/dist/icons/ArrowRight1.js +0 -3
  134. package/dist/icons/Calendar.d.ts +0 -7
  135. package/dist/icons/Calendar.js +0 -3
  136. package/dist/icons/CloseCircle.d.ts +0 -7
  137. package/dist/icons/CloseCircle.js +0 -3
  138. package/dist/icons/DocumentDownload.d.ts +0 -7
  139. package/dist/icons/DocumentDownload.js +0 -3
  140. package/dist/icons/Eye.d.ts +0 -7
  141. package/dist/icons/Eye.js +0 -3
  142. package/dist/icons/EyeSlash.d.ts +0 -7
  143. package/dist/icons/EyeSlash.js +0 -3
  144. package/dist/icons/FolderAdd.d.ts +0 -7
  145. package/dist/icons/FolderAdd.js +0 -3
  146. package/dist/icons/InfoCircle.d.ts +0 -7
  147. package/dist/icons/InfoCircle.js +0 -3
  148. package/dist/icons/Tick.d.ts +0 -7
  149. package/dist/icons/Tick.js +0 -3
  150. package/dist/icons/Trash.d.ts +0 -7
  151. package/dist/icons/Trash.js +0 -3
  152. package/dist/icons/Union.d.ts +0 -7
  153. package/dist/icons/Union.js +0 -3
  154. package/dist/icons/Warning2.d.ts +0 -7
  155. package/dist/icons/Warning2.js +0 -3
  156. package/dist/index.d.ts +0 -8
  157. package/dist/index.js +0 -8
  158. package/dist/methods/debounce.d.ts +0 -3
  159. package/dist/methods/debounce.js +0 -20
  160. package/dist/methods/general.d.ts +0 -2
  161. package/dist/methods/general.js +0 -32
  162. package/dist/mui/Alert/Alert.d.ts +0 -2
  163. package/dist/mui/Alert/Alert.js +0 -13
  164. package/dist/mui/AutoComplete/MuiAutoComplete.d.ts +0 -2
  165. package/dist/mui/AutoComplete/MuiAutoComplete.js +0 -27
  166. package/dist/mui/BreadCrumbs/MuiBreadCrumbs.d.ts +0 -2
  167. package/dist/mui/BreadCrumbs/MuiBreadCrumbs.js +0 -31
  168. package/dist/mui/Button/MuiButton.d.ts +0 -7
  169. package/dist/mui/Button/MuiButton.js +0 -185
  170. package/dist/mui/Card/MuiCard.d.ts +0 -2
  171. package/dist/mui/Card/MuiCard.js +0 -7
  172. package/dist/mui/Checkbox/Checkbox.d.ts +0 -2
  173. package/dist/mui/Checkbox/Checkbox.js +0 -31
  174. package/dist/mui/Checkbox/assets/CheckedIcon.d.ts +0 -8
  175. package/dist/mui/Checkbox/assets/CheckedIcon.js +0 -12
  176. package/dist/mui/Checkbox/assets/IntermediateIcon.d.ts +0 -8
  177. package/dist/mui/Checkbox/assets/IntermediateIcon.js +0 -10
  178. package/dist/mui/Checkbox/assets/UnChekedIcon.d.ts +0 -7
  179. package/dist/mui/Checkbox/assets/UnChekedIcon.js +0 -9
  180. package/dist/mui/Chip/MuiChip.d.ts +0 -10
  181. package/dist/mui/Chip/MuiChip.js +0 -35
  182. package/dist/mui/Dialog/MuiDialog.d.ts +0 -7
  183. package/dist/mui/Dialog/MuiDialog.js +0 -22
  184. package/dist/mui/FormControl/MuiFormControlLabel.d.ts +0 -2
  185. package/dist/mui/FormControl/MuiFormControlLabel.js +0 -13
  186. package/dist/mui/IconButton/MuiIconButon.d.ts +0 -2
  187. package/dist/mui/IconButton/MuiIconButon.js +0 -7
  188. package/dist/mui/InputAdornment/MuiInputAdornment.d.ts +0 -2
  189. package/dist/mui/InputAdornment/MuiInputAdornment.js +0 -6
  190. package/dist/mui/InputLabel/MuiInputLabel.d.ts +0 -2
  191. package/dist/mui/InputLabel/MuiInputLabel.js +0 -43
  192. package/dist/mui/Pagination/MuiPagination.d.ts +0 -2
  193. package/dist/mui/Pagination/MuiPagination.js +0 -15
  194. package/dist/mui/Pagination/MuiPaginationItem.d.ts +0 -2
  195. package/dist/mui/Pagination/MuiPaginationItem.js +0 -15
  196. package/dist/mui/Radio/MuiRadio.d.ts +0 -2
  197. package/dist/mui/Radio/MuiRadio.js +0 -17
  198. package/dist/mui/Select/MuiSelect.d.ts +0 -2
  199. package/dist/mui/Select/MuiSelect.js +0 -47
  200. package/dist/mui/Switch/MuiSwitch.d.ts +0 -2
  201. package/dist/mui/Switch/MuiSwitch.js +0 -83
  202. package/dist/mui/Tabs/MuiTabs.d.ts +0 -2
  203. package/dist/mui/Tabs/MuiTabs.js +0 -21
  204. package/dist/mui/Tabs/Tab/MuiTab.d.ts +0 -2
  205. package/dist/mui/Tabs/Tab/MuiTab.js +0 -26
  206. package/dist/mui/TextField/MuiFilledInput.d.ts +0 -2
  207. package/dist/mui/TextField/MuiFilledInput.js +0 -91
  208. package/dist/mui/TextField/MuiOutlinedInput.d.ts +0 -2
  209. package/dist/mui/TextField/MuiOutlinedInput.js +0 -66
  210. package/dist/mui/TextField/TextField.d.ts +0 -2
  211. package/dist/mui/TextField/TextField.js +0 -78
  212. package/dist/mui/Tooltip/MuiTooltip.d.ts +0 -2
  213. package/dist/mui/Tooltip/MuiTooltip.js +0 -26
  214. package/dist/mui/Typography/MuiTypography.d.ts +0 -2
  215. package/dist/mui/Typography/MuiTypography.js +0 -9
  216. package/dist/mui/Typography/index.d.ts +0 -2
  217. package/dist/mui/Typography/index.js +0 -138
  218. package/dist/mui/accordion/MuiAccodrion.d.ts +0 -2
  219. package/dist/mui/accordion/MuiAccodrion.js +0 -13
  220. package/dist/mui/breakpoints/index.d.ts +0 -9
  221. package/dist/mui/breakpoints/index.js +0 -9
  222. package/dist/mui/menu/MuiMenu.d.ts +0 -2
  223. package/dist/mui/menu/MuiMenu.js +0 -8
  224. package/dist/mui/menu/MuiMenuItem.d.ts +0 -2
  225. package/dist/mui/menu/MuiMenuItem.js +0 -14
  226. package/dist/mui/mui-css-baseline/index.d.ts +0 -3
  227. package/dist/mui/mui-css-baseline/index.js +0 -37
  228. package/dist/mui/palette/dark/darkPalette.d.ts +0 -2
  229. package/dist/mui/palette/dark/darkPalette.js +0 -135
  230. package/dist/mui/palette/light/lightPalette.d.ts +0 -2
  231. package/dist/mui/palette/light/lightPalette.js +0 -135
  232. package/dist/nextjs/NextCacheProvider.d.ts +0 -7
  233. package/dist/nextjs/NextCacheProvider.js +0 -13
  234. package/dist/react/ReactCacheProvider.d.ts +0 -7
  235. package/dist/react/ReactCacheProvider.js +0 -15
  236. package/dist/theme/theme.d.ts +0 -3
  237. package/dist/theme/theme.js +0 -75
  238. package/dist/types/palette.d.ts +0 -60
  239. package/dist/types/palette.js +0 -1
  240. package/dist/types/types.d.ts +0 -102
  241. package/dist/types/types.js +0 -4
  242. package/dist/types/typography.d.ts +0 -71
  243. package/dist/types/typography.js +0 -1
@@ -1,23 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- import { AutocompleteRenderInputParams, TextFieldVariants } from '@mui/material';
3
- import { TextFieldProps } from '@mui/material';
4
- import { TInputLabelMode } from '../../input-list/type';
5
- interface IRenderInputProps extends Omit<TextFieldProps, 'label'> {
6
- params: AutocompleteRenderInputParams;
7
- label?: ReactNode;
8
- loading: boolean | undefined;
9
- inputMaxHeight?: string | number;
10
- variant?: TextFieldVariants;
11
- placeholder?: string;
12
- validation?: {
13
- isInvalid: boolean;
14
- message: string;
15
- };
16
- inputLabelMode?: TInputLabelMode;
17
- helperText?: string;
18
- textFieldProps?: TextFieldProps;
19
- handleSearch?: (e: any) => void;
20
- handleChange?: (e: string) => void;
21
- }
22
- declare const RenderInput: FC<IRenderInputProps>;
23
- export default RenderInput;
@@ -1,51 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback } from 'react';
3
- import { CircularProgress, InputAdornment, TextField, } from '@mui/material';
4
- import debounce from '../../../methods/debounce';
5
- import InfoCircle from '../../../icons/InfoCircle';
6
- const RenderInput = (props) => {
7
- const { params, inputMaxHeight, sx, label, loading, helperText, variant, placeholder, disabled, validation, inputLabelMode, textFieldProps, handleSearch, handleChange, } = props;
8
- const debouncedSearch = useCallback(debounce((e) => {
9
- if (handleSearch) {
10
- handleSearch(e);
11
- }
12
- }, 500), [handleSearch]);
13
- return (_jsx(TextField, { ...params, variant: variant, ...(inputLabelMode === 'relative' && { label: label }), helperText: validation?.message
14
- ? validation?.message ?? helperText ?? ' '
15
- : undefined, error: validation?.isInvalid, placeholder: placeholder, disabled: disabled, InputProps: {
16
- ...params.InputProps,
17
- ...(validation?.isInvalid && {
18
- startAdornment: (_jsx(InputAdornment, { sx: { pl: 2, stroke: ({ palette }) => palette.error.main }, position: 'start', children: _jsx(InfoCircle, { primarycolor: 'inherit' }) })),
19
- }),
20
- endAdornment: (_jsxs(InputAdornment, { position: 'end', children: [loading ? _jsx(CircularProgress, { color: 'inherit', size: 20 }) : null, params.InputProps.endAdornment] })),
21
- }, ...textFieldProps, onChange: (e) => {
22
- debouncedSearch(e.target.value);
23
- handleChange?.(e.target.value);
24
- }, sx: [
25
- ...(Array.isArray(sx) ? sx : [sx]),
26
- {
27
- ...(inputMaxHeight && {
28
- minHeight: 0,
29
- maxHeight: inputMaxHeight ?? 'unset',
30
- }),
31
- minWidth: 0,
32
- height: '100%',
33
- overflow: 'auto',
34
- '& .MuiFilledInput-root': {
35
- ...(inputLabelMode === 'relative' && {
36
- alignItems: 'flex-end',
37
- }),
38
- },
39
- '.MuiAutocomplete-input': {
40
- padding: '0',
41
- },
42
- '.MuiOutlinedInput-root': {
43
- paddingY: '4px !important',
44
- },
45
- '.MuiAutocomplete-popupIndicator': {
46
- transition: '0.3s ease all',
47
- },
48
- },
49
- ] }));
50
- };
51
- export default RenderInput;
@@ -1,9 +0,0 @@
1
- import { TextFieldProps, AutocompleteRenderGetTagProps } from '@mui/material';
2
- interface IRenderTagsProps extends Omit<TextFieldProps, 'label'> {
3
- getTagProps: AutocompleteRenderGetTagProps;
4
- value: any[];
5
- variant: 'filled' | 'outlined';
6
- size: 'small' | 'medium';
7
- }
8
- declare const RenderTags: (value: IRenderTagsProps['value'], getTagProps: IRenderTagsProps['getTagProps'], variant?: IRenderTagsProps['variant'], size?: IRenderTagsProps['size']) => import("react/jsx-runtime").JSX.Element[];
9
- export default RenderTags;
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Chip, } from '@mui/material';
3
- import SvgAdd from '../../../icons/Add';
4
- const RenderTags = (value, getTagProps, variant = 'filled', size = 'medium') => value.map((option, index) => {
5
- const { key, ...tagProps } = getTagProps({ index });
6
- return (_jsx(Chip, { variant: variant, label: option.label, size: size, ...tagProps, deleteIcon: _jsx(SvgAdd, { style: { transform: 'rotate(45deg)' }, primarycolor: 'inherit' }), sx: {
7
- border: 'none',
8
- backgroundColor: 'primary.3',
9
- ':hover': {
10
- backgroundColor: 'primary.4',
11
- cursor: 'default',
12
- },
13
- py: '0 !important',
14
- maxHeight: size === 'small' ? 28 : 32,
15
- color: 'text.primary',
16
- stroke: ({ palette }) => palette.text.primary,
17
- borderRadius: '999px',
18
- fontSize: ({ typography }) => typography['caption3.medium'].fontSize,
19
- fontWeight: ({ typography }) => typography['caption3.medium'].fontWeight,
20
- } }, key));
21
- });
22
- export default RenderTags;
@@ -1,17 +0,0 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
2
- import { BreadcrumbsProps, LinkOwnProps } from '@mui/material';
3
- export interface ICustomBreadcrumbsProps {
4
- separator?: ReactNode | string;
5
- collapse?: boolean;
6
- items: {
7
- title: ReactNode | string;
8
- href: string;
9
- }[];
10
- itemProps?: {
11
- linkProps?: LinkOwnProps;
12
- textProps?: HTMLAttributes<HTMLDivElement>;
13
- };
14
- breadCrumbProps?: BreadcrumbsProps;
15
- }
16
- declare const CustomBreadcrumbs: ({ separator, collapse, items, itemProps, breadCrumbProps, }: ICustomBreadcrumbsProps) => import("react/jsx-runtime").JSX.Element;
17
- export default CustomBreadcrumbs;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Breadcrumbs, Link, } from '@mui/material';
3
- const CustomBreadcrumbs = ({ separator, collapse, items, itemProps, breadCrumbProps, }) => {
4
- return (_jsx(Breadcrumbs, { maxItems: collapse ? 2 : undefined, separator: separator, ...breadCrumbProps, children: items.map((item, index) => (_jsx(Link, { underline: 'none', color: 'inherit', href: item.href, ...itemProps?.linkProps, children: _jsx("div", { style: {
5
- display: 'flex',
6
- alignItems: 'center',
7
- fontSize: 14,
8
- fontWeight: 400,
9
- }, ...itemProps?.textProps, children: item.title }) }, index))) }));
10
- };
11
- export default CustomBreadcrumbs;
@@ -1,3 +0,0 @@
1
- import { CustomCardProps } from "./types";
2
- declare function CustomHorizontalCard({ Image, Title, Subtitle, Date, Actions, ...restProps }: CustomCardProps): import("react/jsx-runtime").JSX.Element;
3
- export default CustomHorizontalCard;
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Box from "@mui/material/Box";
3
- import { useTheme } from "@mui/material";
4
- function CustomHorizontalCard({ Image, Title, Subtitle, Date, Actions, ...restProps }) {
5
- const theme = useTheme();
6
- const { sx, ...props } = restProps;
7
- return (_jsx(Box, { sx: { width: 350, border: `1px solid ${theme.palette.mode === "light" ? theme.palette.text[7] : theme.palette.grey[6]}`, borderRadius: 2, backgroundColor: theme.palette.background.default, overflow: 'hidden', ...restProps.sx }, ...props, children: _jsxs(Box, { sx: { display: 'flex', gap: 2 }, children: [_jsx(Box, { children: Image }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', width: '100%', padding: 2 }, children: [_jsxs(Box, { sx: { display: 'flex', justifyContent: 'space-between' }, children: [_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column' }, children: [Title, Subtitle] }), Date] }), Actions] })] }) }));
8
- }
9
- export default CustomHorizontalCard;
@@ -1,3 +0,0 @@
1
- import { CustomCardProps } from "./types";
2
- declare function CustomVerticalCard({ Image, Title, Subtitle, Date, Description, Chip, Actions, ...restProps }: CustomCardProps): import("react/jsx-runtime").JSX.Element;
3
- export default CustomVerticalCard;
@@ -1,9 +0,0 @@
1
- import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- import Box from "@mui/material/Box";
4
- function CustomVerticalCard({ Image, Title, Subtitle, Date, Description, Chip, Actions, ...restProps }) {
5
- const theme = useTheme();
6
- const { sx, ...props } = restProps;
7
- return (_jsxs(Box, { sx: { width: 350, border: `1px solid ${theme.palette.mode === "light" ? theme.palette.text[7] : theme.palette.grey[6]}`, borderRadius: 2, backgroundColor: theme.palette.background.default, overflow: 'hidden', p: 2, ...restProps.sx }, ...props, children: [Image, _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [Title, Chip] }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column' }, children: [Subtitle, Date] }), Description, Actions] }));
8
- }
9
- export default CustomVerticalCard;
@@ -1,12 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- import { ChipProps } from "@mui/material";
3
- import { TypographyProps } from "@mui/material/Typography";
4
- export interface ICustomChipProps {
5
- label: ReactNode;
6
- endIcon?: ReactNode;
7
- startIcon?: ReactNode;
8
- labelProps?: TypographyProps;
9
- chipProps?: ChipProps;
10
- }
11
- declare const CustomChip: FC<ICustomChipProps>;
12
- export default CustomChip;
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Chip from "@mui/material/Chip";
3
- import Box from "@mui/material/Box";
4
- import Typography from "@mui/material/Typography";
5
- const CustomChip = ({ label, endIcon, startIcon, labelProps, chipProps }) => {
6
- const isLarge = chipProps?.size === 'large';
7
- const { sx, ...props } = chipProps || {};
8
- return (_jsx(Chip, { sx: { ...(chipProps?.rounded && { borderRadius: '9999px' }), ...sx }, color: props.color, label: _jsxs(Box, { display: "flex", gap: 2, alignItems: 'center', children: [_jsx(Box, { display: 'flex', id: "custom-chip__start-icon", children: startIcon }), _jsx(Typography, { id: "custom-chip__label", lineHeight: props.size === 'small' ? '24px' : 'normal', variant: isLarge ? 'caption2.medium' : 'caption3', color: "#ffffff", ...labelProps, children: label }), _jsx(Box, { display: 'flex', id: "custom-chip__start-icon", children: endIcon })] }), ...props }));
9
- };
10
- export default CustomChip;
@@ -1,17 +0,0 @@
1
- import { FC } from 'react';
2
- import { TextFieldVariants } from '@mui/material';
3
- import { BaseTextFieldProps } from '@mui/material/TextField/TextField';
4
- import { TInputLabelMode } from '../input-list/type';
5
- interface Props extends BaseTextFieldProps {
6
- openCalendar: any;
7
- value?: any;
8
- handleValueChange?: () => void;
9
- disabled?: boolean;
10
- error?: any;
11
- readonly?: boolean;
12
- variant?: TextFieldVariants;
13
- inputLabelMode: TInputLabelMode;
14
- withoutHelperText?: boolean;
15
- }
16
- declare const CustomComponent: FC<Props>;
17
- export default CustomComponent;
@@ -1,36 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { InputAdornment, TextField } from '@mui/material';
3
- import SvgCalendar from '../../icons/Calendar';
4
- const CustomComponent = ({ openCalendar, value, handleValueChange, disabled, error, readonly, variant, lang, placeholder, inputLabelMode, label, withoutHelperText, ...rest }) => {
5
- const { sx, helperText, ...props } = rest;
6
- return (_jsx(TextField, { placeholder: placeholder ?? lang === 'fa' ? 'انتخاب کنید' : 'Pick a date', error: Boolean(error), ...(inputLabelMode === 'static' && { hiddenLabel: true }), ...(inputLabelMode === 'relative' && { label: label }), fullWidth: true, variant: variant, sx: {
7
- // ...(inputLabelMode === "static" && {
8
- // ".MuiFilledInput-input": {
9
- // py: "16px !important",
10
- // pr: "3px !important",
11
- // },
12
- // }),
13
- borderRadius: '8px',
14
- pointerEvents: readonly ? 'none' : 'unset',
15
- // backgroundColor: readonly ? "background.paper" : "unset",
16
- '& .MuiOutlinedInput-input ,& .MuiOutlinedInput-root': {
17
- // backgroundColor: readonly ? "background.paper" : "unset",
18
- // color: readonly ? "text.50" : "unset",
19
- borderRadius: '8px',
20
- },
21
- '& .MuiFormHelperText-root': {
22
- position: 'absolute',
23
- top: 55,
24
- left: 0,
25
- },
26
- width: '100%',
27
- ...sx,
28
- }, InputProps: {
29
- endAdornment: (_jsx(InputAdornment, { position: 'end', sx: {
30
- stroke: (theme) => readonly
31
- ? `${theme.palette.text.disabled} !important`
32
- : 'text.primary',
33
- }, children: _jsx(SvgCalendar, { primarycolor: 'inherit' }) })),
34
- }, disabled: disabled, value: value, onFocus: openCalendar, onClick: openCalendar, onChange: handleValueChange, helperText: withoutHelperText ? undefined : error?.message ?? helperText ?? ' ', ...props }));
35
- };
36
- export default CustomComponent;
@@ -1,14 +0,0 @@
1
- import { FC } from "react";
2
- import "../../styles/datePicker.css";
3
- import { CalendarProps } from "react-multi-date-picker";
4
- import { BaseTextFieldProps } from "@mui/material/TextField/TextField";
5
- import { TInputLabelMode } from "../input-list/type";
6
- export interface ICustomDatePickerProps extends CalendarProps {
7
- error: any;
8
- textFieldProps?: BaseTextFieldProps;
9
- inputLabelMode: TInputLabelMode;
10
- label: string;
11
- withoutHelperText?: boolean;
12
- }
13
- declare const CustomDatePicker: FC<ICustomDatePickerProps>;
14
- export default CustomDatePicker;
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
3
- import "../../styles/datePicker.css";
4
- import DatePicker from "react-multi-date-picker";
5
- import CustomComponent from "./CustomComponent";
6
- import { useTheme } from "@mui/material";
7
- import persian from "react-date-object/calendars/persian";
8
- import persian_fa from "react-date-object/locales/persian_fa";
9
- const CustomDatePicker = ({ onChange, value, disabled, error, readOnly, textFieldProps, label, inputLabelMode, withoutHelperText, ...rest }) => {
10
- const handleChange = (selectedDates) => {
11
- if (onChange && selectedDates) {
12
- const convertDate = new Date(selectedDates.toDate());
13
- onChange(convertDate);
14
- }
15
- };
16
- let lang = document.documentElement.lang;
17
- const { palette } = useTheme();
18
- const [portalTarget, setPortalTarget] = useState();
19
- useEffect(() => {
20
- setColors(palette);
21
- lang = document.documentElement.lang;
22
- }, [palette.mode, document.documentElement.lang]);
23
- useEffect(() => {
24
- const portalDiv = document.createElement("div");
25
- portalDiv.id = "myPortalDiv";
26
- portalDiv.style.zIndex = "1500";
27
- portalDiv.style.position = "relative";
28
- document.body.appendChild(portalDiv);
29
- setPortalTarget(portalDiv);
30
- return () => {
31
- document.body.removeChild(portalDiv);
32
- };
33
- }, []);
34
- const defaultWeekDays = ["ش", "ی", "د", "س", "چ", "پ", "ج"];
35
- return (_jsx(DatePicker, { className: "custom-calender", value: value ? new Date(value) : null, portal: true, portalTarget: portalTarget, hideOnScroll: true, onChange: handleChange, ...(lang === "fa" && {
36
- weekDays: defaultWeekDays,
37
- calendar: persian,
38
- locale: persian_fa,
39
- }), calendarPosition: "bottom-left", editable: false, disabled: disabled, containerStyle: { width: "100%" }, ...rest, render: _jsx(CustomComponent, { lang: lang, error: error, disabled: disabled, readonly: readOnly, label: label, inputLabelMode: inputLabelMode, openCalendar: undefined, value: value, handleValueChange: undefined, withoutHelperText: withoutHelperText, ...textFieldProps }) }));
40
- };
41
- export default CustomDatePicker;
42
- const setColors = (colors) => {
43
- const { primary: primaryThemeColor, background: bgThemeColor, text: textThemeColor, } = colors;
44
- const params = [
45
- { className: "--rmdp-primary-theme", value: primaryThemeColor?.main },
46
- { className: "--rmdp-secondary-theme", value: primaryThemeColor?.[2] },
47
- { className: "--rmdp-shadow-theme", value: primaryThemeColor?.[1] },
48
- { className: "--rmdp-today-theme", value: primaryThemeColor?.[5] },
49
- { className: "--rmdp-hover-theme", value: primaryThemeColor?.[4] },
50
- { className: "--rmdp-deselect-theme", value: primaryThemeColor?.[9] },
51
- { className: "--rmdp-background-theme", value: bgThemeColor?.paper },
52
- { className: "--rmdp-text-theme", value: textThemeColor?.primary },
53
- ];
54
- params?.forEach((param) => document.documentElement.style.setProperty(param?.className, param?.value));
55
- };
@@ -1,41 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { ButtonProps, DialogActionsProps, DialogContentProps, DialogProps, DialogTitleProps } from "@mui/material";
3
- import { StackProps } from "@mui/material/Stack";
4
- export interface IDialogButton extends ButtonProps {
5
- label: ReactNode;
6
- isLoading?: ButtonProps["isLoading"];
7
- }
8
- export interface IDialogHeader {
9
- component?: ReactNode;
10
- title: string | ReactNode;
11
- withoutButton?: boolean;
12
- headerProps?: StackProps;
13
- titleProps?: DialogTitleProps;
14
- button?: {
15
- icon?: ReactNode;
16
- props?: ButtonProps;
17
- label?: string | ReactNode;
18
- };
19
- }
20
- export interface ICustomDialog extends DialogProps {
21
- header?: IDialogHeader;
22
- withoutHeader?: boolean;
23
- withoutBoxShadow?: boolean;
24
- dialogContent?: {
25
- props?: DialogContentProps;
26
- image?: ReactNode;
27
- body?: {
28
- title?: string | ReactNode;
29
- content?: string | ReactNode;
30
- props?: StackProps;
31
- };
32
- };
33
- dialogActions?: {
34
- actionButtons?: IDialogButton[];
35
- actionComponent?: ReactNode | string;
36
- props?: DialogActionsProps;
37
- };
38
- onClose?: () => void;
39
- }
40
- declare const CustomDialog: ({ withoutHeader, withoutBoxShadow, dialogContent, children, header, dialogActions, onClose, PaperProps, ...rest }: ICustomDialog) => import("react/jsx-runtime").JSX.Element;
41
- export default CustomDialog;
@@ -1,38 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Dialog, DialogActions, DialogContent, DialogTitle, useTheme, } from "@mui/material";
3
- import Stack from "@mui/material/Stack";
4
- import Box from "@mui/material/Box";
5
- import Typography from "@mui/material/Typography";
6
- import CloseCircle from "../../icons/CloseCircle";
7
- const CustomDialog = ({ withoutHeader = false, withoutBoxShadow = false, dialogContent, children, header, dialogActions, onClose, PaperProps, ...rest }) => {
8
- const { direction } = useTheme();
9
- return (_jsxs(Dialog, { keepMounted: true, dir: direction, onClose: onClose, ...rest, withoutBoxShadow: withoutBoxShadow, children: [!withoutHeader &&
10
- (header?.component ?? (_jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", ...header?.headerProps, children: [_jsx(DialogTitle, { sx: { padding: "0px" }, variant: "caption1", ...header?.titleProps, children: header?.title ?? "Title" }), !header?.withoutButton && (_jsxs(Button, { onClick: onClose, variant: "text", sx: {
11
- padding: "0px",
12
- minWidth: "max-content",
13
- minHeight: "max-content",
14
- transition: "transform 0.1s ease",
15
- stroke: (theme) => theme.palette.text.primary,
16
- ":hover": { backgroundColor: "background.main" },
17
- ":active": {
18
- transform: "scale(90%)",
19
- },
20
- }, ...header?.button?.props, children: [header?.button?.label, header?.button?.icon ?? (_jsx(CloseCircle, { primarycolor: "inherit" }))] }))] }))), _jsxs(DialogContent, { ...dialogContent?.props, children: [!!dialogContent?.image && (_jsx(Box, { width: "max-content", minHeight: "80px", mx: "auto", children: dialogContent?.image })), !!dialogContent?.body && (_jsxs(Stack, { maxWidth: "490px", ...dialogContent?.body?.props, children: [_jsx(Typography, { variant: typeof dialogContent?.body?.title === "string"
21
- ? "caption1.bold"
22
- : "inherit", component: typeof dialogContent?.body?.title === "string" ? "span" : "div", children: dialogContent?.body?.title }), _jsx(Typography, { variant: typeof dialogContent?.body?.content === "string"
23
- ? "caption2"
24
- : "inherit", textAlign: "justify", component: typeof dialogContent?.body?.content === "string"
25
- ? "span"
26
- : "div", children: dialogContent?.body?.content })] })), children] }), dialogActions && (_jsxs(DialogActions, { sx: {
27
- display: "flex",
28
- width: "100%",
29
- gap: 4,
30
- p: 0,
31
- justifyContent: "space-between",
32
- alignItems: "flex-end",
33
- }, ...dialogActions?.props, children: [dialogActions?.actionButtons?.map((actionButton, idx) => (_jsx(Button, { ...actionButton, sx: {
34
- stroke: (theme) => theme.palette.text.primary,
35
- ...actionButton.sx,
36
- }, children: actionButton?.label }, idx))), dialogActions?.actionComponent] }))] }));
37
- };
38
- export default CustomDialog;
@@ -1,9 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- import { TextFieldProps } from '@mui/material/TextField';
3
- export interface ICustomNumericInputProps extends Omit<TextFieldProps, 'onChange' | 'value'> {
4
- onChange?: (value: string | number) => void;
5
- value?: string | number;
6
- currencyIcon?: ReactNode;
7
- }
8
- declare const CustomNumericInput: FC<ICustomNumericInputProps>;
9
- export default CustomNumericInput;
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import TextField from '@mui/material/TextField';
4
- const CustomNumericInput = ({ onChange, value, ...props }) => {
5
- useEffect(() => {
6
- setCustomValue(formatAsCurrency(value) ?? "");
7
- }, [value]);
8
- const [customValue, setCustomValue] = useState(formatAsCurrency(value));
9
- function formatAsCurrency(number) {
10
- // Use toLocaleString to format the number as currency
11
- return number?.toLocaleString(); // Remove 'USD' and a space at the beginning
12
- }
13
- function convertCurrencyToNumber(currencyString) {
14
- // Replace Persian numerals with Arabic numerals
15
- const numericString = currencyString.replace(/[۰-۹]/g, (match) => String.fromCharCode(match.charCodeAt(0) - 1728));
16
- // Remove all non-numeric characters except for the decimal point
17
- const sanitizedNumericString = numericString.replace(/[^0-9.]/g, '');
18
- // Parse the numeric string to a floating-point number
19
- const numberValue = parseFloat(sanitizedNumericString);
20
- // Check if the parsed value is a valid number (not NaN)
21
- return isNaN(numberValue) ? '' : numberValue;
22
- }
23
- const handleChange = (e) => {
24
- const value = e.target.value;
25
- setCustomValue(formatAsCurrency(convertCurrencyToNumber(value)));
26
- if (onChange) {
27
- onChange(convertCurrencyToNumber(value));
28
- }
29
- };
30
- return (_jsx(_Fragment, { children: _jsx(TextField, { fullWidth: true, className: 'numeric-input', value: customValue, onChange: handleChange, ...props }) }));
31
- };
32
- export default CustomNumericInput;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { DialogProps } from '@mui/material';
3
- interface ICustomBottomSheet extends DialogProps {
4
- children?: React.ReactNode;
5
- handleClose: (event?: object | undefined, reason?: string | undefined) => void;
6
- withoutCloseButton?: boolean;
7
- }
8
- declare const CustomBottomSheet: ({ children, handleClose, open, sx, title, withoutCloseButton, ...dialogProps }: ICustomBottomSheet) => import("react/jsx-runtime").JSX.Element;
9
- export default CustomBottomSheet;
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import Slide from '@mui/material/Slide';
4
- import { Box, Dialog, IconButton, Stack, styled, Typography, } from '@mui/material';
5
- import SvgAdd from '../../icons/Add';
6
- const CustomBottomSheet = ({ children, handleClose, open, sx, title, withoutCloseButton, ...dialogProps }) => {
7
- return (_jsxs(Dialog, { fullScreen: true, open: open, onClose: handleClose, TransitionComponent: Transition, keepMounted: true, sx: [style, ...(Array.isArray(sx) ? sx : [sx])], ...dialogProps, children: [_jsxs(DialogHeader, { children: [_jsx(Typography, { variant: 'body3.bold', children: title }), !withoutCloseButton && (_jsx(IconButton, { "aria-label": 'close', onClick: handleClose, children: _jsx(SvgAdd, { style: { transform: 'rotate(45deg) scale(150%)' } }) }))] }), _jsx(Stack, { p: 6, gap: 8, children: children })] }));
8
- };
9
- export default CustomBottomSheet;
10
- const Transition = React.forwardRef(function Transition(props, ref) {
11
- return (_jsx(Slide, { direction: 'up', ref: ref, ...props, style: { transitionDuration: '0.4s' } }));
12
- });
13
- const style = {
14
- '.MuiDialog-paper': {
15
- minWidth: '0px',
16
- maxHeight: '80%',
17
- minHeight: '60%',
18
- height: 'max-content',
19
- padding: 0,
20
- transform: 'translateY(40%)',
21
- maxWidth: 360,
22
- },
23
- };
24
- const DialogHeader = styled(Box)({
25
- width: '100%',
26
- display: 'flex',
27
- justifyContent: 'space-between',
28
- padding: 12,
29
- });
@@ -1,19 +0,0 @@
1
- /// <reference types="react-date-object" />
2
- import { FC } from 'react';
3
- import { UseFormReturn } from 'react-hook-form';
4
- import { IDatePickerMobileForm } from '../input-list/type';
5
- type Props = IDatePickerMobileForm & {
6
- form: UseFormReturn<any>;
7
- error?: any;
8
- };
9
- export type TSelectedDate = {
10
- month: number | null;
11
- day: number | null;
12
- year: number | null;
13
- };
14
- export declare const PERSIAN_CALENDARS: {
15
- calendar: Omit<import("react-date-object").Calendar, "leapsLength">;
16
- locale: import("react-date-object").Locale;
17
- };
18
- declare const MobileDatePicker: FC<Props>;
19
- export default MobileDatePicker;
@@ -1,98 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Controller } from 'react-hook-form';
4
- import { TextField, InputAdornment } from '@mui/material';
5
- import SvgCalendar from '../../icons/Calendar';
6
- import persian from 'react-date-object/calendars/persian';
7
- import persian_fa from 'react-date-object/locales/persian_fa';
8
- import { DateObject } from 'react-multi-date-picker';
9
- import DatePickerBottomSheet from './DatePickerBottomSheet';
10
- export const PERSIAN_CALENDARS = {
11
- calendar: persian,
12
- locale: persian_fa,
13
- };
14
- const calculateDaysInMonth = (isLeap) => [
15
- 31,
16
- 31,
17
- 31,
18
- 31,
19
- 31,
20
- 31,
21
- 30,
22
- 30,
23
- 30,
24
- 30,
25
- 30,
26
- isLeap ? 30 : 29,
27
- ];
28
- const createDateObject = (date, lang) => {
29
- if (date)
30
- return new DateObject({
31
- date: new Date(date),
32
- ...(lang.includes('fa') && {
33
- calendar: persian,
34
- locale: persian_fa,
35
- }),
36
- });
37
- };
38
- const MobileDatePicker = ({ form, name, defaultValue, label, rules, readonly, disabled, placeholder, error, itemProps, props, helperText, variant = 'outlined', withoutHelperText, inputLabelMode, }) => {
39
- const lang = document.documentElement.lang;
40
- const [open, setOpen] = useState(false);
41
- const defaultValueDate = defaultValue
42
- ? createDateObject(new Date(defaultValue), lang)
43
- : form.getValues(name)
44
- ? createDateObject(new Date(form.getValues(name)), lang)
45
- : //Returns undefined because if Date Object bug for showing undefined year as -1 value
46
- undefined;
47
- const [value, setValue] = useState({
48
- day: defaultValueDate?.day ?? null,
49
- month: defaultValueDate?.month?.number ?? null,
50
- year: defaultValueDate?.year && defaultValueDate.year > 1
51
- ? defaultValueDate.year
52
- : null,
53
- });
54
- const selectedDate = new DateObject({
55
- ...(lang.includes('fa') && PERSIAN_CALENDARS),
56
- date: `${value?.year}/${value?.month}/${value?.day}`,
57
- });
58
- const handleChange = () => {
59
- form.setValue(name, selectedDate.toDate() || defaultValueDate?.toDate());
60
- setOpen(false);
61
- };
62
- const getHelperText = () => {
63
- if (withoutHelperText)
64
- return undefined;
65
- return error?.message ?? helperText ?? ' ';
66
- };
67
- const handleTextFieldClick = (e) => {
68
- e.preventDefault();
69
- setOpen(true);
70
- };
71
- const dayOptions = calculateDaysInMonth(selectedDate.isLeap)?.[(value?.month || 1) - 1];
72
- const monthOptions = [{ name: '' }, ...selectedDate.months, { name: '' }];
73
- return (_jsxs(_Fragment, { children: [_jsx(Controller, { control: form?.control, name: name, rules: { ...rules }, defaultValue: selectedDate.isValid ? selectedDate?.toDate() : undefined, render: ({ field }) => (_jsx(TextField, { ...(inputLabelMode === 'static' && { hiddenLabel: true }), ...(inputLabelMode === 'relative' && { label: label }), ...(defaultValue && {
74
- defaultValue: defaultValueDate,
75
- }), onChange: () => {
76
- form
77
- .register(name, { ...rules })
78
- .onChange({ target: { current: selectedDate.toDate() } });
79
- }, onBlur: () => {
80
- form
81
- .register(name, { ...rules })
82
- .onBlur({ target: { current: selectedDate.toDate() } });
83
- }, value: selectedDate?.format('YYYY/MM/DD'), defaultValue: selectedDate?.format('YYYY/MM/DD'), variant: variant, fullWidth: true, id: field?.name, error: !!error, onClick: !(disabled || readonly) && handleTextFieldClick, onTouchEnd: !(disabled || readonly) && handleTextFieldClick, placeholder: placeholder, helperText: getHelperText(), "aria-readonly": readonly, disabled: disabled, inputProps: { readOnly: readonly }, InputProps: {
84
- endAdornment: (_jsx(InputAdornment, { position: 'end', sx: {
85
- '& .MuiInputAdornment-positionStart': {
86
- marginTop: '0 important',
87
- backgroundColor: 'red',
88
- },
89
- stroke: ({ palette }) => disabled || readonly
90
- ? palette.text.disabled
91
- : error
92
- ? palette.error.main
93
- : palette.text.primary,
94
- }, children: _jsx(SvgCalendar, { primarycolor: 'inherit' }) })),
95
- ...itemProps?.InputProps,
96
- }, ...itemProps, ...props })) }), _jsx(DatePickerBottomSheet, { dayOptions: dayOptions, defaultValue: defaultValueDate, handleChange: setValue, handleClose: handleChange, handleSubmit: handleChange, label: String(label), monthOptions: monthOptions, open: open, value: value }, 'date-picker-bottom-sheet')] }));
97
- };
98
- export default MobileDatePicker;
@@ -1,19 +0,0 @@
1
- import { Dispatch, FC, SetStateAction } from 'react';
2
- import { Month } from 'react-date-object';
3
- import { DateObject } from 'react-multi-date-picker';
4
- import { TSelectedDate } from './CustomMobileDatePicker';
5
- type TDatePickerBottomSheetProps = {
6
- open: boolean;
7
- handleClose: () => void;
8
- label: string;
9
- handleChange: Dispatch<SetStateAction<TSelectedDate>>;
10
- monthOptions: Month[] | {
11
- name: string;
12
- }[];
13
- dayOptions: number;
14
- value: TSelectedDate;
15
- handleSubmit: () => void;
16
- defaultValue: DateObject | undefined;
17
- };
18
- declare const DatePickerBottomSheet: FC<TDatePickerBottomSheetProps>;
19
- export default DatePickerBottomSheet;