@grazziotin/react-components-next 1.0.1 → 2.1.0
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/accessibility/index.d.mts +136 -0
- package/dist/accessibility/index.d.ts +136 -0
- package/dist/accessibility/index.js +138 -0
- package/dist/accessibility/index.js.map +1 -0
- package/dist/accessibility/index.mjs +127 -0
- package/dist/accessibility/index.mjs.map +1 -0
- package/dist/{chunk-4DIPDYEU.mjs → chunk-BWW3F4R4.mjs} +42 -3
- package/dist/chunk-BWW3F4R4.mjs.map +1 -0
- package/dist/functions/index.d.mts +36 -1
- package/dist/functions/index.d.ts +36 -1
- package/dist/functions/index.js +36 -0
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/ui/index.d.mts +210 -4
- package/dist/ui/index.d.ts +210 -4
- package/dist/ui/index.js +500 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +888 -2
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +8 -9
- package/dist/chunk-4DIPDYEU.mjs.map +0 -1
- package/dist/chunk-XNWAGZVV.mjs +0 -467
- package/dist/chunk-XNWAGZVV.mjs.map +0 -1
- package/dist/index.d.mts +0 -10
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -582
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -29
- package/dist/index.mjs.map +0 -1
package/dist/ui/index.mjs
CHANGED
|
@@ -1,4 +1,890 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
1
|
+
import { __spreadProps, __spreadValues, cn, __objRest, formatItem150, formatItem170, removeNonDigits, removeTextOnly, formatPriceBrl, formatPhoneBr, removeDigits, formatCpfCnpj } from '../chunk-BWW3F4R4.mjs';
|
|
2
|
+
import { styled, Tabs as Tabs$1, Tab as Tab$1, TextField, Box, useMediaQuery, Drawer, Grid, InputAdornment, IconButton } from '@mui/material';
|
|
3
|
+
import { Tooltip, ActionIcon, Button } from '@mantine/core';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
import DialogMui from '@mui/material/Dialog';
|
|
6
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
7
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
8
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
9
|
+
import { ptBR } from '@mui/x-data-grid/locales';
|
|
10
|
+
import { GRID_STRING_COL_DEF, GRID_NUMERIC_COL_DEF, getGridStringOperators, getGridNumericOperators, DataGrid, GridPagination, GridOverlay, GridColumnsPanel, GridFilterPanel, GridColumnMenu } from '@mui/x-data-grid';
|
|
11
|
+
import { memo, useState, useMemo, useCallback } from 'react';
|
|
12
|
+
import { MdVisibilityOff, MdVisibility } from 'react-icons/md';
|
|
13
|
+
import Autocomplete from '@mui/material/Autocomplete';
|
|
14
|
+
import { FaFilter } from 'react-icons/fa';
|
|
15
|
+
|
|
16
|
+
function Card({
|
|
17
|
+
margin,
|
|
18
|
+
onClick,
|
|
19
|
+
title,
|
|
20
|
+
toolTip,
|
|
21
|
+
className,
|
|
22
|
+
borderTitle,
|
|
23
|
+
children,
|
|
24
|
+
borderRadius,
|
|
25
|
+
width = "100%",
|
|
26
|
+
height = "auto",
|
|
27
|
+
titleWidth = "100%",
|
|
28
|
+
justifyContent = "space-between",
|
|
29
|
+
titleColor = "var(--primary-color)",
|
|
30
|
+
icon
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ jsxs(
|
|
33
|
+
Box,
|
|
34
|
+
{
|
|
35
|
+
onClick,
|
|
36
|
+
className: cn(className, "text-sm!"),
|
|
37
|
+
sx: __spreadValues({
|
|
38
|
+
width,
|
|
39
|
+
margin,
|
|
40
|
+
height,
|
|
41
|
+
borderRadius,
|
|
42
|
+
"@media (max-width: 768px)": { width: "100%" },
|
|
43
|
+
boxShadow: "0 0.15rem 0.5rem rgba(0, 0, 0, 0.16)"
|
|
44
|
+
}, onClick && { cursor: "pointer !important" }),
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsxs(
|
|
47
|
+
Box,
|
|
48
|
+
{
|
|
49
|
+
sx: {
|
|
50
|
+
justifyContent,
|
|
51
|
+
height: "24px",
|
|
52
|
+
color: "white",
|
|
53
|
+
display: "flex",
|
|
54
|
+
width: titleWidth,
|
|
55
|
+
overflow: "hidden",
|
|
56
|
+
padding: "0px 15px",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
flexDirection: "row",
|
|
59
|
+
borderRadius: borderTitle,
|
|
60
|
+
backgroundColor: titleColor
|
|
61
|
+
},
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 font-semibold! truncate!", children: /* @__PURE__ */ jsx(
|
|
64
|
+
Tooltip,
|
|
65
|
+
{
|
|
66
|
+
withArrow: true,
|
|
67
|
+
radius: "md",
|
|
68
|
+
label: title,
|
|
69
|
+
arrowSize: 6,
|
|
70
|
+
position: "top",
|
|
71
|
+
arrowOffset: 15,
|
|
72
|
+
disabled: !toolTip,
|
|
73
|
+
color: titleColor,
|
|
74
|
+
classNames: { tooltip: "text-xs!" },
|
|
75
|
+
offset: { mainAxis: 11, crossAxis: -21 },
|
|
76
|
+
transitionProps: { transition: "fade", duration: 100 },
|
|
77
|
+
children: /* @__PURE__ */ jsx("span", { className: "block! truncate!", children: title })
|
|
78
|
+
}
|
|
79
|
+
) }),
|
|
80
|
+
/* @__PURE__ */ jsx("div", { children: icon })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
children
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
var card_default = Card;
|
|
90
|
+
|
|
91
|
+
// src/components/ui/dialog/utils/constants.ts
|
|
92
|
+
var DIALOG_BACKDROP_STYLE = {
|
|
93
|
+
backdropFilter: "blur(4px)",
|
|
94
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
95
|
+
};
|
|
96
|
+
var DIALOG_PAPER_FONT_SX = {
|
|
97
|
+
fontFamily: "var(--font-family, inherit) !important",
|
|
98
|
+
"& .MuiDialogTitle-root, & .MuiDialogContent-root, & .MuiDialogActions-root, & .MuiTypography-root": {
|
|
99
|
+
fontFamily: "inherit !important"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
function Dialog({
|
|
103
|
+
open,
|
|
104
|
+
title,
|
|
105
|
+
onClose,
|
|
106
|
+
actions,
|
|
107
|
+
children,
|
|
108
|
+
maxWidth,
|
|
109
|
+
blurBackdrop = false
|
|
110
|
+
}) {
|
|
111
|
+
const backdropStyle = blurBackdrop ? DIALOG_BACKDROP_STYLE : {};
|
|
112
|
+
return /* @__PURE__ */ jsxs(
|
|
113
|
+
DialogMui,
|
|
114
|
+
{
|
|
115
|
+
fullWidth: true,
|
|
116
|
+
open,
|
|
117
|
+
onClose,
|
|
118
|
+
maxWidth,
|
|
119
|
+
slotProps: {
|
|
120
|
+
backdrop: { sx: backdropStyle },
|
|
121
|
+
paper: { sx: DIALOG_PAPER_FONT_SX }
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
title && /* @__PURE__ */ jsx(DialogTitle, { children: /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-black-de", children: title }) }),
|
|
125
|
+
/* @__PURE__ */ jsx(DialogContent, { className: "text-black", children }),
|
|
126
|
+
actions && /* @__PURE__ */ jsx(DialogActions, { children: actions })
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
var dialog_default = Dialog;
|
|
132
|
+
var localeText = __spreadProps(__spreadValues({}, ptBR.components.MuiDataGrid.defaultProps.localeText), {
|
|
133
|
+
noColumnsOverlayLabel: "Nenhuma coluna dispon\xEDvel",
|
|
134
|
+
noColumnsOverlayManageColumns: "Gerenciar colunas",
|
|
135
|
+
columnsManagementSearchTitle: "Buscar coluna",
|
|
136
|
+
columnsManagementNoColumns: "Nenhuma coluna para mostrar",
|
|
137
|
+
columnsManagementShowHideAllText: "Mostrar/Ocultar todas",
|
|
138
|
+
columnsManagementReset: "Redefinir",
|
|
139
|
+
columnsManagementDeleteIconLabel: "Excluir",
|
|
140
|
+
columnMenuManageColumns: "Gerenciar colunas",
|
|
141
|
+
columnMenuShowColumns: "Mostrar colunas",
|
|
142
|
+
columnMenuLabel: "Menu da coluna",
|
|
143
|
+
columnMenuHideColumn: "Ocultar",
|
|
144
|
+
columnMenuUnsort: "Remover ordena\xE7\xE3o",
|
|
145
|
+
columnMenuSortAsc: "Ordenar ASC",
|
|
146
|
+
columnMenuSortDesc: "Ordenar DESC",
|
|
147
|
+
columnMenuFilter: "Filtrar",
|
|
148
|
+
toolbarQuickFilterLabel: "Filtro r\xE1pido",
|
|
149
|
+
toolbarQuickFilterPlaceholder: "Filtrar\u2026",
|
|
150
|
+
toolbarQuickFilterDeleteIconLabel: "Limpar filtro",
|
|
151
|
+
toolbarExport: "Exportar",
|
|
152
|
+
toolbarExportLabel: "Exportar",
|
|
153
|
+
toolbarExportCSV: "Baixar como CSV",
|
|
154
|
+
toolbarExportPrint: "Imprimir",
|
|
155
|
+
toolbarColumns: "Colunas",
|
|
156
|
+
toolbarColumnsLabel: "Selecionar colunas",
|
|
157
|
+
toolbarFilters: "Filtros",
|
|
158
|
+
toolbarFiltersLabel: "Mostrar filtros",
|
|
159
|
+
toolbarFiltersTooltipHide: "Ocultar filtros",
|
|
160
|
+
toolbarFiltersTooltipShow: "Mostrar filtros",
|
|
161
|
+
toolbarFiltersTooltipActive: (count) => count === 1 ? `${count} filtro ativo` : `${count} filtros ativos`,
|
|
162
|
+
toolbarDensity: "Densidade",
|
|
163
|
+
toolbarDensityLabel: "Densidade",
|
|
164
|
+
toolbarDensityCompact: "Compacta",
|
|
165
|
+
toolbarDensityStandard: "Padr\xE3o",
|
|
166
|
+
toolbarDensityComfortable: "Confort\xE1vel",
|
|
167
|
+
filterPanelAddFilter: "Adicionar filtro",
|
|
168
|
+
filterPanelDeleteIconLabel: "Excluir",
|
|
169
|
+
filterPanelOperatorAnd: "E",
|
|
170
|
+
filterPanelOperatorOr: "OU",
|
|
171
|
+
filterPanelColumn: "Colunas",
|
|
172
|
+
filterPanelInputLabel: "Valor",
|
|
173
|
+
filterPanelInputPlaceholder: "Valor do filtro",
|
|
174
|
+
filterOperatorContains: "cont\xE9m",
|
|
175
|
+
filterOperatorEquals: "igual a",
|
|
176
|
+
filterOperatorStartsWith: "come\xE7a com",
|
|
177
|
+
filterOperatorEndsWith: "termina com",
|
|
178
|
+
filterOperatorIs: "\xE9",
|
|
179
|
+
filterOperatorNot: "n\xE3o \xE9",
|
|
180
|
+
filterOperatorAfter: "depois de",
|
|
181
|
+
filterOperatorOnOrAfter: "em ou depois de",
|
|
182
|
+
filterOperatorBefore: "antes de",
|
|
183
|
+
filterOperatorOnOrBefore: "em ou antes de",
|
|
184
|
+
filterOperatorIsEmpty: "est\xE1 vazio",
|
|
185
|
+
filterOperatorIsNotEmpty: "n\xE3o est\xE1 vazio",
|
|
186
|
+
filterOperatorIsAnyOf: "\xE9 qualquer um de",
|
|
187
|
+
footerTotalRows: "Total de linhas:",
|
|
188
|
+
footerRowSelected: (count) => count === 1 ? "1 linha selecionada" : `${count.toLocaleString()} linhas selecionadas`,
|
|
189
|
+
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} de ${totalCount.toLocaleString()}`,
|
|
190
|
+
paginationRowsPerPage: "Linhas por p\xE1gina:",
|
|
191
|
+
paginationItemAriaLabel: (type) => {
|
|
192
|
+
switch (type) {
|
|
193
|
+
case "first":
|
|
194
|
+
return "Primeira p\xE1gina";
|
|
195
|
+
case "last":
|
|
196
|
+
return "\xDAltima p\xE1gina";
|
|
197
|
+
case "next":
|
|
198
|
+
return "Pr\xF3xima p\xE1gina";
|
|
199
|
+
case "previous":
|
|
200
|
+
return "P\xE1gina anterior";
|
|
201
|
+
default:
|
|
202
|
+
return "";
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
noRowsLabel: "Nenhum dado encontrado",
|
|
206
|
+
noResultsOverlayLabel: "Nenhum resultado encontrado",
|
|
207
|
+
checkboxSelectionHeaderName: "Sele\xE7\xE3o de checkbox",
|
|
208
|
+
checkboxSelectionSelectAllRows: "Selecionar todas as linhas",
|
|
209
|
+
checkboxSelectionUnselectAllRows: "Desmarcar todas as linhas",
|
|
210
|
+
checkboxSelectionSelectRow: "Selecionar linha",
|
|
211
|
+
checkboxSelectionUnselectRow: "Desmarcar linha",
|
|
212
|
+
columnHeaderSortIconLabel: "Ordenar",
|
|
213
|
+
groupingColumnHeaderName: "Grupo",
|
|
214
|
+
groupColumn: (name) => `Agrupar por ${name}`,
|
|
215
|
+
unGroupColumn: (name) => `Parar de agrupar por ${name}`,
|
|
216
|
+
detailPanelToggle: "Alternar painel de detalhes",
|
|
217
|
+
expandDetailPanel: "Expandir",
|
|
218
|
+
collapseDetailPanel: "Recolher",
|
|
219
|
+
treeDataGroupingHeaderName: "Grupo",
|
|
220
|
+
treeDataExpand: "ver filhos",
|
|
221
|
+
treeDataCollapse: "ocultar filhos",
|
|
222
|
+
aggregationMenuItemHeader: "Agrega\xE7\xE3o",
|
|
223
|
+
aggregationFunctionLabelSum: "soma",
|
|
224
|
+
aggregationFunctionLabelAvg: "m\xE9dia",
|
|
225
|
+
aggregationFunctionLabelMin: "m\xEDn",
|
|
226
|
+
aggregationFunctionLabelMax: "m\xE1x",
|
|
227
|
+
aggregationFunctionLabelSize: "tamanho",
|
|
228
|
+
paginationDisplayedRows: ({ from, to, count }) => {
|
|
229
|
+
const total = count === -1 ? "mais de " + to : count;
|
|
230
|
+
return `${from}\u2013${to} de ${total}`;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
var columnPanelSx = {
|
|
234
|
+
padding: 2,
|
|
235
|
+
width: "350px",
|
|
236
|
+
color: "#000000DE"
|
|
237
|
+
};
|
|
238
|
+
var columnMenuSx = {
|
|
239
|
+
"& .MuiListItemText-primary": {
|
|
240
|
+
fontSize: "14px !important"
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
var filterSx = {
|
|
244
|
+
width: "750px",
|
|
245
|
+
"*": { fontSize: "14px !important" },
|
|
246
|
+
"& .MuiDataGrid-filterFormColumnInput": { width: "230px" },
|
|
247
|
+
"& .MuiDataGrid-filterFormOperatorInput": { width: "230px" }
|
|
248
|
+
};
|
|
249
|
+
var paginationSx = {
|
|
250
|
+
"& .MuiTablePagination-root": { fontSize: "12px !important" },
|
|
251
|
+
"& .MuiTablePagination-selectLabel": { fontSize: "12px !important" },
|
|
252
|
+
"& .MuiTablePagination-displayedRows": { fontSize: "12px !important" },
|
|
253
|
+
"& .MuiTablePagination-select": { fontSize: "12px !important" },
|
|
254
|
+
"& .MuiTablePagination-toolbar": {
|
|
255
|
+
minHeight: "40px !important",
|
|
256
|
+
padding: "0 8px !important"
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
var tableSx = {
|
|
260
|
+
fontSize: "13px",
|
|
261
|
+
"& .MuiDataGrid-row:nth-of-type(even)": {
|
|
262
|
+
backgroundColor: "#F9FAFB"
|
|
263
|
+
},
|
|
264
|
+
"& .MuiDataGrid-row:nth-of-type(odd)": {
|
|
265
|
+
backgroundColor: "#FFFFFF"
|
|
266
|
+
},
|
|
267
|
+
"& .MuiDataGrid-row.Mui-selected:nth-of-type(even)": {
|
|
268
|
+
backgroundColor: "#F9FAFB !important"
|
|
269
|
+
},
|
|
270
|
+
"& .MuiDataGrid-row.Mui-selected:nth-of-type(odd)": {
|
|
271
|
+
backgroundColor: "#FFFFFF !important"
|
|
272
|
+
},
|
|
273
|
+
"& .MuiDataGrid-row:hover": { backgroundColor: "#F3F4F6 !important" },
|
|
274
|
+
"& .MuiDataGrid-columnHeaderTitleContainer": {
|
|
275
|
+
color: "#FFFFFF",
|
|
276
|
+
justifyContent: "center",
|
|
277
|
+
"& svg": { color: "#FFFFFF" }
|
|
278
|
+
},
|
|
279
|
+
"& .MuiDataGrid-iconButtonContainer .MuiIconButton-root, & .MuiDataGrid-menuIconButton": {
|
|
280
|
+
color: "#FFFFFF"
|
|
281
|
+
},
|
|
282
|
+
"& .MuiDataGrid-iconButtonContainer .MuiIconButton-root:hover, & .MuiDataGrid-menuIconButton:hover": { backgroundColor: "transparent" },
|
|
283
|
+
"& .MuiDataGrid-iconButtonContainer .MuiIconButton-root.Mui-focusVisible, & .MuiDataGrid-menuIconButton.Mui-focusVisible": { backgroundColor: "transparent" },
|
|
284
|
+
"& .MuiDataGrid-columnHeaders": {
|
|
285
|
+
background: "linear-gradient(to right, #00B2A6 0%, #0AAEB2 100%)"
|
|
286
|
+
},
|
|
287
|
+
"& .MuiDataGrid-columnHeader": {
|
|
288
|
+
color: "#FFFFFF",
|
|
289
|
+
fontWeight: "bold",
|
|
290
|
+
backgroundColor: "transparent",
|
|
291
|
+
"& svg": { color: "#FFFFFF" }
|
|
292
|
+
},
|
|
293
|
+
"& .MuiDataGrid-columnHeader:hover": { backgroundColor: "transparent" },
|
|
294
|
+
"& .MuiDataGrid-columnHeader:hover .MuiIconButton-root": {
|
|
295
|
+
backgroundColor: "transparent"
|
|
296
|
+
},
|
|
297
|
+
"& .MuiDataGrid-columnHeader:focus-within": {
|
|
298
|
+
backgroundColor: "transparent"
|
|
299
|
+
},
|
|
300
|
+
"& .MuiDataGrid-columnHeader--sorted": { backgroundColor: "transparent" },
|
|
301
|
+
"& .MuiDataGrid-columnHeader--sorted .MuiIconButton-root": {
|
|
302
|
+
backgroundColor: "transparent"
|
|
303
|
+
},
|
|
304
|
+
"& .MuiDataGrid-sortIcon": { color: "#FFFFFF" },
|
|
305
|
+
"& .MuiDataGrid-sortIcon:hover": { backgroundColor: "transparent" },
|
|
306
|
+
"& .MuiDataGrid-columnHeaderTitle": { fontWeight: "500", color: "#FFFFFF" }
|
|
307
|
+
};
|
|
308
|
+
var createChange = (item, applyValue) => (index) => ({ target }) => {
|
|
309
|
+
const [start = "", end = ""] = Array.isArray(item.value) ? item.value : [];
|
|
310
|
+
applyValue(__spreadProps(__spreadValues({}, item), {
|
|
311
|
+
value: index === 0 ? [target.value, end] : [start, target.value]
|
|
312
|
+
}));
|
|
313
|
+
};
|
|
314
|
+
var textBetweenOp = {
|
|
315
|
+
label: "entre",
|
|
316
|
+
value: "between",
|
|
317
|
+
getApplyFilterFn: (filter) => {
|
|
318
|
+
if (!filter.value || !Array.isArray(filter.value)) return null;
|
|
319
|
+
const [start, end] = filter.value;
|
|
320
|
+
if (!start || !end) return null;
|
|
321
|
+
return (value) => {
|
|
322
|
+
const cell = (value == null ? void 0 : value.toString()) || "";
|
|
323
|
+
return cell >= start && cell <= end;
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
InputComponent: ({ item, applyValue, focusElementRef }) => {
|
|
327
|
+
const onChange = createChange(item, applyValue);
|
|
328
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: [
|
|
329
|
+
/* @__PURE__ */ jsx(
|
|
330
|
+
TextField,
|
|
331
|
+
{
|
|
332
|
+
size: "small",
|
|
333
|
+
label: "De",
|
|
334
|
+
variant: "outlined",
|
|
335
|
+
inputRef: focusElementRef,
|
|
336
|
+
value: (item.value || ["", ""])[0] || "",
|
|
337
|
+
onChange: onChange(0),
|
|
338
|
+
placeholder: "Inicial"
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
/* @__PURE__ */ jsx(
|
|
342
|
+
TextField,
|
|
343
|
+
{
|
|
344
|
+
size: "small",
|
|
345
|
+
label: "At\xE9",
|
|
346
|
+
variant: "outlined",
|
|
347
|
+
value: (item.value || ["", ""])[1] || "",
|
|
348
|
+
onChange: onChange(1),
|
|
349
|
+
placeholder: "Final"
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
] });
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
var numberBetweenOp = {
|
|
356
|
+
label: "entre",
|
|
357
|
+
value: "between",
|
|
358
|
+
getApplyFilterFn: (filter) => {
|
|
359
|
+
if (!filter.value || !Array.isArray(filter.value)) return null;
|
|
360
|
+
const [start, end] = filter.value;
|
|
361
|
+
if (start === "" || end === "" || start == null || end == null) return null;
|
|
362
|
+
return (value) => {
|
|
363
|
+
const number = Number(value);
|
|
364
|
+
return number >= Number(start) && number <= Number(end);
|
|
365
|
+
};
|
|
366
|
+
},
|
|
367
|
+
InputComponent: ({ item, applyValue, focusElementRef }) => {
|
|
368
|
+
const onChange = createChange(item, applyValue);
|
|
369
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: [
|
|
370
|
+
/* @__PURE__ */ jsx(
|
|
371
|
+
TextField,
|
|
372
|
+
{
|
|
373
|
+
size: "small",
|
|
374
|
+
label: "De",
|
|
375
|
+
type: "number",
|
|
376
|
+
variant: "outlined",
|
|
377
|
+
inputRef: focusElementRef,
|
|
378
|
+
value: (item.value || ["", ""])[0] || "",
|
|
379
|
+
onChange: onChange(0),
|
|
380
|
+
placeholder: "M\xEDnimo"
|
|
381
|
+
}
|
|
382
|
+
),
|
|
383
|
+
/* @__PURE__ */ jsx(
|
|
384
|
+
TextField,
|
|
385
|
+
{
|
|
386
|
+
size: "small",
|
|
387
|
+
label: "At\xE9",
|
|
388
|
+
type: "number",
|
|
389
|
+
variant: "outlined",
|
|
390
|
+
value: (item.value || ["", ""])[1] || "",
|
|
391
|
+
onChange: onChange(1),
|
|
392
|
+
placeholder: "M\xE1ximo"
|
|
393
|
+
}
|
|
394
|
+
)
|
|
395
|
+
] });
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
var getTextOps = () => {
|
|
399
|
+
return [...getGridStringOperators(), textBetweenOp];
|
|
400
|
+
};
|
|
401
|
+
var getNumberOps = () => {
|
|
402
|
+
return [...getGridNumericOperators(), numberBetweenOp];
|
|
403
|
+
};
|
|
404
|
+
GRID_STRING_COL_DEF.filterOperators = getTextOps();
|
|
405
|
+
GRID_NUMERIC_COL_DEF.filterOperators = getNumberOps();
|
|
406
|
+
function CustomColumnsPanel(props) {
|
|
407
|
+
return /* @__PURE__ */ jsx(GridColumnsPanel, __spreadProps(__spreadValues({}, props), { sx: columnPanelSx }));
|
|
408
|
+
}
|
|
409
|
+
function CustomColumnMenu(props) {
|
|
410
|
+
return /* @__PURE__ */ jsx(Box, { sx: columnMenuSx, children: /* @__PURE__ */ jsx(GridColumnMenu, __spreadValues({}, props)) });
|
|
411
|
+
}
|
|
412
|
+
function CustomFilterPanel(props) {
|
|
413
|
+
return /* @__PURE__ */ jsx(GridFilterPanel, __spreadProps(__spreadValues({}, props), { sx: filterSx }));
|
|
414
|
+
}
|
|
415
|
+
function CustomNoRowsOverlay() {
|
|
416
|
+
return /* @__PURE__ */ jsx(GridOverlay, { children: /* @__PURE__ */ jsx(Box, { sx: { mt: 1 }, children: "Nenhum dado encontrado." }) });
|
|
417
|
+
}
|
|
418
|
+
function CustomPagination() {
|
|
419
|
+
return /* @__PURE__ */ jsx(Box, { sx: paginationSx, children: /* @__PURE__ */ jsx(GridPagination, {}) });
|
|
420
|
+
}
|
|
421
|
+
var DataTable = (_a) => {
|
|
422
|
+
var rest = __objRest(_a, []);
|
|
423
|
+
return /* @__PURE__ */ jsx(Box, { sx: { mb: 2, mt: 2, height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
424
|
+
DataGrid,
|
|
425
|
+
__spreadProps(__spreadValues({
|
|
426
|
+
sx: tableSx
|
|
427
|
+
}, rest), {
|
|
428
|
+
className: "min-h-[210px]!",
|
|
429
|
+
localeText,
|
|
430
|
+
disableRowSelectionOnClick: true,
|
|
431
|
+
slotProps: {
|
|
432
|
+
loadingOverlay: {
|
|
433
|
+
variant: "linear-progress",
|
|
434
|
+
noRowsVariant: "skeleton"
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
slots: {
|
|
438
|
+
columnMenu: CustomColumnMenu,
|
|
439
|
+
filterPanel: CustomFilterPanel,
|
|
440
|
+
columnsPanel: CustomColumnsPanel,
|
|
441
|
+
noRowsOverlay: CustomNoRowsOverlay,
|
|
442
|
+
pagination: CustomPagination
|
|
443
|
+
}
|
|
444
|
+
})
|
|
445
|
+
) });
|
|
446
|
+
};
|
|
447
|
+
var data_table_default = DataTable;
|
|
448
|
+
var DEFAULT_TAB_COLOR = "var(--primary-color)";
|
|
449
|
+
var DEFAULT_TAB_FONT_FAMILY = "var(--font-family, inherit)";
|
|
450
|
+
var Tabs = styled(Tabs$1, {
|
|
451
|
+
shouldForwardProp: (prop) => prop !== "color"
|
|
452
|
+
})(({ color = DEFAULT_TAB_COLOR }) => ({
|
|
453
|
+
fontFamily: `${DEFAULT_TAB_FONT_FAMILY} !important`,
|
|
454
|
+
"& .MuiTabs-indicator": { backgroundColor: color }
|
|
455
|
+
}));
|
|
456
|
+
var Tab = styled(Tab$1, {
|
|
457
|
+
shouldForwardProp: (prop) => prop !== "color" && prop !== "fontFamily"
|
|
458
|
+
})(
|
|
459
|
+
({ color = DEFAULT_TAB_COLOR, fontFamily = DEFAULT_TAB_FONT_FAMILY }) => ({
|
|
460
|
+
fontWeight: "500 !important",
|
|
461
|
+
color: "#000000CC !important",
|
|
462
|
+
fontSize: "14px !important",
|
|
463
|
+
textTransform: "uppercase !important",
|
|
464
|
+
fontFamily: `${fontFamily} !important`,
|
|
465
|
+
"&.Mui-selected": { color: `${color} !important` }
|
|
466
|
+
})
|
|
467
|
+
);
|
|
468
|
+
|
|
469
|
+
// src/core/css-var.ts
|
|
470
|
+
function withCssVar(style, name, value) {
|
|
471
|
+
if (value == null || value === "") return style;
|
|
472
|
+
return __spreadProps(__spreadValues({}, style), { [name]: value });
|
|
473
|
+
}
|
|
474
|
+
var DEFAULT_ACCENT = "var(--primary-color)";
|
|
475
|
+
var accent = "var(--primary-color)";
|
|
476
|
+
var errorColor = "#D32F2F";
|
|
477
|
+
var focusLabel = { color: accent };
|
|
478
|
+
var errorLabel = { color: errorColor };
|
|
479
|
+
var borderAccent = { borderColor: accent };
|
|
480
|
+
var borderError = { borderColor: errorColor };
|
|
481
|
+
var underlineAccent = { borderBottomColor: accent };
|
|
482
|
+
var underlineError = { borderBottomColor: errorColor };
|
|
483
|
+
var disabledText = { color: "#9E9E9E", cursor: "not-allowed" };
|
|
484
|
+
var disabledBorder = { borderColor: "#9E9E9E", cursor: "not-allowed" };
|
|
485
|
+
var input = {
|
|
486
|
+
color: "#333",
|
|
487
|
+
fontSize: "13px !important",
|
|
488
|
+
fontFamily: "var(--font-poppins) !important"
|
|
489
|
+
};
|
|
490
|
+
var InputTextField = styled(TextField)({
|
|
491
|
+
fontFamily: "var(--font-poppins) !important",
|
|
492
|
+
"& input": input,
|
|
493
|
+
"& label": input,
|
|
494
|
+
"& label.Mui-focused": focusLabel,
|
|
495
|
+
"& label.Mui-error": errorLabel,
|
|
496
|
+
"& .MuiInput-underline:after": underlineAccent,
|
|
497
|
+
"& .MuiInput-underline.Mui-error:after": underlineError,
|
|
498
|
+
"& .MuiOutlinedInput-root": {
|
|
499
|
+
"& fieldset": borderAccent,
|
|
500
|
+
"&:hover fieldset": borderAccent,
|
|
501
|
+
"&.Mui-disabled fieldset": disabledBorder,
|
|
502
|
+
"&.Mui-focused fieldset": borderAccent,
|
|
503
|
+
"&.Mui-error fieldset": borderError,
|
|
504
|
+
"&.Mui-error:hover fieldset": borderError,
|
|
505
|
+
"&.Mui-error.Mui-focused fieldset": borderError
|
|
506
|
+
},
|
|
507
|
+
"& .MuiFilledInput-root": {
|
|
508
|
+
backgroundColor: "#F9FAFB",
|
|
509
|
+
"&:after": underlineAccent,
|
|
510
|
+
"&:before": underlineAccent,
|
|
511
|
+
"&:hover:before": underlineAccent,
|
|
512
|
+
"&.Mui-error:after": underlineError,
|
|
513
|
+
"&.Mui-error:before": underlineError,
|
|
514
|
+
"&:hover": { backgroundColor: "#F5F5F5" },
|
|
515
|
+
"&.Mui-error:hover:before": underlineError,
|
|
516
|
+
fontFamily: "var(--font-poppins) !important",
|
|
517
|
+
"&.Mui-disabled": __spreadProps(__spreadValues({}, disabledText), { backgroundColor: "#F9FAFB" })
|
|
518
|
+
},
|
|
519
|
+
"& .MuiInputBase-input": __spreadProps(__spreadValues({}, input), { "&.Mui-disabled": disabledText }),
|
|
520
|
+
"& .MuiFormHelperText-root": {
|
|
521
|
+
fontSize: "11px",
|
|
522
|
+
marginLeft: 2,
|
|
523
|
+
fontFamily: "var(--font-poppins) !important"
|
|
524
|
+
},
|
|
525
|
+
"& .MuiFormHelperText-root.Mui-error": { color: errorColor },
|
|
526
|
+
"& .Mui-disabled": disabledText
|
|
527
|
+
});
|
|
528
|
+
var css_default = memo(InputTextField);
|
|
529
|
+
function useInputMasker({ type, onChange }) {
|
|
530
|
+
const formatValue = useCallback(
|
|
531
|
+
(v) => {
|
|
532
|
+
if (!v) return "";
|
|
533
|
+
switch (type) {
|
|
534
|
+
case "cpf-cnpj":
|
|
535
|
+
return formatCpfCnpj(v);
|
|
536
|
+
case "numeric":
|
|
537
|
+
return removeDigits(v);
|
|
538
|
+
case "tel":
|
|
539
|
+
return formatPhoneBr(v);
|
|
540
|
+
case "price":
|
|
541
|
+
return formatPriceBrl(v);
|
|
542
|
+
case "text-only":
|
|
543
|
+
return removeTextOnly(v);
|
|
544
|
+
case "text-no-number":
|
|
545
|
+
return removeNonDigits(v);
|
|
546
|
+
case "item-170":
|
|
547
|
+
return formatItem170(v);
|
|
548
|
+
case "item-150":
|
|
549
|
+
return formatItem150(v);
|
|
550
|
+
default:
|
|
551
|
+
return v;
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
[type]
|
|
555
|
+
);
|
|
556
|
+
const handleChange = (e) => {
|
|
557
|
+
const newValue = e.target.value;
|
|
558
|
+
onChange == null ? void 0 : onChange(__spreadProps(__spreadValues({}, e), {
|
|
559
|
+
target: __spreadProps(__spreadValues({}, e.target), { value: formatValue(newValue) })
|
|
560
|
+
}));
|
|
561
|
+
};
|
|
562
|
+
return { handleChange };
|
|
563
|
+
}
|
|
564
|
+
function withPasswordToggle({
|
|
565
|
+
showPwd,
|
|
566
|
+
canToggle,
|
|
567
|
+
slotProps,
|
|
568
|
+
setShowPwd,
|
|
569
|
+
color = DEFAULT_ACCENT
|
|
570
|
+
}) {
|
|
571
|
+
if (!canToggle) return slotProps;
|
|
572
|
+
const Icon = showPwd ? MdVisibilityOff : MdVisibility;
|
|
573
|
+
return __spreadProps(__spreadValues({}, slotProps), {
|
|
574
|
+
input: __spreadProps(__spreadValues({}, slotProps == null ? void 0 : slotProps.input), {
|
|
575
|
+
endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
|
|
576
|
+
IconButton,
|
|
577
|
+
{
|
|
578
|
+
edge: "end",
|
|
579
|
+
size: "small",
|
|
580
|
+
sx: { color },
|
|
581
|
+
onClick: () => setShowPwd((prev) => !prev),
|
|
582
|
+
children: /* @__PURE__ */ jsx(Icon, { size: 20 })
|
|
583
|
+
}
|
|
584
|
+
) })
|
|
585
|
+
})
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
function buildSlotProps(args) {
|
|
589
|
+
return withPasswordToggle(args);
|
|
590
|
+
}
|
|
591
|
+
var CUSTOM_INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
592
|
+
"cpf-cnpj",
|
|
593
|
+
"numeric",
|
|
594
|
+
"price",
|
|
595
|
+
"item-170",
|
|
596
|
+
"item-150",
|
|
597
|
+
"text-only",
|
|
598
|
+
"text-no-number"
|
|
599
|
+
]);
|
|
600
|
+
function resolveHtmlInputType(type) {
|
|
601
|
+
if (!type || CUSTOM_INPUT_TYPES.has(type)) return "text";
|
|
602
|
+
return type;
|
|
603
|
+
}
|
|
604
|
+
var Input = (_a) => {
|
|
605
|
+
var _b = _a, {
|
|
606
|
+
color,
|
|
607
|
+
onChange,
|
|
608
|
+
isPassword,
|
|
609
|
+
type = "text",
|
|
610
|
+
size = "small"
|
|
611
|
+
} = _b, rest = __objRest(_b, [
|
|
612
|
+
"color",
|
|
613
|
+
"onChange",
|
|
614
|
+
"isPassword",
|
|
615
|
+
"type",
|
|
616
|
+
"size"
|
|
617
|
+
]);
|
|
618
|
+
const [showPwd, setShowPwd] = useState(false);
|
|
619
|
+
const isPwd = type === "password";
|
|
620
|
+
const canToggle = isPwd && isPassword;
|
|
621
|
+
const htmlType = resolveHtmlInputType(type);
|
|
622
|
+
const inputType = canToggle && showPwd ? "text" : htmlType;
|
|
623
|
+
const style = useMemo(
|
|
624
|
+
() => withCssVar(rest.style, "--primary-color", color),
|
|
625
|
+
[color, rest.style]
|
|
626
|
+
);
|
|
627
|
+
const slotProps = useMemo(
|
|
628
|
+
() => buildSlotProps({
|
|
629
|
+
color,
|
|
630
|
+
showPwd,
|
|
631
|
+
canToggle,
|
|
632
|
+
setShowPwd,
|
|
633
|
+
slotProps: rest.slotProps
|
|
634
|
+
}),
|
|
635
|
+
[canToggle, color, showPwd, rest.slotProps]
|
|
636
|
+
);
|
|
637
|
+
const { handleChange } = useInputMasker({ type, onChange });
|
|
638
|
+
return /* @__PURE__ */ jsx(
|
|
639
|
+
css_default,
|
|
640
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
641
|
+
size,
|
|
642
|
+
style,
|
|
643
|
+
type: inputType,
|
|
644
|
+
slotProps,
|
|
645
|
+
onChange: handleChange,
|
|
646
|
+
className: cn("select-none", rest.className)
|
|
647
|
+
})
|
|
648
|
+
);
|
|
649
|
+
};
|
|
650
|
+
var input_default = Input;
|
|
651
|
+
|
|
652
|
+
// src/components/ui/input-select/utils/css.ts
|
|
653
|
+
var optionText = {
|
|
654
|
+
fontSize: "13px !important",
|
|
655
|
+
fontFamily: "var(--font-poppins) !important"
|
|
656
|
+
};
|
|
657
|
+
var selectMui = {
|
|
658
|
+
"& .MuiAutocomplete-option": __spreadProps(__spreadValues({
|
|
659
|
+
padding: "8px 12px"
|
|
660
|
+
}, optionText), {
|
|
661
|
+
lineHeight: "25px !important"
|
|
662
|
+
}),
|
|
663
|
+
"& .MuiAutocomplete-noOptions": optionText,
|
|
664
|
+
"& .MuiAutocomplete-listbox": { padding: "5px" }
|
|
665
|
+
};
|
|
666
|
+
function InputSelect(_a) {
|
|
667
|
+
var _b = _a, {
|
|
668
|
+
multiple,
|
|
669
|
+
optionLabel,
|
|
670
|
+
onChange,
|
|
671
|
+
input: input2
|
|
672
|
+
} = _b, rest = __objRest(_b, [
|
|
673
|
+
"multiple",
|
|
674
|
+
"optionLabel",
|
|
675
|
+
"onChange",
|
|
676
|
+
"input"
|
|
677
|
+
]);
|
|
678
|
+
const handleChange = (event, value, reason, details) => {
|
|
679
|
+
onChange == null ? void 0 : onChange(event, value, reason, details);
|
|
680
|
+
};
|
|
681
|
+
return /* @__PURE__ */ jsx(
|
|
682
|
+
Autocomplete,
|
|
683
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
684
|
+
size: "small",
|
|
685
|
+
multiple,
|
|
686
|
+
onChange: handleChange,
|
|
687
|
+
slotProps: { paper: { sx: selectMui } },
|
|
688
|
+
getOptionLabel: (option) => typeof option === "string" ? "" : optionLabel(option),
|
|
689
|
+
isOptionEqualToValue: (option, value) => JSON.stringify(option) === JSON.stringify(value),
|
|
690
|
+
renderInput: (params) => {
|
|
691
|
+
var _a2;
|
|
692
|
+
return /* @__PURE__ */ jsx(input_default, __spreadProps(__spreadValues(__spreadValues({}, params), input2), { size: (_a2 = input2 == null ? void 0 : input2.size) != null ? _a2 : "small" }));
|
|
693
|
+
}
|
|
694
|
+
})
|
|
695
|
+
);
|
|
696
|
+
}
|
|
697
|
+
var input_select_default = InputSelect;
|
|
698
|
+
var FilterCard = ({
|
|
699
|
+
title,
|
|
700
|
+
setOpen,
|
|
701
|
+
renderFilter
|
|
702
|
+
}) => {
|
|
703
|
+
return /* @__PURE__ */ jsxs("div", { className: "h-15 flex items-center w-full bg-white mb-2 rounded-md shadow-[0_2px_6px_-1px_rgba(0,0,0,.16),0_6px_18px_-1px_rgba(0,0,0,.06)]", children: [
|
|
704
|
+
/* @__PURE__ */ jsx("div", { className: "h-full w-2 bg-(--primary-color) rounded-tl-md rounded-bl-md" }),
|
|
705
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full flex justify-between items-center p-3", children: [
|
|
706
|
+
/* @__PURE__ */ jsx("h1", { className: "font-medium text-lg whitespace-nowrap text-ellipsis overflow-hidden ml-1 text-black/80", children: title }),
|
|
707
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center space-x-4", children: renderFilter && /* @__PURE__ */ jsx(
|
|
708
|
+
Tooltip,
|
|
709
|
+
{
|
|
710
|
+
withArrow: true,
|
|
711
|
+
arrowSize: 4,
|
|
712
|
+
color: "#00b2a6",
|
|
713
|
+
arrowOffset: 20,
|
|
714
|
+
label: "Ver filtros",
|
|
715
|
+
className: "text-xs!",
|
|
716
|
+
transitionProps: { transition: "pop", duration: 300 },
|
|
717
|
+
children: /* @__PURE__ */ jsx("span", { className: "flex items-center", children: /* @__PURE__ */ jsx(
|
|
718
|
+
ActionIcon,
|
|
719
|
+
{
|
|
720
|
+
size: 40,
|
|
721
|
+
radius: "md",
|
|
722
|
+
"aria-label": "Ver filtros",
|
|
723
|
+
color: "var(--primary-color)",
|
|
724
|
+
onClick: () => setOpen(true),
|
|
725
|
+
children: /* @__PURE__ */ jsx(FaFilter, { className: "h-5 w-5 text-white" })
|
|
726
|
+
}
|
|
727
|
+
) })
|
|
728
|
+
}
|
|
729
|
+
) })
|
|
730
|
+
] })
|
|
731
|
+
] });
|
|
732
|
+
};
|
|
733
|
+
var card_default2 = FilterCard;
|
|
734
|
+
|
|
735
|
+
// src/components/ui/filter/utils/constants.ts
|
|
736
|
+
var FILTER_DEFAULT_ORDER = 99;
|
|
737
|
+
var FILTER_DRAWER_PAPER_SX = {
|
|
738
|
+
["& .MuiDrawer-paper"]: { borderRadius: "0px 0px 20px 20px" }
|
|
739
|
+
};
|
|
740
|
+
function hasFilterFields(inputs, inputSelect) {
|
|
741
|
+
var _a, _b;
|
|
742
|
+
return ((_a = inputs == null ? void 0 : inputs.length) != null ? _a : 0) > 0 || ((_b = inputSelect == null ? void 0 : inputSelect.length) != null ? _b : 0) > 0;
|
|
743
|
+
}
|
|
744
|
+
function isInputSelect(field) {
|
|
745
|
+
return "options" in field;
|
|
746
|
+
}
|
|
747
|
+
function filterInputSelect(props) {
|
|
748
|
+
return props;
|
|
749
|
+
}
|
|
750
|
+
function sortFilterFields(fields) {
|
|
751
|
+
return [...fields].sort(
|
|
752
|
+
(a, b) => {
|
|
753
|
+
var _a, _b;
|
|
754
|
+
return ((_a = a.order) != null ? _a : FILTER_DEFAULT_ORDER) - ((_b = b.order) != null ? _b : FILTER_DEFAULT_ORDER);
|
|
755
|
+
}
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
function mergeFilterFields(inputs, inputSelect) {
|
|
759
|
+
return sortFilterFields([...inputs, ...inputSelect]);
|
|
760
|
+
}
|
|
761
|
+
function getFilterGridColumns(isMobile, isTablet) {
|
|
762
|
+
if (isMobile) return 1;
|
|
763
|
+
if (isTablet) return 3;
|
|
764
|
+
return 7;
|
|
765
|
+
}
|
|
766
|
+
var FilterDrawer = ({
|
|
767
|
+
open,
|
|
768
|
+
setOpen,
|
|
769
|
+
onClear,
|
|
770
|
+
onSubmit,
|
|
771
|
+
inputs = [],
|
|
772
|
+
inputSelect = []
|
|
773
|
+
}) => {
|
|
774
|
+
const m640 = useMediaQuery("(max-width:640px)");
|
|
775
|
+
const m1120 = useMediaQuery("(max-width:1120px)");
|
|
776
|
+
const allInputs = mergeFilterFields(inputs, inputSelect);
|
|
777
|
+
const renderField = (field, index) => {
|
|
778
|
+
var _a, _b, _c;
|
|
779
|
+
if (isInputSelect(field)) {
|
|
780
|
+
if (field.multiple) {
|
|
781
|
+
return /* @__PURE__ */ jsx(Grid, { size: (_a = field.xs) != null ? _a : 1, children: /* @__PURE__ */ jsx(
|
|
782
|
+
input_select_default,
|
|
783
|
+
__spreadProps(__spreadValues({}, field), {
|
|
784
|
+
id: `inputSM${index}`,
|
|
785
|
+
fullWidth: true
|
|
786
|
+
})
|
|
787
|
+
) }, `inputSelect-${index}`);
|
|
788
|
+
}
|
|
789
|
+
return /* @__PURE__ */ jsx(Grid, { size: (_b = field.xs) != null ? _b : 1, children: /* @__PURE__ */ jsx(
|
|
790
|
+
input_select_default,
|
|
791
|
+
__spreadProps(__spreadValues({}, field), {
|
|
792
|
+
id: `inputSM${index}`,
|
|
793
|
+
fullWidth: true
|
|
794
|
+
})
|
|
795
|
+
) }, `inputSelect-${index}`);
|
|
796
|
+
}
|
|
797
|
+
return /* @__PURE__ */ jsx(Grid, { size: (_c = field.xs) != null ? _c : 1, children: /* @__PURE__ */ jsx(input_default, __spreadProps(__spreadValues({}, field), { fullWidth: true })) }, `input-${index}`);
|
|
798
|
+
};
|
|
799
|
+
const handleSubmit = (event) => {
|
|
800
|
+
event.preventDefault();
|
|
801
|
+
if (!onSubmit) return;
|
|
802
|
+
onSubmit(event);
|
|
803
|
+
setOpen(false);
|
|
804
|
+
};
|
|
805
|
+
return /* @__PURE__ */ jsx(
|
|
806
|
+
Drawer,
|
|
807
|
+
{
|
|
808
|
+
open,
|
|
809
|
+
anchor: "top",
|
|
810
|
+
onClose: () => setOpen(false),
|
|
811
|
+
sx: FILTER_DRAWER_PAPER_SX,
|
|
812
|
+
children: /* @__PURE__ */ jsxs(
|
|
813
|
+
"form",
|
|
814
|
+
{
|
|
815
|
+
onSubmit: handleSubmit,
|
|
816
|
+
className: "flex w-full select-none flex-col py-4 pl-5",
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-medium text-system-900", children: "Filtros" }),
|
|
819
|
+
/* @__PURE__ */ jsx("p", { className: "pb-5 pt-1 text-sm text-black/80", children: "Para que possamos apresentar dados espec\xEDficos, por favor, preencha os campos abaixo." }),
|
|
820
|
+
/* @__PURE__ */ jsx(
|
|
821
|
+
Grid,
|
|
822
|
+
{
|
|
823
|
+
container: true,
|
|
824
|
+
rowSpacing: 2,
|
|
825
|
+
className: "pr-5",
|
|
826
|
+
columnSpacing: 1,
|
|
827
|
+
columns: getFilterGridColumns(Boolean(m640), Boolean(m1120)),
|
|
828
|
+
children: allInputs.map((field, index) => renderField(field, index))
|
|
829
|
+
}
|
|
830
|
+
),
|
|
831
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end space-x-4 pr-4 pt-4", children: [
|
|
832
|
+
onClear && /* @__PURE__ */ jsx(
|
|
833
|
+
Button,
|
|
834
|
+
{
|
|
835
|
+
radius: "sm",
|
|
836
|
+
color: "#253E56",
|
|
837
|
+
variant: "outline",
|
|
838
|
+
onClick: onClear,
|
|
839
|
+
size: "xs",
|
|
840
|
+
children: "LIMPAR FILTROS"
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
onSubmit && /* @__PURE__ */ jsx(
|
|
844
|
+
Button,
|
|
845
|
+
{
|
|
846
|
+
size: "xs",
|
|
847
|
+
radius: "sm",
|
|
848
|
+
type: "submit",
|
|
849
|
+
variant: "filled",
|
|
850
|
+
color: "var(--primary-color)",
|
|
851
|
+
children: "PESQUISAR"
|
|
852
|
+
}
|
|
853
|
+
)
|
|
854
|
+
] })
|
|
855
|
+
]
|
|
856
|
+
}
|
|
857
|
+
)
|
|
858
|
+
}
|
|
859
|
+
);
|
|
860
|
+
};
|
|
861
|
+
var filter_default = FilterDrawer;
|
|
862
|
+
var Filter = ({
|
|
863
|
+
title,
|
|
864
|
+
inputs,
|
|
865
|
+
onClear,
|
|
866
|
+
onSubmit,
|
|
867
|
+
inputSelect
|
|
868
|
+
}) => {
|
|
869
|
+
const [open, setOpen] = useState(false);
|
|
870
|
+
const hasFields = hasFilterFields(inputs, inputSelect);
|
|
871
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
872
|
+
/* @__PURE__ */ jsx(card_default2, { title, setOpen, renderFilter: hasFields }),
|
|
873
|
+
/* @__PURE__ */ jsx(
|
|
874
|
+
filter_default,
|
|
875
|
+
{
|
|
876
|
+
open,
|
|
877
|
+
inputs,
|
|
878
|
+
setOpen,
|
|
879
|
+
onClear,
|
|
880
|
+
onSubmit,
|
|
881
|
+
inputSelect
|
|
882
|
+
}
|
|
883
|
+
)
|
|
884
|
+
] });
|
|
885
|
+
};
|
|
886
|
+
var filter_default2 = Filter;
|
|
887
|
+
|
|
888
|
+
export { card_default as Card, data_table_default as DataTable, dialog_default as Dialog, filter_default2 as Filter, input_default as Input, input_select_default as InputSelect, Tab, Tabs, filterInputSelect };
|
|
3
889
|
//# sourceMappingURL=index.mjs.map
|
|
4
890
|
//# sourceMappingURL=index.mjs.map
|