@clickhouse/click-ui 0.0.99 → 0.0.101

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.
@@ -11,10 +11,10 @@ interface HeaderProps {
11
11
  rounded: RoundedType;
12
12
  columnCount: number;
13
13
  onColumnResize: ColumnResizeFn;
14
- columnHorizontalPosition: Array<number>;
14
+ getColumnHorizontalPosition: (columnIndex: number) => number;
15
15
  scrolledVertical: boolean;
16
16
  setResizeCursorPosition: SetResizeCursorPositionFn;
17
17
  showBorder: boolean;
18
18
  }
19
- declare const Header: ({ scrolledVertical, showRowNumber, rowNumberWidth, minColumn, maxColumn, height, columnWidth, cell, rounded, columnCount, getSelectionType, onColumnResize, columnHorizontalPosition, setResizeCursorPosition, showBorder, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
19
+ declare const Header: ({ scrolledVertical, showRowNumber, rowNumberWidth, minColumn, maxColumn, height, columnWidth, cell, rounded, columnCount, getSelectionType, onColumnResize, getColumnHorizontalPosition, setResizeCursorPosition, showBorder, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
20
20
  export default Header;
@@ -1,12 +1,19 @@
1
1
  import { ComponentType, HTMLAttributes, KeyboardEventHandler, MouseEventHandler, ReactNode } from "react";
2
2
  import { VariableSizeGridProps } from "react-window";
3
3
  import { ContextMenuItemProps } from '../../components';
4
- interface CellComponentProps extends HTMLAttributes<HTMLElement> {
5
- rowIndex?: number;
6
- columnIndex?: number;
7
- type: "row-cell" | "header-cell";
4
+ interface CellCommonProps extends HTMLAttributes<HTMLElement> {
5
+ columnIndex: number;
8
6
  isScrolling?: boolean;
9
7
  }
8
+ interface CellHeaderProps extends CellCommonProps {
9
+ rowIndex?: never;
10
+ type: "header-cell";
11
+ }
12
+ interface CellBodyProps extends CellCommonProps {
13
+ rowIndex: number;
14
+ type: "row-cell";
15
+ }
16
+ type CellComponentProps = CellHeaderProps | CellBodyProps;
10
17
  export type CellProps = ComponentType<CellComponentProps>;
11
18
  export interface CellSelectionAction {
12
19
  type: "normal" | "shiftSelection";
@@ -9,7 +9,7 @@ interface Props {
9
9
  onColumnResize?: (columnIndex: number, newWidth: number) => void;
10
10
  }
11
11
  declare const useColumns: ({ columnCount, columnWidth: columnWidthProp, outerGridRef, onColumnResize: onColumnResizeProp, gridRef, }: Props) => {
12
- columnHorizontalPosition: number[];
12
+ getColumnHorizontalPosition: (index: number) => number;
13
13
  onColumnResize: ColumnResizeFn;
14
14
  columnWidth: (columnIndex: number) => number;
15
15
  initColumnSize: (containerWidth: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.99",
3
+ "version": "0.0.101",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",