wt-antd 4.2.3

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 (302) hide show
  1. package/README.md +26 -0
  2. package/dist/esm/assets/location.png +0 -0
  3. package/dist/esm/component/BiuAAutoComplete/index.d.ts +4 -0
  4. package/dist/esm/component/BiuAAutoComplete/index.js +13 -0
  5. package/dist/esm/component/BiuAButton/index.d.ts +18 -0
  6. package/dist/esm/component/BiuAButton/index.js +8 -0
  7. package/dist/esm/component/BiuACard/index.d.ts +2 -0
  8. package/dist/esm/component/BiuACard/index.js +9 -0
  9. package/dist/esm/component/BiuACascader/index.d.ts +10 -0
  10. package/dist/esm/component/BiuACascader/index.js +8 -0
  11. package/dist/esm/component/BiuADatePicker/index.d.ts +19 -0
  12. package/dist/esm/component/BiuADatePicker/index.js +18 -0
  13. package/dist/esm/component/BiuAForm/index.d.ts +7 -0
  14. package/dist/esm/component/BiuAForm/index.js +10 -0
  15. package/dist/esm/component/BiuAInput/index.d.ts +14 -0
  16. package/dist/esm/component/BiuAInput/index.js +32 -0
  17. package/dist/esm/component/BiuASelect/index.d.ts +6 -0
  18. package/dist/esm/component/BiuASelect/index.js +14 -0
  19. package/dist/esm/component/BiuASwitch/index.d.ts +2 -0
  20. package/dist/esm/component/BiuASwitch/index.js +9 -0
  21. package/dist/esm/component/BiuATimePicker/index.d.ts +4 -0
  22. package/dist/esm/component/BiuATimePicker/index.js +8 -0
  23. package/dist/esm/component/BiuATreeSelect/index.d.ts +2 -0
  24. package/dist/esm/component/BiuATreeSelect/index.js +8 -0
  25. package/dist/esm/component/BiuBar/index.d.ts +13 -0
  26. package/dist/esm/component/BiuBar/index.js +43 -0
  27. package/dist/esm/component/BiuComSelect/index.d.ts +19 -0
  28. package/dist/esm/component/BiuComSelect/index.js +107 -0
  29. package/dist/esm/component/BiuCue/index.d.ts +18 -0
  30. package/dist/esm/component/BiuCue/index.js +44 -0
  31. package/dist/esm/component/BiuCustomSelect/index.d.ts +19 -0
  32. package/dist/esm/component/BiuCustomSelect/index.js +198 -0
  33. package/dist/esm/component/BiuCustomTable/index.d.ts +15 -0
  34. package/dist/esm/component/BiuCustomTable/index.js +77 -0
  35. package/dist/esm/component/BiuCustomerOperCard/component/editTable.d.ts +9 -0
  36. package/dist/esm/component/BiuCustomerOperCard/component/editTable.js +268 -0
  37. package/dist/esm/component/BiuCustomerOperCard/component/index.d.ts +1 -0
  38. package/dist/esm/component/BiuCustomerOperCard/component/index.js +1 -0
  39. package/dist/esm/component/BiuCustomerOperCard/component/index.less +5 -0
  40. package/dist/esm/component/BiuCustomerOperCard/index.d.ts +20 -0
  41. package/dist/esm/component/BiuCustomerOperCard/index.js +56 -0
  42. package/dist/esm/component/BiuCustomerOperCard/type.d.ts +117 -0
  43. package/dist/esm/component/BiuCustomerOperCard/type.js +1 -0
  44. package/dist/esm/component/BiuCustomerOperCard/utils.d.ts +48 -0
  45. package/dist/esm/component/BiuCustomerOperCard/utils.js +236 -0
  46. package/dist/esm/component/BiuDescriptions/index.d.ts +9 -0
  47. package/dist/esm/component/BiuDescriptions/index.js +39 -0
  48. package/dist/esm/component/BiuDetailDrawer/index.d.ts +14 -0
  49. package/dist/esm/component/BiuDetailDrawer/index.js +55 -0
  50. package/dist/esm/component/BiuDivider/index.d.ts +4 -0
  51. package/dist/esm/component/BiuDivider/index.js +31 -0
  52. package/dist/esm/component/BiuField/component/AddressTableSelect.d.ts +3 -0
  53. package/dist/esm/component/BiuField/component/AddressTableSelect.js +150 -0
  54. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/index.d.ts +3 -0
  55. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/index.js +3 -0
  56. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertSubValue.d.ts +2 -0
  57. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertSubValue.js +49 -0
  58. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertUnSubValue.d.ts +2 -0
  59. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertUnSubValue.js +146 -0
  60. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useInConvertUnSubValue.d.ts +5 -0
  61. package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useInConvertUnSubValue.js +82 -0
  62. package/dist/esm/component/BiuField/component/DepartOrgSelect/index.d.ts +14 -0
  63. package/dist/esm/component/BiuField/component/DepartOrgSelect/index.js +400 -0
  64. package/dist/esm/component/BiuField/component/DepartOrgSelect/type.d.ts +123 -0
  65. package/dist/esm/component/BiuField/component/DepartOrgSelect/type.js +1 -0
  66. package/dist/esm/component/BiuField/component/DepartOrgSelect/utils.d.ts +5 -0
  67. package/dist/esm/component/BiuField/component/DepartOrgSelect/utils.js +60 -0
  68. package/dist/esm/component/BiuField/component/OMSSystem/cityAreaSelect.d.ts +12 -0
  69. package/dist/esm/component/BiuField/component/OMSSystem/cityAreaSelect.js +131 -0
  70. package/dist/esm/component/BiuField/component/OMSSystem/warehouseSel.d.ts +7 -0
  71. package/dist/esm/component/BiuField/component/OMSSystem/warehouseSel.js +80 -0
  72. package/dist/esm/component/BiuField/component/SNInput.d.ts +13 -0
  73. package/dist/esm/component/BiuField/component/SNInput.js +623 -0
  74. package/dist/esm/component/BiuField/component/TableSelectLocal/addressSelect.d.ts +24 -0
  75. package/dist/esm/component/BiuField/component/TableSelectLocal/addressSelect.js +192 -0
  76. package/dist/esm/component/BiuField/component/TableSelectLocal/base.d.ts +13 -0
  77. package/dist/esm/component/BiuField/component/TableSelectLocal/base.js +204 -0
  78. package/dist/esm/component/BiuField/component/TableSelectLocal/goodSelect.d.ts +21 -0
  79. package/dist/esm/component/BiuField/component/TableSelectLocal/goodSelect.js +240 -0
  80. package/dist/esm/component/BiuField/component/TableSelectLocal/index.d.ts +3 -0
  81. package/dist/esm/component/BiuField/component/TableSelectLocal/index.js +74 -0
  82. package/dist/esm/component/BiuField/component/TableSelectLocal/interface.d.ts +16 -0
  83. package/dist/esm/component/BiuField/component/TableSelectLocal/interface.js +1 -0
  84. package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.d.ts +28 -0
  85. package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.js +178 -0
  86. package/dist/esm/component/BiuField/component/TableSelectLocal/newGoodsSelect.d.ts +21 -0
  87. package/dist/esm/component/BiuField/component/TableSelectLocal/newGoodsSelect.js +249 -0
  88. package/dist/esm/component/BiuField/component/TableSelectLocal/package.d.ts +3 -0
  89. package/dist/esm/component/BiuField/component/TableSelectLocal/package.js +151 -0
  90. package/dist/esm/component/BiuField/component/TableSelectLocal/supplierSelect.d.ts +18 -0
  91. package/dist/esm/component/BiuField/component/TableSelectLocal/supplierSelect.js +146 -0
  92. package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseAreaSelect.d.ts +3 -0
  93. package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseAreaSelect.js +147 -0
  94. package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseInfoSelects.d.ts +18 -0
  95. package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseInfoSelects.js +101 -0
  96. package/dist/esm/component/BiuField/component/appliedgoodsTypeSelect.d.ts +9 -0
  97. package/dist/esm/component/BiuField/component/appliedgoodsTypeSelect.js +75 -0
  98. package/dist/esm/component/BiuField/component/autoComplete.d.ts +8 -0
  99. package/dist/esm/component/BiuField/component/autoComplete.js +83 -0
  100. package/dist/esm/component/BiuField/component/biuMultipleAInput.d.ts +2 -0
  101. package/dist/esm/component/BiuField/component/biuMultipleAInput.js +133 -0
  102. package/dist/esm/component/BiuField/component/boxTypeSelect.d.ts +11 -0
  103. package/dist/esm/component/BiuField/component/boxTypeSelect.js +139 -0
  104. package/dist/esm/component/BiuField/component/businessdistrictselect.d.ts +55 -0
  105. package/dist/esm/component/BiuField/component/businessdistrictselect.js +414 -0
  106. package/dist/esm/component/BiuField/component/carrierInfoSelect.d.ts +13 -0
  107. package/dist/esm/component/BiuField/component/carrierInfoSelect.js +164 -0
  108. package/dist/esm/component/BiuField/component/channelSelect.d.ts +8 -0
  109. package/dist/esm/component/BiuField/component/channelSelect.js +95 -0
  110. package/dist/esm/component/BiuField/component/cityAreaCascader.d.ts +11 -0
  111. package/dist/esm/component/BiuField/component/cityAreaCascader.js +88 -0
  112. package/dist/esm/component/BiuField/component/clientInfoTableSelect.d.ts +3 -0
  113. package/dist/esm/component/BiuField/component/clientInfoTableSelect.js +199 -0
  114. package/dist/esm/component/BiuField/component/customMenu.d.ts +3 -0
  115. package/dist/esm/component/BiuField/component/customMenu.js +110 -0
  116. package/dist/esm/component/BiuField/component/databaseSelect.d.ts +6 -0
  117. package/dist/esm/component/BiuField/component/databaseSelect.js +42 -0
  118. package/dist/esm/component/BiuField/component/departmentTreeSelect.d.ts +3 -0
  119. package/dist/esm/component/BiuField/component/departmentTreeSelect.js +106 -0
  120. package/dist/esm/component/BiuField/component/dicNameSelect.d.ts +12 -0
  121. package/dist/esm/component/BiuField/component/dicNameSelect.js +53 -0
  122. package/dist/esm/component/BiuField/component/dicTypeSelect.d.ts +42 -0
  123. package/dist/esm/component/BiuField/component/dicTypeSelect.js +87 -0
  124. package/dist/esm/component/BiuField/component/dockingPartySelect.d.ts +8 -0
  125. package/dist/esm/component/BiuField/component/dockingPartySelect.js +63 -0
  126. package/dist/esm/component/BiuField/component/editLocationSelect.d.ts +21 -0
  127. package/dist/esm/component/BiuField/component/editLocationSelect.js +124 -0
  128. package/dist/esm/component/BiuField/component/electronicFaceSheet/accountSelect.d.ts +3 -0
  129. package/dist/esm/component/BiuField/component/electronicFaceSheet/accountSelect.js +36 -0
  130. package/dist/esm/component/BiuField/component/electronicFaceSheet/addresSelect.d.ts +14 -0
  131. package/dist/esm/component/BiuField/component/electronicFaceSheet/addresSelect.js +98 -0
  132. package/dist/esm/component/BiuField/component/electronicFaceSheet/platformSelect.d.ts +7 -0
  133. package/dist/esm/component/BiuField/component/electronicFaceSheet/platformSelect.js +74 -0
  134. package/dist/esm/component/BiuField/component/goodsTypeSelect.d.ts +10 -0
  135. package/dist/esm/component/BiuField/component/goodsTypeSelect.js +92 -0
  136. package/dist/esm/component/BiuField/component/index.d.ts +39 -0
  137. package/dist/esm/component/BiuField/component/index.js +39 -0
  138. package/dist/esm/component/BiuField/component/interfaceNameSelect.d.ts +9 -0
  139. package/dist/esm/component/BiuField/component/interfaceNameSelect.js +65 -0
  140. package/dist/esm/component/BiuField/component/lpnSelect.d.ts +3 -0
  141. package/dist/esm/component/BiuField/component/lpnSelect.js +96 -0
  142. package/dist/esm/component/BiuField/component/lpnSelectNew.d.ts +17 -0
  143. package/dist/esm/component/BiuField/component/lpnSelectNew.js +189 -0
  144. package/dist/esm/component/BiuField/component/newEditLocationSelect.d.ts +21 -0
  145. package/dist/esm/component/BiuField/component/newEditLocationSelect.js +129 -0
  146. package/dist/esm/component/BiuField/component/newUserSelect.d.ts +12 -0
  147. package/dist/esm/component/BiuField/component/newUserSelect.js +212 -0
  148. package/dist/esm/component/BiuField/component/orderTypeSelect.d.ts +16 -0
  149. package/dist/esm/component/BiuField/component/orderTypeSelect.js +82 -0
  150. package/dist/esm/component/BiuField/component/orderTypeTableSelect.d.ts +3 -0
  151. package/dist/esm/component/BiuField/component/orderTypeTableSelect.js +45 -0
  152. package/dist/esm/component/BiuField/component/parkSelect.d.ts +12 -0
  153. package/dist/esm/component/BiuField/component/parkSelect.js +88 -0
  154. package/dist/esm/component/BiuField/component/personnelinfoselect.d.ts +57 -0
  155. package/dist/esm/component/BiuField/component/personnelinfoselect.js +432 -0
  156. package/dist/esm/component/BiuField/component/propertNameSelect.d.ts +9 -0
  157. package/dist/esm/component/BiuField/component/propertNameSelect.js +114 -0
  158. package/dist/esm/component/BiuField/component/shipperTableSelect.d.ts +3 -0
  159. package/dist/esm/component/BiuField/component/shipperTableSelect.js +94 -0
  160. package/dist/esm/component/BiuField/component/userSelect.d.ts +11 -0
  161. package/dist/esm/component/BiuField/component/userSelect.js +174 -0
  162. package/dist/esm/component/BiuField/component/warehouseAreaSelect.d.ts +9 -0
  163. package/dist/esm/component/BiuField/component/warehouseAreaSelect.js +104 -0
  164. package/dist/esm/component/BiuField/component/warehouseInfoSelect.d.ts +14 -0
  165. package/dist/esm/component/BiuField/component/warehouseInfoSelect.js +94 -0
  166. package/dist/esm/component/BiuField/component/warehouseLoctionSelect.d.ts +14 -0
  167. package/dist/esm/component/BiuField/component/warehouseLoctionSelect.js +125 -0
  168. package/dist/esm/component/BiuField/index.d.ts +8 -0
  169. package/dist/esm/component/BiuField/index.js +680 -0
  170. package/dist/esm/component/BiuFileInput/index.d.ts +11 -0
  171. package/dist/esm/component/BiuFileInput/index.js +58 -0
  172. package/dist/esm/component/BiuForm/index.d.ts +14 -0
  173. package/dist/esm/component/BiuForm/index.js +270 -0
  174. package/dist/esm/component/BiuForm/type.d.ts +47 -0
  175. package/dist/esm/component/BiuForm/type.js +1 -0
  176. package/dist/esm/component/BiuForm/utils.d.ts +2 -0
  177. package/dist/esm/component/BiuForm/utils.js +53 -0
  178. package/dist/esm/component/BiuIcon/index.d.ts +3 -0
  179. package/dist/esm/component/BiuIcon/index.js +15 -0
  180. package/dist/esm/component/BiuMapSelectSite/index.d.ts +53 -0
  181. package/dist/esm/component/BiuMapSelectSite/index.js +593 -0
  182. package/dist/esm/component/BiuModal/index.d.ts +24 -0
  183. package/dist/esm/component/BiuModal/index.js +240 -0
  184. package/dist/esm/component/BiuOperForm/index.d.ts +22 -0
  185. package/dist/esm/component/BiuOperForm/index.js +390 -0
  186. package/dist/esm/component/BiuOperForm/type.d.ts +24 -0
  187. package/dist/esm/component/BiuOperForm/type.js +1 -0
  188. package/dist/esm/component/BiuOperTable/index.d.ts +15 -0
  189. package/dist/esm/component/BiuOperTable/index.js +349 -0
  190. package/dist/esm/component/BiuOperTable/type.d.ts +142 -0
  191. package/dist/esm/component/BiuOperTable/type.js +1 -0
  192. package/dist/esm/component/BiuOperTable/utils.d.ts +6 -0
  193. package/dist/esm/component/BiuOperTable/utils.js +13 -0
  194. package/dist/esm/component/BiuPagination/index.d.ts +15 -0
  195. package/dist/esm/component/BiuPagination/index.js +34 -0
  196. package/dist/esm/component/BiuResizeTable/component/VirtualTable.d.ts +3 -0
  197. package/dist/esm/component/BiuResizeTable/component/VirtualTable.js +127 -0
  198. package/dist/esm/component/BiuResizeTable/component/biuTableCell.d.ts +1 -0
  199. package/dist/esm/component/BiuResizeTable/component/biuTableCell.js +78 -0
  200. package/dist/esm/component/BiuResizeTable/component/index.d.ts +1 -0
  201. package/dist/esm/component/BiuResizeTable/component/index.js +1 -0
  202. package/dist/esm/component/BiuResizeTable/index.d.ts +2 -0
  203. package/dist/esm/component/BiuResizeTable/index.js +71 -0
  204. package/dist/esm/component/BiuResizeTable/index.less +19 -0
  205. package/dist/esm/component/BiuSplit/index.d.ts +32 -0
  206. package/dist/esm/component/BiuSplit/index.js +57 -0
  207. package/dist/esm/component/BiuTable/component/index.d.ts +3 -0
  208. package/dist/esm/component/BiuTable/component/index.js +3 -0
  209. package/dist/esm/component/BiuTable/component/tableActionBarRender.d.ts +9 -0
  210. package/dist/esm/component/BiuTable/component/tableActionBarRender.js +206 -0
  211. package/dist/esm/component/BiuTable/component/tableCellRender.d.ts +14 -0
  212. package/dist/esm/component/BiuTable/component/tableCellRender.js +125 -0
  213. package/dist/esm/component/BiuTable/component/tableSettingRender.d.ts +2 -0
  214. package/dist/esm/component/BiuTable/component/tableSettingRender.js +347 -0
  215. package/dist/esm/component/BiuTable/context.d.ts +2 -0
  216. package/dist/esm/component/BiuTable/context.js +2 -0
  217. package/dist/esm/component/BiuTable/index.d.ts +67 -0
  218. package/dist/esm/component/BiuTable/index.js +586 -0
  219. package/dist/esm/component/BiuTable/type.d.ts +200 -0
  220. package/dist/esm/component/BiuTable/type.js +1 -0
  221. package/dist/esm/component/BiuTable/utils.d.ts +12 -0
  222. package/dist/esm/component/BiuTable/utils.js +123 -0
  223. package/dist/esm/component/BiuTableLink/index.d.ts +11 -0
  224. package/dist/esm/component/BiuTableLink/index.js +54 -0
  225. package/dist/esm/component/BiuTableSelect/index.d.ts +54 -0
  226. package/dist/esm/component/BiuTableSelect/index.js +231 -0
  227. package/dist/esm/component/BiuTabs/index.d.ts +4 -0
  228. package/dist/esm/component/BiuTabs/index.js +18 -0
  229. package/dist/esm/component/index.d.ts +34 -0
  230. package/dist/esm/component/index.js +34 -0
  231. package/dist/esm/constant/Cache_Key.d.ts +28 -0
  232. package/dist/esm/constant/Cache_Key.js +28 -0
  233. package/dist/esm/constant/DateTime.d.ts +12 -0
  234. package/dist/esm/constant/DateTime.js +15 -0
  235. package/dist/esm/constant/External.d.ts +64 -0
  236. package/dist/esm/constant/External.js +260 -0
  237. package/dist/esm/constant/Gateway_Path.d.ts +5 -0
  238. package/dist/esm/constant/Gateway_Path.js +5 -0
  239. package/dist/esm/constant/Layout.d.ts +210 -0
  240. package/dist/esm/constant/Layout.js +215 -0
  241. package/dist/esm/constant/Regexp.d.ts +109 -0
  242. package/dist/esm/constant/Regexp.js +130 -0
  243. package/dist/esm/constant/index.d.ts +6 -0
  244. package/dist/esm/constant/index.js +6 -0
  245. package/dist/esm/hooks/index.d.ts +7 -0
  246. package/dist/esm/hooks/index.js +7 -0
  247. package/dist/esm/hooks/useAuth.d.ts +4 -0
  248. package/dist/esm/hooks/useAuth.js +22 -0
  249. package/dist/esm/hooks/useCurrentSystem.d.ts +6 -0
  250. package/dist/esm/hooks/useCurrentSystem.js +17 -0
  251. package/dist/esm/hooks/useLayoutInfo.d.ts +10 -0
  252. package/dist/esm/hooks/useLayoutInfo.js +14 -0
  253. package/dist/esm/hooks/useReducerState.d.ts +16 -0
  254. package/dist/esm/hooks/useReducerState.js +45 -0
  255. package/dist/esm/hooks/useUmeng.d.ts +5 -0
  256. package/dist/esm/hooks/useUmeng.js +168 -0
  257. package/dist/esm/hooks/useUserInfo.d.ts +4 -0
  258. package/dist/esm/hooks/useUserInfo.js +17 -0
  259. package/dist/esm/hooks/useWareInfo.d.ts +4 -0
  260. package/dist/esm/hooks/useWareInfo.js +17 -0
  261. package/dist/esm/index.d.ts +5 -0
  262. package/dist/esm/index.js +5 -0
  263. package/dist/esm/package/index.d.ts +1 -0
  264. package/dist/esm/package/index.js +1 -0
  265. package/dist/esm/package/requestWrapper/baseRequest.d.ts +3 -0
  266. package/dist/esm/package/requestWrapper/baseRequest.js +47 -0
  267. package/dist/esm/package/requestWrapper/index.d.ts +4 -0
  268. package/dist/esm/package/requestWrapper/index.js +425 -0
  269. package/dist/esm/package/requestWrapper/type.d.ts +41 -0
  270. package/dist/esm/package/requestWrapper/type.js +1 -0
  271. package/dist/esm/package/requestWrapper/utils.d.ts +10 -0
  272. package/dist/esm/package/requestWrapper/utils.js +45 -0
  273. package/dist/esm/types/track.d.ts +113 -0
  274. package/dist/esm/types/track.js +63 -0
  275. package/dist/esm/types/umeng.d.ts +7 -0
  276. package/dist/esm/utils/authUtils.d.ts +18 -0
  277. package/dist/esm/utils/authUtils.js +36 -0
  278. package/dist/esm/utils/cacheUtils.d.ts +4 -0
  279. package/dist/esm/utils/cacheUtils.js +24 -0
  280. package/dist/esm/utils/chainUtils.d.ts +26 -0
  281. package/dist/esm/utils/chainUtils.js +54 -0
  282. package/dist/esm/utils/dateUtils.d.ts +23 -0
  283. package/dist/esm/utils/dateUtils.js +55 -0
  284. package/dist/esm/utils/decimalUtils.d.ts +5 -0
  285. package/dist/esm/utils/decimalUtils.js +7 -0
  286. package/dist/esm/utils/excelUtils.d.ts +22 -0
  287. package/dist/esm/utils/excelUtils.js +165 -0
  288. package/dist/esm/utils/index.d.ts +11 -0
  289. package/dist/esm/utils/index.js +11 -0
  290. package/dist/esm/utils/layoutUtils.d.ts +1 -0
  291. package/dist/esm/utils/layoutUtils.js +13 -0
  292. package/dist/esm/utils/objectUtils.d.ts +1 -0
  293. package/dist/esm/utils/objectUtils.js +3 -0
  294. package/dist/esm/utils/soundUtils.d.ts +5 -0
  295. package/dist/esm/utils/soundUtils.js +29 -0
  296. package/dist/esm/utils/stringUtils.d.ts +24 -0
  297. package/dist/esm/utils/stringUtils.js +39 -0
  298. package/dist/esm/utils/sysUtils.d.ts +8 -0
  299. package/dist/esm/utils/sysUtils.js +33 -0
  300. package/dist/esm/utils/umeng.d.ts +3 -0
  301. package/dist/esm/utils/umeng.js +161 -0
  302. package/package.json +60 -0
@@ -0,0 +1,109 @@
1
+ /**
2
+ * 匹配火车车次正则
3
+ */
4
+ export declare const RegTrainNumber: RegExp;
5
+ /**
6
+ * 手机机身码(IMEI)正则
7
+ */
8
+ export declare const RegIMEI: RegExp;
9
+ /**
10
+ * 必须带端口号的网址(或ip)
11
+ */
12
+ export declare const RegUriWithPort: RegExp;
13
+ /**
14
+ * 网址(url,支持端口和"?+参数"和"#+参数)
15
+ */
16
+ export declare const RegUri: RegExp;
17
+ /**
18
+ * 24 小时制时间(HH:mm:ss)
19
+ */
20
+ export declare const RegTimeForHour24: RegExp;
21
+ /**
22
+ * 12 小时制时间(HH:mm:ss)
23
+ */
24
+ export declare const RegTimeForHour12: RegExp;
25
+ /**
26
+ * base64 数据格式验证
27
+ */
28
+ export declare const RegStrForBase64: RegExp;
29
+ /**
30
+ * 验证货币格式,支持千分位分隔符,支持负数
31
+ */
32
+ export declare const RegAmountWithNegativeAndSeparator: RegExp;
33
+ /**
34
+ * 验证货币格式,不支持千分位分隔符,只支持正数
35
+ */
36
+ export declare const RegAmountWithNotNegativeAndSeparator: RegExp;
37
+ /**
38
+ * 银行卡号(10到30位, 覆盖对公/私账户, 参考微信支付)
39
+ */
40
+ export declare const RegBankCardNo: RegExp;
41
+ /**
42
+ * 验证中文姓名
43
+ */
44
+ export declare const RegChineseName: RegExp;
45
+ /**
46
+ * 验证英文姓名
47
+ */
48
+ export declare const RegEnglishName: RegExp;
49
+ /**
50
+ *
51
+ * level:
52
+ * - 0 最严格 按照工信部 2019 公布号段
53
+ * - 1 宽松 3,14,15,16,17,18,19 开头即可
54
+ * - 2 最宽松,只要是1开头即可
55
+ *
56
+ * 严格验证手机号
57
+ *
58
+ */
59
+ export declare const RegMobilePhoneNumberLevel0: RegExp;
60
+ /**
61
+ *
62
+ * level:
63
+ * - 0 最严格 按照工信部 2019 公布号段
64
+ * - 1 宽松 3,14,15,16,17,18,19 开头即可
65
+ * - 2 最宽松,只要是1开头即可
66
+ *
67
+ * 较严格验证手机号
68
+ *
69
+ */
70
+ export declare const RegMobilePhoneNumberLevel1: RegExp;
71
+ /**
72
+ *
73
+ * level:
74
+ * - 0 最严格 按照工信部 2019 公布号段
75
+ * - 1 宽松 3,14,15,16,17,18,19 开头即可
76
+ * - 2 最宽松,只要是1开头即可
77
+ *
78
+ * 宽松验证手机号
79
+ *
80
+ */
81
+ export declare const RegMobilePhoneNumberLevel2: RegExp;
82
+ /**
83
+ * 日期格式验证 年月日
84
+ */
85
+ export declare const RegDate: RegExp;
86
+ /**
87
+ * Email 验证
88
+ */
89
+ export declare const RegEmail: RegExp;
90
+ /**
91
+ * 座机号码验证
92
+ */
93
+ export declare const RegTelPhone: RegExp;
94
+ /**
95
+ * 验证第一代身份证 15位
96
+ */
97
+ export declare const RegIDCardNumberV1: RegExp;
98
+ /**
99
+ * 验证第二代身份证 18位
100
+ */
101
+ export declare const RegIDCardNumberV2: RegExp;
102
+ /**
103
+ * 验证第一代和第二代身份证 15、18位
104
+ */
105
+ export declare const RegIDCardNumberV1AndV2: RegExp;
106
+ /**
107
+ * 数据来源
108
+ * [AnyRule](https://github.com/any86/any-rule)
109
+ */
@@ -0,0 +1,130 @@
1
+ /**
2
+ * 匹配火车车次正则
3
+ */
4
+ export var RegTrainNumber = /^[GCDZTSPKXLY1-9]\d{14}$/;
5
+
6
+ /**
7
+ * 手机机身码(IMEI)正则
8
+ */
9
+ export var RegIMEI = /^\d{1517}$/;
10
+
11
+ /**
12
+ * 必须带端口号的网址(或ip)
13
+ */
14
+ export var RegUriWithPort = /^((ht|f)tps?:\/\/)?[\w-]+(\.[\w-]+)+:\d{15}\/?$/;
15
+
16
+ /**
17
+ * 网址(url,支持端口和"?+参数"和"#+参数)
18
+ */
19
+ export var RegUri = /^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/;
20
+
21
+ /**
22
+ * 24 小时制时间(HH:mm:ss)
23
+ */
24
+ export var RegTimeForHour24 = /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/;
25
+
26
+ /**
27
+ * 12 小时制时间(HH:mm:ss)
28
+ */
29
+ export var RegTimeForHour12 = /^(?:1[0-2]|0?[1-9]):[0-5]\d:[0-5]\d$/;
30
+
31
+ /**
32
+ * base64 数据格式验证
33
+ */
34
+ export var RegStrForBase64 = /^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?([a-z0-9!$&'()*+;=\-._~:@/?%\s]*?)\s*$/i;
35
+
36
+ /**
37
+ * 验证货币格式,支持千分位分隔符,支持负数
38
+ */
39
+ export var RegAmountWithNegativeAndSeparator = /^-?\d+(\d{3})*(\.\d{12})?$/;
40
+
41
+ /**
42
+ * 验证货币格式,不支持千分位分隔符,只支持正数
43
+ */
44
+ export var RegAmountWithNotNegativeAndSeparator = /(?:^[1-9]([0-9]+)?(?:\.[0-9]{12})?$)|(?:^(?:0){1}$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/;
45
+
46
+ /**
47
+ * 银行卡号(10到30位, 覆盖对公/私账户, 参考微信支付)
48
+ */
49
+ export var RegBankCardNo = /^[1-9]\d{929}$/;
50
+
51
+ /**
52
+ * 验证中文姓名
53
+ */
54
+ export var RegChineseName = /^(?:[\u4e00-\u9fa5·]{216})$/;
55
+
56
+ /**
57
+ * 验证英文姓名
58
+ */
59
+ export var RegEnglishName = /(^[a-zA-Z]{1}[a-zA-Z\s]{020}[a-zA-Z]{1}$)/;
60
+
61
+ /**
62
+ *
63
+ * level:
64
+ * - 0 最严格 按照工信部 2019 公布号段
65
+ * - 1 宽松 3,14,15,16,17,18,19 开头即可
66
+ * - 2 最宽松,只要是1开头即可
67
+ *
68
+ * 严格验证手机号
69
+ *
70
+ */
71
+ export var RegMobilePhoneNumberLevel0 = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/;
72
+
73
+ /**
74
+ *
75
+ * level:
76
+ * - 0 最严格 按照工信部 2019 公布号段
77
+ * - 1 宽松 3,14,15,16,17,18,19 开头即可
78
+ * - 2 最宽松,只要是1开头即可
79
+ *
80
+ * 较严格验证手机号
81
+ *
82
+ */
83
+ export var RegMobilePhoneNumberLevel1 = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
84
+
85
+ /**
86
+ *
87
+ * level:
88
+ * - 0 最严格 按照工信部 2019 公布号段
89
+ * - 1 宽松 3,14,15,16,17,18,19 开头即可
90
+ * - 2 最宽松,只要是1开头即可
91
+ *
92
+ * 宽松验证手机号
93
+ *
94
+ */
95
+ export var RegMobilePhoneNumberLevel2 = /^(?:(?:\+|00)86)?1\d{10}$/;
96
+
97
+ /**
98
+ * 日期格式验证 年月日
99
+ */
100
+ export var RegDate = /^\d{4}(-)(1[0-2]|0?\d)\1([0-2]\d|\d|30|31)$/;
101
+
102
+ /**
103
+ * Email 验证
104
+ */
105
+ export var RegEmail = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
106
+
107
+ /**
108
+ * 座机号码验证
109
+ */
110
+ export var RegTelPhone = /^\d{3}-\d{8}$|^\d{4}-\d{78}$/;
111
+
112
+ /**
113
+ * 验证第一代身份证 15位
114
+ */
115
+ export var RegIDCardNumberV1 = /^[1-9]\d{7}(?:0\d|10|11|12)(?:0[1-9]|[1-2][\d]|30|31)\d{3}$/;
116
+
117
+ /**
118
+ * 验证第二代身份证 18位
119
+ */
120
+ export var RegIDCardNumberV2 = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/;
121
+
122
+ /**
123
+ * 验证第一代和第二代身份证 15、18位
124
+ */
125
+ export var RegIDCardNumberV1AndV2 = /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/;
126
+
127
+ /**
128
+ * 数据来源
129
+ * [AnyRule](https://github.com/any86/any-rule)
130
+ */
@@ -0,0 +1,6 @@
1
+ export * from './Cache_Key';
2
+ export * from './DateTime';
3
+ export * from './External';
4
+ export * from './Gateway_Path';
5
+ export * from './Layout';
6
+ export * from './Regexp';
@@ -0,0 +1,6 @@
1
+ export * from "./Cache_Key";
2
+ export * from "./DateTime";
3
+ export * from "./External";
4
+ export * from "./Gateway_Path";
5
+ export * from "./Layout";
6
+ export * from "./Regexp";
@@ -0,0 +1,7 @@
1
+ export * from './useCurrentSystem';
2
+ export * from './useLayoutInfo';
3
+ export * from './useReducerState';
4
+ export * from './useUserInfo';
5
+ export * from './useWareInfo';
6
+ export * from './useAuth';
7
+ export * from './useUmeng';
@@ -0,0 +1,7 @@
1
+ export * from "./useCurrentSystem";
2
+ export * from "./useLayoutInfo";
3
+ export * from "./useReducerState";
4
+ export * from "./useUserInfo";
5
+ export * from "./useWareInfo";
6
+ export * from "./useAuth";
7
+ export * from "./useUmeng";
@@ -0,0 +1,4 @@
1
+ export declare const useAuth: () => {
2
+ hasAuth: (authCode?: string) => boolean;
3
+ authKeyArray: string[];
4
+ };
@@ -0,0 +1,22 @@
1
+ import { useCallback, useMemo } from 'react';
2
+ import { BUBU100_CACHE_AUTH_BUTTON_KEY } from "../constant";
3
+ var cacheButtonAuth = localStorage.getItem(BUBU100_CACHE_AUTH_BUTTON_KEY);
4
+ var resolveCodeList = [];
5
+ if (cacheButtonAuth) {
6
+ resolveCodeList = JSON.parse(cacheButtonAuth).resolveCodeList || [];
7
+ }
8
+ export var useAuth = function useAuth() {
9
+ var authKeyArray = useMemo(function () {
10
+ return resolveCodeList;
11
+ }, []);
12
+ var hasAuth = useCallback(function () {
13
+ var authCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
14
+ if (!authCode) return true;
15
+ if (resolveCodeList.length === 0) return false;
16
+ return resolveCodeList.includes(authCode);
17
+ }, []);
18
+ return {
19
+ hasAuth: hasAuth,
20
+ authKeyArray: authKeyArray
21
+ };
22
+ };
@@ -0,0 +1,6 @@
1
+ type CurrentSystemType = 'SSO' | 'MDM' | 'OMS' | 'WMS' | 'TMS' | 'DOC';
2
+ export declare const useCurrentSystem: () => [
3
+ CurrentSystemType,
4
+ (value: CurrentSystemType) => void
5
+ ];
6
+ export {};
@@ -0,0 +1,17 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useLocalStorageState } from 'ahooks';
8
+ import { BUBU100_CACHE_SYSTEM_KEY } from "../constant";
9
+ export var useCurrentSystem = function useCurrentSystem() {
10
+ var _useLocalStorageState = useLocalStorageState(BUBU100_CACHE_SYSTEM_KEY, {
11
+ listenStorageChange: true
12
+ }),
13
+ _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 2),
14
+ currentSystem = _useLocalStorageState2[0],
15
+ setCurrentSystem = _useLocalStorageState2[1];
16
+ return [currentSystem !== null && currentSystem !== void 0 ? currentSystem : 'SSO', setCurrentSystem];
17
+ };
@@ -0,0 +1,10 @@
1
+ export interface size {
2
+ width?: number;
3
+ height?: number;
4
+ offsetWidth?: number;
5
+ offsetHeight?: number;
6
+ }
7
+ export declare const useLayoutInfo: () => [
8
+ Record<string, any>,
9
+ (value: Record<string, any>) => void
10
+ ];
@@ -0,0 +1,14 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useState } from 'react';
8
+ export var useLayoutInfo = function useLayoutInfo() {
9
+ var _useState = useState({}),
10
+ _useState2 = _slicedToArray(_useState, 2),
11
+ layoutInfo = _useState2[0],
12
+ setLayoutInfo = _useState2[1];
13
+ return [layoutInfo !== null && layoutInfo !== void 0 ? layoutInfo : {}, setLayoutInfo];
14
+ };
@@ -0,0 +1,16 @@
1
+ import type { Store } from 'antd/es/form/interface';
2
+ import type { Dispatch } from 'react';
3
+ type DispatchAction<T> = Record<string, (prevState: T, actionData: Store) => T>;
4
+ /**
5
+ *
6
+ * 使用系统的useReducer,模拟平常Class组件书写习惯
7
+ * 例如setState({ ... }),或者setState((prevState:any) => { ... })
8
+ * 注意:自定义dispatch,不会合并state,需要自己在函数中抉择
9
+ *
10
+ * @param initialState 初始化state的值
11
+ * @param dispatchActions 自定义dispatch处理state,声明示例:reset: () => { return {...initialState}; },调用示例:setState({ type: 'reset' })
12
+ */
13
+ export declare function useReducerState<T = Store>(initialState: T, dispatchActions?: DispatchAction<T>): [T, Dispatch<(Store & {
14
+ type?: string;
15
+ }) | ((prevState: T) => T)>];
16
+ export {};
@@ -0,0 +1,45 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["type"];
3
+ 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; }
4
+ 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; }
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ 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."); }
12
+ 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); }
13
+ 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; }
14
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ import { useReducer } from 'react';
17
+ /**
18
+ *
19
+ * 使用系统的useReducer,模拟平常Class组件书写习惯
20
+ * 例如setState({ ... }),或者setState((prevState:any) => { ... })
21
+ * 注意:自定义dispatch,不会合并state,需要自己在函数中抉择
22
+ *
23
+ * @param initialState 初始化state的值
24
+ * @param dispatchActions 自定义dispatch处理state,声明示例:reset: () => { return {...initialState}; },调用示例:setState({ type: 'reset' })
25
+ */
26
+ export function useReducerState(initialState, dispatchActions) {
27
+ var _useReducer = useReducer(function (prevState, newState) {
28
+ if (typeof newState === 'function') {
29
+ return _objectSpread(_objectSpread({}, prevState), newState(prevState));
30
+ }
31
+ var type = newState.type,
32
+ actionData = _objectWithoutProperties(newState, _excluded);
33
+ if (type === undefined) {
34
+ return _objectSpread(_objectSpread({}, prevState), actionData);
35
+ }
36
+ if (!dispatchActions || !dispatchActions[type]) {
37
+ throw new Error("useReducerState\u53C2\u6570dispatchActions\u672A\u5B9A\u4E49type\u7C7B\u578B\u4E3A\u3010".concat(type, "\u3011\u7684\u51FD\u6570\uFF0C\u8BF7\u68C0\u67E5\u4EE3\u7801"));
38
+ }
39
+ return dispatchActions[type](prevState, actionData);
40
+ }, initialState),
41
+ _useReducer2 = _slicedToArray(_useReducer, 2),
42
+ state = _useReducer2[0],
43
+ setState = _useReducer2[1];
44
+ return [state, setState];
45
+ }
@@ -0,0 +1,5 @@
1
+ import { TrackEvent } from "../types/track";
2
+ export declare const useUmeng: (debug?: boolean) => {
3
+ trackPageView: (pageName?: string, pageUrl?: string) => void;
4
+ trackEvent: (event: TrackEvent) => false | undefined;
5
+ };
@@ -0,0 +1,168 @@
1
+ import { BUBU100_CACHE_USERINFO_KEY } from "../constant";
2
+ import { UmengButtonType, UmengSysType } from "../types/track";
3
+ import { getButtonFunction, getButtonType } from "../utils/umeng";
4
+ import { useCallback } from 'react';
5
+ export var useUmeng = function useUmeng() {
6
+ var debug = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
7
+ var isParentWindow = window !== window.parent;
8
+
9
+ // 日志函数
10
+ var log = useCallback(function (message, data) {
11
+ if (debug) {
12
+ console.log("[UmengBridge] ".concat(message), data ? data : '');
13
+ }
14
+ }, [debug]);
15
+ var logError = useCallback(function (message, error) {
16
+ if (debug) {
17
+ console.error("[UmengBridge] ".concat(message), error);
18
+ }
19
+ }, [debug]);
20
+ var logWarn = useCallback(function (message, data) {
21
+ if (debug) {
22
+ console.warn("[UmengParentBridge] ".concat(message), data);
23
+ }
24
+ }, [debug]);
25
+
26
+ /**
27
+ * 用户id_用户名称_组织id_组织名称
28
+ */
29
+ var buildStandardLabel = function buildStandardLabel(label) {
30
+ try {
31
+ var _localStorage$getItem;
32
+ var userInfo = JSON.parse((_localStorage$getItem = localStorage.getItem(BUBU100_CACHE_USERINFO_KEY)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : '{}');
33
+ if (!Object.keys(userInfo).length) return label;
34
+ var _userInfo$employeecus = userInfo.employeecustomcode,
35
+ code = _userInfo$employeecus === void 0 ? '' : _userInfo$employeecus,
36
+ _userInfo$employeenam = userInfo.employeename,
37
+ userName = _userInfo$employeenam === void 0 ? '' : _userInfo$employeenam,
38
+ _userInfo$companyid = userInfo.companyid,
39
+ orgId = _userInfo$companyid === void 0 ? '' : _userInfo$companyid,
40
+ _userInfo$companyName = userInfo.companyName,
41
+ orgName = _userInfo$companyName === void 0 ? '' : _userInfo$companyName;
42
+ return "".concat(label ? label + '_' : '').concat(code || '', "_").concat(userName || '', "_").concat(orgName || '').replace(/_+$/, '');
43
+ } catch (error) {
44
+ logWarn('构建标准label失败', error);
45
+ return '';
46
+ }
47
+ };
48
+ var getCurrentPagePath = function getCurrentPagePath() {
49
+ // const route = useRoute()
50
+
51
+ // const path = window.location.pathname
52
+ var path = window.parent.location.pathname;
53
+ // console.log('window.location.route', route)
54
+
55
+ // 移除开头斜杠
56
+ return path.startsWith('/') ? path.substring(1) : path;
57
+ };
58
+
59
+ /**
60
+ * 页面路径_按钮类型_按钮功能
61
+ */
62
+ var buildStandardAction = function buildStandardAction() {
63
+ var buttonType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : UmengButtonType.ACTION;
64
+ var buttonFunction = arguments.length > 1 ? arguments[1] : undefined;
65
+ // const cleanPagePath = pagePath.replace(/^\/+|\/+$/g, '').replace(/\//g, '_')
66
+ var currentPath = getCurrentPagePath();
67
+ return "".concat(currentPath, "_").concat(buttonType, "_").concat(buttonFunction);
68
+ };
69
+ var getCategoryBySystem = function getCategoryBySystem() {
70
+ var path = window.location.pathname;
71
+ if (path.includes('/wms')) {
72
+ return UmengSysType.WMS;
73
+ }
74
+ if (path.includes('/mdm')) {
75
+ return UmengSysType.MDM;
76
+ }
77
+ return UmengSysType.SSO;
78
+ };
79
+ var trackEvent = function trackEvent(event) {
80
+ if (!isParentWindow) {
81
+ logWarn('当前窗口不是父窗口,无法发送页面访问统计');
82
+ return;
83
+ }
84
+ if (!window.parent._czc) {
85
+ logWarn('友盟未初始化,无法发送事件');
86
+ return false;
87
+ }
88
+ console.log('isParentWindow', isParentWindow, window.location.pathname, window.parent.location);
89
+ var category = event.category,
90
+ buttonType = event.buttonType,
91
+ action = event.action,
92
+ _event$label = event.label,
93
+ label = _event$label === void 0 ? '' : _event$label,
94
+ _event$value = event.value,
95
+ value = _event$value === void 0 ? 1 : _event$value,
96
+ _event$standard = event.standard,
97
+ standard = _event$standard === void 0 ? false : _event$standard,
98
+ el = event.el;
99
+
100
+ // 友盟事件格式:["_trackEvent", category, action, label, value]
101
+ if (!standard && el) {
102
+ buttonType = buttonType ? buttonType : getButtonType(el);
103
+ if (!action) action = getButtonFunction(el, action);
104
+ }
105
+ category = category ? category : getCategoryBySystem();
106
+ var standardLable = standard ? label : buildStandardLabel(label);
107
+ var standardAction = standard ? action : buildStandardAction(buttonType, action);
108
+ var trackEvent = {
109
+ category: category,
110
+ action: standardAction,
111
+ label: standardLable,
112
+ value: value
113
+ };
114
+ sendToUmeng(trackEvent);
115
+ };
116
+
117
+ // 发送页面访问统计
118
+ var trackPageView = useCallback(function (pageName, pageUrl) {
119
+ if (!isParentWindow) {
120
+ logWarn('当前窗口不是父窗口,无法发送页面访问统计');
121
+ return;
122
+ }
123
+ if (!window.parent._czc) {
124
+ logWarn('友盟未加载,无法发送页面访问统计');
125
+ return;
126
+ }
127
+ try {
128
+ var url = pageUrl || window.location.pathname + window.location.search;
129
+ var title = pageName || document.title;
130
+ window.parent._czc.push(['_trackPageview', url, title]);
131
+ log('发送页面访问统计', {
132
+ title: title,
133
+ url: url
134
+ });
135
+ } catch (error) {
136
+ logWarn('发送页面访问统计失败', error);
137
+ }
138
+ }, [log, logWarn]);
139
+
140
+ // 发送事件到友盟
141
+ var sendToUmeng = useCallback(function (event) {
142
+ try {
143
+ var category = event.category,
144
+ action = event.action,
145
+ _event$label2 = event.label,
146
+ label = _event$label2 === void 0 ? '' : _event$label2,
147
+ _event$value2 = event.value,
148
+ value = _event$value2 === void 0 ? 1 : _event$value2;
149
+
150
+ // 友盟标准格式
151
+ window.parent._czc.push(['_trackEvent', category, action, label, value]);
152
+ log('事件统计', {
153
+ category: category,
154
+ action: action,
155
+ label: label,
156
+ value: value
157
+ });
158
+ return true;
159
+ } catch (error) {
160
+ logWarn('发送事件到友盟失败', error);
161
+ return false;
162
+ }
163
+ }, [log, logWarn]);
164
+ return {
165
+ trackPageView: trackPageView,
166
+ trackEvent: trackEvent
167
+ };
168
+ };
@@ -0,0 +1,4 @@
1
+ export declare const useUserInfo: () => [
2
+ Record<string, any>,
3
+ (value: Record<string, any>) => void
4
+ ];
@@ -0,0 +1,17 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useLocalStorageState } from 'ahooks';
8
+ import { BUBU100_CACHE_USERINFO_KEY } from "../constant";
9
+ export var useUserInfo = function useUserInfo() {
10
+ var _useLocalStorageState = useLocalStorageState(BUBU100_CACHE_USERINFO_KEY, {
11
+ listenStorageChange: true
12
+ }),
13
+ _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 2),
14
+ userInfo = _useLocalStorageState2[0],
15
+ setUserInfo = _useLocalStorageState2[1];
16
+ return [userInfo !== null && userInfo !== void 0 ? userInfo : {}, setUserInfo];
17
+ };
@@ -0,0 +1,4 @@
1
+ export declare const useWareInfo: () => [
2
+ Record<string, any>,
3
+ (value: Record<string, any>) => void
4
+ ];
@@ -0,0 +1,17 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useLocalStorageState } from 'ahooks';
8
+ import { BUBU100_CACHE_WAREINFO_KEY } from "../constant";
9
+ export var useWareInfo = function useWareInfo() {
10
+ var _useLocalStorageState = useLocalStorageState(BUBU100_CACHE_WAREINFO_KEY, {
11
+ listenStorageChange: true
12
+ }),
13
+ _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 2),
14
+ warehouseInfo = _useLocalStorageState2[0],
15
+ setWarehouseInfo = _useLocalStorageState2[1];
16
+ return [warehouseInfo !== null && warehouseInfo !== void 0 ? warehouseInfo : {}, setWarehouseInfo];
17
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./component";
2
+ export * from "./constant";
3
+ export * from "./hooks";
4
+ export * from "./utils";
5
+ export * from "./package";
@@ -0,0 +1,5 @@
1
+ export * from "./component";
2
+ export * from "./constant";
3
+ export * from "./hooks";
4
+ export * from "./utils";
5
+ export * from "./package";