@sellgar/kit 0.0.176 → 0.0.178
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 +5018 -4566
- package/package.json +3 -2
- package/types/components/table/components/tbody/cell/cell.d.ts +4 -0
- package/types/components/table/configuration/cell/cell.d.ts +5 -2
- package/types/components/table/configuration/column/column.d.ts +1 -1
- package/types/components/table/configuration/create-columns-config.d.ts +3 -2
- package/types/components/table/configuration/create-empty-config.d.ts +5 -0
- package/types/components/table/configuration/empty/empty.d.ts +8 -0
- package/types/components/table/feature/row-events/index.d.ts +3 -0
- package/types/components/table/feature/row-events/row-events.context.d.ts +10 -0
- package/types/components/table/feature/row-events/row-events.provider.d.ts +7 -0
- package/types/components/table/feature/row-events/row-events.types.d.ts +25 -0
- package/types/components/table/table.context.d.ts +5 -0
- package/types/components/table/table.d.ts +6 -3
- package/types/components/wrappers/index.d.ts +1 -0
- package/types/components/wrappers/sticky-layout/index.d.ts +1 -0
- package/types/components/wrappers/sticky-layout/sticky-layout.wrapper.d.ts +39 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellgar/kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.178",
|
|
5
5
|
"description": "Sellgar kit",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"overlayscrollbars": "2.14.0",
|
|
45
45
|
"overlayscrollbars-react": "0.5.6",
|
|
46
46
|
"react-baron": "3.0.0",
|
|
47
|
-
"react-slider": "2.0.6"
|
|
47
|
+
"react-slider": "2.0.6",
|
|
48
|
+
"stickybits": "3.7.11"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"react": "^19",
|
|
@@ -6,6 +6,10 @@ interface IProps<T> {
|
|
|
6
6
|
collapse?: boolean;
|
|
7
7
|
data: ITableNode<T>;
|
|
8
8
|
className?: string;
|
|
9
|
+
cellRef?: React.Ref<HTMLTableCellElement>;
|
|
10
|
+
onClick?: React.MouseEventHandler<HTMLTableCellElement>;
|
|
11
|
+
onDoubleClick?: React.MouseEventHandler<HTMLTableCellElement>;
|
|
12
|
+
onContextMenu?: React.MouseEventHandler<HTMLTableCellElement>;
|
|
9
13
|
}
|
|
10
14
|
export declare const Cell: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
|
|
11
15
|
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
import { ITableNode } from '../../table.types.ts';
|
|
3
|
+
export interface IProps<T = any> {
|
|
3
4
|
className?: string;
|
|
5
|
+
render?(node: ITableNode<T>): React.ReactNode;
|
|
4
6
|
}
|
|
5
|
-
interface ITableCellPropsWithDisplayName
|
|
7
|
+
interface ITableCellPropsWithDisplayName {
|
|
8
|
+
<T = any>(props: React.PropsWithChildren<IProps<T>>): React.ReactNode;
|
|
6
9
|
displayName: string;
|
|
7
10
|
}
|
|
8
11
|
export declare const Cell: ITableCellPropsWithDisplayName;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ISort } from './column';
|
|
3
|
+
import { ITableNode } from '../table.types.ts';
|
|
3
4
|
export interface IConfigColumn<T> {
|
|
4
5
|
label: React.ReactNode;
|
|
5
6
|
align?: 'left' | 'center' | 'right';
|
|
6
7
|
sort?: ISort;
|
|
7
|
-
width?: number;
|
|
8
|
+
width?: number | string;
|
|
8
9
|
collapse?: boolean;
|
|
9
10
|
pinLeft?: boolean;
|
|
10
11
|
pinRight?: boolean;
|
|
11
12
|
pinSource?: 'user' | 'system';
|
|
12
13
|
cellClassName?: string;
|
|
13
|
-
renderCell: (
|
|
14
|
+
renderCell: (node: ITableNode<T>) => React.ReactNode;
|
|
14
15
|
}
|
|
15
16
|
export declare const createColumnConfig: <T>(children: React.ReactNode) => IConfigColumn<T>[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IEmptyProps {
|
|
3
|
+
}
|
|
4
|
+
interface IEmptyPropsWithDisplayName extends React.FC<React.PropsWithChildren<IEmptyProps>> {
|
|
5
|
+
displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Empty: IEmptyPropsWithDisplayName;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TNodeId } from '../../table.types.ts';
|
|
3
|
+
interface IRowEventsContext<T> {
|
|
4
|
+
onRowClick(event: React.MouseEvent<HTMLTableCellElement>, node: T, id: TNodeId, index: number): void;
|
|
5
|
+
onRowDoubleClick(event: React.MouseEvent<HTMLTableCellElement>, node: T, id: TNodeId, index: number): void;
|
|
6
|
+
onRowContextMenu(event: React.MouseEvent<HTMLTableCellElement>, node: T, id: TNodeId, index: number): void;
|
|
7
|
+
}
|
|
8
|
+
export declare const RowEventsContext: React.Context<IRowEventsContext<any> | null>;
|
|
9
|
+
export declare const useRowEventsContext: <T>(source?: string) => IRowEventsContext<T>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IRowConfig } from './row-events.types.ts';
|
|
3
|
+
interface IProps<T> {
|
|
4
|
+
config?: IRowConfig<T>;
|
|
5
|
+
}
|
|
6
|
+
export declare const RowEventsProvider: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TNodeId } from '../../table.types.ts';
|
|
3
|
+
export type TRowTrigger = 'click' | 'doubleClick' | 'contextMenu';
|
|
4
|
+
export interface IRowEventPayload<T> {
|
|
5
|
+
node: T;
|
|
6
|
+
id: TNodeId;
|
|
7
|
+
index: number;
|
|
8
|
+
trigger: TRowTrigger;
|
|
9
|
+
nativeEvent: React.MouseEvent<HTMLTableCellElement>;
|
|
10
|
+
}
|
|
11
|
+
export interface IRowHandlers<T> {
|
|
12
|
+
click?(payload: IRowEventPayload<T>): void;
|
|
13
|
+
doubleClick?(payload: IRowEventPayload<T>): void;
|
|
14
|
+
contextMenu?(payload: IRowEventPayload<T>): void;
|
|
15
|
+
}
|
|
16
|
+
export interface IRowConfig<T> {
|
|
17
|
+
handlers?: IRowHandlers<T>;
|
|
18
|
+
isInteractiveTarget?(target: EventTarget | null): boolean;
|
|
19
|
+
disableDefaultInteractiveGuard?: boolean;
|
|
20
|
+
getRowId?(node: T): TNodeId;
|
|
21
|
+
lastRowTrigger?: {
|
|
22
|
+
onLastRowVisible(node: T): void;
|
|
23
|
+
rootMargin?: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -2,16 +2,21 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IData } from './table.tsx';
|
|
3
3
|
import { ITableNode, TNodeId } from './table.types.ts';
|
|
4
4
|
import { IConfigColumn } from './configuration/create-columns-config.ts';
|
|
5
|
+
import { IRowConfig } from './feature/row-events';
|
|
5
6
|
interface IContext<T> {
|
|
6
7
|
data: IData<ITableNode<T>>;
|
|
7
8
|
columns: IConfigColumn<T>[];
|
|
8
9
|
columnsWidth: number[];
|
|
9
10
|
resolveNodeId(node: T): TNodeId | undefined;
|
|
11
|
+
row?: IRowConfig<T>;
|
|
10
12
|
expand?: {
|
|
11
13
|
isExpanded(id: TNodeId): boolean;
|
|
12
14
|
toggleById(id: TNodeId): void;
|
|
13
15
|
renderExpanded(node: T): React.ReactNode;
|
|
14
16
|
};
|
|
17
|
+
empty?: {
|
|
18
|
+
renderEmpty(): React.ReactNode;
|
|
19
|
+
};
|
|
15
20
|
}
|
|
16
21
|
export declare const TableContext: React.Context<IContext<any> | null>;
|
|
17
22
|
export declare const useTableContext: <T>(source?: string) => IContext<T>;
|
|
@@ -3,8 +3,9 @@ import { Cell } from './configuration/cell';
|
|
|
3
3
|
import { Head } from './configuration/head';
|
|
4
4
|
import { Column } from './configuration/column';
|
|
5
5
|
import { Expand } from './configuration/expand/expand';
|
|
6
|
+
import { Empty } from './configuration/empty/empty';
|
|
6
7
|
import { ExpandTrigger } from './feature/expand';
|
|
7
|
-
import {
|
|
8
|
+
import { IRowConfig, IRowEventPayload, IRowHandlers, TRowTrigger } from './feature/row-events';
|
|
8
9
|
export interface IData<T> {
|
|
9
10
|
nodes: T[];
|
|
10
11
|
}
|
|
@@ -21,16 +22,18 @@ interface IProps<T> {
|
|
|
21
22
|
data: IData<T>;
|
|
22
23
|
tree?: ITreeProps<T>;
|
|
23
24
|
select?: ISelectProps<T>;
|
|
25
|
+
row?: IRowConfig<T>;
|
|
24
26
|
isBordered?: boolean;
|
|
25
|
-
|
|
27
|
+
useInternalScroll?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export declare const TableComponent: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
|
|
30
|
+
export type { IRowConfig, IRowEventPayload, IRowHandlers, TRowTrigger };
|
|
28
31
|
type TTable = typeof TableComponent & {
|
|
29
32
|
Column: typeof Column;
|
|
30
33
|
Head: typeof Head;
|
|
31
34
|
Cell: typeof Cell;
|
|
32
35
|
Expand: typeof Expand;
|
|
36
|
+
Empty: typeof Empty;
|
|
33
37
|
ExpandTrigger: typeof ExpandTrigger;
|
|
34
38
|
};
|
|
35
39
|
export declare const Table: TTable;
|
|
36
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StickyLayout } from './sticky-layout.wrapper.tsx';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type TStickybitsVerticalPosition = 'top' | 'bottom';
|
|
3
|
+
type TStickyDirection = 'top' | 'bottom' | 'left' | 'right';
|
|
4
|
+
interface IStickyLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
gap?: number | string;
|
|
6
|
+
scrollbarClassName?: string;
|
|
7
|
+
scrollbarStyle?: React.CSSProperties;
|
|
8
|
+
stickyAutoOffsetPadding?: number;
|
|
9
|
+
stickyAutoOffsetGap?: number;
|
|
10
|
+
}
|
|
11
|
+
interface IStickyLayoutStaticProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
}
|
|
14
|
+
interface IStickyLayoutStickyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
offset?: number;
|
|
16
|
+
autoOffset?: boolean;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
direction?: TStickyDirection[];
|
|
19
|
+
useStickyClasses?: boolean;
|
|
20
|
+
noStyles?: boolean;
|
|
21
|
+
useFixed?: boolean;
|
|
22
|
+
useGetBoundingClientRect?: boolean;
|
|
23
|
+
verticalPosition?: TStickybitsVerticalPosition;
|
|
24
|
+
parentClass?: string;
|
|
25
|
+
stickyClass?: string;
|
|
26
|
+
stuckClass?: string;
|
|
27
|
+
stickyChangeClass?: string;
|
|
28
|
+
customStickyChangeNumber?: number;
|
|
29
|
+
scrollEl?: Window | HTMLElement | string;
|
|
30
|
+
}
|
|
31
|
+
declare const StickyLayoutComponent: React.FC<React.PropsWithChildren<IStickyLayoutProps>>;
|
|
32
|
+
declare const StickyLayoutStatic: React.FC<React.PropsWithChildren<IStickyLayoutStaticProps>>;
|
|
33
|
+
declare const StickyLayoutSticky: React.FC<React.PropsWithChildren<IStickyLayoutStickyProps>>;
|
|
34
|
+
type TStickyLayout = typeof StickyLayoutComponent & {
|
|
35
|
+
Static: typeof StickyLayoutStatic;
|
|
36
|
+
Sticky: typeof StickyLayoutSticky;
|
|
37
|
+
};
|
|
38
|
+
export declare const StickyLayout: TStickyLayout;
|
|
39
|
+
export {};
|