@m4l/components 9.2.64 → 9.2.65-JT17072025.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/AppBar/AppBar.js +12 -10
- package/components/AppBar/constants.d.ts +1 -1
- package/components/AppBar/constants.js +1 -1
- package/components/AppBar/slots/AppBarEnum.d.ts +1 -5
- package/components/AppBar/slots/AppBarEnum.js +0 -4
- package/components/AppBar/slots/AppBarSlots.d.ts +4 -18
- package/components/AppBar/slots/AppBarSlots.js +3 -27
- package/components/AppBar/styles.js +0 -42
- package/components/AppBar/types.d.ts +8 -0
- package/components/Chip/ChipStyles.js +1 -1
- package/components/DataGrid/Datagrid.styles.js +95 -8
- 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 +2 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +2 -2
- package/components/DataGrid/formatters/ColumnIconFormatter/useColumnIcon.d.ts +1 -1
- 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/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +4 -5
- 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 +15 -6
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +13 -7
- package/components/DataGrid/subcomponents/Table/index.d.ts +3 -1
- package/components/DataGrid/subcomponents/Table/index.js +38 -9
- 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 +10 -8
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +7 -7
- package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +15 -5
- package/components/DataGrid/types.d.ts +9 -4
- package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +0 -2
- package/components/SideBar/SideBar.js +6 -2
- package/components/SideBar/constants.d.ts +8 -6
- package/components/SideBar/constants.js +8 -8
- package/components/SideBar/context/sideBarContext/index.js +9 -10
- package/components/SideBar/context/sideBarContext/types.d.ts +2 -10
- package/components/SideBar/slots/SideBarEnum.d.ts +8 -7
- package/components/SideBar/slots/SideBarEnum.js +6 -5
- package/components/SideBar/slots/SideBarSlots.d.ts +12 -9
- package/components/SideBar/slots/SideBarSlots.js +36 -28
- package/components/SideBar/styles.js +3 -3
- package/components/SideBar/subcomponents/ContentComponent/index.js +12 -68
- package/components/SideBar/subcomponents/ContentComponent/style.js +134 -107
- package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.d.ts +1 -1
- package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.js +4 -4
- package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.js +8 -2
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.d.ts +5 -0
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.js +37 -0
- package/components/SideBar/subcomponents/HeaderComponent/index.d.ts +1 -0
- package/components/SideBar/subcomponents/HeaderComponent/index.js +1 -0
- package/components/SideBar/subcomponents/HeaderComponent/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/HeaderComponent/styles.js +40 -0
- package/components/SideBar/subcomponents/SideBarDesktop/index.js +4 -3
- package/components/SideBar/subcomponents/SideBarDesktop/styles.js +4 -32
- package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/index.js +4 -3
- package/components/SideBar/subcomponents/TreeGroupItems/styles.js +112 -2
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts +7 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js +12 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/types.d.ts +4 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +9 -7
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +1 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +11 -6
- package/components/SideBar/types.d.ts +12 -7
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/commercial/HamburgerMenu/HamburgerMenu.js +1 -2
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +0 -5
- package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +4 -4
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.d.ts +1 -1
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +7 -6
- package/components/mui_extended/MenuItem/MenuItem.js +3 -2
- package/components/mui_extended/MenuItem/types.d.ts +4 -0
- package/components/mui_extended/TabContent/TabContent.js +2 -2
- package/components/mui_extended/TabContent/TabContent.styles.js +1 -1
- package/components/mui_extended/TabContent/types.d.ts +13 -1
- package/package.json +2 -2
- package/storybook/components/DataGrid/DataGrid.stories.d.ts +4 -0
- package/storybook/components/DataGrid/helpers/types.d.ts +3 -2
- package/storybook/components/SideBar/SideBar.stories.d.ts +5 -11
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/FooterComponentHost.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/index.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.stories.d.ts +14 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/constants.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/index.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/HeaderComponentHost.d.ts +5 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/constants.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/HeaderComponentMicrofrontend.d.ts +5 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/constants.d.ts +1 -0
- package/utils/getSizeStyles/getSizeStyles.d.ts +1 -1
- package/components/SideBar/subcomponents/HeaderSidebar/index.d.ts +0 -6
- package/components/SideBar/subcomponents/HeaderSidebar/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/HeaderSidebar/styles.js +0 -24
- package/components/SideBar/subcomponents/HeaderSidebar/types.d.ts +0 -5
- package/helpers/getFieldValueWithRow.js +0 -10
- package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +0 -4
- package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +0 -1
- /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/types.d.ts +0 -0
- /package/storybook/components/SideBar/subcomponents/{FooterPromotion → FooterComponentHost}/constants.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ColumnDateFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
3
|
/**
|
|
3
4
|
* Function to format a date in a column of a DataGrid
|
|
4
5
|
*/
|
|
5
|
-
export declare function ColumnDateFormatter<TRow>(props: ColumnDateFormatterProps<TRow>): (
|
|
6
|
+
export declare function ColumnDateFormatter<TRow>(props: ColumnDateFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
|
|
5
4
|
import { D as DateFormatter } from "../../../formatters/DateFormatter/DateFormatter.js";
|
|
6
5
|
function ColumnDateFormatter(props) {
|
|
7
6
|
const { fieldValue, presentationType, Component = React.Fragment } = props;
|
|
8
|
-
return (
|
|
9
|
-
const valueMaybeDateStringNumber = getPropertyByString(
|
|
7
|
+
return (formatterProps) => {
|
|
8
|
+
const valueMaybeDateStringNumber = getPropertyByString(
|
|
9
|
+
formatterProps.row,
|
|
10
|
+
fieldValue
|
|
11
|
+
);
|
|
10
12
|
let fixedValue;
|
|
11
13
|
if (typeof valueMaybeDateStringNumber === "string" || typeof valueMaybeDateStringNumber === "number" || valueMaybeDateStringNumber instanceof Date) {
|
|
12
14
|
fixedValue = valueMaybeDateStringNumber;
|
|
13
15
|
} else {
|
|
14
16
|
fixedValue = "";
|
|
15
17
|
}
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
DateFormatter,
|
|
20
|
+
{
|
|
21
|
+
presentationType,
|
|
22
|
+
value: fixedValue,
|
|
23
|
+
Component
|
|
24
|
+
}
|
|
25
|
+
);
|
|
17
26
|
};
|
|
18
27
|
}
|
|
19
28
|
export {
|
|
@@ -8,7 +8,7 @@ export declare const useCustomDateFilter: <TRow>(props: ColumnDateFormatterProps
|
|
|
8
8
|
* customFilter and customSort of a date column
|
|
9
9
|
*/
|
|
10
10
|
export declare const useColumnDate: <TRow>(props: ColumnDateFormatterProps<TRow>) => {
|
|
11
|
-
formatter: (
|
|
11
|
+
formatter: (formatterProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
customFilter: (row: TRow, value: string) => boolean;
|
|
13
13
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
14
14
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ColumnIconFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
3
|
/**
|
|
3
4
|
* Function to format an icon in a column of a DataGrid
|
|
4
5
|
* @template TRow - Tipo de datos de la fila
|
|
5
6
|
*/
|
|
6
|
-
export declare function ColumnIconFormatter<TRow>(props: ColumnIconFormatterProps<TRow>): (
|
|
7
|
+
export declare function ColumnIconFormatter<TRow>(props: ColumnIconFormatterProps<TRow>): (renderProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,8 @@ import { r as renderMultipleIcons } from "./helpers/renderMultipleIcons.js";
|
|
|
2
2
|
import { r as renderIcon } from "./helpers/renderIcon.js";
|
|
3
3
|
function ColumnIconFormatter(props) {
|
|
4
4
|
const { getIconProps } = props;
|
|
5
|
-
return (
|
|
6
|
-
const iconProps = getIconProps(
|
|
5
|
+
return (renderProps) => {
|
|
6
|
+
const iconProps = getIconProps(renderProps.row);
|
|
7
7
|
if (Array.isArray(iconProps)) {
|
|
8
8
|
return renderMultipleIcons(iconProps);
|
|
9
9
|
}
|
|
@@ -4,5 +4,5 @@ import { ColumnIconFormatterProps } from './types';
|
|
|
4
4
|
* el formatter de la columna
|
|
5
5
|
*/
|
|
6
6
|
export declare const useColumnIcon: <TRow>(props: ColumnIconFormatterProps<TRow>) => {
|
|
7
|
-
formatter: (
|
|
7
|
+
formatter: (renderProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ColumnInteractiveCheckFormatterProps<Row> =
|
|
1
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
|
+
export type ColumnInteractiveCheckFormatterProps<Row> = RenderCellProps<Row>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ColumnNestedValueFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
2
3
|
/**
|
|
3
4
|
* Function to format a nested value in a column of a DataGrid
|
|
4
5
|
*/
|
|
5
|
-
export declare function ColumnNestedValueFormatter<TRow>(props: ColumnNestedValueFormatterProps<TRow>): (
|
|
6
|
+
export declare function ColumnNestedValueFormatter<TRow>(props: ColumnNestedValueFormatterProps<TRow>): (formatterProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { g as getFieldValueWithRow } from "../../../../helpers/getFieldValueWithRow.js";
|
|
5
4
|
import { g as getNullGuard } from "../../../../utils/getNullGuard.js";
|
|
6
5
|
function ColumnNestedValueFormatter(props) {
|
|
7
6
|
const { fieldValue, Component = React.Fragment } = props;
|
|
8
|
-
return (
|
|
9
|
-
const property = getNullGuard(
|
|
7
|
+
return (formatterProps) => {
|
|
8
|
+
const property = getNullGuard(
|
|
9
|
+
getPropertyByString(formatterProps.row, fieldValue)
|
|
10
|
+
);
|
|
10
11
|
const value = typeof property === "object" ? JSON.stringify(property) : property;
|
|
11
12
|
return /* @__PURE__ */ jsx(Component, { children: value });
|
|
12
13
|
};
|
|
@@ -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';
|
|
@@ -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
|
) })
|
|
@@ -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]);
|
|
@@ -153,7 +161,7 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
153
161
|
if (externalSortSettings) {
|
|
154
162
|
addExternalSort("asc");
|
|
155
163
|
} else {
|
|
156
|
-
|
|
164
|
+
executeSortChange([
|
|
157
165
|
{
|
|
158
166
|
columnKey,
|
|
159
167
|
direction: "ASC"
|
|
@@ -175,7 +183,7 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
175
183
|
if (externalSortSettings) {
|
|
176
184
|
addExternalSort("desc");
|
|
177
185
|
} else {
|
|
178
|
-
|
|
186
|
+
executeSortChange([
|
|
179
187
|
{
|
|
180
188
|
columnKey,
|
|
181
189
|
direction: "DESC"
|
|
@@ -255,7 +263,8 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
|
255
263
|
host_static_assets,
|
|
256
264
|
environment_assets,
|
|
257
265
|
getLabel,
|
|
258
|
-
isAddFilterDisabled
|
|
266
|
+
isAddFilterDisabled,
|
|
267
|
+
executeSortChange
|
|
259
268
|
]);
|
|
260
269
|
}
|
|
261
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,24 @@ 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
|
+
newColumn.renderEditCell = SkeletonFormatter;
|
|
143
|
+
} else {
|
|
144
|
+
if (newColumn.formatter && !newColumn.renderCell) {
|
|
145
|
+
newColumn.renderCell = newColumn.formatter;
|
|
146
|
+
}
|
|
147
|
+
if (newColumn.editor && !newColumn.renderEditCell) {
|
|
148
|
+
newColumn.renderEditCell = newColumn.editor;
|
|
149
|
+
}
|
|
144
150
|
}
|
|
145
|
-
if (newColumn.
|
|
146
|
-
newColumn.withinHeaderRenderer = newColumn.
|
|
151
|
+
if (newColumn.renderHeaderCell) {
|
|
152
|
+
newColumn.withinHeaderRenderer = newColumn.renderHeaderCell;
|
|
147
153
|
}
|
|
148
154
|
if ((newColumn?.withFilter === void 0 || newColumn.withFilter === true) && activeFilters) {
|
|
149
155
|
newColumn.headerCellClass = `${newColumn.headerCellClass} ${filterColumnClassName}`.trim();
|
|
150
156
|
}
|
|
151
|
-
newColumn.
|
|
157
|
+
newColumn.renderHeaderCell = DragAndDropHeaderRenderer;
|
|
152
158
|
return newColumn;
|
|
153
159
|
});
|
|
154
160
|
}, [
|
|
@@ -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;
|
|
@@ -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(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const CheckboxFormatter: import('react').ForwardRefExoticComponent<
|
|
1
|
+
import { RenderCheckboxProps } from 'react-data-grid';
|
|
2
|
+
export declare const CheckboxFormatter: import('react').ForwardRefExoticComponent<RenderCheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface DraggableHeaderRendererProps<TRow> extends
|
|
1
|
+
import { RenderHeaderCellProps } from 'react-data-grid';
|
|
2
|
+
interface DraggableHeaderRendererProps<TRow> extends RenderHeaderCellProps<TRow> {
|
|
3
3
|
onColumnsReorder: (sourceKey: string, targetKey: string) => void;
|
|
4
4
|
openPopover?: (anchorEl: HTMLElement, columnKey: string) => void;
|
|
5
5
|
}
|