@databrainhq/plugin 0.7.21 → 0.7.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4139,6 +4139,42 @@ function useForm(props = {}) {
4139
4139
  _formControl.current.formState = getProxyFormState(formState, control._proxyFormState);
4140
4140
  return _formControl.current;
4141
4141
  }
4142
+ const chartOptions = "_chartOptions_ltlvy_1";
4143
+ const chartOption = "_chartOption_ltlvy_1";
4144
+ const chartOptionBtn = "_chartOptionBtn_ltlvy_13";
4145
+ const chartOptionText = "_chartOptionText_ltlvy_19";
4146
+ const chartOptionBtnSelected = "_chartOptionBtnSelected_ltlvy_25";
4147
+ const container$f = "_container_ltlvy_31";
4148
+ const field$1 = "_field_ltlvy_37";
4149
+ const fieldText = "_fieldText_ltlvy_43";
4150
+ const selectFieldContainer = "_selectFieldContainer_ltlvy_49";
4151
+ const selectField = "_selectField_ltlvy_49";
4152
+ const doneBtn = "_doneBtn_ltlvy_61";
4153
+ const measureText = "_measureText_ltlvy_67";
4154
+ const singleValueMeasure = "_singleValueMeasure_ltlvy_73";
4155
+ const plus = "_plus_ltlvy_79";
4156
+ const plusIcon = "_plusIcon_ltlvy_85";
4157
+ const form$3 = "_form_ltlvy_91";
4158
+ const chartType = "_chartType_ltlvy_97";
4159
+ var styles$A = {
4160
+ chartOptions,
4161
+ chartOption,
4162
+ chartOptionBtn,
4163
+ chartOptionText,
4164
+ chartOptionBtnSelected,
4165
+ container: container$f,
4166
+ field: field$1,
4167
+ fieldText,
4168
+ selectFieldContainer,
4169
+ selectField,
4170
+ doneBtn,
4171
+ measureText,
4172
+ singleValueMeasure,
4173
+ plus,
4174
+ plusIcon,
4175
+ form: form$3,
4176
+ chartType
4177
+ };
4142
4178
  const e$3 = typeof window == "undefined" || typeof document == "undefined";
4143
4179
  let s$5 = e$3 ? useEffect : useLayoutEffect;
4144
4180
  function s$4(e2) {
@@ -4902,37 +4938,37 @@ let xe = "div", ne = S.RenderStrategy, re = C$2(function(e2, s2) {
4902
4938
  let n2 = useContext(F) !== null, m2 = s() !== null;
4903
4939
  return React__default.createElement(React__default.Fragment, null, !n2 && m2 ? React__default.createElement(q, { ref: s$12, ...e2 }) : React__default.createElement(re, { ref: s$12, ...e2 }));
4904
4940
  }), We = Object.assign(q, { Child: Pe, Root: q });
4905
- const listBoxButton = "_listBoxButton_1mdwz_5";
4906
- const selectedOptionText = "_selectedOptionText_1mdwz_17";
4907
- const transitionDiv = "_transitionDiv_1mdwz_21";
4908
- const listboxButtonWrapper = "_listboxButtonWrapper_1mdwz_25";
4909
- const arrowicon = "_arrowicon_1mdwz_28";
4910
- const leave$1 = "_leave_1mdwz_31";
4911
- const leaveFrom$1 = "_leaveFrom_1mdwz_34";
4912
- const leaveTo$1 = "_leaveTo_1mdwz_37";
4913
- const notAvailable = "_notAvailable_1mdwz_40";
4914
- const option$1 = "_option_1mdwz_43";
4915
- const activeOption = "_activeOption_1mdwz_46";
4916
- const optionSelected = "_optionSelected_1mdwz_49";
4917
- const inactiveOption = "_inactiveOption_1mdwz_52";
4918
- const optionLabel = "_optionLabel_1mdwz_55";
4919
- const optionSubLabel = "_optionSubLabel_1mdwz_58";
4920
- const selectedLabel = "_selectedLabel_1mdwz_61";
4921
- const nonselectedLabel = "_nonselectedLabel_1mdwz_64";
4922
- const check = "_check_1mdwz_67";
4923
- const checkActive = "_checkActive_1mdwz_70";
4924
- const checkInactive = "_checkInactive_1mdwz_73";
4925
- const checkIcon$1 = "_checkIcon_1mdwz_76";
4926
- const checkIconSelected = "_checkIconSelected_1mdwz_79";
4927
- const checkIconUnselected = "_checkIconUnselected_1mdwz_82";
4928
- const loadMore$1 = "_loadMore_1mdwz_85";
4929
- const selectedList = "_selectedList_1mdwz_88";
4930
- const selectedListItem = "_selectedListItem_1mdwz_91";
4941
+ const listBoxButton = "_listBoxButton_1xd0l_5";
4942
+ const selectedOptionText = "_selectedOptionText_1xd0l_17";
4943
+ const transitionDiv = "_transitionDiv_1xd0l_21";
4944
+ const listboxButtonWrapper = "_listboxButtonWrapper_1xd0l_25";
4945
+ const arrowicon = "_arrowicon_1xd0l_28";
4946
+ const leave$1 = "_leave_1xd0l_31";
4947
+ const leaveFrom$1 = "_leaveFrom_1xd0l_34";
4948
+ const leaveTo$1 = "_leaveTo_1xd0l_37";
4949
+ const notAvailable = "_notAvailable_1xd0l_40";
4950
+ const option$1 = "_option_1xd0l_43";
4951
+ const activeOption = "_activeOption_1xd0l_46";
4952
+ const optionSelected = "_optionSelected_1xd0l_49";
4953
+ const inactiveOption = "_inactiveOption_1xd0l_52";
4954
+ const optionLabel = "_optionLabel_1xd0l_55";
4955
+ const optionSubLabel = "_optionSubLabel_1xd0l_58";
4956
+ const selectedLabel = "_selectedLabel_1xd0l_61";
4957
+ const nonselectedLabel = "_nonselectedLabel_1xd0l_64";
4958
+ const check = "_check_1xd0l_67";
4959
+ const checkActive = "_checkActive_1xd0l_70";
4960
+ const checkInactive = "_checkInactive_1xd0l_73";
4961
+ const checkIcon$1 = "_checkIcon_1xd0l_76";
4962
+ const checkIconSelected = "_checkIconSelected_1xd0l_79";
4963
+ const checkIconUnselected = "_checkIconUnselected_1xd0l_82";
4964
+ const loadMore$1 = "_loadMore_1xd0l_85";
4965
+ const selectedList = "_selectedList_1xd0l_88";
4966
+ const selectedListItem = "_selectedListItem_1xd0l_91";
4931
4967
  var style$1 = {
4932
- "listBox-label": "_listBox-label_1mdwz_1",
4933
- "listBoxButton-container": "_listBoxButton-container_1mdwz_5",
4968
+ "listBox-label": "_listBox-label_1xd0l_1",
4969
+ "listBoxButton-container": "_listBoxButton-container_1xd0l_5",
4934
4970
  listBoxButton,
4935
- "listBox-option": "_listBox-option_1mdwz_13",
4971
+ "listBox-option": "_listBox-option_1xd0l_13",
4936
4972
  selectedOptionText,
4937
4973
  transitionDiv,
4938
4974
  listboxButtonWrapper,
@@ -4962,7 +4998,7 @@ var style$1 = {
4962
4998
  const primary = "_primary_18yak_1";
4963
4999
  const secondary = "_secondary_18yak_5";
4964
5000
  const tertiary = "_tertiary_18yak_10";
4965
- var styles$A = {
5001
+ var styles$z = {
4966
5002
  primary,
4967
5003
  secondary,
4968
5004
  tertiary,
@@ -4996,14 +5032,14 @@ const Text = ({
4996
5032
  }) => {
4997
5033
  const Tag = variants[variant];
4998
5034
  return /* @__PURE__ */ jsx(Tag, {
4999
- className: classnames(styleClass === "custom" ? null : `${styles$A[styleClass]}`, className),
5035
+ className: classnames(styleClass === "custom" ? null : `${styles$z[styleClass]}`, className),
5000
5036
  onClick,
5001
5037
  style: style2,
5002
5038
  children: children2
5003
5039
  });
5004
5040
  };
5005
5041
  const search$1 = "_search_1klck_1";
5006
- var styles$z = {
5042
+ var styles$y = {
5007
5043
  "searchTab-container": "_searchTab-container_1klck_1",
5008
5044
  "searchTab-input": "_searchTab-input_1klck_5",
5009
5045
  search: search$1
@@ -5035,13 +5071,13 @@ const SearchTab = ({
5035
5071
  setSearchKeyword(keyword == null ? void 0 : keyword.toLowerCase());
5036
5072
  }, [setSearchKeyword, watch, keyword]);
5037
5073
  return /* @__PURE__ */ jsxs("div", {
5038
- className: `${styles$z["searchTab-container"]} ${className}`,
5074
+ className: `${styles$y["searchTab-container"]} ${className}`,
5039
5075
  children: [/* @__PURE__ */ jsx("input", {
5040
5076
  placeholder: "Search",
5041
5077
  ...register2("searchKeyword"),
5042
- className: styles$z["searchTab-input"]
5078
+ className: styles$y["searchTab-input"]
5043
5079
  }), /* @__PURE__ */ jsx("div", {
5044
- className: styles$z.search,
5080
+ className: styles$y.search,
5045
5081
  children: /* @__PURE__ */ jsx(iconoirSearch, {
5046
5082
  color: "#C7C7C7",
5047
5083
  width: "30px",
@@ -5181,9 +5217,7 @@ const Select = ({
5181
5217
  const HookSelect = ({
5182
5218
  control,
5183
5219
  name,
5184
- options: options2,
5185
- label: label2,
5186
- defaultValue: defaultValue2
5220
+ ...rest
5187
5221
  }) => {
5188
5222
  return /* @__PURE__ */ jsx(Controller, {
5189
5223
  control,
@@ -5194,11 +5228,9 @@ const HookSelect = ({
5194
5228
  value
5195
5229
  }
5196
5230
  }) => /* @__PURE__ */ jsx(Select, {
5231
+ ...rest,
5197
5232
  onChange,
5198
- value,
5199
- label: label2,
5200
- options: options2,
5201
- defaultValue: defaultValue2
5233
+ value
5202
5234
  })
5203
5235
  });
5204
5236
  };
@@ -5333,7 +5365,7 @@ const MultiSelect = ({
5333
5365
  onClick,
5334
5366
  children: [/* @__PURE__ */ jsx("span", {
5335
5367
  className: style$1.selectedOptionText,
5336
- children: placeHolder || "Choose charts from list"
5368
+ children: placeHolder || "Choose options from list"
5337
5369
  }), /* @__PURE__ */ jsx("span", {
5338
5370
  className: style$1.listBoxButton,
5339
5371
  children: /* @__PURE__ */ jsx(mdiChevronDown, {
@@ -5358,15 +5390,12 @@ const MultiSelect = ({
5358
5390
  className: ({
5359
5391
  selected,
5360
5392
  active
5361
- }) => `${style$1.option} ${selected || active ? style$1.optionSelected : ""}`,
5393
+ }) => classnames(selected ? style$1.optionSelected : "", active ? style$1.activeOption : "", style$1.option),
5362
5394
  value: option2.value,
5363
5395
  children: ({
5364
5396
  selected
5365
5397
  }) => /* @__PURE__ */ jsxs(Fragment, {
5366
5398
  children: [/* @__PURE__ */ jsx("span", {
5367
- className: `${style$1.optionLabel}`,
5368
- children: option2.label
5369
- }), /* @__PURE__ */ jsx("span", {
5370
5399
  className: style$1.check,
5371
5400
  children: selected ? /* @__PURE__ */ jsx("div", {
5372
5401
  className: style$1.checkIconSelected,
@@ -5376,6 +5405,9 @@ const MultiSelect = ({
5376
5405
  }) : /* @__PURE__ */ jsx("div", {
5377
5406
  className: style$1.checkIconUnselected
5378
5407
  })
5408
+ }), /* @__PURE__ */ jsx("span", {
5409
+ className: `${style$1.optionLabel}`,
5410
+ children: option2.label
5379
5411
  })]
5380
5412
  })
5381
5413
  }, option2.value)), limit <= options2.length && /* @__PURE__ */ jsx(Button, {
@@ -5428,50 +5460,6 @@ const HookMultiSelect = ({
5428
5460
  })
5429
5461
  });
5430
5462
  };
5431
- const SelectField = ({
5432
- value,
5433
- options: options2,
5434
- control
5435
- }) => {
5436
- const [yAxisValue, setYAxisValue] = useState("");
5437
- return /* @__PURE__ */ jsx(HookSelect, {
5438
- control,
5439
- label: "",
5440
- options: options2,
5441
- onChange: setYAxisValue,
5442
- name: yAxisValue ? yAxisValue : value
5443
- });
5444
- };
5445
- const chartOptions = "_chartOptions_yt3j5_1";
5446
- const chartOption = "_chartOption_yt3j5_1";
5447
- const chartOptionBtn = "_chartOptionBtn_yt3j5_13";
5448
- const chartOptionText = "_chartOptionText_yt3j5_19";
5449
- const container$f = "_container_yt3j5_25";
5450
- const field$1 = "_field_yt3j5_31";
5451
- const fieldText = "_fieldText_yt3j5_37";
5452
- const doneBtn = "_doneBtn_yt3j5_43";
5453
- const measureText = "_measureText_yt3j5_49";
5454
- const singleValueMeasure = "_singleValueMeasure_yt3j5_55";
5455
- const plus = "_plus_yt3j5_61";
5456
- const plusIcon = "_plusIcon_yt3j5_67";
5457
- const form$3 = "_form_yt3j5_73";
5458
- const chartType = "_chartType_yt3j5_79";
5459
- var styles$y = {
5460
- chartOptions,
5461
- chartOption,
5462
- chartOptionBtn,
5463
- chartOptionText,
5464
- container: container$f,
5465
- field: field$1,
5466
- fieldText,
5467
- doneBtn,
5468
- measureText,
5469
- singleValueMeasure,
5470
- plus,
5471
- plusIcon,
5472
- form: form$3,
5473
- chartType
5474
- };
5475
5463
  const SOMETHING_WENT_WRONG = "something went wrong, please try again";
5476
5464
  const CHART_TYPES = {
5477
5465
  line: "line",
@@ -5523,29 +5511,11 @@ const DESTINATIONS = {
5523
5511
  BigQuery: "BigQuery",
5524
5512
  Postges: "Postgres"
5525
5513
  };
5526
- const akarIconsCirclePlus = (props) => /* @__PURE__ */ jsx("svg", {
5527
- viewBox: "0 0 24 24",
5528
- width: "1.2em",
5529
- height: "1.2em",
5530
- ...props,
5531
- children: /* @__PURE__ */ jsxs("g", {
5532
- fill: "none",
5533
- stroke: "currentColor",
5534
- strokeWidth: 2,
5535
- children: [/* @__PURE__ */ jsx("path", {
5536
- strokeLinecap: "round",
5537
- d: "M12 8v4m0 0v4m0-4h4m-4 0H8"
5538
- }), /* @__PURE__ */ jsx("circle", {
5539
- cx: 12,
5540
- cy: 12,
5541
- r: 10
5542
- })]
5543
- })
5544
- });
5545
5514
  const ChartConfig = ({
5546
5515
  data: data2,
5547
5516
  setXAxis,
5548
5517
  xAxis,
5518
+ yAxisList,
5549
5519
  setYAxisList,
5550
5520
  chartType: chartType2,
5551
5521
  setStep,
@@ -5565,29 +5535,22 @@ const ChartConfig = ({
5565
5535
  value: "NONE",
5566
5536
  label: "NONE"
5567
5537
  });
5568
- const [selectField, setSelectField] = useState([options2 == null ? void 0 : options2[0]]);
5569
5538
  const [source, setSource] = useState("");
5570
5539
  const [target, setTarget] = useState("");
5571
5540
  const [values, setValues] = useState("");
5572
- const [count2, setCount] = useState(1);
5573
- const [showAddButton, setShowAddButton] = useState("show");
5574
- const addSelectField = () => {
5575
- if (count2 < (options2 == null ? void 0 : options2.length)) {
5576
- const val = [...selectField, options2[count2]];
5577
- setSelectField(val);
5578
- if (count2 === options2.length - 1) {
5579
- setShowAddButton("hidden");
5580
- }
5581
- }
5582
- setCount(count2 + 1);
5583
- };
5584
5541
  const {
5585
5542
  handleSubmit,
5586
- control
5543
+ control,
5544
+ setValue
5587
5545
  } = useForm();
5588
- const onSubmitOptions = (yAxisdata) => {
5589
- const list = Object.values(yAxisdata);
5590
- setYAxisList(list.filter((item) => item !== void 0 && item !== "NONE"));
5546
+ useEffect(() => {
5547
+ if (!yAxisList)
5548
+ return;
5549
+ setValue("yAxisList", yAxisList);
5550
+ }, []);
5551
+ const onSubmitOptions = (fieldValues) => {
5552
+ const list = fieldValues.yAxisList;
5553
+ setYAxisList(list.filter((item) => item && item !== "NONE"));
5591
5554
  setSettingsShow(false);
5592
5555
  };
5593
5556
  const onSubmitSnakeyValues = () => {
@@ -5595,12 +5558,12 @@ const ChartConfig = ({
5595
5558
  };
5596
5559
  if (chartType2 === SANKEY) {
5597
5560
  return /* @__PURE__ */ jsxs("div", {
5598
- className: styles$y.container,
5561
+ className: styles$A.container,
5599
5562
  children: [/* @__PURE__ */ jsxs("div", {
5600
- className: styles$y.field,
5563
+ className: styles$A.field,
5601
5564
  children: [/* @__PURE__ */ jsx(Text, {
5602
5565
  styleClass: "font-14",
5603
- className: styles$y.fieldText,
5566
+ className: styles$A.fieldText,
5604
5567
  variant: "h4",
5605
5568
  children: "Source"
5606
5569
  }), /* @__PURE__ */ jsx(Select, {
@@ -5610,10 +5573,10 @@ const ChartConfig = ({
5610
5573
  value: source
5611
5574
  })]
5612
5575
  }), /* @__PURE__ */ jsxs("div", {
5613
- className: styles$y.field,
5576
+ className: styles$A.field,
5614
5577
  children: [/* @__PURE__ */ jsx(Text, {
5615
5578
  styleClass: "font-14",
5616
- className: styles$y.fieldText,
5579
+ className: styles$A.fieldText,
5617
5580
  variant: "h4",
5618
5581
  children: "Target"
5619
5582
  }), /* @__PURE__ */ jsx(Select, {
@@ -5625,7 +5588,7 @@ const ChartConfig = ({
5625
5588
  }), /* @__PURE__ */ jsxs("div", {
5626
5589
  children: [/* @__PURE__ */ jsx(Text, {
5627
5590
  styleClass: "font-14",
5628
- className: styles$y.fieldText,
5591
+ className: styles$A.fieldText,
5629
5592
  variant: "h4",
5630
5593
  children: "Value"
5631
5594
  }), /* @__PURE__ */ jsx(Select, {
@@ -5638,7 +5601,7 @@ const ChartConfig = ({
5638
5601
  type: "submit",
5639
5602
  variant: "primary",
5640
5603
  size: "default",
5641
- className: styles$y.doneBtn,
5604
+ className: styles$A.doneBtn,
5642
5605
  onClick: () => {
5643
5606
  onSubmitSnakeyValues();
5644
5607
  setSettingsShow(false);
@@ -5650,10 +5613,10 @@ const ChartConfig = ({
5650
5613
  if (chartType2 === DOUGHNUT) {
5651
5614
  return /* @__PURE__ */ jsx(Fragment, {
5652
5615
  children: !!(chartType2 === DOUGHNUT || PIE) && /* @__PURE__ */ jsxs("div", {
5653
- className: styles$y.container,
5616
+ className: styles$A.container,
5654
5617
  children: [/* @__PURE__ */ jsx(Text, {
5655
5618
  styleClass: "font-14",
5656
- className: styles$y.field,
5619
+ className: styles$A.field,
5657
5620
  variant: "h4",
5658
5621
  children: "Dimension"
5659
5622
  }), /* @__PURE__ */ jsx(Select, {
@@ -5663,27 +5626,22 @@ const ChartConfig = ({
5663
5626
  value: xAxis
5664
5627
  }), /* @__PURE__ */ jsx(Text, {
5665
5628
  styleClass: "font-14",
5666
- className: styles$y.measureText,
5629
+ className: styles$A.measureText,
5667
5630
  variant: "h4",
5668
5631
  children: "Measure"
5669
- }), /* @__PURE__ */ jsx("div", {
5670
- className: styles$y.plus,
5671
- children: /* @__PURE__ */ jsx(akarIconsCirclePlus, {
5672
- className: `${styles$y.plusIcon} ${showAddButton}`,
5673
- onClick: () => addSelectField()
5674
- })
5675
5632
  }), /* @__PURE__ */ jsxs("form", {
5676
5633
  onSubmit: handleSubmit(onSubmitOptions),
5677
- className: styles$y.form,
5678
- children: [selectField.map((field2) => /* @__PURE__ */ jsx(SelectField, {
5679
- value: field2.value,
5634
+ className: styles$A.form,
5635
+ children: [/* @__PURE__ */ jsx(HookMultiSelect, {
5636
+ name: "yAxisList",
5680
5637
  options: options2,
5638
+ defaultValue: options2.map((option2) => option2.value),
5681
5639
  control
5682
- }, field2.value)), /* @__PURE__ */ jsx(Button, {
5640
+ }), /* @__PURE__ */ jsx(Button, {
5683
5641
  type: "submit",
5684
5642
  variant: "primary",
5685
5643
  size: "default",
5686
- className: styles$y.doneBtn,
5644
+ className: styles$A.doneBtn,
5687
5645
  children: "Done"
5688
5646
  })]
5689
5647
  })]
@@ -5691,12 +5649,12 @@ const ChartConfig = ({
5691
5649
  });
5692
5650
  }
5693
5651
  if (chartType2 === PIE) {
5694
- return /* @__PURE__ */ jsxs(Fragment, {
5695
- children: ["(", /* @__PURE__ */ jsxs("div", {
5696
- className: styles$y.container,
5652
+ return /* @__PURE__ */ jsx(Fragment, {
5653
+ children: /* @__PURE__ */ jsxs("div", {
5654
+ className: styles$A.container,
5697
5655
  children: [/* @__PURE__ */ jsx(Text, {
5698
5656
  styleClass: "font-14",
5699
- className: styles$y.field,
5657
+ className: styles$A.field,
5700
5658
  variant: "h4",
5701
5659
  children: "Dimension"
5702
5660
  }), /* @__PURE__ */ jsx(Select, {
@@ -5706,38 +5664,33 @@ const ChartConfig = ({
5706
5664
  value: xAxis
5707
5665
  }), /* @__PURE__ */ jsx(Text, {
5708
5666
  styleClass: "font-14",
5709
- className: styles$y.measureText,
5667
+ className: styles$A.measureText,
5710
5668
  variant: "h4",
5711
5669
  children: "Measure"
5712
- }), /* @__PURE__ */ jsx("div", {
5713
- className: styles$y.plus,
5714
- children: /* @__PURE__ */ jsx(akarIconsCirclePlus, {
5715
- className: `${styles$y.plusIcon} ${showAddButton}`,
5716
- onClick: () => addSelectField()
5717
- })
5718
5670
  }), /* @__PURE__ */ jsxs("form", {
5719
5671
  onSubmit: handleSubmit(onSubmitOptions),
5720
- className: styles$y.form,
5721
- children: [selectField.map((field2) => /* @__PURE__ */ jsx(SelectField, {
5722
- value: field2.value,
5672
+ className: styles$A.form,
5673
+ children: [/* @__PURE__ */ jsx(HookMultiSelect, {
5674
+ name: "yAxisList",
5723
5675
  options: options2,
5676
+ defaultValue: options2.map((option2) => option2.value),
5724
5677
  control
5725
- }, field2.value)), /* @__PURE__ */ jsx(Button, {
5678
+ }), /* @__PURE__ */ jsx(Button, {
5726
5679
  type: "submit",
5727
5680
  variant: "primary",
5728
5681
  size: "default",
5729
- className: styles$y.doneBtn,
5682
+ className: styles$A.doneBtn,
5730
5683
  children: "Done"
5731
5684
  })]
5732
5685
  })]
5733
- }), ")"]
5686
+ })
5734
5687
  });
5735
5688
  }
5736
5689
  if (chartType2 === "single value") {
5737
5690
  return /* @__PURE__ */ jsxs(Fragment, {
5738
5691
  children: [/* @__PURE__ */ jsx(Text, {
5739
5692
  styleClass: "font-14",
5740
- className: `${styles$y.singleValueMeasure}`,
5693
+ className: `${styles$A.singleValueMeasure}`,
5741
5694
  variant: "h4",
5742
5695
  children: "Measure"
5743
5696
  }), /* @__PURE__ */ jsx(Select, {
@@ -5749,7 +5702,7 @@ const ChartConfig = ({
5749
5702
  type: "button",
5750
5703
  variant: "primary",
5751
5704
  size: "default",
5752
- className: styles$y.doneBtn,
5705
+ className: styles$A.doneBtn,
5753
5706
  onClick: () => setSettingsShow(false),
5754
5707
  children: "Done"
5755
5708
  })]
@@ -5757,11 +5710,11 @@ const ChartConfig = ({
5757
5710
  }
5758
5711
  return /* @__PURE__ */ jsx(Fragment, {
5759
5712
  children: /* @__PURE__ */ jsxs("div", {
5760
- className: styles$y.container,
5713
+ className: styles$A.container,
5761
5714
  children: [chartType2 !== "gauge" && chartType2 !== BOXPLOT && chartType2 !== "table" && /* @__PURE__ */ jsxs(Fragment, {
5762
5715
  children: [/* @__PURE__ */ jsxs(Text, {
5763
5716
  styleClass: "font-14",
5764
- className: styles$y.field,
5717
+ className: styles$A.field,
5765
5718
  variant: "h4",
5766
5719
  children: [chartType2 !== "funnel" && chartType2 !== "row" && "X-axis", chartType2 === "funnel" && "Step", chartType2 === "row" && "Y-axis"]
5767
5720
  }), chartType2 === "funnel" ? /* @__PURE__ */ jsx(Select, {
@@ -5775,35 +5728,33 @@ const ChartConfig = ({
5775
5728
  onChange: setXAxis,
5776
5729
  value: xAxis
5777
5730
  })]
5778
- }), /* @__PURE__ */ jsxs("div", {
5779
- className: `${styles$y.chartType}
5780
- ${chartType2 !== "gauge" ? styles$y.measureText : ""}`,
5781
- children: [/* @__PURE__ */ jsxs(Text, {
5731
+ }), /* @__PURE__ */ jsx("div", {
5732
+ className: `${styles$A.chartType}
5733
+ ${chartType2 !== "gauge" ? styles$A.measureText : ""}`,
5734
+ children: /* @__PURE__ */ jsxs(Text, {
5782
5735
  styleClass: "font-14",
5783
5736
  variant: "h1",
5784
- className: styles$y.field,
5737
+ className: styles$A.field,
5785
5738
  children: [chartType2 !== "funnel" && chartType2 !== "gauge" && chartType2 !== "row" && chartType2 !== "boxplot" && chartType2 !== "table" && "Y-axis", (chartType2 === "funnel" || chartType2 === "gauge" || chartType2 === "boxplot" || chartType2 === "table") && "Measure", chartType2 === "row" && "X-axis"]
5786
- }), chartType2 !== "funnel" && chartType2 !== "gauge" && /* @__PURE__ */ jsx(akarIconsCirclePlus, {
5787
- className: `${styles$y.plusIcon} ${showAddButton}`,
5788
- onClick: () => addSelectField()
5789
- })]
5739
+ })
5790
5740
  }), /* @__PURE__ */ jsxs("form", {
5791
5741
  onSubmit: handleSubmit(onSubmitOptions),
5792
- className: styles$y.form,
5742
+ className: styles$A.form,
5793
5743
  children: [chartType2 === "funnel" || chartType2 === "gauge" ? /* @__PURE__ */ jsx(Select, {
5794
5744
  label: "",
5795
5745
  options: options2,
5796
5746
  onChange: setMeasure,
5797
5747
  value: measure
5798
- }) : selectField.map((field2) => /* @__PURE__ */ jsx(SelectField, {
5799
- value: field2.value,
5748
+ }) : /* @__PURE__ */ jsx(HookMultiSelect, {
5749
+ name: "yAxisList",
5800
5750
  options: options2,
5751
+ defaultValue: options2.map((option2) => option2.value),
5801
5752
  control
5802
- }, field2.value)), /* @__PURE__ */ jsx(Button, {
5753
+ }), /* @__PURE__ */ jsx(Button, {
5803
5754
  type: "submit",
5804
5755
  variant: "primary",
5805
5756
  size: "default",
5806
- className: styles$y.doneBtn,
5757
+ className: styles$A.doneBtn,
5807
5758
  children: "Done"
5808
5759
  })]
5809
5760
  })]
@@ -6033,6 +5984,7 @@ const materialSymbolsBackupTable = (props) => /* @__PURE__ */ jsx("svg", {
6033
5984
  })
6034
5985
  });
6035
5986
  const ChartModalOptions = ({
5987
+ chartType: chartType2,
6036
5988
  setChartType
6037
5989
  }) => {
6038
5990
  const chartOptions2 = [{
@@ -6094,13 +6046,13 @@ const ChartModalOptions = ({
6094
6046
  icon: materialSymbolsBackupTable
6095
6047
  }];
6096
6048
  return /* @__PURE__ */ jsx("div", {
6097
- className: styles$y.chartOptions,
6049
+ className: styles$A.chartOptions,
6098
6050
  children: chartOptions2.map((option2) => /* @__PURE__ */ jsxs("div", {
6099
- className: styles$y.chartOption,
6051
+ className: styles$A.chartOption,
6100
6052
  children: [/* @__PURE__ */ jsx(Button, {
6101
6053
  type: "button",
6102
6054
  variant: "custom",
6103
- className: styles$y.chartOptionBtn,
6055
+ className: chartType2 === option2.name.toLowerCase() ? styles$A.chartOptionBtnSelected : styles$A.chartOptionBtn,
6104
6056
  onClick: () => {
6105
6057
  setChartType(option2.name.toLowerCase());
6106
6058
  },
@@ -6113,13 +6065,27 @@ const ChartModalOptions = ({
6113
6065
  })
6114
6066
  }, option2.name), /* @__PURE__ */ jsx(Text, {
6115
6067
  variant: "p",
6116
- styleClass: "tertiary",
6117
- className: styles$y.chartOptionText,
6068
+ styleClass: "custom",
6069
+ className: styles$A.chartOptionText,
6118
6070
  children: option2.name
6119
6071
  })]
6120
6072
  }, option2.name))
6121
6073
  });
6122
6074
  };
6075
+ const SelectField = ({
6076
+ value,
6077
+ options: options2,
6078
+ control
6079
+ }) => {
6080
+ const [yAxisValue, setYAxisValue] = useState("");
6081
+ return /* @__PURE__ */ jsx(HookSelect, {
6082
+ control,
6083
+ label: "",
6084
+ options: options2,
6085
+ onChange: setYAxisValue,
6086
+ name: yAxisValue ? yAxisValue : value
6087
+ });
6088
+ };
6123
6089
  const operatorList = [
6124
6090
  {
6125
6091
  value: "=",
@@ -7617,29 +7583,40 @@ const applyTheme = (theme2) => {
7617
7583
  const root = document.documentElement;
7618
7584
  if (theme2.colors)
7619
7585
  Object.entries(theme2.colors).forEach(([key, value]) => {
7620
- root.style.setProperty(`--databrainhq-plugin-color-${key}`, `${value}`);
7586
+ if (key && value)
7587
+ root.style.setProperty(`--databrainhq-plugin-color-${key}`, `${value}`);
7621
7588
  });
7622
7589
  if (theme2.border)
7623
7590
  Object.entries(theme2.border).forEach(([key, value]) => {
7624
- root.style.setProperty(`--databrainhq-plugin-border-${key}`, `${value}`);
7591
+ if (key && value)
7592
+ root.style.setProperty(
7593
+ `--databrainhq-plugin-border-${key}`,
7594
+ `${value}`
7595
+ );
7625
7596
  });
7626
7597
  if (theme2.shadow)
7627
7598
  Object.entries(theme2.shadow).forEach(([key, value]) => {
7628
- root.style.setProperty(`--databrainhq-plugin-shadow-${key}`, `${value}`);
7599
+ if (key && value)
7600
+ root.style.setProperty(
7601
+ `--databrainhq-plugin-shadow-${key}`,
7602
+ `${value}`
7603
+ );
7629
7604
  });
7630
7605
  if (theme2.typography)
7631
7606
  Object.entries(theme2.typography).forEach(([key, value]) => {
7632
- root.style.setProperty(
7633
- `--databrainhq-plugin-typography-${key}`,
7634
- `${value}`
7635
- );
7607
+ if (key && value)
7608
+ root.style.setProperty(
7609
+ `--databrainhq-plugin-typography-${key}`,
7610
+ `${value}`
7611
+ );
7636
7612
  });
7637
7613
  if (theme2.breakpoint)
7638
7614
  Object.entries(theme2.breakpoint).forEach(([key, value]) => {
7639
- root.style.setProperty(
7640
- `--databrainhq-plugin-breakpoint-${key}`,
7641
- `${value}`
7642
- );
7615
+ if (key && value)
7616
+ root.style.setProperty(
7617
+ `--databrainhq-plugin-breakpoint-${key}`,
7618
+ `${value}`
7619
+ );
7643
7620
  });
7644
7621
  };
7645
7622
  const colors = [
@@ -81582,7 +81559,7 @@ const MetricChart = ({
81582
81559
  tableSettings,
81583
81560
  chartRef
81584
81561
  }) => {
81585
- var _a2, _b2, _c2, _d;
81562
+ var _a2, _b2, _c2, _d, _e, _f;
81586
81563
  if (chartType2 === CHART_TYPES.line) {
81587
81564
  return /* @__PURE__ */ jsx(LineChart, {
81588
81565
  data: data2,
@@ -81828,8 +81805,22 @@ const MetricChart = ({
81828
81805
  });
81829
81806
  }
81830
81807
  if (chartType2 === CHART_TYPES.gauge) {
81808
+ let modifiedData;
81809
+ if ((_e = data2.datasets) == null ? void 0 : _e.length) {
81810
+ const values = (_f = data2.datasets[0]) == null ? void 0 : _f.data;
81811
+ const convertedData = [values == null ? void 0 : values[0]];
81812
+ if (values == null ? void 0 : values.length)
81813
+ for (let i = 1; i < values.length - 1; i++) {
81814
+ convertedData.push(convertedData[i - 1] - values[i]);
81815
+ }
81816
+ convertedData.push(values == null ? void 0 : values[values.length - 1]);
81817
+ modifiedData = {
81818
+ labels: data2.labels,
81819
+ datasets: [values, convertedData]
81820
+ };
81821
+ }
81831
81822
  return /* @__PURE__ */ jsx(GaugeChart, {
81832
- gaugeData: funnelData,
81823
+ gaugeData: modifiedData,
81833
81824
  margins,
81834
81825
  legendSettings,
81835
81826
  labelSettings,
@@ -82507,29 +82498,27 @@ const Dataset = ({
82507
82498
  })]
82508
82499
  });
82509
82500
  };
82510
- const container$6 = "_container_1mqhp_1";
82511
- const header$2 = "_header_1mqhp_7";
82512
- const headerText = "_headerText_1mqhp_13";
82513
- const tab$2 = "_tab_1mqhp_19";
82514
- const tabText$1 = "_tabText_1mqhp_25";
82515
- const tabHeading = "_tabHeading_1mqhp_31";
82516
- const form = "_form_1mqhp_37";
82517
- const inputWrapper = "_inputWrapper_1mqhp_43";
82518
- const input$1 = "_input_1mqhp_43";
82519
- const selectWrapper = "_selectWrapper_1mqhp_55";
82520
- const select = "_select_1mqhp_55";
82521
- const label$1 = "_label_1mqhp_67";
82522
- const series = "_series_1mqhp_73";
82523
- const legendWrapper = "_legendWrapper_1mqhp_79";
82524
- const seriesWrapper = "_seriesWrapper_1mqhp_85";
82525
- const valueLabelWrapper = "_valueLabelWrapper_1mqhp_91";
82526
- const singleCheckBox = "_singleCheckBox_1mqhp_97";
82527
- const seriesCheck = "_seriesCheck_1mqhp_103";
82528
- const seriesCheckContainer = "_seriesCheckContainer_1mqhp_109";
82501
+ const container$6 = "_container_j5bye_1";
82502
+ const header$2 = "_header_j5bye_7";
82503
+ const tab$2 = "_tab_j5bye_13";
82504
+ const tabText$1 = "_tabText_j5bye_19";
82505
+ const tabHeading = "_tabHeading_j5bye_25";
82506
+ const form = "_form_j5bye_31";
82507
+ const inputWrapper = "_inputWrapper_j5bye_37";
82508
+ const input$1 = "_input_j5bye_37";
82509
+ const selectWrapper = "_selectWrapper_j5bye_49";
82510
+ const select = "_select_j5bye_49";
82511
+ const label$1 = "_label_j5bye_61";
82512
+ const series = "_series_j5bye_67";
82513
+ const legendWrapper = "_legendWrapper_j5bye_73";
82514
+ const seriesWrapper = "_seriesWrapper_j5bye_79";
82515
+ const valueLabelWrapper = "_valueLabelWrapper_j5bye_85";
82516
+ const singleCheckBox = "_singleCheckBox_j5bye_91";
82517
+ const seriesCheck = "_seriesCheck_j5bye_97";
82518
+ const seriesCheckContainer = "_seriesCheckContainer_j5bye_103";
82529
82519
  var styles$e = {
82530
82520
  container: container$6,
82531
82521
  header: header$2,
82532
- headerText,
82533
82522
  tab: tab$2,
82534
82523
  tabText: tabText$1,
82535
82524
  tabHeading,
@@ -82606,7 +82595,7 @@ const ChartConfigure = ({
82606
82595
  className: styles$e.container,
82607
82596
  children: [chartType2 === "table" && /* @__PURE__ */ jsxs(Fragment, {
82608
82597
  children: [/* @__PURE__ */ jsx("div", {
82609
- className: "h-[10%]",
82598
+ className: styles$e.header,
82610
82599
  children: /* @__PURE__ */ jsx(Tab, {
82611
82600
  options: tableTabs,
82612
82601
  activeTab: activeTab2,
@@ -82810,7 +82799,7 @@ const ChartConfigure = ({
82810
82799
  ...m2,
82811
82800
  marginTop: parseInt(e2.target.value, 10)
82812
82801
  })),
82813
- defaultValue: margins.marginTop
82802
+ value: margins.marginTop
82814
82803
  })
82815
82804
  }), /* @__PURE__ */ jsx("div", {
82816
82805
  className: styles$e.input,
@@ -82821,14 +82810,14 @@ const ChartConfigure = ({
82821
82810
  ...m2,
82822
82811
  marginBottom: parseInt(e2.target.value, 10)
82823
82812
  })),
82824
- defaultValue: margins.marginBottom
82813
+ value: margins.marginBottom
82825
82814
  })
82826
82815
  }), /* @__PURE__ */ jsx("div", {
82827
82816
  className: styles$e.input,
82828
82817
  children: /* @__PURE__ */ jsx(InputField, {
82829
82818
  type: "number",
82830
82819
  label: "Left",
82831
- defaultValue: margins.marginLeft,
82820
+ value: margins.marginLeft,
82832
82821
  onChange: (e2) => setMargins((m2) => ({
82833
82822
  ...m2,
82834
82823
  marginLeft: parseInt(e2.target.value, 10)
@@ -82839,7 +82828,7 @@ const ChartConfigure = ({
82839
82828
  children: /* @__PURE__ */ jsx(InputField, {
82840
82829
  type: "number",
82841
82830
  label: "Right",
82842
- defaultValue: margins.marginRight,
82831
+ value: margins.marginRight,
82843
82832
  onChange: (e2) => setMargins((m2) => ({
82844
82833
  ...m2,
82845
82834
  marginRight: parseInt(e2.target.value, 10)
@@ -82868,7 +82857,7 @@ const ChartConfigure = ({
82868
82857
  children: /* @__PURE__ */ jsx(InputField, {
82869
82858
  type: "number",
82870
82859
  label: "Top",
82871
- defaultValue: legendSettings.top,
82860
+ value: legendSettings.top,
82872
82861
  onChange: (e2) => setLegendSettings((settings2) => ({
82873
82862
  ...settings2,
82874
82863
  top: parseInt(e2.target.value, 10)
@@ -82879,7 +82868,7 @@ const ChartConfigure = ({
82879
82868
  children: /* @__PURE__ */ jsx(InputField, {
82880
82869
  type: "number",
82881
82870
  label: "Bottom",
82882
- defaultValue: legendSettings.bottom,
82871
+ value: legendSettings.bottom,
82883
82872
  onChange: (e2) => setLegendSettings((settings2) => ({
82884
82873
  ...settings2,
82885
82874
  bottom: parseInt(e2.target.value, 10)
@@ -82890,7 +82879,7 @@ const ChartConfigure = ({
82890
82879
  children: /* @__PURE__ */ jsx(InputField, {
82891
82880
  type: "number",
82892
82881
  label: "Left",
82893
- defaultValue: legendSettings.left,
82882
+ value: legendSettings.left,
82894
82883
  onChange: (e2) => setLegendSettings((settings2) => ({
82895
82884
  ...settings2,
82896
82885
  left: parseInt(e2.target.value, 10)
@@ -82901,7 +82890,7 @@ const ChartConfigure = ({
82901
82890
  children: /* @__PURE__ */ jsx(InputField, {
82902
82891
  type: "number",
82903
82892
  label: "Right",
82904
- defaultValue: legendSettings.right,
82893
+ value: legendSettings.right,
82905
82894
  onChange: (e2) => setLegendSettings((settings2) => ({
82906
82895
  ...settings2,
82907
82896
  right: parseInt(e2.target.value, 10)
@@ -83127,7 +83116,7 @@ const ChartConfigure = ({
83127
83116
  ...m2,
83128
83117
  barWidth: parseInt(e2.target.value, 10)
83129
83118
  })),
83130
- defaultValue: customSettings.barWidth
83119
+ value: customSettings.barWidth
83131
83120
  })]
83132
83121
  }), /* @__PURE__ */ jsxs("div", {
83133
83122
  className: styles$e.seriesWrapper,
@@ -83145,7 +83134,7 @@ const ChartConfigure = ({
83145
83134
  ...m2,
83146
83135
  barRadius: parseInt(e2.target.value, 10)
83147
83136
  })),
83148
- defaultValue: customSettings.barRadius
83137
+ value: customSettings.barRadius
83149
83138
  })]
83150
83139
  })]
83151
83140
  }) : null]
@@ -83165,7 +83154,7 @@ const ChartConfigure = ({
83165
83154
  ...m2,
83166
83155
  fontSize: parseInt(e2.target.value, 10)
83167
83156
  })),
83168
- defaultValue: customSettings.fontSize
83157
+ value: customSettings.fontSize
83169
83158
  })]
83170
83159
  }), /* @__PURE__ */ jsxs("div", {
83171
83160
  className: styles$e.singleCheckBox,
@@ -83201,7 +83190,7 @@ const ChartConfigure = ({
83201
83190
  ...m2,
83202
83191
  displayText: e2.target.value
83203
83192
  })),
83204
- defaultValue: customSettings.displayText
83193
+ value: customSettings.displayText
83205
83194
  })]
83206
83195
  }), /* @__PURE__ */ jsxs("div", {
83207
83196
  className: styles$e.seriesWrapper,
@@ -83217,7 +83206,7 @@ const ChartConfigure = ({
83217
83206
  ...m2,
83218
83207
  subHeaderFontSize: parseInt(e2.target.value, 10)
83219
83208
  })),
83220
- defaultValue: customSettings.subHeaderFontSize
83209
+ value: customSettings.subHeaderFontSize
83221
83210
  })]
83222
83211
  })]
83223
83212
  }), /* @__PURE__ */ jsxs("div", {
@@ -83391,6 +83380,7 @@ const ChartSettings = ({
83391
83380
  data: data2,
83392
83381
  setXAxis,
83393
83382
  setYAxisList,
83383
+ yAxisList,
83394
83384
  xAxis,
83395
83385
  setMeasure,
83396
83386
  setStep,
@@ -83480,6 +83470,7 @@ const ChartSettings = ({
83480
83470
  }), activeTab2 === FIRST_TAB && /* @__PURE__ */ jsx("div", {
83481
83471
  className: styles$c.button,
83482
83472
  children: /* @__PURE__ */ jsx(ChartModalOptions, {
83473
+ chartType: chartType2,
83483
83474
  setChartType
83484
83475
  })
83485
83476
  }), activeTab2 === SECOND_TAB && /* @__PURE__ */ jsx(Fragment, {
@@ -83489,6 +83480,7 @@ const ChartSettings = ({
83489
83480
  data: data2,
83490
83481
  setXAxis,
83491
83482
  xAxis,
83483
+ yAxisList,
83492
83484
  setYAxisList,
83493
83485
  chartType: chartType2,
83494
83486
  setStep,
@@ -83608,6 +83600,7 @@ const ChartTab = ({
83608
83600
  data: data2,
83609
83601
  setXAxis,
83610
83602
  setYAxisList,
83603
+ yAxisList,
83611
83604
  xAxis,
83612
83605
  setMeasure,
83613
83606
  setStep,
@@ -83725,6 +83718,7 @@ const ChartTab = ({
83725
83718
  data: data2,
83726
83719
  setXAxis,
83727
83720
  setYAxisList,
83721
+ yAxisList,
83728
83722
  xAxis,
83729
83723
  setMeasure,
83730
83724
  setStep,
@@ -84174,6 +84168,7 @@ const MetricOutput = ({
84174
84168
  setChartType,
84175
84169
  setXAxis,
84176
84170
  setYAxisList,
84171
+ yAxisList,
84177
84172
  xAxis,
84178
84173
  setMeasure,
84179
84174
  setStep,
@@ -84248,6 +84243,7 @@ const MetricOutput = ({
84248
84243
  setChartType,
84249
84244
  setXAxis,
84250
84245
  setYAxisList,
84246
+ yAxisList,
84251
84247
  xAxis,
84252
84248
  setMeasure,
84253
84249
  setStep,
@@ -85869,6 +85865,7 @@ const EmbeddedMetricCreation = ({
85869
85865
  setChartType,
85870
85866
  setXAxis,
85871
85867
  setYAxisList,
85868
+ yAxisList,
85872
85869
  xAxis,
85873
85870
  setMeasure,
85874
85871
  setStep,