@vtx/components 4.0.0-beta.71 → 4.0.0-beta.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.
Files changed (88) hide show
  1. package/README.md +19 -19
  2. package/es/utils/components/LabelIconTip/index.js +7 -7
  3. package/es/utils/conversionMomentValue/index.js +25 -25
  4. package/es/utils/filterSpecialCharacters.js +6 -6
  5. package/es/utils/genCopyable/index.js +6 -6
  6. package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  7. package/es/utils/hooks/useDebounceFn/index.js +4 -4
  8. package/es/utils/hooks/useDebounceValue/index.js +6 -6
  9. package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
  10. package/es/utils/hooks/useLatest/index.js +2 -2
  11. package/es/utils/hooks/useRefCallback/index.js +5 -5
  12. package/es/utils/isBrowser/index.js +7 -7
  13. package/es/utils/isUrl/index.js +4 -4
  14. package/es/utils/merge/index.js +4 -4
  15. package/es/utils/nanoid/index.js +4 -4
  16. package/es/utils/omitBoolean/index.js +4 -4
  17. package/es/utils/parseValueToMoment/index.js +4 -4
  18. package/es/utils/proFieldParsingText/index.js +10 -10
  19. package/es/utils/transformKeySubmitValue/index.js +57 -57
  20. package/es/utils/useEditableArray/index.js +46 -46
  21. package/es/utils/useEditableMap/index.js +22 -22
  22. package/es/utils/useMediaQuery/index.js +5 -5
  23. package/es/vtx-datagrid/Store/Provide.js +3 -10
  24. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  25. package/es/vtx-datagrid/columnState.js +28 -1
  26. package/es/vtx-datagrid/index.js +26 -8
  27. package/es/vtx-datagrid/style/index.less +242 -242
  28. package/es/vtx-date-picker/style/index.less +39 -39
  29. package/es/vtx-export/index.js +8 -8
  30. package/es/vtx-icon/index.js1 +90 -90
  31. package/es/vtx-import/index.js +57 -29
  32. package/es/vtx-import/result.js +22 -24
  33. package/es/vtx-modal/index.js +2 -2
  34. package/es/vtx-page-layout/Basic.js +2 -2
  35. package/es/vtx-page-layout/TabLayout.js +6 -6
  36. package/es/vtx-page-layout/TableLayout.js +10 -10
  37. package/es/vtx-page-layout/TreeLayout.js +6 -6
  38. package/es/vtx-page-layout/container.js +2 -2
  39. package/es/vtx-provider/index.js +30 -30
  40. package/es/vtx-provider/intl.js +9 -9
  41. package/es/vtx-provider/locale/en_US.js +2 -0
  42. package/es/vtx-provider/locale/zh_CN.js +2 -0
  43. package/es/vtx-provider/useStyle/index.js +17 -17
  44. package/es/vtx-wang-editor/style/index.less +12 -12
  45. package/lib/utils/components/LabelIconTip/index.js +7 -7
  46. package/lib/utils/conversionMomentValue/index.js +25 -25
  47. package/lib/utils/filterSpecialCharacters.js +6 -6
  48. package/lib/utils/genCopyable/index.js +6 -6
  49. package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  50. package/lib/utils/hooks/useDebounceFn/index.js +4 -4
  51. package/lib/utils/hooks/useDebounceValue/index.js +6 -6
  52. package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
  53. package/lib/utils/hooks/useLatest/index.js +2 -2
  54. package/lib/utils/hooks/useRefCallback/index.js +5 -5
  55. package/lib/utils/isBrowser/index.js +7 -7
  56. package/lib/utils/isUrl/index.js +4 -4
  57. package/lib/utils/merge/index.js +4 -4
  58. package/lib/utils/nanoid/index.js +4 -4
  59. package/lib/utils/omitBoolean/index.js +4 -4
  60. package/lib/utils/parseValueToMoment/index.js +4 -4
  61. package/lib/utils/proFieldParsingText/index.js +10 -10
  62. package/lib/utils/transformKeySubmitValue/index.js +57 -57
  63. package/lib/utils/useEditableArray/index.js +46 -46
  64. package/lib/utils/useEditableMap/index.js +22 -22
  65. package/lib/utils/useMediaQuery/index.js +5 -5
  66. package/lib/vtx-datagrid/Store/Provide.js +2 -9
  67. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  68. package/lib/vtx-datagrid/columnState.js +28 -1
  69. package/lib/vtx-datagrid/index.js +26 -8
  70. package/lib/vtx-datagrid/style/index.less +242 -242
  71. package/lib/vtx-date-picker/style/index.less +39 -39
  72. package/lib/vtx-export/index.js +8 -8
  73. package/lib/vtx-icon/index.js1 +90 -90
  74. package/lib/vtx-import/index.js +56 -28
  75. package/lib/vtx-import/result.js +23 -25
  76. package/lib/vtx-modal/index.js +2 -2
  77. package/lib/vtx-page-layout/Basic.js +2 -2
  78. package/lib/vtx-page-layout/TabLayout.js +6 -6
  79. package/lib/vtx-page-layout/TableLayout.js +10 -10
  80. package/lib/vtx-page-layout/TreeLayout.js +6 -6
  81. package/lib/vtx-page-layout/container.js +2 -2
  82. package/lib/vtx-provider/index.js +30 -30
  83. package/lib/vtx-provider/intl.js +9 -9
  84. package/lib/vtx-provider/locale/en_US.js +2 -0
  85. package/lib/vtx-provider/locale/zh_CN.js +2 -0
  86. package/lib/vtx-provider/useStyle/index.js +17 -17
  87. package/lib/vtx-wang-editor/style/index.less +12 -12
  88. package/package.json +238 -238
@@ -17,12 +17,12 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
17
17
  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); }
18
18
  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; }
19
19
  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); }
20
- /**
21
- * 判断一个值是否为普通对象(可以被遍历的对象)
22
- * 暂时还不支持 Set 和 Map 结构
23
- *
24
- * @param itemValue - 要检查的值
25
- * @returns 如果是普通对象返回 true,否则返回 false
20
+ /**
21
+ * 判断一个值是否为普通对象(可以被遍历的对象)
22
+ * 暂时还不支持 Set 和 Map 结构
23
+ *
24
+ * @param itemValue - 要检查的值
25
+ * @returns 如果是普通对象返回 true,否则返回 false
26
26
  */
27
27
  function isPlainObj(itemValue) {
28
28
  // 如果不是对象类型,直接返回 false
@@ -47,12 +47,12 @@ function isPlainObj(itemValue) {
47
47
  return true;
48
48
  }
49
49
 
50
- /**
51
- * 将点号路径字符串转换为路径数组
52
- * 例如: 'users.0.name' => ['users', 0, 'name']
53
- *
54
- * @param dotPath - 点号分隔的路径字符串
55
- * @returns 路径数组,数字会被转换为数字类型
50
+ /**
51
+ * 将点号路径字符串转换为路径数组
52
+ * 例如: 'users.0.name' => ['users', 0, 'name']
53
+ *
54
+ * @param dotPath - 点号分隔的路径字符串
55
+ * @returns 路径数组,数字会被转换为数字类型
56
56
  */
57
57
  function parseDotPath(dotPath) {
58
58
  return dotPath.split('.').map(function (segment) {
@@ -61,11 +61,11 @@ function parseDotPath(dotPath) {
61
61
  });
62
62
  }
63
63
 
64
- /**
65
- * 过滤掉空值的转换配置
66
- *
67
- * @param dataFormatMapRaw - 原始转换配置
68
- * @returns 过滤后的转换配置
64
+ /**
65
+ * 过滤掉空值的转换配置
66
+ *
67
+ * @param dataFormatMapRaw - 原始转换配置
68
+ * @returns 过滤后的转换配置
69
69
  */
70
70
  function filterNilTransforms(dataFormatMapRaw) {
71
71
  var filtered = {};
@@ -78,11 +78,11 @@ function filterNilTransforms(dataFormatMapRaw) {
78
78
  return filtered;
79
79
  }
80
80
 
81
- /**
82
- * 将转换配置分为点号路径格式和传统嵌套对象格式
83
- *
84
- * @param dataFormatMapRaw - 原始转换配置
85
- * @returns 包含两种格式转换配置的对象
81
+ /**
82
+ * 将转换配置分为点号路径格式和传统嵌套对象格式
83
+ *
84
+ * @param dataFormatMapRaw - 原始转换配置
85
+ * @returns 包含两种格式转换配置的对象
86
86
  */
87
87
  function separateTransformFormats(dataFormatMapRaw) {
88
88
  var dotPathTransforms = {};
@@ -102,12 +102,12 @@ function separateTransformFormats(dataFormatMapRaw) {
102
102
  };
103
103
  }
104
104
 
105
- /**
106
- * 处理点号路径格式的转换
107
- * 例如: 'users.0.name' => 转换 users[0].name 的值
108
- *
109
- * @param result - 要转换的数据对象
110
- * @param dotPathTransforms - 点号路径转换配置
105
+ /**
106
+ * 处理点号路径格式的转换
107
+ * 例如: 'users.0.name' => 转换 users[0].name 的值
108
+ *
109
+ * @param result - 要转换的数据对象
110
+ * @param dotPathTransforms - 点号路径转换配置
111
111
  */
112
112
  function processDotPathTransforms(result, dotPathTransforms) {
113
113
  for (var dotPath in dotPathTransforms) {
@@ -150,13 +150,13 @@ function processDotPathTransforms(result, dotPathTransforms) {
150
150
  }
151
151
  }
152
152
 
153
- /**
154
- * 在嵌套转换配置中查找转换函数
155
- *
156
- * @param currentTransforms - 当前转换配置
157
- * @param parentsKey - 父级路径
158
- * @param entityKey - 当前实体键
159
- * @returns 找到的转换函数或 undefined
153
+ /**
154
+ * 在嵌套转换配置中查找转换函数
155
+ *
156
+ * @param currentTransforms - 当前转换配置
157
+ * @param parentsKey - 父级路径
158
+ * @param entityKey - 当前实体键
159
+ * @returns 找到的转换函数或 undefined
160
160
  */
161
161
  function findNestedTransformFunction(currentTransforms, parentsKey, entityKey) {
162
162
  var nestedTransforms = currentTransforms;
@@ -184,11 +184,11 @@ function findNestedTransformFunction(currentTransforms, parentsKey, entityKey) {
184
184
  return undefined;
185
185
  }
186
186
 
187
- /**
188
- * 检查路径是否包含数组索引
189
- *
190
- * @param parentsKey - 父级路径数组
191
- * @returns 如果包含数组索引返回 true
187
+ /**
188
+ * 检查路径是否包含数组索引
189
+ *
190
+ * @param parentsKey - 父级路径数组
191
+ * @returns 如果包含数组索引返回 true
192
192
  */
193
193
  function isInArrayPath(parentsKey) {
194
194
  return parentsKey.some(function (key) {
@@ -196,14 +196,14 @@ function isInArrayPath(parentsKey) {
196
196
  });
197
197
  }
198
198
 
199
- /**
200
- * 递归处理嵌套对象转换(传统格式)
201
- *
202
- * @param tempValues - 要处理的值
203
- * @param parentsKey - 父级路径
204
- * @param currentTransforms - 当前转换配置
205
- * @param rootMergeObjects - 存储需要在根级别合并的对象
206
- * @returns 处理后的结果
199
+ /**
200
+ * 递归处理嵌套对象转换(传统格式)
201
+ *
202
+ * @param tempValues - 要处理的值
203
+ * @param parentsKey - 父级路径
204
+ * @param currentTransforms - 当前转换配置
205
+ * @param rootMergeObjects - 存储需要在根级别合并的对象
206
+ * @returns 处理后的结果
207
207
  */
208
208
  function processNestedObjectTransforms(tempValues, parentsKey, currentTransforms, rootMergeObjects) {
209
209
  var isArrayValues = Array.isArray(tempValues);
@@ -278,15 +278,15 @@ function processNestedObjectTransforms(tempValues, parentsKey, currentTransforms
278
278
  return tempResult;
279
279
  }
280
280
 
281
- /**
282
- * 转换提交值中的键名
283
- * 支持两种格式的转换配置:
284
- * 1. 点号路径格式:'users.0.name' => 转换嵌套路径的值
285
- * 2. 传统嵌套对象格式:{ users: { 0: { name: transformFn } } }
286
- *
287
- * @param values - 要转换的值对象
288
- * @param dataFormatMapRaw - 转换配置映射
289
- * @returns 转换后的值对象
281
+ /**
282
+ * 转换提交值中的键名
283
+ * 支持两种格式的转换配置:
284
+ * 1. 点号路径格式:'users.0.name' => 转换嵌套路径的值
285
+ * 2. 传统嵌套对象格式:{ users: { 0: { name: transformFn } } }
286
+ *
287
+ * @param values - 要转换的值对象
288
+ * @param dataFormatMapRaw - 转换配置映射
289
+ * @returns 转换后的值对象
290
290
  */
291
291
  var transformKeySubmitValue = exports.transformKeySubmitValue = function transformKeySubmitValue(values, dataFormatMapRaw) {
292
292
  // 过滤掉空值的转换配置
@@ -52,9 +52,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
52
52
  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); } /* eslint-disable react-hooks/exhaustive-deps */
53
53
  var noteOnce = _util.warning.noteOnce;
54
54
 
55
- /**
56
- * 显示警告信息
57
- * @param messageStr
55
+ /**
56
+ * 显示警告信息
57
+ * @param messageStr
58
58
  */
59
59
  var warning = function warning(messageStr) {
60
60
  return _antd.message.warning(messageStr);
@@ -64,11 +64,11 @@ var recordKeyToString = exports.recordKeyToString = function recordKeyToString(r
64
64
  return rowKey;
65
65
  };
66
66
 
67
- /**
68
- * 使用map 来删除数据,性能一般 但是准确率比较高
69
- *
70
- * @param keyProps
71
- * @param action
67
+ /**
68
+ * 使用map 来删除数据,性能一般 但是准确率比较高
69
+ *
70
+ * @param keyProps
71
+ * @param action
72
72
  */
73
73
  function editableRowByKey(keyProps, action) {
74
74
  var _recordKeyToString;
@@ -80,11 +80,11 @@ function editableRowByKey(keyProps, action) {
80
80
  var key = (_recordKeyToString = recordKeyToString(keyProps.key)) === null || _recordKeyToString === void 0 ? void 0 : _recordKeyToString.toString();
81
81
  var kvMap = new Map();
82
82
 
83
- /**
84
- * 打平这个数组
85
- *
86
- * @param records
87
- * @param parentKey
83
+ /**
84
+ * 打平这个数组
85
+ *
86
+ * @param records
87
+ * @param parentKey
88
88
  */
89
89
  function dig(records, map_row_parentKey, map_row_index) {
90
90
  records.forEach(function (record, index) {
@@ -169,10 +169,10 @@ function editableRowByKey(keyProps, action) {
169
169
  return fill(kvMap);
170
170
  }
171
171
 
172
- /**
173
- * 保存按钮的dom
174
- *
175
- * @param ActionRenderConfig
172
+ /**
173
+ * 保存按钮的dom
174
+ *
175
+ * @param ActionRenderConfig
176
176
  */
177
177
  function SaveEditableAction(_ref, ref) {
178
178
  var recordKey = _ref.recordKey,
@@ -275,10 +275,10 @@ function SaveEditableAction(_ref, ref) {
275
275
  }, "save");
276
276
  }
277
277
 
278
- /**
279
- * 删除按钮 dom
280
- *
281
- * @param ActionRenderConfig
278
+ /**
279
+ * 删除按钮 dom
280
+ *
281
+ * @param ActionRenderConfig
282
282
  */
283
283
  var DeleteEditableAction = exports.DeleteEditableAction = function DeleteEditableAction(_ref4) {
284
284
  var recordKey = _ref4.recordKey,
@@ -418,17 +418,17 @@ function defaultActionRender(row, config) {
418
418
  };
419
419
  }
420
420
 
421
- /**
422
- * 一个方便的hooks 用于维护编辑的状态
423
- *
424
- * @param props
421
+ /**
422
+ * 一个方便的hooks 用于维护编辑的状态
423
+ *
424
+ * @param props
425
425
  */
426
426
  function useEditableArray(props) {
427
427
  // Internationalization
428
428
  var intl = (0, _vtxProvider.useIntl)();
429
429
 
430
- /**
431
- * 点击开始编辑之前的保存数据用的
430
+ /**
431
+ * 点击开始编辑之前的保存数据用的
432
432
  */
433
433
  var preEditRowRef = (0, _react.useRef)(null);
434
434
  var _useState = (0, _react.useState)(undefined),
@@ -516,10 +516,10 @@ function useEditableArray(props) {
516
516
  };
517
517
  });
518
518
 
519
- /**
520
- * 进入编辑状态
521
- *
522
- * @param recordKey
519
+ /**
520
+ * 进入编辑状态
521
+ *
522
+ * @param recordKey
523
523
  */
524
524
  var startEditable = (0, _.useRefFunction)(function (recordKey, record) {
525
525
  var _ref7, _props$dataSource;
@@ -538,10 +538,10 @@ function useEditableArray(props) {
538
538
  return true;
539
539
  });
540
540
 
541
- /**
542
- * 退出编辑状态
543
- *
544
- * @param recordKey
541
+ /**
542
+ * 退出编辑状态
543
+ *
544
+ * @param recordKey
545
545
  */
546
546
  var cancelEditable = (0, _.useRefFunction)( /*#__PURE__*/function () {
547
547
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(recordKey, needReTry) {
@@ -647,11 +647,11 @@ function useEditableArray(props) {
647
647
  }
648
648
  });
649
649
  }, [saveRefsMap, editableKeysSet]);
650
- /**
651
- * 保存编辑行
652
- *
653
- * @param recordKey
654
- * @param needReTry
650
+ /**
651
+ * 保存编辑行
652
+ *
653
+ * @param recordKey
654
+ * @param needReTry
655
655
  */
656
656
  var saveEditable = (0, _.useRefFunction)( /*#__PURE__*/function () {
657
657
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(recordKey, needReTry) {
@@ -698,12 +698,12 @@ function useEditableArray(props) {
698
698
  };
699
699
  }());
700
700
 
701
- /**
702
- * 同时只能支持一行,取消之后数据消息,不会触发 dataSource
703
- *
704
- * @param row
705
- * @param options
706
- * @name 增加新的行
701
+ /**
702
+ * 同时只能支持一行,取消之后数据消息,不会触发 dataSource
703
+ *
704
+ * @param row
705
+ * @param options
706
+ * @name 增加新的行
707
707
  */
708
708
  var addEditRecord = (0, _.useRefFunction)(function (row, options) {
709
709
  if (options !== null && options !== void 0 && options.parentKey && !dataSourceKeyIndexMapRef.current.has(recordKeyToString(options === null || options === void 0 ? void 0 : options.parentKey).toString())) {
@@ -25,19 +25,19 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
25
25
  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; }
26
26
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
27
27
  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); } /* eslint-disable react-hooks/exhaustive-deps */
28
- /**
29
- * 显示警告信息
30
- * @param messageStr
28
+ /**
29
+ * 显示警告信息
30
+ * @param messageStr
31
31
  */
32
32
  var warning = function warning(messageStr) {
33
33
  return _antd.message.warning(messageStr);
34
34
  };
35
35
 
36
- /**
37
- * 使用map 来删除数据,性能一般 但是准确率比较高
38
- *
39
- * @param params
40
- * @param action
36
+ /**
37
+ * 使用map 来删除数据,性能一般 但是准确率比较高
38
+ *
39
+ * @param params
40
+ * @param action
41
41
  */
42
42
  function editableRowByKey(_ref) {
43
43
  var data = _ref.data,
@@ -45,14 +45,14 @@ function editableRowByKey(_ref) {
45
45
  return _objectSpread(_objectSpread({}, data), row);
46
46
  }
47
47
 
48
- /**
49
- * 一个方便的hooks 用于维护编辑的状态
50
- *
51
- * @param props
48
+ /**
49
+ * 一个方便的hooks 用于维护编辑的状态
50
+ *
51
+ * @param props
52
52
  */
53
53
  function useEditableMap(props) {
54
- /**
55
- * 点击开始编辑之前的保存数据用的
54
+ /**
55
+ * 点击开始编辑之前的保存数据用的
56
56
  */
57
57
  var preEditRowRef = (0, _react.useRef)(null);
58
58
  var editableType = props.type || 'single';
@@ -84,10 +84,10 @@ function useEditableMap(props) {
84
84
  return false;
85
85
  }, [(editableKeys || []).join(',')]);
86
86
 
87
- /**
88
- * 进入编辑状态
89
- *
90
- * @param recordKey
87
+ /**
88
+ * 进入编辑状态
89
+ *
90
+ * @param recordKey
91
91
  */
92
92
  var startEditable = function startEditable(recordKey, recordValue) {
93
93
  var _ref2;
@@ -102,10 +102,10 @@ function useEditableMap(props) {
102
102
  return true;
103
103
  };
104
104
 
105
- /**
106
- * 退出编辑状态
107
- *
108
- * @param recordKey
105
+ /**
106
+ * 退出编辑状态
107
+ *
108
+ * @param recordKey
109
109
  */
110
110
  var cancelEditable = function cancelEditable(recordKey) {
111
111
  // 防止多次渲染
@@ -44,11 +44,11 @@ var MediaQueryEnum = exports.MediaQueryEnum = {
44
44
  }
45
45
  };
46
46
 
47
- /**
48
- * loop query screen className
49
- * Array.find will throw a error
50
- * `Rendered more hooks than during the previous render.`
51
- * So should use Array.forEach
47
+ /**
48
+ * loop query screen className
49
+ * Array.find will throw a error
50
+ * `Rendered more hooks than during the previous render.`
51
+ * So should use Array.forEach
52
52
  */
53
53
  var getScreenClassName = exports.getScreenClassName = function getScreenClassName() {
54
54
  var queryKey = undefined;
@@ -277,15 +277,8 @@ function useContainer() {
277
277
  }
278
278
  }, [visibleColumnKeys, props.defaultVisibleColumnKeys, tableColumn], ['render'], 100);
279
279
  (0, _utils.useDeepCompareEffectDebounce)(function () {
280
- var _sortKeyColumns$curre, _props$onVisibleColum;
281
- var visibleColumnKeys = [];
282
- (_sortKeyColumns$curre = sortKeyColumns.current) === null || _sortKeyColumns$curre === void 0 || _sortKeyColumns$curre.map(function (columnKey) {
283
- var config = columnsMap[columnKey];
284
- if (config !== null && config !== void 0 && config.show) {
285
- visibleColumnKeys.push(columnKey);
286
- }
287
- });
288
- (_props$onVisibleColum = props.onVisibleColumnsChange) === null || _props$onVisibleColum === void 0 || _props$onVisibleColum.call(props, visibleColumnKeys);
280
+ var _props$onVisibleColum;
281
+ (_props$onVisibleColum = props.onVisibleColumnsChange) === null || _props$onVisibleColum === void 0 || _props$onVisibleColum.call(props, (0, _columnState.getVisibleColumnKeysFromMap)(columnsMap, sortKeyColumns.current));
289
282
  }, [JSON.stringify(columnsMap), sortKeyColumns.current], ['render'], 200);
290
283
  var show = function show() {
291
284
  setTimeout(function () {
@@ -379,10 +379,10 @@ function ColumnSetting(props) {
379
379
  var checkedColumnKeys = props.checkedColumnKeys,
380
380
  onColumnsSave = props.onColumnsSave;
381
381
 
382
- /**
383
- * 设置全部选中,或全部未选中
384
- *
385
- * @param show
382
+ /**
383
+ * 设置全部选中,或全部未选中
384
+ *
385
+ * @param show
386
386
  */
387
387
  var setAllSelectAction = (0, _utils.useRefFunction)(function () {
388
388
  var show = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
@@ -9,6 +9,12 @@ exports.getVisibleColumnKeysFromMap = getVisibleColumnKeysFromMap;
9
9
  exports.indexColumnKey = void 0;
10
10
  var _genColumnKey = require("../utils/genColumnKey");
11
11
  var _sortByGivenOrder = require("../utils/sortByGivenOrder");
12
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
13
+ 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."); }
14
+ 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); }
15
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
+ 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; }
12
18
  var indexColumnKey = exports.indexColumnKey = '_serialNum';
13
19
  function buildColumnKeyMap() {
14
20
  var tableColumn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -66,8 +72,29 @@ function buildSortKeyColumns() {
66
72
  function getVisibleColumnKeysFromMap() {
67
73
  var columnsMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
68
74
  var sortKeyColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
69
- return sortKeyColumns.filter(function (columnKey) {
75
+ var allColumnKeys = Array.from(new Set([].concat(_toConsumableArray(sortKeyColumns), _toConsumableArray(Object.keys(columnsMap)))));
76
+ var sortIndexMap = new Map(sortKeyColumns.map(function (columnKey, index) {
77
+ return [columnKey, index];
78
+ }));
79
+ return allColumnKeys.filter(function (columnKey) {
70
80
  var _columnsMap$columnKey;
71
81
  return (_columnsMap$columnKey = columnsMap[columnKey]) === null || _columnsMap$columnKey === void 0 ? void 0 : _columnsMap$columnKey.show;
82
+ }).sort(function (leftKey, rightKey) {
83
+ var leftConfig = columnsMap[leftKey] || {};
84
+ var rightConfig = columnsMap[rightKey] || {};
85
+ var leftFixed = leftConfig.fixed,
86
+ leftOrder = leftConfig.order;
87
+ var rightFixed = rightConfig.fixed,
88
+ rightOrder = rightConfig.order;
89
+ if (leftFixed === 'left' && rightFixed !== 'left' || rightFixed === 'right' && leftFixed !== 'right') {
90
+ return -2;
91
+ }
92
+ if (rightFixed === 'left' && leftFixed !== 'left' || leftFixed === 'right' && rightFixed !== 'right') {
93
+ return 2;
94
+ }
95
+ if (leftOrder !== undefined || rightOrder !== undefined) {
96
+ return (leftOrder !== null && leftOrder !== void 0 ? leftOrder : 0) - (rightOrder !== null && rightOrder !== void 0 ? rightOrder : 0);
97
+ }
98
+ return (sortIndexMap.has(leftKey) ? sortIndexMap.get(leftKey) : Number.MAX_SAFE_INTEGER) - (sortIndexMap.has(rightKey) ? sortIndexMap.get(rightKey) : Number.MAX_SAFE_INTEGER);
72
99
  });
73
100
  }
@@ -68,13 +68,14 @@ function VtxTable(props) {
68
68
  var _useSet = (0, _useSet3.default)({
69
69
  // 表格id
70
70
  datagridId: "vtx-datagrid-".concat(new Date().getTime()),
71
- scrollY: 0
71
+ scrollY: undefined
72
72
  }),
73
73
  _useSet2 = _slicedToArray(_useSet, 2),
74
74
  _useSet2$ = _useSet2[0],
75
75
  datagridId = _useSet2$.datagridId,
76
76
  scrollY = _useSet2$.scrollY,
77
77
  setState = _useSet2[1];
78
+ var scrollYRef = (0, _react.useRef)(undefined);
78
79
  // 列设置提示高度
79
80
  var alertHeight = (0, _react.useRef)(0);
80
81
  // 工具栏高度
@@ -135,32 +136,49 @@ function VtxTable(props) {
135
136
  _headFootHeight = ((pagination === null || pagination === void 0 ? void 0 : pagination.clientHeight) || 0) + 32 + (tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.clientHeight);
136
137
  }
137
138
  var bodyHeight = ((_rootDomRef$current = rootDomRef.current) === null || _rootDomRef$current === void 0 ? void 0 : _rootDomRef$current.clientHeight) - _headFootHeight - toolbarHeight.current - alertHeight.current;
139
+ if (!bodyHeight || bodyHeight <= 0) {
140
+ return;
141
+ }
138
142
  var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
139
143
  return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content') || dom.className.includes('ant-table-tbody');
140
144
  })[0];
141
145
  var tablePlaceholder = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('tr'), function (dom) {
142
146
  return dom.className.includes('ant-table-placeholder');
143
147
  })[0];
148
+ if (!bodyDiv) {
149
+ return;
150
+ }
151
+ var tableHeight = ((_bodyDiv$getElementsB = bodyDiv.getElementsByTagName('table')) === null || _bodyDiv$getElementsB === void 0 || (_bodyDiv$getElementsB = _bodyDiv$getElementsB[0]) === null || _bodyDiv$getElementsB === void 0 ? void 0 : _bodyDiv$getElementsB.clientHeight) || 0;
152
+ var minBodyHeight = Math.max(bodyHeight - (rest.scrollY || 0), 0);
144
153
  if (bodyDiv) {
145
- bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
154
+ bodyDiv.style.minHeight = "".concat(minBodyHeight, "px");
146
155
  }
147
- var tableHeight = (_bodyDiv$getElementsB = bodyDiv.getElementsByTagName('table')) === null || _bodyDiv$getElementsB === void 0 || (_bodyDiv$getElementsB = _bodyDiv$getElementsB[0]) === null || _bodyDiv$getElementsB === void 0 ? void 0 : _bodyDiv$getElementsB.clientHeight;
148
156
  if (tablePlaceholder) {
149
- tablePlaceholder.style.height = "".concat(bodyHeight - (rest.scrollY || 0) - 48 - 12, "px");
157
+ var placeholderHeight = Math.max(bodyHeight - (rest.scrollY || 0) - 48 - 12, 0);
158
+ tablePlaceholder.style.height = "".concat(placeholderHeight, "px");
150
159
  var tableCell = Array.prototype.filter.call(tablePlaceholder.getElementsByTagName('td'), function (dom) {
151
160
  return dom.className.includes('ant-table-cell');
152
161
  })[0];
153
- tableCell.style.height = "".concat(bodyHeight - (rest.scrollY || 0) - 48 - 12, "px");
162
+ if (tableCell) {
163
+ tableCell.style.height = "".concat(placeholderHeight, "px");
164
+ }
154
165
  }
155
166
  // antd6.x 的bug 如果table的高度 没有body 高 则没有滚动条
156
167
 
157
- setState({
158
- scrollY: tableHeight > bodyHeight ? bodyHeight : undefined
159
- });
168
+ var nextScrollY = tableHeight > bodyHeight ? bodyHeight : undefined;
169
+ if (scrollYRef.current !== nextScrollY) {
170
+ scrollYRef.current = nextScrollY;
171
+ setState({
172
+ scrollY: nextScrollY
173
+ });
174
+ }
160
175
  }, {
161
176
  wait: 350
162
177
  }),
163
178
  calculateHeight = _useThrottleFn.run;
179
+ (0, _react.useEffect)(function () {
180
+ scrollYRef.current = scrollY;
181
+ }, [scrollY]);
164
182
  (0, _react.useEffect)(function () {
165
183
  var resizeObserver = new ResizeObserver(function () {
166
184
  calculateHeight();