@izumisy-tailor/tailor-data-viewer 0.1.20 → 0.1.21
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/README.md
CHANGED
|
@@ -52,7 +52,7 @@ import { tableMetadata } from "./generated/table-metadata";
|
|
|
52
52
|
export const dataViewModule = createDataViewModule({
|
|
53
53
|
tableMetadata,
|
|
54
54
|
appUri: import.meta.env.VITE_APP_URL,
|
|
55
|
-
|
|
55
|
+
savedViewStore: createIndexedDBStore(),
|
|
56
56
|
});
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -98,6 +98,15 @@ function App() {
|
|
|
98
98
|
|
|
99
99
|
For store options, see [Saved View Store](./docs/saved-view-store.md).
|
|
100
100
|
|
|
101
|
+
### About savedViewStore
|
|
102
|
+
|
|
103
|
+
`savedViewStore` is a storage implementation for persisting views created in Data Viewer (such as filter settings and column visibility settings). Two built-in stores are provided:
|
|
104
|
+
|
|
105
|
+
- **IndexedDB Store** (`createIndexedDBStore`): Stores data in browser's IndexedDB. Ideal for development, personal use, and offline support
|
|
106
|
+
- **TailorDB Store** (`createTailorDBStore`): Stores data on the server side. Ideal for sharing views across teams
|
|
107
|
+
|
|
108
|
+
For more details, see [Saved View Store](./docs/saved-view-store.md).
|
|
109
|
+
|
|
101
110
|
### Generating Table Metadata
|
|
102
111
|
|
|
103
112
|
This library includes a custom generator for [Tailor Platform SDK](https://www.npmjs.com/package/@tailor-platform/sdk) that automatically generates table metadata from your TailorDB schema.
|
package/docs/app-shell-module.md
CHANGED
|
@@ -21,7 +21,7 @@ import { tableMetadata } from "@tailor-platform/my-app/generated/table-metadata"
|
|
|
21
21
|
export const dataViewModule = createDataViewModule({
|
|
22
22
|
tableMetadata,
|
|
23
23
|
appUri: import.meta.env.VITE_APP_URL,
|
|
24
|
-
|
|
24
|
+
savedViewStore: createIndexedDBStore(),
|
|
25
25
|
});
|
|
26
26
|
```
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@ import { tableMetadata } from "@tailor-platform/my-app/generated/table-metadata"
|
|
|
36
36
|
export const dataViewModule = createDataViewModule({
|
|
37
37
|
tableMetadata,
|
|
38
38
|
appUri: import.meta.env.VITE_APP_URL,
|
|
39
|
-
|
|
39
|
+
savedViewStore: createTailorDBStore(),
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -68,7 +68,7 @@ interface DataViewModuleConfig {
|
|
|
68
68
|
appUri: string;
|
|
69
69
|
|
|
70
70
|
/** Store implementation for view persistence (required) */
|
|
71
|
-
|
|
71
|
+
savedViewStore: SavedViewStore | SavedViewStoreFactory;
|
|
72
72
|
|
|
73
73
|
/** Routing configuration (optional) */
|
|
74
74
|
path?: {
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ import { Badge } from "../component/ui/badge";
|
|
|
36
36
|
* export const dataViewModule = createDataViewModule({
|
|
37
37
|
* tableMetadata,
|
|
38
38
|
* appUri: import.meta.env.VITE_APP_URL,
|
|
39
|
-
*
|
|
39
|
+
* savedViewStore: createIndexedDBStore(),
|
|
40
40
|
* });
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
@@ -44,7 +44,7 @@ export function createDataViewModule(config: DataViewModuleConfig) {
|
|
|
44
44
|
const {
|
|
45
45
|
tableMetadata,
|
|
46
46
|
appUri,
|
|
47
|
-
|
|
47
|
+
savedViewStore: storeOrFactory,
|
|
48
48
|
path = {},
|
|
49
49
|
meta = {},
|
|
50
50
|
} = config;
|
package/src/app-shell/types.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface DataViewModuleConfig {
|
|
|
13
13
|
appUri: string;
|
|
14
14
|
|
|
15
15
|
/** Saved view store implementation (required) */
|
|
16
|
-
|
|
16
|
+
savedViewStore: SavedViewStore | SavedViewStoreFactory;
|
|
17
17
|
|
|
18
18
|
/** Routing configuration */
|
|
19
19
|
path?: {
|
|
@@ -33,10 +33,10 @@ export interface DataViewModuleConfig {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Type guard to check if
|
|
36
|
+
* Type guard to check if savedViewStore is a factory function
|
|
37
37
|
*/
|
|
38
38
|
export function isStoreFactory(
|
|
39
|
-
|
|
40
|
-
):
|
|
41
|
-
return typeof
|
|
39
|
+
savedViewStore: SavedViewStore | SavedViewStoreFactory,
|
|
40
|
+
): savedViewStore is SavedViewStoreFactory {
|
|
41
|
+
return typeof savedViewStore === "function";
|
|
42
42
|
}
|