@tap-payments/os-micro-frontend-shared 0.1.370 → 0.1.371-test.1-test.2
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/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
- package/build/components/AppWindowWrapper/AppWindow/AppWindow.d.ts +1 -1
- package/build/components/AppWindowWrapper/AppWindow/AppWindow.js +2 -2
- package/build/components/AppWindowWrapper/AppWindow/type.d.ts +2 -0
- package/build/components/AppWindowWrapper/headers/AccountHeader/AccountHeader.d.ts +1 -1
- package/build/components/AppWindowWrapper/headers/AccountHeader/AccountHeader.js +2 -2
- package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/AccountHeaderTitle.d.ts +1 -1
- package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/AccountHeaderTitle.js +2 -2
- package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/type.d.ts +3 -2
- package/build/components/AppWindowWrapper/headers/AccountHeader/type.d.ts +2 -1
- package/build/components/Chip/style.d.ts +0 -1
- package/build/components/CountBadge/style.d.ts +0 -1
- package/build/components/Dialog/style.d.ts +0 -1
- package/build/components/FlippingCard/style.d.ts +0 -1
- package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
- package/build/components/JSONViewer/style.d.ts +0 -1
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
- package/build/components/SearchButton/styles.d.ts +0 -1
- package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
- package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/style.d.ts +0 -1
- package/build/components/TableHeader/FiltersRow.d.ts +1 -1
- package/build/components/TableHeader/FiltersRow.js +4 -2
- package/build/components/TableHeader/TableHeader.d.ts +1 -1
- package/build/components/TableHeader/TableHeader.js +2 -2
- package/build/components/TableHeader/TableView/CreateViewDialog.d.ts +3 -0
- package/build/components/TableHeader/TableView/CreateViewDialog.js +56 -0
- package/build/components/TableHeader/TableView/CustomViews.js +1 -1
- package/build/components/TableHeader/TableView/TableView.js +0 -1
- package/build/components/TableHeader/TableView/ViewsDropdown.d.ts +5 -0
- package/build/components/TableHeader/TableView/ViewsDropdown.js +148 -0
- package/build/components/TableHeader/TableView/ViewsManager.d.ts +5 -0
- package/build/components/TableHeader/TableView/ViewsManager.js +108 -0
- package/build/components/TableHeader/TableView/components/ColumnList.d.ts +3 -0
- package/build/components/TableHeader/TableView/components/ColumnList.js +54 -0
- package/build/components/TableHeader/TableView/components/ViewsSubmenu.d.ts +3 -0
- package/build/components/TableHeader/TableView/components/ViewsSubmenu.js +44 -0
- package/build/components/TableHeader/TableView/components/index.d.ts +2 -0
- package/build/components/TableHeader/TableView/components/index.js +2 -0
- package/build/components/TableHeader/TableView/constants.d.ts +10 -0
- package/build/components/TableHeader/TableView/constants.js +10 -0
- package/build/components/TableHeader/TableView/data.d.ts +5 -0
- package/build/components/TableHeader/TableView/data.js +48 -0
- package/build/components/TableHeader/TableView/hooks/useCreateViewDialog.d.ts +22 -0
- package/build/components/TableHeader/TableView/hooks/useCreateViewDialog.js +76 -0
- package/build/components/TableHeader/TableView/hooks/useNestedSubmenu.d.ts +7 -0
- package/build/components/TableHeader/TableView/hooks/useNestedSubmenu.js +34 -0
- package/build/components/TableHeader/TableView/hooks/useViewsManager.d.ts +11 -0
- package/build/components/TableHeader/TableView/hooks/useViewsManager.js +18 -0
- package/build/components/TableHeader/TableView/hooks.d.ts +28 -0
- package/build/components/TableHeader/TableView/hooks.js +81 -0
- package/build/components/TableHeader/TableView/index.d.ts +12 -3
- package/build/components/TableHeader/TableView/index.js +11 -3
- package/build/components/TableHeader/TableView/styles.d.ts +127 -0
- package/build/components/TableHeader/TableView/styles.js +417 -0
- package/build/components/TableHeader/TableView/types.d.ts +137 -0
- package/build/components/TableHeader/TableView/types.js +1 -0
- package/build/components/TableHeader/TableView/utils.d.ts +86 -0
- package/build/components/TableHeader/TableView/utils.js +314 -0
- package/build/components/TableHeader/type.d.ts +17 -0
- package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
- package/build/components/TableReports/style.d.ts +0 -1
- package/build/components/Toolbar/Toolbar.js +1 -1
- package/build/components/VirtualTables/components/style.d.ts +0 -1
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { Box, styled, Button, Paper, TextField } from '@mui/material';
|
|
2
|
+
export const ButtonStyled = styled(Box)(({ theme }) => ({
|
|
3
|
+
display: 'flex',
|
|
4
|
+
alignItems: 'center',
|
|
5
|
+
justifyContent: 'space-between',
|
|
6
|
+
borderRadius: '4px',
|
|
7
|
+
background: theme.palette.common.white,
|
|
8
|
+
padding: '8px',
|
|
9
|
+
border: '1px solid',
|
|
10
|
+
borderColor: theme.palette.divider,
|
|
11
|
+
gap: 8,
|
|
12
|
+
height: 32,
|
|
13
|
+
cursor: 'pointer',
|
|
14
|
+
'&:hover': {
|
|
15
|
+
border: '1px solid',
|
|
16
|
+
borderColor: theme.palette.info.dark,
|
|
17
|
+
boxShadow: theme.shadows[7],
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
20
|
+
export const ViewWrapper = styled(Box)(({ theme }) => ({
|
|
21
|
+
background: theme.palette.common.white,
|
|
22
|
+
display: 'flex',
|
|
23
|
+
gap: theme.spacing(1),
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
color: theme.palette.text.primary,
|
|
26
|
+
fontSize: '11px',
|
|
27
|
+
fontWeight: theme.typography.fontWeightRegular,
|
|
28
|
+
textTransform: 'capitalize',
|
|
29
|
+
position: 'relative',
|
|
30
|
+
transition: '0.5s',
|
|
31
|
+
paddingRight: 0,
|
|
32
|
+
marginRight: 0,
|
|
33
|
+
'&:after': {
|
|
34
|
+
content: '""',
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
left: -8,
|
|
37
|
+
right: 0,
|
|
38
|
+
width: '100%',
|
|
39
|
+
height: '100%',
|
|
40
|
+
boxShadow: theme.shadows[11],
|
|
41
|
+
borderRadius: theme.spacing(0.5),
|
|
42
|
+
paddingInlineStart: theme.spacing(1),
|
|
43
|
+
paddingTop: '9px',
|
|
44
|
+
paddingBottom: '9px',
|
|
45
|
+
paddingInlineEnd: '9px',
|
|
46
|
+
zIndex: -1,
|
|
47
|
+
},
|
|
48
|
+
'& > *:last-child': {
|
|
49
|
+
marginRight: 0,
|
|
50
|
+
paddingRight: 0,
|
|
51
|
+
},
|
|
52
|
+
}));
|
|
53
|
+
export const ListStyled = styled(Box)(({ theme }) => ({
|
|
54
|
+
background: theme.palette.common.white,
|
|
55
|
+
borderRadius: theme.spacing(1),
|
|
56
|
+
boxShadow: theme.shadows[5],
|
|
57
|
+
border: '1px solid',
|
|
58
|
+
borderColor: theme.palette.divider,
|
|
59
|
+
zIndex: 5,
|
|
60
|
+
fontSize: '11px',
|
|
61
|
+
width: 192,
|
|
62
|
+
}));
|
|
63
|
+
export const DropdownStyled = styled(Box)(() => ({
|
|
64
|
+
minWidth: 160,
|
|
65
|
+
position: 'relative',
|
|
66
|
+
marginRight: 0,
|
|
67
|
+
paddingRight: 0,
|
|
68
|
+
}));
|
|
69
|
+
export const MenuItem = styled(Box, { shouldForwardProp: (props) => props !== 'addColumnViewEl' })(({ theme }) => ({
|
|
70
|
+
padding: theme.spacing(1),
|
|
71
|
+
paddingInlineEnd: 2,
|
|
72
|
+
borderBottom: '1px solid',
|
|
73
|
+
borderColor: theme.palette.divider,
|
|
74
|
+
display: 'flex',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
height: 32,
|
|
77
|
+
cursor: 'pointer',
|
|
78
|
+
img: {
|
|
79
|
+
height: 12,
|
|
80
|
+
},
|
|
81
|
+
'.check-icon': {
|
|
82
|
+
height: 'auto',
|
|
83
|
+
marginInlineEnd: theme.spacing(1),
|
|
84
|
+
},
|
|
85
|
+
'&:hover': {
|
|
86
|
+
color: theme.palette.info.dark,
|
|
87
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
88
|
+
},
|
|
89
|
+
'&.add-column': {
|
|
90
|
+
justifyContent: 'space-between',
|
|
91
|
+
paddingInlineEnd: theme.spacing(1),
|
|
92
|
+
position: 'relative',
|
|
93
|
+
border: 'none',
|
|
94
|
+
zIndex: 5,
|
|
95
|
+
borderBottom: '1px solid',
|
|
96
|
+
borderColor: theme.palette.divider,
|
|
97
|
+
borderTopRightRadius: theme.spacing(1),
|
|
98
|
+
borderTopLeftRadius: theme.spacing(1),
|
|
99
|
+
'&:hover': {
|
|
100
|
+
boxShadow: theme.shadows[6],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
}));
|
|
104
|
+
export const Space = styled(Box)(({ theme }) => ({
|
|
105
|
+
width: 12,
|
|
106
|
+
marginInlineEnd: theme.spacing(1),
|
|
107
|
+
}));
|
|
108
|
+
export const SpaceAfter = styled(Box)(() => ({
|
|
109
|
+
width: 16,
|
|
110
|
+
}));
|
|
111
|
+
export const DialogContentWrapper = styled(Box)(({ theme }) => ({
|
|
112
|
+
display: 'flex',
|
|
113
|
+
flexDirection: 'column',
|
|
114
|
+
height: 'calc(100% - 32px)',
|
|
115
|
+
backgroundColor: theme.palette.background.paper,
|
|
116
|
+
position: 'relative',
|
|
117
|
+
}));
|
|
118
|
+
export const ScrollableContent = styled(Box)(() => ({
|
|
119
|
+
flex: 1,
|
|
120
|
+
overflowY: 'auto',
|
|
121
|
+
paddingLeft: 16,
|
|
122
|
+
paddingRight: 16,
|
|
123
|
+
paddingBottom: 64,
|
|
124
|
+
}));
|
|
125
|
+
export const TitleSection = styled(Box)(() => ({
|
|
126
|
+
padding: '24px 0',
|
|
127
|
+
display: 'flex',
|
|
128
|
+
justifyContent: 'space-between',
|
|
129
|
+
alignItems: 'center',
|
|
130
|
+
}));
|
|
131
|
+
export const ColumnListContainer = styled(Box)(({ theme }) => ({
|
|
132
|
+
border: '1px solid',
|
|
133
|
+
borderColor: theme.palette.divider,
|
|
134
|
+
borderRadius: '8px',
|
|
135
|
+
overflow: 'hidden',
|
|
136
|
+
display: 'flex',
|
|
137
|
+
flexDirection: 'column',
|
|
138
|
+
flex: 1,
|
|
139
|
+
minHeight: 0,
|
|
140
|
+
}));
|
|
141
|
+
export const SelectAllHeader = styled(Box)(({ theme }) => ({
|
|
142
|
+
display: 'flex',
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
padding: '12px',
|
|
145
|
+
borderBottom: '1px solid',
|
|
146
|
+
borderColor: theme.palette.divider,
|
|
147
|
+
backgroundColor: '#FAFAFA',
|
|
148
|
+
cursor: 'pointer',
|
|
149
|
+
'&:hover': {
|
|
150
|
+
backgroundColor: '#F0F0F0',
|
|
151
|
+
},
|
|
152
|
+
}));
|
|
153
|
+
export const ColumnItemRow = styled(Box, {
|
|
154
|
+
shouldForwardProp: (prop) => prop !== 'isHovered' && prop !== 'isDate',
|
|
155
|
+
})(({ theme, isHovered, isDate }) => ({
|
|
156
|
+
display: 'flex',
|
|
157
|
+
alignItems: 'center',
|
|
158
|
+
padding: '12px',
|
|
159
|
+
borderBottom: '1px solid',
|
|
160
|
+
borderColor: theme.palette.divider,
|
|
161
|
+
backgroundColor: isHovered ? theme.palette.action.hover : theme.palette.background.paper,
|
|
162
|
+
cursor: isDate ? 'default' : 'grab',
|
|
163
|
+
'&:hover': {
|
|
164
|
+
backgroundColor: isDate ? theme.palette.background.paper : theme.palette.action.hover,
|
|
165
|
+
},
|
|
166
|
+
'&:last-child': {
|
|
167
|
+
borderBottom: 'none',
|
|
168
|
+
},
|
|
169
|
+
}));
|
|
170
|
+
export const DragIconWrapper = styled(Box)(() => ({
|
|
171
|
+
width: 20,
|
|
172
|
+
height: 20,
|
|
173
|
+
marginRight: 8,
|
|
174
|
+
display: 'flex',
|
|
175
|
+
alignItems: 'center',
|
|
176
|
+
justifyContent: 'center',
|
|
177
|
+
flexShrink: 0,
|
|
178
|
+
}));
|
|
179
|
+
export const CheckboxWrapper = styled(Box)(() => ({
|
|
180
|
+
display: 'flex',
|
|
181
|
+
alignItems: 'center',
|
|
182
|
+
justifyContent: 'center',
|
|
183
|
+
padding: 0,
|
|
184
|
+
width: 14,
|
|
185
|
+
height: 14,
|
|
186
|
+
minWidth: 14,
|
|
187
|
+
minHeight: 14,
|
|
188
|
+
flexShrink: 0,
|
|
189
|
+
}));
|
|
190
|
+
export const FooterBar = styled(Box)(({ theme }) => ({
|
|
191
|
+
position: 'absolute',
|
|
192
|
+
bottom: 0,
|
|
193
|
+
left: 0,
|
|
194
|
+
right: 0,
|
|
195
|
+
height: 35,
|
|
196
|
+
backgroundColor: '#F8F9FB',
|
|
197
|
+
borderTop: '1px solid',
|
|
198
|
+
borderColor: theme.palette.divider,
|
|
199
|
+
}));
|
|
200
|
+
export const CreateButtonWrapper = styled(Box)(() => ({
|
|
201
|
+
position: 'absolute',
|
|
202
|
+
bottom: 12,
|
|
203
|
+
right: 16,
|
|
204
|
+
padding: 6,
|
|
205
|
+
backgroundColor: 'white',
|
|
206
|
+
}));
|
|
207
|
+
export const SubmenuPaper = styled(Paper)(() => ({
|
|
208
|
+
paddingTop: 4,
|
|
209
|
+
paddingBottom: 4,
|
|
210
|
+
minWidth: 180,
|
|
211
|
+
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
|
|
212
|
+
borderRadius: '8px',
|
|
213
|
+
}));
|
|
214
|
+
export const SubmenuItem = styled(Box)(({ theme }) => ({
|
|
215
|
+
display: 'flex',
|
|
216
|
+
alignItems: 'center',
|
|
217
|
+
padding: '8px 12px',
|
|
218
|
+
cursor: 'pointer',
|
|
219
|
+
}));
|
|
220
|
+
export const DeleteButton = styled(Button)(() => ({
|
|
221
|
+
color: '#FF0000',
|
|
222
|
+
textTransform: 'none',
|
|
223
|
+
fontSize: 10,
|
|
224
|
+
fontWeight: 500,
|
|
225
|
+
borderRadius: '4px',
|
|
226
|
+
border: '1px solid #F4F4F4',
|
|
227
|
+
paddingLeft: 8,
|
|
228
|
+
paddingRight: 8,
|
|
229
|
+
paddingTop: 4,
|
|
230
|
+
paddingBottom: 4,
|
|
231
|
+
'&:hover': {
|
|
232
|
+
backgroundColor: 'transparent',
|
|
233
|
+
},
|
|
234
|
+
}));
|
|
235
|
+
export const CreateButton = styled(Button)(({ theme }) => ({
|
|
236
|
+
fontSize: 9,
|
|
237
|
+
fontWeight: 600,
|
|
238
|
+
borderRadius: 4,
|
|
239
|
+
paddingLeft: 20,
|
|
240
|
+
paddingRight: 20,
|
|
241
|
+
paddingTop: 8,
|
|
242
|
+
paddingBottom: 8,
|
|
243
|
+
textTransform: 'none',
|
|
244
|
+
backgroundColor: '#1F88D0',
|
|
245
|
+
'&:hover': {
|
|
246
|
+
backgroundColor: '#1A7BC0',
|
|
247
|
+
},
|
|
248
|
+
'&.Mui-disabled': {
|
|
249
|
+
backgroundColor: theme.palette.grey[300],
|
|
250
|
+
color: theme.palette.grey[500],
|
|
251
|
+
},
|
|
252
|
+
}));
|
|
253
|
+
export const NameTextField = styled(TextField)(({ theme }) => ({
|
|
254
|
+
'& .MuiFilledInput-root': {
|
|
255
|
+
borderRadius: '8px',
|
|
256
|
+
backgroundColor: theme.palette.background.paper,
|
|
257
|
+
border: '1px solid',
|
|
258
|
+
borderColor: theme.palette.divider,
|
|
259
|
+
'&:hover': {
|
|
260
|
+
backgroundColor: theme.palette.background.paper,
|
|
261
|
+
},
|
|
262
|
+
'&.Mui-focused': {
|
|
263
|
+
backgroundColor: theme.palette.background.paper,
|
|
264
|
+
},
|
|
265
|
+
'&::before, &::after': {
|
|
266
|
+
display: 'none',
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
}));
|
|
270
|
+
export const checkboxSx = {
|
|
271
|
+
display: 'flex',
|
|
272
|
+
alignItems: 'center',
|
|
273
|
+
justifyContent: 'center',
|
|
274
|
+
padding: 0,
|
|
275
|
+
width: 14,
|
|
276
|
+
height: 14,
|
|
277
|
+
minWidth: 14,
|
|
278
|
+
minHeight: 14,
|
|
279
|
+
flexShrink: 0,
|
|
280
|
+
color: 'grey.A400',
|
|
281
|
+
'&.Mui-checked': {
|
|
282
|
+
color: 'info.dark',
|
|
283
|
+
},
|
|
284
|
+
'&.MuiCheckbox-indeterminate': {
|
|
285
|
+
color: 'info.dark',
|
|
286
|
+
},
|
|
287
|
+
'&.Mui-disabled.Mui-checked': {
|
|
288
|
+
color: 'grey.500',
|
|
289
|
+
'& .MuiSvgIcon-root': {
|
|
290
|
+
backgroundColor: 'grey.500',
|
|
291
|
+
borderRadius: '3px',
|
|
292
|
+
color: '#fff',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
'& .MuiSvgIcon-root': {
|
|
296
|
+
width: 14,
|
|
297
|
+
height: 14,
|
|
298
|
+
},
|
|
299
|
+
'& img': {
|
|
300
|
+
width: 14,
|
|
301
|
+
height: 14,
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
export const getDialogPaperStyle = (width, height) => ({
|
|
305
|
+
margin: 0,
|
|
306
|
+
maxHeight: '100%',
|
|
307
|
+
maxWidth: 'none',
|
|
308
|
+
width,
|
|
309
|
+
height,
|
|
310
|
+
borderRadius: 12,
|
|
311
|
+
overflow: 'hidden',
|
|
312
|
+
boxShadow: '0px 8px 32px rgba(0, 0, 0, 0.15)',
|
|
313
|
+
});
|
|
314
|
+
export const dialogSx = {
|
|
315
|
+
backgroundColor: 'transparent',
|
|
316
|
+
pointerEvents: 'none',
|
|
317
|
+
zIndex: 1300,
|
|
318
|
+
'& .MuiDialog-container': {
|
|
319
|
+
transition: 'none !important',
|
|
320
|
+
zIndex: 1300,
|
|
321
|
+
},
|
|
322
|
+
'& .MuiDialog-paper': {
|
|
323
|
+
transition: 'none !important',
|
|
324
|
+
pointerEvents: 'auto',
|
|
325
|
+
zIndex: 1300,
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
export const ResetHeaderBox = styled(Box)(({ theme }) => ({
|
|
329
|
+
display: 'flex',
|
|
330
|
+
alignItems: 'center',
|
|
331
|
+
justifyContent: 'space-between',
|
|
332
|
+
paddingLeft: theme.spacing(1.5),
|
|
333
|
+
paddingRight: theme.spacing(1.5),
|
|
334
|
+
paddingTop: theme.spacing(1),
|
|
335
|
+
paddingBottom: theme.spacing(1),
|
|
336
|
+
cursor: 'pointer',
|
|
337
|
+
'&:hover': {
|
|
338
|
+
backgroundColor: theme.palette.action.hover,
|
|
339
|
+
},
|
|
340
|
+
}));
|
|
341
|
+
export const ResetCheckboxSx = {
|
|
342
|
+
p: 0,
|
|
343
|
+
width: 14,
|
|
344
|
+
height: 14,
|
|
345
|
+
minWidth: 14,
|
|
346
|
+
minHeight: 14,
|
|
347
|
+
'&.Mui-checked': { color: 'info.dark' },
|
|
348
|
+
'&.MuiCheckbox-indeterminate': { color: 'info.dark' },
|
|
349
|
+
'& .MuiSvgIcon-root': { width: 14, height: 14 },
|
|
350
|
+
};
|
|
351
|
+
export const SubmenuContainer = styled(Box)(() => ({
|
|
352
|
+
minWidth: 200,
|
|
353
|
+
}));
|
|
354
|
+
export const ColumnItemsContainer = styled(Box)(() => ({
|
|
355
|
+
maxHeight: 300,
|
|
356
|
+
overflowY: 'auto',
|
|
357
|
+
paddingLeft: 6,
|
|
358
|
+
paddingRight: 6,
|
|
359
|
+
}));
|
|
360
|
+
export const SaveCustomViewBox = styled(Box)(() => ({
|
|
361
|
+
paddingLeft: 8,
|
|
362
|
+
paddingRight: 8,
|
|
363
|
+
paddingTop: 8,
|
|
364
|
+
paddingBottom: 8,
|
|
365
|
+
}));
|
|
366
|
+
export const SaveCustomViewInnerBox = styled(Box)(({ disabled }) => ({
|
|
367
|
+
width: '100%',
|
|
368
|
+
borderRadius: '8px',
|
|
369
|
+
backgroundColor: '#1F88D00D',
|
|
370
|
+
padding: '8px',
|
|
371
|
+
marginLeft: 6,
|
|
372
|
+
marginRight: 6,
|
|
373
|
+
display: 'flex',
|
|
374
|
+
flexDirection: 'column',
|
|
375
|
+
gap: '6px',
|
|
376
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
377
|
+
opacity: disabled ? 0.5 : 1,
|
|
378
|
+
}));
|
|
379
|
+
export const ButtonsContainer = styled(Box)(() => ({
|
|
380
|
+
display: 'flex',
|
|
381
|
+
justifyContent: 'flex-end',
|
|
382
|
+
gap: 12,
|
|
383
|
+
paddingTop: 8,
|
|
384
|
+
paddingBottom: 8,
|
|
385
|
+
paddingLeft: 12,
|
|
386
|
+
paddingRight: 12,
|
|
387
|
+
}));
|
|
388
|
+
export const CancelButtonSx = {
|
|
389
|
+
fontSize: 11,
|
|
390
|
+
fontWeight: 400,
|
|
391
|
+
textTransform: 'none',
|
|
392
|
+
color: 'text.primary',
|
|
393
|
+
minWidth: 80,
|
|
394
|
+
height: 38,
|
|
395
|
+
borderRadius: '8px',
|
|
396
|
+
border: '1px solid #F2F2F2',
|
|
397
|
+
};
|
|
398
|
+
export const OkayButtonSx = {
|
|
399
|
+
fontSize: 11,
|
|
400
|
+
fontWeight: 500,
|
|
401
|
+
textTransform: 'none',
|
|
402
|
+
backgroundColor: '#1F88D0',
|
|
403
|
+
minWidth: 80,
|
|
404
|
+
height: 38,
|
|
405
|
+
borderRadius: '8px',
|
|
406
|
+
boxShadow: 'none',
|
|
407
|
+
'&:hover': {
|
|
408
|
+
backgroundColor: '#1976B8',
|
|
409
|
+
boxShadow: 'none',
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
export const ModifiedTextSx = {
|
|
413
|
+
color: '#20232B80',
|
|
414
|
+
fontSize: '9px',
|
|
415
|
+
fontWeight: 500,
|
|
416
|
+
marginLeft: '4px',
|
|
417
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ColumnViewProps } from '../../../types/index.js';
|
|
3
|
+
import type { TableHeaderProps, ViewOption } from '../type';
|
|
4
|
+
export type ViewMode = 'advanced' | 'sheet';
|
|
5
|
+
export interface ViewMenuItem {
|
|
6
|
+
label: string;
|
|
7
|
+
id: string;
|
|
8
|
+
columns?: string[];
|
|
9
|
+
submenu?: ColumnViewProps[];
|
|
10
|
+
isCustom?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface FieldItem {
|
|
13
|
+
code: string;
|
|
14
|
+
name: {
|
|
15
|
+
text: string;
|
|
16
|
+
lang: string;
|
|
17
|
+
}[];
|
|
18
|
+
default?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ColumnItem {
|
|
21
|
+
code: string;
|
|
22
|
+
name: {
|
|
23
|
+
text: string;
|
|
24
|
+
lang: string;
|
|
25
|
+
}[];
|
|
26
|
+
order?: number;
|
|
27
|
+
default?: boolean;
|
|
28
|
+
fields?: FieldItem[];
|
|
29
|
+
}
|
|
30
|
+
export interface LayoutSection {
|
|
31
|
+
code: string;
|
|
32
|
+
columns: ColumnItem[];
|
|
33
|
+
}
|
|
34
|
+
export interface CreateCustomViewDialogProps {
|
|
35
|
+
open: boolean;
|
|
36
|
+
onClose: () => void;
|
|
37
|
+
onCreate?: (data: {
|
|
38
|
+
name: string;
|
|
39
|
+
selectedColumns: ColumnViewProps[];
|
|
40
|
+
}) => Promise<void>;
|
|
41
|
+
availableColumns?: ColumnViewProps[];
|
|
42
|
+
isLoading?: boolean;
|
|
43
|
+
defaultColumns?: ColumnViewProps[];
|
|
44
|
+
editingView?: {
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
submenu?: ColumnViewProps[];
|
|
48
|
+
} | null;
|
|
49
|
+
onDelete?: (viewId: string) => Promise<void>;
|
|
50
|
+
tableViews?: ColumnViewProps[];
|
|
51
|
+
}
|
|
52
|
+
export interface ColumnCheckState {
|
|
53
|
+
checked: boolean;
|
|
54
|
+
indeterminate: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface ViewsManagerProps {
|
|
57
|
+
onViewChange?: TableHeaderProps['onViewChange'];
|
|
58
|
+
setIsViewVisible: (visible: boolean) => void;
|
|
59
|
+
setTableViews?: TableHeaderProps['setTableViews'];
|
|
60
|
+
tableViews?: TableHeaderProps['tableViews'];
|
|
61
|
+
resetTableViews?: TableHeaderProps['resetTableViews'];
|
|
62
|
+
customViews?: ViewMenuItem[];
|
|
63
|
+
onCreateCustomView?: (data: {
|
|
64
|
+
name: string;
|
|
65
|
+
selectedColumns: ColumnViewProps[];
|
|
66
|
+
}) => Promise<void>;
|
|
67
|
+
onEditCustomView?: (viewId: string, data: {
|
|
68
|
+
name: string;
|
|
69
|
+
selectedColumns: ColumnViewProps[];
|
|
70
|
+
}) => Promise<void>;
|
|
71
|
+
onDeleteCustomView?: (viewId: string) => Promise<void>;
|
|
72
|
+
mode?: ViewMode;
|
|
73
|
+
onTableViewsChange?: (tableViews: ColumnViewProps[]) => void;
|
|
74
|
+
initialTableViews?: ColumnViewProps[];
|
|
75
|
+
onCustomViewsChange?: (customViews: ViewMenuItem[]) => void;
|
|
76
|
+
initialCustomViews?: ViewMenuItem[];
|
|
77
|
+
layoutData?: LayoutSection[];
|
|
78
|
+
}
|
|
79
|
+
export interface ViewsDropdownProps {
|
|
80
|
+
open: boolean;
|
|
81
|
+
selectedViewInfo: ViewOption;
|
|
82
|
+
setSelectedViewInfo: (selected: ViewOption) => void;
|
|
83
|
+
onSelect: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
84
|
+
setViews?: (views: string[]) => void;
|
|
85
|
+
anchorEl: Element | null;
|
|
86
|
+
tableViews?: ColumnViewProps[];
|
|
87
|
+
setTableViews?: (columns: ColumnViewProps[]) => void;
|
|
88
|
+
onCreateCustomView?: (useCurrentState?: boolean) => void;
|
|
89
|
+
customViews?: ViewMenuItem[];
|
|
90
|
+
onEditCustomView?: (view: ViewMenuItem) => void;
|
|
91
|
+
defaultColumns?: ColumnViewProps[];
|
|
92
|
+
setDefaultColumns?: (columns: ColumnViewProps[]) => void;
|
|
93
|
+
}
|
|
94
|
+
export interface ColumnListProps {
|
|
95
|
+
selectedColumns: ColumnViewProps[];
|
|
96
|
+
columnNames: string[];
|
|
97
|
+
allSelected: boolean;
|
|
98
|
+
someSelected: boolean;
|
|
99
|
+
hoveredColumn: string | null;
|
|
100
|
+
anchorEl: HTMLElement | null;
|
|
101
|
+
onReorder: (reorderedNames: string[]) => void;
|
|
102
|
+
onColumnToggle: (columnName: string) => void;
|
|
103
|
+
onSubItemToggle: (columnName: string, subItemName: string) => void;
|
|
104
|
+
onSelectAll: () => void;
|
|
105
|
+
onResetToDefault: () => void;
|
|
106
|
+
onSubmenuEnter: (columnName: string, element: HTMLElement) => void;
|
|
107
|
+
onSubmenuLeave: () => void;
|
|
108
|
+
onCancelClose: () => void;
|
|
109
|
+
hasChanges?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export interface ViewsSubmenuProps {
|
|
112
|
+
columns: ColumnViewProps[];
|
|
113
|
+
allCurrentSelected: boolean;
|
|
114
|
+
someCurrentSelected: boolean;
|
|
115
|
+
onSelectAll: () => void;
|
|
116
|
+
onReset: () => void;
|
|
117
|
+
onColumnToggle: (columnName: string) => void;
|
|
118
|
+
onNestedItemToggle: (columnName: string, subItemName: string) => void;
|
|
119
|
+
anchorEl: HTMLElement | null;
|
|
120
|
+
}
|
|
121
|
+
export interface UseCreateViewDialogProps {
|
|
122
|
+
open: boolean;
|
|
123
|
+
availableColumns: ColumnViewProps[];
|
|
124
|
+
defaultColumns: ColumnViewProps[];
|
|
125
|
+
editingView?: {
|
|
126
|
+
id: string;
|
|
127
|
+
label: string;
|
|
128
|
+
submenu?: ColumnViewProps[];
|
|
129
|
+
} | null;
|
|
130
|
+
tableViews?: ColumnViewProps[];
|
|
131
|
+
}
|
|
132
|
+
export interface UseViewsManagerProps {
|
|
133
|
+
mode: ViewMode;
|
|
134
|
+
layoutData?: LayoutSection[];
|
|
135
|
+
initialTableViews?: ColumnViewProps[];
|
|
136
|
+
initialCustomViews?: ViewMenuItem[];
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { ColumnViewProps } from '../../../types/index.js';
|
|
2
|
+
import type { LayoutSection, ViewMenuItem, ColumnCheckState, ViewMode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Transform API layout response to internal ColumnViewProps format
|
|
5
|
+
*/
|
|
6
|
+
export declare const transformLayoutToColumns: (layout: LayoutSection[], lang?: string) => ColumnViewProps[];
|
|
7
|
+
export declare const getColumnsByMode: (mode: ViewMode, layoutData?: LayoutSection[]) => ColumnViewProps[];
|
|
8
|
+
export declare const isDateColumn: (name: string) => boolean;
|
|
9
|
+
export declare const getColumnCheckState: (column: ColumnViewProps) => ColumnCheckState;
|
|
10
|
+
export declare const createCustomViewMenuItem: (name: string, selectedColumns: ColumnViewProps[]) => ViewMenuItem;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize columns for editing mode
|
|
13
|
+
*/
|
|
14
|
+
export declare const initializeEditingColumns: (editingColumns: ColumnViewProps[], availableColumns: ColumnViewProps[]) => ColumnViewProps[];
|
|
15
|
+
/**
|
|
16
|
+
* Initialize columns for create mode (all unchecked except date)
|
|
17
|
+
*/
|
|
18
|
+
export declare const initializeCreateColumns: (availableColumns: ColumnViewProps[]) => ColumnViewProps[];
|
|
19
|
+
/**
|
|
20
|
+
* Initialize columns for create mode with current tableViews state (preserves checked/unchecked values)
|
|
21
|
+
*/
|
|
22
|
+
export declare const initializeCreateColumnsWithCurrentState: (availableColumns: ColumnViewProps[], currentTableViews: ColumnViewProps[]) => ColumnViewProps[];
|
|
23
|
+
/**
|
|
24
|
+
* Reset columns to their default selection state
|
|
25
|
+
*/
|
|
26
|
+
export declare const resetColumnsToDefault: (columns: ColumnViewProps[]) => ColumnViewProps[];
|
|
27
|
+
/**
|
|
28
|
+
* Toggle a column's selection (including all children if present)
|
|
29
|
+
*/
|
|
30
|
+
export declare const toggleColumn: (columns: ColumnViewProps[], columnName: string) => ColumnViewProps[];
|
|
31
|
+
/**
|
|
32
|
+
* Toggle a sub-item's selection and update parent state
|
|
33
|
+
*/
|
|
34
|
+
export declare const toggleSubItem: (columns: ColumnViewProps[], columnName: string, subItemName: string) => ColumnViewProps[];
|
|
35
|
+
/**
|
|
36
|
+
* Select or deselect all columns (except date)
|
|
37
|
+
*/
|
|
38
|
+
export declare const toggleAllColumns: (columns: ColumnViewProps[], selectAll: boolean) => ColumnViewProps[];
|
|
39
|
+
/**
|
|
40
|
+
* Check if all non-date columns are selected
|
|
41
|
+
*/
|
|
42
|
+
export declare const areAllColumnsSelected: (columns: ColumnViewProps[]) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check if some (but not all) non-date columns are selected
|
|
45
|
+
*/
|
|
46
|
+
export declare const areSomeColumnsSelected: (columns: ColumnViewProps[], allSelected: boolean) => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Validate template name
|
|
49
|
+
*/
|
|
50
|
+
export declare const isValidTemplateName: (name: string, maxLength: number) => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Deep clone columns array with all nested properties
|
|
53
|
+
*/
|
|
54
|
+
export declare const deepCloneColumns: (columns: ColumnViewProps[]) => ColumnViewProps[];
|
|
55
|
+
/**
|
|
56
|
+
* Toggle a single column's selection state
|
|
57
|
+
*/
|
|
58
|
+
export declare const toggleSingleColumn: (columns: ColumnViewProps[], columnName: string) => ColumnViewProps[];
|
|
59
|
+
/**
|
|
60
|
+
* Get submenu items for a view menu item
|
|
61
|
+
*/
|
|
62
|
+
export declare const getSubmenuItems: (item: ViewMenuItem, defaultColumns: ColumnViewProps[]) => ColumnViewProps[];
|
|
63
|
+
/**
|
|
64
|
+
* Check if a view menu item has submenu
|
|
65
|
+
*/
|
|
66
|
+
export declare const hasSubmenu: (item: ViewMenuItem, defaultColumns: ColumnViewProps[]) => boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Check if all columns in current state are selected
|
|
69
|
+
*/
|
|
70
|
+
export declare const areAllCurrentColumnsSelected: (columns: ColumnViewProps[]) => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Check if some (but not all) columns in current state are selected
|
|
73
|
+
*/
|
|
74
|
+
export declare const areSomeCurrentColumnsSelected: (columns: ColumnViewProps[], allSelected: boolean) => boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Toggle all columns selection (select all or unselect all)
|
|
77
|
+
*/
|
|
78
|
+
export declare const toggleAllCurrentColumns: (columns: ColumnViewProps[], shouldSelect: boolean) => ColumnViewProps[];
|
|
79
|
+
/**
|
|
80
|
+
* Normalize columns by converting undefined selected values to false for consistent comparison
|
|
81
|
+
*/
|
|
82
|
+
export declare const normalizeColumnsSelected: (columns: ColumnViewProps[]) => ColumnViewProps[];
|
|
83
|
+
/**
|
|
84
|
+
* Compare two columns arrays to check if they are equal (same order, same selection states)
|
|
85
|
+
*/
|
|
86
|
+
export declare const areColumnsEqual: (cols1: ColumnViewProps[], cols2: ColumnViewProps[]) => boolean;
|