@nokecy/qc-ui 1.0.70 → 1.0.71

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.
Files changed (188) hide show
  1. package/dist/cjs/ag-grid-plus/ag-gridPlus.js +394 -206
  2. package/dist/cjs/ag-grid-plus/context/gridContext.d.ts +30 -5
  3. package/dist/cjs/ag-grid-plus/context/gridContext.js +6 -1
  4. package/dist/cjs/ag-grid-plus/errors/ErrorBoundary.d.ts +36 -0
  5. package/dist/cjs/ag-grid-plus/errors/ErrorBoundary.js +143 -0
  6. package/dist/cjs/ag-grid-plus/errors/index.d.ts +3 -0
  7. package/dist/cjs/ag-grid-plus/errors/index.js +31 -0
  8. package/dist/cjs/ag-grid-plus/errors/types.d.ts +71 -0
  9. package/dist/cjs/ag-grid-plus/errors/types.js +137 -0
  10. package/dist/cjs/ag-grid-plus/hooks/index.d.ts +7 -0
  11. package/dist/cjs/ag-grid-plus/hooks/index.js +51 -0
  12. package/dist/cjs/ag-grid-plus/hooks/useAgGridCalculation.d.ts +88 -0
  13. package/dist/cjs/ag-grid-plus/hooks/useAgGridCalculation.js +224 -0
  14. package/dist/cjs/ag-grid-plus/hooks/useAgGridData.d.ts +91 -0
  15. package/dist/cjs/ag-grid-plus/hooks/useAgGridData.js +230 -0
  16. package/dist/cjs/ag-grid-plus/hooks/useGridPlusColumnState.d.ts +1 -8
  17. package/dist/cjs/ag-grid-plus/hooks/useGridState.d.ts +153 -0
  18. package/dist/cjs/ag-grid-plus/hooks/useGridState.js +258 -0
  19. package/dist/cjs/ag-grid-plus/index.d.ts +3 -0
  20. package/dist/cjs/ag-grid-plus/index.js +85 -0
  21. package/dist/cjs/ag-grid-plus/interface.d.ts +27 -0
  22. package/dist/cjs/ag-grid-plus/querySchemes/components/QuerySchemesManager.d.ts +21 -0
  23. package/dist/cjs/ag-grid-plus/querySchemes/components/QuerySchemesManager.js +580 -0
  24. package/dist/cjs/ag-grid-plus/querySchemes/components/QuerySchemesManager.less +86 -0
  25. package/dist/cjs/ag-grid-plus/querySchemes/components/index.d.ts +5 -0
  26. package/dist/cjs/ag-grid-plus/querySchemes/components/index.js +12 -0
  27. package/dist/cjs/ag-grid-plus/querySchemes/constants.d.ts +17 -0
  28. package/dist/cjs/ag-grid-plus/querySchemes/constants.js +30 -0
  29. package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.d.ts +10 -0
  30. package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.js +65 -0
  31. package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.d.ts +6 -0
  32. package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.js +542 -0
  33. package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.d.ts +7 -0
  34. package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.js +32 -0
  35. package/dist/cjs/ag-grid-plus/querySchemes/index.d.ts +11 -0
  36. package/dist/cjs/ag-grid-plus/querySchemes/index.js +113 -0
  37. package/dist/cjs/ag-grid-plus/querySchemes/storage/localStorageAdapter.d.ts +44 -0
  38. package/dist/cjs/ag-grid-plus/querySchemes/storage/localStorageAdapter.js +261 -0
  39. package/dist/cjs/ag-grid-plus/querySchemes/types.d.ts +143 -0
  40. package/dist/cjs/ag-grid-plus/querySchemes/types.js +5 -0
  41. package/dist/cjs/ag-grid-plus/querySchemes/utils/validator.d.ts +36 -0
  42. package/dist/cjs/ag-grid-plus/querySchemes/utils/validator.js +155 -0
  43. package/dist/cjs/ag-grid-plus/schemes/components/SchemeManager.d.ts +16 -0
  44. package/dist/cjs/ag-grid-plus/schemes/components/SchemeManager.js +342 -0
  45. package/dist/cjs/ag-grid-plus/schemes/components/SchemeManager.less +35 -0
  46. package/dist/cjs/ag-grid-plus/schemes/components/SchemeSelector.d.ts +20 -0
  47. package/dist/cjs/ag-grid-plus/schemes/components/SchemeSelector.js +289 -0
  48. package/dist/cjs/ag-grid-plus/schemes/components/SchemeSelector.less +39 -0
  49. package/dist/cjs/ag-grid-plus/schemes/components/index.d.ts +4 -0
  50. package/dist/cjs/ag-grid-plus/schemes/components/index.js +19 -0
  51. package/dist/cjs/ag-grid-plus/schemes/constants.d.ts +23 -0
  52. package/dist/cjs/ag-grid-plus/schemes/constants.js +39 -0
  53. package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.d.ts +6 -0
  54. package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.js +542 -0
  55. package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.d.ts +7 -0
  56. package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.js +32 -0
  57. package/dist/cjs/ag-grid-plus/schemes/index.d.ts +16 -0
  58. package/dist/cjs/ag-grid-plus/schemes/index.js +124 -0
  59. package/dist/cjs/ag-grid-plus/schemes/storage/localStorageAdapter.d.ts +64 -0
  60. package/dist/cjs/ag-grid-plus/schemes/storage/localStorageAdapter.js +368 -0
  61. package/dist/cjs/ag-grid-plus/schemes/types.d.ts +126 -0
  62. package/dist/cjs/ag-grid-plus/schemes/types.js +5 -0
  63. package/dist/cjs/ag-grid-plus/schemes/utils/validator.d.ts +27 -0
  64. package/dist/cjs/ag-grid-plus/schemes/utils/validator.js +113 -0
  65. package/dist/cjs/ag-grid-plus/setting/ColumnSetting.d.ts +17 -0
  66. package/dist/cjs/ag-grid-plus/setting/ColumnSetting.js +955 -0
  67. package/dist/cjs/ag-grid-plus/setting/index.d.ts +1 -1
  68. package/dist/cjs/ag-grid-plus/setting/index.js +74 -111
  69. package/dist/cjs/ag-grid-plus/shared/hooks/useSchemeManager.d.ts +66 -0
  70. package/dist/cjs/ag-grid-plus/shared/hooks/useSchemeManager.js +648 -0
  71. package/dist/cjs/ag-grid-plus/storage/MemoryStorageAdapter.d.ts +76 -0
  72. package/dist/cjs/ag-grid-plus/storage/MemoryStorageAdapter.js +276 -0
  73. package/dist/cjs/ag-grid-plus/storage/SchemeSyncManager.d.ts +104 -0
  74. package/dist/cjs/ag-grid-plus/storage/SchemeSyncManager.js +593 -0
  75. package/dist/cjs/ag-grid-plus/storage/globalSyncManager.d.ts +74 -0
  76. package/dist/cjs/ag-grid-plus/storage/globalSyncManager.js +287 -0
  77. package/dist/cjs/ag-grid-plus/storage/index.d.ts +8 -0
  78. package/dist/cjs/ag-grid-plus/storage/index.js +49 -0
  79. package/dist/cjs/ag-grid-plus/storage/types.d.ts +113 -0
  80. package/dist/cjs/ag-grid-plus/storage/types.js +5 -0
  81. package/dist/cjs/ag-grid-plus/types.d.ts +310 -0
  82. package/dist/cjs/ag-grid-plus/types.js +5 -0
  83. package/dist/cjs/ag-grid-plus/utils/columnProcessors.d.ts +95 -0
  84. package/dist/cjs/ag-grid-plus/utils/columnProcessors.js +265 -0
  85. package/dist/cjs/ag-grid-plus/utils/constants.d.ts +41 -0
  86. package/dist/cjs/ag-grid-plus/utils/constants.js +56 -0
  87. package/dist/cjs/ag-grid-plus/utils/logger.d.ts +34 -0
  88. package/dist/cjs/ag-grid-plus/utils/logger.js +119 -0
  89. package/dist/cjs/ag-grid-plus/utils/sanitize.d.ts +15 -0
  90. package/dist/cjs/ag-grid-plus/utils/sanitize.js +39 -0
  91. package/dist/cjs/index.d.ts +3 -2
  92. package/dist/cjs/index.js +84 -0
  93. package/dist/esm/ag-grid-plus/ag-gridPlus.js +395 -206
  94. package/dist/esm/ag-grid-plus/context/gridContext.d.ts +30 -5
  95. package/dist/esm/ag-grid-plus/context/gridContext.js +6 -1
  96. package/dist/esm/ag-grid-plus/errors/ErrorBoundary.d.ts +36 -0
  97. package/dist/esm/ag-grid-plus/errors/ErrorBoundary.js +137 -0
  98. package/dist/esm/ag-grid-plus/errors/index.d.ts +3 -0
  99. package/dist/esm/ag-grid-plus/errors/index.js +2 -0
  100. package/dist/esm/ag-grid-plus/errors/types.d.ts +71 -0
  101. package/dist/esm/ag-grid-plus/errors/types.js +135 -0
  102. package/dist/esm/ag-grid-plus/hooks/index.d.ts +7 -0
  103. package/dist/esm/ag-grid-plus/hooks/index.js +10 -0
  104. package/dist/esm/ag-grid-plus/hooks/useAgGridCalculation.d.ts +88 -0
  105. package/dist/esm/ag-grid-plus/hooks/useAgGridCalculation.js +217 -0
  106. package/dist/esm/ag-grid-plus/hooks/useAgGridData.d.ts +91 -0
  107. package/dist/esm/ag-grid-plus/hooks/useAgGridData.js +225 -0
  108. package/dist/esm/ag-grid-plus/hooks/useGridPlusColumnState.d.ts +1 -8
  109. package/dist/esm/ag-grid-plus/hooks/useGridState.d.ts +153 -0
  110. package/dist/esm/ag-grid-plus/hooks/useGridState.js +258 -0
  111. package/dist/esm/ag-grid-plus/index.d.ts +3 -0
  112. package/dist/esm/ag-grid-plus/index.js +4 -1
  113. package/dist/esm/ag-grid-plus/interface.d.ts +27 -0
  114. package/dist/esm/ag-grid-plus/querySchemes/components/QuerySchemesManager.d.ts +21 -0
  115. package/dist/esm/ag-grid-plus/querySchemes/components/QuerySchemesManager.js +572 -0
  116. package/dist/esm/ag-grid-plus/querySchemes/components/QuerySchemesManager.less +86 -0
  117. package/dist/esm/ag-grid-plus/querySchemes/components/index.d.ts +5 -0
  118. package/dist/esm/ag-grid-plus/querySchemes/components/index.js +5 -0
  119. package/dist/esm/ag-grid-plus/querySchemes/constants.d.ts +17 -0
  120. package/dist/esm/ag-grid-plus/querySchemes/constants.js +24 -0
  121. package/dist/esm/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.d.ts +10 -0
  122. package/dist/esm/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.js +60 -0
  123. package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.d.ts +6 -0
  124. package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.js +537 -0
  125. package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.d.ts +7 -0
  126. package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.js +27 -0
  127. package/dist/esm/ag-grid-plus/querySchemes/index.d.ts +11 -0
  128. package/dist/esm/ag-grid-plus/querySchemes/index.js +20 -0
  129. package/dist/esm/ag-grid-plus/querySchemes/storage/localStorageAdapter.d.ts +44 -0
  130. package/dist/esm/ag-grid-plus/querySchemes/storage/localStorageAdapter.js +256 -0
  131. package/dist/esm/ag-grid-plus/querySchemes/types.d.ts +143 -0
  132. package/dist/esm/ag-grid-plus/querySchemes/types.js +1 -0
  133. package/dist/esm/ag-grid-plus/querySchemes/utils/validator.d.ts +36 -0
  134. package/dist/esm/ag-grid-plus/querySchemes/utils/validator.js +144 -0
  135. package/dist/esm/ag-grid-plus/schemes/components/SchemeManager.d.ts +16 -0
  136. package/dist/esm/ag-grid-plus/schemes/components/SchemeManager.js +334 -0
  137. package/dist/esm/ag-grid-plus/schemes/components/SchemeManager.less +35 -0
  138. package/dist/esm/ag-grid-plus/schemes/components/SchemeSelector.d.ts +20 -0
  139. package/dist/esm/ag-grid-plus/schemes/components/SchemeSelector.js +281 -0
  140. package/dist/esm/ag-grid-plus/schemes/components/SchemeSelector.less +39 -0
  141. package/dist/esm/ag-grid-plus/schemes/components/index.d.ts +4 -0
  142. package/dist/esm/ag-grid-plus/schemes/components/index.js +2 -0
  143. package/dist/esm/ag-grid-plus/schemes/constants.d.ts +23 -0
  144. package/dist/esm/ag-grid-plus/schemes/constants.js +33 -0
  145. package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.d.ts +6 -0
  146. package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.js +537 -0
  147. package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.d.ts +7 -0
  148. package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.js +27 -0
  149. package/dist/esm/ag-grid-plus/schemes/index.d.ts +16 -0
  150. package/dist/esm/ag-grid-plus/schemes/index.js +25 -0
  151. package/dist/esm/ag-grid-plus/schemes/storage/localStorageAdapter.d.ts +64 -0
  152. package/dist/esm/ag-grid-plus/schemes/storage/localStorageAdapter.js +363 -0
  153. package/dist/esm/ag-grid-plus/schemes/types.d.ts +126 -0
  154. package/dist/esm/ag-grid-plus/schemes/types.js +1 -0
  155. package/dist/esm/ag-grid-plus/schemes/utils/validator.d.ts +27 -0
  156. package/dist/esm/ag-grid-plus/schemes/utils/validator.js +104 -0
  157. package/dist/esm/ag-grid-plus/setting/ColumnSetting.d.ts +17 -0
  158. package/dist/esm/ag-grid-plus/setting/ColumnSetting.js +946 -0
  159. package/dist/esm/ag-grid-plus/setting/index.d.ts +1 -1
  160. package/dist/esm/ag-grid-plus/setting/index.js +69 -107
  161. package/dist/esm/ag-grid-plus/shared/hooks/useSchemeManager.d.ts +66 -0
  162. package/dist/esm/ag-grid-plus/shared/hooks/useSchemeManager.js +643 -0
  163. package/dist/esm/ag-grid-plus/storage/MemoryStorageAdapter.d.ts +76 -0
  164. package/dist/esm/ag-grid-plus/storage/MemoryStorageAdapter.js +273 -0
  165. package/dist/esm/ag-grid-plus/storage/SchemeSyncManager.d.ts +104 -0
  166. package/dist/esm/ag-grid-plus/storage/SchemeSyncManager.js +587 -0
  167. package/dist/esm/ag-grid-plus/storage/globalSyncManager.d.ts +74 -0
  168. package/dist/esm/ag-grid-plus/storage/globalSyncManager.js +275 -0
  169. package/dist/esm/ag-grid-plus/storage/index.d.ts +8 -0
  170. package/dist/esm/ag-grid-plus/storage/index.js +9 -0
  171. package/dist/esm/ag-grid-plus/storage/types.d.ts +113 -0
  172. package/dist/esm/ag-grid-plus/storage/types.js +1 -0
  173. package/dist/esm/ag-grid-plus/types.d.ts +310 -0
  174. package/dist/esm/ag-grid-plus/types.js +1 -0
  175. package/dist/esm/ag-grid-plus/utils/columnProcessors.d.ts +95 -0
  176. package/dist/esm/ag-grid-plus/utils/columnProcessors.js +251 -0
  177. package/dist/esm/ag-grid-plus/utils/constants.d.ts +41 -0
  178. package/dist/esm/ag-grid-plus/utils/constants.js +50 -0
  179. package/dist/esm/ag-grid-plus/utils/logger.d.ts +34 -0
  180. package/dist/esm/ag-grid-plus/utils/logger.js +114 -0
  181. package/dist/esm/ag-grid-plus/utils/sanitize.d.ts +15 -0
  182. package/dist/esm/ag-grid-plus/utils/sanitize.js +32 -0
  183. package/dist/esm/index.d.ts +3 -2
  184. package/dist/esm/index.js +8 -2
  185. package/dist/esm/standardFormDialog/withStandardForm.d.ts +2 -2
  186. package/dist/umd/qc-ui.min.css +1 -1
  187. package/dist/umd/qc-ui.min.js +1 -1
  188. package/package.json +3 -2
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "DEFAULT_SCHEME_NAME", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _constants.DEFAULT_SCHEME_NAME;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "MAX_QUERY_SCHEMES_PER_GRID", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _constants.MAX_QUERY_SCHEMES_PER_GRID;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "MAX_SCHEME_DESCRIPTION_LENGTH", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _constants.MAX_SCHEME_DESCRIPTION_LENGTH;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "MAX_SCHEME_NAME_LENGTH", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _constants.MAX_SCHEME_NAME_LENGTH;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "QUERY_SCHEMES_STORAGE_KEY", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _constants.QUERY_SCHEMES_STORAGE_KEY;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "QuerySchemesManager", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _QuerySchemesManager.QuerySchemesManager;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "SYSTEM_SCHEME_PREFIX", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _constants.SYSTEM_SCHEME_PREFIX;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "calculateDefaultOrder", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _validator.calculateDefaultOrder;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "checkDuplicateName", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _validator.checkDuplicateName;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "defaultQueryStorageAdapter", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _localStorageAdapter.defaultQueryStorageAdapter;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "generateUniqueName", {
67
+ enumerable: true,
68
+ get: function get() {
69
+ return _validator.generateUniqueName;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "mergeOrder", {
73
+ enumerable: true,
74
+ get: function get() {
75
+ return _validator.mergeOrder;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "useQueryOrderManager", {
79
+ enumerable: true,
80
+ get: function get() {
81
+ return _useQueryOrderManager.useQueryOrderManager;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "useQuerySchemes", {
85
+ enumerable: true,
86
+ get: function get() {
87
+ return _useQuerySchemes.useQuerySchemes;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "validateScheme", {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _validator.validateScheme;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "validateSchemeDescription", {
97
+ enumerable: true,
98
+ get: function get() {
99
+ return _validator.validateSchemeDescription;
100
+ }
101
+ });
102
+ Object.defineProperty(exports, "validateSchemeName", {
103
+ enumerable: true,
104
+ get: function get() {
105
+ return _validator.validateSchemeName;
106
+ }
107
+ });
108
+ var _useQuerySchemes = require("./hooks/useQuerySchemes");
109
+ var _useQueryOrderManager = require("./hooks/useQueryOrderManager");
110
+ var _QuerySchemesManager = require("./components/QuerySchemesManager");
111
+ var _localStorageAdapter = require("./storage/localStorageAdapter");
112
+ var _validator = require("./utils/validator");
113
+ var _constants = require("./constants");
@@ -0,0 +1,44 @@
1
+ import type { QueryScheme, QueryStorageAdapter } from '../types';
2
+ /**
3
+ * LocalStorage 存储适配器
4
+ * 默认实现,基于浏览器 LocalStorage
5
+ */
6
+ declare class LocalStorageAdapter implements QueryStorageAdapter {
7
+ /**
8
+ * 构造存储键
9
+ */
10
+ private getStorageKey;
11
+ /**
12
+ * 获取指定表格的所有方案
13
+ */
14
+ getSchemes(gridId: string): Promise<QueryScheme[]>;
15
+ /**
16
+ * 保存方案列表到存储
17
+ */
18
+ saveSchemes(gridId: string, schemes: QueryScheme[]): Promise<void>;
19
+ /**
20
+ * 清除指定表格的所有方案
21
+ */
22
+ clearSchemes(gridId: string): Promise<void>;
23
+ /**
24
+ * 获取所有表格的方案总大小(调试用)
25
+ */
26
+ getStorageSize(): number;
27
+ /**
28
+ * 生成当前方案ID存储键名
29
+ */
30
+ private getCurrentSchemeKey;
31
+ /**
32
+ * 获取当前激活的方案ID
33
+ */
34
+ getCurrentSchemeId(gridId: string): Promise<string | null>;
35
+ /**
36
+ * 保存当前激活的方案ID
37
+ */
38
+ saveCurrentSchemeId(gridId: string, schemeId: string | null): Promise<void>;
39
+ }
40
+ /**
41
+ * 默认存储适配器实例
42
+ */
43
+ export declare const defaultQueryStorageAdapter: LocalStorageAdapter;
44
+ export {};
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultQueryStorageAdapter = void 0;
7
+ var _constants = require("../constants");
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
10
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
11
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
12
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
14
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
+ /**
18
+ * LocalStorage 存储适配器
19
+ * 默认实现,基于浏览器 LocalStorage
20
+ */
21
+ var LocalStorageAdapter = /*#__PURE__*/function () {
22
+ function LocalStorageAdapter() {
23
+ _classCallCheck(this, LocalStorageAdapter);
24
+ }
25
+ _createClass(LocalStorageAdapter, [{
26
+ key: "getStorageKey",
27
+ value:
28
+ /**
29
+ * 构造存储键
30
+ */
31
+ function getStorageKey(gridId) {
32
+ return "".concat(_constants.QUERY_SCHEMES_STORAGE_KEY, ":").concat(gridId);
33
+ }
34
+
35
+ /**
36
+ * 获取指定表格的所有方案
37
+ */
38
+ }, {
39
+ key: "getSchemes",
40
+ value: (function () {
41
+ var _getSchemes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(gridId) {
42
+ var key, data, schemes;
43
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
44
+ while (1) switch (_context.prev = _context.next) {
45
+ case 0:
46
+ _context.prev = 0;
47
+ key = this.getStorageKey(gridId);
48
+ data = localStorage.getItem(key);
49
+ if (data) {
50
+ _context.next = 5;
51
+ break;
52
+ }
53
+ return _context.abrupt("return", []);
54
+ case 5:
55
+ schemes = JSON.parse(data); // 数据合法性检查
56
+ if (Array.isArray(schemes)) {
57
+ _context.next = 10;
58
+ break;
59
+ }
60
+ console.warn('[QuerySchemes] 存储数据格式错误,已清空');
61
+ localStorage.removeItem(key);
62
+ return _context.abrupt("return", []);
63
+ case 10:
64
+ return _context.abrupt("return", schemes);
65
+ case 13:
66
+ _context.prev = 13;
67
+ _context.t0 = _context["catch"](0);
68
+ console.error('[QuerySchemes] 读取方案失败:', _context.t0);
69
+ return _context.abrupt("return", []);
70
+ case 17:
71
+ case "end":
72
+ return _context.stop();
73
+ }
74
+ }, _callee, this, [[0, 13]]);
75
+ }));
76
+ function getSchemes(_x) {
77
+ return _getSchemes.apply(this, arguments);
78
+ }
79
+ return getSchemes;
80
+ }()
81
+ /**
82
+ * 保存方案列表到存储
83
+ */
84
+ )
85
+ }, {
86
+ key: "saveSchemes",
87
+ value: (function () {
88
+ var _saveSchemes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(gridId, schemes) {
89
+ var key, data;
90
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
91
+ while (1) switch (_context2.prev = _context2.next) {
92
+ case 0:
93
+ _context2.prev = 0;
94
+ key = this.getStorageKey(gridId);
95
+ data = JSON.stringify(schemes);
96
+ localStorage.setItem(key, data);
97
+ _context2.next = 13;
98
+ break;
99
+ case 6:
100
+ _context2.prev = 6;
101
+ _context2.t0 = _context2["catch"](0);
102
+ console.error('[QuerySchemes] 保存方案失败:', _context2.t0);
103
+
104
+ // 如果是容量不足错误,尝试清理旧数据
105
+ if (!(_context2.t0 instanceof DOMException && _context2.t0.name === 'QuotaExceededError')) {
106
+ _context2.next = 12;
107
+ break;
108
+ }
109
+ console.warn('[QuerySchemes] 存储空间不足,请删除一些旧方案');
110
+ throw new Error('存储空间不足,请删除一些旧方案');
111
+ case 12:
112
+ throw _context2.t0;
113
+ case 13:
114
+ case "end":
115
+ return _context2.stop();
116
+ }
117
+ }, _callee2, this, [[0, 6]]);
118
+ }));
119
+ function saveSchemes(_x2, _x3) {
120
+ return _saveSchemes.apply(this, arguments);
121
+ }
122
+ return saveSchemes;
123
+ }()
124
+ /**
125
+ * 清除指定表格的所有方案
126
+ */
127
+ )
128
+ }, {
129
+ key: "clearSchemes",
130
+ value: (function () {
131
+ var _clearSchemes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(gridId) {
132
+ var key;
133
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
134
+ while (1) switch (_context3.prev = _context3.next) {
135
+ case 0:
136
+ _context3.prev = 0;
137
+ key = this.getStorageKey(gridId);
138
+ localStorage.removeItem(key);
139
+ _context3.next = 9;
140
+ break;
141
+ case 5:
142
+ _context3.prev = 5;
143
+ _context3.t0 = _context3["catch"](0);
144
+ console.error('[QuerySchemes] 清除方案失败:', _context3.t0);
145
+ throw _context3.t0;
146
+ case 9:
147
+ case "end":
148
+ return _context3.stop();
149
+ }
150
+ }, _callee3, this, [[0, 5]]);
151
+ }));
152
+ function clearSchemes(_x4) {
153
+ return _clearSchemes.apply(this, arguments);
154
+ }
155
+ return clearSchemes;
156
+ }()
157
+ /**
158
+ * 获取所有表格的方案总大小(调试用)
159
+ */
160
+ )
161
+ }, {
162
+ key: "getStorageSize",
163
+ value: function getStorageSize() {
164
+ var totalSize = 0;
165
+ var keys = Object.keys(localStorage);
166
+ for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
167
+ var key = _keys[_i];
168
+ if (key.startsWith(_constants.QUERY_SCHEMES_STORAGE_KEY)) {
169
+ var value = localStorage.getItem(key);
170
+ if (value) {
171
+ totalSize += value.length * 2; // UTF-16 编码,每字符占 2 字节
172
+ }
173
+ }
174
+ }
175
+ return totalSize;
176
+ }
177
+
178
+ /**
179
+ * 生成当前方案ID存储键名
180
+ */
181
+ }, {
182
+ key: "getCurrentSchemeKey",
183
+ value: function getCurrentSchemeKey(gridId) {
184
+ return "".concat(this.getStorageKey(gridId)).concat(_constants.CURRENT_QUERY_SCHEME_SUFFIX);
185
+ }
186
+
187
+ /**
188
+ * 获取当前激活的方案ID
189
+ */
190
+ }, {
191
+ key: "getCurrentSchemeId",
192
+ value: (function () {
193
+ var _getCurrentSchemeId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(gridId) {
194
+ var key, schemeId;
195
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
196
+ while (1) switch (_context4.prev = _context4.next) {
197
+ case 0:
198
+ _context4.prev = 0;
199
+ key = this.getCurrentSchemeKey(gridId);
200
+ schemeId = localStorage.getItem(key);
201
+ return _context4.abrupt("return", schemeId || null);
202
+ case 6:
203
+ _context4.prev = 6;
204
+ _context4.t0 = _context4["catch"](0);
205
+ console.error('[QuerySchemes] 获取当前方案ID失败:', _context4.t0);
206
+ return _context4.abrupt("return", null);
207
+ case 10:
208
+ case "end":
209
+ return _context4.stop();
210
+ }
211
+ }, _callee4, this, [[0, 6]]);
212
+ }));
213
+ function getCurrentSchemeId(_x5) {
214
+ return _getCurrentSchemeId.apply(this, arguments);
215
+ }
216
+ return getCurrentSchemeId;
217
+ }()
218
+ /**
219
+ * 保存当前激活的方案ID
220
+ */
221
+ )
222
+ }, {
223
+ key: "saveCurrentSchemeId",
224
+ value: (function () {
225
+ var _saveCurrentSchemeId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(gridId, schemeId) {
226
+ var key;
227
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
228
+ while (1) switch (_context5.prev = _context5.next) {
229
+ case 0:
230
+ _context5.prev = 0;
231
+ key = this.getCurrentSchemeKey(gridId);
232
+ if (schemeId === null) {
233
+ localStorage.removeItem(key);
234
+ } else {
235
+ localStorage.setItem(key, schemeId);
236
+ }
237
+ _context5.next = 9;
238
+ break;
239
+ case 5:
240
+ _context5.prev = 5;
241
+ _context5.t0 = _context5["catch"](0);
242
+ console.error('[QuerySchemes] 保存当前方案ID失败:', _context5.t0);
243
+ throw _context5.t0;
244
+ case 9:
245
+ case "end":
246
+ return _context5.stop();
247
+ }
248
+ }, _callee5, this, [[0, 5]]);
249
+ }));
250
+ function saveCurrentSchemeId(_x6, _x7) {
251
+ return _saveCurrentSchemeId.apply(this, arguments);
252
+ }
253
+ return saveCurrentSchemeId;
254
+ }())
255
+ }]);
256
+ return LocalStorageAdapter;
257
+ }();
258
+ /**
259
+ * 默认存储适配器实例
260
+ */
261
+ var defaultQueryStorageAdapter = exports.defaultQueryStorageAdapter = new LocalStorageAdapter();
@@ -0,0 +1,143 @@
1
+ /**
2
+ * 查询方案 (Query Schemes) 类型定义
3
+ * 平行于列方案 (Column Schemes),用于管理查询表单的项目顺序
4
+ */
5
+ /**
6
+ * 查询方案数据结构
7
+ */
8
+ export interface QueryScheme {
9
+ /** 方案唯一标识(UUID) */
10
+ id: string;
11
+ /** 方案名称(用户可编辑) */
12
+ name: string;
13
+ /** 是否为默认方案(首次加载自动应用) */
14
+ isDefault?: boolean;
15
+ /** 是否为系统预设方案(不可删除) */
16
+ isSystem?: boolean;
17
+ /** 创建时间戳 */
18
+ createdAt: number;
19
+ /** 更新时间戳 */
20
+ updatedAt: number;
21
+ /** 查询项字段名数组,按显示顺序排列 */
22
+ itemsOrder: string[];
23
+ /** 方案描述(可选) */
24
+ description?: string;
25
+ /** 标签分类(可选,扩展功能) */
26
+ tags?: string[];
27
+ /** 共享级别(可选,扩展功能) */
28
+ shareLevel?: 'private' | 'team' | 'public';
29
+ }
30
+ /**
31
+ * 查询表单项接口扩展
32
+ * 在原有 QueryFormItem 基础上添加 order 属性
33
+ */
34
+ export interface QueryFormItemWithOrder {
35
+ /** 字段名(用于排序标识) */
36
+ field: string;
37
+ /** 字段显示名称 */
38
+ headerName?: string;
39
+ /** 默认顺序权重(数字越小越靠前) */
40
+ order?: number;
41
+ /** 其他原有属性 */
42
+ [key: string]: any;
43
+ }
44
+ /**
45
+ * 方案管理器配置
46
+ */
47
+ export interface QuerySchemeManagerConfig {
48
+ /** 表格唯一标识 */
49
+ gridId: string;
50
+ /** 自定义存储适配器(可选) */
51
+ storageAdapter?: QueryStorageAdapter;
52
+ /** 是否启用自动保存到当前方案(默认 true) */
53
+ enableAutoSave?: boolean;
54
+ /** 方案切换回调 */
55
+ onSchemeChange?: (scheme: QueryScheme | null) => void;
56
+ /** 方案保存回调 */
57
+ onSchemeSave?: (scheme: QueryScheme) => void;
58
+ /** 方案删除回调 */
59
+ onSchemeDelete?: (schemeId: string) => void;
60
+ }
61
+ /**
62
+ * 存储适配器接口
63
+ * 允许自定义存储实现(LocalStorage / IndexedDB / 后端API等)
64
+ */
65
+ export interface QueryStorageAdapter {
66
+ /**
67
+ * 获取指定表格的所有方案
68
+ * @param gridId 表格唯一标识
69
+ * @returns 方案列表
70
+ */
71
+ getSchemes(gridId: string): Promise<QueryScheme[]>;
72
+ /**
73
+ * 保存方案列表到存储
74
+ * @param gridId 表格唯一标识
75
+ * @param schemes 方案列表
76
+ */
77
+ saveSchemes(gridId: string, schemes: QueryScheme[]): Promise<void>;
78
+ /**
79
+ * 清除指定表格的所有方案
80
+ * @param gridId 表格唯一标识
81
+ */
82
+ clearSchemes?(gridId: string): Promise<void>;
83
+ /**
84
+ * 获取当前激活的方案ID(用于刷新后恢复)
85
+ * @param gridId 表格唯一标识
86
+ * @returns 方案ID,如果没有则返回 null
87
+ */
88
+ getCurrentSchemeId?(gridId: string): Promise<string | null>;
89
+ /**
90
+ * 保存当前激活的方案ID
91
+ * @param gridId 表格唯一标识
92
+ * @param schemeId 方案ID,null 表示清除
93
+ */
94
+ saveCurrentSchemeId?(gridId: string, schemeId: string | null): Promise<void>;
95
+ }
96
+ /**
97
+ * 方案验证结果
98
+ */
99
+ export interface QuerySchemeValidationResult {
100
+ /** 是否有效 */
101
+ valid: boolean;
102
+ /** 无效的字段列表 */
103
+ invalidFields: string[];
104
+ /** 验证后的有效字段顺序 */
105
+ validatedOrder: string[];
106
+ /** 警告信息 */
107
+ warnings?: string[];
108
+ }
109
+ /**
110
+ * 方案管理器 Hook 返回值
111
+ */
112
+ export interface UseQuerySchemesReturn {
113
+ /** 当前激活的方案 */
114
+ currentScheme: QueryScheme | null;
115
+ /** 所有可用方案列表 */
116
+ schemes: QueryScheme[];
117
+ /** 当前配置是否有未保存的修改 */
118
+ isDirty: boolean;
119
+ /** 是否正在加载 */
120
+ loading: boolean;
121
+ /** 加载指定方案 */
122
+ loadScheme: (schemeId: string) => Promise<void>;
123
+ /** 保存当前方案(更新现有方案) */
124
+ saveScheme: (updates?: Partial<QueryScheme>) => Promise<void>;
125
+ /** 创建新方案 */
126
+ createScheme: (name: string, itemsOrder: string[], options?: Partial<QueryScheme>) => Promise<QueryScheme>;
127
+ /** 更新方案信息(不影响 itemsOrder) */
128
+ updateScheme: (schemeId: string, updates: Partial<Omit<QueryScheme, 'id' | 'itemsOrder'>>) => Promise<void>;
129
+ /** 删除方案 */
130
+ deleteScheme: (schemeId: string) => Promise<void>;
131
+ /** 重置到方案原始状态 */
132
+ resetToScheme: () => void;
133
+ /** 设置默认方案 */
134
+ setDefaultScheme: (schemeId: string) => Promise<void>;
135
+ /** 验证方案有效性 */
136
+ validateScheme: (scheme: QueryScheme, currentFormItems: QueryFormItemWithOrder[]) => QuerySchemeValidationResult;
137
+ }
138
+ /**
139
+ * 旧格式查询顺序数据(用于迁移)
140
+ */
141
+ export interface LegacyQueryOrder {
142
+ [gridKey: string]: string[];
143
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,36 @@
1
+ import type { QueryScheme, QuerySchemeValidationResult, QueryFormItemWithOrder } from '../types';
2
+ /**
3
+ * 验证方案名称
4
+ */
5
+ export declare function validateSchemeName(name: string): {
6
+ valid: boolean;
7
+ error?: string;
8
+ };
9
+ /**
10
+ * 验证方案描述
11
+ */
12
+ export declare function validateSchemeDescription(description: string): {
13
+ valid: boolean;
14
+ error?: string;
15
+ };
16
+ /**
17
+ * 检查方案名称是否重复
18
+ */
19
+ export declare function checkDuplicateName(name: string, schemes: QueryScheme[], excludeId?: string): boolean;
20
+ /**
21
+ * 生成唯一的方案名称
22
+ */
23
+ export declare function generateUniqueName(baseName: string, schemes: QueryScheme[]): string;
24
+ /**
25
+ * 验证方案的字段顺序有效性
26
+ */
27
+ export declare function validateScheme(scheme: QueryScheme, currentFormItems: QueryFormItemWithOrder[]): QuerySchemeValidationResult;
28
+ /**
29
+ * 根据 order 属性计算默认顺序
30
+ */
31
+ export declare function calculateDefaultOrder(formItems: QueryFormItemWithOrder[]): string[];
32
+ /**
33
+ * 合并方案顺序和当前表单项
34
+ * 保留自定义顺序,补充新增字段
35
+ */
36
+ export declare function mergeOrder(schemeOrder: string[], formItems: QueryFormItemWithOrder[]): string[];