@m4l/components 9.2.15-beta.2 → 9.2.15
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/formatters/{ColumnConcatenatedValueFormatter → ColumnConcatenatedValuesFormatter}/formatter.d.ts +1 -1
- package/components/DataGrid/formatters/{ColumnConcatenatedValueFormatter → ColumnConcatenatedValuesFormatter}/formatter.js +2 -2
- package/components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/index.d.ts +3 -0
- package/components/DataGrid/formatters/{ColumnConcatenatedValueFormatter/useColumnConcatenatedValue.d.ts → ColumnConcatenatedValuesFormatter/useColumnConcatenatedValues.d.ts} +1 -1
- package/components/DataGrid/formatters/{ColumnConcatenatedValueFormatter/useColumnConcatenatedValue.js → ColumnConcatenatedValuesFormatter/useColumnConcatenatedValues.js} +4 -4
- package/components/DataGrid/formatters/index.d.ts +1 -1
- package/components/PropertyValue/PropertyValue.js +1 -1
- package/index.js +2 -2
- package/package.json +2 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.d.ts +0 -3
- /package/components/DataGrid/formatters/{ColumnConcatenatedValueFormatter → ColumnConcatenatedValuesFormatter}/index.js +0 -0
- /package/components/DataGrid/formatters/{ColumnConcatenatedValueFormatter → ColumnConcatenatedValuesFormatter}/types.d.ts +0 -0
|
@@ -4,4 +4,4 @@ import { ColumnConcatenatedValuesFormatterProps } from './types';
|
|
|
4
4
|
* @param props
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function ColumnConcatenatedValuesFormatter(props: ColumnConcatenatedValuesFormatterProps): (obProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getPropertyByString } from "@m4l/core";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { C as ConcatenatedFormatter } from "../../../formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
|
|
5
|
-
function
|
|
5
|
+
function ColumnConcatenatedValuesFormatter(props) {
|
|
6
6
|
const { fieldValue, fieldSeparator, Component = React.Fragment } = props;
|
|
7
7
|
return (obProps) => {
|
|
8
8
|
const values = fieldValue.map((element) => {
|
|
@@ -19,5 +19,5 @@ function ColumnConcatenatedValueFormatter(props) {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
ColumnConcatenatedValuesFormatter as C
|
|
23
23
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ColumnConcatenatedValuesFormatter as ColumnConcatenatedValueFormatter } from './formatter';
|
|
2
|
+
export type { ColumnConcatenatedValuesFormatterProps } from './types';
|
|
3
|
+
export { useColumnConcatenatedValues as useColumnConcatenatedValue } from './useColumnConcatenatedValues';
|
|
@@ -2,7 +2,7 @@ import { ColumnConcatenatedValuesFormatterProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Funcion helper que retorna el formatter, filter y customSort de la columna concatenada.
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const useColumnConcatenatedValues: <TRow>(props: ColumnConcatenatedValuesFormatterProps) => {
|
|
6
6
|
formatter: (obProps: any) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
customFilter: (row: TRow, value: string) => boolean;
|
|
8
8
|
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
@@ -3,7 +3,7 @@ import { deepEqual } from "fast-equals";
|
|
|
3
3
|
import { g as getColumnKey } from "../../helpers/getColumnKey.js";
|
|
4
4
|
import { g as getFormatConcatenated } from "../../../formatters/ConcatenatedFormatter/ConcatenatedFormatter.js";
|
|
5
5
|
import { useState, useRef, useEffect, useMemo } from "react";
|
|
6
|
-
import { C as
|
|
6
|
+
import { C as ColumnConcatenatedValuesFormatter } from "./formatter.js";
|
|
7
7
|
const getArrayValuesWithFieldValue = (row, fieldValue) => {
|
|
8
8
|
const values = fieldValue.map((element) => {
|
|
9
9
|
const keyWiouthRow = getColumnKey(element);
|
|
@@ -39,7 +39,7 @@ const getCustomConcatenatedValueSort = (props) => {
|
|
|
39
39
|
return 0;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
const
|
|
42
|
+
const useColumnConcatenatedValues = (props) => {
|
|
43
43
|
const [stateProps, setStateProps] = useState(props);
|
|
44
44
|
const refProps = useRef({ ...props });
|
|
45
45
|
useEffect(() => {
|
|
@@ -49,11 +49,11 @@ const useColumnConcatenatedValue = (props) => {
|
|
|
49
49
|
}
|
|
50
50
|
}, [props]);
|
|
51
51
|
return useMemo(() => ({
|
|
52
|
-
formatter:
|
|
52
|
+
formatter: ColumnConcatenatedValuesFormatter(stateProps),
|
|
53
53
|
customFilter: getCustomContatenatedValueFilter(stateProps),
|
|
54
54
|
customSort: getCustomConcatenatedValueSort(stateProps)
|
|
55
55
|
}), [stateProps]);
|
|
56
56
|
};
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
useColumnConcatenatedValues as u
|
|
59
59
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './ColumnBooleanFormatter';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './ColumnConcatenatedValuesFormatter';
|
|
3
3
|
export * from './ColumnDateFormatter';
|
|
4
4
|
export * from './ColumnIconFormatter';
|
|
5
5
|
export * from './ColumnInteractiveCheckFormatter';
|
|
@@ -55,7 +55,7 @@ function PropertyValue(props) {
|
|
|
55
55
|
return startAdornment;
|
|
56
56
|
};
|
|
57
57
|
const renderValue = () => {
|
|
58
|
-
if (typeof value === "string" || typeof value === "number") {
|
|
58
|
+
if (typeof value === "string" || typeof value === "number" || value === null || value === void 0) {
|
|
59
59
|
return /* @__PURE__ */ jsx(Typography, { id: inputId, size: normalizedSize, variant: "body", children: getNullGuard(value) });
|
|
60
60
|
}
|
|
61
61
|
if (React.isValidElement(value)) {
|
package/index.js
CHANGED
|
@@ -36,8 +36,8 @@ import { N, T as T2 } from "./components/DataGrid/subcomponents/editors/TextEdit
|
|
|
36
36
|
import { g as g6 } from "./components/DataGrid/utils/getDataGridRowsFromSet.js";
|
|
37
37
|
import { C as C2 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js";
|
|
38
38
|
import { u as u3 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.js";
|
|
39
|
-
import { C as C3 } from "./components/DataGrid/formatters/
|
|
40
|
-
import { u as u4 } from "./components/DataGrid/formatters/
|
|
39
|
+
import { C as C3 } from "./components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js";
|
|
40
|
+
import { u as u4 } from "./components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/useColumnConcatenatedValues.js";
|
|
41
41
|
import { C as C4 } from "./components/DataGrid/formatters/ColumnDateFormatter/formatter.js";
|
|
42
42
|
import { u as u5 } from "./components/DataGrid/formatters/ColumnDateFormatter/useColumnDate.js";
|
|
43
43
|
import { C as C5 } from "./components/DataGrid/formatters/ColumnIconFormatter/formatter.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.2.15
|
|
3
|
+
"version": "9.2.15",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"lint-staged": {
|
|
6
6
|
"*.{js,ts,tsx}": "eslint --fix --max-warnings 0 --no-warn-ignored"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"@m4l/core": "^2.0.0",
|
|
13
13
|
"@m4l/graphics": "^7.0.0",
|
|
14
14
|
"@m4l/styles": "^7.0.0",
|
|
15
|
+
"@m4l/testing": "^0.0.0",
|
|
15
16
|
"@microlink/react-json-view": "^1.23.3",
|
|
16
17
|
"@mui/lab": "5.0.0-alpha.173",
|
|
17
18
|
"@mui/material": "5.16.7",
|
|
File without changes
|