@teamix/pro 1.5.3 → 1.5.4-beta.0

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 (291) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +20239 -19807
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/dist/pro.min.js.LICENSE.txt +2 -6
  6. package/es/actions/base.js +8 -21
  7. package/es/actions/dialog-component.js +2 -9
  8. package/es/actions/dialog-form.js +37 -75
  9. package/es/actions/dialog-info.js +1 -5
  10. package/es/actions/dialog.js +57 -95
  11. package/es/actions/index.d.ts +2 -0
  12. package/es/actions/index.js +70 -156
  13. package/es/actions/link.js +3 -5
  14. package/es/actions/quick.js +0 -6
  15. package/es/actions/request.js +12 -27
  16. package/es/actions/utils.js +1 -9
  17. package/es/card/card-container.js +0 -5
  18. package/es/card/divider.js +0 -5
  19. package/es/card/index.js +56 -95
  20. package/es/card/selectable.js +4 -13
  21. package/es/card/tab.js +1 -10
  22. package/es/card/utils.js +0 -2
  23. package/es/form/Components/Editable/index.js +16 -55
  24. package/es/form/Components/FormGroup/index.d.ts +1 -0
  25. package/es/form/Components/FormGroup/index.js +7 -22
  26. package/es/form/Components/LightFilter/index.js +15 -35
  27. package/es/form/Components/ProField/index.js +2 -14
  28. package/es/form/Components/ProField/mapDateFormat.js +2 -28
  29. package/es/form/Components/Text/index.d.ts +1 -0
  30. package/es/form/Components/Text/index.js +2 -11
  31. package/es/form/Filter/AdvancedFilter.js +11 -26
  32. package/es/form/Filter/Layout.js +11 -24
  33. package/es/form/Filter/LightFilter.js +13 -24
  34. package/es/form/Filter/SimpleFilter.js +7 -21
  35. package/es/form/Filter/index.js +106 -171
  36. package/es/form/Filter/index2.js +11 -28
  37. package/es/form/Filter/useBindUrl.js +18 -46
  38. package/es/form/Filter/useSpecialProps.js +8 -13
  39. package/es/form/ProForm/addCascadeEffect.js +10 -32
  40. package/es/form/ProForm/customComponent.js +0 -5
  41. package/es/form/ProForm/index.js +23 -34
  42. package/es/form/ProForm/useAutoLayout.js +21 -42
  43. package/es/form/ProForm/useAutoSubmit.js +3 -8
  44. package/es/form/ProForm/useFieldRequest.js +0 -5
  45. package/es/form/ProForm/useFormDisplayValues.js +12 -28
  46. package/es/form/ProForm/useInitialRequest.js +0 -5
  47. package/es/form/SchemaForm/adapterComponent.js +0 -3
  48. package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
  49. package/es/form/SchemaForm/adapterDecorator.js +0 -8
  50. package/es/form/SchemaForm/adapterType.js +0 -2
  51. package/es/form/SchemaForm/index.js +78 -114
  52. package/es/form/SchemaForm/initializeArrayCards.js +0 -6
  53. package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
  54. package/es/form/SchemaForm/initializeArrayItems.js +2 -9
  55. package/es/form/SchemaForm/initializeArrayTable.js +21 -34
  56. package/es/form/SchemaForm/initializeDataSource.js +2 -6
  57. package/es/form/SchemaForm/initializeFormButton.js +14 -31
  58. package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
  59. package/es/form/SchemaForm/initializeFormGroup.js +10 -20
  60. package/es/form/SchemaForm/initializeFormStep.js +11 -23
  61. package/es/form/SchemaForm/initializeFormTab.js +10 -20
  62. package/es/form/SchemaForm/initializeReactions.js +9 -33
  63. package/es/form/SchemaForm/initializeRequest.js +2 -16
  64. package/es/form/SchemaForm/initializeRules.js +4 -22
  65. package/es/form/SchemaForm/initializeSelectTable.js +7 -33
  66. package/es/form/SchemaForm/reactions.js +19 -34
  67. package/es/form/docs/ActionResponse.d.ts +1 -0
  68. package/es/form/index.d.ts +9 -9
  69. package/es/form/index.js +0 -9
  70. package/es/form/typing.d.ts +6 -4
  71. package/es/form/utils.d.ts +1 -1
  72. package/es/form/utils.js +4 -49
  73. package/es/form/warning.js +2 -7
  74. package/es/index-without-icon.js +4 -3
  75. package/es/index.d.ts +1 -1
  76. package/es/index.js +7 -8
  77. package/es/info/components/InfoGroup/index.js +21 -32
  78. package/es/info/components/InfoValueItem/index.js +66 -119
  79. package/es/info/components/ProInfoItem/index.js +13 -21
  80. package/es/info/components/baseInfo/index.js +14 -26
  81. package/es/info/components/headerInfo/index.js +8 -20
  82. package/es/info/components/tableInfo/index.js +20 -50
  83. package/es/info/index.js +53 -82
  84. package/es/info/utils/index.js +0 -11
  85. package/es/nocode/configurators/common.js +5 -6
  86. package/es/nocode/configurators/index.js +2 -3
  87. package/es/nocode/index.js +6 -6
  88. package/es/nocode/pages/editor.js +5 -9
  89. package/es/nocode/pages/index.js +4 -4
  90. package/es/nocode/pages/playground.js +18 -35
  91. package/es/nocode/pages/renderer.js +9 -42
  92. package/es/nocode/playground.js +10 -23
  93. package/es/page-header/index.d.ts +2 -2
  94. package/es/page-header/index.js +39 -75
  95. package/es/sidebar/components/sidebar-container/index.js +41 -72
  96. package/es/sidebar/components/tree/index.js +88 -144
  97. package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
  98. package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
  99. package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
  100. package/es/sidebar/components/tree-node/index.js +41 -83
  101. package/es/sidebar/index.js +69 -94
  102. package/es/sidebar/utils/action-ref.js +2 -7
  103. package/es/sidebar/utils/index.d.ts +5 -2
  104. package/es/sidebar/utils/index.js +41 -98
  105. package/es/table/components/CardView/index.js +62 -149
  106. package/es/table/components/Filter/index.js +42 -83
  107. package/es/table/components/Layout/index.js +25 -45
  108. package/es/table/components/LoadMore/index.js +15 -34
  109. package/es/table/components/Pagination/index.js +25 -58
  110. package/es/table/components/QuickAction/index.js +3 -11
  111. package/es/table/components/ToolBar/CardSwitch.js +6 -17
  112. package/es/table/components/ToolBar/DensityIcon.js +18 -31
  113. package/es/table/components/ToolBar/FilterColumnIcon.js +50 -106
  114. package/es/table/components/ToolBar/FullScreenIcon.js +2 -6
  115. package/es/table/components/ToolBar/Fullscreen.js +19 -35
  116. package/es/table/components/ToolBar/RefreshIcon.js +2 -5
  117. package/es/table/components/ToolBar/index.js +23 -45
  118. package/es/table/index.js +226 -399
  119. package/es/table/utils/columnRender.d.ts +1 -1
  120. package/es/table/utils/columnRender.js +32 -76
  121. package/es/table/utils/genProColumnToColumn.js +5 -14
  122. package/es/table/utils/index.js +14 -47
  123. package/es/table/utils/pureColumnRender.js +21 -53
  124. package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
  125. package/es/table/utils/pureGenProColumnToColumn.js +2 -10
  126. package/es/table/utils/useTableSelection.js +6 -33
  127. package/es/templates/List/index.js +2 -9
  128. package/es/timeline/ProTimeLineItem/index.js +24 -64
  129. package/es/timeline/index.js +8 -22
  130. package/es/timeline/typing.d.ts +1 -0
  131. package/es/utils/message.d.ts +2 -2
  132. package/es/utils/message.js +0 -5
  133. package/es/utils/useRealHistory.d.ts +8 -0
  134. package/es/utils/useRealHistory.js +23 -0
  135. package/lib/actions/base.js +8 -24
  136. package/lib/actions/confirm.js +0 -5
  137. package/lib/actions/danger-confirm.js +0 -5
  138. package/lib/actions/danger-pop-confirm.js +0 -4
  139. package/lib/actions/dialog-component.js +2 -15
  140. package/lib/actions/dialog-form.js +36 -88
  141. package/lib/actions/dialog-info.js +1 -10
  142. package/lib/actions/dialog-table.js +0 -5
  143. package/lib/actions/dialog.js +55 -111
  144. package/lib/actions/drawer-form.js +0 -3
  145. package/lib/actions/drawer-info.js +0 -3
  146. package/lib/actions/drawer-table.js +0 -3
  147. package/lib/actions/drawer.js +0 -4
  148. package/lib/actions/error.js +0 -5
  149. package/lib/actions/index.d.ts +2 -0
  150. package/lib/actions/index.js +70 -186
  151. package/lib/actions/link.js +3 -10
  152. package/lib/actions/notice.js +0 -5
  153. package/lib/actions/pop-confirm.js +0 -5
  154. package/lib/actions/quick.js +0 -13
  155. package/lib/actions/request.js +10 -32
  156. package/lib/actions/utils.js +1 -9
  157. package/lib/card/card-container.js +0 -9
  158. package/lib/card/divider.js +0 -7
  159. package/lib/card/index.js +56 -122
  160. package/lib/card/selectable.js +4 -20
  161. package/lib/card/tab.js +1 -14
  162. package/lib/card/utils.js +0 -6
  163. package/lib/field/index.js +0 -6
  164. package/lib/form/Components/Editable/index.js +15 -65
  165. package/lib/form/Components/FormGroup/index.d.ts +1 -0
  166. package/lib/form/Components/FormGroup/index.js +7 -28
  167. package/lib/form/Components/LightFilter/index.js +15 -47
  168. package/lib/form/Components/ProField/index.js +2 -21
  169. package/lib/form/Components/ProField/mapDateFormat.js +2 -32
  170. package/lib/form/Components/Text/index.d.ts +1 -0
  171. package/lib/form/Components/Text/index.js +2 -16
  172. package/lib/form/Filter/AdvancedFilter.js +11 -34
  173. package/lib/form/Filter/Layout.js +11 -33
  174. package/lib/form/Filter/LightFilter.js +13 -32
  175. package/lib/form/Filter/SimpleFilter.js +5 -27
  176. package/lib/form/Filter/index.js +105 -191
  177. package/lib/form/Filter/index2.js +11 -38
  178. package/lib/form/Filter/useBindUrl.js +18 -50
  179. package/lib/form/Filter/useSpecialProps.js +6 -13
  180. package/lib/form/ProForm/addCascadeEffect.js +10 -35
  181. package/lib/form/ProForm/customComponent.js +0 -8
  182. package/lib/form/ProForm/index.js +23 -57
  183. package/lib/form/ProForm/useAutoLayout.js +21 -45
  184. package/lib/form/ProForm/useAutoSubmit.js +3 -10
  185. package/lib/form/ProForm/useFieldRequest.js +0 -8
  186. package/lib/form/ProForm/useFormDisplayValues.js +12 -34
  187. package/lib/form/ProForm/useInitialRequest.js +0 -6
  188. package/lib/form/SchemaForm/adapterComponent.js +0 -6
  189. package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
  190. package/lib/form/SchemaForm/adapterDecorator.js +0 -12
  191. package/lib/form/SchemaForm/adapterType.js +0 -5
  192. package/lib/form/SchemaForm/index.js +78 -144
  193. package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
  194. package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
  195. package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
  196. package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
  197. package/lib/form/SchemaForm/initializeDataSource.js +2 -8
  198. package/lib/form/SchemaForm/initializeFormButton.js +14 -32
  199. package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
  200. package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
  201. package/lib/form/SchemaForm/initializeFormStep.js +11 -23
  202. package/lib/form/SchemaForm/initializeFormTab.js +10 -20
  203. package/lib/form/SchemaForm/initializeReactions.js +9 -37
  204. package/lib/form/SchemaForm/initializeRequest.js +2 -18
  205. package/lib/form/SchemaForm/initializeRules.js +4 -24
  206. package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
  207. package/lib/form/SchemaForm/reactions.js +17 -37
  208. package/lib/form/docs/ActionResponse.d.ts +1 -0
  209. package/lib/form/docs/ActionResponse.js +0 -5
  210. package/lib/form/index.d.ts +9 -9
  211. package/lib/form/index.js +0 -25
  212. package/lib/form/typing.d.ts +6 -4
  213. package/lib/form/utils.d.ts +1 -1
  214. package/lib/form/utils.js +4 -61
  215. package/lib/form/warning.js +2 -8
  216. package/lib/hooks/index.js +0 -5
  217. package/lib/index-without-icon.js +2 -36
  218. package/lib/index.d.ts +1 -1
  219. package/lib/index.js +1 -39
  220. package/lib/info/components/InfoGroup/index.js +21 -42
  221. package/lib/info/components/InfoValueItem/index.js +66 -134
  222. package/lib/info/components/ProInfoItem/index.js +13 -29
  223. package/lib/info/components/baseInfo/index.js +14 -38
  224. package/lib/info/components/headerInfo/index.js +8 -31
  225. package/lib/info/components/tableInfo/index.js +20 -62
  226. package/lib/info/index.js +53 -97
  227. package/lib/info/utils/index.js +0 -19
  228. package/lib/info/utils/utils.js +0 -1
  229. package/lib/nocode/configurators/PageHeader.js +0 -2
  230. package/lib/nocode/configurators/ProTable.js +0 -2
  231. package/lib/nocode/configurators/common.js +5 -10
  232. package/lib/nocode/configurators/index.js +2 -10
  233. package/lib/nocode/configurators/map.js +0 -5
  234. package/lib/nocode/index.js +0 -11
  235. package/lib/nocode/pages/editor.js +5 -19
  236. package/lib/nocode/pages/index.js +2 -9
  237. package/lib/nocode/pages/playground.js +18 -52
  238. package/lib/nocode/pages/renderer.js +9 -53
  239. package/lib/nocode/playground.js +10 -35
  240. package/lib/page-container/index.js +0 -6
  241. package/lib/page-header/index.d.ts +2 -2
  242. package/lib/page-header/index.js +38 -88
  243. package/lib/sidebar/components/sidebar-container/index.js +41 -84
  244. package/lib/sidebar/components/tree/index.js +88 -158
  245. package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
  246. package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
  247. package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
  248. package/lib/sidebar/components/tree-node/index.js +41 -99
  249. package/lib/sidebar/index.js +69 -112
  250. package/lib/sidebar/utils/action-ref.js +2 -8
  251. package/lib/sidebar/utils/index.d.ts +5 -2
  252. package/lib/sidebar/utils/index.js +41 -106
  253. package/lib/skeleton/index.js +0 -6
  254. package/lib/table/components/CardView/index.js +62 -161
  255. package/lib/table/components/EmptyContent/index.js +0 -6
  256. package/lib/table/components/Filter/index.js +42 -93
  257. package/lib/table/components/Layout/index.js +25 -58
  258. package/lib/table/components/LoadMore/index.js +15 -44
  259. package/lib/table/components/Pagination/index.js +25 -68
  260. package/lib/table/components/QuickAction/index.js +3 -15
  261. package/lib/table/components/ToolBar/CardSwitch.js +6 -28
  262. package/lib/table/components/ToolBar/DensityIcon.js +18 -42
  263. package/lib/table/components/ToolBar/FilterColumnIcon.js +50 -118
  264. package/lib/table/components/ToolBar/FullScreenIcon.js +3 -13
  265. package/lib/table/components/ToolBar/Fullscreen.js +19 -42
  266. package/lib/table/components/ToolBar/RefreshIcon.js +3 -12
  267. package/lib/table/components/ToolBar/index.js +23 -63
  268. package/lib/table/index.js +226 -423
  269. package/lib/table/utils/columnRender.d.ts +1 -1
  270. package/lib/table/utils/columnRender.js +32 -89
  271. package/lib/table/utils/genProColumnToColumn.js +5 -19
  272. package/lib/table/utils/getTableProps.js +0 -2
  273. package/lib/table/utils/getTableSortIcons.js +0 -5
  274. package/lib/table/utils/index.js +12 -55
  275. package/lib/table/utils/pureColumnRender.js +21 -64
  276. package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
  277. package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
  278. package/lib/table/utils/useTableSelection.js +6 -35
  279. package/lib/templates/Detail/index.js +0 -5
  280. package/lib/templates/Form/index.js +0 -5
  281. package/lib/templates/List/index.js +2 -19
  282. package/lib/templates/index.js +0 -6
  283. package/lib/timeline/ProTimeLineItem/index.js +24 -75
  284. package/lib/timeline/index.js +8 -33
  285. package/lib/timeline/typing.d.ts +1 -0
  286. package/lib/utils/index.js +0 -6
  287. package/lib/utils/message.d.ts +2 -2
  288. package/lib/utils/message.js +0 -10
  289. package/lib/utils/useRealHistory.d.ts +8 -0
  290. package/lib/utils/useRealHistory.js +32 -0
  291. package/package.json +1 -1
@@ -7,44 +7,38 @@ import defaultLayoutMap from '../../utils/layout';
7
7
  import InfoValueItem from '../InfoValueItem';
8
8
  import { getDataIndexValue, isHidden } from '../../utils';
9
9
  var Row = Grid.Row,
10
- Col = Grid.Col;
11
-
10
+ Col = Grid.Col;
12
11
  var ProBaseInfo = function ProBaseInfo(props) {
13
12
  var _size$width;
14
-
15
13
  var columns = props.columns,
16
- dataSource = props.dataSource,
17
- loading = props.loading,
18
- result = props.result,
19
- actionRef = props.actionRef,
20
- layout = props.layout,
21
- size = props.size,
22
- context = props.context;
23
- var defaultLayout = defaultLayoutMap[getLayout((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)]; // 获取列内的布局参数
24
-
14
+ dataSource = props.dataSource,
15
+ loading = props.loading,
16
+ result = props.result,
17
+ actionRef = props.actionRef,
18
+ layout = props.layout,
19
+ size = props.size,
20
+ context = props.context;
21
+ var defaultLayout = defaultLayoutMap[getLayout((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)];
22
+ // 获取列内的布局参数
25
23
  var getFormItemLayout = function getFormItemLayout(colspan) {
26
- var formItemLayout = JSON.parse(JSON.stringify(defaultLayout.formItemLayout)); // 自定义布局
27
-
24
+ var formItemLayout = JSON.parse(JSON.stringify(defaultLayout.formItemLayout));
25
+ // 自定义布局
28
26
  if (layout) {
29
27
  var _layout$labelCol, _layout$wrapperCol;
30
-
31
28
  var labelCol = (_layout$labelCol = layout === null || layout === void 0 ? void 0 : layout.labelCol) !== null && _layout$labelCol !== void 0 ? _layout$labelCol : defaultLayout.formItemLayout.labelCol;
32
29
  var wrapperCol = (_layout$wrapperCol = layout === null || layout === void 0 ? void 0 : layout.wrapperCol) !== null && _layout$wrapperCol !== void 0 ? _layout$wrapperCol : defaultLayout.formItemLayout.wrapperCol;
33
30
  formItemLayout.labelCol = labelCol;
34
31
  formItemLayout.wrapperCol = wrapperCol;
35
32
  }
36
-
37
33
  var newLabelSpan = formItemLayout.labelCol.span;
38
- var newWrapperSpan = formItemLayout.wrapperCol.span; // 计算合并列情况。label与wrapper需要重新计算
39
-
34
+ var newWrapperSpan = formItemLayout.wrapperCol.span;
35
+ // 计算合并列情况。label与wrapper需要重新计算
40
36
  if (colspan) {
41
37
  var _layout$span, _layout$span2;
42
-
43
38
  var realColspan = ((_layout$span = layout === null || layout === void 0 ? void 0 : layout.span) !== null && _layout$span !== void 0 ? _layout$span : 24 / defaultLayout.span > colspan) ? colspan : (_layout$span2 = layout === null || layout === void 0 ? void 0 : layout.span) !== null && _layout$span2 !== void 0 ? _layout$span2 : 24 / defaultLayout.span;
44
39
  newLabelSpan = newLabelSpan / realColspan;
45
40
  newWrapperSpan = newWrapperSpan + (formItemLayout.labelCol.span - newLabelSpan);
46
41
  }
47
-
48
42
  var newFormItemLayout = {
49
43
  labelCol: {
50
44
  span: newLabelSpan.toFixed()
@@ -55,17 +49,13 @@ var ProBaseInfo = function ProBaseInfo(props) {
55
49
  };
56
50
  return Object.assign(formItemLayout, newFormItemLayout);
57
51
  };
58
-
59
52
  var renderContent = function renderContent() {
60
53
  return columns.map(function (item, index) {
61
54
  var _ref, _ref2, _layout$span3, _layout$span4, _item$title, _item$valueType, _ref3, _item$colSpan;
62
-
63
55
  var hidden = isHidden(item === null || item === void 0 ? void 0 : item.hidden, getDataIndexValue(item.dataIndex, (_ref = dataSource !== null && dataSource !== void 0 ? dataSource : result) !== null && _ref !== void 0 ? _ref : {}), (_ref2 = dataSource !== null && dataSource !== void 0 ? dataSource : result) !== null && _ref2 !== void 0 ? _ref2 : {}, context);
64
-
65
56
  if (hidden) {
66
57
  return;
67
58
  }
68
-
69
59
  var span = item.colSpan ? defaultLayout.span : defaultLayout.span;
70
60
  var layoutSpan = item.colSpan ? ((_layout$span3 = layout === null || layout === void 0 ? void 0 : layout.span) !== null && _layout$span3 !== void 0 ? _layout$span3 : span) * item.colSpan : (_layout$span4 = layout === null || layout === void 0 ? void 0 : layout.span) !== null && _layout$span4 !== void 0 ? _layout$span4 : span;
71
61
  return /*#__PURE__*/React.createElement(Col, {
@@ -94,12 +84,10 @@ var ProBaseInfo = function ProBaseInfo(props) {
94
84
  }));
95
85
  });
96
86
  };
97
-
98
87
  return /*#__PURE__*/React.createElement(React.Fragment, null, (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/React.createElement(Row, {
99
88
  wrap: true,
100
89
  className: "teamix-pro-info-content-row",
101
90
  gutter: 20
102
91
  }, renderContent()));
103
92
  };
104
-
105
93
  export default ProBaseInfo;
@@ -7,43 +7,33 @@ import { getLayout } from '../../utils/utils';
7
7
  import InfoValueItem from '../InfoValueItem';
8
8
  import { getDataIndexValue, isHidden } from '../../utils';
9
9
  var Row = Grid.Row,
10
- Col = Grid.Col;
11
-
10
+ Col = Grid.Col;
12
11
  var ProHeaderInfo = function ProHeaderInfo(props) {
13
12
  var _size$width;
14
-
15
13
  var columns = props.columns,
16
- dataSource = props.dataSource,
17
- layout = props.layout,
18
- loading = props.loading,
19
- result = props.result,
20
- actionRef = props.actionRef,
21
- size = props.size,
22
- context = props.context;
14
+ dataSource = props.dataSource,
15
+ layout = props.layout,
16
+ loading = props.loading,
17
+ result = props.result,
18
+ actionRef = props.actionRef,
19
+ size = props.size,
20
+ context = props.context;
23
21
  var defaultLayout = defaultLayoutMap[getLayout((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)];
24
-
25
22
  var renderContent = function renderContent() {
26
23
  return columns.map(function (item, index) {
27
24
  var _ref, _ref2, _item$title, _item$valueType;
28
-
29
25
  var hidden = isHidden(item === null || item === void 0 ? void 0 : item.hidden, getDataIndexValue(item.dataIndex, (_ref = dataSource !== null && dataSource !== void 0 ? dataSource : result) !== null && _ref !== void 0 ? _ref : {}), (_ref2 = dataSource !== null && dataSource !== void 0 ? dataSource : result) !== null && _ref2 !== void 0 ? _ref2 : {}, context);
30
-
31
26
  if (hidden) {
32
27
  return;
33
28
  }
34
-
35
29
  var span = 24;
36
-
37
30
  if (layout === null || layout === void 0 ? void 0 : layout.colNum) {
38
31
  var _item$colSpan;
39
-
40
32
  span = 24 / (layout === null || layout === void 0 ? void 0 : layout.colNum) * ((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 1);
41
33
  } else {
42
34
  var _item$colSpan2;
43
-
44
35
  span = defaultLayout.span * ((_item$colSpan2 = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan2 !== void 0 ? _item$colSpan2 : 1);
45
36
  }
46
-
47
37
  return /*#__PURE__*/React.createElement(Col, {
48
38
  span: span,
49
39
  key: index
@@ -70,11 +60,9 @@ var ProHeaderInfo = function ProHeaderInfo(props) {
70
60
  }));
71
61
  });
72
62
  };
73
-
74
63
  return /*#__PURE__*/React.createElement(React.Fragment, null, (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/React.createElement(Row, {
75
64
  wrap: true,
76
65
  className: "teamix-pro-info-content-row"
77
66
  }, renderContent()));
78
67
  };
79
-
80
68
  export default ProHeaderInfo;
@@ -1,21 +1,12 @@
1
1
  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; }
2
-
3
2
  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; }
4
-
5
3
  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; }
6
-
7
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
-
9
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."); }
10
-
11
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); }
12
-
13
7
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
14
-
15
8
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
16
-
17
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; }
18
-
19
10
  import React, { useMemo } from 'react';
20
11
  import './index.scss';
21
12
  import { Table } from '@alicloudfe/components';
@@ -25,21 +16,19 @@ import InfoValueItem from '../InfoValueItem';
25
16
  import { ProSkeletonRaw } from '../../..';
26
17
  import { getDataIndexValue, isHidden } from '../../utils';
27
18
  import cloneDeep from 'lodash.clonedeep';
28
-
29
19
  var ProTableInfo = function ProTableInfo(props) {
30
20
  var columns = props.columns,
31
- dataSource = props.dataSource,
32
- _props$layout = props.layout,
33
- layout = _props$layout === void 0 ? {} : _props$layout,
34
- loading = props.loading,
35
- result = props.result,
36
- actionRef = props.actionRef,
37
- context = props.context;
21
+ dataSource = props.dataSource,
22
+ _props$layout = props.layout,
23
+ layout = _props$layout === void 0 ? {} : _props$layout,
24
+ loading = props.loading,
25
+ result = props.result,
26
+ actionRef = props.actionRef,
27
+ context = props.context;
38
28
  var _layout$colNum = layout.colNum,
39
- colNum = _layout$colNum === void 0 ? 2 : _layout$colNum,
40
- _layout$labelGutter = layout.labelGutter,
41
- labelGutter = _layout$labelGutter === void 0 ? '80px' : _layout$labelGutter;
42
-
29
+ colNum = _layout$colNum === void 0 ? 2 : _layout$colNum,
30
+ _layout$labelGutter = layout.labelGutter,
31
+ labelGutter = _layout$labelGutter === void 0 ? '80px' : _layout$labelGutter;
43
32
  var getNewColumns = function getNewColumns() {
44
33
  // 需要 fill 填充 否则有可能不执行
45
34
  return _toConsumableArray(new Array(colNum)).fill(1).map(function (_, index) {
@@ -56,10 +45,8 @@ var ProTableInfo = function ProTableInfo(props) {
56
45
  return [].concat(_toConsumableArray(acc), _toConsumableArray(cur));
57
46
  }, []);
58
47
  };
59
-
60
48
  var getInfoValueItem = function getInfoValueItem(item) {
61
49
  var _item$valueType;
62
-
63
50
  return /*#__PURE__*/React.createElement(InfoValueItem, {
64
51
  type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
65
52
  value: getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result),
@@ -71,77 +58,66 @@ var ProTableInfo = function ProTableInfo(props) {
71
58
  props: item.props
72
59
  });
73
60
  };
74
-
75
61
  var newDataSource = useMemo(function () {
76
62
  var nResult = [];
77
63
  var columnsCopy = cloneDeep(columns).filter(function (item) {
78
64
  return !isHidden(item.hidden, getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result), dataSource !== null && dataSource !== void 0 ? dataSource : result, context);
79
- }); // 取当前行的数据。直到取完
80
-
65
+ });
66
+ // 取当前行的数据。直到取完
81
67
  while (columnsCopy.length > 0) {
82
68
  var filterColumns = [];
83
- var col = colNum * 2; // 需要判断是否有合并行情况
84
-
69
+ var col = colNum * 2;
70
+ // 需要判断是否有合并行情况
85
71
  while (col >= 2) {
86
72
  if (columnsCopy.length > 0) {
87
73
  var _columnsItem$colSpan;
88
-
89
74
  var columnsItem = columnsCopy.shift();
90
- var needCol = 1 + ((_columnsItem$colSpan = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan !== void 0 ? _columnsItem$colSpan : 1); // 如果剩余的col能满足下一组数据那么就放在这一组
91
-
75
+ var needCol = 1 + ((_columnsItem$colSpan = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan !== void 0 ? _columnsItem$colSpan : 1);
76
+ // 如果剩余的col能满足下一组数据那么就放在这一组
92
77
  if (needCol <= col) {
93
78
  col = col - needCol;
94
79
  filterColumns.push(columnsItem);
95
80
  } else {
96
81
  var _filterColumns$0$colS;
97
-
98
82
  // 不满足条件。再安回去。。。
99
- columnsCopy.unshift(columnsItem); // 并且把剩余的col都分配给前一组数据
100
-
101
- filterColumns[0].colSpan = ((_filterColumns$0$colS = filterColumns[0].colSpan) !== null && _filterColumns$0$colS !== void 0 ? _filterColumns$0$colS : 1) + col; // 置0
102
-
83
+ columnsCopy.unshift(columnsItem);
84
+ // 并且把剩余的col都分配给前一组数据
85
+ filterColumns[0].colSpan = ((_filterColumns$0$colS = filterColumns[0].colSpan) !== null && _filterColumns$0$colS !== void 0 ? _filterColumns$0$colS : 1) + col;
86
+ // 置0
103
87
  col = 0;
104
88
  }
105
89
  }
106
-
107
90
  if (columnsCopy.length === 0) {
108
91
  // 如果剩余仍有列数并且已经没有columns分配了
109
92
  col = 0;
110
93
  }
111
94
  }
112
-
113
95
  var itemData = filterColumns.map(function (item, index) {
114
96
  var _item$title, _data;
115
-
116
97
  var data = (_data = {}, _defineProperty(_data, "label_".concat(index), /*#__PURE__*/React.createElement(LabelIconTip, {
117
98
  label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
118
99
  tooltip: item.tooltip,
119
100
  icon: item.tooltipIcon
120
101
  })), _defineProperty(_data, "value_".concat(index), /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null), !loading && getInfoValueItem(item))), _data);
121
-
122
102
  if (item.colSpan) {
123
103
  data['formatter'] = {
124
104
  colSpan: item.colSpan
125
105
  };
126
106
  }
127
-
128
107
  return data;
129
108
  }).reduce(function (acc, cur) {
130
109
  return _objectSpread(_objectSpread({}, acc), cur);
131
110
  }, {});
132
111
  nResult.push(itemData);
133
112
  }
134
-
135
113
  return nResult;
136
114
  }, [loading, result]);
137
-
138
115
  var setCellProps = function setCellProps(rowIndex, colIndex, dataIndex, record) {
139
116
  if (colIndex % 2 === 0) {
140
117
  return {
141
118
  className: 'key-type'
142
119
  };
143
120
  }
144
-
145
121
  if (record.formatter) {
146
122
  if (record.formatter.colSpan) {
147
123
  if (colIndex === record.formatter.colSpan) {
@@ -149,28 +125,23 @@ var ProTableInfo = function ProTableInfo(props) {
149
125
  colSpan: record.formatter.colSpan
150
126
  };
151
127
  }
152
-
153
128
  var length = Object.keys(record).length;
154
-
155
129
  if (length <= 3) {
156
130
  return {
157
131
  colSpan: record.formatter.colSpan
158
132
  };
159
133
  }
160
-
161
134
  if (length > 5) {
162
135
  return {
163
136
  colSpan: record.formatter.colSpan
164
137
  };
165
138
  }
166
139
  }
167
-
168
140
  return {
169
141
  rowSpan: record.formatter.rowSpan
170
142
  };
171
143
  }
172
144
  };
173
-
174
145
  return /*#__PURE__*/React.createElement(Table.StickyLock, {
175
146
  className: "teamix-pro-info-table",
176
147
  cellProps: setCellProps,
@@ -180,5 +151,4 @@ var ProTableInfo = function ProTableInfo(props) {
180
151
  dataSource: newDataSource
181
152
  });
182
153
  };
183
-
184
154
  export default ProTableInfo;
package/es/info/index.js CHANGED
@@ -1,28 +1,16 @@
1
1
  var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra", "context"],
2
- _excluded2 = ["context"];
3
-
2
+ _excluded2 = ["context"];
4
3
  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; }
5
-
6
4
  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; }
7
-
8
5
  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; }
9
-
10
6
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
-
12
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."); }
13
-
14
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); }
15
-
16
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; }
17
-
18
10
  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; }
19
-
20
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
-
22
12
  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; }
23
-
24
13
  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; }
25
-
26
14
  import React, { isValidElement, useContext, useEffect, useRef, useState, useMemo } from 'react';
27
15
  import ProTableInfo from './components/tableInfo';
28
16
  import ProHeaderInfo from './components/headerInfo';
@@ -34,67 +22,59 @@ import { doCommonRequest, cls, getTestRequestData, getTestRequestParams } from '
34
22
  import { useSize } from '@teamix/hooks';
35
23
  import { ProCard } from '..';
36
24
  export * from './typing';
37
-
38
25
  var ProInfo = function ProInfo(props) {
39
26
  var _ref;
40
-
41
27
  var _props$type = props.type,
42
- type = _props$type === void 0 ? 'base' : _props$type,
43
- url = props.url,
44
- _props$method = props.method,
45
- method = _props$method === void 0 ? 'post' : _props$method,
46
- formatResult = props.formatResult,
47
- formatParams = props.formatParams,
48
- params = props.params,
49
- propsActionRef = props.actionRef,
50
- _props$header = props.header,
51
- header = _props$header === void 0 ? {} : _props$header,
52
- onSuccess = props.onSuccess,
53
- onError = props.onError,
54
- beforeRequest = props.beforeRequest,
55
- extendParams = props.extendParams,
56
- className = props.className,
57
- style = props.style,
58
- columns = props.columns,
59
- layout = props.layout,
60
- dataSource = props.dataSource,
61
- userLoading = props.loading,
62
- extra = props.extra,
63
- infoContext = props.context,
64
- others = _objectWithoutProperties(props, _excluded);
65
-
28
+ type = _props$type === void 0 ? 'base' : _props$type,
29
+ url = props.url,
30
+ _props$method = props.method,
31
+ method = _props$method === void 0 ? 'post' : _props$method,
32
+ formatResult = props.formatResult,
33
+ formatParams = props.formatParams,
34
+ params = props.params,
35
+ propsActionRef = props.actionRef,
36
+ _props$header = props.header,
37
+ header = _props$header === void 0 ? {} : _props$header,
38
+ onSuccess = props.onSuccess,
39
+ onError = props.onError,
40
+ beforeRequest = props.beforeRequest,
41
+ extendParams = props.extendParams,
42
+ className = props.className,
43
+ style = props.style,
44
+ columns = props.columns,
45
+ layout = props.layout,
46
+ dataSource = props.dataSource,
47
+ userLoading = props.loading,
48
+ extra = props.extra,
49
+ infoContext = props.context,
50
+ others = _objectWithoutProperties(props, _excluded);
66
51
  var _useContext = useContext(ProInfoGroupContext),
67
- contextUrl = _useContext.url,
68
- contextMethod = _useContext.method,
69
- contextParams = _useContext.params,
70
- contextFormatResult = _useContext.formatResult,
71
- contextVisible = _useContext.visible,
72
- contextSize = _useContext.size,
73
- contextOnSuccess = _useContext.onSuccess,
74
- contextOnError = _useContext.onError,
75
- contextFormatParams = _useContext.formatParams,
76
- contextBeforeRequest = _useContext.beforeRequest,
77
- contextExtendParams = _useContext.extendParams,
78
- _useContext$context = _useContext.context,
79
- contextContext = _useContext$context === void 0 ? {} : _useContext$context; // 获取容器宽度
80
-
81
-
52
+ contextUrl = _useContext.url,
53
+ contextMethod = _useContext.method,
54
+ contextParams = _useContext.params,
55
+ contextFormatResult = _useContext.formatResult,
56
+ contextVisible = _useContext.visible,
57
+ contextSize = _useContext.size,
58
+ contextOnSuccess = _useContext.onSuccess,
59
+ contextOnError = _useContext.onError,
60
+ contextFormatParams = _useContext.formatParams,
61
+ contextBeforeRequest = _useContext.beforeRequest,
62
+ contextExtendParams = _useContext.extendParams,
63
+ _useContext$context = _useContext.context,
64
+ contextContext = _useContext$context === void 0 ? {} : _useContext$context;
65
+ // 获取容器宽度
82
66
  var ref = useRef();
83
67
  var size = contextVisible ? contextSize : useSize(ref);
84
-
85
68
  var _useState = useState(false),
86
- _useState2 = _slicedToArray(_useState, 2),
87
- loading = _useState2[0],
88
- setLoading = _useState2[1]; // 请求数据
89
-
90
-
69
+ _useState2 = _slicedToArray(_useState, 2),
70
+ loading = _useState2[0],
71
+ setLoading = _useState2[1];
72
+ // 请求数据
91
73
  var _useState3 = useState(),
92
- _useState4 = _slicedToArray(_useState3, 2),
93
- data = _useState4[0],
94
- setData = _useState4[1];
95
-
74
+ _useState4 = _slicedToArray(_useState3, 2),
75
+ data = _useState4[0],
76
+ setData = _useState4[1];
96
77
  var requestDataKey = (contextMethod !== null && contextMethod !== void 0 ? contextMethod : method).toLowerCase() === 'get' ? 'params' : 'data';
97
-
98
78
  var requestConfig = _defineProperty({
99
79
  url: (_ref = contextUrl !== null && contextUrl !== void 0 ? contextUrl : url) !== null && _ref !== void 0 ? _ref : '',
100
80
  method: contextMethod !== null && contextMethod !== void 0 ? contextMethod : method,
@@ -105,7 +85,6 @@ var ProInfo = function ProInfo(props) {
105
85
  beforeRequest: contextBeforeRequest !== null && contextBeforeRequest !== void 0 ? contextBeforeRequest : beforeRequest,
106
86
  extendParams: contextExtendParams !== null && contextExtendParams !== void 0 ? contextExtendParams : extendParams
107
87
  }, requestDataKey, contextParams !== null && contextParams !== void 0 ? contextParams : params);
108
-
109
88
  useEffect(function () {
110
89
  if (url || contextUrl) {
111
90
  setLoading(false);
@@ -118,8 +97,8 @@ var ProInfo = function ProInfo(props) {
118
97
  return _objectSpread(_objectSpread({}, infoContext), {}, {
119
98
  record: dataSource !== null && dataSource !== void 0 ? dataSource : data
120
99
  }, contextContext);
121
- }, [dataSource, data]); // 获取数据
122
-
100
+ }, [dataSource, data]);
101
+ // 获取数据
123
102
  var request = function request() {
124
103
  setLoading(true);
125
104
  doCommonRequest(requestConfig).then(function (resp) {
@@ -128,38 +107,31 @@ var ProInfo = function ProInfo(props) {
128
107
  setLoading(false);
129
108
  });
130
109
  };
131
-
132
- var actionRef = useRef(); // 将 Actions 绑定到传入的 propsActionRef 中
133
-
110
+ var actionRef = useRef();
111
+ // 将 Actions 绑定到传入的 propsActionRef 中
134
112
  if (propsActionRef) {
135
113
  propsActionRef.current = actionRef.current;
136
- } // 绑定 Actions
137
-
138
-
114
+ }
115
+ // 绑定 Actions
139
116
  useActionType(actionRef, {
140
117
  refresh: function refresh() {
141
118
  request();
142
119
  }
143
120
  });
144
-
145
121
  var getExtra = function getExtra() {
146
122
  if (!extra) {
147
123
  return undefined;
148
124
  }
149
-
150
125
  if ( /*#__PURE__*/isValidElement(extra)) {
151
126
  return extra;
152
127
  }
153
-
154
128
  var _extra$context = extra.context,
155
- actionContext = _extra$context === void 0 ? {} : _extra$context,
156
- others = _objectWithoutProperties(extra, _excluded2);
157
-
129
+ actionContext = _extra$context === void 0 ? {} : _extra$context,
130
+ others = _objectWithoutProperties(extra, _excluded2);
158
131
  return _objectSpread(_objectSpread({}, others), {}, {
159
132
  context: _objectSpread(_objectSpread({}, context), actionContext)
160
133
  });
161
134
  };
162
-
163
135
  return /*#__PURE__*/React.createElement("div", {
164
136
  ref: ref,
165
137
  style: style,
@@ -203,7 +175,6 @@ var ProInfo = function ProInfo(props) {
203
175
  context: context
204
176
  })));
205
177
  };
206
-
207
178
  ProInfo.Group = ProInfoGroup;
208
179
  ProInfo.ProInfoGroup = ProInfoGroup;
209
180
  export default ProInfo;
@@ -1,19 +1,14 @@
1
1
  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; }
2
-
3
2
  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; }
4
-
5
3
  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; }
6
-
7
4
  import { getDeepValue, getTargetValue } from '@teamix/utils';
8
5
  import React from 'react';
9
6
  export function useActionType(ref, action) {
10
7
  // 合并自定义事件
11
8
  var userAction = _objectSpread({}, action);
12
-
13
9
  ref.current = userAction;
14
10
  }
15
11
  /** ProInfoGroupContext */
16
-
17
12
  export var ProInfoGroupContext = /*#__PURE__*/React.createContext({});
18
13
  /**
19
14
  * 获取 dataIndex 值
@@ -21,14 +16,12 @@ export var ProInfoGroupContext = /*#__PURE__*/React.createContext({});
21
16
  * @param dataSource
22
17
  * @returns
23
18
  */
24
-
25
19
  export function getDataIndexValue(dataIndex, dataSource) {
26
20
  if (Array.isArray(dataIndex)) {
27
21
  return dataIndex.map(function (item) {
28
22
  return getDeepValue(item !== null && item !== void 0 ? item : '', dataSource);
29
23
  });
30
24
  }
31
-
32
25
  return getDeepValue(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
33
26
  }
34
27
  /**
@@ -38,7 +31,6 @@ export function getDataIndexValue(dataIndex, dataSource) {
38
31
  * @param record
39
32
  * @param context
40
33
  */
41
-
42
34
  export function isHidden(hidden, value, record, context) {
43
35
  if (typeof hidden === 'string') {
44
36
  return getTargetValue(hidden, _objectSpread(_objectSpread({}, record), {}, {
@@ -47,14 +39,11 @@ export function isHidden(hidden, value, record, context) {
47
39
  context: context
48
40
  }));
49
41
  }
50
-
51
42
  if (typeof hidden === 'boolean') {
52
43
  return hidden;
53
44
  }
54
-
55
45
  if (typeof hidden === 'function') {
56
46
  return hidden === null || hidden === void 0 ? void 0 : hidden(value, record);
57
47
  }
58
-
59
48
  return false;
60
49
  }
@@ -55,12 +55,11 @@ export function array(title, name, fields, main, arrayTitle) {
55
55
  }
56
56
  export function actions(props) {
57
57
  var _ref = props || {},
58
- _ref$title = _ref.title,
59
- title = _ref$title === void 0 ? '操作项' : _ref$title,
60
- _ref$name = _ref.name,
61
- name = _ref$name === void 0 ? 'actions' : _ref$name,
62
- arrayTitle = _ref.arrayTitle;
63
-
58
+ _ref$title = _ref.title,
59
+ title = _ref$title === void 0 ? '操作项' : _ref$title,
60
+ _ref$name = _ref.name,
61
+ name = _ref$name === void 0 ? 'actions' : _ref$name,
62
+ arrayTitle = _ref.arrayTitle;
64
63
  return array(title, name, [{
65
64
  name: 'children',
66
65
  title: '文字',
@@ -1,19 +1,18 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import ProForm, { createForm } from '../../form';
3
+ // @ts-ignore
3
4
  export var initConfigurator = function initConfigurator(schema, defaultInitialValues, defaultValues) {
4
5
  return function (props) {
5
6
  var initialValues = props.initialValues,
6
- onValuesChange = props.onValuesChange;
7
+ onValuesChange = props.onValuesChange;
7
8
  var form = useMemo(function () {
8
9
  return createForm({
9
10
  initialValues: Object.assign({}, defaultValues, initialValues || defaultInitialValues)
10
11
  });
11
12
  }, []);
12
-
13
13
  var onChange = function onChange(values) {
14
14
  onValuesChange && onValuesChange(values);
15
15
  };
16
-
17
16
  return /*#__PURE__*/React.createElement(ProForm, {
18
17
  labelCol: 6,
19
18
  wrapperCol: 18,