@lingxiteam/ebe-utils 0.3.11 → 0.3.12

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 (370) hide show
  1. package/package.json +2 -2
  2. package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/closeIcon.png +0 -0
  3. package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/fileName.png +0 -0
  4. package/lib/pcpublic/src/components/pcfactory/src/StdUpload/assets/img.png +0 -0
  5. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFormatCell.ts +0 -279
  6. package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/customLocale.tsx +0 -6
  7. package/lib/public/src/components/ExpBusiObjModal/index.less +0 -28
  8. package/lib/public/src/components/ExpBusiObjModal/index.tsx +0 -315
  9. package/lib/public/src/components/PreviewFile/index.less +0 -200
  10. package/lib/public/src/components/PreviewFile/index.tsx +0 -787
  11. package/lib/public/src/components/PreviewFile/utils.ts +0 -90
  12. package/lib/public/src/components/common/PreviewFile/index.less +0 -200
  13. package/lib/public/src/components/common/PreviewFile/index.tsx +0 -787
  14. package/lib/public/src/components/common/PreviewFile/utils.ts +0 -90
  15. package/lib/public/src/components/pcfactory/src/Alert/index.tsx +0 -22
  16. package/lib/public/src/components/pcfactory/src/Animation/index.tsx +0 -186
  17. package/lib/public/src/components/pcfactory/src/Animation/useAnimation.ts +0 -270
  18. package/lib/public/src/components/pcfactory/src/Animation/useBackgroundStyle.ts +0 -74
  19. package/lib/public/src/components/pcfactory/src/Audio/index.tsx +0 -240
  20. package/lib/public/src/components/pcfactory/src/BarChart/index.tsx +0 -3
  21. package/lib/public/src/components/pcfactory/src/Button/index.tsx +0 -151
  22. package/lib/public/src/components/pcfactory/src/Card/index.tsx +0 -201
  23. package/lib/public/src/components/pcfactory/src/Card/useExtendBtn.tsx +0 -195
  24. package/lib/public/src/components/pcfactory/src/Cascader/index.tsx +0 -398
  25. package/lib/public/src/components/pcfactory/src/ChartBar/index.tsx +0 -15
  26. package/lib/public/src/components/pcfactory/src/ChartBar/loader.tsx +0 -12
  27. package/lib/public/src/components/pcfactory/src/ChartLine/ChartLine.tsx +0 -48
  28. package/lib/public/src/components/pcfactory/src/ChartLine/PropsType.ts +0 -88
  29. package/lib/public/src/components/pcfactory/src/ChartLine/index.tsx +0 -15
  30. package/lib/public/src/components/pcfactory/src/ChartLine/loader.tsx +0 -12
  31. package/lib/public/src/components/pcfactory/src/Checkbox/index.tsx +0 -144
  32. package/lib/public/src/components/pcfactory/src/CheckboxGroup/index.tsx +0 -319
  33. package/lib/public/src/components/pcfactory/src/Collapse/index.tsx +0 -195
  34. package/lib/public/src/components/pcfactory/src/CollapsePanel/index.tsx +0 -186
  35. package/lib/public/src/components/pcfactory/src/Condition/index.tsx +0 -22
  36. package/lib/public/src/components/pcfactory/src/DatePicker/index.tsx +0 -756
  37. package/lib/public/src/components/pcfactory/src/Description/index.tsx +0 -447
  38. package/lib/public/src/components/pcfactory/src/Description/utils/getLabelSizeMode.ts +0 -40
  39. package/lib/public/src/components/pcfactory/src/Divider/components/CenterLineDivider/index.tsx +0 -190
  40. package/lib/public/src/components/pcfactory/src/Divider/components/CenterTabDivider/index.tsx +0 -77
  41. package/lib/public/src/components/pcfactory/src/Divider/components/LeftCardDivider/index.tsx +0 -87
  42. package/lib/public/src/components/pcfactory/src/Divider/components/LeftLineDivider/index.tsx +0 -106
  43. package/lib/public/src/components/pcfactory/src/Divider/components/LeftTabDivider/index.tsx +0 -60
  44. package/lib/public/src/components/pcfactory/src/Divider/components/LeftTopDivider/index.tsx +0 -55
  45. package/lib/public/src/components/pcfactory/src/Divider/components/LxDashed/index.module.less +0 -10
  46. package/lib/public/src/components/pcfactory/src/Divider/components/LxDashed/index.tsx +0 -143
  47. package/lib/public/src/components/pcfactory/src/Divider/components/LxSolid/index.module.less +0 -10
  48. package/lib/public/src/components/pcfactory/src/Divider/components/LxSolid/index.tsx +0 -126
  49. package/lib/public/src/components/pcfactory/src/Divider/index.tsx +0 -210
  50. package/lib/public/src/components/pcfactory/src/Dropdown/index.tsx +0 -385
  51. package/lib/public/src/components/pcfactory/src/DynamicTabs/PropsType.ts +0 -31
  52. package/lib/public/src/components/pcfactory/src/DynamicTabs/TabPage.tsx +0 -63
  53. package/lib/public/src/components/pcfactory/src/DynamicTabs/index.tsx +0 -214
  54. package/lib/public/src/components/pcfactory/src/Form/Form.tsx +0 -600
  55. package/lib/public/src/components/pcfactory/src/Form/WrapperForm.ts +0 -14
  56. package/lib/public/src/components/pcfactory/src/Form/index.tsx +0 -15
  57. package/lib/public/src/components/pcfactory/src/Form/useFormStatus.ts +0 -47
  58. package/lib/public/src/components/pcfactory/src/Form/useMonitor.ts +0 -40
  59. package/lib/public/src/components/pcfactory/src/FormGroup/TitleComp.tsx +0 -107
  60. package/lib/public/src/components/pcfactory/src/FormGroup/index.tsx +0 -181
  61. package/lib/public/src/components/pcfactory/src/FreeLayout/index.tsx +0 -151
  62. package/lib/public/src/components/pcfactory/src/Gantt/Gantt.tsx +0 -460
  63. package/lib/public/src/components/pcfactory/src/Gantt/const.ts +0 -122
  64. package/lib/public/src/components/pcfactory/src/Gantt/index.tsx +0 -16
  65. package/lib/public/src/components/pcfactory/src/Gantt/loader.tsx +0 -12
  66. package/lib/public/src/components/pcfactory/src/GridView/GridView.tsx +0 -435
  67. package/lib/public/src/components/pcfactory/src/GridView/index.tsx +0 -24
  68. package/lib/public/src/components/pcfactory/src/GridView/loader.tsx +0 -12
  69. package/lib/public/src/components/pcfactory/src/HorizontalView/index.tsx +0 -32
  70. package/lib/public/src/components/pcfactory/src/Icon/IconED/index.tsx +0 -42
  71. package/lib/public/src/components/pcfactory/src/Icon/PropsType.ts +0 -57
  72. package/lib/public/src/components/pcfactory/src/Icon/hooks/index.tsx +0 -300
  73. package/lib/public/src/components/pcfactory/src/Icon/index.tsx +0 -69
  74. package/lib/public/src/components/pcfactory/src/IconFont/index.tsx +0 -24
  75. package/lib/public/src/components/pcfactory/src/Img/BasicImage/index.tsx +0 -90
  76. package/lib/public/src/components/pcfactory/src/Img/assets/placeholder.png +0 -0
  77. package/lib/public/src/components/pcfactory/src/Img/index.tsx +0 -91
  78. package/lib/public/src/components/pcfactory/src/Input/index.tsx +0 -425
  79. package/lib/public/src/components/pcfactory/src/InputNumber/index.tsx +0 -263
  80. package/lib/public/src/components/pcfactory/src/LXPieChart/LXPieChart.tsx +0 -23
  81. package/lib/public/src/components/pcfactory/src/LXPieChart/PropsType.ts +0 -11
  82. package/lib/public/src/components/pcfactory/src/LXPieChart/index.less +0 -6
  83. package/lib/public/src/components/pcfactory/src/LXPieChart/index.tsx +0 -15
  84. package/lib/public/src/components/pcfactory/src/LXPieChart/loader.tsx +0 -12
  85. package/lib/public/src/components/pcfactory/src/LXRadarChart/LXRadarChat.tsx +0 -25
  86. package/lib/public/src/components/pcfactory/src/LXRadarChart/PropsType.ts +0 -9
  87. package/lib/public/src/components/pcfactory/src/LXRadarChart/index.less +0 -7
  88. package/lib/public/src/components/pcfactory/src/LXRadarChart/index.tsx +0 -17
  89. package/lib/public/src/components/pcfactory/src/LXRadarChart/loader.tsx +0 -12
  90. package/lib/public/src/components/pcfactory/src/Layout/index.tsx +0 -130
  91. package/lib/public/src/components/pcfactory/src/Layout/utils.ts +0 -48
  92. package/lib/public/src/components/pcfactory/src/LineChart/index.tsx +0 -3
  93. package/lib/public/src/components/pcfactory/src/Link/index.tsx +0 -117
  94. package/lib/public/src/components/pcfactory/src/LoopList/index.tsx +0 -551
  95. package/lib/public/src/components/pcfactory/src/Menu/index.tsx +0 -422
  96. package/lib/public/src/components/pcfactory/src/ModalSelect/BaseModalSelect.tsx +0 -95
  97. package/lib/public/src/components/pcfactory/src/ModalSelect/index.tsx +0 -453
  98. package/lib/public/src/components/pcfactory/src/MultipleSelect/index.tsx +0 -3
  99. package/lib/public/src/components/pcfactory/src/Pagination/index.tsx +0 -104
  100. package/lib/public/src/components/pcfactory/src/Password/index.tsx +0 -88
  101. package/lib/public/src/components/pcfactory/src/PictureVerifyCode/assets/placeholder.png +0 -0
  102. package/lib/public/src/components/pcfactory/src/PictureVerifyCode/index.tsx +0 -76
  103. package/lib/public/src/components/pcfactory/src/PieChart/index.tsx +0 -3
  104. package/lib/public/src/components/pcfactory/src/Progress/index.tsx +0 -155
  105. package/lib/public/src/components/pcfactory/src/QRCode/const.ts +0 -5
  106. package/lib/public/src/components/pcfactory/src/QRCode/index.tsx +0 -146
  107. package/lib/public/src/components/pcfactory/src/QuillEditor/QuillEditor.tsx +0 -197
  108. package/lib/public/src/components/pcfactory/src/QuillEditor/index.tsx +0 -37
  109. package/lib/public/src/components/pcfactory/src/QuillEditor/loader.ts +0 -12
  110. package/lib/public/src/components/pcfactory/src/RadarChart/RadarChartHook.ts +0 -449
  111. package/lib/public/src/components/pcfactory/src/RadarChart/RadarChartType.ts +0 -39
  112. package/lib/public/src/components/pcfactory/src/RadarChart/RadarECharts.tsx +0 -86
  113. package/lib/public/src/components/pcfactory/src/RadarChart/index.tsx +0 -16
  114. package/lib/public/src/components/pcfactory/src/RadarChart/loader.tsx +0 -12
  115. package/lib/public/src/components/pcfactory/src/RadarChart/radarDefaultConfig.js +0 -55
  116. package/lib/public/src/components/pcfactory/src/Radio/index.tsx +0 -260
  117. package/lib/public/src/components/pcfactory/src/RangePicker/index.tsx +0 -3
  118. package/lib/public/src/components/pcfactory/src/Rate/index.tsx +0 -187
  119. package/lib/public/src/components/pcfactory/src/ReactECharts/PropsType.ts +0 -37
  120. package/lib/public/src/components/pcfactory/src/ReactECharts/ReactECharts.tsx +0 -672
  121. package/lib/public/src/components/pcfactory/src/ReactECharts/index.tsx +0 -26
  122. package/lib/public/src/components/pcfactory/src/ReactECharts/loader.tsx +0 -12
  123. package/lib/public/src/components/pcfactory/src/RemoteComponent/components/FishRender.tsx +0 -31
  124. package/lib/public/src/components/pcfactory/src/RemoteComponent/components/ReactRender.tsx +0 -55
  125. package/lib/public/src/components/pcfactory/src/RemoteComponent/components/VueRender.tsx +0 -32
  126. package/lib/public/src/components/pcfactory/src/RemoteComponent/constant.ts +0 -9
  127. package/lib/public/src/components/pcfactory/src/RemoteComponent/index.tsx +0 -82
  128. package/lib/public/src/components/pcfactory/src/RemoteComponent/remote-component.config.ts +0 -12
  129. package/lib/public/src/components/pcfactory/src/Result/index.tsx +0 -27
  130. package/lib/public/src/components/pcfactory/src/RichTextEditor/LcdpUeditorMain.tsx +0 -105
  131. package/lib/public/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +0 -234
  132. package/lib/public/src/components/pcfactory/src/RichTextEditor/RichTextEditorMain.tsx +0 -41
  133. package/lib/public/src/components/pcfactory/src/RichTextEditor/index.tsx +0 -33
  134. package/lib/public/src/components/pcfactory/src/RichTextEditor/loader.ts +0 -12
  135. package/lib/public/src/components/pcfactory/src/Row/Row.tsx +0 -66
  136. package/lib/public/src/components/pcfactory/src/Row/index.tsx +0 -9
  137. package/lib/public/src/components/pcfactory/src/Row/loader.tsx +0 -12
  138. package/lib/public/src/components/pcfactory/src/Select/index.tsx +0 -628
  139. package/lib/public/src/components/pcfactory/src/Select/selectUtils.ts +0 -257
  140. package/lib/public/src/components/pcfactory/src/Slider/index.tsx +0 -351
  141. package/lib/public/src/components/pcfactory/src/StdUpload/DownloadProgress/DownloadProgress.tsx +0 -27
  142. package/lib/public/src/components/pcfactory/src/StdUpload/DownloadProgress/index.ts +0 -3
  143. package/lib/public/src/components/pcfactory/src/StdUpload/UploadItem.tsx +0 -257
  144. package/lib/public/src/components/pcfactory/src/StdUpload/assets/default.png +0 -0
  145. package/lib/public/src/components/pcfactory/src/StdUpload/assets/js.png +0 -0
  146. package/lib/public/src/components/pcfactory/src/StdUpload/assets/pdf.png +0 -0
  147. package/lib/public/src/components/pcfactory/src/StdUpload/assets/ppt.png +0 -0
  148. package/lib/public/src/components/pcfactory/src/StdUpload/assets/txt.png +0 -0
  149. package/lib/public/src/components/pcfactory/src/StdUpload/assets/word.png +0 -0
  150. package/lib/public/src/components/pcfactory/src/StdUpload/assets/xls.png +0 -0
  151. package/lib/public/src/components/pcfactory/src/StdUpload/assets/zip.png +0 -0
  152. package/lib/public/src/components/pcfactory/src/StdUpload/index.tsx +0 -1050
  153. package/lib/public/src/components/pcfactory/src/StdUpload/uploadItem.less +0 -64
  154. package/lib/public/src/components/pcfactory/src/Steps/constant/checkcircle.tsx +0 -29
  155. package/lib/public/src/components/pcfactory/src/Steps/constant/index.ts +0 -2
  156. package/lib/public/src/components/pcfactory/src/Steps/constant/vector.tsx +0 -13
  157. package/lib/public/src/components/pcfactory/src/Steps/index.tsx +0 -343
  158. package/lib/public/src/components/pcfactory/src/SuperSelect/ComSelect.tsx +0 -538
  159. package/lib/public/src/components/pcfactory/src/SuperSelect/index.tsx +0 -127
  160. package/lib/public/src/components/pcfactory/src/SuperSelect/loader.tsx +0 -12
  161. package/lib/public/src/components/pcfactory/src/Swiper/index.tsx +0 -184
  162. package/lib/public/src/components/pcfactory/src/Switch/index.tsx +0 -219
  163. package/lib/public/src/components/pcfactory/src/TabPane/index.tsx +0 -145
  164. package/lib/public/src/components/pcfactory/src/Table/BodyCell/index.tsx +0 -278
  165. package/lib/public/src/components/pcfactory/src/Table/EditComponent/index.tsx +0 -554
  166. package/lib/public/src/components/pcfactory/src/Table/FormatCell/GhostTag/index.tsx +0 -34
  167. package/lib/public/src/components/pcfactory/src/Table/FormatCell/Hyperlink/index.tsx +0 -26
  168. package/lib/public/src/components/pcfactory/src/Table/FormatCell/PointTag/index.tsx +0 -41
  169. package/lib/public/src/components/pcfactory/src/Table/FormatCell/PureColourFill/index.tsx +0 -32
  170. package/lib/public/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx +0 -34
  171. package/lib/public/src/components/pcfactory/src/Table/FormatCell/index.tsx +0 -227
  172. package/lib/public/src/components/pcfactory/src/Table/HeaderCell/HeaderCellTitle/index.tsx +0 -63
  173. package/lib/public/src/components/pcfactory/src/Table/HeaderCell/index.tsx +0 -32
  174. package/lib/public/src/components/pcfactory/src/Table/TableHead/index.tsx +0 -501
  175. package/lib/public/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +0 -46
  176. package/lib/public/src/components/pcfactory/src/Table/constant.ts +0 -73
  177. package/lib/public/src/components/pcfactory/src/Table/hooks/index.ts +0 -32
  178. package/lib/public/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +0 -325
  179. package/lib/public/src/components/pcfactory/src/Table/hooks/useCheckStrict.ts +0 -176
  180. package/lib/public/src/components/pcfactory/src/Table/hooks/useColumns.tsx +0 -1851
  181. package/lib/public/src/components/pcfactory/src/Table/hooks/useCommon.ts +0 -39
  182. package/lib/public/src/components/pcfactory/src/Table/hooks/useDataSource.ts +0 -201
  183. package/lib/public/src/components/pcfactory/src/Table/hooks/useExpandable.tsx +0 -324
  184. package/lib/public/src/components/pcfactory/src/Table/hooks/useFilter.tsx +0 -274
  185. package/lib/public/src/components/pcfactory/src/Table/hooks/useFormatCell.ts +0 -309
  186. package/lib/public/src/components/pcfactory/src/Table/hooks/usePagination.ts +0 -104
  187. package/lib/public/src/components/pcfactory/src/Table/hooks/useRowEdit.ts +0 -302
  188. package/lib/public/src/components/pcfactory/src/Table/hooks/useRowMerge.ts +0 -93
  189. package/lib/public/src/components/pcfactory/src/Table/hooks/useScroll.ts +0 -120
  190. package/lib/public/src/components/pcfactory/src/Table/hooks/useSelection.ts +0 -467
  191. package/lib/public/src/components/pcfactory/src/Table/hooks/useSort.ts +0 -39
  192. package/lib/public/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +0 -191
  193. package/lib/public/src/components/pcfactory/src/Table/index.tsx +0 -525
  194. package/lib/public/src/components/pcfactory/src/Table/utils/SequenceId.ts +0 -104
  195. package/lib/public/src/components/pcfactory/src/Table/utils/index.ts +0 -442
  196. package/lib/public/src/components/pcfactory/src/Tabs/index.tsx +0 -209
  197. package/lib/public/src/components/pcfactory/src/Tag/index.tsx +0 -39
  198. package/lib/public/src/components/pcfactory/src/Text/index.tsx +0 -191
  199. package/lib/public/src/components/pcfactory/src/TextArea/ForIETextArea.tsx +0 -96
  200. package/lib/public/src/components/pcfactory/src/TextArea/index.tsx +0 -255
  201. package/lib/public/src/components/pcfactory/src/TimePicker/index.tsx +0 -3
  202. package/lib/public/src/components/pcfactory/src/TlrView/index.tsx +0 -3
  203. package/lib/public/src/components/pcfactory/src/TooltipView/PropsType.ts +0 -22
  204. package/lib/public/src/components/pcfactory/src/TooltipView/TooltipViewED/index.tsx +0 -10
  205. package/lib/public/src/components/pcfactory/src/TooltipView/hooks/index.tsx +0 -90
  206. package/lib/public/src/components/pcfactory/src/TooltipView/index.tsx +0 -13
  207. package/lib/public/src/components/pcfactory/src/Transfer/index.tsx +0 -753
  208. package/lib/public/src/components/pcfactory/src/Tree/TreeNodeMenu/index.tsx +0 -102
  209. package/lib/public/src/components/pcfactory/src/Tree/index.tsx +0 -1303
  210. package/lib/public/src/components/pcfactory/src/TreeSelect/index.tsx +0 -639
  211. package/lib/public/src/components/pcfactory/src/TreeTable/hooks/index.ts +0 -4
  212. package/lib/public/src/components/pcfactory/src/TreeTable/hooks/useCMDAction.ts +0 -82
  213. package/lib/public/src/components/pcfactory/src/TreeTable/hooks/useExpandable.tsx +0 -61
  214. package/lib/public/src/components/pcfactory/src/TreeTable/index.tsx +0 -273
  215. package/lib/public/src/components/pcfactory/src/Upload/Upload.tsx +0 -740
  216. package/lib/public/src/components/pcfactory/src/Upload/index.tsx +0 -29
  217. package/lib/public/src/components/pcfactory/src/Upload/loader.tsx +0 -13
  218. package/lib/public/src/components/pcfactory/src/VerificationCode/assets/placeholder.png +0 -0
  219. package/lib/public/src/components/pcfactory/src/VerificationCode/index.tsx +0 -297
  220. package/lib/public/src/components/pcfactory/src/VerticalView/index.tsx +0 -25
  221. package/lib/public/src/components/pcfactory/src/VideoPlayer/index.tsx +0 -159
  222. package/lib/public/src/components/pcfactory/src/View/index.tsx +0 -150
  223. package/lib/public/src/components/pcfactory/src/View/useBackgroundStyle.ts +0 -75
  224. package/lib/public/src/components/pcfactory/src/VirtualGroup/index.tsx +0 -16
  225. package/lib/public/src/components/pcfactory/src/Webview/index.tsx +0 -104
  226. package/lib/public/src/components/pcfactory/src/index.component.ts +0 -253
  227. package/lib/public/src/components/pcfactory/src/styles/common.less +0 -107
  228. package/lib/public/src/components/pcfactory/src/styles/compatible.less +0 -976
  229. package/lib/public/src/components/pcfactory/src/styles/components/Alert.less +0 -25
  230. package/lib/public/src/components/pcfactory/src/styles/components/Audio.less +0 -198
  231. package/lib/public/src/components/pcfactory/src/styles/components/Button.less +0 -32
  232. package/lib/public/src/components/pcfactory/src/styles/components/Card.less +0 -155
  233. package/lib/public/src/components/pcfactory/src/styles/components/Cascader.less +0 -54
  234. package/lib/public/src/components/pcfactory/src/styles/components/Checkbox.less +0 -7
  235. package/lib/public/src/components/pcfactory/src/styles/components/Collapse.less +0 -214
  236. package/lib/public/src/components/pcfactory/src/styles/components/DatePicker.less +0 -22
  237. package/lib/public/src/components/pcfactory/src/styles/components/Description.less +0 -64
  238. package/lib/public/src/components/pcfactory/src/styles/components/Divider.less +0 -530
  239. package/lib/public/src/components/pcfactory/src/styles/components/Drawer.less +0 -54
  240. package/lib/public/src/components/pcfactory/src/styles/components/Dropdown.less +0 -11
  241. package/lib/public/src/components/pcfactory/src/styles/components/DynamicDataContainer.less +0 -16
  242. package/lib/public/src/components/pcfactory/src/styles/components/DynamicTabs.less +0 -254
  243. package/lib/public/src/components/pcfactory/src/styles/components/Form.less +0 -265
  244. package/lib/public/src/components/pcfactory/src/styles/components/FormGroup.less +0 -111
  245. package/lib/public/src/components/pcfactory/src/styles/components/Gantt.less +0 -139
  246. package/lib/public/src/components/pcfactory/src/styles/components/GridView.less +0 -62
  247. package/lib/public/src/components/pcfactory/src/styles/components/Icon.less +0 -20
  248. package/lib/public/src/components/pcfactory/src/styles/components/Input.less +0 -164
  249. package/lib/public/src/components/pcfactory/src/styles/components/InputNumber.less +0 -124
  250. package/lib/public/src/components/pcfactory/src/styles/components/InputPassword.less +0 -3
  251. package/lib/public/src/components/pcfactory/src/styles/components/Link.less +0 -4
  252. package/lib/public/src/components/pcfactory/src/styles/components/LoopList.less +0 -67
  253. package/lib/public/src/components/pcfactory/src/styles/components/Menu.less +0 -54
  254. package/lib/public/src/components/pcfactory/src/styles/components/ModalSelect.less +0 -42
  255. package/lib/public/src/components/pcfactory/src/styles/components/Popconfirm.less +0 -7
  256. package/lib/public/src/components/pcfactory/src/styles/components/Progress.less +0 -57
  257. package/lib/public/src/components/pcfactory/src/styles/components/QuillEditor.less +0 -15
  258. package/lib/public/src/components/pcfactory/src/styles/components/Radio.less +0 -7
  259. package/lib/public/src/components/pcfactory/src/styles/components/Rate.less +0 -16
  260. package/lib/public/src/components/pcfactory/src/styles/components/Result.less +0 -26
  261. package/lib/public/src/components/pcfactory/src/styles/components/Select.less +0 -146
  262. package/lib/public/src/components/pcfactory/src/styles/components/Slider.less +0 -78
  263. package/lib/public/src/components/pcfactory/src/styles/components/StdUpload.less +0 -225
  264. package/lib/public/src/components/pcfactory/src/styles/components/Step.less +0 -91
  265. package/lib/public/src/components/pcfactory/src/styles/components/SuperSelect.less +0 -83
  266. package/lib/public/src/components/pcfactory/src/styles/components/Swiper.less +0 -106
  267. package/lib/public/src/components/pcfactory/src/styles/components/Switch.less +0 -49
  268. package/lib/public/src/components/pcfactory/src/styles/components/Table.less +0 -1229
  269. package/lib/public/src/components/pcfactory/src/styles/components/Tabs.less +0 -291
  270. package/lib/public/src/components/pcfactory/src/styles/components/Tag.less +0 -107
  271. package/lib/public/src/components/pcfactory/src/styles/components/TextArea.less +0 -12
  272. package/lib/public/src/components/pcfactory/src/styles/components/TooltipView.less +0 -43
  273. package/lib/public/src/components/pcfactory/src/styles/components/Transfer.less +0 -155
  274. package/lib/public/src/components/pcfactory/src/styles/components/Tree.less +0 -329
  275. package/lib/public/src/components/pcfactory/src/styles/components/TreeSelect.less +0 -65
  276. package/lib/public/src/components/pcfactory/src/styles/components/Upload.less +0 -26
  277. package/lib/public/src/components/pcfactory/src/styles/components/VerificationCode.less +0 -162
  278. package/lib/public/src/components/pcfactory/src/styles/components/Webview.less +0 -31
  279. package/lib/public/src/components/pcfactory/src/styles/index.less +0 -10
  280. package/lib/public/src/components/pcfactory/src/styles/index.ued.less +0 -65
  281. package/lib/public/src/components/pcfactory/src/styles/theme/variables/antdVariables.less +0 -84
  282. package/lib/public/src/components/pcfactory/src/styles/theme/variables/common.less +0 -9
  283. package/lib/public/src/components/pcfactory/src/styles/theme/variables/customVariables.less +0 -35
  284. package/lib/public/src/components/pcfactory/src/styles/theme/variables/index.less +0 -2
  285. package/lib/public/src/components/pcfactory/src/utils/ChannelContainer.tsx +0 -150
  286. package/lib/public/src/components/pcfactory/src/utils/ChildRender.ts +0 -103
  287. package/lib/public/src/components/pcfactory/src/utils/CustomModule.tsx +0 -134
  288. package/lib/public/src/components/pcfactory/src/utils/DummyFormContext.ts +0 -136
  289. package/lib/public/src/components/pcfactory/src/utils/Empty/customLocale.tsx +0 -6
  290. package/lib/public/src/components/pcfactory/src/utils/Empty/empty.tsx +0 -37
  291. package/lib/public/src/components/pcfactory/src/utils/LoaderHelper.tsx +0 -29
  292. package/lib/public/src/components/pcfactory/src/utils/PropsType.ts +0 -21
  293. package/lib/public/src/components/pcfactory/src/utils/WithSyncValue.ts +0 -218
  294. package/lib/public/src/components/pcfactory/src/utils/ahooks/index.ts +0 -22
  295. package/lib/public/src/components/pcfactory/src/utils/ahooks/useCreation.ts +0 -23
  296. package/lib/public/src/components/pcfactory/src/utils/ahooks/useDeepCompareEffect.ts +0 -27
  297. package/lib/public/src/components/pcfactory/src/utils/ahooks/useMap.ts +0 -46
  298. package/lib/public/src/components/pcfactory/src/utils/ahooks/useMemoizedFn.ts +0 -27
  299. package/lib/public/src/components/pcfactory/src/utils/ahooks/usePrevious.ts +0 -19
  300. package/lib/public/src/components/pcfactory/src/utils/ahooks/useSafeState.ts +0 -26
  301. package/lib/public/src/components/pcfactory/src/utils/ahooks/useSetState.ts +0 -26
  302. package/lib/public/src/components/pcfactory/src/utils/ahooks/useUnmountedRef.ts +0 -14
  303. package/lib/public/src/components/pcfactory/src/utils/ahooks/useUpdate.ts +0 -9
  304. package/lib/public/src/components/pcfactory/src/utils/ahooks/useUpdateEffect.ts +0 -16
  305. package/lib/public/src/components/pcfactory/src/utils/basicStatusTransfer.ts +0 -32
  306. package/lib/public/src/components/pcfactory/src/utils/common.ts +0 -367
  307. package/lib/public/src/components/pcfactory/src/utils/dynamicUtils/DynamicContext.tsx +0 -106
  308. package/lib/public/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +0 -131
  309. package/lib/public/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +0 -646
  310. package/lib/public/src/components/pcfactory/src/utils/formUtils/WrapperContainer.tsx +0 -123
  311. package/lib/public/src/components/pcfactory/src/utils/formUtils/cmdHelper.ts +0 -411
  312. package/lib/public/src/components/pcfactory/src/utils/formUtils/common.ts +0 -28
  313. package/lib/public/src/components/pcfactory/src/utils/getExportDefaultObj.ts +0 -11
  314. package/lib/public/src/components/pcfactory/src/utils/hooks/useCommonImperativeHandle.ts +0 -140
  315. package/lib/public/src/components/pcfactory/src/utils/hooks/useDataMask.ts +0 -83
  316. package/lib/public/src/components/pcfactory/src/utils/hooks/useDoubleClick.ts +0 -63
  317. package/lib/public/src/components/pcfactory/src/utils/hooks/useFuncExpExecute.ts +0 -86
  318. package/lib/public/src/components/pcfactory/src/utils/hooks/useGetStaticAttrData.ts +0 -41
  319. package/lib/public/src/components/pcfactory/src/utils/hooks/useHiddenStyle.ts +0 -43
  320. package/lib/public/src/components/pcfactory/src/utils/hooks/useInitReactQuill.ts +0 -90
  321. package/lib/public/src/components/pcfactory/src/utils/hooks/useListenState.ts +0 -26
  322. package/lib/public/src/components/pcfactory/src/utils/hooks/useLocale.ts +0 -129
  323. package/lib/public/src/components/pcfactory/src/utils/hooks/usePrintMode.tsx +0 -80
  324. package/lib/public/src/components/pcfactory/src/utils/hooks/useRules.ts +0 -89
  325. package/lib/public/src/components/pcfactory/src/utils/hooks/useTestHelper.ts +0 -26
  326. package/lib/public/src/components/pcfactory/src/utils/hooks/useToggleBoolean.ts +0 -33
  327. package/lib/public/src/components/pcfactory/src/utils/index.ts +0 -19
  328. package/lib/public/src/components/pcfactory/src/utils/polyfill.js +0 -305
  329. package/lib/public/src/components/pcfactory/src/utils/renderReadOnly.tsx +0 -105
  330. package/lib/public/src/components/pcfactory/src/variables.ts +0 -2
  331. package/lib/public/src/components/pcfactory/typings.d.ts +0 -27
  332. package/lib/public/src/hooks/useGenerateContext.ts +0 -73
  333. package/lib/public/src/styles/common.less +0 -41
  334. package/lib/public/src/styles/index.less +0 -4
  335. package/lib/public/src/styles/index.ts +0 -1
  336. package/lib/public/src/styles/theme/variables.less +0 -130
  337. package/lib/public/src/utils/LcdpSpin/index.less +0 -13
  338. package/lib/public/src/utils/LcdpSpin/index.tsx +0 -12
  339. package/lib/public/src/utils/ModalManager/Drawer/index.less +0 -30
  340. package/lib/public/src/utils/ModalManager/Drawer/index.tsx +0 -109
  341. package/lib/public/src/utils/ModalManager/Modal/index.less +0 -7
  342. package/lib/public/src/utils/ModalManager/Modal/index.tsx +0 -96
  343. package/lib/public/src/utils/ModalManager/index.tsx +0 -278
  344. package/lib/public/src/utils/Security/encipher/des.ts +0 -52
  345. package/lib/public/src/utils/customFuncMapping.ts +0 -107
  346. package/lib/public/src/utils/formUtils.ts +0 -458
  347. package/lib/public/src/utils/i18n/i18n.ts +0 -15
  348. package/lib/public/src/utils/i18n/index.ts +0 -7
  349. package/lib/public/src/utils/i18n/locale/app/en_US.ts +0 -77
  350. package/lib/public/src/utils/i18n/locale/app/index.ts +0 -9
  351. package/lib/public/src/utils/i18n/locale/app/otherLocale.ts +0 -2
  352. package/lib/public/src/utils/i18n/locale/app/zh_CN.ts +0 -65
  353. package/lib/public/src/utils/i18n/locale/app/zh_HK.ts +0 -66
  354. package/lib/public/src/utils/i18n/locale/base/en_US.ts +0 -449
  355. package/lib/public/src/utils/i18n/locale/base/index.ts +0 -5
  356. package/lib/public/src/utils/i18n/locale/base/zh_CN.ts +0 -413
  357. package/lib/public/src/utils/i18n/locale/base/zh_HK.ts +0 -411
  358. package/lib/public/src/utils/i18n/locale/pc/en_US.ts +0 -131
  359. package/lib/public/src/utils/i18n/locale/pc/index.ts +0 -9
  360. package/lib/public/src/utils/i18n/locale/pc/otherLocale.ts +0 -2
  361. package/lib/public/src/utils/i18n/locale/pc/zh_CN.ts +0 -105
  362. package/lib/public/src/utils/i18n/locale/pc/zh_HK.ts +0 -105
  363. package/lib/public/src/utils/i18n/localeMonitor.ts +0 -71
  364. package/lib/public/src/utils/i18n/locales.ts +0 -30
  365. package/lib/public/src/utils/i18n/replaceMessage.ts +0 -29
  366. package/lib/public/src/utils/i18n/types.ts +0 -2
  367. package/lib/public/src/utils/i18n/useLocale.ts +0 -129
  368. package/lib/public/src/utils/messageApi.ts +0 -93
  369. package/lib/public/src/utils/useTool.ts +0 -428
  370. /package/lib/public/src/utils/functors/{DATEADD.ts → dateAdd.ts} +0 -0
@@ -1,467 +0,0 @@
1
- import { TableRowSelection } from 'antd/lib/table/interface';
2
- import { useEffect, useMemo, useRef, useState } from 'react';
3
- import { MyTableProps } from '../types/prop';
4
- import { recursionDataSource } from '../utils';
5
- import useCheckStrict from './useCheckStrict';
6
-
7
- type selectionProps<T> = {
8
- innerDataSource: T[];
9
- currentRowKey: string;
10
- currentPageDataSource: T[];
11
- checkIfHiddenRow?: Function;
12
- hasPageChangeEvent?: boolean;
13
- funcExpExecute: Function;
14
- };
15
- const useSelection = <T extends { [key: string]: unknown }>(
16
- props: MyTableProps & selectionProps<T>,
17
- ) => {
18
- const {
19
- innerDataSource,
20
- currentRowKey,
21
- currentPageDataSource,
22
- checkIfHiddenRow,
23
- page,
24
- hasPageChangeEvent,
25
- rowSelection,
26
- rowSelectionDisabled,
27
- onSelectChange,
28
- funcExpExecute,
29
- checkLoosed,
30
- expandable,
31
- } = props;
32
-
33
- const { childrenColumnName = 'children' } = expandable || {};
34
-
35
- const [selectedRows, setSelectedRows] = useState<any[]>([]);
36
- const [selectedRowKeys, setSelectedRowKeys] = useState<any[]>([]);
37
- const [currentPageSelectedRows, setCurrentPageSelectedRows] = useState<any[]>(
38
- [],
39
- );
40
- const [currentPageSelectedRowKeys, setCurrentPageSelectedRowKeys] = useState<
41
- any[]
42
- >([]);
43
- const {
44
- checkStrictly,
45
- relatedDisabledMap,
46
- markDisable,
47
- triggerSingleSelection,
48
- triggerFullSelection,
49
- } = useCheckStrict<T>({
50
- dataSource: innerDataSource,
51
- currentRowKey,
52
- rowSelectType: rowSelection?.type,
53
- checkLoosed,
54
- childrenKey: childrenColumnName,
55
- });
56
-
57
- // 记录动作+操作选中的keys,包括跨页和非法的key
58
- const combineSelectedRowKeysRef = useRef<any[]>([]);
59
- const hiddenKeysRef = useRef<any[]>([]);
60
- const updateCombineKeys = (keys: string[], action = false) => {
61
- // 通过动作设置选中数据时,是追加而非覆盖
62
- const curKeys = action ? combineSelectedRowKeysRef.current : keys;
63
- if (action) {
64
- // hiddenKeysRef记录的是动作设置的,string类型的,且不在当前页面展示的选中key,等数据被加载后需要显示选中
65
- hiddenKeysRef.current = keys;
66
- } else {
67
- // 当更新当前selectedKeys时,从hiddenKeys中过滤掉页面上已展示过的
68
- // 配置时兼容key为数字or字符串的情况
69
- const currentMap: Record<string | number, boolean> = keys.reduce(
70
- (p, n) => {
71
- p[n] = true;
72
- return p;
73
- },
74
- {} as any,
75
- );
76
- hiddenKeysRef.current = hiddenKeysRef.current.filter(
77
- (k) => !currentMap[k],
78
- );
79
- }
80
- // 更新表格所有的选中key
81
- combineSelectedRowKeysRef.current = [
82
- ...new Set([...curKeys, ...hiddenKeysRef.current]),
83
- ];
84
- };
85
-
86
- // 给动作专用
87
- const [actionSetSelectRowsObject, updateSelectRowsObject] = useState<any>();
88
-
89
- /**
90
- * 判断可选表格某行是否允许界面选中
91
- * @param row 某行数据对象
92
- * @param index 某行所处当前页行索引
93
- * @returns
94
- */
95
- const handleIsRowSelectDisabled = (row: any, index?: number) => {
96
- // 存量:配置态生成的DSL是包含的完整代码的对象
97
- if (rowSelectionDisabled?.code) {
98
- return funcExpExecute(rowSelectionDisabled.code, [
99
- {
100
- key: 'row',
101
- value: row,
102
- },
103
- {
104
- key: 'index',
105
- value: index,
106
- },
107
- ]);
108
- }
109
- if (rowSelectionDisabled) {
110
- /**
111
- * 新版:配置态生成的DSL就是一个$$包含函数的表达式
112
- * 但会经过预处理移除 $$
113
- */
114
- return funcExpExecute(rowSelectionDisabled, [
115
- {
116
- key: 'row',
117
- value: row,
118
- },
119
- {
120
- key: 'index',
121
- value: index,
122
- },
123
- ]);
124
- }
125
-
126
- return false;
127
- };
128
-
129
- /**
130
- * 获取所有页选中行数据
131
- * @param _selectedRows 当前选中的行数据
132
- * @returns
133
- */
134
- const handleAllPageSelectedRows = (_selectedRows: any[] = []) => {
135
- // 当 未配置页面回调事件 时,认为是前端分页,此时,_selectedRows 就代表所有页选中行数据
136
- if (!hasPageChangeEvent) {
137
- return _selectedRows;
138
- }
139
-
140
- // 当 配置页面回调事件 时,认为是后端分页,此时,_selectedRows 代表当前页选中数据,需要特殊处理
141
- if (currentRowKey) {
142
- // 移除当前所有页行选中中,当前页对应的选中
143
- const otherPageSelectedRows = selectedRows.filter((selectedRow) => {
144
- return !innerDataSource.some(
145
- (row: any) => row[currentRowKey] === selectedRow[currentRowKey],
146
- );
147
- });
148
-
149
- // 重新补回最新的当前页的选中数据,返回所有页选中行数据
150
- return [...otherPageSelectedRows, ..._selectedRows];
151
- }
152
-
153
- return _selectedRows;
154
- };
155
-
156
- /**
157
- * 获取当前页选中行数据
158
- * @param selectedRows 当前最新的选中的行数据
159
- * @returns
160
- */
161
- const handleCurrentPageSelectedRows = (selectedRows: any[] = []) => {
162
- let currentPageSeletedRows = [];
163
-
164
- if (currentRowKey) {
165
- const currentPageKey = new Set<string>();
166
- // 记录当前页数据(包括层级数据)的主键集合
167
- recursionDataSource(
168
- currentPageDataSource,
169
- (n) => {
170
- currentPageKey.add(n[currentRowKey] as string);
171
- },
172
- childrenColumnName,
173
- );
174
- // 在当前最新的选中的行数据中,找到属于当前页的、且可选中数据
175
- currentPageSeletedRows = selectedRows.filter((selectedRow) => {
176
- return currentPageKey.has(selectedRow[currentRowKey]);
177
- });
178
- }
179
-
180
- return currentPageSeletedRows;
181
- };
182
-
183
- /**
184
- * 处理复选框、单选按钮选中
185
- * @param _selectedRows 当前选中的行数据(在dataSource中真正有的行数据)
186
- * 注:selectedRowKeys 中不在 dataSource 的,rows 不包含
187
- */
188
- const handleSelect = (_selectedRows: any[]) => {
189
- // 单选
190
- if (rowSelection?.type === 'radio') {
191
- onRowSelected(_selectedRows, true, _selectedRows);
192
- } else {
193
- // 多选
194
- const allPageSelectedRows = handleAllPageSelectedRows(_selectedRows);
195
-
196
- let currentPageSelectedRows;
197
-
198
- /**
199
- * 1、当 配置页面回调事件 时,认为是后端分页,此时,_selectedRows 就代表当前页选中数据
200
- * 2、当 未配置页面回调事件(前端分页) 且 未开启分页 时,认为只有一页,此时,_selectedRows 就代表当前页选中数据
201
- */
202
- if (hasPageChangeEvent || !page) {
203
- currentPageSelectedRows = _selectedRows;
204
- }
205
-
206
- onRowSelected(allPageSelectedRows, true, currentPageSelectedRows);
207
- }
208
- };
209
-
210
- const onRowSelected = (
211
- _sltrows: any[],
212
- doOnSelectChange: boolean,
213
- _currentPageSelectedRows?: any[],
214
- ) => {
215
- const sltrows: any = currentRowKey ? _sltrows : [];
216
-
217
- const sltkeys: any = sltrows.map((row: any) => row[currentRowKey]);
218
-
219
- setSelectedRows(sltrows);
220
- updateCombineKeys(sltkeys);
221
- setSelectedRowKeys(sltkeys);
222
-
223
- let newCurrentPageSelectedRows: any = currentRowKey
224
- ? _currentPageSelectedRows
225
- : [];
226
- let newCurrentPageSelectedRowKeys = newCurrentPageSelectedRows?.map(
227
- (r: any) => r[currentRowKey],
228
- );
229
-
230
- if (!_currentPageSelectedRows) {
231
- newCurrentPageSelectedRows = currentRowKey
232
- ? handleCurrentPageSelectedRows(sltrows)
233
- : [];
234
- newCurrentPageSelectedRowKeys = newCurrentPageSelectedRows.map(
235
- (r: any) => r[currentRowKey],
236
- );
237
- }
238
-
239
- // 更新当前页选中数据
240
- setCurrentPageSelectedRows(newCurrentPageSelectedRows);
241
- setCurrentPageSelectedRowKeys(newCurrentPageSelectedRowKeys);
242
-
243
- if (typeof onSelectChange === 'function' && doOnSelectChange) {
244
- const oldSelectedKeys = selectedRowKeys.sort();
245
- const newSelectedKeys = sltkeys.sort();
246
-
247
- // 当选中数据变更时,才需要触发选中回调
248
- if (JSON.stringify(oldSelectedKeys) !== JSON.stringify(newSelectedKeys)) {
249
- onSelectChange(sltkeys, sltrows);
250
- }
251
- }
252
- };
253
-
254
- const onRowSelectClick = (record: any, index?: number) => {
255
- // 行禁用,不允许界面选中
256
- if (rowSelection && !handleIsRowSelectDisabled(record, index)) {
257
- if (selectedRowKeys.includes(record[currentRowKey])) {
258
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
259
- rowSelection.type === 'radio'
260
- ? onRowSelected([record], true)
261
- : onRowSelected(triggerSingleSelection(selectedRows, record), true);
262
- } else {
263
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
264
- rowSelection.type === 'radio'
265
- ? onRowSelected([record], true)
266
- : onRowSelected(triggerSingleSelection(selectedRows, record), true);
267
- }
268
- }
269
- };
270
-
271
- // 设置选中行动作设置的默认选中
272
- const handleUpdateSelectedRows = (
273
- selectedRowsRule: string | string[] | T[],
274
- ) => {
275
- let actionSetSelectedKeys: any = [];
276
- // 记录设置选中行时配置的对象格式格数据
277
- const rowsObject = new Map();
278
- if (selectedRowsRule) {
279
- if (!['string', 'object'].includes(typeof selectedRowsRule)) {
280
- // TODO: (2022.7.27 与国永沟通),废弃旧版本在表格内部对 $$ 表达式的解析
281
- console.warn(
282
- '请检查配置数据,现有版本只支持(行id字符串或数组、行对象)',
283
- );
284
- updateSelectRowsObject(rowsObject);
285
- return;
286
- }
287
-
288
- // '1' / '1,2,3' / 1,2,3 代表选中行的行id
289
- if (typeof selectedRowsRule === 'string') {
290
- actionSetSelectedKeys =
291
- selectedRowsRule?.split(',').map((k) => k.trim()) || [];
292
- }
293
-
294
- // 处理 [{ [rowId]: '1'} ...] 或 ['1', '2'] 或 [1, 2]
295
- if (Array.isArray(selectedRowsRule)) {
296
- actionSetSelectedKeys = selectedRowsRule
297
- .map((one) => {
298
- if (['string', 'number'].includes(typeof one)) {
299
- return one;
300
- }
301
-
302
- if (typeof one === 'object' && !Array.isArray(one) && one) {
303
- const rowKey = one[currentRowKey];
304
- if (rowKey) {
305
- rowsObject.set(rowKey, one);
306
- }
307
- return rowKey;
308
- }
309
-
310
- return undefined;
311
- })
312
- .filter((one) => !!one);
313
- }
314
-
315
- // 代表行数据对象
316
- if (
317
- !Array.isArray(selectedRowsRule) &&
318
- typeof selectedRowsRule === 'object'
319
- ) {
320
- const selectedRowKey = selectedRowsRule[currentRowKey];
321
- if (selectedRowKey) {
322
- rowsObject.set(selectedRowKey, selectedRowsRule);
323
- }
324
- actionSetSelectedKeys = selectedRowKey ? [selectedRowKey] : [];
325
- }
326
- }
327
-
328
- updateCombineKeys(actionSetSelectedKeys, true);
329
- updateSelectRowsObject(rowsObject);
330
- };
331
-
332
- // 可选表格当前页不允许选择的行数据
333
- const currentPageDisabledRows = useMemo(() => {
334
- return currentPageDataSource.filter((row: any, index: number) =>
335
- handleIsRowSelectDisabled(row, index),
336
- );
337
- }, [currentPageDataSource]);
338
-
339
- useEffect(() => {
340
- if (currentRowKey) {
341
- const keySet: Record<string | number, unknown> = {};
342
- const map: any = {};
343
- // 数据源变更需要更新当前选中行的数据,保证获取时能获取到当前最新的数据详情
344
- recursionDataSource<{ [k: string]: any; children?: any[] }>(
345
- innerDataSource as [],
346
- (n) => {
347
- map[n[currentRowKey]] = n;
348
- },
349
- childrenColumnName,
350
- );
351
-
352
- const rows = [];
353
- selectedRows.forEach((selectedRow) => {
354
- const key = selectedRow[currentRowKey];
355
- if (!map[key]) {
356
- map[key] = selectedRow;
357
- }
358
- });
359
-
360
- const actionRows: any[] = [];
361
- const collectSelectedRow = (key: string | number, childFlag = false) => {
362
- if (!keySet[key]) {
363
- const row = map[key] || actionSetSelectRowsObject.get(key);
364
- const canSelected = childFlag
365
- ? !relatedDisabledMap[row[currentRowKey]]
366
- : true;
367
- // 通过动作设置选中的禁用节点,允许选中
368
- // 通过动作设置选中父节点时,非禁用的子级数据也需要选中
369
- if (row && canSelected) {
370
- keySet[key] = row;
371
- actionRows.push(row);
372
- if (row?.[childrenColumnName]?.length && !checkStrictly) {
373
- recursionDataSource<{ [k: string]: any }>(
374
- row[childrenColumnName],
375
- (n) => {
376
- if (n[currentRowKey]) {
377
- collectSelectedRow(n[currentRowKey], true);
378
- }
379
- },
380
- childrenColumnName,
381
- );
382
- }
383
- }
384
- }
385
- };
386
- const fullKeys = triggerFullSelection(
387
- combineSelectedRowKeysRef.current || [],
388
- );
389
- // 遍历所有选中keys,组装当前选中行
390
- fullKeys.forEach((key: string | number) => {
391
- collectSelectedRow(key);
392
- });
393
- rows.push(...actionRows);
394
- onRowSelected(rows, true);
395
- }
396
- }, [
397
- actionSetSelectRowsObject,
398
- currentRowKey,
399
- innerDataSource,
400
- childrenColumnName,
401
- ]);
402
-
403
- // 分页更新时,更新当前页选中数据
404
- useEffect(() => {
405
- const newCurrentPageSelectedRows =
406
- handleCurrentPageSelectedRows(selectedRows);
407
- const newCurrentPageSelectedRowKeys = newCurrentPageSelectedRows.map(
408
- (r: any) => r[currentRowKey],
409
- );
410
- setCurrentPageSelectedRows(newCurrentPageSelectedRows);
411
- setCurrentPageSelectedRowKeys(newCurrentPageSelectedRowKeys);
412
- }, [selectedRows, currentRowKey, currentPageDataSource]);
413
-
414
- return {
415
- rowSelection: rowSelection
416
- ? {
417
- type: rowSelection.type,
418
- selectedRowKeys,
419
- checkStrictly,
420
- onChange: (_: any, sltrows: any[]) => handleSelect(sltrows),
421
- getCheckboxProps: (record: T) => {
422
- const props: ReturnType<
423
- Required<TableRowSelection<unknown>>['getCheckboxProps']
424
- > = {
425
- disabled: relatedDisabledMap[record[currentRowKey] as string],
426
- };
427
-
428
- /**
429
- * 决定可选表格某行是否可选
430
- * 由于此接口不支持索引 index 操作,所以 index 定位行逻辑放在 currentPageDisabledRows,以此兼容
431
- */
432
- const isRowSelectDisabled =
433
- handleIsRowSelectDisabled(record) ||
434
- !!currentPageDisabledRows.find(
435
- (row) => row[currentRowKey] === record[currentRowKey],
436
- );
437
-
438
- if (
439
- isRowSelectDisabled ||
440
- checkIfHiddenRow?.(record[currentRowKey])
441
- ) {
442
- props.disabled = true;
443
- }
444
-
445
- // 开启checkLoosed模式时,父禁用子也禁用
446
- markDisable(record, props.disabled || false);
447
-
448
- return props;
449
- },
450
- }
451
- : undefined,
452
- selectedRows,
453
- selectedRowKeys,
454
- currentPageSelectedRows,
455
- currentPageSelectedRowKeys,
456
- setSelectedRows,
457
- setSelectedRowKeys,
458
- setCurrentPageSelectedRows,
459
- setCurrentPageSelectedRowKeys,
460
- setSelectedRowsRule: handleUpdateSelectedRows,
461
- onRowSelected,
462
- onRowSelectClick,
463
- checkStrictly,
464
- };
465
- };
466
-
467
- export default useSelection;
@@ -1,39 +0,0 @@
1
- import { useMemo, useState } from 'react';
2
- import { compareFn } from '../utils';
3
-
4
- const useSort = (props: any) => {
5
- const { innerDataSource, onSortChange } = props;
6
-
7
- const hasSortEvent = typeof onSortChange === 'function'; // 是否配置表格排序事件
8
-
9
- // 开启了行合并后由前端进行排序
10
- const [sortOrder, setSortOrder] = useState<
11
- | {
12
- field: string;
13
- order?: string;
14
- }
15
- | undefined
16
- >();
17
-
18
- // 前端排序后的数据
19
- const sortDataSource = useMemo(() => {
20
- if (!sortOrder?.order) {
21
- return innerDataSource;
22
- }
23
- return [...innerDataSource].sort((a, b) => {
24
- if (sortOrder?.order === 'ascend') {
25
- return compareFn(a[sortOrder?.field], b[sortOrder?.field]);
26
- }
27
- return compareFn(b[sortOrder?.field], a[sortOrder?.field]);
28
- });
29
- }, [innerDataSource, sortOrder]);
30
-
31
- return {
32
- onSortChange,
33
- sortDataSource,
34
- setSortOrder,
35
- hasSortEvent,
36
- };
37
- };
38
-
39
- export default useSort;
@@ -1,191 +0,0 @@
1
- import { TableColumnProps } from 'antd';
2
- import { useMemo } from 'react';
3
- import { SummaryConfig } from '../types/prop';
4
-
5
- export type ColItem = {
6
- /**
7
- * 总结行类型 sub 合计
8
- */
9
- operateType: 'sub';
10
-
11
- /**
12
- * 总结行涉及列key集合
13
- */
14
- group: string[];
15
- };
16
-
17
- export type Column = {
18
- key?: string;
19
- dataIndex: string;
20
- type?: string;
21
- fixed?: TableColumnProps<any>['fixed'];
22
- align?: TableColumnProps<any>['align'];
23
- children?: Array<Column>;
24
- };
25
- export interface SummaryProps<T> {
26
- summaryConfig?: SummaryConfig;
27
- readonly dataSource?: Array<T>;
28
- columns?: Array<Column>;
29
- }
30
- const useSummaryCol = <T>(props: SummaryProps<T>) => {
31
- const { summaryConfig, dataSource, columns } = props;
32
- const { summaryType, summaryGroup } = useMemo(() => {
33
- if (!summaryConfig) {
34
- return {
35
- summaryType: 'none',
36
- summaryGroup: [],
37
- };
38
- }
39
- const { type } = summaryConfig;
40
- return {
41
- summaryType: type,
42
- summaryGroup:
43
- type === 'single' ? summaryConfig?.col : summaryConfig?.group,
44
- };
45
- }, [summaryConfig]);
46
-
47
- const summaryColIndexMap = useMemo(() => {
48
- const map = new Map<
49
- string,
50
- {
51
- index: number;
52
- operateType: ColItem['operateType'];
53
- }
54
- >();
55
- if (summaryType === 'none') {
56
- return map;
57
- }
58
- summaryGroup?.forEach(({ group, operateType }, index) => {
59
- if (group?.length) {
60
- group.forEach((g: string) => {
61
- map.set(g, {
62
- operateType,
63
- index,
64
- });
65
- });
66
- }
67
- });
68
- return map;
69
- }, [summaryGroup, summaryType]);
70
-
71
- /**
72
- * 1. 勾选相邻的,按顺序渲染,多列时进行合并
73
- * 2. 勾选不相邻时,空出来的填充空白单元格
74
- * 3. 勾选不相邻,位置存在交叉的,交叉的作为单独计算项
75
- */
76
- const summaryColList = useMemo(() => {
77
- if (summaryColIndexMap.size === 0) return [];
78
- const col: Array<{
79
- title: string | number;
80
- colSpan?: number;
81
- dataIndexList?: string[];
82
- operateType?: ColItem['operateType'];
83
- prev?: {
84
- index: number;
85
- fixed?: TableColumnProps<T>['fixed'];
86
- };
87
- align?: TableColumnProps<T>['align'];
88
- }> = [];
89
- // 标记当前已经记录的总结列
90
- const currentSummaryColMap: Record<number, (typeof col)[number]> = {};
91
- columns?.forEach((c, i) => {
92
- if (i === 0 && c.type === 'orderCol' && summaryConfig?.name) {
93
- col.push({
94
- title: summaryConfig?.name,
95
- align: c.align,
96
- });
97
- } else {
98
- let item: (typeof col)[number] = {
99
- title: '',
100
- dataIndexList: [],
101
- align: c.align,
102
- };
103
- const { key, dataIndex } = c;
104
- const summaryCol = summaryColIndexMap.get(key || '');
105
- if (summaryCol) {
106
- const { index, operateType } = summaryCol;
107
- if (currentSummaryColMap[index]) {
108
- const prevItem = currentSummaryColMap[index];
109
- if (
110
- prevItem?.prev &&
111
- i === prevItem?.prev?.index + 1 &&
112
- prevItem?.prev?.fixed === c?.fixed
113
- ) {
114
- // 勾选列是相邻的,则允许合并
115
- item = prevItem;
116
- } else {
117
- // 单独一列
118
- col.push(item);
119
- }
120
- } else {
121
- currentSummaryColMap[index] = item;
122
- // 合并分组
123
- col.push(item);
124
- }
125
- item?.dataIndexList?.push?.(dataIndex);
126
- item.colSpan = (item.colSpan || 0) + 1;
127
- if (item.colSpan > 1) {
128
- item.align = 'center';
129
- }
130
- item.prev = {
131
- index: i,
132
- fixed: c?.fixed,
133
- };
134
- item.operateType = operateType;
135
- return;
136
- }
137
- // 没有配置的单独一列作为空白单元格存在
138
- col.push(item);
139
- }
140
- });
141
- const dataMap: Record<string, any[]> = {};
142
- dataSource?.forEach((v) => {
143
- Object.keys(v || {}).forEach((key: string) => {
144
- if (!dataMap[key]) {
145
- dataMap[key] = [];
146
- }
147
- dataMap[key].push((v as any)[key]);
148
- });
149
- });
150
- return col.map((c) => {
151
- const { operateType, dataIndexList = [] } = c;
152
- const item = {
153
- ...c,
154
- };
155
- switch (operateType) {
156
- case 'sub': {
157
- // 计算合计
158
- const sub = dataIndexList.reduce((p, dataIndex) => {
159
- const data = dataMap[dataIndex] || [];
160
- let val = p;
161
- if (isNaN(val)) {
162
- // 转换失败不合计
163
- return NaN;
164
- }
165
- data.forEach((v) => {
166
- val += Number(v);
167
- });
168
- return val;
169
- }, 0);
170
- item.title = isNaN(sub)
171
- ? ''
172
- : sub.toFixed(summaryConfig?.decimal || 0);
173
- break;
174
- }
175
- default:
176
- }
177
- return item;
178
- });
179
- }, [
180
- dataSource,
181
- summaryConfig?.name,
182
- summaryConfig?.decimal,
183
- columns,
184
- summaryColIndexMap,
185
- ]);
186
- return {
187
- summaryColList,
188
- };
189
- };
190
-
191
- export default useSummaryCol;