@rc-component/trigger 1.13.5 → 1.13.6

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.
@@ -379,36 +379,36 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
379
379
  var numShiftX = shiftX === true ? 0 : shiftX;
380
380
  if (typeof numShiftX === 'number') {
381
381
  // Left
382
- if (nextPopupX < visibleArea.left) {
383
- nextOffsetX -= nextPopupX - visibleArea.left;
384
- if (targetRect.x + targetWidth < visibleArea.left + numShiftX) {
385
- nextOffsetX += targetRect.x - visibleArea.left + targetWidth - numShiftX;
382
+ if (nextPopupX < visibleRegionArea.left) {
383
+ nextOffsetX -= nextPopupX - visibleRegionArea.left;
384
+ if (targetRect.x + targetWidth < visibleRegionArea.left + numShiftX) {
385
+ nextOffsetX += targetRect.x - visibleRegionArea.left + targetWidth - numShiftX;
386
386
  }
387
387
  }
388
388
 
389
389
  // Right
390
- if (nextPopupRight > visibleArea.right) {
391
- nextOffsetX -= nextPopupRight - visibleArea.right;
392
- if (targetRect.x > visibleArea.right - numShiftX) {
393
- nextOffsetX += targetRect.x - visibleArea.right + numShiftX;
390
+ if (nextPopupRight > visibleRegionArea.right) {
391
+ nextOffsetX -= nextPopupRight - visibleRegionArea.right;
392
+ if (targetRect.x > visibleRegionArea.right - numShiftX) {
393
+ nextOffsetX += targetRect.x - visibleRegionArea.right + numShiftX;
394
394
  }
395
395
  }
396
396
  }
397
397
  var numShiftY = shiftY === true ? 0 : shiftY;
398
398
  if (typeof numShiftY === 'number') {
399
399
  // Top
400
- if (nextPopupY < visibleArea.top) {
401
- nextOffsetY -= nextPopupY - visibleArea.top;
402
- if (targetRect.y + targetHeight < visibleArea.top + numShiftY) {
403
- nextOffsetY += targetRect.y - visibleArea.top + targetHeight - numShiftY;
400
+ if (nextPopupY < visibleRegionArea.top) {
401
+ nextOffsetY -= nextPopupY - visibleRegionArea.top;
402
+ if (targetRect.y + targetHeight < visibleRegionArea.top + numShiftY) {
403
+ nextOffsetY += targetRect.y - visibleRegionArea.top + targetHeight - numShiftY;
404
404
  }
405
405
  }
406
406
 
407
407
  // Bottom
408
- if (nextPopupBottom > visibleArea.bottom) {
409
- nextOffsetY -= nextPopupBottom - visibleArea.bottom;
410
- if (targetRect.y > visibleArea.bottom - numShiftY) {
411
- nextOffsetY += targetRect.y - visibleArea.bottom + numShiftY;
408
+ if (nextPopupBottom > visibleRegionArea.bottom) {
409
+ nextOffsetY -= nextPopupBottom - visibleRegionArea.bottom;
410
+ if (targetRect.y > visibleRegionArea.bottom - numShiftY) {
411
+ nextOffsetY += targetRect.y - visibleRegionArea.bottom + numShiftY;
412
412
  }
413
413
  }
414
414
  }
@@ -387,36 +387,36 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
387
387
  var numShiftX = shiftX === true ? 0 : shiftX;
388
388
  if (typeof numShiftX === 'number') {
389
389
  // Left
390
- if (nextPopupX < visibleArea.left) {
391
- nextOffsetX -= nextPopupX - visibleArea.left;
392
- if (targetRect.x + targetWidth < visibleArea.left + numShiftX) {
393
- nextOffsetX += targetRect.x - visibleArea.left + targetWidth - numShiftX;
390
+ if (nextPopupX < visibleRegionArea.left) {
391
+ nextOffsetX -= nextPopupX - visibleRegionArea.left;
392
+ if (targetRect.x + targetWidth < visibleRegionArea.left + numShiftX) {
393
+ nextOffsetX += targetRect.x - visibleRegionArea.left + targetWidth - numShiftX;
394
394
  }
395
395
  }
396
396
 
397
397
  // Right
398
- if (nextPopupRight > visibleArea.right) {
399
- nextOffsetX -= nextPopupRight - visibleArea.right;
400
- if (targetRect.x > visibleArea.right - numShiftX) {
401
- nextOffsetX += targetRect.x - visibleArea.right + numShiftX;
398
+ if (nextPopupRight > visibleRegionArea.right) {
399
+ nextOffsetX -= nextPopupRight - visibleRegionArea.right;
400
+ if (targetRect.x > visibleRegionArea.right - numShiftX) {
401
+ nextOffsetX += targetRect.x - visibleRegionArea.right + numShiftX;
402
402
  }
403
403
  }
404
404
  }
405
405
  var numShiftY = shiftY === true ? 0 : shiftY;
406
406
  if (typeof numShiftY === 'number') {
407
407
  // Top
408
- if (nextPopupY < visibleArea.top) {
409
- nextOffsetY -= nextPopupY - visibleArea.top;
410
- if (targetRect.y + targetHeight < visibleArea.top + numShiftY) {
411
- nextOffsetY += targetRect.y - visibleArea.top + targetHeight - numShiftY;
408
+ if (nextPopupY < visibleRegionArea.top) {
409
+ nextOffsetY -= nextPopupY - visibleRegionArea.top;
410
+ if (targetRect.y + targetHeight < visibleRegionArea.top + numShiftY) {
411
+ nextOffsetY += targetRect.y - visibleRegionArea.top + targetHeight - numShiftY;
412
412
  }
413
413
  }
414
414
 
415
415
  // Bottom
416
- if (nextPopupBottom > visibleArea.bottom) {
417
- nextOffsetY -= nextPopupBottom - visibleArea.bottom;
418
- if (targetRect.y > visibleArea.bottom - numShiftY) {
419
- nextOffsetY += targetRect.y - visibleArea.bottom + numShiftY;
416
+ if (nextPopupBottom > visibleRegionArea.bottom) {
417
+ nextOffsetY -= nextPopupBottom - visibleRegionArea.bottom;
418
+ if (targetRect.y > visibleRegionArea.bottom - numShiftY) {
419
+ nextOffsetY += targetRect.y - visibleRegionArea.bottom + numShiftY;
420
420
  }
421
421
  }
422
422
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "1.13.5",
3
+ "version": "1.13.6",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"