@teamix/pro 1.0.22 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/dist/all.css +1 -1
  2. package/dist/all.js +12421 -13334
  3. package/dist/all.min.css +1 -1
  4. package/dist/all.min.js +1 -1
  5. package/es/actions/base.d.ts +13 -0
  6. package/es/actions/base.js +23 -0
  7. package/es/actions/confirm.d.ts +7 -0
  8. package/es/actions/confirm.js +11 -0
  9. package/es/actions/danger-confirm.d.ts +7 -0
  10. package/es/actions/danger-confirm.js +14 -0
  11. package/es/actions/dialog-component.d.ts +10 -0
  12. package/es/actions/dialog-component.js +25 -0
  13. package/es/actions/dialog-form.d.ts +15 -0
  14. package/es/actions/dialog-form.js +129 -0
  15. package/es/actions/dialog-table.d.ts +4 -0
  16. package/es/actions/dialog-table.js +1 -0
  17. package/es/actions/dialog.d.ts +17 -0
  18. package/es/actions/dialog.js +197 -0
  19. package/es/actions/drawer-form.d.ts +6 -0
  20. package/es/actions/drawer-form.js +7 -0
  21. package/es/actions/drawer-table.d.ts +2 -0
  22. package/es/actions/drawer-table.js +1 -0
  23. package/es/actions/drawer.d.ts +6 -0
  24. package/es/actions/drawer.js +7 -0
  25. package/es/actions/error.d.ts +7 -0
  26. package/es/actions/error.js +11 -0
  27. package/es/actions/index.d.ts +76 -0
  28. package/es/actions/index.js +317 -0
  29. package/es/actions/index.scss +34 -0
  30. package/es/actions/link.d.ts +14 -0
  31. package/es/actions/link.js +45 -0
  32. package/es/actions/notice.d.ts +7 -0
  33. package/es/actions/notice.js +11 -0
  34. package/es/actions/request.d.ts +9 -0
  35. package/es/actions/request.js +60 -0
  36. package/es/card/index.d.ts +30 -0
  37. package/es/card/index.js +159 -0
  38. package/es/card/index.scss +98 -0
  39. package/es/field/index.d.ts +3 -0
  40. package/es/field/index.js +3 -0
  41. package/es/form/Components/Editable/index.d.ts +20 -0
  42. package/es/form/Components/Editable/index.js +228 -0
  43. package/es/form/Components/FormGroup/index.d.ts +13 -0
  44. package/es/form/Components/FormGroup/index.js +89 -0
  45. package/es/form/Components/FormGroup/index.scss +23 -0
  46. package/es/form/Components/ProField/index.d.ts +150 -0
  47. package/es/form/Components/ProField/index.js +53 -0
  48. package/es/form/Components/Query/index.d.ts +4 -0
  49. package/es/form/Components/Query/index.js +70 -0
  50. package/es/form/Components/Query/index.scss +90 -0
  51. package/es/form/Components/QueryFilter/index.d.ts +3 -0
  52. package/es/form/Components/QueryFilter/index.js +111 -0
  53. package/es/form/Components/Search/index.d.ts +11 -0
  54. package/es/form/Components/Search/index.js +89 -0
  55. package/es/form/Filter/index.d.ts +16 -0
  56. package/es/form/Filter/index.js +218 -0
  57. package/es/form/ProForm/index.d.ts +5 -0
  58. package/es/form/ProForm/index.js +100 -0
  59. package/es/form/ProForm/index.scss +248 -0
  60. package/es/form/SchemaForm/adapterComponent.d.ts +5 -0
  61. package/es/form/SchemaForm/adapterComponent.js +17 -0
  62. package/es/form/SchemaForm/adapterDecorator.d.ts +6 -0
  63. package/es/form/SchemaForm/adapterDecorator.js +28 -0
  64. package/es/form/SchemaForm/adapterType.d.ts +5 -0
  65. package/es/form/SchemaForm/adapterType.js +54 -0
  66. package/es/form/SchemaForm/index.d.ts +4 -0
  67. package/es/form/SchemaForm/index.js +258 -0
  68. package/es/form/SchemaForm/initializeArrayCards.d.ts +3 -0
  69. package/es/form/SchemaForm/initializeArrayCards.js +69 -0
  70. package/es/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
  71. package/es/form/SchemaForm/initializeArrayCollapse.js +78 -0
  72. package/es/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
  73. package/es/form/SchemaForm/initializeArrayIcon.js +50 -0
  74. package/es/form/SchemaForm/initializeArrayItems.d.ts +3 -0
  75. package/es/form/SchemaForm/initializeArrayItems.js +97 -0
  76. package/es/form/SchemaForm/initializeArrayTable.d.ts +3 -0
  77. package/es/form/SchemaForm/initializeArrayTable.js +66 -0
  78. package/es/form/SchemaForm/initializeFormButton.d.ts +3 -0
  79. package/es/form/SchemaForm/initializeFormButton.js +75 -0
  80. package/es/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
  81. package/es/form/SchemaForm/initializeFormCollapse.js +43 -0
  82. package/es/form/SchemaForm/initializeFormGroup.d.ts +3 -0
  83. package/es/form/SchemaForm/initializeFormGroup.js +46 -0
  84. package/es/form/SchemaForm/initializeFormStep.d.ts +3 -0
  85. package/es/form/SchemaForm/initializeFormStep.js +48 -0
  86. package/es/form/SchemaForm/initializeFormTab.d.ts +3 -0
  87. package/es/form/SchemaForm/initializeFormTab.js +53 -0
  88. package/es/form/SchemaForm/initializeProField.d.ts +5 -0
  89. package/es/form/SchemaForm/initializeProField.js +69 -0
  90. package/es/form/SchemaForm/initializeRequest.d.ts +11 -0
  91. package/es/form/SchemaForm/initializeRequest.js +25 -0
  92. package/es/form/SchemaForm/reactions.d.ts +4 -0
  93. package/es/form/SchemaForm/reactions.js +62 -0
  94. package/es/form/index.d.ts +20 -0
  95. package/es/form/index.js +24 -0
  96. package/es/form/typing.d.ts +78 -0
  97. package/es/form/typing.js +1 -0
  98. package/es/form/utils.d.ts +9 -0
  99. package/es/form/utils.js +108 -0
  100. package/es/form/warning.d.ts +3 -0
  101. package/es/form/warning.js +20 -0
  102. package/es/hooks/index.d.ts +2 -0
  103. package/es/hooks/index.js +2 -0
  104. package/es/index.d.ts +24 -22
  105. package/es/index.js +25 -23
  106. package/es/info/components/FormItem/index.d.ts +5 -0
  107. package/es/info/components/FormItem/index.js +63 -0
  108. package/es/info/components/FormItem/index.scss +49 -0
  109. package/es/info/components/InfoGroup/index.d.ts +5 -0
  110. package/es/info/components/InfoGroup/index.js +16 -0
  111. package/es/info/components/InfoGroup/index.scss +8 -0
  112. package/es/info/components/InfoValueItem/index.d.ts +5 -0
  113. package/es/info/components/InfoValueItem/index.js +211 -0
  114. package/es/info/components/InfoValueItem/index.scss +21 -0
  115. package/es/info/components/baseInfo/index.d.ts +7 -0
  116. package/es/info/components/baseInfo/index.js +72 -0
  117. package/es/info/components/baseInfo/index.scss +3 -0
  118. package/es/info/components/headerInfo/index.d.ts +7 -0
  119. package/es/info/components/headerInfo/index.js +84 -0
  120. package/es/info/components/headerInfo/index.scss +0 -0
  121. package/es/info/components/tableInfo/index.d.ts +8 -0
  122. package/es/info/components/tableInfo/index.js +172 -0
  123. package/es/info/components/tableInfo/index.scss +18 -0
  124. package/es/info/index.d.ts +9 -0
  125. package/es/info/index.js +85 -0
  126. package/es/info/index.scss +8 -0
  127. package/es/info/typing.d.ts +143 -0
  128. package/es/info/typing.js +1 -0
  129. package/es/info/utils/index.d.ts +3 -0
  130. package/es/info/utils/index.js +12 -0
  131. package/es/info/utils/layout.d.ts +2 -0
  132. package/es/info/utils/layout.js +58 -0
  133. package/es/info/utils/useInfoRequest.d.ts +14 -0
  134. package/es/info/utils/useInfoRequest.js +73 -0
  135. package/es/info/utils/utils.d.ts +1 -0
  136. package/es/info/utils/utils.js +13 -0
  137. package/es/layout/index.d.ts +3 -0
  138. package/es/layout/index.js +3 -0
  139. package/es/nocode/configurators/Card.d.ts +3 -0
  140. package/es/nocode/configurators/Card.js +109 -0
  141. package/es/nocode/configurators/PageHeader.d.ts +3 -0
  142. package/es/nocode/configurators/PageHeader.js +196 -0
  143. package/es/nocode/configurators/ProTable.d.ts +3 -0
  144. package/es/nocode/configurators/ProTable.js +317 -0
  145. package/es/nocode/configurators/common.d.ts +176 -0
  146. package/es/nocode/configurators/common.js +314 -0
  147. package/es/nocode/configurators/index.d.ts +15 -0
  148. package/es/nocode/configurators/index.js +27 -0
  149. package/es/nocode/configurators/map.d.ts +2 -0
  150. package/es/nocode/configurators/map.js +8 -0
  151. package/es/nocode/index.d.ts +8 -0
  152. package/es/nocode/index.js +11 -0
  153. package/es/nocode/index.scss +93 -0
  154. package/es/nocode/pages/editor.d.ts +12 -0
  155. package/es/nocode/pages/editor.js +40 -0
  156. package/es/nocode/pages/index.d.ts +14 -0
  157. package/es/nocode/pages/index.js +41 -0
  158. package/es/nocode/pages/playground.d.ts +11 -0
  159. package/es/nocode/pages/playground.js +130 -0
  160. package/es/nocode/pages/renderer.d.ts +10 -0
  161. package/es/nocode/pages/renderer.js +144 -0
  162. package/es/nocode/playground.d.ts +14 -0
  163. package/es/nocode/playground.js +68 -0
  164. package/es/page-container/index.d.ts +3 -0
  165. package/es/page-container/index.js +3 -0
  166. package/es/page-header/index.d.ts +42 -0
  167. package/es/page-header/index.js +222 -0
  168. package/es/page-header/index.scss +171 -0
  169. package/es/skeleton/index.d.ts +3 -0
  170. package/es/skeleton/index.js +3 -0
  171. package/es/table/components/Filter/index.d.ts +9 -0
  172. package/es/table/components/Filter/index.js +231 -0
  173. package/es/table/components/Filter/index.scss +23 -0
  174. package/es/table/components/Layout/index.d.ts +5 -0
  175. package/es/table/components/Layout/index.js +241 -0
  176. package/es/table/components/Layout/index.scss +39 -0
  177. package/es/table/components/QuickAction/index.d.ts +10 -0
  178. package/es/table/components/QuickAction/index.js +53 -0
  179. package/es/table/components/QuickAction/index.scss +0 -0
  180. package/es/table/components/ToolBar/DensityIcon.d.ts +4 -0
  181. package/es/table/components/ToolBar/DensityIcon.js +117 -0
  182. package/es/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
  183. package/es/table/components/ToolBar/FilterColumnIcon.js +284 -0
  184. package/es/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
  185. package/es/table/components/ToolBar/FullScreenIcon.js +89 -0
  186. package/es/table/components/ToolBar/Fullscreen.d.ts +10 -0
  187. package/es/table/components/ToolBar/Fullscreen.js +68 -0
  188. package/es/table/components/ToolBar/RefreshIcon.d.ts +4 -0
  189. package/es/table/components/ToolBar/RefreshIcon.js +45 -0
  190. package/es/table/components/ToolBar/index.d.ts +5 -0
  191. package/es/table/components/ToolBar/index.js +79 -0
  192. package/es/table/components/ToolBar/index.scss +110 -0
  193. package/es/table/index.d.ts +7 -0
  194. package/es/table/index.js +620 -0
  195. package/es/table/index.scss +104 -0
  196. package/es/table/typing.d.ts +222 -0
  197. package/es/table/typing.js +1 -0
  198. package/es/table/utils/columnRender.d.ts +13 -0
  199. package/es/table/utils/columnRender.js +185 -0
  200. package/es/table/utils/genProColumnToColumn.d.ts +9 -0
  201. package/es/table/utils/genProColumnToColumn.js +51 -0
  202. package/es/table/utils/getTableProps.d.ts +2 -0
  203. package/es/table/utils/getTableProps.js +4 -0
  204. package/es/table/utils/getTableSortIcons.d.ts +3 -0
  205. package/es/table/utils/getTableSortIcons.js +21 -0
  206. package/es/table/utils/index.d.ts +4 -0
  207. package/es/table/utils/index.js +100 -0
  208. package/es/table/utils/useTableSelection.d.ts +3 -0
  209. package/es/table/utils/useTableSelection.js +107 -0
  210. package/es/templates/Detail/index.d.ts +2 -0
  211. package/es/templates/Detail/index.js +5 -0
  212. package/es/templates/Detail/index.scss +3 -0
  213. package/es/templates/Form/index.d.ts +2 -0
  214. package/es/templates/Form/index.js +5 -0
  215. package/es/templates/Form/index.scss +3 -0
  216. package/es/templates/List/index.d.ts +9 -0
  217. package/es/templates/List/index.js +45 -0
  218. package/es/templates/List/index.scss +3 -0
  219. package/es/templates/index.d.ts +5 -0
  220. package/es/templates/index.js +7 -0
  221. package/es/templates/index.scss +3 -0
  222. package/es/utils/index.d.ts +2 -0
  223. package/es/utils/index.js +2 -0
  224. package/lib/actions/base.d.ts +13 -0
  225. package/lib/actions/base.js +33 -0
  226. package/lib/actions/confirm.d.ts +7 -0
  227. package/lib/actions/confirm.js +25 -0
  228. package/lib/actions/danger-confirm.d.ts +7 -0
  229. package/lib/actions/danger-confirm.js +28 -0
  230. package/lib/actions/dialog-component.d.ts +10 -0
  231. package/lib/actions/dialog-component.js +39 -0
  232. package/lib/actions/dialog-form.d.ts +15 -0
  233. package/lib/actions/dialog-form.js +152 -0
  234. package/lib/actions/dialog-table.d.ts +4 -0
  235. package/lib/actions/dialog-table.js +5 -0
  236. package/lib/actions/dialog.d.ts +17 -0
  237. package/lib/actions/dialog.js +219 -0
  238. package/lib/actions/drawer-form.d.ts +6 -0
  239. package/lib/actions/drawer-form.js +18 -0
  240. package/lib/actions/drawer-table.d.ts +2 -0
  241. package/lib/actions/drawer-table.js +5 -0
  242. package/lib/actions/drawer.d.ts +6 -0
  243. package/lib/actions/drawer.js +20 -0
  244. package/lib/actions/error.d.ts +7 -0
  245. package/lib/actions/error.js +25 -0
  246. package/lib/actions/index.d.ts +76 -0
  247. package/lib/actions/index.js +356 -0
  248. package/lib/actions/index.scss +34 -0
  249. package/lib/actions/link.d.ts +14 -0
  250. package/lib/actions/link.js +60 -0
  251. package/lib/actions/notice.d.ts +7 -0
  252. package/lib/actions/notice.js +25 -0
  253. package/lib/actions/request.d.ts +9 -0
  254. package/lib/actions/request.js +75 -0
  255. package/lib/card/index.d.ts +30 -0
  256. package/lib/card/index.js +179 -0
  257. package/lib/card/index.scss +98 -0
  258. package/lib/field/index.d.ts +3 -0
  259. package/lib/field/index.js +30 -0
  260. package/lib/form/Components/Editable/index.d.ts +20 -0
  261. package/lib/form/Components/Editable/index.js +251 -0
  262. package/lib/form/Components/FormGroup/index.d.ts +13 -0
  263. package/lib/form/Components/FormGroup/index.js +103 -0
  264. package/lib/form/Components/FormGroup/index.scss +23 -0
  265. package/lib/form/Components/ProField/index.d.ts +150 -0
  266. package/lib/form/Components/ProField/index.js +68 -0
  267. package/lib/form/Components/Query/index.d.ts +4 -0
  268. package/lib/form/Components/Query/index.js +91 -0
  269. package/lib/form/Components/Query/index.scss +90 -0
  270. package/lib/form/Components/QueryFilter/index.d.ts +3 -0
  271. package/lib/form/Components/QueryFilter/index.js +130 -0
  272. package/lib/form/Components/Search/index.d.ts +11 -0
  273. package/lib/form/Components/Search/index.js +103 -0
  274. package/lib/form/Filter/index.d.ts +16 -0
  275. package/lib/form/Filter/index.js +242 -0
  276. package/lib/form/ProForm/index.d.ts +5 -0
  277. package/lib/form/ProForm/index.js +125 -0
  278. package/lib/form/ProForm/index.scss +248 -0
  279. package/lib/form/SchemaForm/adapterComponent.d.ts +5 -0
  280. package/lib/form/SchemaForm/adapterComponent.js +27 -0
  281. package/lib/form/SchemaForm/adapterDecorator.d.ts +6 -0
  282. package/lib/form/SchemaForm/adapterDecorator.js +34 -0
  283. package/lib/form/SchemaForm/adapterType.d.ts +5 -0
  284. package/lib/form/SchemaForm/adapterType.js +64 -0
  285. package/lib/form/SchemaForm/index.d.ts +4 -0
  286. package/lib/form/SchemaForm/index.js +301 -0
  287. package/lib/form/SchemaForm/initializeArrayCards.d.ts +3 -0
  288. package/lib/form/SchemaForm/initializeArrayCards.js +76 -0
  289. package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +3 -0
  290. package/lib/form/SchemaForm/initializeArrayCollapse.js +85 -0
  291. package/lib/form/SchemaForm/initializeArrayIcon.d.ts +3 -0
  292. package/lib/form/SchemaForm/initializeArrayIcon.js +61 -0
  293. package/lib/form/SchemaForm/initializeArrayItems.d.ts +3 -0
  294. package/lib/form/SchemaForm/initializeArrayItems.js +104 -0
  295. package/lib/form/SchemaForm/initializeArrayTable.d.ts +3 -0
  296. package/lib/form/SchemaForm/initializeArrayTable.js +73 -0
  297. package/lib/form/SchemaForm/initializeFormButton.d.ts +3 -0
  298. package/lib/form/SchemaForm/initializeFormButton.js +82 -0
  299. package/lib/form/SchemaForm/initializeFormCollapse.d.ts +3 -0
  300. package/lib/form/SchemaForm/initializeFormCollapse.js +50 -0
  301. package/lib/form/SchemaForm/initializeFormGroup.d.ts +3 -0
  302. package/lib/form/SchemaForm/initializeFormGroup.js +53 -0
  303. package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -0
  304. package/lib/form/SchemaForm/initializeFormStep.js +55 -0
  305. package/lib/form/SchemaForm/initializeFormTab.d.ts +3 -0
  306. package/lib/form/SchemaForm/initializeFormTab.js +60 -0
  307. package/lib/form/SchemaForm/initializeProField.d.ts +5 -0
  308. package/lib/form/SchemaForm/initializeProField.js +76 -0
  309. package/lib/form/SchemaForm/initializeRequest.d.ts +11 -0
  310. package/lib/form/SchemaForm/initializeRequest.js +34 -0
  311. package/lib/form/SchemaForm/reactions.d.ts +4 -0
  312. package/lib/form/SchemaForm/reactions.js +72 -0
  313. package/lib/form/index.d.ts +20 -0
  314. package/lib/form/index.js +149 -0
  315. package/lib/form/typing.d.ts +78 -0
  316. package/lib/form/typing.js +5 -0
  317. package/lib/form/utils.d.ts +9 -0
  318. package/lib/form/utils.js +124 -0
  319. package/lib/form/warning.d.ts +3 -0
  320. package/lib/form/warning.js +28 -0
  321. package/lib/hooks/index.d.ts +2 -0
  322. package/lib/hooks/index.js +17 -0
  323. package/lib/index.d.ts +24 -22
  324. package/lib/index.js +84 -57
  325. package/lib/info/components/FormItem/index.d.ts +5 -0
  326. package/lib/info/components/FormItem/index.js +78 -0
  327. package/lib/info/components/FormItem/index.scss +49 -0
  328. package/lib/info/components/InfoGroup/index.d.ts +5 -0
  329. package/lib/info/components/InfoGroup/index.js +27 -0
  330. package/lib/info/components/InfoGroup/index.scss +8 -0
  331. package/lib/info/components/InfoValueItem/index.d.ts +5 -0
  332. package/lib/info/components/InfoValueItem/index.js +237 -0
  333. package/lib/info/components/InfoValueItem/index.scss +21 -0
  334. package/lib/info/components/baseInfo/index.d.ts +7 -0
  335. package/lib/info/components/baseInfo/index.js +99 -0
  336. package/lib/info/components/baseInfo/index.scss +3 -0
  337. package/lib/info/components/headerInfo/index.d.ts +7 -0
  338. package/lib/info/components/headerInfo/index.js +111 -0
  339. package/lib/info/components/headerInfo/index.scss +0 -0
  340. package/lib/info/components/tableInfo/index.d.ts +8 -0
  341. package/lib/info/components/tableInfo/index.js +193 -0
  342. package/lib/info/components/tableInfo/index.scss +18 -0
  343. package/lib/info/index.d.ts +9 -0
  344. package/lib/info/index.js +121 -0
  345. package/lib/info/index.scss +8 -0
  346. package/lib/info/typing.d.ts +143 -0
  347. package/lib/info/typing.js +5 -0
  348. package/lib/info/utils/index.d.ts +3 -0
  349. package/lib/info/utils/index.js +19 -0
  350. package/lib/info/utils/layout.d.ts +2 -0
  351. package/lib/info/utils/layout.js +65 -0
  352. package/lib/info/utils/useInfoRequest.d.ts +14 -0
  353. package/lib/info/utils/useInfoRequest.js +82 -0
  354. package/lib/info/utils/utils.d.ts +1 -0
  355. package/lib/info/utils/utils.js +20 -0
  356. package/lib/layout/index.d.ts +3 -0
  357. package/lib/layout/index.js +30 -0
  358. package/lib/nocode/configurators/Card.d.ts +3 -0
  359. package/lib/nocode/configurators/Card.js +116 -0
  360. package/lib/nocode/configurators/PageHeader.d.ts +3 -0
  361. package/lib/nocode/configurators/PageHeader.js +205 -0
  362. package/lib/nocode/configurators/ProTable.d.ts +3 -0
  363. package/lib/nocode/configurators/ProTable.js +326 -0
  364. package/lib/nocode/configurators/common.d.ts +176 -0
  365. package/lib/nocode/configurators/common.js +325 -0
  366. package/lib/nocode/configurators/index.d.ts +15 -0
  367. package/lib/nocode/configurators/index.js +44 -0
  368. package/lib/nocode/configurators/map.d.ts +2 -0
  369. package/lib/nocode/configurators/map.js +21 -0
  370. package/lib/nocode/index.d.ts +8 -0
  371. package/lib/nocode/index.js +76 -0
  372. package/lib/nocode/index.scss +93 -0
  373. package/lib/nocode/pages/editor.d.ts +12 -0
  374. package/lib/nocode/pages/editor.js +58 -0
  375. package/lib/nocode/pages/index.d.ts +14 -0
  376. package/lib/nocode/pages/index.js +93 -0
  377. package/lib/nocode/pages/playground.d.ts +11 -0
  378. package/lib/nocode/pages/playground.js +158 -0
  379. package/lib/nocode/pages/renderer.d.ts +10 -0
  380. package/lib/nocode/pages/renderer.js +164 -0
  381. package/lib/nocode/playground.d.ts +14 -0
  382. package/lib/nocode/playground.js +91 -0
  383. package/lib/page-container/index.d.ts +3 -0
  384. package/lib/page-container/index.js +30 -0
  385. package/lib/page-header/index.d.ts +42 -0
  386. package/lib/page-header/index.js +240 -0
  387. package/lib/page-header/index.scss +171 -0
  388. package/lib/skeleton/index.d.ts +3 -0
  389. package/lib/skeleton/index.js +30 -0
  390. package/lib/table/components/Filter/index.d.ts +9 -0
  391. package/lib/table/components/Filter/index.js +252 -0
  392. package/lib/table/components/Filter/index.scss +23 -0
  393. package/lib/table/components/Layout/index.d.ts +5 -0
  394. package/lib/table/components/Layout/index.js +265 -0
  395. package/lib/table/components/Layout/index.scss +39 -0
  396. package/lib/table/components/QuickAction/index.d.ts +10 -0
  397. package/lib/table/components/QuickAction/index.js +65 -0
  398. package/lib/table/components/QuickAction/index.scss +0 -0
  399. package/lib/table/components/ToolBar/DensityIcon.d.ts +4 -0
  400. package/lib/table/components/ToolBar/DensityIcon.js +135 -0
  401. package/lib/table/components/ToolBar/FilterColumnIcon.d.ts +4 -0
  402. package/lib/table/components/ToolBar/FilterColumnIcon.js +303 -0
  403. package/lib/table/components/ToolBar/FullScreenIcon.d.ts +4 -0
  404. package/lib/table/components/ToolBar/FullScreenIcon.js +107 -0
  405. package/lib/table/components/ToolBar/Fullscreen.d.ts +10 -0
  406. package/lib/table/components/ToolBar/Fullscreen.js +85 -0
  407. package/lib/table/components/ToolBar/RefreshIcon.d.ts +4 -0
  408. package/lib/table/components/ToolBar/RefreshIcon.js +60 -0
  409. package/lib/table/components/ToolBar/index.d.ts +5 -0
  410. package/lib/table/components/ToolBar/index.js +96 -0
  411. package/lib/table/components/ToolBar/index.scss +110 -0
  412. package/lib/table/index.d.ts +7 -0
  413. package/lib/table/index.js +681 -0
  414. package/lib/table/index.scss +104 -0
  415. package/lib/table/typing.d.ts +222 -0
  416. package/lib/table/typing.js +5 -0
  417. package/lib/table/utils/columnRender.d.ts +13 -0
  418. package/lib/table/utils/columnRender.js +201 -0
  419. package/lib/table/utils/genProColumnToColumn.d.ts +9 -0
  420. package/lib/table/utils/genProColumnToColumn.js +62 -0
  421. package/lib/table/utils/getTableProps.d.ts +2 -0
  422. package/lib/table/utils/getTableProps.js +13 -0
  423. package/lib/table/utils/getTableSortIcons.d.ts +3 -0
  424. package/lib/table/utils/getTableSortIcons.js +34 -0
  425. package/lib/table/utils/index.d.ts +4 -0
  426. package/lib/table/utils/index.js +112 -0
  427. package/lib/table/utils/useTableSelection.d.ts +3 -0
  428. package/lib/table/utils/useTableSelection.js +112 -0
  429. package/lib/templates/Detail/index.d.ts +2 -0
  430. package/lib/templates/Detail/index.js +18 -0
  431. package/lib/templates/Detail/index.scss +3 -0
  432. package/lib/templates/Form/index.d.ts +2 -0
  433. package/lib/templates/Form/index.js +18 -0
  434. package/lib/templates/Form/index.scss +3 -0
  435. package/lib/templates/List/index.d.ts +9 -0
  436. package/lib/templates/List/index.js +67 -0
  437. package/lib/templates/List/index.scss +3 -0
  438. package/lib/templates/index.d.ts +5 -0
  439. package/lib/templates/index.js +59 -0
  440. package/lib/templates/index.scss +3 -0
  441. package/lib/utils/index.d.ts +2 -0
  442. package/lib/utils/index.js +17 -0
  443. package/package.json +21 -11
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _icon = _interopRequireDefault(require("@teamix/icon"));
13
+
14
+ var _components = require("@alicloudfe/components");
15
+
16
+ var _utils = require("@teamix/utils");
17
+
18
+ require("./index.scss");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ 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
+ 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
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
27
+
28
+ 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
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
+
32
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
33
+
34
+ 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; }
35
+
36
+ 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; }
37
+
38
+ 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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
+
42
+ 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
+ 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
+ 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
+ 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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
+
52
+ var CheckboxItem = _components.Menu.CheckboxItem;
53
+ var cls = (0, _utils.baseClass)('teamix-pro-table-toolbar-filter');
54
+ var RadioGroup = _components.Radio.Group;
55
+
56
+ var Filter = function Filter(props) {
57
+ var column = props.column,
58
+ actionRef = props.actionRef; // 选中过滤项
59
+
60
+ var _useState = (0, _react.useState)([]),
61
+ _useState2 = _slicedToArray(_useState, 2),
62
+ selected = _useState2[0],
63
+ setSelected = _useState2[1];
64
+
65
+ var _useState3 = (0, _react.useState)(false),
66
+ _useState4 = _slicedToArray(_useState3, 2),
67
+ visible = _useState4[0],
68
+ setVisible = _useState4[1];
69
+
70
+ (0, _react.useEffect)(function () {
71
+ var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4;
72
+
73
+ // 从全局状态中读取上次存储的条件
74
+ 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).filterRules) === null || _actionRef$current$ge3 === void 0 ? void 0 : (_actionRef$current$ge4 = _actionRef$current$ge3[column.dataIndex]) === null || _actionRef$current$ge4 === void 0 ? void 0 : _actionRef$current$ge4.rules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : [];
75
+ setSelected(rules);
76
+ }, []); // 获取过滤项
77
+
78
+ var filters = (0, _react.useMemo)(function () {
79
+ if (Array.isArray(column.filters)) {
80
+ return column.filters;
81
+ }
82
+
83
+ var filters = column.dataSource; // 转换 valueEnum 为 options
84
+
85
+ if (!Array.isArray(column.dataSource)) {
86
+ filters = Object.entries(column.dataSource).map(function (_ref) {
87
+ var _nv$label, _nv$color;
88
+
89
+ var _ref2 = _slicedToArray(_ref, 2),
90
+ k = _ref2[0],
91
+ v = _ref2[1];
92
+
93
+ var nv = v;
94
+ return _objectSpread(_objectSpread({
95
+ value: k
96
+ }, nv), {}, {
97
+ label: (_nv$label = nv.label) !== null && _nv$label !== void 0 ? _nv$label : k,
98
+ color: (_nv$color = nv.color) !== null && _nv$color !== void 0 ? _nv$color : k
99
+ });
100
+ });
101
+ } // console.log(filters);
102
+
103
+
104
+ return filters;
105
+ }, []); // 渲染单选
106
+
107
+ var renderSingle = function renderSingle() {
108
+ var _selected$;
109
+
110
+ return /*#__PURE__*/_react.default.createElement(RadioGroup, {
111
+ value: (_selected$ = selected === null || selected === void 0 ? void 0 : selected[0]) !== null && _selected$ !== void 0 ? _selected$ : '',
112
+ onChange: function onChange(check) {
113
+ setSelected([check]);
114
+ }
115
+ }, filters === null || filters === void 0 ? void 0 : filters.map(function (_ref3) {
116
+ var label = _ref3.label,
117
+ value = _ref3.value;
118
+ var valueStr = value.toString();
119
+ return /*#__PURE__*/_react.default.createElement(_components.Radio, {
120
+ id: valueStr,
121
+ value: valueStr,
122
+ key: valueStr,
123
+ style: {
124
+ display: 'block',
125
+ marginLeft: '5px'
126
+ }
127
+ }, label);
128
+ }));
129
+ }; // 渲染多选
130
+
131
+
132
+ var renderMultiple = function renderMultiple() {
133
+ return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref4) {
134
+ var label = _ref4.label,
135
+ value = _ref4.value;
136
+ var valueStr = value.toString();
137
+ return /*#__PURE__*/_react.default.createElement(CheckboxItem, {
138
+ key: valueStr,
139
+ checked: selected.includes(valueStr),
140
+ onChange: function onChange(check) {
141
+ if (check) {
142
+ setSelected([].concat(_toConsumableArray(selected), [valueStr]));
143
+ } else {
144
+ setSelected(selected.filter(function (item) {
145
+ return item !== valueStr;
146
+ }));
147
+ }
148
+ }
149
+ }, label);
150
+ });
151
+ }; // 渲染选择区域
152
+
153
+
154
+ var renderSelect = function renderSelect() {
155
+ if (column.filterMode === 'multiple') {
156
+ return renderMultiple();
157
+ }
158
+
159
+ return renderSingle();
160
+ };
161
+
162
+ return /*#__PURE__*/_react.default.createElement(_components.Dropdown, {
163
+ trigger: /*#__PURE__*/_react.default.createElement(_icon.default, {
164
+ size: "small",
165
+ type: "filter-line",
166
+ className: cls({
167
+ icon: true,
168
+ 'icon-selected': selected.length > 0
169
+ }),
170
+ onClick: function onClick() {
171
+ setVisible(!visible);
172
+ }
173
+ }),
174
+ triggerType: ['click'],
175
+ align: "tl bl",
176
+ visible: visible,
177
+ onVisibleChange: function onVisibleChange() {
178
+ return setVisible(false);
179
+ }
180
+ }, /*#__PURE__*/_react.default.createElement("div", {
181
+ className: cls()
182
+ }, /*#__PURE__*/_react.default.createElement(_components.Menu, null, renderSelect(), /*#__PURE__*/_react.default.createElement("div", {
183
+ className: cls({
184
+ 'btn-box': true
185
+ })
186
+ }, /*#__PURE__*/_react.default.createElement(_components.Button, {
187
+ type: "primary",
188
+ size: "small",
189
+ className: cls({
190
+ btn: true
191
+ }),
192
+ onClick: function onClick() {
193
+ var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge5, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$r, _actionRef$current5, _actionRef$current5$s;
194
+
195
+ (_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
196
+
197
+ var param = '';
198
+
199
+ if (column.beforeFilter) {
200
+ var _column$beforeFilter;
201
+
202
+ param = (_column$beforeFilter = column.beforeFilter) === null || _column$beforeFilter === void 0 ? void 0 : _column$beforeFilter.call(column, selected);
203
+ } else {
204
+ param = selected.join(',');
205
+ } // 需要带上其他所有的信息
206
+
207
+
208
+ var rules = (_actionRef$current$ge5 = (_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$ge5 !== void 0 ? _actionRef$current$ge5 : {};
209
+ var params = Object.fromEntries([].concat(_toConsumableArray(Object.entries(rules).map(function (_ref5) {
210
+ var _ref6 = _slicedToArray(_ref5, 2),
211
+ k = _ref6[0],
212
+ v = _ref6[1];
213
+
214
+ if (v) {
215
+ return [k, v.params];
216
+ }
217
+
218
+ return null;
219
+ })), [[column.dataIndex, param]]).filter(function (item) {
220
+ return item && (item === null || item === void 0 ? void 0 : item[1]);
221
+ })); // 先发送请求。因为这会置空组件的列筛选状态
222
+
223
+ (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$r = _actionRef$current4.request) === null || _actionRef$current4$r === void 0 ? void 0 : _actionRef$current4$r.call(_actionRef$current4, _objectSpread({}, params)); // 再设置所有的列筛选状态
224
+
225
+ (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$s = _actionRef$current5.setFilterRules) === null || _actionRef$current5$s === void 0 ? void 0 : _actionRef$current5$s.call(_actionRef$current5, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
226
+ rules: selected,
227
+ params: param
228
+ })));
229
+ setVisible(false);
230
+ }
231
+ }, "\u786E\u5B9A"), /*#__PURE__*/_react.default.createElement(_components.Button, {
232
+ type: "normal",
233
+ size: "small",
234
+ className: cls({
235
+ btn: true
236
+ }),
237
+ onClick: function onClick() {
238
+ var _actionRef$current$ge6, _actionRef$current6, _actionRef$current6$g, _actionRef$current6$g2, _actionRef$current7, _actionRef$current7$s, _actionRef$current8, _actionRef$current8$f;
239
+
240
+ setSelected([]);
241
+ var rules = (_actionRef$current$ge6 = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getState) === null || _actionRef$current6$g === void 0 ? void 0 : (_actionRef$current6$g2 = _actionRef$current6$g.call(_actionRef$current6)) === null || _actionRef$current6$g2 === void 0 ? void 0 : _actionRef$current6$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {};
242
+ (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$s = _actionRef$current7.setFilterRules) === null || _actionRef$current7$s === void 0 ? void 0 : _actionRef$current7$s.call(_actionRef$current7, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
243
+ rules: [],
244
+ params: ''
245
+ })));
246
+ (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$f = _actionRef$current8.filterDataSource) === null || _actionRef$current8$f === void 0 ? void 0 : _actionRef$current8$f.call(_actionRef$current8, column.dataIndex); // setVisible(!visible);
247
+ }
248
+ }, "\u91CD\u7F6E")))));
249
+ };
250
+
251
+ var _default = Filter;
252
+ exports.default = _default;
@@ -0,0 +1,23 @@
1
+ .teamix-pro-table-toolbar-filter {
2
+ width: 130px;
3
+ max-height: 350px;
4
+ overflow-y: auto;
5
+ box-shadow: var(--popup-local-shadow, 0px 6px 24px 0px rgba(0, 0, 0, 0.1));
6
+ &-icon {
7
+ cursor: pointer;
8
+ margin-left: 4px;
9
+ }
10
+ &-icon-selected {
11
+ color: var(--color-brand1-6, #0064c8);
12
+ }
13
+ .teamix-pro-table-toolbar-filter-btn-box {
14
+ display: flex;
15
+ justify-content: space-around;
16
+ margin-top: 10px;
17
+ padding-bottom: 5px;
18
+ }
19
+ .teamix-pro-table-toolbar-filter-btn.teamix-pro-table-toolbar-filter-btn {
20
+ width: 48px !important;
21
+ min-width: unset !important;
22
+ }
23
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ProTableLayoutProps } from '../../typing';
3
+ import './index.scss';
4
+ declare const _default: React.MemoExoticComponent<(props: ProTableLayoutProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,265 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _utils = require("@teamix/utils");
11
+
12
+ var _components = require("@alicloudfe/components");
13
+
14
+ var _icon = _interopRequireDefault(require("@teamix/icon"));
15
+
16
+ var _actions = require("../../../actions");
17
+
18
+ var _form = require("../../../form");
19
+
20
+ var _ToolBar = _interopRequireDefault(require("../ToolBar"));
21
+
22
+ var _QuickAction = _interopRequireDefault(require("../QuickAction"));
23
+
24
+ var _lodash = _interopRequireDefault(require("lodash.isempty"));
25
+
26
+ require("./index.scss");
27
+
28
+ var _excluded = ["header", "mainAction", "quickAction", "actionRef", "dataFilter", "dataFilterForm", "rowSelection"];
29
+
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+
32
+ 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); }
33
+
34
+ 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; }
35
+
36
+ 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; }
37
+
38
+ 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; }
39
+
40
+ 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; }
41
+
42
+ 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); }
43
+
44
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45
+
46
+ 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."); }
47
+
48
+ 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); }
49
+
50
+ 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; }
51
+
52
+ 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; }
53
+
54
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
55
+
56
+ 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; }
57
+
58
+ 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; }
59
+
60
+ var cls = (0, _utils.baseClass)('teamix-pro-table-layout');
61
+
62
+ var Layout = function Layout(props) {
63
+ var header = props.header,
64
+ mainAction = props.mainAction,
65
+ quickAction = props.quickAction,
66
+ actionRef = props.actionRef,
67
+ dataFilter = props.dataFilter,
68
+ dataFilterForm = props.dataFilterForm,
69
+ rowSelection = props.rowSelection,
70
+ otherProps = _objectWithoutProperties(props, _excluded);
71
+
72
+ var mode = (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.mode) || 'inline';
73
+
74
+ var _useState = (0, _react.useState)((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) || false),
75
+ _useState2 = _slicedToArray(_useState, 2),
76
+ expand = _useState2[0],
77
+ setExpand = _useState2[1];
78
+
79
+ var _useState3 = (0, _react.useState)(false),
80
+ _useState4 = _slicedToArray(_useState3, 2),
81
+ hasDot = _useState4[0],
82
+ setHasDot = _useState4[1];
83
+
84
+ (0, _react.useEffect)(function () {
85
+ if (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) {
86
+ setExpand(dataFilter.expand);
87
+ }
88
+ }, [dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand]); // 渲染主操作区
89
+
90
+ var renderMainAction = function renderMainAction() {
91
+ var _mainAction$actions;
92
+
93
+ 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) {
94
+ // 默认 context
95
+ var defaultContext = {
96
+ action: actionRef.current,
97
+ rowSelection: rowSelection
98
+ };
99
+ return /*#__PURE__*/_react.default.createElement("div", {
100
+ className: cls('main-action')
101
+ }, /*#__PURE__*/_react.default.createElement(_actions.ActionGroup, _objectSpread(_objectSpread({}, mainAction), {}, {
102
+ context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context)
103
+ })));
104
+ } else return mainAction;
105
+ }; // 渲染 mode='inline' 数据过滤区
106
+
107
+
108
+ var renderInlineFilter = function renderInlineFilter() {
109
+ var _dataFilter$schema;
110
+
111
+ if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) > 0) {
112
+ return /*#__PURE__*/_react.default.createElement("div", {
113
+ className: cls('inline-filter')
114
+ }, /*#__PURE__*/_react.default.createElement(_form.SimpleFilter, _objectSpread({
115
+ form: dataFilterForm
116
+ }, dataFilter)));
117
+ }
118
+ }; // 渲染 mode='panel' 数据过滤区
119
+
120
+
121
+ var renderPanelFilter = function renderPanelFilter() {
122
+ var _dataFilter$schema2;
123
+
124
+ if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) > 0) {
125
+ return /*#__PURE__*/_react.default.createElement("div", {
126
+ className: cls('panel-filter'),
127
+ style: {
128
+ display: expand ? 'block' : 'none'
129
+ }
130
+ }, /*#__PURE__*/_react.default.createElement(_form.AdvancedFilter, _objectSpread({
131
+ form: dataFilterForm
132
+ }, dataFilter)));
133
+ }
134
+ }; // 渲染过滤器按钮
135
+
136
+
137
+ var renderFilterBtn = function renderFilterBtn() {
138
+ var handleBtnClick = function handleBtnClick() {
139
+ setExpand(!expand);
140
+ var filterValues = Object.values((0, _form.toJS)(dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.values)).filter(function (v) {
141
+ return !(0, _lodash.default)(v);
142
+ }); // console.log('filterValues', filterValues);
143
+
144
+ if (filterValues && (filterValues === null || filterValues === void 0 ? void 0 : filterValues.length) > 0) {
145
+ setHasDot(true);
146
+ } else {
147
+ setHasDot(false);
148
+ } // 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
149
+
150
+
151
+ setTimeout(function () {
152
+ var _actionRef$current, _actionRef$current$ge;
153
+
154
+ if ((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge = _actionRef$current.getState) === null || _actionRef$current$ge === void 0 ? void 0 : _actionRef$current$ge.call(_actionRef$current).fullScreenState) {
155
+ var _actionRef$current2, _actionRef$current2$r;
156
+
157
+ (_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);
158
+ }
159
+ });
160
+ };
161
+
162
+ if (mode === 'panel') {
163
+ if (expand === false && hasDot) {
164
+ return /*#__PURE__*/_react.default.createElement(_components.Badge, {
165
+ dot: true,
166
+ className: cls('filter-btn')
167
+ }, /*#__PURE__*/_react.default.createElement(_components.Button, {
168
+ onClick: handleBtnClick,
169
+ style: {
170
+ minWidth: 'unset'
171
+ }
172
+ }, /*#__PURE__*/_react.default.createElement(_icon.default, {
173
+ type: expand ? 'up-line' : 'filter-line'
174
+ }), (0, _utils.getMessage)('filter')));
175
+ } else return /*#__PURE__*/_react.default.createElement(_components.Button, {
176
+ onClick: handleBtnClick,
177
+ className: cls('filter-btn'),
178
+ style: {
179
+ minWidth: 'unset'
180
+ }
181
+ }, /*#__PURE__*/_react.default.createElement(_icon.default, {
182
+ type: expand ? 'up-line' : 'filter-line'
183
+ }), (0, _utils.getMessage)('filter'));
184
+ }
185
+ }; // 区域组合渲染
186
+
187
+
188
+ var renderLayout = function renderLayout() {
189
+ if (header && mainAction) {
190
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
191
+ className: cls('wrapper')
192
+ }, /*#__PURE__*/_react.default.createElement("div", {
193
+ className: cls('left')
194
+ }, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header))), /*#__PURE__*/_react.default.createElement("div", {
195
+ className: cls('right')
196
+ }, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
197
+ actionRef: actionRef,
198
+ quickAction: quickAction,
199
+ rowSelection: rowSelection
200
+ }))), /*#__PURE__*/_react.default.createElement("div", {
201
+ className: cls('wrapper')
202
+ }, /*#__PURE__*/_react.default.createElement("div", {
203
+ className: cls('left')
204
+ }, mainAction && renderMainAction(), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
205
+ className: cls('right')
206
+ }, /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
207
+ actionRef: actionRef
208
+ }, otherProps)))), mode === 'panel' && renderPanelFilter());
209
+ } else if (header && !mainAction) {
210
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
211
+ className: cls('wrapper')
212
+ }, /*#__PURE__*/_react.default.createElement("div", {
213
+ className: cls('left')
214
+ }, header && /*#__PURE__*/_react.default.createElement(_utils.Header, _objectSpread({}, header)), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
215
+ className: cls('right')
216
+ }, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
217
+ actionRef: actionRef,
218
+ quickAction: quickAction,
219
+ rowSelection: rowSelection
220
+ }), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
221
+ actionRef: actionRef
222
+ }, otherProps)))), mode === 'panel' && renderPanelFilter());
223
+ } else if (!header && mainAction) {
224
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
225
+ className: cls('wrapper')
226
+ }, /*#__PURE__*/_react.default.createElement("div", {
227
+ className: cls('left')
228
+ }, mainAction && renderMainAction(), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
229
+ className: cls('right')
230
+ }, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
231
+ actionRef: actionRef,
232
+ quickAction: quickAction,
233
+ rowSelection: rowSelection
234
+ }), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
235
+ actionRef: actionRef
236
+ }, otherProps)))), mode === 'panel' && renderPanelFilter());
237
+ } else if (!header && !mainAction) {
238
+ if (!dataFilterForm && !quickAction) {
239
+ return null;
240
+ }
241
+
242
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
243
+ className: cls('wrapper')
244
+ }, /*#__PURE__*/_react.default.createElement("div", {
245
+ className: cls('left')
246
+ }, mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/_react.default.createElement("div", {
247
+ className: cls('right')
248
+ }, quickAction && /*#__PURE__*/_react.default.createElement(_QuickAction.default, {
249
+ actionRef: actionRef,
250
+ quickAction: quickAction,
251
+ rowSelection: rowSelection
252
+ }), /*#__PURE__*/_react.default.createElement(_ToolBar.default, _objectSpread({
253
+ actionRef: actionRef
254
+ }, otherProps)))), mode === 'panel' && renderPanelFilter());
255
+ }
256
+ };
257
+
258
+ return /*#__PURE__*/_react.default.createElement("div", {
259
+ className: cls()
260
+ }, renderLayout());
261
+ };
262
+
263
+ var _default = /*#__PURE__*/_react.default.memo(Layout);
264
+
265
+ exports.default = _default;
@@ -0,0 +1,39 @@
1
+ $prefix: 'teamix-pro-table-layout';
2
+
3
+ .theme-hybridcloud-dark {
4
+ --panel-filter-bg: #1f1f1f;
5
+ }
6
+
7
+ .#{$prefix} {
8
+ &-wrapper {
9
+ display: flex;
10
+ justify-content: space-between;
11
+ margin-bottom: 8px;
12
+ &:not(:first-child) {
13
+ margin-top: 8px;
14
+ }
15
+ }
16
+ &-left {
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: flex-start;
20
+ }
21
+ &-right {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: flex-end;
25
+ }
26
+ &-inline-filter:not(:first-child) {
27
+ margin-left: 8px;
28
+ display: flex;
29
+ align-items: center;
30
+ }
31
+ &-filter-btn:not(:first-child) {
32
+ margin-left: 8px;
33
+ }
34
+ &-panel-filter {
35
+ margin: 8px 0;
36
+ padding: 16px;
37
+ background: var(--panel-filter-bg, #fff);
38
+ }
39
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IActionButton } from '../../../actions';
3
+ import { ProTableActionType, innerRowSelectionType, rowSelectionType } from '../../typing';
4
+ interface QuickActionProps {
5
+ quickAction?: IActionButton | React.ReactNode | React.ReactNode[];
6
+ actionRef: React.MutableRefObject<ProTableActionType | undefined>;
7
+ rowSelection?: innerRowSelectionType | rowSelectionType;
8
+ }
9
+ declare const QuickAction: React.FC<QuickActionProps>;
10
+ export default QuickAction;