@done-coding/forge-core 0.0.0-placeholder.0 → 0.100.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/es/bridge/badge.mjs +37 -0
- package/es/bridge/config-hook.mjs +58 -0
- package/es/bridge/contracts/event.mjs +102 -0
- package/es/bridge/contracts/index.mjs +5 -0
- package/es/bridge/event.mjs +87 -0
- package/es/bridge/index.mjs +331 -0
- package/es/bridge/layout.mjs +100 -0
- package/es/bridge/permission.mjs +91 -0
- package/es/bridge/plugin.mjs +39 -0
- package/es/bridge/route.mjs +78 -0
- package/es/bridge/state.mjs +61 -0
- package/es/bridge/storage.mjs +26 -0
- package/es/bridge/theme/index.mjs +233 -0
- package/es/bridge/theme/persist.mjs +18 -0
- package/es/bridge/theme/system-dark.mjs +18 -0
- package/es/components/basic/AppCollapseToggle.vue.mjs +7 -0
- package/es/components/basic/AppCollapseToggle.vue2.mjs +63 -0
- package/es/components/basic/action-btn/ActionBtn.vue.mjs +200 -0
- package/es/components/basic/action-btn/ActionBtn.vue2.mjs +4 -0
- package/es/components/basic/action-btn/index.mjs +4 -0
- package/es/components/basic/action-btn/use-action-btn-report.mjs +54 -0
- package/es/components/basic/action-btn-group/ActionBtnGroup.vue.mjs +69 -0
- package/es/components/basic/action-btn-group/ActionBtnGroup.vue2.mjs +4 -0
- package/es/components/basic/action-btn-group/index.mjs +4 -0
- package/es/components/basic/action-btn-group/use-action-btn-group-report.mjs +30 -0
- package/es/components/basic/display-contracts/index.mjs +1 -0
- package/es/components/basic/drag-float/DragFloat.vue.mjs +7 -0
- package/es/components/basic/drag-float/DragFloat.vue2.mjs +109 -0
- package/es/components/basic/drag-float/index.mjs +4 -0
- package/es/components/basic/height-provider/HeightProvider.vue.mjs +62 -0
- package/es/components/basic/height-provider/HeightProvider.vue2.mjs +4 -0
- package/es/components/basic/height-provider/index.mjs +4 -0
- package/es/components/basic/index.mjs +4 -0
- package/es/components/basic/shadow-clone/ShadowClone.vue.mjs +32 -0
- package/es/components/basic/shadow-clone/ShadowClone.vue2.mjs +4 -0
- package/es/components/basic/shadow-clone/index.mjs +4 -0
- package/es/components/basic/shadow-clone/use-shadow-target.mjs +76 -0
- package/es/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue.mjs +7 -0
- package/es/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue2.mjs +68 -0
- package/es/components/basic/slot-layout-flow-aside/index.mjs +4 -0
- package/es/components/basic/slot-layout-template/SlotLayoutTemplate.vue.mjs +30 -0
- package/es/components/basic/slot-layout-template/SlotLayoutTemplate.vue2.mjs +4 -0
- package/es/components/basic/slot-layout-template/index.mjs +4 -0
- package/es/components/basic/watch-size/WatchSize.vue.mjs +73 -0
- package/es/components/basic/watch-size/WatchSize.vue2.mjs +4 -0
- package/es/components/basic/watch-size/index.mjs +4 -0
- package/es/components/config/app-theme/AppTheme.vue.mjs +7 -0
- package/es/components/config/app-theme/AppTheme.vue2.mjs +82 -0
- package/es/components/config/app-theme/index.mjs +4 -0
- package/es/components/data/badge-mark/BadgeMark.vue.mjs +7 -0
- package/es/components/data/badge-mark/BadgeMark.vue2.mjs +80 -0
- package/es/components/data/badge-mark/index.mjs +4 -0
- package/es/components/data/badge-mark/use-badge-mask.mjs +82 -0
- package/es/components/data/badge-mark/use-badge.mjs +106 -0
- package/es/components/data/boolean-tag/BooleanTag.vue.mjs +36 -0
- package/es/components/data/boolean-tag/BooleanTag.vue2.mjs +4 -0
- package/es/components/data/boolean-tag/index.mjs +4 -0
- package/es/components/data/image-preview-trigger/ImagePreviewTrigger.vue.mjs +38 -0
- package/es/components/data/image-preview-trigger/ImagePreviewTrigger.vue2.mjs +4 -0
- package/es/components/data/image-preview-trigger/index.mjs +4 -0
- package/es/components/data/modal-image-preview/ModalImagePreview.vue.mjs +52 -0
- package/es/components/data/modal-image-preview/ModalImagePreview.vue2.mjs +4 -0
- package/es/components/data/modal-image-preview/index.mjs +4 -0
- package/es/components/feedback/action-confirm/ActionConfirm.vue.mjs +7 -0
- package/es/components/feedback/action-confirm/ActionConfirm.vue2.mjs +143 -0
- package/es/components/feedback/action-confirm/index.mjs +4 -0
- package/es/components/feedback/modal-confirm/ModalConfirm.vue.mjs +8 -0
- package/es/components/feedback/modal-confirm/ModalConfirm.vue2.mjs +243 -0
- package/es/components/feedback/modal-confirm/index.mjs +4 -0
- package/es/components/feedback/modal-video-preview/ModalVideoPreview.vue.mjs +8 -0
- package/es/components/feedback/modal-video-preview/ModalVideoPreview.vue2.mjs +93 -0
- package/es/components/feedback/modal-video-preview/index.mjs +4 -0
- package/es/components/feedback/preview-keys/index.mjs +7 -0
- package/es/components/feedback/preview-keys/keys.mjs +7 -0
- package/es/components/feedback/shelf-contracts/index.mjs +1 -0
- package/es/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue.mjs +7 -0
- package/es/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue2.mjs +133 -0
- package/es/components/feedback/video-preview-trigger/index.mjs +4 -0
- package/es/components/other/TriggerAutoImport.vue.mjs +12 -0
- package/es/components/other/TriggerAutoImport.vue2.mjs +4 -0
- package/es/components/other/auto-refresh/AutoRefresh.vue.mjs +7 -0
- package/es/components/other/auto-refresh/AutoRefresh.vue2.mjs +96 -0
- package/es/components/other/auto-refresh/index.mjs +4 -0
- package/es/components/other/auto-refresh/use-auto-refresh-report.mjs +31 -0
- package/es/components/other/auto-refresh-contracts/index.mjs +1 -0
- package/es/components/other/auto-refresh-group/AutoRefreshGroup.vue.mjs +7 -0
- package/es/components/other/auto-refresh-group/AutoRefreshGroup.vue2.mjs +69 -0
- package/es/components/other/auto-refresh-group/index.mjs +4 -0
- package/es/components/other/auto-refresh-group/use-auto-refresh-group-report.mjs +12 -0
- package/es/components/other/index.mjs +4 -0
- package/es/config/badge-attr.mjs +6 -0
- package/es/config/index.mjs +19 -0
- package/es/config/list-model.mjs +13 -0
- package/es/config/modal-keys.mjs +6 -0
- package/es/config/route.mjs +6 -0
- package/es/config/slot-region.mjs +45 -0
- package/es/helpers/form.mjs +25 -0
- package/es/helpers/index.mjs +10 -0
- package/es/helpers/list-helper.mjs +77 -0
- package/es/hooks/activated.mjs +64 -0
- package/es/hooks/feel-size.mjs +46 -0
- package/es/hooks/index.mjs +31 -0
- package/es/hooks/menus-dispatch.mjs +85 -0
- package/es/hooks/timeout.mjs +36 -0
- package/es/hooks/use-active-record.mjs +104 -0
- package/es/hooks/use-breakpoint.mjs +48 -0
- package/es/hooks/use-bridge-report.mjs +12 -0
- package/es/hooks/use-channel-viewport-height.mjs +43 -0
- package/es/hooks/use-context-defaults.mjs +44 -0
- package/es/hooks/use-custom-breakpoint.mjs +69 -0
- package/es/hooks/use-is-dev.mjs +16 -0
- package/es/hooks/use-observe-size.mjs +43 -0
- package/es/hooks/use-permission.mjs +12 -0
- package/es/hooks/use-surface.mjs +35 -0
- package/es/hooks/use-theme-apply.mjs +496 -0
- package/es/hooks/use-viewport-apply.mjs +52 -0
- package/es/index.mjs +179 -0
- package/es/inject/index.mjs +19 -0
- package/es/inject/key.mjs +70 -0
- package/es/injection-namespace.mjs +4 -0
- package/es/internals/index.mjs +16 -0
- package/es/router/group-redirect.mjs +26 -0
- package/es/router/guard/index.mjs +36 -0
- package/es/router/guard/login.mjs +6 -0
- package/es/router/guard/permission.mjs +6 -0
- package/es/router/index.mjs +10 -0
- package/es/store/app.mjs +306 -0
- package/es/store/index.mjs +8 -0
- package/es/store/router-permission.mjs +94 -0
- package/es/store/user.mjs +128 -0
- package/es/style.css +339 -0
- package/es/types/index.mjs +1 -0
- package/es/utils/dom.mjs +42 -0
- package/es/utils/export.mjs +39 -0
- package/es/utils/gap-scale.mjs +25 -0
- package/es/utils/id.mjs +7 -0
- package/es/utils/index.mjs +37 -0
- package/es/utils/permission.mjs +31 -0
- package/es/utils/router.mjs +42 -0
- package/es/utils/theme-scale.mjs +86 -0
- package/es/utils/time.mjs +24 -0
- package/package.json +232 -1
- package/types/bridge/badge.d.ts +215 -0
- package/types/bridge/config-hook.d.ts +12 -0
- package/types/bridge/contracts/bridge.d.ts +339 -0
- package/types/bridge/contracts/config.d.ts +519 -0
- package/types/bridge/contracts/event.d.ts +546 -0
- package/types/bridge/contracts/index.d.ts +3 -0
- package/types/bridge/event.d.ts +3 -0
- package/types/bridge/index.d.ts +28 -0
- package/types/bridge/layout.d.ts +102 -0
- package/types/bridge/permission.d.ts +31 -0
- package/types/bridge/plugin.d.ts +11 -0
- package/types/bridge/route.d.ts +36 -0
- package/types/bridge/state.d.ts +26 -0
- package/types/bridge/storage.d.ts +10 -0
- package/types/bridge/theme/index.d.ts +10 -0
- package/types/bridge/theme/persist.d.ts +23 -0
- package/types/bridge/theme/system-dark.d.ts +14 -0
- package/types/bridge/theme/types.d.ts +346 -0
- package/types/components/basic/AppCollapseToggle.vue.d.ts +14 -0
- package/types/components/basic/action-btn/ActionBtn.vue.d.ts +19 -0
- package/types/components/basic/action-btn/index.d.ts +1 -0
- package/types/components/basic/action-btn/use-action-btn-report.d.ts +12 -0
- package/types/components/basic/action-btn-group/ActionBtnGroup.vue.d.ts +18 -0
- package/types/components/basic/action-btn-group/index.d.ts +1 -0
- package/types/components/basic/action-btn-group/use-action-btn-group-report.d.ts +6 -0
- package/types/components/basic/display-contracts/index.d.ts +1 -0
- package/types/components/basic/display-contracts/types.d.ts +280 -0
- package/types/components/basic/drag-float/DragFloat.vue.d.ts +35 -0
- package/types/components/basic/drag-float/index.d.ts +1 -0
- package/types/components/basic/height-provider/HeightProvider.vue.d.ts +28 -0
- package/types/components/basic/height-provider/index.d.ts +1 -0
- package/types/components/basic/index.d.ts +1 -0
- package/types/components/basic/shadow-clone/ShadowClone.vue.d.ts +20 -0
- package/types/components/basic/shadow-clone/index.d.ts +1 -0
- package/types/components/basic/shadow-clone/use-shadow-target.d.ts +9 -0
- package/types/components/basic/slot-layout-flow-aside/SlotLayoutFlowAside.vue.d.ts +32 -0
- package/types/components/basic/slot-layout-flow-aside/index.d.ts +2 -0
- package/types/components/basic/slot-layout-flow-aside/types.d.ts +10 -0
- package/types/components/basic/slot-layout-template/SlotLayoutTemplate.vue.d.ts +48 -0
- package/types/components/basic/slot-layout-template/index.d.ts +1 -0
- package/types/components/basic/watch-size/WatchSize.vue.d.ts +45 -0
- package/types/components/basic/watch-size/index.d.ts +1 -0
- package/types/components/config/app-theme/AppTheme.vue.d.ts +2 -0
- package/types/components/config/app-theme/index.d.ts +1 -0
- package/types/components/data/badge-mark/BadgeMark.vue.d.ts +212 -0
- package/types/components/data/badge-mark/index.d.ts +1 -0
- package/types/components/data/badge-mark/use-badge-mask.d.ts +8 -0
- package/types/components/data/badge-mark/use-badge.d.ts +78 -0
- package/types/components/data/boolean-tag/BooleanTag.vue.d.ts +8 -0
- package/types/components/data/boolean-tag/index.d.ts +1 -0
- package/types/components/data/image-preview-trigger/ImagePreviewTrigger.vue.d.ts +41 -0
- package/types/components/data/image-preview-trigger/index.d.ts +1 -0
- package/types/components/data/modal-image-preview/ModalImagePreview.vue.d.ts +31 -0
- package/types/components/data/modal-image-preview/index.d.ts +1 -0
- package/types/components/feedback/action-confirm/ActionConfirm.vue.d.ts +33 -0
- package/types/components/feedback/action-confirm/index.d.ts +1 -0
- package/types/components/feedback/modal-confirm/ModalConfirm.vue.d.ts +120 -0
- package/types/components/feedback/modal-confirm/index.d.ts +2 -0
- package/types/components/feedback/modal-confirm/types.d.ts +4 -0
- package/types/components/feedback/modal-video-preview/ModalVideoPreview.vue.d.ts +40 -0
- package/types/components/feedback/modal-video-preview/index.d.ts +1 -0
- package/types/components/feedback/preview-keys/index.d.ts +2 -0
- package/types/components/feedback/preview-keys/keys.d.ts +14 -0
- package/types/components/feedback/shelf-contracts/index.d.ts +1 -0
- package/types/components/feedback/shelf-contracts/types.d.ts +1 -0
- package/types/components/feedback/video-preview-trigger/VideoPreviewTrigger.vue.d.ts +46 -0
- package/types/components/feedback/video-preview-trigger/index.d.ts +1 -0
- package/types/components/other/TriggerAutoImport.vue.d.ts +17 -0
- package/types/components/other/auto-refresh/AutoRefresh.vue.d.ts +14 -0
- package/types/components/other/auto-refresh/index.d.ts +1 -0
- package/types/components/other/auto-refresh/use-auto-refresh-report.d.ts +1 -0
- package/types/components/other/auto-refresh-contracts/index.d.ts +1 -0
- package/types/components/other/auto-refresh-contracts/types.d.ts +17 -0
- package/types/components/other/auto-refresh-group/AutoRefreshGroup.vue.d.ts +18 -0
- package/types/components/other/auto-refresh-group/index.d.ts +1 -0
- package/types/components/other/auto-refresh-group/use-auto-refresh-group-report.d.ts +3 -0
- package/types/components/other/index.d.ts +1 -0
- package/types/config/badge-attr.d.ts +26 -0
- package/types/config/index.d.ts +5 -0
- package/types/config/list-model.d.ts +49 -0
- package/types/config/modal-keys.d.ts +12 -0
- package/types/config/route.d.ts +4 -0
- package/types/config/slot-region.d.ts +72 -0
- package/types/helpers/form.d.ts +8 -0
- package/types/helpers/index.d.ts +3 -0
- package/types/helpers/list-helper.d.ts +35 -0
- package/types/helpers/types.d.ts +15 -0
- package/types/hooks/activated.d.ts +36 -0
- package/types/hooks/feel-size.d.ts +10 -0
- package/types/hooks/index.d.ts +12 -0
- package/types/hooks/menus-dispatch.d.ts +35 -0
- package/types/hooks/timeout.d.ts +7 -0
- package/types/hooks/use-active-record.d.ts +64 -0
- package/types/hooks/use-breakpoint.d.ts +4 -0
- package/types/hooks/use-bridge-report.d.ts +3 -0
- package/types/hooks/use-channel-viewport-height.d.ts +22 -0
- package/types/hooks/use-context-defaults.d.ts +39 -0
- package/types/hooks/use-custom-breakpoint.d.ts +17 -0
- package/types/hooks/use-is-dev.d.ts +24 -0
- package/types/hooks/use-observe-size.d.ts +36 -0
- package/types/hooks/use-permission.d.ts +14 -0
- package/types/hooks/use-surface.d.ts +45 -0
- package/types/hooks/use-theme-apply.d.ts +34 -0
- package/types/hooks/use-viewport-apply.d.ts +20 -0
- package/types/index.d.ts +33 -0
- package/types/inject/index.d.ts +1 -0
- package/types/inject/key.d.ts +247 -0
- package/types/injection-namespace.d.ts +4 -0
- package/types/internals/index.d.ts +6 -0
- package/types/router/group-redirect.d.ts +14 -0
- package/types/router/guard/index.d.ts +20 -0
- package/types/router/guard/login.d.ts +4 -0
- package/types/router/guard/permission.d.ts +4 -0
- package/types/router/guard/types.d.ts +14 -0
- package/types/router/index.d.ts +2 -0
- package/types/store/app.d.ts +219 -0
- package/types/store/index.d.ts +3 -0
- package/types/store/router-permission.d.ts +79 -0
- package/types/store/user.d.ts +64 -0
- package/types/types/app-layout.d.ts +42 -0
- package/types/types/dc-path.d.ts +2 -0
- package/types/types/dot-path.d.ts +13 -0
- package/types/types/index.d.ts +9 -0
- package/types/types/list-api.d.ts +17 -0
- package/types/types/modal-shelf.d.ts +123 -0
- package/types/types/nest-form.d.ts +8 -0
- package/types/types/permission.d.ts +31 -0
- package/types/types/route.d.ts +141 -0
- package/types/types/utility-types.d.ts +25 -0
- package/types/utils/dom.d.ts +61 -0
- package/types/utils/export.d.ts +35 -0
- package/types/utils/gap-scale.d.ts +46 -0
- package/types/utils/id.d.ts +2 -0
- package/types/utils/index.d.ts +8 -0
- package/types/utils/permission.d.ts +16 -0
- package/types/utils/router.d.ts +18 -0
- package/types/utils/theme-scale.d.ts +78 -0
- package/types/utils/time.d.ts +2 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VideoPreviewTrigger —— 视频预览触发原语(默认插槽 = 封面三形态 + 播放图标,
|
|
3
|
+
* 吐 `open` 供自定义内容复用;核心唤起逻辑内置)。与 ImagePreviewTrigger 对等成对
|
|
4
|
+
* (视频无 el 原生预览,弹窗是唯一路径——决策链保留;图片触发端点击直达原生预览,
|
|
5
|
+
* 无决策链)。无封面默认 frameCover 抠首帧(#t=0.01 + preload=metadata 只拉元数据 +
|
|
6
|
+
* 首帧,不拉全片);关 frameCover 才深色占位零请求。$attrs 只落封面层(coverUrl 路径)
|
|
7
|
+
* ——弹窗端视频属性(autoplay/muted 等)在 ModalVideoPreview 上配,
|
|
8
|
+
* [MUST NOT] 经本组件透传。详见 docs/README-VideoPreviewTrigger.md。
|
|
9
|
+
*/
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
/** 视频地址(点击唤起预览弹窗的视频) */
|
|
12
|
+
url: string;
|
|
13
|
+
/** 封面图地址;空 → 首帧封面(frameCover 默认开)或深色占位(关);有 → ElImage 封面(原生懒加载)+ 图标叠加 */
|
|
14
|
+
coverUrl?: string;
|
|
15
|
+
/** 无 coverUrl 时用 video#t=0.01 首帧作封面(preload=metadata 只拉元数据 + 首帧);关 = 深色占位 + 播放图标(零请求) */
|
|
16
|
+
frameCover?: boolean;
|
|
17
|
+
/** 封面图懒加载(仅 coverUrl 有值时生效) */
|
|
18
|
+
lazy?: boolean;
|
|
19
|
+
/** 是否可点击唤起预览(false = 纯展示封面/占位) */
|
|
20
|
+
preview?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare function __VLS_template(): {
|
|
23
|
+
attrs: Partial<{}>;
|
|
24
|
+
slots: {
|
|
25
|
+
default?(_: {
|
|
26
|
+
open: (event?: Event) => void;
|
|
27
|
+
}): any;
|
|
28
|
+
placeholder?(_: {}): any;
|
|
29
|
+
error?(_: {}): any;
|
|
30
|
+
};
|
|
31
|
+
refs: {};
|
|
32
|
+
rootEl: any;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
35
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
36
|
+
lazy: boolean;
|
|
37
|
+
preview: boolean;
|
|
38
|
+
frameCover: boolean;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as VideoPreviewTrigger } from './VideoPreviewTrigger.vue';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: any;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AutoRefreshProps } from '../auto-refresh-contracts';
|
|
2
|
+
type __VLS_Props = AutoRefreshProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: boolean;
|
|
5
|
+
"interval"?: number;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: boolean) => any;
|
|
9
|
+
"update:interval": (value: number) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
12
|
+
"onUpdate:interval"?: ((value: number) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AutoRefresh } from './AutoRefresh.vue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useAutoRefreshReport(getEnabled: () => boolean, getInterval: () => number): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** AutoRefresh 组件 props */
|
|
2
|
+
export interface AutoRefreshProps {
|
|
3
|
+
/** 刷新方法,返回 Promise。失败不影响下轮定时 */
|
|
4
|
+
refreshFn: () => Promise<unknown>;
|
|
5
|
+
/** 是否不允许自动刷新。true 时清 timer 且不排下轮 */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface AutoRefreshGroupProps extends Omit<AutoRefreshProps, "disabled"> {
|
|
9
|
+
/** 是否显示自动刷新开关 */
|
|
10
|
+
showAutoRefresh?: boolean;
|
|
11
|
+
/** 是否显示刷新按钮 */
|
|
12
|
+
showRefresh?: boolean;
|
|
13
|
+
/** 加载是否正在进行中 */
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
/** 是否需要根节点 */
|
|
16
|
+
needRootNode?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AutoRefreshGroupProps } from '../auto-refresh-contracts';
|
|
2
|
+
type __VLS_Props = AutoRefreshGroupProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
"isAutoRefresh"?: boolean;
|
|
5
|
+
"interval"?: number;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
"update:interval": (value: number) => any;
|
|
9
|
+
"update:isAutoRefresh": (value: boolean) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:interval"?: ((value: number) => any) | undefined;
|
|
12
|
+
"onUpdate:isAutoRefresh"?: ((value: boolean) => any) | undefined;
|
|
13
|
+
}>, {
|
|
14
|
+
showAutoRefresh: boolean;
|
|
15
|
+
showRefresh: boolean;
|
|
16
|
+
needRootNode: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AutoRefreshGroup } from './AutoRefreshGroup.vue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TriggerAutoImport } from './TriggerAutoImport.vue';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 徽标 DOM 契约属性名(跨包共享的单一真源)。
|
|
3
|
+
*
|
|
4
|
+
* 与 {@link DC_SLOT_ATTR} 同性质:**运行期 DOM 上的约定**,core 内部消费之外,
|
|
5
|
+
* 外部包(如引导插件 `forge-plugin-tour`)也要按它 `querySelector` 定位锚点
|
|
6
|
+
* ⇒ [MUST NOT] 让任何一方硬编码字面量,改名时只该改这一处。
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* 宿主声明属性 —— 调用点打在**可点击的那个元素**上(按钮 / 菜单项 / 模块条 / tile 卡片)。
|
|
10
|
+
*
|
|
11
|
+
* 宿主形态因调用点而异,core [MUST NOT] 硬编码一张选择器表去猜(EP 换版即碎),
|
|
12
|
+
* 故由调用点自报;`BadgeMark` 的遮挡 hook 与外部引导插件都靠向上 `closest` 找它。
|
|
13
|
+
* **无值属性**(`data-dc-badge-host`),存在即声明。
|
|
14
|
+
*/
|
|
15
|
+
export declare const BADGE_HOST_ATTR = "data-dc-badge-host";
|
|
16
|
+
/**
|
|
17
|
+
* 徽标键回写属性 —— `BadgeMark` **命中标时**写在角标根元素上,值 = 该标的 key。
|
|
18
|
+
*
|
|
19
|
+
* 与 {@link BADGE_HOST_ATTR} 的分工:host 只回答「这是个宿主」,本属性回答
|
|
20
|
+
* 「**是哪个 key 的**」。外部引导插件据此把 `key → DOM` 打通:
|
|
21
|
+
* `[data-dc-badge-key="K"]` → `.closest([data-dc-badge-host])`(够不到则用角标自身)。
|
|
22
|
+
*
|
|
23
|
+
* 只在有标时存在(与角标同生命周期)——无标时不渲染角标,也就没有可导览的锚点,
|
|
24
|
+
* 这正是想要的语义,[MUST NOT] 改成「宿主恒挂 key」(会产出一堆指向空标的死锚点)。
|
|
25
|
+
*/
|
|
26
|
+
export declare const BADGE_KEY_ATTR = "data-dc-badge-key";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DotToObject, UnionToIntersection } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 列表 KEY 配置接口
|
|
4
|
+
* ---
|
|
5
|
+
* 约束消费方传入的 KEY_CONFIG 对象 shape,后续 BuildListModel / BuildListParams 工具基于本接口推导
|
|
6
|
+
*/
|
|
7
|
+
export interface ListModelKeyConfig {
|
|
8
|
+
PAGE_SIZE_KEY: string;
|
|
9
|
+
CURRENT_PAGE_KEY: string;
|
|
10
|
+
TOTAL_KEY: string;
|
|
11
|
+
LIST_KEY: string;
|
|
12
|
+
}
|
|
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
|
+
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
|
+
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
|
+
export declare const APP_API_LIST_MODEL_KEY_CONFIG: Readonly<{
|
|
31
|
+
/** 当前页码 key */
|
|
32
|
+
CURRENT_PAGE_KEY: "page.page";
|
|
33
|
+
/** 每页条数 key */
|
|
34
|
+
PAGE_SIZE_KEY: "page.pageSize";
|
|
35
|
+
/** 总数 key */
|
|
36
|
+
TOTAL_KEY: "page.totalRecord";
|
|
37
|
+
/** 数据列表 key */
|
|
38
|
+
LIST_KEY: "items";
|
|
39
|
+
}>;
|
|
40
|
+
/** 应用接口列表模型 */
|
|
41
|
+
export type AppApiListModel<T = any> = BuildListModel<typeof APP_API_LIST_MODEL_KEY_CONFIG, T>;
|
|
42
|
+
/** 应用接口列表分页参数 key */
|
|
43
|
+
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
|
+
export type AppApiListNoPageParamsKey = Exclude<string, AppApiListPageParamsKey>;
|
|
46
|
+
/** 应用接口列表请求参数模型 */
|
|
47
|
+
export type AppApiListParamsModel<P extends Record<AppApiListNoPageParamsKey, any> = Record<AppApiListNoPageParamsKey, any>> = BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG, Partial<P>>;
|
|
48
|
+
/** 应用接口列表请求参数模型(排除分页参数) */
|
|
49
|
+
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>>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 全局图片预览弹窗预置 key(core 预置,见 README-ModalImagePreview / README-AppLayout)。
|
|
3
|
+
* ---
|
|
4
|
+
* 三重身份:remote 遥控器对象上的键(`remote[APP_GLOBAL_IMAGE_PREVIEW_KEY]`)、
|
|
5
|
+
* `modalKey` 清单条目(触发端 `modalKey.includes()` 显式判断)、`ModalShelfMap`
|
|
6
|
+
* 计算属性名(evoke payload 全链类型化)。
|
|
7
|
+
* AppLayout `enableGlobalImagePreview` 开启后以 `ModalImagePreview` 按此 key 注册;
|
|
8
|
+
* 触发端 `ImagePreviewTrigger` 经遥控器按此 key 唤起。
|
|
9
|
+
*/
|
|
10
|
+
export declare const APP_GLOBAL_IMAGE_PREVIEW_KEY: "appGlobalImagePreview";
|
|
11
|
+
/** 全局视频预览弹窗预置 key(同上;AppLayout `enableGlobalVideoPreview` 注册) */
|
|
12
|
+
export declare const APP_GLOBAL_VIDEO_PREVIEW_KEY: "appGlobalVideoPreview";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 直系父上下文槽位标识(useContextDefaults 消费)。
|
|
3
|
+
*
|
|
4
|
+
* 宿主(AppPage / TabsMain)在槽内容**直系父包裹元素**上挂 `DC_SLOT_ATTR`,
|
|
5
|
+
* 消费 hook(useContextDefaults)读 `$el.parentElement` 命中 → 按 prop 解析上下文默认。
|
|
6
|
+
* 详见 spec:`docs/specs/2026-08-14-080509-moderate-usecontextdefaults直系父上下文默认/spec.md`
|
|
7
|
+
*/
|
|
8
|
+
/** 槽位 attr key(唯一共享来源,宿主 / 消费方 / hook 同源 import)。 */
|
|
9
|
+
export declare const DC_SLOT_ATTR = "data-dc-slot";
|
|
10
|
+
/**
|
|
11
|
+
* 槽位区域数字枚举(宿主前缀命名)。
|
|
12
|
+
*
|
|
13
|
+
* 值用数字:运行期 DOM 只见数字、看不出槽位语义(防"有心人"扫 DOM 一眼识别);
|
|
14
|
+
* ⚠️ 注意这只是防扫一眼,**不是安全边界**——core 在公网 npm,枚举映射在包产物里可还原
|
|
15
|
+
* (L2/LiveView 才是秘方保护正解)。
|
|
16
|
+
*/
|
|
17
|
+
export declare enum SlotRegion {
|
|
18
|
+
/** AppPage 默认槽(页面主体,ModalShelf 透明包裹后 `.app-page-shim` 为直系父) */
|
|
19
|
+
AppPage_Default = 1,
|
|
20
|
+
/** AppPage top 槽(通栏悬浮区) */
|
|
21
|
+
AppPage_Top = 2,
|
|
22
|
+
/** AppPage right 槽(侧向悬浮区) */
|
|
23
|
+
AppPage_Right = 3,
|
|
24
|
+
/** AppPage bottom 槽(通栏悬浮区) */
|
|
25
|
+
AppPage_Bottom = 4,
|
|
26
|
+
/** AppPage left 槽(侧向悬浮区) */
|
|
27
|
+
AppPage_Left = 5,
|
|
28
|
+
/** TabsMain 页签内容(tab item) */
|
|
29
|
+
TabsMain_Item = 6,
|
|
30
|
+
/**
|
|
31
|
+
* ModalConfirm 正文区(弹窗 / 抽屉的默认插槽直系父)。
|
|
32
|
+
*
|
|
33
|
+
* 用途:告诉后代「**你已经站在一块面上了**」—— 弹窗正文的底是
|
|
34
|
+
* `--el-bg-color-overlay`(抬升面),后代 [MUST NOT] 再刷一层面色,
|
|
35
|
+
* 否则暗色下 overlay `#1d1e1f` 上盖 `#141414` 会出现「弹窗里凹下去一块」
|
|
36
|
+
* (亮色两者都是 `#fff`,**看不出来** —— [MUST NOT] 只用亮色截图验收)。
|
|
37
|
+
*/
|
|
38
|
+
ModalConfirm_Body = 7,
|
|
39
|
+
/**
|
|
40
|
+
* ModalConfirm **抽屉形态**的正文区(drawer 的默认插槽直系父)。
|
|
41
|
+
*
|
|
42
|
+
* 🔴 **与 {@link ModalConfirm_Body} 是两个档,不是一个档的两种写法**:
|
|
43
|
+
* 抽屉正文自 v0.32.0 起取**底色**(k2vnfp)⇒ 它**不再是一块面**
|
|
44
|
+
* ⇒ 后代 [MUST] 自持面(与 modal 正文那档**正好相反**)。
|
|
45
|
+
*
|
|
46
|
+
* ⚠️ 上面那条标记的语义一直是「**你脚下是一块面**」。抽屉正文改成底之后它就不再是
|
|
47
|
+
* 那个意思了 —— 所以是**换一个标**,[MUST NOT] 把那个标的含义反过来
|
|
48
|
+
* (反过来会把 modal 形态一起改掉,而 modal 正文仍是面、那儿的自动关面是对的)。
|
|
49
|
+
*
|
|
50
|
+
* ⚠️ 它同时还被「**refine 默认开**」那一路消费(`ViewLayout` / `TabsMain`)——
|
|
51
|
+
* 抽屉与弹窗**两档都 provide 有界可用高** ⇒ 那一路 [MUST] 把两个档都列上,
|
|
52
|
+
* 漏一个就是「抽屉里的 ViewLayout 掉回自然流」。
|
|
53
|
+
*/
|
|
54
|
+
ModalConfirm_DrawerBody = 8
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 读 DOM 槽位数字值并守卫:数字读回是字符串,[MUST] 经本函数 `Number()` 强转 + 枚举值校验;
|
|
58
|
+
* 缺失 / 非法 → `undefined`(未命中 region = 不处理,由消费 hook 决定原样透传)。
|
|
59
|
+
*/
|
|
60
|
+
export declare const parseSlotRegion: (raw: string | null | undefined) => SlotRegion | undefined;
|
|
61
|
+
/** `AppPage` 四向方位槽名(= 插槽名,报错文案直接拼 `#${name}`)。 */
|
|
62
|
+
export type AppPageSlotName = "top" | "right" | "bottom" | "left";
|
|
63
|
+
/** `AppPage` 四向方位槽名清单(**不含默认槽**——默认槽是正确落点)。 */
|
|
64
|
+
export declare const APP_PAGE_SIDE_SLOTS: readonly AppPageSlotName[];
|
|
65
|
+
/**
|
|
66
|
+
* `AppPage` 四向方位槽 region → 槽名;默认槽 / 非 AppPage region / 未命中 → `undefined`。
|
|
67
|
+
*
|
|
68
|
+
* 用途 = **误用检测的公共判据**(ModalPorter 落错槽 / AppPage 空壳槽),两处同源一份映射,
|
|
69
|
+
* [MUST NOT] 各写一份 switch。
|
|
70
|
+
* 🔴 [MUST NOT] 把 `AppPage_Default` 算进来——默认槽是**正确**落点,不是方位槽。
|
|
71
|
+
*/
|
|
72
|
+
export declare const resolveAppPageSlotName: (region: SlotRegion | undefined) => AppPageSlotName | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormItemRule } from 'element-plus';
|
|
2
|
+
/**
|
|
3
|
+
* 密码规则
|
|
4
|
+
*/
|
|
5
|
+
export declare const passwordRule: FormItemRule;
|
|
6
|
+
export declare const getConfirmPasswordRule: (getPassword: () => string) => FormItemRule;
|
|
7
|
+
/** 选择框全选值 */
|
|
8
|
+
export declare const FORM_CONFIG_SELECT_ALL_VALUE: string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TableApiParams, TableApiResult } from '../types';
|
|
2
|
+
export interface FetchListAllOptions {
|
|
3
|
+
/** 单页大小,默认 100,范围 [1, 1000] */
|
|
4
|
+
pageSize?: number;
|
|
5
|
+
/** 累计抓取上限,默认 10000;totalRecord > limit 则 throw */
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
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
|
+
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
|
+
export type ListApiSource<T> = T[] | (() => T[]) | (() => Promise<T[]>);
|
|
24
|
+
/**
|
|
25
|
+
* 用本地数组 / 同步函数 / 异步函数生成符合 TableMain :api prop 签名的 api
|
|
26
|
+
* ---
|
|
27
|
+
* 内部识别 source 类型 + 分页切片;无缓存,每次调用 source 重新求值
|
|
28
|
+
*/
|
|
29
|
+
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
|
+
export declare function countAll<P extends Record<string, any> = {}>(api: (params: TableApiParams<P>) => Promise<TableApiResult<any>>, baseParams?: P): Promise<number>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 深度递归 Partial(函数类型保持不变,object 类型字段递归可选)
|
|
3
|
+
* ---
|
|
4
|
+
* 应用场景:SDK 请求参数嵌套结构的可选化(如 PagingInput)
|
|
5
|
+
*/
|
|
6
|
+
export type DeepPartial<T> = T extends (...args: any[]) => any ? T : T extends object ? {
|
|
7
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
8
|
+
} : T;
|
|
9
|
+
/**
|
|
10
|
+
* 分页请求参数的可选包装
|
|
11
|
+
* ---
|
|
12
|
+
* 与 SDK 1.1.40 嵌套契约耦合:业务侧手包 list api wrapper 时
|
|
13
|
+
* 常以 PagingInput<RawApiParams> 作为入参类型,兜底字段缺失
|
|
14
|
+
*/
|
|
15
|
+
export type PagingInput<T> = DeepPartial<T>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** 激活信息 */
|
|
2
|
+
export interface ActivatedInfo {
|
|
3
|
+
isActivated: boolean;
|
|
4
|
+
triggerType: "mounted" | "activated" | "deactivated" | "unmounted";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 是否激活。
|
|
8
|
+
*
|
|
9
|
+
* 四个生命周期时机(mounted / activated / deactivated / unmounted)各在对应钩子里
|
|
10
|
+
* **直接派发 watchFn**——`activatedInfo` 这个 ref 也只在这四处被改,别无他源,故不再经
|
|
11
|
+
* `watch` 中转。移除 `watch(activatedInfo, …, { immediate: true })` 同时根治了两个 bug:
|
|
12
|
+
* - **卸载不派发(监听泄漏)**:`watch` 默认 `flush:'pre'` 是队列 job,真·卸载时 watcher 在
|
|
13
|
+
* `scope.stop()` 后才轮到刷新、被跳过 → watchFn 收不到 `triggerType:"unmounted"`。直接派发即修。
|
|
14
|
+
* - **初始 false 陷阱**:`immediate` 种子(setup 期、isActivated=false、早于 onMounted)会让非幂等
|
|
15
|
+
* 副作用在激活前误触发一次。无 watch → 无种子 → 首次派发即 onMounted,陷阱消失(故无需 hasMounted)。
|
|
16
|
+
*
|
|
17
|
+
* 注:`useActivated((info) => …)` 里绑 window/document/matchMedia 等外部 target 监听的
|
|
18
|
+
* 「随激活态绑解」现在卸载会正常解绑,无需任何 opt-in。
|
|
19
|
+
*/
|
|
20
|
+
export declare const useActivated: (watchFn?: (info: ActivatedInfo) => void) => {
|
|
21
|
+
isActivated: import('vue').ComputedRef<boolean>;
|
|
22
|
+
activatedInfo: import('vue').ComputedRef<{
|
|
23
|
+
readonly isActivated: boolean;
|
|
24
|
+
readonly triggerType: "mounted" | "activated" | "deactivated" | "unmounted";
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated 请使用 useActivated 替代
|
|
29
|
+
* @example useActivated((info) => { info.isActivated && callback(info) })
|
|
30
|
+
* 激活时执行时间 */
|
|
31
|
+
export declare const useActivatedExec: (callback: (info: ActivatedInfo) => void) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated 请使用 useActivated 替代
|
|
34
|
+
* @example useActivated((info) => { info.isActivated ? bind(info) : unbind(info) })
|
|
35
|
+
* 激活时监听事件 */
|
|
36
|
+
export declare const useActivatedEvent: (bind: (info: ActivatedInfo) => void, unbind: (info: ActivatedInfo) => void) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './use-breakpoint';
|
|
2
|
+
export * from './use-custom-breakpoint';
|
|
3
|
+
export * from './activated';
|
|
4
|
+
export * from './feel-size';
|
|
5
|
+
export * from './menus-dispatch';
|
|
6
|
+
export * from './timeout';
|
|
7
|
+
export * from './use-channel-viewport-height';
|
|
8
|
+
export * from './use-observe-size';
|
|
9
|
+
export * from './use-permission';
|
|
10
|
+
export * from './use-theme-apply';
|
|
11
|
+
export * from './use-viewport-apply';
|
|
12
|
+
export * from './use-bridge-report';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RouteMetaResolveRaw } from '../types';
|
|
2
|
+
/** 应用菜单数据分发 */
|
|
3
|
+
export declare const useMenusDataDispatch: ({ getMenus, getMenuFlatList, getExtractLevel1ToHeader, }: {
|
|
4
|
+
/** 菜单树 */
|
|
5
|
+
getMenus: () => RouteMetaResolveRaw[];
|
|
6
|
+
/** 扁平化菜单列表 */
|
|
7
|
+
getMenuFlatList: () => RouteMetaResolveRaw[];
|
|
8
|
+
/** 判断是否提取1级路由模块到HEADER */
|
|
9
|
+
getExtractLevel1ToHeader: () => boolean;
|
|
10
|
+
}) => {
|
|
11
|
+
sidebarMenus: import('vue').ComputedRef<RouteMetaResolveRaw[]>;
|
|
12
|
+
headerMenus: import('vue').ComputedRef<{
|
|
13
|
+
children: never[];
|
|
14
|
+
path: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
title: string;
|
|
17
|
+
routeLevel: number;
|
|
18
|
+
redirectToFirstChildRoute: boolean;
|
|
19
|
+
menuShow: boolean;
|
|
20
|
+
menuIcon?: import('vue').DefineComponent;
|
|
21
|
+
menuSort: number;
|
|
22
|
+
menuTarget: "_self" | "_blank";
|
|
23
|
+
childrenRaw: import('vue-router').RouteRecordRaw[];
|
|
24
|
+
parentPath: string;
|
|
25
|
+
parentPathList: string[];
|
|
26
|
+
permissionKey?: string | number;
|
|
27
|
+
permissionRequirement?: import('../types').PermissionRequirement;
|
|
28
|
+
checkPermission: boolean;
|
|
29
|
+
permissionEditShow: boolean;
|
|
30
|
+
needLogin: boolean;
|
|
31
|
+
}[]>;
|
|
32
|
+
activeMenu: import('vue').ComputedRef<RouteMetaResolveRaw | undefined>;
|
|
33
|
+
activeModuleMenu: import('vue').ComputedRef<RouteMetaResolveRaw | undefined>;
|
|
34
|
+
needRedirectToFirstChildMenu: import('vue').ComputedRef<RouteMetaResolveRaw | undefined>;
|
|
35
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 当前项唯一键:`string | number` **两种都是一等公民**——出口值保持业务数据里的原始类型
|
|
4
|
+
* (`rowKey` 是字段名时直接取 `row[rowKey]`,数字 id 出数字、字符串 id 出字符串),
|
|
5
|
+
* 仅**比对**时内部统一 `String()` 归一,故外部传另一种类型也照样命中。
|
|
6
|
+
*/
|
|
7
|
+
export type ActiveRecordKey = string | number;
|
|
8
|
+
/**
|
|
9
|
+
* 行 → 当前项键值(保原始类型)。`rowKey` 为字段名 → 直取 `row[rowKey]`(number 保持 number);
|
|
10
|
+
* 为取键函数 → 用其返回值(契约上是 string)。
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ [MUST NOT] 在此 `String()` 归一 —— 那会把业务的数字 id 强制变成字符串吐回去
|
|
13
|
+
* (归一只发生在比对处,见 `normalizeActiveKey`)。
|
|
14
|
+
*/
|
|
15
|
+
export declare const activeRecordValueOf: <T extends Record<string, any>>(row: T, rowKey: string | ((row: T) => string)) => ActiveRecordKey;
|
|
16
|
+
/**
|
|
17
|
+
* 「当前项」(active)双 model 同步内核(core 内部组合函数,**[MUST NOT] 出桶导出**——
|
|
18
|
+
* 见 hooks/index.ts 锁面注释;使用者可枚举:TableMain / DataListView / DataGridView)。
|
|
19
|
+
*
|
|
20
|
+
* `activeId`(唯一键)与 `activeData`(列表 item)**同生同灭**,由本 hook 守以下不变式
|
|
21
|
+
* (spec D2「先有列表,才有详情」):
|
|
22
|
+
*
|
|
23
|
+
* > `activeId` 有值 ⇒ `activeData` 必有值,且 `activeData` 恒为**列表数据原样**(非详情数据)。
|
|
24
|
+
*
|
|
25
|
+
* | 触发 | 行为 |
|
|
26
|
+
* | --- | --- |
|
|
27
|
+
* | 用户点击某项(`setActive(row)`) | 同时写两者(data 即被点行对象,天然一致) |
|
|
28
|
+
* | 外部写入 `activeData`(如序列导航切上/下一条) | **对等通道**:按行反查键 → 同步 `activeId`;行不在列表内 → 忽略 + `console.warn` + 回滚 |
|
|
29
|
+
* | 列表数据刷新 | 按当前 id 在新数据内重查 → 刷新 `activeData`;**查不到 → 两者一并清空** |
|
|
30
|
+
* | 外部写入不在列表内的 id | **忽略 + `console.warn`**(回滚到上一个合法值),[MUST NOT] 擅自清空用户既有选中 |
|
|
31
|
+
* | 外部写入 `undefined` | 合法清空(两者一并归零) |
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ 外部写入的校验与同步走 `watch`(值变化语义):**同一 tick 内把 `activeId` 改回原值**
|
|
34
|
+
* (如 `undefined → "1" → undefined`)净值未变、watch 不触发,`activeData` 会停在中间态。
|
|
35
|
+
* 实际写入路径(点击走 `setActive` 同步写两者、外部写入天然跨 tick)不会遇到;
|
|
36
|
+
* [MUST NOT] 在同一 tick 内对 `activeId` 做往返赋值。
|
|
37
|
+
*
|
|
38
|
+
* ⚠️ `activeId` **出口值保原始类型**(`rowKey` 为字段名时即 `row[rowKey]`,数字 id 出数字);
|
|
39
|
+
* 外部写入用另一种类型(如字符串 `"1"` 对数字 id)同样命中——比对统一 `String()` 归一,
|
|
40
|
+
* 且**保留调用方写入的原值**,不回写覆盖。
|
|
41
|
+
*
|
|
42
|
+
* @param options.data 当前列表数据(getter,数组整体重赋值时触发重查)
|
|
43
|
+
* @param options.keyOf 行 → 唯一键**原始值**(各消费方用自己的 rowKey 解析,
|
|
44
|
+
* [MUST] 走 {@link activeRecordValueOf} 保类型,[MUST NOT] 自行 `String()` 归一)
|
|
45
|
+
* @param options.activeId `v-model:activeId`
|
|
46
|
+
* @param options.activeData `v-model:activeData`
|
|
47
|
+
* @param options.name 消费方组件名(仅用于 warn 前缀)
|
|
48
|
+
* @param options.enabled 本实例是否接管不变式(默认 true)。**唯一用途**:TableMain 在
|
|
49
|
+
* `customView` 态把渲染与点击交给内层 `DataListView`(后者自带本 hook),此时 TableMain 侧
|
|
50
|
+
* [MUST] 关掉,否则同一对 model 上跑两份状态机 —— 双重 warn、两个 `lastValidId` 各自为政。
|
|
51
|
+
*/
|
|
52
|
+
export declare function useActiveRecord<T extends Record<string, any>>(options: {
|
|
53
|
+
data: () => T[];
|
|
54
|
+
keyOf: (row: T) => ActiveRecordKey;
|
|
55
|
+
activeId: Ref<ActiveRecordKey | undefined>;
|
|
56
|
+
activeData: Ref<T | undefined>;
|
|
57
|
+
name: string;
|
|
58
|
+
enabled?: () => boolean;
|
|
59
|
+
}): {
|
|
60
|
+
/** 该行是否为当前项 */
|
|
61
|
+
isActive: (row: T) => boolean;
|
|
62
|
+
/** 设为当前项(传 undefined = 清空);内部写入路径,不触发非法值告警 */
|
|
63
|
+
setActive: (row: T | undefined) => void;
|
|
64
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { ScopeViewportMaxHeight } from '../inject';
|
|
3
|
+
/** useChannelViewportHeight 第二参数 options */
|
|
4
|
+
export interface UseChannelViewportHeightOptions {
|
|
5
|
+
/** scope 链未命中时的最终兜底,默认 0(脱离容器体系不假定具体高;组件自有 floor 各管各) */
|
|
6
|
+
fallback?: number;
|
|
7
|
+
}
|
|
8
|
+
/** useChannelViewportHeight 入参对象形状(约定 reactive,props 即满足) */
|
|
9
|
+
export interface UseChannelViewportHeightMaybeProps {
|
|
10
|
+
/** props.viewportHeight,显式指定,优先级最高 */
|
|
11
|
+
viewportHeight?: number;
|
|
12
|
+
/** tabs 族 channel 父级标识——沿 scope 链找 `scope === parentChannel` 的祖先;setup 期快照,变更 console.error 忽略 */
|
|
13
|
+
parentChannel?: string;
|
|
14
|
+
}
|
|
15
|
+
/** useChannelViewportHeight 返回值 */
|
|
16
|
+
export interface UseChannelViewportHeightReturn {
|
|
17
|
+
/** 最终视口高度,链路 viewportHeight > scope 链(parentChannel 定向/就近) > fallback */
|
|
18
|
+
viewportHeightFinal: ComputedRef<number>;
|
|
19
|
+
/** inject 到的最近 scope 对象(未命中 undefined)——供 provider 型消费方(TabsRefineFlow)作 `parent` 续链 */
|
|
20
|
+
nearestScope: ScopeViewportMaxHeight | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare const useChannelViewportHeight: (maybeProps: UseChannelViewportHeightMaybeProps, options?: UseChannelViewportHeightOptions) => UseChannelViewportHeightReturn;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { SlotRegion } from '../config';
|
|
3
|
+
/** useContextDefaults resolver 上下文(resolver 内自带"显式 > 上下文 > 内建"合并)。 */
|
|
4
|
+
export interface UseContextDefaultsResolverCtx<P extends Record<string, any>> {
|
|
5
|
+
/** 直系父解析到的槽位区域(未命中 = undefined) */
|
|
6
|
+
parentInfo: SlotRegion | undefined;
|
|
7
|
+
/** props 原始值(未含上下文默认,含显式传值) */
|
|
8
|
+
props: P;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 直系父上下文默认值解析 hook(core 内部组合函数,**[MUST NOT] 出桶导出**——hooks 桶 index 注释锁面,规则 22;
|
|
12
|
+
* 使用者可枚举:ListLayout / ViewLayout / TabsMain)。
|
|
13
|
+
*
|
|
14
|
+
* 核心一句话:core 组件在特定父容器(槽位)中自动获得上下文默认值(如 ListLayout 放 AppPage#left/right
|
|
15
|
+
* 窄栏 → 分页配置自动窄栏化;ViewLayout/TabsMain refine 在 AppPage#default / TabsMain item → 默认 true),
|
|
16
|
+
* 消费方零传参;显式传 prop 仍优先。详见 spec:`docs/specs/2026-08-14-080509-moderate-usecontextdefaults直系父上下文默认/spec.md`
|
|
17
|
+
*
|
|
18
|
+
* 导出面 = `defaults` 声明过的键(动态名 `ctx${首字母大写}`,每个为 ComputedRef 最终值):
|
|
19
|
+
* `defaults: { refine }` → 返回 `{ ctxRefine: ComputedRef<...> }`;组件 `const { ctxRefine } = useContextDefaults(...)`。
|
|
20
|
+
* **[MUST NOT] 导出 defaults 之外的 props 键(不替代 props)**——组件其余 prop 照常 `props.xx`。
|
|
21
|
+
*
|
|
22
|
+
* 机制:
|
|
23
|
+
* - 直系父 DOM(`$el.parentElement`)上的 `DC_SLOT_ATTR`(数字)→ `parseSlotRegion` 守卫 → resolver 拿 `parentInfo`。
|
|
24
|
+
* - 对 `defaults` 每个键产独立 computed:`resolver({ props: getProps(), parentInfo: region })`;未命中 region
|
|
25
|
+
* 也跑 resolver——resolver 返回 `props.xx`(≡ 透传,零差异)。
|
|
26
|
+
* - resolver 自带合并:`props.xx ?? (parentInfo===X ? 上下文默认 : undefined)`(`??` 只在 undefined 走上下文 = 显式优先)。
|
|
27
|
+
* - region 结构静态(槽位不随生命周期变),挂载 / 激活后解析一次并缓存。
|
|
28
|
+
*
|
|
29
|
+
* 使用注意(规范注释,[MUST] 遵守):
|
|
30
|
+
* - 需上下文动态默认的 prop **[MUST NOT] 写 withDefaults 内建默认**(Boolean prop 缺席被 Vue 强转 false 会
|
|
31
|
+
* 短路 `??`,withDefaults 填 `undefined` 使缺席 ≡ undefined、合法;填内建 true/false 违规 → hook 首次调用
|
|
32
|
+
* 发 console.warn 防呆提示——次要流程,不阻塞)。详见本文件底部 warn 逻辑。
|
|
33
|
+
* - 模板 / 脚本一律用解构出的 `ctxXx`(模板 ComputedRef 自动解包),[MUST NOT] 用 `props.xx`(原始未解析值)。
|
|
34
|
+
* - resolver 内 `??` 与 `?:` 混用 [MUST] 加括号(`??` 优先级高于 `?:`,裸写会解析错)。
|
|
35
|
+
*/
|
|
36
|
+
export declare const useContextDefaults: <P extends Record<string, any>, D extends Record<string, (ctx: UseContextDefaultsResolverCtx<P>) => unknown>>(options: {
|
|
37
|
+
getProps: () => P;
|
|
38
|
+
defaults: D;
|
|
39
|
+
}) => { [K in keyof D as `ctx${Capitalize<K & string>}`]: ComputedRef<D[K] extends (ctx: UseContextDefaultsResolverCtx<P>) => infer R ? R : unknown>; };
|