@yueglobal/ui 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yueglobal/ui",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "粤链全球 - react组件库",
5
5
  "license": "MIT",
6
6
  "module": "index.js",
@@ -8,6 +8,7 @@
8
8
  height: 100%;
9
9
  width: 100%;
10
10
  border-bottom: none;
11
+ min-width: 0;
11
12
 
12
13
  & > li {
13
14
  display: flex;
@@ -133,6 +134,7 @@
133
134
  box-shadow: none;
134
135
  }
135
136
 
137
+ .ant-menu-submenu-title,
136
138
  .ant-menu-item {
137
139
  width: max-content;
138
140
  flex: unset;
@@ -169,6 +171,21 @@
169
171
  }
170
172
  }
171
173
 
174
+ .ant-menu-submenu {
175
+ border-radius: 0;
176
+
177
+ .ant-menu-submenu-title {
178
+ color: #fff;
179
+ height: 60px;
180
+
181
+ .ant-menu-submenu-arrow {
182
+ display: none;
183
+ }
184
+ }
185
+ }
186
+
187
+ .ant-menu-submenu-active,
188
+ .ant-menu-submenu-selected,
172
189
  .ant-menu-item-active,
173
190
  .ant-menu-item-selected {
174
191
  color: #fff !important;
@@ -85,9 +85,9 @@ export var firstMenuList = [{
85
85
  key: "".concat(mainHost, "/aboutus"),
86
86
  label: '关于我们'
87
87
  /*children: [
88
- { key: `${mainHost}/aboutus?key=1`, label: '企业宣传片' },
89
- { key: `${mainHost}/aboutus?key=2`, label: '企业宣传册' },
90
- { key: `${mainHost}/aboutus?key=3`, label: '企业资质' },
88
+ { key: `${mainHost}/aboutus/p1`, label: '企业宣传片' },
89
+ { key: `${mainHost}/aboutus/p2`, label: '企业宣传册' },
90
+ { key: `${mainHost}/aboutus/p3`, label: '企业资质' },
91
91
  ],*/
92
92
  }];
93
93
 
@@ -1,8 +1,14 @@
1
1
  var _excluded = ["width", "backgroundColor", "rightContent", "onLocaleChange", "pageTitle", "pageIcon", "activeLabel"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
- import React, { memo, useMemo } from 'react';
11
+ import React, { memo, useMemo, useState } from 'react';
6
12
  import logoImg from "../assets/gw-logo.png";
7
13
  import logoSvg from "../components/svg-icon/logo.svg";
8
14
  import FirstMenus from "./first-menus";
@@ -21,6 +27,10 @@ var Index = function Index(_ref) {
21
27
  pageIcon = _ref.pageIcon,
22
28
  activeLabel = _ref.activeLabel,
23
29
  props = _objectWithoutProperties(_ref, _excluded);
30
+ var _useState = useState('cn'),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ locale = _useState2[0],
33
+ setLocale = _useState2[1];
24
34
  var hasSecondMenu = useMemo(function () {
25
35
  var _props$breadcrumbs, _props$menuItems;
26
36
  return !!pageTitle || !!((_props$breadcrumbs = props.breadcrumbs) !== null && _props$breadcrumbs !== void 0 && _props$breadcrumbs.length) || !!((_props$menuItems = props.menuItems) !== null && _props$menuItems !== void 0 && _props$menuItems.length);
@@ -70,6 +80,10 @@ var Index = function Index(_ref) {
70
80
  key: key
71
81
  };
72
82
  }, [pageTitle, pageIcon, activeLabel]);
83
+ var onLocaleValueChange = function onLocaleValueChange(value) {
84
+ setLocale(value === null || value === void 0 ? void 0 : value.locale);
85
+ onLocaleChange === null || onLocaleChange === void 0 || onLocaleChange(value);
86
+ };
73
87
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
74
88
  style: {
75
89
  backgroundColor: backgroundColor,
@@ -101,12 +115,14 @@ var Index = function Index(_ref) {
101
115
  })), /*#__PURE__*/React.createElement("div", {
102
116
  className: "menus-bar"
103
117
  }, /*#__PURE__*/React.createElement(FirstMenus, {
118
+ key: locale,
104
119
  moduleData: moduleData,
105
120
  hasSecondMenu: hasSecondMenu
106
121
  })), /*#__PURE__*/React.createElement(RightContent, {
107
122
  content: rightContent,
108
- onLocaleChange: onLocaleChange
123
+ onLocaleChange: onLocaleValueChange
109
124
  })), hasSecondMenu && /*#__PURE__*/React.createElement(SecondMenus, _extends({
125
+ locale: locale,
110
126
  width: width,
111
127
  moduleData: moduleData
112
128
  }, props))));
@@ -7,6 +7,7 @@ interface Props extends Omit<YuePageHeaderProps, 'rightContent' | 'pageTitle' |
7
7
  icon?: ReactNode;
8
8
  key?: string;
9
9
  };
10
+ locale?: string;
10
11
  }
11
12
  declare const _default: React.NamedExoticComponent<Props>;
12
13
  export default _default;
@@ -24,7 +24,8 @@ var Index = function Index(_ref) {
24
24
  pathname = _ref.pathname,
25
25
  moduleData = _ref.moduleData,
26
26
  onRouteChange = _ref.onRouteChange,
27
- subMenuLayout = _ref.subMenuLayout;
27
+ subMenuLayout = _ref.subMenuLayout,
28
+ locale = _ref.locale;
28
29
  var _useState = useState(),
29
30
  _useState2 = _slicedToArray(_useState, 2),
30
31
  selectedKeys = _useState2[0],
@@ -151,6 +152,7 @@ var Index = function Index(_ref) {
151
152
  }, moduleData.title)), /*#__PURE__*/React.createElement("div", {
152
153
  className: "menus"
153
154
  }, /*#__PURE__*/React.createElement(Menu, {
155
+ key: locale,
154
156
  ref: menuRef,
155
157
  items: mergeMenuItems,
156
158
  mode: "horizontal",
@@ -19,6 +19,7 @@
19
19
  .left {
20
20
  gap: 8px;
21
21
  height: 100%;
22
+ min-width: 0;
22
23
  }
23
24
 
24
25
  .module-info {