@m4l/components 0.0.26 → 0.0.31
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 +14 -11
- package/dist/components/DynamicFilter/components/ApplyedFilters/components/ApplyedFilter/index.d.ts +3 -0
- package/dist/components/DynamicFilter/components/ApplyedFilters/components/ApplyedFilter/styles.d.ts +6 -0
- package/dist/components/DynamicFilter/components/ApplyedFilters/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/ApplyedFilters/styles.d.ts +2 -0
- package/dist/components/DynamicFilter/components/ClearFilters/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/ClearFilters/styles.d.ts +3 -0
- package/dist/components/DynamicFilter/components/FilterButton/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/FilterButton/styles.d.ts +4 -0
- package/dist/components/DynamicFilter/components/InputFilter/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/InputFilter/styles.d.ts +3 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/BooleanFilter/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/BooleanFilter/styles.d.ts +3 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/DateTimeFilter/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/DateTimeFilter/styles.d.ts +3 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/StringFilter/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/StringFilter/styles.d.ts +3 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/factory.d.ts +6 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/components/validations.d.ts +5 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/index.d.ts +2 -0
- package/dist/components/DynamicFilter/components/PopupEditFilter/styles.d.ts +5 -0
- package/dist/components/DynamicFilter/contexts/BaseContext/index.d.ts +5 -0
- package/dist/components/DynamicFilter/contexts/BaseContext/types.d.ts +42 -0
- package/dist/components/DynamicFilter/hooks/useFilter.d.ts +1 -0
- package/dist/components/DynamicFilter/index.d.ts +3 -0
- package/dist/components/DynamicFilter/index.js +1392 -0
- package/dist/components/DynamicFilter/styles.d.ts +8 -0
- package/dist/components/DynamicFilter/types.d.ts +65 -0
- package/dist/components/FormActions/index.js +2 -1
- package/dist/components/FormActions/types.d.ts +2 -2
- package/dist/components/Icon/index.js +4 -2
- package/dist/components/Icon/styles.d.ts +1 -2
- package/dist/components/Icon/types.d.ts +4 -2
- package/dist/components/Image/index.js +1 -2
- package/dist/components/ModalDialog/dictionary.d.ts +1 -1
- package/dist/components/ModalDialog/index.js +3 -2
- package/dist/components/ModalDialog/types.d.ts +2 -1
- package/dist/components/ObjectLogs/index.js +51 -98
- package/dist/components/ObjectLogs/types.d.ts +0 -2
- package/dist/components/ScrollBar/index.d.ts +6 -3
- package/dist/components/ScrollBar/index.js +7 -15
- package/dist/components/hook-form/FormProvider/index.js +0 -1
- package/dist/components/hook-form/RHFAutocomplete/index.d.ts +4 -0
- package/dist/components/hook-form/RHFAutocomplete/styles.d.ts +5 -0
- package/dist/components/hook-form/RHFAutocomplete/types.d.ts +13 -0
- package/dist/components/hook-form/RHFAutocompleteAsync/index.js +0 -2
- package/dist/components/hook-form/RHFDateTime/index.d.ts +4 -0
- package/dist/components/hook-form/RHFDateTime/styles.d.ts +2 -0
- package/dist/components/hook-form/RHFDateTime/types.d.ts +9 -0
- package/dist/components/hook-form/RHFDateTime.js +72 -0
- package/dist/components/hook-form/RHFTextField/index.d.ts +1 -2
- package/dist/components/hook-form/RHFTextField/index.js +6 -3
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/index.d.ts +3 -0
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/styles.d.ts +4 -0
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/types.d.ts +11 -0
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/index.d.ts +3 -0
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/types.d.ts +14 -0
- package/dist/components/hook-form/RHFUpload/index.d.ts +1 -0
- package/dist/components/hook-form/RHFUpload/types.d.ts +4 -0
- package/dist/components/hook-form/RHFUpload.js +182 -0
- package/dist/components/hook-form/index.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/mui_extended/MenuActions/index.js +1 -1
- package/dist/components/mui_extended/MenuActions/styles.d.ts +1 -1
- package/dist/contexts/ModalContext/types.d.ts +2 -1
- package/dist/index.js +51 -46
- package/dist/lodash.js +61 -1
- package/dist/node_modules.js +1307 -1
- package/dist/simplebar.js +1 -0
- package/dist/style.css +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/vendor.js +226 -0
- package/package.json +9 -8
- package/dist/components/ScrollBar/styles.d.ts +0 -6
- package/dist/components/ScrollBar/types.d.ts +0 -7
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface WrapperProps {
|
|
3
|
+
inEdition: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const WrapperFilter: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & WrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const WrapperFilterMobile: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & WrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
export declare const ContainerFistRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Maybe } from '@m4l/core';
|
|
2
|
+
export declare type FieldType = 'number' | 'string' | 'boolean' | 'date' | 'datetime' | 'time' | 'select' | 'in';
|
|
3
|
+
export declare type OperandType = number | string | boolean | Date | [] | object;
|
|
4
|
+
export declare type Operator = 'e' | 'ne' | 'b' | 'gt' | 'gte' | 'lt' | 'lte' | 'c' | 'nc';
|
|
5
|
+
export declare const OPERATORS: Array<Operator>;
|
|
6
|
+
export declare type StringOperator = 'c' | 'nc';
|
|
7
|
+
export declare const STRING_OPERATORS: Array<StringOperator>;
|
|
8
|
+
export declare type BooleanOperator = 'e' | 'ne';
|
|
9
|
+
export declare const BOOLEAN_OPERATORS: Array<BooleanOperator>;
|
|
10
|
+
export declare type DateTimeOperator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
11
|
+
export declare const DATE_TIME_OPERATORS: Array<DateTimeOperator>;
|
|
12
|
+
export interface Field {
|
|
13
|
+
name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
type: FieldType;
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
fixed?: boolean;
|
|
18
|
+
urlIcon: string;
|
|
19
|
+
defaultOperand1?: Maybe<OperandType>;
|
|
20
|
+
defaultOperand2?: Maybe<OperandType>;
|
|
21
|
+
}
|
|
22
|
+
export interface OptionOperator<T> {
|
|
23
|
+
id: T;
|
|
24
|
+
label: string;
|
|
25
|
+
}
|
|
26
|
+
export interface BaseApplyFilter {
|
|
27
|
+
id: number;
|
|
28
|
+
fieldName: string;
|
|
29
|
+
isSetted: boolean;
|
|
30
|
+
fixed: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ValuesFilter {
|
|
33
|
+
operator: Operator;
|
|
34
|
+
labelOperator: string;
|
|
35
|
+
labelOperands: string;
|
|
36
|
+
operand1?: Maybe<OperandType>;
|
|
37
|
+
operand2?: Maybe<OperandType>;
|
|
38
|
+
}
|
|
39
|
+
export interface FormValuesFilter<T> {
|
|
40
|
+
valueOperator?: Maybe<OptionOperator<T>>;
|
|
41
|
+
valueOperand1?: Maybe<any>;
|
|
42
|
+
valueOperand2?: Maybe<any>;
|
|
43
|
+
}
|
|
44
|
+
export interface RawFilterFieldApply {
|
|
45
|
+
n: string;
|
|
46
|
+
o: Operator;
|
|
47
|
+
o1: Maybe<OperandType>;
|
|
48
|
+
o2: Maybe<OperandType>;
|
|
49
|
+
}
|
|
50
|
+
export interface FilterFieldApply extends BaseApplyFilter, ValuesFilter {
|
|
51
|
+
}
|
|
52
|
+
export declare type InitialFilterFieldApply = Omit<FilterFieldApply, 'id' | 'fixed' | 'isSetted'>;
|
|
53
|
+
export declare type FilterToAddApply = Omit<FilterFieldApply, 'id' | 'labelOperator'>;
|
|
54
|
+
export declare type FilterToEditApply = Omit<FilterFieldApply, 'labelOperator'>;
|
|
55
|
+
export interface FilterFormFieldApply extends BaseApplyFilter, ValuesFilter, FormValuesFilter<Operator> {
|
|
56
|
+
}
|
|
57
|
+
export declare const ALL_FIELDS: Field;
|
|
58
|
+
export interface DynamicFilterProps {
|
|
59
|
+
isSkeleton?: boolean;
|
|
60
|
+
automatic?: boolean;
|
|
61
|
+
withAllField?: boolean;
|
|
62
|
+
fields: Array<Field>;
|
|
63
|
+
initialFilters?: Array<InitialFilterFieldApply>;
|
|
64
|
+
onChangeFilter: (newFilters: Array<FilterFieldApply>, rawFilters: Array<RawFilterFieldApply>) => void;
|
|
65
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
2
|
import { Button } from "@mui/material";
|
|
3
|
+
import { g as getVariantColor } from "../../vendor.js";
|
|
3
4
|
import { styled } from "@mui/material/styles";
|
|
4
5
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
6
|
const WrapperActions = styled("div")(({
|
|
@@ -33,7 +34,7 @@ const FormActions = (props) => {
|
|
|
33
34
|
variant: "contained",
|
|
34
35
|
onClick: standardActions.onClickIntro,
|
|
35
36
|
type: "submit",
|
|
36
|
-
color: variant
|
|
37
|
+
color: getVariantColor(variant),
|
|
37
38
|
children: getLabel("actions.action_accept")
|
|
38
39
|
})]
|
|
39
40
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ModalOpenOptions } from
|
|
1
|
+
import { ModalOpenOptions, VariantModal } from '../../contexts/ModalContext/types';
|
|
2
2
|
declare type ImodalOpt = Pick<ModalOpenOptions, 'actionComponents' | 'standardActions'>;
|
|
3
3
|
export interface ActionsProps extends ImodalOpt {
|
|
4
|
-
variant?:
|
|
4
|
+
variant?: VariantModal;
|
|
5
5
|
onCloseModal?: () => void | undefined;
|
|
6
6
|
}
|
|
7
7
|
export {};
|
|
@@ -14,13 +14,15 @@ function Icon(props) {
|
|
|
14
14
|
src = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/commons/assets/icons/default.svg",
|
|
15
15
|
width = "20px",
|
|
16
16
|
height = "20px",
|
|
17
|
-
bgColor = "active"
|
|
17
|
+
bgColor = "active",
|
|
18
|
+
onClick
|
|
18
19
|
} = props;
|
|
19
20
|
return /* @__PURE__ */ jsx(MaskIcon, {
|
|
20
21
|
src,
|
|
21
22
|
width,
|
|
22
23
|
height,
|
|
23
|
-
bgColor
|
|
24
|
+
bgColor,
|
|
25
|
+
onClick
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
28
|
export { Icon as I };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
export declare const MaskIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & IconProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
2
|
+
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>, {}>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
export interface OwnProps {
|
|
3
|
+
src: string | undefined;
|
|
3
4
|
width?: number | string;
|
|
4
5
|
height?: number | string;
|
|
5
6
|
bgColor?: string | 'info' | 'warning' | 'error' | 'active' | 'disabled';
|
|
6
7
|
}
|
|
8
|
+
export declare type IconProps = OwnProps & HTMLProps<HTMLDivElement>;
|
|
@@ -9,7 +9,7 @@ const SKTWrapperImage = styled("div")(({
|
|
|
9
9
|
width,
|
|
10
10
|
height: "100%",
|
|
11
11
|
padding: theme.spacing(3),
|
|
12
|
-
mask: `
|
|
12
|
+
mask: `zurl("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`,
|
|
13
13
|
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`
|
|
14
14
|
}));
|
|
15
15
|
const WrapperLazyLoadImage = styled("div")(({
|
|
@@ -54,7 +54,6 @@ function Image({
|
|
|
54
54
|
src,
|
|
55
55
|
...other
|
|
56
56
|
}) {
|
|
57
|
-
console.log("ImageSkeleton", isSekeleton);
|
|
58
57
|
const theme = useTheme();
|
|
59
58
|
const themeMode = theme.palette.mode;
|
|
60
59
|
if (isSekeleton) {
|
|
@@ -2,6 +2,7 @@ import { Dialog, IconButton, Paper } from "@mui/material";
|
|
|
2
2
|
import { D as Draggable } from "../../react-draggable.js";
|
|
3
3
|
import { u as useModal } from "../../hooks/useModal/index.js";
|
|
4
4
|
import { styled } from "@mui/material/styles";
|
|
5
|
+
import { a as getThemeVariantColor } from "../../vendor.js";
|
|
5
6
|
import { R as Resizeable } from "../Resizeable/index.js";
|
|
6
7
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
7
8
|
import { useEnvironment } from "@m4l/core";
|
|
@@ -39,7 +40,7 @@ const IconHeader = styled("div")(({ theme, variant }) => ({
|
|
|
39
40
|
justifyContent: "center",
|
|
40
41
|
marginRight: theme.spacing(1.5),
|
|
41
42
|
"& > span": {
|
|
42
|
-
background:
|
|
43
|
+
background: getThemeVariantColor(theme, variant)
|
|
43
44
|
}
|
|
44
45
|
}));
|
|
45
46
|
const Content = styled("div")(() => ({
|
|
@@ -48,7 +49,7 @@ const Content = styled("div")(() => ({
|
|
|
48
49
|
}));
|
|
49
50
|
const ModalTitle = styled("div")(({ theme, variant }) => ({
|
|
50
51
|
...theme.typography.subtitle1,
|
|
51
|
-
color:
|
|
52
|
+
color: getThemeVariantColor(theme, variant)
|
|
52
53
|
}));
|
|
53
54
|
const Header = (props) => {
|
|
54
55
|
const {
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
2
2
|
import { useNetwork, useModuleDictionary, usePaginate } from "@m4l/core";
|
|
3
|
-
import {
|
|
4
|
-
import { DateTimePicker } from "@mui/x-date-pickers";
|
|
5
|
-
import { styled, useTheme } from "@mui/material/styles";
|
|
6
|
-
import { startOfMonth, endOfDay } from "date-fns";
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
7
4
|
import { D as DataGrid } from "../DataGrid/index.js";
|
|
8
|
-
import { I as IconButton$1 } from "../mui_extended/IconButton/index.js";
|
|
9
5
|
import { D as DateFormatter } from "../DataGrid/formatters/DateFormatter/index.js";
|
|
6
|
+
import { Tooltip, IconButton } from "@mui/material";
|
|
10
7
|
import { R as ReactJson } from "../../react-json-view.js";
|
|
11
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
9
|
import { u as useModal } from "../../hooks/useModal/index.js";
|
|
10
|
+
import { D as DynamicFilter } from "../DynamicFilter/index.js";
|
|
13
11
|
const Container$1 = styled("div")(() => ({
|
|
14
12
|
height: "100%",
|
|
15
13
|
width: "100%",
|
|
@@ -77,13 +75,6 @@ function DetailDialog(props) {
|
|
|
77
75
|
mounted = false;
|
|
78
76
|
};
|
|
79
77
|
}, []);
|
|
80
|
-
const detailTest = {
|
|
81
|
-
id: "id",
|
|
82
|
-
test: true,
|
|
83
|
-
number: 123
|
|
84
|
-
};
|
|
85
|
-
console.log("parseJson", detail, typeof detail);
|
|
86
|
-
console.log("parseJosnTest", detailTest, typeof detailTest);
|
|
87
78
|
return /* @__PURE__ */ jsx(Container, {
|
|
88
79
|
id: "objectLogsDetail",
|
|
89
80
|
children: /* @__PURE__ */ jsx(ReactJson, {
|
|
@@ -133,17 +124,10 @@ function ObjectLogs(props) {
|
|
|
133
124
|
resource_id,
|
|
134
125
|
object_id
|
|
135
126
|
} = props;
|
|
136
|
-
const now = new Date();
|
|
137
|
-
const [startValue, setStartValue] = useState(startOfMonth(now));
|
|
138
|
-
const [endValue, setEndtValue] = useState(endOfDay(now));
|
|
139
127
|
const [queryParams, setQueryParams] = useState({
|
|
140
128
|
resource_id,
|
|
141
|
-
object_id
|
|
142
|
-
init_date: startValue,
|
|
143
|
-
end_date: endValue
|
|
129
|
+
object_id
|
|
144
130
|
});
|
|
145
|
-
const [queryActive, setQueryActive] = useState(true);
|
|
146
|
-
const theme = useTheme();
|
|
147
131
|
const dateFormatterCreatedAt = useCallback((rowProps) => /* @__PURE__ */ jsx(DateFormatter, {
|
|
148
132
|
presentationType: "datetime",
|
|
149
133
|
dateTime: rowProps.row.created_at
|
|
@@ -151,42 +135,35 @@ function ObjectLogs(props) {
|
|
|
151
135
|
const DetailRowFormatter = useCallback((rowProps) => /* @__PURE__ */ jsx(DetailFormatter, {
|
|
152
136
|
log_id: rowProps.row.id
|
|
153
137
|
}), []);
|
|
154
|
-
const columns = useMemo(() => [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
key: "ip",
|
|
186
|
-
name: getLabel("object_logs.ip"),
|
|
187
|
-
type: "text"
|
|
188
|
-
}
|
|
189
|
-
], [getLabel]);
|
|
138
|
+
const columns = useMemo(() => [{
|
|
139
|
+
key: "created_at",
|
|
140
|
+
name: getLabel("object_logs.created_at"),
|
|
141
|
+
type: "date",
|
|
142
|
+
width: 300,
|
|
143
|
+
formatter: dateFormatterCreatedAt
|
|
144
|
+
}, {
|
|
145
|
+
key: "email",
|
|
146
|
+
name: getLabel("object_logs.email"),
|
|
147
|
+
type: "text",
|
|
148
|
+
width: 300
|
|
149
|
+
}, {
|
|
150
|
+
key: "resource_name",
|
|
151
|
+
name: getLabel("object_logs.resource_name"),
|
|
152
|
+
type: "text"
|
|
153
|
+
}, {
|
|
154
|
+
key: "preview",
|
|
155
|
+
name: getLabel("object_logs.preview"),
|
|
156
|
+
type: "text"
|
|
157
|
+
}, {
|
|
158
|
+
key: "Detail",
|
|
159
|
+
name: getLabel("object_logs.log_detail"),
|
|
160
|
+
type: "custom",
|
|
161
|
+
formatter: DetailRowFormatter
|
|
162
|
+
}, {
|
|
163
|
+
key: "ip",
|
|
164
|
+
name: getLabel("object_logs.ip"),
|
|
165
|
+
type: "text"
|
|
166
|
+
}], [getLabel]);
|
|
190
167
|
const {
|
|
191
168
|
pagerState,
|
|
192
169
|
rows,
|
|
@@ -199,57 +176,33 @@ function ObjectLogs(props) {
|
|
|
199
176
|
queryParams
|
|
200
177
|
});
|
|
201
178
|
useEffect(() => {
|
|
202
|
-
setQueryActive(true);
|
|
203
179
|
clearRows();
|
|
204
180
|
}, [object_id]);
|
|
205
|
-
const
|
|
206
|
-
if (!date)
|
|
207
|
-
return;
|
|
208
|
-
if (which === "start") {
|
|
209
|
-
setStartValue(date);
|
|
210
|
-
} else {
|
|
211
|
-
setEndtValue(date);
|
|
212
|
-
}
|
|
213
|
-
setQueryActive(true);
|
|
214
|
-
};
|
|
215
|
-
const onClickFilter = () => {
|
|
181
|
+
const onChangeFilter = (filters, rawFilters) => {
|
|
216
182
|
setQueryParams({
|
|
217
183
|
resource_id,
|
|
218
184
|
object_id,
|
|
219
|
-
|
|
220
|
-
end_date: endValue
|
|
185
|
+
f: rawFilters
|
|
221
186
|
});
|
|
222
|
-
|
|
187
|
+
console.log("filter was change*****", JSON.stringify(rawFilters));
|
|
223
188
|
};
|
|
224
189
|
return /* @__PURE__ */ jsxs(Container$1, {
|
|
225
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ jsx(Actions, {
|
|
226
191
|
id: "objectLogsActions",
|
|
227
|
-
children:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
...params
|
|
242
|
-
})
|
|
243
|
-
}), /* @__PURE__ */ jsx(IconButton$1, {
|
|
244
|
-
dictionaryTooltip: "object_logs.search",
|
|
245
|
-
onClick: onClickFilter,
|
|
246
|
-
sx: {
|
|
247
|
-
color: queryActive ? theme.palette.primary.main : theme.palette.text.primary
|
|
248
|
-
},
|
|
249
|
-
disabled: object_id === void 0,
|
|
250
|
-
"aria-label": "searc",
|
|
251
|
-
src: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/object_logs/assets/icons/search.svg"
|
|
252
|
-
})]
|
|
192
|
+
children: /* @__PURE__ */ jsx(DynamicFilter, {
|
|
193
|
+
withAllField: false,
|
|
194
|
+
onChangeFilter,
|
|
195
|
+
automatic: false,
|
|
196
|
+
fields: [{
|
|
197
|
+
name: "user_logs.created_at",
|
|
198
|
+
label: getLabel("object_logs.date"),
|
|
199
|
+
type: "datetime",
|
|
200
|
+
multiple: false,
|
|
201
|
+
fixed: true,
|
|
202
|
+
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
|
|
203
|
+
}],
|
|
204
|
+
initialFilters: []
|
|
205
|
+
})
|
|
253
206
|
}), /* @__PURE__ */ jsx(GridWrapper, {
|
|
254
207
|
id: "GridWrapper",
|
|
255
208
|
children: /* @__PURE__ */ jsx(DataGrid, {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
children?: ReactElement;
|
|
4
|
+
}
|
|
5
|
+
export default function Scrollbar({ children }: Props): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box } from "@mui/material";
|
|
2
|
-
import { styled, alpha } from "@mui/material/styles";
|
|
3
1
|
import { S as SimpleBar } from "../../simplebar.js";
|
|
2
|
+
import { styled, alpha } from "@mui/material/styles";
|
|
3
|
+
import { Box } from "@mui/material";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
const RootStyle = styled("div")(() => ({
|
|
6
6
|
flexGrow: 1,
|
|
@@ -29,32 +29,24 @@ const SimpleBarStyle = styled(SimpleBar)(({
|
|
|
29
29
|
zIndex: "inherit"
|
|
30
30
|
}
|
|
31
31
|
}));
|
|
32
|
-
function
|
|
33
|
-
children
|
|
34
|
-
sx,
|
|
35
|
-
...other
|
|
32
|
+
function Scrollbar({
|
|
33
|
+
children
|
|
36
34
|
}) {
|
|
37
35
|
const userAgent = typeof navigator === "undefined" ? "SSR" : navigator.userAgent;
|
|
38
36
|
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
|
|
39
37
|
if (isMobile) {
|
|
40
38
|
return /* @__PURE__ */ jsx(Box, {
|
|
41
39
|
sx: {
|
|
42
|
-
overflowX: "auto"
|
|
43
|
-
...sx
|
|
40
|
+
overflowX: "auto"
|
|
44
41
|
},
|
|
45
|
-
...other,
|
|
46
42
|
children
|
|
47
43
|
});
|
|
48
44
|
}
|
|
49
45
|
return /* @__PURE__ */ jsx(RootStyle, {
|
|
50
|
-
id: "RootStyle",
|
|
51
46
|
children: /* @__PURE__ */ jsx(SimpleBarStyle, {
|
|
52
|
-
|
|
53
|
-
clickOnTrack: false,
|
|
54
|
-
sx,
|
|
55
|
-
...other,
|
|
47
|
+
autoHide: false,
|
|
56
48
|
children
|
|
57
49
|
})
|
|
58
50
|
});
|
|
59
51
|
}
|
|
60
|
-
export {
|
|
52
|
+
export { Scrollbar as S };
|
|
@@ -137,7 +137,6 @@ function FormProvider(props) {
|
|
|
137
137
|
if (values.initial) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
|
-
console.log("****\xB7\xB7\xB7\xB7\xB7\xB7useEffect FormProvider", values);
|
|
141
140
|
const keys = Object.keys(values);
|
|
142
141
|
keys.forEach((key) => {
|
|
143
142
|
methods.setValue(key, values[key], {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SKTRHFAutocompleteWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
|
+
export declare const PropertieValueLabel: 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 SKTInputText: 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 WrapperAutocomplete: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SkeletonProps {
|
|
2
|
+
isSkeleton?: boolean;
|
|
3
|
+
width?: string | number;
|
|
4
|
+
height?: string | number;
|
|
5
|
+
}
|
|
6
|
+
export interface RHFAutocompleteProps<T> {
|
|
7
|
+
name: string;
|
|
8
|
+
options: Array<T>;
|
|
9
|
+
getOptionLabel: (option: T) => string;
|
|
10
|
+
isOptionEqualToValue: (option: T, value: T) => boolean;
|
|
11
|
+
skeletonProps?: SkeletonProps;
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
@@ -74,7 +74,6 @@ function RHFAutocompleteAsync(props) {
|
|
|
74
74
|
setOptions([initialValue]);
|
|
75
75
|
}
|
|
76
76
|
}, [initialValue, optionsLoaded]);
|
|
77
|
-
console.log("***2022Render RHFAutocompleteAsync", loading, options, initialValue);
|
|
78
77
|
const getOptionLabelLocal = (option) => {
|
|
79
78
|
if (option === void 0 || option === null) {
|
|
80
79
|
return "";
|
|
@@ -155,7 +154,6 @@ function RHFAutocompleteAsync(props) {
|
|
|
155
154
|
loadingText: "",
|
|
156
155
|
noOptionsText: getLabel("component_no_options"),
|
|
157
156
|
renderInput: (params) => {
|
|
158
|
-
console.log("TextField", params);
|
|
159
157
|
return /* @__PURE__ */ jsx(TextField, {
|
|
160
158
|
...params,
|
|
161
159
|
label,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SKTRHFWrapperTextField: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useFormContext, Controller } from "react-hook-form";
|
|
2
|
+
import { Skeleton, TextField } from "@mui/material";
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { DateTimePicker } from "@mui/x-date-pickers";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
const SKTRHFWrapperTextField = styled("div")(({
|
|
7
|
+
theme
|
|
8
|
+
}) => ({
|
|
9
|
+
display: "flex",
|
|
10
|
+
width: "100%",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
13
|
+
padding: "12px 14px",
|
|
14
|
+
borderRadius: theme.spacing(1)
|
|
15
|
+
}));
|
|
16
|
+
function RHFDateTime(props) {
|
|
17
|
+
const {
|
|
18
|
+
name,
|
|
19
|
+
autoComplete = "off",
|
|
20
|
+
skeletonProps: skeletoProps = {}
|
|
21
|
+
} = props;
|
|
22
|
+
const {
|
|
23
|
+
isSkeleton = false,
|
|
24
|
+
width = "100%",
|
|
25
|
+
height = 14
|
|
26
|
+
} = skeletoProps;
|
|
27
|
+
const {
|
|
28
|
+
control
|
|
29
|
+
} = useFormContext();
|
|
30
|
+
if (isSkeleton) {
|
|
31
|
+
return /* @__PURE__ */ jsx(SKTRHFWrapperTextField, {
|
|
32
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
33
|
+
variant: "text",
|
|
34
|
+
width,
|
|
35
|
+
height
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
40
|
+
name,
|
|
41
|
+
control,
|
|
42
|
+
render: ({
|
|
43
|
+
field,
|
|
44
|
+
fieldState: {
|
|
45
|
+
error
|
|
46
|
+
}
|
|
47
|
+
}) => {
|
|
48
|
+
return /* @__PURE__ */ jsx(DateTimePicker, {
|
|
49
|
+
ampm: false,
|
|
50
|
+
inputFormat: "yyyy-MM-dd HH:mm:ss",
|
|
51
|
+
mask: "____-__-__ __:__:__",
|
|
52
|
+
label: "",
|
|
53
|
+
value: field.value,
|
|
54
|
+
onChange: (value) => {
|
|
55
|
+
if (!isNaN(value)) {
|
|
56
|
+
field.onChange(value);
|
|
57
|
+
} else {
|
|
58
|
+
field.onChange(void 0);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, {
|
|
62
|
+
autoComplete,
|
|
63
|
+
fullWidth: true,
|
|
64
|
+
error: !!error,
|
|
65
|
+
helperText: error?.message,
|
|
66
|
+
...params
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
export { RHFDateTime as R };
|