@nokecy/qc-ui 1.0.70 → 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.
- package/dist/cjs/ag-grid-plus/ag-gridPlus.js +409 -206
- package/dist/cjs/ag-grid-plus/context/gridContext.d.ts +30 -5
- package/dist/cjs/ag-grid-plus/context/gridContext.js +6 -1
- package/dist/cjs/ag-grid-plus/errors/ErrorBoundary.d.ts +36 -0
- package/dist/cjs/ag-grid-plus/errors/ErrorBoundary.js +143 -0
- package/dist/cjs/ag-grid-plus/errors/index.d.ts +3 -0
- package/dist/cjs/ag-grid-plus/errors/index.js +31 -0
- package/dist/cjs/ag-grid-plus/errors/types.d.ts +71 -0
- package/dist/cjs/ag-grid-plus/errors/types.js +137 -0
- package/dist/cjs/ag-grid-plus/hooks/index.d.ts +7 -0
- package/dist/cjs/ag-grid-plus/hooks/index.js +51 -0
- package/dist/cjs/ag-grid-plus/hooks/useAgGridCalculation.d.ts +88 -0
- package/dist/cjs/ag-grid-plus/hooks/useAgGridCalculation.js +224 -0
- package/dist/cjs/ag-grid-plus/hooks/useAgGridData.d.ts +91 -0
- package/dist/cjs/ag-grid-plus/hooks/useAgGridData.js +230 -0
- package/dist/cjs/ag-grid-plus/hooks/useGridPlusColumnState.d.ts +1 -8
- package/dist/cjs/ag-grid-plus/hooks/useGridState.d.ts +153 -0
- package/dist/cjs/ag-grid-plus/hooks/useGridState.js +258 -0
- package/dist/cjs/ag-grid-plus/index.d.ts +5 -0
- package/dist/cjs/ag-grid-plus/index.js +164 -0
- package/dist/cjs/ag-grid-plus/interface.d.ts +37 -0
- package/dist/cjs/ag-grid-plus/querySchemes/components/QuerySchemesManager.d.ts +21 -0
- package/dist/cjs/ag-grid-plus/querySchemes/components/QuerySchemesManager.js +580 -0
- package/dist/cjs/ag-grid-plus/querySchemes/components/QuerySchemesManager.less +86 -0
- package/dist/cjs/ag-grid-plus/querySchemes/components/index.d.ts +5 -0
- package/dist/cjs/ag-grid-plus/querySchemes/components/index.js +12 -0
- package/dist/cjs/ag-grid-plus/querySchemes/constants.d.ts +17 -0
- package/dist/cjs/ag-grid-plus/querySchemes/constants.js +30 -0
- package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.d.ts +10 -0
- package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.js +65 -0
- package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.d.ts +6 -0
- package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.js +542 -0
- package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.d.ts +7 -0
- package/dist/cjs/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.js +32 -0
- package/dist/cjs/ag-grid-plus/querySchemes/index.d.ts +11 -0
- package/dist/cjs/ag-grid-plus/querySchemes/index.js +113 -0
- package/dist/cjs/ag-grid-plus/querySchemes/storage/localStorageAdapter.d.ts +44 -0
- package/dist/cjs/ag-grid-plus/querySchemes/storage/localStorageAdapter.js +261 -0
- package/dist/cjs/ag-grid-plus/querySchemes/types.d.ts +143 -0
- package/dist/cjs/ag-grid-plus/querySchemes/types.js +5 -0
- package/dist/cjs/ag-grid-plus/querySchemes/utils/validator.d.ts +36 -0
- package/dist/cjs/ag-grid-plus/querySchemes/utils/validator.js +155 -0
- package/dist/cjs/ag-grid-plus/schemes/components/SchemeManager.d.ts +16 -0
- package/dist/cjs/ag-grid-plus/schemes/components/SchemeManager.js +342 -0
- package/dist/cjs/ag-grid-plus/schemes/components/SchemeManager.less +35 -0
- package/dist/cjs/ag-grid-plus/schemes/components/SchemeSelector.d.ts +20 -0
- package/dist/cjs/ag-grid-plus/schemes/components/SchemeSelector.js +289 -0
- package/dist/cjs/ag-grid-plus/schemes/components/SchemeSelector.less +39 -0
- package/dist/cjs/ag-grid-plus/schemes/components/index.d.ts +4 -0
- package/dist/cjs/ag-grid-plus/schemes/components/index.js +19 -0
- package/dist/cjs/ag-grid-plus/schemes/constants.d.ts +23 -0
- package/dist/cjs/ag-grid-plus/schemes/constants.js +39 -0
- package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.d.ts +6 -0
- package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.js +542 -0
- package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.d.ts +7 -0
- package/dist/cjs/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.js +32 -0
- package/dist/cjs/ag-grid-plus/schemes/index.d.ts +16 -0
- package/dist/cjs/ag-grid-plus/schemes/index.js +124 -0
- package/dist/cjs/ag-grid-plus/schemes/storage/localStorageAdapter.d.ts +64 -0
- package/dist/cjs/ag-grid-plus/schemes/storage/localStorageAdapter.js +368 -0
- package/dist/cjs/ag-grid-plus/schemes/types.d.ts +126 -0
- package/dist/cjs/ag-grid-plus/schemes/types.js +5 -0
- package/dist/cjs/ag-grid-plus/schemes/utils/validator.d.ts +27 -0
- package/dist/cjs/ag-grid-plus/schemes/utils/validator.js +113 -0
- package/dist/cjs/ag-grid-plus/setting/ColumnSetting.d.ts +17 -0
- package/dist/cjs/ag-grid-plus/setting/ColumnSetting.js +955 -0
- package/dist/cjs/ag-grid-plus/setting/index.d.ts +1 -1
- package/dist/cjs/ag-grid-plus/setting/index.js +74 -111
- package/dist/cjs/ag-grid-plus/shared/hooks/useSchemeManager.d.ts +66 -0
- package/dist/cjs/ag-grid-plus/shared/hooks/useSchemeManager.js +648 -0
- package/dist/cjs/ag-grid-plus/storage/MemoryStorageAdapter.d.ts +76 -0
- package/dist/cjs/ag-grid-plus/storage/MemoryStorageAdapter.js +276 -0
- package/dist/cjs/ag-grid-plus/storage/SchemeSyncManager.d.ts +114 -0
- package/dist/cjs/ag-grid-plus/storage/SchemeSyncManager.js +615 -0
- package/dist/cjs/ag-grid-plus/storage/globalSyncManager.d.ts +100 -0
- package/dist/cjs/ag-grid-plus/storage/globalSyncManager.js +335 -0
- package/dist/cjs/ag-grid-plus/storage/index.d.ts +8 -0
- package/dist/cjs/ag-grid-plus/storage/index.js +49 -0
- package/dist/cjs/ag-grid-plus/storage/types.d.ts +144 -0
- package/dist/cjs/ag-grid-plus/storage/types.js +5 -0
- package/dist/cjs/ag-grid-plus/types.d.ts +310 -0
- package/dist/cjs/ag-grid-plus/types.js +5 -0
- package/dist/cjs/ag-grid-plus/utils/columnProcessors.d.ts +95 -0
- package/dist/cjs/ag-grid-plus/utils/columnProcessors.js +265 -0
- package/dist/cjs/ag-grid-plus/utils/constants.d.ts +41 -0
- package/dist/cjs/ag-grid-plus/utils/constants.js +56 -0
- package/dist/cjs/ag-grid-plus/utils/logger.d.ts +34 -0
- package/dist/cjs/ag-grid-plus/utils/logger.js +119 -0
- package/dist/cjs/ag-grid-plus/utils/sanitize.d.ts +15 -0
- package/dist/cjs/ag-grid-plus/utils/sanitize.js +39 -0
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +84 -0
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +410 -206
- package/dist/esm/ag-grid-plus/context/gridContext.d.ts +30 -5
- package/dist/esm/ag-grid-plus/context/gridContext.js +6 -1
- package/dist/esm/ag-grid-plus/errors/ErrorBoundary.d.ts +36 -0
- package/dist/esm/ag-grid-plus/errors/ErrorBoundary.js +137 -0
- package/dist/esm/ag-grid-plus/errors/index.d.ts +3 -0
- package/dist/esm/ag-grid-plus/errors/index.js +2 -0
- package/dist/esm/ag-grid-plus/errors/types.d.ts +71 -0
- package/dist/esm/ag-grid-plus/errors/types.js +135 -0
- package/dist/esm/ag-grid-plus/hooks/index.d.ts +7 -0
- package/dist/esm/ag-grid-plus/hooks/index.js +10 -0
- package/dist/esm/ag-grid-plus/hooks/useAgGridCalculation.d.ts +88 -0
- package/dist/esm/ag-grid-plus/hooks/useAgGridCalculation.js +217 -0
- package/dist/esm/ag-grid-plus/hooks/useAgGridData.d.ts +91 -0
- package/dist/esm/ag-grid-plus/hooks/useAgGridData.js +225 -0
- package/dist/esm/ag-grid-plus/hooks/useGridPlusColumnState.d.ts +1 -8
- package/dist/esm/ag-grid-plus/hooks/useGridState.d.ts +153 -0
- package/dist/esm/ag-grid-plus/hooks/useGridState.js +258 -0
- package/dist/esm/ag-grid-plus/index.d.ts +5 -0
- package/dist/esm/ag-grid-plus/index.js +6 -1
- package/dist/esm/ag-grid-plus/interface.d.ts +37 -0
- package/dist/esm/ag-grid-plus/querySchemes/components/QuerySchemesManager.d.ts +21 -0
- package/dist/esm/ag-grid-plus/querySchemes/components/QuerySchemesManager.js +572 -0
- package/dist/esm/ag-grid-plus/querySchemes/components/QuerySchemesManager.less +86 -0
- package/dist/esm/ag-grid-plus/querySchemes/components/index.d.ts +5 -0
- package/dist/esm/ag-grid-plus/querySchemes/components/index.js +5 -0
- package/dist/esm/ag-grid-plus/querySchemes/constants.d.ts +17 -0
- package/dist/esm/ag-grid-plus/querySchemes/constants.js +24 -0
- package/dist/esm/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.d.ts +10 -0
- package/dist/esm/ag-grid-plus/querySchemes/hooks/useQueryOrderManager.js +60 -0
- package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.d.ts +6 -0
- package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.js +537 -0
- package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.d.ts +7 -0
- package/dist/esm/ag-grid-plus/querySchemes/hooks/useQuerySchemes.refactored.js +27 -0
- package/dist/esm/ag-grid-plus/querySchemes/index.d.ts +11 -0
- package/dist/esm/ag-grid-plus/querySchemes/index.js +20 -0
- package/dist/esm/ag-grid-plus/querySchemes/storage/localStorageAdapter.d.ts +44 -0
- package/dist/esm/ag-grid-plus/querySchemes/storage/localStorageAdapter.js +256 -0
- package/dist/esm/ag-grid-plus/querySchemes/types.d.ts +143 -0
- package/dist/esm/ag-grid-plus/querySchemes/types.js +1 -0
- package/dist/esm/ag-grid-plus/querySchemes/utils/validator.d.ts +36 -0
- package/dist/esm/ag-grid-plus/querySchemes/utils/validator.js +144 -0
- package/dist/esm/ag-grid-plus/schemes/components/SchemeManager.d.ts +16 -0
- package/dist/esm/ag-grid-plus/schemes/components/SchemeManager.js +334 -0
- package/dist/esm/ag-grid-plus/schemes/components/SchemeManager.less +35 -0
- package/dist/esm/ag-grid-plus/schemes/components/SchemeSelector.d.ts +20 -0
- package/dist/esm/ag-grid-plus/schemes/components/SchemeSelector.js +281 -0
- package/dist/esm/ag-grid-plus/schemes/components/SchemeSelector.less +39 -0
- package/dist/esm/ag-grid-plus/schemes/components/index.d.ts +4 -0
- package/dist/esm/ag-grid-plus/schemes/components/index.js +2 -0
- package/dist/esm/ag-grid-plus/schemes/constants.d.ts +23 -0
- package/dist/esm/ag-grid-plus/schemes/constants.js +33 -0
- package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.d.ts +6 -0
- package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.js +537 -0
- package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.d.ts +7 -0
- package/dist/esm/ag-grid-plus/schemes/hooks/useColumnSchemes.refactored.js +27 -0
- package/dist/esm/ag-grid-plus/schemes/index.d.ts +16 -0
- package/dist/esm/ag-grid-plus/schemes/index.js +25 -0
- package/dist/esm/ag-grid-plus/schemes/storage/localStorageAdapter.d.ts +64 -0
- package/dist/esm/ag-grid-plus/schemes/storage/localStorageAdapter.js +363 -0
- package/dist/esm/ag-grid-plus/schemes/types.d.ts +126 -0
- package/dist/esm/ag-grid-plus/schemes/types.js +1 -0
- package/dist/esm/ag-grid-plus/schemes/utils/validator.d.ts +27 -0
- package/dist/esm/ag-grid-plus/schemes/utils/validator.js +104 -0
- package/dist/esm/ag-grid-plus/setting/ColumnSetting.d.ts +17 -0
- package/dist/esm/ag-grid-plus/setting/ColumnSetting.js +946 -0
- package/dist/esm/ag-grid-plus/setting/index.d.ts +1 -1
- package/dist/esm/ag-grid-plus/setting/index.js +69 -107
- package/dist/esm/ag-grid-plus/shared/hooks/useSchemeManager.d.ts +66 -0
- package/dist/esm/ag-grid-plus/shared/hooks/useSchemeManager.js +643 -0
- package/dist/esm/ag-grid-plus/storage/MemoryStorageAdapter.d.ts +76 -0
- package/dist/esm/ag-grid-plus/storage/MemoryStorageAdapter.js +273 -0
- package/dist/esm/ag-grid-plus/storage/SchemeSyncManager.d.ts +114 -0
- package/dist/esm/ag-grid-plus/storage/SchemeSyncManager.js +609 -0
- package/dist/esm/ag-grid-plus/storage/globalSyncManager.d.ts +100 -0
- package/dist/esm/ag-grid-plus/storage/globalSyncManager.js +321 -0
- package/dist/esm/ag-grid-plus/storage/index.d.ts +8 -0
- package/dist/esm/ag-grid-plus/storage/index.js +9 -0
- package/dist/esm/ag-grid-plus/storage/types.d.ts +144 -0
- package/dist/esm/ag-grid-plus/storage/types.js +1 -0
- package/dist/esm/ag-grid-plus/types.d.ts +310 -0
- package/dist/esm/ag-grid-plus/types.js +1 -0
- package/dist/esm/ag-grid-plus/utils/columnProcessors.d.ts +95 -0
- package/dist/esm/ag-grid-plus/utils/columnProcessors.js +251 -0
- package/dist/esm/ag-grid-plus/utils/constants.d.ts +41 -0
- package/dist/esm/ag-grid-plus/utils/constants.js +50 -0
- package/dist/esm/ag-grid-plus/utils/logger.d.ts +34 -0
- package/dist/esm/ag-grid-plus/utils/logger.js +114 -0
- package/dist/esm/ag-grid-plus/utils/sanitize.d.ts +15 -0
- package/dist/esm/ag-grid-plus/utils/sanitize.js +32 -0
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +8 -2
- package/dist/esm/standardFormDialog/useStandardFormSchema.d.ts +1 -1
- package/dist/esm/standardFormDialog/withStandardForm.d.ts +2 -2
- package/dist/umd/qc-ui.min.css +1 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.REQUEST_DEBOUNCE_DELAY = exports.DEFAULT_SEARCH_SORT_ORDER = exports.DEFAULT_PAGE_SIZE_WHEN_HIDDEN = exports.DEFAULT_PAGE_SIZE_OPTIONS = exports.DEFAULT_PAGE_SIZE = exports.DEFAULT_EMPTY_TEXT = exports.DEFAULT_DECIMAL_PLACES = exports.COLUMN_STATE_SAVE_DEBOUNCE_DELAY = exports.COLUMN_STATE_APPLY_DELAY = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* AG-Grid Plus 常量定义
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 列状态应用延迟(毫秒)
|
|
13
|
+
* AG-Grid 需要延迟应用列状态以确保 DOM 已就绪
|
|
14
|
+
*/
|
|
15
|
+
var COLUMN_STATE_APPLY_DELAY = exports.COLUMN_STATE_APPLY_DELAY = 10;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 默认查询表单排序顺序
|
|
19
|
+
* 用于未指定 searchSort 的列
|
|
20
|
+
*/
|
|
21
|
+
var DEFAULT_SEARCH_SORT_ORDER = exports.DEFAULT_SEARCH_SORT_ORDER = 999;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 默认分页大小选项
|
|
25
|
+
*/
|
|
26
|
+
var DEFAULT_PAGE_SIZE_OPTIONS = exports.DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 50, 100, 200, 500, 1000, 10000];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 默认分页大小
|
|
30
|
+
*/
|
|
31
|
+
var DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = 200;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 隐藏分页时的默认分页大小
|
|
35
|
+
*/
|
|
36
|
+
var DEFAULT_PAGE_SIZE_WHEN_HIDDEN = exports.DEFAULT_PAGE_SIZE_WHEN_HIDDEN = 10000;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 计算列默认小数位数
|
|
40
|
+
*/
|
|
41
|
+
var DEFAULT_DECIMAL_PLACES = exports.DEFAULT_DECIMAL_PLACES = 2;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 空数据默认提示文本
|
|
45
|
+
*/
|
|
46
|
+
var DEFAULT_EMPTY_TEXT = exports.DEFAULT_EMPTY_TEXT = '没有找到数据,试试调整筛选条件吧!';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 请求防抖延迟(毫秒)
|
|
50
|
+
*/
|
|
51
|
+
var REQUEST_DEBOUNCE_DELAY = exports.REQUEST_DEBOUNCE_DELAY = 300;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 列配置保存防抖延迟(毫秒)
|
|
55
|
+
*/
|
|
56
|
+
var COLUMN_STATE_SAVE_DEBOUNCE_DELAY = exports.COLUMN_STATE_SAVE_DEBOUNCE_DELAY = 300;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AG-Grid Plus 日志工具
|
|
3
|
+
*/
|
|
4
|
+
declare enum LogLevel {
|
|
5
|
+
DEBUG = "debug",
|
|
6
|
+
INFO = "info",
|
|
7
|
+
WARN = "warn",
|
|
8
|
+
ERROR = "error",
|
|
9
|
+
FATAL = "fatal"
|
|
10
|
+
}
|
|
11
|
+
interface LogEntry {
|
|
12
|
+
timestamp: string;
|
|
13
|
+
level: LogLevel;
|
|
14
|
+
message: string;
|
|
15
|
+
context?: any;
|
|
16
|
+
}
|
|
17
|
+
declare class Logger {
|
|
18
|
+
private isDevelopment;
|
|
19
|
+
private enableConsole;
|
|
20
|
+
private logHistory;
|
|
21
|
+
private maxHistorySize;
|
|
22
|
+
private log;
|
|
23
|
+
debug(message: string, context?: any): void;
|
|
24
|
+
info(message: string, context?: any): void;
|
|
25
|
+
warn(message: string, context?: any): void;
|
|
26
|
+
error(message: string, context?: any): void;
|
|
27
|
+
fatal(message: string, context?: any): void;
|
|
28
|
+
getHistory(): LogEntry[];
|
|
29
|
+
clearHistory(): void;
|
|
30
|
+
setConsoleEnabled(enabled: boolean): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const logger: Logger;
|
|
33
|
+
export { LogLevel };
|
|
34
|
+
export type { LogEntry };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.logger = exports.LogLevel = void 0;
|
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
+
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); } }
|
|
16
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
|
+
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); }
|
|
20
|
+
/**
|
|
21
|
+
* AG-Grid Plus 日志工具
|
|
22
|
+
*/
|
|
23
|
+
var LogLevel = exports.LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
24
|
+
LogLevel["DEBUG"] = "debug";
|
|
25
|
+
LogLevel["INFO"] = "info";
|
|
26
|
+
LogLevel["WARN"] = "warn";
|
|
27
|
+
LogLevel["ERROR"] = "error";
|
|
28
|
+
LogLevel["FATAL"] = "fatal";
|
|
29
|
+
return LogLevel;
|
|
30
|
+
}(LogLevel || {});
|
|
31
|
+
var Logger = /*#__PURE__*/function () {
|
|
32
|
+
function Logger() {
|
|
33
|
+
_classCallCheck(this, Logger);
|
|
34
|
+
_defineProperty(this, "isDevelopment", process.env.NODE_ENV === 'development');
|
|
35
|
+
_defineProperty(this, "enableConsole", true);
|
|
36
|
+
_defineProperty(this, "logHistory", []);
|
|
37
|
+
_defineProperty(this, "maxHistorySize", 100);
|
|
38
|
+
}
|
|
39
|
+
_createClass(Logger, [{
|
|
40
|
+
key: "log",
|
|
41
|
+
value: function log(level, message, context) {
|
|
42
|
+
var entry = {
|
|
43
|
+
timestamp: new Date().toISOString(),
|
|
44
|
+
level: level,
|
|
45
|
+
message: message,
|
|
46
|
+
context: context
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// 记录到历史
|
|
50
|
+
this.logHistory.push(entry);
|
|
51
|
+
if (this.logHistory.length > this.maxHistorySize) {
|
|
52
|
+
this.logHistory.shift();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 控制台输出
|
|
56
|
+
if (this.enableConsole) {
|
|
57
|
+
var prefix = "[AG-Grid Plus] [".concat(level.toUpperCase(), "]");
|
|
58
|
+
var timestamp = new Date().toLocaleTimeString();
|
|
59
|
+
switch (level) {
|
|
60
|
+
case LogLevel.DEBUG:
|
|
61
|
+
this.isDevelopment && console.log("".concat(prefix, " ").concat(timestamp), message, context || '');
|
|
62
|
+
break;
|
|
63
|
+
case LogLevel.INFO:
|
|
64
|
+
console.log("".concat(prefix, " ").concat(timestamp), message, context || '');
|
|
65
|
+
break;
|
|
66
|
+
case LogLevel.WARN:
|
|
67
|
+
console.warn("".concat(prefix, " ").concat(timestamp), message, context || '');
|
|
68
|
+
break;
|
|
69
|
+
case LogLevel.ERROR:
|
|
70
|
+
case LogLevel.FATAL:
|
|
71
|
+
console.error("".concat(prefix, " ").concat(timestamp), message, context || '');
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "debug",
|
|
78
|
+
value: function debug(message, context) {
|
|
79
|
+
this.log(LogLevel.DEBUG, message, context);
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "info",
|
|
83
|
+
value: function info(message, context) {
|
|
84
|
+
this.log(LogLevel.INFO, message, context);
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "warn",
|
|
88
|
+
value: function warn(message, context) {
|
|
89
|
+
this.log(LogLevel.WARN, message, context);
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "error",
|
|
93
|
+
value: function error(message, context) {
|
|
94
|
+
this.log(LogLevel.ERROR, message, context);
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "fatal",
|
|
98
|
+
value: function fatal(message, context) {
|
|
99
|
+
this.log(LogLevel.FATAL, message, context);
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "getHistory",
|
|
103
|
+
value: function getHistory() {
|
|
104
|
+
return _toConsumableArray(this.logHistory);
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "clearHistory",
|
|
108
|
+
value: function clearHistory() {
|
|
109
|
+
this.logHistory = [];
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "setConsoleEnabled",
|
|
113
|
+
value: function setConsoleEnabled(enabled) {
|
|
114
|
+
this.enableConsole = enabled;
|
|
115
|
+
}
|
|
116
|
+
}]);
|
|
117
|
+
return Logger;
|
|
118
|
+
}();
|
|
119
|
+
var logger = exports.logger = new Logger();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML 内容安全转义工具
|
|
3
|
+
* 防止 XSS 攻击
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 转义 HTML 特殊字符
|
|
7
|
+
* @param unsafeText 未转义的文本
|
|
8
|
+
* @returns 转义后的安全文本
|
|
9
|
+
*/
|
|
10
|
+
export declare function escapeHtml(unsafeText: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* 生成安全的 HTML 模板
|
|
13
|
+
* 用于 AG-Grid 的 overlayNoRowsTemplate 等场景
|
|
14
|
+
*/
|
|
15
|
+
export declare function createSafeHtmlTemplate(text: string, styles?: string): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createSafeHtmlTemplate = createSafeHtmlTemplate;
|
|
7
|
+
exports.escapeHtml = escapeHtml;
|
|
8
|
+
/**
|
|
9
|
+
* HTML 内容安全转义工具
|
|
10
|
+
* 防止 XSS 攻击
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 转义 HTML 特殊字符
|
|
15
|
+
* @param unsafeText 未转义的文本
|
|
16
|
+
* @returns 转义后的安全文本
|
|
17
|
+
*/
|
|
18
|
+
function escapeHtml(unsafeText) {
|
|
19
|
+
var map = {
|
|
20
|
+
'&': '&',
|
|
21
|
+
'<': '<',
|
|
22
|
+
'>': '>',
|
|
23
|
+
'"': '"',
|
|
24
|
+
"'": '''
|
|
25
|
+
};
|
|
26
|
+
return unsafeText.replace(/[&<>"']/g, function (char) {
|
|
27
|
+
return map[char];
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 生成安全的 HTML 模板
|
|
33
|
+
* 用于 AG-Grid 的 overlayNoRowsTemplate 等场景
|
|
34
|
+
*/
|
|
35
|
+
function createSafeHtmlTemplate(text, styles) {
|
|
36
|
+
var safeText = escapeHtml(text);
|
|
37
|
+
var defaultStyles = "\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n font-size: 14px;\n color: #aaa;\n line-height: 1.5;\n text-align: center;\n ";
|
|
38
|
+
return "<span style=\"".concat(styles || defaultStyles, "\">").concat(safeText, "</span>");
|
|
39
|
+
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgGridColumn, AgGridPlus, flattenTreeDeep, GridPlusContext, useGridPlusColumnState } from "./ag-grid-plus";
|
|
1
|
+
import { AgGridColumn, AgGridPlus, flattenTreeDeep, GridPlusContext, useGridPlusColumnState, useColumnSchemes, SchemeSelector, SchemeManager, LocalStorageAdapter, defaultStorageAdapter, validateScheme, validateSchemeName, validateSchemeDescription, checkDuplicateName, generateUniqueName, STORAGE_PREFIX, DEFAULT_SCHEME_NAME, MAX_SCHEMES_PER_GRID, MAX_SCHEME_NAME_LENGTH } from "./ag-grid-plus";
|
|
2
2
|
import ArrayTable from "./array-table";
|
|
3
3
|
import ArrayTableIndex from "./array-table-index";
|
|
4
4
|
import { ColumnPresets } from "./array-table/columnHelper";
|
|
@@ -21,7 +21,7 @@ import { StandardFormDialog, withStandardForm, FieldCreators, createSelectField,
|
|
|
21
21
|
import DeleteConfirm from "./deleteConfirm";
|
|
22
22
|
import { RuleBuilder } from "./RuleBuilder";
|
|
23
23
|
import { RegexEditor, useRegexValidation, useTemplateManager, TemplateSelector, TemplateCategory, RegexTester, FlagsSelector, MatchItem, RegexRailroadDiagram } from "./components/RegexEditor";
|
|
24
|
-
export { AgGridColumn, AgGridPlus, ArrayTable, ArrayTableIndex, ColumnPresets, Card, Dashboard, DialogSelect, DraggableModal, Editable, ExtensibleGrid, flattenTreeDeep, FormDesigner, FormProContext, FormProLayout, GridPlusContext, useGridPlusColumnState, ImportModal, QueryBuilder, ToolBar, FullScreenAlert, ConfirmPro, GeneratedListPage, StandardFormDialog, withStandardForm, FieldCreators, createSelectField, createCascaderField, DeleteConfirm, RuleBuilder, RegexEditor, useRegexValidation, useTemplateManager, TemplateSelector, TemplateCategory, RegexTester, FlagsSelector, MatchItem, RegexRailroadDiagram, };
|
|
24
|
+
export { AgGridColumn, AgGridPlus, ArrayTable, ArrayTableIndex, ColumnPresets, Card, Dashboard, DialogSelect, DraggableModal, Editable, ExtensibleGrid, flattenTreeDeep, FormDesigner, FormProContext, FormProLayout, GridPlusContext, useGridPlusColumnState, ImportModal, QueryBuilder, ToolBar, FullScreenAlert, ConfirmPro, GeneratedListPage, StandardFormDialog, withStandardForm, FieldCreators, createSelectField, createCascaderField, DeleteConfirm, RuleBuilder, RegexEditor, useRegexValidation, useTemplateManager, TemplateSelector, TemplateCategory, RegexTester, FlagsSelector, MatchItem, RegexRailroadDiagram, useColumnSchemes, SchemeSelector, SchemeManager, LocalStorageAdapter, defaultStorageAdapter, validateScheme, validateSchemeName, validateSchemeDescription, checkDuplicateName, generateUniqueName, STORAGE_PREFIX, DEFAULT_SCHEME_NAME, MAX_SCHEMES_PER_GRID, MAX_SCHEME_NAME_LENGTH, };
|
|
25
25
|
export type * from "./generatedListPage";
|
|
26
26
|
export type * from "./standardFormDialog";
|
|
27
27
|
export type * from "./deleteConfirm";
|
|
@@ -29,4 +29,5 @@ export type * from "./importModal";
|
|
|
29
29
|
export type * from "./fullScreenAlert";
|
|
30
30
|
export type * from "./RuleBuilder";
|
|
31
31
|
export type { ColumnConfig } from "./array-table/columnHelper";
|
|
32
|
+
export type { ColumnScheme, SchemeManagerConfig, StorageAdapter, SchemeValidationResult, UseColumnSchemesReturn, SchemeSelectorProps, SchemeManagerProps, GridPlusContextValue, } from "./ag-grid-plus";
|
|
32
33
|
export type { ParseResult as RegexParseResult, ValidationResult as RegexValidationResult, RegexError, ComplexityMetrics, ASTNode, AstRegExp, RegexTemplate, TestResult as RegexTestResult, CodeMirrorWrapperProps, RegexEditorProps, RegexFlags, MatchResult, RegexTesterProps, FlagsSelectorProps, MatchItemProps, RegexRailroadDiagramProps, } from "./components/RegexEditor";
|
package/dist/cjs/index.js
CHANGED
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "ConfirmPro", {
|
|
|
45
45
|
return _ConfirmPro.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "DEFAULT_SCHEME_NAME", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _agGridPlus.DEFAULT_SCHEME_NAME;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
Object.defineProperty(exports, "Dashboard", {
|
|
49
55
|
enumerable: true,
|
|
50
56
|
get: function get() {
|
|
@@ -135,6 +141,24 @@ Object.defineProperty(exports, "ImportModal", {
|
|
|
135
141
|
return _importModal.default;
|
|
136
142
|
}
|
|
137
143
|
});
|
|
144
|
+
Object.defineProperty(exports, "LocalStorageAdapter", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function get() {
|
|
147
|
+
return _agGridPlus.LocalStorageAdapter;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "MAX_SCHEMES_PER_GRID", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function get() {
|
|
153
|
+
return _agGridPlus.MAX_SCHEMES_PER_GRID;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "MAX_SCHEME_NAME_LENGTH", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function get() {
|
|
159
|
+
return _agGridPlus.MAX_SCHEME_NAME_LENGTH;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
138
162
|
Object.defineProperty(exports, "MatchItem", {
|
|
139
163
|
enumerable: true,
|
|
140
164
|
get: function get() {
|
|
@@ -171,6 +195,24 @@ Object.defineProperty(exports, "RuleBuilder", {
|
|
|
171
195
|
return _RuleBuilder.RuleBuilder;
|
|
172
196
|
}
|
|
173
197
|
});
|
|
198
|
+
Object.defineProperty(exports, "STORAGE_PREFIX", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function get() {
|
|
201
|
+
return _agGridPlus.STORAGE_PREFIX;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "SchemeManager", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function get() {
|
|
207
|
+
return _agGridPlus.SchemeManager;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "SchemeSelector", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function get() {
|
|
213
|
+
return _agGridPlus.SchemeSelector;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
174
216
|
Object.defineProperty(exports, "StandardFormDialog", {
|
|
175
217
|
enumerable: true,
|
|
176
218
|
get: function get() {
|
|
@@ -195,6 +237,12 @@ Object.defineProperty(exports, "ToolBar", {
|
|
|
195
237
|
return _toolBar.default;
|
|
196
238
|
}
|
|
197
239
|
});
|
|
240
|
+
Object.defineProperty(exports, "checkDuplicateName", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function get() {
|
|
243
|
+
return _agGridPlus.checkDuplicateName;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
198
246
|
Object.defineProperty(exports, "createCascaderField", {
|
|
199
247
|
enumerable: true,
|
|
200
248
|
get: function get() {
|
|
@@ -207,12 +255,30 @@ Object.defineProperty(exports, "createSelectField", {
|
|
|
207
255
|
return _standardFormDialog.createSelectField;
|
|
208
256
|
}
|
|
209
257
|
});
|
|
258
|
+
Object.defineProperty(exports, "defaultStorageAdapter", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function get() {
|
|
261
|
+
return _agGridPlus.defaultStorageAdapter;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
210
264
|
Object.defineProperty(exports, "flattenTreeDeep", {
|
|
211
265
|
enumerable: true,
|
|
212
266
|
get: function get() {
|
|
213
267
|
return _agGridPlus.flattenTreeDeep;
|
|
214
268
|
}
|
|
215
269
|
});
|
|
270
|
+
Object.defineProperty(exports, "generateUniqueName", {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
get: function get() {
|
|
273
|
+
return _agGridPlus.generateUniqueName;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
Object.defineProperty(exports, "useColumnSchemes", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function get() {
|
|
279
|
+
return _agGridPlus.useColumnSchemes;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
216
282
|
Object.defineProperty(exports, "useGridPlusColumnState", {
|
|
217
283
|
enumerable: true,
|
|
218
284
|
get: function get() {
|
|
@@ -231,6 +297,24 @@ Object.defineProperty(exports, "useTemplateManager", {
|
|
|
231
297
|
return _RegexEditor.useTemplateManager;
|
|
232
298
|
}
|
|
233
299
|
});
|
|
300
|
+
Object.defineProperty(exports, "validateScheme", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function get() {
|
|
303
|
+
return _agGridPlus.validateScheme;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
Object.defineProperty(exports, "validateSchemeDescription", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function get() {
|
|
309
|
+
return _agGridPlus.validateSchemeDescription;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, "validateSchemeName", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function get() {
|
|
315
|
+
return _agGridPlus.validateSchemeName;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
234
318
|
Object.defineProperty(exports, "withStandardForm", {
|
|
235
319
|
enumerable: true,
|
|
236
320
|
get: function get() {
|