@m4l/components 0.0.36 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CompanyLogo/index.js +0 -1
- package/dist/components/DataGrid/index.js +0 -1
- package/dist/components/DynamicFilter/components/FilterButton/styles.d.ts +0 -1
- package/dist/components/DynamicFilter/components/fieldstypes/BooleanFilter/index.d.ts +4 -0
- package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/BooleanFilter/styles.d.ts +0 -0
- package/dist/components/DynamicFilter/components/fieldstypes/DateTimeFilter/index.d.ts +4 -0
- package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/DateTimeFilter/styles.d.ts +0 -0
- package/dist/components/DynamicFilter/components/fieldstypes/NumberFilter/index.d.ts +4 -0
- package/dist/components/DynamicFilter/components/{PopupEditFilter/components/StringFilter → fieldstypes/NumberFilter}/styles.d.ts +0 -0
- package/dist/components/DynamicFilter/components/fieldstypes/StringFilter/index.d.ts +4 -0
- package/dist/components/DynamicFilter/components/fieldstypes/StringFilter/styles.d.ts +3 -0
- package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/factory.d.ts +2 -2
- package/dist/components/DynamicFilter/components/{PopupEditFilter/components → fieldstypes}/validations.d.ts +2 -1
- package/dist/components/DynamicFilter/index.js +400 -188
- package/dist/components/DynamicFilter/types.d.ts +12 -11
- package/dist/components/Icon/index.js +27 -4
- package/dist/components/Image/index.d.ts +1 -1
- package/dist/components/Image/index.js +4 -4
- package/dist/components/Image/types.d.ts +1 -1
- package/dist/components/ModalDialog/index.js +19 -16
- package/dist/components/NoItemSelected/index.d.ts +2 -1
- package/dist/components/NoItemSelected/index.js +41 -34
- package/dist/components/NoItemSelected/styles.d.ts +2 -2
- package/dist/components/NoItemSelected/types.d.ts +6 -1
- package/dist/components/ObjectLogs/index.js +9 -7
- package/dist/components/SplitLayout/index.js +3 -1
- package/dist/components/{DataGrid/formatters → formatters}/BooleanFormatter/index.d.ts +0 -0
- package/dist/components/formatters/BooleanFormatter/index.js +32 -0
- package/dist/components/{DataGrid/formatters → formatters}/BooleanFormatter/types.d.ts +2 -0
- package/dist/components/{DataGrid/formatters → formatters}/DateFormatter/index.d.ts +0 -0
- package/dist/components/formatters/DateFormatter/index.js +55 -0
- package/dist/components/{DataGrid/formatters → formatters}/DateFormatter/types.d.ts +4 -2
- package/dist/components/{DataGrid/formatters → formatters}/index.d.ts +0 -0
- package/dist/components/formatters/types.d.ts +2 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/mui_extended/IconButton/index.d.ts +1 -1
- package/dist/components/mui_extended/IconButton/index.js +5 -2
- package/dist/components/mui_extended/IconButton/types.d.ts +2 -1
- package/dist/components/mui_extended/Pager/index.js +3 -0
- package/dist/index.js +4 -4
- package/dist/vendor.js +3 -4
- package/package.json +2 -2
- package/dist/components/DataGrid/formatters/BooleanFormatter/index.js +0 -26
- package/dist/components/DataGrid/formatters/DateFormatter/index.js +0 -33
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/BooleanFilter/index.d.ts +0 -2
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/DateTimeFilter/index.d.ts +0 -2
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/StringFilter/index.d.ts +0 -2
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Maybe } from '@m4l/core';
|
|
2
|
-
export declare type FieldType = 'number' | 'string' | 'boolean' | '
|
|
2
|
+
export declare type FieldType = 'number' | 'string' | 'boolean' | 'datetime';
|
|
3
3
|
export declare type OperandType = number | string | boolean | Date | [] | object;
|
|
4
|
-
export declare type Operator = '
|
|
4
|
+
export declare type Operator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'c' | 'nc';
|
|
5
5
|
export declare const OPERATORS: Array<Operator>;
|
|
6
6
|
export declare type StringOperator = 'c' | 'nc';
|
|
7
7
|
export declare const STRING_OPERATORS: Array<StringOperator>;
|
|
8
|
+
export declare type NumberOperator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
9
|
+
export declare const NUMBER_OPERATORS: Array<NumberOperator>;
|
|
8
10
|
export declare type BooleanOperator = 'e' | 'ne';
|
|
9
11
|
export declare const BOOLEAN_OPERATORS: Array<BooleanOperator>;
|
|
10
12
|
export declare type DateTimeOperator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
@@ -25,16 +27,16 @@ export interface OptionOperator<T> {
|
|
|
25
27
|
}
|
|
26
28
|
export interface BaseApplyFilter {
|
|
27
29
|
id: number;
|
|
28
|
-
|
|
30
|
+
n: string;
|
|
29
31
|
isSetted: boolean;
|
|
30
32
|
fixed: boolean;
|
|
31
33
|
}
|
|
32
34
|
export interface ValuesFilter {
|
|
33
|
-
|
|
35
|
+
o: Operator;
|
|
34
36
|
labelOperator: string;
|
|
35
|
-
labelOperands: string;
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
labelOperands: string | number;
|
|
38
|
+
o1?: Maybe<OperandType>;
|
|
39
|
+
o2?: Maybe<OperandType>;
|
|
38
40
|
}
|
|
39
41
|
export interface FormValuesFilter<T> {
|
|
40
42
|
valueOperator?: Maybe<OptionOperator<T>>;
|
|
@@ -47,9 +49,8 @@ export interface RawFilterFieldApply {
|
|
|
47
49
|
o1: Maybe<OperandType>;
|
|
48
50
|
o2: Maybe<OperandType>;
|
|
49
51
|
}
|
|
50
|
-
export
|
|
51
|
-
|
|
52
|
-
export declare type InitialFilterFieldApply = Omit<FilterFieldApply, 'id' | 'fixed' | 'isSetted'>;
|
|
52
|
+
export declare type FilterFieldApply = BaseApplyFilter & ValuesFilter;
|
|
53
|
+
export declare type InitialFilterFieldApply = Omit<FilterFieldApply, 'id' | 'fixed' | 'isSetted' | 'labelOperator'>;
|
|
53
54
|
export declare type FilterToAddApply = Omit<FilterFieldApply, 'id' | 'labelOperator'>;
|
|
54
55
|
export declare type FilterToEditApply = Omit<FilterFieldApply, 'labelOperator'>;
|
|
55
56
|
export interface FilterFormFieldApply extends BaseApplyFilter, ValuesFilter, FormValuesFilter<Operator> {
|
|
@@ -61,5 +62,5 @@ export interface DynamicFilterProps {
|
|
|
61
62
|
withAllField?: boolean;
|
|
62
63
|
fields: Array<Field>;
|
|
63
64
|
initialFilters?: Array<InitialFilterFieldApply>;
|
|
64
|
-
onChangeFilter: (
|
|
65
|
+
onChangeFilter: (initialFilters: Array<InitialFilterFieldApply>, rawFilters: Array<RawFilterFieldApply>) => void;
|
|
65
66
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from "@mui/material";
|
|
1
|
+
import { styled, useTheme } from "@mui/material";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
const MaskIcon = styled("div", {
|
|
@@ -6,9 +6,10 @@ const MaskIcon = styled("div", {
|
|
|
6
6
|
})((props) => ({
|
|
7
7
|
WebkitMask: `url(${props.src}) no-repeat`,
|
|
8
8
|
mask: `url(${props.src}) no-repeat`,
|
|
9
|
+
maskPosition: "center",
|
|
9
10
|
width: props.width === void 0 ? "20px" : props.width,
|
|
10
11
|
height: props.height === void 0 ? "20px" : props.height,
|
|
11
|
-
backgroundColor: props.bgColor
|
|
12
|
+
backgroundColor: props.bgColor
|
|
12
13
|
}));
|
|
13
14
|
const WrapperPlaceHolder = styled("div", {
|
|
14
15
|
shouldForwardProp: (props) => props !== "widht" && props !== "height"
|
|
@@ -20,13 +21,35 @@ const WrapperPlaceHolder = styled("div", {
|
|
|
20
21
|
height: props.height
|
|
21
22
|
}));
|
|
22
23
|
function Icon(props) {
|
|
23
|
-
const [resource, setResource] = useState(void 0);
|
|
24
24
|
const {
|
|
25
25
|
src,
|
|
26
26
|
width = "16px",
|
|
27
27
|
height = "16px",
|
|
28
28
|
bgColor = "active"
|
|
29
29
|
} = props;
|
|
30
|
+
const [resource, setResource] = useState(void 0);
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const getBgColor = () => {
|
|
33
|
+
if (bgColor === "active") {
|
|
34
|
+
return theme.palette.action.active;
|
|
35
|
+
}
|
|
36
|
+
if (bgColor === "selected") {
|
|
37
|
+
return theme.palette.primary.main;
|
|
38
|
+
}
|
|
39
|
+
if (bgColor === "info") {
|
|
40
|
+
return theme.palette.info.main;
|
|
41
|
+
}
|
|
42
|
+
if (bgColor === "warning") {
|
|
43
|
+
return theme.palette.warning.main;
|
|
44
|
+
}
|
|
45
|
+
if (bgColor === "error") {
|
|
46
|
+
return theme.palette.error.main;
|
|
47
|
+
}
|
|
48
|
+
if (bgColor === "disabled") {
|
|
49
|
+
return theme.palette.action.disabled;
|
|
50
|
+
}
|
|
51
|
+
return bgColor;
|
|
52
|
+
};
|
|
30
53
|
useEffect(() => {
|
|
31
54
|
let mounted = true;
|
|
32
55
|
if (resource)
|
|
@@ -54,7 +77,7 @@ function Icon(props) {
|
|
|
54
77
|
src: resource,
|
|
55
78
|
width,
|
|
56
79
|
height,
|
|
57
|
-
bgColor
|
|
80
|
+
bgColor: getBgColor()
|
|
58
81
|
}) : /* @__PURE__ */ jsx("img", {
|
|
59
82
|
src: placeHolder,
|
|
60
83
|
alt: "icon_svg"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Props } from './types';
|
|
3
|
-
export declare function Image({ ratio, sx,
|
|
3
|
+
export declare function Image({ ratio, sx, isSkeleton, width, height, src, ...other }: Props): JSX.Element;
|
|
4
4
|
export default Image;
|
|
@@ -48,15 +48,15 @@ const WrapperLazyLoadImage = styled("div")(({
|
|
|
48
48
|
function Image({
|
|
49
49
|
ratio,
|
|
50
50
|
sx,
|
|
51
|
-
|
|
52
|
-
width,
|
|
53
|
-
height,
|
|
51
|
+
isSkeleton = false,
|
|
52
|
+
width = "100%",
|
|
53
|
+
height = "100%",
|
|
54
54
|
src,
|
|
55
55
|
...other
|
|
56
56
|
}) {
|
|
57
57
|
const theme = useTheme();
|
|
58
58
|
const themeMode = theme.palette.mode;
|
|
59
|
-
if (
|
|
59
|
+
if (isSkeleton) {
|
|
60
60
|
return /* @__PURE__ */ jsx(SKTWrapperImage, {
|
|
61
61
|
width,
|
|
62
62
|
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
@@ -19,13 +19,13 @@ const Container = styled("div")(({ theme }) => ({
|
|
|
19
19
|
}));
|
|
20
20
|
const Header$1 = styled("div")(({ theme }) => ({
|
|
21
21
|
display: "flex",
|
|
22
|
-
flexDirection: "row",
|
|
23
22
|
alignItems: "center",
|
|
24
|
-
|
|
23
|
+
justifyContent: "space-between",
|
|
24
|
+
minHeight: theme.spacing(5),
|
|
25
25
|
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
26
26
|
overflow: "hidden"
|
|
27
27
|
}));
|
|
28
|
-
|
|
28
|
+
styled("div")(({ theme }) => ({
|
|
29
29
|
display: "flex",
|
|
30
30
|
flexDirection: "row",
|
|
31
31
|
flexGrow: 1,
|
|
@@ -45,11 +45,16 @@ const IconHeader = styled("div")(({ theme, variant }) => ({
|
|
|
45
45
|
}));
|
|
46
46
|
const Content = styled("div")(() => ({
|
|
47
47
|
flexGrow: 1,
|
|
48
|
-
position: "relative"
|
|
48
|
+
position: "relative",
|
|
49
|
+
overflow: "auto"
|
|
49
50
|
}));
|
|
50
51
|
const ModalTitle = styled("div")(({ theme, variant }) => ({
|
|
51
52
|
...theme.typography.subtitle1,
|
|
52
|
-
color: getThemeVariantColor(theme, variant)
|
|
53
|
+
color: getThemeVariantColor(theme, variant),
|
|
54
|
+
width: "100%",
|
|
55
|
+
whiteSpace: "nowrap",
|
|
56
|
+
textOverflow: "ellipsis",
|
|
57
|
+
overflow: "hidden"
|
|
53
58
|
}));
|
|
54
59
|
const Header = (props) => {
|
|
55
60
|
const {
|
|
@@ -69,17 +74,15 @@ const Header = (props) => {
|
|
|
69
74
|
const iconDefault = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/icon_bar_tittle.svg`;
|
|
70
75
|
return /* @__PURE__ */ jsxs(Header$1, {
|
|
71
76
|
id: "Header",
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
children: title
|
|
82
|
-
})]
|
|
77
|
+
className: "draggable-dialog-title",
|
|
78
|
+
children: [/* @__PURE__ */ jsx(IconHeader, {
|
|
79
|
+
variant,
|
|
80
|
+
children: !iconComponent ? /* @__PURE__ */ jsx(Icon, {
|
|
81
|
+
src: variant === "warning" ? iconSrcWarning : variant === "delete" ? iconSrcError : variant === "info" ? iconSrcInfo : iconDefault
|
|
82
|
+
}) : iconComponent
|
|
83
|
+
}), /* @__PURE__ */ jsx(ModalTitle, {
|
|
84
|
+
variant,
|
|
85
|
+
children: title
|
|
83
86
|
}), withClose && /* @__PURE__ */ jsx(IconButton, {
|
|
84
87
|
onClick: onCloseModal,
|
|
85
88
|
"aria-label": "click",
|
|
@@ -1,44 +1,23 @@
|
|
|
1
1
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
2
2
|
import { styled } from "@mui/material/styles";
|
|
3
|
-
import {
|
|
3
|
+
import { I as Image } from "../Image/index.js";
|
|
4
|
+
import { Skeleton } from "@mui/material";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
const WrapperNoItemSelected = styled("div")(({
|
|
5
8
|
theme
|
|
6
9
|
}) => ({
|
|
7
10
|
width: "100%",
|
|
8
|
-
|
|
11
|
+
maxWidth: "400px",
|
|
12
|
+
minWidth: "300px",
|
|
9
13
|
display: "flex",
|
|
10
14
|
flexDirection: "column",
|
|
11
15
|
alignItems: "center",
|
|
12
16
|
justifyContent: "center",
|
|
13
|
-
overflow: "auto",
|
|
14
17
|
padding: theme.spacing(3)
|
|
15
18
|
}));
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
})(({
|
|
19
|
-
src,
|
|
20
|
-
theme
|
|
21
|
-
}) => ({
|
|
22
|
-
zIndex: 9,
|
|
23
|
-
top: 0,
|
|
24
|
-
height: "100%",
|
|
25
|
-
width: "100%",
|
|
26
|
-
maxWidth: "500px",
|
|
27
|
-
maxHeight: "200px",
|
|
28
|
-
".split_horizontal &": {
|
|
29
|
-
bruces: "sss",
|
|
30
|
-
minWidth: "150px"
|
|
31
|
-
},
|
|
32
|
-
".split_vertical &": {
|
|
33
|
-
bruces: "sss",
|
|
34
|
-
minHeight: "150px"
|
|
35
|
-
},
|
|
36
|
-
padding: `0px ${theme.spacing(1)} ${theme.spacing(1)} ${theme.spacing(1)}`,
|
|
37
|
-
display: "inline-block",
|
|
38
|
-
backgroundColor: theme.palette.divider,
|
|
39
|
-
justifyContent: "center",
|
|
40
|
-
mask: `url(${src}) no-repeat center / contain`,
|
|
41
|
-
WebkitMask: `url(${src}) no-repeat center / contain`
|
|
19
|
+
const Img = styled(Image)(() => ({
|
|
20
|
+
display: "flex"
|
|
42
21
|
}));
|
|
43
22
|
const Label = styled("span")(({
|
|
44
23
|
theme
|
|
@@ -47,7 +26,18 @@ const Label = styled("span")(({
|
|
|
47
26
|
padding: `${theme.spacing(1.5)} ${theme.spacing(1)} ${theme.spacing(1)} ${theme.spacing(1)}`,
|
|
48
27
|
color: theme.palette.text.primary
|
|
49
28
|
}));
|
|
50
|
-
|
|
29
|
+
const WrapperSKTNoItemSelected = styled("div")(() => ({
|
|
30
|
+
display: "flex",
|
|
31
|
+
width: "100%",
|
|
32
|
+
minWidth: "100%",
|
|
33
|
+
minHeight: "230px",
|
|
34
|
+
mask: `url("data:image/svg+xml,%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 70 70' style='enable-background:new 0 0 70 70%3B' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M45 8.7c1.4-1.5 3.4-2.3 5.4-2.3s3.9 0.8 5.4 2.3s2.4 3.5 2.5 5.7c0 2.2-0.9 4.2-2.4 5.7s-3.5 2.3-5.5 2.2c-2.1 0.1-4-0.7-5.5-2.2c-1.4-1.5-2.3-3.5-2.4-5.7C42.6 12.2 43.5 10.2 45 8.7z'/%3E%3Cpath d='M68.4 62.1c-0.3 0.5-0.7 0.8-1.2 1.1s-1 0.4-1.6 0.4H4.3c-0.6 0-1.1-0.1-1.6-0.4s-0.9-0.6-1.2-1.1c-0.2-0.5-0.4-1-0.4-1.5s0.1-1.1 0.4-1.5l23-36.4c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l11.5 18.2c0.2 0.3 0.5 0.5 0.8 0.7c0.3 0.2 0.6 0.3 1 0.3c0.3 0 0.7-0.1 1-0.3c0.3-0.2 0.6-0.4 0.8-0.7l3.1-4.9c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l14.6 23.1c0.3 0.5 0.3 1 0.3 1.5S68.7 61.7 68.4 62.1z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain`,
|
|
35
|
+
WebkitMask: `url("data:image/svg+xml,%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 70 70' style='enable-background:new 0 0 70 70%3B' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M45 8.7c1.4-1.5 3.4-2.3 5.4-2.3s3.9 0.8 5.4 2.3s2.4 3.5 2.5 5.7c0 2.2-0.9 4.2-2.4 5.7s-3.5 2.3-5.5 2.2c-2.1 0.1-4-0.7-5.5-2.2c-1.4-1.5-2.3-3.5-2.4-5.7C42.6 12.2 43.5 10.2 45 8.7z'/%3E%3Cpath d='M68.4 62.1c-0.3 0.5-0.7 0.8-1.2 1.1s-1 0.4-1.6 0.4H4.3c-0.6 0-1.1-0.1-1.6-0.4s-0.9-0.6-1.2-1.1c-0.2-0.5-0.4-1-0.4-1.5s0.1-1.1 0.4-1.5l23-36.4c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l11.5 18.2c0.2 0.3 0.5 0.5 0.8 0.7c0.3 0.2 0.6 0.3 1 0.3c0.3 0 0.7-0.1 1-0.3c0.3-0.2 0.6-0.4 0.8-0.7l3.1-4.9c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l14.6 23.1c0.3 0.5 0.3 1 0.3 1.5S68.7 61.7 68.4 62.1z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain`
|
|
36
|
+
}));
|
|
37
|
+
function NoItemSelected(props) {
|
|
38
|
+
const {
|
|
39
|
+
isSkeleton
|
|
40
|
+
} = props;
|
|
51
41
|
const {
|
|
52
42
|
host_static_assets,
|
|
53
43
|
environment_assets
|
|
@@ -55,11 +45,28 @@ function NoItemSelected() {
|
|
|
55
45
|
const {
|
|
56
46
|
getLabel
|
|
57
47
|
} = useModuleDictionary();
|
|
58
|
-
const src =
|
|
48
|
+
const src = useMemo(() => {
|
|
49
|
+
return `${host_static_assets}/${environment_assets}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
|
|
50
|
+
}, []);
|
|
51
|
+
if (isSkeleton) {
|
|
52
|
+
return /* @__PURE__ */ jsx(WrapperNoItemSelected, {
|
|
53
|
+
id: "WrapperNoItemSelected",
|
|
54
|
+
children: /* @__PURE__ */ jsx(WrapperSKTNoItemSelected, {
|
|
55
|
+
id: "WrapperSKTNoItemSelected",
|
|
56
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
57
|
+
variant: "rectangular",
|
|
58
|
+
width: "100%",
|
|
59
|
+
height: "100%"
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
59
64
|
return /* @__PURE__ */ jsxs(WrapperNoItemSelected, {
|
|
60
|
-
id: "
|
|
61
|
-
children: [/* @__PURE__ */ jsx(
|
|
62
|
-
src
|
|
65
|
+
id: "WrapperNoItemSelected",
|
|
66
|
+
children: [/* @__PURE__ */ jsx(Img, {
|
|
67
|
+
src,
|
|
68
|
+
width: "100%",
|
|
69
|
+
height: "100%"
|
|
63
70
|
}), /* @__PURE__ */ jsx(Label, {
|
|
64
71
|
children: getLabel("no_item_selected.message")
|
|
65
72
|
})]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ImageProps } from './types';
|
|
3
2
|
export declare const WrapperNoItemSelected: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
|
-
export declare const
|
|
3
|
+
export declare const Img: import("@emotion/styled").StyledComponent<import("../Image/types").Props & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
5
4
|
export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
5
|
+
export declare const WrapperSKTNoItemSelected: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { Props } from '../Image/types';
|
|
1
2
|
export interface NoItemSelectedProps {
|
|
3
|
+
isSkeleton: boolean;
|
|
2
4
|
}
|
|
3
|
-
export interface
|
|
5
|
+
export interface WrapperSKTNoItemSelectedProps {
|
|
6
|
+
src: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ImageProps extends Props {
|
|
4
9
|
src: string;
|
|
5
10
|
}
|
|
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback, useMemo } from "react";
|
|
|
2
2
|
import { useNetwork, useModuleDictionary, useEnvironment, usePaginate } from "@m4l/core";
|
|
3
3
|
import { styled } from "@mui/material/styles";
|
|
4
4
|
import { D as DataGrid } from "../DataGrid/index.js";
|
|
5
|
-
import { D as DateFormatter } from "../
|
|
5
|
+
import { D as DateFormatter } from "../formatters/DateFormatter/index.js";
|
|
6
6
|
import { Tooltip, IconButton } from "@mui/material";
|
|
7
7
|
import { R as ReactJson } from "../../react-json-view.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -79,6 +79,10 @@ function DetailDialog(props) {
|
|
|
79
79
|
return /* @__PURE__ */ jsx(Container, {
|
|
80
80
|
id: "objectLogsDetail",
|
|
81
81
|
children: /* @__PURE__ */ jsx(ReactJson, {
|
|
82
|
+
name: null,
|
|
83
|
+
sortKeys: true,
|
|
84
|
+
displayDataTypes: false,
|
|
85
|
+
quotesOnKeys: false,
|
|
82
86
|
src: detail
|
|
83
87
|
})
|
|
84
88
|
});
|
|
@@ -102,8 +106,8 @@ function DetailFormatter(props) {
|
|
|
102
106
|
openModal({
|
|
103
107
|
onQueryClose: () => closeModal(),
|
|
104
108
|
title: getLabel("object_logs.modal_detail_title"),
|
|
105
|
-
iconComponent: /* @__PURE__ */ jsx(
|
|
106
|
-
|
|
109
|
+
iconComponent: /* @__PURE__ */ jsx(Icon, {
|
|
110
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/search.svg`
|
|
107
111
|
}),
|
|
108
112
|
contentComponent: /* @__PURE__ */ jsx(DetailDialog, {
|
|
109
113
|
log_id
|
|
@@ -125,7 +129,6 @@ function ObjectLogs(props) {
|
|
|
125
129
|
const {
|
|
126
130
|
getLabel
|
|
127
131
|
} = useModuleDictionary();
|
|
128
|
-
useEnvironment();
|
|
129
132
|
const {
|
|
130
133
|
resource_id,
|
|
131
134
|
object_id
|
|
@@ -136,7 +139,7 @@ function ObjectLogs(props) {
|
|
|
136
139
|
});
|
|
137
140
|
const dateFormatterCreatedAt = useCallback((rowProps) => /* @__PURE__ */ jsx(DateFormatter, {
|
|
138
141
|
presentationType: "datetime",
|
|
139
|
-
|
|
142
|
+
value: rowProps.row.created_at
|
|
140
143
|
}), []);
|
|
141
144
|
const DetailRowFormatter = useCallback((rowProps) => /* @__PURE__ */ jsx(DetailFormatter, {
|
|
142
145
|
log_id: rowProps.row.id
|
|
@@ -184,13 +187,12 @@ function ObjectLogs(props) {
|
|
|
184
187
|
useEffect(() => {
|
|
185
188
|
clearRows();
|
|
186
189
|
}, [object_id]);
|
|
187
|
-
const onChangeFilter = (
|
|
190
|
+
const onChangeFilter = (_initFilters, rawFilters) => {
|
|
188
191
|
setQueryParams({
|
|
189
192
|
resource_id,
|
|
190
193
|
object_id,
|
|
191
194
|
f: rawFilters
|
|
192
195
|
});
|
|
193
|
-
console.log("filter was change*****", JSON.stringify(rawFilters));
|
|
194
196
|
};
|
|
195
197
|
return /* @__PURE__ */ jsxs(Container$1, {
|
|
196
198
|
children: [/* @__PURE__ */ jsx(Actions, {
|
|
@@ -95,6 +95,8 @@ const SplitMaster = styled("div")(() => ({
|
|
|
95
95
|
const SplitDetail = styled("div")(() => ({
|
|
96
96
|
display: "flex",
|
|
97
97
|
flexDirection: "column",
|
|
98
|
+
justifyContent: "center",
|
|
99
|
+
alignItems: "center",
|
|
98
100
|
overflow: "hidden",
|
|
99
101
|
position: "absolute",
|
|
100
102
|
left: "0px",
|
|
@@ -121,7 +123,7 @@ function SplitLayout(props) {
|
|
|
121
123
|
id: "splitMaster",
|
|
122
124
|
children: typeof firstPart === "function" ? firstPart() : firstPart
|
|
123
125
|
}), splitPosition !== "none" && /* @__PURE__ */ jsx(SplitDetail, {
|
|
124
|
-
id: "
|
|
126
|
+
id: "detail2",
|
|
125
127
|
children: typeof secondPart === "function" ? secondPart() : secondPart
|
|
126
128
|
})]
|
|
127
129
|
})
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import require$$0 from "react";
|
|
2
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
3
|
+
import { Checkbox } from "@mui/material";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function BooleanFormatter(props) {
|
|
6
|
+
const {
|
|
7
|
+
presentationType,
|
|
8
|
+
value,
|
|
9
|
+
Component = require$$0.Fragment
|
|
10
|
+
} = props;
|
|
11
|
+
const {
|
|
12
|
+
getLabel
|
|
13
|
+
} = useModuleDictionary();
|
|
14
|
+
if (presentationType === "string_yes_no") {
|
|
15
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
16
|
+
children: value ? getLabel("formatters.boolean_yes") : getLabel("formatters.boolean_no")
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
if (presentationType === "string_true_false") {
|
|
20
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
21
|
+
children: value ? getLabel("formatters.boolean_true") : getLabel("formatters.boolean_false")
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsx(Checkbox, {
|
|
25
|
+
checked: value !== void 0 ? value : false,
|
|
26
|
+
size: "small",
|
|
27
|
+
readOnly: true,
|
|
28
|
+
disableFocusRipple: true,
|
|
29
|
+
disableRipple: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export { BooleanFormatter as B };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ComponentForrmaterType } from '../types';
|
|
1
2
|
export declare type PresentationType = 'string_yes_no' | 'string_true_false' | 'check';
|
|
2
3
|
export interface BooleanFormatterProps {
|
|
4
|
+
Component?: ComponentForrmaterType;
|
|
3
5
|
presentationType: PresentationType;
|
|
4
6
|
value: boolean;
|
|
5
7
|
}
|
|
File without changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useEnvironment } from "@m4l/core";
|
|
2
|
+
import { format } from "date-fns";
|
|
3
|
+
import require$$0 from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function DateFormatter(props) {
|
|
6
|
+
const {
|
|
7
|
+
presentationType,
|
|
8
|
+
value,
|
|
9
|
+
format: format$1,
|
|
10
|
+
Component = require$$0.Fragment
|
|
11
|
+
} = props;
|
|
12
|
+
const {
|
|
13
|
+
dfnsFormat
|
|
14
|
+
} = useEnvironment();
|
|
15
|
+
let finalFormat = format$1 || dfnsFormat.datetime_format;
|
|
16
|
+
let result;
|
|
17
|
+
let resultDate;
|
|
18
|
+
switch (presentationType) {
|
|
19
|
+
case "datetime":
|
|
20
|
+
finalFormat = format$1 || dfnsFormat.datetime_format;
|
|
21
|
+
break;
|
|
22
|
+
case "date":
|
|
23
|
+
finalFormat = format$1 || dfnsFormat.date_format;
|
|
24
|
+
break;
|
|
25
|
+
case "time":
|
|
26
|
+
finalFormat = format$1 || dfnsFormat.time_format;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
if (typeof value === "number" || typeof value === "string") {
|
|
31
|
+
resultDate = new Date(value);
|
|
32
|
+
} else {
|
|
33
|
+
resultDate = value;
|
|
34
|
+
}
|
|
35
|
+
result = format(resultDate, finalFormat);
|
|
36
|
+
} catch (e) {
|
|
37
|
+
result = "err_typing";
|
|
38
|
+
}
|
|
39
|
+
switch (Component) {
|
|
40
|
+
case "div":
|
|
41
|
+
return /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: "DateFormatter",
|
|
43
|
+
children: result
|
|
44
|
+
});
|
|
45
|
+
case "span":
|
|
46
|
+
return /* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: "DateFormatter",
|
|
48
|
+
children: result
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
52
|
+
children: result
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export { DateFormatter as D };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ComponentForrmaterType } from '../types';
|
|
1
2
|
export declare type PresentationType = 'date' | 'datetime' | 'time';
|
|
2
3
|
export interface DateFormatterProps {
|
|
4
|
+
Component?: ComponentForrmaterType;
|
|
3
5
|
presentationType: PresentationType;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
format?: string;
|
|
7
|
+
value: Date | string | number;
|
|
6
8
|
}
|
|
File without changes
|
|
@@ -2,8 +2,8 @@ export * from '../components/animate';
|
|
|
2
2
|
export * from '../components/hook-form';
|
|
3
3
|
export * from '../components/mui_extended';
|
|
4
4
|
export * from '../components/CompanyLogo';
|
|
5
|
+
export * from './formatters';
|
|
5
6
|
export { DataGrid } from '../components/DataGrid';
|
|
6
|
-
export { DateFormatter, BooleanFormatter } from '../components/DataGrid/formatters';
|
|
7
7
|
export type { Column } from 'react-data-grid';
|
|
8
8
|
export type { RowKey } from '../components/DataGrid/types';
|
|
9
9
|
export { getGridComponentsDictionary } from '../components/DataGrid/dictionary';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconButtonProps as MUIIconButtonProps } from '@mui/material';
|
|
3
3
|
import { IconButtonProps } from './types';
|
|
4
|
-
export declare function IconButton({ src, tooltip, size, dictionaryTooltip, ...other }: IconButtonProps & MUIIconButtonProps): JSX.Element;
|
|
4
|
+
export declare function IconButton({ src, tooltip, size, dictionaryTooltip, bgColor, ...other }: IconButtonProps & MUIIconButtonProps): JSX.Element;
|
|
5
5
|
export default IconButton;
|
|
@@ -64,6 +64,7 @@ function IconButton({
|
|
|
64
64
|
tooltip,
|
|
65
65
|
size = "small",
|
|
66
66
|
dictionaryTooltip,
|
|
67
|
+
bgColor = "active",
|
|
67
68
|
...other
|
|
68
69
|
}) {
|
|
69
70
|
const {
|
|
@@ -72,15 +73,17 @@ function IconButton({
|
|
|
72
73
|
const iconMemo = useMemo(() => {
|
|
73
74
|
console.log("IconButton", size, other, src);
|
|
74
75
|
return /* @__PURE__ */ jsx(Icon, {
|
|
75
|
-
src
|
|
76
|
+
src,
|
|
77
|
+
bgColor: other.disabled ? "disabled" : bgColor
|
|
76
78
|
});
|
|
77
|
-
}, [src]);
|
|
79
|
+
}, [src, bgColor, other.disabled]);
|
|
78
80
|
const finalTooltip = useMemo(() => {
|
|
79
81
|
if (dictionaryTooltip && getLabel) {
|
|
80
82
|
return getLabel(dictionaryTooltip);
|
|
81
83
|
}
|
|
82
84
|
return tooltip;
|
|
83
85
|
}, [dictionaryTooltip, tooltip, getLabel]);
|
|
86
|
+
console.log("icon button test validation disabled", other.disabled ? "disabled" : bgColor);
|
|
84
87
|
if (finalTooltip && !other.disabled) {
|
|
85
88
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
86
89
|
title: finalTooltip,
|
|
@@ -38,9 +38,12 @@ function PagerActions(props) {
|
|
|
38
38
|
const handleLastPageButtonClick = (event) => {
|
|
39
39
|
onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
|
40
40
|
};
|
|
41
|
+
console.log("validaci\xF3n pager action 1", page === 0);
|
|
42
|
+
console.log("validaci\xF3n pager action 2", page >= Math.ceil(count / rowsPerPage) - 1);
|
|
41
43
|
return /* @__PURE__ */ jsxs(WrapperPagerActions, {
|
|
42
44
|
id: "WrapperPagerActions",
|
|
43
45
|
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
46
|
+
id: "test_bruce",
|
|
44
47
|
dictionaryTooltip: "pager.first",
|
|
45
48
|
onClick: handleFirstPageButtonClick,
|
|
46
49
|
disabled: page === 0,
|