@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.d.mts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +362 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +332 -84
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __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,
|
|
@@ -54,6 +55,7 @@ __export(index_exports, {
|
|
|
54
55
|
PieChart: () => PieChart2,
|
|
55
56
|
PieChartControls: () => PieChartControls,
|
|
56
57
|
PieIcon: () => PieIcon_default,
|
|
58
|
+
QueryValueChart: () => QueryValueChart,
|
|
57
59
|
QueryValueIcon: () => QueryValueIcon_default,
|
|
58
60
|
ReactEChartsBase: () => ReactEChartsBase,
|
|
59
61
|
RefreshButton: () => RefreshButton,
|
|
@@ -3723,10 +3725,256 @@ ${percent}%`;
|
|
|
3723
3725
|
);
|
|
3724
3726
|
PieChart2.displayName = "PieChart";
|
|
3725
3727
|
|
|
3728
|
+
// src/charts/BarGaugeChart.tsx
|
|
3729
|
+
var import_react18 = require("react");
|
|
3730
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3731
|
+
var compareOption = { numeric: true };
|
|
3732
|
+
var BarGaugeChart = (0, import_react18.forwardRef)(
|
|
3733
|
+
(props, ref) => {
|
|
3734
|
+
const {
|
|
3735
|
+
series: input,
|
|
3736
|
+
legend,
|
|
3737
|
+
valueFormatter,
|
|
3738
|
+
config,
|
|
3739
|
+
title,
|
|
3740
|
+
minHeight,
|
|
3741
|
+
loading,
|
|
3742
|
+
style,
|
|
3743
|
+
onInitChart
|
|
3744
|
+
} = props;
|
|
3745
|
+
const [series, setSeries] = (0, import_react18.useState)([]);
|
|
3746
|
+
const [xAxis, setXAxis] = (0, import_react18.useState)();
|
|
3747
|
+
const [yAxis, setYAxis] = (0, import_react18.useState)();
|
|
3748
|
+
const isVertical = config?.barGauge?.direction === "VERTICAL";
|
|
3749
|
+
(0, import_react18.useEffect)(() => {
|
|
3750
|
+
const tmpData = input.map((s) => {
|
|
3751
|
+
const d = s.data && s.data[0];
|
|
3752
|
+
return { name: s.name, value: d && d[1] };
|
|
3753
|
+
});
|
|
3754
|
+
const sort = config?.barGauge?.sort;
|
|
3755
|
+
switch (sort?.sortBy) {
|
|
3756
|
+
case "ByName":
|
|
3757
|
+
tmpData.sort(
|
|
3758
|
+
(a, b) => sort.orderDesc ? b.name.localeCompare(a.name, void 0, compareOption) : a.name.localeCompare(b.name, void 0, compareOption)
|
|
3759
|
+
);
|
|
3760
|
+
break;
|
|
3761
|
+
case "ByValue":
|
|
3762
|
+
tmpData.sort(
|
|
3763
|
+
(a, b) => sort.orderDesc ? b.value - a.value : a.value - b.value
|
|
3764
|
+
);
|
|
3765
|
+
break;
|
|
3766
|
+
}
|
|
3767
|
+
const series2 = [
|
|
3768
|
+
{
|
|
3769
|
+
type: "bar",
|
|
3770
|
+
data: tmpData.map((d) => d.value),
|
|
3771
|
+
label: {
|
|
3772
|
+
show: config?.valueConfig ? config.valueConfig.showValueLabel : false,
|
|
3773
|
+
position: config?.barGauge?.direction == "VERTICAL" ? "top" : "right",
|
|
3774
|
+
formatter: ({ value }) => valueFormatter(value)
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
];
|
|
3778
|
+
const seriesAxis = {
|
|
3779
|
+
type: "category",
|
|
3780
|
+
data: tmpData.map((s) => s.name),
|
|
3781
|
+
axisLabel: config?.barGauge?.direction == "VERTICAL" ? { interval: 0, rotate: 30 } : {}
|
|
3782
|
+
};
|
|
3783
|
+
if (config?.xAxis?.name) {
|
|
3784
|
+
seriesAxis.name = config?.xAxis?.name;
|
|
3785
|
+
seriesAxis.nameLocation = "middle";
|
|
3786
|
+
seriesAxis.nameGap = isVertical ? 45 : 60;
|
|
3787
|
+
}
|
|
3788
|
+
const valueAxis = {
|
|
3789
|
+
type: "value",
|
|
3790
|
+
axisLabel: (
|
|
3791
|
+
// show dates on value-axis label is weird
|
|
3792
|
+
config?.valueConfig?.valueFormatter == "DateFormatter" ? void 0 : { formatter: (v) => valueFormatter(v) }
|
|
3793
|
+
)
|
|
3794
|
+
};
|
|
3795
|
+
let xAxis2, yAxis2;
|
|
3796
|
+
switch (config?.barGauge?.direction) {
|
|
3797
|
+
case "VERTICAL":
|
|
3798
|
+
xAxis2 = seriesAxis;
|
|
3799
|
+
yAxis2 = valueAxis;
|
|
3800
|
+
break;
|
|
3801
|
+
case "HORIZONTAL":
|
|
3802
|
+
default:
|
|
3803
|
+
xAxis2 = valueAxis;
|
|
3804
|
+
yAxis2 = seriesAxis;
|
|
3805
|
+
}
|
|
3806
|
+
setSeries(series2);
|
|
3807
|
+
setXAxis(xAxis2);
|
|
3808
|
+
setYAxis(yAxis2);
|
|
3809
|
+
}, [
|
|
3810
|
+
input,
|
|
3811
|
+
config?.barGauge?.calculation,
|
|
3812
|
+
config?.barGauge?.sort,
|
|
3813
|
+
config?.valueConfig?.showValueLabel,
|
|
3814
|
+
config?.xAxis?.name,
|
|
3815
|
+
isVertical,
|
|
3816
|
+
valueFormatter
|
|
3817
|
+
]);
|
|
3818
|
+
const dataZoom = (0, import_react18.useMemo)(() => {
|
|
3819
|
+
if (config?.barGauge?.direction == "HORIZONTAL") {
|
|
3820
|
+
return [
|
|
3821
|
+
{
|
|
3822
|
+
show: series[0]?.data.length > 15,
|
|
3823
|
+
type: "slider",
|
|
3824
|
+
yAxisIndex: 0,
|
|
3825
|
+
zoomLock: true,
|
|
3826
|
+
width: 8,
|
|
3827
|
+
right: 10,
|
|
3828
|
+
top: 5,
|
|
3829
|
+
bottom: 30,
|
|
3830
|
+
minValueSpan: 5,
|
|
3831
|
+
maxValueSpan: 15,
|
|
3832
|
+
orient: "vertical",
|
|
3833
|
+
handleSize: 0,
|
|
3834
|
+
showDetail: false,
|
|
3835
|
+
brushSelect: false,
|
|
3836
|
+
showDataShadow: false
|
|
3837
|
+
},
|
|
3838
|
+
{
|
|
3839
|
+
type: "inside",
|
|
3840
|
+
id: "insideY",
|
|
3841
|
+
yAxisIndex: 0,
|
|
3842
|
+
zoomOnMouseWheel: false,
|
|
3843
|
+
moveOnMouseMove: true,
|
|
3844
|
+
moveOnMouseWheel: true
|
|
3845
|
+
}
|
|
3846
|
+
];
|
|
3847
|
+
} else {
|
|
3848
|
+
return [
|
|
3849
|
+
{
|
|
3850
|
+
show: series[0]?.data.length > 25,
|
|
3851
|
+
type: "slider",
|
|
3852
|
+
xAxisIndex: 0,
|
|
3853
|
+
zoomLock: true,
|
|
3854
|
+
height: 8,
|
|
3855
|
+
bottom: 5,
|
|
3856
|
+
maxValueSpan: 25,
|
|
3857
|
+
minValueSpan: 10,
|
|
3858
|
+
handleSize: "0",
|
|
3859
|
+
showDetail: false,
|
|
3860
|
+
orient: "horizontal",
|
|
3861
|
+
brushSelect: false,
|
|
3862
|
+
showDataShadow: false
|
|
3863
|
+
},
|
|
3864
|
+
{
|
|
3865
|
+
type: "inside",
|
|
3866
|
+
id: "insideX",
|
|
3867
|
+
xAxisIndex: 0,
|
|
3868
|
+
zoomOnMouseWheel: false,
|
|
3869
|
+
moveOnMouseMove: true,
|
|
3870
|
+
moveOnMouseWheel: true
|
|
3871
|
+
}
|
|
3872
|
+
];
|
|
3873
|
+
}
|
|
3874
|
+
}, [config, series]);
|
|
3875
|
+
const options = {
|
|
3876
|
+
title: { text: title },
|
|
3877
|
+
grid: {
|
|
3878
|
+
top: title ? 48 : 16,
|
|
3879
|
+
right: 40,
|
|
3880
|
+
bottom: isVertical && config?.xAxis?.name ? 40 : 16,
|
|
3881
|
+
left: !isVertical && config?.xAxis?.name ? 40 : 16,
|
|
3882
|
+
containLabel: true
|
|
3883
|
+
},
|
|
3884
|
+
xAxis,
|
|
3885
|
+
legend: { data: legend, top: -1e4, left: -1e4 },
|
|
3886
|
+
toolbox: { show: false },
|
|
3887
|
+
yAxis,
|
|
3888
|
+
dataZoom,
|
|
3889
|
+
animation: false,
|
|
3890
|
+
series,
|
|
3891
|
+
tooltip: {
|
|
3892
|
+
trigger: "axis",
|
|
3893
|
+
confine: true,
|
|
3894
|
+
extraCssText: "max-width: 50%; max-height: 50vh; overflow-y: auto;"
|
|
3895
|
+
}
|
|
3896
|
+
};
|
|
3897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3898
|
+
ReactEChartsBase,
|
|
3899
|
+
{
|
|
3900
|
+
ref,
|
|
3901
|
+
loading,
|
|
3902
|
+
option: options,
|
|
3903
|
+
minHeight,
|
|
3904
|
+
style,
|
|
3905
|
+
noLegend: true,
|
|
3906
|
+
onInitChart
|
|
3907
|
+
}
|
|
3908
|
+
) });
|
|
3909
|
+
}
|
|
3910
|
+
);
|
|
3911
|
+
BarGaugeChart.displayName = "BarGaugeChart";
|
|
3912
|
+
|
|
3913
|
+
// src/charts/QueryValueChart.tsx
|
|
3914
|
+
var import_react19 = require("react");
|
|
3915
|
+
var import_react_resize_detector4 = require("react-resize-detector");
|
|
3916
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3917
|
+
var QueryValueChart = (0, import_react19.forwardRef)(
|
|
3918
|
+
(props, ref) => {
|
|
3919
|
+
const {
|
|
3920
|
+
series,
|
|
3921
|
+
valueText,
|
|
3922
|
+
textColor,
|
|
3923
|
+
backgroundColor,
|
|
3924
|
+
minHeight,
|
|
3925
|
+
loading,
|
|
3926
|
+
style,
|
|
3927
|
+
onInitChart
|
|
3928
|
+
} = props;
|
|
3929
|
+
const { width, height, ref: ref2 } = (0, import_react_resize_detector4.useResizeDetector)();
|
|
3930
|
+
const fontSize = (0, import_react19.useMemo)(() => {
|
|
3931
|
+
return Math.min(
|
|
3932
|
+
(width || 0) / String(valueText).length,
|
|
3933
|
+
(height || 0) / 1.5
|
|
3934
|
+
);
|
|
3935
|
+
}, [width, height, valueText]);
|
|
3936
|
+
const options = {
|
|
3937
|
+
backgroundColor,
|
|
3938
|
+
grid: { top: 0, right: 0, bottom: 0, left: 0 },
|
|
3939
|
+
toolbox: { show: false },
|
|
3940
|
+
animation: false,
|
|
3941
|
+
series,
|
|
3942
|
+
xAxis: { type: "time", show: false },
|
|
3943
|
+
yAxis: { type: "value", show: false },
|
|
3944
|
+
legend: { show: false },
|
|
3945
|
+
graphic: {
|
|
3946
|
+
type: "text",
|
|
3947
|
+
z: 100,
|
|
3948
|
+
left: "center",
|
|
3949
|
+
top: "middle",
|
|
3950
|
+
style: {
|
|
3951
|
+
text: valueText,
|
|
3952
|
+
fontSize,
|
|
3953
|
+
stroke: textColor,
|
|
3954
|
+
fill: textColor
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
};
|
|
3958
|
+
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)(
|
|
3959
|
+
ReactEChartsBase,
|
|
3960
|
+
{
|
|
3961
|
+
ref,
|
|
3962
|
+
loading,
|
|
3963
|
+
option: options,
|
|
3964
|
+
minHeight,
|
|
3965
|
+
style,
|
|
3966
|
+
noLegend: true,
|
|
3967
|
+
onInitChart
|
|
3968
|
+
}
|
|
3969
|
+
) }) });
|
|
3970
|
+
}
|
|
3971
|
+
);
|
|
3972
|
+
QueryValueChart.displayName = "QueryValueChart";
|
|
3973
|
+
|
|
3726
3974
|
// src/charts/options/LineControls.tsx
|
|
3727
3975
|
var import_immer4 = require("immer");
|
|
3728
3976
|
var import_ui_core11 = require("@sentio/ui-core");
|
|
3729
|
-
var
|
|
3977
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3730
3978
|
var lineStyles = [
|
|
3731
3979
|
{ label: "Solid", value: "Solid" },
|
|
3732
3980
|
{ label: "Dotted", value: "Dotted" }
|
|
@@ -3746,13 +3994,13 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
|
|
|
3746
3994
|
})
|
|
3747
3995
|
);
|
|
3748
3996
|
};
|
|
3749
|
-
return /* @__PURE__ */ (0,
|
|
3997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3750
3998
|
import_ui_core11.DisclosurePanel,
|
|
3751
3999
|
{
|
|
3752
4000
|
title: "Line style",
|
|
3753
4001
|
containerClassName: "w-full bg-default-bg",
|
|
3754
|
-
children: /* @__PURE__ */ (0,
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
4002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3756
4004
|
import_ui_core11.NewButtonGroup,
|
|
3757
4005
|
{
|
|
3758
4006
|
buttons: lineStyles,
|
|
@@ -3761,7 +4009,7 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
|
|
|
3761
4009
|
small: true
|
|
3762
4010
|
}
|
|
3763
4011
|
),
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
4012
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3765
4013
|
import_ui_core11.Checkbox,
|
|
3766
4014
|
{
|
|
3767
4015
|
label: "Smooth Curves",
|
|
@@ -3775,16 +4023,16 @@ var LineControls = ({ config, defaultOpen, onChange }) => {
|
|
|
3775
4023
|
};
|
|
3776
4024
|
|
|
3777
4025
|
// src/charts/options/LabelControls.tsx
|
|
3778
|
-
var
|
|
4026
|
+
var import_react20 = require("react");
|
|
3779
4027
|
var import_immer5 = require("immer");
|
|
3780
4028
|
var import_ui_core12 = require("@sentio/ui-core");
|
|
3781
|
-
var
|
|
4029
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3782
4030
|
var initialConfig = {
|
|
3783
4031
|
columns: [],
|
|
3784
4032
|
alias: ""
|
|
3785
4033
|
};
|
|
3786
4034
|
var LabelControls = ({ config, setConfig, defaultOpen }) => {
|
|
3787
|
-
(0,
|
|
4035
|
+
(0, import_react20.useEffect)(() => {
|
|
3788
4036
|
if (config?.columns && config.columns.length > 0 && !config.alias) {
|
|
3789
4037
|
const aliasParts = [];
|
|
3790
4038
|
config.columns.forEach((colConfig) => {
|
|
@@ -3814,31 +4062,31 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
|
|
|
3814
4062
|
})
|
|
3815
4063
|
);
|
|
3816
4064
|
};
|
|
3817
|
-
const _defaultOpen = (0,
|
|
4065
|
+
const _defaultOpen = (0, import_react20.useMemo)(() => {
|
|
3818
4066
|
if (defaultOpen) {
|
|
3819
4067
|
return true;
|
|
3820
4068
|
}
|
|
3821
4069
|
return config?.alias !== "" || config?.columns && config.columns.length > 0;
|
|
3822
4070
|
}, [config, defaultOpen]);
|
|
3823
|
-
return /* @__PURE__ */ (0,
|
|
4071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3824
4072
|
import_ui_core12.DisclosurePanel,
|
|
3825
4073
|
{
|
|
3826
4074
|
title: "Label Controls",
|
|
3827
4075
|
defaultOpen: _defaultOpen,
|
|
3828
4076
|
containerClassName: "w-full bg-default-bg",
|
|
3829
|
-
children: /* @__PURE__ */ (0,
|
|
3830
|
-
/* @__PURE__ */ (0,
|
|
3831
|
-
/* @__PURE__ */ (0,
|
|
4077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "inline-flex h-8", children: [
|
|
4079
|
+
/* @__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
4080
|
"Label Alias",
|
|
3833
|
-
/* @__PURE__ */ (0,
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3834
4082
|
import_ui_core12.HelpIcon,
|
|
3835
4083
|
{
|
|
3836
|
-
text: /* @__PURE__ */ (0,
|
|
3837
|
-
/* @__PURE__ */ (0,
|
|
3838
|
-
/* @__PURE__ */ (0,
|
|
4084
|
+
text: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "text-icontent text-text-foreground", children: [
|
|
4085
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { children: "Series name override or template." }),
|
|
4086
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
3839
4087
|
"Ex.",
|
|
3840
4088
|
" ",
|
|
3841
|
-
/* @__PURE__ */ (0,
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-primary mx-1 font-semibold italic", children: "{{contract}}" }),
|
|
3842
4090
|
" ",
|
|
3843
4091
|
"will be replaced with the value of the contract label."
|
|
3844
4092
|
] })
|
|
@@ -3846,7 +4094,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
|
|
|
3846
4094
|
}
|
|
3847
4095
|
)
|
|
3848
4096
|
] }),
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
4097
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3850
4098
|
"input",
|
|
3851
4099
|
{
|
|
3852
4100
|
type: "text",
|
|
@@ -3857,7 +4105,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
|
|
|
3857
4105
|
}
|
|
3858
4106
|
)
|
|
3859
4107
|
] }),
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
4108
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3861
4109
|
import_ui_core12.Button,
|
|
3862
4110
|
{
|
|
3863
4111
|
type: "button",
|
|
@@ -3877,7 +4125,7 @@ var LabelControls = ({ config, setConfig, defaultOpen }) => {
|
|
|
3877
4125
|
var import_immer6 = require("immer");
|
|
3878
4126
|
var import_lodash5 = require("lodash");
|
|
3879
4127
|
var import_ui_core13 = require("@sentio/ui-core");
|
|
3880
|
-
var
|
|
4128
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3881
4129
|
var defaultConfig = {
|
|
3882
4130
|
pieType: "Pie",
|
|
3883
4131
|
calculation: "LAST",
|
|
@@ -3912,14 +4160,14 @@ function PieChartControls({ config, defaultOpen, onChange }) {
|
|
|
3912
4160
|
})
|
|
3913
4161
|
);
|
|
3914
4162
|
}
|
|
3915
|
-
return /* @__PURE__ */ (0,
|
|
4163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3916
4164
|
import_ui_core13.DisclosurePanel,
|
|
3917
4165
|
{
|
|
3918
4166
|
title: "Pie Chart Options",
|
|
3919
4167
|
defaultOpen,
|
|
3920
4168
|
containerClassName: "w-full bg-default-bg",
|
|
3921
|
-
children: /* @__PURE__ */ (0,
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
4169
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
4170
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "shadow-xs flex rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3923
4171
|
import_ui_core13.NewButtonGroup,
|
|
3924
4172
|
{
|
|
3925
4173
|
small: true,
|
|
@@ -3928,21 +4176,21 @@ function PieChartControls({ config, defaultOpen, onChange }) {
|
|
|
3928
4176
|
onChange: onPieTypeChange
|
|
3929
4177
|
}
|
|
3930
4178
|
) }),
|
|
3931
|
-
/* @__PURE__ */ (0,
|
|
3932
|
-
/* @__PURE__ */ (0,
|
|
3933
|
-
/* @__PURE__ */ (0,
|
|
4179
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
|
|
4180
|
+
/* @__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" }),
|
|
4181
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3934
4182
|
"select",
|
|
3935
4183
|
{
|
|
3936
4184
|
value: config.calculation,
|
|
3937
4185
|
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
4186
|
onChange: (e) => onCalculationChange(e.target.value),
|
|
3939
4187
|
children: CalculationItems.map((d) => {
|
|
3940
|
-
return /* @__PURE__ */ (0,
|
|
4188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("option", { value: d.value, children: d.label }, d.value);
|
|
3941
4189
|
})
|
|
3942
4190
|
}
|
|
3943
4191
|
)
|
|
3944
4192
|
] }),
|
|
3945
|
-
/* @__PURE__ */ (0,
|
|
4193
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3946
4194
|
import_ui_core13.Checkbox,
|
|
3947
4195
|
{
|
|
3948
4196
|
checked: config?.showValue,
|
|
@@ -3951,7 +4199,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
|
|
|
3951
4199
|
labelClassName: "whitespace-nowrap"
|
|
3952
4200
|
}
|
|
3953
4201
|
),
|
|
3954
|
-
/* @__PURE__ */ (0,
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3955
4203
|
import_ui_core13.Checkbox,
|
|
3956
4204
|
{
|
|
3957
4205
|
checked: config?.showPercent,
|
|
@@ -3960,7 +4208,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
|
|
|
3960
4208
|
labelClassName: "whitespace-nowrap"
|
|
3961
4209
|
}
|
|
3962
4210
|
),
|
|
3963
|
-
/* @__PURE__ */ (0,
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3964
4212
|
import_ui_core13.Checkbox,
|
|
3965
4213
|
{
|
|
3966
4214
|
checked: config?.absValue,
|
|
@@ -3978,7 +4226,7 @@ function PieChartControls({ config, defaultOpen, onChange }) {
|
|
|
3978
4226
|
var import_immer7 = require("immer");
|
|
3979
4227
|
var import_lodash6 = require("lodash");
|
|
3980
4228
|
var import_ui_core14 = require("@sentio/ui-core");
|
|
3981
|
-
var
|
|
4229
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3982
4230
|
var defaultConfig2 = {
|
|
3983
4231
|
direction: "HORIZONTAL",
|
|
3984
4232
|
calculation: "LAST",
|
|
@@ -4031,62 +4279,62 @@ function BarGaugeControls({ config, defaultOpen, onChange }) {
|
|
|
4031
4279
|
})
|
|
4032
4280
|
);
|
|
4033
4281
|
}
|
|
4034
|
-
return /* @__PURE__ */ (0,
|
|
4282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4035
4283
|
import_ui_core14.DisclosurePanel,
|
|
4036
4284
|
{
|
|
4037
4285
|
title: "Bar Gauge Options",
|
|
4038
4286
|
defaultOpen,
|
|
4039
4287
|
containerClassName: "w-full bg-default-bg",
|
|
4040
|
-
children: /* @__PURE__ */ (0,
|
|
4041
|
-
/* @__PURE__ */ (0,
|
|
4042
|
-
/* @__PURE__ */ (0,
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
4288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
4289
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
|
|
4290
|
+
/* @__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" }),
|
|
4291
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4044
4292
|
"select",
|
|
4045
4293
|
{
|
|
4046
4294
|
value: config.direction,
|
|
4047
4295
|
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
4296
|
onChange: (e) => onDirectionChange(e.target.value),
|
|
4049
4297
|
children: directionItems.map((d) => {
|
|
4050
|
-
return /* @__PURE__ */ (0,
|
|
4298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
|
|
4051
4299
|
})
|
|
4052
4300
|
}
|
|
4053
4301
|
)
|
|
4054
4302
|
] }),
|
|
4055
|
-
/* @__PURE__ */ (0,
|
|
4056
|
-
/* @__PURE__ */ (0,
|
|
4057
|
-
/* @__PURE__ */ (0,
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
|
|
4304
|
+
/* @__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" }),
|
|
4305
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4058
4306
|
"select",
|
|
4059
4307
|
{
|
|
4060
4308
|
value: config.calculation,
|
|
4061
4309
|
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
4310
|
onChange: (e) => onCalculationChange(e.target.value),
|
|
4063
4311
|
children: CalculationItems2.map((d) => {
|
|
4064
|
-
return /* @__PURE__ */ (0,
|
|
4312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
|
|
4065
4313
|
})
|
|
4066
4314
|
}
|
|
4067
4315
|
)
|
|
4068
4316
|
] }),
|
|
4069
|
-
/* @__PURE__ */ (0,
|
|
4070
|
-
/* @__PURE__ */ (0,
|
|
4071
|
-
/* @__PURE__ */ (0,
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "shadow-xs flex rounded-md", children: [
|
|
4318
|
+
/* @__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" }),
|
|
4319
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4072
4320
|
"select",
|
|
4073
4321
|
{
|
|
4074
4322
|
value: config?.sort?.sortBy,
|
|
4075
4323
|
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
4324
|
onChange: (e) => onSortByChange(e.target.value),
|
|
4077
4325
|
children: sortByItems.map((d) => {
|
|
4078
|
-
return /* @__PURE__ */ (0,
|
|
4326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value, children: d.label }, d.value);
|
|
4079
4327
|
})
|
|
4080
4328
|
}
|
|
4081
4329
|
),
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4330
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4083
4331
|
"select",
|
|
4084
4332
|
{
|
|
4085
4333
|
value: config?.sort?.orderDesc + "",
|
|
4086
4334
|
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
4335
|
onChange: (e) => onOrderChange(e.target.value === "true"),
|
|
4088
4336
|
children: orderItems.map((d) => {
|
|
4089
|
-
return /* @__PURE__ */ (0,
|
|
4337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: d.value + "", children: d.label }, d.label);
|
|
4090
4338
|
})
|
|
4091
4339
|
}
|
|
4092
4340
|
)
|
|
@@ -4104,7 +4352,7 @@ var import_ui_core16 = require("@sentio/ui-core");
|
|
|
4104
4352
|
var import_lu5 = require("react-icons/lu");
|
|
4105
4353
|
var import_ui_core15 = require("@sentio/ui-core");
|
|
4106
4354
|
var import_immer8 = require("immer");
|
|
4107
|
-
var
|
|
4355
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4108
4356
|
var operators = {
|
|
4109
4357
|
">": "greater than",
|
|
4110
4358
|
">=": "greater or equal",
|
|
@@ -4114,8 +4362,8 @@ var operators = {
|
|
|
4114
4362
|
"<=": "less or equal"
|
|
4115
4363
|
};
|
|
4116
4364
|
var renderTreeLine = (index, isLast) => {
|
|
4117
|
-
return /* @__PURE__ */ (0,
|
|
4118
|
-
/* @__PURE__ */ (0,
|
|
4365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mr-2 flex h-12 w-3 flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex h-full w-full items-center", children: [
|
|
4366
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4119
4367
|
"div",
|
|
4120
4368
|
{
|
|
4121
4369
|
className: (0, import_ui_core15.classNames)(
|
|
@@ -4124,7 +4372,7 @@ var renderTreeLine = (index, isLast) => {
|
|
|
4124
4372
|
)
|
|
4125
4373
|
}
|
|
4126
4374
|
),
|
|
4127
|
-
/* @__PURE__ */ (0,
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "h-px w-3 bg-gray-300" })
|
|
4128
4376
|
] }) });
|
|
4129
4377
|
};
|
|
4130
4378
|
function ValueStringMapping({ rules, onChange }) {
|
|
@@ -4155,31 +4403,31 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4155
4403
|
})
|
|
4156
4404
|
);
|
|
4157
4405
|
}
|
|
4158
|
-
return /* @__PURE__ */ (0,
|
|
4406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex w-full flex-col rounded-md py-2", children: [
|
|
4159
4407
|
(rules || []).map((rule, index) => {
|
|
4160
4408
|
const isLast = index === (rules || []).length - 1;
|
|
4161
|
-
return /* @__PURE__ */ (0,
|
|
4409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4162
4410
|
"div",
|
|
4163
4411
|
{
|
|
4164
4412
|
className: "text-text-foreground flex h-10 items-center py-1",
|
|
4165
4413
|
children: [
|
|
4166
4414
|
renderTreeLine(index, isLast),
|
|
4167
|
-
/* @__PURE__ */ (0,
|
|
4168
|
-
/* @__PURE__ */ (0,
|
|
4415
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center pr-3 font-medium", children: "If value is" }),
|
|
4416
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4169
4417
|
"select",
|
|
4170
4418
|
{
|
|
4171
4419
|
value: rule.comparison,
|
|
4172
4420
|
onChange: (e) => changeRule(index, "comparison", e.target.value),
|
|
4173
4421
|
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
4422
|
children: Object.entries(operators).map(([op, display]) => {
|
|
4175
|
-
return /* @__PURE__ */ (0,
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("option", { value: op, children: [
|
|
4176
4424
|
"is ",
|
|
4177
4425
|
display
|
|
4178
4426
|
] }, op);
|
|
4179
4427
|
})
|
|
4180
4428
|
}
|
|
4181
4429
|
),
|
|
4182
|
-
/* @__PURE__ */ (0,
|
|
4430
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4183
4431
|
"input",
|
|
4184
4432
|
{
|
|
4185
4433
|
type: "text",
|
|
@@ -4193,8 +4441,8 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4193
4441
|
}
|
|
4194
4442
|
}
|
|
4195
4443
|
),
|
|
4196
|
-
/* @__PURE__ */ (0,
|
|
4197
|
-
/* @__PURE__ */ (0,
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center rounded-none px-3 font-medium", children: ", then show" }),
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4198
4446
|
"input",
|
|
4199
4447
|
{
|
|
4200
4448
|
type: "text",
|
|
@@ -4208,14 +4456,14 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4208
4456
|
}
|
|
4209
4457
|
}
|
|
4210
4458
|
),
|
|
4211
|
-
/* @__PURE__ */ (0,
|
|
4459
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4212
4460
|
"button",
|
|
4213
4461
|
{
|
|
4214
4462
|
type: "button",
|
|
4215
4463
|
className: "mx-2",
|
|
4216
4464
|
"aria-label": "remove",
|
|
4217
4465
|
onClick: () => removeRule(index),
|
|
4218
|
-
children: /* @__PURE__ */ (0,
|
|
4466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4219
4467
|
import_lu5.LuTrash2,
|
|
4220
4468
|
{
|
|
4221
4469
|
className: "icon text-text-foreground-disabled",
|
|
@@ -4229,7 +4477,7 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4229
4477
|
index
|
|
4230
4478
|
);
|
|
4231
4479
|
}),
|
|
4232
|
-
/* @__PURE__ */ (0,
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4233
4481
|
import_ui_core15.Button,
|
|
4234
4482
|
{
|
|
4235
4483
|
type: "button",
|
|
@@ -4238,7 +4486,7 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4238
4486
|
"aria-label": "remove",
|
|
4239
4487
|
onClick: addRule,
|
|
4240
4488
|
children: [
|
|
4241
|
-
/* @__PURE__ */ (0,
|
|
4489
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lu5.LuPlus, { className: (0, import_ui_core15.classNames)("h-4 w-4"), "aria-hidden": "true" }),
|
|
4242
4490
|
"Add Formatting Rule"
|
|
4243
4491
|
]
|
|
4244
4492
|
}
|
|
@@ -4247,7 +4495,7 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4247
4495
|
}
|
|
4248
4496
|
|
|
4249
4497
|
// src/charts/options/ValueOptions.tsx
|
|
4250
|
-
var
|
|
4498
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4251
4499
|
var ValueFormatters = [
|
|
4252
4500
|
{ label: "Number", value: "NumberFormatter" },
|
|
4253
4501
|
{ label: "Date", value: "DateFormatter" },
|
|
@@ -4276,7 +4524,7 @@ var CurrencySymbols = [
|
|
|
4276
4524
|
var AddonLabel = ({
|
|
4277
4525
|
className,
|
|
4278
4526
|
children
|
|
4279
|
-
}) => /* @__PURE__ */ (0,
|
|
4527
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4280
4528
|
"span",
|
|
4281
4529
|
{
|
|
4282
4530
|
className: (0, import_ui_core16.classNames)(
|
|
@@ -4352,9 +4600,9 @@ var ValueOptions = ({
|
|
|
4352
4600
|
function numberAddons(style) {
|
|
4353
4601
|
switch (style) {
|
|
4354
4602
|
case "None":
|
|
4355
|
-
return /* @__PURE__ */ (0,
|
|
4356
|
-
/* @__PURE__ */ (0,
|
|
4357
|
-
/* @__PURE__ */ (0,
|
|
4603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4604
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border border-l-0", children: "Fraction Digits" }),
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4358
4606
|
"input",
|
|
4359
4607
|
{
|
|
4360
4608
|
disabled: true,
|
|
@@ -4365,9 +4613,9 @@ var ValueOptions = ({
|
|
|
4365
4613
|
] });
|
|
4366
4614
|
case "Percent":
|
|
4367
4615
|
case "Standard":
|
|
4368
|
-
return /* @__PURE__ */ (0,
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4617
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border border-x-0", children: "Fraction Digits" }),
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4371
4619
|
"input",
|
|
4372
4620
|
{
|
|
4373
4621
|
type: "number",
|
|
@@ -4381,9 +4629,9 @@ var ValueOptions = ({
|
|
|
4381
4629
|
)
|
|
4382
4630
|
] });
|
|
4383
4631
|
case "Currency":
|
|
4384
|
-
return /* @__PURE__ */ (0,
|
|
4385
|
-
/* @__PURE__ */ (0,
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4633
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border border-r-0", children: "Symbol" }),
|
|
4634
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-28 ", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4387
4635
|
import_ui_core16.ComboInput,
|
|
4388
4636
|
{
|
|
4389
4637
|
onChange: onChangeSymbol,
|
|
@@ -4396,8 +4644,8 @@ var ValueOptions = ({
|
|
|
4396
4644
|
value: config?.currencySymbol
|
|
4397
4645
|
}
|
|
4398
4646
|
) }),
|
|
4399
|
-
/* @__PURE__ */ (0,
|
|
4400
|
-
/* @__PURE__ */ (0,
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border", children: "Precision" }),
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4401
4649
|
"input",
|
|
4402
4650
|
{
|
|
4403
4651
|
type: "number",
|
|
@@ -4412,9 +4660,9 @@ var ValueOptions = ({
|
|
|
4412
4660
|
)
|
|
4413
4661
|
] });
|
|
4414
4662
|
default:
|
|
4415
|
-
return /* @__PURE__ */ (0,
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4417
|
-
/* @__PURE__ */ (0,
|
|
4663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4664
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border border-x-0", children: "Max significant digits" }),
|
|
4665
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4418
4666
|
"input",
|
|
4419
4667
|
{
|
|
4420
4668
|
type: "number",
|
|
@@ -4429,10 +4677,10 @@ var ValueOptions = ({
|
|
|
4429
4677
|
] });
|
|
4430
4678
|
}
|
|
4431
4679
|
}
|
|
4432
|
-
return /* @__PURE__ */ (0,
|
|
4433
|
-
/* @__PURE__ */ (0,
|
|
4434
|
-
/* @__PURE__ */ (0,
|
|
4435
|
-
/* @__PURE__ */ (0,
|
|
4680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4681
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex", children: [
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0", children: "Value formatter" }),
|
|
4683
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4436
4684
|
"select",
|
|
4437
4685
|
{
|
|
4438
4686
|
value: config.valueFormatter,
|
|
@@ -4442,49 +4690,49 @@ var ValueOptions = ({
|
|
|
4442
4690
|
),
|
|
4443
4691
|
onChange: (e) => onChangeFormatter(e.target.value),
|
|
4444
4692
|
children: formatters.map((d) => {
|
|
4445
|
-
return /* @__PURE__ */ (0,
|
|
4693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: d.value, children: d.label }, d.value);
|
|
4446
4694
|
})
|
|
4447
4695
|
}
|
|
4448
4696
|
),
|
|
4449
|
-
config.valueFormatter == "NumberFormatter" && /* @__PURE__ */ (0,
|
|
4450
|
-
/* @__PURE__ */ (0,
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4697
|
+
config.valueFormatter == "NumberFormatter" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4698
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border border-l-0 border-r-0", children: "Style" }),
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4452
4700
|
"select",
|
|
4453
4701
|
{
|
|
4454
4702
|
value: config.style,
|
|
4455
4703
|
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
4704
|
onChange: (e) => onStyleChange(e.target.value),
|
|
4457
4705
|
children: [
|
|
4458
|
-
/* @__PURE__ */ (0,
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4460
|
-
/* @__PURE__ */ (0,
|
|
4461
|
-
/* @__PURE__ */ (0,
|
|
4462
|
-
/* @__PURE__ */ (0,
|
|
4463
|
-
/* @__PURE__ */ (0,
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "None", children: "None" }),
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "Compact", children: "Compact" }),
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "Standard", children: "Standard" }),
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "Scientific", children: "Scientific" }),
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "Percent", children: "Percent" }),
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "Currency", children: "Currency" })
|
|
4464
4712
|
]
|
|
4465
4713
|
}
|
|
4466
4714
|
),
|
|
4467
4715
|
config.style && numberAddons(config.style)
|
|
4468
4716
|
] }),
|
|
4469
|
-
config.valueFormatter == "DateFormatter" && /* @__PURE__ */ (0,
|
|
4470
|
-
/* @__PURE__ */ (0,
|
|
4471
|
-
/* @__PURE__ */ (0,
|
|
4717
|
+
config.valueFormatter == "DateFormatter" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border border-l-0", children: "Date format" }),
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4472
4720
|
"select",
|
|
4473
4721
|
{
|
|
4474
4722
|
value: config.dateFormat,
|
|
4475
4723
|
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
4724
|
onChange: (e) => onChangeDateFormat(e.target.value),
|
|
4477
4725
|
children: dateFormats.map((d) => {
|
|
4478
|
-
return /* @__PURE__ */ (0,
|
|
4726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: d.value, children: d.label }, d.value);
|
|
4479
4727
|
})
|
|
4480
4728
|
}
|
|
4481
4729
|
)
|
|
4482
4730
|
] })
|
|
4483
4731
|
] }) }),
|
|
4484
|
-
(showPrefix || showSuffix) && /* @__PURE__ */ (0,
|
|
4485
|
-
showPrefix && /* @__PURE__ */ (0,
|
|
4486
|
-
/* @__PURE__ */ (0,
|
|
4487
|
-
/* @__PURE__ */ (0,
|
|
4732
|
+
(showPrefix || showSuffix) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-2 flex items-center gap-4", children: [
|
|
4733
|
+
showPrefix && /* @__PURE__ */ (0, import_jsx_runtime30.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: [
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Prefix" }),
|
|
4735
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4488
4736
|
"input",
|
|
4489
4737
|
{
|
|
4490
4738
|
type: "text",
|
|
@@ -4495,9 +4743,9 @@ var ValueOptions = ({
|
|
|
4495
4743
|
}
|
|
4496
4744
|
)
|
|
4497
4745
|
] }),
|
|
4498
|
-
showSuffix && /* @__PURE__ */ (0,
|
|
4499
|
-
/* @__PURE__ */ (0,
|
|
4500
|
-
/* @__PURE__ */ (0,
|
|
4746
|
+
showSuffix && /* @__PURE__ */ (0, import_jsx_runtime30.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: [
|
|
4747
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Suffix" }),
|
|
4748
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4501
4749
|
"input",
|
|
4502
4750
|
{
|
|
4503
4751
|
type: "text",
|
|
@@ -4509,7 +4757,7 @@ var ValueOptions = ({
|
|
|
4509
4757
|
)
|
|
4510
4758
|
] })
|
|
4511
4759
|
] }) }),
|
|
4512
|
-
config.valueFormatter == "StringFormatter" && /* @__PURE__ */ (0,
|
|
4760
|
+
config.valueFormatter == "StringFormatter" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4513
4761
|
ValueStringMapping,
|
|
4514
4762
|
{
|
|
4515
4763
|
rules: config.mappingRules || [],
|
|
@@ -4523,7 +4771,7 @@ var ValueOptions = ({
|
|
|
4523
4771
|
var import_lodash7 = require("lodash");
|
|
4524
4772
|
var import_ui_core17 = require("@sentio/ui-core");
|
|
4525
4773
|
var import_immer10 = require("immer");
|
|
4526
|
-
var
|
|
4774
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4527
4775
|
var defaultConfig4 = {
|
|
4528
4776
|
valueFormatter: "NumberFormatter",
|
|
4529
4777
|
showValueLabel: false,
|
|
@@ -4550,14 +4798,14 @@ var ValueControls = ({
|
|
|
4550
4798
|
function toggleTooltipTotal(checked) {
|
|
4551
4799
|
config && onChange((0, import_immer10.produce)(config, (draft) => void (draft.tooltipTotal = checked)));
|
|
4552
4800
|
}
|
|
4553
|
-
return /* @__PURE__ */ (0,
|
|
4801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4554
4802
|
import_ui_core17.DisclosurePanel,
|
|
4555
4803
|
{
|
|
4556
4804
|
title: "Value Options",
|
|
4557
4805
|
defaultOpen,
|
|
4558
4806
|
containerClassName: "w-full bg-default-bg",
|
|
4559
4807
|
children: [
|
|
4560
|
-
/* @__PURE__ */ (0,
|
|
4808
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4561
4809
|
ValueOptions,
|
|
4562
4810
|
{
|
|
4563
4811
|
onChange,
|
|
@@ -4567,8 +4815,8 @@ var ValueControls = ({
|
|
|
4567
4815
|
showSuffix
|
|
4568
4816
|
}
|
|
4569
4817
|
),
|
|
4570
|
-
/* @__PURE__ */ (0,
|
|
4571
|
-
/* @__PURE__ */ (0,
|
|
4818
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
4819
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4572
4820
|
import_ui_core17.Checkbox,
|
|
4573
4821
|
{
|
|
4574
4822
|
checked: config?.showValueLabel,
|
|
@@ -4576,7 +4824,7 @@ var ValueControls = ({
|
|
|
4576
4824
|
label: "Show value label"
|
|
4577
4825
|
}
|
|
4578
4826
|
),
|
|
4579
|
-
/* @__PURE__ */ (0,
|
|
4827
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4580
4828
|
import_ui_core17.Checkbox,
|
|
4581
4829
|
{
|
|
4582
4830
|
checked: config?.tooltipTotal,
|
|
@@ -4595,6 +4843,7 @@ var ValueControls = ({
|
|
|
4595
4843
|
AreaIcon,
|
|
4596
4844
|
ArgumentInput,
|
|
4597
4845
|
ArgumentType,
|
|
4846
|
+
BarGaugeChart,
|
|
4598
4847
|
BarGaugeControls,
|
|
4599
4848
|
BarGuageIcon,
|
|
4600
4849
|
BarIcon,
|
|
@@ -4615,6 +4864,7 @@ var ValueControls = ({
|
|
|
4615
4864
|
PieChart,
|
|
4616
4865
|
PieChartControls,
|
|
4617
4866
|
PieIcon,
|
|
4867
|
+
QueryValueChart,
|
|
4618
4868
|
QueryValueIcon,
|
|
4619
4869
|
ReactEChartsBase,
|
|
4620
4870
|
RefreshButton,
|