@m4l/components 9.3.5 → 9.3.6
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/ObjectLogs/subcomponents/DetailDialog/index.js +3 -8
- package/components/ObjectLogs/types.d.ts +0 -2
- package/components/extended/React-Json-Viewer/ReactJsonViewer.d.ts +7 -0
- package/components/extended/React-Json-Viewer/ReactJsonViewer.js +31 -0
- package/components/extended/React-Json-Viewer/ReactJsonViewer.styles.d.ts +2 -0
- package/components/extended/React-Json-Viewer/ReactJsonViewer.styles.js +12 -0
- package/components/extended/React-Json-Viewer/constants.d.ts +2 -0
- package/components/extended/React-Json-Viewer/constants.js +8 -0
- package/components/extended/React-Json-Viewer/helpers/getReactJsonViewerTheme/getReactJsonViewerTheme.d.ts +8 -0
- package/components/extended/React-Json-Viewer/helpers/getReactJsonViewerTheme/getReactJsonViewerTheme.js +23 -0
- package/components/extended/React-Json-Viewer/helpers/getReactJsonViewerTheme/index.d.ts +1 -0
- package/components/extended/React-Json-Viewer/index.d.ts +1 -0
- package/components/extended/React-Json-Viewer/index.js +1 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerEnum.d.ts +3 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerEnum.js +7 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerSlots.d.ts +1 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerSlots.js +11 -0
- package/components/extended/React-Json-Viewer/test/ReactJsonViewer.test.d.ts +1 -0
- package/components/extended/React-Json-Viewer/types.d.ts +12 -0
- package/components/extended/index.d.ts +1 -0
- package/index.js +42 -40
- package/package.json +1 -1
- package/storybook/components/extended/React-Json-Viewer/ReactJsonViewer.stories.d.ts +9 -0
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { useNetwork } from "@m4l/core";
|
|
4
|
-
import { useHostTheme } from "@m4l/graphics";
|
|
5
|
-
import ReactJson from "@microlink/react-json-view";
|
|
6
4
|
import { a as OBJECT_LOGS_M4L_END_POINT, b as OBJECT_LOGS_OTHERS_END_POINT } from "../../constants.js";
|
|
5
|
+
import { R as ReactJsonViewer } from "../../../extended/React-Json-Viewer/ReactJsonViewer.js";
|
|
7
6
|
function DetailDialog(props) {
|
|
8
|
-
const { logId,
|
|
7
|
+
const { logId, type } = props;
|
|
9
8
|
const { networkOperation } = useNetwork();
|
|
10
|
-
const { hostThemeOptions } = useHostTheme();
|
|
11
9
|
const [detail, setDetail] = useState({});
|
|
12
10
|
useEffect(() => {
|
|
13
11
|
let mounted = true;
|
|
@@ -27,12 +25,9 @@ function DetailDialog(props) {
|
|
|
27
25
|
mounted = false;
|
|
28
26
|
};
|
|
29
27
|
}, []);
|
|
30
|
-
const modeTheme = hostThemeOptions.palette?.mode;
|
|
31
|
-
const appliedTheme = theme || (modeTheme === "dark" ? "summerfruit" : "rjv-default");
|
|
32
28
|
return /* @__PURE__ */ jsx(
|
|
33
|
-
|
|
29
|
+
ReactJsonViewer,
|
|
34
30
|
{
|
|
35
|
-
theme: appliedTheme,
|
|
36
31
|
name: null,
|
|
37
32
|
sortKeys: true,
|
|
38
33
|
displayDataTypes: false,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Maybe } from '@m4l/core';
|
|
2
|
-
import { ThemeKeys, ThemeObject } from '@microlink/react-json-view';
|
|
3
2
|
import { Theme } from '@mui/material';
|
|
4
3
|
import { ObjectLogsSlots } from './slots/ObjectLogsEnum';
|
|
5
4
|
import { OBJECT_LOGS_KEY_COMPONENT } from './constants';
|
|
@@ -35,7 +34,6 @@ export interface ObjectLogsQueryParams {
|
|
|
35
34
|
export interface DetailDialogProps {
|
|
36
35
|
type: 'm4l' | 'other';
|
|
37
36
|
logId: number | string;
|
|
38
|
-
theme?: ThemeKeys | ThemeObject;
|
|
39
37
|
}
|
|
40
38
|
export type ObjectLogsSlotsType = keyof typeof ObjectLogsSlots;
|
|
41
39
|
export type ObjectLogsOwnerState = {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactJsonViewerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente para visualizar datos en formato JSON.
|
|
4
|
+
* @param props - Props del componente.
|
|
5
|
+
* @returns Componente ReactJsonViewer.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ReactJsonViewer: (props: ReactJsonViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import ReactJson from "@microlink/react-json-view";
|
|
4
|
+
import { R as ReactJsonViewerRootStyled } from "./slots/ReactJsonViewerSlots.js";
|
|
5
|
+
import { R as REACT_JSON_VIEWER_CLASSES } from "./constants.js";
|
|
6
|
+
import { useTheme } from "@mui/material";
|
|
7
|
+
import { g as getReactJsonViewerTheme } from "./helpers/getReactJsonViewerTheme/getReactJsonViewerTheme.js";
|
|
8
|
+
const ReactJsonViewer = (props) => {
|
|
9
|
+
const { className, dataTestId, ...others } = props;
|
|
10
|
+
const muiTheme = useTheme();
|
|
11
|
+
const theme = getReactJsonViewerTheme(muiTheme);
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
ReactJsonViewerRootStyled,
|
|
14
|
+
{
|
|
15
|
+
className: clsx(REACT_JSON_VIEWER_CLASSES.root, className),
|
|
16
|
+
dataTestId,
|
|
17
|
+
role: "application",
|
|
18
|
+
"aria-label": "JSON data viewer",
|
|
19
|
+
children: /* @__PURE__ */ jsx(
|
|
20
|
+
ReactJson,
|
|
21
|
+
{
|
|
22
|
+
theme,
|
|
23
|
+
...others
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
ReactJsonViewer as R
|
|
31
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { R as ReactJsonViewerSlots } from "./slots/ReactJsonViewerEnum.js";
|
|
3
|
+
const REACT_JSON_VIEWER_KEY_COMPONENT = "M4LReactJsonViewer";
|
|
4
|
+
const REACT_JSON_VIEWER_CLASSES = getComponentClasses(REACT_JSON_VIEWER_KEY_COMPONENT, ReactJsonViewerSlots);
|
|
5
|
+
export {
|
|
6
|
+
REACT_JSON_VIEWER_CLASSES as R,
|
|
7
|
+
REACT_JSON_VIEWER_KEY_COMPONENT as a
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ThemeObject } from '@microlink/react-json-view';
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
3
|
+
/**
|
|
4
|
+
* Función para obtener los colores del tema de MUI.
|
|
5
|
+
* @param muiTheme - Tema de MUI.
|
|
6
|
+
* @returns Colores del tema.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getReactJsonViewerTheme: (muiTheme: Theme) => ThemeObject;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const getReactJsonViewerTheme = (muiTheme) => {
|
|
2
|
+
return {
|
|
3
|
+
base00: muiTheme?.vars?.palette?.background?.default,
|
|
4
|
+
base01: muiTheme?.vars?.palette?.background?.base,
|
|
5
|
+
base02: muiTheme?.vars?.palette?.background?.neutral,
|
|
6
|
+
base03: muiTheme?.vars?.palette?.text?.disabled,
|
|
7
|
+
base04: muiTheme?.vars?.palette?.text?.secondary,
|
|
8
|
+
base05: muiTheme?.vars?.palette?.text?.primary,
|
|
9
|
+
base06: muiTheme?.vars?.palette?.text?.primary,
|
|
10
|
+
base07: muiTheme?.vars?.palette?.text?.primary,
|
|
11
|
+
base08: muiTheme?.vars?.palette?.chips?.error?.outlined?.colorTone,
|
|
12
|
+
base09: muiTheme?.vars?.palette?.chips?.orange?.outlined?.color,
|
|
13
|
+
base0A: muiTheme?.vars?.palette?.chips?.warning?.outlined?.colorTone,
|
|
14
|
+
base0B: muiTheme?.vars?.palette?.chips?.forest?.outlined?.color,
|
|
15
|
+
base0C: muiTheme?.vars?.palette?.chips?.aqua?.outlined?.colorTone,
|
|
16
|
+
base0D: muiTheme?.vars?.palette?.chips?.info?.outlined?.colorTone,
|
|
17
|
+
base0E: muiTheme?.vars?.palette?.chips?.pink?.outlined?.colorTone,
|
|
18
|
+
base0F: muiTheme?.vars?.palette?.chips?.persianGreen?.outlined?.colorTone
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
getReactJsonViewerTheme as g
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getReactJsonViewerTheme } from './getReactJsonViewerTheme';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactJsonViewer } from './ReactJsonViewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ReactJsonViewerRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { a as REACT_JSON_VIEWER_KEY_COMPONENT } from "../constants.js";
|
|
3
|
+
import { R as ReactJsonViewerSlots } from "./ReactJsonViewerEnum.js";
|
|
4
|
+
import { r as reactJsonViewerStyles } from "../ReactJsonViewer.styles.js";
|
|
5
|
+
const ReactJsonViewerRootStyled = styled("div", {
|
|
6
|
+
name: REACT_JSON_VIEWER_KEY_COMPONENT,
|
|
7
|
+
slot: ReactJsonViewerSlots.root
|
|
8
|
+
})(reactJsonViewerStyles?.root);
|
|
9
|
+
export {
|
|
10
|
+
ReactJsonViewerRootStyled as R
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactJsonViewProps } from '@microlink/react-json-view';
|
|
2
|
+
import { ReactJsonViewerSlots } from './slots/ReactJsonViewerEnum';
|
|
3
|
+
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
4
|
+
import { REACT_JSON_VIEWER_KEY_COMPONENT } from './constants';
|
|
5
|
+
import { Theme } from '@mui/material';
|
|
6
|
+
export interface ReactJsonViewerProps extends Omit<ReactJsonViewProps, 'theme'> {
|
|
7
|
+
className?: string;
|
|
8
|
+
dataTestId?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ReactJsonViewerOwnerState = {};
|
|
11
|
+
export type ReactJsonViewerSlotsType = keyof typeof ReactJsonViewerSlots;
|
|
12
|
+
export type ReactJsonViewerStyles = M4LOverridesStyleRules<ReactJsonViewerSlotsType, typeof REACT_JSON_VIEWER_KEY_COMPONENT, Theme>;
|
package/index.js
CHANGED
|
@@ -72,6 +72,7 @@ import { S as S3 } from "./components/extended/React-resizable-panels/SplitLayou
|
|
|
72
72
|
import { P } from "./components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.js";
|
|
73
73
|
import { F } from "./components/extended/React-Window/FixedSizeList/FixedSizeList.js";
|
|
74
74
|
import { V } from "./components/extended/React-Window/VariableSizeList/VariableSizeList.js";
|
|
75
|
+
import { R as R3 } from "./components/extended/React-Json-Viewer/ReactJsonViewer.js";
|
|
75
76
|
import { A as A14 } from "./components/mui_extended/Avatar/Avatar.js";
|
|
76
77
|
import { B as B2 } from "./components/mui_extended/BoxIcon/index.js";
|
|
77
78
|
import { B as B3 } from "./components/mui_extended/Breadcrumbs/index.js";
|
|
@@ -121,34 +122,34 @@ import { g as g17 } from "./components/formatters/DistanceToNowFormatter/diction
|
|
|
121
122
|
import { D as D9 } from "./components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js";
|
|
122
123
|
import { g as g18 } from "./components/formatters/dictionary.js";
|
|
123
124
|
import { G } from "./components/GridLayout/GridLayout.js";
|
|
124
|
-
import { R as
|
|
125
|
+
import { R as R4 } from "./components/GridLayout/subcomponents/Responsive/index.js";
|
|
125
126
|
import { c as c2, e as e2, d as d3 } from "./components/GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
126
127
|
import { i, k } from "./components/GridLayout/utils.js";
|
|
127
128
|
import { w } from "./components/GridLayout/subcomponents/withSizeProvider/index.js";
|
|
128
129
|
import { H as H2 } from "./components/HelmetPage/index.js";
|
|
129
130
|
import { H as H3 } from "./components/HelperError/HelperError.js";
|
|
130
|
-
import { R as
|
|
131
|
+
import { R as R5 } from "./components/hook-form/RHFAutocomplete/RHFAutocomplete.js";
|
|
131
132
|
import { g as g19 } from "./components/hook-form/RHFAutocomplete/dictionary.js";
|
|
132
|
-
import { R as
|
|
133
|
+
import { R as R6 } from "./components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.js";
|
|
133
134
|
import { g as g20 } from "./components/hook-form/RHFAutocompleteAsync/dictionary.js";
|
|
134
|
-
import { R as
|
|
135
|
-
import { R as
|
|
136
|
-
import { R as
|
|
137
|
-
import { R as
|
|
138
|
-
import { R as
|
|
139
|
-
import { R as
|
|
140
|
-
import { R as
|
|
141
|
-
import { R as
|
|
142
|
-
import { R as
|
|
143
|
-
import { R as
|
|
135
|
+
import { R as R7 } from "./components/hook-form/RHFDateTime/RHFDateTime.js";
|
|
136
|
+
import { R as R8 } from "./components/hook-form/RHFMultiCheckbox/index.js";
|
|
137
|
+
import { R as R9 } from "./components/hook-form/RHFSelect/RHFSelect.js";
|
|
138
|
+
import { R as R10 } from "./components/hook-form/RHFHelperError/index.js";
|
|
139
|
+
import { R as R11 } from "./components/hook-form/RHFRadioGroup/RHFRadioGroup.js";
|
|
140
|
+
import { R as R12 } from "./components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js";
|
|
141
|
+
import { R as R13 } from "./components/hook-form/RHFColorPicker/RFHColorPicker.js";
|
|
142
|
+
import { R as R14 } from "./components/hook-form/RHFCheckbox/RHFCheckbox.js";
|
|
143
|
+
import { R as R15 } from "./components/hook-form/RHFTextField/RHFTextField.js";
|
|
144
|
+
import { R as R16 } from "./components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js";
|
|
144
145
|
import { g as g21 } from "./components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js";
|
|
145
146
|
import { r } from "./components/hook-form/RHFPeriod/RHFPeriod.styles.js";
|
|
146
|
-
import { R as
|
|
147
|
-
import { R as
|
|
148
|
-
import { R as
|
|
149
|
-
import { N as N3, P as P6, R as
|
|
150
|
-
import { R as
|
|
151
|
-
import { R as
|
|
147
|
+
import { R as R17 } from "./components/hook-form/RHFPeriod/RHFPeriod.js";
|
|
148
|
+
import { R as R18 } from "./components/hook-form/RHFPeriod/constants.js";
|
|
149
|
+
import { R as R19 } from "./components/hook-form/RHFPeriod/slots/RHFPeriodEnum.js";
|
|
150
|
+
import { N as N3, P as P6, R as R20, S as S7 } from "./components/hook-form/RHFPeriod/slots/RHFPeriodSlots.js";
|
|
151
|
+
import { R as R21 } from "./components/hook-form/RHFNumberInput/RHFNumberInput.js";
|
|
152
|
+
import { R as R22 } from "./components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js";
|
|
152
153
|
import { I as I4 } from "./components/Icon/Icon.js";
|
|
153
154
|
import { I as I5 } from "./components/Image/Image.js";
|
|
154
155
|
import { L as L6 } from "./components/Label/Label.js";
|
|
@@ -188,7 +189,7 @@ import { a as a14, g as g27 } from "./components/ModalDialog/dictionary.js";
|
|
|
188
189
|
import { M as M8 } from "./components/ModalDialog/ModalDialog.js";
|
|
189
190
|
import { S as S10 } from "./components/SettingsLayout/SettingsLayout.js";
|
|
190
191
|
import { P as P13 } from "./components/Pager/Pager.js";
|
|
191
|
-
import { F as F2, R as
|
|
192
|
+
import { F as F2, R as R23, u as u16 } from "./components/hook-form/RHFormContext/index.js";
|
|
192
193
|
import { g as g28 } from "./components/hook-form/RHFormContext/dictionary.js";
|
|
193
194
|
import { u as u17 } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
|
|
194
195
|
import { A as A16 } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
|
|
@@ -327,28 +328,29 @@ export {
|
|
|
327
328
|
P11 as PrintingSystem,
|
|
328
329
|
P as PropagateLoaderSpinner,
|
|
329
330
|
P12 as PropertyValue,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
331
|
+
R5 as RHFAutocomplete,
|
|
332
|
+
R6 as RHFAutocompleteAsync,
|
|
333
|
+
R14 as RHFCheckbox,
|
|
334
|
+
R13 as RHFColorPicker,
|
|
335
|
+
R7 as RHFDateTime,
|
|
336
|
+
R10 as RHFHelperError,
|
|
337
|
+
R8 as RHFMultiCheckbox,
|
|
338
|
+
R21 as RHFNumberInput,
|
|
339
|
+
R17 as RHFPeriod,
|
|
340
|
+
R20 as RHFPeriodRootStyled,
|
|
341
|
+
R19 as RHFPeriodSlots,
|
|
342
|
+
R11 as RHFRadioGroup,
|
|
343
|
+
R9 as RHFSelect,
|
|
344
|
+
R15 as RHFTextField,
|
|
345
|
+
R16 as RHFTextFieldPassword,
|
|
346
|
+
R22 as RHFUploadImage,
|
|
347
|
+
R12 as RHFUploadSingleFile,
|
|
348
|
+
R18 as RHF_PERIOD_KEY_COMPONENT,
|
|
349
|
+
R23 as RHFormProvider,
|
|
350
|
+
R3 as ReactJsonViewer,
|
|
349
351
|
R as Resizable,
|
|
350
352
|
R2 as ResizableBox,
|
|
351
|
-
|
|
353
|
+
R4 as Responsive,
|
|
352
354
|
S11 as SKELETON_SVG_ICON,
|
|
353
355
|
S8 as ScrollBar,
|
|
354
356
|
S as SectionCommercial,
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ReactJsonViewer } from '../../../../src/components/extended/React-Json-Viewer';
|
|
3
|
+
declare const meta: Meta<typeof ReactJsonViewer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ReactJsonViewer>;
|
|
6
|
+
/**
|
|
7
|
+
* ReactJsonViewer historia por defecto.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ReactJsonViewerDefault: Story;
|