@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 +31 -27
- package/README.md +7 -0
- package/Selector/index.js +2 -0
- package/Timeline/index.js +1 -1
- package/package.json +1 -1
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
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
298
|
-
|
|
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
|
-
|
|
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
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, {
|