@campxdev/shared 1.10.67 → 1.10.69
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 +7 -6
- package/src/components/FeeCard.tsx +132 -0
- package/src/components/LabelValue.tsx +17 -4
- package/src/components/Stepper.tsx +117 -0
- package/src/components/Tables/BasicTable/Table.tsx +48 -82
- package/src/components/Tables/BasicTable/interface.ts +19 -0
- package/src/components/Tables/BasicTable/styles.ts +105 -0
- package/src/components/Tabs/TabsContainer.tsx +0 -3
- package/src/components/Tabs/styles.tsx +16 -8
- package/src/components/index.ts +2 -0
- package/src/shared-state/PermissionsStore.ts +14 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/shared",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.69",
|
|
4
4
|
"main": "./exports.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
@@ -27,12 +27,13 @@
|
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@emotion/react": "^11.
|
|
31
|
-
"@emotion/styled": "^11.
|
|
30
|
+
"@emotion/react": "^11.11.1",
|
|
31
|
+
"@emotion/styled": "^11.11.0",
|
|
32
32
|
"@hookform/resolvers": "^2.9.10",
|
|
33
|
-
"@mui/icons-material": "^5.
|
|
34
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
35
|
-
"@mui/material": "^5.
|
|
33
|
+
"@mui/icons-material": "^5.14.11",
|
|
34
|
+
"@mui/lab": "^5.0.0-alpha.146",
|
|
35
|
+
"@mui/material": "^5.14.11",
|
|
36
|
+
"@mui/x-date-pickers": "^6.16.0",
|
|
36
37
|
"axios": "^0.27.2",
|
|
37
38
|
"date-fns": "^2.28.0",
|
|
38
39
|
"fuse.js": "^6.6.2",
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Box, Stack, Typography, styled } from '@mui/material'
|
|
2
|
+
import { useNavigate } from 'react-router-dom'
|
|
3
|
+
import LabelValue from './LabelValue'
|
|
4
|
+
|
|
5
|
+
const FeeCard = ({
|
|
6
|
+
title = null,
|
|
7
|
+
amount,
|
|
8
|
+
path = null,
|
|
9
|
+
yearRestricted = false,
|
|
10
|
+
cardHeight = '170px',
|
|
11
|
+
payButtonHeight = '50px',
|
|
12
|
+
isCardDue = false,
|
|
13
|
+
paymentPath = null,
|
|
14
|
+
image = null,
|
|
15
|
+
labelValue = 'Total due amount',
|
|
16
|
+
}) => {
|
|
17
|
+
const navigate = useNavigate()
|
|
18
|
+
|
|
19
|
+
const handleInformation = (path) => {
|
|
20
|
+
navigate(`${path}`)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const handleClick = (due) => {
|
|
24
|
+
if (!due) return
|
|
25
|
+
|
|
26
|
+
navigate(`${paymentPath}`)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<StyledYearCard isCardDue={isCardDue} height={cardHeight}>
|
|
31
|
+
<Box style={{ padding: '20px', width: '100%' }}>
|
|
32
|
+
{title && (
|
|
33
|
+
<Stack
|
|
34
|
+
alignItems={'center'}
|
|
35
|
+
direction={'row'}
|
|
36
|
+
justifyContent={'space-between'}
|
|
37
|
+
sx={{
|
|
38
|
+
paddingBottom: '18px',
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<Typography
|
|
42
|
+
variant="subtitle1"
|
|
43
|
+
sx={{ color: 'white', fontWeight: '600' }}
|
|
44
|
+
>
|
|
45
|
+
{title}
|
|
46
|
+
</Typography>
|
|
47
|
+
<img
|
|
48
|
+
style={{ height: '20px', width: '20px', cursor: 'pointer' }}
|
|
49
|
+
src={image}
|
|
50
|
+
onClick={() => handleInformation(path)}
|
|
51
|
+
/>
|
|
52
|
+
</Stack>
|
|
53
|
+
)}
|
|
54
|
+
|
|
55
|
+
<LabelValue
|
|
56
|
+
reverse
|
|
57
|
+
value={labelValue}
|
|
58
|
+
label={`${
|
|
59
|
+
amount > 0
|
|
60
|
+
? `${amount.toLocaleString('en-IN', {
|
|
61
|
+
style: 'currency',
|
|
62
|
+
currency: 'INR',
|
|
63
|
+
})}`
|
|
64
|
+
: 'NA'
|
|
65
|
+
}`}
|
|
66
|
+
labelsx={{
|
|
67
|
+
fontSize: '14px',
|
|
68
|
+
color: 'white',
|
|
69
|
+
fontWeight: '600',
|
|
70
|
+
}}
|
|
71
|
+
valuesx={{
|
|
72
|
+
fontSize: '12px',
|
|
73
|
+
color: 'white',
|
|
74
|
+
fontWeight: '400',
|
|
75
|
+
}}
|
|
76
|
+
sx={{ gap: '4px' }}
|
|
77
|
+
/>
|
|
78
|
+
</Box>
|
|
79
|
+
<StyledPayContainer
|
|
80
|
+
disabled={yearRestricted}
|
|
81
|
+
height={payButtonHeight}
|
|
82
|
+
onClick={() => handleClick(amount)}
|
|
83
|
+
>
|
|
84
|
+
<Typography
|
|
85
|
+
variant="subtitle1"
|
|
86
|
+
sx={{
|
|
87
|
+
color: 'white',
|
|
88
|
+
opacity: !yearRestricted ? 1 : 0.7,
|
|
89
|
+
fontWeight: '600',
|
|
90
|
+
padding: '12px',
|
|
91
|
+
cursor: !yearRestricted ? 'pointer' : 'initial',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{amount > 0 ? 'Pay' : 'View'}
|
|
95
|
+
</Typography>
|
|
96
|
+
</StyledPayContainer>
|
|
97
|
+
</StyledYearCard>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
export default FeeCard
|
|
101
|
+
|
|
102
|
+
const StyledYearCard = styled(Box, {
|
|
103
|
+
shouldForwardProp: (prop) => prop !== 'disabled',
|
|
104
|
+
})<{ isCardDue: boolean; height: string }>(({ theme, isCardDue, height }) => ({
|
|
105
|
+
display: 'flex',
|
|
106
|
+
flexDirection: 'column',
|
|
107
|
+
height: height ?? '170px',
|
|
108
|
+
alignItems: 'flex-start',
|
|
109
|
+
justifyContent: 'space-between',
|
|
110
|
+
backgroundImage: isCardDue
|
|
111
|
+
? 'linear-gradient(102deg, #C02633 0%, #A23B39 100%)'
|
|
112
|
+
: 'linear-gradient(102deg, #0093E9 0%, #0841AC 100%)',
|
|
113
|
+
borderRadius: '10px',
|
|
114
|
+
transition: 'background 0.2s ease-in-out, box-shadow 0.2s ease-in-out',
|
|
115
|
+
boxShadow: '0px 2px 10px #0000000F',
|
|
116
|
+
'& .MuiTypography-subtitle2': {
|
|
117
|
+
color: 'white',
|
|
118
|
+
opacity: 0.9,
|
|
119
|
+
},
|
|
120
|
+
}))
|
|
121
|
+
|
|
122
|
+
const StyledPayContainer = styled(Box, {
|
|
123
|
+
shouldForwardProp: (prop) => prop !== 'disabled',
|
|
124
|
+
})<{ disabled: boolean; height: string }>(({ theme, disabled, height }) => ({
|
|
125
|
+
width: '100%',
|
|
126
|
+
height: height,
|
|
127
|
+
backgroundColor: disabled ? '#333333' : '#121212',
|
|
128
|
+
borderRadius: '0px 0px 10px 10px',
|
|
129
|
+
display: 'flex',
|
|
130
|
+
justifyContent: 'center',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
}))
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Stack, Theme, Typography } from '@mui/material'
|
|
2
|
+
import { SxProps } from '@mui/system'
|
|
2
3
|
import { ReactNode } from 'react'
|
|
3
4
|
|
|
4
5
|
export default function LabelValue({
|
|
5
6
|
label,
|
|
6
7
|
value,
|
|
7
8
|
reverse = false,
|
|
9
|
+
labelsx,
|
|
10
|
+
valuesx,
|
|
11
|
+
sx,
|
|
8
12
|
}: {
|
|
9
13
|
label: string | ReactNode
|
|
10
14
|
value?: ReactNode
|
|
11
15
|
reverse?: boolean
|
|
16
|
+
labelsx?: SxProps<Theme>
|
|
17
|
+
valuesx?: SxProps<Theme>
|
|
18
|
+
sx?: SxProps<Theme>
|
|
12
19
|
}) {
|
|
13
20
|
return (
|
|
14
|
-
<Stack
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
<Stack
|
|
22
|
+
flexDirection={reverse ? 'column-reverse' : 'column'}
|
|
23
|
+
gap="6px"
|
|
24
|
+
sx={sx}
|
|
25
|
+
>
|
|
26
|
+
<Typography variant="subtitle2" sx={labelsx}>
|
|
27
|
+
{label}
|
|
28
|
+
</Typography>
|
|
29
|
+
<Typography paragraph fontWeight={600} sx={valuesx}>
|
|
17
30
|
{value ?? '-'}
|
|
18
31
|
</Typography>
|
|
19
32
|
</Stack>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import Check from '@mui/icons-material/Check'
|
|
2
|
+
import { StepContent } from '@mui/material'
|
|
3
|
+
import Stack from '@mui/material/Stack'
|
|
4
|
+
import Step from '@mui/material/Step'
|
|
5
|
+
import StepConnector, {
|
|
6
|
+
stepConnectorClasses,
|
|
7
|
+
} from '@mui/material/StepConnector'
|
|
8
|
+
import { StepIconProps } from '@mui/material/StepIcon'
|
|
9
|
+
import StepLabel from '@mui/material/StepLabel'
|
|
10
|
+
import Stepper from '@mui/material/Stepper'
|
|
11
|
+
import { styled } from '@mui/material/styles'
|
|
12
|
+
|
|
13
|
+
const QontoConnector = styled(StepConnector)(({ theme }) => ({
|
|
14
|
+
[`&.${stepConnectorClasses.alternativeLabel}`]: {
|
|
15
|
+
top: 10,
|
|
16
|
+
left: 'calc(-50% + 16px)',
|
|
17
|
+
right: 'calc(50% + 16px)',
|
|
18
|
+
},
|
|
19
|
+
[`&.${stepConnectorClasses.active}`]: {
|
|
20
|
+
[`& .${stepConnectorClasses.line}`]: {
|
|
21
|
+
borderColor: '#2975D0',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
[`&.${stepConnectorClasses.completed}`]: {
|
|
25
|
+
[`& .${stepConnectorClasses.line}`]: {
|
|
26
|
+
borderColor: '#2975D0',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
[`& .${stepConnectorClasses.line}`]: {
|
|
30
|
+
borderColor: '#d1d1d2',
|
|
31
|
+
borderTopWidth: 1,
|
|
32
|
+
borderRadius: 1,
|
|
33
|
+
},
|
|
34
|
+
}))
|
|
35
|
+
|
|
36
|
+
const ColorlibStepIconRoot = styled('div')<{
|
|
37
|
+
ownerState: { completed?: boolean; active?: boolean }
|
|
38
|
+
}>(({ theme, ownerState }) => ({
|
|
39
|
+
zIndex: 1,
|
|
40
|
+
color: '#fff',
|
|
41
|
+
width: 25,
|
|
42
|
+
height: 25,
|
|
43
|
+
display: 'flex',
|
|
44
|
+
borderRadius: '50%',
|
|
45
|
+
justifyContent: 'center',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
border: '1px solid #12121234',
|
|
48
|
+
...(ownerState.active && {
|
|
49
|
+
boxShadow: '0px 3px 25px #303E6334',
|
|
50
|
+
border: 'none',
|
|
51
|
+
'& .QontoStepIcon-circle': {
|
|
52
|
+
height: '10px',
|
|
53
|
+
width: '10px',
|
|
54
|
+
borderRadius: '50%',
|
|
55
|
+
background:
|
|
56
|
+
'transparent linear-gradient(180deg, #2522AF 0%, #2976D0 100%)',
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
...(ownerState.completed && {
|
|
60
|
+
background: 'transparent linear-gradient(180deg, #2522AF 0%, #2976D0 100%)',
|
|
61
|
+
'& .QontoStepIcon-completedIcon': {
|
|
62
|
+
height: '15px',
|
|
63
|
+
width: '15px',
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
}))
|
|
67
|
+
|
|
68
|
+
function ColorlibStepIcon(props: StepIconProps) {
|
|
69
|
+
const { active, completed, className } = props
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<ColorlibStepIconRoot
|
|
73
|
+
ownerState={{ completed, active }}
|
|
74
|
+
className={className}
|
|
75
|
+
>
|
|
76
|
+
{completed ? (
|
|
77
|
+
<Check className="QontoStepIcon-completedIcon" />
|
|
78
|
+
) : (
|
|
79
|
+
<div className="QontoStepIcon-circle" />
|
|
80
|
+
)}
|
|
81
|
+
</ColorlibStepIconRoot>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default function PaymentStepper({ steps, active }) {
|
|
86
|
+
return (
|
|
87
|
+
<Stack
|
|
88
|
+
sx={{
|
|
89
|
+
width: '100%',
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<Stepper
|
|
93
|
+
activeStep={active}
|
|
94
|
+
connector={<QontoConnector />}
|
|
95
|
+
sx={{
|
|
96
|
+
'& .MuiStep-root': {
|
|
97
|
+
padding: '0px',
|
|
98
|
+
},
|
|
99
|
+
'& .MuiStepLabel-root': {
|
|
100
|
+
display: 'flex',
|
|
101
|
+
flexDirection: 'column',
|
|
102
|
+
},
|
|
103
|
+
'& .MuiStep-root span': {
|
|
104
|
+
padding: '0px',
|
|
105
|
+
},
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
{steps.map((item, index) => (
|
|
109
|
+
<Step key={item.label}>
|
|
110
|
+
<StepLabel StepIconComponent={ColorlibStepIcon}></StepLabel>
|
|
111
|
+
<StepContent>{item.component} </StepContent>
|
|
112
|
+
</Step>
|
|
113
|
+
))}
|
|
114
|
+
</Stepper>
|
|
115
|
+
</Stack>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Box,
|
|
3
2
|
IconButton,
|
|
4
3
|
ListItemIcon,
|
|
5
|
-
Table as MuiTable,
|
|
6
4
|
TableBody,
|
|
7
|
-
TableCell,
|
|
8
|
-
TableContainer,
|
|
9
5
|
TableHead,
|
|
10
6
|
TableRow,
|
|
11
|
-
|
|
12
|
-
styled,
|
|
7
|
+
Theme,
|
|
13
8
|
} from '@mui/material'
|
|
9
|
+
import { SxProps } from '@mui/system'
|
|
14
10
|
import _ from 'lodash'
|
|
15
11
|
import { useEffect, useState } from 'react'
|
|
16
12
|
import Spinner from '../../Spinner'
|
|
17
13
|
import NoRecordsFound from '../common/NoRecordsFound'
|
|
18
14
|
import { SortAscIcon, SortDescIcon, SortIcon } from '../common/icons'
|
|
19
15
|
import TableFooter from './TableFooter'
|
|
16
|
+
import {
|
|
17
|
+
StyledMuiTable,
|
|
18
|
+
StyledTableCell,
|
|
19
|
+
StyledTableContainer,
|
|
20
|
+
StyledTableRow,
|
|
21
|
+
} from './styles'
|
|
20
22
|
|
|
21
23
|
type Order = 'asc' | 'desc' | ''
|
|
22
24
|
type Sort = {}
|
|
23
25
|
type DataType = 'currency' | 'string' | 'number'
|
|
24
|
-
export interface
|
|
26
|
+
export interface TableColumn {
|
|
25
27
|
dataIndex: string
|
|
26
28
|
key: string
|
|
27
29
|
title: any
|
|
@@ -32,7 +34,7 @@ export interface ColumnProps {
|
|
|
32
34
|
dataType?: DataType
|
|
33
35
|
}
|
|
34
36
|
interface TableProps {
|
|
35
|
-
columns: Array<
|
|
37
|
+
columns: Array<TableColumn>
|
|
36
38
|
rowKey?: string
|
|
37
39
|
dataSource?: any[]
|
|
38
40
|
loading?: boolean
|
|
@@ -47,7 +49,9 @@ interface TableProps {
|
|
|
47
49
|
onSort?: (sort: any) => void
|
|
48
50
|
dense?: boolean
|
|
49
51
|
showTotal?: boolean
|
|
50
|
-
|
|
52
|
+
sx?: Record<string, SxProps<Theme>>
|
|
53
|
+
totalColumns?: number[]
|
|
54
|
+
showTotalInFirstCellOfTotalRow?: boolean
|
|
51
55
|
}
|
|
52
56
|
export default function Table({
|
|
53
57
|
columns,
|
|
@@ -58,10 +62,18 @@ export default function Table({
|
|
|
58
62
|
onSort,
|
|
59
63
|
dense = false,
|
|
60
64
|
showTotal = false,
|
|
61
|
-
|
|
65
|
+
sx,
|
|
66
|
+
totalColumns,
|
|
67
|
+
showTotalInFirstCellOfTotalRow,
|
|
62
68
|
}: TableProps) {
|
|
63
69
|
const [sort, setSort] = useState<Sort>({})
|
|
64
70
|
let totalCount = []
|
|
71
|
+
let totalCols = []
|
|
72
|
+
if (showTotalInFirstCellOfTotalRow) {
|
|
73
|
+
totalCols = totalColumns ? [...totalColumns, 1] : [1]
|
|
74
|
+
} else {
|
|
75
|
+
totalCols = totalColumns ? [...totalColumns] : []
|
|
76
|
+
}
|
|
65
77
|
|
|
66
78
|
const handleSortClick = (sortBykey) => {
|
|
67
79
|
setSort((prev) => {
|
|
@@ -101,7 +113,7 @@ export default function Table({
|
|
|
101
113
|
totalCount[colIndex] = 0
|
|
102
114
|
}
|
|
103
115
|
|
|
104
|
-
if (colIndex === 0) {
|
|
116
|
+
if (showTotalInFirstCellOfTotalRow && colIndex === 0) {
|
|
105
117
|
totalCount[colIndex] = 'Total'
|
|
106
118
|
return
|
|
107
119
|
}
|
|
@@ -118,22 +130,23 @@ export default function Table({
|
|
|
118
130
|
}
|
|
119
131
|
|
|
120
132
|
return (
|
|
121
|
-
<StyledTableContainer
|
|
133
|
+
<StyledTableContainer sx={sx}>
|
|
122
134
|
<>
|
|
123
|
-
<StyledMuiTable
|
|
135
|
+
<StyledMuiTable sx={sx}>
|
|
124
136
|
<TableHead>
|
|
125
137
|
<TableRow>
|
|
126
|
-
{columns.map((col,
|
|
138
|
+
{columns.map((col, columnIndex) => (
|
|
127
139
|
<StyledTableCell
|
|
128
|
-
key={
|
|
129
|
-
isMobile={isMobile}
|
|
140
|
+
key={columnIndex}
|
|
130
141
|
columnsLength={columns.length}
|
|
131
|
-
|
|
142
|
+
columnIndex={columnIndex + 1}
|
|
143
|
+
rowIndex={0}
|
|
132
144
|
col={col}
|
|
145
|
+
sx={sx}
|
|
146
|
+
isHeaderCell
|
|
133
147
|
>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
</Box>
|
|
148
|
+
{col.title}
|
|
149
|
+
|
|
137
150
|
{col.sort && (
|
|
138
151
|
<IconButton onClick={() => handleSortClick(col.dataIndex)}>
|
|
139
152
|
<ListItemIcon>
|
|
@@ -168,16 +181,12 @@ export default function Table({
|
|
|
168
181
|
{columns.map((col, colIndex) => (
|
|
169
182
|
<StyledTableCell
|
|
170
183
|
key={colIndex}
|
|
171
|
-
isMobile={isMobile}
|
|
172
184
|
columnsLength={columns.length}
|
|
173
|
-
|
|
185
|
+
columnIndex={colIndex + 1}
|
|
186
|
+
rowIndex={rowIndex + 1}
|
|
174
187
|
col={col}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
padding: dense ? '10px' : '15px',
|
|
178
|
-
font: 'avenir',
|
|
179
|
-
fontSize: '14px',
|
|
180
|
-
}}
|
|
188
|
+
isBodyCell
|
|
189
|
+
sx={sx}
|
|
181
190
|
>
|
|
182
191
|
{col?.dataType && col?.dataType == 'currency' ? (
|
|
183
192
|
<>{convertToAmount(row[col.dataIndex])}</>
|
|
@@ -199,22 +208,21 @@ export default function Table({
|
|
|
199
208
|
<>
|
|
200
209
|
<StyledTableCell
|
|
201
210
|
key={colIndex}
|
|
202
|
-
isMobile={isMobile}
|
|
203
211
|
columnsLength={columns.length}
|
|
204
|
-
|
|
212
|
+
columnIndex={colIndex + 1}
|
|
213
|
+
rowIndex={dataSource.length + 1}
|
|
205
214
|
col={col}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
padding: dense ? '10px' : '15px',
|
|
209
|
-
font: 'avenir',
|
|
210
|
-
fontSize: '14px',
|
|
211
|
-
fontWeight: '600',
|
|
212
|
-
}}
|
|
215
|
+
isBodyCell
|
|
216
|
+
sx={sx}
|
|
213
217
|
>
|
|
214
|
-
{
|
|
215
|
-
|
|
218
|
+
{totalCols.includes(colIndex + 1) ? (
|
|
219
|
+
col?.dataType && col?.dataType == 'currency' ? (
|
|
220
|
+
<>{convertToAmount(totalCount[colIndex])}</>
|
|
221
|
+
) : (
|
|
222
|
+
<>{totalCount[colIndex]}</>
|
|
223
|
+
)
|
|
216
224
|
) : (
|
|
217
|
-
|
|
225
|
+
'---'
|
|
218
226
|
)}
|
|
219
227
|
</StyledTableCell>
|
|
220
228
|
</>
|
|
@@ -247,45 +255,3 @@ export default function Table({
|
|
|
247
255
|
</StyledTableContainer>
|
|
248
256
|
)
|
|
249
257
|
}
|
|
250
|
-
|
|
251
|
-
const StyledTableContainer = styled(TableContainer)<{ isMobile: boolean }>(
|
|
252
|
-
({ theme, isMobile }) => ({
|
|
253
|
-
width: '100%',
|
|
254
|
-
overflowX: 'auto',
|
|
255
|
-
borderRadius: isMobile ? '10px 10px 10px 10px' : 'none',
|
|
256
|
-
border: isMobile ? '1px solid #1212121A' : 'none',
|
|
257
|
-
}),
|
|
258
|
-
)
|
|
259
|
-
|
|
260
|
-
const StyledTableCell = styled(TableCell)<{
|
|
261
|
-
isMobile: boolean
|
|
262
|
-
columnsLength: number
|
|
263
|
-
index: number
|
|
264
|
-
col: any
|
|
265
|
-
sx?: any
|
|
266
|
-
}>(({ theme, isMobile, columnsLength, index, col, sx }) => ({
|
|
267
|
-
...(col?.width && {
|
|
268
|
-
width: col?.width,
|
|
269
|
-
}),
|
|
270
|
-
borderRightColor:
|
|
271
|
-
isMobile && columnsLength - 1 !== index ? '#1212121A' : 'none',
|
|
272
|
-
borderRightStyle: isMobile && columnsLength - 1 !== index ? 'solid' : 'none',
|
|
273
|
-
...sx,
|
|
274
|
-
}))
|
|
275
|
-
|
|
276
|
-
const StyledMuiTable = styled(MuiTable)<{ isMobile: boolean }>(
|
|
277
|
-
({ theme, isMobile }) => ({
|
|
278
|
-
border: isMobile ? 'none' : '1px solid #1212121A',
|
|
279
|
-
}),
|
|
280
|
-
)
|
|
281
|
-
|
|
282
|
-
const StyledTableRow = styled(TableRow, {
|
|
283
|
-
shouldForwardProp: (prop) => prop !== 'canRowClick',
|
|
284
|
-
})<{ canRowClick: boolean }>(({ canRowClick }) => ({
|
|
285
|
-
...(canRowClick && {
|
|
286
|
-
cursor: 'pointer',
|
|
287
|
-
'&.MuiTableRow-hover:hover': {
|
|
288
|
-
backgroundColor: alpha('#f2f2f2', 0.4),
|
|
289
|
-
},
|
|
290
|
-
}),
|
|
291
|
-
}))
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Theme } from '@mui/material'
|
|
2
|
+
import { SxProps } from '@mui/system'
|
|
3
|
+
|
|
4
|
+
export interface StyledCellProps {
|
|
5
|
+
columnsLength: number
|
|
6
|
+
columnIndex: number
|
|
7
|
+
rowIndex: number
|
|
8
|
+
col: any
|
|
9
|
+
sx?: Record<string, SxProps<Theme>>
|
|
10
|
+
isBodyCell?: boolean
|
|
11
|
+
isHeaderCell?: boolean
|
|
12
|
+
}
|
|
13
|
+
export interface StyledTableContainerProps {
|
|
14
|
+
sx?: Record<string, SxProps<Theme>>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface StyledMuiTableProps {
|
|
18
|
+
sx?: Record<string, SxProps<Theme>>
|
|
19
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import styled, { CSSObject } from '@emotion/styled'
|
|
2
|
+
import {
|
|
3
|
+
Table,
|
|
4
|
+
TableCell,
|
|
5
|
+
TableContainer,
|
|
6
|
+
TableRow,
|
|
7
|
+
Theme,
|
|
8
|
+
alpha,
|
|
9
|
+
} from '@mui/material'
|
|
10
|
+
import { SxProps } from '@mui/system'
|
|
11
|
+
import _ from 'lodash'
|
|
12
|
+
import {
|
|
13
|
+
StyledCellProps,
|
|
14
|
+
StyledMuiTableProps,
|
|
15
|
+
StyledTableContainerProps,
|
|
16
|
+
} from './interface'
|
|
17
|
+
|
|
18
|
+
export const StyledTableCell = styled(TableCell)<StyledCellProps>(
|
|
19
|
+
({
|
|
20
|
+
theme,
|
|
21
|
+
columnsLength,
|
|
22
|
+
columnIndex,
|
|
23
|
+
rowIndex,
|
|
24
|
+
col,
|
|
25
|
+
sx,
|
|
26
|
+
isBodyCell = false,
|
|
27
|
+
isHeaderCell = false,
|
|
28
|
+
}) => {
|
|
29
|
+
const { rowkey, columnKey, cellKey, allKey } = getSxKeys(
|
|
30
|
+
rowIndex,
|
|
31
|
+
columnIndex,
|
|
32
|
+
)
|
|
33
|
+
const rowSx: SxProps<Theme> = _.get(sx, rowkey)
|
|
34
|
+
const columnSx: SxProps<Theme> = _.get(sx, columnKey)
|
|
35
|
+
const cellSx: SxProps<Theme> = _.get(sx, cellKey)
|
|
36
|
+
const allSx: SxProps<Theme> = _.get(sx, allKey)
|
|
37
|
+
return {
|
|
38
|
+
...(col?.width && {
|
|
39
|
+
width: col?.width,
|
|
40
|
+
}),
|
|
41
|
+
['@media(max-width: 680px)']: {
|
|
42
|
+
borderRightColor:
|
|
43
|
+
columnsLength - 1 !== columnIndex ? '#1212121A' : 'none',
|
|
44
|
+
borderRightStyle: columnsLength - 1 !== columnIndex ? 'solid' : 'none',
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
...(isBodyCell && {
|
|
48
|
+
color: col.textColor,
|
|
49
|
+
padding: '15px',
|
|
50
|
+
font: 'avenir',
|
|
51
|
+
fontSize: '14px',
|
|
52
|
+
}),
|
|
53
|
+
...(isHeaderCell && {
|
|
54
|
+
fontWeight: 600,
|
|
55
|
+
fontSize: '14px',
|
|
56
|
+
}),
|
|
57
|
+
|
|
58
|
+
...columnSx,
|
|
59
|
+
...rowSx,
|
|
60
|
+
...cellSx,
|
|
61
|
+
...allSx,
|
|
62
|
+
} as CSSObject
|
|
63
|
+
},
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
export const StyledMuiTable = styled(Table)<StyledMuiTableProps>(
|
|
67
|
+
({ theme, sx }) => {
|
|
68
|
+
const containerSx: SxProps<Theme> = _.get(sx, 'MuiTable')
|
|
69
|
+
return {
|
|
70
|
+
...containerSx,
|
|
71
|
+
} as CSSObject
|
|
72
|
+
},
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
export const StyledTableRow = styled(TableRow, {
|
|
76
|
+
shouldForwardProp: (prop) => prop !== 'canRowClick',
|
|
77
|
+
})<{ canRowClick: boolean }>(({ canRowClick }) => ({
|
|
78
|
+
...(canRowClick && {
|
|
79
|
+
cursor: 'pointer',
|
|
80
|
+
'&.MuiTableRow-hover:hover': {
|
|
81
|
+
backgroundColor: alpha('#f2f2f2', 0.4),
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
}))
|
|
85
|
+
|
|
86
|
+
export const StyledTableContainer = styled(
|
|
87
|
+
TableContainer,
|
|
88
|
+
)<StyledTableContainerProps>(({ theme, sx }) => {
|
|
89
|
+
const containerSx: SxProps<Theme> = _.get(sx, 'TableContainer')
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
width: '100%',
|
|
93
|
+
overflowX: 'auto',
|
|
94
|
+
...containerSx,
|
|
95
|
+
} as CSSObject
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const getSxKeys = (rowIndex, columnIndex) => {
|
|
99
|
+
return {
|
|
100
|
+
rowkey: `row:${rowIndex}`,
|
|
101
|
+
columnKey: `column:${columnIndex}`,
|
|
102
|
+
cellKey: `row:${rowIndex},column:${columnIndex}`,
|
|
103
|
+
allKey: 'Tablecell',
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -13,7 +13,6 @@ export interface TabsContainerProps {
|
|
|
13
13
|
size?: 'small' | 'medium'
|
|
14
14
|
containerVariant?: 'box' | 'page'
|
|
15
15
|
onTabChange?: (tabKey: string) => void
|
|
16
|
-
isMobile?: boolean
|
|
17
16
|
tabUnderlineColor?: string
|
|
18
17
|
tabMobileUnderlineColor?: string
|
|
19
18
|
}
|
|
@@ -22,7 +21,6 @@ export default function TabsContainer({
|
|
|
22
21
|
tabs,
|
|
23
22
|
size = 'small',
|
|
24
23
|
containerVariant = 'box',
|
|
25
|
-
isMobile = false,
|
|
26
24
|
onTabChange,
|
|
27
25
|
tabUnderlineColor,
|
|
28
26
|
tabMobileUnderlineColor,
|
|
@@ -48,7 +46,6 @@ export default function TabsContainer({
|
|
|
48
46
|
scrollButtons="auto"
|
|
49
47
|
textColor="primary"
|
|
50
48
|
indicatorColor="primary"
|
|
51
|
-
isMobile={isMobile}
|
|
52
49
|
underlineColor={tabUnderlineColor}
|
|
53
50
|
mobileUnderlineColor={tabMobileUnderlineColor}
|
|
54
51
|
>
|
|
@@ -3,7 +3,6 @@ import { Box, Stack, styled, Tabs } from '@mui/material'
|
|
|
3
3
|
interface StyledTabsProps {
|
|
4
4
|
size: 'small' | 'medium'
|
|
5
5
|
containerVariant?: 'page' | 'box'
|
|
6
|
-
isMobile?: false | true
|
|
7
6
|
underlineColor?: string
|
|
8
7
|
mobileUnderlineColor?: string
|
|
9
8
|
}
|
|
@@ -13,19 +12,22 @@ export const StyledTabs = styled(Tabs)<StyledTabsProps>(
|
|
|
13
12
|
theme,
|
|
14
13
|
size,
|
|
15
14
|
containerVariant,
|
|
16
|
-
isMobile,
|
|
17
15
|
underlineColor,
|
|
18
16
|
mobileUnderlineColor,
|
|
19
17
|
}) => ({
|
|
20
18
|
borderTopRightRadius: '10px',
|
|
21
19
|
borderTopLeftRadius: '10px',
|
|
22
20
|
background: theme.palette.secondary.light,
|
|
23
|
-
minHeight:
|
|
21
|
+
minHeight: '60px',
|
|
22
|
+
['@media(max-width: 680px)']: {
|
|
23
|
+
minHeight: '30px',
|
|
24
|
+
},
|
|
24
25
|
paddingLeft: '15px',
|
|
25
26
|
'& .MuiTabs-indicator': {
|
|
26
|
-
backgroundColor:
|
|
27
|
-
|
|
28
|
-
:
|
|
27
|
+
backgroundColor: underlineColor ?? theme.palette.common.yellow,
|
|
28
|
+
['@media(max-width: 680px)']: {
|
|
29
|
+
backgroundColor: mobileUnderlineColor,
|
|
30
|
+
},
|
|
29
31
|
},
|
|
30
32
|
'& span': {
|
|
31
33
|
color: theme.palette.error.main,
|
|
@@ -36,7 +38,10 @@ export const StyledTabs = styled(Tabs)<StyledTabsProps>(
|
|
|
36
38
|
'& .MuiTabs-flexContainer': {
|
|
37
39
|
height: '100%',
|
|
38
40
|
alignItems: 'end',
|
|
39
|
-
justifyContent:
|
|
41
|
+
justifyContent: 'flex-start',
|
|
42
|
+
['@media(max-width: 680px)']: {
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
},
|
|
40
45
|
},
|
|
41
46
|
'& .MuiTab-root': {
|
|
42
47
|
textTransform: 'none',
|
|
@@ -45,7 +50,10 @@ export const StyledTabs = styled(Tabs)<StyledTabsProps>(
|
|
|
45
50
|
paddingBottom: '8px',
|
|
46
51
|
minHeight: 0,
|
|
47
52
|
fontSize: size === 'medium' ? '16px' : '14px',
|
|
48
|
-
fontWeight:
|
|
53
|
+
fontWeight: '600',
|
|
54
|
+
['@media(max-width: 680px)']: {
|
|
55
|
+
fontWeight: '500',
|
|
56
|
+
},
|
|
49
57
|
},
|
|
50
58
|
'& .MuiTab-root.Mui-selected': {
|
|
51
59
|
color: theme.palette.secondary.main,
|
package/src/components/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ export { default as Card } from './Card'
|
|
|
46
46
|
export { default as CardsGrid } from './CardsGrid'
|
|
47
47
|
export { default as DividerHeading } from './DividerHeading'
|
|
48
48
|
export { default as DropDownButton } from './DropDownButton'
|
|
49
|
+
export { default as FeeCard } from './FeeCard'
|
|
49
50
|
export { default as Image } from './Image'
|
|
50
51
|
export { default as JsonPreview } from './JsonPreview'
|
|
51
52
|
export { default as LabelValue } from './LabelValue'
|
|
@@ -57,6 +58,7 @@ export { default as PageHeader } from './PageHeader'
|
|
|
57
58
|
export { default as useConfirm } from './PopupConfirm/useConfirm'
|
|
58
59
|
export { default as ReportPageHeader } from './ReportPageHeader'
|
|
59
60
|
export { default as Spinner } from './Spinner'
|
|
61
|
+
export { default as PaymentStepper } from './Stepper'
|
|
60
62
|
export { default as SwitchButton } from './SwitchButton'
|
|
61
63
|
export { default as Table } from './Tables/BasicTable'
|
|
62
64
|
export { default as TableFooter } from './Tables/BasicTable/TableFooter'
|
|
@@ -749,13 +749,17 @@ export enum Permission {
|
|
|
749
749
|
STUDENTS_ALLOTMENT = 'can_students_allotment',
|
|
750
750
|
STUDENT_INFO_VIEW = 'can_student_info_view',
|
|
751
751
|
|
|
752
|
-
//
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
752
|
+
// Student Certificate
|
|
753
|
+
CAN_STUDENT_CERTIFICATES_VIEW = 'can_student_certificates_view',
|
|
754
|
+
CAN_STUDENT_CERTIFICATES_EDIT = 'can_student_certificates_edit',
|
|
755
|
+
CAN_STUDENT_CERTIFICATES_DELETE = 'can_student_certificates_delete',
|
|
756
|
+
CAN_STUDENT_CERTIFICATES_ADD = 'can_student_certificates_add',
|
|
758
757
|
|
|
758
|
+
//EmailReportCronJobs
|
|
759
|
+
EMAIL_REPORT_CRON_JOBS_VIEW = 'can_email_report_cron_jobs_view',
|
|
760
|
+
EMAIL_REPORT_CRON_JOBS_ADD = 'can_email_report_cron_jobs_add',
|
|
761
|
+
EMAIL_REPORT_CRON_JOBS_EDIT = 'can_email_report_cron_jobs_edit',
|
|
762
|
+
EMAIL_REPORT_CRON_JOBS_DELETE = 'can_email_report_cron_jobs_delete',
|
|
759
763
|
|
|
760
764
|
// Subjects
|
|
761
765
|
SUBJECTS_VIEW = 'can_subjects_view',
|
|
@@ -793,6 +797,10 @@ export enum Permission {
|
|
|
793
797
|
CAN_CLASSROOM_SESSION_EDIT = 'can_classroom_session_edit',
|
|
794
798
|
CAN_CLASSROOM_SESSION_DELETE = 'can_classroom_session_delete',
|
|
795
799
|
|
|
800
|
+
CAN_CLASSROOM_SUBJECT_ASSESSMENT_CREATE = 'can_classroom_subject_assessment_create',
|
|
801
|
+
CAN_CLASSROOM_SUBJECT_ASSESSMENT_DELETE = 'can_classroom_subject_assessment_delete',
|
|
802
|
+
CAN_CLASSROOM_SUBJECT_ASSESSMENT_LINK_EXAM = 'can_classroom_subject_assessment_link_exam',
|
|
803
|
+
|
|
796
804
|
// Institution
|
|
797
805
|
CAN_INSTITUTION_VIEW = 'can_institutions_view',
|
|
798
806
|
CAN_INSTITUTION_EDIT = 'can_institutions_edit',
|