@sentio/ui-dashboard 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,6 +41,7 @@ __export(index_exports, {
41
41
  ChartLegend: () => ChartLegend,
42
42
  ChartTooltip: () => ChartTooltip,
43
43
  ChartTypeButtonGroup: () => ChartTypeButtonGroup,
44
+ DataControls: () => DataControls,
44
45
  EventsFunctionCategories: () => EventsFunctionCategories,
45
46
  EventsFunctionMap: () => EventsFunctionMap,
46
47
  FunctionInput: () => FunctionInput,
@@ -52,6 +53,7 @@ __export(index_exports, {
52
53
  LabelsInput: () => LabelsInput,
53
54
  LineControls: () => LineControls,
54
55
  LineIcon: () => LineIcon_default,
56
+ MarkerControls: () => MarkerControls,
55
57
  PieChart: () => PieChart2,
56
58
  PieChartControls: () => PieChartControls,
57
59
  PieIcon: () => PieIcon_default,
@@ -61,6 +63,7 @@ __export(index_exports, {
61
63
  RefreshButton: () => RefreshButton,
62
64
  RefreshContext: () => RefreshContext,
63
65
  ScatterChartTooltip: () => ScatterChartTooltip,
66
+ ScatterControls: () => ScatterControls,
64
67
  ScatterIcon: () => ScatterIcon_default,
65
68
  SystemLabels: () => SystemLabels,
66
69
  TableIcon: () => TableIcon_default,
@@ -68,8 +71,12 @@ __export(index_exports, {
68
71
  ValueFormatters: () => ValueFormatters,
69
72
  ValueOptions: () => ValueOptions,
70
73
  ValueStringMapping: () => ValueStringMapping,
74
+ XAxisControls: () => XAxisControls,
75
+ YaxisControls: () => YaxisControls,
71
76
  defaultBarGaugeConfig: () => defaultConfig2,
77
+ defaultDataConfig: () => defaultConfig5,
72
78
  defaultPieConfig: () => defaultConfig,
79
+ defaultScatterConfig: () => defaultConfig6,
73
80
  defaultValueConfig: () => defaultConfig3,
74
81
  defaultValueControlsConfig: () => defaultConfig4,
75
82
  isAggrOrRollupFunction: () => isAggrOrRollupFunction,
@@ -4346,13 +4353,30 @@ function BarGaugeControls({ config, defaultOpen, onChange }) {
4346
4353
 
4347
4354
  // src/charts/options/ValueOptions.tsx
4348
4355
  var import_immer9 = require("immer");
4349
- var import_ui_core16 = require("@sentio/ui-core");
4356
+ var import_ui_core17 = require("@sentio/ui-core");
4357
+
4358
+ // src/charts/options/controls-ui.tsx
4359
+ var import_ui_core15 = require("@sentio/ui-core");
4360
+ var import_jsx_runtime29 = require("react/jsx-runtime");
4361
+ var AddonLabel = ({
4362
+ className,
4363
+ children
4364
+ }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4365
+ "span",
4366
+ {
4367
+ className: (0, import_ui_core15.classNames)(
4368
+ "sm:text-icontent border-main inline-flex items-center whitespace-nowrap bg-gray-50",
4369
+ className
4370
+ ),
4371
+ children
4372
+ }
4373
+ );
4350
4374
 
4351
4375
  // src/charts/options/ValueStringMapping.tsx
4352
4376
  var import_lu5 = require("react-icons/lu");
4353
- var import_ui_core15 = require("@sentio/ui-core");
4377
+ var import_ui_core16 = require("@sentio/ui-core");
4354
4378
  var import_immer8 = require("immer");
4355
- var import_jsx_runtime29 = require("react/jsx-runtime");
4379
+ var import_jsx_runtime30 = require("react/jsx-runtime");
4356
4380
  var operators = {
4357
4381
  ">": "greater than",
4358
4382
  ">=": "greater or equal",
@@ -4362,17 +4386,17 @@ var operators = {
4362
4386
  "<=": "less or equal"
4363
4387
  };
4364
4388
  var renderTreeLine = (index, isLast) => {
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)(
4389
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mr-2 flex h-12 w-3 flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex h-full w-full items-center", children: [
4390
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4367
4391
  "div",
4368
4392
  {
4369
- className: (0, import_ui_core15.classNames)(
4393
+ className: (0, import_ui_core16.classNames)(
4370
4394
  "w-px bg-gray-300",
4371
4395
  isLast ? "h-1/2 self-start" : index === 0 ? "h-full self-end" : "h-full"
4372
4396
  )
4373
4397
  }
4374
4398
  ),
4375
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "h-px w-3 bg-gray-300" })
4399
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-px w-3 bg-gray-300" })
4376
4400
  ] }) });
4377
4401
  };
4378
4402
  function ValueStringMapping({ rules, onChange }) {
@@ -4403,31 +4427,31 @@ function ValueStringMapping({ rules, onChange }) {
4403
4427
  })
4404
4428
  );
4405
4429
  }
4406
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex w-full flex-col rounded-md py-2", children: [
4430
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex w-full flex-col rounded-md py-2", children: [
4407
4431
  (rules || []).map((rule, index) => {
4408
4432
  const isLast = index === (rules || []).length - 1;
4409
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4433
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4410
4434
  "div",
4411
4435
  {
4412
4436
  className: "text-text-foreground flex h-10 items-center py-1",
4413
4437
  children: [
4414
4438
  renderTreeLine(index, isLast),
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)(
4439
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center pr-3 font-medium", children: "If value is" }),
4440
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4417
4441
  "select",
4418
4442
  {
4419
4443
  value: rule.comparison,
4420
4444
  onChange: (e) => changeRule(index, "comparison", e.target.value),
4421
4445
  className: "rounded-r-0 sm:text-ilabel border-main text-text-foreground focus:border-primary-600 focus:ring-3 focus:ring-primary-600/30 inline-flex h-full items-center rounded-l-md border border-r-0 bg-gray-50 py-1 pl-4 pr-7",
4422
4446
  children: Object.entries(operators).map(([op, display]) => {
4423
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("option", { value: op, children: [
4447
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("option", { value: op, children: [
4424
4448
  "is ",
4425
4449
  display
4426
4450
  ] }, op);
4427
4451
  })
4428
4452
  }
4429
4453
  ),
4430
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4454
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4431
4455
  "input",
4432
4456
  {
4433
4457
  type: "text",
@@ -4441,8 +4465,8 @@ function ValueStringMapping({ rules, onChange }) {
4441
4465
  }
4442
4466
  }
4443
4467
  ),
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)(
4468
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "sm:text-ilabel inline-flex h-full items-center rounded-none px-3 font-medium", children: ", then show" }),
4469
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4446
4470
  "input",
4447
4471
  {
4448
4472
  type: "text",
@@ -4456,14 +4480,14 @@ function ValueStringMapping({ rules, onChange }) {
4456
4480
  }
4457
4481
  }
4458
4482
  ),
4459
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4483
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4460
4484
  "button",
4461
4485
  {
4462
4486
  type: "button",
4463
4487
  className: "mx-2",
4464
4488
  "aria-label": "remove",
4465
4489
  onClick: () => removeRule(index),
4466
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4490
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4467
4491
  import_lu5.LuTrash2,
4468
4492
  {
4469
4493
  className: "icon text-text-foreground-disabled",
@@ -4477,8 +4501,8 @@ function ValueStringMapping({ rules, onChange }) {
4477
4501
  index
4478
4502
  );
4479
4503
  }),
4480
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4481
- import_ui_core15.Button,
4504
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4505
+ import_ui_core16.Button,
4482
4506
  {
4483
4507
  type: "button",
4484
4508
  role: "secondary",
@@ -4486,7 +4510,7 @@ function ValueStringMapping({ rules, onChange }) {
4486
4510
  "aria-label": "remove",
4487
4511
  onClick: addRule,
4488
4512
  children: [
4489
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lu5.LuPlus, { className: (0, import_ui_core15.classNames)("h-4 w-4"), "aria-hidden": "true" }),
4513
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lu5.LuPlus, { className: (0, import_ui_core16.classNames)("h-4 w-4"), "aria-hidden": "true" }),
4490
4514
  "Add Formatting Rule"
4491
4515
  ]
4492
4516
  }
@@ -4495,7 +4519,7 @@ function ValueStringMapping({ rules, onChange }) {
4495
4519
  }
4496
4520
 
4497
4521
  // src/charts/options/ValueOptions.tsx
4498
- var import_jsx_runtime30 = require("react/jsx-runtime");
4522
+ var import_jsx_runtime31 = require("react/jsx-runtime");
4499
4523
  var ValueFormatters = [
4500
4524
  { label: "Number", value: "NumberFormatter" },
4501
4525
  { label: "Date", value: "DateFormatter" },
@@ -4521,19 +4545,10 @@ var CurrencySymbols = [
4521
4545
  { label: "BTC", value: "\u0243" },
4522
4546
  { label: "ETH", value: "\u039E" }
4523
4547
  ];
4524
- var AddonLabel = ({
4548
+ var AddonLabel2 = ({
4525
4549
  className,
4526
4550
  children
4527
- }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4528
- "span",
4529
- {
4530
- className: (0, import_ui_core16.classNames)(
4531
- "sm:text-ilabel border-main inline-flex items-center whitespace-nowrap bg-gray-50 px-3",
4532
- className
4533
- ),
4534
- children
4535
- }
4536
- );
4551
+ }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel, { className: (0, import_ui_core17.classNames)("px-3", className), children });
4537
4552
  var ValueOptions = ({
4538
4553
  config,
4539
4554
  onChange,
@@ -4600,9 +4615,9 @@ var ValueOptions = ({
4600
4615
  function numberAddons(style) {
4601
4616
  switch (style) {
4602
4617
  case "None":
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)(
4618
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4619
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-l-0", children: "Fraction Digits" }),
4620
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4606
4621
  "input",
4607
4622
  {
4608
4623
  disabled: true,
@@ -4613,9 +4628,9 @@ var ValueOptions = ({
4613
4628
  ] });
4614
4629
  case "Percent":
4615
4630
  case "Standard":
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)(
4631
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4632
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-x-0", children: "Fraction Digits" }),
4633
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4619
4634
  "input",
4620
4635
  {
4621
4636
  type: "number",
@@ -4629,10 +4644,10 @@ var ValueOptions = ({
4629
4644
  )
4630
4645
  ] });
4631
4646
  case "Currency":
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)(
4635
- import_ui_core16.ComboInput,
4647
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4648
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-r-0", children: "Symbol" }),
4649
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-28 ", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4650
+ import_ui_core17.ComboInput,
4636
4651
  {
4637
4652
  onChange: onChangeSymbol,
4638
4653
  options: CurrencySymbols.map((s) => s.value),
@@ -4644,8 +4659,8 @@ var ValueOptions = ({
4644
4659
  value: config?.currencySymbol
4645
4660
  }
4646
4661
  ) }),
4647
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AddonLabel, { className: "border", children: "Precision" }),
4648
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4662
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border", children: "Precision" }),
4663
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4649
4664
  "input",
4650
4665
  {
4651
4666
  type: "number",
@@ -4660,9 +4675,9 @@ var ValueOptions = ({
4660
4675
  )
4661
4676
  ] });
4662
4677
  default:
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)(
4678
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4679
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-x-0", children: "Max significant digits" }),
4680
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4666
4681
  "input",
4667
4682
  {
4668
4683
  type: "number",
@@ -4677,62 +4692,62 @@ var ValueOptions = ({
4677
4692
  ] });
4678
4693
  }
4679
4694
  }
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)(
4695
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4696
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex", children: [
4697
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "rounded-l-md border border-r-0", children: "Value formatter" }),
4698
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4684
4699
  "select",
4685
4700
  {
4686
4701
  value: config.valueFormatter,
4687
- className: (0, import_ui_core16.classNames)(
4702
+ className: (0, import_ui_core17.classNames)(
4688
4703
  "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 inline-flex items-center border py-1.5 pl-4 pr-7 focus:ring-0",
4689
4704
  config.valueFormatter == "StringFormatter" ? "rounded-r-md" : ""
4690
4705
  ),
4691
4706
  onChange: (e) => onChangeFormatter(e.target.value),
4692
4707
  children: formatters.map((d) => {
4693
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: d.value, children: d.label }, d.value);
4708
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: d.value, children: d.label }, d.value);
4694
4709
  })
4695
4710
  }
4696
4711
  ),
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)(
4712
+ config.valueFormatter == "NumberFormatter" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4713
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-l-0 border-r-0", children: "Style" }),
4714
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
4700
4715
  "select",
4701
4716
  {
4702
4717
  value: config.style,
4703
4718
  className: "sm:text-ilabel border-main text-text-foreground hover:border-primary-600 inline-flex items-center border py-1 pl-4 pr-7 focus:ring-0",
4704
4719
  onChange: (e) => onStyleChange(e.target.value),
4705
4720
  children: [
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" })
4721
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "None", children: "None" }),
4722
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Compact", children: "Compact" }),
4723
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Standard", children: "Standard" }),
4724
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Scientific", children: "Scientific" }),
4725
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Percent", children: "Percent" }),
4726
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "Currency", children: "Currency" })
4712
4727
  ]
4713
4728
  }
4714
4729
  ),
4715
4730
  config.style && numberAddons(config.style)
4716
4731
  ] }),
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)(
4732
+ config.valueFormatter == "DateFormatter" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4733
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AddonLabel2, { className: "border border-l-0", children: "Date format" }),
4734
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4720
4735
  "select",
4721
4736
  {
4722
4737
  value: config.dateFormat,
4723
4738
  className: "sm:text-ilabel border-main text-text-foreground inline-flex items-center rounded-r-md border border-l-0 py-1 pl-4 pr-7",
4724
4739
  onChange: (e) => onChangeDateFormat(e.target.value),
4725
4740
  children: dateFormats.map((d) => {
4726
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: d.value, children: d.label }, d.value);
4741
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: d.value, children: d.label }, d.value);
4727
4742
  })
4728
4743
  }
4729
4744
  )
4730
4745
  ] })
4731
4746
  ] }) }),
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)(
4747
+ (showPrefix || showSuffix) && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mt-2 flex items-center gap-4", children: [
4748
+ showPrefix && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "border-main hover:border-primary-600 focus-within:border-primary-600 focus-within:ring-3 focus-within:ring-primary-500/30 text-icontent inline-flex items-center rounded-md border", children: [
4749
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Prefix" }),
4750
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4736
4751
  "input",
4737
4752
  {
4738
4753
  type: "text",
@@ -4743,9 +4758,9 @@ var ValueOptions = ({
4743
4758
  }
4744
4759
  )
4745
4760
  ] }),
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)(
4761
+ showSuffix && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "border-main hover:border-primary-600 focus-within:border-primary-600 focus-within:ring-3 focus-within:ring-primary-500/30 text-icontent inline-flex items-center rounded-md border", children: [
4762
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Suffix" }),
4763
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4749
4764
  "input",
4750
4765
  {
4751
4766
  type: "text",
@@ -4757,7 +4772,7 @@ var ValueOptions = ({
4757
4772
  )
4758
4773
  ] })
4759
4774
  ] }) }),
4760
- config.valueFormatter == "StringFormatter" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4775
+ config.valueFormatter == "StringFormatter" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4761
4776
  ValueStringMapping,
4762
4777
  {
4763
4778
  rules: config.mappingRules || [],
@@ -4769,9 +4784,9 @@ var ValueOptions = ({
4769
4784
 
4770
4785
  // src/charts/options/ValueControls.tsx
4771
4786
  var import_lodash7 = require("lodash");
4772
- var import_ui_core17 = require("@sentio/ui-core");
4787
+ var import_ui_core18 = require("@sentio/ui-core");
4773
4788
  var import_immer10 = require("immer");
4774
- var import_jsx_runtime31 = require("react/jsx-runtime");
4789
+ var import_jsx_runtime32 = require("react/jsx-runtime");
4775
4790
  var defaultConfig4 = {
4776
4791
  valueFormatter: "NumberFormatter",
4777
4792
  showValueLabel: false,
@@ -4798,14 +4813,14 @@ var ValueControls = ({
4798
4813
  function toggleTooltipTotal(checked) {
4799
4814
  config && onChange((0, import_immer10.produce)(config, (draft) => void (draft.tooltipTotal = checked)));
4800
4815
  }
4801
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
4802
- import_ui_core17.DisclosurePanel,
4816
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4817
+ import_ui_core18.DisclosurePanel,
4803
4818
  {
4804
4819
  title: "Value Options",
4805
4820
  defaultOpen,
4806
4821
  containerClassName: "w-full bg-default-bg",
4807
4822
  children: [
4808
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4823
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4809
4824
  ValueOptions,
4810
4825
  {
4811
4826
  onChange,
@@ -4815,17 +4830,17 @@ var ValueControls = ({
4815
4830
  showSuffix
4816
4831
  }
4817
4832
  ),
4818
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [
4819
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4820
- import_ui_core17.Checkbox,
4833
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [
4834
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4835
+ import_ui_core18.Checkbox,
4821
4836
  {
4822
4837
  checked: config?.showValueLabel,
4823
4838
  onChange: toggleShowValueLabel,
4824
4839
  label: "Show value label"
4825
4840
  }
4826
4841
  ),
4827
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4828
- import_ui_core17.Checkbox,
4842
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4843
+ import_ui_core18.Checkbox,
4829
4844
  {
4830
4845
  checked: config?.tooltipTotal,
4831
4846
  onChange: toggleTooltipTotal,
@@ -4837,6 +4852,590 @@ var ValueControls = ({
4837
4852
  }
4838
4853
  );
4839
4854
  };
4855
+
4856
+ // src/charts/options/YaxisControls.tsx
4857
+ var import_lodash8 = require("lodash");
4858
+ var import_ui_core19 = require("@sentio/ui-core");
4859
+ var import_jsx_runtime33 = require("react/jsx-runtime");
4860
+ var initialConfig2 = {
4861
+ yAxis: {
4862
+ min: "",
4863
+ max: "",
4864
+ scale: true,
4865
+ stack: ""
4866
+ }
4867
+ };
4868
+ function YaxisControls({
4869
+ yAxis,
4870
+ setYAxis,
4871
+ defaultOpen,
4872
+ columnSelect,
4873
+ supportSetName = true,
4874
+ supportSetMinMax = true,
4875
+ supportStackSeries = true,
4876
+ supportAlwaysShowZero = true,
4877
+ supportReset = true,
4878
+ panelTitle = "Y-Axis Controls"
4879
+ }) {
4880
+ yAxis = (0, import_lodash8.defaults)(yAxis || {}, initialConfig2.yAxis);
4881
+ const onChangeInput = (field) => (event) => {
4882
+ const { value } = event.target;
4883
+ setYAxis({
4884
+ ...yAxis,
4885
+ [field]: value || void 0,
4886
+ scale: field == "min" && value > "0" ? true : yAxis?.scale
4887
+ });
4888
+ };
4889
+ const onToggleZero = (checked) => {
4890
+ setYAxis({ ...yAxis, scale: !checked, min: checked ? "" : yAxis?.min });
4891
+ };
4892
+ const onClickResetYAxis = () => {
4893
+ setYAxis(initialConfig2.yAxis);
4894
+ };
4895
+ const onToggleStack = (checked) => {
4896
+ setYAxis({ ...yAxis, stacked: checked ? "samesign" : "" });
4897
+ };
4898
+ const minMaxLabelCls = "inline-flex items-center border border-r-0 sm:text-icontent border-main bg-gray-50 px-2 rounded-l-md";
4899
+ const minMaxInputCls = "border focus:border-primary-500 rounded-r-md sm:text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30";
4900
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4901
+ import_ui_core19.DisclosurePanel,
4902
+ {
4903
+ title: panelTitle,
4904
+ defaultOpen,
4905
+ containerClassName: "w-full bg-default-bg",
4906
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-icontent flex flex-wrap gap-[10px]", children: [
4907
+ supportSetName && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "inline-flex h-8", children: [
4908
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Name" }),
4909
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4910
+ "input",
4911
+ {
4912
+ type: "text",
4913
+ className: "focus:border-primary-500 sm:text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 w-40 rounded-r-md border",
4914
+ value: yAxis?.name,
4915
+ placeholder: "Axis Name",
4916
+ onChange: onChangeInput("name")
4917
+ }
4918
+ )
4919
+ ] }),
4920
+ columnSelect && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "inline-flex h-8", children: [
4921
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AddonLabel, { className: "rounded-l-md border px-2", children: "Column" }),
4922
+ columnSelect
4923
+ ] }),
4924
+ supportSetMinMax && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4925
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "inline-flex h-8", children: [
4926
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: minMaxLabelCls, children: "Min" }),
4927
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4928
+ "input",
4929
+ {
4930
+ type: "text",
4931
+ className: minMaxInputCls,
4932
+ style: { width: "10em" },
4933
+ value: yAxis.min,
4934
+ placeholder: "Auto",
4935
+ onChange: onChangeInput("min")
4936
+ }
4937
+ )
4938
+ ] }),
4939
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "inline-flex h-8", children: [
4940
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: minMaxLabelCls, children: "Max" }),
4941
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4942
+ "input",
4943
+ {
4944
+ type: "text",
4945
+ className: minMaxInputCls,
4946
+ style: { width: "10em" },
4947
+ value: yAxis.max,
4948
+ placeholder: "Auto",
4949
+ onChange: onChangeInput("max")
4950
+ }
4951
+ )
4952
+ ] })
4953
+ ] }),
4954
+ supportStackSeries && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4955
+ import_ui_core19.Checkbox,
4956
+ {
4957
+ checked: !!yAxis?.stacked,
4958
+ onChange: onToggleStack,
4959
+ label: "Stack series"
4960
+ }
4961
+ ),
4962
+ supportAlwaysShowZero && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4963
+ import_ui_core19.Checkbox,
4964
+ {
4965
+ checked: !yAxis.scale,
4966
+ onChange: onToggleZero,
4967
+ label: "Always show zero"
4968
+ }
4969
+ ),
4970
+ supportReset && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui_core19.Button, { type: "button", role: "link", onClick: onClickResetYAxis, children: "Reset" })
4971
+ ] })
4972
+ }
4973
+ );
4974
+ }
4975
+
4976
+ // src/charts/options/XaxisControls.tsx
4977
+ var import_ui_core20 = require("@sentio/ui-core");
4978
+ var import_lu6 = require("react-icons/lu");
4979
+ var import_jsx_runtime34 = require("react/jsx-runtime");
4980
+ var TypeSelect = import_ui_core20.Select;
4981
+ var SortSelect = import_ui_core20.Select;
4982
+ var OrderSelect = import_ui_core20.Select;
4983
+ var sortByItems2 = [
4984
+ { label: "Name", value: "ByName" },
4985
+ { label: "Value", value: "ByValue" }
4986
+ ];
4987
+ var orderItems2 = [
4988
+ { label: "Ascendant", value: false },
4989
+ { label: "Descendant", value: true }
4990
+ ];
4991
+ var XAxisControls = ({
4992
+ xAxis,
4993
+ setXAxis,
4994
+ defaultOpen,
4995
+ columnSelect,
4996
+ columnIsNonTime,
4997
+ panelTitle = "X-Axis Controls",
4998
+ supportName = true,
4999
+ supportSort,
5000
+ supportSetType
5001
+ }) => {
5002
+ const onChangeInput = (field) => (event) => {
5003
+ const { value } = event.target;
5004
+ setXAxis({ ...xAxis, [field]: value || void 0 });
5005
+ };
5006
+ const onClickResetXAxis = () => {
5007
+ setXAxis(void 0);
5008
+ };
5009
+ const isXAixsNoneTime = xAxis && xAxis.column && columnIsNonTime;
5010
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5011
+ import_ui_core20.DisclosurePanel,
5012
+ {
5013
+ title: panelTitle,
5014
+ defaultOpen,
5015
+ containerClassName: "w-full bg-default-bg",
5016
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-icontent flex flex-wrap gap-[10px]", children: [
5017
+ supportName && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "inline-flex h-8", children: [
5018
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Name" }),
5019
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5020
+ "input",
5021
+ {
5022
+ type: "text",
5023
+ className: "sm:text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 w-40 rounded-r-md",
5024
+ value: xAxis?.name,
5025
+ placeholder: "Axis Name",
5026
+ onChange: onChangeInput("name")
5027
+ }
5028
+ )
5029
+ ] }),
5030
+ supportSetType && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "inline-flex h-8", children: [
5031
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "sm:text-icontent border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-2", children: [
5032
+ "X-Axis Type",
5033
+ " ",
5034
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5035
+ import_ui_core20.PopoverTooltip,
5036
+ {
5037
+ strategy: "fixed",
5038
+ hideArrow: true,
5039
+ placementOption: "bottom",
5040
+ text: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-text-foreground max-w-[300px] p-2", children: [
5041
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-medium", children: "Discrete axis" }),
5042
+ " displays",
5043
+ " ",
5044
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-primary-600", children: "discrete values evenly" }),
5045
+ ", while ",
5046
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-medium", children: "Continuous axis" }),
5047
+ " ",
5048
+ "shows",
5049
+ " ",
5050
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-primary-600", children: "continuous time series" }),
5051
+ " ",
5052
+ "and",
5053
+ " ",
5054
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-primary-600", children: "auto-fills missing time points" })
5055
+ ] }),
5056
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lu6.LuInfo, { className: "text-text-foreground-secondary h-4 w-4" })
5057
+ }
5058
+ )
5059
+ ] }),
5060
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5061
+ TypeSelect,
5062
+ {
5063
+ className: "h-8 w-40",
5064
+ buttonClassName: "h-full border-main rounded-l-none items-center inline-flex items-center",
5065
+ value: xAxis?.type || "time",
5066
+ onChange: (val) => {
5067
+ setXAxis({ ...xAxis, type: val });
5068
+ },
5069
+ options: [
5070
+ { label: "Continuous", value: "time" },
5071
+ { label: "Discrete", value: "category" }
5072
+ ]
5073
+ }
5074
+ )
5075
+ ] }),
5076
+ columnSelect && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "inline-flex h-8", children: [
5077
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AddonLabel, { className: "rounded-l-md border px-2", children: "Column" }),
5078
+ columnSelect
5079
+ ] }),
5080
+ supportSort && isXAixsNoneTime && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "inline-flex h-8", children: [
5081
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Sort By" }),
5082
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5083
+ SortSelect,
5084
+ {
5085
+ className: "h-8 w-20 leading-8",
5086
+ buttonClassName: "h-full border-main rounded-none inline-flex items-center",
5087
+ options: sortByItems2,
5088
+ value: xAxis?.sort?.sortBy,
5089
+ onChange: (value) => {
5090
+ setXAxis({
5091
+ ...xAxis,
5092
+ sort: { ...xAxis?.sort, sortBy: value }
5093
+ });
5094
+ },
5095
+ placeholder: "Sort By"
5096
+ }
5097
+ ),
5098
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5099
+ OrderSelect,
5100
+ {
5101
+ className: "h-8 w-40 leading-8",
5102
+ buttonClassName: "h-full border-l-0 border-main rounded-l-none inline-flex items-center",
5103
+ options: orderItems2,
5104
+ value: xAxis?.sort?.orderDesc,
5105
+ onChange: (value) => {
5106
+ setXAxis({
5107
+ ...xAxis,
5108
+ sort: { ...xAxis?.sort, orderDesc: value }
5109
+ });
5110
+ },
5111
+ placeholder: "Sort Order"
5112
+ }
5113
+ )
5114
+ ] }),
5115
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5116
+ import_ui_core20.Button,
5117
+ {
5118
+ type: "button",
5119
+ role: "link",
5120
+ onClick: onClickResetXAxis,
5121
+ className: "h-8",
5122
+ children: "Reset"
5123
+ }
5124
+ )
5125
+ ] })
5126
+ }
5127
+ );
5128
+ };
5129
+
5130
+ // src/charts/options/MarkerControls.tsx
5131
+ var import_immer11 = require("immer");
5132
+ var import_lu7 = require("react-icons/lu");
5133
+ var import_ui_core21 = require("@sentio/ui-core");
5134
+ var import_jsx_runtime35 = require("react/jsx-runtime");
5135
+ var labelCls = "inline-flex items-center border border-r-0 sm:text-icontent border-main bg-gray-50 px-2 rounded-l-md";
5136
+ var inputCls = "border focus:border-primary-500 rounded-r-md sm:text-icontent border-main w-28 hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30";
5137
+ function MarkerInput({
5138
+ marker,
5139
+ label,
5140
+ onChange,
5141
+ onRemove
5142
+ }) {
5143
+ const _onChange = (field, value) => {
5144
+ onChange(
5145
+ (0, import_immer11.produce)(marker, (draft) => {
5146
+ ;
5147
+ draft[field] = value;
5148
+ })
5149
+ );
5150
+ };
5151
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-[10px]", children: [
5152
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "inline-flex h-8", children: [
5153
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: labelCls, children: [
5154
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pr-2", children: label }),
5155
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
5156
+ "select",
5157
+ {
5158
+ className: "sm:text-ilabel border-main text-text-foreground inline-flex h-full items-center border border-b-0 border-t-0 bg-gray-50 p-0 pl-4 pr-7 focus:border-transparent focus:ring-inset",
5159
+ value: marker.type,
5160
+ onChange: (e) => _onChange("type", e.target.value),
5161
+ children: [
5162
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "LINE", children: "horizontal line" }),
5163
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "LINEX", children: "vertical line" })
5164
+ ]
5165
+ }
5166
+ ),
5167
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pl-2", children: "at" })
5168
+ ] }),
5169
+ marker.type === "LINEX" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5170
+ "input",
5171
+ {
5172
+ className: inputCls,
5173
+ type: "text",
5174
+ value: marker.valueX,
5175
+ placeholder: "YYYY-MM-DD",
5176
+ onChange: (e) => _onChange("valueX", e.target.value)
5177
+ }
5178
+ ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5179
+ "input",
5180
+ {
5181
+ className: inputCls,
5182
+ type: "text",
5183
+ value: marker.value,
5184
+ onChange: (e) => _onChange("value", e.target.value)
5185
+ }
5186
+ )
5187
+ ] }),
5188
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "inline-flex h-8", children: [
5189
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: labelCls, children: "Color" }),
5190
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative", children: [
5191
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "absolute inset-0 flex w-8 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-4 w-4", style: { background: marker.color } }) }),
5192
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5193
+ "input",
5194
+ {
5195
+ className: inputCls + " pl-8",
5196
+ type: "text",
5197
+ value: marker.color,
5198
+ onChange: (e) => _onChange("color", e.target.value)
5199
+ }
5200
+ )
5201
+ ] })
5202
+ ] }),
5203
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "inline-flex h-8", children: [
5204
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: labelCls, children: "Label" }),
5205
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5206
+ "input",
5207
+ {
5208
+ className: inputCls,
5209
+ type: "text",
5210
+ value: marker.label,
5211
+ onChange: (e) => _onChange("label", e.target.value)
5212
+ }
5213
+ )
5214
+ ] }),
5215
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5216
+ "button",
5217
+ {
5218
+ type: "button",
5219
+ className: "ml-2 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-gray-800 hover:bg-red-600",
5220
+ "aria-label": "Remove marker",
5221
+ onClick: onRemove,
5222
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5223
+ import_lu7.LuMinus,
5224
+ {
5225
+ className: "dark:text-default-bg h-3 w-3 text-white",
5226
+ "aria-hidden": "true"
5227
+ }
5228
+ )
5229
+ }
5230
+ )
5231
+ ] });
5232
+ }
5233
+ var DEFAULT_MARKER = { value: 0, color: "#ff0000", label: "" };
5234
+ function MarkerControls({ markers, onChange }) {
5235
+ const _markers = markers?.length ? markers : [];
5236
+ const onAdd = () => {
5237
+ onChange(
5238
+ (0, import_immer11.produce)(_markers, (draft) => {
5239
+ draft.push(DEFAULT_MARKER);
5240
+ })
5241
+ );
5242
+ };
5243
+ const onRemove = (index) => {
5244
+ onChange(
5245
+ (0, import_immer11.produce)(_markers, (draft) => {
5246
+ draft.splice(index, 1);
5247
+ })
5248
+ );
5249
+ };
5250
+ const _onChange = (index, marker) => {
5251
+ onChange(
5252
+ (0, import_immer11.produce)(_markers, (draft) => {
5253
+ draft[index] = marker;
5254
+ })
5255
+ );
5256
+ };
5257
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5258
+ import_ui_core21.DisclosurePanel,
5259
+ {
5260
+ title: "Markers",
5261
+ containerClassName: "w-full bg-default-bg",
5262
+ defaultOpen: true,
5263
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-2", children: [
5264
+ _markers.map((marker, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5265
+ MarkerInput,
5266
+ {
5267
+ marker,
5268
+ label: String.fromCharCode(65 + index % 26),
5269
+ onChange: (v) => _onChange(index, v),
5270
+ onRemove: () => onRemove(index)
5271
+ },
5272
+ index
5273
+ )),
5274
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_ui_core21.Button, { type: "button", onClick: onAdd, children: [
5275
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lu7.LuPlus, { className: "h-4 w-4", "aria-hidden": "true" }),
5276
+ "Add Marker"
5277
+ ] }) })
5278
+ ] })
5279
+ }
5280
+ );
5281
+ }
5282
+
5283
+ // src/charts/options/DataControls.tsx
5284
+ var import_immer12 = require("immer");
5285
+ var import_lodash9 = require("lodash");
5286
+ var import_ui_core22 = require("@sentio/ui-core");
5287
+ var import_jsx_runtime36 = require("react/jsx-runtime");
5288
+ var defaultConfig5 = {
5289
+ seriesLimit: void 0
5290
+ };
5291
+ function DataControls({
5292
+ defaultOpen,
5293
+ onChange,
5294
+ chartConfig,
5295
+ defaultSeriesLimit = 20
5296
+ }) {
5297
+ const config = (0, import_lodash9.defaults)(chartConfig?.dataConfig, defaultConfig5);
5298
+ const currentSeriesLimit = config?.seriesLimit || chartConfig?.tableConfig?.rowLimit;
5299
+ function onSeriesLimitChange(e) {
5300
+ const value = parseInt(e.target.value);
5301
+ if (value > 1e3) {
5302
+ return;
5303
+ }
5304
+ config && onChange(
5305
+ (0, import_immer12.produce)(config, (draft) => {
5306
+ draft.seriesLimit = value;
5307
+ })
5308
+ );
5309
+ }
5310
+ function onKeyDown(e) {
5311
+ if (!/[0-9]/.test(e.key) && !["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab"].includes(e.key)) {
5312
+ e.preventDefault();
5313
+ }
5314
+ }
5315
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5316
+ import_ui_core22.DisclosurePanel,
5317
+ {
5318
+ title: "Data Options",
5319
+ defaultOpen,
5320
+ containerClassName: "w-full bg-default-bg",
5321
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex h-8", children: [
5322
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-3", children: "Max Series Limit" }),
5323
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5324
+ "input",
5325
+ {
5326
+ type: "number",
5327
+ max: 1e3,
5328
+ min: 20,
5329
+ className: "text-icontent border-main hover:border-primary-600 focus:ring-3 focus:ring-primary-600/30 focus:border-primary-600 mr-1 w-32 rounded-r-md",
5330
+ value: currentSeriesLimit ?? defaultSeriesLimit,
5331
+ onChange: onSeriesLimitChange,
5332
+ onKeyDown
5333
+ }
5334
+ )
5335
+ ] })
5336
+ }
5337
+ );
5338
+ }
5339
+
5340
+ // src/charts/options/ScatterControls.tsx
5341
+ var import_immer13 = require("immer");
5342
+ var import_lodash10 = require("lodash");
5343
+ var import_react21 = require("react");
5344
+ var import_ui_core23 = require("@sentio/ui-core");
5345
+ var import_jsx_runtime37 = require("react/jsx-runtime");
5346
+ var defaultConfig6 = {
5347
+ minSize: 5,
5348
+ maxSize: 30
5349
+ };
5350
+ function ScatterControls({
5351
+ config,
5352
+ defaultOpen,
5353
+ onChange,
5354
+ columnSelect,
5355
+ colorPicker
5356
+ }) {
5357
+ config = (0, import_lodash10.defaults)(config, defaultConfig6);
5358
+ const onSymbolSizeColumnChange = (0, import_react21.useCallback)(
5359
+ (column) => {
5360
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.symbolSize = column)));
5361
+ },
5362
+ [config, onChange]
5363
+ );
5364
+ const onSymbolColorChange = (0, import_react21.useCallback)(
5365
+ (color) => {
5366
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.color = color)));
5367
+ },
5368
+ [config, onChange]
5369
+ );
5370
+ const onMinSizeChange = (0, import_react21.useCallback)(
5371
+ (event) => {
5372
+ const value = parseInt(event.target.value) || 5;
5373
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.minSize = value)));
5374
+ },
5375
+ [config, onChange]
5376
+ );
5377
+ const onMaxSizeChange = (0, import_react21.useCallback)(
5378
+ (event) => {
5379
+ const value = parseInt(event.target.value) || 50;
5380
+ config && onChange((0, import_immer13.produce)(config, (draft) => void (draft.maxSize = value)));
5381
+ },
5382
+ [config, onChange]
5383
+ );
5384
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5385
+ import_ui_core23.DisclosurePanel,
5386
+ {
5387
+ title: "Scatter Chart Options",
5388
+ defaultOpen,
5389
+ containerClassName: "w-full bg-default-bg",
5390
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center gap-4", children: [
5391
+ columnSelect && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5392
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Size By Column" }),
5393
+ columnSelect({
5394
+ value: config.symbolSize,
5395
+ onChange: onSymbolSizeColumnChange
5396
+ })
5397
+ ] }),
5398
+ colorPicker && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5399
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Size Color Mapping" }),
5400
+ colorPicker({
5401
+ value: config.color,
5402
+ onChange: onSymbolColorChange
5403
+ })
5404
+ ] }),
5405
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5406
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Min Size" }),
5407
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5408
+ "input",
5409
+ {
5410
+ name: "minSize",
5411
+ type: "number",
5412
+ className: "focus:ring-primary-600/30 focus:border-primary-600 border-main text-icontent focus:ring-3 h-8 w-24 rounded-r-md border px-2",
5413
+ value: config.minSize || 5,
5414
+ onChange: onMinSizeChange,
5415
+ min: "1",
5416
+ max: "60"
5417
+ }
5418
+ )
5419
+ ] }),
5420
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "inline-flex h-8", children: [
5421
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Max Size" }),
5422
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5423
+ "input",
5424
+ {
5425
+ name: "maxSize",
5426
+ type: "number",
5427
+ className: "focus:ring-primary-600/30 focus:border-primary-600 border-main focus:ring-3 h-8 w-24 rounded-r-md border px-2 text-sm",
5428
+ value: config.maxSize || 30,
5429
+ onChange: onMaxSizeChange,
5430
+ min: "1",
5431
+ max: "60"
5432
+ }
5433
+ )
5434
+ ] })
5435
+ ] })
5436
+ }
5437
+ );
5438
+ }
4840
5439
  // Annotate the CommonJS export names for ESM import in node:
4841
5440
  0 && (module.exports = {
4842
5441
  AggregateInput,
@@ -4850,6 +5449,7 @@ var ValueControls = ({
4850
5449
  ChartLegend,
4851
5450
  ChartTooltip,
4852
5451
  ChartTypeButtonGroup,
5452
+ DataControls,
4853
5453
  EventsFunctionCategories,
4854
5454
  EventsFunctionMap,
4855
5455
  FunctionInput,
@@ -4861,6 +5461,7 @@ var ValueControls = ({
4861
5461
  LabelsInput,
4862
5462
  LineControls,
4863
5463
  LineIcon,
5464
+ MarkerControls,
4864
5465
  PieChart,
4865
5466
  PieChartControls,
4866
5467
  PieIcon,
@@ -4870,6 +5471,7 @@ var ValueControls = ({
4870
5471
  RefreshButton,
4871
5472
  RefreshContext,
4872
5473
  ScatterChartTooltip,
5474
+ ScatterControls,
4873
5475
  ScatterIcon,
4874
5476
  SystemLabels,
4875
5477
  TableIcon,
@@ -4877,8 +5479,12 @@ var ValueControls = ({
4877
5479
  ValueFormatters,
4878
5480
  ValueOptions,
4879
5481
  ValueStringMapping,
5482
+ XAxisControls,
5483
+ YaxisControls,
4880
5484
  defaultBarGaugeConfig,
5485
+ defaultDataConfig,
4881
5486
  defaultPieConfig,
5487
+ defaultScatterConfig,
4882
5488
  defaultValueConfig,
4883
5489
  defaultValueControlsConfig,
4884
5490
  isAggrOrRollupFunction,