@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.
- package/es/index.js +3 -0
- package/es/utils/filterSpecialCharacters.js +47 -46
- package/es/utils/index.js +1 -2
- package/es/vtx-color-picker/index.js +138 -33
- package/es/vtx-color-picker/style/index.js +36 -12
- package/es/vtx-combogrid/Combogrid.js +16 -10
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-combogrid/style/index.js +4 -4
- package/es/vtx-datagrid/Store/Provide.js +109 -132
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -5
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/index.js +2 -2
- package/es/vtx-datagrid/columnState.js +64 -0
- package/es/vtx-datagrid/index.js +114 -35
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +102 -20
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-descriptions/Descriptions.js +29 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +7 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +25 -25
- package/es/vtx-export-async/History.js +7 -3
- package/es/vtx-export-async/index.js +42 -14
- package/es/vtx-form-layout/Card.js +10 -10
- package/es/vtx-form-layout/Divider.js +1 -1
- package/es/vtx-form-layout/FormItem.js +18 -17
- package/es/vtx-form-layout/Pane.js +23 -12
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/Preview.js +11 -6
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +155 -43
- package/es/vtx-import/result.js +6 -2
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +31 -20
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-input/TextArea/index.js +11 -6
- package/es/vtx-modal/index.js +9 -4
- package/es/vtx-modal/style/index.js +5 -3
- package/es/vtx-page-layout/Content.js +1 -1
- package/es/vtx-page-layout/TabLayout.js +1 -7
- package/es/vtx-page-layout/TableLayout.js +14 -4
- package/es/vtx-page-layout/TableWrap.js +3 -2
- package/es/vtx-page-layout/TreeLayout.js +2 -8
- package/es/vtx-page-layout/container.js +6 -5
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +20 -10
- package/es/vtx-provider/locale/en_US.js +65 -5
- package/es/vtx-provider/locale/zh_CN.js +75 -5
- package/es/vtx-provider/useStyle/index.js +8 -4
- package/es/vtx-scrollable-row/index.js +38 -28
- package/es/vtx-search/index.js +18 -13
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +132 -46
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-signature/index.js +5 -4
- package/es/vtx-signature/style/index.js +1 -1
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +34 -25
- package/es/vtx-split-pane/style/index.js +8 -112
- package/es/vtx-time-picker/index.js +27 -1
- package/es/vtx-transfer/Transfer.js +29 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +104 -40
- package/es/vtx-tree-select/index.js +75 -105
- package/es/vtx-tree-select/style/index.js +9 -3
- package/es/vtx-upload/FilePreview.js +2 -1
- package/es/vtx-wang-editor/index.js +291 -113
- package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
- package/lib/index.js +36 -0
- package/lib/utils/filterSpecialCharacters.js +48 -46
- package/lib/utils/index.js +0 -7
- package/lib/vtx-color-picker/index.js +139 -34
- package/lib/vtx-color-picker/style/index.js +36 -12
- package/lib/vtx-combogrid/Combogrid.js +16 -10
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-combogrid/style/index.js +4 -4
- package/lib/vtx-datagrid/Store/Provide.js +116 -138
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -6
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/index.js +2 -2
- package/lib/vtx-datagrid/columnState.js +73 -0
- package/lib/vtx-datagrid/index.js +115 -35
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +102 -20
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-descriptions/Descriptions.js +38 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +7 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +26 -26
- package/lib/vtx-export-async/History.js +7 -3
- package/lib/vtx-export-async/index.js +40 -12
- package/lib/vtx-form-layout/Card.js +9 -9
- package/lib/vtx-form-layout/Divider.js +1 -1
- package/lib/vtx-form-layout/FormItem.js +18 -17
- package/lib/vtx-form-layout/Pane.js +22 -11
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/Preview.js +11 -6
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +154 -42
- package/lib/vtx-import/result.js +6 -2
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +30 -19
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-input/TextArea/index.js +11 -6
- package/lib/vtx-modal/index.js +9 -4
- package/lib/vtx-modal/style/index.js +5 -3
- package/lib/vtx-page-layout/Content.js +1 -1
- package/lib/vtx-page-layout/TabLayout.js +3 -9
- package/lib/vtx-page-layout/TableLayout.js +14 -4
- package/lib/vtx-page-layout/TableWrap.js +3 -2
- package/lib/vtx-page-layout/TreeLayout.js +4 -10
- package/lib/vtx-page-layout/container.js +6 -5
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +19 -10
- package/lib/vtx-provider/locale/en_US.js +65 -5
- package/lib/vtx-provider/locale/zh_CN.js +75 -5
- package/lib/vtx-provider/useStyle/index.js +8 -4
- package/lib/vtx-scrollable-row/index.js +38 -28
- package/lib/vtx-search/index.js +18 -13
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +134 -48
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-signature/index.js +4 -3
- package/lib/vtx-signature/style/index.js +1 -1
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +32 -23
- package/lib/vtx-split-pane/style/index.js +8 -112
- package/lib/vtx-time-picker/index.js +27 -1
- package/lib/vtx-transfer/Transfer.js +38 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +102 -38
- package/lib/vtx-tree-select/index.js +75 -105
- package/lib/vtx-tree-select/style/index.js +9 -3
- package/lib/vtx-upload/FilePreview.js +2 -1
- package/lib/vtx-wang-editor/index.js +289 -113
- package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
- package/package.json +44 -28
- package/es/utils/hooks/useFetchData/index.js +0 -82
- 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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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$
|
|
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.
|
|
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
|
-
|
|
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
|
-
}, [
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
offset.current
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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) {
|
package/es/vtx-search/index.js
CHANGED
|
@@ -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 ? {
|
|
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
|
|
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: [
|
|
322
|
+
children: [customEnumText.collapseText, /*#__PURE__*/_jsx(UpOutlined, {})]
|
|
318
323
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
319
|
-
children: [
|
|
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,
|