@meethive/components 0.0.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/AutoComplete/AutoComplete.js +84 -0
- package/es/AutoComplete/index.js +7 -0
- package/es/BadgeStatus/Badge.js +51 -0
- package/es/BadgeStatus/color.js +14 -0
- package/es/BadgeStatus/index.js +8 -0
- package/es/CardSelect/CardSelect.js +141 -0
- package/es/CardSelect/index.js +7 -0
- package/es/CardSelect/style/index.js +29 -0
- package/es/CheckButton/CheckButton.js +122 -0
- package/es/CheckButton/index.js +7 -0
- package/es/CheckButton/style/index.js +44 -0
- package/es/ConfigProvider/ConfigProvider.js +73 -0
- package/es/ConfigProvider/context.js +26 -0
- package/es/ConfigProvider/index.js +9 -0
- package/es/DragModal/DragModal.js +212 -0
- package/es/DragModal/index.js +7 -0
- package/es/DragModal/style/index.js +86 -0
- package/es/EditTable/Body.js +189 -0
- package/es/EditTable/CellRender.js +12 -0
- package/es/EditTable/EditTable.js +434 -0
- package/es/EditTable/FormItem.js +169 -0
- package/es/EditTable/Group.js +204 -0
- package/es/EditTable/Header.js +63 -0
- package/es/EditTable/HeaderRender.js +12 -0
- package/es/EditTable/components/ContextMenu/Menu.js +86 -0
- package/es/EditTable/components/ContextMenu/index.js +96 -0
- package/es/EditTable/components/Search/Search.js +163 -0
- package/es/EditTable/components/Search/Sort.js +119 -0
- package/es/EditTable/components/Search/index.js +2 -0
- package/es/EditTable/consts.js +13 -0
- package/es/EditTable/context.js +88 -0
- package/es/EditTable/hooks/index.js +19 -0
- package/es/EditTable/hooks/useGroup.js +48 -0
- package/es/EditTable/hooks/useResizeObserver.js +27 -0
- package/es/EditTable/hooks/useValidate.js +112 -0
- package/es/EditTable/index.js +25 -0
- package/es/EditTable/props.js +60 -0
- package/es/EditTable/style/body.js +63 -0
- package/es/EditTable/style/form.js +33 -0
- package/es/EditTable/style/group.js +33 -0
- package/es/EditTable/style/header.js +72 -0
- package/es/EditTable/style/index.js +52 -0
- package/es/EditTable/style/menu.js +27 -0
- package/es/EditTable/style/table.js +46 -0
- package/es/EditTable/utils.js +110 -0
- package/es/Ellipsis/Ellipsis.js +148 -0
- package/es/Ellipsis/index.js +7 -0
- package/es/Ellipsis/style/index.js +26 -0
- package/es/Empty/Empty.js +63 -0
- package/es/Empty/image.js +3 -0
- package/es/Empty/index.js +7 -0
- package/es/FullPage/FullPage.js +19 -0
- package/es/FullPage/index.js +7 -0
- package/es/Icon/Icon.js +49 -0
- package/es/Icon/index.js +7 -0
- package/es/LocaleProvider/LocaleProvider.js +31 -0
- package/es/LocaleProvider/index.js +7 -0
- package/es/LocaleReciver/index.js +24 -0
- package/es/Markdown/Markdown.js +118 -0
- package/es/Markdown/index.js +7 -0
- package/es/PermissionButton/PermissionButton.js +118 -0
- package/es/PermissionButton/confirm.js +94 -0
- package/es/PermissionButton/index.js +9 -0
- package/es/PermissionButton/shared.js +1 -0
- package/es/ProLayout/Basic/BasicLayout.js +422 -0
- package/es/ProLayout/Basic/BasicLayoutStyle.js +51 -0
- package/es/ProLayout/Basic/Header.js +111 -0
- package/es/ProLayout/Basic/HeaderStyle.js +10 -0
- package/es/ProLayout/PageContainer/index.js +354 -0
- package/es/ProLayout/PageContainer/style.js +85 -0
- package/es/ProLayout/RouteContext.js +28 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +241 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +274 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/style.js +204 -0
- package/es/ProLayout/TopHeader/index.js +170 -0
- package/es/ProLayout/TopHeader/style.js +154 -0
- package/es/ProLayout/defaultSettings.js +113 -0
- package/es/ProLayout/index.js +10 -0
- package/es/ProLayout/style/index.js +14 -0
- package/es/ProLayout/util.js +58 -0
- package/es/ProTable/Alert.js +40 -0
- package/es/ProTable/Content.js +97 -0
- package/es/ProTable/Header.js +33 -0
- package/es/ProTable/Pagination.js +55 -0
- package/es/ProTable/ProTable.js +279 -0
- package/es/ProTable/hooks/index.js +2 -0
- package/es/ProTable/hooks/useTableInject.js +6 -0
- package/es/ProTable/hooks/useTableSelection.js +115 -0
- package/es/ProTable/index.js +8 -0
- package/es/ProTable/setting.js +138 -0
- package/es/ProTable/style/index.js +113 -0
- package/es/RadioButton/RadioButton.js +53 -0
- package/es/RadioButton/index.js +8 -0
- package/es/RadioButton/style/index.js +25 -0
- package/es/Scrollbar/Bar.js +76 -0
- package/es/Scrollbar/Scrollbar.js +161 -0
- package/es/Scrollbar/Thumb.js +150 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +7 -0
- package/es/Scrollbar/scrollbarProps.js +100 -0
- package/es/Scrollbar/style/index.js +85 -0
- package/es/Scrollbar/thumbProps.js +10 -0
- package/es/Scrollbar/util.js +39 -0
- package/es/Search/Item.js +239 -0
- package/es/Search/Search.js +90 -0
- package/es/Search/hooks/index.js +117 -0
- package/es/Search/hooks/useRouteQuery.js +86 -0
- package/es/Search/hooks/useSearchItems.js +50 -0
- package/es/Search/hooks/useTermOptions.js +29 -0
- package/es/Search/index.js +10 -0
- package/es/Search/setting.js +245 -0
- package/es/Search/style/index.js +5 -0
- package/es/Search/style/item.js +40 -0
- package/es/Search/style/search.js +177 -0
- package/es/Search/util.js +270 -0
- package/es/Skeleton/Skeleton.js +27 -0
- package/es/Skeleton/components/DashBoardCard.js +27 -0
- package/es/Skeleton/components/DashBoardChart.js +27 -0
- package/es/Skeleton/components/Detail.js +27 -0
- package/es/Skeleton/components/Drawer.js +27 -0
- package/es/Skeleton/components/Item.js +54 -0
- package/es/Skeleton/components/List.js +27 -0
- package/es/Skeleton/components/ListCard.js +28 -0
- package/es/Skeleton/components/ListCardItem.js +20 -0
- package/es/Skeleton/components/ListTable.js +27 -0
- package/es/Skeleton/components/Page.js +26 -0
- package/es/Skeleton/components/Search.js +16 -0
- package/es/Skeleton/components/Tree.js +27 -0
- package/es/Skeleton/index.js +28 -0
- package/es/Skeleton/style/index.js +195 -0
- package/es/TimeFormat/TimeFormat.js +36 -0
- package/es/TimeFormat/index.js +7 -0
- package/es/Title/Title.js +26 -0
- package/es/Title/index.js +7 -0
- package/es/Title/style/index.js +34 -0
- package/es/ValueItem/ValueItem.js +113 -0
- package/es/ValueItem/index.js +7 -0
- package/es/ValueItem/util.js +17 -0
- package/es/VirtualTable/VirtualTable.js +271 -0
- package/es/VirtualTable/data.js +60 -0
- package/es/VirtualTable/index.js +7 -0
- package/es/VirtualTable/style/index.js +34 -0
- package/es/components.js +21 -0
- package/es/index.js +17 -0
- package/es/locale/en-US.js +120 -0
- package/es/locale/zh-CN.js +120 -0
- package/es/style/styleRegister.js +19 -0
- package/es/style/variable.js +4 -0
- package/es/style.js +1 -0
- package/es/utils/constants.js +10 -0
- package/lib/AutoComplete/AutoComplete.js +84 -0
- package/lib/AutoComplete/index.js +7 -0
- package/lib/BadgeStatus/Badge.js +51 -0
- package/lib/BadgeStatus/color.js +14 -0
- package/lib/BadgeStatus/index.js +8 -0
- package/lib/CardSelect/CardSelect.js +141 -0
- package/lib/CardSelect/index.js +7 -0
- package/lib/CardSelect/style/index.js +29 -0
- package/lib/CheckButton/CheckButton.js +122 -0
- package/lib/CheckButton/index.js +7 -0
- package/lib/CheckButton/style/index.js +44 -0
- package/lib/ConfigProvider/ConfigProvider.js +73 -0
- package/lib/ConfigProvider/context.js +26 -0
- package/lib/ConfigProvider/index.js +9 -0
- package/lib/DragModal/DragModal.js +212 -0
- package/lib/DragModal/index.js +7 -0
- package/lib/DragModal/style/index.js +86 -0
- package/lib/EditTable/Body.js +189 -0
- package/lib/EditTable/CellRender.js +12 -0
- package/lib/EditTable/EditTable.js +434 -0
- package/lib/EditTable/FormItem.js +169 -0
- package/lib/EditTable/Group.js +204 -0
- package/lib/EditTable/Header.js +63 -0
- package/lib/EditTable/HeaderRender.js +12 -0
- package/lib/EditTable/components/ContextMenu/Menu.js +86 -0
- package/lib/EditTable/components/ContextMenu/index.js +96 -0
- package/lib/EditTable/components/Search/Search.js +163 -0
- package/lib/EditTable/components/Search/Sort.js +119 -0
- package/lib/EditTable/components/Search/index.js +2 -0
- package/lib/EditTable/consts.js +13 -0
- package/lib/EditTable/context.js +88 -0
- package/lib/EditTable/hooks/index.js +19 -0
- package/lib/EditTable/hooks/useGroup.js +48 -0
- package/lib/EditTable/hooks/useResizeObserver.js +27 -0
- package/lib/EditTable/hooks/useValidate.js +112 -0
- package/lib/EditTable/index.js +25 -0
- package/lib/EditTable/props.js +60 -0
- package/lib/EditTable/style/body.js +63 -0
- package/lib/EditTable/style/form.js +33 -0
- package/lib/EditTable/style/group.js +33 -0
- package/lib/EditTable/style/header.js +72 -0
- package/lib/EditTable/style/index.js +52 -0
- package/lib/EditTable/style/menu.js +27 -0
- package/lib/EditTable/style/table.js +46 -0
- package/lib/EditTable/utils.js +110 -0
- package/lib/Ellipsis/Ellipsis.js +148 -0
- package/lib/Ellipsis/index.js +7 -0
- package/lib/Ellipsis/style/index.js +26 -0
- package/lib/Empty/Empty.js +63 -0
- package/lib/Empty/image.js +3 -0
- package/lib/Empty/index.js +7 -0
- package/lib/FullPage/FullPage.js +19 -0
- package/lib/FullPage/index.js +7 -0
- package/lib/Icon/Icon.js +49 -0
- package/lib/Icon/index.js +7 -0
- package/lib/LocaleProvider/LocaleProvider.js +31 -0
- package/lib/LocaleProvider/index.js +7 -0
- package/lib/LocaleReciver/index.js +24 -0
- package/lib/Markdown/Markdown.js +118 -0
- package/lib/Markdown/index.js +7 -0
- package/lib/PermissionButton/PermissionButton.js +118 -0
- package/lib/PermissionButton/confirm.js +94 -0
- package/lib/PermissionButton/index.js +9 -0
- package/lib/PermissionButton/shared.js +1 -0
- package/lib/ProLayout/Basic/BasicLayout.js +422 -0
- package/lib/ProLayout/Basic/BasicLayoutStyle.js +51 -0
- package/lib/ProLayout/Basic/Header.js +111 -0
- package/lib/ProLayout/Basic/HeaderStyle.js +10 -0
- package/lib/ProLayout/PageContainer/index.js +354 -0
- package/lib/ProLayout/PageContainer/style.js +85 -0
- package/lib/ProLayout/RouteContext.js +28 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +241 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +274 -0
- package/lib/ProLayout/SiderMenu/index.js +2 -0
- package/lib/ProLayout/SiderMenu/style.js +204 -0
- package/lib/ProLayout/TopHeader/index.js +170 -0
- package/lib/ProLayout/TopHeader/style.js +154 -0
- package/lib/ProLayout/defaultSettings.js +113 -0
- package/lib/ProLayout/index.js +10 -0
- package/lib/ProLayout/style/index.js +14 -0
- package/lib/ProLayout/util.js +58 -0
- package/lib/ProTable/Alert.js +40 -0
- package/lib/ProTable/Content.js +97 -0
- package/lib/ProTable/Header.js +33 -0
- package/lib/ProTable/Pagination.js +55 -0
- package/lib/ProTable/ProTable.js +279 -0
- package/lib/ProTable/hooks/index.js +2 -0
- package/lib/ProTable/hooks/useTableInject.js +6 -0
- package/lib/ProTable/hooks/useTableSelection.js +115 -0
- package/lib/ProTable/index.js +8 -0
- package/lib/ProTable/setting.js +138 -0
- package/lib/ProTable/style/index.js +113 -0
- package/lib/RadioButton/RadioButton.js +53 -0
- package/lib/RadioButton/index.js +8 -0
- package/lib/RadioButton/style/index.js +25 -0
- package/lib/Scrollbar/Bar.js +76 -0
- package/lib/Scrollbar/Scrollbar.js +161 -0
- package/lib/Scrollbar/Thumb.js +150 -0
- package/lib/Scrollbar/constants.js +1 -0
- package/lib/Scrollbar/index.js +7 -0
- package/lib/Scrollbar/scrollbarProps.js +100 -0
- package/lib/Scrollbar/style/index.js +85 -0
- package/lib/Scrollbar/thumbProps.js +10 -0
- package/lib/Scrollbar/util.js +39 -0
- package/lib/Search/Item.js +239 -0
- package/lib/Search/Search.js +90 -0
- package/lib/Search/hooks/index.js +117 -0
- package/lib/Search/hooks/useRouteQuery.js +86 -0
- package/lib/Search/hooks/useSearchItems.js +50 -0
- package/lib/Search/hooks/useTermOptions.js +29 -0
- package/lib/Search/index.js +10 -0
- package/lib/Search/setting.js +245 -0
- package/lib/Search/style/index.js +5 -0
- package/lib/Search/style/item.js +40 -0
- package/lib/Search/style/search.js +177 -0
- package/lib/Search/util.js +270 -0
- package/lib/Skeleton/Skeleton.js +27 -0
- package/lib/Skeleton/components/DashBoardCard.js +27 -0
- package/lib/Skeleton/components/DashBoardChart.js +27 -0
- package/lib/Skeleton/components/Detail.js +27 -0
- package/lib/Skeleton/components/Drawer.js +27 -0
- package/lib/Skeleton/components/Item.js +54 -0
- package/lib/Skeleton/components/List.js +27 -0
- package/lib/Skeleton/components/ListCard.js +28 -0
- package/lib/Skeleton/components/ListCardItem.js +20 -0
- package/lib/Skeleton/components/ListTable.js +27 -0
- package/lib/Skeleton/components/Page.js +26 -0
- package/lib/Skeleton/components/Search.js +16 -0
- package/lib/Skeleton/components/Tree.js +27 -0
- package/lib/Skeleton/index.js +28 -0
- package/lib/Skeleton/style/index.js +195 -0
- package/lib/TimeFormat/TimeFormat.js +36 -0
- package/lib/TimeFormat/index.js +7 -0
- package/lib/Title/Title.js +26 -0
- package/lib/Title/index.js +7 -0
- package/lib/Title/style/index.js +34 -0
- package/lib/ValueItem/ValueItem.js +113 -0
- package/lib/ValueItem/index.js +7 -0
- package/lib/ValueItem/util.js +17 -0
- package/lib/VirtualTable/VirtualTable.js +271 -0
- package/lib/VirtualTable/data.js +60 -0
- package/lib/VirtualTable/index.js +7 -0
- package/lib/VirtualTable/style/index.js +34 -0
- package/lib/components.js +21 -0
- package/lib/index.js +17 -0
- package/lib/locale/en-US.js +120 -0
- package/lib/locale/zh-CN.js +120 -0
- package/lib/style/styleRegister.js +19 -0
- package/lib/style/variable.js +4 -0
- package/lib/style.js +1 -0
- package/lib/utils/constants.js +10 -0
- package/package.json +164 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
export const genTopHeaderStyle = (config) => {
|
|
2
|
+
const { token } = config
|
|
3
|
+
const topNavHeaderCls = `${token.antCls}-pro-top-nav-header`
|
|
4
|
+
const proLayoutGlobalHeaderCls = `${token.antCls}-pro-global-header`
|
|
5
|
+
const proLayoutHeaderBg = token.colorBgContainer
|
|
6
|
+
const proLayoutHeaderBoxShadow = '0 1px 4px rgba(0, 21, 41, 0.08)'
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
[proLayoutGlobalHeaderCls]: {
|
|
10
|
+
position: 'relative',
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
height: '100%',
|
|
14
|
+
padding: '0 16px',
|
|
15
|
+
backgroundColor: proLayoutHeaderBg,
|
|
16
|
+
boxShadow: proLayoutHeaderBoxShadow,
|
|
17
|
+
'> *': {
|
|
18
|
+
height: '100%'
|
|
19
|
+
},
|
|
20
|
+
[`${proLayoutGlobalHeaderCls}-coppassed-button`]: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
marginLeft: '16px',
|
|
24
|
+
fontSize: '20px'
|
|
25
|
+
},
|
|
26
|
+
[`${proLayoutGlobalHeaderCls}-layout`]: {
|
|
27
|
+
[`${proLayoutGlobalHeaderCls}-layout-mix`]: {
|
|
28
|
+
backgroundColor: '#001529',
|
|
29
|
+
[`${proLayoutGlobalHeaderCls}-logo`]: {
|
|
30
|
+
'h1': {
|
|
31
|
+
color: '#fff'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
'.anticon': {
|
|
35
|
+
color: '#fff'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
[`${proLayoutGlobalHeaderCls}-logo`]: {
|
|
40
|
+
position: 'relative',
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
a: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
height: '100%',
|
|
46
|
+
img: {
|
|
47
|
+
height: '28px'
|
|
48
|
+
},
|
|
49
|
+
h1: {
|
|
50
|
+
height: '32px',
|
|
51
|
+
margin: '0 0 0 12px',
|
|
52
|
+
color: token.colorPrimary,
|
|
53
|
+
fontWeight: 600,
|
|
54
|
+
fontSize: '18px',
|
|
55
|
+
lineHeight: '32px'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
[`${proLayoutGlobalHeaderCls}-menu`]: {
|
|
60
|
+
'.anticon': {
|
|
61
|
+
marginRight: '8px'
|
|
62
|
+
},
|
|
63
|
+
[`${token.antCls}-dropdown-menu-item`]: {
|
|
64
|
+
minWidth: '160px'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
'.dark': {
|
|
68
|
+
height: '48px',
|
|
69
|
+
'.action': {
|
|
70
|
+
color: 'rgba(255, 255, 255, 0.85)',
|
|
71
|
+
'> i': {
|
|
72
|
+
color: 'rgba(255, 255, 255, 0.85)'
|
|
73
|
+
},
|
|
74
|
+
'&:hover,&.opend': {
|
|
75
|
+
background: token.colorPrimary
|
|
76
|
+
},
|
|
77
|
+
[`${token.antCls}-badge`]: {
|
|
78
|
+
color: 'rgba(255, 255, 255, 0.85)'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
[topNavHeaderCls]: {
|
|
84
|
+
position: 'relative',
|
|
85
|
+
width: '100%',
|
|
86
|
+
height: '100%',
|
|
87
|
+
boxShadow: '0 1px 4px 0 rgba(0, 21, 41, 0.12)',
|
|
88
|
+
transition: 'background 0.3s, width 0.2s',
|
|
89
|
+
[`${token.antCls}-menu`]: {
|
|
90
|
+
backgroundColor: 'transparent'
|
|
91
|
+
},
|
|
92
|
+
'&.light': {
|
|
93
|
+
backgroundColor: token.colorBgContainer,
|
|
94
|
+
[`${topNavHeaderCls}-logo`]: {
|
|
95
|
+
h1: {
|
|
96
|
+
color: token.colorTextHeading
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
'.anticon': {
|
|
100
|
+
color: 'inherit'
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
[`${topNavHeaderCls}-main`]: {
|
|
104
|
+
display: 'flex',
|
|
105
|
+
height: '100%',
|
|
106
|
+
paddingLeft: '16px',
|
|
107
|
+
[`${topNavHeaderCls}-main-left`]: {
|
|
108
|
+
display: 'flex',
|
|
109
|
+
minWidth: '192px'
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
'.anticon': {
|
|
113
|
+
color: '#fff'
|
|
114
|
+
},
|
|
115
|
+
[`${topNavHeaderCls}-logo`]: {
|
|
116
|
+
position: 'relative',
|
|
117
|
+
minWidth: '165px',
|
|
118
|
+
height: '100%',
|
|
119
|
+
overflow: 'hidden',
|
|
120
|
+
img: {
|
|
121
|
+
display: 'inline-block',
|
|
122
|
+
height: '32px',
|
|
123
|
+
verticalAlign: 'middle'
|
|
124
|
+
},
|
|
125
|
+
h1: {
|
|
126
|
+
display: 'inline-block',
|
|
127
|
+
margin: '0 0 0 12px',
|
|
128
|
+
color: token.colorPrimary,
|
|
129
|
+
fontWeight: 600,
|
|
130
|
+
fontSize: '16px',
|
|
131
|
+
verticalAlign: 'top'
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
[`${topNavHeaderCls}-menu`]: {
|
|
135
|
+
minWidth: 0,
|
|
136
|
+
[`${token.antCls}-menu${token.antCls}-meu-horizontal`]: {
|
|
137
|
+
height: '100%',
|
|
138
|
+
border: 'none',
|
|
139
|
+
[`${token.antCls}-menu-item`]: {
|
|
140
|
+
height: '100%',
|
|
141
|
+
[`${token.antCls}-badge`]: {
|
|
142
|
+
color: 'unset'
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
[`${token.antCls}-pro-menu-popup`]: {
|
|
149
|
+
[`${token.antCls}-badge`]: {
|
|
150
|
+
color: 'unset'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import 'vue'
|
|
2
|
+
import PropTypes from 'ant-design-vue/es/_util/vue-types'
|
|
3
|
+
|
|
4
|
+
export const defaultSettings = {
|
|
5
|
+
theme: 'light',
|
|
6
|
+
layout: 'mix',
|
|
7
|
+
contentWidth: 'Fluid',
|
|
8
|
+
fixedHeader: true,
|
|
9
|
+
fixSiderbar: true,
|
|
10
|
+
menu: {
|
|
11
|
+
locale: true
|
|
12
|
+
},
|
|
13
|
+
headerHeight: 48,
|
|
14
|
+
title: 'Jetlink UI Components',
|
|
15
|
+
iconfontUrl: '',
|
|
16
|
+
primaryColor: '#315EFB'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const LayoutType = {
|
|
20
|
+
CARD: 'card',
|
|
21
|
+
PAD: 'pad',
|
|
22
|
+
LIST: 'list'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const defaultSettingProps = {
|
|
26
|
+
theme: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: defaultSettings.theme
|
|
29
|
+
},
|
|
30
|
+
layout: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: defaultSettings.layout
|
|
33
|
+
},
|
|
34
|
+
contentWidth: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: defaultSettings.contentWidth
|
|
37
|
+
},
|
|
38
|
+
fixedHeader: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: defaultSettings.fixedHeader
|
|
41
|
+
},
|
|
42
|
+
fixSiderbar: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: defaultSettings.fixSiderbar
|
|
45
|
+
},
|
|
46
|
+
menu: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: function _default() {
|
|
49
|
+
return {
|
|
50
|
+
locale: true
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
headerHeight: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: defaultSettings.headerHeight
|
|
57
|
+
},
|
|
58
|
+
title: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: function _default() {
|
|
61
|
+
return defaultSettings.title
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
iconfontUrl: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: function _default() {
|
|
67
|
+
return defaultSettings.iconfontUrl
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
primaryColor: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: function _default() {
|
|
73
|
+
return defaultSettings.primaryColor
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
layoutType: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: LayoutType.LIST
|
|
79
|
+
},
|
|
80
|
+
cardSiderWidth: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: 60
|
|
83
|
+
},
|
|
84
|
+
historyRoutes: {
|
|
85
|
+
type: Array,
|
|
86
|
+
default: function _default() {
|
|
87
|
+
return []
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
historyActive: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: undefined
|
|
93
|
+
},
|
|
94
|
+
pageFooterStyle: {
|
|
95
|
+
type: Object,
|
|
96
|
+
default: function _default() {
|
|
97
|
+
return undefined
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
pageHeaderStyle: {
|
|
101
|
+
type: Object,
|
|
102
|
+
default: function _default() {
|
|
103
|
+
return undefined
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
apps: {
|
|
107
|
+
type: Array,
|
|
108
|
+
default: function _default() {
|
|
109
|
+
return []
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
onAppMenuClick: PropTypes.func
|
|
113
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import ProLayout from './Basic/BasicLayout.js'
|
|
2
|
+
import PageContainer from './PageContainer/index.js'
|
|
3
|
+
import { LayoutType } from './defaultSettings'
|
|
4
|
+
|
|
5
|
+
ProLayout.install = function (app) {
|
|
6
|
+
app.component(ProLayout.name, ProLayout)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { PageContainer, LayoutType }
|
|
10
|
+
export default ProLayout
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import genCompoentStyle from '../../style/styleRegister'
|
|
2
|
+
import { genBasicLayoutStyle } from '../Basic/BasicLayoutStyle'
|
|
3
|
+
import { genHeaderStyle } from '../Basic/HeaderStyle'
|
|
4
|
+
import { genPageContainerStyle } from '../PageContainer/style'
|
|
5
|
+
import { genSiderMenuStyle } from '../SiderMenu/style'
|
|
6
|
+
import { genTopHeaderStyle } from '../TopHeader/style'
|
|
7
|
+
|
|
8
|
+
export default genCompoentStyle([
|
|
9
|
+
genBasicLayoutStyle,
|
|
10
|
+
genHeaderStyle,
|
|
11
|
+
genPageContainerStyle,
|
|
12
|
+
genSiderMenuStyle,
|
|
13
|
+
genTopHeaderStyle
|
|
14
|
+
])
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }export function clearMenuItem(menusData) {
|
|
2
|
+
return menusData.map((item) => {
|
|
3
|
+
const finalItem = { ...item }
|
|
4
|
+
if (_optionalChain([finalItem, 'access', _ => _.meta, 'optionalAccess', _2 => _2.hideInMenu])) {
|
|
5
|
+
return null
|
|
6
|
+
}
|
|
7
|
+
if (finalItem && _optionalChain([finalItem, 'optionalAccess', _3 => _3.children])) {
|
|
8
|
+
if (!_optionalChain([finalItem, 'access', _4 => _4.meta, 'optionalAccess', _5 => _5.hideChildInMenu]) && finalItem.children.some((child) => {
|
|
9
|
+
return child && child.name && !_optionalChain([child, 'access', _6 => _6.meta, 'optionalAccess', _7 => _7.hideInMenu])
|
|
10
|
+
})) {
|
|
11
|
+
return {
|
|
12
|
+
...item,
|
|
13
|
+
children: clearMenuItem(finalItem.children)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
delete finalItem.children
|
|
17
|
+
}
|
|
18
|
+
return finalItem
|
|
19
|
+
}).filter((item) => {
|
|
20
|
+
return item
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function flatMap(menusData) {
|
|
25
|
+
return menusData.map((item) => {
|
|
26
|
+
const finalItem = { ...item }
|
|
27
|
+
if (!finalItem.name || _optionalChain([finalItem, 'access', _8 => _8.meta, 'optionalAccess', _9 => _9.hideInMenu])) {
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
if (finalItem.children) {
|
|
31
|
+
delete finalItem.children
|
|
32
|
+
}
|
|
33
|
+
return finalItem
|
|
34
|
+
}).filter((item) => {
|
|
35
|
+
return item
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getMenuFirstChildren(menus, key) {
|
|
40
|
+
return key === undefined ? [] : (menus[menus.findIndex((menu) => {
|
|
41
|
+
return menu.path === key
|
|
42
|
+
})] || {}).children || []
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function getSlot(slots, props, prop = 'default') {
|
|
46
|
+
if (props[prop] === false) {
|
|
47
|
+
// force not render
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
return props[prop] || slots[prop]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function getSlotVNode(slots, props, prop = 'default') {
|
|
54
|
+
if (props[prop] === false) {
|
|
55
|
+
return false
|
|
56
|
+
}
|
|
57
|
+
return props[prop] || _optionalChain([slots, 'access', _10 => _10[prop], 'optionalCall', _11 => _11()])
|
|
58
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
import { defineComponent, computed } from 'vue'
|
|
3
|
+
import { Alert, Button } from 'ant-design-vue'
|
|
4
|
+
import { _alertProps } from './setting'
|
|
5
|
+
import { useLocaleReceiver } from '../LocaleReciver'
|
|
6
|
+
import useProTableStyle from './style'
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'Alert',
|
|
10
|
+
components: {
|
|
11
|
+
Alert,
|
|
12
|
+
Button
|
|
13
|
+
},
|
|
14
|
+
props: { ..._alertProps } ,
|
|
15
|
+
emits: ['close'],
|
|
16
|
+
setup(props, { emit }) {
|
|
17
|
+
const [contextLocale] = useLocaleReceiver('ProTable')
|
|
18
|
+
const prefixCls = computed(() => 'pro-table')
|
|
19
|
+
const [wrapSSR, hashId] = useProTableStyle(prefixCls)
|
|
20
|
+
|
|
21
|
+
const _message = computed(() => {
|
|
22
|
+
let locale = _optionalChain([contextLocale, 'access', _ => _.value, 'optionalAccess', _2 => _2.alert, 'optionalAccess', _3 => _3.selectItem]) || ''
|
|
23
|
+
;[_optionalChain([props, 'access', _4 => _4.rowSelection, 'optionalAccess', _5 => _5.selectedRowKeys, 'optionalAccess', _6 => _6.length]) || 0].forEach((item, index) => {
|
|
24
|
+
locale = locale.replace(`{${index}}`, item)
|
|
25
|
+
})
|
|
26
|
+
return locale
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const onClose = () => {
|
|
30
|
+
emit('close')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
hashId,
|
|
35
|
+
contextLocale,
|
|
36
|
+
_message,
|
|
37
|
+
onClose
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
})
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
import { defineComponent, computed, useSlots } from 'vue'
|
|
3
|
+
import { Table, Checkbox as ACheckbox } from 'ant-design-vue'
|
|
4
|
+
import { get, omit } from 'lodash-es'
|
|
5
|
+
import Empty from '../Empty'
|
|
6
|
+
import { useTableInject } from './hooks'
|
|
7
|
+
import useProTableStyle from './style'
|
|
8
|
+
import { useLocaleReceiver } from '../LocaleReciver'
|
|
9
|
+
import JVirtualTable from '../VirtualTable'
|
|
10
|
+
import { _contentProps } from './setting'
|
|
11
|
+
|
|
12
|
+
export default defineComponent({
|
|
13
|
+
name: 'Content',
|
|
14
|
+
components: {
|
|
15
|
+
Table,
|
|
16
|
+
ACheckbox,
|
|
17
|
+
Empty,
|
|
18
|
+
JVirtualTable
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
..._contentProps,
|
|
22
|
+
column: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 4
|
|
25
|
+
}
|
|
26
|
+
} ,
|
|
27
|
+
setup(props) {
|
|
28
|
+
const slots = useSlots()
|
|
29
|
+
const [contextLocale] = useLocaleReceiver('ProTable')
|
|
30
|
+
const prefixCls = computed(() => 'pro-table')
|
|
31
|
+
const [wrapSSR, hashId] = useProTableStyle(prefixCls)
|
|
32
|
+
|
|
33
|
+
const _rowSelection = useTableInject()
|
|
34
|
+
|
|
35
|
+
const _columns = computed(() => props.columns.filter((i) => !_optionalChain([i, 'optionalAccess', _ => _.hideInTable])))
|
|
36
|
+
|
|
37
|
+
const _slots = computed(() => {
|
|
38
|
+
return omit(slots, ['emptyText', 'bodyCell'])
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const _scroll = computed(() => {
|
|
42
|
+
if (props.scroll === false) {
|
|
43
|
+
return {
|
|
44
|
+
x: undefined,
|
|
45
|
+
y: undefined
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
x: props.scroll.x === false ? undefined : props.scroll.x || '100%',
|
|
50
|
+
y: props.scroll.y === false ? undefined : props.scroll.y || '100%'
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const gridTemplateColumns = computed(() => {
|
|
55
|
+
return `repeat(${props.column}, 1fr)`
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const __rowSelection = computed(() => {
|
|
59
|
+
return props.rowSelection || _optionalChain([_rowSelection, 'optionalAccess', _2 => _2.value])
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const indeterminate = computed(() => {
|
|
63
|
+
return _optionalChain([__rowSelection, 'access', _3 => _3.value, 'optionalAccess', _4 => _4.selectedRowKeys, 'optionalAccess', _5 => _5.length]) > 0 && _optionalChain([__rowSelection, 'access', _6 => _6.value, 'optionalAccess', _7 => _7.selectedRowKeys, 'optionalAccess', _8 => _8.length]) < props.dataSource.length
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const checkedAll = computed(() => {
|
|
67
|
+
return _optionalChain([__rowSelection, 'access', _9 => _9.value, 'optionalAccess', _10 => _10.selectedRowKeys, 'optionalAccess', _11 => _11.length]) > 0 && _optionalChain([__rowSelection, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.selectedRowKeys, 'optionalAccess', _14 => _14.length]) === props.dataSource.length
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const onClick = (item) => {
|
|
71
|
+
if (_rowSelection && _rowSelection.value) {
|
|
72
|
+
const _selected = _optionalChain([_rowSelection, 'access', _15 => _15.value, 'access', _16 => _16.selectedRowKeys, 'optionalAccess', _17 => _17.includes, 'call', _18 => _18(item[props.rowKey])])
|
|
73
|
+
_optionalChain([_rowSelection, 'access', _19 => _19.value, 'access', _20 => _20.onSelect, 'optionalCall', _21 => _21(item, !_selected)])
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const handleCheckedAllChange = (e) => {
|
|
78
|
+
const flag = e.target.checked
|
|
79
|
+
_optionalChain([__rowSelection, 'access', _22 => _22.value, 'optionalAccess', _23 => _23.onSelectAll, 'optionalCall', _24 => _24(flag, props.dataSource, props.dataSource)])
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
hashId,
|
|
84
|
+
contextLocale,
|
|
85
|
+
_columns,
|
|
86
|
+
_slots,
|
|
87
|
+
_scroll,
|
|
88
|
+
gridTemplateColumns,
|
|
89
|
+
__rowSelection,
|
|
90
|
+
indeterminate,
|
|
91
|
+
checkedAll,
|
|
92
|
+
onClick,
|
|
93
|
+
handleCheckedAllChange,
|
|
94
|
+
get
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
import { defineComponent, computed } from 'vue'
|
|
3
|
+
import { RadioGroup, RadioButton } from 'ant-design-vue'
|
|
4
|
+
import AIcon from '../Icon'
|
|
5
|
+
import { _headerProps } from './setting'
|
|
6
|
+
import useProTableStyle from './style'
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'Header',
|
|
10
|
+
components: {
|
|
11
|
+
RadioGroup,
|
|
12
|
+
RadioButton,
|
|
13
|
+
AIcon
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
..._headerProps,
|
|
17
|
+
initMode: {
|
|
18
|
+
type: [String, undefined] ,
|
|
19
|
+
default: undefined
|
|
20
|
+
}
|
|
21
|
+
} ,
|
|
22
|
+
emits: ['change'],
|
|
23
|
+
setup(props, { emit }) {
|
|
24
|
+
const emits = emit
|
|
25
|
+
const prefixCls = computed(() => 'pro-table')
|
|
26
|
+
const [wrapSSR, hashId] = useProTableStyle(prefixCls)
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
hashId,
|
|
30
|
+
emits
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
})
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
import { defineComponent, computed, h } from 'vue'
|
|
3
|
+
import { Pagination, Spin } from 'ant-design-vue'
|
|
4
|
+
import { _paginationProps } from './setting'
|
|
5
|
+
import { useLocaleReceiver } from '../LocaleReciver'
|
|
6
|
+
import useProTableStyle from './style'
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'JPagination',
|
|
10
|
+
components: {
|
|
11
|
+
Pagination
|
|
12
|
+
},
|
|
13
|
+
props: { ..._paginationProps } ,
|
|
14
|
+
emits: ['change'],
|
|
15
|
+
setup(props, { emit }) {
|
|
16
|
+
const [contextLocale] = useLocaleReceiver('ProTable')
|
|
17
|
+
const prefixCls = computed(() => 'pro-table')
|
|
18
|
+
const [wrapSSR, hashId] = useProTableStyle(prefixCls)
|
|
19
|
+
|
|
20
|
+
const className = computed(() => {
|
|
21
|
+
return {
|
|
22
|
+
'hide-content': !props.isShowContent
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const _showTotal = (num) => {
|
|
27
|
+
const minSize = props.pageIndex * props.pageSize + 1
|
|
28
|
+
const MaxSize = (props.pageIndex + 1) * props.pageSize
|
|
29
|
+
let localePage = _optionalChain([contextLocale, 'access', _ => _.value, 'access', _2 => _2.pagination, 'optionalAccess', _3 => _3.page]) || ''
|
|
30
|
+
let localeTotal = _optionalChain([contextLocale, 'access', _4 => _4.value, 'access', _5 => _5.pagination, 'optionalAccess', _6 => _6.total]) || ''
|
|
31
|
+
const _maxSize = props.totalLoading ? MaxSize : (MaxSize > num ? num : MaxSize)
|
|
32
|
+
;[minSize, _maxSize].forEach((item, index) => {
|
|
33
|
+
localePage = localePage.replace(`{${index}}`, item)
|
|
34
|
+
})
|
|
35
|
+
return h('span', {}, [
|
|
36
|
+
localePage,
|
|
37
|
+
props.totalLoading
|
|
38
|
+
? h(Spin, { size: 'small', style: { margin: '0 4px' } })
|
|
39
|
+
: h('span', { style: { margin: '0 4px' } }, num),
|
|
40
|
+
localeTotal
|
|
41
|
+
])
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const onChange = (page, size) => {
|
|
45
|
+
emit('change', page, size)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
hashId,
|
|
50
|
+
className,
|
|
51
|
+
_showTotal,
|
|
52
|
+
onChange
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|