@abdellatifui/react 3.1.81 → 3.1.83

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/nextgen.d.ts CHANGED
@@ -504,10 +504,16 @@ export declare interface MenuButtonProps extends ButtonProps {
504
504
  }>;
505
505
  }
506
506
 
507
- export declare const Model: default_2.ForwardRefExoticComponent<ModelProps_2 & default_2.RefAttributes<HTMLDivElement>>;
507
+ export declare const Model: default_2.ForwardRefExoticComponent<ModelProps_2 & default_2.RefAttributes<ModelHandle>>;
508
508
 
509
509
  export declare const ModelContext: Context< {}>;
510
510
 
511
+ declare interface ModelHandle {
512
+ open: () => void;
513
+ close: () => void;
514
+ readonly isOpen: boolean;
515
+ }
516
+
511
517
  export declare interface ModelProps extends ContainerProps {
512
518
  isOpen: boolean;
513
519
  onClose: () => void;
@@ -767,6 +773,7 @@ declare interface RadioItemProps_2 {
767
773
  onContextMenu?: (state: any) => void;
768
774
  labelProps?: React.LabelHTMLAttributes<HTMLLabelElement>;
769
775
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
776
+ showRadio?: boolean;
770
777
  }
771
778
 
772
779
  export declare function range(start: any, end: any, step?: number): any[];
package/dist/nextgen.js CHANGED
@@ -14633,7 +14633,7 @@ const NetworkMapComponent = forwardRef((props, ref) => {
14633
14633
  loadOptions,
14634
14634
  FlyToNodeApi,
14635
14635
  ...mapApi.current
14636
- }));
14636
+ }), [mapApi.current]);
14637
14637
  const _menuItems = useMemo(() => {
14638
14638
  return (menuItems == null ? void 0 : menuItems.map((item) => ({
14639
14639
  ...item,
@@ -16333,29 +16333,33 @@ const Model = forwardRef((props, ref) => {
16333
16333
  hideOnContextMenu,
16334
16334
  blur = false
16335
16335
  } = props;
16336
- function handleClose() {
16336
+ const handleClose = useCallback(() => {
16337
16337
  setOpen(false);
16338
- }
16339
- function hanldeOpen() {
16338
+ }, []);
16339
+ const hanldeOpen = useCallback(() => {
16340
16340
  setOpen(true);
16341
- }
16341
+ }, []);
16342
+ useImperativeHandle(ref, () => ({
16343
+ open: hanldeOpen,
16344
+ close: handleClose,
16345
+ get isOpen() {
16346
+ return open;
16347
+ }
16348
+ }), [handleClose, hanldeOpen, open]);
16342
16349
  useEffect(() => {
16343
- if (ref.current) {
16344
- ref.current.open = hanldeOpen;
16345
- ref.current.close = handleClose;
16346
- ref.open = hanldeOpen;
16347
- ref.close = handleClose;
16348
- ref.current.isOpen = open;
16349
- if (open == true && !inline) {
16350
- setTimeout(() => {
16351
- const element = $(`#${id}`);
16352
- const element2 = document.getElementById(id);
16353
- const boundires = element2.getBoundingClientRect();
16354
- element.css("top", -boundires.y + "px");
16355
- }, 10);
16356
- }
16350
+ if (!open || inline) {
16351
+ return;
16357
16352
  }
16358
- }, [open, ref, id]);
16353
+ const element = document.getElementById(id);
16354
+ if (!element) {
16355
+ return;
16356
+ }
16357
+ const frame = window.requestAnimationFrame(() => {
16358
+ const boundaries = element.getBoundingClientRect();
16359
+ element.style.top = `${-boundaries.y}px`;
16360
+ });
16361
+ return () => window.cancelAnimationFrame(frame);
16362
+ }, [id, inline, open]);
16359
16363
  function handleWrapperClose(e) {
16360
16364
  if (e.target.classList.contains("custom-click-away") && bodyClick) {
16361
16365
  setOpen(false);
@@ -25469,7 +25473,8 @@ const RadioItem = (props) => {
25469
25473
  labelProps = {},
25470
25474
  className = {},
25471
25475
  inputProps = {},
25472
- defaultChecked = false
25476
+ defaultChecked = false,
25477
+ showRadio = true
25473
25478
  } = props;
25474
25479
  const checkChecked = (ev) => {
25475
25480
  const s = {
@@ -25543,7 +25548,7 @@ const RadioItem = (props) => {
25543
25548
  ...labelProps,
25544
25549
  htmlFor: id,
25545
25550
  ref,
25546
- className: cn("relative p-2 border-[2px] border-gray-300 rounded-sm min-w-[200px] min-h-[100px] bg-white", className),
25551
+ className: cn("relative p-2 rounded-lg min-w-[200px] min-h-[100px] bg-white", className),
25547
25552
  children: [
25548
25553
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-1", children: [
25549
25554
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -25554,7 +25559,7 @@ const RadioItem = (props) => {
25554
25559
  onChange: checkChecked,
25555
25560
  id,
25556
25561
  type: "radio",
25557
- className: "w-[20px] h-[20px]",
25562
+ className: cn("w-[20px] h-[20px]", showRadio && "hidden"),
25558
25563
  name: name2
25559
25564
  }
25560
25565
  ),
@@ -26544,3 +26549,4 @@ export {
26544
26549
  useStore,
26545
26550
  useVariable
26546
26551
  };
26552
+ //# sourceMappingURL=nextgen.js.map