@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.
Files changed (303) hide show
  1. package/es/AutoComplete/AutoComplete.js +84 -0
  2. package/es/AutoComplete/index.js +7 -0
  3. package/es/BadgeStatus/Badge.js +51 -0
  4. package/es/BadgeStatus/color.js +14 -0
  5. package/es/BadgeStatus/index.js +8 -0
  6. package/es/CardSelect/CardSelect.js +141 -0
  7. package/es/CardSelect/index.js +7 -0
  8. package/es/CardSelect/style/index.js +29 -0
  9. package/es/CheckButton/CheckButton.js +122 -0
  10. package/es/CheckButton/index.js +7 -0
  11. package/es/CheckButton/style/index.js +44 -0
  12. package/es/ConfigProvider/ConfigProvider.js +73 -0
  13. package/es/ConfigProvider/context.js +26 -0
  14. package/es/ConfigProvider/index.js +9 -0
  15. package/es/DragModal/DragModal.js +212 -0
  16. package/es/DragModal/index.js +7 -0
  17. package/es/DragModal/style/index.js +86 -0
  18. package/es/EditTable/Body.js +189 -0
  19. package/es/EditTable/CellRender.js +12 -0
  20. package/es/EditTable/EditTable.js +434 -0
  21. package/es/EditTable/FormItem.js +169 -0
  22. package/es/EditTable/Group.js +204 -0
  23. package/es/EditTable/Header.js +63 -0
  24. package/es/EditTable/HeaderRender.js +12 -0
  25. package/es/EditTable/components/ContextMenu/Menu.js +86 -0
  26. package/es/EditTable/components/ContextMenu/index.js +96 -0
  27. package/es/EditTable/components/Search/Search.js +163 -0
  28. package/es/EditTable/components/Search/Sort.js +119 -0
  29. package/es/EditTable/components/Search/index.js +2 -0
  30. package/es/EditTable/consts.js +13 -0
  31. package/es/EditTable/context.js +88 -0
  32. package/es/EditTable/hooks/index.js +19 -0
  33. package/es/EditTable/hooks/useGroup.js +48 -0
  34. package/es/EditTable/hooks/useResizeObserver.js +27 -0
  35. package/es/EditTable/hooks/useValidate.js +112 -0
  36. package/es/EditTable/index.js +25 -0
  37. package/es/EditTable/props.js +60 -0
  38. package/es/EditTable/style/body.js +63 -0
  39. package/es/EditTable/style/form.js +33 -0
  40. package/es/EditTable/style/group.js +33 -0
  41. package/es/EditTable/style/header.js +72 -0
  42. package/es/EditTable/style/index.js +52 -0
  43. package/es/EditTable/style/menu.js +27 -0
  44. package/es/EditTable/style/table.js +46 -0
  45. package/es/EditTable/utils.js +110 -0
  46. package/es/Ellipsis/Ellipsis.js +148 -0
  47. package/es/Ellipsis/index.js +7 -0
  48. package/es/Ellipsis/style/index.js +26 -0
  49. package/es/Empty/Empty.js +63 -0
  50. package/es/Empty/image.js +3 -0
  51. package/es/Empty/index.js +7 -0
  52. package/es/FullPage/FullPage.js +19 -0
  53. package/es/FullPage/index.js +7 -0
  54. package/es/Icon/Icon.js +49 -0
  55. package/es/Icon/index.js +7 -0
  56. package/es/LocaleProvider/LocaleProvider.js +31 -0
  57. package/es/LocaleProvider/index.js +7 -0
  58. package/es/LocaleReciver/index.js +24 -0
  59. package/es/Markdown/Markdown.js +118 -0
  60. package/es/Markdown/index.js +7 -0
  61. package/es/PermissionButton/PermissionButton.js +118 -0
  62. package/es/PermissionButton/confirm.js +94 -0
  63. package/es/PermissionButton/index.js +9 -0
  64. package/es/PermissionButton/shared.js +1 -0
  65. package/es/ProLayout/Basic/BasicLayout.js +422 -0
  66. package/es/ProLayout/Basic/BasicLayoutStyle.js +51 -0
  67. package/es/ProLayout/Basic/Header.js +111 -0
  68. package/es/ProLayout/Basic/HeaderStyle.js +10 -0
  69. package/es/ProLayout/PageContainer/index.js +354 -0
  70. package/es/ProLayout/PageContainer/style.js +85 -0
  71. package/es/ProLayout/RouteContext.js +28 -0
  72. package/es/ProLayout/SiderMenu/BaseMenu.js +241 -0
  73. package/es/ProLayout/SiderMenu/SiderMenu.js +274 -0
  74. package/es/ProLayout/SiderMenu/index.js +2 -0
  75. package/es/ProLayout/SiderMenu/style.js +204 -0
  76. package/es/ProLayout/TopHeader/index.js +170 -0
  77. package/es/ProLayout/TopHeader/style.js +154 -0
  78. package/es/ProLayout/defaultSettings.js +113 -0
  79. package/es/ProLayout/index.js +10 -0
  80. package/es/ProLayout/style/index.js +14 -0
  81. package/es/ProLayout/util.js +58 -0
  82. package/es/ProTable/Alert.js +40 -0
  83. package/es/ProTable/Content.js +97 -0
  84. package/es/ProTable/Header.js +33 -0
  85. package/es/ProTable/Pagination.js +55 -0
  86. package/es/ProTable/ProTable.js +279 -0
  87. package/es/ProTable/hooks/index.js +2 -0
  88. package/es/ProTable/hooks/useTableInject.js +6 -0
  89. package/es/ProTable/hooks/useTableSelection.js +115 -0
  90. package/es/ProTable/index.js +8 -0
  91. package/es/ProTable/setting.js +138 -0
  92. package/es/ProTable/style/index.js +113 -0
  93. package/es/RadioButton/RadioButton.js +53 -0
  94. package/es/RadioButton/index.js +8 -0
  95. package/es/RadioButton/style/index.js +25 -0
  96. package/es/Scrollbar/Bar.js +76 -0
  97. package/es/Scrollbar/Scrollbar.js +161 -0
  98. package/es/Scrollbar/Thumb.js +150 -0
  99. package/es/Scrollbar/constants.js +1 -0
  100. package/es/Scrollbar/index.js +7 -0
  101. package/es/Scrollbar/scrollbarProps.js +100 -0
  102. package/es/Scrollbar/style/index.js +85 -0
  103. package/es/Scrollbar/thumbProps.js +10 -0
  104. package/es/Scrollbar/util.js +39 -0
  105. package/es/Search/Item.js +239 -0
  106. package/es/Search/Search.js +90 -0
  107. package/es/Search/hooks/index.js +117 -0
  108. package/es/Search/hooks/useRouteQuery.js +86 -0
  109. package/es/Search/hooks/useSearchItems.js +50 -0
  110. package/es/Search/hooks/useTermOptions.js +29 -0
  111. package/es/Search/index.js +10 -0
  112. package/es/Search/setting.js +245 -0
  113. package/es/Search/style/index.js +5 -0
  114. package/es/Search/style/item.js +40 -0
  115. package/es/Search/style/search.js +177 -0
  116. package/es/Search/util.js +270 -0
  117. package/es/Skeleton/Skeleton.js +27 -0
  118. package/es/Skeleton/components/DashBoardCard.js +27 -0
  119. package/es/Skeleton/components/DashBoardChart.js +27 -0
  120. package/es/Skeleton/components/Detail.js +27 -0
  121. package/es/Skeleton/components/Drawer.js +27 -0
  122. package/es/Skeleton/components/Item.js +54 -0
  123. package/es/Skeleton/components/List.js +27 -0
  124. package/es/Skeleton/components/ListCard.js +28 -0
  125. package/es/Skeleton/components/ListCardItem.js +20 -0
  126. package/es/Skeleton/components/ListTable.js +27 -0
  127. package/es/Skeleton/components/Page.js +26 -0
  128. package/es/Skeleton/components/Search.js +16 -0
  129. package/es/Skeleton/components/Tree.js +27 -0
  130. package/es/Skeleton/index.js +28 -0
  131. package/es/Skeleton/style/index.js +195 -0
  132. package/es/TimeFormat/TimeFormat.js +36 -0
  133. package/es/TimeFormat/index.js +7 -0
  134. package/es/Title/Title.js +26 -0
  135. package/es/Title/index.js +7 -0
  136. package/es/Title/style/index.js +34 -0
  137. package/es/ValueItem/ValueItem.js +113 -0
  138. package/es/ValueItem/index.js +7 -0
  139. package/es/ValueItem/util.js +17 -0
  140. package/es/VirtualTable/VirtualTable.js +271 -0
  141. package/es/VirtualTable/data.js +60 -0
  142. package/es/VirtualTable/index.js +7 -0
  143. package/es/VirtualTable/style/index.js +34 -0
  144. package/es/components.js +21 -0
  145. package/es/index.js +17 -0
  146. package/es/locale/en-US.js +120 -0
  147. package/es/locale/zh-CN.js +120 -0
  148. package/es/style/styleRegister.js +19 -0
  149. package/es/style/variable.js +4 -0
  150. package/es/style.js +1 -0
  151. package/es/utils/constants.js +10 -0
  152. package/lib/AutoComplete/AutoComplete.js +84 -0
  153. package/lib/AutoComplete/index.js +7 -0
  154. package/lib/BadgeStatus/Badge.js +51 -0
  155. package/lib/BadgeStatus/color.js +14 -0
  156. package/lib/BadgeStatus/index.js +8 -0
  157. package/lib/CardSelect/CardSelect.js +141 -0
  158. package/lib/CardSelect/index.js +7 -0
  159. package/lib/CardSelect/style/index.js +29 -0
  160. package/lib/CheckButton/CheckButton.js +122 -0
  161. package/lib/CheckButton/index.js +7 -0
  162. package/lib/CheckButton/style/index.js +44 -0
  163. package/lib/ConfigProvider/ConfigProvider.js +73 -0
  164. package/lib/ConfigProvider/context.js +26 -0
  165. package/lib/ConfigProvider/index.js +9 -0
  166. package/lib/DragModal/DragModal.js +212 -0
  167. package/lib/DragModal/index.js +7 -0
  168. package/lib/DragModal/style/index.js +86 -0
  169. package/lib/EditTable/Body.js +189 -0
  170. package/lib/EditTable/CellRender.js +12 -0
  171. package/lib/EditTable/EditTable.js +434 -0
  172. package/lib/EditTable/FormItem.js +169 -0
  173. package/lib/EditTable/Group.js +204 -0
  174. package/lib/EditTable/Header.js +63 -0
  175. package/lib/EditTable/HeaderRender.js +12 -0
  176. package/lib/EditTable/components/ContextMenu/Menu.js +86 -0
  177. package/lib/EditTable/components/ContextMenu/index.js +96 -0
  178. package/lib/EditTable/components/Search/Search.js +163 -0
  179. package/lib/EditTable/components/Search/Sort.js +119 -0
  180. package/lib/EditTable/components/Search/index.js +2 -0
  181. package/lib/EditTable/consts.js +13 -0
  182. package/lib/EditTable/context.js +88 -0
  183. package/lib/EditTable/hooks/index.js +19 -0
  184. package/lib/EditTable/hooks/useGroup.js +48 -0
  185. package/lib/EditTable/hooks/useResizeObserver.js +27 -0
  186. package/lib/EditTable/hooks/useValidate.js +112 -0
  187. package/lib/EditTable/index.js +25 -0
  188. package/lib/EditTable/props.js +60 -0
  189. package/lib/EditTable/style/body.js +63 -0
  190. package/lib/EditTable/style/form.js +33 -0
  191. package/lib/EditTable/style/group.js +33 -0
  192. package/lib/EditTable/style/header.js +72 -0
  193. package/lib/EditTable/style/index.js +52 -0
  194. package/lib/EditTable/style/menu.js +27 -0
  195. package/lib/EditTable/style/table.js +46 -0
  196. package/lib/EditTable/utils.js +110 -0
  197. package/lib/Ellipsis/Ellipsis.js +148 -0
  198. package/lib/Ellipsis/index.js +7 -0
  199. package/lib/Ellipsis/style/index.js +26 -0
  200. package/lib/Empty/Empty.js +63 -0
  201. package/lib/Empty/image.js +3 -0
  202. package/lib/Empty/index.js +7 -0
  203. package/lib/FullPage/FullPage.js +19 -0
  204. package/lib/FullPage/index.js +7 -0
  205. package/lib/Icon/Icon.js +49 -0
  206. package/lib/Icon/index.js +7 -0
  207. package/lib/LocaleProvider/LocaleProvider.js +31 -0
  208. package/lib/LocaleProvider/index.js +7 -0
  209. package/lib/LocaleReciver/index.js +24 -0
  210. package/lib/Markdown/Markdown.js +118 -0
  211. package/lib/Markdown/index.js +7 -0
  212. package/lib/PermissionButton/PermissionButton.js +118 -0
  213. package/lib/PermissionButton/confirm.js +94 -0
  214. package/lib/PermissionButton/index.js +9 -0
  215. package/lib/PermissionButton/shared.js +1 -0
  216. package/lib/ProLayout/Basic/BasicLayout.js +422 -0
  217. package/lib/ProLayout/Basic/BasicLayoutStyle.js +51 -0
  218. package/lib/ProLayout/Basic/Header.js +111 -0
  219. package/lib/ProLayout/Basic/HeaderStyle.js +10 -0
  220. package/lib/ProLayout/PageContainer/index.js +354 -0
  221. package/lib/ProLayout/PageContainer/style.js +85 -0
  222. package/lib/ProLayout/RouteContext.js +28 -0
  223. package/lib/ProLayout/SiderMenu/BaseMenu.js +241 -0
  224. package/lib/ProLayout/SiderMenu/SiderMenu.js +274 -0
  225. package/lib/ProLayout/SiderMenu/index.js +2 -0
  226. package/lib/ProLayout/SiderMenu/style.js +204 -0
  227. package/lib/ProLayout/TopHeader/index.js +170 -0
  228. package/lib/ProLayout/TopHeader/style.js +154 -0
  229. package/lib/ProLayout/defaultSettings.js +113 -0
  230. package/lib/ProLayout/index.js +10 -0
  231. package/lib/ProLayout/style/index.js +14 -0
  232. package/lib/ProLayout/util.js +58 -0
  233. package/lib/ProTable/Alert.js +40 -0
  234. package/lib/ProTable/Content.js +97 -0
  235. package/lib/ProTable/Header.js +33 -0
  236. package/lib/ProTable/Pagination.js +55 -0
  237. package/lib/ProTable/ProTable.js +279 -0
  238. package/lib/ProTable/hooks/index.js +2 -0
  239. package/lib/ProTable/hooks/useTableInject.js +6 -0
  240. package/lib/ProTable/hooks/useTableSelection.js +115 -0
  241. package/lib/ProTable/index.js +8 -0
  242. package/lib/ProTable/setting.js +138 -0
  243. package/lib/ProTable/style/index.js +113 -0
  244. package/lib/RadioButton/RadioButton.js +53 -0
  245. package/lib/RadioButton/index.js +8 -0
  246. package/lib/RadioButton/style/index.js +25 -0
  247. package/lib/Scrollbar/Bar.js +76 -0
  248. package/lib/Scrollbar/Scrollbar.js +161 -0
  249. package/lib/Scrollbar/Thumb.js +150 -0
  250. package/lib/Scrollbar/constants.js +1 -0
  251. package/lib/Scrollbar/index.js +7 -0
  252. package/lib/Scrollbar/scrollbarProps.js +100 -0
  253. package/lib/Scrollbar/style/index.js +85 -0
  254. package/lib/Scrollbar/thumbProps.js +10 -0
  255. package/lib/Scrollbar/util.js +39 -0
  256. package/lib/Search/Item.js +239 -0
  257. package/lib/Search/Search.js +90 -0
  258. package/lib/Search/hooks/index.js +117 -0
  259. package/lib/Search/hooks/useRouteQuery.js +86 -0
  260. package/lib/Search/hooks/useSearchItems.js +50 -0
  261. package/lib/Search/hooks/useTermOptions.js +29 -0
  262. package/lib/Search/index.js +10 -0
  263. package/lib/Search/setting.js +245 -0
  264. package/lib/Search/style/index.js +5 -0
  265. package/lib/Search/style/item.js +40 -0
  266. package/lib/Search/style/search.js +177 -0
  267. package/lib/Search/util.js +270 -0
  268. package/lib/Skeleton/Skeleton.js +27 -0
  269. package/lib/Skeleton/components/DashBoardCard.js +27 -0
  270. package/lib/Skeleton/components/DashBoardChart.js +27 -0
  271. package/lib/Skeleton/components/Detail.js +27 -0
  272. package/lib/Skeleton/components/Drawer.js +27 -0
  273. package/lib/Skeleton/components/Item.js +54 -0
  274. package/lib/Skeleton/components/List.js +27 -0
  275. package/lib/Skeleton/components/ListCard.js +28 -0
  276. package/lib/Skeleton/components/ListCardItem.js +20 -0
  277. package/lib/Skeleton/components/ListTable.js +27 -0
  278. package/lib/Skeleton/components/Page.js +26 -0
  279. package/lib/Skeleton/components/Search.js +16 -0
  280. package/lib/Skeleton/components/Tree.js +27 -0
  281. package/lib/Skeleton/index.js +28 -0
  282. package/lib/Skeleton/style/index.js +195 -0
  283. package/lib/TimeFormat/TimeFormat.js +36 -0
  284. package/lib/TimeFormat/index.js +7 -0
  285. package/lib/Title/Title.js +26 -0
  286. package/lib/Title/index.js +7 -0
  287. package/lib/Title/style/index.js +34 -0
  288. package/lib/ValueItem/ValueItem.js +113 -0
  289. package/lib/ValueItem/index.js +7 -0
  290. package/lib/ValueItem/util.js +17 -0
  291. package/lib/VirtualTable/VirtualTable.js +271 -0
  292. package/lib/VirtualTable/data.js +60 -0
  293. package/lib/VirtualTable/index.js +7 -0
  294. package/lib/VirtualTable/style/index.js +34 -0
  295. package/lib/components.js +21 -0
  296. package/lib/index.js +17 -0
  297. package/lib/locale/en-US.js +120 -0
  298. package/lib/locale/zh-CN.js +120 -0
  299. package/lib/style/styleRegister.js +19 -0
  300. package/lib/style/variable.js +4 -0
  301. package/lib/style.js +1 -0
  302. package/lib/utils/constants.js +10 -0
  303. package/package.json +164 -0
@@ -0,0 +1,354 @@
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, toRefs, unref } from 'vue'
3
+ import { withInstall } from 'ant-design-vue/es/_util/type'
4
+ import { Affix, Spin, PageHeader, Tabs, Button } from 'ant-design-vue'
5
+ import { pageHeaderProps } from 'ant-design-vue/es/page-header'
6
+ import { useRouteContext } from '../RouteContext'
7
+ import { getSlotVNode } from '../util'
8
+ import { LayoutType } from '../defaultSettings'
9
+ import { useLocaleReceiver } from '../../LocaleReciver'
10
+ import useProLayoutStyle from '../style'
11
+
12
+ export const pageHeaderTabConfig = {
13
+ /**
14
+ * @name tabs 的列表
15
+ */
16
+ tabList: {
17
+ type: [Object, Function, Array],
18
+ default: () => undefined
19
+ },
20
+ /**
21
+ * @name 当前选中 tab 的 key
22
+ */
23
+ tabActiveKey: String,
24
+ /**
25
+ * @name tab 上多余的区域
26
+ */
27
+ tabBarExtraContent: {
28
+ type: [Object, Function],
29
+ default: () => undefined
30
+ },
31
+ /**
32
+ * @name tabs 的其他配置
33
+ */
34
+ tabProps: {
35
+ type: Object,
36
+ default: () => undefined
37
+ },
38
+ /**
39
+ * @name 固定 PageHeader 到页面顶部
40
+ */
41
+ fixedHeader: Boolean,
42
+ // events
43
+ onTabChange: Function,
44
+ pure: Boolean
45
+ }
46
+
47
+ export const pageContainerProps = {
48
+ ...pageHeaderTabConfig,
49
+ ...pageHeaderProps,
50
+ prefixCls: {
51
+ type: String,
52
+ default: 'ant-pro'
53
+ },
54
+ title: {
55
+ type: [Object, String, Boolean, Function],
56
+ default: () => null
57
+ },
58
+ subTitle: {
59
+ type: [Object, String, Boolean, Function],
60
+ default: () => null
61
+ },
62
+ content: {
63
+ type: [Object, String, Boolean, Function],
64
+ default: () => null
65
+ },
66
+ extra: {
67
+ type: [Object, String, Boolean, Function],
68
+ default: () => null
69
+ },
70
+ extraContent: {
71
+ type: [Object, String, Boolean, Function],
72
+ default: () => null
73
+ },
74
+ header: {
75
+ type: [Object, String, Boolean, Function],
76
+ default: () => null
77
+ },
78
+ pageHeaderRender: {
79
+ type: [Object, Function, Boolean],
80
+ default: () => undefined
81
+ },
82
+ affixProps: {
83
+ type: [Object, Function]
84
+ },
85
+ ghost: {
86
+ type: Boolean,
87
+ default: () => false
88
+ },
89
+ loading: {
90
+ type: Boolean,
91
+ default: () => undefined
92
+ },
93
+ childrenFullHeight: {
94
+ type: Boolean,
95
+ default: () => true
96
+ },
97
+ pure: {
98
+ type: Boolean,
99
+ default: false
100
+ },
101
+ showBack: {
102
+ type: Boolean,
103
+ default: false
104
+ },
105
+ contentStyle: {
106
+ type: Object,
107
+ default: () => ({})
108
+ },
109
+ onBack: {
110
+ type: Function
111
+ }
112
+ }
113
+
114
+ const renderFooter = (props) => {
115
+ const {
116
+ tabList,
117
+ tabActiveKey,
118
+ onTabChange,
119
+ tabBarExtraContent,
120
+ tabProps
121
+ } = props
122
+
123
+ const tabPane = (item) => {
124
+ return React.createElement('span', { class: item.class || `tab-pane-${item.key}`,}, item.tab)
125
+ }
126
+
127
+ if (tabList && tabList.length) {
128
+ return (
129
+ React.createElement(Tabs, {
130
+ class: "page-container-tabs",
131
+ activeKey: tabActiveKey,
132
+ onChange: (key) => {
133
+ if (onTabChange) {
134
+ onTabChange(key)
135
+ }
136
+ },
137
+ tabBarExtraContent: tabBarExtraContent,
138
+ ...tabProps,}
139
+
140
+ , tabList.map((item) => (
141
+ React.createElement(Tabs.TabPane, {
142
+ ...item,
143
+ tab: tabPane(item),
144
+ key: item.key,}
145
+ )
146
+ ))
147
+ )
148
+ )
149
+ }
150
+ return null
151
+ }
152
+
153
+ const renderPageHeader = (content, extraContent, prefixedClassName) => {
154
+ if (!content && !extraContent) {
155
+ return null
156
+ }
157
+ return (
158
+ React.createElement('div', { class: `${prefixedClassName}-detail`,}
159
+ , React.createElement('div', { class: `${prefixedClassName}-main`,}
160
+ , React.createElement('div', { class: `${prefixedClassName}-row`,}
161
+ , content && (
162
+ React.createElement('div', { class: `${prefixedClassName}-content`,}
163
+ , typeof content === 'function' && content() || content
164
+ )
165
+ )
166
+ , extraContent && (
167
+ React.createElement('div', { class: `${prefixedClassName}-extraContent`,}
168
+ , typeof extraContent === 'function' && extraContent() || extraContent
169
+ )
170
+ )
171
+ )
172
+ )
173
+ )
174
+ )
175
+ }
176
+
177
+ const ProPageHeader = (props) => {
178
+ const {
179
+ title,
180
+ tabList,
181
+ tabActiveKey,
182
+ content,
183
+ pageHeaderRender,
184
+ header,
185
+ extraContent,
186
+ prefixedClassName,
187
+ prefixCls,
188
+ fixedHeader: _,
189
+ showBack,
190
+ onBack,
191
+ ...restProps
192
+ } = props
193
+
194
+ const value = useRouteContext()
195
+ const [contextLocale] = useLocaleReceiver('ProLayout')
196
+
197
+ if (pageHeaderRender === false) {
198
+ return null
199
+ }
200
+ if (pageHeaderRender) {
201
+ return pageHeaderRender({ ...props })
202
+ }
203
+
204
+ let pageHeaderTitle = title
205
+ if (!title && title !== false) {
206
+ pageHeaderTitle = (value ).title
207
+ }
208
+
209
+ const unrefBreadcrumb = unref((value ).breadcrumb || {})
210
+ const breadcrumb = props.breadcrumb || {
211
+ ...unrefBreadcrumb,
212
+ routes: unrefBreadcrumb.routes,
213
+ itemRender: unrefBreadcrumb.itemRender
214
+ }
215
+
216
+ const backProps = {}
217
+ if (showBack) {
218
+ // @ts-ignore
219
+ backProps.backIcon = React.createElement(Button, null, contextLocale.value.pageContainer.back)
220
+ backProps.onBack = () => {
221
+ if (props.onBack) {
222
+ props.onBack()
223
+ } else {
224
+ _optionalChain([(value ), 'access', _2 => _2.back, 'optionalCall', _3 => _3()])
225
+ }
226
+ }
227
+ }
228
+
229
+ const styles = (value ).layoutType === LayoutType.CARD
230
+ ? {
231
+ padding: props.extra || props.subTitle || pageHeaderTitle || tabList || props.extraContent || props.showBack || props.title
232
+ ? '16px 24px'
233
+ : '0px'
234
+ }
235
+ : {}
236
+
237
+ return (
238
+ React.createElement('div', { class: `${prefixedClassName}-wrap`,}
239
+ , React.createElement(PageHeader, {
240
+ style: styles,
241
+ ...backProps,
242
+ ...restProps,
243
+ title: pageHeaderTitle,
244
+ breadcrumb: (value ).layoutType === LayoutType.LIST ? breadcrumb : null,
245
+ footer: renderFooter({
246
+ ...restProps,
247
+ tabList,
248
+ tabActiveKey
249
+ }),
250
+ prefixCls: prefixCls,}
251
+
252
+ , header || renderPageHeader(content, extraContent, prefixedClassName)
253
+ )
254
+ )
255
+ )
256
+ }
257
+
258
+ const PageContainer = defineComponent({
259
+ name: 'JPageContainer',
260
+ inheritAttrs: false,
261
+ props: pageContainerProps ,
262
+ setup(props, { slots, attrs }) {
263
+ const {
264
+ loading,
265
+ affixProps,
266
+ ghost,
267
+ childrenFullHeight
268
+ } = toRefs(props)
269
+
270
+ const value = useRouteContext()
271
+ const getPrefixCls = (value ).getPrefixCls
272
+ const prefixCls = props.prefixCls || getPrefixCls()
273
+
274
+ const stylePrefixCls = computed(() => 'pro-layout')
275
+ const [wrapSSR, hashId] = useProLayoutStyle(stylePrefixCls)
276
+
277
+ const prefixedClassName = computed(() => `${prefixCls}-page-container`)
278
+
279
+ const classNames = computed(() => ({
280
+ [hashId.value]: true,
281
+ [prefixedClassName.value]: true,
282
+ [`${prefixCls}-page-container-ghost`]: ghost.value
283
+ }))
284
+
285
+ const headerDom = computed(() => {
286
+ // const tags = getSlotVNode<DefaultPropRender>(slots, props, 'tags');
287
+ const headerContent = getSlotVNode(slots, props, 'content')
288
+ const extra = getSlotVNode(slots, props, 'extra')
289
+ const extraContent = getSlotVNode(slots, props, 'extraContent')
290
+ const subTitle = getSlotVNode(slots, props, 'subTitle')
291
+ const title = getSlotVNode(slots, props, 'title')
292
+ // @ts-ignore
293
+ return (
294
+ React.createElement(ProPageHeader, {
295
+ ...props,
296
+ prefixCls: undefined,
297
+ prefixedClassName: prefixedClassName.value,
298
+ ghost: ghost.value,
299
+ title: title,
300
+ subTitle: subTitle,
301
+ content: headerContent,
302
+ extra: extra,
303
+ extraContent: extraContent,}
304
+ )
305
+ )
306
+ })
307
+
308
+ return () => {
309
+ const { fixedHeader, pure } = props
310
+
311
+ return (
312
+ React.createElement(React.Fragment, null
313
+ , pure ? (
314
+ React.createElement('div', { class: classNames.value,}
315
+ , _optionalChain([slots, 'access', _4 => _4.default, 'optionalCall', _5 => _5()])
316
+ )
317
+ ) : (
318
+ React.createElement('div', { class: classNames.value, style: { ...(attrs.style || {}) },}
319
+ , fixedHeader && headerDom.value ? (
320
+ React.createElement(Affix, {
321
+ ...affixProps.value,
322
+ offsetTop: (value ).hasHeader && (value ).fixedHeader ? (value ).headerHeight : 0,}
323
+
324
+ , headerDom.value
325
+ )
326
+ ) : (
327
+ headerDom.value
328
+ )
329
+ , React.createElement('div', { class: `${prefixedClassName.value}-grid-content`,}
330
+ , loading.value ? (
331
+ React.createElement(Spin, null )
332
+ ) : slots.default ? (
333
+ React.createElement('div', null
334
+ , React.createElement('div', {
335
+ class: `${prefixedClassName.value}-children-content ${childrenFullHeight.value ? 'children-full-height' : ''} ${hashId.value}`,
336
+ style: { ...(props.contentStyle || {}) },}
337
+
338
+ , slots.default()
339
+ )
340
+ , (value ).hasFooterToolbar && (
341
+ React.createElement('div', { style: { height: 48, marginTop: 24 },} )
342
+ )
343
+ )
344
+ ) : null
345
+ )
346
+ )
347
+ )
348
+ )
349
+ )
350
+ }
351
+ }
352
+ })
353
+
354
+ export default withInstall(PageContainer)
@@ -0,0 +1,85 @@
1
+ export const genPageContainerStyle = (config) => {
2
+ const { token } = config
3
+ const proLayoutPageContainerCls = `${token.antCls}-pro-page-container`
4
+
5
+ return {
6
+ [`${proLayoutPageContainerCls}-children-content`]: {
7
+ margin: '24px 24px 0'
8
+ },
9
+ [`${proLayoutPageContainerCls}`]: {
10
+ [`${proLayoutPageContainerCls}-warp`]: {
11
+ backgroundColor: token.colorBgContainer,
12
+ [`${token.antCls}-tabs-bar`]: {
13
+ margin: 0
14
+ }
15
+ },
16
+ [`${proLayoutPageContainerCls}-ghost`]: {
17
+ [`${proLayoutPageContainerCls}-warp`]: {
18
+ backgroundColor: token.colorBgContainer
19
+ }
20
+ }
21
+ },
22
+ [`${proLayoutPageContainerCls}-main`]: {
23
+ [`${proLayoutPageContainerCls}-detail`]: {
24
+ display: 'flex'
25
+ },
26
+ [`${proLayoutPageContainerCls}-row`]: {
27
+ display: 'flex',
28
+ width: '100%'
29
+ },
30
+ [`${proLayoutPageContainerCls}-title-content`]: {
31
+ marginBottom: '16px'
32
+ },
33
+ [`${proLayoutPageContainerCls}-title,${proLayoutPageContainerCls}-content`]: {
34
+ flex: 'auto'
35
+ },
36
+ [`${proLayoutPageContainerCls}-extraContent,${proLayoutPageContainerCls}-main`]: {
37
+ flex: '0 1 auto'
38
+ },
39
+ [`${proLayoutPageContainerCls}-title`]: {
40
+ marginBottom: '16px'
41
+ },
42
+ [`${proLayoutPageContainerCls}-logo`]: {
43
+ marginBottom: '16px'
44
+ },
45
+ [`${proLayoutPageContainerCls}-extraContent`]: {
46
+ minWidth: '242px',
47
+ marginLeft: '88px',
48
+ textAlign: 'right'
49
+ }
50
+ },
51
+ [`@media screen and (max-width: ${token.screenXl}px)`]: {
52
+ [`${proLayoutPageContainerCls}-main`]: {
53
+ [`${proLayoutPageContainerCls}-extraContent`]: {
54
+ marginLeft: '44px'
55
+ }
56
+ }
57
+ },
58
+ [`@media screen and (max-width: ${token.screenLG}px)`]: {
59
+ [`${proLayoutPageContainerCls}-main`]: {
60
+ [`${proLayoutPageContainerCls}-extraContent`]: {
61
+ marginLeft: '20px'
62
+ }
63
+ }
64
+ },
65
+ [`@media screen and (max-width: ${token.screenMD}px)`]: {
66
+ [`${proLayoutPageContainerCls}-main`]: {
67
+ [`${proLayoutPageContainerCls}-row`]: {
68
+ display: 'block'
69
+ },
70
+ [`${proLayoutPageContainerCls}-extraContent,${proLayoutPageContainerCls}-action`]: {
71
+ marginLeft: 0,
72
+ textAlign: 'left'
73
+ }
74
+ }
75
+ },
76
+ [`@media screen and (max-width: ${token.screenSM}px)`]: {
77
+ [`${proLayoutPageContainerCls}-detail`]: {
78
+ display: 'block'
79
+ },
80
+ [`${proLayoutPageContainerCls}-extraContent`]: {
81
+ marginLeft: 0
82
+ }
83
+ }
84
+ }
85
+ }
@@ -0,0 +1,28 @@
1
+ import { provide, reactive } from 'vue'
2
+ import { useContext } from '@meethive/hooks'
3
+
4
+ export const defaultPrefixCls = 'ant-pro'
5
+
6
+ export const getPrefixCls = (suffixCls, customizePrefixCls) => {
7
+ if (customizePrefixCls) return customizePrefixCls
8
+ return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls
9
+ }
10
+
11
+ export const defaultRouteContext = reactive({
12
+ getPrefixCls: getPrefixCls,
13
+ locale: (t) => {
14
+ return t
15
+ },
16
+ contentWidth: 'Fluid',
17
+ hasFooterToolbar: false
18
+ })
19
+
20
+ export const routeContextInjectKey = Symbol('jetlinks-route-context')
21
+
22
+ export const provideRouteContext = (value) => {
23
+ provide(routeContextInjectKey, value)
24
+ }
25
+
26
+ export const useRouteContext = () => {
27
+ return useContext(routeContextInjectKey, defaultRouteContext)
28
+ }
@@ -0,0 +1,241 @@
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, watchEffect, isVNode, resolveComponent, getCurrentInstance, withCtx, } from 'vue'
3
+ import { Menu } from 'ant-design-vue'
4
+ import { createFromIconfontCN } from '@ant-design/icons-vue'
5
+ import { defaultSettingProps } from '../defaultSettings'
6
+ import { defaultPrefixCls } from '../RouteContext'
7
+ import IconFont from '../../Icon'
8
+ import { regular } from '@meethive/utils'
9
+
10
+ let AntdIconFont = createFromIconfontCN({
11
+ scriptUrl: ''
12
+ })
13
+
14
+ const LazyIcon = (props) => {
15
+ const { icon, iconUrl, prefixCls = defaultPrefixCls } = props
16
+ if (!icon) return null
17
+ if (isVNode(icon)) {
18
+ return icon
19
+ }
20
+ if (typeof icon === 'string' && icon !== '') {
21
+ if (regular.isUrl(icon) || regular.isImg(icon)) {
22
+ return (
23
+ React.createElement('img', {
24
+ src: icon,
25
+ alt: "icon",
26
+ class: `${prefixCls}-sider-menu-icon`,}
27
+ )
28
+ )
29
+ }
30
+ return iconUrl
31
+ ? React.createElement(AntdIconFont, { type: icon,} )
32
+ : React.createElement(IconFont, { type: icon,} )
33
+ }
34
+ return null
35
+ }
36
+
37
+ export const baseMenuProps = {
38
+ ...defaultSettingProps,
39
+ prefixCls: {
40
+ type: String,
41
+ default: defaultPrefixCls
42
+ },
43
+ locale: {
44
+ type: [Function, Boolean],
45
+ default: (t) => t
46
+ },
47
+ menuData: {
48
+ type: Array,
49
+ default: () => []
50
+ },
51
+ mode: {
52
+ type: String,
53
+ default: 'inline'
54
+ },
55
+ theme: {
56
+ type: String,
57
+ default: 'dark'
58
+ },
59
+ collapsed: {
60
+ type: Boolean,
61
+ default: () => false
62
+ },
63
+ openKeys: {
64
+ type: Array,
65
+ default: () => undefined
66
+ },
67
+ selectedKeys: {
68
+ type: Array,
69
+ default: () => undefined
70
+ },
71
+ menuProps: {
72
+ type: Object,
73
+ default: () => null
74
+ },
75
+ menuItemRender: {
76
+ type: [Object, Function, Boolean],
77
+ default: () => undefined
78
+ },
79
+ subMenuItemRender: {
80
+ type: [Object, Function, Boolean],
81
+ default: () => undefined
82
+ },
83
+ onClick: [Function, Object]
84
+ }
85
+
86
+ // MenuUtil class for recursive menu rendering (matching ES source)
87
+ class MenuUtil {
88
+
89
+
90
+
91
+
92
+ constructor(_props, ctx) {;MenuUtil.prototype.__init.call(this);MenuUtil.prototype.__init2.call(this);MenuUtil.prototype.__init3.call(this);
93
+ this.props = _props
94
+ this.ctx = ctx
95
+ this.RouterLink = resolveComponent('router-link')
96
+ }
97
+
98
+ __init() {this.getNavMenuItems = (menusData = []) => {
99
+ return menusData.map((item) => this.getSubMenuOrItem(item)).filter((item) => item)
100
+ }}
101
+
102
+ __init2() {this.getSubMenuOrItem = (item) => {
103
+ if (
104
+ Array.isArray(item.children) &&
105
+ item.children.length > 0 &&
106
+ !_optionalChain([item, 'access', _27 => _27.meta, 'optionalAccess', _28 => _28.hideInMenu]) &&
107
+ !_optionalChain([item, 'access', _29 => _29.meta, 'optionalAccess', _30 => _30.hideChildrenInMenu])
108
+ ) {
109
+ if (this.props.subMenuItemRender) {
110
+ const subMenuItemRender = withCtx(this.props.subMenuItemRender, this.ctx)
111
+ return subMenuItemRender({
112
+ item,
113
+ children: this.getNavMenuItems(item.children)
114
+ })
115
+ }
116
+ const { prefixCls, locale } = this.props
117
+ const menuTitle = locale && locale(_optionalChain([item, 'access', _31 => _31.meta, 'optionalAccess', _32 => _32.title])) || _optionalChain([item, 'access', _33 => _33.meta, 'optionalAccess', _34 => _34.title])
118
+ const defaultTitle = _optionalChain([item, 'access', _35 => _35.meta, 'optionalAccess', _36 => _36.icon])
119
+ ? React.createElement('span', { class: `${prefixCls}-menu-item`,}
120
+ , React.createElement('span', { class: `${prefixCls}-menu-item-title`,}, menuTitle)
121
+ )
122
+ : React.createElement('span', { class: `${prefixCls}-menu-item`,}, menuTitle)
123
+
124
+ return (
125
+ React.createElement(Menu.SubMenu, {
126
+ title: defaultTitle,
127
+ key: item.key || item.path,
128
+ popupClassName: `${prefixCls}-menu-popup`,
129
+ icon: React.createElement(LazyIcon, { iconUrl: this.props.iconfontUrl, icon: _optionalChain([item, 'access', _37 => _37.meta, 'optionalAccess', _38 => _38.icon]),} ),}
130
+
131
+ , this.getNavMenuItems(item.children)
132
+ )
133
+ )
134
+ }
135
+
136
+ const menuItemRender = this.props.menuItemRender && withCtx(this.props.menuItemRender, this.ctx)
137
+ const [title, icon] = this.getMenuItem(item)
138
+
139
+ return (
140
+ menuItemRender &&
141
+ menuItemRender({
142
+ item,
143
+ title,
144
+ icon
145
+ })
146
+ ) || (
147
+ React.createElement(Menu.Item, {
148
+ disabled: _optionalChain([item, 'access', _39 => _39.meta, 'optionalAccess', _40 => _40.disabled]),
149
+ danger: _optionalChain([item, 'access', _41 => _41.meta, 'optionalAccess', _42 => _42.danger]),
150
+ key: item.key || item.path,}
151
+
152
+ , title
153
+ )
154
+ )
155
+ }}
156
+
157
+ __init3() {this.getMenuItem = (item) => {
158
+ const meta = { ...item.meta }
159
+ const target = meta.target || null
160
+ const hasUrl = regular.isUrl(item.path)
161
+ const CustomTag = (target && 'a') || this.RouterLink
162
+ const routerProps = {
163
+ to: {
164
+ name: item.name,
165
+ ...item.meta
166
+ }
167
+ }
168
+ const attrs = hasUrl || target ? {
169
+ ...item.meta,
170
+ href: item.path,
171
+ target: target
172
+ } : {}
173
+ const { prefixCls, locale } = this.props
174
+ const icon = _optionalChain([item, 'access', _43 => _43.meta, 'optionalAccess', _44 => _44.icon]) && (
175
+ React.createElement(LazyIcon, { iconUrl: this.props.iconfontUrl, icon: _optionalChain([item, 'access', _45 => _45.meta, 'optionalAccess', _46 => _46.icon]),} )
176
+ ) || undefined
177
+ const menuTitle = locale && locale(_optionalChain([item, 'access', _47 => _47.meta, 'optionalAccess', _48 => _48.title])) || _optionalChain([item, 'access', _49 => _49.meta, 'optionalAccess', _50 => _50.title])
178
+ const defaultTitle = _optionalChain([item, 'access', _51 => _51.meta, 'optionalAccess', _52 => _52.icon])
179
+ ? React.createElement(CustomTag, { ...attrs, ...routerProps, class: `${prefixCls}-menu-item`,}
180
+ , icon
181
+ , React.createElement('span', { class: `${prefixCls}-menu-item-title`,}, menuTitle)
182
+ )
183
+ : React.createElement(CustomTag, { ...attrs, ...routerProps, class: `${prefixCls}-menu-item`,}
184
+ , React.createElement('span', null, menuTitle)
185
+ )
186
+ return [defaultTitle, icon]
187
+ }}
188
+ }
189
+
190
+ export default defineComponent({
191
+ name: 'BaseMenu',
192
+ props: baseMenuProps ,
193
+ emits: ['update:openKeys', 'update:selectedKeys', 'click'],
194
+ setup(props, { emit }) {
195
+ const ctx = getCurrentInstance()
196
+ const menuUtil = new MenuUtil(props, ctx)
197
+
198
+ watchEffect(() => {
199
+ if (props.iconfontUrl) {
200
+ AntdIconFont = createFromIconfontCN({
201
+ scriptUrl: props.iconfontUrl
202
+ })
203
+ }
204
+ })
205
+
206
+ const handleOpenChange = (openKeys) => {
207
+ emit('update:openKeys', openKeys)
208
+ }
209
+
210
+ const handleSelect = (args) => {
211
+ // ignore https? link handle selectkeys
212
+ if (regular.isUrl(args.key)) {
213
+ return
214
+ }
215
+ emit('update:selectedKeys', args.selectedKeys)
216
+ }
217
+
218
+ const handleClick = (args) => {
219
+ emit('click', args)
220
+ }
221
+
222
+ return () => {
223
+ return (
224
+ React.createElement(Menu, {
225
+ key: "Menu",
226
+ inlineIndent: 16,
227
+ mode: props.mode,
228
+ theme: props.theme,
229
+ openKeys: props.openKeys === false ? [] : props.openKeys,
230
+ selectedKeys: props.selectedKeys || [],
231
+ onOpenChange: handleOpenChange,
232
+ onSelect: handleSelect,
233
+ onClick: handleClick,
234
+ ...props.menuProps,}
235
+
236
+ , menuUtil.getNavMenuItems(props.menuData)
237
+ )
238
+ )
239
+ }
240
+ }
241
+ })