@foodpilot/foods 2.7.1 → 2.7.3
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { useState, useRef } from "react";
|
|
3
3
|
import { useTheme, Stack, Typography } from "@mui/material";
|
|
4
4
|
import Accordion from "@mui/material/Accordion";
|
|
5
5
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
|
@@ -9,6 +9,7 @@ import { FoodsIcon } from "../Icons/FoodsIcon.js";
|
|
|
9
9
|
const FormAccordion = (props) => {
|
|
10
10
|
const [expanded, setExpanded] = useState(null);
|
|
11
11
|
const theme = useTheme();
|
|
12
|
+
const refs = useRef([]);
|
|
12
13
|
const selectWindow = (index) => {
|
|
13
14
|
if (index === expanded) {
|
|
14
15
|
setExpanded(null);
|
|
@@ -20,7 +21,25 @@ const FormAccordion = (props) => {
|
|
|
20
21
|
return /* @__PURE__ */ jsxs(
|
|
21
22
|
Accordion,
|
|
22
23
|
{
|
|
24
|
+
ref: (el) => refs.current[index] = el,
|
|
23
25
|
expanded: expanded === index,
|
|
26
|
+
slotProps: {
|
|
27
|
+
transition: {
|
|
28
|
+
onEntered: (_node, isAppearing) => {
|
|
29
|
+
var _a;
|
|
30
|
+
if (isAppearing === false) {
|
|
31
|
+
if (expanded !== null) {
|
|
32
|
+
(_a = refs.current[expanded]) == null ? void 0 : _a.scrollIntoView({
|
|
33
|
+
behavior: "smooth",
|
|
34
|
+
block: "start"
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
onExited: (_node) => {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
24
43
|
sx: {
|
|
25
44
|
background: "transparent",
|
|
26
45
|
borderTop: `1px solid ${theme.custom.grey[500]}`,
|
|
@@ -23,7 +23,7 @@ const ScoreCard = (props) => {
|
|
|
23
23
|
children: /* @__PURE__ */ jsx(ScoreCardHeader, { ...header })
|
|
24
24
|
}
|
|
25
25
|
),
|
|
26
|
-
/* @__PURE__ */ jsx(Stack, { padding: "28px 32px", paddingBottom: "37px", gap: "40px", children })
|
|
26
|
+
/* @__PURE__ */ jsx(Stack, { padding: { xs: "16px", md: "28px 32px" }, paddingBottom: { xs: "16px", md: "37px" }, gap: "40px", children })
|
|
27
27
|
] }),
|
|
28
28
|
disableFooter === false && /* @__PURE__ */ jsxs(
|
|
29
29
|
Stack,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
1
2
|
import { TextOptions } from './WaterfallLegend/types';
|
|
2
3
|
import { Improvement } from '../../ComparisonBlock/ComparisonBlock';
|
|
3
4
|
export type WaterfallData = {
|
|
@@ -35,5 +36,6 @@ export type WaterfallChartProps = {
|
|
|
35
36
|
showLegend?: boolean;
|
|
36
37
|
valueFormatterFn?: (value: number, precision?: number) => string;
|
|
37
38
|
precision?: number;
|
|
39
|
+
sx?: SxProps<Theme>;
|
|
38
40
|
};
|
|
39
41
|
export declare const WaterfallChart: (props: WaterfallChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,7 +19,8 @@ const WaterfallChart = (props) => {
|
|
|
19
19
|
improvement = "decrease",
|
|
20
20
|
textOptions,
|
|
21
21
|
showLegend = true,
|
|
22
|
-
valueFormatterFn = theme.numbers.valueFormatterFn
|
|
22
|
+
valueFormatterFn = theme.numbers.valueFormatterFn,
|
|
23
|
+
sx
|
|
23
24
|
} = props;
|
|
24
25
|
const rawValues = useMemo(
|
|
25
26
|
() => (values == null ? void 0 : values.length) ? values.map((v) => v.value).filter((value) => value !== null) : null,
|
|
@@ -53,7 +54,8 @@ const WaterfallChart = (props) => {
|
|
|
53
54
|
borderRadius: theme.spacing(1),
|
|
54
55
|
width: "100%",
|
|
55
56
|
height,
|
|
56
|
-
padding: theme.spacing(3)
|
|
57
|
+
padding: theme.spacing(3),
|
|
58
|
+
...sx
|
|
57
59
|
},
|
|
58
60
|
children: /* @__PURE__ */ jsx(
|
|
59
61
|
WaterfallChartCore,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foodpilot/foods",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"module": "./dist/main.js",
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"@mui/lab": "^6.0.0-beta.0",
|
|
291
291
|
"@mui/x-data-grid": "^7.0.0",
|
|
292
292
|
"@mui/x-data-grid-generator": "^7.29.8",
|
|
293
|
-
"@mui/x-date-pickers": "^
|
|
293
|
+
"@mui/x-date-pickers": "^8.14.1",
|
|
294
294
|
"@mui/x-tree-view": "^7.0.0",
|
|
295
295
|
"@tiptap/extension-color": "^2.26.1",
|
|
296
296
|
"@tiptap/extension-font-family": "^2.26.1",
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
"i18next-http-backend": "^2.4.2",
|
|
313
313
|
"lexical": "^0.21.0",
|
|
314
314
|
"lodash": "^4.17.0",
|
|
315
|
-
"material-react-table": "^2.
|
|
315
|
+
"material-react-table": "^3.2.1",
|
|
316
316
|
"material-ui-popup-state": "^5.3.1",
|
|
317
317
|
"prettier": "^3.1.1",
|
|
318
318
|
"react-dnd": "^16.0.1",
|