@sheinx/hooks 3.3.7-beta.5 → 3.3.7-beta.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"use-transform.d.ts","sourceRoot":"","sources":["use-transform.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,QAAA,MAAM,YAAY,aAAc,iBAAiB;;;;;;;;8BAwBd,MAAM;;;CAsFxC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"use-transform.d.ts","sourceRoot":"","sources":["use-transform.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,QAAA,MAAM,YAAY,aAAc,iBAAiB;;;;;;;;8BAwBd,MAAM;;;CA0FxC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -116,13 +116,17 @@ var useTransform = function useTransform(props) {
116
116
  setAtStart(true);
117
117
  }
118
118
  var removeWheelListener;
119
+ var removeScrollerListener;
119
120
  if (autoScroll) {
120
121
  var removeMouse = shouldScroll ? (0, _scrollBehavior.banOverScrollx)(container) : null;
121
122
  removeWheelListener = (0, _element.addResizeObserver)(container, handleResize);
123
+ // 同时需要监听tabs-header-scroll的resize事件,防止tabs-header-scroll的宽度变化后不出现左右箭头的问题
124
+ removeScrollerListener = (0, _element.addResizeObserver)(target, handleResize);
122
125
  return function () {
123
- var _removeWheelListener;
126
+ var _removeWheelListener, _removeScrollerListen;
124
127
  removeMouse === null || removeMouse === void 0 || removeMouse();
125
128
  (_removeWheelListener = removeWheelListener) === null || _removeWheelListener === void 0 || _removeWheelListener();
129
+ (_removeScrollerListen = removeScrollerListener) === null || _removeScrollerListen === void 0 || _removeScrollerListen();
126
130
  };
127
131
  }
128
132
  }, [containerRef.current, targetRef.current, shouldScroll]);
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAA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AO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA+CX,MAAM,UAAU,MAAM;;;;;;;;CAmO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -103,6 +103,7 @@ var useTableLayout = function useTableLayout(props) {
103
103
  return;
104
104
  }
105
105
  context.clientWidth = scrollEl.clientWidth;
106
+ if (scrollEl.clientHeight === 0) return;
106
107
  var overHeight = scrollEl.scrollHeight > scrollEl.clientHeight;
107
108
  var overWidth = scrollEl.scrollWidth > context.clientWidth;
108
109
  var newScrollBarWidth = overHeight ? scrollEl.offsetWidth - scrollEl.clientWidth : 0;
@@ -1 +1 @@
1
- {"version":3,"file":"use-transform.d.ts","sourceRoot":"","sources":["use-transform.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,QAAA,MAAM,YAAY,aAAc,iBAAiB;;;;;;;;8BAwBd,MAAM;;;CAsFxC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"use-transform.d.ts","sourceRoot":"","sources":["use-transform.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,QAAA,MAAM,YAAY,aAAc,iBAAiB;;;;;;;;8BAwBd,MAAM;;;CA0FxC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -110,13 +110,17 @@ var useTransform = function useTransform(props) {
110
110
  setAtStart(true);
111
111
  }
112
112
  var removeWheelListener;
113
+ var removeScrollerListener;
113
114
  if (autoScroll) {
114
115
  var removeMouse = shouldScroll ? banOverScrollx(container) : null;
115
116
  removeWheelListener = addResizeObserver(container, handleResize);
117
+ // 同时需要监听tabs-header-scroll的resize事件,防止tabs-header-scroll的宽度变化后不出现左右箭头的问题
118
+ removeScrollerListener = addResizeObserver(target, handleResize);
116
119
  return function () {
117
- var _removeWheelListener;
120
+ var _removeWheelListener, _removeScrollerListen;
118
121
  removeMouse === null || removeMouse === void 0 || removeMouse();
119
122
  (_removeWheelListener = removeWheelListener) === null || _removeWheelListener === void 0 || _removeWheelListener();
123
+ (_removeScrollerListen = removeScrollerListener) === null || _removeScrollerListen === void 0 || _removeScrollerListen();
120
124
  };
121
125
  }
122
126
  }, [containerRef.current, targetRef.current, shouldScroll]);
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CAmO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA+CX,MAAM,UAAU,MAAM;;;;;;;;CAmO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -94,6 +94,7 @@ var useTableLayout = function useTableLayout(props) {
94
94
  return;
95
95
  }
96
96
  context.clientWidth = scrollEl.clientWidth;
97
+ if (scrollEl.clientHeight === 0) return;
97
98
  var overHeight = scrollEl.scrollHeight > scrollEl.clientHeight;
98
99
  var overWidth = scrollEl.scrollWidth > context.clientWidth;
99
100
  var newScrollBarWidth = overHeight ? scrollEl.offsetWidth - scrollEl.clientWidth : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.3.7-beta.5",
3
+ "version": "3.3.7-beta.7",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",