@archbase/admin 4.0.18 → 4.0.20

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.
@@ -0,0 +1,59 @@
1
+ export interface GridState {
2
+ columnWidths: Record<string, number>;
3
+ sortModel: {
4
+ field: string;
5
+ sort: 'asc' | 'desc';
6
+ }[];
7
+ filterModel: Record<string, any>;
8
+ page: number;
9
+ pageSize: number;
10
+ }
11
+ export interface TabLocalState {
12
+ scrollY: number;
13
+ setScrollY: (y: number) => void;
14
+ expandedPanels: string[];
15
+ togglePanel: (panelId: string) => void;
16
+ setExpandedPanels: (panels: string[]) => void;
17
+ formValues: Record<string, any>;
18
+ formDirty: boolean;
19
+ setFormValues: (values: Record<string, any>) => void;
20
+ setFormDirty: (dirty: boolean) => void;
21
+ gridState: GridState | null;
22
+ setGridState: (state: Partial<GridState> | null) => void;
23
+ dataSourceIndex: number;
24
+ setDataSourceIndex: (index: number) => void;
25
+ customState: Record<string, any>;
26
+ setCustomState: (key: string, value: any) => void;
27
+ getCustomState: <T = any>(key: string) => T | undefined;
28
+ clearCustomState: (key?: string) => void;
29
+ openModals: string[];
30
+ openModal: (modalId: string) => void;
31
+ closeModal: (modalId: string) => void;
32
+ isModalOpen: (modalId: string) => boolean;
33
+ closeAllModals: () => void;
34
+ viewMode: string;
35
+ setViewMode: (mode: string) => void;
36
+ activeInternalTab: string | null;
37
+ setActiveInternalTab: (tabId: string | null) => void;
38
+ filters: Record<string, any>;
39
+ setFilter: (key: string, value: any) => void;
40
+ setFilters: (filters: Record<string, any>) => void;
41
+ clearFilters: () => void;
42
+ hydrate: (snapshot: Partial<SerializedTabState>) => void;
43
+ serialize: () => SerializedTabState;
44
+ }
45
+ export interface SerializedTabState {
46
+ scrollY: number;
47
+ expandedPanels: string[];
48
+ formValues: Record<string, any>;
49
+ formDirty: boolean;
50
+ gridState: GridState | null;
51
+ dataSourceIndex: number;
52
+ customState: Record<string, any>;
53
+ openModals: string[];
54
+ viewMode: string;
55
+ activeInternalTab: string | null;
56
+ filters: Record<string, any>;
57
+ }
58
+ export declare const createTabStore: (initialState?: Partial<SerializedTabState>) => import('zustand').StoreApi<TabLocalState>;
59
+ export type TabStore = ReturnType<typeof createTabStore>;
@@ -0,0 +1,4 @@
1
+ export { useTabRegistryStore } from './tabRegistryStore';
2
+ export type { TabSnapshot, TabRegistryState } from './tabRegistryStore';
3
+ export { createTabStore } from './createTabStore';
4
+ export type { TabStore, TabLocalState, SerializedTabState, GridState } from './createTabStore';
@@ -0,0 +1,53 @@
1
+ export interface TabSnapshot {
2
+ scrollY: number;
3
+ expandedPanels: string[];
4
+ formValues: Record<string, any>;
5
+ formDirty: boolean;
6
+ gridState: {
7
+ columnWidths: Record<string, number>;
8
+ sortModel: {
9
+ field: string;
10
+ sort: 'asc' | 'desc';
11
+ }[];
12
+ filterModel: Record<string, any>;
13
+ page: number;
14
+ pageSize: number;
15
+ } | null;
16
+ dataSourceIndex: number;
17
+ customState: Record<string, any>;
18
+ openModals: string[];
19
+ viewMode: string;
20
+ activeInternalTab: string | null;
21
+ filters: Record<string, any>;
22
+ lastAccessed: number;
23
+ }
24
+ export interface TabRegistryState {
25
+ openTabs: string[];
26
+ activeTabId: string | null;
27
+ snapshots: Record<string, TabSnapshot>;
28
+ maxSnapshots: number;
29
+ addTab: (tabId: string) => void;
30
+ removeTab: (tabId: string) => void;
31
+ setActiveTab: (tabId: string) => void;
32
+ saveSnapshot: (tabId: string, snapshot: Partial<TabSnapshot>) => void;
33
+ getSnapshot: (tabId: string) => TabSnapshot | undefined;
34
+ clearSnapshot: (tabId: string) => void;
35
+ pruneOldSnapshots: () => void;
36
+ }
37
+ export declare const useTabRegistryStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TabRegistryState>, "setState" | "persist"> & {
38
+ setState(partial: TabRegistryState | Partial<TabRegistryState> | ((state: TabRegistryState) => TabRegistryState | Partial<TabRegistryState>), replace?: false): unknown;
39
+ setState(state: TabRegistryState | ((state: TabRegistryState) => TabRegistryState), replace: true): unknown;
40
+ persist: {
41
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<TabRegistryState, {
42
+ snapshots: Record<string, TabSnapshot>;
43
+ }, unknown>>) => void;
44
+ clearStorage: () => void;
45
+ rehydrate: () => Promise<void> | void;
46
+ hasHydrated: () => boolean;
47
+ onHydrate: (fn: (state: TabRegistryState) => void) => () => void;
48
+ onFinishHydration: (fn: (state: TabRegistryState) => void) => () => void;
49
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<TabRegistryState, {
50
+ snapshots: Record<string, TabSnapshot>;
51
+ }, unknown>>;
52
+ };
53
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archbase/admin",
3
- "version": "4.0.18",
3
+ "version": "4.0.20",
4
4
  "description": "Admin interface components for Archbase React",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -43,12 +43,12 @@
43
43
  "react-router-dom": "^6.28.0",
44
44
  "usehooks-ts": "^2.16.0",
45
45
  "zustand": "^5.0.6",
46
- "@archbase/components": "4.0.18",
47
- "@archbase/core": "4.0.18",
48
- "@archbase/data": "4.0.18",
49
- "@archbase/layout": "4.0.18",
50
- "@archbase/security": "4.0.18",
51
- "@archbase/template": "4.0.18"
46
+ "@archbase/components": "4.0.20",
47
+ "@archbase/core": "4.0.20",
48
+ "@archbase/data": "4.0.20",
49
+ "@archbase/layout": "4.0.20",
50
+ "@archbase/security": "4.0.20",
51
+ "@archbase/template": "4.0.20"
52
52
  },
53
53
  "devDependencies": {
54
54
  "keepalive-for-react": "^5.0.7",
Binary file