mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 21:19:37 +08:00
55c85f77a1
* deps: upgrade rc-menu, and close: #2837 * test: update snapshots * Update rc-calendar * Update rc-cascader * Update rc-dialog * Update dropdown * Update rc-select@7.1.0 * Update rc-slider * Update rc-time-picker * Update rc-tooltip * Update rc-tree-select * Mock rc-trigger and Portal * Fix animation warning when inlineCollapsed changes * fix: should use SubMenu[popupClassName] * Fix typescript error * Fix lint * fix: style for menu * Mock rc-trigger for React 15 * Remvoe allow_failures
32 lines
718 B
JavaScript
32 lines
718 B
JavaScript
import React from 'react';
|
|
|
|
let Trigger; // eslint-disable-line
|
|
|
|
if (process.env.REACT === '15') {
|
|
const ActualTrigger = require.requireActual('rc-trigger');
|
|
const render = ActualTrigger.prototype.render;
|
|
|
|
ActualTrigger.prototype.render = function () {
|
|
const { popupVisible } = this.state;
|
|
let component;
|
|
|
|
if (popupVisible || this._component) { // eslint-disable-line
|
|
component = this.getComponent();
|
|
}
|
|
|
|
return (
|
|
<div id="TriggerContainer">
|
|
{render.call(this)}
|
|
{component}
|
|
</div>
|
|
);
|
|
};
|
|
Trigger = ActualTrigger;
|
|
} else {
|
|
const TriggerMock = require('rc-trigger/lib/mock'); // eslint-disable-line
|
|
Trigger = TriggerMock;
|
|
}
|
|
|
|
|
|
export default Trigger;
|