@economic/taco 8.1.0 → 8.1.2-EC-71727-update-tanstack-virtual.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/dist/charts/components/Composed/BarLineChart.cjs +1 -1
- package/dist/charts/components/Composed/BarLineChart.cjs.map +1 -1
- package/dist/charts/components/Composed/BarLineChart.js +1 -1
- package/dist/charts/components/Composed/BarLineChart.js.map +1 -1
- package/dist/charts/components/Donut/DonutChart.cjs +1 -1
- package/dist/charts/components/Donut/DonutChart.cjs.map +1 -1
- package/dist/charts/components/Donut/DonutChart.js +1 -1
- package/dist/charts/components/Donut/DonutChart.js.map +1 -1
- package/package.json +2 -2
|
@@ -71,7 +71,7 @@ function BarLineChart(props) {
|
|
|
71
71
|
/* @__PURE__ */ React.createElement(RechartsPrimitive__namespace.YAxis, { ...common.getAxisProps("y", props) }),
|
|
72
72
|
BarChart.renderBars(barShapes, showLabels, stacked, false),
|
|
73
73
|
LineChart.renderLines(lineShapes, showDots, lineType)
|
|
74
|
-
)), showLegend ? /* @__PURE__ */ React.createElement(
|
|
74
|
+
)), showLegend ? /* @__PURE__ */ React.createElement(Legend.Legend, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
|
75
75
|
}
|
|
76
76
|
function Bar(_) {
|
|
77
77
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarLineChart.cjs","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import React from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { clsx } from 'clsx';\nimport { getAxisProps, stripCartesianProps } from '../../utils/common';\nimport { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Tooltip } from '../Tooltip';\nimport { Legend } from '../Legend';\nimport { useChart } from '../useChartData';\nimport { renderBars } from '../Bar/BarChart';\nimport { renderLines } from '../Line/LineChart';\n\nexport interface BarLineChartProps<TData extends object> extends CartesianChartProps<TData> {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n}\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<BarLineChartProps<TData>>(props);\n\n const className = clsx('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <
|
|
1
|
+
{"version":3,"file":"BarLineChart.cjs","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import React from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { clsx } from 'clsx';\nimport { getAxisProps, stripCartesianProps } from '../../utils/common';\nimport { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Tooltip } from '../Tooltip';\nimport { Legend } from '../Legend';\nimport { useChart } from '../useChartData';\nimport { renderBars } from '../Bar/BarChart';\nimport { renderLines } from '../Line/LineChart';\n\nexport interface BarLineChartProps<TData extends object> extends CartesianChartProps<TData> {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n}\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<BarLineChartProps<TData>>(props);\n\n const className = clsx('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport interface BarLineChartBarProps<TData extends object> extends ChartChildProps<TData> {}\n\nfunction Bar<TData extends object>(_: BarLineChartBarProps<TData>): JSX.Element | null {\n return null;\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport interface BarLineChartLineProps<TData extends object> extends ChartChildProps<TData> {}\n\nfunction Line<TData extends object>(_: BarLineChartLineProps<TData>): JSX.Element | null {\n return null;\n}\n\n// Attach the marker components to BarLineChart\nBarLineChart.Bar = Bar;\nBarLineChart.Line = Line;\n"],"names":["stripCartesianProps","clsx","useChart","props","ChartWrapper","RechartsPrimitive","Tooltip","getAxisProps","renderBars","renderLines","Legend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,SAAS,aAAmC,OAAiC;AAC1E,QAAA;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EAAA,IACHA,OAAAA,oBAA8C,KAAK;AAEvD,QAAM,YAAYC,GAAAA,KAAK,yBAAyB,EAAE,QAAQ,cAAc,eAAe;AACjF,QAAA,EAAE,OAAO,QAAQ,aAAa,gBAAgB,WAAW,IAAIC,sBAAgB,QAAQ;AAG3F,QAAM,cAAc,MAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAS,UAAA,MAAM,eAAe,KAAK,KAAK,MAAM,SAAS,GAAG;AAEtH,QAAM,cAAc,IAAI;AAAA,IACpB,YACK,OAAO,CAAS,UAAA,MAAM,eAAuC,KAAK,CAAC,EACnE,IAAI,CAAS,UAAA;AACV,YAAMC,SAAS,MAAqD;AAC7DA,aAAAA,OAAM,WAAWA,OAAM;AAAA,IACjC,CAAA;AAAA,EACT;AAGM,QAAA,YAAY,OAAO,OAAO,CAAA,UAAS,YAAY,IAAI,MAAM,OAA+B,CAAC;AACzF,QAAA,aAAa,OAAO,OAAO,CAAA,UAAS,CAAC,YAAY,IAAI,MAAM,OAA+B,CAAC;AAEjG,SACK,sBAAA,cAAA,OAAA,EAAI,WAAsB,aAAU,gBACjC,GAAA,sBAAA,cAACC,aAAAA,cAAc,EAAA,GAAG,YAAY,WAAU,iBAAgB,aAAU,iBAC9D,GAAA,sBAAA;AAAA,IAACC,6BAAkB;AAAA,IAAlB;AAAA,MACG;AAAA,MACA,gBAAe;AAAA,MACf,QAAO;AAAA,MACP,QAAQ;AAAA,QACJ,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,KAAK;AAAA,MACT;AAAA,MACA,aAAa,YAAY,WAAW,WAAW;AAAA,IAAA;AAAA,IAC9C,sBAAA,cAAAA,6BAAkB,eAAlB,EAAgC,UAAU,OAAO;AAAA,IAClD,sBAAA,cAACA,6BAAkB,SAAlB,EAA0B,SAAU,sBAAA,cAAAC,QAAA,SAAA,EAAQ,OAAO,aAAA,CAAc,EAAI,CAAA;AAAA,IACtE,sBAAA,cAACD,6BAAkB,OAAlB,EAAyB,GAAGE,oBAAa,KAAK,KAAK,GAAG;AAAA,IACvD,sBAAA,cAACF,6BAAkB,OAAlB,EAAyB,GAAGE,oBAAa,KAAK,KAAK,GAAG;AAAA,IACtDC,SAAAA,WAAW,WAAW,YAAY,SAAS,KAAK;AAAA,IAChDC,sBAAY,YAAY,UAAU,QAAQ;AAAA,EAAA,CAEnD,GACC,aACG,sBAAA,cAACC,OAAc,QAAA,EAAA,OAAc,YAAY,aAAa,SAAS,gBAAgB,UAAU,WAAY,CAAA,IACrG,IACR;AAER;AAKA,SAAS,IAA0B,GAAoD;AAC5E,SAAA;AACX;AAKA,SAAS,KAA2B,GAAqD;AAC9E,SAAA;AACX;AAGA,aAAa,MAAM;AACnB,aAAa,OAAO;;"}
|
|
@@ -52,7 +52,7 @@ function BarLineChart(props) {
|
|
|
52
52
|
/* @__PURE__ */ React__default.createElement(RechartsPrimitive.YAxis, { ...getAxisProps("y", props) }),
|
|
53
53
|
renderBars(barShapes, showLabels, stacked, false),
|
|
54
54
|
renderLines(lineShapes, showDots, lineType)
|
|
55
|
-
)), showLegend ? /* @__PURE__ */ React__default.createElement(
|
|
55
|
+
)), showLegend ? /* @__PURE__ */ React__default.createElement(Legend, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
|
56
56
|
}
|
|
57
57
|
function Bar(_) {
|
|
58
58
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarLineChart.js","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import React from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { clsx } from 'clsx';\nimport { getAxisProps, stripCartesianProps } from '../../utils/common';\nimport { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Tooltip } from '../Tooltip';\nimport { Legend } from '../Legend';\nimport { useChart } from '../useChartData';\nimport { renderBars } from '../Bar/BarChart';\nimport { renderLines } from '../Line/LineChart';\n\nexport interface BarLineChartProps<TData extends object> extends CartesianChartProps<TData> {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n}\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<BarLineChartProps<TData>>(props);\n\n const className = clsx('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <
|
|
1
|
+
{"version":3,"file":"BarLineChart.js","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import React from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { clsx } from 'clsx';\nimport { getAxisProps, stripCartesianProps } from '../../utils/common';\nimport { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Tooltip } from '../Tooltip';\nimport { Legend } from '../Legend';\nimport { useChart } from '../useChartData';\nimport { renderBars } from '../Bar/BarChart';\nimport { renderLines } from '../Line/LineChart';\n\nexport interface BarLineChartProps<TData extends object> extends CartesianChartProps<TData> {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n}\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<BarLineChartProps<TData>>(props);\n\n const className = clsx('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport interface BarLineChartBarProps<TData extends object> extends ChartChildProps<TData> {}\n\nfunction Bar<TData extends object>(_: BarLineChartBarProps<TData>): JSX.Element | null {\n return null;\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport interface BarLineChartLineProps<TData extends object> extends ChartChildProps<TData> {}\n\nfunction Line<TData extends object>(_: BarLineChartLineProps<TData>): JSX.Element | null {\n return null;\n}\n\n// Attach the marker components to BarLineChart\nBarLineChart.Bar = Bar;\nBarLineChart.Line = Line;\n"],"names":["React","props"],"mappings":";;;;;;;;;;AA+BO,SAAS,aAAmC,OAAiC;AAC1E,QAAA;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EAAA,IACH,oBAA8C,KAAK;AAEvD,QAAM,YAAY,KAAK,yBAAyB,EAAE,QAAQ,cAAc,eAAe;AACjF,QAAA,EAAE,OAAO,QAAQ,aAAa,gBAAgB,WAAW,IAAI,SAAgB,QAAQ;AAG3F,QAAM,cAAcA,eAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAS,UAAAA,eAAM,eAAe,KAAK,KAAK,MAAM,SAAS,GAAG;AAEtH,QAAM,cAAc,IAAI;AAAA,IACpB,YACK,OAAO,CAAS,UAAAA,eAAM,eAAuC,KAAK,CAAC,EACnE,IAAI,CAAS,UAAA;AACV,YAAMC,SAAS,MAAqD;AAC7DA,aAAAA,OAAM,WAAWA,OAAM;AAAA,IACjC,CAAA;AAAA,EACT;AAGM,QAAA,YAAY,OAAO,OAAO,CAAA,UAAS,YAAY,IAAI,MAAM,OAA+B,CAAC;AACzF,QAAA,aAAa,OAAO,OAAO,CAAA,UAAS,CAAC,YAAY,IAAI,MAAM,OAA+B,CAAC;AAEjG,SACKD,+BAAA,cAAA,OAAA,EAAI,WAAsB,aAAU,gBACjC,GAAAA,+BAAA,cAAC,cAAc,EAAA,GAAG,YAAY,WAAU,iBAAgB,aAAU,iBAC9D,GAAAA,+BAAA;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACG;AAAA,MACA,gBAAe;AAAA,MACf,QAAO;AAAA,MACP,QAAQ;AAAA,QACJ,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,KAAK;AAAA,MACT;AAAA,MACA,aAAa,YAAY,WAAW,WAAW;AAAA,IAAA;AAAA,IAC9CA,+BAAA,cAAA,kBAAkB,eAAlB,EAAgC,UAAU,OAAO;AAAA,IAClDA,+BAAA,cAAC,kBAAkB,SAAlB,EAA0B,SAAUA,+BAAA,cAAA,SAAA,EAAQ,OAAO,aAAA,CAAc,EAAI,CAAA;AAAA,IACtEA,+BAAA,cAAC,kBAAkB,OAAlB,EAAyB,GAAG,aAAa,KAAK,KAAK,GAAG;AAAA,IACvDA,+BAAA,cAAC,kBAAkB,OAAlB,EAAyB,GAAG,aAAa,KAAK,KAAK,GAAG;AAAA,IACtD,WAAW,WAAW,YAAY,SAAS,KAAK;AAAA,IAChD,YAAY,YAAY,UAAU,QAAQ;AAAA,EAAA,CAEnD,GACC,aACGA,+BAAA,cAAC,QAAc,EAAA,OAAc,YAAY,aAAa,SAAS,gBAAgB,UAAU,WAAY,CAAA,IACrG,IACR;AAER;AAKA,SAAS,IAA0B,GAAoD;AAC5E,SAAA;AACX;AAKA,SAAS,KAA2B,GAAqD;AAC9E,SAAA;AACX;AAGA,aAAa,MAAM;AACnB,aAAa,OAAO;"}
|
|
@@ -45,7 +45,7 @@ function DonutChart(props) {
|
|
|
45
45
|
unit,
|
|
46
46
|
style: { top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }
|
|
47
47
|
}
|
|
48
|
-
) : null, showLegend ? /* @__PURE__ */ React.createElement(
|
|
48
|
+
) : null, showLegend ? /* @__PURE__ */ React.createElement(Legend.Legend, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
|
49
49
|
}
|
|
50
50
|
function Segment(_) {
|
|
51
51
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.cjs","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport * as RechartsPrimitive from 'recharts';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { usePieChart } from '../Pie/util';\nimport { Legend } from '../Legend';\nimport { PieChartSegmentProps } from '../Pie/PieChart';\nimport { ChartValueFormatter, PolarChartProps } from '../types';\nimport { Tooltip } from '../Tooltip';\nimport { Tooltip as TacoTooltip } from '../../../components/Tooltip/Tooltip';\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport interface DonutChartProps extends PolarChartProps {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n}\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = clsx('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <
|
|
1
|
+
{"version":3,"file":"DonutChart.cjs","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport * as RechartsPrimitive from 'recharts';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { usePieChart } from '../Pie/util';\nimport { Legend } from '../Legend';\nimport { PieChartSegmentProps } from '../Pie/PieChart';\nimport { ChartValueFormatter, PolarChartProps } from '../types';\nimport { Tooltip } from '../Tooltip';\nimport { Tooltip as TacoTooltip } from '../../../components/Tooltip/Tooltip';\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport interface DonutChartProps extends PolarChartProps {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n}\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = clsx('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport interface DonutChartSegmentProps<TData extends object> extends PieChartSegmentProps<TData> {}\n\nfunction Segment<TData extends object>(_: DonutChartSegmentProps<TData>): JSX.Element | null {\n return null;\n}\nDonutChart.Segment = Segment;\n\ninterface DonutTotalProps<TData extends object> extends React.ComponentProps<'div'> {\n formatter: ChartValueFormatter;\n items: DonutChartSegmentProps<TData>[];\n unit?: string;\n}\n\nfunction Total<TData extends object>(props: DonutTotalProps<TData>) {\n const { formatter, items, unit, ...attributes } = props;\n const total = React.useMemo(() => {\n const total = items.filter(item => !item.isHidden).reduce((acc, curr) => acc + curr.value, 0);\n return formatter(total);\n }, [items]);\n\n return (\n <div\n {...attributes}\n className=\"absolute-center flex aspect-video flex-col items-center justify-center overflow-hidden rounded-full\"\n data-taco=\"chart-donut-total\">\n <TacoTooltip title={total}>\n <span className=\"w-full truncate text-center text-lg font-bold tabular-nums\">{total}</span>\n </TacoTooltip>\n {unit ? <span className=\"-mb-1 -mt-0.5 truncate text-xs text-gray-700\">{unit}</span> : null}\n </div>\n );\n}\n"],"names":["usePieChart","clsx","ChartWrapper","RechartsPrimitive","Tooltip","Legend","total","TacoTooltip"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,cAAc;AASb,SAAS,WAAiC,OAAwB;AAC/D,QAAA,EAAE,UAAU,WAAW,aAAa,OAAO,YAAY,OAAO,cAAc,MAAM,GAAG,WAAe,IAAA;AACpG,QAAA,EAAE,UAAU,QAAQ,WAAW,OAAO,aAAa,gBAAgB,iBAAiB,WAAA,IAAeA,KAAA;AAAA,IACrG;AAAA,IACA;AAAA,MACI;AAAA,MACA;AAAA,IAAA;AAAA,EAER;AACA,QAAM,YAAYC,GAAA,KAAK,iBAAiB,WAAW,SAAS;AAE5D,6CACK,OAAI,EAAA,WAAU,YAAW,aAAU,gBAAA,uCAC/BC,aAAAA,cAAc,EAAA,GAAG,YAAY,WAAsB,aAAU,eAAc,YAAY,UAAA,uCACnFC,6BAAkB,UAAlB,MACI,sBAAA,cAAAA,6BAAkB,SAAlB,EAA0B,SAAU,sBAAA,cAAAC,iBAAA,EAAQ,OAAO,cAAc,EAAA,CAAI,GACrE,sBAAA,cAAAD,6BAAkB,KAAlB,EAAuB,GAAG,UAAU,aAAa,SAAS,aAAa,CAC5E,CACJ,GACC,YACG,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,OAAO,EAAE,KAAK,SAAS,cAAc,GAAG,OAAO,SAAS,cAAc,EAAE;AAAA,IAAA;AAAA,EAAA,IAE5E,MACH,aACG,sBAAA,cAACE,OAAAA,QAAc,EAAA,OAAc,YAAY,aAAa,SAAS,gBAAgB,UAAU,WAAA,CAAY,IACrG,IACR;AAER;AAKA,SAAS,QAA8B,GAAsD;AAClF,SAAA;AACX;AACA,WAAW,UAAU;AAQrB,SAAS,MAA4B,OAA+B;AAChE,QAAM,EAAE,WAAW,OAAO,MAAM,GAAG,WAAe,IAAA;AAC5C,QAAA,QAAQ,MAAM,QAAQ,MAAM;AAC9B,UAAMC,SAAQ,MAAM,OAAO,CAAA,SAAQ,CAAC,KAAK,QAAQ,EAAE,OAAO,CAAC,KAAK,SAAS,MAAM,KAAK,OAAO,CAAC;AAC5F,WAAO,UAAUA,MAAK;AAAA,EAAA,GACvB,CAAC,KAAK,CAAC;AAGN,SAAA,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,WAAU;AAAA,MACV,aAAU;AAAA,IAAA;AAAA,IACV,sBAAA,cAACC,UAAAA,WAAY,OAAO,MAAA,uCACf,QAAK,EAAA,WAAU,6DAA8D,GAAA,KAAM,CACxF;AAAA,IACC,OAAQ,sBAAA,cAAA,QAAA,EAAK,WAAU,+CAAA,GAAgD,IAAK,IAAU;AAAA,EAC3F;AAER;;"}
|
|
@@ -26,7 +26,7 @@ function DonutChart(props) {
|
|
|
26
26
|
unit,
|
|
27
27
|
style: { top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }
|
|
28
28
|
}
|
|
29
|
-
) : null, showLegend ? /* @__PURE__ */ React__default.createElement(
|
|
29
|
+
) : null, showLegend ? /* @__PURE__ */ React__default.createElement(Legend, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
|
30
30
|
}
|
|
31
31
|
function Segment(_) {
|
|
32
32
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.js","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport * as RechartsPrimitive from 'recharts';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { usePieChart } from '../Pie/util';\nimport { Legend } from '../Legend';\nimport { PieChartSegmentProps } from '../Pie/PieChart';\nimport { ChartValueFormatter, PolarChartProps } from '../types';\nimport { Tooltip } from '../Tooltip';\nimport { Tooltip as TacoTooltip } from '../../../components/Tooltip/Tooltip';\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport interface DonutChartProps extends PolarChartProps {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n}\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = clsx('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <
|
|
1
|
+
{"version":3,"file":"DonutChart.js","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport * as RechartsPrimitive from 'recharts';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { usePieChart } from '../Pie/util';\nimport { Legend } from '../Legend';\nimport { PieChartSegmentProps } from '../Pie/PieChart';\nimport { ChartValueFormatter, PolarChartProps } from '../types';\nimport { Tooltip } from '../Tooltip';\nimport { Tooltip as TacoTooltip } from '../../../components/Tooltip/Tooltip';\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport interface DonutChartProps extends PolarChartProps {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n}\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = clsx('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport interface DonutChartSegmentProps<TData extends object> extends PieChartSegmentProps<TData> {}\n\nfunction Segment<TData extends object>(_: DonutChartSegmentProps<TData>): JSX.Element | null {\n return null;\n}\nDonutChart.Segment = Segment;\n\ninterface DonutTotalProps<TData extends object> extends React.ComponentProps<'div'> {\n formatter: ChartValueFormatter;\n items: DonutChartSegmentProps<TData>[];\n unit?: string;\n}\n\nfunction Total<TData extends object>(props: DonutTotalProps<TData>) {\n const { formatter, items, unit, ...attributes } = props;\n const total = React.useMemo(() => {\n const total = items.filter(item => !item.isHidden).reduce((acc, curr) => acc + curr.value, 0);\n return formatter(total);\n }, [items]);\n\n return (\n <div\n {...attributes}\n className=\"absolute-center flex aspect-video flex-col items-center justify-center overflow-hidden rounded-full\"\n data-taco=\"chart-donut-total\">\n <TacoTooltip title={total}>\n <span className=\"w-full truncate text-center text-lg font-bold tabular-nums\">{total}</span>\n </TacoTooltip>\n {unit ? <span className=\"-mb-1 -mt-0.5 truncate text-xs text-gray-700\">{unit}</span> : null}\n </div>\n );\n}\n"],"names":["React","total","TacoTooltip"],"mappings":";;;;;;;;;AAYA,MAAM,cAAc;AASb,SAAS,WAAiC,OAAwB;AAC/D,QAAA,EAAE,UAAU,WAAW,aAAa,OAAO,YAAY,OAAO,cAAc,MAAM,GAAG,WAAe,IAAA;AACpG,QAAA,EAAE,UAAU,QAAQ,WAAW,OAAO,aAAa,gBAAgB,iBAAiB,WAAA,IAAe;AAAA,IACrG;AAAA,IACA;AAAA,MACI;AAAA,MACA;AAAA,IAAA;AAAA,EAER;AACA,QAAM,YAAY,KAAK,iBAAiB,WAAW,SAAS;AAE5D,sDACK,OAAI,EAAA,WAAU,YAAW,aAAU,gBAAA,gDAC/B,cAAc,EAAA,GAAG,YAAY,WAAsB,aAAU,eAAc,YAAY,UAAA,gDACnF,kBAAkB,UAAlB,MACIA,+BAAA,cAAA,kBAAkB,SAAlB,EAA0B,SAAUA,+BAAA,cAAA,SAAA,EAAQ,OAAO,cAAc,EAAA,CAAI,GACrEA,+BAAA,cAAA,kBAAkB,KAAlB,EAAuB,GAAG,UAAU,aAAa,SAAS,aAAa,CAC5E,CACJ,GACC,YACGA,+BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,OAAO,EAAE,KAAK,SAAS,cAAc,GAAG,OAAO,SAAS,cAAc,EAAE;AAAA,IAAA;AAAA,EAAA,IAE5E,MACH,aACGA,+BAAA,cAAC,QAAc,EAAA,OAAc,YAAY,aAAa,SAAS,gBAAgB,UAAU,WAAA,CAAY,IACrG,IACR;AAER;AAKA,SAAS,QAA8B,GAAsD;AAClF,SAAA;AACX;AACA,WAAW,UAAU;AAQrB,SAAS,MAA4B,OAA+B;AAChE,QAAM,EAAE,WAAW,OAAO,MAAM,GAAG,WAAe,IAAA;AAC5C,QAAA,QAAQA,eAAM,QAAQ,MAAM;AAC9B,UAAMC,SAAQ,MAAM,OAAO,CAAA,SAAQ,CAAC,KAAK,QAAQ,EAAE,OAAO,CAAC,KAAK,SAAS,MAAM,KAAK,OAAO,CAAC;AAC5F,WAAO,UAAUA,MAAK;AAAA,EAAA,GACvB,CAAC,KAAK,CAAC;AAGN,SAAAD,+BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,WAAU;AAAA,MACV,aAAU;AAAA,IAAA;AAAA,IACVA,+BAAA,cAACE,aAAY,OAAO,MAAA,gDACf,QAAK,EAAA,WAAU,6DAA8D,GAAA,KAAM,CACxF;AAAA,IACC,OAAQF,+BAAA,cAAA,QAAA,EAAK,WAAU,+CAAA,GAAgD,IAAK,IAAU;AAAA,EAC3F;AAER;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@economic/taco",
|
|
3
|
-
"version": "8.1.0",
|
|
3
|
+
"version": "8.1.2-EC-71727-update-tanstack-virtual.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"optionalDependencies": {
|
|
100
100
|
"@rollup/rollup-linux-x64-gnu": "^4.60.4"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "9d3b3ab1756c82abccb6d2b35b9104dee28dc5b9"
|
|
103
103
|
}
|