@done-coding/admin-core 0.3.1-alpha.0 → 0.4.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 (79) hide show
  1. package/es/bridge/index.mjs +83 -27
  2. package/es/components/app-layout/AppBody.vue.mjs +7 -0
  3. package/es/components/app-layout/AppBody.vue2.mjs +89 -0
  4. package/es/components/app-layout/AppBreadcrumb.vue.mjs +7 -0
  5. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +58 -0
  6. package/es/components/app-layout/AppFooter.vue.mjs +7 -0
  7. package/es/components/app-layout/AppFooter.vue2.mjs +17 -0
  8. package/es/components/app-layout/AppHeader.vue.mjs +7 -0
  9. package/es/components/app-layout/AppHeader.vue2.mjs +99 -0
  10. package/es/components/app-layout/AppLayout.vue.mjs +7 -0
  11. package/es/components/app-layout/AppLayout.vue2.mjs +130 -0
  12. package/es/components/app-layout/AppPage.vue.mjs +7 -0
  13. package/es/components/app-layout/AppPage.vue2.mjs +39 -0
  14. package/es/components/app-layout/AppSidebar.vue.mjs +7 -0
  15. package/es/components/app-layout/AppSidebar.vue2.mjs +97 -0
  16. package/es/components/app-layout/index.mjs +32 -0
  17. package/es/components/display/ActionBtnGroup.vue.mjs +61 -0
  18. package/es/components/display/ActionBtnGroup.vue2.mjs +4 -0
  19. package/es/components/display/index.mjs +13 -11
  20. package/es/components/misc/ActionBtn.vue.mjs +84 -65
  21. package/es/components/misc/ActionConfirm.vue.mjs +1 -1
  22. package/es/components/misc/ActionConfirm.vue2.mjs +77 -71
  23. package/es/components/misc/SelectModule.vue.mjs +55 -0
  24. package/es/components/misc/SelectModule.vue2.mjs +4 -0
  25. package/es/components/modal/ConfirmModal.vue.mjs +1 -1
  26. package/es/components/modal/ConfirmModal.vue2.mjs +13 -12
  27. package/es/components/modal/modal-shelf-hierarchy.mjs +4 -6
  28. package/es/components/table/ToolbarButtons.vue.mjs +10 -40
  29. package/es/index.mjs +165 -132
  30. package/es/inject/key.mjs +15 -6
  31. package/es/router/guard/index.mjs +31 -0
  32. package/es/router/guard/login.mjs +4 -0
  33. package/es/router/guard/permission.mjs +4 -0
  34. package/es/store/app.mjs +103 -0
  35. package/es/store/router-permission.mjs +65 -0
  36. package/es/store/user.mjs +52 -52
  37. package/es/style.css +1 -1
  38. package/package.json +2 -2
  39. package/types/bridge/index.d.ts +180 -76
  40. package/types/components/app-layout/AppBody.vue.d.ts +45 -0
  41. package/types/components/app-layout/AppBreadcrumb.vue.d.ts +25 -0
  42. package/types/components/app-layout/AppFooter.vue.d.ts +2 -0
  43. package/types/components/app-layout/AppHeader.vue.d.ts +55 -0
  44. package/types/components/app-layout/AppLayout.vue.d.ts +76 -0
  45. package/types/components/app-layout/AppPage.vue.d.ts +54 -0
  46. package/types/components/app-layout/AppSidebar.vue.d.ts +51 -0
  47. package/types/components/app-layout/index.d.ts +27 -0
  48. package/types/components/app-layout/types.d.ts +43 -0
  49. package/types/components/display/ActionBtnGroup.vue.d.ts +16 -0
  50. package/types/components/display/TabsHeader.vue.d.ts +8 -8
  51. package/types/components/display/index.d.ts +10 -1
  52. package/types/components/display/types.d.ts +42 -1
  53. package/types/components/misc/ActionBtn.vue.d.ts +17 -23
  54. package/types/components/misc/ActionConfirm.vue.d.ts +56 -27
  55. package/types/components/misc/SelectModule.vue.d.ts +2 -0
  56. package/types/components/misc/index.d.ts +2 -1
  57. package/types/components/misc/types.d.ts +35 -26
  58. package/types/components/modal/ConfirmModal.vue.d.ts +19 -2
  59. package/types/components/modal/modal-shelf-hierarchy.d.ts +1 -1
  60. package/types/components/table/TableToolbar.vue.d.ts +8 -8
  61. package/types/components/table/types.d.ts +10 -12
  62. package/types/helpers/index.d.ts +10 -3
  63. package/types/index.d.ts +4 -1
  64. package/types/inject/key.d.ts +25 -0
  65. package/types/router/guard/index.d.ts +21 -0
  66. package/types/router/guard/login.d.ts +5 -0
  67. package/types/router/guard/permission.d.ts +5 -0
  68. package/types/router/guard/types.d.ts +15 -0
  69. package/types/router/index.d.ts +1 -0
  70. package/types/store/app.d.ts +149 -0
  71. package/types/store/index.d.ts +2 -0
  72. package/types/store/router-permission.d.ts +80 -0
  73. package/types/store/user.d.ts +11 -9
  74. /package/es/{helpers → bridge}/route.mjs +0 -0
  75. /package/es/{helpers → bridge}/state.mjs +0 -0
  76. /package/es/{helpers → bridge}/storage.mjs +0 -0
  77. /package/types/{helpers → bridge}/route.d.ts +0 -0
  78. /package/types/{helpers → bridge}/state.d.ts +0 -0
  79. /package/types/{helpers → bridge}/storage.d.ts +0 -0
@@ -0,0 +1,27 @@
1
+ import { Plugin } from 'vue';
2
+ import { default as AppLayout } from './AppLayout.vue';
3
+ import { default as AppHeader } from './AppHeader.vue';
4
+ import { default as AppSidebar } from './AppSidebar.vue';
5
+ import { default as AppBody } from './AppBody.vue';
6
+ import { default as AppBreadcrumb } from './AppBreadcrumb.vue';
7
+ import { default as AppFooter } from './AppFooter.vue';
8
+ import { default as AppPage } from './AppPage.vue';
9
+
10
+ export {
11
+ /** 应用根布局容器:props 注入 adminBridge / appStore / userStore,provide 给子 layout */
12
+ AppLayout,
13
+ /** 应用头部布局:模块菜单 + 深色切换;#left / #right slot 给业务自渲染 */
14
+ AppHeader,
15
+ /** 应用侧栏布局:菜单树 + 折叠按钮;#top / #bottom slot 给业务自渲染 */
16
+ AppSidebar,
17
+ /** 应用主体布局:面包屑 + RouterView keepAlive;#footer slot */
18
+ AppBody,
19
+ /** 应用面包屑(AppBody 内部消费,业务侧通常不直接使用) */
20
+ AppBreadcrumb,
21
+ /** 应用底部布局 */
22
+ AppFooter,
23
+ /** 业务页面容器:fullViewport 满视口 + ModalShelf page level */
24
+ AppPage, };
25
+ /** app-layout 子目录批量 install plugin(同 form/menu/display 子桶范式) */
26
+ export declare const appLayoutInstall: Plugin;
27
+ export * from './types';
@@ -0,0 +1,43 @@
1
+ import { createAppStore, createUserStore } from '../../store';
2
+ import { AdminBridge } from '../../bridge';
3
+
4
+ /**
5
+ * AppLayout 族 app store 消费契约(props/inject 切面)。
6
+ *
7
+ * 调用方通过 props 注入 store 实例,AppLayout 集中 provide,子组件
8
+ * (AppBody / AppHeader / AppSidebar / AppFooter)经 `APP_LAYOUT_APP_STORE_KEY`
9
+ * inject 自取——废除原 AppLayout → 子组件 `:style` / `:showBreadcrumb` props 透传链。
10
+ *
11
+ * 类型由 `createAppStore` 工厂 ReturnType 推导(store 实例完整类型),自动跟随
12
+ * 工厂演化、零手维护字段清单——放弃 narrow 换取 0 维护成本。`UserInfo` /
13
+ * `LoginParams` 泛型未显式实例化时走工厂 default `Record<string, any>` /
14
+ * `unknown`(D-a 原则——core 不锁 UserInfo 具体 shape)。
15
+ *
16
+ * app-layout 族下沉 core 后此 slice 仍是 props/inject 契约——core 端无法直接
17
+ * `useAppStore()`,必须由业务侧通过 props 注入。
18
+ */
19
+ export type AppLayoutAppStoreSlice<UserInfo = Record<string, any>> = ReturnType<ReturnType<typeof createAppStore<UserInfo>>>;
20
+ /**
21
+ * AppLayout 族 user store 消费契约(props/inject 切面)。
22
+ *
23
+ * 调用方通过 props 注入,AppLayout 集中 provide,子组件(AppHeader)经
24
+ * `APP_LAYOUT_USER_STORE_KEY` inject 自取。
25
+ *
26
+ * 类型由 `createUserStore` 工厂 ReturnType 推导。`UserInfo` 走工厂 default
27
+ * `Record<string, any>`(D-a 原则——core 不锁 UserInfo 具体 shape),业务侧
28
+ * (如 AppLayout watermark content / AppHeader user dropdown)按需 cast 为本应用
29
+ * 具体 shape。
30
+ */
31
+ export type AppLayoutUserStoreSlice<UserInfo = Record<string, any>> = ReturnType<ReturnType<typeof createUserStore<UserInfo>>>;
32
+ /**
33
+ * AppLayout 族 admin bridge 消费契约(props/inject 切面,#7.6 期挂载)。
34
+ *
35
+ * AppLayout 通过 `props.adminBridge` 注入 + `provide(APP_LAYOUT_BRIDGE_KEY, ...)`,
36
+ * 子组件(AppBody / AppHeader / AppSidebar / AppLayout 自身菜单派生)inject 自取——
37
+ * 与 `AppLayoutAppStoreSlice` / `AppLayoutUserStoreSlice` 完全对称范式。
38
+ *
39
+ * 仅暴露 layout 子组件实际读取的字段:12 readonly 配置属性 + 2 派生方法
40
+ * (getRoutes / generateRouteMetaRawTree)。loginApi / refreshToken 等 auth
41
+ * 面不通过本 slice 暴露(业务侧通过 appAdminBridge 直读)。
42
+ */
43
+ export type AppLayoutBridgeSlice = Pick<AdminBridge, "APP_BASE_INFO" | "APP_ENV_INFO" | "APP_CACHE_CONFIG" | "APP_LAYOUT_HEADER_CONFIG" | "APP_LAYOUT_FOOTER_CONFIG" | "APP_LAYOUT_SIDEBAR_CONFIG" | "APP_LAYOUT_BREADCRUMB_CONFIG" | "APP_LAYOUT_BODY_CONFIG" | "APP_LAYOUT_CONFIG" | "APP_ROUTER_META_DEFAULT_CONFIG" | "APP_ROUTER_CONFIG" | "APP_ROUTER_PATHS_CONFIG" | "APP_THEME_CONFIG" | "getRoutes" | "generateRouteMetaRawTree">;
@@ -0,0 +1,16 @@
1
+ import { ActionBtnConfigItem, ActionBtnSize } from './types';
2
+
3
+ declare const _default: <Ctx = void>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & {
5
+ configs?: ActionBtnConfigItem<Ctx>[];
6
+ ctx: Ctx;
7
+ defaultSize?: ActionBtnSize;
8
+ }, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
9
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
10
+ attrs: any;
11
+ slots: ReturnType<() => {}>;
12
+ emit: typeof __VLS_emit;
13
+ }>) => import('vue').VNode & {
14
+ __ctx?: Awaited<typeof __VLS_setup>;
15
+ };
16
+ export default _default;
@@ -6,27 +6,27 @@ declare function __VLS_template(): Partial<Record<string, (_: {
6
6
  }) => any>>;
7
7
  declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
8
8
  activeKey: import('vue').PropType<string>;
9
- level: {
10
- type: globalThis.PropType<number>;
11
- default: number;
12
- };
13
9
  tabs: {
14
10
  type: globalThis.PropType<TabsMainItem[]>;
15
11
  required: true;
16
12
  };
13
+ level: {
14
+ type: globalThis.PropType<number>;
15
+ default: number;
16
+ };
17
17
  variant: {
18
18
  type: globalThis.PropType<TabsHeaderVariant>;
19
19
  };
20
20
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
21
21
  activeKey: import('vue').PropType<string>;
22
- level: {
23
- type: globalThis.PropType<number>;
24
- default: number;
25
- };
26
22
  tabs: {
27
23
  type: globalThis.PropType<TabsMainItem[]>;
28
24
  required: true;
29
25
  };
26
+ level: {
27
+ type: globalThis.PropType<number>;
28
+ default: number;
29
+ };
30
30
  variant: {
31
31
  type: globalThis.PropType<TabsHeaderVariant>;
32
32
  };
@@ -2,6 +2,7 @@ import { Plugin } from 'vue';
2
2
  import { default as WatchSize } from './WatchSize.vue';
3
3
  import { default as TabsMain } from './TabsMain.vue';
4
4
  import { default as HeightProvider } from './HeightProvider.vue';
5
+ import { default as ActionBtnGroup } from './ActionBtnGroup.vue';
5
6
 
6
7
  export {
7
8
  /** 尺寸监听容器:debounce 测默认槽内容宽/高,`@height-change` / `@size-change` 上报 */
@@ -16,6 +17,14 @@ TabsMain,
16
17
  * 默认槽 `{ height }` 暴露。Fragment 双根,不撑开自身,不 inject 不 provide。
17
18
  * 消费方 [MUST] 用 slot scope `:height` 自设容器高。
18
19
  */
19
- HeightProvider, };
20
+ HeightProvider,
21
+ /**
22
+ * 配置式按钮组(泛型 Ctx 由消费方决定形状)。
23
+ * - 二选一渲染:`actionBtnProps`(走 ActionBtn 带 confirm/beforeOpen)优先 / `props`(走 ElButton)。
24
+ * - `render` 对标 FormItem.render 三态:string | Component | (props:{ctx})=>VNode。
25
+ * - `show` 函数过滤;`defaultSize` 给基础 size,业务侧显式 size 优先。
26
+ * - 典型消费:TableMain.toolbar 内置 / 表格 OPERATE 列(BL-5 推广)。
27
+ */
28
+ ActionBtnGroup, };
20
29
  export declare const displayInstall: Plugin;
21
30
  export * from './types';
@@ -1,5 +1,46 @@
1
- import { Component, ComputedRef } from 'vue';
1
+ import { Component, ComputedRef, VNode } from 'vue';
2
2
 
3
+ /** ActionBtnGroup 按钮 size 枚举(对齐 element-plus ElButton size) */
4
+ export type ActionBtnSize = "large" | "default" | "small";
5
+ /**
6
+ * ActionBtnGroup 单项配置
7
+ * ---
8
+ * 泛型 Ctx 由消费方决定形状(toolbar 传 ToolbarButtonContext / 表格 OPERATE 列传 row 上下文 / 等)。
9
+ * 与 FormItem.render 三态对标:string(全局组件名)/ Component(对象/异步)/ functional((props) => VNode)。
10
+ */
11
+ export interface ActionBtnConfigItem<Ctx = void> {
12
+ /** 唯一标识 */
13
+ key: string;
14
+ /** ActionBtn props 工厂(含 confirmConfig / beforeOpen / ElButton 全透传),与 props 二选一优先 */
15
+ actionBtnProps?: (ctx: Ctx) => Record<string, any>;
16
+ /** ElButton props 工厂,与 actionBtnProps 二选一 */
17
+ props?: (ctx: Ctx) => Record<string, any>;
18
+ /** 按钮文字;render 缺省时回退 */
19
+ label?: string;
20
+ /**
21
+ * 按钮内容 render(对标 FormItem.render 三态);优先级高于 label。
22
+ * - string:全局注册组件名
23
+ * - Component:对象/异步组件
24
+ * - functional:`(props: { ctx }) => VNode`——通过 `:ctx` prop 拿到上下文
25
+ */
26
+ render?: string | Component | ((props: {
27
+ ctx: Ctx;
28
+ }) => VNode);
29
+ /** 显示条件,返回 false 跳过该项;缺省视为 true */
30
+ show?: (ctx: Ctx) => boolean;
31
+ }
32
+ /** ActionBtnGroup props */
33
+ export interface ActionBtnGroupProps<Ctx = void> {
34
+ /** 按钮配置列表 */
35
+ configs?: ActionBtnConfigItem<Ctx>[];
36
+ /** 渲染上下文(透传给每项 actionBtnProps / props / render / show) */
37
+ ctx: Ctx;
38
+ /**
39
+ * 默认按钮 size——未传时不强加 size(沿用 ElButton 自身默认);
40
+ * 传入时作为基础 size 注入每项,业务侧 actionBtnProps / props 返回对象内显式 size 优先。
41
+ */
42
+ defaultSize?: ActionBtnSize;
43
+ }
3
44
  /** HeightProvider props——见组件 JSDoc */
4
45
  export interface HeightProviderProps {
5
46
  /** px,视口可用高度(必填) */
@@ -1,26 +1,20 @@
1
- import { ActionBtnProps } from './types';
1
+ import { ActionBtnConfirmConfig } from './types';
2
2
 
3
- declare function __VLS_template(): {
4
- default?(_: {}): any;
3
+ declare const _default: <T = void>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
5
+ readonly onClick?: ((evt: MouseEvent) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & (Omit<import('element-plus').ButtonProps, "loading"> & {
7
+ confirmMode?: import('./types').ActionConfirmMode;
8
+ confirmConfig?: ActionBtnConfirmConfig | ((data: T) => ActionBtnConfirmConfig) | undefined;
9
+ beforeOpen?: (() => Promise<T>) | undefined;
10
+ }), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
11
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
12
+ attrs: any;
13
+ slots: ReturnType<() => {
14
+ default?(_: {}): any;
15
+ }>;
16
+ emit: (evt: "click", evt: MouseEvent) => void;
17
+ }>) => import('vue').VNode & {
18
+ __ctx?: Awaited<typeof __VLS_setup>;
5
19
  };
6
- declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ActionBtnProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- click: (evt: MouseEvent) => void;
8
- }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ActionBtnProps>>> & Readonly<{
9
- onClick?: ((evt: MouseEvent) => any) | undefined;
10
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
11
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
20
  export default _default;
13
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
- type __VLS_TypePropsToRuntimeProps<T> = {
15
- [K in keyof T]-?: {} extends Pick<T, K> ? {
16
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
- } : {
18
- type: import('vue').PropType<T[K]>;
19
- required: true;
20
- };
21
- };
22
- type __VLS_WithTemplateSlots<T, S> = T & {
23
- new (): {
24
- $slots: S;
25
- };
26
- };
@@ -1,39 +1,68 @@
1
- import { ActionConfirmProps } from './types';
1
+ import { ActionConfirmTextResolver } from './types';
2
2
 
3
3
  declare function __VLS_template(): {
4
4
  default?(_: {}): any;
5
5
  };
6
- declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ActionConfirmProps>, {
7
- confirmText: string;
8
- cancelText: string;
9
- }>>, {
10
- run: () => Promise<boolean>;
11
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ActionConfirmProps>, {
12
- confirmText: string;
13
- cancelText: string;
14
- }>>> & Readonly<{}>, {
6
+ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
7
+ show: import('vue').PropType<boolean>;
8
+ type: {
9
+ type: globalThis.PropType<"" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text">;
10
+ };
11
+ title: {
12
+ type: globalThis.PropType<ActionConfirmTextResolver>;
13
+ };
14
+ content: {
15
+ type: globalThis.PropType<ActionConfirmTextResolver>;
16
+ };
17
+ cancelText: {
18
+ type: globalThis.PropType<string>;
19
+ default: string;
20
+ };
21
+ confirmText: {
22
+ type: globalThis.PropType<string>;
23
+ default: string;
24
+ };
25
+ mode: {
26
+ type: globalThis.PropType<import('./types').ActionConfirmMode>;
27
+ required: true;
28
+ };
29
+ submitFn: {
30
+ type: globalThis.PropType<() => void | Promise<void>>;
31
+ required: true;
32
+ };
33
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
34
+ show: import('vue').PropType<boolean>;
35
+ type: {
36
+ type: globalThis.PropType<"" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text">;
37
+ };
38
+ title: {
39
+ type: globalThis.PropType<ActionConfirmTextResolver>;
40
+ };
41
+ content: {
42
+ type: globalThis.PropType<ActionConfirmTextResolver>;
43
+ };
44
+ cancelText: {
45
+ type: globalThis.PropType<string>;
46
+ default: string;
47
+ };
48
+ confirmText: {
49
+ type: globalThis.PropType<string>;
50
+ default: string;
51
+ };
52
+ mode: {
53
+ type: globalThis.PropType<import('./types').ActionConfirmMode>;
54
+ required: true;
55
+ };
56
+ submitFn: {
57
+ type: globalThis.PropType<() => void | Promise<void>>;
58
+ required: true;
59
+ };
60
+ }>> & Readonly<{}>, {
15
61
  cancelText: string;
16
62
  confirmText: string;
17
63
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
64
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
19
65
  export default _default;
20
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
- type __VLS_TypePropsToRuntimeProps<T> = {
22
- [K in keyof T]-?: {} extends Pick<T, K> ? {
23
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
- } : {
25
- type: import('vue').PropType<T[K]>;
26
- required: true;
27
- };
28
- };
29
- type __VLS_WithDefaults<P, D> = {
30
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
31
- default: D[K];
32
- }> : P[K];
33
- };
34
- type __VLS_Prettify<T> = {
35
- [K in keyof T]: T[K];
36
- } & {};
37
66
  type __VLS_WithTemplateSlots<T, S> = T & {
38
67
  new (): {
39
68
  $slots: S;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -6,9 +6,10 @@ import { default as ActionButtonDanger } from './ActionButtonDanger.vue';
6
6
  import { default as ActionButtonWarn } from './ActionButtonWarn.vue';
7
7
  import { default as ActionBtn } from './ActionBtn.vue';
8
8
  import { default as ActionConfirm } from './ActionConfirm.vue';
9
+ import { default as SelectModule } from './SelectModule.vue';
9
10
 
10
11
  export * from './types';
11
- export { TriggerAutoImport, AutoRefresh, ActionBtn, ActionConfirm };
12
+ export { TriggerAutoImport, AutoRefresh, ActionBtn, ActionConfirm, SelectModule, };
12
13
  /**
13
14
  * @deprecated 改用 {@link ActionBtn}——`ActionBtn` 通过 `confirmConfig` 一体化承载
14
15
  * loading 自动接管 + 同步/异步 confirm-gate(popconfirm / message-box 两种 mode),
@@ -12,13 +12,14 @@ export type ActionConfirmTextResolver = string | (() => string | VNode[]);
12
12
  /**
13
13
  * ActionBtn 的确认配置(嵌套对象;无此配置则为普通按钮,不触发确认)。
14
14
  *
15
- * ⚠️ 瞬时用户激活限制:配置本项后,点击与原始 `@click` handler 之间隔了一次
16
- * 异步确认。原始点击的瞬时用户激活(transient user activation)此时已过期
17
- * (注意:事件对象 `isTrusted` 仍为 true,失效的是激活窗口而非事件本身)。
18
- * confirm 后的 handler [MUST NOT] 调用依赖用户激活的 API——`window.open`、
19
- * `navigator.clipboard.*`、`requestFullscreen` 等会被浏览器拦截。需要这类
20
- * 操作时改用不带 confirmConfig 的 ActionBtn / 普通按钮。此为 confirm-gate
21
- * 模式固有代价,组件层无法绕过。
15
+ * ⚠️ 瞬时用户激活限制:`confirmConfig` `beforeOpen` 均会异步打断点击的瞬时
16
+ * 用户激活窗口(transient user activation)——confirm 后 / beforeOpen 之后的
17
+ * handler 与原始点击之间隔了一次异步等待,原始激活此时已过期(注意:事件对象
18
+ * `isTrusted` 仍为 true,失效的是激活窗口而非事件本身)。故 confirm /
19
+ * beforeOpen 之后的 handler [MUST NOT] 调用依赖瞬时用户激活的 API——
20
+ * `window.open`、`navigator.clipboard.*`、`requestFullscreen` 等会被浏览器
21
+ * 拦截。需要这类操作时改用无 `confirmConfig` 且无 `beforeOpen` 的 ActionBtn /
22
+ * 普通按钮。此为 confirm-gate / async-prefetch 模式固有代价,组件层无法绕过。
22
23
  */
23
24
  export interface ActionBtnConfirmConfig {
24
25
  /** 确认标题 */
@@ -34,22 +35,37 @@ export interface ActionBtnConfirmConfig {
34
35
  }
35
36
  /**
36
37
  * ActionBtn 组件 props。
37
- * 完全兼容 ElButton(继承 ButtonProps),仅一处改写 + 两个增量:
38
+ * 完全兼容 ElButton(继承 ButtonProps),仅一处改写 + 三个增量:
38
39
  * - `loading` 被 Omit:有意的 ElButton 不兼容,唯一接管项——loading 由组件内部
39
- * 独占,对接异步 confirm 的进行态(innerLoading),对外不可设置。
40
+ * 独占,对接异步 confirm / beforeOpen 的进行态(innerLoading),对外不可设置。
40
41
  * - `disabled` 原生透传,不改写不扩展。
41
- * - 增量:`confirmMode` / `confirmConfig`。无 `ctx`、无泛型——动态数据由调用方
42
- * 在自身作用域闭包捕获,组件不做数据回环。
42
+ * - 增量:`confirmMode` / `confirmConfig` / `beforeOpen`。
43
+ * - 泛型 `T`:由 `beforeOpen` 返回值反推,并透传给 `confirmConfig` 函数形态的
44
+ * 入参;未传 `beforeOpen` 时默认 `T = void`,函数形态的 `data = undefined`。
43
45
  */
44
- export type ActionBtnProps = Omit<ButtonProps, "loading"> & {
46
+ export type ActionBtnProps<T = void> = Omit<ButtonProps, "loading"> & {
45
47
  /** 确认交互形态,仅在 confirmConfig 存在时生效,默认 "popconfirm" */
46
48
  confirmMode?: ActionConfirmMode;
47
- /** 确认配置;存在时点击需经确认闸门,确认后才触发 click */
48
- confirmConfig?: ActionBtnConfirmConfig;
49
+ /**
50
+ * 确认配置;存在时点击需经确认闸门,确认后才触发 click。
51
+ * - 对象形态:静态确认配置(向后兼容)。
52
+ * - 函数形态:`(data: T) => ActionBtnConfirmConfig`,`data` 来自 `beforeOpen`
53
+ * 返回值;无 `beforeOpen` 时 `data = undefined`(T 默认 `void`)。
54
+ */
55
+ confirmConfig?: ActionBtnConfirmConfig | ((data: T) => ActionBtnConfirmConfig);
56
+ /**
57
+ * 点击后、弹层前的异步预取钩子。
58
+ * - 返回值类型 `T` 反推给 `confirmConfig` 函数形态的入参。
59
+ * - 失败时静默退出(不弹层、不触发 `@click` handler);调用方 [MUST] 在内部
60
+ * 自行 catch 并显示反馈(如 `ElMessage.error`),忘记 catch 会"点了没反应"。
61
+ * - 期间按钮显 loading 态(`innerLoading`);同 `confirmConfig` 一样消耗
62
+ * 瞬时用户激活(详见 {@link ActionBtnConfirmConfig} 顶部注释)。
63
+ */
64
+ beforeOpen?: () => Promise<T>;
49
65
  };
50
66
  /**
51
67
  * ActionConfirm 组件 props(扁平,confirm 原语;可独立于 ActionBtn 消费)。
52
- * 触发元素由默认 slot 提供;确认流程经 defineExpose 的 `run()` 命令式驱动。
68
+ * 触发元素由默认 slot 提供;弹层可见性由 `v-model:show` 声明式驱动。
53
69
  */
54
70
  export interface ActionConfirmProps {
55
71
  /** 确认交互形态 */
@@ -65,16 +81,9 @@ export interface ActionConfirmProps {
65
81
  /** 确认按钮 type */
66
82
  type?: ButtonProps["type"];
67
83
  /**
68
- * 被确认闸住的待执行动作。用户点确认后调用;返回 Promise 时弹层保持不关、
69
- * 确认按钮 loading,直到 settle(成功或失败均结束)。
70
- */
71
- action: () => unknown | Promise<unknown>;
72
- }
73
- /** ActionConfirm 实例(defineExpose) */
74
- export interface ActionConfirmInstance {
75
- /**
76
- * 驱动一次确认流程。
77
- * @returns 已确认并完成 action → true;用户取消 → false
84
+ * 点击确认后调用。返回 Promise 时确认按钮 loading + 弹层保持不关,
85
+ * **仅成功(fulfill)才关闭弹层**;失败(reject 或同步 throw)时清 loading
86
+ * 弹层保持打开,错误由 `submitFn` 内部自行 catch 反馈。
78
87
  */
79
- run: () => Promise<boolean>;
88
+ submitFn: () => void | Promise<void>;
80
89
  }
@@ -1,3 +1,5 @@
1
+ import { ButtonProps } from 'element-plus';
2
+
1
3
  declare function __VLS_template(): {
2
4
  title?(_: {}): any;
3
5
  default?(_: {}): any;
@@ -28,6 +30,12 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
28
30
  closeOnClickModal?: boolean;
29
31
  /** 是否使用确认按钮loading */
30
32
  useLoading?: boolean;
33
+ /**
34
+ * 确认按钮 type(对齐 element-plus ElButton type)。
35
+ * 默认 'primary';danger / warning / success / info 全枚举均支持,
36
+ * 与 ActionConfirm popconfirm 模式按钮颜色行为对齐。
37
+ */
38
+ type?: ButtonProps["type"];
31
39
  }>, {
32
40
  showClose: boolean;
33
41
  cancelText: string;
@@ -37,6 +45,7 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
37
45
  reverse: boolean;
38
46
  closeOnPressEscape: boolean;
39
47
  closeOnClickModal: boolean;
48
+ type: string;
40
49
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
41
50
  "update:show": (value: boolean) => void;
42
51
  }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
@@ -60,6 +69,12 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
60
69
  closeOnClickModal?: boolean;
61
70
  /** 是否使用确认按钮loading */
62
71
  useLoading?: boolean;
72
+ /**
73
+ * 确认按钮 type(对齐 element-plus ElButton type)。
74
+ * 默认 'primary';danger / warning / success / info 全枚举均支持,
75
+ * 与 ActionConfirm popconfirm 模式按钮颜色行为对齐。
76
+ */
77
+ type?: ButtonProps["type"];
63
78
  }>, {
64
79
  showClose: boolean;
65
80
  cancelText: string;
@@ -69,15 +84,17 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
69
84
  reverse: boolean;
70
85
  closeOnPressEscape: boolean;
71
86
  closeOnClickModal: boolean;
87
+ type: string;
72
88
  }>>> & Readonly<{
73
89
  "onUpdate:show"?: ((value: boolean) => any) | undefined;
74
90
  }>, {
75
- width: number | string;
76
- reverse: boolean;
91
+ type: "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text";
77
92
  showClose: boolean;
78
93
  cancelText: string | (() => VNode);
79
94
  confirmText: string | (() => VNode);
80
95
  hiddenCancel: boolean;
96
+ width: number | string;
97
+ reverse: boolean;
81
98
  closeOnPressEscape: boolean;
82
99
  closeOnClickModal: boolean;
83
100
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,7 +1,7 @@
1
1
  import { ModalLevel } from './modal-shelf-types';
2
2
 
3
3
  /**
4
- * 层级合法性:app 必最顶层;page 祖先仅允许 app;custom 可嵌套任何(含 custom 套 custom)。
4
+ * 层级合法性:app 必最顶层;page 祖先允许 app/page(父子页面嵌套场景),仅禁止 custom;custom 可嵌套任何(含 custom 套 custom)。
5
5
  * 非法仅开发期 console.error,不抛、不静默。
6
6
  */
7
7
  export declare function assertLevelHierarchy(level: ModalLevel, ancestorLevels: ModalLevel[]): void;
@@ -2,14 +2,14 @@ import { ExportType, TableExportContext, TableMainInstance } from './types';
2
2
 
3
3
  declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
4
4
  isAutoRefresh: import('vue').PropType<boolean>;
5
- pageSize: {
6
- type: globalThis.PropType<number>;
7
- required: true;
8
- };
9
5
  loading: {
10
6
  type: globalThis.PropType<boolean>;
11
7
  required: true;
12
8
  };
9
+ pageSize: {
10
+ type: globalThis.PropType<number>;
11
+ required: true;
12
+ };
13
13
  showRefresh: {
14
14
  type: globalThis.PropType<boolean>;
15
15
  default: boolean;
@@ -52,14 +52,14 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
52
52
  };
53
53
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
54
54
  isAutoRefresh: import('vue').PropType<boolean>;
55
- pageSize: {
56
- type: globalThis.PropType<number>;
57
- required: true;
58
- };
59
55
  loading: {
60
56
  type: globalThis.PropType<boolean>;
61
57
  required: true;
62
58
  };
59
+ pageSize: {
60
+ type: globalThis.PropType<number>;
61
+ required: true;
62
+ };
63
63
  showRefresh: {
64
64
  type: globalThis.PropType<boolean>;
65
65
  default: boolean;
@@ -3,6 +3,7 @@ import { APP_API_LIST_MODEL_KEY_CONFIG, BuildListParams } from '../../config';
3
3
  import { DotToObject, UnionToIntersection } from '../../types';
4
4
  import { ExportColumnConfig } from '../../utils';
5
5
  import { ExtractPropTypes, VNode } from 'vue';
6
+ import { ActionBtnConfigItem } from '../display';
6
7
 
7
8
  /**
8
9
  * 表格请求参数
@@ -61,18 +62,15 @@ export interface ToolbarButtonContext<T extends Record<string, any> = Record<str
61
62
  total: number;
62
63
  };
63
64
  }
64
- /** toolbar 额外按钮配置 */
65
- export interface ToolbarButtonConfig<T extends Record<string, any> = Record<string, any>> {
66
- key: string;
67
- /** ElButton props,与 actionButtonProps 二选一 */
68
- props?: (ctx: ToolbarButtonContext<T>) => Record<string, any>;
69
- /** ActionButton props(含 data/tipContent),与 props 二选一 */
70
- actionButtonProps?: (ctx: ToolbarButtonContext<T>) => Record<string, any>;
71
- /** 按钮文字。btnRender 优先 */
72
- label?: string;
73
- /** 按钮内容 render,优先级高于 label */
74
- btnRender?: (ctx: ToolbarButtonContext<T>) => VNode[];
75
- }
65
+ /**
66
+ * toolbar 额外按钮配置(BL-4 / 2026-05-26 重定义为 ActionBtnConfigItem 别名)
67
+ * ---
68
+ * 跨族迁移到 display/ActionBtnGroup 后,本类型沦为通用配置的 toolbar 特化别名;
69
+ * 字段集与 ActionBtnConfigItem 完全一致(key / actionBtnProps / props / label / render / show)。
70
+ * 旧的 VNode[] 返回函数字段已移除,render 三态(string | Component | functional)
71
+ * 对标 FormItem;升级路径见 MIGRATION.md BL-4 节。
72
+ */
73
+ export type ToolbarButtonConfig<T extends Record<string, any> = Record<string, any>> = ActionBtnConfigItem<ToolbarButtonContext<T>>;
76
74
  /** toolbar 可配置项(通过 TableMain 的 toolbar prop 传入) */
77
75
  export interface TableToolbarConfig {
78
76
  /** 是否显示刷新按钮,默认 true */
@@ -1,6 +1,13 @@
1
1
  export * from './form';
2
- export * from './storage';
3
- export * from './state';
4
- export * from './route';
5
2
  export * from './types';
6
3
  export * from './list-helper';
4
+ /** @deprecated 改用 appAdminBridge.useState() */
5
+ export { createUseState } from '../bridge/state';
6
+ /** @deprecated 改用 appAdminBridge.useState() */
7
+ export type { UseStateOptions } from '../bridge/state';
8
+ /** @deprecated 改用 appAdminBridge.generateRouteMetaRawTree() */
9
+ export { createGenerateRouteMetaRawTree } from '../bridge/route';
10
+ /** @deprecated 改用 appAdminBridge.generateRouteMetaRawTree() */
11
+ export type { RouteMetaDefaultConfig } from '../bridge/route';
12
+ /** @deprecated 改用 appAdminBridge.getStorage() */
13
+ export { createStorageWithNamespace } from '../bridge/storage';
package/types/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import { modalInstall } from './components/modal';
7
7
  import { tableInstall } from './components/table';
8
8
  import { listPageInstall } from './components/list-page';
9
9
  import { panelInstall } from './components/panel';
10
+ import { appLayoutInstall } from './components/app-layout';
10
11
 
11
12
  export * from './components/form';
12
13
  export * from './components/menu';
@@ -16,6 +17,8 @@ export * from './components/modal';
16
17
  export * from './components/table';
17
18
  export * from './components/list-page';
18
19
  export * from './components/panel';
20
+ export * from './components/app-layout';
21
+ export * from './router';
19
22
  export * from './utils';
20
23
  export * from './hooks';
21
24
  export * from './types';
@@ -24,5 +27,5 @@ export * from './inject';
24
27
  export * from './helpers';
25
28
  export * from './bridge';
26
29
  export * from './store';
27
- export { formInstall, menuInstall, displayInstall, miscInstall, modalInstall, tableInstall, listPageInstall, panelInstall, };
30
+ export { formInstall, menuInstall, displayInstall, miscInstall, modalInstall, tableInstall, listPageInstall, panelInstall, appLayoutInstall, };
28
31
  export declare const installComponents: Plugin;