@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.
- package/README.md +77 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +7 -6
- package/es/bridge/config-hook.mjs +49 -37
- package/es/bridge/index.mjs +152 -109
- package/es/bridge/layout.mjs +45 -31
- package/es/bridge/plugin.mjs +22 -12
- package/es/bridge/route.mjs +59 -50
- package/es/bridge/state.mjs +54 -39
- package/es/bridge/storage.mjs +18 -8
- package/es/bridge/theme/index.mjs +200 -97
- package/es/bridge/theme/persist.mjs +11 -7
- package/es/bridge/theme/system-dark.mjs +13 -6
- package/es/components/app-layout/AppAside.vue.mjs +4 -4
- package/es/components/app-layout/AppAside.vue2.mjs +37 -30
- package/es/components/app-layout/AppBody.vue.mjs +4 -4
- package/es/components/app-layout/AppBody.vue2.mjs +97 -60
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +4 -4
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +59 -38
- package/es/components/app-layout/AppCollapseToggle.vue.mjs +4 -4
- package/es/components/app-layout/AppCollapseToggle.vue2.mjs +51 -42
- package/es/components/app-layout/AppFooter.vue.mjs +4 -4
- package/es/components/app-layout/AppFooter.vue2.mjs +15 -12
- package/es/components/app-layout/AppHeader.vue.mjs +4 -4
- package/es/components/app-layout/AppHeader.vue2.mjs +81 -58
- package/es/components/app-layout/AppLayout.vue.mjs +4 -4
- package/es/components/app-layout/AppLayout.vue2.mjs +148 -112
- package/es/components/app-layout/AppPage.vue.mjs +4 -4
- package/es/components/app-layout/AppPage.vue2.mjs +254 -197
- package/es/components/app-layout/AppShell.vue.mjs +44 -42
- package/es/components/app-layout/AppShell.vue2.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue.mjs +4 -4
- package/es/components/app-layout/AppSidebar.vue2.mjs +76 -59
- package/es/components/app-layout/AppTheme.vue.mjs +4 -4
- package/es/components/app-layout/AppTheme.vue2.mjs +69 -57
- package/es/components/app-layout/app-page-geometry.mjs +44 -42
- package/es/components/app-layout/keep-alive.mjs +27 -19
- package/es/components/app-layout/viewport.mjs +4 -3
- package/es/components/data-view/DataListView.vue.mjs +4 -4
- package/es/components/data-view/DataListView.vue2.mjs +133 -93
- package/es/components/data-view/DataListViewItem.vue.mjs +4 -4
- package/es/components/data-view/DataListViewItem.vue2.mjs +11 -9
- package/es/components/data-view/utils.mjs +36 -34
- package/es/components/display/ActionBtn.vue.mjs +94 -71
- package/es/components/display/ActionBtn.vue2.mjs +2 -2
- package/es/components/display/ActionBtnGroup.vue.mjs +54 -48
- package/es/components/display/ActionBtnGroup.vue2.mjs +2 -2
- package/es/components/display/ActionConfirm.vue.mjs +4 -4
- package/es/components/display/ActionConfirm.vue2.mjs +116 -92
- package/es/components/display/BooleanTag.vue.mjs +24 -18
- package/es/components/display/BooleanTag.vue2.mjs +2 -2
- package/es/components/display/HeightProvider.vue.mjs +37 -27
- package/es/components/display/HeightProvider.vue2.mjs +2 -2
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +86 -57
- package/es/components/display/TabsMain.vue.mjs +156 -125
- package/es/components/display/TabsMain.vue2.mjs +2 -2
- package/es/components/display/TabsNaturalFlow.vue.mjs +15 -11
- package/es/components/display/TabsNaturalFlow.vue2.mjs +2 -2
- package/es/components/display/TabsRefineFlow.vue.mjs +55 -42
- package/es/components/display/TabsRefineFlow.vue2.mjs +2 -2
- package/es/components/display/TabsTile.vue.mjs +4 -4
- package/es/components/display/TabsTile.vue2.mjs +204 -146
- package/es/components/display/WatchSize.vue.mjs +50 -30
- package/es/components/display/WatchSize.vue2.mjs +2 -2
- package/es/components/display/use-tabs-query-sync.mjs +21 -17
- package/es/components/form/FormItem.vue.mjs +4 -4
- package/es/components/form/FormItem.vue2.mjs +183 -121
- package/es/components/form/FormItemNestForm.vue.mjs +4 -4
- package/es/components/form/FormItemNestForm.vue2.mjs +38 -34
- package/es/components/form/FormItemNestFormList.vue.mjs +4 -4
- package/es/components/form/FormItemNestFormList.vue2.mjs +135 -106
- package/es/components/form/FormMain.vue.mjs +4 -4
- package/es/components/form/FormMain.vue2.mjs +226 -139
- package/es/components/form/FormRadioGroup.vue.mjs +67 -52
- package/es/components/form/FormRadioGroup.vue2.mjs +2 -2
- package/es/components/form/FormSearch.vue.mjs +4 -4
- package/es/components/form/FormSearch.vue2.mjs +194 -156
- package/es/components/form/FormSelect.vue.mjs +69 -42
- package/es/components/form/FormSelect.vue2.mjs +2 -2
- package/es/components/form/FormSubmitBtn.vue.mjs +30 -25
- package/es/components/form/FormSubmitBtn.vue2.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue.mjs +4 -4
- package/es/components/form/FormSubmitPanel.vue2.mjs +129 -96
- package/es/components/form/FormTree.vue.mjs +19 -16
- package/es/components/form/FormTree.vue2.mjs +2 -2
- package/es/components/form/FormVerifyCode.vue.mjs +58 -41
- package/es/components/form/FormVerifyCode.vue2.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue.mjs +4 -4
- package/es/components/form/FormVerifyImage.vue2.mjs +62 -40
- package/es/components/form/form-search-utils.mjs +83 -52
- package/es/components/form/nest-form-item-list.mjs +63 -55
- package/es/components/form/nest-form-item.mjs +30 -30
- package/es/components/form/nest-registry.mjs +4 -4
- package/es/components/form/use-form-submit.mjs +18 -15
- package/es/components/form/use-layout-by-container.mjs +23 -15
- package/es/components/form/use-nest-form-list.mjs +19 -16
- package/es/components/form/use-nest-form.mjs +37 -28
- package/es/components/form/use-nest-layout-scale.mjs +11 -10
- package/es/components/form/utils.mjs +233 -145
- package/es/components/list-page/ListPage.vue.mjs +4 -4
- package/es/components/list-page/ListPage.vue2.mjs +313 -207
- package/es/components/list-page/use-sticky.mjs +45 -33
- package/es/components/menu/MenuItemSub.vue.mjs +47 -43
- package/es/components/menu/MenuItemSub.vue2.mjs +2 -2
- package/es/components/menu/MenuTree.vue.mjs +84 -61
- package/es/components/menu/MenuTree.vue2.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue.mjs +4 -4
- package/es/components/misc/AutoRefresh.vue2.mjs +78 -53
- package/es/components/misc/AutoRefreshGroup.vue.mjs +4 -4
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +54 -51
- package/es/components/misc/SelectModule.vue.mjs +54 -45
- package/es/components/misc/SelectModule.vue2.mjs +2 -2
- package/es/components/misc/TriggerAutoImport.vue.mjs +7 -5
- package/es/components/misc/TriggerAutoImport.vue2.mjs +2 -2
- package/es/components/modal/ModalConfirm.vue.mjs +4 -4
- package/es/components/modal/ModalConfirm.vue2.mjs +160 -125
- package/es/components/modal/ModalDetail.vue.mjs +50 -39
- package/es/components/modal/ModalDetail.vue2.mjs +2 -2
- package/es/components/modal/ModalForm.vue.mjs +63 -52
- package/es/components/modal/ModalForm.vue2.mjs +2 -2
- package/es/components/modal/ModalPorter.vue.mjs +51 -36
- package/es/components/modal/ModalPorter.vue2.mjs +2 -2
- package/es/components/modal/ModalShelf.vue.mjs +38 -28
- package/es/components/modal/ModalShelf.vue2.mjs +2 -2
- package/es/components/modal/modal-shelf-core.mjs +52 -36
- package/es/components/modal/modal-shelf-hierarchy.mjs +11 -9
- package/es/components/panel/PanelEditSwitch.vue.mjs +4 -4
- package/es/components/panel/PanelEditSwitch.vue2.mjs +88 -66
- package/es/components/panel/PanelItem.vue.mjs +4 -4
- package/es/components/panel/PanelItem.vue2.mjs +103 -77
- package/es/components/panel/PanelItemNestForm.vue.mjs +4 -4
- package/es/components/panel/PanelItemNestForm.vue2.mjs +61 -52
- package/es/components/panel/PanelItemNestPanel.vue.mjs +22 -20
- package/es/components/panel/PanelItemNestPanel.vue2.mjs +2 -2
- package/es/components/panel/PanelMain.vue.mjs +4 -4
- package/es/components/panel/PanelMain.vue2.mjs +92 -74
- package/es/components/panel/nest-panel-form.mjs +44 -38
- package/es/components/panel/nest-panel-item.mjs +18 -17
- package/es/components/slot-layout/SlotLayoutFlowAside.vue.mjs +4 -4
- package/es/components/slot-layout/SlotLayoutFlowAside.vue2.mjs +55 -42
- package/es/components/slot-layout/SlotLayoutTemplate.vue.mjs +11 -9
- package/es/components/slot-layout/SlotLayoutTemplate.vue2.mjs +2 -2
- package/es/components/table/TableMain.vue.mjs +4 -4
- package/es/components/table/TableMain.vue2.mjs +378 -275
- package/es/components/table/TableSkeleton.vue.mjs +4 -4
- package/es/components/table/TableSkeleton.vue2.mjs +95 -74
- package/es/components/table/TableToolbar.vue.mjs +4 -4
- package/es/components/table/TableToolbar.vue2.mjs +170 -154
- package/es/components/table/ToolbarButtons.vue.mjs +12 -10
- package/es/components/table/ToolbarButtons.vue2.mjs +2 -2
- package/es/components/table/constants.mjs +4 -3
- package/es/components/table/use-fill-height.mjs +12 -10
- package/es/components/table/use-table-skeleton.mjs +19 -15
- package/es/config/list-model.mjs +2 -2
- package/es/config/route.mjs +4 -3
- package/es/helpers/form.mjs +35 -25
- package/es/helpers/list-helper.mjs +59 -44
- package/es/hooks/activated.mjs +49 -33
- package/es/hooks/feel-size.mjs +39 -23
- package/es/hooks/menus-dispatch.mjs +68 -35
- package/es/hooks/timeout.mjs +29 -14
- package/es/hooks/use-breakpoint.mjs +35 -23
- package/es/hooks/use-channel-viewport-height.mjs +30 -20
- package/es/hooks/use-custom-breakpoint.mjs +48 -31
- package/es/hooks/use-observe-size.mjs +37 -20
- package/es/hooks/use-theme-apply.mjs +175 -124
- package/es/hooks/use-viewport-apply.mjs +39 -27
- package/es/index.mjs +239 -239
- package/es/inject/key.mjs +52 -41
- package/es/injectInfo.json.mjs +2 -2
- package/es/router/group-redirect.mjs +22 -16
- package/es/router/guard/index.mjs +26 -21
- package/es/router/guard/login.mjs +4 -2
- package/es/router/guard/permission.mjs +4 -2
- package/es/store/app.mjs +163 -123
- package/es/store/router-permission.mjs +75 -46
- package/es/store/user.mjs +100 -71
- package/es/style.css +769 -1
- package/es/utils/dom.mjs +20 -16
- package/es/utils/export.mjs +34 -18
- package/es/utils/id.mjs +5 -3
- package/es/utils/router.mjs +21 -14
- package/es/utils/theme-scale.mjs +50 -35
- package/es/utils/time.mjs +20 -14
- package/package.json +4 -3
- package/src/bridge/README.md +5 -0
- package/src/bridge/docs/README.md +72 -0
- package/src/components/README.md +84 -0
- package/src/components/app-layout/README.md +46 -0
- package/src/components/app-layout/docs/README-AppAside.md +69 -0
- package/src/components/app-layout/docs/README-AppBody.md +81 -0
- package/src/components/app-layout/docs/README-AppBreadcrumb.md +71 -0
- package/src/components/app-layout/docs/README-AppFooter.md +41 -0
- package/src/components/app-layout/docs/README-AppHeader.md +73 -0
- package/src/components/app-layout/docs/README-AppLayout.md +83 -0
- package/src/components/app-layout/docs/README-AppPage.md +80 -0
- package/src/components/app-layout/docs/README-AppSidebar.md +70 -0
- package/src/components/app-layout/docs/README-AppTheme.md +66 -0
- package/src/components/data-view/README.md +19 -0
- package/src/components/data-view/docs/README-DataListView.md +114 -0
- package/src/components/display/README.md +23 -0
- package/src/components/display/docs/README-ActionBtn.md +84 -0
- package/src/components/display/docs/README-ActionBtnGroup.md +96 -0
- package/src/components/display/docs/README-ActionConfirm.md +77 -0
- package/src/components/display/docs/README-BooleanTag.md +76 -0
- package/src/components/display/docs/README-HeightProvider.md +74 -0
- package/src/components/display/docs/README-TabsMain.md +99 -0
- package/src/components/display/docs/README-WatchSize.md +70 -0
- package/src/components/form/README.md +24 -0
- package/src/components/form/docs/README-FormItemNestForm.md +86 -0
- package/src/components/form/docs/README-FormItemNestFormList.md +93 -0
- package/src/components/form/docs/README-FormMain.md +101 -0
- package/src/components/form/docs/README-FormSearch.md +89 -0
- package/src/components/form/docs/README-FormSubmitBtn.md +72 -0
- package/src/components/form/docs/README-FormSubmitPanel.md +97 -0
- package/src/components/list-page/README.md +16 -0
- package/src/components/list-page/docs/README-ListPage.md +136 -0
- package/src/components/menu/README.md +19 -0
- package/src/components/menu/docs/README-MenuItemSub.md +53 -0
- package/src/components/menu/docs/README-MenuTree.md +76 -0
- package/src/components/misc/README.md +21 -0
- package/src/components/misc/docs/README-AutoRefresh.md +74 -0
- package/src/components/misc/docs/README-AutoRefreshGroup.md +74 -0
- package/src/components/misc/docs/README-SelectModule.md +72 -0
- package/src/components/modal/README.md +21 -0
- package/src/components/modal/docs/README-ModalConfirm.md +105 -0
- package/src/components/modal/docs/README-ModalDetail.md +103 -0
- package/src/components/modal/docs/README-ModalForm.md +97 -0
- package/src/components/modal/docs/README-ModalPorter.md +92 -0
- package/src/components/modal/docs/README-ModalShelf.md +115 -0
- package/src/components/panel/README.md +19 -0
- package/src/components/panel/docs/README-PanelMain.md +149 -0
- package/src/components/slot-layout/README.md +17 -0
- package/src/components/slot-layout/docs/README-SlotLayoutFlowAside.md +83 -0
- package/src/components/slot-layout/docs/README-SlotLayoutTemplate.md +73 -0
- package/src/components/table/README.md +17 -0
- package/src/components/table/docs/README-TableMain.md +140 -0
- package/src/hooks/README.md +5 -0
- package/src/hooks/docs/README.md +49 -0
- package/types/bridge/config-hook.d.ts +68 -0
- package/types/bridge/index.d.ts +411 -0
- package/types/bridge/layout.d.ts +40 -0
- package/types/bridge/plugin.d.ts +18 -0
- package/types/bridge/route.d.ts +20 -1
- package/types/bridge/state.d.ts +14 -0
- package/types/bridge/storage.d.ts +9 -0
- package/types/bridge/theme/index.d.ts +7 -0
- package/types/bridge/theme/persist.d.ts +12 -0
- package/types/bridge/theme/system-dark.d.ts +12 -0
- package/types/bridge/theme/types.d.ts +238 -0
- package/types/components/app-layout/AppAside.vue.d.ts +1 -0
- package/types/components/app-layout/AppCollapseToggle.vue.d.ts +3 -0
- package/types/components/app-layout/AppHeader.vue.d.ts +3 -0
- package/types/components/app-layout/AppLayout.vue.d.ts +12 -0
- package/types/components/app-layout/AppPage.vue.d.ts +17 -0
- package/types/components/app-layout/AppSidebar.vue.d.ts +2 -0
- package/types/components/app-layout/app-page-geometry.d.ts +48 -0
- package/types/components/app-layout/keep-alive.d.ts +17 -0
- package/types/components/app-layout/types.d.ts +125 -0
- package/types/components/app-layout/viewport.d.ts +28 -0
- package/types/components/data-view/DataListViewItem.vue.d.ts +8 -0
- package/types/components/data-view/index.d.ts +4 -0
- package/types/components/data-view/types.d.ts +42 -0
- package/types/components/data-view/utils.d.ts +3 -0
- package/types/components/display/TabsHeader.vue.d.ts +2 -0
- package/types/components/display/TabsMain.vue.d.ts +2 -0
- package/types/components/display/TabsRefineFlow.vue.d.ts +1 -0
- package/types/components/display/TabsTile.vue.d.ts +247 -12
- package/types/components/display/WatchSize.vue.d.ts +9 -0
- package/types/components/display/index.d.ts +37 -1
- package/types/components/display/types.d.ts +163 -0
- package/types/components/display/use-tabs-query-sync.d.ts +29 -0
- package/types/components/form/FormItemNestForm.vue.d.ts +5 -0
- package/types/components/form/FormItemNestFormList.vue.d.ts +17 -0
- package/types/components/form/FormVerifyCode.vue.d.ts +9 -0
- package/types/components/form/FormVerifyImage.vue.d.ts +1 -0
- package/types/components/form/form-search-utils.d.ts +34 -0
- package/types/components/form/nest-form-item-list.d.ts +28 -0
- package/types/components/form/nest-form-item.d.ts +21 -0
- package/types/components/form/nest-registry.d.ts +14 -0
- package/types/components/form/types.d.ts +208 -8
- package/types/components/form/use-form-submit.d.ts +13 -0
- package/types/components/form/use-layout-by-container.d.ts +23 -0
- package/types/components/form/use-nest-form-list.d.ts +13 -0
- package/types/components/form/use-nest-form.d.ts +15 -0
- package/types/components/form/use-nest-layout-scale.d.ts +12 -0
- package/types/components/form/utils.d.ts +56 -1
- package/types/components/list-page/ListPage.vue.d.ts +6 -0
- package/types/components/list-page/types.d.ts +50 -2
- package/types/components/list-page/use-sticky.d.ts +23 -0
- package/types/components/misc/index.d.ts +6 -1
- package/types/components/misc/types.d.ts +7 -0
- package/types/components/modal/ModalConfirm.vue.d.ts +29 -0
- package/types/components/modal/index.d.ts +7 -1
- package/types/components/modal/modal-shelf-core.d.ts +3 -0
- package/types/components/modal/modal-shelf-hierarchy.d.ts +4 -0
- package/types/components/modal/modal-shelf-types.d.ts +34 -0
- package/types/components/modal/types.d.ts +63 -2
- package/types/components/panel/PanelItemNestForm.vue.d.ts +6 -0
- package/types/components/panel/PanelItemNestPanel.vue.d.ts +5 -0
- package/types/components/panel/nest-panel-form.d.ts +21 -0
- package/types/components/panel/nest-panel-item.d.ts +14 -0
- package/types/components/panel/types.d.ts +52 -1
- package/types/components/slot-layout/SlotLayoutTemplate.vue.d.ts +21 -0
- package/types/components/slot-layout/types.d.ts +4 -0
- package/types/components/table/constants.d.ts +8 -0
- package/types/components/table/types.d.ts +140 -9
- package/types/components/table/use-fill-height.d.ts +14 -0
- package/types/components/table/use-table-skeleton.d.ts +16 -0
- package/types/config/list-model.d.ts +29 -0
- package/types/config/route.d.ts +2 -0
- package/types/helpers/form.d.ts +5 -0
- package/types/helpers/list-helper.d.ts +26 -0
- package/types/helpers/types.d.ts +11 -0
- package/types/hooks/activated.d.ts +23 -0
- package/types/hooks/feel-size.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +4 -0
- package/types/hooks/timeout.d.ts +4 -0
- package/types/hooks/use-channel-viewport-height.d.ts +8 -0
- package/types/hooks/use-custom-breakpoint.d.ts +19 -0
- package/types/hooks/use-observe-size.d.ts +29 -0
- package/types/hooks/use-theme-apply.d.ts +23 -0
- package/types/hooks/use-viewport-apply.d.ts +12 -0
- package/types/inject/key.d.ts +163 -0
- package/types/injectInfo.json.d.ts +1 -1
- package/types/router/group-redirect.d.ts +9 -0
- package/types/router/guard/index.d.ts +13 -0
- package/types/router/guard/login.d.ts +1 -0
- package/types/router/guard/permission.d.ts +1 -0
- package/types/router/guard/types.d.ts +3 -0
- package/types/store/app.d.ts +27 -0
- package/types/store/router-permission.d.ts +53 -0
- package/types/store/user.d.ts +24 -0
- package/types/types/dot-path.d.ts +8 -0
- package/types/types/route.d.ts +45 -0
- package/types/types/utility-types.d.ts +7 -0
- package/types/utils/dom.d.ts +22 -0
- package/types/utils/export.d.ts +16 -1
- package/types/utils/id.d.ts +1 -0
- package/types/utils/router.d.ts +2 -0
- package/types/utils/theme-scale.d.ts +31 -0
- package/types/utils/time.d.ts +1 -0
|
@@ -6,27 +6,75 @@ export type FormSearchRewriteKey = "list";
|
|
|
6
6
|
export type TableMainOptionsKey = "refine" | "refineReduceHeight" | "viewportHeight" | "parentChannel" | "toolbar" | "showSwitchView";
|
|
7
7
|
export type TableMainRequiredKey = "columns" | "rowKey";
|
|
8
8
|
export type TableMainRewriteKey = "api" | "query" | "injectInfo";
|
|
9
|
-
export type ListPageInnerInjectInfo<PO extends Record<string, any>,
|
|
10
|
-
|
|
9
|
+
export type ListPageInnerInjectInfo<PO extends Record<string, any>,
|
|
10
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
11
|
+
F extends Record<string, any>> = Pick<ListPageInstance<PO>, "triggerReset" | "triggerSearch" | "update"> & F;
|
|
12
|
+
export type ListPageProps<
|
|
13
|
+
/** 行数据结构 */
|
|
14
|
+
T extends Record<string, any>,
|
|
15
|
+
/** 表单标准结构模型 */
|
|
16
|
+
PO extends Record<string, any>,
|
|
17
|
+
/** 表单需转换的部分结构模型 */
|
|
18
|
+
SO extends Record<string, any>,
|
|
19
|
+
/** 静态参数 */
|
|
20
|
+
SQ extends Record<string, any>,
|
|
21
|
+
/** 期望注入到表格列插槽上的额外内容 */
|
|
22
|
+
F extends Record<string, any>> = Partial<Pick<FormSearchProps<PO, SO, {}>, FormSearchOptionsKey>> & {
|
|
11
23
|
formSearchProps?: Partial<Omit<FormSearchProps<PO, SO, {}>, FormSearchOptionsKey | FormSearchRewriteKey | "compact">>;
|
|
12
24
|
} & Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainRequiredKey> & Partial<Pick<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey>> & {
|
|
13
25
|
tableMainProps?: Partial<Omit<TableMainProps<T, ExtractFormStringifyFromObject<PO, SO> & SQ, ListPageInnerInjectInfo<PO, F>>, TableMainOptionsKey | TableMainOptionsKey | TableMainRewriteKey>>;
|
|
14
26
|
} & {
|
|
15
27
|
list?: FormItemConfigList<PO, SO>;
|
|
28
|
+
/** api */
|
|
16
29
|
api: (params: TableApiParams<ExtractFormStringifyFromObject<PO, SO> & SQ>) => Promise<TableApiResult<T>>;
|
|
30
|
+
/** 静态参数 */
|
|
17
31
|
query?: SQ;
|
|
18
32
|
injectInfo?: F;
|
|
33
|
+
/** 搜索前的回调[同步] */
|
|
19
34
|
beforeSearch?: (data: ExtractFormStringifyFromObject<PO, SO>, type: FormSearchSearchType) => ExtractFormStringifyFromObject<PO, SO>;
|
|
35
|
+
/** 在点击搜索重置按钮时,是否同时调用清空表格表头过滤 */
|
|
20
36
|
clearTableFilterOnReset?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 搜索是否分离为侧栏。
|
|
39
|
+
* - false(默认):header/搜索/operation 纵向内联在表格上方(与旧版逐像素一致)。
|
|
40
|
+
* - true:header/搜索/operation 整体移入侧栏,主区只余表格。
|
|
41
|
+
*/
|
|
21
42
|
separateSearch?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 分离侧栏布局配置(透传 SlotLayoutFlowAside 的 type/gap/asideWidth)。
|
|
45
|
+
* asideMaxHeight 不在此列——由 ListPage 内部按 viewport 高度消化后自动提供。
|
|
46
|
+
*/
|
|
22
47
|
separateSearchConfig?: Pick<SlotLayoutFlowAsideProps, "type" | "gap" | "asideWidth">;
|
|
48
|
+
/**
|
|
49
|
+
* FormSearch 粘性:容器/页面滚动时搜索区钉在滚动视口顶部(默认 false 不开启)。
|
|
50
|
+
* 典型场景:refine 计算可用高低于表格下界(dataViewMaxHeightMinValue)被顶破出滚动条时,
|
|
51
|
+
* 下滚看表格搜索区不滚走。只粘搜索区(header 槽随流滚走、operation 滚上来被盖过)。
|
|
52
|
+
* 分离态(separateSearch=true)搜索在自滚侧栏内、粘性无意义——该开关被完全无视。
|
|
53
|
+
*/
|
|
23
54
|
searchSticky?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 表格 toolbar 粘性:容器/页面滚动时 TableMain 的 toolbar 钉在滚动视口顶部
|
|
57
|
+
* (默认 false 不开启)。与 separateSearch 无关——分离与否表格都在主滚动流里。
|
|
58
|
+
* 与 searchSticky 同开(非分离态)时自动叠钉在粘住的搜索区正下方。
|
|
59
|
+
*/
|
|
24
60
|
toolbarSticky?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 表格分页器粘性:容器/页面滚动时 TableMain 的分页器钉在滚动视口底部
|
|
63
|
+
* (默认 false 不开启)。与 separateSearch 无关——分离与否表格都在主滚动流里。
|
|
64
|
+
*/
|
|
25
65
|
pagerSticky?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* header 插槽量高是否启用 ResizeObserver(透传 WatchSize observeResize,默认 false)。
|
|
68
|
+
* 默认时机(激活首测 + window resize + onUpdated)覆盖重渲染驱动的高度变化;槽内有
|
|
69
|
+
* **异步撑高 / CSS 过渡 / 后代自更新** 等不触发重渲染的变化(如无固定高的图片加载完成)
|
|
70
|
+
* 时开启,否则表格可用高扣减停在旧值。
|
|
71
|
+
*/
|
|
26
72
|
headerObserveResize?: boolean;
|
|
73
|
+
/** operation 插槽量高是否启用 ResizeObserver(语义同 headerObserveResize,默认 false)。 */
|
|
27
74
|
operationObserveResize?: boolean;
|
|
28
75
|
};
|
|
29
76
|
export interface ListPageInstance<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> extends FormSearchInstance<PO, SO>, TableMainInstance {
|
|
77
|
+
/** 更新表单数据 */
|
|
30
78
|
update: (key: Extract<keyof PO, string>, value: any) => void;
|
|
31
79
|
}
|
|
32
80
|
export type ListApiParams<L, SQ extends Record<string, any>> = TableApiParams<ExtractFormStringifyFromList<L> & SQ>;
|
|
@@ -1,19 +1,42 @@
|
|
|
1
1
|
import { ComponentPublicInstance, ComputedRef, ShallowRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* useListPageSticky 入参——吸附功能对主体 setup 的全部接线点(getter 保留响应式)。
|
|
4
|
+
* 只读不写:吸附是主体状态的纯下游,删除功能不影响任何主体逻辑。
|
|
5
|
+
*/
|
|
2
6
|
export interface UseListPageStickyOptions {
|
|
7
|
+
/** searchSticky prop:搜索区粘顶开关 */
|
|
3
8
|
searchSticky: () => boolean;
|
|
9
|
+
/** toolbarSticky prop:表格 toolbar 悬浮开关 */
|
|
4
10
|
toolbarSticky: () => boolean;
|
|
11
|
+
/** pagerSticky prop:分页器底吸开关 */
|
|
5
12
|
pagerSticky: () => boolean;
|
|
13
|
+
/** separateSearch prop:分离态搜索在自滚侧栏内、粘性无意义(开关被完全无视) */
|
|
6
14
|
separateSearch: () => boolean;
|
|
15
|
+
/** 搜索区实测盒高(主体 WatchSize 链维护,兼喂高度扣减,非吸附专属故传入不搬移) */
|
|
7
16
|
searchHeight: () => number;
|
|
17
|
+
/** 搜索区显隐(主体状态) */
|
|
8
18
|
showSearch: () => boolean;
|
|
9
19
|
}
|
|
20
|
+
/** useListPageSticky 返回——模板类绑定 + scoped 样式 v-bind 的全部吸附输出 */
|
|
10
21
|
export interface UseListPageStickyReturn {
|
|
22
|
+
/** ListPage 根(SlotLayoutFlowAside 根 div)模板 ref——粘性滚动语境的探测锚点 */
|
|
11
23
|
layoutRoot: ShallowRef<ComponentPublicInstance | undefined>;
|
|
24
|
+
/** 搜索区粘顶生效态(根条件类 list-page_search-sticky) */
|
|
12
25
|
searchStickyActive: ComputedRef<boolean>;
|
|
26
|
+
/** toolbar 悬浮生效态(根条件类 list-page_toolbar-sticky) */
|
|
13
27
|
toolbarStickyActive: ComputedRef<boolean>;
|
|
28
|
+
/** 分页器底吸生效态(根条件类 list-page_pager-sticky) */
|
|
14
29
|
pagerStickyActive: ComputedRef<boolean>;
|
|
30
|
+
/** 搜索区粘住顶距(喂 scoped 样式 v-bind) */
|
|
15
31
|
searchStickyTop: ComputedRef<string>;
|
|
32
|
+
/** toolbar 粘住顶距(基准 + 搜索叠钉补偿,喂 v-bind) */
|
|
16
33
|
toolbarStickyTop: ComputedRef<string>;
|
|
34
|
+
/** 分页器粘住底距(喂 v-bind) */
|
|
17
35
|
pagerStickyBottom: ComputedRef<string>;
|
|
18
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* ListPage 吸附三件套(searchSticky 粘顶 / toolbarSticky 悬浮 / pagerSticky 底吸)
|
|
39
|
+
* 专属 composable——服务吸附的探测 / computed / 生命周期全收于此,主体 setup 只留
|
|
40
|
+
* 一行委托;后续删除该功能 = 删本文件 + 组件内委托行 + 模板类绑定与对应样式块,分界明确。
|
|
41
|
+
*/
|
|
19
42
|
export declare function useListPageSticky(options: UseListPageStickyOptions): UseListPageStickyReturn;
|
|
@@ -3,4 +3,9 @@ import { default as AutoRefresh } from './AutoRefresh.vue';
|
|
|
3
3
|
import { default as AutoRefreshGroup } from './AutoRefreshGroup.vue';
|
|
4
4
|
import { default as SelectModule } from './SelectModule.vue';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated 全局样式引入后已无用——main.ts `import "element-plus/dist/index.css"`
|
|
9
|
+
* + ElementPlusResolver `importStyle: false` 即可,无需本组件触发按需样式。下个 MAJOR 删除。
|
|
10
|
+
*/
|
|
11
|
+
TriggerAutoImport, AutoRefresh, AutoRefreshGroup, SelectModule, };
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
/** AutoRefresh 组件 props */
|
|
1
2
|
export interface AutoRefreshProps {
|
|
3
|
+
/** 刷新方法,返回 Promise。失败不影响下轮定时 */
|
|
2
4
|
refreshFn: () => Promise<unknown>;
|
|
5
|
+
/** 是否不允许自动刷新。true 时清 timer 且不排下轮 */
|
|
3
6
|
disabled?: boolean;
|
|
4
7
|
}
|
|
5
8
|
export interface AutoRefreshGroupProps extends Omit<AutoRefreshProps, "disabled"> {
|
|
9
|
+
/** 是否显示自动刷新开关 */
|
|
6
10
|
showAutoRefresh?: boolean;
|
|
11
|
+
/** 是否显示刷新按钮 */
|
|
7
12
|
showRefresh?: boolean;
|
|
13
|
+
/** 加载是否正在进行中 */
|
|
8
14
|
loading?: boolean;
|
|
15
|
+
/** 是否需要根节点 */
|
|
9
16
|
needRootNode?: boolean;
|
|
10
17
|
}
|
|
@@ -10,17 +10,46 @@ type __VLS_Props = {
|
|
|
10
10
|
content?: string | (() => VNode);
|
|
11
11
|
cancelText?: string | (() => VNode);
|
|
12
12
|
confirmText?: string | (() => VNode);
|
|
13
|
+
/** 是否隐藏取消按钮 */
|
|
13
14
|
hiddenCancel?: boolean;
|
|
14
15
|
width?: number | string;
|
|
16
|
+
/** 反转按钮位置 */
|
|
15
17
|
reverse?: boolean;
|
|
18
|
+
/** 按下 ESC 是否关闭 */
|
|
16
19
|
closeOnPressEscape?: boolean;
|
|
20
|
+
/** 点击遮罩是否关闭 */
|
|
17
21
|
closeOnClickModal?: boolean;
|
|
22
|
+
/** 是否使用确认按钮loading */
|
|
18
23
|
useLoading?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 确认按钮 type(对齐 element-plus ElButton type)。
|
|
26
|
+
* 默认 'primary';danger / warning / success / info 全枚举均支持,
|
|
27
|
+
* 与 ActionConfirm popconfirm 模式按钮颜色行为对齐。
|
|
28
|
+
*/
|
|
19
29
|
type?: ButtonProps["type"];
|
|
30
|
+
/** 弹层形态:'modal'=ElDialog(居中弹窗,默认)|'drawer'=ElDrawer(抽屉) */
|
|
20
31
|
layerType?: "modal" | "drawer";
|
|
32
|
+
/**
|
|
33
|
+
* drawer 形态弹出方向(仅 layerType='drawer' 生效),默认 'rtl'(右侧滑出)。
|
|
34
|
+
* width 在 drawer 下复用为抽屉尺寸(size),modal 下为弹窗宽度。
|
|
35
|
+
*/
|
|
21
36
|
direction?: "rtl" | "ltr" | "ttb" | "btt";
|
|
37
|
+
/**
|
|
38
|
+
* header(标题区)下分割线。缺省按形态取默认:drawer=true / modal=false
|
|
39
|
+
* (modal 形态默认无分割线,保持既有观感);显式传值则两形态均生效。
|
|
40
|
+
*/
|
|
22
41
|
headerDivider?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* footer(按钮操作区)上分割线。缺省按形态取默认:drawer=true / modal=false;
|
|
44
|
+
* 显式传值则两形态均生效。
|
|
45
|
+
*/
|
|
23
46
|
footerDivider?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* modal 形态弹层体可用高的视口预留(px):向后代 provide 的可用最大高 =
|
|
49
|
+
* `window.innerHeight - modalReserve`,避免弹窗内有界内容顶天顶底。
|
|
50
|
+
* 默认 200——与内容区既有上限 `max-height: calc(100vh - 200px)` 同构。
|
|
51
|
+
* 仅 layerType='modal' 生效(drawer 体高由抽屉尺寸实测)。
|
|
52
|
+
*/
|
|
24
53
|
modalReserve?: number;
|
|
25
54
|
};
|
|
26
55
|
declare function __VLS_template(): {
|
|
@@ -5,4 +5,10 @@ import { default as ModalShelf } from './ModalShelf.vue';
|
|
|
5
5
|
import { default as ModalPorter } from './ModalPorter.vue';
|
|
6
6
|
export * from './types';
|
|
7
7
|
export * from './modal-shelf-types';
|
|
8
|
-
export { ModalConfirm, ModalForm, ModalDetail, ModalShelf, ModalPorter,
|
|
8
|
+
export { ModalConfirm, ModalForm, ModalDetail, ModalShelf, ModalPorter,
|
|
9
|
+
/** @deprecated 改用 `ModalConfirm`(modal 族统一前缀) */
|
|
10
|
+
ModalConfirm as ConfirmModal,
|
|
11
|
+
/** @deprecated 改用 `ModalForm`(modal 族统一前缀) */
|
|
12
|
+
ModalForm as FormModal,
|
|
13
|
+
/** @deprecated 改用 `ModalDetail`(modal 族统一前缀) */
|
|
14
|
+
ModalDetail as DetailModal, };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { ModalLevel, ShelfController, ShelfItem } from './modal-shelf-types';
|
|
3
|
+
/** ShelfController 内部扩展:额外暴露渲染用活跃实例列表 */
|
|
3
4
|
export interface ShelfControllerInternal extends ShelfController {
|
|
5
|
+
/** 渲染用:当前活跃实例列表(多例数组) */
|
|
4
6
|
items: Ref<ShelfItem[]>;
|
|
5
7
|
}
|
|
8
|
+
/** 创建一个架子逻辑控制器(纯逻辑,无 DOM 依赖,可单测) */
|
|
6
9
|
export declare function createShelfController(level: ModalLevel): ShelfControllerInternal;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { ModalLevel } from './modal-shelf-types';
|
|
2
|
+
/**
|
|
3
|
+
* 层级合法性:app 必最顶层;page 祖先允许 app/page(父子页面嵌套场景),仅禁止 custom;custom 可嵌套任何(含 custom 套 custom)。
|
|
4
|
+
* 非法仅开发期 console.error,不抛、不静默。
|
|
5
|
+
*/
|
|
2
6
|
export declare function assertLevelHierarchy(level: ModalLevel, ancestorLevels: ModalLevel[]): void;
|
|
@@ -1,39 +1,73 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
+
/** 架子层级 */
|
|
2
3
|
export type ModalLevel = "app" | "page" | "custom";
|
|
4
|
+
/** 同 key 再 evoke 策略:recreate=关旧重建(默认);update=已开则整体替换 props 不 remount */
|
|
3
5
|
export type ModalSameKeyStrategy = "recreate" | "update";
|
|
6
|
+
/**
|
|
7
|
+
* 业务侧 declare merge 扩展此接口声明每个弹窗的业务 props 契约。
|
|
8
|
+
* 例:declare module "@done-coding/admin-core" {
|
|
9
|
+
* interface ModalShelfMap { detail: { id: string; onConfirm?: (r: unknown) => void } }
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
4
12
|
export interface ModalShelfMap {
|
|
5
13
|
}
|
|
14
|
+
/** 架子注入给弹窗组件的契约(业务 payload 经单 payload 对象传入) */
|
|
6
15
|
export interface ModalInjectedProps<P = Record<string, unknown>> {
|
|
16
|
+
/** v-model:show 受控可见性 */
|
|
7
17
|
show: boolean;
|
|
18
|
+
/** 优雅关闭(隐藏→等动画→移除),=== EvokeHandle.close */
|
|
8
19
|
closeFn: () => void;
|
|
20
|
+
/** 立即移除(无动画) */
|
|
9
21
|
removeFn: () => void;
|
|
22
|
+
/** 业务 payload(ModalShelfMap[key]) */
|
|
10
23
|
payload: P;
|
|
11
24
|
}
|
|
25
|
+
/** evoke 返回的命令式句柄;只绑稳定 nsKey,调用时现查当前实例(不闭包 id) */
|
|
12
26
|
export interface EvokeHandle {
|
|
27
|
+
/** 优雅关闭该 nsKey 当前实例;无则 no-op */
|
|
13
28
|
close: () => void;
|
|
29
|
+
/** 对该 nsKey 当前实例受控增量合并 payload(不 remount);无则 no-op */
|
|
14
30
|
update: (partialPayload: Record<string, unknown>) => void;
|
|
15
31
|
}
|
|
32
|
+
/** 注册项(扁平,无 options 包裹,无 isSingle——v1 仅多例) */
|
|
16
33
|
export interface RegisterEntry<K extends keyof ModalShelfMap = keyof ModalShelfMap> {
|
|
34
|
+
/** 弹窗逻辑 key */
|
|
17
35
|
key: K;
|
|
36
|
+
/** 组件或懒工厂(() => import()) */
|
|
18
37
|
component: Component | (() => Promise<Component>);
|
|
38
|
+
/** 目标架子:app/page 名称代指,或直接持 ShelfInstance */
|
|
19
39
|
shelf: "app" | "page" | ShelfInstance;
|
|
40
|
+
/** 同 key 再 evoke 策略,缺省 "recreate" */
|
|
20
41
|
sameKeyStrategy?: ModalSameKeyStrategy;
|
|
21
42
|
}
|
|
43
|
+
/** 架子内部一条活跃实例 */
|
|
22
44
|
export interface ShelfItem {
|
|
45
|
+
/** 架子内部自增唯一 id,用作渲染 :key */
|
|
23
46
|
id: number;
|
|
47
|
+
/** porter 命名空间后的注册键 p{porterUid}:{key} */
|
|
24
48
|
nsKey: string;
|
|
49
|
+
/** 组件或懒工厂 */
|
|
25
50
|
component: Component | (() => Promise<Component>);
|
|
51
|
+
/** 业务 payload */
|
|
26
52
|
payload: Record<string, unknown>;
|
|
53
|
+
/** v-model:show */
|
|
27
54
|
show: boolean;
|
|
55
|
+
/** close 排定的关闭动画定时器句柄;remove 立即移除前 [MUST] clearTimeout 它 */
|
|
28
56
|
timer?: ReturnType<typeof setTimeout>;
|
|
29
57
|
}
|
|
58
|
+
/** ModalShelf 实例 expose === 它 provide 的 controller */
|
|
30
59
|
export interface ShelfController {
|
|
60
|
+
/** 本架子层级 */
|
|
31
61
|
level: ModalLevel;
|
|
62
|
+
/** 唤起一条;同 nsKey 先 remove(立即) 旧再新建 */
|
|
32
63
|
evoke: (nsKey: string, component: Component | (() => Promise<Component>), options: {
|
|
33
64
|
payload: Record<string, unknown>;
|
|
34
65
|
sameKeyStrategy?: ModalSameKeyStrategy;
|
|
35
66
|
}) => EvokeHandle;
|
|
67
|
+
/** 立即移除(不等动画),支持单个或批量 */
|
|
36
68
|
remove: (nsKey: string | string[]) => void;
|
|
69
|
+
/** 优雅关闭某条(触发隐藏 → 动画结束 → 移除) */
|
|
37
70
|
close: (item: ShelfItem) => void;
|
|
38
71
|
}
|
|
72
|
+
/** ModalShelf 实例引用类型别名(用于 RegisterEntry.shelf 直接持实例定位 custom 架子) */
|
|
39
73
|
export type ShelfInstance = ShelfController;
|
|
@@ -1,41 +1,102 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
import { ExtractFormStringifyFromObject, FormItemConfigList, FormMainProps } from '../form';
|
|
3
3
|
import { FormProps } from 'element-plus';
|
|
4
|
+
/** 详情页类型 */
|
|
4
5
|
export type DetailType = "add" | "edit" | "read";
|
|
6
|
+
/** 弹层形态:'modal'=居中弹窗(默认)|'drawer'=抽屉 */
|
|
5
7
|
export type ModalLayerType = "modal" | "drawer";
|
|
8
|
+
/** drawer 弹出方向(仅 layerType='drawer' 生效) */
|
|
6
9
|
export type ModalDirection = "rtl" | "ltr" | "ttb" | "btt";
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* ModalForm —— 通用"弹窗 + 表单 + 校验提交"原语(modal 族,可独立使用)。
|
|
12
|
+
* ModalDetail 是它的 CRUD 预设薄壳(内部委托 ModalForm);本原语无 add/edit 语义。
|
|
13
|
+
* 长表单超高时内容区自动滚动(继承 ModalConfirm __content 的 overflow)。
|
|
14
|
+
*/
|
|
15
|
+
export interface ModalFormProps<
|
|
16
|
+
/** 表单标准结构模型 */
|
|
17
|
+
PO extends Record<string, any>,
|
|
18
|
+
/** 表单需转换的部分结构模型 */
|
|
19
|
+
SO extends Record<string, any>> {
|
|
8
20
|
show: boolean;
|
|
21
|
+
/** 表单数据(模型) */
|
|
9
22
|
data: PO;
|
|
23
|
+
/** 表单配置 */
|
|
10
24
|
list: FormItemConfigList<PO, SO>;
|
|
25
|
+
/**
|
|
26
|
+
* 提交方法:入参 = FormMain 序列化后的数据(校验通过后调用)。
|
|
27
|
+
* 返回 Promise——reject 则弹窗不关闭(沿用 ModalConfirm confirmHandler 契约)、
|
|
28
|
+
* resolve 则关窗并 emit submitSuccess。
|
|
29
|
+
*/
|
|
11
30
|
submitFn: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any> | any;
|
|
31
|
+
/**
|
|
32
|
+
* 标题(非必传)。字符串或返回 VNode[] 的渲染函数;透传 ModalConfirm。
|
|
33
|
+
* 未传则标题区为空(消费方也可用 #header 插槽自绘)。
|
|
34
|
+
*/
|
|
12
35
|
title?: string | (() => VNode[]);
|
|
36
|
+
/** 弹窗宽度(drawer 形态复用为抽屉尺寸 size) */
|
|
13
37
|
width?: number | string;
|
|
38
|
+
/** 弹层形态:modal 居中弹窗(默认)/ drawer 抽屉;透传 ModalConfirm */
|
|
14
39
|
layerType?: ModalLayerType;
|
|
40
|
+
/** drawer 弹出方向(仅 layerType='drawer' 生效),默认 rtl */
|
|
15
41
|
direction?: ModalDirection;
|
|
42
|
+
/** 表单整体布局 */
|
|
16
43
|
formLayout?: FormMainProps<PO, SO>["layout"];
|
|
44
|
+
/** elForm 其他属性 */
|
|
17
45
|
formProps?: Partial<FormProps>;
|
|
46
|
+
/** 表单行 gutter,透传给 FormMain */
|
|
18
47
|
formRowGutter?: number;
|
|
48
|
+
/** 表单 label 宽度 */
|
|
19
49
|
labelWidth?: string;
|
|
50
|
+
/** header(标题区)下分割线,默认 true(ModalForm 族默认带分割线,区别于裸 ModalConfirm) */
|
|
20
51
|
headerDivider?: boolean;
|
|
52
|
+
/** footer(操作区)上分割线,默认 true */
|
|
21
53
|
footerDivider?: boolean;
|
|
22
54
|
}
|
|
55
|
+
/** @deprecated 改用 {@link ModalFormProps}(modal 族统一前缀);老名保留兼容,后续大版本移除 */
|
|
23
56
|
export type FormModalProps<PO extends Record<string, any>, SO extends Record<string, any>> = ModalFormProps<PO, SO>;
|
|
24
|
-
|
|
57
|
+
/**
|
|
58
|
+
* ModalDetail —— CRUD 预设薄壳(内部委托 ModalForm,只保留 add/edit 语义)。
|
|
59
|
+
*/
|
|
60
|
+
export interface ModalDetailProps<
|
|
61
|
+
/** 表单标准结构模型 */
|
|
62
|
+
PO extends Record<string, any>,
|
|
63
|
+
/** 表单需转换的部分结构模型 */
|
|
64
|
+
SO extends Record<string, any>> {
|
|
65
|
+
/** 表单数据 */
|
|
25
66
|
data: PO;
|
|
67
|
+
/** 表单配置 */
|
|
26
68
|
list: FormItemConfigList<PO, SO>;
|
|
69
|
+
/** 表单类型 */
|
|
27
70
|
type: DetailType;
|
|
71
|
+
/**
|
|
72
|
+
* 自定义标题渲染(非必传)。设置后优先使用,返回的 VNode[] 整体替换内置标题;
|
|
73
|
+
* 未设置则回退到内置 `titleFinal`(新增[subTitle] / 编辑[subTitle])。
|
|
74
|
+
*/
|
|
28
75
|
title?: () => VNode[];
|
|
76
|
+
/**
|
|
77
|
+
* 标题
|
|
78
|
+
* 最终表现为:新增[标题]、编辑[标题]
|
|
79
|
+
*/
|
|
29
80
|
subTitle?: string;
|
|
30
81
|
show: boolean;
|
|
82
|
+
/** 新增api */
|
|
31
83
|
addApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
|
|
84
|
+
/** 编辑api */
|
|
32
85
|
editApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
|
|
86
|
+
/** 弹窗宽度 */
|
|
33
87
|
width?: number | string;
|
|
88
|
+
/** 表单整体布局 */
|
|
34
89
|
formLayout?: FormMainProps<PO, SO>["layout"];
|
|
90
|
+
/** elForm其他属性 */
|
|
35
91
|
formProps?: Partial<FormProps>;
|
|
92
|
+
/** 表单行 gutter,透传给 FormMain */
|
|
36
93
|
formRowGutter?: number;
|
|
94
|
+
/** 表单 label 宽度 */
|
|
37
95
|
labelWidth?: string;
|
|
96
|
+
/** 弹层形态:modal 居中弹窗(默认)/ drawer 抽屉;透传 ModalForm → ModalConfirm */
|
|
38
97
|
layerType?: ModalLayerType;
|
|
98
|
+
/** drawer 弹出方向(仅 layerType='drawer' 生效),默认 rtl */
|
|
39
99
|
direction?: ModalDirection;
|
|
40
100
|
}
|
|
101
|
+
/** @deprecated 改用 {@link ModalDetailProps}(modal 族统一前缀);老名保留兼容,后续大版本移除 */
|
|
41
102
|
export type DetailModalProps<PO extends Record<string, any>, SO extends Record<string, any>> = ModalDetailProps<PO, SO>;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { ColProps } from 'element-plus';
|
|
2
2
|
import { FormItemConfigList } from '../form';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
+
/** 子 FormMain 数据(= 父 item 草稿的嵌套对象,子 in-place 改草稿) */
|
|
4
5
|
data: Record<string, any>;
|
|
6
|
+
/** 子表单配置列表 */
|
|
5
7
|
list: FormItemConfigList;
|
|
6
8
|
layout?: Partial<ColProps>;
|
|
7
9
|
rowGutter?: number;
|
|
8
10
|
submitText?: string;
|
|
9
11
|
cancelText?: string;
|
|
12
|
+
/** 校验通过后的业务提交(helper 内 wire submitFn(草稿) → closeEdit);返回 Promise 自动 loading */
|
|
10
13
|
submit?: () => Promise<unknown> | unknown;
|
|
14
|
+
/** 取消编辑(helper 内 wire closeEdit) */
|
|
11
15
|
cancel?: () => void;
|
|
16
|
+
/** 父 item 代表 span(P3 rebase 算因子用;helper 经 resolveLayoutSpan(layout) 传入) */
|
|
12
17
|
parentSpan?: number;
|
|
18
|
+
/** 是否叠本层嵌套布局 rebase(缺省 true;false = 逆向逃生口,layout 原样直透) */
|
|
13
19
|
rebase?: boolean;
|
|
14
20
|
};
|
|
15
21
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { PanelItemConfigList } from './types';
|
|
2
2
|
import { ColProps, CardProps } from 'element-plus';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
+
/** 子 PanelMain 数据(= 父 item value,嵌套对象) */
|
|
4
5
|
data: Record<string, any>;
|
|
6
|
+
/** 子 PanelMain 配置列表 */
|
|
5
7
|
list: PanelItemConfigList;
|
|
8
|
+
/** 子项是否包 Card,缺省继承 PanelMain 默认 */
|
|
6
9
|
itemCard?: boolean | Partial<CardProps & {
|
|
7
10
|
lastMarginBottom?: string;
|
|
8
11
|
}>;
|
|
9
12
|
layout?: Partial<ColProps>;
|
|
10
13
|
rowGutter?: number;
|
|
14
|
+
/** 父 item 代表 span(P3 rebase 算因子用;helper 经 resolveLayoutSpan(layout) 传入) */
|
|
11
15
|
parentSpan?: number;
|
|
16
|
+
/** 是否叠本层嵌套布局 rebase(缺省 true;false = 逆向逃生口,layout 原样直透) */
|
|
12
17
|
rebase?: boolean;
|
|
13
18
|
};
|
|
14
19
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
@@ -2,16 +2,37 @@ import { ColProps } from 'element-plus';
|
|
|
2
2
|
import { PanelItemConfig, PanelScopeBase } from './types';
|
|
3
3
|
import { FormItemConfigList } from '../form';
|
|
4
4
|
export interface NestPanelFormOptions {
|
|
5
|
+
/** 父 item key */
|
|
5
6
|
key: string;
|
|
7
|
+
/** 父 item label */
|
|
6
8
|
label?: string;
|
|
9
|
+
/** 子 FormMain 配置列表(吃嵌套子对象) */
|
|
7
10
|
list: FormItemConfigList;
|
|
11
|
+
/** 父 item 栅格布局 */
|
|
8
12
|
layout?: Partial<ColProps>;
|
|
13
|
+
/** 子表单行间距 */
|
|
9
14
|
rowGutter?: number;
|
|
15
|
+
/** 提交按钮文案 */
|
|
10
16
|
submitText?: string;
|
|
17
|
+
/** 取消按钮文案 */
|
|
11
18
|
cancelText?: string;
|
|
19
|
+
/** 是否可编辑,缺省 true */
|
|
12
20
|
editable?: boolean | ((scope: PanelScopeBase) => boolean);
|
|
21
|
+
/** 单字段提交:校验通过后回流草稿到父数据(panel 既有 submitFn 语义) */
|
|
13
22
|
submitFn: PanelItemConfig["submitFn"];
|
|
23
|
+
/** 只读态展示渲染;缺省走 PanelItem 默认(纯文本 data[key]) */
|
|
14
24
|
render?: PanelItemConfig["render"];
|
|
25
|
+
/** 是否叠本层嵌套布局 rebase(P3,缺省 true;false = 逆向逃生口,子层 layout 原样直透) */
|
|
15
26
|
rebase?: boolean;
|
|
16
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* 生成「父 panel item 编辑态内嵌子 FormMain」的 PanelItemConfig(C3 配套 helper)
|
|
30
|
+
* ----
|
|
31
|
+
* 走 editorRender(优先级高于 editorConfig,panel/types.ts L65-77)挂 PanelItemNestForm:
|
|
32
|
+
* - 编辑态:PanelEditSwitch 进编辑时深克隆草稿(scope.data),子 FormMain 绑草稿嵌套对象
|
|
33
|
+
* in-place 编辑(不穿透真实 data,ADR-5 panel 分支);
|
|
34
|
+
* - 提交:组件内 validateChild 通过 → 本 helper wire 的 submit(`submitFn(草稿) → closeEdit`)回流;
|
|
35
|
+
* - 取消:closeEdit 关编辑态,草稿丢弃,下次进编辑重新克隆。
|
|
36
|
+
* editorConfig 与 editorRender 互斥——C3 用 editorRender,同一 item [MUST NOT] 再配 editorConfig。
|
|
37
|
+
*/
|
|
17
38
|
export declare function nestPanelForm(options: NestPanelFormOptions): PanelItemConfig;
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { ColProps, CardProps } from 'element-plus';
|
|
2
2
|
import { PanelItemConfig, PanelItemConfigList } from './types';
|
|
3
3
|
export interface NestPanelItemOptions {
|
|
4
|
+
/** 父 item key */
|
|
4
5
|
key: string;
|
|
6
|
+
/** 父 item label */
|
|
5
7
|
label?: string;
|
|
8
|
+
/** 子 PanelMain 配置列表(吃嵌套子对象) */
|
|
6
9
|
list: PanelItemConfigList;
|
|
10
|
+
/** 父 item 栅格布局 */
|
|
7
11
|
layout?: Partial<ColProps>;
|
|
12
|
+
/** 子 PanelMain 子项是否包 Card */
|
|
8
13
|
itemCard?: boolean | Partial<CardProps & {
|
|
9
14
|
lastMarginBottom?: string;
|
|
10
15
|
}>;
|
|
16
|
+
/** 子 PanelMain 行间距 */
|
|
11
17
|
rowGutter?: number;
|
|
18
|
+
/** 是否叠本层嵌套布局 rebase(P3,缺省 true;false = 逆向逃生口,子层 layout 原样直透) */
|
|
12
19
|
rebase?: boolean;
|
|
13
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* 生成「父 panel item 内嵌子 PanelMain」的 PanelItemConfig(C2 配套 helper)
|
|
23
|
+
* ----
|
|
24
|
+
* 降低业务方手写 h(PanelItemNestPanel) 噪音:传 key/label/子 list 即得一个满足
|
|
25
|
+
* PanelItemConfig 的纯展示配置项,render 出口挂 PanelItemNestPanel(嵌套对象只读展示)。
|
|
26
|
+
* 值贯通:render scope.value(= data[key] 嵌套对象)作子 PanelMain.data。
|
|
27
|
+
*/
|
|
14
28
|
export declare function nestPanelItem(options: NestPanelItemOptions): PanelItemConfig;
|
|
@@ -1,51 +1,102 @@
|
|
|
1
1
|
import { CSSProperties, VNode } from 'vue';
|
|
2
2
|
import { ColProps, CardProps } from 'element-plus';
|
|
3
3
|
import { ExtractFormStringifyFromObject, FormDataInfo, FormItemConfig, FormSubmitPanelProps } from '../form';
|
|
4
|
+
/**
|
|
5
|
+
* 通用作用于
|
|
6
|
+
* -----
|
|
7
|
+
* 用于 render 、editorRender 及 判断
|
|
8
|
+
*/
|
|
4
9
|
export interface PanelScopeBase<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
10
|
+
/** 原始数据(只读消费,[MUST NOT] 在 render 内修改) */
|
|
5
11
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
12
|
+
/** data[config.key] */
|
|
6
13
|
value: any;
|
|
14
|
+
/** 配置项 */
|
|
7
15
|
config: PanelItemConfig<PO, SO>;
|
|
8
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Panel render 作用域
|
|
19
|
+
* -----
|
|
20
|
+
* 应用于 render \ editorRender
|
|
21
|
+
*/
|
|
9
22
|
export interface PanelRenderScope<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> extends PanelScopeBase<PO, SO> {
|
|
23
|
+
/** 是否编辑态 */
|
|
10
24
|
editing: boolean;
|
|
25
|
+
/** 请求 PanelMain 调用 refreshFn;仅用于 render/editorRender 自管刷新,不处理 editorConfig 提交成功 */
|
|
11
26
|
refresh?: () => Promise<unknown> | void;
|
|
27
|
+
/** 结束编辑态 */
|
|
12
28
|
closeEdit?: () => void;
|
|
13
29
|
}
|
|
30
|
+
/** Panel 配置项 */
|
|
14
31
|
export interface PanelItemConfig<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
32
|
+
/** 数据键 */
|
|
15
33
|
key: string;
|
|
34
|
+
/** 标签,非必填 */
|
|
16
35
|
label?: string;
|
|
36
|
+
/** 隐藏标签;展示态 label 不渲染(编辑态走 editorConfig 时 label 已由 PanelItem 层接管并 labelHide,此项不影响编辑态) */
|
|
17
37
|
labelHide?: boolean;
|
|
38
|
+
/** 标签样式(挂载到 PanelItem 外层 label 元素) */
|
|
18
39
|
labelStyle?: CSSProperties | string;
|
|
40
|
+
/** 标签位置;默认 inline(label 在值左侧),top = label 在值上方 */
|
|
19
41
|
labelPosition?: "inline" | "top";
|
|
42
|
+
/** 栅格布局,复用 resolveFormLayout 语义;缺省继承 PanelMain.layout */
|
|
20
43
|
layout?: Partial<ColProps>;
|
|
44
|
+
/** 隐藏 */
|
|
21
45
|
hide?: boolean | ((scope: PanelScopeBase<PO, SO>) => boolean);
|
|
46
|
+
/** 只读渲染;缺省=纯文本 data[key] */
|
|
22
47
|
render?: string | Record<string, any> | ((scope: PanelRenderScope<PO, SO>) => VNode[]);
|
|
48
|
+
/** 是否可就地编辑 */
|
|
23
49
|
editable?: boolean | ((scope: PanelScopeBase<PO, SO>) => boolean);
|
|
50
|
+
/** 编辑器渲染;仅 editable 时需要
|
|
51
|
+
* ----
|
|
52
|
+
* 使用优先级高于 editorConfig
|
|
53
|
+
*/
|
|
24
54
|
editorRender?: string | Record<string, any> | ((scope: PanelRenderScope<PO, SO>) => VNode[]);
|
|
55
|
+
/** 编辑器表单配置;仅 editable 时需要
|
|
56
|
+
* ----
|
|
57
|
+
* 使用优先级次于 editorRender
|
|
58
|
+
* 但是优先级高于 render 即编辑态时使用render
|
|
59
|
+
*/
|
|
25
60
|
editorConfig?: Omit<FormItemConfig<PO, SO>, "key" | "label" | "labelHide" | "layout">;
|
|
61
|
+
/** 单字段提交;仅 editable 时需要。draft = 深克隆副本 */
|
|
26
62
|
submitFn?: FormSubmitPanelProps<PO, SO>["submitFn"];
|
|
27
63
|
}
|
|
64
|
+
/** Panel 配置项列表 */
|
|
28
65
|
export type PanelItemConfigList<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> = PanelItemConfig<PO, SO>[];
|
|
66
|
+
/** PanelMain props */
|
|
29
67
|
export interface PanelMainProps<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
30
68
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
69
|
+
/** 行水平间距 */
|
|
31
70
|
rowGutter?: number;
|
|
32
71
|
layout?: Partial<ColProps>;
|
|
72
|
+
/** P3 嵌套 rebase 累乘因子(缺省 1 = 顶级行为不变,向后兼容)。由联结薄壳算出后传子 PanelMain */
|
|
33
73
|
layoutScale?: number;
|
|
34
74
|
list: PanelItemConfigList<PO, SO>;
|
|
75
|
+
/** item是否包括Card */
|
|
35
76
|
itemCard?: boolean | Partial<CardProps & {
|
|
77
|
+
/** 最后一个 margin bottom */
|
|
36
78
|
lastMarginBottom?: string;
|
|
37
79
|
}>;
|
|
38
|
-
|
|
80
|
+
/** render/editorRender 内 scope.refresh 的回调;editorConfig 提交成功请监听 submitSuccess */
|
|
81
|
+
refreshFn?: (currentStringifyData: any,
|
|
82
|
+
/** 当前的key */
|
|
83
|
+
key: string) => Promise<unknown> | void;
|
|
39
84
|
}
|
|
85
|
+
/** PanelItem props */
|
|
40
86
|
export interface PanelItemProps<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
|
|
41
87
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
42
88
|
config: PanelItemConfig<PO, SO>;
|
|
89
|
+
/** render/editorRender 内 scope.refresh 的回调;不承接 submitSuccess */
|
|
43
90
|
refreshFn?: (currentStringifyData: FormDataInfo<PO, SO>["stringifyData"]) => Promise<unknown> | void;
|
|
44
91
|
}
|
|
92
|
+
/** PanelEditSwitch props */
|
|
45
93
|
export interface PanelEditSwitchProps<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> extends Partial<Pick<FormSubmitPanelProps<PO, SO>, "submitFn">> {
|
|
46
94
|
data: ExtractFormStringifyFromObject<PO, SO>;
|
|
95
|
+
/** panel 配置项 */
|
|
47
96
|
config: Omit<PanelItemConfig<PO, SO>, "editorConfig"> & {
|
|
97
|
+
/** 缺失的key label 由 PanelItem补齐 */
|
|
48
98
|
editorConfig?: FormItemConfig<PO, SO>;
|
|
49
99
|
};
|
|
100
|
+
/** 是否可编辑 */
|
|
50
101
|
editable?: boolean;
|
|
51
102
|
}
|