@teamix/pro 1.4.25-bugfix → 1.4.25-bugfix.2

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 (356) hide show
  1. package/dist/pro.all.min.css +1 -0
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +78506 -59443
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/dist/pro.min.js.LICENSE.txt +13 -6
  7. package/dist/pro.xconsole.min.css +1 -0
  8. package/es/actions/base.js +8 -21
  9. package/es/actions/dialog-component.js +2 -9
  10. package/es/actions/dialog-form.js +37 -75
  11. package/es/actions/dialog-info.js +1 -5
  12. package/es/actions/dialog.js +57 -95
  13. package/es/actions/index.d.ts +7 -0
  14. package/es/actions/index.js +93 -153
  15. package/es/actions/index.scss +6 -1
  16. package/es/actions/link.js +3 -5
  17. package/es/actions/quick.d.ts +2 -0
  18. package/es/actions/quick.js +26 -0
  19. package/es/actions/request.js +12 -27
  20. package/es/actions/utils.js +1 -9
  21. package/es/card/card-container.js +0 -5
  22. package/es/card/divider.js +0 -5
  23. package/es/card/index.js +61 -100
  24. package/es/card/index.scss +15 -0
  25. package/es/card/selectable.js +4 -13
  26. package/es/card/tab.js +1 -10
  27. package/es/card/utils.js +0 -2
  28. package/es/card/xconsole.scss +3 -0
  29. package/es/form/Components/Editable/index.js +16 -55
  30. package/es/form/Components/FormGroup/index.d.ts +1 -0
  31. package/es/form/Components/FormGroup/index.js +7 -22
  32. package/es/form/Components/LightFilter/index.js +15 -35
  33. package/es/form/Components/ProField/index.js +2 -14
  34. package/es/form/Components/ProField/mapDateFormat.js +2 -28
  35. package/es/form/Components/Text/index.d.ts +1 -0
  36. package/es/form/Components/Text/index.js +2 -11
  37. package/es/form/Filter/AdvancedFilter.js +11 -26
  38. package/es/form/Filter/Layout.js +11 -24
  39. package/es/form/Filter/LightFilter.js +13 -24
  40. package/es/form/Filter/SimpleFilter.js +7 -21
  41. package/es/form/Filter/index.js +117 -171
  42. package/es/form/Filter/index2.js +11 -28
  43. package/es/form/Filter/layout.scss +1 -1
  44. package/es/form/Filter/useBindUrl.js +18 -46
  45. package/es/form/Filter/useSpecialProps.js +8 -13
  46. package/es/form/ProForm/addCascadeEffect.d.ts +2 -0
  47. package/es/form/ProForm/addCascadeEffect.js +203 -0
  48. package/es/form/ProForm/customComponent.js +0 -5
  49. package/es/form/ProForm/index.js +30 -38
  50. package/es/form/ProForm/useAutoLayout.js +21 -42
  51. package/es/form/ProForm/useAutoSubmit.js +3 -8
  52. package/es/form/ProForm/useFieldRequest.js +0 -5
  53. package/es/form/ProForm/useFormDisplayValues.js +12 -28
  54. package/es/form/ProForm/useInitialRequest.js +0 -5
  55. package/es/form/SchemaForm/adapterComponent.js +0 -3
  56. package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
  57. package/es/form/SchemaForm/adapterDecorator.js +0 -8
  58. package/es/form/SchemaForm/adapterType.js +0 -2
  59. package/es/form/SchemaForm/index.js +78 -114
  60. package/es/form/SchemaForm/initializeArrayCards.js +0 -6
  61. package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
  62. package/es/form/SchemaForm/initializeArrayItems.js +2 -9
  63. package/es/form/SchemaForm/initializeArrayTable.js +21 -34
  64. package/es/form/SchemaForm/initializeDataSource.js +2 -6
  65. package/es/form/SchemaForm/initializeFormButton.js +14 -31
  66. package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
  67. package/es/form/SchemaForm/initializeFormGroup.js +10 -20
  68. package/es/form/SchemaForm/initializeFormStep.js +11 -23
  69. package/es/form/SchemaForm/initializeFormTab.js +10 -20
  70. package/es/form/SchemaForm/initializeReactions.js +9 -33
  71. package/es/form/SchemaForm/initializeRequest.js +2 -16
  72. package/es/form/SchemaForm/initializeRules.js +4 -22
  73. package/es/form/SchemaForm/initializeSelectTable.js +7 -33
  74. package/es/form/SchemaForm/reactions.js +19 -34
  75. package/es/form/docs/ActionResponse.d.ts +1 -0
  76. package/es/form/index.d.ts +9 -9
  77. package/es/form/index.js +0 -9
  78. package/es/form/typing.d.ts +26 -4
  79. package/es/form/utils.d.ts +1 -1
  80. package/es/form/utils.js +4 -49
  81. package/es/form/warning.js +2 -7
  82. package/es/global.scss +3 -1
  83. package/es/index-without-icon.js +4 -3
  84. package/es/index.d.ts +1 -1
  85. package/es/index.js +18 -8
  86. package/es/info/components/InfoGroup/index.js +21 -32
  87. package/es/info/components/InfoValueItem/index.js +66 -119
  88. package/es/info/components/ProInfoItem/index.js +13 -21
  89. package/es/info/components/baseInfo/index.js +17 -27
  90. package/es/info/components/headerInfo/index.js +8 -20
  91. package/es/info/components/tableInfo/index.js +20 -50
  92. package/es/info/index.js +61 -86
  93. package/es/info/typing.d.ts +2 -0
  94. package/es/info/utils/index.js +0 -11
  95. package/es/next-xconsole.scss +34 -0
  96. package/es/nocode/configurators/ProTable.js +1 -22
  97. package/es/nocode/configurators/common.js +5 -6
  98. package/es/nocode/configurators/index.js +2 -3
  99. package/es/nocode/index.js +6 -6
  100. package/es/nocode/pages/editor.js +5 -9
  101. package/es/nocode/pages/index.js +5 -30
  102. package/es/nocode/pages/playground.js +18 -35
  103. package/es/nocode/pages/renderer.js +9 -42
  104. package/es/nocode/playground.js +10 -23
  105. package/es/page-header/index.d.ts +2 -2
  106. package/es/page-header/index.js +40 -76
  107. package/es/page-header/index.scss +2 -1
  108. package/es/page-header/xconsole.scss +5 -0
  109. package/es/sidebar/components/sidebar-container/index.js +54 -69
  110. package/es/sidebar/components/sidebar-container/index.scss +21 -14
  111. package/es/sidebar/components/tree/index.js +100 -138
  112. package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
  113. package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
  114. package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
  115. package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
  116. package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
  117. package/es/sidebar/components/tree-node/index.js +42 -84
  118. package/es/sidebar/components/tree-node/index.scss +6 -0
  119. package/es/sidebar/index.d.ts +2 -0
  120. package/es/sidebar/index.js +72 -95
  121. package/es/sidebar/typing.d.ts +4 -0
  122. package/es/sidebar/utils/action-ref.js +2 -7
  123. package/es/sidebar/utils/index.d.ts +5 -2
  124. package/es/sidebar/utils/index.js +41 -98
  125. package/es/table/components/CardView/index.d.ts +5 -0
  126. package/es/table/components/CardView/index.js +392 -0
  127. package/es/table/components/CardView/index.scss +46 -0
  128. package/es/table/components/Filter/index.d.ts +6 -3
  129. package/es/table/components/Filter/index.js +115 -128
  130. package/es/table/components/Layout/index.js +32 -47
  131. package/es/table/components/Layout/index.scss +2 -1
  132. package/es/table/components/LoadMore/index.d.ts +20 -0
  133. package/es/table/components/LoadMore/index.js +88 -0
  134. package/es/table/components/LoadMore/index.scss +19 -0
  135. package/es/table/components/Pagination/index.js +25 -58
  136. package/es/table/components/QuickAction/index.d.ts +1 -0
  137. package/es/table/components/QuickAction/index.js +3 -11
  138. package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
  139. package/es/table/components/ToolBar/CardSwitch.js +52 -0
  140. package/es/table/components/ToolBar/DensityIcon.js +19 -31
  141. package/es/table/components/ToolBar/FilterColumnIcon.js +87 -125
  142. package/es/table/components/ToolBar/FullScreenIcon.js +7 -62
  143. package/es/table/components/ToolBar/Fullscreen.js +25 -28
  144. package/es/table/components/ToolBar/RefreshIcon.js +162 -27
  145. package/es/table/components/ToolBar/index.d.ts +1 -1
  146. package/es/table/components/ToolBar/index.js +130 -38
  147. package/es/table/components/ToolBar/index.scss +49 -3
  148. package/es/table/index.js +455 -423
  149. package/es/table/index.scss +8 -0
  150. package/es/table/typing.d.ts +125 -6
  151. package/es/table/utils/columnRender.d.ts +3 -3
  152. package/es/table/utils/columnRender.js +39 -79
  153. package/es/table/utils/genProColumnToColumn.d.ts +2 -2
  154. package/es/table/utils/genProColumnToColumn.js +13 -16
  155. package/es/table/utils/index.js +14 -47
  156. package/es/table/utils/pureColumnRender.js +21 -53
  157. package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
  158. package/es/table/utils/pureGenProColumnToColumn.js +2 -10
  159. package/es/table/utils/useTableSelection.js +6 -33
  160. package/es/table/utils/util.d.ts +5 -0
  161. package/es/table/utils/util.js +19 -0
  162. package/es/templates/List/index.js +2 -9
  163. package/es/timeline/ProTimeLineItem/index.js +25 -65
  164. package/es/timeline/index.js +8 -22
  165. package/es/timeline/typing.d.ts +1 -0
  166. package/es/utils/message.d.ts +2 -2
  167. package/es/utils/message.js +0 -5
  168. package/es/xconsole.scss +503 -0
  169. package/lib/actions/base.js +8 -24
  170. package/lib/actions/confirm.js +0 -5
  171. package/lib/actions/danger-confirm.js +0 -5
  172. package/lib/actions/danger-pop-confirm.js +0 -4
  173. package/lib/actions/dialog-component.js +2 -15
  174. package/lib/actions/dialog-form.js +36 -89
  175. package/lib/actions/dialog-info.js +1 -10
  176. package/lib/actions/dialog-table.js +0 -5
  177. package/lib/actions/dialog.js +55 -112
  178. package/lib/actions/drawer-form.js +0 -3
  179. package/lib/actions/drawer-info.js +0 -3
  180. package/lib/actions/drawer-table.js +0 -3
  181. package/lib/actions/drawer.js +0 -4
  182. package/lib/actions/error.js +0 -5
  183. package/lib/actions/index.d.ts +7 -0
  184. package/lib/actions/index.js +115 -184
  185. package/lib/actions/index.scss +6 -1
  186. package/lib/actions/link.js +1 -10
  187. package/lib/actions/notice.js +0 -5
  188. package/lib/actions/pop-confirm.js +0 -5
  189. package/lib/actions/quick.d.ts +2 -0
  190. package/lib/actions/quick.js +33 -0
  191. package/lib/actions/request.js +8 -32
  192. package/lib/actions/utils.js +1 -9
  193. package/lib/card/card-container.js +0 -9
  194. package/lib/card/divider.js +0 -7
  195. package/lib/card/index.js +61 -127
  196. package/lib/card/index.scss +15 -0
  197. package/lib/card/selectable.js +4 -20
  198. package/lib/card/tab.js +1 -14
  199. package/lib/card/utils.js +0 -6
  200. package/lib/card/xconsole.scss +3 -0
  201. package/lib/field/index.js +0 -6
  202. package/lib/form/Components/Editable/index.js +15 -65
  203. package/lib/form/Components/FormGroup/index.d.ts +1 -0
  204. package/lib/form/Components/FormGroup/index.js +7 -28
  205. package/lib/form/Components/LightFilter/index.js +15 -47
  206. package/lib/form/Components/ProField/index.js +2 -21
  207. package/lib/form/Components/ProField/mapDateFormat.js +2 -32
  208. package/lib/form/Components/Text/index.d.ts +1 -0
  209. package/lib/form/Components/Text/index.js +2 -16
  210. package/lib/form/Filter/AdvancedFilter.js +11 -34
  211. package/lib/form/Filter/Layout.js +11 -33
  212. package/lib/form/Filter/LightFilter.js +13 -32
  213. package/lib/form/Filter/SimpleFilter.js +5 -27
  214. package/lib/form/Filter/index.js +116 -191
  215. package/lib/form/Filter/index2.js +11 -38
  216. package/lib/form/Filter/layout.scss +1 -1
  217. package/lib/form/Filter/useBindUrl.js +18 -50
  218. package/lib/form/Filter/useSpecialProps.js +6 -13
  219. package/lib/form/ProForm/addCascadeEffect.d.ts +2 -0
  220. package/lib/form/ProForm/addCascadeEffect.js +210 -0
  221. package/lib/form/ProForm/customComponent.js +0 -8
  222. package/lib/form/ProForm/index.js +30 -60
  223. package/lib/form/ProForm/useAutoLayout.js +21 -45
  224. package/lib/form/ProForm/useAutoSubmit.js +1 -10
  225. package/lib/form/ProForm/useFieldRequest.js +0 -8
  226. package/lib/form/ProForm/useFormDisplayValues.js +12 -34
  227. package/lib/form/ProForm/useInitialRequest.js +0 -6
  228. package/lib/form/SchemaForm/adapterComponent.js +0 -6
  229. package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
  230. package/lib/form/SchemaForm/adapterDecorator.js +0 -12
  231. package/lib/form/SchemaForm/adapterType.js +0 -5
  232. package/lib/form/SchemaForm/index.js +78 -144
  233. package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
  234. package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
  235. package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
  236. package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
  237. package/lib/form/SchemaForm/initializeDataSource.js +2 -8
  238. package/lib/form/SchemaForm/initializeFormButton.js +14 -32
  239. package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
  240. package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
  241. package/lib/form/SchemaForm/initializeFormStep.js +11 -23
  242. package/lib/form/SchemaForm/initializeFormTab.js +10 -20
  243. package/lib/form/SchemaForm/initializeReactions.js +9 -37
  244. package/lib/form/SchemaForm/initializeRequest.js +2 -18
  245. package/lib/form/SchemaForm/initializeRules.js +4 -24
  246. package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
  247. package/lib/form/SchemaForm/reactions.js +17 -37
  248. package/lib/form/docs/ActionResponse.d.ts +1 -0
  249. package/lib/form/docs/ActionResponse.js +0 -5
  250. package/lib/form/index.d.ts +9 -9
  251. package/lib/form/index.js +0 -25
  252. package/lib/form/typing.d.ts +26 -4
  253. package/lib/form/utils.d.ts +1 -1
  254. package/lib/form/utils.js +4 -61
  255. package/lib/form/warning.js +2 -8
  256. package/lib/global.scss +3 -1
  257. package/lib/hooks/index.js +0 -5
  258. package/lib/index-without-icon.js +2 -36
  259. package/lib/index.d.ts +1 -1
  260. package/lib/index.js +13 -40
  261. package/lib/info/components/InfoGroup/index.js +21 -42
  262. package/lib/info/components/InfoValueItem/index.js +66 -134
  263. package/lib/info/components/ProInfoItem/index.js +13 -29
  264. package/lib/info/components/baseInfo/index.js +17 -39
  265. package/lib/info/components/headerInfo/index.js +8 -31
  266. package/lib/info/components/tableInfo/index.js +20 -62
  267. package/lib/info/index.js +61 -101
  268. package/lib/info/typing.d.ts +2 -0
  269. package/lib/info/utils/index.js +0 -19
  270. package/lib/info/utils/utils.js +0 -1
  271. package/lib/next-xconsole.scss +34 -0
  272. package/lib/nocode/configurators/PageHeader.js +0 -2
  273. package/lib/nocode/configurators/ProTable.js +1 -24
  274. package/lib/nocode/configurators/common.js +5 -10
  275. package/lib/nocode/configurators/index.js +2 -10
  276. package/lib/nocode/configurators/map.js +0 -5
  277. package/lib/nocode/index.js +0 -11
  278. package/lib/nocode/pages/editor.js +5 -19
  279. package/lib/nocode/pages/index.js +3 -35
  280. package/lib/nocode/pages/playground.js +18 -52
  281. package/lib/nocode/pages/renderer.js +9 -53
  282. package/lib/nocode/playground.js +10 -35
  283. package/lib/page-container/index.js +0 -6
  284. package/lib/page-header/index.d.ts +2 -2
  285. package/lib/page-header/index.js +39 -90
  286. package/lib/page-header/index.scss +2 -1
  287. package/lib/page-header/xconsole.scss +5 -0
  288. package/lib/sidebar/components/sidebar-container/index.js +54 -81
  289. package/lib/sidebar/components/sidebar-container/index.scss +21 -14
  290. package/lib/sidebar/components/tree/index.js +100 -152
  291. package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
  292. package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
  293. package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
  294. package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
  295. package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
  296. package/lib/sidebar/components/tree-node/index.js +42 -100
  297. package/lib/sidebar/components/tree-node/index.scss +6 -0
  298. package/lib/sidebar/index.d.ts +2 -0
  299. package/lib/sidebar/index.js +79 -111
  300. package/lib/sidebar/typing.d.ts +4 -0
  301. package/lib/sidebar/utils/action-ref.js +2 -8
  302. package/lib/sidebar/utils/index.d.ts +5 -2
  303. package/lib/sidebar/utils/index.js +41 -106
  304. package/lib/skeleton/index.js +0 -6
  305. package/lib/table/components/CardView/index.d.ts +5 -0
  306. package/lib/table/components/CardView/index.js +402 -0
  307. package/lib/table/components/CardView/index.scss +46 -0
  308. package/lib/table/components/EmptyContent/index.js +0 -6
  309. package/lib/table/components/Filter/index.d.ts +6 -3
  310. package/lib/table/components/Filter/index.js +114 -137
  311. package/lib/table/components/Layout/index.js +32 -60
  312. package/lib/table/components/Layout/index.scss +2 -1
  313. package/lib/table/components/LoadMore/index.d.ts +20 -0
  314. package/lib/table/components/LoadMore/index.js +99 -0
  315. package/lib/table/components/LoadMore/index.scss +19 -0
  316. package/lib/table/components/Pagination/index.js +25 -68
  317. package/lib/table/components/QuickAction/index.d.ts +1 -0
  318. package/lib/table/components/QuickAction/index.js +3 -15
  319. package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
  320. package/lib/table/components/ToolBar/CardSwitch.js +60 -0
  321. package/lib/table/components/ToolBar/DensityIcon.js +19 -42
  322. package/lib/table/components/ToolBar/FilterColumnIcon.js +86 -136
  323. package/lib/table/components/ToolBar/FullScreenIcon.js +10 -74
  324. package/lib/table/components/ToolBar/Fullscreen.js +25 -35
  325. package/lib/table/components/ToolBar/RefreshIcon.js +164 -36
  326. package/lib/table/components/ToolBar/index.d.ts +1 -1
  327. package/lib/table/components/ToolBar/index.js +133 -47
  328. package/lib/table/components/ToolBar/index.scss +49 -3
  329. package/lib/table/index.js +454 -445
  330. package/lib/table/index.scss +8 -0
  331. package/lib/table/typing.d.ts +125 -6
  332. package/lib/table/utils/columnRender.d.ts +3 -3
  333. package/lib/table/utils/columnRender.js +39 -92
  334. package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
  335. package/lib/table/utils/genProColumnToColumn.js +13 -21
  336. package/lib/table/utils/getTableProps.js +0 -2
  337. package/lib/table/utils/getTableSortIcons.js +0 -5
  338. package/lib/table/utils/index.js +12 -55
  339. package/lib/table/utils/pureColumnRender.js +21 -64
  340. package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
  341. package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
  342. package/lib/table/utils/useTableSelection.js +6 -35
  343. package/lib/table/utils/util.d.ts +5 -0
  344. package/lib/table/utils/util.js +25 -0
  345. package/lib/templates/Detail/index.js +0 -5
  346. package/lib/templates/Form/index.js +0 -5
  347. package/lib/templates/List/index.js +2 -19
  348. package/lib/templates/index.js +0 -6
  349. package/lib/timeline/ProTimeLineItem/index.js +25 -76
  350. package/lib/timeline/index.js +8 -33
  351. package/lib/timeline/typing.d.ts +1 -0
  352. package/lib/utils/index.js +0 -6
  353. package/lib/utils/message.d.ts +2 -2
  354. package/lib/utils/message.js +0 -10
  355. package/lib/xconsole.scss +503 -0
  356. package/package.json +1 -1
@@ -1,97 +1,79 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _icon = _interopRequireDefault(require("@teamix/icon"));
13
-
14
10
  var _components = require("@alicloudfe/components");
15
-
16
11
  var _utils = require("@teamix/utils");
17
-
18
12
  require("./index.scss");
19
-
13
+ var _hooks = require("@teamix/hooks");
20
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
17
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
27
-
28
18
  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."); }
29
-
30
19
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
-
32
20
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
33
-
34
21
  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; }
35
-
36
22
  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; }
37
-
38
23
  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; }
39
-
40
24
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
-
42
25
  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."); }
43
-
44
26
  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); }
45
-
46
27
  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; }
47
-
48
28
  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; }
49
-
50
29
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
-
52
30
  var CheckboxItem = _components.Menu.CheckboxItem;
53
31
  var cls = (0, _utils.usePrefixCls)('teamix-pro-table-toolbar-filter');
54
32
  var RadioItem = _components.Menu.RadioItem;
55
-
56
33
  var Filter = function Filter(props) {
34
+ var _urlState$split, _urlState, _urlState$split2;
57
35
  var column = props.column,
58
- actionRef = props.actionRef;
36
+ actionRef = props.actionRef,
37
+ switchCardView = props.switchCardView,
38
+ bindUrlProps = props.bindUrlProps,
39
+ bindUrl = props.bindUrl;
59
40
  var _column$filtersWidth = column.filtersWidth,
60
- filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth; // 选中过滤项
61
-
62
- var _useState = (0, _react.useState)([]),
63
- _useState2 = _slicedToArray(_useState, 2),
64
- selected = _useState2[0],
65
- setSelected = _useState2[1];
66
-
41
+ filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth;
42
+ var _ref = bindUrl ? (0, _hooks.useUrlState)() : [],
43
+ _ref2 = _slicedToArray(_ref, 2),
44
+ urlState = _ref2[0],
45
+ setUrlState = _ref2[1];
46
+ // 选中过滤项
47
+ var _useState = (0, _react.useState)((_urlState$split = urlState === null || urlState === void 0 ? void 0 : (_urlState = urlState["filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex)]) === null || _urlState === void 0 ? void 0 : (_urlState$split2 = _urlState.split) === null || _urlState$split2 === void 0 ? void 0 : _urlState$split2.call(_urlState, ',')) !== null && _urlState$split !== void 0 ? _urlState$split : []),
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ selected = _useState2[0],
50
+ setSelected = _useState2[1];
67
51
  var _useState3 = (0, _react.useState)(false),
68
- _useState4 = _slicedToArray(_useState3, 2),
69
- visible = _useState4[0],
70
- setVisible = _useState4[1];
71
-
52
+ _useState4 = _slicedToArray(_useState3, 2),
53
+ visible = _useState4[0],
54
+ setVisible = _useState4[1];
72
55
  (0, _react.useEffect)(function () {
73
56
  var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4, _actionRef$current$ge5;
74
-
75
57
  // 从全局状态中读取上次存储的条件
76
58
  var rules = (_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$ge3 = _actionRef$current$ge2.call(_actionRef$current)) === null || _actionRef$current$ge3 === void 0 ? void 0 : (_actionRef$current$ge4 = _actionRef$current$ge3.filterRules) === null || _actionRef$current$ge4 === void 0 ? void 0 : (_actionRef$current$ge5 = _actionRef$current$ge4[column.dataIndex]) === null || _actionRef$current$ge5 === void 0 ? void 0 : _actionRef$current$ge5.rules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : [];
77
- setSelected(rules);
78
- }, []); // 获取过滤项
79
-
59
+ // 全局状态中需要有值才赋值。优先级:全局状态 > urlState
60
+ if (rules && rules.length > 0) {
61
+ setSelected(rules);
62
+ }
63
+ }, []);
64
+ // 获取过滤项
80
65
  var filters = (0, _react.useMemo)(function () {
81
66
  if (Array.isArray(column.filters)) {
82
67
  return column.filters;
83
68
  }
84
-
85
- var filters = column.dataSource; // 转换 valueEnum 为 options
86
-
69
+ var filters = column.dataSource;
70
+ // 转换 valueEnum 为 options
87
71
  if (!Array.isArray(column.dataSource)) {
88
- filters = Object.entries(column.dataSource).map(function (_ref) {
72
+ filters = Object.entries(column.dataSource).map(function (_ref3) {
89
73
  var _nv$label, _nv$color;
90
-
91
- var _ref2 = _slicedToArray(_ref, 2),
92
- k = _ref2[0],
93
- v = _ref2[1];
94
-
74
+ var _ref4 = _slicedToArray(_ref3, 2),
75
+ k = _ref4[0],
76
+ v = _ref4[1];
95
77
  var nv = v;
96
78
  return _objectSpread(_objectSpread({
97
79
  value: k
@@ -100,18 +82,82 @@ var Filter = function Filter(props) {
100
82
  color: (_nv$color = nv.color) !== null && _nv$color !== void 0 ? _nv$color : k
101
83
  });
102
84
  });
103
- } // console.log(filters);
104
-
105
-
85
+ }
86
+ // console.log(filters);
106
87
  return filters;
107
- }, []); // 渲染单选
108
-
88
+ }, []);
89
+ // 点击确定回调
90
+ var onFilterOk = function onFilterOk() {
91
+ var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$r, _actionRef$current9, _actionRef$current9$c;
92
+ (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex);
93
+ // 先获取此列的param
94
+ var param = '';
95
+ if (column.beforeFilter) {
96
+ var _column$beforeFilter;
97
+ param = (_column$beforeFilter = column.beforeFilter) === null || _column$beforeFilter === void 0 ? void 0 : _column$beforeFilter.call(column, selected);
98
+ } else {
99
+ param = selected.join(',');
100
+ }
101
+ // 需要带上其他所有的信息
102
+ var rules = (_actionRef$current$ge6 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {};
103
+ // 再设置所有的列筛选状态
104
+ (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
105
+ rules: selected,
106
+ params: param
107
+ })));
108
+ var targetPageKey = 'currentPage';
109
+ var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
110
+ if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
111
+ targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
112
+ }
113
+ if (switchCardView === 'card') {
114
+ var _actionRef$current6, _actionRef$current6$s;
115
+ (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$s = _actionRef$current6.setData) === null || _actionRef$current6$s === void 0 ? void 0 : _actionRef$current6$s.call(_actionRef$current6, []);
116
+ }
117
+ // 发送请求
118
+ (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.request) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7, _defineProperty({}, targetPageKey, 1));
119
+ (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$r = _actionRef$current8.resetPage) === null || _actionRef$current8$r === void 0 ? void 0 : _actionRef$current8$r.call(_actionRef$current8);
120
+ // 清空表格选择
121
+ (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$c = _actionRef$current9.clearRowSelection) === null || _actionRef$current9$c === void 0 ? void 0 : _actionRef$current9$c.call(_actionRef$current9);
122
+ setVisible(false);
123
+ // 设置 url
124
+ if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && (urlState === null || urlState === void 0 ? void 0 : urlState["filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex)]) !== selected.join(',')) {
125
+ setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState(_defineProperty({}, "filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex), selected.join(',')));
126
+ }
127
+ };
128
+ // 重置回调
129
+ var onFilterReset = function onFilterReset() {
130
+ var _actionRef$current$ge7, _actionRef$current10, _actionRef$current10$, _actionRef$current10$2, _actionRef$current11, _actionRef$current11$, _actionRef$current12, _actionRef$current12$;
131
+ setSelected([]);
132
+ var rules = (_actionRef$current$ge7 = (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.getState) === null || _actionRef$current10$ === void 0 ? void 0 : (_actionRef$current10$2 = _actionRef$current10$.call(_actionRef$current10)) === null || _actionRef$current10$2 === void 0 ? void 0 : _actionRef$current10$2.filterRules) !== null && _actionRef$current$ge7 !== void 0 ? _actionRef$current$ge7 : {};
133
+ (_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.setFilterRules) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
134
+ rules: [],
135
+ params: ''
136
+ })));
137
+ (_actionRef$current12 = actionRef.current) === null || _actionRef$current12 === void 0 ? void 0 : (_actionRef$current12$ = _actionRef$current12.filterDataSource) === null || _actionRef$current12$ === void 0 ? void 0 : _actionRef$current12$.call(_actionRef$current12, column.dataIndex);
138
+ if (selected.length > 0) {
139
+ var _actionRef$current13, _actionRef$current14, _actionRef$current14$, _actionRef$current15, _actionRef$current15$, _actionRef$current16, _actionRef$current16$;
140
+ var targetPageKey = 'currentPage';
141
+ var pageInfo = (_actionRef$current13 = actionRef.current) === null || _actionRef$current13 === void 0 ? void 0 : _actionRef$current13.pageInfo;
142
+ if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
143
+ targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
144
+ }
145
+ // 发送请求
146
+ (_actionRef$current14 = actionRef.current) === null || _actionRef$current14 === void 0 ? void 0 : (_actionRef$current14$ = _actionRef$current14.request) === null || _actionRef$current14$ === void 0 ? void 0 : _actionRef$current14$.call(_actionRef$current14, _defineProperty({}, targetPageKey, 1));
147
+ (_actionRef$current15 = actionRef.current) === null || _actionRef$current15 === void 0 ? void 0 : (_actionRef$current15$ = _actionRef$current15.resetPage) === null || _actionRef$current15$ === void 0 ? void 0 : _actionRef$current15$.call(_actionRef$current15);
148
+ // 清空表格选择
149
+ (_actionRef$current16 = actionRef.current) === null || _actionRef$current16 === void 0 ? void 0 : (_actionRef$current16$ = _actionRef$current16.clearRowSelection) === null || _actionRef$current16$ === void 0 ? void 0 : _actionRef$current16$.call(_actionRef$current16);
150
+ if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false) {
151
+ setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState(_defineProperty({}, "filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex), undefined));
152
+ }
153
+ }
154
+ };
155
+ // 渲染单选
109
156
  var renderSingle = function renderSingle() {
110
- return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref3) {
157
+ return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref5) {
111
158
  var _value$toString;
112
-
113
- var label = _ref3.label,
114
- value = _ref3.value;
159
+ var label = _ref5.label,
160
+ value = _ref5.value;
115
161
  var valueStr = (_value$toString = value === null || value === void 0 ? void 0 : value.toString()) !== null && _value$toString !== void 0 ? _value$toString : '';
116
162
  return /*#__PURE__*/_react.default.createElement(RadioItem, {
117
163
  id: valueStr,
@@ -122,15 +168,13 @@ var Filter = function Filter(props) {
122
168
  }
123
169
  }, label);
124
170
  });
125
- }; // 渲染多选
126
-
127
-
171
+ };
172
+ // 渲染多选
128
173
  var renderMultiple = function renderMultiple() {
129
- return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref4) {
174
+ return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref6) {
130
175
  var _value$toString2;
131
-
132
- var label = _ref4.label,
133
- value = _ref4.value;
176
+ var label = _ref6.label,
177
+ value = _ref6.value;
134
178
  var valueStr = (_value$toString2 = value === null || value === void 0 ? void 0 : value.toString()) !== null && _value$toString2 !== void 0 ? _value$toString2 : '';
135
179
  return /*#__PURE__*/_react.default.createElement(CheckboxItem, {
136
180
  key: valueStr,
@@ -146,17 +190,14 @@ var Filter = function Filter(props) {
146
190
  }
147
191
  }, label);
148
192
  });
149
- }; // 渲染选择区域
150
-
151
-
193
+ };
194
+ // 渲染选择区域
152
195
  var renderSelect = function renderSelect() {
153
196
  if (column.filterMode === 'multiple') {
154
197
  return renderMultiple();
155
198
  }
156
-
157
199
  return renderSingle();
158
200
  };
159
-
160
201
  return /*#__PURE__*/_react.default.createElement(_components.Dropdown, {
161
202
  trigger: /*#__PURE__*/_react.default.createElement(_icon.default, {
162
203
  size: "small",
@@ -190,79 +231,15 @@ var Filter = function Filter(props) {
190
231
  className: cls({
191
232
  btn: true
192
233
  }),
193
- onClick: function onClick() {
194
- var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$current6, _actionRef$current6$r, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$c;
195
-
196
- (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
197
-
198
- var param = '';
199
-
200
- if (column.beforeFilter) {
201
- var _column$beforeFilter;
202
-
203
- param = (_column$beforeFilter = column.beforeFilter) === null || _column$beforeFilter === void 0 ? void 0 : _column$beforeFilter.call(column, selected);
204
- } else {
205
- param = selected.join(',');
206
- } // 需要带上其他所有的信息
207
-
208
-
209
- var rules = (_actionRef$current$ge6 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {}; // 再设置所有的列筛选状态
210
-
211
- (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
212
- rules: selected,
213
- params: param
214
- })));
215
- var targetPageKey = 'currentPage';
216
- var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
217
-
218
- if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
219
- targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
220
- } // 发送请求
221
-
222
-
223
- (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _defineProperty({}, targetPageKey, 1));
224
- (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7); // 清空表格选择
225
-
226
- (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
227
- setVisible(false);
228
- }
234
+ onClick: onFilterOk
229
235
  }, (0, _utils.getMessage)('ok')), /*#__PURE__*/_react.default.createElement(_components.Button, {
230
236
  type: "normal",
231
237
  size: "small",
232
238
  className: cls({
233
239
  btn: true
234
240
  }),
235
- onClick: function onClick() {
236
- var _actionRef$current$ge7, _actionRef$current9, _actionRef$current9$g, _actionRef$current9$g2, _actionRef$current10, _actionRef$current10$, _actionRef$current11, _actionRef$current11$;
237
-
238
- setSelected([]);
239
- var rules = (_actionRef$current$ge7 = (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$g = _actionRef$current9.getState) === null || _actionRef$current9$g === void 0 ? void 0 : (_actionRef$current9$g2 = _actionRef$current9$g.call(_actionRef$current9)) === null || _actionRef$current9$g2 === void 0 ? void 0 : _actionRef$current9$g2.filterRules) !== null && _actionRef$current$ge7 !== void 0 ? _actionRef$current$ge7 : {};
240
- (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.setFilterRules) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
241
- rules: [],
242
- params: ''
243
- })));
244
- (_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.filterDataSource) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11, column.dataIndex);
245
-
246
- if (selected.length > 0) {
247
- var _actionRef$current12, _actionRef$current13, _actionRef$current13$, _actionRef$current14, _actionRef$current14$, _actionRef$current15, _actionRef$current15$;
248
-
249
- var targetPageKey = 'currentPage';
250
- var pageInfo = (_actionRef$current12 = actionRef.current) === null || _actionRef$current12 === void 0 ? void 0 : _actionRef$current12.pageInfo;
251
-
252
- if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
253
- targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
254
- } // 发送请求
255
-
256
-
257
- (_actionRef$current13 = actionRef.current) === null || _actionRef$current13 === void 0 ? void 0 : (_actionRef$current13$ = _actionRef$current13.request) === null || _actionRef$current13$ === void 0 ? void 0 : _actionRef$current13$.call(_actionRef$current13, _defineProperty({}, targetPageKey, 1));
258
- (_actionRef$current14 = actionRef.current) === null || _actionRef$current14 === void 0 ? void 0 : (_actionRef$current14$ = _actionRef$current14.resetPage) === null || _actionRef$current14$ === void 0 ? void 0 : _actionRef$current14$.call(_actionRef$current14); // 清空表格选择
259
-
260
- (_actionRef$current15 = actionRef.current) === null || _actionRef$current15 === void 0 ? void 0 : (_actionRef$current15$ = _actionRef$current15.clearRowSelection) === null || _actionRef$current15$ === void 0 ? void 0 : _actionRef$current15$.call(_actionRef$current15);
261
- } // setVisible(!visible);
262
-
263
- }
241
+ onClick: onFilterReset
264
242
  }, (0, _utils.getMessage)('reset'))))));
265
243
  };
266
-
267
- var _default = Filter;
244
+ var _default = /*#__PURE__*/(0, _react.memo)(Filter);
268
245
  exports.default = _default;
@@ -4,72 +4,51 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _utils = require("@teamix/utils");
11
-
12
9
  var _field = require("../../../field");
13
-
14
10
  var _actions = require("../../../actions");
15
-
16
11
  var _form = require("../../../form");
17
-
18
12
  var _ToolBar = _interopRequireDefault(require("../ToolBar"));
19
-
20
13
  var _QuickAction = _interopRequireDefault(require("../QuickAction"));
21
-
22
14
  require("./index.scss");
23
-
24
- var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterFormRef", "afterDataFilter", "rowSelection", "toolBar"];
25
-
15
+ var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterFormRef", "afterDataFilter", "rowSelection", "toolBar", "dataTeamixSpm", "bindUrl", "bindUrlProps"];
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
19
  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; }
33
-
34
20
  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; }
35
-
36
21
  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; }
37
-
38
22
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
39
-
40
23
  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; }
41
-
42
24
  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; }
43
-
44
25
  var cls = (0, _utils.usePrefixCls)('teamix-pro-table-layout');
45
-
46
26
  var Layout = function Layout(props) {
47
27
  var header = props.header,
48
- mainAction = props.mainAction,
49
- extra = props.extra,
50
- actionRef = props.actionRef,
51
- dataFilter = props.dataFilter,
52
- dataFilterFormRef = props.dataFilterFormRef,
53
- afterDataFilter = props.afterDataFilter,
54
- rowSelection = props.rowSelection,
55
- toolBar = props.toolBar,
56
- otherProps = _objectWithoutProperties(props, _excluded); // 渲染主操作区
57
-
58
-
28
+ mainAction = props.mainAction,
29
+ extra = props.extra,
30
+ actionRef = props.actionRef,
31
+ dataFilter = props.dataFilter,
32
+ dataFilterFormRef = props.dataFilterFormRef,
33
+ afterDataFilter = props.afterDataFilter,
34
+ rowSelection = props.rowSelection,
35
+ toolBar = props.toolBar,
36
+ dataTeamixSpm = props.dataTeamixSpm,
37
+ bindUrl = props.bindUrl,
38
+ bindUrlProps = props.bindUrlProps,
39
+ otherProps = _objectWithoutProperties(props, _excluded);
40
+ // 渲染主操作区
59
41
  var renderMainAction = function renderMainAction() {
60
42
  var _mainAction$actions;
61
-
62
43
  if (_typeof(mainAction) === 'object' && (mainAction === null || mainAction === void 0 ? void 0 : (_mainAction$actions = mainAction.actions) === null || _mainAction$actions === void 0 ? void 0 : _mainAction$actions.length) > 0) {
63
44
  // 判断 actions 是否 visible 都为 false,是的话也不渲染
64
45
  var isEmptyActions = mainAction === null || mainAction === void 0 ? void 0 : mainAction.actions.every(function (action) {
65
46
  return (action === null || action === void 0 ? void 0 : action.visible) === false;
66
47
  });
67
-
68
48
  if (isEmptyActions) {
69
49
  return;
70
- } // 默认 context
71
-
72
-
50
+ }
51
+ // 默认 context
73
52
  var defaultContext = {
74
53
  action: actionRef.current,
75
54
  rowSelection: rowSelection
@@ -77,12 +56,12 @@ var Layout = function Layout(props) {
77
56
  return /*#__PURE__*/_react.default.createElement("div", {
78
57
  className: cls('main-action')
79
58
  }, /*#__PURE__*/_react.default.createElement(_actions.ProActionGroup, _objectSpread(_objectSpread({}, mainAction), {}, {
80
- context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context)
59
+ context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context),
60
+ "data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-mainAction") : undefined
81
61
  })));
82
62
  } else return mainAction;
83
- }; // 渲染 addonAfter
84
-
85
-
63
+ };
64
+ // 渲染 addonAfter
86
65
  var renderAddonAfter = function renderAddonAfter() {
87
66
  return /*#__PURE__*/_react.default.createElement("div", {
88
67
  className: cls('addon-after-wrapper')
@@ -94,15 +73,12 @@ var Layout = function Layout(props) {
94
73
  actionRef: actionRef,
95
74
  toolBar: toolBar
96
75
  }, otherProps)));
97
- }; // 渲染新版 QueryFilter
98
-
99
-
76
+ };
77
+ // 渲染新版 QueryFilter
100
78
  var renderQueryFilter = function renderQueryFilter() {
101
79
  var _dataFilter$schema;
102
-
103
80
  if (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) {
104
81
  var _dataFilter$schema2;
105
-
106
82
  if ( /*#__PURE__*/(0, _react.isValidElement)(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content)) {
107
83
  // 自定义渲染内容
108
84
  return /*#__PURE__*/_react.default.createElement(_form.QueryFilterLayout, _objectSpread({
@@ -110,11 +86,12 @@ var Layout = function Layout(props) {
110
86
  // 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
111
87
  setTimeout(function () {
112
88
  var _actionRef$current, _actionRef$current$re;
113
-
114
89
  // if (actionRef.current?.getState?.().fullScreenState) {
115
90
  // 偏移量8像素为面板展开后的下margin
116
- (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.resetTableMaxBodyHeight) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current, expand ? 8 : 0); // }
91
+ (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.resetTableMaxBodyHeight) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current, expand ? 8 : 0);
92
+ // }
117
93
  });
94
+
118
95
  (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
119
96
  },
120
97
  panelContent: dataFilter.content,
@@ -128,15 +105,17 @@ var Layout = function Layout(props) {
128
105
  // 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
129
106
  setTimeout(function () {
130
107
  var _actionRef$current2, _actionRef$current2$r;
131
-
132
108
  // if (actionRef.current?.getState?.().fullScreenState) {
133
109
  // 偏移量8像素为面板展开后的下margin
134
- (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2, expand ? 8 : 0); // }
110
+ (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2, expand ? 8 : 0);
111
+ // }
135
112
  });
113
+
136
114
  (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
137
115
  },
138
116
  addonBefore: renderMainAction(),
139
- addonAfter: renderAddonAfter()
117
+ addonAfter: renderAddonAfter(),
118
+ bindUrl: bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.filters) !== false
140
119
  }, dataFilter)), afterDataFilter && /*#__PURE__*/_react.default.createElement("div", {
141
120
  className: "mb8 ".concat(cls('after-data-filter-wrapper'))
142
121
  }, afterDataFilter));
@@ -158,9 +137,8 @@ var Layout = function Layout(props) {
158
137
  }, afterDataFilter) : null
159
138
  }));
160
139
  }
161
- }; // 区域组合渲染
162
-
163
-
140
+ };
141
+ // 区域组合渲染
164
142
  var renderLayout = function renderLayout() {
165
143
  if (header && mainAction) {
166
144
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
@@ -176,7 +154,6 @@ var Layout = function Layout(props) {
176
154
  }))), renderQueryFilter());
177
155
  } else if (header && !mainAction) {
178
156
  var _dataFilter$schema3, _dataFilter$schema4;
179
-
180
157
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
181
158
  className: cls('wrapper')
182
159
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -194,20 +171,15 @@ var Layout = function Layout(props) {
194
171
  if (!dataFilterFormRef && !extra) {
195
172
  return null;
196
173
  }
197
-
198
174
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderQueryFilter());
199
175
  }
200
176
  };
201
-
202
177
  if ((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.schema) || mainAction || header || extra || toolBar !== false) {
203
178
  return /*#__PURE__*/_react.default.createElement("div", {
204
179
  className: cls()
205
180
  }, renderLayout());
206
181
  }
207
-
208
182
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
209
183
  };
210
-
211
184
  var _default = /*#__PURE__*/_react.default.memo(Layout);
212
-
213
185
  exports.default = _default;
@@ -1,7 +1,7 @@
1
1
  $prefix: 'teamix-pro-table-layout';
2
2
 
3
3
  .theme-hybridcloud-dark {
4
- --panel-filter-bg: #1f1f1f;
4
+ --panel-filter-bg: #141414;
5
5
  }
6
6
 
7
7
  .#{$prefix} {
@@ -43,5 +43,6 @@ $prefix: 'teamix-pro-table-layout';
43
43
  &-addon-after-wrapper {
44
44
  display: flex;
45
45
  align-items: center;
46
+ margin-bottom: 8px;
46
47
  }
47
48
  }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ export declare type LoadMoreProps = {
4
+ /** 内容 **/
5
+ children?: React.ReactNode;
6
+ /** 加载状态 受控 **/
7
+ loadState?: 'loading' | 'loadMore' | 'noMore' | 'none';
8
+ /** 滚动条滚动到底部触发事件 **/
9
+ onScrollBottom?: () => void;
10
+ /** 加载状态改变回调 **/
11
+ onChangeLoadState?: (state: LoadMoreProps['loadState']) => void;
12
+ /** 点击加载更多回调 **/
13
+ onLoadMore?: () => void;
14
+ /** 滚动区域高度 **/
15
+ scrollHeight?: number | string;
16
+ /** 当前滚动区域位置 **/
17
+ scrollPosition?: number;
18
+ };
19
+ declare const LoadMore: React.FC<LoadMoreProps>;
20
+ export default LoadMore;