@done-coding/admin-core 0.21.0 → 0.22.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 (136) hide show
  1. package/es/components/app-layout/AppLayout.vue.mjs +1 -1
  2. package/es/components/app-layout/AppLayout.vue2.mjs +51 -6
  3. package/es/components/app-layout/AppPage.vue.mjs +1 -1
  4. package/es/components/app-layout/AppPage.vue2.mjs +16 -9
  5. package/es/components/display/ShadowClone.vue.mjs +32 -0
  6. package/es/components/display/ShadowClone.vue2.mjs +4 -0
  7. package/es/components/display/use-shadow-target.mjs +76 -0
  8. package/es/components/form/FormActiveFilter.vue.mjs +7 -0
  9. package/es/components/form/FormActiveFilter.vue2.mjs +62 -0
  10. package/es/components/form/FormInput.vue.mjs +27 -0
  11. package/es/components/form/FormInput.vue2.mjs +4 -0
  12. package/es/components/form/FormInputShadowClone.vue.mjs +47 -0
  13. package/es/components/form/FormInputShadowClone.vue2.mjs +4 -0
  14. package/es/components/form/FormMain.vue.mjs +1 -1
  15. package/es/components/form/FormMain.vue2.mjs +5 -25
  16. package/es/components/form/FormSelectShadowClone.vue.mjs +57 -0
  17. package/es/components/form/FormSelectShadowClone.vue2.mjs +4 -0
  18. package/es/components/form/FormShadowCloneDispatch.vue.mjs +7 -0
  19. package/es/components/form/FormShadowCloneDispatch.vue2.mjs +74 -0
  20. package/es/components/form/FormSortSwitch.vue.mjs +7 -0
  21. package/es/components/form/FormSortSwitch.vue2.mjs +188 -0
  22. package/es/components/form/FormSortSwitchGroup.vue.mjs +7 -0
  23. package/es/components/form/FormSortSwitchGroup.vue2.mjs +68 -0
  24. package/es/components/form/FormUpload.vue.mjs +8 -0
  25. package/es/components/form/FormUpload.vue2.mjs +112 -0
  26. package/es/components/form/FormUploadAudio.vue.mjs +7 -0
  27. package/es/components/form/FormUploadAudio.vue2.mjs +88 -0
  28. package/es/components/form/FormUploadCard.vue.mjs +7 -0
  29. package/es/components/form/FormUploadCard.vue2.mjs +56 -0
  30. package/es/components/form/FormUploadFileInfo.vue.mjs +7 -0
  31. package/es/components/form/FormUploadFileInfo.vue2.mjs +36 -0
  32. package/es/components/form/FormUploadImage.vue.mjs +7 -0
  33. package/es/components/form/FormUploadImage.vue2.mjs +77 -0
  34. package/es/components/form/FormUploadTrigger.vue.mjs +7 -0
  35. package/es/components/form/FormUploadTrigger.vue2.mjs +34 -0
  36. package/es/components/form/FormUploadVideo.vue.mjs +7 -0
  37. package/es/components/form/FormUploadVideo.vue2.mjs +74 -0
  38. package/es/components/form/use-password-autofill.mjs +34 -0
  39. package/es/components/form/use-upload-state.mjs +98 -0
  40. package/es/components/list-layout/ListLayout.vue.mjs +1 -1
  41. package/es/components/list-layout/ListLayout.vue2.mjs +36 -9
  42. package/es/components/list-layout/use-active-filter.mjs +133 -0
  43. package/es/components/modal/ImagePreviewTrigger.vue.mjs +34 -0
  44. package/es/components/modal/ImagePreviewTrigger.vue2.mjs +4 -0
  45. package/es/components/modal/ModalImagePreview.vue.mjs +52 -0
  46. package/es/components/modal/ModalImagePreview.vue2.mjs +4 -0
  47. package/es/components/modal/ModalPorter.vue.mjs +49 -2
  48. package/es/components/modal/ModalShelf.vue.mjs +13 -4
  49. package/es/components/modal/ModalVideoPreview.vue.mjs +8 -0
  50. package/es/components/modal/ModalVideoPreview.vue2.mjs +93 -0
  51. package/es/components/modal/VideoPreviewTrigger.vue.mjs +7 -0
  52. package/es/components/modal/VideoPreviewTrigger.vue2.mjs +96 -0
  53. package/es/components/modal/modal-global-keys.mjs +11 -0
  54. package/es/components/modal/modal-global-symbol.mjs +6 -0
  55. package/es/components/modal/modal-shelf-core.mjs +53 -4
  56. package/es/components/table/TableEmpty.vue.mjs +36 -0
  57. package/es/components/table/TableEmpty.vue2.mjs +4 -0
  58. package/es/components/table/TableMain.vue.mjs +1 -1
  59. package/es/components/table/TableMain.vue2.mjs +21 -8
  60. package/es/components/view-layout/ViewLayout.vue.mjs +1 -1
  61. package/es/components/view-layout/ViewLayout.vue2.mjs +1 -1
  62. package/es/hooks/menus-dispatch.mjs +8 -3
  63. package/es/index.mjs +127 -91
  64. package/es/style.css +412 -33
  65. package/package.json +2 -2
  66. package/src/components/app-layout/docs/README-AppLayout.md +48 -0
  67. package/src/components/app-layout/docs/README-AppPage.md +40 -2
  68. package/src/components/display/README.md +9 -3
  69. package/src/components/display/docs/README-ShadowClone.md +75 -0
  70. package/src/components/form/README.md +15 -2
  71. package/src/components/form/docs/README-FormActiveFilter.md +57 -0
  72. package/src/components/form/docs/README-FormInput.md +66 -0
  73. package/src/components/form/docs/README-FormSelect.md +77 -0
  74. package/src/components/form/docs/README-FormShadowCloneDispatch.md +65 -0
  75. package/src/components/form/docs/README-FormSortSwitchGroup.md +131 -0
  76. package/src/components/form/docs/README-FormUpload.md +108 -0
  77. package/src/components/form/docs/README-FormUploadAudio.md +80 -0
  78. package/src/components/form/docs/README-FormUploadImage.md +83 -0
  79. package/src/components/form/docs/README-FormUploadVideo.md +82 -0
  80. package/src/components/list-layout/README.md +6 -2
  81. package/src/components/list-layout/docs/README-ListLayout.md +1 -0
  82. package/src/components/modal/README.md +7 -2
  83. package/src/components/modal/docs/README-ImagePreviewTrigger.md +78 -0
  84. package/src/components/modal/docs/README-ModalImagePreview.md +78 -0
  85. package/src/components/modal/docs/README-ModalPorter.md +10 -0
  86. package/src/components/modal/docs/README-ModalShelf.md +11 -2
  87. package/src/components/modal/docs/README-ModalVideoPreview.md +89 -0
  88. package/src/components/modal/docs/README-VideoPreviewTrigger.md +91 -0
  89. package/src/components/table/docs/README-TableMain.md +3 -0
  90. package/types/components/app-layout/AppLayout.vue.d.ts +31 -1
  91. package/types/components/app-layout/AppPage.vue.d.ts +7 -2
  92. package/types/components/app-layout/types.d.ts +25 -0
  93. package/types/components/display/ShadowClone.vue.d.ts +20 -0
  94. package/types/components/display/TabsTile.vue.d.ts +2 -2
  95. package/types/components/display/index.d.ts +8 -1
  96. package/types/components/display/types.d.ts +7 -0
  97. package/types/components/display/use-shadow-target.d.ts +9 -0
  98. package/types/components/form/FormActiveFilter.vue.d.ts +9 -0
  99. package/types/components/form/FormInput.vue.d.ts +3 -0
  100. package/types/components/form/FormInputShadowClone.vue.d.ts +7 -0
  101. package/types/components/form/FormSearch.vue.d.ts +1 -1
  102. package/types/components/form/FormSelectShadowClone.vue.d.ts +39 -0
  103. package/types/components/form/FormShadowCloneDispatch.vue.d.ts +44 -0
  104. package/types/components/form/FormSortSwitch.vue.d.ts +17 -0
  105. package/types/components/form/FormSortSwitchGroup.vue.d.ts +15 -0
  106. package/types/components/form/FormUpload.vue.d.ts +57 -0
  107. package/types/components/form/FormUploadAudio.vue.d.ts +30 -0
  108. package/types/components/form/FormUploadCard.vue.d.ts +24 -0
  109. package/types/components/form/FormUploadFileInfo.vue.d.ts +10 -0
  110. package/types/components/form/FormUploadImage.vue.d.ts +34 -0
  111. package/types/components/form/FormUploadTrigger.vue.d.ts +11 -0
  112. package/types/components/form/FormUploadVideo.vue.d.ts +34 -0
  113. package/types/components/form/index.d.ts +12 -1
  114. package/types/components/form/types.d.ts +158 -0
  115. package/types/components/form/use-password-autofill.d.ts +11 -0
  116. package/types/components/form/use-upload-state.d.ts +29 -0
  117. package/types/components/list-layout/ListLayout.vue.d.ts +3 -0
  118. package/types/components/list-layout/types.d.ts +16 -0
  119. package/types/components/list-layout/use-active-filter.d.ts +27 -0
  120. package/types/components/modal/ImagePreviewTrigger.vue.d.ts +41 -0
  121. package/types/components/modal/ModalConfirm.vue.d.ts +1 -1
  122. package/types/components/modal/ModalImagePreview.vue.d.ts +31 -0
  123. package/types/components/modal/ModalPorter.vue.d.ts +7 -0
  124. package/types/components/modal/ModalShelf.vue.d.ts +12 -3
  125. package/types/components/modal/ModalVideoPreview.vue.d.ts +40 -0
  126. package/types/components/modal/VideoPreviewTrigger.vue.d.ts +43 -0
  127. package/types/components/modal/index.d.ts +6 -1
  128. package/types/components/modal/modal-global-keys.d.ts +25 -0
  129. package/types/components/modal/modal-global-symbol.d.ts +8 -0
  130. package/types/components/modal/modal-shelf-core.d.ts +11 -3
  131. package/types/components/modal/modal-shelf-types.d.ts +50 -0
  132. package/types/components/table/TableEmpty.vue.d.ts +11 -0
  133. package/types/components/table/types.d.ts +11 -0
  134. package/types/components/view-layout/types.d.ts +1 -1
  135. package/types/injectInfo.json.d.ts +1 -1
  136. package/types/store/app.d.ts +1 -1
@@ -1,8 +1,11 @@
1
1
  import { Component } from 'vue';
2
- import { ModalLevel } from './modal-shelf-types';
2
+ import { GlobalModalRemote, ModalLevel } from './modal-shelf-types';
3
3
  type __VLS_Props = {
4
4
  level: ModalLevel;
5
5
  };
6
+ type __VLS_PublicProps = {
7
+ "remote"?: GlobalModalRemote;
8
+ } & __VLS_Props;
6
9
  declare function __VLS_template(): {
7
10
  attrs: Partial<{}>;
8
11
  slots: {
@@ -12,7 +15,7 @@ declare function __VLS_template(): {
12
15
  rootEl: any;
13
16
  };
14
17
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
18
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
16
19
  items: import('vue').Ref<import('./modal-shelf-types').ShelfItem[]>;
17
20
  level: ModalLevel;
18
21
  evoke: (nsKey: string, component: Component | (() => Promise<Component>), options: {
@@ -21,7 +24,13 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
21
24
  }) => import('./modal-shelf-types').EvokeHandle;
22
25
  remove: (nsKey: string | string[]) => void;
23
26
  close: (item: import('./modal-shelf-types').ShelfItem) => void;
24
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
+ registerConfig: (entries: import('./modal-shelf-types').ShelfConfigEntry[]) => void;
28
+ unregisterConfig: (keys: string[]) => void;
29
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
30
+ "update:remote": (value: GlobalModalRemote) => any;
31
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
32
+ "onUpdate:remote"?: ((value: GlobalModalRemote) => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
34
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
26
35
  export default _default;
27
36
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -0,0 +1,40 @@
1
+ /**
2
+ * ModalVideoPreview —— 视频预览弹窗·lightbox 形态(ElDialog 直配黑底 + 原生
3
+ * <video controls>)。封面兜底:coverUrl 传则作 poster;不传则 src 自动追加
4
+ * `#t=0.01`(Media Fragments 首帧渲染)配合 preload="metadata" 只拉元数据不拉全片。
5
+ * 注册形态(ModalShelf/Porter):payload/closeFn/removeFn 显式声明(不泄漏进
6
+ * $attrs 落 video DOM),业务值双输入源:`url`/`coverUrl` = props ?? payload。
7
+ * 详见 docs/README-ModalVideoPreview.md。
8
+ */
9
+ type __VLS_Props = {
10
+ /** 视频地址(<video src>);注册形态下可改经 payload.url 承载 */
11
+ url: string;
12
+ /** 封面图地址(<video poster>);空 → src 追加 #t=0.01 + preload="metadata" 首帧兜底 */
13
+ coverUrl?: string;
14
+ /** 打开即自动播放(业界 lightbox 行为,默认开);关闭即暂停(固定行为) */
15
+ autoPlay?: boolean;
16
+ /** 注册形态注入(ModalShelf/Porter 渲染只传 payload;原语用法无需传) */
17
+ payload?: {
18
+ url?: string;
19
+ coverUrl?: string;
20
+ };
21
+ /** 注册形态注入的关闭出口(本组件不消费,仅声明避免泄漏进 $attrs) */
22
+ closeFn?: () => void;
23
+ /** 注册形态注入的移除出口(同上) */
24
+ removeFn?: () => void;
25
+ /** 关闭回调(ElDialog @close 触发) */
26
+ onClose?: (status?: boolean) => void;
27
+ };
28
+ type __VLS_PublicProps = {
29
+ "show": boolean;
30
+ } & __VLS_Props;
31
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
32
+ "update:show": (value: boolean) => any;
33
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
34
+ "onUpdate:show"?: ((value: boolean) => any) | undefined;
35
+ }>, {
36
+ autoPlay: boolean;
37
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
38
+ videoEl: HTMLVideoElement;
39
+ }, any>;
40
+ export default _default;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * VideoPreviewTrigger —— 视频预览触发原语(默认插槽 = 封面/占位 + 播放图标,
3
+ * 吐 `open` 供自定义内容复用;核心唤起逻辑内置)。与 ImagePreviewTrigger 对等成对
4
+ * (视频无 el 原生预览,弹窗是唯一路径——决策链保留;图片触发端点击直达原生预览,
5
+ * 无决策链)。无封面零请求是硬行为(占位方案零请求零副作用,不预加载不拉 metadata);
6
+ * $attrs 只落封面层(coverUrl 路径)——弹窗端视频属性(autoplay/muted 等)
7
+ * 在 ModalVideoPreview 上配,[MUST NOT] 经本组件透传。
8
+ * 详见 docs/README-VideoPreviewTrigger.md。
9
+ */
10
+ type __VLS_Props = {
11
+ /** 视频地址(点击唤起预览弹窗的视频) */
12
+ url: string;
13
+ /** 封面图地址;空 → 深色占位 + 播放图标(零请求);有 → ElImage 封面(原生懒加载)+ 图标叠加 */
14
+ coverUrl?: string;
15
+ /** 封面图懒加载(仅 coverUrl 有值时生效) */
16
+ lazy?: boolean;
17
+ /** 是否可点击唤起预览(false = 纯展示封面/占位) */
18
+ preview?: boolean;
19
+ };
20
+ declare function __VLS_template(): {
21
+ attrs: Partial<{}>;
22
+ slots: {
23
+ default?(_: {
24
+ open: () => void;
25
+ }): any;
26
+ placeholder?(_: {}): any;
27
+ error?(_: {}): any;
28
+ };
29
+ refs: {};
30
+ rootEl: any;
31
+ };
32
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
33
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
34
+ lazy: boolean;
35
+ preview: boolean;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
37
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
38
+ export default _default;
39
+ type __VLS_WithTemplateSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -3,9 +3,14 @@ import { default as ModalForm } from './ModalForm.vue';
3
3
  import { default as ModalDetail } from './ModalDetail.vue';
4
4
  import { default as ModalShelf } from './ModalShelf.vue';
5
5
  import { default as ModalPorter } from './ModalPorter.vue';
6
+ import { default as ModalImagePreview } from './ModalImagePreview.vue';
7
+ import { default as ModalVideoPreview } from './ModalVideoPreview.vue';
8
+ import { default as ImagePreviewTrigger } from './ImagePreviewTrigger.vue';
9
+ import { default as VideoPreviewTrigger } from './VideoPreviewTrigger.vue';
6
10
  export * from './types';
7
11
  export * from './modal-shelf-types';
8
- export { ModalConfirm, ModalForm, ModalDetail, ModalShelf, ModalPorter,
12
+ export * from './modal-global-keys';
13
+ export { ModalConfirm, ModalForm, ModalDetail, ModalShelf, ModalPorter, ModalImagePreview, ModalVideoPreview, ImagePreviewTrigger, VideoPreviewTrigger,
9
14
  /** @deprecated 改用 `ModalConfirm`(modal 族统一前缀) */
10
15
  ModalConfirm as ConfirmModal,
11
16
  /** @deprecated 改用 `ModalForm`(modal 族统一前缀) */
@@ -0,0 +1,25 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { GlobalModalRemote } from './modal-shelf-types';
3
+ /**
4
+ * 全局图片预览弹窗预置 key(core 预置,见 README-ModalImagePreview / README-AppLayout)。
5
+ * ---
6
+ * 三重身份:remote 遥控器对象上的键(`remote[APP_GLOBAL_IMAGE_PREVIEW_KEY]`)、
7
+ * `modalKey` 清单条目(触发端 `modalKey.includes()` 显式判断)、`ModalShelfMap`
8
+ * 计算属性名(evoke payload 全链类型化)。
9
+ * AppLayout `enableGlobalImagePreview` 开启后以 `ModalImagePreview` 按此 key 注册;
10
+ * 触发端 `ImagePreviewTrigger` 经遥控器按此 key 唤起。
11
+ */
12
+ export declare const APP_GLOBAL_IMAGE_PREVIEW_KEY: "appGlobalImagePreview";
13
+ /** 全局视频预览弹窗预置 key(同上;AppLayout `enableGlobalVideoPreview` 注册) */
14
+ export declare const APP_GLOBAL_VIDEO_PREVIEW_KEY: "appGlobalVideoPreview";
15
+ /**
16
+ * 全局弹窗遥控器注入 key(core 导出,见 README-AppLayout「全局弹窗遥控器」)。
17
+ * ---
18
+ * App 根(App.vue)把持有同一 `globalModalRemote` 对象经本 key provide(与既有
19
+ * 业务侧 key 并存——core 不 provide、消费方自持自传);触发组件(ImagePreviewTrigger /
20
+ * VideoPreviewTrigger)inject 后按 `modalKey` 判断全局 key 是否已注册,命中即遥控唤起。
21
+ * ---
22
+ * 值 = 包名 + 键名(injectInfo.name),`Symbol.for` 全局注册表保证跨包 / 跨 chunk /
23
+ * 跨 ESM 实例唯一(同 `@/inject/key.ts` 各 key 构造,规则 8)。[MUST NOT] 焊 version。
24
+ */
25
+ export declare const GLOBAL_MODAL_REMOTE_KEY: InjectionKey<Ref<GlobalModalRemote>>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 全局弹窗专用 Porter 标识(core 内部私有,[MUST NOT] 经 modal/index.ts 导出)。
3
+ *
4
+ * 只有持有本 Symbol 的调用方(= AppLayout 内部专用 ModalPorter)才能启用
5
+ * `globalOnly` 模式推送 app 级弹窗配置——外部拿不到 Symbol 即无法伪造专用模式。
6
+ * AppLayout 经相对路径 import(内部私有符号不走桶出口,规则 7 粒度约束针对对外面)。
7
+ */
8
+ export declare const APP_GLOBAL_MODAL_PORTER_SYMBOL: unique symbol;
@@ -1,9 +1,17 @@
1
1
  import { Ref } from 'vue';
2
- import { ModalLevel, ShelfController, ShelfItem } from './modal-shelf-types';
2
+ import { GlobalModalRemote, ModalLevel, ShelfController, ShelfItem } from './modal-shelf-types';
3
3
  /** ShelfController 内部扩展:额外暴露渲染用活跃实例列表 */
4
4
  export interface ShelfControllerInternal extends ShelfController {
5
5
  /** 渲染用:当前活跃实例列表(多例数组) */
6
6
  items: Ref<ShelfItem[]>;
7
7
  }
8
- /** 创建一个架子逻辑控制器(纯逻辑,无 DOM 依赖,可单测) */
9
- export declare function createShelfController(level: ModalLevel): ShelfControllerInternal;
8
+ /**
9
+ * 创建一个架子逻辑控制器(纯逻辑,无 DOM 依赖,可单测)。
10
+ *
11
+ * `remoteRef` 可选——仅 app 级架子传入(v-model:remote 的 model ref):收到
12
+ * `registerConfig` 推送的全局弹窗配置后,把 key → {evoke, close, update} 句柄
13
+ * 挂进遥控器对象(整体替换 model 值触发响应式 + 链式 v-model 传播);配置移除
14
+ * (`unregisterConfig`)时同步移除对应 key + 清掉该 key 活跃实例。page/custom
15
+ * 架子不传 remoteRef——registerConfig 只存配置不挂遥控器。
16
+ */
17
+ export declare function createShelfController(level: ModalLevel, remoteRef?: Ref<GlobalModalRemote>): ShelfControllerInternal;
@@ -1,4 +1,5 @@
1
1
  import { Component } from 'vue';
2
+ import { APP_GLOBAL_IMAGE_PREVIEW_KEY, APP_GLOBAL_VIDEO_PREVIEW_KEY } from './modal-global-keys';
2
3
  /** 架子层级 */
3
4
  export type ModalLevel = "app" | "page" | "custom";
4
5
  /** 同 key 再 evoke 策略:recreate=关旧重建(默认);update=已开则整体替换 props 不 remount */
@@ -8,8 +9,18 @@ export type ModalSameKeyStrategy = "recreate" | "update";
8
9
  * 例:declare module "@done-coding/admin-core" {
9
10
  * interface ModalShelfMap { detail: { id: string; onConfirm?: (r: unknown) => void } }
10
11
  * }
12
+ *
13
+ * core 预置全局预览弹窗 key 常量(APP_GLOBAL_*_PREVIEW_KEY,as const 计算属性名)
14
+ * 直接内建——触发端经遥控器 evoke 的 payload 全链类型化(src/url/coverUrl)。
11
15
  */
12
16
  export interface ModalShelfMap {
17
+ [APP_GLOBAL_IMAGE_PREVIEW_KEY]: {
18
+ src: string;
19
+ };
20
+ [APP_GLOBAL_VIDEO_PREVIEW_KEY]: {
21
+ url: string;
22
+ coverUrl?: string;
23
+ };
13
24
  }
14
25
  /** 架子注入给弹窗组件的契约(业务 payload 经单 payload 对象传入) */
15
26
  export interface ModalInjectedProps<P = Record<string, unknown>> {
@@ -68,6 +79,45 @@ export interface ShelfController {
68
79
  remove: (nsKey: string | string[]) => void;
69
80
  /** 优雅关闭某条(触发隐藏 → 动画结束 → 移除) */
70
81
  close: (item: ShelfItem) => void;
82
+ /** 配置注册面(全局遥控器链路专用:专用 ModalPorter 推送 app 级弹窗配置) */
83
+ registerConfig: (entries: ShelfConfigEntry[]) => void;
84
+ /** 配置移除(同步清理遥控器对应 key + 该 key 活跃实例) */
85
+ unregisterConfig: (keys: string[]) => void;
71
86
  }
72
87
  /** ModalShelf 实例引用类型别名(用于 RegisterEntry.shelf 直接持实例定位 custom 架子) */
73
88
  export type ShelfInstance = ShelfController;
89
+ /**
90
+ * 单个全局弹窗的遥控控制面(remote[key])。
91
+ *
92
+ * - `evoke`:唤起(不带 key——key 即 remote 对象上的键;重复 evoke 行为由配置期
93
+ * `sameKeyStrategy` 决定:recreate 关旧重建 / update 整体替换 props 不 remount)
94
+ * - `close`:关闭当前实例(**关键能力**:全局弹窗不能只靠用户点击关闭——可能无
95
+ * 关闭按钮 / 需外部编排,应用根经此按 key 遥控关闭)
96
+ * - `update`:受控增量合并 payload(不 remount)
97
+ */
98
+ export interface GlobalModalControl {
99
+ evoke: (payload?: Record<string, unknown>) => void;
100
+ close: () => void;
101
+ update: (payload: Record<string, unknown>) => void;
102
+ }
103
+ /**
104
+ * 全局弹窗遥控器对象(AppLayout `v-model:globalModalRemote` / 架子 `v-model:remote`)。
105
+ * ---
106
+ * 按业务 key 寻址句柄三件套(evoke / close / update);**`modalKey` = 已注册全局弹窗
107
+ * key 清单**(架子 `registerConfig` / `unregisterConfig` 同步维护,与句柄同生命周期)——
108
+ * 触发端等调用方以 `modalKey.includes(key)` 显式判断「该 key 是否已注册」,
109
+ * `evoke` 无返回值,未注册直接调会 TypeError。
110
+ */
111
+ export type GlobalModalRemote = Record<string, GlobalModalControl> & {
112
+ /** 已注册全局弹窗 key 清单(架子 registerConfig/unregisterConfig 同步维护) */
113
+ modalKey: string[];
114
+ };
115
+ /** 架子内部配置注册面(专用 ModalPorter 推送 app 级弹窗配置;全局遥控器挂载源) */
116
+ export interface ShelfConfigEntry {
117
+ /** 业务弹窗 key(remote 对象键) */
118
+ key: string;
119
+ /** 组件或懒工厂 */
120
+ component: Component | (() => Promise<Component>);
121
+ /** 同 key 再 evoke 策略,缺省 "recreate" */
122
+ sameKeyStrategy?: ModalSameKeyStrategy;
123
+ }
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ /** 加载中(优先展示「加载中...」) */
3
+ loading?: boolean;
4
+ /** api 是否至少被调用过一次(false = 欢迎触发查询;true = 暂无数据) */
5
+ hasRequested?: boolean;
6
+ };
7
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ loading: boolean;
9
+ hasRequested: boolean;
10
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
+ export default _default;
@@ -193,6 +193,12 @@ SQ extends Record<string, any>,
193
193
  F extends Record<string, any>> {
194
194
  /** 展示分页器 */
195
195
  showPager?: boolean;
196
+ /**
197
+ * 挂载后是否立即触发初始化查询(默认 true 查)。
198
+ * - false:挂载不自动拉数——空态「欢迎触发查询」(hasRequested 自判)、
199
+ * KeepAlive 激活不自动刷新,用户手动查询后恢复。
200
+ */
201
+ initialSearch?: boolean;
196
202
  /** 是否显示切换视图按钮,默认 false */
197
203
  showSwitchView?: boolean;
198
204
  /** 是否显示 toolbar(顶层开关,默认 true,优先级高于 toolbar.leftFeatures / rightFeatures) */
@@ -205,6 +211,11 @@ F extends Record<string, any>> {
205
211
  pageSizeInit?: number;
206
212
  pageSizeOptions?: number[];
207
213
  pageLayout?: string;
214
+ /**
215
+ * 分页器页码是否带背景框(透传 ElPagination `background`,默认 true = 现形态)。
216
+ * false = EP 默认无框纯数字链接形态(最简;窄栏 / 精简场景用)。
217
+ */
218
+ paginationBackground?: boolean;
208
219
  rowKey: Extract<keyof T, string> | ((row: T) => string);
209
220
  /** 请求api */
210
221
  api: (params: TableApiParams<SQ>) => Promise<TableApiResult<T>>;
@@ -19,7 +19,7 @@ export interface ViewLayoutProps<P = Record<string, any>, R = any> {
19
19
  api: (params?: P) => Promise<R>;
20
20
  /** 拉取参数;响应式变化不自动重拉(需要时调 scope.refresh()) */
21
21
  params?: P;
22
- /** 精细流:默认 true——包 HeightProvider 精确扣 toolbar reserve,内容区可用高(slot scope viewportHeight + 容器 max-height);false=自然流(无高度预算,内容按自身尺寸) */
22
+ /** 精细流:默认 false(自然流:无高度预算,内容按自身尺寸);true=包 HeightProvider 精确扣 toolbar reserve,内容区可用高(slot scope viewportHeight + 容器 max-height */
23
23
  refine?: boolean;
24
24
  /** 显式视口高,优先级最高;未传降级 inject SCOPE_VIEWPORT_MAX_HEIGHT scope 链 */
25
25
  viewportHeight?: number;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@done-coding/admin-core",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "内部前端库"
5
5
  };
6
6
 
@@ -136,7 +136,7 @@ export declare function createAppStore<UserInfo = unknown, LoginParams = unknown
136
136
  changeAsideCollapseStatus: (status: boolean) => void;
137
137
  changeSidebarHasMenusStatus: (status: boolean) => void;
138
138
  changeIsDarkTheme: (status: boolean) => void;
139
- }, "name" | "bodyStyle" | "theme" | "showHeader" | "keepAlive" | "bodyShimPadding" | "isDarkTheme" | "showFooter" | "showSidebar" | "showAside" | "showBreadcrumb" | "headerStyle" | "footerStyle" | "sidebarStyle" | "asideStyle" | "contentViewportInset" | "bodyShimStyle" | "viewportPadding" | "sidebarIsCollapse" | "asideIsCollapse">, Pick<{
139
+ }, "name" | "theme" | "showHeader" | "keepAlive" | "bodyShimPadding" | "isDarkTheme" | "showFooter" | "showSidebar" | "showAside" | "showBreadcrumb" | "headerStyle" | "footerStyle" | "sidebarStyle" | "asideStyle" | "bodyStyle" | "contentViewportInset" | "bodyShimStyle" | "viewportPadding" | "sidebarIsCollapse" | "asideIsCollapse">, Pick<{
140
140
  name: import('vue').ComputedRef<string>;
141
141
  isDarkTheme: import('vue').ComputedRef<boolean>;
142
142
  theme: import('vue').ComputedRef<{