@skygraph/react 0.5.3 → 0.5.4

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
@@ -22,7 +22,7 @@ import {
22
22
  zodRule,
23
23
  zodRules,
24
24
  zodToJsonSchema
25
- } from "./chunk-YTPUWPWA.js";
25
+ } from "./chunk-Y6XZ5TLD.js";
26
26
  import {
27
27
  Pagination,
28
28
  Select,
@@ -31,7 +31,7 @@ import {
31
31
  buildPrintHtml,
32
32
  printElement,
33
33
  useTable
34
- } from "./chunk-P4J4PFBG.js";
34
+ } from "./chunk-7AA2JPZB.js";
35
35
  import {
36
36
  Button,
37
37
  Input,
@@ -2676,6 +2676,21 @@ function startOfDay(d) {
2676
2676
  function cloneDate(d) {
2677
2677
  return new Date(d.getTime());
2678
2678
  }
2679
+ function startOfWeek(d) {
2680
+ const s = startOfDay(d);
2681
+ s.setDate(s.getDate() - s.getDay());
2682
+ return s;
2683
+ }
2684
+ function endOfWeek(d) {
2685
+ const e = startOfWeek(d);
2686
+ e.setDate(e.getDate() + 6);
2687
+ return e;
2688
+ }
2689
+ function getWeekOfYear(d) {
2690
+ const oneJan = new Date(d.getFullYear(), 0, 1);
2691
+ const dayOfYear = Math.floor((startOfDay(d).getTime() - startOfDay(oneJan).getTime()) / 864e5) + 1;
2692
+ return Math.ceil((dayOfYear + oneJan.getDay()) / 7);
2693
+ }
2679
2694
  function toValidDate(input) {
2680
2695
  if (input == null || input === "") return null;
2681
2696
  if (input instanceof Date) return isNaN(input.getTime()) ? null : input;
@@ -3077,6 +3092,7 @@ function DatePicker({
3077
3092
  const okBtnLabel = config.locale?.modal?.okText ?? "OK";
3078
3093
  const timeConfig = typeof showTime === "object" ? showTime : {};
3079
3094
  const hasTime = !!showTime;
3095
+ const isWeek = picker === "week";
3080
3096
  const fmt = formatProp ?? (hasTime ? "YYYY-MM-DD HH:mm:ss" : picker === "month" ? "YYYY-MM" : picker === "year" ? "YYYY" : "YYYY-MM-DD");
3081
3097
  const normalizedValue = toValidDate(value);
3082
3098
  const normalizedDefault = toValidDate(defaultValue);
@@ -3226,7 +3242,8 @@ function DatePicker({
3226
3242
  }
3227
3243
  if (e.key === "Escape") closeDropdown();
3228
3244
  };
3229
- const displayText = isInputting ? inputText : currentValue ? formatDate(currentValue, fmt) : "";
3245
+ const formatValue = (d) => isWeek ? `${d.getFullYear()}-W${String(getWeekOfYear(d)).padStart(2, "0")}` : formatDate(d, fmt);
3246
+ const displayText = isInputting ? inputText : currentValue ? formatValue(currentValue) : "";
3230
3247
  const wrapperCls = unstyled ? className ?? "" : [
3231
3248
  "sg-datepicker",
3232
3249
  `sg-datepicker-${size}`,
@@ -3291,7 +3308,9 @@ function DatePicker({
3291
3308
  {
3292
3309
  viewYear,
3293
3310
  viewMonth,
3294
- selectedDate: currentValue,
3311
+ selectedDate: isWeek ? null : currentValue,
3312
+ rangeStart: isWeek && currentValue ? startOfWeek(currentValue) : void 0,
3313
+ rangeEnd: isWeek && currentValue ? endOfWeek(currentValue) : void 0,
3295
3314
  disabledDate,
3296
3315
  onSelect: handleDateSelect,
3297
3316
  onMonthChange: (d) => {
@@ -3407,7 +3426,8 @@ function RangePicker({
3407
3426
  const [internalOpen, setInternalOpen] = useState5(false);
3408
3427
  const [activeIndex, setActiveIndex] = useState5(0);
3409
3428
  const [hoverDate, setHoverDate] = useState5(null);
3410
- const currentValue = normalizedValue ?? internalValue;
3429
+ const [draft, setDraft] = useState5(null);
3430
+ const currentValue = draft ?? normalizedValue ?? internalValue;
3411
3431
  const isOpen = openProp ?? internalOpen;
3412
3432
  const now = /* @__PURE__ */ new Date();
3413
3433
  const [leftYear, setLeftYear] = useState5(() => (currentValue[0] ?? now).getFullYear());
@@ -3424,6 +3444,8 @@ function RangePicker({
3424
3444
  if (ref.current && !ref.current.contains(e.target)) {
3425
3445
  setInternalOpen(false);
3426
3446
  onOpenChange?.(false);
3447
+ setDraft(null);
3448
+ setActiveIndex(0);
3427
3449
  }
3428
3450
  };
3429
3451
  document.addEventListener("mousedown", handle);
@@ -3446,7 +3468,7 @@ function RangePicker({
3446
3468
  };
3447
3469
  const handleDateSelect = (date) => {
3448
3470
  if (activeIndex === 0) {
3449
- setInternalValue([date, null]);
3471
+ setDraft([date, null]);
3450
3472
  setActiveIndex(1);
3451
3473
  } else {
3452
3474
  let start = currentValue[0];
@@ -3460,9 +3482,10 @@ function RangePicker({
3460
3482
  s.setHours(tempTimes[0].getHours(), tempTimes[0].getMinutes(), tempTimes[0].getSeconds());
3461
3483
  const e = cloneDate(end);
3462
3484
  e.setHours(tempTimes[1].getHours(), tempTimes[1].getMinutes(), tempTimes[1].getSeconds());
3463
- setInternalValue([s, e]);
3485
+ setDraft([s, e]);
3464
3486
  } else {
3465
3487
  commitRange([start, end]);
3488
+ setDraft(null);
3466
3489
  setInternalOpen(false);
3467
3490
  onOpenChange?.(false);
3468
3491
  setActiveIndex(0);
@@ -3471,6 +3494,7 @@ function RangePicker({
3471
3494
  };
3472
3495
  const handleTimeOk = () => {
3473
3496
  commitRange(currentValue);
3497
+ setDraft(null);
3474
3498
  setInternalOpen(false);
3475
3499
  onOpenChange?.(false);
3476
3500
  setActiveIndex(0);
@@ -3478,6 +3502,7 @@ function RangePicker({
3478
3502
  const handleClear = (e) => {
3479
3503
  e.stopPropagation();
3480
3504
  commitRange([null, null]);
3505
+ setDraft(null);
3481
3506
  setActiveIndex(0);
3482
3507
  };
3483
3508
  const handlePresetSelect = (val) => {
@@ -3486,6 +3511,8 @@ function RangePicker({
3486
3511
  } else {
3487
3512
  commitRange([val, val]);
3488
3513
  }
3514
+ setDraft(null);
3515
+ setActiveIndex(0);
3489
3516
  setInternalOpen(false);
3490
3517
  onOpenChange?.(false);
3491
3518
  };
@@ -3779,12 +3806,18 @@ function TimePicker({
3779
3806
  }, [secondStep]);
3780
3807
  const disHours = useMemo4(() => new Set(disabledHours?.() ?? []), [disabledHours]);
3781
3808
  const disMinutes = useMemo4(() => new Set(disabledMinutes?.(hour) ?? []), [disabledMinutes, hour]);
3782
- const disSecs = useMemo4(() => new Set(disabledSeconds?.(hour, minute) ?? []), [disabledSeconds, hour, minute]);
3783
- const commitTime = useCallback5((h, m, s) => {
3784
- const str = formatTime(h, m, s, fmt, use12Hours);
3785
- setInternalValue(str);
3786
- onChange?.(str);
3787
- }, [fmt, use12Hours, onChange]);
3809
+ const disSecs = useMemo4(
3810
+ () => new Set(disabledSeconds?.(hour, minute) ?? []),
3811
+ [disabledSeconds, hour, minute]
3812
+ );
3813
+ const commitTime = useCallback5(
3814
+ (h, m, s) => {
3815
+ const str = formatTime(h, m, s, fmt, use12Hours);
3816
+ setInternalValue(str);
3817
+ onChange?.(str);
3818
+ },
3819
+ [fmt, use12Hours, onChange]
3820
+ );
3788
3821
  const handleHourChange = (h) => {
3789
3822
  const realH = use12Hours ? h === 12 ? hour >= 12 ? 12 : 0 : hour >= 12 ? h + 12 : h : h;
3790
3823
  setHour(realH);
@@ -3839,10 +3872,26 @@ function TimePicker({
3839
3872
  "aria-label": ariaLabel,
3840
3873
  "aria-labelledby": ariaLabelledBy,
3841
3874
  children: [
3842
- /* @__PURE__ */ jsx9("span", { className: currentValue ? "" : unstyled ? "" : "sg-timepicker-placeholder", children: currentValue || placeholder }),
3875
+ /* @__PURE__ */ jsx9(
3876
+ "span",
3877
+ {
3878
+ className: unstyled ? "" : currentValue ? "sg-timepicker-value" : "sg-timepicker-placeholder",
3879
+ children: currentValue || placeholder
3880
+ }
3881
+ ),
3843
3882
  /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-suffix", children: loading ? /* @__PURE__ */ jsx9(Spin, { size: "small", unstyled }) : /* @__PURE__ */ jsxs9(Fragment3, { children: [
3844
3883
  allowClear && currentValue && /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-clear", onClick: handleClear, children: "\xD7" }),
3845
- /* @__PURE__ */ jsx9("svg", { className: unstyled ? "" : "sg-timepicker-icon-svg", viewBox: "0 0 16 16", width: "14", height: "14", fill: "currentColor", children: /* @__PURE__ */ jsx9("path", { d: "M8 0a8 8 0 110 16A8 8 0 018 0zm0 1a7 7 0 100 14A7 7 0 008 1zm.5 3v4.5l3 1.5-.5 1-3.5-1.75V4h1z" }) })
3884
+ /* @__PURE__ */ jsx9(
3885
+ "svg",
3886
+ {
3887
+ className: unstyled ? "" : "sg-timepicker-icon-svg",
3888
+ viewBox: "0 0 16 16",
3889
+ width: "14",
3890
+ height: "14",
3891
+ fill: "currentColor",
3892
+ children: /* @__PURE__ */ jsx9("path", { d: "M8 0a8 8 0 110 16A8 8 0 018 0zm0 1a7 7 0 100 14A7 7 0 008 1zm.5 3v4.5l3 1.5-.5 1-3.5-1.75V4h1z" })
3893
+ }
3894
+ )
3846
3895
  ] }) })
3847
3896
  ]
3848
3897
  }
@@ -3940,7 +3989,9 @@ function TimeRangePicker({
3940
3989
  const size = sizeProp ?? config.size ?? "middle";
3941
3990
  const disabled = disabledProp ?? config.disabled ?? false;
3942
3991
  const fmt = formatProp ?? (use12Hours ? "hh:mm:ss A" : showSecond ? "HH:mm:ss" : "HH:mm");
3943
- const [internalValue, setInternalValue] = useState6(value ?? defaultValue ?? ["", ""]);
3992
+ const [internalValue, setInternalValue] = useState6(
3993
+ value ?? defaultValue ?? ["", ""]
3994
+ );
3944
3995
  const [internalOpen, setInternalOpen] = useState6(false);
3945
3996
  const currentValue = value ?? internalValue;
3946
3997
  const isOpen = openProp ?? internalOpen;
@@ -3985,12 +4036,19 @@ function TimeRangePicker({
3985
4036
  className
3986
4037
  ].filter(Boolean).join(" ");
3987
4038
  return /* @__PURE__ */ jsxs9("div", { className: wrapperCls, ref, style, children: [
3988
- /* @__PURE__ */ jsxs9("div", { className: unstyled ? "" : "sg-timepicker-input sg-timepicker-range-input", onClick: openDropdown, children: [
3989
- /* @__PURE__ */ jsx9("span", { children: currentValue[0] || placeholder[0] }),
3990
- /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-separator", children: separator }),
3991
- /* @__PURE__ */ jsx9("span", { children: currentValue[1] || placeholder[1] }),
3992
- /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-suffix", children: allowClear && (currentValue[0] || currentValue[1]) && /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-clear", onClick: handleClear, children: "\xD7" }) })
3993
- ] }),
4039
+ /* @__PURE__ */ jsxs9(
4040
+ "div",
4041
+ {
4042
+ className: unstyled ? "" : "sg-timepicker-input sg-timepicker-range-input",
4043
+ onClick: openDropdown,
4044
+ children: [
4045
+ /* @__PURE__ */ jsx9("span", { children: currentValue[0] || placeholder[0] }),
4046
+ /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-separator", children: separator }),
4047
+ /* @__PURE__ */ jsx9("span", { children: currentValue[1] || placeholder[1] }),
4048
+ /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-suffix", children: allowClear && (currentValue[0] || currentValue[1]) && /* @__PURE__ */ jsx9("span", { className: unstyled ? "" : "sg-timepicker-clear", onClick: handleClear, children: "\xD7" }) })
4049
+ ]
4050
+ }
4051
+ ),
3994
4052
  isOpen && /* @__PURE__ */ jsx9("div", { className: unstyled ? "" : "sg-tp-dropdown sg-tp-dropdown-range", children: /* @__PURE__ */ jsxs9("div", { className: unstyled ? "" : "sg-tp-range-panels", children: [
3995
4053
  /* @__PURE__ */ jsx9(
3996
4054
  TimePicker,
@@ -4055,9 +4113,7 @@ function AutoComplete({
4055
4113
  const [open, setOpen] = useState7(false);
4056
4114
  const ref = useRef6(null);
4057
4115
  const currentValue = value ?? internalValue;
4058
- const filtered = options.filter(
4059
- (o) => o.label.toLowerCase().includes(currentValue.toLowerCase())
4060
- );
4116
+ const filtered = options.filter((o) => o.label.toLowerCase().includes(currentValue.toLowerCase()));
4061
4117
  useEffect8(() => {
4062
4118
  const handleClickOutside = (e) => {
4063
4119
  if (ref.current && !ref.current.contains(e.target)) setOpen(false);
@@ -4078,7 +4134,12 @@ function AutoComplete({
4078
4134
  onSelect?.(opt.value, opt);
4079
4135
  setOpen(false);
4080
4136
  };
4081
- const wrapperClass = unstyled ? className ?? "" : ["sg-autocomplete", `sg-autocomplete-${size}`, loading ? "sg-autocomplete-loading" : "", className].filter(Boolean).join(" ");
4137
+ const wrapperClass = unstyled ? className ?? "" : [
4138
+ "sg-autocomplete",
4139
+ `sg-autocomplete-${size}`,
4140
+ loading ? "sg-autocomplete-loading" : "",
4141
+ className
4142
+ ].filter(Boolean).join(" ");
4082
4143
  return /* @__PURE__ */ jsxs10("div", { className: wrapperClass, ref, style, children: [
4083
4144
  /* @__PURE__ */ jsxs10("span", { className: unstyled ? "" : "sg-input-wrapper", children: [
4084
4145
  /* @__PURE__ */ jsx10(
@@ -4091,7 +4152,8 @@ function AutoComplete({
4091
4152
  className: unstyled ? "" : `sg-input sg-input-${size}`,
4092
4153
  value: currentValue,
4093
4154
  placeholder,
4094
- disabled: disabled || loading,
4155
+ disabled,
4156
+ "aria-busy": loading || void 0,
4095
4157
  onChange: handleChange,
4096
4158
  onFocus: () => setOpen(true),
4097
4159
  onBlur
@@ -4559,32 +4621,53 @@ function NotificationCard({
4559
4621
  const type = item.type ?? "info";
4560
4622
  const closeAriaLabel = useConfig().locale?.notification?.closeAriaLabel ?? "Close";
4561
4623
  if (unstyled) {
4562
- return /* @__PURE__ */ jsxs13("div", { role: "alert", children: [
4624
+ return /* @__PURE__ */ jsxs13("div", { role: "alert", className: item.className, style: item.style, children: [
4563
4625
  /* @__PURE__ */ jsx14("span", { children: typeIcons[type] }),
4564
4626
  /* @__PURE__ */ jsx14("span", { children: item.message }),
4565
4627
  item.description && /* @__PURE__ */ jsx14("div", { children: item.description }),
4566
4628
  /* @__PURE__ */ jsx14("button", { onClick: onClose, "aria-label": closeAriaLabel, children: "\xD7" })
4567
4629
  ] });
4568
4630
  }
4569
- return /* @__PURE__ */ jsxs13("div", { className: `sg-notification sg-notification-${type}`, role: "alert", children: [
4570
- /* @__PURE__ */ jsx14("div", { className: "sg-notification-icon", children: typeIcons[type] }),
4571
- /* @__PURE__ */ jsxs13("div", { className: "sg-notification-content", children: [
4572
- /* @__PURE__ */ jsx14("div", { className: "sg-notification-message", children: item.message }),
4573
- item.description && /* @__PURE__ */ jsx14("div", { className: "sg-notification-description", children: item.description })
4574
- ] }),
4575
- /* @__PURE__ */ jsx14("button", { className: "sg-notification-close", onClick: onClose, "aria-label": closeAriaLabel, children: "\xD7" })
4576
- ] });
4631
+ return /* @__PURE__ */ jsxs13(
4632
+ "div",
4633
+ {
4634
+ className: ["sg-notification", `sg-notification-${type}`, item.className].filter(Boolean).join(" "),
4635
+ style: item.style,
4636
+ role: "alert",
4637
+ children: [
4638
+ /* @__PURE__ */ jsx14("div", { className: "sg-notification-icon", children: typeIcons[type] }),
4639
+ /* @__PURE__ */ jsxs13("div", { className: "sg-notification-content", children: [
4640
+ /* @__PURE__ */ jsx14("div", { className: "sg-notification-message", children: item.message }),
4641
+ item.description && /* @__PURE__ */ jsx14("div", { className: "sg-notification-description", children: item.description })
4642
+ ] }),
4643
+ /* @__PURE__ */ jsx14("button", { className: "sg-notification-close", onClick: onClose, "aria-label": closeAriaLabel, children: "\xD7" })
4644
+ ]
4645
+ }
4646
+ );
4577
4647
  }
4578
4648
 
4579
4649
  // src/components/ui/Drawer.tsx
4580
- import { useEffect as useEffect10, useCallback as useCallback7, useId as useId2 } from "react";
4581
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
4650
+ import { useEffect as useEffect10, useCallback as useCallback7, useId as useId2, useRef as useRef10 } from "react";
4651
+ import { createPortal } from "react-dom";
4652
+ import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
4582
4653
  var PLACEMENT_TRANSITION = {
4583
4654
  left: "sg-slide-left",
4584
4655
  right: "sg-slide-right",
4585
4656
  top: "sg-slide-down",
4586
4657
  bottom: "sg-slide-up"
4587
4658
  };
4659
+ function getScopedCssVars(scope) {
4660
+ if (!scope || typeof window === "undefined") return {};
4661
+ const computed = window.getComputedStyle(scope);
4662
+ const vars = {};
4663
+ for (let i = 0; i < computed.length; i += 1) {
4664
+ const name = computed.item(i);
4665
+ if (name.startsWith("--sg-")) {
4666
+ vars[name] = computed.getPropertyValue(name);
4667
+ }
4668
+ }
4669
+ return vars;
4670
+ }
4588
4671
  function Drawer({
4589
4672
  open,
4590
4673
  onClose,
@@ -4605,6 +4688,7 @@ function Drawer({
4605
4688
  const titleId = `${uid}-title`;
4606
4689
  const bodyId = `${uid}-body`;
4607
4690
  const trapRef = useFocusTrap(open);
4691
+ const scopeRef = useRef10(null);
4608
4692
  const { locale } = useConfig();
4609
4693
  const closeAriaLabel = locale?.drawer?.closeAriaLabel ?? "Close";
4610
4694
  const handleKeyDown = useCallback7(
@@ -4642,7 +4726,8 @@ function Drawer({
4642
4726
  );
4643
4727
  }
4644
4728
  const transitionName = PLACEMENT_TRANSITION[placement] ?? "sg-slide-right";
4645
- return /* @__PURE__ */ jsx15(Transition, { visible: open, name: "sg-fade", unmountOnExit: true, duration: 300, children: /* @__PURE__ */ jsxs14("div", { className: "sg-drawer-root", children: [
4729
+ const portalTarget = typeof document !== "undefined" ? document.body : null;
4730
+ const drawer = /* @__PURE__ */ jsx15(Transition, { visible: open, name: "sg-fade", unmountOnExit: true, duration: 300, children: /* @__PURE__ */ jsxs14("div", { className: "sg-drawer-root", style: getScopedCssVars(scopeRef.current), children: [
4646
4731
  mask && /* @__PURE__ */ jsx15("div", { className: "sg-drawer-mask", onClick: maskClosable ? onClose : void 0 }),
4647
4732
  /* @__PURE__ */ jsx15(Transition, { visible: open, name: transitionName, unmountOnExit: true, duration: 300, children: /* @__PURE__ */ jsxs14(
4648
4733
  "div",
@@ -4674,10 +4759,14 @@ function Drawer({
4674
4759
  }
4675
4760
  ) })
4676
4761
  ] }) });
4762
+ return /* @__PURE__ */ jsxs14(Fragment5, { children: [
4763
+ /* @__PURE__ */ jsx15("span", { ref: scopeRef, hidden: true }),
4764
+ portalTarget ? createPortal(drawer, portalTarget) : drawer
4765
+ ] });
4677
4766
  }
4678
4767
 
4679
4768
  // src/components/ui/Popconfirm.tsx
4680
- import { useState as useState10, useRef as useRef10, useEffect as useEffect11, useId as useId3 } from "react";
4769
+ import { useState as useState10, useRef as useRef11, useEffect as useEffect11, useId as useId3 } from "react";
4681
4770
  import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
4682
4771
  function Popconfirm({
4683
4772
  title,
@@ -4696,7 +4785,7 @@ function Popconfirm({
4696
4785
  const okText = okTextProp ?? popconfirmLocale?.okText ?? "Yes";
4697
4786
  const cancelText = cancelTextProp ?? popconfirmLocale?.cancelText ?? "No";
4698
4787
  const [open, setOpen] = useState10(false);
4699
- const ref = useRef10(null);
4788
+ const ref = useRef11(null);
4700
4789
  const trapRef = useFocusTrap(open);
4701
4790
  const popconfirmId = useId3();
4702
4791
  useEffect11(() => {
@@ -4967,7 +5056,7 @@ function Breadcrumb({
4967
5056
  }
4968
5057
 
4969
5058
  // src/components/ui/Dropdown.tsx
4970
- import { useState as useState11, useRef as useRef11, useEffect as useEffect12, useId as useId4 } from "react";
5059
+ import { useState as useState11, useRef as useRef12, useEffect as useEffect12, useId as useId4 } from "react";
4971
5060
  import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4972
5061
  function Dropdown({
4973
5062
  items: items2,
@@ -4983,8 +5072,8 @@ function Dropdown({
4983
5072
  const disabled = disabledProp ?? config.disabled ?? false;
4984
5073
  const [open, setOpen] = useState11(false);
4985
5074
  const [focusedIndex, setFocusedIndex] = useState11(-1);
4986
- const ref = useRef11(null);
4987
- const timerRef = useRef11(void 0);
5075
+ const ref = useRef12(null);
5076
+ const timerRef = useRef12(void 0);
4988
5077
  const menuId = useId4();
4989
5078
  useEffect12(() => {
4990
5079
  if (!open) return;
@@ -5256,7 +5345,7 @@ function Progress({
5256
5345
  }
5257
5346
 
5258
5347
  // src/components/ui/Menu.tsx
5259
- import { useState as useState12, useRef as useRef12, useEffect as useEffect13, useCallback as useCallback8 } from "react";
5348
+ import { useState as useState12, useRef as useRef13, useEffect as useEffect13, useCallback as useCallback8 } from "react";
5260
5349
  import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
5261
5350
  function collectNavigableItems(items2, openKeys, mode, out = []) {
5262
5351
  for (const item of items2) {
@@ -5315,7 +5404,7 @@ function Menu({
5315
5404
  const [internalOpen, setInternalOpen] = useState12(
5316
5405
  openKeys ?? defaultOpenKeys
5317
5406
  );
5318
- const rootRef = useRef12(null);
5407
+ const rootRef = useRef13(null);
5319
5408
  const currentSelected = selectedKeys ?? internalSelected;
5320
5409
  const currentOpen = openKeys ?? internalOpen;
5321
5410
  const navigable = collectNavigableItems(items2, currentOpen, mode);
@@ -5591,9 +5680,9 @@ function StyledMenuItem({
5591
5680
  inlineCollapsed,
5592
5681
  depth
5593
5682
  }) {
5594
- const popoverRef = useRef12(null);
5683
+ const popoverRef = useRef13(null);
5595
5684
  const [hoverOpen, setHoverOpen] = useState12(false);
5596
- const timerRef = useRef12(void 0);
5685
+ const timerRef = useRef13(void 0);
5597
5686
  useEffect13(() => {
5598
5687
  return () => clearTimeout(timerRef.current);
5599
5688
  }, []);
@@ -5741,7 +5830,7 @@ function StyledMenuItem({
5741
5830
  }
5742
5831
 
5743
5832
  // src/components/ui/Collapse.tsx
5744
- import { useState as useState13, useRef as useRef13, useEffect as useEffect14 } from "react";
5833
+ import { useState as useState13, useRef as useRef14, useEffect as useEffect14 } from "react";
5745
5834
  import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
5746
5835
  function toArray(val) {
5747
5836
  if (val === void 0) return [];
@@ -5827,9 +5916,9 @@ function CollapsePanel({
5827
5916
  expandIconPosition,
5828
5917
  onToggle
5829
5918
  }) {
5830
- const contentRef = useRef13(null);
5919
+ const contentRef = useRef14(null);
5831
5920
  const [height, setHeight] = useState13(void 0);
5832
- const firstRender = useRef13(true);
5921
+ const firstRender = useRef14(true);
5833
5922
  useEffect14(() => {
5834
5923
  if (firstRender.current) {
5835
5924
  firstRender.current = false;
@@ -5905,7 +5994,7 @@ function CollapsePanel({
5905
5994
  // src/components/ui/ColorPicker.tsx
5906
5995
  import {
5907
5996
  useState as useState14,
5908
- useRef as useRef14,
5997
+ useRef as useRef15,
5909
5998
  useEffect as useEffect15,
5910
5999
  useCallback as useCallback9
5911
6000
  } from "react";
@@ -6048,11 +6137,11 @@ function ColorPicker({
6048
6137
  const [internalOpen, setInternalOpen] = useState14(false);
6049
6138
  const isOpen = controlledOpen ?? internalOpen;
6050
6139
  const [textInput, setTextInput] = useState14(formatColor(currentHex, format));
6051
- const wrapperRef = useRef14(null);
6052
- const timerRef = useRef14(void 0);
6053
- const satPanelRef = useRef14(null);
6054
- const hueBarRef = useRef14(null);
6055
- const draggingRef = useRef14(null);
6140
+ const wrapperRef = useRef15(null);
6141
+ const timerRef = useRef15(void 0);
6142
+ const satPanelRef = useRef15(null);
6143
+ const hueBarRef = useRef15(null);
6144
+ const draggingRef = useRef15(null);
6056
6145
  useEffect15(() => {
6057
6146
  if (value) {
6058
6147
  const [r, g, b] = hexToRgb(value);
@@ -6330,7 +6419,7 @@ function ColorPicker({
6330
6419
  }
6331
6420
 
6332
6421
  // src/components/ui/Empty.tsx
6333
- import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
6422
+ import { Fragment as Fragment6, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
6334
6423
  var DefaultImage = () => /* @__PURE__ */ jsx26("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxs24("g", { fill: "none", fillRule: "evenodd", transform: "translate(0 1)", children: [
6335
6424
  /* @__PURE__ */ jsx26("ellipse", { cx: "32", cy: "33", rx: "32", ry: "7", fill: "currentColor", opacity: "0.08" }),
6336
6425
  /* @__PURE__ */ jsxs24("g", { fillRule: "nonzero", stroke: "currentColor", strokeOpacity: "0.25", children: [
@@ -6348,7 +6437,7 @@ var DefaultImage = () => /* @__PURE__ */ jsx26("svg", { width: "64", height: "41
6348
6437
  function Empty({ image, description, children, className, style, unstyled }) {
6349
6438
  const config = useConfig();
6350
6439
  if (config.renderEmpty && image === void 0 && description === void 0 && children === void 0) {
6351
- return /* @__PURE__ */ jsx26(Fragment5, { children: config.renderEmpty("Empty") });
6440
+ return /* @__PURE__ */ jsx26(Fragment6, { children: config.renderEmpty("Empty") });
6352
6441
  }
6353
6442
  const localeDefault = config.locale?.empty?.description ?? "No Data";
6354
6443
  const desc = description === void 0 ? localeDefault : description;
@@ -6426,7 +6515,7 @@ function Result({
6426
6515
  }
6427
6516
 
6428
6517
  // src/components/ui/Skeleton.tsx
6429
- import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
6518
+ import { Fragment as Fragment7, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
6430
6519
  function Skeleton({
6431
6520
  active = false,
6432
6521
  avatar,
@@ -6439,7 +6528,7 @@ function Skeleton({
6439
6528
  unstyled
6440
6529
  }) {
6441
6530
  const loadingLabel = useConfig().locale?.skeleton?.loading ?? "Loading";
6442
- if (!loading) return /* @__PURE__ */ jsx28(Fragment6, { children });
6531
+ if (!loading) return /* @__PURE__ */ jsx28(Fragment7, { children });
6443
6532
  const avatarSize = typeof avatar === "object" ? avatar.size ?? 40 : 40;
6444
6533
  const avatarShape = typeof avatar === "object" ? avatar.shape ?? "circle" : "circle";
6445
6534
  const titleWidth = typeof title === "object" ? title.width ?? "38%" : "38%";
@@ -6929,7 +7018,7 @@ function Descriptions({
6929
7018
  import { useEffect as useEffect17, useMemo as useMemo9, useState as useState18 } from "react";
6930
7019
 
6931
7020
  // src/components/complex/SchemaFormEditor/useSchemaEditor.ts
6932
- import { useCallback as useCallback11, useMemo as useMemo5, useRef as useRef15, useSyncExternalStore } from "react";
7021
+ import { useCallback as useCallback11, useMemo as useMemo5, useRef as useRef16, useSyncExternalStore } from "react";
6933
7022
  import { createCore } from "@skygraph/core";
6934
7023
 
6935
7024
  // src/components/complex/SchemaFormEditor/adapters/jsonSchema.ts
@@ -7113,9 +7202,9 @@ function cloneSchema(schema) {
7113
7202
  }
7114
7203
  function useSchemaEditor(options = {}) {
7115
7204
  const { initialSchema, onChange } = options;
7116
- const onChangeRef = useRef15(onChange);
7205
+ const onChangeRef = useRef16(onChange);
7117
7206
  onChangeRef.current = onChange;
7118
- const storeRef = useRef15(null);
7207
+ const storeRef = useRef16(null);
7119
7208
  if (storeRef.current === null) {
7120
7209
  const core = options.core ?? createCore();
7121
7210
  const initial = {
@@ -7437,8 +7526,8 @@ function SchemaFormEditorPalette({
7437
7526
  }
7438
7527
 
7439
7528
  // src/components/complex/SchemaFormEditor/SchemaFormEditorCanvas.tsx
7440
- import { useCallback as useCallback12, useMemo as useMemo6, useRef as useRef16, useState as useState17 } from "react";
7441
- import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
7529
+ import { useCallback as useCallback12, useMemo as useMemo6, useRef as useRef17, useState as useState17 } from "react";
7530
+ import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
7442
7531
  function SchemaFormEditorCanvas({
7443
7532
  store,
7444
7533
  emptyText = "Drop a field here",
@@ -7465,7 +7554,7 @@ function SchemaFormEditorCanvas({
7465
7554
  [fields]
7466
7555
  );
7467
7556
  const [dropIndicator, setDropIndicator] = useState17(null);
7468
- const dragRef = useRef16(null);
7557
+ const dragRef = useRef17(null);
7469
7558
  function handleDragOver(e) {
7470
7559
  if (e.dataTransfer.types.includes(PALETTE_DATA_TYPE) || e.dataTransfer.types.includes("text/plain") || dragRef.current !== null) {
7471
7560
  e.preventDefault();
@@ -7616,7 +7705,7 @@ function FieldOverlay({
7616
7705
  function handleDragLeave() {
7617
7706
  onIndicator(null);
7618
7707
  }
7619
- return /* @__PURE__ */ jsxs33(Fragment7, { children: [
7708
+ return /* @__PURE__ */ jsxs33(Fragment8, { children: [
7620
7709
  showIndicator && /* @__PURE__ */ jsx35("div", { className: "sg-sfe-canvas-drop-indicator", "data-testid": "sfe-drop-indicator" }),
7621
7710
  /* @__PURE__ */ jsxs33(
7622
7711
  "div",
@@ -8118,7 +8207,7 @@ function PreviewPane({ store }) {
8118
8207
  import { createVirtual, createMeasureCache } from "@skygraph/core";
8119
8208
 
8120
8209
  // src/hooks/useGraph.ts
8121
- import { useMemo as useMemo10, useRef as useRef17, useSyncExternalStore as useSyncExternalStore2 } from "react";
8210
+ import { useMemo as useMemo10, useRef as useRef18, useSyncExternalStore as useSyncExternalStore2 } from "react";
8122
8211
  import { createCore as createCore2, createGraph } from "@skygraph/core";
8123
8212
  function useGraph(options = {}) {
8124
8213
  const { core: externalCore, ...graphOptions } = options;
@@ -8127,7 +8216,7 @@ function useGraph(options = {}) {
8127
8216
  const g = createGraph(c, graphOptions);
8128
8217
  return { graph: g, core: c };
8129
8218
  }, [externalCore]);
8130
- const snapshotRef = useRef17(null);
8219
+ const snapshotRef = useRef18(null);
8131
8220
  if (snapshotRef.current === null) {
8132
8221
  snapshotRef.current = graph.getState();
8133
8222
  }
@@ -8149,7 +8238,7 @@ import {
8149
8238
  useEffect as useEffect18,
8150
8239
  useImperativeHandle,
8151
8240
  useMemo as useMemo11,
8152
- useRef as useRef18,
8241
+ useRef as useRef19,
8153
8242
  useState as useState19
8154
8243
  } from "react";
8155
8244
  import {
@@ -8411,14 +8500,14 @@ function DiagramInner({
8411
8500
  return m;
8412
8501
  }, [nodes, allBounds]);
8413
8502
  const [view, setView] = useState19({ zoom: 1, panX: 0, panY: 0 });
8414
- const wrapperRef = useRef18(null);
8503
+ const wrapperRef = useRef19(null);
8415
8504
  const isSelectionControlled = selection !== void 0;
8416
8505
  const [internalSelection, setInternalSelection] = useState19(
8417
8506
  () => defaultSelection ?? []
8418
8507
  );
8419
8508
  const currentSelection = isSelectionControlled ? selection : internalSelection;
8420
8509
  const selectionSet = useMemo11(() => new Set(currentSelection), [currentSelection]);
8421
- const onSelectionChangeRef = useRef18(onSelectionChange);
8510
+ const onSelectionChangeRef = useRef19(onSelectionChange);
8422
8511
  useEffect18(() => {
8423
8512
  onSelectionChangeRef.current = onSelectionChange;
8424
8513
  }, [onSelectionChange]);
@@ -8475,7 +8564,7 @@ function DiagramInner({
8475
8564
  width: "100%",
8476
8565
  height: "100%"
8477
8566
  };
8478
- const dragRef = useRef18(null);
8567
+ const dragRef = useRef19(null);
8479
8568
  const [draggingId, setDraggingId] = useState19(null);
8480
8569
  const DRAG_THRESHOLD_PX = 0.5;
8481
8570
  function applyMove(id, x, y) {
@@ -8590,16 +8679,16 @@ function DiagramInner({
8590
8679
  }
8591
8680
  }
8592
8681
  const [lasso, setLasso] = useState19(null);
8593
- const lassoRef = useRef18(null);
8594
- const boundsByIdRef = useRef18(boundsById);
8682
+ const lassoRef = useRef19(null);
8683
+ const boundsByIdRef = useRef19(boundsById);
8595
8684
  useEffect18(() => {
8596
8685
  boundsByIdRef.current = boundsById;
8597
8686
  }, [boundsById]);
8598
- const viewRef = useRef18(view);
8687
+ const viewRef = useRef19(view);
8599
8688
  useEffect18(() => {
8600
8689
  viewRef.current = view;
8601
8690
  }, [view]);
8602
- const wrapperSessionRef = useRef18(null);
8691
+ const wrapperSessionRef = useRef19(null);
8603
8692
  function startLasso(e) {
8604
8693
  const rect = wrapperRef.current?.getBoundingClientRect();
8605
8694
  if (!rect) return;
@@ -8752,10 +8841,10 @@ function DiagramInner({
8752
8841
  }
8753
8842
  const [hoveredNode, setHoveredNode] = useState19(null);
8754
8843
  const [hoveredEdge, setHoveredEdge] = useState19(null);
8755
- const nodeHoverShowTimer = useRef18(null);
8756
- const nodeHoverHideTimer = useRef18(null);
8757
- const edgeHoverShowTimer = useRef18(null);
8758
- const edgeHoverHideTimer = useRef18(null);
8844
+ const nodeHoverShowTimer = useRef19(null);
8845
+ const nodeHoverHideTimer = useRef19(null);
8846
+ const edgeHoverShowTimer = useRef19(null);
8847
+ const edgeHoverHideTimer = useRef19(null);
8759
8848
  const clearTimer = (ref) => {
8760
8849
  if (ref.current != null) {
8761
8850
  window.clearTimeout(ref.current);
@@ -9053,7 +9142,7 @@ import {
9053
9142
  useCallback as useCallback14,
9054
9143
  useEffect as useEffect19,
9055
9144
  useMemo as useMemo12,
9056
- useRef as useRef19,
9145
+ useRef as useRef20,
9057
9146
  useState as useState20
9058
9147
  } from "react";
9059
9148
  import { jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
@@ -9208,7 +9297,7 @@ function WidgetActionsMenu({
9208
9297
  onActivateMaximize
9209
9298
  }) {
9210
9299
  const dashboardLocale = useConfig().locale?.dashboard;
9211
- const wrapperRef = useRef19(null);
9300
+ const wrapperRef = useRef20(null);
9212
9301
  useEffect19(() => {
9213
9302
  if (!open) return;
9214
9303
  const onDocClick = (ev) => {
@@ -9312,7 +9401,7 @@ function MoreIcon() {
9312
9401
  // src/components/complex/Dashboard/DashboardEditor.tsx
9313
9402
  import {
9314
9403
  useMemo as useMemo13,
9315
- useRef as useRef20,
9404
+ useRef as useRef21,
9316
9405
  useState as useState21
9317
9406
  } from "react";
9318
9407
  import { jsx as jsx42 } from "react/jsx-runtime";
@@ -9338,12 +9427,12 @@ function DashboardEditor({
9338
9427
  onWidgetRemove
9339
9428
  }) {
9340
9429
  const dashboardLocale = useConfig().locale?.dashboard;
9341
- const gridRef = useRef20(null);
9342
- const dragRef = useRef20(null);
9430
+ const gridRef = useRef21(null);
9431
+ const dragRef = useRef21(null);
9343
9432
  const [maximizedId, setMaximizedId] = useState21(null);
9344
- const widgetsRef = useRef20(widgets);
9433
+ const widgetsRef = useRef21(widgets);
9345
9434
  widgetsRef.current = widgets;
9346
- const onChangeRef = useRef20(onLayoutChange);
9435
+ const onChangeRef = useRef21(onLayoutChange);
9347
9436
  onChangeRef.current = onLayoutChange;
9348
9437
  function emitChange(widgetId, patch) {
9349
9438
  const cb = onChangeRef.current;
@@ -9516,7 +9605,7 @@ function DashboardEditor({
9516
9605
  import {
9517
9606
  useCallback as useCallback15,
9518
9607
  useMemo as useMemo14,
9519
- useRef as useRef21
9608
+ useRef as useRef22
9520
9609
  } from "react";
9521
9610
  import { pointsToPath as pointsToPath2 } from "@skygraph/core";
9522
9611
  import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
@@ -9603,7 +9692,7 @@ function Gantt({
9603
9692
  style
9604
9693
  }) {
9605
9694
  const ganttLocale = useConfig().locale?.gantt;
9606
- const onChangeRef = useRef21(onTaskChange);
9695
+ const onChangeRef = useRef22(onTaskChange);
9607
9696
  onChangeRef.current = onTaskChange;
9608
9697
  const resolved = useMemo14(() => {
9609
9698
  const step = STEP_MS[scale];
@@ -9691,7 +9780,7 @@ function Gantt({
9691
9780
  }
9692
9781
  return out;
9693
9782
  }, [taskRects, taskRectById]);
9694
- const dragRef = useRef21(null);
9783
+ const dragRef = useRef22(null);
9695
9784
  const startInteraction = useCallback15(
9696
9785
  (e, task, kind) => {
9697
9786
  if (e.button !== 0) return;
@@ -9978,7 +10067,7 @@ import {
9978
10067
  useCallback as useCallback16,
9979
10068
  useEffect as useEffect20,
9980
10069
  useMemo as useMemo15,
9981
- useRef as useRef22,
10070
+ useRef as useRef23,
9982
10071
  useState as useState22
9983
10072
  } from "react";
9984
10073
  import { detectConflicts, isAvailable } from "@skygraph/core";
@@ -10065,9 +10154,9 @@ function ResourceCalendar({
10065
10154
  style
10066
10155
  }) {
10067
10156
  const resourceCalendarLocale = useConfig().locale?.resourceCalendar;
10068
- const onChangeRef = useRef22(onAssignmentChange);
10157
+ const onChangeRef = useRef23(onAssignmentChange);
10069
10158
  onChangeRef.current = onAssignmentChange;
10070
- const onConflictRef = useRef22(onConflict);
10159
+ const onConflictRef = useRef23(onConflict);
10071
10160
  onConflictRef.current = onConflict;
10072
10161
  const [ghost, setGhost] = useState22(null);
10073
10162
  const step = STEP_MS2[scale];
@@ -10133,7 +10222,7 @@ function ResourceCalendar({
10133
10222
  () => conflicts.map((c) => `${c.reason}:${c.assignmentIds.join(",")}`).sort().join("|"),
10134
10223
  [conflicts]
10135
10224
  );
10136
- const lastKeyRef = useRef22("");
10225
+ const lastKeyRef = useRef23("");
10137
10226
  useEffect20(() => {
10138
10227
  if (lastKeyRef.current === conflictKey) return;
10139
10228
  lastKeyRef.current = conflictKey;
@@ -10191,7 +10280,7 @@ function ResourceCalendar({
10191
10280
  }
10192
10281
  return out;
10193
10282
  }, [rules, resources, rowIndexById, rangeStart, rangeEnd, step, pxPerMs, rowHeight]);
10194
- const dragRef = useRef22(null);
10283
+ const dragRef = useRef23(null);
10195
10284
  const startInteraction = useCallback16(
10196
10285
  (e, assignment, kind) => {
10197
10286
  if (e.button !== 0) return;
@@ -10525,8 +10614,8 @@ function ResourceCalendar({
10525
10614
  }
10526
10615
 
10527
10616
  // src/components/complex/Timeline/Timeline.tsx
10528
- import { Fragment as Fragment8, useMemo as useMemo16 } from "react";
10529
- import { Fragment as Fragment9, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
10617
+ import { Fragment as Fragment9, useMemo as useMemo16 } from "react";
10618
+ import { Fragment as Fragment10, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
10530
10619
  function toMs3(v) {
10531
10620
  return v instanceof Date ? v.getTime() : v;
10532
10621
  }
@@ -10607,7 +10696,7 @@ function EventTimeline({
10607
10696
  "aria-label": timelineLocale?.ariaLabel ?? "Timeline",
10608
10697
  "data-orientation": orientation,
10609
10698
  "data-group-by": groupBy ?? "none",
10610
- children: groups.map((group) => /* @__PURE__ */ jsxs40(Fragment8, { children: [
10699
+ children: groups.map((group) => /* @__PURE__ */ jsxs40(Fragment9, { children: [
10611
10700
  groupBy && /* @__PURE__ */ jsx45(
10612
10701
  "div",
10613
10702
  {
@@ -10625,7 +10714,7 @@ function EventTimeline({
10625
10714
  "aria-hidden": "true"
10626
10715
  }
10627
10716
  );
10628
- const body = renderEvent ? renderEvent(ev) : /* @__PURE__ */ jsxs40(Fragment9, { children: [
10717
+ const body = renderEvent ? renderEvent(ev) : /* @__PURE__ */ jsxs40(Fragment10, { children: [
10629
10718
  /* @__PURE__ */ jsx45("div", { className: unstyled ? void 0 : "sg-event-timeline-title", children: ev.title }),
10630
10719
  ev.description !== void 0 && /* @__PURE__ */ jsx45("div", { className: unstyled ? void 0 : "sg-event-timeline-description", children: ev.description })
10631
10720
  ] });
@@ -10766,7 +10855,7 @@ function ChartLegend({ series, className, style }) {
10766
10855
  }
10767
10856
 
10768
10857
  // src/components/complex/Charts/ChartCrosshair.tsx
10769
- import { Fragment as Fragment10 } from "react";
10858
+ import { Fragment as Fragment11 } from "react";
10770
10859
  import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
10771
10860
  var TIP_WIDTH = 140;
10772
10861
  var TIP_LINE_HEIGHT = 14;
@@ -10860,7 +10949,7 @@ function ChartCrosshair({
10860
10949
  ),
10861
10950
  points.map((p, i) => {
10862
10951
  const rowY = tipY + TIP_PADDING + headerHeight + i * TIP_LINE_HEIGHT;
10863
- return /* @__PURE__ */ jsxs42(Fragment10, { children: [
10952
+ return /* @__PURE__ */ jsxs42(Fragment11, { children: [
10864
10953
  /* @__PURE__ */ jsx47(
10865
10954
  "rect",
10866
10955
  {
@@ -10905,7 +10994,7 @@ function ChartCrosshair({
10905
10994
  }
10906
10995
 
10907
10996
  // src/components/complex/Charts/ChartBrush.tsx
10908
- import { useMemo as useMemo17, useRef as useRef23, useState as useState23 } from "react";
10997
+ import { useMemo as useMemo17, useRef as useRef24, useState as useState23 } from "react";
10909
10998
  import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
10910
10999
  function resolveBrushConfig(brush) {
10911
11000
  if (brush == null || brush === false) return null;
@@ -10940,7 +11029,7 @@ function ChartBrush({
10940
11029
  fill,
10941
11030
  disabled
10942
11031
  }) {
10943
- const overlayRef = useRef23(null);
11032
+ const overlayRef = useRef24(null);
10944
11033
  const [drag, setDrag] = useState23(null);
10945
11034
  const cls4 = (suffix) => unstyled ? void 0 : `sg-chart-brush-${suffix}`;
10946
11035
  const clientToCategoryIndex = (clientX) => {
@@ -11086,10 +11175,10 @@ function ChartBrush({
11086
11175
  }
11087
11176
 
11088
11177
  // src/components/complex/Charts/LineChart.tsx
11089
- import { forwardRef as forwardRef2, useMemo as useMemo19, useRef as useRef26, useState as useState25 } from "react";
11178
+ import { forwardRef as forwardRef2, useMemo as useMemo19, useRef as useRef27, useState as useState25 } from "react";
11090
11179
 
11091
11180
  // src/components/complex/Charts/ChartAxes.tsx
11092
- import { Fragment as Fragment11 } from "react";
11181
+ import { Fragment as Fragment12 } from "react";
11093
11182
  import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
11094
11183
  var DEFAULT_Y_TICKS = 5;
11095
11184
  var TICK_LEN = 4;
@@ -11184,7 +11273,7 @@ function ChartAxes({
11184
11273
  strokeWidth: 1
11185
11274
  }
11186
11275
  ),
11187
- yTicks.map((t, i) => /* @__PURE__ */ jsxs44(Fragment11, { children: [
11276
+ yTicks.map((t, i) => /* @__PURE__ */ jsxs44(Fragment12, { children: [
11188
11277
  /* @__PURE__ */ jsx49(
11189
11278
  "line",
11190
11279
  {
@@ -11244,7 +11333,7 @@ function ChartAxes({
11244
11333
  const cx = xFor(idx);
11245
11334
  const cat = categories[idx];
11246
11335
  const text = xFmt ? xFmt(cat, idx) : String(cat);
11247
- return /* @__PURE__ */ jsxs44(Fragment11, { children: [
11336
+ return /* @__PURE__ */ jsxs44(Fragment12, { children: [
11248
11337
  /* @__PURE__ */ jsx49(
11249
11338
  "line",
11250
11339
  {
@@ -11296,9 +11385,9 @@ function ChartAxes({
11296
11385
  }
11297
11386
 
11298
11387
  // src/components/complex/Charts/chartRef.ts
11299
- import { useCallback as useCallback17, useImperativeHandle as useImperativeHandle2, useMemo as useMemo18, useRef as useRef24 } from "react";
11388
+ import { useCallback as useCallback17, useImperativeHandle as useImperativeHandle2, useMemo as useMemo18, useRef as useRef25 } from "react";
11300
11389
  function useChartPrint(forwardedRef, printable) {
11301
- const rootRef = useRef24(null);
11390
+ const rootRef = useRef25(null);
11302
11391
  const printOptionsFromProp = useMemo18(() => {
11303
11392
  if (typeof printable === "object" && printable !== null) {
11304
11393
  return { fileName: printable.fileName };
@@ -11316,10 +11405,10 @@ function useChartPrint(forwardedRef, printable) {
11316
11405
  }
11317
11406
 
11318
11407
  // src/components/complex/Charts/useChartSize.ts
11319
- import { useEffect as useEffect21, useRef as useRef25, useState as useState24 } from "react";
11408
+ import { useEffect as useEffect21, useRef as useRef26, useState as useState24 } from "react";
11320
11409
  function useChartSize(ref, fallback) {
11321
11410
  const [size, setSize] = useState24(fallback);
11322
- const lastRef = useRef25(size);
11411
+ const lastRef = useRef26(size);
11323
11412
  useEffect21(() => {
11324
11413
  const el = ref.current;
11325
11414
  if (!el) return void 0;
@@ -11465,7 +11554,7 @@ function downloadSvgAsPng(svg, fileNameOrOpts = "chart.png") {
11465
11554
  }
11466
11555
 
11467
11556
  // src/components/complex/Charts/ChartHoverToolbar.tsx
11468
- import { Fragment as Fragment12, jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
11557
+ import { Fragment as Fragment13, jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
11469
11558
  function IconStroke(props) {
11470
11559
  return /* @__PURE__ */ jsxs45(
11471
11560
  "svg",
@@ -11490,7 +11579,7 @@ var PRINT_ICON = /* @__PURE__ */ jsx50(
11490
11579
  IconStroke,
11491
11580
  {
11492
11581
  d: "M4 6V2.5h8V6",
11493
- extra: /* @__PURE__ */ jsxs45(Fragment12, { children: [
11582
+ extra: /* @__PURE__ */ jsxs45(Fragment13, { children: [
11494
11583
  /* @__PURE__ */ jsx50("rect", { x: 3, y: 6, width: 10, height: 6, rx: 1 }),
11495
11584
  /* @__PURE__ */ jsx50("path", { d: "M4.5 10h7v3.5h-7z" })
11496
11585
  ] })
@@ -11500,7 +11589,7 @@ var SVG_ICON = /* @__PURE__ */ jsx50(
11500
11589
  IconStroke,
11501
11590
  {
11502
11591
  d: "M3 8.5v3.25A1.25 1.25 0 0 0 4.25 13h7.5A1.25 1.25 0 0 0 13 11.75V8.5",
11503
- extra: /* @__PURE__ */ jsxs45(Fragment12, { children: [
11592
+ extra: /* @__PURE__ */ jsxs45(Fragment13, { children: [
11504
11593
  /* @__PURE__ */ jsx50("path", { d: "M8 2.5v7" }),
11505
11594
  /* @__PURE__ */ jsx50("path", { d: "M5 6.5l3 3 3-3" })
11506
11595
  ] })
@@ -11510,7 +11599,7 @@ var PNG_ICON = /* @__PURE__ */ jsx50(
11510
11599
  IconStroke,
11511
11600
  {
11512
11601
  d: "M2.5 3.5h11v9h-11z",
11513
- extra: /* @__PURE__ */ jsxs45(Fragment12, { children: [
11602
+ extra: /* @__PURE__ */ jsxs45(Fragment13, { children: [
11514
11603
  /* @__PURE__ */ jsx50("circle", { cx: 5.5, cy: 6.5, r: 0.9 }),
11515
11604
  /* @__PURE__ */ jsx50("path", { d: "M2.5 11l3-3 2.5 2.5L10.5 8l3 3" })
11516
11605
  ] })
@@ -11520,7 +11609,7 @@ var RESET_ICON = /* @__PURE__ */ jsx50(
11520
11609
  IconStroke,
11521
11610
  {
11522
11611
  d: "M3 8a5 5 0 1 0 1.5-3.5",
11523
- extra: /* @__PURE__ */ jsx50(Fragment12, { children: /* @__PURE__ */ jsx50("path", { d: "M3 3v3h3" }) })
11612
+ extra: /* @__PURE__ */ jsx50(Fragment13, { children: /* @__PURE__ */ jsx50("path", { d: "M3 3v3h3" }) })
11524
11613
  }
11525
11614
  );
11526
11615
  function defaultChartActions(opts) {
@@ -11670,7 +11759,7 @@ function LineChartInner({
11670
11759
  }, forwardedRef) {
11671
11760
  const chartsLocale = useConfig().locale?.charts;
11672
11761
  const { rootRef } = useChartPrint(forwardedRef, printable);
11673
- const svgRef = useRef26(null);
11762
+ const svgRef = useRef27(null);
11674
11763
  const { min, max } = useMemo19(() => chartBounds(series.map((s) => s.values)), [series]);
11675
11764
  const [pt, pr, pb, pl] = useMemo19(
11676
11765
  () => resolveChartPadding(padding, yAxis, min, max),
@@ -11924,7 +12013,7 @@ var LineChart = forwardRef2(LineChartInner);
11924
12013
  LineChart.displayName = "LineChart";
11925
12014
 
11926
12015
  // src/components/complex/Charts/BarChart.tsx
11927
- import { forwardRef as forwardRef3, useMemo as useMemo20, useRef as useRef27, useState as useState26 } from "react";
12016
+ import { forwardRef as forwardRef3, useMemo as useMemo20, useRef as useRef28, useState as useState26 } from "react";
11928
12017
  import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
11929
12018
  function BarChartInner({
11930
12019
  categories,
@@ -11950,7 +12039,7 @@ function BarChartInner({
11950
12039
  }, forwardedRef) {
11951
12040
  const chartsLocale = useConfig().locale?.charts;
11952
12041
  const { rootRef } = useChartPrint(forwardedRef, printable);
11953
- const svgRef = useRef27(null);
12042
+ const svgRef = useRef28(null);
11954
12043
  const { min, max } = useMemo20(() => chartBounds(series.map((s) => s.values)), [series]);
11955
12044
  const baseline = Math.min(0, min);
11956
12045
  const top = Math.max(0, max);
@@ -12132,7 +12221,7 @@ var BarChart = forwardRef3(BarChartInner);
12132
12221
  BarChart.displayName = "BarChart";
12133
12222
 
12134
12223
  // src/components/complex/Charts/AreaChart.tsx
12135
- import { forwardRef as forwardRef4, useMemo as useMemo21, useRef as useRef28, useState as useState27 } from "react";
12224
+ import { forwardRef as forwardRef4, useMemo as useMemo21, useRef as useRef29, useState as useState27 } from "react";
12136
12225
  import { jsx as jsx53, jsxs as jsxs48 } from "react/jsx-runtime";
12137
12226
  function AreaChartInner({
12138
12227
  categories,
@@ -12159,7 +12248,7 @@ function AreaChartInner({
12159
12248
  }, forwardedRef) {
12160
12249
  const chartsLocale = useConfig().locale?.charts;
12161
12250
  const { rootRef } = useChartPrint(forwardedRef, printable);
12162
- const svgRef = useRef28(null);
12251
+ const svgRef = useRef29(null);
12163
12252
  const stackedValues = useMemo21(() => {
12164
12253
  if (!stacked) return series.map((s) => [...s.values]);
12165
12254
  const totals = new Array(categories.length).fill(0);
@@ -12356,7 +12445,7 @@ var AreaChart = forwardRef4(AreaChartInner);
12356
12445
  AreaChart.displayName = "AreaChart";
12357
12446
 
12358
12447
  // src/components/complex/Charts/PieChart.tsx
12359
- import { forwardRef as forwardRef5, useMemo as useMemo22, useRef as useRef29, useState as useState28 } from "react";
12448
+ import { forwardRef as forwardRef5, useMemo as useMemo22, useRef as useRef30, useState as useState28 } from "react";
12360
12449
  import { jsx as jsx54, jsxs as jsxs49 } from "react/jsx-runtime";
12361
12450
  function PieChartInner({
12362
12451
  data,
@@ -12376,7 +12465,7 @@ function PieChartInner({
12376
12465
  }, forwardedRef) {
12377
12466
  const chartsLocale = useConfig().locale?.charts;
12378
12467
  const { rootRef } = useChartPrint(forwardedRef, printable);
12379
- const svgRef = useRef29(null);
12468
+ const svgRef = useRef30(null);
12380
12469
  const fallbackW = typeof width === "number" && Number.isFinite(width) ? width : 200;
12381
12470
  const fallbackH = typeof height === "number" && Number.isFinite(height) ? height : 200;
12382
12471
  const measured = useChartSize(svgRef, { width: fallbackW, height: fallbackH });
@@ -12631,7 +12720,8 @@ function ListInner({
12631
12720
  (e, index) => {
12632
12721
  if (!draggable || dragIndex === null) return;
12633
12722
  e.preventDefault();
12634
- setDropIndex(index);
12723
+ e.dataTransfer.dropEffect = "move";
12724
+ setDropIndex((prev) => prev === index ? prev : index);
12635
12725
  },
12636
12726
  [draggable, dragIndex]
12637
12727
  );
@@ -12713,7 +12803,6 @@ function ListInner({
12713
12803
  onDragOver: (e) => handleDragOver(e, index),
12714
12804
  onDrop: (e) => handleDrop(e, index),
12715
12805
  onDragEnd: handleDragEnd,
12716
- onDragLeave: () => setDropIndex(null),
12717
12806
  children: [
12718
12807
  draggable && /* @__PURE__ */ jsx55("span", { className: "sg-list-drag-handle", children: "\u283F" }),
12719
12808
  renderItem(item, index)
@@ -13275,7 +13364,7 @@ function Transfer({
13275
13364
  }
13276
13365
 
13277
13366
  // src/components/ui/Mentions.tsx
13278
- import { useState as useState29, useRef as useRef30, useEffect as useEffect22, useMemo as useMemo23, useCallback as useCallback18 } from "react";
13367
+ import { useState as useState29, useRef as useRef31, useEffect as useEffect22, useMemo as useMemo23, useCallback as useCallback18 } from "react";
13279
13368
  import { jsx as jsx58, jsxs as jsxs53 } from "react/jsx-runtime";
13280
13369
  function Mentions({
13281
13370
  value,
@@ -13305,8 +13394,8 @@ function Mentions({
13305
13394
  const currentValue = value ?? internalValue;
13306
13395
  const [mentionState, setMentionState] = useState29(null);
13307
13396
  const [activeIndex, setActiveIndex] = useState29(0);
13308
- const textareaRef = useRef30(null);
13309
- const dropdownRef = useRef30(null);
13397
+ const textareaRef = useRef31(null);
13398
+ const dropdownRef = useRef31(null);
13310
13399
  const filteredOptions = useMemo23(() => {
13311
13400
  if (!mentionState) return [];
13312
13401
  const q = mentionState.query.toLowerCase();
@@ -13551,7 +13640,7 @@ function InputPassword({
13551
13640
  }
13552
13641
 
13553
13642
  // src/components/ui/SearchInput.tsx
13554
- import { useState as useState31, useRef as useRef31 } from "react";
13643
+ import { useState as useState31, useRef as useRef32 } from "react";
13555
13644
  import { jsx as jsx60, jsxs as jsxs55 } from "react/jsx-runtime";
13556
13645
  function SearchInput({
13557
13646
  value,
@@ -13575,7 +13664,7 @@ function SearchInput({
13575
13664
  const disabled = disabledProp ?? config.disabled ?? false;
13576
13665
  const [internal, setInternal] = useState31(defaultValue ?? "");
13577
13666
  const current = value ?? internal;
13578
- const inputRef = useRef31(null);
13667
+ const inputRef = useRef32(null);
13579
13668
  const handleChange = (v) => {
13580
13669
  setInternal(v);
13581
13670
  onChange?.(v);
@@ -13659,7 +13748,7 @@ function SearchInput({
13659
13748
  }
13660
13749
 
13661
13750
  // src/components/ui/TagInput.tsx
13662
- import { useState as useState32, useRef as useRef32, useId as useId5 } from "react";
13751
+ import { useState as useState32, useRef as useRef33, useId as useId5 } from "react";
13663
13752
  import { jsx as jsx61, jsxs as jsxs56 } from "react/jsx-runtime";
13664
13753
  function TagInput({
13665
13754
  value,
@@ -13685,7 +13774,7 @@ function TagInput({
13685
13774
  const removeTagLabel = config.locale?.tagInput?.removeTag ?? ((tag) => `Remove ${tag}`);
13686
13775
  const [internalTags, setInternalTags] = useState32(defaultValue);
13687
13776
  const [inputValue, setInputValue] = useState32("");
13688
- const inputRef = useRef32(null);
13777
+ const inputRef = useRef33(null);
13689
13778
  const id = useId5();
13690
13779
  const tags = value ?? internalTags;
13691
13780
  const updateTags = (next) => {
@@ -13796,7 +13885,7 @@ function TagInput({
13796
13885
  }
13797
13886
 
13798
13887
  // src/components/ui/PinInput.tsx
13799
- import { useState as useState33, useRef as useRef33, useCallback as useCallback19, useId as useId6 } from "react";
13888
+ import { useState as useState33, useRef as useRef34, useCallback as useCallback19, useId as useId6 } from "react";
13800
13889
  import { jsx as jsx62 } from "react/jsx-runtime";
13801
13890
  function PinInput({
13802
13891
  length = 6,
@@ -13823,7 +13912,7 @@ function PinInput({
13823
13912
  const pad2 = (s) => s.padEnd(length, "").slice(0, length);
13824
13913
  const [internal, setInternal] = useState33(() => pad2(defaultValue));
13825
13914
  const current = value !== void 0 ? pad2(value) : internal;
13826
- const refs = useRef33([]);
13915
+ const refs = useRef34([]);
13827
13916
  const pattern = type === "numeric" ? /^\d$/ : /^[a-zA-Z0-9]$/;
13828
13917
  const update = useCallback19(
13829
13918
  (next) => {
@@ -13932,8 +14021,8 @@ function PinInput({
13932
14021
  }
13933
14022
 
13934
14023
  // src/components/ui/InlineEdit.tsx
13935
- import { useState as useState34, useRef as useRef34, useEffect as useEffect23 } from "react";
13936
- import { Fragment as Fragment13, jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
14024
+ import { useState as useState34, useRef as useRef35, useEffect as useEffect23 } from "react";
14025
+ import { Fragment as Fragment14, jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
13937
14026
  function InlineEdit({
13938
14027
  value,
13939
14028
  defaultValue = "",
@@ -13957,7 +14046,7 @@ function InlineEdit({
13957
14046
  const [editing, setEditing] = useState34(false);
13958
14047
  const [internal, setInternal] = useState34(defaultValue);
13959
14048
  const [draft, setDraft] = useState34("");
13960
- const inputRef = useRef34(null);
14049
+ const inputRef = useRef35(null);
13961
14050
  const current = value ?? internal;
13962
14051
  useEffect23(() => {
13963
14052
  if (editing) {
@@ -13989,7 +14078,7 @@ function InlineEdit({
13989
14078
  };
13990
14079
  if (!editing) {
13991
14080
  if (renderView) {
13992
- return /* @__PURE__ */ jsx63(Fragment13, { children: renderView(current, startEditing) });
14081
+ return /* @__PURE__ */ jsx63(Fragment14, { children: renderView(current, startEditing) });
13993
14082
  }
13994
14083
  if (unstyled) {
13995
14084
  return /* @__PURE__ */ jsx63(
@@ -14038,7 +14127,7 @@ function InlineEdit({
14038
14127
  onBlur: saveOnBlur ? save : void 0
14039
14128
  }
14040
14129
  ),
14041
- showButtons && /* @__PURE__ */ jsxs57(Fragment13, { children: [
14130
+ showButtons && /* @__PURE__ */ jsxs57(Fragment14, { children: [
14042
14131
  /* @__PURE__ */ jsx63("button", { type: "button", onClick: save, children: "\u2713" }),
14043
14132
  /* @__PURE__ */ jsx63("button", { type: "button", onClick: cancel, children: "\u2715" })
14044
14133
  ] })