Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var notFindInputItem = sel.every(function (option) {
// this.filterOption return true has two meaning,
// 1, some one exists after filtering
// 2, filterOption is set to false
// condition 2 does not mean the option has same value with inputValue
var filterFn = function filterFn() {
return (0, _util.getValuePropValue)(option) === inputValue;
};
if (_this2.props.filterOption !== false) {
return !_this2.filterOption.call(_this2, inputValue, option, filterFn);
}
return !filterFn();
});
if (notFindInputItem) {
sel.unshift(_react2['default'].createElement(
_rcMenu.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: inputValue,
key: inputValue
},
inputValue
));
}
}
}
if (!sel.length && showNotFound && props.notFoundContent) {
sel = [_react2['default'].createElement(
_rcMenu.Item,
{
style: _util.UNSELECTABLE_STYLE,
var inlineCollapsed = _ref2.inlineCollapsed;
var tooltipProps = {
title: title || (level === 1 ? children : '')
};
if (!siderCollapsed && !inlineCollapsed) {
tooltipProps.title = null; // Reset `visible` to fix control mode tooltip display not correct
// ref: https://github.com/ant-design/ant-design/issues/16742
tooltipProps.visible = false;
}
return React.createElement(_tooltip["default"], _extends({}, tooltipProps, {
placement: "right",
overlayClassName: "".concat(rootPrefixCls, "-inline-collapsed-tooltip")
}), React.createElement(_rcMenu.Item, _extends({}, rest, {
title: title,
ref: _this.saveMenuItem
})));
});
};
if (menuMode !== 'inline') {
// closing vertical popup submenu after click it
menuProps.onClick = this.handleClick;
menuProps.openTransitionName = menuOpenAnimation;
} else {
menuProps.openAnimation = menuOpenAnimation;
}
return _react2['default'].createElement(_rcMenu2['default'], (0, _extends3['default'])({}, this.props, menuProps));
}
}]);
return Menu;
}(_react2['default'].Component);
exports['default'] = Menu;
Menu.Divider = _rcMenu.Divider;
Menu.Item = _MenuItem2['default'];
Menu.SubMenu = _rcMenu.SubMenu;
Menu.ItemGroup = _rcMenu.ItemGroup;
Menu.defaultProps = {
prefixCls: 'ant-menu',
className: '',
theme: 'light'
};
Menu.childContextTypes = {
inlineCollapsed: _propTypes2['default'].bool
};
Menu.contextTypes = {
siderCollapsed: _propTypes2['default'].bool
};
module.exports = exports['default'];
if (menuMode !== 'inline') {
// closing vertical popup submenu after click it
menuProps.onClick = this.handleClick;
menuProps.openTransitionName = menuOpenAnimation;
} else {
menuProps.openAnimation = menuOpenAnimation;
}
return _react2['default'].createElement(_rcMenu2['default'], (0, _extends3['default'])({}, this.props, menuProps));
}
}]);
return Menu;
}(_react2['default'].Component);
exports['default'] = Menu;
Menu.Divider = _rcMenu.Divider;
Menu.Item = _MenuItem2['default'];
Menu.SubMenu = _rcMenu.SubMenu;
Menu.ItemGroup = _rcMenu.ItemGroup;
Menu.defaultProps = {
prefixCls: 'ant-menu',
className: '',
theme: 'light'
};
Menu.childContextTypes = {
inlineCollapsed: _propTypes2['default'].bool
};
Menu.contextTypes = {
siderCollapsed: _propTypes2['default'].bool
};
module.exports = exports['default'];
value: function render() {
var inlineCollapsed = this.context.inlineCollapsed;
var props = this.props;
return _react2['default'].createElement(
_tooltip2['default'],
{ title: inlineCollapsed && props.level === 1 ? props.children : '', placement: 'right', overlayClassName: props.rootPrefixCls + '-inline-collapsed-tooltip' },
_react2['default'].createElement(_rcMenu.Item, props)
);
}
}]);
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: singleValue,
key: singleValue
},
singleValue
);
}));
if (inputValue) {
var notFindInputItem = sel.every(function (option) {
return (0, _util.getValuePropValue)(option) !== inputValue;
});
if (notFindInputItem) {
sel.unshift(_react2['default'].createElement(
_rcMenu.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: inputValue,
key: inputValue
},
inputValue
));
}
}
}
if (!sel.length && showNotFound && props.notFoundContent) {
sel = [_react2['default'].createElement(
_rcMenu.Item,
{
style: _util.UNSELECTABLE_STYLE,
sel = sel.concat(value.map(function (singleValue) {
var key = singleValue.key;
return _react2['default'].createElement(
_rcMenu.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: key,
key: key
},
key
);
}));
if (inputValue) {
sel.unshift(_react2['default'].createElement(
_rcMenu.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: inputValue,
key: inputValue
},
inputValue
));
}
}
}
if (!sel.length && showNotFound && props.notFoundContent) {
sel = [_react2['default'].createElement(
_rcMenu.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
disabled: true,
value: 'NOT_FOUND',
key: 'NOT_FOUND'
},
props.notFoundContent
)];
}
return sel;
}
};
)
),
_react2.default.createElement(
_rcDropdown2.default,
{
trigger: ['click'],
overlay: _react2.default.createElement(
_rcMenu2.default,
{ selectable: false, onClick: this.insertMenuClick },
_react2.default.createElement(
_rcMenu.Item,
{ key: '0' },
'\u63D2\u5165\u56FE\u7247'
),
_react2.default.createElement(
_rcMenu.Item,
{ key: '1' },
'\u63D2\u5165\u94FE\u63A5'
)
),
onVisibleChange: this.dropdownChange('insert'),
animation: ''
},
_react2.default.createElement(
'span',
{ className: 'insert-tab ' + (panelType === 'insert' && 'active') },
'\u63D2\u5165'
)
),
_react2.default.createElement(
_rcDropdown2.default,
{
value: function renderMenuItem(item) {
var column = this.props.column;
var multiple = 'filterMultiple' in column ? column.filterMultiple : true;
var input = multiple ? _react2['default'].createElement(_checkbox2['default'], { checked: this.state.selectedKeys.indexOf(item.value.toString()) >= 0 }) : _react2['default'].createElement(_radio2['default'], { checked: this.state.selectedKeys.indexOf(item.value.toString()) >= 0 });
return _react2['default'].createElement(
_rcMenu.Item,
{ key: item.value },
input,
_react2['default'].createElement(
'span',
null,
item.text
)
);
}
}, {