@vuu-ui/vuu-table-types 0.8.91 → 0.8.92
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 +31 -73
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
DataSourceRowObject,
|
|
3
|
+
DataValueDescriptor,
|
|
4
|
+
DataValueTypeSimple,
|
|
5
|
+
EditValidationRule,
|
|
6
|
+
} from "@vuu-ui/vuu-data-types";
|
|
7
|
+
import type {
|
|
8
|
+
DataValueValidationChecker,
|
|
9
|
+
DataSourceRow,
|
|
10
|
+
} from "@vuu-ui/vuu-data-types";
|
|
3
11
|
import type { Filter } from "@vuu-ui/vuu-filter-types";
|
|
4
12
|
import type {
|
|
5
13
|
VuuAggType,
|
|
6
|
-
VuuColumnDataType,
|
|
7
14
|
VuuMenuItem,
|
|
8
15
|
VuuRowDataItemType,
|
|
9
16
|
VuuSortType,
|
|
10
17
|
VuuTable,
|
|
11
18
|
} from "@vuu-ui/vuu-protocol-types";
|
|
12
|
-
import type { ClientSideValidationChecker } from "@vuu-ui/vuu-ui-controls";
|
|
13
19
|
import type {
|
|
14
20
|
ColumnMap,
|
|
15
21
|
DateTimePattern,
|
|
@@ -30,10 +36,6 @@ export type TableHeadings = TableHeading[][];
|
|
|
30
36
|
|
|
31
37
|
export type ValueFormatter = (value: unknown) => string;
|
|
32
38
|
|
|
33
|
-
export type ClientSideValidationChecker = (
|
|
34
|
-
value?: VuuRowDataItemType,
|
|
35
|
-
) => string | false | undefined;
|
|
36
|
-
|
|
37
39
|
export type DataCellEditHandler = (
|
|
38
40
|
row: DataSourceRow,
|
|
39
41
|
columnName: string,
|
|
@@ -124,6 +126,18 @@ export interface GridConfig extends TableConfig {
|
|
|
124
126
|
selectionBookendWidth?: number;
|
|
125
127
|
}
|
|
126
128
|
|
|
129
|
+
// TODO tidy up this definition, currently split beween here and data-types
|
|
130
|
+
export declare type DataValueTypeDescriptor = {
|
|
131
|
+
rules?: EditValidationRule[];
|
|
132
|
+
formatting?: ColumnTypeFormatting;
|
|
133
|
+
name: DataValueTypeSimple;
|
|
134
|
+
renderer?:
|
|
135
|
+
| ColumnTypeRendering
|
|
136
|
+
| LookupRenderer
|
|
137
|
+
| MappedValueTypeRenderer
|
|
138
|
+
| ValueListRenderer;
|
|
139
|
+
};
|
|
140
|
+
|
|
127
141
|
export declare type ColumnTypeFormatting = {
|
|
128
142
|
alignOnDecimals?: boolean;
|
|
129
143
|
decimals?: number;
|
|
@@ -133,12 +147,6 @@ export declare type ColumnTypeFormatting = {
|
|
|
133
147
|
|
|
134
148
|
export type ColumnTypeValueMap = { [key: string]: string };
|
|
135
149
|
|
|
136
|
-
export interface EditValidationRule {
|
|
137
|
-
name: string;
|
|
138
|
-
message?: string;
|
|
139
|
-
value?: string;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
150
|
export type ListOption = {
|
|
143
151
|
label: string;
|
|
144
152
|
value: number | string;
|
|
@@ -152,7 +160,6 @@ export interface ColumnTypeRendering {
|
|
|
152
160
|
// specific to Background renderer
|
|
153
161
|
flashStyle?: "bg-only" | "arrow-bg" | "arrow";
|
|
154
162
|
name: string;
|
|
155
|
-
rules?: EditValidationRule[];
|
|
156
163
|
}
|
|
157
164
|
export interface MappedValueTypeRenderer {
|
|
158
165
|
map: ColumnTypeValueMap;
|
|
@@ -178,40 +185,9 @@ export interface ValueListRenderer {
|
|
|
178
185
|
values: string[];
|
|
179
186
|
}
|
|
180
187
|
|
|
181
|
-
export declare type ColumnTypeSimple =
|
|
182
|
-
| "string"
|
|
183
|
-
| "number"
|
|
184
|
-
| "boolean"
|
|
185
|
-
| "json"
|
|
186
|
-
| DateTimeColumnTypeSimple
|
|
187
|
-
| "checkbox";
|
|
188
|
-
|
|
189
|
-
export declare type ColumnTypeDescriptor = {
|
|
190
|
-
formatting?: ColumnTypeFormatting;
|
|
191
|
-
name: ColumnTypeSimple;
|
|
192
|
-
renderer?:
|
|
193
|
-
| ColumnTypeRendering
|
|
194
|
-
| LookupRenderer
|
|
195
|
-
| MappedValueTypeRenderer
|
|
196
|
-
| ValueListRenderer;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export declare type DateTimeColumnTypeSimple = "date/time";
|
|
200
|
-
|
|
201
|
-
type DateTimeColumnType =
|
|
202
|
-
| DateTimeColumnTypeSimple
|
|
203
|
-
| (Omit<ColumnTypeDescriptor, "name"> & { name: DateTimeColumnTypeSimple });
|
|
204
|
-
|
|
205
|
-
export declare type DateTimeColumnDescriptor = Omit<
|
|
206
|
-
ColumnDescriptor,
|
|
207
|
-
"type"
|
|
208
|
-
> & {
|
|
209
|
-
type: DateTimeColumnType;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
188
|
export declare type ColumnTypeDescriptorCustomRenderer = {
|
|
213
189
|
formatting?: ColumnTypeFormatting;
|
|
214
|
-
name:
|
|
190
|
+
name: DataValueTypeSimple;
|
|
215
191
|
renderer: ColumnTypeRendering;
|
|
216
192
|
};
|
|
217
193
|
|
|
@@ -226,41 +202,28 @@ export interface FormattingSettingsProps<
|
|
|
226
202
|
latter. e.g a server data type of long may be further refined as
|
|
227
203
|
a date/time value using the column descriptor type.
|
|
228
204
|
*/
|
|
229
|
-
onChangeColumnType: (type:
|
|
205
|
+
onChangeColumnType: (type: DataValueTypeSimple) => void;
|
|
230
206
|
}
|
|
231
207
|
|
|
232
|
-
export interface
|
|
233
|
-
extends
|
|
208
|
+
export interface ColumnTypeWithValidationRules
|
|
209
|
+
extends Omit<DataValueTypeDescriptor, "editRules"> {
|
|
234
210
|
rules: EditValidationRule[];
|
|
235
211
|
}
|
|
236
212
|
|
|
237
|
-
export
|
|
238
|
-
renderer: ColumnTypeRendererWithValidationRules;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export declare type ColumnType = ColumnTypeSimple | ColumnTypeDescriptor;
|
|
242
|
-
|
|
243
|
-
export type ColumnSort = VuuSortType | number;
|
|
213
|
+
export declare type ColumnSort = VuuSortType | number;
|
|
244
214
|
|
|
245
|
-
export type PinLocation = "left" | "right" | "floating";
|
|
215
|
+
export declare type PinLocation = "left" | "right" | "floating";
|
|
246
216
|
|
|
247
|
-
export type ColumnAlignment = "left" | "right";
|
|
248
|
-
|
|
249
|
-
export type BulkEdit = "bulk" | false | "read-only";
|
|
217
|
+
export declare type ColumnAlignment = "left" | "right";
|
|
250
218
|
|
|
251
219
|
/** This is a public description of a Column, defining all the
|
|
252
220
|
* column attributes that can be defined by client. */
|
|
253
|
-
export interface ColumnDescriptor {
|
|
221
|
+
export interface ColumnDescriptor extends DataValueDescriptor {
|
|
254
222
|
aggregate?: VuuAggType;
|
|
255
223
|
align?: ColumnAlignment;
|
|
256
224
|
className?: string;
|
|
257
225
|
colHeaderContentRenderer?: string;
|
|
258
226
|
colHeaderLabelRenderer?: string;
|
|
259
|
-
editable?: boolean;
|
|
260
|
-
/**
|
|
261
|
-
There are three values for editableBulk. When editableBulk is false, user will not see the column in BulkEditPanel. When editableBulk is "bulk", user will see the column in BulkEditPanel and be able to bulk-edit on BulkEditRow. When editableBulk is "read-only", user will see the column but won't be able to edit.
|
|
262
|
-
*/
|
|
263
|
-
editableBulk?: BulkEdit;
|
|
264
227
|
flex?: number;
|
|
265
228
|
/**
|
|
266
229
|
Optional additional level(s) of heading to display above label.
|
|
@@ -270,17 +233,12 @@ export interface ColumnDescriptor {
|
|
|
270
233
|
heading?: string[];
|
|
271
234
|
hidden?: boolean;
|
|
272
235
|
isSystemColumn?: boolean;
|
|
273
|
-
/** The Label to display on column in Table */
|
|
274
|
-
label?: string;
|
|
275
236
|
locked?: boolean;
|
|
276
237
|
maxWidth?: number;
|
|
277
238
|
minWidth?: number;
|
|
278
|
-
name: string;
|
|
279
239
|
pin?: PinLocation;
|
|
280
240
|
resizeable?: boolean;
|
|
281
|
-
serverDataType?: VuuColumnDataType;
|
|
282
241
|
sortable?: boolean;
|
|
283
|
-
type?: ColumnType;
|
|
284
242
|
width?: number;
|
|
285
243
|
}
|
|
286
244
|
|
|
@@ -298,7 +256,7 @@ export interface RuntimeColumnDescriptor extends ColumnDescriptor {
|
|
|
298
256
|
HeaderCellContentRenderer?: FunctionComponent<HeaderCellProps>;
|
|
299
257
|
canStretch?: boolean;
|
|
300
258
|
className?: string;
|
|
301
|
-
clientSideEditValidationCheck?:
|
|
259
|
+
clientSideEditValidationCheck?: DataValueValidationChecker;
|
|
302
260
|
endPin?: true | undefined;
|
|
303
261
|
filter?: Filter;
|
|
304
262
|
flex?: number;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuu-ui/vuu-table-types",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.92",
|
|
4
4
|
"devDependencies": {
|
|
5
|
-
"@vuu-ui/vuu-data-types": "0.8.
|
|
6
|
-
"@vuu-ui/vuu-filter-types": "0.8.
|
|
7
|
-
"@vuu-ui/vuu-protocol-types": "0.8.
|
|
5
|
+
"@vuu-ui/vuu-data-types": "0.8.92",
|
|
6
|
+
"@vuu-ui/vuu-filter-types": "0.8.92",
|
|
7
|
+
"@vuu-ui/vuu-protocol-types": "0.8.92"
|
|
8
8
|
},
|
|
9
9
|
"author": "heswell",
|
|
10
10
|
"license": "Apache-2.0",
|