vap1 0.0.1

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 (441) hide show
  1. package/basetype.d.ts +62 -0
  2. package/basetype.js +2 -0
  3. package/components/Box/Box.d.ts +118 -0
  4. package/components/Box/Box.js +150 -0
  5. package/components/Box/SelectBar.d.ts +90 -0
  6. package/components/Box/SelectBar.js +93 -0
  7. package/components/Box/_register.d.ts +49 -0
  8. package/components/Box/_register.js +29 -0
  9. package/components/Box/index.d.ts +9 -0
  10. package/components/Box/index.js +6 -0
  11. package/components/Lists/SList.d.ts +58 -0
  12. package/components/Lists/SList.js +167 -0
  13. package/components/SearchBar/ActionButtons.d.ts +49 -0
  14. package/components/SearchBar/ActionButtons.js +96 -0
  15. package/components/SearchBar/ByField.d.ts +3 -0
  16. package/components/SearchBar/ByField.js +193 -0
  17. package/components/SearchBar/ByKeyword.d.ts +3 -0
  18. package/components/SearchBar/ByKeyword.js +34 -0
  19. package/components/SearchBar/SearchField.d.ts +15 -0
  20. package/components/SearchBar/SearchField.js +25 -0
  21. package/components/SearchBar/SearchTags.d.ts +2 -0
  22. package/components/SearchBar/SearchTags.js +18 -0
  23. package/components/SearchBar/_FieldType.d.ts +8 -0
  24. package/components/SearchBar/_FieldType.js +45 -0
  25. package/components/SearchBar/_register.d.ts +65 -0
  26. package/components/SearchBar/_register.js +29 -0
  27. package/components/SearchBar/index.d.ts +134 -0
  28. package/components/SearchBar/index.js +33 -0
  29. package/components/Tables/ApiTable.d.ts +18 -0
  30. package/components/Tables/ApiTable.js +48 -0
  31. package/components/Tables/ApiTableModal.d.ts +22 -0
  32. package/components/Tables/ApiTableModal.js +73 -0
  33. package/components/Tables/Components/ActionBar.d.ts +56 -0
  34. package/components/Tables/Components/ActionBar.js +100 -0
  35. package/components/Tables/Components/Actions.d.ts +47 -0
  36. package/components/Tables/Components/Actions.js +91 -0
  37. package/components/Tables/Components/Summary.d.ts +11 -0
  38. package/components/Tables/Components/Summary.js +11 -0
  39. package/components/Tables/Components/index.d.ts +17 -0
  40. package/components/Tables/Components/index.js +19 -0
  41. package/components/Tables/STable.d.ts +5 -0
  42. package/components/Tables/STable.js +37 -0
  43. package/components/Tables/TopTable.d.ts +24 -0
  44. package/components/Tables/TopTable.js +157 -0
  45. package/components/Tables/TopTableModal.d.ts +5 -0
  46. package/components/Tables/TopTableModal.js +20 -0
  47. package/components/Tables/Util.d.ts +3 -0
  48. package/components/Tables/Util.js +41 -0
  49. package/components/Tables/VTable.d.ts +11 -0
  50. package/components/Tables/VTable.js +237 -0
  51. package/components/Tables/index.d.ts +81 -0
  52. package/components/Tables/index.js +20 -0
  53. package/components/TreeSelect/BaseTreeSelect.d.ts +33 -0
  54. package/components/TreeSelect/BaseTreeSelect.js +190 -0
  55. package/components/TreeSelect/DTreeSelect.d.ts +24 -0
  56. package/components/TreeSelect/DTreeSelect.js +66 -0
  57. package/components/TreeSelect/FTreeSelect.d.ts +11 -0
  58. package/components/TreeSelect/FTreeSelect.js +39 -0
  59. package/components/TreeSelect/STreeSelect.d.ts +14 -0
  60. package/components/TreeSelect/STreeSelect.js +52 -0
  61. package/components/TreeSelect/index.d.ts +94 -0
  62. package/components/TreeSelect/index.js +9 -0
  63. package/components/Trees/ActionTree.d.ts +54 -0
  64. package/components/Trees/ActionTree.js +657 -0
  65. package/components/Trees/BaseTree.d.ts +31 -0
  66. package/components/Trees/BaseTree.js +185 -0
  67. package/components/Trees/DTree.d.ts +48 -0
  68. package/components/Trees/DTree.js +142 -0
  69. package/components/Trees/FTree.d.ts +33 -0
  70. package/components/Trees/FTree.js +79 -0
  71. package/components/Trees/STree.d.ts +21 -0
  72. package/components/Trees/STree.js +92 -0
  73. package/components/Trees/index.d.ts +134 -0
  74. package/components/Trees/index.js +9 -0
  75. package/components/UForm/FormWrapper.d.ts +22 -0
  76. package/components/UForm/FormWrapper.js +270 -0
  77. package/components/UForm/UDescriptions.d.ts +5 -0
  78. package/components/UForm/UDescriptions.js +134 -0
  79. package/components/UForm/UForm.d.ts +33 -0
  80. package/components/UForm/UForm.js +484 -0
  81. package/components/UForm/UFormModal.d.ts +3 -0
  82. package/components/UForm/UFormModal.js +149 -0
  83. package/components/UForm/UInfo.d.ts +10 -0
  84. package/components/UForm/UInfo.js +75 -0
  85. package/components/UForm/UInfoModal.d.ts +3 -0
  86. package/components/UForm/UInfoModal.js +50 -0
  87. package/components/UForm/UModal.d.ts +3 -0
  88. package/components/UForm/UModal.js +24 -0
  89. package/components/UForm/_FieldType.d.ts +8 -0
  90. package/components/UForm/_FieldType.js +100 -0
  91. package/components/UForm/_FormUtils.d.ts +5 -0
  92. package/components/UForm/_FormUtils.js +75 -0
  93. package/components/UForm/_input.d.ts +59 -0
  94. package/components/UForm/_input.js +147 -0
  95. package/components/UForm/_register.d.ts +87 -0
  96. package/components/UForm/_register.js +44 -0
  97. package/components/UForm/index.d.ts +387 -0
  98. package/components/UForm/index.js +15 -0
  99. package/components/Upload/UploadFile.d.ts +3 -0
  100. package/components/Upload/UploadFile.js +40 -0
  101. package/components/Upload/UploadImage.d.ts +24 -0
  102. package/components/Upload/UploadImage.js +93 -0
  103. package/components/Upload/UploadModal.d.ts +50 -0
  104. package/components/Upload/UploadModal.js +140 -0
  105. package/components/Upload/index.d.ts +77 -0
  106. package/components/Upload/index.js +9 -0
  107. package/components/Upload/useUpload.d.ts +15 -0
  108. package/components/Upload/useUpload.js +93 -0
  109. package/components/_RegisterUtil.d.ts +1 -0
  110. package/components/_RegisterUtil.js +25 -0
  111. package/components/_adapt/Alert.d.ts +11 -0
  112. package/components/_adapt/Alert.js +43 -0
  113. package/components/_adapt/Button.d.ts +20 -0
  114. package/components/_adapt/Button.js +26 -0
  115. package/components/_adapt/Col.d.ts +53 -0
  116. package/components/_adapt/Col.js +90 -0
  117. package/components/_adapt/Collapse.d.ts +30 -0
  118. package/components/_adapt/Collapse.js +33 -0
  119. package/components/_adapt/Drawer.d.ts +12 -0
  120. package/components/_adapt/Drawer.js +11 -0
  121. package/components/_adapt/Dropdown.d.ts +15 -0
  122. package/components/_adapt/Dropdown.js +38 -0
  123. package/components/_adapt/Icon.d.ts +14 -0
  124. package/components/_adapt/Icon.js +34 -0
  125. package/components/_adapt/Image.d.ts +4 -0
  126. package/components/_adapt/Image.js +11 -0
  127. package/components/_adapt/Menu.d.ts +32 -0
  128. package/components/_adapt/Menu.js +25 -0
  129. package/components/_adapt/Modal.d.ts +23 -0
  130. package/components/_adapt/Modal.js +69 -0
  131. package/components/_adapt/Popconfirm.d.ts +5 -0
  132. package/components/_adapt/Popconfirm.js +34 -0
  133. package/components/_adapt/Popover.d.ts +5 -0
  134. package/components/_adapt/Popover.js +34 -0
  135. package/components/_adapt/Progress.d.ts +14 -0
  136. package/components/_adapt/Progress.js +56 -0
  137. package/components/_adapt/Row.d.ts +10 -0
  138. package/components/_adapt/Row.js +23 -0
  139. package/components/_adapt/Select.d.ts +14 -0
  140. package/components/_adapt/Select.js +47 -0
  141. package/components/_adapt/Tag.d.ts +7 -0
  142. package/components/_adapt/Tag.js +12 -0
  143. package/components/_adapt/Tooltip.d.ts +5 -0
  144. package/components/_adapt/Tooltip.js +11 -0
  145. package/components/_adapt/todo/ColorPicker.d.ts +3 -0
  146. package/components/_adapt/todo/ColorPicker.js +42 -0
  147. package/components/_adapt/todo/FloatButton.d.ts +2 -0
  148. package/components/_adapt/todo/FloatButton.js +6 -0
  149. package/components/_adapt/todo/Image.d.ts +2 -0
  150. package/components/_adapt/todo/Image.js +6 -0
  151. package/components/_adapt/todo/Segmented.d.ts +2 -0
  152. package/components/_adapt/todo/Segmented.js +6 -0
  153. package/components/_adapt/todo/Space.d.ts +2 -0
  154. package/components/_adapt/todo/Space.js +6 -0
  155. package/components/_adapt/utils.d.ts +12 -0
  156. package/components/_adapt/utils.js +93 -0
  157. package/components/_common/AutoComplete.d.ts +32 -0
  158. package/components/_common/AutoComplete.js +87 -0
  159. package/components/_common/CountUp.d.ts +38 -0
  160. package/components/_common/CountUp.js +60 -0
  161. package/components/_common/DateRange.d.ts +52 -0
  162. package/components/_common/DateRange.js +108 -0
  163. package/components/_common/HighLight.d.ts +15 -0
  164. package/components/_common/HighLight.js +37 -0
  165. package/components/_common/I18N.d.ts +7 -0
  166. package/components/_common/I18N.js +6 -0
  167. package/components/_common/Loading.d.ts +9 -0
  168. package/components/_common/Loading.js +52 -0
  169. package/components/_common/MonthRange.d.ts +46 -0
  170. package/components/_common/MonthRange.js +130 -0
  171. package/components/_common/PromiseLabel.d.ts +11 -0
  172. package/components/_common/PromiseLabel.js +34 -0
  173. package/components/_common/Role.d.ts +5 -0
  174. package/components/_common/Role.js +11 -0
  175. package/components/_common/Upagination.d.ts +21 -0
  176. package/components/_common/Upagination.js +106 -0
  177. package/components/_setup/Const.d.ts +205 -0
  178. package/components/_setup/Const.js +112 -0
  179. package/components/_setup/I18N/enUS.d.ts +1 -0
  180. package/components/_setup/I18N/enUS.js +106 -0
  181. package/components/_setup/I18N/index.d.ts +3 -0
  182. package/components/_setup/I18N/index.js +5 -0
  183. package/components/_setup/I18N/zhCN.d.ts +3 -0
  184. package/components/_setup/I18N/zhCN.js +109 -0
  185. package/components/_setup/I18N/zhHK.d.ts +1 -0
  186. package/components/_setup/I18N/zhHK.js +107 -0
  187. package/components/_setup/ICON/IconTypes.d.ts +1 -0
  188. package/components/_setup/ICON/IconTypes.js +10 -0
  189. package/components/_setup/SearchField/SearchFieldAdvance.d.ts +1 -0
  190. package/components/_setup/SearchField/SearchFieldAdvance.js +57 -0
  191. package/components/_setup/SearchField/SearchFieldDate.d.ts +1 -0
  192. package/components/_setup/SearchField/SearchFieldDate.js +186 -0
  193. package/components/_setup/SearchField/SearchFieldInput.d.ts +3 -0
  194. package/components/_setup/SearchField/SearchFieldInput.js +20 -0
  195. package/components/_setup/SearchField/SearchFieldSelect.d.ts +1 -0
  196. package/components/_setup/SearchField/SearchFieldSelect.js +106 -0
  197. package/components/_setup/SearchField/SearchFieldTree.d.ts +1 -0
  198. package/components/_setup/SearchField/SearchFieldTree.js +191 -0
  199. package/components/_setup/SelectBar/SelectList.d.ts +1 -0
  200. package/components/_setup/SelectBar/SelectList.js +21 -0
  201. package/components/_setup/SelectBar/SelectTree.d.ts +1 -0
  202. package/components/_setup/SelectBar/SelectTree.js +11 -0
  203. package/components/_setup/UForm/UFormAdvanceInput.d.ts +1 -0
  204. package/components/_setup/UForm/UFormAdvanceInput.js +300 -0
  205. package/components/_setup/UForm/UFormAdvanceSelect.d.ts +0 -0
  206. package/components/_setup/UForm/UFormAdvanceSelect.js +26 -0
  207. package/components/_setup/UForm/UFormCrontab.d.ts +1 -0
  208. package/components/_setup/UForm/UFormCrontab.js +199 -0
  209. package/components/_setup/UForm/UFormDate.d.ts +1 -0
  210. package/components/_setup/UForm/UFormDate.js +313 -0
  211. package/components/_setup/UForm/UFormInput.d.ts +1 -0
  212. package/components/_setup/UForm/UFormInput.js +159 -0
  213. package/components/_setup/UForm/UFormJSON.d.ts +1 -0
  214. package/components/_setup/UForm/UFormJSON.js +219 -0
  215. package/components/_setup/UForm/UFormOrg.d.ts +1 -0
  216. package/components/_setup/UForm/UFormOrg.js +121 -0
  217. package/components/_setup/UForm/UFormRole.d.ts +1 -0
  218. package/components/_setup/UForm/UFormRole.js +47 -0
  219. package/components/_setup/UForm/UFormSearch.d.ts +0 -0
  220. package/components/_setup/UForm/UFormSearch.js +35 -0
  221. package/components/_setup/UForm/UFormSelect.d.ts +1 -0
  222. package/components/_setup/UForm/UFormSelect.js +179 -0
  223. package/components/_setup/UForm/UFormTree.d.ts +0 -0
  224. package/components/_setup/UForm/UFormTree.js +134 -0
  225. package/components/_setup/UForm/UFormUpload.d.ts +1 -0
  226. package/components/_setup/UForm/UFormUpload.js +173 -0
  227. package/components/_setup/UForm/_utils.d.ts +11 -0
  228. package/components/_setup/UForm/_utils.js +41 -0
  229. package/components/_setup/index.d.ts +21 -0
  230. package/components/_setup/index.js +25 -0
  231. package/components/index.d.ts +7 -0
  232. package/components/index.js +16 -0
  233. package/deps/JsonView.d.ts +6 -0
  234. package/deps/JsonView.js +57 -0
  235. package/deps/SpringBoot.d.ts +4 -0
  236. package/deps/SpringBoot.js +18 -0
  237. package/deps/SpringCloud.d.ts +14 -0
  238. package/deps/SpringCloud.js +29 -0
  239. package/deps/_editor/advance/_Audio.d.ts +0 -0
  240. package/deps/_editor/advance/_Audio.js +1 -0
  241. package/deps/_editor/advance/_Image.d.ts +2 -0
  242. package/deps/_editor/advance/_Image.js +89 -0
  243. package/deps/_editor/advance/_Table.d.ts +0 -0
  244. package/deps/_editor/advance/_Table.js +1 -0
  245. package/deps/_editor/advance/_Video.d.ts +0 -0
  246. package/deps/_editor/advance/_Video.js +1 -0
  247. package/deps/_editor/base/Element.d.ts +5 -0
  248. package/deps/_editor/base/Element.js +43 -0
  249. package/deps/_editor/base/Leaf.d.ts +3 -0
  250. package/deps/_editor/base/Leaf.js +36 -0
  251. package/deps/_editor/base/Support.d.ts +2 -0
  252. package/deps/_editor/base/Support.js +78 -0
  253. package/deps/_editor/base/types.d.ts +156 -0
  254. package/deps/_editor/base/types.js +10 -0
  255. package/deps/_editor/i18n.d.ts +1 -0
  256. package/deps/_editor/i18n.js +31 -0
  257. package/deps/_editor/tools/Button.d.ts +6 -0
  258. package/deps/_editor/tools/Button.js +86 -0
  259. package/deps/_editor/tools/ToolBar.d.ts +8 -0
  260. package/deps/_editor/tools/ToolBar.js +10 -0
  261. package/deps/_editor/tools/_BlockButton.d.ts +4 -0
  262. package/deps/_editor/tools/_BlockButton.js +77 -0
  263. package/deps/_editor/tools/_InsertButton.d.ts +6 -0
  264. package/deps/_editor/tools/_InsertButton.js +65 -0
  265. package/deps/_editor/tools/_MarkButton.d.ts +6 -0
  266. package/deps/_editor/tools/_MarkButton.js +45 -0
  267. package/deps/_editor/tools/_TxtButton.d.ts +7 -0
  268. package/deps/_editor/tools/_TxtButton.js +187 -0
  269. package/deps/_editor/utils/ParseHtml.d.ts +0 -0
  270. package/deps/_editor/utils/ParseHtml.js +220 -0
  271. package/deps/api-audit.d.ts +1 -0
  272. package/deps/api-audit.js +6 -0
  273. package/deps/api-data.d.ts +0 -0
  274. package/deps/api-data.js +1 -0
  275. package/deps/apis/useSource.d.ts +0 -0
  276. package/deps/apis/useSource.js +152 -0
  277. package/deps/echarts.d.ts +26 -0
  278. package/deps/echarts.js +71 -0
  279. package/deps/editor.d.ts +34 -0
  280. package/deps/editor.js +111 -0
  281. package/deps/registerEditor.d.ts +1 -0
  282. package/deps/registerEditor.js +15 -0
  283. package/hooks/_list.d.ts +87 -0
  284. package/hooks/_list.js +13 -0
  285. package/hooks/index.d.ts +14 -0
  286. package/hooks/index.js +49 -0
  287. package/hooks/useAjax.d.ts +14 -0
  288. package/hooks/useAjax.js +43 -0
  289. package/hooks/useAjaxAction.d.ts +13 -0
  290. package/hooks/useAjaxAction.js +42 -0
  291. package/hooks/useAjaxQuery.d.ts +40 -0
  292. package/hooks/useAjaxQuery.js +81 -0
  293. package/hooks/useApi.d.ts +69 -0
  294. package/hooks/useApi.js +352 -0
  295. package/hooks/useApiGlobal.d.ts +0 -0
  296. package/hooks/useApiGlobal.js +5 -0
  297. package/hooks/useApp.d.ts +243 -0
  298. package/hooks/useApp.js +17 -0
  299. package/hooks/useArray.d.ts +21 -0
  300. package/hooks/useArray.js +182 -0
  301. package/hooks/useCounter.d.ts +0 -0
  302. package/hooks/useCounter.js +82 -0
  303. package/hooks/useDefault.d.ts +6 -0
  304. package/hooks/useDefault.js +16 -0
  305. package/hooks/useDoLoad.d.ts +17 -0
  306. package/hooks/useDoLoad.js +44 -0
  307. package/hooks/useEffectFunction.d.ts +8 -0
  308. package/hooks/useEffectFunction.js +16 -0
  309. package/hooks/useEffectOnce.d.ts +5 -0
  310. package/hooks/useEffectOnce.js +23 -0
  311. package/hooks/useError.d.ts +5 -0
  312. package/hooks/useError.js +21 -0
  313. package/hooks/useFirstMountState.d.ts +6 -0
  314. package/hooks/useFirstMountState.js +18 -0
  315. package/hooks/useGenkey.d.ts +2 -0
  316. package/hooks/useGenkey.js +16 -0
  317. package/hooks/useGetSet.d.ts +11 -0
  318. package/hooks/useGetSet.js +27 -0
  319. package/hooks/useGlobal.d.ts +19 -0
  320. package/hooks/useGlobal.js +62 -0
  321. package/hooks/useGlobal_back.d.ts +1 -0
  322. package/hooks/useGlobal_back.js +11 -0
  323. package/hooks/useHover.d.ts +8 -0
  324. package/hooks/useHover.js +49 -0
  325. package/hooks/useMemoPromise.d.ts +6 -0
  326. package/hooks/useMemoPromise.js +42 -0
  327. package/hooks/useModals.d.ts +40 -0
  328. package/hooks/useModals.js +98 -0
  329. package/hooks/useMountedState.d.ts +5 -0
  330. package/hooks/useMountedState.js +20 -0
  331. package/hooks/useOpenState.d.ts +28 -0
  332. package/hooks/useOpenState.js +23 -0
  333. package/hooks/usePromise.d.ts +7 -0
  334. package/hooks/usePromise.js +22 -0
  335. package/hooks/useQueue.d.ts +12 -0
  336. package/hooks/useQueue.js +34 -0
  337. package/hooks/useSetState.d.ts +9 -0
  338. package/hooks/useSetState.js +26 -0
  339. package/hooks/useStateList.d.ts +13 -0
  340. package/hooks/useStateList.js +59 -0
  341. package/hooks/useToggle.d.ts +6 -0
  342. package/hooks/useToggle.js +12 -0
  343. package/hooks/useUnmountPromise.d.ts +6 -0
  344. package/hooks/useUnmountPromise.js +36 -0
  345. package/hooks/useUpdate.d.ts +7 -0
  346. package/hooks/useUpdate.js +15 -0
  347. package/hooks/useUpdateEffect.d.ts +6 -0
  348. package/hooks/useUpdateEffect.js +18 -0
  349. package/index.d.ts +139 -0
  350. package/index.js +161 -0
  351. package/login/Base65.d.ts +8 -0
  352. package/login/Base65.js +65 -0
  353. package/login/Password.d.ts +61 -0
  354. package/login/Password.js +124 -0
  355. package/login/SM4.d.ts +20 -0
  356. package/login/SM4.js +193 -0
  357. package/login/cems/index.d.ts +10 -0
  358. package/login/cems/index.js +17 -0
  359. package/login/jit/index.d.ts +32 -0
  360. package/login/jit/index.js +180 -0
  361. package/login/jit/pnxclient.d.ts +54 -0
  362. package/login/jit/pnxclient.js +575 -0
  363. package/login/sso/index.d.ts +0 -0
  364. package/login/sso/index.js +0 -0
  365. package/login/vap/index.d.ts +1 -0
  366. package/login/vap/index.js +6 -0
  367. package/login/xrtx/index.d.ts +2 -0
  368. package/login/xrtx/index.js +33 -0
  369. package/package.json +1 -0
  370. package/screen/Comment.d.ts +31 -0
  371. package/screen/Comment.js +29 -0
  372. package/screen/EchartContent.d.ts +0 -0
  373. package/screen/EchartContent.js +63 -0
  374. package/screen/Page.d.ts +13 -0
  375. package/screen/Page.js +74 -0
  376. package/screen/index.d.ts +3 -0
  377. package/screen/index.js +9 -0
  378. package/screen/render.d.ts +5 -0
  379. package/screen/render.js +10 -0
  380. package/utils/Ajax.d.ts +85 -0
  381. package/utils/Ajax.js +147 -0
  382. package/utils/ArrayUtil.d.ts +22 -0
  383. package/utils/ArrayUtil.js +51 -0
  384. package/utils/CacheUtil.d.ts +20 -0
  385. package/utils/CacheUtil.js +86 -0
  386. package/utils/Const.d.ts +14 -0
  387. package/utils/Const.js +37 -0
  388. package/utils/CustomApp.d.ts +242 -0
  389. package/utils/CustomApp.js +18 -0
  390. package/utils/EventUtil.d.ts +22 -0
  391. package/utils/EventUtil.js +63 -0
  392. package/utils/Format.d.ts +28 -0
  393. package/utils/Format.js +206 -0
  394. package/utils/Global.d.ts +276 -0
  395. package/utils/Global.js +125 -0
  396. package/utils/Logger.d.ts +5 -0
  397. package/utils/Logger.js +32 -0
  398. package/utils/PageUtil.d.ts +24 -0
  399. package/utils/PageUtil.js +87 -0
  400. package/utils/Renders/ApiGetRender.d.ts +23 -0
  401. package/utils/Renders/ApiGetRender.js +192 -0
  402. package/utils/Renders/ApiPostRender.d.ts +17 -0
  403. package/utils/Renders/ApiPostRender.js +161 -0
  404. package/utils/Renders/DateRender.d.ts +8 -0
  405. package/utils/Renders/DateRender.js +35 -0
  406. package/utils/Renders/DictRender.d.ts +23 -0
  407. package/utils/Renders/DictRender.js +258 -0
  408. package/utils/Renders/FileRender.d.ts +3 -0
  409. package/utils/Renders/FileRender.js +46 -0
  410. package/utils/Renders/ListRender.d.ts +23 -0
  411. package/utils/Renders/ListRender.js +111 -0
  412. package/utils/Renders/NumberRender.d.ts +19 -0
  413. package/utils/Renders/NumberRender.js +65 -0
  414. package/utils/Renders/StatusRender.d.ts +12 -0
  415. package/utils/Renders/StatusRender.js +68 -0
  416. package/utils/Renders/StringRender.d.ts +14 -0
  417. package/utils/Renders/StringRender.js +194 -0
  418. package/utils/Renders/_define.d.ts +26 -0
  419. package/utils/Renders/_define.js +64 -0
  420. package/utils/Renders/index.d.ts +9 -0
  421. package/utils/Renders/index.js +42 -0
  422. package/utils/StringUtil.d.ts +124 -0
  423. package/utils/StringUtil.js +352 -0
  424. package/utils/TreeUtil.d.ts +42 -0
  425. package/utils/TreeUtil.js +69 -0
  426. package/utils/VAP.d.ts +16 -0
  427. package/utils/VAP.js +78 -0
  428. package/utils/XHR.d.ts +9 -0
  429. package/utils/XHR.js +53 -0
  430. package/utils/_AjaxUtil.d.ts +11 -0
  431. package/utils/_AjaxUtil.js +45 -0
  432. package/utils/_Support.d.ts +22 -0
  433. package/utils/_Support.js +106 -0
  434. package/utils/i18n.d.ts +60 -0
  435. package/utils/i18n.js +184 -0
  436. package/utils/index.d.ts +19 -0
  437. package/utils/index.js +54 -0
  438. package/utils/screenful.d.ts +15 -0
  439. package/utils/screenful.js +64 -0
  440. package/widget/index.d.ts +39 -0
  441. package/widget/index.js +21 -0
package/basetype.d.ts ADDED
@@ -0,0 +1,62 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * VAP 在应用页面上,自动注入页面参数
4
+ */
5
+ export type PageProps = {
6
+ /**
7
+ * params 是 search 部分
8
+ * 例如 /app/?a=1&b=2&c=3#/xxx => {a:'1',b:'2',c:'3'}
9
+ */
10
+ params: {
11
+ [props: string]: string;
12
+ };
13
+ /**
14
+ * pattrens 是 hash 部分
15
+ * 例如 /app/#/xxx/1/2/3 => ['1','2','3']
16
+ */
17
+ patterns: string[];
18
+ /**
19
+ * Status 状态参数,不会体现在 url 上,
20
+ * 只能通过代码 toMenu('url',{status:xxxx}) 带入,页面刷新会丢失
21
+ */
22
+ status?: any;
23
+ };
24
+ export type Key = string | number;
25
+ export type BaseTypes = string | number | bigint | boolean | null | undefined;
26
+ export type PlainObject = Record<string, any>;
27
+ /**
28
+ * VAP 通用
29
+ */
30
+ export type BaseItem = {
31
+ /**
32
+ * 是否有权限查看此列
33
+ */
34
+ roleCode?: string;
35
+ /**
36
+ * i18nKey, title 替代品,存在 ik(i18n Key) 时,有限使用 i18n Key
37
+ */
38
+ ik?: string;
39
+ };
40
+ /**
41
+ * VAP 通用选项 用于 select , radio, checkbox 等输入,
42
+ * 支持多级(treeselect cascade)等,级联场景需要传 children
43
+ */
44
+ export type BaseOption = BaseItem & {
45
+ /**
46
+ * 显示名称
47
+ */
48
+ label: React.ReactNode;
49
+ /**
50
+ * 选中后的取值
51
+ */
52
+ value: number | string | boolean | null;
53
+ /**
54
+ * 级联模式下传入
55
+ */
56
+ children?: BaseOption[];
57
+ /**
58
+ * 自定义扩展字段
59
+ */
60
+ [propName: string]: any;
61
+ };
62
+ export type { ApiModel } from './hooks/_list';
package/basetype.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,118 @@
1
+ import React from 'react';
2
+ import type { MutableRefObject } from 'react';
3
+ import type { SelectBarProps } from './SelectBar';
4
+ import type { SearchBarProps } from '../SearchBar';
5
+ import type { ActButton } from '../SearchBar/ActionButtons';
6
+ import type { Key, PlainObject } from '../../basetype';
7
+ import type { UPaginationProps } from '../_common/Upagination';
8
+ type BoxState = {
9
+ /**
10
+ * 内容区域高度
11
+ */
12
+ height?: number;
13
+ /**
14
+ * 当前选中的信息,
15
+ * 前两项分别为 key 和 data, 后面三项为扩展项,
16
+ */
17
+ selected: [Key, PlainObject, any, any, any];
18
+ };
19
+ type BoxContext = {
20
+ /**
21
+ * BOX 当前状态
22
+ */
23
+ state: BoxState;
24
+ /**
25
+ * BOX
26
+ */
27
+ resize: () => void;
28
+ /**
29
+ * 容器映射
30
+ */
31
+ root: MutableRefObject<HTMLDivElement>;
32
+ /**
33
+ * 某些支持ref的类型,可以使用 selectRef 进行一些REF操作
34
+ * 说明:使用时需自行确认类型存在
35
+ */
36
+ selectRef?: MutableRefObject<any>;
37
+ };
38
+ declare const BoxContext: React.Context<BoxContext>;
39
+ /**
40
+ * 展示模式
41
+ * common : 默认,无固定高度
42
+ * inner : 当 Table 在一个高度固定的容器内时,使用 inner 模式
43
+ * fixed : 页面可见区域只有一个 Table 时, 使用 fixed 模式
44
+ */
45
+ export type BoxMode = 'common' | 'inner' | 'fixed';
46
+ /**
47
+ * 说明:如果需要使用 useBox 获取BOX内部状态
48
+ * 必须自行手动再包一层 否则无法使用,
49
+ * 即: useBox() 代码必须出现在 Box 内
50
+ *
51
+ * 例如 :
52
+ *
53
+ * 错误代码
54
+ * const box = useBox();
55
+ * return <Box>...</Box>
56
+ *
57
+ * 正确代码
58
+ * const Clild = ()=>{
59
+ * const box = useBox();
60
+ * return <>...</>
61
+ * }
62
+ *
63
+ * return <Box><Child/></Box>
64
+ * */
65
+ export declare const useBox: () => BoxContext;
66
+ /**
67
+ * Box 排版用于普通的信息交互,统一与简化各种排版
68
+ *
69
+ * 左边 : 自定义条件选择区域
70
+ * 右边 上 : 自定义条件输入区域
71
+ * 右边 下 : 自定义内容展示区
72
+ */
73
+ export type BoxProps = {
74
+ /**
75
+ * 自定义 className
76
+ */
77
+ className?: string;
78
+ /**
79
+ * 自定义 className
80
+ */
81
+ style?: React.CSSProperties;
82
+ /**
83
+ * 展示模式
84
+ */
85
+ mode?: BoxMode;
86
+ /**
87
+ * 选择区域
88
+ */
89
+ selectBar?: SelectBarProps;
90
+ /**
91
+ * 搜索区域
92
+ */
93
+ searchBar?: SearchBarProps;
94
+ /**
95
+ * 操作区域
96
+ */
97
+ actionBar?: (ActButton[]) | React.ReactNode;
98
+ /**
99
+ * 分页区域
100
+ */
101
+ pagination?: UPaginationProps;
102
+ /**
103
+ * 传此项时,会自动设置 内容区域为 overflow:auto, 否则 为 overflow:hidden
104
+ */
105
+ overflowAuto?: true;
106
+ /**
107
+ * 默认查询参数
108
+ */
109
+ default?: PlainObject;
110
+ /**
111
+ * 在部分皮肤下有效,强制不显示背景
112
+ */
113
+ nobg?: boolean;
114
+ };
115
+ export declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<{
116
+ resize: Function;
117
+ }>>;
118
+ export {};
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Box = exports.useBox = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const lodash_1 = __importDefault(require("lodash"));
32
+ const antd_1 = require("antd");
33
+ const hooks_1 = require("../../hooks");
34
+ const SelectBar_1 = require("./SelectBar");
35
+ const SearchBar_1 = require("../SearchBar");
36
+ const Upagination_1 = require("../_common/Upagination");
37
+ const utils_1 = require("../../utils");
38
+ const _register_1 = require("./_register");
39
+ const HEIGHT_OMIT = 'ubox-omit';
40
+ const getParentByClassName = (el, clazz) => {
41
+ if (el.classList.contains(clazz))
42
+ return el;
43
+ return getParentByClassName(el.parentElement, clazz);
44
+ };
45
+ const BoxContext = (0, react_1.createContext)(null);
46
+ /**
47
+ * 说明:如果需要使用 useBox 获取BOX内部状态
48
+ * 必须自行手动再包一层 否则无法使用,
49
+ * 即: useBox() 代码必须出现在 Box 内
50
+ *
51
+ * 例如 :
52
+ *
53
+ * 错误代码
54
+ * const box = useBox();
55
+ * return <Box>...</Box>
56
+ *
57
+ * 正确代码
58
+ * const Clild = ()=>{
59
+ * const box = useBox();
60
+ * return <>...</>
61
+ * }
62
+ *
63
+ * return <Box><Child/></Box>
64
+ * */
65
+ const useBox = () => (0, react_1.useContext)(BoxContext);
66
+ exports.useBox = useBox;
67
+ exports.Box = react_1.default.forwardRef((props, ref) => {
68
+ const app = (0, hooks_1.useApp)();
69
+ const [state, setState] = (0, hooks_1.useSetState)(null);
70
+ const rootRef = (0, react_1.useRef)(null);
71
+ const contextRef = (0, react_1.useRef)(null);
72
+ const selectRef = (0, react_1.useRef)(null);
73
+ const className = ['c-box'];
74
+ if (props.nobg)
75
+ className.push('c-box-nobg');
76
+ const style = Object.assign({}, props.style);
77
+ if (props.mode)
78
+ className.push('c-box-' + props.mode);
79
+ if (props.mode == 'inner') {
80
+ if (rootRef.current == null) {
81
+ // style.height = 0;
82
+ style.display = 'none';
83
+ }
84
+ else {
85
+ const container = getParentByClassName(rootRef.current.parentElement, 'c-box');
86
+ style.height = Math.floor(container.parentElement.getBoundingClientRect().height);
87
+ }
88
+ }
89
+ else if (props.mode == 'fixed') {
90
+ if (app != null) {
91
+ style.height = app.theme.contentHeight;
92
+ }
93
+ else {
94
+ style.height = '100%';
95
+ }
96
+ }
97
+ const resize = () => {
98
+ if (props.mode == undefined || props.mode == 'common' || app == null) {
99
+ if (state === null)
100
+ setState({});
101
+ return;
102
+ }
103
+ ;
104
+ let el = rootRef.current;
105
+ if (!el)
106
+ return;
107
+ document.body.classList.add('v-resizing');
108
+ let total = el.getBoundingClientRect().height;
109
+ if (props.mode == 'inner') {
110
+ total = el.parentElement.parentElement.getBoundingClientRect().height;
111
+ }
112
+ let children = el.children;
113
+ if (el.children.length == 1 && el.children.item(0).classList.contains('ubox-content')) {
114
+ children = el.children.item(0).children;
115
+ }
116
+ for (let i = 0, _i = children.length; i < _i; i++) {
117
+ let child = children.item(i);
118
+ if (child.classList.contains(HEIGHT_OMIT)) {
119
+ total -= child.getBoundingClientRect().height;
120
+ }
121
+ }
122
+ setState({ height: Math.floor(total) });
123
+ document.body.classList.remove('v-resizing');
124
+ };
125
+ (0, react_1.useEffect)(() => { setTimeout(resize, 2); }, [app === null || app === void 0 ? void 0 : app.theme.contentHeight]);
126
+ (0, react_1.useLayoutEffect)(() => {
127
+ if (ref) {
128
+ ref.current = { resize };
129
+ }
130
+ setTimeout(resize, 1);
131
+ }, []);
132
+ let paginationProps = {};
133
+ // if (props.pagination && props.mode == 'inner') {
134
+ // paginationProps.hideOnSinglePage = true;
135
+ // }
136
+ return react_1.default.createElement(antd_1.Layout, { className: utils_1.StringUtil.className(className, props.className), style: style },
137
+ props.selectBar && (0, _register_1.getSelectBar)(props.selectBar.type) != null && react_1.default.createElement(SelectBar_1.SelectBar, Object.assign({}, props.selectBar, { ref: selectRef, onSelect: (...args) => setState({ selected: args }) })),
138
+ react_1.default.createElement(antd_1.Layout.Content, { style: { overflow: props.overflowAuto ? 'auto' : 'hidden' }, ref: ctx => rootRef.current = ctx.context },
139
+ (props.searchBar ||
140
+ (props.actionBar && ((lodash_1.default.isArray(props.actionBar) && props.actionBar.length > 0)
141
+ || (!lodash_1.default.isArray(props.actionBar) && react_1.default.isValidElement(props.actionBar))))) && react_1.default.createElement(SearchBar_1.SearchBar, Object.assign({}, props.searchBar, { default: props.default, className: HEIGHT_OMIT, onExpand: (isExpand) => {
142
+ resize();
143
+ if (lodash_1.default.isFunction(props.searchBar.onExpand)) {
144
+ props.searchBar.onExpand(isExpand);
145
+ }
146
+ } }), props.actionBar ? (lodash_1.default.isArray(props.actionBar) ? react_1.default.createElement(SearchBar_1.SearchBar.ActionButtons, { buttons: props.actionBar }) : props.actionBar) : []),
147
+ react_1.default.createElement(BoxContext.Provider, { value: { state, resize, root: contextRef, selectRef } },
148
+ react_1.default.createElement("div", { className: 'ubox-content', ref: contextRef }, state != null && props.children)),
149
+ props.pagination && react_1.default.createElement(Upagination_1.UPagination, Object.assign({}, paginationProps, props.pagination, { className: HEIGHT_OMIT }))));
150
+ });
@@ -0,0 +1,90 @@
1
+ import React from 'react';
2
+ import type { ComponentType } from 'react';
3
+ import type { Key, BaseItem, PlainObject } from '../../basetype';
4
+ import type { STreeProps } from '../Trees/STree';
5
+ import type { DTreeProps } from '../Trees/DTree';
6
+ import type { FTreeProps } from '../Trees/FTree';
7
+ import type { SListPorps } from '../Lists/SList';
8
+ type SelectBarAction = BaseItem & {
9
+ /**
10
+ * action 图标
11
+ */
12
+ icon: string;
13
+ /**
14
+ * 鼠标 hover tips 标题
15
+ */
16
+ title?: string;
17
+ /**
18
+ * 点击事件
19
+ * */
20
+ onClick: () => void;
21
+ /**
22
+ * 如需二次确定,传提示消息
23
+ */
24
+ confirm?: React.ReactNode;
25
+ };
26
+ type _BoxSelectBarProps = BaseItem & {
27
+ /**
28
+ * 标题,如传了 ik ,则由 ik 替代之
29
+ * 传 fasle 时,不显示标题区域
30
+ */
31
+ title: string | false;
32
+ /**
33
+ * 宽度,默认为250
34
+ */
35
+ width?: number;
36
+ /**
37
+ * 选中一个项目后的回调方法
38
+ *
39
+ * 说明 :
40
+ * 1. sekectKey 可能 为空,需要判断,为空时,代表没有条目被选中
41
+ * 2. 前两项,固定为 被选中条目的key, 被选中条目的数据,根据实际情况不同,可能返回后面的项目
42
+ * 在 stree,ftree,dtree 中, 第 三 四 五项分别为 : 父结点 ID Key, 父结点 对象 Object,全路径 Object []
43
+ * list 中没有
44
+ */
45
+ onSelect: (key: Key, object?: PlainObject, ...args: any[]) => PlainObject;
46
+ /**
47
+ * 是否可以过滤
48
+ * 说明,开启后,将会往注册的组件注入 searchValue,组件需要自行实现
49
+ */
50
+ filter?: boolean;
51
+ /**
52
+ * 操作区域
53
+ */
54
+ actions?: SelectBarAction[];
55
+ /**
56
+ * 边栏状态变更触发
57
+ */
58
+ onSelectCollapse?: (boolean: any) => void;
59
+ };
60
+ /**
61
+ * 说明: 内置 stree/dtree/ftree 三种树类型,和 list 类型
62
+ * 当为类置 type 时,不要传以下属性:
63
+ * searchValue : 在 selectBar 里面传 filter: true
64
+ * onSelect : 在 selectBar 里面传 onSelect
65
+ */
66
+ type ExtendSelectProps = {
67
+ type: 'stree';
68
+ config: Omit<STreeProps, 'searchValue' | 'onSelect'>;
69
+ } | {
70
+ type: 'dtree';
71
+ config: Omit<DTreeProps, 'searchValue' | 'onSelect'>;
72
+ } | {
73
+ type: 'ftree';
74
+ config: Omit<FTreeProps, 'searchValue' | 'onSelect'>;
75
+ } | {
76
+ type: 'slist';
77
+ config: Omit<SListPorps, 'searchValue' | 'onSelect'>;
78
+ } | {
79
+ type: 'custom';
80
+ config?: any;
81
+ content: ComponentType<_BoxSelectBarProps>;
82
+ } | {
83
+ type: string;
84
+ config?: any;
85
+ };
86
+ export type SelectBarProps = _BoxSelectBarProps & ExtendSelectProps;
87
+ export declare const SelectBar: React.ForwardRefExoticComponent<Omit<SelectBarProps, "onSelect"> & {
88
+ onSelect: (key: Key, object?: PlainObject, ...args: any[]) => void;
89
+ } & React.RefAttributes<any>>;
90
+ export {};
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SelectBar = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const lodash_1 = __importDefault(require("lodash"));
32
+ const antd_1 = require("antd");
33
+ const hooks_1 = require("../../hooks");
34
+ const utils_1 = require("../../utils");
35
+ const _register_1 = require("./_register");
36
+ const Const_1 = require("../_setup/Const");
37
+ const Icon_1 = require("../_adapt/Icon");
38
+ exports.SelectBar = react_1.default.forwardRef((props, ref) => {
39
+ const [keyword, setKeyword] = (0, react_1.useState)(null);
40
+ const [collapsed, setCollapsed] = (0, hooks_1.useToggle)(false);
41
+ // const setKeyword = _.debounce(_setKeyword, 100);
42
+ let component = (0, _register_1.getSelectBar)(props.type);
43
+ (0, react_1.useLayoutEffect)(() => {
44
+ if (lodash_1.default.isFunction(props.onSelectCollapse)) {
45
+ props.onSelectCollapse(collapsed);
46
+ }
47
+ }, [collapsed]);
48
+ if (component == undefined) {
49
+ console.warn('SelectBar Type is not registerd ', props.type);
50
+ return utils_1.Const.NONE;
51
+ }
52
+ if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
53
+ return utils_1.Const.NONE;
54
+ const width = lodash_1.default.isNumber(props.width) ? props.width : 250;
55
+ const renderContent = () => {
56
+ if (props.type == 'custom') {
57
+ if (!lodash_1.default.has(props, 'content')) {
58
+ return utils_1.Const.NONE;
59
+ }
60
+ // @ts-ignore
61
+ return react_1.default.createElement(props.content, Object.assign({}, props, { searchValue: keyword }));
62
+ }
63
+ return react_1.default.createElement(component.component, Object.assign({}, props, { searchValue: keyword, ref: ref }));
64
+ };
65
+ if (props.title === false)
66
+ return react_1.default.createElement(antd_1.Layout.Sider, { collapsed: false, width: width }, renderContent());
67
+ const title = utils_1.i18n.getText(props.ik, props.title);
68
+ const SearchAction = (props) => {
69
+ if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
70
+ return utils_1.Const.NONE;
71
+ const iconProps = { type: props.icon, };
72
+ if (props.ik) {
73
+ iconProps.title = utils_1.i18n.txt(props.ik);
74
+ }
75
+ else if (props.title) {
76
+ iconProps.title = props.title;
77
+ }
78
+ if (props.confirm == null)
79
+ return react_1.default.createElement(Icon_1.Icon, Object.assign({}, iconProps, { onClick: props.onClick }));
80
+ return react_1.default.createElement(antd_1.Popconfirm, { placement: "right", title: props.confirm, onConfirm: props.onClick },
81
+ react_1.default.createElement(Icon_1.Icon, Object.assign({}, iconProps, { evt: true })));
82
+ };
83
+ return react_1.default.createElement(antd_1.Layout.Sider, { className: 'c-selectbar-' + utils_1.GLOBAL.CONFIG.BOX.SELECT_CLOSE, collapsed: collapsed, collapsedWidth: utils_1.GLOBAL.CONFIG.BOX.SELECT_CLOSE == 2 ? 0 : 6, width: width },
84
+ react_1.default.createElement("div", { className: 'c-selectbar-closed', onClick: setCollapsed, title: utils_1.i18n.txt(Const_1.V.TXT_EXPAND) }),
85
+ react_1.default.createElement("div", { className: 'c-selectbar' },
86
+ react_1.default.createElement("div", { className: 'c-selectbar-head' },
87
+ react_1.default.createElement("div", { className: 'c-selectbar-title' },
88
+ react_1.default.createElement(Icon_1.Icon, { type: "left-circle", title: utils_1.i18n.txt(Const_1.V.TXT_COLLAPSE), onClick: setCollapsed }),
89
+ props.filter && react_1.default.createElement("input", { onChange: evt => utils_1.PageUtil.stopEvent(evt, () => setKeyword(evt.target.value)), value: keyword, placeholder: utils_1.i18n.getText(props.ik, props.title) }),
90
+ !props.filter && react_1.default.createElement("span", null, title)),
91
+ react_1.default.createElement("div", { className: 'c-selectbar-action' }, (props.actions || []).map(item => react_1.default.createElement(SearchAction, Object.assign({}, item))))),
92
+ react_1.default.createElement("div", { className: 'c-selectbar-body' }, renderContent())));
93
+ });
@@ -0,0 +1,49 @@
1
+ import type { Key, PlainObject } from '../../basetype';
2
+ import type { ComponentType } from 'react';
3
+ export type SelectBarProps = {
4
+ /**
5
+ * 选中一个项目后的回调方法
6
+ * 按规范:
7
+ * 第一个参数返回选中项的 key
8
+ * 第二个参数返回选中项的 数据
9
+ * 后面的项,可在不同类型间扩展,根据不同的类型,参数会有不同
10
+ */
11
+ onSelect: (key: Key, obj: PlainObject, ...args: any[]) => PlainObject;
12
+ /**
13
+ * 搜索值
14
+ */
15
+ searchValue?: string;
16
+ /**
17
+ * 自定义扩展配置
18
+ */
19
+ config?: any;
20
+ };
21
+ /**
22
+ * 通用 Table 左侧组件定义
23
+ */
24
+ export type SelectBarComponent = ComponentType<SelectBarProps>;
25
+ /**
26
+ * 左边选择栏 组件特性
27
+ */
28
+ export type SelectBarOptions = {
29
+ /**
30
+ * 是否支持搜索
31
+ */
32
+ canSearch?: boolean;
33
+ };
34
+ type SelectBar = SelectBarOptions & {
35
+ component: SelectBarComponent;
36
+ };
37
+ /**
38
+ * @param type
39
+ * 类型名称, 支持: VTable,STable,ApiTalbe,DataTable,Box
40
+ * @param element
41
+ * 输入组件,为一个React 类型,自动注入 props @see FieldProps
42
+ * @param options
43
+ * 注册选项 @see FieldOptions
44
+ * @param forceOverWrite
45
+ * 强制覆盖掉已注册的组件,默认重复注册相同的类型时,后注册的不能生效,使用 true 后,强㓡覆盖掉之前注册的组件
46
+ */
47
+ export declare const registerSelectBar: (type: string, component: SelectBarComponent, options?: SelectBarOptions, forceOverWrite?: boolean) => void;
48
+ export declare const getSelectBar: (type: string) => SelectBar;
49
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSelectBar = exports.registerSelectBar = void 0;
4
+ const _Support_1 = require("../../utils/_Support");
5
+ const StringUtil_1 = require("../../utils/StringUtil");
6
+ const _RegisterUtil_1 = require("../_RegisterUtil");
7
+ const _C_SELECT_BAR = (0, _Support_1.globalDefault)('_C_SELECT_BAR', new Map());
8
+ const DEFAULT = { canSearch: false };
9
+ /**
10
+ * @param type
11
+ * 类型名称, 支持: VTable,STable,ApiTalbe,DataTable,Box
12
+ * @param element
13
+ * 输入组件,为一个React 类型,自动注入 props @see FieldProps
14
+ * @param options
15
+ * 注册选项 @see FieldOptions
16
+ * @param forceOverWrite
17
+ * 强制覆盖掉已注册的组件,默认重复注册相同的类型时,后注册的不能生效,使用 true 后,强㓡覆盖掉之前注册的组件
18
+ */
19
+ const registerSelectBar = (type, component, options = null, forceOverWrite = false) => {
20
+ (0, _RegisterUtil_1.register)(_C_SELECT_BAR, type, DEFAULT, component, options, forceOverWrite);
21
+ };
22
+ exports.registerSelectBar = registerSelectBar;
23
+ const getSelectBar = (type) => {
24
+ let key = (0, StringUtil_1.trimLower)(type);
25
+ if (_C_SELECT_BAR.has(key))
26
+ return _C_SELECT_BAR.get(key);
27
+ return null;
28
+ };
29
+ exports.getSelectBar = getSelectBar;
@@ -0,0 +1,9 @@
1
+ import { useBox } from './Box';
2
+ import { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from 'react';
3
+ import type { BoxProps } from './Box';
4
+ export type BoxComponent = ForwardRefExoticComponent<PropsWithChildren<BoxProps> & RefAttributes<{
5
+ resize: () => void;
6
+ }>> & {
7
+ useBox: typeof useBox;
8
+ };
9
+ export declare const Box: BoxComponent;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Box = void 0;
4
+ const Box_1 = require("./Box");
5
+ exports.Box = Box_1.Box;
6
+ exports.Box.useBox = Box_1.useBox;
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import type { PlainObject, Key } from '../../basetype';
3
+ import type { ReactNode } from 'react';
4
+ import type { IconProps } from '../_adapt/Icon';
5
+ type ItemRenderFunction = (record: PlainObject, searchValue?: string) => ReactNode;
6
+ export type SListPorps = {
7
+ /**
8
+ * key 字段,默认为ID
9
+ */
10
+ keyField: string;
11
+ /**
12
+ * Icon字段 ,默认为空,传入后,以此字段显示图标
13
+ */
14
+ iconField?: string;
15
+ /**
16
+ * title 字段,传字段名称。
17
+ */
18
+ titleField: string;
19
+ /**
20
+ * 值字段,传值时,显示在右
21
+ */
22
+ valueField?: string;
23
+ /**
24
+ * 搜索关键字
25
+ */
26
+ searchValue?: string;
27
+ /**
28
+ * 自定义 render, 说明:自定义时,搜索关键字可能会失效。
29
+ */
30
+ itemRender?: ItemRenderFunction;
31
+ /**
32
+ * 自定义 Renders
33
+ * 说明:优先级:
34
+ *
35
+ * itemRender > renders > 自动生成 (通过传field)
36
+ *
37
+ */
38
+ renders?: {
39
+ icon?: (record: PlainObject, searchValue?: string) => IconProps | string | React.ReactNode;
40
+ title: ItemRenderFunction;
41
+ value?: ItemRenderFunction;
42
+ action?: ItemRenderFunction;
43
+ };
44
+ /**
45
+ * 数据
46
+ */
47
+ list: PlainObject[];
48
+ /**
49
+ * 选中方法
50
+ */
51
+ onSelect?: (key: Key, data: PlainObject) => void;
52
+ /**
53
+ * 可选中必选
54
+ */
55
+ mustSelect?: true | ((list: PlainObject[]) => PlainObject);
56
+ };
57
+ export declare const SList: React.FC<SListPorps>;
58
+ export {};