@jetlinks-web/components 2.0.2 → 2.0.4-1
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/es/AMap/Map.js +125 -0
- package/es/AMap/index.js +2 -0
- package/es/AMap/util.js +56 -0
- package/es/BadgeStatus/Badge.js +54 -0
- package/es/BadgeStatus/color.js +21 -0
- package/es/BadgeStatus/index.js +3 -0
- package/es/CardSelect/CardSelect.js +123 -0
- package/es/CardSelect/index.js +2 -0
- package/es/CheckButton/CheckButton.js +120 -0
- package/es/CheckButton/index.js +2 -0
- package/es/CheckButton/style/index.css +37 -0
- package/es/CheckButton/style/index.less +40 -0
- package/es/ConfigProvider/context.js +12 -0
- package/es/ConfigProvider/index.js +31 -0
- package/es/Echarts/Echarts.js +47 -0
- package/es/Echarts/index.js +2 -0
- package/es/Ellipsis/Ellipsis.js +184 -0
- package/es/Ellipsis/index.js +2 -0
- package/es/Ellipsis/style/index.css +17 -0
- package/es/Ellipsis/style/index.less +20 -0
- package/es/Empty/Empty.js +56 -0
- package/es/Empty/image.js +2 -0
- package/es/Empty/index.js +2 -0
- package/es/FullPage/FullPage.js +31 -0
- package/es/FullPage/index.js +2 -0
- package/es/Icon/icon.js +42 -0
- package/{src/Icon/index.ts → es/Icon/index.js} +2 -3
- package/es/MonacoEditor/Monaco.js +238 -0
- package/es/MonacoEditor/index.js +2 -0
- package/es/PermissionButton/index.js +117 -0
- package/es/ProLayout/Basic/BasicLayout.js +259 -0
- package/es/ProLayout/Basic/Header.js +97 -0
- package/es/ProLayout/PageContainer/index.js +324 -0
- package/es/ProLayout/PageContainer/typings.js +1 -0
- package/es/ProLayout/RouteContext.js +22 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +285 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +278 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/typings.js +1 -0
- package/es/ProLayout/TopHeader/index.js +163 -0
- package/es/ProLayout/defaultSettings.js +66 -0
- package/{src/ProLayout/index.ts → es/ProLayout/index.js} +4 -6
- package/{src → es}/ProLayout/style/default.less +1 -1
- package/es/ProLayout/style/index.js +1 -0
- package/es/ProLayout/typings.js +1 -0
- package/es/ProLayout/util.js +61 -0
- package/es/ProTable/index.js +411 -0
- package/es/ProTable/proTableTypes.js +11 -0
- package/es/ProTable/style/index.css +65 -0
- package/es/ProTable/style/index.js +1 -0
- package/{src → es}/ProTable/style/index.less +92 -92
- package/es/Scrollbar/Bar.js +114 -0
- package/es/Scrollbar/Scrollbar.js +212 -0
- package/es/Scrollbar/Thumb.js +189 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +2 -0
- package/es/Scrollbar/scrollbarProps.js +100 -0
- package/es/Scrollbar/thumbProps.js +10 -0
- package/es/Scrollbar/util.js +30 -0
- package/es/Search/Advanced/History.js +183 -0
- package/es/Search/Advanced/SaveHistory.js +153 -0
- package/es/Search/Advanced/index.js +520 -0
- package/es/Search/Item.js +497 -0
- package/es/Search/Search.js +249 -0
- package/es/Search/hooks/index.js +1 -0
- package/es/Search/hooks/useSearchItems.js +40 -0
- package/es/Search/index.js +4 -0
- package/es/Search/setting.js +91 -0
- package/es/Search/style/Item.less +33 -0
- package/es/Search/style/Search.less +179 -0
- package/es/Search/style/index.js +2 -0
- package/es/Search/typing.js +1 -0
- package/es/Search/util.js +234 -0
- package/es/ValueItem/ValueItem.js +233 -0
- package/es/ValueItem/index.js +2 -0
- package/es/ValueItem/util.js +16 -0
- package/es/index.js +24 -0
- package/es/style/index.js +3 -0
- package/es/style/variable.css +0 -0
- package/{src → es}/style/variable.less +2 -4
- package/es/style.js +5 -0
- package/lib/AMap/Map.js +125 -0
- package/lib/AMap/index.js +9 -0
- package/lib/AMap/util.js +62 -0
- package/lib/BadgeStatus/Badge.js +54 -0
- package/lib/BadgeStatus/color.js +27 -0
- package/lib/BadgeStatus/index.js +22 -0
- package/lib/CardSelect/CardSelect.js +123 -0
- package/lib/CardSelect/index.js +9 -0
- package/lib/CheckButton/CheckButton.js +120 -0
- package/lib/CheckButton/index.js +9 -0
- package/lib/CheckButton/style/index.css +37 -0
- package/lib/CheckButton/style/index.less +40 -0
- package/lib/ConfigProvider/context.js +19 -0
- package/lib/ConfigProvider/index.js +37 -0
- package/lib/Echarts/Echarts.js +47 -0
- package/lib/Echarts/index.js +9 -0
- package/lib/Ellipsis/Ellipsis.js +184 -0
- package/lib/Ellipsis/index.js +9 -0
- package/lib/Ellipsis/style/index.css +17 -0
- package/lib/Ellipsis/style/index.less +20 -0
- package/lib/Empty/Empty.js +56 -0
- package/lib/Empty/image.js +8 -0
- package/lib/Empty/index.js +9 -0
- package/lib/FullPage/FullPage.js +31 -0
- package/lib/FullPage/index.js +9 -0
- package/lib/Icon/icon.js +52 -0
- package/lib/Icon/index.js +9 -0
- package/lib/MonacoEditor/Monaco.js +238 -0
- package/lib/MonacoEditor/index.js +9 -0
- package/lib/PermissionButton/index.js +124 -0
- package/lib/ProLayout/Basic/BasicLayout.js +268 -0
- package/lib/ProLayout/Basic/BasicLayout.less +66 -0
- package/lib/ProLayout/Basic/Header.js +103 -0
- package/lib/ProLayout/Basic/Header.less +8 -0
- package/lib/ProLayout/PageContainer/index.js +327 -0
- package/lib/ProLayout/PageContainer/index.less +103 -0
- package/lib/ProLayout/PageContainer/typings.js +5 -0
- package/lib/ProLayout/RouteContext.js +28 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +290 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +287 -0
- package/lib/ProLayout/SiderMenu/index.js +20 -0
- package/lib/ProLayout/SiderMenu/index.less +212 -0
- package/lib/ProLayout/SiderMenu/typings.js +5 -0
- package/lib/ProLayout/TopHeader/index.js +168 -0
- package/lib/ProLayout/TopHeader/index.less +174 -0
- package/lib/ProLayout/defaultSettings.js +72 -0
- package/lib/ProLayout/index.js +16 -0
- package/lib/ProLayout/style/default.less +4 -0
- package/lib/ProLayout/style/index.js +3 -0
- package/lib/ProLayout/style/style.less +7 -0
- package/lib/ProLayout/typings.js +5 -0
- package/lib/ProLayout/util.js +72 -0
- package/lib/ProTable/index.js +417 -0
- package/lib/ProTable/proTableTypes.js +17 -0
- package/lib/ProTable/style/index.css +65 -0
- package/lib/ProTable/style/index.js +3 -0
- package/lib/ProTable/style/index.less +92 -0
- package/lib/Scrollbar/Bar.js +114 -0
- package/lib/Scrollbar/Scrollbar.js +212 -0
- package/lib/Scrollbar/Thumb.js +189 -0
- package/lib/Scrollbar/constants.js +7 -0
- package/lib/Scrollbar/index.js +9 -0
- package/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/scrollbarProps.js} +106 -108
- package/lib/Scrollbar/thumbProps.js +16 -0
- package/lib/Scrollbar/util.js +37 -0
- package/lib/Search/Advanced/History.js +183 -0
- package/lib/Search/Advanced/SaveHistory.js +153 -0
- package/lib/Search/Advanced/index.js +520 -0
- package/lib/Search/Item.js +497 -0
- package/lib/Search/Search.js +249 -0
- package/lib/Search/hooks/index.js +16 -0
- package/lib/Search/hooks/useSearchItems.js +47 -0
- package/lib/Search/index.js +16 -0
- package/lib/Search/setting.js +97 -0
- package/lib/Search/style/Item.less +33 -0
- package/lib/Search/style/Search.less +179 -0
- package/lib/Search/style/index.js +4 -0
- package/lib/Search/typing.js +5 -0
- package/lib/Search/util.js +241 -0
- package/lib/ValueItem/ValueItem.js +233 -0
- package/lib/ValueItem/index.js +9 -0
- package/lib/ValueItem/util.js +22 -0
- package/lib/index.js +158 -0
- package/lib/style/components.less +3 -0
- package/lib/style/index.js +4 -0
- package/lib/style/variable.css +0 -0
- package/lib/style/variable.less +2 -0
- package/lib/style.js +7 -0
- package/package.json +123 -13
- package/index.ts +0 -64
- package/src/AMap/Map.vue +0 -110
- package/src/AMap/index.ts +0 -1
- package/src/AMap/util.ts +0 -56
- package/src/BadgeStatus/Badge.vue +0 -41
- package/src/BadgeStatus/color.ts +0 -25
- package/src/BadgeStatus/index.ts +0 -4
- package/src/CardSelect/CardSelect.vue +0 -136
- package/src/CardSelect/index.ts +0 -3
- package/src/CheckButton/CheckButton.vue +0 -146
- package/src/CheckButton/index.md +0 -27
- package/src/CheckButton/index.ts +0 -3
- package/src/ConfigProvider/context.ts +0 -17
- package/src/ConfigProvider/index.tsx +0 -42
- package/src/Echarts/Echarts.vue +0 -43
- package/src/Echarts/index.ts +0 -3
- package/src/Ellipsis/Ellipsis.vue +0 -182
- package/src/Ellipsis/index.ts +0 -3
- package/src/Empty/Empty.vue +0 -43
- package/src/Empty/image.ts +0 -3
- package/src/Empty/index.ts +0 -2
- package/src/FullPage/FullPage.vue +0 -30
- package/src/FullPage/index.ts +0 -3
- package/src/Icon/icon.tsx +0 -40
- package/src/MonacoEditor/Monaco.vue +0 -242
- package/src/MonacoEditor/index.md +0 -26
- package/src/MonacoEditor/index.ts +0 -2
- package/src/PermissionButton/index.tsx +0 -110
- package/src/ProLayout/Basic/BasicLayout.tsx +0 -392
- package/src/ProLayout/Basic/Header.tsx +0 -115
- package/src/ProLayout/PageContainer/index.tsx +0 -441
- package/src/ProLayout/PageContainer/typings.ts +0 -56
- package/src/ProLayout/RouteContext.ts +0 -87
- package/src/ProLayout/SiderMenu/BaseMenu.tsx +0 -296
- package/src/ProLayout/SiderMenu/SiderMenu.tsx +0 -320
- package/src/ProLayout/SiderMenu/index.ts +0 -2
- package/src/ProLayout/SiderMenu/typings.ts +0 -49
- package/src/ProLayout/TopHeader/index.tsx +0 -210
- package/src/ProLayout/defaultSettings.ts +0 -106
- package/src/ProLayout/style/index.ts +0 -1
- package/src/ProLayout/typings.ts +0 -87
- package/src/ProLayout/util.ts +0 -64
- package/src/ProTable/index.md +0 -53
- package/src/ProTable/index.tsx +0 -551
- package/src/ProTable/proTableTypes.ts +0 -70
- package/src/ProTable/style/index.ts +0 -1
- package/src/Scrollbar/Bar.vue +0 -75
- package/src/Scrollbar/Scrollbar.vue +0 -260
- package/src/Scrollbar/Thumb.vue +0 -163
- package/src/Scrollbar/constants.ts +0 -10
- package/src/Scrollbar/index.ts +0 -4
- package/src/Scrollbar/thumb.ts +0 -16
- package/src/Scrollbar/util.ts +0 -38
- package/src/Search/Advanced/History.vue +0 -140
- package/src/Search/Advanced/SaveHistory.vue +0 -108
- package/src/Search/Advanced/index.vue +0 -435
- package/src/Search/Item.vue +0 -525
- package/src/Search/Search.vue +0 -398
- package/src/Search/hooks/index.ts +0 -1
- package/src/Search/hooks/useSearchItems.ts +0 -68
- package/src/Search/index.md +0 -57
- package/src/Search/index.ts +0 -5
- package/src/Search/setting.ts +0 -55
- package/src/Search/typing.ts +0 -76
- package/src/Search/util.ts +0 -263
- package/src/ValueItem/ValueItem.vue +0 -192
- package/src/ValueItem/index.ts +0 -3
- package/src/ValueItem/util.ts +0 -16
- package/src/style/index.ts +0 -3
- /package/{src → es}/ProLayout/Basic/BasicLayout.less +0 -0
- /package/{src → es}/ProLayout/Basic/Header.less +0 -0
- /package/{src → es}/ProLayout/PageContainer/index.less +0 -0
- /package/{src → es}/ProLayout/SiderMenu/index.less +0 -0
- /package/{src → es}/ProLayout/TopHeader/index.less +0 -0
- /package/{src → es}/ProLayout/style/style.less +0 -0
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
import { withInstall } from 'ant-design-vue/es/_util/type';
|
|
2
|
-
import {
|
|
3
|
-
TabPaneProps,
|
|
4
|
-
Affix,
|
|
5
|
-
Spin,
|
|
6
|
-
PageHeader,
|
|
7
|
-
Tabs,
|
|
8
|
-
Button,
|
|
9
|
-
} from 'ant-design-vue';
|
|
10
|
-
import type {
|
|
11
|
-
ExtractPropTypes,
|
|
12
|
-
FunctionalComponent,
|
|
13
|
-
PropType,
|
|
14
|
-
VNodeChild,
|
|
15
|
-
CSSProperties,
|
|
16
|
-
} from 'vue';
|
|
17
|
-
import { defineComponent, unref, toRefs, computed } from 'vue';
|
|
18
|
-
import { pageHeaderProps } from 'ant-design-vue/es/page-header';
|
|
19
|
-
import type { DefaultPropRender, PageHeaderRender } from '../typings';
|
|
20
|
-
import type { AffixProps, TabBarExtraContent } from './typings';
|
|
21
|
-
import { useRouteContext } from '../RouteContext';
|
|
22
|
-
import { getSlotVNode } from '../util';
|
|
23
|
-
import { VueNode } from 'ant-design-vue/es/_util/type';
|
|
24
|
-
import './index.less';
|
|
25
|
-
|
|
26
|
-
export const pageHeaderTabConfig = {
|
|
27
|
-
/**
|
|
28
|
-
* @name tabs 的列表
|
|
29
|
-
*/
|
|
30
|
-
tabList: {
|
|
31
|
-
type: [Object, Function, Array] as PropType<
|
|
32
|
-
(Omit<TabPaneProps, 'id'> & { key?: string; class: string })[]
|
|
33
|
-
>,
|
|
34
|
-
default: () => undefined,
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* @name 当前选中 tab 的 key
|
|
38
|
-
*/
|
|
39
|
-
tabActiveKey: String, //PropTypes.string,
|
|
40
|
-
/**
|
|
41
|
-
* @name tab 上多余的区域
|
|
42
|
-
*/
|
|
43
|
-
tabBarExtraContent: {
|
|
44
|
-
type: [Object, Function] as PropType<TabBarExtraContent>,
|
|
45
|
-
default: () => undefined,
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* @name tabs 的其他配置
|
|
49
|
-
*/
|
|
50
|
-
tabProps: {
|
|
51
|
-
type: Object, //as PropType<TabsProps>,
|
|
52
|
-
default: () => undefined,
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* @name 固定 PageHeader 到页面顶部
|
|
56
|
-
*/
|
|
57
|
-
fixedHeader: Boolean, //PropTypes.looseBool,
|
|
58
|
-
// events
|
|
59
|
-
onTabChange: Function, //PropTypes.func,
|
|
60
|
-
pure: Boolean,
|
|
61
|
-
};
|
|
62
|
-
export type PageHeaderTabConfig = Partial<
|
|
63
|
-
ExtractPropTypes<typeof pageHeaderTabConfig>
|
|
64
|
-
>;
|
|
65
|
-
|
|
66
|
-
export const pageContainerProps = {
|
|
67
|
-
...pageHeaderTabConfig,
|
|
68
|
-
...pageHeaderProps,
|
|
69
|
-
prefixCls: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: 'ant-pro',
|
|
72
|
-
}, //PropTypes.string.def('ant-pro'),
|
|
73
|
-
title: {
|
|
74
|
-
type: [
|
|
75
|
-
Object,
|
|
76
|
-
String,
|
|
77
|
-
Boolean,
|
|
78
|
-
Function,
|
|
79
|
-
] as PropType<DefaultPropRender>,
|
|
80
|
-
default: () => null,
|
|
81
|
-
},
|
|
82
|
-
subTitle: {
|
|
83
|
-
type: [
|
|
84
|
-
Object,
|
|
85
|
-
String,
|
|
86
|
-
Boolean,
|
|
87
|
-
Function,
|
|
88
|
-
] as PropType<DefaultPropRender>,
|
|
89
|
-
default: () => null,
|
|
90
|
-
},
|
|
91
|
-
content: {
|
|
92
|
-
type: [
|
|
93
|
-
Object,
|
|
94
|
-
String,
|
|
95
|
-
Boolean,
|
|
96
|
-
Function,
|
|
97
|
-
] as PropType<DefaultPropRender>,
|
|
98
|
-
default: () => null,
|
|
99
|
-
},
|
|
100
|
-
extra: {
|
|
101
|
-
type: [
|
|
102
|
-
Object,
|
|
103
|
-
String,
|
|
104
|
-
Boolean,
|
|
105
|
-
Function,
|
|
106
|
-
] as PropType<DefaultPropRender>,
|
|
107
|
-
default: () => null,
|
|
108
|
-
},
|
|
109
|
-
extraContent: {
|
|
110
|
-
type: [
|
|
111
|
-
Object,
|
|
112
|
-
String,
|
|
113
|
-
Boolean,
|
|
114
|
-
Function,
|
|
115
|
-
] as PropType<DefaultPropRender>,
|
|
116
|
-
default: () => null,
|
|
117
|
-
},
|
|
118
|
-
header: {
|
|
119
|
-
type: [
|
|
120
|
-
Object,
|
|
121
|
-
String,
|
|
122
|
-
Boolean,
|
|
123
|
-
Function,
|
|
124
|
-
] as PropType<DefaultPropRender>,
|
|
125
|
-
default: () => null,
|
|
126
|
-
},
|
|
127
|
-
pageHeaderRender: {
|
|
128
|
-
type: [Object, Function, Boolean] as PropType<PageHeaderRender>,
|
|
129
|
-
default: () => undefined,
|
|
130
|
-
},
|
|
131
|
-
affixProps: {
|
|
132
|
-
type: [Object, Function] as PropType<AffixProps>,
|
|
133
|
-
},
|
|
134
|
-
ghost: {
|
|
135
|
-
type: Boolean,
|
|
136
|
-
default: () => false,
|
|
137
|
-
}, //PropTypes.looseBool,
|
|
138
|
-
loading: {
|
|
139
|
-
type: Boolean,
|
|
140
|
-
default: () => undefined,
|
|
141
|
-
}, //PropTypes.looseBool,
|
|
142
|
-
childrenFullHeight: {
|
|
143
|
-
type: Boolean,
|
|
144
|
-
default: () => true,
|
|
145
|
-
},
|
|
146
|
-
pure: {
|
|
147
|
-
type: Boolean,
|
|
148
|
-
default: false,
|
|
149
|
-
},
|
|
150
|
-
showBack: {
|
|
151
|
-
type: Boolean,
|
|
152
|
-
default: false,
|
|
153
|
-
},
|
|
154
|
-
contentStyle: {
|
|
155
|
-
type: Object,
|
|
156
|
-
default: () => ({}),
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export type PageContainerProps = Partial<
|
|
161
|
-
ExtractPropTypes<typeof pageContainerProps>
|
|
162
|
-
>;
|
|
163
|
-
|
|
164
|
-
const renderFooter = (
|
|
165
|
-
props: Omit<PageContainerProps, 'title'>,
|
|
166
|
-
): VNodeChild | JSX.Element => {
|
|
167
|
-
const { tabList, tabActiveKey, onTabChange, tabBarExtraContent, tabProps } =
|
|
168
|
-
props;
|
|
169
|
-
const tabPane = (item: any) => {
|
|
170
|
-
return (
|
|
171
|
-
<span class={item.class || `tab-pane-${item.key}`}>{item.tab}</span>
|
|
172
|
-
);
|
|
173
|
-
};
|
|
174
|
-
if (tabList && tabList.length) {
|
|
175
|
-
return (
|
|
176
|
-
<Tabs
|
|
177
|
-
class={`page-container-tabs`}
|
|
178
|
-
activeKey={tabActiveKey}
|
|
179
|
-
onChange={(key: string | number) => {
|
|
180
|
-
if (onTabChange) {
|
|
181
|
-
onTabChange(key);
|
|
182
|
-
}
|
|
183
|
-
}}
|
|
184
|
-
tabBarExtraContent={tabBarExtraContent}
|
|
185
|
-
{...tabProps}
|
|
186
|
-
>
|
|
187
|
-
{tabList.map((item) => (
|
|
188
|
-
<Tabs.TabPane
|
|
189
|
-
{...item}
|
|
190
|
-
tab={tabPane(item)}
|
|
191
|
-
key={item.key}
|
|
192
|
-
/>
|
|
193
|
-
))}
|
|
194
|
-
</Tabs>
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
return null;
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
const renderPageHeader = (
|
|
201
|
-
content: VueNode,
|
|
202
|
-
extraContent: VueNode | any,
|
|
203
|
-
prefixedClassName: string,
|
|
204
|
-
): VNodeChild | JSX.Element | null => {
|
|
205
|
-
if (!content && !extraContent) {
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
208
|
-
return (
|
|
209
|
-
<div class={`${prefixedClassName}-detail`}>
|
|
210
|
-
<div class={`${prefixedClassName}-main`}>
|
|
211
|
-
<div class={`${prefixedClassName}-row`}>
|
|
212
|
-
{content && (
|
|
213
|
-
<div class={`${prefixedClassName}-content`}>
|
|
214
|
-
{
|
|
215
|
-
// @ts-ignore
|
|
216
|
-
(typeof content === 'function' && content()) ||
|
|
217
|
-
content
|
|
218
|
-
}
|
|
219
|
-
</div>
|
|
220
|
-
)}
|
|
221
|
-
{extraContent && (
|
|
222
|
-
<div class={`${prefixedClassName}-extraContent`}>
|
|
223
|
-
{
|
|
224
|
-
// @ts-ignore
|
|
225
|
-
(typeof extraContent === 'function' &&
|
|
226
|
-
extraContent()) ||
|
|
227
|
-
extraContent
|
|
228
|
-
}
|
|
229
|
-
</div>
|
|
230
|
-
)}
|
|
231
|
-
</div>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
);
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
const ProPageHeader: FunctionalComponent<
|
|
238
|
-
PageContainerProps & { prefixedClassName: string }
|
|
239
|
-
> = (props) => {
|
|
240
|
-
const {
|
|
241
|
-
title,
|
|
242
|
-
tabList,
|
|
243
|
-
tabActiveKey,
|
|
244
|
-
content,
|
|
245
|
-
pageHeaderRender,
|
|
246
|
-
header,
|
|
247
|
-
extraContent,
|
|
248
|
-
prefixedClassName,
|
|
249
|
-
prefixCls,
|
|
250
|
-
fixedHeader: _,
|
|
251
|
-
showBack,
|
|
252
|
-
...restProps
|
|
253
|
-
} = props;
|
|
254
|
-
|
|
255
|
-
const value = useRouteContext();
|
|
256
|
-
|
|
257
|
-
if (pageHeaderRender === false) {
|
|
258
|
-
return null;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if (pageHeaderRender) {
|
|
262
|
-
return pageHeaderRender({ ...props });
|
|
263
|
-
}
|
|
264
|
-
let pageHeaderTitle = title;
|
|
265
|
-
if (!title && title !== false) {
|
|
266
|
-
pageHeaderTitle = value.title;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const unrefBreadcrumb = unref(value.breadcrumb || {});
|
|
270
|
-
const breadcrumb = (props as any).breadcrumb || {
|
|
271
|
-
...unrefBreadcrumb,
|
|
272
|
-
routes: unrefBreadcrumb.routes,
|
|
273
|
-
itemRender: unrefBreadcrumb.itemRender,
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
const backProps: any = {};
|
|
277
|
-
|
|
278
|
-
if (showBack) {
|
|
279
|
-
// @ts-ignore
|
|
280
|
-
backProps.backIcon = <Button>返回</Button>;
|
|
281
|
-
backProps.onBack = () => {
|
|
282
|
-
value.back?.();
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return (
|
|
287
|
-
<div class={`${prefixedClassName}-wrap`}>
|
|
288
|
-
<PageHeader
|
|
289
|
-
{...backProps}
|
|
290
|
-
{...restProps}
|
|
291
|
-
// {...value}
|
|
292
|
-
title={pageHeaderTitle}
|
|
293
|
-
breadcrumb={breadcrumb}
|
|
294
|
-
footer={renderFooter({
|
|
295
|
-
...restProps,
|
|
296
|
-
tabList,
|
|
297
|
-
tabActiveKey,
|
|
298
|
-
})}
|
|
299
|
-
prefixCls={prefixCls}
|
|
300
|
-
>
|
|
301
|
-
{header ||
|
|
302
|
-
renderPageHeader(content, extraContent, prefixedClassName)}
|
|
303
|
-
</PageHeader>
|
|
304
|
-
</div>
|
|
305
|
-
);
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
const PageContainer = defineComponent({
|
|
309
|
-
name: 'JPageContainer',
|
|
310
|
-
inheritAttrs: false,
|
|
311
|
-
props: pageContainerProps,
|
|
312
|
-
setup(props, { slots, attrs }) {
|
|
313
|
-
const { loading, affixProps, ghost, childrenFullHeight } =
|
|
314
|
-
toRefs(props);
|
|
315
|
-
|
|
316
|
-
const value = useRouteContext();
|
|
317
|
-
const { getPrefixCls } = value;
|
|
318
|
-
const prefixCls = props.prefixCls || getPrefixCls();
|
|
319
|
-
|
|
320
|
-
const prefixedClassName = computed(() => `${prefixCls}-page-container`);
|
|
321
|
-
const classNames = computed(() => {
|
|
322
|
-
return {
|
|
323
|
-
[prefixedClassName.value]: true,
|
|
324
|
-
[`${prefixCls}-page-container-ghost`]: ghost.value,
|
|
325
|
-
};
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
const headerDom = computed(() => {
|
|
329
|
-
// const tags = getSlotVNode<DefaultPropRender>(slots, props, 'tags');
|
|
330
|
-
const headerContent = getSlotVNode<DefaultPropRender>(
|
|
331
|
-
slots,
|
|
332
|
-
props,
|
|
333
|
-
'content',
|
|
334
|
-
);
|
|
335
|
-
const extra = getSlotVNode<DefaultPropRender>(
|
|
336
|
-
slots,
|
|
337
|
-
props,
|
|
338
|
-
'extra',
|
|
339
|
-
);
|
|
340
|
-
const extraContent = getSlotVNode<DefaultPropRender>(
|
|
341
|
-
slots,
|
|
342
|
-
props,
|
|
343
|
-
'extraContent',
|
|
344
|
-
);
|
|
345
|
-
const subTitle = getSlotVNode<DefaultPropRender>(
|
|
346
|
-
slots,
|
|
347
|
-
props,
|
|
348
|
-
'subTitle',
|
|
349
|
-
);
|
|
350
|
-
const title = getSlotVNode<DefaultPropRender>(
|
|
351
|
-
slots,
|
|
352
|
-
props,
|
|
353
|
-
'title',
|
|
354
|
-
);
|
|
355
|
-
|
|
356
|
-
// @ts-ignore
|
|
357
|
-
return (
|
|
358
|
-
<ProPageHeader
|
|
359
|
-
{...props}
|
|
360
|
-
prefixCls={undefined}
|
|
361
|
-
prefixedClassName={prefixedClassName.value}
|
|
362
|
-
ghost={ghost.value}
|
|
363
|
-
title={title}
|
|
364
|
-
subTitle={subTitle}
|
|
365
|
-
content={headerContent}
|
|
366
|
-
// tags={tags}
|
|
367
|
-
extra={extra}
|
|
368
|
-
extraContent={extraContent}
|
|
369
|
-
/>
|
|
370
|
-
);
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
return () => {
|
|
374
|
-
const { fixedHeader, pure } = props;
|
|
375
|
-
return (
|
|
376
|
-
<>
|
|
377
|
-
{pure ? (
|
|
378
|
-
<div class={classNames.value}>{slots.default?.()}</div>
|
|
379
|
-
) : (
|
|
380
|
-
<div
|
|
381
|
-
class={classNames.value}
|
|
382
|
-
style={{
|
|
383
|
-
...((attrs.style as CSSProperties) || {}),
|
|
384
|
-
}}
|
|
385
|
-
>
|
|
386
|
-
{fixedHeader && headerDom.value ? (
|
|
387
|
-
<Affix
|
|
388
|
-
{...affixProps.value}
|
|
389
|
-
offsetTop={
|
|
390
|
-
value.hasHeader && value.fixedHeader
|
|
391
|
-
? value.headerHeight
|
|
392
|
-
: 0
|
|
393
|
-
}
|
|
394
|
-
>
|
|
395
|
-
{headerDom.value}
|
|
396
|
-
</Affix>
|
|
397
|
-
) : (
|
|
398
|
-
headerDom.value
|
|
399
|
-
)}
|
|
400
|
-
<div
|
|
401
|
-
class={`${prefixedClassName.value}-grid-content`}
|
|
402
|
-
>
|
|
403
|
-
{loading.value ? (
|
|
404
|
-
<Spin />
|
|
405
|
-
) : slots.default ? (
|
|
406
|
-
<div>
|
|
407
|
-
<div
|
|
408
|
-
class={`${
|
|
409
|
-
prefixedClassName.value
|
|
410
|
-
}-children-content ${
|
|
411
|
-
childrenFullHeight.value
|
|
412
|
-
? 'children-full-height'
|
|
413
|
-
: ''
|
|
414
|
-
}`}
|
|
415
|
-
style={{
|
|
416
|
-
...((props.contentStyle as CSSProperties) ||
|
|
417
|
-
{}),
|
|
418
|
-
}}
|
|
419
|
-
>
|
|
420
|
-
{slots.default()}
|
|
421
|
-
</div>
|
|
422
|
-
{value.hasFooterToolbar && (
|
|
423
|
-
<div
|
|
424
|
-
style={{
|
|
425
|
-
height: 48,
|
|
426
|
-
marginTop: 24,
|
|
427
|
-
}}
|
|
428
|
-
/>
|
|
429
|
-
)}
|
|
430
|
-
</div>
|
|
431
|
-
) : null}
|
|
432
|
-
</div>
|
|
433
|
-
</div>
|
|
434
|
-
)}
|
|
435
|
-
</>
|
|
436
|
-
);
|
|
437
|
-
};
|
|
438
|
-
},
|
|
439
|
-
});
|
|
440
|
-
|
|
441
|
-
export default withInstall(PageContainer);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { VNodeChild, CSSProperties, VNode } from 'vue';
|
|
2
|
-
|
|
3
|
-
export interface Tab {
|
|
4
|
-
key: string;
|
|
5
|
-
tab: string | VNode | JSX.Element;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type TabBarType = 'line' | 'card' | 'editable-card';
|
|
9
|
-
export type TabSize = 'default' | 'large' | 'small';
|
|
10
|
-
export type TabPosition = 'left' | 'right';
|
|
11
|
-
export type TabBarExtraPosition = TabPosition;
|
|
12
|
-
|
|
13
|
-
export type TabBarExtraMap = Partial<Record<TabBarExtraPosition, VNodeChild>>;
|
|
14
|
-
|
|
15
|
-
export type TabBarExtraContent = VNodeChild | TabBarExtraMap;
|
|
16
|
-
|
|
17
|
-
export interface TabsProps {
|
|
18
|
-
prefixCls?: string;
|
|
19
|
-
class?: string | string[];
|
|
20
|
-
style?: CSSProperties;
|
|
21
|
-
id?: string;
|
|
22
|
-
|
|
23
|
-
activeKey?: string;
|
|
24
|
-
hideAdd?: boolean;
|
|
25
|
-
// Unchangeable
|
|
26
|
-
// size?: TabSize;
|
|
27
|
-
tabBarStyle?: CSSProperties;
|
|
28
|
-
tabPosition?: TabPosition;
|
|
29
|
-
type?: TabBarType;
|
|
30
|
-
tabBarGutter?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface AffixProps {
|
|
34
|
-
offsetBottom: number;
|
|
35
|
-
offsetTop: number;
|
|
36
|
-
target?: () => HTMLElement;
|
|
37
|
-
|
|
38
|
-
onChange?: (affixed: boolean) => void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface TabPaneProps {
|
|
42
|
-
tab?: string | VNodeChild | JSX.Element;
|
|
43
|
-
class?: string | string[];
|
|
44
|
-
style?: CSSProperties;
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
forceRender?: boolean;
|
|
47
|
-
closable?: boolean;
|
|
48
|
-
closeIcon?: VNodeChild | JSX.Element;
|
|
49
|
-
|
|
50
|
-
prefixCls?: string;
|
|
51
|
-
tabKey?: string;
|
|
52
|
-
id: string;
|
|
53
|
-
animated?: boolean;
|
|
54
|
-
active?: boolean;
|
|
55
|
-
destroyInactiveTabPane?: boolean;
|
|
56
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { provide, reactive } from 'vue';
|
|
2
|
-
import type { InjectionKey, Ref, VNodeChild, ComputedRef } from 'vue';
|
|
3
|
-
import { useContext } from '@jetlinks-web/hooks';
|
|
4
|
-
import type { MenuDataItem, FormatMessage, WithFalse } from './typings';
|
|
5
|
-
import type { DefaultSettingProps } from './defaultSettings';
|
|
6
|
-
|
|
7
|
-
export interface Route {
|
|
8
|
-
path: string;
|
|
9
|
-
breadcrumbName: string;
|
|
10
|
-
children?: Omit<Route, 'children'>[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface BreadcrumbProps {
|
|
14
|
-
prefixCls?: string;
|
|
15
|
-
routes?: Route[];
|
|
16
|
-
params?: any;
|
|
17
|
-
separator?: VNodeChild;
|
|
18
|
-
itemRender?: (opts: {
|
|
19
|
-
route: Route;
|
|
20
|
-
params: any;
|
|
21
|
-
routes: Array<Route>;
|
|
22
|
-
paths: Array<string>;
|
|
23
|
-
}) => VNodeChild;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type BreadcrumbListReturn = Pick<
|
|
27
|
-
BreadcrumbProps,
|
|
28
|
-
Extract<keyof BreadcrumbProps, 'routes' | 'itemRender'>
|
|
29
|
-
>;
|
|
30
|
-
|
|
31
|
-
export interface MenuState {
|
|
32
|
-
selectedKeys: string[];
|
|
33
|
-
openKeys: string[];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface RouteContextProps
|
|
37
|
-
extends Partial<DefaultSettingProps>,
|
|
38
|
-
MenuState {
|
|
39
|
-
menuData: MenuDataItem[];
|
|
40
|
-
flatMenuData?: MenuDataItem[];
|
|
41
|
-
|
|
42
|
-
getPrefixCls?: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
43
|
-
locale?: WithFalse<FormatMessage>;
|
|
44
|
-
breadcrumb?: BreadcrumbListReturn | ComputedRef<BreadcrumbListReturn>;
|
|
45
|
-
prefixCls?: string;
|
|
46
|
-
collapsed?: boolean;
|
|
47
|
-
hasSideMenu?: boolean;
|
|
48
|
-
hasHeader?: boolean;
|
|
49
|
-
siderWidth?: number;
|
|
50
|
-
headerHeight?: number;
|
|
51
|
-
hasSide?: boolean;
|
|
52
|
-
/* 附加属性 */
|
|
53
|
-
[key: string]: any;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export const defaultPrefixCls = 'ant-pro';
|
|
57
|
-
|
|
58
|
-
export const getPrefixCls = (
|
|
59
|
-
suffixCls?: string,
|
|
60
|
-
customizePrefixCls?: string,
|
|
61
|
-
) => {
|
|
62
|
-
if (customizePrefixCls) return customizePrefixCls;
|
|
63
|
-
return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const defaultRouteContext = reactive({
|
|
67
|
-
getPrefixCls,
|
|
68
|
-
locale: (t: string) => t,
|
|
69
|
-
contentWidth: 'Fluid',
|
|
70
|
-
hasFooterToolbar: false,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export const routeContextInjectKey: InjectionKey<RouteContextProps> = Symbol(
|
|
74
|
-
'jetlinks-route-context',
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
export const provideRouteContext = (
|
|
78
|
-
value: RouteContextProps | Ref<RouteContextProps>,
|
|
79
|
-
) => {
|
|
80
|
-
provide(routeContextInjectKey, value);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const useRouteContext = () =>
|
|
84
|
-
useContext<Required<RouteContextProps>>(
|
|
85
|
-
routeContextInjectKey,
|
|
86
|
-
defaultRouteContext,
|
|
87
|
-
);
|