rez-table-listing-mui 1.3.62 → 2.0.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/dist/index.d.ts +5 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/listing/components/index.scss +0 -144
- package/src/listing/components/login/index.tsx +4 -4
- package/src/listing/components/pagination/default/index.tsx +108 -138
- package/src/listing/components/pagination/default/pagination.styles.ts +115 -0
- package/src/listing/components/search/index.tsx +4 -8
- package/src/listing/components/{table-body-dnd-cell.tsx → table-body/table-body-dnd-cell.tsx} +18 -25
- package/src/listing/components/table-body/table-body.styles.ts +64 -0
- package/src/listing/components/{table-body.tsx → table-body/table-body.tsx} +35 -32
- package/src/listing/components/table-head/table-head-dnd-cell.tsx +112 -0
- package/src/listing/components/table-head/table-head-pin.tsx +29 -0
- package/src/listing/components/{table-head-popover.tsx → table-head/table-head-popover.tsx} +4 -16
- package/src/listing/components/table-head/table-head-resizer.tsx +22 -0
- package/src/listing/components/table-head/table-head.styles.ts +113 -0
- package/src/listing/components/{table-head.tsx → table-head/table-head.tsx} +36 -69
- package/src/listing/components/table.tsx +2 -2
- package/src/listing/components/tabs/index.tsx +31 -49
- package/src/listing/components/tabs/tabs.styles.ts +49 -0
- package/src/listing/components/topbar/index.scss +2 -4
- package/src/listing/components/topbar/index.tsx +169 -175
- package/src/listing/libs/hooks/useEntityTableHooks.ts +3 -3
- package/src/listing/libs/utils/apiColumn.ts +7 -3
- package/src/listing/libs/utils/common.ts +44 -0
- package/src/listing/types/table.ts +2 -2
- package/src/view/ListingView.tsx +38 -87
- package/src/listing/components/table-head-dnd-cell.tsx +0 -150
- package/src/listing/components/table-head-pin.tsx +0 -22
- package/src/listing/components/tabs/index.scss +0 -42
- package/src/listing/components/tabs/styles.ts +0 -34
package/package.json
CHANGED
|
@@ -65,152 +65,14 @@
|
|
|
65
65
|
max-height: calc(100vh - 56px);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.ts__table.ts--striped > .ts__body > .ts__body__tr:nth-of-type(odd) {
|
|
69
|
-
background-color: var(--grey-200);
|
|
70
|
-
}
|
|
71
|
-
.ts__table:not(.ts--striped) > .ts__body > .ts__body__tr:hover {
|
|
72
|
-
background-color: var(--grey-100);
|
|
73
|
-
box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.05),
|
|
74
|
-
inset 0 -2px 2px rgba(0, 0, 0, 0.05);
|
|
75
|
-
}
|
|
76
|
-
.ts__table:not(.ts--striped) > .ts__head > .ts__head__tr {
|
|
77
|
-
background-color: var(--grey-100);
|
|
78
|
-
|
|
79
|
-
.ts__head__th {
|
|
80
|
-
border: 1px solid var(--grey-500);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.ts__table.ts--compact {
|
|
85
|
-
.ts__head > .ts__head__tr > .ts__head__th {
|
|
86
|
-
padding: 0.25rem 0.5rem;
|
|
87
|
-
|
|
88
|
-
.ts__content {
|
|
89
|
-
font-size: 0.875rem;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.ts__body > .ts__body__tr > .ts__body__td {
|
|
94
|
-
padding: 0.25rem 0.5rem;
|
|
95
|
-
|
|
96
|
-
.ts__content {
|
|
97
|
-
font-size: 0.75rem;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
68
|
.ts__table {
|
|
103
69
|
width: max-content;
|
|
104
70
|
min-width: 100%;
|
|
105
71
|
border-spacing: 0;
|
|
106
72
|
border-collapse: separate;
|
|
107
|
-
|
|
108
|
-
.ts__head.ts--sticky {
|
|
109
|
-
position: sticky;
|
|
110
|
-
top: 0rem;
|
|
111
|
-
z-index: 3;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.ts__head {
|
|
115
|
-
position: relative;
|
|
116
|
-
// box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05); //removing shadow below table header
|
|
117
|
-
|
|
118
|
-
.ts__head__tr {
|
|
119
|
-
background-color: var(--white);
|
|
120
|
-
|
|
121
|
-
.ts__head__th {
|
|
122
|
-
position: relative;
|
|
123
|
-
padding: 0.5rem 1rem;
|
|
124
|
-
border: 1px solid var(--grey-500);
|
|
125
|
-
cursor: pointer;
|
|
126
|
-
|
|
127
|
-
.ts__dnd__button {
|
|
128
|
-
color: var(--grey-600);
|
|
129
|
-
// width: max-content;
|
|
130
|
-
// height: max-content;
|
|
131
|
-
// cursor: grabbing;
|
|
132
|
-
|
|
133
|
-
&:hover {
|
|
134
|
-
scale: 1.1;
|
|
135
|
-
color: var(--grey-900);
|
|
136
|
-
width: max-content;
|
|
137
|
-
height: max-content;
|
|
138
|
-
cursor: grabbing;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.ts__content {
|
|
143
|
-
display: flex;
|
|
144
|
-
align-items: center;
|
|
145
|
-
gap: 0.25rem;
|
|
146
|
-
min-height: 44px; // to give min height of 60 px
|
|
147
|
-
|
|
148
|
-
.ts__content__sort {
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
user-select: none;
|
|
151
|
-
|
|
152
|
-
svg {
|
|
153
|
-
margin-left: 0.25rem;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.ts--head--button {
|
|
158
|
-
display: flex;
|
|
159
|
-
justify-content: center;
|
|
160
|
-
align-items: center;
|
|
161
|
-
cursor: pointer;
|
|
162
|
-
|
|
163
|
-
&:hover {
|
|
164
|
-
scale: 1.1;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
svg {
|
|
168
|
-
color: var(--grey-700);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.column__resize {
|
|
174
|
-
position: absolute;
|
|
175
|
-
top: 0;
|
|
176
|
-
right: 0;
|
|
177
|
-
height: 100%;
|
|
178
|
-
width: 5px;
|
|
179
|
-
background: rgba(0, 0, 0, 0.5);
|
|
180
|
-
cursor: col-resize;
|
|
181
|
-
user-select: none;
|
|
182
|
-
touch-action: none;
|
|
183
|
-
opacity: 0;
|
|
184
|
-
|
|
185
|
-
&:hover {
|
|
186
|
-
opacity: 1;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.column__resize.is__resizing {
|
|
191
|
-
background: rgba(0, 0, 0, 0.8);
|
|
192
|
-
opacity: 1;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.ts__body {
|
|
199
|
-
.ts__body__tr {
|
|
200
|
-
background-color: var(--white);
|
|
201
|
-
|
|
202
|
-
.ts__body__td {
|
|
203
|
-
font-size: 0.875rem;
|
|
204
|
-
padding: 0.5rem 1rem;
|
|
205
|
-
border-top: 1px solid var(--grey-300);
|
|
206
|
-
border-bottom: 1px solid var(--grey-300);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
73
|
}
|
|
211
74
|
}
|
|
212
75
|
}
|
|
213
|
-
// Full screen styles fixes
|
|
214
76
|
|
|
215
77
|
:fullscreen {
|
|
216
78
|
width: 100vw !important;
|
|
@@ -229,9 +91,3 @@
|
|
|
229
91
|
background: var(--white);
|
|
230
92
|
overflow: hidden;
|
|
231
93
|
}
|
|
232
|
-
|
|
233
|
-
// .ts__table__wrapper.is-fullscreen {
|
|
234
|
-
// height: calc(100vh - 56px);
|
|
235
|
-
// max-height: none;
|
|
236
|
-
// overflow-y: auto;
|
|
237
|
-
// }
|
|
@@ -10,8 +10,8 @@ const LoginButton = () => {
|
|
|
10
10
|
// const api_url = "https://api.eth-qa.rezolut.in/api/enrol/auth";
|
|
11
11
|
const api_url = "http://localhost:6010/api/auth";
|
|
12
12
|
const email_id = "admin@rezolut.in";
|
|
13
|
-
const
|
|
14
|
-
const sub_domain = "
|
|
13
|
+
const verify_otp = "123456";
|
|
14
|
+
const sub_domain = "platform";
|
|
15
15
|
|
|
16
16
|
setLoading(true);
|
|
17
17
|
|
|
@@ -26,10 +26,10 @@ const LoginButton = () => {
|
|
|
26
26
|
identifier: email_id,
|
|
27
27
|
service: "email",
|
|
28
28
|
reset: true,
|
|
29
|
-
otp:
|
|
29
|
+
otp: verify_otp,
|
|
30
30
|
otp_id: otpAPIResponse.data.otp_id,
|
|
31
31
|
fcm_token: "",
|
|
32
|
-
subdomain:
|
|
32
|
+
subdomain: sub_domain,
|
|
33
33
|
})
|
|
34
34
|
.then((otpVerifyResponse) => {
|
|
35
35
|
const token = otpVerifyResponse.data.accessToken;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Table } from "@tanstack/react-table";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// TablePreviousPageIcon,
|
|
7
|
-
} from "../../../../assets/svg";
|
|
8
|
-
import TablePreviousPageIcon from "@mui/icons-material/NavigateBeforeRounded";
|
|
9
|
-
import TableNextPageIcon from "@mui/icons-material/NavigateNextRounded";
|
|
10
|
-
import "./index.scss";
|
|
2
|
+
import { TableFirstPageIcon, TableLastPageIcon } from "../../../../assets/svg";
|
|
3
|
+
import NavigateBeforeRounded from "@mui/icons-material/NavigateBeforeRounded";
|
|
4
|
+
import NavigateNextRounded from "@mui/icons-material/NavigateNextRounded";
|
|
5
|
+
import { MenuItem, Typography } from "@mui/material";
|
|
11
6
|
import { CraftTablePaginationProps } from "../../../types/table";
|
|
7
|
+
import {
|
|
8
|
+
PaginationContainer,
|
|
9
|
+
GoToPageContainer,
|
|
10
|
+
RowsPerPageContainer,
|
|
11
|
+
RecordsRangeContainer,
|
|
12
|
+
PageRangeContainer,
|
|
13
|
+
PaginationButtons,
|
|
14
|
+
PaginationButton,
|
|
15
|
+
RowsPerPageSelect,
|
|
16
|
+
GoToPageInput,
|
|
17
|
+
} from "./pagination.styles";
|
|
12
18
|
|
|
13
19
|
interface DefaultPaginationProps<T> {
|
|
14
20
|
table: Table<T>;
|
|
@@ -25,145 +31,109 @@ function DefaultPagination<T>({
|
|
|
25
31
|
const pageCount = table.getPageCount();
|
|
26
32
|
const pageSize = table.getState().pagination.pageSize;
|
|
27
33
|
const rowCount = table.getRowCount();
|
|
34
|
+
|
|
28
35
|
const recordsRangeFirst = pageIndex * pageSize - pageSize + 1;
|
|
29
36
|
const recordsRangeLast = Math.min(pageIndex * pageSize, rowCount);
|
|
30
37
|
|
|
38
|
+
const isFullView = paginationOptions?.paginationView === "full";
|
|
39
|
+
|
|
31
40
|
return (
|
|
32
|
-
<
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
<PaginationContainer>
|
|
42
|
+
{isFullView && (
|
|
43
|
+
<GoToPageContainer>
|
|
44
|
+
<Typography variant="body2" fontSize={14} mr={1}>
|
|
45
|
+
Go to page:
|
|
46
|
+
</Typography>
|
|
47
|
+
<GoToPageInput
|
|
48
|
+
defaultValue={pageIndex}
|
|
49
|
+
type="number"
|
|
50
|
+
inputProps={{
|
|
51
|
+
name: "pagination-size",
|
|
52
|
+
min: 1,
|
|
53
|
+
max: pageCount,
|
|
54
|
+
}}
|
|
55
|
+
onKeyDown={(e) => {
|
|
56
|
+
if (e.key === "Enter") {
|
|
57
|
+
const page = e.currentTarget.value
|
|
58
|
+
? Number(e.currentTarget.value) - 1
|
|
59
|
+
: 0;
|
|
60
|
+
table.setPageIndex(page);
|
|
61
|
+
}
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</GoToPageContainer>
|
|
65
|
+
)}
|
|
66
|
+
|
|
67
|
+
<RowsPerPageContainer>
|
|
68
|
+
{isFullView && (
|
|
69
|
+
<Typography variant="body2" fontSize={14} mr={1}>
|
|
70
|
+
Rows per page:
|
|
71
|
+
</Typography>
|
|
72
|
+
)}
|
|
73
|
+
<RowsPerPageSelect
|
|
74
|
+
value={pageSize}
|
|
75
|
+
onChange={(e) => table.setPageSize(Number(e.target.value))}
|
|
76
|
+
>
|
|
77
|
+
{rowsPerPageArray.map((size) => (
|
|
78
|
+
<MenuItem key={size} value={size} sx={{ fontSize: 12 }}>
|
|
79
|
+
{size}
|
|
80
|
+
</MenuItem>
|
|
81
|
+
))}
|
|
82
|
+
</RowsPerPageSelect>
|
|
83
|
+
</RowsPerPageContainer>
|
|
54
84
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
table.setPageSize(Number(e.target.value));
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
{rowsPerPageArray.map((pageSize) => (
|
|
64
|
-
<option key={pageSize} value={pageSize}>
|
|
65
|
-
{pageSize}
|
|
66
|
-
</option>
|
|
67
|
-
))}
|
|
68
|
-
</select>
|
|
69
|
-
</div>
|
|
85
|
+
<RecordsRangeContainer>
|
|
86
|
+
<strong>
|
|
87
|
+
{recordsRangeFirst} – {recordsRangeLast} of {rowCount}
|
|
88
|
+
</strong>
|
|
89
|
+
</RecordsRangeContainer>
|
|
70
90
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
91
|
+
{isFullView && (
|
|
92
|
+
<PageRangeContainer>
|
|
93
|
+
<strong>
|
|
94
|
+
Page {pageIndex} of {pageCount}
|
|
95
|
+
</strong>
|
|
96
|
+
</PageRangeContainer>
|
|
97
|
+
)}
|
|
77
98
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
<PaginationButtons>
|
|
100
|
+
{isFullView && (
|
|
101
|
+
<PaginationButton
|
|
102
|
+
title="First Page"
|
|
103
|
+
disabled={!table.getCanPreviousPage()}
|
|
104
|
+
onClick={() => table.setPageIndex(0)}
|
|
105
|
+
>
|
|
106
|
+
<TableFirstPageIcon />
|
|
107
|
+
</PaginationButton>
|
|
108
|
+
)}
|
|
85
109
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<TableFirstPageIcon />
|
|
94
|
-
</button>
|
|
95
|
-
<button
|
|
96
|
-
title="Previous Page"
|
|
97
|
-
className="pagination_btn"
|
|
98
|
-
disabled={!table.getCanPreviousPage()}
|
|
99
|
-
onClick={() => table.previousPage()}
|
|
100
|
-
>
|
|
101
|
-
<TablePreviousPageIcon fontSize="small" />
|
|
102
|
-
</button>
|
|
103
|
-
<button
|
|
104
|
-
title="Next Page"
|
|
105
|
-
className="pagination_btn"
|
|
106
|
-
disabled={!table.getCanNextPage()}
|
|
107
|
-
onClick={() => table.nextPage()}
|
|
108
|
-
>
|
|
109
|
-
<TableNextPageIcon />
|
|
110
|
-
</button>
|
|
111
|
-
<button
|
|
112
|
-
title="Last Page"
|
|
113
|
-
className="pagination_btn"
|
|
114
|
-
disabled={!table.getCanNextPage()}
|
|
115
|
-
onClick={() => table.setPageIndex(pageCount - 1)}
|
|
116
|
-
>
|
|
117
|
-
<TableLastPageIcon />
|
|
118
|
-
</button>
|
|
119
|
-
</div>
|
|
120
|
-
</>
|
|
121
|
-
) : (
|
|
122
|
-
<>
|
|
123
|
-
<div className="rows_per_page_container">
|
|
124
|
-
{/* <span>Rows Per Page : </span> */}
|
|
125
|
-
<select
|
|
126
|
-
value={table.getState().pagination.pageSize}
|
|
127
|
-
onChange={(e) => {
|
|
128
|
-
table.setPageSize(Number(e.target.value));
|
|
129
|
-
}}
|
|
130
|
-
>
|
|
131
|
-
{rowsPerPageArray.map((pageSize) => (
|
|
132
|
-
<option key={pageSize} value={pageSize}>
|
|
133
|
-
{pageSize}
|
|
134
|
-
</option>
|
|
135
|
-
))}
|
|
136
|
-
</select>
|
|
137
|
-
</div>
|
|
110
|
+
<PaginationButton
|
|
111
|
+
title="Previous Page"
|
|
112
|
+
disabled={!table.getCanPreviousPage()}
|
|
113
|
+
onClick={() => table.previousPage()}
|
|
114
|
+
>
|
|
115
|
+
<NavigateBeforeRounded fontSize="small" />
|
|
116
|
+
</PaginationButton>
|
|
138
117
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
118
|
+
<PaginationButton
|
|
119
|
+
title="Next Page"
|
|
120
|
+
disabled={!table.getCanNextPage()}
|
|
121
|
+
onClick={() => table.nextPage()}
|
|
122
|
+
>
|
|
123
|
+
<NavigateNextRounded fontSize="small" />
|
|
124
|
+
</PaginationButton>
|
|
145
125
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
className="pagination_btn"
|
|
158
|
-
disabled={!table.getCanNextPage()}
|
|
159
|
-
onClick={() => table.nextPage()}
|
|
160
|
-
>
|
|
161
|
-
<TableNextPageIcon />
|
|
162
|
-
</button>
|
|
163
|
-
</div>
|
|
164
|
-
</>
|
|
165
|
-
)}
|
|
166
|
-
</div>
|
|
126
|
+
{isFullView && (
|
|
127
|
+
<PaginationButton
|
|
128
|
+
title="Last Page"
|
|
129
|
+
disabled={!table.getCanNextPage()}
|
|
130
|
+
onClick={() => table.setPageIndex(pageCount - 1)}
|
|
131
|
+
>
|
|
132
|
+
<TableLastPageIcon />
|
|
133
|
+
</PaginationButton>
|
|
134
|
+
)}
|
|
135
|
+
</PaginationButtons>
|
|
136
|
+
</PaginationContainer>
|
|
167
137
|
);
|
|
168
138
|
}
|
|
169
139
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { Box, IconButton, Select, InputBase } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
/* Root container */
|
|
5
|
+
export const PaginationContainer = styled(Box)(({ theme }) => ({
|
|
6
|
+
padding: theme.spacing(0.5),
|
|
7
|
+
display: "flex",
|
|
8
|
+
justifyContent: "flex-end",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
gap: theme.spacing(2),
|
|
11
|
+
fontSize: theme.typography.pxToRem(14),
|
|
12
|
+
backgroundColor: theme.palette.common.white,
|
|
13
|
+
|
|
14
|
+
[theme.breakpoints.down("md")]: {
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
fontSize: theme.typography.pxToRem(12),
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
/* Hide go-to-page on <= 991px */
|
|
21
|
+
export const GoToPageContainer = styled(Box)(({ theme }) => ({
|
|
22
|
+
display: "flex",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
|
|
25
|
+
[theme.breakpoints.down("md")]: {
|
|
26
|
+
display: "none",
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
/* Rows per page */
|
|
31
|
+
export const RowsPerPageContainer = styled(Box)(({ theme }) => ({
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
|
|
35
|
+
[theme.breakpoints.down("sm")]: {
|
|
36
|
+
display: "none",
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
/* Records range */
|
|
41
|
+
export const RecordsRangeContainer = styled(Box)(({ theme }) => ({
|
|
42
|
+
whiteSpace: "nowrap",
|
|
43
|
+
fontSize: theme.typography.pxToRem(14),
|
|
44
|
+
|
|
45
|
+
[theme.breakpoints.down("sm")]: {
|
|
46
|
+
display: "none",
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
/* Page range */
|
|
51
|
+
export const PageRangeContainer = styled(Box)(({ theme }) => ({
|
|
52
|
+
whiteSpace: "nowrap",
|
|
53
|
+
fontSize: theme.typography.pxToRem(14),
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
/* Buttons wrapper */
|
|
57
|
+
export const PaginationButtons = styled(Box)(({ theme }) => ({
|
|
58
|
+
display: "flex",
|
|
59
|
+
gap: theme.spacing(1),
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
/* Pagination button */
|
|
63
|
+
export const PaginationButton = styled(IconButton)(({ theme }) => ({
|
|
64
|
+
borderRadius: "50%",
|
|
65
|
+
height: 24,
|
|
66
|
+
width: 24,
|
|
67
|
+
padding: 2,
|
|
68
|
+
transition: "0.4s",
|
|
69
|
+
|
|
70
|
+
"&:hover": {
|
|
71
|
+
backgroundColor: theme.palette.grey[300],
|
|
72
|
+
boxShadow: "0 1px 2px 0 rgba(60,64,67,.6), 0 1px 3px 1px rgba(60,64,67,.3)",
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
"&.Mui-disabled": {
|
|
76
|
+
color: theme.palette.action.disabled,
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
[theme.breakpoints.down("sm")]: {
|
|
80
|
+
height: 24,
|
|
81
|
+
width: 24,
|
|
82
|
+
padding: 0,
|
|
83
|
+
|
|
84
|
+
"& svg": {
|
|
85
|
+
width: 20,
|
|
86
|
+
height: 20,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
90
|
+
|
|
91
|
+
/* Select (rows per page) */
|
|
92
|
+
export const RowsPerPageSelect = styled(Select)(({ theme }) => ({
|
|
93
|
+
borderRadius: theme.shape.borderRadius,
|
|
94
|
+
padding: theme.spacing(0),
|
|
95
|
+
fontSize: theme.typography.pxToRem(12),
|
|
96
|
+
|
|
97
|
+
"& .MuiSelect-select": {
|
|
98
|
+
fontSize: theme.typography.pxToRem(12),
|
|
99
|
+
padding: theme.spacing(0.5, 0.75),
|
|
100
|
+
},
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
/* Input for go-to-page */
|
|
104
|
+
export const GoToPageInput = styled(InputBase)(({ theme }) => ({
|
|
105
|
+
width: 60,
|
|
106
|
+
textAlign: "center",
|
|
107
|
+
borderRadius: theme.shape.borderRadius,
|
|
108
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
109
|
+
fontSize: theme.typography.pxToRem(12),
|
|
110
|
+
|
|
111
|
+
"& .MuiInputBase-input": {
|
|
112
|
+
fontSize: theme.typography.pxToRem(12),
|
|
113
|
+
padding: theme.spacing(0.25, 0.75),
|
|
114
|
+
},
|
|
115
|
+
}));
|
|
@@ -58,11 +58,7 @@ export const TableSearch = ({
|
|
|
58
58
|
<Box
|
|
59
59
|
ref={searchContainerRef}
|
|
60
60
|
className="search-container"
|
|
61
|
-
sx={{
|
|
62
|
-
display: "flex",
|
|
63
|
-
position: "relative",
|
|
64
|
-
top: "10px",
|
|
65
|
-
}}
|
|
61
|
+
sx={{ position: "relative" }}
|
|
66
62
|
>
|
|
67
63
|
<TextField
|
|
68
64
|
type="text"
|
|
@@ -87,7 +83,7 @@ export const TableSearch = ({
|
|
|
87
83
|
}, 100);
|
|
88
84
|
}
|
|
89
85
|
}}
|
|
90
|
-
sx={{ color: "black", fontSize:
|
|
86
|
+
sx={{ color: "black", fontSize: 14 }}
|
|
91
87
|
edge="start"
|
|
92
88
|
>
|
|
93
89
|
<SearchIcon />
|
|
@@ -103,12 +99,12 @@ export const TableSearch = ({
|
|
|
103
99
|
setLocalValue("");
|
|
104
100
|
handleChange({ target: { value: "" } } as any);
|
|
105
101
|
}}
|
|
106
|
-
sx={{ color: "black", fontSize:
|
|
102
|
+
sx={{ color: "black", fontSize: 14 }}
|
|
107
103
|
edge="end"
|
|
108
104
|
>
|
|
109
105
|
<CloseRoundedIcon
|
|
110
106
|
fontSize="small"
|
|
111
|
-
sx={{ color: "black", fontSize:
|
|
107
|
+
sx={{ color: "black", fontSize: 14 }}
|
|
112
108
|
/>
|
|
113
109
|
</IconButton>
|
|
114
110
|
</InputAdornment>
|
package/src/listing/components/{table-body-dnd-cell.tsx → table-body/table-body-dnd-cell.tsx}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useSortable } from "@dnd-kit/sortable";
|
|
2
2
|
import { CSS } from "@dnd-kit/utilities";
|
|
3
3
|
import { Cell, flexRender } from "@tanstack/react-table";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getColumnPinningStylesBody } from "../libs/utils/common";
|
|
4
|
+
import { align } from "../../types/common";
|
|
5
|
+
import { getColumnPinningStylesBody } from "../../libs/utils/common";
|
|
7
6
|
import {
|
|
8
7
|
CraftTableFeatureProps,
|
|
9
8
|
CraftTableOptionsProps,
|
|
10
|
-
} from "
|
|
9
|
+
} from "../../types/table-options";
|
|
10
|
+
import { TableBodyCell } from "./table-body.styles";
|
|
11
11
|
|
|
12
12
|
interface DragAlongCellProps<T> {
|
|
13
13
|
cell: Cell<T, unknown>;
|
|
@@ -28,34 +28,27 @@ function DragAlongCell<T>({
|
|
|
28
28
|
|
|
29
29
|
const isPinned = cell.column.getIsPinned();
|
|
30
30
|
|
|
31
|
-
const style: CSSProperties = {
|
|
32
|
-
opacity: isDragging ? 0.8 : 1,
|
|
33
|
-
transform: CSS.Translate.toString(transform),
|
|
34
|
-
transition: "width transform 0.2s ease-in-out",
|
|
35
|
-
width: cell.column.getSize(),
|
|
36
|
-
...getColumnPinningStylesBody(cell.column),
|
|
37
|
-
...((wrapColumns.all_wrap || wrapColumns[cell.column.id]) && {
|
|
38
|
-
wordBreak: "break-all",
|
|
39
|
-
// whiteSpace: "normal",
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
|
-
|
|
43
31
|
return (
|
|
44
|
-
<
|
|
32
|
+
<TableBodyCell
|
|
45
33
|
ref={setNodeRef}
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
align={(cell.column.columnDef.meta as align)?.align || "left"}
|
|
35
|
+
style={{
|
|
36
|
+
opacity: isDragging ? 0.8 : 1,
|
|
37
|
+
transform: CSS.Translate.toString(transform),
|
|
38
|
+
transition: "width transform 0.2s ease-in-out",
|
|
39
|
+
width: cell.column.getSize(),
|
|
40
|
+
...getColumnPinningStylesBody(cell.column),
|
|
41
|
+
...((wrapColumns.all_wrap || wrapColumns[cell.column.id]) && {
|
|
42
|
+
wordBreak: "break-all",
|
|
43
|
+
whiteSpace: "normal",
|
|
44
|
+
}),
|
|
45
|
+
zIndex: isPinned ? 2 : isDragging ? 1 : 0,
|
|
53
46
|
}}
|
|
54
47
|
>
|
|
55
48
|
{cell.getIsPlaceholder()
|
|
56
49
|
? null
|
|
57
50
|
: flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
58
|
-
</
|
|
51
|
+
</TableBodyCell>
|
|
59
52
|
);
|
|
60
53
|
}
|
|
61
54
|
|