@sellgar/kit 0.0.169 → 0.0.170
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 +3288 -3208
- package/package.json +1 -1
- package/types/components/table3/cell/cell.context.d.ts +4 -5
- package/types/components/table3/cell/cell.d.ts +3 -3
- package/types/components/table3/cell/cell.provider.d.ts +3 -3
- package/types/components/table3/cell/hook/cell-data.hook.d.ts +3 -1
- package/types/components/table3/get-columns-width.hook.d.ts +3 -0
- package/types/components/table3/index.d.ts +1 -1
- package/types/components/table3/select/index.d.ts +3 -0
- package/types/components/table3/select/row-checkbox/index.d.ts +1 -0
- package/types/components/table3/select/row-checkbox/row-checkbox.d.ts +6 -0
- package/types/components/table3/select/select.context.d.ts +14 -0
- package/types/components/table3/select/select.provider.d.ts +6 -0
- package/types/components/table3/select/title-checkbox/index.d.ts +1 -0
- package/types/components/table3/select/title-checkbox/title-checkbox.d.ts +2 -0
- package/types/components/table3/table-cell/cell/cell.context.d.ts +6 -0
- package/types/components/table3/table-cell/cell/cell.d.ts +8 -0
- package/types/components/table3/table-cell/cell/cell.provider.d.ts +6 -0
- package/types/components/table3/table-cell/cell/hook/cell-data.hook.d.ts +3 -0
- package/types/components/table3/table-cell/cell/index.d.ts +3 -0
- package/types/components/table3/table-cell/index.d.ts +2 -0
- package/types/components/table3/table-cell/table-cell.d.ts +10 -0
- package/types/components/table3/table-rows/cell/cell.context.d.ts +7 -0
- package/types/components/table3/table-rows/cell/cell.d.ts +8 -0
- package/types/components/table3/table-rows/cell/cell.provider.d.ts +7 -0
- package/types/components/table3/table-rows/cell/hook/cell-data.hook.d.ts +3 -0
- package/types/components/table3/table-rows/cell/index.d.ts +3 -0
- package/types/components/table3/table-rows/index.d.ts +1 -0
- package/types/components/table3/table-rows/row/index.d.ts +1 -0
- package/types/components/table3/table-rows/row/row.context.d.ts +8 -0
- package/types/components/table3/table-rows/row/row.d.ts +7 -0
- package/types/components/table3/table-rows/row/row.provider.d.ts +6 -0
- package/types/components/table3/table-rows/table-row.context.d.ts +9 -0
- package/types/components/table3/table-rows/table-row.provider.d.ts +8 -0
- package/types/components/table3/table-rows/table-rows.d.ts +10 -0
- package/types/components/table3/table.context.d.ts +4 -8
- package/types/components/table3/table.d.ts +37 -13
- package/types/components/table3/table.provider.d.ts +6 -4
- package/types/components/table3/tree/index.d.ts +3 -0
- package/types/components/table3/tree/row-arrow/index.d.ts +1 -0
- package/types/components/table3/tree/row-arrow/row-arrow.d.ts +5 -0
- package/types/components/table3/tree/title-arrow/index.d.ts +1 -0
- package/types/components/table3/tree/title-arrow/title-arrow.d.ts +2 -0
- package/types/components/table3/tree/tree.context.d.ts +6 -0
- package/types/components/table3/tree/tree.provider.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
interface IContext {
|
|
3
|
-
data:
|
|
2
|
+
export interface IContext<T> {
|
|
3
|
+
data: T;
|
|
4
4
|
}
|
|
5
|
-
export declare const context: React.Context<IContext
|
|
6
|
-
export declare const Provider: React.Provider<IContext
|
|
7
|
-
export {};
|
|
5
|
+
export declare const context: React.Context<IContext<any>>;
|
|
6
|
+
export declare const Provider: React.Provider<IContext<any>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
interface IProps {
|
|
3
|
-
data:
|
|
2
|
+
interface IProps<T> {
|
|
3
|
+
data: T;
|
|
4
4
|
}
|
|
5
|
-
export declare const Cell:
|
|
5
|
+
export declare const Cell: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
interface IProps {
|
|
3
|
-
data:
|
|
2
|
+
interface IProps<T> {
|
|
3
|
+
data: T;
|
|
4
4
|
}
|
|
5
|
-
export declare const CellProvider:
|
|
5
|
+
export declare const CellProvider: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Table } from './table.tsx';
|
|
2
|
-
export { useCellData } from './cell';
|
|
2
|
+
export { useCellData } from './table-rows/cell';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RowCheckbox } from './row-checkbox.tsx';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface IContext {
|
|
3
|
+
isSelectedAll: boolean;
|
|
4
|
+
isIndeterminate: boolean;
|
|
5
|
+
selectedItems: any[];
|
|
6
|
+
hasSelected: (item: any) => boolean;
|
|
7
|
+
addItem: (item: any) => void;
|
|
8
|
+
deleteItem: (item: any) => void;
|
|
9
|
+
selectAll: () => void;
|
|
10
|
+
deleteAll: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const context: React.Context<IContext>;
|
|
13
|
+
export declare const Provider: React.Provider<IContext>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TitleCheckbox } from './title-checkbox.tsx';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TTableDataItem } from '../table.tsx';
|
|
3
|
+
export interface ITableCellProps<T> {
|
|
4
|
+
render?: (item: T) => React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
interface ITableCellPropsWithDisplayName extends React.FC<React.PropsWithChildren<ITableCellProps<TTableDataItem>>> {
|
|
7
|
+
displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TableCell: ITableCellPropsWithDisplayName;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableRows } from './table-rows.tsx';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Row } from './row.tsx';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IContext<T> {
|
|
3
|
+
data: T;
|
|
4
|
+
expanded: boolean;
|
|
5
|
+
setExpanded: (expanded: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const context: React.Context<IContext<any>>;
|
|
8
|
+
export declare const Provider: React.Provider<IContext<any>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IContext<T> {
|
|
3
|
+
data: T;
|
|
4
|
+
deps: number;
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
setExpanded: (expanded: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const context: React.Context<IContext<any>>;
|
|
9
|
+
export declare const Provider: React.Provider<IContext<any>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ITree } from '../table.tsx';
|
|
3
|
+
interface ITableRowsProps<T> {
|
|
4
|
+
data: T;
|
|
5
|
+
tree?: ITree<T>;
|
|
6
|
+
deps: number;
|
|
7
|
+
index: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const TableRows: <T>(props: React.PropsWithChildren<ITableRowsProps<T>>) => React.ReactNode[];
|
|
10
|
+
export {};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { IConfigColumn } from './table.tsx';
|
|
2
3
|
interface IContext {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
hasSelected: (item: any) => boolean;
|
|
7
|
-
addItem: (item: any) => void;
|
|
8
|
-
deleteItem: (item: any) => void;
|
|
9
|
-
selectAll: () => void;
|
|
10
|
-
deleteAll: () => void;
|
|
4
|
+
data: any[];
|
|
5
|
+
config: IConfigColumn<any>[];
|
|
6
|
+
columnsWidth: number[];
|
|
11
7
|
}
|
|
12
8
|
export declare const context: React.Context<IContext>;
|
|
13
9
|
export declare const Provider: React.Provider<IContext>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { TableCell } from './table-cell';
|
|
3
|
+
export type TTableDataItem = Record<string, any>;
|
|
2
4
|
interface IColumnProps {
|
|
3
5
|
width?: number;
|
|
4
6
|
align?: 'left' | 'center' | 'right';
|
|
@@ -23,26 +25,48 @@ interface ICaptionPropsWithDisplayName extends React.FC<ICaptionProps> {
|
|
|
23
25
|
displayName: string;
|
|
24
26
|
}
|
|
25
27
|
declare const Caption: ICaptionPropsWithDisplayName;
|
|
26
|
-
interface
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
interface ICellPropsWithDisplayName extends React.FC<React.PropsWithChildren<ICellProps>> {
|
|
30
|
-
displayName: string;
|
|
28
|
+
interface ITableSelectProps<T> {
|
|
29
|
+
isUse: boolean;
|
|
30
|
+
onChange: (items: T[]) => void;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
interface ITableSelectProps {
|
|
32
|
+
export interface ITree<T> {
|
|
34
33
|
isUse: boolean;
|
|
35
|
-
|
|
34
|
+
accessor: keyof T;
|
|
35
|
+
defaultExpanded?: boolean;
|
|
36
36
|
}
|
|
37
|
-
interface ITableProps {
|
|
38
|
-
data:
|
|
39
|
-
|
|
37
|
+
interface ITableProps<T> {
|
|
38
|
+
data: T[];
|
|
39
|
+
tree?: ITree<T>;
|
|
40
|
+
select?: ITableSelectProps<T>;
|
|
40
41
|
}
|
|
41
|
-
export
|
|
42
|
+
export interface IConfigColumn<T> {
|
|
43
|
+
type: 'control' | 'data';
|
|
44
|
+
label: React.ReactNode;
|
|
45
|
+
align?: 'left' | 'center' | 'right';
|
|
46
|
+
width?: number;
|
|
47
|
+
collapse?: boolean;
|
|
48
|
+
pinLeft?: boolean;
|
|
49
|
+
pinRight?: boolean;
|
|
50
|
+
renderCell: (items: T) => React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
export declare const getPinColumnStyles: <T>(columnIndex: number, config: IConfigColumn<T>[], columnWidths: number[]) => {
|
|
53
|
+
left?: undefined;
|
|
54
|
+
zIndex?: undefined;
|
|
55
|
+
right?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
left: string;
|
|
58
|
+
zIndex: number;
|
|
59
|
+
right?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
right: string;
|
|
62
|
+
zIndex: number;
|
|
63
|
+
left?: undefined;
|
|
64
|
+
};
|
|
65
|
+
export declare const TableComponent: <TDataValue extends TTableDataItem>(props: React.PropsWithChildren<ITableProps<TDataValue>>) => React.JSX.Element;
|
|
42
66
|
type TTable = typeof TableComponent & {
|
|
43
67
|
Column: typeof Column;
|
|
44
68
|
Head: typeof Head;
|
|
45
|
-
Cell: typeof
|
|
69
|
+
Cell: typeof TableCell;
|
|
46
70
|
Caption: typeof Caption;
|
|
47
71
|
};
|
|
48
72
|
export declare const Table: TTable;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { IConfigColumn } from './table.tsx';
|
|
3
|
+
interface IProviderProps<T> {
|
|
4
|
+
data: T[];
|
|
5
|
+
columnsWidth: number[];
|
|
6
|
+
config: IConfigColumn<T>[];
|
|
5
7
|
}
|
|
6
|
-
export declare const TableProvider:
|
|
8
|
+
export declare const TableProvider: <T>(props: React.PropsWithChildren<IProviderProps<T>>) => React.JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RowArrow } from './row-arrow.tsx';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TitleArrow } from './title-arrow.tsx';
|