@vuu-ui/vuu-utils 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/cjs/column-utils.js +2 -2
- package/cjs/column-utils.js.map +1 -1
- package/cjs/context-definitions/DataContext.js +20 -0
- package/cjs/context-definitions/DataContext.js.map +1 -0
- package/cjs/context-definitions/DataProvider.js +24 -0
- package/cjs/context-definitions/DataProvider.js.map +1 -0
- package/cjs/context-definitions/DataSourceProvider.js +20 -17
- package/cjs/context-definitions/DataSourceProvider.js.map +1 -1
- package/cjs/datasource/BaseDataSource.js +5 -2
- package/cjs/datasource/BaseDataSource.js.map +1 -1
- package/cjs/group-utils.js +16 -1
- package/cjs/group-utils.js.map +1 -1
- package/cjs/index.js +12 -13
- package/cjs/index.js.map +1 -1
- package/cjs/logging-utils.js +4 -0
- package/cjs/logging-utils.js.map +1 -1
- package/cjs/menu-utils.js +0 -151
- package/cjs/menu-utils.js.map +1 -1
- package/cjs/moving-window.js +3 -1
- package/cjs/moving-window.js.map +1 -1
- package/cjs/range-utils.js +89 -13
- package/cjs/range-utils.js.map +1 -1
- package/cjs/sort-utils.js +17 -0
- package/cjs/sort-utils.js.map +1 -1
- package/esm/column-utils.js +2 -2
- package/esm/column-utils.js.map +1 -1
- package/esm/context-definitions/DataContext.js +18 -0
- package/esm/context-definitions/DataContext.js.map +1 -0
- package/esm/context-definitions/DataProvider.js +20 -0
- package/esm/context-definitions/DataProvider.js.map +1 -0
- package/esm/context-definitions/DataSourceProvider.js +21 -18
- package/esm/context-definitions/DataSourceProvider.js.map +1 -1
- package/esm/datasource/BaseDataSource.js +5 -2
- package/esm/datasource/BaseDataSource.js.map +1 -1
- package/esm/group-utils.js +15 -2
- package/esm/group-utils.js.map +1 -1
- package/esm/index.js +9 -8
- package/esm/index.js.map +1 -1
- package/esm/logging-utils.js +4 -1
- package/esm/logging-utils.js.map +1 -1
- package/esm/menu-utils.js +1 -145
- package/esm/menu-utils.js.map +1 -1
- package/esm/moving-window.js +3 -1
- package/esm/moving-window.js.map +1 -1
- package/esm/range-utils.js +89 -12
- package/esm/range-utils.js.map +1 -1
- package/esm/sort-utils.js +17 -1
- package/esm/sort-utils.js.map +1 -1
- package/package.json +6 -6
- package/types/column-utils.d.ts +4 -4
- package/types/context-definitions/{DataSourceContext.d.ts → DataContext.d.ts} +2 -2
- package/types/context-definitions/DataProvider.d.ts +8 -0
- package/types/context-definitions/DataSourceProvider.d.ts +9 -5
- package/types/datasource/BaseDataSource.d.ts +7 -6
- package/types/filters/filter-utils.d.ts +2 -1
- package/types/group-utils.d.ts +9 -2
- package/types/index.d.ts +3 -2
- package/types/logging-utils.d.ts +1 -0
- package/types/menu-utils.d.ts +3 -19
- package/types/moving-window.d.ts +1 -1
- package/types/range-utils.d.ts +15 -9
- package/types/sort-utils.d.ts +9 -3
- package/cjs/context-definitions/DataSourceContext.js +0 -20
- package/cjs/context-definitions/DataSourceContext.js.map +0 -1
- package/esm/context-definitions/DataSourceContext.js +0 -18
- package/esm/context-definitions/DataSourceContext.js.map +0 -1
|
@@ -2,7 +2,7 @@ import type { DataSource, DataSourceConstructorProps, ServerAPI, TableSchema } f
|
|
|
2
2
|
export type DataSourceConstructor = {
|
|
3
3
|
new (props: DataSourceConstructorProps): DataSource;
|
|
4
4
|
};
|
|
5
|
-
export interface
|
|
5
|
+
export interface DataContextProps {
|
|
6
6
|
VuuDataSource: DataSourceConstructor;
|
|
7
7
|
dataSourceExtensions?: unknown;
|
|
8
8
|
isLocalData: boolean;
|
|
@@ -16,4 +16,4 @@ export interface DataSourceContextProps {
|
|
|
16
16
|
*/
|
|
17
17
|
tableSchemas?: Record<string, TableSchema>;
|
|
18
18
|
}
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const DataContext: import("react").Context<DataContextProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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-runtime").JSX.Element;
|
|
7
|
+
export declare const useData: () => DataContextProps;
|
|
8
|
+
export declare const useDataSourceExtensions: () => unknown;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { DataSource } from "@vuu-ui/vuu-data-types";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export interface DataSourceContextProps {
|
|
4
|
+
dataSource?: DataSource;
|
|
5
|
+
}
|
|
6
|
+
export declare const DataSourceContext: import("react").Context<DataSourceContextProps>;
|
|
7
|
+
export declare const DataSourceProvider: ({ children, dataSource, }: {
|
|
4
8
|
children: ReactNode;
|
|
5
|
-
|
|
9
|
+
dataSource: DataSource;
|
|
6
10
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
11
|
+
export declare function useDataSource(throwIfNoDataSource: true): DataSource;
|
|
12
|
+
export declare function useDataSource(throwIfNoDataSource: false | undefined): DataSource | undefined;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import type { DataSource, DataSourceConfig, DataSourceConstructorProps, DataSourceEvents, DataSourceFilter,
|
|
1
|
+
import type { DataSource, DataSourceConfig, DataSourceConstructorProps, DataSourceEvents, DataSourceFilter, DataSourceSubscribeCallback, DataSourceSubscribeProps, WithBaseFilter, WithFullConfig } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
import { LinkDescriptorWithLabel, VuuAggregation, VuuRange, VuuSort } from "@vuu-ui/vuu-protocol-types";
|
|
3
3
|
import { EventEmitter } from "../event-emitter";
|
|
4
4
|
import { DataSourceConfigChanges } from "./datasource-utils";
|
|
5
|
+
import { Range } from "../range-utils";
|
|
5
6
|
export type RuntimeConfig = WithBaseFilter<WithFullConfig> & {
|
|
6
7
|
visualLink?: LinkDescriptorWithLabel;
|
|
7
8
|
};
|
|
8
9
|
export declare abstract class BaseDataSource extends EventEmitter<DataSourceEvents> implements Pick<DataSource, "config"> {
|
|
9
10
|
#private;
|
|
10
11
|
viewport: string;
|
|
11
|
-
protected _clientCallback:
|
|
12
|
+
protected _clientCallback: DataSourceSubscribeCallback | undefined;
|
|
12
13
|
protected _config: RuntimeConfig;
|
|
13
14
|
protected _impendingConfig: RuntimeConfig | undefined;
|
|
14
|
-
protected _range:
|
|
15
|
+
protected _range: Range;
|
|
15
16
|
protected _size: number;
|
|
16
17
|
protected _title: string | undefined;
|
|
17
18
|
private awaitingConfirmationOfConfigChanges;
|
|
18
19
|
constructor({ aggregations, baseFilterSpec, columns, filterSpec, groupBy, sort, title, viewport, }: Omit<DataSourceConstructorProps, "table">);
|
|
19
|
-
subscribe({ baseFilterSpec, columns, aggregations, range, sort, groupBy, filterSpec, viewport, }:
|
|
20
|
+
subscribe({ baseFilterSpec, columns, aggregations, range, sort, groupBy, filterSpec, viewport, }: DataSourceSubscribeProps, callback: DataSourceSubscribeCallback): void;
|
|
20
21
|
get aggregations(): VuuAggregation[];
|
|
21
22
|
set aggregations(aggregations: VuuAggregation[]);
|
|
22
23
|
get baseFilter(): DataSourceFilter | undefined;
|
|
@@ -32,8 +33,8 @@ export declare abstract class BaseDataSource extends EventEmitter<DataSourceEven
|
|
|
32
33
|
set impendingConfig(config: WithBaseFilter<WithFullConfig>);
|
|
33
34
|
get pageCount(): number;
|
|
34
35
|
set pageCount(pageCount: number);
|
|
35
|
-
get range():
|
|
36
|
-
set range(range:
|
|
36
|
+
get range(): Range;
|
|
37
|
+
set range(range: Range);
|
|
37
38
|
get size(): number;
|
|
38
39
|
set size(size: number);
|
|
39
40
|
get sort(): VuuSort;
|
|
@@ -45,10 +45,11 @@ export declare const stripFilterFromColumns: (columns: RuntimeColumnDescriptor[]
|
|
|
45
45
|
colHeaderContentRenderer?: string;
|
|
46
46
|
colHeaderLabelRenderer?: string;
|
|
47
47
|
getIcon?: (row: import("@vuu-ui/vuu-data-types").DataSourceRow) => string | undefined;
|
|
48
|
+
groupable?: boolean;
|
|
48
49
|
hidden?: boolean;
|
|
49
50
|
maxWidth?: number;
|
|
50
51
|
minWidth?: number;
|
|
51
|
-
pin?: import("@vuu-ui/vuu-table-types").PinLocation;
|
|
52
|
+
pin?: import("@vuu-ui/vuu-table-types").PinLocation | false;
|
|
52
53
|
source?: "client" | "server";
|
|
53
54
|
editable?: boolean;
|
|
54
55
|
editableBulk?: import("@vuu-ui/vuu-data-types").BulkEdit;
|
package/types/group-utils.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
2
2
|
import { VuuGroupBy } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
export declare function addGroupColumn(groupBy: VuuGroupBy, column:
|
|
3
|
+
export declare function addGroupColumn(groupBy: VuuGroupBy, column: ColumnDescriptor): string[];
|
|
4
|
+
export declare const removeGroupColumn: (groupBy: VuuGroupBy, column: ColumnDescriptor) => string[];
|
|
5
|
+
export type ColumnGroupStatus = "no-groupby" | "single-groupby-other-column" | "single-groupby" | "multi-groupby-other-columns" | "multi-groupby-includes-column";
|
|
6
|
+
/**
|
|
7
|
+
* Given a VuuGroupby definition and a column, determine whether the given column
|
|
8
|
+
* is included in the grouping and if so, in what position/direction.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getGroupStatus: (columnName: string, groupBy?: VuuGroupBy) => ColumnGroupStatus;
|
package/types/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export * from "./user-types";
|
|
|
61
61
|
export * from "./useLayoutEffectSkipFirst";
|
|
62
62
|
/** Context declarations hosted in utils to minimize intra package dependencies */
|
|
63
63
|
export * from "./ShellContext";
|
|
64
|
-
export * from "./context-definitions/
|
|
65
|
-
export * from "./context-definitions/
|
|
64
|
+
export * from "./context-definitions/DataContext";
|
|
65
|
+
export * from "./context-definitions/DataProvider";
|
|
66
|
+
export { DataSourceProvider, useDataSource, } from "./context-definitions/DataSourceProvider";
|
|
66
67
|
export * from "./context-definitions/WorkspaceContext";
|
package/types/logging-utils.d.ts
CHANGED
package/types/menu-utils.d.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ShowNotificationAction,
|
|
3
|
-
import {
|
|
4
|
-
import { type ColumnMap } from "./column-utils";
|
|
5
|
-
export type VuuServerMenuOptions = {
|
|
6
|
-
columnMap: ColumnMap;
|
|
7
|
-
columnName: string;
|
|
8
|
-
columns: ColumnDescriptor[];
|
|
9
|
-
row: DataSourceRow;
|
|
10
|
-
selectedRows: DataSourceRow[];
|
|
11
|
-
viewport: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const isRoot: (menu: VuuMenu) => boolean;
|
|
14
|
-
export declare const isCellMenu: (options: VuuMenuItem) => options is VuuCellMenuItem;
|
|
15
|
-
export declare const isRowMenu: (options: VuuMenuItem) => options is VuuRowMenuItem;
|
|
16
|
-
export declare const isSelectionMenu: (options: VuuMenuItem) => options is VuuMenuItem;
|
|
1
|
+
import { MenuRpcResponse, OpenDialogActionWithSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { ShowNotificationAction, VuuRpcResponse } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { ContextMenuGroupItemDescriptor, ContextMenuItemDescriptor } from "@vuu-ui/vuu-context-menu";
|
|
17
4
|
export declare const isGroupMenuItemDescriptor: (menuItem?: ContextMenuItemDescriptor) => menuItem is ContextMenuGroupItemDescriptor;
|
|
18
|
-
export declare const isTableLocation: (location: string) => location is TableMenuLocation;
|
|
19
|
-
export declare const buildMenuDescriptorFromVuuMenu: (menu: VuuMenu | VuuMenuItem, tableLocation: TableMenuLocation, options: VuuServerMenuOptions) => ContextMenuItemDescriptor | undefined;
|
|
20
|
-
export declare const getMenuRpcRequest: (options: VuuMenuItem) => Omit<VuuRpcMenuRequest, "vpId">;
|
|
21
5
|
export declare const isOpenBulkEditResponse: (rpcResponse: Partial<VuuRpcResponse>) => rpcResponse is MenuRpcResponse<OpenDialogActionWithSchema>;
|
|
22
6
|
export declare const hasShowNotificationAction: (res: Partial<VuuRpcResponse>) => res is MenuRpcResponse<ShowNotificationAction>;
|
package/types/moving-window.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { WindowRange } from "@vuu-ui/vuu-utils";
|
|
3
2
|
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { WindowRange } from "./range-utils";
|
|
4
4
|
export declare class MovingWindow {
|
|
5
5
|
#private;
|
|
6
6
|
data: DataSourceRow[];
|
package/types/range-utils.d.ts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
from: number;
|
|
3
|
-
to: number;
|
|
4
|
-
bufferSize?: number;
|
|
5
|
-
reset?: boolean;
|
|
6
|
-
}
|
|
1
|
+
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
7
2
|
interface FromToRange {
|
|
8
3
|
from: number;
|
|
9
4
|
to: number;
|
|
10
5
|
}
|
|
11
|
-
export
|
|
12
|
-
|
|
6
|
+
export interface Range extends VuuRange {
|
|
7
|
+
equals: (vuuRange: VuuRange) => boolean;
|
|
8
|
+
firstRowInViewport: number;
|
|
9
|
+
lastRowInViewport: number;
|
|
10
|
+
renderBufferSize?: number;
|
|
11
|
+
reset: Range;
|
|
12
|
+
rowCount?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RangeOptions {
|
|
15
|
+
renderBufferSize?: number;
|
|
16
|
+
rowCount?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const Range: (from: number, to: number, rangeOptions?: RangeOptions) => Range;
|
|
19
|
+
export declare const NULL_RANGE: Range;
|
|
13
20
|
export declare function getFullRange({ from, to }: VuuRange, bufferSize?: number, totalRowCount?: number): FromToRange;
|
|
14
|
-
export declare function resetRange({ from, to, bufferSize }: VuuRange): VuuRange;
|
|
15
21
|
export declare const withinRange: (value: number, { from, to }: VuuRange) => boolean;
|
|
16
22
|
export declare const rangeNewItems: ({ from: from1, to: to1 }: VuuRange, newRange: VuuRange) => VuuRange;
|
|
17
23
|
export declare class WindowRange {
|
package/types/sort-utils.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { ColumnDescriptor
|
|
1
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
2
2
|
import { VuuSort, VuuSortType } from "@vuu-ui/vuu-protocol-types";
|
|
3
3
|
export declare const toggleOrApplySort: ({ sortDefs }: VuuSort, { name: column }: ColumnDescriptor, extendSort?: boolean, sortType?: VuuSortType) => VuuSort;
|
|
4
|
-
export declare const setSortColumn: ({ sortDefs }: VuuSort, column:
|
|
5
|
-
export declare const addSortColumn: ({ sortDefs }: VuuSort, column:
|
|
4
|
+
export declare const setSortColumn: ({ sortDefs }: VuuSort, column: ColumnDescriptor, sortType?: "A" | "D") => VuuSort;
|
|
5
|
+
export declare const addSortColumn: ({ sortDefs }: VuuSort, column: ColumnDescriptor, sortType?: "A" | "D") => VuuSort;
|
|
6
|
+
export type ColumnSortStatus = "no-sort" | "sort-other-column" | "single-sort-asc" | "single-sort-desc" | "multi-sort-includes-column-asc" | "multi-sort-includes-column-desc";
|
|
7
|
+
/**
|
|
8
|
+
* Given a VuuSort definition and a column, determine whether the given column
|
|
9
|
+
* is included in the sort and if so, in what position/direction.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getSortStatus: (columnName: string, vuuSort?: VuuSort) => ColumnSortStatus;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
|
|
5
|
-
const getServerAPI = () => {
|
|
6
|
-
throw Error("no DataSourceProvider has been installed");
|
|
7
|
-
};
|
|
8
|
-
class NullDataSource {
|
|
9
|
-
constructor(_) {
|
|
10
|
-
throw Error("no DataSourceProvider has been installed");
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
const DataSourceContext = React.createContext({
|
|
14
|
-
isLocalData: false,
|
|
15
|
-
getServerAPI,
|
|
16
|
-
VuuDataSource: NullDataSource
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
exports.DataSourceContext = DataSourceContext;
|
|
20
|
-
//# sourceMappingURL=DataSourceContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceContext.js","sources":["../../src/context-definitions/DataSourceContext.tsx"],"sourcesContent":["import type {\n DataSource,\n DataSourceConstructorProps,\n ServerAPI,\n TableSchema,\n} from \"@vuu-ui/vuu-data-types\";\nimport { createContext } from \"react\";\n\nexport type DataSourceConstructor = {\n new (props: DataSourceConstructorProps): DataSource;\n};\n\nexport interface DataSourceContextProps {\n VuuDataSource: DataSourceConstructor;\n dataSourceExtensions?: unknown;\n isLocalData: boolean;\n getServerAPI: () => Promise<\n Pick<ServerAPI, \"getTableList\" | \"getTableSchema\" | \"rpcCall\">\n >;\n /**\n * A tableSchema would normally be requested via the serverAPI.\n * schemas can be injected, in which case these 'local' schemas\n * will be returned from the getTableSchema API call.\n * The key is formed from concatenation of module and tableName\n * from VuuTable e.g 'SIMUL:instruments'\n */\n tableSchemas?: Record<string, TableSchema>;\n}\n\nconst getServerAPI = () => {\n throw Error(\"no DataSourceProvider has been installed\");\n};\n\nclass NullDataSource {\n constructor(_: DataSourceConstructorProps) {\n throw Error(\"no DataSourceProvider has been installed\");\n }\n}\n\nexport const DataSourceContext = createContext<DataSourceContextProps>({\n isLocalData: false,\n getServerAPI,\n VuuDataSource: NullDataSource as DataSourceConstructor,\n});\n"],"names":["createContext"],"mappings":";;;;AA6BA,MAAM,eAAe,MAAM;AACzB,EAAA,MAAM,MAAM,0CAA0C,CAAA;AACxD,CAAA;AAEA,MAAM,cAAe,CAAA;AAAA,EACnB,YAAY,CAA+B,EAAA;AACzC,IAAA,MAAM,MAAM,0CAA0C,CAAA;AAAA;AAE1D;AAEO,MAAM,oBAAoBA,mBAAsC,CAAA;AAAA,EACrE,WAAa,EAAA,KAAA;AAAA,EACb,YAAA;AAAA,EACA,aAAe,EAAA;AACjB,CAAC;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
2
|
-
|
|
3
|
-
const getServerAPI = () => {
|
|
4
|
-
throw Error("no DataSourceProvider has been installed");
|
|
5
|
-
};
|
|
6
|
-
class NullDataSource {
|
|
7
|
-
constructor(_) {
|
|
8
|
-
throw Error("no DataSourceProvider has been installed");
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const DataSourceContext = createContext({
|
|
12
|
-
isLocalData: false,
|
|
13
|
-
getServerAPI,
|
|
14
|
-
VuuDataSource: NullDataSource
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export { DataSourceContext };
|
|
18
|
-
//# sourceMappingURL=DataSourceContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceContext.js","sources":["../../src/context-definitions/DataSourceContext.tsx"],"sourcesContent":["import type {\n DataSource,\n DataSourceConstructorProps,\n ServerAPI,\n TableSchema,\n} from \"@vuu-ui/vuu-data-types\";\nimport { createContext } from \"react\";\n\nexport type DataSourceConstructor = {\n new (props: DataSourceConstructorProps): DataSource;\n};\n\nexport interface DataSourceContextProps {\n VuuDataSource: DataSourceConstructor;\n dataSourceExtensions?: unknown;\n isLocalData: boolean;\n getServerAPI: () => Promise<\n Pick<ServerAPI, \"getTableList\" | \"getTableSchema\" | \"rpcCall\">\n >;\n /**\n * A tableSchema would normally be requested via the serverAPI.\n * schemas can be injected, in which case these 'local' schemas\n * will be returned from the getTableSchema API call.\n * The key is formed from concatenation of module and tableName\n * from VuuTable e.g 'SIMUL:instruments'\n */\n tableSchemas?: Record<string, TableSchema>;\n}\n\nconst getServerAPI = () => {\n throw Error(\"no DataSourceProvider has been installed\");\n};\n\nclass NullDataSource {\n constructor(_: DataSourceConstructorProps) {\n throw Error(\"no DataSourceProvider has been installed\");\n }\n}\n\nexport const DataSourceContext = createContext<DataSourceContextProps>({\n isLocalData: false,\n getServerAPI,\n VuuDataSource: NullDataSource as DataSourceConstructor,\n});\n"],"names":[],"mappings":";;AA6BA,MAAM,eAAe,MAAM;AACzB,EAAA,MAAM,MAAM,0CAA0C,CAAA;AACxD,CAAA;AAEA,MAAM,cAAe,CAAA;AAAA,EACnB,YAAY,CAA+B,EAAA;AACzC,IAAA,MAAM,MAAM,0CAA0C,CAAA;AAAA;AAE1D;AAEO,MAAM,oBAAoB,aAAsC,CAAA;AAAA,EACrE,WAAa,EAAA,KAAA;AAAA,EACb,YAAA;AAAA,EACA,aAAe,EAAA;AACjB,CAAC;;;;"}
|