@para-ui/core 3.0.30 → 3.0.31

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/Menu/index.js CHANGED
@@ -266,6 +266,7 @@ var MenuItemPopper = function MenuItemPopper(props) {
266
266
  return function () {
267
267
  clearTimeout(timerJson.leaveBox);
268
268
  clearTimeout(timerJson.closeTimer);
269
+ clearTimeout(timerJson.styleTimer);
269
270
  };
270
271
  }, []);
271
272
  useEffect(function () {
@@ -275,35 +276,38 @@ var MenuItemPopper = function MenuItemPopper(props) {
275
276
  * 设置定位样式
276
277
  * */
277
278
  var handPosStyle = function handPosStyle() {
278
- if (anchorEl && open && boxRef.current) {
279
- // 定位容器
280
- var anchorElDom = document.querySelector("[data-menu-id=".concat(anchorEl, "]"));
281
- var reactDom = anchorElDom.getBoundingClientRect();
282
- var top = reactDom.top;
283
- // 不是第一级的弹窗向上便宜8px
284
- if (level !== 1) {
285
- top = top - 8;
286
- }
287
- // 第一级,且只有一级
288
- if (handTooltip()) {
289
- top = top + 4;
290
- }
291
- var bodyHeight = document.body.clientHeight;
292
- var selfHeight = boxRef.current.clientHeight;
293
- if (selfHeight + top > bodyHeight) {
294
- top = top - (selfHeight + top - bodyHeight) - 20; // 多减20的余量
295
- }
279
+ clearTimeout(timerJson.styleTimer);
280
+ timerJson.styleTimer = setTimeout(function () {
281
+ if (anchorEl && open && boxRef.current) {
282
+ // 定位容器
283
+ var anchorElDom = document.querySelector("[data-menu-id=".concat(anchorEl, "]"));
284
+ var reactDom = anchorElDom.getBoundingClientRect();
285
+ var top = reactDom.top;
286
+ // 不是第一级的弹窗向上便宜8px
287
+ if (level !== 1) {
288
+ top = top - 8;
289
+ }
290
+ // 第一级,且只有一级
291
+ if (handTooltip()) {
292
+ top = top + 4;
293
+ }
294
+ var bodyHeight = document.body.clientHeight;
295
+ var selfHeight = boxRef.current.clientHeight;
296
+ if (selfHeight + top > bodyHeight) {
297
+ top = top - (selfHeight + top - bodyHeight) - 20; // 多减20的余量
298
+ }
296
299
 
297
- if (top < 0) {
298
- top = 0;
300
+ if (top < 0) {
301
+ top = 0;
302
+ }
303
+ setPosStyle({
304
+ position: 'absolute',
305
+ left: '0',
306
+ top: '0',
307
+ transform: "translate3d(".concat(reactDom.right, "px, ").concat(top, "px, 0px)")
308
+ });
299
309
  }
300
- setPosStyle({
301
- position: 'absolute',
302
- left: '0',
303
- top: '0',
304
- transform: "translate3d(".concat(reactDom.right, "px, ").concat(top, "px, 0px)")
305
- });
306
- }
310
+ });
307
311
  };
308
312
  /**
309
313
  * 判断是否是第一级,且没有子级
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 版本: 3.0.31
2
+
3
+ para-ui/core@3.0.31 发布
4
+ 【菜单-Menu】修复菜单收缩以后,展开显示不全问题
5
+ 【选择器-Selector】可自定义详情按钮
6
+ 【时间轴-Timeline】TimelineItem添加key
7
+
1
8
  ## 版本: 3.0.30
2
9
 
3
10
  para-ui/core@3.0.30 发布
package/Selector/index.js CHANGED
@@ -593,6 +593,7 @@ var SelectorMainContent = function SelectorMainContent(props) {
593
593
  }));
594
594
  };
595
595
  }
596
+ if (item.detail !== undefined) json.detail = item.detail;
596
597
  return json;
597
598
  };
598
599
  /** 渲染list节点 */
@@ -1018,6 +1019,7 @@ var SelectorData = function SelectorData(props) {
1018
1019
  }));
1019
1020
  };
1020
1021
  }
1022
+ if (item.detail !== undefined) json.detail = item.detail;
1021
1023
  /** 是否具有删除 */
1022
1024
  if (item.close !== undefined) json.close = item.close;
1023
1025
  return json;
package/Timeline/index.js CHANGED
@@ -134,7 +134,7 @@ var Timeline = function Timeline(props) {
134
134
  className: clsx([className, _defineProperty({}, "".concat($rcPrefixCls, "-timeline-item-disabled"), disabled), !reverse && !!pending ? pendingClass : readyClass, getPositionCls(null, idx)])
135
135
  }, {
136
136
  children: content
137
- }));
137
+ }), idx);
138
138
  });
139
139
  };
140
140
  return jsx("ul", Object.assign({}, restProps, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@para-ui/core",
3
3
  "private": false,
4
- "version": "3.0.30",
4
+ "version": "3.0.31",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "description": "Powered by Para FED",