@zhenliang/sheet 0.1.7-3.beta.11 → 0.1.7-3.beta.12

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.
@@ -8,9 +8,9 @@ export var Remark = /*#__PURE__*/forwardRef(function (props, ref) {
8
8
  var rightOverflow = document.body.clientWidth - position.left < 400;
9
9
  var bottomOverflow = document.body.clientHeight - position.top < 400;
10
10
  if (rightOverflow && bottomOverflow) {
11
- return "translate(-100%, -100%)";
11
+ return "translate(calc(-100% - 4px), calc(-100% - 4px))";
12
12
  } else if (rightOverflow && !bottomOverflow) {
13
- return "translate(-100%, 40px)";
13
+ return "translate(calc(-100% - 4px), 44px)";
14
14
  } else if (!rightOverflow && bottomOverflow) {
15
15
  return "translate(0, calc(40px - 100%))";
16
16
  }
@@ -390,6 +390,7 @@ span.harvest-sheet-container:focus {
390
390
  padding: 0;
391
391
  background: rgb(255,255,255);
392
392
  box-shadow: 0 4px 8px rgba(216,223,235,.5);
393
+ transition: top .1s linear,left .1s linear,transform .05s linear;
393
394
  }
394
395
  .harvest-remark-container::-webkit-scrollbar{
395
396
  display: none;
@@ -63,6 +63,17 @@ export var useRemarkContainer = function useRemarkContainer(elementRef, start, e
63
63
  useEffect(function () {
64
64
  var _elementRef$current, _elementRef$current2;
65
65
  var remarkScroll = throttle(function () {
66
+ var _ref = elementRef.current || {},
67
+ _ref$scrollTop = _ref.scrollTop,
68
+ scrollTop = _ref$scrollTop === void 0 ? 0 : _ref$scrollTop,
69
+ _ref$scrollHeight = _ref.scrollHeight,
70
+ scrollHeight = _ref$scrollHeight === void 0 ? 0 : _ref$scrollHeight,
71
+ _ref$clientHeight = _ref.clientHeight,
72
+ clientHeight = _ref$clientHeight === void 0 ? 0 : _ref$clientHeight;
73
+ // 滚动条抖动导致的
74
+ if (Math.abs(clientHeight + scrollTop - scrollHeight) <= 1) {
75
+ return;
76
+ }
66
77
  setRemarkInfo({
67
78
  show: false
68
79
  });
@@ -96,13 +107,13 @@ export var useRemarkContainer = function useRemarkContainer(elementRef, start, e
96
107
  }
97
108
  var io = new IntersectionObserver(function (entries) {
98
109
  var ratio = entries[0].intersectionRatio;
99
- if (ratio < 0.8) {
110
+ if (ratio < 0.5) {
100
111
  setRemarkInfo({
101
112
  show: false
102
113
  });
103
114
  }
104
115
  }, {
105
- threshold: 0.8
116
+ threshold: 0.5
106
117
  });
107
118
  io.observe(cell);
108
119
  return function () {
@@ -240,7 +240,6 @@ var Table = function Table(_ref) {
240
240
  columnKey: columnKey,
241
241
  id: data === null || data === void 0 || (_data$row = data[row]) === null || _data$row === void 0 || (_data$row = _data$row[col]) === null || _data$row === void 0 || (_data$row = _data$row.record) === null || _data$row === void 0 ? void 0 : _data$row.id
242
242
  });
243
- console.log(data);
244
243
  setShowRemark(!!(data !== null && data !== void 0 && (_data$row2 = data[row]) !== null && _data$row2 !== void 0 && (_data$row2 = _data$row2[col]) !== null && _data$row2 !== void 0 && (_data$row2 = _data$row2.record) !== null && _data$row2 !== void 0 && (_data$row2 = _data$row2.remarks) !== null && _data$row2 !== void 0 && _data$row2.includes(columnKey)));
245
244
  }, [offset, columns, data]);
246
245
  var remarkElement = useMemo(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.73.beta.11",
3
+ "version": "0.1.73.beta.12",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",