@foodpilot/foods 2.25.2 → 2.25.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,7 +1,7 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRef as r,useState as i,useEffect as a,useMemo as o}from"react";import{ResponsiveContainer as n,ComposedChart as s,CartesianGrid as m,XAxis as l,YAxis as d,Label as c,ReferenceLine as h}from"recharts";import{useTheme as f,useMediaQuery as p,Box as
|
|
2
|
-
return t(
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRef as r,useState as i,useEffect as a,useMemo as o}from"react";import{ResponsiveContainer as n,ComposedChart as s,CartesianGrid as m,XAxis as l,YAxis as d,Label as c,ReferenceLine as h}from"recharts";import{useTheme as f,useMediaQuery as p,Box as u}from"@mui/material";import{transformWaterfallData as g,calculateLabelSettings as k,wrapWaterfallLabel as v}from"./utils.js";import{WaterfallChartTick as x}from"./WaterfallChartTick.js";import{WaterfallChartBars as y}from"./WaterfallChartBars.js";import{TICK_VERTICAL_OFFSET as F,LINE_HEIGHT_PIXELS as w}from"./labelGeometry.js";const b=b=>{const W=f(),L=p(W.breakpoints.down("sm")),{reference:j,start:z,values:C,colors:M,target:D,goal:$,forcedPrecision:B,unit:E,improvement:P,targetValueFinal:S,valueFormatterFn:T=W.numbers.valueFormatterFn,precision:X,CoreOverride:A}=b,G=r(null),[H,K]=i(800);a(()=>{const t=()=>{if(G.current){const t=G.current.getBoundingClientRect().width;t>0&&K(t-60)}};t();const e=()=>t();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const N=o(()=>g(j,z,C,M,D,$,P,S,W),[j,z,C,M,D,$,P,S,W]),O=o(()=>k(N,H),[N,H]),R=L?80:O.maxWidth,V=Math.max(A?.XAxisHeight??40,...N.map(t=>F+v(t.label,R).length*w));/* @__PURE__ */
|
|
2
|
+
return t(u,{ref:G,sx:{width:"100%",height:"100%",minWidth:{xs:96*N.length+100,sm:0}},children:/* @__PURE__ */t(n,{width:"100%",height:"100%",children:/* @__PURE__ */e(s,{data:N,margin:{top:45,right:0,left:30,bottom:35},children:[
|
|
3
3
|
/* @__PURE__ */t(m,{strokeDasharray:"4 4",stroke:W.palette.divider}),
|
|
4
|
-
/* @__PURE__ */t(l,{dataKey:"label",strokeWidth:0,strokeDasharray:"4 4",tick:e=>/* @__PURE__ */t(x,{...e,maxWidth:
|
|
5
|
-
/* @__PURE__ */t(d,{width:"auto",domain:([t,e])=>[t<0?t-.2*Math.abs(t):t,e],strokeWidth:0,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${W.spacing(2)})`}},axisLine:{stroke:W.palette.divider},tickLine:!1,tickFormatter:t=>
|
|
4
|
+
/* @__PURE__ */t(l,{dataKey:"label",strokeWidth:0,strokeDasharray:"4 4",tick:e=>/* @__PURE__ */t(x,{...e,maxWidth:R}),axisLine:{stroke:W.palette.divider},interval:L?0:O.interval,tickLine:!1,padding:{left:0,right:0},height:V}),
|
|
5
|
+
/* @__PURE__ */t(d,{width:"auto",domain:([t,e])=>[t<0?t-.2*Math.abs(t):t,e],strokeWidth:0,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${W.spacing(2)})`}},axisLine:{stroke:W.palette.divider},tickLine:!1,tickFormatter:t=>T(Number(t),X),children:/* @__PURE__ */t(c,{value:E,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${W.spacing(2.75)}, -${W.spacing(6)})`}})}),
|
|
6
6
|
/* @__PURE__ */t(h,{y:0,stroke:W.custom.grey[600],strokeWidth:2}),
|
|
7
|
-
/* @__PURE__ */t(y,{transformedData:N,valueFormatterFn:
|
|
7
|
+
/* @__PURE__ */t(y,{transformedData:N,valueFormatterFn:T,forcedPrecision:B,precision:X})]})})})};export{b as WaterfallChartCore};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foodpilot/foods",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.25.
|
|
4
|
+
"version": "2.25.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"module": "./dist/main.js",
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
"chroma-js": "^3.2.0",
|
|
329
329
|
"i18next": "^23.0.0 || ^25.0.0",
|
|
330
330
|
"i18next-browser-languagedetector": "^8.2.1",
|
|
331
|
-
"i18next-http-backend": "^
|
|
331
|
+
"i18next-http-backend": "^4.0.2",
|
|
332
332
|
"lexical": "^0.41.0",
|
|
333
333
|
"lodash": "^4.18.1",
|
|
334
334
|
"material-ui-popup-state": "^5.3.1",
|