@m4l/components 0.1.28 → 0.1.30
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/CommonActions/components/ActionCancel/{index.e498eeb2.js → index.a57fcfae.js} +1 -1
- package/components/CommonActions/components/ActionFormCancel/{index.4ff0ad73.js → index.b8215cd2.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index.60ef7bd7.js → index.591a8195.js} +1 -1
- package/components/CommonActions/components/Actions/{index.0645e30f.js → index.2ce05d29.js} +7 -7
- package/components/DataGrid/{index.76d8fd25.js → index.07162c02.js} +3 -3
- package/components/DynamicFilter/components/PopupEditFilter/styles.d.ts +1 -0
- package/components/DynamicFilter/components/fieldstypes/DateTimeFilter/index.d.ts +2 -2
- package/components/DynamicFilter/components/fieldstypes/factory.d.ts +2 -2
- package/components/DynamicFilter/{index.342ba5fe.js → index.31876c9f.js} +67 -62
- package/components/ModalDialog/{index.9ea10764.js → index.3e5675c4.js} +5 -3
- package/components/ObjectLogs/{index.f941fb79.js → index.35dbf836.js} +19 -8
- package/components/Period/{index.2941fbda.js → index.111600f2.js} +2 -2
- package/components/animate/IconButtonAnimate/index.d.ts +1 -1
- package/components/formatters/BooleanFormatter/{index.8da35c9c.js → index.ae70b54f.js} +1 -0
- package/components/formatters/DateFormatter/{index.1b9baacc.js → index.ed73f8ae.js} +9 -11
- package/components/formatters/{index.689a8086.js → index.9bd10770.js} +1 -0
- package/components/hook-form/RHFAutocomplete/{index.59a68f9f.js → index.de93fe01.js} +89 -34
- package/components/hook-form/RHFAutocomplete/styles.d.ts +0 -2
- package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/index.d.ts +3 -0
- package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/styles.d.ts +3 -0
- package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/types.d.ts +4 -0
- package/components/hook-form/RHFAutocompleteAsync/{index.c3083062.js → index.ca696cce.js} +1 -1
- package/components/hook-form/RHFDateTime/{index.9231a7c7.js → index.e70d2de3.js} +36 -23
- package/components/hook-form/RHFDateTime/types.d.ts +1 -0
- package/components/hook-form/RHFPeriod/{index.64a228d5.js → index.fa8426ac.js} +1 -1
- package/components/hook-form/RHFTextField/index.d.ts +1 -1
- package/components/mui_extended/Avatar/index.d.ts +1 -1
- package/components/mui_extended/Button/{index.53b56958.js → index.1d13f53b.js} +1 -1
- package/components/mui_extended/MenuActions/styles.d.ts +2 -2
- package/components/mui_extended/Pager/{index.c0865b70.js → index.72b43352.js} +1 -1
- package/components/mui_extended/Popover/{index.705275a4.js → index.028756ac.js} +3 -3
- package/contexts/ModalContext/{index.b92fa565.js → index.cc3690d3.js} +7 -12
- package/contexts/ModalContext/types.d.ts +1 -2
- package/contexts/RHFormContext/{index.b142190a.js → index.f8c00745.js} +1 -0
- package/hooks/useModal/{index.5fee01a3.js → index.78ee58f3.js} +1 -1
- package/index.js +23 -23
- package/package.json +1 -1
package/components/CommonActions/components/ActionCancel/{index.e498eeb2.js → index.a57fcfae.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
2
|
+
import { B as Button } from "../../../mui_extended/Button/index.1d13f53b.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
const ActionCancel = (props) => {
|
|
5
5
|
const {
|
package/components/CommonActions/components/ActionFormCancel/{index.4ff0ad73.js → index.b8215cd2.js}
RENAMED
|
@@ -2,9 +2,9 @@ import { useFormContext, useFormState } from "react-hook-form";
|
|
|
2
2
|
import { useNavigate } from "react-router-dom";
|
|
3
3
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
4
4
|
import { Skeleton } from "@mui/material";
|
|
5
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
5
|
+
import { B as Button } from "../../../mui_extended/Button/index.1d13f53b.js";
|
|
6
6
|
import { useCallback } from "react";
|
|
7
|
-
import { u as useModal } from "../../../../hooks/useModal/index.
|
|
7
|
+
import { u as useModal } from "../../../../hooks/useModal/index.78ee58f3.js";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
function ActionFormCancel(props) {
|
|
10
10
|
const {
|
package/components/CommonActions/components/ActionIntro/{index.60ef7bd7.js → index.591a8195.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
2
|
+
import { B as Button } from "../../../mui_extended/Button/index.1d13f53b.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
const ActionIntro = (props) => {
|
|
5
5
|
const {
|
|
@@ -6,16 +6,16 @@ import "@mui/material/Button";
|
|
|
6
6
|
import "react-hook-form";
|
|
7
7
|
import "react-router-dom";
|
|
8
8
|
import { useState, useMemo, forwardRef, useRef, useImperativeHandle, useEffect, useCallback } from "react";
|
|
9
|
-
import "../../../../contexts/ModalContext/index.
|
|
9
|
+
import "../../../../contexts/ModalContext/index.cc3690d3.js";
|
|
10
10
|
import "@mui/lab";
|
|
11
11
|
import { I as IconButton$1 } from "../../../mui_extended/IconButton/index.a321e5cb.js";
|
|
12
|
-
import { u as useBase, a as useFilters, O as OriginalDataGridWrapperStyled } from "../../../DataGrid/index.
|
|
13
|
-
import { P as Pager } from "../../../mui_extended/Pager/index.
|
|
12
|
+
import { u as useBase, a as useFilters, O as OriginalDataGridWrapperStyled } from "../../../DataGrid/index.07162c02.js";
|
|
13
|
+
import { P as Pager } from "../../../mui_extended/Pager/index.72b43352.js";
|
|
14
14
|
import { D as DataGrid$1 } from "../../../../react-data-grid.d46d625e.js";
|
|
15
|
-
import { u as useModal } from "../../../../hooks/useModal/index.
|
|
16
|
-
import { A as ActionCancel } from "../ActionCancel/index.
|
|
17
|
-
import { A as ActionIntro } from "../ActionIntro/index.
|
|
18
|
-
import { P as Popover } from "../../../mui_extended/Popover/index.
|
|
15
|
+
import { u as useModal } from "../../../../hooks/useModal/index.78ee58f3.js";
|
|
16
|
+
import { A as ActionCancel } from "../ActionCancel/index.a57fcfae.js";
|
|
17
|
+
import { A as ActionIntro } from "../ActionIntro/index.591a8195.js";
|
|
18
|
+
import { P as Popover } from "../../../mui_extended/Popover/index.028756ac.js";
|
|
19
19
|
import { I as Icon } from "../../../Icon/index.619c31c4.js";
|
|
20
20
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
21
21
|
const WrapperStandarActions = styled("div")(({
|
|
@@ -6,9 +6,9 @@ import { HTML5Backend } from "react-dnd-html5-backend";
|
|
|
6
6
|
import { SvgIcon, Checkbox, InputBase, Skeleton } from "@mui/material";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { voidFunction, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
9
|
-
import { A as ActionsColumn, a as Actions } from "../CommonActions/components/Actions/index.
|
|
10
|
-
import { g as getModalDialogComponentsDictionary, d as defaultModalDialogDictionary } from "../ModalDialog/index.
|
|
11
|
-
import { g as getPagerComponentsDictionary, d as defaultPagerDictionary } from "../mui_extended/Pager/index.
|
|
9
|
+
import { A as ActionsColumn, a as Actions } from "../CommonActions/components/Actions/index.2ce05d29.js";
|
|
10
|
+
import { g as getModalDialogComponentsDictionary, d as defaultModalDialogDictionary } from "../ModalDialog/index.3e5675c4.js";
|
|
11
|
+
import { g as getPagerComponentsDictionary, d as defaultPagerDictionary } from "../mui_extended/Pager/index.72b43352.js";
|
|
12
12
|
const WrapperGrid = styled("div")(() => ({
|
|
13
13
|
display: "flex",
|
|
14
14
|
flexDirection: "column",
|
|
@@ -3,3 +3,4 @@ export declare const WrapperPopupEditFilter: import("@emotion/styled").StyledCom
|
|
|
3
3
|
export declare const PopperActionsContainer: 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 TitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
5
|
export declare const HeaderContainer: 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 WrapperEditFilter: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FilterFieldApply, Field } from '../../../types';
|
|
3
|
-
import
|
|
4
|
-
export declare const getDefaultDateTimeFilter: (field: Field, fixed: boolean, getLabel: (key: string) => string,
|
|
3
|
+
import { Formatters } from '@m4l/graphics';
|
|
4
|
+
export declare const getDefaultDateTimeFilter: (field: Field, fixed: boolean, getLabel: (key: string) => string, formatters: Formatters) => FilterFieldApply;
|
|
5
5
|
export declare function DateTimeFilter(): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FilterFieldApply, Field } from '../../types';
|
|
3
|
-
import
|
|
4
|
-
export declare const getDefaultFilterValues: (field: Field, fixed: boolean, getLabel: (key: string) => string,
|
|
3
|
+
import { Formatters } from '@m4l/graphics';
|
|
4
|
+
export declare const getDefaultFilterValues: (field: Field, fixed: boolean, getLabel: (key: string) => string, formatters: Formatters) => FilterFieldApply;
|
|
5
5
|
export declare const PopupEditFilterComponent: (props: {
|
|
6
6
|
filter: FilterFieldApply;
|
|
7
7
|
}) => JSX.Element;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { S as ScrollBar } from "../ScrollBar/index.39eeb2de.js";
|
|
2
2
|
import { styled } from "@mui/material/styles";
|
|
3
3
|
import { useRef, useState, useMemo, useCallback, useEffect, createContext, useContext } from "react";
|
|
4
|
-
import { useModuleDictionary,
|
|
4
|
+
import { useModuleDictionary, voidFunction, useEnvironment, useHostTools, useFlagsPresent } from "@m4l/core";
|
|
5
5
|
import * as Yup from "yup";
|
|
6
6
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
7
|
-
import { R as RHFAutocomplete } from "../hook-form/RHFAutocomplete/index.
|
|
7
|
+
import { R as RHFAutocomplete } from "../hook-form/RHFAutocomplete/index.de93fe01.js";
|
|
8
8
|
import "lodash/debounce";
|
|
9
9
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
10
10
|
import "../hook-form/RHFCheckbox/index.6dcec9e2.js";
|
|
11
|
-
import { alpha, styled as styled$1, Skeleton, MenuItem, useTheme, Popper } from "@mui/material";
|
|
11
|
+
import { alpha, styled as styled$1, Skeleton, MenuItem, useTheme, Popper, ClickAwayListener } from "@mui/material";
|
|
12
12
|
import "@mui/x-date-pickers";
|
|
13
|
-
import { R as RHFDateTime } from "../hook-form/RHFDateTime/index.
|
|
13
|
+
import { R as RHFDateTime } from "../hook-form/RHFDateTime/index.e70d2de3.js";
|
|
14
|
+
import { useFormatter, useResponsiveDesktop } from "@m4l/graphics";
|
|
14
15
|
import { R as RHFTextField } from "../hook-form/RHFTextField/index.f9aaaa90.js";
|
|
15
16
|
import { I as Icon } from "../Icon/index.619c31c4.js";
|
|
16
|
-
import "../hook-form/RHFPeriod/index.
|
|
17
|
+
import "../hook-form/RHFPeriod/index.fa8426ac.js";
|
|
17
18
|
import "../ErrorLabel/index.c8615f16.js";
|
|
18
|
-
import "../Period/index.
|
|
19
|
-
import { L as LabelMemuItem, b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.
|
|
19
|
+
import "../Period/index.111600f2.js";
|
|
20
|
+
import { L as LabelMemuItem, b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.2ce05d29.js";
|
|
20
21
|
import "@mui/material/Button";
|
|
21
22
|
import "react-router-dom";
|
|
22
|
-
import "../../contexts/ModalContext/index.
|
|
23
|
+
import "../../contexts/ModalContext/index.cc3690d3.js";
|
|
23
24
|
import "@mui/lab";
|
|
24
25
|
import "lodash/isString";
|
|
25
26
|
import "react-dropzone";
|
|
@@ -27,12 +28,11 @@ import "../Image/index.93d5f37f.js";
|
|
|
27
28
|
import "../hook-form/RHFUpload/index.d5cc7c13.js";
|
|
28
29
|
import { I as IconButton } from "../mui_extended/IconButton/index.a321e5cb.js";
|
|
29
30
|
import "simplebar/dist/simplebar.min.css";
|
|
30
|
-
import { F as FilterButton } from "../mui_extended/Button/index.
|
|
31
|
-
import { P as Popover } from "../mui_extended/Popover/index.
|
|
32
|
-
import { R as RHFormProvider } from "../../contexts/RHFormContext/index.
|
|
33
|
-
import { A as ActionCancel } from "../CommonActions/components/ActionCancel/index.
|
|
34
|
-
import { A as ActionIntro } from "../CommonActions/components/ActionIntro/index.
|
|
35
|
-
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
31
|
+
import { F as FilterButton } from "../mui_extended/Button/index.1d13f53b.js";
|
|
32
|
+
import { P as Popover } from "../mui_extended/Popover/index.028756ac.js";
|
|
33
|
+
import { R as RHFormProvider } from "../../contexts/RHFormContext/index.f8c00745.js";
|
|
34
|
+
import { A as ActionCancel } from "../CommonActions/components/ActionCancel/index.a57fcfae.js";
|
|
35
|
+
import { A as ActionIntro } from "../CommonActions/components/ActionIntro/index.591a8195.js";
|
|
36
36
|
const WrapperApplyedFilters = styled("div")(({
|
|
37
37
|
theme
|
|
38
38
|
}) => ({
|
|
@@ -378,9 +378,12 @@ const verifyDateTime = (filter) => {
|
|
|
378
378
|
}
|
|
379
379
|
return true;
|
|
380
380
|
};
|
|
381
|
-
const getDefaultDateTimeFilter = (field, fixed, getLabel,
|
|
381
|
+
const getDefaultDateTimeFilter = (field, fixed, getLabel, formatters) => {
|
|
382
382
|
const defaultStartDate = new Date();
|
|
383
383
|
const defaultEndDate = new Date();
|
|
384
|
+
const {
|
|
385
|
+
dateFormatter
|
|
386
|
+
} = formatters;
|
|
384
387
|
let dfop1 = field.defaultOperand1;
|
|
385
388
|
let dfop2 = field.defaultOperand2;
|
|
386
389
|
const defaultFilter = {
|
|
@@ -416,7 +419,7 @@ const getDefaultDateTimeFilter = (field, fixed, getLabel, hostTools) => {
|
|
|
416
419
|
}
|
|
417
420
|
defaultFilter.o1 = defaultStartDate.toISOString();
|
|
418
421
|
defaultFilter.o2 = defaultEndDate.toISOString();
|
|
419
|
-
defaultFilter.labelOperands = `${
|
|
422
|
+
defaultFilter.labelOperands = `${dateFormatter.formatDate(defaultStartDate, formatters.dateFormatter.datetimeFormat)} - ${dateFormatter.formatDate(defaultEndDate, dateFormatter.datetimeFormat)}`;
|
|
420
423
|
defaultFilter.labelOperator = getLabel(`dynamic_filter.operator_${defaultFilter.o}`);
|
|
421
424
|
return defaultFilter;
|
|
422
425
|
};
|
|
@@ -430,13 +433,8 @@ function DateTimeFilter() {
|
|
|
430
433
|
getLabel
|
|
431
434
|
} = useModuleDictionary();
|
|
432
435
|
const {
|
|
433
|
-
|
|
434
|
-
} =
|
|
435
|
-
const {
|
|
436
|
-
dfnsFormat: {
|
|
437
|
-
datetime_format
|
|
438
|
-
}
|
|
439
|
-
} = useEnvironment();
|
|
436
|
+
dateFormatter
|
|
437
|
+
} = useFormatter();
|
|
440
438
|
const {
|
|
441
439
|
popupData: {
|
|
442
440
|
filter,
|
|
@@ -471,10 +469,10 @@ function DateTimeFilter() {
|
|
|
471
469
|
};
|
|
472
470
|
if (data.valueOperator.id === "b") {
|
|
473
471
|
newFilter.o2 = data.valueOperand2.toISOString();
|
|
474
|
-
newFilter.labelOperands = `${formatDate(data.valueOperand1,
|
|
472
|
+
newFilter.labelOperands = `${dateFormatter.formatDate(data.valueOperand1, dateFormatter.datetimeFormat)} - ${dateFormatter.formatDate(data.valueOperand2, dateFormatter.datetimeFormat)}`;
|
|
475
473
|
} else {
|
|
476
474
|
newFilter.o2 = newFilter.o2 ? newFilter.o2 : newFilter.o1;
|
|
477
|
-
newFilter.labelOperands = formatDate(data.valueOperand1,
|
|
475
|
+
newFilter.labelOperands = dateFormatter.formatDate(data.valueOperand1, dateFormatter.datetimeFormat);
|
|
478
476
|
}
|
|
479
477
|
return newFilter;
|
|
480
478
|
}, []);
|
|
@@ -482,14 +480,10 @@ function DateTimeFilter() {
|
|
|
482
480
|
if (!isLoaded) {
|
|
483
481
|
setPoupEditValidationSchema({
|
|
484
482
|
valueOperator: Yup.object().nullable().required(getLabel(`operator_required`)),
|
|
485
|
-
valueOperand1: Yup.date().
|
|
486
|
-
|
|
487
|
-
}),
|
|
488
|
-
valueOperand2: Yup.date().when(["valueOperator.id"], {
|
|
483
|
+
valueOperand1: Yup.date().required(getLabel(`dynamic_filter.error_invalid_date`)).typeError(getLabel(`dynamic_filter.error_invalid_date`)),
|
|
484
|
+
valueOperand2: Yup.mixed().when(["valueOperator.id"], {
|
|
489
485
|
is: "b",
|
|
490
|
-
then: Yup.date().
|
|
491
|
-
return Boolean(value);
|
|
492
|
-
})
|
|
486
|
+
then: Yup.date().typeError(getLabel(`dynamic_filter.error_invalid_date`)).min(Yup.ref("valueOperand1"), getLabel(`dynamic_filter.error_less_than_start`))
|
|
493
487
|
})
|
|
494
488
|
});
|
|
495
489
|
}
|
|
@@ -651,8 +645,8 @@ function NumberFilter() {
|
|
|
651
645
|
useEffect(() => {
|
|
652
646
|
inputRef.current?.focus();
|
|
653
647
|
}, [isLoaded]);
|
|
654
|
-
return /* @__PURE__ */
|
|
655
|
-
children:
|
|
648
|
+
return /* @__PURE__ */ jsx(WrapperStringFilter, {
|
|
649
|
+
children: isLoaded && /* @__PURE__ */ jsxs(Fragment, {
|
|
656
650
|
children: [/* @__PURE__ */ jsx(WrapperAutoComplete, {
|
|
657
651
|
children: /* @__PURE__ */ jsx(RHFAutocomplete, {
|
|
658
652
|
name: "valueOperator",
|
|
@@ -665,12 +659,14 @@ function NumberFilter() {
|
|
|
665
659
|
}), /* @__PURE__ */ jsx(RHFTextField, {
|
|
666
660
|
name: "valueOperand1",
|
|
667
661
|
ref: inputRef,
|
|
662
|
+
type: "number",
|
|
668
663
|
focused: true
|
|
669
664
|
}), operator && operator.id === "b" && /* @__PURE__ */ jsx(RHFTextField, {
|
|
670
665
|
name: "valueOperand2",
|
|
671
|
-
ref: inputRef
|
|
666
|
+
ref: inputRef,
|
|
667
|
+
type: "number"
|
|
672
668
|
})]
|
|
673
|
-
})
|
|
669
|
+
})
|
|
674
670
|
});
|
|
675
671
|
}
|
|
676
672
|
const strategiesDefaultFilterValues = {
|
|
@@ -682,9 +678,9 @@ const strategiesDefaultFilterValues = {
|
|
|
682
678
|
throw new Error("Type no defined");
|
|
683
679
|
}
|
|
684
680
|
};
|
|
685
|
-
const getDefaultFilterValues = (field, fixed, getLabel,
|
|
681
|
+
const getDefaultFilterValues = (field, fixed, getLabel, formatters) => {
|
|
686
682
|
const transformer = strategiesDefaultFilterValues[field.type] ?? strategiesDefaultFilterValues.__default__;
|
|
687
|
-
return transformer(field, fixed, getLabel,
|
|
683
|
+
return transformer(field, fixed, getLabel, formatters);
|
|
688
684
|
};
|
|
689
685
|
const strategiesEditFilterComponent = {
|
|
690
686
|
string: StringFilter,
|
|
@@ -762,7 +758,7 @@ const formatToRawFilter = (applyedFilter) => {
|
|
|
762
758
|
o2: af.o2
|
|
763
759
|
}));
|
|
764
760
|
};
|
|
765
|
-
const getInitialFilters = (fields, filters, getFieldByName, getLabel,
|
|
761
|
+
const getInitialFilters = (fields, filters, getFieldByName, getLabel, formatters) => {
|
|
766
762
|
const newFilters = [];
|
|
767
763
|
const fixedFields = [];
|
|
768
764
|
for (let index = 0; index < filters.length; index++) {
|
|
@@ -812,7 +808,7 @@ const getInitialFilters = (fields, filters, getFieldByName, getLabel, hostTools)
|
|
|
812
808
|
const field = fields[index];
|
|
813
809
|
if (field.presence === "initialized" || field.presence === "fixed") {
|
|
814
810
|
if (!filters.find((f) => f.n === field.name)) {
|
|
815
|
-
const newFilter = getDefaultFilterValues(field, field.presence === "fixed", getLabel,
|
|
811
|
+
const newFilter = getDefaultFilterValues(field, field.presence === "fixed", getLabel, formatters);
|
|
816
812
|
newFilter.id = newFilters.length + 1;
|
|
817
813
|
newFilters.push(newFilter);
|
|
818
814
|
}
|
|
@@ -845,7 +841,7 @@ function BaseProvider(props) {
|
|
|
845
841
|
host_static_assets,
|
|
846
842
|
environment_assets
|
|
847
843
|
} = useEnvironment();
|
|
848
|
-
const
|
|
844
|
+
const formatter = useFormatter();
|
|
849
845
|
const all_fields = useMemo(() => {
|
|
850
846
|
return {
|
|
851
847
|
...ALL_FIELDS,
|
|
@@ -867,7 +863,7 @@ function BaseProvider(props) {
|
|
|
867
863
|
const getLabelOperator = useCallback((operator) => {
|
|
868
864
|
return getLabel(`dynamic_filter.operator_${operator}`);
|
|
869
865
|
}, [getLabel]);
|
|
870
|
-
const [applyedFilters, setApplyedFilters] = useState(getInitialFilters(fields, initialFilters, getFieldByName, getLabel,
|
|
866
|
+
const [applyedFilters, setApplyedFilters] = useState(getInitialFilters(fields, initialFilters, getFieldByName, getLabel, formatter));
|
|
871
867
|
const availableFields = useMemo(() => {
|
|
872
868
|
const newFields = [];
|
|
873
869
|
for (let index = 0; index < fields.length; index++) {
|
|
@@ -956,6 +952,7 @@ function BaseProvider(props) {
|
|
|
956
952
|
setInEdition(true);
|
|
957
953
|
}, [applyedFilters]);
|
|
958
954
|
const closeMenuFields = useCallback(() => {
|
|
955
|
+
console.log("closeMenuFields");
|
|
959
956
|
setOpenAnchorEl(null);
|
|
960
957
|
setInEdition(false);
|
|
961
958
|
}, []);
|
|
@@ -974,7 +971,7 @@ function BaseProvider(props) {
|
|
|
974
971
|
const showPopupForAddFilter = useCallback((anchorEl, field) => {
|
|
975
972
|
setPopupData({
|
|
976
973
|
popupAnchorEl: anchorEl,
|
|
977
|
-
filter: getDefaultFilterValues(field, false, getLabel,
|
|
974
|
+
filter: getDefaultFilterValues(field, false, getLabel, formatter),
|
|
978
975
|
field
|
|
979
976
|
});
|
|
980
977
|
setInEdition(true);
|
|
@@ -1397,6 +1394,12 @@ const HeaderContainer = styled("div")(({
|
|
|
1397
1394
|
alignItems: "center",
|
|
1398
1395
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
1399
1396
|
}));
|
|
1397
|
+
const WrapperEditFilter = styled("div")(() => ({
|
|
1398
|
+
"& .m4l_FormProvider": {
|
|
1399
|
+
padding: "0px",
|
|
1400
|
+
margin: "0px"
|
|
1401
|
+
}
|
|
1402
|
+
}));
|
|
1400
1403
|
const PopupEditFilter = () => {
|
|
1401
1404
|
const {
|
|
1402
1405
|
popupValidationSchema,
|
|
@@ -1444,32 +1447,34 @@ const PopupEditFilter = () => {
|
|
|
1444
1447
|
hidePopupEdit(false);
|
|
1445
1448
|
};
|
|
1446
1449
|
return /* @__PURE__ */ jsx(Popper, {
|
|
1447
|
-
id: "Popover",
|
|
1448
1450
|
open: Boolean(popupAnchorEl),
|
|
1449
1451
|
anchorEl: popupAnchorEl,
|
|
1450
1452
|
sx: {
|
|
1451
1453
|
boxShadow: theme.customShadows.dropdown,
|
|
1452
1454
|
borderRadius: 1
|
|
1453
1455
|
},
|
|
1454
|
-
children: /* @__PURE__ */ jsx(
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1456
|
+
children: /* @__PURE__ */ jsx(ClickAwayListener, {
|
|
1457
|
+
onClickAway: onClose,
|
|
1458
|
+
children: /* @__PURE__ */ jsx(WrapperEditFilter, {
|
|
1459
|
+
children: filter && /* @__PURE__ */ jsx(RHFormProvider, {
|
|
1460
|
+
onSubmit,
|
|
1461
|
+
values,
|
|
1462
|
+
validationSchema: popupValidationSchema,
|
|
1463
|
+
children: /* @__PURE__ */ jsxs(WrapperPopupEditFilter, {
|
|
1464
|
+
children: [/* @__PURE__ */ jsxs(HeaderContainer, {
|
|
1465
|
+
children: [field?.urlIcon && /* @__PURE__ */ jsx(Icon, {
|
|
1466
|
+
src: field.urlIcon
|
|
1467
|
+
}), /* @__PURE__ */ jsx(TitleContainer, {
|
|
1468
|
+
children: field?.label
|
|
1469
|
+
})]
|
|
1470
|
+
}), /* @__PURE__ */ jsx(PopupEditFilterComponent, {
|
|
1471
|
+
filter
|
|
1472
|
+
}), /* @__PURE__ */ jsxs(Actions, {
|
|
1473
|
+
children: [/* @__PURE__ */ jsx(ActionCancel, {
|
|
1474
|
+
onClick: onClose
|
|
1475
|
+
}), /* @__PURE__ */ jsx(ActionIntro, {})]
|
|
1465
1476
|
})]
|
|
1466
|
-
})
|
|
1467
|
-
filter
|
|
1468
|
-
}), /* @__PURE__ */ jsxs(Actions, {
|
|
1469
|
-
children: [/* @__PURE__ */ jsx(ActionCancel, {
|
|
1470
|
-
onClick: onClose
|
|
1471
|
-
}), /* @__PURE__ */ jsx(ActionIntro, {})]
|
|
1472
|
-
})]
|
|
1477
|
+
})
|
|
1473
1478
|
})
|
|
1474
1479
|
})
|
|
1475
1480
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dialog, IconButton, Paper } from "@mui/material";
|
|
2
2
|
import { c as cjs } from "../../react-draggable.20e95c61.js";
|
|
3
|
-
import { u as useModal } from "../../hooks/useModal/index.
|
|
3
|
+
import { u as useModal } from "../../hooks/useModal/index.78ee58f3.js";
|
|
4
4
|
import { styled } from "@mui/material/styles";
|
|
5
5
|
import { a as getThemeVariantColor } from "../../utils/index.214d9542.js";
|
|
6
6
|
import { R as Resizeable } from "../Resizeable/index.45995d2b.js";
|
|
@@ -8,7 +8,7 @@ import { useResponsiveDesktop } from "@m4l/graphics";
|
|
|
8
8
|
import { useEnvironment } from "@m4l/core";
|
|
9
9
|
import { I as Icon } from "../Icon/index.619c31c4.js";
|
|
10
10
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
11
|
-
import { b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.
|
|
11
|
+
import { b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.2ce05d29.js";
|
|
12
12
|
const WrapperDialog = styled(Dialog)(() => ({}));
|
|
13
13
|
const Container = styled("div")(({ theme }) => ({
|
|
14
14
|
display: "flex",
|
|
@@ -129,7 +129,8 @@ const ModalDialog = () => {
|
|
|
129
129
|
closeModal,
|
|
130
130
|
iconComponent,
|
|
131
131
|
actions,
|
|
132
|
-
variant
|
|
132
|
+
variant,
|
|
133
|
+
fullScreen
|
|
133
134
|
} = useModal();
|
|
134
135
|
const isDesktop = useResponsiveDesktop();
|
|
135
136
|
const onCloseModal = () => {
|
|
@@ -162,6 +163,7 @@ const ModalDialog = () => {
|
|
|
162
163
|
PaperComponent: isDesktop ? DragabblePaperComponent : PaperComponent,
|
|
163
164
|
maxWidth: false,
|
|
164
165
|
fullWidth: !isDesktop,
|
|
166
|
+
fullScreen,
|
|
165
167
|
children: [isDesktop && /* @__PURE__ */ jsx(Resizeable, {
|
|
166
168
|
width: initialWidth,
|
|
167
169
|
height: initialHeigth,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
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
|
-
import { D as DataGrid, g as getDataGridComponentsDictionary } from "../DataGrid/index.
|
|
5
|
-
import { D as DateFormatter } from "../formatters/DateFormatter/index.
|
|
4
|
+
import { D as DataGrid, g as getDataGridComponentsDictionary } from "../DataGrid/index.07162c02.js";
|
|
5
|
+
import { D as DateFormatter } from "../formatters/DateFormatter/index.ed73f8ae.js";
|
|
6
6
|
import { Tooltip, IconButton } from "@mui/material";
|
|
7
|
+
import { useHostTheme, useResponsiveDesktop } from "@m4l/graphics";
|
|
7
8
|
import { R as ReactJson } from "../../react-json-view.f56a7f8e.js";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { u as useModal } from "../../hooks/useModal/index.
|
|
10
|
+
import { u as useModal } from "../../hooks/useModal/index.78ee58f3.js";
|
|
10
11
|
import { I as Icon } from "../Icon/index.619c31c4.js";
|
|
11
|
-
import { D as DynamicFilter, g as getDynamicFilterComponentsDictionary } from "../DynamicFilter/index.
|
|
12
|
+
import { D as DynamicFilter, g as getDynamicFilterComponentsDictionary } from "../DynamicFilter/index.31876c9f.js";
|
|
12
13
|
const Container$1 = styled("div")(() => ({
|
|
13
14
|
height: "100%",
|
|
14
15
|
width: "100%",
|
|
@@ -60,6 +61,9 @@ function DetailDialog(props) {
|
|
|
60
61
|
const {
|
|
61
62
|
networkOperation
|
|
62
63
|
} = useNetwork();
|
|
64
|
+
const {
|
|
65
|
+
hostThemeOptions
|
|
66
|
+
} = useHostTheme();
|
|
63
67
|
const [detail, setDetail] = useState({});
|
|
64
68
|
useEffect(() => {
|
|
65
69
|
let mounted = true;
|
|
@@ -76,9 +80,11 @@ function DetailDialog(props) {
|
|
|
76
80
|
mounted = false;
|
|
77
81
|
};
|
|
78
82
|
}, []);
|
|
83
|
+
const modeTheme = hostThemeOptions.palette?.mode;
|
|
79
84
|
return /* @__PURE__ */ jsx(Container, {
|
|
80
85
|
id: "objectLogsDetail",
|
|
81
86
|
children: /* @__PURE__ */ jsx(ReactJson, {
|
|
87
|
+
theme: modeTheme === "dark" ? "summerfruit" : "rjv-default",
|
|
82
88
|
name: null,
|
|
83
89
|
sortKeys: true,
|
|
84
90
|
displayDataTypes: false,
|
|
@@ -102,6 +108,7 @@ function DetailFormatter(props) {
|
|
|
102
108
|
host_static_assets,
|
|
103
109
|
environment_assets
|
|
104
110
|
} = useEnvironment();
|
|
111
|
+
const isDesktop = useResponsiveDesktop();
|
|
105
112
|
const onClickDetail = () => {
|
|
106
113
|
openModal({
|
|
107
114
|
onQueryClose: () => closeModal(),
|
|
@@ -111,7 +118,8 @@ function DetailFormatter(props) {
|
|
|
111
118
|
}),
|
|
112
119
|
contentComponent: /* @__PURE__ */ jsx(DetailDialog, {
|
|
113
120
|
log_id
|
|
114
|
-
})
|
|
121
|
+
}),
|
|
122
|
+
fullScreen: !isDesktop ? true : false
|
|
115
123
|
});
|
|
116
124
|
};
|
|
117
125
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
@@ -162,11 +170,13 @@ function ObjectLogs(props) {
|
|
|
162
170
|
}, {
|
|
163
171
|
key: "resource_name",
|
|
164
172
|
name: getLabel("object_logs.resource_name"),
|
|
165
|
-
type: "string"
|
|
173
|
+
type: "string",
|
|
174
|
+
width: 120
|
|
166
175
|
}, {
|
|
167
176
|
key: "log_preview",
|
|
168
177
|
name: getLabel("object_logs.log_preview"),
|
|
169
|
-
type: "string"
|
|
178
|
+
type: "string",
|
|
179
|
+
width: 250
|
|
170
180
|
}, {
|
|
171
181
|
key: "Detail",
|
|
172
182
|
name: getLabel("object_logs.log_detail"),
|
|
@@ -175,7 +185,8 @@ function ObjectLogs(props) {
|
|
|
175
185
|
}, {
|
|
176
186
|
key: "ip",
|
|
177
187
|
name: getLabel("object_logs.ip"),
|
|
178
|
-
type: "string"
|
|
188
|
+
type: "string",
|
|
189
|
+
width: 120
|
|
179
190
|
}], [getLabel]);
|
|
180
191
|
const {
|
|
181
192
|
pagerState,
|
|
@@ -3,11 +3,11 @@ import { styled, Skeleton, Autocomplete, TextField } from "@mui/material";
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { I as Icon } from "../Icon/index.619c31c4.js";
|
|
5
5
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
6
|
-
import { g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.
|
|
6
|
+
import { g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.2ce05d29.js";
|
|
7
7
|
import "@mui/material/Button";
|
|
8
8
|
import "react-hook-form";
|
|
9
9
|
import "react-router-dom";
|
|
10
|
-
import "../../contexts/ModalContext/index.
|
|
10
|
+
import "../../contexts/ModalContext/index.cc3690d3.js";
|
|
11
11
|
import "@mui/lab";
|
|
12
12
|
const ContainerPeriod = styled("div")(({
|
|
13
13
|
theme,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
|
-
export declare const IconButtonAnimate: import("react").ForwardRefExoticComponent<
|
|
3
|
+
export declare const IconButtonAnimate: import("react").ForwardRefExoticComponent<Omit<IconButtonProps<"button", {}>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,6 +2,7 @@ import { useModuleDictionary, useEnvironment, getPropertyByString } from "@m4l/c
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { I as Icon } from "../../Icon/index.619c31c4.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import "@m4l/graphics";
|
|
5
6
|
function BooleanFormatter(props) {
|
|
6
7
|
const {
|
|
7
8
|
presentationType,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { getPropertyByString } from "@m4l/core";
|
|
3
3
|
import "../../Icon/index.619c31c4.js";
|
|
4
4
|
import "@mui/material/styles";
|
|
5
5
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
6
|
+
import { useFormatter } from "@m4l/graphics";
|
|
6
7
|
function DateFormatter(props) {
|
|
7
8
|
const {
|
|
8
9
|
presentationType,
|
|
@@ -11,12 +12,9 @@ function DateFormatter(props) {
|
|
|
11
12
|
Component = React.Fragment
|
|
12
13
|
} = props;
|
|
13
14
|
const {
|
|
14
|
-
|
|
15
|
-
} =
|
|
16
|
-
|
|
17
|
-
formatDate
|
|
18
|
-
} = useHostTools();
|
|
19
|
-
let finalFormat = format || dfnsFormat.datetime_format;
|
|
15
|
+
dateFormatter
|
|
16
|
+
} = useFormatter();
|
|
17
|
+
let finalFormat = format || dateFormatter.datetimeFormat;
|
|
20
18
|
let result;
|
|
21
19
|
let resultDate;
|
|
22
20
|
if (value === void 0 || value === null) {
|
|
@@ -26,13 +24,13 @@ function DateFormatter(props) {
|
|
|
26
24
|
}
|
|
27
25
|
switch (presentationType) {
|
|
28
26
|
case "datetime":
|
|
29
|
-
finalFormat = format ||
|
|
27
|
+
finalFormat = format || dateFormatter.datetimeFormat;
|
|
30
28
|
break;
|
|
31
29
|
case "date":
|
|
32
|
-
finalFormat = format ||
|
|
30
|
+
finalFormat = format || dateFormatter.dateFormat;
|
|
33
31
|
break;
|
|
34
32
|
case "time":
|
|
35
|
-
finalFormat = format ||
|
|
33
|
+
finalFormat = format || dateFormatter.timeFormat;
|
|
36
34
|
break;
|
|
37
35
|
}
|
|
38
36
|
try {
|
|
@@ -41,7 +39,7 @@ function DateFormatter(props) {
|
|
|
41
39
|
} else {
|
|
42
40
|
resultDate = value;
|
|
43
41
|
}
|
|
44
|
-
result = formatDate(resultDate, finalFormat);
|
|
42
|
+
result = dateFormatter.formatDate(resultDate, finalFormat);
|
|
45
43
|
} catch (e) {
|
|
46
44
|
result = "err_typing";
|
|
47
45
|
}
|