@gx-design-vue/pro-layout 0.1.0-alpha.12 → 0.1.0-alpha.14
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/dist/ProLayout.d.ts +1 -2
- package/dist/ProLayout.js +7 -2
- package/dist/components/AppPage/index.d.ts +4 -6
- package/dist/components/AppPage/style.d.ts +1 -2
- package/dist/components/Breadcrumb/index.d.ts +2 -3
- package/dist/components/Breadcrumb/index.js +23 -2
- package/dist/components/Breadcrumb/interface.d.ts +5 -0
- package/dist/components/CollapseButton/Arrow.d.ts +1 -3
- package/dist/components/CollapseButton/index.d.ts +1 -2
- package/dist/components/Footer/index.d.ts +2 -3
- package/dist/components/FooterToolbar/index.d.ts +2 -3
- package/dist/components/FooterToolbar/style.d.ts +1 -2
- package/dist/components/Header/index.d.ts +1 -2
- package/dist/components/Logo/index.d.ts +1 -2
- package/dist/components/Menu/SiderMenu.d.ts +1 -2
- package/dist/components/Menu/index.d.ts +1 -2
- package/dist/components/Menu/style/siderMenu.d.ts +1 -2
- package/dist/components/PageContainer/PageHeader.d.ts +2 -3
- package/dist/components/PageContainer/index.d.ts +1 -2
- package/dist/components/PageContainer/style.d.ts +1 -3
- package/dist/components/PageTransition/index.d.ts +4 -5
- package/dist/components/PageTransition/style.d.ts +1 -2
- package/dist/components/Sider/index.d.ts +1 -2
- package/dist/components/Tabs/InnerTabs.d.ts +7 -0
- package/dist/components/Tabs/InnerTabs.js +117 -0
- package/dist/components/Tabs/hooks/flipAnimate.d.ts +24 -0
- package/dist/components/Tabs/hooks/flipAnimate.js +40 -0
- package/dist/components/Tabs/hooks/useAutoScroll.d.ts +27 -0
- package/dist/components/Tabs/hooks/useAutoScroll.js +122 -0
- package/dist/components/Tabs/hooks/useTabDrag.d.ts +31 -0
- package/dist/components/Tabs/hooks/useTabDrag.js +252 -0
- package/dist/components/Tabs/index.d.ts +8 -3
- package/dist/components/Tabs/index.js +44 -29
- package/dist/components/Tabs/interface.d.ts +47 -6
- package/dist/components/Tabs/style/index.d.ts +33 -0
- package/dist/components/Tabs/style/index.js +140 -0
- package/dist/components/WrapContent/index.d.ts +2 -3
- package/dist/context/index.d.ts +2 -0
- package/dist/defaultConfig.js +2 -1
- package/dist/hooks/useLayoutBase.d.ts +41 -42
- package/dist/hooks/useLayoutBase.js +4 -0
- package/dist/hooks/useMenu.js +1 -1
- package/dist/hooks/useTabs.d.ts +3 -0
- package/dist/hooks/useTabs.js +12 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/interface.d.ts +6 -2
- package/dist/pro-layout.esm.js +1360 -895
- package/dist/pro-layout.js +2 -2
- package/dist/style/index.d.ts +1 -3
- package/dist/style/tabs.d.ts +6 -0
- package/dist/style/tabs.js +9 -53
- package/dist/theme/augment.d.ts +4 -2
- package/dist/theme/interface/components.d.ts +4 -2
- package/dist/utils/themeComponents.js +1 -1
- package/package.json +23 -13
package/dist/ProLayout.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { GProLayoutEmits, GProLayoutProps, GProLayoutSlots } from "./interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/ProLayout.d.ts
|
|
6
|
-
declare const GProLayout:
|
|
5
|
+
declare const GProLayout: import("vue").DefineSetupFnComponent<GProLayoutProps, GProLayoutEmits, SlotsType<GProLayoutSlots>, GProLayoutProps, import("vue").PublicProps>;
|
|
7
6
|
//#endregion
|
|
8
7
|
export { GProLayout as default };
|
package/dist/ProLayout.js
CHANGED
|
@@ -156,6 +156,7 @@ const GProLayout = /* @__PURE__ */ defineComponent((props, { emit, expose, slots
|
|
|
156
156
|
emit("contentFullscreenChange", val);
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
+
const tabsHeight = ref(41);
|
|
159
160
|
function handleSelect(info) {
|
|
160
161
|
menuState.selectedKeys.value = info.keys;
|
|
161
162
|
selectedKeysModel.value = info.keys;
|
|
@@ -224,7 +225,11 @@ const GProLayout = /* @__PURE__ */ defineComponent((props, { emit, expose, slots
|
|
|
224
225
|
hasFooterToolbar.value = value;
|
|
225
226
|
},
|
|
226
227
|
navigate,
|
|
227
|
-
tabsState
|
|
228
|
+
tabsState,
|
|
229
|
+
tabsHeight,
|
|
230
|
+
setTabsHeight: (value) => {
|
|
231
|
+
tabsHeight.value = value;
|
|
232
|
+
}
|
|
228
233
|
});
|
|
229
234
|
expose({ tabs: tabsState.tabsController });
|
|
230
235
|
function resolveLayoutSlots() {
|
|
@@ -298,7 +303,7 @@ const GProLayout = /* @__PURE__ */ defineComponent((props, { emit, expose, slots
|
|
|
298
303
|
])] })] })] })] });
|
|
299
304
|
};
|
|
300
305
|
}, {
|
|
301
|
-
props:
|
|
306
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
302
307
|
layout: {
|
|
303
308
|
type: String,
|
|
304
309
|
required: false
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { AppPageSpinning } from "../../interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { CSSProperties, PropType, SlotsType } from "vue";
|
|
4
3
|
import { CustomRender } from "@gx-design-vue/pro-utils";
|
|
5
|
-
import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
6
4
|
import { ConfigOptions } from "antdv-next/dist/message/interface";
|
|
7
5
|
import { NotificationConfig } from "antdv-next/dist/notification/interface";
|
|
8
6
|
|
|
@@ -13,7 +11,7 @@ import { NotificationConfig } from "antdv-next/dist/notification/interface";
|
|
|
13
11
|
* ① 全局滚动容器;② 全局 loading 遮罩;
|
|
14
12
|
* ③ 经 GProApp context 向后代下发 emptyText / indicator(供 pro-table 等空态/加载态复用)。
|
|
15
13
|
*/
|
|
16
|
-
declare const ProAppPage:
|
|
14
|
+
declare const ProAppPage: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
15
|
class: PropType<string>;
|
|
18
16
|
style: PropType<CSSProperties>;
|
|
19
17
|
prefixCls: PropType<string>;
|
|
@@ -27,7 +25,7 @@ declare const ProAppPage: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
27
25
|
};
|
|
28
26
|
message: PropType<ConfigOptions>;
|
|
29
27
|
notification: PropType<NotificationConfig>;
|
|
30
|
-
}>, () =>
|
|
28
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
29
|
class: PropType<string>;
|
|
32
30
|
style: PropType<CSSProperties>;
|
|
33
31
|
prefixCls: PropType<string>;
|
|
@@ -42,11 +40,11 @@ declare const ProAppPage: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
42
40
|
message: PropType<ConfigOptions>;
|
|
43
41
|
notification: PropType<NotificationConfig>;
|
|
44
42
|
}>> & Readonly<{}>, {
|
|
45
|
-
spinning: AppPageSpinning;
|
|
46
43
|
indicator: CustomRender;
|
|
44
|
+
spinning: AppPageSpinning;
|
|
47
45
|
}, SlotsType<{
|
|
48
46
|
default: () => any;
|
|
49
47
|
indicator: () => any;
|
|
50
|
-
}>, {}, {}, string,
|
|
48
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
51
49
|
//#endregion
|
|
52
50
|
export { ProAppPage as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
1
|
import { ProFullToken } from "@gx-design-vue/pro-provider";
|
|
3
2
|
import { CSSObject } from "@antdv-next/cssinjs";
|
|
4
3
|
import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
@@ -7,6 +6,6 @@ import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
|
7
6
|
type ComponentToken = Record<string, any>;
|
|
8
7
|
/** GProAppPage 样式:应用壳容器 + loading 遮罩。 */
|
|
9
8
|
declare const genAppPageStyle: GenerateStyle<ProFullToken<'ProAppPage'>, CSSObject>;
|
|
10
|
-
declare const _default: (prefixCls:
|
|
9
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
11
10
|
//#endregion
|
|
12
11
|
export { ComponentToken, _default as default, genAppPageStyle };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayoutBreadcrumbProps, LayoutBreadcrumbSlots } from "./interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/Breadcrumb/index.d.ts
|
|
@@ -13,8 +12,8 @@ import { SlotsType } from "vue";
|
|
|
13
12
|
* - 下拉子菜单(有子节点的层级鼠标悬停展示)
|
|
14
13
|
* - 点击导航(非当前页层级可点击跳转)
|
|
15
14
|
*/
|
|
16
|
-
declare const Breadcrumb:
|
|
15
|
+
declare const Breadcrumb: import("vue").DefineSetupFnComponent<LayoutBreadcrumbProps, Record<string, never>, SlotsType<LayoutBreadcrumbSlots>, LayoutBreadcrumbProps & {
|
|
17
16
|
[x: `on${Capitalize<string>}`]: (...args: unknown[]) => any;
|
|
18
|
-
},
|
|
17
|
+
}, import("vue").PublicProps>;
|
|
19
18
|
//#endregion
|
|
20
19
|
export { Breadcrumb as default };
|
|
@@ -3,6 +3,7 @@ import { renderMenuIcon } from "../Menu/iconRender.js";
|
|
|
3
3
|
import { Fragment, computed, createTextVNode, createVNode, defineComponent } from "vue";
|
|
4
4
|
import { classNames } from "@gx-design-vue/pro-utils";
|
|
5
5
|
import { Dropdown } from "antdv-next";
|
|
6
|
+
import { useRouter } from "vue-router";
|
|
6
7
|
import { GIcon } from "@gx-design-vue/icon";
|
|
7
8
|
//#region src/components/Breadcrumb/index.tsx
|
|
8
9
|
/** 首页占位路由名 */
|
|
@@ -24,11 +25,16 @@ function renderBreadcrumbItemContent(prefixCls, route) {
|
|
|
24
25
|
*/
|
|
25
26
|
const Breadcrumb = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
26
27
|
const { navigate, prefixCls, menuState, breadcrumbConfig } = useLayoutBase();
|
|
28
|
+
const router = useRouter();
|
|
27
29
|
const breadcrumbRoutes = computed(() => props.routes ?? menuState?.breadcrumbRoutes.value ?? []);
|
|
28
30
|
const homeIconConfig = computed(() => {
|
|
29
31
|
if (props.homeIcon !== void 0) return props.homeIcon;
|
|
30
32
|
return breadcrumbConfig ? breadcrumbConfig.value?.showHome : void 0;
|
|
31
33
|
});
|
|
34
|
+
const homePath = computed(() => {
|
|
35
|
+
if (props.homePath !== void 0) return props.homePath;
|
|
36
|
+
return breadcrumbConfig?.value?.homePath ?? "/";
|
|
37
|
+
});
|
|
32
38
|
const lookup = computed(() => menuState?.lookup.value);
|
|
33
39
|
const selectedKeys = computed(() => menuState?.selectedKeys.value ?? []);
|
|
34
40
|
const displayRoutes = computed(() => {
|
|
@@ -48,13 +54,21 @@ const Breadcrumb = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
48
54
|
* 首页占位项本身没有子节点,不展示 dropdown。
|
|
49
55
|
*/
|
|
50
56
|
function getDropdownChildren(route) {
|
|
51
|
-
if (route.name === BREADCRUMB_HOME_KEY)
|
|
57
|
+
if (route.name === BREADCRUMB_HOME_KEY) {
|
|
58
|
+
const visibleTopMenus = (menuState?.headerMenus.value ?? menuState?.menus.value ?? []).filter((menu) => !menu.meta?.hideInMenu);
|
|
59
|
+
return visibleTopMenus.length ? visibleTopMenus : void 0;
|
|
60
|
+
}
|
|
52
61
|
const visibleChildren = ((lookup.value?.get(route.name))?.route)?.children?.filter((child) => !child.meta?.hideInMenu);
|
|
53
62
|
return visibleChildren?.length ? visibleChildren : void 0;
|
|
54
63
|
}
|
|
55
64
|
/** 点击面包屑项导航 */
|
|
56
65
|
function handleItemClick(route, isLast) {
|
|
57
66
|
if (isLast) return;
|
|
67
|
+
if (route.name === BREADCRUMB_HOME_KEY) {
|
|
68
|
+
const targetPath = homePath.value;
|
|
69
|
+
if (router.currentRoute.value.fullPath !== targetPath) router.push(targetPath);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
58
72
|
navigate?.(route.name);
|
|
59
73
|
}
|
|
60
74
|
/** 点击 dropdown 子菜单项导航 */
|
|
@@ -82,7 +96,10 @@ const Breadcrumb = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
82
96
|
})),
|
|
83
97
|
selectedKeys: dropdownSelectedKeys,
|
|
84
98
|
onClick: ({ key }) => handleDropdownMenuClick(String(key))
|
|
85
|
-
} }, { default: () => [createVNode("span", {
|
|
99
|
+
} }, { default: () => [createVNode("span", {
|
|
100
|
+
"class": `${breadcrumbCls}-overlay-link`,
|
|
101
|
+
"onClick": route.name === BREADCRUMB_HOME_KEY ? () => handleItemClick(route, isLast) : void 0
|
|
102
|
+
}, [itemContent, createVNode(GIcon, { "type": "DownOutlined" }, null)])] }) : createVNode("span", {
|
|
86
103
|
"class": classNames(`${breadcrumbCls}-link`, isLast && `${breadcrumbCls}-link-last`),
|
|
87
104
|
"onClick": () => handleItemClick(route, isLast)
|
|
88
105
|
}, [itemContent])]), !isLast && createVNode("li", { "class": `${breadcrumbCls}-separator` }, [createTextVNode("/")])]);
|
|
@@ -98,6 +115,10 @@ const Breadcrumb = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
98
115
|
type: Boolean,
|
|
99
116
|
required: false,
|
|
100
117
|
default: void 0
|
|
118
|
+
},
|
|
119
|
+
homePath: {
|
|
120
|
+
type: String,
|
|
121
|
+
required: false
|
|
101
122
|
}
|
|
102
123
|
},
|
|
103
124
|
name: "LayoutBreadcrumb",
|
|
@@ -15,6 +15,11 @@ interface LayoutBreadcrumbProps {
|
|
|
15
15
|
* - `false`:不显示首页项
|
|
16
16
|
*/
|
|
17
17
|
homeIcon?: WithFalse<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* 覆盖 context 的首页点击跳转路径。
|
|
20
|
+
* 默认从 layoutContext.breadcrumbConfig.homePath 读取,缺省 '/'。
|
|
21
|
+
*/
|
|
22
|
+
homePath?: string;
|
|
18
23
|
}
|
|
19
24
|
interface LayoutBreadcrumbSlots {
|
|
20
25
|
/** 自定义每个面包屑项的渲染 */
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
2
|
-
|
|
3
1
|
//#region src/components/CollapseButton/Arrow.d.ts
|
|
4
|
-
declare function ArrowSvgIcon():
|
|
2
|
+
declare function ArrowSvgIcon(): import("vue/jsx-runtime").JSX.Element;
|
|
5
3
|
//#endregion
|
|
6
4
|
export { ArrowSvgIcon };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LayoutCollapseButtonEmits, LayoutCollapseButtonProps, LayoutCollapseButtonSlots } from "./interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/CollapseButton/index.d.ts
|
|
6
|
-
declare const LayoutCollapseButton:
|
|
5
|
+
declare const LayoutCollapseButton: import("vue").DefineSetupFnComponent<LayoutCollapseButtonProps, LayoutCollapseButtonEmits, SlotsType<LayoutCollapseButtonSlots>, LayoutCollapseButtonProps, import("vue").PublicProps>;
|
|
7
6
|
//#endregion
|
|
8
7
|
export { LayoutCollapseButton as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { LayoutFooterProps, LayoutFooterSlots } from "./interface.js";
|
|
2
2
|
import { EmptyEmits } from "../../interface.js";
|
|
3
|
-
import * as _$vue from "vue";
|
|
4
3
|
import { SlotsType } from "vue";
|
|
5
4
|
|
|
6
5
|
//#region src/components/Footer/index.d.ts
|
|
7
|
-
declare const LayoutFooter:
|
|
6
|
+
declare const LayoutFooter: import("vue").DefineSetupFnComponent<LayoutFooterProps, EmptyEmits, SlotsType<LayoutFooterSlots>, LayoutFooterProps & {
|
|
8
7
|
[x: `on${Capitalize<string>}`]: (...args: unknown[]) => any;
|
|
9
|
-
},
|
|
8
|
+
}, import("vue").PublicProps>;
|
|
10
9
|
//#endregion
|
|
11
10
|
export { LayoutFooter as default };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { GFooterToolbarProps, GFooterToolbarSlots } from "../../interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/FooterToolbar/index.d.ts
|
|
6
|
-
declare const GFooterToolbar:
|
|
5
|
+
declare const GFooterToolbar: import("vue").DefineSetupFnComponent<GFooterToolbarProps, Record<string, never>, SlotsType<GFooterToolbarSlots>, GFooterToolbarProps & {
|
|
7
6
|
[x: `on${Capitalize<string>}`]: (...args: unknown[]) => any;
|
|
8
|
-
},
|
|
7
|
+
}, import("vue").PublicProps>;
|
|
9
8
|
//#endregion
|
|
10
9
|
export { GFooterToolbar as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
1
|
import { ProFullToken } from "@gx-design-vue/pro-provider";
|
|
3
2
|
import { CSSObject } from "@antdv-next/cssinjs";
|
|
4
3
|
import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
@@ -6,6 +5,6 @@ import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
|
6
5
|
//#region src/components/FooterToolbar/style.d.ts
|
|
7
6
|
type ComponentToken = Record<string, any>;
|
|
8
7
|
declare const genFooterToolbarStyle: GenerateStyle<ProFullToken<'ProFooterToolbar'>, CSSObject>;
|
|
9
|
-
declare const _default: (prefixCls:
|
|
8
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
10
9
|
//#endregion
|
|
11
10
|
export { ComponentToken, _default as default, genFooterToolbarStyle };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LayoutHeaderEmits, LayoutHeaderProps, LayoutHeaderSlots } from "./interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/Header/index.d.ts
|
|
6
|
-
declare const Header:
|
|
5
|
+
declare const Header: import("vue").DefineSetupFnComponent<LayoutHeaderProps, LayoutHeaderEmits, SlotsType<LayoutHeaderSlots>, LayoutHeaderProps, import("vue").PublicProps>;
|
|
7
6
|
//#endregion
|
|
8
7
|
export { Header as default };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { LayoutLogoEmits, LayoutLogoEmitsProps, LayoutLogoSlots } from "./interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
import { CustomRender } from "@gx-design-vue/pro-utils";
|
|
5
4
|
|
|
6
5
|
//#region src/components/Logo/index.d.ts
|
|
7
6
|
declare function defaultRenderLogo(logo?: CustomRender | false): any;
|
|
8
|
-
declare const LayoutLogo:
|
|
7
|
+
declare const LayoutLogo: import("vue").DefineSetupFnComponent<LayoutLogoEmitsProps, LayoutLogoEmits, SlotsType<LayoutLogoSlots>, LayoutLogoEmitsProps, import("vue").PublicProps>;
|
|
9
8
|
//#endregion
|
|
10
9
|
export { LayoutLogo as default, defaultRenderLogo };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LayoutMenuEmits, LayoutMenuSlots } from "./interface.js";
|
|
2
2
|
import { LayoutClassNamesType, LayoutMenuItemSlotProps, LayoutMenuRoute, LayoutStylesType } from "../../interface.js";
|
|
3
|
-
import * as _$vue from "vue";
|
|
4
3
|
import { CSSProperties, SlotsType } from "vue";
|
|
5
4
|
import { CustomRender } from "@gx-design-vue/pro-utils";
|
|
6
5
|
|
|
@@ -25,6 +24,6 @@ interface SiderMenuProps {
|
|
|
25
24
|
'onUpdate:selectedKeys'?: LayoutMenuEmits['update:selectedKeys'];
|
|
26
25
|
'onUpdate:openKeys'?: LayoutMenuEmits['update:openKeys'];
|
|
27
26
|
}
|
|
28
|
-
declare const SiderMenu:
|
|
27
|
+
declare const SiderMenu: import("vue").DefineSetupFnComponent<SiderMenuProps, LayoutMenuEmits, SlotsType<LayoutMenuSlots>, SiderMenuProps, import("vue").PublicProps>;
|
|
29
28
|
//#endregion
|
|
30
29
|
export { SiderMenu as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayoutMenuEmits, LayoutMenuProps, LayoutMenuSlots } from "./interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/Menu/index.d.ts
|
|
@@ -10,6 +9,6 @@ import { SlotsType } from "vue";
|
|
|
10
9
|
* 视觉定制通过 `menuItemIcon`/`menuItemLabel`/`menuItemExtra`(prop 或同名 slot,prop 优先)
|
|
11
10
|
* 注入 antdv-next 的 `iconRender`/`labelRender`/`extraRender`。可脱离 GProLayout 独立使用。
|
|
12
11
|
*/
|
|
13
|
-
declare const LayoutMenu:
|
|
12
|
+
declare const LayoutMenu: import("vue").DefineSetupFnComponent<LayoutMenuProps, LayoutMenuEmits, SlotsType<LayoutMenuSlots>, LayoutMenuProps, import("vue").PublicProps>;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { LayoutMenu as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
1
|
import { CSSProperties } from "vue";
|
|
3
2
|
import { GetDefaultToken } from "antdv-next/dist/theme/internal";
|
|
4
3
|
|
|
@@ -293,6 +292,6 @@ interface ComponentToken {
|
|
|
293
292
|
itemWidth: number | string;
|
|
294
293
|
}
|
|
295
294
|
declare const prepareComponentToken: GetDefaultToken<'ProSiderMenu'>;
|
|
296
|
-
declare const _default: (prefixCls:
|
|
295
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
297
296
|
//#endregion
|
|
298
297
|
export { ComponentToken, _default as default, prepareComponentToken };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BreadcrumbItemType, LayoutBreadcrumbConfig, LayoutBreadcrumbSlotProps, LayoutMenuRoute, PageContainerClassNamesType, PageContainerStylesType } from "../../interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/PageContainer/PageHeader.d.ts
|
|
@@ -27,8 +26,8 @@ interface PageHeaderSlots {
|
|
|
27
26
|
* 负责渲染:面包屑行 + 标题行(标题 + headerContent + extra)+ 全屏关闭按钮。
|
|
28
27
|
* 所有渲染所需数据通过 props 传入,不自行读取 layout context。
|
|
29
28
|
*/
|
|
30
|
-
declare const PageHeader:
|
|
29
|
+
declare const PageHeader: import("vue").DefineSetupFnComponent<PageHeaderProps, Record<string, never>, SlotsType<PageHeaderSlots>, PageHeaderProps & {
|
|
31
30
|
[x: `on${Capitalize<string>}`]: (...args: unknown[]) => any;
|
|
32
|
-
},
|
|
31
|
+
}, import("vue").PublicProps>;
|
|
33
32
|
//#endregion
|
|
34
33
|
export { PageHeader as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GPageContainerEmits, GPageContainerProps, GPageContainerSlots } from "../../interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/PageContainer/index.d.ts
|
|
@@ -7,6 +6,6 @@ import { SlotsType } from "vue";
|
|
|
7
6
|
* GPageContainer —— 页面容器:页头(面包屑 + 标题 + 操作)+ 内容卡片 + loading 遮罩 + 水印。
|
|
8
7
|
* 可独立使用;置于 `GProLayout` 内时通过 layout context 读取面包屑数据与全屏态。
|
|
9
8
|
*/
|
|
10
|
-
declare const ProPageContainer:
|
|
9
|
+
declare const ProPageContainer: import("vue").DefineSetupFnComponent<GPageContainerProps, GPageContainerEmits, SlotsType<GPageContainerSlots>, GPageContainerProps, import("vue").PublicProps>;
|
|
11
10
|
//#endregion
|
|
12
11
|
export { ProPageContainer as default };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
|
-
|
|
3
1
|
//#region src/components/PageContainer/style.d.ts
|
|
4
2
|
type ComponentToken = Record<string, any>;
|
|
5
|
-
declare const _default: (prefixCls:
|
|
3
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
6
4
|
//#endregion
|
|
7
5
|
export { ComponentToken, _default as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GPageTransitionSlots } from "../../interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { PropType, SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/PageTransition/index.d.ts
|
|
@@ -8,7 +7,7 @@ import { PropType, SlotsType } from "vue";
|
|
|
8
7
|
* 通过 `name`/`direction` 选择 animate.css 预设动画;`reverse` 控制离场时方向倒放;
|
|
9
8
|
* `disabled` 时直接渲染子节点、不套动画。
|
|
10
9
|
*/
|
|
11
|
-
declare const GPageTransition:
|
|
10
|
+
declare const GPageTransition: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
12
11
|
prefixCls: {
|
|
13
12
|
type: PropType<string>;
|
|
14
13
|
}; /** 禁用动画,直接渲染子节点 */
|
|
@@ -28,7 +27,7 @@ declare const GPageTransition: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
28
27
|
type: PropType<string>;
|
|
29
28
|
default: string;
|
|
30
29
|
};
|
|
31
|
-
}>, () => any, {}, {}, {},
|
|
30
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
31
|
prefixCls: {
|
|
33
32
|
type: PropType<string>;
|
|
34
33
|
}; /** 禁用动画,直接渲染子节点 */
|
|
@@ -49,10 +48,10 @@ declare const GPageTransition: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
49
48
|
default: string;
|
|
50
49
|
};
|
|
51
50
|
}>> & Readonly<{}>, {
|
|
52
|
-
name: string;
|
|
53
51
|
reverse: boolean;
|
|
54
52
|
disabled: boolean;
|
|
53
|
+
name: string;
|
|
55
54
|
direction: string;
|
|
56
|
-
}, SlotsType<GPageTransitionSlots>, {}, {}, string,
|
|
55
|
+
}, SlotsType<GPageTransitionSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
57
56
|
//#endregion
|
|
58
57
|
export { GPageTransition as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
1
|
import { ProFullToken } from "@gx-design-vue/pro-provider";
|
|
3
2
|
import { CSSObject } from "@antdv-next/cssinjs";
|
|
4
3
|
import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
@@ -7,6 +6,6 @@ import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
|
7
6
|
type ComponentToken = Record<string, any>;
|
|
8
7
|
/** GPageTransition 样式:进场/离场两段,合并所有预设关键帧。 */
|
|
9
8
|
declare const genPageTransitionStyle: GenerateStyle<ProFullToken<'ProPageTransition'>, CSSObject>;
|
|
10
|
-
declare const _default: (prefixCls:
|
|
9
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
11
10
|
//#endregion
|
|
12
11
|
export { ComponentToken, _default as default, genPageTransitionStyle };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LayoutSiderEmits, LayoutSiderProps, LayoutSiderSlots } from "./interface.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
2
|
import { SlotsType } from "vue";
|
|
4
3
|
|
|
5
4
|
//#region src/components/Sider/index.d.ts
|
|
6
|
-
declare const LayoutSider:
|
|
5
|
+
declare const LayoutSider: import("vue").DefineSetupFnComponent<LayoutSiderProps, LayoutSiderEmits, SlotsType<LayoutSiderSlots>, LayoutSiderProps, import("vue").PublicProps>;
|
|
7
6
|
//#endregion
|
|
8
7
|
export { LayoutSider as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InnerTabsEmits, InnerTabsProps, InnerTabsSlots } from "./interface.js";
|
|
2
|
+
import { SlotsType } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Tabs/InnerTabs.d.ts
|
|
5
|
+
declare const InnerTabs: import("vue").DefineSetupFnComponent<InnerTabsProps, InnerTabsEmits, SlotsType<InnerTabsSlots>, InnerTabsProps, import("vue").PublicProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { InnerTabs as default };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { useTabDrag } from "./hooks/useTabDrag.js";
|
|
2
|
+
import style_default from "./style/index.js";
|
|
3
|
+
import { Fragment, computed, createVNode, defineComponent, mergeProps, nextTick, ref, watch } from "vue";
|
|
4
|
+
import { classNames } from "@gx-design-vue/pro-utils";
|
|
5
|
+
import { useScroll } from "@vueuse/core";
|
|
6
|
+
import { useBaseConfig } from "antdv-next/config-provider/context";
|
|
7
|
+
import useCSSVarCls from "antdv-next/config-provider/hooks/useCSSVarCls";
|
|
8
|
+
import { GIcon } from "@gx-design-vue/icon";
|
|
9
|
+
//#region src/components/Tabs/InnerTabs.tsx
|
|
10
|
+
/** 溢出时两端透明裁切宽度(px) */
|
|
11
|
+
const MASK_GUTTER = 16;
|
|
12
|
+
const MASK_COLOR = "#fff";
|
|
13
|
+
const InnerTabs = /* @__PURE__ */ defineComponent((props, { slots, emit }) => {
|
|
14
|
+
const { prefixCls } = useBaseConfig("pro-inner-tabs", props);
|
|
15
|
+
const rootCls = useCSSVarCls(prefixCls);
|
|
16
|
+
const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
|
|
17
|
+
const scrollRef = ref();
|
|
18
|
+
const items = computed(() => props.items ?? []);
|
|
19
|
+
const activeKey = computed(() => props.activeKey ?? "");
|
|
20
|
+
const { arrivedState } = useScroll(scrollRef);
|
|
21
|
+
const { draggingKey: tabDraggingKey, getItemProps } = useTabDrag({
|
|
22
|
+
items,
|
|
23
|
+
scrollEl: scrollRef,
|
|
24
|
+
onReorder: (fromKey, toKey) => emit("reorder", fromKey, toKey),
|
|
25
|
+
enabled: computed(() => props.draggable !== false)
|
|
26
|
+
});
|
|
27
|
+
const wrapStyle = computed(() => {
|
|
28
|
+
const atLeft = arrivedState.left;
|
|
29
|
+
const atRight = arrivedState.right;
|
|
30
|
+
if (atLeft && atRight) return {};
|
|
31
|
+
const maskImage = !atLeft && !atRight ? `linear-gradient(90deg, transparent, ${MASK_COLOR} ${MASK_GUTTER}px, ${MASK_COLOR} calc(100% - ${MASK_GUTTER}px), transparent)` : !atLeft ? `linear-gradient(90deg, transparent, ${MASK_COLOR} ${MASK_GUTTER}px)` : `linear-gradient(90deg, ${MASK_COLOR} calc(100% - ${MASK_GUTTER}px), transparent)`;
|
|
32
|
+
return {
|
|
33
|
+
WebkitMaskImage: maskImage,
|
|
34
|
+
maskImage
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
function handleTabClick(item) {
|
|
38
|
+
if (item.disabled || item.key === activeKey.value) return;
|
|
39
|
+
emit("update:activeKey", item.key);
|
|
40
|
+
emit("change", item.key);
|
|
41
|
+
}
|
|
42
|
+
function handleRemoveClick(event, item) {
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
emit("close", item.key);
|
|
46
|
+
}
|
|
47
|
+
function renderItem(item) {
|
|
48
|
+
const active = item.key === activeKey.value;
|
|
49
|
+
const closable = item.closable !== false;
|
|
50
|
+
const customTab = slots.tab?.({
|
|
51
|
+
item,
|
|
52
|
+
active
|
|
53
|
+
});
|
|
54
|
+
const dragging = tabDraggingKey.value === item.key;
|
|
55
|
+
return createVNode("div", mergeProps({
|
|
56
|
+
"key": item.key,
|
|
57
|
+
"class": classNames(`${prefixCls.value}-tab`, {
|
|
58
|
+
[`${prefixCls.value}-tab-active`]: active,
|
|
59
|
+
[`${prefixCls.value}-tab-disabled`]: item.disabled,
|
|
60
|
+
[`${prefixCls.value}-tab-dragging`]: dragging
|
|
61
|
+
}),
|
|
62
|
+
"data-key": item.key,
|
|
63
|
+
"onClick": () => handleTabClick(item)
|
|
64
|
+
}, getItemProps(item.key)), [customTab ?? createVNode(Fragment, null, [createVNode("span", { "class": `${prefixCls.value}-tab-btn` }, [item.label]), closable && createVNode(GIcon, {
|
|
65
|
+
"type": "CloseOutlined",
|
|
66
|
+
"class": `${prefixCls.value}-tab-remove`,
|
|
67
|
+
"data-drag-ignore": "true",
|
|
68
|
+
"onClick": (event) => handleRemoveClick(event, item)
|
|
69
|
+
}, null)])]);
|
|
70
|
+
}
|
|
71
|
+
watch(() => [props.activeKey, items.value.length], () => {
|
|
72
|
+
nextTick(() => {
|
|
73
|
+
(scrollRef.value?.querySelector(`[data-key="${activeKey.value}"]`))?.scrollIntoView?.({
|
|
74
|
+
inline: "nearest",
|
|
75
|
+
block: "nearest"
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}, { immediate: true });
|
|
79
|
+
return () => {
|
|
80
|
+
if (items.value.length === 0) return null;
|
|
81
|
+
return createVNode("div", { "class": classNames(prefixCls.value, hashId.value, cssVarCls.value, rootCls.value) }, [createVNode("div", { "class": `${prefixCls.value}-nav` }, [createVNode("div", {
|
|
82
|
+
"ref": scrollRef,
|
|
83
|
+
"class": `${prefixCls.value}-nav-wrap`,
|
|
84
|
+
"style": wrapStyle.value
|
|
85
|
+
}, [createVNode("div", { "class": `${prefixCls.value}-nav-list` }, [items.value.map((item) => renderItem(item))])]), slots.extra && createVNode("div", { "class": `${prefixCls.value}-extra` }, [slots.extra()])])]);
|
|
86
|
+
};
|
|
87
|
+
}, {
|
|
88
|
+
props: {
|
|
89
|
+
prefixCls: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: false
|
|
92
|
+
},
|
|
93
|
+
items: {
|
|
94
|
+
type: Array,
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
activeKey: {
|
|
98
|
+
type: String,
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
draggable: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
required: false,
|
|
104
|
+
default: void 0
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
emits: [
|
|
108
|
+
"update:activeKey",
|
|
109
|
+
"change",
|
|
110
|
+
"close",
|
|
111
|
+
"reorder"
|
|
112
|
+
],
|
|
113
|
+
name: "InnerTabs",
|
|
114
|
+
inheritAttrs: false
|
|
115
|
+
});
|
|
116
|
+
//#endregion
|
|
117
|
+
export { InnerTabs as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/components/Tabs/hooks/flipAnimate.d.ts
|
|
2
|
+
interface FlipAnimateOptions {
|
|
3
|
+
/** 动画时长 ms,默认 200 */
|
|
4
|
+
duration?: number;
|
|
5
|
+
/** 缓动函数,默认 cubic-bezier(0.2,0,0,1)(对齐 dnd-kit motionEase) */
|
|
6
|
+
easing?: string;
|
|
7
|
+
}
|
|
8
|
+
interface FlipEntry {
|
|
9
|
+
key: string;
|
|
10
|
+
el: HTMLElement;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* FLIP 动画 —— 精简复刻 `@dnd-kit/dom` 的 `sortable#animate`。
|
|
14
|
+
*
|
|
15
|
+
* 用 Web Animations API(`element.animate`)+ CSS `translate` 属性(非 transform):
|
|
16
|
+
* 1. 取消元素上 transform/translate/scale 的 CSS transition(避免 getBoundingClientRect 取到中间帧)
|
|
17
|
+
* 2. 测新旧位置算 `delta = prev.left - next.left`
|
|
18
|
+
* 3. `el.animate({ translate: [delta, 0] }, { duration, easing })`
|
|
19
|
+
*
|
|
20
|
+
* 命中 `prefers-reduced-motion` 时 duration 置 0。
|
|
21
|
+
*/
|
|
22
|
+
declare function flipAnimate(entries: FlipEntry[], prevRects: Map<string, DOMRect>, options?: FlipAnimateOptions): void;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { FlipAnimateOptions, FlipEntry, flipAnimate };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/components/Tabs/hooks/flipAnimate.ts
|
|
2
|
+
/**
|
|
3
|
+
* FLIP 动画 —— 精简复刻 `@dnd-kit/dom` 的 `sortable#animate`。
|
|
4
|
+
*
|
|
5
|
+
* 用 Web Animations API(`element.animate`)+ CSS `translate` 属性(非 transform):
|
|
6
|
+
* 1. 取消元素上 transform/translate/scale 的 CSS transition(避免 getBoundingClientRect 取到中间帧)
|
|
7
|
+
* 2. 测新旧位置算 `delta = prev.left - next.left`
|
|
8
|
+
* 3. `el.animate({ translate: [delta, 0] }, { duration, easing })`
|
|
9
|
+
*
|
|
10
|
+
* 命中 `prefers-reduced-motion` 时 duration 置 0。
|
|
11
|
+
*/
|
|
12
|
+
function flipAnimate(entries, prevRects, options = {}) {
|
|
13
|
+
const { duration = 200, easing = "cubic-bezier(0.2, 0, 0, 1)" } = options;
|
|
14
|
+
const finalDuration = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : duration;
|
|
15
|
+
for (const { key, el } of entries) {
|
|
16
|
+
const prev = prevRects.get(key);
|
|
17
|
+
if (!prev) continue;
|
|
18
|
+
for (const animation of el.getAnimations()) {
|
|
19
|
+
const transitionProperty = animation.transitionProperty;
|
|
20
|
+
if (transitionProperty === "transform" || transitionProperty === "translate" || transitionProperty === "scale") animation.cancel();
|
|
21
|
+
}
|
|
22
|
+
const next = el.getBoundingClientRect();
|
|
23
|
+
const deltaX = prev.left - next.left;
|
|
24
|
+
const deltaY = prev.top - next.top;
|
|
25
|
+
if (deltaX === 0 && deltaY === 0) continue;
|
|
26
|
+
const animation = el.animate({ translate: [`${deltaX}px ${deltaY}px`, "0px 0px"] }, {
|
|
27
|
+
duration: finalDuration,
|
|
28
|
+
easing
|
|
29
|
+
});
|
|
30
|
+
const clearTranslate = () => {
|
|
31
|
+
el.style.translate = "";
|
|
32
|
+
};
|
|
33
|
+
if ("addEventListener" in animation) {
|
|
34
|
+
animation.addEventListener("finish", clearTranslate, { once: true });
|
|
35
|
+
animation.addEventListener("cancel", clearTranslate, { once: true });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { flipAnimate };
|