@sellgar/kit 0.0.173 → 0.0.175
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.css +1 -1
- package/dist/index.js +3668 -3501
- package/package.json +1 -1
- package/types/components/drawer/close/close.d.ts +2 -0
- package/types/components/drawer/close/index.d.ts +1 -0
- package/types/components/drawer/drawer.d.ts +12 -7
- package/types/components/table/components/tbody/cell/cell.context.d.ts +3 -8
- package/types/components/table/components/tbody/cell/cell.d.ts +2 -1
- package/types/components/table/components/tbody/tbody.d.ts +1 -3
- package/types/components/table/configuration/create-columns-config.d.ts +1 -2
- package/types/components/table/configuration/create-data-nodes.d.ts +19 -2
- package/types/components/table/configuration/create-expand-config.d.ts +1 -2
- package/types/components/table/feature/expand/hooks/expanded.hook.d.ts +1 -2
- package/types/components/table/feature/select/cell/cell.d.ts +3 -3
- package/types/components/table/feature/select/index.d.ts +1 -1
- package/types/components/table/feature/select/select.context.d.ts +2 -2
- package/types/components/table/feature/sort/index.d.ts +1 -1
- package/types/components/table/feature/sort/sort.context.d.ts +2 -2
- package/types/components/table/feature/tree/cell/cell.d.ts +1 -4
- package/types/components/table/feature/tree/index.d.ts +1 -1
- package/types/components/table/feature/tree/tree.context.d.ts +7 -4
- package/types/components/table/feature/tree/tree.provider.d.ts +4 -2
- package/types/components/table/table.context.d.ts +7 -5
- package/types/components/table/table.d.ts +5 -7
- package/types/components/table/table.types.d.ts +8 -0
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Close } from './close.tsx';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { Close } from './close';
|
|
2
3
|
interface IProps {
|
|
3
4
|
isClosable?: boolean;
|
|
5
|
+
isEscapeClosable?: boolean;
|
|
4
6
|
isOverlayClosable?: boolean;
|
|
5
7
|
open?: boolean;
|
|
6
8
|
initialOpen?: boolean;
|
|
7
9
|
onOpen?(): void;
|
|
8
10
|
onClose?(): void;
|
|
9
11
|
}
|
|
10
|
-
export declare function useDrawer({ initialOpen, isClosable, isOverlayClosable, open: controlledOpen, onOpen, onClose }?: IProps): {
|
|
12
|
+
export declare function useDrawer({ initialOpen, isClosable, isEscapeClosable, isOverlayClosable, open: controlledOpen, onOpen, onClose, }?: IProps): {
|
|
11
13
|
placement: import('@floating-ui/utils').Placement;
|
|
12
14
|
strategy: import('@floating-ui/utils').Strategy;
|
|
13
15
|
middlewareData: import('@floating-ui/core').MiddlewareData;
|
|
@@ -50,10 +52,10 @@ export declare function useDrawer({ initialOpen, isClosable, isOverlayClosable,
|
|
|
50
52
|
active?: boolean;
|
|
51
53
|
selected?: boolean;
|
|
52
54
|
}) => Record<string, unknown>;
|
|
53
|
-
open: boolean;
|
|
55
|
+
open: boolean | undefined;
|
|
54
56
|
onOpen: (() => void) | undefined;
|
|
55
57
|
onClose: (() => void) | undefined;
|
|
56
|
-
isClosable: boolean;
|
|
58
|
+
isClosable: boolean | undefined;
|
|
57
59
|
};
|
|
58
60
|
export declare const useDrawerContext: () => {
|
|
59
61
|
placement: import('@floating-ui/utils').Placement;
|
|
@@ -98,13 +100,16 @@ export declare const useDrawerContext: () => {
|
|
|
98
100
|
active?: boolean;
|
|
99
101
|
selected?: boolean;
|
|
100
102
|
}) => Record<string, unknown>;
|
|
101
|
-
open: boolean;
|
|
103
|
+
open: boolean | undefined;
|
|
102
104
|
onOpen: (() => void) | undefined;
|
|
103
105
|
onClose: (() => void) | undefined;
|
|
104
|
-
isClosable: boolean;
|
|
106
|
+
isClosable: boolean | undefined;
|
|
105
107
|
};
|
|
106
108
|
export declare const Dialog: React.FC<React.PropsWithChildren<IProps>>;
|
|
107
109
|
export declare const DialogContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
108
|
-
export declare const
|
|
109
|
-
|
|
110
|
+
export declare const DrawerComponent: React.FC<React.PropsWithChildren<IProps>>;
|
|
111
|
+
type TDrawer = typeof DrawerComponent & {
|
|
112
|
+
Close: typeof Close;
|
|
113
|
+
};
|
|
114
|
+
export declare const Drawer: TDrawer;
|
|
110
115
|
export {};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
deps: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const createContext: <T>() => React.Context<IContext<T>>;
|
|
8
|
-
export declare const useCellData: <T extends INode>() => IContext<T>;
|
|
9
|
-
export {};
|
|
2
|
+
import { ITableNode } from '../../../table.types.ts';
|
|
3
|
+
export declare const CellContext: React.Context<ITableNode<unknown> | null>;
|
|
4
|
+
export declare const useCellData: <T>(source?: string) => ITableNode<T>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ITableNode } from '../../../table.types.ts';
|
|
2
3
|
interface IProps<T> {
|
|
3
4
|
originIndex: number;
|
|
4
5
|
align?: 'left' | 'center' | 'right';
|
|
5
6
|
collapse?: boolean;
|
|
6
|
-
data: T
|
|
7
|
+
data: ITableNode<T>;
|
|
7
8
|
className?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const Cell: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ISort } from './column';
|
|
3
|
-
import { INode } from '../table.tsx';
|
|
4
3
|
export interface IConfigColumn<T> {
|
|
5
4
|
label: React.ReactNode;
|
|
6
5
|
align?: 'left' | 'center' | 'right';
|
|
@@ -13,4 +12,4 @@ export interface IConfigColumn<T> {
|
|
|
13
12
|
cellClassName?: string;
|
|
14
13
|
renderCell: (nodes: T) => React.ReactNode;
|
|
15
14
|
}
|
|
16
|
-
export declare const createColumnConfig: <T
|
|
15
|
+
export declare const createColumnConfig: <T>(children: React.ReactNode) => IConfigColumn<T>[];
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import { IData
|
|
2
|
-
|
|
1
|
+
import { IData } from '../table.tsx';
|
|
2
|
+
import { ITableNode, TNodeId } from '../table.types.ts';
|
|
3
|
+
interface ITreeConfig<T> {
|
|
4
|
+
isUse: boolean;
|
|
5
|
+
accessor: keyof T;
|
|
6
|
+
}
|
|
7
|
+
interface ICreateNodesOptions<T> {
|
|
8
|
+
tree?: ITreeConfig<T>;
|
|
9
|
+
getRowId?(node: T): TNodeId;
|
|
10
|
+
}
|
|
11
|
+
export declare const createDataNodes: <T>(data: IData<T>, options: ICreateNodesOptions<T>) => {
|
|
12
|
+
data: IData<ITableNode<T>>;
|
|
13
|
+
nodeIdByData: Map<T, TNodeId>;
|
|
14
|
+
tree?: {
|
|
15
|
+
childrenById: Map<TNodeId, TNodeId[]>;
|
|
16
|
+
parentById: Map<TNodeId, TNodeId | null>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { INode } from '../table.tsx';
|
|
3
2
|
export interface IConfigExpand<T> {
|
|
4
3
|
renderExpanded: (node: T) => React.ReactNode;
|
|
5
4
|
}
|
|
6
|
-
export declare const createExpandConfig: <T
|
|
5
|
+
export declare const createExpandConfig: <T>(children: React.ReactNode) => IConfigExpand<T> | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
interface IRowCheckboxProps {
|
|
3
|
-
item:
|
|
2
|
+
interface IRowCheckboxProps<T> {
|
|
3
|
+
item: T;
|
|
4
4
|
}
|
|
5
|
-
export declare const Cell: <T>(props: IRowCheckboxProps) => React.JSX.Element;
|
|
5
|
+
export declare const Cell: <T>(props: IRowCheckboxProps<T>) => React.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Head } from './head';
|
|
2
2
|
export { Cell } from './cell';
|
|
3
|
-
export {
|
|
3
|
+
export { useSelectContext } from './select.context.ts';
|
|
4
4
|
export { SelectProvider } from './select.provider.tsx';
|
|
5
5
|
export { compareColumnsConfig } from './compare-columns-config.tsx';
|
|
@@ -9,6 +9,6 @@ interface IContext<T> {
|
|
|
9
9
|
selectAll: () => void;
|
|
10
10
|
deleteAll: () => void;
|
|
11
11
|
}
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
12
|
+
export declare const SelectContext: React.Context<IContext<any> | null>;
|
|
13
|
+
export declare const useSelectContext: <T>(source?: string) => IContext<T>;
|
|
14
14
|
export {};
|
|
@@ -3,6 +3,6 @@ interface IContext {
|
|
|
3
3
|
direction?: 'asc' | 'desc';
|
|
4
4
|
onToggle(): void;
|
|
5
5
|
}
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
6
|
+
export declare const SortContext: React.Context<IContext | null>;
|
|
7
|
+
export declare const useSortContext: (source?: string) => IContext;
|
|
8
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Head } from './head';
|
|
2
2
|
export { Cell } from './cell';
|
|
3
|
-
export {
|
|
3
|
+
export { useTreeContext } from './tree.context.ts';
|
|
4
4
|
export { TreeProvider } from './tree.provider.tsx';
|
|
5
5
|
export { compareColumnsConfig } from './compare-columns-config.tsx';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
import { TNodeId } from '../../table.types.ts';
|
|
3
|
+
export interface ITreeContext {
|
|
4
|
+
isExpanded(id: TNodeId): boolean;
|
|
5
|
+
toggle(id: TNodeId): void;
|
|
6
|
+
hasChildren(id: TNodeId): boolean;
|
|
3
7
|
}
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export {};
|
|
8
|
+
export declare const TreeContext: React.Context<ITreeContext | null>;
|
|
9
|
+
export declare const useTreeContext: (source?: string) => ITreeContext;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
import { ITreeContext } from './tree.context.ts';
|
|
3
|
+
interface IProps {
|
|
4
|
+
value: ITreeContext;
|
|
3
5
|
}
|
|
4
|
-
export declare const TreeProvider:
|
|
6
|
+
export declare const TreeProvider: (props: React.PropsWithChildren<IProps>) => React.JSX.Element;
|
|
5
7
|
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IData } from './table.tsx';
|
|
3
|
+
import { ITableNode, TNodeId } from './table.types.ts';
|
|
3
4
|
import { IConfigColumn } from './configuration/create-columns-config.ts';
|
|
4
5
|
interface IContext<T> {
|
|
5
|
-
data: IData<T
|
|
6
|
+
data: IData<ITableNode<T>>;
|
|
6
7
|
columns: IConfigColumn<T>[];
|
|
7
8
|
columnsWidth: number[];
|
|
9
|
+
resolveNodeId(node: T): TNodeId | undefined;
|
|
8
10
|
expand?: {
|
|
9
|
-
isExpanded(id:
|
|
10
|
-
|
|
11
|
+
isExpanded(id: TNodeId): boolean;
|
|
12
|
+
toggleById(id: TNodeId): void;
|
|
11
13
|
renderExpanded(node: T): React.ReactNode;
|
|
12
14
|
};
|
|
13
15
|
}
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
+
export declare const TableContext: React.Context<IContext<any> | null>;
|
|
17
|
+
export declare const useTableContext: <T>(source?: string) => IContext<T>;
|
|
16
18
|
export {};
|
|
@@ -4,29 +4,27 @@ import { Head } from './configuration/head';
|
|
|
4
4
|
import { Column } from './configuration/column';
|
|
5
5
|
import { Expand } from './configuration/expand/expand';
|
|
6
6
|
import { ExpandTrigger } from './feature/expand';
|
|
7
|
-
|
|
8
|
-
id: string | number;
|
|
9
|
-
nodes?: INode[];
|
|
10
|
-
[prop: string]: any;
|
|
11
|
-
}
|
|
7
|
+
import { TNodeId } from './table.types.ts';
|
|
12
8
|
export interface IData<T> {
|
|
13
9
|
nodes: T[];
|
|
14
10
|
}
|
|
15
11
|
interface ITreeProps<T> {
|
|
16
12
|
isUse: boolean;
|
|
17
13
|
accessor: keyof T;
|
|
14
|
+
defaultExpanded?: boolean;
|
|
18
15
|
}
|
|
19
16
|
interface ISelectProps<T> {
|
|
20
17
|
isUse: boolean;
|
|
21
18
|
onSelect(nodes: T[]): void;
|
|
22
19
|
}
|
|
23
|
-
interface IProps<T
|
|
20
|
+
interface IProps<T> {
|
|
24
21
|
data: IData<T>;
|
|
25
22
|
tree?: ITreeProps<T>;
|
|
26
23
|
select?: ISelectProps<T>;
|
|
27
24
|
isBordered?: boolean;
|
|
25
|
+
getRowId?(node: T): TNodeId;
|
|
28
26
|
}
|
|
29
|
-
export declare const TableComponent: <T
|
|
27
|
+
export declare const TableComponent: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
|
|
30
28
|
type TTable = typeof TableComponent & {
|
|
31
29
|
Column: typeof Column;
|
|
32
30
|
Head: typeof Head;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type TNodeId = string | number;
|
|
2
|
+
export interface ITableNode<T> {
|
|
3
|
+
id: TNodeId;
|
|
4
|
+
data: T;
|
|
5
|
+
deps: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const toNodeId: (value: unknown) => TNodeId | undefined;
|
|
8
|
+
export declare const getFallbackRowId: (node: unknown) => TNodeId | undefined;
|