@databrainhq/plugin 0.7.5 → 0.7.7

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
@@ -2545,6 +2545,7 @@ var styles$C = {
2545
2545
  grid,
2546
2546
  hidden,
2547
2547
  "h-screen": "_h-screen_1hfou_1",
2548
+ "h-[10%]": "_h-[10%]_1hfou_1",
2548
2549
  "w-screen": "_w-screen_1hfou_1",
2549
2550
  "w-full": "_w-full_1hfou_1",
2550
2551
  transform,
@@ -2570,7 +2571,10 @@ var styles$C = {
2570
2571
  floatingButton,
2571
2572
  floatingButtonIcon,
2572
2573
  staticContainer,
2573
- floatingContainer
2574
+ floatingContainer,
2575
+ "hover:cursor-pointer": "_hover:cursor-pointer_1hfou_1",
2576
+ "hover:cursor-text": "_hover:cursor-text_1hfou_1",
2577
+ "disabled:cursor-text": "_disabled:cursor-text_1hfou_1"
2574
2578
  };
2575
2579
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2576
2580
  function getAugmentedNamespace(n2) {
@@ -8025,6 +8029,7 @@ const EmbeddedDashboardMetricsDocument = `
8025
8029
  companyIntegration {
8026
8030
  name
8027
8031
  }
8032
+ clickActions
8028
8033
  }
8029
8034
  }
8030
8035
  }
@@ -79534,6 +79539,46 @@ var EChartsReact = function(_super) {
79534
79539
  }
79535
79540
  return EChartsReact2;
79536
79541
  }(EChartsReactCore);
79542
+ const handleRoute = (routeType, route) => {
79543
+ if (routeType === "external") {
79544
+ window.open(route, "_blank");
79545
+ } else {
79546
+ window.location.replace(route);
79547
+ }
79548
+ };
79549
+ const handleCardClick = (clickActionsConfig, metricId, id2) => {
79550
+ const { card } = clickActionsConfig;
79551
+ switch (true) {
79552
+ case !card.isEnable:
79553
+ return;
79554
+ case card.dynamic === "metricId": {
79555
+ const metricRoute = card.route.replace("{{metric.metricId}}", metricId);
79556
+ handleRoute(card.routeType, metricRoute);
79557
+ break;
79558
+ }
79559
+ case card.dynamic === "uuid": {
79560
+ const uuidRoute = card.route.replace("{{metric.uuid}}", id2);
79561
+ handleRoute(card.routeType, uuidRoute);
79562
+ break;
79563
+ }
79564
+ case card.dynamic === "none": {
79565
+ handleRoute(card.routeType, card.route);
79566
+ break;
79567
+ }
79568
+ default:
79569
+ console.warn("Unhandled click behaviour configuration");
79570
+ break;
79571
+ }
79572
+ };
79573
+ const handleChartClick = (clickActionsConfig, value) => {
79574
+ if (clickActionsConfig.isEnable) {
79575
+ const navigateRoute = clickActionsConfig.route.replace(
79576
+ "{{value}}",
79577
+ `${value}`.replace(/"/g, "")
79578
+ );
79579
+ handleRoute(clickActionsConfig.routeType, navigateRoute);
79580
+ }
79581
+ };
79537
79582
  const AreaChart = ({
79538
79583
  data: data2,
79539
79584
  margins,
@@ -79545,7 +79590,8 @@ const AreaChart = ({
79545
79590
  updateGroup,
79546
79591
  isEnableGroupBy,
79547
79592
  backGroundColor,
79548
- customSettings
79593
+ customSettings,
79594
+ chartClickConfig
79549
79595
  }) => {
79550
79596
  var _a2;
79551
79597
  const option2 = {
@@ -79649,7 +79695,13 @@ const AreaChart = ({
79649
79695
  width: "100%",
79650
79696
  height: "90%"
79651
79697
  },
79652
- option: option2
79698
+ option: option2,
79699
+ onEvents: {
79700
+ click: (params) => {
79701
+ var _a3;
79702
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79703
+ }
79704
+ }
79653
79705
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79654
79706
  style: {
79655
79707
  width: "100%",
@@ -79674,7 +79726,8 @@ const BarChart = ({
79674
79726
  labelSettings,
79675
79727
  axisSettings,
79676
79728
  margins,
79677
- customSettings
79729
+ customSettings,
79730
+ chartClickConfig
79678
79731
  }) => {
79679
79732
  var _a2, _b2;
79680
79733
  const option2 = {
@@ -79780,7 +79833,13 @@ const BarChart = ({
79780
79833
  width: "100%",
79781
79834
  height: "90%"
79782
79835
  },
79783
- option: option2
79836
+ option: option2,
79837
+ onEvents: {
79838
+ click: (params) => {
79839
+ var _a3;
79840
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
79841
+ }
79842
+ }
79784
79843
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79785
79844
  style: {
79786
79845
  width: "100%",
@@ -79805,7 +79864,8 @@ const ComboChart = ({
79805
79864
  updateGroup,
79806
79865
  isEnableGroupBy,
79807
79866
  backGroundColor,
79808
- customSettings
79867
+ customSettings,
79868
+ chartClickConfig
79809
79869
  }) => {
79810
79870
  var _a2;
79811
79871
  const choice = ["bar", "line"];
@@ -79934,7 +79994,13 @@ const ComboChart = ({
79934
79994
  width: "100%",
79935
79995
  height: "90%"
79936
79996
  },
79937
- option: option2
79997
+ option: option2,
79998
+ onEvents: {
79999
+ click: (params) => {
80000
+ var _a3;
80001
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80002
+ }
80003
+ }
79938
80004
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
79939
80005
  style: {
79940
80006
  width: "100%",
@@ -79959,7 +80025,8 @@ const LineChart = ({
79959
80025
  colors: colors2,
79960
80026
  updateGroup,
79961
80027
  isEnableGroupBy,
79962
- customSettings
80028
+ customSettings,
80029
+ chartClickConfig
79963
80030
  }) => {
79964
80031
  var _a2, _b2;
79965
80032
  const option2 = {
@@ -80068,7 +80135,7 @@ const LineChart = ({
80068
80135
  option: option2,
80069
80136
  onEvents: {
80070
80137
  click: (params) => {
80071
- updateGroup(params.name);
80138
+ handleChartClick(chartClickConfig, params.name);
80072
80139
  }
80073
80140
  }
80074
80141
  })]
@@ -80082,7 +80149,8 @@ const PieChart = ({
80082
80149
  enableSaveAs,
80083
80150
  colors: colors2,
80084
80151
  updateGroup,
80085
- isEnableGroupBy
80152
+ isEnableGroupBy,
80153
+ chartClickConfig
80086
80154
  }) => {
80087
80155
  var _a2, _b2, _c2;
80088
80156
  if (((_b2 = (_a2 = data2 == null ? void 0 : data2.datasets[0]) == null ? void 0 : _a2.data) == null ? void 0 : _b2.length) > 1) {
@@ -80184,7 +80252,13 @@ const PieChart = ({
80184
80252
  width: "100%",
80185
80253
  height: "100%"
80186
80254
  },
80187
- option: option22
80255
+ option: option22,
80256
+ onEvents: {
80257
+ click: (params) => {
80258
+ var _a3;
80259
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80260
+ }
80261
+ }
80188
80262
  })
80189
80263
  })]
80190
80264
  });
@@ -80268,7 +80342,13 @@ const PieChart = ({
80268
80342
  width: "100%",
80269
80343
  height: "100%"
80270
80344
  },
80271
- option: option2
80345
+ option: option2,
80346
+ onEvents: {
80347
+ click: (params) => {
80348
+ var _a3;
80349
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80350
+ }
80351
+ }
80272
80352
  })
80273
80353
  })]
80274
80354
  })
@@ -80284,7 +80364,8 @@ const RowChart = ({
80284
80364
  updateGroup,
80285
80365
  isEnableGroupBy,
80286
80366
  backGroundColor,
80287
- customSettings
80367
+ customSettings,
80368
+ chartClickConfig
80288
80369
  }) => {
80289
80370
  var _a2;
80290
80371
  const option2 = {
@@ -80389,7 +80470,13 @@ const RowChart = ({
80389
80470
  width: "100%",
80390
80471
  height: "90%"
80391
80472
  },
80392
- option: option2
80473
+ option: option2,
80474
+ onEvents: {
80475
+ click: (params) => {
80476
+ var _a3;
80477
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80478
+ }
80479
+ }
80393
80480
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80394
80481
  style: {
80395
80482
  width: "100%",
@@ -80415,7 +80502,8 @@ const ScatterChart = ({
80415
80502
  updateGroup,
80416
80503
  isEnableGroupBy,
80417
80504
  backGroundColor,
80418
- customSettings
80505
+ customSettings,
80506
+ chartClickConfig
80419
80507
  }) => {
80420
80508
  var _a2;
80421
80509
  const option2 = {
@@ -80514,7 +80602,13 @@ const ScatterChart = ({
80514
80602
  width: "100%",
80515
80603
  height: "90%"
80516
80604
  },
80517
- option: option2
80605
+ option: option2,
80606
+ onEvents: {
80607
+ click: (params) => {
80608
+ var _a3;
80609
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80610
+ }
80611
+ }
80518
80612
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80519
80613
  style: {
80520
80614
  width: "100%",
@@ -80539,7 +80633,8 @@ const WaterFallChart = ({
80539
80633
  updateGroup,
80540
80634
  isEnableGroupBy,
80541
80635
  backGroundColor,
80542
- customSettings
80636
+ customSettings,
80637
+ chartClickConfig
80543
80638
  }) => {
80544
80639
  var _a2, _b2;
80545
80640
  const option2 = {
@@ -80641,7 +80736,13 @@ const WaterFallChart = ({
80641
80736
  width: "100%",
80642
80737
  height: "90%"
80643
80738
  },
80644
- option: option2
80739
+ option: option2,
80740
+ onEvents: {
80741
+ click: (params) => {
80742
+ var _a3;
80743
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80744
+ }
80745
+ }
80645
80746
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80646
80747
  style: {
80647
80748
  width: "100%",
@@ -80661,7 +80762,8 @@ const FunnelChart = ({
80661
80762
  margins,
80662
80763
  legendSettings,
80663
80764
  labelSettings,
80664
- colors: colors2
80765
+ colors: colors2,
80766
+ chartClickConfig
80665
80767
  }) => {
80666
80768
  const option2 = {
80667
80769
  tooltip: {
@@ -80734,7 +80836,13 @@ const FunnelChart = ({
80734
80836
  width: "100%",
80735
80837
  height: "90%"
80736
80838
  },
80737
- option: option2
80839
+ option: option2,
80840
+ onEvents: {
80841
+ click: (params) => {
80842
+ var _a2;
80843
+ handleChartClick(chartClickConfig, ((_a2 = params == null ? void 0 : params.name) == null ? void 0 : _a2.split(" ").join("_")) || "undefined");
80844
+ }
80845
+ }
80738
80846
  })
80739
80847
  });
80740
80848
  };
@@ -80748,7 +80856,8 @@ const BubbleChart = ({
80748
80856
  colors: colors2,
80749
80857
  updateGroup,
80750
80858
  isEnableGroupBy,
80751
- customSettings
80859
+ customSettings,
80860
+ chartClickConfig
80752
80861
  }) => {
80753
80862
  var _a2;
80754
80863
  const modifiedData = [];
@@ -80872,7 +80981,13 @@ const BubbleChart = ({
80872
80981
  width: "100%",
80873
80982
  height: "90%"
80874
80983
  },
80875
- option: option2
80984
+ option: option2,
80985
+ onEvents: {
80986
+ click: (params) => {
80987
+ var _a3;
80988
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
80989
+ }
80990
+ }
80876
80991
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
80877
80992
  style: {
80878
80993
  width: "100%",
@@ -80895,7 +81010,8 @@ const DoughnutChart = ({
80895
81010
  enableSaveAs,
80896
81011
  colors: colors2,
80897
81012
  updateGroup,
80898
- isEnableGroupBy
81013
+ isEnableGroupBy,
81014
+ chartClickConfig
80899
81015
  }) => {
80900
81016
  var _a2, _b2;
80901
81017
  if (((_a2 = data2 == null ? void 0 : data2.labels) == null ? void 0 : _a2.length) > 1) {
@@ -81056,7 +81172,13 @@ const DoughnutChart = ({
81056
81172
  width: "100%",
81057
81173
  height: "90%"
81058
81174
  },
81059
- option: option2
81175
+ option: option2,
81176
+ onEvents: {
81177
+ click: (params) => {
81178
+ var _a3;
81179
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81180
+ }
81181
+ }
81060
81182
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81061
81183
  style: {
81062
81184
  width: "100%",
@@ -81082,7 +81204,8 @@ const SteppedAreaChart = ({
81082
81204
  updateGroup,
81083
81205
  isEnableGroupBy,
81084
81206
  backGroundColor,
81085
- customSettings
81207
+ customSettings,
81208
+ chartClickConfig
81086
81209
  }) => {
81087
81210
  var _a2;
81088
81211
  const choice = ["start", "middle", "end"];
@@ -81185,7 +81308,13 @@ const SteppedAreaChart = ({
81185
81308
  width: "100%",
81186
81309
  height: "90%"
81187
81310
  },
81188
- option: option2
81311
+ option: option2,
81312
+ onEvents: {
81313
+ click: (params) => {
81314
+ var _a3;
81315
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81316
+ }
81317
+ }
81189
81318
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81190
81319
  style: {
81191
81320
  width: "100%",
@@ -81211,7 +81340,8 @@ const Histogram = ({
81211
81340
  updateGroup,
81212
81341
  isEnableGroupBy,
81213
81342
  backGroundColor,
81214
- customSettings
81343
+ customSettings,
81344
+ chartClickConfig
81215
81345
  }) => {
81216
81346
  var _a2, _b2;
81217
81347
  const option2 = {
@@ -81308,7 +81438,13 @@ const Histogram = ({
81308
81438
  width: "100%",
81309
81439
  height: "90%"
81310
81440
  },
81311
- option: option2
81441
+ option: option2,
81442
+ onEvents: {
81443
+ click: (params) => {
81444
+ var _a3;
81445
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81446
+ }
81447
+ }
81312
81448
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81313
81449
  style: {
81314
81450
  width: "100%",
@@ -81328,7 +81464,8 @@ const GaugeChart = ({
81328
81464
  margins,
81329
81465
  legendSettings,
81330
81466
  enableSaveAs,
81331
- colors: colors2
81467
+ colors: colors2,
81468
+ chartClickConfig
81332
81469
  }) => {
81333
81470
  const newGuageData = Array.isArray(gaugeData) ? gaugeData : [];
81334
81471
  const total = newGuageData.reduce((sum2, item) => {
@@ -81423,7 +81560,13 @@ const GaugeChart = ({
81423
81560
  width: "100%",
81424
81561
  height: "113%"
81425
81562
  },
81426
- option: option2
81563
+ option: option2,
81564
+ onEvents: {
81565
+ click: (params) => {
81566
+ var _a2;
81567
+ handleChartClick(chartClickConfig, ((_a2 = params == null ? void 0 : params.name) == null ? void 0 : _a2.split(" ").join("_")) || "undefined");
81568
+ }
81569
+ }
81427
81570
  });
81428
81571
  };
81429
81572
  const SankeyChart = ({
@@ -81431,7 +81574,8 @@ const SankeyChart = ({
81431
81574
  margins,
81432
81575
  enableSaveAs,
81433
81576
  colors: colors2,
81434
- backGroundColor
81577
+ backGroundColor,
81578
+ chartClickConfig
81435
81579
  }) => {
81436
81580
  var _a2, _b2, _c2;
81437
81581
  const allValues = [];
@@ -81508,7 +81652,13 @@ const SankeyChart = ({
81508
81652
  width: "100%",
81509
81653
  height: "100%"
81510
81654
  },
81511
- option: option2
81655
+ option: option2,
81656
+ onEvents: {
81657
+ click: (params) => {
81658
+ var _a3;
81659
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81660
+ }
81661
+ }
81512
81662
  })
81513
81663
  });
81514
81664
  };
@@ -81523,7 +81673,8 @@ const StackedBarChart = ({
81523
81673
  updateGroup,
81524
81674
  isEnableGroupBy,
81525
81675
  backGroundColor,
81526
- customSettings
81676
+ customSettings,
81677
+ chartClickConfig
81527
81678
  }) => {
81528
81679
  var _a2, _b2;
81529
81680
  const option2 = {
@@ -81629,7 +81780,13 @@ const StackedBarChart = ({
81629
81780
  width: "100%",
81630
81781
  height: "90%"
81631
81782
  },
81632
- option: option2
81783
+ option: option2,
81784
+ onEvents: {
81785
+ click: (params) => {
81786
+ var _a3;
81787
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
81788
+ }
81789
+ }
81633
81790
  }), isEnableGroupBy && updateGroup && /* @__PURE__ */ jsx(EChartsReact, {
81634
81791
  style: {
81635
81792
  width: "100%",
@@ -81644,9 +81801,9 @@ const StackedBarChart = ({
81644
81801
  })]
81645
81802
  });
81646
81803
  };
81647
- const container$g = "_container_hxsc7_1";
81648
- const label$5 = "_label_hxsc7_7";
81649
- const sync = "_sync_hxsc7_13";
81804
+ const container$g = "_container_w4vgp_1";
81805
+ const label$5 = "_label_w4vgp_7";
81806
+ const sync = "_sync_w4vgp_13";
81650
81807
  var styles$x = {
81651
81808
  container: container$g,
81652
81809
  label: label$5,
@@ -81654,7 +81811,8 @@ var styles$x = {
81654
81811
  };
81655
81812
  const SingleValueChart = ({
81656
81813
  data: data2,
81657
- customSettings
81814
+ customSettings,
81815
+ chartClickConfig
81658
81816
  }) => {
81659
81817
  var _a2, _b2, _c2, _d;
81660
81818
  const subHeaderFont = {
@@ -81663,36 +81821,37 @@ const SingleValueChart = ({
81663
81821
  const valueFont = {
81664
81822
  fontSize: `${customSettings.fontSize}px` || "30px"
81665
81823
  };
81824
+ const hover = chartClickConfig.isEnable ? "hover:cursor-pointer" : "hover:cursor-text";
81666
81825
  const comaFormatter = new Intl.NumberFormat();
81667
81826
  const adaptiveFormatter = (val, decimal) => {
81668
- let value = "";
81827
+ let value2 = "";
81669
81828
  if (decimal) {
81670
81829
  switch (parseInt(val, 10).toString().length) {
81671
81830
  case 1:
81672
81831
  case 2:
81673
81832
  case 3:
81674
- value = val;
81833
+ value2 = val;
81675
81834
  break;
81676
81835
  case 4:
81677
- value = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}k`;
81836
+ value2 = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}k`;
81678
81837
  break;
81679
81838
  case 5:
81680
- value = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}k`;
81839
+ value2 = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}k`;
81681
81840
  break;
81682
81841
  case 6:
81683
- value = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}k`;
81842
+ value2 = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}k`;
81684
81843
  break;
81685
81844
  case 7:
81686
- value = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}M`;
81845
+ value2 = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}M`;
81687
81846
  break;
81688
81847
  case 8:
81689
- value = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}M`;
81848
+ value2 = `${val.toString().slice(0, 2)}.${val.toString().slice(2, 4)}M`;
81690
81849
  break;
81691
81850
  case 9:
81692
- value = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}M`;
81851
+ value2 = `${val.toString().slice(0, 3)}.${val.toString().slice(3, 5)}M`;
81693
81852
  break;
81694
81853
  case 10:
81695
- value = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}B`;
81854
+ value2 = `${val.toString().slice(0, 1)}.${val.toString().slice(1, 3)}B`;
81696
81855
  break;
81697
81856
  }
81698
81857
  } else {
@@ -81700,32 +81859,32 @@ const SingleValueChart = ({
81700
81859
  case 1:
81701
81860
  case 2:
81702
81861
  case 3:
81703
- value = val;
81862
+ value2 = val;
81704
81863
  break;
81705
81864
  case 4:
81706
- value = `${val.toString().slice(0, 1)}k`;
81865
+ value2 = `${val.toString().slice(0, 1)}k`;
81707
81866
  break;
81708
81867
  case 5:
81709
- value = `${val.toString().slice(0, 2)}k`;
81868
+ value2 = `${val.toString().slice(0, 2)}k`;
81710
81869
  break;
81711
81870
  case 6:
81712
- value = `${val.toString().slice(0, 3)}k`;
81871
+ value2 = `${val.toString().slice(0, 3)}k`;
81713
81872
  break;
81714
81873
  case 7:
81715
- value = `${val.toString().slice(0, 1)}M`;
81874
+ value2 = `${val.toString().slice(0, 1)}M`;
81716
81875
  break;
81717
81876
  case 8:
81718
- value = `${val.toString().slice(0, 2)}M`;
81877
+ value2 = `${val.toString().slice(0, 2)}M`;
81719
81878
  break;
81720
81879
  case 9:
81721
- value = `${val.toString().slice(0, 3)}M`;
81880
+ value2 = `${val.toString().slice(0, 3)}M`;
81722
81881
  break;
81723
81882
  case 10:
81724
- value = `${val.toString().slice(0, 1)}B`;
81883
+ value2 = `${val.toString().slice(0, 1)}B`;
81725
81884
  break;
81726
81885
  }
81727
81886
  }
81728
- return value;
81887
+ return value2;
81729
81888
  };
81730
81889
  const formattedData = (val, formatter) => {
81731
81890
  switch (formatter) {
@@ -81733,8 +81892,8 @@ const SingleValueChart = ({
81733
81892
  return val;
81734
81893
  case "3s":
81735
81894
  case "adaptive": {
81736
- const value = adaptiveFormatter(val, true);
81737
- return value;
81895
+ const value2 = adaptiveFormatter(val, true);
81896
+ return value2;
81738
81897
  }
81739
81898
  case "d": {
81740
81899
  const n2 = parseInt(val, 10);
@@ -81745,89 +81904,89 @@ const SingleValueChart = ({
81745
81904
  for (let i2 = 1; i2 < val.toString().length; i2 += 1) {
81746
81905
  num += 0;
81747
81906
  }
81748
- const value = adaptiveFormatter(num, false);
81749
- return value;
81907
+ const value2 = adaptiveFormatter(num, false);
81908
+ return value2;
81750
81909
  }
81751
81910
  case "1f": {
81752
81911
  const num = parseFloat(val.toFixed(1));
81753
- const value = comaFormatter.format(num);
81912
+ const value2 = comaFormatter.format(num);
81754
81913
  if (val.toString().includes(".")) {
81755
- return value;
81914
+ return value2;
81756
81915
  }
81757
- return `${value}.${Array(2).join("0")}`;
81916
+ return `${value2}.${Array(2).join("0")}`;
81758
81917
  }
81759
81918
  case "2f": {
81760
81919
  const num = parseFloat(val.toFixed(2));
81761
- const value = comaFormatter.format(num);
81920
+ const value2 = comaFormatter.format(num);
81762
81921
  if (val.toString().includes(".")) {
81763
81922
  const arr = val.toString().split(".");
81764
81923
  if (arr[1].length > 1) {
81765
- return value;
81924
+ return value2;
81766
81925
  }
81767
- return `${value}.${Array(2).join("0")}`;
81926
+ return `${value2}.${Array(2).join("0")}`;
81768
81927
  }
81769
- return `${value}.${Array(3).join("0")}`;
81928
+ return `${value2}.${Array(3).join("0")}`;
81770
81929
  }
81771
81930
  case "3f": {
81772
81931
  const num = parseFloat(val.toFixed(3));
81773
- const value = comaFormatter.format(num);
81932
+ const value2 = comaFormatter.format(num);
81774
81933
  if (val.toString().includes(".")) {
81775
81934
  const arr = val.toString().split(".");
81776
81935
  if (arr[1].length > 1) {
81777
- return value;
81936
+ return value2;
81778
81937
  }
81779
- return `${value}.${Array(3).join("0")}`;
81938
+ return `${value2}.${Array(3).join("0")}`;
81780
81939
  }
81781
- return `${value}.${Array(4).join("0")}`;
81940
+ return `${value2}.${Array(4).join("0")}`;
81782
81941
  }
81783
81942
  case "+": {
81784
81943
  return `+${comaFormatter.format(val)}`;
81785
81944
  }
81786
81945
  case "$": {
81787
81946
  const num = parseFloat(val.toFixed(2));
81788
- const value = comaFormatter.format(num);
81947
+ const value2 = comaFormatter.format(num);
81789
81948
  if (val.toString().includes(".")) {
81790
81949
  const arr = val.toString().split(".");
81791
81950
  if (arr[1].length > 1) {
81792
- return `$${value}`;
81951
+ return `$${value2}`;
81793
81952
  }
81794
- return `$${value}.${Array(2).join("0")}`;
81953
+ return `$${value2}.${Array(2).join("0")}`;
81795
81954
  }
81796
- return `$${value}.${Array(3).join("0")}`;
81955
+ return `$${value2}.${Array(3).join("0")}`;
81797
81956
  }
81798
81957
  case "1%": {
81799
81958
  const num = val * 100;
81800
- const value = comaFormatter.format(num);
81959
+ const value2 = comaFormatter.format(num);
81801
81960
  if (val.toString().includes(".")) {
81802
- return `${value}%`;
81961
+ return `${value2}%`;
81803
81962
  }
81804
- return `${value}.${Array(2).join("0")}%`;
81963
+ return `${value2}.${Array(2).join("0")}%`;
81805
81964
  }
81806
81965
  case "2%": {
81807
81966
  const num = val * 100;
81808
81967
  const num2 = parseFloat(val.toFixed(2));
81809
- const value = comaFormatter.format(num2);
81968
+ const value2 = comaFormatter.format(num2);
81810
81969
  if (num.toString().includes(".")) {
81811
81970
  const arr = val.toString().split(".");
81812
81971
  if (arr[1].length > 1) {
81813
- return `${value}%`;
81972
+ return `${value2}%`;
81814
81973
  }
81815
- return `${value}.${Array(2).join("0")}`;
81974
+ return `${value2}.${Array(2).join("0")}`;
81816
81975
  }
81817
- return `${value}.${Array(3).join("0")}%`;
81976
+ return `${value2}.${Array(3).join("0")}%`;
81818
81977
  }
81819
81978
  case "3%": {
81820
81979
  const num = val * 100;
81821
81980
  const num2 = parseFloat(val.toFixed(3));
81822
- const value = comaFormatter.format(num2);
81981
+ const value2 = comaFormatter.format(num2);
81823
81982
  if (num.toString().includes(".")) {
81824
81983
  const arr = val.toString().split(".");
81825
81984
  if (arr[1].length > 1) {
81826
- return `${value}%`;
81985
+ return `${value2}%`;
81827
81986
  }
81828
- return `${value}.${Array(3).join("0")}`;
81987
+ return `${value2}.${Array(3).join("0")}`;
81829
81988
  }
81830
- return `${value}.${Array(4).join("0")}%`;
81989
+ return `${value2}.${Array(4).join("0")}%`;
81831
81990
  }
81832
81991
  case "ms1": {
81833
81992
  const seconds = Math.floor(val / 1e3);
@@ -81887,15 +82046,23 @@ const SingleValueChart = ({
81887
82046
  return val;
81888
82047
  }
81889
82048
  };
82049
+ 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
82050
  return /* @__PURE__ */ jsxs("div", {
81891
82051
  className: styles$x.container,
81892
82052
  children: [/* @__PURE__ */ jsx("div", {
81893
82053
  style: valueFont,
82054
+ onClick: () => {
82055
+ handleChartClick(chartClickConfig, value || "");
82056
+ },
82057
+ className: hover,
81894
82058
  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)
82059
+ children: value
81896
82060
  })
81897
82061
  }), /* @__PURE__ */ jsx("div", {
81898
82062
  style: subHeaderFont,
82063
+ onClick: () => {
82064
+ handleChartClick(chartClickConfig, customSettings.displayText || "");
82065
+ },
81899
82066
  children: customSettings.subHeaderShow && customSettings.displayText
81900
82067
  })]
81901
82068
  });
@@ -81907,7 +82074,8 @@ const BoxPlot = ({
81907
82074
  axisSettings,
81908
82075
  enableSaveAs,
81909
82076
  colors: colors2,
81910
- customSettings
82077
+ customSettings,
82078
+ chartClickConfig
81911
82079
  }) => {
81912
82080
  var _a2;
81913
82081
  const modifiedData = [];
@@ -82026,22 +82194,28 @@ const BoxPlot = ({
82026
82194
  width: "100%",
82027
82195
  height: "90%"
82028
82196
  },
82029
- option: option2
82197
+ option: option2,
82198
+ onEvents: {
82199
+ click: (params) => {
82200
+ var _a3;
82201
+ handleChartClick(chartClickConfig, ((_a3 = params == null ? void 0 : params.name) == null ? void 0 : _a3.split(" ").join("_")) || "undefined");
82202
+ }
82203
+ }
82030
82204
  })
82031
82205
  });
82032
82206
  };
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";
82207
+ const tableSection = "_tableSection_rwcfo_1";
82208
+ const tableContainer = "_tableContainer_rwcfo_5";
82209
+ const tableDiv = "_tableDiv_rwcfo_9";
82210
+ const table$4 = "_table_rwcfo_1";
82211
+ const tableHead$1 = "_tableHead_rwcfo_17";
82212
+ const tableHeadColHash = "_tableHeadColHash_rwcfo_21";
82213
+ const tableCol = "_tableCol_rwcfo_25";
82214
+ const tableColLabel = "_tableColLabel_rwcfo_29";
82215
+ const data = "_data_rwcfo_33";
82216
+ const tableBodyColHash = "_tableBodyColHash_rwcfo_37";
82217
+ const tableBodyColHashLabel = "_tableBodyColHashLabel_rwcfo_41";
82218
+ const noData$1 = "_noData_rwcfo_53";
82045
82219
  var style$1 = {
82046
82220
  tableSection,
82047
82221
  tableContainer,
@@ -82054,8 +82228,8 @@ var style$1 = {
82054
82228
  data,
82055
82229
  tableBodyColHash,
82056
82230
  tableBodyColHashLabel,
82057
- "table-loader-container": "_table-loader-container_20k3k_45",
82058
- "table-error-message": "_table-error-message_20k3k_49",
82231
+ "table-loader-container": "_table-loader-container_rwcfo_45",
82232
+ "table-error-message": "_table-error-message_rwcfo_49",
82059
82233
  noData: noData$1
82060
82234
  };
82061
82235
  var classnames = { exports: {} };
@@ -82147,8 +82321,42 @@ const Text = ({
82147
82321
  children: children2
82148
82322
  });
82149
82323
  };
82324
+ var styles$v = {
82325
+ "btn-primary": "_btn-primary_1h5ze_1",
82326
+ "btn-secondary": "_btn-secondary_1h5ze_5",
82327
+ "btn-reject": "_btn-reject_1h5ze_9",
82328
+ "btn-outlined": "_btn-outlined_1h5ze_14",
82329
+ "btn-tertiary": "_btn-tertiary_1h5ze_18",
82330
+ "btn-default": "_btn-default_1h5ze_22",
82331
+ "btn-large": "_btn-large_1h5ze_25",
82332
+ "btn-small": "_btn-small_1h5ze_28",
82333
+ "btn-xs": "_btn-xs_1h5ze_31",
82334
+ "btn-medium": "_btn-medium_1h5ze_34",
82335
+ "btn-11rem": "_btn-11rem_1h5ze_38"
82336
+ };
82337
+ const Button = ({
82338
+ isDisabled = false,
82339
+ type: type3 = "button",
82340
+ className,
82341
+ children: children2 = "",
82342
+ variant = "primary",
82343
+ size = "none",
82344
+ onClick,
82345
+ title: title2
82346
+ }) => {
82347
+ const btnClasses = classNames(className, styles$v[`btn-${variant}`], size === "none" ? null : styles$v[`btn-${size}`]);
82348
+ return /* @__PURE__ */ jsx("button", {
82349
+ type: type3,
82350
+ className: variant === "custom" ? className : btnClasses,
82351
+ onClick,
82352
+ disabled: isDisabled,
82353
+ title: title2,
82354
+ children: children2
82355
+ });
82356
+ };
82150
82357
  const TableChart = ({
82151
- data: data2
82358
+ data: data2,
82359
+ chartClickConfig
82152
82360
  }) => {
82153
82361
  var _a2, _b2, _c2;
82154
82362
  let k = 0;
@@ -82212,11 +82420,13 @@ const TableChart = ({
82212
82420
  return /* @__PURE__ */ jsx(Fragment, {
82213
82421
  children: /* @__PURE__ */ jsx("td", {
82214
82422
  className: style$1.tableCol,
82215
- children: /* @__PURE__ */ jsx(Text, {
82216
- styleClass: "font-14",
82217
- variant: "p",
82423
+ children: /* @__PURE__ */ jsx(Button, {
82424
+ variant: "custom",
82425
+ type: "button",
82218
82426
  className: style$1.tableColLabel,
82219
- children: d2
82427
+ isDisabled: !chartClickConfig.isEnable,
82428
+ onClick: () => handleChartClick(chartClickConfig, JSON.stringify(d2)),
82429
+ children: JSON.stringify(d2)
82220
82430
  })
82221
82431
  }, d2 + index2)
82222
82432
  });
@@ -82245,7 +82455,8 @@ const MetricChart = ({
82245
82455
  colors: colors2,
82246
82456
  updateGroup,
82247
82457
  isEnableGroupBy,
82248
- backGroundColor
82458
+ backGroundColor,
82459
+ chartClickConfig
82249
82460
  }) => {
82250
82461
  var _a2, _b2, _c2, _d;
82251
82462
  if (chartType2 === CHART_TYPES.line) {
@@ -82258,7 +82469,8 @@ const MetricChart = ({
82258
82469
  customSettings,
82259
82470
  enableSaveAs,
82260
82471
  updateGroup,
82261
- isEnableGroupBy
82472
+ isEnableGroupBy,
82473
+ chartClickConfig
82262
82474
  });
82263
82475
  }
82264
82476
  if (chartType2 === CHART_TYPES.stepped) {
@@ -82274,7 +82486,8 @@ const MetricChart = ({
82274
82486
  colors: colors2,
82275
82487
  updateGroup,
82276
82488
  isEnableGroupBy,
82277
- backGroundColor
82489
+ backGroundColor,
82490
+ chartClickConfig
82278
82491
  });
82279
82492
  }
82280
82493
  if (chartType2 === CHART_TYPES.bar) {
@@ -82288,7 +82501,8 @@ const MetricChart = ({
82288
82501
  labelSettings,
82289
82502
  axisSettings,
82290
82503
  customSettings,
82291
- margins
82504
+ margins,
82505
+ chartClickConfig
82292
82506
  });
82293
82507
  }
82294
82508
  if (chartType2 === CHART_TYPES.stack) {
@@ -82303,7 +82517,8 @@ const MetricChart = ({
82303
82517
  updateGroup,
82304
82518
  isEnableGroupBy,
82305
82519
  backGroundColor,
82306
- customSettings
82520
+ customSettings,
82521
+ chartClickConfig
82307
82522
  });
82308
82523
  }
82309
82524
  if (chartType2 === CHART_TYPES.histogram) {
@@ -82318,7 +82533,8 @@ const MetricChart = ({
82318
82533
  updateGroup,
82319
82534
  isEnableGroupBy,
82320
82535
  backGroundColor,
82321
- customSettings
82536
+ customSettings,
82537
+ chartClickConfig
82322
82538
  });
82323
82539
  }
82324
82540
  if (chartType2 === CHART_TYPES.bubble) {
@@ -82333,7 +82549,8 @@ const MetricChart = ({
82333
82549
  updateGroup,
82334
82550
  isEnableGroupBy,
82335
82551
  backGroundColor,
82336
- customSettings
82552
+ customSettings,
82553
+ chartClickConfig
82337
82554
  });
82338
82555
  }
82339
82556
  if (chartType2 === CHART_TYPES.scatter) {
@@ -82348,7 +82565,8 @@ const MetricChart = ({
82348
82565
  updateGroup,
82349
82566
  isEnableGroupBy,
82350
82567
  backGroundColor,
82351
- customSettings
82568
+ customSettings,
82569
+ chartClickConfig
82352
82570
  });
82353
82571
  }
82354
82572
  if (chartType2 === CHART_TYPES.row) {
@@ -82362,7 +82580,8 @@ const MetricChart = ({
82362
82580
  updateGroup,
82363
82581
  isEnableGroupBy,
82364
82582
  backGroundColor,
82365
- customSettings
82583
+ customSettings,
82584
+ chartClickConfig
82366
82585
  });
82367
82586
  }
82368
82587
  if (chartType2 === CHART_TYPES.area) {
@@ -82380,7 +82599,8 @@ const MetricChart = ({
82380
82599
  updateGroup,
82381
82600
  isEnableGroupBy,
82382
82601
  backGroundColor,
82383
- customSettings
82602
+ customSettings,
82603
+ chartClickConfig
82384
82604
  });
82385
82605
  }
82386
82606
  if (chartType2 === CHART_TYPES.combo) {
@@ -82400,7 +82620,8 @@ const MetricChart = ({
82400
82620
  updateGroup,
82401
82621
  isEnableGroupBy,
82402
82622
  backGroundColor,
82403
- customSettings
82623
+ customSettings,
82624
+ chartClickConfig
82404
82625
  });
82405
82626
  }
82406
82627
  if (chartType2 === CHART_TYPES.pie) {
@@ -82412,7 +82633,8 @@ const MetricChart = ({
82412
82633
  enableSaveAs,
82413
82634
  colors: colors2,
82414
82635
  updateGroup,
82415
- isEnableGroupBy
82636
+ isEnableGroupBy,
82637
+ chartClickConfig
82416
82638
  });
82417
82639
  }
82418
82640
  if (chartType2 === CHART_TYPES.doughnut) {
@@ -82424,7 +82646,8 @@ const MetricChart = ({
82424
82646
  enableSaveAs,
82425
82647
  colors: colors2,
82426
82648
  updateGroup,
82427
- isEnableGroupBy
82649
+ isEnableGroupBy,
82650
+ chartClickConfig
82428
82651
  });
82429
82652
  }
82430
82653
  if (chartType2 === CHART_TYPES.waterfall) {
@@ -82453,7 +82676,8 @@ const MetricChart = ({
82453
82676
  updateGroup,
82454
82677
  isEnableGroupBy,
82455
82678
  backGroundColor,
82456
- customSettings
82679
+ customSettings,
82680
+ chartClickConfig
82457
82681
  });
82458
82682
  }
82459
82683
  if (chartType2 === CHART_TYPES.funnel) {
@@ -82462,7 +82686,8 @@ const MetricChart = ({
82462
82686
  margins,
82463
82687
  legendSettings,
82464
82688
  labelSettings,
82465
- colors: colors2
82689
+ colors: colors2,
82690
+ chartClickConfig
82466
82691
  });
82467
82692
  }
82468
82693
  if (chartType2 === CHART_TYPES.gauge) {
@@ -82472,7 +82697,8 @@ const MetricChart = ({
82472
82697
  legendSettings,
82473
82698
  labelSettings,
82474
82699
  enableSaveAs,
82475
- colors: colors2
82700
+ colors: colors2,
82701
+ chartClickConfig
82476
82702
  });
82477
82703
  }
82478
82704
  if (chartType2 === CHART_TYPES.sankey) {
@@ -82483,7 +82709,8 @@ const MetricChart = ({
82483
82709
  labelSettings,
82484
82710
  enableSaveAs,
82485
82711
  colors: colors2,
82486
- backGroundColor
82712
+ backGroundColor,
82713
+ chartClickConfig
82487
82714
  });
82488
82715
  }
82489
82716
  if (chartType2 === CHART_TYPES.singleValue) {
@@ -82491,7 +82718,8 @@ const MetricChart = ({
82491
82718
  data: singleValueData2,
82492
82719
  margins,
82493
82720
  labelSettings,
82494
- customSettings
82721
+ customSettings,
82722
+ chartClickConfig
82495
82723
  });
82496
82724
  }
82497
82725
  if (chartType2 === CHART_TYPES.boxplot) {
@@ -82503,7 +82731,8 @@ const MetricChart = ({
82503
82731
  axisSettings,
82504
82732
  enableSaveAs,
82505
82733
  colors: colors2,
82506
- customSettings
82734
+ customSettings,
82735
+ chartClickConfig
82507
82736
  });
82508
82737
  }
82509
82738
  if (chartType2 === CHART_TYPES.table) {
@@ -82511,7 +82740,8 @@ const MetricChart = ({
82511
82740
  data: data2,
82512
82741
  margins,
82513
82742
  legendSettings,
82514
- labelSettings
82743
+ labelSettings,
82744
+ chartClickConfig
82515
82745
  });
82516
82746
  }
82517
82747
  return /* @__PURE__ */ jsx("div", {
@@ -82519,39 +82749,6 @@ const MetricChart = ({
82519
82749
  children: "No chart selected"
82520
82750
  });
82521
82751
  };
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
82752
  const mdiDotsVertical = (props) => /* @__PURE__ */ jsx("svg", {
82556
82753
  viewBox: "0 0 24 24",
82557
82754
  width: "1.2em",
@@ -86457,6 +86654,22 @@ const MetricCard = ({
86457
86654
  const [singleValue2, setSingleValue] = useState("");
86458
86655
  const [dataDb, setData] = useState([]);
86459
86656
  const [rlsConditions, setRlsConditions] = useState([]);
86657
+ const [clickBehaviourConfigs, setClickBehaviourConfigs] = useState({
86658
+ card: {
86659
+ isEnable: false,
86660
+ baseUrl: "",
86661
+ dynamic: "none",
86662
+ route: "",
86663
+ routeType: "internal"
86664
+ },
86665
+ chart: {
86666
+ isEnable: false,
86667
+ baseUrl: "",
86668
+ dynamic: "{{value}}",
86669
+ route: "/{{value}}",
86670
+ routeType: "internal"
86671
+ }
86672
+ });
86460
86673
  const {
86461
86674
  data: metricdata,
86462
86675
  isLoading: isQueryLoading
@@ -86547,6 +86760,22 @@ const MetricCard = ({
86547
86760
  setSelectedGroupBy(metricItem == null ? void 0 : metricItem.selectedGroupBy);
86548
86761
  setGroupBy(metricItem == null ? void 0 : metricItem.groupBy);
86549
86762
  setRlsConditions((metricItem == null ? void 0 : metricItem.rlsConditions) || []);
86763
+ setClickBehaviourConfigs(metricItem.clickActions || {
86764
+ card: {
86765
+ isEnable: false,
86766
+ baseUrl: "",
86767
+ dynamic: "none",
86768
+ route: "",
86769
+ routeType: "internal"
86770
+ },
86771
+ chart: {
86772
+ isEnable: false,
86773
+ baseUrl: "",
86774
+ dynamic: "{{value}}",
86775
+ route: "/{{value}}",
86776
+ routeType: "internal"
86777
+ }
86778
+ });
86550
86779
  }, [metricItem]);
86551
86780
  useEffect(() => {
86552
86781
  setData(queryData != null ? queryData : []);
@@ -86628,7 +86857,14 @@ const MetricCard = ({
86628
86857
  variant: "h3",
86629
86858
  styleClass: "primary",
86630
86859
  className: styles$z.metricName,
86631
- children: [renderHeaderName ? renderHeaderName(metricItem.name) : metricItem.name, metricItem.description && /* @__PURE__ */ jsx("span", {
86860
+ children: [renderHeaderName ? renderHeaderName(metricItem.name) : /* @__PURE__ */ jsx(Button, {
86861
+ type: "button",
86862
+ variant: "custom",
86863
+ isDisabled: !clickBehaviourConfigs.card.isEnable,
86864
+ className: "disabled:cursor-text",
86865
+ onClick: () => handleCardClick(clickBehaviourConfigs, metricItem.metricId, metricItem.id),
86866
+ children: metricItem.name
86867
+ }), metricItem.description && /* @__PURE__ */ jsx("span", {
86632
86868
  className: styles$z.metricDescription,
86633
86869
  children: metricItem.description
86634
86870
  })]
@@ -86668,7 +86904,8 @@ const MetricCard = ({
86668
86904
  axisSettings,
86669
86905
  customSettings,
86670
86906
  backGroundColor,
86671
- enableSaveAs: true
86907
+ enableSaveAs: true,
86908
+ chartClickConfig: clickBehaviourConfigs.chart
86672
86909
  }),
86673
86910
  children: [/* @__PURE__ */ jsx(ggMinimize, {}), " Enter Fullscreen"]
86674
86911
  }), /* @__PURE__ */ jsx(CsvDownloadButton, {
@@ -86723,7 +86960,8 @@ const MetricCard = ({
86723
86960
  updateGroup,
86724
86961
  isEnableGroupBy,
86725
86962
  customSettings,
86726
- backGroundColor
86963
+ backGroundColor,
86964
+ chartClickConfig: clickBehaviourConfigs.chart
86727
86965
  }) : null]
86728
86966
  })]
86729
86967
  })
@@ -86752,6 +86990,22 @@ const SingleValueCard = ({
86752
86990
  const [singleValue2, setSingleValue] = useState("");
86753
86991
  const [dataDb, setData] = useState([]);
86754
86992
  const [rlsConditions, setRlsConditions] = useState([]);
86993
+ const [clickBehaviourConfigs, setClickBehaviourConfigs] = useState({
86994
+ card: {
86995
+ isEnable: false,
86996
+ baseUrl: "",
86997
+ dynamic: "none",
86998
+ route: "",
86999
+ routeType: "internal"
87000
+ },
87001
+ chart: {
87002
+ isEnable: false,
87003
+ baseUrl: "",
87004
+ dynamic: "{{value}}",
87005
+ route: "/{{value}}",
87006
+ routeType: "internal"
87007
+ }
87008
+ });
86755
87009
  const [customSettings, setCustomSettings] = useState({
86756
87010
  hideSplitLines: "none",
86757
87011
  hideAxisLines: "none",
@@ -86800,6 +87054,22 @@ const SingleValueCard = ({
86800
87054
  dateFormatter: "none",
86801
87055
  numberFormatter: "original"
86802
87056
  });
87057
+ setClickBehaviourConfigs(metricItem.clickActions || {
87058
+ card: {
87059
+ isEnable: false,
87060
+ baseUrl: "",
87061
+ dynamic: "none",
87062
+ route: "",
87063
+ routeType: "internal"
87064
+ },
87065
+ chart: {
87066
+ isEnable: false,
87067
+ baseUrl: "",
87068
+ dynamic: "{{value}}",
87069
+ route: "/{{value}}",
87070
+ routeType: "internal"
87071
+ }
87072
+ });
86803
87073
  }, [metricItem]);
86804
87074
  useEffect(() => {
86805
87075
  setData(queryData != null ? queryData : []);
@@ -86822,7 +87092,14 @@ const SingleValueCard = ({
86822
87092
  variant: "h3",
86823
87093
  styleClass: "primary",
86824
87094
  className: styles$z.metricName,
86825
- children: [renderHeaderName ? renderHeaderName(metricItem.name) : metricItem.name, metricItem.description && /* @__PURE__ */ jsx("span", {
87095
+ children: [renderHeaderName ? renderHeaderName(metricItem.name) : /* @__PURE__ */ jsx(Button, {
87096
+ type: "button",
87097
+ variant: "custom",
87098
+ isDisabled: !clickBehaviourConfigs.card.isEnable,
87099
+ className: "disabled:cursor-text",
87100
+ onClick: () => handleCardClick(clickBehaviourConfigs, metricItem.metricId, metricItem.id),
87101
+ children: metricItem.name
87102
+ }), metricItem.description && /* @__PURE__ */ jsx("span", {
86826
87103
  className: styles$z.metricDescription,
86827
87104
  children: metricItem.description
86828
87105
  })]
@@ -86848,7 +87125,8 @@ const SingleValueCard = ({
86848
87125
  }) : /* @__PURE__ */ jsx(Fragment, {
86849
87126
  children: singleValueData2.length ? /* @__PURE__ */ jsx(SingleValueChart, {
86850
87127
  data: chartData,
86851
- customSettings
87128
+ customSettings,
87129
+ chartClickConfig: clickBehaviourConfigs.chart
86852
87130
  }) : /* @__PURE__ */ jsx("div", {
86853
87131
  className: styles$z.noData,
86854
87132
  children: /* @__PURE__ */ jsxs("div", {
@@ -86975,7 +87253,14 @@ const FullScreenChart = ({
86975
87253
  axisSettings: chart.axisSettings,
86976
87254
  backGroundColor: chart.backGroundColor,
86977
87255
  enableSaveAs: true,
86978
- customSettings: chart.customSettings
87256
+ customSettings: chart.customSettings,
87257
+ chartClickConfig: {
87258
+ isEnable: false,
87259
+ baseUrl: "",
87260
+ dynamic: "{{value}}",
87261
+ route: "/{{value}}",
87262
+ routeType: "internal"
87263
+ }
86979
87264
  })
86980
87265
  })
86981
87266
  });
@@ -87350,23 +87635,23 @@ const Dataset = ({
87350
87635
  })]
87351
87636
  });
87352
87637
  };
87353
- const container$a = "_container_3ro5s_1";
87354
- const header$2 = "_header_3ro5s_7";
87355
- const headerText = "_headerText_3ro5s_13";
87356
- const tab$2 = "_tab_3ro5s_19";
87357
- const tabText$1 = "_tabText_3ro5s_25";
87358
- const tabHeading = "_tabHeading_3ro5s_31";
87359
- const form$3 = "_form_3ro5s_37";
87360
- const inputWrapper = "_inputWrapper_3ro5s_43";
87361
- const input = "_input_3ro5s_43";
87362
- const selectWrapper = "_selectWrapper_3ro5s_55";
87363
- const select = "_select_3ro5s_55";
87364
- const label$2 = "_label_3ro5s_67";
87365
- const series = "_series_3ro5s_73";
87366
- const legendWrapper = "_legendWrapper_3ro5s_79";
87367
- const seriesWrapper = "_seriesWrapper_3ro5s_85";
87368
- const valueLabelWrapper = "_valueLabelWrapper_3ro5s_91";
87369
- const singleCheckBox = "_singleCheckBox_3ro5s_97";
87638
+ const container$a = "_container_1cslw_1";
87639
+ const header$2 = "_header_1cslw_7";
87640
+ const headerText = "_headerText_1cslw_13";
87641
+ const tab$2 = "_tab_1cslw_19";
87642
+ const tabText$1 = "_tabText_1cslw_25";
87643
+ const tabHeading = "_tabHeading_1cslw_31";
87644
+ const form$3 = "_form_1cslw_37";
87645
+ const inputWrapper = "_inputWrapper_1cslw_43";
87646
+ const input = "_input_1cslw_43";
87647
+ const selectWrapper = "_selectWrapper_1cslw_55";
87648
+ const select = "_select_1cslw_55";
87649
+ const label$2 = "_label_1cslw_67";
87650
+ const series = "_series_1cslw_73";
87651
+ const legendWrapper = "_legendWrapper_1cslw_79";
87652
+ const seriesWrapper = "_seriesWrapper_1cslw_85";
87653
+ const valueLabelWrapper = "_valueLabelWrapper_1cslw_91";
87654
+ const singleCheckBox = "_singleCheckBox_1cslw_97";
87370
87655
  var styles$i = {
87371
87656
  container: container$a,
87372
87657
  header: header$2,
@@ -87487,12 +87772,15 @@ const ChartConfigure = ({
87487
87772
  const [activeTab2, setActiveTab] = useState("Margins");
87488
87773
  return /* @__PURE__ */ jsxs("div", {
87489
87774
  className: styles$i.container,
87490
- children: [/* @__PURE__ */ jsx(Tab, {
87491
- options: chartType2 !== "single value" ? TabList : singleValueTabs,
87492
- activeTab: activeTab2,
87493
- setActiveTab,
87494
- className: styles$i.tab,
87495
- tabText: styles$i.tabText
87775
+ children: [/* @__PURE__ */ jsx("div", {
87776
+ className: "h-[10%]",
87777
+ children: /* @__PURE__ */ jsx(Tab, {
87778
+ options: chartType2 !== "single value" ? TabList : singleValueTabs,
87779
+ activeTab: activeTab2,
87780
+ setActiveTab,
87781
+ className: styles$i.tab,
87782
+ tabText: styles$i.tabText
87783
+ })
87496
87784
  }), /* @__PURE__ */ jsxs("form", {
87497
87785
  className: styles$i.form,
87498
87786
  children: [activeTab2 === "Margins" && /* @__PURE__ */ jsxs("div", {
@@ -88028,22 +88316,22 @@ const ChartConfigure = ({
88028
88316
  })]
88029
88317
  });
88030
88318
  };
88031
- const chartButtonContainer$1 = "_chartButtonContainer_6600c_17";
88032
- const tabContainer = "_tabContainer_6600c_25";
88033
- const tab = "_tab_6600c_25";
88034
- const tabText = "_tabText_6600c_41";
88035
- const chartButtons$1 = "_chartButtons_6600c_49";
88036
- const chartButton$1 = "_chartButton_6600c_1";
88037
- const chartButtonSelected = "_chartButtonSelected_6600c_65";
88038
- const chartTypesButton = "_chartTypesButton_6600c_73";
88039
- const button$2 = "_button_6600c_81";
88040
- const propertyButton = "_propertyButton_6600c_89";
88041
- const settings = "_settings_6600c_9";
88042
- const crossIcon = "_crossIcon_6600c_105";
88319
+ const chartButtonContainer$1 = "_chartButtonContainer_mrrhu_1";
88320
+ const tabContainer = "_tabContainer_mrrhu_23";
88321
+ const tab = "_tab_mrrhu_23";
88322
+ const tabText = "_tabText_mrrhu_39";
88323
+ const chartButtons$1 = "_chartButtons_mrrhu_47";
88324
+ const chartButton$1 = "_chartButton_mrrhu_1";
88325
+ const chartButtonSelected = "_chartButtonSelected_mrrhu_63";
88326
+ const chartTypesButton = "_chartTypesButton_mrrhu_71";
88327
+ const button$2 = "_button_mrrhu_79";
88328
+ const propertyButton = "_propertyButton_mrrhu_87";
88329
+ const settings = "_settings_mrrhu_15";
88330
+ const crossIcon = "_crossIcon_mrrhu_103";
88043
88331
  var styles$f = {
88044
- "chartButton-header": "_chartButton-header_6600c_1",
88045
- "settingsTab-header-control": "_settingsTab-header-control_6600c_9",
88046
88332
  chartButtonContainer: chartButtonContainer$1,
88333
+ "chartButton-header": "_chartButton-header_mrrhu_7",
88334
+ "settingsTab-header-control": "_settingsTab-header-control_mrrhu_15",
88047
88335
  tabContainer,
88048
88336
  tab,
88049
88337
  tabText,
@@ -88070,20 +88358,20 @@ const SelectField = ({
88070
88358
  name: yAxisValue ? yAxisValue : value
88071
88359
  });
88072
88360
  };
88073
- const chartOptions = "_chartOptions_jdb8o_1";
88074
- const chartOption = "_chartOption_jdb8o_1";
88075
- const chartOptionBtn = "_chartOptionBtn_jdb8o_13";
88076
- const chartOptionText = "_chartOptionText_jdb8o_19";
88077
- const container$8 = "_container_jdb8o_25";
88078
- const field$1 = "_field_jdb8o_31";
88079
- const fieldText = "_fieldText_jdb8o_37";
88080
- const doneBtn = "_doneBtn_jdb8o_43";
88081
- const measureText = "_measureText_jdb8o_49";
88082
- const singleValueMeasure = "_singleValueMeasure_jdb8o_55";
88083
- const plus = "_plus_jdb8o_61";
88084
- const plusIcon = "_plusIcon_jdb8o_67";
88085
- const form$2 = "_form_jdb8o_73";
88086
- const chartType = "_chartType_jdb8o_79";
88361
+ const chartOptions = "_chartOptions_yt3j5_1";
88362
+ const chartOption = "_chartOption_yt3j5_1";
88363
+ const chartOptionBtn = "_chartOptionBtn_yt3j5_13";
88364
+ const chartOptionText = "_chartOptionText_yt3j5_19";
88365
+ const container$8 = "_container_yt3j5_25";
88366
+ const field$1 = "_field_yt3j5_31";
88367
+ const fieldText = "_fieldText_yt3j5_37";
88368
+ const doneBtn = "_doneBtn_yt3j5_43";
88369
+ const measureText = "_measureText_yt3j5_49";
88370
+ const singleValueMeasure = "_singleValueMeasure_yt3j5_55";
88371
+ const plus = "_plus_yt3j5_61";
88372
+ const plusIcon = "_plusIcon_yt3j5_67";
88373
+ const form$2 = "_form_yt3j5_73";
88374
+ const chartType = "_chartType_yt3j5_79";
88087
88375
  var styles$e = {
88088
88376
  chartOptions,
88089
88377
  chartOption,
@@ -88838,35 +89126,35 @@ const ChartSettings = ({
88838
89126
  })]
88839
89127
  });
88840
89128
  };
88841
- const searchCommand$1 = "_searchCommand_1jfcs_9";
88842
- const chartText = "_chartText_1jfcs_25";
88843
- const charts = "_charts_1jfcs_33";
88844
- const metricChart = "_metricChart_1jfcs_41";
88845
- const metricChartEmpty = "_metricChartEmpty_1jfcs_49";
88846
- const fullQuery = "_fullQuery_1jfcs_73";
88847
- const noQuery = "_noQuery_1jfcs_81";
88848
- const chartButtonContainer = "_chartButtonContainer_1jfcs_105";
88849
- const searchWrapper = "_searchWrapper_1jfcs_113";
88850
- const searchIcon = "_searchIcon_1jfcs_121";
88851
- const chartConfigure = "_chartConfigure_1jfcs_129";
88852
- const chartSettings = "_chartSettings_1jfcs_137";
88853
- const labels = "_labels_1jfcs_145";
88854
- const chartButtons = "_chartButtons_1jfcs_153";
88855
- const chartButton = "_chartButton_1jfcs_97";
89129
+ const searchCommand$1 = "_searchCommand_x33uc_9";
89130
+ const chartText = "_chartText_x33uc_25";
89131
+ const charts = "_charts_x33uc_33";
89132
+ const metricChart = "_metricChart_x33uc_41";
89133
+ const metricChartEmpty = "_metricChartEmpty_x33uc_49";
89134
+ const fullQuery = "_fullQuery_x33uc_73";
89135
+ const noQuery = "_noQuery_x33uc_81";
89136
+ const chartButtonContainer = "_chartButtonContainer_x33uc_105";
89137
+ const searchWrapper = "_searchWrapper_x33uc_113";
89138
+ const searchIcon = "_searchIcon_x33uc_121";
89139
+ const chartConfigure = "_chartConfigure_x33uc_129";
89140
+ const chartSettings = "_chartSettings_x33uc_137";
89141
+ const labels = "_labels_x33uc_145";
89142
+ const chartButtons = "_chartButtons_x33uc_153";
89143
+ const chartButton = "_chartButton_x33uc_97";
88856
89144
  var styles$d = {
88857
- "outputTab-header": "_outputTab-header_1jfcs_1",
89145
+ "outputTab-header": "_outputTab-header_x33uc_1",
88858
89146
  searchCommand: searchCommand$1,
88859
- "chartTab-container": "_chartTab-container_1jfcs_17",
89147
+ "chartTab-container": "_chartTab-container_x33uc_17",
88860
89148
  chartText,
88861
89149
  charts,
88862
89150
  metricChart,
88863
89151
  metricChartEmpty,
88864
- "chartTab-wrapper": "_chartTab-wrapper_1jfcs_57",
88865
- "chartTab-wrapper-head": "_chartTab-wrapper-head_1jfcs_65",
89152
+ "chartTab-wrapper": "_chartTab-wrapper_x33uc_57",
89153
+ "chartTab-wrapper-head": "_chartTab-wrapper-head_x33uc_65",
88866
89154
  fullQuery,
88867
89155
  noQuery,
88868
- "tableTab-header": "_tableTab-header_1jfcs_89",
88869
- "chartButton-header": "_chartButton-header_1jfcs_97",
89156
+ "tableTab-header": "_tableTab-header_x33uc_89",
89157
+ "chartButton-header": "_chartButton-header_x33uc_97",
88870
89158
  chartButtonContainer,
88871
89159
  searchWrapper,
88872
89160
  searchIcon,
@@ -88971,11 +89259,14 @@ const ChartTab = ({
88971
89259
  })]
88972
89260
  }), !!(data2 == null ? void 0 : data2.length) && !isLoading && /* @__PURE__ */ jsxs("div", {
88973
89261
  className: styles$d.metricChart,
88974
- children: [/* @__PURE__ */ jsx(Text, {
88975
- styleClass: "primary",
88976
- variant: "p",
88977
- className: "",
88978
- children: "Preview"
89262
+ children: [/* @__PURE__ */ jsx("div", {
89263
+ className: "h-[10%]",
89264
+ children: /* @__PURE__ */ jsx(Text, {
89265
+ styleClass: "primary",
89266
+ variant: "p",
89267
+ className: "",
89268
+ children: "Preview"
89269
+ })
88979
89270
  }), /* @__PURE__ */ jsxs("div", {
88980
89271
  className: styles$d["chartTab-wrapper"],
88981
89272
  children: [/* @__PURE__ */ jsxs("div", {
@@ -89053,6 +89344,13 @@ const ChartTab = ({
89053
89344
  backGroundColor,
89054
89345
  updateGroup,
89055
89346
  isEnableGroupBy,
89347
+ chartClickConfig: {
89348
+ isEnable: false,
89349
+ baseUrl: "",
89350
+ dynamic: "{{value}}",
89351
+ route: "/{{value}}",
89352
+ routeType: "internal"
89353
+ },
89056
89354
  enableSaveAs: true
89057
89355
  })
89058
89356
  }) : /* @__PURE__ */ jsxs("div", {
@@ -89098,7 +89396,14 @@ const ChartTab = ({
89098
89396
  axisSettings,
89099
89397
  customSettings,
89100
89398
  backGroundColor,
89101
- enableSaveAs: true
89399
+ enableSaveAs: true,
89400
+ chartClickConfig: {
89401
+ isEnable: false,
89402
+ baseUrl: "",
89403
+ dynamic: "{{value}}",
89404
+ route: "/{{value}}",
89405
+ routeType: "internal"
89406
+ }
89102
89407
  }
89103
89408
  })]
89104
89409
  });