@vuu-ui/vuu-data-test 0.8.91 → 0.8.92

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/index.js CHANGED
@@ -13,6 +13,7 @@ var simulModule = require('./simul/simul-module.js');
13
13
  var testModule = require('./test/test-module.js');
14
14
  var Table = require('./Table.js');
15
15
  var VuuModule = require('./VuuModule.js');
16
+ var LocalDatasourceProvider = require('./local-datasource-provider/LocalDatasourceProvider.js');
16
17
 
17
18
 
18
19
 
@@ -44,4 +45,5 @@ exports.joinTables = Table.joinTables;
44
45
  exports.VuuModule = VuuModule.VuuModule;
45
46
  exports.withNamedParams = VuuModule.withNamedParams;
46
47
  exports.withParams = VuuModule.withParams;
48
+ exports.LocalDataSourceProvider = LocalDatasourceProvider.LocalDataSourceProvider;
47
49
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var basketSchemas = require('../basket/basket-schemas.js');
5
+ var basketModule = require('../basket/basket-module.js');
6
+ var simulSchemas = require('../simul/simul-schemas.js');
7
+ var simulModule = require('../simul/simul-module.js');
8
+ var vuuUtils = require('@vuu-ui/vuu-utils');
9
+
10
+ const serverAPI = {
11
+ getTableList: async () => {
12
+ return {
13
+ tables: Object.values(simulSchemas.schemas).concat(Object.values(basketSchemas.schemas)).map((schema) => schema.table)
14
+ };
15
+ },
16
+ getTableSchema: async (vuuTable) => {
17
+ if (simulSchemas.isSimulTable(vuuTable)) {
18
+ return simulSchemas.schemas[vuuTable.table];
19
+ } else if (basketSchemas.isBasketTable(vuuTable)) {
20
+ return basketSchemas.schemas[vuuTable.table];
21
+ } else {
22
+ throw Error(
23
+ `unsupported module/table ${vuuTable.module}/${vuuTable.table}`
24
+ );
25
+ }
26
+ }
27
+ };
28
+ const getServerAPI = async () => serverAPI;
29
+ class VuuDataSource {
30
+ constructor({
31
+ aggregations,
32
+ columns,
33
+ filterSpec,
34
+ groupBy,
35
+ sort,
36
+ table,
37
+ viewport,
38
+ visualLink
39
+ }) {
40
+ const config = {
41
+ aggregations,
42
+ columns,
43
+ filterSpec,
44
+ groupBy,
45
+ sort,
46
+ visualLink
47
+ };
48
+ if (simulSchemas.isSimulTable(table)) {
49
+ return simulModule.simulModule.createDataSource(table.table, viewport, config);
50
+ } else if (basketSchemas.isBasketTable(table)) {
51
+ return basketModule.basketModule.createDataSource(table.table, viewport, config);
52
+ } else {
53
+ throw Error(`unsupported module/table ${table.module}/${table.table}`);
54
+ }
55
+ }
56
+ }
57
+ const LocalDataSourceProvider = ({
58
+ children,
59
+ modules
60
+ }) => {
61
+ return /* @__PURE__ */ jsxRuntime.jsx(
62
+ vuuUtils.DataSourceProvider,
63
+ {
64
+ VuuDataSource,
65
+ vuuModuleNames: modules,
66
+ getServerAPI,
67
+ children
68
+ }
69
+ );
70
+ };
71
+
72
+ exports.LocalDataSourceProvider = LocalDataSourceProvider;
73
+ //# sourceMappingURL=LocalDatasourceProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalDatasourceProvider.js","sources":["../../src/local-datasource-provider/LocalDatasourceProvider.tsx"],"sourcesContent":["import type {\n DataSourceConfig,\n DataSourceConstructorProps,\n TableSchema,\n} from \"@vuu-ui/vuu-data-types\";\nimport type { VuuTable, VuuTableList } from \"@vuu-ui/vuu-protocol-types\";\nimport { basketModule, basketSchemas, isBasketTable } from \"../basket\";\nimport { isSimulTable, simulModule, simulSchemas } from \"../simul\";\nimport { ReactNode } from \"react\";\nimport { DataSourceProvider } from \"@vuu-ui/vuu-utils\";\n\ninterface ServerAPI {\n getTableList: () => Promise<VuuTableList>;\n getTableSchema: (table: VuuTable) => Promise<TableSchema>;\n}\n\nconst serverAPI: ServerAPI = {\n getTableList: async () => {\n return {\n tables: Object.values(simulSchemas)\n .concat(Object.values(basketSchemas))\n .map((schema) => schema.table),\n };\n },\n getTableSchema: async (vuuTable: VuuTable) => {\n if (isSimulTable(vuuTable)) {\n return simulSchemas[vuuTable.table];\n } else if (isBasketTable(vuuTable)) {\n return basketSchemas[vuuTable.table];\n } else {\n throw Error(\n `unsupported module/table ${vuuTable.module}/${vuuTable.table}`,\n );\n }\n },\n};\n\nconst getServerAPI = async () => serverAPI;\n\nclass VuuDataSource {\n constructor({\n aggregations,\n columns,\n filterSpec,\n groupBy,\n sort,\n table,\n viewport,\n visualLink,\n }: DataSourceConstructorProps) {\n const config: DataSourceConfig = {\n aggregations,\n columns,\n filterSpec,\n groupBy,\n sort,\n visualLink,\n };\n\n if (isSimulTable(table)) {\n return simulModule.createDataSource(table.table, viewport, config);\n } else if (isBasketTable(table)) {\n return basketModule.createDataSource(table.table, viewport, config);\n } else {\n throw Error(`unsupported module/table ${table.module}/${table.table}`);\n }\n }\n}\n\nexport const LocalDataSourceProvider = ({\n children,\n modules,\n}: {\n children: ReactNode;\n modules: string[];\n}) => {\n return (\n <DataSourceProvider\n VuuDataSource={VuuDataSource as any}\n vuuModuleNames={modules}\n getServerAPI={getServerAPI}\n >\n {children}\n </DataSourceProvider>\n );\n};\n"],"names":["simulSchemas","basketSchemas","isSimulTable","isBasketTable","simulModule","basketModule","jsx","DataSourceProvider"],"mappings":";;;;;;;;;AAgBA,MAAM,SAAuB,GAAA;AAAA,EAC3B,cAAc,YAAY;AACxB,IAAO,OAAA;AAAA,MACL,MAAQ,EAAA,MAAA,CAAO,MAAO,CAAAA,oBAAY,EAC/B,MAAO,CAAA,MAAA,CAAO,MAAO,CAAAC,qBAAa,CAAC,CACnC,CAAA,GAAA,CAAI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AAA;AACL,MAAA,MAAM,MAAM,CAA4B,yBAAA,EAAA,KAAA,CAAM,MAAM,CAAI,CAAA,EAAA,KAAA,CAAM,KAAK,CAAE,CAAA,CAAA,CAAA;AAAA,KACvE;AAAA,GACF;AACF,CAAA;AAEO,MAAM,0BAA0B,CAAC;AAAA,EACtC,QAAA;AAAA,EACA,OAAA;AACF,CAGM,KAAA;AACJ,EACE,uBAAAC,cAAA;AAAA,IAACC,2BAAA;AAAA,IAAA;AAAA,MACC,aAAA;AAAA,MACA,cAAgB,EAAA,OAAA;AAAA,MAChB,YAAA;AAAA,MAEC,QAAA;AAAA,KAAA;AAAA,GACH,CAAA;AAEJ;;;;"}
package/esm/index.js CHANGED
@@ -11,4 +11,5 @@ export { simulModule } from './simul/simul-module.js';
11
11
  export { testModule } from './test/test-module.js';
12
12
  export { Table, buildDataColumnMap, buildDataColumnMapFromSchema, joinTables } from './Table.js';
13
13
  export { VuuModule, withNamedParams, withParams } from './VuuModule.js';
14
+ export { LocalDataSourceProvider } from './local-datasource-provider/LocalDatasourceProvider.js';
14
15
  //# sourceMappingURL=index.js.map
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -0,0 +1,71 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { isBasketTable, schemas as schemas$1 } from '../basket/basket-schemas.js';
3
+ import { basketModule } from '../basket/basket-module.js';
4
+ import { isSimulTable, schemas } from '../simul/simul-schemas.js';
5
+ import { simulModule } from '../simul/simul-module.js';
6
+ import { DataSourceProvider } from '@vuu-ui/vuu-utils';
7
+
8
+ const serverAPI = {
9
+ getTableList: async () => {
10
+ return {
11
+ tables: Object.values(schemas).concat(Object.values(schemas$1)).map((schema) => schema.table)
12
+ };
13
+ },
14
+ getTableSchema: async (vuuTable) => {
15
+ if (isSimulTable(vuuTable)) {
16
+ return schemas[vuuTable.table];
17
+ } else if (isBasketTable(vuuTable)) {
18
+ return schemas$1[vuuTable.table];
19
+ } else {
20
+ throw Error(
21
+ `unsupported module/table ${vuuTable.module}/${vuuTable.table}`
22
+ );
23
+ }
24
+ }
25
+ };
26
+ const getServerAPI = async () => serverAPI;
27
+ class VuuDataSource {
28
+ constructor({
29
+ aggregations,
30
+ columns,
31
+ filterSpec,
32
+ groupBy,
33
+ sort,
34
+ table,
35
+ viewport,
36
+ visualLink
37
+ }) {
38
+ const config = {
39
+ aggregations,
40
+ columns,
41
+ filterSpec,
42
+ groupBy,
43
+ sort,
44
+ visualLink
45
+ };
46
+ if (isSimulTable(table)) {
47
+ return simulModule.createDataSource(table.table, viewport, config);
48
+ } else if (isBasketTable(table)) {
49
+ return basketModule.createDataSource(table.table, viewport, config);
50
+ } else {
51
+ throw Error(`unsupported module/table ${table.module}/${table.table}`);
52
+ }
53
+ }
54
+ }
55
+ const LocalDataSourceProvider = ({
56
+ children,
57
+ modules
58
+ }) => {
59
+ return /* @__PURE__ */ jsx(
60
+ DataSourceProvider,
61
+ {
62
+ VuuDataSource,
63
+ vuuModuleNames: modules,
64
+ getServerAPI,
65
+ children
66
+ }
67
+ );
68
+ };
69
+
70
+ export { LocalDataSourceProvider };
71
+ //# sourceMappingURL=LocalDatasourceProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalDatasourceProvider.js","sources":["../../src/local-datasource-provider/LocalDatasourceProvider.tsx"],"sourcesContent":["import type {\n DataSourceConfig,\n DataSourceConstructorProps,\n TableSchema,\n} from \"@vuu-ui/vuu-data-types\";\nimport type { VuuTable, VuuTableList } from \"@vuu-ui/vuu-protocol-types\";\nimport { basketModule, basketSchemas, isBasketTable } from \"../basket\";\nimport { isSimulTable, simulModule, simulSchemas } from \"../simul\";\nimport { ReactNode } from \"react\";\nimport { DataSourceProvider } from \"@vuu-ui/vuu-utils\";\n\ninterface ServerAPI {\n getTableList: () => Promise<VuuTableList>;\n getTableSchema: (table: VuuTable) => Promise<TableSchema>;\n}\n\nconst serverAPI: ServerAPI = {\n getTableList: async () => {\n return {\n tables: Object.values(simulSchemas)\n .concat(Object.values(basketSchemas))\n .map((schema) => schema.table),\n };\n },\n getTableSchema: async (vuuTable: VuuTable) => {\n if (isSimulTable(vuuTable)) {\n return simulSchemas[vuuTable.table];\n } else if (isBasketTable(vuuTable)) {\n return basketSchemas[vuuTable.table];\n } else {\n throw Error(\n `unsupported module/table ${vuuTable.module}/${vuuTable.table}`,\n );\n }\n },\n};\n\nconst getServerAPI = async () => serverAPI;\n\nclass VuuDataSource {\n constructor({\n aggregations,\n columns,\n filterSpec,\n groupBy,\n sort,\n table,\n viewport,\n visualLink,\n }: DataSourceConstructorProps) {\n const config: DataSourceConfig = {\n aggregations,\n columns,\n filterSpec,\n groupBy,\n sort,\n visualLink,\n };\n\n if (isSimulTable(table)) {\n return simulModule.createDataSource(table.table, viewport, config);\n } else if (isBasketTable(table)) {\n return basketModule.createDataSource(table.table, viewport, config);\n } else {\n throw Error(`unsupported module/table ${table.module}/${table.table}`);\n }\n }\n}\n\nexport const LocalDataSourceProvider = ({\n children,\n modules,\n}: {\n children: ReactNode;\n modules: string[];\n}) => {\n return (\n <DataSourceProvider\n VuuDataSource={VuuDataSource as any}\n vuuModuleNames={modules}\n getServerAPI={getServerAPI}\n >\n {children}\n </DataSourceProvider>\n );\n};\n"],"names":["simulSchemas","basketSchemas"],"mappings":";;;;;;;AAgBA,MAAM,SAAuB,GAAA;AAAA,EAC3B,cAAc,YAAY;AACxB,IAAO,OAAA;AAAA,MACL,MAAQ,EAAA,MAAA,CAAO,MAAO,CAAAA,OAAY,EAC/B,MAAO,CAAA,MAAA,CAAO,MAAO,CAAAC,SAAa,CAAC,CACnC,CAAA,GAAA,CAAI,CAAC,MAAA,KAAW,OAAO,KAAK,CAAA;AAAA,KACjC,CAAA;AAAA,GACF;AAAA,EACA,cAAA,EAAgB,OA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AAA,CAAA,CAAA;AAAA,KACvE;AAAA,GACF;AACF,CAAA;AAEO,MAAM,0BAA0B,CAAC;AAAA,EACtC,QAAA;AAAA,EACA,OAAA;AACF,CAGM,KAAA;AACJ,EACE,uBAAA,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,aAAA;AAAA,MACA,cAAgB,EAAA,OAAA;AAAA,MAChB,YAAA;AAAA,MAEC,QAAA;AAAA,KAAA;AAAA,GACH,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
- "version": "0.8.91",
2
+ "version": "0.8.92",
3
3
  "author": "heswell",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
- "@vuu-ui/vuu-data-local": "0.8.91",
7
- "@vuu-ui/vuu-utils": "0.8.91",
6
+ "@vuu-ui/vuu-data-local": "0.8.92",
7
+ "@vuu-ui/vuu-utils": "0.8.92",
8
8
  "@thomaschaplin/isin-generator": "1.0.3"
9
9
  },
10
10
  "devDependencies": {
11
- "@vuu-ui/vuu-protocol-types": "0.8.91",
12
- "@vuu-ui/vuu-data-types": "0.8.91",
13
- "@vuu-ui/vuu-table-types": "0.8.91"
11
+ "@vuu-ui/vuu-protocol-types": "0.8.92",
12
+ "@vuu-ui/vuu-data-types": "0.8.92",
13
+ "@vuu-ui/vuu-table-types": "0.8.92"
14
14
  },
15
15
  "sideEffects": false,
16
16
  "files": [
package/types/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from "./simul";
9
9
  export * from "./test";
10
10
  export * from "./Table";
11
11
  export * from "./VuuModule";
12
+ export * from "./local-datasource-provider/LocalDatasourceProvider";