@m4l/components 9.2.62 → 9.2.63-JT15072025.beta.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/components/DataGrid/Datagrid.styles.js +109 -18
- package/components/DataGrid/formatters/ColumnBooleanFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js +2 -3
- package/components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.js +5 -4
- package/components/DataGrid/formatters/ColumnChipStatusFormatter/useColumnChipStatus.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js +11 -4
- package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/useColumnConcatenatedValues.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnDateFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnDateFormatter/formatter.js +13 -4
- package/components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +3 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +7 -43
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.d.ts +8 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.js +58 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.d.ts +7 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.js +19 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/types.d.ts +10 -3
- package/components/DataGrid/formatters/ColumnIconFormatter/useColumnIcon.d.ts +2 -2
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/types.d.ts +2 -2
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.js +4 -3
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnPointsFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnPointsFormatter/formatter.js +13 -5
- package/components/DataGrid/formatters/ColumnPointsFormatter/useColumnPoints.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnPriceFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnPriceFormatter/formatter.js +11 -4
- package/components/DataGrid/formatters/ColumnPriceFormatter/useColumnPrice.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.d.ts +2 -2
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +1 -1
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/useColumnSetCheck.d.ts +1 -1
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.js +15 -6
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/useColumnUncertainty.d.ts +1 -1
- package/components/DataGrid/index.d.ts +1 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +3 -0
- package/components/DataGrid/slots/DataGridEnum.js +6 -1
- package/components/DataGrid/slots/DataGridSlot.d.ts +6 -0
- package/components/DataGrid/slots/DataGridSlot.js +24 -19
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Density/index.js +2 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +5 -6
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +2 -2
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.d.ts +2 -2
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +17 -7
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +9 -7
- package/components/DataGrid/subcomponents/Table/index.d.ts +3 -1
- package/components/DataGrid/subcomponents/Table/index.js +39 -10
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.d.ts +2 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +2 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +24 -10
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +2 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +7 -7
- package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +3 -3
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/types.d.ts +8 -6
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +0 -2
- package/components/ObjectLogs/ObjectLogs.styles.js +2 -1
- package/components/ObjectLogs/slots/ObjectLogsEnum.d.ts +1 -0
- package/components/ObjectLogs/slots/ObjectLogsEnum.js +1 -0
- package/components/ObjectLogs/slots/ObjectLogsSlots.d.ts +3 -0
- package/components/ObjectLogs/slots/ObjectLogsSlots.js +7 -2
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/formatters/BooleanFormatter/BooleanFormatter.js +7 -4
- package/components/formatters/BooleanFormatter/BooleanFormatter.styles.js +9 -1
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterEnum.d.ts +2 -1
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterEnum.js +1 -0
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.d.ts +3 -0
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.js +6 -1
- package/components/formatters/BooleanFormatter/types.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +0 -5
- package/components/mui_extended/MenuItem/MenuItem.js +2 -1
- package/components/mui_extended/MenuItem/types.d.ts +4 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +1 -1
- package/package.json +2 -2
- package/storybook/components/DataGrid/DataGrid.stories.d.ts +8 -0
- package/storybook/components/DataGrid/helpers/icons.d.ts +6 -0
- package/storybook/components/DataGrid/helpers/types.d.ts +14 -2
- package/storybook/components/DataGrid/helpers/useColumns.d.ts +2 -1
- package/storybook/components/DataGrid/helpers/useSeed.d.ts +1 -1
- package/helpers/getFieldValueWithRow.js +0 -10
|
@@ -4,7 +4,7 @@ import { ColumnNestedValueFormatterProps } from './types';
|
|
|
4
4
|
* of the column for ColumnNestedValueFormatter.
|
|
5
5
|
*/
|
|
6
6
|
export declare const useColumnNestedValue: <TRow>(props: ColumnNestedValueFormatterProps<TRow>) => {
|
|
7
|
-
formatter: (
|
|
7
|
+
formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
customFilter: (row: TRow, value: string) => any;
|
|
9
9
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
10
10
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ColumnPointsFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
3
|
/**
|
|
3
4
|
* Formatter for column points in DataGrid
|
|
4
5
|
*/
|
|
5
|
-
export declare function ColumnPointsFormatter<TRow>(props: ColumnPointsFormatterProps<TRow>): (
|
|
6
|
+
export declare function ColumnPointsFormatter<TRow>(props: ColumnPointsFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { P as PointsFormatter } from "../../../formatters/PointsFormatter/PointsFormatter.js";
|
|
4
|
-
import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
|
|
5
4
|
function ColumnPointsFormatter(props) {
|
|
6
5
|
const { Component = React.Fragment } = props;
|
|
7
|
-
const fieldValue =
|
|
8
|
-
const fieldUnit =
|
|
9
|
-
return (
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
+
const fieldValue = props.fieldValue;
|
|
7
|
+
const fieldUnit = props.fieldUnit;
|
|
8
|
+
return (formatterProps) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
PointsFormatter,
|
|
11
|
+
{
|
|
12
|
+
obProps: formatterProps.row,
|
|
13
|
+
...props,
|
|
14
|
+
fieldValue,
|
|
15
|
+
fieldUnit,
|
|
16
|
+
Component
|
|
17
|
+
}
|
|
18
|
+
);
|
|
11
19
|
};
|
|
12
20
|
}
|
|
13
21
|
export {
|
|
@@ -4,7 +4,7 @@ import { ColumnPointsFormatterProps } from './types';
|
|
|
4
4
|
* return formatter, customFilter and customSort.
|
|
5
5
|
*/
|
|
6
6
|
export declare const useColumnPoints: <TRow>(props: ColumnPointsFormatterProps<TRow>) => {
|
|
7
|
-
formatter: (
|
|
7
|
+
formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
customFilter: (row: TRow, value: string) => boolean;
|
|
9
9
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
10
10
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ColumnPriceFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
3
|
/**
|
|
3
4
|
* Formatter for column price in DataGrid
|
|
4
5
|
*/
|
|
5
|
-
export declare function ColumnPriceFormatter<TRow>(props: ColumnPriceFormatterProps<TRow>): (
|
|
6
|
+
export declare function ColumnPriceFormatter<TRow>(props: ColumnPriceFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { P as PriceFormatter } from "../../../formatters/PriceFormatter/PriceFormatter.js";
|
|
4
|
-
import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
|
|
5
4
|
function ColumnPriceFormatter(props) {
|
|
6
5
|
const { Component = React.Fragment } = props;
|
|
7
|
-
const fieldValue =
|
|
8
|
-
return (
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
+
const fieldValue = props.fieldValue;
|
|
7
|
+
return (formatterProps) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
PriceFormatter,
|
|
10
|
+
{
|
|
11
|
+
obProps: formatterProps.row,
|
|
12
|
+
...props,
|
|
13
|
+
fieldValue,
|
|
14
|
+
Component
|
|
15
|
+
}
|
|
16
|
+
);
|
|
10
17
|
};
|
|
11
18
|
}
|
|
12
19
|
export {
|
|
@@ -4,7 +4,7 @@ import { ColumnPriceFormatterProps } from './types';
|
|
|
4
4
|
* Returns formatter, customFilter and customSort.
|
|
5
5
|
*/
|
|
6
6
|
export declare const useColumnPrice: <TRow>(props: ColumnPriceFormatterProps<TRow>) => {
|
|
7
|
-
formatter: (
|
|
7
|
+
formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
customFilter: (row: TRow, value: string) => boolean;
|
|
9
9
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
10
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
2
|
import { ColumnSetCheckFormatterProps } from './types';
|
|
3
3
|
import { RowKey } from '../../types';
|
|
4
4
|
/**
|
|
@@ -6,4 +6,4 @@ import { RowKey } from '../../types';
|
|
|
6
6
|
* acualizando un Set/Setter por medio de un hook generico el cual es invocado con el argumento field para ,
|
|
7
7
|
* sin la necesidad de entrar en edición como lo hace un editor
|
|
8
8
|
*/
|
|
9
|
-
export declare function ColumnSetCheckFormatter<Row, TKey extends RowKey = RowKey>(parameters: ColumnSetCheckFormatterProps<Row, TKey>): (props:
|
|
9
|
+
export declare function ColumnSetCheckFormatter<Row, TKey extends RowKey = RowKey>(parameters: ColumnSetCheckFormatterProps<Row, TKey>): (props: RenderCellProps<Row>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { ColumnSetCheckFormatterProps } from './types';
|
|
|
5
5
|
* Returns formatter, customFilter and customSort.
|
|
6
6
|
*/
|
|
7
7
|
export declare const useColumnSetCheck: <TRow, TKey extends RowKey = RowKey>(props: ColumnSetCheckFormatterProps<TRow, TKey>) => {
|
|
8
|
-
formatter: (props: import('react-data-grid').
|
|
8
|
+
formatter: (props: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
customFilter: (row: TRow, value: TKey) => boolean;
|
|
10
10
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ColumnUncertaintyFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
3
|
/**
|
|
3
4
|
* Formatter for column uncertainty in DataGrid
|
|
4
5
|
*/
|
|
5
|
-
export declare function ColumnUncertaintyFormatter<TRow>(props: ColumnUncertaintyFormatterProps<TRow>): (
|
|
6
|
+
export declare function ColumnUncertaintyFormatter<TRow>(props: ColumnUncertaintyFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
|
|
4
3
|
import { U as UncertaintyFormatter } from "../../../formatters/UncertaintyFormatter/UncertaintyFormatter.js";
|
|
5
4
|
function ColumnUncertaintyFormatter(props) {
|
|
6
5
|
const { Component = React.Fragment } = props;
|
|
7
|
-
const fieldValue =
|
|
8
|
-
const fieldSymbol =
|
|
9
|
-
const fieldUnit =
|
|
10
|
-
return (
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
+
const fieldValue = props.fieldValue;
|
|
7
|
+
const fieldSymbol = props.fieldSymbol;
|
|
8
|
+
const fieldUnit = props.fieldUnit;
|
|
9
|
+
return (formatterProps) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
UncertaintyFormatter,
|
|
12
|
+
{
|
|
13
|
+
obProps: formatterProps.row,
|
|
14
|
+
...props,
|
|
15
|
+
fieldValue,
|
|
16
|
+
fieldSymbol,
|
|
17
|
+
fieldUnit,
|
|
18
|
+
Component
|
|
19
|
+
}
|
|
20
|
+
);
|
|
12
21
|
};
|
|
13
22
|
}
|
|
14
23
|
export {
|
|
@@ -4,7 +4,7 @@ import { ColumnUncertaintyFormatterProps } from './types';
|
|
|
4
4
|
* the filter and the customSort of the uncertainty column.
|
|
5
5
|
*/
|
|
6
6
|
export declare const useColumnUncertanity: <TRow>(props: ColumnUncertaintyFormatterProps<TRow>) => {
|
|
7
|
-
formatter: (
|
|
7
|
+
formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
customFilter: (row: TRow, value: string) => boolean;
|
|
9
9
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DataGrid } from './DataGrid';
|
|
2
2
|
export * from './formatters';
|
|
3
|
-
export type { Column,
|
|
3
|
+
export type { Column, RenderEditCellProps, RenderCellProps } from 'react-data-grid';
|
|
4
4
|
export type { RowKey, ChangeUserColumn } from './types';
|
|
5
5
|
export { getDataGridComponentsDictionary } from './dictionary';
|
|
6
6
|
export { TextEditor, NumberEditor } from './subcomponents/editors/TextEditor';
|
|
@@ -48,6 +48,10 @@ var ControlNavigateSlots = /* @__PURE__ */ ((ControlNavigateSlots2) => {
|
|
|
48
48
|
ControlNavigateSlots2["controlNavigate"] = "controlNavigate";
|
|
49
49
|
return ControlNavigateSlots2;
|
|
50
50
|
})(ControlNavigateSlots || {});
|
|
51
|
+
var ColumnIconFormatterSlots = /* @__PURE__ */ ((ColumnIconFormatterSlots2) => {
|
|
52
|
+
ColumnIconFormatterSlots2["columnIconFormatter"] = "columnIconFormatter";
|
|
53
|
+
return ColumnIconFormatterSlots2;
|
|
54
|
+
})(ColumnIconFormatterSlots || {});
|
|
51
55
|
export {
|
|
52
56
|
ActionsSlots as A,
|
|
53
57
|
ControlNavigateSlots as C,
|
|
@@ -55,5 +59,6 @@ export {
|
|
|
55
59
|
RowsCountSlots as R,
|
|
56
60
|
TextEditorSlots as T,
|
|
57
61
|
ColumnsConfigSlots as a,
|
|
58
|
-
TableSlots as b
|
|
62
|
+
TableSlots as b,
|
|
63
|
+
ColumnIconFormatterSlots as c
|
|
59
64
|
};
|
|
@@ -62,3 +62,9 @@ export declare const InputTextEditorStyled: import('@emotion/styled').StyledComp
|
|
|
62
62
|
* ****************
|
|
63
63
|
*/
|
|
64
64
|
export declare const ControlNavigateStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
65
|
+
/**
|
|
66
|
+
* ****************
|
|
67
|
+
* Slots ColumnIconFormatter
|
|
68
|
+
* ****************
|
|
69
|
+
*/
|
|
70
|
+
export declare const ColumnIconFormatterStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
2
|
import { MenuList, InputBase } from "@mui/material";
|
|
3
3
|
import { D as DATAGRID_PREFIX_NAME } from "../constants.js";
|
|
4
|
-
import { D as DataGridSlots, T as TextEditorSlots, A as ActionsSlots, b as TableSlots, C as ControlNavigateSlots, R as RowsCountSlots, a as ColumnsConfigSlots } from "./DataGridEnum.js";
|
|
4
|
+
import { D as DataGridSlots, T as TextEditorSlots, A as ActionsSlots, b as TableSlots, C as ControlNavigateSlots, c as ColumnIconFormatterSlots, R as RowsCountSlots, a as ColumnsConfigSlots } from "./DataGridEnum.js";
|
|
5
5
|
import { d as dataGridStyles } from "../Datagrid.styles.js";
|
|
6
6
|
import { I as Icon } from "../../Icon/Icon.js";
|
|
7
7
|
const DataGridRootStyled = styled("div", {
|
|
@@ -120,6 +120,10 @@ const ControlNavigateStyled = styled("div", {
|
|
|
120
120
|
name: DATAGRID_PREFIX_NAME,
|
|
121
121
|
slot: ControlNavigateSlots.controlNavigate
|
|
122
122
|
})(dataGridStyles.controlNavigate);
|
|
123
|
+
const ColumnIconFormatterStyled = styled("div", {
|
|
124
|
+
name: DATAGRID_PREFIX_NAME,
|
|
125
|
+
slot: ColumnIconFormatterSlots.columnIconFormatter
|
|
126
|
+
})(dataGridStyles.columnIconFormatter);
|
|
123
127
|
export {
|
|
124
128
|
ActionsRootStyled as A,
|
|
125
129
|
ButtonHeaderActionsStyled as B,
|
|
@@ -132,22 +136,23 @@ export {
|
|
|
132
136
|
RowsCountRootStyled as R,
|
|
133
137
|
TableWrapperDataGridStyled as T,
|
|
134
138
|
WrapperSkeletonStyled as W,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
139
|
+
ColumnIconFormatterStyled as a,
|
|
140
|
+
ControlNavigateStyled as b,
|
|
141
|
+
ActionsConfigContainerStyled as c,
|
|
142
|
+
ContainerLeftActionsStyled as d,
|
|
143
|
+
ContainerRightActionsStyled as e,
|
|
144
|
+
RowsCountLabelStyled as f,
|
|
145
|
+
RowsCountValueStyled as g,
|
|
146
|
+
ColumnsConfigWrapperStyled as h,
|
|
147
|
+
ColumnsConfigDataGridStyled as i,
|
|
148
|
+
ColumnsConfigSelColumnsStyled as j,
|
|
149
|
+
ColumnsConfigActiosStyled as k,
|
|
150
|
+
ContentModalSettingStyled as l,
|
|
151
|
+
TableContainerStyled as m,
|
|
152
|
+
NameColumnStyled as n,
|
|
153
|
+
DraggableHeaderRootStyled as o,
|
|
154
|
+
DraggableWrapperInputBaseStyled as p,
|
|
155
|
+
IconSearchStyled as q,
|
|
156
|
+
HeaderRenderClickStyled as r,
|
|
157
|
+
InputTextEditorStyled as s
|
|
153
158
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIsMobile } from "@m4l/graphics";
|
|
3
|
-
import {
|
|
3
|
+
import { b as ControlNavigateStyled } from "../../slots/DataGridSlot.js";
|
|
4
4
|
import { R as RowsCount } from "../HeaderActions/subcomponents/RowsCount/index.js";
|
|
5
5
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
6
6
|
import { P as Pager } from "../../../Pager/Pager.js";
|
|
@@ -5,7 +5,7 @@ import { D as Density } from "./subcomponents/Density/index.js";
|
|
|
5
5
|
import { u as useDataGrid } from "../../hooks/useDataGrid.js";
|
|
6
6
|
import { useIsMobile } from "@m4l/graphics";
|
|
7
7
|
import { M as MobileMenuActions } from "./subcomponents/MobileMenuActions/index.js";
|
|
8
|
-
import { A as ActionsRootStyled,
|
|
8
|
+
import { A as ActionsRootStyled, c as ActionsConfigContainerStyled, d as ContainerLeftActionsStyled, e as ContainerRightActionsStyled } from "../../slots/DataGridSlot.js";
|
|
9
9
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
10
10
|
function HeaderActions(props) {
|
|
11
11
|
const {
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
3
3
|
import { Skeleton } from "@mui/material";
|
|
4
4
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
5
|
-
import { R as RowsCountRootStyled,
|
|
5
|
+
import { R as RowsCountRootStyled, f as RowsCountLabelStyled, g as RowsCountValueStyled } from "../../../../slots/DataGridSlot.js";
|
|
6
6
|
function RowsCount() {
|
|
7
7
|
const { rowsCount, size } = useDataGrid();
|
|
8
8
|
const { getLabel } = useModuleDictionary();
|
|
@@ -4,7 +4,7 @@ import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
|
4
4
|
import DataGrid from "react-data-grid";
|
|
5
5
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
6
6
|
import { p as pathIcons } from "../../../../../../icons.js";
|
|
7
|
-
import {
|
|
7
|
+
import { h as ColumnsConfigWrapperStyled, i as ColumnsConfigDataGridStyled, j as ColumnsConfigSelColumnsStyled, T as TableWrapperDataGridStyled, k as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../../../dictionary.js";
|
|
9
9
|
import { C as ColumnInteractiveCheckFormatter } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/formatter.js";
|
|
10
10
|
function getRowsFromColumnsConfig(columnsConfig, columns) {
|
|
@@ -62,7 +62,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
62
62
|
name: getLabel(DICTIONARY.SETTINGS_COLUMN_VISIBLE),
|
|
63
63
|
width: 80,
|
|
64
64
|
type: "boolean",
|
|
65
|
-
|
|
65
|
+
renderCell: ColumnInteractiveCheckFormatter,
|
|
66
66
|
...getAlignClass("center")
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -70,7 +70,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
70
70
|
name: getLabel(DICTIONARY.SETTINGS_COLUMNS_FROZEN),
|
|
71
71
|
width: 80,
|
|
72
72
|
type: "boolean",
|
|
73
|
-
|
|
73
|
+
renderCell: ColumnInteractiveCheckFormatter,
|
|
74
74
|
...getAlignClass("center")
|
|
75
75
|
}
|
|
76
76
|
],
|
|
@@ -176,7 +176,7 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
176
176
|
const onInternalRowsChange = (newRows) => {
|
|
177
177
|
setRows(newRows);
|
|
178
178
|
};
|
|
179
|
-
const
|
|
179
|
+
const onCellClick = ({ row }) => {
|
|
180
180
|
if (selRows.has(row.key)) {
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
@@ -196,9 +196,8 @@ const ColumnsConfig = forwardRef((props, ref) => {
|
|
|
196
196
|
onRowsChange: onInternalRowsChange,
|
|
197
197
|
selectedRows: selRows,
|
|
198
198
|
onSelectedRowsChange: onInternalSelectedRowsChange,
|
|
199
|
-
|
|
199
|
+
onCellClick,
|
|
200
200
|
rowKeyGetter: (row) => row.key,
|
|
201
|
-
cellNavigationMode: "CHANGE_ROW",
|
|
202
201
|
defaultColumnOptions: { resizable: true, sortable: true }
|
|
203
202
|
}
|
|
204
203
|
) })
|
|
@@ -5,7 +5,7 @@ import { useRef, useCallback } from "react";
|
|
|
5
5
|
import { u as useDataGrid } from "../../../../../hooks/useDataGrid.js";
|
|
6
6
|
import { u as useModal } from "../../../../../../../hooks/useModal/index.js";
|
|
7
7
|
import { C as ColumnsConfig } from "../../Settings/subcomponents/ColumnsConfig/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { l as ContentModalSettingStyled, D as DataGridRootStyled } from "../../../../../slots/DataGridSlot.js";
|
|
9
9
|
import { p as pathIcons } from "../../../../../icons.js";
|
|
10
10
|
import { A as ActionsContainer } from "../../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
11
11
|
import { W as WindowBase } from "../../../../../../WindowBase/WindowBase.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { RenderHeaderCellProps } from 'react-data-grid';
|
|
3
3
|
/**
|
|
4
4
|
* Función encargada de retornar el componente de renderizado de cabecera con la capacidad de arrastrar columnas
|
|
5
5
|
* @param handleColumnsReorder - Función que se ejecuta al reordenar columnas
|
|
6
6
|
*/
|
|
7
7
|
export declare const getDragHeaderRenderer: <TRow, TSummaryRow>(handleColumnsReorder: (sourceKey: string, targetKey: string) => void, options?: {
|
|
8
8
|
openPopover?: (anchorEl: HTMLElement, columnKey: string) => void;
|
|
9
|
-
}) => FunctionComponent<
|
|
9
|
+
}) => FunctionComponent<RenderHeaderCellProps<TRow, TSummaryRow>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Column } from 'react-data-grid';
|
|
1
|
+
import { Column, SortColumn } from 'react-data-grid';
|
|
2
2
|
import { MenuAction } from '../subcomponents/HeaderRenderClick/types';
|
|
3
3
|
/**
|
|
4
4
|
* Función que retorna las acciones del menu del header de la columna
|
|
5
5
|
*/
|
|
6
|
-
export declare function useHeaderMenuActions<Trow, TSummaryRow>(columnKey: string | null, finalColumns: readonly Column<Trow, TSummaryRow>[], defaultSortable: boolean): MenuAction[];
|
|
6
|
+
export declare function useHeaderMenuActions<Trow, TSummaryRow>(columnKey: string | null, finalColumns: readonly Column<Trow, TSummaryRow>[], defaultSortable: boolean, handleSortFromPopover?: (newSortColumns: SortColumn[]) => void): MenuAction[];
|
|
@@ -3,7 +3,7 @@ import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
|
3
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { D as DICTIONARY } from "../../../dictionary.js";
|
|
5
5
|
import { p as pathIcons } from "../../../icons.js";
|
|
6
|
-
function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
6
|
+
function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSortFromPopover) {
|
|
7
7
|
const {
|
|
8
8
|
columnsConfig,
|
|
9
9
|
onChangeColumnsConfig,
|
|
@@ -14,6 +14,13 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
14
14
|
} = useDataGrid();
|
|
15
15
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
16
16
|
const { getLabel } = useModuleDictionary();
|
|
17
|
+
const executeSortChange = (newSortColumns) => {
|
|
18
|
+
if (handleSortFromPopover) {
|
|
19
|
+
handleSortFromPopover(newSortColumns);
|
|
20
|
+
} else {
|
|
21
|
+
setSortColumns(newSortColumns);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
17
24
|
const column = useMemo(() => {
|
|
18
25
|
return finalColumns.find((c) => c.key === columnKey);
|
|
19
26
|
}, [columnKey, finalColumns]);
|
|
@@ -66,8 +73,9 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
66
73
|
if (!columnKey) {
|
|
67
74
|
return;
|
|
68
75
|
}
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
const newSortColumns = sortColumns.filter((s) => s.columnKey !== columnKey);
|
|
77
|
+
executeSortChange(newSortColumns);
|
|
78
|
+
}, [columnKey, sortColumns, executeSortChange]);
|
|
71
79
|
const hasAnySortApplied = useMemo(() => {
|
|
72
80
|
return Boolean(currentSort);
|
|
73
81
|
}, [currentSort]);
|
|
@@ -97,7 +105,8 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
97
105
|
externalSortSettings?.onChange({
|
|
98
106
|
action: "add",
|
|
99
107
|
columnKey,
|
|
100
|
-
direction
|
|
108
|
+
direction,
|
|
109
|
+
label: column.name
|
|
101
110
|
});
|
|
102
111
|
},
|
|
103
112
|
[columnKey, column, externalSortSettings]
|
|
@@ -152,7 +161,7 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
152
161
|
if (externalSortSettings) {
|
|
153
162
|
addExternalSort("asc");
|
|
154
163
|
} else {
|
|
155
|
-
|
|
164
|
+
executeSortChange([
|
|
156
165
|
{
|
|
157
166
|
columnKey,
|
|
158
167
|
direction: "ASC"
|
|
@@ -174,7 +183,7 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
174
183
|
if (externalSortSettings) {
|
|
175
184
|
addExternalSort("desc");
|
|
176
185
|
} else {
|
|
177
|
-
|
|
186
|
+
executeSortChange([
|
|
178
187
|
{
|
|
179
188
|
columnKey,
|
|
180
189
|
direction: "DESC"
|
|
@@ -254,7 +263,8 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
254
263
|
host_static_assets,
|
|
255
264
|
environment_assets,
|
|
256
265
|
getLabel,
|
|
257
|
-
isAddFilterDisabled
|
|
266
|
+
isAddFilterDisabled,
|
|
267
|
+
executeSortChange
|
|
258
268
|
]);
|
|
259
269
|
}
|
|
260
270
|
export {
|
|
@@ -17,7 +17,6 @@ function getComparator(columns, sortColumn) {
|
|
|
17
17
|
return column.customSort;
|
|
18
18
|
}
|
|
19
19
|
switch (typeOrder) {
|
|
20
|
-
//Si el tipo de dato de la columna es un numerico, retorna una función de ordenamiento numérica
|
|
21
20
|
case "number":
|
|
22
21
|
return (a, b) => {
|
|
23
22
|
try {
|
|
@@ -26,7 +25,6 @@ function getComparator(columns, sortColumn) {
|
|
|
26
25
|
return -1;
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
|
-
//Por defecto retorna una función de ordenamiento de string
|
|
30
28
|
default:
|
|
31
29
|
return (a, b) => {
|
|
32
30
|
try {
|
|
@@ -139,16 +137,20 @@ const useSortColumnsRows = (sourceColumns, sourceRows, popoverHandlers) => {
|
|
|
139
137
|
return newColumn;
|
|
140
138
|
}
|
|
141
139
|
if (isSkeleton) {
|
|
142
|
-
newColumn.
|
|
143
|
-
newColumn.
|
|
140
|
+
newColumn.renderHeaderCell = SkeletonFormatter;
|
|
141
|
+
newColumn.renderCell = SkeletonFormatter;
|
|
142
|
+
} else {
|
|
143
|
+
if (newColumn.formatter && !newColumn.renderCell) {
|
|
144
|
+
newColumn.renderCell = newColumn.formatter;
|
|
145
|
+
}
|
|
144
146
|
}
|
|
145
|
-
if (newColumn.
|
|
146
|
-
newColumn.withinHeaderRenderer = newColumn.
|
|
147
|
+
if (newColumn.renderHeaderCell) {
|
|
148
|
+
newColumn.withinHeaderRenderer = newColumn.renderHeaderCell;
|
|
147
149
|
}
|
|
148
150
|
if ((newColumn?.withFilter === void 0 || newColumn.withFilter === true) && activeFilters) {
|
|
149
151
|
newColumn.headerCellClass = `${newColumn.headerCellClass} ${filterColumnClassName}`.trim();
|
|
150
152
|
}
|
|
151
|
-
newColumn.
|
|
153
|
+
newColumn.renderHeaderCell = DragAndDropHeaderRenderer;
|
|
152
154
|
return newColumn;
|
|
153
155
|
});
|
|
154
156
|
}, [
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { DataGridProps } from 'react-data-grid';
|
|
1
2
|
import { GridProps, RowKey } from '../../types';
|
|
2
3
|
/**
|
|
3
4
|
* Componente que renderiza la tabla con las filas y columnas
|
|
5
|
+
* Acepta todos los props de DataGrid y prioriza las configuraciones personalizadas
|
|
4
6
|
*/
|
|
5
|
-
export declare function Table<TRow, TSummaryRow, TKey extends RowKey = RowKey>(props: GridProps<TRow, TSummaryRow, TKey>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Table<TRow, TSummaryRow, TKey extends RowKey = RowKey>(props: GridProps<TRow, TSummaryRow, TKey> & Omit<DataGridProps<TRow, TSummaryRow>, keyof GridProps<TRow, TSummaryRow, TKey>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { a as filterHeight } from "./subcomponents/SelectColumn.js";
|
|
|
8
8
|
import { u as useSortColumnsRows } from "./hooks/useSortColumnsRows.js";
|
|
9
9
|
import { u as useFilters } from "../../hooks/useFilters.js";
|
|
10
10
|
import { u as useDataGrid } from "../../hooks/useDataGrid.js";
|
|
11
|
-
import {
|
|
11
|
+
import { m as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../slots/DataGridSlot.js";
|
|
12
12
|
import { u as useHeaderMenuActions } from "./hooks/useHeaderMenuActions.js";
|
|
13
13
|
import { H as HeaderRenderClick } from "./subcomponents/HeaderRenderClick/HeaderRenderClick.js";
|
|
14
14
|
function Table(props) {
|
|
@@ -18,8 +18,19 @@ function Table(props) {
|
|
|
18
18
|
onRowsChange,
|
|
19
19
|
rowKeyGetter,
|
|
20
20
|
selectedRows,
|
|
21
|
-
onSelectedRowsChange
|
|
21
|
+
onSelectedRowsChange,
|
|
22
|
+
defaultColumnOptions: defaultColumnOptionsProp,
|
|
23
|
+
...restProps
|
|
22
24
|
} = props;
|
|
25
|
+
const renderCheckbox = (formatterProps) => {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
CheckboxFormatter,
|
|
28
|
+
{
|
|
29
|
+
...formatterProps,
|
|
30
|
+
tabIndex: formatterProps.tabIndex
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
23
34
|
const { finalColumns, finalRows } = useSortColumnsRows(
|
|
24
35
|
columns,
|
|
25
36
|
rows,
|
|
@@ -55,7 +66,18 @@ function Table(props) {
|
|
|
55
66
|
anchorEl: null,
|
|
56
67
|
columnKey: null
|
|
57
68
|
});
|
|
58
|
-
const
|
|
69
|
+
const [allowSortChange, setAllowSortChange] = useState(false);
|
|
70
|
+
const handleSortColumnsChange = (newSortColumns) => {
|
|
71
|
+
if (allowSortChange) {
|
|
72
|
+
setSortColumns(newSortColumns);
|
|
73
|
+
setAllowSortChange(false);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const handleSortFromPopover = (newSortColumns) => {
|
|
77
|
+
setAllowSortChange(true);
|
|
78
|
+
setSortColumns(newSortColumns);
|
|
79
|
+
};
|
|
80
|
+
const onCellClick = ({ row }) => {
|
|
59
81
|
if (selectedRows && onSelectedRowsChange) {
|
|
60
82
|
if (selectedRows.entries().next().value) {
|
|
61
83
|
if (selectedRows.entries().next().value?.[1] === rowKeyGetter(row)) {
|
|
@@ -90,11 +112,16 @@ function Table(props) {
|
|
|
90
112
|
const onColumnResize = (idx, width) => {
|
|
91
113
|
onChangeColumnWidth(finalColumns[idx].key, width);
|
|
92
114
|
};
|
|
93
|
-
const defaultColumnOptions = {
|
|
115
|
+
const defaultColumnOptions = {
|
|
116
|
+
resizable: true,
|
|
117
|
+
sortable: true,
|
|
118
|
+
...defaultColumnOptionsProp || {}
|
|
119
|
+
};
|
|
94
120
|
const menuActions = useHeaderMenuActions(
|
|
95
121
|
popoverState.columnKey,
|
|
96
122
|
finalColumns,
|
|
97
|
-
defaultColumnOptions.sortable
|
|
123
|
+
Boolean(defaultColumnOptions.sortable),
|
|
124
|
+
handleSortFromPopover
|
|
98
125
|
);
|
|
99
126
|
return /* @__PURE__ */ jsx(TableContainerStyled, { id: "WrapperTable", children: /* @__PURE__ */ jsxs(TableWrapperDataGridStyled, { ownerState: { size }, children: [
|
|
100
127
|
/* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, context: window, children: /* @__PURE__ */ jsx(
|
|
@@ -105,18 +132,20 @@ function Table(props) {
|
|
|
105
132
|
headerRowHeight: activeFilters ? currentRowHeaderHeight + filterHeight : currentRowHeaderHeight,
|
|
106
133
|
columns: finalColumns,
|
|
107
134
|
sortColumns,
|
|
108
|
-
onSortColumnsChange:
|
|
135
|
+
onSortColumnsChange: handleSortColumnsChange,
|
|
109
136
|
onColumnResize,
|
|
110
137
|
rows: finalRows,
|
|
111
138
|
onRowsChange,
|
|
112
139
|
selectedRows,
|
|
113
140
|
onSelectedRowsChange,
|
|
114
|
-
|
|
141
|
+
onCellClick,
|
|
115
142
|
rowHeight: currentRowHeight,
|
|
116
143
|
rowKeyGetter,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
144
|
+
renderers: {
|
|
145
|
+
renderCheckbox
|
|
146
|
+
},
|
|
147
|
+
defaultColumnOptions,
|
|
148
|
+
...restProps
|
|
120
149
|
}
|
|
121
150
|
) }),
|
|
122
151
|
popoverState.columnKey && popoverState.anchorEl instanceof HTMLDivElement && /* @__PURE__ */ jsx(
|