@vuu-ui/vuu-data-types 0.9.0 → 0.9.2

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 +23 -13
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -61,6 +61,7 @@ export declare type DataValueValidationResult =
61
61
 
62
62
  export declare type DataValueValidationChecker = (
63
63
  value?: VuuRowDataItemType,
64
+ phase: EditPhase | "*",
64
65
  ) => DataValueValidationResult;
65
66
 
66
67
  export declare type EditRuleValidationSuccessResult = {
@@ -90,6 +91,8 @@ export declare type EditRuleValidator = (
90
91
  value?: VuuRowDataItemType,
91
92
  ) => EditRuleValidationResult;
92
93
 
94
+ export declare type EditPhase = "commit" | "change";
95
+
93
96
  /**
94
97
  * Edit validation functions (EditRuleValidator) must be registered with the component registry.
95
98
  * They can then be referenced by name from EditValidationRule(s)
@@ -97,10 +100,10 @@ export declare type EditRuleValidator = (
97
100
  export interface EditValidationRule {
98
101
  /**
99
102
  * when is the rule applied
100
- * - 'commit' - when suer commits change, e.g. by pressent ENTER (on an input), or TAB
103
+ * - 'commit' - when user commits change, e.g. by pressent ENTER (on an input), or TAB
101
104
  * - 'change' - for a text input, on every keystroke
102
105
  * */
103
- apply?: "commit" | "change";
106
+ phase?: EditPhase;
104
107
  name: string;
105
108
  message?: string;
106
109
  value?: string;
@@ -466,12 +469,15 @@ export declare type RowSelectionEventHandler = (
466
469
  selectedRowCount: number,
467
470
  ) => void;
468
471
 
472
+ export type DataSourceConfigChangeHandler = (
473
+ config: WithBaseFilter<WithFullConfig>,
474
+ range: VuuRange,
475
+ confirmed?: boolean,
476
+ configChanges?: DataSourceConfigChanges,
477
+ ) => void;
478
+
469
479
  export declare type DataSourceEvents = {
470
- config: (
471
- config: DataSourceConfig | undefined,
472
- confirmed?: boolean,
473
- configChanges?: DataSourceConfigChanges,
474
- ) => void;
480
+ config: DataSourceConfigChangeHandler;
475
481
  optimize: (optimize: OptimizeStrategy) => void;
476
482
  "page-count": (pageCount: number) => void;
477
483
  range: (range: VuuRange) => void;
@@ -576,9 +582,9 @@ export interface DataSource
576
582
  */
577
583
  preserveExistingConfigAttributes?: boolean,
578
584
  ) => DataSourceConfigChanges | undefined;
579
- closeTreeNode: (key: string, cascade?: boolean) => void;
585
+ closeTreeNode: (keyOrIndex: string | number, cascade?: boolean) => void;
580
586
  columns: string[];
581
- config: WithBaseFilter<DataSourceConfig>;
587
+ config: WithBaseFilter<WithFullConfig>;
582
588
  status: DataSourceStatus;
583
589
  /**
584
590
  *
@@ -627,6 +633,8 @@ export interface DataSource
627
633
  * @returns
628
634
  */
629
635
  getChildRows?: (rowKey: string) => DataSourceRow[];
636
+
637
+ getRowAtIndex?: (rowIndex: number) => DataSourceRow | undefined;
630
638
  /**
631
639
  * Only implemented on JSON DataSource
632
640
  * @param depth
@@ -634,7 +642,7 @@ export interface DataSource
634
642
  * @returns
635
643
  */
636
644
  getRowsAtDepth?: (depth: number, visibleOnly?: boolean) => DataSourceRow[];
637
- groupBy: VuuGroupBy;
645
+ groupBy?: VuuGroupBy;
638
646
  insertRow?: DataSourceInsertHandler;
639
647
  links?: LinkDescriptorWithLabel[];
640
648
  menu?: VuuMenu;
@@ -646,7 +654,7 @@ export interface DataSource
646
654
  rpcCall?: <T extends VuuRpcResponse = VuuRpcResponse>(
647
655
  rpcRequest: Omit<VuuRpcRequest, "vpId">,
648
656
  ) => Promise<T>;
649
- openTreeNode: (key: string) => void;
657
+ openTreeNode: (keyOrIndex: string | number) => void;
650
658
  range: VuuRange;
651
659
  remoteProcedureCall: <T extends VuuRpcResponse = VuuRpcResponse>(
652
660
  message: VuuRpcRequest,
@@ -849,7 +857,8 @@ export interface VuuUIMessageOutViewRange extends ViewportMessageOut {
849
857
  };
850
858
  }
851
859
  export interface VuuUIMessageOutCloseTreeNode extends ViewportMessageOut {
852
- key: string;
860
+ index?: number;
861
+ key?: string;
853
862
  type: "closeTreeNode";
854
863
  }
855
864
  export interface VuuUIMessageOutRemoveLink extends ViewportMessageOut {
@@ -867,7 +876,8 @@ export interface VuuUIMessageOutEnable extends ViewportMessageOut {
867
876
  type: "enable";
868
877
  }
869
878
  export interface VuuUIMessageOutOpenTreeNode extends ViewportMessageOut {
870
- key: string;
879
+ index?: number;
880
+ key?: string;
871
881
  type: "openTreeNode";
872
882
  }
873
883
  export interface VuuUIMessageOutResume extends ViewportMessageOut {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-data-types",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
7
- "@vuu-ui/vuu-filter-types": "0.9.0",
8
- "@vuu-ui/vuu-protocol-types": "0.9.0"
7
+ "@vuu-ui/vuu-filter-types": "0.9.2",
8
+ "@vuu-ui/vuu-protocol-types": "0.9.2"
9
9
  },
10
10
  "dependencies": {},
11
11
  "peerDependencies": {},