@sellgar/kit 0.0.171 → 0.0.173

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.
Files changed (126) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +4843 -4697
  3. package/package.json +6 -6
  4. package/types/components/table/components/get-pinned-styles.hook.d.ts +19 -0
  5. package/types/components/table/components/tbody/cell/cell.context.d.ts +9 -0
  6. package/types/components/table/components/tbody/cell/cell.d.ts +10 -0
  7. package/types/components/table/components/tbody/cell/index.d.ts +2 -0
  8. package/types/components/table/components/tbody/index.d.ts +1 -0
  9. package/types/components/table/components/tbody/tbody.d.ts +4 -0
  10. package/types/components/table/components/thead/cell/cell.d.ts +10 -0
  11. package/types/components/table/components/thead/cell/index.d.ts +1 -0
  12. package/types/components/table/components/thead/index.d.ts +1 -0
  13. package/types/components/table/components/thead/thead.d.ts +2 -0
  14. package/types/components/table/configuration/cell/cell.d.ts +9 -0
  15. package/types/components/table/configuration/cell/index.d.ts +2 -0
  16. package/types/components/table/configuration/column/column.d.ts +18 -0
  17. package/types/components/table/configuration/column/index.d.ts +2 -0
  18. package/types/components/table/configuration/create-columns-config.d.ts +16 -0
  19. package/types/components/table/configuration/create-data-nodes.d.ts +2 -0
  20. package/types/components/table/configuration/create-expand-config.d.ts +6 -0
  21. package/types/components/table/configuration/create-grid-template.hook.d.ts +2 -0
  22. package/types/components/table/configuration/expand/expand.d.ts +8 -0
  23. package/types/components/table/configuration/get-columns-width.hook.d.ts +3 -0
  24. package/types/components/table/configuration/head/head.d.ts +9 -0
  25. package/types/components/table/configuration/head/index.d.ts +2 -0
  26. package/types/components/table/feature/expand/expand.trigger.d.ts +6 -0
  27. package/types/components/table/feature/expand/hooks/expanded.hook.d.ts +5 -0
  28. package/types/components/table/feature/expand/index.d.ts +2 -0
  29. package/types/components/table/feature/select/cell/cell.d.ts +6 -0
  30. package/types/components/table/feature/select/cell/index.d.ts +1 -0
  31. package/types/components/table/feature/select/compare-columns-config.d.ts +2 -0
  32. package/types/components/table/feature/select/head/head.d.ts +2 -0
  33. package/types/components/table/feature/select/head/index.d.ts +1 -0
  34. package/types/components/table/feature/select/index.d.ts +5 -0
  35. package/types/components/table/feature/select/select.context.d.ts +14 -0
  36. package/types/components/table/feature/select/select.provider.d.ts +6 -0
  37. package/types/components/table/feature/sort/arrow/arrow.d.ts +2 -0
  38. package/types/components/table/feature/sort/arrow/index.d.ts +1 -0
  39. package/types/components/table/feature/sort/index.d.ts +3 -0
  40. package/types/components/table/feature/sort/sort.context.d.ts +8 -0
  41. package/types/components/table/feature/sort/sort.provider.d.ts +10 -0
  42. package/types/components/table/feature/tree/cell/cell.d.ts +5 -0
  43. package/types/components/table/feature/tree/cell/index.d.ts +1 -0
  44. package/types/components/table/feature/tree/compare-columns-config.d.ts +2 -0
  45. package/types/components/table/feature/tree/head/head.d.ts +2 -0
  46. package/types/components/table/feature/tree/head/index.d.ts +1 -0
  47. package/types/components/table/feature/tree/index.d.ts +5 -0
  48. package/types/components/table/feature/tree/tree.context.d.ts +6 -0
  49. package/types/components/table/feature/tree/tree.provider.d.ts +5 -0
  50. package/types/components/table/index.d.ts +2 -7
  51. package/types/components/table/table.context.d.ts +14 -9
  52. package/types/components/table/table.d.ts +33 -7
  53. package/types/components/table3/table-rows/table-row.context.d.ts +2 -0
  54. package/types/components/table4/components/get-pinned-styles.d.ts +13 -0
  55. package/types/components/table4/components/get-pinned-styles.hook.d.ts +13 -0
  56. package/types/components/table4/components/tbody/cell/cell.context.d.ts +4 -0
  57. package/types/components/table4/components/tbody/cell/cell.d.ts +10 -0
  58. package/types/components/table4/components/tbody/cell/index.d.ts +2 -0
  59. package/types/components/table4/components/tbody/index.d.ts +1 -0
  60. package/types/components/table4/components/tbody/tbody.d.ts +2 -0
  61. package/types/components/table4/components/thead/cell/cell.d.ts +10 -0
  62. package/types/components/table4/components/thead/cell/index.d.ts +1 -0
  63. package/types/components/table4/components/thead/index.d.ts +1 -0
  64. package/types/components/table4/components/thead/thead.d.ts +2 -0
  65. package/types/components/table4/configuration/cell/cell.d.ts +8 -0
  66. package/types/components/table4/configuration/cell/index.d.ts +2 -0
  67. package/types/components/table4/configuration/column/column.d.ts +17 -0
  68. package/types/components/table4/configuration/column/index.d.ts +2 -0
  69. package/types/components/table4/configuration/create-columns-config.d.ts +13 -0
  70. package/types/components/table4/configuration/create-data-nodes.d.ts +4 -0
  71. package/types/components/table4/configuration/create-grid-template.hook.d.ts +2 -0
  72. package/types/components/table4/configuration/get-columns-width.hook.d.ts +3 -0
  73. package/types/components/table4/configuration/head/head.d.ts +9 -0
  74. package/types/components/table4/configuration/head/index.d.ts +2 -0
  75. package/types/components/table4/feature/select/cell/cell.d.ts +7 -0
  76. package/types/components/table4/feature/select/cell/index.d.ts +1 -0
  77. package/types/components/table4/feature/select/compare-columns-config.d.ts +2 -0
  78. package/types/components/table4/feature/select/head/head.d.ts +2 -0
  79. package/types/components/table4/feature/select/head/index.d.ts +1 -0
  80. package/types/components/table4/feature/select/index.d.ts +5 -0
  81. package/types/components/table4/feature/select/select.context.d.ts +13 -0
  82. package/types/components/table4/feature/select/select.provider.d.ts +7 -0
  83. package/types/components/table4/feature/sort/arrow/arrow.d.ts +2 -0
  84. package/types/components/table4/feature/sort/arrow/index.d.ts +1 -0
  85. package/types/components/table4/feature/sort/index.d.ts +3 -0
  86. package/types/components/table4/feature/sort/sort.context.d.ts +7 -0
  87. package/types/components/table4/feature/sort/sort.provider.d.ts +7 -0
  88. package/types/components/table4/feature/tree/cell/cell.d.ts +5 -0
  89. package/types/components/table4/feature/tree/cell/index.d.ts +1 -0
  90. package/types/components/table4/feature/tree/compare-columns-config.d.ts +2 -0
  91. package/types/components/table4/feature/tree/head/head.d.ts +2 -0
  92. package/types/components/table4/feature/tree/head/index.d.ts +1 -0
  93. package/types/components/table4/feature/tree/index.d.ts +5 -0
  94. package/types/components/table4/feature/tree/tree.context.d.ts +5 -0
  95. package/types/components/table4/feature/tree/tree.provider.d.ts +5 -0
  96. package/types/components/table4/get-columns-width.hook.d.ts +3 -0
  97. package/types/components/table4/index.d.ts +2 -0
  98. package/types/components/table4/select/index.d.ts +3 -0
  99. package/types/components/table4/select/row-checkbox/index.d.ts +1 -0
  100. package/types/components/table4/select/row-checkbox/row-checkbox.d.ts +6 -0
  101. package/types/components/table4/select/select.context.d.ts +14 -0
  102. package/types/components/table4/select/select.provider.d.ts +6 -0
  103. package/types/components/table4/select/title-checkbox/index.d.ts +1 -0
  104. package/types/components/table4/select/title-checkbox/title-checkbox.d.ts +2 -0
  105. package/types/components/table4/table-cell/index.d.ts +2 -0
  106. package/types/components/table4/table-cell/table-cell.d.ts +10 -0
  107. package/types/components/table4/table-rows/cell/cell.context.d.ts +7 -0
  108. package/types/components/table4/table-rows/cell/cell.d.ts +8 -0
  109. package/types/components/table4/table-rows/cell/cell.provider.d.ts +7 -0
  110. package/types/components/table4/table-rows/cell/hook/cell-data.hook.d.ts +3 -0
  111. package/types/components/table4/table-rows/cell/index.d.ts +3 -0
  112. package/types/components/table4/table-rows/index.d.ts +1 -0
  113. package/types/components/table4/table-rows/row/index.d.ts +1 -0
  114. package/types/components/table4/table-rows/row/row.d.ts +7 -0
  115. package/types/components/table4/table-rows/table-row.context.d.ts +11 -0
  116. package/types/components/table4/table-rows/table-row.provider.d.ts +8 -0
  117. package/types/components/table4/table-rows/table-rows.d.ts +10 -0
  118. package/types/components/table4/table.context.d.ts +10 -0
  119. package/types/components/table4/table.d.ts +39 -0
  120. package/types/components/table4/tree/index.d.ts +3 -0
  121. package/types/components/table4/tree/row-arrow/index.d.ts +1 -0
  122. package/types/components/table4/tree/row-arrow/row-arrow.d.ts +5 -0
  123. package/types/components/table4/tree/title-arrow/index.d.ts +1 -0
  124. package/types/components/table4/tree/title-arrow/title-arrow.d.ts +2 -0
  125. package/types/components/table4/tree/tree.context.d.ts +6 -0
  126. package/types/index.d.ts +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sellgar/kit",
3
3
  "type": "module",
4
- "version": "0.0.171",
4
+ "version": "0.0.173",
5
5
  "description": "Sellgar kit",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -34,14 +34,14 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@emotion/react": "11.14.0",
37
- "@floating-ui/dom": "1.7.4",
38
- "@floating-ui/react": "0.27.16",
37
+ "@floating-ui/dom": "1.7.5",
38
+ "@floating-ui/react": "0.27.17",
39
39
  "@react-input/mask": "2.0.4",
40
40
  "@react-input/number-format": "2.0.3",
41
41
  "classnames": "2.5.1",
42
42
  "date-fns": "4.1.0",
43
43
  "moment": "2.30.1",
44
- "overlayscrollbars": "2.13.0",
44
+ "overlayscrollbars": "2.14.0",
45
45
  "overlayscrollbars-react": "0.5.6",
46
46
  "react-baron": "3.0.0",
47
47
  "react-slider": "2.0.6"
@@ -59,9 +59,9 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@storybook/react-vite": "10.1.11",
62
+ "@storybook/react-vite": "10.2.7",
63
63
  "@types/react-slider": "1.3.6",
64
- "@vitejs/plugin-react": "5.1.2",
64
+ "@vitejs/plugin-react": "5.1.3",
65
65
  "typescript": "5.9.3",
66
66
  "vite": "7.3.1",
67
67
  "vite-plugin-dts": "4.5.4",
@@ -0,0 +1,19 @@
1
+ export declare const useGetPinnedStyles: <T>(columnIndex: number) => {
2
+ left?: undefined;
3
+ zIndex?: undefined;
4
+ borderRight?: undefined;
5
+ right?: undefined;
6
+ borderLeft?: undefined;
7
+ } | {
8
+ left: string;
9
+ zIndex: number;
10
+ borderRight: string | undefined;
11
+ right?: undefined;
12
+ borderLeft?: undefined;
13
+ } | {
14
+ right: string;
15
+ zIndex: number;
16
+ borderLeft: string | undefined;
17
+ left?: undefined;
18
+ borderRight?: undefined;
19
+ };
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { INode } from '../../../table.tsx';
3
+ interface IContext<T> {
4
+ data: T;
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 {};
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ interface IProps<T> {
3
+ originIndex: number;
4
+ align?: 'left' | 'center' | 'right';
5
+ collapse?: boolean;
6
+ data: T;
7
+ className?: string;
8
+ }
9
+ export declare const Cell: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Cell } from './cell.tsx';
2
+ export { useCellData } from './cell.context.ts';
@@ -0,0 +1 @@
1
+ export { TBody } from './tbody.tsx';
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ export declare const TBody: <T extends {
3
+ id: string | number;
4
+ }>() => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { ISort } from '../../../configuration/column';
3
+ interface IProps {
4
+ originIndex: number;
5
+ align?: 'left' | 'center' | 'right';
6
+ collapse?: boolean;
7
+ sort?: ISort;
8
+ }
9
+ export declare const Cell: (props: React.PropsWithChildren<IProps>) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export { Cell } from './cell.tsx';
@@ -0,0 +1 @@
1
+ export { THead } from './thead.tsx';
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const THead: <T>() => React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface IProps {
3
+ className?: string;
4
+ }
5
+ interface ITableCellPropsWithDisplayName extends React.FC<React.PropsWithChildren<IProps>> {
6
+ displayName: string;
7
+ }
8
+ export declare const Cell: ITableCellPropsWithDisplayName;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Cell } from './cell.tsx';
2
+ export type { IProps } from './cell.tsx';
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ export interface ISort {
3
+ directionDefault?: 'asc' | 'desc';
4
+ onToggle(direction?: 'asc' | 'desc'): void;
5
+ onReset?(): void;
6
+ }
7
+ export interface IProps {
8
+ width?: number;
9
+ align?: 'left' | 'center' | 'right';
10
+ pinLeft?: boolean;
11
+ pinRight?: boolean;
12
+ sort?: ISort;
13
+ }
14
+ interface IColumnPropsWithDisplayName extends React.FC<React.PropsWithChildren<IProps>> {
15
+ displayName: string;
16
+ }
17
+ export declare const Column: IColumnPropsWithDisplayName;
18
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Column } from './column.tsx';
2
+ export type { IProps, ISort } from './column.tsx';
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { ISort } from './column';
3
+ import { INode } from '../table.tsx';
4
+ export interface IConfigColumn<T> {
5
+ label: React.ReactNode;
6
+ align?: 'left' | 'center' | 'right';
7
+ sort?: ISort;
8
+ width?: number;
9
+ collapse?: boolean;
10
+ pinLeft?: boolean;
11
+ pinRight?: boolean;
12
+ pinSource?: 'user' | 'system';
13
+ cellClassName?: string;
14
+ renderCell: (nodes: T) => React.ReactNode;
15
+ }
16
+ export declare const createColumnConfig: <T extends INode>(children: React.ReactNode) => IConfigColumn<T>[];
@@ -0,0 +1,2 @@
1
+ import { IData, INode } from '../table.tsx';
2
+ export declare const createDataNodes: <T extends INode>(data: IData<T>) => IData<T>;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { INode } from '../table.tsx';
3
+ export interface IConfigExpand<T> {
4
+ renderExpanded: (node: T) => React.ReactNode;
5
+ }
6
+ export declare const createExpandConfig: <T extends INode>(children: React.ReactNode) => IConfigExpand<T> | null;
@@ -0,0 +1,2 @@
1
+ import { IConfigColumn } from './create-columns-config.ts';
2
+ export declare const useCreateTableGridTemplate: <T>(columns: IConfigColumn<T>[]) => string;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface IExpandProps {
3
+ }
4
+ interface IExpandPropsWithDisplayName extends React.FC<React.PropsWithChildren<IExpandProps>> {
5
+ displayName: string;
6
+ }
7
+ export declare const Expand: IExpandPropsWithDisplayName;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import { IConfigColumn } from './create-columns-config.ts';
3
+ export declare const useGetColumnsWidth: <T>(tableRef: React.RefObject<HTMLTableElement | null>, config: IConfigColumn<T>[]) => number[];
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface IProps {
3
+ label?: string;
4
+ }
5
+ interface IHeadPropsWithDisplayName extends React.FC<IProps> {
6
+ displayName: string;
7
+ }
8
+ export declare const Head: IHeadPropsWithDisplayName;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Head } from './head.tsx';
2
+ export type { IProps } from './head.tsx';
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface IProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare const ExpandTrigger: (props: IProps) => React.JSX.Element;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import { INode } from '../../../table.tsx';
2
+ export declare const useRowExpanded: <T extends INode>(node?: T) => {
3
+ expanded: boolean;
4
+ onToggle: (nextNode?: T) => void;
5
+ };
@@ -0,0 +1,2 @@
1
+ export { ExpandTrigger } from './expand.trigger.tsx';
2
+ export { useRowExpanded } from './hooks/expanded.hook.ts';
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface IRowCheckboxProps {
3
+ item: any;
4
+ }
5
+ export declare const Cell: <T>(props: IRowCheckboxProps) => React.JSX.Element;
6
+ export {};
@@ -0,0 +1 @@
1
+ export { Cell } from './cell.tsx';
@@ -0,0 +1,2 @@
1
+ import { IConfigColumn } from '../../configuration/create-columns-config.ts';
2
+ export declare const compareColumnsConfig: <T>(columns: IConfigColumn<T>[]) => IConfigColumn<T>[];
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const Head: <T>() => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { Head } from './head.tsx';
@@ -0,0 +1,5 @@
1
+ export { Head } from './head';
2
+ export { Cell } from './cell';
3
+ export { useContext } from './select.context.ts';
4
+ export { SelectProvider } from './select.provider.tsx';
5
+ export { compareColumnsConfig } from './compare-columns-config.tsx';
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ interface IContext<T> {
3
+ isSelectedAll: boolean;
4
+ isIndeterminate: boolean;
5
+ selectedItems: T[];
6
+ hasSelected: (item: T) => boolean;
7
+ addItem: (item: T) => void;
8
+ deleteItem: (item: T) => void;
9
+ selectAll: () => void;
10
+ deleteAll: () => void;
11
+ }
12
+ export declare const createContext: <T>() => React.Context<IContext<T>>;
13
+ export declare const useContext: <T>() => IContext<T>;
14
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface IProps<T> {
3
+ onSelect: (items: T[]) => void;
4
+ }
5
+ export declare const SelectProvider: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const Arrow: () => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { Arrow } from './arrow.tsx';
@@ -0,0 +1,3 @@
1
+ export { Arrow } from './arrow';
2
+ export { useContext } from './sort.context.ts';
3
+ export { SortProvider } from './sort.provider.tsx';
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ interface IContext {
3
+ direction?: 'asc' | 'desc';
4
+ onToggle(): void;
5
+ }
6
+ export declare const createContext: () => React.Context<IContext>;
7
+ export declare const useContext: () => IContext;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ interface IProps {
3
+ directionDefault?: 'asc' | 'desc';
4
+ onToggle?(direction?: 'asc' | 'desc'): void;
5
+ isActive?: boolean;
6
+ onActivate?(): void;
7
+ onReset?(): void;
8
+ }
9
+ export declare const SortProvider: (props: React.PropsWithChildren<IProps>) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ interface IRowCheckboxProps {
3
+ }
4
+ export declare const Cell: React.FC<IRowCheckboxProps>;
5
+ export {};
@@ -0,0 +1 @@
1
+ export { Cell } from './cell.tsx';
@@ -0,0 +1,2 @@
1
+ import { IConfigColumn } from '../../configuration/create-columns-config.ts';
2
+ export declare const compareColumnsConfig: <T>(columns: IConfigColumn<T>[]) => IConfigColumn<T>[];
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const Head: React.FC;
@@ -0,0 +1 @@
1
+ export { Head } from './head.tsx';
@@ -0,0 +1,5 @@
1
+ export { Head } from './head';
2
+ export { Cell } from './cell';
3
+ export { useContext } from './tree.context.ts';
4
+ export { TreeProvider } from './tree.provider.tsx';
5
+ export { compareColumnsConfig } from './compare-columns-config.tsx';
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface IContext<T> {
3
+ }
4
+ export declare const createContext: <T>() => React.Context<IContext<T>>;
5
+ export declare const useContext: <T>() => IContext<T>;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ interface IProps<T> {
3
+ }
4
+ export declare const TreeProvider: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
5
+ export {};
@@ -1,8 +1,3 @@
1
1
  export { Table } from './table.tsx';
2
- export { Column } from './column';
3
- export { Expand } from './expand';
4
- export { context as rowContext } from './row';
5
- export { context as cellContext } from './cell';
6
- export { useCellData } from './cell/hook/useCellData.ts';
7
- export { type ITitleProps } from './title';
8
- export { type ICellProps } from './cell';
2
+ export { useRowExpanded } from './feature/expand';
3
+ export { useCellData } from './components/tbody/cell';
@@ -1,11 +1,16 @@
1
1
  import { default as React } from 'react';
2
- export interface ITree<T> {
3
- accessor: keyof T;
4
- defaultExpanded?: boolean;
2
+ import { IData } from './table.tsx';
3
+ import { IConfigColumn } from './configuration/create-columns-config.ts';
4
+ interface IContext<T> {
5
+ data: IData<T>;
6
+ columns: IConfigColumn<T>[];
7
+ columnsWidth: number[];
8
+ expand?: {
9
+ isExpanded(id: string | number): boolean;
10
+ toggle(node: T): void;
11
+ renderExpanded(node: T): React.ReactNode;
12
+ };
5
13
  }
6
- export interface IContext<T> {
7
- tree?: ITree<T>;
8
- target?: HTMLTableElement;
9
- }
10
- export declare const context: React.Context<IContext<any>>;
11
- export declare const Provider: React.Provider<IContext<any>>;
14
+ export declare const createContext: <T>() => React.Context<IContext<T>>;
15
+ export declare const useContext: <T>() => IContext<T>;
16
+ export {};
@@ -1,12 +1,38 @@
1
1
  import { default as React } from 'react';
2
- interface ITree<T> {
2
+ import { Cell } from './configuration/cell';
3
+ import { Head } from './configuration/head';
4
+ import { Column } from './configuration/column';
5
+ import { Expand } from './configuration/expand/expand';
6
+ import { ExpandTrigger } from './feature/expand';
7
+ export interface INode {
8
+ id: string | number;
9
+ nodes?: INode[];
10
+ [prop: string]: any;
11
+ }
12
+ export interface IData<T> {
13
+ nodes: T[];
14
+ }
15
+ interface ITreeProps<T> {
16
+ isUse: boolean;
3
17
  accessor: keyof T;
4
- defaultExpanded?: boolean;
5
18
  }
6
- interface IProps<T> {
7
- data: T[];
8
- tree?: ITree<T>;
9
- empty?: React.ReactNode;
19
+ interface ISelectProps<T> {
20
+ isUse: boolean;
21
+ onSelect(nodes: T[]): void;
22
+ }
23
+ interface IProps<T extends INode> {
24
+ data: IData<T>;
25
+ tree?: ITreeProps<T>;
26
+ select?: ISelectProps<T>;
27
+ isBordered?: boolean;
10
28
  }
11
- export declare const Table: <T extends Record<string, any>>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
29
+ export declare const TableComponent: <T extends INode>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
30
+ type TTable = typeof TableComponent & {
31
+ Column: typeof Column;
32
+ Head: typeof Head;
33
+ Cell: typeof Cell;
34
+ Expand: typeof Expand;
35
+ ExpandTrigger: typeof ExpandTrigger;
36
+ };
37
+ export declare const Table: TTable;
12
38
  export {};
@@ -4,6 +4,8 @@ export interface IContext<T> {
4
4
  deps: number;
5
5
  expanded: boolean;
6
6
  setExpanded: (expanded: boolean) => void;
7
+ selected: boolean;
8
+ setSelected: (selected: boolean) => void;
7
9
  }
8
10
  export declare const context: React.Context<IContext<any>>;
9
11
  export declare const Provider: React.Provider<IContext<any>>;
@@ -0,0 +1,13 @@
1
+ export declare const useGetPinnedStyles: <T>(columnIndex: number) => {
2
+ left?: undefined;
3
+ zIndex?: undefined;
4
+ right?: undefined;
5
+ } | {
6
+ left: string;
7
+ zIndex: number;
8
+ right?: undefined;
9
+ } | {
10
+ right: string;
11
+ zIndex: number;
12
+ left?: undefined;
13
+ };
@@ -0,0 +1,13 @@
1
+ export declare const useGetPinnedStyles: <T>(columnIndex: number) => {
2
+ left?: undefined;
3
+ zIndex?: undefined;
4
+ right?: undefined;
5
+ } | {
6
+ left: string;
7
+ zIndex: number;
8
+ right?: undefined;
9
+ } | {
10
+ right: string;
11
+ zIndex: number;
12
+ left?: undefined;
13
+ };
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { INode } from '../../../table.tsx';
3
+ export declare const CellProvider: React.Provider<INode<any> | null>;
4
+ export declare const useCellData: <T = any>() => INode<T>;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { INode } from '../../../table.tsx';
3
+ interface IProps<T> {
4
+ originIndex: number;
5
+ align?: 'left' | 'center' | 'right';
6
+ collapse?: boolean;
7
+ node: INode<T>;
8
+ }
9
+ export declare const Cell: <T>(props: React.PropsWithChildren<IProps<T>>) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Cell } from './cell.tsx';
2
+ export { useCellData } from './cell.context.ts';
@@ -0,0 +1 @@
1
+ export { TBody } from './tbody.tsx';
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const TBody: <T>() => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { ISort } from '../../../configuration/column';
3
+ interface IProps {
4
+ originIndex: number;
5
+ align?: 'left' | 'center' | 'right';
6
+ collapse?: boolean;
7
+ sort?: ISort;
8
+ }
9
+ export declare const Cell: (props: React.PropsWithChildren<IProps>) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export { Cell } from './cell.tsx';
@@ -0,0 +1 @@
1
+ export { THead } from './thead.tsx';
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const THead: <T>() => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface IProps {
3
+ }
4
+ interface ITableCellPropsWithDisplayName extends React.FC<React.PropsWithChildren<IProps>> {
5
+ displayName: string;
6
+ }
7
+ export declare const Cell: ITableCellPropsWithDisplayName;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Cell } from './cell.tsx';
2
+ export type { IProps } from './cell.tsx';
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ export interface ISort {
3
+ directionDefault?: 'asc' | 'desc';
4
+ onToggle(direction?: 'asc' | 'desc'): void;
5
+ }
6
+ export interface IProps {
7
+ width?: number;
8
+ align?: 'left' | 'center' | 'right';
9
+ pinLeft?: boolean;
10
+ pinRight?: boolean;
11
+ sort?: ISort;
12
+ }
13
+ interface IColumnPropsWithDisplayName extends React.FC<React.PropsWithChildren<IProps>> {
14
+ displayName: string;
15
+ }
16
+ export declare const Column: IColumnPropsWithDisplayName;
17
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Column } from './column.tsx';
2
+ export type { IProps, ISort } from './column.tsx';
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { ISort } from './column';
3
+ export interface IConfigColumn<T> {
4
+ label: React.ReactNode;
5
+ align?: 'left' | 'center' | 'right';
6
+ sort?: ISort;
7
+ width?: number;
8
+ collapse?: boolean;
9
+ pinLeft?: boolean;
10
+ pinRight?: boolean;
11
+ renderCell: (nodes: T) => React.ReactNode;
12
+ }
13
+ export declare const createColumnConfig: <T>(children: React.ReactNode) => IConfigColumn<T>[];
@@ -0,0 +1,4 @@
1
+ import { IData, INode } from '../table.tsx';
2
+ export declare const createDataNodes: <T extends {
3
+ id: string | number;
4
+ }>(data: IData<T>, treeAccessor?: keyof T) => IData<INode<T>>;
@@ -0,0 +1,2 @@
1
+ import { IConfigColumn } from './create-columns-config.ts';
2
+ export declare const useCreateTableGridTemplate: <T>(columns: IConfigColumn<T>[]) => string;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import { IConfigColumn } from './create-columns-config.ts';
3
+ export declare const useGetColumnsWidth: <T>(tableRef: React.RefObject<HTMLTableElement | null>, config: IConfigColumn<T>[]) => number[];