@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.css +79 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +101 -37
- package/dist/index.d.ts +101 -37
- package/dist/index.js +690 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +666 -62
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4296,13 +4296,30 @@ function BarGaugeControls({ config, defaultOpen, onChange }) {
|
|
|
4296
4296
|
|
|
4297
4297
|
// src/charts/options/ValueOptions.tsx
|
|
4298
4298
|
import { produce as produce9 } from "immer";
|
|
4299
|
-
import { ComboInput, classNames as
|
|
4299
|
+
import { ComboInput, classNames as classNames9 } from "@sentio/ui-core";
|
|
4300
|
+
|
|
4301
|
+
// src/charts/options/controls-ui.tsx
|
|
4302
|
+
import { classNames as classNames7 } from "@sentio/ui-core";
|
|
4303
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4304
|
+
var AddonLabel = ({
|
|
4305
|
+
className,
|
|
4306
|
+
children
|
|
4307
|
+
}) => /* @__PURE__ */ jsx29(
|
|
4308
|
+
"span",
|
|
4309
|
+
{
|
|
4310
|
+
className: classNames7(
|
|
4311
|
+
"sm:text-icontent border-main inline-flex items-center whitespace-nowrap bg-gray-50",
|
|
4312
|
+
className
|
|
4313
|
+
),
|
|
4314
|
+
children
|
|
4315
|
+
}
|
|
4316
|
+
);
|
|
4300
4317
|
|
|
4301
4318
|
// src/charts/options/ValueStringMapping.tsx
|
|
4302
4319
|
import { LuPlus, LuTrash2 } from "react-icons/lu";
|
|
4303
|
-
import { Button, classNames as
|
|
4320
|
+
import { Button, classNames as classNames8 } from "@sentio/ui-core";
|
|
4304
4321
|
import { produce as produce8 } from "immer";
|
|
4305
|
-
import { jsx as
|
|
4322
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4306
4323
|
var operators = {
|
|
4307
4324
|
">": "greater than",
|
|
4308
4325
|
">=": "greater or equal",
|
|
@@ -4312,17 +4329,17 @@ var operators = {
|
|
|
4312
4329
|
"<=": "less or equal"
|
|
4313
4330
|
};
|
|
4314
4331
|
var renderTreeLine = (index, isLast) => {
|
|
4315
|
-
return /* @__PURE__ */
|
|
4316
|
-
/* @__PURE__ */
|
|
4332
|
+
return /* @__PURE__ */ jsx30("div", { className: "mr-2 flex h-12 w-3 flex-col items-center justify-center", children: /* @__PURE__ */ jsxs20("div", { className: "flex h-full w-full items-center", children: [
|
|
4333
|
+
/* @__PURE__ */ jsx30(
|
|
4317
4334
|
"div",
|
|
4318
4335
|
{
|
|
4319
|
-
className:
|
|
4336
|
+
className: classNames8(
|
|
4320
4337
|
"w-px bg-gray-300",
|
|
4321
4338
|
isLast ? "h-1/2 self-start" : index === 0 ? "h-full self-end" : "h-full"
|
|
4322
4339
|
)
|
|
4323
4340
|
}
|
|
4324
4341
|
),
|
|
4325
|
-
/* @__PURE__ */
|
|
4342
|
+
/* @__PURE__ */ jsx30("div", { className: "h-px w-3 bg-gray-300" })
|
|
4326
4343
|
] }) });
|
|
4327
4344
|
};
|
|
4328
4345
|
function ValueStringMapping({ rules, onChange }) {
|
|
@@ -4362,8 +4379,8 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4362
4379
|
className: "text-text-foreground flex h-10 items-center py-1",
|
|
4363
4380
|
children: [
|
|
4364
4381
|
renderTreeLine(index, isLast),
|
|
4365
|
-
/* @__PURE__ */
|
|
4366
|
-
/* @__PURE__ */
|
|
4382
|
+
/* @__PURE__ */ jsx30("span", { className: "sm:text-ilabel inline-flex h-full items-center pr-3 font-medium", children: "If value is" }),
|
|
4383
|
+
/* @__PURE__ */ jsx30(
|
|
4367
4384
|
"select",
|
|
4368
4385
|
{
|
|
4369
4386
|
value: rule.comparison,
|
|
@@ -4377,7 +4394,7 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4377
4394
|
})
|
|
4378
4395
|
}
|
|
4379
4396
|
),
|
|
4380
|
-
/* @__PURE__ */
|
|
4397
|
+
/* @__PURE__ */ jsx30(
|
|
4381
4398
|
"input",
|
|
4382
4399
|
{
|
|
4383
4400
|
type: "text",
|
|
@@ -4391,8 +4408,8 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4391
4408
|
}
|
|
4392
4409
|
}
|
|
4393
4410
|
),
|
|
4394
|
-
/* @__PURE__ */
|
|
4395
|
-
/* @__PURE__ */
|
|
4411
|
+
/* @__PURE__ */ jsx30("span", { className: "sm:text-ilabel inline-flex h-full items-center rounded-none px-3 font-medium", children: ", then show" }),
|
|
4412
|
+
/* @__PURE__ */ jsx30(
|
|
4396
4413
|
"input",
|
|
4397
4414
|
{
|
|
4398
4415
|
type: "text",
|
|
@@ -4406,14 +4423,14 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4406
4423
|
}
|
|
4407
4424
|
}
|
|
4408
4425
|
),
|
|
4409
|
-
/* @__PURE__ */
|
|
4426
|
+
/* @__PURE__ */ jsx30(
|
|
4410
4427
|
"button",
|
|
4411
4428
|
{
|
|
4412
4429
|
type: "button",
|
|
4413
4430
|
className: "mx-2",
|
|
4414
4431
|
"aria-label": "remove",
|
|
4415
4432
|
onClick: () => removeRule(index),
|
|
4416
|
-
children: /* @__PURE__ */
|
|
4433
|
+
children: /* @__PURE__ */ jsx30(
|
|
4417
4434
|
LuTrash2,
|
|
4418
4435
|
{
|
|
4419
4436
|
className: "icon text-text-foreground-disabled",
|
|
@@ -4436,7 +4453,7 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4436
4453
|
"aria-label": "remove",
|
|
4437
4454
|
onClick: addRule,
|
|
4438
4455
|
children: [
|
|
4439
|
-
/* @__PURE__ */
|
|
4456
|
+
/* @__PURE__ */ jsx30(LuPlus, { className: classNames8("h-4 w-4"), "aria-hidden": "true" }),
|
|
4440
4457
|
"Add Formatting Rule"
|
|
4441
4458
|
]
|
|
4442
4459
|
}
|
|
@@ -4445,7 +4462,7 @@ function ValueStringMapping({ rules, onChange }) {
|
|
|
4445
4462
|
}
|
|
4446
4463
|
|
|
4447
4464
|
// src/charts/options/ValueOptions.tsx
|
|
4448
|
-
import { Fragment as Fragment8, jsx as
|
|
4465
|
+
import { Fragment as Fragment8, jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4449
4466
|
var ValueFormatters = [
|
|
4450
4467
|
{ label: "Number", value: "NumberFormatter" },
|
|
4451
4468
|
{ label: "Date", value: "DateFormatter" },
|
|
@@ -4471,19 +4488,10 @@ var CurrencySymbols = [
|
|
|
4471
4488
|
{ label: "BTC", value: "\u0243" },
|
|
4472
4489
|
{ label: "ETH", value: "\u039E" }
|
|
4473
4490
|
];
|
|
4474
|
-
var
|
|
4491
|
+
var AddonLabel2 = ({
|
|
4475
4492
|
className,
|
|
4476
4493
|
children
|
|
4477
|
-
}) => /* @__PURE__ */
|
|
4478
|
-
"span",
|
|
4479
|
-
{
|
|
4480
|
-
className: classNames8(
|
|
4481
|
-
"sm:text-ilabel border-main inline-flex items-center whitespace-nowrap bg-gray-50 px-3",
|
|
4482
|
-
className
|
|
4483
|
-
),
|
|
4484
|
-
children
|
|
4485
|
-
}
|
|
4486
|
-
);
|
|
4494
|
+
}) => /* @__PURE__ */ jsx31(AddonLabel, { className: classNames9("px-3", className), children });
|
|
4487
4495
|
var ValueOptions = ({
|
|
4488
4496
|
config,
|
|
4489
4497
|
onChange,
|
|
@@ -4551,8 +4559,8 @@ var ValueOptions = ({
|
|
|
4551
4559
|
switch (style) {
|
|
4552
4560
|
case "None":
|
|
4553
4561
|
return /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4554
|
-
/* @__PURE__ */
|
|
4555
|
-
/* @__PURE__ */
|
|
4562
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "border border-l-0", children: "Fraction Digits" }),
|
|
4563
|
+
/* @__PURE__ */ jsx31(
|
|
4556
4564
|
"input",
|
|
4557
4565
|
{
|
|
4558
4566
|
disabled: true,
|
|
@@ -4564,8 +4572,8 @@ var ValueOptions = ({
|
|
|
4564
4572
|
case "Percent":
|
|
4565
4573
|
case "Standard":
|
|
4566
4574
|
return /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4567
|
-
/* @__PURE__ */
|
|
4568
|
-
/* @__PURE__ */
|
|
4575
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "border border-x-0", children: "Fraction Digits" }),
|
|
4576
|
+
/* @__PURE__ */ jsx31(
|
|
4569
4577
|
"input",
|
|
4570
4578
|
{
|
|
4571
4579
|
type: "number",
|
|
@@ -4580,8 +4588,8 @@ var ValueOptions = ({
|
|
|
4580
4588
|
] });
|
|
4581
4589
|
case "Currency":
|
|
4582
4590
|
return /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4583
|
-
/* @__PURE__ */
|
|
4584
|
-
/* @__PURE__ */
|
|
4591
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "border border-r-0", children: "Symbol" }),
|
|
4592
|
+
/* @__PURE__ */ jsx31("div", { className: "w-28 ", children: /* @__PURE__ */ jsx31(
|
|
4585
4593
|
ComboInput,
|
|
4586
4594
|
{
|
|
4587
4595
|
onChange: onChangeSymbol,
|
|
@@ -4594,8 +4602,8 @@ var ValueOptions = ({
|
|
|
4594
4602
|
value: config?.currencySymbol
|
|
4595
4603
|
}
|
|
4596
4604
|
) }),
|
|
4597
|
-
/* @__PURE__ */
|
|
4598
|
-
/* @__PURE__ */
|
|
4605
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "border", children: "Precision" }),
|
|
4606
|
+
/* @__PURE__ */ jsx31(
|
|
4599
4607
|
"input",
|
|
4600
4608
|
{
|
|
4601
4609
|
type: "number",
|
|
@@ -4611,8 +4619,8 @@ var ValueOptions = ({
|
|
|
4611
4619
|
] });
|
|
4612
4620
|
default:
|
|
4613
4621
|
return /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4614
|
-
/* @__PURE__ */
|
|
4615
|
-
/* @__PURE__ */
|
|
4622
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "border border-x-0", children: "Max significant digits" }),
|
|
4623
|
+
/* @__PURE__ */ jsx31(
|
|
4616
4624
|
"input",
|
|
4617
4625
|
{
|
|
4618
4626
|
type: "number",
|
|
@@ -4628,24 +4636,24 @@ var ValueOptions = ({
|
|
|
4628
4636
|
}
|
|
4629
4637
|
}
|
|
4630
4638
|
return /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4631
|
-
/* @__PURE__ */
|
|
4632
|
-
/* @__PURE__ */
|
|
4633
|
-
/* @__PURE__ */
|
|
4639
|
+
/* @__PURE__ */ jsx31("div", { children: /* @__PURE__ */ jsxs21("div", { className: "flex", children: [
|
|
4640
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "rounded-l-md border border-r-0", children: "Value formatter" }),
|
|
4641
|
+
/* @__PURE__ */ jsx31(
|
|
4634
4642
|
"select",
|
|
4635
4643
|
{
|
|
4636
4644
|
value: config.valueFormatter,
|
|
4637
|
-
className:
|
|
4645
|
+
className: classNames9(
|
|
4638
4646
|
"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",
|
|
4639
4647
|
config.valueFormatter == "StringFormatter" ? "rounded-r-md" : ""
|
|
4640
4648
|
),
|
|
4641
4649
|
onChange: (e) => onChangeFormatter(e.target.value),
|
|
4642
4650
|
children: formatters.map((d) => {
|
|
4643
|
-
return /* @__PURE__ */
|
|
4651
|
+
return /* @__PURE__ */ jsx31("option", { value: d.value, children: d.label }, d.value);
|
|
4644
4652
|
})
|
|
4645
4653
|
}
|
|
4646
4654
|
),
|
|
4647
4655
|
config.valueFormatter == "NumberFormatter" && /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4648
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "border border-l-0 border-r-0", children: "Style" }),
|
|
4649
4657
|
/* @__PURE__ */ jsxs21(
|
|
4650
4658
|
"select",
|
|
4651
4659
|
{
|
|
@@ -4653,36 +4661,36 @@ var ValueOptions = ({
|
|
|
4653
4661
|
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",
|
|
4654
4662
|
onChange: (e) => onStyleChange(e.target.value),
|
|
4655
4663
|
children: [
|
|
4656
|
-
/* @__PURE__ */
|
|
4657
|
-
/* @__PURE__ */
|
|
4658
|
-
/* @__PURE__ */
|
|
4659
|
-
/* @__PURE__ */
|
|
4660
|
-
/* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4664
|
+
/* @__PURE__ */ jsx31("option", { value: "None", children: "None" }),
|
|
4665
|
+
/* @__PURE__ */ jsx31("option", { value: "Compact", children: "Compact" }),
|
|
4666
|
+
/* @__PURE__ */ jsx31("option", { value: "Standard", children: "Standard" }),
|
|
4667
|
+
/* @__PURE__ */ jsx31("option", { value: "Scientific", children: "Scientific" }),
|
|
4668
|
+
/* @__PURE__ */ jsx31("option", { value: "Percent", children: "Percent" }),
|
|
4669
|
+
/* @__PURE__ */ jsx31("option", { value: "Currency", children: "Currency" })
|
|
4662
4670
|
]
|
|
4663
4671
|
}
|
|
4664
4672
|
),
|
|
4665
4673
|
config.style && numberAddons(config.style)
|
|
4666
4674
|
] }),
|
|
4667
4675
|
config.valueFormatter == "DateFormatter" && /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4668
|
-
/* @__PURE__ */
|
|
4669
|
-
/* @__PURE__ */
|
|
4676
|
+
/* @__PURE__ */ jsx31(AddonLabel2, { className: "border border-l-0", children: "Date format" }),
|
|
4677
|
+
/* @__PURE__ */ jsx31(
|
|
4670
4678
|
"select",
|
|
4671
4679
|
{
|
|
4672
4680
|
value: config.dateFormat,
|
|
4673
4681
|
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",
|
|
4674
4682
|
onChange: (e) => onChangeDateFormat(e.target.value),
|
|
4675
4683
|
children: dateFormats.map((d) => {
|
|
4676
|
-
return /* @__PURE__ */
|
|
4684
|
+
return /* @__PURE__ */ jsx31("option", { value: d.value, children: d.label }, d.value);
|
|
4677
4685
|
})
|
|
4678
4686
|
}
|
|
4679
4687
|
)
|
|
4680
4688
|
] })
|
|
4681
4689
|
] }) }),
|
|
4682
|
-
(showPrefix || showSuffix) && /* @__PURE__ */
|
|
4690
|
+
(showPrefix || showSuffix) && /* @__PURE__ */ jsx31("div", { children: /* @__PURE__ */ jsxs21("div", { className: "mt-2 flex items-center gap-4", children: [
|
|
4683
4691
|
showPrefix && /* @__PURE__ */ jsxs21("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: [
|
|
4684
|
-
/* @__PURE__ */
|
|
4685
|
-
/* @__PURE__ */
|
|
4692
|
+
/* @__PURE__ */ jsx31("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Prefix" }),
|
|
4693
|
+
/* @__PURE__ */ jsx31(
|
|
4686
4694
|
"input",
|
|
4687
4695
|
{
|
|
4688
4696
|
type: "text",
|
|
@@ -4694,8 +4702,8 @@ var ValueOptions = ({
|
|
|
4694
4702
|
)
|
|
4695
4703
|
] }),
|
|
4696
4704
|
showSuffix && /* @__PURE__ */ jsxs21("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: [
|
|
4697
|
-
/* @__PURE__ */
|
|
4698
|
-
/* @__PURE__ */
|
|
4705
|
+
/* @__PURE__ */ jsx31("div", { className: "h-7.5 leading-7.5 border-r px-3", children: "Suffix" }),
|
|
4706
|
+
/* @__PURE__ */ jsx31(
|
|
4699
4707
|
"input",
|
|
4700
4708
|
{
|
|
4701
4709
|
type: "text",
|
|
@@ -4707,7 +4715,7 @@ var ValueOptions = ({
|
|
|
4707
4715
|
)
|
|
4708
4716
|
] })
|
|
4709
4717
|
] }) }),
|
|
4710
|
-
config.valueFormatter == "StringFormatter" && /* @__PURE__ */
|
|
4718
|
+
config.valueFormatter == "StringFormatter" && /* @__PURE__ */ jsx31(
|
|
4711
4719
|
ValueStringMapping,
|
|
4712
4720
|
{
|
|
4713
4721
|
rules: config.mappingRules || [],
|
|
@@ -4721,7 +4729,7 @@ var ValueOptions = ({
|
|
|
4721
4729
|
import { defaults as defaults3 } from "lodash";
|
|
4722
4730
|
import { Checkbox as Checkbox3, DisclosurePanel as DisclosurePanel5 } from "@sentio/ui-core";
|
|
4723
4731
|
import { produce as produce10 } from "immer";
|
|
4724
|
-
import { jsx as
|
|
4732
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4725
4733
|
var defaultConfig4 = {
|
|
4726
4734
|
valueFormatter: "NumberFormatter",
|
|
4727
4735
|
showValueLabel: false,
|
|
@@ -4755,7 +4763,7 @@ var ValueControls = ({
|
|
|
4755
4763
|
defaultOpen,
|
|
4756
4764
|
containerClassName: "w-full bg-default-bg",
|
|
4757
4765
|
children: [
|
|
4758
|
-
/* @__PURE__ */
|
|
4766
|
+
/* @__PURE__ */ jsx32(
|
|
4759
4767
|
ValueOptions,
|
|
4760
4768
|
{
|
|
4761
4769
|
onChange,
|
|
@@ -4766,7 +4774,7 @@ var ValueControls = ({
|
|
|
4766
4774
|
}
|
|
4767
4775
|
),
|
|
4768
4776
|
/* @__PURE__ */ jsxs22("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
4769
|
-
/* @__PURE__ */
|
|
4777
|
+
/* @__PURE__ */ jsx32(
|
|
4770
4778
|
Checkbox3,
|
|
4771
4779
|
{
|
|
4772
4780
|
checked: config?.showValueLabel,
|
|
@@ -4774,7 +4782,7 @@ var ValueControls = ({
|
|
|
4774
4782
|
label: "Show value label"
|
|
4775
4783
|
}
|
|
4776
4784
|
),
|
|
4777
|
-
/* @__PURE__ */
|
|
4785
|
+
/* @__PURE__ */ jsx32(
|
|
4778
4786
|
Checkbox3,
|
|
4779
4787
|
{
|
|
4780
4788
|
checked: config?.tooltipTotal,
|
|
@@ -4787,6 +4795,595 @@ var ValueControls = ({
|
|
|
4787
4795
|
}
|
|
4788
4796
|
);
|
|
4789
4797
|
};
|
|
4798
|
+
|
|
4799
|
+
// src/charts/options/YaxisControls.tsx
|
|
4800
|
+
import { defaults as defaults4 } from "lodash";
|
|
4801
|
+
import { Button as Button2, Checkbox as Checkbox4, DisclosurePanel as DisclosurePanel6 } from "@sentio/ui-core";
|
|
4802
|
+
import { Fragment as Fragment9, jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4803
|
+
var initialConfig2 = {
|
|
4804
|
+
yAxis: {
|
|
4805
|
+
min: "",
|
|
4806
|
+
max: "",
|
|
4807
|
+
scale: true,
|
|
4808
|
+
stack: ""
|
|
4809
|
+
}
|
|
4810
|
+
};
|
|
4811
|
+
function YaxisControls({
|
|
4812
|
+
yAxis,
|
|
4813
|
+
setYAxis,
|
|
4814
|
+
defaultOpen,
|
|
4815
|
+
columnSelect,
|
|
4816
|
+
supportSetName = true,
|
|
4817
|
+
supportSetMinMax = true,
|
|
4818
|
+
supportStackSeries = true,
|
|
4819
|
+
supportAlwaysShowZero = true,
|
|
4820
|
+
supportReset = true,
|
|
4821
|
+
panelTitle = "Y-Axis Controls"
|
|
4822
|
+
}) {
|
|
4823
|
+
yAxis = defaults4(yAxis || {}, initialConfig2.yAxis);
|
|
4824
|
+
const onChangeInput = (field) => (event) => {
|
|
4825
|
+
const { value } = event.target;
|
|
4826
|
+
setYAxis({
|
|
4827
|
+
...yAxis,
|
|
4828
|
+
[field]: value || void 0,
|
|
4829
|
+
scale: field == "min" && value > "0" ? true : yAxis?.scale
|
|
4830
|
+
});
|
|
4831
|
+
};
|
|
4832
|
+
const onToggleZero = (checked) => {
|
|
4833
|
+
setYAxis({ ...yAxis, scale: !checked, min: checked ? "" : yAxis?.min });
|
|
4834
|
+
};
|
|
4835
|
+
const onClickResetYAxis = () => {
|
|
4836
|
+
setYAxis(initialConfig2.yAxis);
|
|
4837
|
+
};
|
|
4838
|
+
const onToggleStack = (checked) => {
|
|
4839
|
+
setYAxis({ ...yAxis, stacked: checked ? "samesign" : "" });
|
|
4840
|
+
};
|
|
4841
|
+
const minMaxLabelCls = "inline-flex items-center border border-r-0 sm:text-icontent border-main bg-gray-50 px-2 rounded-l-md";
|
|
4842
|
+
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";
|
|
4843
|
+
return /* @__PURE__ */ jsx33(
|
|
4844
|
+
DisclosurePanel6,
|
|
4845
|
+
{
|
|
4846
|
+
title: panelTitle,
|
|
4847
|
+
defaultOpen,
|
|
4848
|
+
containerClassName: "w-full bg-default-bg",
|
|
4849
|
+
children: /* @__PURE__ */ jsxs23("div", { className: "text-icontent flex flex-wrap gap-[10px]", children: [
|
|
4850
|
+
supportSetName && /* @__PURE__ */ jsxs23("label", { className: "inline-flex h-8", children: [
|
|
4851
|
+
/* @__PURE__ */ jsx33(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Name" }),
|
|
4852
|
+
/* @__PURE__ */ jsx33(
|
|
4853
|
+
"input",
|
|
4854
|
+
{
|
|
4855
|
+
type: "text",
|
|
4856
|
+
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",
|
|
4857
|
+
value: yAxis?.name,
|
|
4858
|
+
placeholder: "Axis Name",
|
|
4859
|
+
onChange: onChangeInput("name")
|
|
4860
|
+
}
|
|
4861
|
+
)
|
|
4862
|
+
] }),
|
|
4863
|
+
columnSelect && /* @__PURE__ */ jsxs23("span", { className: "inline-flex h-8", children: [
|
|
4864
|
+
/* @__PURE__ */ jsx33(AddonLabel, { className: "rounded-l-md border px-2", children: "Column" }),
|
|
4865
|
+
columnSelect
|
|
4866
|
+
] }),
|
|
4867
|
+
supportSetMinMax && /* @__PURE__ */ jsxs23(Fragment9, { children: [
|
|
4868
|
+
/* @__PURE__ */ jsxs23("label", { className: "inline-flex h-8", children: [
|
|
4869
|
+
/* @__PURE__ */ jsx33("span", { className: minMaxLabelCls, children: "Min" }),
|
|
4870
|
+
/* @__PURE__ */ jsx33(
|
|
4871
|
+
"input",
|
|
4872
|
+
{
|
|
4873
|
+
type: "text",
|
|
4874
|
+
className: minMaxInputCls,
|
|
4875
|
+
style: { width: "10em" },
|
|
4876
|
+
value: yAxis.min,
|
|
4877
|
+
placeholder: "Auto",
|
|
4878
|
+
onChange: onChangeInput("min")
|
|
4879
|
+
}
|
|
4880
|
+
)
|
|
4881
|
+
] }),
|
|
4882
|
+
/* @__PURE__ */ jsxs23("label", { className: "inline-flex h-8", children: [
|
|
4883
|
+
/* @__PURE__ */ jsx33("span", { className: minMaxLabelCls, children: "Max" }),
|
|
4884
|
+
/* @__PURE__ */ jsx33(
|
|
4885
|
+
"input",
|
|
4886
|
+
{
|
|
4887
|
+
type: "text",
|
|
4888
|
+
className: minMaxInputCls,
|
|
4889
|
+
style: { width: "10em" },
|
|
4890
|
+
value: yAxis.max,
|
|
4891
|
+
placeholder: "Auto",
|
|
4892
|
+
onChange: onChangeInput("max")
|
|
4893
|
+
}
|
|
4894
|
+
)
|
|
4895
|
+
] })
|
|
4896
|
+
] }),
|
|
4897
|
+
supportStackSeries && /* @__PURE__ */ jsx33(
|
|
4898
|
+
Checkbox4,
|
|
4899
|
+
{
|
|
4900
|
+
checked: !!yAxis?.stacked,
|
|
4901
|
+
onChange: onToggleStack,
|
|
4902
|
+
label: "Stack series"
|
|
4903
|
+
}
|
|
4904
|
+
),
|
|
4905
|
+
supportAlwaysShowZero && /* @__PURE__ */ jsx33(
|
|
4906
|
+
Checkbox4,
|
|
4907
|
+
{
|
|
4908
|
+
checked: !yAxis.scale,
|
|
4909
|
+
onChange: onToggleZero,
|
|
4910
|
+
label: "Always show zero"
|
|
4911
|
+
}
|
|
4912
|
+
),
|
|
4913
|
+
supportReset && /* @__PURE__ */ jsx33(Button2, { type: "button", role: "link", onClick: onClickResetYAxis, children: "Reset" })
|
|
4914
|
+
] })
|
|
4915
|
+
}
|
|
4916
|
+
);
|
|
4917
|
+
}
|
|
4918
|
+
|
|
4919
|
+
// src/charts/options/XaxisControls.tsx
|
|
4920
|
+
import {
|
|
4921
|
+
Button as Button3,
|
|
4922
|
+
DisclosurePanel as DisclosurePanel7,
|
|
4923
|
+
PopoverTooltip,
|
|
4924
|
+
Select
|
|
4925
|
+
} from "@sentio/ui-core";
|
|
4926
|
+
import { LuInfo } from "react-icons/lu";
|
|
4927
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4928
|
+
var TypeSelect = Select;
|
|
4929
|
+
var SortSelect = Select;
|
|
4930
|
+
var OrderSelect = Select;
|
|
4931
|
+
var sortByItems2 = [
|
|
4932
|
+
{ label: "Name", value: "ByName" },
|
|
4933
|
+
{ label: "Value", value: "ByValue" }
|
|
4934
|
+
];
|
|
4935
|
+
var orderItems2 = [
|
|
4936
|
+
{ label: "Ascendant", value: false },
|
|
4937
|
+
{ label: "Descendant", value: true }
|
|
4938
|
+
];
|
|
4939
|
+
var XAxisControls = ({
|
|
4940
|
+
xAxis,
|
|
4941
|
+
setXAxis,
|
|
4942
|
+
defaultOpen,
|
|
4943
|
+
columnSelect,
|
|
4944
|
+
columnIsNonTime,
|
|
4945
|
+
panelTitle = "X-Axis Controls",
|
|
4946
|
+
supportName = true,
|
|
4947
|
+
supportSort,
|
|
4948
|
+
supportSetType
|
|
4949
|
+
}) => {
|
|
4950
|
+
const onChangeInput = (field) => (event) => {
|
|
4951
|
+
const { value } = event.target;
|
|
4952
|
+
setXAxis({ ...xAxis, [field]: value || void 0 });
|
|
4953
|
+
};
|
|
4954
|
+
const onClickResetXAxis = () => {
|
|
4955
|
+
setXAxis(void 0);
|
|
4956
|
+
};
|
|
4957
|
+
const isXAixsNoneTime = xAxis && xAxis.column && columnIsNonTime;
|
|
4958
|
+
return /* @__PURE__ */ jsx34(
|
|
4959
|
+
DisclosurePanel7,
|
|
4960
|
+
{
|
|
4961
|
+
title: panelTitle,
|
|
4962
|
+
defaultOpen,
|
|
4963
|
+
containerClassName: "w-full bg-default-bg",
|
|
4964
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "text-icontent flex flex-wrap gap-[10px]", children: [
|
|
4965
|
+
supportName && /* @__PURE__ */ jsxs24("label", { className: "inline-flex h-8", children: [
|
|
4966
|
+
/* @__PURE__ */ jsx34(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Name" }),
|
|
4967
|
+
/* @__PURE__ */ jsx34(
|
|
4968
|
+
"input",
|
|
4969
|
+
{
|
|
4970
|
+
type: "text",
|
|
4971
|
+
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",
|
|
4972
|
+
value: xAxis?.name,
|
|
4973
|
+
placeholder: "Axis Name",
|
|
4974
|
+
onChange: onChangeInput("name")
|
|
4975
|
+
}
|
|
4976
|
+
)
|
|
4977
|
+
] }),
|
|
4978
|
+
supportSetType && /* @__PURE__ */ jsxs24("span", { className: "inline-flex h-8", children: [
|
|
4979
|
+
/* @__PURE__ */ jsxs24("span", { className: "sm:text-icontent border-main inline-flex items-center rounded-l-md border border-r-0 bg-gray-50 px-2", children: [
|
|
4980
|
+
"X-Axis Type",
|
|
4981
|
+
" ",
|
|
4982
|
+
/* @__PURE__ */ jsx34(
|
|
4983
|
+
PopoverTooltip,
|
|
4984
|
+
{
|
|
4985
|
+
strategy: "fixed",
|
|
4986
|
+
hideArrow: true,
|
|
4987
|
+
placementOption: "bottom",
|
|
4988
|
+
text: /* @__PURE__ */ jsxs24("div", { className: "text-text-foreground max-w-[300px] p-2", children: [
|
|
4989
|
+
/* @__PURE__ */ jsx34("span", { className: "font-medium", children: "Discrete axis" }),
|
|
4990
|
+
" displays",
|
|
4991
|
+
" ",
|
|
4992
|
+
/* @__PURE__ */ jsx34("span", { className: "text-primary-600", children: "discrete values evenly" }),
|
|
4993
|
+
", while ",
|
|
4994
|
+
/* @__PURE__ */ jsx34("span", { className: "font-medium", children: "Continuous axis" }),
|
|
4995
|
+
" ",
|
|
4996
|
+
"shows",
|
|
4997
|
+
" ",
|
|
4998
|
+
/* @__PURE__ */ jsx34("span", { className: "text-primary-600", children: "continuous time series" }),
|
|
4999
|
+
" ",
|
|
5000
|
+
"and",
|
|
5001
|
+
" ",
|
|
5002
|
+
/* @__PURE__ */ jsx34("span", { className: "text-primary-600", children: "auto-fills missing time points" })
|
|
5003
|
+
] }),
|
|
5004
|
+
children: /* @__PURE__ */ jsx34(LuInfo, { className: "text-text-foreground-secondary h-4 w-4" })
|
|
5005
|
+
}
|
|
5006
|
+
)
|
|
5007
|
+
] }),
|
|
5008
|
+
/* @__PURE__ */ jsx34(
|
|
5009
|
+
TypeSelect,
|
|
5010
|
+
{
|
|
5011
|
+
className: "h-8 w-40",
|
|
5012
|
+
buttonClassName: "h-full border-main rounded-l-none items-center inline-flex items-center",
|
|
5013
|
+
value: xAxis?.type || "time",
|
|
5014
|
+
onChange: (val) => {
|
|
5015
|
+
setXAxis({ ...xAxis, type: val });
|
|
5016
|
+
},
|
|
5017
|
+
options: [
|
|
5018
|
+
{ label: "Continuous", value: "time" },
|
|
5019
|
+
{ label: "Discrete", value: "category" }
|
|
5020
|
+
]
|
|
5021
|
+
}
|
|
5022
|
+
)
|
|
5023
|
+
] }),
|
|
5024
|
+
columnSelect && /* @__PURE__ */ jsxs24("span", { className: "inline-flex h-8", children: [
|
|
5025
|
+
/* @__PURE__ */ jsx34(AddonLabel, { className: "rounded-l-md border px-2", children: "Column" }),
|
|
5026
|
+
columnSelect
|
|
5027
|
+
] }),
|
|
5028
|
+
supportSort && isXAixsNoneTime && /* @__PURE__ */ jsxs24("span", { className: "inline-flex h-8", children: [
|
|
5029
|
+
/* @__PURE__ */ jsx34(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Sort By" }),
|
|
5030
|
+
/* @__PURE__ */ jsx34(
|
|
5031
|
+
SortSelect,
|
|
5032
|
+
{
|
|
5033
|
+
className: "h-8 w-20 leading-8",
|
|
5034
|
+
buttonClassName: "h-full border-main rounded-none inline-flex items-center",
|
|
5035
|
+
options: sortByItems2,
|
|
5036
|
+
value: xAxis?.sort?.sortBy,
|
|
5037
|
+
onChange: (value) => {
|
|
5038
|
+
setXAxis({
|
|
5039
|
+
...xAxis,
|
|
5040
|
+
sort: { ...xAxis?.sort, sortBy: value }
|
|
5041
|
+
});
|
|
5042
|
+
},
|
|
5043
|
+
placeholder: "Sort By"
|
|
5044
|
+
}
|
|
5045
|
+
),
|
|
5046
|
+
/* @__PURE__ */ jsx34(
|
|
5047
|
+
OrderSelect,
|
|
5048
|
+
{
|
|
5049
|
+
className: "h-8 w-40 leading-8",
|
|
5050
|
+
buttonClassName: "h-full border-l-0 border-main rounded-l-none inline-flex items-center",
|
|
5051
|
+
options: orderItems2,
|
|
5052
|
+
value: xAxis?.sort?.orderDesc,
|
|
5053
|
+
onChange: (value) => {
|
|
5054
|
+
setXAxis({
|
|
5055
|
+
...xAxis,
|
|
5056
|
+
sort: { ...xAxis?.sort, orderDesc: value }
|
|
5057
|
+
});
|
|
5058
|
+
},
|
|
5059
|
+
placeholder: "Sort Order"
|
|
5060
|
+
}
|
|
5061
|
+
)
|
|
5062
|
+
] }),
|
|
5063
|
+
/* @__PURE__ */ jsx34(
|
|
5064
|
+
Button3,
|
|
5065
|
+
{
|
|
5066
|
+
type: "button",
|
|
5067
|
+
role: "link",
|
|
5068
|
+
onClick: onClickResetXAxis,
|
|
5069
|
+
className: "h-8",
|
|
5070
|
+
children: "Reset"
|
|
5071
|
+
}
|
|
5072
|
+
)
|
|
5073
|
+
] })
|
|
5074
|
+
}
|
|
5075
|
+
);
|
|
5076
|
+
};
|
|
5077
|
+
|
|
5078
|
+
// src/charts/options/MarkerControls.tsx
|
|
5079
|
+
import { produce as produce11 } from "immer";
|
|
5080
|
+
import { LuMinus, LuPlus as LuPlus2 } from "react-icons/lu";
|
|
5081
|
+
import { Button as Button4, DisclosurePanel as DisclosurePanel8 } from "@sentio/ui-core";
|
|
5082
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5083
|
+
var labelCls = "inline-flex items-center border border-r-0 sm:text-icontent border-main bg-gray-50 px-2 rounded-l-md";
|
|
5084
|
+
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";
|
|
5085
|
+
function MarkerInput({
|
|
5086
|
+
marker,
|
|
5087
|
+
label,
|
|
5088
|
+
onChange,
|
|
5089
|
+
onRemove
|
|
5090
|
+
}) {
|
|
5091
|
+
const _onChange = (field, value) => {
|
|
5092
|
+
onChange(
|
|
5093
|
+
produce11(marker, (draft) => {
|
|
5094
|
+
;
|
|
5095
|
+
draft[field] = value;
|
|
5096
|
+
})
|
|
5097
|
+
);
|
|
5098
|
+
};
|
|
5099
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-[10px]", children: [
|
|
5100
|
+
/* @__PURE__ */ jsxs25("label", { className: "inline-flex h-8", children: [
|
|
5101
|
+
/* @__PURE__ */ jsxs25("span", { className: labelCls, children: [
|
|
5102
|
+
/* @__PURE__ */ jsx35("span", { className: "pr-2", children: label }),
|
|
5103
|
+
/* @__PURE__ */ jsxs25(
|
|
5104
|
+
"select",
|
|
5105
|
+
{
|
|
5106
|
+
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",
|
|
5107
|
+
value: marker.type,
|
|
5108
|
+
onChange: (e) => _onChange("type", e.target.value),
|
|
5109
|
+
children: [
|
|
5110
|
+
/* @__PURE__ */ jsx35("option", { value: "LINE", children: "horizontal line" }),
|
|
5111
|
+
/* @__PURE__ */ jsx35("option", { value: "LINEX", children: "vertical line" })
|
|
5112
|
+
]
|
|
5113
|
+
}
|
|
5114
|
+
),
|
|
5115
|
+
/* @__PURE__ */ jsx35("span", { className: "pl-2", children: "at" })
|
|
5116
|
+
] }),
|
|
5117
|
+
marker.type === "LINEX" ? /* @__PURE__ */ jsx35(
|
|
5118
|
+
"input",
|
|
5119
|
+
{
|
|
5120
|
+
className: inputCls,
|
|
5121
|
+
type: "text",
|
|
5122
|
+
value: marker.valueX,
|
|
5123
|
+
placeholder: "YYYY-MM-DD",
|
|
5124
|
+
onChange: (e) => _onChange("valueX", e.target.value)
|
|
5125
|
+
}
|
|
5126
|
+
) : /* @__PURE__ */ jsx35(
|
|
5127
|
+
"input",
|
|
5128
|
+
{
|
|
5129
|
+
className: inputCls,
|
|
5130
|
+
type: "text",
|
|
5131
|
+
value: marker.value,
|
|
5132
|
+
onChange: (e) => _onChange("value", e.target.value)
|
|
5133
|
+
}
|
|
5134
|
+
)
|
|
5135
|
+
] }),
|
|
5136
|
+
/* @__PURE__ */ jsxs25("label", { className: "inline-flex h-8", children: [
|
|
5137
|
+
/* @__PURE__ */ jsx35("span", { className: labelCls, children: "Color" }),
|
|
5138
|
+
/* @__PURE__ */ jsxs25("div", { className: "relative", children: [
|
|
5139
|
+
/* @__PURE__ */ jsx35("div", { className: "absolute inset-0 flex w-8 items-center justify-center", children: /* @__PURE__ */ jsx35("div", { className: "h-4 w-4", style: { background: marker.color } }) }),
|
|
5140
|
+
/* @__PURE__ */ jsx35(
|
|
5141
|
+
"input",
|
|
5142
|
+
{
|
|
5143
|
+
className: inputCls + " pl-8",
|
|
5144
|
+
type: "text",
|
|
5145
|
+
value: marker.color,
|
|
5146
|
+
onChange: (e) => _onChange("color", e.target.value)
|
|
5147
|
+
}
|
|
5148
|
+
)
|
|
5149
|
+
] })
|
|
5150
|
+
] }),
|
|
5151
|
+
/* @__PURE__ */ jsxs25("label", { className: "inline-flex h-8", children: [
|
|
5152
|
+
/* @__PURE__ */ jsx35("span", { className: labelCls, children: "Label" }),
|
|
5153
|
+
/* @__PURE__ */ jsx35(
|
|
5154
|
+
"input",
|
|
5155
|
+
{
|
|
5156
|
+
className: inputCls,
|
|
5157
|
+
type: "text",
|
|
5158
|
+
value: marker.label,
|
|
5159
|
+
onChange: (e) => _onChange("label", e.target.value)
|
|
5160
|
+
}
|
|
5161
|
+
)
|
|
5162
|
+
] }),
|
|
5163
|
+
/* @__PURE__ */ jsx35(
|
|
5164
|
+
"button",
|
|
5165
|
+
{
|
|
5166
|
+
type: "button",
|
|
5167
|
+
className: "ml-2 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-gray-800 hover:bg-red-600",
|
|
5168
|
+
"aria-label": "Remove marker",
|
|
5169
|
+
onClick: onRemove,
|
|
5170
|
+
children: /* @__PURE__ */ jsx35(
|
|
5171
|
+
LuMinus,
|
|
5172
|
+
{
|
|
5173
|
+
className: "dark:text-default-bg h-3 w-3 text-white",
|
|
5174
|
+
"aria-hidden": "true"
|
|
5175
|
+
}
|
|
5176
|
+
)
|
|
5177
|
+
}
|
|
5178
|
+
)
|
|
5179
|
+
] });
|
|
5180
|
+
}
|
|
5181
|
+
var DEFAULT_MARKER = { value: 0, color: "#ff0000", label: "" };
|
|
5182
|
+
function MarkerControls({ markers, onChange }) {
|
|
5183
|
+
const _markers = markers?.length ? markers : [];
|
|
5184
|
+
const onAdd = () => {
|
|
5185
|
+
onChange(
|
|
5186
|
+
produce11(_markers, (draft) => {
|
|
5187
|
+
draft.push(DEFAULT_MARKER);
|
|
5188
|
+
})
|
|
5189
|
+
);
|
|
5190
|
+
};
|
|
5191
|
+
const onRemove = (index) => {
|
|
5192
|
+
onChange(
|
|
5193
|
+
produce11(_markers, (draft) => {
|
|
5194
|
+
draft.splice(index, 1);
|
|
5195
|
+
})
|
|
5196
|
+
);
|
|
5197
|
+
};
|
|
5198
|
+
const _onChange = (index, marker) => {
|
|
5199
|
+
onChange(
|
|
5200
|
+
produce11(_markers, (draft) => {
|
|
5201
|
+
draft[index] = marker;
|
|
5202
|
+
})
|
|
5203
|
+
);
|
|
5204
|
+
};
|
|
5205
|
+
return /* @__PURE__ */ jsx35(
|
|
5206
|
+
DisclosurePanel8,
|
|
5207
|
+
{
|
|
5208
|
+
title: "Markers",
|
|
5209
|
+
containerClassName: "w-full bg-default-bg",
|
|
5210
|
+
defaultOpen: true,
|
|
5211
|
+
children: /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
|
|
5212
|
+
_markers.map((marker, index) => /* @__PURE__ */ jsx35(
|
|
5213
|
+
MarkerInput,
|
|
5214
|
+
{
|
|
5215
|
+
marker,
|
|
5216
|
+
label: String.fromCharCode(65 + index % 26),
|
|
5217
|
+
onChange: (v) => _onChange(index, v),
|
|
5218
|
+
onRemove: () => onRemove(index)
|
|
5219
|
+
},
|
|
5220
|
+
index
|
|
5221
|
+
)),
|
|
5222
|
+
/* @__PURE__ */ jsx35("div", { children: /* @__PURE__ */ jsxs25(Button4, { type: "button", onClick: onAdd, children: [
|
|
5223
|
+
/* @__PURE__ */ jsx35(LuPlus2, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
5224
|
+
"Add Marker"
|
|
5225
|
+
] }) })
|
|
5226
|
+
] })
|
|
5227
|
+
}
|
|
5228
|
+
);
|
|
5229
|
+
}
|
|
5230
|
+
|
|
5231
|
+
// src/charts/options/DataControls.tsx
|
|
5232
|
+
import { produce as produce12 } from "immer";
|
|
5233
|
+
import { defaults as defaults5 } from "lodash";
|
|
5234
|
+
import { DisclosurePanel as DisclosurePanel9 } from "@sentio/ui-core";
|
|
5235
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5236
|
+
var defaultConfig5 = {
|
|
5237
|
+
seriesLimit: void 0
|
|
5238
|
+
};
|
|
5239
|
+
function DataControls({
|
|
5240
|
+
defaultOpen,
|
|
5241
|
+
onChange,
|
|
5242
|
+
chartConfig,
|
|
5243
|
+
defaultSeriesLimit = 20
|
|
5244
|
+
}) {
|
|
5245
|
+
const config = defaults5(chartConfig?.dataConfig, defaultConfig5);
|
|
5246
|
+
const currentSeriesLimit = config?.seriesLimit || chartConfig?.tableConfig?.rowLimit;
|
|
5247
|
+
function onSeriesLimitChange(e) {
|
|
5248
|
+
const value = parseInt(e.target.value);
|
|
5249
|
+
if (value > 1e3) {
|
|
5250
|
+
return;
|
|
5251
|
+
}
|
|
5252
|
+
config && onChange(
|
|
5253
|
+
produce12(config, (draft) => {
|
|
5254
|
+
draft.seriesLimit = value;
|
|
5255
|
+
})
|
|
5256
|
+
);
|
|
5257
|
+
}
|
|
5258
|
+
function onKeyDown(e) {
|
|
5259
|
+
if (!/[0-9]/.test(e.key) && !["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab"].includes(e.key)) {
|
|
5260
|
+
e.preventDefault();
|
|
5261
|
+
}
|
|
5262
|
+
}
|
|
5263
|
+
return /* @__PURE__ */ jsx36(
|
|
5264
|
+
DisclosurePanel9,
|
|
5265
|
+
{
|
|
5266
|
+
title: "Data Options",
|
|
5267
|
+
defaultOpen,
|
|
5268
|
+
containerClassName: "w-full bg-default-bg",
|
|
5269
|
+
children: /* @__PURE__ */ jsxs26("div", { className: "flex h-8", children: [
|
|
5270
|
+
/* @__PURE__ */ jsx36(AddonLabel, { className: "rounded-l-md border border-r-0 px-3", children: "Max Series Limit" }),
|
|
5271
|
+
/* @__PURE__ */ jsx36(
|
|
5272
|
+
"input",
|
|
5273
|
+
{
|
|
5274
|
+
type: "number",
|
|
5275
|
+
max: 1e3,
|
|
5276
|
+
min: 20,
|
|
5277
|
+
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",
|
|
5278
|
+
value: currentSeriesLimit ?? defaultSeriesLimit,
|
|
5279
|
+
onChange: onSeriesLimitChange,
|
|
5280
|
+
onKeyDown
|
|
5281
|
+
}
|
|
5282
|
+
)
|
|
5283
|
+
] })
|
|
5284
|
+
}
|
|
5285
|
+
);
|
|
5286
|
+
}
|
|
5287
|
+
|
|
5288
|
+
// src/charts/options/ScatterControls.tsx
|
|
5289
|
+
import { produce as produce13 } from "immer";
|
|
5290
|
+
import { defaults as defaults6 } from "lodash";
|
|
5291
|
+
import { useCallback as useCallback4 } from "react";
|
|
5292
|
+
import { DisclosurePanel as DisclosurePanel10 } from "@sentio/ui-core";
|
|
5293
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5294
|
+
var defaultConfig6 = {
|
|
5295
|
+
minSize: 5,
|
|
5296
|
+
maxSize: 30
|
|
5297
|
+
};
|
|
5298
|
+
function ScatterControls({
|
|
5299
|
+
config,
|
|
5300
|
+
defaultOpen,
|
|
5301
|
+
onChange,
|
|
5302
|
+
columnSelect,
|
|
5303
|
+
colorPicker
|
|
5304
|
+
}) {
|
|
5305
|
+
config = defaults6(config, defaultConfig6);
|
|
5306
|
+
const onSymbolSizeColumnChange = useCallback4(
|
|
5307
|
+
(column) => {
|
|
5308
|
+
config && onChange(produce13(config, (draft) => void (draft.symbolSize = column)));
|
|
5309
|
+
},
|
|
5310
|
+
[config, onChange]
|
|
5311
|
+
);
|
|
5312
|
+
const onSymbolColorChange = useCallback4(
|
|
5313
|
+
(color) => {
|
|
5314
|
+
config && onChange(produce13(config, (draft) => void (draft.color = color)));
|
|
5315
|
+
},
|
|
5316
|
+
[config, onChange]
|
|
5317
|
+
);
|
|
5318
|
+
const onMinSizeChange = useCallback4(
|
|
5319
|
+
(event) => {
|
|
5320
|
+
const value = parseInt(event.target.value) || 5;
|
|
5321
|
+
config && onChange(produce13(config, (draft) => void (draft.minSize = value)));
|
|
5322
|
+
},
|
|
5323
|
+
[config, onChange]
|
|
5324
|
+
);
|
|
5325
|
+
const onMaxSizeChange = useCallback4(
|
|
5326
|
+
(event) => {
|
|
5327
|
+
const value = parseInt(event.target.value) || 50;
|
|
5328
|
+
config && onChange(produce13(config, (draft) => void (draft.maxSize = value)));
|
|
5329
|
+
},
|
|
5330
|
+
[config, onChange]
|
|
5331
|
+
);
|
|
5332
|
+
return /* @__PURE__ */ jsx37(
|
|
5333
|
+
DisclosurePanel10,
|
|
5334
|
+
{
|
|
5335
|
+
title: "Scatter Chart Options",
|
|
5336
|
+
defaultOpen,
|
|
5337
|
+
containerClassName: "w-full bg-default-bg",
|
|
5338
|
+
children: /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-4", children: [
|
|
5339
|
+
columnSelect && /* @__PURE__ */ jsxs27("div", { className: "inline-flex h-8", children: [
|
|
5340
|
+
/* @__PURE__ */ jsx37(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Size By Column" }),
|
|
5341
|
+
columnSelect({
|
|
5342
|
+
value: config.symbolSize,
|
|
5343
|
+
onChange: onSymbolSizeColumnChange
|
|
5344
|
+
})
|
|
5345
|
+
] }),
|
|
5346
|
+
colorPicker && /* @__PURE__ */ jsxs27("div", { className: "inline-flex h-8", children: [
|
|
5347
|
+
/* @__PURE__ */ jsx37(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Size Color Mapping" }),
|
|
5348
|
+
colorPicker({
|
|
5349
|
+
value: config.color,
|
|
5350
|
+
onChange: onSymbolColorChange
|
|
5351
|
+
})
|
|
5352
|
+
] }),
|
|
5353
|
+
/* @__PURE__ */ jsxs27("div", { className: "inline-flex h-8", children: [
|
|
5354
|
+
/* @__PURE__ */ jsx37(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Min Size" }),
|
|
5355
|
+
/* @__PURE__ */ jsx37(
|
|
5356
|
+
"input",
|
|
5357
|
+
{
|
|
5358
|
+
name: "minSize",
|
|
5359
|
+
type: "number",
|
|
5360
|
+
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",
|
|
5361
|
+
value: config.minSize || 5,
|
|
5362
|
+
onChange: onMinSizeChange,
|
|
5363
|
+
min: "1",
|
|
5364
|
+
max: "60"
|
|
5365
|
+
}
|
|
5366
|
+
)
|
|
5367
|
+
] }),
|
|
5368
|
+
/* @__PURE__ */ jsxs27("div", { className: "inline-flex h-8", children: [
|
|
5369
|
+
/* @__PURE__ */ jsx37(AddonLabel, { className: "rounded-l-md border border-r-0 px-2", children: "Max Size" }),
|
|
5370
|
+
/* @__PURE__ */ jsx37(
|
|
5371
|
+
"input",
|
|
5372
|
+
{
|
|
5373
|
+
name: "maxSize",
|
|
5374
|
+
type: "number",
|
|
5375
|
+
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",
|
|
5376
|
+
value: config.maxSize || 30,
|
|
5377
|
+
onChange: onMaxSizeChange,
|
|
5378
|
+
min: "1",
|
|
5379
|
+
max: "60"
|
|
5380
|
+
}
|
|
5381
|
+
)
|
|
5382
|
+
] })
|
|
5383
|
+
] })
|
|
5384
|
+
}
|
|
5385
|
+
);
|
|
5386
|
+
}
|
|
4790
5387
|
export {
|
|
4791
5388
|
AggregateInput,
|
|
4792
5389
|
AreaIcon_default as AreaIcon,
|
|
@@ -4799,6 +5396,7 @@ export {
|
|
|
4799
5396
|
ChartLegend,
|
|
4800
5397
|
ChartTooltip,
|
|
4801
5398
|
ChartTypeButtonGroup,
|
|
5399
|
+
DataControls,
|
|
4802
5400
|
EventsFunctionCategories,
|
|
4803
5401
|
EventsFunctionMap,
|
|
4804
5402
|
FunctionInput,
|
|
@@ -4810,6 +5408,7 @@ export {
|
|
|
4810
5408
|
LabelsInput,
|
|
4811
5409
|
LineControls,
|
|
4812
5410
|
LineIcon_default as LineIcon,
|
|
5411
|
+
MarkerControls,
|
|
4813
5412
|
PieChart2 as PieChart,
|
|
4814
5413
|
PieChartControls,
|
|
4815
5414
|
PieIcon_default as PieIcon,
|
|
@@ -4819,6 +5418,7 @@ export {
|
|
|
4819
5418
|
RefreshButton,
|
|
4820
5419
|
RefreshContext,
|
|
4821
5420
|
ScatterChartTooltip,
|
|
5421
|
+
ScatterControls,
|
|
4822
5422
|
ScatterIcon_default as ScatterIcon,
|
|
4823
5423
|
SystemLabels,
|
|
4824
5424
|
TableIcon_default as TableIcon,
|
|
@@ -4826,8 +5426,12 @@ export {
|
|
|
4826
5426
|
ValueFormatters,
|
|
4827
5427
|
ValueOptions,
|
|
4828
5428
|
ValueStringMapping,
|
|
5429
|
+
XAxisControls,
|
|
5430
|
+
YaxisControls,
|
|
4829
5431
|
defaultConfig2 as defaultBarGaugeConfig,
|
|
5432
|
+
defaultConfig5 as defaultDataConfig,
|
|
4830
5433
|
defaultConfig as defaultPieConfig,
|
|
5434
|
+
defaultConfig6 as defaultScatterConfig,
|
|
4831
5435
|
defaultConfig3 as defaultValueConfig,
|
|
4832
5436
|
defaultConfig4 as defaultValueControlsConfig,
|
|
4833
5437
|
isAggrOrRollupFunction,
|