@grazziotin/react-components-next 1.0.0 → 1.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/README.md +184 -105
- package/dist/{chunk-NHHZBMJL.mjs → chunk-4DIPDYEU.mjs} +18 -3
- package/dist/chunk-4DIPDYEU.mjs.map +1 -0
- package/dist/chunk-XNWAGZVV.mjs +467 -0
- package/dist/chunk-XNWAGZVV.mjs.map +1 -0
- package/dist/functions/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +368 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/ui/index.d.mts +98 -6
- package/dist/ui/index.d.ts +98 -6
- package/dist/ui/index.js +367 -2
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +2 -2
- package/package.json +2 -3
- package/dist/chunk-CNXFSE26.mjs +0 -120
- package/dist/chunk-CNXFSE26.mjs.map +0 -1
- package/dist/chunk-NHHZBMJL.mjs.map +0 -1
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as _mui_material from '@mui/material';
|
|
2
|
+
import { CSSProperties, Breakpoint, TabProps as TabProps$1, TabsProps as TabsProps$1 } from '@mui/material';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import react__default, { ComponentPropsWithoutRef } from 'react';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { DataGridProps } from '@mui/x-data-grid';
|
|
7
|
+
import * as _emotion_styled from '@emotion/styled';
|
|
8
|
+
import * as _mui_system from '@mui/system';
|
|
9
|
+
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
3
10
|
|
|
4
11
|
/**
|
|
5
12
|
* Tipo do atributo nativo `className` de um elemento `div` no React.
|
|
@@ -55,7 +62,7 @@ interface CardProps {
|
|
|
55
62
|
/**
|
|
56
63
|
* Cor de fundo do cabeçalho.
|
|
57
64
|
* Aceita cores CSS (hex, rgb, variáveis CSS, etc.).
|
|
58
|
-
* @default "var(--color
|
|
65
|
+
* @default "var(--primary-color)"
|
|
59
66
|
*/
|
|
60
67
|
titleColor?: string;
|
|
61
68
|
/**
|
|
@@ -104,7 +111,7 @@ interface CardProps {
|
|
|
104
111
|
* @param props.toolTip - Habilita tooltip no título.
|
|
105
112
|
* @param props.className - `className` nativo do React no container.
|
|
106
113
|
* @param props.titleWidth - Largura da barra do cabeçalho. Padrão: `"100%"`.
|
|
107
|
-
* @param props.titleColor - Cor de fundo do cabeçalho. Padrão: `var(--color
|
|
114
|
+
* @param props.titleColor - Cor de fundo do cabeçalho. Padrão: `var(--primary-color)`.
|
|
108
115
|
* @param props.borderTitle - `border-radius` só do cabeçalho.
|
|
109
116
|
* @param props.onClick - Clique no card; adiciona `cursor: pointer !important`.
|
|
110
117
|
* @param props.borderRadius - `border-radius` do container.
|
|
@@ -219,6 +226,91 @@ interface DialogProps {
|
|
|
219
226
|
* </Dialog>
|
|
220
227
|
* ```
|
|
221
228
|
*/
|
|
222
|
-
declare function Dialog({ open, title, onClose, actions, children, maxWidth, blurBackdrop, }: Readonly<DialogProps>):
|
|
229
|
+
declare function Dialog({ open, title, onClose, actions, children, maxWidth, blurBackdrop, }: Readonly<DialogProps>): react__default.ReactElement;
|
|
223
230
|
|
|
224
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Propriedades do componente {@link DataTable}.
|
|
233
|
+
* Wrapper tipado sobre o MUI `DataGrid`, com estilização e textos em português.
|
|
234
|
+
*/
|
|
235
|
+
type DataTableProps = DataGridProps;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Componente DataTable personalizado baseado no MUI DataGrid.
|
|
239
|
+
*
|
|
240
|
+
* Fornece uma tabela de dados com estilização customizada, filtros avançados,
|
|
241
|
+
* paginação, ordenação e gerenciamento de colunas.
|
|
242
|
+
*
|
|
243
|
+
* Recursos incluídos:
|
|
244
|
+
* - Operador de filtro "entre" automático para colunas string e number
|
|
245
|
+
* - Painel de filtros customizado
|
|
246
|
+
* - Painel de gerenciamento de colunas
|
|
247
|
+
* - Paginação estilizada
|
|
248
|
+
* - Overlay personalizado para "sem dados"
|
|
249
|
+
* - Textos em português brasileiro
|
|
250
|
+
*
|
|
251
|
+
* @param props - Todas as props do MUI DataGrid são suportadas. Ver {@link DataTableProps}.
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* <DataTable
|
|
255
|
+
* rows={dados}
|
|
256
|
+
* columns={colunas}
|
|
257
|
+
* loading={carregando}
|
|
258
|
+
* pageSizeOptions={[10, 20, 50]}
|
|
259
|
+
* />
|
|
260
|
+
*/
|
|
261
|
+
declare const DataTable: ({ ...rest }: DataTableProps) => react_jsx_runtime.JSX.Element;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Propriedades de estilo compartilhadas entre {@link Tab} e {@link Tabs}.
|
|
265
|
+
*/
|
|
266
|
+
interface TabColorProps {
|
|
267
|
+
/**
|
|
268
|
+
* Cor do indicador ativo e do rótulo da aba selecionada.
|
|
269
|
+
* @default "var(--primary-color)"
|
|
270
|
+
*/
|
|
271
|
+
color?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Família tipográfica do rótulo da aba.
|
|
274
|
+
* Defina `--font-family` no CSS do projeto ou passe esta prop diretamente.
|
|
275
|
+
* @default "var(--font-family, inherit)"
|
|
276
|
+
*/
|
|
277
|
+
fontFamily?: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Propriedades do componente {@link Tab}.
|
|
281
|
+
* Estende o `Tab` do MUI com suporte a cor customizada via `color`.
|
|
282
|
+
*/
|
|
283
|
+
type TabProps = TabProps$1 & TabColorProps;
|
|
284
|
+
/**
|
|
285
|
+
* Propriedades do componente {@link Tabs}.
|
|
286
|
+
* Estende o `Tabs` do MUI com suporte a cor customizada do indicador via `color`.
|
|
287
|
+
*/
|
|
288
|
+
type TabsProps = TabsProps$1 & TabColorProps;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Container de abas baseado no MUI `Tabs`, com indicador colorido customizável.
|
|
292
|
+
*
|
|
293
|
+
* @param props.color - Cor do indicador da aba ativa. Padrão: `var(--primary-color)`.
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```tsx
|
|
297
|
+
* <Tabs value={value} onChange={handleChange} color="#00B2A6">
|
|
298
|
+
* <Tab label="Aba 1" />
|
|
299
|
+
* </Tabs>
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
declare const Tabs: _emotion_styled.StyledComponent<_mui_material.TabsOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style" | "className" | "aria-label" | "aria-labelledby" | "children" | "onChange" | "sx" | "classes" | "slots" | "slotProps" | "variant" | "value" | "action" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "orientation" | "scrollButtons" | "selectionFollowsFocus" | "textColor" | "visibleScrollbar"> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & TabColorProps, {}, {}>;
|
|
303
|
+
/**
|
|
304
|
+
* Aba individual baseada no MUI `Tab`, com tipografia e cor de seleção customizáveis.
|
|
305
|
+
*
|
|
306
|
+
* @param props.color - Cor do rótulo quando a aba está selecionada. Padrão: `var(--primary-color)`.
|
|
307
|
+
* @param props.fontFamily - Família tipográfica do rótulo. Padrão: `var(--font-family, inherit)`.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```tsx
|
|
311
|
+
* <Tab label="Configurações" color="#00B2A6" />
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
declare const Tab: _emotion_styled.StyledComponent<_mui_material.TabOwnProps & Omit<_mui_material.ButtonBaseOwnProps, keyof _mui_material.TabOwnProps> & Omit<_mui_material.ButtonBaseOwnProps, "tabIndex" | "type" | "touchRippleRef" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "nativeButton" | "onFocusVisible" | "TouchRippleProps" | keyof _mui_material.TabOwnProps> & _mui_material_OverridableComponent.CommonProps & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "label" | "style" | "className" | "tabIndex" | "children" | "icon" | "sx" | "type" | "classes" | "disabled" | "touchRippleRef" | "value" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "nativeButton" | "onFocusVisible" | "TouchRippleProps" | "disableFocusRipple" | "iconPosition" | "wrapped"> & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & TabColorProps, {}, {}>;
|
|
315
|
+
|
|
316
|
+
export { Card, type CardClassName, type CardProps, DataTable, type DataTableProps, Dialog, type DialogProps, Tab, type TabColorProps, type TabProps, Tabs, type TabsProps };
|
package/dist/ui/index.js
CHANGED
|
@@ -9,6 +9,8 @@ var DialogMui = require('@mui/material/Dialog');
|
|
|
9
9
|
var DialogTitle = require('@mui/material/DialogTitle');
|
|
10
10
|
var DialogActions = require('@mui/material/DialogActions');
|
|
11
11
|
var DialogContent = require('@mui/material/DialogContent');
|
|
12
|
+
var locales = require('@mui/x-data-grid/locales');
|
|
13
|
+
var xDataGrid = require('@mui/x-data-grid');
|
|
12
14
|
|
|
13
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
16
|
|
|
@@ -18,6 +20,8 @@ var DialogActions__default = /*#__PURE__*/_interopDefault(DialogActions);
|
|
|
18
20
|
var DialogContent__default = /*#__PURE__*/_interopDefault(DialogContent);
|
|
19
21
|
|
|
20
22
|
var __defProp = Object.defineProperty;
|
|
23
|
+
var __defProps = Object.defineProperties;
|
|
24
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
21
25
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
22
26
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
23
27
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -33,6 +37,19 @@ var __spreadValues = (a, b) => {
|
|
|
33
37
|
}
|
|
34
38
|
return a;
|
|
35
39
|
};
|
|
40
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
41
|
+
var __objRest = (source, exclude) => {
|
|
42
|
+
var target = {};
|
|
43
|
+
for (var prop in source)
|
|
44
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
45
|
+
target[prop] = source[prop];
|
|
46
|
+
if (source != null && __getOwnPropSymbols)
|
|
47
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
48
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
49
|
+
target[prop] = source[prop];
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
};
|
|
36
53
|
function cn(...values) {
|
|
37
54
|
return tailwindMerge.twMerge(clsx.clsx(values));
|
|
38
55
|
}
|
|
@@ -49,7 +66,7 @@ function Card({
|
|
|
49
66
|
height = "auto",
|
|
50
67
|
titleWidth = "100%",
|
|
51
68
|
justifyContent = "space-between",
|
|
52
|
-
titleColor = "var(--color
|
|
69
|
+
titleColor = "var(--primary-color)",
|
|
53
70
|
icon
|
|
54
71
|
}) {
|
|
55
72
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -116,6 +133,12 @@ var DIALOG_BACKDROP_STYLE = {
|
|
|
116
133
|
backdropFilter: "blur(4px)",
|
|
117
134
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
118
135
|
};
|
|
136
|
+
var DIALOG_PAPER_FONT_SX = {
|
|
137
|
+
fontFamily: "var(--font-family, inherit) !important",
|
|
138
|
+
"& .MuiDialogTitle-root, & .MuiDialogContent-root, & .MuiDialogActions-root, & .MuiTypography-root": {
|
|
139
|
+
fontFamily: "inherit !important"
|
|
140
|
+
}
|
|
141
|
+
};
|
|
119
142
|
function Dialog({
|
|
120
143
|
open,
|
|
121
144
|
title,
|
|
@@ -133,7 +156,10 @@ function Dialog({
|
|
|
133
156
|
open,
|
|
134
157
|
onClose,
|
|
135
158
|
maxWidth,
|
|
136
|
-
slotProps: {
|
|
159
|
+
slotProps: {
|
|
160
|
+
backdrop: { sx: backdropStyle },
|
|
161
|
+
paper: { sx: DIALOG_PAPER_FONT_SX }
|
|
162
|
+
},
|
|
137
163
|
children: [
|
|
138
164
|
title && /* @__PURE__ */ jsxRuntime.jsx(DialogTitle__default.default, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-black-de", children: title }) }),
|
|
139
165
|
/* @__PURE__ */ jsxRuntime.jsx(DialogContent__default.default, { className: "text-black", children }),
|
|
@@ -143,8 +169,347 @@ function Dialog({
|
|
|
143
169
|
);
|
|
144
170
|
}
|
|
145
171
|
var dialog_default = Dialog;
|
|
172
|
+
var localeText = __spreadProps(__spreadValues({}, locales.ptBR.components.MuiDataGrid.defaultProps.localeText), {
|
|
173
|
+
noColumnsOverlayLabel: "Nenhuma coluna dispon\xEDvel",
|
|
174
|
+
noColumnsOverlayManageColumns: "Gerenciar colunas",
|
|
175
|
+
columnsManagementSearchTitle: "Buscar coluna",
|
|
176
|
+
columnsManagementNoColumns: "Nenhuma coluna para mostrar",
|
|
177
|
+
columnsManagementShowHideAllText: "Mostrar/Ocultar todas",
|
|
178
|
+
columnsManagementReset: "Redefinir",
|
|
179
|
+
columnsManagementDeleteIconLabel: "Excluir",
|
|
180
|
+
columnMenuManageColumns: "Gerenciar colunas",
|
|
181
|
+
columnMenuShowColumns: "Mostrar colunas",
|
|
182
|
+
columnMenuLabel: "Menu da coluna",
|
|
183
|
+
columnMenuHideColumn: "Ocultar",
|
|
184
|
+
columnMenuUnsort: "Remover ordena\xE7\xE3o",
|
|
185
|
+
columnMenuSortAsc: "Ordenar ASC",
|
|
186
|
+
columnMenuSortDesc: "Ordenar DESC",
|
|
187
|
+
columnMenuFilter: "Filtrar",
|
|
188
|
+
toolbarQuickFilterLabel: "Filtro r\xE1pido",
|
|
189
|
+
toolbarQuickFilterPlaceholder: "Filtrar\u2026",
|
|
190
|
+
toolbarQuickFilterDeleteIconLabel: "Limpar filtro",
|
|
191
|
+
toolbarExport: "Exportar",
|
|
192
|
+
toolbarExportLabel: "Exportar",
|
|
193
|
+
toolbarExportCSV: "Baixar como CSV",
|
|
194
|
+
toolbarExportPrint: "Imprimir",
|
|
195
|
+
toolbarColumns: "Colunas",
|
|
196
|
+
toolbarColumnsLabel: "Selecionar colunas",
|
|
197
|
+
toolbarFilters: "Filtros",
|
|
198
|
+
toolbarFiltersLabel: "Mostrar filtros",
|
|
199
|
+
toolbarFiltersTooltipHide: "Ocultar filtros",
|
|
200
|
+
toolbarFiltersTooltipShow: "Mostrar filtros",
|
|
201
|
+
toolbarFiltersTooltipActive: (count) => count === 1 ? `${count} filtro ativo` : `${count} filtros ativos`,
|
|
202
|
+
toolbarDensity: "Densidade",
|
|
203
|
+
toolbarDensityLabel: "Densidade",
|
|
204
|
+
toolbarDensityCompact: "Compacta",
|
|
205
|
+
toolbarDensityStandard: "Padr\xE3o",
|
|
206
|
+
toolbarDensityComfortable: "Confort\xE1vel",
|
|
207
|
+
filterPanelAddFilter: "Adicionar filtro",
|
|
208
|
+
filterPanelDeleteIconLabel: "Excluir",
|
|
209
|
+
filterPanelOperatorAnd: "E",
|
|
210
|
+
filterPanelOperatorOr: "OU",
|
|
211
|
+
filterPanelColumn: "Colunas",
|
|
212
|
+
filterPanelInputLabel: "Valor",
|
|
213
|
+
filterPanelInputPlaceholder: "Valor do filtro",
|
|
214
|
+
filterOperatorContains: "cont\xE9m",
|
|
215
|
+
filterOperatorEquals: "igual a",
|
|
216
|
+
filterOperatorStartsWith: "come\xE7a com",
|
|
217
|
+
filterOperatorEndsWith: "termina com",
|
|
218
|
+
filterOperatorIs: "\xE9",
|
|
219
|
+
filterOperatorNot: "n\xE3o \xE9",
|
|
220
|
+
filterOperatorAfter: "depois de",
|
|
221
|
+
filterOperatorOnOrAfter: "em ou depois de",
|
|
222
|
+
filterOperatorBefore: "antes de",
|
|
223
|
+
filterOperatorOnOrBefore: "em ou antes de",
|
|
224
|
+
filterOperatorIsEmpty: "est\xE1 vazio",
|
|
225
|
+
filterOperatorIsNotEmpty: "n\xE3o est\xE1 vazio",
|
|
226
|
+
filterOperatorIsAnyOf: "\xE9 qualquer um de",
|
|
227
|
+
footerTotalRows: "Total de linhas:",
|
|
228
|
+
footerRowSelected: (count) => count === 1 ? "1 linha selecionada" : `${count.toLocaleString()} linhas selecionadas`,
|
|
229
|
+
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} de ${totalCount.toLocaleString()}`,
|
|
230
|
+
paginationRowsPerPage: "Linhas por p\xE1gina:",
|
|
231
|
+
paginationItemAriaLabel: (type) => {
|
|
232
|
+
switch (type) {
|
|
233
|
+
case "first":
|
|
234
|
+
return "Primeira p\xE1gina";
|
|
235
|
+
case "last":
|
|
236
|
+
return "\xDAltima p\xE1gina";
|
|
237
|
+
case "next":
|
|
238
|
+
return "Pr\xF3xima p\xE1gina";
|
|
239
|
+
case "previous":
|
|
240
|
+
return "P\xE1gina anterior";
|
|
241
|
+
default:
|
|
242
|
+
return "";
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
noRowsLabel: "Nenhum dado encontrado",
|
|
246
|
+
noResultsOverlayLabel: "Nenhum resultado encontrado",
|
|
247
|
+
checkboxSelectionHeaderName: "Sele\xE7\xE3o de checkbox",
|
|
248
|
+
checkboxSelectionSelectAllRows: "Selecionar todas as linhas",
|
|
249
|
+
checkboxSelectionUnselectAllRows: "Desmarcar todas as linhas",
|
|
250
|
+
checkboxSelectionSelectRow: "Selecionar linha",
|
|
251
|
+
checkboxSelectionUnselectRow: "Desmarcar linha",
|
|
252
|
+
columnHeaderSortIconLabel: "Ordenar",
|
|
253
|
+
groupingColumnHeaderName: "Grupo",
|
|
254
|
+
groupColumn: (name) => `Agrupar por ${name}`,
|
|
255
|
+
unGroupColumn: (name) => `Parar de agrupar por ${name}`,
|
|
256
|
+
detailPanelToggle: "Alternar painel de detalhes",
|
|
257
|
+
expandDetailPanel: "Expandir",
|
|
258
|
+
collapseDetailPanel: "Recolher",
|
|
259
|
+
treeDataGroupingHeaderName: "Grupo",
|
|
260
|
+
treeDataExpand: "ver filhos",
|
|
261
|
+
treeDataCollapse: "ocultar filhos",
|
|
262
|
+
aggregationMenuItemHeader: "Agrega\xE7\xE3o",
|
|
263
|
+
aggregationFunctionLabelSum: "soma",
|
|
264
|
+
aggregationFunctionLabelAvg: "m\xE9dia",
|
|
265
|
+
aggregationFunctionLabelMin: "m\xEDn",
|
|
266
|
+
aggregationFunctionLabelMax: "m\xE1x",
|
|
267
|
+
aggregationFunctionLabelSize: "tamanho",
|
|
268
|
+
paginationDisplayedRows: ({ from, to, count }) => {
|
|
269
|
+
const total = count === -1 ? "mais de " + to : count;
|
|
270
|
+
return `${from}\u2013${to} de ${total}`;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
var columnPanelSx = {
|
|
274
|
+
padding: 2,
|
|
275
|
+
width: "350px",
|
|
276
|
+
color: "#000000DE"
|
|
277
|
+
};
|
|
278
|
+
var columnMenuSx = {
|
|
279
|
+
"& .MuiListItemText-primary": {
|
|
280
|
+
fontSize: "14px !important"
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
var filterSx = {
|
|
284
|
+
width: "750px",
|
|
285
|
+
"*": { fontSize: "14px !important" },
|
|
286
|
+
"& .MuiDataGrid-filterFormColumnInput": { width: "230px" },
|
|
287
|
+
"& .MuiDataGrid-filterFormOperatorInput": { width: "230px" }
|
|
288
|
+
};
|
|
289
|
+
var paginationSx = {
|
|
290
|
+
"& .MuiTablePagination-root": { fontSize: "12px !important" },
|
|
291
|
+
"& .MuiTablePagination-selectLabel": { fontSize: "12px !important" },
|
|
292
|
+
"& .MuiTablePagination-displayedRows": { fontSize: "12px !important" },
|
|
293
|
+
"& .MuiTablePagination-select": { fontSize: "12px !important" },
|
|
294
|
+
"& .MuiTablePagination-toolbar": {
|
|
295
|
+
minHeight: "40px !important",
|
|
296
|
+
padding: "0 8px !important"
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
var tableSx = {
|
|
300
|
+
fontSize: "13px",
|
|
301
|
+
"& .MuiDataGrid-row:nth-of-type(even)": {
|
|
302
|
+
backgroundColor: "#F9FAFB"
|
|
303
|
+
},
|
|
304
|
+
"& .MuiDataGrid-row:nth-of-type(odd)": {
|
|
305
|
+
backgroundColor: "#FFFFFF"
|
|
306
|
+
},
|
|
307
|
+
"& .MuiDataGrid-row.Mui-selected:nth-of-type(even)": {
|
|
308
|
+
backgroundColor: "#F9FAFB !important"
|
|
309
|
+
},
|
|
310
|
+
"& .MuiDataGrid-row.Mui-selected:nth-of-type(odd)": {
|
|
311
|
+
backgroundColor: "#FFFFFF !important"
|
|
312
|
+
},
|
|
313
|
+
"& .MuiDataGrid-row:hover": { backgroundColor: "#F3F4F6 !important" },
|
|
314
|
+
"& .MuiDataGrid-columnHeaderTitleContainer": {
|
|
315
|
+
color: "#FFFFFF",
|
|
316
|
+
justifyContent: "center",
|
|
317
|
+
"& svg": { color: "#FFFFFF" }
|
|
318
|
+
},
|
|
319
|
+
"& .MuiDataGrid-iconButtonContainer .MuiIconButton-root, & .MuiDataGrid-menuIconButton": {
|
|
320
|
+
color: "#FFFFFF"
|
|
321
|
+
},
|
|
322
|
+
"& .MuiDataGrid-iconButtonContainer .MuiIconButton-root:hover, & .MuiDataGrid-menuIconButton:hover": { backgroundColor: "transparent" },
|
|
323
|
+
"& .MuiDataGrid-iconButtonContainer .MuiIconButton-root.Mui-focusVisible, & .MuiDataGrid-menuIconButton.Mui-focusVisible": { backgroundColor: "transparent" },
|
|
324
|
+
"& .MuiDataGrid-columnHeaders": {
|
|
325
|
+
background: "linear-gradient(to right, #00B2A6 0%, #0AAEB2 100%)"
|
|
326
|
+
},
|
|
327
|
+
"& .MuiDataGrid-columnHeader": {
|
|
328
|
+
color: "#FFFFFF",
|
|
329
|
+
fontWeight: "bold",
|
|
330
|
+
backgroundColor: "transparent",
|
|
331
|
+
"& svg": { color: "#FFFFFF" }
|
|
332
|
+
},
|
|
333
|
+
"& .MuiDataGrid-columnHeader:hover": { backgroundColor: "transparent" },
|
|
334
|
+
"& .MuiDataGrid-columnHeader:hover .MuiIconButton-root": {
|
|
335
|
+
backgroundColor: "transparent"
|
|
336
|
+
},
|
|
337
|
+
"& .MuiDataGrid-columnHeader:focus-within": {
|
|
338
|
+
backgroundColor: "transparent"
|
|
339
|
+
},
|
|
340
|
+
"& .MuiDataGrid-columnHeader--sorted": { backgroundColor: "transparent" },
|
|
341
|
+
"& .MuiDataGrid-columnHeader--sorted .MuiIconButton-root": {
|
|
342
|
+
backgroundColor: "transparent"
|
|
343
|
+
},
|
|
344
|
+
"& .MuiDataGrid-sortIcon": { color: "#FFFFFF" },
|
|
345
|
+
"& .MuiDataGrid-sortIcon:hover": { backgroundColor: "transparent" },
|
|
346
|
+
"& .MuiDataGrid-columnHeaderTitle": { fontWeight: "500", color: "#FFFFFF" }
|
|
347
|
+
};
|
|
348
|
+
var createChange = (item, applyValue) => (index) => ({ target }) => {
|
|
349
|
+
const [start = "", end = ""] = Array.isArray(item.value) ? item.value : [];
|
|
350
|
+
applyValue(__spreadProps(__spreadValues({}, item), {
|
|
351
|
+
value: index === 0 ? [target.value, end] : [start, target.value]
|
|
352
|
+
}));
|
|
353
|
+
};
|
|
354
|
+
var textBetweenOp = {
|
|
355
|
+
label: "entre",
|
|
356
|
+
value: "between",
|
|
357
|
+
getApplyFilterFn: (filter) => {
|
|
358
|
+
if (!filter.value || !Array.isArray(filter.value)) return null;
|
|
359
|
+
const [start, end] = filter.value;
|
|
360
|
+
if (!start || !end) return null;
|
|
361
|
+
return (value) => {
|
|
362
|
+
const cell = (value == null ? void 0 : value.toString()) || "";
|
|
363
|
+
return cell >= start && cell <= end;
|
|
364
|
+
};
|
|
365
|
+
},
|
|
366
|
+
InputComponent: ({ item, applyValue, focusElementRef }) => {
|
|
367
|
+
const onChange = createChange(item, applyValue);
|
|
368
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: [
|
|
369
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
370
|
+
material.TextField,
|
|
371
|
+
{
|
|
372
|
+
size: "small",
|
|
373
|
+
label: "De",
|
|
374
|
+
variant: "outlined",
|
|
375
|
+
inputRef: focusElementRef,
|
|
376
|
+
value: (item.value || ["", ""])[0] || "",
|
|
377
|
+
onChange: onChange(0),
|
|
378
|
+
placeholder: "Inicial"
|
|
379
|
+
}
|
|
380
|
+
),
|
|
381
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
382
|
+
material.TextField,
|
|
383
|
+
{
|
|
384
|
+
size: "small",
|
|
385
|
+
label: "At\xE9",
|
|
386
|
+
variant: "outlined",
|
|
387
|
+
value: (item.value || ["", ""])[1] || "",
|
|
388
|
+
onChange: onChange(1),
|
|
389
|
+
placeholder: "Final"
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
] });
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
var numberBetweenOp = {
|
|
396
|
+
label: "entre",
|
|
397
|
+
value: "between",
|
|
398
|
+
getApplyFilterFn: (filter) => {
|
|
399
|
+
if (!filter.value || !Array.isArray(filter.value)) return null;
|
|
400
|
+
const [start, end] = filter.value;
|
|
401
|
+
if (start === "" || end === "" || start == null || end == null) return null;
|
|
402
|
+
return (value) => {
|
|
403
|
+
const number = Number(value);
|
|
404
|
+
return number >= Number(start) && number <= Number(end);
|
|
405
|
+
};
|
|
406
|
+
},
|
|
407
|
+
InputComponent: ({ item, applyValue, focusElementRef }) => {
|
|
408
|
+
const onChange = createChange(item, applyValue);
|
|
409
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: [
|
|
410
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
411
|
+
material.TextField,
|
|
412
|
+
{
|
|
413
|
+
size: "small",
|
|
414
|
+
label: "De",
|
|
415
|
+
type: "number",
|
|
416
|
+
variant: "outlined",
|
|
417
|
+
inputRef: focusElementRef,
|
|
418
|
+
value: (item.value || ["", ""])[0] || "",
|
|
419
|
+
onChange: onChange(0),
|
|
420
|
+
placeholder: "M\xEDnimo"
|
|
421
|
+
}
|
|
422
|
+
),
|
|
423
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
424
|
+
material.TextField,
|
|
425
|
+
{
|
|
426
|
+
size: "small",
|
|
427
|
+
label: "At\xE9",
|
|
428
|
+
type: "number",
|
|
429
|
+
variant: "outlined",
|
|
430
|
+
value: (item.value || ["", ""])[1] || "",
|
|
431
|
+
onChange: onChange(1),
|
|
432
|
+
placeholder: "M\xE1ximo"
|
|
433
|
+
}
|
|
434
|
+
)
|
|
435
|
+
] });
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
var getTextOps = () => {
|
|
439
|
+
return [...xDataGrid.getGridStringOperators(), textBetweenOp];
|
|
440
|
+
};
|
|
441
|
+
var getNumberOps = () => {
|
|
442
|
+
return [...xDataGrid.getGridNumericOperators(), numberBetweenOp];
|
|
443
|
+
};
|
|
444
|
+
xDataGrid.GRID_STRING_COL_DEF.filterOperators = getTextOps();
|
|
445
|
+
xDataGrid.GRID_NUMERIC_COL_DEF.filterOperators = getNumberOps();
|
|
446
|
+
function CustomColumnsPanel(props) {
|
|
447
|
+
return /* @__PURE__ */ jsxRuntime.jsx(xDataGrid.GridColumnsPanel, __spreadProps(__spreadValues({}, props), { sx: columnPanelSx }));
|
|
448
|
+
}
|
|
449
|
+
function CustomColumnMenu(props) {
|
|
450
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: columnMenuSx, children: /* @__PURE__ */ jsxRuntime.jsx(xDataGrid.GridColumnMenu, __spreadValues({}, props)) });
|
|
451
|
+
}
|
|
452
|
+
function CustomFilterPanel(props) {
|
|
453
|
+
return /* @__PURE__ */ jsxRuntime.jsx(xDataGrid.GridFilterPanel, __spreadProps(__spreadValues({}, props), { sx: filterSx }));
|
|
454
|
+
}
|
|
455
|
+
function CustomNoRowsOverlay() {
|
|
456
|
+
return /* @__PURE__ */ jsxRuntime.jsx(xDataGrid.GridOverlay, { children: /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { mt: 1 }, children: "Nenhum dado encontrado." }) });
|
|
457
|
+
}
|
|
458
|
+
function CustomPagination() {
|
|
459
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: paginationSx, children: /* @__PURE__ */ jsxRuntime.jsx(xDataGrid.GridPagination, {}) });
|
|
460
|
+
}
|
|
461
|
+
var DataTable = (_a) => {
|
|
462
|
+
var rest = __objRest(_a, []);
|
|
463
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { mb: 2, mt: 2, height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
464
|
+
xDataGrid.DataGrid,
|
|
465
|
+
__spreadProps(__spreadValues({
|
|
466
|
+
sx: tableSx
|
|
467
|
+
}, rest), {
|
|
468
|
+
className: "min-h-[210px]!",
|
|
469
|
+
localeText,
|
|
470
|
+
disableRowSelectionOnClick: true,
|
|
471
|
+
slotProps: {
|
|
472
|
+
loadingOverlay: {
|
|
473
|
+
variant: "linear-progress",
|
|
474
|
+
noRowsVariant: "skeleton"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
slots: {
|
|
478
|
+
columnMenu: CustomColumnMenu,
|
|
479
|
+
filterPanel: CustomFilterPanel,
|
|
480
|
+
columnsPanel: CustomColumnsPanel,
|
|
481
|
+
noRowsOverlay: CustomNoRowsOverlay,
|
|
482
|
+
pagination: CustomPagination
|
|
483
|
+
}
|
|
484
|
+
})
|
|
485
|
+
) });
|
|
486
|
+
};
|
|
487
|
+
var data_table_default = DataTable;
|
|
488
|
+
var DEFAULT_TAB_COLOR = "var(--primary-color)";
|
|
489
|
+
var DEFAULT_TAB_FONT_FAMILY = "var(--font-family, inherit)";
|
|
490
|
+
var Tabs = material.styled(material.Tabs, {
|
|
491
|
+
shouldForwardProp: (prop) => prop !== "color"
|
|
492
|
+
})(({ color = DEFAULT_TAB_COLOR }) => ({
|
|
493
|
+
fontFamily: `${DEFAULT_TAB_FONT_FAMILY} !important`,
|
|
494
|
+
"& .MuiTabs-indicator": { backgroundColor: color }
|
|
495
|
+
}));
|
|
496
|
+
var Tab = material.styled(material.Tab, {
|
|
497
|
+
shouldForwardProp: (prop) => prop !== "color" && prop !== "fontFamily"
|
|
498
|
+
})(
|
|
499
|
+
({ color = DEFAULT_TAB_COLOR, fontFamily = DEFAULT_TAB_FONT_FAMILY }) => ({
|
|
500
|
+
fontWeight: "500 !important",
|
|
501
|
+
color: "#000000CC !important",
|
|
502
|
+
fontSize: "14px !important",
|
|
503
|
+
textTransform: "uppercase !important",
|
|
504
|
+
fontFamily: `${fontFamily} !important`,
|
|
505
|
+
"&.Mui-selected": { color: `${color} !important` }
|
|
506
|
+
})
|
|
507
|
+
);
|
|
146
508
|
|
|
147
509
|
exports.Card = card_default;
|
|
510
|
+
exports.DataTable = data_table_default;
|
|
148
511
|
exports.Dialog = dialog_default;
|
|
512
|
+
exports.Tab = Tab;
|
|
513
|
+
exports.Tabs = Tabs;
|
|
149
514
|
//# sourceMappingURL=index.js.map
|
|
150
515
|
//# sourceMappingURL=index.js.map
|