@vuu-ui/vuu-utils 3.3.9 → 3.3.10
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/package.json +6 -6
- package/types/src/Clock.d.ts +20 -0
- package/types/src/PageVisibilityObserver.d.ts +36 -0
- package/types/src/ScaledDecimal.d.ts +12 -0
- package/types/src/ShellContext.d.ts +11 -0
- package/types/src/ThemeProvider.d.ts +32 -0
- package/types/src/array-utils.d.ts +16 -0
- package/types/src/box-utils.d.ts +24 -0
- package/types/src/broadcast-channel.d.ts +16 -0
- package/types/src/column-utils.d.ts +243 -0
- package/types/src/common-types.d.ts +6 -0
- package/types/src/component-registry.d.ts +65 -0
- package/types/src/context-definitions/DataContext.d.ts +21 -0
- package/types/src/context-definitions/DataProvider.d.ts +7 -0
- package/types/src/context-definitions/DataSourceProvider.d.ts +12 -0
- package/types/src/context-definitions/WorkspaceContext.d.ts +17 -0
- package/types/src/cookie-utils.d.ts +9 -0
- package/types/src/css-utils.d.ts +1 -0
- package/types/src/data-utils.d.ts +33 -0
- package/types/src/datasource/BaseDataSource.d.ts +63 -0
- package/types/src/datasource/datasource-action-utils.d.ts +7 -0
- package/types/src/datasource/datasource-filter-utils.d.ts +2 -0
- package/types/src/datasource/datasource-utils.d.ts +61 -0
- package/types/src/date/date-utils.d.ts +39 -0
- package/types/src/date/dateTimePattern.d.ts +8 -0
- package/types/src/date/formatter.d.ts +9 -0
- package/types/src/date/index.d.ts +4 -0
- package/types/src/date/types.d.ts +29 -0
- package/types/src/debug-utils.d.ts +9 -0
- package/types/src/edit-utils.d.ts +2 -0
- package/types/src/errors.d.ts +2 -0
- package/types/src/event-emitter.d.ts +21 -0
- package/types/src/feature-utils.d.ts +110 -0
- package/types/src/filters/filter-utils.d.ts +75 -0
- package/types/src/filters/filterAsQuery.d.ts +8 -0
- package/types/src/filters/index.d.ts +2 -0
- package/types/src/form-utils.d.ts +37 -0
- package/types/src/formatting-utils.d.ts +14 -0
- package/types/src/getUniqueId.d.ts +1 -0
- package/types/src/group-utils.d.ts +10 -0
- package/types/src/html-utils.d.ts +21 -0
- package/types/src/index.d.ts +76 -0
- package/types/src/input-utils.d.ts +2 -0
- package/types/src/invariant.d.ts +1 -0
- package/types/src/itemToString.d.ts +2 -0
- package/types/src/json-types.d.ts +52 -0
- package/types/src/json-utils.d.ts +6 -0
- package/types/src/keyboard-utils.d.ts +15 -0
- package/types/src/keyset.d.ts +16 -0
- package/types/src/layout-types.d.ts +22 -0
- package/types/src/list-utils.d.ts +2 -0
- package/types/src/local-storage-utils.d.ts +4 -0
- package/types/src/logging-utils.d.ts +45 -0
- package/types/src/module-utils.d.ts +8 -0
- package/types/src/nanoid/index.d.ts +1 -0
- package/types/src/perf-utils.d.ts +5 -0
- package/types/src/promise-utils.d.ts +8 -0
- package/types/src/protocol-message-utils.d.ts +43 -0
- package/types/src/range-utils.d.ts +29 -0
- package/types/src/react-utils.d.ts +15 -0
- package/types/src/round-decimal.d.ts +4 -0
- package/types/src/row-utils.d.ts +28 -0
- package/types/src/selection-utils.d.ts +9 -0
- package/types/src/shell-layout-types.d.ts +15 -0
- package/types/src/sort-utils.d.ts +11 -0
- package/types/src/table-schema-utils.d.ts +5 -0
- package/types/src/text-utils.d.ts +10 -0
- package/types/src/theme-utils.d.ts +14 -0
- package/types/src/tree-types.d.ts +9 -0
- package/types/src/tree-utils.d.ts +9 -0
- package/types/src/ts-utils.d.ts +20 -0
- package/types/src/typeahead-utils.d.ts +1 -0
- package/types/src/url-utils.d.ts +3 -0
- package/types/src/useId.d.ts +1 -0
- package/types/src/useLayoutEffectSkipFirst.d.ts +2 -0
- package/types/src/useResizeObserver.d.ts +15 -0
- package/types/src/useStateRef.d.ts +2 -0
- package/types/src/user-types.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.3.
|
|
2
|
+
"version": "3.3.10",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@dnd-kit/react": "^0.1.21",
|
|
18
|
-
"@vuu-ui/vuu-data-types": "3.3.
|
|
19
|
-
"@vuu-ui/vuu-table-types": "3.3.
|
|
20
|
-
"@vuu-ui/vuu-filter-types": "3.3.
|
|
21
|
-
"@vuu-ui/vuu-protocol-types": "3.3.
|
|
18
|
+
"@vuu-ui/vuu-data-types": "3.3.10",
|
|
19
|
+
"@vuu-ui/vuu-table-types": "3.3.10",
|
|
20
|
+
"@vuu-ui/vuu-filter-types": "3.3.10",
|
|
21
|
+
"@vuu-ui/vuu-protocol-types": "3.3.10"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@internationalized/date": "^3.0.0",
|
|
25
|
-
"@vuu-ui/vuu-filter-parser": "3.3.
|
|
25
|
+
"@vuu-ui/vuu-filter-parser": "3.3.10",
|
|
26
26
|
"clsx": "^2.0.0",
|
|
27
27
|
"react": "^19.2.3",
|
|
28
28
|
"react-dom": "^19.2.3"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ClockProps {
|
|
2
|
+
year?: number;
|
|
3
|
+
month?: number;
|
|
4
|
+
day?: number;
|
|
5
|
+
hours?: number;
|
|
6
|
+
minutes?: number;
|
|
7
|
+
seconds?: number;
|
|
8
|
+
milliseconds?: number;
|
|
9
|
+
}
|
|
10
|
+
export type ClockTimeUnit = "minutes" | "seconds" | "ms";
|
|
11
|
+
export declare class Clock {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(props?: ClockProps);
|
|
14
|
+
goBack(value: number, units?: ClockTimeUnit): this;
|
|
15
|
+
advance(value: number, units?: ClockTimeUnit): this;
|
|
16
|
+
set showCurrentTime(value: boolean);
|
|
17
|
+
toString(): string;
|
|
18
|
+
get now(): number;
|
|
19
|
+
get date(): Date;
|
|
20
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EventEmitter } from "./event-emitter";
|
|
2
|
+
export type PageVisibilityEvents = {
|
|
3
|
+
/**
|
|
4
|
+
* emits when page has been hidden for this period of time
|
|
5
|
+
*/
|
|
6
|
+
"inactive-timeout": () => void;
|
|
7
|
+
/**
|
|
8
|
+
* emits when page is hidden
|
|
9
|
+
*/
|
|
10
|
+
hidden: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* emits when page is made visible
|
|
13
|
+
*/
|
|
14
|
+
visible: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* emits when page visibility status changes
|
|
17
|
+
*/
|
|
18
|
+
visibilityChange: (hidden: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
export interface PageVisibilityObserverConstructorProps {
|
|
21
|
+
/**
|
|
22
|
+
* timeout period in seconds. Defaults to zero which will never timeout
|
|
23
|
+
*/
|
|
24
|
+
inactiveTimeout?: number;
|
|
25
|
+
onHidden?: () => void;
|
|
26
|
+
onInactiveTimeout?: () => void;
|
|
27
|
+
onVisible?: () => void;
|
|
28
|
+
onVisibilityChange?: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare class PageVisibilityObserver extends EventEmitter<PageVisibilityEvents> {
|
|
31
|
+
#private;
|
|
32
|
+
visibilityChangeHandler: () => void;
|
|
33
|
+
constructor({ inactiveTimeout, onHidden, onInactiveTimeout, onVisibilityChange, onVisible, }?: PageVisibilityObserverConstructorProps);
|
|
34
|
+
clear(): void;
|
|
35
|
+
private set hidden(value);
|
|
36
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class ScaledDecimal {
|
|
2
|
+
protected readonly value: string;
|
|
3
|
+
private readonly decimals;
|
|
4
|
+
constructor(value: string, decimals?: number);
|
|
5
|
+
get asLong(): string;
|
|
6
|
+
toJSON(): string;
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ScaledDecimal2: (value: string) => ScaledDecimal;
|
|
10
|
+
export declare const ScaledDecimal4: (value: string) => ScaledDecimal;
|
|
11
|
+
export declare const ScaledDecimal6: (value: string) => ScaledDecimal;
|
|
12
|
+
export declare const ScaledDecimal8: (value: string) => ScaledDecimal;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RpcResponseHandler } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import type { DefaultColumnConfiguration, DefaultTableConfiguration } from "@vuu-ui/vuu-table-types";
|
|
3
|
+
import { LookupTableProvider } from "./feature-utils";
|
|
4
|
+
export interface ShellContextProps {
|
|
5
|
+
getDefaultColumnConfig?: DefaultColumnConfiguration;
|
|
6
|
+
getDefaultTableConfig?: DefaultTableConfiguration;
|
|
7
|
+
getLookupValues?: LookupTableProvider;
|
|
8
|
+
handleRpcResponse?: RpcResponseHandler;
|
|
9
|
+
}
|
|
10
|
+
export declare const ShellContext: import("react").Context<ShellContextProps>;
|
|
11
|
+
export declare const useShellContext: () => ShellContextProps;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare const DEFAULT_DENSITY: Density;
|
|
3
|
+
export declare const DEFAULT_THEME = "salt-theme";
|
|
4
|
+
export declare const DEFAULT_THEME_MODE: ThemeMode;
|
|
5
|
+
export type Density = "high" | "medium" | "low" | "touch";
|
|
6
|
+
export type ThemeMode = "light" | "dark";
|
|
7
|
+
export type TargetElement = "root" | "scope" | "child";
|
|
8
|
+
export interface ThemeContextProps {
|
|
9
|
+
density: Density;
|
|
10
|
+
theme: string;
|
|
11
|
+
themeMode: ThemeMode;
|
|
12
|
+
}
|
|
13
|
+
export declare const ThemeContext: import("react").Context<ThemeContextProps>;
|
|
14
|
+
export type ThemeClasses = [string, string, ThemeMode];
|
|
15
|
+
export type ThemeAttributes = {
|
|
16
|
+
themeClass: string;
|
|
17
|
+
densityClass: string;
|
|
18
|
+
dataMode: ThemeMode;
|
|
19
|
+
};
|
|
20
|
+
export declare const useThemeAttributes: (themeAttributes?: ThemeAttributes) => [string, string, ThemeMode];
|
|
21
|
+
interface ThemeProviderProps {
|
|
22
|
+
applyThemeClasses?: boolean;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
density?: Density;
|
|
25
|
+
theme?: string;
|
|
26
|
+
themeMode?: ThemeMode;
|
|
27
|
+
}
|
|
28
|
+
export declare function ThemeProvider({ applyThemeClasses, children, theme: themeProp, themeMode: themeModeProp, density: densityProp, }: ThemeProviderProps): import("react").JSX.Element;
|
|
29
|
+
export declare namespace ThemeProvider {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type PartitionTest<T> = (value: T, index: number) => boolean;
|
|
2
|
+
export declare function partition<T>(array: T[], test: PartitionTest<T>, pass?: T[], fail?: T[]): [T[], T[]];
|
|
3
|
+
export declare function itemsChanged<T = unknown>(currentItems: T[], newItems: T[], identityProperty?: string): boolean;
|
|
4
|
+
export declare function itemsOrOrderChanged<T = unknown>(currentItems: T[], newItems: T[], identityProperty?: string): boolean;
|
|
5
|
+
export declare const moveItemDeprecated: <T = unknown>(items: T[], item: T, moveTo: number) => T[];
|
|
6
|
+
export declare const moveItem: <T = unknown>(items: T[], fromIndex: number, toIndex: number) => T[];
|
|
7
|
+
export declare const getAddedItems: <T>(values: undefined | T[], newValues: T[]) => T[];
|
|
8
|
+
export declare const getMissingItems: <T, I>(sourceItems: T[], items: I[], identity: (s: T) => I) => I[];
|
|
9
|
+
/**
|
|
10
|
+
* Given an ordered list of item names, return items in same order
|
|
11
|
+
*/
|
|
12
|
+
export declare const reorderItems: <T extends {
|
|
13
|
+
name: string;
|
|
14
|
+
} = {
|
|
15
|
+
name: string;
|
|
16
|
+
}>(originalItems: readonly T[], orderedNames: string[]) => T[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface rect {
|
|
2
|
+
bottom: number;
|
|
3
|
+
left: number;
|
|
4
|
+
right: number;
|
|
5
|
+
top: number;
|
|
6
|
+
}
|
|
7
|
+
export type rectTuple = [number, number, number, number];
|
|
8
|
+
export type dimension = "width" | "height";
|
|
9
|
+
export declare function boxContainsPoint(rect: rect, x: number, y: number): boolean | undefined;
|
|
10
|
+
export type GridLayoutSplitDirection = "north" | "south" | "east" | "west";
|
|
11
|
+
export type GridLayoutDropPosition = GridLayoutSplitDirection | "header" | "centre";
|
|
12
|
+
export declare function getCenteredBox({ right, left, top, bottom }: rect, pctSize: number): {
|
|
13
|
+
left: number;
|
|
14
|
+
top: number;
|
|
15
|
+
right: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function pointPositionWithinRect(x: number, y: number, rect: rect, borderZone?: number): {
|
|
19
|
+
pctX: number;
|
|
20
|
+
pctY: number;
|
|
21
|
+
closeToTheEdge: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const isGridLayoutSplitDirection: (position: GridLayoutDropPosition) => position is GridLayoutSplitDirection;
|
|
24
|
+
export declare function getPositionWithinBox(x: number, y: number, rect: rect, pctX: number, pctY: number): GridLayoutDropPosition;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface VuuBroadcastChannelEventMap<T> {
|
|
2
|
+
message: MessageEvent<T>;
|
|
3
|
+
messageerror: MessageEvent<T>;
|
|
4
|
+
}
|
|
5
|
+
export interface VuuBroadcastChannel<T> extends EventTarget {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
onmessage: ((this: BroadcastChannel, evt: MessageEvent<T>) => void) | null;
|
|
8
|
+
onmessageerror: ((this: BroadcastChannel, evt: MessageEvent<T>) => void) | null;
|
|
9
|
+
close(): void;
|
|
10
|
+
postMessage<M extends T = T>(message: M): void;
|
|
11
|
+
addEventListener<K extends keyof VuuBroadcastChannelEventMap<T>>(type: K, listener: (this: BroadcastChannel, evt: VuuBroadcastChannelEventMap<T>[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
12
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
13
|
+
removeEventListener<K extends keyof VuuBroadcastChannelEventMap<T>>(type: K, listener: (this: BroadcastChannel, evt: VuuBroadcastChannelEventMap<T>[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
14
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { DataSourceRow, DataValueDescriptor, DataValueType, DataValueTypeSimple, DateTimeDataValueDescriptor, SchemaColumn, TableSchema, TimeDataValueDescriptor } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import type { VuuAggType, VuuAggregation, VuuColumnDataType, VuuDataRowDto, VuuGroupBy, VuuSort } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { TableModel } from "@vuu-ui/vuu-table";
|
|
4
|
+
import type { ColumnAlignment, ColumnDescriptor, ColumnLayout, ColumnTypeFormatting, ColumnTypeRendering, ColumnTypeWithValidationRules, DataRow, DataValueTypeDescriptor, DefaultColumnConfiguration, GroupColumnDescriptor, LookupRenderer, MappedValueTypeRenderer, PinLocation, RuntimeColumnDescriptor, TableCellRendererProps, TableConfig, TableHeadings, ValueListRenderer } from "@vuu-ui/vuu-table-types";
|
|
5
|
+
import { type CSSProperties } from "react";
|
|
6
|
+
/**
|
|
7
|
+
* ColumnMap provides a lookup of the index position of a data item within a row
|
|
8
|
+
* by column name.
|
|
9
|
+
*/
|
|
10
|
+
export interface ColumnMap {
|
|
11
|
+
[columnName: string]: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ReverseColumnMap {
|
|
14
|
+
[columnIndex: number]: string;
|
|
15
|
+
}
|
|
16
|
+
export type SortCriteriaItem = string | [string, "asc"];
|
|
17
|
+
export declare const AggregationType: {
|
|
18
|
+
[key: string]: VuuAggType;
|
|
19
|
+
};
|
|
20
|
+
export declare function mapSortCriteria(sortCriteria: SortCriteriaItem[], columnMap: ColumnMap, metadataOffset?: number): [number, "asc"][];
|
|
21
|
+
export declare const getDefaultAlignment: (serverDataType?: VuuColumnDataType) => ColumnAlignment;
|
|
22
|
+
export type EditOperation = "insert" | "update";
|
|
23
|
+
export declare const isDataValueEditable: (dataDescriptor: Pick<DataValueDescriptor, "editable">, operation: EditOperation, defaultValue?: boolean) => boolean;
|
|
24
|
+
export declare const getRuntimeColumnWidth: (col: ColumnDescriptor, runtimeColumns: RuntimeColumnDescriptor[]) => number;
|
|
25
|
+
export declare const applyRuntimeColumnWidthsToConfig: (tableConfig: TableConfig, columns: RuntimeColumnDescriptor[]) => TableConfig;
|
|
26
|
+
export declare const isValidColumnAlignment: (v: string) => v is ColumnAlignment;
|
|
27
|
+
export declare const isValidPinLocation: (v: string) => v is PinLocation;
|
|
28
|
+
export type CalculatedColumn = {
|
|
29
|
+
name: string;
|
|
30
|
+
expression: string;
|
|
31
|
+
serverDataType: VuuColumnDataType;
|
|
32
|
+
};
|
|
33
|
+
export declare const isVuuColumnDataType: (value: string | undefined | null) => value is VuuColumnDataType;
|
|
34
|
+
export declare const fromServerDataType: (serverDataType: VuuColumnDataType) => DataValueTypeSimple;
|
|
35
|
+
export declare const isNanoTimestampColumn: ({ serverDataType, }: DataValueDescriptor) => boolean;
|
|
36
|
+
export declare const isTimestampColumn: (column: ColumnDescriptor) => boolean;
|
|
37
|
+
export declare const isNumericColumn: ({ serverDataType, type }: ColumnDescriptor) => boolean;
|
|
38
|
+
export declare const isDateTimeDataType: (column: ColumnDescriptor) => column is DateTimeDataValueDescriptor;
|
|
39
|
+
export declare const isTimeDataType: (column: ColumnDescriptor) => column is TimeDataValueDescriptor;
|
|
40
|
+
export declare const isDateTimeDataValue: (column: ColumnDescriptor) => boolean;
|
|
41
|
+
export declare const isTimeDataValue: (column?: ColumnDescriptor) => column is TimeDataValueDescriptor;
|
|
42
|
+
export declare const isPinned: (column: ColumnDescriptor) => boolean;
|
|
43
|
+
export declare const hasHeadings: (column: ColumnDescriptor) => boolean;
|
|
44
|
+
export declare const isResizing: (column: RuntimeColumnDescriptor) => boolean | undefined;
|
|
45
|
+
export declare const isTextColumn: ({ serverDataType }: ColumnDescriptor) => boolean;
|
|
46
|
+
export declare const toColumnDescriptor: (name: string, serverDataType?: ColumnDescriptor["serverDataType"]) => ColumnDescriptor;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
export declare const isTypeDescriptor: (type?: DataValueType) => type is DataValueTypeDescriptor;
|
|
51
|
+
export declare const isColumnTypeRenderer: (renderer?: unknown) => renderer is ColumnTypeRendering;
|
|
52
|
+
export declare const hasCustomRenderer: (type?: DataValueType) => type is DataValueTypeDescriptor;
|
|
53
|
+
export declare const isLookupRenderer: (renderer?: unknown) => renderer is LookupRenderer;
|
|
54
|
+
export declare const isValueListRenderer: (renderer?: unknown) => renderer is ValueListRenderer;
|
|
55
|
+
export declare const hasValidationRules: (type?: DataValueType) => type is ColumnTypeWithValidationRules;
|
|
56
|
+
export declare const isMappedValueTypeRenderer: (renderer?: unknown) => renderer is MappedValueTypeRenderer;
|
|
57
|
+
export declare function buildColumnMap(columns?: readonly (ColumnDescriptor | SchemaColumn | string)[]): ColumnMap;
|
|
58
|
+
export declare function projectUpdates(updates: number[]): number[];
|
|
59
|
+
export declare const metadataKeys: {
|
|
60
|
+
readonly IDX: 0;
|
|
61
|
+
readonly RENDER_IDX: 1;
|
|
62
|
+
readonly IS_LEAF: 2;
|
|
63
|
+
readonly IS_EXPANDED: 3;
|
|
64
|
+
readonly DEPTH: 4;
|
|
65
|
+
readonly COUNT: 5;
|
|
66
|
+
readonly KEY: 6;
|
|
67
|
+
readonly SELECTED: 7;
|
|
68
|
+
readonly TIMESTAMP: 8;
|
|
69
|
+
readonly IS_NEW: 9;
|
|
70
|
+
readonly count: 10;
|
|
71
|
+
readonly PARENT_IDX: "parent_idx";
|
|
72
|
+
readonly IDX_POINTER: "idx_pointer";
|
|
73
|
+
readonly FILTER_COUNT: "filter_count";
|
|
74
|
+
readonly NEXT_FILTER_IDX: "next_filter_idx";
|
|
75
|
+
};
|
|
76
|
+
export declare const flattenColumnGroup: (columns: RuntimeColumnDescriptor[]) => RuntimeColumnDescriptor[];
|
|
77
|
+
export declare function extractGroupColumn({ availableWidth, columns, groupBy, confirmed, }: ColumnGroupProps): [
|
|
78
|
+
GroupColumnDescriptor | null,
|
|
79
|
+
RuntimeColumnDescriptor[]
|
|
80
|
+
];
|
|
81
|
+
export declare const isGroupColumn: (column: RuntimeColumnDescriptor) => column is GroupColumnDescriptor;
|
|
82
|
+
/**
|
|
83
|
+
* groupConfirmed is currently the only 'pending' attribute we use. A
|
|
84
|
+
* value of true is only reset by a follow-up value of false. Intermediary
|
|
85
|
+
* values of undefined are discounted.
|
|
86
|
+
*/
|
|
87
|
+
export declare const checkConfirmationPending: (previousConfig?: TableModel) => boolean | undefined;
|
|
88
|
+
export declare const isJsonAttribute: (value: unknown) => boolean;
|
|
89
|
+
export declare const isJsonGroup: (column: RuntimeColumnDescriptor, dataRow: DataRow) => boolean;
|
|
90
|
+
export declare const isJsonColumn: (column: RuntimeColumnDescriptor) => boolean;
|
|
91
|
+
export declare const sortPinnedColumns: (columns: RuntimeColumnDescriptor[], selectionBookendWidth?: number) => RuntimeColumnDescriptor[];
|
|
92
|
+
export declare const measurePinnedColumns: (columns: RuntimeColumnDescriptor[], selectionEndSize: number) => {
|
|
93
|
+
pinnedWidthLeft: number;
|
|
94
|
+
pinnedWidthRight: number;
|
|
95
|
+
unpinnedWidth: number;
|
|
96
|
+
};
|
|
97
|
+
export declare const getTableHeadings: (columns: RuntimeColumnDescriptor[]) => TableHeadings;
|
|
98
|
+
export declare const getColumnStyle: ({ pin, pinnedOffset, pinnedWidth, width, }: RuntimeColumnDescriptor) => CSSProperties;
|
|
99
|
+
export declare const getAllCellsInColumn: (container: HTMLElement | null, colIndex: number) => HTMLDivElement[];
|
|
100
|
+
export type PinState = {
|
|
101
|
+
/**
|
|
102
|
+
* The pinned 'endPin' cell
|
|
103
|
+
*/
|
|
104
|
+
cell: HTMLElement;
|
|
105
|
+
/**
|
|
106
|
+
* With multiple columns pinned, left pinned columns that follow
|
|
107
|
+
* // the resized column. These will need pinOffset adjustments.
|
|
108
|
+
*/
|
|
109
|
+
pinnedCells?: HTMLElement[];
|
|
110
|
+
pinnedWidth: number;
|
|
111
|
+
};
|
|
112
|
+
export declare const getAriaRowIndex: (rowElement: HTMLElement | null) => number;
|
|
113
|
+
export declare const getAriaColIndex: (cellElement: HTMLElement | null) => number;
|
|
114
|
+
export declare const getPinStateFromElement: (cell: HTMLElement) => PinState | undefined;
|
|
115
|
+
export declare const setAggregations: (aggregations: VuuAggregation[], column: ColumnDescriptor, aggType: VuuAggType) => VuuAggregation[];
|
|
116
|
+
export type ColumnGroupProps = {
|
|
117
|
+
columns: RuntimeColumnDescriptor[];
|
|
118
|
+
groupBy: VuuGroupBy;
|
|
119
|
+
confirmed?: boolean;
|
|
120
|
+
availableWidth: number;
|
|
121
|
+
};
|
|
122
|
+
export declare const applyGroupByToColumns: (props: ColumnGroupProps) => RuntimeColumnDescriptor[];
|
|
123
|
+
export declare const applySortToColumns: (columns: RuntimeColumnDescriptor[], sort: VuuSort) => RuntimeColumnDescriptor[];
|
|
124
|
+
export declare const removeSort: (columns: RuntimeColumnDescriptor[]) => RuntimeColumnDescriptor[];
|
|
125
|
+
export declare const existingSort: (columns: RuntimeColumnDescriptor[]) => boolean;
|
|
126
|
+
export declare const getColumnName: (name: string) => string;
|
|
127
|
+
export declare const getColumnLabel: (column: ColumnDescriptor) => string;
|
|
128
|
+
export declare const findColumn: (columns: RuntimeColumnDescriptor[], columnName: string) => RuntimeColumnDescriptor | undefined;
|
|
129
|
+
export declare function updateColumn<T extends ColumnDescriptor>(columns: readonly T[], column: T): T[];
|
|
130
|
+
export declare function updateColumn(columns: readonly RuntimeColumnDescriptor[], column: string, options: Partial<ColumnDescriptor>): RuntimeColumnDescriptor[];
|
|
131
|
+
export declare const toDataSourceColumns: (column: ColumnDescriptor) => string;
|
|
132
|
+
export declare const dataSourceRowToDataRowDto: (row: DataSourceRow, columnMap: ColumnMap) => VuuDataRowDto;
|
|
133
|
+
export declare const isDataLoading: (columns: RuntimeColumnDescriptor[]) => boolean;
|
|
134
|
+
export declare const getColumnsInViewport: (columns: RuntimeColumnDescriptor[], vpStart: number, vpEnd: number) => [RuntimeColumnDescriptor[], number];
|
|
135
|
+
export declare const isNotHidden: (column: RuntimeColumnDescriptor) => boolean;
|
|
136
|
+
export declare const visibleColumnAtIndex: (columns: RuntimeColumnDescriptor[], index: number) => RuntimeColumnDescriptor | undefined;
|
|
137
|
+
export declare const getGroupIcon: (columns: RuntimeColumnDescriptor[], dataRow: DataRow) => string | undefined;
|
|
138
|
+
export declare const getGroupValue: (columns: RuntimeColumnDescriptor[], dataRow: DataRow) => string | null;
|
|
139
|
+
export declare const getDefaultColumnType: (serverDataType?: VuuColumnDataType) => DataValueTypeSimple;
|
|
140
|
+
export declare const updateColumnFormatting: <T extends ColumnDescriptor = ColumnDescriptor>(column: T, formatting: ColumnTypeFormatting) => T;
|
|
141
|
+
export declare function updateColumnType<T extends ColumnDescriptor = ColumnDescriptor>(column: T, type: DataValueTypeSimple): T;
|
|
142
|
+
export declare const updateColumnRenderProps: <T extends ColumnDescriptor = ColumnDescriptor>(column: T, renderer: ColumnTypeRendering) => T;
|
|
143
|
+
export declare const getTypeFormattingFromColumn: (column: ColumnDescriptor) => ColumnTypeFormatting;
|
|
144
|
+
/**
|
|
145
|
+
* Check that columnDescriptors are included in provided list of subscribec column names (unless they
|
|
146
|
+
* atr 'client side' columns).
|
|
147
|
+
*/
|
|
148
|
+
export declare const assertAllColumnsAreIncludedInSubscription: (columns: readonly ColumnDescriptor[], columnNames: string[]) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Return a filter predicate that will reject columns, names of which
|
|
151
|
+
* are not in provided list. Exception made for columns explicitly
|
|
152
|
+
* configured as client columns.
|
|
153
|
+
*/
|
|
154
|
+
export declare const subscribedOnly: (columnNames?: string[]) => (column: ColumnDescriptor) => boolean | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Called from TableSettings.ColumnList when a column is added to subscription.
|
|
157
|
+
*
|
|
158
|
+
* @param subscribedColumns
|
|
159
|
+
* @param availableColumns
|
|
160
|
+
* @param columnName
|
|
161
|
+
* @returns
|
|
162
|
+
*/
|
|
163
|
+
export declare const addColumnToSubscribedColumns: (subscribedColumns: readonly ColumnDescriptor[], availableColumns: readonly SchemaColumn[], columnName: string) => ColumnDescriptor[];
|
|
164
|
+
export declare function getServerDataType(column: ColumnDescriptor): VuuColumnDataType | undefined;
|
|
165
|
+
export declare function getServerDataType(column: ColumnDescriptor, throwIfUndefined: true): VuuColumnDataType;
|
|
166
|
+
export declare const isCalculatedColumn: (columnName?: string) => boolean;
|
|
167
|
+
export declare const getCalculatedColumnDetails: (column: ColumnDescriptor | string) => Partial<CalculatedColumn>;
|
|
168
|
+
export declare const setCalculatedColumnName: (column: ColumnDescriptor, name: string) => ColumnDescriptor;
|
|
169
|
+
export declare const setCalculatedColumnType: (column: ColumnDescriptor, serverDataType: VuuColumnDataType) => ColumnDescriptor;
|
|
170
|
+
export declare const setCalculatedColumnExpression: (column: ColumnDescriptor, expression: string) => ColumnDescriptor;
|
|
171
|
+
export declare const moveColumnTo: (columns: ColumnDescriptor[], column: ColumnDescriptor, newIndex: number) => ColumnDescriptor[];
|
|
172
|
+
export declare function replaceColumn<C extends ColumnDescriptor = RuntimeColumnDescriptor>(columns: readonly C[], column: C): C[];
|
|
173
|
+
export declare const applyDefaultColumnConfig: ({ columns: columnsProp, table }: TableSchema, getDefaultColumnConfig?: DefaultColumnConfiguration, includeVuuDefaultColumns?: boolean) => (SchemaColumn | {
|
|
174
|
+
aggregate?: VuuAggType;
|
|
175
|
+
align?: ColumnAlignment;
|
|
176
|
+
allowColumnHeaderMenu?: false;
|
|
177
|
+
className?: string;
|
|
178
|
+
colHeaderContentRenderer?: string;
|
|
179
|
+
colHeaderLabelRenderer?: string;
|
|
180
|
+
exportFormatter?: (value: unknown) => string;
|
|
181
|
+
flex?: number;
|
|
182
|
+
getIcon?: (row: DataRow) => string | undefined;
|
|
183
|
+
groupable?: boolean;
|
|
184
|
+
heading?: string[];
|
|
185
|
+
hidden?: boolean;
|
|
186
|
+
isSystemColumn?: boolean;
|
|
187
|
+
locked?: Exclude<PinLocation, "left"> | false;
|
|
188
|
+
maxWidth?: number;
|
|
189
|
+
minWidth?: number;
|
|
190
|
+
pin?: PinLocation | false;
|
|
191
|
+
removeable?: boolean;
|
|
192
|
+
resizeable?: boolean;
|
|
193
|
+
selected?: boolean;
|
|
194
|
+
sortable?: boolean;
|
|
195
|
+
source?: "client" | "server";
|
|
196
|
+
status?: import("@salt-ds/core").ValidationStatus;
|
|
197
|
+
width?: number;
|
|
198
|
+
editableBulk?: import("@vuu-ui/vuu-data-types").BulkEdit;
|
|
199
|
+
label?: string;
|
|
200
|
+
required?: boolean;
|
|
201
|
+
type?: DataValueType;
|
|
202
|
+
editable?: import("@vuu-ui/vuu-data-types").DataEditable | undefined;
|
|
203
|
+
name: string;
|
|
204
|
+
serverDataType: VuuColumnDataType;
|
|
205
|
+
})[] | readonly SchemaColumn[];
|
|
206
|
+
export type columnOptions = {
|
|
207
|
+
availableWidth?: number;
|
|
208
|
+
columnLayout?: ColumnLayout;
|
|
209
|
+
defaultWidth?: number;
|
|
210
|
+
defaultMinWidth?: number;
|
|
211
|
+
defaultMaxWidth?: number;
|
|
212
|
+
defaultFlex?: number;
|
|
213
|
+
};
|
|
214
|
+
type ColumnLayoutOptions = Pick<columnOptions, "defaultMinWidth" | "defaultMaxWidth" | "defaultWidth">;
|
|
215
|
+
interface StaticColumnLayoutOptions extends ColumnLayoutOptions {
|
|
216
|
+
columnLayout: "manual" | "static";
|
|
217
|
+
}
|
|
218
|
+
interface FitColumnLayoutOptions extends ColumnLayoutOptions {
|
|
219
|
+
availableWidth?: number;
|
|
220
|
+
columnLayout: "fit";
|
|
221
|
+
}
|
|
222
|
+
export declare function applyWidthToColumns(columns: RuntimeColumnDescriptor[], options: StaticColumnLayoutOptions | FitColumnLayoutOptions): RuntimeColumnDescriptor[];
|
|
223
|
+
/**
|
|
224
|
+
* A memo compare function for cell renderers. Can be used to suppress
|
|
225
|
+
* render where column and data are both unchanged. Avoids render
|
|
226
|
+
* when row changes, where changes in row are unrelated to this cell.
|
|
227
|
+
* Suitabnle only for readonly cell renderers. See below for editable
|
|
228
|
+
* cell renderers.
|
|
229
|
+
*/
|
|
230
|
+
export declare const dataAndColumnUnchanged: (p: TableCellRendererProps, p1: TableCellRendererProps) => boolean;
|
|
231
|
+
/**
|
|
232
|
+
* A memo compare function for cell renderers. Can be used to suppress
|
|
233
|
+
* render where column, row key and data are all unchanged. Avoids render
|
|
234
|
+
* when row changes, where changes in row are unrelated to this cell.
|
|
235
|
+
* Suitable for editable cells. Including key in compare is not strictly
|
|
236
|
+
* necessary for rendering, but it is important in the event that user
|
|
237
|
+
* edits data - ensures we never have a stale key.
|
|
238
|
+
*/
|
|
239
|
+
export declare const dataColumnAndKeyUnchanged: (p: TableCellRendererProps, p1: TableCellRendererProps) => boolean;
|
|
240
|
+
export declare const toColumnName: (column: ColumnDescriptor) => string;
|
|
241
|
+
export declare const isStringColumn: (column: ColumnDescriptor) => boolean;
|
|
242
|
+
export declare const columnByAriaIndex: (columns: RuntimeColumnDescriptor[], ariaColIndex: number) => RuntimeColumnDescriptor;
|
|
243
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { EditRuleValidator } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { VuuColumnDataType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { ColumnDescriptor, ColumnDescriptorCustomRenderer, ColumnTypeRendering, DataRow, HeaderCellProps, TableCellRendererProps } from "@vuu-ui/vuu-table-types";
|
|
4
|
+
import { FunctionComponent as FC, HTMLAttributes } from "react";
|
|
5
|
+
export interface CellConfigPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
onConfigChange: () => void;
|
|
7
|
+
}
|
|
8
|
+
export type PropertyChangeHandler = (propertyName: string, propertyValue: string | number | boolean) => void;
|
|
9
|
+
export type ColumnRenderPropsChangeHandler = (renderProps: ColumnTypeRendering) => void;
|
|
10
|
+
export interface ConfigurationEditorProps {
|
|
11
|
+
column: ColumnDescriptorCustomRenderer;
|
|
12
|
+
onChangeRendering: ColumnRenderPropsChangeHandler;
|
|
13
|
+
}
|
|
14
|
+
export type RowClassNameGenerator = (dataRow: DataRow) => string | undefined;
|
|
15
|
+
export type RowClassGenerator = {
|
|
16
|
+
id: string;
|
|
17
|
+
fn: RowClassNameGenerator;
|
|
18
|
+
};
|
|
19
|
+
export type ConfigEditorComponent = FC<CellConfigPanelProps>;
|
|
20
|
+
export type layoutComponentType = "container" | "view";
|
|
21
|
+
export type ComponentType = layoutComponentType | "cell-renderer" | "cell-config-panel" | "column-header-content-renderer" | "column-header-label-renderer" | "component" | "data-edit-validator" | "row-class-generator";
|
|
22
|
+
/**
|
|
23
|
+
* The CellRenderer Options provide configuration for the Column Settings panel
|
|
24
|
+
*/
|
|
25
|
+
type CellRendererOptions = {
|
|
26
|
+
configEditor?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
serverDataType?: VuuColumnDataType | VuuColumnDataType[] | "json" | "private";
|
|
30
|
+
userCanAssign?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export interface CellRendererDescriptor extends CellRendererOptions {
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* This check is performed during construction of UI from JSON. If component
|
|
37
|
+
* is not registered, it will log a warning.
|
|
38
|
+
*/
|
|
39
|
+
export declare const isContainer: (componentType: string) => boolean;
|
|
40
|
+
/**
|
|
41
|
+
* This check is performed during construction of UI from JSON. If component
|
|
42
|
+
* is not registered, it will log a warning.
|
|
43
|
+
*/
|
|
44
|
+
export declare const isView: (componentType: string) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* This check is performed during construction of UI from JSON. If component
|
|
47
|
+
* is not registered, it will log a warning.
|
|
48
|
+
*/
|
|
49
|
+
export declare const isLayoutComponent: (componentType: string) => componentType is layoutComponentType;
|
|
50
|
+
export declare function registerComponent(componentName: string, component: RowClassGenerator, componentType: "row-class-generator", options?: CellRendererOptions): void;
|
|
51
|
+
export declare function registerComponent(componentName: string, component: EditRuleValidator, componentType: "data-edit-validator", options?: CellRendererOptions): void;
|
|
52
|
+
export declare function registerComponent(componentName: string, component: FC<any>, componentType: Omit<ComponentType, "data-edit-validator" | "row-class-generator">, options?: CellRendererOptions): void;
|
|
53
|
+
export declare const registerConfigurationEditor: (componentName: string, configurationEditor: FC<ConfigurationEditorProps>) => void;
|
|
54
|
+
type CellRendererDataType = VuuColumnDataType | "json";
|
|
55
|
+
export declare const getRegisteredCellRenderers: (cellRendererDataType?: CellRendererDataType) => CellRendererDescriptor[];
|
|
56
|
+
export declare const getLayoutComponent: (componentName: string) => FC<any>;
|
|
57
|
+
export declare const getCellRendererOptions: (renderName: string) => CellRendererOptions | undefined;
|
|
58
|
+
export declare function getCellRenderer(column: ColumnDescriptor): FC<TableCellRendererProps> | undefined;
|
|
59
|
+
export declare function getColumnHeaderContentRenderer(column: ColumnDescriptor): FC<Omit<HeaderCellProps, "id" | "index">> | undefined;
|
|
60
|
+
export declare function getColumnHeaderLabelRenderer(column: ColumnDescriptor): FC<Omit<HeaderCellProps, "id" | "index">> | undefined;
|
|
61
|
+
export declare const getRowClassNameGenerator: (generatorId: string) => RowClassGenerator | undefined;
|
|
62
|
+
export declare function getConfigurationEditor(configEditor?: string): FC<ConfigurationEditorProps> | undefined;
|
|
63
|
+
export declare function getCellConfigPanelRenderer(name: string): ConfigEditorComponent | undefined;
|
|
64
|
+
export declare function getEditRuleValidator(name: string): EditRuleValidator | undefined;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DataSource, DataSourceConstructorProps, ServerAPI, TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
export type DataSourceConstructor = {
|
|
3
|
+
new (props: DataSourceConstructorProps): DataSource;
|
|
4
|
+
};
|
|
5
|
+
export interface DataContextProps {
|
|
6
|
+
VuuDataSource: DataSourceConstructor;
|
|
7
|
+
isLocalData: boolean;
|
|
8
|
+
getServerAPI: () => Promise<Pick<ServerAPI, "getTableList" | "getTableSchema" | "rpcCall">>;
|
|
9
|
+
/**
|
|
10
|
+
* A tableSchema would normally be requested via the serverAPI.
|
|
11
|
+
* schemas can be injected, in which case these 'local' schemas
|
|
12
|
+
* will be returned from the getTableSchema API call.
|
|
13
|
+
* The key is formed from concatenation of module and tableName
|
|
14
|
+
* from VuuTable e.g 'SIMUL:instruments'
|
|
15
|
+
*/
|
|
16
|
+
tableSchemas?: Record<string, TableSchema>;
|
|
17
|
+
}
|
|
18
|
+
export declare class NullDataSourceConstructor {
|
|
19
|
+
constructor(_: DataSourceConstructorProps);
|
|
20
|
+
}
|
|
21
|
+
export declare const DataContext: import("react").Context<DataContextProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { DataContextProps } from "./DataContext";
|
|
3
|
+
export declare const DataProvider: ({ children, getServerAPI, isLocalData, VuuDataSource, }: Omit<DataContextProps, "isLocalData"> & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
isLocalData?: boolean;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
7
|
+
export declare const useData: () => DataContextProps;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataSource } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export interface DataSourceContextProps {
|
|
4
|
+
dataSource?: DataSource;
|
|
5
|
+
}
|
|
6
|
+
export declare const DataSourceContext: import("react").Context<DataSourceContextProps>;
|
|
7
|
+
export declare const DataSourceProvider: ({ children, dataSource, }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
dataSource: DataSource;
|
|
10
|
+
}) => import("react").JSX.Element;
|
|
11
|
+
export declare function useDataSource(throwIfNoDataSource: true): DataSource;
|
|
12
|
+
export declare function useDataSource(throwIfNoDataSource: false | undefined): DataSource | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ApplicationSetting, ApplicationSettings, LayoutJSON } from "../json-types";
|
|
3
|
+
import { LayoutMetadata, LayoutMetadataDto } from "../layout-types";
|
|
4
|
+
export interface WorkspaceContextProps {
|
|
5
|
+
layoutMetadata: LayoutMetadata[];
|
|
6
|
+
layoutPlaceholderJSON?: LayoutJSON;
|
|
7
|
+
getApplicationSettings: (key?: keyof ApplicationSettings) => ApplicationSettings | ApplicationSetting | undefined;
|
|
8
|
+
loadLayoutById: (id: string) => void;
|
|
9
|
+
saveApplicationSettings: (settings: ApplicationSettings | ApplicationSetting, key?: keyof ApplicationSettings) => void;
|
|
10
|
+
saveLayout: (n: LayoutMetadataDto) => void;
|
|
11
|
+
saveApplicationLayout: (layout: LayoutJSON) => void;
|
|
12
|
+
workspaceJSON?: LayoutJSON | LayoutJSON[];
|
|
13
|
+
}
|
|
14
|
+
export declare const WorkspaceContext: React.Context<WorkspaceContextProps>;
|
|
15
|
+
export declare const usePlaceholderJSON: () => LayoutJSON<{
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}> | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getCookieValue: (name: string) => string | undefined;
|
|
2
|
+
/**
|
|
3
|
+
* Sets a cookie value.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} name - Cookie name
|
|
6
|
+
* @param {string} value - Cookie value
|
|
7
|
+
* @param {number} [days] - Optional: number of days until the cookie expires
|
|
8
|
+
*/
|
|
9
|
+
export declare function setCookieValue(name: string, value: string, days?: number): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const importCSS: (path: string) => Promise<CSSStyleSheet>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DataValueDescriptor } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
export type valueChangeDirection = "up1" | "up2" | "down1" | "down2" | "";
|
|
3
|
+
export declare const UP1 = "up1";
|
|
4
|
+
export declare const UP2 = "up2";
|
|
5
|
+
export declare const DOWN1 = "down1";
|
|
6
|
+
export declare const DOWN2 = "down2";
|
|
7
|
+
export declare const stringIsValidInt: (val: string) => boolean;
|
|
8
|
+
export declare const stringIsValidLong: (val: string) => boolean;
|
|
9
|
+
export declare const stringIsValidDecimal: (val: string) => boolean;
|
|
10
|
+
export declare const stringIsValidNumber: (val: string) => boolean;
|
|
11
|
+
export declare const numericTypeOfStringValue: (val: string) => "NaN" | "double" | "int";
|
|
12
|
+
export declare const isValidNumber: (n: unknown) => n is number;
|
|
13
|
+
export declare const shallowEquals: (o1?: {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}, o2?: {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}) => boolean;
|
|
18
|
+
export declare function getMovingValueDirection(newValue?: number, direction?: valueChangeDirection, prevValue?: number,
|
|
19
|
+
/** the number of decimal places to take into account when highlighting a change */
|
|
20
|
+
decimalPlaces?: number): valueChangeDirection;
|
|
21
|
+
/**
|
|
22
|
+
* Convert a value to integer.
|
|
23
|
+
* If value is a number, remove any decimals.
|
|
24
|
+
* If value is a string, parse as integer. If NaN,
|
|
25
|
+
* return defaultValue else throw.
|
|
26
|
+
* If value is integer numeric, return value.
|
|
27
|
+
*
|
|
28
|
+
* @param value
|
|
29
|
+
* @param defaultValue
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare function asInteger(value: number | string | undefined, defaultValue?: number): number;
|
|
33
|
+
export declare const dataDescriptorTypeToVuuRowDataItemType: ({ serverDataType, }: DataValueDescriptor) => "string" | "number" | "boolean";
|