@databrainhq/plugin 0.15.14 → 0.15.15

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.
@@ -20,6 +20,8 @@ export type SingleValueChartProps = {
20
20
  }[];
21
21
  isEnableTruncate?: boolean;
22
22
  truncateValue?: number;
23
+ upVariant?: string;
24
+ downVariant?: string;
23
25
  };
24
26
  value: string | number;
25
27
  hideBorder?: boolean;
@@ -6,6 +6,7 @@ export type ComparisonLagProps = {
6
6
  comparisonLagSettings: ComparisonLagSettings;
7
7
  dateTimeColumnList: FloatingDropDownOption[];
8
8
  onSaveComparisonLag: () => void;
9
+ onDisableComparisonSettings?: () => void;
9
10
  } | undefined;
10
11
  type Props = {
11
12
  chartSettings: ChartSettingsType;
@@ -110,6 +110,10 @@ export type CustomSettings = {
110
110
  customUppperLimit?: number;
111
111
  customLowerLimit?: number;
112
112
  isEnableInterchange?: boolean;
113
+ comparisonBadgeColor?: {
114
+ up?: string;
115
+ down?: string;
116
+ };
113
117
  linearGaugeV2?: {
114
118
  isEnableValue?: boolean;
115
119
  isEnableLabel?: boolean;
@@ -2238,6 +2238,10 @@ const DEFAULT_CHART_SETTINGS = {
2238
2238
  isEnableFullScale: true,
2239
2239
  isEnableCustomLimits: false,
2240
2240
  isEnableTimezoneFormatting: false,
2241
+ comparisonBadgeColor: {
2242
+ up: "success",
2243
+ down: "danger"
2244
+ },
2241
2245
  repulsion: 50,
2242
2246
  linearGaugeV2: {
2243
2247
  isEnableLabel: true,
@@ -93809,7 +93813,7 @@ const getNoAxisChartOptions = ({
93809
93813
  chartAppearance,
93810
93814
  chartRef
93811
93815
  }) => {
93812
- var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib, _Jb, _Kb, _Lb, _Mb, _Nb, _Ob, _Pb, _Qb, _Rb, _Sb, _Tb, _Ub, _Vb, _Wb, _Xb, _Yb, _Zb, __b, _$b, _ac, _bc, _cc, _dc, _ec, _fc, _gc, _hc, _ic, _jc, _kc, _lc, _mc, _nc, _oc, _pc, _qc, _rc, _sc, _tc, _uc, _vc, _wc, _xc, _yc, _zc, _Ac, _Bc, _Cc, _Dc, _Ec, _Fc, _Gc, _Hc, _Ic, _Jc, _Kc, _Lc, _Mc, _Nc, _Oc, _Pc, _Qc, _Rc, _Sc, _Tc, _Uc, _Vc, _Wc, _Xc, _Yc, _Zc, __c, _$c, _ad, _bd, _cd, _dd, _ed, _fd, _gd, _hd, _id2, _jd, _kd, _ld;
93816
+ var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib, _Jb, _Kb, _Lb, _Mb, _Nb, _Ob, _Pb, _Qb, _Rb, _Sb, _Tb, _Ub, _Vb, _Wb, _Xb, _Yb, _Zb, __b, _$b, _ac, _bc, _cc, _dc, _ec, _fc, _gc, _hc, _ic, _jc, _kc, _lc, _mc, _nc, _oc, _pc, _qc, _rc, _sc, _tc, _uc, _vc, _wc, _xc, _yc, _zc, _Ac, _Bc, _Cc, _Dc, _Ec, _Fc, _Gc, _Hc, _Ic, _Jc, _Kc, _Lc, _Mc, _Nc, _Oc, _Pc, _Qc, _Rc, _Sc, _Tc, _Uc, _Vc, _Wc, _Xc, _Yc, _Zc, __c, _$c, _ad, _bd, _cd, _dd, _ed, _fd, _gd, _hd, _id2, _jd, _kd, _ld, _md, _nd, _od;
93813
93817
  const legendPosition = findLegendPosition(
93814
93818
  ((_a2 = chartAppearance == null ? void 0 : chartAppearance.chartLegend) == null ? void 0 : _a2.fixedPosition) || ((_b2 = chartOptions2.legendSettings) == null ? void 0 : _b2.fixedPosition)
93815
93819
  );
@@ -95471,15 +95475,17 @@ const getNoAxisChartOptions = ({
95471
95475
  prefix: customSettings.singleValuePrefix || "",
95472
95476
  conditionalFormatter: customSettings.singleValConditionalFormatter || [],
95473
95477
  isEnableTruncate: customSettings == null ? void 0 : customSettings.enableSingleValueTruncate,
95474
- truncateValue: customSettings == null ? void 0 : customSettings.truncateValue
95478
+ truncateValue: customSettings == null ? void 0 : customSettings.truncateValue,
95479
+ upVariant: ((_dc = customSettings == null ? void 0 : customSettings.comparisonBadgeColor) == null ? void 0 : _dc.up) || "",
95480
+ downVariant: ((_ec = customSettings == null ? void 0 : customSettings.comparisonBadgeColor) == null ? void 0 : _ec.down) || ""
95475
95481
  },
95476
95482
  value: value2,
95477
95483
  comparisonValue: isComparisonValue ? comparisonValue2 : void 0,
95478
95484
  trendLineOptions: comparisonValue2 && customSettings.isShowTrendLine ? {
95479
95485
  ...option3,
95480
- title: ((_dc = chartOptions2.customSettings) == null ? void 0 : _dc.enableTitleDesc) ? {
95481
- text: (_ec = chartOptions2.customSettings) == null ? void 0 : _ec.chartTitle,
95482
- subtext: (_fc = chartOptions2.customSettings) == null ? void 0 : _fc.chartDesc,
95486
+ title: ((_fc = chartOptions2.customSettings) == null ? void 0 : _fc.enableTitleDesc) ? {
95487
+ text: (_gc = chartOptions2.customSettings) == null ? void 0 : _gc.chartTitle,
95488
+ subtext: (_hc = chartOptions2.customSettings) == null ? void 0 : _hc.chartDesc,
95483
95489
  ...titlePosition
95484
95490
  } : {},
95485
95491
  tooltip: {
@@ -95542,11 +95548,11 @@ const getNoAxisChartOptions = ({
95542
95548
  series: [
95543
95549
  {
95544
95550
  // sort data from old to new
95545
- data: (_gc = data == null ? void 0 : data.sort((a3, b3) => {
95551
+ data: (_jc = (_ic = [...data]) == null ? void 0 : _ic.sort((a3, b3) => {
95546
95552
  const dateA = new Date(a3 == null ? void 0 : a3._timestamp).getTime();
95547
95553
  const dateB = new Date(b3 == null ? void 0 : b3._timestamp).getTime();
95548
95554
  return dateA < dateB ? -1 : 1;
95549
- })) == null ? void 0 : _gc.map((d3) => [
95555
+ })) == null ? void 0 : _jc.map((d3) => [
95550
95556
  d3 == null ? void 0 : d3._timestamp,
95551
95557
  d3 == null ? void 0 : d3[chartOptions2.singleValue || ""]
95552
95558
  ]),
@@ -95576,7 +95582,7 @@ const getNoAxisChartOptions = ({
95576
95582
  keys2.push(item.label);
95577
95583
  data2.push(item.data);
95578
95584
  });
95579
- for (let i2 = 0; i2 < ((_hc = data2[0]) == null ? void 0 : _hc.length); i2 += 1) {
95585
+ for (let i2 = 0; i2 < ((_kc = data2[0]) == null ? void 0 : _kc.length); i2 += 1) {
95580
95586
  const obj = {};
95581
95587
  for (let j2 = 0; j2 < keys2.length; j2 += 1) {
95582
95588
  obj[keys2[j2]] = data2[j2][i2];
@@ -95613,7 +95619,7 @@ const getNoAxisChartOptions = ({
95613
95619
  data2.push(item.data);
95614
95620
  }
95615
95621
  });
95616
- for (let i2 = 0; i2 < ((_ic = data2[0]) == null ? void 0 : _ic.length); i2 += 1) {
95622
+ for (let i2 = 0; i2 < ((_lc = data2[0]) == null ? void 0 : _lc.length); i2 += 1) {
95617
95623
  const obj = {};
95618
95624
  for (let j2 = 0; j2 < keys2.length; j2 += 1) {
95619
95625
  obj[keys2[j2]] = data2[j2][i2];
@@ -95708,7 +95714,7 @@ const getNoAxisChartOptions = ({
95708
95714
  case CHART_TYPES.geoMap: {
95709
95715
  let modifiedData = [];
95710
95716
  let values = [];
95711
- if ((chartOptions2 == null ? void 0 : chartOptions2.xAxis) && ((_jc = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _jc.length)) {
95717
+ if ((chartOptions2 == null ? void 0 : chartOptions2.xAxis) && ((_mc = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _mc.length)) {
95712
95718
  modifiedData = data == null ? void 0 : data.map((item) => {
95713
95719
  var _a3;
95714
95720
  return {
@@ -95741,9 +95747,9 @@ const getNoAxisChartOptions = ({
95741
95747
  });
95742
95748
  Object.assign(option3, {
95743
95749
  ...option3,
95744
- title: ((_kc = chartOptions2.customSettings) == null ? void 0 : _kc.enableTitleDesc) ? {
95745
- text: (_lc = chartOptions2.customSettings) == null ? void 0 : _lc.chartTitle,
95746
- subtext: (_mc = chartOptions2.customSettings) == null ? void 0 : _mc.chartDesc,
95750
+ title: ((_nc = chartOptions2.customSettings) == null ? void 0 : _nc.enableTitleDesc) ? {
95751
+ text: (_oc = chartOptions2.customSettings) == null ? void 0 : _oc.chartTitle,
95752
+ subtext: (_pc = chartOptions2.customSettings) == null ? void 0 : _pc.chartDesc,
95747
95753
  ...titlePosition
95748
95754
  } : {},
95749
95755
  toolbox: {
@@ -95753,7 +95759,7 @@ const getNoAxisChartOptions = ({
95753
95759
  }
95754
95760
  }
95755
95761
  },
95756
- backgroundColor: ((_nc = chartOptions2.customSettings) == null ? void 0 : _nc.enableBackgroundGradient) ? backgroundGradient : "",
95762
+ backgroundColor: ((_qc = chartOptions2.customSettings) == null ? void 0 : _qc.enableBackgroundGradient) ? backgroundGradient : "",
95757
95763
  tooltip: {
95758
95764
  trigger: "item",
95759
95765
  showDelay: 0,
@@ -95803,7 +95809,7 @@ const getNoAxisChartOptions = ({
95803
95809
  case CHART_TYPES.geoBarMap: {
95804
95810
  let modifiedData = [];
95805
95811
  let values = [];
95806
- if ((chartOptions2 == null ? void 0 : chartOptions2.xAxis) && ((_oc = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _oc.length)) {
95812
+ if ((chartOptions2 == null ? void 0 : chartOptions2.xAxis) && ((_rc = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _rc.length)) {
95807
95813
  modifiedData = data == null ? void 0 : data.map((item) => {
95808
95814
  var _a3;
95809
95815
  return {
@@ -95837,9 +95843,9 @@ const getNoAxisChartOptions = ({
95837
95843
  Object.assign(option3, {
95838
95844
  ...option3,
95839
95845
  geoOption: {
95840
- title: ((_pc = chartOptions2.customSettings) == null ? void 0 : _pc.enableTitleDesc) ? {
95841
- text: (_qc = chartOptions2.customSettings) == null ? void 0 : _qc.chartTitle,
95842
- subtext: (_rc = chartOptions2.customSettings) == null ? void 0 : _rc.chartDesc,
95846
+ title: ((_sc = chartOptions2.customSettings) == null ? void 0 : _sc.enableTitleDesc) ? {
95847
+ text: (_tc = chartOptions2.customSettings) == null ? void 0 : _tc.chartTitle,
95848
+ subtext: (_uc = chartOptions2.customSettings) == null ? void 0 : _uc.chartDesc,
95843
95849
  ...titlePosition
95844
95850
  } : {},
95845
95851
  toolbox: {
@@ -95849,7 +95855,7 @@ const getNoAxisChartOptions = ({
95849
95855
  }
95850
95856
  }
95851
95857
  },
95852
- backgroundColor: ((_sc = chartOptions2.customSettings) == null ? void 0 : _sc.enableBackgroundGradient) ? backgroundGradient : "",
95858
+ backgroundColor: ((_vc = chartOptions2.customSettings) == null ? void 0 : _vc.enableBackgroundGradient) ? backgroundGradient : "",
95853
95859
  tooltip: {
95854
95860
  trigger: "item",
95855
95861
  showDelay: 0,
@@ -95919,7 +95925,7 @@ const getNoAxisChartOptions = ({
95919
95925
  case CHART_TYPES.geoScatterMap: {
95920
95926
  let modifiedData = [];
95921
95927
  let values = [];
95922
- if (chartOptions2.xAxis && ((_tc = chartOptions2.yAxisList) == null ? void 0 : _tc.length)) {
95928
+ if (chartOptions2.xAxis && ((_wc = chartOptions2.yAxisList) == null ? void 0 : _wc.length)) {
95923
95929
  values = data == null ? void 0 : data.map((item) => {
95924
95930
  var _a3;
95925
95931
  return item[((_a3 = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _a3[0]) || ""];
@@ -95956,9 +95962,9 @@ const getNoAxisChartOptions = ({
95956
95962
  });
95957
95963
  Object.assign(option3, {
95958
95964
  ...option3,
95959
- title: ((_uc = chartOptions2.customSettings) == null ? void 0 : _uc.enableTitleDesc) ? {
95960
- text: (_vc = chartOptions2.customSettings) == null ? void 0 : _vc.chartTitle,
95961
- subtext: (_wc = chartOptions2.customSettings) == null ? void 0 : _wc.chartDesc,
95965
+ title: ((_xc = chartOptions2.customSettings) == null ? void 0 : _xc.enableTitleDesc) ? {
95966
+ text: (_yc = chartOptions2.customSettings) == null ? void 0 : _yc.chartTitle,
95967
+ subtext: (_zc = chartOptions2.customSettings) == null ? void 0 : _zc.chartDesc,
95962
95968
  ...titlePosition
95963
95969
  } : {},
95964
95970
  toolbox: {
@@ -95968,7 +95974,7 @@ const getNoAxisChartOptions = ({
95968
95974
  }
95969
95975
  }
95970
95976
  },
95971
- backgroundColor: ((_xc = chartOptions2.customSettings) == null ? void 0 : _xc.enableBackgroundGradient) ? backgroundGradient : "",
95977
+ backgroundColor: ((_Ac = chartOptions2.customSettings) == null ? void 0 : _Ac.enableBackgroundGradient) ? backgroundGradient : "",
95972
95978
  tooltip: {
95973
95979
  trigger: "item",
95974
95980
  showDelay: 0,
@@ -96036,7 +96042,7 @@ const getNoAxisChartOptions = ({
96036
96042
  case CHART_TYPES.worldMap: {
96037
96043
  let modifiedData = [];
96038
96044
  let values = [];
96039
- if ((chartOptions2 == null ? void 0 : chartOptions2.xAxis) && ((_yc = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _yc.length)) {
96045
+ if ((chartOptions2 == null ? void 0 : chartOptions2.xAxis) && ((_Bc = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _Bc.length)) {
96040
96046
  modifiedData = data == null ? void 0 : data.map((item) => {
96041
96047
  var _a3;
96042
96048
  return {
@@ -96060,7 +96066,7 @@ const getNoAxisChartOptions = ({
96060
96066
  }
96061
96067
  }
96062
96068
  },
96063
- backgroundColor: ((_zc = chartOptions2.customSettings) == null ? void 0 : _zc.enableBackgroundGradient) ? backgroundGradient : "",
96069
+ backgroundColor: ((_Cc = chartOptions2.customSettings) == null ? void 0 : _Cc.enableBackgroundGradient) ? backgroundGradient : "",
96064
96070
  tooltip: {
96065
96071
  trigger: "item",
96066
96072
  showDelay: 0,
@@ -96089,7 +96095,7 @@ const getNoAxisChartOptions = ({
96089
96095
  } : {},
96090
96096
  series: [
96091
96097
  {
96092
- name: (_Ac = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _Ac[0],
96098
+ name: (_Dc = chartOptions2 == null ? void 0 : chartOptions2.yAxisList) == null ? void 0 : _Dc[0],
96093
96099
  type: "map",
96094
96100
  roam: true,
96095
96101
  map: "world",
@@ -96108,8 +96114,8 @@ const getNoAxisChartOptions = ({
96108
96114
  break;
96109
96115
  }
96110
96116
  case CHART_TYPES.progressBar: {
96111
- const max3 = (chartOptions2 == null ? void 0 : chartOptions2.progressMaxColumn) ? (_Bc = data == null ? void 0 : data[0]) == null ? void 0 : _Bc[(chartOptions2 == null ? void 0 : chartOptions2.progressMaxColumn) || ""] : null;
96112
- const min3 = (chartOptions2 == null ? void 0 : chartOptions2.progressMinColumn) ? (_Cc = data == null ? void 0 : data[0]) == null ? void 0 : _Cc[(chartOptions2 == null ? void 0 : chartOptions2.progressMinColumn) || ""] : null;
96117
+ const max3 = (chartOptions2 == null ? void 0 : chartOptions2.progressMaxColumn) ? (_Ec = data == null ? void 0 : data[0]) == null ? void 0 : _Ec[(chartOptions2 == null ? void 0 : chartOptions2.progressMaxColumn) || ""] : null;
96118
+ const min3 = (chartOptions2 == null ? void 0 : chartOptions2.progressMinColumn) ? (_Fc = data == null ? void 0 : data[0]) == null ? void 0 : _Fc[(chartOptions2 == null ? void 0 : chartOptions2.progressMinColumn) || ""] : null;
96113
96119
  Object.assign(option3, {
96114
96120
  ...option3,
96115
96121
  tooltip: {
@@ -96139,17 +96145,17 @@ const getNoAxisChartOptions = ({
96139
96145
  show: false
96140
96146
  },
96141
96147
  axisLine: {
96142
- show: ((_Dc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Dc.hideAxisLines) ? !((_Ec = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Ec.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96148
+ show: ((_Gc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Gc.hideAxisLines) ? !((_Hc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Hc.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96143
96149
  },
96144
96150
  axisTick: {
96145
- show: ((_Fc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Fc.hideAxisLines) ? !((_Gc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Gc.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96151
+ show: ((_Ic = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Ic.hideAxisLines) ? !((_Jc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Jc.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96146
96152
  },
96147
96153
  axisLabel: {
96148
96154
  show: true,
96149
- color: ((_Hc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Hc.color) || ((_Jc = (_Ic = chartOptions2.labelSettings) == null ? void 0 : _Ic.XAxisStyle) == null ? void 0 : _Jc.color) || "#000000",
96150
- fontSize: ((_Kc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Kc.fontSize) || ((_Mc = (_Lc = chartOptions2.labelSettings) == null ? void 0 : _Lc.XAxisStyle) == null ? void 0 : _Mc.size) || 14,
96151
- fontWeight: ((_Nc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Nc.fontWeight) || ((_Pc = (_Oc = chartOptions2.labelSettings) == null ? void 0 : _Oc.XAxisStyle) == null ? void 0 : _Pc.weight) || 400,
96152
- fontFamily: ((_Qc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Qc.fontFamily) || ((_Sc = (_Rc = chartOptions2.labelSettings) == null ? void 0 : _Rc.XAxisStyle) == null ? void 0 : _Sc.family),
96155
+ color: ((_Kc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Kc.color) || ((_Mc = (_Lc = chartOptions2.labelSettings) == null ? void 0 : _Lc.XAxisStyle) == null ? void 0 : _Mc.color) || "#000000",
96156
+ fontSize: ((_Nc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Nc.fontSize) || ((_Pc = (_Oc = chartOptions2.labelSettings) == null ? void 0 : _Oc.XAxisStyle) == null ? void 0 : _Pc.size) || 14,
96157
+ fontWeight: ((_Qc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Qc.fontWeight) || ((_Sc = (_Rc = chartOptions2.labelSettings) == null ? void 0 : _Rc.XAxisStyle) == null ? void 0 : _Sc.weight) || 400,
96158
+ fontFamily: ((_Tc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Tc.fontFamily) || ((_Vc = (_Uc = chartOptions2.labelSettings) == null ? void 0 : _Uc.XAxisStyle) == null ? void 0 : _Vc.family),
96153
96159
  formatter: (value2) => {
96154
96160
  if (value2 === null || value2 === 0) {
96155
96161
  return "0";
@@ -96227,8 +96233,8 @@ const getNoAxisChartOptions = ({
96227
96233
  focus: "series"
96228
96234
  },
96229
96235
  label: {
96230
- show: !!((_Tc = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _Tc.position) || labelSettings.show,
96231
- position: ((_Uc = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _Uc.position) || labelSettings.position,
96236
+ show: !!((_Wc = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _Wc.position) || labelSettings.show,
96237
+ position: ((_Xc = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _Xc.position) || labelSettings.position,
96232
96238
  formatter(d3) {
96233
96239
  return addPrefixAndSuffix(
96234
96240
  numberFormatter(d3.data, customSettings.numberFormatter),
@@ -96284,17 +96290,17 @@ const getNoAxisChartOptions = ({
96284
96290
  show: false
96285
96291
  },
96286
96292
  axisLine: {
96287
- show: ((_Vc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Vc.hideAxisLines) ? !((_Wc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Wc.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96293
+ show: ((_Yc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Yc.hideAxisLines) ? !((_Zc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Zc.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96288
96294
  },
96289
96295
  axisTick: {
96290
- show: ((_Xc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Xc.hideAxisLines) ? !((_Yc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Yc.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96296
+ show: ((__c = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : __c.hideAxisLines) ? !((_$c = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _$c.hideAxisLines) : !(customSettings == null ? void 0 : customSettings.hideXAxisLines)
96291
96297
  },
96292
96298
  axisLabel: {
96293
96299
  show: true,
96294
- color: ((_Zc = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _Zc.color) || ((_$c = (__c = chartOptions2.labelSettings) == null ? void 0 : __c.XAxisStyle) == null ? void 0 : _$c.color) || "#000000",
96295
- fontSize: ((_ad = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _ad.fontSize) || ((_cd = (_bd = chartOptions2.labelSettings) == null ? void 0 : _bd.XAxisStyle) == null ? void 0 : _cd.size) || 14,
96296
- fontWeight: ((_dd = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _dd.fontWeight) || ((_fd = (_ed = chartOptions2.labelSettings) == null ? void 0 : _ed.XAxisStyle) == null ? void 0 : _fd.weight) || 400,
96297
- fontFamily: ((_gd = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _gd.fontFamily) || ((_id2 = (_hd = chartOptions2.labelSettings) == null ? void 0 : _hd.XAxisStyle) == null ? void 0 : _id2.family),
96300
+ color: ((_ad = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _ad.color) || ((_cd = (_bd = chartOptions2.labelSettings) == null ? void 0 : _bd.XAxisStyle) == null ? void 0 : _cd.color) || "#000000",
96301
+ fontSize: ((_dd = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _dd.fontSize) || ((_fd = (_ed = chartOptions2.labelSettings) == null ? void 0 : _ed.XAxisStyle) == null ? void 0 : _fd.size) || 14,
96302
+ fontWeight: ((_gd = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _gd.fontWeight) || ((_id2 = (_hd = chartOptions2.labelSettings) == null ? void 0 : _hd.XAxisStyle) == null ? void 0 : _id2.weight) || 400,
96303
+ fontFamily: ((_jd = chartAppearance == null ? void 0 : chartAppearance.horizontalAxis) == null ? void 0 : _jd.fontFamily) || ((_ld = (_kd = chartOptions2.labelSettings) == null ? void 0 : _kd.XAxisStyle) == null ? void 0 : _ld.family),
96298
96304
  formatter: (value2) => {
96299
96305
  if (value2 === null || value2 === 0) {
96300
96306
  return "0";
@@ -96376,7 +96382,7 @@ const getNoAxisChartOptions = ({
96376
96382
  color: "black"
96377
96383
  },
96378
96384
  symbolSize: chartHeight2 ? chartHeight2 >= 6 ? 20 : chartHeight2 >= 4 ? 10 : 5 : 20,
96379
- ...(customSettings == null ? void 0 : customSettings.isEnableLabelFormatting) && ((_jd = customSettings == null ? void 0 : customSettings.YaxislabelFormatters) == null ? void 0 : _jd.length) ? {} : {
96385
+ ...(customSettings == null ? void 0 : customSettings.isEnableLabelFormatting) && ((_md = customSettings == null ? void 0 : customSettings.YaxislabelFormatters) == null ? void 0 : _md.length) ? {} : {
96380
96386
  markArea: {
96381
96387
  silent: true,
96382
96388
  label: {
@@ -96404,8 +96410,8 @@ const getNoAxisChartOptions = ({
96404
96410
  focus: "series"
96405
96411
  },
96406
96412
  label: {
96407
- show: !!((_kd = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _kd.position) || labelSettings.show,
96408
- position: ((_ld = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _ld.position) || labelSettings.position,
96413
+ show: !!((_nd = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _nd.position) || labelSettings.show,
96414
+ position: ((_od = chartAppearance == null ? void 0 : chartAppearance.chartLabel) == null ? void 0 : _od.position) || labelSettings.position,
96409
96415
  formatter(d3) {
96410
96416
  return addPrefixAndSuffix(
96411
96417
  numberFormatter(d3.data, customSettings.numberFormatter),
@@ -159396,6 +159402,16 @@ const getValuePositioningLabelOptions = (chartType2) => {
159396
159402
  }
159397
159403
  return options2;
159398
159404
  };
159405
+ const INDICATOR_OPTIONS = [
159406
+ {
159407
+ value: "success",
159408
+ label: "Green for Up"
159409
+ },
159410
+ {
159411
+ value: "danger",
159412
+ label: "Red for Up"
159413
+ }
159414
+ ];
159399
159415
  const ChartConfigure = ({
159400
159416
  chartSettings: chartSettings2,
159401
159417
  setChartSettings,
@@ -160093,13 +160109,17 @@ const ChartConfigure = ({
160093
160109
  name: "Comparison value",
160094
160110
  enabled: (_z = chartSettings2.customSettings) == null ? void 0 : _z.comparisonValueShow,
160095
160111
  onChange: () => {
160096
- return setChartSettings((prev) => {
160097
- var _a3;
160112
+ var _a3, _b3;
160113
+ if ((_a3 = chartSettings2.customSettings) == null ? void 0 : _a3.comparisonValueShow) {
160114
+ (_b3 = comparisonLagProps == null ? void 0 : comparisonLagProps.onDisableComparisonSettings) == null ? void 0 : _b3.call(comparisonLagProps);
160115
+ }
160116
+ setChartSettings((prev) => {
160117
+ var _a4;
160098
160118
  return {
160099
160119
  ...prev,
160100
160120
  customSettings: {
160101
160121
  ...prev.customSettings,
160102
- comparisonValueShow: !((_a3 = prev.customSettings) == null ? void 0 : _a3.comparisonValueShow)
160122
+ comparisonValueShow: !((_a4 = prev.customSettings) == null ? void 0 : _a4.comparisonValueShow)
160103
160123
  }
160104
160124
  };
160105
160125
  });
@@ -160266,6 +160286,39 @@ const ChartConfigure = ({
160266
160286
  }
160267
160287
  ) })
160268
160288
  ] }),
160289
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "dbn-w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
160290
+ FloatingDropDown,
160291
+ {
160292
+ onChange: (value2) => setChartSettings((prev) => {
160293
+ var _a3;
160294
+ return {
160295
+ ...prev,
160296
+ customSettings: {
160297
+ ...prev.customSettings,
160298
+ comparisonBadgeColor: {
160299
+ ...(_a3 = prev.customSettings) == null ? void 0 : _a3.comparisonBadgeColor,
160300
+ up: value2.value,
160301
+ down: value2.value === "success" ? "danger" : "success"
160302
+ }
160303
+ }
160304
+ };
160305
+ }),
160306
+ selectedOption: INDICATOR_OPTIONS.find(
160307
+ (item) => {
160308
+ var _a3, _b3;
160309
+ return item.value === ((_b3 = (_a3 = chartSettings2 == null ? void 0 : chartSettings2.customSettings) == null ? void 0 : _a3.comparisonBadgeColor) == null ? void 0 : _b3.up);
160310
+ }
160311
+ ) || {
160312
+ value: "",
160313
+ label: ""
160314
+ },
160315
+ options: INDICATOR_OPTIONS,
160316
+ labelVariant: "static",
160317
+ buttonWidth: "100%",
160318
+ menuWidth: "100%",
160319
+ label: "Indicator Color"
160320
+ }
160321
+ ) }),
160269
160322
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$P.wrapper, children: [
160270
160323
  /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { variant: "body-text-sm", children: "Trendline" }),
160271
160324
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -168668,6 +168721,24 @@ const options = [
168668
168721
  { type: "year", label: "This Year", startOffset: 0, endOffset: 0 },
168669
168722
  { type: "all_time", label: "Life Time", startOffset: 0, endOffset: 0 }
168670
168723
  ];
168724
+ const formatDateAsUTC = (date2) => {
168725
+ if (!date2)
168726
+ return null;
168727
+ const year = date2.getUTCFullYear();
168728
+ const month = `0${date2.getUTCMonth() + 1}`.slice(-2);
168729
+ const day = `0${date2.getUTCDate()}`.slice(-2);
168730
+ return `${year}-${month}-${day}`;
168731
+ };
168732
+ const stripTimeToUTC = (date2) => {
168733
+ if (!date2)
168734
+ return null;
168735
+ const newDate = new Date(date2);
168736
+ newDate.setHours(0, 0, 0, 0);
168737
+ const utcDate = new Date(
168738
+ Date.UTC(newDate.getFullYear(), newDate.getMonth(), newDate.getDate())
168739
+ );
168740
+ return utcDate;
168741
+ };
168671
168742
  const DateRangePicker = ({
168672
168743
  label: fieldLabel2,
168673
168744
  placeholder = "Select Date Range",
@@ -168701,20 +168772,18 @@ const DateRangePicker = ({
168701
168772
  );
168702
168773
  const setOnDateChange2 = (start2, end2, timeGrain) => {
168703
168774
  if (start2 && end2) {
168704
- const startDateValue = new Date(
168705
- start2.getTime() - start2.getTimezoneOffset() * 60 * 1e3
168706
- );
168707
- const endDateValue = new Date(
168708
- end2.getTime() - end2.getTimezoneOffset() * 60 * 1e3
168709
- );
168710
- const startDateFormat = startDateValue.toISOString().slice(0, 10);
168711
- const endDateFormat = endDateValue.toISOString().slice(0, 10);
168712
- onChange == null ? void 0 : onChange({
168713
- value: `${startDateFormat} - ${endDateFormat}`,
168714
- startDate: startDateValue,
168715
- endDate: endDateValue,
168716
- timeGrainValue: timeGrain || `${startDateFormat} - ${endDateFormat}`
168717
- });
168775
+ const startDateValue = stripTimeToUTC(start2);
168776
+ const endDateValue = stripTimeToUTC(end2);
168777
+ if (startDateValue && endDateValue) {
168778
+ const startDateFormat = formatDateAsUTC(start2);
168779
+ const endDateFormat = formatDateAsUTC(end2);
168780
+ onChange == null ? void 0 : onChange({
168781
+ value: `${startDateFormat} - ${endDateFormat}`,
168782
+ startDate: startDateValue,
168783
+ endDate: endDateValue,
168784
+ timeGrainValue: timeGrain || `${startDateFormat} - ${endDateFormat}`
168785
+ });
168786
+ }
168718
168787
  }
168719
168788
  };
168720
168789
  const handleOptionClick = ({
@@ -168729,33 +168798,51 @@ const DateRangePicker = ({
168729
168798
  let start2 = /* @__PURE__ */ new Date();
168730
168799
  let end2 = /* @__PURE__ */ new Date();
168731
168800
  if (type3 === "all_time") {
168732
- start2.setFullYear(1, 0, 1);
168733
- setStartDate(start2);
168734
- setEndDate(end2);
168801
+ start2 = new Date(Date.UTC(1, 0, 1));
168802
+ end2 = new Date(
168803
+ Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())
168804
+ );
168735
168805
  } else if (type3 === "month") {
168736
168806
  if (label3 === "Last Month") {
168737
- start2 = new Date(today.getFullYear(), today.getMonth() - 1, 1);
168738
- end2 = new Date(today.getFullYear(), today.getMonth(), 0);
168807
+ start2 = new Date(
168808
+ Date.UTC(today.getFullYear(), today.getMonth() - 1, 1)
168809
+ );
168810
+ end2 = new Date(Date.UTC(today.getFullYear(), today.getMonth(), 0));
168739
168811
  } else {
168740
- start2.setMonth(start2.getMonth() + startOffset);
168812
+ start2 = new Date(
168813
+ Date.UTC(today.getFullYear(), today.getMonth() + startOffset, 1)
168814
+ );
168741
168815
  if (startOffset === 0) {
168742
- start2.setDate(1);
168816
+ start2.setUTCDate(1);
168743
168817
  }
168744
168818
  }
168745
168819
  } else if (type3 === "year") {
168746
- start2.setFullYear(start2.getFullYear() + startOffset);
168820
+ start2 = new Date(Date.UTC(today.getFullYear() + startOffset, 0, 1));
168747
168821
  if (startOffset === 0) {
168748
- start2.setMonth(0);
168749
- start2.setDate(1);
168822
+ start2.setUTCMonth(0);
168823
+ start2.setUTCDate(1);
168750
168824
  }
168751
- setStartDate(start2);
168752
- setEndDate(end2);
168825
+ end2 = new Date(
168826
+ Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())
168827
+ );
168753
168828
  } else {
168754
- start2.setDate(start2.getDate() + startOffset);
168755
- end2.setDate(end2.getDate() + endOffset);
168756
- setStartDate(start2);
168757
- setEndDate(end2);
168829
+ start2 = new Date(
168830
+ Date.UTC(
168831
+ today.getFullYear(),
168832
+ today.getMonth(),
168833
+ today.getDate() + startOffset
168834
+ )
168835
+ );
168836
+ end2 = new Date(
168837
+ Date.UTC(
168838
+ today.getFullYear(),
168839
+ today.getMonth(),
168840
+ today.getDate() + endOffset
168841
+ )
168842
+ );
168758
168843
  }
168844
+ setStartDate(start2);
168845
+ setEndDate(end2);
168759
168846
  setOnDateChange2(start2, end2, label3);
168760
168847
  (_a2 = datePickerRef.current) == null ? void 0 : _a2.click();
168761
168848
  };
@@ -168787,27 +168874,29 @@ const DateRangePicker = ({
168787
168874
  }
168788
168875
  }, [isDateReset]);
168789
168876
  const onDateSelect = (dates) => {
168790
- const [start2, end2] = dates;
168877
+ const [startD, endD] = dates;
168878
+ const start2 = startD ? stripTimeToUTC(startD) : null;
168879
+ const end2 = endD ? stripTimeToUTC(endD) : null;
168791
168880
  if (!isEnableSingleDate) {
168792
168881
  if (start2) {
168793
- const startDateFormat = start2.toISOString().slice(0, 10);
168794
- const endDateFormat = endDate == null ? void 0 : endDate.toISOString().slice(0, 10);
168882
+ const startDateFormat = formatDateAsUTC(start2);
168883
+ const endDateFormat = formatDateAsUTC(end2);
168795
168884
  setTimeGrainValue(`${startDateFormat} - ${endDateFormat}`);
168796
168885
  setStartDate(start2);
168797
168886
  } else {
168798
168887
  setStartDate(void 0);
168799
168888
  }
168800
168889
  if (end2) {
168801
- const endDateFormat = end2.toISOString().slice(0, 10);
168802
- const startDateFormat = startDate == null ? void 0 : startDate.toISOString().slice(0, 10);
168890
+ const startDateFormat = formatDateAsUTC(start2);
168891
+ const endDateFormat = formatDateAsUTC(end2);
168803
168892
  setTimeGrainValue(`${startDateFormat} - ${endDateFormat}`);
168804
168893
  setEndDate(end2);
168805
168894
  } else
168806
168895
  setEndDate(void 0);
168807
168896
  }
168808
168897
  if (isEnableSingleDate && start2 && end2) {
168809
- const startDateFormat = start2.toISOString().slice(0, 10);
168810
- const endDateFormat = end2.toISOString().slice(0, 10);
168898
+ const startDateFormat = formatDateAsUTC(start2);
168899
+ const endDateFormat = formatDateAsUTC(end2);
168811
168900
  setTimeGrainValue(`${startDateFormat} - ${endDateFormat}`);
168812
168901
  setStartDate(start2);
168813
168902
  setEndDate(end2);
@@ -218496,9 +218585,21 @@ const SingleValueChart = ({
218496
218585
  "span",
218497
218586
  {
218498
218587
  style: changeVariableFont,
218499
- className: parseFloat(comparisonValue2.toString()) > 0 ? style.positiveComparisonText : style.negativeComparisonText,
218588
+ className: parseFloat(comparisonValue2.toString()) > 0 ? (settings2 == null ? void 0 : settings2.upVariant) && (settings2 == null ? void 0 : settings2.upVariant) === "danger" ? style.negativeComparisonText : style.positiveComparisonText : (settings2 == null ? void 0 : settings2.downVariant) && (settings2 == null ? void 0 : settings2.downVariant) === "success" ? style.positiveComparisonText : style.negativeComparisonText,
218500
218589
  children: [
218501
- parseFloat(comparisonValue2.toString()) > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Icons, { name: "arrow-up", color: "success" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Icons, { name: "arrow-down", color: "alert" }),
218590
+ parseFloat(comparisonValue2.toString()) > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
218591
+ Icons,
218592
+ {
218593
+ name: "arrow-up",
218594
+ color: (settings2 == null ? void 0 : settings2.upVariant) === "danger" ? "alert" : "success"
218595
+ }
218596
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
218597
+ Icons,
218598
+ {
218599
+ name: "arrow-down",
218600
+ color: (settings2 == null ? void 0 : settings2.downVariant) === "success" ? "success" : "alert"
218601
+ }
218602
+ ),
218502
218603
  comparisonValue2,
218503
218604
  " ",
218504
218605
  settings2 == null ? void 0 : settings2.comparisonSuffix