caplink-saas-ui-shared-component-library 0.5.13 → 0.5.15
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/components/dag/hooks/index.d.ts +4 -0
- package/dist/components/dag/hooks/use-dag.d.ts +2 -0
- package/dist/components/dag/hooks/use-get-adjacent-nodes.d.ts +6 -0
- package/dist/components/dag/model/dag-types.d.ts +115 -0
- package/dist/components/dag/model/index.d.ts +3 -0
- package/dist/components/dag/ui/adjacent-nodes/adjacent-nodes.d.ts +10 -0
- package/dist/components/dag/ui/adjacent-nodes/index.d.ts +3 -0
- package/dist/components/dag/ui/dag-container.d.ts +2 -0
- package/dist/components/dag/ui/dag.d.ts +2 -0
- package/dist/components/dag/ui/defaults/default-edge.d.ts +2 -0
- package/dist/components/dag/ui/defaults/default-node.d.ts +2 -0
- package/dist/components/dag/ui/defaults/index.d.ts +4 -0
- package/dist/components/dag/ui/defaults/skeleton-node.d.ts +1 -0
- package/dist/components/dag/ui/float-menu/default-float-buttons/button-change-orientation.d.ts +12 -0
- package/dist/components/dag/ui/float-menu/default-float-buttons/button-zoom-in.d.ts +1 -0
- package/dist/components/dag/ui/float-menu/default-float-buttons/button-zoom-out.d.ts +1 -0
- package/dist/components/dag/ui/float-menu/default-float-buttons/index.d.ts +5 -0
- package/dist/components/dag/ui/float-menu/float-menu-button-group.d.ts +2 -0
- package/dist/components/dag/ui/float-menu/float-menu-button.d.ts +2 -0
- package/dist/components/dag/ui/float-menu/float-menu.d.ts +5 -0
- package/dist/components/dag/ui/float-menu/index.d.ts +5 -0
- package/dist/components/dag/ui/index.d.ts +3 -0
- package/dist/components/dag/ui/search-node/index.d.ts +3 -0
- package/dist/components/dag/ui/search-node/search-node.d.ts +6 -0
- package/dist/components/dag/utils/get-layout-elements.d.ts +49 -0
- package/dist/components/file-uploader/ui/file-uploader.d.ts +9 -0
- package/dist/components/file-uploader/ui/index.d.ts +3 -0
- package/dist/components/image-uploader/ui/image-uploader.d.ts +20 -0
- package/dist/components/image-uploader/ui/image-viewer.d.ts +7 -0
- package/dist/components/image-uploader/ui/index.d.ts +3 -0
- package/dist/components/sidebar/ui/content-split.d.ts +4 -0
- package/dist/components/sidebar/ui/index.d.ts +5 -0
- package/dist/components/sidebar/ui/sidebar-header.d.ts +5 -0
- package/dist/components/sidebar/ui/sidebar.d.ts +11 -0
- package/dist/components/spreadsheet/lib/cap-value.d.ts +5 -0
- package/dist/components/spreadsheet/lib/date-formatter.d.ts +1 -0
- package/dist/components/spreadsheet/lib/get-text-width-by-font.d.ts +1 -0
- package/dist/components/spreadsheet/lib/indexed-alphabet.d.ts +1 -0
- package/dist/components/spreadsheet/lib/normalize-value.d.ts +5 -0
- package/dist/components/spreadsheet/lib/one-line-string.d.ts +1 -0
- package/dist/components/spreadsheet/lib/text-overflow.d.ts +1 -0
- package/dist/components/spreadsheet/lib/use-spreadsheet.d.ts +1 -0
- package/dist/components/spreadsheet/lib/with-portal-provider.d.ts +10 -0
- package/dist/components/spreadsheet/model/matrix.d.ts +59 -0
- package/dist/components/spreadsheet/model/spreadsheet.d.ts +170 -0
- package/dist/components/spreadsheet/ui/cell.d.ts +2 -0
- package/dist/components/spreadsheet/ui/containers/index.d.ts +6 -0
- package/dist/components/spreadsheet/ui/containers/matrix.d.ts +6 -0
- package/dist/components/spreadsheet/ui/containers/root.d.ts +6 -0
- package/dist/components/spreadsheet/ui/context.d.ts +4 -0
- package/dist/components/spreadsheet/ui/data-editor/boolean.d.ts +3 -0
- package/dist/components/spreadsheet/ui/data-editor/date.d.ts +3 -0
- package/dist/components/spreadsheet/ui/data-editor/index.d.ts +19 -0
- package/dist/components/spreadsheet/ui/data-editor/numeric.d.ts +3 -0
- package/dist/components/spreadsheet/ui/data-editor/select.d.ts +7 -0
- package/dist/components/spreadsheet/ui/data-editor/text.d.ts +3 -0
- package/dist/components/spreadsheet/ui/header.d.ts +1 -0
- package/dist/components/spreadsheet/ui/icons/add-row-icon.d.ts +2 -0
- package/dist/components/spreadsheet/ui/icons/integer-icon.d.ts +2 -0
- package/dist/components/spreadsheet/ui/icons/remove-row-icon.d.ts +2 -0
- package/dist/components/spreadsheet/ui/index.d.ts +2 -0
- package/dist/components/spreadsheet/ui/indicators/column-indicator.d.ts +10 -0
- package/dist/components/spreadsheet/ui/indicators/column-title-indicator.d.ts +9 -0
- package/dist/components/spreadsheet/ui/indicators/corner-indicator.d.ts +3 -0
- package/dist/components/spreadsheet/ui/indicators/drag-indicator.d.ts +9 -0
- package/dist/components/spreadsheet/ui/indicators/row-indicator.d.ts +3 -0
- package/dist/components/spreadsheet/ui/rows.d.ts +1 -0
- package/dist/components/spreadsheet/ui/start.d.ts +3 -0
- package/dist/components/spreadsheet/ui/toolbar.d.ts +1 -0
- package/dist/components/tmp/numeric.d.ts +24 -0
- package/dist/index.d.ts +152 -848
- package/dist/index.es.js +3421 -3394
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +45 -45
- package/dist/index.umd.js.map +1 -1
- package/dist/providers/caplink-provider.d.ts +7 -0
- package/dist/providers/caplink-theme-provider.d.ts +7 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/shared/business/get-formatted-id.d.ts +4 -0
- package/dist/shared/business/index.d.ts +56 -0
- package/dist/shared/business/parse-product-featured-data.d.ts +14 -0
- package/dist/shared/business/product-featured-data-schema.d.ts +50 -0
- package/dist/shared/business/validate-product-featured-data.d.ts +8 -0
- package/dist/shared/lib/cn.d.ts +2 -0
- package/dist/shared/lib/custom-variant-prop.d.ts +6 -0
- package/dist/shared/lib/get-current-date-time-text.d.ts +5 -0
- package/dist/shared/lib/move-input-cursor-to-end.d.ts +2 -0
- package/dist/shared/lib/read-text-from-clipboard.d.ts +4 -0
- package/dist/shared/lib/use-focused.d.ts +2 -0
- package/dist/shared/lib/use-select-on-focus.d.ts +2 -0
- package/dist/shared/ui/alert.d.ts +8 -0
- package/dist/shared/ui/button.d.ts +11 -0
- package/dist/shared/ui/dropdown-menu.d.ts +27 -0
- package/dist/shared/ui/empty-search-icon.d.ts +2 -0
- package/dist/shared/ui/float-button.d.ts +8 -0
- package/dist/shared/ui/icon-button.d.ts +11 -0
- package/dist/shared/ui/input.d.ts +5 -0
- package/dist/shared/ui/select.d.ts +13 -0
- package/dist/shared/ui/tooltip.d.ts +7 -0
- package/dist/theme/caplink-theme.d.ts +44 -0
- package/dist/theme/get-theme-stylesheet.d.ts +2 -0
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { ComponentType, CSSProperties, PropsWithChildren } from 'react';
|
|
2
|
+
export type Node<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
3
|
+
id: string;
|
|
4
|
+
data: T;
|
|
5
|
+
type?: string;
|
|
6
|
+
position: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
targetPosition?: Position;
|
|
11
|
+
sourcePosition?: Position;
|
|
12
|
+
dragging?: boolean;
|
|
13
|
+
zIndex?: number;
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
export type NodeProps<T extends Node = Node> = Pick<T, 'id' | 'data' | 'sourcePosition' | 'targetPosition' | 'selected'> & Required<Pick<T, 'type' | 'dragging' | 'zIndex'>> & {
|
|
19
|
+
isConnectable: boolean;
|
|
20
|
+
positionAbsoluteX: number;
|
|
21
|
+
positionAbsoluteY: number;
|
|
22
|
+
};
|
|
23
|
+
export type DefaultNodeDataProps = {
|
|
24
|
+
content: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
hideHandles?: boolean;
|
|
27
|
+
targetHandleClassName?: string;
|
|
28
|
+
sourceHandleClassName?: string;
|
|
29
|
+
} & Record<string, unknown>;
|
|
30
|
+
export type Edge<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
31
|
+
id: string;
|
|
32
|
+
animated?: boolean;
|
|
33
|
+
data?: T;
|
|
34
|
+
type?: string;
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
|
+
selected?: boolean;
|
|
37
|
+
selectable?: boolean;
|
|
38
|
+
source: string;
|
|
39
|
+
target: string;
|
|
40
|
+
deletable?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export type EdgePosition = {
|
|
43
|
+
sourceX: number;
|
|
44
|
+
sourceY: number;
|
|
45
|
+
targetX: number;
|
|
46
|
+
targetY: number;
|
|
47
|
+
sourcePosition: Position;
|
|
48
|
+
targetPosition: Position;
|
|
49
|
+
};
|
|
50
|
+
export type EdgeProps<T extends Edge = Edge> = Pick<T, 'id' | 'animated' | 'data' | 'style' | 'selected' | 'source' | 'target' | 'selectable' | 'deletable'> & EdgePosition & {
|
|
51
|
+
markerEnd?: string;
|
|
52
|
+
};
|
|
53
|
+
export type DefaultEdgeProps = {
|
|
54
|
+
edgePath?: 'simpleBezier' | 'smoothStep';
|
|
55
|
+
} & Record<string, unknown>;
|
|
56
|
+
export declare enum Position {
|
|
57
|
+
Left = "left",
|
|
58
|
+
Top = "top",
|
|
59
|
+
Right = "right",
|
|
60
|
+
Bottom = "bottom"
|
|
61
|
+
}
|
|
62
|
+
export type Connection = {
|
|
63
|
+
source: string;
|
|
64
|
+
sourceHandle: string | null;
|
|
65
|
+
target: string;
|
|
66
|
+
targetHandle: string | null;
|
|
67
|
+
};
|
|
68
|
+
type NodeTypes = Record<string, ComponentType<NodeProps & {
|
|
69
|
+
data: unknown;
|
|
70
|
+
type: unknown;
|
|
71
|
+
}>>;
|
|
72
|
+
type EdgeTypes = Record<string, ComponentType<EdgeProps & {
|
|
73
|
+
data: unknown;
|
|
74
|
+
type: unknown;
|
|
75
|
+
}>>;
|
|
76
|
+
export type DagProps = PropsWithChildren<{
|
|
77
|
+
isLoading?: boolean;
|
|
78
|
+
initialNodes?: Node[];
|
|
79
|
+
initialEdges?: Edge[];
|
|
80
|
+
nodeTypes?: NodeTypes;
|
|
81
|
+
edgeTypes?: EdgeTypes;
|
|
82
|
+
onNodeClick?: (event: React.MouseEvent, node: Node) => void;
|
|
83
|
+
onNodeDragStop?: (event: React.MouseEvent, node: Node) => void;
|
|
84
|
+
onNodeDragStart?: (event: React.MouseEvent, node: Node) => void;
|
|
85
|
+
onConnect?: (connection: Connection) => void;
|
|
86
|
+
}>;
|
|
87
|
+
export type UseDagProps = {
|
|
88
|
+
getEdges: () => Edge[];
|
|
89
|
+
getNodes: () => Node[];
|
|
90
|
+
getNode: (nodeId: string) => Node | undefined;
|
|
91
|
+
getEdge: (edgeId: string) => Edge | undefined;
|
|
92
|
+
zoomIn: () => void;
|
|
93
|
+
zoomOut: () => void;
|
|
94
|
+
fitView: (props: {
|
|
95
|
+
duration?: number;
|
|
96
|
+
maxZoom?: number;
|
|
97
|
+
minZoom?: number;
|
|
98
|
+
nodes?: Node[];
|
|
99
|
+
padding?: number;
|
|
100
|
+
}) => void;
|
|
101
|
+
addEdges: (edges: Edge[]) => void;
|
|
102
|
+
addNodes: (nodes: Node[]) => void;
|
|
103
|
+
deleteNodes: (node: Node | Node[]) => void;
|
|
104
|
+
deleteEdges: (edge: Edge | Edge[]) => void;
|
|
105
|
+
getNodeEdges: (nodeId: string) => Edge[];
|
|
106
|
+
changeOrientation: (props: {
|
|
107
|
+
direction: 'vertical' | 'horizontal';
|
|
108
|
+
nodeHeight?: number;
|
|
109
|
+
nodeWidth?: number;
|
|
110
|
+
}) => {
|
|
111
|
+
nodes: Node[];
|
|
112
|
+
edges: Edge[];
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Position, Connection, DagProps, DefaultNodeDataProps, Edge, EdgePosition, EdgeProps, Node, NodeProps, UseDagProps } from './dag-types';
|
|
2
|
+
export { Position };
|
|
3
|
+
export type { Connection, DagProps, DefaultNodeDataProps, Edge, EdgePosition, EdgeProps, Node, NodeProps, UseDagProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HandleType, Node } from '@xyflow/react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
export type AdjacentNodesProps = PropsWithChildren<{
|
|
4
|
+
title?: string;
|
|
5
|
+
nodeId: string;
|
|
6
|
+
type: HandleType;
|
|
7
|
+
nodeValueKey: string;
|
|
8
|
+
onFindAdjacentNodes?: (nodes: Node[]) => void;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function AdjacentNodes(props: AdjacentNodesProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DefaultEdgeProps, Edge, EdgeProps } from '../../model/dag-types';
|
|
2
|
+
export declare function DefaultEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, source, target, data, }: EdgeProps<Edge<DefaultEdgeProps>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SkeletonNode(): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/dag/ui/float-menu/default-float-buttons/button-change-orientation.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Edge, Node } from '../../../model';
|
|
2
|
+
export type ButtonChangeOrientationProps = {
|
|
3
|
+
orientation: 'vertical' | 'horizontal';
|
|
4
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>, props: {
|
|
5
|
+
nodes: Node[];
|
|
6
|
+
edges: Edge[];
|
|
7
|
+
}) => void;
|
|
8
|
+
shouldFitView?: boolean;
|
|
9
|
+
nodeHeight?: number;
|
|
10
|
+
nodeWidth?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const ButtonChangeOrientation: ({ onClick, orientation, shouldFitView, nodeHeight, nodeWidth, }: ButtonChangeOrientationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ButtonZoomIn: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ButtonZoomOut: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ButtonChangeOrientation, ButtonChangeOrientationProps } from './button-change-orientation';
|
|
2
|
+
import { ButtonZoomIn } from './button-zoom-in';
|
|
3
|
+
import { ButtonZoomOut } from './button-zoom-out';
|
|
4
|
+
export { ButtonChangeOrientation, ButtonZoomIn, ButtonZoomOut };
|
|
5
|
+
export type { ButtonChangeOrientationProps };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FloatMenu, FloatMenuProps } from './float-menu';
|
|
2
|
+
import { FloatMenuButton } from './float-menu-button';
|
|
3
|
+
import { FloatMenuButtonGroup } from './float-menu-button-group';
|
|
4
|
+
export { FloatMenu, FloatMenuButton, FloatMenuButtonGroup };
|
|
5
|
+
export type { FloatMenuProps };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Edge, Node, Position } from '@xyflow/react';
|
|
2
|
+
export interface GetLayoutedElementsProps {
|
|
3
|
+
nodes: Node[];
|
|
4
|
+
edges: Edge[];
|
|
5
|
+
direction?: 'vertical' | 'horizontal';
|
|
6
|
+
nodeWidth?: number;
|
|
7
|
+
nodeHeight?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const getLayoutedElements: (props: GetLayoutedElementsProps) => {
|
|
10
|
+
nodes: {
|
|
11
|
+
targetPosition: Position;
|
|
12
|
+
sourcePosition: Position;
|
|
13
|
+
position: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
id: string;
|
|
18
|
+
data: Record<string, unknown>;
|
|
19
|
+
type?: string | undefined;
|
|
20
|
+
hidden?: boolean | undefined;
|
|
21
|
+
selected?: boolean | undefined;
|
|
22
|
+
dragging?: boolean | undefined;
|
|
23
|
+
draggable?: boolean | undefined;
|
|
24
|
+
selectable?: boolean | undefined;
|
|
25
|
+
connectable?: boolean | undefined;
|
|
26
|
+
deletable?: boolean | undefined;
|
|
27
|
+
dragHandle?: string | undefined;
|
|
28
|
+
width?: number | undefined;
|
|
29
|
+
height?: number | undefined;
|
|
30
|
+
initialWidth?: number | undefined;
|
|
31
|
+
initialHeight?: number | undefined;
|
|
32
|
+
parentId?: string | undefined;
|
|
33
|
+
zIndex?: number | undefined;
|
|
34
|
+
extent?: "parent" | import('@xyflow/react').CoordinateExtent | undefined;
|
|
35
|
+
expandParent?: boolean | undefined;
|
|
36
|
+
ariaLabel?: string | undefined;
|
|
37
|
+
origin?: import('@xyflow/react').NodeOrigin | undefined;
|
|
38
|
+
handles?: import('@xyflow/system').NodeHandle[] | undefined;
|
|
39
|
+
measured?: {
|
|
40
|
+
width?: number | undefined;
|
|
41
|
+
height?: number | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
style?: import('react').CSSProperties | undefined;
|
|
44
|
+
className?: string | undefined;
|
|
45
|
+
resizing?: boolean | undefined;
|
|
46
|
+
focusable?: boolean | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
edges: Edge[];
|
|
49
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export type FileUploaderState = 'Loading' | 'Idle' | 'Disabled' | 'Finished';
|
|
3
|
+
export type FileUploaderProps = {
|
|
4
|
+
fileName: string;
|
|
5
|
+
fileSizeInMb: string;
|
|
6
|
+
onDownload: () => void;
|
|
7
|
+
state: FileUploaderState;
|
|
8
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
9
|
+
export declare function FileUploader(props: FileUploaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type ImageUploaderState = 'Uploading' | 'Removing' | 'Idle' | 'Disabled' | 'Finished';
|
|
3
|
+
export type ImageUploaderProps = {
|
|
4
|
+
imageName?: string;
|
|
5
|
+
imageSize?: string;
|
|
6
|
+
maxImageSizeInKb?: number;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
onError?: (errorMessage: string) => void;
|
|
9
|
+
onRemove?: () => void;
|
|
10
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
state: ImageUploaderState;
|
|
12
|
+
customImagePreview?: React.ReactElement;
|
|
13
|
+
customImage?: React.ReactElement;
|
|
14
|
+
errorMessages?: {
|
|
15
|
+
priorityError?: string;
|
|
16
|
+
imageTypeError?: string;
|
|
17
|
+
imageSizeError?: string;
|
|
18
|
+
};
|
|
19
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;
|
|
20
|
+
export declare function ImageUploader(props: ImageUploaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ContentSplit, ContentSplitProps } from './content-split';
|
|
2
|
+
import { Sidebar, SidebarProps } from './sidebar';
|
|
3
|
+
import { SidebarHeader } from './sidebar-header';
|
|
4
|
+
export { Sidebar, SidebarHeader, ContentSplit };
|
|
5
|
+
export type { SidebarProps, ContentSplitProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
declare const sidebarVariants: (props?: ({
|
|
4
|
+
direction?: "left" | "right" | "fixed" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export type SidebarProps = PropsWithChildren<{
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & VariantProps<typeof sidebarVariants>>;
|
|
10
|
+
export declare function Sidebar(props: SidebarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dateFormatter(value: string): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getTextWidthByFont(text: string, font?: string): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function indexedAlphabet(columns: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function oneLineString(value: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function textOverflow(text: string, maxWidth: number): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useSpreadsheet(): import('../model/spreadsheet').Context;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IWithPortalProvider {
|
|
3
|
+
children: React.ReactElement<{
|
|
4
|
+
ref?: React.RefObject<HTMLElement | null>;
|
|
5
|
+
}>;
|
|
6
|
+
}
|
|
7
|
+
export declare const WithPortalProvider: ({ children }: IWithPortalProvider) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const useWithPortal: () => {
|
|
9
|
+
portalRef?: React.RefObject<HTMLElement> | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** A cell cordinates in matrix */
|
|
2
|
+
export type Point = {
|
|
3
|
+
row: number;
|
|
4
|
+
column: number;
|
|
5
|
+
};
|
|
6
|
+
/** Range between two points. */
|
|
7
|
+
export type PointRange = {
|
|
8
|
+
/** The top-left point */
|
|
9
|
+
start: Point;
|
|
10
|
+
/** The bottom-right point */
|
|
11
|
+
end: Point;
|
|
12
|
+
};
|
|
13
|
+
/** Counts of the rows and column in a matrix */
|
|
14
|
+
export type Size = {
|
|
15
|
+
/** Count of the rows in the matrix */
|
|
16
|
+
rows: number;
|
|
17
|
+
/** Count of the columns in the matrix */
|
|
18
|
+
columns: number;
|
|
19
|
+
};
|
|
20
|
+
export type Matrix<T> = Array<Array<T | undefined>>;
|
|
21
|
+
/** Creates an empty matrix with given rows and columns */
|
|
22
|
+
export declare function createEmpty<T>(size: Size, fill?: T): Matrix<T>;
|
|
23
|
+
/** Gets the count of rows of given matrix */
|
|
24
|
+
export declare function getRowsCount(matrix: Matrix<unknown>): number;
|
|
25
|
+
/** Gets the count of columns of given matrix */
|
|
26
|
+
export declare function getColumnsCount(matrix: Matrix<unknown>): number;
|
|
27
|
+
/** Gets the count of rows and columns of given matrix */
|
|
28
|
+
export declare function getSize(matrix: Matrix<unknown>): Size;
|
|
29
|
+
/** Gets the value at row and column of matrix. */
|
|
30
|
+
export declare function getPoint<T>(params: {
|
|
31
|
+
point: Point;
|
|
32
|
+
matrix: Matrix<T>;
|
|
33
|
+
}): T | undefined;
|
|
34
|
+
/** Checks if the source and target point are equal */
|
|
35
|
+
export declare function isSamePoint(source: Point, target: Point): boolean;
|
|
36
|
+
/** Returns whether given point exists in given range */
|
|
37
|
+
export declare function hasPointInRange(pointsRange: PointRange[], point: Point): boolean;
|
|
38
|
+
/** Determines whether all columns are selected */
|
|
39
|
+
export declare function hasEntireColumns(params: {
|
|
40
|
+
matrix: Matrix<unknown>;
|
|
41
|
+
pointsRange: PointRange[];
|
|
42
|
+
}): true | undefined;
|
|
43
|
+
/** Determines which row is entirely selected in given selection */
|
|
44
|
+
export declare function hasEntireRows(params: {
|
|
45
|
+
matrix: Matrix<unknown>;
|
|
46
|
+
pointsRange: PointRange[];
|
|
47
|
+
row: number;
|
|
48
|
+
}): boolean;
|
|
49
|
+
/** Converts string value into an matrix */
|
|
50
|
+
export declare function parseString(value: string): Matrix<unknown>;
|
|
51
|
+
/**
|
|
52
|
+
* Overlaps a given Matrix B (mB) starting in a specific point into a given Matrix A (mA)
|
|
53
|
+
* Matrix B (mB) always has priority when replacing cell values
|
|
54
|
+
*/
|
|
55
|
+
export declare function overlap(params: {
|
|
56
|
+
mA: Matrix<unknown>;
|
|
57
|
+
mB: Matrix<unknown>;
|
|
58
|
+
point: Point;
|
|
59
|
+
}): Matrix<unknown>;
|