@jetlinks-web/components 2.0.2 → 2.0.3
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 +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 +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 +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/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 +0 -2
- package/es/style.js +3 -0
- 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 +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 +1 -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 +5 -0
- package/package.json +122 -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
- /package/{src → es}/ProTable/style/index.less +0 -0
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { computed, ref } from 'vue';
|
|
2
|
-
import type { RouteRecordRaw } from 'vue-router';
|
|
3
|
-
import { default as ResizeObserver } from 'ant-design-vue/es/vc-resize-observer';
|
|
4
|
-
import type { VueNode } from 'ant-design-vue/es/_util/type';
|
|
5
|
-
import type { SiderMenuProps } from '../SiderMenu/SiderMenu';
|
|
6
|
-
import {
|
|
7
|
-
defaultRenderLogoAndTitle,
|
|
8
|
-
siderMenuProps,
|
|
9
|
-
} from '../SiderMenu/SiderMenu';
|
|
10
|
-
import PropTypes from 'ant-design-vue/es/_util/vue-types';
|
|
11
|
-
import type {
|
|
12
|
-
MenuDataItem,
|
|
13
|
-
ProProps,
|
|
14
|
-
RightContentRender,
|
|
15
|
-
WithFalse,
|
|
16
|
-
Theme,
|
|
17
|
-
} from '../typings';
|
|
18
|
-
import { defaultSettingProps } from '../defaultSettings';
|
|
19
|
-
import type { PropType, FunctionalComponent, ExtractPropTypes } from 'vue';
|
|
20
|
-
import { defaultPrefixCls, useRouteContext } from '../RouteContext';
|
|
21
|
-
import BaseMenu from '../SiderMenu/BaseMenu';
|
|
22
|
-
import { clearMenuItem } from '../util';
|
|
23
|
-
|
|
24
|
-
export const baseHeaderProps = {
|
|
25
|
-
...defaultSettingProps,
|
|
26
|
-
prefixCls: PropTypes.string.def('ant-pro'),
|
|
27
|
-
collapsed: PropTypes.looseBool,
|
|
28
|
-
logo: siderMenuProps.logo,
|
|
29
|
-
logoStyle: siderMenuProps.logoStyle,
|
|
30
|
-
headerTheme: {
|
|
31
|
-
type: String as PropType<Theme>,
|
|
32
|
-
default: 'dark',
|
|
33
|
-
},
|
|
34
|
-
menuData: {
|
|
35
|
-
type: Array as PropType<MenuDataItem[]>,
|
|
36
|
-
default: () => [],
|
|
37
|
-
},
|
|
38
|
-
splitMenus: siderMenuProps.splitMenus,
|
|
39
|
-
menuRender: {
|
|
40
|
-
type: [Object, Function] as PropType<
|
|
41
|
-
WithFalse<
|
|
42
|
-
(
|
|
43
|
-
props: ProProps /* HeaderViewProps */,
|
|
44
|
-
defaultDom: VueNode,
|
|
45
|
-
) => VueNode
|
|
46
|
-
>
|
|
47
|
-
>,
|
|
48
|
-
default: () => undefined,
|
|
49
|
-
},
|
|
50
|
-
menuHeaderRender: siderMenuProps.menuHeaderRender,
|
|
51
|
-
menuItemRender: siderMenuProps.menuItemRender,
|
|
52
|
-
subMenuItemRender: siderMenuProps.subMenuItemRender,
|
|
53
|
-
rightContentRender: {
|
|
54
|
-
type: [Object, Function] as PropType<RightContentRender>,
|
|
55
|
-
default: () => undefined,
|
|
56
|
-
},
|
|
57
|
-
collapsedButtonRender: siderMenuProps.collapsedButtonRender,
|
|
58
|
-
matchMenuKeys: siderMenuProps.matchMenuKeys,
|
|
59
|
-
|
|
60
|
-
// events
|
|
61
|
-
onMenuHeaderClick: PropTypes.func,
|
|
62
|
-
onCollapse: siderMenuProps.onCollapse,
|
|
63
|
-
onOpenKeys: siderMenuProps.onOpenKeys,
|
|
64
|
-
onSelect: siderMenuProps.onSelect,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export type BaseHeaderPropsType = ExtractPropTypes<typeof baseHeaderProps>;
|
|
68
|
-
|
|
69
|
-
export const topNavHeaderProps = { ...siderMenuProps, ...baseHeaderProps };
|
|
70
|
-
|
|
71
|
-
export type TopNavHeaderProps = Partial<
|
|
72
|
-
ExtractPropTypes<typeof topNavHeaderProps>
|
|
73
|
-
> &
|
|
74
|
-
Partial<SiderMenuProps>;
|
|
75
|
-
|
|
76
|
-
const RightContent: FunctionalComponent<TopNavHeaderProps> = ({
|
|
77
|
-
rightContentRender,
|
|
78
|
-
...props
|
|
79
|
-
}) => {
|
|
80
|
-
const rightSize = ref<number | string>('auto');
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<div
|
|
84
|
-
style={{
|
|
85
|
-
minWidth: rightSize.value,
|
|
86
|
-
}}
|
|
87
|
-
>
|
|
88
|
-
<div
|
|
89
|
-
style={{
|
|
90
|
-
paddingRight: 8,
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
93
|
-
<ResizeObserver
|
|
94
|
-
onResize={({ width }: { width: number }) => {
|
|
95
|
-
rightSize.value = width;
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
{rightContentRender &&
|
|
99
|
-
typeof rightContentRender === 'function' ? (
|
|
100
|
-
<div>
|
|
101
|
-
{rightContentRender({
|
|
102
|
-
...props,
|
|
103
|
-
})}
|
|
104
|
-
</div>
|
|
105
|
-
) : (
|
|
106
|
-
rightContentRender
|
|
107
|
-
)}
|
|
108
|
-
</ResizeObserver>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const TopNavHeader: FunctionalComponent<TopNavHeaderProps> = (props) => {
|
|
115
|
-
const headerRef = ref();
|
|
116
|
-
const {
|
|
117
|
-
prefixCls: propPrefixCls,
|
|
118
|
-
onMenuHeaderClick,
|
|
119
|
-
onOpenKeys,
|
|
120
|
-
onSelect,
|
|
121
|
-
contentWidth,
|
|
122
|
-
rightContentRender,
|
|
123
|
-
layout,
|
|
124
|
-
menuData,
|
|
125
|
-
mode,
|
|
126
|
-
} = props;
|
|
127
|
-
const context = useRouteContext();
|
|
128
|
-
const prefixCls = `${propPrefixCls || defaultPrefixCls}-top-nav-header`;
|
|
129
|
-
const headerDom = defaultRenderLogoAndTitle(
|
|
130
|
-
{ ...props, collapsed: false } as SiderMenuProps,
|
|
131
|
-
// REMARK:: Any time render header title
|
|
132
|
-
// layout === 'mix' ? 'headerTitleRender' : undefined,
|
|
133
|
-
// layout !== 'side' ? 'headerTitleRender' : undefined,
|
|
134
|
-
'headerTitleRender',
|
|
135
|
-
);
|
|
136
|
-
//
|
|
137
|
-
let MenusData = props.layout === 'side' ? [] : menuData;
|
|
138
|
-
if (props.layout === 'mix' && props.splitMenus) {
|
|
139
|
-
const noChildrenMenuData = (menuData || []).map((item) => ({
|
|
140
|
-
...item,
|
|
141
|
-
children: undefined,
|
|
142
|
-
component: undefined,
|
|
143
|
-
})) as RouteRecordRaw[];
|
|
144
|
-
MenusData = clearMenuItem(noChildrenMenuData);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const _mode = computed(() =>
|
|
148
|
-
props.layout === 'mix' && props.splitMenus ? 'horizontal' : mode,
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
const className = computed(() => {
|
|
152
|
-
return {
|
|
153
|
-
[prefixCls]: true,
|
|
154
|
-
light: props.theme === 'light',
|
|
155
|
-
dark: props.theme === 'dark',
|
|
156
|
-
};
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
<div class={className.value}>
|
|
161
|
-
<div
|
|
162
|
-
ref={headerRef}
|
|
163
|
-
class={`${prefixCls}-main ${
|
|
164
|
-
contentWidth === 'Fixed' ? 'wide' : ''
|
|
165
|
-
}`}
|
|
166
|
-
>
|
|
167
|
-
{headerDom && (
|
|
168
|
-
<div
|
|
169
|
-
class={`${prefixCls}-main-left`}
|
|
170
|
-
onClick={onMenuHeaderClick}
|
|
171
|
-
>
|
|
172
|
-
<div class={`${prefixCls}-logo`} key="logo" id="logo">
|
|
173
|
-
{headerDom}
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
)}
|
|
177
|
-
<div style={{ flex: 1 }} class={`${prefixCls}-menu`}>
|
|
178
|
-
<BaseMenu
|
|
179
|
-
prefixCls={propPrefixCls}
|
|
180
|
-
locale={props.locale || context.locale}
|
|
181
|
-
theme={props.theme}
|
|
182
|
-
mode={_mode.value}
|
|
183
|
-
collapsed={props.collapsed}
|
|
184
|
-
iconfontUrl={props.iconfontUrl}
|
|
185
|
-
menuData={MenusData}
|
|
186
|
-
menuItemRender={props.menuItemRender}
|
|
187
|
-
subMenuItemRender={props.subMenuItemRender}
|
|
188
|
-
openKeys={context.openKeys}
|
|
189
|
-
selectedKeys={context.selectedKeys}
|
|
190
|
-
class={{
|
|
191
|
-
'top-nav-menu': props.mode === 'horizontal',
|
|
192
|
-
}}
|
|
193
|
-
{...{
|
|
194
|
-
'onUpdate:openKeys': ($event: string[]) =>
|
|
195
|
-
onOpenKeys && onOpenKeys($event),
|
|
196
|
-
'onUpdate:selectedKeys': ($event: string[]) =>
|
|
197
|
-
onSelect && onSelect($event),
|
|
198
|
-
}}
|
|
199
|
-
/>
|
|
200
|
-
</div>
|
|
201
|
-
{rightContentRender && (
|
|
202
|
-
<RightContent
|
|
203
|
-
rightContentRender={rightContentRender}
|
|
204
|
-
{...props}
|
|
205
|
-
/>
|
|
206
|
-
)}
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
);
|
|
210
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { Theme, ContentWidth } from './typings';
|
|
3
|
-
|
|
4
|
-
export interface RenderSetting {
|
|
5
|
-
headerRender?: false;
|
|
6
|
-
menuRender?: false;
|
|
7
|
-
menuHeaderRender?: false;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface DefaultSettingProps {
|
|
11
|
-
theme?: Theme;
|
|
12
|
-
/**
|
|
13
|
-
* 自定义页眉高度
|
|
14
|
-
*/
|
|
15
|
-
headerHeight?: number;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
layout: 'side' | 'top' | 'mix';
|
|
20
|
-
|
|
21
|
-
contentWidth: ContentWidth;
|
|
22
|
-
/**
|
|
23
|
-
* sticky header
|
|
24
|
-
*/
|
|
25
|
-
fixedHeader: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* sticky siderbar
|
|
28
|
-
*/
|
|
29
|
-
fixSiderbar: boolean;
|
|
30
|
-
menu: { locale?: boolean; defaultOpenAll?: boolean };
|
|
31
|
-
title: string;
|
|
32
|
-
// Your custom iconfont Symbol script Url
|
|
33
|
-
// eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
|
|
34
|
-
// 注意:如果需要图标多色,Iconfont 图标项目里要进行批量去色处理
|
|
35
|
-
// Usage: https://github.com/ant-design/ant-design-pro/pull/3517
|
|
36
|
-
iconfontUrl: string;
|
|
37
|
-
primaryColor: string;
|
|
38
|
-
colorWeak?: boolean;
|
|
39
|
-
splitMenus?: boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type ProSettings = DefaultSettingProps & RenderSetting;
|
|
43
|
-
|
|
44
|
-
export const defaultSettings = {
|
|
45
|
-
theme: 'light',
|
|
46
|
-
layout: 'mix',
|
|
47
|
-
contentWidth: 'Fluid',
|
|
48
|
-
fixedHeader: true,
|
|
49
|
-
fixSiderbar: true,
|
|
50
|
-
menu: {
|
|
51
|
-
locale: true,
|
|
52
|
-
},
|
|
53
|
-
headerHeight: 48,
|
|
54
|
-
title: 'Jetlink UI Components',
|
|
55
|
-
iconfontUrl: '',
|
|
56
|
-
primaryColor: '#315EFB',
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const defaultSettingProps = {
|
|
60
|
-
theme: {
|
|
61
|
-
type: String as PropType<DefaultSettingProps['theme']>,
|
|
62
|
-
default: defaultSettings.theme,
|
|
63
|
-
},
|
|
64
|
-
layout: {
|
|
65
|
-
type: String as PropType<DefaultSettingProps['layout']>,
|
|
66
|
-
default: defaultSettings.layout,
|
|
67
|
-
},
|
|
68
|
-
contentWidth: {
|
|
69
|
-
type: String as PropType<DefaultSettingProps['contentWidth']>,
|
|
70
|
-
default: defaultSettings.contentWidth,
|
|
71
|
-
},
|
|
72
|
-
fixedHeader: {
|
|
73
|
-
type: Boolean as PropType<DefaultSettingProps['fixedHeader']>,
|
|
74
|
-
default: defaultSettings.fixedHeader,
|
|
75
|
-
},
|
|
76
|
-
fixSiderbar: {
|
|
77
|
-
type: Boolean as PropType<DefaultSettingProps['fixSiderbar']>,
|
|
78
|
-
default: defaultSettings.fixSiderbar,
|
|
79
|
-
},
|
|
80
|
-
menu: {
|
|
81
|
-
type: Object as PropType<DefaultSettingProps['menu']>,
|
|
82
|
-
default: () => {
|
|
83
|
-
return {
|
|
84
|
-
locale: true,
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
headerHeight: {
|
|
89
|
-
type: Number as PropType<DefaultSettingProps['headerHeight']>,
|
|
90
|
-
default: defaultSettings.headerHeight,
|
|
91
|
-
},
|
|
92
|
-
title: {
|
|
93
|
-
type: String as PropType<DefaultSettingProps['title']>,
|
|
94
|
-
default: () => defaultSettings.title,
|
|
95
|
-
},
|
|
96
|
-
iconfontUrl: {
|
|
97
|
-
type: String as PropType<DefaultSettingProps['iconfontUrl']>,
|
|
98
|
-
default: () => defaultSettings.iconfontUrl,
|
|
99
|
-
},
|
|
100
|
-
primaryColor: {
|
|
101
|
-
type: String as PropType<DefaultSettingProps['primaryColor']>,
|
|
102
|
-
default: () => defaultSettings.primaryColor,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export type ProSettingsProps = ExtractPropTypes<typeof defaultSettingProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './style.less';
|
package/src/ProLayout/typings.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { VNode } from 'vue';
|
|
2
|
-
import type { BreadcrumbProps } from './RouteContext';
|
|
3
|
-
import type { VueNode } from 'ant-design-vue/es/_util/type';
|
|
4
|
-
|
|
5
|
-
export type Theme = 'dark' | 'light';
|
|
6
|
-
export type LayoutType = 'side' | 'top' | 'mix';
|
|
7
|
-
export type TargetType = '_blank' | '_self' | unknown;
|
|
8
|
-
export type ProProps = Record<never, never>;
|
|
9
|
-
export type ContentWidth = 'Fluid' | 'Fixed';
|
|
10
|
-
|
|
11
|
-
export interface MetaRecord {
|
|
12
|
-
/**
|
|
13
|
-
* @name 菜单的icon
|
|
14
|
-
*/
|
|
15
|
-
icon?: string | VNode;
|
|
16
|
-
/**
|
|
17
|
-
* @name 自定义菜单的国际化 key,如果没有则返回自身
|
|
18
|
-
*/
|
|
19
|
-
title?: string;
|
|
20
|
-
/**
|
|
21
|
-
* @name 打开目标位置 '_blank' | '_self' | null | undefined
|
|
22
|
-
*/
|
|
23
|
-
target?: TargetType;
|
|
24
|
-
/**
|
|
25
|
-
* @name 在菜单中隐藏子节点
|
|
26
|
-
*/
|
|
27
|
-
hideChildInMenu?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @name 在菜单中隐藏自己和子节点
|
|
30
|
-
*/
|
|
31
|
-
hideInMenu?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* @name disable 菜单选项
|
|
34
|
-
*/
|
|
35
|
-
disabled?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* @name 隐藏自己,并且将子节点提升到与自己平级
|
|
38
|
-
*/
|
|
39
|
-
flatMenu?: boolean;
|
|
40
|
-
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface MenuDataItem {
|
|
46
|
-
/**
|
|
47
|
-
* @name 用于标定选中的值,默认是 path
|
|
48
|
-
*/
|
|
49
|
-
path: string;
|
|
50
|
-
name?: string | symbol;
|
|
51
|
-
meta?: MetaRecord;
|
|
52
|
-
/**
|
|
53
|
-
* @name 子菜单
|
|
54
|
-
*/
|
|
55
|
-
children?: MenuDataItem[];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export type WithFalse<T> = T | false;
|
|
59
|
-
|
|
60
|
-
export type FormatMessage = (message?: string) => string;
|
|
61
|
-
|
|
62
|
-
export type BreadcrumbRender = BreadcrumbProps['itemRender'];
|
|
63
|
-
export type HeaderContentRender = WithFalse<() => VueNode>;
|
|
64
|
-
export type HeaderRender = WithFalse<(props: ProProps) => VueNode>;
|
|
65
|
-
export type RightContentRender = WithFalse<(props: ProProps) => VueNode>;
|
|
66
|
-
export type MenuItemRender = WithFalse<
|
|
67
|
-
(args: {
|
|
68
|
-
item: MenuDataItem;
|
|
69
|
-
title?: JSX.Element;
|
|
70
|
-
icon?: JSX.Element;
|
|
71
|
-
}) => VueNode
|
|
72
|
-
>;
|
|
73
|
-
export type SubMenuItemRender = WithFalse<
|
|
74
|
-
(args: { item: MenuDataItem; children?: VueNode[] }) => VueNode
|
|
75
|
-
>;
|
|
76
|
-
export type MenuHeaderRender = WithFalse<
|
|
77
|
-
(logo: VueNode, title: VueNode, props?: ProProps) => VueNode
|
|
78
|
-
>;
|
|
79
|
-
export type MenuContentRender = WithFalse<
|
|
80
|
-
(props: ProProps, defaultDom: VueNode) => VueNode
|
|
81
|
-
>;
|
|
82
|
-
export type MenuExtraRender = WithFalse<(props?: ProProps) => VueNode>;
|
|
83
|
-
export type LogoRender = WithFalse<VueNode>;
|
|
84
|
-
|
|
85
|
-
export type CollapsedButtonRender = WithFalse<(collapsed?: boolean) => VueNode>;
|
|
86
|
-
export type DefaultPropRender = WithFalse<VueNode>;
|
|
87
|
-
export type PageHeaderRender = WithFalse<(props?: ProProps) => VueNode>;
|
package/src/ProLayout/util.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { RouteRecord, RouteRecordRaw } from "vue-router";
|
|
2
|
-
import type { MenuDataItem } from "./typings";
|
|
3
|
-
import type { Slots } from "vue"
|
|
4
|
-
|
|
5
|
-
export function clearMenuItem(menusData: RouteRecord[] | RouteRecordRaw[]): RouteRecordRaw[] {
|
|
6
|
-
return menusData
|
|
7
|
-
.map((item: RouteRecord | RouteRecordRaw) => {
|
|
8
|
-
const finalItem = {...item};
|
|
9
|
-
if (finalItem.meta?.hideInMenu) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (finalItem && finalItem?.children) {
|
|
14
|
-
if (
|
|
15
|
-
!finalItem.meta?.hideChildInMenu &&
|
|
16
|
-
finalItem.children.some(
|
|
17
|
-
(child: RouteRecord | RouteRecordRaw) => child && child.name && !child.meta?.hideInMenu
|
|
18
|
-
)
|
|
19
|
-
) {
|
|
20
|
-
return {
|
|
21
|
-
...item,
|
|
22
|
-
children: clearMenuItem(finalItem.children),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
delete finalItem.children;
|
|
26
|
-
}
|
|
27
|
-
return finalItem;
|
|
28
|
-
})
|
|
29
|
-
.filter((item) => item) as RouteRecordRaw[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function flatMap(menusData: RouteRecord[]): MenuDataItem[] {
|
|
33
|
-
return menusData
|
|
34
|
-
.map((item) => {
|
|
35
|
-
const finalItem = {...item} as MenuDataItem;
|
|
36
|
-
if (!finalItem.name || finalItem.meta?.hideInMenu) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
if (finalItem.children) {
|
|
40
|
-
delete finalItem.children;
|
|
41
|
-
}
|
|
42
|
-
return finalItem;
|
|
43
|
-
})
|
|
44
|
-
.filter((item) => item) as MenuDataItem[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function getMenuFirstChildren(menus: MenuDataItem[], key?: string) {
|
|
48
|
-
return key === undefined ? [] : (menus[menus.findIndex((menu) => menu.path === key)] || {}).children || [];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function getSlot<T>(slots: Slots, props: Record<string, unknown>, prop = 'default'): T | false {
|
|
52
|
-
if (props[prop] === false) {
|
|
53
|
-
// force not render
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
return (props[prop] || slots[prop]) as T;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function getSlotVNode<T>(slots: Slots, props: Record<string, unknown>, prop = 'default'): T | false {
|
|
60
|
-
if (props[prop] === false) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
return (props[prop] || slots[prop]?.()) as T;
|
|
64
|
-
}
|
package/src/ProTable/index.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
category: Components
|
|
3
|
-
subtitle: 表格
|
|
4
|
-
cols: 1
|
|
5
|
-
type: 高阶组件
|
|
6
|
-
title: ProTable
|
|
7
|
-
# cover: https://gw.alipayobjects.com/zos/alicdn/1vqv2bj68/Pagination.svg
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## API
|
|
11
|
-
|
|
12
|
-
```html
|
|
13
|
-
<j-pro-table />
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### Table
|
|
17
|
-
|
|
18
|
-
该属性参考 ant-design-vue 的 [Table](https://www.antdv.com/components/table-cn#Table)
|
|
19
|
-
|
|
20
|
-
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
21
|
-
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ------ | ---- |
|
|
22
|
-
| request | 请求数据的 api | promise | - | |
|
|
23
|
-
| loading | 控制loading | boolean | undefined | |
|
|
24
|
-
| columns | 表格列的配置描述 | array | - | |
|
|
25
|
-
| params | 搜索参数 | object | {} | |
|
|
26
|
-
| type | 表格的类型 | `TREE`\| `PAGE` | 'PAGE' | |
|
|
27
|
-
| noPagination | 是否显示分页 | boolean | trues | |
|
|
28
|
-
| rowSelection | 列表项是否可选择 | object | - | |
|
|
29
|
-
| dataSource | 数据数组 | object\[] | | |
|
|
30
|
-
| gridColumns | 用于不同分辨率下展示的卡片数量的展示,gridColumns\[0] 1366 ~ 1440 分辨率,gridColumns\[1] 1440 ~ 1600 分辨率, gridColumns\[2] > 1600 分辨率 | number[] | - | |
|
|
31
|
-
| gridColumn | 每行展示的卡片数量 | number | - | |
|
|
32
|
-
| alertRender | 是否展示上方选择提示框 | boolean | true | |
|
|
33
|
-
| defaultParams | 默认参数 | object | {} | |
|
|
34
|
-
| bodyStyle | 内容区域自定义样式 | object | - | |
|
|
35
|
-
| card | 卡片插槽 | slot | - | |
|
|
36
|
-
| headerTitle | type 为`PAGE`和`TREE`时顶部左边插槽 | slot | - | |
|
|
37
|
-
| rightExtraRender | type 为`PAGE`和`TREE`时顶部右边插槽 | slot | - | |
|
|
38
|
-
| paginationRender | 分页插槽 | slot | - | |
|
|
39
|
-
|
|
40
|
-
### Column
|
|
41
|
-
|
|
42
|
-
该属性参考 ant-design-vue 的 [Column](https://www.antdv.com/components/table-cn#Column).
|
|
43
|
-
|
|
44
|
-
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
45
|
-
| ----------- | ---------------- | ------- | ------ | ---- |
|
|
46
|
-
| scopedSlots | 是否为插槽 | boolean | false | |
|
|
47
|
-
| hideInTable | 是否在表格中隐藏 | boolean | - | |
|
|
48
|
-
|
|
49
|
-
### 事件
|
|
50
|
-
|
|
51
|
-
| 事件名称 | 说明 | 回调参数 | 版本 | |
|
|
52
|
-
| ------------ | -------- | ---------- | ---- | --- |
|
|
53
|
-
| cancelSelect | 取消选择 | () => void | - | |
|