@vuu-ui/vuu-utils 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.
- package/cjs/DataWindow.js.map +1 -1
- package/cjs/ShellContext.js.map +1 -1
- package/cjs/ThemeProvider.js.map +1 -1
- package/cjs/array-utils.js.map +1 -1
- package/cjs/box-utils.js +43 -0
- package/cjs/box-utils.js.map +1 -1
- package/cjs/column-utils.js +74 -51
- package/cjs/column-utils.js.map +1 -1
- package/cjs/common-types.js.map +1 -1
- package/cjs/component-registry.js.map +1 -1
- package/cjs/context-definitions/DataSourceContext.js.map +1 -1
- package/cjs/context-definitions/DataSourceProvider.js.map +1 -1
- package/cjs/context-definitions/WorkspaceContext.js.map +1 -1
- package/cjs/cookie-utils.js.map +1 -1
- package/cjs/css-utils.js.map +1 -1
- package/cjs/data-utils.js +14 -0
- package/cjs/data-utils.js.map +1 -1
- package/cjs/datasource/BaseDataSource.js.map +1 -1
- package/cjs/datasource/datasource-action-utils.js.map +1 -1
- package/cjs/datasource/datasource-filter-utils.js.map +1 -1
- package/cjs/datasource/datasource-utils.js.map +1 -1
- package/cjs/date/date-utils.js.map +1 -1
- package/cjs/date/dateTimePattern.js.map +1 -1
- package/cjs/date/formatter.js.map +1 -1
- package/cjs/date/types.js.map +1 -1
- package/cjs/debug-utils.js.map +1 -1
- package/cjs/event-emitter.js +1 -0
- package/cjs/event-emitter.js.map +1 -1
- package/cjs/feature-utils.js +43 -55
- package/cjs/feature-utils.js.map +1 -1
- package/cjs/filters/filter-utils.js.map +1 -1
- package/cjs/filters/filterAsQuery.js.map +1 -1
- package/cjs/form-utils.js +2 -0
- package/cjs/form-utils.js.map +1 -1
- package/cjs/formatting-utils.js +2 -0
- package/cjs/formatting-utils.js.map +1 -1
- package/cjs/group-utils.js.map +1 -1
- package/cjs/html-utils.js.map +1 -1
- package/cjs/index.js +18 -2
- package/cjs/index.js.map +1 -1
- package/cjs/input-utils.js.map +1 -1
- package/cjs/invariant.js.map +1 -1
- package/cjs/itemToString.js.map +1 -1
- package/cjs/json-utils.js.map +1 -1
- package/cjs/keyboard-utils.js.map +1 -1
- package/cjs/keyset.js.map +1 -1
- package/cjs/list-utils.js.map +1 -1
- package/cjs/local-storage-utils.js.map +1 -1
- package/cjs/logging-utils.js.map +1 -1
- package/cjs/menu-utils.js.map +1 -1
- package/cjs/module-utils.js +0 -6
- package/cjs/module-utils.js.map +1 -1
- package/cjs/nanoid/index.js.map +1 -1
- package/cjs/perf-utils.js.map +1 -1
- package/cjs/promise-utils.js +1 -1
- package/cjs/promise-utils.js.map +1 -1
- package/cjs/protocol-message-utils.js +2 -0
- package/cjs/protocol-message-utils.js.map +1 -1
- package/cjs/range-utils.js.map +1 -1
- package/cjs/react-utils.js +15 -0
- package/cjs/react-utils.js.map +1 -1
- package/cjs/round-decimal.js.map +1 -1
- package/cjs/row-utils.js.map +1 -1
- package/cjs/selection-utils.js +2 -2
- package/cjs/selection-utils.js.map +1 -1
- package/cjs/shell-layout-types.js.map +1 -1
- package/cjs/sort-utils.js.map +1 -1
- package/cjs/table-schema-utils.js.map +1 -1
- package/cjs/text-utils.js.map +1 -1
- package/cjs/tree-utils.js +44 -4
- package/cjs/tree-utils.js.map +1 -1
- package/cjs/ts-utils.js +2 -0
- package/cjs/ts-utils.js.map +1 -1
- package/cjs/url-utils.js.map +1 -1
- package/cjs/useId.js.map +1 -1
- package/cjs/useLayoutEffectSkipFirst.js.map +1 -1
- package/cjs/useStateRef.js.map +1 -1
- package/esm/DataWindow.js.map +1 -1
- package/esm/ShellContext.js.map +1 -1
- package/esm/ThemeProvider.js.map +1 -1
- package/esm/array-utils.js.map +1 -1
- package/esm/box-utils.js +40 -1
- package/esm/box-utils.js.map +1 -1
- package/esm/column-utils.js +74 -52
- package/esm/column-utils.js.map +1 -1
- package/esm/common-types.js.map +1 -1
- package/esm/component-registry.js.map +1 -1
- package/esm/context-definitions/DataSourceContext.js.map +1 -1
- package/esm/context-definitions/DataSourceProvider.js.map +1 -1
- package/esm/context-definitions/WorkspaceContext.js.map +1 -1
- package/esm/cookie-utils.js.map +1 -1
- package/esm/css-utils.js.map +1 -1
- package/esm/data-utils.js +14 -1
- package/esm/data-utils.js.map +1 -1
- package/esm/datasource/BaseDataSource.js.map +1 -1
- package/esm/datasource/datasource-action-utils.js.map +1 -1
- package/esm/datasource/datasource-filter-utils.js.map +1 -1
- package/esm/datasource/datasource-utils.js.map +1 -1
- package/esm/date/date-utils.js.map +1 -1
- package/esm/date/dateTimePattern.js.map +1 -1
- package/esm/date/formatter.js.map +1 -1
- package/esm/date/types.js.map +1 -1
- package/esm/debug-utils.js.map +1 -1
- package/esm/event-emitter.js +1 -0
- package/esm/event-emitter.js.map +1 -1
- package/esm/feature-utils.js +42 -55
- package/esm/feature-utils.js.map +1 -1
- package/esm/filters/filter-utils.js.map +1 -1
- package/esm/filters/filterAsQuery.js.map +1 -1
- package/esm/form-utils.js +2 -1
- package/esm/form-utils.js.map +1 -1
- package/esm/formatting-utils.js +2 -1
- package/esm/formatting-utils.js.map +1 -1
- package/esm/group-utils.js.map +1 -1
- package/esm/html-utils.js.map +1 -1
- package/esm/index.js +11 -11
- package/esm/input-utils.js.map +1 -1
- package/esm/invariant.js.map +1 -1
- package/esm/itemToString.js.map +1 -1
- package/esm/json-utils.js.map +1 -1
- package/esm/keyboard-utils.js.map +1 -1
- package/esm/keyset.js.map +1 -1
- package/esm/list-utils.js.map +1 -1
- package/esm/local-storage-utils.js.map +1 -1
- package/esm/logging-utils.js.map +1 -1
- package/esm/menu-utils.js.map +1 -1
- package/esm/module-utils.js +1 -6
- package/esm/module-utils.js.map +1 -1
- package/esm/nanoid/index.js.map +1 -1
- package/esm/perf-utils.js.map +1 -1
- package/esm/promise-utils.js +1 -1
- package/esm/promise-utils.js.map +1 -1
- package/esm/protocol-message-utils.js +2 -1
- package/esm/protocol-message-utils.js.map +1 -1
- package/esm/range-utils.js.map +1 -1
- package/esm/react-utils.js +15 -2
- package/esm/react-utils.js.map +1 -1
- package/esm/round-decimal.js.map +1 -1
- package/esm/row-utils.js.map +1 -1
- package/esm/selection-utils.js +2 -2
- package/esm/selection-utils.js.map +1 -1
- package/esm/shell-layout-types.js.map +1 -1
- package/esm/sort-utils.js.map +1 -1
- package/esm/table-schema-utils.js.map +1 -1
- package/esm/text-utils.js.map +1 -1
- package/esm/tree-utils.js +41 -5
- package/esm/tree-utils.js.map +1 -1
- package/esm/ts-utils.js +2 -1
- package/esm/ts-utils.js.map +1 -1
- package/esm/url-utils.js.map +1 -1
- package/esm/useId.js.map +1 -1
- package/esm/useLayoutEffectSkipFirst.js.map +1 -1
- package/esm/useStateRef.js.map +1 -1
- package/package.json +8 -8
- package/types/ShellContext.d.ts +0 -1
- package/types/ThemeProvider.d.ts +1 -1
- package/types/box-utils.d.ts +15 -0
- package/types/column-utils.d.ts +20 -7
- package/types/context-definitions/DataSourceContext.d.ts +0 -1
- package/types/context-definitions/DataSourceProvider.d.ts +2 -2
- package/types/data-utils.d.ts +1 -0
- package/types/date/types.d.ts +2 -2
- package/types/feature-utils.d.ts +18 -5
- package/types/filters/filter-utils.d.ts +37 -37
- package/types/form-utils.d.ts +2 -1
- package/types/formatting-utils.d.ts +7 -0
- package/types/module-utils.d.ts +1 -3
- package/types/protocol-message-utils.d.ts +1 -0
- package/types/react-utils.d.ts +3 -1
- package/types/row-utils.d.ts +2 -1
- package/types/selection-utils.d.ts +1 -1
- package/types/tree-types.d.ts +3 -12
- package/types/tree-utils.d.ts +4 -0
- package/types/ts-utils.d.ts +17 -0
package/types/column-utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataSourceRow, DataValueType, DataValueTypeSimple, DateTimeDataValueDescriptor, SchemaColumn, TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
import type { VuuAggType, VuuAggregation, VuuColumnDataType, VuuDataRow, VuuGroupBy, VuuRowRecord, VuuSort } from "@vuu-ui/vuu-protocol-types";
|
|
3
3
|
import type { ColumnAlignment, ColumnDescriptor, ColumnLayout, DataValueTypeDescriptor, ColumnTypeFormatting, ColumnTypeRendering, ColumnTypeWithValidationRules, DefaultColumnConfiguration, GroupColumnDescriptor, LookupRenderer, MappedValueTypeRenderer, PinLocation, RuntimeColumnDescriptor, TableCellRendererProps, TableConfig, TableHeadings, ValueListRenderer } from "@vuu-ui/vuu-table-types";
|
|
4
|
-
import type
|
|
4
|
+
import { type CSSProperties } from "react";
|
|
5
5
|
import { TableModel } from "@vuu-ui/vuu-table";
|
|
6
6
|
/**
|
|
7
7
|
* ColumnMap provides a lookup of the index position of a data item within a row
|
|
@@ -10,6 +10,9 @@ import { TableModel } from "@vuu-ui/vuu-table";
|
|
|
10
10
|
export interface ColumnMap {
|
|
11
11
|
[columnName: string]: number;
|
|
12
12
|
}
|
|
13
|
+
export interface ReverseColumnMap {
|
|
14
|
+
[columnIndex: number]: string;
|
|
15
|
+
}
|
|
13
16
|
export type SortCriteriaItem = string | [string, "asc"];
|
|
14
17
|
export declare const AggregationType: {
|
|
15
18
|
[key: string]: VuuAggType;
|
|
@@ -45,6 +48,7 @@ export declare const isValueListRenderer: (renderer?: unknown) => renderer is Va
|
|
|
45
48
|
export declare const hasValidationRules: (type?: DataValueType) => type is ColumnTypeWithValidationRules;
|
|
46
49
|
export declare const isMappedValueTypeRenderer: (renderer?: unknown) => renderer is MappedValueTypeRenderer;
|
|
47
50
|
export declare function buildColumnMap(columns?: (RuntimeColumnDescriptor | SchemaColumn | string)[]): ColumnMap;
|
|
51
|
+
export declare function buildReverseColumnMap(columns?: (RuntimeColumnDescriptor | SchemaColumn | string)[]): ReverseColumnMap;
|
|
48
52
|
export declare function projectUpdates(updates: number[]): number[];
|
|
49
53
|
export declare const metadataKeys: {
|
|
50
54
|
readonly IDX: 0;
|
|
@@ -62,7 +66,10 @@ export declare const metadataKeys: {
|
|
|
62
66
|
readonly NEXT_FILTER_IDX: "next_filter_idx";
|
|
63
67
|
};
|
|
64
68
|
export declare const flattenColumnGroup: (columns: RuntimeColumnDescriptor[]) => RuntimeColumnDescriptor[];
|
|
65
|
-
export declare function extractGroupColumn(
|
|
69
|
+
export declare function extractGroupColumn({ availableWidth, columns, groupBy, confirmed, }: ColumnGroupProps): [
|
|
70
|
+
GroupColumnDescriptor | null,
|
|
71
|
+
RuntimeColumnDescriptor[]
|
|
72
|
+
];
|
|
66
73
|
export declare const isGroupColumn: (column: RuntimeColumnDescriptor) => column is GroupColumnDescriptor;
|
|
67
74
|
/**
|
|
68
75
|
* groupConfirmed is currently the only 'pending' attribute we use. A
|
|
@@ -82,7 +89,13 @@ export declare const measurePinnedColumns: (columns: RuntimeColumnDescriptor[],
|
|
|
82
89
|
export declare const getTableHeadings: (columns: RuntimeColumnDescriptor[]) => TableHeadings;
|
|
83
90
|
export declare const getColumnStyle: ({ pin, pinnedOffset, width, }: RuntimeColumnDescriptor) => CSSProperties;
|
|
84
91
|
export declare const setAggregations: (aggregations: VuuAggregation[], column: RuntimeColumnDescriptor, aggType: VuuAggType) => VuuAggregation[];
|
|
85
|
-
export
|
|
92
|
+
export type ColumnGroupProps = {
|
|
93
|
+
columns: RuntimeColumnDescriptor[];
|
|
94
|
+
groupBy: VuuGroupBy;
|
|
95
|
+
confirmed?: boolean;
|
|
96
|
+
availableWidth: number;
|
|
97
|
+
};
|
|
98
|
+
export declare const applyGroupByToColumns: (props: ColumnGroupProps) => RuntimeColumnDescriptor[];
|
|
86
99
|
export declare const applySortToColumns: (columns: RuntimeColumnDescriptor[], sort: VuuSort) => RuntimeColumnDescriptor[];
|
|
87
100
|
export declare const removeSort: (columns: RuntimeColumnDescriptor[]) => RuntimeColumnDescriptor[];
|
|
88
101
|
export declare const existingSort: (columns: RuntimeColumnDescriptor[]) => boolean;
|
|
@@ -98,16 +111,16 @@ export declare const getColumnsInViewport: (columns: RuntimeColumnDescriptor[],
|
|
|
98
111
|
export declare const isNotHidden: (column: RuntimeColumnDescriptor) => boolean;
|
|
99
112
|
export declare const visibleColumnAtIndex: (columns: RuntimeColumnDescriptor[], index: number) => RuntimeColumnDescriptor | undefined;
|
|
100
113
|
export declare const getGroupIcon: (columns: RuntimeColumnDescriptor[], row: DataSourceRow) => string | undefined;
|
|
101
|
-
export declare const getGroupValue: (columns: RuntimeColumnDescriptor[], row: DataSourceRow, columnMap: ColumnMap) =>
|
|
114
|
+
export declare const getGroupValue: (columns: RuntimeColumnDescriptor[], row: DataSourceRow, columnMap: ColumnMap) => string | null;
|
|
102
115
|
export declare const getDefaultColumnType: (serverDataType?: VuuColumnDataType) => DataValueTypeSimple;
|
|
103
116
|
export declare const updateColumnFormatting: <T extends ColumnDescriptor = ColumnDescriptor>(column: T, formatting: ColumnTypeFormatting) => T;
|
|
104
117
|
export declare function updateColumnType<T extends ColumnDescriptor = ColumnDescriptor>(column: T, type: DataValueTypeSimple): T;
|
|
105
118
|
export declare const updateColumnRenderProps: <T extends ColumnDescriptor = ColumnDescriptor>(column: T, renderer: ColumnTypeRendering) => T;
|
|
106
119
|
export declare const getTypeFormattingFromColumn: (column: ColumnDescriptor) => ColumnTypeFormatting;
|
|
107
120
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
121
|
+
* Return a filter predicate that will reject columns, names of which
|
|
122
|
+
* are not in provided list. Exception made for columns explicitly
|
|
123
|
+
* configured as client columns.
|
|
111
124
|
*/
|
|
112
125
|
export declare const subscribedOnly: (columnNames?: string[]) => (column: ColumnDescriptor) => boolean | undefined;
|
|
113
126
|
export declare const addColumnToSubscribedColumns: (subscribedColumns: ColumnDescriptor[], availableColumns: SchemaColumn[], columnName: string) => ColumnDescriptor[];
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import { DataSourceContextProps } from "./DataSourceContext";
|
|
3
3
|
export declare const DataSourceProvider: ({ children, getServerAPI, isLocalData, VuuDataSource, vuuModuleNames, }: Omit<DataSourceContextProps, "isLocalData"> & {
|
|
4
4
|
children: ReactNode;
|
|
5
|
-
isLocalData?: boolean
|
|
6
|
-
}) => JSX.Element;
|
|
5
|
+
isLocalData?: boolean;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const useDataSource: () => DataSourceContextProps;
|
|
8
8
|
export declare const useDataSourceExtensions: () => unknown;
|
package/types/data-utils.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export declare const shallowEquals: (o1?: {
|
|
|
16
16
|
export declare function getMovingValueDirection(newValue?: number, direction?: valueChangeDirection, prevValue?: number,
|
|
17
17
|
/** the number of decimal places to take into account when highlighting a change */
|
|
18
18
|
decimalPlaces?: number): valueChangeDirection;
|
|
19
|
+
export declare function asInteger(index: number | string | undefined, defaultValue?: number): number;
|
package/types/date/types.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type DateTimePattern = {
|
|
|
18
18
|
date: DatePattern;
|
|
19
19
|
time?: TimePattern;
|
|
20
20
|
};
|
|
21
|
-
export declare const isDatePattern: (pattern?: string) => pattern is
|
|
22
|
-
export declare const isTimePattern: (pattern?: string) => pattern is
|
|
21
|
+
export declare const isDatePattern: (pattern?: string) => pattern is DatePattern;
|
|
22
|
+
export declare const isTimePattern: (pattern?: string) => pattern is TimePattern;
|
|
23
23
|
export declare const isDateTimePattern: (pattern?: ColumnTypeFormatting["pattern"]) => pattern is DateTimePattern;
|
|
24
24
|
export {};
|
package/types/feature-utils.d.ts
CHANGED
|
@@ -39,8 +39,7 @@ export interface DynamicFeatureDescriptor {
|
|
|
39
39
|
css?: string;
|
|
40
40
|
leftNavLocation: "vuu-features" | "vuu-tables";
|
|
41
41
|
featureProps?: {
|
|
42
|
-
|
|
43
|
-
schemas?: VuuTable[];
|
|
42
|
+
vuuTables?: "*" | VuuTable[];
|
|
44
43
|
};
|
|
45
44
|
viewProps?: ViewConfig;
|
|
46
45
|
}
|
|
@@ -65,13 +64,19 @@ export interface VuuConfig {
|
|
|
65
64
|
websocketUrl: string;
|
|
66
65
|
ssl: boolean;
|
|
67
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* We currently categorize 'features' simply by the leftNavLocation
|
|
69
|
+
* @param feature
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
68
72
|
export declare const isCustomFeature: (feature: DynamicFeatureDescriptor) => boolean;
|
|
69
|
-
export declare const isWildcardSchema: (
|
|
70
|
-
export declare const
|
|
73
|
+
export declare const isWildcardSchema: (vuuTables?: "*" | VuuTable[]) => vuuTables is "*";
|
|
74
|
+
export declare const isVuuTables: (vuuTables?: "*" | VuuTable[]) => vuuTables is VuuTable[];
|
|
71
75
|
export interface FeaturePropsWithFilterTableFeature extends Omit<DynamicFeatureProps, "ComponentProps"> {
|
|
72
76
|
ComponentProps: FilterTableFeatureProps;
|
|
73
77
|
}
|
|
74
78
|
export declare const hasFilterTableFeatureProps: (props: DynamicFeatureProps) => props is FeaturePropsWithFilterTableFeature;
|
|
79
|
+
export declare const isSameTable: (t1: VuuTable, t2: VuuTable) => void;
|
|
75
80
|
export declare const byModule: (schema1: TableSchema, schema2: TableSchema) => 0 | 1 | -1;
|
|
76
81
|
export type GetFeaturePaths = (params: {
|
|
77
82
|
env: Environment;
|
|
@@ -85,7 +90,15 @@ export type Component = {
|
|
|
85
90
|
};
|
|
86
91
|
export declare const assertComponentRegistered: (componentName: string, component: unknown) => void;
|
|
87
92
|
export declare const assertComponentsRegistered: (componentList: Component[]) => void;
|
|
88
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Process the DynamicFeature descriptors. Identify
|
|
95
|
+
* the vuu tables required and inject the appropriate TableSchemas
|
|
96
|
+
*
|
|
97
|
+
* @param dynamicFeatures
|
|
98
|
+
* @param tableSchemas
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
export declare const getCustomAndTableFeatures: (dynamicFeatures: DynamicFeatureDescriptor[], tableSchemas: TableSchema[]) => {
|
|
89
102
|
dynamicFeatures: DynamicFeatureProps[];
|
|
90
103
|
tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[];
|
|
91
104
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DataSourceFilter } from "@vuu-ui/vuu-data-types";
|
|
3
2
|
import { AndFilter, Filter, FilterClauseOp, FilterWithPartialClause, MultiClauseFilter, MultiValueFilterClause, OrFilter, SingleValueFilterClause } from "@vuu-ui/vuu-filter-types";
|
|
4
3
|
import { ColumnDescriptor, RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
@@ -6,10 +5,10 @@ import { EventEmitter } from "../event-emitter";
|
|
|
6
5
|
import { VuuFilter } from "@vuu-ui/vuu-protocol-types";
|
|
7
6
|
export declare const isValidFilterClauseOp: (op?: string) => op is FilterClauseOp;
|
|
8
7
|
export declare const isNamedFilter: (f?: Filter) => boolean;
|
|
9
|
-
export declare const isSingleValueFilter: (f?: Partial<Filter>) => f is SingleValueFilterClause
|
|
10
|
-
export declare const isFilterClause: (f?: Partial<Filter>) => f is SingleValueFilterClause
|
|
11
|
-
export declare const isMultiValueFilter: (f?: Partial<Filter>) => f is MultiValueFilterClause
|
|
12
|
-
export declare const isInFilter: (f: Partial<Filter>) => f is MultiValueFilterClause
|
|
8
|
+
export declare const isSingleValueFilter: (f?: Partial<Filter>) => f is SingleValueFilterClause;
|
|
9
|
+
export declare const isFilterClause: (f?: Partial<Filter>) => f is SingleValueFilterClause | MultiValueFilterClause;
|
|
10
|
+
export declare const isMultiValueFilter: (f?: Partial<Filter>) => f is MultiValueFilterClause;
|
|
11
|
+
export declare const isInFilter: (f: Partial<Filter>) => f is MultiValueFilterClause;
|
|
13
12
|
export declare const isAndFilter: (f: Partial<Filter>) => f is AndFilter;
|
|
14
13
|
export declare const isOrFilter: (f: Partial<Filter>) => f is OrFilter;
|
|
15
14
|
export declare const isCompleteFilter: (filter: Partial<Filter>) => filter is Filter;
|
|
@@ -17,44 +16,45 @@ export declare function isMultiClauseFilter(f?: Partial<Filter> | FilterWithPart
|
|
|
17
16
|
export declare const applyFilterToColumns: (columns: RuntimeColumnDescriptor[], { filterStruct }: DataSourceFilter) => RuntimeColumnDescriptor[];
|
|
18
17
|
export declare const isFilteredColumn: (column: RuntimeColumnDescriptor) => boolean;
|
|
19
18
|
export declare const stripFilterFromColumns: (columns: RuntimeColumnDescriptor[]) => {
|
|
20
|
-
align?: "left" | "right"
|
|
19
|
+
align?: "left" | "right";
|
|
21
20
|
ariaColIndex: number;
|
|
22
|
-
CellRenderer?: import("react").FunctionComponent<import("@vuu-ui/vuu-table-types").TableCellRendererProps
|
|
23
|
-
HeaderCellLabelRenderer?: import("react").FunctionComponent<import("@vuu-ui/vuu-table-types").HeaderCellProps
|
|
24
|
-
HeaderCellContentRenderer?: import("react").FunctionComponent<import("@vuu-ui/vuu-table-types").HeaderCellProps
|
|
25
|
-
canStretch?: boolean
|
|
26
|
-
className?: string
|
|
27
|
-
clientSideEditValidationCheck?: import("@vuu-ui/vuu-data-types").DataValueValidationChecker
|
|
21
|
+
CellRenderer?: import("react").FunctionComponent<import("@vuu-ui/vuu-table-types").TableCellRendererProps>;
|
|
22
|
+
HeaderCellLabelRenderer?: import("react").FunctionComponent<import("@vuu-ui/vuu-table-types").HeaderCellProps>;
|
|
23
|
+
HeaderCellContentRenderer?: import("react").FunctionComponent<import("@vuu-ui/vuu-table-types").HeaderCellProps>;
|
|
24
|
+
canStretch?: boolean;
|
|
25
|
+
className?: string;
|
|
26
|
+
clientSideEditValidationCheck?: import("@vuu-ui/vuu-data-types").DataValueValidationChecker;
|
|
28
27
|
endPin?: true | undefined;
|
|
29
|
-
flex?: number
|
|
30
|
-
heading?: string[]
|
|
31
|
-
isGroup?: boolean
|
|
32
|
-
isSystemColumn?: boolean
|
|
28
|
+
flex?: number;
|
|
29
|
+
heading?: [...string[]];
|
|
30
|
+
isGroup?: boolean;
|
|
31
|
+
isSystemColumn?: boolean;
|
|
33
32
|
label: string;
|
|
34
|
-
locked?: boolean
|
|
35
|
-
marginLeft?: number
|
|
36
|
-
moving?: boolean
|
|
37
|
-
originalIdx?: number
|
|
38
|
-
pinnedOffset?: number
|
|
39
|
-
resizeable?: boolean
|
|
40
|
-
resizing?: boolean
|
|
41
|
-
sortable?: boolean
|
|
42
|
-
sorted?: import("@vuu-ui/vuu-table-types").ColumnSort
|
|
33
|
+
locked?: boolean;
|
|
34
|
+
marginLeft?: number;
|
|
35
|
+
moving?: boolean;
|
|
36
|
+
originalIdx?: number;
|
|
37
|
+
pinnedOffset?: number;
|
|
38
|
+
resizeable?: boolean;
|
|
39
|
+
resizing?: boolean;
|
|
40
|
+
sortable?: boolean;
|
|
41
|
+
sorted?: import("@vuu-ui/vuu-table-types").ColumnSort;
|
|
43
42
|
valueFormatter: import("@vuu-ui/vuu-table-types").ValueFormatter;
|
|
44
43
|
width: number;
|
|
45
|
-
aggregate?: import("@vuu-ui/vuu-protocol-types").VuuAggType
|
|
46
|
-
colHeaderContentRenderer?: string
|
|
47
|
-
colHeaderLabelRenderer?: string
|
|
48
|
-
getIcon?: (
|
|
49
|
-
hidden?: boolean
|
|
50
|
-
maxWidth?: number
|
|
51
|
-
minWidth?: number
|
|
52
|
-
pin?: import("@vuu-ui/vuu-table-types").PinLocation
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
aggregate?: import("@vuu-ui/vuu-protocol-types").VuuAggType;
|
|
45
|
+
colHeaderContentRenderer?: string;
|
|
46
|
+
colHeaderLabelRenderer?: string;
|
|
47
|
+
getIcon?: (row: import("@vuu-ui/vuu-data-types").DataSourceRow) => string | undefined;
|
|
48
|
+
hidden?: boolean;
|
|
49
|
+
maxWidth?: number;
|
|
50
|
+
minWidth?: number;
|
|
51
|
+
pin?: import("@vuu-ui/vuu-table-types").PinLocation;
|
|
52
|
+
source?: "client" | "server";
|
|
53
|
+
editable?: boolean;
|
|
54
|
+
editableBulk?: import("@vuu-ui/vuu-data-types").BulkEdit;
|
|
55
55
|
name: string;
|
|
56
|
-
serverDataType?: import("@vuu-ui/vuu-protocol-types").VuuColumnDataType
|
|
57
|
-
type?: import("@vuu-ui/vuu-data-types").DataValueType
|
|
56
|
+
serverDataType?: import("@vuu-ui/vuu-protocol-types").VuuColumnDataType;
|
|
57
|
+
type?: import("@vuu-ui/vuu-data-types").DataValueType;
|
|
58
58
|
}[];
|
|
59
59
|
export declare const extractFilterForColumn: (filter: Filter | undefined, columnName: string) => Filter | undefined;
|
|
60
60
|
export type FilterEvents = {
|
package/types/form-utils.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import { KeyboardEvent, SyntheticEvent } from "react";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const getFieldName: (target: EventTarget | HTMLElement) => string;
|
|
9
9
|
export type InputSource = "typeahead-suggestion" | "text-input";
|
|
10
|
-
export
|
|
10
|
+
export declare const isNumber: (type: string, value: VuuRowDataItemType) => value is number;
|
|
11
|
+
export type CommitHandler<E extends HTMLElement = HTMLInputElement, T extends VuuRowDataItemType = VuuRowDataItemType> = (evt: SyntheticEvent<E> | KeyboardEvent<E>, value: T, source?: InputSource) => void;
|
|
11
12
|
/**
|
|
12
13
|
* Convert a string value to the type appropriate for the associated
|
|
13
14
|
* column or form field. Can be used when processing a string value
|
|
@@ -5,3 +5,10 @@ export type ValueFormatters = {
|
|
|
5
5
|
export declare const defaultValueFormatter: (value: unknown) => string;
|
|
6
6
|
export declare const numericFormatter: ({ align, type, }: Partial<ColumnDescriptor>) => (value: unknown) => string;
|
|
7
7
|
export declare const getValueFormatter: (column: ColumnDescriptor, serverDataType?: import("@vuu-ui/vuu-protocol-types").VuuColumnDataType | undefined) => ValueFormatter;
|
|
8
|
+
/**
|
|
9
|
+
* Lowercases a string and returns as Lowercase typescript type
|
|
10
|
+
*
|
|
11
|
+
* @param str the input string
|
|
12
|
+
* @returns str converted to Lowercase
|
|
13
|
+
*/
|
|
14
|
+
export declare const lowerCase: (str: string) => Lowercase<string>;
|
package/types/module-utils.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type ReactComponent = {
|
|
3
2
|
(props?: any): JSX.Element;
|
|
4
3
|
};
|
|
5
|
-
export declare const isModule: (entity: Module | ReactComponent) => entity is Module
|
|
4
|
+
export declare const isModule: (entity: Module | ReactComponent) => entity is Module;
|
|
6
5
|
export interface Module<T = ReactComponent> {
|
|
7
6
|
[key: string]: Module<T> | T;
|
|
8
7
|
}
|
|
9
|
-
export declare const assertModuleExportsAtLeastOneComponent: (module: Module) => void;
|
|
@@ -25,3 +25,4 @@ export declare function isSessionTableActionMessage(rpcResponse: VuuRpcResponse)
|
|
|
25
25
|
export declare function isSessionTableActionMessage(rpcResponse: Omit<VuuRpcResponse, "vpId">): rpcResponse is Omit<VuuRpcMenuSuccess<OpenDialogAction & {
|
|
26
26
|
tableSchema: TableSchema;
|
|
27
27
|
}>, "vpId">;
|
|
28
|
+
export declare const isRpcSuccess: (response: VuuRpcResponse | Omit<VuuRpcResponse, "vpId">) => response is VuuRpcViewportResponse;
|
package/types/react-utils.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from "react";
|
|
1
|
+
import { ReactElement, ReactNode, SetStateAction } from "react";
|
|
2
2
|
export declare const asReactElements: (children: ReactNode) => ReactElement[];
|
|
3
|
+
export declare const useIsMounted: (id?: string) => import("react").MutableRefObject<boolean>;
|
|
4
|
+
export declare const isSimpleStateValue: <T>(arg: SetStateAction<T>) => arg is T;
|
package/types/row-utils.d.ts
CHANGED
|
@@ -20,4 +20,5 @@ export declare const actualRowPositioning: (rowHeight: number) => RowPositioning
|
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
22
|
export declare const virtualRowPositioning: (rowHeight: number, virtualisedExtent: number, pctScrollTop: MutableRefObject<number>) => RowPositioning;
|
|
23
|
-
export
|
|
23
|
+
export type RowToObjectMapper = (row: DataSourceRow, columnMap: ColumnMap) => DataSourceRowObject;
|
|
24
|
+
export declare const asDataSourceRowObject: RowToObjectMapper;
|
package/types/tree-types.d.ts
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
export interface TreeSourceNode {
|
|
1
|
+
export interface TreeSourceNode<T = unknown> {
|
|
2
|
+
nodeData?: T;
|
|
2
3
|
id: string;
|
|
3
4
|
icon?: string;
|
|
4
5
|
header?: boolean;
|
|
5
6
|
label: string;
|
|
6
|
-
childNodes?: TreeSourceNode[];
|
|
7
|
-
}
|
|
8
|
-
export interface NormalisedTreeSourceNode extends TreeSourceNode {
|
|
9
|
-
childNodes?: NormalisedTreeSourceNode[];
|
|
10
|
-
count: number;
|
|
11
|
-
expanded?: boolean;
|
|
12
|
-
index: number;
|
|
13
|
-
level: number;
|
|
14
|
-
}
|
|
15
|
-
export interface NonLeafNode extends NormalisedTreeSourceNode {
|
|
16
|
-
childNodes: NormalisedTreeSourceNode[];
|
|
7
|
+
childNodes?: TreeSourceNode<T>[];
|
|
17
8
|
}
|
package/types/tree-utils.d.ts
CHANGED
|
@@ -3,3 +3,7 @@ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
|
3
3
|
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
4
4
|
import { IconProvider } from "@vuu-ui/vuu-data-local/src/tree-data-source/IconProvider";
|
|
5
5
|
export declare const treeToDataSourceRows: (treeSourceNodes: TreeSourceNode[], iconProvider?: IconProvider) => [ColumnDescriptor[], DataSourceRow[]];
|
|
6
|
+
export declare const lastPathSegment: (path: string, separator?: string) => string;
|
|
7
|
+
export declare const dropLastPathSegment: (path: string, separator?: string) => string;
|
|
8
|
+
export declare const getParentRow: (rows: DataSourceRow[], row: DataSourceRow) => DataSourceRow | undefined;
|
|
9
|
+
export declare const missingAncestor: (row: DataSourceRow, previousRow?: DataSourceRow) => boolean;
|
package/types/ts-utils.d.ts
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
+
import { JSXElementConstructor, ReactElement } from "react";
|
|
2
|
+
import { LayoutJSON } from "./json-types";
|
|
1
3
|
export declare function isNotNullOrUndefined<T>(value: T | undefined | null): value is NonNullable<T>;
|
|
2
4
|
export declare const isObject: (o: unknown) => o is object;
|
|
5
|
+
export type OptionalProperty<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
6
|
+
/**
|
|
7
|
+
* test whether a given react element implements a custom toJSON
|
|
8
|
+
* serialisation (static) method.
|
|
9
|
+
*/
|
|
10
|
+
type JsonEnabledJSXElementConstructor<P> = JSXElementConstructor<P> & {
|
|
11
|
+
toJSON: (el: ReactElement) => LayoutJSON<any>;
|
|
12
|
+
};
|
|
13
|
+
interface ReactElementWithJSON<P = any, T extends JsonEnabledJSXElementConstructor<any> = JsonEnabledJSXElementConstructor<any>> {
|
|
14
|
+
type: T;
|
|
15
|
+
props: P;
|
|
16
|
+
key: string | null;
|
|
17
|
+
}
|
|
18
|
+
export declare const elementImplementsJSONSerialization: (element: ReactElement) => element is ReactElementWithJSON;
|
|
19
|
+
export {};
|