@done-coding/admin-core 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/README.md +77 -1
  2. package/es/_virtual/_plugin-vue_export-helper.mjs +7 -6
  3. package/es/bridge/config-hook.mjs +49 -37
  4. package/es/bridge/index.mjs +152 -109
  5. package/es/bridge/layout.mjs +45 -31
  6. package/es/bridge/plugin.mjs +22 -12
  7. package/es/bridge/route.mjs +59 -50
  8. package/es/bridge/state.mjs +54 -39
  9. package/es/bridge/storage.mjs +18 -8
  10. package/es/bridge/theme/index.mjs +200 -97
  11. package/es/bridge/theme/persist.mjs +11 -7
  12. package/es/bridge/theme/system-dark.mjs +13 -6
  13. package/es/components/app-layout/AppAside.vue.mjs +4 -4
  14. package/es/components/app-layout/AppAside.vue2.mjs +37 -30
  15. package/es/components/app-layout/AppBody.vue.mjs +4 -4
  16. package/es/components/app-layout/AppBody.vue2.mjs +97 -60
  17. package/es/components/app-layout/AppBreadcrumb.vue.mjs +4 -4
  18. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +59 -38
  19. package/es/components/app-layout/AppCollapseToggle.vue.mjs +4 -4
  20. package/es/components/app-layout/AppCollapseToggle.vue2.mjs +51 -42
  21. package/es/components/app-layout/AppFooter.vue.mjs +4 -4
  22. package/es/components/app-layout/AppFooter.vue2.mjs +15 -12
  23. package/es/components/app-layout/AppHeader.vue.mjs +4 -4
  24. package/es/components/app-layout/AppHeader.vue2.mjs +81 -58
  25. package/es/components/app-layout/AppLayout.vue.mjs +4 -4
  26. package/es/components/app-layout/AppLayout.vue2.mjs +148 -112
  27. package/es/components/app-layout/AppPage.vue.mjs +4 -4
  28. package/es/components/app-layout/AppPage.vue2.mjs +254 -197
  29. package/es/components/app-layout/AppShell.vue.mjs +44 -42
  30. package/es/components/app-layout/AppShell.vue2.mjs +2 -2
  31. package/es/components/app-layout/AppSidebar.vue.mjs +4 -4
  32. package/es/components/app-layout/AppSidebar.vue2.mjs +76 -59
  33. package/es/components/app-layout/AppTheme.vue.mjs +4 -4
  34. package/es/components/app-layout/AppTheme.vue2.mjs +69 -57
  35. package/es/components/app-layout/app-page-geometry.mjs +44 -42
  36. package/es/components/app-layout/keep-alive.mjs +27 -19
  37. package/es/components/app-layout/viewport.mjs +4 -3
  38. package/es/components/data-view/DataListView.vue.mjs +4 -4
  39. package/es/components/data-view/DataListView.vue2.mjs +133 -93
  40. package/es/components/data-view/DataListViewItem.vue.mjs +4 -4
  41. package/es/components/data-view/DataListViewItem.vue2.mjs +11 -9
  42. package/es/components/data-view/utils.mjs +36 -34
  43. package/es/components/display/ActionBtn.vue.mjs +94 -71
  44. package/es/components/display/ActionBtn.vue2.mjs +2 -2
  45. package/es/components/display/ActionBtnGroup.vue.mjs +54 -48
  46. package/es/components/display/ActionBtnGroup.vue2.mjs +2 -2
  47. package/es/components/display/ActionConfirm.vue.mjs +4 -4
  48. package/es/components/display/ActionConfirm.vue2.mjs +116 -92
  49. package/es/components/display/BooleanTag.vue.mjs +24 -18
  50. package/es/components/display/BooleanTag.vue2.mjs +2 -2
  51. package/es/components/display/HeightProvider.vue.mjs +37 -27
  52. package/es/components/display/HeightProvider.vue2.mjs +2 -2
  53. package/es/components/display/TabsHeader.vue.mjs +4 -4
  54. package/es/components/display/TabsHeader.vue2.mjs +86 -57
  55. package/es/components/display/TabsMain.vue.mjs +156 -125
  56. package/es/components/display/TabsMain.vue2.mjs +2 -2
  57. package/es/components/display/TabsNaturalFlow.vue.mjs +15 -11
  58. package/es/components/display/TabsNaturalFlow.vue2.mjs +2 -2
  59. package/es/components/display/TabsRefineFlow.vue.mjs +55 -42
  60. package/es/components/display/TabsRefineFlow.vue2.mjs +2 -2
  61. package/es/components/display/TabsTile.vue.mjs +4 -4
  62. package/es/components/display/TabsTile.vue2.mjs +204 -146
  63. package/es/components/display/WatchSize.vue.mjs +50 -30
  64. package/es/components/display/WatchSize.vue2.mjs +2 -2
  65. package/es/components/display/use-tabs-query-sync.mjs +21 -17
  66. package/es/components/form/FormItem.vue.mjs +4 -4
  67. package/es/components/form/FormItem.vue2.mjs +183 -121
  68. package/es/components/form/FormItemNestForm.vue.mjs +4 -4
  69. package/es/components/form/FormItemNestForm.vue2.mjs +38 -34
  70. package/es/components/form/FormItemNestFormList.vue.mjs +4 -4
  71. package/es/components/form/FormItemNestFormList.vue2.mjs +135 -106
  72. package/es/components/form/FormMain.vue.mjs +4 -4
  73. package/es/components/form/FormMain.vue2.mjs +226 -139
  74. package/es/components/form/FormRadioGroup.vue.mjs +67 -52
  75. package/es/components/form/FormRadioGroup.vue2.mjs +2 -2
  76. package/es/components/form/FormSearch.vue.mjs +4 -4
  77. package/es/components/form/FormSearch.vue2.mjs +194 -156
  78. package/es/components/form/FormSelect.vue.mjs +69 -42
  79. package/es/components/form/FormSelect.vue2.mjs +2 -2
  80. package/es/components/form/FormSubmitBtn.vue.mjs +30 -25
  81. package/es/components/form/FormSubmitBtn.vue2.mjs +2 -2
  82. package/es/components/form/FormSubmitPanel.vue.mjs +4 -4
  83. package/es/components/form/FormSubmitPanel.vue2.mjs +129 -96
  84. package/es/components/form/FormTree.vue.mjs +19 -16
  85. package/es/components/form/FormTree.vue2.mjs +2 -2
  86. package/es/components/form/FormVerifyCode.vue.mjs +58 -41
  87. package/es/components/form/FormVerifyCode.vue2.mjs +2 -2
  88. package/es/components/form/FormVerifyImage.vue.mjs +4 -4
  89. package/es/components/form/FormVerifyImage.vue2.mjs +62 -40
  90. package/es/components/form/form-search-utils.mjs +83 -52
  91. package/es/components/form/nest-form-item-list.mjs +63 -55
  92. package/es/components/form/nest-form-item.mjs +30 -30
  93. package/es/components/form/nest-registry.mjs +4 -4
  94. package/es/components/form/use-form-submit.mjs +18 -15
  95. package/es/components/form/use-layout-by-container.mjs +23 -15
  96. package/es/components/form/use-nest-form-list.mjs +19 -16
  97. package/es/components/form/use-nest-form.mjs +37 -28
  98. package/es/components/form/use-nest-layout-scale.mjs +11 -10
  99. package/es/components/form/utils.mjs +233 -145
  100. package/es/components/list-page/ListPage.vue.mjs +4 -4
  101. package/es/components/list-page/ListPage.vue2.mjs +313 -207
  102. package/es/components/list-page/use-sticky.mjs +45 -33
  103. package/es/components/menu/MenuItemSub.vue.mjs +47 -43
  104. package/es/components/menu/MenuItemSub.vue2.mjs +2 -2
  105. package/es/components/menu/MenuTree.vue.mjs +84 -61
  106. package/es/components/menu/MenuTree.vue2.mjs +2 -2
  107. package/es/components/misc/AutoRefresh.vue.mjs +4 -4
  108. package/es/components/misc/AutoRefresh.vue2.mjs +78 -53
  109. package/es/components/misc/AutoRefreshGroup.vue.mjs +4 -4
  110. package/es/components/misc/AutoRefreshGroup.vue2.mjs +54 -51
  111. package/es/components/misc/SelectModule.vue.mjs +54 -45
  112. package/es/components/misc/SelectModule.vue2.mjs +2 -2
  113. package/es/components/misc/TriggerAutoImport.vue.mjs +7 -5
  114. package/es/components/misc/TriggerAutoImport.vue2.mjs +2 -2
  115. package/es/components/modal/ModalConfirm.vue.mjs +4 -4
  116. package/es/components/modal/ModalConfirm.vue2.mjs +160 -125
  117. package/es/components/modal/ModalDetail.vue.mjs +50 -39
  118. package/es/components/modal/ModalDetail.vue2.mjs +2 -2
  119. package/es/components/modal/ModalForm.vue.mjs +63 -52
  120. package/es/components/modal/ModalForm.vue2.mjs +2 -2
  121. package/es/components/modal/ModalPorter.vue.mjs +51 -36
  122. package/es/components/modal/ModalPorter.vue2.mjs +2 -2
  123. package/es/components/modal/ModalShelf.vue.mjs +38 -28
  124. package/es/components/modal/ModalShelf.vue2.mjs +2 -2
  125. package/es/components/modal/modal-shelf-core.mjs +52 -36
  126. package/es/components/modal/modal-shelf-hierarchy.mjs +11 -9
  127. package/es/components/panel/PanelEditSwitch.vue.mjs +4 -4
  128. package/es/components/panel/PanelEditSwitch.vue2.mjs +88 -66
  129. package/es/components/panel/PanelItem.vue.mjs +4 -4
  130. package/es/components/panel/PanelItem.vue2.mjs +103 -77
  131. package/es/components/panel/PanelItemNestForm.vue.mjs +4 -4
  132. package/es/components/panel/PanelItemNestForm.vue2.mjs +61 -52
  133. package/es/components/panel/PanelItemNestPanel.vue.mjs +22 -20
  134. package/es/components/panel/PanelItemNestPanel.vue2.mjs +2 -2
  135. package/es/components/panel/PanelMain.vue.mjs +4 -4
  136. package/es/components/panel/PanelMain.vue2.mjs +92 -74
  137. package/es/components/panel/nest-panel-form.mjs +44 -38
  138. package/es/components/panel/nest-panel-item.mjs +18 -17
  139. package/es/components/slot-layout/SlotLayoutFlowAside.vue.mjs +4 -4
  140. package/es/components/slot-layout/SlotLayoutFlowAside.vue2.mjs +55 -42
  141. package/es/components/slot-layout/SlotLayoutTemplate.vue.mjs +11 -9
  142. package/es/components/slot-layout/SlotLayoutTemplate.vue2.mjs +2 -2
  143. package/es/components/table/TableMain.vue.mjs +4 -4
  144. package/es/components/table/TableMain.vue2.mjs +378 -275
  145. package/es/components/table/TableSkeleton.vue.mjs +4 -4
  146. package/es/components/table/TableSkeleton.vue2.mjs +95 -74
  147. package/es/components/table/TableToolbar.vue.mjs +4 -4
  148. package/es/components/table/TableToolbar.vue2.mjs +170 -154
  149. package/es/components/table/ToolbarButtons.vue.mjs +12 -10
  150. package/es/components/table/ToolbarButtons.vue2.mjs +2 -2
  151. package/es/components/table/constants.mjs +4 -3
  152. package/es/components/table/use-fill-height.mjs +12 -10
  153. package/es/components/table/use-table-skeleton.mjs +19 -15
  154. package/es/config/list-model.mjs +2 -2
  155. package/es/config/route.mjs +4 -3
  156. package/es/helpers/form.mjs +35 -25
  157. package/es/helpers/list-helper.mjs +59 -44
  158. package/es/hooks/activated.mjs +49 -33
  159. package/es/hooks/feel-size.mjs +39 -23
  160. package/es/hooks/menus-dispatch.mjs +68 -35
  161. package/es/hooks/timeout.mjs +29 -14
  162. package/es/hooks/use-breakpoint.mjs +35 -23
  163. package/es/hooks/use-channel-viewport-height.mjs +30 -20
  164. package/es/hooks/use-custom-breakpoint.mjs +48 -31
  165. package/es/hooks/use-observe-size.mjs +37 -20
  166. package/es/hooks/use-theme-apply.mjs +175 -124
  167. package/es/hooks/use-viewport-apply.mjs +39 -27
  168. package/es/index.mjs +239 -239
  169. package/es/inject/key.mjs +52 -41
  170. package/es/injectInfo.json.mjs +2 -2
  171. package/es/router/group-redirect.mjs +22 -16
  172. package/es/router/guard/index.mjs +26 -21
  173. package/es/router/guard/login.mjs +4 -2
  174. package/es/router/guard/permission.mjs +4 -2
  175. package/es/store/app.mjs +163 -123
  176. package/es/store/router-permission.mjs +75 -46
  177. package/es/store/user.mjs +100 -71
  178. package/es/style.css +769 -1
  179. package/es/utils/dom.mjs +20 -16
  180. package/es/utils/export.mjs +34 -18
  181. package/es/utils/id.mjs +5 -3
  182. package/es/utils/router.mjs +21 -14
  183. package/es/utils/theme-scale.mjs +50 -35
  184. package/es/utils/time.mjs +20 -14
  185. package/package.json +4 -3
  186. package/src/bridge/README.md +5 -0
  187. package/src/bridge/docs/README.md +72 -0
  188. package/src/components/README.md +84 -0
  189. package/src/components/app-layout/README.md +46 -0
  190. package/src/components/app-layout/docs/README-AppAside.md +69 -0
  191. package/src/components/app-layout/docs/README-AppBody.md +81 -0
  192. package/src/components/app-layout/docs/README-AppBreadcrumb.md +71 -0
  193. package/src/components/app-layout/docs/README-AppFooter.md +41 -0
  194. package/src/components/app-layout/docs/README-AppHeader.md +73 -0
  195. package/src/components/app-layout/docs/README-AppLayout.md +83 -0
  196. package/src/components/app-layout/docs/README-AppPage.md +80 -0
  197. package/src/components/app-layout/docs/README-AppSidebar.md +70 -0
  198. package/src/components/app-layout/docs/README-AppTheme.md +66 -0
  199. package/src/components/data-view/README.md +19 -0
  200. package/src/components/data-view/docs/README-DataListView.md +114 -0
  201. package/src/components/display/README.md +23 -0
  202. package/src/components/display/docs/README-ActionBtn.md +84 -0
  203. package/src/components/display/docs/README-ActionBtnGroup.md +96 -0
  204. package/src/components/display/docs/README-ActionConfirm.md +77 -0
  205. package/src/components/display/docs/README-BooleanTag.md +76 -0
  206. package/src/components/display/docs/README-HeightProvider.md +74 -0
  207. package/src/components/display/docs/README-TabsMain.md +99 -0
  208. package/src/components/display/docs/README-WatchSize.md +70 -0
  209. package/src/components/form/README.md +24 -0
  210. package/src/components/form/docs/README-FormItemNestForm.md +86 -0
  211. package/src/components/form/docs/README-FormItemNestFormList.md +93 -0
  212. package/src/components/form/docs/README-FormMain.md +101 -0
  213. package/src/components/form/docs/README-FormSearch.md +89 -0
  214. package/src/components/form/docs/README-FormSubmitBtn.md +72 -0
  215. package/src/components/form/docs/README-FormSubmitPanel.md +97 -0
  216. package/src/components/list-page/README.md +16 -0
  217. package/src/components/list-page/docs/README-ListPage.md +136 -0
  218. package/src/components/menu/README.md +19 -0
  219. package/src/components/menu/docs/README-MenuItemSub.md +53 -0
  220. package/src/components/menu/docs/README-MenuTree.md +76 -0
  221. package/src/components/misc/README.md +21 -0
  222. package/src/components/misc/docs/README-AutoRefresh.md +74 -0
  223. package/src/components/misc/docs/README-AutoRefreshGroup.md +74 -0
  224. package/src/components/misc/docs/README-SelectModule.md +72 -0
  225. package/src/components/modal/README.md +21 -0
  226. package/src/components/modal/docs/README-ModalConfirm.md +105 -0
  227. package/src/components/modal/docs/README-ModalDetail.md +103 -0
  228. package/src/components/modal/docs/README-ModalForm.md +97 -0
  229. package/src/components/modal/docs/README-ModalPorter.md +92 -0
  230. package/src/components/modal/docs/README-ModalShelf.md +115 -0
  231. package/src/components/panel/README.md +19 -0
  232. package/src/components/panel/docs/README-PanelMain.md +149 -0
  233. package/src/components/slot-layout/README.md +17 -0
  234. package/src/components/slot-layout/docs/README-SlotLayoutFlowAside.md +83 -0
  235. package/src/components/slot-layout/docs/README-SlotLayoutTemplate.md +73 -0
  236. package/src/components/table/README.md +17 -0
  237. package/src/components/table/docs/README-TableMain.md +140 -0
  238. package/src/hooks/README.md +5 -0
  239. package/src/hooks/docs/README.md +49 -0
  240. package/types/bridge/config-hook.d.ts +68 -0
  241. package/types/bridge/index.d.ts +411 -0
  242. package/types/bridge/layout.d.ts +40 -0
  243. package/types/bridge/plugin.d.ts +18 -0
  244. package/types/bridge/route.d.ts +20 -1
  245. package/types/bridge/state.d.ts +14 -0
  246. package/types/bridge/storage.d.ts +9 -0
  247. package/types/bridge/theme/index.d.ts +7 -0
  248. package/types/bridge/theme/persist.d.ts +12 -0
  249. package/types/bridge/theme/system-dark.d.ts +12 -0
  250. package/types/bridge/theme/types.d.ts +238 -0
  251. package/types/components/app-layout/AppAside.vue.d.ts +1 -0
  252. package/types/components/app-layout/AppCollapseToggle.vue.d.ts +3 -0
  253. package/types/components/app-layout/AppHeader.vue.d.ts +3 -0
  254. package/types/components/app-layout/AppLayout.vue.d.ts +12 -0
  255. package/types/components/app-layout/AppPage.vue.d.ts +17 -0
  256. package/types/components/app-layout/AppSidebar.vue.d.ts +2 -0
  257. package/types/components/app-layout/app-page-geometry.d.ts +48 -0
  258. package/types/components/app-layout/keep-alive.d.ts +17 -0
  259. package/types/components/app-layout/types.d.ts +125 -0
  260. package/types/components/app-layout/viewport.d.ts +28 -0
  261. package/types/components/data-view/DataListViewItem.vue.d.ts +8 -0
  262. package/types/components/data-view/index.d.ts +4 -0
  263. package/types/components/data-view/types.d.ts +42 -0
  264. package/types/components/data-view/utils.d.ts +3 -0
  265. package/types/components/display/TabsHeader.vue.d.ts +2 -0
  266. package/types/components/display/TabsMain.vue.d.ts +2 -0
  267. package/types/components/display/TabsRefineFlow.vue.d.ts +1 -0
  268. package/types/components/display/TabsTile.vue.d.ts +247 -12
  269. package/types/components/display/WatchSize.vue.d.ts +9 -0
  270. package/types/components/display/index.d.ts +37 -1
  271. package/types/components/display/types.d.ts +163 -0
  272. package/types/components/display/use-tabs-query-sync.d.ts +29 -0
  273. package/types/components/form/FormItemNestForm.vue.d.ts +5 -0
  274. package/types/components/form/FormItemNestFormList.vue.d.ts +17 -0
  275. package/types/components/form/FormVerifyCode.vue.d.ts +9 -0
  276. package/types/components/form/FormVerifyImage.vue.d.ts +1 -0
  277. package/types/components/form/form-search-utils.d.ts +34 -0
  278. package/types/components/form/nest-form-item-list.d.ts +28 -0
  279. package/types/components/form/nest-form-item.d.ts +21 -0
  280. package/types/components/form/nest-registry.d.ts +14 -0
  281. package/types/components/form/types.d.ts +208 -8
  282. package/types/components/form/use-form-submit.d.ts +13 -0
  283. package/types/components/form/use-layout-by-container.d.ts +23 -0
  284. package/types/components/form/use-nest-form-list.d.ts +13 -0
  285. package/types/components/form/use-nest-form.d.ts +15 -0
  286. package/types/components/form/use-nest-layout-scale.d.ts +12 -0
  287. package/types/components/form/utils.d.ts +56 -1
  288. package/types/components/list-page/ListPage.vue.d.ts +6 -0
  289. package/types/components/list-page/types.d.ts +50 -2
  290. package/types/components/list-page/use-sticky.d.ts +23 -0
  291. package/types/components/misc/index.d.ts +6 -1
  292. package/types/components/misc/types.d.ts +7 -0
  293. package/types/components/modal/ModalConfirm.vue.d.ts +29 -0
  294. package/types/components/modal/index.d.ts +7 -1
  295. package/types/components/modal/modal-shelf-core.d.ts +3 -0
  296. package/types/components/modal/modal-shelf-hierarchy.d.ts +4 -0
  297. package/types/components/modal/modal-shelf-types.d.ts +34 -0
  298. package/types/components/modal/types.d.ts +63 -2
  299. package/types/components/panel/PanelItemNestForm.vue.d.ts +6 -0
  300. package/types/components/panel/PanelItemNestPanel.vue.d.ts +5 -0
  301. package/types/components/panel/nest-panel-form.d.ts +21 -0
  302. package/types/components/panel/nest-panel-item.d.ts +14 -0
  303. package/types/components/panel/types.d.ts +52 -1
  304. package/types/components/slot-layout/SlotLayoutTemplate.vue.d.ts +21 -0
  305. package/types/components/slot-layout/types.d.ts +4 -0
  306. package/types/components/table/constants.d.ts +8 -0
  307. package/types/components/table/types.d.ts +140 -9
  308. package/types/components/table/use-fill-height.d.ts +14 -0
  309. package/types/components/table/use-table-skeleton.d.ts +16 -0
  310. package/types/config/list-model.d.ts +29 -0
  311. package/types/config/route.d.ts +2 -0
  312. package/types/helpers/form.d.ts +5 -0
  313. package/types/helpers/list-helper.d.ts +26 -0
  314. package/types/helpers/types.d.ts +11 -0
  315. package/types/hooks/activated.d.ts +23 -0
  316. package/types/hooks/feel-size.d.ts +2 -0
  317. package/types/hooks/menus-dispatch.d.ts +4 -0
  318. package/types/hooks/timeout.d.ts +4 -0
  319. package/types/hooks/use-channel-viewport-height.d.ts +8 -0
  320. package/types/hooks/use-custom-breakpoint.d.ts +19 -0
  321. package/types/hooks/use-observe-size.d.ts +29 -0
  322. package/types/hooks/use-theme-apply.d.ts +23 -0
  323. package/types/hooks/use-viewport-apply.d.ts +12 -0
  324. package/types/inject/key.d.ts +163 -0
  325. package/types/injectInfo.json.d.ts +1 -1
  326. package/types/router/group-redirect.d.ts +9 -0
  327. package/types/router/guard/index.d.ts +13 -0
  328. package/types/router/guard/login.d.ts +1 -0
  329. package/types/router/guard/permission.d.ts +1 -0
  330. package/types/router/guard/types.d.ts +3 -0
  331. package/types/store/app.d.ts +27 -0
  332. package/types/store/router-permission.d.ts +53 -0
  333. package/types/store/user.d.ts +24 -0
  334. package/types/types/dot-path.d.ts +8 -0
  335. package/types/types/route.d.ts +45 -0
  336. package/types/types/utility-types.d.ts +7 -0
  337. package/types/utils/dom.d.ts +22 -0
  338. package/types/utils/export.d.ts +16 -1
  339. package/types/utils/id.d.ts +1 -0
  340. package/types/utils/router.d.ts +2 -0
  341. package/types/utils/theme-scale.d.ts +31 -0
  342. package/types/utils/time.d.ts +1 -0
@@ -1,14 +1,16 @@
1
- import { computed as t } from "vue";
2
- const a = (l) => {
3
- const e = t(() => {
4
- if (!l.enabled()) return;
5
- const i = l.rawAvailableHeight();
6
- return i && i > 0 ? i : void 0;
7
- }), r = t(() => e.value !== void 0), n = t(
8
- () => e.value ? `${e.value}px` : ""
1
+ import { computed } from "vue";
2
+ const useFillHeight = (options) => {
3
+ const fillMinHeight = computed(() => {
4
+ if (!options.enabled()) return void 0;
5
+ const raw = options.rawAvailableHeight();
6
+ return raw && raw > 0 ? raw : void 0;
7
+ });
8
+ const fillActive = computed(() => fillMinHeight.value !== void 0);
9
+ const fillMinHeightCss = computed(
10
+ () => fillMinHeight.value ? `${fillMinHeight.value}px` : ""
9
11
  );
10
- return { fillActive: r, fillMinHeight: e, fillMinHeightCss: n };
12
+ return { fillActive, fillMinHeight, fillMinHeightCss };
11
13
  };
12
14
  export {
13
- a as useFillHeight
15
+ useFillHeight
14
16
  };
@@ -1,19 +1,23 @@
1
- import { computed as t } from "vue";
2
- const h = (e) => {
3
- const l = t(
4
- () => e.enabled() && e.loading() && e.dataLength() === 0
5
- ), o = t(
6
- () => e.isGrid() ? "grid" : "table"
7
- ), r = t(
8
- () => Math.min(Math.max(e.columnCount(), 1), 8)
9
- ), s = t(() => {
10
- const n = e.skeletonRows();
11
- if (n && n > 0) return n;
12
- const a = e.availableHeight();
13
- return a ? Math.min(Math.max(Math.floor((a - 44) / 48), 3), 8) : 5;
1
+ import { computed } from "vue";
2
+ const useTableSkeleton = (options) => {
3
+ const showSkeleton = computed(
4
+ () => options.enabled() && options.loading() && options.dataLength() === 0
5
+ );
6
+ const skeletonMode = computed(
7
+ () => options.isGrid() ? "grid" : "table"
8
+ );
9
+ const skeletonColumns = computed(
10
+ () => Math.min(Math.max(options.columnCount(), 1), 8)
11
+ );
12
+ const skeletonRowsFinal = computed(() => {
13
+ const explicit = options.skeletonRows();
14
+ if (explicit && explicit > 0) return explicit;
15
+ const h = options.availableHeight();
16
+ if (!h) return 5;
17
+ return Math.min(Math.max(Math.floor((h - 44) / 48), 3), 8);
14
18
  });
15
- return { showSkeleton: l, skeletonMode: o, skeletonColumns: r, skeletonRowsFinal: s };
19
+ return { showSkeleton, skeletonMode, skeletonColumns, skeletonRowsFinal };
16
20
  };
17
21
  export {
18
- h as useTableSkeleton
22
+ useTableSkeleton
19
23
  };
@@ -1,4 +1,4 @@
1
- const e = Object.freeze({
1
+ const APP_API_LIST_MODEL_KEY_CONFIG = Object.freeze({
2
2
  /** 当前页码 key */
3
3
  CURRENT_PAGE_KEY: "page.page",
4
4
  /** 每页条数 key */
@@ -9,5 +9,5 @@ const e = Object.freeze({
9
9
  LIST_KEY: "items"
10
10
  });
11
11
  export {
12
- e as APP_API_LIST_MODEL_KEY_CONFIG
12
+ APP_API_LIST_MODEL_KEY_CONFIG
13
13
  };
@@ -1,5 +1,6 @@
1
- const e = 1, a = "_tab";
1
+ const ROUTE_MODULE_LEVEL = 1;
2
+ const TabsMainReplaceQueryKey = "_tab";
2
3
  export {
3
- e as ROUTE_MODULE_LEVEL,
4
- a as TabsMainReplaceQueryKey
4
+ ROUTE_MODULE_LEVEL,
5
+ TabsMainReplaceQueryKey
5
6
  };
@@ -1,32 +1,42 @@
1
- import { ElInput as e, ElInputNumber as m, ElSelect as n } from "element-plus";
2
- import p from "../components/form/FormSelect.vue.mjs";
3
- import s from "../components/form/FormSearch.vue.mjs";
4
- import i from "../components/form/FormVerifyImage.vue.mjs";
5
- import f from "../components/form/FormVerifyCode.vue.mjs";
6
- import { setInputComponent as _, setSelectComponent as a } from "../components/form/utils.mjs";
7
- const S = {
1
+ import { ElInput, ElInputNumber, ElSelect } from "element-plus";
2
+ import _sfc_main$1 from "../components/form/FormSelect.vue.mjs";
3
+ import FormSearch from "../components/form/FormSearch.vue.mjs";
4
+ import FormVerifyImage from "../components/form/FormVerifyImage.vue.mjs";
5
+ import _sfc_main from "../components/form/FormVerifyCode.vue.mjs";
6
+ import { setInputComponent, setSelectComponent } from "../components/form/utils.mjs";
7
+ const passwordRule = {
8
8
  message: "限定20个以内字母、数字",
9
9
  pattern: /^[0-9a-zA-Z]{0,20}$/,
10
10
  trigger: "blur"
11
- }, F = (o) => ({
12
- validator: (l, t, r) => {
13
- t !== o() ? r("两次输入密码不一致!") : r();
14
- },
15
- trigger: "blur"
16
- }), I = `SELECT_ALL_${Date.now().toString(
11
+ };
12
+ const getConfirmPasswordRule = (getPassword) => {
13
+ return {
14
+ validator: (_rule, value, callback) => {
15
+ if (value !== getPassword()) {
16
+ callback("两次输入密码不一致!");
17
+ } else {
18
+ callback();
19
+ }
20
+ },
21
+ trigger: "blur"
22
+ };
23
+ };
24
+ const FORM_CONFIG_SELECT_ALL_VALUE = `SELECT_ALL_${Date.now().toString(
17
25
  36
18
- )}`, A = () => {
19
- _([
20
- e,
21
- m,
22
- s,
23
- i,
24
- f
25
- ]), a([n, p]);
26
+ )}`;
27
+ const setFormComponentType = () => {
28
+ setInputComponent([
29
+ ElInput,
30
+ ElInputNumber,
31
+ FormSearch,
32
+ FormVerifyImage,
33
+ _sfc_main
34
+ ]);
35
+ setSelectComponent([ElSelect, _sfc_main$1]);
26
36
  };
27
37
  export {
28
- I as FORM_CONFIG_SELECT_ALL_VALUE,
29
- F as getConfirmPasswordRule,
30
- S as passwordRule,
31
- A as setFormComponentType
38
+ FORM_CONFIG_SELECT_ALL_VALUE,
39
+ getConfirmPasswordRule,
40
+ passwordRule,
41
+ setFormComponentType
32
42
  };
@@ -1,62 +1,77 @@
1
- async function A(r, n, e) {
2
- var o;
3
- const i = (e == null ? void 0 : e.pageSize) ?? 200, a = (e == null ? void 0 : e.limit) ?? 1e4;
4
- if (i < 1 || i > 1e3)
1
+ const DEFAULT_PAGE_SIZE = 200;
2
+ const DEFAULT_LIMIT = 1e4;
3
+ async function fetchListAll(api, baseParams, opts) {
4
+ var _a;
5
+ const pageSize = (opts == null ? void 0 : opts.pageSize) ?? DEFAULT_PAGE_SIZE;
6
+ const limit = (opts == null ? void 0 : opts.limit) ?? DEFAULT_LIMIT;
7
+ if (pageSize < 1 || pageSize > 1e3) {
5
8
  throw new Error(
6
- `fetchListAll: pageSize 必须在 [1, 1000] 范围内(实际 ${i})`
9
+ `fetchListAll: pageSize 必须在 [1, 1000] 范围内(实际 ${pageSize})`
7
10
  );
8
- const t = [];
9
- let c = 1;
10
- for (; ; ) {
11
- const s = {
12
- ...n,
13
- page: { page: c, pageSize: i }
14
- }, l = await r(s), g = l.items, p = ((o = l.page) == null ? void 0 : o.totalRecord) ?? 0;
15
- if (t.push(...g), t.length >= a || g.length < i || t.length >= p) break;
16
- c += 1;
17
11
  }
18
- return t.slice(0, a);
12
+ const all = [];
13
+ let page = 1;
14
+ while (true) {
15
+ const params = {
16
+ ...baseParams,
17
+ page: { page, pageSize }
18
+ };
19
+ const resp = await api(params);
20
+ const items = resp.items;
21
+ const totalRecord = ((_a = resp.page) == null ? void 0 : _a.totalRecord) ?? 0;
22
+ all.push(...items);
23
+ if (all.length >= limit) break;
24
+ if (items.length < pageSize) break;
25
+ if (all.length >= totalRecord) break;
26
+ page += 1;
27
+ }
28
+ return all.slice(0, limit);
19
29
  }
20
- function f(r) {
21
- return async (n) => {
22
- const e = n.page;
23
- if (!e)
30
+ function createListApi(source) {
31
+ return async (params) => {
32
+ const page = params.page;
33
+ if (!page) {
24
34
  throw new Error("createListApi: params.page 必填(含 page / pageSize)");
25
- const { page: i, pageSize: a } = e;
26
- if (!a || a <= 0)
35
+ }
36
+ const { page: pageNum, pageSize } = page;
37
+ if (!pageSize || pageSize <= 0) {
27
38
  throw new Error("createListApi: pageSize 必须 > 0");
28
- let t;
29
- if (Array.isArray(r))
30
- t = r;
31
- else {
32
- const s = r();
33
- if (s instanceof Promise) {
34
- const l = await s;
35
- if (!Array.isArray(l))
39
+ }
40
+ let list;
41
+ if (Array.isArray(source)) {
42
+ list = source;
43
+ } else {
44
+ const r = source();
45
+ if (r instanceof Promise) {
46
+ const awaited = await r;
47
+ if (!Array.isArray(awaited)) {
36
48
  throw new Error("createListApi: 异步 source 返回值必须为数组");
37
- t = l;
38
- } else
39
- t = s;
49
+ }
50
+ list = awaited;
51
+ } else {
52
+ list = r;
53
+ }
40
54
  }
41
- const c = (i - 1) * a, o = c + a;
55
+ const start = (pageNum - 1) * pageSize;
56
+ const end = start + pageSize;
42
57
  return {
43
- items: t.slice(c, o),
58
+ items: list.slice(start, end),
44
59
  page: {
45
- totalRecord: t.length,
46
- pageSize: a,
47
- totalPage: Math.ceil(t.length / a)
60
+ totalRecord: list.length,
61
+ pageSize,
62
+ totalPage: Math.ceil(list.length / pageSize)
48
63
  }
49
64
  };
50
65
  };
51
66
  }
52
- function h(r, n) {
53
- return r({
54
- ...n,
67
+ function countAll(api, baseParams) {
68
+ return api({
69
+ ...baseParams,
55
70
  page: { page: 1, pageSize: 1 }
56
- }).then((e) => e.page.totalRecord);
71
+ }).then((r) => r.page.totalRecord);
57
72
  }
58
73
  export {
59
- h as countAll,
60
- f as createListApi,
61
- A as fetchListAll
74
+ countAll,
75
+ createListApi,
76
+ fetchListAll
62
77
  };
@@ -1,48 +1,64 @@
1
- import { ref as n, computed as o, readonly as r, onMounted as u, onActivated as A, onDeactivated as g, onBeforeUnmount as m, watch as v } from "vue";
2
- const s = (t) => {
3
- const e = n({
4
- isActivated: !1,
1
+ import { ref, computed, readonly, onMounted, onActivated, onDeactivated, onBeforeUnmount, watch } from "vue";
2
+ const useActivated = (watchFn) => {
3
+ const activatedInfo = ref({
4
+ isActivated: false,
5
5
  triggerType: "mounted"
6
- }), i = o(() => e.value.isActivated), a = o(() => r(e.value)), d = (c) => {
7
- e.value = c, t == null || t(c);
6
+ });
7
+ const isActivated = computed(() => activatedInfo.value.isActivated);
8
+ const activatedInfoReadonly = computed(() => readonly(activatedInfo.value));
9
+ const changeActivatedInfo = (info) => {
10
+ activatedInfo.value = info;
11
+ watchFn == null ? void 0 : watchFn(info);
8
12
  };
9
- return u(() => {
10
- d({ isActivated: !0, triggerType: "mounted" }), A(() => {
11
- d({ isActivated: !0, triggerType: "activated" });
13
+ onMounted(() => {
14
+ changeActivatedInfo({ isActivated: true, triggerType: "mounted" });
15
+ onActivated(() => {
16
+ changeActivatedInfo({ isActivated: true, triggerType: "activated" });
12
17
  });
13
- }), g(() => {
14
- d({ isActivated: !1, triggerType: "deactivated" });
15
- }), m(() => {
16
- d({ isActivated: !1, triggerType: "unmounted" });
17
- }), {
18
- isActivated: i,
19
- activatedInfo: a
18
+ });
19
+ onDeactivated(() => {
20
+ changeActivatedInfo({ isActivated: false, triggerType: "deactivated" });
21
+ });
22
+ onBeforeUnmount(() => {
23
+ changeActivatedInfo({ isActivated: false, triggerType: "unmounted" });
24
+ });
25
+ return {
26
+ isActivated,
27
+ activatedInfo: activatedInfoReadonly
20
28
  };
21
- }, l = (t) => {
22
- const { activatedInfo: e } = s();
23
- v(
24
- e,
25
- (i) => {
26
- i.isActivated && t(i);
29
+ };
30
+ const useActivatedExec = (callback) => {
31
+ const { activatedInfo } = useActivated();
32
+ watch(
33
+ activatedInfo,
34
+ (info) => {
35
+ if (info.isActivated) {
36
+ callback(info);
37
+ }
27
38
  },
28
39
  {
29
- immediate: !0
40
+ immediate: true
30
41
  }
31
42
  );
32
- }, p = (t, e) => {
33
- const { activatedInfo: i } = s();
34
- v(
35
- i,
36
- (a) => {
37
- a.isActivated ? t(a) : e(a);
43
+ };
44
+ const useActivatedEvent = (bind, unbind) => {
45
+ const { activatedInfo } = useActivated();
46
+ watch(
47
+ activatedInfo,
48
+ (info) => {
49
+ if (info.isActivated) {
50
+ bind(info);
51
+ } else {
52
+ unbind(info);
53
+ }
38
54
  },
39
55
  {
40
- immediate: !0
56
+ immediate: true
41
57
  }
42
58
  );
43
59
  };
44
60
  export {
45
- s as useActivated,
46
- p as useActivatedEvent,
47
- l as useActivatedExec
61
+ useActivated,
62
+ useActivatedEvent,
63
+ useActivatedExec
48
64
  };
@@ -1,30 +1,46 @@
1
- import { shallowRef as c, ref as f, onBeforeMount as a, computed as h } from "vue";
2
- const w = () => {
3
- const t = c(), o = f(), n = new ResizeObserver((e) => {
4
- for (const u of e) {
5
- const { target: v, contentRect: i } = u;
6
- v === t.value && (o.value = {
7
- width: i.width,
8
- height: i.height
9
- });
1
+ import { shallowRef, ref, onBeforeMount, computed } from "vue";
2
+ const useFeelSize = () => {
3
+ const el = shallowRef();
4
+ const sizeInfo = ref();
5
+ const resizeObserver = new ResizeObserver((entries) => {
6
+ for (const entry of entries) {
7
+ const { target, contentRect } = entry;
8
+ if (target === el.value) {
9
+ sizeInfo.value = {
10
+ width: contentRect.width,
11
+ height: contentRect.height
12
+ };
13
+ }
10
14
  }
11
- }), s = () => {
12
- t.value && (n.unobserve(t.value), t.value = void 0, o.value = void 0);
13
- }, r = (e) => {
14
- e !== t.value && (s(), n.observe(e), t.value = e, o.value = {
15
- width: e.offsetWidth,
16
- height: e.offsetHeight
17
- });
15
+ });
16
+ const unwatchDom = () => {
17
+ if (el.value) {
18
+ resizeObserver.unobserve(el.value);
19
+ el.value = void 0;
20
+ sizeInfo.value = void 0;
21
+ }
22
+ };
23
+ const watchDom = (dom) => {
24
+ if (dom === el.value) return;
25
+ unwatchDom();
26
+ resizeObserver.observe(dom);
27
+ el.value = dom;
28
+ sizeInfo.value = {
29
+ width: dom.offsetWidth,
30
+ height: dom.offsetHeight
31
+ };
18
32
  };
19
- return a(() => {
20
- s(), n.disconnect();
21
- }), {
22
- unwatchDom: s,
23
- watchDom: r,
33
+ onBeforeMount(() => {
34
+ unwatchDom();
35
+ resizeObserver.disconnect();
36
+ });
37
+ return {
38
+ unwatchDom,
39
+ watchDom,
24
40
  /** 元素尺寸信息只读属性 */
25
- sizeInfo: h(() => o.value)
41
+ sizeInfo: computed(() => sizeInfo.value)
26
42
  };
27
43
  };
28
44
  export {
29
- w as useFeelSize
45
+ useFeelSize
30
46
  };
@@ -1,47 +1,80 @@
1
- import { computed as t } from "vue";
2
- import { useRoute as F } from "vue-router";
3
- import { ROUTE_MODULE_LEVEL as c } from "../config/route.mjs";
4
- const O = ({
5
- getMenus: v,
6
- getMenuFlatList: d,
7
- getExtractLevel1ToHeader: h
1
+ import { computed } from "vue";
2
+ import { useRoute } from "vue-router";
3
+ import { ROUTE_MODULE_LEVEL } from "../config/route.mjs";
4
+ const useMenusDataDispatch = ({
5
+ getMenus,
6
+ getMenuFlatList,
7
+ getExtractLevel1ToHeader
8
8
  }) => {
9
- const u = t(v), M = t(d), n = t(h), o = F(), r = t(() => M.value.find((e) => e.path === o.path)), f = t(
10
- () => r.value && i(r.value, !0)
11
- ), a = t(() => {
12
- if (!r.value) {
9
+ const menus = computed(getMenus);
10
+ const menuFlatList = computed(getMenuFlatList);
11
+ const extractLevel1ToHeader = computed(getExtractLevel1ToHeader);
12
+ const route = useRoute();
13
+ const activeMenu = computed(() => {
14
+ return menuFlatList.value.find((item) => {
15
+ return item.path === route.path;
16
+ });
17
+ });
18
+ const needRedirectToFirstChildMenu = computed(
19
+ () => activeMenu.value && getCanRedirectFirstChildMenu(activeMenu.value, true)
20
+ );
21
+ const activeModulePath = computed(() => {
22
+ if (!activeMenu.value) {
13
23
  console.warn(
14
- `当前 ${o.path} 未找到聚焦的菜单 可能路由配置不展示菜单`
24
+ `当前 ${route.path} 未找到聚焦的菜单 可能路由配置不展示菜单`
15
25
  );
16
26
  return;
17
27
  }
18
- return r.value.routeLevel === c ? r.value.path : r.value.parentPathList[0];
19
- }), l = t(() => a.value ? u.value.find((e) => e.path === a.value) : void 0), p = t(() => {
20
- var e;
21
- return (e = l.value) == null ? void 0 : e.children;
22
- }), L = t(() => n.value ? p.value || [] : u.value), m = t(() => u.value.filter((e) => e.routeLevel === c)), C = t(
23
- () => m.value.map((e) => ({
24
- ...e,
25
- // 避免 展示子菜单
26
- children: []
27
- }))
28
- ), R = t(() => n.value ? C.value : []), i = (e, E) => {
29
- if (e.redirectToFirstChildRoute) {
30
- const s = e.children[0];
31
- if (s)
32
- return i(s, !1);
28
+ if (activeMenu.value.routeLevel === ROUTE_MODULE_LEVEL) {
29
+ return activeMenu.value.path;
30
+ } else {
31
+ return activeMenu.value.parentPathList[0];
32
+ }
33
+ });
34
+ const activeModuleMenu = computed(() => {
35
+ return activeModulePath.value ? menus.value.find((item) => item.path === activeModulePath.value) : void 0;
36
+ });
37
+ const activeModuleMenuChildrenMenu = computed(() => {
38
+ var _a;
39
+ return (_a = activeModuleMenu.value) == null ? void 0 : _a.children;
40
+ });
41
+ const sidebarMenus = computed(() => {
42
+ return extractLevel1ToHeader.value ? activeModuleMenuChildrenMenu.value || [] : menus.value;
43
+ });
44
+ const routeModuleLevelList = computed(() => {
45
+ return menus.value.filter((item) => item.routeLevel === ROUTE_MODULE_LEVEL);
46
+ });
47
+ const routeModuleLevel1ListNoChildren = computed(
48
+ () => routeModuleLevelList.value.map((item) => {
49
+ return {
50
+ ...item,
51
+ // 避免 展示子菜单
52
+ children: []
53
+ };
54
+ })
55
+ );
56
+ const headerMenus = computed(() => {
57
+ return extractLevel1ToHeader.value ? routeModuleLevel1ListNoChildren.value : [];
58
+ });
59
+ const getCanRedirectFirstChildMenu = (menu, isInitCall) => {
60
+ if (menu.redirectToFirstChildRoute) {
61
+ const firstChild = menu.children[0];
62
+ if (firstChild) {
63
+ return getCanRedirectFirstChildMenu(firstChild, false);
64
+ }
65
+ }
66
+ if (!isInitCall) {
67
+ return menu;
33
68
  }
34
- if (!E)
35
- return e;
36
69
  };
37
70
  return {
38
- sidebarMenus: L,
39
- headerMenus: R,
40
- activeMenu: r,
41
- activeModuleMenu: l,
42
- needRedirectToFirstChildMenu: f
71
+ sidebarMenus,
72
+ headerMenus,
73
+ activeMenu,
74
+ activeModuleMenu,
75
+ needRedirectToFirstChildMenu
43
76
  };
44
77
  };
45
78
  export {
46
- O as useMenusDataDispatch
79
+ useMenusDataDispatch
47
80
  };
@@ -1,21 +1,36 @@
1
- import { ref as c, onBeforeUnmount as n, watch as s } from "vue";
2
- import { useActivated as v } from "./activated.mjs";
3
- const l = (o = !0) => {
4
- const { isActivated: r } = v(), e = c(void 0), t = () => {
5
- e.value !== null && e.value !== void 0 && (clearTimeout(e.value), e.value = void 0);
6
- }, u = (i, m) => {
7
- t(), e.value = setTimeout(i, m);
1
+ import { ref, onBeforeUnmount, watch } from "vue";
2
+ import { useActivated } from "./activated.mjs";
3
+ const useTimeout = (autoClear = true) => {
4
+ const { isActivated } = useActivated();
5
+ const timer = ref(void 0);
6
+ const clearTimer = () => {
7
+ if (timer.value !== null && timer.value !== void 0) {
8
+ clearTimeout(timer.value);
9
+ timer.value = void 0;
10
+ }
11
+ };
12
+ const setTimer = (handler, timeout) => {
13
+ clearTimer();
14
+ timer.value = setTimeout(handler, timeout);
8
15
  };
9
- return o && n(t), s(
10
- r,
11
- (i) => {
12
- i || o && t();
16
+ if (autoClear) {
17
+ onBeforeUnmount(clearTimer);
18
+ }
19
+ watch(
20
+ isActivated,
21
+ (n) => {
22
+ if (!n) {
23
+ if (autoClear) {
24
+ clearTimer();
25
+ }
26
+ }
13
27
  },
14
28
  {
15
- immediate: !0
29
+ immediate: true
16
30
  }
17
- ), [u, t];
31
+ );
32
+ return [setTimer, clearTimer];
18
33
  };
19
34
  export {
20
- l as useTimeout
35
+ useTimeout
21
36
  };