goobs-frontend 0.8.6 → 0.8.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 +18 -18
- package/src/components/ConfirmationCodeInput/index.tsx +120 -46
- package/src/components/Content/Structure/phoneNumber/usePhoneNumber.tsx +3 -4
- package/src/components/Content/Structure/textfield/useTextField.tsx +5 -29
- package/src/components/DataGrid/Checkbox/index.tsx +79 -0
- package/src/components/DataGrid/Footer/index.tsx +169 -0
- package/src/components/DataGrid/Jotai/atom.ts +91 -0
- package/src/components/DataGrid/ManageColumn/index.tsx +211 -0
- package/src/components/DataGrid/ManageRow/index.tsx +182 -0
- package/src/components/DataGrid/Table/index.tsx +227 -0
- package/src/components/DataGrid/VerticalDivider/index.tsx +6 -0
- package/src/components/DataGrid/index.tsx +267 -0
- package/src/components/DataGrid/utils/useManageColumn.tsx +138 -0
- package/src/components/DataGrid/utils/useSearchbar.tsx +122 -0
- package/src/components/Form/DataGrid/index.tsx +63 -0
- package/src/components/PhoneNumberField/index.tsx +91 -67
- package/src/components/Searchbar/index.tsx +98 -42
- package/src/components/TextField/index.tsx +21 -33
- package/src/components/Toolbar/index.tsx +16 -18
- package/src/index.ts +16 -3
- package/src/components/ConfirmationCodeInput/utils/useCodeConfirmation.tsx +0 -150
|
@@ -1,45 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import React, {
|
|
3
|
-
import { TextField, TextFieldProps } from '@mui/material'
|
|
4
|
-
import { styled } from '@mui/material/styles'
|
|
5
|
-
|
|
6
|
-
export interface PhoneNumberFieldProps
|
|
7
|
-
extends Omit<TextFieldProps, 'onChange'> {
|
|
8
|
-
initialValue?: string
|
|
9
|
-
onChange?: () => void
|
|
10
|
-
backgroundcolor?: string
|
|
11
|
-
outlinecolor?: string
|
|
12
|
-
fontcolor?: string
|
|
13
|
-
label?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const StyledTextField = styled(TextField)<{
|
|
17
|
-
backgroundcolor?: string
|
|
18
|
-
outlinecolor?: string
|
|
19
|
-
fontcolor?: string
|
|
20
|
-
}>(({ theme, backgroundcolor, outlinecolor, fontcolor }) => ({
|
|
21
|
-
'& .MuiOutlinedInput-root': {
|
|
22
|
-
backgroundColor: backgroundcolor || theme.palette.background.paper,
|
|
23
|
-
'& fieldset': {
|
|
24
|
-
borderColor: outlinecolor || theme.palette.primary.main,
|
|
25
|
-
},
|
|
26
|
-
'&:hover fieldset': {
|
|
27
|
-
borderColor: outlinecolor || theme.palette.primary.main,
|
|
28
|
-
},
|
|
29
|
-
'&.Mui-focused fieldset': {
|
|
30
|
-
borderColor: outlinecolor || theme.palette.primary.main,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
'& .MuiInputLabel-root': {
|
|
34
|
-
color: fontcolor || theme.palette.text.primary,
|
|
35
|
-
'&.Mui-focused': {
|
|
36
|
-
color: fontcolor || theme.palette.primary.main,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
'& .MuiInputBase-input': {
|
|
40
|
-
color: fontcolor || theme.palette.text.primary,
|
|
41
|
-
},
|
|
42
|
-
}))
|
|
2
|
+
import React, { useCallback, useMemo, useState } from 'react'
|
|
3
|
+
import { Box, TextField as MuiTextField, TextFieldProps } from '@mui/material'
|
|
43
4
|
|
|
44
5
|
const formatPhoneNumber = (value: string): string => {
|
|
45
6
|
const digits = value.replace(/\D/g, '')
|
|
@@ -57,47 +18,110 @@ const formatPhoneNumber = (value: string): string => {
|
|
|
57
18
|
return formattedNumber.trim()
|
|
58
19
|
}
|
|
59
20
|
|
|
60
|
-
const PhoneNumberField: React.FC<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
21
|
+
const PhoneNumberField: React.FC<TextFieldProps> = React.memo(props => {
|
|
22
|
+
const {
|
|
23
|
+
name,
|
|
24
|
+
label = 'Phone Number',
|
|
25
|
+
placeholder,
|
|
26
|
+
onChange,
|
|
27
|
+
onFocus,
|
|
28
|
+
onBlur,
|
|
29
|
+
value = '',
|
|
30
|
+
error,
|
|
31
|
+
...restProps
|
|
32
|
+
} = props
|
|
33
|
+
|
|
69
34
|
const [phoneNumber, setPhoneNumber] = useState(
|
|
70
|
-
formatPhoneNumber(
|
|
35
|
+
formatPhoneNumber(value as string)
|
|
71
36
|
)
|
|
72
37
|
|
|
73
|
-
const
|
|
74
|
-
(e: React.ChangeEvent<HTMLInputElement
|
|
38
|
+
const handleChange = useCallback(
|
|
39
|
+
(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
75
40
|
const input = e.target.value
|
|
76
41
|
let strippedInput = input.replace(/^\+1\s?/, '').replace(/\D/g, '')
|
|
77
42
|
strippedInput = strippedInput.slice(0, 10)
|
|
78
43
|
const formattedValue =
|
|
79
44
|
strippedInput.length > 0 ? formatPhoneNumber(strippedInput) : '+1 '
|
|
80
45
|
setPhoneNumber(formattedValue)
|
|
81
|
-
onChange
|
|
46
|
+
if (onChange) {
|
|
47
|
+
onChange(e)
|
|
48
|
+
}
|
|
82
49
|
},
|
|
83
50
|
[onChange]
|
|
84
51
|
)
|
|
85
52
|
|
|
53
|
+
const handleFocus = useCallback(
|
|
54
|
+
(e: React.FocusEvent<HTMLInputElement>) => {
|
|
55
|
+
if (onFocus) {
|
|
56
|
+
onFocus(e)
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
[onFocus]
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
const handleBlur = useCallback(
|
|
63
|
+
(e: React.FocusEvent<HTMLInputElement>) => {
|
|
64
|
+
if (onBlur) {
|
|
65
|
+
onBlur(e)
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
[onBlur]
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
const handleClick = useCallback((e: React.MouseEvent<HTMLDivElement>) => {
|
|
72
|
+
e.preventDefault()
|
|
73
|
+
}, [])
|
|
74
|
+
|
|
75
|
+
const inputProps = useMemo(
|
|
76
|
+
() => ({
|
|
77
|
+
style: {
|
|
78
|
+
height: '40px',
|
|
79
|
+
padding: '8px 14px',
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
[]
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
const InputProps = useMemo(
|
|
86
|
+
() => ({
|
|
87
|
+
style: {
|
|
88
|
+
height: '45px',
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
[]
|
|
92
|
+
)
|
|
93
|
+
|
|
86
94
|
return (
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
inputProps={{
|
|
96
|
-
maxLength: 16,
|
|
95
|
+
<Box
|
|
96
|
+
sx={{
|
|
97
|
+
display: 'flex',
|
|
98
|
+
flexDirection: 'column',
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
width: '100%',
|
|
101
|
+
marginTop: '5px',
|
|
102
|
+
height: '70px',
|
|
97
103
|
}}
|
|
98
|
-
{
|
|
99
|
-
|
|
104
|
+
onClick={handleClick}
|
|
105
|
+
>
|
|
106
|
+
<MuiTextField
|
|
107
|
+
name={name}
|
|
108
|
+
label={label}
|
|
109
|
+
placeholder={placeholder}
|
|
110
|
+
onChange={handleChange}
|
|
111
|
+
onFocus={handleFocus}
|
|
112
|
+
onBlur={handleBlur}
|
|
113
|
+
value={phoneNumber}
|
|
114
|
+
error={error}
|
|
115
|
+
fullWidth
|
|
116
|
+
variant="outlined"
|
|
117
|
+
inputProps={inputProps}
|
|
118
|
+
InputProps={InputProps}
|
|
119
|
+
{...restProps}
|
|
120
|
+
/>
|
|
121
|
+
</Box>
|
|
100
122
|
)
|
|
101
|
-
}
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
PhoneNumberField.displayName = 'PhoneNumberField'
|
|
102
126
|
|
|
103
127
|
export default PhoneNumberField
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
'use client'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import {
|
|
4
|
+
OutlinedInput,
|
|
5
|
+
styled,
|
|
6
|
+
FormControl,
|
|
7
|
+
InputLabel,
|
|
8
|
+
InputAdornment,
|
|
9
|
+
} from '@mui/material'
|
|
3
10
|
import SearchIcon from '@mui/icons-material/Search'
|
|
11
|
+
import * as palette from '../../styles/palette'
|
|
4
12
|
|
|
5
13
|
export interface SearchbarProps {
|
|
6
14
|
label?: string
|
|
@@ -13,31 +21,65 @@ export interface SearchbarProps {
|
|
|
13
21
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
|
|
14
22
|
}
|
|
15
23
|
|
|
16
|
-
const
|
|
24
|
+
const StyledFormControl = styled(FormControl)({
|
|
25
|
+
width: '100%',
|
|
26
|
+
position: 'relative',
|
|
27
|
+
height: '45px',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'flex-end',
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const StyledOutlinedInput = styled(OutlinedInput)<{
|
|
17
33
|
backgroundcolor?: string
|
|
18
34
|
outlinecolor?: string
|
|
19
|
-
|
|
20
|
-
}>(({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
fontcolor?: string
|
|
36
|
+
}>(({ backgroundcolor, outlinecolor, fontcolor }) => ({
|
|
37
|
+
height: '40px',
|
|
38
|
+
backgroundColor: backgroundcolor || palette.white.main,
|
|
39
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
40
|
+
border:
|
|
41
|
+
outlinecolor === 'none'
|
|
42
|
+
? 'none'
|
|
43
|
+
: `1px solid ${outlinecolor || palette.black.main}`,
|
|
44
|
+
},
|
|
45
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
46
|
+
border:
|
|
47
|
+
outlinecolor === 'none'
|
|
48
|
+
? 'none'
|
|
49
|
+
: `1px solid ${outlinecolor || palette.black.main}`,
|
|
50
|
+
},
|
|
51
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
52
|
+
border:
|
|
53
|
+
outlinecolor === 'none'
|
|
54
|
+
? 'none'
|
|
55
|
+
: `1px solid ${outlinecolor || palette.black.main}`,
|
|
56
|
+
borderWidth: outlinecolor === 'none' ? '0' : '1px',
|
|
32
57
|
},
|
|
33
|
-
'&
|
|
34
|
-
color:
|
|
35
|
-
'
|
|
36
|
-
|
|
58
|
+
'& input': {
|
|
59
|
+
color: fontcolor || palette.black.main,
|
|
60
|
+
padding: '0 12px',
|
|
61
|
+
paddingLeft: '7px',
|
|
62
|
+
height: '100%',
|
|
63
|
+
'&::placeholder': {
|
|
64
|
+
color: fontcolor || palette.black.main,
|
|
65
|
+
opacity: 0.7,
|
|
37
66
|
},
|
|
38
67
|
},
|
|
39
|
-
|
|
40
|
-
|
|
68
|
+
}))
|
|
69
|
+
|
|
70
|
+
const StyledInputLabel = styled(InputLabel)<{
|
|
71
|
+
fontcolor?: string
|
|
72
|
+
}>(({ fontcolor }) => ({
|
|
73
|
+
color: fontcolor || palette.black.main,
|
|
74
|
+
transform: 'translate(44px, 20px) scale(1)',
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
top: '-5px',
|
|
77
|
+
'&.Mui-focused': {
|
|
78
|
+
color: fontcolor || palette.black.main,
|
|
79
|
+
},
|
|
80
|
+
'&.MuiInputLabel-shrink': {
|
|
81
|
+
transform: 'translate(14px, 3px) scale(0.75)',
|
|
82
|
+
color: fontcolor || palette.black.main,
|
|
41
83
|
},
|
|
42
84
|
}))
|
|
43
85
|
|
|
@@ -51,27 +93,41 @@ const Searchbar: React.FC<SearchbarProps> = ({
|
|
|
51
93
|
value,
|
|
52
94
|
onChange,
|
|
53
95
|
}) => {
|
|
96
|
+
const [focused, setFocused] = useState(false)
|
|
97
|
+
const isLabelShrunken = focused || Boolean(value)
|
|
98
|
+
|
|
99
|
+
const handleFocus = () => setFocused(true)
|
|
100
|
+
const handleBlur = () => setFocused(false)
|
|
101
|
+
|
|
54
102
|
return (
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
103
|
+
<StyledFormControl variant="outlined">
|
|
104
|
+
<StyledInputLabel
|
|
105
|
+
variant="outlined"
|
|
106
|
+
htmlFor="search-input"
|
|
107
|
+
shrink={isLabelShrunken}
|
|
108
|
+
fontcolor={fontcolor}
|
|
109
|
+
>
|
|
110
|
+
{label}
|
|
111
|
+
</StyledInputLabel>
|
|
112
|
+
<StyledOutlinedInput
|
|
113
|
+
id="search-input"
|
|
114
|
+
label={label}
|
|
115
|
+
notched={isLabelShrunken}
|
|
116
|
+
placeholder={isLabelShrunken ? placeholder : ''}
|
|
117
|
+
value={value}
|
|
118
|
+
onChange={onChange}
|
|
119
|
+
onFocus={handleFocus}
|
|
120
|
+
onBlur={handleBlur}
|
|
121
|
+
backgroundcolor={backgroundcolor}
|
|
122
|
+
outlinecolor={outlinecolor}
|
|
123
|
+
fontcolor={fontcolor}
|
|
124
|
+
startAdornment={
|
|
125
|
+
<InputAdornment position="start">
|
|
126
|
+
<SearchIcon sx={{ color: iconcolor || palette.black.main }} />
|
|
127
|
+
</InputAdornment>
|
|
128
|
+
}
|
|
129
|
+
/>
|
|
130
|
+
</StyledFormControl>
|
|
75
131
|
)
|
|
76
132
|
}
|
|
77
133
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
'use client'
|
|
1
2
|
import React, { useCallback, useMemo } from 'react'
|
|
2
3
|
import { Box, TextField as MuiTextField, TextFieldProps } from '@mui/material'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
name: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const TextField: React.FC<CustomTextFieldProps> = React.memo(props => {
|
|
5
|
+
const TextField: React.FC<TextFieldProps> = React.memo(props => {
|
|
9
6
|
const {
|
|
10
7
|
name,
|
|
11
8
|
label,
|
|
@@ -16,7 +13,6 @@ const TextField: React.FC<CustomTextFieldProps> = React.memo(props => {
|
|
|
16
13
|
value,
|
|
17
14
|
error,
|
|
18
15
|
sx,
|
|
19
|
-
InputProps,
|
|
20
16
|
...restProps
|
|
21
17
|
} = props
|
|
22
18
|
|
|
@@ -59,36 +55,31 @@ const TextField: React.FC<CustomTextFieldProps> = React.memo(props => {
|
|
|
59
55
|
cursor: 'text',
|
|
60
56
|
boxSizing: 'border-box',
|
|
61
57
|
borderRadius: 5,
|
|
62
|
-
paddingRight: 6,
|
|
63
58
|
}),
|
|
64
59
|
[]
|
|
65
60
|
)
|
|
66
61
|
|
|
67
|
-
const
|
|
62
|
+
const slotProps = useMemo(
|
|
68
63
|
() => ({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
...inputStyle,
|
|
72
|
-
...InputProps?.style,
|
|
64
|
+
input: {
|
|
65
|
+
style: inputStyle,
|
|
73
66
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
top: '9px',
|
|
88
|
-
left: '12px',
|
|
67
|
+
inputLabel: {
|
|
68
|
+
sx: {
|
|
69
|
+
'&.MuiInputLabel-shrink': {
|
|
70
|
+
top: '0px',
|
|
71
|
+
left: '0px',
|
|
72
|
+
},
|
|
73
|
+
'&:not(.MuiInputLabel-shrink)': {
|
|
74
|
+
transform: 'scale(1)',
|
|
75
|
+
transformOrigin: 'top left',
|
|
76
|
+
top: '9px',
|
|
77
|
+
left: '12px',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
89
80
|
},
|
|
90
81
|
}),
|
|
91
|
-
[]
|
|
82
|
+
[inputStyle]
|
|
92
83
|
)
|
|
93
84
|
|
|
94
85
|
return (
|
|
@@ -99,7 +90,7 @@ const TextField: React.FC<CustomTextFieldProps> = React.memo(props => {
|
|
|
99
90
|
justifyContent: 'center',
|
|
100
91
|
width: '100%',
|
|
101
92
|
marginTop: '5px',
|
|
102
|
-
height: '
|
|
93
|
+
height: '70px',
|
|
103
94
|
...sx,
|
|
104
95
|
}}
|
|
105
96
|
onClick={handleClick}
|
|
@@ -113,10 +104,7 @@ const TextField: React.FC<CustomTextFieldProps> = React.memo(props => {
|
|
|
113
104
|
onBlur={handleBlur}
|
|
114
105
|
value={value}
|
|
115
106
|
error={error}
|
|
116
|
-
|
|
117
|
-
InputLabelProps={{
|
|
118
|
-
sx: labelStyle,
|
|
119
|
-
}}
|
|
107
|
+
slotProps={slotProps}
|
|
120
108
|
fullWidth
|
|
121
109
|
variant="outlined"
|
|
122
110
|
{...restProps}
|
|
@@ -6,33 +6,20 @@ import Searchbar, { SearchbarProps } from '../Searchbar'
|
|
|
6
6
|
import Dropdown, { DropdownProps } from '../Dropdown'
|
|
7
7
|
import { white, black, semiTransparentWhite } from '../../styles/palette'
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* Styled component for a vertical divider
|
|
11
|
-
*/
|
|
12
9
|
const VerticalDivider = styled(Box)({
|
|
13
10
|
borderLeft: '2px solid black',
|
|
14
11
|
height: '20px',
|
|
15
12
|
})
|
|
16
13
|
|
|
17
|
-
/**
|
|
18
|
-
* Interface for the CustomToolbar component props
|
|
19
|
-
*/
|
|
20
14
|
export interface ToolbarProps {
|
|
21
15
|
buttons?: CustomButtonProps[]
|
|
22
16
|
dropdowns?: DropdownProps[]
|
|
23
17
|
searchbarProps?: Partial<SearchbarProps>
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
/**
|
|
27
|
-
* CustomToolbar component that renders a toolbar with buttons, dropdowns, and a search bar
|
|
28
|
-
* @param {ToolbarProps} props - The props for the CustomToolbar component
|
|
29
|
-
* @returns {JSX.Element} The rendered CustomToolbar component
|
|
30
|
-
*/
|
|
31
20
|
function CustomToolbar({ buttons, dropdowns, searchbarProps }: ToolbarProps) {
|
|
32
|
-
// State for checkbox width (set to 45px as default)
|
|
33
21
|
const [checkboxWidth] = useState(45)
|
|
34
|
-
|
|
35
|
-
const toolbarHeight = 56
|
|
22
|
+
const toolbarHeight = 45
|
|
36
23
|
|
|
37
24
|
return (
|
|
38
25
|
<Box
|
|
@@ -41,12 +28,13 @@ function CustomToolbar({ buttons, dropdowns, searchbarProps }: ToolbarProps) {
|
|
|
41
28
|
pl: `${checkboxWidth}px`,
|
|
42
29
|
display: 'flex',
|
|
43
30
|
flexDirection: 'row',
|
|
44
|
-
justifyContent: '
|
|
31
|
+
justifyContent: 'flex-start',
|
|
45
32
|
alignItems: 'stretch',
|
|
46
33
|
height: `${toolbarHeight}px`,
|
|
34
|
+
width: '100%',
|
|
47
35
|
}}
|
|
48
36
|
>
|
|
49
|
-
{/* Left section
|
|
37
|
+
{/* Left section with buttons and divider */}
|
|
50
38
|
<Box
|
|
51
39
|
sx={{
|
|
52
40
|
display: 'flex',
|
|
@@ -70,7 +58,8 @@ function CustomToolbar({ buttons, dropdowns, searchbarProps }: ToolbarProps) {
|
|
|
70
58
|
<Box
|
|
71
59
|
sx={{
|
|
72
60
|
display: 'flex',
|
|
73
|
-
alignItems: '
|
|
61
|
+
alignItems: 'flex-end', // Changed from center to flex-end
|
|
62
|
+
paddingBottom: '13px', // Added padding to align with other elements
|
|
74
63
|
gap: '10px',
|
|
75
64
|
height: '100%',
|
|
76
65
|
padding: '0 15px',
|
|
@@ -90,6 +79,7 @@ function CustomToolbar({ buttons, dropdowns, searchbarProps }: ToolbarProps) {
|
|
|
90
79
|
))}
|
|
91
80
|
</Box>
|
|
92
81
|
</Box>
|
|
82
|
+
|
|
93
83
|
{/* Search bar section */}
|
|
94
84
|
<Box
|
|
95
85
|
sx={{
|
|
@@ -99,10 +89,12 @@ function CustomToolbar({ buttons, dropdowns, searchbarProps }: ToolbarProps) {
|
|
|
99
89
|
width: '300px',
|
|
100
90
|
minWidth: '200px',
|
|
101
91
|
height: '100%',
|
|
92
|
+
padding: '0 15px',
|
|
102
93
|
}}
|
|
103
94
|
>
|
|
104
95
|
<Searchbar
|
|
105
96
|
backgroundcolor={semiTransparentWhite.main}
|
|
97
|
+
outlinecolor="none"
|
|
106
98
|
label="Search the DataGrid"
|
|
107
99
|
fontcolor={black.main}
|
|
108
100
|
iconcolor={black.main}
|
|
@@ -111,15 +103,21 @@ function CustomToolbar({ buttons, dropdowns, searchbarProps }: ToolbarProps) {
|
|
|
111
103
|
{...searchbarProps}
|
|
112
104
|
/>
|
|
113
105
|
</Box>
|
|
106
|
+
|
|
107
|
+
{/* Spacer to push dropdowns to the right */}
|
|
108
|
+
<Box sx={{ flexGrow: 1 }} />
|
|
109
|
+
|
|
114
110
|
{/* Dropdowns section */}
|
|
115
111
|
{dropdowns && dropdowns.length > 0 && (
|
|
116
112
|
<Box
|
|
117
113
|
sx={{
|
|
118
114
|
display: 'flex',
|
|
119
|
-
alignItems: '
|
|
115
|
+
alignItems: 'flex-end', // Changed from center to flex-end
|
|
116
|
+
paddingBottom: '13px', // Added padding to align with other elements
|
|
120
117
|
height: '100%',
|
|
121
118
|
padding: '0 15px',
|
|
122
119
|
gap: '10px',
|
|
120
|
+
marginLeft: 'auto',
|
|
123
121
|
}}
|
|
124
122
|
>
|
|
125
123
|
{dropdowns.map((dropdown, index) => (
|
package/src/index.ts
CHANGED
|
@@ -47,7 +47,9 @@ import PasswordField from './components/PasswordField'
|
|
|
47
47
|
import PhoneNumberField from './components/PhoneNumberField'
|
|
48
48
|
import Searchbar from './components/Searchbar'
|
|
49
49
|
import TextField from './components/TextField'
|
|
50
|
-
|
|
50
|
+
// Add FormDataGrid import
|
|
51
|
+
import FormDataGrid from './components/Form/DataGrid'
|
|
52
|
+
import type { FormDataGridProps } from './components/Form/DataGrid'
|
|
51
53
|
// Animations
|
|
52
54
|
import { Animation } from './components/Content/Structure/animations'
|
|
53
55
|
|
|
@@ -71,7 +73,10 @@ import { ExtendedImageProps } from './components/Content/Structure/image/useImag
|
|
|
71
73
|
import { ExtendedConfirmationCodeInputsProps } from './components/Content/Structure/confirmationinput/useConfirmationInput'
|
|
72
74
|
import { ExtendedRadioGroupProps } from './components/Content/Structure/radiogroup/useRadioGroup'
|
|
73
75
|
import { ExtendedPhoneNumberFieldProps } from './components/Content/Structure/phoneNumber/usePhoneNumber'
|
|
74
|
-
import {
|
|
76
|
+
import { DatagridProps } from './components/DataGrid'
|
|
77
|
+
import type { ColumnDef, RowData } from './components/DataGrid/Table'
|
|
78
|
+
import type { CellParams, HeaderParams } from './components/DataGrid/Table'
|
|
79
|
+
|
|
75
80
|
// Colors
|
|
76
81
|
import {
|
|
77
82
|
moss,
|
|
@@ -213,6 +218,15 @@ export { PhoneNumberField }
|
|
|
213
218
|
export { Searchbar }
|
|
214
219
|
export { TextField }
|
|
215
220
|
|
|
221
|
+
// Add FormDataGrid to named exports
|
|
222
|
+
export { FormDataGrid }
|
|
223
|
+
|
|
224
|
+
// Add FormDataGrid type to type exports
|
|
225
|
+
export type { FormDataGridProps }
|
|
226
|
+
export type { DatagridProps }
|
|
227
|
+
export type { ColumnDef, RowData }
|
|
228
|
+
export type { CellParams, HeaderParams }
|
|
229
|
+
|
|
216
230
|
// Exporting ExtendedButtonProps
|
|
217
231
|
export type { ExtendedButtonProps }
|
|
218
232
|
export type { ExtendedTypographyProps }
|
|
@@ -268,7 +282,6 @@ export type { CustomToolbarComponentProps }
|
|
|
268
282
|
export type { TransferListComponentProps }
|
|
269
283
|
export type { StyledTooltipComponentProps }
|
|
270
284
|
export type { DropdownOption }
|
|
271
|
-
export type { CustomTextFieldProps }
|
|
272
285
|
|
|
273
286
|
// New type exports
|
|
274
287
|
export type { DateFieldProps }
|