@done-coding/admin-core 0.12.1 → 0.12.2

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 (128) hide show
  1. package/README.md +1 -48
  2. package/es/bridge/index.mjs +75 -72
  3. package/es/bridge/layout.mjs +51 -0
  4. package/es/bridge/theme/index.mjs +1 -1
  5. package/es/bridge/theme/persist.mjs +1 -1
  6. package/es/components/app-layout/AppAside.vue.mjs +2 -2
  7. package/es/components/app-layout/AppAside.vue2.mjs +27 -10
  8. package/es/components/app-layout/AppCollapseToggle.vue.mjs +7 -0
  9. package/es/components/app-layout/AppCollapseToggle.vue2.mjs +54 -0
  10. package/es/components/app-layout/AppFooter.vue.mjs +1 -1
  11. package/es/components/app-layout/AppHeader.vue.mjs +3 -3
  12. package/es/components/app-layout/AppHeader.vue2.mjs +1 -1
  13. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  14. package/es/components/app-layout/AppLayout.vue2.mjs +3 -3
  15. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  16. package/es/components/app-layout/AppSidebar.vue2.mjs +41 -61
  17. package/es/components/app-layout/AppTheme.vue.mjs +3 -3
  18. package/es/components/app-layout/viewport.mjs +3 -3
  19. package/es/components/display/TabsHeader.vue.mjs +4 -4
  20. package/es/components/form/FormItemNestForm.vue.mjs +2 -2
  21. package/es/components/form/FormItemNestFormList.vue.mjs +2 -2
  22. package/es/components/form/FormSubmitPanel.vue.mjs +1 -1
  23. package/es/components/form/FormVerifyImage.vue.mjs +1 -1
  24. package/es/components/table/TableToolbar.vue.mjs +3 -3
  25. package/es/hooks/{use-admin-theme-apply.mjs → use-theme-apply.mjs} +62 -62
  26. package/es/hooks/use-viewport-apply.mjs +39 -0
  27. package/es/index.mjs +88 -88
  28. package/es/inject/key.mjs +13 -13
  29. package/es/store/app.mjs +69 -62
  30. package/es/style.css +1 -1
  31. package/package.json +6 -8
  32. package/types/bridge/config-hook.d.ts +0 -68
  33. package/types/bridge/index.d.ts +18 -417
  34. package/types/bridge/layout.d.ts +25 -0
  35. package/types/bridge/plugin.d.ts +12 -30
  36. package/types/bridge/route.d.ts +1 -20
  37. package/types/bridge/state.d.ts +0 -14
  38. package/types/bridge/storage.d.ts +0 -9
  39. package/types/bridge/theme/index.d.ts +1 -8
  40. package/types/bridge/theme/persist.d.ts +3 -15
  41. package/types/bridge/theme/system-dark.d.ts +0 -12
  42. package/types/bridge/theme/types.d.ts +27 -265
  43. package/types/components/app-layout/AppAside.vue.d.ts +0 -1
  44. package/types/components/app-layout/AppCollapseToggle.vue.d.ts +11 -0
  45. package/types/components/app-layout/AppHeader.vue.d.ts +0 -3
  46. package/types/components/app-layout/AppLayout.vue.d.ts +0 -12
  47. package/types/components/app-layout/AppPage.vue.d.ts +0 -2
  48. package/types/components/app-layout/AppSidebar.vue.d.ts +0 -2
  49. package/types/components/app-layout/types.d.ts +2 -127
  50. package/types/components/app-layout/viewport.d.ts +2 -30
  51. package/types/components/data-view/DataListViewItem.vue.d.ts +0 -8
  52. package/types/components/data-view/index.d.ts +0 -4
  53. package/types/components/data-view/types.d.ts +0 -41
  54. package/types/components/data-view/utils.d.ts +0 -3
  55. package/types/components/display/TabsHeader.vue.d.ts +0 -2
  56. package/types/components/display/TabsMain.vue.d.ts +0 -2
  57. package/types/components/display/TabsRefineFlow.vue.d.ts +0 -1
  58. package/types/components/display/index.d.ts +1 -37
  59. package/types/components/display/types.d.ts +0 -131
  60. package/types/components/form/FormItemNestForm.vue.d.ts +0 -5
  61. package/types/components/form/FormItemNestFormList.vue.d.ts +0 -17
  62. package/types/components/form/FormVerifyCode.vue.d.ts +0 -9
  63. package/types/components/form/FormVerifyImage.vue.d.ts +0 -1
  64. package/types/components/form/form-search-utils.d.ts +0 -14
  65. package/types/components/form/nest-form-item-list.d.ts +0 -28
  66. package/types/components/form/nest-form-item.d.ts +0 -21
  67. package/types/components/form/nest-registry.d.ts +0 -14
  68. package/types/components/form/types.d.ts +8 -185
  69. package/types/components/form/use-form-submit.d.ts +0 -12
  70. package/types/components/form/use-nest-form-list.d.ts +0 -13
  71. package/types/components/form/use-nest-form.d.ts +0 -15
  72. package/types/components/form/use-nest-layout-scale.d.ts +0 -12
  73. package/types/components/form/utils.d.ts +1 -56
  74. package/types/components/list-page/ListPage.vue.d.ts +0 -6
  75. package/types/components/list-page/types.d.ts +2 -19
  76. package/types/components/misc/index.d.ts +1 -6
  77. package/types/components/misc/types.d.ts +0 -6
  78. package/types/components/modal/ConfirmModal.vue.d.ts +0 -10
  79. package/types/components/modal/modal-shelf-core.d.ts +0 -3
  80. package/types/components/modal/modal-shelf-hierarchy.d.ts +0 -4
  81. package/types/components/modal/modal-shelf-types.d.ts +0 -34
  82. package/types/components/modal/types.d.ts +1 -20
  83. package/types/components/panel/PanelItemNestForm.vue.d.ts +0 -6
  84. package/types/components/panel/PanelItemNestPanel.vue.d.ts +0 -5
  85. package/types/components/panel/nest-panel-form.d.ts +0 -21
  86. package/types/components/panel/nest-panel-item.d.ts +0 -14
  87. package/types/components/panel/types.d.ts +1 -49
  88. package/types/components/table/types.d.ts +9 -124
  89. package/types/config/list-model.d.ts +0 -29
  90. package/types/config/route.d.ts +0 -2
  91. package/types/helpers/form.d.ts +0 -5
  92. package/types/helpers/list-helper.d.ts +0 -26
  93. package/types/helpers/types.d.ts +0 -11
  94. package/types/hooks/activated.d.ts +0 -10
  95. package/types/hooks/feel-size.d.ts +0 -2
  96. package/types/hooks/index.d.ts +2 -2
  97. package/types/hooks/menus-dispatch.d.ts +0 -4
  98. package/types/hooks/timeout.d.ts +0 -4
  99. package/types/hooks/use-channel-viewport-height.d.ts +0 -14
  100. package/types/hooks/use-theme-apply.d.ts +11 -0
  101. package/types/hooks/use-viewport-apply.d.ts +8 -0
  102. package/types/inject/key.d.ts +2 -87
  103. package/types/router/guard/index.d.ts +0 -13
  104. package/types/router/guard/login.d.ts +0 -1
  105. package/types/router/guard/permission.d.ts +0 -1
  106. package/types/router/guard/types.d.ts +2 -5
  107. package/types/store/app.d.ts +10 -31
  108. package/types/store/router-permission.d.ts +2 -55
  109. package/types/store/user.d.ts +2 -26
  110. package/types/types/dot-path.d.ts +0 -8
  111. package/types/types/route.d.ts +0 -45
  112. package/types/types/utility-types.d.ts +0 -7
  113. package/types/utils/export.d.ts +1 -16
  114. package/types/utils/id.d.ts +0 -1
  115. package/types/utils/router.d.ts +0 -2
  116. package/types/utils/theme-scale.d.ts +0 -31
  117. package/types/utils/time.d.ts +0 -1
  118. package/docs/TECH_SNAPSHOT.md +0 -146
  119. package/docs/nested-config-paradigm.md +0 -80
  120. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/RETROSPECTIVE.md +0 -63
  121. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/design.md +0 -575
  122. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/landing-authorizations/2026-05-09-080900-/346/234/2371-/345/205/245/345/256/236/346/226/275/346/216/210/346/235/203.md +0 -107
  123. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/project-orchestration.md +0 -58
  124. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/requirements.md +0 -238
  125. package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/tasks.md +0 -290
  126. package/es/hooks/use-admin-viewport-apply.mjs +0 -39
  127. package/types/hooks/use-admin-theme-apply.d.ts +0 -34
  128. package/types/hooks/use-admin-viewport-apply.d.ts +0 -20
@@ -5,138 +5,53 @@ import { ExportColumnConfig } from '../../utils';
5
5
  import { ExtractPropTypes, VNode } from 'vue';
6
6
  import { ActionBtnConfigItem } from '../display';
7
7
  import { AutoRefreshGroupProps } from '../misc';
8
- /** 表格实例 */
9
8
  export type TableInstance = Pick<ElTableInstance, "clearSelection" | "getSelectionRows" | "toggleRowSelection" | "toggleAllSelection" | "toggleRowExpansion" | "setCurrentRow" | "clearSort" | "clearFilter" | "doLayout" | "sort" | "scrollTo" | "setScrollTop" | "setScrollLeft" | "columns" | "updateKeyChildren">;
10
- /** 表格分页信息 */
11
9
  export interface TablePageInfo {
12
- /** 每页数量 */
13
10
  pageSize: number;
14
- /** 当前页码 */
15
11
  currentPage: number;
16
- /** 数据总数(总记录数,非页数) */
17
12
  total: number;
18
13
  }
19
- /**
20
- * 表格请求参数
21
- * ---
22
- * 静态参数 SQ + KEY_CONFIG 推导出的 page.page / page.pageSize 嵌套
23
- */
24
- export type TableApiParams<
25
- /** 静态参数 */
26
- SQ extends Record<string, any> = Record<string, any>> = BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG, SQ>;
27
- /**
28
- * 表格响应结果
29
- * ---
30
- * items 列表 + page.totalRecord 总数(仅 2 字段子集,不带 page.page / page.pageSize)
31
- */
14
+ export type TableApiParams<SQ extends Record<string, any> = Record<string, any>> = BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG, SQ>;
32
15
  export type TableApiResult<T extends Record<string, any> = Record<string, any>> = UnionToIntersection<DotToObject<typeof APP_API_LIST_MODEL_KEY_CONFIG.LIST_KEY, T[]> | DotToObject<typeof APP_API_LIST_MODEL_KEY_CONFIG.TOTAL_KEY, number>>;
33
16
  export interface TableMainInstance {
34
- /** 如果关心是否结束(无论成功还是失败 甚至都未发起请求(比如某些状态机未满足)),那么可以await, 等待刷新调用给个结束 */
35
17
  refresh: (silent?: boolean) => Promise<unknown>;
36
- /** 如果关心是否结束(无论成功还是失败 甚至都未发起请求(比如某些状态机未满足)),那么可以await, 等待刷新调用给个结束 */
37
18
  reload: (slice?: boolean) => Promise<unknown>;
38
19
  getTableInstance: () => TableInstance | undefined;
39
20
  }
40
- /** 导出类型 */
41
21
  export type ExportType = "selected" | "current" | "all";
42
- /** TableMain 传给 toolbar 的导出上下文 */
43
- export interface TableExportContext<T extends Record<string, any> = Record<string, any>,
44
- /** 静态参数 */
45
- SQ extends Record<string, any> = Record<string, any>,
46
- /** 期望注入到表格列插槽上的额外内容 */
47
- F extends Record<string, any> = {}> {
48
- /** 可导出列 */
22
+ export interface TableExportContext<T extends Record<string, any> = Record<string, any>, SQ extends Record<string, any> = Record<string, any>, F extends Record<string, any> = {}> {
49
23
  columns: Pick<ElTableColumnProps<T, F>, "prop" | "label">[];
50
- /** 选中行数据 */
51
24
  selectedList: T[];
52
- /** 当前页数据 */
53
25
  currentPageList: T[];
54
- /** 分页 API */
55
26
  api: (params: TableApiParams<SQ>) => Promise<TableApiResult<T>>;
56
- /** 静态查询参数 */
57
27
  query?: SQ;
58
- /** 当前数据总数 */
59
28
  total: number;
60
- /** 是否包含 selection 列 */
61
29
  hasSelection: boolean;
62
30
  }
63
- /** toolbar 按钮渲染上下文 */
64
- export interface ToolbarButtonContext<T extends Record<string, any> = Record<string, any>,
65
- /** 静态参数 */
66
- SQ extends Record<string, any> = Record<string, any>,
67
- /** 期望注入到表格列插槽上的额外内容 */
68
- F extends Record<string, any> = {}> {
69
- /** TableMain expose */
31
+ export interface ToolbarButtonContext<T extends Record<string, any> = Record<string, any>, SQ extends Record<string, any> = Record<string, any>, F extends Record<string, any> = {}> {
70
32
  tableExpose: TableMainInstance;
71
- /** 表格是否加载中 */
72
33
  loading: boolean;
73
- /** 导出上下文 */
74
34
  exportContext: TableExportContext<T, SQ, F>;
75
- /** 当前选中行数据 */
76
35
  selectedList: T[];
77
- /** 分页信息 */
78
36
  pagination: TablePageInfo;
79
37
  }
80
- /**
81
- * toolbar 额外按钮配置(BL-4 / 2026-05-26 重定义为 ActionBtnConfigItem 别名)
82
- * ---
83
- * 跨族迁移到 display/ActionBtnGroup 后,本类型沦为通用配置的 toolbar 特化别名;
84
- * 字段集与 ActionBtnConfigItem 完全一致(key / actionBtnProps / props / label / render / show)。
85
- * 旧的 VNode[] 返回函数字段已移除,render 三态(string | Component | functional)
86
- * 对标 FormItem;升级路径见 MIGRATION.md BL-4 节。
87
- */
88
- export type ToolbarButtonConfig<T extends Record<string, any> = Record<string, any>,
89
- /** 静态参数 */
90
- SQ extends Record<string, any> = Record<string, any>,
91
- /** 期望注入到表格列插槽上的额外内容 */
92
- F extends Record<string, any> = {}> = ActionBtnConfigItem<ToolbarButtonContext<T, SQ, F>>;
93
- /** toolbar (被TableMain) 内部提供的props */
94
- export interface TableToolbarPrivateProps<T extends Record<string, any> = Record<string, any>,
95
- /** 静态参数 */
96
- SQ extends Record<string, any> = Record<string, any>,
97
- /** 期望注入到表格列插槽上的额外内容 */
98
- F extends Record<string, any> = {}> {
99
- /** TableMain expose */
38
+ export type ToolbarButtonConfig<T extends Record<string, any> = Record<string, any>, SQ extends Record<string, any> = Record<string, any>, F extends Record<string, any> = {}> = ActionBtnConfigItem<ToolbarButtonContext<T, SQ, F>>;
39
+ export interface TableToolbarPrivateProps<T extends Record<string, any> = Record<string, any>, SQ extends Record<string, any> = Record<string, any>, F extends Record<string, any> = {}> {
100
40
  tableExpose: TableMainInstance;
101
- /** 表格是否加载中 */
102
41
  loading: boolean;
103
- /** 导出上下文 */
104
42
  exportContext: TableExportContext<T, SQ, F>;
105
- /** 当前页码 */
106
43
  currentPage: number;
107
- /** 每页行数 */
108
44
  pageSize: number;
109
- /** 是否显示切换视图按钮,默认 false */
110
45
  showSwitchView?: boolean;
111
46
  }
112
- /** toolbar props */
113
- export interface TableToolbarProps<T extends Record<string, any> = Record<string, any>,
114
- /** 静态参数 */
115
- SQ extends Record<string, any> = Record<string, any>,
116
- /** 期望注入到表格列插槽上的额外内容 */
117
- F extends Record<string, any> = {}> extends TableToolbarPrivateProps<T, SQ, F>, Pick<AutoRefreshGroupProps, "showRefresh" | "showAutoRefresh"> {
118
- /**
119
- * 是否由前端导出,默认 true。
120
- * - true:toolbar 内部调 fetchListAll + exportCSV 完成导出
121
- * - false:走 exportFn 回调
122
- */
47
+ export interface TableToolbarProps<T extends Record<string, any> = Record<string, any>, SQ extends Record<string, any> = Record<string, any>, F extends Record<string, any> = {}> extends TableToolbarPrivateProps<T, SQ, F>, Pick<AutoRefreshGroupProps, "showRefresh" | "showAutoRefresh"> {
123
48
  exportByFe?: boolean;
124
- /** 导出方法。传入导出类型,返回 Promise。exportByFe 为 false 时必传 */
125
49
  exportFn?: (type: ExportType) => Promise<unknown>;
126
- /** 导出列配置。不传则不显示导出按钮。支持 valueMap 自定义取值 */
127
50
  exportColumns?: ExportColumnConfig<T>[];
128
- /** 左侧额外按钮 */
129
51
  leftExtraButtons?: ToolbarButtonConfig<T, SQ, F>[];
130
- /** 右侧额外按钮 */
131
52
  rightExtraButtons?: ToolbarButtonConfig<T, SQ, F>[];
132
53
  }
133
- /** toolbar 可配置项(通过 TableMain toolbar prop 传入) */
134
- export type TableToolbarConfig<T extends Record<string, any> = Record<string, any>,
135
- /** 静态参数 */
136
- SQ extends Record<string, any> = Record<string, any>,
137
- /** 期望注入到表格列插槽上的额外内容 */
138
- F extends Record<string, any> = {}> = Omit<TableToolbarProps<T, SQ, F>, keyof TableToolbarPrivateProps<T, SQ, F>>;
139
- /** 表格列默认作用域 */
54
+ export type TableToolbarConfig<T extends Record<string, any> = Record<string, any>, SQ extends Record<string, any> = Record<string, any>, F extends Record<string, any> = {}> = Omit<TableToolbarProps<T, SQ, F>, keyof TableToolbarPrivateProps<T, SQ, F>>;
140
55
  export interface TableColumnDefaultScope<T extends Record<string, any>, F extends Record<string, any>> {
141
56
  row: T;
142
57
  column: ElTableColumnProps<T, F>;
@@ -144,11 +59,9 @@ export interface TableColumnDefaultScope<T extends Record<string, any>, F extend
144
59
  injectInfo: F;
145
60
  exposeInfo: TableMainInstance;
146
61
  }
147
- /** 表格列组件props[$开头的属性vue报错] */
148
62
  export type TableColumnComponentProps<T extends Record<string, any>, F extends Record<string, any>> = Omit<TableColumnDefaultScope<T, F>, "$index"> & {
149
63
  _index: TableColumnDefaultScope<T, F>["$index"];
150
64
  };
151
- /** 表格列header作用域 */
152
65
  export interface TableColumnHeaderScope<T extends Record<string, any>, F extends Record<string, any>> {
153
66
  column: ElTableColumnProps<T, F>;
154
67
  $index: number;
@@ -156,9 +69,7 @@ export interface TableColumnHeaderScope<T extends Record<string, any>, F extends
156
69
  exposeInfo: TableMainInstance;
157
70
  }
158
71
  export type ExtractElTableColumnProps = ExtractPropTypes<typeof ETC>;
159
- export type ElTableColumnProps<T extends Record<string, any> = Record<string, any>,
160
- /** 期望注入到表格列插槽上的额外内容 */
161
- F extends Record<string, any> = {}> = Omit<ExtractPropTypes<typeof ETC>, "prop" | "columnKey" | "type"> & Partial<{
72
+ export type ElTableColumnProps<T extends Record<string, any> = Record<string, any>, F extends Record<string, any> = {}> = Omit<ExtractPropTypes<typeof ETC>, "prop" | "columnKey" | "type"> & Partial<{
162
73
  prop: Exclude<Extract<keyof T, string>, "custom-view-item" | "item"> | `${Uppercase<string>}`;
163
74
  columnKey: ElTableColumnProps<T, F>["prop"];
164
75
  type: "default" | "selection" | "index" | "expand";
@@ -166,54 +77,28 @@ F extends Record<string, any> = {}> = Omit<ExtractPropTypes<typeof ETC>, "prop"
166
77
  align: "left" | "center" | "right";
167
78
  headerAlign: "left" | "center" | "right";
168
79
  filterPlacement: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
169
- /** 插槽render */
170
80
  render: string | Record<string, any> | ((props: TableColumnComponentProps<T, F>) => VNode);
171
- /** 表头插槽render */
172
81
  headerRender: string | Record<string, any> | ((props: TableColumnHeaderScope<T, F>) => VNode);
173
82
  }>;
174
- export interface TableMainProps<
175
- /** 行数据结构 */
176
- T extends Record<string, any>,
177
- /** 静态参数 */
178
- SQ extends Record<string, any>,
179
- /** 期望注入到表格列插槽上的额外内容 */
180
- F extends Record<string, any>> {
181
- /** 展示分页器 */
83
+ export interface TableMainProps<T extends Record<string, any>, SQ extends Record<string, any>, F extends Record<string, any>> {
182
84
  showPager?: boolean;
183
- /** 是否显示切换视图按钮,默认 false */
184
85
  showSwitchView?: boolean;
185
- /** 是否显示 toolbar(顶层开关,默认 true,优先级高于 toolbar.leftFeatures / rightFeatures) */
186
86
  showToolbar?: boolean;
187
- /** toolbar 配置 */
188
87
  toolbar?: TableToolbarConfig<T, SQ, F>;
189
- /** 参数 */
190
88
  query?: SQ;
191
- /** 每页条数 */
192
89
  pageSizeInit?: number;
193
90
  pageSizeOptions?: number[];
194
91
  pageLayout?: string;
195
92
  rowKey: Extract<keyof T, string> | ((row: T) => string);
196
- /** 请求api */
197
93
  api: (params: TableApiParams<SQ>) => Promise<TableApiResult<T>>;
198
94
  tableProps?: Omit<TableProps<T>, "data" | "maxHeight" | "rowKey"> & Record<`on${Capitalize<string>}`, (...args: any[]) => any>;
199
95
  columns: ElTableColumnProps<T, F>[];
200
- /** 最大高度 */
201
96
  maxHeight?: number;
202
- /** @deprecated 表头背景色
203
- * ----
204
- * 外部通过 --el-table-header-bg-color 自行设置 或者 通过同意修改主题色
205
- */
206
97
  headerColor?: string;
207
- /** 精细化布局 */
208
98
  refine?: boolean;
209
- /** 精细化预留高度 */
210
99
  refineReduceHeight?: number;
211
- /** 给插槽注入的方法 */
212
100
  injectInfo?: F;
213
- /** 数据视口最大高度最小值 */
214
101
  dataViewMaxHeightMinValue?: number;
215
- /** 视口可用高度(优先级高于 BODY_CONTENT_VIEWPORT_HEIGHT 老链 inject,低于 parentChannel inject);未传时回退 inject 链 + fallback 500 */
216
102
  viewportHeight?: number;
217
- /** 父级 tabs 族 channel 标识(setup 期 Symbol.for 快照,变更 console.error 忽略);命中后高度从父级 inject 取,优先级最高 */
218
103
  parentChannel?: string;
219
104
  }
@@ -1,49 +1,20 @@
1
1
  import { DotToObject, UnionToIntersection } from '../types';
2
- /**
3
- * 列表 KEY 配置接口
4
- * ---
5
- * 约束消费方传入的 KEY_CONFIG 对象 shape,后续 BuildListModel / BuildListParams 工具基于本接口推导
6
- */
7
2
  export interface ListModelKeyConfig {
8
3
  PAGE_SIZE_KEY: string;
9
4
  CURRENT_PAGE_KEY: string;
10
5
  TOTAL_KEY: string;
11
6
  LIST_KEY: string;
12
7
  }
13
- /**
14
- * 基于 KEY_CONFIG 联合推导完整列表响应模型
15
- * ---
16
- * @example
17
- * BuildListModel<typeof APP_API_LIST_MODEL_KEY_CONFIG, User>
18
- * -> { items: User[]; page: { page: number; pageSize: number; totalRecord: number } }
19
- */
20
8
  export type BuildListModel<KC extends ListModelKeyConfig, T> = UnionToIntersection<DotToObject<KC["LIST_KEY"], T[]> | DotToObject<KC["TOTAL_KEY"], number> | DotToObject<KC["CURRENT_PAGE_KEY"], number> | DotToObject<KC["PAGE_SIZE_KEY"], number>>;
21
- /**
22
- * 基于 KEY_CONFIG 联合推导列表请求参数模型
23
- * ---
24
- * @example
25
- * BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG, { keyword?: string }>
26
- * -> { keyword?: string } & { page: { page: number; pageSize: number } }
27
- */
28
9
  export type BuildListParams<KC extends ListModelKeyConfig, P extends Record<string, any> = Record<string, any>> = P & UnionToIntersection<DotToObject<KC["CURRENT_PAGE_KEY"], number> | DotToObject<KC["PAGE_SIZE_KEY"], number>>;
29
- /** 应用接口列表模型配置(core 单一来源) */
30
10
  export declare const APP_API_LIST_MODEL_KEY_CONFIG: Readonly<{
31
- /** 当前页码 key */
32
11
  CURRENT_PAGE_KEY: "page.page";
33
- /** 每页条数 key */
34
12
  PAGE_SIZE_KEY: "page.pageSize";
35
- /** 总数 key */
36
13
  TOTAL_KEY: "page.totalRecord";
37
- /** 数据列表 key */
38
14
  LIST_KEY: "items";
39
15
  }>;
40
- /** 应用接口列表模型 */
41
16
  export type AppApiListModel<T = any> = BuildListModel<typeof APP_API_LIST_MODEL_KEY_CONFIG, T>;
42
- /** 应用接口列表分页参数 key */
43
17
  export type AppApiListPageParamsKey = typeof APP_API_LIST_MODEL_KEY_CONFIG.PAGE_SIZE_KEY | typeof APP_API_LIST_MODEL_KEY_CONFIG.CURRENT_PAGE_KEY;
44
- /** 应用接口列表 排除分页参数的 key */
45
18
  export type AppApiListNoPageParamsKey = Exclude<string, AppApiListPageParamsKey>;
46
- /** 应用接口列表请求参数模型 */
47
19
  export type AppApiListParamsModel<P extends Record<AppApiListNoPageParamsKey, any> = Record<AppApiListNoPageParamsKey, any>> = BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG, Partial<P>>;
48
- /** 应用接口列表请求参数模型(排除分页参数) */
49
20
  export type AppApiListParamsNoPageParams<P extends BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG>> = Omit<AppApiListParamsModel<P>, keyof UnionToIntersection<DotToObject<(typeof APP_API_LIST_MODEL_KEY_CONFIG)["CURRENT_PAGE_KEY"], number> | DotToObject<(typeof APP_API_LIST_MODEL_KEY_CONFIG)["PAGE_SIZE_KEY"], number>>>;
@@ -1,4 +1,2 @@
1
- /** 模块级别的路由 */
2
1
  export declare const ROUTE_MODULE_LEVEL = 1;
3
- /** TabsMain replaceQuery 同步到路由时的 query key */
4
2
  export declare const TabsMainReplaceQueryKey = "_tab";
@@ -1,10 +1,5 @@
1
1
  import { FormItemRule } from 'element-plus';
2
- /**
3
- * 密码规则
4
- */
5
2
  export declare const passwordRule: FormItemRule;
6
3
  export declare const getConfirmPasswordRule: (getPassword: () => string) => FormItemRule;
7
- /** 选择框全选值 */
8
4
  export declare const FORM_CONFIG_SELECT_ALL_VALUE: string;
9
- /** 设置表单组件类型 */
10
5
  export declare const setFormComponentType: () => void;
@@ -1,35 +1,9 @@
1
1
  import { TableApiParams, TableApiResult } from '../components/table/types';
2
2
  export interface FetchListAllOptions {
3
- /** 单页大小,默认 200,范围 [1, 1000] */
4
3
  pageSize?: number;
5
- /** 累计抓取上限,默认 10000;totalRecord > limit 则 throw */
6
4
  limit?: number;
7
5
  }
8
- /**
9
- * 全量翻页拉取(串行,提前终止)
10
- * ---
11
- * @param api 原始分页 api 函数(签名同 TableMain :api prop)
12
- * @param baseParams 业务侧固定参数,会透传到每页 api 调用(不被改写)
13
- * @param opts pageSize / limit 覆盖
14
- * @returns 全量 items 数组
15
- *
16
- * 行为:
17
- * - totalRecord = 0 → 直接 [] 返回(仅调 1 次)
18
- * - 单页 items.length < pageSize → 视为末页提前终止
19
- * - 任一页 reject → 整体 reject 透传原错误
20
- * - totalRecord > limit → throw 兜底
21
- */
22
6
  export declare function fetchListAll<T extends Record<string, any>, P extends Record<string, any> = {}>(api: (params: TableApiParams<P>) => Promise<TableApiResult<T>>, baseParams?: P, opts?: FetchListAllOptions): Promise<T[]>;
23
7
  export type ListApiSource<T> = T[] | (() => T[]) | (() => Promise<T[]>);
24
- /**
25
- * 用本地数组 / 同步函数 / 异步函数生成符合 TableMain :api prop 签名的 api
26
- * ---
27
- * 内部识别 source 类型 + 分页切片;无缓存,每次调用 source 重新求值
28
- */
29
8
  export declare function createListApi<T extends Record<string, any>>(source: ListApiSource<T>): (params: TableApiParams<{}>) => Promise<TableApiResult<T>>;
30
- /**
31
- * countAll: 仅探测列表总记录数,不拉数据。
32
- * 1 次 api 调用 page=1/pageSize=1,返回 totalRecord。
33
- * 用于"探测是否有数据 / 数据计数 / 存在性判断"等场景,替代手工 pageSize: 9999 hack。
34
- */
35
9
  export declare function countAll<P extends Record<string, any> = {}>(api: (params: TableApiParams<P>) => Promise<TableApiResult<any>>, baseParams?: P): Promise<number>;
@@ -1,15 +1,4 @@
1
- /**
2
- * 深度递归 Partial(函数类型保持不变,object 类型字段递归可选)
3
- * ---
4
- * 应用场景:SDK 请求参数嵌套结构的可选化(如 PagingInput)
5
- */
6
1
  export type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends object ? {
7
2
  [K in keyof T]?: DeepPartial<T[K]>;
8
3
  } : T;
9
- /**
10
- * 分页请求参数的可选包装
11
- * ---
12
- * 与 SDK 1.1.40 嵌套契约耦合:业务侧手包 list api wrapper 时
13
- * 常以 PagingInput<RawApiParams> 作为入参类型,兜底字段缺失
14
- */
15
4
  export type PagingInput<T> = DeepPartial<T>;
@@ -1,9 +1,7 @@
1
- /** 激活信息 */
2
1
  export interface ActivatedInfo {
3
2
  isActivated: boolean;
4
3
  triggerType: "mounted" | "activated" | "deactivated" | "unmounted";
5
4
  }
6
- /** 是否激活 */
7
5
  export declare const useActivated: (watchFn?: (info: ActivatedInfo) => void) => {
8
6
  isActivated: import('vue').ComputedRef<boolean>;
9
7
  activatedInfo: import('vue').ComputedRef<{
@@ -11,13 +9,5 @@ export declare const useActivated: (watchFn?: (info: ActivatedInfo) => void) =>
11
9
  readonly triggerType: "mounted" | "activated" | "deactivated" | "unmounted";
12
10
  }>;
13
11
  };
14
- /**
15
- * @deprecated 请使用 useActivated 替代
16
- * @example useActivated((info) => { info.isActivated && callback(info) })
17
- * 激活时执行时间 */
18
12
  export declare const useActivatedExec: (callback: (info: ActivatedInfo) => void) => void;
19
- /**
20
- * @deprecated 请使用 useActivated 替代
21
- * @example useActivated((info) => { info.isActivated ? bind(info) : unbind(info) })
22
- * 激活时监听事件 */
23
13
  export declare const useActivatedEvent: (bind: (info: ActivatedInfo) => void, unbind: (info: ActivatedInfo) => void) => void;
@@ -1,8 +1,6 @@
1
- /** 感知元素尺寸变化 */
2
1
  export declare const useFeelSize: () => {
3
2
  unwatchDom: () => void;
4
3
  watchDom: (dom: HTMLElement) => void;
5
- /** 元素尺寸信息只读属性 */
6
4
  sizeInfo: import('vue').ComputedRef<{
7
5
  width: number;
8
6
  height: number;
@@ -4,5 +4,5 @@ export * from './feel-size';
4
4
  export * from './menus-dispatch';
5
5
  export * from './timeout';
6
6
  export * from './use-channel-viewport-height';
7
- export * from './use-admin-theme-apply';
8
- export * from './use-admin-viewport-apply';
7
+ export * from './use-theme-apply';
8
+ export * from './use-viewport-apply';
@@ -1,11 +1,7 @@
1
1
  import { RouteMetaResolveRaw } from '../types';
2
- /** 应用菜单数据分发 */
3
2
  export declare const useMenusDataDispatch: ({ getMenus, getMenuFlatList, getExtractLevel1ToHeader, }: {
4
- /** 菜单树 */
5
3
  getMenus: () => RouteMetaResolveRaw[];
6
- /** 扁平化菜单列表 */
7
4
  getMenuFlatList: () => RouteMetaResolveRaw[];
8
- /** 判断是否提取1级路由模块到HEADER */
9
5
  getExtractLevel1ToHeader: () => boolean;
10
6
  }) => {
11
7
  sidebarMenus: import('vue').ComputedRef<RouteMetaResolveRaw[]>;
@@ -1,7 +1,3 @@
1
1
  export type ClearTimer = () => void;
2
2
  export type SetTimer = (handler: () => void, timeout: number) => void;
3
- /**
4
- * 使用定时器
5
- * @param autoClear 是否在生命周期结束前自动清除定时器
6
- */
7
3
  export declare const useTimeout: (autoClear?: boolean) => [SetTimer, ClearTimer];
@@ -1,27 +1,13 @@
1
1
  import { ComputedRef } from 'vue';
2
- /** useChannelViewportHeight 第二参数 options */
3
2
  export interface UseChannelViewportHeightOptions {
4
- /** body inject 未命中时的最终兜底,默认 0 */
5
3
  fallback?: number;
6
4
  }
7
- /** useChannelViewportHeight 入参对象形状(约定 reactive,props 即满足) */
8
5
  export interface UseChannelViewportHeightMaybeProps {
9
- /** props.viewportHeight,优先级位于 parentChannel inject 之下、body inject 之上 */
10
6
  viewportHeight?: number;
11
- /** tabs 族 channel 父级标识——setup 期 Symbol.for 快照,变更 console.error 忽略 */
12
7
  parentChannel?: string;
13
8
  }
14
- /** useChannelViewportHeight 返回值 */
15
9
  export interface UseChannelViewportHeightReturn {
16
- /** 最终视口高度,链路 parentChannel > viewportHeight > body inject > fallback */
17
10
  viewportHeightFinal: ComputedRef<number>;
18
- /** parent inject 命中时取 payload.level,否则 0;调用方算 childLevel = parentLevel + 1 */
19
11
  parentLevel: ComputedRef<number>;
20
12
  }
21
- /**
22
- * tabs 族 channel 视口高度解析 hook。
23
- * 链路:parentChannel inject > maybeProps.viewportHeight > body inject > options.fallback。
24
- * `parentChannel` setup 期 Symbol.for 快照,变更 console.error 忽略(非响应式)。
25
- * 入参 maybeProps 约定 reactive 对象(props 即满足);返回 viewportHeightFinal/parentLevel 均为 computed。
26
- */
27
13
  export declare const useChannelViewportHeight: (maybeProps: UseChannelViewportHeightMaybeProps, options?: UseChannelViewportHeightOptions) => UseChannelViewportHeightReturn;
@@ -0,0 +1,11 @@
1
+ import { DeepReadonly } from 'vue';
2
+ import { AppThemeConfig, CoreThemeDensity, CoreThemeMotion } from '../bridge';
3
+ export declare function buildRhythmCss(density: CoreThemeDensity, motion: CoreThemeMotion): string;
4
+ export interface UseThemeApplyOptions {
5
+ getThemeConfig: () => AppThemeConfig | DeepReadonly<AppThemeConfig>;
6
+ getThemeIsDark: () => boolean;
7
+ getThemeDensity?: () => CoreThemeDensity;
8
+ getThemeMotion?: () => CoreThemeMotion;
9
+ document?: Document;
10
+ }
11
+ export declare function useThemeApply(options: UseThemeApplyOptions): void;
@@ -0,0 +1,8 @@
1
+ import { DeepReadonly } from 'vue';
2
+ import { AppLayoutViewportConfig, AppLayoutGapConfig } from '../bridge';
3
+ export interface UseViewportApplyOptions {
4
+ getViewportConfig: () => AppLayoutViewportConfig | DeepReadonly<AppLayoutViewportConfig>;
5
+ getGapConfig?: () => AppLayoutGapConfig | DeepReadonly<AppLayoutGapConfig>;
6
+ document?: Document;
7
+ }
8
+ export declare function useViewportApply(options: UseViewportApplyOptions): void;
@@ -1,99 +1,14 @@
1
1
  import { InjectionKey, Ref } from 'vue';
2
- import { AdminBridge } from '../bridge';
2
+ import { CoreBridge } from '../bridge';
3
3
  import { ModalLevel, ShelfController } from '../components/modal';
4
4
  import { AppLayoutAppStoreSlice, AppLayoutUserStoreSlice, AppLayoutBridgeSlice } from '../components/app-layout';
5
5
  import { NestFormExposeMap } from '../components/form';
6
- /**
7
- * body 视口高度
8
- * ---
9
- * AppBody(留 app)通过 provide 写入;
10
- * TableMain / ListPage / Page1(核内或核外消费方)通过 inject 读取;
11
- * ---
12
- * 使用 `Symbol.for` 全局注册表保证跨包 / 跨 chunk / 跨 ESM 实例的 Symbol 唯一性。
13
- * `Symbol(key)` 每次调用产生新实例;vite chunk split 或多次模块 evaluate 可能
14
- * 产生多个 Symbol → inject/provide 失配 → 列表精细化高度计算塌陷至 fallback。
15
- */
16
6
  export declare const BODY_CONTENT_VIEWPORT_HEIGHT: unique symbol;
17
- /**
18
- * 弹窗架子 inject key 工厂——按 level 参数化。
19
- * Symbol.for 全局注册表保证跨包/跨 chunk/跨 ESM 实例唯一(同 BODY_CONTENT_VIEWPORT_HEIGHT)。
20
- */
21
7
  export declare function getModalShelfInjectionKey(level: ModalLevel): InjectionKey<ShelfController>;
22
- /**
23
- * TabsMain 视觉嵌套层级 inject key(独立于 channel payload.level)。
24
- * ---
25
- * 与 channel 体系完全解耦:
26
- * - channel level:高度预算用,父未配 channel 时子 selfLevel=1(看是否 inject 命中)
27
- * - 视觉 level:物理嵌套深度,每层 TabsMain(含 refine=false)+1 → provide 给后代
28
- * ---
29
- * 用途:TabsHeader 据此应用层级化样式(L1 卡片 / L2 下划线 / L3 紧凑 / L4+ 仅文字加粗)。
30
- * setup 期一次性 provide number(不响应式);Symbol.for 跨包/chunk/ESM 实例唯一(同上)。
31
- */
32
8
  export declare const TABS_MAIN_VISUAL_LEVEL: InjectionKey<number>;
33
- /**
34
- * AppLayout 族 app store 窄化消费契约 inject key。
35
- * ---
36
- * AppLayout(唯一 `useAppStore()` 调用方)provide;子组件
37
- * (AppBody / AppHeader / AppSidebar / AppFooter)inject 自取。
38
- * Symbol.for 保证跨包同一性(同 BODY_CONTENT_VIEWPORT_HEIGHT)。
39
- */
40
9
  export declare const APP_LAYOUT_APP_STORE_KEY: InjectionKey<AppLayoutAppStoreSlice>;
41
- /**
42
- * AppLayout 族 user store 窄化消费契约 inject key。
43
- * ---
44
- * AppLayout 集中 provide;AppHeader inject 自取(取 userInfo / isLogin / logout 等)。
45
- * Symbol.for 保证跨包同一性。
46
- */
47
10
  export declare const APP_LAYOUT_USER_STORE_KEY: InjectionKey<AppLayoutUserStoreSlice>;
48
- /**
49
- * AppLayout 族 admin bridge 窄化消费契约 inject key(#7.6 期挂载)。
50
- * ---
51
- * AppLayout 通过 `props.adminBridge` 接收注入后 provide;子组件
52
- * (AppBody/AppHeader/AppSidebar/AppLayout 内菜单派生)inject 自取 12 readonly
53
- * 配置属性 + getRoutes / generateRouteMetaRawTree 派生方法。
54
- * Symbol.for 保证跨包同一性(同 APP_LAYOUT_APP_STORE_KEY / APP_LAYOUT_USER_STORE_KEY)。
55
- */
56
11
  export declare const APP_LAYOUT_BRIDGE_KEY: InjectionKey<AppLayoutBridgeSlice>;
57
- /**
58
- * 整 admin bridge app 级注入 key(#插件系统一期挂载)。
59
- * ---
60
- * `bridge.install(app)`(即 `app.use(bridge)`)经 `app.provide(ADMIN_BRIDGE_KEY, bridge)`
61
- * 把**整个 bridge 实例**注入应用级 provide 链;任意后代组件经 `inject(ADMIN_BRIDGE_KEY)`
62
- * 取整 bridge(含 7 响应式只读配置视图 + `update` + 全部 auth/api/派生方法)。
63
- * ---
64
- * **opt-in**:仅当 app 显式 `app.use(bridge)` 时注入;未 use 则 `inject(ADMIN_BRIDGE_KEY)`
65
- * 返回 `undefined`(不报错)。
66
- * ---
67
- * **区别于 `APP_LAYOUT_BRIDGE_KEY`**:后者是 AppLayout 族**组件级**窄切片(`AppLayoutBridgeSlice`
68
- * Pick 子集,由 AppLayout 从 `props.adminBridge` 接收后 provide,供 layout 子组件 inject),
69
- * 两 KEY 各管各、并存——本 KEY 注入的是 app 级**整 bridge**,非 layout 窄切片。
70
- * ---
71
- * Symbol.for 保证跨包/跨 chunk/跨 ESM 实例唯一(同 APP_LAYOUT_BRIDGE_KEY,规则 8)。
72
- */
73
- export declare const ADMIN_BRIDGE_KEY: InjectionKey<AdminBridge>;
74
- /**
75
- * 嵌套子 FormMain exposeMap inject key(配置化嵌套联结组件 Nest 三件套挂载)。
76
- * ---
77
- * 每个 FormMain `provide` 一份本 key 的空 exposeMap(shallowReactive,按 item key 索引),
78
- * 供其后代联结组件(FormItemNestForm)`inject` 到**最近祖先** FormMain 的 map 并把子
79
- * FormMain 的级联 expose 写入(key = 自身 item key);FormMain 的 validate/clearValidate/
80
- * resetFields 遍历自身 map 级联子表单。
81
- * ---
82
- * provide/inject 链天然实现「只挂最近祖先」(inject 向上解析至最近 provide)。
83
- * 注册由联结组件显式触发(非裸嵌套 FormMain 自动注册)→ 旧用法零回归(additive)。
84
- * ---
85
- * Symbol.for 保证跨包/跨 chunk/跨 ESM 实例唯一(规则 8,同上)。
86
- */
12
+ export declare const CORE_BRIDGE_KEY: InjectionKey<CoreBridge>;
87
13
  export declare const FORM_NEST_REGISTRY_KEY: InjectionKey<NestFormExposeMap>;
88
- /**
89
- * 嵌套布局 rebase 累乘因子 inject key(P3 嵌套布局 rebase 挂载)。
90
- * ---
91
- * 每个 FormMain / PanelMain `provide` 自身 `layoutScale`(缺省 1)的响应式只读引用;
92
- * 其后代联结组件(FormItemNestForm / FormItemNestFormList / PanelItemNestPanel /
93
- * PanelItemNestForm)`inject` 到**最近祖先**的 scale,叠本层因子
94
- * `childScale = parentScale × (24 / parentItemSpan)` 后作 `layoutScale` 传子 Form/PanelMain。
95
- * ---
96
- * 顶级 FormMain/PanelMain 未嵌套时 provide 1 → 子层缺省行为不变(向后兼容)。
97
- * Symbol.for 保证跨包/跨 chunk/跨 ESM 实例唯一(规则 8,同上)。
98
- */
99
14
  export declare const NEST_LAYOUT_SCALE_KEY: InjectionKey<Readonly<Ref<number>>>;
@@ -2,19 +2,6 @@ import { Router } from 'vue-router';
2
2
  import { checkLogin } from './login';
3
3
  import { checkPermission } from './permission';
4
4
  import { CreateGuardOptions } from './types';
5
- /**
6
- * 路由守卫工厂——给 router 装登录守卫 + 权限守卫 + document.title 写入。
7
- *
8
- * 1:1 镜像原 app `router/guard/index.ts` 行为:
9
- * - beforeEach: checkLogin → 跳 loginPath;checkPermission → 跳 noPermissionPath
10
- * - beforeResolve: document.title = to.meta.title
11
- *
12
- * @example
13
- * createGuard(router, {
14
- * bridge: appAdminBridge,
15
- * useRoutePermission,
16
- * });
17
- */
18
5
  export declare const createGuard: (router: Router, options: CreateGuardOptions) => void;
19
6
  export { checkLogin, checkPermission };
20
7
  export type { CreateGuardOptions, GuardBridgeSlice, GuardRoutePermissionStore, } from './types';
@@ -1,4 +1,3 @@
1
1
  import { RouteLocationNormalized } from 'vue-router';
2
2
  import { GuardRoutePermissionStore } from './types';
3
- /** 登录检测壳子——复用 store.checkNeedGoToLoginPage */
4
3
  export declare const checkLogin: (to: RouteLocationNormalized, store: GuardRoutePermissionStore) => Promise<boolean>;
@@ -1,4 +1,3 @@
1
1
  import { RouteLocationNormalized } from 'vue-router';
2
2
  import { GuardRoutePermissionStore } from './types';
3
- /** 权限检测壳子——复用 store.checkNeedGoToAuthPage */
4
3
  export declare const checkPermission: (to: RouteLocationNormalized, store: GuardRoutePermissionStore) => Promise<boolean>;
@@ -1,13 +1,10 @@
1
1
  import { RouteLocationNormalized } from 'vue-router';
2
- import { AdminBridge } from '../../bridge';
3
- /** guard 仅依赖 bridge 的路径配置切片(Pick 表达 → 必 type alias,无法 interface) */
4
- export type GuardBridgeSlice = Pick<AdminBridge, "APP_ROUTER_PATHS_CONFIG">;
5
- /** guard 仅依赖 route-permission store 的 2 个 check 方法 */
2
+ import { CoreBridge } from '../../bridge';
3
+ export type GuardBridgeSlice = Pick<CoreBridge, "APP_ROUTER_PATHS_CONFIG">;
6
4
  export interface GuardRoutePermissionStore {
7
5
  checkNeedGoToLoginPage: (route: RouteLocationNormalized) => boolean;
8
6
  checkNeedGoToAuthPage: (route: Pick<RouteLocationNormalized, "path">) => boolean;
9
7
  }
10
- /** createGuard 入参 */
11
8
  export interface CreateGuardOptions {
12
9
  bridge: GuardBridgeSlice;
13
10
  useRoutePermission: () => GuardRoutePermissionStore;