@zhenliang/sheet 0.1.27 → 0.1.29

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.
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  /// <reference types="node" />
3
2
  import type { EventEmitter } from 'events';
3
+ import { CSSProperties } from 'react';
4
4
  import { SheetTableType, SheetType } from '.';
5
5
  export declare enum CellAlign {
6
6
  left = "left",
@@ -10,6 +10,8 @@ export declare enum CellAlign {
10
10
  }
11
11
  export type Cell = {
12
12
  id: string;
13
+ row?: number;
14
+ col?: number;
13
15
  key?: string;
14
16
  readonly?: boolean;
15
17
  component?: CellViewer;
@@ -68,6 +70,10 @@ export type RowGroupConfig = {
68
70
  groups: RowGroup[];
69
71
  groupOpen: boolean[];
70
72
  };
73
+ export type GroupMap = Map<number, SheetType.RowGroup & {
74
+ isStart: boolean;
75
+ isOpen: boolean;
76
+ }>;
71
77
  export type MenuRenderProps = {
72
78
  position?: {
73
79
  top: number;
@@ -96,7 +102,7 @@ export type SheetProps = {
96
102
  freePaste?: boolean;
97
103
  virtualized?: boolean;
98
104
  showBackEdit?: boolean;
99
- backEditStyle?: Partial<CSSStyleDeclaration>;
105
+ backEditStyle?: Partial<CSSProperties>;
100
106
  sticky?: boolean;
101
107
  groupConfig?: RowGroupConfig;
102
108
  onCellsChanged?: CellChangeHandler;
@@ -109,10 +115,16 @@ export type SheetProps = {
109
115
  rowClassName?: string | ((record: Record<string, unknown>, index: number) => string);
110
116
  children?: any[];
111
117
  };
112
- export type WidthConfig = {
118
+ export type WidthConfigContext = {
113
119
  onChange?: (value: Record<number | string, number>) => void;
114
120
  widths?: Record<number | string, number>;
115
121
  };
122
+ export type GroupConfigContext = {
123
+ onChange?: (value: RowGroupConfig) => void;
124
+ config?: RowGroupConfig & {
125
+ configMap: GroupMap;
126
+ };
127
+ };
116
128
  export type SheetShell = Pick<SheetTableType.TableProps, 'columns'> & {
117
129
  className?: string;
118
130
  showGroup?: boolean;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  import { SheetType } from '.';
3
3
  export type refAssertion = {
4
4
  contains?: (target: EventTarget | null) => boolean;
@@ -79,7 +79,7 @@ export type TableProps = {
79
79
  draggable?: boolean;
80
80
  freePaste?: boolean;
81
81
  showBackEdit?: boolean;
82
- backEditStyle?: Partial<CSSStyleDeclaration>;
82
+ backEditStyle?: Partial<CSSProperties>;
83
83
  rowSelection?: TableRowSelection;
84
84
  groupConfig?: TableGroupConfig;
85
85
  menuRenderer?: React.FC<SheetType.MenuRenderProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",