@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,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
+ })