@m4l/components 9.3.20 → 9.3.21-JAEBeta.0
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/@types/types.d.ts +1 -1
- package/components/Chip/Chip.js +9 -7
- package/components/Chip/ChipStyles.js +4 -31
- package/components/Chip/helpers.d.ts +10 -0
- package/components/Chip/helpers.js +34 -0
- package/components/Chip/types.d.ts +6 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +1 -1
- package/components/DragResizeWindowRND/DragResizeWindowRND.js +14 -10
- package/components/DragResizeWindowRND/helpers/expandingParentContainer.d.ts +1 -1
- package/components/DragResizeWindowRND/helpers/expandingParentContainer.js +24 -19
- package/components/DragResizeWindowRND/helpers/getInitialSize.d.ts +3 -3
- package/components/DragResizeWindowRND/helpers/getInitialSize.js +18 -15
- package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.d.ts +1 -1
- package/components/DragResizeWindowRND/helpers/shrinkingParentContainer.js +17 -9
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.js +4 -1
- package/components/DragResizeWindowRND/index.d.ts +1 -0
- package/components/DragResizeWindowRND/types.d.ts +12 -2
- package/components/DynamicFilter/DynamicFilter.js +2 -1
- package/components/DynamicFilter/helpers/frontEndHelpers.d.ts +2 -2
- package/components/DynamicFilter/helpers/frontEndHelpers.js +31 -9
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.d.ts +2 -1
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +4 -2
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/types.d.ts +3 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +1 -1
- package/components/DynamicFilter/types.d.ts +4 -0
- package/components/DynamicSort/DynamicSort.js +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.d.ts +2 -1
- package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +4 -2
- package/components/DynamicSort/subcomponents/DynamicSortBase/types.d.ts +3 -0
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +1 -1
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/Image/Image.js +4 -1
- package/components/MFLoader/MFLoader.js +3 -2
- package/components/MFLoader/types.d.ts +5 -0
- package/components/ObjectLogs/hooks/useDetailFormatter.js +1 -1
- package/components/WindowBase/WindowBase.js +3 -3
- package/components/WindowBase/WindowBase.styles.js +36 -31
- package/components/WindowBase/constants.d.ts +1 -1
- package/components/WindowBase/constants.js +2 -2
- package/components/WindowBase/index.d.ts +1 -0
- package/components/WindowBase/subcomponents/Component/index.js +2 -2
- package/components/WindowBase/subcomponents/Component/types.d.ts +2 -0
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +7 -7
- package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/MicroFrontend/types.d.ts +2 -0
- package/components/WindowBase/types.d.ts +3 -3
- package/components/WindowConfirm/WindowConfirm.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +3 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +17 -2
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/areas/index.d.ts +1 -1
- package/components/areas/types.d.ts +1 -1
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js +3 -34
- package/components/formatters/DistanceToNowFormatter/dictionary.d.ts +8 -0
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.d.ts +13 -0
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.js +65 -0
- package/components/formatters/DistanceToNowFormatter/index.d.ts +1 -0
- package/components/formatters/DistanceToNowFormatter/types.d.ts +4 -1
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +5 -1
- package/components/hook-form/RHFAutocomplete/constants.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/constants.js +5 -1
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js +3 -1
- package/components/hook-form/RHFAutocompleteAsync/types.d.ts +4 -0
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/ToggleIconButton.js +6 -2
- package/components/mui_extended/ToggleIconButton/ToggleIconButton.styles.js +9 -0
- package/components/mui_extended/ToggleIconButton/types.d.ts +1 -0
- package/components/mui_extended/index.d.ts +1 -1
- package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +2 -2
- package/components/popups/components/PopupsProvider/hooks/usePopups.js +0 -1
- package/components/popups/components/PopupsViewer/PopupsViewer.js +2 -2
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +3 -1
- package/components/popups/components/PopupsViewer/types.d.ts +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/useSizeContainer/index.d.ts +2 -1
- package/hooks/useSizeContainer/index.js +22 -13
- package/hooks/useSizeContainer/types.d.ts +6 -0
- package/hooks/useStateRef/index.js +4 -4
- package/index.js +45 -38
- package/package.json +1 -1
- package/utils/deepShallow.d.ts +17 -0
- package/utils/deepShallow.js +76 -0
- package/utils/formatDistanceToNow/formatDistanteToNow.d.ts +2 -2
- package/utils/formatDistanceToNow/formatDistanteToNow.js +18 -2
- package/utils/formatDistanceToNow/types.d.ts +13 -0
- package/utils/index.d.ts +1 -0
|
@@ -3,19 +3,21 @@ import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
|
3
3
|
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
4
4
|
import { D as DYNAMIC_FILTER_KEY_COMPONENT } from "../../constants.js";
|
|
5
5
|
import { u as useDynamicFilterBase } from "./useDynamicFilterBase.js";
|
|
6
|
+
import clsx from "clsx";
|
|
6
7
|
import { R as RootStyled, I as InnerContainerStyled } from "../../slots/dynamicFilterSlots.js";
|
|
7
8
|
import { I as InputFilter } from "../InputFilter/InputFilter.js";
|
|
8
9
|
import { A as AppliedFilters } from "../AppliedFilters/AppliedFilters.js";
|
|
9
10
|
import { F as FilterActions } from "../FilterActions/FilterActions.js";
|
|
10
11
|
import { P as PopoverFilter } from "../PopoverFilter/PopoverFilter.js";
|
|
11
12
|
import { D as DynamicFilterSlots } from "../../slots/SlotsEnum.js";
|
|
12
|
-
function DynamicFilterBase() {
|
|
13
|
+
function DynamicFilterBase(props) {
|
|
14
|
+
const { className } = props;
|
|
13
15
|
const { ownerState, dataTestId } = useDynamicFilterBase();
|
|
14
16
|
const classRoot = getComponentSlotRoot(DYNAMIC_FILTER_KEY_COMPONENT);
|
|
15
17
|
return /* @__PURE__ */ jsx(
|
|
16
18
|
RootStyled,
|
|
17
19
|
{
|
|
18
|
-
className: classRoot,
|
|
20
|
+
className: clsx(classRoot, className),
|
|
19
21
|
ownerState: { ...ownerState },
|
|
20
22
|
...getPropDataTestId(DYNAMIC_FILTER_KEY_COMPONENT, DynamicFilterSlots.root, dataTestId),
|
|
21
23
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -273,6 +273,10 @@ rawFilters: Array<RawFilterFieldApply>) => void;
|
|
|
273
273
|
* Propiedades que recibe el componente DynamicFilter
|
|
274
274
|
*/
|
|
275
275
|
export interface DynamicFilterProps {
|
|
276
|
+
/**
|
|
277
|
+
* "className" clase css para el componente
|
|
278
|
+
*/
|
|
279
|
+
className?: string;
|
|
276
280
|
/**
|
|
277
281
|
* "storeId" identificador del store
|
|
278
282
|
*/
|
|
@@ -5,13 +5,14 @@ import { D as DynamicSortProvider } from "./store/DynamicSortContext.js";
|
|
|
5
5
|
import { D as DynamicSortBase } from "./subcomponents/DynamicSortBase/DynamicSortBase.js";
|
|
6
6
|
const DynamicSort = forwardRef(
|
|
7
7
|
(props, ref) => {
|
|
8
|
+
const { className, ...others } = props;
|
|
8
9
|
const hasPresentFlags = useFlagsPresent([
|
|
9
10
|
CommonFlags.FLAG_DICTIONARY_LOADED
|
|
10
11
|
]);
|
|
11
12
|
if (!hasPresentFlags) {
|
|
12
13
|
return null;
|
|
13
14
|
}
|
|
14
|
-
return /* @__PURE__ */ jsx(DynamicSortProvider, { ...
|
|
15
|
+
return /* @__PURE__ */ jsx(DynamicSortProvider, { ...others, ref, children: /* @__PURE__ */ jsx(DynamicSortBase, { className }) });
|
|
15
16
|
}
|
|
16
17
|
);
|
|
17
18
|
export {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { DynamicSortBaseProps } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* DynamicSortBase es un componente base que contiene los subcomponentes InputSort, AppliedSorts, SortActions y PopoverSort.
|
|
3
4
|
*/
|
|
4
|
-
declare function DynamicSortBase(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DynamicSortBase(props: DynamicSortBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export default DynamicSortBase;
|
|
@@ -3,19 +3,21 @@ import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
|
3
3
|
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
4
4
|
import { D as DYNAMIC_SORT_KEY_COMPONENT } from "../../constants.js";
|
|
5
5
|
import { u as useDynamicSortBase } from "./useDynamicSortBase.js";
|
|
6
|
+
import clsx from "clsx";
|
|
6
7
|
import { R as RootStyled, I as InnerContainerStyled } from "../../slots/DynamicSortSlots.js";
|
|
7
8
|
import { I as InputSort } from "../InputSort/InputSort.js";
|
|
8
9
|
import { A as AppliedSorts } from "../AppliedSorts/AppliedSorts.js";
|
|
9
10
|
import { S as SortActions } from "../SortActions/SortActions.js";
|
|
10
11
|
import { P as PopoverSort } from "../PopoverSort/PopoverSort.js";
|
|
11
12
|
import { D as DynamicSortSlots } from "../../slots/SlotsEnum.js";
|
|
12
|
-
function DynamicSortBase() {
|
|
13
|
+
function DynamicSortBase(props) {
|
|
14
|
+
const { className } = props;
|
|
13
15
|
const { ownerState, dataTestId } = useDynamicSortBase();
|
|
14
16
|
const classRoot = getComponentSlotRoot(DYNAMIC_SORT_KEY_COMPONENT);
|
|
15
17
|
return /* @__PURE__ */ jsx(
|
|
16
18
|
RootStyled,
|
|
17
19
|
{
|
|
18
|
-
className: classRoot,
|
|
20
|
+
className: clsx(classRoot, className),
|
|
19
21
|
ownerState: { ...ownerState },
|
|
20
22
|
...getPropDataTestId(DYNAMIC_SORT_KEY_COMPONENT, DynamicSortSlots.root, dataTestId),
|
|
21
23
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -106,6 +106,10 @@ rawSorts: Array<RawSortFieldApply>) => void;
|
|
|
106
106
|
* Propiedades que recibe el componente DynamicSort
|
|
107
107
|
*/
|
|
108
108
|
export interface DynamicSortProps {
|
|
109
|
+
/**
|
|
110
|
+
* "className" clase css para el componente
|
|
111
|
+
*/
|
|
112
|
+
className?: string;
|
|
109
113
|
/**
|
|
110
114
|
* "storeId" identificador del store
|
|
111
115
|
*/
|
|
@@ -14,6 +14,8 @@ function Image(props) {
|
|
|
14
14
|
dataTestId,
|
|
15
15
|
className,
|
|
16
16
|
cover,
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
17
19
|
...others
|
|
18
20
|
} = props;
|
|
19
21
|
const isSkeleton = useModuleSkeleton();
|
|
@@ -31,6 +33,7 @@ function Image(props) {
|
|
|
31
33
|
ImgStyled,
|
|
32
34
|
{
|
|
33
35
|
ownerState: { ...ownerState },
|
|
36
|
+
style: { width, height },
|
|
34
37
|
...getPropDataTestId(IMAGE_KEY_COMPONENT, ImageSlots.root, dataTestId),
|
|
35
38
|
...others,
|
|
36
39
|
className: clsx(IMAGE_CLASSES.root, className)
|
|
@@ -38,7 +41,7 @@ function Image(props) {
|
|
|
38
41
|
) })
|
|
39
42
|
}
|
|
40
43
|
);
|
|
41
|
-
}, [
|
|
44
|
+
}, [enableIntersectionObserver, threshold, ownerState, width, height, dataTestId, others, className]);
|
|
42
45
|
return lazyLoadComponent;
|
|
43
46
|
}
|
|
44
47
|
export {
|
|
@@ -30,7 +30,7 @@ function getDivScritId(prefix, moduleId) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function MFLoader(props) {
|
|
33
|
-
const { prefix, moduleId, cache = true, debugPort, dynamicMFStore, windowTools } = props;
|
|
33
|
+
const { prefix, moduleId, cache = true, debugPort, dynamicMFStore, windowTools, emergeType } = props;
|
|
34
34
|
const { hostThemeOptions, fnComponentsOverrides } = useHostTheme();
|
|
35
35
|
const { networkOperation } = useNetwork();
|
|
36
36
|
const environment = useEnvironment();
|
|
@@ -74,7 +74,8 @@ function MFLoader(props) {
|
|
|
74
74
|
axiosOperation,
|
|
75
75
|
formatter,
|
|
76
76
|
dynamicMFStore,
|
|
77
|
-
windowTools
|
|
77
|
+
windowTools,
|
|
78
|
+
emergeType
|
|
78
79
|
);
|
|
79
80
|
} catch (_e) {
|
|
80
81
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DynamicMFStore } from '../WindowBase/contexts/DynamicMFParmsContext/store';
|
|
2
2
|
import { WindowToolsMF } from '../WindowBase/contexts';
|
|
3
|
+
import { EmergeType } from '../areas/types';
|
|
3
4
|
/**
|
|
4
5
|
* Propiedades base de un microfrontend.
|
|
5
6
|
*/
|
|
@@ -33,4 +34,8 @@ export interface MFLoaderProps extends MFBaseProps {
|
|
|
33
34
|
* Herramientas de ventana para el microfrontend.
|
|
34
35
|
*/
|
|
35
36
|
windowTools: WindowToolsMF;
|
|
37
|
+
/**
|
|
38
|
+
* Tipo de lanzamiento de la ventana, popup, layout, modal
|
|
39
|
+
*/
|
|
40
|
+
emergeType?: EmergeType;
|
|
36
41
|
}
|
|
@@ -33,7 +33,7 @@ const useDetailFormatter = (type) => {
|
|
|
33
33
|
title: getLabel(`${DICTIONARY.LABEL_LOG_DETAIL}`),
|
|
34
34
|
onClose: closeModal,
|
|
35
35
|
variant: "outlined",
|
|
36
|
-
|
|
36
|
+
emergeType: "modal",
|
|
37
37
|
children: /* @__PURE__ */ jsx(StackStyled, { direction: "column", flexGrow: 1, children: /* @__PURE__ */ jsx(DetailDialogComponent, { logId, type }) })
|
|
38
38
|
}
|
|
39
39
|
),
|
|
@@ -25,7 +25,7 @@ const WindowBase = (props) => {
|
|
|
25
25
|
windowId,
|
|
26
26
|
onMouseDown,
|
|
27
27
|
editionInfo,
|
|
28
|
-
|
|
28
|
+
emergeType = "layout",
|
|
29
29
|
collapsed,
|
|
30
30
|
draggable = true,
|
|
31
31
|
...other
|
|
@@ -36,7 +36,7 @@ const WindowBase = (props) => {
|
|
|
36
36
|
selected,
|
|
37
37
|
variant: computedVariant,
|
|
38
38
|
size: currentSize,
|
|
39
|
-
|
|
39
|
+
emergeType,
|
|
40
40
|
maximized,
|
|
41
41
|
collapsed,
|
|
42
42
|
draggable
|
|
@@ -61,7 +61,7 @@ const WindowBase = (props) => {
|
|
|
61
61
|
maximized,
|
|
62
62
|
collapsed,
|
|
63
63
|
onClose,
|
|
64
|
-
|
|
64
|
+
emergeType,
|
|
65
65
|
draggable,
|
|
66
66
|
...other
|
|
67
67
|
}
|
|
@@ -16,7 +16,7 @@ const windowBaseStyles = {
|
|
|
16
16
|
overflow: "hidden",
|
|
17
17
|
...ownerState?.variant === "outlined" && {
|
|
18
18
|
...ownerState?.selected ? {
|
|
19
|
-
...ownerState?.
|
|
19
|
+
...ownerState?.emergeType === "layout" ? {
|
|
20
20
|
background: `linear-gradient(to bottom,
|
|
21
21
|
${theme.vars.palette.primary.opacityGradient1},
|
|
22
22
|
${theme.vars.palette.primary.opacityGradient2})`,
|
|
@@ -31,26 +31,26 @@ const windowBaseStyles = {
|
|
|
31
31
|
boxShadow: `inset 0px 0px 0 1px ${theme.vars.palette?.border.main}`
|
|
32
32
|
}
|
|
33
33
|
} : {
|
|
34
|
-
boxShadow: ownerState?.
|
|
34
|
+
boxShadow: ownerState?.emergeType === "layout" ? `inset 0px 0px 0 1px ${theme.vars.palette?.border.secondary}` : "unset"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
...ownerState?.
|
|
37
|
+
...ownerState?.emergeType === "popup" && {
|
|
38
38
|
"&&&": {
|
|
39
39
|
boxShadow: theme.vars.customShadows.z1,
|
|
40
40
|
border: `1px solid ${theme.vars.palette?.border.secondary}`,
|
|
41
|
-
borderRadius: theme.vars.size.borderRadius.
|
|
41
|
+
borderRadius: theme.vars.size.borderRadius.r3,
|
|
42
42
|
...ownerState?.selected && {
|
|
43
43
|
boxShadow: theme.vars.customShadows.z4,
|
|
44
|
-
border: `1px solid ${theme.vars.palette?.
|
|
44
|
+
border: `1px solid ${theme.vars.palette?.primary.activeOpacity}`
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
...ownerState?.
|
|
48
|
+
...ownerState?.emergeType === "layout" && {
|
|
49
49
|
...ownerState?.selected && !ownerState?.maximized ? {
|
|
50
50
|
boxShadow: theme.vars.customShadows.primary
|
|
51
51
|
} : {}
|
|
52
52
|
},
|
|
53
|
-
...ownerState?.
|
|
53
|
+
...ownerState?.emergeType === "modal" && {
|
|
54
54
|
boxShadow: `${theme.vars.customShadows.z3}!important`
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -59,8 +59,8 @@ const windowBaseStyles = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Styles for the content of the window base component.
|
|
61
61
|
*/
|
|
62
|
-
contentWindowBase: ({
|
|
63
|
-
padding: ownerState?.
|
|
62
|
+
contentWindowBase: ({ ownerState, theme }) => ({
|
|
63
|
+
padding: ownerState?.emergeType === "layout" ? theme.vars.size.baseSpacings.sp5 : theme.vars.size.baseSpacings.sp4,
|
|
64
64
|
overflow: "auto",
|
|
65
65
|
width: "100%",
|
|
66
66
|
height: "100%",
|
|
@@ -69,6 +69,17 @@ const windowBaseStyles = {
|
|
|
69
69
|
display: "none"
|
|
70
70
|
}
|
|
71
71
|
}),
|
|
72
|
+
/**
|
|
73
|
+
* Window component content Styles by emergeType
|
|
74
|
+
*/
|
|
75
|
+
windowContainerComponent: () => ({
|
|
76
|
+
//Mover el estilado para adentro
|
|
77
|
+
position: "relative",
|
|
78
|
+
display: "flex",
|
|
79
|
+
width: "100%",
|
|
80
|
+
height: "100%",
|
|
81
|
+
overflow: "visible"
|
|
82
|
+
}),
|
|
72
83
|
/**
|
|
73
84
|
* Styles for the header of the window base component.
|
|
74
85
|
*/
|
|
@@ -76,14 +87,19 @@ const windowBaseStyles = {
|
|
|
76
87
|
return {
|
|
77
88
|
width: "100%",
|
|
78
89
|
display: "flex",
|
|
79
|
-
padding:
|
|
90
|
+
padding: theme.vars.size.baseSpacings.sp1,
|
|
91
|
+
borderBottom: "1px solid #ffffff00",
|
|
92
|
+
...(ownerState?.emergeType === "popup" || ownerState?.emergeType === "modal") && {
|
|
93
|
+
padding: `${theme.vars.size.baseSpacings["sp2-5"]} ${theme.vars.size.baseSpacings.sp2} 0 ${theme.vars.size.baseSpacings.sp2}`,
|
|
94
|
+
borderBottom: `unset`
|
|
95
|
+
},
|
|
80
96
|
alignItems: "center",
|
|
81
97
|
justifyContent: "space-between",
|
|
82
98
|
flexShrink: 0,
|
|
83
99
|
alignSelf: "stretch",
|
|
84
100
|
cursor: ownerState?.draggable ? "all-scroll" : "default",
|
|
85
101
|
position: "relative",
|
|
86
|
-
...ownerState?.
|
|
102
|
+
...ownerState?.emergeType === "layout" || ownerState?.emergeType === "modal" ? getSizeStyles(
|
|
87
103
|
theme,
|
|
88
104
|
ownerState?.size,
|
|
89
105
|
"container",
|
|
@@ -101,8 +117,7 @@ const windowBaseStyles = {
|
|
|
101
117
|
})
|
|
102
118
|
)
|
|
103
119
|
},
|
|
104
|
-
|
|
105
|
-
...ownerState?.selected && ownerState?.type === "layout" && ownerState?.variant === "outlined" && !ownerState?.maximized ? {
|
|
120
|
+
...ownerState?.selected && ownerState?.emergeType === "layout" && ownerState?.variant === "outlined" && !ownerState?.maximized ? {
|
|
106
121
|
background: `linear-gradient(to right, ${theme.vars.palette.primary.opacity}, #ffffff00);`,
|
|
107
122
|
"&::before": {
|
|
108
123
|
content: '""',
|
|
@@ -114,8 +129,7 @@ const windowBaseStyles = {
|
|
|
114
129
|
background: `linear-gradient(to left, ${theme.vars.palette.primary.opacityGradient2}, #ffffff00);`
|
|
115
130
|
}
|
|
116
131
|
} : {
|
|
117
|
-
background: "transparent"
|
|
118
|
-
borderBottom: `1px solid ${theme.vars.palette.border.disabled}`
|
|
132
|
+
background: "transparent"
|
|
119
133
|
}
|
|
120
134
|
};
|
|
121
135
|
},
|
|
@@ -138,7 +152,7 @@ const windowBaseStyles = {
|
|
|
138
152
|
*/
|
|
139
153
|
headerTitleWindowBase: ({ theme, ownerState }) => ({
|
|
140
154
|
minWidth: "30px",
|
|
141
|
-
...ownerState?.selected && ownerState?.
|
|
155
|
+
...ownerState?.selected && ownerState?.emergeType !== "modal" ? {
|
|
142
156
|
color: `${theme.vars.palette["primary"].semanticText} !important`
|
|
143
157
|
} : {
|
|
144
158
|
color: `${theme.vars.palette.text.secondary} !important`
|
|
@@ -180,7 +194,7 @@ const windowBaseStyles = {
|
|
|
180
194
|
headerSubTitleWindowBase: ({ theme, ownerState }) => ({
|
|
181
195
|
width: "auto !important",
|
|
182
196
|
height: "auto !important",
|
|
183
|
-
...ownerState?.selected && ownerState?.
|
|
197
|
+
...ownerState?.selected && ownerState?.emergeType !== "modal" ? {
|
|
184
198
|
color: `${theme.vars.palette["primary"].semanticText} !important`
|
|
185
199
|
} : {
|
|
186
200
|
color: `${theme.vars.palette.text.secondary} !important`
|
|
@@ -196,7 +210,7 @@ const windowBaseStyles = {
|
|
|
196
210
|
*/
|
|
197
211
|
headerIconWindowBase: ({ theme, ownerState }) => ({
|
|
198
212
|
"& .M4LIcon-icon": {
|
|
199
|
-
...ownerState?.selected && ownerState?.
|
|
213
|
+
...ownerState?.selected && ownerState?.emergeType !== "modal" ? {
|
|
200
214
|
backgroundColor: `${theme.vars.palette["primary"].semanticText} !important`
|
|
201
215
|
} : {
|
|
202
216
|
backgroundColor: `${theme.vars.palette.text.secondary} !important`
|
|
@@ -228,7 +242,7 @@ const windowBaseStyles = {
|
|
|
228
242
|
),
|
|
229
243
|
marginLeft: theme.vars.size.baseSpacings.sp1,
|
|
230
244
|
marginRight: theme.vars.size.baseSpacings.sp1,
|
|
231
|
-
marginBottom: ownerState?.
|
|
245
|
+
marginBottom: ownerState?.emergeType === "layout" ? "auto" : "unset"
|
|
232
246
|
},
|
|
233
247
|
'& .window-actions[class*="M4LIconButton-styledMUIIconButton"]': {
|
|
234
248
|
...getSizeStyles(
|
|
@@ -242,7 +256,7 @@ const windowBaseStyles = {
|
|
|
242
256
|
),
|
|
243
257
|
marginLeft: theme.vars.size.baseSpacings.sp1,
|
|
244
258
|
marginRight: theme.vars.size.baseSpacings.sp1,
|
|
245
|
-
marginBottom: ownerState?.
|
|
259
|
+
marginBottom: ownerState?.emergeType === "layout" ? "auto!important" : "unset!important",
|
|
246
260
|
"&.collapse-toggle": {
|
|
247
261
|
...ownerState?.maximized && {
|
|
248
262
|
display: "none"
|
|
@@ -304,7 +318,7 @@ const windowBaseStyles = {
|
|
|
304
318
|
*/
|
|
305
319
|
pointIcon: ({ theme, ownerState }) => ({
|
|
306
320
|
"& .M4LIcon-icon": {
|
|
307
|
-
...ownerState?.selected && ownerState?.
|
|
321
|
+
...ownerState?.selected && ownerState?.emergeType !== "modal" && ownerState?.variant === "outlined" ? {
|
|
308
322
|
backgroundColor: `${theme.vars.palette["primary"].semanticText} !important`
|
|
309
323
|
} : {
|
|
310
324
|
backgroundColor: `${theme.vars.palette.text.secondary} !important`
|
|
@@ -320,7 +334,7 @@ const windowBaseStyles = {
|
|
|
320
334
|
* Styles for the menu actions of the window base component.
|
|
321
335
|
*/
|
|
322
336
|
menuActionsWindowBase: ({ theme, ownerState }) => ({
|
|
323
|
-
...ownerState?.
|
|
337
|
+
...ownerState?.emergeType === "layout" ? {
|
|
324
338
|
...getSizeStyles(
|
|
325
339
|
theme,
|
|
326
340
|
ownerState?.size,
|
|
@@ -363,15 +377,6 @@ const windowBaseStyles = {
|
|
|
363
377
|
maxWidth: "100%"
|
|
364
378
|
}
|
|
365
379
|
}),
|
|
366
|
-
/**
|
|
367
|
-
* Window component content Styles
|
|
368
|
-
*/
|
|
369
|
-
windowContainerComponent: () => ({
|
|
370
|
-
display: "flex",
|
|
371
|
-
width: "100%",
|
|
372
|
-
height: "100%",
|
|
373
|
-
overflow: "auto"
|
|
374
|
-
}),
|
|
375
380
|
/**
|
|
376
381
|
* Styles for the toast container of the window base component.
|
|
377
382
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const WINDOW_BASE_KEY_COMPONENT = "M4LWindowBase";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const windowBaseClasses: Record<string, string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
|
|
2
2
|
import { W as WindowBaseSlots } from "./slots/WindowBaseEnum.js";
|
|
3
3
|
const WINDOW_BASE_KEY_COMPONENT = "M4LWindowBase";
|
|
4
|
-
const
|
|
4
|
+
const windowBaseClasses = getComponentClasses(WINDOW_BASE_KEY_COMPONENT, WindowBaseSlots);
|
|
5
5
|
export {
|
|
6
6
|
WINDOW_BASE_KEY_COMPONENT as W,
|
|
7
|
-
|
|
7
|
+
windowBaseClasses as w
|
|
8
8
|
};
|
|
@@ -5,3 +5,4 @@ export * from './contexts/WindowToolsMFContext';
|
|
|
5
5
|
export * from './contexts/DynamicMFParmsContext';
|
|
6
6
|
export type { WindowToolsMFContextProps } from './contexts/WindowToolsMFContext/types';
|
|
7
7
|
export type { ModuleAction, GroupActionMenuItem, ModuleActionGroup } from './types';
|
|
8
|
+
export type { JSX_REACT_NODE } from './types';
|
|
@@ -4,8 +4,8 @@ import { a as WindowContainerComponentStyled } from "../../slots/WindowBaseSlots
|
|
|
4
4
|
import { a as WindowToolsMFProvider } from "../../contexts/WindowToolsMFContext/WindowToolsMFContext.js";
|
|
5
5
|
import { a as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/DynamicMFParmsContext.js";
|
|
6
6
|
const WindowBaseComponent = (props) => {
|
|
7
|
-
const { component, dynamicMFStore, windowTools, componentProps } = props;
|
|
8
|
-
return /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(WindowContainerComponentStyled, { ownerState: {}, children: typeof component === "function" ? component(componentProps) : component }) }) });
|
|
7
|
+
const { component, dynamicMFStore, windowTools, componentProps, emergeType } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx(WindowContainerComponentStyled, { ownerState: { emergeType }, children: typeof component === "function" ? component(componentProps) : component }) }) });
|
|
9
9
|
};
|
|
10
10
|
React.memo(WindowBaseComponent);
|
|
11
11
|
export {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { WindowToolsMF } from '../../contexts';
|
|
2
2
|
import { DynamicMFStore } from '../../contexts/DynamicMFParmsContext/store';
|
|
3
3
|
import { JSX_REACT_NODE } from '../../../WindowBase/types';
|
|
4
|
+
import { EmergeType } from '../../../areas/types';
|
|
4
5
|
export interface ComponentProps {
|
|
6
|
+
emergeType: EmergeType;
|
|
5
7
|
windowTools: WindowToolsMF;
|
|
6
8
|
dynamicMFStore: DynamicMFStore;
|
|
7
9
|
component: JSX_REACT_NODE;
|
|
@@ -8,7 +8,7 @@ import { deepEqual } from "fast-equals";
|
|
|
8
8
|
import { useFormatter } from "@m4l/graphics";
|
|
9
9
|
import { u as useButtonActions } from "./useButtonActions.js";
|
|
10
10
|
import { H as HeaderWindowComponentStyled, c as HeaderContentStyled, I as IconWindowStyled, d as ContainerTitleSubtitleStyled, e as TitleWindowStyled, P as PointIconStyled, S as SubtitleWindowStyled, f as IconsWrapperStyled, g as ContainerLeftActionsStyled, M as MenuActionsWindowsStyled } from "../../slots/WindowBaseSlots.js";
|
|
11
|
-
import {
|
|
11
|
+
import { w as windowBaseClasses } from "../../constants.js";
|
|
12
12
|
import clsx from "clsx";
|
|
13
13
|
const HeaderWindowBase = (props) => {
|
|
14
14
|
const {
|
|
@@ -24,7 +24,7 @@ const HeaderWindowBase = (props) => {
|
|
|
24
24
|
variant,
|
|
25
25
|
actions = [],
|
|
26
26
|
collapsed,
|
|
27
|
-
|
|
27
|
+
emergeType,
|
|
28
28
|
draggable
|
|
29
29
|
} = props;
|
|
30
30
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -103,17 +103,17 @@ const HeaderWindowBase = (props) => {
|
|
|
103
103
|
maximized,
|
|
104
104
|
variant,
|
|
105
105
|
size,
|
|
106
|
-
|
|
106
|
+
emergeType,
|
|
107
107
|
collapsed,
|
|
108
108
|
draggable
|
|
109
109
|
};
|
|
110
110
|
const IconButtonLeftActions = useButtonActions(leftActions);
|
|
111
111
|
const IconButtonRightActions = useButtonActions(rightActions);
|
|
112
|
-
return /* @__PURE__ */ jsxs(HeaderWindowComponentStyled, { className: clsx(draggable && dragResizeWindowRNDClasses.draggableHandle,
|
|
113
|
-
/* @__PURE__ */ jsxs(HeaderContentStyled, { ownerState, children: [
|
|
112
|
+
return /* @__PURE__ */ jsxs(HeaderWindowComponentStyled, { className: clsx(draggable && dragResizeWindowRNDClasses.draggableHandle, windowBaseClasses.headerWindowComponent), ownerState, children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(HeaderContentStyled, { ownerState, className: windowBaseClasses.headerContentWindowBase, children: [
|
|
114
114
|
iconUrl && /* @__PURE__ */ jsx(IconWindowStyled, { size, ownerState, src: iconUrl, "aria-label": "main icon" }),
|
|
115
115
|
/* @__PURE__ */ jsxs(ContainerTitleSubtitleStyled, { size, ownerState, children: [
|
|
116
|
-
/* @__PURE__ */ jsx(TitleWindowStyled, { variant:
|
|
116
|
+
/* @__PURE__ */ jsx(TitleWindowStyled, { variant: emergeType === "popup" || emergeType === "modal" ? "body" : "captionDens", size, skeletonWidth: 100, ownerState, children: title }),
|
|
117
117
|
subTitle && /* @__PURE__ */ jsx(
|
|
118
118
|
PointIconStyled,
|
|
119
119
|
{
|
|
@@ -122,7 +122,7 @@ const HeaderWindowBase = (props) => {
|
|
|
122
122
|
ownerState
|
|
123
123
|
}
|
|
124
124
|
),
|
|
125
|
-
subTitle && /* @__PURE__ */ jsx(SubtitleWindowStyled, { variant:
|
|
125
|
+
subTitle && /* @__PURE__ */ jsx(SubtitleWindowStyled, { variant: emergeType === "popup" || emergeType === "modal" ? "body" : "captionDens", size, skeletonWidth: 100, ownerState, children: subTitle })
|
|
126
126
|
] })
|
|
127
127
|
] }),
|
|
128
128
|
/* @__PURE__ */ jsxs(
|
|
@@ -32,7 +32,7 @@ import { WindowBaseAction, WindowBaseProps } from '../../types';
|
|
|
32
32
|
* - `selected` modifies the visual appearance to indicate the selected state.
|
|
33
33
|
* @see WindowBaseProps - General properties for the window base.
|
|
34
34
|
*/
|
|
35
|
-
export type HeaderProps = Pick<WindowBaseProps, 'title' | 'subTitle' | 'iconUrl' | 'onClose' | 'version' | 'selected' | 'variant' | '
|
|
35
|
+
export type HeaderProps = Pick<WindowBaseProps, 'title' | 'subTitle' | 'iconUrl' | 'onClose' | 'version' | 'selected' | 'variant' | 'emergeType' | 'buildTime' | 'maximized' | 'draggable'> & {
|
|
36
36
|
actions?: WindowBaseAction[];
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EmergeType } from '../../../areas/types';
|
|
1
2
|
import { MFBaseProps } from '../../../MFLoader/types';
|
|
2
3
|
import { WindowToolsMF } from '../../contexts';
|
|
3
4
|
import { DynamicMFStore } from '../../contexts/DynamicMFParmsContext/store';
|
|
@@ -5,4 +6,5 @@ export interface MicroFrontendProps extends MFBaseProps {
|
|
|
5
6
|
moduleId: string;
|
|
6
7
|
windowTools: WindowToolsMF;
|
|
7
8
|
dynamicMFStore: DynamicMFStore;
|
|
9
|
+
emergeType: EmergeType;
|
|
8
10
|
}
|
|
@@ -189,7 +189,7 @@ export interface WindowBaseProps {
|
|
|
189
189
|
* - `'window'`: A window.
|
|
190
190
|
* Default is `'window'` if not specified.
|
|
191
191
|
*/
|
|
192
|
-
|
|
192
|
+
emergeType?: EmergeType;
|
|
193
193
|
/**
|
|
194
194
|
* Indicates if the window is draggable.
|
|
195
195
|
*/
|
|
@@ -210,13 +210,13 @@ export type WindowBaseType = keyof typeof WindowBaseSlots;
|
|
|
210
210
|
* windowBaseVariant (optional) - Visual variant of the component (`'outlined'` or `'text'`).
|
|
211
211
|
* windowBaseSize (optional) - Size of the component (`'small'` or `'medium'`).
|
|
212
212
|
*/
|
|
213
|
-
export type WindowBaseOwnerState =
|
|
213
|
+
export type WindowBaseOwnerState = {
|
|
214
214
|
selected?: WindowBaseProps['selected'];
|
|
215
215
|
collapsed?: WindowBaseProps['collapsed'];
|
|
216
216
|
maximized?: WindowBaseProps['maximized'];
|
|
217
217
|
variant?: WindowBaseProps['variant'];
|
|
218
218
|
size?: WindowBaseProps['size'];
|
|
219
|
-
|
|
219
|
+
emergeType?: WindowBaseProps['emergeType'];
|
|
220
220
|
draggable?: WindowBaseProps['draggable'];
|
|
221
221
|
};
|
|
222
222
|
/**
|
|
@@ -56,7 +56,7 @@ const WindowConfirm = (props) => {
|
|
|
56
56
|
info: `${host_static_assets}/${environment_assets}/frontend/components/window_confirm/assets/icons/Info.svg`
|
|
57
57
|
};
|
|
58
58
|
const iconUrl = iconMap[variant] || iconMap.warning;
|
|
59
|
-
return /* @__PURE__ */ jsx(AppearanceComponentProvider, { defaultSize: currentSize, children: /* @__PURE__ */ jsx(WindowBase, { iconUrl, variant: "outlined", title: getLabel("modal_dialog.label_window_confirm"), onClose: () => closeModal(),
|
|
59
|
+
return /* @__PURE__ */ jsx(AppearanceComponentProvider, { defaultSize: currentSize, children: /* @__PURE__ */ jsx(WindowBase, { iconUrl, variant: "outlined", title: getLabel("modal_dialog.label_window_confirm"), onClose: () => closeModal(), emergeType: "modal", children: /* @__PURE__ */ jsx(
|
|
60
60
|
WindowConfirmRootStyled,
|
|
61
61
|
{
|
|
62
62
|
className: clsx(getComponentSlotRoot(WINDOW_CONFIRM_KEY_COMPONENT)),
|
package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js
CHANGED
|
@@ -67,7 +67,7 @@ const Window = (props) => {
|
|
|
67
67
|
selected,
|
|
68
68
|
maximized: !!maximizedId,
|
|
69
69
|
onMouseDown: onTouch,
|
|
70
|
-
|
|
70
|
+
emergeType,
|
|
71
71
|
collapsed,
|
|
72
72
|
...process.env.NODE_ENV !== "production" ? {
|
|
73
73
|
[TEST_PROP_ID]: getNameDataTestId(
|
|
@@ -79,6 +79,7 @@ const Window = (props) => {
|
|
|
79
79
|
children: status === "loaded" ? winType === "microfrontend" ? /* @__PURE__ */ jsx(
|
|
80
80
|
MemonizedWindowBaseMicroFrontend,
|
|
81
81
|
{
|
|
82
|
+
emergeType,
|
|
82
83
|
moduleId,
|
|
83
84
|
dynamicMFStore,
|
|
84
85
|
windowTools,
|
|
@@ -87,6 +88,7 @@ const Window = (props) => {
|
|
|
87
88
|
) : /* @__PURE__ */ jsx(
|
|
88
89
|
WindowBaseComponent,
|
|
89
90
|
{
|
|
91
|
+
emergeType,
|
|
90
92
|
dynamicMFStore,
|
|
91
93
|
windowTools,
|
|
92
94
|
component
|
|
@@ -5,7 +5,22 @@ import { u as useHeaderActions } from "./useHeaderActions.js";
|
|
|
5
5
|
import { u as usePopupsStore } from "../../../../../../../../popups/components/PopupsProvider/hooks/usePopupsStore.js";
|
|
6
6
|
import { c as createToaster } from "../../../../../../../../ToastContainer/helpers/toaster.js";
|
|
7
7
|
const useWindow = (windowId, areaId) => {
|
|
8
|
-
const [
|
|
8
|
+
const [
|
|
9
|
+
emergeType,
|
|
10
|
+
moduleId,
|
|
11
|
+
winType,
|
|
12
|
+
title,
|
|
13
|
+
subTitle,
|
|
14
|
+
editionInfo,
|
|
15
|
+
iconUrl,
|
|
16
|
+
version,
|
|
17
|
+
buildTime,
|
|
18
|
+
moduleCount,
|
|
19
|
+
selected,
|
|
20
|
+
loading,
|
|
21
|
+
status,
|
|
22
|
+
dynamicMFStore
|
|
23
|
+
] = useAreasStore((state) => {
|
|
9
24
|
const window = state.hashWindows[windowId];
|
|
10
25
|
const selected2 = areaId ? state.hashAreas[areaId]?.currentLayoutId === windowId : false;
|
|
11
26
|
return [
|
|
@@ -66,7 +81,7 @@ const useWindow = (windowId, areaId) => {
|
|
|
66
81
|
throw new Error("show not implemented");
|
|
67
82
|
}
|
|
68
83
|
}),
|
|
69
|
-
[windowId,
|
|
84
|
+
[windowId, setActions, getCookie, getCookies, setCookie, close, startProgress, stopProgress, setFnQueryClose, setWindowTitle]
|
|
70
85
|
);
|
|
71
86
|
useEffect(() => {
|
|
72
87
|
if (status === "init") {
|
|
@@ -441,8 +441,8 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
441
441
|
bounds: {
|
|
442
442
|
left: MARGIN_GRIDLAYOUT,
|
|
443
443
|
top: MARGIN_GRIDLAYOUT,
|
|
444
|
-
right: -
|
|
445
|
-
bottom: -
|
|
444
|
+
right: -10,
|
|
445
|
+
bottom: -10
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
448
|
}
|