@revisium/schema-toolkit-ui 0.3.1 → 0.3.2

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.cjs CHANGED
@@ -5785,37 +5785,32 @@ const NumberRendererComponent = (0, mobx_react_lite.observer)(({ node }) => {
5785
5785
  //#endregion
5786
5786
  //#region src/row-editor/ui/editors/FocusPopover.tsx
5787
5787
  const FocusPopover = ({ isOpen, setIsOpen, trigger, children, disabled, width }) => {
5788
- const triggerRef = (0, react.useRef)(null);
5789
- const lastRectRef = (0, react.useRef)(null);
5790
- const getAnchorRect = (0, react.useCallback)(() => {
5791
- const rect = triggerRef.current?.getBoundingClientRect();
5792
- if (rect && rect.width > 0) lastRectRef.current = rect;
5793
- return lastRectRef.current;
5794
- }, []);
5795
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Box, {
5796
- ref: triggerRef,
5797
- onPointerDown: (0, react.useCallback)(() => {
5798
- if (!disabled) setIsOpen(true);
5799
- }, [disabled, setIsOpen]),
5800
- children: trigger
5801
- }), !disabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Popover.Root, {
5788
+ const handleClick = (0, react.useCallback)(() => {
5789
+ if (!disabled) setIsOpen(true);
5790
+ }, [disabled, setIsOpen]);
5791
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_chakra_ui_react.Popover.Root, {
5802
5792
  lazyMount: true,
5803
5793
  unmountOnExit: true,
5804
5794
  open: isOpen,
5805
- onOpenChange: ({ open }) => setIsOpen(open),
5795
+ onOpenChange: ({ open }) => {
5796
+ if (!disabled) setIsOpen(open);
5797
+ },
5806
5798
  autoFocus: false,
5807
- closeOnInteractOutside: true,
5799
+ closeOnInteractOutside: !disabled,
5808
5800
  modal: false,
5809
- positioning: {
5810
- placement: "bottom-start",
5811
- getAnchorRect
5812
- },
5813
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Popover.Positioner, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Popover.Content, {
5801
+ positioning: { placement: "bottom-start" },
5802
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Popover.Trigger, {
5803
+ asChild: true,
5804
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Box, {
5805
+ onClick: handleClick,
5806
+ children: trigger
5807
+ })
5808
+ }), !disabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Popover.Positioner, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_chakra_ui_react.Popover.Content, {
5814
5809
  width,
5815
5810
  p: 1,
5816
5811
  children
5817
- }) }) })
5818
- })] });
5812
+ }) }) })]
5813
+ });
5819
5814
  };
5820
5815
 
5821
5816
  //#endregion