@vuu-ui/vuu-table-types 0.9.2 → 0.10.0

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 (2) hide show
  1. package/index.d.ts +22 -4
  2. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -21,11 +21,12 @@ import type {
21
21
  RowClassNameGenerator,
22
22
  } from "@vuu-ui/vuu-utils";
23
23
  import type {
24
+ ComponentType,
24
25
  CSSProperties,
25
26
  FunctionComponent,
27
+ FunctionComponentElement,
26
28
  HTMLAttributes,
27
29
  MouseEvent,
28
- ReactElement,
29
30
  } from "react";
30
31
 
31
32
  export declare type GroupToggleTarget = "toggle-icon" | "group-column";
@@ -39,7 +40,9 @@ export declare type TableSelectionModel =
39
40
  export declare type TableHeading = { label: string; width: number };
40
41
  export declare type TableHeadings = TableHeading[][];
41
42
 
42
- export declare type ValueFormatter = (value: unknown) => string;
43
+ export declare type ValueFormatter<T extends string | JSX.Element = string> = (
44
+ value: unknown,
45
+ ) => T;
43
46
 
44
47
  export interface EditEventState {
45
48
  editType?: EditType;
@@ -65,6 +68,7 @@ export interface TableCellProps {
65
68
  onClick?: (event: MouseEvent, column: RuntimeColumnDescriptor) => void;
66
69
  onDataEdited?: DataCellEditHandler;
67
70
  row: DataSourceRow;
71
+ searchPattern?: Lowercase<string>;
68
72
  }
69
73
 
70
74
  export declare type CommitResponse = Promise<true | string>;
@@ -245,6 +249,11 @@ export interface ColumnDescriptor extends DataValueDescriptor {
245
249
  aggregate?: VuuAggType;
246
250
  align?: ColumnAlignment;
247
251
  className?: string;
252
+ /**
253
+ * Allows custom content to be rendered into the column header. This will be an identifier.
254
+ * The identifier will be used to retrieve content from the component registry. The componnet
255
+ * yielded will be rendered into the column header.
256
+ */
248
257
  colHeaderContentRenderer?: string;
249
258
  colHeaderLabelRenderer?: string;
250
259
  flex?: number;
@@ -267,6 +276,13 @@ export interface ColumnDescriptor extends DataValueDescriptor {
267
276
  pin?: PinLocation;
268
277
  resizeable?: boolean;
269
278
  sortable?: boolean;
279
+ /**
280
+ * 'client' columns will not receive data from dataSource.
281
+ * They can be used with a custom renderer, e.g to render
282
+ * action buttons.
283
+ * default is 'server'
284
+ */
285
+ source?: "client" | "server";
270
286
  width?: number;
271
287
  }
272
288
 
@@ -411,6 +427,7 @@ export interface RowProps extends BaseRowProps {
411
427
  onDataEdited?: DataCellEditHandler;
412
428
  onToggleGroup?: (row: DataSourceRow, column: RuntimeColumnDescriptor) => void;
413
429
  row: DataSourceRow;
430
+ searchPattern: Lowercase<string>;
414
431
  showBookends?: boolean;
415
432
  zebraStripes?: boolean;
416
433
  }
@@ -426,8 +443,9 @@ export interface HeaderCellProps
426
443
 
427
444
  export declare type TableConfigChangeHandler = (config: TableConfig) => void;
428
445
 
429
- export declare type CustomHeaderComponent = FC<BaseRowProps>;
430
- export declare type CustomHeaderElement = ReactElement;
446
+ export declare type CustomHeaderComponent = ComponentType<BaseRowProps>;
447
+ export declare type CustomHeaderElement =
448
+ FunctionComponentElement<BaseRowProps>;
431
449
  export declare type CustomHeader = CustomHeaderComponent | CustomHeaderElement;
432
450
 
433
451
  /**
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-table-types",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "devDependencies": {
5
- "@vuu-ui/vuu-data-types": "0.9.2",
6
- "@vuu-ui/vuu-filter-types": "0.9.2",
7
- "@vuu-ui/vuu-protocol-types": "0.9.2"
5
+ "@vuu-ui/vuu-data-types": "0.10.0",
6
+ "@vuu-ui/vuu-filter-types": "0.10.0",
7
+ "@vuu-ui/vuu-protocol-types": "0.10.0"
8
8
  },
9
9
  "author": "heswell",
10
10
  "license": "Apache-2.0",