@vtx/components 4.0.0-beta.7 → 4.0.0-beta.70

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 (161) hide show
  1. package/es/index.js +3 -0
  2. package/es/utils/filterSpecialCharacters.js +47 -46
  3. package/es/utils/index.js +1 -2
  4. package/es/vtx-color-picker/index.js +138 -33
  5. package/es/vtx-color-picker/style/index.js +36 -12
  6. package/es/vtx-combogrid/Combogrid.js +16 -10
  7. package/es/vtx-combogrid/index.js +7 -4
  8. package/es/vtx-combogrid/style/index.js +4 -4
  9. package/es/vtx-datagrid/Store/Provide.js +109 -132
  10. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -5
  11. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  12. package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  13. package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  14. package/es/vtx-datagrid/ToolBar/index.js +2 -2
  15. package/es/vtx-datagrid/columnState.js +64 -0
  16. package/es/vtx-datagrid/index.js +114 -35
  17. package/es/vtx-datagrid/mergeComponents.js +15 -0
  18. package/es/vtx-datagrid/renderColumnButtons.js +30 -11
  19. package/es/vtx-datagrid/style/index.js +102 -20
  20. package/es/vtx-date-picker/QdatePicker.js +1 -1
  21. package/es/vtx-descriptions/Descriptions.js +29 -0
  22. package/es/vtx-descriptions/index.js +3 -0
  23. package/es/vtx-descriptions/style/index.js +19 -0
  24. package/es/vtx-ellipsis-text/index.js +7 -2
  25. package/es/vtx-ellipsis-text/style/index.js +3 -1
  26. package/es/vtx-export/index.js +25 -25
  27. package/es/vtx-export-async/History.js +7 -3
  28. package/es/vtx-export-async/index.js +42 -14
  29. package/es/vtx-form-layout/Card.js +10 -10
  30. package/es/vtx-form-layout/Divider.js +1 -1
  31. package/es/vtx-form-layout/FormItem.js +18 -17
  32. package/es/vtx-form-layout/Pane.js +23 -12
  33. package/es/vtx-icon/index.js +54 -45
  34. package/es/vtx-icon/index.js1 +90 -0
  35. package/es/vtx-image/Preview.js +11 -6
  36. package/es/vtx-image/style/index.js +0 -1
  37. package/es/vtx-import/index.js +155 -43
  38. package/es/vtx-import/result.js +6 -2
  39. package/es/vtx-import/style/index.js +16 -1
  40. package/es/vtx-import2/Content.js +2 -1
  41. package/es/vtx-import2/index.js +31 -20
  42. package/es/vtx-import2/style/index.js +60 -9
  43. package/es/vtx-input/TextArea/index.js +11 -6
  44. package/es/vtx-modal/index.js +9 -4
  45. package/es/vtx-modal/style/index.js +5 -3
  46. package/es/vtx-page-layout/Content.js +1 -1
  47. package/es/vtx-page-layout/TabLayout.js +1 -7
  48. package/es/vtx-page-layout/TableLayout.js +14 -4
  49. package/es/vtx-page-layout/TableWrap.js +3 -2
  50. package/es/vtx-page-layout/TreeLayout.js +2 -8
  51. package/es/vtx-page-layout/container.js +6 -5
  52. package/es/vtx-page-layout/style/index.js +4 -2
  53. package/es/vtx-provider/index.js +20 -10
  54. package/es/vtx-provider/locale/en_US.js +65 -5
  55. package/es/vtx-provider/locale/zh_CN.js +75 -5
  56. package/es/vtx-provider/useStyle/index.js +8 -4
  57. package/es/vtx-scrollable-row/index.js +38 -28
  58. package/es/vtx-search/index.js +18 -13
  59. package/es/vtx-search/style/index.js +2 -1
  60. package/es/vtx-select/index.js +132 -46
  61. package/es/vtx-select/style/index.js +11 -56
  62. package/es/vtx-signature/index.js +5 -4
  63. package/es/vtx-signature/style/index.js +1 -1
  64. package/es/vtx-split-pane/Resizer.js +0 -1
  65. package/es/vtx-split-pane/SplitPane.js +34 -25
  66. package/es/vtx-split-pane/style/index.js +8 -112
  67. package/es/vtx-time-picker/index.js +27 -1
  68. package/es/vtx-transfer/Transfer.js +29 -0
  69. package/es/vtx-transfer/index.js +3 -0
  70. package/es/vtx-transfer/style/index.js +19 -0
  71. package/es/vtx-transfer-select/TransferSelect.js +143 -0
  72. package/es/vtx-transfer-select/index.js +3 -0
  73. package/es/vtx-transfer-select/style/index.js +19 -0
  74. package/es/vtx-tree/index.js +104 -40
  75. package/es/vtx-tree-select/index.js +75 -105
  76. package/es/vtx-tree-select/style/index.js +9 -3
  77. package/es/vtx-upload/FilePreview.js +2 -1
  78. package/es/vtx-wang-editor/index.js +291 -113
  79. package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
  80. package/lib/index.js +36 -0
  81. package/lib/utils/filterSpecialCharacters.js +48 -46
  82. package/lib/utils/index.js +0 -7
  83. package/lib/vtx-color-picker/index.js +139 -34
  84. package/lib/vtx-color-picker/style/index.js +36 -12
  85. package/lib/vtx-combogrid/Combogrid.js +16 -10
  86. package/lib/vtx-combogrid/index.js +7 -4
  87. package/lib/vtx-combogrid/style/index.js +4 -4
  88. package/lib/vtx-datagrid/Store/Provide.js +116 -138
  89. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -6
  90. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  91. package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  92. package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  93. package/lib/vtx-datagrid/ToolBar/index.js +2 -2
  94. package/lib/vtx-datagrid/columnState.js +73 -0
  95. package/lib/vtx-datagrid/index.js +115 -35
  96. package/lib/vtx-datagrid/mergeComponents.js +21 -0
  97. package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
  98. package/lib/vtx-datagrid/style/index.js +102 -20
  99. package/lib/vtx-date-picker/QdatePicker.js +1 -1
  100. package/lib/vtx-descriptions/Descriptions.js +38 -0
  101. package/lib/vtx-descriptions/index.js +15 -0
  102. package/lib/vtx-descriptions/style/index.js +25 -0
  103. package/lib/vtx-ellipsis-text/index.js +7 -2
  104. package/lib/vtx-ellipsis-text/style/index.js +3 -1
  105. package/lib/vtx-export/index.js +26 -26
  106. package/lib/vtx-export-async/History.js +7 -3
  107. package/lib/vtx-export-async/index.js +40 -12
  108. package/lib/vtx-form-layout/Card.js +9 -9
  109. package/lib/vtx-form-layout/Divider.js +1 -1
  110. package/lib/vtx-form-layout/FormItem.js +18 -17
  111. package/lib/vtx-form-layout/Pane.js +22 -11
  112. package/lib/vtx-icon/index.js +54 -52
  113. package/lib/vtx-icon/index.js1 +90 -0
  114. package/lib/vtx-image/Preview.js +11 -6
  115. package/lib/vtx-image/style/index.js +0 -1
  116. package/lib/vtx-import/index.js +154 -42
  117. package/lib/vtx-import/result.js +6 -2
  118. package/lib/vtx-import/style/index.js +16 -1
  119. package/lib/vtx-import2/Content.js +2 -1
  120. package/lib/vtx-import2/index.js +30 -19
  121. package/lib/vtx-import2/style/index.js +60 -9
  122. package/lib/vtx-input/TextArea/index.js +11 -6
  123. package/lib/vtx-modal/index.js +9 -4
  124. package/lib/vtx-modal/style/index.js +5 -3
  125. package/lib/vtx-page-layout/Content.js +1 -1
  126. package/lib/vtx-page-layout/TabLayout.js +3 -9
  127. package/lib/vtx-page-layout/TableLayout.js +14 -4
  128. package/lib/vtx-page-layout/TableWrap.js +3 -2
  129. package/lib/vtx-page-layout/TreeLayout.js +4 -10
  130. package/lib/vtx-page-layout/container.js +6 -5
  131. package/lib/vtx-page-layout/style/index.js +4 -2
  132. package/lib/vtx-provider/index.js +19 -10
  133. package/lib/vtx-provider/locale/en_US.js +65 -5
  134. package/lib/vtx-provider/locale/zh_CN.js +75 -5
  135. package/lib/vtx-provider/useStyle/index.js +8 -4
  136. package/lib/vtx-scrollable-row/index.js +38 -28
  137. package/lib/vtx-search/index.js +18 -13
  138. package/lib/vtx-search/style/index.js +2 -1
  139. package/lib/vtx-select/index.js +134 -48
  140. package/lib/vtx-select/style/index.js +11 -56
  141. package/lib/vtx-signature/index.js +4 -3
  142. package/lib/vtx-signature/style/index.js +1 -1
  143. package/lib/vtx-split-pane/Resizer.js +0 -1
  144. package/lib/vtx-split-pane/SplitPane.js +32 -23
  145. package/lib/vtx-split-pane/style/index.js +8 -112
  146. package/lib/vtx-time-picker/index.js +27 -1
  147. package/lib/vtx-transfer/Transfer.js +38 -0
  148. package/lib/vtx-transfer/index.js +15 -0
  149. package/lib/vtx-transfer/style/index.js +25 -0
  150. package/lib/vtx-transfer-select/TransferSelect.js +151 -0
  151. package/lib/vtx-transfer-select/index.js +15 -0
  152. package/lib/vtx-transfer-select/style/index.js +25 -0
  153. package/lib/vtx-tree/index.js +102 -38
  154. package/lib/vtx-tree-select/index.js +75 -105
  155. package/lib/vtx-tree-select/style/index.js +9 -3
  156. package/lib/vtx-upload/FilePreview.js +2 -1
  157. package/lib/vtx-wang-editor/index.js +289 -113
  158. package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
  159. package/package.json +44 -28
  160. package/es/utils/hooks/useFetchData/index.js +0 -82
  161. package/lib/utils/hooks/useFetchData/index.js +0 -89
@@ -42,6 +42,7 @@ export default {
42
42
  noFixedTitle: 'Not Fixed',
43
43
  reset: 'Reset',
44
44
  columnDisplay: 'Column Display',
45
+ columnAll: 'All',
45
46
  columnSetting: 'Table Settings',
46
47
  fullScreen: 'Full Screen',
47
48
  exitFullScreen: 'Exit Full Screen',
@@ -50,7 +51,12 @@ export default {
50
51
  densityDefault: 'Default',
51
52
  densityLarger: 'Larger',
52
53
  densityMiddle: 'Middle',
53
- densitySmall: 'Compact'
54
+ densitySmall: 'Compact',
55
+ messageWarningOneText: 'Please select at least one column to save',
56
+ messageSuccessText: 'Operation successful',
57
+ striped: 'Striped',
58
+ border: 'Border',
59
+ headerBackground: 'Header Background'
54
60
  },
55
61
  stepsForm: {
56
62
  next: 'Next',
@@ -119,6 +125,8 @@ export default {
119
125
  operation: 'Import',
120
126
  error: 'Upload failed',
121
127
  success: 'Upload successful',
128
+ selectFile: 'Click to select file',
129
+ noFileSelected: "No file selected",
122
130
  downloadTemplate: 'Download template',
123
131
  pleaseSelectFile: 'Please select the file to upload',
124
132
  upload: 'Upload',
@@ -142,7 +150,9 @@ export default {
142
150
  delete: 'Delete',
143
151
  add: 'Add',
144
152
  import: 'Import',
145
- export: 'Export'
153
+ export: 'Export',
154
+ queryResults: 'Query results',
155
+ deleteConfirm: 'Are you sure you want to delete'
146
156
  },
147
157
  select: {
148
158
  selectAll: 'Select All',
@@ -174,8 +184,58 @@ export default {
174
184
  download: 'Download'
175
185
  },
176
186
  wangEditor: {
177
- imageInsertionFailed: 'Image Insertion Failed',
178
- videoInsertionFailed: 'Video Insertion Failed',
179
- attachmentInsertionFailed: 'Attachment Insertion Failed'
187
+ messageOverSizeText: 'Exceeds file size limit, maximum file size is',
188
+ messageUploadFailText: 'Upload error',
189
+ messageInsertImgFailText: 'Image Insertion Failed',
190
+ messageInsertVideoFailText: 'Video Insertion Failed',
191
+ messageInsertAttachmentFailText: 'Attachment Insertion Failed'
192
+ },
193
+ envPuzzle: {
194
+ common: {
195
+ startTime: 'Start time',
196
+ endTime: 'End time',
197
+ confirm: 'OK',
198
+ prompt: 'Prompt'
199
+ },
200
+ createModal: {
201
+ clear: 'Clear',
202
+ required: '{label} is required',
203
+ whitespace: '{label} cannot contain only whitespace'
204
+ },
205
+ template: {
206
+ selectedPrefix: 'Selected',
207
+ selectedSuffix: 'items',
208
+ clearSelected: 'Clear',
209
+ deleteItemConfirm: 'Delete this item?',
210
+ deleteRowConfirm: 'Confirm delete?',
211
+ deleteSelectedConfirm: 'Delete the selected {count} records?',
212
+ exportSelectedRows: 'Export selected rows',
213
+ exportCurrentPage: 'Export current page',
214
+ exportAll: 'Export all',
215
+ exportAllFields: 'Export all fields',
216
+ exportingFile: 'Exporting file...',
217
+ paginationTotal: 'Total {total} records'
218
+ },
219
+ import: {
220
+ rowNumber: 'Row',
221
+ errorMessage: 'Error message',
222
+ pleaseUploadFile: 'Please upload a file',
223
+ uploadFile: 'Upload file'
224
+ },
225
+ map: {
226
+ goToMap: 'Open map',
227
+ locate: 'Locate',
228
+ calibrate: 'Calibrate',
229
+ redraw: 'Redraw',
230
+ keywordPlaceholder: 'Enter keywords',
231
+ invalidLayerOptions: 'data and options cannot be empty, and map is required'
232
+ },
233
+ upload: {
234
+ downloading: 'Downloading...',
235
+ pictureUnit: 'files'
236
+ },
237
+ request: {
238
+ operationFailed: 'Operation failed'
239
+ }
180
240
  }
181
241
  };
@@ -53,7 +53,10 @@ export default {
53
53
  densityMiddle: '中等',
54
54
  densitySmall: '紧凑',
55
55
  messageWarningOneText: '至少勾选一列保存',
56
- messageSuccessText: '操作成功'
56
+ messageSuccessText: '操作成功',
57
+ striped: '斑马纹',
58
+ border: '边框',
59
+ headerBackground: '表头背景'
57
60
  },
58
61
  stepsForm: {
59
62
  next: '下一步',
@@ -121,6 +124,8 @@ export default {
121
124
  operation: '导入',
122
125
  error: '上传失败',
123
126
  success: '上传成功',
127
+ selectFile: '选择文件',
128
+ noFileSelected: "未选择任何文件",
124
129
  downloadTemplate: '下载模板',
125
130
  pleaseSelectFile: '请选择需要上传的文件',
126
131
  upload: '上传',
@@ -144,7 +149,9 @@ export default {
144
149
  delete: '删除',
145
150
  add: '新增',
146
151
  import: '导入',
147
- export: '导出'
152
+ export: '导出',
153
+ queryResults: '查询结果',
154
+ deleteConfirm: '是否确认删除'
148
155
  },
149
156
  select: {
150
157
  selectAll: '全选',
@@ -176,8 +183,71 @@ export default {
176
183
  download: '下载'
177
184
  },
178
185
  wangEditor: {
179
- imageInsertionFailed: '插入图片失败',
180
- videoInsertionFailed: '插入视频失败',
181
- attachmentInsertionFailed: '插入附件失败'
186
+ messageOverSizeText: '超过文件大小限制,最大文件大小为',
187
+ messageUploadFailText: '上传出错',
188
+ messageInsertImgFailText: '插入图片失败',
189
+ messageInsertVideoFailText: '插入视频失败',
190
+ messageInsertAttachmentFailText: '插入附件失败'
191
+ },
192
+ colorPicker: {
193
+ primary: '主要',
194
+ // 主色调
195
+ danger: '红色',
196
+ // 危险/错误
197
+ success: '绿色',
198
+ // 成功
199
+ info: '青色',
200
+ // 信息/提示
201
+ basic: '基础颜色',
202
+ // 基础色板
203
+ chart: '图表颜色' // 图表专用色
204
+ },
205
+ envPuzzle: {
206
+ common: {
207
+ startTime: '开始时间',
208
+ endTime: '结束时间',
209
+ confirm: '确定',
210
+ prompt: '提示'
211
+ },
212
+ createModal: {
213
+ clear: '清空',
214
+ required: '{label}不能为空',
215
+ whitespace: '{label}不能只包含空白字符'
216
+ },
217
+ template: {
218
+ selectedPrefix: '已选择',
219
+ selectedSuffix: '项',
220
+ clearSelected: '清空',
221
+ deleteItemConfirm: '确定删除该项吗?',
222
+ deleteRowConfirm: '是否确认删除',
223
+ deleteSelectedConfirm: '确定删除选中的{count}条数据吗?',
224
+ exportSelectedRows: '导出选中行',
225
+ exportCurrentPage: '导出当前页',
226
+ exportAll: '导出全部',
227
+ exportAllFields: '导出全量字段',
228
+ exportingFile: '导出文件中...',
229
+ paginationTotal: '总共{total}条记录'
230
+ },
231
+ import: {
232
+ rowNumber: '行数',
233
+ errorMessage: '错误信息',
234
+ pleaseUploadFile: '请上传文件',
235
+ uploadFile: '上传文件'
236
+ },
237
+ map: {
238
+ goToMap: '去地图',
239
+ locate: '定位',
240
+ calibrate: '校正',
241
+ redraw: '重新绘制',
242
+ keywordPlaceholder: '请输入关键字',
243
+ invalidLayerOptions: 'data,options 不能为空或者是map对象没有'
244
+ },
245
+ upload: {
246
+ downloading: '下载中...',
247
+ pictureUnit: '张'
248
+ },
249
+ request: {
250
+ operationFailed: '操作失败'
251
+ }
182
252
  }
183
253
  };
@@ -9,7 +9,6 @@ import { TinyColor } from '@ctrl/tinycolor';
9
9
  import { ConfigProvider as AntdConfigProvider, theme as antdTheme } from 'antd';
10
10
  import { useContext } from 'react';
11
11
  import { VtxProvider } from "../index";
12
- import { merge } from "../utils/merge";
13
12
 
14
13
  /**
15
14
  * 把一个颜色设置一下透明度
@@ -69,7 +68,7 @@ export var operationUnit = function operationUnit(token) {
69
68
  * @returns UseStyleResult
70
69
  */
71
70
  export function useStyle(componentName, styleFn) {
72
- var _token$proComponentsC;
71
+ var _token$vtxComponentsC;
73
72
  // eslint-disable-next-line prefer-const
74
73
  var _useContext = useContext(VtxProvider),
75
74
  _useContext$token = _useContext.token,
@@ -87,8 +86,13 @@ export function useStyle(componentName, styleFn) {
87
86
  if (!token.layout) {
88
87
  token = _objectSpread({}, antdToken);
89
88
  }
90
- token.proComponentsCls = (_token$proComponentsC = token.proComponentsCls) !== null && _token$proComponentsC !== void 0 ? _token$proComponentsC : ".".concat(getPrefixCls('pro'));
89
+ token.vtxComponentsCls = (_token$vtxComponentsC = token.vtxComponentsCls) !== null && _token$vtxComponentsC !== void 0 ? _token$vtxComponentsC : ".vtx";
91
90
  token.antCls = ".".concat(getPrefixCls());
91
+ // wrapSSR 样式注入器 支持 SSR
92
+ // useStyleRegister 生成注入器的工厂
93
+ // nonce CSP 通行证 把生成的 <style> 标签加上 nonce="xxx",防止内联样式被 CSP 拦截
94
+ // path 缓存键 相同 path 就复用已编译的 CSS,避免重复生成样式
95
+ // layer @layer 名称:把全部规则包进 @layer vtx- { ... },方便后续层叠控制与覆盖
92
96
  return {
93
97
  wrapSSR: useStyleRegister({
94
98
  theme: theme,
@@ -96,7 +100,7 @@ export function useStyle(componentName, styleFn) {
96
100
  path: [componentName],
97
101
  nonce: csp === null || csp === void 0 ? void 0 : csp.nonce,
98
102
  layer: {
99
- name: 'vtx-'
103
+ name: 'vtx'
100
104
  }
101
105
  }, function () {
102
106
  return styleFn(token);
@@ -52,44 +52,54 @@ function VtxScrollableRow(props) {
52
52
  setNextPrev();
53
53
  }, 200);
54
54
  window.addEventListener('resize', debouncedResize);
55
- setNextPrev();
55
+ // 使用 requestAnimationFrame 确保 DOM 已渲染
56
+ requestAnimationFrame(function () {
57
+ setNextPrev();
58
+ });
56
59
  return function () {
60
+ debouncedResize.cancel();
57
61
  window.removeEventListener('resize', debouncedResize);
58
62
  };
59
- }, [navRef === null || navRef === void 0 ? void 0 : navRef.current, containerRef.current, navWrapRef.current]);
63
+ }, []);
60
64
  function setNextPrev() {
61
65
  if (navRef !== null && navRef !== void 0 && navRef.current && containerRef.current && navWrapRef.current) {
62
66
  var navNodeW = navRef.current.scrollWidth;
63
67
  var containerW = containerRef.current.offsetWidth;
64
68
  var navWrapNodeW = navWrapRef.current.offsetWidth;
65
69
  var minOffset = containerW - navNodeW;
66
- var _next = state.next,
67
- _prev = state.prev;
68
- if (minOffset >= 0) {
69
- _next = false;
70
- setOffset(0, false);
71
- offset.current = 0;
72
- } else if (minOffset < offset.current) {
73
- _next = true;
74
- } else {
75
- _next = false;
76
- var realOffset = navWrapNodeW - navNodeW;
77
- setOffset(realOffset, false);
78
- offset.current = realOffset;
79
- }
80
- if (offset.current < 0) {
81
- _prev = true;
82
- } else {
83
- _prev = false;
84
- }
85
- setState({
86
- next: _next,
87
- prev: _prev
70
+
71
+ // ✅ 使用函数式更新确保状态一致性
72
+ setState(function (prevState) {
73
+ var next = prevState.next,
74
+ prev = prevState.prev;
75
+ var newOffset = offset.current;
76
+ if (minOffset >= 0) {
77
+ next = false;
78
+ setOffset(0, false);
79
+ newOffset = 0;
80
+ } else if (minOffset < newOffset) {
81
+ next = true;
82
+ } else {
83
+ next = false;
84
+ var realOffset = navWrapNodeW - navNodeW;
85
+ setOffset(realOffset, false);
86
+ newOffset = realOffset;
87
+ }
88
+ if (newOffset < 0) {
89
+ prev = true;
90
+ } else {
91
+ prev = false;
92
+ }
93
+
94
+ // 同步更新 ref 值
95
+ offset.current = newOffset;
96
+
97
+ // 返回新的状态对象
98
+ return {
99
+ next: next,
100
+ prev: prev
101
+ };
88
102
  });
89
- return {
90
- next: _next,
91
- prev: _prev
92
- };
93
103
  }
94
104
  }
95
105
  var setOffset = function setOffset(os) {
@@ -55,10 +55,6 @@ function VtxSearch(props) {
55
55
  isClearButton = _props$isClearButton === void 0 ? true : _props$isClearButton,
56
56
  _props$isMoreButton = props.isMoreButton,
57
57
  isMoreButton = _props$isMoreButton === void 0 ? true : _props$isMoreButton,
58
- _props$confirmText = props.confirmText,
59
- confirmText = _props$confirmText === void 0 ? intl.getMessage('tableForm.search', '查询') : _props$confirmText,
60
- _props$clearText = props.clearText,
61
- clearText = _props$clearText === void 0 ? intl.getMessage('tableForm.reset', '重置') : _props$clearText,
62
58
  onConfirm = props.onConfirm,
63
59
  onClear = props.onClear,
64
60
  renderButtons = props.renderButtons,
@@ -66,7 +62,15 @@ function VtxSearch(props) {
66
62
  showAll = _props$showAll === void 0 ? false : _props$showAll,
67
63
  onToggleShow = props.onToggleShow,
68
64
  _props$customEnumText = props.customEnumText,
69
- customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText;
65
+ customEnumText = _props$customEnumText === void 0 ? {
66
+ confirmText: intl.getMessage('tableForm.search', '查询'),
67
+ //确认按钮文本
68
+ clearText: intl.getMessage('tableForm.reset', '重置'),
69
+ //情况按钮文本
70
+ collapseText: intl.getMessage('tableForm.expand', '收起'),
71
+ //情况按钮文本
72
+ expandText: intl.getMessage('tableForm.collapsed', '展开') //情况按钮文本
73
+ } : _props$customEnumText;
70
74
  var vtxSearchRef = useRef();
71
75
  var ref = useRef();
72
76
  var size = useColSize(vtxSearchRef);
@@ -94,7 +98,7 @@ function VtxSearch(props) {
94
98
  return !!item;
95
99
  }) : props === null || props === void 0 ? void 0 : props.children;
96
100
  var grid = useMemo(function () {
97
- var weightArr = props.gridWeight.filter(function (item) {
101
+ var weightArr = (props.gridWeight || []).filter(function (item) {
98
102
  return !!item;
99
103
  });
100
104
  var sum = 0;
@@ -121,7 +125,7 @@ function VtxSearch(props) {
121
125
  cumulative: cumulative,
122
126
  // 总数量
123
127
  len: cumulative[cumulative.length - 1],
124
- lenWeight: cumulativeWeight[cumulative.length - 2] + weightArr[(weightArr === null || weightArr === void 0 ? void 0 : weightArr.length) - 1],
128
+ lenWeight: cumulativeWeight[Math.max(0, cumulative.length - 2)] + (weightArr[(weightArr === null || weightArr === void 0 ? void 0 : weightArr.length) - 1] || 0),
125
129
  // 几个children
126
130
  count: count,
127
131
  // 兼容的处理
@@ -218,12 +222,13 @@ function VtxSearch(props) {
218
222
  } else {
219
223
  var chData = [];
220
224
  cData.forEach(function (item) {
221
- if (typeof item == 'function') {
225
+ if (typeof item === 'function') {
222
226
  var ite = item();
223
227
  if (Array.isArray(ite)) {
224
228
  chData.push.apply(chData, _toConsumableArray(ite));
229
+ } else {
230
+ chData.push(ite);
225
231
  }
226
- chData.push(ite);
227
232
  return;
228
233
  }
229
234
  if (Array.isArray(item)) {
@@ -295,7 +300,7 @@ function VtxSearch(props) {
295
300
  },
296
301
  type: "primary",
297
302
  onClick: onConfirm,
298
- children: confirmText
303
+ children: customEnumText.confirmText
299
304
  })
300
305
  }), isClearButton && /*#__PURE__*/_jsx("span", {
301
306
  "data-type": 'bt',
@@ -305,7 +310,7 @@ function VtxSearch(props) {
305
310
  width: '100%'
306
311
  },
307
312
  onClick: onClear,
308
- children: clearText
313
+ children: customEnumText.clearText
309
314
  })
310
315
  }), isMoreButton && grid.len > realColumn - 1 && /*#__PURE__*/_jsx("div", {
311
316
  "data-type": 'bt',
@@ -314,9 +319,9 @@ function VtxSearch(props) {
314
319
  },
315
320
  className: classnames("".concat(prefix, "-more"), hashId),
316
321
  children: showMore ? /*#__PURE__*/_jsxs(_Fragment, {
317
- children: [(customEnumText === null || customEnumText === void 0 ? void 0 : customEnumText.collapseText) || '收起', /*#__PURE__*/_jsx(UpOutlined, {})]
322
+ children: [customEnumText.collapseText, /*#__PURE__*/_jsx(UpOutlined, {})]
318
323
  }) : /*#__PURE__*/_jsxs(_Fragment, {
319
- children: [(customEnumText === null || customEnumText === void 0 ? void 0 : customEnumText.expandText) || '展开', /*#__PURE__*/_jsx(DownOutlined, {})]
324
+ children: [customEnumText.expandText, /*#__PURE__*/_jsx(DownOutlined, {})]
320
325
  })
321
326
  })]
322
327
  })
@@ -16,7 +16,8 @@ var genVtxStyle = function genVtxStyle(token) {
16
16
  transitionDuration: token.toggleSpeed,
17
17
  transitionProperty: 'height',
18
18
  boxSizing: 'border-box',
19
- overflow: 'hidden'
19
+ overflow: 'hidden',
20
+ color: token.colorText
20
21
  }, "".concat(componentCls, "-element"), {}), "".concat(componentCls, "-label_v"), {
21
22
  overflow: 'hidden',
22
23
  lineHeight: 1,