@campxdev/shared 1.6.6 → 1.6.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -33,15 +33,18 @@ export default function FormDatePicker({
33
33
  }: IDatePicker) {
34
34
  return (
35
35
  <Flatpickr
36
- onChange={(dates: Date[]) => {
37
- if (onChange) onChange(dates[0])
38
- }}
39
36
  options={{
40
37
  dateFormat: 'd-m-Y',
41
38
  minDate,
42
39
  maxDate,
43
40
  allowInput: true,
44
41
  }}
42
+ onChange={(dates: Date[]) => {
43
+ if (onChange) onChange(dates[0])
44
+ }}
45
+ onClose={(dates) => {
46
+ if (onChange) onChange(dates[0])
47
+ }}
45
48
  value={value || null}
46
49
  render={(
47
50
  props: Omit<DateTimePickerProps, 'options' | 'render'>,
@@ -50,6 +50,9 @@ export default function DateTimePicker({
50
50
  onChange={(dates: Date[]) => {
51
51
  if (onChange) onChange(dates[0])
52
52
  }}
53
+ onClose={(dates) => {
54
+ if (onChange) onChange(dates[0])
55
+ }}
53
56
  value={value || null}
54
57
  render={(
55
58
  props: Omit<DateTimePickerProps, 'options' | 'render'>,
@@ -40,6 +40,9 @@ export default function TimePicker({
40
40
  maxTime,
41
41
  allowInput: true,
42
42
  }}
43
+ onClose={(dates) => {
44
+ if (onChange) onChange(dates[0])
45
+ }}
43
46
  onChange={(dates: Date[]) => {
44
47
  if (onChange) onChange(dates[0])
45
48
  }}
@@ -98,13 +98,18 @@ export const CustomDialog = ({
98
98
  }: CustomDialogProps) => {
99
99
  return (
100
100
  <Dialog
101
- PaperProps={{ elevation: 2, sx: { borderRadius: '10px' } }}
101
+ PaperProps={{
102
+ ...dialogProps.PaperProps,
103
+ elevation: 2,
104
+ sx: { borderRadius: '10px' },
105
+ }}
102
106
  fullWidth
103
107
  onClose={onClose}
104
108
  open={open}
105
109
  transitionDuration={140}
106
110
  TransitionComponent={Transition}
107
111
  sx={{
112
+ ...dialogProps.sx,
108
113
  '& .MuiBackdrop-root': { backgroundColor: 'rgba(0, 0, 0, 0.4)' },
109
114
  }}
110
115
  {...dialogProps}
@@ -86,9 +86,11 @@ export const CustomDrawer = ({
86
86
  onClose={onClose}
87
87
  open={open}
88
88
  PaperProps={{
89
+ ...drawerProps.PaperProps,
89
90
  elevation: 2,
90
91
  }}
91
92
  sx={{
93
+ ...drawerProps.sx,
92
94
  zIndex: 500,
93
95
  '& .MuiDrawer-paper': {
94
96
  boxSizing: 'border-box',
@@ -28,6 +28,8 @@ import AsyncSearchSelect from './Input/AsyncSearchSelect'
28
28
  import FilterButton from './FilterComponents/FilterButton'
29
29
  import Helmet from './Layout/Helmet'
30
30
  import NavigationTabs from './Tabs/NavigationTabs'
31
+ import { CustomDialog } from './ModalButtons/DialogButton'
32
+ import { CustomDrawer } from './ModalButtons/DrawerButton'
31
33
  export { default as Image } from './Image'
32
34
  export { default as PageHeader } from './PageHeader'
33
35
  export { PageContent } from './PageContent'
@@ -84,6 +86,8 @@ export {
84
86
  FilterButton,
85
87
  Helmet,
86
88
  NavigationTabs,
89
+ CustomDialog,
90
+ CustomDrawer,
87
91
  }
88
92
 
89
93
  export * from './UploadButton/types'