@m4l/components 9.2.64 → 9.2.65-JT18072025.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.
Files changed (130) hide show
  1. package/components/AppBar/AppBar.js +12 -10
  2. package/components/AppBar/constants.d.ts +1 -1
  3. package/components/AppBar/constants.js +1 -1
  4. package/components/AppBar/slots/AppBarEnum.d.ts +1 -5
  5. package/components/AppBar/slots/AppBarEnum.js +0 -4
  6. package/components/AppBar/slots/AppBarSlots.d.ts +4 -18
  7. package/components/AppBar/slots/AppBarSlots.js +3 -27
  8. package/components/AppBar/styles.js +0 -42
  9. package/components/AppBar/types.d.ts +8 -0
  10. package/components/Chip/ChipStyles.js +1 -1
  11. package/components/DataGrid/Datagrid.styles.js +112 -9
  12. package/components/DataGrid/formatters/ColumnBooleanFormatter/formatter.d.ts +2 -1
  13. package/components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js +2 -3
  14. package/components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.d.ts +1 -1
  15. package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.d.ts +2 -1
  16. package/components/DataGrid/formatters/ColumnChipStatusFormatter/formatter.js +5 -4
  17. package/components/DataGrid/formatters/ColumnChipStatusFormatter/useColumnChipStatus.d.ts +1 -1
  18. package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.d.ts +2 -1
  19. package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js +11 -4
  20. package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/useColumnConcatenatedValues.d.ts +1 -1
  21. package/components/DataGrid/formatters/ColumnDateFormatter/formatter.d.ts +2 -1
  22. package/components/DataGrid/formatters/ColumnDateFormatter/formatter.js +13 -4
  23. package/components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.d.ts +1 -1
  24. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +2 -1
  25. package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +2 -2
  26. package/components/DataGrid/formatters/ColumnIconFormatter/useColumnIcon.d.ts +1 -1
  27. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/types.d.ts +2 -2
  28. package/components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.d.ts +2 -1
  29. package/components/DataGrid/formatters/ColumnNestedValueFormatter/formatter.js +4 -3
  30. package/components/DataGrid/formatters/ColumnNestedValueFormatter/useColumnNestedValue.d.ts +1 -1
  31. package/components/DataGrid/formatters/ColumnPointsFormatter/formatter.d.ts +2 -1
  32. package/components/DataGrid/formatters/ColumnPointsFormatter/formatter.js +13 -5
  33. package/components/DataGrid/formatters/ColumnPointsFormatter/useColumnPoints.d.ts +1 -1
  34. package/components/DataGrid/formatters/ColumnPriceFormatter/formatter.d.ts +2 -1
  35. package/components/DataGrid/formatters/ColumnPriceFormatter/formatter.js +11 -4
  36. package/components/DataGrid/formatters/ColumnPriceFormatter/useColumnPrice.d.ts +1 -1
  37. package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.d.ts +2 -2
  38. package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +1 -1
  39. package/components/DataGrid/formatters/ColumnSetCheckFormatter/useColumnSetCheck.d.ts +1 -1
  40. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.d.ts +2 -1
  41. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/formatter.js +15 -6
  42. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/useColumnUncertainty.d.ts +1 -1
  43. package/components/DataGrid/index.d.ts +1 -1
  44. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +4 -5
  45. package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +2 -2
  46. package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.d.ts +2 -2
  47. package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +15 -6
  48. package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +13 -7
  49. package/components/DataGrid/subcomponents/Table/index.d.ts +3 -1
  50. package/components/DataGrid/subcomponents/Table/index.js +38 -9
  51. package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
  52. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.d.ts +2 -2
  53. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +2 -2
  54. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +10 -8
  55. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  56. package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +7 -7
  57. package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +15 -5
  58. package/components/DataGrid/types.d.ts +9 -4
  59. package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
  60. package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +0 -2
  61. package/components/SideBar/SideBar.js +6 -2
  62. package/components/SideBar/constants.d.ts +8 -6
  63. package/components/SideBar/constants.js +8 -8
  64. package/components/SideBar/context/sideBarContext/index.js +9 -10
  65. package/components/SideBar/context/sideBarContext/types.d.ts +2 -10
  66. package/components/SideBar/slots/SideBarEnum.d.ts +8 -7
  67. package/components/SideBar/slots/SideBarEnum.js +6 -5
  68. package/components/SideBar/slots/SideBarSlots.d.ts +12 -9
  69. package/components/SideBar/slots/SideBarSlots.js +36 -28
  70. package/components/SideBar/styles.js +3 -3
  71. package/components/SideBar/subcomponents/ContentComponent/index.js +12 -68
  72. package/components/SideBar/subcomponents/ContentComponent/style.js +134 -107
  73. package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.d.ts +1 -1
  74. package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.js +4 -4
  75. package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.js +8 -2
  76. package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.d.ts +5 -0
  77. package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.js +37 -0
  78. package/components/SideBar/subcomponents/HeaderComponent/index.d.ts +1 -0
  79. package/components/SideBar/subcomponents/HeaderComponent/index.js +1 -0
  80. package/components/SideBar/subcomponents/HeaderComponent/styles.d.ts +2 -0
  81. package/components/SideBar/subcomponents/HeaderComponent/styles.js +40 -0
  82. package/components/SideBar/subcomponents/SideBarDesktop/index.js +4 -3
  83. package/components/SideBar/subcomponents/SideBarDesktop/styles.js +4 -32
  84. package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
  85. package/components/SideBar/subcomponents/TreeGroupItems/index.js +4 -3
  86. package/components/SideBar/subcomponents/TreeGroupItems/styles.js +112 -2
  87. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts +7 -0
  88. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js +12 -0
  89. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/types.d.ts +4 -0
  90. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +9 -7
  91. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +1 -0
  92. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +11 -6
  93. package/components/SideBar/types.d.ts +12 -7
  94. package/components/areas/contexts/AreasContext/store.js +2 -2
  95. package/components/commercial/HamburgerMenu/HamburgerMenu.js +1 -2
  96. package/components/formatters/BooleanFormatter/BooleanFormatter.styles.js +1 -1
  97. package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +0 -5
  98. package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +4 -4
  99. package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.d.ts +1 -1
  100. package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +7 -6
  101. package/components/mui_extended/MenuItem/MenuItem.js +3 -2
  102. package/components/mui_extended/MenuItem/types.d.ts +4 -0
  103. package/components/mui_extended/TabContent/TabContent.js +2 -2
  104. package/components/mui_extended/TabContent/TabContent.styles.js +1 -1
  105. package/components/mui_extended/TabContent/types.d.ts +13 -1
  106. package/package.json +2 -2
  107. package/storybook/components/DataGrid/DataGrid.stories.d.ts +4 -0
  108. package/storybook/components/DataGrid/helpers/types.d.ts +3 -2
  109. package/storybook/components/SideBar/SideBar.stories.d.ts +5 -11
  110. package/storybook/components/SideBar/subcomponents/FooterComponentHost/FooterComponentHost.d.ts +4 -0
  111. package/storybook/components/SideBar/subcomponents/FooterComponentHost/index.d.ts +1 -0
  112. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.d.ts +4 -0
  113. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.stories.d.ts +14 -0
  114. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/constants.d.ts +1 -0
  115. package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/index.d.ts +1 -0
  116. package/storybook/components/SideBar/subcomponents/HeaderComponentHost/HeaderComponentHost.d.ts +5 -0
  117. package/storybook/components/SideBar/subcomponents/HeaderComponentHost/constants.d.ts +1 -0
  118. package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/HeaderComponentMicrofrontend.d.ts +5 -0
  119. package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/constants.d.ts +1 -0
  120. package/utils/getSizeStyles/getSizeStyles.d.ts +1 -1
  121. package/components/SideBar/subcomponents/HeaderSidebar/index.d.ts +0 -6
  122. package/components/SideBar/subcomponents/HeaderSidebar/styles.d.ts +0 -2
  123. package/components/SideBar/subcomponents/HeaderSidebar/styles.js +0 -24
  124. package/components/SideBar/subcomponents/HeaderSidebar/types.d.ts +0 -5
  125. package/helpers/getFieldValueWithRow.js +0 -10
  126. package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +0 -4
  127. package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +0 -1
  128. /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.d.ts +0 -0
  129. /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/types.d.ts +0 -0
  130. /package/storybook/components/SideBar/subcomponents/{FooterPromotion → FooterComponentHost}/constants.d.ts +0 -0
@@ -1,13 +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 { C as ConcatenatedFormatter } from "../../../formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
6
5
  function ColumnConcatenatedValuesFormatter(props) {
7
6
  const { fieldValue, fieldSeparator, Component = React.Fragment } = props;
8
- return (obProps) => {
7
+ return (renderProps) => {
8
+ const rowData = renderProps.row;
9
9
  const values = fieldValue.map((element) => {
10
- const valueMaybeString = getPropertyByString(obProps, getFieldValueWithRow(element));
10
+ const valueMaybeString = getPropertyByString(rowData, element);
11
11
  let fixedValue;
12
12
  if (typeof valueMaybeString === "string" || typeof valueMaybeString === "number") {
13
13
  fixedValue = valueMaybeString.toString();
@@ -16,7 +16,14 @@ function ColumnConcatenatedValuesFormatter(props) {
16
16
  }
17
17
  return fixedValue;
18
18
  });
19
- return /* @__PURE__ */ jsx(ConcatenatedFormatter, { values, separator: fieldSeparator, Component });
19
+ return /* @__PURE__ */ jsx(
20
+ ConcatenatedFormatter,
21
+ {
22
+ values,
23
+ separator: fieldSeparator,
24
+ Component
25
+ }
26
+ );
20
27
  };
21
28
  }
22
29
  export {
@@ -3,7 +3,7 @@ import { ColumnConcatenatedValuesFormatterProps } from './types';
3
3
  * Funcion helper que retorna el formatter, filter y customSort de la columna concatenada.
4
4
  */
5
5
  export declare const useColumnConcatenatedValues: <TRow>(props: ColumnConcatenatedValuesFormatterProps<TRow>) => {
6
- formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
6
+ formatter: (renderProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
7
7
  customFilter: (row: TRow, value: string) => boolean;
8
8
  customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
9
9
  };
@@ -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>): (obProps: any) => import("react/jsx-runtime").JSX.Element;
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 (obProps) => {
9
- const valueMaybeDateStringNumber = getPropertyByString(obProps, getFieldValueWithRow(fieldValue));
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(DateFormatter, { presentationType, value: fixedValue, Component });
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: (obProps: any) => import("react/jsx-runtime").JSX.Element;
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>): (rowData: TRow) => JSX.Element;
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 (rowData) => {
6
- const iconProps = getIconProps(rowData);
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: (rowData: TRow) => JSX.Element;
7
+ formatter: (renderProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
8
8
  };
@@ -1,2 +1,2 @@
1
- import { FormatterProps as RDGFormatterProps } from 'react-data-grid';
2
- export type ColumnInteractiveCheckFormatterProps<Row> = RDGFormatterProps<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>): (obProps: any) => import("react/jsx-runtime").JSX.Element;
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 (obProps) => {
9
- const property = getNullGuard(getPropertyByString(obProps, getFieldValueWithRow(fieldValue)));
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: (obProps: any) => import("react/jsx-runtime").JSX.Element;
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>): (obProps: any) => import("react/jsx-runtime").JSX.Element;
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 = getFieldValueWithRow(props.fieldValue);
8
- const fieldUnit = getFieldValueWithRow(props.fieldUnit);
9
- return (obProps) => {
10
- return /* @__PURE__ */ jsx(PointsFormatter, { obProps, ...props, fieldValue, fieldUnit, Component });
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: (obProps: any) => import("react/jsx-runtime").JSX.Element;
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>): (obProps: any) => import("react/jsx-runtime").JSX.Element;
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 = getFieldValueWithRow(props.fieldValue);
8
- return (obProps) => {
9
- return /* @__PURE__ */ jsx(PriceFormatter, { obProps, ...props, fieldValue, Component });
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: (obProps: any) => import("react/jsx-runtime").JSX.Element;
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 { FormatterProps } from 'react-data-grid';
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: FormatterProps<Row>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare function ColumnSetCheckFormatter<Row, TKey extends RowKey = RowKey>(parameters: ColumnSetCheckFormatterProps<Row, TKey>): (props: RenderCellProps<Row>) => import("react/jsx-runtime").JSX.Element;
@@ -23,7 +23,7 @@ function ColumnSetCheckFormatter(parameters) {
23
23
  {
24
24
  value: checkedRows.has(rowKeyGetter(row)) || false,
25
25
  disabled,
26
- isCellSelected: props.isCellSelected,
26
+ tabIndex: props.tabIndex,
27
27
  onChange,
28
28
  "aria-label": "Select"
29
29
  }
@@ -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').FormatterProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
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>): (obProps: any) => import("react/jsx-runtime").JSX.Element;
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 = getFieldValueWithRow(props.fieldValue);
8
- const fieldSymbol = getFieldValueWithRow(props.fieldSymbol);
9
- const fieldUnit = getFieldValueWithRow(props.fieldUnit);
10
- return (obProps) => {
11
- return /* @__PURE__ */ jsx(UncertaintyFormatter, { obProps, ...props, fieldValue, fieldSymbol, fieldUnit, Component });
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: (obProps: any) => import("react/jsx-runtime").JSX.Element;
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, EditorProps, FormatterProps } from 'react-data-grid';
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
- formatter: ColumnInteractiveCheckFormatter,
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
- formatter: ColumnInteractiveCheckFormatter,
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 onRowClick = (row) => {
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
- onRowClick,
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 { HeaderRendererProps } from 'react-data-grid';
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<HeaderRendererProps<TRow, TSummaryRow>>;
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
- setSortColumns((prev) => prev.filter((s) => s.columnKey !== columnKey));
70
- }, [columnKey, setSortColumns]);
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
- setSortColumns([
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
- setSortColumns([
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.headerRenderer = SkeletonFormatter;
143
- newColumn.formatter = SkeletonFormatter;
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.headerRenderer) {
146
- newColumn.withinHeaderRenderer = newColumn.headerRenderer;
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.headerRenderer = DragAndDropHeaderRenderer;
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 onRowClick = (row) => {
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 = { resizable: true, sortable: true };
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: setSortColumns,
135
+ onSortColumnsChange: handleSortColumnsChange,
109
136
  onColumnResize,
110
137
  rows: finalRows,
111
138
  onRowsChange,
112
139
  selectedRows,
113
140
  onSelectedRowsChange,
114
- onRowClick,
141
+ onCellClick,
115
142
  rowHeight: currentRowHeight,
116
143
  rowKeyGetter,
117
- cellNavigationMode: "LOOP_OVER_ROW",
118
- components: { checkboxFormatter: CheckboxFormatter },
119
- defaultColumnOptions
144
+ renderers: {
145
+ renderCheckbox
146
+ },
147
+ defaultColumnOptions,
148
+ ...restProps
120
149
  }
121
150
  ) }),
122
151
  popoverState.columnKey && popoverState.anchorEl instanceof HTMLDivElement && /* @__PURE__ */ jsx(
@@ -35,7 +35,7 @@ const ActionsColumn = {
35
35
  sortable: false,
36
36
  frozen: true,
37
37
  type: "custom",
38
- formatter: ActionsFormatter
38
+ renderCell: ActionsFormatter
39
39
  };
40
40
  function getActionLabel() {
41
41
  return "";
@@ -1,2 +1,2 @@
1
- import { CheckboxFormatterProps } from 'react-data-grid';
2
- export declare const CheckboxFormatter: import('react').ForwardRefExoticComponent<CheckboxFormatterProps & import('react').RefAttributes<HTMLInputElement>>;
1
+ import { RenderCheckboxProps } from 'react-data-grid';
2
+ export declare const CheckboxFormatter: import('react').ForwardRefExoticComponent<RenderCheckboxProps & import('react').RefAttributes<HTMLInputElement>>;