@done-coding/admin-core 0.17.1-alpha.0 → 0.18.1-alpha.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,11 +1,12 @@
1
- import { defineComponent as w, computed as m, ref as B, watch as R, openBlock as s, createElementBlock as p, normalizeStyle as A, Fragment as F, renderList as z, createBlock as E, withCtx as K, renderSlot as S, createVNode as O, unref as j, markRaw as q, h as c } from "vue";
2
- import { ElEmpty as I } from "element-plus";
3
- import M from "./DataListViewItem.vue.mjs";
4
- import { createDataListViewInstance as N } from "./utils.mjs";
5
- const P = {
1
+ import { defineComponent, computed, ref, watch, openBlock, createElementBlock, normalizeStyle, Fragment, renderList, createBlock, withCtx, renderSlot, createVNode, unref, markRaw, h } from "vue";
2
+ import { ElEmpty } from "element-plus";
3
+ import DataListViewItem from "./DataListViewItem.vue.mjs";
4
+ import { createDataListViewInstance } from "./utils.mjs";
5
+ const _hoisted_1 = {
6
6
  key: 1,
7
7
  class: "data-list-view-empty"
8
- }, T = /* @__PURE__ */ w({
8
+ };
9
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
10
  __name: "DataListView",
10
11
  props: {
11
12
  data: {},
@@ -13,119 +14,158 @@ const P = {
13
14
  columns: {},
14
15
  maxHeight: {},
15
16
  minHeight: {},
16
- selectable: { type: Boolean, default: !1 },
17
+ selectable: { type: Boolean, default: false },
17
18
  getRenderCtxParams: {}
18
19
  },
19
20
  emits: ["selectionChange"],
20
- setup(r, { expose: k, emit: C }) {
21
- const o = r, b = C, i = (e) => {
22
- const t = o.rowKey;
23
- return typeof t == "function" ? t(e) : String(e[t]);
24
- }, H = m(() => {
25
- const e = {};
26
- return o.maxHeight && (e.maxHeight = `${o.maxHeight}px`, e.overflowY = "auto"), o.minHeight && (e.minHeight = `${o.minHeight}px`), Object.keys(e).length ? e : void 0;
27
- }), l = B(/* @__PURE__ */ new Set()), V = m(() => l.value.size === o.data.length), f = (e) => o.selectable && l.value.has(i(e)), d = () => {
28
- b("selectionChange", g());
29
- }, g = () => o.selectable ? o.data.filter((e) => l.value.has(i(e))) : [], y = () => {
30
- l.value = /* @__PURE__ */ new Set(), d();
31
- }, $ = () => {
32
- if (!o.selectable) return;
33
- const e = !V.value;
34
- l.value = e ? new Set(o.data.map((t) => i(t))) : /* @__PURE__ */ new Set(), d();
35
- }, h = (e) => {
36
- if (!o.selectable) return;
37
- const t = i(e), n = new Set(l.value);
38
- n.has(t) ? n.delete(t) : n.add(t), l.value = n, d();
39
- }, D = (e) => q(
40
- w({
21
+ setup(__props, { expose: __expose, emit: __emit }) {
22
+ const props = __props;
23
+ const emits = __emit;
24
+ const keyOf = (row) => {
25
+ const rk = props.rowKey;
26
+ return typeof rk === "function" ? rk(row) : String(row[rk]);
27
+ };
28
+ const containerStyle = computed(() => {
29
+ const style = {};
30
+ if (props.maxHeight) {
31
+ style.maxHeight = `${props.maxHeight}px`;
32
+ style.overflowY = "auto";
33
+ }
34
+ if (props.minHeight) {
35
+ style.minHeight = `${props.minHeight}px`;
36
+ }
37
+ return Object.keys(style).length ? style : void 0;
38
+ });
39
+ const selectedKeys = ref(/* @__PURE__ */ new Set());
40
+ const selectAll = computed(() => selectedKeys.value.size === props.data.length);
41
+ const isSelected = (row) => props.selectable && selectedKeys.value.has(keyOf(row));
42
+ const emitChange = () => {
43
+ emits("selectionChange", getSelected());
44
+ };
45
+ const getSelected = () => props.selectable ? props.data.filter((r) => selectedKeys.value.has(keyOf(r))) : [];
46
+ const clearSelection = () => {
47
+ selectedKeys.value = /* @__PURE__ */ new Set();
48
+ emitChange();
49
+ };
50
+ const toggleAll = () => {
51
+ if (!props.selectable) return;
52
+ const nextSelectAll = !selectAll.value;
53
+ selectedKeys.value = nextSelectAll ? new Set(props.data.map((r) => keyOf(r))) : /* @__PURE__ */ new Set();
54
+ emitChange();
55
+ };
56
+ const toggleSelect = (row) => {
57
+ if (!props.selectable) return;
58
+ const k = keyOf(row);
59
+ const next = new Set(selectedKeys.value);
60
+ next.has(k) ? next.delete(k) : next.add(k);
61
+ selectedKeys.value = next;
62
+ emitChange();
63
+ };
64
+ const makeFieldComp = (column) => markRaw(
65
+ defineComponent({
41
66
  name: "DataViewField",
42
67
  props: {
43
- row: { type: Object, required: !0 },
44
- index: { type: Number, required: !0 },
45
- selected: { type: Boolean, default: !1 },
68
+ row: { type: Object, required: true },
69
+ index: { type: Number, required: true },
70
+ selected: { type: Boolean, default: false },
46
71
  toggleSelect: { type: Function, default: void 0 }
47
72
  },
48
- setup(t) {
73
+ setup(p) {
49
74
  return () => {
50
- const { type: n, render: a, prop: x } = e;
51
- if (n === "index")
52
- return c("span", String(t.index + 1));
53
- if (n === "selection")
54
- return c("input", {
75
+ const { type, render, prop } = column;
76
+ if (type === "index") {
77
+ return h("span", String(p.index + 1));
78
+ }
79
+ if (type === "selection") {
80
+ return h("input", {
55
81
  type: "checkbox",
56
- checked: t.selected,
82
+ checked: p.selected,
57
83
  onChange: () => {
58
- var v;
59
- return (v = t.toggleSelect) == null ? void 0 : v.call(t);
84
+ var _a;
85
+ return (_a = p.toggleSelect) == null ? void 0 : _a.call(p);
60
86
  }
61
87
  });
62
- if (typeof a == "function")
63
- return a({
64
- ...o.getRenderCtxParams(),
65
- row: t.row,
66
- column: e,
67
- _index: t.index
88
+ }
89
+ if (typeof render === "function") {
90
+ return render({
91
+ ...props.getRenderCtxParams(),
92
+ row: p.row,
93
+ column,
94
+ _index: p.index
68
95
  });
69
- if (a)
70
- return c(a);
71
- const u = x ? t.row[x] : void 0;
72
- return c("span", u == null ? "" : String(u));
96
+ }
97
+ if (render) {
98
+ return h(render);
99
+ }
100
+ const v = prop ? p.row[prop] : void 0;
101
+ return h("span", v === void 0 || v === null ? "" : String(v));
73
102
  };
74
103
  }
75
104
  })
76
- ), L = m(() => {
77
- const e = {};
78
- for (const t of o.columns) {
79
- if (t.type === "expand") continue;
80
- const n = t.type === "index" ? "$type_index" : t.type === "selection" ? "$type_selection" : t.prop;
81
- if (!n) {
105
+ );
106
+ const fieldComponentMap = computed(() => {
107
+ const map = {};
108
+ for (const column of props.columns) {
109
+ if (column.type === "expand") continue;
110
+ const key = column.type === "index" ? "$type_index" : column.type === "selection" ? "$type_selection" : column.prop;
111
+ if (!key) {
82
112
  console.warn(
83
113
  "[DataListView] 列缺少 prop 且非 index/selection,跳过",
84
- t
114
+ column
85
115
  );
86
116
  continue;
87
117
  }
88
- e[n] && console.warn(`[DataListView] 列 key 重复 "${n}",后者覆盖前者`), e[n] = D(t);
118
+ if (map[key]) {
119
+ console.warn(`[DataListView] 列 key 重复 "${key}",后者覆盖前者`);
120
+ }
121
+ map[key] = makeFieldComp(column);
89
122
  }
90
- return e;
91
- }), _ = N({
92
- clearSelection: y,
93
- getSelectionRows: g,
94
- toggleRowSelection: h,
95
- toggleAllSelection: $,
96
- columns: o.columns
123
+ return map;
124
+ });
125
+ const expose = createDataListViewInstance({
126
+ clearSelection,
127
+ getSelectionRows: getSelected,
128
+ toggleRowSelection: toggleSelect,
129
+ toggleAllSelection: toggleAll,
130
+ columns: props.columns
97
131
  });
98
- return k(_), R(
99
- () => o.data,
132
+ __expose(expose);
133
+ watch(
134
+ () => props.data,
100
135
  () => {
101
- l.value.size && y();
136
+ if (selectedKeys.value.size) clearSelection();
102
137
  }
103
- ), (e, t) => (s(), p("div", {
104
- class: "data-list-view",
105
- style: A(H.value)
106
- }, [
107
- r.data.length ? (s(!0), p(F, { key: 0 }, z(r.data, (n, a) => (s(), E(M, {
108
- key: i(n),
109
- selected: f(n)
110
- }, {
111
- default: K(() => [
112
- S(e.$slots, "item", {
113
- fieldComponentMap: L.value,
114
- row: n,
115
- index: a,
116
- selected: f(n),
117
- toggleSelect: () => h(n)
118
- }, void 0, !0)
119
- ]),
120
- _: 2
121
- }, 1032, ["selected"]))), 128)) : (s(), p("div", P, [
122
- S(e.$slots, "empty", {}, () => [
123
- O(j(I))
124
- ], !0)
125
- ]))
126
- ], 4));
138
+ );
139
+ return (_ctx, _cache) => {
140
+ return openBlock(), createElementBlock("div", {
141
+ class: "data-list-view",
142
+ style: normalizeStyle(containerStyle.value)
143
+ }, [
144
+ __props.data.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.data, (row, index) => {
145
+ return openBlock(), createBlock(DataListViewItem, {
146
+ key: keyOf(row),
147
+ selected: isSelected(row)
148
+ }, {
149
+ default: withCtx(() => [
150
+ renderSlot(_ctx.$slots, "item", {
151
+ fieldComponentMap: fieldComponentMap.value,
152
+ row,
153
+ index,
154
+ selected: isSelected(row),
155
+ toggleSelect: () => toggleSelect(row)
156
+ }, void 0, true)
157
+ ]),
158
+ _: 2
159
+ }, 1032, ["selected"]);
160
+ }), 128)) : (openBlock(), createElementBlock("div", _hoisted_1, [
161
+ renderSlot(_ctx.$slots, "empty", {}, () => [
162
+ createVNode(unref(ElEmpty))
163
+ ], true)
164
+ ]))
165
+ ], 4);
166
+ };
127
167
  }
128
168
  });
129
169
  export {
130
- T as default
170
+ _sfc_main as default
131
171
  };
@@ -1,7 +1,7 @@
1
- import t from "./DataListViewItem.vue2.mjs";
1
+ import _sfc_main from "./DataListViewItem.vue2.mjs";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-d9b5d5ca"]]);
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const DataListViewItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d9b5d5ca"]]);
5
5
  export {
6
- e as default
6
+ DataListViewItem as default
7
7
  };
@@ -1,17 +1,19 @@
1
- import { defineComponent as s, openBlock as o, createElementBlock as a, normalizeClass as l, renderSlot as n } from "vue";
2
- const c = /* @__PURE__ */ s({
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3
3
  __name: "DataListViewItem",
4
4
  props: {
5
5
  selected: { type: Boolean }
6
6
  },
7
- setup(e) {
8
- return (t, r) => (o(), a("div", {
9
- class: l(["data-list-view-item", { "is-selected": e.selected }])
10
- }, [
11
- n(t.$slots, "default", {}, void 0, !0)
12
- ], 2));
7
+ setup(__props) {
8
+ return (_ctx, _cache) => {
9
+ return openBlock(), createElementBlock("div", {
10
+ class: normalizeClass(["data-list-view-item", { "is-selected": __props.selected }])
11
+ }, [
12
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
13
+ ], 2);
14
+ };
13
15
  }
14
16
  });
15
17
  export {
16
- c as default
18
+ _sfc_main as default
17
19
  };
@@ -1,36 +1,38 @@
1
- const o = (r) => ({
2
- toggleRowExpansion: () => {
3
- throw new Error("toggleRowExpansion not supported");
4
- },
5
- setCurrentRow: () => {
6
- throw new Error("setCurrentRow not supported");
7
- },
8
- clearSort: () => {
9
- throw new Error("clearSort not supported");
10
- },
11
- clearFilter: () => {
12
- throw new Error("clearFilter not supported");
13
- },
14
- doLayout: () => {
15
- throw new Error("doLayout not supported");
16
- },
17
- sort: () => {
18
- throw new Error("sort not supported");
19
- },
20
- scrollTo: () => {
21
- throw new Error("scrollTo not supported");
22
- },
23
- setScrollTop: () => {
24
- throw new Error("setScrollTop not supported");
25
- },
26
- setScrollLeft: () => {
27
- throw new Error("setScrollLeft not supported");
28
- },
29
- updateKeyChildren: () => {
30
- throw new Error("updateKeyChildren not supported");
31
- },
32
- ...r
33
- });
1
+ const createDataListViewInstance = (mainMethods) => {
2
+ return {
3
+ toggleRowExpansion: () => {
4
+ throw new Error("toggleRowExpansion not supported");
5
+ },
6
+ setCurrentRow: () => {
7
+ throw new Error("setCurrentRow not supported");
8
+ },
9
+ clearSort: () => {
10
+ throw new Error("clearSort not supported");
11
+ },
12
+ clearFilter: () => {
13
+ throw new Error("clearFilter not supported");
14
+ },
15
+ doLayout: () => {
16
+ throw new Error("doLayout not supported");
17
+ },
18
+ sort: () => {
19
+ throw new Error("sort not supported");
20
+ },
21
+ scrollTo: () => {
22
+ throw new Error("scrollTo not supported");
23
+ },
24
+ setScrollTop: () => {
25
+ throw new Error("setScrollTop not supported");
26
+ },
27
+ setScrollLeft: () => {
28
+ throw new Error("setScrollLeft not supported");
29
+ },
30
+ updateKeyChildren: () => {
31
+ throw new Error("updateKeyChildren not supported");
32
+ },
33
+ ...mainMethods
34
+ };
35
+ };
34
36
  export {
35
- o as createDataListViewInstance
37
+ createDataListViewInstance
36
38
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as O, toRefs as R, getCurrentInstance as V, ref as f, computed as b, openBlock as x, createBlock as w, unref as p, withCtx as d, createVNode as $, mergeProps as A, renderSlot as I } from "vue";
2
- import { ElButton as T } from "element-plus";
3
- import F from "./ActionConfirm.vue.mjs";
4
- const q = /* @__PURE__ */ O({
5
- inheritAttrs: !1,
1
+ import { defineComponent, toRefs, getCurrentInstance, ref, computed, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, renderSlot } from "vue";
2
+ import { ElButton } from "element-plus";
3
+ import ActionConfirm from "./ActionConfirm.vue.mjs";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{ inheritAttrs: false },
6
6
  __name: "ActionBtn",
7
7
  props: {
8
8
  size: {},
@@ -28,13 +28,21 @@ const q = /* @__PURE__ */ O({
28
28
  beforeOpen: {}
29
29
  },
30
30
  emits: ["click"],
31
- setup(v) {
32
- const m = v, { confirmConfig: s, confirmMode: _, beforeOpen: u } = R(m), r = V(), o = f(!1), c = f(!1), l = f();
33
- let y;
34
- const L = b(
35
- () => !!s.value || !!u.value
36
- ), g = b(() => {
37
- const e = m, t = {}, a = [
31
+ setup(__props) {
32
+ const props = __props;
33
+ const { confirmConfig, confirmMode, beforeOpen } = toRefs(props);
34
+ const instance = getCurrentInstance();
35
+ const innerLoading = ref(false);
36
+ const confirmVisible = ref(false);
37
+ const resolvedConfig = ref();
38
+ let lastEvt;
39
+ const shouldRenderConfirm = computed(
40
+ () => Boolean(confirmConfig.value) || Boolean(beforeOpen.value)
41
+ );
42
+ const passthrough = computed(() => {
43
+ const p = props;
44
+ const picked = {};
45
+ const keys = [
38
46
  "type",
39
47
  "size",
40
48
  "plain",
@@ -53,82 +61,97 @@ const q = /* @__PURE__ */ O({
53
61
  "icon",
54
62
  "loadingIcon"
55
63
  ];
56
- for (const n of a) e[n] !== void 0 && (t[n] = e[n]);
57
- return { ...r == null ? void 0 : r.attrs, ...t };
58
- }), P = (e) => !!e && typeof e.then == "function", S = () => {
59
- var t;
60
- const e = (t = r == null ? void 0 : r.vnode.props) == null ? void 0 : t.onClick;
61
- return e ? Array.isArray(e) ? e : [e] : [];
62
- }, k = () => {
63
- const e = S();
64
- if (!e.length) return;
65
- const t = y;
66
- let a;
64
+ for (const k of keys) if (p[k] !== void 0) picked[k] = p[k];
65
+ return { ...instance == null ? void 0 : instance.attrs, ...picked };
66
+ });
67
+ const isPromise = (v) => !!v && typeof v.then === "function";
68
+ const getListeners = () => {
69
+ var _a;
70
+ const raw = (_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick;
71
+ if (!raw) return [];
72
+ return Array.isArray(raw) ? raw : [raw];
73
+ };
74
+ const invokeListeners = () => {
75
+ const listeners = getListeners();
76
+ if (!listeners.length) return;
77
+ const evt = lastEvt;
78
+ let rets;
67
79
  try {
68
- a = e.map((i) => i(t));
69
- } catch (i) {
70
- throw o.value = !1, i;
80
+ rets = listeners.map((fn) => fn(evt));
81
+ } catch (e) {
82
+ innerLoading.value = false;
83
+ throw e;
71
84
  }
72
- const n = a.filter(P);
73
- if (n.length)
74
- return o.value = !0, Promise.all(n).finally(() => {
75
- o.value = !1;
76
- });
77
- }, z = () => k(), B = async (e) => {
78
- if (o.value || c.value) return;
79
- y = e;
80
- let t;
81
- if (u.value) {
82
- o.value = !0;
85
+ const proms = rets.filter(isPromise);
86
+ if (!proms.length) return;
87
+ innerLoading.value = true;
88
+ return Promise.all(proms).finally(() => {
89
+ innerLoading.value = false;
90
+ });
91
+ };
92
+ const submitFnAdapter = () => invokeListeners();
93
+ const onInnerClick = async (evt) => {
94
+ if (innerLoading.value || confirmVisible.value) return;
95
+ lastEvt = evt;
96
+ let data;
97
+ if (beforeOpen.value) {
98
+ innerLoading.value = true;
83
99
  try {
84
- t = await u.value();
100
+ data = await beforeOpen.value();
85
101
  } catch {
86
- o.value = !1;
102
+ innerLoading.value = false;
87
103
  return;
88
104
  }
89
- o.value = !1;
90
- } else
91
- t = void 0;
92
- s.value ? (l.value = typeof s.value == "function" ? s.value(t) : s.value, c.value = !0) : k();
93
- }, E = (e) => {
94
- l.value = void 0;
105
+ innerLoading.value = false;
106
+ } else {
107
+ data = void 0;
108
+ }
109
+ if (confirmConfig.value) {
110
+ resolvedConfig.value = typeof confirmConfig.value === "function" ? confirmConfig.value(data) : confirmConfig.value;
111
+ confirmVisible.value = true;
112
+ } else {
113
+ invokeListeners();
114
+ }
115
+ };
116
+ const onConfirmClose = (_confirmed) => {
117
+ resolvedConfig.value = void 0;
95
118
  };
96
- return (e, t) => {
97
- var a, n, i, C, h;
98
- return L.value ? (x(), w(F, {
119
+ return (_ctx, _cache) => {
120
+ var _a, _b, _c, _d, _e;
121
+ return shouldRenderConfirm.value ? (openBlock(), createBlock(ActionConfirm, {
99
122
  key: 0,
100
- show: c.value,
101
- "onUpdate:show": t[0] || (t[0] = (M) => c.value = M),
102
- mode: p(_) || "popconfirm",
103
- title: (a = l.value) == null ? void 0 : a.title,
104
- content: (n = l.value) == null ? void 0 : n.content,
105
- "confirm-text": (i = l.value) == null ? void 0 : i.confirmText,
106
- "cancel-text": (C = l.value) == null ? void 0 : C.cancelText,
107
- type: ((h = l.value) == null ? void 0 : h.type) ?? v.type,
108
- "submit-fn": z,
109
- onClose: E
123
+ show: confirmVisible.value,
124
+ "onUpdate:show": _cache[0] || (_cache[0] = ($event) => confirmVisible.value = $event),
125
+ mode: unref(confirmMode) || "popconfirm",
126
+ title: (_a = resolvedConfig.value) == null ? void 0 : _a.title,
127
+ content: (_b = resolvedConfig.value) == null ? void 0 : _b.content,
128
+ "confirm-text": (_c = resolvedConfig.value) == null ? void 0 : _c.confirmText,
129
+ "cancel-text": (_d = resolvedConfig.value) == null ? void 0 : _d.cancelText,
130
+ type: ((_e = resolvedConfig.value) == null ? void 0 : _e.type) ?? __props.type,
131
+ "submit-fn": submitFnAdapter,
132
+ onClose: onConfirmClose
110
133
  }, {
111
- default: d(() => [
112
- $(p(T), A({ class: "dc-action-btn" }, g.value, {
113
- loading: o.value,
114
- onClick: B
134
+ default: withCtx(() => [
135
+ createVNode(unref(ElButton), mergeProps({ class: "dc-action-btn" }, passthrough.value, {
136
+ loading: innerLoading.value,
137
+ onClick: onInnerClick
115
138
  }), {
116
- default: d(() => [
117
- I(e.$slots, "default")
139
+ default: withCtx(() => [
140
+ renderSlot(_ctx.$slots, "default")
118
141
  ]),
119
142
  _: 3
120
143
  }, 16, ["loading"])
121
144
  ]),
122
145
  _: 3
123
- }, 8, ["show", "mode", "title", "content", "confirm-text", "cancel-text", "type"])) : (x(), w(p(T), A({
146
+ }, 8, ["show", "mode", "title", "content", "confirm-text", "cancel-text", "type"])) : (openBlock(), createBlock(unref(ElButton), mergeProps({
124
147
  key: 1,
125
148
  class: "dc-action-btn"
126
- }, g.value, {
127
- loading: o.value,
128
- onClick: B
149
+ }, passthrough.value, {
150
+ loading: innerLoading.value,
151
+ onClick: onInnerClick
129
152
  }), {
130
- default: d(() => [
131
- I(e.$slots, "default")
153
+ default: withCtx(() => [
154
+ renderSlot(_ctx.$slots, "default")
132
155
  ]),
133
156
  _: 3
134
157
  }, 16, ["loading"]));
@@ -136,5 +159,5 @@ const q = /* @__PURE__ */ O({
136
159
  }
137
160
  });
138
161
  export {
139
- q as default
162
+ _sfc_main as default
140
163
  };
@@ -1,4 +1,4 @@
1
- import f from "./ActionBtn.vue.mjs";
1
+ import _sfc_main from "./ActionBtn.vue.mjs";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };