@sheinx/base 3.9.9-beta.7 → 3.9.9-beta.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CAgSzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CAuSzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -170,10 +170,17 @@ var TabsHeader = function TabsHeader(props) {
170
170
  return clearInterval(timer);
171
171
  };
172
172
  } else {
173
- setCurrentTabSize({
174
- width: width,
175
- height: height
176
- });
173
+ // why timeout: 依然是微前端下的问题,初始化线段不对齐
174
+ setTimeout(function () {
175
+ setCurrentTabSize({
176
+ width: currentTab.offsetWidth,
177
+ height: currentTab.offsetHeight
178
+ });
179
+ setCurrentTabOffset({
180
+ offsetTop: currentTab.offsetTop || 0,
181
+ offsetLeft: currentTab.offsetLeft || 0
182
+ });
183
+ }, 0);
177
184
  }
178
185
  }, [active, tabs]);
179
186
  var renderHeaderScrollBar = function renderHeaderScrollBar() {
@@ -54,7 +54,6 @@ var Tooltip = function Tooltip(props) {
54
54
  devUseWarning.error('Tooltip children expect a single ReactElement.');
55
55
  return null;
56
56
  }
57
- if (!tip) return children;
58
57
  var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
59
58
  var config = (0, _config.useConfig)();
60
59
  var persistent = persistentProp !== null && persistentProp !== void 0 ? persistentProp : (_config$tooltip = config.tooltip) === null || _config$tooltip === void 0 ? void 0 : _config$tooltip.persistent;
@@ -144,7 +143,7 @@ var Tooltip = function Tooltip(props) {
144
143
  if (targetRef.current === targetEl) return;
145
144
  targetRef.current = targetEl;
146
145
  }
147
- }, 'ns'), /*#__PURE__*/(0, _react.cloneElement)(inner, innerProps), /*#__PURE__*/(0, _jsxRuntime.jsx)(_absoluteList.default, {
146
+ }, 'ns'), /*#__PURE__*/(0, _react.cloneElement)(inner, innerProps), tip && /*#__PURE__*/(0, _jsxRuntime.jsx)(_absoluteList.default, {
148
147
  focus: open,
149
148
  parentElRef: targetRef,
150
149
  popupElRef: popupRef,
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CAgSzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CAuSzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -164,10 +164,17 @@ var TabsHeader = function TabsHeader(props) {
164
164
  return clearInterval(timer);
165
165
  };
166
166
  } else {
167
- setCurrentTabSize({
168
- width: width,
169
- height: height
170
- });
167
+ // why timeout: 依然是微前端下的问题,初始化线段不对齐
168
+ setTimeout(function () {
169
+ setCurrentTabSize({
170
+ width: currentTab.offsetWidth,
171
+ height: currentTab.offsetHeight
172
+ });
173
+ setCurrentTabOffset({
174
+ offsetTop: currentTab.offsetTop || 0,
175
+ offsetLeft: currentTab.offsetLeft || 0
176
+ });
177
+ }, 0);
171
178
  }
172
179
  }, [active, tabs]);
173
180
  var renderHeaderScrollBar = function renderHeaderScrollBar() {
@@ -47,7 +47,6 @@ var Tooltip = function Tooltip(props) {
47
47
  devUseWarning.error('Tooltip children expect a single ReactElement.');
48
48
  return null;
49
49
  }
50
- if (!tip) return children;
51
50
  var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
52
51
  var config = useConfig();
53
52
  var persistent = persistentProp !== null && persistentProp !== void 0 ? persistentProp : (_config$tooltip = config.tooltip) === null || _config$tooltip === void 0 ? void 0 : _config$tooltip.persistent;
@@ -137,7 +136,7 @@ var Tooltip = function Tooltip(props) {
137
136
  if (targetRef.current === targetEl) return;
138
137
  targetRef.current = targetEl;
139
138
  }
140
- }, 'ns'), /*#__PURE__*/cloneElement(inner, innerProps), /*#__PURE__*/_jsx(AbsoluteList, {
139
+ }, 'ns'), /*#__PURE__*/cloneElement(inner, innerProps), tip && /*#__PURE__*/_jsx(AbsoluteList, {
141
140
  focus: open,
142
141
  parentElRef: targetRef,
143
142
  popupElRef: popupRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.9.9-beta.7",
3
+ "version": "3.9.9-beta.9",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.9.9-beta.7",
13
+ "@sheinx/hooks": "3.9.9-beta.9",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.3.3"