@jetlinks-web/components 2.0.2-2 → 2.0.2-4
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 +124 -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 +121 -0
- package/es/CheckButton/index.js +2 -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 +189 -0
- package/es/Ellipsis/index.js +2 -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 +43 -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 +255 -0
- package/es/ProLayout/Basic/Header.js +93 -0
- package/es/ProLayout/PageContainer/index.js +318 -0
- package/es/ProLayout/PageContainer/typings.js +1 -0
- package/es/ProLayout/RouteContext.js +22 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +262 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +258 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/typings.js +1 -0
- package/es/ProLayout/TopHeader/index.js +155 -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 +4 -4
- 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 +406 -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/es/Scrollbar/Bar.js +114 -0
- package/es/Scrollbar/Scrollbar.js +100 -0
- package/es/Scrollbar/Thumb.js +10 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +2 -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/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 +0 -2
- package/lib/AMap/Map.js +124 -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 +121 -0
- package/lib/CheckButton/index.js +9 -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 +189 -0
- package/lib/Ellipsis/index.js +9 -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 +264 -0
- package/lib/ProLayout/Basic/BasicLayout.less +66 -0
- package/lib/ProLayout/Basic/Header.js +99 -0
- package/lib/ProLayout/Basic/Header.less +8 -0
- package/lib/ProLayout/PageContainer/index.js +323 -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 +268 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +267 -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 +161 -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 +412 -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/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/Scrollbar.js} +106 -108
- package/lib/Scrollbar/Thumb.js +16 -0
- package/lib/Scrollbar/constants.js +7 -0
- package/lib/Scrollbar/index.js +9 -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/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 +1 -0
- package/lib/style/index.js +4 -0
- package/lib/style/variable.css +0 -0
- package/lib/style/variable.less +2 -0
- package/package.json +121 -12
- 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 -40
- 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 -395
- 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
- /package/{src → es}/ProTable/style/index.less +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
var _excluded = ["title", "tabList", "tabActiveKey", "content", "pageHeaderRender", "header", "extraContent", "prefixedClassName", "prefixCls", "fixedHeader", "showBack"];
|
|
5
|
+
import { Fragment as _Fragment, createTextVNode as _createTextVNode, createVNode as _createVNode } from "vue";
|
|
6
|
+
import { withInstall } from 'ant-design-vue/es/_util/type';
|
|
7
|
+
import { Affix, Spin, PageHeader, Tabs, Button } from 'ant-design-vue';
|
|
8
|
+
import { defineComponent, unref, toRefs, computed } from 'vue';
|
|
9
|
+
import { pageHeaderProps } from 'ant-design-vue/es/page-header';
|
|
10
|
+
import { useRouteContext } from '../RouteContext';
|
|
11
|
+
import { getSlotVNode } from '../util';
|
|
12
|
+
import 'ant-design-vue/es/_util/type';
|
|
13
|
+
import './index.less';
|
|
14
|
+
export var pageHeaderTabConfig = {
|
|
15
|
+
/**
|
|
16
|
+
* @name tabs 的列表
|
|
17
|
+
*/
|
|
18
|
+
tabList: {
|
|
19
|
+
type: [Object, Function, Array],
|
|
20
|
+
default: function _default() {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* @name 当前选中 tab 的 key
|
|
26
|
+
*/
|
|
27
|
+
tabActiveKey: String,
|
|
28
|
+
/**
|
|
29
|
+
* @name tab 上多余的区域
|
|
30
|
+
*/
|
|
31
|
+
tabBarExtraContent: {
|
|
32
|
+
type: [Object, Function],
|
|
33
|
+
default: function _default() {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* @name tabs 的其他配置
|
|
39
|
+
*/
|
|
40
|
+
tabProps: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: function _default() {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* @name 固定 PageHeader 到页面顶部
|
|
48
|
+
*/
|
|
49
|
+
fixedHeader: Boolean,
|
|
50
|
+
// events
|
|
51
|
+
onTabChange: Function,
|
|
52
|
+
pure: Boolean
|
|
53
|
+
};
|
|
54
|
+
export var pageContainerProps = _objectSpread(_objectSpread(_objectSpread({}, pageHeaderTabConfig), pageHeaderProps), {}, {
|
|
55
|
+
prefixCls: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: 'ant-pro'
|
|
58
|
+
},
|
|
59
|
+
title: {
|
|
60
|
+
type: [Object, String, Boolean, Function],
|
|
61
|
+
default: function _default() {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
subTitle: {
|
|
66
|
+
type: [Object, String, Boolean, Function],
|
|
67
|
+
default: function _default() {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
content: {
|
|
72
|
+
type: [Object, String, Boolean, Function],
|
|
73
|
+
default: function _default() {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
extra: {
|
|
78
|
+
type: [Object, String, Boolean, Function],
|
|
79
|
+
default: function _default() {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
extraContent: {
|
|
84
|
+
type: [Object, String, Boolean, Function],
|
|
85
|
+
default: function _default() {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
header: {
|
|
90
|
+
type: [Object, String, Boolean, Function],
|
|
91
|
+
default: function _default() {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
pageHeaderRender: {
|
|
96
|
+
type: [Object, Function, Boolean],
|
|
97
|
+
default: function _default() {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
affixProps: {
|
|
102
|
+
type: [Object, Function]
|
|
103
|
+
},
|
|
104
|
+
ghost: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: function _default() {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
loading: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: function _default() {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
childrenFullHeight: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: function _default() {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
pure: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
showBack: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false
|
|
129
|
+
},
|
|
130
|
+
contentStyle: {
|
|
131
|
+
type: Object,
|
|
132
|
+
default: function _default() {
|
|
133
|
+
return {};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
var renderFooter = function renderFooter(props) {
|
|
138
|
+
var tabList = props.tabList,
|
|
139
|
+
tabActiveKey = props.tabActiveKey,
|
|
140
|
+
onTabChange = props.onTabChange,
|
|
141
|
+
tabBarExtraContent = props.tabBarExtraContent,
|
|
142
|
+
tabProps = props.tabProps;
|
|
143
|
+
var tabPane = function tabPane(item) {
|
|
144
|
+
return _createVNode("span", {
|
|
145
|
+
"class": item.class || "tab-pane-".concat(item.key)
|
|
146
|
+
}, [item.tab]);
|
|
147
|
+
};
|
|
148
|
+
if (tabList && tabList.length) {
|
|
149
|
+
return _createVNode(Tabs, _objectSpread({
|
|
150
|
+
"class": "page-container-tabs",
|
|
151
|
+
"activeKey": tabActiveKey,
|
|
152
|
+
"onChange": function onChange(key) {
|
|
153
|
+
if (onTabChange) {
|
|
154
|
+
onTabChange(key);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"tabBarExtraContent": tabBarExtraContent
|
|
158
|
+
}, tabProps), {
|
|
159
|
+
default: function _default() {
|
|
160
|
+
return [tabList.map(function (item) {
|
|
161
|
+
return _createVNode(Tabs.TabPane, _objectSpread(_objectSpread({}, item), {}, {
|
|
162
|
+
"tab": tabPane(item),
|
|
163
|
+
"key": item.key
|
|
164
|
+
}), null);
|
|
165
|
+
})];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
};
|
|
171
|
+
var renderPageHeader = function renderPageHeader(content, extraContent, prefixedClassName) {
|
|
172
|
+
if (!content && !extraContent) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
return _createVNode("div", {
|
|
176
|
+
"class": "".concat(prefixedClassName, "-detail")
|
|
177
|
+
}, [_createVNode("div", {
|
|
178
|
+
"class": "".concat(prefixedClassName, "-main")
|
|
179
|
+
}, [_createVNode("div", {
|
|
180
|
+
"class": "".concat(prefixedClassName, "-row")
|
|
181
|
+
}, [content && _createVNode("div", {
|
|
182
|
+
"class": "".concat(prefixedClassName, "-content")
|
|
183
|
+
}, [
|
|
184
|
+
// @ts-ignore
|
|
185
|
+
typeof content === 'function' && content() || content]), extraContent && _createVNode("div", {
|
|
186
|
+
"class": "".concat(prefixedClassName, "-extraContent")
|
|
187
|
+
}, [
|
|
188
|
+
// @ts-ignore
|
|
189
|
+
typeof extraContent === 'function' && extraContent() || extraContent])])])]);
|
|
190
|
+
};
|
|
191
|
+
var ProPageHeader = function ProPageHeader(props) {
|
|
192
|
+
var title = props.title,
|
|
193
|
+
tabList = props.tabList,
|
|
194
|
+
tabActiveKey = props.tabActiveKey,
|
|
195
|
+
content = props.content,
|
|
196
|
+
pageHeaderRender = props.pageHeaderRender,
|
|
197
|
+
header = props.header,
|
|
198
|
+
extraContent = props.extraContent,
|
|
199
|
+
prefixedClassName = props.prefixedClassName,
|
|
200
|
+
prefixCls = props.prefixCls,
|
|
201
|
+
_ = props.fixedHeader,
|
|
202
|
+
showBack = props.showBack,
|
|
203
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
204
|
+
var value = useRouteContext();
|
|
205
|
+
if (pageHeaderRender === false) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
if (pageHeaderRender) {
|
|
209
|
+
return pageHeaderRender(_objectSpread({}, props));
|
|
210
|
+
}
|
|
211
|
+
var pageHeaderTitle = title;
|
|
212
|
+
if (!title && title !== false) {
|
|
213
|
+
pageHeaderTitle = value.title;
|
|
214
|
+
}
|
|
215
|
+
var unrefBreadcrumb = unref(value.breadcrumb || {});
|
|
216
|
+
var breadcrumb = props.breadcrumb || _objectSpread(_objectSpread({}, unrefBreadcrumb), {}, {
|
|
217
|
+
routes: unrefBreadcrumb.routes,
|
|
218
|
+
itemRender: unrefBreadcrumb.itemRender
|
|
219
|
+
});
|
|
220
|
+
var backProps = {};
|
|
221
|
+
if (showBack) {
|
|
222
|
+
// @ts-ignore
|
|
223
|
+
backProps.backIcon = _createVNode(Button, null, {
|
|
224
|
+
default: function _default() {
|
|
225
|
+
return [_createTextVNode("\u8FD4\u56DE")];
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
backProps.onBack = function () {
|
|
229
|
+
var _value$back;
|
|
230
|
+
(_value$back = value.back) === null || _value$back === void 0 ? void 0 : _value$back.call(value);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
return _createVNode("div", {
|
|
234
|
+
"class": "".concat(prefixedClassName, "-wrap")
|
|
235
|
+
}, [_createVNode(PageHeader, _objectSpread(_objectSpread(_objectSpread({}, backProps), restProps), {}, {
|
|
236
|
+
"title": pageHeaderTitle,
|
|
237
|
+
"breadcrumb": breadcrumb,
|
|
238
|
+
"footer": renderFooter(_objectSpread(_objectSpread({}, restProps), {}, {
|
|
239
|
+
tabList: tabList,
|
|
240
|
+
tabActiveKey: tabActiveKey
|
|
241
|
+
})),
|
|
242
|
+
"prefixCls": prefixCls
|
|
243
|
+
}), {
|
|
244
|
+
default: function _default() {
|
|
245
|
+
return [header || renderPageHeader(content, extraContent, prefixedClassName)];
|
|
246
|
+
}
|
|
247
|
+
})]);
|
|
248
|
+
};
|
|
249
|
+
var PageContainer = defineComponent({
|
|
250
|
+
name: 'JPageContainer',
|
|
251
|
+
inheritAttrs: false,
|
|
252
|
+
props: pageContainerProps,
|
|
253
|
+
setup: function setup(props, _ref) {
|
|
254
|
+
var slots = _ref.slots,
|
|
255
|
+
attrs = _ref.attrs;
|
|
256
|
+
var _toRefs = toRefs(props),
|
|
257
|
+
loading = _toRefs.loading,
|
|
258
|
+
affixProps = _toRefs.affixProps,
|
|
259
|
+
ghost = _toRefs.ghost,
|
|
260
|
+
childrenFullHeight = _toRefs.childrenFullHeight;
|
|
261
|
+
var value = useRouteContext();
|
|
262
|
+
var getPrefixCls = value.getPrefixCls;
|
|
263
|
+
var prefixCls = props.prefixCls || getPrefixCls();
|
|
264
|
+
var prefixedClassName = computed(function () {
|
|
265
|
+
return "".concat(prefixCls, "-page-container");
|
|
266
|
+
});
|
|
267
|
+
var classNames = computed(function () {
|
|
268
|
+
return _defineProperty(_defineProperty({}, prefixedClassName.value, true), "".concat(prefixCls, "-page-container-ghost"), ghost.value);
|
|
269
|
+
});
|
|
270
|
+
var headerDom = computed(function () {
|
|
271
|
+
// const tags = getSlotVNode<DefaultPropRender>(slots, props, 'tags');
|
|
272
|
+
var headerContent = getSlotVNode(slots, props, 'content');
|
|
273
|
+
var extra = getSlotVNode(slots, props, 'extra');
|
|
274
|
+
var extraContent = getSlotVNode(slots, props, 'extraContent');
|
|
275
|
+
var subTitle = getSlotVNode(slots, props, 'subTitle');
|
|
276
|
+
var title = getSlotVNode(slots, props, 'title');
|
|
277
|
+
// @ts-ignore
|
|
278
|
+
return _createVNode(ProPageHeader, _objectSpread(_objectSpread({}, props), {}, {
|
|
279
|
+
"prefixCls": undefined,
|
|
280
|
+
"prefixedClassName": prefixedClassName.value,
|
|
281
|
+
"ghost": ghost.value,
|
|
282
|
+
"title": title,
|
|
283
|
+
"subTitle": subTitle,
|
|
284
|
+
"content": headerContent,
|
|
285
|
+
"extra": extra,
|
|
286
|
+
"extraContent": extraContent
|
|
287
|
+
}), null);
|
|
288
|
+
});
|
|
289
|
+
return function () {
|
|
290
|
+
var _slots$default;
|
|
291
|
+
var fixedHeader = props.fixedHeader,
|
|
292
|
+
pure = props.pure;
|
|
293
|
+
return _createVNode(_Fragment, null, [pure ? _createVNode("div", {
|
|
294
|
+
"class": classNames.value
|
|
295
|
+
}, [(_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)]) : _createVNode("div", {
|
|
296
|
+
"class": classNames.value,
|
|
297
|
+
"style": _objectSpread({}, attrs.style || {})
|
|
298
|
+
}, [fixedHeader && headerDom.value ? _createVNode(Affix, _objectSpread(_objectSpread({}, affixProps.value), {}, {
|
|
299
|
+
"offsetTop": value.hasHeader && value.fixedHeader ? value.headerHeight : 0
|
|
300
|
+
}), {
|
|
301
|
+
default: function _default() {
|
|
302
|
+
return [headerDom.value];
|
|
303
|
+
}
|
|
304
|
+
}) : headerDom.value, _createVNode("div", {
|
|
305
|
+
"class": "".concat(prefixedClassName.value, "-grid-content")
|
|
306
|
+
}, [loading.value ? _createVNode(Spin, null, null) : slots.default ? _createVNode("div", null, [_createVNode("div", {
|
|
307
|
+
"class": "".concat(prefixedClassName.value, "-children-content ").concat(childrenFullHeight.value ? 'children-full-height' : ''),
|
|
308
|
+
"style": _objectSpread({}, props.contentStyle || {})
|
|
309
|
+
}, [slots.default()]), value.hasFooterToolbar && _createVNode("div", {
|
|
310
|
+
"style": {
|
|
311
|
+
height: 48,
|
|
312
|
+
marginTop: 24
|
|
313
|
+
}
|
|
314
|
+
}, null)]) : null])])]);
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
export default withInstall(PageContainer);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { provide, reactive } from 'vue';
|
|
2
|
+
import { useContext } from '@jetlinks-web/hooks';
|
|
3
|
+
export var defaultPrefixCls = 'ant-pro';
|
|
4
|
+
export var getPrefixCls = function getPrefixCls(suffixCls, customizePrefixCls) {
|
|
5
|
+
if (customizePrefixCls) return customizePrefixCls;
|
|
6
|
+
return suffixCls ? "".concat(defaultPrefixCls, "-").concat(suffixCls) : defaultPrefixCls;
|
|
7
|
+
};
|
|
8
|
+
export var defaultRouteContext = reactive({
|
|
9
|
+
getPrefixCls: getPrefixCls,
|
|
10
|
+
locale: function locale(t) {
|
|
11
|
+
return t;
|
|
12
|
+
},
|
|
13
|
+
contentWidth: 'Fluid',
|
|
14
|
+
hasFooterToolbar: false
|
|
15
|
+
});
|
|
16
|
+
export var routeContextInjectKey = Symbol('jetlinks-route-context');
|
|
17
|
+
export var provideRouteContext = function provideRouteContext(value) {
|
|
18
|
+
provide(routeContextInjectKey, value);
|
|
19
|
+
};
|
|
20
|
+
export var useRouteContext = function useRouteContext() {
|
|
21
|
+
return useContext(routeContextInjectKey, defaultRouteContext);
|
|
22
|
+
};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
import { createVNode as _createVNode } from "vue";
|
|
7
|
+
import { defaultSettingProps } from '../defaultSettings';
|
|
8
|
+
import { defineComponent, getCurrentInstance, isVNode, resolveComponent, watchEffect, withCtx } from 'vue';
|
|
9
|
+
import { defaultPrefixCls } from '../RouteContext';
|
|
10
|
+
import IconFont from '../../Icon';
|
|
11
|
+
import { regular } from '@jetlinks-web/utils';
|
|
12
|
+
import { Menu } from 'ant-design-vue';
|
|
13
|
+
import { createFromIconfontCN } from '@ant-design/icons-vue';
|
|
14
|
+
export var baseMenuProps = _objectSpread(_objectSpread({}, defaultSettingProps), {}, {
|
|
15
|
+
prefixCls: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: function _default() {
|
|
18
|
+
return defaultPrefixCls;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
locale: {
|
|
22
|
+
type: [Function, Boolean],
|
|
23
|
+
default: function _default(t) {
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
menuData: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: function _default() {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
mode: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'inline'
|
|
36
|
+
},
|
|
37
|
+
theme: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'dark'
|
|
40
|
+
},
|
|
41
|
+
collapsed: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: function _default() {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
openKeys: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: function _default() {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
selectedKeys: {
|
|
54
|
+
type: Array,
|
|
55
|
+
default: function _default() {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
menuProps: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: function _default() {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
menuItemRender: {
|
|
66
|
+
type: [Object, Function, Boolean],
|
|
67
|
+
default: function _default() {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
subMenuItemRender: {
|
|
72
|
+
type: [Object, Function, Boolean],
|
|
73
|
+
default: function _default() {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
onClick: [Function, Object]
|
|
78
|
+
});
|
|
79
|
+
var AntdIconFont = createFromIconfontCN({
|
|
80
|
+
scriptUrl: ''
|
|
81
|
+
});
|
|
82
|
+
var LazyIcon = function LazyIcon(props) {
|
|
83
|
+
var icon = props.icon,
|
|
84
|
+
iconUrl = props.iconUrl,
|
|
85
|
+
_props$prefixCls = props.prefixCls,
|
|
86
|
+
prefixCls = _props$prefixCls === void 0 ? defaultPrefixCls : _props$prefixCls;
|
|
87
|
+
if (!icon) return null;
|
|
88
|
+
if (isVNode(icon)) {
|
|
89
|
+
return icon;
|
|
90
|
+
}
|
|
91
|
+
if (typeof icon === 'string' && icon !== '') {
|
|
92
|
+
if (regular.isUrl(icon) || regular.isImg(icon)) {
|
|
93
|
+
return _createVNode("img", {
|
|
94
|
+
"src": icon,
|
|
95
|
+
"alt": "icon",
|
|
96
|
+
"class": "".concat(prefixCls, "-sider-menu-icon")
|
|
97
|
+
}, null);
|
|
98
|
+
}
|
|
99
|
+
return iconUrl ? _createVNode(AntdIconFont, {
|
|
100
|
+
"type": icon
|
|
101
|
+
}, null) : _createVNode(IconFont, {
|
|
102
|
+
"type": icon
|
|
103
|
+
}, null);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(_props, ctx) {
|
|
107
|
+
var _this = this;
|
|
108
|
+
_classCallCheck(this, MenuUtil);
|
|
109
|
+
_defineProperty(this, "getNavMenuItems", function () {
|
|
110
|
+
var menusData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
111
|
+
return menusData.map(function (item) {
|
|
112
|
+
return _this.getSubMenuOrItem(item);
|
|
113
|
+
}).filter(function (item) {
|
|
114
|
+
return item;
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
_defineProperty(this, "getSubMenuOrItem", function (item) {
|
|
118
|
+
var _item$meta, _item$meta2, _item$meta7, _item$meta8;
|
|
119
|
+
if (Array.isArray(item.children) && item.children.length > 0 && !(item !== null && item !== void 0 && (_item$meta = item.meta) !== null && _item$meta !== void 0 && _item$meta.hideInMenu) && !(item !== null && item !== void 0 && (_item$meta2 = item.meta) !== null && _item$meta2 !== void 0 && _item$meta2.hideChildrenInMenu)) {
|
|
120
|
+
var _item$meta3, _item$meta4, _item$meta5, _item$meta6;
|
|
121
|
+
if (_this.props.subMenuItemRender) {
|
|
122
|
+
var subMenuItemRender = withCtx(_this.props.subMenuItemRender, _this.ctx);
|
|
123
|
+
return subMenuItemRender({
|
|
124
|
+
item: item,
|
|
125
|
+
children: _this.getNavMenuItems(item.children)
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
var _this$props = _this.props,
|
|
129
|
+
prefixCls = _this$props.prefixCls,
|
|
130
|
+
locale = _this$props.locale;
|
|
131
|
+
var menuTitle = locale && locale((_item$meta3 = item.meta) === null || _item$meta3 === void 0 ? void 0 : _item$meta3.title) || ((_item$meta4 = item.meta) === null || _item$meta4 === void 0 ? void 0 : _item$meta4.title);
|
|
132
|
+
var defaultTitle = (_item$meta5 = item.meta) !== null && _item$meta5 !== void 0 && _item$meta5.icon ? _createVNode("span", {
|
|
133
|
+
"class": "".concat(prefixCls, "-menu-item")
|
|
134
|
+
}, [_createVNode("span", {
|
|
135
|
+
"class": "".concat(prefixCls, "-menu-item-title")
|
|
136
|
+
}, [menuTitle])]) : _createVNode("span", {
|
|
137
|
+
"class": "".concat(prefixCls, "-menu-item")
|
|
138
|
+
}, [menuTitle]);
|
|
139
|
+
return _createVNode(Menu.SubMenu, {
|
|
140
|
+
"title": defaultTitle,
|
|
141
|
+
"key": item.path,
|
|
142
|
+
"popupClassName": "".concat(prefixCls, "-menu-popup"),
|
|
143
|
+
"icon": _createVNode(LazyIcon, {
|
|
144
|
+
"iconUrl": _this.props.iconfontUrl,
|
|
145
|
+
"icon": (_item$meta6 = item.meta) === null || _item$meta6 === void 0 ? void 0 : _item$meta6.icon
|
|
146
|
+
}, null)
|
|
147
|
+
}, {
|
|
148
|
+
default: function _default() {
|
|
149
|
+
return [_this.getNavMenuItems(item.children)];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
var menuItemRender = _this.props.menuItemRender && withCtx(_this.props.menuItemRender, _this.ctx);
|
|
154
|
+
var _this$getMenuItem = _this.getMenuItem(item),
|
|
155
|
+
_this$getMenuItem2 = _slicedToArray(_this$getMenuItem, 2),
|
|
156
|
+
title = _this$getMenuItem2[0],
|
|
157
|
+
icon = _this$getMenuItem2[1];
|
|
158
|
+
return menuItemRender && menuItemRender({
|
|
159
|
+
item: item,
|
|
160
|
+
title: title,
|
|
161
|
+
icon: icon
|
|
162
|
+
}) || _createVNode(Menu.Item, {
|
|
163
|
+
"disabled": (_item$meta7 = item.meta) === null || _item$meta7 === void 0 ? void 0 : _item$meta7.disabled,
|
|
164
|
+
"danger": (_item$meta8 = item.meta) === null || _item$meta8 === void 0 ? void 0 : _item$meta8.danger,
|
|
165
|
+
"key": item.path
|
|
166
|
+
}, {
|
|
167
|
+
default: function _default() {
|
|
168
|
+
return [title];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
_defineProperty(this, "getMenuItem", function (item) {
|
|
173
|
+
var _item$meta9, _item$meta10, _item$meta11, _item$meta12, _item$meta13;
|
|
174
|
+
var meta = _objectSpread({}, item.meta);
|
|
175
|
+
var target = meta.target || null;
|
|
176
|
+
var hasUrl = regular.isUrl(item.path);
|
|
177
|
+
var CustomTag = target && 'a' || _this.RouterLink;
|
|
178
|
+
var props = {
|
|
179
|
+
to: _objectSpread({
|
|
180
|
+
name: item.name
|
|
181
|
+
}, item.meta)
|
|
182
|
+
};
|
|
183
|
+
var attrs = hasUrl || target ? _objectSpread(_objectSpread({}, item.meta), {}, {
|
|
184
|
+
href: item.path,
|
|
185
|
+
target: target
|
|
186
|
+
}) : {};
|
|
187
|
+
var _this$props2 = _this.props,
|
|
188
|
+
prefixCls = _this$props2.prefixCls,
|
|
189
|
+
locale = _this$props2.locale;
|
|
190
|
+
var icon = ((_item$meta9 = item.meta) === null || _item$meta9 === void 0 ? void 0 : _item$meta9.icon) && _createVNode(LazyIcon, {
|
|
191
|
+
"iconUrl": _this.props.iconfontUrl,
|
|
192
|
+
"icon": (_item$meta10 = item.meta) === null || _item$meta10 === void 0 ? void 0 : _item$meta10.icon
|
|
193
|
+
}, null) || undefined;
|
|
194
|
+
var menuTitle = locale && locale((_item$meta11 = item.meta) === null || _item$meta11 === void 0 ? void 0 : _item$meta11.title) || ((_item$meta12 = item.meta) === null || _item$meta12 === void 0 ? void 0 : _item$meta12.title);
|
|
195
|
+
var defaultTitle = (_item$meta13 = item.meta) !== null && _item$meta13 !== void 0 && _item$meta13.icon ? _createVNode(CustomTag, _objectSpread(_objectSpread(_objectSpread({}, attrs), props), {}, {
|
|
196
|
+
"class": "".concat(prefixCls, "-menu-item")
|
|
197
|
+
}), {
|
|
198
|
+
default: function _default() {
|
|
199
|
+
return [icon, _createVNode("span", {
|
|
200
|
+
"class": "".concat(prefixCls, "-menu-item-title")
|
|
201
|
+
}, [menuTitle])];
|
|
202
|
+
}
|
|
203
|
+
}) : _createVNode(CustomTag, _objectSpread(_objectSpread(_objectSpread({}, attrs), props), {}, {
|
|
204
|
+
"class": "".concat(prefixCls, "-menu-item")
|
|
205
|
+
}), {
|
|
206
|
+
default: function _default() {
|
|
207
|
+
return [_createVNode("span", null, [menuTitle])];
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return [defaultTitle, icon];
|
|
211
|
+
});
|
|
212
|
+
this.props = _props;
|
|
213
|
+
this.ctx = ctx;
|
|
214
|
+
this.RouterLink = resolveComponent('router-link');
|
|
215
|
+
});
|
|
216
|
+
export default defineComponent({
|
|
217
|
+
name: 'BaseMenu',
|
|
218
|
+
props: baseMenuProps,
|
|
219
|
+
emits: ['update:openKeys', 'update:selectedKeys', 'click'],
|
|
220
|
+
setup: function setup(props, _ref) {
|
|
221
|
+
var emit = _ref.emit;
|
|
222
|
+
var ctx = getCurrentInstance();
|
|
223
|
+
var menuUtil = new MenuUtil(props, ctx);
|
|
224
|
+
watchEffect(function () {
|
|
225
|
+
if (props.iconfontUrl) {
|
|
226
|
+
AntdIconFont = createFromIconfontCN({
|
|
227
|
+
scriptUrl: props.iconfontUrl
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
var handleOpenChange = function handleOpenChange(openKeys) {
|
|
232
|
+
emit('update:openKeys', openKeys);
|
|
233
|
+
};
|
|
234
|
+
var handleSelect = function handleSelect(args) {
|
|
235
|
+
// ignore https? link handle selectkeys
|
|
236
|
+
if (regular.isUrl(args.key)) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
emit('update:selectedKeys', args.selectedKeys);
|
|
240
|
+
};
|
|
241
|
+
var handleClick = function handleClick(args) {
|
|
242
|
+
emit('click', args);
|
|
243
|
+
};
|
|
244
|
+
return function () {
|
|
245
|
+
return _createVNode(Menu, _objectSpread({
|
|
246
|
+
"key": "Menu",
|
|
247
|
+
"inlineIndent": 16,
|
|
248
|
+
"mode": props.mode,
|
|
249
|
+
"theme": props.theme,
|
|
250
|
+
"openKeys": props.openKeys === false ? [] : props.openKeys,
|
|
251
|
+
"selectedKeys": props.selectedKeys || [],
|
|
252
|
+
"onOpenChange": handleOpenChange,
|
|
253
|
+
"onSelect": handleSelect,
|
|
254
|
+
"onClick": handleClick
|
|
255
|
+
}, props.menuProps), {
|
|
256
|
+
default: function _default() {
|
|
257
|
+
return [menuUtil.getNavMenuItems(props.menuData)];
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|