@sheinx/base 3.8.5-beta.1 → 3.8.5-beta.2
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/cjs/tooltip/tooltip.d.ts.map +1 -1
- package/cjs/tooltip/tooltip.js +18 -16
- package/esm/tooltip/tooltip.d.ts.map +1 -1
- package/esm/tooltip/tooltip.js +18 -16
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,mDA+JnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/cjs/tooltip/tooltip.js
CHANGED
|
@@ -48,6 +48,13 @@ var Tooltip = function Tooltip(props) {
|
|
|
48
48
|
popsitionProps = _props$position === void 0 ? 'auto' : _props$position,
|
|
49
49
|
_props$popupGap = props.popupGap,
|
|
50
50
|
popupGap = _props$popupGap === void 0 ? 0 : _props$popupGap;
|
|
51
|
+
|
|
52
|
+
// Early validation checks BEFORE any hooks
|
|
53
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
54
|
+
devUseWarning.error('Tooltip children expect a single ReactElement.');
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (!tip) return children;
|
|
51
58
|
var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
|
|
52
59
|
var config = (0, _config.useConfig)();
|
|
53
60
|
var persistent = persistentProp !== null && persistentProp !== void 0 ? persistentProp : (_config$tooltip = config.tooltip) === null || _config$tooltip === void 0 ? void 0 : _config$tooltip.persistent;
|
|
@@ -106,22 +113,6 @@ var Tooltip = function Tooltip(props) {
|
|
|
106
113
|
unbindEvents();
|
|
107
114
|
};
|
|
108
115
|
}, [persistent]);
|
|
109
|
-
if (! /*#__PURE__*/(0, _react.isValidElement)(children)) {
|
|
110
|
-
devUseWarning.error('Tooltip children expect a single ReactElement.');
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
if (!tip) return children;
|
|
114
|
-
var inner = disabledChild ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
115
|
-
className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.target,
|
|
116
|
-
style: {
|
|
117
|
-
cursor: 'not-allowed'
|
|
118
|
-
},
|
|
119
|
-
children: /*#__PURE__*/(0, _react.cloneElement)(children, {
|
|
120
|
-
style: _objectSpread(_objectSpread({}, childrenProps.style), {}, {
|
|
121
|
-
pointerEvents: 'none'
|
|
122
|
-
})
|
|
123
|
-
})
|
|
124
|
-
}) : children;
|
|
125
116
|
var innerProps = (0, _react.useMemo)(function () {
|
|
126
117
|
if (persistent) {
|
|
127
118
|
return trigger === 'hover' ? _objectSpread(_objectSpread({}, events), {}, {
|
|
@@ -133,6 +124,17 @@ var Tooltip = function Tooltip(props) {
|
|
|
133
124
|
}
|
|
134
125
|
return events;
|
|
135
126
|
}, [persistent, events, trigger]);
|
|
127
|
+
var inner = disabledChild ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
128
|
+
className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.target,
|
|
129
|
+
style: {
|
|
130
|
+
cursor: 'not-allowed'
|
|
131
|
+
},
|
|
132
|
+
children: /*#__PURE__*/(0, _react.cloneElement)(children, {
|
|
133
|
+
style: _objectSpread(_objectSpread({}, childrenProps.style), {}, {
|
|
134
|
+
pointerEvents: 'none'
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}) : children;
|
|
136
138
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
137
139
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("noscript", {
|
|
138
140
|
ref: function ref(el) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,mDA+JnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/esm/tooltip/tooltip.js
CHANGED
|
@@ -41,6 +41,13 @@ var Tooltip = function Tooltip(props) {
|
|
|
41
41
|
popsitionProps = _props$position === void 0 ? 'auto' : _props$position,
|
|
42
42
|
_props$popupGap = props.popupGap,
|
|
43
43
|
popupGap = _props$popupGap === void 0 ? 0 : _props$popupGap;
|
|
44
|
+
|
|
45
|
+
// Early validation checks BEFORE any hooks
|
|
46
|
+
if (! /*#__PURE__*/isValidElement(children)) {
|
|
47
|
+
devUseWarning.error('Tooltip children expect a single ReactElement.');
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if (!tip) return children;
|
|
44
51
|
var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
|
|
45
52
|
var config = useConfig();
|
|
46
53
|
var persistent = persistentProp !== null && persistentProp !== void 0 ? persistentProp : (_config$tooltip = config.tooltip) === null || _config$tooltip === void 0 ? void 0 : _config$tooltip.persistent;
|
|
@@ -99,22 +106,6 @@ var Tooltip = function Tooltip(props) {
|
|
|
99
106
|
unbindEvents();
|
|
100
107
|
};
|
|
101
108
|
}, [persistent]);
|
|
102
|
-
if (! /*#__PURE__*/isValidElement(children)) {
|
|
103
|
-
devUseWarning.error('Tooltip children expect a single ReactElement.');
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
if (!tip) return children;
|
|
107
|
-
var inner = disabledChild ? /*#__PURE__*/_jsx("span", {
|
|
108
|
-
className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.target,
|
|
109
|
-
style: {
|
|
110
|
-
cursor: 'not-allowed'
|
|
111
|
-
},
|
|
112
|
-
children: /*#__PURE__*/cloneElement(children, {
|
|
113
|
-
style: _objectSpread(_objectSpread({}, childrenProps.style), {}, {
|
|
114
|
-
pointerEvents: 'none'
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
}) : children;
|
|
118
109
|
var innerProps = useMemo(function () {
|
|
119
110
|
if (persistent) {
|
|
120
111
|
return trigger === 'hover' ? _objectSpread(_objectSpread({}, events), {}, {
|
|
@@ -126,6 +117,17 @@ var Tooltip = function Tooltip(props) {
|
|
|
126
117
|
}
|
|
127
118
|
return events;
|
|
128
119
|
}, [persistent, events, trigger]);
|
|
120
|
+
var inner = disabledChild ? /*#__PURE__*/_jsx("span", {
|
|
121
|
+
className: tooltipClasses === null || tooltipClasses === void 0 ? void 0 : tooltipClasses.target,
|
|
122
|
+
style: {
|
|
123
|
+
cursor: 'not-allowed'
|
|
124
|
+
},
|
|
125
|
+
children: /*#__PURE__*/cloneElement(children, {
|
|
126
|
+
style: _objectSpread(_objectSpread({}, childrenProps.style), {}, {
|
|
127
|
+
pointerEvents: 'none'
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
}) : children;
|
|
129
131
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
130
132
|
children: [/*#__PURE__*/_jsx("noscript", {
|
|
131
133
|
ref: function ref(el) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheinx/base",
|
|
3
|
-
"version": "3.8.5-beta.
|
|
3
|
+
"version": "3.8.5-beta.2",
|
|
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.8.5-beta.
|
|
13
|
+
"@sheinx/hooks": "3.8.5-beta.2",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|