@m4l/components 0.0.34 → 0.0.37
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 +2 -3
- package/dist/components/DataGrid/index.js +21 -21
- package/dist/components/DynamicFilter/components/ApplyedFilters/styles.d.ts +1 -0
- 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 +1 -1
- package/dist/components/DynamicFilter/index.js +369 -159
- package/dist/components/DynamicFilter/types.d.ts +4 -2
- package/dist/components/Icon/index.js +69 -11
- package/dist/components/Icon/styles.d.ts +2 -0
- package/dist/components/Icon/types.d.ts +3 -2
- package/dist/components/ModalDialog/index.js +9 -9
- package/dist/components/NoItemSelected/index.js +2 -3
- package/dist/components/ObjectLogs/index.js +18 -5
- package/dist/components/PaperForm/index.js +4 -7
- package/dist/components/PropertyValue/index.js +32 -5
- package/dist/components/PropertyValue/styles.d.ts +2 -2
- package/dist/components/PropertyValue/types.d.ts +10 -3
- package/dist/components/hook-form/RHFDateTime.js +9 -2
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/styles.d.ts +7 -0
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +2 -0
- package/dist/components/hook-form/RHFUpload.js +111 -33
- package/dist/components/mui_extended/Accordion/index.js +2 -2
- package/dist/components/mui_extended/IconButton/index.d.ts +1 -1
- package/dist/components/mui_extended/IconButton/index.js +19 -10
- package/dist/components/mui_extended/IconButton/types.d.ts +2 -1
- package/dist/components/mui_extended/MenuActions/index.js +8 -10
- package/dist/components/mui_extended/Pager/index.js +5 -5
- package/dist/contexts/ModalContext/index.js +4 -4
- package/dist/vendor.js +2 -2
- package/package.json +2 -5
- 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
2
|
export declare type FieldType = 'number' | 'string' | 'boolean' | 'date' | 'datetime' | 'time' | 'select' | 'in';
|
|
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';
|
|
@@ -32,7 +34,7 @@ export interface BaseApplyFilter {
|
|
|
32
34
|
export interface ValuesFilter {
|
|
33
35
|
operator: Operator;
|
|
34
36
|
labelOperator: string;
|
|
35
|
-
labelOperands: string;
|
|
37
|
+
labelOperands: string | number;
|
|
36
38
|
operand1?: Maybe<OperandType>;
|
|
37
39
|
operand2?: Maybe<OperandType>;
|
|
38
40
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { styled } from "@mui/material";
|
|
1
|
+
import { styled, useTheme } from "@mui/material";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
const MaskIcon = styled("div", {
|
|
4
5
|
shouldForwardProp: (props) => props !== "src" && props !== "width" && props !== "height" && props !== "bgColor"
|
|
@@ -7,22 +8,79 @@ const MaskIcon = styled("div", {
|
|
|
7
8
|
mask: `url(${props.src}) no-repeat`,
|
|
8
9
|
width: props.width === void 0 ? "20px" : props.width,
|
|
9
10
|
height: props.height === void 0 ? "20px" : props.height,
|
|
10
|
-
backgroundColor: props.bgColor
|
|
11
|
+
backgroundColor: props.bgColor
|
|
12
|
+
}));
|
|
13
|
+
const WrapperPlaceHolder = styled("div", {
|
|
14
|
+
shouldForwardProp: (props) => props !== "widht" && props !== "height"
|
|
15
|
+
})((props) => ({
|
|
16
|
+
display: "flex",
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
width: props.width,
|
|
20
|
+
height: props.height
|
|
11
21
|
}));
|
|
12
22
|
function Icon(props) {
|
|
13
23
|
const {
|
|
14
|
-
src = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/commons/assets/icons/default.svg",
|
|
15
|
-
width = "20px",
|
|
16
|
-
height = "20px",
|
|
17
|
-
bgColor = "active",
|
|
18
|
-
onClick
|
|
19
|
-
} = props;
|
|
20
|
-
return /* @__PURE__ */ jsx(MaskIcon, {
|
|
21
24
|
src,
|
|
25
|
+
width = "16px",
|
|
26
|
+
height = "16px",
|
|
27
|
+
bgColor = "active"
|
|
28
|
+
} = props;
|
|
29
|
+
const [resource, setResource] = useState(void 0);
|
|
30
|
+
const theme = useTheme();
|
|
31
|
+
const getBgColor = () => {
|
|
32
|
+
if (bgColor === "active") {
|
|
33
|
+
return theme.palette.action.active;
|
|
34
|
+
}
|
|
35
|
+
if (bgColor === "selected") {
|
|
36
|
+
return theme.palette.primary.main;
|
|
37
|
+
}
|
|
38
|
+
if (bgColor === "info") {
|
|
39
|
+
return theme.palette.info.main;
|
|
40
|
+
}
|
|
41
|
+
if (bgColor === "warning") {
|
|
42
|
+
return theme.palette.warning.main;
|
|
43
|
+
}
|
|
44
|
+
if (bgColor === "error") {
|
|
45
|
+
return theme.palette.error.main;
|
|
46
|
+
}
|
|
47
|
+
if (bgColor === "disabled") {
|
|
48
|
+
return theme.palette.action.disabled;
|
|
49
|
+
}
|
|
50
|
+
return bgColor;
|
|
51
|
+
};
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
let mounted = true;
|
|
54
|
+
if (resource)
|
|
55
|
+
return;
|
|
56
|
+
(async function networkOperation() {
|
|
57
|
+
await fetch(src).then((response) => {
|
|
58
|
+
if (mounted) {
|
|
59
|
+
console.log("Icon***", response.body);
|
|
60
|
+
setResource(response.url);
|
|
61
|
+
}
|
|
62
|
+
}).catch((_err) => {
|
|
63
|
+
});
|
|
64
|
+
})();
|
|
65
|
+
return function clenUp() {
|
|
66
|
+
console.log("CleanUP", "Icon");
|
|
67
|
+
mounted = false;
|
|
68
|
+
};
|
|
69
|
+
}, []);
|
|
70
|
+
const placeHolder = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDcwIDcwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA3MCA3MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM2MzczODE7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00NSw4LjdjMS40LTEuNSwzLjQtMi4zLDUuNC0yLjNzMy45LDAuOCw1LjQsMi4zczIuNCwzLjUsMi41LDUuN2MwLDIuMi0wLjksNC4yLTIuNCw1LjdzLTMuNSwyLjMtNS41LDIuMgoJCWMtMi4xLDAuMS00LTAuNy01LjUtMi4yYy0xLjQtMS41LTIuMy0zLjUtMi40LTUuN0M0Mi42LDEyLjIsNDMuNSwxMC4yLDQ1LDguN3oiLz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02OC40LDYyLjFjLTAuMywwLjUtMC43LDAuOC0xLjIsMS4xcy0xLDAuNC0xLjYsMC40SDQuM2MtMC42LDAtMS4xLTAuMS0xLjYtMC40cy0wLjktMC42LTEuMi0xLjEKCQljLTAuMi0wLjUtMC40LTEtMC40LTEuNXMwLjEtMS4xLDAuNC0xLjVsMjMtMzYuNGMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNHMwLjksMC42LDEuMiwxLjEKCQlsMTEuNSwxOC4yYzAuMiwwLjMsMC41LDAuNSwwLjgsMC43czAuNiwwLjMsMSwwLjNjMC4zLDAsMC43LTAuMSwxLTAuM3MwLjYtMC40LDAuOC0wLjdsMy4xLTQuOWMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMQoJCXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNGMwLjUsMC4zLDAuOSwwLjYsMS4yLDEuMWwxNC42LDIzLjFjMC4zLDAuNSwwLjMsMSwwLjMsMS41UzY4LjcsNjEuNyw2OC40LDYyLjF6Ii8+CjwvZz4KPC9zdmc+Cg==";
|
|
71
|
+
return /* @__PURE__ */ jsx(WrapperPlaceHolder, {
|
|
72
|
+
id: "IconReact",
|
|
22
73
|
width,
|
|
23
74
|
height,
|
|
24
|
-
|
|
25
|
-
|
|
75
|
+
children: resource ? /* @__PURE__ */ jsx(MaskIcon, {
|
|
76
|
+
src: resource,
|
|
77
|
+
width,
|
|
78
|
+
height,
|
|
79
|
+
bgColor: getBgColor()
|
|
80
|
+
}) : /* @__PURE__ */ jsx("img", {
|
|
81
|
+
src: placeHolder,
|
|
82
|
+
alt: "icon_svg"
|
|
83
|
+
})
|
|
26
84
|
});
|
|
27
85
|
}
|
|
28
86
|
export { Icon as I };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { WrapperPlaceHolderProps } from './types';
|
|
2
3
|
export declare const MaskIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("./types").OwnProps & import("react").HTMLProps<HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
|
+
export declare const WrapperPlaceHolder: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & WrapperPlaceHolderProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { HTMLProps } from 'react';
|
|
2
2
|
export interface OwnProps {
|
|
3
|
-
src: string
|
|
3
|
+
src: string;
|
|
4
4
|
width?: number | string;
|
|
5
5
|
height?: number | string;
|
|
6
|
-
bgColor?: string | 'info' | 'warning' | 'error' | 'active' | 'disabled';
|
|
6
|
+
bgColor?: string | 'info' | 'warning' | 'error' | 'active' | 'selected' | 'disabled';
|
|
7
7
|
}
|
|
8
|
+
export declare type WrapperPlaceHolderProps = Pick<OwnProps, 'width' | 'height'>;
|
|
8
9
|
export declare type IconProps = OwnProps & HTMLProps<HTMLDivElement>;
|
|
@@ -6,7 +6,7 @@ import { a as getThemeVariantColor } from "../../vendor.js";
|
|
|
6
6
|
import { R as Resizeable } from "../Resizeable/index.js";
|
|
7
7
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
8
8
|
import { useEnvironment } from "@m4l/core";
|
|
9
|
-
import {
|
|
9
|
+
import { I as Icon } from "../Icon/index.js";
|
|
10
10
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
11
11
|
import { F as FormActions, g as getActionnsComponentsDictionary } from "../FormActions/index.js";
|
|
12
12
|
const WrapperDialog = styled(Dialog)(() => ({}));
|
|
@@ -54,7 +54,7 @@ const ModalTitle = styled("div")(({ theme, variant }) => ({
|
|
|
54
54
|
const Header = (props) => {
|
|
55
55
|
const {
|
|
56
56
|
host_static_assets,
|
|
57
|
-
|
|
57
|
+
environment_assets
|
|
58
58
|
} = useEnvironment();
|
|
59
59
|
const {
|
|
60
60
|
variant,
|
|
@@ -63,17 +63,17 @@ const Header = (props) => {
|
|
|
63
63
|
withClose,
|
|
64
64
|
onCloseModal
|
|
65
65
|
} = props;
|
|
66
|
-
const iconSrcWarning = `${host_static_assets}/${
|
|
67
|
-
const iconSrcError = `${host_static_assets}/${
|
|
68
|
-
const iconSrcInfo = `${host_static_assets}/${
|
|
69
|
-
const iconDefault = `${host_static_assets}/${
|
|
66
|
+
const iconSrcWarning = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/warning.svg`;
|
|
67
|
+
const iconSrcError = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/error.svg`;
|
|
68
|
+
const iconSrcInfo = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/info.svg`;
|
|
69
|
+
const iconDefault = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/icon_bar_tittle.svg`;
|
|
70
70
|
return /* @__PURE__ */ jsxs(Header$1, {
|
|
71
71
|
id: "Header",
|
|
72
72
|
children: [/* @__PURE__ */ jsxs(IconTitleContainer, {
|
|
73
73
|
className: "draggable-dialog-title",
|
|
74
74
|
children: [/* @__PURE__ */ jsx(IconHeader, {
|
|
75
75
|
variant,
|
|
76
|
-
children: !iconComponent ? /* @__PURE__ */ jsx(
|
|
76
|
+
children: !iconComponent ? /* @__PURE__ */ jsx(Icon, {
|
|
77
77
|
src: variant === "warning" ? iconSrcWarning : variant === "delete" ? iconSrcError : variant === "info" ? iconSrcInfo : iconDefault
|
|
78
78
|
}) : iconComponent
|
|
79
79
|
}), /* @__PURE__ */ jsx(ModalTitle, {
|
|
@@ -83,8 +83,8 @@ const Header = (props) => {
|
|
|
83
83
|
}), withClose && /* @__PURE__ */ jsx(IconButton, {
|
|
84
84
|
onClick: onCloseModal,
|
|
85
85
|
"aria-label": "click",
|
|
86
|
-
children: /* @__PURE__ */ jsx(
|
|
87
|
-
src: `${host_static_assets}/${
|
|
86
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
87
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/close.svg`
|
|
88
88
|
})
|
|
89
89
|
})]
|
|
90
90
|
});
|
|
@@ -19,7 +19,6 @@ const Image = styled("span", {
|
|
|
19
19
|
src,
|
|
20
20
|
theme
|
|
21
21
|
}) => ({
|
|
22
|
-
zIndex: 9,
|
|
23
22
|
top: 0,
|
|
24
23
|
height: "100%",
|
|
25
24
|
width: "100%",
|
|
@@ -50,12 +49,12 @@ const Label = styled("span")(({
|
|
|
50
49
|
function NoItemSelected() {
|
|
51
50
|
const {
|
|
52
51
|
host_static_assets,
|
|
53
|
-
|
|
52
|
+
environment_assets
|
|
54
53
|
} = useEnvironment();
|
|
55
54
|
const {
|
|
56
55
|
getLabel
|
|
57
56
|
} = useModuleDictionary();
|
|
58
|
-
const src = `${host_static_assets}/${
|
|
57
|
+
const src = `${host_static_assets}/${environment_assets}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
|
|
59
58
|
return /* @__PURE__ */ jsxs(WrapperNoItemSelected, {
|
|
60
59
|
id: "Wrapper",
|
|
61
60
|
children: [/* @__PURE__ */ jsx(Image, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
2
|
-
import { useNetwork, useModuleDictionary, usePaginate } from "@m4l/core";
|
|
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
5
|
import { D as DateFormatter } from "../DataGrid/formatters/DateFormatter/index.js";
|
|
@@ -7,6 +7,7 @@ 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";
|
|
9
9
|
import { u as useModal } from "../../hooks/useModal/index.js";
|
|
10
|
+
import { I as Icon } from "../Icon/index.js";
|
|
10
11
|
import { D as DynamicFilter } from "../DynamicFilter/index.js";
|
|
11
12
|
const Container$1 = styled("div")(() => ({
|
|
12
13
|
height: "100%",
|
|
@@ -19,7 +20,7 @@ const Actions = styled("div")(({
|
|
|
19
20
|
theme
|
|
20
21
|
}) => ({
|
|
21
22
|
position: "relative",
|
|
22
|
-
height: "
|
|
23
|
+
height: "auto",
|
|
23
24
|
display: "flex",
|
|
24
25
|
flexDirection: "row",
|
|
25
26
|
justifyContent: "flex-start",
|
|
@@ -93,6 +94,10 @@ function DetailFormatter(props) {
|
|
|
93
94
|
const {
|
|
94
95
|
getLabel
|
|
95
96
|
} = useModuleDictionary();
|
|
97
|
+
const {
|
|
98
|
+
host_static_assets,
|
|
99
|
+
environment_assets
|
|
100
|
+
} = useEnvironment();
|
|
96
101
|
const onClickDetail = () => {
|
|
97
102
|
openModal({
|
|
98
103
|
onQueryClose: () => closeModal(),
|
|
@@ -110,8 +115,8 @@ function DetailFormatter(props) {
|
|
|
110
115
|
children: /* @__PURE__ */ jsx(IconButton, {
|
|
111
116
|
onClick: onClickDetail,
|
|
112
117
|
"aria-label": "filter",
|
|
113
|
-
children: /* @__PURE__ */ jsx(
|
|
114
|
-
|
|
118
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
119
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/search.svg`
|
|
115
120
|
})
|
|
116
121
|
})
|
|
117
122
|
});
|
|
@@ -120,6 +125,7 @@ function ObjectLogs(props) {
|
|
|
120
125
|
const {
|
|
121
126
|
getLabel
|
|
122
127
|
} = useModuleDictionary();
|
|
128
|
+
useEnvironment();
|
|
123
129
|
const {
|
|
124
130
|
resource_id,
|
|
125
131
|
object_id
|
|
@@ -190,7 +196,7 @@ function ObjectLogs(props) {
|
|
|
190
196
|
children: [/* @__PURE__ */ jsx(Actions, {
|
|
191
197
|
id: "objectLogsActions",
|
|
192
198
|
children: /* @__PURE__ */ jsx(DynamicFilter, {
|
|
193
|
-
withAllField:
|
|
199
|
+
withAllField: true,
|
|
194
200
|
onChangeFilter,
|
|
195
201
|
automatic: false,
|
|
196
202
|
fields: [{
|
|
@@ -200,6 +206,13 @@ function ObjectLogs(props) {
|
|
|
200
206
|
multiple: false,
|
|
201
207
|
fixed: true,
|
|
202
208
|
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
|
|
209
|
+
}, {
|
|
210
|
+
name: "user_logs.log_detail",
|
|
211
|
+
label: getLabel("object_logs.log_detail"),
|
|
212
|
+
type: "string",
|
|
213
|
+
multiple: false,
|
|
214
|
+
fixed: false,
|
|
215
|
+
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
|
|
203
216
|
}],
|
|
204
217
|
initialFilters: []
|
|
205
218
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled, useTheme } from "@mui/material/styles";
|
|
2
2
|
import { Skeleton } from "@mui/material";
|
|
3
3
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { I as Icon } from "../Icon/index.js";
|
|
5
5
|
const WrapperPaper = styled("div")(({
|
|
6
6
|
theme
|
|
7
7
|
}) => ({
|
|
@@ -93,7 +93,7 @@ function PaperForm(props) {
|
|
|
93
93
|
children,
|
|
94
94
|
isSkeleton = false
|
|
95
95
|
} = props;
|
|
96
|
-
|
|
96
|
+
useTheme();
|
|
97
97
|
return /* @__PURE__ */ jsx(WrapperPaper, {
|
|
98
98
|
id: "ContainerPropertyValue",
|
|
99
99
|
children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, {
|
|
@@ -102,11 +102,8 @@ function PaperForm(props) {
|
|
|
102
102
|
children: /* @__PURE__ */ jsxs(IconTitleContainer, {
|
|
103
103
|
className: "draggable-dialog-title",
|
|
104
104
|
children: [/* @__PURE__ */ jsx(IconHeader, {
|
|
105
|
-
children: /* @__PURE__ */ jsx(
|
|
106
|
-
src: urlIcon
|
|
107
|
-
sx: {
|
|
108
|
-
color: theme.palette.action.active
|
|
109
|
-
}
|
|
105
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
106
|
+
src: urlIcon
|
|
110
107
|
})
|
|
111
108
|
}), tittle]
|
|
112
109
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
2
|
import { Skeleton } from "@mui/material";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
4
5
|
const WrapperPropertyValue = styled("div", {
|
|
5
6
|
shouldForwardProp: (prop) => prop !== "propertyWidth" && prop !== "propertyHeight" && prop !== "isForm"
|
|
6
7
|
})(({
|
|
@@ -12,7 +13,7 @@ const WrapperPropertyValue = styled("div", {
|
|
|
12
13
|
alignItems: "flex-start",
|
|
13
14
|
width: "100%",
|
|
14
15
|
padding: `${theme.spacing(1)} ${theme.spacing(2)}`,
|
|
15
|
-
|
|
16
|
+
maxHeight: propertyHeight || "auto",
|
|
16
17
|
":hover": {
|
|
17
18
|
backgroundColor: isForm ? "unset" : theme.palette.grid?.rowHover
|
|
18
19
|
},
|
|
@@ -44,8 +45,9 @@ const Property = styled("span", {
|
|
|
44
45
|
overflowWrap: "break-word"
|
|
45
46
|
}));
|
|
46
47
|
const Value = styled("div", {
|
|
47
|
-
shouldForwardProp: (prop) => prop !== "propertyWidth" && prop !== "propertyHeight"
|
|
48
|
+
shouldForwardProp: (prop) => prop !== "propertyWidth" && prop !== "propertyHeight" && prop !== "valueWidth"
|
|
48
49
|
})(({
|
|
50
|
+
width,
|
|
49
51
|
propertyHeight,
|
|
50
52
|
theme
|
|
51
53
|
}) => ({
|
|
@@ -54,9 +56,9 @@ const Value = styled("div", {
|
|
|
54
56
|
color: theme.palette.text.secondary,
|
|
55
57
|
position: "relative",
|
|
56
58
|
padding: "1px",
|
|
57
|
-
|
|
59
|
+
width: width ? `${width}%` : "100%",
|
|
60
|
+
height: propertyHeight ? propertyHeight : "auto",
|
|
58
61
|
marginTop: theme.spacing(1),
|
|
59
|
-
width: "100%",
|
|
60
62
|
[theme.breakpoints.up("sm")]: {
|
|
61
63
|
marginLeft: theme.spacing(2),
|
|
62
64
|
marginTop: "0px"
|
|
@@ -83,9 +85,34 @@ function PropertyValue(props) {
|
|
|
83
85
|
value,
|
|
84
86
|
propertyWidth,
|
|
85
87
|
propertyHeight,
|
|
88
|
+
valueWidth = "100",
|
|
86
89
|
isForm,
|
|
87
90
|
isSkeleton = false
|
|
88
91
|
} = props;
|
|
92
|
+
const isDesktop = useResponsiveDesktop();
|
|
93
|
+
console.log("valueWidth", valueWidth);
|
|
94
|
+
const getValueW = () => {
|
|
95
|
+
if (valueWidth === "75" && isDesktop) {
|
|
96
|
+
return "75";
|
|
97
|
+
} else if (valueWidth === "75" && !isDesktop) {
|
|
98
|
+
return "100";
|
|
99
|
+
}
|
|
100
|
+
if (valueWidth === "50" && isDesktop) {
|
|
101
|
+
return "50";
|
|
102
|
+
} else if (valueWidth === "50" && !isDesktop) {
|
|
103
|
+
return "100";
|
|
104
|
+
}
|
|
105
|
+
if (valueWidth === "25" && isDesktop || valueWidth === "12.5" && isDesktop) {
|
|
106
|
+
return parseFloat(valueWidth).toString(10);
|
|
107
|
+
} else if (valueWidth === "25" && !isDesktop || valueWidth === "12.5" && !isDesktop) {
|
|
108
|
+
return (parseFloat(valueWidth) * 2).toString(10);
|
|
109
|
+
}
|
|
110
|
+
console.log("valueWidth in function", valueWidth);
|
|
111
|
+
return "100";
|
|
112
|
+
};
|
|
113
|
+
const valueW = getValueW();
|
|
114
|
+
console.log("valueWidth in function", valueWidth);
|
|
115
|
+
console.log("getValueW", typeof getValueW(), getValueW());
|
|
89
116
|
return /* @__PURE__ */ jsxs(WrapperPropertyValue, {
|
|
90
117
|
id: "ContainerPropertyValue",
|
|
91
118
|
isForm,
|
|
@@ -99,7 +126,7 @@ function PropertyValue(props) {
|
|
|
99
126
|
children: isSkeleton ? /* @__PURE__ */ jsx(SKTProperty, {}) : property
|
|
100
127
|
}), /* @__PURE__ */ jsx(Value, {
|
|
101
128
|
id: "Value",
|
|
102
|
-
|
|
129
|
+
width: valueW,
|
|
103
130
|
propertyHeight,
|
|
104
131
|
children: value
|
|
105
132
|
})]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PropertyProps } from './types';
|
|
2
|
+
import { PropertyProps, ValueProps } from './types';
|
|
3
3
|
export declare const WrapperPropertyValue: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PropertyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
4
|
export declare const Property: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PropertyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
5
|
-
export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> &
|
|
5
|
+
export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & ValueProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
6
|
export declare const SKTWrapperProperty: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export interface PropertyProps {
|
|
3
3
|
propertyWidth?: number;
|
|
4
|
-
propertyHeight?: number;
|
|
4
|
+
propertyHeight?: number | string;
|
|
5
5
|
isForm?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
8
|
-
|
|
7
|
+
export interface ValueProps {
|
|
8
|
+
width: string;
|
|
9
|
+
propertyHeight?: number | string;
|
|
10
|
+
}
|
|
11
|
+
export interface PropertyValueProps extends PropertyProps, ValueTypeProps {
|
|
9
12
|
property: string;
|
|
13
|
+
isSkeleton?: boolean;
|
|
10
14
|
value: number | string | ReactNode;
|
|
11
15
|
}
|
|
16
|
+
export interface ValueTypeProps {
|
|
17
|
+
valueWidth?: '100' | '75' | '50' | '25' | '12.5';
|
|
18
|
+
}
|
|
@@ -2,6 +2,7 @@ import { useFormContext, Controller } from "react-hook-form";
|
|
|
2
2
|
import { Skeleton, TextField } from "@mui/material";
|
|
3
3
|
import { styled } from "@mui/material/styles";
|
|
4
4
|
import { DateTimePicker } from "@mui/x-date-pickers";
|
|
5
|
+
import { useEnvironment } from "@m4l/core";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
const SKTRHFWrapperTextField = styled("div")(({
|
|
7
8
|
theme
|
|
@@ -27,6 +28,12 @@ function RHFDateTime(props) {
|
|
|
27
28
|
const {
|
|
28
29
|
control
|
|
29
30
|
} = useFormContext();
|
|
31
|
+
const {
|
|
32
|
+
dfnsFormat: {
|
|
33
|
+
datetime_format,
|
|
34
|
+
datetime_mask
|
|
35
|
+
}
|
|
36
|
+
} = useEnvironment();
|
|
30
37
|
if (isSkeleton) {
|
|
31
38
|
return /* @__PURE__ */ jsx(SKTRHFWrapperTextField, {
|
|
32
39
|
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
@@ -47,8 +54,8 @@ function RHFDateTime(props) {
|
|
|
47
54
|
}) => {
|
|
48
55
|
return /* @__PURE__ */ jsx(DateTimePicker, {
|
|
49
56
|
ampm: false,
|
|
50
|
-
inputFormat:
|
|
51
|
-
mask:
|
|
57
|
+
inputFormat: datetime_format,
|
|
58
|
+
mask: datetime_mask,
|
|
52
59
|
label: "",
|
|
53
60
|
value: field.value,
|
|
54
61
|
onChange: (value) => {
|
package/dist/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/styles.d.ts
CHANGED
|
@@ -2,3 +2,10 @@
|
|
|
2
2
|
export declare const RootStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
3
|
export declare const DropZoneStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
4
|
export declare const PlaceholderStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
|
+
export declare const ContainerUploadBody: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Containermessage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
export declare const ContainerTitle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
8
|
+
export declare const ContainerDescription: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
9
|
+
export declare const ContainerConditions: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
10
|
+
export declare const WrapperImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
+
export declare const ContainerPlaceHolder: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const WrapperRHFUploadImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|