tycho-components 0.19.13 → 0.19.14
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { MenuItem, Select } from '@mui/material';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
5
4
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -111,7 +110,7 @@ export default function AppPagination({ totalElements, pagination, setPagination
|
|
|
111
110
|
}, []);
|
|
112
111
|
return (_jsxs("div", { className: classNames('app-table-pagination', {
|
|
113
112
|
small: size === 'small',
|
|
114
|
-
}), children: [_jsxs("div", { className: "itens-container", children: [!hideItensPage && (_jsxs("div", { className: "itens-page", children: [_jsx("span", { children: t('table.label.rows-page') }), _jsx(
|
|
113
|
+
}), children: [_jsxs("div", { className: "itens-container", children: [!hideItensPage && (_jsxs("div", { className: "itens-page", children: [_jsx("span", { className: "itens-page-label", children: t('table.label.rows-page') }), _jsx("select", { className: "select-pages", value: pagination.pageSize, onChange: (e) => setPageSize(Number(e.target.value)), children: numItens.map((pageSizeOption) => (_jsx("option", { value: pageSizeOption, children: pageSizeOption }, pageSizeOption))) })] })), _jsx("div", { className: "itens-total", children: _jsx("span", { children: _jsx(Trans, { t: t, i18nKey: "table.label.items", values: {
|
|
115
114
|
first: getFirstElementNumber(),
|
|
116
115
|
last: getLastElementNumber(),
|
|
117
116
|
total: totalElements,
|
|
@@ -126,39 +125,8 @@ export default function AppPagination({ totalElements, pagination, setPagination
|
|
|
126
125
|
}
|
|
127
126
|
setPageIndex(index);
|
|
128
127
|
}, "aria-current": isActive ? 'page' : undefined, children: pageNum }, pageNum));
|
|
129
|
-
}) }), stripScrollEdges.overflow && (_jsx("button", { type: "button", className: "page-strip-nudge", disabled: !stripScrollEdges.canScrollRight, onClick: () => scrollPageStrip(1), "aria-label": t('table.pagination.scroll-strip-right'), title: t('table.pagination.scroll-strip-right'), children: _jsx(Icon, { name: "keyboard_double_arrow_right", size: "x-small" }) })), _jsx(IconButton, { size: size, mode: "tonal", onClick: () => setPageIndex(pagination.pageIndex + 1), disabled: pagination.pageIndex >= numPages - 1, name: "chevron_forward" })] })] }));
|
|
128
|
+
}) }), _jsx("div", { className: "pages-total-mobile", children: _jsx("select", { className: "select-pages", value: currentPage, onChange: (e) => setPageIndex(Number(e.target.value) - 1), children: Array.from({ length: numPages }, (_, index) => (_jsx("option", { value: index + 1, children: index + 1 }, index + 1))) }) }), stripScrollEdges.overflow && (_jsx("button", { type: "button", className: "page-strip-nudge", disabled: !stripScrollEdges.canScrollRight, onClick: () => scrollPageStrip(1), "aria-label": t('table.pagination.scroll-strip-right'), title: t('table.pagination.scroll-strip-right'), children: _jsx(Icon, { name: "keyboard_double_arrow_right", size: "x-small" }) })), _jsx(IconButton, { size: size, mode: "tonal", onClick: () => setPageIndex(pagination.pageIndex + 1), disabled: pagination.pageIndex >= numPages - 1, name: "chevron_forward" })] })] }));
|
|
130
129
|
}
|
|
131
|
-
const menuProps = {
|
|
132
|
-
PaperProps: {
|
|
133
|
-
style: {
|
|
134
|
-
maxHeight: 200,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
anchorOrigin: {
|
|
138
|
-
vertical: 'top',
|
|
139
|
-
horizontal: 'left',
|
|
140
|
-
},
|
|
141
|
-
transformOrigin: {
|
|
142
|
-
vertical: 'bottom',
|
|
143
|
-
horizontal: 'left',
|
|
144
|
-
},
|
|
145
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
146
|
-
// @ts-expect-error -- PopperProps is not typed but works at runtime
|
|
147
|
-
PopperProps: {
|
|
148
|
-
modifiers: [
|
|
149
|
-
{
|
|
150
|
-
name: 'flip',
|
|
151
|
-
enabled: false,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: 'offset',
|
|
155
|
-
options: {
|
|
156
|
-
offset: [0, -4],
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
},
|
|
161
|
-
};
|
|
162
130
|
const initialDragRow = {
|
|
163
131
|
pointerId: null,
|
|
164
132
|
startX: 0,
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
.pages-total-mobile {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
.pages-total {
|
|
26
30
|
display: flex;
|
|
27
31
|
align-items: center;
|
|
@@ -91,6 +95,35 @@
|
|
|
91
95
|
margin-left: auto;
|
|
92
96
|
}
|
|
93
97
|
|
|
98
|
+
.select-pages {
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
min-width: 56px;
|
|
101
|
+
height: 40px;
|
|
102
|
+
margin: 0;
|
|
103
|
+
padding: var(--spacing-0) 28px var(--spacing-0) var(--spacing-100);
|
|
104
|
+
border: none;
|
|
105
|
+
border-radius: 0;
|
|
106
|
+
font-family: 'Work Sans', sans-serif;
|
|
107
|
+
@include button-small;
|
|
108
|
+
color: var(--text-on-color-dark);
|
|
109
|
+
background-color: var(--button-secondary-default);
|
|
110
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23222' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
|
|
111
|
+
background-repeat: no-repeat;
|
|
112
|
+
background-position: right 4px center;
|
|
113
|
+
background-size: 20px 20px;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
appearance: none;
|
|
116
|
+
|
|
117
|
+
&:hover {
|
|
118
|
+
filter: brightness(1.05);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&:focus-visible {
|
|
122
|
+
outline: 2px solid var(--border-focus);
|
|
123
|
+
outline-offset: 2px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
94
127
|
.page-strip-nudge {
|
|
95
128
|
flex-shrink: 0;
|
|
96
129
|
display: inline-flex;
|
|
@@ -122,34 +155,6 @@
|
|
|
122
155
|
}
|
|
123
156
|
}
|
|
124
157
|
|
|
125
|
-
.MuiInputBase-root {
|
|
126
|
-
border-radius: 0px;
|
|
127
|
-
font-family: 'Work Sans' !important;
|
|
128
|
-
|
|
129
|
-
> .MuiSelect-select {
|
|
130
|
-
display: flex;
|
|
131
|
-
align-items: center;
|
|
132
|
-
padding: var(--spacing-0) var(--spacing-100);
|
|
133
|
-
height: 40px;
|
|
134
|
-
border-radius: 0px;
|
|
135
|
-
background-color: var(--button-secondary-default);
|
|
136
|
-
@include button-small;
|
|
137
|
-
color: var(--text-on-color-dark);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
> .MuiSelect-icon {
|
|
141
|
-
position: relative;
|
|
142
|
-
width: 20px;
|
|
143
|
-
height: 40px;
|
|
144
|
-
background-color: var(--button-secondary-default);
|
|
145
|
-
margin-left: 8px;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
> .MuiOutlinedInput-notchedOutline {
|
|
149
|
-
display: none;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
158
|
&.small {
|
|
154
159
|
padding: var(--spacing-100);
|
|
155
160
|
|
|
@@ -170,14 +175,9 @@
|
|
|
170
175
|
height: 32px;
|
|
171
176
|
}
|
|
172
177
|
|
|
173
|
-
.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
> .MuiSelect-icon {
|
|
179
|
-
height: 32px;
|
|
180
|
-
}
|
|
178
|
+
.select-pages {
|
|
179
|
+
height: 32px;
|
|
180
|
+
background-position: right 2px center;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -199,3 +199,32 @@
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
+
|
|
203
|
+
@media (max-width: 767px) {
|
|
204
|
+
.app-table-pagination {
|
|
205
|
+
flex-direction: row;
|
|
206
|
+
justify-content: space-between;
|
|
207
|
+
padding: 12px 0px;
|
|
208
|
+
|
|
209
|
+
.itens-container {
|
|
210
|
+
.itens-page {
|
|
211
|
+
.itens-page-label {
|
|
212
|
+
display: none;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.pages-total-mobile {
|
|
218
|
+
display: block;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.pages-total {
|
|
222
|
+
display: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.pages-navigation {
|
|
226
|
+
justify-content: center;
|
|
227
|
+
margin: 0px;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|