@teamix/pro 1.1.3 → 1.1.7

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 (445) hide show
  1. package/README.md +97 -0
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +1198 -1228
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/dist/pro.min.js.LICENSE.txt +1 -1
  7. package/es/actions/base.d.ts +13 -0
  8. package/es/actions/base.js +23 -0
  9. package/es/actions/confirm.d.ts +7 -0
  10. package/es/actions/confirm.js +11 -0
  11. package/es/actions/danger-confirm.d.ts +7 -0
  12. package/es/actions/danger-confirm.js +14 -0
  13. package/es/actions/dialog-component.d.ts +10 -0
  14. package/es/actions/dialog-component.js +25 -0
  15. package/es/actions/dialog-form.d.ts +15 -0
  16. package/es/actions/dialog-form.js +129 -0
  17. package/es/actions/dialog-table.d.ts +9 -0
  18. package/es/actions/dialog-table.js +10 -0
  19. package/es/actions/dialog.d.ts +17 -0
  20. package/es/actions/dialog.js +197 -0
  21. package/es/actions/drawer-form.d.ts +6 -0
  22. package/es/actions/drawer-form.js +7 -0
  23. package/es/actions/drawer-table.d.ts +6 -0
  24. package/es/actions/drawer-table.js +7 -0
  25. package/es/actions/drawer.d.ts +6 -0
  26. package/es/actions/drawer.js +7 -0
  27. package/es/actions/error.d.ts +7 -0
  28. package/es/actions/error.js +11 -0
  29. package/es/actions/index.d.ts +71 -0
  30. package/es/actions/index.js +337 -0
  31. package/es/actions/index.scss +34 -0
  32. package/es/actions/link.d.ts +14 -0
  33. package/es/actions/link.js +45 -0
  34. package/es/actions/notice.d.ts +7 -0
  35. package/es/actions/notice.js +11 -0
  36. package/es/actions/request.d.ts +9 -0
  37. package/es/actions/request.js +60 -0
  38. package/es/card/index.d.ts +47 -0
  39. package/es/card/index.js +159 -0
  40. package/es/card/index.scss +98 -0
  41. package/es/field/index.d.ts +3 -0
  42. package/es/field/index.js +3 -0
  43. package/es/form/Components/Editable/index.d.ts +20 -0
  44. package/es/form/Components/Editable/index.js +228 -0
  45. package/es/form/Components/FormGroup/index.d.ts +13 -0
  46. package/es/form/Components/FormGroup/index.js +89 -0
  47. package/es/form/Components/FormGroup/index.scss +23 -0
  48. package/es/form/Components/ProField/index.d.ts +150 -0
  49. package/es/form/Components/ProField/index.js +53 -0
  50. package/es/form/Components/Query/index.d.ts +4 -0
  51. package/es/form/Components/Query/index.js +70 -0
  52. package/es/form/Components/Query/index.scss +90 -0
  53. package/es/form/Components/QueryFilter/index.d.ts +3 -0
  54. package/es/form/Components/QueryFilter/index.js +111 -0
  55. package/es/form/Components/Search/index.d.ts +11 -0
  56. package/es/form/Components/Search/index.js +89 -0
  57. package/es/form/Filter/index.d.ts +16 -0
  58. package/es/form/Filter/index.js +218 -0
  59. package/es/form/ProForm/index.d.ts +5 -0
  60. package/es/form/ProForm/index.js +100 -0
  61. package/es/form/ProForm/index.scss +254 -0
  62. package/es/form/SchemaForm/adapterComponent.d.ts +5 -0
  63. package/es/form/SchemaForm/adapterComponent.js +17 -0
  64. package/es/form/SchemaForm/adapterDecorator.d.ts +6 -0
  65. package/es/form/SchemaForm/adapterDecorator.js +28 -0
  66. package/es/form/SchemaForm/adapterType.d.ts +5 -0
  67. package/es/form/SchemaForm/adapterType.js +52 -0
  68. package/es/form/SchemaForm/index.d.ts +4 -0
  69. package/es/form/SchemaForm/index.js +259 -0
  70. package/es/form/SchemaForm/initializeArrayCards.d.ts +3 -0
  71. package/es/form/SchemaForm/initializeArrayCards.js +24 -0
  72. package/es/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
  73. package/es/form/SchemaForm/initializeArrayCollapse.js +24 -0
  74. package/es/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
  75. package/es/form/SchemaForm/initializeArrayIcon.js +57 -0
  76. package/es/form/SchemaForm/initializeArrayItems.d.ts +3 -0
  77. package/es/form/SchemaForm/initializeArrayItems.js +38 -0
  78. package/es/form/SchemaForm/initializeArrayTable.d.ts +3 -0
  79. package/es/form/SchemaForm/initializeArrayTable.js +56 -0
  80. package/es/form/SchemaForm/initializeFormButton.d.ts +3 -0
  81. package/es/form/SchemaForm/initializeFormButton.js +75 -0
  82. package/es/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
  83. package/es/form/SchemaForm/initializeFormCollapse.js +43 -0
  84. package/es/form/SchemaForm/initializeFormGroup.d.ts +3 -0
  85. package/es/form/SchemaForm/initializeFormGroup.js +46 -0
  86. package/es/form/SchemaForm/initializeFormStep.d.ts +3 -0
  87. package/es/form/SchemaForm/initializeFormStep.js +48 -0
  88. package/es/form/SchemaForm/initializeFormTab.d.ts +3 -0
  89. package/es/form/SchemaForm/initializeFormTab.js +53 -0
  90. package/es/form/SchemaForm/initializeProField.d.ts +5 -0
  91. package/es/form/SchemaForm/initializeProField.js +67 -0
  92. package/es/form/SchemaForm/initializeRequest.d.ts +11 -0
  93. package/es/form/SchemaForm/initializeRequest.js +25 -0
  94. package/es/form/SchemaForm/reactions.d.ts +4 -0
  95. package/es/form/SchemaForm/reactions.js +62 -0
  96. package/es/form/index.d.ts +27 -0
  97. package/es/form/index.js +35 -0
  98. package/es/form/typing.d.ts +69 -0
  99. package/es/form/typing.js +1 -0
  100. package/es/form/utils.d.ts +9 -0
  101. package/es/form/utils.js +108 -0
  102. package/es/form/warning.d.ts +3 -0
  103. package/es/form/warning.js +16 -0
  104. package/es/hooks/index.d.ts +2 -0
  105. package/es/hooks/index.js +2 -0
  106. package/es/index.d.ts +24 -0
  107. package/es/index.js +29 -0
  108. package/es/info/components/FormItem/index.d.ts +5 -0
  109. package/es/info/components/FormItem/index.js +63 -0
  110. package/es/info/components/FormItem/index.scss +60 -0
  111. package/es/info/components/InfoGroup/index.d.ts +5 -0
  112. package/es/info/components/InfoGroup/index.js +47 -0
  113. package/es/info/components/InfoGroup/index.scss +14 -0
  114. package/es/info/components/InfoValueItem/index.d.ts +5 -0
  115. package/es/info/components/InfoValueItem/index.js +223 -0
  116. package/es/info/components/InfoValueItem/index.scss +21 -0
  117. package/es/info/components/baseInfo/index.d.ts +7 -0
  118. package/es/info/components/baseInfo/index.js +73 -0
  119. package/es/info/components/baseInfo/index.scss +3 -0
  120. package/es/info/components/headerInfo/index.d.ts +7 -0
  121. package/es/info/components/headerInfo/index.js +85 -0
  122. package/es/info/components/headerInfo/index.scss +0 -0
  123. package/es/info/components/tableInfo/index.d.ts +8 -0
  124. package/es/info/components/tableInfo/index.js +175 -0
  125. package/es/info/components/tableInfo/index.scss +18 -0
  126. package/es/info/index.d.ts +10 -0
  127. package/es/info/index.js +87 -0
  128. package/es/info/index.scss +12 -0
  129. package/es/info/typing.d.ts +157 -0
  130. package/es/info/typing.js +1 -0
  131. package/es/info/utils/index.d.ts +12 -0
  132. package/es/info/utils/index.js +33 -0
  133. package/es/info/utils/layout.d.ts +2 -0
  134. package/es/info/utils/layout.js +58 -0
  135. package/es/info/utils/useInfoRequest.d.ts +14 -0
  136. package/es/info/utils/useInfoRequest.js +73 -0
  137. package/es/info/utils/utils.d.ts +1 -0
  138. package/es/info/utils/utils.js +13 -0
  139. package/es/layout/index.d.ts +2 -0
  140. package/es/layout/index.js +3 -0
  141. package/es/nocode/configurators/Card.d.ts +3 -0
  142. package/es/nocode/configurators/Card.js +109 -0
  143. package/es/nocode/configurators/PageHeader.d.ts +3 -0
  144. package/es/nocode/configurators/PageHeader.js +202 -0
  145. package/es/nocode/configurators/ProTable.d.ts +3 -0
  146. package/es/nocode/configurators/ProTable.js +320 -0
  147. package/es/nocode/configurators/common.d.ts +188 -0
  148. package/es/nocode/configurators/common.js +318 -0
  149. package/es/nocode/configurators/index.d.ts +15 -0
  150. package/es/nocode/configurators/index.js +27 -0
  151. package/es/nocode/configurators/map.d.ts +2 -0
  152. package/es/nocode/configurators/map.js +8 -0
  153. package/es/nocode/index.d.ts +8 -0
  154. package/es/nocode/index.js +11 -0
  155. package/es/nocode/index.scss +93 -0
  156. package/es/nocode/pages/editor.d.ts +12 -0
  157. package/es/nocode/pages/editor.js +40 -0
  158. package/es/nocode/pages/index.d.ts +14 -0
  159. package/es/nocode/pages/index.js +41 -0
  160. package/es/nocode/pages/playground.d.ts +11 -0
  161. package/es/nocode/pages/playground.js +130 -0
  162. package/es/nocode/pages/renderer.d.ts +10 -0
  163. package/es/nocode/pages/renderer.js +144 -0
  164. package/es/nocode/playground.d.ts +14 -0
  165. package/es/nocode/playground.js +68 -0
  166. package/es/page-container/index.d.ts +3 -0
  167. package/es/page-container/index.js +3 -0
  168. package/es/page-header/index.d.ts +43 -0
  169. package/es/page-header/index.js +233 -0
  170. package/es/page-header/index.scss +169 -0
  171. package/es/skeleton/index.d.ts +3 -0
  172. package/es/skeleton/index.js +3 -0
  173. package/es/table/components/Filter/index.d.ts +9 -0
  174. package/es/table/components/Filter/index.js +223 -0
  175. package/es/table/components/Filter/index.scss +23 -0
  176. package/es/table/components/Layout/index.d.ts +5 -0
  177. package/es/table/components/Layout/index.js +242 -0
  178. package/es/table/components/Layout/index.scss +39 -0
  179. package/es/table/components/QuickAction/index.d.ts +10 -0
  180. package/es/table/components/QuickAction/index.js +53 -0
  181. package/es/table/components/QuickAction/index.scss +0 -0
  182. package/es/table/components/ToolBar/DensityIcon.d.ts +4 -0
  183. package/es/table/components/ToolBar/DensityIcon.js +117 -0
  184. package/es/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
  185. package/es/table/components/ToolBar/FilterColumnIcon.js +284 -0
  186. package/es/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
  187. package/es/table/components/ToolBar/FullScreenIcon.js +89 -0
  188. package/es/table/components/ToolBar/Fullscreen.d.ts +10 -0
  189. package/es/table/components/ToolBar/Fullscreen.js +68 -0
  190. package/es/table/components/ToolBar/RefreshIcon.d.ts +4 -0
  191. package/es/table/components/ToolBar/RefreshIcon.js +45 -0
  192. package/es/table/components/ToolBar/index.d.ts +5 -0
  193. package/es/table/components/ToolBar/index.js +79 -0
  194. package/es/table/components/ToolBar/index.scss +110 -0
  195. package/es/table/index.d.ts +6 -0
  196. package/es/table/index.js +607 -0
  197. package/es/table/index.scss +103 -0
  198. package/es/table/typing.d.ts +222 -0
  199. package/es/table/typing.js +1 -0
  200. package/es/table/utils/columnRender.d.ts +13 -0
  201. package/es/table/utils/columnRender.js +185 -0
  202. package/es/table/utils/genProColumnToColumn.d.ts +9 -0
  203. package/es/table/utils/genProColumnToColumn.js +51 -0
  204. package/es/table/utils/getTableProps.d.ts +2 -0
  205. package/es/table/utils/getTableProps.js +4 -0
  206. package/es/table/utils/getTableSortIcons.d.ts +3 -0
  207. package/es/table/utils/getTableSortIcons.js +21 -0
  208. package/es/table/utils/index.d.ts +4 -0
  209. package/es/table/utils/index.js +100 -0
  210. package/es/table/utils/useTableSelection.d.ts +3 -0
  211. package/es/table/utils/useTableSelection.js +107 -0
  212. package/es/templates/Detail/index.d.ts +2 -0
  213. package/es/templates/Detail/index.js +5 -0
  214. package/es/templates/Detail/index.scss +3 -0
  215. package/es/templates/Form/index.d.ts +2 -0
  216. package/es/templates/Form/index.js +5 -0
  217. package/es/templates/Form/index.scss +3 -0
  218. package/es/templates/List/index.d.ts +9 -0
  219. package/es/templates/List/index.js +45 -0
  220. package/es/templates/List/index.scss +3 -0
  221. package/es/templates/index.d.ts +5 -0
  222. package/es/templates/index.js +7 -0
  223. package/es/templates/index.scss +3 -0
  224. package/es/utils/index.d.ts +2 -0
  225. package/es/utils/index.js +2 -0
  226. package/lib/actions/base.d.ts +13 -0
  227. package/lib/actions/base.js +33 -0
  228. package/lib/actions/confirm.d.ts +7 -0
  229. package/lib/actions/confirm.js +25 -0
  230. package/lib/actions/danger-confirm.d.ts +7 -0
  231. package/lib/actions/danger-confirm.js +28 -0
  232. package/lib/actions/dialog-component.d.ts +10 -0
  233. package/lib/actions/dialog-component.js +39 -0
  234. package/lib/actions/dialog-form.d.ts +15 -0
  235. package/lib/actions/dialog-form.js +152 -0
  236. package/lib/actions/dialog-table.d.ts +9 -0
  237. package/lib/actions/dialog-table.js +24 -0
  238. package/lib/actions/dialog.d.ts +17 -0
  239. package/lib/actions/dialog.js +219 -0
  240. package/lib/actions/drawer-form.d.ts +6 -0
  241. package/lib/actions/drawer-form.js +18 -0
  242. package/lib/actions/drawer-table.d.ts +6 -0
  243. package/lib/actions/drawer-table.js +18 -0
  244. package/lib/actions/drawer.d.ts +6 -0
  245. package/lib/actions/drawer.js +20 -0
  246. package/lib/actions/error.d.ts +7 -0
  247. package/lib/actions/error.js +25 -0
  248. package/lib/actions/index.d.ts +71 -0
  249. package/lib/actions/index.js +380 -0
  250. package/lib/actions/index.scss +34 -0
  251. package/lib/actions/link.d.ts +14 -0
  252. package/lib/actions/link.js +60 -0
  253. package/lib/actions/notice.d.ts +7 -0
  254. package/lib/actions/notice.js +25 -0
  255. package/lib/actions/request.d.ts +9 -0
  256. package/lib/actions/request.js +75 -0
  257. package/lib/card/index.d.ts +47 -0
  258. package/lib/card/index.js +179 -0
  259. package/lib/card/index.scss +98 -0
  260. package/lib/field/index.d.ts +3 -0
  261. package/lib/field/index.js +30 -0
  262. package/lib/form/Components/Editable/index.d.ts +20 -0
  263. package/lib/form/Components/Editable/index.js +251 -0
  264. package/lib/form/Components/FormGroup/index.d.ts +13 -0
  265. package/lib/form/Components/FormGroup/index.js +103 -0
  266. package/lib/form/Components/FormGroup/index.scss +23 -0
  267. package/lib/form/Components/ProField/index.d.ts +150 -0
  268. package/lib/form/Components/ProField/index.js +68 -0
  269. package/lib/form/Components/Query/index.d.ts +4 -0
  270. package/lib/form/Components/Query/index.js +91 -0
  271. package/lib/form/Components/Query/index.scss +90 -0
  272. package/lib/form/Components/QueryFilter/index.d.ts +3 -0
  273. package/lib/form/Components/QueryFilter/index.js +130 -0
  274. package/lib/form/Components/Search/index.d.ts +11 -0
  275. package/lib/form/Components/Search/index.js +103 -0
  276. package/lib/form/Filter/index.d.ts +16 -0
  277. package/lib/form/Filter/index.js +242 -0
  278. package/lib/form/ProForm/index.d.ts +5 -0
  279. package/lib/form/ProForm/index.js +125 -0
  280. package/lib/form/ProForm/index.scss +254 -0
  281. package/lib/form/SchemaForm/adapterComponent.d.ts +5 -0
  282. package/lib/form/SchemaForm/adapterComponent.js +27 -0
  283. package/lib/form/SchemaForm/adapterDecorator.d.ts +6 -0
  284. package/lib/form/SchemaForm/adapterDecorator.js +34 -0
  285. package/lib/form/SchemaForm/adapterType.d.ts +5 -0
  286. package/lib/form/SchemaForm/adapterType.js +62 -0
  287. package/lib/form/SchemaForm/index.d.ts +4 -0
  288. package/lib/form/SchemaForm/index.js +302 -0
  289. package/lib/form/SchemaForm/initializeArrayCards.d.ts +3 -0
  290. package/lib/form/SchemaForm/initializeArrayCards.js +32 -0
  291. package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
  292. package/lib/form/SchemaForm/initializeArrayCollapse.js +32 -0
  293. package/lib/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
  294. package/lib/form/SchemaForm/initializeArrayIcon.js +68 -0
  295. package/lib/form/SchemaForm/initializeArrayItems.d.ts +3 -0
  296. package/lib/form/SchemaForm/initializeArrayItems.js +46 -0
  297. package/lib/form/SchemaForm/initializeArrayTable.d.ts +3 -0
  298. package/lib/form/SchemaForm/initializeArrayTable.js +63 -0
  299. package/lib/form/SchemaForm/initializeFormButton.d.ts +3 -0
  300. package/lib/form/SchemaForm/initializeFormButton.js +82 -0
  301. package/lib/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
  302. package/lib/form/SchemaForm/initializeFormCollapse.js +50 -0
  303. package/lib/form/SchemaForm/initializeFormGroup.d.ts +3 -0
  304. package/lib/form/SchemaForm/initializeFormGroup.js +53 -0
  305. package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -0
  306. package/lib/form/SchemaForm/initializeFormStep.js +55 -0
  307. package/lib/form/SchemaForm/initializeFormTab.d.ts +3 -0
  308. package/lib/form/SchemaForm/initializeFormTab.js +60 -0
  309. package/lib/form/SchemaForm/initializeProField.d.ts +5 -0
  310. package/lib/form/SchemaForm/initializeProField.js +74 -0
  311. package/lib/form/SchemaForm/initializeRequest.d.ts +11 -0
  312. package/lib/form/SchemaForm/initializeRequest.js +34 -0
  313. package/lib/form/SchemaForm/reactions.d.ts +4 -0
  314. package/lib/form/SchemaForm/reactions.js +72 -0
  315. package/lib/form/index.d.ts +27 -0
  316. package/lib/form/index.js +139 -0
  317. package/lib/form/typing.d.ts +69 -0
  318. package/lib/form/typing.js +5 -0
  319. package/lib/form/utils.d.ts +9 -0
  320. package/lib/form/utils.js +124 -0
  321. package/lib/form/warning.d.ts +3 -0
  322. package/lib/form/warning.js +24 -0
  323. package/lib/hooks/index.d.ts +2 -0
  324. package/lib/hooks/index.js +17 -0
  325. package/lib/index.d.ts +24 -0
  326. package/lib/index.js +244 -0
  327. package/lib/info/components/FormItem/index.d.ts +5 -0
  328. package/lib/info/components/FormItem/index.js +78 -0
  329. package/lib/info/components/FormItem/index.scss +60 -0
  330. package/lib/info/components/InfoGroup/index.d.ts +5 -0
  331. package/lib/info/components/InfoGroup/index.js +67 -0
  332. package/lib/info/components/InfoGroup/index.scss +14 -0
  333. package/lib/info/components/InfoValueItem/index.d.ts +5 -0
  334. package/lib/info/components/InfoValueItem/index.js +249 -0
  335. package/lib/info/components/InfoValueItem/index.scss +21 -0
  336. package/lib/info/components/baseInfo/index.d.ts +7 -0
  337. package/lib/info/components/baseInfo/index.js +100 -0
  338. package/lib/info/components/baseInfo/index.scss +3 -0
  339. package/lib/info/components/headerInfo/index.d.ts +7 -0
  340. package/lib/info/components/headerInfo/index.js +112 -0
  341. package/lib/info/components/headerInfo/index.scss +0 -0
  342. package/lib/info/components/tableInfo/index.d.ts +8 -0
  343. package/lib/info/components/tableInfo/index.js +197 -0
  344. package/lib/info/components/tableInfo/index.scss +18 -0
  345. package/lib/info/index.d.ts +10 -0
  346. package/lib/info/index.js +123 -0
  347. package/lib/info/index.scss +12 -0
  348. package/lib/info/typing.d.ts +157 -0
  349. package/lib/info/typing.js +5 -0
  350. package/lib/info/utils/index.d.ts +12 -0
  351. package/lib/info/utils/index.js +50 -0
  352. package/lib/info/utils/layout.d.ts +2 -0
  353. package/lib/info/utils/layout.js +65 -0
  354. package/lib/info/utils/useInfoRequest.d.ts +14 -0
  355. package/lib/info/utils/useInfoRequest.js +82 -0
  356. package/lib/info/utils/utils.d.ts +1 -0
  357. package/lib/info/utils/utils.js +20 -0
  358. package/lib/layout/index.d.ts +2 -0
  359. package/lib/layout/index.js +10 -0
  360. package/lib/nocode/configurators/Card.d.ts +3 -0
  361. package/lib/nocode/configurators/Card.js +116 -0
  362. package/lib/nocode/configurators/PageHeader.d.ts +3 -0
  363. package/lib/nocode/configurators/PageHeader.js +211 -0
  364. package/lib/nocode/configurators/ProTable.d.ts +3 -0
  365. package/lib/nocode/configurators/ProTable.js +329 -0
  366. package/lib/nocode/configurators/common.d.ts +188 -0
  367. package/lib/nocode/configurators/common.js +329 -0
  368. package/lib/nocode/configurators/index.d.ts +15 -0
  369. package/lib/nocode/configurators/index.js +44 -0
  370. package/lib/nocode/configurators/map.d.ts +2 -0
  371. package/lib/nocode/configurators/map.js +21 -0
  372. package/lib/nocode/index.d.ts +8 -0
  373. package/lib/nocode/index.js +76 -0
  374. package/lib/nocode/index.scss +93 -0
  375. package/lib/nocode/pages/editor.d.ts +12 -0
  376. package/lib/nocode/pages/editor.js +58 -0
  377. package/lib/nocode/pages/index.d.ts +14 -0
  378. package/lib/nocode/pages/index.js +93 -0
  379. package/lib/nocode/pages/playground.d.ts +11 -0
  380. package/lib/nocode/pages/playground.js +158 -0
  381. package/lib/nocode/pages/renderer.d.ts +10 -0
  382. package/lib/nocode/pages/renderer.js +164 -0
  383. package/lib/nocode/playground.d.ts +14 -0
  384. package/lib/nocode/playground.js +91 -0
  385. package/lib/page-container/index.d.ts +3 -0
  386. package/lib/page-container/index.js +30 -0
  387. package/lib/page-header/index.d.ts +43 -0
  388. package/lib/page-header/index.js +252 -0
  389. package/lib/page-header/index.scss +169 -0
  390. package/lib/skeleton/index.d.ts +3 -0
  391. package/lib/skeleton/index.js +30 -0
  392. package/lib/table/components/Filter/index.d.ts +9 -0
  393. package/lib/table/components/Filter/index.js +244 -0
  394. package/lib/table/components/Filter/index.scss +23 -0
  395. package/lib/table/components/Layout/index.d.ts +5 -0
  396. package/lib/table/components/Layout/index.js +266 -0
  397. package/lib/table/components/Layout/index.scss +39 -0
  398. package/lib/table/components/QuickAction/index.d.ts +10 -0
  399. package/lib/table/components/QuickAction/index.js +65 -0
  400. package/lib/table/components/QuickAction/index.scss +0 -0
  401. package/lib/table/components/ToolBar/DensityIcon.d.ts +4 -0
  402. package/lib/table/components/ToolBar/DensityIcon.js +135 -0
  403. package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
  404. package/lib/table/components/ToolBar/FilterColumnIcon.js +303 -0
  405. package/lib/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
  406. package/lib/table/components/ToolBar/FullScreenIcon.js +107 -0
  407. package/lib/table/components/ToolBar/Fullscreen.d.ts +10 -0
  408. package/lib/table/components/ToolBar/Fullscreen.js +85 -0
  409. package/lib/table/components/ToolBar/RefreshIcon.d.ts +4 -0
  410. package/lib/table/components/ToolBar/RefreshIcon.js +60 -0
  411. package/lib/table/components/ToolBar/index.d.ts +5 -0
  412. package/lib/table/components/ToolBar/index.js +96 -0
  413. package/lib/table/components/ToolBar/index.scss +110 -0
  414. package/lib/table/index.d.ts +6 -0
  415. package/lib/table/index.js +662 -0
  416. package/lib/table/index.scss +103 -0
  417. package/lib/table/typing.d.ts +222 -0
  418. package/lib/table/typing.js +5 -0
  419. package/lib/table/utils/columnRender.d.ts +13 -0
  420. package/lib/table/utils/columnRender.js +201 -0
  421. package/lib/table/utils/genProColumnToColumn.d.ts +9 -0
  422. package/lib/table/utils/genProColumnToColumn.js +62 -0
  423. package/lib/table/utils/getTableProps.d.ts +2 -0
  424. package/lib/table/utils/getTableProps.js +13 -0
  425. package/lib/table/utils/getTableSortIcons.d.ts +3 -0
  426. package/lib/table/utils/getTableSortIcons.js +34 -0
  427. package/lib/table/utils/index.d.ts +4 -0
  428. package/lib/table/utils/index.js +112 -0
  429. package/lib/table/utils/useTableSelection.d.ts +3 -0
  430. package/lib/table/utils/useTableSelection.js +112 -0
  431. package/lib/templates/Detail/index.d.ts +2 -0
  432. package/lib/templates/Detail/index.js +18 -0
  433. package/lib/templates/Detail/index.scss +3 -0
  434. package/lib/templates/Form/index.d.ts +2 -0
  435. package/lib/templates/Form/index.js +18 -0
  436. package/lib/templates/Form/index.scss +3 -0
  437. package/lib/templates/List/index.d.ts +9 -0
  438. package/lib/templates/List/index.js +67 -0
  439. package/lib/templates/List/index.scss +3 -0
  440. package/lib/templates/index.d.ts +5 -0
  441. package/lib/templates/index.js +59 -0
  442. package/lib/templates/index.scss +3 -0
  443. package/lib/utils/index.d.ts +2 -0
  444. package/lib/utils/index.js +17 -0
  445. package/package.json +5 -5
@@ -0,0 +1,662 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {};
7
+ exports.default = void 0;
8
+
9
+ var _react = _interopRequireWildcard(require("react"));
10
+
11
+ var _components = require("@alicloudfe/components");
12
+
13
+ var _genProColumnToColumn = _interopRequireDefault(require("./utils/genProColumnToColumn"));
14
+
15
+ var _utils = require("@teamix/utils");
16
+
17
+ var _skeleton = require("../skeleton");
18
+
19
+ require("./index.scss");
20
+
21
+ var _Layout = _interopRequireDefault(require("./components/Layout"));
22
+
23
+ var _utils2 = require("./utils");
24
+
25
+ var _getTableProps = _interopRequireDefault(require("./utils/getTableProps"));
26
+
27
+ var _getTableSortIcons = _interopRequireDefault(require("./utils/getTableSortIcons"));
28
+
29
+ var _useTableSelection = _interopRequireDefault(require("./utils/useTableSelection"));
30
+
31
+ var _Fullscreen = _interopRequireDefault(require("./components/ToolBar/Fullscreen"));
32
+
33
+ var _form = require("../form");
34
+
35
+ var _actions = require("../actions");
36
+
37
+ Object.keys(_actions).forEach(function (key) {
38
+ if (key === "default" || key === "__esModule") return;
39
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
40
+ if (key in exports && exports[key] === _actions[key]) return;
41
+ Object.defineProperty(exports, key, {
42
+ enumerable: true,
43
+ get: function get() {
44
+ return _actions[key];
45
+ }
46
+ });
47
+ });
48
+
49
+ var _lodash = _interopRequireDefault(require("lodash.debounce"));
50
+
51
+ var _classnames = _interopRequireDefault(require("classnames"));
52
+
53
+ var _typing = require("./typing");
54
+
55
+ Object.keys(_typing).forEach(function (key) {
56
+ if (key === "default" || key === "__esModule") return;
57
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
58
+ if (key in exports && exports[key] === _typing[key]) return;
59
+ Object.defineProperty(exports, key, {
60
+ enumerable: true,
61
+ get: function get() {
62
+ return _typing[key];
63
+ }
64
+ });
65
+ });
66
+
67
+ var _ahooks = require("ahooks");
68
+
69
+ var _excluded = ["header", "className", "tableClassName", "mainAction", "quickAction", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction"];
70
+
71
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
72
+
73
+ 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); }
74
+
75
+ 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; }
76
+
77
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
78
+
79
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
80
+
81
+ 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."); }
82
+
83
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
84
+
85
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
86
+
87
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
88
+
89
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
90
+
91
+ 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; }
92
+
93
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
94
+
95
+ 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."); }
96
+
97
+ 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); }
98
+
99
+ 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; }
100
+
101
+ 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; }
102
+
103
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
104
+
105
+ 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; }
106
+
107
+ 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; }
108
+
109
+ var cls = (0, _utils.baseClass)('teamix-pro-table');
110
+ var toJS = _form.formilyReactive.toJS;
111
+ /**
112
+ * 处理原生传入的 columns 以便于 选择列 方便处理
113
+ * @param columns 原生传入的 columns
114
+ * @returns
115
+ */
116
+
117
+ var processColumns = function processColumns(columns) {
118
+ return columns.filter(function (item) {
119
+ return item.columnFilters !== false;
120
+ });
121
+ };
122
+ /** 默认请求翻页参数 */
123
+
124
+
125
+ var globalPageKey = 'currentPage';
126
+ var globalPageSizeKey = 'pageSize';
127
+
128
+ var globalFormatSort = function globalFormatSort(sort) {
129
+ if (Object.keys(sort).length > 0) {
130
+ return {
131
+ sort: sort
132
+ };
133
+ }
134
+
135
+ return {};
136
+ };
137
+
138
+ var ProTable = function ProTable(props) {
139
+ var _rowSelection$selecte;
140
+
141
+ var header = props.header,
142
+ className = props.className,
143
+ tableClassName = props.tableClassName,
144
+ mainAction = props.mainAction,
145
+ quickAction = props.quickAction,
146
+ propsDataFilter = props.dataFilter,
147
+ toolBar = props.toolBar,
148
+ propsColumns = props.columns,
149
+ useRowSelection = props.useRowSelection,
150
+ propsRowSelection = props.rowSelection,
151
+ onChangeRowSelection = props.onChangeRowSelection,
152
+ getRowSelection = props.getRowSelection,
153
+ primaryKey = props.primaryKey,
154
+ footerAction = props.footerAction,
155
+ url = props.url,
156
+ pageKey = props.pageKey,
157
+ pageSizeKey = props.pageSizeKey,
158
+ _props$method = props.method,
159
+ method = _props$method === void 0 ? 'get' : _props$method,
160
+ _props$params = props.params,
161
+ propsParams = _props$params === void 0 ? {} : _props$params,
162
+ formatSort = props.formatSort,
163
+ _props$formatParams = props.formatParams,
164
+ formatParams = _props$formatParams === void 0 ? function (params) {
165
+ return params;
166
+ } : _props$formatParams,
167
+ formatResult = props.formatResult,
168
+ _props$requestWhenMou = props.requestWhenMount,
169
+ requestWhenMount = _props$requestWhenMou === void 0 ? true : _props$requestWhenMou,
170
+ _props$showPagination = props.showPagination,
171
+ showPagination = _props$showPagination === void 0 ? true : _props$showPagination,
172
+ _props$pageSizeList = props.pageSizeList,
173
+ pageSizeList = _props$pageSizeList === void 0 ? [5, 10, 20, 50, 100] : _props$pageSizeList,
174
+ _props$showSkeleton = props.showSkeleton,
175
+ propsShowSkeleton = _props$showSkeleton === void 0 ? true : _props$showSkeleton,
176
+ _props$skeletonSize = props.skeletonSize,
177
+ skeletonSize = _props$skeletonSize === void 0 ? 5 : _props$skeletonSize,
178
+ propsActionRef = props.actionRef,
179
+ dataSource = props.dataSource,
180
+ _props$filterDebounce = props.filterDebounce,
181
+ filterDebounce = _props$filterDebounce === void 0 ? 300 : _props$filterDebounce,
182
+ _props$footerSuction = props.footerSuction,
183
+ footerSuction = _props$footerSuction === void 0 ? false : _props$footerSuction,
184
+ otherProps = _objectWithoutProperties(props, _excluded);
185
+
186
+ var targetPageKey = pageKey || globalPageKey;
187
+ var targetPageSizeKey = pageSizeKey || globalPageSizeKey;
188
+ var targetFormatSort = formatSort || globalFormatSort;
189
+
190
+ var _useState = (0, _react.useState)(1),
191
+ _useState2 = _slicedToArray(_useState, 2),
192
+ currentPage = _useState2[0],
193
+ setCurrentPage = _useState2[1];
194
+
195
+ var _useState3 = (0, _react.useState)(props.pageSize || 10),
196
+ _useState4 = _slicedToArray(_useState3, 2),
197
+ pageSize = _useState4[0],
198
+ setPageSize = _useState4[1];
199
+
200
+ var _useState5 = (0, _react.useState)(0),
201
+ _useState6 = _slicedToArray(_useState5, 2),
202
+ total = _useState6[0],
203
+ setTotal = _useState6[1];
204
+
205
+ var _useState7 = (0, _react.useState)([]),
206
+ _useState8 = _slicedToArray(_useState7, 2),
207
+ data = _useState8[0],
208
+ setData = _useState8[1];
209
+
210
+ var _useState9 = (0, _react.useState)(props.sort || {}),
211
+ _useState10 = _slicedToArray(_useState9, 2),
212
+ sort = _useState10[0],
213
+ setSort = _useState10[1];
214
+
215
+ var _useState11 = (0, _react.useState)(requestWhenMount && propsShowSkeleton),
216
+ _useState12 = _slicedToArray(_useState11, 2),
217
+ showSkeleton = _useState12[0],
218
+ setShowSkeleton = _useState12[1]; // 首次加载,渲染骨架屏
219
+
220
+
221
+ var skeletonDataSource = new Array(skeletonSize).fill({});
222
+ var requestDataKey = method.toLowerCase() === 'get' ? 'params' : 'data';
223
+ var tableRef = (0, _react.useRef)(null);
224
+ var actionRef = (0, _react.useRef)(); // 传给 table 的过滤后的 columns
225
+
226
+ var _useState13 = (0, _react.useState)(processColumns(propsColumns !== null && propsColumns !== void 0 ? propsColumns : [])),
227
+ _useState14 = _slicedToArray(_useState13, 2),
228
+ filteredColumns = _useState14[0],
229
+ setFilteredColumns = _useState14[1];
230
+
231
+ var _useState15 = (0, _react.useState)('medium'),
232
+ _useState16 = _slicedToArray(_useState15, 2),
233
+ size = _useState16[0],
234
+ _setSize = _useState16[1]; // 获取header高度,用作全屏吸底吸顶高度计算
235
+
236
+
237
+ var getHeaderHeight = function getHeaderHeight() {
238
+ var _tableDom$getElements, _tableDom$getElements2;
239
+
240
+ var tableDom = tableRef.current;
241
+ var headerDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements = tableDom.getElementsByClassName('teamix-pro-table-layout')) === null || _tableDom$getElements === void 0 ? void 0 : _tableDom$getElements[0];
242
+ var tableHeaderDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements2 = tableDom.getElementsByClassName('next-table-header-inner')) === null || _tableDom$getElements2 === void 0 ? void 0 : _tableDom$getElements2[0];
243
+ return new Promise(function (resolve) {
244
+ setTimeout(function () {
245
+ var _headerDom$offsetHeig, _tableHeaderDom$offse;
246
+
247
+ var headerHeight = (_headerDom$offsetHeig = headerDom === null || headerDom === void 0 ? void 0 : headerDom.offsetHeight) !== null && _headerDom$offsetHeig !== void 0 ? _headerDom$offsetHeig : 0; // table表头默认一行。即42px
248
+
249
+ var tableHeaderHeight = (_tableHeaderDom$offse = tableHeaderDom === null || tableHeaderDom === void 0 ? void 0 : tableHeaderDom.offsetHeight) !== null && _tableHeaderDom$offse !== void 0 ? _tableHeaderDom$offse : 42;
250
+ resolve(headerHeight + tableHeaderHeight);
251
+ }, 50);
252
+ });
253
+ }; // header 区域高度。用作全屏计算吸顶吸底高度。默认不做计算
254
+
255
+
256
+ var _useState17 = (0, _react.useState)(0),
257
+ _useState18 = _slicedToArray(_useState17, 2),
258
+ headerHeight = _useState18[0],
259
+ setHeaderHeight = _useState18[1]; // 全屏显示 className
260
+
261
+
262
+ var _useState19 = (0, _react.useState)(false),
263
+ _useState20 = _slicedToArray(_useState19, 2),
264
+ fullscreenState = _useState20[0],
265
+ setFullscreenState = _useState20[1]; // 父元素位置。用作非全屏模式下的吸底
266
+
267
+
268
+ var _useState21 = (0, _react.useState)(),
269
+ _useState22 = _slicedToArray(_useState21, 2),
270
+ parentPosition = _useState22[0],
271
+ setParentPosition = _useState22[1];
272
+ /** 筛选区域 form */
273
+
274
+
275
+ var dataFilterForm = (0, _react.useMemo)(function () {
276
+ return (0, _form.createForm)();
277
+ }, []); // 获取表格大小
278
+
279
+ var tableSize = (0, _ahooks.useSize)(tableRef); // 获取父元素位置
280
+
281
+ var getParentPosition = function getParentPosition() {
282
+ // 暂时仅支持使用全家桶
283
+ if (footerSuction) {
284
+ var _parentDom$offsetLeft, _parentDom$offsetRigh;
285
+
286
+ var parentDom = document.querySelector('.teamix-pro-page-container');
287
+ setParentPosition({
288
+ offsetLeft: (_parentDom$offsetLeft = parentDom === null || parentDom === void 0 ? void 0 : parentDom.offsetLeft) !== null && _parentDom$offsetLeft !== void 0 ? _parentDom$offsetLeft : 0,
289
+ offsetRight: (_parentDom$offsetRigh = parentDom === null || parentDom === void 0 ? void 0 : parentDom.offsetRight) !== null && _parentDom$offsetRigh !== void 0 ? _parentDom$offsetRigh : 0
290
+ });
291
+ }
292
+ }; // 监听表格大小动态改变吸底footer大小
293
+
294
+
295
+ (0, _react.useEffect)(function () {
296
+ getParentPosition();
297
+ }, [tableSize]); // rowSelection 相关
298
+
299
+ var rowSelectionHook = (0, _useTableSelection.default)(_objectSpread(_objectSpread({}, propsRowSelection), {}, {
300
+ onChange: onChangeRowSelection
301
+ }), primaryKey);
302
+ var rowSelection = useRowSelection ? rowSelectionHook.rowSelection : propsRowSelection;
303
+ var selectedCount = (rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$selecte = rowSelection.selectedRowKeys) === null || _rowSelection$selecte === void 0 ? void 0 : _rowSelection$selecte.length) || 0;
304
+ (0, _react.useEffect)(function () {
305
+ getRowSelection && getRowSelection(rowSelectionHook);
306
+ }, [rowSelectionHook]); // 获取 table 左下角 checkbox 属性
307
+
308
+ function getCheckAllProps() {
309
+ var _rowSelection$onChang = rowSelection.onChange,
310
+ _onChange = _rowSelection$onChang === void 0 ? function () {} : _rowSelection$onChang,
311
+ _rowSelection$onSelec = rowSelection.onSelectAll,
312
+ onSelectAll = _rowSelection$onSelec === void 0 ? function () {} : _rowSelection$onSelec,
313
+ _rowSelection$selecte2 = rowSelection.selectedRowKeys,
314
+ selectedRowKeys = _rowSelection$selecte2 === void 0 ? [] : _rowSelection$selecte2,
315
+ getProps = rowSelection.getProps;
316
+
317
+ var dataSource = data;
318
+ var allRowKeys = dataSource.filter(function (d, i) {
319
+ var _getProps;
320
+
321
+ return getProps ? !((_getProps = getProps(d, i)) === null || _getProps === void 0 ? void 0 : _getProps.disabled) : true;
322
+ }).map(function (d) {
323
+ return (0, _utils.getDeepValue)(primaryKey || 'id', d);
324
+ });
325
+ var nowCheckedKeys = allRowKeys.filter(function (k) {
326
+ return selectedRowKeys.includes(k);
327
+ });
328
+ return {
329
+ onChange: function onChange(check) {
330
+ if (check) {
331
+ var result = selectedRowKeys.concat([]);
332
+ result.push.apply(result, _toConsumableArray(allRowKeys.filter(function (k) {
333
+ return !selectedRowKeys.includes(k);
334
+ })));
335
+
336
+ _onChange(result, dataSource);
337
+
338
+ onSelectAll(check, dataSource);
339
+ } else {
340
+ _onChange(selectedRowKeys.filter(function (k) {
341
+ return !allRowKeys.includes(k);
342
+ }), []);
343
+
344
+ onSelectAll(check, []);
345
+ }
346
+ },
347
+ indeterminate: nowCheckedKeys.length !== allRowKeys.length && nowCheckedKeys.length > 0,
348
+ checked: nowCheckedKeys.length !== 0 && nowCheckedKeys.length === allRowKeys.length
349
+ };
350
+ }
351
+
352
+ (0, _react.useEffect)(function () {
353
+ if (typeof propsActionRef === 'function' && actionRef.current) {
354
+ // @ts-ignore
355
+ propsActionRef(actionRef.current);
356
+ }
357
+ }, [propsActionRef]);
358
+ (0, _react.useEffect)(function () {
359
+ setFilteredColumns(processColumns(propsColumns !== null && propsColumns !== void 0 ? propsColumns : []));
360
+ }, [propsColumns]); // 绑定 Actions
361
+
362
+ (0, _utils2.useActionType)(actionRef, {
363
+ fullScreen: function fullScreen() {
364
+ var state = !fullscreenState; // 全屏时需要重新计算header高度
365
+
366
+ getHeaderHeight().then(function (height) {
367
+ setHeaderHeight(height);
368
+ });
369
+ setFullscreenState(state);
370
+ return state;
371
+ },
372
+ setColumn: function setColumn(newColumns) {
373
+ setFilteredColumns(processColumns(newColumns));
374
+ },
375
+ setSize: function setSize(mode) {
376
+ _setSize(mode);
377
+ },
378
+ refresh: function refresh(params) {
379
+ return _request(params);
380
+ },
381
+ request: function request(params) {
382
+ return _request(params);
383
+ },
384
+ reset: function reset() {
385
+ (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
386
+ dataFilterForm.reset();
387
+ setCurrentPage(1);
388
+
389
+ _request(_defineProperty({}, targetPageKey, 1));
390
+ },
391
+ clearRowSelection: function clearRowSelection() {
392
+ rowSelectionHook.setSelectedRowKeys([]);
393
+ rowSelectionHook.setSelectedRecords([]);
394
+ onChangeRowSelection && onChangeRowSelection([]);
395
+ },
396
+ pageInfo: {
397
+ total: total,
398
+ current: currentPage,
399
+ pageSize: pageSize
400
+ },
401
+ resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
402
+ getHeaderHeight().then(function (height) {
403
+ setHeaderHeight(height);
404
+ });
405
+ }
406
+ }); // 将 Actions 绑定到传入的 propsActionRef 中
407
+
408
+ if (propsActionRef) {
409
+ propsActionRef.current = actionRef.current;
410
+ } // 请求表格数据工具函数
411
+
412
+
413
+ var getData = (0, _utils.useRequest)(function (params) {
414
+ return _defineProperty({
415
+ url: url,
416
+ method: method
417
+ }, requestDataKey, params);
418
+ }, {
419
+ // 使用 request 方法代替 fetch
420
+ requestMethod: function requestMethod(params) {
421
+ return (0, _utils.request)(params);
422
+ },
423
+ manual: true,
424
+ onSuccess: function onSuccess(result) {
425
+ props.onSuccess && props.onSuccess(result);
426
+ var nextData = result;
427
+
428
+ if (formatResult) {
429
+ if (typeof formatResult === 'function') {
430
+ nextData = formatResult(result) || {};
431
+ } else if (_typeof(formatResult) === 'object') {
432
+ var dataTotal = (0, _utils.getDeepValue)(formatResult.total, result);
433
+ nextData = {
434
+ data: (0, _utils.getDeepValue)(formatResult.data, result) || [],
435
+ total: isNaN(dataTotal) ? 0 : Number(dataTotal)
436
+ };
437
+ }
438
+ }
439
+
440
+ function onFormatResult(next) {
441
+ var _next$data;
442
+
443
+ props.onFormatResult && props.onFormatResult(next); // 设置 dataSource、total
444
+
445
+ setData(next.data || []);
446
+ setTotal(next.total || ((_next$data = next.data) === null || _next$data === void 0 ? void 0 : _next$data.length));
447
+ setShowSkeleton(false);
448
+ }
449
+
450
+ if (nextData instanceof Promise) {
451
+ nextData.then(function (res) {
452
+ onFormatResult(res);
453
+ }).catch(function () {
454
+ onFormatResult({});
455
+ });
456
+ } else {
457
+ onFormatResult(nextData);
458
+ }
459
+ },
460
+ onError: function onError(error) {
461
+ setShowSkeleton(false);
462
+
463
+ if (props.onError) {
464
+ props.onError(error);
465
+ } else {
466
+ _components.Message.error(error.toString());
467
+ }
468
+ }
469
+ }); // 请求函数
470
+
471
+ function _request(params) {
472
+ var _actionRef$current, _actionRef$current$se, _objectSpread2;
473
+
474
+ // 请求前需要优先清空列过滤条件
475
+ (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setFilterRules) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, {});
476
+ var sortParams = targetFormatSort(sort); // 筛选区请求参数
477
+
478
+ var dataFilterParams = toJS(dataFilterForm.values); // 格式化后的请求参数
479
+
480
+ var requestData = formatParams(_objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams) : _objectSpread(_objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, targetPageKey, currentPage), _defineProperty(_objectSpread2, targetPageSizeKey, pageSize), _objectSpread2), dataFilterParams), propsParams), sortParams)), params));
481
+
482
+ if (requestData) {
483
+ // console.log('requestData', requestData);
484
+ getData.run(requestData);
485
+ }
486
+ }
487
+
488
+ (0, _react.useEffect)(function () {
489
+ if (requestWhenMount) {
490
+ _request();
491
+ }
492
+ }, []);
493
+
494
+ function onSort(dataIndex, order) {
495
+ var nextSort = _defineProperty({}, dataIndex, order);
496
+
497
+ setSort(nextSort);
498
+
499
+ _request(targetFormatSort(nextSort));
500
+ } // 处理 dataFilter 中的 onFilter、onReset
501
+
502
+
503
+ var dataFilter = _objectSpread(_objectSpread({}, propsDataFilter), {}, {
504
+ onFilter: (0, _lodash.default)(function () {
505
+ (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(_objectSpread({}, toJS(dataFilterForm.values))));
506
+ setCurrentPage(1);
507
+
508
+ _request(_defineProperty({}, targetPageKey, 1));
509
+ }, filterDebounce),
510
+ onReset: function onReset() {
511
+ (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
512
+ dataFilterForm.reset();
513
+ setCurrentPage(1);
514
+
515
+ _request(_defineProperty({}, targetPageKey, 1));
516
+ }
517
+ });
518
+
519
+ var renderTable = function renderTable() {
520
+ if (propsColumns) {
521
+ return /*#__PURE__*/_react.default.createElement("div", {
522
+ className: (0, _classnames.default)('teamix-pro-table-container', className)
523
+ }, /*#__PURE__*/_react.default.createElement(_Layout.default, {
524
+ header: header,
525
+ mainAction: mainAction,
526
+ quickAction: quickAction,
527
+ toolBar: toolBar,
528
+ actionRef: actionRef,
529
+ columns: propsColumns,
530
+ dataFilter: dataFilter,
531
+ dataFilterForm: dataFilterForm,
532
+ rowSelection: rowSelection
533
+ }), /*#__PURE__*/_react.default.createElement(_components.Table.StickyLock, _objectSpread({
534
+ hasBorder: false,
535
+ dataSource: showSkeleton ? skeletonDataSource : data || props.dataSource,
536
+ columns: (0, _genProColumnToColumn.default)(filteredColumns, showSkeleton, actionRef),
537
+ loading: !showSkeleton && (getData.loading || props.loading),
538
+ className: (0, _classnames.default)('teamix-pro-table', tableClassName, {
539
+ 'with-row-select': rowSelection
540
+ }),
541
+ size: size,
542
+ onSort: onSort,
543
+ sort: sort,
544
+ primaryKey: primaryKey,
545
+ rowSelection: rowSelection,
546
+ sortIcons: (0, _getTableSortIcons.default)(),
547
+ fixedHeader: fullscreenState,
548
+ // 102px 为 底部 50px + 空格10px + 顶部 24px padding
549
+ maxBodyHeight: "calc(100vh - 84px - ".concat(headerHeight, "px)")
550
+ }, (0, _utils.pickProps)((0, _getTableProps.default)(), otherProps))));
551
+ } else {
552
+ // 不传 columns 直接返回原始 Table
553
+ return /*#__PURE__*/_react.default.createElement(_components.Table, _objectSpread({
554
+ className: cls()
555
+ }, (0, _utils.pickProps)((0, _getTableProps.default)(), otherProps)));
556
+ }
557
+ };
558
+
559
+ var renderFooterAction = function renderFooterAction() {
560
+ var _footerAction$actions;
561
+
562
+ if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_footerAction$actions = footerAction.actions) === null || _footerAction$actions === void 0 ? void 0 : _footerAction$actions.length) > 0) {
563
+ // 默认 context
564
+ var defaultContext = {
565
+ action: actionRef.current,
566
+ rowSelection: rowSelection
567
+ };
568
+ return /*#__PURE__*/_react.default.createElement("div", {
569
+ className: cls('footer-action')
570
+ }, /*#__PURE__*/_react.default.createElement(_actions.ActionGroup, _objectSpread(_objectSpread({}, footerAction), {}, {
571
+ context: _objectSpread(_objectSpread({}, defaultContext), footerAction.context)
572
+ })));
573
+ } else return footerAction;
574
+ };
575
+
576
+ var renderFooter = function renderFooter() {
577
+ function onChangePagination(currentPage) {
578
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
579
+ setCurrentPage(currentPage);
580
+
581
+ _request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
582
+ }
583
+
584
+ function onChangePaginationSize(currentPageSize) {
585
+ setPageSize(currentPageSize);
586
+
587
+ _request(_defineProperty({}, targetPageSizeKey, currentPageSize));
588
+ }
589
+
590
+ function renderRowSelection() {
591
+ if (rowSelection) {
592
+ if (showSkeleton) {
593
+ return /*#__PURE__*/_react.default.createElement("div", {
594
+ className: cls('footer-left-wrapper')
595
+ }, /*#__PURE__*/_react.default.createElement(_skeleton.BaseSkeleton.Footer.Operation, null));
596
+ } else {
597
+ return /*#__PURE__*/_react.default.createElement("div", {
598
+ className: cls('footer-left-wrapper')
599
+ }, rowSelection.mode !== 'single' && /*#__PURE__*/_react.default.createElement(_components.Checkbox, _objectSpread({
600
+ className: cls("footer-checkbox-".concat(size))
601
+ }, getCheckAllProps())), footerAction && renderFooterAction(), /*#__PURE__*/_react.default.createElement("span", {
602
+ className: cls('selected-msg')
603
+ }, (0, _utils.getMessage)('selected', {
604
+ count: selectedCount
605
+ })));
606
+ }
607
+ }
608
+ }
609
+
610
+ if (showPagination || footerAction) {
611
+ var _parentPosition$offse, _parentPosition$offse2;
612
+
613
+ return /*#__PURE__*/_react.default.createElement("div", {
614
+ className: cls('footer', {
615
+ 'footer-has-rowSelection': rowSelection
616
+ }),
617
+ style: {
618
+ left: "".concat(fullscreenState ? 0 : (_parentPosition$offse = parentPosition === null || parentPosition === void 0 ? void 0 : parentPosition.offsetLeft) !== null && _parentPosition$offse !== void 0 ? _parentPosition$offse : 0, "px"),
619
+ right: "".concat(fullscreenState ? 0 : (_parentPosition$offse2 = parentPosition === null || parentPosition === void 0 ? void 0 : parentPosition.offsetRight) !== null && _parentPosition$offse2 !== void 0 ? _parentPosition$offse2 : 0, "px")
620
+ }
621
+ }, renderRowSelection(), /*#__PURE__*/_react.default.createElement("div", {
622
+ className: cls('footer-right-wrapper')
623
+ }, showSkeleton ? /*#__PURE__*/_react.default.createElement(_skeleton.BaseSkeleton.Footer.Pagination, null) : /*#__PURE__*/_react.default.createElement(_components.Pagination, _objectSpread({
624
+ className: cls('pagination'),
625
+ onChange: function onChange(number) {
626
+ return onChangePagination(number);
627
+ },
628
+ total: total,
629
+ totalRender: function totalRender(total) {
630
+ return (0, _utils.getMessage)('total', {
631
+ total: total
632
+ });
633
+ },
634
+ pageSize: pageSize,
635
+ current: currentPage,
636
+ shape: "arrow-only",
637
+ pageSizeList: pageSizeList,
638
+ pageSizeSelector: total > (props.pageSize || 10) * 2 ? 'dropdown' : false,
639
+ pageSizePosition: "end",
640
+ type: total / pageSize <= 2 ? 'simple' : 'normal',
641
+ onPageSizeChange: function onPageSizeChange(number) {
642
+ return onChangePaginationSize(number);
643
+ }
644
+ }, props.paginationProps))));
645
+ }
646
+ };
647
+
648
+ return /*#__PURE__*/_react.default.createElement(_Fullscreen.default, {
649
+ visible: fullscreenState,
650
+ actionRef: actionRef
651
+ }, /*#__PURE__*/_react.default.createElement("div", {
652
+ className: cls({
653
+ '': true,
654
+ fullscreen: fullscreenState,
655
+ 'footer-suction': footerSuction
656
+ }),
657
+ ref: tableRef
658
+ }, renderTable(), renderFooter()));
659
+ };
660
+
661
+ var _default = ProTable;
662
+ exports.default = _default;