@acvl/frontend-components 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +14 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/v1/datagrids/columns/index.d.ts +2 -2
- package/dist/cjs/types/src/components/v1/datagrids/index.d.ts +2 -2
- package/dist/cjs/types/src/components/v1/datagrids/wrappers/EditGridWrapper.d.ts +3 -1
- package/dist/cjs/types/src/components/v1/layout/shared/index.d.ts +1 -1
- package/dist/cjs/types/src/components/v1/lib/context/index.d.ts +1 -1
- package/dist/esm/index.js +14 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/v1/datagrids/columns/index.d.ts +2 -2
- package/dist/esm/types/src/components/v1/datagrids/index.d.ts +2 -2
- package/dist/esm/types/src/components/v1/datagrids/wrappers/EditGridWrapper.d.ts +3 -1
- package/dist/esm/types/src/components/v1/layout/shared/index.d.ts +1 -1
- package/dist/esm/types/src/components/v1/lib/context/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -26625,10 +26625,12 @@ const SaveCancelButton = (props) => {
|
|
|
26625
26625
|
...props.slotProps?.cancelBtn
|
|
26626
26626
|
} }), jsxRuntime.jsx(NormalOrIcon, { buttonProps: {
|
|
26627
26627
|
color: 'secondary',
|
|
26628
|
+
variant: 'contained',
|
|
26628
26629
|
startIcon: jsxRuntime.jsx(SaveIcon, {}),
|
|
26629
26630
|
type: 'submit',
|
|
26630
26631
|
form: 'formulario',
|
|
26631
26632
|
sx: { height: 1 },
|
|
26633
|
+
children: 'Guardar',
|
|
26632
26634
|
...props.slotProps?.saveBtn
|
|
26633
26635
|
} })] }));
|
|
26634
26636
|
};
|
|
@@ -30566,7 +30568,6 @@ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
|
|
|
30566
30568
|
|
|
30567
30569
|
const EditGridWrapper = (props) => {
|
|
30568
30570
|
const notifications = core.useNotifications();
|
|
30569
|
-
const baseGridRef = React.useRef(null);
|
|
30570
30571
|
// ======================|| EDIT ||====================== //
|
|
30571
30572
|
const [edit, setEdit] = React.useState(false);
|
|
30572
30573
|
const [editMutation, { isLoading: loadingMutation }] = props.mutation();
|
|
@@ -30623,7 +30624,7 @@ const EditGridWrapper = (props) => {
|
|
|
30623
30624
|
};
|
|
30624
30625
|
}, [handleKeyPress]);
|
|
30625
30626
|
// ========================= || DRAG N DROP || ========================= //
|
|
30626
|
-
const rowsIterator = baseGridRef?.current?.
|
|
30627
|
+
const rowsIterator = props.baseGridRef?.current?.getRowModels().values();
|
|
30627
30628
|
const rows = React.useMemo(() => {
|
|
30628
30629
|
return rowsIterator ? Array.from(rowsIterator) : [];
|
|
30629
30630
|
}, [rowsIterator]);
|
|
@@ -30650,7 +30651,7 @@ const EditGridWrapper = (props) => {
|
|
|
30650
30651
|
mutationErrors: errors,
|
|
30651
30652
|
options: props.options,
|
|
30652
30653
|
}),
|
|
30653
|
-
...(edit && props.dnd ? { slots: { row: DraggableRow } } :
|
|
30654
|
+
...(edit && props.dnd ? { slots: { row: DraggableRow } } : {}),
|
|
30654
30655
|
slotProps: {
|
|
30655
30656
|
toolbar: {
|
|
30656
30657
|
extraButtons: [
|
|
@@ -30989,6 +30990,11 @@ const Base = (props) => {
|
|
|
30989
30990
|
const dataGridProps = mergeSettings({
|
|
30990
30991
|
columns: [],
|
|
30991
30992
|
loadingParams: [isLoading, isFetching],
|
|
30993
|
+
slots: {
|
|
30994
|
+
toolbar: CustomToolbar,
|
|
30995
|
+
pagination: CustomPagination,
|
|
30996
|
+
noRowsOverlay: CustomNoRows,
|
|
30997
|
+
},
|
|
30992
30998
|
slotProps: {
|
|
30993
30999
|
baseCheckbox: {
|
|
30994
31000
|
size: 'small'
|
|
@@ -31017,15 +31023,12 @@ const Base = (props) => {
|
|
|
31017
31023
|
},
|
|
31018
31024
|
}, props.dataGridProps);
|
|
31019
31025
|
const renderDataGrid = ({ dataGridProps: renderDataGridProps }) => {
|
|
31026
|
+
// console.log(dataGridProps)
|
|
31020
31027
|
return (jsxRuntime.jsx(material.Box, { width: 1, minHeight: 300, height: 1,
|
|
31021
31028
|
// maxHeight={'calc(100% - 30px)'}
|
|
31022
|
-
display: 'flex', flexDirection: 'column', pb: 0, children: jsxRuntime.jsx(material.NoSsr, { children: jsxRuntime.jsx(xDataGrid.DataGrid, { apiRef: apiRef,
|
|
31029
|
+
display: 'flex', flexDirection: 'column', pb: 0, children: jsxRuntime.jsx(material.NoSsr, { children: jsxRuntime.jsx(xDataGrid.DataGrid, { apiRef: apiRef, rows: data?.results || [], loading: lodash.some(lodash.get(renderDataGridProps, 'loadingParams', []), function (x) {
|
|
31023
31030
|
return x;
|
|
31024
|
-
}),
|
|
31025
|
-
toolbar: CustomToolbar,
|
|
31026
|
-
pagination: CustomPagination,
|
|
31027
|
-
noRowsOverlay: CustomNoRows,
|
|
31028
|
-
},
|
|
31031
|
+
}),
|
|
31029
31032
|
// paginado //
|
|
31030
31033
|
pagination: true, paginationMode: 'server', paginationModel: paginationModel, onPaginationModelChange: setPaginationModel, pageSizeOptions: [50, 100, { value: -1, label: 'Todos' }],
|
|
31031
31034
|
// ordenado
|
|
@@ -31049,7 +31052,7 @@ const Base = (props) => {
|
|
|
31049
31052
|
// row count
|
|
31050
31053
|
rowCount: rowCount,
|
|
31051
31054
|
// settings
|
|
31052
|
-
|
|
31055
|
+
density: 'compact',
|
|
31053
31056
|
// striping
|
|
31054
31057
|
getRowClassName: (params) => params.indexRelativeToCurrentPage % 2 === 0 ? 'even' : 'odd', localeText: {
|
|
31055
31058
|
columnHeaderSortIconLabel: 'Ordenar',
|
|
@@ -31078,6 +31081,7 @@ const Base = (props) => {
|
|
|
31078
31081
|
renderFunction: renderFunction,
|
|
31079
31082
|
renderFunctionProps: renderProps,
|
|
31080
31083
|
dataGridProps: dataGridProps,
|
|
31084
|
+
baseGridRef: apiRef,
|
|
31081
31085
|
...props.api.edit
|
|
31082
31086
|
};
|
|
31083
31087
|
renderFunction = EditGridWrapper;
|