datastake-daf 0.6.311 → 0.6.313

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.
@@ -16114,10 +16114,12 @@ function ImageWidget(_ref) {
16114
16114
  isPdf = false
16115
16115
  } = _ref,
16116
16116
  props = _objectWithoutProperties(_ref, _excluded$p);
16117
+ const expandable = isPdf ? false : props.expandable;
16117
16118
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
16118
16119
  loading: loading,
16119
16120
  title: title,
16120
- className: "with-border-header"
16121
+ className: "with-border-header",
16122
+ expandable: expandable
16121
16123
  }, props), {}, {
16122
16124
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
16123
16125
  className: "flex gap-4",
@@ -49691,7 +49693,7 @@ function LineChart(_ref) {
49691
49693
  });
49692
49694
  }
49693
49695
 
49694
- const _excluded$5 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "seriesField", "isPercentage", "showBackground", "formattedYAxis", "formattedXAxis", "color", "height", "groupField", "t", "isPdf", "extraLegendConfig"];
49696
+ const _excluded$5 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "seriesField", "isPercentage", "showBackground", "formattedYAxis", "formattedXAxis", "color", "height", "groupField", "t", "isPdf", "extraLegendConfig", "shouldSeperateLegendName"];
49695
49697
  const {
49696
49698
  useToken: useToken$c
49697
49699
  } = antd.theme;
@@ -49778,7 +49780,8 @@ function ColumnChart(_ref) {
49778
49780
  groupField,
49779
49781
  t = s => s,
49780
49782
  isPdf = false,
49781
- extraLegendConfig = {}
49783
+ extraLegendConfig = {},
49784
+ shouldSeperateLegendName = false
49782
49785
  } = _ref;
49783
49786
  _objectWithoutProperties(_ref, _excluded$5);
49784
49787
  const containerRef = React__default["default"].useRef(null);
@@ -49823,7 +49826,10 @@ function ColumnChart(_ref) {
49823
49826
  }),
49824
49827
  legend: isPdf ? _objectSpread2({
49825
49828
  itemName: {
49826
- formatter: text => t(text)
49829
+ formatter: text => {
49830
+ const textToTranslate = shouldSeperateLegendName ? text.split("-")[1].toLowerCase() : text;
49831
+ return t(textToTranslate);
49832
+ }
49827
49833
  },
49828
49834
  position: 'bottom'
49829
49835
  }, extraLegendConfig) : hasLegendConfig || false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.311",
3
+ "version": "0.6.313",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -456,6 +456,7 @@ export const Pdf = {
456
456
  renderTooltipContent: renderTooltipContent,
457
457
  showBackground: true,
458
458
  isPercentage: true,
459
+ shouldSeperateLegendName: true,
459
460
  },
460
461
  render: (args) => {
461
462
  return <ColumnChart {...args} />;
@@ -89,6 +89,7 @@ export default function ColumnChart({
89
89
  t = (s) => s,
90
90
  isPdf = false,
91
91
  extraLegendConfig = {},
92
+ shouldSeperateLegendName = false,
92
93
  ...rest
93
94
  }) {
94
95
  const containerRef = React.useRef(null);
@@ -145,7 +146,10 @@ export default function ColumnChart({
145
146
  legend: isPdf
146
147
  ? {
147
148
  itemName: {
148
- formatter: (text) => t(text),
149
+ formatter: (text) => {
150
+ const textToTranslate = shouldSeperateLegendName ? text.split("-")[1].toLowerCase() : text
151
+ return t(textToTranslate)
152
+ },
149
153
  },
150
154
  position: 'bottom',
151
155
  ...extraLegendConfig,
@@ -11,8 +11,9 @@ export default function ImageWidget({
11
11
  isPdf = false,
12
12
  ...props
13
13
  }) {
14
+ const expandable = isPdf ? false : props.expandable
14
15
  return (
15
- <Widget loading={loading} title={title} className="with-border-header" {...props}>
16
+ <Widget loading={loading} title={title} className="with-border-header" expandable={expandable} {...props}>
16
17
  <div className="flex gap-4">
17
18
  {image ? (
18
19
  <Image