@jetlinks-web/components 3.0.1-rc → 3.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 (286) hide show
  1. package/es/AutoComplete/AutoComplete.js +13 -9
  2. package/es/BadgeStatus/Badge.js +1 -2
  3. package/es/BadgeStatus/color.js +3 -3
  4. package/es/CardSelect/CardSelect.js +23 -13
  5. package/es/CardSelect/style/index.js +25 -1
  6. package/es/CheckButton/CheckButton.js +12 -4
  7. package/es/CheckButton/style/index.js +41 -1
  8. package/es/DragModal/DragModal.js +14 -8
  9. package/es/DragModal/style/index.js +64 -1
  10. package/es/EditTable/Body.js +10 -3
  11. package/es/EditTable/EditTable.js +13 -7
  12. package/es/EditTable/FormItem.js +18 -19
  13. package/es/EditTable/Header.js +16 -6
  14. package/es/EditTable/components/ContextMenu/Menu.js +11 -5
  15. package/es/EditTable/components/Search/search.js +1 -2
  16. package/es/EditTable/components/Search/sort.js +1 -3
  17. package/es/EditTable/group.js +23 -18
  18. package/es/EditTable/hooks/useValidate.js +1 -1
  19. package/es/EditTable/style/body.js +53 -0
  20. package/es/EditTable/style/form.js +24 -0
  21. package/es/EditTable/style/group.js +25 -0
  22. package/es/EditTable/style/header.js +58 -0
  23. package/es/EditTable/style/index.js +42 -1
  24. package/es/EditTable/style/menu.js +27 -0
  25. package/es/EditTable/style/table.js +46 -0
  26. package/es/EditTable/utils.js +30 -3
  27. package/es/Ellipsis/Ellipsis.js +10 -2
  28. package/es/Ellipsis/style/index.js +24 -1
  29. package/es/FullPage/FullPage.js +1 -2
  30. package/es/LocaleProvider/index.js +1 -2
  31. package/es/PermissionButton/index.js +6 -7
  32. package/es/ProLayout/Basic/BasicLayout.js +45 -41
  33. package/es/ProLayout/Basic/BasicLayoutStyle.js +39 -0
  34. package/es/ProLayout/Basic/Header.js +3 -7
  35. package/es/ProLayout/Basic/HeaderStyle.js +10 -0
  36. package/es/ProLayout/PageContainer/index.js +21 -17
  37. package/es/ProLayout/PageContainer/style.js +46 -0
  38. package/es/ProLayout/SiderMenu/BaseMenu.js +18 -42
  39. package/es/ProLayout/SiderMenu/SiderMenu.js +24 -36
  40. package/es/ProLayout/SiderMenu/style.js +166 -0
  41. package/es/ProLayout/TopHeader/index.js +13 -12
  42. package/es/ProLayout/TopHeader/style.js +126 -0
  43. package/es/ProLayout/style/index.js +7 -1
  44. package/es/ProLayout/util.js +5 -5
  45. package/es/ProTable/Alert.js +12 -4
  46. package/es/ProTable/Content.js +108 -28
  47. package/es/ProTable/Header.js +21 -11
  48. package/es/ProTable/Pagination.js +12 -4
  49. package/es/ProTable/ProTable.js +46 -34
  50. package/es/ProTable/hooks/index.js +2 -0
  51. package/es/ProTable/hooks/useTableInject.js +5 -0
  52. package/es/ProTable/hooks/useTableSelection.js +95 -0
  53. package/es/ProTable/setting.js +1 -1
  54. package/es/ProTable/style/index.js +109 -1
  55. package/es/RadioButton/RadioButton.js +10 -4
  56. package/es/RadioButton/style/index.js +23 -1
  57. package/es/Scrollbar/Scrollbar.js +10 -3
  58. package/es/Scrollbar/Thumb.js +36 -25
  59. package/es/Scrollbar/style/index.js +63 -1
  60. package/es/Search/Advanced/History.js +23 -16
  61. package/es/Search/Advanced/SaveHistory.js +1 -2
  62. package/es/Search/Advanced/index.js +212 -292
  63. package/es/Search/Item.js +175 -415
  64. package/es/Search/Search.js +78 -172
  65. package/es/Search/hooks/index.js +108 -1
  66. package/es/Search/hooks/useRouteQuery.js +57 -0
  67. package/es/Search/setting.js +132 -14
  68. package/es/Search/style/index.js +4 -2
  69. package/es/Search/style/item.js +28 -0
  70. package/es/Search/style/search.js +133 -0
  71. package/es/Search/util.js +116 -124
  72. package/es/Skeleton/components/DashBoardCard.js +19 -12
  73. package/es/Skeleton/components/DashBoardChart.js +48 -45
  74. package/es/Skeleton/components/Detail.js +27 -21
  75. package/es/Skeleton/components/Drawer.js +23 -14
  76. package/es/Skeleton/components/Item.js +9 -1
  77. package/es/Skeleton/components/List.js +0 -1
  78. package/es/Skeleton/components/ListCard.js +20 -13
  79. package/es/Skeleton/components/ListCardItem.js +12 -13
  80. package/es/Skeleton/components/ListTable.js +19 -10
  81. package/es/Skeleton/components/Page.js +0 -1
  82. package/es/Skeleton/components/Tree.js +21 -14
  83. package/es/Skeleton/skeleton.js +17 -8
  84. package/es/Skeleton/style/index.js +132 -1
  85. package/es/Title/style/index.js +29 -1
  86. package/es/Title/title.js +13 -5
  87. package/es/ValueItem/ValueItem.js +44 -39
  88. package/es/components.js +1 -5
  89. package/es/locale/en-US.js +3 -7
  90. package/es/locale/zh-CN.js +3 -7
  91. package/es/style/index.js +0 -3
  92. package/es/style/styleRegister.js +21 -0
  93. package/es/style/variable.js +4 -0
  94. package/es/style.js +0 -13
  95. package/lib/AutoComplete/AutoComplete.js +13 -9
  96. package/lib/BadgeStatus/Badge.js +1 -2
  97. package/lib/BadgeStatus/color.js +3 -3
  98. package/lib/CardSelect/CardSelect.js +23 -13
  99. package/lib/CardSelect/style/index.js +30 -1
  100. package/lib/CheckButton/CheckButton.js +12 -4
  101. package/lib/CheckButton/style/index.js +46 -1
  102. package/lib/DragModal/DragModal.js +14 -8
  103. package/lib/DragModal/style/index.js +69 -1
  104. package/lib/EditTable/Body.js +10 -3
  105. package/lib/EditTable/EditTable.js +13 -7
  106. package/lib/EditTable/FormItem.js +18 -19
  107. package/lib/EditTable/Header.js +16 -6
  108. package/lib/EditTable/components/ContextMenu/Menu.js +11 -5
  109. package/lib/EditTable/components/Search/search.js +1 -2
  110. package/lib/EditTable/components/Search/sort.js +1 -3
  111. package/lib/EditTable/group.js +23 -18
  112. package/lib/EditTable/hooks/useValidate.js +1 -1
  113. package/lib/EditTable/style/body.js +60 -0
  114. package/lib/EditTable/style/form.js +31 -0
  115. package/lib/EditTable/style/group.js +32 -0
  116. package/lib/EditTable/style/header.js +65 -0
  117. package/lib/EditTable/style/index.js +47 -1
  118. package/lib/EditTable/style/menu.js +33 -0
  119. package/lib/EditTable/style/table.js +52 -0
  120. package/lib/EditTable/utils.js +31 -3
  121. package/lib/Ellipsis/Ellipsis.js +10 -2
  122. package/lib/Ellipsis/style/index.js +29 -1
  123. package/lib/FullPage/FullPage.js +1 -2
  124. package/lib/Icon/icon.js +1 -2
  125. package/lib/LocaleProvider/index.js +1 -2
  126. package/lib/PermissionButton/index.js +6 -7
  127. package/lib/ProLayout/Basic/BasicLayout.js +45 -42
  128. package/lib/ProLayout/Basic/BasicLayoutStyle.js +46 -0
  129. package/lib/ProLayout/Basic/Header.js +2 -6
  130. package/lib/ProLayout/Basic/HeaderStyle.js +17 -0
  131. package/lib/ProLayout/PageContainer/index.js +19 -15
  132. package/lib/ProLayout/PageContainer/style.js +53 -0
  133. package/lib/ProLayout/SiderMenu/BaseMenu.js +19 -42
  134. package/lib/ProLayout/SiderMenu/SiderMenu.js +24 -37
  135. package/lib/ProLayout/SiderMenu/style.js +173 -0
  136. package/lib/ProLayout/TopHeader/index.js +14 -12
  137. package/lib/ProLayout/TopHeader/style.js +133 -0
  138. package/lib/ProLayout/style/index.js +12 -1
  139. package/lib/ProLayout/util.js +5 -5
  140. package/lib/ProTable/Alert.js +12 -4
  141. package/lib/ProTable/Content.js +108 -28
  142. package/lib/ProTable/Header.js +21 -11
  143. package/lib/ProTable/Pagination.js +12 -4
  144. package/lib/ProTable/ProTable.js +46 -34
  145. package/lib/ProTable/hooks/index.js +27 -0
  146. package/lib/ProTable/hooks/useTableInject.js +11 -0
  147. package/lib/ProTable/hooks/useTableSelection.js +102 -0
  148. package/lib/ProTable/setting.js +1 -1
  149. package/lib/ProTable/style/index.js +114 -1
  150. package/lib/RadioButton/RadioButton.js +10 -4
  151. package/lib/RadioButton/style/index.js +28 -1
  152. package/lib/Scrollbar/Scrollbar.js +10 -3
  153. package/lib/Scrollbar/Thumb.js +36 -25
  154. package/lib/Scrollbar/style/index.js +68 -1
  155. package/lib/Search/Advanced/History.js +23 -16
  156. package/lib/Search/Advanced/SaveHistory.js +1 -2
  157. package/lib/Search/Advanced/index.js +212 -292
  158. package/lib/Search/Item.js +175 -415
  159. package/lib/Search/Search.js +78 -172
  160. package/lib/Search/hooks/index.js +130 -1
  161. package/lib/Search/hooks/useRouteQuery.js +64 -0
  162. package/lib/Search/setting.js +133 -15
  163. package/lib/Search/style/index.js +9 -2
  164. package/lib/Search/style/item.js +35 -0
  165. package/lib/Search/style/search.js +140 -0
  166. package/lib/Search/util.js +116 -124
  167. package/lib/Skeleton/components/DashBoardCard.js +19 -12
  168. package/lib/Skeleton/components/DashBoardChart.js +48 -45
  169. package/lib/Skeleton/components/Detail.js +27 -21
  170. package/lib/Skeleton/components/Drawer.js +23 -14
  171. package/lib/Skeleton/components/Item.js +9 -1
  172. package/lib/Skeleton/components/List.js +0 -1
  173. package/lib/Skeleton/components/ListCard.js +20 -13
  174. package/lib/Skeleton/components/ListCardItem.js +12 -13
  175. package/lib/Skeleton/components/ListTable.js +19 -10
  176. package/lib/Skeleton/components/Page.js +0 -1
  177. package/lib/Skeleton/components/Tree.js +21 -14
  178. package/lib/Skeleton/skeleton.js +17 -8
  179. package/lib/Skeleton/style/index.js +137 -1
  180. package/lib/Title/style/index.js +34 -1
  181. package/lib/Title/title.js +13 -5
  182. package/lib/ValueItem/ValueItem.js +44 -39
  183. package/lib/components.js +1 -30
  184. package/lib/index.js +1 -2
  185. package/lib/locale/en-US.js +3 -7
  186. package/lib/locale/zh-CN.js +3 -7
  187. package/lib/style/components.less +0 -1
  188. package/lib/style/index.js +1 -4
  189. package/lib/style/styleRegister.js +28 -0
  190. package/lib/style/variable.js +10 -0
  191. package/lib/style.js +1 -15
  192. package/package.json +170 -173
  193. package/es/AMap/Map.js +0 -133
  194. package/es/AMap/index.js +0 -5
  195. package/es/AMap/util.js +0 -56
  196. package/es/CardSelect/style/index.css +0 -24
  197. package/es/CardSelect/style/index.less +0 -26
  198. package/es/CheckButton/style/index.css +0 -37
  199. package/es/CheckButton/style/index.less +0 -40
  200. package/es/DragModal/style/index.css +0 -82
  201. package/es/DragModal/style/index.less +0 -97
  202. package/es/Echarts/Echarts.js +0 -48
  203. package/es/Echarts/index.js +0 -5
  204. package/es/EditTable/style/body.less +0 -66
  205. package/es/EditTable/style/form.less +0 -33
  206. package/es/EditTable/style/group.less +0 -32
  207. package/es/EditTable/style/header.less +0 -77
  208. package/es/EditTable/style/index.css +0 -267
  209. package/es/EditTable/style/index.less +0 -41
  210. package/es/EditTable/style/menu.less +0 -25
  211. package/es/EditTable/style/table.less +0 -47
  212. package/es/Ellipsis/style/index.css +0 -17
  213. package/es/Ellipsis/style/index.less +0 -20
  214. package/es/FlameGraph/FlameGraph.js +0 -136
  215. package/es/FlameGraph/index.js +0 -5
  216. package/es/FlameGraph/style/index.css +0 -43
  217. package/es/FlameGraph/style/index.js +0 -1
  218. package/es/FlameGraph/style/index.less +0 -52
  219. package/es/ProLayout/Basic/BasicLayout.less +0 -66
  220. package/es/ProLayout/Basic/Header.less +0 -8
  221. package/es/ProLayout/PageContainer/index.less +0 -103
  222. package/es/ProLayout/SiderMenu/index.less +0 -231
  223. package/es/ProLayout/TopHeader/index.less +0 -174
  224. package/es/ProLayout/style/default.less +0 -4
  225. package/es/ProLayout/style/style.less +0 -7
  226. package/es/ProTable/style/ProTable.less +0 -139
  227. package/es/RadioButton/style/index.css +0 -20
  228. package/es/RadioButton/style/index.less +0 -19
  229. package/es/Scrollbar/style/index.css +0 -65
  230. package/es/Scrollbar/style/index.less +0 -83
  231. package/es/Search/style/Item.less +0 -33
  232. package/es/Search/style/Search.less +0 -179
  233. package/es/Skeleton/style/Skeleton.less +0 -166
  234. package/es/Title/style/index.css +0 -27
  235. package/es/Title/style/index.less +0 -27
  236. package/es/style/index.css +0 -5375
  237. package/es/style/index.less +0 -14
  238. package/es/style/variable.css +0 -4
  239. package/es/style/variable.less +0 -4
  240. package/lib/AMap/Map.js +0 -133
  241. package/lib/AMap/index.js +0 -12
  242. package/lib/AMap/util.js +0 -62
  243. package/lib/CardSelect/style/index.css +0 -24
  244. package/lib/CardSelect/style/index.less +0 -26
  245. package/lib/CheckButton/style/index.css +0 -37
  246. package/lib/CheckButton/style/index.less +0 -40
  247. package/lib/DragModal/style/index.css +0 -82
  248. package/lib/DragModal/style/index.less +0 -97
  249. package/lib/Echarts/Echarts.js +0 -48
  250. package/lib/Echarts/index.js +0 -12
  251. package/lib/EditTable/style/body.less +0 -66
  252. package/lib/EditTable/style/form.less +0 -33
  253. package/lib/EditTable/style/group.less +0 -32
  254. package/lib/EditTable/style/header.less +0 -77
  255. package/lib/EditTable/style/index.css +0 -267
  256. package/lib/EditTable/style/index.less +0 -41
  257. package/lib/EditTable/style/menu.less +0 -25
  258. package/lib/EditTable/style/table.less +0 -47
  259. package/lib/Ellipsis/style/index.css +0 -17
  260. package/lib/Ellipsis/style/index.less +0 -20
  261. package/lib/FlameGraph/FlameGraph.js +0 -136
  262. package/lib/FlameGraph/index.js +0 -12
  263. package/lib/FlameGraph/style/index.css +0 -43
  264. package/lib/FlameGraph/style/index.js +0 -3
  265. package/lib/FlameGraph/style/index.less +0 -52
  266. package/lib/ProLayout/Basic/BasicLayout.less +0 -66
  267. package/lib/ProLayout/Basic/Header.less +0 -8
  268. package/lib/ProLayout/PageContainer/index.less +0 -103
  269. package/lib/ProLayout/SiderMenu/index.less +0 -231
  270. package/lib/ProLayout/TopHeader/index.less +0 -174
  271. package/lib/ProLayout/style/default.less +0 -4
  272. package/lib/ProLayout/style/style.less +0 -7
  273. package/lib/ProTable/style/ProTable.less +0 -139
  274. package/lib/RadioButton/style/index.css +0 -20
  275. package/lib/RadioButton/style/index.less +0 -19
  276. package/lib/Scrollbar/style/index.css +0 -65
  277. package/lib/Scrollbar/style/index.less +0 -83
  278. package/lib/Search/style/Item.less +0 -33
  279. package/lib/Search/style/Search.less +0 -179
  280. package/lib/Skeleton/style/Skeleton.less +0 -166
  281. package/lib/Title/style/index.css +0 -27
  282. package/lib/Title/style/index.less +0 -27
  283. package/lib/style/index.css +0 -5375
  284. package/lib/style/index.less +0 -14
  285. package/lib/style/variable.css +0 -4
  286. package/lib/style/variable.less +0 -4
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.baseMenuProps = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- var _vue = require("vue");
10
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+ var _vue = require("vue");
13
13
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
14
14
  var _defaultSettings = require("../defaultSettings");
15
15
  var _RouteContext = require("../RouteContext");
@@ -17,10 +17,6 @@ var _Icon = _interopRequireDefault(require("../../Icon"));
17
17
  var _utils = require("@jetlinks-web/utils");
18
18
  var _antDesignVue = require("ant-design-vue");
19
19
  var _iconsVue = require("@ant-design/icons-vue/lib/icons");
20
- require("ant-design-vue/es/_util/vue-types");
21
- function _isSlot(s) {
22
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0, _vue.isVNode)(s);
23
- }
24
20
  var baseMenuProps = exports.baseMenuProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _defaultSettings.defaultSettingProps), {}, {
25
21
  prefixCls: {
26
22
  type: String,
@@ -124,8 +120,7 @@ var MenuUtil = /*#__PURE__*/(0, _createClass2.default)(function MenuUtil(_props,
124
120
  });
125
121
  (0, _defineProperty2.default)(this, "getSubMenuOrItem", function (item) {
126
122
  var _item$meta, _item$meta2, _item$meta7, _item$meta8;
127
- if (Array.isArray(item.children) && item.children.length > 0 && !(item === null || item === void 0 ? void 0 : (_item$meta = item.meta) === null || _item$meta === void 0 ? void 0 : _item$meta.hideInMenu) && !(item === null || item === void 0 ? void 0 : (_item$meta2 = item.meta) === null || _item$meta2 === void 0 ? void 0 : _item$meta2.hideChildrenInMenu)) {
128
- var _slot;
123
+ if (Array.isArray(item.children) && item.children.length > 0 && !(item !== null && item !== void 0 && (_item$meta = item.meta) !== null && _item$meta !== void 0 && _item$meta.hideInMenu) && !(item !== null && item !== void 0 && (_item$meta2 = item.meta) !== null && _item$meta2 !== void 0 && _item$meta2.hideChildrenInMenu)) {
129
124
  var _item$meta3, _item$meta4, _item$meta5, _item$meta6;
130
125
  if (_this.props.subMenuItemRender) {
131
126
  var subMenuItemRender = (0, _vue.withCtx)(_this.props.subMenuItemRender, _this.ctx);
@@ -138,32 +133,24 @@ var MenuUtil = /*#__PURE__*/(0, _createClass2.default)(function MenuUtil(_props,
138
133
  prefixCls = _this$props.prefixCls,
139
134
  locale = _this$props.locale;
140
135
  var menuTitle = locale && locale((_item$meta3 = item.meta) === null || _item$meta3 === void 0 ? void 0 : _item$meta3.title) || ((_item$meta4 = item.meta) === null || _item$meta4 === void 0 ? void 0 : _item$meta4.title);
141
- var defaultTitle = ((_item$meta5 = item.meta) === null || _item$meta5 === void 0 ? void 0 : _item$meta5.icon) ? (0, _vue.createVNode)("span", {
136
+ var defaultTitle = (_item$meta5 = item.meta) !== null && _item$meta5 !== void 0 && _item$meta5.icon ? (0, _vue.createVNode)("span", {
142
137
  "class": "".concat(prefixCls, "-menu-item")
143
138
  }, [(0, _vue.createVNode)("span", {
144
139
  "class": "".concat(prefixCls, "-menu-item-title")
145
- }, _isSlot(menuTitle) ? menuTitle : {
146
- default: function _default() {
147
- return [menuTitle];
148
- }
149
- })]) : (0, _vue.createVNode)("span", {
140
+ }, [menuTitle])]) : (0, _vue.createVNode)("span", {
150
141
  "class": "".concat(prefixCls, "-menu-item")
151
- }, _isSlot(menuTitle) ? menuTitle : {
152
- default: function _default() {
153
- return [menuTitle];
154
- }
155
- });
142
+ }, [menuTitle]);
156
143
  return (0, _vue.createVNode)(_antDesignVue.Menu.SubMenu, {
157
144
  "title": defaultTitle,
158
- "key": item.path,
145
+ "key": item.key || item.path,
159
146
  "popupClassName": "".concat(prefixCls, "-menu-popup"),
160
147
  "icon": (0, _vue.createVNode)(LazyIcon, {
161
148
  "iconUrl": _this.props.iconfontUrl,
162
149
  "icon": (_item$meta6 = item.meta) === null || _item$meta6 === void 0 ? void 0 : _item$meta6.icon
163
150
  }, null)
164
- }, _isSlot(_slot = _this.getNavMenuItems(item.children)) ? _slot : {
151
+ }, {
165
152
  default: function _default() {
166
- return [_slot];
153
+ return [_this.getNavMenuItems(item.children)];
167
154
  }
168
155
  });
169
156
  }
@@ -179,16 +166,15 @@ var MenuUtil = /*#__PURE__*/(0, _createClass2.default)(function MenuUtil(_props,
179
166
  }) || (0, _vue.createVNode)(_antDesignVue.Menu.Item, {
180
167
  "disabled": (_item$meta7 = item.meta) === null || _item$meta7 === void 0 ? void 0 : _item$meta7.disabled,
181
168
  "danger": (_item$meta8 = item.meta) === null || _item$meta8 === void 0 ? void 0 : _item$meta8.danger,
182
- "key": item.path
183
- }, _isSlot(title) ? title : {
169
+ "key": item.key || item.path
170
+ }, {
184
171
  default: function _default() {
185
172
  return [title];
186
173
  }
187
174
  });
188
175
  });
189
176
  (0, _defineProperty2.default)(this, "getMenuItem", function (item) {
190
- var _slot2;
191
- var _item$meta9, _item$meta10, _item$meta11, _item$meta12, _item$meta13;
177
+ var _item$meta9, _item$meta0, _item$meta1, _item$meta10, _item$meta11;
192
178
  var meta = (0, _objectSpread2.default)({}, item.meta);
193
179
  var target = meta.target || null;
194
180
  var hasUrl = _utils.regular.isUrl(item.path);
@@ -207,30 +193,22 @@ var MenuUtil = /*#__PURE__*/(0, _createClass2.default)(function MenuUtil(_props,
207
193
  locale = _this$props2.locale;
208
194
  var icon = ((_item$meta9 = item.meta) === null || _item$meta9 === void 0 ? void 0 : _item$meta9.icon) && (0, _vue.createVNode)(LazyIcon, {
209
195
  "iconUrl": _this.props.iconfontUrl,
210
- "icon": (_item$meta10 = item.meta) === null || _item$meta10 === void 0 ? void 0 : _item$meta10.icon
196
+ "icon": (_item$meta0 = item.meta) === null || _item$meta0 === void 0 ? void 0 : _item$meta0.icon
211
197
  }, null) || undefined;
212
- var menuTitle = locale && locale((_item$meta11 = item.meta) === null || _item$meta11 === void 0 ? void 0 : _item$meta11.title) || ((_item$meta12 = item.meta) === null || _item$meta12 === void 0 ? void 0 : _item$meta12.title);
213
- var defaultTitle = ((_item$meta13 = item.meta) === null || _item$meta13 === void 0 ? void 0 : _item$meta13.icon) ? (0, _vue.createVNode)(CustomTag, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, attrs), props), {}, {
198
+ var menuTitle = locale && locale((_item$meta1 = item.meta) === null || _item$meta1 === void 0 ? void 0 : _item$meta1.title) || ((_item$meta10 = item.meta) === null || _item$meta10 === void 0 ? void 0 : _item$meta10.title);
199
+ var defaultTitle = (_item$meta11 = item.meta) !== null && _item$meta11 !== void 0 && _item$meta11.icon ? (0, _vue.createVNode)(CustomTag, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, attrs), props), {}, {
214
200
  "class": "".concat(prefixCls, "-menu-item")
215
201
  }), {
216
202
  default: function _default() {
217
203
  return [icon, (0, _vue.createVNode)("span", {
218
204
  "class": "".concat(prefixCls, "-menu-item-title")
219
- }, _isSlot(menuTitle) ? menuTitle : {
220
- default: function _default() {
221
- return [menuTitle];
222
- }
223
- })];
205
+ }, [menuTitle])];
224
206
  }
225
207
  }) : (0, _vue.createVNode)(CustomTag, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, attrs), props), {}, {
226
208
  "class": "".concat(prefixCls, "-menu-item")
227
- }), _isSlot(_slot2 = (0, _vue.createVNode)("span", null, _isSlot(menuTitle) ? menuTitle : {
228
- default: function _default() {
229
- return [menuTitle];
230
- }
231
- })) ? _slot2 : {
209
+ }), {
232
210
  default: function _default() {
233
- return [_slot2];
211
+ return [(0, _vue.createVNode)("span", null, [menuTitle])];
234
212
  }
235
213
  });
236
214
  return [defaultTitle, icon];
@@ -268,7 +246,6 @@ var _default2 = exports.default = (0, _vue.defineComponent)({
268
246
  emit('click', args);
269
247
  };
270
248
  return function () {
271
- var _slot3;
272
249
  return (0, _vue.createVNode)(_antDesignVue.Menu, (0, _objectSpread2.default)({
273
250
  "key": "Menu",
274
251
  "inlineIndent": 16,
@@ -279,9 +256,9 @@ var _default2 = exports.default = (0, _vue.defineComponent)({
279
256
  "onOpenChange": handleOpenChange,
280
257
  "onSelect": handleSelect,
281
258
  "onClick": handleClick
282
- }, props.menuProps), _isSlot(_slot3 = menuUtil.getNavMenuItems(props.menuData)) ? _slot3 : {
259
+ }, props.menuProps), {
283
260
  default: function _default() {
284
- return [_slot3];
261
+ return [menuUtil.getNavMenuItems(props.menuData)];
285
262
  }
286
263
  });
287
264
  };
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.siderMenuProps = exports.defaultRenderLogoAndTitle = exports.defaultRenderLogo = exports.defaultRenderCollapsedButton = exports.default = void 0;
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
12
  var _vue = require("vue");
12
13
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
13
14
  var _antDesignVue = require("ant-design-vue");
@@ -17,11 +18,8 @@ var _vueTypes = _interopRequireDefault(require("ant-design-vue/es/_util/vue-type
17
18
  var _Icon = _interopRequireDefault(require("../../Icon"));
18
19
  var _RouteContext = require("../RouteContext");
19
20
  require("../typings");
20
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
- function _isSlot(s) {
23
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0, _vue.isVNode)(s);
24
- }
21
+ var _style = _interopRequireDefault(require("../style"));
22
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
25
23
  var siderMenuProps = exports.siderMenuProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _defaultSettings.defaultSettingProps), _BaseMenu.baseMenuProps), {}, {
26
24
  logo: {
27
25
  type: [Object, String, Function],
@@ -154,11 +152,7 @@ var defaultRenderLogoAndTitle = exports.defaultRenderLogoAndTitle = function def
154
152
  if (layout === 'mix' && renderFunction === false) {
155
153
  return null;
156
154
  }
157
- var titleDom = (0, _vue.createVNode)("h1", null, _isSlot(title) ? title : {
158
- default: function _default() {
159
- return [title];
160
- }
161
- });
155
+ var titleDom = (0, _vue.createVNode)("h1", null, [title]);
162
156
  if (renderKey === 'menuHeaderRender') {
163
157
  return null;
164
158
  }
@@ -168,11 +162,7 @@ var defaultRenderLogoAndTitle = exports.defaultRenderLogoAndTitle = function def
168
162
  return renderFunction(logoDom, props.collapsed ? null : titleDom, props);
169
163
  }
170
164
  if (Array.isArray(renderFunction)) {
171
- return (0, _vue.createVNode)(_vue.Fragment, null, _isSlot(renderFunction) ? renderFunction : {
172
- default: function _default() {
173
- return [renderFunction];
174
- }
175
- });
165
+ return (0, _vue.createVNode)(_vue.Fragment, null, [renderFunction]);
176
166
  }
177
167
  return (0, _vue.createVNode)("a", null, [logoDom, props.collapsed ? null : titleDom]);
178
168
  };
@@ -184,7 +174,6 @@ var defaultRenderCollapsedButton = exports.defaultRenderCollapsedButton = functi
184
174
  }, null);
185
175
  };
186
176
  var SiderMenu = function SiderMenu(props) {
187
- var _slot;
188
177
  var collapsed = props.collapsed,
189
178
  siderWidth = props.siderWidth,
190
179
  breakpoint = props.breakpoint,
@@ -198,6 +187,13 @@ var SiderMenu = function SiderMenu(props) {
198
187
  collapsedButtonRender = _props$collapsedButto === void 0 ? defaultRenderCollapsedButton : _props$collapsedButto,
199
188
  linksRender = props.linksRender,
200
189
  theme = props.theme;
190
+ var prefixCls = (0, _vue.computed)(function () {
191
+ return 'pro-layout';
192
+ });
193
+ var _useProLayoutStyle = (0, _style.default)(prefixCls),
194
+ _useProLayoutStyle2 = (0, _slicedToArray2.default)(_useProLayoutStyle, 2),
195
+ wrapSSR = _useProLayoutStyle2[0],
196
+ hashId = _useProLayoutStyle2[1];
201
197
  var context = (0, _RouteContext.useRouteContext)();
202
198
  var getPrefixCls = context.getPrefixCls;
203
199
  var baseClassName = getPrefixCls('sider');
@@ -208,7 +204,7 @@ var SiderMenu = function SiderMenu(props) {
208
204
  return props.collapsed ? props.collapsedWidth : props.siderWidth;
209
205
  });
210
206
  var classNames = (0, _vue.computed)(function () {
211
- return (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, baseClassName, true), "".concat(baseClassName, "-fixed"), context.fixSiderbar), "".concat(baseClassName, "-").concat(theme), true), "".concat(baseClassName, "-layout-").concat(props.layout), props.layout);
207
+ return (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, baseClassName, true), "".concat(baseClassName, "-fixed"), context.fixSiderbar), "".concat(baseClassName, "-").concat(theme), true), "".concat(baseClassName, "-layout-").concat(props.layout), props.layout), hashId.value, true);
212
208
  });
213
209
  var logCls = (0, _vue.computed)(function () {
214
210
  return (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(baseClassName, "-logo"), true), "".concat(baseClassName, "-logo-card"), props.layoutType === _defaultSettings.LayoutType.CARD);
@@ -251,7 +247,6 @@ var SiderMenu = function SiderMenu(props) {
251
247
  },
252
248
  'onUpdate:selectedKeys': handleSelect
253
249
  }, null);
254
- console.log('context', context.fixSiderbar);
255
250
  return (0, _vue.createVNode)(_vue.Fragment, null, [context.fixSiderbar && (0, _vue.createVNode)("div", {
256
251
  "style": {
257
252
  width: "".concat(sSideWidth.value, "px"),
@@ -286,17 +281,9 @@ var SiderMenu = function SiderMenu(props) {
286
281
  "onClick": props.layout !== 'mix' ? props.onMenuHeaderClick : undefined,
287
282
  "id": "logo",
288
283
  "style": props === null || props === void 0 ? void 0 : props.logoStyle
289
- }, _isSlot(headerDom) ? headerDom : {
290
- default: function _default() {
291
- return [headerDom];
292
- }
293
- }), extraDom && (0, _vue.createVNode)("div", {
284
+ }, [headerDom]), extraDom && (0, _vue.createVNode)("div", {
294
285
  "class": (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(baseClassName, "-extra"), true), "".concat(baseClassName, "-extra-no-logo"), !headerDom)
295
- }, _isSlot(extraDom) ? extraDom : {
296
- default: function _default() {
297
- return [extraDom];
298
- }
299
- }), (0, _vue.createVNode)("div", {
286
+ }, [extraDom]), (0, _vue.createVNode)("div", {
300
287
  "class": "".concat(baseClassName, "-body"),
301
288
  "style": "flex: 1; overflow: hidden auto;"
302
289
  }, [props.layoutType !== _defaultSettings.LayoutType.CARD ? menuContentRender && menuContentRender(props, defaultMenuDom) || defaultMenuDom : null]), (0, _vue.createVNode)("div", {
@@ -313,17 +300,17 @@ var SiderMenu = function SiderMenu(props) {
313
300
  props.onCollapse(!props.collapsed);
314
301
  }
315
302
  }
316
- }, _isSlot(_slot = (0, _vue.createVNode)(_antDesignVue.Menu.Item, {
317
- "key": 'collapsed-button',
318
- "class": "".concat(baseClassName, "-collapsed-button"),
319
- "title": false
320
303
  }, {
321
304
  default: function _default() {
322
- return [collapsedButtonRender && typeof collapsedButtonRender === 'function' ? collapsedButtonRender(collapsed) : collapsedButtonRender];
323
- }
324
- })) ? _slot : {
325
- default: function _default() {
326
- return [_slot];
305
+ return [(0, _vue.createVNode)(_antDesignVue.Menu.Item, {
306
+ "key": 'collapsed-button',
307
+ "class": "".concat(baseClassName, "-collapsed-button"),
308
+ "title": false
309
+ }, {
310
+ default: function _default() {
311
+ return [collapsedButtonRender && typeof collapsedButtonRender === 'function' ? collapsedButtonRender(collapsed) : collapsedButtonRender];
312
+ }
313
+ })];
327
314
  }
328
315
  }) : null])];
329
316
  }
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.genSiderMenuStyle = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _antDesignVue = require("ant-design-vue");
10
+ var genSiderMenuStyle = exports.genSiderMenuStyle = function genSiderMenuStyle(config) {
11
+ var _$concat8;
12
+ var token = config.token;
13
+ var proLayoutSiderMenuCls = "".concat(token.antCls, "-pro-sider");
14
+ var proLayoutHeaderHeight = '48px';
15
+ var proLayoutTitleHideKeyframes = new _antDesignVue.Keyframes('pro-layout-title-hide', {
16
+ '0%': {
17
+ display: 'none',
18
+ opacity: 0
19
+ },
20
+ '80%': {
21
+ display: 'none',
22
+ opacity: 0
23
+ },
24
+ '100%': {
25
+ display: 'unset',
26
+ opacity: 1
27
+ }
28
+ });
29
+ return (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(proLayoutSiderMenuCls), (_$concat8 = {
30
+ position: 'relative',
31
+ backgroundColor: '#001529',
32
+ borderRight: 0,
33
+ // FIXME: 临时修正(可能不会做兼容)
34
+ zIndex: 20
35
+ }, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_$concat8, "".concat(token.antCls, "-menu"), {
36
+ background: 'transparent'
37
+ }), "&".concat(token.antCls, "-layout-sider-light"), (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(token.antCls, "-menu-item a"), {
38
+ color: token.colorTextHeading
39
+ }), "".concat(token.antCls, "-menu-item-selected a, ").concat(token.antCls, "-menu-item a:hover"), {
40
+ color: token.colorPrimary
41
+ })), "".concat(proLayoutSiderMenuCls, "-logo"), {
42
+ position: 'relative',
43
+ display: 'flex',
44
+ alignItems: 'center',
45
+ padding: '16px 16px',
46
+ cursor: 'pointer',
47
+ transition: 'padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)',
48
+ '> a': {
49
+ display: 'flex',
50
+ alignItems: 'center',
51
+ justifyContent: 'center',
52
+ minHeight: 32
53
+ },
54
+ 'img': {
55
+ display: 'inline-block',
56
+ height: 32,
57
+ verticalAlign: 'middle'
58
+ },
59
+ 'h1': {
60
+ display: 'inline-block',
61
+ height: '32px',
62
+ margin: '0 0 0 12px',
63
+ color: 'white',
64
+ fontWeight: 600,
65
+ fontSize: '18px',
66
+ lineHeight: '32px',
67
+ verticalAlign: 'middle',
68
+ animationName: proLayoutTitleHideKeyframes,
69
+ animationDuration: '0.3s'
70
+ }
71
+ }), "".concat(proLayoutSiderMenuCls, "-logo-card"), {
72
+ padding: '16px 0',
73
+ justifyContent: 'center'
74
+ }), "".concat(proLayoutSiderMenuCls, "-extra"), (0, _defineProperty2.default)({
75
+ marginBottom: '16px',
76
+ padding: '0 16px'
77
+ }, "".concat(proLayoutSiderMenuCls, "-extra-no-logo"), {
78
+ marginTop: '16px'
79
+ })), "".concat(proLayoutSiderMenuCls, "-menu"), {
80
+ position: 'relative',
81
+ zIndex: 10,
82
+ minHeight: '100%',
83
+ boxShadow: '2px 0 6px rgba(0, 21, 41, 0.35)'
84
+ }), "".concat(token.antCls, "-layout-sider-children"), {
85
+ display: 'flex',
86
+ flexDirection: 'column',
87
+ height: '100%',
88
+ '::-webkit-scrollbar': {
89
+ width: '6px',
90
+ height: '6px'
91
+ },
92
+ '::webkit-scrollbar-track': {
93
+ background: 'rgba(255, 255, 255, 0.15)',
94
+ borderRadius: '3px',
95
+ boxShadow: 'inset 0 0 5px rgba(37, 37, 37, 0.05)'
96
+ },
97
+ /* 滚动条滑块 */
98
+ '::-webkit-scrollbar-thumb': {
99
+ background: 'rgba(255, 255, 255, 0.2)',
100
+ borderRadius: '3px',
101
+ boxShadow: 'inset 0 0 5px rgba(255, 255, 255, 0.05)'
102
+ }
103
+ }), "&".concat(token.antCls, "-layout-sider-collapsed"), (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(token.antCls, "-menu-inline-collapsed"), {
104
+ width: '48px'
105
+ }), "".concat(proLayoutSiderMenuCls), (0, _defineProperty2.default)({}, "".concat(proLayoutSiderMenuCls, "-logo"), {
106
+ padding: '16px 24px'
107
+ }))), "&".concat(token.antCls, "-layout-sider").concat(proLayoutSiderMenuCls, "-fixed"), (0, _defineProperty2.default)({
108
+ position: 'fixed',
109
+ top: 0,
110
+ left: 0,
111
+ zIndex: 99,
112
+ height: '100%',
113
+ overflow: 'auto',
114
+ overflowX: 'hidden',
115
+ boxShadow: '2px 0 8px 0 rgba(29, 35, 41, 0.05)'
116
+ }, "> ".concat(token.antCls, "-menu-root"), (0, _defineProperty2.default)({}, ":not".concat(proLayoutSiderMenuCls, "-link-menu"), {
117
+ height: "calc(100vh - ".concat(proLayoutHeaderHeight, ")"),
118
+ overflowY: 'auto'
119
+ }))), "".concat(proLayoutSiderMenuCls, "-light"), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
120
+ backgroundColor: token.colorBgContainer,
121
+ boxShadow: '2px 0 8px 0 rgba(29, 35, 41, 0.05)'
122
+ }, "".concat(token.antCls, "-layout-sider-children"), {
123
+ '::webkit-scrollbar-track': {
124
+ background: 'rgba(0, 0, 0, 0.06)',
125
+ borderRadius: '3px',
126
+ boxShadow: 'inset 0 0 5px rgba(0, 21, 41, 0.05)',
127
+ /* 滚动条滑块 */
128
+ '::-webkit-scrollbar-thumb': {
129
+ background: 'rgba(0, 0, 0, 0.12)',
130
+ borderRadius: '3px',
131
+ boxShadow: 'inset 0 0 5px rgba(0, 21, 41, 0.05)'
132
+ }
133
+ }
134
+ }), "".concat(proLayoutSiderMenuCls, "-logo"), {
135
+ 'h1': {
136
+ color: token.colorPrimary
137
+ }
138
+ }), "".concat(token.antCls, "-menu-light"), {
139
+ borderRightColor: 'transparent'
140
+ }), "".concat(proLayoutSiderMenuCls, "-collapsed-button"), {
141
+ borderTop: "".concat(token.lineWidth, " solid ").concat(token.colorSplit)
142
+ })), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_$concat8, "".concat(proLayoutSiderMenuCls, "-icon"), {
143
+ width: '14px',
144
+ verticalAlign: 'baseline'
145
+ }), "".concat(proLayoutSiderMenuCls, "-link"), (0, _defineProperty2.default)({
146
+ width: '100%'
147
+ }, "ul".concat(token.antCls, "-menu-root"), {
148
+ height: 'auto'
149
+ })), "".concat(proLayoutSiderMenuCls, "-collapsed-button"), {
150
+ borderTop: "".concat(token.lineWidth, " solid rgba(0, 0, 0, 0.25)"),
151
+ '.anticon': {
152
+ fontSize: '16px'
153
+ }
154
+ }), ".top-nav-menu li".concat(token.antCls, "-menu-item"), {
155
+ height: '100%',
156
+ lineHeight: 1
157
+ }), '.drawer .drawer-content', {
158
+ background: "#001529"
159
+ }))), "".concat(token.antCls, "-pro-menu-item"), (0, _defineProperty2.default)({}, ".anticon".concat(token.antCls, "-pro-menu-item-title"), {
160
+ marginLeft: '10px'
161
+ })), '.sider-app-menus', {
162
+ width: '100px',
163
+ backgroundColor: '#fff',
164
+ cursor: 'pointer',
165
+ padding: '6px',
166
+ transition: 'all .3s',
167
+ borderRadius: '4px',
168
+ color: '#333',
169
+ '&:hover': {
170
+ backgroundColor: '#efefef'
171
+ }
172
+ });
173
+ };
@@ -5,21 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.topNavHeaderProps = exports.baseHeaderProps = exports.TopNavHeader = void 0;
8
- var _vue = require("vue");
9
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _vue = require("vue");
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
12
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
12
- var _vcResizeObserver = _interopRequireDefault(require("ant-design-vue/es/vc-resize-observer"));
13
+ var _vcResizeObserver = _interopRequireDefault(require("ant-design-vue/lib/vc-resize-observer"));
13
14
  var _SiderMenu = require("../SiderMenu/SiderMenu");
14
- var _vueTypes = _interopRequireDefault(require("ant-design-vue/es/_util/vue-types"));
15
+ var _vueTypes = _interopRequireDefault(require("ant-design-vue/lib/_util/vue-types"));
15
16
  var _defaultSettings = require("../defaultSettings");
16
17
  var _RouteContext = require("../RouteContext");
17
18
  var _BaseMenu = _interopRequireDefault(require("../SiderMenu/BaseMenu"));
18
19
  var _util = require("../util");
20
+ var _style = _interopRequireDefault(require("../style"));
19
21
  var _excluded = ["rightContentRender"];
20
- function _isSlot(s) {
21
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0, _vue.isVNode)(s);
22
- }
23
22
  var baseHeaderProps = exports.baseHeaderProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _defaultSettings.defaultSettingProps), {}, {
24
23
  prefixCls: _vueTypes.default.string.def('ant-pro'),
25
24
  collapsed: _vueTypes.default.looseBool,
@@ -104,6 +103,13 @@ var TopNavHeader = exports.TopNavHeader = function TopNavHeader(props) {
104
103
  mode = props.mode;
105
104
  var context = (0, _RouteContext.useRouteContext)();
106
105
  var prefixCls = "".concat(propPrefixCls || _RouteContext.defaultPrefixCls, "-top-nav-header");
106
+ var stylePrefixCls = (0, _vue.computed)(function () {
107
+ return 'pro-layout';
108
+ });
109
+ var _useProLayoutStyle = (0, _style.default)(stylePrefixCls),
110
+ _useProLayoutStyle2 = (0, _slicedToArray2.default)(_useProLayoutStyle, 2),
111
+ wrapSSR = _useProLayoutStyle2[0],
112
+ hashId = _useProLayoutStyle2[1];
107
113
  var headerDom = (0, _SiderMenu.defaultRenderLogoAndTitle)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
108
114
  collapsed: false
109
115
  }),
@@ -126,7 +132,7 @@ var TopNavHeader = exports.TopNavHeader = function TopNavHeader(props) {
126
132
  return props.layout === 'mix' && props.splitMenus ? 'horizontal' : mode;
127
133
  });
128
134
  var className = (0, _vue.computed)(function () {
129
- return (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, prefixCls, true), "light", props.theme === 'light'), "dark", props.theme === 'dark');
135
+ return (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, prefixCls, true), hashId.value, true), "light", props.theme === 'light'), "dark", props.theme === 'dark');
130
136
  });
131
137
  var paddingLeft = (0, _vue.computed)(function () {
132
138
  return context.layoutType === _defaultSettings.LayoutType.PAD && props.collapsed ? context.headerLeftWidth + 'px' : 0;
@@ -146,11 +152,7 @@ var TopNavHeader = exports.TopNavHeader = function TopNavHeader(props) {
146
152
  "class": "".concat(prefixCls, "-logo"),
147
153
  "key": "logo",
148
154
  "id": "logo"
149
- }, _isSlot(headerDom) ? headerDom : {
150
- default: function _default() {
151
- return [headerDom];
152
- }
153
- })]), (0, _vue.createVNode)("div", {
155
+ }, [headerDom])]), (0, _vue.createVNode)("div", {
154
156
  "style": {
155
157
  flex: 1
156
158
  },
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.genTopHeaderStyle = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var genTopHeaderStyle = exports.genTopHeaderStyle = function genTopHeaderStyle(config) {
10
+ var token = config.token;
11
+ var topNavHeaderCls = "".concat(token.antCls, "-pro-top-nav-header");
12
+ var proLayoutGlobalHeaderCls = "".concat(token.antCls, "-pro-global-header");
13
+ var proLayoutHeaderBg = token.colorBgContainer;
14
+ var proLayoutHeaderHoverBg = token.colorBgContainer;
15
+ var proLayoutHeaderBoxShadow = '0 1px 4px rgba(0, 21, 41, 0.08)';
16
+ return (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, proLayoutGlobalHeaderCls, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
17
+ position: 'relative',
18
+ display: 'flex',
19
+ alignItems: 'center',
20
+ height: '100%',
21
+ padding: '0 16px',
22
+ backgroundColor: proLayoutHeaderBg,
23
+ boxShadow: proLayoutHeaderBoxShadow,
24
+ '> *': {
25
+ height: '100%'
26
+ }
27
+ }, "".concat(proLayoutGlobalHeaderCls, "-coppapsed-button"), {
28
+ display: 'flex',
29
+ alignItems: 'center',
30
+ marginLeft: '16px',
31
+ fontSize: '20px'
32
+ }), "".concat(proLayoutGlobalHeaderCls, "-layout"), (0, _defineProperty2.default)({}, "".concat(proLayoutGlobalHeaderCls, "-layout-mix"), (0, _defineProperty2.default)((0, _defineProperty2.default)({
33
+ backgroundColor: '#001529'
34
+ }, "".concat(proLayoutGlobalHeaderCls, "-logo"), {
35
+ 'h1': {
36
+ color: '#fff'
37
+ }
38
+ }), '.anticon', {
39
+ color: '#fff'
40
+ }))), "".concat(proLayoutGlobalHeaderCls, "-logo"), {
41
+ position: 'relative',
42
+ overflow: 'hidden',
43
+ a: {
44
+ display: 'flex',
45
+ alignItems: 'center',
46
+ height: '100%',
47
+ img: {
48
+ height: '28px'
49
+ },
50
+ h1: {
51
+ height: '32px',
52
+ margin: '0 0 0 12px',
53
+ color: token.colorPrimary,
54
+ fontWeight: 600,
55
+ fontSize: '18px',
56
+ lineHeight: '32px'
57
+ }
58
+ }
59
+ }), "".concat(proLayoutGlobalHeaderCls, "-menu"), (0, _defineProperty2.default)({
60
+ '.anticon': {
61
+ marginRight: '8px'
62
+ }
63
+ }, "".concat(token.antCls, "-dropdown-menu-item"), {
64
+ minWidth: '160px'
65
+ })), '.dark', {
66
+ height: '48px',
67
+ '.action': (0, _defineProperty2.default)({
68
+ color: 'rgba(255, 255, 255, 0.85)',
69
+ '> i': {
70
+ color: 'rgba(255, 255, 255, 0.85)'
71
+ },
72
+ '&:hover,&.opend': {
73
+ background: token.colorPrimary
74
+ }
75
+ }, "".concat(token.antCls, "-badge"), {
76
+ color: 'rgba(255, 255, 255, 0.85)'
77
+ })
78
+ })), topNavHeaderCls, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
79
+ position: 'relative',
80
+ width: '100%',
81
+ height: '100%',
82
+ boxShadow: '0 1px 4px 0 rgba(0, 21, 41, 0.12)',
83
+ transition: 'background 0.3s, width 0.2s'
84
+ }, "".concat(token.antCls, "-menu"), {
85
+ backgroundColor: 'transparent'
86
+ }), '&.light', (0, _defineProperty2.default)((0, _defineProperty2.default)({
87
+ backgroundColor: token.colorBgContainer
88
+ }, "".concat(topNavHeaderCls, "-logo"), {
89
+ h1: {
90
+ color: token.colorTextHeading
91
+ }
92
+ }), '.anticon', {
93
+ color: 'inherit'
94
+ })), "".concat(topNavHeaderCls, "-main"), (0, _defineProperty2.default)({
95
+ display: 'flex',
96
+ height: '100%',
97
+ paddingLeft: '16px'
98
+ }, "".concat(topNavHeaderCls, "-main-left"), {
99
+ display: 'flex',
100
+ minWidth: '192px'
101
+ })), '.anticon', {
102
+ color: '#fff'
103
+ }), "".concat(topNavHeaderCls, "-logo"), {
104
+ position: 'relative',
105
+ minWidth: '165px',
106
+ height: '100%',
107
+ overflow: 'hidden',
108
+ img: {
109
+ display: 'inline-block',
110
+ height: '32px',
111
+ verticalAlign: 'middle'
112
+ },
113
+ h1: {
114
+ display: 'inline-block',
115
+ margin: '0 0 0 12px',
116
+ color: token.colorPrimary,
117
+ fontWeight: 600,
118
+ fontSize: '16px',
119
+ verticalAlign: 'top'
120
+ }
121
+ }), "".concat(topNavHeaderCls, "-menu"), (0, _defineProperty2.default)({
122
+ minWidth: 0
123
+ }, "".concat(token.antCls, "-menu").concat(token.antCls, "-meu-horizontal"), (0, _defineProperty2.default)({
124
+ height: '100%',
125
+ border: 'none'
126
+ }, "".concat(token.antCls, "-menu-item"), (0, _defineProperty2.default)({
127
+ height: '100%'
128
+ }, "".concat(token.antCls, "-badge"), {
129
+ color: 'unset'
130
+ }))))), "".concat(token.antCls, "-pro-menu-popup"), (0, _defineProperty2.default)({}, "".concat(token.antCls, "-badge"), {
131
+ color: 'unset'
132
+ }));
133
+ };