@cyber-harbour/ui 1.0.45 → 1.0.47

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.d.mts CHANGED
@@ -6,7 +6,6 @@ import { CSSProperties, DefaultTheme, WebTarget } from 'styled-components';
6
6
  import * as styled_components_dist_types from 'styled-components/dist/types';
7
7
  import { DefaultTheme as DefaultTheme$1 } from 'styled-components/dist/types';
8
8
  import { PopoverPosition, PopoverAlign } from 'react-tiny-popover';
9
- import { GraphData, NodeObject } from 'react-force-graph-2d';
10
9
 
11
10
  declare const GlobalStyle: react.NamedExoticComponent<styled_components.ExecutionProps & object>;
12
11
 
@@ -217,6 +216,7 @@ type Theme = {
217
216
  graph2D: {
218
217
  ring: {
219
218
  highlightFill: string;
219
+ selectionFill: string;
220
220
  };
221
221
  button: {
222
222
  stroke: string;
@@ -577,6 +577,36 @@ interface MaximizeIconProps extends SVGProps<SVGSVGElement> {
577
577
  }
578
578
  declare const MaximizeIcon: ({ fill, ...props }: MaximizeIconProps) => react_jsx_runtime.JSX.Element;
579
579
 
580
+ interface BusIconProps extends SVGProps<SVGSVGElement> {
581
+ fill?: string;
582
+ }
583
+ declare const BusIcon: ({ fill, ...props }: BusIconProps) => react_jsx_runtime.JSX.Element;
584
+
585
+ interface CarIconProps extends SVGProps<SVGSVGElement> {
586
+ fill?: string;
587
+ }
588
+ declare const CarIcon: ({ fill, ...props }: CarIconProps) => react_jsx_runtime.JSX.Element;
589
+
590
+ interface WayIconProps extends SVGProps<SVGSVGElement> {
591
+ fill?: string;
592
+ }
593
+ declare const WayIcon: ({ fill, ...props }: WayIconProps) => react_jsx_runtime.JSX.Element;
594
+
595
+ interface PlaneIconProps extends SVGProps<SVGSVGElement> {
596
+ fill?: string;
597
+ }
598
+ declare const PlaneIcon: ({ fill, ...props }: PlaneIconProps) => react_jsx_runtime.JSX.Element;
599
+
600
+ interface ShipIconProps extends SVGProps<SVGSVGElement> {
601
+ fill?: string;
602
+ }
603
+ declare const ShipIcon: ({ fill, ...props }: ShipIconProps) => react_jsx_runtime.JSX.Element;
604
+
605
+ interface FileIconProps extends SVGProps<SVGSVGElement> {
606
+ fill?: string;
607
+ }
608
+ declare const FileIcon: ({ fill, ...props }: FileIconProps) => react_jsx_runtime.JSX.Element;
609
+
580
610
  interface SidebarProps {
581
611
  defaultCollapsed?: boolean;
582
612
  children: any;
@@ -838,31 +868,68 @@ type ContainerProps = FabricComponent<{
838
868
  }>;
839
869
  declare const Container: ({ maxWidth, ...props }: ContainerProps) => react_jsx_runtime.JSX.Element;
840
870
 
871
+ declare const Graph2D: any;
872
+
873
+ interface Graph2DRef {
874
+ /**
875
+ * Масштабирует график так, чтобы все узлы были видны
876
+ * @param duration Длительность анимации масштабирования в миллисекундах
877
+ * @param padding Отступ от краев в пикселях
878
+ */
879
+ zoomToFit: (duration?: number, padding?: number) => void;
880
+ /**
881
+ * Добавляет новые узлы и связи на график
882
+ * @param newNodes Массив новых узлов для добавления
883
+ * @param newLinks Массив новых связей для добавления
884
+ * @param options Опции для настройки поведения при добавлении
885
+ * - smoothAppearance: если true, существующие узлы не будут двигаться,
886
+ * а новые появятся плавно рядом со связанными узлами
887
+ * - transitionDuration: длительность анимации появления новых узлов в миллисекундах
888
+ */
889
+ addNodes: (newNodes: NodeObject[], newLinks?: LinkObject[], options?: {
890
+ smoothAppearance?: boolean;
891
+ transitionDuration?: number;
892
+ }) => void;
893
+ /**
894
+ * Удаляет узлы и связанные с ними связи из графа
895
+ * @param nodeIds Массив идентификаторов узлов для удаления
896
+ */
897
+ removeNodes: (nodeIds: (string | number)[]) => void;
898
+ }
841
899
  interface Graph2DProps {
842
- graphData?: GraphData;
843
- linkSource?: string;
844
- linkTarget?: string;
900
+ graphData: GraphData;
845
901
  loading?: boolean;
846
- width?: number;
847
- height?: number;
848
- config?: {
849
- fontSize: number;
850
- maxZoom: number;
851
- nodeSizeBase: number;
852
- nodeAreaFactor: number;
853
- textPaddingFactor: number;
854
- gridSpacing: number;
855
- dotSize: number;
856
- };
902
+ width: number;
903
+ height: number;
904
+ buttons?: NodeButton[];
857
905
  onNodeClick?: (node: NodeObject) => void;
858
- onLinkClick?: (link: NodeObject) => void;
859
- onNodeHover?: (node: NodeObject | null) => void;
860
- onLinkHover?: (link: NodeObject | null) => void;
861
906
  onBackgroundClick?: () => void;
862
- onClickLoadNodes?: (node: NodeObject) => void;
907
+ onNodeHover?: (node: NodeObject | null) => void;
863
908
  }
864
-
865
- declare const Graph2D: ({ graphData, width, height, linkTarget, linkSource, loading, config, onNodeClick, onNodeHover, onLinkHover, onLinkClick, onBackgroundClick, onClickLoadNodes, }: Graph2DProps) => react_jsx_runtime.JSX.Element;
909
+ interface NodeButton {
910
+ img: string;
911
+ hoverImg: string;
912
+ onClick: (node: NodeObject) => void;
913
+ }
914
+ type GraphData<NodeType = {}, LinkType = {}> = {
915
+ nodes: NodeObject<NodeType>[];
916
+ links: LinkObject<NodeType, LinkType>[];
917
+ };
918
+ type NodeObject<NodeType = {}> = NodeType & {
919
+ id?: string | number;
920
+ x?: number;
921
+ y?: number;
922
+ vx?: number;
923
+ vy?: number;
924
+ fx?: number;
925
+ fy?: number;
926
+ [others: string]: any;
927
+ };
928
+ type LinkObject<NodeType = {}, LinkType = {}> = LinkType & {
929
+ source: string | number | NodeObject<NodeType>;
930
+ target: string | number | NodeObject<NodeType>;
931
+ [others: string]: any;
932
+ };
866
933
 
867
934
  interface FullscreenCardProps {
868
935
  children: any;
@@ -876,4 +943,4 @@ interface FullscreenCardProps {
876
943
  }
877
944
  declare const FullscreenCard: ({ isActive, position, top, left, right, bottom, ...props }: FullscreenCardProps) => react_jsx_runtime.JSX.Element;
878
945
 
879
- export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };
946
+ export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, BusIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FileIcon, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, type Graph2DRef, type GraphData, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, type LinkObject, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, type NodeButton, type NodeObject, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlaneIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, ShipIcon, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, WayIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,6 @@ import { CSSProperties, DefaultTheme, WebTarget } from 'styled-components';
6
6
  import * as styled_components_dist_types from 'styled-components/dist/types';
7
7
  import { DefaultTheme as DefaultTheme$1 } from 'styled-components/dist/types';
8
8
  import { PopoverPosition, PopoverAlign } from 'react-tiny-popover';
9
- import { GraphData, NodeObject } from 'react-force-graph-2d';
10
9
 
11
10
  declare const GlobalStyle: react.NamedExoticComponent<styled_components.ExecutionProps & object>;
12
11
 
@@ -217,6 +216,7 @@ type Theme = {
217
216
  graph2D: {
218
217
  ring: {
219
218
  highlightFill: string;
219
+ selectionFill: string;
220
220
  };
221
221
  button: {
222
222
  stroke: string;
@@ -577,6 +577,36 @@ interface MaximizeIconProps extends SVGProps<SVGSVGElement> {
577
577
  }
578
578
  declare const MaximizeIcon: ({ fill, ...props }: MaximizeIconProps) => react_jsx_runtime.JSX.Element;
579
579
 
580
+ interface BusIconProps extends SVGProps<SVGSVGElement> {
581
+ fill?: string;
582
+ }
583
+ declare const BusIcon: ({ fill, ...props }: BusIconProps) => react_jsx_runtime.JSX.Element;
584
+
585
+ interface CarIconProps extends SVGProps<SVGSVGElement> {
586
+ fill?: string;
587
+ }
588
+ declare const CarIcon: ({ fill, ...props }: CarIconProps) => react_jsx_runtime.JSX.Element;
589
+
590
+ interface WayIconProps extends SVGProps<SVGSVGElement> {
591
+ fill?: string;
592
+ }
593
+ declare const WayIcon: ({ fill, ...props }: WayIconProps) => react_jsx_runtime.JSX.Element;
594
+
595
+ interface PlaneIconProps extends SVGProps<SVGSVGElement> {
596
+ fill?: string;
597
+ }
598
+ declare const PlaneIcon: ({ fill, ...props }: PlaneIconProps) => react_jsx_runtime.JSX.Element;
599
+
600
+ interface ShipIconProps extends SVGProps<SVGSVGElement> {
601
+ fill?: string;
602
+ }
603
+ declare const ShipIcon: ({ fill, ...props }: ShipIconProps) => react_jsx_runtime.JSX.Element;
604
+
605
+ interface FileIconProps extends SVGProps<SVGSVGElement> {
606
+ fill?: string;
607
+ }
608
+ declare const FileIcon: ({ fill, ...props }: FileIconProps) => react_jsx_runtime.JSX.Element;
609
+
580
610
  interface SidebarProps {
581
611
  defaultCollapsed?: boolean;
582
612
  children: any;
@@ -838,31 +868,68 @@ type ContainerProps = FabricComponent<{
838
868
  }>;
839
869
  declare const Container: ({ maxWidth, ...props }: ContainerProps) => react_jsx_runtime.JSX.Element;
840
870
 
871
+ declare const Graph2D: any;
872
+
873
+ interface Graph2DRef {
874
+ /**
875
+ * Масштабирует график так, чтобы все узлы были видны
876
+ * @param duration Длительность анимации масштабирования в миллисекундах
877
+ * @param padding Отступ от краев в пикселях
878
+ */
879
+ zoomToFit: (duration?: number, padding?: number) => void;
880
+ /**
881
+ * Добавляет новые узлы и связи на график
882
+ * @param newNodes Массив новых узлов для добавления
883
+ * @param newLinks Массив новых связей для добавления
884
+ * @param options Опции для настройки поведения при добавлении
885
+ * - smoothAppearance: если true, существующие узлы не будут двигаться,
886
+ * а новые появятся плавно рядом со связанными узлами
887
+ * - transitionDuration: длительность анимации появления новых узлов в миллисекундах
888
+ */
889
+ addNodes: (newNodes: NodeObject[], newLinks?: LinkObject[], options?: {
890
+ smoothAppearance?: boolean;
891
+ transitionDuration?: number;
892
+ }) => void;
893
+ /**
894
+ * Удаляет узлы и связанные с ними связи из графа
895
+ * @param nodeIds Массив идентификаторов узлов для удаления
896
+ */
897
+ removeNodes: (nodeIds: (string | number)[]) => void;
898
+ }
841
899
  interface Graph2DProps {
842
- graphData?: GraphData;
843
- linkSource?: string;
844
- linkTarget?: string;
900
+ graphData: GraphData;
845
901
  loading?: boolean;
846
- width?: number;
847
- height?: number;
848
- config?: {
849
- fontSize: number;
850
- maxZoom: number;
851
- nodeSizeBase: number;
852
- nodeAreaFactor: number;
853
- textPaddingFactor: number;
854
- gridSpacing: number;
855
- dotSize: number;
856
- };
902
+ width: number;
903
+ height: number;
904
+ buttons?: NodeButton[];
857
905
  onNodeClick?: (node: NodeObject) => void;
858
- onLinkClick?: (link: NodeObject) => void;
859
- onNodeHover?: (node: NodeObject | null) => void;
860
- onLinkHover?: (link: NodeObject | null) => void;
861
906
  onBackgroundClick?: () => void;
862
- onClickLoadNodes?: (node: NodeObject) => void;
907
+ onNodeHover?: (node: NodeObject | null) => void;
863
908
  }
864
-
865
- declare const Graph2D: ({ graphData, width, height, linkTarget, linkSource, loading, config, onNodeClick, onNodeHover, onLinkHover, onLinkClick, onBackgroundClick, onClickLoadNodes, }: Graph2DProps) => react_jsx_runtime.JSX.Element;
909
+ interface NodeButton {
910
+ img: string;
911
+ hoverImg: string;
912
+ onClick: (node: NodeObject) => void;
913
+ }
914
+ type GraphData<NodeType = {}, LinkType = {}> = {
915
+ nodes: NodeObject<NodeType>[];
916
+ links: LinkObject<NodeType, LinkType>[];
917
+ };
918
+ type NodeObject<NodeType = {}> = NodeType & {
919
+ id?: string | number;
920
+ x?: number;
921
+ y?: number;
922
+ vx?: number;
923
+ vy?: number;
924
+ fx?: number;
925
+ fy?: number;
926
+ [others: string]: any;
927
+ };
928
+ type LinkObject<NodeType = {}, LinkType = {}> = LinkType & {
929
+ source: string | number | NodeObject<NodeType>;
930
+ target: string | number | NodeObject<NodeType>;
931
+ [others: string]: any;
932
+ };
866
933
 
867
934
  interface FullscreenCardProps {
868
935
  children: any;
@@ -876,4 +943,4 @@ interface FullscreenCardProps {
876
943
  }
877
944
  declare const FullscreenCard: ({ isActive, position, top, left, right, bottom, ...props }: FullscreenCardProps) => react_jsx_runtime.JSX.Element;
878
945
 
879
- export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };
946
+ export { type Action, AlertIcon, ApiIcon, ArrowCircleTopRightIcon, ArrowRightIcon, BallsMenu, Box, type Breakpoint, BugReportIcon, BusIcon, Button, type ButtonColor, type ButtonElementStyle, type ButtonProps, type ButtonSize, type ButtonSizeStyle, type ButtonState, type ButtonVariant, CalendarIcon, CarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseCircleIcon, ClosedLockIcon, type ColorVariant, type ColumnTable, Container, ContextMenu, ContextMenuDelimiter, CrossIcon, DataSetsIcon, DeepSearchIcon, DisabledVisibleIcon, DocsIcon, DownloadIcon, EditUserIcon, EmptyData, type EmptyDataProps, EnableVisibleIcon, EnterArrowLeftIcon, type FabricComponent, FileIcon, FiltersIcon, FlexContainer, FlexItem, FullscreenCard, GlobalStyle, Graph2D, type Graph2DProps, type Graph2DRef, type GraphData, Header, HeaderDelimeter, HeaderSection, HomepageIcon, InfoCircleFilledIcon, InfoCircleIcon, Input, type InputElementProps, type InputElementStyle, type InputProps, type InputSize, type InputSizeStyle, type InputState, type InputVariant, Line, type LinkObject, ListMenu, ListMenuItem, type ListMenuItemAnchorProps, type ListMenuItemBase, type ListMenuItemButtonProps, type ListMenuItemProps, type ListMenuProps, ListMenuSection, type ListMenuSectionProps, MapRadarIcon, MaximizeIcon, MoonIcon, type NestedColorPaths, type NodeButton, type NodeObject, OpenLockIcon, OrganizationIcon, PageLayout, Pagination, type PaginationProps, PasswordFinderIcon, PhonebookIcon, PlaneIcon, PlusIcon, PrintIcon, Profiler2Icon, ProfilerIcon, type RenderCellProps, type RenderHeaderCellProps, RowActionsMenu, SandBoxIcon, SearchIcon, Select, ShipIcon, Sidebar, SidebarContext, SidebarDelimeter, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatisticIcon, StyledContainer, SunIcon, Table, type TextAreaElementProps, type Theme, type ThemeMode, ThemeProvider, Typography, type TypographyVariant, UnfoldIcon, UpRightArrowCircleIcon, UsersIcon, VectorIcon, WayIcon, convertPaletteToRem, createComponent, darkTheme, darkThemePx, getBreakpoint, getButtonSizeStyles, getButtonStyles, getInputStyles, getTypographyStyles, lightTheme, lightThemePx, pxToRem, remToPx, resolveThemeColor, useContextMenuControl };