@vuu-ui/vuu-table-types 0.13.110-alpha.4 → 0.13.110
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/index.d.ts +16 -51
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type {
|
|
|
8
8
|
} from "@vuu-ui/vuu-data-types";
|
|
9
9
|
import type { Filter } from "@vuu-ui/vuu-filter-types";
|
|
10
10
|
import type {
|
|
11
|
-
RpcResult,
|
|
12
11
|
SelectRequest,
|
|
13
12
|
VuuAggType,
|
|
14
13
|
VuuRowDataItemType,
|
|
@@ -52,17 +51,16 @@ export declare type ValueFormatter<T extends string | ReactElement = string> = (
|
|
|
52
51
|
) => T;
|
|
53
52
|
|
|
54
53
|
export interface EditEventState {
|
|
55
|
-
columnName?: string;
|
|
56
54
|
editType?: EditType;
|
|
57
55
|
isValid?: boolean;
|
|
56
|
+
// value: unknown;
|
|
58
57
|
previousValue?: VuuRowDataItemType;
|
|
59
|
-
row?: DataSourceRow;
|
|
60
58
|
value: VuuRowDataItemType;
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
export interface DataCellEditEvent extends EditEventState {
|
|
64
|
-
row
|
|
65
|
-
columnName
|
|
62
|
+
row: DataSourceRow;
|
|
63
|
+
columnName: string;
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
export declare type DataCellEditNotification = (
|
|
@@ -74,17 +72,19 @@ export interface TableCellProps {
|
|
|
74
72
|
column: RuntimeColumnDescriptor;
|
|
75
73
|
columnMap: ColumnMap;
|
|
76
74
|
onClick?: (event: MouseEvent, column: RuntimeColumnDescriptor) => void;
|
|
77
|
-
onDataEdited?:
|
|
75
|
+
onDataEdited?: DataCellEditHandler;
|
|
78
76
|
row: DataSourceRow;
|
|
79
77
|
searchPattern?: Lowercase<string>;
|
|
80
78
|
}
|
|
81
79
|
|
|
80
|
+
export declare type CommitResponse = Promise<true | string>;
|
|
81
|
+
|
|
82
82
|
export declare type EditType = "commit" | "change" | "cancel";
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
declare type DataItemEditHandler<T extends EditType = EditType> = (
|
|
85
85
|
editState: EditEventState,
|
|
86
86
|
editPhase: T,
|
|
87
|
-
) => T extends "commit" ? Promise<
|
|
87
|
+
) => T extends "commit" ? Promise<string | true> : void;
|
|
88
88
|
|
|
89
89
|
export declare type TableRowSelectHandler = (
|
|
90
90
|
row: DataSourceRowObject | null,
|
|
@@ -110,7 +110,7 @@ export declare type TableRowClickHandlerInternal = (
|
|
|
110
110
|
|
|
111
111
|
export interface TableCellRendererProps
|
|
112
112
|
extends Omit<TableCellProps, "onDataEdited"> {
|
|
113
|
-
onEdit?:
|
|
113
|
+
onEdit?: DataItemEditHandler;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
@@ -123,21 +123,12 @@ export interface TableCellRendererProps
|
|
|
123
123
|
export declare type ColumnLayout = "static" | "fit" | "manual";
|
|
124
124
|
|
|
125
125
|
export interface TableAttributes {
|
|
126
|
-
/**
|
|
127
|
-
* In the case of checkbox selection, allows width of checkbox columns to be specified
|
|
128
|
-
*/
|
|
129
|
-
checkboxColumnWidth?: number;
|
|
130
126
|
columnDefaultWidth?: number;
|
|
131
127
|
columnFormatHeader?: "capitalize" | "uppercase";
|
|
132
128
|
columnLayout?: ColumnLayout;
|
|
133
129
|
columnSeparators?: boolean;
|
|
134
130
|
// showHighlightedRow?: boolean;
|
|
135
131
|
rowSeparators?: boolean;
|
|
136
|
-
/**
|
|
137
|
-
* Selection Bookends style the left and right edge of a selection block.
|
|
138
|
-
* They are optional, value currently defaults to 4.
|
|
139
|
-
*/
|
|
140
|
-
selectionBookendWidth?: number;
|
|
141
132
|
zebraStripes?: boolean;
|
|
142
133
|
}
|
|
143
134
|
|
|
@@ -151,6 +142,10 @@ export interface TableConfig extends TableAttributes {
|
|
|
151
142
|
columns: ColumnDescriptor[];
|
|
152
143
|
rowClassNameGenerators?: string[];
|
|
153
144
|
}
|
|
145
|
+
export interface GridConfig extends TableConfig {
|
|
146
|
+
headings: TableHeadings;
|
|
147
|
+
selectionBookendWidth?: number;
|
|
148
|
+
}
|
|
154
149
|
|
|
155
150
|
// TODO tidy up this definition, currently split beween here and data-types
|
|
156
151
|
export declare type DataValueTypeDescriptor = {
|
|
@@ -242,7 +237,7 @@ export interface ColumnTypeWithValidationRules
|
|
|
242
237
|
|
|
243
238
|
export declare type ColumnSort = VuuSortType | number;
|
|
244
239
|
|
|
245
|
-
export declare type PinLocation = "left" | "right";
|
|
240
|
+
export declare type PinLocation = "left" | "right" | "floating";
|
|
246
241
|
|
|
247
242
|
export declare type ColumnAlignment = "left" | "right";
|
|
248
243
|
|
|
@@ -318,10 +313,7 @@ export interface RuntimeColumnDescriptor extends ColumnDescriptor {
|
|
|
318
313
|
canStretch?: boolean;
|
|
319
314
|
className?: string;
|
|
320
315
|
clientSideEditValidationCheck?: DataValueValidationChecker;
|
|
321
|
-
|
|
322
|
-
* Used to mark a column as non-draggable, e.g when pinned
|
|
323
|
-
*/
|
|
324
|
-
draggable?: boolean;
|
|
316
|
+
endPin?: true | undefined;
|
|
325
317
|
filter?: Filter;
|
|
326
318
|
flex?: number;
|
|
327
319
|
heading?: [...string[]];
|
|
@@ -333,14 +325,7 @@ export interface RuntimeColumnDescriptor extends ColumnDescriptor {
|
|
|
333
325
|
moving?: boolean;
|
|
334
326
|
/** used only when column is a child of GroupColumn */
|
|
335
327
|
originalIdx?: number;
|
|
336
|
-
/**
|
|
337
|
-
* The offset from left or right where we want to pin the column
|
|
338
|
-
*/
|
|
339
328
|
pinnedOffset?: number;
|
|
340
|
-
/**
|
|
341
|
-
* The total width of pinned columns, only required on the outermost pinned column
|
|
342
|
-
*/
|
|
343
|
-
pinnedWidth?: number;
|
|
344
329
|
resizeable?: boolean;
|
|
345
330
|
resizing?: boolean;
|
|
346
331
|
sortable?: boolean;
|
|
@@ -482,7 +467,7 @@ export interface RowProps extends BaseRowProps {
|
|
|
482
467
|
offset: number;
|
|
483
468
|
onCellEdit?: CellEditHandler;
|
|
484
469
|
onClick?: TableRowClickHandlerInternal;
|
|
485
|
-
onDataEdited?:
|
|
470
|
+
onDataEdited?: DataCellEditHandler;
|
|
486
471
|
onToggleGroup?: (row: DataSourceRow, column: RuntimeColumnDescriptor) => void;
|
|
487
472
|
row: DataSourceRow;
|
|
488
473
|
searchPattern: Lowercase<string>;
|
|
@@ -564,23 +549,3 @@ export declare type SelectionChange = Omit<SelectRequest, "vpId">;
|
|
|
564
549
|
export declare type SelectionChangeHandler = (
|
|
565
550
|
selectionChange: SelectionChange,
|
|
566
551
|
) => void;
|
|
567
|
-
|
|
568
|
-
export interface ColumnPinAction {
|
|
569
|
-
type: "pinColumn";
|
|
570
|
-
column: ColumnDescriptor;
|
|
571
|
-
pin: PinLocation | false;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
export interface ColumnHideAction {
|
|
575
|
-
type: "hideColumn";
|
|
576
|
-
column: ColumnDescriptor;
|
|
577
|
-
}
|
|
578
|
-
export interface ColumnRemoveAction {
|
|
579
|
-
type: "removeColumn";
|
|
580
|
-
column: ColumnDescriptor;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
export type ColumnDisplayAction =
|
|
584
|
-
| ColumnPinAction
|
|
585
|
-
| ColumnHideAction
|
|
586
|
-
| ColumnRemoveAction;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuu-ui/vuu-table-types",
|
|
3
|
-
"version": "0.13.110
|
|
3
|
+
"version": "0.13.110",
|
|
4
4
|
"devDependencies": {
|
|
5
|
-
"@vuu-ui/vuu-data-types": "0.13.110
|
|
6
|
-
"@vuu-ui/vuu-filter-types": "0.13.110
|
|
7
|
-
"@vuu-ui/vuu-protocol-types": "0.13.110
|
|
5
|
+
"@vuu-ui/vuu-data-types": "0.13.110",
|
|
6
|
+
"@vuu-ui/vuu-filter-types": "0.13.110",
|
|
7
|
+
"@vuu-ui/vuu-protocol-types": "0.13.110"
|
|
8
8
|
},
|
|
9
9
|
"author": "heswell",
|
|
10
10
|
"license": "Apache-2.0",
|