@nokecy/qc-ui 1.0.71 → 1.0.72

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.
@@ -72,3 +72,29 @@ export declare function useGlobalColumnAdapter(): import("./MemoryStorageAdapter
72
72
  * 简化组件中的使用
73
73
  */
74
74
  export declare function useGlobalQueryAdapter(): import("./MemoryStorageAdapter").QueryMemoryStorageAdapter;
75
+ /**
76
+ * React Hook: 使用全局列方案管理器
77
+ * 自动创建并管理指定 gridId 的列方案管理器
78
+ *
79
+ * @param gridId 表格唯一标识
80
+ * @param options 可选配置
81
+ * @returns 列方案管理器实例
82
+ */
83
+ export declare function useGlobalColumnSchemeManager(gridId: string, options?: {
84
+ enableAutoSave?: boolean;
85
+ onSchemeChange?: (scheme: any) => void;
86
+ onSchemeSave?: (scheme: any) => void;
87
+ }): any;
88
+ /**
89
+ * React Hook: 使用全局查询方案管理器
90
+ * 自动创建并管理指定 gridId 的查询方案管理器
91
+ *
92
+ * @param gridId 表格唯一标识
93
+ * @param options 可选配置
94
+ * @returns 查询方案管理器实例
95
+ */
96
+ export declare function useGlobalQuerySchemeManager(gridId: string, options?: {
97
+ enableAutoSave?: boolean;
98
+ onSchemeChange?: (scheme: any) => void;
99
+ onSchemeSave?: (scheme: any) => void;
100
+ }): any;
@@ -272,4 +272,50 @@ export function useGlobalColumnAdapter() {
272
272
  export function useGlobalQueryAdapter() {
273
273
  var factory = getGlobalAdapterFactory();
274
274
  return factory.getQueryAdapter();
275
+ }
276
+
277
+ /**
278
+ * React Hook: 使用全局列方案管理器
279
+ * 自动创建并管理指定 gridId 的列方案管理器
280
+ *
281
+ * @param gridId 表格唯一标识
282
+ * @param options 可选配置
283
+ * @returns 列方案管理器实例
284
+ */
285
+ export function useGlobalColumnSchemeManager(gridId, options) {
286
+ var _options$enableAutoSa;
287
+ // 动态导入 useSchemeManager Hook
288
+ var _require = require("../shared/hooks/useSchemeManager"),
289
+ useSchemeManager = _require.useSchemeManager;
290
+ var columnAdapter = useGlobalColumnAdapter();
291
+ return useSchemeManager({
292
+ gridId: gridId,
293
+ storageAdapter: columnAdapter,
294
+ enableAutoSave: (_options$enableAutoSa = options === null || options === void 0 ? void 0 : options.enableAutoSave) !== null && _options$enableAutoSa !== void 0 ? _options$enableAutoSa : true,
295
+ onSchemeChange: options === null || options === void 0 ? void 0 : options.onSchemeChange,
296
+ onSchemeSave: options === null || options === void 0 ? void 0 : options.onSchemeSave
297
+ });
298
+ }
299
+
300
+ /**
301
+ * React Hook: 使用全局查询方案管理器
302
+ * 自动创建并管理指定 gridId 的查询方案管理器
303
+ *
304
+ * @param gridId 表格唯一标识
305
+ * @param options 可选配置
306
+ * @returns 查询方案管理器实例
307
+ */
308
+ export function useGlobalQuerySchemeManager(gridId, options) {
309
+ var _options$enableAutoSa2;
310
+ // 动态导入 useSchemeManager Hook
311
+ var _require2 = require("../shared/hooks/useSchemeManager"),
312
+ useSchemeManager = _require2.useSchemeManager;
313
+ var queryAdapter = useGlobalQueryAdapter();
314
+ return useSchemeManager({
315
+ gridId: gridId,
316
+ storageAdapter: queryAdapter,
317
+ enableAutoSave: (_options$enableAutoSa2 = options === null || options === void 0 ? void 0 : options.enableAutoSave) !== null && _options$enableAutoSa2 !== void 0 ? _options$enableAutoSa2 : true,
318
+ onSchemeChange: options === null || options === void 0 ? void 0 : options.onSchemeChange,
319
+ onSchemeSave: options === null || options === void 0 ? void 0 : options.onSchemeSave
320
+ });
275
321
  }
@@ -71,6 +71,25 @@ export interface ConflictData {
71
71
  /** 冲突原因 */
72
72
  reason: string;
73
73
  }
74
+ /**
75
+ * 方案冲突(别名)
76
+ */
77
+ export type SchemeConflict = ConflictData;
78
+ /**
79
+ * 同步状态信息
80
+ */
81
+ export interface SyncStatus {
82
+ /** 是否已初始化 */
83
+ initialized: boolean;
84
+ /** 是否正在同步 */
85
+ syncing: boolean;
86
+ /** 最后同步时间 */
87
+ lastSyncTime: number;
88
+ /** 是否有未同步数据 */
89
+ hasDirtyData: boolean;
90
+ /** 有未同步数据的表格ID列表 */
91
+ dirtyGrids: string[];
92
+ }
74
93
  /**
75
94
  * 脏数据标记类型
76
95
  */
@@ -81,6 +100,18 @@ export type DirtyType = 'column' | 'query' | 'current';
81
100
  export interface SyncConfig {
82
101
  /** API 基础路径 */
83
102
  apiBaseUrl: string;
103
+ /**
104
+ * 获取方案API路径(可选)
105
+ * 默认值: '/api/v1/ag-grid-plus/schemes'
106
+ * 用于GET请求,获取所有方案数据
107
+ */
108
+ getApiPath?: string;
109
+ /**
110
+ * 同步方案API路径(可选)
111
+ * 默认值: '/api/v1/ag-grid-plus/schemes'
112
+ * 用于PUT请求,同步保存方案数据
113
+ */
114
+ syncApiPath?: string;
84
115
  /** 自动保存延迟(毫秒),默认 3000 */
85
116
  autoSaveDelay?: number;
86
117
  /** 后台同步间隔(毫秒),默认 300000 (5分钟) */
@@ -32,7 +32,7 @@ export declare const createSelectField: (title: string, options: Array<{
32
32
  required?: boolean | undefined;
33
33
  placeholder?: string | undefined;
34
34
  gridSpan?: number | undefined;
35
- mode?: "multiple" | "tags" | undefined;
35
+ mode?: "tags" | "multiple" | undefined;
36
36
  } | undefined) => any;
37
37
  /**
38
38
  * 快速创建常用字段的工具函数集合