@campxdev/shared 1.6.4 → 1.6.6
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,7 +1,6 @@
|
|
|
1
1
|
import { Delete } from '@mui/icons-material'
|
|
2
2
|
import { Box, IconButton, styled, Typography, Stack } from '@mui/material'
|
|
3
3
|
import Image from '../Image'
|
|
4
|
-
// import { Media } from 'components/UploadButton/UploadButton'
|
|
5
4
|
|
|
6
5
|
interface MediaRowProps {
|
|
7
6
|
list: any[]
|
|
@@ -9,17 +8,16 @@ interface MediaRowProps {
|
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export default function MediaRow({ list, onDelete }: MediaRowProps) {
|
|
12
|
-
console.log(list, 'list')
|
|
13
11
|
return (
|
|
14
12
|
<Box sx={{ display: 'flex', gap: '1rem', width: '100%', flexWrap: 'wrap' }}>
|
|
15
13
|
{list.map((item, index) => (
|
|
16
|
-
<>{
|
|
14
|
+
<>{renderMediaCard(item, onDelete)}</>
|
|
17
15
|
))}
|
|
18
16
|
</Box>
|
|
19
17
|
)
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
const
|
|
20
|
+
const renderMediaCard = (item: any, onDelete?: (mediaKey: string) => void) => {
|
|
23
21
|
switch (item?.type) {
|
|
24
22
|
case 'image':
|
|
25
23
|
return (
|
package/src/components/index.ts
CHANGED
|
@@ -36,7 +36,6 @@ export { default as Breadcrumbs } from './Breadcrumbs'
|
|
|
36
36
|
export { default as Table } from './TableComponent'
|
|
37
37
|
export { default as Spinner } from './Spinner'
|
|
38
38
|
export { default as AutocompleteSearch } from './AutocompleteSearch'
|
|
39
|
-
export { FullCalendarWrapper } from './FullCalendar/FullCalendarWrapper'
|
|
40
39
|
export { default as JsonPreview } from './JsonPreview'
|
|
41
40
|
export { default as LabelValue } from './LabelValue'
|
|
42
41
|
export { LinearProgress } from './LinearProgress'
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import type { ElementType, FC, ReactNode } from 'react'
|
|
2
|
-
import { format } from 'date-fns'
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
import { Grid, IconButton, Tooltip, Typography } from '@mui/material'
|
|
5
|
-
|
|
6
|
-
import ViewAgendaTwoToneIcon from '@mui/icons-material/ViewAgendaTwoTone'
|
|
7
|
-
|
|
8
|
-
import ViewDayTwoToneIcon from '@mui/icons-material/ViewDayTwoTone'
|
|
9
|
-
import CalendarViewMonthTwoToneIcon from '@mui/icons-material/CalendarViewMonthTwoTone'
|
|
10
|
-
import ViewWeekTwoToneIcon from '@mui/icons-material/ViewWeekTwoTone'
|
|
11
|
-
import TodayTwoToneIcon from '@mui/icons-material/TodayTwoTone'
|
|
12
|
-
import ArrowForwardTwoToneIcon from '@mui/icons-material/ArrowForwardTwoTone'
|
|
13
|
-
import ArrowBackTwoToneIcon from '@mui/icons-material/ArrowBackTwoTone'
|
|
14
|
-
|
|
15
|
-
export type View = 'dayGridMonth' | 'timeGridWeek' | 'timeGridDay' | 'listWeek'
|
|
16
|
-
|
|
17
|
-
interface ActionsProps {
|
|
18
|
-
children?: ReactNode
|
|
19
|
-
className?: string
|
|
20
|
-
date: Date
|
|
21
|
-
onNext?: () => void
|
|
22
|
-
onPrevious?: () => void
|
|
23
|
-
onToday?: () => void
|
|
24
|
-
handleCreateEvent?: () => void
|
|
25
|
-
changeView?: (view: View) => void
|
|
26
|
-
view: View
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface ViewOption {
|
|
30
|
-
label: string
|
|
31
|
-
value: View
|
|
32
|
-
icon: ElementType
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const viewOptions: ViewOption[] = [
|
|
36
|
-
{
|
|
37
|
-
label: 'Month',
|
|
38
|
-
value: 'dayGridMonth',
|
|
39
|
-
icon: CalendarViewMonthTwoToneIcon,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
label: 'Week',
|
|
43
|
-
value: 'timeGridWeek',
|
|
44
|
-
icon: ViewWeekTwoToneIcon,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: 'Day',
|
|
48
|
-
value: 'timeGridDay',
|
|
49
|
-
icon: ViewDayTwoToneIcon,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: 'Agenda',
|
|
53
|
-
value: 'listWeek',
|
|
54
|
-
icon: ViewAgendaTwoToneIcon,
|
|
55
|
-
},
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
const Actions: FC<ActionsProps> = ({
|
|
59
|
-
date,
|
|
60
|
-
onNext,
|
|
61
|
-
onPrevious,
|
|
62
|
-
onToday,
|
|
63
|
-
changeView,
|
|
64
|
-
view,
|
|
65
|
-
}) => {
|
|
66
|
-
return (
|
|
67
|
-
<Grid
|
|
68
|
-
container
|
|
69
|
-
spacing={3}
|
|
70
|
-
alignItems="center"
|
|
71
|
-
justifyContent="space-between"
|
|
72
|
-
marginBottom={'20px'}
|
|
73
|
-
>
|
|
74
|
-
<Grid item>
|
|
75
|
-
{/* <Tooltip arrow placement="top" title={'Previous Day'}>
|
|
76
|
-
<IconButton color="primary" onClick={onPrevious}>
|
|
77
|
-
<ArrowBackTwoToneIcon />
|
|
78
|
-
</IconButton>
|
|
79
|
-
</Tooltip>
|
|
80
|
-
<Tooltip arrow placement="top" title={'Today'}>
|
|
81
|
-
<IconButton
|
|
82
|
-
color="primary"
|
|
83
|
-
sx={{
|
|
84
|
-
mx: 1,
|
|
85
|
-
}}
|
|
86
|
-
onClick={onToday}
|
|
87
|
-
>
|
|
88
|
-
<TodayTwoToneIcon />
|
|
89
|
-
</IconButton>
|
|
90
|
-
</Tooltip>
|
|
91
|
-
<Tooltip arrow placement="top" title={'Next Day'}>
|
|
92
|
-
<IconButton color="primary" onClick={onNext}>
|
|
93
|
-
<ArrowForwardTwoToneIcon />
|
|
94
|
-
</IconButton>
|
|
95
|
-
</Tooltip> */}
|
|
96
|
-
</Grid>
|
|
97
|
-
<Grid
|
|
98
|
-
item
|
|
99
|
-
sx={{
|
|
100
|
-
display: { xs: 'none', sm: 'inline-block' },
|
|
101
|
-
}}
|
|
102
|
-
>
|
|
103
|
-
<Typography variant="h3" color="text.primary">
|
|
104
|
-
{format(date, 'MMMM yyyy')}
|
|
105
|
-
</Typography>
|
|
106
|
-
</Grid>
|
|
107
|
-
<Grid
|
|
108
|
-
item
|
|
109
|
-
sx={{
|
|
110
|
-
display: { xs: 'none', sm: 'inline-block' },
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
{viewOptions.map((viewOption) => {
|
|
114
|
-
const Icon = viewOption.icon
|
|
115
|
-
|
|
116
|
-
return (
|
|
117
|
-
<Tooltip
|
|
118
|
-
key={viewOption.value}
|
|
119
|
-
arrow
|
|
120
|
-
placement="top"
|
|
121
|
-
title={viewOption.label}
|
|
122
|
-
>
|
|
123
|
-
<IconButton
|
|
124
|
-
color={viewOption.value === view ? 'primary' : 'secondary'}
|
|
125
|
-
onClick={() => changeView(viewOption.value)}
|
|
126
|
-
>
|
|
127
|
-
<Icon />
|
|
128
|
-
</IconButton>
|
|
129
|
-
</Tooltip>
|
|
130
|
-
)
|
|
131
|
-
})}
|
|
132
|
-
</Grid>
|
|
133
|
-
</Grid>
|
|
134
|
-
)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
Actions.propTypes = {
|
|
138
|
-
children: PropTypes.node,
|
|
139
|
-
className: PropTypes.string,
|
|
140
|
-
date: PropTypes.instanceOf(Date).isRequired,
|
|
141
|
-
onNext: PropTypes.func,
|
|
142
|
-
onPrevious: PropTypes.func,
|
|
143
|
-
onToday: PropTypes.func,
|
|
144
|
-
handleCreateEvent: PropTypes.func,
|
|
145
|
-
changeView: PropTypes.func,
|
|
146
|
-
view: PropTypes.oneOf([
|
|
147
|
-
'dayGridMonth',
|
|
148
|
-
'timeGridWeek',
|
|
149
|
-
'timeGridDay',
|
|
150
|
-
'listWeek',
|
|
151
|
-
]),
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
Actions.defaultProps = {
|
|
155
|
-
onNext: () => {},
|
|
156
|
-
onPrevious: () => {},
|
|
157
|
-
onToday: () => {},
|
|
158
|
-
handleCreateEvent: () => {},
|
|
159
|
-
changeView: () => {},
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export default Actions
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { alpha, Box, styled } from '@mui/material'
|
|
2
|
-
|
|
3
|
-
export const FullCalendarWrapper = styled(Box)(({ theme }) => ({
|
|
4
|
-
'& colgroup': {
|
|
5
|
-
'& col': {
|
|
6
|
-
minWidth: '120px',
|
|
7
|
-
},
|
|
8
|
-
},
|
|
9
|
-
'.fc .fc-timegrid-axis-cushion': {
|
|
10
|
-
maxWidth: 'unset',
|
|
11
|
-
},
|
|
12
|
-
'.fc .fc-timegrid-axis-frame': {
|
|
13
|
-
justifyContent: 'flex-start',
|
|
14
|
-
},
|
|
15
|
-
'.fc-direction-ltr .fc-timegrid-slot-label-frame': {
|
|
16
|
-
textAlign: 'left',
|
|
17
|
-
},
|
|
18
|
-
'.fc .fc-timegrid-divider': {
|
|
19
|
-
padding: 0,
|
|
20
|
-
},
|
|
21
|
-
'.fc .fc-timegrid-slot-minor': {
|
|
22
|
-
borderTop: 'none',
|
|
23
|
-
},
|
|
24
|
-
'& thead': {
|
|
25
|
-
'& th': {
|
|
26
|
-
verticalAlign: 'bottom',
|
|
27
|
-
},
|
|
28
|
-
height: '60px',
|
|
29
|
-
'& *': {
|
|
30
|
-
color: theme.palette.secondary.main,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
'& .fc .fc-timegrid-slot': {
|
|
34
|
-
height: '84px',
|
|
35
|
-
},
|
|
36
|
-
'& .fc-v-event, & .fc-h-event': {
|
|
37
|
-
border: 'none',
|
|
38
|
-
padding: '2px 5px',
|
|
39
|
-
},
|
|
40
|
-
'& .fc .fc-timegrid-col.fc-day-today': {
|
|
41
|
-
backgroundColor: 'white',
|
|
42
|
-
},
|
|
43
|
-
'& .fc-daygrid-day-top': {
|
|
44
|
-
'& a': {
|
|
45
|
-
color: theme.palette.text.primary,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
'& .fc-day-disabled': {
|
|
49
|
-
background: 'rgba(0, 0, 0, 0.02)',
|
|
50
|
-
},
|
|
51
|
-
'& .fc-daygrid-event .fc-event-time': {
|
|
52
|
-
display: 'none',
|
|
53
|
-
},
|
|
54
|
-
}))
|