@data-c/pro 0.2.54 → 0.2.56
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 +40 -7
- package/dist/index.js +329 -412
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +369 -452
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/DataTable/index.ts
|
|
2
|
-
import {
|
|
2
|
+
import { useGridApiRef as useGridApiRef2 } from "@mui/x-data-grid-pro";
|
|
3
3
|
|
|
4
4
|
// src/DataTable/DataTable.tsx
|
|
5
|
-
import { useEffect
|
|
5
|
+
import React, { useEffect } from "react";
|
|
6
6
|
import { Circle } from "@mui/icons-material";
|
|
7
7
|
import { LinearProgress, Stack as Stack3 } from "@mui/material";
|
|
8
8
|
import {
|
|
@@ -109,7 +109,9 @@ import {
|
|
|
109
109
|
useContext,
|
|
110
110
|
useState
|
|
111
111
|
} from "react";
|
|
112
|
-
import {
|
|
112
|
+
import {
|
|
113
|
+
useGridApiRef
|
|
114
|
+
} from "@mui/x-data-grid-pro";
|
|
113
115
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
114
116
|
var TableRootContext = createContext({});
|
|
115
117
|
function TableRootProvider({
|
|
@@ -152,209 +154,274 @@ function useTableRootContext() {
|
|
|
152
154
|
|
|
153
155
|
// src/DataTable/DataTable.tsx
|
|
154
156
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
155
|
-
var
|
|
156
|
-
function Table(props) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
157
|
+
var _DataTable = React.forwardRef(
|
|
158
|
+
function Table(props, ref) {
|
|
159
|
+
const {
|
|
160
|
+
error,
|
|
161
|
+
isLoading,
|
|
162
|
+
isFetching,
|
|
163
|
+
data,
|
|
164
|
+
columns,
|
|
165
|
+
onColumnChange,
|
|
166
|
+
onColumnVisibilityModelChange,
|
|
167
|
+
onColumnOrderChange,
|
|
168
|
+
onColumnWidthChange,
|
|
169
|
+
controlledRowsSelectedId,
|
|
170
|
+
onClearRowsSelectedId,
|
|
171
|
+
onRowSelectionChange,
|
|
172
|
+
onCellKeyDown,
|
|
173
|
+
onRowDoubleClick,
|
|
174
|
+
stackProps,
|
|
175
|
+
slots,
|
|
176
|
+
restoreFromState,
|
|
177
|
+
...rest
|
|
178
|
+
} = props;
|
|
179
|
+
const {
|
|
180
|
+
rowsSelectedId,
|
|
181
|
+
setRowsSelectedId,
|
|
182
|
+
clearCallback,
|
|
183
|
+
setClearCallback,
|
|
184
|
+
apiRef
|
|
185
|
+
} = useTableRootContext();
|
|
186
|
+
React.useImperativeHandle(
|
|
187
|
+
ref,
|
|
188
|
+
() => ({
|
|
189
|
+
apiRef: apiRef.current,
|
|
190
|
+
restoreState: (state) => {
|
|
191
|
+
if (!apiRef?.current || !state)
|
|
192
|
+
return;
|
|
193
|
+
const cleanState = Object.entries(state).reduce(
|
|
194
|
+
(acc, [key, value]) => {
|
|
195
|
+
if (value !== null) {
|
|
196
|
+
acc[key] = value;
|
|
197
|
+
}
|
|
198
|
+
return acc;
|
|
199
|
+
},
|
|
200
|
+
{}
|
|
201
|
+
);
|
|
202
|
+
if (Object.keys(cleanState).length > 0) {
|
|
203
|
+
console.log("Restaurando estado da tabela:", cleanState);
|
|
204
|
+
apiRef.current.restoreState(cleanState);
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
exportState: () => {
|
|
208
|
+
return apiRef?.current?.exportState({
|
|
209
|
+
exportOnlyDirtyModels: true
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}),
|
|
213
|
+
[apiRef]
|
|
214
|
+
);
|
|
215
|
+
const columnWidthDebounceRef = React.useRef(null);
|
|
216
|
+
const ignoreWarmupRef = React.useRef(true);
|
|
217
|
+
React.useEffect(() => {
|
|
218
|
+
const timeoutId = window.setTimeout(() => {
|
|
219
|
+
ignoreWarmupRef.current = false;
|
|
220
|
+
}, 100);
|
|
221
|
+
return () => {
|
|
222
|
+
window.clearTimeout(timeoutId);
|
|
223
|
+
if (columnWidthDebounceRef.current) {
|
|
224
|
+
window.clearTimeout(columnWidthDebounceRef.current);
|
|
190
225
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
226
|
+
};
|
|
227
|
+
}, []);
|
|
228
|
+
useEffect(() => {
|
|
229
|
+
if (!apiRef.current)
|
|
230
|
+
return;
|
|
231
|
+
if (!restoreFromState)
|
|
232
|
+
return;
|
|
233
|
+
const cleanState = Object.entries(restoreFromState).reduce(
|
|
234
|
+
(acc, [key, value]) => {
|
|
235
|
+
if (value !== null) {
|
|
236
|
+
acc[key] = value;
|
|
237
|
+
}
|
|
238
|
+
return acc;
|
|
239
|
+
},
|
|
240
|
+
{}
|
|
241
|
+
);
|
|
242
|
+
if (Object.keys(cleanState).length > 0) {
|
|
243
|
+
apiRef.current.restoreState(cleanState);
|
|
244
|
+
}
|
|
245
|
+
}, [apiRef, restoreFromState]);
|
|
246
|
+
const emitColumnChange = React.useCallback(
|
|
247
|
+
(meta) => {
|
|
248
|
+
if (!apiRef.current)
|
|
249
|
+
return;
|
|
250
|
+
const state = apiRef.current.exportState({
|
|
251
|
+
exportOnlyDirtyModels: true
|
|
252
|
+
});
|
|
253
|
+
onColumnChange?.({ state, meta });
|
|
254
|
+
},
|
|
255
|
+
[apiRef, onColumnChange]
|
|
256
|
+
);
|
|
257
|
+
function _onColumnOrderChange(params, event, details) {
|
|
258
|
+
onColumnOrderChange?.(params, event, details);
|
|
259
|
+
emitColumnChange({
|
|
260
|
+
reason: "order"
|
|
198
261
|
});
|
|
199
|
-
};
|
|
200
|
-
}, [columns]);
|
|
201
|
-
useEffect(() => {
|
|
202
|
-
if (controlledRowsSelectedId) {
|
|
203
|
-
setRowsSelectedId(controlledRowsSelectedId);
|
|
204
262
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
});
|
|
212
|
-
setClearCallback(false);
|
|
263
|
+
function _onColumnWidthChange(params, event, details) {
|
|
264
|
+
if (ignoreWarmupRef.current) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
onColumnWidthChange?.(params, event, details);
|
|
268
|
+
emitColumnWidthChangeDebounced();
|
|
213
269
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
event.preventDefault();
|
|
220
|
-
if (onCellKeyDown)
|
|
221
|
-
onCellKeyDown("edit", params.id);
|
|
222
|
-
break;
|
|
223
|
-
case "F3":
|
|
224
|
-
event.preventDefault();
|
|
225
|
-
if (onCellKeyDown)
|
|
226
|
-
onCellKeyDown("edit", params.id);
|
|
227
|
-
break;
|
|
228
|
-
case "Delete":
|
|
229
|
-
event.preventDefault();
|
|
230
|
-
if (onCellKeyDown)
|
|
231
|
-
onCellKeyDown("delete", params.id);
|
|
232
|
-
break;
|
|
233
|
-
case "ctrl+e":
|
|
234
|
-
event.preventDefault();
|
|
235
|
-
const handleExport = (options) => {
|
|
236
|
-
if (apiRef?.current) {
|
|
237
|
-
apiRef.current.exportDataAsCsv(options);
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
handleExport({ getRowsToExport: getFilteredRows });
|
|
241
|
-
break;
|
|
242
|
-
default:
|
|
243
|
-
break;
|
|
270
|
+
function _onColumnVisibilityModelChange(params, details) {
|
|
271
|
+
onColumnVisibilityModelChange?.(params, details);
|
|
272
|
+
emitColumnChange({
|
|
273
|
+
reason: "visibility"
|
|
274
|
+
});
|
|
244
275
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
onRowDoubleClick("edit", params.id);
|
|
249
|
-
}
|
|
250
|
-
return /* @__PURE__ */ jsxs3(Stack3, { height: "100%", minHeight: "500px", position: "relative", ...stackProps, children: [
|
|
251
|
-
!isLoading && isFetching && /* @__PURE__ */ jsx4(
|
|
252
|
-
LinearProgress,
|
|
253
|
-
{
|
|
254
|
-
sx: {
|
|
255
|
-
position: "absolute",
|
|
256
|
-
top: 0,
|
|
257
|
-
right: 0,
|
|
258
|
-
left: 0,
|
|
259
|
-
zIndex: 999,
|
|
260
|
-
height: "3px"
|
|
261
|
-
}
|
|
276
|
+
const emitColumnWidthChangeDebounced = React.useCallback(() => {
|
|
277
|
+
if (columnWidthDebounceRef.current) {
|
|
278
|
+
window.clearTimeout(columnWidthDebounceRef.current);
|
|
262
279
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
280
|
+
columnWidthDebounceRef.current = window.setTimeout(() => {
|
|
281
|
+
emitColumnChange({ reason: "width" });
|
|
282
|
+
}, 250);
|
|
283
|
+
}, [emitColumnChange]);
|
|
284
|
+
useEffect(() => {
|
|
285
|
+
if (controlledRowsSelectedId) {
|
|
286
|
+
setRowsSelectedId(controlledRowsSelectedId);
|
|
287
|
+
}
|
|
288
|
+
}, [controlledRowsSelectedId]);
|
|
289
|
+
useEffect(() => {
|
|
290
|
+
if (clearCallback) {
|
|
291
|
+
onClearRowsSelectedId && onClearRowsSelectedId({
|
|
292
|
+
type: "include",
|
|
293
|
+
ids: /* @__PURE__ */ new Set()
|
|
294
|
+
});
|
|
295
|
+
setClearCallback(false);
|
|
296
|
+
}
|
|
297
|
+
}, [clearCallback]);
|
|
298
|
+
return /* @__PURE__ */ jsxs3(
|
|
299
|
+
Stack3,
|
|
266
300
|
{
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
if (onRowSelectionChange) {
|
|
283
|
-
onRowSelectionChange(rowSelectionModel, details);
|
|
284
|
-
}
|
|
285
|
-
if (controlledRowsSelectedId)
|
|
286
|
-
return;
|
|
287
|
-
setRowsSelectedId(rowSelectionModel);
|
|
288
|
-
},
|
|
289
|
-
slots: {
|
|
290
|
-
booleanCellFalseIcon: () => /* @__PURE__ */ jsx4(Circle, { color: "error", sx: { fontSize: "10pt" } }),
|
|
291
|
-
booleanCellTrueIcon: () => /* @__PURE__ */ jsx4(Circle, { color: "success", sx: { fontSize: "10pt" } }),
|
|
292
|
-
noRowsOverlay: () => !isLoading && !!error ? /* @__PURE__ */ jsx4(DataTableError, { errorMessage: error }) : /* @__PURE__ */ jsx4(DataTableEmptyData, {}),
|
|
293
|
-
...slots
|
|
294
|
-
},
|
|
295
|
-
slotProps: {
|
|
296
|
-
loadingOverlay: {
|
|
297
|
-
variant: "skeleton",
|
|
298
|
-
noRowsVariant: "skeleton"
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
disableColumnFilter: true,
|
|
302
|
-
localeText: ptBR.components.MuiDataGrid.defaultProps.localeText,
|
|
303
|
-
sx: {
|
|
304
|
-
border: "none",
|
|
305
|
-
borderRadius: 0,
|
|
306
|
-
"--DataGrid-rowBorderColor": "#edf2f9",
|
|
307
|
-
"--DataGrid-containerBackground": "#f4f6fa",
|
|
308
|
-
".MuiDataGrid-overlayWrapperInner": {
|
|
309
|
-
display: "flex",
|
|
310
|
-
alignItems: "center",
|
|
311
|
-
justifyContent: "center"
|
|
312
|
-
},
|
|
313
|
-
".MuiDataGrid-row": {
|
|
314
|
-
backgroundColor: "white",
|
|
315
|
-
"&:nth-of-type(even)": {
|
|
316
|
-
backgroundColor: "#f9fafd"
|
|
317
|
-
},
|
|
318
|
-
":hover": {
|
|
319
|
-
backgroundColor: "#e9e9e9"
|
|
320
|
-
},
|
|
321
|
-
"&.Mui-selected": {
|
|
322
|
-
backgroundColor: "rgb(238, 249, 252)",
|
|
323
|
-
"&:hover": {
|
|
324
|
-
backgroundColor: "rgb(222, 243, 249)"
|
|
301
|
+
height: "100%",
|
|
302
|
+
minHeight: "500px",
|
|
303
|
+
position: "relative",
|
|
304
|
+
...stackProps,
|
|
305
|
+
children: [
|
|
306
|
+
!isLoading && isFetching && /* @__PURE__ */ jsx4(
|
|
307
|
+
LinearProgress,
|
|
308
|
+
{
|
|
309
|
+
sx: {
|
|
310
|
+
position: "absolute",
|
|
311
|
+
top: 0,
|
|
312
|
+
right: 0,
|
|
313
|
+
left: 0,
|
|
314
|
+
zIndex: 999,
|
|
315
|
+
height: "3px"
|
|
325
316
|
}
|
|
326
317
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
318
|
+
),
|
|
319
|
+
/* @__PURE__ */ jsx4(
|
|
320
|
+
DataGridPro,
|
|
321
|
+
{
|
|
322
|
+
apiRef,
|
|
323
|
+
rows: data,
|
|
324
|
+
columns,
|
|
325
|
+
onColumnOrderChange: _onColumnOrderChange,
|
|
326
|
+
onColumnWidthChange: _onColumnWidthChange,
|
|
327
|
+
onColumnVisibilityModelChange: _onColumnVisibilityModelChange,
|
|
328
|
+
density: "compact",
|
|
329
|
+
hideFooterPagination: true,
|
|
330
|
+
hideFooter: true,
|
|
331
|
+
loading: isLoading,
|
|
332
|
+
rowHeight: 43,
|
|
333
|
+
columnHeaderHeight: 43,
|
|
334
|
+
disableVirtualization: true,
|
|
335
|
+
disableRowSelectionOnClick: true,
|
|
336
|
+
rowSelectionModel: rowsSelectedId,
|
|
337
|
+
onRowSelectionModelChange: (rowSelectionModel, details) => {
|
|
338
|
+
if (onRowSelectionChange) {
|
|
339
|
+
onRowSelectionChange(rowSelectionModel, details);
|
|
340
|
+
}
|
|
341
|
+
if (controlledRowsSelectedId)
|
|
342
|
+
return;
|
|
343
|
+
setRowsSelectedId(rowSelectionModel);
|
|
344
|
+
},
|
|
345
|
+
slots: {
|
|
346
|
+
booleanCellFalseIcon: () => /* @__PURE__ */ jsx4(Circle, { color: "error", sx: { fontSize: "10pt" } }),
|
|
347
|
+
booleanCellTrueIcon: () => /* @__PURE__ */ jsx4(Circle, { color: "success", sx: { fontSize: "10pt" } }),
|
|
348
|
+
noRowsOverlay: () => !isLoading && !!error ? /* @__PURE__ */ jsx4(DataTableError, { errorMessage: error }) : /* @__PURE__ */ jsx4(DataTableEmptyData, {}),
|
|
349
|
+
...slots
|
|
350
|
+
},
|
|
351
|
+
slotProps: {
|
|
352
|
+
loadingOverlay: {
|
|
353
|
+
variant: "skeleton",
|
|
354
|
+
noRowsVariant: "skeleton"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
disableColumnFilter: true,
|
|
358
|
+
localeText: ptBR.components.MuiDataGrid.defaultProps.localeText,
|
|
359
|
+
sx: {
|
|
360
|
+
border: "none",
|
|
361
|
+
borderRadius: 0,
|
|
362
|
+
"--DataGrid-rowBorderColor": "#edf2f9",
|
|
363
|
+
"--DataGrid-containerBackground": "#f4f6fa",
|
|
364
|
+
".MuiDataGrid-overlayWrapperInner": {
|
|
365
|
+
display: "flex",
|
|
366
|
+
alignItems: "center",
|
|
367
|
+
justifyContent: "center"
|
|
368
|
+
},
|
|
369
|
+
".MuiDataGrid-row": {
|
|
370
|
+
backgroundColor: "white",
|
|
371
|
+
"&:nth-of-type(even)": {
|
|
372
|
+
backgroundColor: "#f9fafd"
|
|
373
|
+
},
|
|
374
|
+
":hover": {
|
|
375
|
+
backgroundColor: "#e9e9e9"
|
|
376
|
+
},
|
|
377
|
+
"&.Mui-selected": {
|
|
378
|
+
backgroundColor: "rgb(238, 249, 252)",
|
|
379
|
+
"&:hover": {
|
|
380
|
+
backgroundColor: "rgb(222, 243, 249)"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
".MuiDataGrid-cell": {
|
|
385
|
+
fontSize: "12px",
|
|
386
|
+
color: "#0b0e14"
|
|
387
|
+
},
|
|
388
|
+
".MuiDataGrid-columnHeaders": {
|
|
389
|
+
border: "solid 1px #edf2f9",
|
|
390
|
+
backgroundColor: "#f4f6fa"
|
|
391
|
+
},
|
|
392
|
+
".MuiDataGrid-columnHeader": {
|
|
393
|
+
backgroundColor: "#f4f6fa"
|
|
394
|
+
},
|
|
395
|
+
".MuiDataGrid-columnHeaders .MuiDataGrid-filler": {
|
|
396
|
+
backgroundColor: "#f4f6fa"
|
|
397
|
+
},
|
|
398
|
+
".MuiDataGrid-columnHeaderTitle": {
|
|
399
|
+
fontSize: "12px",
|
|
400
|
+
color: "#0b0e14",
|
|
401
|
+
fontWeight: "600"
|
|
402
|
+
},
|
|
403
|
+
"& .sticky-cell": {
|
|
404
|
+
position: "sticky",
|
|
405
|
+
right: 0,
|
|
406
|
+
background: "inherit",
|
|
407
|
+
zIndex: 1
|
|
408
|
+
},
|
|
409
|
+
"& .sticky-header": {
|
|
410
|
+
position: "sticky",
|
|
411
|
+
right: 0,
|
|
412
|
+
backgroundColor: "#f4f6fa",
|
|
413
|
+
zIndex: 2
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
...rest
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
]
|
|
354
420
|
}
|
|
355
|
-
)
|
|
356
|
-
|
|
357
|
-
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
var DataTable_default = _DataTable;
|
|
358
425
|
|
|
359
426
|
// src/DataTable/DataTableAction.tsx
|
|
360
427
|
import {
|
|
@@ -376,132 +443,7 @@ function DataTableAction(props) {
|
|
|
376
443
|
import {
|
|
377
444
|
GridActionsCellItem as GridActionsCellItem2
|
|
378
445
|
} from "@mui/x-data-grid-pro";
|
|
379
|
-
|
|
380
|
-
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
381
|
-
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
|
382
|
-
|
|
383
|
-
// ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
384
|
-
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
385
|
-
var toCamelCase = (string) => string.replace(
|
|
386
|
-
/^([A-Z])|[\s-_]+(\w)/g,
|
|
387
|
-
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
388
|
-
);
|
|
389
|
-
var toPascalCase = (string) => {
|
|
390
|
-
const camelCase = toCamelCase(string);
|
|
391
|
-
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
392
|
-
};
|
|
393
|
-
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
394
|
-
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
395
|
-
}).join(" ").trim();
|
|
396
|
-
var hasA11yProp = (props) => {
|
|
397
|
-
for (const prop in props) {
|
|
398
|
-
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
399
|
-
return true;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
// ../../node_modules/lucide-react/dist/esm/Icon.js
|
|
405
|
-
import { forwardRef, createElement } from "react";
|
|
406
|
-
|
|
407
|
-
// ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
408
|
-
var defaultAttributes = {
|
|
409
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
410
|
-
width: 24,
|
|
411
|
-
height: 24,
|
|
412
|
-
viewBox: "0 0 24 24",
|
|
413
|
-
fill: "none",
|
|
414
|
-
stroke: "currentColor",
|
|
415
|
-
strokeWidth: 2,
|
|
416
|
-
strokeLinecap: "round",
|
|
417
|
-
strokeLinejoin: "round"
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
// ../../node_modules/lucide-react/dist/esm/Icon.js
|
|
421
|
-
var Icon = forwardRef(
|
|
422
|
-
({
|
|
423
|
-
color = "currentColor",
|
|
424
|
-
size = 24,
|
|
425
|
-
strokeWidth = 2,
|
|
426
|
-
absoluteStrokeWidth,
|
|
427
|
-
className = "",
|
|
428
|
-
children,
|
|
429
|
-
iconNode,
|
|
430
|
-
...rest
|
|
431
|
-
}, ref) => createElement(
|
|
432
|
-
"svg",
|
|
433
|
-
{
|
|
434
|
-
ref,
|
|
435
|
-
...defaultAttributes,
|
|
436
|
-
width: size,
|
|
437
|
-
height: size,
|
|
438
|
-
stroke: color,
|
|
439
|
-
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
440
|
-
className: mergeClasses("lucide", className),
|
|
441
|
-
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
442
|
-
...rest
|
|
443
|
-
},
|
|
444
|
-
[
|
|
445
|
-
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
446
|
-
...Array.isArray(children) ? children : [children]
|
|
447
|
-
]
|
|
448
|
-
)
|
|
449
|
-
);
|
|
450
|
-
|
|
451
|
-
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
452
|
-
var createLucideIcon = (iconName, iconNode) => {
|
|
453
|
-
const Component = forwardRef2(
|
|
454
|
-
({ className, ...props }, ref) => createElement2(Icon, {
|
|
455
|
-
ref,
|
|
456
|
-
iconNode,
|
|
457
|
-
className: mergeClasses(
|
|
458
|
-
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
459
|
-
`lucide-${iconName}`,
|
|
460
|
-
className
|
|
461
|
-
),
|
|
462
|
-
...props
|
|
463
|
-
})
|
|
464
|
-
);
|
|
465
|
-
Component.displayName = toPascalCase(iconName);
|
|
466
|
-
return Component;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
// ../../node_modules/lucide-react/dist/esm/icons/arrow-big-down.js
|
|
470
|
-
var __iconNode = [
|
|
471
|
-
[
|
|
472
|
-
"path",
|
|
473
|
-
{
|
|
474
|
-
d: "M15 11a1 1 0 0 0 1 1h2.939a1 1 0 0 1 .75 1.811l-6.835 6.836a1.207 1.207 0 0 1-1.707 0L4.31 13.81a1 1 0 0 1 .75-1.811H8a1 1 0 0 0 1-1V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1z",
|
|
475
|
-
key: "1eaqc3"
|
|
476
|
-
}
|
|
477
|
-
]
|
|
478
|
-
];
|
|
479
|
-
var ArrowBigDown = createLucideIcon("arrow-big-down", __iconNode);
|
|
480
|
-
|
|
481
|
-
// ../../node_modules/lucide-react/dist/esm/icons/pencil.js
|
|
482
|
-
var __iconNode2 = [
|
|
483
|
-
[
|
|
484
|
-
"path",
|
|
485
|
-
{
|
|
486
|
-
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
487
|
-
key: "1a8usu"
|
|
488
|
-
}
|
|
489
|
-
],
|
|
490
|
-
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
491
|
-
];
|
|
492
|
-
var Pencil = createLucideIcon("pencil", __iconNode2);
|
|
493
|
-
|
|
494
|
-
// ../../node_modules/lucide-react/dist/esm/icons/trash-2.js
|
|
495
|
-
var __iconNode3 = [
|
|
496
|
-
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
497
|
-
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
498
|
-
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
499
|
-
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
500
|
-
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
501
|
-
];
|
|
502
|
-
var Trash2 = createLucideIcon("trash-2", __iconNode3);
|
|
503
|
-
|
|
504
|
-
// src/DataTable/DataTableActionDelete.tsx
|
|
446
|
+
import { Trash2 } from "lucide-react";
|
|
505
447
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
506
448
|
function DataTableActionDelete(props) {
|
|
507
449
|
const { ref, ...rest } = props;
|
|
@@ -521,6 +463,7 @@ function DataTableActionDelete(props) {
|
|
|
521
463
|
import {
|
|
522
464
|
GridActionsCellItem as GridActionsCellItem3
|
|
523
465
|
} from "@mui/x-data-grid-pro";
|
|
466
|
+
import { Pencil } from "lucide-react";
|
|
524
467
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
525
468
|
function DataTableActionEdit(props) {
|
|
526
469
|
const { ref, ...rest } = props;
|
|
@@ -565,6 +508,7 @@ function Actions({ children, breakpoints }) {
|
|
|
565
508
|
import {
|
|
566
509
|
GridActionsCellItem as GridActionsCellItem4
|
|
567
510
|
} from "@mui/x-data-grid-pro";
|
|
511
|
+
import { ArrowBigDown } from "lucide-react";
|
|
568
512
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
569
513
|
function DataTableActionTransport(props) {
|
|
570
514
|
const { ref, ...rest } = props;
|
|
@@ -580,6 +524,18 @@ function DataTableActionTransport(props) {
|
|
|
580
524
|
);
|
|
581
525
|
}
|
|
582
526
|
|
|
527
|
+
// src/DataTable/DataTableAddPanelTrigger.tsx
|
|
528
|
+
import { useTheme as useTheme2 } from "@mui/material";
|
|
529
|
+
import { ToolbarButton } from "@mui/x-data-grid-pro";
|
|
530
|
+
import { SquarePlus } from "lucide-react";
|
|
531
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
532
|
+
function DataTableAddPanelTrigger({
|
|
533
|
+
onClick
|
|
534
|
+
}) {
|
|
535
|
+
const theme = useTheme2();
|
|
536
|
+
return /* @__PURE__ */ jsx10(ToolbarButton, { onClick, children: /* @__PURE__ */ jsx10(SquarePlus, { color: theme.palette.primary.main, size: 18 }) });
|
|
537
|
+
}
|
|
538
|
+
|
|
583
539
|
// src/DataTable/DataTableButton.tsx
|
|
584
540
|
import {
|
|
585
541
|
Button as MuiButton,
|
|
@@ -588,11 +544,11 @@ import {
|
|
|
588
544
|
Tooltip,
|
|
589
545
|
Box
|
|
590
546
|
} from "@mui/material";
|
|
591
|
-
import { Fragment, jsx as
|
|
547
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
592
548
|
function DataTableButton(props) {
|
|
593
549
|
const { isLoading, startIcon, children, title, ...rest } = props;
|
|
594
550
|
const { breakpoint } = useTableRootContext();
|
|
595
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ jsx11(Fragment, { children: breakpoint ? /* @__PURE__ */ jsx11(Tooltip, { title: children, children: /* @__PURE__ */ jsxs4(
|
|
596
552
|
IconButton,
|
|
597
553
|
{
|
|
598
554
|
...rest,
|
|
@@ -600,7 +556,7 @@ function DataTableButton(props) {
|
|
|
600
556
|
disabled: isLoading ? true : rest.disabled,
|
|
601
557
|
children: [
|
|
602
558
|
startIcon,
|
|
603
|
-
isLoading && /* @__PURE__ */
|
|
559
|
+
isLoading && /* @__PURE__ */ jsx11(
|
|
604
560
|
CircularProgress,
|
|
605
561
|
{
|
|
606
562
|
color: "secondary",
|
|
@@ -617,7 +573,7 @@ function DataTableButton(props) {
|
|
|
617
573
|
)
|
|
618
574
|
]
|
|
619
575
|
}
|
|
620
|
-
) }) : /* @__PURE__ */
|
|
576
|
+
) }) : /* @__PURE__ */ jsx11(
|
|
621
577
|
MuiButton,
|
|
622
578
|
{
|
|
623
579
|
startIcon,
|
|
@@ -648,7 +604,7 @@ function DataTableButton(props) {
|
|
|
648
604
|
textOverflow: "ellipsis"
|
|
649
605
|
},
|
|
650
606
|
children: [
|
|
651
|
-
isLoading && /* @__PURE__ */
|
|
607
|
+
isLoading && /* @__PURE__ */ jsx11(
|
|
652
608
|
CircularProgress,
|
|
653
609
|
{
|
|
654
610
|
color: "secondary",
|
|
@@ -671,16 +627,16 @@ function DataTableButton(props) {
|
|
|
671
627
|
|
|
672
628
|
// src/DataTable/DataTableCellAction.tsx
|
|
673
629
|
import { GridActionsCellItem as GridActionsCellItem5 } from "@mui/x-data-grid-pro";
|
|
674
|
-
import { jsx as
|
|
630
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
675
631
|
function CellAction(props) {
|
|
676
632
|
const { event, onClick, ...rest } = props;
|
|
677
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ jsx12(
|
|
678
634
|
GridActionsCellItem5,
|
|
679
635
|
{
|
|
680
636
|
label: "A\xE7\xE3o",
|
|
681
637
|
onClick: () => {
|
|
682
638
|
},
|
|
683
|
-
icon: /* @__PURE__ */
|
|
639
|
+
icon: /* @__PURE__ */ jsx12("span", { children: "\u{1F527}" })
|
|
684
640
|
}
|
|
685
641
|
);
|
|
686
642
|
}
|
|
@@ -688,15 +644,15 @@ function CellAction(props) {
|
|
|
688
644
|
// src/DataTable/DataTableCellActionDelete.tsx
|
|
689
645
|
import { Delete as DeleteIcon } from "@mui/icons-material";
|
|
690
646
|
import { GridActionsCellItem as GridActionsCellItem6 } from "@mui/x-data-grid-pro";
|
|
691
|
-
import { jsx as
|
|
647
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
692
648
|
function CellActionDelete({
|
|
693
649
|
onClick,
|
|
694
650
|
...rest
|
|
695
651
|
}) {
|
|
696
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ jsx13(
|
|
697
653
|
GridActionsCellItem6,
|
|
698
654
|
{
|
|
699
|
-
icon: /* @__PURE__ */
|
|
655
|
+
icon: /* @__PURE__ */ jsx13(DeleteIcon, {}),
|
|
700
656
|
label: "Delete",
|
|
701
657
|
color: "primary",
|
|
702
658
|
onClick: () => {
|
|
@@ -711,15 +667,15 @@ function CellActionDelete({
|
|
|
711
667
|
// src/DataTable/DataTableCellActionEdit.tsx
|
|
712
668
|
import { Edit as EditIcon } from "@mui/icons-material";
|
|
713
669
|
import { GridActionsCellItem as GridActionsCellItem7 } from "@mui/x-data-grid-pro";
|
|
714
|
-
import { jsx as
|
|
670
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
715
671
|
function CellActionEdit({
|
|
716
672
|
onClick,
|
|
717
673
|
...rest
|
|
718
674
|
}) {
|
|
719
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsx14(
|
|
720
676
|
GridActionsCellItem7,
|
|
721
677
|
{
|
|
722
|
-
icon: /* @__PURE__ */
|
|
678
|
+
icon: /* @__PURE__ */ jsx14(EditIcon, {}),
|
|
723
679
|
label: "Edit",
|
|
724
680
|
color: "primary",
|
|
725
681
|
onClick: () => onClick && onClick("edit"),
|
|
@@ -730,10 +686,10 @@ function CellActionEdit({
|
|
|
730
686
|
|
|
731
687
|
// src/DataTable/DataTableCellActions.tsx
|
|
732
688
|
import { Children, cloneElement, isValidElement } from "react";
|
|
733
|
-
import { Fragment as Fragment2, jsx as
|
|
689
|
+
import { Fragment as Fragment2, jsx as jsx15 } from "react/jsx-runtime";
|
|
734
690
|
function CellActions(props) {
|
|
735
691
|
const { children, onClick: onItemClick } = props;
|
|
736
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ jsx15(Fragment2, { children: Children.map(children, (child) => {
|
|
737
693
|
if (isValidElement(child)) {
|
|
738
694
|
return cloneElement(child, {
|
|
739
695
|
onClick: onItemClick
|
|
@@ -745,15 +701,15 @@ function CellActions(props) {
|
|
|
745
701
|
// src/DataTable/DataTableCellActionTransport.tsx
|
|
746
702
|
import { GetApp as TransportIcon } from "@mui/icons-material";
|
|
747
703
|
import { GridActionsCellItem as GridActionsCellItem8 } from "@mui/x-data-grid-pro";
|
|
748
|
-
import { jsx as
|
|
704
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
749
705
|
function CellActionTransport({
|
|
750
706
|
onClick,
|
|
751
707
|
...rest
|
|
752
708
|
}) {
|
|
753
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsx16(
|
|
754
710
|
GridActionsCellItem8,
|
|
755
711
|
{
|
|
756
|
-
icon: /* @__PURE__ */
|
|
712
|
+
icon: /* @__PURE__ */ jsx16(TransportIcon, {}),
|
|
757
713
|
label: "Transport",
|
|
758
714
|
color: "primary",
|
|
759
715
|
onClick: () => onClick && onClick("transport"),
|
|
@@ -762,11 +718,21 @@ function CellActionTransport({
|
|
|
762
718
|
);
|
|
763
719
|
}
|
|
764
720
|
|
|
721
|
+
// src/DataTable/DataTableColumnsPanelTrigger.tsx
|
|
722
|
+
import { useTheme as useTheme3 } from "@mui/material";
|
|
723
|
+
import { ColumnsPanelTrigger, ToolbarButton as ToolbarButton2 } from "@mui/x-data-grid-pro";
|
|
724
|
+
import { Columns3Cog } from "lucide-react";
|
|
725
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
726
|
+
function DataTableColumnsPanelTrigger() {
|
|
727
|
+
const theme = useTheme3();
|
|
728
|
+
return /* @__PURE__ */ jsx17(ColumnsPanelTrigger, { render: /* @__PURE__ */ jsx17(ToolbarButton2, {}), children: /* @__PURE__ */ jsx17(Columns3Cog, { color: theme.palette.primary.main, size: 18 }) });
|
|
729
|
+
}
|
|
730
|
+
|
|
765
731
|
// src/DataTable/DataTableContent.tsx
|
|
766
732
|
import { Stack as Stack5 } from "@mui/material";
|
|
767
|
-
import { jsx as
|
|
733
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
768
734
|
function Content(props) {
|
|
769
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ jsx18(
|
|
770
736
|
Stack5,
|
|
771
737
|
{
|
|
772
738
|
direction: "row",
|
|
@@ -785,8 +751,8 @@ import { FileDownload as FileDownloadIcon } from "@mui/icons-material";
|
|
|
785
751
|
import {
|
|
786
752
|
gridFilteredSortedRowIdsSelector as gridFilteredSortedRowIdsSelector2
|
|
787
753
|
} from "@mui/x-data-grid-pro";
|
|
788
|
-
import { jsx as
|
|
789
|
-
var
|
|
754
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
755
|
+
var getFilteredRows = ({ apiRef }) => gridFilteredSortedRowIdsSelector2(apiRef);
|
|
790
756
|
function ExportCsvButton() {
|
|
791
757
|
const { apiRef } = useTableRootContext();
|
|
792
758
|
const handleExport = (options) => {
|
|
@@ -794,11 +760,11 @@ function ExportCsvButton() {
|
|
|
794
760
|
apiRef.current.exportDataAsCsv(options);
|
|
795
761
|
}
|
|
796
762
|
};
|
|
797
|
-
return /* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ jsx19(
|
|
798
764
|
DataTableButton,
|
|
799
765
|
{
|
|
800
|
-
startIcon: /* @__PURE__ */
|
|
801
|
-
onClick: () => handleExport({ getRowsToExport:
|
|
766
|
+
startIcon: /* @__PURE__ */ jsx19(FileDownloadIcon, {}),
|
|
767
|
+
onClick: () => handleExport({ getRowsToExport: getFilteredRows }),
|
|
802
768
|
children: "Exportar CSV"
|
|
803
769
|
}
|
|
804
770
|
);
|
|
@@ -806,9 +772,9 @@ function ExportCsvButton() {
|
|
|
806
772
|
|
|
807
773
|
// src/DataTable/DataTableFooter.tsx
|
|
808
774
|
import { TableFooter } from "@mui/material";
|
|
809
|
-
import { jsx as
|
|
775
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
810
776
|
function Footer(props) {
|
|
811
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ jsx20(
|
|
812
778
|
TableFooter,
|
|
813
779
|
{
|
|
814
780
|
...props,
|
|
@@ -838,8 +804,8 @@ import {
|
|
|
838
804
|
TextField,
|
|
839
805
|
Typography as Typography3
|
|
840
806
|
} from "@mui/material";
|
|
841
|
-
import { useMemo
|
|
842
|
-
import { jsx as
|
|
807
|
+
import { useMemo } from "react";
|
|
808
|
+
import { jsx as jsx21, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
843
809
|
function Pagination(props) {
|
|
844
810
|
const {
|
|
845
811
|
onChangePageSize,
|
|
@@ -848,14 +814,14 @@ function Pagination(props) {
|
|
|
848
814
|
rowsPerPageOptions = [15, 50, 100, 200]
|
|
849
815
|
} = props;
|
|
850
816
|
const { page, pageSize = 15, totalRecords } = pagination || {};
|
|
851
|
-
const pages =
|
|
817
|
+
const pages = useMemo(() => {
|
|
852
818
|
if (pagination?.lastPage)
|
|
853
819
|
return pagination.lastPage;
|
|
854
820
|
if ((totalRecords || 0) < pageSize)
|
|
855
821
|
return 1;
|
|
856
822
|
return Math.max(Math.ceil((totalRecords || 0) / pageSize));
|
|
857
823
|
}, [totalRecords, pageSize]);
|
|
858
|
-
const totalRecordsLabel =
|
|
824
|
+
const totalRecordsLabel = useMemo(() => {
|
|
859
825
|
if ((totalRecords || 0) < pageSize)
|
|
860
826
|
return `Exibindo ${pluralizar(
|
|
861
827
|
totalRecords || 0,
|
|
@@ -885,7 +851,7 @@ function Pagination(props) {
|
|
|
885
851
|
gap: 2,
|
|
886
852
|
marginLeft: "auto",
|
|
887
853
|
children: [
|
|
888
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ jsx21(
|
|
889
855
|
Typography3,
|
|
890
856
|
{
|
|
891
857
|
variant: "body2",
|
|
@@ -896,7 +862,7 @@ function Pagination(props) {
|
|
|
896
862
|
}
|
|
897
863
|
),
|
|
898
864
|
showPagination && /* @__PURE__ */ jsxs5(Stack6, { direction: "row", alignItems: "center", gap: 2, marginLeft: "auto", children: [
|
|
899
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ jsx21(
|
|
900
866
|
TextField,
|
|
901
867
|
{
|
|
902
868
|
sx: {
|
|
@@ -911,10 +877,10 @@ function Pagination(props) {
|
|
|
911
877
|
onChangePageSize(parseInt(e.target.value));
|
|
912
878
|
}
|
|
913
879
|
},
|
|
914
|
-
children: rowsPerPageOptions.map((option) => /* @__PURE__ */
|
|
880
|
+
children: rowsPerPageOptions.map((option) => /* @__PURE__ */ jsx21(MenuItem, { value: option, children: option }, option))
|
|
915
881
|
}
|
|
916
882
|
),
|
|
917
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ jsx21(
|
|
918
884
|
MuiPagination,
|
|
919
885
|
{
|
|
920
886
|
variant: "outlined",
|
|
@@ -939,7 +905,7 @@ function Pagination(props) {
|
|
|
939
905
|
// src/DataTable/DataTableRoot.tsx
|
|
940
906
|
import { useEffect as useEffect3, useRef, useState as useState2 } from "react";
|
|
941
907
|
import { Stack as Stack7 } from "@mui/material";
|
|
942
|
-
import { jsx as
|
|
908
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
943
909
|
function Root({ children, height, ...rest }) {
|
|
944
910
|
const tableContainerRef = useRef(null);
|
|
945
911
|
const [tableHeight, setTableHeight] = useState2(500);
|
|
@@ -957,7 +923,7 @@ function Root({ children, height, ...rest }) {
|
|
|
957
923
|
window.removeEventListener("resize", calculateHeight);
|
|
958
924
|
};
|
|
959
925
|
}, []);
|
|
960
|
-
return /* @__PURE__ */
|
|
926
|
+
return /* @__PURE__ */ jsx22(
|
|
961
927
|
Stack7,
|
|
962
928
|
{
|
|
963
929
|
ref: tableContainerRef,
|
|
@@ -969,20 +935,20 @@ function Root({ children, height, ...rest }) {
|
|
|
969
935
|
...rest.sx
|
|
970
936
|
},
|
|
971
937
|
...rest,
|
|
972
|
-
children: /* @__PURE__ */
|
|
938
|
+
children: /* @__PURE__ */ jsx22(TableRootProvider, { children })
|
|
973
939
|
}
|
|
974
940
|
);
|
|
975
941
|
}
|
|
976
942
|
|
|
977
943
|
// src/DataTable/DataTableSelectionCounter.tsx
|
|
978
944
|
import { Stack as Stack8, Typography as Typography4 } from "@mui/material";
|
|
979
|
-
import { useMemo as
|
|
980
|
-
import { jsx as
|
|
945
|
+
import { useMemo as useMemo2 } from "react";
|
|
946
|
+
import { jsx as jsx23, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
981
947
|
function SelectionCounter(props) {
|
|
982
948
|
const { countTitle, gender } = props;
|
|
983
949
|
const { rowsSelectedId } = useTableRootContext();
|
|
984
950
|
const countQuantidade = rowsSelectedId?.ids.size || 0;
|
|
985
|
-
const flexSufixCountTitle =
|
|
951
|
+
const flexSufixCountTitle = useMemo2(() => {
|
|
986
952
|
if (!countTitle)
|
|
987
953
|
return "";
|
|
988
954
|
const selecionadoText = gender === "feminino" ? "selecionada" : "selecionado";
|
|
@@ -990,7 +956,7 @@ function SelectionCounter(props) {
|
|
|
990
956
|
const nenhumText = gender === "feminino" ? "Nenhuma" : "Nenhum";
|
|
991
957
|
return countQuantidade === 1 ? `${countTitle} ${selecionadoText}` : countQuantidade && countQuantidade > 1 ? `${countTitle.split(" ").map((item) => `${item}s`).join(" ")} ${selecionadosText}` : `${nenhumText} ${countTitle} ${selecionadoText}`;
|
|
992
958
|
}, [countQuantidade]);
|
|
993
|
-
return /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ jsx23(Stack8, { children: /* @__PURE__ */ jsxs6(
|
|
994
960
|
Typography4,
|
|
995
961
|
{
|
|
996
962
|
variant: "body2",
|
|
@@ -1007,15 +973,15 @@ function SelectionCounter(props) {
|
|
|
1007
973
|
}
|
|
1008
974
|
|
|
1009
975
|
// src/DataTable/DataTableTitle.tsx
|
|
1010
|
-
import { Typography as Typography5, useTheme as
|
|
1011
|
-
import { jsx as
|
|
976
|
+
import { Typography as Typography5, useTheme as useTheme4 } from "@mui/material";
|
|
977
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1012
978
|
function Title({
|
|
1013
979
|
children,
|
|
1014
980
|
titleDivider = false,
|
|
1015
981
|
sx
|
|
1016
982
|
}) {
|
|
1017
|
-
const theme =
|
|
1018
|
-
return /* @__PURE__ */
|
|
983
|
+
const theme = useTheme4();
|
|
984
|
+
return /* @__PURE__ */ jsx24(
|
|
1019
985
|
Typography5,
|
|
1020
986
|
{
|
|
1021
987
|
variant: "h6",
|
|
@@ -1032,25 +998,40 @@ function Title({
|
|
|
1032
998
|
|
|
1033
999
|
// src/DataTable/DataTableToolbar.tsx
|
|
1034
1000
|
import { Paper, Stack as Stack9 } from "@mui/material";
|
|
1035
|
-
import {
|
|
1001
|
+
import { Toolbar as MuiToolbar } from "@mui/x-data-grid-pro";
|
|
1002
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1036
1003
|
function Toolbar({ children }) {
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
|
|
1004
|
+
return /* @__PURE__ */ jsx25(
|
|
1005
|
+
MuiToolbar,
|
|
1039
1006
|
{
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1007
|
+
render: /* @__PURE__ */ jsx25(
|
|
1008
|
+
Stack9,
|
|
1009
|
+
{
|
|
1010
|
+
component: Paper,
|
|
1011
|
+
elevation: 0,
|
|
1012
|
+
gap: 1.5,
|
|
1013
|
+
flexDirection: "row",
|
|
1014
|
+
justifyContent: "space-between",
|
|
1015
|
+
alignItems: "center",
|
|
1016
|
+
p: 1,
|
|
1017
|
+
borderRadius: "8px 8px 0 0",
|
|
1018
|
+
sx: { width: "100%" },
|
|
1019
|
+
children
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1050
1022
|
}
|
|
1051
1023
|
);
|
|
1052
1024
|
}
|
|
1053
1025
|
|
|
1026
|
+
// src/DataTable/DataTableToolbarActionsContainer.tsx
|
|
1027
|
+
import { Stack as Stack10 } from "@mui/material";
|
|
1028
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1029
|
+
function ToolbarActionsContainer({
|
|
1030
|
+
children
|
|
1031
|
+
}) {
|
|
1032
|
+
return /* @__PURE__ */ jsx26(Stack10, { direction: "row", alignItems: "center", justifyContent: "flex-end", children });
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1054
1035
|
// src/DataTable/index.ts
|
|
1055
1036
|
var DataTable = {
|
|
1056
1037
|
CellActionTransport,
|
|
@@ -1063,87 +1044,23 @@ var DataTable = {
|
|
|
1063
1044
|
Pagination,
|
|
1064
1045
|
Actions,
|
|
1065
1046
|
Toolbar,
|
|
1047
|
+
ToolbarActionsContainer,
|
|
1066
1048
|
Content,
|
|
1067
1049
|
Button: DataTableButton,
|
|
1068
1050
|
Footer,
|
|
1069
|
-
Table,
|
|
1051
|
+
Table: DataTable_default,
|
|
1070
1052
|
Title,
|
|
1071
1053
|
Root,
|
|
1072
1054
|
Action: DataTableAction,
|
|
1073
1055
|
ActionEdit: DataTableActionEdit,
|
|
1074
1056
|
ActionDelete: DataTableActionDelete,
|
|
1075
1057
|
ActionTransport: DataTableActionTransport,
|
|
1076
|
-
ColumnsPanelTrigger,
|
|
1058
|
+
ColumnsPanelTrigger: DataTableColumnsPanelTrigger,
|
|
1059
|
+
AddPanelTrigger: DataTableAddPanelTrigger,
|
|
1077
1060
|
useGridApiRef: useGridApiRef2
|
|
1078
1061
|
};
|
|
1079
|
-
var
|
|
1062
|
+
var DataTable_default2 = DataTable;
|
|
1080
1063
|
export {
|
|
1081
|
-
|
|
1064
|
+
DataTable_default2 as DataTable
|
|
1082
1065
|
};
|
|
1083
|
-
/*! Bundled license information:
|
|
1084
|
-
|
|
1085
|
-
lucide-react/dist/esm/shared/src/utils.js:
|
|
1086
|
-
(**
|
|
1087
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1088
|
-
*
|
|
1089
|
-
* This source code is licensed under the ISC license.
|
|
1090
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1091
|
-
*)
|
|
1092
|
-
|
|
1093
|
-
lucide-react/dist/esm/defaultAttributes.js:
|
|
1094
|
-
(**
|
|
1095
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1096
|
-
*
|
|
1097
|
-
* This source code is licensed under the ISC license.
|
|
1098
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1099
|
-
*)
|
|
1100
|
-
|
|
1101
|
-
lucide-react/dist/esm/Icon.js:
|
|
1102
|
-
(**
|
|
1103
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1104
|
-
*
|
|
1105
|
-
* This source code is licensed under the ISC license.
|
|
1106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1107
|
-
*)
|
|
1108
|
-
|
|
1109
|
-
lucide-react/dist/esm/createLucideIcon.js:
|
|
1110
|
-
(**
|
|
1111
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1112
|
-
*
|
|
1113
|
-
* This source code is licensed under the ISC license.
|
|
1114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1115
|
-
*)
|
|
1116
|
-
|
|
1117
|
-
lucide-react/dist/esm/icons/arrow-big-down.js:
|
|
1118
|
-
(**
|
|
1119
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1120
|
-
*
|
|
1121
|
-
* This source code is licensed under the ISC license.
|
|
1122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1123
|
-
*)
|
|
1124
|
-
|
|
1125
|
-
lucide-react/dist/esm/icons/pencil.js:
|
|
1126
|
-
(**
|
|
1127
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1128
|
-
*
|
|
1129
|
-
* This source code is licensed under the ISC license.
|
|
1130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1131
|
-
*)
|
|
1132
|
-
|
|
1133
|
-
lucide-react/dist/esm/icons/trash-2.js:
|
|
1134
|
-
(**
|
|
1135
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1136
|
-
*
|
|
1137
|
-
* This source code is licensed under the ISC license.
|
|
1138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1139
|
-
*)
|
|
1140
|
-
|
|
1141
|
-
lucide-react/dist/esm/lucide-react.js:
|
|
1142
|
-
(**
|
|
1143
|
-
* @license lucide-react v0.536.0 - ISC
|
|
1144
|
-
*
|
|
1145
|
-
* This source code is licensed under the ISC license.
|
|
1146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1147
|
-
*)
|
|
1148
|
-
*/
|
|
1149
1066
|
//# sourceMappingURL=index.mjs.map
|