@tap-payments/os-micro-frontend-shared 0.1.376-test.9 → 0.1.377-test.1
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/TableCells/CustomCells/BalanceCell/BalanceCell.js +8 -3
- 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 +91 -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 +189 -0
- package/build/components/TableHeader/TableView/ViewsMenu.d.ts +5 -0
- package/build/components/TableHeader/TableView/ViewsMenu.js +76 -0
- package/build/components/TableHeader/TableView/components/ColumnList.d.ts +3 -0
- package/build/components/TableHeader/TableView/components/ColumnList.js +70 -0
- package/build/components/TableHeader/TableView/components/ViewsSubmenu.d.ts +3 -0
- package/build/components/TableHeader/TableView/components/ViewsSubmenu.js +75 -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/index.d.ts +6 -0
- package/build/components/TableHeader/TableView/hooks/index.js +6 -0
- package/build/components/TableHeader/TableView/hooks/useCreateViewDialog.d.ts +22 -0
- package/build/components/TableHeader/TableView/hooks/useCreateViewDialog.js +86 -0
- package/build/components/TableHeader/TableView/hooks/useDialogPosition.d.ts +8 -0
- package/build/components/TableHeader/TableView/hooks/useDialogPosition.js +16 -0
- package/build/components/TableHeader/TableView/hooks/useNestedSubmenu.d.ts +7 -0
- package/build/components/TableHeader/TableView/hooks/useNestedSubmenu.js +27 -0
- package/build/components/TableHeader/TableView/hooks/useOriginalColumns.d.ts +6 -0
- package/build/components/TableHeader/TableView/hooks/useOriginalColumns.js +18 -0
- package/build/components/TableHeader/TableView/hooks/useSubmenuHover.d.ts +8 -0
- package/build/components/TableHeader/TableView/hooks/useSubmenuHover.js +43 -0
- package/build/components/TableHeader/TableView/hooks/useViewsManager.d.ts +9 -0
- package/build/components/TableHeader/TableView/hooks/useViewsManager.js +62 -0
- package/build/components/TableHeader/TableView/hooks/useViewsMenu.d.ts +44 -0
- package/build/components/TableHeader/TableView/hooks/useViewsMenu.js +177 -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 +426 -0
- package/build/components/TableHeader/TableView/types.d.ts +182 -0
- package/build/components/TableHeader/TableView/types.js +1 -0
- package/build/components/TableHeader/TableView/utils.d.ts +121 -0
- package/build/components/TableHeader/TableView/utils.js +469 -0
- package/build/components/TableHeader/index.d.ts +1 -0
- package/build/components/TableHeader/type.d.ts +15 -1
- package/build/components/VirtualTables/VirtualTable/VirtualTable.d.ts +1 -1
- package/build/components/VirtualTables/VirtualTable/VirtualTable.js +4 -3
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/types/table.d.ts +1 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/skeletonColumns.d.ts +4 -0
- package/build/utils/skeletonColumns.js +17 -0
- package/package.json +3 -2
|
@@ -0,0 +1,426 @@
|
|
|
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
|
+
display: 'flex',
|
|
354
|
+
flexDirection: 'column',
|
|
355
|
+
maxHeight: '80vh',
|
|
356
|
+
overflow: 'hidden',
|
|
357
|
+
}));
|
|
358
|
+
export const ColumnItemsContainer = styled(Box)(() => ({
|
|
359
|
+
flex: 1,
|
|
360
|
+
overflowY: 'auto',
|
|
361
|
+
paddingLeft: 6,
|
|
362
|
+
paddingRight: 6,
|
|
363
|
+
minHeight: 0,
|
|
364
|
+
}));
|
|
365
|
+
export const SaveCustomViewBox = styled(Box)(() => ({
|
|
366
|
+
paddingLeft: 8,
|
|
367
|
+
paddingRight: 8,
|
|
368
|
+
paddingTop: 8,
|
|
369
|
+
paddingBottom: 8,
|
|
370
|
+
flexShrink: 0,
|
|
371
|
+
}));
|
|
372
|
+
export const SaveCustomViewInnerBox = styled(Box)(({ disabled }) => ({
|
|
373
|
+
width: '100%',
|
|
374
|
+
borderRadius: '8px',
|
|
375
|
+
backgroundColor: '#1F88D00D',
|
|
376
|
+
padding: '8px',
|
|
377
|
+
marginLeft: 6,
|
|
378
|
+
marginRight: 6,
|
|
379
|
+
display: 'flex',
|
|
380
|
+
flexDirection: 'column',
|
|
381
|
+
gap: '6px',
|
|
382
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
383
|
+
opacity: disabled ? 0.5 : 1,
|
|
384
|
+
}));
|
|
385
|
+
export const ButtonsContainer = styled(Box)(({ theme }) => ({
|
|
386
|
+
display: 'flex',
|
|
387
|
+
justifyContent: 'flex-end',
|
|
388
|
+
gap: 12,
|
|
389
|
+
paddingTop: 8,
|
|
390
|
+
paddingBottom: 8,
|
|
391
|
+
paddingLeft: 12,
|
|
392
|
+
paddingRight: 12,
|
|
393
|
+
flexShrink: 0,
|
|
394
|
+
borderTop: '1px solid',
|
|
395
|
+
borderColor: theme.palette.divider,
|
|
396
|
+
}));
|
|
397
|
+
export const CancelButtonSx = {
|
|
398
|
+
fontSize: 11,
|
|
399
|
+
fontWeight: 400,
|
|
400
|
+
textTransform: 'none',
|
|
401
|
+
color: 'text.primary',
|
|
402
|
+
minWidth: 80,
|
|
403
|
+
height: 38,
|
|
404
|
+
borderRadius: '8px',
|
|
405
|
+
border: '1px solid #F2F2F2',
|
|
406
|
+
};
|
|
407
|
+
export const OkayButtonSx = {
|
|
408
|
+
fontSize: 11,
|
|
409
|
+
fontWeight: 500,
|
|
410
|
+
textTransform: 'none',
|
|
411
|
+
backgroundColor: '#1F88D0',
|
|
412
|
+
minWidth: 80,
|
|
413
|
+
height: 38,
|
|
414
|
+
borderRadius: '8px',
|
|
415
|
+
boxShadow: 'none',
|
|
416
|
+
'&:hover': {
|
|
417
|
+
backgroundColor: '#1976B8',
|
|
418
|
+
boxShadow: 'none',
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
export const ModifiedTextSx = {
|
|
422
|
+
color: '#20232B80',
|
|
423
|
+
fontSize: '9px',
|
|
424
|
+
fontWeight: 500,
|
|
425
|
+
marginLeft: '4px',
|
|
426
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { ColumnViewProps, TableMode } from '../../../types/index.js';
|
|
2
|
+
import type { TableHeaderProps, ViewOption } from '../type';
|
|
3
|
+
export interface ViewMenuItem {
|
|
4
|
+
label: string;
|
|
5
|
+
id: string;
|
|
6
|
+
templateId?: string;
|
|
7
|
+
columns?: string[];
|
|
8
|
+
submenu?: ColumnViewProps[];
|
|
9
|
+
isCustom?: boolean;
|
|
10
|
+
default?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface FieldItem {
|
|
13
|
+
code: string;
|
|
14
|
+
name: {
|
|
15
|
+
text: string;
|
|
16
|
+
lang: string;
|
|
17
|
+
}[];
|
|
18
|
+
order?: number | null;
|
|
19
|
+
default?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ColumnItem {
|
|
22
|
+
code: string;
|
|
23
|
+
name: {
|
|
24
|
+
text: string;
|
|
25
|
+
lang: string;
|
|
26
|
+
}[];
|
|
27
|
+
order?: number;
|
|
28
|
+
default?: boolean;
|
|
29
|
+
fields?: FieldItem[];
|
|
30
|
+
}
|
|
31
|
+
export interface LayoutSection {
|
|
32
|
+
code: string;
|
|
33
|
+
columns: ColumnItem[];
|
|
34
|
+
}
|
|
35
|
+
export interface TemplateAPIMetadata {
|
|
36
|
+
segment: string;
|
|
37
|
+
app: string;
|
|
38
|
+
service: string;
|
|
39
|
+
user: {
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
master_template_id?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface CreateTemplatePayload extends TemplateAPIMetadata {
|
|
45
|
+
name: string;
|
|
46
|
+
layout: LayoutSection[];
|
|
47
|
+
}
|
|
48
|
+
export interface UpdateTemplatePayload extends TemplateAPIMetadata {
|
|
49
|
+
name: string;
|
|
50
|
+
layout: LayoutSection[];
|
|
51
|
+
}
|
|
52
|
+
export interface Template {
|
|
53
|
+
templateId: string;
|
|
54
|
+
segment: string;
|
|
55
|
+
app: string;
|
|
56
|
+
service: string;
|
|
57
|
+
name: string;
|
|
58
|
+
layout: LayoutSection[];
|
|
59
|
+
id: {
|
|
60
|
+
timestamp: number;
|
|
61
|
+
date: string;
|
|
62
|
+
};
|
|
63
|
+
masterTemplateId: string;
|
|
64
|
+
user: {
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
67
|
+
created: number;
|
|
68
|
+
updated: number;
|
|
69
|
+
default: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface TemplatesList {
|
|
72
|
+
object: string;
|
|
73
|
+
live_mode: boolean;
|
|
74
|
+
api_version: string;
|
|
75
|
+
feature_version: string;
|
|
76
|
+
count: number;
|
|
77
|
+
has_more: boolean;
|
|
78
|
+
templates: Template[];
|
|
79
|
+
}
|
|
80
|
+
export interface CreateCustomViewDialogProps {
|
|
81
|
+
open: boolean;
|
|
82
|
+
onClose: () => void;
|
|
83
|
+
onCreate?: (data: {
|
|
84
|
+
name: string;
|
|
85
|
+
selectedColumns: ColumnViewProps[];
|
|
86
|
+
layout: LayoutSection;
|
|
87
|
+
}) => Promise<void>;
|
|
88
|
+
availableColumns?: ColumnViewProps[];
|
|
89
|
+
defaultColumns?: ColumnViewProps[];
|
|
90
|
+
editingView?: {
|
|
91
|
+
id: string;
|
|
92
|
+
label: string;
|
|
93
|
+
templateId?: string;
|
|
94
|
+
submenu?: ColumnViewProps[];
|
|
95
|
+
} | null;
|
|
96
|
+
onDelete?: (viewId: string) => Promise<void>;
|
|
97
|
+
tableViews?: ColumnViewProps[];
|
|
98
|
+
mode?: TableMode;
|
|
99
|
+
}
|
|
100
|
+
export interface ColumnCheckState {
|
|
101
|
+
checked: boolean;
|
|
102
|
+
indeterminate: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface ViewsMenuProps {
|
|
105
|
+
onViewChange?: TableHeaderProps['onViewChange'];
|
|
106
|
+
onCreateCustomView?: (data: {
|
|
107
|
+
name: string;
|
|
108
|
+
selectedColumns: ColumnViewProps[];
|
|
109
|
+
layout: LayoutSection;
|
|
110
|
+
}) => Promise<void>;
|
|
111
|
+
onEditCustomView?: (viewId: string, data: {
|
|
112
|
+
name: string;
|
|
113
|
+
selectedColumns: ColumnViewProps[];
|
|
114
|
+
layout: LayoutSection;
|
|
115
|
+
}) => Promise<void>;
|
|
116
|
+
onDeleteCustomView?: (viewId: string) => Promise<void>;
|
|
117
|
+
tableMode?: TableMode;
|
|
118
|
+
templates: Template[];
|
|
119
|
+
lang?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface ViewsDropdownProps {
|
|
122
|
+
open: boolean;
|
|
123
|
+
selectedViewInfo: ViewOption;
|
|
124
|
+
setSelectedViewInfo: (selected: ViewOption, viewMenuItem?: ViewMenuItem) => void;
|
|
125
|
+
anchorEl: Element | null;
|
|
126
|
+
defaultModified?: boolean;
|
|
127
|
+
onMarkDefaultModified?: () => void;
|
|
128
|
+
onCreateCustomView?: (useCurrentState?: boolean) => void;
|
|
129
|
+
customViews?: ViewMenuItem[];
|
|
130
|
+
onEditCustomView?: (view: ViewMenuItem) => void;
|
|
131
|
+
onSaveDefaultColumns?: (columns: ColumnViewProps[]) => void;
|
|
132
|
+
defaultColumns?: ColumnViewProps[];
|
|
133
|
+
setDefaultColumns?: (columns: ColumnViewProps[]) => void;
|
|
134
|
+
updateSelectedView?: (view: ViewMenuItem) => void;
|
|
135
|
+
mode?: TableMode;
|
|
136
|
+
defaultTemplate?: ViewMenuItem;
|
|
137
|
+
}
|
|
138
|
+
export interface ColumnListProps {
|
|
139
|
+
selectedColumns: ColumnViewProps[];
|
|
140
|
+
columnNames: string[];
|
|
141
|
+
allSelected: boolean;
|
|
142
|
+
someSelected: boolean;
|
|
143
|
+
hoveredColumn: string | null;
|
|
144
|
+
anchorEl: HTMLElement | null;
|
|
145
|
+
onReorder: (reorderedNames: string[]) => void;
|
|
146
|
+
onColumnToggle: (columnName: string) => void;
|
|
147
|
+
onSubItemToggle: (columnName: string, subItemName: string) => void;
|
|
148
|
+
onSelectAll: () => void;
|
|
149
|
+
onResetToDefault: () => void;
|
|
150
|
+
onSubmenuEnter: (columnName: string, element: HTMLElement) => void;
|
|
151
|
+
onSubmenuLeave: () => void;
|
|
152
|
+
onCancelClose: () => void;
|
|
153
|
+
hasChanges?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface ViewsSubmenuProps {
|
|
156
|
+
columns: ColumnViewProps[];
|
|
157
|
+
allCurrentSelected: boolean;
|
|
158
|
+
someCurrentSelected: boolean;
|
|
159
|
+
onSelectAll: () => void;
|
|
160
|
+
onReset: () => void;
|
|
161
|
+
onColumnToggle: (columnName: string) => void;
|
|
162
|
+
onNestedItemToggle: (columnName: string, subItemName: string) => void;
|
|
163
|
+
onReorder: (reorderedColumnNames: string[]) => void;
|
|
164
|
+
anchorEl: HTMLElement | null;
|
|
165
|
+
isModified?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface UseCreateViewDialogProps {
|
|
168
|
+
open: boolean;
|
|
169
|
+
availableColumns: ColumnViewProps[];
|
|
170
|
+
defaultColumns: ColumnViewProps[];
|
|
171
|
+
editingView?: {
|
|
172
|
+
id: string;
|
|
173
|
+
label: string;
|
|
174
|
+
submenu?: ColumnViewProps[];
|
|
175
|
+
} | null;
|
|
176
|
+
tableViews?: ColumnViewProps[];
|
|
177
|
+
}
|
|
178
|
+
export interface UseViewsManagerProps {
|
|
179
|
+
tableMode: TableMode;
|
|
180
|
+
templates: Template[];
|
|
181
|
+
lang?: string;
|
|
182
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|