New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bi-open-menu-sdk

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bi-open-menu-sdk - npm Package Compare versions

Comparing version

to
0.0.8-beta.0

2

declaration/components.d.ts

@@ -28,3 +28,3 @@ /**

disabled?: boolean;
/** hover 提示 */
/** PC端鼠标 hover 提示 */
hoverTip?: string;

@@ -31,0 +31,0 @@ /** 是否加载中 */

@@ -54,4 +54,3 @@ "use strict";

style = _ref.style,
_ref$title = _ref.title,
title = _ref$title === void 0 ? '' : _ref$title,
title = _ref.title,
_ref$disabled = _ref.disabled,

@@ -61,4 +60,3 @@ disabled = _ref$disabled === void 0 ? false : _ref$disabled,

loading = _ref$loading === void 0 ? false : _ref$loading,
_ref$hoverTip = _ref.hoverTip,
hoverTip = _ref$hoverTip === void 0 ? '' : _ref$hoverTip,
hoverTip = _ref.hoverTip,
onClick = _ref.onClick;

@@ -71,7 +69,2 @@

var _React$useState3 = React.useState(false),
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
hoverTipVisible = _React$useState4[0],
setHoverTipVisible = _React$useState4[1];
var ref = React.useRef();

@@ -91,11 +84,11 @@ React.useEffect(function () {

}, []);
React.useEffect(function () {
var setTip = React.useCallback(function (visible) {
if (ref.current) {
var container = ref.current.closest('[data-custom-component-root]');
if (typeof hoverTip === 'string' && container) {
if (hoverTip && typeof hoverTip === 'string' && container) {
container.dispatchEvent(new CustomEvent(CUSTOM_MENU_TOOLTIP_EVENT, {
detail: {
title: hoverTip,
visible: hoverTipVisible
visible: visible
}

@@ -105,3 +98,3 @@ }));

}
}, [hoverTip, hoverTipVisible]);
}, [hoverTip]);
React.useEffect(function () {

@@ -118,8 +111,2 @@ if (ref.current) {

}, []);
var handleMouseEnter = React.useCallback(function (e) {
setHoverTipVisible(true);
}, []);
var handleMouseLeave = React.useCallback(function (e) {
setHoverTipVisible(false);
}, []);
var iconContent = React.createElement(IconDefault, {

@@ -146,7 +133,19 @@ className: "default-icon"

}, [disabled, onClick]);
var handleMouseEnter = React.useCallback(function (e) {
setTip(true);
}, [setTip]);
var handleMouseLeave = React.useCallback(function (e) {
setTip(false);
}, [setTip]);
var viewTitle = React.useMemo(function () {
var _ref2, _ref2$componentInfo;
var originConfigName = (_ref2 = window.globalConfig) === null || _ref2 === void 0 ? void 0 : (_ref2$componentInfo = _ref2.componentInfo) === null || _ref2$componentInfo === void 0 ? void 0 : _ref2$componentInfo.name;
var configName = typeof originConfigName === 'string' ? originConfigName : '';
var propsTitle = typeof title === 'string' ? title : undefined;
return propsTitle !== null && propsTitle !== void 0 ? propsTitle : configName;
}, [title]);
return React.createElement("div", {
ref: ref,
className: "custom-card-menu ".concat(disabled ? 'disabled' : '', " ").concat(className || ''),
onMouseOver: handleMouseEnter,
onMouseOut: handleMouseLeave,
style: style,

@@ -158,6 +157,8 @@ onClick: handleClick

className: "custom-card-menu-text",
title: typeof title === 'string' ? title : ''
}, title));
title: viewTitle,
onMouseOver: handleMouseEnter,
onMouseOut: handleMouseLeave
}, viewTitle));
};
exports.MenuItem = MenuItem;

@@ -28,4 +28,3 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray.js";

style = _ref.style,
_ref$title = _ref.title,
title = _ref$title === void 0 ? '' : _ref$title,
title = _ref.title,
_ref$disabled = _ref.disabled,

@@ -35,4 +34,3 @@ disabled = _ref$disabled === void 0 ? false : _ref$disabled,

loading = _ref$loading === void 0 ? false : _ref$loading,
_ref$hoverTip = _ref.hoverTip,
hoverTip = _ref$hoverTip === void 0 ? '' : _ref$hoverTip,
hoverTip = _ref.hoverTip,
onClick = _ref.onClick;

@@ -45,7 +43,2 @@

var _React$useState3 = React.useState(false),
_React$useState4 = _slicedToArray(_React$useState3, 2),
hoverTipVisible = _React$useState4[0],
setHoverTipVisible = _React$useState4[1];
var ref = React.useRef();

@@ -65,11 +58,11 @@ React.useEffect(function () {

}, []);
React.useEffect(function () {
var setTip = React.useCallback(function (visible) {
if (ref.current) {
var container = ref.current.closest('[data-custom-component-root]');
if (typeof hoverTip === 'string' && container) {
if (hoverTip && typeof hoverTip === 'string' && container) {
container.dispatchEvent(new CustomEvent(CUSTOM_MENU_TOOLTIP_EVENT, {
detail: {
title: hoverTip,
visible: hoverTipVisible
visible: visible
}

@@ -79,3 +72,3 @@ }));

}
}, [hoverTip, hoverTipVisible]);
}, [hoverTip]);
React.useEffect(function () {

@@ -92,8 +85,2 @@ if (ref.current) {

}, []);
var handleMouseEnter = React.useCallback(function (e) {
setHoverTipVisible(true);
}, []);
var handleMouseLeave = React.useCallback(function (e) {
setHoverTipVisible(false);
}, []);
var iconContent = React.createElement(IconDefault, {

@@ -120,7 +107,19 @@ className: "default-icon"

}, [disabled, onClick]);
var handleMouseEnter = React.useCallback(function (e) {
setTip(true);
}, [setTip]);
var handleMouseLeave = React.useCallback(function (e) {
setTip(false);
}, [setTip]);
var viewTitle = React.useMemo(function () {
var _ref2, _ref2$componentInfo;
var originConfigName = (_ref2 = window.globalConfig) === null || _ref2 === void 0 ? void 0 : (_ref2$componentInfo = _ref2.componentInfo) === null || _ref2$componentInfo === void 0 ? void 0 : _ref2$componentInfo.name;
var configName = typeof originConfigName === 'string' ? originConfigName : '';
var propsTitle = typeof title === 'string' ? title : undefined;
return propsTitle !== null && propsTitle !== void 0 ? propsTitle : configName;
}, [title]);
return React.createElement("div", {
ref: ref,
className: "custom-card-menu ".concat(disabled ? 'disabled' : '', " ").concat(className || ''),
onMouseOver: handleMouseEnter,
onMouseOut: handleMouseLeave,
style: style,

@@ -132,4 +131,6 @@ onClick: handleClick

className: "custom-card-menu-text",
title: typeof title === 'string' ? title : ''
}, title));
title: viewTitle,
onMouseOver: handleMouseEnter,
onMouseOut: handleMouseLeave
}, viewTitle));
};
{
"name": "bi-open-menu-sdk",
"version": "0.0.7",
"version": "0.0.8-beta.0",
"main": "dist/main",
"peerDependencies": {

@@ -17,7 +18,6 @@ "react": "^16.12.0",

"dependencies": {
"bi-open-react-sdk": "^2.1.12"
"bi-open-react-sdk": "2.1.13-beta.0"
},
"main": "dist/main",
"module": "dist/module",
"types": "declaration/index.d.ts"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet