@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
@@ -19,6 +19,11 @@ function VtxEllipsisText(props) {
19
19
  tooltip = _props$tooltip === void 0 ? {} : _props$tooltip,
20
20
  className = props.className,
21
21
  style = props.style;
22
+
23
+ // 边界检查
24
+ if (!text) {
25
+ return null;
26
+ }
22
27
  var _useContext = useContext(ConfigProvider.ConfigContext),
23
28
  getPrefixCls = _useContext.getPrefixCls;
24
29
  var prefixCls = getPrefixCls('vtx-ellipsis-text');
@@ -26,7 +31,7 @@ function VtxEllipsisText(props) {
26
31
  wrapSSR = _useStyle.wrapSSR,
27
32
  hashId = _useStyle.hashId;
28
33
  var textStyle = {};
29
- if (lineClamp > 2) {
34
+ if (lineClamp >= 1) {
30
35
  textStyle['WebkitLineClamp'] = lineClamp;
31
36
  }
32
37
  return wrapSSR( /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
@@ -35,7 +40,7 @@ function VtxEllipsisText(props) {
35
40
  mouseEnterDelay: 0.3
36
41
  }, tooltip), {}, {
37
42
  children: /*#__PURE__*/_jsx("p", {
38
- className: classnames(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 2), "".concat(prefixCls, "--multi"), lineClamp >= 2), className),
43
+ className: classnames(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 1), "".concat(prefixCls, "--multi"), lineClamp >= 1), className),
39
44
  style: _objectSpread(_objectSpread({}, style), textStyle),
40
45
  children: text
41
46
  })
@@ -10,7 +10,9 @@ var genVtxEllipsisTextStyle = function genVtxEllipsisTextStyle(token) {
10
10
  return _defineProperty({}, componentCls, _defineProperty(_defineProperty({
11
11
  margin: 0,
12
12
  overflow: 'hidden',
13
- textOverflow: 'ellipsis'
13
+ textOverflow: 'ellipsis',
14
+ wordBreak: "break-all",
15
+ wordWrap: "break-word"
14
16
  }, "&--single", {
15
17
  whiteSpace: 'nowrap'
16
18
  }), "&--multi", {
@@ -16,13 +16,15 @@ import PropTypes from 'prop-types';
16
16
  import axios from 'axios';
17
17
  import qs from 'querystring';
18
18
  import getToken from "../utils/getToken";
19
- import { DownOutlined, ExportOutlined } from '@ant-design/icons';
20
- import { getSignature } from '@vtx/utils';
19
+ import { ExportOutlined } from '@ant-design/icons';
20
+ import downloadFile from '@vtx/utils/lib/downloadFile';
21
+ import getSignature from '@vtx/utils/lib/getSignature';
21
22
  import { isObject } from "../utils";
22
23
  import { useStyle } from "./style/index";
23
24
  import { ConfigProvider, message, Spin, Dropdown, Menu, Button } from 'antd';
24
25
  import classnames from 'classnames';
25
26
  import { useIntl } from "../vtx-provider";
27
+ import VtxIcon from "../vtx-icon";
26
28
  import { jsx as _jsx } from "react/jsx-runtime";
27
29
  import { Fragment as _Fragment } from "react/jsx-runtime";
28
30
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -102,31 +104,26 @@ var VtxExport = function VtxExport(props) {
102
104
  spinning: true,
103
105
  className: classnames(prefixCls, hashId, 'vtx-spin')
104
106
  }), div);
107
+ var status = false;
105
108
  document.body.appendChild(div);
106
- requestToResponse(postData).then(function (res) {
107
- var status = false;
108
- // 文件存在
109
- if (res.headers['content-disposition']) {
110
- var contentDisposition = res.headers['content-disposition'];
111
- var filename;
112
- if (contentDisposition.indexOf('filename*=') > -1) {
113
- filename = decodeURI(contentDisposition.split('filename*=')[1].replace("utf-8'zh_cn'", ''));
114
- } else {
115
- filename = decodeURI(contentDisposition.split('filename=')[1]);
109
+ downloadFile(downloadURL, {
110
+ timeout: timeout,
111
+ data: postData,
112
+ extraHeader: headers,
113
+ success: function success() {
114
+ status = true;
115
+ },
116
+ fail: function fail() {
117
+ status = false;
118
+ message.error('导出失败');
119
+ },
120
+ finally: function _finally() {
121
+ document.body.removeChild(div);
122
+ if (afterExport && typeof afterExport === 'function') {
123
+ afterExport(status);
116
124
  }
117
- if ('download' in document.createElement('a')) {
118
- download(res.data, filename);
119
- status = true;
120
- } else {
121
- message.warning(intl.getMessage('fallback.browserNotSupported', '浏览器不支持'));
122
- }
123
- }
124
- // 关闭loading,执行回调
125
- document.body.removeChild(div);
126
- if (afterExport && typeof afterExport === 'function') {
127
- afterExport(status);
128
125
  }
129
- });
126
+ }, 'blob');
130
127
  }
131
128
  /* 下载并 兼容IE */
132
129
  function download(content, filename) {
@@ -177,7 +174,10 @@ var VtxExport = function VtxExport(props) {
177
174
  trigger: ['click'],
178
175
  children: /*#__PURE__*/_jsxs(Button, {
179
176
  icon: /*#__PURE__*/_jsx(ExportOutlined, {}),
180
- children: [exportText, " ", /*#__PURE__*/_jsx(DownOutlined, {})]
177
+ children: [exportText, " ", /*#__PURE__*/_jsx(VtxIcon, {
178
+ type: "downOutlined",
179
+ fileType: "svg"
180
+ })]
181
181
  })
182
182
  }));
183
183
  };
@@ -38,7 +38,9 @@ function History(props) {
38
38
  _props$customTablePro = props.customTableProps,
39
39
  customTableProps = _props$customTablePro === void 0 ? {} : _props$customTablePro,
40
40
  refreshTime = props.refreshTime,
41
- downloadInNewTab = props.downloadInNewTab;
41
+ downloadInNewTab = props.downloadInNewTab,
42
+ _props$headers = props.headers,
43
+ headers = _props$headers === void 0 ? {} : _props$headers;
42
44
  var _Form$useForm = Form.useForm(),
43
45
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
44
46
  form = _Form$useForm2[0];
@@ -151,7 +153,8 @@ function History(props) {
151
153
  downloadFile(downFileUrl, {
152
154
  data: {
153
155
  id: record.id
154
- }
156
+ },
157
+ extraHeader: headers
155
158
  }, 'blob');
156
159
  }
157
160
  },
@@ -251,6 +254,7 @@ History.propTypes = {
251
254
  TextEnum: PropTypes.object,
252
255
  customTableProps: PropTypes.object,
253
256
  refreshTime: PropTypes.number,
254
- downloadInNewTab: PropTypes.bool
257
+ downloadInNewTab: PropTypes.bool,
258
+ headers: PropTypes.object
255
259
  };
256
260
  export default History;
@@ -10,11 +10,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  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; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import React, { useEffect, forwardRef, useContext, useMemo } from 'react';
13
+ import React, { useEffect, forwardRef, useContext, useMemo, useRef } from 'react';
14
14
  import { ExportOutlined } from '@ant-design/icons';
15
15
  import PropTypes from 'prop-types';
16
16
  import { useSetState } from 'ahooks';
17
- import { Button, Form, Input, message, Modal, Radio, ConfigProvider } from 'antd';
17
+ import { Button, Form, message, Modal, Radio, ConfigProvider } from 'antd';
18
18
  import dayjs from 'dayjs';
19
19
  import { postData } from "./util";
20
20
  import History from "./History";
@@ -23,17 +23,20 @@ import { useStyle } from "./style/index";
23
23
  import classnames from 'classnames';
24
24
  import { useIntl } from "../vtx-provider";
25
25
  import VtxModal from "../vtx-modal";
26
+ import VtxInput from "../vtx-input";
27
+ import { SpecialCharacters } from "../utils/filterSpecialCharacters";
26
28
  import { jsx as _jsx } from "react/jsx-runtime";
27
29
  import { jsxs as _jsxs } from "react/jsx-runtime";
28
- var timer = null;
30
+ var Includes = ['\\\\', '\\/', ':', '*', '?', '"', '<', '>', '|'];
29
31
  var VtxExportAsync = function VtxExportAsync(props) {
30
32
  var intl = useIntl();
31
33
  var _useContext = useContext(ConfigProvider.ConfigContext),
32
34
  getPrefixCls = _useContext.getPrefixCls;
33
- var prefixCls = getPrefixCls('vtx-export-async', props.prefixCls);
35
+ var prefixCls = getPrefixCls('', 'vtx-export-async');
34
36
  var _useStyle = useStyle(prefixCls),
35
37
  wrapSSR = _useStyle.wrapSSR,
36
38
  hashId = _useStyle.hashId;
39
+ var timerRef = useRef(null);
37
40
  var uniqueKey = props.uniqueKey,
38
41
  _props$title = props.title,
39
42
  title = _props$title === void 0 ? '' : _props$title,
@@ -76,9 +79,11 @@ var VtxExportAsync = function VtxExportAsync(props) {
76
79
  downloadInNewTab = _props$downloadInNewT === void 0 ? false : _props$downloadInNewT,
77
80
  _props$enableCustomSe = props.enableCustomSelect,
78
81
  enableCustomSelect = _props$enableCustomSe === void 0 ? false : _props$enableCustomSe,
79
- beforeExport = props.beforeExport,
80
82
  _props$headers = props.headers,
81
- headers = _props$headers === void 0 ? {} : _props$headers;
83
+ headers = _props$headers === void 0 ? {} : _props$headers,
84
+ beforeExport = props.beforeExport,
85
+ _props$historyHeaders = props.historyHeaders,
86
+ historyHeaders = _props$historyHeaders === void 0 ? {} : _props$historyHeaders;
82
87
  var _Form$useForm = Form.useForm(),
83
88
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
84
89
  form = _Form$useForm2[0];
@@ -160,9 +165,9 @@ var VtxExportAsync = function VtxExportAsync(props) {
160
165
  });
161
166
  }, [state.visible]);
162
167
  function close() {
163
- if (timer) {
164
- clearInterval(timer);
165
- timer = null;
168
+ if (timerRef.current) {
169
+ clearInterval(timerRef.current);
170
+ timerRef.current = null;
166
171
  }
167
172
  form.resetFields();
168
173
  setState({
@@ -172,6 +177,15 @@ var VtxExportAsync = function VtxExportAsync(props) {
172
177
  timer: null
173
178
  });
174
179
  }
180
+
181
+ // 组件卸载时也要清理
182
+ useEffect(function () {
183
+ return function () {
184
+ if (timerRef.current) {
185
+ clearInterval(timerRef.current);
186
+ }
187
+ };
188
+ }, []);
175
189
  function showHistory() {
176
190
  setState({
177
191
  showHistoryModal: true
@@ -253,6 +267,8 @@ var VtxExportAsync = function VtxExportAsync(props) {
253
267
  } else {
254
268
  message.error((res === null || res === void 0 ? void 0 : res.msg) || "".concat(intl.getMessage('export.exportText', '导出')).concat(intl.getMessage('export.failure', '失败')));
255
269
  }
270
+ }).catch(function (err) {
271
+ message.error('导出失败:' + (err.message || '网络错误'));
256
272
  });
257
273
  }
258
274
  });
@@ -282,7 +298,9 @@ var VtxExportAsync = function VtxExportAsync(props) {
282
298
  subtitle: TextEnum.modalTitleText
283
299
  }) : TextEnum.modalTitleText,
284
300
  open: state.visible,
285
- maskClosable: false,
301
+ mask: {
302
+ closable: false
303
+ },
286
304
  onCancel: close,
287
305
  footer: [/*#__PURE__*/_jsx(Button, {
288
306
  onClick: close,
@@ -313,8 +331,15 @@ var VtxExportAsync = function VtxExportAsync(props) {
313
331
  required: true,
314
332
  message: TextEnum.requireFieldMsgText
315
333
  }],
316
- children: /*#__PURE__*/_jsx(Input, {
317
- placeholder: TextEnum.placeholderFileName
334
+ children: /*#__PURE__*/_jsx(VtxInput, {
335
+ placeholder: TextEnum.placeholderFileName,
336
+ specialCharactersFilter: {
337
+ include: Includes,
338
+ exclude: SpecialCharacters.filter(function (v) {
339
+ return !Includes.includes(v);
340
+ })
341
+ },
342
+ maxLength: 255
318
343
  })
319
344
  }), /*#__PURE__*/_jsx(Form.Item, {
320
345
  label: TextEnum.fieldTypeText,
@@ -366,7 +391,8 @@ var VtxExportAsync = function VtxExportAsync(props) {
366
391
  TextEnum: TextEnum,
367
392
  customTableProps: customTableProps,
368
393
  refreshTime: refreshTime,
369
- downloadInNewTab: downloadInNewTab
394
+ downloadInNewTab: downloadInNewTab,
395
+ headers: historyHeaders
370
396
  })]
371
397
  }));
372
398
  };
@@ -396,7 +422,9 @@ VtxExportAsync.propTypes = {
396
422
  refreshTime: PropTypes.number,
397
423
  downloadInNewTab: PropTypes.bool,
398
424
  enableCustomSelect: PropTypes.bool,
399
- headers: PropTypes.object
425
+ headers: PropTypes.object,
426
+ beforeExport: PropTypes.object,
427
+ historyHeaders: PropTypes.object
400
428
  };
401
429
  export { VtxExportAsync };
402
430
  export default VtxExportAsync;
@@ -8,7 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  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; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useEffect, useState, useContext } from 'react';
11
+ import React, { useEffect, useState, useContext, useMemo } from 'react';
12
12
  import PropTypes from 'prop-types';
13
13
  import classnames from 'classnames';
14
14
  import { Card, ConfigProvider } from 'antd';
@@ -22,17 +22,17 @@ function VtxCard(props) {
22
22
  _props$expand = props.expand,
23
23
  expand = _props$expand === void 0 ? true : _props$expand,
24
24
  extra = props.extra,
25
- onExpandChange = props.onExpandChange;
25
+ onExpandChange = props.onExpandChange,
26
+ children = props.children;
26
27
  var _useState = useState(expand),
27
28
  _useState2 = _slicedToArray(_useState, 2),
28
29
  visible = _useState2[0],
29
30
  setVisible = _useState2[1];
30
- var style = {};
31
- if (visible) {
32
- style = {
31
+ var iconStyle = useMemo(function () {
32
+ return visible ? {
33
33
  transform: 'rotate(90deg)'
34
- };
35
- }
34
+ } : {};
35
+ }, [visible]);
36
36
  useEffect(function () {
37
37
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
38
38
  onExpandChange && onExpandChange(visible);
@@ -50,8 +50,8 @@ function VtxCard(props) {
50
50
  },
51
51
  children: extra
52
52
  }) : /*#__PURE__*/_jsx(RightOutlined, {
53
- className: "".concat(prefixCls, "-expand-icon\""),
54
- style: style,
53
+ className: "".concat(prefixCls, "-expand-icon"),
54
+ style: iconStyle,
55
55
  onClick: function onClick() {
56
56
  return setVisible(function (pre) {
57
57
  return !pre;
@@ -60,7 +60,7 @@ function VtxCard(props) {
60
60
  }),
61
61
  children: /*#__PURE__*/_jsx("div", {
62
62
  className: classnames("".concat(prefixCls, "-content"), _defineProperty({}, "".concat(prefixCls, "-content-hide"), !visible)),
63
- children: props.children
63
+ children: children
64
64
  })
65
65
  });
66
66
  }
@@ -13,7 +13,7 @@ function VtxDivider(props) {
13
13
  var prefixCls = getPrefixCls('', 'vtx-form-layout-divider');
14
14
  var size = props.size;
15
15
  return /*#__PURE__*/_jsx(Divider, {
16
- className: classnames(prefixCls, _defineProperty({}, "".concat(prefixCls, "--small'"), size === 'small'))
16
+ className: classnames(prefixCls, _defineProperty({}, "".concat(prefixCls, "--small"), size === 'small'))
17
17
  });
18
18
  }
19
19
  VtxDivider.propTypes = {
@@ -12,6 +12,7 @@ import PropTypes from 'prop-types';
12
12
  import { ConfigProvider, Tooltip, Col, Form } from 'antd';
13
13
  import classnames from 'classnames';
14
14
  import { StoreCtx } from "./context";
15
+ import { useIntl } from "../vtx-provider";
15
16
 
16
17
  // 24 栅格
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -19,6 +20,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
19
20
  var SPAN = 24;
20
21
  export default function FormItem(props) {
21
22
  var _rest$rules;
23
+ var intl = useIntl();
22
24
  var _useContext = useContext(ConfigProvider.ConfigContext),
23
25
  getPrefixCls = _useContext.getPrefixCls;
24
26
  var prefixCls = getPrefixCls('', 'vtx-form-layout-item');
@@ -62,27 +64,25 @@ export default function FormItem(props) {
62
64
  if (placeholder) {
63
65
  return placeholder;
64
66
  }
65
- if (typeof label === 'string') {
66
- if (!['Input', 'Select', 'RangePicker', 'VtxInput', 'InputNumber', 'VtxSelect', 'TextArea'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
67
- // console.log(type?.displayName)
68
- }
69
- if (['Input', 'InputNumber', 'VtxInput', 'TextArea'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
70
- return '请输入' + label;
71
- }
72
- if (['Select', 'VtxColorPicker', 'VtxSelect', 'VtxCombogrid'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
73
- return '请选择' + label;
74
- }
75
- if (['RangePicker'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
76
- return undefined;
77
- }
67
+ if (['Input', 'InputNumber', 'VtxInput', 'TextArea', 'VtxEditor'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
68
+ // return '请输入' + label
69
+ return intl.getMessage('tableForm.inputPlaceholder', '请输入');
70
+ }
71
+ if (['Select', 'VtxColorPicker', 'VtxSelect', 'VtxCombogrid', 'VtxTreeSelect', 'VtxZtreeSelect', 'VtxSearchMapInput'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
72
+ // return '请选择' + label
73
+ return intl.getMessage('tableForm.selectPlaceholder', '请选择');
74
+ }
75
+ if (['DatePicker', 'RangePicker', 'TimePicker', 'VtxDatePicker', 'VtxRangePicker', 'VtxTimePicker', 'VtxTimeRangePicker'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
76
+ return undefined;
78
77
  }
79
78
  return null;
80
79
  };
81
80
  var renderItem = function renderItem(child) {
82
81
  if ( /*#__PURE__*/isValidElement(child)) {
83
- return /*#__PURE__*/React.cloneElement(child, {
84
- placeholder: initPlaceholder(props.placeholder, label, child === null || child === void 0 ? void 0 : child.type)
85
- });
82
+ var _child$props;
83
+ return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
84
+ placeholder: initPlaceholder(child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.placeholder, label, child === null || child === void 0 ? void 0 : child.type)
85
+ }));
86
86
  }
87
87
  return child;
88
88
  };
@@ -100,7 +100,8 @@ export default function FormItem(props) {
100
100
  children: label
101
101
  }),
102
102
  required: required,
103
- hidden: hidden
103
+ hidden: hidden,
104
+ colon: label ? true : false
104
105
  }, formItemLayout), {}, {
105
106
  children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread(_objectSpread({
106
107
  noStyle: true
@@ -1,4 +1,4 @@
1
- import React, { useContext } from 'react';
1
+ import React, { useContext, useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { ConfigProvider, Collapse } from 'antd';
4
4
  import { CaretRightOutlined } from '@ant-design/icons';
@@ -8,18 +8,29 @@ function Pane(props) {
8
8
  var _useContext = useContext(ConfigProvider.ConfigContext),
9
9
  getPrefixCls = _useContext.getPrefixCls;
10
10
  var prefixCls = getPrefixCls('', 'vtx-form-layout-pane');
11
- var title = props.title;
12
- var items = [{
13
- key: '1',
14
- label: /*#__PURE__*/_jsx("div", {
15
- className: "".concat(prefixCls, "-title"),
16
- children: title
17
- }),
18
- children: /*#__PURE__*/_jsx("div", {
11
+ var title = props.title,
12
+ children = props.children;
13
+
14
+ // 无标题时直接渲染内容
15
+ if (!title) {
16
+ return /*#__PURE__*/_jsx("div", {
19
17
  className: "".concat(prefixCls, "-content"),
20
- children: props.children
21
- })
22
- }];
18
+ children: children
19
+ });
20
+ }
21
+ var items = useMemo(function () {
22
+ return [{
23
+ key: '1',
24
+ label: /*#__PURE__*/_jsx("div", {
25
+ className: "".concat(prefixCls, "-title"),
26
+ children: title
27
+ }),
28
+ children: /*#__PURE__*/_jsx("div", {
29
+ className: "".concat(prefixCls, "-content"),
30
+ children: children
31
+ })
32
+ }];
33
+ }, [title, children, prefixCls]);
23
34
  return /*#__PURE__*/_jsx(Collapse, {
24
35
  className: prefixCls,
25
36
  bordered: false,
@@ -1,5 +1,6 @@
1
1
  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); }
2
- var _excluded = ["type", "size", "className", "style", "color", "fileType"];
2
+ var _excluded = ["width", "height", "style", "className"],
3
+ _excluded2 = ["type", "size", "className", "style", "color", "fileType"];
3
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
6
  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; }
@@ -7,62 +8,70 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
8
  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); }
8
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
- import { lazy, memo, Suspense, useMemo } from 'react';
11
+ import { memo } from 'react';
12
+ import AlignRightOutlined from "./svg/alignRightOutlined.js";
13
+ import ColumnHeightOutlined from "./svg/columnHeightOutlined.js";
14
+ import DownOutlined from "./svg/downOutlined.js";
15
+ import Fullscreen from "./svg/fullscreen.js";
16
+ import RedoOutlined from "./svg/redoOutlined.js";
17
+ import RightOutlined from "./svg/rightOutlined.js";
18
+ import SettingOutlined from "./svg/settingOutlined.js";
11
19
  import { jsx as _jsx } from "react/jsx-runtime";
12
20
  import { Fragment as _Fragment } from "react/jsx-runtime";
13
- var VtxIcon = /*#__PURE__*/memo(function (_ref) {
14
- var type = _ref.type,
15
- _ref$size = _ref.size,
16
- size = _ref$size === void 0 ? 16 : _ref$size,
17
- _ref$className = _ref.className,
18
- className = _ref$className === void 0 ? '' : _ref$className,
19
- _ref$style = _ref.style,
20
- style = _ref$style === void 0 ? {} : _ref$style,
21
- color = _ref.color,
22
- _ref$fileType = _ref.fileType,
23
- fileType = _ref$fileType === void 0 ? 'webp' : _ref$fileType,
21
+ var iconComponents = {
22
+ alignRightOutlined: AlignRightOutlined,
23
+ columnHeightOutlined: ColumnHeightOutlined,
24
+ downOutlined: DownOutlined,
25
+ fullscreen: Fullscreen,
26
+ redoOutlined: RedoOutlined,
27
+ rightOutlined: RightOutlined,
28
+ settingOutlined: SettingOutlined
29
+ // 低频图标如果确实需要,可以再考虑 lazy
30
+ };
31
+ var EmptySvg = function EmptySvg(_ref) {
32
+ var width = _ref.width,
33
+ height = _ref.height,
34
+ style = _ref.style,
35
+ className = _ref.className,
24
36
  props = _objectWithoutProperties(_ref, _excluded);
37
+ return /*#__PURE__*/_jsx("svg", _objectSpread({
38
+ width: width,
39
+ height: height,
40
+ style: style,
41
+ className: className
42
+ }, props));
43
+ };
44
+ var VtxIcon = /*#__PURE__*/memo(function (_ref2) {
45
+ var type = _ref2.type,
46
+ _ref2$size = _ref2.size,
47
+ size = _ref2$size === void 0 ? 16 : _ref2$size,
48
+ _ref2$className = _ref2.className,
49
+ className = _ref2$className === void 0 ? '' : _ref2$className,
50
+ _ref2$style = _ref2.style,
51
+ style = _ref2$style === void 0 ? {} : _ref2$style,
52
+ color = _ref2.color,
53
+ _ref2$fileType = _ref2.fileType,
54
+ fileType = _ref2$fileType === void 0 ? 'webp' : _ref2$fileType,
55
+ props = _objectWithoutProperties(_ref2, _excluded2);
25
56
  var width = props.width || size;
26
57
  var height = props.height || size;
27
58
  if (!type) {
28
59
  return null;
29
60
  }
30
- var SvgComponent = useMemo(function () {
31
- // 动态导入并缓存结果
32
- return /*#__PURE__*/lazy(function () {
33
- return import( /* @vite-ignore */"./svg/".concat(type, ".js"));
34
- });
35
- }, [type]);
36
61
 
37
62
  // 默认返回空元素
38
63
  if (fileType == 'svg') {
39
- try {
40
- // const SvgComponent = lazy(() => import(`./svg/${type}.js`));
41
- return /*#__PURE__*/_jsx(Suspense, {
42
- fallback: /*#__PURE__*/_jsx("div", {
43
- style: _objectSpread({
44
- width: width,
45
- height: height
46
- }, style)
47
- }),
48
- children: /*#__PURE__*/_jsx(SvgComponent, _objectSpread({
49
- className: className,
50
- style: _objectSpread({
51
- width: width,
52
- height: height
53
- }, style),
54
- fill: color
55
- }, props))
56
- });
57
- } catch (error) {
58
- // 如果动态导入失败,返回空的 SVG 元素
59
- return /*#__PURE__*/_jsx("svg", _objectSpread({
64
+ var SvgComponent = iconComponents[type] || EmptySvg;
65
+ return /*#__PURE__*/_jsx(SvgComponent, _objectSpread({
66
+ className: className,
67
+ style: _objectSpread({
60
68
  width: width,
61
- height: height,
62
- style: style,
63
- className: className
64
- }, props));
65
- }
69
+ height: height
70
+ }, style),
71
+ width: width,
72
+ height: height,
73
+ fill: color
74
+ }, props));
66
75
  } else {
67
76
  return (
68
77
  /*#__PURE__*/