@sentio/ui-dashboard 0.2.6 → 0.2.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.mjs CHANGED
@@ -3667,6 +3667,252 @@ ${percent}%`;
3667
3667
  );
3668
3668
  PieChart2.displayName = "PieChart";
3669
3669
 
3670
+ // src/charts/BarGaugeChart.tsx
3671
+ import { forwardRef as forwardRef3, useEffect as useEffect7, useMemo as useMemo7, useState as useState9 } from "react";
3672
+ import { jsx as jsx23 } from "react/jsx-runtime";
3673
+ var compareOption = { numeric: true };
3674
+ var BarGaugeChart = forwardRef3(
3675
+ (props, ref) => {
3676
+ const {
3677
+ series: input,
3678
+ legend,
3679
+ valueFormatter,
3680
+ config,
3681
+ title,
3682
+ minHeight,
3683
+ loading,
3684
+ style,
3685
+ onInitChart
3686
+ } = props;
3687
+ const [series, setSeries] = useState9([]);
3688
+ const [xAxis, setXAxis] = useState9();
3689
+ const [yAxis, setYAxis] = useState9();
3690
+ const isVertical = config?.barGauge?.direction === "VERTICAL";
3691
+ useEffect7(() => {
3692
+ const tmpData = input.map((s) => {
3693
+ const d = s.data && s.data[0];
3694
+ return { name: s.name, value: d && d[1] };
3695
+ });
3696
+ const sort = config?.barGauge?.sort;
3697
+ switch (sort?.sortBy) {
3698
+ case "ByName":
3699
+ tmpData.sort(
3700
+ (a, b) => sort.orderDesc ? b.name.localeCompare(a.name, void 0, compareOption) : a.name.localeCompare(b.name, void 0, compareOption)
3701
+ );
3702
+ break;
3703
+ case "ByValue":
3704
+ tmpData.sort(
3705
+ (a, b) => sort.orderDesc ? b.value - a.value : a.value - b.value
3706
+ );
3707
+ break;
3708
+ }
3709
+ const series2 = [
3710
+ {
3711
+ type: "bar",
3712
+ data: tmpData.map((d) => d.value),
3713
+ label: {
3714
+ show: config?.valueConfig ? config.valueConfig.showValueLabel : false,
3715
+ position: config?.barGauge?.direction == "VERTICAL" ? "top" : "right",
3716
+ formatter: ({ value }) => valueFormatter(value)
3717
+ }
3718
+ }
3719
+ ];
3720
+ const seriesAxis = {
3721
+ type: "category",
3722
+ data: tmpData.map((s) => s.name),
3723
+ axisLabel: config?.barGauge?.direction == "VERTICAL" ? { interval: 0, rotate: 30 } : {}
3724
+ };
3725
+ if (config?.xAxis?.name) {
3726
+ seriesAxis.name = config?.xAxis?.name;
3727
+ seriesAxis.nameLocation = "middle";
3728
+ seriesAxis.nameGap = isVertical ? 45 : 60;
3729
+ }
3730
+ const valueAxis = {
3731
+ type: "value",
3732
+ axisLabel: (
3733
+ // show dates on value-axis label is weird
3734
+ config?.valueConfig?.valueFormatter == "DateFormatter" ? void 0 : { formatter: (v) => valueFormatter(v) }
3735
+ )
3736
+ };
3737
+ let xAxis2, yAxis2;
3738
+ switch (config?.barGauge?.direction) {
3739
+ case "VERTICAL":
3740
+ xAxis2 = seriesAxis;
3741
+ yAxis2 = valueAxis;
3742
+ break;
3743
+ case "HORIZONTAL":
3744
+ default:
3745
+ xAxis2 = valueAxis;
3746
+ yAxis2 = seriesAxis;
3747
+ }
3748
+ setSeries(series2);
3749
+ setXAxis(xAxis2);
3750
+ setYAxis(yAxis2);
3751
+ }, [
3752
+ input,
3753
+ config?.barGauge?.calculation,
3754
+ config?.barGauge?.sort,
3755
+ config?.valueConfig?.showValueLabel,
3756
+ config?.xAxis?.name,
3757
+ isVertical,
3758
+ valueFormatter
3759
+ ]);
3760
+ const dataZoom = useMemo7(() => {
3761
+ if (config?.barGauge?.direction == "HORIZONTAL") {
3762
+ return [
3763
+ {
3764
+ show: series[0]?.data.length > 15,
3765
+ type: "slider",
3766
+ yAxisIndex: 0,
3767
+ zoomLock: true,
3768
+ width: 8,
3769
+ right: 10,
3770
+ top: 5,
3771
+ bottom: 30,
3772
+ minValueSpan: 5,
3773
+ maxValueSpan: 15,
3774
+ orient: "vertical",
3775
+ handleSize: 0,
3776
+ showDetail: false,
3777
+ brushSelect: false,
3778
+ showDataShadow: false
3779
+ },
3780
+ {
3781
+ type: "inside",
3782
+ id: "insideY",
3783
+ yAxisIndex: 0,
3784
+ zoomOnMouseWheel: false,
3785
+ moveOnMouseMove: true,
3786
+ moveOnMouseWheel: true
3787
+ }
3788
+ ];
3789
+ } else {
3790
+ return [
3791
+ {
3792
+ show: series[0]?.data.length > 25,
3793
+ type: "slider",
3794
+ xAxisIndex: 0,
3795
+ zoomLock: true,
3796
+ height: 8,
3797
+ bottom: 5,
3798
+ maxValueSpan: 25,
3799
+ minValueSpan: 10,
3800
+ handleSize: "0",
3801
+ showDetail: false,
3802
+ orient: "horizontal",
3803
+ brushSelect: false,
3804
+ showDataShadow: false
3805
+ },
3806
+ {
3807
+ type: "inside",
3808
+ id: "insideX",
3809
+ xAxisIndex: 0,
3810
+ zoomOnMouseWheel: false,
3811
+ moveOnMouseMove: true,
3812
+ moveOnMouseWheel: true
3813
+ }
3814
+ ];
3815
+ }
3816
+ }, [config, series]);
3817
+ const options = {
3818
+ title: { text: title },
3819
+ grid: {
3820
+ top: title ? 48 : 16,
3821
+ right: 40,
3822
+ bottom: isVertical && config?.xAxis?.name ? 40 : 16,
3823
+ left: !isVertical && config?.xAxis?.name ? 40 : 16,
3824
+ containLabel: true
3825
+ },
3826
+ xAxis,
3827
+ legend: { data: legend, top: -1e4, left: -1e4 },
3828
+ toolbox: { show: false },
3829
+ yAxis,
3830
+ dataZoom,
3831
+ animation: false,
3832
+ series,
3833
+ tooltip: {
3834
+ trigger: "axis",
3835
+ confine: true,
3836
+ extraCssText: "max-width: 50%; max-height: 50vh; overflow-y: auto;"
3837
+ }
3838
+ };
3839
+ return /* @__PURE__ */ jsx23("div", { className: "h-full w-full", children: /* @__PURE__ */ jsx23(
3840
+ ReactEChartsBase,
3841
+ {
3842
+ ref,
3843
+ loading,
3844
+ option: options,
3845
+ minHeight,
3846
+ style,
3847
+ noLegend: true,
3848
+ onInitChart
3849
+ }
3850
+ ) });
3851
+ }
3852
+ );
3853
+ BarGaugeChart.displayName = "BarGaugeChart";
3854
+
3855
+ // src/charts/QueryValueChart.tsx
3856
+ import { forwardRef as forwardRef4, useMemo as useMemo8 } from "react";
3857
+ import { useResizeDetector as useResizeDetector4 } from "react-resize-detector";
3858
+ import { jsx as jsx24 } from "react/jsx-runtime";
3859
+ var QueryValueChart = forwardRef4(
3860
+ (props, ref) => {
3861
+ const {
3862
+ series,
3863
+ valueText,
3864
+ textColor,
3865
+ backgroundColor,
3866
+ minHeight,
3867
+ loading,
3868
+ style,
3869
+ onInitChart
3870
+ } = props;
3871
+ const { width, height, ref: ref2 } = useResizeDetector4();
3872
+ const fontSize = useMemo8(() => {
3873
+ return Math.min(
3874
+ (width || 0) / String(valueText).length,
3875
+ (height || 0) / 1.5
3876
+ );
3877
+ }, [width, height, valueText]);
3878
+ const options = {
3879
+ backgroundColor,
3880
+ grid: { top: 0, right: 0, bottom: 0, left: 0 },
3881
+ toolbox: { show: false },
3882
+ animation: false,
3883
+ series,
3884
+ xAxis: { type: "time", show: false },
3885
+ yAxis: { type: "value", show: false },
3886
+ legend: { show: false },
3887
+ graphic: {
3888
+ type: "text",
3889
+ z: 100,
3890
+ left: "center",
3891
+ top: "middle",
3892
+ style: {
3893
+ text: valueText,
3894
+ fontSize,
3895
+ stroke: textColor,
3896
+ fill: textColor
3897
+ }
3898
+ }
3899
+ };
3900
+ return /* @__PURE__ */ jsx24("div", { className: "h-full w-full", children: /* @__PURE__ */ jsx24("div", { className: "h-full w-full", ref: ref2, children: /* @__PURE__ */ jsx24(
3901
+ ReactEChartsBase,
3902
+ {
3903
+ ref,
3904
+ loading,
3905
+ option: options,
3906
+ minHeight,
3907
+ style,
3908
+ noLegend: true,
3909
+ onInitChart
3910
+ }
3911
+ ) }) });
3912
+ }
3913
+ );
3914
+ QueryValueChart.displayName = "QueryValueChart";
3915
+
3670
3916
  // src/charts/options/LineControls.tsx
3671
3917
  import { produce as produce4 } from "immer";
3672
3918
  import {
@@ -3674,7 +3920,7 @@ import {
3674
3920
  NewButtonGroup as ButtonGroup2,
3675
3921
  Checkbox
3676
3922
  } from "@sentio/ui-core";
3677
- import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
3923
+ import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
3678
3924
  var lineStyles = [
3679
3925
  { label: "Solid", value: "Solid" },
3680
3926
  { label: "Dotted", value: "Dotted" }
@@ -3694,13 +3940,13 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
3694
3940
  })
3695
3941
  );
3696
3942
  };
3697
- return /* @__PURE__ */ jsx23(
3943
+ return /* @__PURE__ */ jsx25(
3698
3944
  DisclosurePanel,
3699
3945
  {
3700
3946
  title: "Line style",
3701
3947
  containerClassName: "w-full bg-default-bg",
3702
3948
  children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-4", children: [
3703
- /* @__PURE__ */ jsx23(
3949
+ /* @__PURE__ */ jsx25(
3704
3950
  ButtonGroup2,
3705
3951
  {
3706
3952
  buttons: lineStyles,
@@ -3709,7 +3955,7 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
3709
3955
  small: true
3710
3956
  }
3711
3957
  ),
3712
- /* @__PURE__ */ jsx23(
3958
+ /* @__PURE__ */ jsx25(
3713
3959
  Checkbox,
3714
3960
  {
3715
3961
  label: "Smooth Curves",
@@ -3723,16 +3969,16 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
3723
3969
  };
3724
3970
 
3725
3971
  // src/charts/options/LabelControls.tsx
3726
- import { useEffect as useEffect7, useMemo as useMemo7 } from "react";
3972
+ import { useEffect as useEffect8, useMemo as useMemo9 } from "react";
3727
3973
  import { produce as produce5 } from "immer";
3728
3974
  import { Button as NewButton2, DisclosurePanel as DisclosurePanel2, HelpIcon as HelpIcon2 } from "@sentio/ui-core";
3729
- import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
3975
+ import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
3730
3976
  var initialConfig = {
3731
3977
  columns: [],
3732
3978
  alias: ""
3733
3979
  };
3734
3980
  var LabelControls = ({ config, setConfig, defaultOpen }) => {
3735
- useEffect7(() => {
3981
+ useEffect8(() => {
3736
3982
  if (config?.columns && config.columns.length > 0 && !config.alias) {
3737
3983
  const aliasParts = [];
3738
3984
  config.columns.forEach((colConfig) => {
@@ -3762,13 +4008,13 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3762
4008
  })
3763
4009
  );
3764
4010
  };
3765
- const _defaultOpen = useMemo7(() => {
4011
+ const _defaultOpen = useMemo9(() => {
3766
4012
  if (defaultOpen) {
3767
4013
  return true;
3768
4014
  }
3769
4015
  return config?.alias !== "" || config?.columns && config.columns.length > 0;
3770
4016
  }, [config, defaultOpen]);
3771
- return /* @__PURE__ */ jsx24(
4017
+ return /* @__PURE__ */ jsx26(
3772
4018
  DisclosurePanel2,
3773
4019
  {
3774
4020
  title: "Label Controls",
@@ -3778,15 +4024,15 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3778
4024
  /* @__PURE__ */ jsxs17("div", { className: "inline-flex h-8", children: [
3779
4025
  /* @__PURE__ */ jsxs17("span", { className: "sm:text-icontent border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-2 font-medium", children: [
3780
4026
  "Label Alias",
3781
- /* @__PURE__ */ jsx24(
4027
+ /* @__PURE__ */ jsx26(
3782
4028
  HelpIcon2,
3783
4029
  {
3784
4030
  text: /* @__PURE__ */ jsxs17("div", { className: "text-icontent text-text-foreground", children: [
3785
- /* @__PURE__ */ jsx24("div", { children: "Series name override or template." }),
4031
+ /* @__PURE__ */ jsx26("div", { children: "Series name override or template." }),
3786
4032
  /* @__PURE__ */ jsxs17("div", { children: [
3787
4033
  "Ex.",
3788
4034
  " ",
3789
- /* @__PURE__ */ jsx24("span", { className: "text-primary mx-1 font-semibold italic", children: "{{contract}}" }),
4035
+ /* @__PURE__ */ jsx26("span", { className: "text-primary mx-1 font-semibold italic", children: "{{contract}}" }),
3790
4036
  " ",
3791
4037
  "will be replaced with the value of the contract label."
3792
4038
  ] })
@@ -3794,7 +4040,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3794
4040
  }
3795
4041
  )
3796
4042
  ] }),
3797
- /* @__PURE__ */ jsx24(
4043
+ /* @__PURE__ */ jsx26(
3798
4044
  "input",
3799
4045
  {
3800
4046
  type: "text",
@@ -3805,7 +4051,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3805
4051
  }
3806
4052
  )
3807
4053
  ] }),
3808
- /* @__PURE__ */ jsx24(
4054
+ /* @__PURE__ */ jsx26(
3809
4055
  NewButton2,
3810
4056
  {
3811
4057
  type: "button",
@@ -3829,7 +4075,7 @@ import {
3829
4075
  DisclosurePanel as DisclosurePanel3,
3830
4076
  NewButtonGroup as ButtonGroup3
3831
4077
  } from "@sentio/ui-core";
3832
- import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
4078
+ import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
3833
4079
  var defaultConfig = {
3834
4080
  pieType: "Pie",
3835
4081
  calculation: "LAST",
@@ -3864,14 +4110,14 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3864
4110
  })
3865
4111
  );
3866
4112
  }
3867
- return /* @__PURE__ */ jsx25(
4113
+ return /* @__PURE__ */ jsx27(
3868
4114
  DisclosurePanel3,
3869
4115
  {
3870
4116
  title: "Pie Chart Options",
3871
4117
  defaultOpen,
3872
4118
  containerClassName: "w-full bg-default-bg",
3873
4119
  children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-4", children: [
3874
- /* @__PURE__ */ jsx25("div", { className: "shadow-xs flex rounded-md", children: /* @__PURE__ */ jsx25(
4120
+ /* @__PURE__ */ jsx27("div", { className: "shadow-xs flex rounded-md", children: /* @__PURE__ */ jsx27(
3875
4121
  ButtonGroup3,
3876
4122
  {
3877
4123
  small: true,
@@ -3881,20 +4127,20 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3881
4127
  }
3882
4128
  ) }),
3883
4129
  /* @__PURE__ */ jsxs18("div", { className: "shadow-xs flex rounded-md", children: [
3884
- /* @__PURE__ */ jsx25("span", { className: "sm:text-ilabel border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-3 ", children: "Calculation" }),
3885
- /* @__PURE__ */ jsx25(
4130
+ /* @__PURE__ */ jsx27("span", { className: "sm:text-ilabel border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-3 ", children: "Calculation" }),
4131
+ /* @__PURE__ */ jsx27(
3886
4132
  "select",
3887
4133
  {
3888
4134
  value: config.calculation,
3889
4135
  className: "sm:text-ilabel text-text-foreground border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 inline-flex items-center rounded-r-md border pl-4 pr-7",
3890
4136
  onChange: (e) => onCalculationChange(e.target.value),
3891
4137
  children: CalculationItems.map((d) => {
3892
- return /* @__PURE__ */ jsx25("option", { value: d.value, children: d.label }, d.value);
4138
+ return /* @__PURE__ */ jsx27("option", { value: d.value, children: d.label }, d.value);
3893
4139
  })
3894
4140
  }
3895
4141
  )
3896
4142
  ] }),
3897
- /* @__PURE__ */ jsx25(
4143
+ /* @__PURE__ */ jsx27(
3898
4144
  Checkbox2,
3899
4145
  {
3900
4146
  checked: config?.showValue,
@@ -3903,7 +4149,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3903
4149
  labelClassName: "whitespace-nowrap"
3904
4150
  }
3905
4151
  ),
3906
- /* @__PURE__ */ jsx25(
4152
+ /* @__PURE__ */ jsx27(
3907
4153
  Checkbox2,
3908
4154
  {
3909
4155
  checked: config?.showPercent,
@@ -3912,7 +4158,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3912
4158
  labelClassName: "whitespace-nowrap"
3913
4159
  }
3914
4160
  ),
3915
- /* @__PURE__ */ jsx25(
4161
+ /* @__PURE__ */ jsx27(
3916
4162
  Checkbox2,
3917
4163
  {
3918
4164
  checked: config?.absValue,
@@ -3930,7 +4176,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3930
4176
  import { produce as produce7 } from "immer";
3931
4177
  import { defaults as defaults2 } from "lodash";
3932
4178
  import { DisclosurePanel as DisclosurePanel4 } from "@sentio/ui-core";
3933
- import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
4179
+ import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
3934
4180
  var defaultConfig2 = {
3935
4181
  direction: "HORIZONTAL",
3936
4182
  calculation: "LAST",
@@ -3983,7 +4229,7 @@ function BarGaugeControls({ config, defaultOpen, onChange }) {
3983
4229
  })
3984
4230
  );
3985
4231
  }
3986
- return /* @__PURE__ */ jsx26(
4232
+ return /* @__PURE__ */ jsx28(
3987
4233
  DisclosurePanel4,
3988
4234
  {
3989
4235
  title: "Bar Gauge Options",
@@ -3991,54 +4237,54 @@ function BarGaugeControls({ config, defaultOpen, onChange }) {
3991
4237
  containerClassName: "w-full bg-default-bg",
3992
4238
  children: /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-4", children: [
3993
4239
  /* @__PURE__ */ jsxs19("div", { className: "shadow-xs flex rounded-md", children: [
3994
- /* @__PURE__ */ jsx26("span", { className: "sm:text-ilabel border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-3 ", children: "Direction" }),
3995
- /* @__PURE__ */ jsx26(
4240
+ /* @__PURE__ */ jsx28("span", { className: "sm:text-ilabel border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-3 ", children: "Direction" }),
4241
+ /* @__PURE__ */ jsx28(
3996
4242
  "select",
3997
4243
  {
3998
4244
  value: config.direction,
3999
4245
  className: "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 inline-flex items-center rounded-r-md border pl-4 pr-7",
4000
4246
  onChange: (e) => onDirectionChange(e.target.value),
4001
4247
  children: directionItems.map((d) => {
4002
- return /* @__PURE__ */ jsx26("option", { value: d.value, children: d.label }, d.value);
4248
+ return /* @__PURE__ */ jsx28("option", { value: d.value, children: d.label }, d.value);
4003
4249
  })
4004
4250
  }
4005
4251
  )
4006
4252
  ] }),
4007
4253
  /* @__PURE__ */ jsxs19("div", { className: "shadow-xs flex rounded-md", children: [
4008
- /* @__PURE__ */ jsx26("span", { className: "sm:text-ilabel border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-3 ", children: "Calculation" }),
4009
- /* @__PURE__ */ jsx26(
4254
+ /* @__PURE__ */ jsx28("span", { className: "sm:text-ilabel border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-3 ", children: "Calculation" }),
4255
+ /* @__PURE__ */ jsx28(
4010
4256
  "select",
4011
4257
  {
4012
4258
  value: config.calculation,
4013
4259
  className: "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 inline-flex items-center rounded-r-md border pl-4 pr-7",
4014
4260
  onChange: (e) => onCalculationChange(e.target.value),
4015
4261
  children: CalculationItems2.map((d) => {
4016
- return /* @__PURE__ */ jsx26("option", { value: d.value, children: d.label }, d.value);
4262
+ return /* @__PURE__ */ jsx28("option", { value: d.value, children: d.label }, d.value);
4017
4263
  })
4018
4264
  }
4019
4265
  )
4020
4266
  ] }),
4021
4267
  /* @__PURE__ */ jsxs19("div", { className: "shadow-xs flex rounded-md", children: [
4022
- /* @__PURE__ */ jsx26("span", { className: "sm:text-ilabel border-main inline-flex items-center whitespace-nowrap rounded-l-md border border-r-0 bg-gray-50 px-3", children: "Sort by" }),
4023
- /* @__PURE__ */ jsx26(
4268
+ /* @__PURE__ */ jsx28("span", { className: "sm:text-ilabel border-main inline-flex items-center whitespace-nowrap rounded-l-md border border-r-0 bg-gray-50 px-3", children: "Sort by" }),
4269
+ /* @__PURE__ */ jsx28(
4024
4270
  "select",
4025
4271
  {
4026
4272
  value: config?.sort?.sortBy,
4027
4273
  className: "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 inline-flex items-center border pl-4 pr-7",
4028
4274
  onChange: (e) => onSortByChange(e.target.value),
4029
4275
  children: sortByItems.map((d) => {
4030
- return /* @__PURE__ */ jsx26("option", { value: d.value, children: d.label }, d.value);
4276
+ return /* @__PURE__ */ jsx28("option", { value: d.value, children: d.label }, d.value);
4031
4277
  })
4032
4278
  }
4033
4279
  ),
4034
- /* @__PURE__ */ jsx26(
4280
+ /* @__PURE__ */ jsx28(
4035
4281
  "select",
4036
4282
  {
4037
4283
  value: config?.sort?.orderDesc + "",
4038
4284
  className: "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 inline-flex items-center rounded-r-md border border-l-0 pl-4 pr-7",
4039
4285
  onChange: (e) => onOrderChange(e.target.value === "true"),
4040
4286
  children: orderItems.map((d) => {
4041
- return /* @__PURE__ */ jsx26("option", { value: d.value + "", children: d.label }, d.label);
4287
+ return /* @__PURE__ */ jsx28("option", { value: d.value + "", children: d.label }, d.label);
4042
4288
  })
4043
4289
  }
4044
4290
  )
@@ -4056,7 +4302,7 @@ import { ComboInput, classNames as classNames8 } from "@sentio/ui-core";
4056
4302
  import { LuPlus, LuTrash2 } from "react-icons/lu";
4057
4303
  import { Button, classNames as classNames7 } from "@sentio/ui-core";
4058
4304
  import { produce as produce8 } from "immer";
4059
- import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
4305
+ import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
4060
4306
  var operators = {
4061
4307
  ">": "greater than",
4062
4308
  ">=": "greater or equal",
@@ -4066,8 +4312,8 @@ var operators = {
4066
4312
  "<=": "less or equal"
4067
4313
  };
4068
4314
  var renderTreeLine = (index, isLast) => {
4069
- return /* @__PURE__ */ jsx27("div", { className: "mr-2 flex h-12 w-3 flex-col items-center justify-center", children: /* @__PURE__ */ jsxs20("div", { className: "flex h-full w-full items-center", children: [
4070
- /* @__PURE__ */ jsx27(
4315
+ return /* @__PURE__ */ jsx29("div", { className: "mr-2 flex h-12 w-3 flex-col items-center justify-center", children: /* @__PURE__ */ jsxs20("div", { className: "flex h-full w-full items-center", children: [
4316
+ /* @__PURE__ */ jsx29(
4071
4317
  "div",
4072
4318
  {
4073
4319
  className: classNames7(
@@ -4076,7 +4322,7 @@ var renderTreeLine = (index, isLast) => {
4076
4322
  )
4077
4323
  }
4078
4324
  ),
4079
- /* @__PURE__ */ jsx27("div", { className: "h-px w-3 bg-gray-300" })
4325
+ /* @__PURE__ */ jsx29("div", { className: "h-px w-3 bg-gray-300" })
4080
4326
  ] }) });
4081
4327
  };
4082
4328
  function ValueStringMapping({ rules, onChange }) {
@@ -4116,8 +4362,8 @@ function ValueStringMapping({ rules, onChange }) {
4116
4362
  className: "text-text-foreground flex h-10 items-center py-1",
4117
4363
  children: [
4118
4364
  renderTreeLine(index, isLast),
4119
- /* @__PURE__ */ jsx27("span", { className: "sm:text-ilabel inline-flex h-full items-center pr-3 font-medium", children: "If value is" }),
4120
- /* @__PURE__ */ jsx27(
4365
+ /* @__PURE__ */ jsx29("span", { className: "sm:text-ilabel inline-flex h-full items-center pr-3 font-medium", children: "If value is" }),
4366
+ /* @__PURE__ */ jsx29(
4121
4367
  "select",
4122
4368
  {
4123
4369
  value: rule.comparison,
@@ -4131,7 +4377,7 @@ function ValueStringMapping({ rules, onChange }) {
4131
4377
  })
4132
4378
  }
4133
4379
  ),
4134
- /* @__PURE__ */ jsx27(
4380
+ /* @__PURE__ */ jsx29(
4135
4381
  "input",
4136
4382
  {
4137
4383
  type: "text",
@@ -4145,8 +4391,8 @@ function ValueStringMapping({ rules, onChange }) {
4145
4391
  }
4146
4392
  }
4147
4393
  ),
4148
- /* @__PURE__ */ jsx27("span", { className: "sm:text-ilabel inline-flex h-full items-center rounded-none px-3 font-medium", children: ", then show" }),
4149
- /* @__PURE__ */ jsx27(
4394
+ /* @__PURE__ */ jsx29("span", { className: "sm:text-ilabel inline-flex h-full items-center rounded-none px-3 font-medium", children: ", then show" }),
4395
+ /* @__PURE__ */ jsx29(
4150
4396
  "input",
4151
4397
  {
4152
4398
  type: "text",
@@ -4160,14 +4406,14 @@ function ValueStringMapping({ rules, onChange }) {
4160
4406
  }
4161
4407
  }
4162
4408
  ),
4163
- /* @__PURE__ */ jsx27(
4409
+ /* @__PURE__ */ jsx29(
4164
4410
  "button",
4165
4411
  {
4166
4412
  type: "button",
4167
4413
  className: "mx-2",
4168
4414
  "aria-label": "remove",
4169
4415
  onClick: () => removeRule(index),
4170
- children: /* @__PURE__ */ jsx27(
4416
+ children: /* @__PURE__ */ jsx29(
4171
4417
  LuTrash2,
4172
4418
  {
4173
4419
  className: "icon text-text-foreground-disabled",
@@ -4190,7 +4436,7 @@ function ValueStringMapping({ rules, onChange }) {
4190
4436
  "aria-label": "remove",
4191
4437
  onClick: addRule,
4192
4438
  children: [
4193
- /* @__PURE__ */ jsx27(LuPlus, { className: classNames7("h-4 w-4"), "aria-hidden": "true" }),
4439
+ /* @__PURE__ */ jsx29(LuPlus, { className: classNames7("h-4 w-4"), "aria-hidden": "true" }),
4194
4440
  "Add Formatting Rule"
4195
4441
  ]
4196
4442
  }
@@ -4199,7 +4445,7 @@ function ValueStringMapping({ rules, onChange }) {
4199
4445
  }
4200
4446
 
4201
4447
  // src/charts/options/ValueOptions.tsx
4202
- import { Fragment as Fragment8, jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
4448
+ import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
4203
4449
  var ValueFormatters = [
4204
4450
  { label: "Number", value: "NumberFormatter" },
4205
4451
  { label: "Date", value: "DateFormatter" },
@@ -4228,7 +4474,7 @@ var CurrencySymbols = [
4228
4474
  var AddonLabel = ({
4229
4475
  className,
4230
4476
  children
4231
- }) => /* @__PURE__ */ jsx28(
4477
+ }) => /* @__PURE__ */ jsx30(
4232
4478
  "span",
4233
4479
  {
4234
4480
  className: classNames8(
@@ -4305,8 +4551,8 @@ var ValueOptions = ({
4305
4551
  switch (style) {
4306
4552
  case "None":
4307
4553
  return /* @__PURE__ */ jsxs21(Fragment8, { children: [
4308
- /* @__PURE__ */ jsx28(AddonLabel, { className: "border border-l-0", children: "Fraction Digits" }),
4309
- /* @__PURE__ */ jsx28(
4554
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "border border-l-0", children: "Fraction Digits" }),
4555
+ /* @__PURE__ */ jsx30(
4310
4556
  "input",
4311
4557
  {
4312
4558
  disabled: true,
@@ -4318,8 +4564,8 @@ var ValueOptions = ({
4318
4564
  case "Percent":
4319
4565
  case "Standard":
4320
4566
  return /* @__PURE__ */ jsxs21(Fragment8, { children: [
4321
- /* @__PURE__ */ jsx28(AddonLabel, { className: "border border-x-0", children: "Fraction Digits" }),
4322
- /* @__PURE__ */ jsx28(
4567
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "border border-x-0", children: "Fraction Digits" }),
4568
+ /* @__PURE__ */ jsx30(
4323
4569
  "input",
4324
4570
  {
4325
4571
  type: "number",
@@ -4334,8 +4580,8 @@ var ValueOptions = ({
4334
4580
  ] });
4335
4581
  case "Currency":
4336
4582
  return /* @__PURE__ */ jsxs21(Fragment8, { children: [
4337
- /* @__PURE__ */ jsx28(AddonLabel, { className: "border border-r-0", children: "Symbol" }),
4338
- /* @__PURE__ */ jsx28("div", { className: "w-28 ", children: /* @__PURE__ */ jsx28(
4583
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "border border-r-0", children: "Symbol" }),
4584
+ /* @__PURE__ */ jsx30("div", { className: "w-28 ", children: /* @__PURE__ */ jsx30(
4339
4585
  ComboInput,
4340
4586
  {
4341
4587
  onChange: onChangeSymbol,
@@ -4348,8 +4594,8 @@ var ValueOptions = ({
4348
4594
  value: config?.currencySymbol
4349
4595
  }
4350
4596
  ) }),
4351
- /* @__PURE__ */ jsx28(AddonLabel, { className: "border", children: "Precision" }),
4352
- /* @__PURE__ */ jsx28(
4597
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "border", children: "Precision" }),
4598
+ /* @__PURE__ */ jsx30(
4353
4599
  "input",
4354
4600
  {
4355
4601
  type: "number",
@@ -4365,8 +4611,8 @@ var ValueOptions = ({
4365
4611
  ] });
4366
4612
  default:
4367
4613
  return /* @__PURE__ */ jsxs21(Fragment8, { children: [
4368
- /* @__PURE__ */ jsx28(AddonLabel, { className: "border border-x-0", children: "Max significant digits" }),
4369
- /* @__PURE__ */ jsx28(
4614
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "border border-x-0", children: "Max significant digits" }),
4615
+ /* @__PURE__ */ jsx30(
4370
4616
  "input",
4371
4617
  {
4372
4618
  type: "number",
@@ -4382,9 +4628,9 @@ var ValueOptions = ({
4382
4628
  }
4383
4629
  }
4384
4630
  return /* @__PURE__ */ jsxs21(Fragment8, { children: [
4385
- /* @__PURE__ */ jsx28("div", { children: /* @__PURE__ */ jsxs21("div", { className: "flex", children: [
4386
- /* @__PURE__ */ jsx28(AddonLabel, { className: "rounded-l-md border border-r-0", children: "Value formatter" }),
4387
- /* @__PURE__ */ jsx28(
4631
+ /* @__PURE__ */ jsx30("div", { children: /* @__PURE__ */ jsxs21("div", { className: "flex", children: [
4632
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "rounded-l-md border border-r-0", children: "Value formatter" }),
4633
+ /* @__PURE__ */ jsx30(
4388
4634
  "select",
4389
4635
  {
4390
4636
  value: config.valueFormatter,
@@ -4394,12 +4640,12 @@ var ValueOptions = ({
4394
4640
  ),
4395
4641
  onChange: (e) => onChangeFormatter(e.target.value),
4396
4642
  children: formatters.map((d) => {
4397
- return /* @__PURE__ */ jsx28("option", { value: d.value, children: d.label }, d.value);
4643
+ return /* @__PURE__ */ jsx30("option", { value: d.value, children: d.label }, d.value);
4398
4644
  })
4399
4645
  }
4400
4646
  ),
4401
4647
  config.valueFormatter == "NumberFormatter" && /* @__PURE__ */ jsxs21(Fragment8, { children: [
4402
- /* @__PURE__ */ jsx28(AddonLabel, { className: "border border-l-0 border-r-0", children: "Style" }),
4648
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "border border-l-0 border-r-0", children: "Style" }),
4403
4649
  /* @__PURE__ */ jsxs21(
4404
4650
  "select",
4405
4651
  {
@@ -4407,36 +4653,36 @@ var ValueOptions = ({
4407
4653
  className: "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 inline-flex items-center border py-1 pl-4 pr-7 focus:ring-0",
4408
4654
  onChange: (e) => onStyleChange(e.target.value),
4409
4655
  children: [
4410
- /* @__PURE__ */ jsx28("option", { value: "None", children: "None" }),
4411
- /* @__PURE__ */ jsx28("option", { value: "Compact", children: "Compact" }),
4412
- /* @__PURE__ */ jsx28("option", { value: "Standard", children: "Standard" }),
4413
- /* @__PURE__ */ jsx28("option", { value: "Scientific", children: "Scientific" }),
4414
- /* @__PURE__ */ jsx28("option", { value: "Percent", children: "Percent" }),
4415
- /* @__PURE__ */ jsx28("option", { value: "Currency", children: "Currency" })
4656
+ /* @__PURE__ */ jsx30("option", { value: "None", children: "None" }),
4657
+ /* @__PURE__ */ jsx30("option", { value: "Compact", children: "Compact" }),
4658
+ /* @__PURE__ */ jsx30("option", { value: "Standard", children: "Standard" }),
4659
+ /* @__PURE__ */ jsx30("option", { value: "Scientific", children: "Scientific" }),
4660
+ /* @__PURE__ */ jsx30("option", { value: "Percent", children: "Percent" }),
4661
+ /* @__PURE__ */ jsx30("option", { value: "Currency", children: "Currency" })
4416
4662
  ]
4417
4663
  }
4418
4664
  ),
4419
4665
  config.style && numberAddons(config.style)
4420
4666
  ] }),
4421
4667
  config.valueFormatter == "DateFormatter" && /* @__PURE__ */ jsxs21(Fragment8, { children: [
4422
- /* @__PURE__ */ jsx28(AddonLabel, { className: "border border-l-0", children: "Date format" }),
4423
- /* @__PURE__ */ jsx28(
4668
+ /* @__PURE__ */ jsx30(AddonLabel, { className: "border border-l-0", children: "Date format" }),
4669
+ /* @__PURE__ */ jsx30(
4424
4670
  "select",
4425
4671
  {
4426
4672
  value: config.dateFormat,
4427
4673
  className: "sm:text-ilabel border-main text-text-foreground inline-flex items-center rounded-r-md border border-l-0 py-1 pl-4 pr-7",
4428
4674
  onChange: (e) => onChangeDateFormat(e.target.value),
4429
4675
  children: dateFormats.map((d) => {
4430
- return /* @__PURE__ */ jsx28("option", { value: d.value, children: d.label }, d.value);
4676
+ return /* @__PURE__ */ jsx30("option", { value: d.value, children: d.label }, d.value);
4431
4677
  })
4432
4678
  }
4433
4679
  )
4434
4680
  ] })
4435
4681
  ] }) }),
4436
- (showPrefix || showSuffix) && /* @__PURE__ */ jsx28("div", { children: /* @__PURE__ */ jsxs21("div", { className: "mt-2 flex items-center gap-4", children: [
4682
+ (showPrefix || showSuffix) && /* @__PURE__ */ jsx30("div", { children: /* @__PURE__ */ jsxs21("div", { className: "mt-2 flex items-center gap-4", children: [
4437
4683
  showPrefix && /* @__PURE__ */ jsxs21("div", { className: "border-main hover:border-primary-600 focus-within:border-primary-600 focus-within:ring-3 focus-within:ring-primary-500/30 text-icontent inline-flex items-center rounded-md border", children: [
4438
- /* @__PURE__ */ jsx28("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Prefix" }),
4439
- /* @__PURE__ */ jsx28(
4684
+ /* @__PURE__ */ jsx30("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Prefix" }),
4685
+ /* @__PURE__ */ jsx30(
4440
4686
  "input",
4441
4687
  {
4442
4688
  type: "text",
@@ -4448,8 +4694,8 @@ var ValueOptions = ({
4448
4694
  )
4449
4695
  ] }),
4450
4696
  showSuffix && /* @__PURE__ */ jsxs21("div", { className: "border-main hover:border-primary-600 focus-within:border-primary-600 focus-within:ring-3 focus-within:ring-primary-500/30 text-icontent inline-flex items-center rounded-md border", children: [
4451
- /* @__PURE__ */ jsx28("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Suffix" }),
4452
- /* @__PURE__ */ jsx28(
4697
+ /* @__PURE__ */ jsx30("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Suffix" }),
4698
+ /* @__PURE__ */ jsx30(
4453
4699
  "input",
4454
4700
  {
4455
4701
  type: "text",
@@ -4461,7 +4707,7 @@ var ValueOptions = ({
4461
4707
  )
4462
4708
  ] })
4463
4709
  ] }) }),
4464
- config.valueFormatter == "StringFormatter" && /* @__PURE__ */ jsx28(
4710
+ config.valueFormatter == "StringFormatter" && /* @__PURE__ */ jsx30(
4465
4711
  ValueStringMapping,
4466
4712
  {
4467
4713
  rules: config.mappingRules || [],
@@ -4475,7 +4721,7 @@ var ValueOptions = ({
4475
4721
  import { defaults as defaults3 } from "lodash";
4476
4722
  import { Checkbox as Checkbox3, DisclosurePanel as DisclosurePanel5 } from "@sentio/ui-core";
4477
4723
  import { produce as produce10 } from "immer";
4478
- import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
4724
+ import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
4479
4725
  var defaultConfig4 = {
4480
4726
  valueFormatter: "NumberFormatter",
4481
4727
  showValueLabel: false,
@@ -4509,7 +4755,7 @@ var ValueControls = ({
4509
4755
  defaultOpen,
4510
4756
  containerClassName: "w-full bg-default-bg",
4511
4757
  children: [
4512
- /* @__PURE__ */ jsx29(
4758
+ /* @__PURE__ */ jsx31(
4513
4759
  ValueOptions,
4514
4760
  {
4515
4761
  onChange,
@@ -4520,7 +4766,7 @@ var ValueControls = ({
4520
4766
  }
4521
4767
  ),
4522
4768
  /* @__PURE__ */ jsxs22("div", { className: "mt-2 flex items-center gap-2", children: [
4523
- /* @__PURE__ */ jsx29(
4769
+ /* @__PURE__ */ jsx31(
4524
4770
  Checkbox3,
4525
4771
  {
4526
4772
  checked: config?.showValueLabel,
@@ -4528,7 +4774,7 @@ var ValueControls = ({
4528
4774
  label: "Show value label"
4529
4775
  }
4530
4776
  ),
4531
- /* @__PURE__ */ jsx29(
4777
+ /* @__PURE__ */ jsx31(
4532
4778
  Checkbox3,
4533
4779
  {
4534
4780
  checked: config?.tooltipTotal,
@@ -4546,6 +4792,7 @@ export {
4546
4792
  AreaIcon_default as AreaIcon,
4547
4793
  ArgumentInput,
4548
4794
  ArgumentType,
4795
+ BarGaugeChart,
4549
4796
  BarGaugeControls,
4550
4797
  BarGuageIcon_default as BarGuageIcon,
4551
4798
  BarIcon_default as BarIcon,
@@ -4566,6 +4813,7 @@ export {
4566
4813
  PieChart2 as PieChart,
4567
4814
  PieChartControls,
4568
4815
  PieIcon_default as PieIcon,
4816
+ QueryValueChart,
4569
4817
  QueryValueIcon_default as QueryValueIcon,
4570
4818
  ReactEChartsBase,
4571
4819
  RefreshButton,