@databrainhq/plugin 0.7.5 → 0.7.6

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/index.es.js CHANGED
@@ -2570,7 +2570,10 @@ var styles$C = {
2570
2570
  floatingButton,
2571
2571
  floatingButtonIcon,
2572
2572
  staticContainer,
2573
- floatingContainer
2573
+ floatingContainer,
2574
+ "hover:cursor-pointer": "_hover:cursor-pointer_1hfou_1",
2575
+ "hover:cursor-text": "_hover:cursor-text_1hfou_1",
2576
+ "disabled:cursor-text": "_disabled:cursor-text_1hfou_1"
2574
2577
  };
2575
2578
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2576
2579
  function getAugmentedNamespace(n2) {
@@ -8025,6 +8028,7 @@ const EmbeddedDashboardMetricsDocument = `
8025
8028
  companyIntegration {
8026
8029
  name
8027
8030
  }
8031
+ clickActions
8028
8032
  }
8029
8033
  }
8030
8034
  }
@@ -79534,6 +79538,46 @@ var EChartsReact = function(_super) {
79534
79538
  }
79535
79539
  return EChartsReact2;
79536
79540
  }(EChartsReactCore);
79541
+ const handleRoute = (routeType, route) => {
79542
+ if (routeType === "external") {
79543
+ window.open(route, "_blank");
79544
+ } else {
79545
+ window.location.replace(route);
79546
+ }
79547
+ };
79548
+ const handleCardClick = (clickActionsConfig, metricId, id2) => {
79549
+ const { card } = clickActionsConfig;
79550
+ switch (true) {
79551
+ case !card.isEnable:
79552
+ return;
79553
+ case card.dynamic === "metricId": {
79554
+ const metricRoute = card.route.replace("{{metric.metricId}}", metricId);
79555
+ handleRoute(card.routeType, metricRoute);
79556
+ break;
79557
+ }
79558
+ case card.dynamic === "uuid": {
79559
+ const uuidRoute = card.route.replace("{{metric.uuid}}", id2);
79560
+ handleRoute(card.routeType, uuidRoute);
79561
+ break;
79562
+ }
79563
+ case card.dynamic === "none": {
79564
+ handleRoute(card.routeType, card.route);
79565
+ break;
79566
+ }
79567
+ default:
79568
+ console.warn("Unhandled click behaviour configuration");
79569
+ break;
79570
+ }
79571
+ };
79572
+ const handleChartClick = (clickActionsConfig, value) => {
79573
+ if (clickActionsConfig.isEnable) {
79574
+ const navigateRoute = clickActionsConfig.route.replace(
79575
+ "{{value}}",
79576
+ `${value}`.replace(/"/g, "")
79577
+ );
79578
+ handleRoute(clickActionsConfig.routeType, navigateRoute);
79579
+ }
79580
+ };
79537
79581
  const AreaChart = ({
79538
79582
  data: data2,
79539
79583
  margins,
@@ -79545,7 +79589,8 @@ const AreaChart = ({
79545
79589
  updateGroup,
79546
79590
  isEnableGroupBy,
79547
79591
  backGroundColor,
79548
- customSettings
79592
+ customSettings,
79593
+ chartClickConfig
79549
79594
  }) => {
79550
79595
  var _a2;
79551
79596
  const option2 = {
@@ -79649,7 +79694,13 @@ const AreaChart = ({
79649
79694
  width: "100%",
79650
79695
  height: "90%"
79651
79696
  },
79652
- option: option2
79697
+ option: option2,
79698
+ onEvents: {
79699
+ click: (params) => {
79700
+ var _a3;
79701
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79702
+ }
79703
+ }
79653
79704
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79654
79705
  style: {
79655
79706
  width: "100%",
@@ -79674,7 +79725,8 @@ const BarChart = ({
79674
79725
  labelSettings,
79675
79726
  axisSettings,
79676
79727
  margins,
79677
- customSettings
79728
+ customSettings,
79729
+ chartClickConfig
79678
79730
  }) => {
79679
79731
  var _a2, _b2;
79680
79732
  const option2 = {
@@ -79780,7 +79832,13 @@ const BarChart = ({
79780
79832
  width: "100%",
79781
79833
  height: "90%"
79782
79834
  },
79783
- option: option2
79835
+ option: option2,
79836
+ onEvents: {
79837
+ click: (params) => {
79838
+ var _a3;
79839
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79840
+ }
79841
+ }
79784
79842
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79785
79843
  style: {
79786
79844
  width: "100%",
@@ -79805,7 +79863,8 @@ const ComboChart = ({
79805
79863
  updateGroup,
79806
79864
  isEnableGroupBy,
79807
79865
  backGroundColor,
79808
- customSettings
79866
+ customSettings,
79867
+ chartClickConfig
79809
79868
  }) => {
79810
79869
  var _a2;
79811
79870
  const choice = ["bar", "line"];
@@ -79934,7 +79993,13 @@ const ComboChart = ({
79934
79993
  width: "100%",
79935
79994
  height: "90%"
79936
79995
  },
79937
- option: option2
79996
+ option: option2,
79997
+ onEvents: {
79998
+ click: (params) => {
79999
+ var _a3;
80000
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80001
+ }
80002
+ }
79938
80003
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79939
80004
  style: {
79940
80005
  width: "100%",
@@ -79959,7 +80024,8 @@ const LineChart = ({
79959
80024
  colors: colors2,
79960
80025
  updateGroup,
79961
80026
  isEnableGroupBy,
79962
- customSettings
80027
+ customSettings,
80028
+ chartClickConfig
79963
80029
  }) => {
79964
80030
  var _a2, _b2;
79965
80031
  const option2 = {
@@ -80068,7 +80134,7 @@ const LineChart = ({
80068
80134
  option: option2,
80069
80135
  onEvents: {
80070
80136
  click: (params) => {
80071
- updateGroup(params.name);
80137
+ handleChartClick(chartClickConfig, params.name);
80072
80138
  }
80073
80139
  }
80074
80140
  })]
@@ -80082,7 +80148,8 @@ const PieChart = ({
80082
80148
  enableSaveAs,
80083
80149
  colors: colors2,
80084
80150
  updateGroup,
80085
- isEnableGroupBy
80151
+ isEnableGroupBy,
80152
+ chartClickConfig
80086
80153
  }) => {
80087
80154
  var _a2, _b2, _c2;
80088
80155
  if (((_b2 = (_a2 = data2 == null ? void 0 : data2.datasets[0]) == null ? void 0 : _a2.data) == null ? void 0 : _b2.length) > 1) {
@@ -80184,7 +80251,13 @@ const PieChart = ({
80184
80251
  width: "100%",
80185
80252
  height: "100%"
80186
80253
  },
80187
- option: option22
80254
+ option: option22,
80255
+ onEvents: {
80256
+ click: (params) => {
80257
+ var _a3;
80258
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80259
+ }
80260
+ }
80188
80261
  })
80189
80262
  })]
80190
80263
  });
@@ -80268,7 +80341,13 @@ const PieChart = ({
80268
80341
  width: "100%",
80269
80342
  height: "100%"
80270
80343
  },
80271
- option: option2
80344
+ option: option2,
80345
+ onEvents: {
80346
+ click: (params) => {
80347
+ var _a3;
80348
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80349
+ }
80350
+ }
80272
80351
  })
80273
80352
  })]
80274
80353
  })
@@ -80284,7 +80363,8 @@ const RowChart = ({
80284
80363
  updateGroup,
80285
80364
  isEnableGroupBy,
80286
80365
  backGroundColor,
80287
- customSettings
80366
+ customSettings,
80367
+ chartClickConfig
80288
80368
  }) => {
80289
80369
  var _a2;
80290
80370
  const option2 = {
@@ -80389,7 +80469,13 @@ const RowChart = ({
80389
80469
  width: "100%",
80390
80470
  height: "90%"
80391
80471
  },
80392
- option: option2
80472
+ option: option2,
80473
+ onEvents: {
80474
+ click: (params) => {
80475
+ var _a3;
80476
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80477
+ }
80478
+ }
80393
80479
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80394
80480
  style: {
80395
80481
  width: "100%",
@@ -80415,7 +80501,8 @@ const ScatterChart = ({
80415
80501
  updateGroup,
80416
80502
  isEnableGroupBy,
80417
80503
  backGroundColor,
80418
- customSettings
80504
+ customSettings,
80505
+ chartClickConfig
80419
80506
  }) => {
80420
80507
  var _a2;
80421
80508
  const option2 = {
@@ -80514,7 +80601,13 @@ const ScatterChart = ({
80514
80601
  width: "100%",
80515
80602
  height: "90%"
80516
80603
  },
80517
- option: option2
80604
+ option: option2,
80605
+ onEvents: {
80606
+ click: (params) => {
80607
+ var _a3;
80608
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80609
+ }
80610
+ }
80518
80611
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80519
80612
  style: {
80520
80613
  width: "100%",
@@ -80539,7 +80632,8 @@ const WaterFallChart = ({
80539
80632
  updateGroup,
80540
80633
  isEnableGroupBy,
80541
80634
  backGroundColor,
80542
- customSettings
80635
+ customSettings,
80636
+ chartClickConfig
80543
80637
  }) => {
80544
80638
  var _a2, _b2;
80545
80639
  const option2 = {
@@ -80641,7 +80735,13 @@ const WaterFallChart = ({
80641
80735
  width: "100%",
80642
80736
  height: "90%"
80643
80737
  },
80644
- option: option2
80738
+ option: option2,
80739
+ onEvents: {
80740
+ click: (params) => {
80741
+ var _a3;
80742
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80743
+ }
80744
+ }
80645
80745
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80646
80746
  style: {
80647
80747
  width: "100%",
@@ -80661,7 +80761,8 @@ const FunnelChart = ({
80661
80761
  margins,
80662
80762
  legendSettings,
80663
80763
  labelSettings,
80664
- colors: colors2
80764
+ colors: colors2,
80765
+ chartClickConfig
80665
80766
  }) => {
80666
80767
  const option2 = {
80667
80768
  tooltip: {
@@ -80734,7 +80835,13 @@ const FunnelChart = ({
80734
80835
  width: "100%",
80735
80836
  height: "90%"
80736
80837
  },
80737
- option: option2
80838
+ option: option2,
80839
+ onEvents: {
80840
+ click: (params) => {
80841
+ var _a2;
80842
+ handleChartClick(chartClickConfig, ((_a2 = params == null ? void 0 : params.name) == null ? void 0 : _a2.split(" ").join("_")) || "undefined");
80843
+ }
80844
+ }
80738
80845
  })
80739
80846
  });
80740
80847
  };
@@ -80748,7 +80855,8 @@ const BubbleChart = ({
80748
80855
  colors: colors2,
80749
80856
  updateGroup,
80750
80857
  isEnableGroupBy,
80751
- customSettings
80858
+ customSettings,
80859
+ chartClickConfig
80752
80860
  }) => {
80753
80861
  var _a2;
80754
80862
  const modifiedData = [];
@@ -80872,7 +80980,13 @@ const BubbleChart = ({
80872
80980
  width: "100%",
80873
80981
  height: "90%"
80874
80982
  },
80875
- option: option2
80983
+ option: option2,
80984
+ onEvents: {
80985
+ click: (params) => {
80986
+ var _a3;
80987
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80988
+ }
80989
+ }
80876
80990
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80877
80991
  style: {
80878
80992
  width: "100%",
@@ -80895,7 +81009,8 @@ const DoughnutChart = ({
80895
81009
  enableSaveAs,
80896
81010
  colors: colors2,
80897
81011
  updateGroup,
80898
- isEnableGroupBy
81012
+ isEnableGroupBy,
81013
+ chartClickConfig
80899
81014
  }) => {
80900
81015
  var _a2, _b2;
80901
81016
  if (((_a2 = data2 == null ? void 0 : data2.labels) == null ? void 0 : _a2.length) > 1) {
@@ -81056,7 +81171,13 @@ const DoughnutChart = ({
81056
81171
  width: "100%",
81057
81172
  height: "90%"
81058
81173
  },
81059
- option: option2
81174
+ option: option2,
81175
+ onEvents: {
81176
+ click: (params) => {
81177
+ var _a3;
81178
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81179
+ }
81180
+ }
81060
81181
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81061
81182
  style: {
81062
81183
  width: "100%",
@@ -81082,7 +81203,8 @@ const SteppedAreaChart = ({
81082
81203
  updateGroup,
81083
81204
  isEnableGroupBy,
81084
81205
  backGroundColor,
81085
- customSettings
81206
+ customSettings,
81207
+ chartClickConfig
81086
81208
  }) => {
81087
81209
  var _a2;
81088
81210
  const choice = ["start", "middle", "end"];
@@ -81185,7 +81307,13 @@ const SteppedAreaChart = ({
81185
81307
  width: "100%",
81186
81308
  height: "90%"
81187
81309
  },
81188
- option: option2
81310
+ option: option2,
81311
+ onEvents: {
81312
+ click: (params) => {
81313
+ var _a3;
81314
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81315
+ }
81316
+ }
81189
81317
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81190
81318
  style: {
81191
81319
  width: "100%",
@@ -81211,7 +81339,8 @@ const Histogram = ({
81211
81339
  updateGroup,
81212
81340
  isEnableGroupBy,
81213
81341
  backGroundColor,
81214
- customSettings
81342
+ customSettings,
81343
+ chartClickConfig
81215
81344
  }) => {
81216
81345
  var _a2, _b2;
81217
81346
  const option2 = {
@@ -81308,7 +81437,13 @@ const Histogram = ({
81308
81437
  width: "100%",
81309
81438
  height: "90%"
81310
81439
  },
81311
- option: option2
81440
+ option: option2,
81441
+ onEvents: {
81442
+ click: (params) => {
81443
+ var _a3;
81444
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81445
+ }
81446
+ }
81312
81447
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81313
81448
  style: {
81314
81449
  width: "100%",
@@ -81328,7 +81463,8 @@ const GaugeChart = ({
81328
81463
  margins,
81329
81464
  legendSettings,
81330
81465
  enableSaveAs,
81331
- colors: colors2
81466
+ colors: colors2,
81467
+ chartClickConfig
81332
81468
  }) => {
81333
81469
  const newGuageData = Array.isArray(gaugeData) ? gaugeData : [];
81334
81470
  const total = newGuageData.reduce((sum2, item) => {
@@ -81423,7 +81559,13 @@ const GaugeChart = ({
81423
81559
  width: "100%",
81424
81560
  height: "113%"
81425
81561
  },
81426
- option: option2
81562
+ option: option2,
81563
+ onEvents: {
81564
+ click: (params) => {
81565
+ var _a2;
81566
+ handleChartClick(chartClickConfig, ((_a2 = params == null ? void 0 : params.name) == null ? void 0 : _a2.split(" ").join("_")) || "undefined");
81567
+ }
81568
+ }
81427
81569
  });
81428
81570
  };
81429
81571
  const SankeyChart = ({
@@ -81431,7 +81573,8 @@ const SankeyChart = ({
81431
81573
  margins,
81432
81574
  enableSaveAs,
81433
81575
  colors: colors2,
81434
- backGroundColor
81576
+ backGroundColor,
81577
+ chartClickConfig
81435
81578
  }) => {
81436
81579
  var _a2, _b2, _c2;
81437
81580
  const allValues = [];
@@ -81508,7 +81651,13 @@ const SankeyChart = ({
81508
81651
  width: "100%",
81509
81652
  height: "100%"
81510
81653
  },
81511
- option: option2
81654
+ option: option2,
81655
+ onEvents: {
81656
+ click: (params) => {
81657
+ var _a3;
81658
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81659
+ }
81660
+ }
81512
81661
  })
81513
81662
  });
81514
81663
  };
@@ -81523,7 +81672,8 @@ const StackedBarChart = ({
81523
81672
  updateGroup,
81524
81673
  isEnableGroupBy,
81525
81674
  backGroundColor,
81526
- customSettings
81675
+ customSettings,
81676
+ chartClickConfig
81527
81677
  }) => {
81528
81678
  var _a2, _b2;
81529
81679
  const option2 = {
@@ -81629,7 +81779,13 @@ const StackedBarChart = ({
81629
81779
  width: "100%",
81630
81780
  height: "90%"
81631
81781
  },
81632
- option: option2
81782
+ option: option2,
81783
+ onEvents: {
81784
+ click: (params) => {
81785
+ var _a3;
81786
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81787
+ }
81788
+ }
81633
81789
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81634
81790
  style: {
81635
81791
  width: "100%",
@@ -81644,9 +81800,9 @@ const StackedBarChart = ({
81644
81800
  })]
81645
81801
  });
81646
81802
  };
81647
- const container$g = "_container_hxsc7_1";
81648
- const label$5 = "_label_hxsc7_7";
81649
- const sync = "_sync_hxsc7_13";
81803
+ const container$g = "_container_1vqip_1";
81804
+ const label$5 = "_label_1vqip_7";
81805
+ const sync = "_sync_1vqip_13";
81650
81806
  var styles$x = {
81651
81807
  container: container$g,
81652
81808
  label: label$5,
@@ -81654,7 +81810,8 @@ var styles$x = {
81654
81810
  };
81655
81811
  const SingleValueChart = ({
81656
81812
  data: data2,
81657
- customSettings
81813
+ customSettings,
81814
+ chartClickConfig
81658
81815
  }) => {
81659
81816
  var _a2, _b2, _c2, _d;
81660
81817
  const subHeaderFont = {
@@ -81663,36 +81820,37 @@ const SingleValueChart = ({
81663
81820
  const valueFont = {
81664
81821
  fontSize: `${customSettings.fontSize}px` || "30px"
81665
81822
  };
81823
+ const hover = chartClickConfig.isEnable ? "hover:cursor-pointer" : "hover:cursor-text";
81666
81824
  const comaFormatter = new Intl.NumberFormat();
81667
81825
  const adaptiveFormatter = (val, decimal) => {
81668
- let value = "";
81826
+ let value2 = "";
81669
81827
  if (decimal) {
81670
81828
  switch (parseInt(val, 10).toString().length) {
81671
81829
  case 1:
81672
81830
  case 2:
81673
81831
  case 3:
81674
- value = val;
81832
+ value2 = val;
81675
81833
  break;
81676
81834
  case 4:
81677
- value = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}k`;
81835
+ value2 = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}k`;
81678
81836
  break;
81679
81837
  case 5:
81680
- value = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}k`;
81838
+ value2 = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}k`;
81681
81839
  break;
81682
81840
  case 6:
81683
- value = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}k`;
81841
+ value2 = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}k`;
81684
81842
  break;
81685
81843
  case 7:
81686
- value = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}M`;
81844
+ value2 = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}M`;
81687
81845
  break;
81688
81846
  case 8:
81689
- value = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}M`;
81847
+ value2 = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}M`;
81690
81848
  break;
81691
81849
  case 9:
81692
- value = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}M`;
81850
+ value2 = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}M`;
81693
81851
  break;
81694
81852
  case 10:
81695
- value = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}B`;
81853
+ value2 = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}B`;
81696
81854
  break;
81697
81855
  }
81698
81856
  } else {
@@ -81700,32 +81858,32 @@ const SingleValueChart = ({
81700
81858
  case 1:
81701
81859
  case 2:
81702
81860
  case 3:
81703
- value = val;
81861
+ value2 = val;
81704
81862
  break;
81705
81863
  case 4:
81706
- value = `${val.toString().slice(0, 1)}k`;
81864
+ value2 = `${val.toString().slice(0, 1)}k`;
81707
81865
  break;
81708
81866
  case 5:
81709
- value = `${val.toString().slice(0, 2)}k`;
81867
+ value2 = `${val.toString().slice(0, 2)}k`;
81710
81868
  break;
81711
81869
  case 6:
81712
- value = `${val.toString().slice(0, 3)}k`;
81870
+ value2 = `${val.toString().slice(0, 3)}k`;
81713
81871
  break;
81714
81872
  case 7:
81715
- value = `${val.toString().slice(0, 1)}M`;
81873
+ value2 = `${val.toString().slice(0, 1)}M`;
81716
81874
  break;
81717
81875
  case 8:
81718
- value = `${val.toString().slice(0, 2)}M`;
81876
+ value2 = `${val.toString().slice(0, 2)}M`;
81719
81877
  break;
81720
81878
  case 9:
81721
- value = `${val.toString().slice(0, 3)}M`;
81879
+ value2 = `${val.toString().slice(0, 3)}M`;
81722
81880
  break;
81723
81881
  case 10:
81724
- value = `${val.toString().slice(0, 1)}B`;
81882
+ value2 = `${val.toString().slice(0, 1)}B`;
81725
81883
  break;
81726
81884
  }
81727
81885
  }
81728
- return value;
81886
+ return value2;
81729
81887
  };
81730
81888
  const formattedData = (val, formatter) => {
81731
81889
  switch (formatter) {
@@ -81733,8 +81891,8 @@ const SingleValueChart = ({
81733
81891
  return val;
81734
81892
  case "3s":
81735
81893
  case "adaptive": {
81736
- const value = adaptiveFormatter(val, true);
81737
- return value;
81894
+ const value2 = adaptiveFormatter(val, true);
81895
+ return value2;
81738
81896
  }
81739
81897
  case "d": {
81740
81898
  const n2 = parseInt(val, 10);
@@ -81745,89 +81903,89 @@ const SingleValueChart = ({
81745
81903
  for (let i2 = 1; i2 < val.toString().length; i2 += 1) {
81746
81904
  num += 0;
81747
81905
  }
81748
- const value = adaptiveFormatter(num, false);
81749
- return value;
81906
+ const value2 = adaptiveFormatter(num, false);
81907
+ return value2;
81750
81908
  }
81751
81909
  case "1f": {
81752
81910
  const num = parseFloat(val.toFixed(1));
81753
- const value = comaFormatter.format(num);
81911
+ const value2 = comaFormatter.format(num);
81754
81912
  if (val.toString().includes(".")) {
81755
- return value;
81913
+ return value2;
81756
81914
  }
81757
- return `${value}.${Array(2).join("0")}`;
81915
+ return `${value2}.${Array(2).join("0")}`;
81758
81916
  }
81759
81917
  case "2f": {
81760
81918
  const num = parseFloat(val.toFixed(2));
81761
- const value = comaFormatter.format(num);
81919
+ const value2 = comaFormatter.format(num);
81762
81920
  if (val.toString().includes(".")) {
81763
81921
  const arr = val.toString().split(".");
81764
81922
  if (arr[1].length > 1) {
81765
- return value;
81923
+ return value2;
81766
81924
  }
81767
- return `${value}.${Array(2).join("0")}`;
81925
+ return `${value2}.${Array(2).join("0")}`;
81768
81926
  }
81769
- return `${value}.${Array(3).join("0")}`;
81927
+ return `${value2}.${Array(3).join("0")}`;
81770
81928
  }
81771
81929
  case "3f": {
81772
81930
  const num = parseFloat(val.toFixed(3));
81773
- const value = comaFormatter.format(num);
81931
+ const value2 = comaFormatter.format(num);
81774
81932
  if (val.toString().includes(".")) {
81775
81933
  const arr = val.toString().split(".");
81776
81934
  if (arr[1].length > 1) {
81777
- return value;
81935
+ return value2;
81778
81936
  }
81779
- return `${value}.${Array(3).join("0")}`;
81937
+ return `${value2}.${Array(3).join("0")}`;
81780
81938
  }
81781
- return `${value}.${Array(4).join("0")}`;
81939
+ return `${value2}.${Array(4).join("0")}`;
81782
81940
  }
81783
81941
  case "+": {
81784
81942
  return `+${comaFormatter.format(val)}`;
81785
81943
  }
81786
81944
  case "$": {
81787
81945
  const num = parseFloat(val.toFixed(2));
81788
- const value = comaFormatter.format(num);
81946
+ const value2 = comaFormatter.format(num);
81789
81947
  if (val.toString().includes(".")) {
81790
81948
  const arr = val.toString().split(".");
81791
81949
  if (arr[1].length > 1) {
81792
- return `$${value}`;
81950
+ return `$${value2}`;
81793
81951
  }
81794
- return `$${value}.${Array(2).join("0")}`;
81952
+ return `$${value2}.${Array(2).join("0")}`;
81795
81953
  }
81796
- return `$${value}.${Array(3).join("0")}`;
81954
+ return `$${value2}.${Array(3).join("0")}`;
81797
81955
  }
81798
81956
  case "1%": {
81799
81957
  const num = val * 100;
81800
- const value = comaFormatter.format(num);
81958
+ const value2 = comaFormatter.format(num);
81801
81959
  if (val.toString().includes(".")) {
81802
- return `${value}%`;
81960
+ return `${value2}%`;
81803
81961
  }
81804
- return `${value}.${Array(2).join("0")}%`;
81962
+ return `${value2}.${Array(2).join("0")}%`;
81805
81963
  }
81806
81964
  case "2%": {
81807
81965
  const num = val * 100;
81808
81966
  const num2 = parseFloat(val.toFixed(2));
81809
- const value = comaFormatter.format(num2);
81967
+ const value2 = comaFormatter.format(num2);
81810
81968
  if (num.toString().includes(".")) {
81811
81969
  const arr = val.toString().split(".");
81812
81970
  if (arr[1].length > 1) {
81813
- return `${value}%`;
81971
+ return `${value2}%`;
81814
81972
  }
81815
- return `${value}.${Array(2).join("0")}`;
81973
+ return `${value2}.${Array(2).join("0")}`;
81816
81974
  }
81817
- return `${value}.${Array(3).join("0")}%`;
81975
+ return `${value2}.${Array(3).join("0")}%`;
81818
81976
  }
81819
81977
  case "3%": {
81820
81978
  const num = val * 100;
81821
81979
  const num2 = parseFloat(val.toFixed(3));
81822
- const value = comaFormatter.format(num2);
81980
+ const value2 = comaFormatter.format(num2);
81823
81981
  if (num.toString().includes(".")) {
81824
81982
  const arr = val.toString().split(".");
81825
81983
  if (arr[1].length > 1) {
81826
- return `${value}%`;
81984
+ return `${value2}%`;
81827
81985
  }
81828
- return `${value}.${Array(3).join("0")}`;
81986
+ return `${value2}.${Array(3).join("0")}`;
81829
81987
  }
81830
- return `${value}.${Array(4).join("0")}%`;
81988
+ return `${value2}.${Array(4).join("0")}%`;
81831
81989
  }
81832
81990
  case "ms1": {
81833
81991
  const seconds = Math.floor(val / 1e3);
@@ -81887,15 +82045,23 @@ const SingleValueChart = ({
81887
82045
  return val;
81888
82046
  }
81889
82047
  };
82048
+ const value = ((_a2 = data2[0]) == null ? void 0 : _a2.value) && ((_b2 = data2[0]) == null ? void 0 : _b2.value.toString().length) > 16 ? dateFormatter((_c2 = data2[0]) == null ? void 0 : _c2.value, customSettings.dateFormatter) : formattedData((_d = data2[0]) == null ? void 0 : _d.value, customSettings.numberFormatter);
81890
82049
  return /* @__PURE__ */ jsxs("div", {
81891
82050
  className: styles$x.container,
81892
82051
  children: [/* @__PURE__ */ jsx("div", {
81893
82052
  style: valueFont,
82053
+ onClick: () => {
82054
+ handleChartClick(chartClickConfig, value || "");
82055
+ },
82056
+ className: hover,
81894
82057
  children: (data2 == null ? void 0 : data2.length) && /* @__PURE__ */ jsx(Fragment, {
81895
- children: ((_a2 = data2[0]) == null ? void 0 : _a2.value) && ((_b2 = data2[0]) == null ? void 0 : _b2.value.toString().length) > 16 ? dateFormatter((_c2 = data2[0]) == null ? void 0 : _c2.value, customSettings.dateFormatter) : formattedData((_d = data2[0]) == null ? void 0 : _d.value, customSettings.numberFormatter)
82058
+ children: value
81896
82059
  })
81897
82060
  }), /* @__PURE__ */ jsx("div", {
81898
82061
  style: subHeaderFont,
82062
+ onClick: () => {
82063
+ handleChartClick(chartClickConfig, customSettings.displayText || "");
82064
+ },
81899
82065
  children: customSettings.subHeaderShow && customSettings.displayText
81900
82066
  })]
81901
82067
  });
@@ -81907,7 +82073,8 @@ const BoxPlot = ({
81907
82073
  axisSettings,
81908
82074
  enableSaveAs,
81909
82075
  colors: colors2,
81910
- customSettings
82076
+ customSettings,
82077
+ chartClickConfig
81911
82078
  }) => {
81912
82079
  var _a2;
81913
82080
  const modifiedData = [];
@@ -82026,22 +82193,28 @@ const BoxPlot = ({
82026
82193
  width: "100%",
82027
82194
  height: "90%"
82028
82195
  },
82029
- option: option2
82196
+ option: option2,
82197
+ onEvents: {
82198
+ click: (params) => {
82199
+ var _a3;
82200
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
82201
+ }
82202
+ }
82030
82203
  })
82031
82204
  });
82032
82205
  };
82033
- const tableSection = "_tableSection_20k3k_1";
82034
- const tableContainer = "_tableContainer_20k3k_5";
82035
- const tableDiv = "_tableDiv_20k3k_9";
82036
- const table$4 = "_table_20k3k_1";
82037
- const tableHead$1 = "_tableHead_20k3k_17";
82038
- const tableHeadColHash = "_tableHeadColHash_20k3k_21";
82039
- const tableCol = "_tableCol_20k3k_25";
82040
- const tableColLabel = "_tableColLabel_20k3k_29";
82041
- const data = "_data_20k3k_33";
82042
- const tableBodyColHash = "_tableBodyColHash_20k3k_37";
82043
- const tableBodyColHashLabel = "_tableBodyColHashLabel_20k3k_41";
82044
- const noData$1 = "_noData_20k3k_53";
82206
+ const tableSection = "_tableSection_tcrid_1";
82207
+ const tableContainer = "_tableContainer_tcrid_5";
82208
+ const tableDiv = "_tableDiv_tcrid_9";
82209
+ const table$4 = "_table_tcrid_1";
82210
+ const tableHead$1 = "_tableHead_tcrid_17";
82211
+ const tableHeadColHash = "_tableHeadColHash_tcrid_21";
82212
+ const tableCol = "_tableCol_tcrid_25";
82213
+ const tableColLabel = "_tableColLabel_tcrid_29";
82214
+ const data = "_data_tcrid_33";
82215
+ const tableBodyColHash = "_tableBodyColHash_tcrid_37";
82216
+ const tableBodyColHashLabel = "_tableBodyColHashLabel_tcrid_41";
82217
+ const noData$1 = "_noData_tcrid_53";
82045
82218
  var style$1 = {
82046
82219
  tableSection,
82047
82220
  tableContainer,
@@ -82054,8 +82227,8 @@ var style$1 = {
82054
82227
  data,
82055
82228
  tableBodyColHash,
82056
82229
  tableBodyColHashLabel,
82057
- "table-loader-container": "_table-loader-container_20k3k_45",
82058
- "table-error-message": "_table-error-message_20k3k_49",
82230
+ "table-loader-container": "_table-loader-container_tcrid_45",
82231
+ "table-error-message": "_table-error-message_tcrid_49",
82059
82232
  noData: noData$1
82060
82233
  };
82061
82234
  var classnames = { exports: {} };
@@ -82147,8 +82320,42 @@ const Text = ({
82147
82320
  children: children2
82148
82321
  });
82149
82322
  };
82323
+ var styles$v = {
82324
+ "btn-primary": "_btn-primary_1h5ze_1",
82325
+ "btn-secondary": "_btn-secondary_1h5ze_5",
82326
+ "btn-reject": "_btn-reject_1h5ze_9",
82327
+ "btn-outlined": "_btn-outlined_1h5ze_14",
82328
+ "btn-tertiary": "_btn-tertiary_1h5ze_18",
82329
+ "btn-default": "_btn-default_1h5ze_22",
82330
+ "btn-large": "_btn-large_1h5ze_25",
82331
+ "btn-small": "_btn-small_1h5ze_28",
82332
+ "btn-xs": "_btn-xs_1h5ze_31",
82333
+ "btn-medium": "_btn-medium_1h5ze_34",
82334
+ "btn-11rem": "_btn-11rem_1h5ze_38"
82335
+ };
82336
+ const Button = ({
82337
+ isDisabled = false,
82338
+ type: type3 = "button",
82339
+ className,
82340
+ children: children2 = "",
82341
+ variant = "primary",
82342
+ size = "none",
82343
+ onClick,
82344
+ title: title2
82345
+ }) => {
82346
+ const btnClasses = classNames(className, styles$v[`btn-${variant}`], size === "none" ? null : styles$v[`btn-${size}`]);
82347
+ return /* @__PURE__ */ jsx("button", {
82348
+ type: type3,
82349
+ className: variant === "custom" ? className : btnClasses,
82350
+ onClick,
82351
+ disabled: isDisabled,
82352
+ title: title2,
82353
+ children: children2
82354
+ });
82355
+ };
82150
82356
  const TableChart = ({
82151
- data: data2
82357
+ data: data2,
82358
+ chartClickConfig
82152
82359
  }) => {
82153
82360
  var _a2, _b2, _c2;
82154
82361
  let k = 0;
@@ -82212,11 +82419,13 @@ const TableChart = ({
82212
82419
  return /* @__PURE__ */ jsx(Fragment, {
82213
82420
  children: /* @__PURE__ */ jsx("td", {
82214
82421
  className: style$1.tableCol,
82215
- children: /* @__PURE__ */ jsx(Text, {
82216
- styleClass: "font-14",
82217
- variant: "p",
82422
+ children: /* @__PURE__ */ jsx(Button, {
82423
+ variant: "custom",
82424
+ type: "button",
82218
82425
  className: style$1.tableColLabel,
82219
- children: d2
82426
+ isDisabled: !chartClickConfig.isEnable,
82427
+ onClick: () => handleChartClick(chartClickConfig, JSON.stringify(d2)),
82428
+ children: JSON.stringify(d2)
82220
82429
  })
82221
82430
  }, d2 + index2)
82222
82431
  });
@@ -82245,7 +82454,8 @@ const MetricChart = ({
82245
82454
  colors: colors2,
82246
82455
  updateGroup,
82247
82456
  isEnableGroupBy,
82248
- backGroundColor
82457
+ backGroundColor,
82458
+ chartClickConfig
82249
82459
  }) => {
82250
82460
  var _a2, _b2, _c2, _d;
82251
82461
  if (chartType2 === CHART_TYPES.line) {
@@ -82258,7 +82468,8 @@ const MetricChart = ({
82258
82468
  customSettings,
82259
82469
  enableSaveAs,
82260
82470
  updateGroup,
82261
- isEnableGroupBy
82471
+ isEnableGroupBy,
82472
+ chartClickConfig
82262
82473
  });
82263
82474
  }
82264
82475
  if (chartType2 === CHART_TYPES.stepped) {
@@ -82274,7 +82485,8 @@ const MetricChart = ({
82274
82485
  colors: colors2,
82275
82486
  updateGroup,
82276
82487
  isEnableGroupBy,
82277
- backGroundColor
82488
+ backGroundColor,
82489
+ chartClickConfig
82278
82490
  });
82279
82491
  }
82280
82492
  if (chartType2 === CHART_TYPES.bar) {
@@ -82288,7 +82500,8 @@ const MetricChart = ({
82288
82500
  labelSettings,
82289
82501
  axisSettings,
82290
82502
  customSettings,
82291
- margins
82503
+ margins,
82504
+ chartClickConfig
82292
82505
  });
82293
82506
  }
82294
82507
  if (chartType2 === CHART_TYPES.stack) {
@@ -82303,7 +82516,8 @@ const MetricChart = ({
82303
82516
  updateGroup,
82304
82517
  isEnableGroupBy,
82305
82518
  backGroundColor,
82306
- customSettings
82519
+ customSettings,
82520
+ chartClickConfig
82307
82521
  });
82308
82522
  }
82309
82523
  if (chartType2 === CHART_TYPES.histogram) {
@@ -82318,7 +82532,8 @@ const MetricChart = ({
82318
82532
  updateGroup,
82319
82533
  isEnableGroupBy,
82320
82534
  backGroundColor,
82321
- customSettings
82535
+ customSettings,
82536
+ chartClickConfig
82322
82537
  });
82323
82538
  }
82324
82539
  if (chartType2 === CHART_TYPES.bubble) {
@@ -82333,7 +82548,8 @@ const MetricChart = ({
82333
82548
  updateGroup,
82334
82549
  isEnableGroupBy,
82335
82550
  backGroundColor,
82336
- customSettings
82551
+ customSettings,
82552
+ chartClickConfig
82337
82553
  });
82338
82554
  }
82339
82555
  if (chartType2 === CHART_TYPES.scatter) {
@@ -82348,7 +82564,8 @@ const MetricChart = ({
82348
82564
  updateGroup,
82349
82565
  isEnableGroupBy,
82350
82566
  backGroundColor,
82351
- customSettings
82567
+ customSettings,
82568
+ chartClickConfig
82352
82569
  });
82353
82570
  }
82354
82571
  if (chartType2 === CHART_TYPES.row) {
@@ -82362,7 +82579,8 @@ const MetricChart = ({
82362
82579
  updateGroup,
82363
82580
  isEnableGroupBy,
82364
82581
  backGroundColor,
82365
- customSettings
82582
+ customSettings,
82583
+ chartClickConfig
82366
82584
  });
82367
82585
  }
82368
82586
  if (chartType2 === CHART_TYPES.area) {
@@ -82380,7 +82598,8 @@ const MetricChart = ({
82380
82598
  updateGroup,
82381
82599
  isEnableGroupBy,
82382
82600
  backGroundColor,
82383
- customSettings
82601
+ customSettings,
82602
+ chartClickConfig
82384
82603
  });
82385
82604
  }
82386
82605
  if (chartType2 === CHART_TYPES.combo) {
@@ -82400,7 +82619,8 @@ const MetricChart = ({
82400
82619
  updateGroup,
82401
82620
  isEnableGroupBy,
82402
82621
  backGroundColor,
82403
- customSettings
82622
+ customSettings,
82623
+ chartClickConfig
82404
82624
  });
82405
82625
  }
82406
82626
  if (chartType2 === CHART_TYPES.pie) {
@@ -82412,7 +82632,8 @@ const MetricChart = ({
82412
82632
  enableSaveAs,
82413
82633
  colors: colors2,
82414
82634
  updateGroup,
82415
- isEnableGroupBy
82635
+ isEnableGroupBy,
82636
+ chartClickConfig
82416
82637
  });
82417
82638
  }
82418
82639
  if (chartType2 === CHART_TYPES.doughnut) {
@@ -82424,7 +82645,8 @@ const MetricChart = ({
82424
82645
  enableSaveAs,
82425
82646
  colors: colors2,
82426
82647
  updateGroup,
82427
- isEnableGroupBy
82648
+ isEnableGroupBy,
82649
+ chartClickConfig
82428
82650
  });
82429
82651
  }
82430
82652
  if (chartType2 === CHART_TYPES.waterfall) {
@@ -82453,7 +82675,8 @@ const MetricChart = ({
82453
82675
  updateGroup,
82454
82676
  isEnableGroupBy,
82455
82677
  backGroundColor,
82456
- customSettings
82678
+ customSettings,
82679
+ chartClickConfig
82457
82680
  });
82458
82681
  }
82459
82682
  if (chartType2 === CHART_TYPES.funnel) {
@@ -82462,7 +82685,8 @@ const MetricChart = ({
82462
82685
  margins,
82463
82686
  legendSettings,
82464
82687
  labelSettings,
82465
- colors: colors2
82688
+ colors: colors2,
82689
+ chartClickConfig
82466
82690
  });
82467
82691
  }
82468
82692
  if (chartType2 === CHART_TYPES.gauge) {
@@ -82472,7 +82696,8 @@ const MetricChart = ({
82472
82696
  legendSettings,
82473
82697
  labelSettings,
82474
82698
  enableSaveAs,
82475
- colors: colors2
82699
+ colors: colors2,
82700
+ chartClickConfig
82476
82701
  });
82477
82702
  }
82478
82703
  if (chartType2 === CHART_TYPES.sankey) {
@@ -82483,7 +82708,8 @@ const MetricChart = ({
82483
82708
  labelSettings,
82484
82709
  enableSaveAs,
82485
82710
  colors: colors2,
82486
- backGroundColor
82711
+ backGroundColor,
82712
+ chartClickConfig
82487
82713
  });
82488
82714
  }
82489
82715
  if (chartType2 === CHART_TYPES.singleValue) {
@@ -82491,7 +82717,8 @@ const MetricChart = ({
82491
82717
  data: singleValueData2,
82492
82718
  margins,
82493
82719
  labelSettings,
82494
- customSettings
82720
+ customSettings,
82721
+ chartClickConfig
82495
82722
  });
82496
82723
  }
82497
82724
  if (chartType2 === CHART_TYPES.boxplot) {
@@ -82503,7 +82730,8 @@ const MetricChart = ({
82503
82730
  axisSettings,
82504
82731
  enableSaveAs,
82505
82732
  colors: colors2,
82506
- customSettings
82733
+ customSettings,
82734
+ chartClickConfig
82507
82735
  });
82508
82736
  }
82509
82737
  if (chartType2 === CHART_TYPES.table) {
@@ -82511,7 +82739,8 @@ const MetricChart = ({
82511
82739
  data: data2,
82512
82740
  margins,
82513
82741
  legendSettings,
82514
- labelSettings
82742
+ labelSettings,
82743
+ chartClickConfig
82515
82744
  });
82516
82745
  }
82517
82746
  return /* @__PURE__ */ jsx("div", {
@@ -82519,39 +82748,6 @@ const MetricChart = ({
82519
82748
  children: "No chart selected"
82520
82749
  });
82521
82750
  };
82522
- var styles$v = {
82523
- "btn-primary": "_btn-primary_1h5ze_1",
82524
- "btn-secondary": "_btn-secondary_1h5ze_5",
82525
- "btn-reject": "_btn-reject_1h5ze_9",
82526
- "btn-outlined": "_btn-outlined_1h5ze_14",
82527
- "btn-tertiary": "_btn-tertiary_1h5ze_18",
82528
- "btn-default": "_btn-default_1h5ze_22",
82529
- "btn-large": "_btn-large_1h5ze_25",
82530
- "btn-small": "_btn-small_1h5ze_28",
82531
- "btn-xs": "_btn-xs_1h5ze_31",
82532
- "btn-medium": "_btn-medium_1h5ze_34",
82533
- "btn-11rem": "_btn-11rem_1h5ze_38"
82534
- };
82535
- const Button = ({
82536
- isDisabled = false,
82537
- type: type3 = "button",
82538
- className,
82539
- children: children2 = "",
82540
- variant = "primary",
82541
- size = "none",
82542
- onClick,
82543
- title: title2
82544
- }) => {
82545
- const btnClasses = classNames(className, styles$v[`btn-${variant}`], size === "none" ? null : styles$v[`btn-${size}`]);
82546
- return /* @__PURE__ */ jsx("button", {
82547
- type: type3,
82548
- className: variant === "custom" ? className : btnClasses,
82549
- onClick,
82550
- disabled: isDisabled,
82551
- title: title2,
82552
- children: children2
82553
- });
82554
- };
82555
82751
  const mdiDotsVertical = (props) => /* @__PURE__ */ jsx("svg", {
82556
82752
  viewBox: "0 0 24 24",
82557
82753
  width: "1.2em",
@@ -86457,6 +86653,22 @@ const MetricCard = ({
86457
86653
  const [singleValue2, setSingleValue] = useState("");
86458
86654
  const [dataDb, setData] = useState([]);
86459
86655
  const [rlsConditions, setRlsConditions] = useState([]);
86656
+ const [clickBehaviourConfigs, setClickBehaviourConfigs] = useState({
86657
+ card: {
86658
+ isEnable: false,
86659
+ baseUrl: "",
86660
+ dynamic: "none",
86661
+ route: "",
86662
+ routeType: "internal"
86663
+ },
86664
+ chart: {
86665
+ isEnable: false,
86666
+ baseUrl: "",
86667
+ dynamic: "{{value}}",
86668
+ route: "/{{value}}",
86669
+ routeType: "internal"
86670
+ }
86671
+ });
86460
86672
  const {
86461
86673
  data: metricdata,
86462
86674
  isLoading: isQueryLoading
@@ -86547,6 +86759,22 @@ const MetricCard = ({
86547
86759
  setSelectedGroupBy(metricItem == null ? void 0 : metricItem.selectedGroupBy);
86548
86760
  setGroupBy(metricItem == null ? void 0 : metricItem.groupBy);
86549
86761
  setRlsConditions((metricItem == null ? void 0 : metricItem.rlsConditions) || []);
86762
+ setClickBehaviourConfigs(metricItem.clickActions || {
86763
+ card: {
86764
+ isEnable: false,
86765
+ baseUrl: "",
86766
+ dynamic: "none",
86767
+ route: "",
86768
+ routeType: "internal"
86769
+ },
86770
+ chart: {
86771
+ isEnable: false,
86772
+ baseUrl: "",
86773
+ dynamic: "{{value}}",
86774
+ route: "/{{value}}",
86775
+ routeType: "internal"
86776
+ }
86777
+ });
86550
86778
  }, [metricItem]);
86551
86779
  useEffect(() => {
86552
86780
  setData(queryData != null ? queryData : []);
@@ -86628,7 +86856,14 @@ const MetricCard = ({
86628
86856
  variant: "h3",
86629
86857
  styleClass: "primary",
86630
86858
  className: styles$z.metricName,
86631
- children: [renderHeaderName ? renderHeaderName(metricItem.name) : metricItem.name, metricItem.description && /* @__PURE__ */ jsx("span", {
86859
+ children: [renderHeaderName ? renderHeaderName(metricItem.name) : /* @__PURE__ */ jsx(Button, {
86860
+ type: "button",
86861
+ variant: "custom",
86862
+ isDisabled: !clickBehaviourConfigs.card.isEnable,
86863
+ className: "disabled:cursor-text",
86864
+ onClick: () => handleCardClick(clickBehaviourConfigs, metricItem.metricId, metricItem.id),
86865
+ children: metricItem.name
86866
+ }), metricItem.description && /* @__PURE__ */ jsx("span", {
86632
86867
  className: styles$z.metricDescription,
86633
86868
  children: metricItem.description
86634
86869
  })]
@@ -86668,7 +86903,8 @@ const MetricCard = ({
86668
86903
  axisSettings,
86669
86904
  customSettings,
86670
86905
  backGroundColor,
86671
- enableSaveAs: true
86906
+ enableSaveAs: true,
86907
+ chartClickConfig: clickBehaviourConfigs.chart
86672
86908
  }),
86673
86909
  children: [/* @__PURE__ */ jsx(ggMinimize, {}), " Enter Fullscreen"]
86674
86910
  }), /* @__PURE__ */ jsx(CsvDownloadButton, {
@@ -86723,7 +86959,8 @@ const MetricCard = ({
86723
86959
  updateGroup,
86724
86960
  isEnableGroupBy,
86725
86961
  customSettings,
86726
- backGroundColor
86962
+ backGroundColor,
86963
+ chartClickConfig: clickBehaviourConfigs.chart
86727
86964
  }) : null]
86728
86965
  })]
86729
86966
  })
@@ -86752,6 +86989,22 @@ const SingleValueCard = ({
86752
86989
  const [singleValue2, setSingleValue] = useState("");
86753
86990
  const [dataDb, setData] = useState([]);
86754
86991
  const [rlsConditions, setRlsConditions] = useState([]);
86992
+ const [clickBehaviourConfigs, setClickBehaviourConfigs] = useState({
86993
+ card: {
86994
+ isEnable: false,
86995
+ baseUrl: "",
86996
+ dynamic: "none",
86997
+ route: "",
86998
+ routeType: "internal"
86999
+ },
87000
+ chart: {
87001
+ isEnable: false,
87002
+ baseUrl: "",
87003
+ dynamic: "{{value}}",
87004
+ route: "/{{value}}",
87005
+ routeType: "internal"
87006
+ }
87007
+ });
86755
87008
  const [customSettings, setCustomSettings] = useState({
86756
87009
  hideSplitLines: "none",
86757
87010
  hideAxisLines: "none",
@@ -86800,6 +87053,22 @@ const SingleValueCard = ({
86800
87053
  dateFormatter: "none",
86801
87054
  numberFormatter: "original"
86802
87055
  });
87056
+ setClickBehaviourConfigs(metricItem.clickActions || {
87057
+ card: {
87058
+ isEnable: false,
87059
+ baseUrl: "",
87060
+ dynamic: "none",
87061
+ route: "",
87062
+ routeType: "internal"
87063
+ },
87064
+ chart: {
87065
+ isEnable: false,
87066
+ baseUrl: "",
87067
+ dynamic: "{{value}}",
87068
+ route: "/{{value}}",
87069
+ routeType: "internal"
87070
+ }
87071
+ });
86803
87072
  }, [metricItem]);
86804
87073
  useEffect(() => {
86805
87074
  setData(queryData != null ? queryData : []);
@@ -86822,7 +87091,14 @@ const SingleValueCard = ({
86822
87091
  variant: "h3",
86823
87092
  styleClass: "primary",
86824
87093
  className: styles$z.metricName,
86825
- children: [renderHeaderName ? renderHeaderName(metricItem.name) : metricItem.name, metricItem.description && /* @__PURE__ */ jsx("span", {
87094
+ children: [renderHeaderName ? renderHeaderName(metricItem.name) : /* @__PURE__ */ jsx(Button, {
87095
+ type: "button",
87096
+ variant: "custom",
87097
+ isDisabled: !clickBehaviourConfigs.card.isEnable,
87098
+ className: "disabled:cursor-text",
87099
+ onClick: () => handleCardClick(clickBehaviourConfigs, metricItem.metricId, metricItem.id),
87100
+ children: metricItem.name
87101
+ }), metricItem.description && /* @__PURE__ */ jsx("span", {
86826
87102
  className: styles$z.metricDescription,
86827
87103
  children: metricItem.description
86828
87104
  })]
@@ -86848,7 +87124,8 @@ const SingleValueCard = ({
86848
87124
  }) : /* @__PURE__ */ jsx(Fragment, {
86849
87125
  children: singleValueData2.length ? /* @__PURE__ */ jsx(SingleValueChart, {
86850
87126
  data: chartData,
86851
- customSettings
87127
+ customSettings,
87128
+ chartClickConfig: clickBehaviourConfigs.chart
86852
87129
  }) : /* @__PURE__ */ jsx("div", {
86853
87130
  className: styles$z.noData,
86854
87131
  children: /* @__PURE__ */ jsxs("div", {
@@ -86975,7 +87252,14 @@ const FullScreenChart = ({
86975
87252
  axisSettings: chart.axisSettings,
86976
87253
  backGroundColor: chart.backGroundColor,
86977
87254
  enableSaveAs: true,
86978
- customSettings: chart.customSettings
87255
+ customSettings: chart.customSettings,
87256
+ chartClickConfig: {
87257
+ isEnable: false,
87258
+ baseUrl: "",
87259
+ dynamic: "{{value}}",
87260
+ route: "/{{value}}",
87261
+ routeType: "internal"
87262
+ }
86979
87263
  })
86980
87264
  })
86981
87265
  });
@@ -89053,6 +89337,13 @@ const ChartTab = ({
89053
89337
  backGroundColor,
89054
89338
  updateGroup,
89055
89339
  isEnableGroupBy,
89340
+ chartClickConfig: {
89341
+ isEnable: false,
89342
+ baseUrl: "",
89343
+ dynamic: "{{value}}",
89344
+ route: "/{{value}}",
89345
+ routeType: "internal"
89346
+ },
89056
89347
  enableSaveAs: true
89057
89348
  })
89058
89349
  }) : /* @__PURE__ */ jsxs("div", {
@@ -89098,7 +89389,14 @@ const ChartTab = ({
89098
89389
  axisSettings,
89099
89390
  customSettings,
89100
89391
  backGroundColor,
89101
- enableSaveAs: true
89392
+ enableSaveAs: true,
89393
+ chartClickConfig: {
89394
+ isEnable: false,
89395
+ baseUrl: "",
89396
+ dynamic: "{{value}}",
89397
+ route: "/{{value}}",
89398
+ routeType: "internal"
89399
+ }
89102
89400
  }
89103
89401
  })]
89104
89402
  });