@sentio/ui-dashboard 0.2.6 → 0.2.8

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.js CHANGED
@@ -34,12 +34,14 @@ __export(index_exports, {
34
34
  AreaIcon: () => AreaIcon_default,
35
35
  ArgumentInput: () => ArgumentInput,
36
36
  ArgumentType: () => ArgumentType,
37
+ BarGaugeChart: () => BarGaugeChart,
37
38
  BarGaugeControls: () => BarGaugeControls,
38
39
  BarGuageIcon: () => BarGuageIcon_default,
39
40
  BarIcon: () => BarIcon_default,
40
41
  ChartLegend: () => ChartLegend,
41
42
  ChartTooltip: () => ChartTooltip,
42
43
  ChartTypeButtonGroup: () => ChartTypeButtonGroup,
44
+ DataControls: () => DataControls,
43
45
  EventsFunctionCategories: () => EventsFunctionCategories,
44
46
  EventsFunctionMap: () => EventsFunctionMap,
45
47
  FunctionInput: () => FunctionInput,
@@ -51,14 +53,17 @@ __export(index_exports, {
51
53
  LabelsInput: () => LabelsInput,
52
54
  LineControls: () => LineControls,
53
55
  LineIcon: () => LineIcon_default,
56
+ MarkerControls: () => MarkerControls,
54
57
  PieChart: () => PieChart2,
55
58
  PieChartControls: () => PieChartControls,
56
59
  PieIcon: () => PieIcon_default,
60
+ QueryValueChart: () => QueryValueChart,
57
61
  QueryValueIcon: () => QueryValueIcon_default,
58
62
  ReactEChartsBase: () => ReactEChartsBase,
59
63
  RefreshButton: () => RefreshButton,
60
64
  RefreshContext: () => RefreshContext,
61
65
  ScatterChartTooltip: () => ScatterChartTooltip,
66
+ ScatterControls: () => ScatterControls,
62
67
  ScatterIcon: () => ScatterIcon_default,
63
68
  SystemLabels: () => SystemLabels,
64
69
  TableIcon: () => TableIcon_default,
@@ -66,8 +71,12 @@ __export(index_exports, {
66
71
  ValueFormatters: () => ValueFormatters,
67
72
  ValueOptions: () => ValueOptions,
68
73
  ValueStringMapping: () => ValueStringMapping,
74
+ XAxisControls: () => XAxisControls,
75
+ YaxisControls: () => YaxisControls,
69
76
  defaultBarGaugeConfig: () => defaultConfig2,
77
+ defaultDataConfig: () => defaultConfig5,
70
78
  defaultPieConfig: () => defaultConfig,
79
+ defaultScatterConfig: () => defaultConfig6,
71
80
  defaultValueConfig: () => defaultConfig3,
72
81
  defaultValueControlsConfig: () => defaultConfig4,
73
82
  isAggrOrRollupFunction: () => isAggrOrRollupFunction,
@@ -3723,10 +3732,256 @@ ${percent}%`;
3723
3732
  );
3724
3733
  PieChart2.displayName = "PieChart";
3725
3734
 
3735
+ // src/charts/BarGaugeChart.tsx
3736
+ var import_react18 = require("react");
3737
+ var import_jsx_runtime23 = require("react/jsx-runtime");
3738
+ var compareOption = { numeric: true };
3739
+ var BarGaugeChart = (0, import_react18.forwardRef)(
3740
+ (props, ref) => {
3741
+ const {
3742
+ series: input,
3743
+ legend,
3744
+ valueFormatter,
3745
+ config,
3746
+ title,
3747
+ minHeight,
3748
+ loading,
3749
+ style,
3750
+ onInitChart
3751
+ } = props;
3752
+ const [series, setSeries] = (0, import_react18.useState)([]);
3753
+ const [xAxis, setXAxis] = (0, import_react18.useState)();
3754
+ const [yAxis, setYAxis] = (0, import_react18.useState)();
3755
+ const isVertical = config?.barGauge?.direction === "VERTICAL";
3756
+ (0, import_react18.useEffect)(() => {
3757
+ const tmpData = input.map((s) => {
3758
+ const d = s.data && s.data[0];
3759
+ return { name: s.name, value: d && d[1] };
3760
+ });
3761
+ const sort = config?.barGauge?.sort;
3762
+ switch (sort?.sortBy) {
3763
+ case "ByName":
3764
+ tmpData.sort(
3765
+ (a, b) => sort.orderDesc ? b.name.localeCompare(a.name, void 0, compareOption) : a.name.localeCompare(b.name, void 0, compareOption)
3766
+ );
3767
+ break;
3768
+ case "ByValue":
3769
+ tmpData.sort(
3770
+ (a, b) => sort.orderDesc ? b.value - a.value : a.value - b.value
3771
+ );
3772
+ break;
3773
+ }
3774
+ const series2 = [
3775
+ {
3776
+ type: "bar",
3777
+ data: tmpData.map((d) => d.value),
3778
+ label: {
3779
+ show: config?.valueConfig ? config.valueConfig.showValueLabel : false,
3780
+ position: config?.barGauge?.direction == "VERTICAL" ? "top" : "right",
3781
+ formatter: ({ value }) => valueFormatter(value)
3782
+ }
3783
+ }
3784
+ ];
3785
+ const seriesAxis = {
3786
+ type: "category",
3787
+ data: tmpData.map((s) => s.name),
3788
+ axisLabel: config?.barGauge?.direction == "VERTICAL" ? { interval: 0, rotate: 30 } : {}
3789
+ };
3790
+ if (config?.xAxis?.name) {
3791
+ seriesAxis.name = config?.xAxis?.name;
3792
+ seriesAxis.nameLocation = "middle";
3793
+ seriesAxis.nameGap = isVertical ? 45 : 60;
3794
+ }
3795
+ const valueAxis = {
3796
+ type: "value",
3797
+ axisLabel: (
3798
+ // show dates on value-axis label is weird
3799
+ config?.valueConfig?.valueFormatter == "DateFormatter" ? void 0 : { formatter: (v) => valueFormatter(v) }
3800
+ )
3801
+ };
3802
+ let xAxis2, yAxis2;
3803
+ switch (config?.barGauge?.direction) {
3804
+ case "VERTICAL":
3805
+ xAxis2 = seriesAxis;
3806
+ yAxis2 = valueAxis;
3807
+ break;
3808
+ case "HORIZONTAL":
3809
+ default:
3810
+ xAxis2 = valueAxis;
3811
+ yAxis2 = seriesAxis;
3812
+ }
3813
+ setSeries(series2);
3814
+ setXAxis(xAxis2);
3815
+ setYAxis(yAxis2);
3816
+ }, [
3817
+ input,
3818
+ config?.barGauge?.calculation,
3819
+ config?.barGauge?.sort,
3820
+ config?.valueConfig?.showValueLabel,
3821
+ config?.xAxis?.name,
3822
+ isVertical,
3823
+ valueFormatter
3824
+ ]);
3825
+ const dataZoom = (0, import_react18.useMemo)(() => {
3826
+ if (config?.barGauge?.direction == "HORIZONTAL") {
3827
+ return [
3828
+ {
3829
+ show: series[0]?.data.length > 15,
3830
+ type: "slider",
3831
+ yAxisIndex: 0,
3832
+ zoomLock: true,
3833
+ width: 8,
3834
+ right: 10,
3835
+ top: 5,
3836
+ bottom: 30,
3837
+ minValueSpan: 5,
3838
+ maxValueSpan: 15,
3839
+ orient: "vertical",
3840
+ handleSize: 0,
3841
+ showDetail: false,
3842
+ brushSelect: false,
3843
+ showDataShadow: false
3844
+ },
3845
+ {
3846
+ type: "inside",
3847
+ id: "insideY",
3848
+ yAxisIndex: 0,
3849
+ zoomOnMouseWheel: false,
3850
+ moveOnMouseMove: true,
3851
+ moveOnMouseWheel: true
3852
+ }
3853
+ ];
3854
+ } else {
3855
+ return [
3856
+ {
3857
+ show: series[0]?.data.length > 25,
3858
+ type: "slider",
3859
+ xAxisIndex: 0,
3860
+ zoomLock: true,
3861
+ height: 8,
3862
+ bottom: 5,
3863
+ maxValueSpan: 25,
3864
+ minValueSpan: 10,
3865
+ handleSize: "0",
3866
+ showDetail: false,
3867
+ orient: "horizontal",
3868
+ brushSelect: false,
3869
+ showDataShadow: false
3870
+ },
3871
+ {
3872
+ type: "inside",
3873
+ id: "insideX",
3874
+ xAxisIndex: 0,
3875
+ zoomOnMouseWheel: false,
3876
+ moveOnMouseMove: true,
3877
+ moveOnMouseWheel: true
3878
+ }
3879
+ ];
3880
+ }
3881
+ }, [config, series]);
3882
+ const options = {
3883
+ title: { text: title },
3884
+ grid: {
3885
+ top: title ? 48 : 16,
3886
+ right: 40,
3887
+ bottom: isVertical && config?.xAxis?.name ? 40 : 16,
3888
+ left: !isVertical && config?.xAxis?.name ? 40 : 16,
3889
+ containLabel: true
3890
+ },
3891
+ xAxis,
3892
+ legend: { data: legend, top: -1e4, left: -1e4 },
3893
+ toolbox: { show: false },
3894
+ yAxis,
3895
+ dataZoom,
3896
+ animation: false,
3897
+ series,
3898
+ tooltip: {
3899
+ trigger: "axis",
3900
+ confine: true,
3901
+ extraCssText: "max-width: 50%; max-height: 50vh; overflow-y: auto;"
3902
+ }
3903
+ };
3904
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3905
+ ReactEChartsBase,
3906
+ {
3907
+ ref,
3908
+ loading,
3909
+ option: options,
3910
+ minHeight,
3911
+ style,
3912
+ noLegend: true,
3913
+ onInitChart
3914
+ }
3915
+ ) });
3916
+ }
3917
+ );
3918
+ BarGaugeChart.displayName = "BarGaugeChart";
3919
+
3920
+ // src/charts/QueryValueChart.tsx
3921
+ var import_react19 = require("react");
3922
+ var import_react_resize_detector4 = require("react-resize-detector");
3923
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3924
+ var QueryValueChart = (0, import_react19.forwardRef)(
3925
+ (props, ref) => {
3926
+ const {
3927
+ series,
3928
+ valueText,
3929
+ textColor,
3930
+ backgroundColor,
3931
+ minHeight,
3932
+ loading,
3933
+ style,
3934
+ onInitChart
3935
+ } = props;
3936
+ const { width, height, ref: ref2 } = (0, import_react_resize_detector4.useResizeDetector)();
3937
+ const fontSize = (0, import_react19.useMemo)(() => {
3938
+ return Math.min(
3939
+ (width || 0) / String(valueText).length,
3940
+ (height || 0) / 1.5
3941
+ );
3942
+ }, [width, height, valueText]);
3943
+ const options = {
3944
+ backgroundColor,
3945
+ grid: { top: 0, right: 0, bottom: 0, left: 0 },
3946
+ toolbox: { show: false },
3947
+ animation: false,
3948
+ series,
3949
+ xAxis: { type: "time", show: false },
3950
+ yAxis: { type: "value", show: false },
3951
+ legend: { show: false },
3952
+ graphic: {
3953
+ type: "text",
3954
+ z: 100,
3955
+ left: "center",
3956
+ top: "middle",
3957
+ style: {
3958
+ text: valueText,
3959
+ fontSize,
3960
+ stroke: textColor,
3961
+ fill: textColor
3962
+ }
3963
+ }
3964
+ };
3965
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full w-full", ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3966
+ ReactEChartsBase,
3967
+ {
3968
+ ref,
3969
+ loading,
3970
+ option: options,
3971
+ minHeight,
3972
+ style,
3973
+ noLegend: true,
3974
+ onInitChart
3975
+ }
3976
+ ) }) });
3977
+ }
3978
+ );
3979
+ QueryValueChart.displayName = "QueryValueChart";
3980
+
3726
3981
  // src/charts/options/LineControls.tsx
3727
3982
  var import_immer4 = require("immer");
3728
3983
  var import_ui_core11 = require("@sentio/ui-core");
3729
- var import_jsx_runtime23 = require("react/jsx-runtime");
3984
+ var import_jsx_runtime25 = require("react/jsx-runtime");
3730
3985
  var lineStyles = [
3731
3986
  { label: "Solid", value: "Solid" },
3732
3987
  { label: "Dotted", value: "Dotted" }
@@ -3746,13 +4001,13 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
3746
4001
  })
3747
4002
  );
3748
4003
  };
3749
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4004
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3750
4005
  import_ui_core11.DisclosurePanel,
3751
4006
  {
3752
4007
  title: "Line style",
3753
4008
  containerClassName: "w-full bg-default-bg",
3754
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-4", children: [
3755
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4009
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-4", children: [
4010
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3756
4011
  import_ui_core11.NewButtonGroup,
3757
4012
  {
3758
4013
  buttons: lineStyles,
@@ -3761,7 +4016,7 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
3761
4016
  small: true
3762
4017
  }
3763
4018
  ),
3764
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4019
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3765
4020
  import_ui_core11.Checkbox,
3766
4021
  {
3767
4022
  label: "Smooth Curves",
@@ -3775,16 +4030,16 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
3775
4030
  };
3776
4031
 
3777
4032
  // src/charts/options/LabelControls.tsx
3778
- var import_react18 = require("react");
4033
+ var import_react20 = require("react");
3779
4034
  var import_immer5 = require("immer");
3780
4035
  var import_ui_core12 = require("@sentio/ui-core");
3781
- var import_jsx_runtime24 = require("react/jsx-runtime");
4036
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3782
4037
  var initialConfig = {
3783
4038
  columns: [],
3784
4039
  alias: ""
3785
4040
  };
3786
4041
  var LabelControls = ({ config, setConfig, defaultOpen }) => {
3787
- (0, import_react18.useEffect)(() => {
4042
+ (0, import_react20.useEffect)(() => {
3788
4043
  if (config?.columns && config.columns.length > 0 && !config.alias) {
3789
4044
  const aliasParts = [];
3790
4045
  config.columns.forEach((colConfig) => {
@@ -3814,31 +4069,31 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3814
4069
  })
3815
4070
  );
3816
4071
  };
3817
- const _defaultOpen = (0, import_react18.useMemo)(() => {
4072
+ const _defaultOpen = (0, import_react20.useMemo)(() => {
3818
4073
  if (defaultOpen) {
3819
4074
  return true;
3820
4075
  }
3821
4076
  return config?.alias !== "" || config?.columns && config.columns.length > 0;
3822
4077
  }, [config, defaultOpen]);
3823
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4078
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3824
4079
  import_ui_core12.DisclosurePanel,
3825
4080
  {
3826
4081
  title: "Label Controls",
3827
4082
  defaultOpen: _defaultOpen,
3828
4083
  containerClassName: "w-full bg-default-bg",
3829
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
3830
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "inline-flex h-8", children: [
3831
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("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: [
4084
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
4085
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "inline-flex h-8", children: [
4086
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("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: [
3832
4087
  "Label Alias",
3833
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4088
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3834
4089
  import_ui_core12.HelpIcon,
3835
4090
  {
3836
- text: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "text-icontent text-text-foreground", children: [
3837
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: "Series name override or template." }),
3838
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
4091
+ text: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "text-icontent text-text-foreground", children: [
4092
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { children: "Series name override or template." }),
4093
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
3839
4094
  "Ex.",
3840
4095
  " ",
3841
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-primary mx-1 font-semibold italic", children: "{{contract}}" }),
4096
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-primary mx-1 font-semibold italic", children: "{{contract}}" }),
3842
4097
  " ",
3843
4098
  "will be replaced with the value of the contract label."
3844
4099
  ] })
@@ -3846,7 +4101,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3846
4101
  }
3847
4102
  )
3848
4103
  ] }),
3849
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4104
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3850
4105
  "input",
3851
4106
  {
3852
4107
  type: "text",
@@ -3857,7 +4112,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3857
4112
  }
3858
4113
  )
3859
4114
  ] }),
3860
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4115
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3861
4116
  import_ui_core12.Button,
3862
4117
  {
3863
4118
  type: "button",
@@ -3877,7 +4132,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
3877
4132
  var import_immer6 = require("immer");
3878
4133
  var import_lodash5 = require("lodash");
3879
4134
  var import_ui_core13 = require("@sentio/ui-core");
3880
- var import_jsx_runtime25 = require("react/jsx-runtime");
4135
+ var import_jsx_runtime27 = require("react/jsx-runtime");
3881
4136
  var defaultConfig = {
3882
4137
  pieType: "Pie",
3883
4138
  calculation: "LAST",
@@ -3912,14 +4167,14 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3912
4167
  })
3913
4168
  );
3914
4169
  }
3915
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4170
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3916
4171
  import_ui_core13.DisclosurePanel,
3917
4172
  {
3918
4173
  title: "Pie Chart Options",
3919
4174
  defaultOpen,
3920
4175
  containerClassName: "w-full bg-default-bg",
3921
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-4", children: [
3922
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "shadow-xs flex rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4176
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-4", children: [
4177
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "shadow-xs flex rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3923
4178
  import_ui_core13.NewButtonGroup,
3924
4179
  {
3925
4180
  small: true,
@@ -3928,21 +4183,21 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3928
4183
  onChange: onPieTypeChange
3929
4184
  }
3930
4185
  ) }),
3931
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
3932
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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" }),
3933
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4186
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
4187
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("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" }),
4188
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3934
4189
  "select",
3935
4190
  {
3936
4191
  value: config.calculation,
3937
4192
  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",
3938
4193
  onChange: (e) => onCalculationChange(e.target.value),
3939
4194
  children: CalculationItems.map((d) => {
3940
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: d.value, children: d.label }, d.value);
4195
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("option", { value: d.value, children: d.label }, d.value);
3941
4196
  })
3942
4197
  }
3943
4198
  )
3944
4199
  ] }),
3945
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4200
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3946
4201
  import_ui_core13.Checkbox,
3947
4202
  {
3948
4203
  checked: config?.showValue,
@@ -3951,7 +4206,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3951
4206
  labelClassName: "whitespace-nowrap"
3952
4207
  }
3953
4208
  ),
3954
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4209
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3955
4210
  import_ui_core13.Checkbox,
3956
4211
  {
3957
4212
  checked: config?.showPercent,
@@ -3960,7 +4215,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3960
4215
  labelClassName: "whitespace-nowrap"
3961
4216
  }
3962
4217
  ),
3963
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4218
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3964
4219
  import_ui_core13.Checkbox,
3965
4220
  {
3966
4221
  checked: config?.absValue,
@@ -3978,7 +4233,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
3978
4233
  var import_immer7 = require("immer");
3979
4234
  var import_lodash6 = require("lodash");
3980
4235
  var import_ui_core14 = require("@sentio/ui-core");
3981
- var import_jsx_runtime26 = require("react/jsx-runtime");
4236
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3982
4237
  var defaultConfig2 = {
3983
4238
  direction: "HORIZONTAL",
3984
4239
  calculation: "LAST",
@@ -4031,62 +4286,62 @@ function BarGaugeControls({ config, defaultOpen, onChange }) {
4031
4286
  })
4032
4287
  );
4033
4288
  }
4034
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4289
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4035
4290
  import_ui_core14.DisclosurePanel,
4036
4291
  {
4037
4292
  title: "Bar Gauge Options",
4038
4293
  defaultOpen,
4039
4294
  containerClassName: "w-full bg-default-bg",
4040
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-4", children: [
4041
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
4042
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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" }),
4043
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4295
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-4", children: [
4296
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
4297
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("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" }),
4298
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4044
4299
  "select",
4045
4300
  {
4046
4301
  value: config.direction,
4047
4302
  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",
4048
4303
  onChange: (e) => onDirectionChange(e.target.value),
4049
4304
  children: directionItems.map((d) => {
4050
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: d.value, children: d.label }, d.value);
4305
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
4051
4306
  })
4052
4307
  }
4053
4308
  )
4054
4309
  ] }),
4055
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
4056
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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" }),
4057
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4310
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
4311
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("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" }),
4312
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4058
4313
  "select",
4059
4314
  {
4060
4315
  value: config.calculation,
4061
4316
  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",
4062
4317
  onChange: (e) => onCalculationChange(e.target.value),
4063
4318
  children: CalculationItems2.map((d) => {
4064
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: d.value, children: d.label }, d.value);
4319
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
4065
4320
  })
4066
4321
  }
4067
4322
  )
4068
4323
  ] }),
4069
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
4070
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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" }),
4071
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4324
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
4325
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("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" }),
4326
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4072
4327
  "select",
4073
4328
  {
4074
4329
  value: config?.sort?.sortBy,
4075
4330
  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",
4076
4331
  onChange: (e) => onSortByChange(e.target.value),
4077
4332
  children: sortByItems.map((d) => {
4078
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: d.value, children: d.label }, d.value);
4333
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
4079
4334
  })
4080
4335
  }
4081
4336
  ),
4082
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4337
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4083
4338
  "select",
4084
4339
  {
4085
4340
  value: config?.sort?.orderDesc + "",
4086
4341
  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",
4087
4342
  onChange: (e) => onOrderChange(e.target.value === "true"),
4088
4343
  children: orderItems.map((d) => {
4089
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: d.value + "", children: d.label }, d.label);
4344
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value + "", children: d.label }, d.label);
4090
4345
  })
4091
4346
  }
4092
4347
  )
@@ -4098,13 +4353,30 @@ function BarGaugeControls({ config, defaultOpen, onChange }) {
4098
4353
 
4099
4354
  // src/charts/options/ValueOptions.tsx
4100
4355
  var import_immer9 = require("immer");
4101
- var import_ui_core16 = require("@sentio/ui-core");
4356
+ var import_ui_core17 = require("@sentio/ui-core");
4357
+
4358
+ // src/charts/options/controls-ui.tsx
4359
+ var import_ui_core15 = require("@sentio/ui-core");
4360
+ var import_jsx_runtime29 = require("react/jsx-runtime");
4361
+ var AddonLabel = ({
4362
+ className,
4363
+ children
4364
+ }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4365
+ "span",
4366
+ {
4367
+ className: (0, import_ui_core15.classNames)(
4368
+ "sm:text-icontent border-main inline-flex items-center whitespace-nowrap bg-gray-50",
4369
+ className
4370
+ ),
4371
+ children
4372
+ }
4373
+ );
4102
4374
 
4103
4375
  // src/charts/options/ValueStringMapping.tsx
4104
4376
  var import_lu5 = require("react-icons/lu");
4105
- var import_ui_core15 = require("@sentio/ui-core");
4377
+ var import_ui_core16 = require("@sentio/ui-core");
4106
4378
  var import_immer8 = require("immer");
4107
- var import_jsx_runtime27 = require("react/jsx-runtime");
4379
+ var import_jsx_runtime30 = require("react/jsx-runtime");
4108
4380
  var operators = {
4109
4381
  ">": "greater than",
4110
4382
  ">=": "greater or equal",
@@ -4114,17 +4386,17 @@ var operators = {
4114
4386
  "<=": "less or equal"
4115
4387
  };
4116
4388
  var renderTreeLine = (index, isLast) => {
4117
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mr-2 flex h-12 w-3 flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex h-full w-full items-center", children: [
4118
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4389
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mr-2 flex h-12 w-3 flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex h-full w-full items-center", children: [
4390
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4119
4391
  "div",
4120
4392
  {
4121
- className: (0, import_ui_core15.classNames)(
4393
+ className: (0, import_ui_core16.classNames)(
4122
4394
  "w-px bg-gray-300",
4123
4395
  isLast ? "h-1/2 self-start" : index === 0 ? "h-full self-end" : "h-full"
4124
4396
  )
4125
4397
  }
4126
4398
  ),
4127
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "h-px w-3 bg-gray-300" })
4399
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-px w-3 bg-gray-300" })
4128
4400
  ] }) });
4129
4401
  };
4130
4402
  function ValueStringMapping({ rules, onChange }) {
@@ -4155,31 +4427,31 @@ function ValueStringMapping({ rules, onChange }) {
4155
4427
  })
4156
4428
  );
4157
4429
  }
4158
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full flex-col rounded-md py-2", children: [
4430
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex w-full flex-col rounded-md py-2", children: [
4159
4431
  (rules || []).map((rule, index) => {
4160
4432
  const isLast = index === (rules || []).length - 1;
4161
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4433
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4162
4434
  "div",
4163
4435
  {
4164
4436
  className: "text-text-foreground flex h-10 items-center py-1",
4165
4437
  children: [
4166
4438
  renderTreeLine(index, isLast),
4167
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center pr-3 font-medium", children: "If value is" }),
4168
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4439
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center pr-3 font-medium", children: "If value is" }),
4440
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4169
4441
  "select",
4170
4442
  {
4171
4443
  value: rule.comparison,
4172
4444
  onChange: (e) => changeRule(index, "comparison", e.target.value),
4173
4445
  className: "rounded-r-0 sm:text-ilabel border-main text-text-foreground focus:border-primary-600 focus:ring-3 focus:ring-primary-600/30 inline-flex h-full items-center rounded-l-md border border-r-0 bg-gray-50 py-1 pl-4 pr-7",
4174
4446
  children: Object.entries(operators).map(([op, display]) => {
4175
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("option", { value: op, children: [
4447
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("option", { value: op, children: [
4176
4448
  "is ",
4177
4449
  display
4178
4450
  ] }, op);
4179
4451
  })
4180
4452
  }
4181
4453
  ),
4182
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4454
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4183
4455
  "input",
4184
4456
  {
4185
4457
  type: "text",
@@ -4193,8 +4465,8 @@ function ValueStringMapping({ rules, onChange }) {
4193
4465
  }
4194
4466
  }
4195
4467
  ),
4196
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center rounded-none px-3 font-medium", children: ", then show" }),
4197
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4468
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center rounded-none px-3 font-medium", children: ", then show" }),
4469
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4198
4470
  "input",
4199
4471
  {
4200
4472
  type: "text",
@@ -4208,14 +4480,14 @@ function ValueStringMapping({ rules, onChange }) {
4208
4480
  }
4209
4481
  }
4210
4482
  ),
4211
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4483
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4212
4484
  "button",
4213
4485
  {
4214
4486
  type: "button",
4215
4487
  className: "mx-2",
4216
4488
  "aria-label": "remove",
4217
4489
  onClick: () => removeRule(index),
4218
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4490
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4219
4491
  import_lu5.LuTrash2,
4220
4492
  {
4221
4493
  className: "icon text-text-foreground-disabled",
@@ -4229,8 +4501,8 @@ function ValueStringMapping({ rules, onChange }) {
4229
4501
  index
4230
4502
  );
4231
4503
  }),
4232
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4233
- import_ui_core15.Button,
4504
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4505
+ import_ui_core16.Button,
4234
4506
  {
4235
4507
  type: "button",
4236
4508
  role: "secondary",
@@ -4238,7 +4510,7 @@ function ValueStringMapping({ rules, onChange }) {
4238
4510
  "aria-label": "remove",
4239
4511
  onClick: addRule,
4240
4512
  children: [
4241
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lu5.LuPlus, { className: (0, import_ui_core15.classNames)("h-4 w-4"), "aria-hidden": "true" }),
4513
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lu5.LuPlus, { className: (0, import_ui_core16.classNames)("h-4 w-4"), "aria-hidden": "true" }),
4242
4514
  "Add Formatting Rule"
4243
4515
  ]
4244
4516
  }
@@ -4247,7 +4519,7 @@ function ValueStringMapping({ rules, onChange }) {
4247
4519
  }
4248
4520
 
4249
4521
  // src/charts/options/ValueOptions.tsx
4250
- var import_jsx_runtime28 = require("react/jsx-runtime");
4522
+ var import_jsx_runtime31 = require("react/jsx-runtime");
4251
4523
  var ValueFormatters = [
4252
4524
  { label: "Number", value: "NumberFormatter" },
4253
4525
  { label: "Date", value: "DateFormatter" },
@@ -4273,19 +4545,10 @@ var CurrencySymbols = [
4273
4545
  { label: "BTC", value: "\u0243" },
4274
4546
  { label: "ETH", value: "\u039E" }
4275
4547
  ];
4276
- var AddonLabel = ({
4548
+ var AddonLabel2 = ({
4277
4549
  className,
4278
4550
  children
4279
- }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4280
- "span",
4281
- {
4282
- className: (0, import_ui_core16.classNames)(
4283
- "sm:text-ilabel border-main inline-flex items-center whitespace-nowrap bg-gray-50 px-3",
4284
- className
4285
- ),
4286
- children
4287
- }
4288
- );
4551
+ }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel, { className: (0, import_ui_core17.classNames)("px-3", className), children });
4289
4552
  var ValueOptions = ({
4290
4553
  config,
4291
4554
  onChange,
@@ -4352,9 +4615,9 @@ var ValueOptions = ({
4352
4615
  function numberAddons(style) {
4353
4616
  switch (style) {
4354
4617
  case "None":
4355
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
4356
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "border border-l-0", children: "Fraction Digits" }),
4357
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4618
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4619
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-l-0", children: "Fraction Digits" }),
4620
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4358
4621
  "input",
4359
4622
  {
4360
4623
  disabled: true,
@@ -4365,9 +4628,9 @@ var ValueOptions = ({
4365
4628
  ] });
4366
4629
  case "Percent":
4367
4630
  case "Standard":
4368
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
4369
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "border border-x-0", children: "Fraction Digits" }),
4370
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4631
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4632
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-x-0", children: "Fraction Digits" }),
4633
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4371
4634
  "input",
4372
4635
  {
4373
4636
  type: "number",
@@ -4381,10 +4644,10 @@ var ValueOptions = ({
4381
4644
  )
4382
4645
  ] });
4383
4646
  case "Currency":
4384
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
4385
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "border border-r-0", children: "Symbol" }),
4386
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-28 ", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4387
- import_ui_core16.ComboInput,
4647
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4648
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-r-0", children: "Symbol" }),
4649
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-28 ", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4650
+ import_ui_core17.ComboInput,
4388
4651
  {
4389
4652
  onChange: onChangeSymbol,
4390
4653
  options: CurrencySymbols.map((s) => s.value),
@@ -4396,8 +4659,8 @@ var ValueOptions = ({
4396
4659
  value: config?.currencySymbol
4397
4660
  }
4398
4661
  ) }),
4399
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "border", children: "Precision" }),
4400
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4662
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border", children: "Precision" }),
4663
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4401
4664
  "input",
4402
4665
  {
4403
4666
  type: "number",
@@ -4412,9 +4675,9 @@ var ValueOptions = ({
4412
4675
  )
4413
4676
  ] });
4414
4677
  default:
4415
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
4416
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "border border-x-0", children: "Max significant digits" }),
4417
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4678
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4679
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-x-0", children: "Max significant digits" }),
4680
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4418
4681
  "input",
4419
4682
  {
4420
4683
  type: "number",
@@ -4429,62 +4692,62 @@ var ValueOptions = ({
4429
4692
  ] });
4430
4693
  }
4431
4694
  }
4432
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
4433
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex", children: [
4434
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0", children: "Value formatter" }),
4435
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4695
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4696
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex", children: [
4697
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "rounded-l-md border border-r-0", children: "Value formatter" }),
4698
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4436
4699
  "select",
4437
4700
  {
4438
4701
  value: config.valueFormatter,
4439
- className: (0, import_ui_core16.classNames)(
4702
+ className: (0, import_ui_core17.classNames)(
4440
4703
  "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 inline-flex items-center border py-1.5 pl-4 pr-7 focus:ring-0",
4441
4704
  config.valueFormatter == "StringFormatter" ? "rounded-r-md" : ""
4442
4705
  ),
4443
4706
  onChange: (e) => onChangeFormatter(e.target.value),
4444
4707
  children: formatters.map((d) => {
4445
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
4708
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: d.value, children: d.label }, d.value);
4446
4709
  })
4447
4710
  }
4448
4711
  ),
4449
- config.valueFormatter == "NumberFormatter" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
4450
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "border border-l-0 border-r-0", children: "Style" }),
4451
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4712
+ config.valueFormatter == "NumberFormatter" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4713
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-l-0 border-r-0", children: "Style" }),
4714
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
4452
4715
  "select",
4453
4716
  {
4454
4717
  value: config.style,
4455
4718
  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",
4456
4719
  onChange: (e) => onStyleChange(e.target.value),
4457
4720
  children: [
4458
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "None", children: "None" }),
4459
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "Compact", children: "Compact" }),
4460
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "Standard", children: "Standard" }),
4461
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "Scientific", children: "Scientific" }),
4462
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "Percent", children: "Percent" }),
4463
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "Currency", children: "Currency" })
4721
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "None", children: "None" }),
4722
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Compact", children: "Compact" }),
4723
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Standard", children: "Standard" }),
4724
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Scientific", children: "Scientific" }),
4725
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Percent", children: "Percent" }),
4726
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Currency", children: "Currency" })
4464
4727
  ]
4465
4728
  }
4466
4729
  ),
4467
4730
  config.style && numberAddons(config.style)
4468
4731
  ] }),
4469
- config.valueFormatter == "DateFormatter" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
4470
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddonLabel, { className: "border border-l-0", children: "Date format" }),
4471
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4732
+ config.valueFormatter == "DateFormatter" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4733
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-l-0", children: "Date format" }),
4734
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4472
4735
  "select",
4473
4736
  {
4474
4737
  value: config.dateFormat,
4475
4738
  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",
4476
4739
  onChange: (e) => onChangeDateFormat(e.target.value),
4477
4740
  children: dateFormats.map((d) => {
4478
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
4741
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: d.value, children: d.label }, d.value);
4479
4742
  })
4480
4743
  }
4481
4744
  )
4482
4745
  ] })
4483
4746
  ] }) }),
4484
- (showPrefix || showSuffix) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mt-2 flex items-center gap-4", children: [
4485
- showPrefix && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("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: [
4486
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Prefix" }),
4487
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4747
+ (showPrefix || showSuffix) && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mt-2 flex items-center gap-4", children: [
4748
+ showPrefix && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("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: [
4749
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Prefix" }),
4750
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4488
4751
  "input",
4489
4752
  {
4490
4753
  type: "text",
@@ -4495,9 +4758,9 @@ var ValueOptions = ({
4495
4758
  }
4496
4759
  )
4497
4760
  ] }),
4498
- showSuffix && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("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: [
4499
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Suffix" }),
4500
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4761
+ showSuffix && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("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: [
4762
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Suffix" }),
4763
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4501
4764
  "input",
4502
4765
  {
4503
4766
  type: "text",
@@ -4509,7 +4772,7 @@ var ValueOptions = ({
4509
4772
  )
4510
4773
  ] })
4511
4774
  ] }) }),
4512
- config.valueFormatter == "StringFormatter" && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4775
+ config.valueFormatter == "StringFormatter" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4513
4776
  ValueStringMapping,
4514
4777
  {
4515
4778
  rules: config.mappingRules || [],
@@ -4521,9 +4784,9 @@ var ValueOptions = ({
4521
4784
 
4522
4785
  // src/charts/options/ValueControls.tsx
4523
4786
  var import_lodash7 = require("lodash");
4524
- var import_ui_core17 = require("@sentio/ui-core");
4787
+ var import_ui_core18 = require("@sentio/ui-core");
4525
4788
  var import_immer10 = require("immer");
4526
- var import_jsx_runtime29 = require("react/jsx-runtime");
4789
+ var import_jsx_runtime32 = require("react/jsx-runtime");
4527
4790
  var defaultConfig4 = {
4528
4791
  valueFormatter: "NumberFormatter",
4529
4792
  showValueLabel: false,
@@ -4550,14 +4813,14 @@ var ValueControls = ({
4550
4813
  function toggleTooltipTotal(checked) {
4551
4814
  config && onChange((0, import_immer10.produce)(config, (draft) => void (draft.tooltipTotal = checked)));
4552
4815
  }
4553
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4554
- import_ui_core17.DisclosurePanel,
4816
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4817
+ import_ui_core18.DisclosurePanel,
4555
4818
  {
4556
4819
  title: "Value Options",
4557
4820
  defaultOpen,
4558
4821
  containerClassName: "w-full bg-default-bg",
4559
4822
  children: [
4560
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4823
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4561
4824
  ValueOptions,
4562
4825
  {
4563
4826
  onChange,
@@ -4567,17 +4830,17 @@ var ValueControls = ({
4567
4830
  showSuffix
4568
4831
  }
4569
4832
  ),
4570
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [
4571
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4572
- import_ui_core17.Checkbox,
4833
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [
4834
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4835
+ import_ui_core18.Checkbox,
4573
4836
  {
4574
4837
  checked: config?.showValueLabel,
4575
4838
  onChange: toggleShowValueLabel,
4576
4839
  label: "Show value label"
4577
4840
  }
4578
4841
  ),
4579
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4580
- import_ui_core17.Checkbox,
4842
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4843
+ import_ui_core18.Checkbox,
4581
4844
  {
4582
4845
  checked: config?.tooltipTotal,
4583
4846
  onChange: toggleTooltipTotal,
@@ -4589,18 +4852,604 @@ var ValueControls = ({
4589
4852
  }
4590
4853
  );
4591
4854
  };
4855
+
4856
+ // src/charts/options/YaxisControls.tsx
4857
+ var import_lodash8 = require("lodash");
4858
+ var import_ui_core19 = require("@sentio/ui-core");
4859
+ var import_jsx_runtime33 = require("react/jsx-runtime");
4860
+ var initialConfig2 = {
4861
+ yAxis: {
4862
+ min: "",
4863
+ max: "",
4864
+ scale: true,
4865
+ stack: ""
4866
+ }
4867
+ };
4868
+ function YaxisControls({
4869
+ yAxis,
4870
+ setYAxis,
4871
+ defaultOpen,
4872
+ columnSelect,
4873
+ supportSetName = true,
4874
+ supportSetMinMax = true,
4875
+ supportStackSeries = true,
4876
+ supportAlwaysShowZero = true,
4877
+ supportReset = true,
4878
+ panelTitle = "Y-Axis Controls"
4879
+ }) {
4880
+ yAxis = (0, import_lodash8.defaults)(yAxis || {}, initialConfig2.yAxis);
4881
+ const onChangeInput = (field) => (event) => {
4882
+ const { value } = event.target;
4883
+ setYAxis({
4884
+ ...yAxis,
4885
+ [field]: value || void 0,
4886
+ scale: field == "min" && value > "0" ? true : yAxis?.scale
4887
+ });
4888
+ };
4889
+ const onToggleZero = (checked) => {
4890
+ setYAxis({ ...yAxis, scale: !checked, min: checked ? "" : yAxis?.min });
4891
+ };
4892
+ const onClickResetYAxis = () => {
4893
+ setYAxis(initialConfig2.yAxis);
4894
+ };
4895
+ const onToggleStack = (checked) => {
4896
+ setYAxis({ ...yAxis, stacked: checked ? "samesign" : "" });
4897
+ };
4898
+ const minMaxLabelCls = "inline-flex items-center border border-r-0 sm:text-icontent border-main bg-gray-50 px-2 rounded-l-md";
4899
+ const minMaxInputCls = "border focus:border-primary-500 rounded-r-md sm:text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30";
4900
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4901
+ import_ui_core19.DisclosurePanel,
4902
+ {
4903
+ title: panelTitle,
4904
+ defaultOpen,
4905
+ containerClassName: "w-full bg-default-bg",
4906
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-icontent flex flex-wrap gap-[10px]", children: [
4907
+ supportSetName && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "inline-flex h-8", children: [
4908
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Name" }),
4909
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4910
+ "input",
4911
+ {
4912
+ type: "text",
4913
+ className: "focus:border-primary-500 sm:text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 w-40 rounded-r-md border",
4914
+ value: yAxis?.name,
4915
+ placeholder: "Axis Name",
4916
+ onChange: onChangeInput("name")
4917
+ }
4918
+ )
4919
+ ] }),
4920
+ columnSelect && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "inline-flex h-8", children: [
4921
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AddonLabel, { className: "rounded-l-md border px-2", children: "Column" }),
4922
+ columnSelect
4923
+ ] }),
4924
+ supportSetMinMax && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4925
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "inline-flex h-8", children: [
4926
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: minMaxLabelCls, children: "Min" }),
4927
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4928
+ "input",
4929
+ {
4930
+ type: "text",
4931
+ className: minMaxInputCls,
4932
+ style: { width: "10em" },
4933
+ value: yAxis.min,
4934
+ placeholder: "Auto",
4935
+ onChange: onChangeInput("min")
4936
+ }
4937
+ )
4938
+ ] }),
4939
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "inline-flex h-8", children: [
4940
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: minMaxLabelCls, children: "Max" }),
4941
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4942
+ "input",
4943
+ {
4944
+ type: "text",
4945
+ className: minMaxInputCls,
4946
+ style: { width: "10em" },
4947
+ value: yAxis.max,
4948
+ placeholder: "Auto",
4949
+ onChange: onChangeInput("max")
4950
+ }
4951
+ )
4952
+ ] })
4953
+ ] }),
4954
+ supportStackSeries && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4955
+ import_ui_core19.Checkbox,
4956
+ {
4957
+ checked: !!yAxis?.stacked,
4958
+ onChange: onToggleStack,
4959
+ label: "Stack series"
4960
+ }
4961
+ ),
4962
+ supportAlwaysShowZero && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4963
+ import_ui_core19.Checkbox,
4964
+ {
4965
+ checked: !yAxis.scale,
4966
+ onChange: onToggleZero,
4967
+ label: "Always show zero"
4968
+ }
4969
+ ),
4970
+ supportReset && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui_core19.Button, { type: "button", role: "link", onClick: onClickResetYAxis, children: "Reset" })
4971
+ ] })
4972
+ }
4973
+ );
4974
+ }
4975
+
4976
+ // src/charts/options/XaxisControls.tsx
4977
+ var import_ui_core20 = require("@sentio/ui-core");
4978
+ var import_lu6 = require("react-icons/lu");
4979
+ var import_jsx_runtime34 = require("react/jsx-runtime");
4980
+ var TypeSelect = import_ui_core20.Select;
4981
+ var SortSelect = import_ui_core20.Select;
4982
+ var OrderSelect = import_ui_core20.Select;
4983
+ var sortByItems2 = [
4984
+ { label: "Name", value: "ByName" },
4985
+ { label: "Value", value: "ByValue" }
4986
+ ];
4987
+ var orderItems2 = [
4988
+ { label: "Ascendant", value: false },
4989
+ { label: "Descendant", value: true }
4990
+ ];
4991
+ var XAxisControls = ({
4992
+ xAxis,
4993
+ setXAxis,
4994
+ defaultOpen,
4995
+ columnSelect,
4996
+ columnIsNonTime,
4997
+ panelTitle = "X-Axis Controls",
4998
+ supportName = true,
4999
+ supportSort,
5000
+ supportSetType
5001
+ }) => {
5002
+ const onChangeInput = (field) => (event) => {
5003
+ const { value } = event.target;
5004
+ setXAxis({ ...xAxis, [field]: value || void 0 });
5005
+ };
5006
+ const onClickResetXAxis = () => {
5007
+ setXAxis(void 0);
5008
+ };
5009
+ const isXAixsNoneTime = xAxis && xAxis.column && columnIsNonTime;
5010
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5011
+ import_ui_core20.DisclosurePanel,
5012
+ {
5013
+ title: panelTitle,
5014
+ defaultOpen,
5015
+ containerClassName: "w-full bg-default-bg",
5016
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-icontent flex flex-wrap gap-[10px]", children: [
5017
+ supportName && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "inline-flex h-8", children: [
5018
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Name" }),
5019
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5020
+ "input",
5021
+ {
5022
+ type: "text",
5023
+ className: "sm:text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 w-40 rounded-r-md",
5024
+ value: xAxis?.name,
5025
+ placeholder: "Axis Name",
5026
+ onChange: onChangeInput("name")
5027
+ }
5028
+ )
5029
+ ] }),
5030
+ supportSetType && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "inline-flex h-8", children: [
5031
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "sm:text-icontent border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-2", children: [
5032
+ "X-Axis Type",
5033
+ " ",
5034
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5035
+ import_ui_core20.PopoverTooltip,
5036
+ {
5037
+ strategy: "fixed",
5038
+ hideArrow: true,
5039
+ placementOption: "bottom",
5040
+ text: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-text-foreground max-w-[300px] p-2", children: [
5041
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-medium", children: "Discrete axis" }),
5042
+ " displays",
5043
+ " ",
5044
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-primary-600", children: "discrete values evenly" }),
5045
+ ", while ",
5046
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-medium", children: "Continuous axis" }),
5047
+ " ",
5048
+ "shows",
5049
+ " ",
5050
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-primary-600", children: "continuous time series" }),
5051
+ " ",
5052
+ "and",
5053
+ " ",
5054
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-primary-600", children: "auto-fills missing time points" })
5055
+ ] }),
5056
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lu6.LuInfo, { className: "text-text-foreground-secondary h-4 w-4" })
5057
+ }
5058
+ )
5059
+ ] }),
5060
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5061
+ TypeSelect,
5062
+ {
5063
+ className: "h-8 w-40",
5064
+ buttonClassName: "h-full border-main rounded-l-none items-center inline-flex items-center",
5065
+ value: xAxis?.type || "time",
5066
+ onChange: (val) => {
5067
+ setXAxis({ ...xAxis, type: val });
5068
+ },
5069
+ options: [
5070
+ { label: "Continuous", value: "time" },
5071
+ { label: "Discrete", value: "category" }
5072
+ ]
5073
+ }
5074
+ )
5075
+ ] }),
5076
+ columnSelect && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "inline-flex h-8", children: [
5077
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AddonLabel, { className: "rounded-l-md border px-2", children: "Column" }),
5078
+ columnSelect
5079
+ ] }),
5080
+ supportSort && isXAixsNoneTime && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "inline-flex h-8", children: [
5081
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Sort By" }),
5082
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5083
+ SortSelect,
5084
+ {
5085
+ className: "h-8 w-20 leading-8",
5086
+ buttonClassName: "h-full border-main rounded-none inline-flex items-center",
5087
+ options: sortByItems2,
5088
+ value: xAxis?.sort?.sortBy,
5089
+ onChange: (value) => {
5090
+ setXAxis({
5091
+ ...xAxis,
5092
+ sort: { ...xAxis?.sort, sortBy: value }
5093
+ });
5094
+ },
5095
+ placeholder: "Sort By"
5096
+ }
5097
+ ),
5098
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5099
+ OrderSelect,
5100
+ {
5101
+ className: "h-8 w-40 leading-8",
5102
+ buttonClassName: "h-full border-l-0 border-main rounded-l-none inline-flex items-center",
5103
+ options: orderItems2,
5104
+ value: xAxis?.sort?.orderDesc,
5105
+ onChange: (value) => {
5106
+ setXAxis({
5107
+ ...xAxis,
5108
+ sort: { ...xAxis?.sort, orderDesc: value }
5109
+ });
5110
+ },
5111
+ placeholder: "Sort Order"
5112
+ }
5113
+ )
5114
+ ] }),
5115
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5116
+ import_ui_core20.Button,
5117
+ {
5118
+ type: "button",
5119
+ role: "link",
5120
+ onClick: onClickResetXAxis,
5121
+ className: "h-8",
5122
+ children: "Reset"
5123
+ }
5124
+ )
5125
+ ] })
5126
+ }
5127
+ );
5128
+ };
5129
+
5130
+ // src/charts/options/MarkerControls.tsx
5131
+ var import_immer11 = require("immer");
5132
+ var import_lu7 = require("react-icons/lu");
5133
+ var import_ui_core21 = require("@sentio/ui-core");
5134
+ var import_jsx_runtime35 = require("react/jsx-runtime");
5135
+ var labelCls = "inline-flex items-center border border-r-0 sm:text-icontent border-main bg-gray-50 px-2 rounded-l-md";
5136
+ var inputCls = "border focus:border-primary-500 rounded-r-md sm:text-icontent border-main w-28 hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30";
5137
+ function MarkerInput({
5138
+ marker,
5139
+ label,
5140
+ onChange,
5141
+ onRemove
5142
+ }) {
5143
+ const _onChange = (field, value) => {
5144
+ onChange(
5145
+ (0, import_immer11.produce)(marker, (draft) => {
5146
+ ;
5147
+ draft[field] = value;
5148
+ })
5149
+ );
5150
+ };
5151
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-[10px]", children: [
5152
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "inline-flex h-8", children: [
5153
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: labelCls, children: [
5154
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pr-2", children: label }),
5155
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
5156
+ "select",
5157
+ {
5158
+ className: "sm:text-ilabel border-main text-text-foreground inline-flex h-full items-center border border-b-0 border-t-0 bg-gray-50 p-0 pl-4 pr-7 focus:border-transparent focus:ring-inset",
5159
+ value: marker.type,
5160
+ onChange: (e) => _onChange("type", e.target.value),
5161
+ children: [
5162
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "LINE", children: "horizontal line" }),
5163
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "LINEX", children: "vertical line" })
5164
+ ]
5165
+ }
5166
+ ),
5167
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pl-2", children: "at" })
5168
+ ] }),
5169
+ marker.type === "LINEX" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5170
+ "input",
5171
+ {
5172
+ className: inputCls,
5173
+ type: "text",
5174
+ value: marker.valueX,
5175
+ placeholder: "YYYY-MM-DD",
5176
+ onChange: (e) => _onChange("valueX", e.target.value)
5177
+ }
5178
+ ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5179
+ "input",
5180
+ {
5181
+ className: inputCls,
5182
+ type: "text",
5183
+ value: marker.value,
5184
+ onChange: (e) => _onChange("value", e.target.value)
5185
+ }
5186
+ )
5187
+ ] }),
5188
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "inline-flex h-8", children: [
5189
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: labelCls, children: "Color" }),
5190
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative", children: [
5191
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "absolute inset-0 flex w-8 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-4 w-4", style: { background: marker.color } }) }),
5192
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5193
+ "input",
5194
+ {
5195
+ className: inputCls + " pl-8",
5196
+ type: "text",
5197
+ value: marker.color,
5198
+ onChange: (e) => _onChange("color", e.target.value)
5199
+ }
5200
+ )
5201
+ ] })
5202
+ ] }),
5203
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "inline-flex h-8", children: [
5204
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: labelCls, children: "Label" }),
5205
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5206
+ "input",
5207
+ {
5208
+ className: inputCls,
5209
+ type: "text",
5210
+ value: marker.label,
5211
+ onChange: (e) => _onChange("label", e.target.value)
5212
+ }
5213
+ )
5214
+ ] }),
5215
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5216
+ "button",
5217
+ {
5218
+ type: "button",
5219
+ className: "ml-2 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-gray-800 hover:bg-red-600",
5220
+ "aria-label": "Remove marker",
5221
+ onClick: onRemove,
5222
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5223
+ import_lu7.LuMinus,
5224
+ {
5225
+ className: "dark:text-default-bg h-3 w-3 text-white",
5226
+ "aria-hidden": "true"
5227
+ }
5228
+ )
5229
+ }
5230
+ )
5231
+ ] });
5232
+ }
5233
+ var DEFAULT_MARKER = { value: 0, color: "#ff0000", label: "" };
5234
+ function MarkerControls({ markers, onChange }) {
5235
+ const _markers = markers?.length ? markers : [];
5236
+ const onAdd = () => {
5237
+ onChange(
5238
+ (0, import_immer11.produce)(_markers, (draft) => {
5239
+ draft.push(DEFAULT_MARKER);
5240
+ })
5241
+ );
5242
+ };
5243
+ const onRemove = (index) => {
5244
+ onChange(
5245
+ (0, import_immer11.produce)(_markers, (draft) => {
5246
+ draft.splice(index, 1);
5247
+ })
5248
+ );
5249
+ };
5250
+ const _onChange = (index, marker) => {
5251
+ onChange(
5252
+ (0, import_immer11.produce)(_markers, (draft) => {
5253
+ draft[index] = marker;
5254
+ })
5255
+ );
5256
+ };
5257
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5258
+ import_ui_core21.DisclosurePanel,
5259
+ {
5260
+ title: "Markers",
5261
+ containerClassName: "w-full bg-default-bg",
5262
+ defaultOpen: true,
5263
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-2", children: [
5264
+ _markers.map((marker, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5265
+ MarkerInput,
5266
+ {
5267
+ marker,
5268
+ label: String.fromCharCode(65 + index % 26),
5269
+ onChange: (v) => _onChange(index, v),
5270
+ onRemove: () => onRemove(index)
5271
+ },
5272
+ index
5273
+ )),
5274
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_ui_core21.Button, { type: "button", onClick: onAdd, children: [
5275
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lu7.LuPlus, { className: "h-4 w-4", "aria-hidden": "true" }),
5276
+ "Add Marker"
5277
+ ] }) })
5278
+ ] })
5279
+ }
5280
+ );
5281
+ }
5282
+
5283
+ // src/charts/options/DataControls.tsx
5284
+ var import_immer12 = require("immer");
5285
+ var import_lodash9 = require("lodash");
5286
+ var import_ui_core22 = require("@sentio/ui-core");
5287
+ var import_jsx_runtime36 = require("react/jsx-runtime");
5288
+ var defaultConfig5 = {
5289
+ seriesLimit: void 0
5290
+ };
5291
+ function DataControls({
5292
+ defaultOpen,
5293
+ onChange,
5294
+ chartConfig,
5295
+ defaultSeriesLimit = 20
5296
+ }) {
5297
+ const config = (0, import_lodash9.defaults)(chartConfig?.dataConfig, defaultConfig5);
5298
+ const currentSeriesLimit = config?.seriesLimit || chartConfig?.tableConfig?.rowLimit;
5299
+ function onSeriesLimitChange(e) {
5300
+ const value = parseInt(e.target.value);
5301
+ if (value > 1e3) {
5302
+ return;
5303
+ }
5304
+ config && onChange(
5305
+ (0, import_immer12.produce)(config, (draft) => {
5306
+ draft.seriesLimit = value;
5307
+ })
5308
+ );
5309
+ }
5310
+ function onKeyDown(e) {
5311
+ if (!/[0-9]/.test(e.key) && !["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab"].includes(e.key)) {
5312
+ e.preventDefault();
5313
+ }
5314
+ }
5315
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5316
+ import_ui_core22.DisclosurePanel,
5317
+ {
5318
+ title: "Data Options",
5319
+ defaultOpen,
5320
+ containerClassName: "w-full bg-default-bg",
5321
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex h-8", children: [
5322
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-3", children: "Max Series Limit" }),
5323
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5324
+ "input",
5325
+ {
5326
+ type: "number",
5327
+ max: 1e3,
5328
+ min: 20,
5329
+ className: "text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 mr-1 w-32 rounded-r-md",
5330
+ value: currentSeriesLimit ?? defaultSeriesLimit,
5331
+ onChange: onSeriesLimitChange,
5332
+ onKeyDown
5333
+ }
5334
+ )
5335
+ ] })
5336
+ }
5337
+ );
5338
+ }
5339
+
5340
+ // src/charts/options/ScatterControls.tsx
5341
+ var import_immer13 = require("immer");
5342
+ var import_lodash10 = require("lodash");
5343
+ var import_react21 = require("react");
5344
+ var import_ui_core23 = require("@sentio/ui-core");
5345
+ var import_jsx_runtime37 = require("react/jsx-runtime");
5346
+ var defaultConfig6 = {
5347
+ minSize: 5,
5348
+ maxSize: 30
5349
+ };
5350
+ function ScatterControls({
5351
+ config,
5352
+ defaultOpen,
5353
+ onChange,
5354
+ columnSelect,
5355
+ colorPicker
5356
+ }) {
5357
+ config = (0, import_lodash10.defaults)(config, defaultConfig6);
5358
+ const onSymbolSizeColumnChange = (0, import_react21.useCallback)(
5359
+ (column) => {
5360
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.symbolSize = column)));
5361
+ },
5362
+ [config, onChange]
5363
+ );
5364
+ const onSymbolColorChange = (0, import_react21.useCallback)(
5365
+ (color) => {
5366
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.color = color)));
5367
+ },
5368
+ [config, onChange]
5369
+ );
5370
+ const onMinSizeChange = (0, import_react21.useCallback)(
5371
+ (event) => {
5372
+ const value = parseInt(event.target.value) || 5;
5373
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.minSize = value)));
5374
+ },
5375
+ [config, onChange]
5376
+ );
5377
+ const onMaxSizeChange = (0, import_react21.useCallback)(
5378
+ (event) => {
5379
+ const value = parseInt(event.target.value) || 50;
5380
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.maxSize = value)));
5381
+ },
5382
+ [config, onChange]
5383
+ );
5384
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5385
+ import_ui_core23.DisclosurePanel,
5386
+ {
5387
+ title: "Scatter Chart Options",
5388
+ defaultOpen,
5389
+ containerClassName: "w-full bg-default-bg",
5390
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-4", children: [
5391
+ columnSelect && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5392
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Size By Column" }),
5393
+ columnSelect({
5394
+ value: config.symbolSize,
5395
+ onChange: onSymbolSizeColumnChange
5396
+ })
5397
+ ] }),
5398
+ colorPicker && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5399
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Size Color Mapping" }),
5400
+ colorPicker({
5401
+ value: config.color,
5402
+ onChange: onSymbolColorChange
5403
+ })
5404
+ ] }),
5405
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5406
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Min Size" }),
5407
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5408
+ "input",
5409
+ {
5410
+ name: "minSize",
5411
+ type: "number",
5412
+ className: "focus:ring-primary-600/30 focus:border-primary-600 border-main text-icontent focus:ring-3 h-8 w-24 rounded-r-md border px-2",
5413
+ value: config.minSize || 5,
5414
+ onChange: onMinSizeChange,
5415
+ min: "1",
5416
+ max: "60"
5417
+ }
5418
+ )
5419
+ ] }),
5420
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5421
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Max Size" }),
5422
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5423
+ "input",
5424
+ {
5425
+ name: "maxSize",
5426
+ type: "number",
5427
+ className: "focus:ring-primary-600/30 focus:border-primary-600 border-main focus:ring-3 h-8 w-24 rounded-r-md border px-2 text-sm",
5428
+ value: config.maxSize || 30,
5429
+ onChange: onMaxSizeChange,
5430
+ min: "1",
5431
+ max: "60"
5432
+ }
5433
+ )
5434
+ ] })
5435
+ ] })
5436
+ }
5437
+ );
5438
+ }
4592
5439
  // Annotate the CommonJS export names for ESM import in node:
4593
5440
  0 && (module.exports = {
4594
5441
  AggregateInput,
4595
5442
  AreaIcon,
4596
5443
  ArgumentInput,
4597
5444
  ArgumentType,
5445
+ BarGaugeChart,
4598
5446
  BarGaugeControls,
4599
5447
  BarGuageIcon,
4600
5448
  BarIcon,
4601
5449
  ChartLegend,
4602
5450
  ChartTooltip,
4603
5451
  ChartTypeButtonGroup,
5452
+ DataControls,
4604
5453
  EventsFunctionCategories,
4605
5454
  EventsFunctionMap,
4606
5455
  FunctionInput,
@@ -4612,14 +5461,17 @@ var ValueControls = ({
4612
5461
  LabelsInput,
4613
5462
  LineControls,
4614
5463
  LineIcon,
5464
+ MarkerControls,
4615
5465
  PieChart,
4616
5466
  PieChartControls,
4617
5467
  PieIcon,
5468
+ QueryValueChart,
4618
5469
  QueryValueIcon,
4619
5470
  ReactEChartsBase,
4620
5471
  RefreshButton,
4621
5472
  RefreshContext,
4622
5473
  ScatterChartTooltip,
5474
+ ScatterControls,
4623
5475
  ScatterIcon,
4624
5476
  SystemLabels,
4625
5477
  TableIcon,
@@ -4627,8 +5479,12 @@ var ValueControls = ({
4627
5479
  ValueFormatters,
4628
5480
  ValueOptions,
4629
5481
  ValueStringMapping,
5482
+ XAxisControls,
5483
+ YaxisControls,
4630
5484
  defaultBarGaugeConfig,
5485
+ defaultDataConfig,
4631
5486
  defaultPieConfig,
5487
+ defaultScatterConfig,
4632
5488
  defaultValueConfig,
4633
5489
  defaultValueControlsConfig,
4634
5490
  isAggrOrRollupFunction,