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

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 (212) hide show
  1. package/README.md +19 -19
  2. package/es/index.js +3 -0
  3. package/es/utils/components/LabelIconTip/index.js +7 -7
  4. package/es/utils/conversionMomentValue/index.js +25 -25
  5. package/es/utils/filterSpecialCharacters.js +53 -52
  6. package/es/utils/genCopyable/index.js +6 -6
  7. package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  8. package/es/utils/hooks/useDebounceFn/index.js +4 -4
  9. package/es/utils/hooks/useDebounceValue/index.js +6 -6
  10. package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
  11. package/es/utils/hooks/useLatest/index.js +2 -2
  12. package/es/utils/hooks/useRefCallback/index.js +5 -5
  13. package/es/utils/index.js +1 -2
  14. package/es/utils/isBrowser/index.js +7 -7
  15. package/es/utils/isUrl/index.js +4 -4
  16. package/es/utils/merge/index.js +4 -4
  17. package/es/utils/nanoid/index.js +4 -4
  18. package/es/utils/omitBoolean/index.js +4 -4
  19. package/es/utils/parseValueToMoment/index.js +4 -4
  20. package/es/utils/proFieldParsingText/index.js +10 -10
  21. package/es/utils/transformKeySubmitValue/index.js +57 -57
  22. package/es/utils/useEditableArray/index.js +46 -46
  23. package/es/utils/useEditableMap/index.js +22 -22
  24. package/es/utils/useMediaQuery/index.js +5 -5
  25. package/es/vtx-color-picker/index.js +138 -33
  26. package/es/vtx-color-picker/style/index.js +36 -12
  27. package/es/vtx-combogrid/Combogrid.js +16 -10
  28. package/es/vtx-combogrid/index.js +7 -4
  29. package/es/vtx-combogrid/style/index.js +4 -4
  30. package/es/vtx-datagrid/Store/Provide.js +109 -132
  31. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -9
  32. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  33. package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  34. package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  35. package/es/vtx-datagrid/ToolBar/index.js +2 -2
  36. package/es/vtx-datagrid/columnState.js +64 -0
  37. package/es/vtx-datagrid/index.js +114 -35
  38. package/es/vtx-datagrid/mergeComponents.js +15 -0
  39. package/es/vtx-datagrid/renderColumnButtons.js +30 -11
  40. package/es/vtx-datagrid/style/index.js +102 -20
  41. package/es/vtx-datagrid/style/index.less +242 -242
  42. package/es/vtx-date-picker/QdatePicker.js +1 -1
  43. package/es/vtx-date-picker/style/index.less +39 -39
  44. package/es/vtx-descriptions/Descriptions.js +29 -0
  45. package/es/vtx-descriptions/index.js +3 -0
  46. package/es/vtx-descriptions/style/index.js +19 -0
  47. package/es/vtx-ellipsis-text/index.js +7 -2
  48. package/es/vtx-ellipsis-text/style/index.js +3 -1
  49. package/es/vtx-export/index.js +33 -33
  50. package/es/vtx-export-async/History.js +11 -3
  51. package/es/vtx-export-async/index.js +45 -15
  52. package/es/vtx-form-layout/Card.js +10 -10
  53. package/es/vtx-form-layout/Divider.js +1 -1
  54. package/es/vtx-form-layout/FormItem.js +18 -17
  55. package/es/vtx-form-layout/Pane.js +23 -12
  56. package/es/vtx-icon/index.js +54 -45
  57. package/es/vtx-icon/index.js1 +90 -0
  58. package/es/vtx-image/Preview.js +11 -6
  59. package/es/vtx-image/style/index.js +0 -1
  60. package/es/vtx-import/index.js +155 -43
  61. package/es/vtx-import/result.js +6 -2
  62. package/es/vtx-import/style/index.js +16 -1
  63. package/es/vtx-import2/Content.js +2 -1
  64. package/es/vtx-import2/index.js +31 -20
  65. package/es/vtx-import2/style/index.js +60 -9
  66. package/es/vtx-input/TextArea/index.js +11 -6
  67. package/es/vtx-modal/index.js +11 -6
  68. package/es/vtx-modal/style/index.js +5 -3
  69. package/es/vtx-page-layout/Basic.js +2 -2
  70. package/es/vtx-page-layout/Content.js +1 -1
  71. package/es/vtx-page-layout/TabLayout.js +7 -13
  72. package/es/vtx-page-layout/TableLayout.js +24 -14
  73. package/es/vtx-page-layout/TableWrap.js +3 -2
  74. package/es/vtx-page-layout/TreeLayout.js +8 -14
  75. package/es/vtx-page-layout/container.js +8 -7
  76. package/es/vtx-page-layout/style/index.js +4 -2
  77. package/es/vtx-provider/index.js +50 -40
  78. package/es/vtx-provider/intl.js +9 -9
  79. package/es/vtx-provider/locale/en_US.js +65 -5
  80. package/es/vtx-provider/locale/zh_CN.js +75 -5
  81. package/es/vtx-provider/useStyle/index.js +25 -21
  82. package/es/vtx-scrollable-row/index.js +38 -28
  83. package/es/vtx-search/index.js +18 -13
  84. package/es/vtx-search/style/index.js +2 -1
  85. package/es/vtx-select/index.js +132 -46
  86. package/es/vtx-select/style/index.js +11 -56
  87. package/es/vtx-signature/index.js +5 -4
  88. package/es/vtx-signature/style/index.js +1 -1
  89. package/es/vtx-split-pane/Resizer.js +0 -1
  90. package/es/vtx-split-pane/SplitPane.js +34 -25
  91. package/es/vtx-split-pane/style/index.js +8 -112
  92. package/es/vtx-time-picker/index.js +27 -1
  93. package/es/vtx-transfer/Transfer.js +29 -0
  94. package/es/vtx-transfer/index.js +3 -0
  95. package/es/vtx-transfer/style/index.js +19 -0
  96. package/es/vtx-transfer-select/TransferSelect.js +143 -0
  97. package/es/vtx-transfer-select/index.js +3 -0
  98. package/es/vtx-transfer-select/style/index.js +19 -0
  99. package/es/vtx-tree/index.js +104 -40
  100. package/es/vtx-tree-select/index.js +75 -105
  101. package/es/vtx-tree-select/style/index.js +9 -3
  102. package/es/vtx-upload/FilePreview.js +2 -1
  103. package/es/vtx-wang-editor/index.js +291 -113
  104. package/es/vtx-wang-editor/style/index.less +12 -12
  105. package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
  106. package/lib/index.js +36 -0
  107. package/lib/utils/components/LabelIconTip/index.js +7 -7
  108. package/lib/utils/conversionMomentValue/index.js +25 -25
  109. package/lib/utils/filterSpecialCharacters.js +54 -52
  110. package/lib/utils/genCopyable/index.js +6 -6
  111. package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  112. package/lib/utils/hooks/useDebounceFn/index.js +4 -4
  113. package/lib/utils/hooks/useDebounceValue/index.js +6 -6
  114. package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
  115. package/lib/utils/hooks/useLatest/index.js +2 -2
  116. package/lib/utils/hooks/useRefCallback/index.js +5 -5
  117. package/lib/utils/index.js +0 -7
  118. package/lib/utils/isBrowser/index.js +7 -7
  119. package/lib/utils/isUrl/index.js +4 -4
  120. package/lib/utils/merge/index.js +4 -4
  121. package/lib/utils/nanoid/index.js +4 -4
  122. package/lib/utils/omitBoolean/index.js +4 -4
  123. package/lib/utils/parseValueToMoment/index.js +4 -4
  124. package/lib/utils/proFieldParsingText/index.js +10 -10
  125. package/lib/utils/transformKeySubmitValue/index.js +57 -57
  126. package/lib/utils/useEditableArray/index.js +46 -46
  127. package/lib/utils/useEditableMap/index.js +22 -22
  128. package/lib/utils/useMediaQuery/index.js +5 -5
  129. package/lib/vtx-color-picker/index.js +139 -34
  130. package/lib/vtx-color-picker/style/index.js +36 -12
  131. package/lib/vtx-combogrid/Combogrid.js +16 -10
  132. package/lib/vtx-combogrid/index.js +7 -4
  133. package/lib/vtx-combogrid/style/index.js +4 -4
  134. package/lib/vtx-datagrid/Store/Provide.js +116 -138
  135. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +15 -10
  136. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
  137. package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  138. package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  139. package/lib/vtx-datagrid/ToolBar/index.js +2 -2
  140. package/lib/vtx-datagrid/columnState.js +73 -0
  141. package/lib/vtx-datagrid/index.js +115 -35
  142. package/lib/vtx-datagrid/mergeComponents.js +21 -0
  143. package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
  144. package/lib/vtx-datagrid/style/index.js +102 -20
  145. package/lib/vtx-datagrid/style/index.less +242 -242
  146. package/lib/vtx-date-picker/QdatePicker.js +1 -1
  147. package/lib/vtx-date-picker/style/index.less +39 -39
  148. package/lib/vtx-descriptions/Descriptions.js +38 -0
  149. package/lib/vtx-descriptions/index.js +15 -0
  150. package/lib/vtx-descriptions/style/index.js +25 -0
  151. package/lib/vtx-ellipsis-text/index.js +7 -2
  152. package/lib/vtx-ellipsis-text/style/index.js +3 -1
  153. package/lib/vtx-export/index.js +34 -34
  154. package/lib/vtx-export-async/History.js +11 -3
  155. package/lib/vtx-export-async/index.js +43 -13
  156. package/lib/vtx-form-layout/Card.js +9 -9
  157. package/lib/vtx-form-layout/Divider.js +1 -1
  158. package/lib/vtx-form-layout/FormItem.js +18 -17
  159. package/lib/vtx-form-layout/Pane.js +22 -11
  160. package/lib/vtx-icon/index.js +54 -52
  161. package/lib/vtx-icon/index.js1 +90 -0
  162. package/lib/vtx-image/Preview.js +11 -6
  163. package/lib/vtx-image/style/index.js +0 -1
  164. package/lib/vtx-import/index.js +154 -42
  165. package/lib/vtx-import/result.js +6 -2
  166. package/lib/vtx-import/style/index.js +16 -1
  167. package/lib/vtx-import2/Content.js +2 -1
  168. package/lib/vtx-import2/index.js +30 -19
  169. package/lib/vtx-import2/style/index.js +60 -9
  170. package/lib/vtx-input/TextArea/index.js +11 -6
  171. package/lib/vtx-modal/index.js +11 -6
  172. package/lib/vtx-modal/style/index.js +5 -3
  173. package/lib/vtx-page-layout/Basic.js +2 -2
  174. package/lib/vtx-page-layout/Content.js +1 -1
  175. package/lib/vtx-page-layout/TabLayout.js +8 -14
  176. package/lib/vtx-page-layout/TableLayout.js +24 -14
  177. package/lib/vtx-page-layout/TableWrap.js +3 -2
  178. package/lib/vtx-page-layout/TreeLayout.js +9 -15
  179. package/lib/vtx-page-layout/container.js +8 -7
  180. package/lib/vtx-page-layout/style/index.js +4 -2
  181. package/lib/vtx-provider/index.js +49 -40
  182. package/lib/vtx-provider/intl.js +9 -9
  183. package/lib/vtx-provider/locale/en_US.js +65 -5
  184. package/lib/vtx-provider/locale/zh_CN.js +75 -5
  185. package/lib/vtx-provider/useStyle/index.js +25 -21
  186. package/lib/vtx-scrollable-row/index.js +38 -28
  187. package/lib/vtx-search/index.js +18 -13
  188. package/lib/vtx-search/style/index.js +2 -1
  189. package/lib/vtx-select/index.js +134 -48
  190. package/lib/vtx-select/style/index.js +11 -56
  191. package/lib/vtx-signature/index.js +4 -3
  192. package/lib/vtx-signature/style/index.js +1 -1
  193. package/lib/vtx-split-pane/Resizer.js +0 -1
  194. package/lib/vtx-split-pane/SplitPane.js +32 -23
  195. package/lib/vtx-split-pane/style/index.js +8 -112
  196. package/lib/vtx-time-picker/index.js +27 -1
  197. package/lib/vtx-transfer/Transfer.js +38 -0
  198. package/lib/vtx-transfer/index.js +15 -0
  199. package/lib/vtx-transfer/style/index.js +25 -0
  200. package/lib/vtx-transfer-select/TransferSelect.js +151 -0
  201. package/lib/vtx-transfer-select/index.js +15 -0
  202. package/lib/vtx-transfer-select/style/index.js +25 -0
  203. package/lib/vtx-tree/index.js +102 -38
  204. package/lib/vtx-tree-select/index.js +75 -105
  205. package/lib/vtx-tree-select/style/index.js +9 -3
  206. package/lib/vtx-upload/FilePreview.js +2 -1
  207. package/lib/vtx-wang-editor/index.js +289 -113
  208. package/lib/vtx-wang-editor/style/index.less +12 -12
  209. package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
  210. package/package.json +238 -222
  211. package/es/utils/hooks/useFetchData/index.js +0 -82
  212. package/lib/utils/hooks/useFetchData/index.js +0 -89
@@ -21,9 +21,9 @@ function ToolBar(props) {
21
21
  onRefresh = props.onRefresh,
22
22
  hideColumnHeight = props.hideColumnHeight,
23
23
  hideColumnSetting = props.hideColumnSetting,
24
- columns = props.columns,
25
24
  onColumnsSave = props.onColumnsSave,
26
25
  uniqueKey = props.uniqueKey,
26
+ columns = props.columns,
27
27
  TextEnum = props.TextEnum;
28
28
  var _useStyle = useStyle("".concat(prefix, "-toolbar")),
29
29
  wrapSSR = _useStyle.wrapSSR,
@@ -72,7 +72,7 @@ function ToolBar(props) {
72
72
  }), !hideColumnSetting && /*#__PURE__*/_jsx("div", {
73
73
  className: "".concat(prefix, "-toolbar-setting-item"),
74
74
  children: /*#__PURE__*/_jsx(ColumnSetting, {
75
- columns: columns,
75
+ localColumns: columns,
76
76
  uniqueKey: uniqueKey,
77
77
  onColumnsSave: onColumnsSave
78
78
  })
@@ -0,0 +1,64 @@
1
+ import { genColumnKey } from "../utils/genColumnKey";
2
+ import { sortByGivenOrder } from "../utils/sortByGivenOrder";
3
+ export var indexColumnKey = '_serialNum';
4
+ export function buildColumnKeyMap() {
5
+ var tableColumn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
7
+ visibleColumnKeys = _ref.visibleColumnKeys,
8
+ defaultVisibleColumnKeys = _ref.defaultVisibleColumnKeys,
9
+ _ref$previousColumnsM = _ref.previousColumnsMap,
10
+ previousColumnsMap = _ref$previousColumnsM === void 0 ? {} : _ref$previousColumnsM,
11
+ _ref$indexColumn = _ref.indexColumn,
12
+ indexColumn = _ref$indexColumn === void 0 ? true : _ref$indexColumn;
13
+ var hasVisibleColumnKeys = Array.isArray(visibleColumnKeys);
14
+ var hasDefaultVisibleColumnKeys = Array.isArray(defaultVisibleColumnKeys);
15
+ return (tableColumn || []).reduce(function (columnKeyMap, _ref2, index) {
16
+ var _previousConfig$fixed, _previousConfig$width;
17
+ var key = _ref2.key,
18
+ dataIndex = _ref2.dataIndex,
19
+ fixed = _ref2.fixed,
20
+ disable = _ref2.disable,
21
+ width = _ref2.width;
22
+ var columnKey = genColumnKey(key !== null && key !== void 0 ? key : dataIndex, index);
23
+ var previousConfig = previousColumnsMap[columnKey] || {};
24
+ var show = previousConfig.show;
25
+ if (indexColumn && indexColumnKey === columnKey) {
26
+ show = true;
27
+ } else if (hasVisibleColumnKeys) {
28
+ show = visibleColumnKeys.includes(columnKey);
29
+ } else if (show === undefined && hasDefaultVisibleColumnKeys) {
30
+ show = defaultVisibleColumnKeys.includes(columnKey);
31
+ } else if (show === undefined) {
32
+ show = true;
33
+ }
34
+ columnKeyMap[columnKey] = {
35
+ show: show,
36
+ fixed: (_previousConfig$fixed = previousConfig.fixed) !== null && _previousConfig$fixed !== void 0 ? _previousConfig$fixed : fixed,
37
+ disable: disable,
38
+ width: (_previousConfig$width = previousConfig.width) !== null && _previousConfig$width !== void 0 ? _previousConfig$width : width
39
+ };
40
+ if (previousConfig.order !== undefined) {
41
+ columnKeyMap[columnKey].order = previousConfig.order;
42
+ }
43
+ return columnKeyMap;
44
+ }, {});
45
+ }
46
+ export function buildSortKeyColumns() {
47
+ var columnsMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
48
+ var visibleColumnKeys = arguments.length > 1 ? arguments[1] : undefined;
49
+ var defaultVisibleColumnKeys = arguments.length > 2 ? arguments[2] : undefined;
50
+ var columnKeys = Object.keys(columnsMap);
51
+ var sortKeys = visibleColumnKeys || defaultVisibleColumnKeys || [];
52
+ if (sortKeys.length > 0) {
53
+ return sortByGivenOrder(columnKeys, sortKeys);
54
+ }
55
+ return columnKeys;
56
+ }
57
+ export function getVisibleColumnKeysFromMap() {
58
+ var columnsMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
59
+ var sortKeyColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
60
+ return sortKeyColumns.filter(function (columnKey) {
61
+ var _columnsMap$columnKey;
62
+ return (_columnsMap$columnKey = columnsMap[columnKey]) === null || _columnsMap$columnKey === void 0 ? void 0 : _columnsMap$columnKey.show;
63
+ });
64
+ }
@@ -23,14 +23,22 @@ import useSet from "../utils/useSet";
23
23
  import Alert from "./Alert";
24
24
  import ToolBar from "./ToolBar";
25
25
  import { Container, TableContext } from "./Store/Provide";
26
+ import { mergeComponentsForResize } from "./mergeComponents";
26
27
  import { useStyle } from "./style/index";
27
28
  import { useAntdColumnResize } from 'react-antd-column-resize';
29
+ import { useIntl } from "../vtx-provider";
28
30
  import { jsx as _jsx } from "react/jsx-runtime";
29
31
  import { jsxs as _jsxs } from "react/jsx-runtime";
30
32
  var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
31
33
  export var indexColumnKey = '_serialNum';
34
+ export var DEFAULT_HEIGHTS = {
35
+ HEAD_FOOT: 115,
36
+ ALERT: 48,
37
+ TOOLBAR: 64
38
+ };
32
39
  function VtxTable(props) {
33
40
  var _rest$dataSource, _rest$rowSelection, _rest$rowSelection3, _rest$rowSelection4;
41
+ var intl = useIntl();
34
42
  var _useContext = useContext(ConfigProvider.ConfigContext),
35
43
  getPrefixCls = _useContext.getPrefixCls;
36
44
  var prefixCls = getPrefixCls('', 'vtx-datagrid');
@@ -45,7 +53,8 @@ function VtxTable(props) {
45
53
  isDragRef = _useContext2.isDragRef,
46
54
  rootDomRef = _useContext2.rootDomRef,
47
55
  sortKeyColumns = _useContext2.sortKeyColumns,
48
- TextEnum = _useContext2.TextEnum;
56
+ TextEnum = _useContext2.TextEnum,
57
+ tableSize = _useContext2.tableSize;
49
58
  var _useSet = useSet({
50
59
  // 表格id
51
60
  datagridId: "vtx-datagrid-".concat(new Date().getTime()),
@@ -66,7 +75,7 @@ function VtxTable(props) {
66
75
  toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
67
76
  toolbarClassName = props.toolbarClassName,
68
77
  _props$toolbarTilte = props.toolbarTilte,
69
- toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
78
+ toolbarTilte = _props$toolbarTilte === void 0 ? intl.getMessage('datagrid.queryResults', '查询结果') : _props$toolbarTilte,
70
79
  buttonGroup = props.buttonGroup,
71
80
  _props$refreshIconVis = props.refreshIconVisible,
72
81
  refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
@@ -80,14 +89,14 @@ function VtxTable(props) {
80
89
  _props$autoFit = props.autoFit,
81
90
  autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
82
91
  _props$headFootHeight = props.headFootHeight,
83
- headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
92
+ headFootHeight = _props$headFootHeight === void 0 ? DEFAULT_HEIGHTS.HEAD_FOOT : _props$headFootHeight,
84
93
  _props$columnResizabl = props.columnResizable,
85
94
  columnResizable = _props$columnResizabl === void 0 ? true : _props$columnResizabl,
86
95
  components = props.components,
87
96
  className = props.className,
88
97
  style = props.style,
89
98
  _props$emptyText = props.emptyText,
90
- emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
99
+ emptyText = _props$emptyText === void 0 ? intl.getMessage('select.empty', '暂无数据') : _props$emptyText,
91
100
  onRowSelectionClear = props.onRowSelectionClear,
92
101
  onColumnsSave = props.onColumnsSave,
93
102
  uniqueKey = props.uniqueKey,
@@ -100,20 +109,43 @@ function VtxTable(props) {
100
109
 
101
110
  // 高度计算
102
111
  var _useThrottleFn = useThrottleFn(function () {
103
- var _rootDomRef$current;
112
+ var _rootDomRef$current, _bodyDiv$getElementsB;
104
113
  if (!rootDomRef.current) {
105
114
  return null;
106
115
  }
107
- var bodyHeight = ((_rootDomRef$current = rootDomRef.current) === null || _rootDomRef$current === void 0 ? void 0 : _rootDomRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
108
116
  var divs = rootDomRef.current.getElementsByTagName('div');
117
+ var pagination = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('ul'), function (dom) {
118
+ return dom.className.includes('ant-pagination');
119
+ })[0];
120
+ var tableHeader = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('thead'), function (dom) {
121
+ return dom.className.includes('ant-table-thead');
122
+ })[0];
123
+ var _headFootHeight = headFootHeight;
124
+ if (tableHeader) {
125
+ _headFootHeight = ((pagination === null || pagination === void 0 ? void 0 : pagination.clientHeight) || 0) + 32 + (tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.clientHeight);
126
+ }
127
+ var bodyHeight = ((_rootDomRef$current = rootDomRef.current) === null || _rootDomRef$current === void 0 ? void 0 : _rootDomRef$current.clientHeight) - _headFootHeight - toolbarHeight.current - alertHeight.current;
109
128
  var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
110
- return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
129
+ return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content') || dom.className.includes('ant-table-tbody');
130
+ })[0];
131
+ var tablePlaceholder = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('tr'), function (dom) {
132
+ return dom.className.includes('ant-table-placeholder');
111
133
  })[0];
112
134
  if (bodyDiv) {
113
135
  bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
114
136
  }
137
+ 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;
138
+ if (tablePlaceholder) {
139
+ tablePlaceholder.style.height = "".concat(bodyHeight - (rest.scrollY || 0) - 48 - 12, "px");
140
+ var tableCell = Array.prototype.filter.call(tablePlaceholder.getElementsByTagName('td'), function (dom) {
141
+ return dom.className.includes('ant-table-cell');
142
+ })[0];
143
+ tableCell.style.height = "".concat(bodyHeight - (rest.scrollY || 0) - 48 - 12, "px");
144
+ }
145
+ // antd6.x 的bug 如果table的高度 没有body 高 则没有滚动条
146
+
115
147
  setState({
116
- scrollY: bodyHeight
148
+ scrollY: tableHeight > bodyHeight ? bodyHeight : undefined
117
149
  });
118
150
  }, {
119
151
  wait: 350
@@ -123,19 +155,24 @@ function VtxTable(props) {
123
155
  var resizeObserver = new ResizeObserver(function () {
124
156
  calculateHeight();
125
157
  });
126
- // componentDidMount
127
158
  if (autoFit && rootDomRef.current) {
128
159
  resizeObserver.observe(rootDomRef.current, {
129
160
  box: 'border-box'
130
161
  });
131
162
  }
132
163
  return function () {
133
- // componentWillUnmount
134
164
  if (autoFit) {
135
165
  resizeObserver.disconnect();
136
166
  }
137
167
  };
138
- }, [autoFit]);
168
+ }, [autoFit, tableSize]);
169
+
170
+ // fix: 最后一页,横向滚动条上移问题
171
+ useEffect(function () {
172
+ if (scrollY > 0) {
173
+ calculateHeight();
174
+ }
175
+ }, [scrollY]);
139
176
  useLayoutEffect(function () {
140
177
  if (autoFit) {
141
178
  calculateHeight();
@@ -152,7 +189,7 @@ function VtxTable(props) {
152
189
  showSizeChanger: true,
153
190
  showQuickJumper: true,
154
191
  showTotal: function showTotal(total) {
155
- return "".concat(TextEnum.total, " ").concat(total, " ").concat(TextEnum.item);
192
+ return "".concat(TextEnum.paginationTotalText, " ").concat(total, " ").concat(TextEnum.paginationItemText);
156
193
  }
157
194
  }, pagination);
158
195
  };
@@ -176,9 +213,6 @@ function VtxTable(props) {
176
213
  });
177
214
  };
178
215
  var _tableColumn = loopFilter(counter.tableColumn);
179
- if (!columnsMap['_serialNum']) {
180
- return [];
181
- }
182
216
  return sortByKeyArrayExtract(_tableColumn, sortKeyColumns, columnsMap, 'key');
183
217
  }, [columnsMap, counter.tableColumn, sortKeyColumns]);
184
218
 
@@ -216,9 +250,12 @@ function VtxTable(props) {
216
250
  result = _objectSpread(_objectSpread({}, result), {}, {
217
251
  y: scrollY - (rest.scrollY || 0)
218
252
  });
253
+ if (scrollY == undefined) {
254
+ result.y = undefined;
255
+ }
219
256
  }
220
257
  return result;
221
- }, [rest.scroll, rest.scrollY, autoFit]);
258
+ }, [rest.scroll, rest.scrollY, scrollY, autoFit]);
222
259
  var hasAlert = useMemo(function () {
223
260
  var _rest$rowSelection2;
224
261
  return (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
@@ -227,20 +264,49 @@ function VtxTable(props) {
227
264
  selectedRowKeys: (_rest$rowSelection4 = rest.rowSelection) === null || _rest$rowSelection4 === void 0 ? void 0 : _rest$rowSelection4.selectedRowKeys,
228
265
  onRowSelectionClear: onRowSelectionClear
229
266
  }) : null;
230
- alertHeight.current = !hideSelectionClear && hasAlert ? 49 : 0;
231
- toolbarHeight.current = toolbar ? 56 : 0;
267
+ alertHeight.current = !hideSelectionClear && hasAlert ? DEFAULT_HEIGHTS.ALERT : 0;
268
+ toolbarHeight.current = toolbar ? DEFAULT_HEIGHTS.TOOLBAR : 0;
232
269
  var _useAntdColumnResize = useAntdColumnResize(function () {
233
270
  return {
234
271
  columns: columns,
235
- minWidth: 20
272
+ minWidth: 10
236
273
  };
237
274
  }, [columns]),
238
275
  resizableColumns = _useAntdColumnResize.resizableColumns,
239
276
  resizeComponents = _useAntdColumnResize.components,
240
277
  tableWidth = _useAntdColumnResize.tableWidth,
241
278
  resetColumns = _useAntdColumnResize.resetColumns;
279
+
280
+ // const _columns = useMemo(() => {
281
+ // let result = [];
282
+ // if (!showTable) {
283
+ // result = []
284
+ // } else if (isDragRef) {
285
+ // result = resizableColumns
286
+ // } else {
287
+ // result = columns
288
+ // }
289
+ // let flag = false;
290
+ // result?.map((v) => {
291
+ // if (columnsMap[v.key].width !== v.width) {
292
+ // flag = true;
293
+ // columnsMap[v.key] = {
294
+ // ...columnsMap[v.key],
295
+ // width: v.width
296
+ // };
297
+ // }
298
+ // })
299
+ // if (flag) {
300
+ // counter.setColumnsMap(
301
+ // columnsMap
302
+ // )
303
+ // }
304
+ // return result;
305
+
306
+ // }, [isDragRef, resizableColumns, showTable, columns, columnsMap])
307
+
308
+ // 1. 先计算列配置
242
309
  var _columns = useMemo(function () {
243
- var _result;
244
310
  var result = [];
245
311
  if (!showTable) {
246
312
  result = [];
@@ -249,24 +315,30 @@ function VtxTable(props) {
249
315
  } else {
250
316
  result = columns;
251
317
  }
318
+ return result;
319
+ }, [isDragRef, resizableColumns, showTable, columns]);
320
+
321
+ // 2. 在 effect 中同步列宽到 columnsMap
322
+ useEffect(function () {
323
+ if (!showTable || !_columns.length) return;
252
324
  var flag = false;
253
- (_result = result) === null || _result === void 0 || _result.map(function (v) {
254
- if (columnsMap[v.key].width !== v.width) {
325
+ var newColumnsMap = _objectSpread({}, columnsMap); // 创建副本避免直接修改
326
+
327
+ _columns.forEach(function (v) {
328
+ var _columnsMap$v$key;
329
+ if (((_columnsMap$v$key = columnsMap[v.key]) === null || _columnsMap$v$key === void 0 ? void 0 : _columnsMap$v$key.width) !== v.width) {
255
330
  flag = true;
256
- columnsMap[v.key].width = v.width;
331
+ newColumnsMap[v.key] = _objectSpread(_objectSpread({}, newColumnsMap[v.key]), {}, {
332
+ width: v.width
333
+ });
257
334
  }
258
335
  });
259
336
  if (flag) {
260
- counter.setColumnsMap(columnsMap);
337
+ counter.setColumnsMap(newColumnsMap);
261
338
  }
262
- return result;
263
- }, [isDragRef, resizableColumns, showTable, columns, columnsMap]);
339
+ }, [_columns, columnsMap, counter, showTable]);
264
340
  var _components = useMemo(function () {
265
- if (isDragRef) {
266
- return resizeComponents;
267
- } else {
268
- return components;
269
- }
341
+ return mergeComponentsForResize(components, resizeComponents, isDragRef);
270
342
  }, [isDragRef, resizeComponents, components]);
271
343
 
272
344
  // 工具栏
@@ -279,7 +351,7 @@ function VtxTable(props) {
279
351
  hideColumnHeight: hideColumnHeight,
280
352
  hideColumnSetting: hideColumnSetting,
281
353
  onRefresh: onRefresh,
282
- columns: _columns,
354
+ columns: tableColumn,
283
355
  onColumnsSave: onColumnsSave,
284
356
  uniqueKey: uniqueKey,
285
357
  prefixUrl: prefixUrl,
@@ -288,20 +360,24 @@ function VtxTable(props) {
288
360
  }) : null;
289
361
  return wrapSSR( /*#__PURE__*/_jsxs("div", {
290
362
  id: datagridId,
291
- className: classnames(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-fit"), autoFit), "".concat(prefixCls, "-noFit"), !autoFit), "".concat(prefixCls, "-nodata"), !(dataSource !== null && dataSource !== void 0 && dataSource.length)), "".concat(prefixCls, "-userAgent-mac"), isMac), "".concat(prefixCls, "-striped"), tableStyles.includes('striped')), "".concat(prefixCls, "-no-border"), !tableStyles.includes('border')), "".concat(prefixCls, "-header-background"), tableStyles.includes('header-background')), hashId),
363
+ className: classnames(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-fit"), autoFit), "".concat(prefixCls, "-noFit"), !autoFit), "".concat(prefixCls, "-nodata"), !(dataSource !== null && dataSource !== void 0 && dataSource.length)), "".concat(prefixCls, "-userAgent-mac"), isMac), "".concat(prefixCls, "-striped"), tableStyles.includes('striped')), "".concat(prefixCls, "-no-border"), !tableStyles.includes('border')), "".concat(prefixCls, "-no-data"), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) === 0), "".concat(prefixCls, "-header-background"), tableStyles.includes('header-background')), "".concat(prefixCls, "-no-header-background"), !tableStyles.includes('header-background')), hashId),
292
364
  ref: rootDomRef,
293
365
  style: style,
294
366
  children: [toolbarRender, alertRender, /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
295
367
  size: counter.tableSize,
296
368
  bordered: true
369
+ // virtual
297
370
  }, rest), {}, {
298
371
  dataSource: dataSource,
299
372
  scroll: _objectSpread({
300
373
  x: 'max-content'
301
374
  }, scroll),
302
375
  pagination: getPagination(rest.pagination),
303
- style: {
304
- height: "calc(100% - ".concat(toolbarHeight.current + alertHeight.current, "px)")
376
+ xs: true,
377
+ styles: {
378
+ root: {
379
+ height: "calc(100% - ".concat(toolbarHeight.current + alertHeight.current, "px)")
380
+ }
305
381
  },
306
382
  locale: _objectSpread({
307
383
  emptyText: /*#__PURE__*/_jsx(Empty, {
@@ -310,6 +386,9 @@ function VtxTable(props) {
310
386
  }, rest.locale),
311
387
  components: _components,
312
388
  columns: _columns
389
+ // tableLayout={'auto'}
390
+ ,
391
+ tableLayout: "fixed"
313
392
  }))]
314
393
  }));
315
394
  }
@@ -0,0 +1,15 @@
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
+ 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ export function mergeComponentsForResize(components, resizeComponents, isDragRef) {
8
+ if (!isDragRef) {
9
+ return components;
10
+ }
11
+ return _objectSpread(_objectSpread(_objectSpread({}, resizeComponents || {}), components || {}), {}, {
12
+ header: _objectSpread(_objectSpread({}, (components === null || components === void 0 ? void 0 : components.header) || {}), (resizeComponents === null || resizeComponents === void 0 ? void 0 : resizeComponents.header) || {}),
13
+ body: _objectSpread(_objectSpread({}, (resizeComponents === null || resizeComponents === void 0 ? void 0 : resizeComponents.body) || {}), (components === null || components === void 0 ? void 0 : components.body) || {})
14
+ });
15
+ }
@@ -1,5 +1,12 @@
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 = ["confirm"];
2
+ var _excluded = ["confirm"],
3
+ _excluded2 = ["confirm"];
4
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
+ 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."); }
6
+ 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); }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
9
+ 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; }
3
10
  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
11
  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
12
  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,12 +14,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
14
  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
15
  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
16
  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
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
- 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."); }
12
- 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); }
13
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
14
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
15
- 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; }
16
17
  import { DownOutlined } from '@ant-design/icons';
17
18
  import { Divider, Dropdown, Popconfirm } from 'antd';
18
19
  import Icon from "../vtx-icon";
@@ -45,14 +46,32 @@ var renderColumnButtons = function renderColumnButtons(_ref) {
45
46
  /* eslint-disable */
46
47
  moreRender = /*#__PURE__*/_jsx(Dropdown, {
47
48
  menu: {
48
- items: (moreActions === null || moreActions === void 0 ? void 0 : moreActions.map(function (item, i) {
49
+ items: (moreActions === null || moreActions === void 0 ? void 0 : moreActions.map(function (item, index) {
50
+ var name = item.name,
51
+ popconfirm = item.popconfirm;
52
+ if (popconfirm) {
53
+ var confirm = popconfirm.confirm,
54
+ rest = _objectWithoutProperties(popconfirm, _excluded);
55
+ return {
56
+ key: index,
57
+ label: /*#__PURE__*/_jsx(Popconfirm, _objectSpread(_objectSpread({
58
+ trigger: ['hover'],
59
+ onConfirm: confirm ? function () {
60
+ return confirm(record, index);
61
+ } : undefined
62
+ }, rest), {}, {
63
+ children: name
64
+ }))
65
+ };
66
+ }
49
67
  return {
50
- key: i,
68
+ key: index,
51
69
  label: item.name
52
70
  };
53
71
  })) || [],
54
72
  onClick: function onClick(e) {
55
- moreActions[e.key].onClick(record, index);
73
+ var _moreActions$e$key, _moreActions$e$key$on;
74
+ (_moreActions$e$key = moreActions[e.key]) === null || _moreActions$e$key === void 0 || (_moreActions$e$key$on = _moreActions$e$key.onClick) === null || _moreActions$e$key$on === void 0 || _moreActions$e$key$on.call(_moreActions$e$key, record, index);
56
75
  }
57
76
  },
58
77
  children: /*#__PURE__*/_jsxs("a", {
@@ -82,7 +101,7 @@ var renderColumnButtons = function renderColumnButtons(_ref) {
82
101
  }, name);
83
102
  if (popconfirm) {
84
103
  var confirm = popconfirm.confirm,
85
- rest = _objectWithoutProperties(popconfirm, _excluded);
104
+ rest = _objectWithoutProperties(popconfirm, _excluded2);
86
105
  btnNode = /*#__PURE__*/_createElement(Popconfirm, _objectSpread(_objectSpread({}, rest), {}, {
87
106
  onConfirm: confirm ? function () {
88
107
  return confirm(record, index);
@@ -8,37 +8,85 @@ import { useStyle as useAntdStyle } from "../../vtx-provider";
8
8
  var genVtxStyle = function genVtxStyle(token) {
9
9
  var componentCls = token.componentCls,
10
10
  antCls = token.antCls;
11
- return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
11
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty({
12
12
  position: 'relative',
13
- overflow: 'hidden'
14
- }, "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty({}, '.ant-table', _defineProperty(_defineProperty(_defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
13
+ // overflow: 'hidden',
14
+ display: 'flex',
15
+ flexDirection: 'column'
16
+ }, "".concat(antCls, "-table-cell-ellipsis"), {
17
+ whiteSpace: "normal"
18
+ }), "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
19
+ // minWidth: "calc(100% - 2px) !important"
20
+ }), '.ant-spin', _defineProperty({
21
+ height: '100%'
22
+ }, '.ant-spin-container', _defineProperty({
23
+ height: '100%',
24
+ display: 'flex',
25
+ flexDirection: 'column'
26
+ }, '.ant-table', _defineProperty({
27
+ // height: '100%',
28
+ flex: 1
29
+ }, '.ant-table-container', _defineProperty(_defineProperty({
30
+ height: '100%',
31
+ borderInlineStart: "none"
32
+ }, '.ant-table-body', {
33
+ scrollbarWidth: "thin"
34
+ }), '.ant-table-content', _defineProperty({
35
+ height: '100%',
36
+ scrollbarWidth: "thin"
37
+ }, 'table', {
38
+ // height: '100%',
39
+ minWidth: "calc(100% - 1px) !important"
40
+ })))))), '.ant-table', _defineProperty(_defineProperty(_defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
15
41
  '>tr>th': {
16
- background: token.colorBgContainer
42
+ background: token.colorBgContainer,
43
+ '&:first-child': {
44
+ borderInlineStart: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
45
+ }
17
46
  }
18
47
  })), '.ant-table-cell', {
19
- minWidth: 20
20
- }), '.ant-table-body', _defineProperty({}, '.ant-table-tbody', {
48
+ // minWidth: 10,
49
+ }), '.ant-table-tbody', {
50
+ '>tr>td': {
51
+ '&:first-child': {
52
+ borderInlineStart: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
53
+ }
54
+ },
21
55
  '>tr.ant-table-placeholder': {
22
56
  position: 'absolute',
23
- top: '25%',
57
+ top: "auto",
58
+ bottom: "auto",
24
59
  right: 0,
25
60
  left: 0,
26
61
  backgroundColor: 'transparent',
27
62
  borderTop: 'none',
63
+ // borderInlineEnd: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
64
+ // borderBottom: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
28
65
  '>td.ant-table-cell': {
29
- display: 'flex',
30
- alignItems: 'center',
31
- justifyContent: 'center',
66
+ padding: 0,
32
67
  width: '100%',
33
68
  height: '100%',
34
- border: 'none'
69
+ border: 'none',
70
+ '>.ant-table-expanded-row-fixed': {
71
+ display: 'flex',
72
+ alignItems: 'center',
73
+ justifyContent: 'center',
74
+ height: '100%',
75
+ width: '100%',
76
+ '&::after': {
77
+ border: 'none'
78
+ }
79
+ }
35
80
  }
36
81
  }
37
- }))), '.ant-pagination', _defineProperty({}, '.ant-pagination-item', {
82
+ })), '.ant-pagination', _defineProperty({
83
+ margin: "var(--ant-margin) 0 0 0"
84
+ }, '.ant-pagination-item', {
38
85
  borderRadius: token.borderRadiusSM
39
- }))), "&-fit", {
40
- height: '100%'
41
- }), "&-noFit", {}), "&-no-border", _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({
86
+ })))), "".concat(componentCls, "-fit"), {
87
+ height: '100%',
88
+ minHeight: 200
89
+ }), "".concat(componentCls, "-noFit"), {}), "".concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({
42
90
  borderColor: 'transparent'
43
91
  }, '.ant-table-thead', {
44
92
  '>tr>th': {
@@ -47,10 +95,14 @@ var genVtxStyle = function genVtxStyle(token) {
47
95
  }), '.ant-table-body', {
48
96
  '>table >tbody>tr>td': {
49
97
  borderInlineColor: 'transparent !important'
98
+ },
99
+ '>table >tbody>tr.ant-table-placeholder': {
100
+ borderInlineColor: 'transparent !important',
101
+ borderBottomColor: 'transparent !important'
50
102
  }
51
- }))))), "&.vtx-datagrid-striped", _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty({}, '.ant-table-body', {
103
+ }))))), "".concat(componentCls, "-striped"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({}, '.ant-table-body', {
52
104
  '>table >tbody>tr:nth-child(odd)>td': {
53
- backgroundColor: token.colorBgLayout,
105
+ backgroundColor: token.colorBgLayoutTable,
54
106
  '&.ant-table-cell-row-hover': {
55
107
  backgroundColor: token.colorFillAlterSolid
56
108
  }
@@ -64,11 +116,41 @@ var genVtxStyle = function genVtxStyle(token) {
64
116
  backgroundColor: token.controlItemBgActiveHover
65
117
  }
66
118
  }
67
- }))))), "&.vtx-datagrid-header-background", _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
119
+ }), '.ant-table-tbody', {
120
+ '>tr:nth-child(odd)>td': {
121
+ backgroundColor: token.colorBgLayoutTable,
122
+ '&.ant-table-cell-row-hover': {
123
+ backgroundColor: token.colorFillAlterSolid
124
+ }
125
+ },
126
+ '>tr:nth-child(odd)>td.ant-table-column-sort': {
127
+ backgroundColor: token.colorFillAlterSolid
128
+ },
129
+ '>tr.ant-table-row-selected:nth-child(odd)>td': {
130
+ backgroundColor: token.controlItemBgActive,
131
+ '&.ant-table-cell-row-hover': {
132
+ backgroundColor: token.controlItemBgActiveHover
133
+ }
134
+ }
135
+ }))))), "".concat(componentCls, "-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
68
136
  '>tr>th': {
69
- background: token.colorBgLayout
137
+ background: token.colorBgLayoutTable
138
+ }
139
+ }))))), "".concat(componentCls, "-no-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper "), _defineProperty({}, '.ant-table-thead', {
140
+ '>tr>th': {
141
+ background: token.colorBgContainer
70
142
  }
71
- }))))));
143
+ }))), "".concat(componentCls, "-no-data"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
144
+ borderInlineStart: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
145
+ }, '.ant-table-content', _defineProperty({
146
+ borderRight: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
147
+ borderBottom: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)"
148
+ }, 'table', {})))))))), "".concat(componentCls, "-no-data").concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
149
+ borderInlineStart: "none"
150
+ }, '.ant-table-content', {
151
+ borderRight: "none",
152
+ borderBottom: "none"
153
+ })))))));
72
154
  };
73
155
  export function useStyle(prefix) {
74
156
  return useAntdStyle(prefix, function (token) {