@databrainhq/plugin 0.8.11 → 0.8.13

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,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare const FunnelChart: ({ funnelData, margins, legendSettings, labelSettings, colors, chartClickConfig, chartRef, handleChartRightClick, }: any) => JSX.Element;
2
+ declare const FunnelChart: ({ funnelData, margins, legendSettings, labelSettings, colors, chartClickConfig, chartRef, handleChartRightClick, customSettings, }: any) => JSX.Element;
3
3
  export default FunnelChart;
package/dist/index.es.js CHANGED
@@ -7464,6 +7464,7 @@ const useExternalMetric = ({
7464
7464
  createdBy: clientId || "external user",
7465
7465
  clientId,
7466
7466
  isCreatedByClient: !!clientId,
7467
+ resizeAttributes: metric == null ? void 0 : metric.resizeAttributes,
7467
7468
  externalDashboardMetrics: {
7468
7469
  data: dashboardIds.map((externalDashboardId) => ({
7469
7470
  externalDashboardId
@@ -80503,12 +80504,13 @@ const FunnelChart = ({
80503
80504
  colors: colors2,
80504
80505
  chartClickConfig,
80505
80506
  chartRef,
80506
- handleChartRightClick
80507
+ handleChartRightClick,
80508
+ customSettings
80507
80509
  }) => {
80508
80510
  const option2 = {
80509
80511
  tooltip: {
80510
80512
  trigger: "item",
80511
- formatter: "{b} : {c}k",
80513
+ formatter: "{b} : {c}",
80512
80514
  backgroundColor: "black",
80513
80515
  textStyle: {
80514
80516
  color: "white"
@@ -80549,7 +80551,8 @@ const FunnelChart = ({
80549
80551
  gap: 3,
80550
80552
  label: {
80551
80553
  show: labelSettings.show,
80552
- position: labelSettings.position
80554
+ position: labelSettings.position,
80555
+ formatter: customSettings.showLabelValues ? "{b} : {c}" : "{b}"
80553
80556
  },
80554
80557
  labelLine: {
80555
80558
  length: 10,
@@ -86146,7 +86149,8 @@ const MetricChart = ({
86146
86149
  colors: colors2,
86147
86150
  chartClickConfig,
86148
86151
  chartRef,
86149
- handleChartRightClick
86152
+ handleChartRightClick,
86153
+ customSettings
86150
86154
  });
86151
86155
  }
86152
86156
  if (chartType2 === CHART_TYPES.gauge) {
@@ -86273,7 +86277,7 @@ const menuContainer$1 = "_menuContainer_1ecv1_13";
86273
86277
  const buttonText = "_buttonText_1ecv1_19";
86274
86278
  const buttonIcon = "_buttonIcon_1ecv1_25";
86275
86279
  const filterName = "_filterName_1ecv1_31";
86276
- const filterDropdown$1 = "_filterDropdown_1ecv1_37";
86280
+ const filterDropdown$2 = "_filterDropdown_1ecv1_37";
86277
86281
  var styles$n = {
86278
86282
  button: button$5,
86279
86283
  menu: menu$3,
@@ -86281,7 +86285,7 @@ var styles$n = {
86281
86285
  buttonText,
86282
86286
  buttonIcon,
86283
86287
  filterName,
86284
- filterDropdown: filterDropdown$1
86288
+ filterDropdown: filterDropdown$2
86285
86289
  };
86286
86290
  const container$a = "_container_1qflp_1";
86287
86291
  const popover$1 = "_popover_1qflp_9";
@@ -86387,8 +86391,8 @@ const FilterField = ({
86387
86391
  tableName
86388
86392
  }) => {
86389
86393
  const [operator, setOperator] = useState({
86390
- value: "",
86391
- label: ""
86394
+ value: "=",
86395
+ label: "Equal to (=)"
86392
86396
  });
86393
86397
  const [option2, setOption] = useState({
86394
86398
  value: "",
@@ -86493,20 +86497,21 @@ const FilterField = ({
86493
86497
  })
86494
86498
  });
86495
86499
  };
86496
- const container$9 = "_container_9vrf0_1";
86497
- const form$1 = "_form_9vrf0_7";
86498
- const filterHeader = "_filterHeader_9vrf0_13";
86499
- const titleContent = "_titleContent_9vrf0_19";
86500
- const title = "_title_9vrf0_19";
86501
- const buttons = "_buttons_9vrf0_31";
86502
- const apply = "_apply_9vrf0_37";
86503
- const applyIcon = "_applyIcon_9vrf0_43";
86504
- const reset = "_reset_9vrf0_49";
86505
- const filterFields = "_filterFields_9vrf0_55";
86506
- const filters = "_filters_9vrf0_61";
86507
- const filterItem = "_filterItem_9vrf0_67";
86508
- const filterItemOperator = "_filterItemOperator_9vrf0_73";
86509
- const remove = "_remove_9vrf0_79";
86500
+ const container$9 = "_container_1cs1m_1";
86501
+ const form$1 = "_form_1cs1m_7";
86502
+ const filterHeader = "_filterHeader_1cs1m_13";
86503
+ const titleContent = "_titleContent_1cs1m_19";
86504
+ const title = "_title_1cs1m_19";
86505
+ const buttons = "_buttons_1cs1m_31";
86506
+ const apply = "_apply_1cs1m_37";
86507
+ const applyIcon = "_applyIcon_1cs1m_43";
86508
+ const reset = "_reset_1cs1m_49";
86509
+ const filterFields = "_filterFields_1cs1m_55";
86510
+ const filterDropdown$1 = "_filterDropdown_1cs1m_61";
86511
+ const filters = "_filters_1cs1m_67";
86512
+ const filterItem = "_filterItem_1cs1m_73";
86513
+ const filterItemOperator = "_filterItemOperator_1cs1m_79";
86514
+ const remove = "_remove_1cs1m_85";
86510
86515
  var styles$l = {
86511
86516
  container: container$9,
86512
86517
  form: form$1,
@@ -86518,6 +86523,7 @@ var styles$l = {
86518
86523
  applyIcon,
86519
86524
  reset,
86520
86525
  filterFields,
86526
+ filterDropdown: filterDropdown$1,
86521
86527
  filters,
86522
86528
  filterItem,
86523
86529
  filterItemOperator,
@@ -86578,6 +86584,14 @@ const GlobalFilters = ({
86578
86584
  filters: filterColumns
86579
86585
  });
86580
86586
  };
86587
+ const getSelectedOption = useCallback((col) => {
86588
+ var _a2;
86589
+ const colValue = ((_a2 = appliedfilters.find((filter2) => filter2.column === col)) == null ? void 0 : _a2.value) || "";
86590
+ return {
86591
+ label: colValue,
86592
+ value: colValue
86593
+ };
86594
+ }, [appliedfilters]);
86581
86595
  return /* @__PURE__ */ jsx(Fragment, {
86582
86596
  children: /* @__PURE__ */ jsxs("div", {
86583
86597
  className: styles$l.container,
@@ -86617,20 +86631,33 @@ const GlobalFilters = ({
86617
86631
  })]
86618
86632
  }), /* @__PURE__ */ jsx("div", {
86619
86633
  className: styles$l.filterFields,
86620
- children: filters2[0].columns.map((col) => /* @__PURE__ */ jsx(FilterField, {
86621
- tableName: filters2[0].tableName,
86622
- filter: col,
86623
- isResetted: !appliedfilters.find((a2) => a2.column === col.name),
86624
- onChange: (field2) => setAppliedFilters((prev) => {
86625
- const index2 = prev.findIndex((f2) => f2.column === field2.column);
86626
- if (index2 === -1)
86627
- return [...prev, field2];
86628
- const updated = [...prev];
86629
- updated[index2] = field2;
86630
- return updated;
86631
- }),
86632
- companyId
86633
- }, col.name))
86634
+ children: filters2[0].columns.map((col) => /* @__PURE__ */ jsx("div", {
86635
+ className: styles$l.filterDropdown,
86636
+ children: /* @__PURE__ */ jsx(FilterDropDown, {
86637
+ filter: {
86638
+ tableName: filters2[0].tableName,
86639
+ columnName: col.name
86640
+ },
86641
+ companyId,
86642
+ selectedOption: getSelectedOption(col.name),
86643
+ autoSelected: false,
86644
+ onChange: (option2) => setAppliedFilters((prev) => {
86645
+ const field2 = {
86646
+ column: col.name,
86647
+ operator: "=",
86648
+ value: option2.value
86649
+ };
86650
+ const index2 = prev.findIndex((f2) => f2.column === col.name);
86651
+ if (index2 === -1)
86652
+ return [...prev, field2];
86653
+ const updated = [...prev];
86654
+ updated[index2] = field2;
86655
+ return updated;
86656
+ }),
86657
+ labelDesign: "client",
86658
+ isSearchEnabled: true
86659
+ })
86660
+ }))
86634
86661
  })]
86635
86662
  }), appliedfilters.length ? /* @__PURE__ */ jsx("ul", {
86636
86663
  className: styles$l.filters,
@@ -87271,6 +87298,14 @@ const ChartConfigure = ({
87271
87298
  }))
87272
87299
  })
87273
87300
  })]
87301
+ }), chartType2 === "funnel" && /* @__PURE__ */ jsx(InputField, {
87302
+ type: "checkbox",
87303
+ label: "Show labels with values",
87304
+ checked: customSettings.showLabelValues,
87305
+ onChange: (e2) => setCustomSettings((settings2) => ({
87306
+ ...settings2,
87307
+ showLabelValues: e2.target.checked
87308
+ }))
87274
87309
  }), chartType2 !== "pie" && chartType2 !== "doughnut" && chartType2 !== "funnel" && chartType2 !== "gauge" && chartType2 !== "sankey" && chartType2 !== "singleValue" && chartType2 !== "table" && /* @__PURE__ */ jsxs(Fragment, {
87275
87310
  children: [/* @__PURE__ */ jsxs("div", {
87276
87311
  className: styles$g.seriesWrapper,
@@ -89757,7 +89792,8 @@ const EmbeddedMetricCreation = ({
89757
89792
  subHeaderFontSize: 0,
89758
89793
  dateFormatter: "none",
89759
89794
  numberFormatter: "original",
89760
- xRotation: 50
89795
+ xRotation: 50,
89796
+ showLabelValues: false
89761
89797
  });
89762
89798
  const [tableSettings, setTableSettings] = useState({
89763
89799
  contentAlignment: "center",
@@ -96042,7 +96078,8 @@ const MetricCard = ({
96042
96078
  subHeaderFontSize: 0,
96043
96079
  dateFormatter: "none",
96044
96080
  numberFormatter: "original",
96045
- xRotation: 50
96081
+ xRotation: 50,
96082
+ showLabelValues: false
96046
96083
  });
96047
96084
  const [backGroundColor, setBackGroundColor] = useState({
96048
96085
  show: false
@@ -96077,7 +96114,8 @@ const MetricCard = ({
96077
96114
  subHeaderFontSize: 0,
96078
96115
  dateFormatter: "none",
96079
96116
  numberFormatter: "original",
96080
- xRotation: 50
96117
+ xRotation: 50,
96118
+ showLabelValues: false
96081
96119
  });
96082
96120
  setEnableGroupBy(metricItem == null ? void 0 : metricItem.isEnableGroupBy);
96083
96121
  setSelectedGroupBy(metricItem == null ? void 0 : metricItem.selectedGroupBy);
@@ -96538,7 +96576,8 @@ const SingleValueCard = ({
96538
96576
  subHeaderFontSize: 0,
96539
96577
  dateFormatter: "none",
96540
96578
  numberFormatter: "original",
96541
- xRotation: 50
96579
+ xRotation: 50,
96580
+ showLabelValues: false
96542
96581
  });
96543
96582
  const {
96544
96583
  data: metricdata,
@@ -96573,7 +96612,8 @@ const SingleValueCard = ({
96573
96612
  subHeaderFontSize: 0,
96574
96613
  dateFormatter: "none",
96575
96614
  numberFormatter: "original",
96576
- xRotation: 50
96615
+ xRotation: 50,
96616
+ showLabelValues: false
96577
96617
  });
96578
96618
  setClickBehaviourConfigs(metricItem.clickActions || {
96579
96619
  card: {