@teamix/pro 1.5.17 → 1.5.18-beta.1

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 (261) hide show
  1. package/dist/fonts/txddinmedium.woff +0 -0
  2. package/dist/pro.all.min.css +1 -0
  3. package/dist/pro.css +1 -0
  4. package/dist/pro.js +114796 -0
  5. package/dist/pro.min.css +1 -0
  6. package/dist/pro.min.js +2 -0
  7. package/dist/pro.min.js.LICENSE.txt +47 -0
  8. package/dist/pro.xconsole.min.css +1 -0
  9. package/es/actions/dialog-component.js +1 -4
  10. package/es/actions/dialog-form.js +4 -3
  11. package/es/actions/dialog.js +2 -1
  12. package/es/actions/index.js +35 -22
  13. package/es/actions/quick.js +1 -4
  14. package/es/card/card-container.js +12 -5
  15. package/es/card/divider.js +2 -4
  16. package/es/card/index.js +18 -7
  17. package/es/card/selectable.js +2 -4
  18. package/es/card/tab.js +2 -4
  19. package/es/form/Components/Editable/index.js +1 -1
  20. package/es/form/Components/FormGroup/index.js +4 -3
  21. package/es/form/Components/LightFilter/index.js +11 -2
  22. package/es/form/Components/ProField/index.js +2 -4
  23. package/es/form/Components/Text/index.js +2 -4
  24. package/es/form/Filter/AdvancedFilter.js +16 -14
  25. package/es/form/Filter/LightFilter.js +13 -9
  26. package/es/form/Filter/SimpleFilter.js +8 -5
  27. package/es/form/Filter/index.js +24 -7
  28. package/es/form/Filter/index.scss +1 -0
  29. package/es/form/Filter/index2.js +22 -17
  30. package/es/form/Filter/index2.scss +1 -0
  31. package/es/form/Filter/useBindUrl.js +3 -0
  32. package/es/form/Filter/useSpecialProps.js +1 -0
  33. package/es/form/ProForm/index.js +5 -2
  34. package/es/form/ProForm/useAutoLayout.js +4 -0
  35. package/es/form/ProForm/useFormDisplayValues.js +1 -0
  36. package/es/form/SchemaForm/adapterComponent.js +1 -0
  37. package/es/form/SchemaForm/adapterDecorator.js +1 -0
  38. package/es/form/SchemaForm/adapterType.js +1 -0
  39. package/es/form/SchemaForm/index.js +13 -0
  40. package/es/form/SchemaForm/initializeFormButton.js +2 -0
  41. package/es/form/SchemaForm/initializeReactions.js +1 -0
  42. package/es/form/SchemaForm/initializeSelectTable.js +1 -0
  43. package/es/form/SchemaForm/reactions.js +5 -0
  44. package/es/form/index.js +4 -0
  45. package/es/form/utils.js +12 -0
  46. package/es/form/warning.js +2 -0
  47. package/es/index.js +3 -1
  48. package/es/info/components/InfoGroup/index.js +2 -4
  49. package/es/info/components/InfoValueItem/index.js +32 -20
  50. package/es/info/components/ProInfoItem/index.js +1 -0
  51. package/es/info/components/baseInfo/index.js +3 -0
  52. package/es/info/components/tableInfo/index.js +6 -4
  53. package/es/info/index.js +11 -5
  54. package/es/info/utils/index.js +3 -0
  55. package/es/layout/index.js +2 -0
  56. package/es/nocode/index.js +2 -0
  57. package/es/nocode/pages/index.js +3 -0
  58. package/es/nocode/pages/playground.js +3 -5
  59. package/es/nocode/pages/renderer.js +4 -6
  60. package/es/nocode/playground.js +2 -4
  61. package/es/page-header/index.js +12 -7
  62. package/es/sidebar/components/sidebar-container/index.js +10 -7
  63. package/es/sidebar/components/tree/index.js +22 -4
  64. package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +3 -4
  65. package/es/sidebar/components/tree-node/components/IconAction/index.js +4 -2
  66. package/es/sidebar/components/tree-node/components/IconSwitch/index.js +1 -0
  67. package/es/sidebar/components/tree-node/index.js +29 -16
  68. package/es/sidebar/index.js +15 -4
  69. package/es/sidebar/utils/index.js +19 -11
  70. package/es/table/components/CardView/index.js +29 -13
  71. package/es/table/components/Filter/index.js +11 -0
  72. package/es/table/components/Layout/index.js +13 -8
  73. package/es/table/components/LoadMore/index.js +3 -0
  74. package/es/table/components/Pagination/index.js +12 -10
  75. package/es/table/components/QuickAction/index.js +3 -2
  76. package/es/table/components/ToolBar/CardSwitch.js +2 -0
  77. package/es/table/components/ToolBar/DensityIcon.js +7 -2
  78. package/es/table/components/ToolBar/FilterColumnIcon.js +9 -0
  79. package/es/table/components/ToolBar/FullScreenIcon.js +1 -0
  80. package/es/table/components/ToolBar/Fullscreen.js +3 -0
  81. package/es/table/components/ToolBar/RefreshIcon.js +11 -0
  82. package/es/table/components/ToolBar/index.js +13 -10
  83. package/es/table/index.js +138 -51
  84. package/es/table/index.scss +26 -0
  85. package/es/table/utils/columnRender.js +81 -27
  86. package/es/table/utils/genAutoWidthColumns.js +347 -0
  87. package/es/table/utils/index.js +6 -0
  88. package/es/table/utils/pureColumnRender.js +9 -1
  89. package/es/templates/List/index.js +4 -6
  90. package/es/templates/index.js +2 -1
  91. package/es/timeline/ProTimeLineItem/index.js +8 -4
  92. package/es/timeline/index.js +5 -5
  93. package/es/utils/message.js +3 -5
  94. package/es/xconsole.scss +23 -0
  95. package/lib/form/Filter/index.scss +1 -0
  96. package/lib/form/Filter/index2.scss +1 -0
  97. package/lib/index.d.ts +1 -1
  98. package/lib/index.js +1 -1
  99. package/lib/table/components/CardView/index.js +5 -10
  100. package/lib/table/components/ToolBar/index.js +10 -7
  101. package/lib/table/index.js +71 -25
  102. package/lib/table/index.scss +26 -0
  103. package/lib/table/typing.d.ts +11 -1
  104. package/lib/table/utils/columnRender.d.ts +1 -0
  105. package/lib/table/utils/columnRender.js +49 -4
  106. package/lib/table/utils/genAutoWidthColumns.d.ts +30 -0
  107. package/lib/table/utils/genAutoWidthColumns.js +351 -0
  108. package/lib/xconsole.scss +23 -0
  109. package/package.json +1 -1
  110. package/es/actions/base.d.ts +0 -24
  111. package/es/actions/confirm.d.ts +0 -7
  112. package/es/actions/danger-confirm.d.ts +0 -7
  113. package/es/actions/danger-pop-confirm.d.ts +0 -5
  114. package/es/actions/dialog-component.d.ts +0 -10
  115. package/es/actions/dialog-form.d.ts +0 -29
  116. package/es/actions/dialog-info.d.ts +0 -9
  117. package/es/actions/dialog-table.d.ts +0 -9
  118. package/es/actions/dialog.d.ts +0 -40
  119. package/es/actions/drawer-form.d.ts +0 -6
  120. package/es/actions/drawer-info.d.ts +0 -6
  121. package/es/actions/drawer-table.d.ts +0 -6
  122. package/es/actions/drawer.d.ts +0 -6
  123. package/es/actions/error.d.ts +0 -7
  124. package/es/actions/index.d.ts +0 -114
  125. package/es/actions/link.d.ts +0 -8
  126. package/es/actions/notice.d.ts +0 -7
  127. package/es/actions/pop-confirm.d.ts +0 -9
  128. package/es/actions/quick.d.ts +0 -2
  129. package/es/actions/request.d.ts +0 -9
  130. package/es/actions/utils.d.ts +0 -1
  131. package/es/card/card-container.d.ts +0 -18
  132. package/es/card/divider.d.ts +0 -6
  133. package/es/card/index.d.ts +0 -109
  134. package/es/card/selectable.d.ts +0 -13
  135. package/es/card/tab.d.ts +0 -6
  136. package/es/card/utils.d.ts +0 -9
  137. package/es/field/index.d.ts +0 -3
  138. package/es/form/Components/Editable/index.d.ts +0 -20
  139. package/es/form/Components/FormGroup/index.d.ts +0 -14
  140. package/es/form/Components/LightFilter/componentMap.d.ts +0 -3
  141. package/es/form/Components/LightFilter/index.d.ts +0 -17
  142. package/es/form/Components/ProField/index.d.ts +0 -2
  143. package/es/form/Components/ProField/mapDateFormat.d.ts +0 -3
  144. package/es/form/Components/Text/index.d.ts +0 -8
  145. package/es/form/Filter/AdvancedFilter.d.ts +0 -7
  146. package/es/form/Filter/Layout.d.ts +0 -5
  147. package/es/form/Filter/LightFilter.d.ts +0 -7
  148. package/es/form/Filter/SimpleFilter.d.ts +0 -7
  149. package/es/form/Filter/index.d.ts +0 -9
  150. package/es/form/Filter/index2.d.ts +0 -13
  151. package/es/form/Filter/useBindUrl.d.ts +0 -2
  152. package/es/form/Filter/useSpecialProps.d.ts +0 -6
  153. package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
  154. package/es/form/ProForm/customComponent.d.ts +0 -3
  155. package/es/form/ProForm/index.d.ts +0 -5
  156. package/es/form/ProForm/useAutoLayout.d.ts +0 -9
  157. package/es/form/ProForm/useAutoSubmit.d.ts +0 -6
  158. package/es/form/ProForm/useFieldRequest.d.ts +0 -5
  159. package/es/form/ProForm/useFormDisplayValues.d.ts +0 -4
  160. package/es/form/ProForm/useInitialRequest.d.ts +0 -6
  161. package/es/form/SchemaForm/adapterComponent.d.ts +0 -5
  162. package/es/form/SchemaForm/adapterDecorator.d.ts +0 -6
  163. package/es/form/SchemaForm/adapterType.d.ts +0 -5
  164. package/es/form/SchemaForm/index.d.ts +0 -4
  165. package/es/form/SchemaForm/initializeArrayCards.d.ts +0 -3
  166. package/es/form/SchemaForm/initializeArrayCollapse.d.ts +0 -3
  167. package/es/form/SchemaForm/initializeArrayItems.d.ts +0 -3
  168. package/es/form/SchemaForm/initializeArrayTable.d.ts +0 -3
  169. package/es/form/SchemaForm/initializeDataSource.d.ts +0 -15
  170. package/es/form/SchemaForm/initializeFormButton.d.ts +0 -3
  171. package/es/form/SchemaForm/initializeFormCollapse.d.ts +0 -3
  172. package/es/form/SchemaForm/initializeFormGroup.d.ts +0 -3
  173. package/es/form/SchemaForm/initializeFormStep.d.ts +0 -5
  174. package/es/form/SchemaForm/initializeFormTab.d.ts +0 -3
  175. package/es/form/SchemaForm/initializeReactions.d.ts +0 -2
  176. package/es/form/SchemaForm/initializeRequest.d.ts +0 -11
  177. package/es/form/SchemaForm/initializeRules.d.ts +0 -11
  178. package/es/form/SchemaForm/initializeSelectTable.d.ts +0 -3
  179. package/es/form/SchemaForm/reactions.d.ts +0 -6
  180. package/es/form/docs/ActionResponse.d.ts +0 -8
  181. package/es/form/fieldTypeMap.d.ts +0 -7
  182. package/es/form/index.d.ts +0 -125
  183. package/es/form/locales/validate.d.ts +0 -159
  184. package/es/form/schemaNameMap.d.ts +0 -5
  185. package/es/form/typing.d.ts +0 -194
  186. package/es/form/utils.d.ts +0 -55
  187. package/es/form/warning.d.ts +0 -3
  188. package/es/hooks/index.d.ts +0 -2
  189. package/es/index-without-icon.d.ts +0 -32
  190. package/es/index.d.ts +0 -32
  191. package/es/info/components/InfoGroup/index.d.ts +0 -5
  192. package/es/info/components/InfoValueItem/index.d.ts +0 -5
  193. package/es/info/components/ProInfoItem/index.d.ts +0 -5
  194. package/es/info/components/baseInfo/index.d.ts +0 -8
  195. package/es/info/components/headerInfo/index.d.ts +0 -8
  196. package/es/info/components/tableInfo/index.d.ts +0 -7
  197. package/es/info/index.d.ts +0 -10
  198. package/es/info/typing.d.ts +0 -220
  199. package/es/info/utils/index.d.ts +0 -20
  200. package/es/info/utils/layout.d.ts +0 -2
  201. package/es/info/utils/utils.d.ts +0 -1
  202. package/es/layout/index.d.ts +0 -2
  203. package/es/nocode/configurators/Card.d.ts +0 -3
  204. package/es/nocode/configurators/PageHeader.d.ts +0 -3
  205. package/es/nocode/configurators/ProTable.d.ts +0 -3
  206. package/es/nocode/configurators/common.d.ts +0 -280
  207. package/es/nocode/configurators/index.d.ts +0 -15
  208. package/es/nocode/configurators/map.d.ts +0 -2
  209. package/es/nocode/index.d.ts +0 -8
  210. package/es/nocode/pages/editor.d.ts +0 -12
  211. package/es/nocode/pages/index.d.ts +0 -14
  212. package/es/nocode/pages/playground.d.ts +0 -11
  213. package/es/nocode/pages/renderer.d.ts +0 -10
  214. package/es/nocode/playground.d.ts +0 -14
  215. package/es/page-container/index.d.ts +0 -3
  216. package/es/page-header/index.d.ts +0 -74
  217. package/es/sidebar/components/sidebar-container/index.d.ts +0 -5
  218. package/es/sidebar/components/tree/index.d.ts +0 -6
  219. package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +0 -15
  220. package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +0 -12
  221. package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +0 -23
  222. package/es/sidebar/components/tree-node/index.d.ts +0 -7
  223. package/es/sidebar/index.d.ts +0 -9
  224. package/es/sidebar/typing.d.ts +0 -141
  225. package/es/sidebar/utils/action-ref.d.ts +0 -3
  226. package/es/sidebar/utils/index.d.ts +0 -364
  227. package/es/skeleton/index.d.ts +0 -3
  228. package/es/table/components/CardView/index.d.ts +0 -5
  229. package/es/table/components/EmptyContent/index.d.ts +0 -2
  230. package/es/table/components/Filter/index.d.ts +0 -12
  231. package/es/table/components/Layout/index.d.ts +0 -5
  232. package/es/table/components/LoadMore/index.d.ts +0 -20
  233. package/es/table/components/Pagination/index.d.ts +0 -7
  234. package/es/table/components/QuickAction/index.d.ts +0 -11
  235. package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
  236. package/es/table/components/ToolBar/DensityIcon.d.ts +0 -4
  237. package/es/table/components/ToolBar/FilterColumnIcon.d.ts +0 -4
  238. package/es/table/components/ToolBar/FullScreenIcon.d.ts +0 -4
  239. package/es/table/components/ToolBar/Fullscreen.d.ts +0 -10
  240. package/es/table/components/ToolBar/RefreshIcon.d.ts +0 -4
  241. package/es/table/components/ToolBar/index.d.ts +0 -5
  242. package/es/table/index.d.ts +0 -5
  243. package/es/table/typing.d.ts +0 -418
  244. package/es/table/utils/columnRender.d.ts +0 -13
  245. package/es/table/utils/genProColumnToColumn.d.ts +0 -13
  246. package/es/table/utils/getTableProps.d.ts +0 -2
  247. package/es/table/utils/getTableSortIcons.d.ts +0 -3
  248. package/es/table/utils/index.d.ts +0 -19
  249. package/es/table/utils/pureColumnRender.d.ts +0 -9
  250. package/es/table/utils/pureGenProColumnToColumn.d.ts +0 -7
  251. package/es/table/utils/useTableSelection.d.ts +0 -3
  252. package/es/table/utils/util.d.ts +0 -5
  253. package/es/templates/Detail/index.d.ts +0 -2
  254. package/es/templates/Form/index.d.ts +0 -2
  255. package/es/templates/List/index.d.ts +0 -9
  256. package/es/templates/index.d.ts +0 -3
  257. package/es/timeline/ProTimeLineItem/index.d.ts +0 -5
  258. package/es/timeline/index.d.ts +0 -10
  259. package/es/timeline/typing.d.ts +0 -107
  260. package/es/utils/index.d.ts +0 -3
  261. package/es/utils/message.d.ts +0 -3
@@ -8,6 +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(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
12
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
13
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
14
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -19,6 +20,7 @@ import { getTargetValue } from '@teamix/utils';
19
20
  import { ProActionGroup } from '../../actions';
20
21
  import ProField, { LabelIconTip } from '../../field';
21
22
  import Filter from '../components/Filter';
23
+ import { getProFieldWidth } from '@teamix/pro-field';
22
24
  /**
23
25
  * 增加了 icon 的功能 render title
24
26
  */
@@ -34,17 +36,18 @@ export var renderColumnsTitle = function renderColumnsTitle(item, actionRef, bin
34
36
  var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2;
35
37
  var selectedItem = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : _actionRef$current$ge2.call(_actionRef$current).filterRules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
36
38
  if (Object.keys(selectedItem).length > 0) {
37
- var _selectedItem$dataInd;
38
- if ((_selectedItem$dataInd = selectedItem[dataIndex]) === null || _selectedItem$dataInd === void 0 ? void 0 : _selectedItem$dataInd.params) {
39
- var _targetFilters$find;
39
+ var _selectedItem;
40
+ if ((_selectedItem = selectedItem[dataIndex]) === null || _selectedItem === void 0 ? void 0 : _selectedItem.params) {
41
+ var _ref, _targetFilters$find;
40
42
  // 找到对应的 label
41
- var targetFilters = filters !== null && filters !== void 0 ? filters : [];
43
+ var targetFilters = (_ref = filters) !== null && _ref !== void 0 ? _ref : [];
42
44
  if (filters === true) {
43
- targetFilters = dataSource !== null && dataSource !== void 0 ? dataSource : [];
45
+ var _ref2;
46
+ targetFilters = (_ref2 = dataSource) !== null && _ref2 !== void 0 ? _ref2 : [];
44
47
  }
45
48
  var label = (_targetFilters$find = targetFilters.find(function (item) {
46
- var _selectedItem$dataInd2;
47
- return item.value === ((_selectedItem$dataInd2 = selectedItem[dataIndex]) === null || _selectedItem$dataInd2 === void 0 ? void 0 : _selectedItem$dataInd2.params);
49
+ var _selectedItem2;
50
+ return item.value === ((_selectedItem2 = selectedItem[dataIndex]) === null || _selectedItem2 === void 0 ? void 0 : _selectedItem2.params);
48
51
  })) === null || _targetFilters$find === void 0 ? void 0 : _targetFilters$find.label;
49
52
  var value = "".concat(item.title, " (").concat(label, ")");
50
53
  return /*#__PURE__*/React.createElement(ProField, {
@@ -84,13 +87,11 @@ export var renderColumnsTitle = function renderColumnsTitle(item, actionRef, bin
84
87
  bindUrlProps: bindUrlProps
85
88
  }));
86
89
  };
90
+
87
91
  /**
88
92
  * 负责单元格的具体渲染
89
93
  */
90
- export var renderCell = function renderCell(value, item, index, record, actionRef, /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
91
- context,
92
- // 用于埋点
93
- dataTeamixSpm) {
94
+ export var renderCell = function renderCell(value, item, index, record, actionRef, context, dataTeamixSpm) {
94
95
  var _actionSchema$actions;
95
96
  var _item$valueType = item.valueType,
96
97
  valueType = _item$valueType === void 0 ? 'text' : _item$valueType,
@@ -98,10 +99,12 @@ dataTeamixSpm) {
98
99
  actionSchema = item.actionSchema,
99
100
  dataIndex = item.dataIndex,
100
101
  format = item.format;
102
+
101
103
  // 如果没传 dataIndex,返回 null
102
104
  if (!dataIndex) {
103
105
  value = null;
104
106
  }
107
+
105
108
  // 处理 dataIndex 为数组的情况
106
109
  if (Array.isArray(dataIndex)) {
107
110
  value = dataIndex.map(function (item) {
@@ -142,6 +145,7 @@ dataTeamixSpm) {
142
145
  });
143
146
  }
144
147
  }
148
+
145
149
  // 渲染操作组
146
150
  if (actionSchema && ((_actionSchema$actions = actionSchema.actions) === null || _actionSchema$actions === void 0 ? void 0 : _actionSchema$actions.length)) {
147
151
  // 默认 context
@@ -151,13 +155,14 @@ dataTeamixSpm) {
151
155
  record: record,
152
156
  action: actionRef.current
153
157
  }, context);
154
- return /*#__PURE__*/React.createElement(ProActionGroup, _objectSpread(_objectSpread({
158
+ return /*#__PURE__*/React.createElement(ProActionGroup, _extends({
155
159
  type: "text"
156
- }, actionSchema), {}, {
160
+ }, actionSchema, {
157
161
  context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context),
158
162
  "data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-columnAction") : undefined
159
163
  }));
160
164
  }
165
+
161
166
  // dataSource可传函数
162
167
  if (typeof item.dataSource === 'function') {
163
168
  var _item$dataSource;
@@ -165,10 +170,10 @@ dataTeamixSpm) {
165
170
  } else {
166
171
  var _item$dataSource2;
167
172
  newDataSource = ((_item$dataSource2 = item.dataSource) !== null && _item$dataSource2 !== void 0 ? _item$dataSource2 : []).map(function (item) {
168
- return Object.fromEntries(Object.entries(item).map(function (_ref) {
169
- var _ref2 = _slicedToArray(_ref, 2),
170
- k = _ref2[0],
171
- v = _ref2[1];
173
+ return Object.fromEntries(Object.entries(item).map(function (_ref3) {
174
+ var _ref4 = _slicedToArray(_ref3, 2),
175
+ k = _ref4[0],
176
+ v = _ref4[1];
172
177
  return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
173
178
  record: record,
174
179
  value: value,
@@ -177,15 +182,63 @@ dataTeamixSpm) {
177
182
  }));
178
183
  });
179
184
  }
185
+
180
186
  // 渲染 ProField
181
- return /*#__PURE__*/React.createElement(ProField, _objectSpread({
187
+ return /*#__PURE__*/React.createElement(ProField
188
+ // style={{width: `${width}px`}}
189
+ , _extends({
182
190
  type: valueType || 'text',
183
191
  value: value,
184
192
  render: newRender,
185
193
  dataSource: newDataSource,
186
- format: format
194
+ format: format,
195
+ proFieldWidthType: valueType
187
196
  }, props));
188
197
  };
198
+ export var renderCellSmartWidth = function renderCellSmartWidth(value, item, index, record
199
+ // actionRef: React.MutableRefObject<ProTableActionType | undefined>,
200
+ /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
201
+ // context?: any,
202
+ ) {
203
+ var _item$valueType2 = item.valueType,
204
+ valueType = _item$valueType2 === void 0 ? 'text' : _item$valueType2,
205
+ render = item.render;
206
+ var newRender = null;
207
+ var newDataSource = null;
208
+ var props = item.props;
209
+ // 如果 render 直接传函数
210
+ if (typeof render === 'function') {
211
+ newRender = function newRender() {
212
+ return render === null || render === void 0 ? void 0 : render(value, index, record);
213
+ };
214
+ } else {
215
+ newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
216
+ if (valueType === 'selectGroup') {
217
+ newRender = _objectSpread(_objectSpread({
218
+ maxShowNumber: 'auto',
219
+ foldText: 'more',
220
+ editOnClick: function editOnClick() {},
221
+ edit: true
222
+ }, newRender), {}, {
223
+ ellipsis: false
224
+ });
225
+ props = _objectSpread({
226
+ valueAlias: {
227
+ value: 'TagValue',
228
+ key: 'TagKey'
229
+ }
230
+ }, props);
231
+ }
232
+ if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
233
+ newRender = _objectSpread(_objectSpread({}, newRender), {}, {
234
+ ellipsis: false
235
+ });
236
+ }
237
+ }
238
+ return getProFieldWidth(valueType, newRender);
239
+ // return getProFieldWidthBox(valueType, newRender)?.minWidth || undefined
240
+ };
241
+
189
242
  /**
190
243
  * 处理 render 配置项是函数的情况
191
244
  * @param render ProFieldRender
@@ -201,10 +254,10 @@ var processRenderFunction = function processRenderFunction() {
201
254
  var record = arguments.length > 3 ? arguments[3] : undefined;
202
255
  // 当 ProField render 类型为 function 时。需要表格预先处理以塞入 record
203
256
  var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
204
- return Object.fromEntries(Object.entries(render).map(function (_ref3) {
205
- var _ref4 = _slicedToArray(_ref3, 2),
206
- k = _ref4[0],
207
- v = _ref4[1];
257
+ return Object.fromEntries(Object.entries(render).map(function (_ref5) {
258
+ var _ref6 = _slicedToArray(_ref5, 2),
259
+ k = _ref6[0],
260
+ v = _ref6[1];
208
261
  if (typeof v === 'function') {
209
262
  var _v;
210
263
  if (external.includes(k)) {
@@ -220,6 +273,7 @@ var processRenderFunction = function processRenderFunction() {
220
273
  return [k, v];
221
274
  }));
222
275
  };
276
+
223
277
  /**
224
278
  * 处理 render 数据,取出 {{xxx}} 匹配值
225
279
  * @param render ProFieldRender
@@ -234,10 +288,10 @@ var processBuriedPoint = function processBuriedPoint() {
234
288
  return Object.fromEntries([
235
289
  // 默认 ellipsis、descriptionEllipsis 为 true
236
290
  // emptyText 默认为 '-'
237
- ['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref5) {
238
- var _ref6 = _slicedToArray(_ref5, 2),
239
- k = _ref6[0],
240
- v = _ref6[1];
291
+ ['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref7) {
292
+ var _ref8 = _slicedToArray(_ref7, 2),
293
+ k = _ref8[0],
294
+ v = _ref8[1];
241
295
  return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
242
296
  record: record,
243
297
  value: value,
@@ -0,0 +1,347 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ import React, { useRef } from 'react';
12
+ import { getTargetValue } from '@teamix/utils';
13
+ import { renderCell } from './pureColumnRender';
14
+ import { renderColumnsTitle } from './columnRender';
15
+ import { ProActionGroup } from '../../actions';
16
+ import { getProFieldWidth } from '@teamix/pro-field';
17
+ import { renderCellSmartWidth } from './columnRender';
18
+
19
+ // 最大宽度
20
+ var maxColumnWidth = 600;
21
+ // 最小宽度
22
+ var minColumnWidth = 48;
23
+ // 每个列可以缩减的最大宽度
24
+ var columnShrinkMaxWidth = 100;
25
+
26
+ /**
27
+ * @param fileteredColumns
28
+ * @param ref
29
+ * @param data
30
+ * @returns
31
+ */
32
+ export function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSelection, actionColumnRef) {
33
+ if (!ref.current) {
34
+ return fileteredColumns;
35
+ }
36
+ var hasLockFlag = false;
37
+ var dom = ref.current;
38
+ var actionColumnDom = actionColumnRef === null || actionColumnRef === void 0 ? void 0 : actionColumnRef.current;
39
+ var childNodes = dom.children;
40
+ var finalColumns = [];
41
+ fileteredColumns.forEach(function (column, index) {
42
+ var render = column.render,
43
+ _column$valueType = column.valueType,
44
+ valueType = _column$valueType === void 0 ? 'text' : _column$valueType,
45
+ _column$autoWidth = column.autoWidth,
46
+ autoWidth = _column$autoWidth === void 0 ? true : _column$autoWidth,
47
+ actionSchema = column.actionSchema,
48
+ sortable = column.sortable,
49
+ lock = column.lock;
50
+ if (lock) {
51
+ hasLockFlag = true;
52
+ }
53
+ //@ts-ignore
54
+ var type = render === null || render === void 0 ? void 0 : render.type;
55
+ var finalType = type || valueType || '';
56
+ var shrink = fieldTypeShrink[finalType];
57
+ column.shrink = column.shrink || (shrink !== undefined ? shrink : 1);
58
+ //@ts-ignore
59
+ // if (!autoWidth) {
60
+ // finalColumns.push(column);
61
+ // return;
62
+ // }
63
+ if (actionSchema) {
64
+ // TODO 操作列暂时未处理,但是应该根据actionSchema的数量直接推测出操作列的宽度
65
+ // console.log('column', column);
66
+ column.shrink = 0;
67
+ // column.width = 280;
68
+ // console.log(
69
+ // 'actionColumnDom',
70
+ // actionColumnDom?.childNodes[0].scrollWidth,
71
+ // );
72
+ if (actionColumnDom === null || actionColumnDom === void 0 ? void 0 : actionColumnDom.childNodes[0]) {
73
+ //@ts-ignore
74
+ var width = actionColumnDom === null || actionColumnDom === void 0 ? void 0 : actionColumnDom.childNodes[0].scrollWidth;
75
+ if (width >= 280) {
76
+ width = 280;
77
+ }
78
+ console.log('actionWidth', width);
79
+ column.width = defaultPaddingFixer(width, size, false);
80
+ }
81
+ finalColumns.push(column);
82
+ return;
83
+ }
84
+ // @ts-ignore
85
+ var titleWidth = childNodes[index].children[0].scrollWidth;
86
+ // @ts-ignore
87
+ if (fixedWidthTypeList[finalType]) {
88
+ // console.log(
89
+ // 'fixedWidthTypeList[finalType]',
90
+ // fixedWidthTypeList[finalType],
91
+ // );
92
+ // 固定宽度
93
+ column.width = defaultPaddingFixer(
94
+ // @ts-ignore
95
+ Math.max(titleWidth, fixedWidthTypeList[finalType]), size, index === 0 && useRowSelection);
96
+ // @ts-ignore
97
+ } else if (computeableWidthTypeList[finalType]) {
98
+ // 可计算宽度
99
+ column.width = defaultPaddingFixer(
100
+ // @ts-ignore
101
+ Math.max(titleWidth, computeableWidthTypeList[finalType](data, render)), size, index === 0 && useRowSelection);
102
+ } else {
103
+ // 直接根据 dom 计算
104
+ column.width = defaultPaddingFixer(Math.max(titleWidth,
105
+ // @ts-ignore
106
+ calcWidthWithParentDOM(childNodes[index], column.shrink)), size, index === 0 && useRowSelection);
107
+ }
108
+ if (index === 0) {
109
+ // 首列不会被挤占
110
+ column.shrink = 0;
111
+ }
112
+ finalColumns.push(column);
113
+ });
114
+ if (!hasLockFlag) {
115
+ // 如果没有锁列的情况,需要将所有列放到一屏内,此时需要将所有列放到一起计算一次
116
+ var containerWidth = dom.offsetWidth;
117
+ var comboColumns = calcMultiColumnLength(finalColumns, useRowSelection ? containerWidth - 50 : containerWidth);
118
+ return comboColumns;
119
+ }
120
+ console.log('[ finalColumns ] >', finalColumns);
121
+ return finalColumns;
122
+ }
123
+ export var shadowContainer = function shadowContainer(props) {
124
+ var ref = useRef();
125
+ var columns = props.columns,
126
+ data = props.data,
127
+ shadowContainerRef = props.shadowContainerRef;
128
+ return /*#__PURE__*/React.createElement("div", {
129
+ ref: shadowContainerRef,
130
+ className: "teamix-pro-table-shadow-container"
131
+ }, columns.map(function (column, index) {
132
+ var dataIndex = column.dataIndex,
133
+ valueType = column.valueType;
134
+ if (!(column === null || column === void 0 ? void 0 : column.actionSchema)) {
135
+ return /*#__PURE__*/React.createElement("div", {
136
+ className: "teamix-pro-table-shadow-container-columns",
137
+ key: index
138
+ }, /*#__PURE__*/React.createElement("div", null, renderColumnsTitle(column, ref)),
139
+ //@ts-ignore
140
+ !computeableWidthTypeList[valueType] &&
141
+ //@ts-ignore
142
+ !fixedWidthTypeList[valueType] && data.map(function (item, index) {
143
+ // @ts-ignore
144
+ column.smartWidth = renderCellSmartWidth(getValueFromRecord(dataIndex, item), column, index, item);
145
+ return renderCell(getValueFromRecord(dataIndex, item), column, index, item);
146
+ }));
147
+ }
148
+ }));
149
+ };
150
+ export var shadowActionColumnContainer = function shadowActionColumnContainer(columns, shadowActionColumnContainerRef) {
151
+ var actionColumn = columns.find(function (column) {
152
+ return column === null || column === void 0 ? void 0 : column.actionSchema;
153
+ });
154
+ if (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionSchema) {
155
+ return /*#__PURE__*/React.createElement("div", {
156
+ ref: shadowActionColumnContainerRef,
157
+ className: "teamix-pro-table-action-column-shadow-container"
158
+ }, /*#__PURE__*/React.createElement(ProActionGroup, _extends({
159
+ type: "text"
160
+ }, actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionSchema, {
161
+ context: _objectSpread({}, actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionSchema.context)
162
+ })));
163
+ }
164
+ };
165
+
166
+ // 计算操作列的宽度
167
+
168
+ function getValueFromRecord(dataIndex, record) {
169
+ if (!dataIndex) {
170
+ return null;
171
+ }
172
+ if (Array.isArray(dataIndex)) {
173
+ var value = dataIndex.map(function (item) {
174
+ return getTargetValue("{{".concat(item, "}}"), _objectSpread(_objectSpread({}, record), {}, {
175
+ record: record
176
+ }));
177
+ });
178
+ return value;
179
+ } else {
180
+ var result = record;
181
+ var array = dataIndex.split('.');
182
+ array.forEach(function (item) {
183
+ return result = result ? result[item] : undefined;
184
+ });
185
+ return result;
186
+ }
187
+ }
188
+
189
+ // TODO 某些可以直接算出结果的 profield 类型白名单,待补充,每个类型下支持一个函数,用当前值和渲染类型算出一个结果
190
+ export var computeableWidthTypeList = {
191
+ dateTime: function dateTime(data, render) {
192
+ var result = getProFieldWidth('dateTime', render);
193
+ // @ts-ignore
194
+ return (result === null || result === void 0 ? void 0 : result.minWidth) || 0;
195
+ }
196
+ };
197
+
198
+ // TODO 某些固定宽度的 profield 类型白名单,这里的数据可能需要综合考虑 dataFold 和 render.rows
199
+ export var fixedWidthTypeList = {
200
+ // 时间日期
201
+ // dateTime: 142,
202
+ // dateMonth: 74, // 60
203
+ // dateWeek: 74,
204
+ // date: 100,
205
+ // dateYear: 46,
206
+ // dateQuarter: 64,
207
+ // dateRange: 212,
208
+ dateWeekRange: 156,
209
+ dateMonthRange: 156,
210
+ dateYearRange: 102,
211
+ dateQuarterRange: 136,
212
+ dateTimeRange: 326,
213
+ time: 38,
214
+ timeRange: 124
215
+ };
216
+
217
+ // TODO 不同类型的 profield 的 shrink,0表示不可以省略号,数字越大越容易被挤占空间
218
+ export var fieldTypeShrink = {
219
+ tag: 0,
220
+ statusTag: 0,
221
+ statusIconTag: 0,
222
+ circle: 0,
223
+ rank: 0,
224
+ progress: 0,
225
+ money: 0,
226
+ number: 0,
227
+ percent: 0,
228
+ dateTime: 0,
229
+ ip: 0
230
+ };
231
+ function calcWidthWithParentDOM(dom, shrink) {
232
+ var childNodes = _toConsumableArray(dom.children);
233
+ childNodes.shift();
234
+ return calcSingleColumnLength(childNodes.map(function (node) {
235
+ return node.scrollWidth;
236
+ }), shrink);
237
+ }
238
+ function calcSingleColumnLength() {
239
+ var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
240
+ var shrink = arguments.length > 1 ? arguments[1] : undefined;
241
+ if (shrink === 0) {
242
+ return Math.ceil(Math.max.apply(null, list));
243
+ }
244
+ return getConfidence90UpperBound(list);
245
+ }
246
+
247
+ /**
248
+ * 根据所有列的宽度和权重,结合总宽度,计算出各个列合适的宽度
249
+ * 目前算法:
250
+ * 当前需要的总宽度-总宽度=需要降低的宽度
251
+ * 从后往前,将shrink不为0的列,降低一些宽度到最小宽度
252
+ * 最小宽度可以用百分比去算
253
+ * TODO 当前shrink只用了0,其他的权重也要考虑一下
254
+ * @param list
255
+ * @param max
256
+ * @returns
257
+ */
258
+ function calcMultiColumnLength() {
259
+ var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
260
+ var max = arguments.length > 1 ? arguments[1] : undefined;
261
+ var result = _toConsumableArray(list);
262
+ var targetList = [];
263
+ var needWidth = 0;
264
+ var canShrink = 0;
265
+ list.forEach(function (item) {
266
+ //@ts-ignore
267
+ needWidth += item.width;
268
+ console.log('item.width', item.width);
269
+ if (item.shrink !== 0) {
270
+ targetList.push(item);
271
+ //@ts-ignore
272
+ canShrink += Math.min(item.width - minColumnWidth, columnShrinkMaxWidth);
273
+ }
274
+ });
275
+ console.log('needWidth', needWidth);
276
+ console.log('max', max);
277
+ var widthToBeRemoved = needWidth - max;
278
+ if (widthToBeRemoved <= 0) {
279
+ return list;
280
+ }
281
+ console.log('canShrink', canShrink);
282
+ console.log('widthToBeRemoved', widthToBeRemoved);
283
+ // TODO 超过的特别多直接加锁列,这个逻辑怎么设计
284
+ // 目前用可以缩小的宽度加起来比较一下
285
+ if (canShrink < widthToBeRemoved) {
286
+ console.log('canShrink', canShrink);
287
+ console.log('widthToBeRemoved', widthToBeRemoved);
288
+ list[0].lock = 'left';
289
+ if (list[list.length - 1].actionSchema) {
290
+ list[list.length - 1].lock = 'right';
291
+ }
292
+ return list;
293
+ }
294
+ //@ts-ignore
295
+ var sortedList = targetList.sort(function (a, b) {
296
+ return a.width - b.width;
297
+ });
298
+ var shrinkedWidth = 0;
299
+ for (var i = sortedList.length - 1; i >= 0; i--) {
300
+ if (shrinkedWidth >= widthToBeRemoved) {
301
+ break;
302
+ }
303
+ var singleShrinkedWidth = Math.min(sortedList[i].width - minColumnWidth, columnShrinkMaxWidth, widthToBeRemoved - shrinkedWidth);
304
+ sortedList[i].width = sortedList[i].width - singleShrinkedWidth;
305
+ shrinkedWidth += singleShrinkedWidth;
306
+ }
307
+ return result;
308
+ }
309
+
310
+ /**
311
+ * 修正内容放在table中默认的padding
312
+ * @param width
313
+ * @returns
314
+ */
315
+ function defaultPaddingFixer(width) {
316
+ var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'medium';
317
+ var half = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
318
+ return size === 'medium' ? width + (half ? 16 : 32) + 0.5 : width + (half ? 8 : 16) + 0.5;
319
+ }
320
+ function sum() {
321
+ var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
322
+ return list.reduce(function (a, b) {
323
+ return a + b;
324
+ });
325
+ }
326
+
327
+ /**
328
+ * 假设样本正态分布,取 90% 置信区间的上界
329
+ * 当上界与最大值差距不大(目前是20)的时候,直接用最大值
330
+ * TODO 这里没考虑是否可以直接用标准差做评判依据,如标准差过大时,直接排序并展示前90%,或标准差很小时直接用最大值
331
+ * TODO 这里极限情况是不是会挂? 如:长度为9个100和2个10000,估计会挂,是否置信区间这个不靠谱。。。最差情况就直接展示90%的数据算了
332
+ */
333
+ function getConfidence90UpperBound() {
334
+ var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
335
+ var max = Math.max.apply(null, list);
336
+ var length = list.length;
337
+ var mean = sum(list) / length;
338
+ var std = Math.sqrt(sum(list.map(function (n) {
339
+ return (n - mean) * (n - mean);
340
+ })) / length);
341
+ var interval = length > 30 ? 1.65 * std / Math.sqrt(length) : 2.2622 * std / Math.sqrt(length);
342
+ var bound = Math.ceil(mean + interval);
343
+ if (max - bound < 20) {
344
+ return Math.min(max, maxColumnWidth);
345
+ }
346
+ return Math.min(bound, maxColumnWidth);
347
+ }
@@ -10,6 +10,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
10
  import cloneDeepLodash from 'lodash.clonedeep';
11
11
  // 所有 ProTable 组件公用一套组件内事件转发机制
12
12
  var tableCallback = {};
13
+
13
14
  // 组件内对全局状态的更改
14
15
  var getMutations = function getMutations(actionRef) {
15
16
  var _actionRef$current2, _actionRef$current2$g, _actionRef$current2$g2;
@@ -50,6 +51,7 @@ var getMutations = function getMutations(actionRef) {
50
51
  }
51
52
  };
52
53
  };
54
+
53
55
  // 调用绑定的监听函数
54
56
  export function actionRefUseStateOn(callback, state) {
55
57
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
@@ -66,16 +68,19 @@ export function actionRefUseStateOn(callback, state) {
66
68
  });
67
69
  }
68
70
  }
71
+
69
72
  /** table 组件内监听 不对外暴露 */
70
73
  export function on(fun, key) {
71
74
  tableCallback[key] = fun;
72
75
  }
76
+
73
77
  /** table 组件内销毁监听 不对外暴露 */
74
78
  export function off(key) {
75
79
  if (tableCallback[key]) {
76
80
  delete tableCallback[key];
77
81
  }
78
82
  }
83
+
79
84
  /** table 组件内触发事件 不对外暴露 */
80
85
  export function emit(key) {
81
86
  var fun = tableCallback[key];
@@ -96,6 +101,7 @@ export function useActionType(ref, action) {
96
101
  export function cloneDeep(obj) {
97
102
  return cloneDeepLodash(obj);
98
103
  }
104
+
99
105
  /**
100
106
  * 处理默认过滤参数
101
107
  * @param columns
@@ -2,6 +2,7 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
2
2
  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."); }
3
3
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
4
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
6
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
7
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
8
  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); }
@@ -27,6 +28,7 @@ export var renderColumnsTitle = function renderColumnsTitle(item) {
27
28
  icon: item.tooltipIcon
28
29
  }));
29
30
  };
31
+
30
32
  /**
31
33
  * 负责单元格的具体渲染
32
34
  */
@@ -36,10 +38,12 @@ export var renderCell = function renderCell(value, item, index, record) {
36
38
  render = item.render,
37
39
  dataIndex = item.dataIndex,
38
40
  format = item.format;
41
+
39
42
  // 如果没传 dataIndex,返回 null
40
43
  if (!dataIndex) {
41
44
  value = null;
42
45
  }
46
+
43
47
  // 处理 dataIndex 为数组的情况
44
48
  if (Array.isArray(dataIndex)) {
45
49
  value = dataIndex.map(function (item) {
@@ -80,6 +84,7 @@ export var renderCell = function renderCell(value, item, index, record) {
80
84
  });
81
85
  }
82
86
  }
87
+
83
88
  // dataSource可传函数
84
89
  if (typeof item.dataSource === 'function') {
85
90
  var _item$dataSource;
@@ -99,8 +104,9 @@ export var renderCell = function renderCell(value, item, index, record) {
99
104
  }));
100
105
  });
101
106
  }
107
+
102
108
  // 渲染 ProField
103
- return /*#__PURE__*/React.createElement(ProField, _objectSpread({
109
+ return /*#__PURE__*/React.createElement(ProField, _extends({
104
110
  type: valueType || 'text',
105
111
  value: value,
106
112
  render: newRender,
@@ -108,6 +114,7 @@ export var renderCell = function renderCell(value, item, index, record) {
108
114
  format: format
109
115
  }, props));
110
116
  };
117
+
111
118
  /**
112
119
  * 处理 render 配置项是函数的情况
113
120
  * @param render ProFieldRender
@@ -142,6 +149,7 @@ var processRenderFunction = function processRenderFunction() {
142
149
  return [k, v];
143
150
  }));
144
151
  };
152
+
145
153
  /**
146
154
  * 处理 render 数据,取出 {{xxx}} 匹配值
147
155
  * @param render ProFieldRender