@gx-design-vue/pro-layout 0.1.0-alpha.5 → 0.1.0-alpha.6
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.js +8 -12
- package/dist/components/AppPage/index.d.ts +10 -41
- package/dist/components/AppPage/index.js +33 -22
- package/dist/components/Footer/index.js +4 -6
- package/dist/components/FooterToolbar/index.js +2 -3
- package/dist/components/PageContainer/index.js +8 -12
- package/dist/hooks/useLayoutBase.d.ts +6 -6
- package/dist/pro-layout.esm.js +649 -653
- package/dist/pro-layout.js +1 -1
- package/package.json +7 -8
package/dist/ProLayout.js
CHANGED
|
@@ -399,12 +399,11 @@ const GProLayout = /* @__PURE__ */ defineComponent((props, { emit, expose, slots
|
|
|
399
399
|
headerRightExtra: {
|
|
400
400
|
type: [
|
|
401
401
|
Function,
|
|
402
|
-
Object,
|
|
403
402
|
String,
|
|
404
403
|
Number,
|
|
405
|
-
Boolean,
|
|
406
404
|
null,
|
|
407
|
-
|
|
405
|
+
Object,
|
|
406
|
+
Boolean
|
|
408
407
|
],
|
|
409
408
|
required: false,
|
|
410
409
|
default: void 0
|
|
@@ -420,12 +419,11 @@ const GProLayout = /* @__PURE__ */ defineComponent((props, { emit, expose, slots
|
|
|
420
419
|
siderExtra: {
|
|
421
420
|
type: [
|
|
422
421
|
Function,
|
|
423
|
-
Object,
|
|
424
422
|
String,
|
|
425
423
|
Number,
|
|
426
|
-
Boolean,
|
|
427
424
|
null,
|
|
428
|
-
|
|
425
|
+
Object,
|
|
426
|
+
Boolean
|
|
429
427
|
],
|
|
430
428
|
required: false,
|
|
431
429
|
default: void 0
|
|
@@ -457,12 +455,11 @@ const GProLayout = /* @__PURE__ */ defineComponent((props, { emit, expose, slots
|
|
|
457
455
|
footer: {
|
|
458
456
|
type: [
|
|
459
457
|
Function,
|
|
460
|
-
Object,
|
|
461
458
|
String,
|
|
462
459
|
Number,
|
|
463
|
-
Boolean,
|
|
464
460
|
null,
|
|
465
|
-
|
|
461
|
+
Object,
|
|
462
|
+
Boolean
|
|
466
463
|
],
|
|
467
464
|
required: false,
|
|
468
465
|
default: void 0
|
|
@@ -470,12 +467,11 @@ const GProLayout = /* @__PURE__ */ defineComponent((props, { emit, expose, slots
|
|
|
470
467
|
copyright: {
|
|
471
468
|
type: [
|
|
472
469
|
Function,
|
|
473
|
-
Object,
|
|
474
470
|
String,
|
|
475
471
|
Number,
|
|
476
|
-
Boolean,
|
|
477
472
|
null,
|
|
478
|
-
|
|
473
|
+
Object,
|
|
474
|
+
Boolean
|
|
479
475
|
],
|
|
480
476
|
required: false,
|
|
481
477
|
default: void 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppPageSpinning } from "../../interface.js";
|
|
2
2
|
import * as _$vue from "vue";
|
|
3
3
|
import { CSSProperties, PropType, SlotsType } from "vue";
|
|
4
|
-
import
|
|
4
|
+
import { CustomRender } from "@gx-design-vue/pro-utils";
|
|
5
5
|
import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/AppPage/index.d.ts
|
|
@@ -12,65 +12,34 @@ import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
|
12
12
|
* ③ 经 GProApp context 向后代下发 emptyText / indicator(供 pro-table 等空态/加载态复用)。
|
|
13
13
|
*/
|
|
14
14
|
declare const ProAppPage: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
15
|
+
class: PropType<string>;
|
|
16
|
+
style: PropType<CSSProperties>;
|
|
17
|
+
prefixCls: PropType<string>;
|
|
15
18
|
spinning: {
|
|
16
19
|
type: PropType<AppPageSpinning>;
|
|
17
20
|
default: () => {};
|
|
18
21
|
};
|
|
19
|
-
class: {
|
|
20
|
-
type: StringConstructor;
|
|
21
|
-
default: any;
|
|
22
|
-
};
|
|
23
|
-
prefixCls: {
|
|
24
|
-
type: StringConstructor;
|
|
25
|
-
default: any;
|
|
26
|
-
};
|
|
27
|
-
style: {
|
|
28
|
-
type: PropType<CSSProperties>;
|
|
29
|
-
default: any;
|
|
30
|
-
};
|
|
31
|
-
emptyText: {
|
|
32
|
-
type: PropType<_$_gx_design_vue_pro_utils0.WithFalse<_$_gx_design_vue_pro_utils0.CustomRender>>;
|
|
33
|
-
default: any;
|
|
34
|
-
};
|
|
35
22
|
indicator: {
|
|
36
|
-
type: PropType<
|
|
23
|
+
type: PropType<CustomRender>;
|
|
37
24
|
default: any;
|
|
38
25
|
};
|
|
39
26
|
}>, () => _$vue_jsx_runtime0.JSX.Element, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{
|
|
27
|
+
class: PropType<string>;
|
|
28
|
+
style: PropType<CSSProperties>;
|
|
29
|
+
prefixCls: PropType<string>;
|
|
40
30
|
spinning: {
|
|
41
31
|
type: PropType<AppPageSpinning>;
|
|
42
32
|
default: () => {};
|
|
43
33
|
};
|
|
44
|
-
class: {
|
|
45
|
-
type: StringConstructor;
|
|
46
|
-
default: any;
|
|
47
|
-
};
|
|
48
|
-
prefixCls: {
|
|
49
|
-
type: StringConstructor;
|
|
50
|
-
default: any;
|
|
51
|
-
};
|
|
52
|
-
style: {
|
|
53
|
-
type: PropType<CSSProperties>;
|
|
54
|
-
default: any;
|
|
55
|
-
};
|
|
56
|
-
emptyText: {
|
|
57
|
-
type: PropType<_$_gx_design_vue_pro_utils0.WithFalse<_$_gx_design_vue_pro_utils0.CustomRender>>;
|
|
58
|
-
default: any;
|
|
59
|
-
};
|
|
60
34
|
indicator: {
|
|
61
|
-
type: PropType<
|
|
35
|
+
type: PropType<CustomRender>;
|
|
62
36
|
default: any;
|
|
63
37
|
};
|
|
64
38
|
}>> & Readonly<{}>, {
|
|
65
|
-
|
|
66
|
-
indicator: _$_gx_design_vue_pro_utils0.CustomRender;
|
|
67
|
-
prefixCls: string;
|
|
39
|
+
indicator: CustomRender;
|
|
68
40
|
spinning: AppPageSpinning;
|
|
69
|
-
class: string;
|
|
70
|
-
style: CSSProperties;
|
|
71
41
|
}, SlotsType<{
|
|
72
42
|
default: () => any;
|
|
73
|
-
emptyText: () => any;
|
|
74
43
|
indicator: () => any;
|
|
75
44
|
}>, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
76
45
|
//#endregion
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { APP_PAGE_SLOT_KEYS } from "../../interface.js";
|
|
2
1
|
import { provideAppPageContext } from "./context.js";
|
|
3
2
|
import style_default from "./style.js";
|
|
4
3
|
import { computed, createVNode, defineComponent } from "vue";
|
|
5
|
-
import {
|
|
4
|
+
import { useProConfigContext } from "@gx-design-vue/pro-provider";
|
|
5
|
+
import { classNames, getSlotVNode } from "@gx-design-vue/pro-utils";
|
|
6
6
|
import { useBaseConfig } from "antdv-next/config-provider/context";
|
|
7
7
|
import useCSSVarCls from "antdv-next/config-provider/hooks/useCSSVarCls";
|
|
8
8
|
import { GIcon } from "@gx-design-vue/icon";
|
|
9
|
-
import { GProApp, proAppProps } from "@gx-design-vue/pro-app";
|
|
10
|
-
import { useSlotsProps } from "@gx-design-vue/pro-hooks";
|
|
11
9
|
import { GScrollbar } from "@gx-design-vue/scrollbar";
|
|
12
10
|
//#region src/components/AppPage/index.tsx
|
|
13
11
|
const SCROLLBAR_BAR_STYLE = {
|
|
@@ -29,10 +27,22 @@ const ProAppPage = /* @__PURE__ */ defineComponent({
|
|
|
29
27
|
name: "GProAppPage",
|
|
30
28
|
inheritAttrs: false,
|
|
31
29
|
props: {
|
|
32
|
-
|
|
30
|
+
class: String,
|
|
31
|
+
style: Object,
|
|
32
|
+
prefixCls: String,
|
|
33
33
|
spinning: {
|
|
34
34
|
type: Object,
|
|
35
35
|
default: () => ({})
|
|
36
|
+
},
|
|
37
|
+
indicator: {
|
|
38
|
+
type: [
|
|
39
|
+
Object,
|
|
40
|
+
Function,
|
|
41
|
+
Boolean,
|
|
42
|
+
Array,
|
|
43
|
+
String
|
|
44
|
+
],
|
|
45
|
+
default: void 0
|
|
36
46
|
}
|
|
37
47
|
},
|
|
38
48
|
slots: Object,
|
|
@@ -40,37 +50,38 @@ const ProAppPage = /* @__PURE__ */ defineComponent({
|
|
|
40
50
|
const { prefixCls } = useBaseConfig("pro-app-page", props);
|
|
41
51
|
const rootCls = useCSSVarCls(prefixCls);
|
|
42
52
|
const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
|
|
43
|
-
const
|
|
44
|
-
slots,
|
|
45
|
-
props,
|
|
46
|
-
keys: APP_PAGE_SLOT_KEYS,
|
|
47
|
-
render: true
|
|
48
|
-
});
|
|
53
|
+
const configContext = useProConfigContext();
|
|
49
54
|
const loading = computed(() => props.spinning?.loading ?? false);
|
|
50
55
|
provideAppPageContext({ spinning: computed(() => props.spinning?.loading) });
|
|
51
|
-
const resolvedIndicator = computed(() =>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
const resolvedIndicator = computed(() => {
|
|
57
|
+
const indicator = getSlotVNode({
|
|
58
|
+
slots,
|
|
59
|
+
key: "indicator",
|
|
60
|
+
props
|
|
61
|
+
});
|
|
62
|
+
if (indicator) return indicator;
|
|
63
|
+
return typeof configContext?.indicator?.value === "function" ? configContext?.indicator?.value?.() : configContext?.indicator?.value || createVNode(GIcon, {
|
|
64
|
+
"type": "Spinning",
|
|
65
|
+
"spin": true,
|
|
66
|
+
"class": `${prefixCls.value}-spin-dot ${hashId.value}`
|
|
67
|
+
}, null);
|
|
68
|
+
});
|
|
56
69
|
const rootClassNames = computed(() => classNames(prefixCls.value, hashId.value, cssVarCls.value, rootCls.value, loading.value && `${prefixCls.value}-loading`, props.class));
|
|
57
70
|
const maskStyle = computed(() => ({
|
|
58
71
|
zIndex: props.spinning?.blur ? 999 : void 0,
|
|
59
72
|
backgroundColor: props.spinning?.blur ? void 0 : "unset",
|
|
60
73
|
...props.spinning?.style || {}
|
|
61
74
|
}));
|
|
62
|
-
return () => createVNode(
|
|
75
|
+
return () => createVNode("div", {
|
|
63
76
|
"class": rootClassNames.value,
|
|
64
|
-
"style": props.style
|
|
65
|
-
|
|
66
|
-
"indicator": resolvedIndicator.value
|
|
67
|
-
}, { default: () => [createVNode(GScrollbar, {
|
|
77
|
+
"style": props.style
|
|
78
|
+
}, [createVNode(GScrollbar, {
|
|
68
79
|
"barStyle": SCROLLBAR_BAR_STYLE,
|
|
69
80
|
"viewStyle": SCROLLBAR_VIEW_STYLE
|
|
70
81
|
}, { default: () => [slots.default?.()] }), loading.value && createVNode("div", {
|
|
71
82
|
"class": classNames(`${prefixCls.value}-blur`, hashId.value),
|
|
72
83
|
"style": maskStyle.value
|
|
73
|
-
}, [createVNode("div", { "class": `${prefixCls.value}-spin` }, [resolvedIndicator.value])])]
|
|
84
|
+
}, [createVNode("div", { "class": `${prefixCls.value}-spin` }, [resolvedIndicator.value])])]);
|
|
74
85
|
}
|
|
75
86
|
});
|
|
76
87
|
//#endregion
|
|
@@ -41,12 +41,11 @@ const LayoutFooter = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
41
41
|
footer: {
|
|
42
42
|
type: [
|
|
43
43
|
Function,
|
|
44
|
-
Object,
|
|
45
44
|
String,
|
|
46
45
|
Number,
|
|
47
|
-
Boolean,
|
|
48
46
|
null,
|
|
49
|
-
|
|
47
|
+
Object,
|
|
48
|
+
Boolean
|
|
50
49
|
],
|
|
51
50
|
required: false,
|
|
52
51
|
default: void 0
|
|
@@ -54,12 +53,11 @@ const LayoutFooter = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
54
53
|
copyrightRender: {
|
|
55
54
|
type: [
|
|
56
55
|
Function,
|
|
57
|
-
Object,
|
|
58
56
|
String,
|
|
59
57
|
Number,
|
|
60
|
-
Boolean,
|
|
61
58
|
null,
|
|
62
|
-
|
|
59
|
+
Object,
|
|
60
|
+
Boolean
|
|
63
61
|
],
|
|
64
62
|
required: false,
|
|
65
63
|
default: void 0
|
|
@@ -66,12 +66,11 @@ const GFooterToolbar = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
66
66
|
extra: {
|
|
67
67
|
type: [
|
|
68
68
|
Function,
|
|
69
|
-
Object,
|
|
70
69
|
String,
|
|
71
70
|
Number,
|
|
72
|
-
Boolean,
|
|
73
71
|
null,
|
|
74
|
-
|
|
72
|
+
Object,
|
|
73
|
+
Boolean
|
|
75
74
|
],
|
|
76
75
|
required: false,
|
|
77
76
|
default: void 0
|
|
@@ -241,12 +241,11 @@ const ProPageContainer = /* @__PURE__ */ defineComponent((props, { slots, emit }
|
|
|
241
241
|
header: {
|
|
242
242
|
type: [
|
|
243
243
|
Function,
|
|
244
|
-
Object,
|
|
245
244
|
String,
|
|
246
245
|
Number,
|
|
247
|
-
Boolean,
|
|
248
246
|
null,
|
|
249
|
-
|
|
247
|
+
Object,
|
|
248
|
+
Boolean
|
|
250
249
|
],
|
|
251
250
|
required: false,
|
|
252
251
|
default: void 0
|
|
@@ -254,12 +253,11 @@ const ProPageContainer = /* @__PURE__ */ defineComponent((props, { slots, emit }
|
|
|
254
253
|
headerContent: {
|
|
255
254
|
type: [
|
|
256
255
|
Function,
|
|
257
|
-
Object,
|
|
258
256
|
String,
|
|
259
257
|
Number,
|
|
260
|
-
Boolean,
|
|
261
258
|
null,
|
|
262
|
-
|
|
259
|
+
Object,
|
|
260
|
+
Boolean
|
|
263
261
|
],
|
|
264
262
|
required: false,
|
|
265
263
|
default: void 0
|
|
@@ -267,12 +265,11 @@ const ProPageContainer = /* @__PURE__ */ defineComponent((props, { slots, emit }
|
|
|
267
265
|
extra: {
|
|
268
266
|
type: [
|
|
269
267
|
Function,
|
|
270
|
-
Object,
|
|
271
268
|
String,
|
|
272
269
|
Number,
|
|
273
|
-
Boolean,
|
|
274
270
|
null,
|
|
275
|
-
|
|
271
|
+
Object,
|
|
272
|
+
Boolean
|
|
276
273
|
],
|
|
277
274
|
required: false,
|
|
278
275
|
default: void 0
|
|
@@ -284,12 +281,11 @@ const ProPageContainer = /* @__PURE__ */ defineComponent((props, { slots, emit }
|
|
|
284
281
|
footer: {
|
|
285
282
|
type: [
|
|
286
283
|
Function,
|
|
287
|
-
Object,
|
|
288
284
|
String,
|
|
289
285
|
Number,
|
|
290
|
-
Boolean,
|
|
291
286
|
null,
|
|
292
|
-
|
|
287
|
+
Object,
|
|
288
|
+
Boolean
|
|
293
289
|
],
|
|
294
290
|
required: false,
|
|
295
291
|
default: void 0
|
|
@@ -38,13 +38,13 @@ declare function useLayoutBase(props?: {
|
|
|
38
38
|
selectedKeys: _$vue.ComputedRef<string[]>;
|
|
39
39
|
openKeys: _$vue.ComputedRef<string[]>;
|
|
40
40
|
proClasses: _$vue.ComputedRef<{
|
|
41
|
+
header?: string;
|
|
42
|
+
sider?: string;
|
|
43
|
+
content?: string;
|
|
41
44
|
siderHeader?: string;
|
|
42
45
|
siderFooter?: string;
|
|
43
46
|
breadcrumb?: string;
|
|
44
47
|
footer?: string;
|
|
45
|
-
header?: string;
|
|
46
|
-
content?: string;
|
|
47
|
-
sider?: string;
|
|
48
48
|
root?: string;
|
|
49
49
|
siderChildren?: string;
|
|
50
50
|
logo?: string;
|
|
@@ -53,13 +53,13 @@ declare function useLayoutBase(props?: {
|
|
|
53
53
|
tabs?: string;
|
|
54
54
|
}>;
|
|
55
55
|
proStyles: _$vue.ComputedRef<{
|
|
56
|
+
header?: _$vue.CSSProperties;
|
|
57
|
+
sider?: _$vue.CSSProperties;
|
|
58
|
+
content?: _$vue.CSSProperties;
|
|
56
59
|
siderHeader?: _$vue.CSSProperties;
|
|
57
60
|
siderFooter?: _$vue.CSSProperties;
|
|
58
61
|
breadcrumb?: _$vue.CSSProperties;
|
|
59
62
|
footer?: _$vue.CSSProperties;
|
|
60
|
-
header?: _$vue.CSSProperties;
|
|
61
|
-
content?: _$vue.CSSProperties;
|
|
62
|
-
sider?: _$vue.CSSProperties;
|
|
63
63
|
root?: _$vue.CSSProperties;
|
|
64
64
|
siderChildren?: _$vue.CSSProperties;
|
|
65
65
|
logo?: _$vue.CSSProperties;
|