@vuu-ui/vuu-data-types 0.11.2 → 0.12.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.
- package/index.d.ts +15 -61
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type {
|
|
|
5
5
|
TableSchema,
|
|
6
6
|
} from "@vuu-ui/vuu-data-types";
|
|
7
7
|
import type { Filter } from "@vuu-ui/vuu-filter-types";
|
|
8
|
-
import type { MenuActionClosePopup } from "@vuu-ui/vuu-popups";
|
|
9
8
|
import type {
|
|
10
9
|
LinkDescriptorWithLabel,
|
|
11
10
|
NoAction,
|
|
@@ -33,7 +32,11 @@ import type {
|
|
|
33
32
|
VuuRemoveVisualLink,
|
|
34
33
|
VuuTableList,
|
|
35
34
|
} from "@vuu-ui/vuu-protocol-types";
|
|
36
|
-
import type {
|
|
35
|
+
import type {
|
|
36
|
+
DataSourceConfigChanges,
|
|
37
|
+
IEventEmitter,
|
|
38
|
+
Range,
|
|
39
|
+
} from "@vuu-ui/vuu-utils";
|
|
37
40
|
import type {
|
|
38
41
|
DataSourceFilter,
|
|
39
42
|
MenuRpcResponse,
|
|
@@ -197,26 +200,6 @@ export declare type DataSourceRowObject = {
|
|
|
197
200
|
|
|
198
201
|
export declare type DataSourceRowPredicate = (row: DataSourceRow) => boolean;
|
|
199
202
|
|
|
200
|
-
export interface ContextMenuItemBase {
|
|
201
|
-
className?: string;
|
|
202
|
-
icon?: string;
|
|
203
|
-
label: string;
|
|
204
|
-
location?: string;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export interface ContextMenuLeafItemDescriptor extends ContextMenuItemBase {
|
|
208
|
-
action: string;
|
|
209
|
-
options?: unknown;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export declare type ContextMenuItemDescriptor =
|
|
213
|
-
| ContextMenuLeafItemDescriptor
|
|
214
|
-
| ContextMenuGroupItemDescriptor;
|
|
215
|
-
|
|
216
|
-
export interface ContextMenuGroupItemDescriptor extends ContextMenuItemBase {
|
|
217
|
-
children: ContextMenuItemDescriptor[];
|
|
218
|
-
}
|
|
219
|
-
|
|
220
203
|
export interface MessageWithClientViewportId {
|
|
221
204
|
clientViewportId: string;
|
|
222
205
|
}
|
|
@@ -368,35 +351,6 @@ export declare type ConfigChangeMessage =
|
|
|
368
351
|
|
|
369
352
|
export declare type ConfigChangeHandler = (msg: ConfigChangeMessage) => void;
|
|
370
353
|
|
|
371
|
-
/**
|
|
372
|
-
* MenuBuilder describes a factory function that creates
|
|
373
|
-
* Menu Item Descriptors appropriate to the supplied
|
|
374
|
-
* location. Location can be any string identifier, it
|
|
375
|
-
* can be used to determine which Menu Items to include
|
|
376
|
-
* in the menu. Most often used for ContextMenus.
|
|
377
|
-
*/
|
|
378
|
-
export declare type MenuBuilder<L = string, O = unknown> = (
|
|
379
|
-
location: L,
|
|
380
|
-
options: O,
|
|
381
|
-
) => ContextMenuItemDescriptor[];
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* MenuActionHandler describes a function that provides an implementation of
|
|
385
|
-
* one or more MenuItem actions. It will receive the type from the MenuItem
|
|
386
|
-
* clicked, plus any options object associated with that MenuItem.
|
|
387
|
-
*
|
|
388
|
-
* It should return true if it handled this MenuItem. This allows multiple Menu-
|
|
389
|
-
* ActionHandlers to be chained.
|
|
390
|
-
*/
|
|
391
|
-
export declare type MenuActionHandler = (
|
|
392
|
-
reason: MenuActionClosePopup,
|
|
393
|
-
) => boolean | undefined;
|
|
394
|
-
|
|
395
|
-
export interface ContextMenuContextType {
|
|
396
|
-
menuBuilders: MenuBuilder[];
|
|
397
|
-
menuActionHandler: MenuActionHandler;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
354
|
export declare type SchemaColumn = {
|
|
401
355
|
name: string;
|
|
402
356
|
serverDataType: VuuColumnDataType;
|
|
@@ -451,17 +405,17 @@ export interface DataSourceConstructorProps
|
|
|
451
405
|
viewport?: string;
|
|
452
406
|
}
|
|
453
407
|
|
|
454
|
-
export interface
|
|
408
|
+
export interface DataSourceSubscribeProps
|
|
455
409
|
extends Partial<WithBaseFilter<WithFullConfig>> {
|
|
456
410
|
viewport?: string;
|
|
457
|
-
range?:
|
|
411
|
+
range?: Range;
|
|
458
412
|
revealSelected?: boolean;
|
|
459
413
|
selectedIndexValues?: Selection;
|
|
460
414
|
selectedKeyValues?: string[];
|
|
461
415
|
title?: string;
|
|
462
416
|
}
|
|
463
417
|
|
|
464
|
-
export declare type
|
|
418
|
+
export declare type DataSourceSubscribeCallback = (
|
|
465
419
|
message: DataSourceCallbackMessage,
|
|
466
420
|
) => void;
|
|
467
421
|
export declare type OptimizeStrategy = "none" | "throttle" | "debounce";
|
|
@@ -474,7 +428,7 @@ export declare type RowSelectionEventHandler = (
|
|
|
474
428
|
|
|
475
429
|
export type DataSourceConfigChangeHandler = (
|
|
476
430
|
config: WithBaseFilter<WithFullConfig>,
|
|
477
|
-
range:
|
|
431
|
+
range: Range,
|
|
478
432
|
confirmed?: boolean,
|
|
479
433
|
configChanges?: DataSourceConfigChanges,
|
|
480
434
|
) => void;
|
|
@@ -483,7 +437,7 @@ export declare type DataSourceEvents = {
|
|
|
483
437
|
config: DataSourceConfigChangeHandler;
|
|
484
438
|
optimize: (optimize: OptimizeStrategy) => void;
|
|
485
439
|
"page-count": (pageCount: number) => void;
|
|
486
|
-
range: (range:
|
|
440
|
+
range: (range: Range) => void;
|
|
487
441
|
resize: (size: number) => void;
|
|
488
442
|
"row-selection": RowSelectionEventHandler;
|
|
489
443
|
subscribed: (subscription: DataSourceSubscribedMessage) => void;
|
|
@@ -601,7 +555,7 @@ export interface DataSource
|
|
|
601
555
|
* If an suspend is requested and not resumed within 3 seconds, it will automatically be promoted to a disable.,
|
|
602
556
|
*/
|
|
603
557
|
suspend?: () => void;
|
|
604
|
-
resume?: (callback?:
|
|
558
|
+
resume?: (callback?: DataSourceSubscribeCallback) => void;
|
|
605
559
|
|
|
606
560
|
deleteRow?: DataSourceDeleteHandler;
|
|
607
561
|
/**
|
|
@@ -618,7 +572,7 @@ export interface DataSource
|
|
|
618
572
|
* assume ownership of a subscription and receive all messages.
|
|
619
573
|
* Should emit an enabled event
|
|
620
574
|
*/
|
|
621
|
-
enable?: (callback?:
|
|
575
|
+
enable?: (callback?: DataSourceSubscribeCallback) => void;
|
|
622
576
|
/**
|
|
623
577
|
* Disables this subscription. A datasource will send no further messages until re-enabled. Example usage
|
|
624
578
|
* might be for a component displayed within a set of Tabs. If user switches to another tab, the dataSource
|
|
@@ -658,7 +612,7 @@ export interface DataSource
|
|
|
658
612
|
rpcRequest: Omit<VuuRpcRequest, "vpId">,
|
|
659
613
|
) => Promise<T>;
|
|
660
614
|
openTreeNode: (keyOrIndex: string | number) => void;
|
|
661
|
-
range:
|
|
615
|
+
range: Range;
|
|
662
616
|
remoteProcedureCall: <T extends VuuRpcResponse = VuuRpcResponse>(
|
|
663
617
|
message: VuuRpcRequest,
|
|
664
618
|
) => Promise<T>;
|
|
@@ -668,8 +622,8 @@ export interface DataSource
|
|
|
668
622
|
readonly size: number;
|
|
669
623
|
sort: VuuSort;
|
|
670
624
|
subscribe: (
|
|
671
|
-
props:
|
|
672
|
-
callback:
|
|
625
|
+
props: DataSourceSubscribeProps,
|
|
626
|
+
callback: DataSourceSubscribeCallback,
|
|
673
627
|
) => Promise<void>;
|
|
674
628
|
table?: VuuTable;
|
|
675
629
|
readonly tableSchema?: TableSchema;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuu-ui/vuu-data-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-filter-types": "0.
|
|
8
|
-
"@vuu-ui/vuu-protocol-types": "0.
|
|
7
|
+
"@vuu-ui/vuu-filter-types": "0.12.0",
|
|
8
|
+
"@vuu-ui/vuu-protocol-types": "0.12.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {},
|
|
11
11
|
"peerDependencies": {},
|