@layers-app/shared 0.0.36 → 0.0.37-0
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/{KanbanLayout-B8RukpT8.js → KanbanLayout-Diy-kZtU.js} +1 -1
- package/dist/{TimeLine--HywOpKf.js → TimeLine-CNziqKtl.js} +3 -3
- package/dist/components/ColorPicker/ColorPicker.d.ts +5 -0
- package/dist/components/Copyright/index.d.ts +9 -0
- package/dist/components/FlowEditor/components/FlowAction/index.d.ts +7 -0
- package/dist/components/FlowEditor/components/colors.d.ts +19 -0
- package/dist/components/FlowEditor/components/edges/ConnectionLine.d.ts +8 -0
- package/dist/components/FlowEditor/components/edges/Custom.d.ts +4 -0
- package/dist/components/FlowEditor/components/edges/index.d.ts +4 -0
- package/dist/components/FlowEditor/components/editor/EdgeEdit.d.ts +12 -0
- package/dist/components/FlowEditor/components/editor/GridControls.d.ts +1 -0
- package/dist/components/FlowEditor/components/editor/KeyboardShortcuts.d.ts +1 -0
- package/dist/components/FlowEditor/components/editor/NodeEdit.d.ts +11 -0
- package/dist/components/FlowEditor/components/editor/NodeSelect.d.ts +7 -0
- package/dist/components/FlowEditor/components/editor/TextEdit.d.ts +11 -0
- package/dist/components/FlowEditor/components/editor/Toolbox.d.ts +10 -0
- package/dist/components/FlowEditor/components/editor/UndoRedoControls.d.ts +5 -0
- package/dist/components/FlowEditor/components/editor/ViewportControls.d.ts +1 -0
- package/dist/components/FlowEditor/components/editor/index.d.ts +12 -0
- package/dist/components/FlowEditor/components/index.d.ts +5 -0
- package/dist/components/FlowEditor/components/nodes/Resizer.d.ts +8 -0
- package/dist/components/FlowEditor/components/nodes/index.d.ts +145 -0
- package/dist/components/FlowEditor/components/nodes/shapes/Circle.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/shapes/Diamond.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/shapes/Rectangle.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/shapes/RoundRectangle.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/shapes/ShapeSetup.d.ts +5 -0
- package/dist/components/FlowEditor/components/nodes/shapes/Triangle.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Discord.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Etsy.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Facebook.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Flickr.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Github.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Gmail.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Instagram.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Linkedin.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Medium.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Pinterest.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Reddit.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Skype.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Slack.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Snapchat.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Telegram.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Threads.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/TikTok.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Twitch.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Vimeo.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Whatsup.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Wrapper.d.ts +5 -0
- package/dist/components/FlowEditor/components/nodes/social/XTwitter.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/social/Youtube.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/text/Annotation.d.ts +4 -0
- package/dist/components/FlowEditor/components/nodes/wireframes/Browser.d.ts +8 -0
- package/dist/components/FlowEditor/components/nodes/wireframes/ColorSchemeImage.d.ts +3 -0
- package/dist/components/FlowEditor/context/DragDropContext.d.ts +10 -0
- package/dist/components/FlowEditor/hooks/useFlow.d.ts +35 -0
- package/dist/components/FlowEditor/hooks/usePngExport.d.ts +1 -0
- package/dist/components/FlowEditor/index.d.ts +10 -0
- package/dist/components/FlowEditor/store/useFlowStore.d.ts +9 -0
- package/dist/components/FlowEditor/store/useUndoRedoStore.d.ts +24 -0
- package/dist/components/FlowEditor/types.d.ts +0 -0
- package/dist/components/FlowEditor/utils/index.d.ts +1 -0
- package/dist/components/Logotype.d.ts +4 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.d.ts +1 -2
- package/dist/components/SearchFilters/SearchFilters.d.ts +4 -2
- package/dist/components/SearchFilters/components/Type.d.ts +3 -2
- package/dist/components/SearchFilters/types.d.ts +1 -1
- package/dist/components/TemplatesModal/components/SelectedTemplate.d.ts +7 -0
- package/dist/components/TemplatesModal/components/Template.d.ts +9 -0
- package/dist/components/TemplatesModal/components/Templates.d.ts +7 -0
- package/dist/components/TemplatesModal/data.d.ts +13 -0
- package/dist/components/TemplatesModal/index.d.ts +7 -0
- package/dist/components/TemplatesModal/types.d.ts +16 -0
- package/dist/components/table/FrontTable.d.ts +35 -0
- package/dist/components/table/api.d.ts +31 -0
- package/dist/components/table/components/Table.d.ts +1 -0
- package/dist/components/table/components/TableAggregation.d.ts +1 -0
- package/dist/components/table/components/TableCell.d.ts +11 -0
- package/dist/components/table/components/TableHeaderCell.d.ts +17 -0
- package/dist/components/table/components/TableHeaders.d.ts +1 -0
- package/dist/components/table/components/TableMenu.d.ts +4 -0
- package/dist/components/table/components/TablePagination.d.ts +1 -0
- package/dist/components/table/components/TablePanel.d.ts +1 -0
- package/dist/components/table/components/TableRow.d.ts +14 -0
- package/dist/components/table/components/TableRows.d.ts +14 -0
- package/dist/components/table/components/TableSearch.d.ts +1 -0
- package/dist/components/table/components/TableSkeleton.d.ts +11 -0
- package/dist/components/table/components/TableTitle.d.ts +16 -0
- package/dist/components/table/constants.d.ts +25 -0
- package/dist/components/table/export.d.ts +9 -0
- package/dist/components/table/helpers/columns.d.ts +28 -0
- package/dist/components/table/helpers/formatters.d.ts +76 -0
- package/dist/components/table/hooks/TableProvider.d.ts +57 -0
- package/dist/components/table/hooks/useColumnsResizing.d.ts +5 -0
- package/dist/components/table/hooks/useCreateTable.d.ts +52 -0
- package/dist/components/table/hooks/useSaveRowCount.d.ts +1 -0
- package/dist/components/table/hooks/useSorting.d.ts +2 -0
- package/dist/components/table/hooks/useTableStore.d.ts +51 -0
- package/dist/components/table/selectors.d.ts +1837 -0
- package/dist/components/table/store.d.ts +83 -0
- package/dist/components/table/types.d.ts +99 -0
- package/dist/index-C4NKtsV-.js +78436 -0
- package/dist/index.d.ts +11 -0
- package/dist/{index.esm-DbeiBKnb.js → index.esm-DkcsgZzy.js} +1 -1
- package/dist/index.js +171 -120
- package/dist/index.umd.cjs +618 -116
- package/dist/store/accessOptionsControl.d.ts +6 -0
- package/dist/utils/getPlanBadgeColor.d.ts +6 -0
- package/dist/utils/queryParams.d.ts +2 -0
- package/package.json +2 -2
- package/dist/index-D_nxhqe0.js +0 -39586
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Connection, NodeChange, OnEdgesChange, XYPosition } from '@xyflow/react';
|
|
2
|
+
import { ApiFlowLight } from '../../../../../flow/src/api/flowLight/types.ts';
|
|
3
|
+
interface Props {
|
|
4
|
+
value: {
|
|
5
|
+
nodes: string;
|
|
6
|
+
edges: string;
|
|
7
|
+
};
|
|
8
|
+
flowId: string;
|
|
9
|
+
onChange?: (flow: Props['value']) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const useFlow: ({ value, onChange, flowId }: Props) => {
|
|
12
|
+
nodes: ApiFlowLight.FlowNodeItem[];
|
|
13
|
+
edges: ApiFlowLight.FlowEdgeItem[];
|
|
14
|
+
onNodesChange: (changes: NodeChange<ApiFlowLight.FlowNodeItem>[]) => Promise<void>;
|
|
15
|
+
onEdgesChange: OnEdgesChange<ApiFlowLight.FlowEdgeItem>;
|
|
16
|
+
onConnect: (params: Connection) => void;
|
|
17
|
+
addNode: (type: ApiFlowLight.NodeType, position: XYPosition, data?: Partial<ApiFlowLight.FlowNodeItem["data"]>, measured?: Partial<ApiFlowLight.FlowNodeItem["measured"]>) => void;
|
|
18
|
+
updateNodeData: (nodeId: string, data: Partial<ApiFlowLight.FlowNodeItem["data"]>) => void;
|
|
19
|
+
updateEdge: (edgeId: string, data: Partial<ApiFlowLight.FlowEdgeItem>) => void;
|
|
20
|
+
updateEdgeData: (edgeId: string, data: Partial<Required<ApiFlowLight.FlowEdgeItem>["data"]>) => void;
|
|
21
|
+
};
|
|
22
|
+
export interface UseFlowResult {
|
|
23
|
+
nodes: ApiFlowLight.FlowNodeItem[];
|
|
24
|
+
edges: ApiFlowLight.FlowEdgeItem[];
|
|
25
|
+
onNodesChange: (changes: NodeChange<ApiFlowLight.FlowNodeItem>[], selectedNode?: ApiFlowLight.FlowNodeItem | null) => void;
|
|
26
|
+
onEdgesChange: OnEdgesChange<ApiFlowLight.FlowEdgeItem>;
|
|
27
|
+
onConnect: (params: Connection) => void;
|
|
28
|
+
addNode: (type: ApiFlowLight.NodeType, position: XYPosition, data?: Partial<ApiFlowLight.FlowNodeItem['data']>, measured?: Partial<ApiFlowLight.FlowNodeItem['measured']>) => void;
|
|
29
|
+
updateNodeData: (nodeId: string, data: Partial<ApiFlowLight.FlowNodeItem['data']>) => void;
|
|
30
|
+
updateEdge: (edgeId: string, data: Partial<ApiFlowLight.FlowEdgeItem>) => void;
|
|
31
|
+
updateEdgeData: (edgeId: string, data: Partial<Required<ApiFlowLight.FlowEdgeItem>['data']>) => void;
|
|
32
|
+
returnNode: (node: ApiFlowLight.FlowNodeItem) => void;
|
|
33
|
+
returnEdge: (edge: ApiFlowLight.FlowEdgeItem) => void;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePngExport: () => (flowName: string) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value: {
|
|
3
|
+
nodes: string;
|
|
4
|
+
edges: string;
|
|
5
|
+
};
|
|
6
|
+
flowId: string;
|
|
7
|
+
onChange?: (data: Props['value']) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const FlowEditor: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ApiFlowLight } from '../../../../../flow/src/api/flowLight/types.ts';
|
|
2
|
+
interface FlowStateSnapshot {
|
|
3
|
+
nodes: ApiFlowLight.FlowNodeItem[];
|
|
4
|
+
edges: ApiFlowLight.FlowEdgeItem[];
|
|
5
|
+
}
|
|
6
|
+
interface PerFlowUndoRedoState {
|
|
7
|
+
undoStack: FlowStateSnapshot[];
|
|
8
|
+
redoStack: FlowStateSnapshot[];
|
|
9
|
+
current: FlowStateSnapshot;
|
|
10
|
+
}
|
|
11
|
+
interface UndoRedoState {
|
|
12
|
+
flows: Record<string, PerFlowUndoRedoState>;
|
|
13
|
+
initFlow: (flowId: string, initialState?: FlowStateSnapshot) => void;
|
|
14
|
+
setSnapshot: (flowId: string, snapshot: FlowStateSnapshot) => void;
|
|
15
|
+
undo: (flowId: string) => void;
|
|
16
|
+
redo: (flowId: string) => void;
|
|
17
|
+
getCurrent: (flowId: string) => FlowStateSnapshot | undefined;
|
|
18
|
+
canUndo: (flowId: string) => boolean;
|
|
19
|
+
canRedo: (flowId: string) => boolean;
|
|
20
|
+
clearHistory: (flowId: string) => void;
|
|
21
|
+
setCurrent: (flowId: string, snapshot: FlowStateSnapshot) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const useFlowUndoRedoStore: import('zustand').UseBoundStore<import('zustand').StoreApi<UndoRedoState>>;
|
|
24
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const truncate: (text: string, maxLength?: number) => string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { FlexProps } from '@mantine/core';
|
|
2
2
|
import { default as LayersLogoIcon } from '../assets/layers-logo-icon.svg?react';
|
|
3
|
-
|
|
3
|
+
import { default as LayersLogoCopyright } from '../assets/logo-copyright.svg?react';
|
|
4
|
+
export declare const Logotype: ({ minified, isLink, to, variant, ...props }: FlexProps & {
|
|
4
5
|
minified?: boolean;
|
|
5
6
|
isLink?: boolean;
|
|
6
7
|
to?: string;
|
|
8
|
+
variant?: "default" | "copyright";
|
|
7
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export { LayersLogoIcon };
|
|
10
|
+
export { LayersLogoIcon, LayersLogoCopyright };
|
|
@@ -5,7 +5,6 @@ type Props = {
|
|
|
5
5
|
PreviewComponent?: React.FC<{
|
|
6
6
|
data: any;
|
|
7
7
|
}>;
|
|
8
|
-
zoom?: boolean;
|
|
9
8
|
};
|
|
10
|
-
export declare const NotPublicPanel: ({ entityData, handlePublish, isPublishing, PreviewComponent,
|
|
9
|
+
export declare const NotPublicPanel: ({ entityData, handlePublish, isPublishing, PreviewComponent, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { SelectedFilter, setSelectedFilterType } from './types';
|
|
1
|
+
import { FilterType, SelectedFilter, setSelectedFilterType } from './types';
|
|
2
2
|
interface IProps {
|
|
3
|
+
allowedTypes?: FilterType[];
|
|
4
|
+
allowedFilters?: string[];
|
|
3
5
|
setSelectedFilter?: setSelectedFilterType;
|
|
4
6
|
selectedFilter?: SelectedFilter;
|
|
5
7
|
}
|
|
6
|
-
export declare const SearchFilters: ({ setSelectedFilter, selectedFilter, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const SearchFilters: ({ setSelectedFilter, selectedFilter, allowedTypes, allowedFilters, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { SelectedFilter } from '../types';
|
|
1
|
+
import { FilterType, SelectedFilter } from '../types';
|
|
2
2
|
interface IProps {
|
|
3
3
|
setSelectedFilter: (value: (prev: SelectedFilter) => SelectedFilter) => void;
|
|
4
4
|
selectedFilter?: SelectedFilter;
|
|
5
|
+
allowedTypes?: FilterType[];
|
|
5
6
|
}
|
|
6
|
-
export declare const Type: ({ setSelectedFilter, selectedFilter }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Type: ({ setSelectedFilter, selectedFilter, allowedTypes, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SortOrder = 'asc' | 'desc';
|
|
2
|
-
export type FilterType = '
|
|
2
|
+
export type FilterType = 'PAGE' | 'PROJECT' | 'FLOW' | 'FORM' | 'FOLDER' | null;
|
|
3
3
|
export type SortFilter = {
|
|
4
4
|
[key: string]: {
|
|
5
5
|
order: SortOrder;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Template } from '../types.ts';
|
|
2
|
+
interface Props {
|
|
3
|
+
selectedTemplate: Template;
|
|
4
|
+
closeSelectedTemplateContent: VoidFunction;
|
|
5
|
+
}
|
|
6
|
+
export declare const SelectedTemplate: ({ selectedTemplate, closeSelectedTemplateContent, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { templates } from '../data.ts';
|
|
2
|
+
import { Template as TemplateType } from '../types.ts';
|
|
3
|
+
interface Props {
|
|
4
|
+
template: (typeof templates)[number];
|
|
5
|
+
setSelectedTemplate: (template: TemplateType) => void;
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const Template: ({ template, setSelectedTemplate, index }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Template as TemplateType } from '../types.ts';
|
|
2
|
+
interface Props {
|
|
3
|
+
title?: string;
|
|
4
|
+
setSelectedTemplate: (template: TemplateType) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const Templates: ({ title, setSelectedTemplate }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Template } from './types.ts';
|
|
2
|
+
export declare const templateCategories: string[];
|
|
3
|
+
export declare const appTypeConfig: readonly [{
|
|
4
|
+
readonly type: "Pages";
|
|
5
|
+
readonly icon: import('react').ForwardRefExoticComponent<import('@tabler/icons-react').IconProps & import('react').RefAttributes<import('@tabler/icons-react').Icon>>;
|
|
6
|
+
}, {
|
|
7
|
+
readonly type: "Flow";
|
|
8
|
+
readonly icon: import('react').ForwardRefExoticComponent<import('@tabler/icons-react').IconProps & import('react').RefAttributes<import('@tabler/icons-react').Icon>>;
|
|
9
|
+
}, ...{
|
|
10
|
+
type: string;
|
|
11
|
+
icon: import('react').ForwardRefExoticComponent<import('@tabler/icons-react').IconProps & import('react').RefAttributes<import('@tabler/icons-react').Icon>>;
|
|
12
|
+
}[]];
|
|
13
|
+
export declare const templates: Template[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare const openTemplatesModal: () => void;
|
|
3
|
+
export declare const closeTemplatesModal: () => void;
|
|
4
|
+
export declare const TemplatesModal: FC;
|
|
5
|
+
export declare const TemplatesLayout: ({ title }: {
|
|
6
|
+
title?: string;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type AppType = 'Pages' | 'Forms' | 'Flow';
|
|
2
|
+
export interface Template {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
category: string;
|
|
7
|
+
appType: AppType;
|
|
8
|
+
author: string;
|
|
9
|
+
views?: number;
|
|
10
|
+
isBlocked?: boolean;
|
|
11
|
+
pageId: string;
|
|
12
|
+
wsId: string;
|
|
13
|
+
createdAt?: string;
|
|
14
|
+
tags?: string[];
|
|
15
|
+
longDescription?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const FrontTable: import('react').NamedExoticComponent<unknown> & {
|
|
2
|
+
readonly type: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
} & {
|
|
4
|
+
Header: import('@emotion/styled').StyledComponent<{
|
|
5
|
+
theme?: import('@emotion/react').Theme;
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
Title: import('@emotion/styled').StyledComponent<{
|
|
9
|
+
theme?: import('@emotion/react').Theme;
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
Desc: import('@emotion/styled').StyledComponent<{
|
|
13
|
+
theme?: import('@emotion/react').Theme;
|
|
14
|
+
as?: React.ElementType;
|
|
15
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
16
|
+
Pagination: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
17
|
+
Search: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
18
|
+
Root: import('@emotion/styled').StyledComponent<{
|
|
19
|
+
theme?: import('@emotion/react').Theme;
|
|
20
|
+
as?: React.ElementType;
|
|
21
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
22
|
+
Provider: <ITEM extends import('./types').TableRowModel>({ children, store, rows, columns, loading, pageSizeOptions, rowHeight, headerHeight, rowCount, exportFileName, pagination, virtualization, searching, selection, sorting, expanding, }: import('react').PropsWithChildren<{
|
|
23
|
+
store: import('./store').CreateTableReturn;
|
|
24
|
+
} & import('./types').TableProps<ITEM>>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
Menu: import('react').MemoExoticComponent<({ onExport, isLoading, }: {
|
|
26
|
+
onExport?: (format: "csv" | "xlsx") => void;
|
|
27
|
+
isLoading?: boolean;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
29
|
+
};
|
|
30
|
+
export * from './hooks/useCreateTable';
|
|
31
|
+
export * from './hooks/useSaveRowCount';
|
|
32
|
+
export * from './types';
|
|
33
|
+
export * from './helpers/columns';
|
|
34
|
+
export * from './components/TableSearch';
|
|
35
|
+
export * from './components/TablePagination';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { UseStore } from './store';
|
|
2
|
+
import { TableSortModel } from './types';
|
|
3
|
+
export type TableAPI = ReturnType<typeof createApi>;
|
|
4
|
+
export declare const createApi: (store: UseStore) => {
|
|
5
|
+
setPageSize: (v: number) => void;
|
|
6
|
+
setPage: (v: number) => void;
|
|
7
|
+
setSort: (v: TableSortModel | null) => void;
|
|
8
|
+
downloadCSV: () => void;
|
|
9
|
+
downloadExcel: () => void;
|
|
10
|
+
setSelected: (selected: string[]) => void;
|
|
11
|
+
toggleColumn: (v: string) => void;
|
|
12
|
+
setVisibleColumns: (v: string[]) => void;
|
|
13
|
+
setSearch: (v: string) => void;
|
|
14
|
+
setPrevPage: () => void;
|
|
15
|
+
setNextPage: () => void;
|
|
16
|
+
setColumnWidth: (field: string, setWidth: number) => void;
|
|
17
|
+
toggleRowExpand: (id: string) => void;
|
|
18
|
+
setRootRef: (rootRef: HTMLDivElement) => void;
|
|
19
|
+
setScrollRef: (scrollRef: HTMLDivElement) => void;
|
|
20
|
+
calculateColumnWidths: (clear?: boolean) => void;
|
|
21
|
+
selectVisibleRows: () => void;
|
|
22
|
+
unselectVisibleRows: () => void;
|
|
23
|
+
unselectRow: (id: string) => void;
|
|
24
|
+
selectRow: (id: string) => void;
|
|
25
|
+
setAutosize: () => void;
|
|
26
|
+
removeAutosize: () => void;
|
|
27
|
+
setColumnsOrder: (columnsOrder: string[]) => void;
|
|
28
|
+
setColumnOrder: (columnId: string, index: number) => void;
|
|
29
|
+
moveColumnLeft: (columnId: string) => void;
|
|
30
|
+
moveColumnRight: (columnId: string) => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Table: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableAggregation: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TableColumnDef, TableRowModel } from '../types';
|
|
2
|
+
interface TableCellProps {
|
|
3
|
+
column: TableColumnDef;
|
|
4
|
+
row: TableRowModel;
|
|
5
|
+
}
|
|
6
|
+
export declare const TableCell: import('react').MemoExoticComponent<({ column, row }: TableCellProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export declare const CellRoot: import('@emotion/styled').StyledComponent<{
|
|
8
|
+
theme?: import('@emotion/react').Theme;
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { TableColumnDef, TableSortModel } from '../types';
|
|
3
|
+
interface TableHeaderCellProps {
|
|
4
|
+
column: TableColumnDef;
|
|
5
|
+
sort?: TableSortModel | null;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
export declare const TableHeaderCell: ({ column, sort, style, }: TableHeaderCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const HeaderCellRoot: import('@emotion/styled').StyledComponent<{
|
|
10
|
+
theme?: import('@emotion/react').Theme;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const HeaderCellContent: import('@emotion/styled').StyledComponent<{
|
|
14
|
+
theme?: import('@emotion/react').Theme;
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableHeaders: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TablePagination: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TablePanel: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RowMeta, TableColumnDef, TableRowModel } from '../types';
|
|
2
|
+
interface TableRowProps {
|
|
3
|
+
start: number;
|
|
4
|
+
row: TableRowModel;
|
|
5
|
+
selected: string[];
|
|
6
|
+
meta: Partial<Record<string, RowMeta>>;
|
|
7
|
+
columns: {
|
|
8
|
+
left: TableColumnDef[];
|
|
9
|
+
base: TableColumnDef[];
|
|
10
|
+
right: TableColumnDef[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const TableRow: import('react').MemoExoticComponent<({ row, meta, columns, selected, start }: TableRowProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RowMeta, TableColumnDef, TableRowModel } from '../types';
|
|
2
|
+
type RenderRowsProps = {
|
|
3
|
+
rows: TableRowModel[];
|
|
4
|
+
meta: Partial<Record<string, RowMeta>>;
|
|
5
|
+
selected: string[];
|
|
6
|
+
virtual?: boolean;
|
|
7
|
+
columns: {
|
|
8
|
+
left: TableColumnDef[];
|
|
9
|
+
base: TableColumnDef[];
|
|
10
|
+
right: TableColumnDef[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const TableRows: import('react').MemoExoticComponent<({ rows, meta, columns, selected, virtual }: RenderRowsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableSearch: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TableColumnDef } from '../types';
|
|
2
|
+
type TableSkeletonProps = {
|
|
3
|
+
count: number;
|
|
4
|
+
columns: {
|
|
5
|
+
left: TableColumnDef[];
|
|
6
|
+
base: TableColumnDef[];
|
|
7
|
+
right: TableColumnDef[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const TableSkeleton: import('react').MemoExoticComponent<({ count, columns }: TableSkeletonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const TableTitle: import('@emotion/styled').StyledComponent<{
|
|
2
|
+
theme?: import('@emotion/react').Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
|
+
export declare const TableHeader: import('@emotion/styled').StyledComponent<{
|
|
6
|
+
theme?: import('@emotion/react').Theme;
|
|
7
|
+
as?: React.ElementType;
|
|
8
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
export declare const TableRoot: import('@emotion/styled').StyledComponent<{
|
|
10
|
+
theme?: import('@emotion/react').Theme;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const TableDesc: import('@emotion/styled').StyledComponent<{
|
|
14
|
+
theme?: import('@emotion/react').Theme;
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const TABLE_ATTRIBUTES: {
|
|
2
|
+
readonly ROW: "data-row";
|
|
3
|
+
readonly CELL: "data-cell";
|
|
4
|
+
readonly ROOT: "data-root";
|
|
5
|
+
readonly COLUMN_ALIGN: "data-al";
|
|
6
|
+
readonly SCROLLED: "data-scrolled";
|
|
7
|
+
readonly SORTABLE: "data-sortable";
|
|
8
|
+
readonly RESIZER: "data-resizer";
|
|
9
|
+
readonly RESIZER_SIDE: "data-side";
|
|
10
|
+
readonly ROW_SELECTED: "data-sel";
|
|
11
|
+
readonly ROW_CHILD: "data-child";
|
|
12
|
+
readonly SORTED: "data-sorted";
|
|
13
|
+
readonly HEADER_CELL: "data-header";
|
|
14
|
+
readonly INNER: "data-inner";
|
|
15
|
+
readonly AUTOSIZE: "data-autosize";
|
|
16
|
+
readonly PANEL_SIDE: "data-side";
|
|
17
|
+
readonly HEADER_GRID: "data-header-grid";
|
|
18
|
+
readonly VIRTUAL_CONTAINER: "data-virtual";
|
|
19
|
+
readonly BASE: "data-base";
|
|
20
|
+
readonly HEADERS: "data-headers";
|
|
21
|
+
readonly HEADER_GROUP: "data-header-group";
|
|
22
|
+
};
|
|
23
|
+
export declare const SELECT_COLUMN_FIELD = "__checkbox__";
|
|
24
|
+
export declare const EXPAND_COLUMN_FIELD = "__expand__";
|
|
25
|
+
export declare const TABLE_AGGREGATION_ROW_ID = "__aggregation__";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableColumnDef, TableRowModel } from './types';
|
|
2
|
+
type ExportProps<T extends TableRowModel> = {
|
|
3
|
+
rows: T[];
|
|
4
|
+
columns: TableColumnDef<T>[];
|
|
5
|
+
fileName: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const exportToExcel: <T extends TableRowModel>({ rows, columns, fileName, }: ExportProps<T>) => Promise<void>;
|
|
8
|
+
export declare const exportToCSV: <T extends TableRowModel>({ rows, columns, fileName, }: ExportProps<T>) => Promise<void>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { TableAPI } from '../api';
|
|
3
|
+
import { DateColumnProps, TableColumnDef, TableColumnPin, TableColumnState, TableColumnsProp, TableRowModel } from '../types';
|
|
4
|
+
import { Numbers } from './formatters';
|
|
5
|
+
export declare const getDateColumn: (props?: DateColumnProps) => Partial<TableColumnDef>;
|
|
6
|
+
export declare const getNumberColumn: (props?: Numbers.FormatterProps) => Partial<TableColumnDef>;
|
|
7
|
+
export declare const getRatioColumn: (props?: Numbers.FormatterProps) => Partial<TableColumnDef>;
|
|
8
|
+
export declare const getPercentColumn: (props?: Omit<Numbers.FormatterProps, "value">) => Partial<TableColumnDef>;
|
|
9
|
+
export declare const getCurrencyColumn: (props?: Omit<Numbers.FormatterProps, "value">) => Partial<TableColumnDef>;
|
|
10
|
+
export declare const getColumnId: (str: string) => string;
|
|
11
|
+
export declare const getColumnsProps: <T extends TableRowModel>(type: TableColumnDef<T>["type"]) => Partial<TableColumnDef>;
|
|
12
|
+
export declare const isTechnicalColumn: (col: string) => col is "__checkbox__" | "__expand__";
|
|
13
|
+
export type GridAreaMap = Record<string, string>;
|
|
14
|
+
export declare function filterPinnedColumns(columns: TableColumnsProp, pinnedSide?: TableColumnPin): TableColumnsProp;
|
|
15
|
+
export declare const mergeColumn: (current: TableColumnDef, update?: Partial<TableColumnState>) => TableColumnState;
|
|
16
|
+
export declare const getHeaderStyles: (columns: TableColumnDef[]) => CSSProperties;
|
|
17
|
+
export declare const getExpandingColumn: ({ expanded, api, pinned, }: {
|
|
18
|
+
expanded: string[];
|
|
19
|
+
api: TableAPI;
|
|
20
|
+
pinned: boolean;
|
|
21
|
+
}) => TableColumnState;
|
|
22
|
+
export declare const getSelectionColumn: ({ selected, api, pinned, }: {
|
|
23
|
+
selected: string[];
|
|
24
|
+
api: TableAPI;
|
|
25
|
+
pinned: boolean;
|
|
26
|
+
}) => TableColumnState;
|
|
27
|
+
export declare const getAggregationColumns: (columns: TableColumnDef[], aggregatedRow: TableRowModel, rows: TableRowModel[]) => TableColumnDef[];
|
|
28
|
+
export declare const getAggregateValue: (column: TableColumnDef, rows: TableRowModel[]) => number | null;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A namespace containing utility functions for number parsing, validation, and formatting
|
|
3
|
+
*/
|
|
4
|
+
export declare namespace Numbers {
|
|
5
|
+
type AcceptableValue = number | string | null | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Parses a value into a number, handling various input types
|
|
8
|
+
* @param value - The value to parse (can be number, string, or null/undefined)
|
|
9
|
+
* @returns The parsed number or NaN if parsing fails
|
|
10
|
+
*/
|
|
11
|
+
const parse: (value: AcceptableValue) => number;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if a value is a positive number
|
|
14
|
+
* @param value - The value to check
|
|
15
|
+
* @returns True if the value is a positive number, false otherwise
|
|
16
|
+
*/
|
|
17
|
+
const isPositive: (value: AcceptableValue) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a value is a negative number
|
|
20
|
+
* @param v - The value to check
|
|
21
|
+
* @returns True if the value is a negative number, false otherwise
|
|
22
|
+
*/
|
|
23
|
+
const isNegative: (value: AcceptableValue) => boolean;
|
|
24
|
+
const getDynamic: (v: AcceptableValue, invert?: boolean) => DynamicType | null;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if a value is a valid number
|
|
27
|
+
* @param v - The value to check
|
|
28
|
+
* @returns True if the value is a valid number, false otherwise
|
|
29
|
+
*/
|
|
30
|
+
const isNumber: (value: AcceptableValue) => value is number;
|
|
31
|
+
/**
|
|
32
|
+
* Type definition for number formatting styles
|
|
33
|
+
*/
|
|
34
|
+
type NumberType = 'number' | 'percent' | 'currency';
|
|
35
|
+
/**
|
|
36
|
+
* Configuration options for number formatting
|
|
37
|
+
*/
|
|
38
|
+
type FormatterProps = Intl.NumberFormatOptions & {
|
|
39
|
+
/** The locale to use for formatting */
|
|
40
|
+
locale?: Intl.LocalesArgument;
|
|
41
|
+
/** Whether to force decimal places */
|
|
42
|
+
decimal?: boolean;
|
|
43
|
+
/** The value to return when formatting fails */
|
|
44
|
+
invalidValue?: string;
|
|
45
|
+
/** Whether to divide the value by 100 */
|
|
46
|
+
divide?: boolean;
|
|
47
|
+
/** Whether to use short formatting */
|
|
48
|
+
short?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Formats a number according to the specified options
|
|
52
|
+
* @param v - The value to format
|
|
53
|
+
* @param _options
|
|
54
|
+
* @returns The formatted string or the invalidValue if formatting fails
|
|
55
|
+
*/
|
|
56
|
+
const format: (v: AcceptableValue, _options?: FormatterProps) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Formats a number as currency
|
|
59
|
+
* @param v - The value to format
|
|
60
|
+
* @param options - Formatting options including locale and currency
|
|
61
|
+
* @returns The formatted currency string
|
|
62
|
+
*/
|
|
63
|
+
const formatCurrency: (v: AcceptableValue, options?: FormatterProps) => string;
|
|
64
|
+
/**
|
|
65
|
+
* Formats a number as a percentage
|
|
66
|
+
* @param v - The value to format
|
|
67
|
+
* @param options - Formatting options including locale
|
|
68
|
+
* @returns The formatted percentage string
|
|
69
|
+
*/
|
|
70
|
+
const formatPercents: (v: AcceptableValue, options?: FormatterProps) => string;
|
|
71
|
+
const dynamicTypesList: readonly ["positive", "negative", "neutral"];
|
|
72
|
+
type DynamicType = (typeof dynamicTypesList)[number];
|
|
73
|
+
const round: (value: string | number, exp?: number, type?: "round" | "floor" | "ceil") => number;
|
|
74
|
+
const formatByType: (type: NumberType, v: AcceptableValue, options?: FormatterProps) => string;
|
|
75
|
+
const getCurrencySymbol: (currency: Intl.NumberFormatOptions["currency"], locale?: Intl.LocalesArgument) => string;
|
|
76
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { CreateTableReturn } from '../store';
|
|
3
|
+
import { TableProps, TableRowModel } from '../types';
|
|
4
|
+
export declare const TableContext: import('react').Context<{
|
|
5
|
+
useStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<import('../store').Store>, "persist"> & {
|
|
6
|
+
persist: {
|
|
7
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<import('../store').Store, {
|
|
8
|
+
sort: import('../types').TableSortModel | null;
|
|
9
|
+
search: string;
|
|
10
|
+
pageSize: number;
|
|
11
|
+
columnsOrder: string[];
|
|
12
|
+
}>>) => void;
|
|
13
|
+
clearStorage: () => void;
|
|
14
|
+
rehydrate: () => Promise<void> | void;
|
|
15
|
+
hasHydrated: () => boolean;
|
|
16
|
+
onHydrate: (fn: (state: import('../store').Store) => void) => () => void;
|
|
17
|
+
onFinishHydration: (fn: (state: import('../store').Store) => void) => () => void;
|
|
18
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<import('../store').Store, {
|
|
19
|
+
sort: import('../types').TableSortModel | null;
|
|
20
|
+
search: string;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
columnsOrder: string[];
|
|
23
|
+
}>>;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
api: {
|
|
27
|
+
setPageSize: (v: number) => void;
|
|
28
|
+
setPage: (v: number) => void;
|
|
29
|
+
setSort: (v: import('../types').TableSortModel | null) => void;
|
|
30
|
+
downloadCSV: () => void;
|
|
31
|
+
downloadExcel: () => void;
|
|
32
|
+
setSelected: (selected: string[]) => void;
|
|
33
|
+
toggleColumn: (v: string) => void;
|
|
34
|
+
setVisibleColumns: (v: string[]) => void;
|
|
35
|
+
setSearch: (v: string) => void;
|
|
36
|
+
setPrevPage: () => void;
|
|
37
|
+
setNextPage: () => void;
|
|
38
|
+
setColumnWidth: (field: string, setWidth: number) => void;
|
|
39
|
+
toggleRowExpand: (id: string) => void;
|
|
40
|
+
setRootRef: (rootRef: HTMLDivElement) => void;
|
|
41
|
+
setScrollRef: (scrollRef: HTMLDivElement) => void;
|
|
42
|
+
calculateColumnWidths: (clear?: boolean) => void;
|
|
43
|
+
selectVisibleRows: () => void;
|
|
44
|
+
unselectVisibleRows: () => void;
|
|
45
|
+
unselectRow: (id: string) => void;
|
|
46
|
+
selectRow: (id: string) => void;
|
|
47
|
+
setAutosize: () => void;
|
|
48
|
+
removeAutosize: () => void;
|
|
49
|
+
setColumnsOrder: (columnsOrder: string[]) => void;
|
|
50
|
+
setColumnOrder: (columnId: string, index: number) => void;
|
|
51
|
+
moveColumnLeft: (columnId: string) => void;
|
|
52
|
+
moveColumnRight: (columnId: string) => void;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
export declare const TableProvider: <ITEM extends TableRowModel>({ children, store, rows, columns, loading, pageSizeOptions, rowHeight, headerHeight, rowCount, exportFileName, pagination, virtualization, searching, selection, sorting, expanding, }: PropsWithChildren<{
|
|
56
|
+
store: CreateTableReturn;
|
|
57
|
+
} & TableProps<ITEM>>) => import("react/jsx-runtime").JSX.Element;
|