Browse Source

fix: upgrade rc-tooltip lint fail (#19408)

* fix: upgrade rc-tooltip lint fail

* fix tooltip typescript type

* rebase and update snapshots

* update tests

* change trigger mock export

* upgrade rc-trigger

* fix type error

* upgrade dependencies

* update snapshots

* upgrade rc-calendar and test use sleep

* update snapshots

* fix test fail

* update snapshots
pull/20103/head
骗你是小猫咪 5 years ago
committed by GitHub
parent
commit
114fdd9333
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1497
      components/cascader/__tests__/__snapshots__/index.test.js.snap
  2. 75
      components/config-provider/__tests__/__snapshots__/components.test.js.snap
  3. 8
      components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap
  4. 6
      components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap
  5. 3
      components/date-picker/__tests__/__snapshots__/WeekPicker.test.js.snap
  6. 6
      components/date-picker/__tests__/__snapshots__/other.test.js.snap
  7. 5
      components/list/__tests__/__snapshots__/pagination.test.js.snap
  8. 1197
      components/locale-provider/__tests__/__snapshots__/index.test.js.snap
  9. 7
      components/menu/__tests__/index.test.js
  10. 6
      components/popconfirm/__tests__/index.test.js
  11. 4
      components/popover/__tests__/index.test.js
  12. 4
      components/popover/index.tsx
  13. 3
      components/slider/__tests__/__snapshots__/demo.test.js.snap
  14. 5
      components/slider/__tests__/__snapshots__/index.test.js.snap
  15. 10
      components/table/__tests__/Table.filter.test.js
  16. 19
      components/table/__tests__/__snapshots__/Table.filter.test.js.snap
  17. 3
      components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap
  18. 5
      components/time-picker/__tests__/__snapshots__/index.test.js.snap
  19. 11
      components/tooltip/index.tsx
  20. 7
      components/tooltip/placements.tsx
  21. 6
      package.json
  22. 6
      tests/__mocks__/rc-trigger.js
  23. 2
      typings/custom-typings.d.ts

1497
components/cascader/__tests__/__snapshots__/index.test.js.snap

File diff suppressed because it is too large

75
components/config-provider/__tests__/__snapshots__/components.test.js.snap

@ -9132,7 +9132,8 @@ exports[`ConfigProvider components Popconfirm configProvider 1`] = `
</span>
<div>
<div
class="config-popover config-popover-placement-top "
class="config-popover"
style="opacity:0"
>
<div
class="config-popover-content"
@ -9213,7 +9214,8 @@ exports[`ConfigProvider components Popconfirm normal 1`] = `
</span>
<div>
<div
class="ant-popover ant-popover-placement-top "
class="ant-popover"
style="opacity:0"
>
<div
class="ant-popover-content"
@ -9294,7 +9296,8 @@ exports[`ConfigProvider components Popconfirm prefixCls 1`] = `
</span>
<div>
<div
class="prefix-Popconfirm prefix-Popconfirm-placement-top "
class="prefix-Popconfirm"
style="opacity:0"
>
<div
class="prefix-Popconfirm-content"
@ -9375,7 +9378,8 @@ exports[`ConfigProvider components Popover configProvider 1`] = `
</span>
<div>
<div
class="config-popover config-popover-placement-top "
class="config-popover"
style="opacity:0"
>
<div
class="config-popover-content"
@ -9408,7 +9412,8 @@ exports[`ConfigProvider components Popover normal 1`] = `
</span>
<div>
<div
class="ant-popover ant-popover-placement-top "
class="ant-popover"
style="opacity:0"
>
<div
class="ant-popover-content"
@ -9441,7 +9446,8 @@ exports[`ConfigProvider components Popover prefixCls 1`] = `
</span>
<div>
<div
class="prefix-Popover prefix-Popover-placement-top "
class="prefix-Popover"
style="opacity:0"
>
<div
class="prefix-Popover-content"
@ -10656,7 +10662,8 @@ exports[`ConfigProvider components Select configProvider 1`] = `
</div>
<div>
<div
class="config-select-dropdown config-select-dropdown-placement-bottomLeft "
class="config-select-dropdown"
style="opacity:0"
>
<div>
<div
@ -10773,7 +10780,8 @@ exports[`ConfigProvider components Select normal 1`] = `
</div>
<div>
<div
class="ant-select-dropdown ant-select-dropdown-placement-bottomLeft "
class="ant-select-dropdown"
style="opacity:0"
>
<div>
<div
@ -10890,7 +10898,8 @@ exports[`ConfigProvider components Select prefixCls 1`] = `
</div>
<div>
<div
class="prefix-Select-dropdown prefix-Select-dropdown-placement-bottomLeft "
class="prefix-Select-dropdown"
style="opacity:0"
>
<div>
<div
@ -11087,7 +11096,8 @@ exports[`ConfigProvider components Slider configProvider 1`] = `
/>
<div>
<div
class="config-tooltip config-slider-tooltip config-tooltip-placement-top "
class="config-tooltip config-slider-tooltip"
style="opacity:0"
>
<div
class="config-tooltip-content"
@ -11136,7 +11146,8 @@ exports[`ConfigProvider components Slider normal 1`] = `
/>
<div>
<div
class="ant-tooltip ant-slider-tooltip ant-tooltip-placement-top "
class="ant-tooltip ant-slider-tooltip"
style="opacity:0"
>
<div
class="ant-tooltip-content"
@ -11185,7 +11196,8 @@ exports[`ConfigProvider components Slider prefixCls 1`] = `
/>
<div>
<div
class="prefix-Slider-tooltip prefix-Slider-tooltip prefix-Slider-tooltip-placement-top "
class="prefix-Slider-tooltip prefix-Slider-tooltip"
style="opacity:0"
>
<div
class="prefix-Slider-tooltip-content"
@ -11622,8 +11634,8 @@ exports[`ConfigProvider components Table configProvider 1`] = `
</span>
<div>
<div
class="config-dropdown config-dropdown-placement-bottomRight "
style="visibility:hidden"
class="config-dropdown"
style="opacity:0"
>
<div
class="config-table-filter-dropdown"
@ -11958,8 +11970,8 @@ exports[`ConfigProvider components Table normal 1`] = `
</span>
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight "
style="visibility:hidden"
class="ant-dropdown"
style="opacity:0"
>
<div
class="ant-table-filter-dropdown"
@ -12294,8 +12306,8 @@ exports[`ConfigProvider components Table prefixCls 1`] = `
</span>
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight "
style="visibility:hidden"
class="ant-dropdown"
style="opacity:0"
>
<div
class="prefix-Table-filter-dropdown"
@ -12987,7 +12999,8 @@ Array [
</span>,
<div>
<div
class="config-time-picker-panel config-time-picker-panel-column-3 config-time-picker-panel-placement-bottomLeft "
class="config-time-picker-panel config-time-picker-panel-column-3"
style="opacity:0"
>
<div
class="config-time-picker-panel-inner"
@ -14079,7 +14092,8 @@ Array [
</span>,
<div>
<div
class="ant-time-picker-panel ant-time-picker-panel-column-3 ant-time-picker-panel-placement-bottomLeft "
class="ant-time-picker-panel ant-time-picker-panel-column-3"
style="opacity:0"
>
<div
class="ant-time-picker-panel-inner"
@ -15171,7 +15185,8 @@ Array [
</span>,
<div>
<div
class="prefix-TimePicker-panel prefix-TimePicker-panel-column-3 prefix-TimePicker-panel-placement-bottomLeft "
class="prefix-TimePicker-panel prefix-TimePicker-panel-column-3"
style="opacity:0"
>
<div
class="prefix-TimePicker-panel-inner"
@ -16296,7 +16311,8 @@ Array [
</span>,
<div>
<div
class="config-tooltip config-tooltip-placement-top "
class="config-tooltip"
style="opacity:0"
>
<div
class="config-tooltip-content"
@ -16325,7 +16341,8 @@ Array [
</span>,
<div>
<div
class="ant-tooltip ant-tooltip-placement-top "
class="ant-tooltip"
style="opacity:0"
>
<div
class="ant-tooltip-content"
@ -16354,7 +16371,8 @@ Array [
</span>,
<div>
<div
class="prefix-Tooltip prefix-Tooltip-placement-top "
class="prefix-Tooltip"
style="opacity:0"
>
<div
class="prefix-Tooltip-content"
@ -17448,7 +17466,8 @@ exports[`ConfigProvider components TreeSelect configProvider 1`] = `
</div>
<div>
<div
class="config-select-dropdown config-tree-select-dropdown config-select-dropdown-placement-bottomLeft "
class="config-select-dropdown config-tree-select-dropdown"
style="opacity:0"
>
<div>
<div>
@ -17558,7 +17577,8 @@ exports[`ConfigProvider components TreeSelect normal 1`] = `
</div>
<div>
<div
class="ant-select-dropdown ant-tree-select-dropdown ant-select-dropdown-placement-bottomLeft "
class="ant-select-dropdown ant-tree-select-dropdown"
style="opacity:0"
>
<div>
<div>
@ -17668,7 +17688,8 @@ exports[`ConfigProvider components TreeSelect prefixCls 1`] = `
</div>
<div>
<div
class="prefix-TreeSelect-dropdown prefix-TreeSelect-dropdown prefix-TreeSelect-dropdown-placement-bottomLeft "
class="prefix-TreeSelect-dropdown prefix-TreeSelect-dropdown"
style="opacity:0"
>
<div>
<div>

8
components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap

@ -39,9 +39,7 @@ exports[`DatePicker prop locale should works 1`] = `
<span
class="ant-calendar-picker"
>
<div
style=""
>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="Избери дата"
@ -92,8 +90,8 @@ exports[`DatePicker prop locale should works 1`] = `
</div>
<div>
<div
class="ant-calendar-picker-container ant-calendar-picker-container-placement-bottomLeft slide-up-appear"
style="left: -999px; top: -1002px;"
class="ant-calendar-picker-container"
style="opacity: 0;"
>
<div
class="ant-calendar"

6
components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap

@ -54,7 +54,8 @@ exports[`RangePicker customize separator 1`] = `
exports[`RangePicker show month panel according to value 1`] = `
<div>
<div
class="ant-calendar-picker-container ant-calendar-picker-container-placement-bottomLeft "
class="ant-calendar-picker-container"
style="opacity:0"
>
<div
class="ant-calendar-time ant-calendar ant-calendar-range"
@ -1559,7 +1560,8 @@ exports[`RangePicker show month panel according to value 1`] = `
exports[`RangePicker switch to corresponding month panel when click presetted ranges 1`] = `
<div>
<div
class="ant-calendar-picker-container ant-calendar-picker-container-placement-bottomLeft "
class="ant-calendar-picker-container"
style="opacity:0"
>
<div
class="ant-calendar-time ant-calendar-range-with-ranges ant-calendar ant-calendar-range"

3
components/date-picker/__tests__/__snapshots__/WeekPicker.test.js.snap

@ -3,7 +3,8 @@
exports[`WeekPicker should support dateRender 1`] = `
<div>
<div
class="ant-calendar-picker-container ant-calendar-picker-container-placement-bottomLeft "
class="ant-calendar-picker-container"
style="opacity:0"
>
<div
class="ant-calendar ant-calendar-week-number"

6
components/date-picker/__tests__/__snapshots__/other.test.js.snap

@ -3,7 +3,8 @@
exports[`MonthPicker and WeekPicker render MonthPicker 1`] = `
<div>
<div
class="ant-calendar-picker-container ant-calendar-picker-container-placement-bottomLeft "
class="ant-calendar-picker-container"
style="opacity:0"
>
<div
class="ant-calendar ant-calendar-month ant-calendar-month-calendar"
@ -267,7 +268,8 @@ exports[`MonthPicker and WeekPicker render MonthPicker 1`] = `
exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
<div>
<div
class="ant-calendar-picker-container ant-calendar-picker-container-placement-bottomLeft "
class="ant-calendar-picker-container"
style="opacity:0"
>
<div
class="ant-calendar ant-calendar-week-number"

5
components/list/__tests__/__snapshots__/pagination.test.js.snap

@ -337,7 +337,6 @@ exports[`List.pagination should change page size work 2`] = `
>
<div
class="ant-select-selector"
style=""
>
<span
class="ant-select-selection-search"
@ -365,8 +364,8 @@ exports[`List.pagination should change page size work 2`] = `
</div>
<div>
<div
class="ant-select-dropdown ant-select-dropdown-placement-bottomLeft ant-select-dropdown-hidden"
style="width: 0px; left: -999px; top: -995px;"
class="ant-select-dropdown"
style="width: 0px;"
>
<div>
<div

1197
components/locale-provider/__tests__/__snapshots__/index.test.js.snap

File diff suppressed because it is too large

7
components/menu/__tests__/index.test.js

@ -725,7 +725,12 @@ describe('Menu', () => {
wrapper.setProps({ inlineCollapsed: true });
jest.runAllTimers();
wrapper.update();
expect(wrapper.find('.ant-menu-submenu-popup:not(.ant-menu-submenu-hidden)').length).toBe(0);
expect(
wrapper
.find('Trigger')
.map(node => node.prop('popupVisible'))
.findIndex(node => !!node),
).toBe(-1);
wrapper.setProps({ inlineCollapsed: false });
expect(wrapper.find('.ant-menu-item-selected').getDOMNode().textContent).toBe('Option 2');
jest.useRealTimers();

6
components/popconfirm/__tests__/index.test.js

@ -2,6 +2,7 @@ import React from 'react';
import { mount } from 'enzyme';
import Popconfirm from '..';
import mountTest from '../../../tests/shared/mountTest';
import { sleep } from '../../../tests/utils';
describe('Popconfirm', () => {
mountTest(Popconfirm);
@ -36,7 +37,7 @@ describe('Popconfirm', () => {
expect(onVisibleChange).toHaveBeenLastCalledWith(false, undefined);
});
it('should show overlay when trigger is clicked', () => {
it('should show overlay when trigger is clicked', async () => {
const popconfirm = mount(
<Popconfirm title="code">
<span>show me your code</span>
@ -46,6 +47,7 @@ describe('Popconfirm', () => {
expect(popconfirm.instance().getPopupDomNode()).toBe(null);
popconfirm.find('span').simulate('click');
await sleep(100);
const popup = popconfirm.instance().getPopupDomNode();
expect(popup).not.toBe(null);
@ -67,7 +69,7 @@ describe('Popconfirm', () => {
expect(popconfirm.instance().getPopupDomNode().className).not.toContain('ant-popover-hidden');
popconfirm.setProps({ visible: false });
jest.runAllTimers();
expect(popconfirm.instance().getPopupDomNode().className).toContain('ant-popover-hidden');
expect(popconfirm.find('Trigger').props().popupVisible).toBe(false);
jest.useRealTimers();
});

4
components/popover/__tests__/index.test.js

@ -2,11 +2,12 @@ import React from 'react';
import { mount } from 'enzyme';
import Popover from '..';
import mountTest from '../../../tests/shared/mountTest';
import { sleep } from '../../../tests/utils';
describe('Popover', () => {
mountTest(Popover);
it('should show overlay when trigger is clicked', () => {
it('should show overlay when trigger is clicked', async () => {
const popover = mount(
<Popover content="console.log('hello world')" title="code" trigger="click">
<span>show me your code</span>
@ -16,6 +17,7 @@ describe('Popover', () => {
expect(popover.instance().getPopupDomNode()).toBe(null);
popover.find('span').simulate('click');
await sleep(100);
const popup = popover.instance().getPopupDomNode();
expect(popup).not.toBe(null);

4
components/popover/index.tsx

@ -1,5 +1,5 @@
import * as React from 'react';
import Tooltip, { AbstractTooltipProps, TooltipPlacement, TooltipTrigger } from '../tooltip';
import Tooltip, { AbstractTooltipProps, TooltipPlacement } from '../tooltip';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
export interface PopoverProps extends AbstractTooltipProps {
@ -11,7 +11,7 @@ export default class Popover extends React.Component<PopoverProps, {}> {
static defaultProps = {
placement: 'top' as TooltipPlacement,
transitionName: 'zoom-big',
trigger: 'hover' as TooltipTrigger,
trigger: 'hover',
mouseEnterDelay: 0.1,
mouseLeaveDelay: 0.1,
overlayStyle: {},

3
components/slider/__tests__/__snapshots__/demo.test.js.snap

@ -955,7 +955,8 @@ exports[`renders ./components/slider/demo/show-tooltip.md correctly 1`] = `
/>
<div>
<div
class="ant-tooltip ant-slider-tooltip ant-tooltip-placement-top "
class="ant-tooltip ant-slider-tooltip"
style="opacity:0"
>
<div
class="ant-tooltip-content"

5
components/slider/__tests__/__snapshots__/index.test.js.snap

@ -3,7 +3,8 @@
exports[`Slider should show tooltip when hovering slider handler 1`] = `
<div>
<div
class="ant-tooltip ant-slider-tooltip ant-tooltip-placement-top "
class="ant-tooltip ant-slider-tooltip"
style="opacity:0"
>
<div
class="ant-tooltip-content"
@ -25,7 +26,7 @@ exports[`Slider should show tooltip when hovering slider handler 1`] = `
exports[`Slider should show tooltip when hovering slider handler 2`] = `
<div>
<div
class="ant-tooltip ant-slider-tooltip ant-tooltip-placement-top ant-tooltip-hidden"
class="ant-tooltip ant-slider-tooltip ant-tooltip-hidden"
>
<div
class="ant-tooltip-content"

10
components/table/__tests__/Table.filter.test.js

@ -451,6 +451,14 @@ describe('Table.filter', () => {
wrapper.find('.confirm').simulate('click');
wrapper.update();
expect(
wrapper
.find('FilterDropdown')
.find('Checkbox')
.at(0)
.props().checked,
).toEqual(true);
expect(typeof wrapper.find('FilterDropdown').props().filterState.filteredKeys[0]).toEqual(
'string',
);
@ -471,7 +479,7 @@ describe('Table.filter', () => {
.find('Checkbox')
.at(0)
.props().checked,
).toEqual(true);
).toEqual(false);
jest.useRealTimers();
});
});

19
components/table/__tests__/__snapshots__/Table.filter.test.js.snap

@ -35,8 +35,7 @@ exports[`Table.filter override custom filter correctly 1`] = `
exports[`Table.filter renders custom content correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight ant-dropdown-hidden"
style="visibility: hidden;"
class="ant-dropdown ant-dropdown-hidden"
>
<div
class="ant-table-filter-dropdown"
@ -191,8 +190,7 @@ exports[`Table.filter renders filter correctly 1`] = `
exports[`Table.filter renders menu correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight ant-dropdown-hidden"
style="visibility: hidden;"
class="ant-dropdown ant-dropdown-hidden"
>
<div
class="ant-table-filter-dropdown"
@ -288,8 +286,7 @@ exports[`Table.filter renders menu correctly 1`] = `
exports[`Table.filter renders radio filter correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight ant-dropdown-hidden"
style="visibility: hidden;"
class="ant-dropdown ant-dropdown-hidden"
>
<div
class="ant-table-filter-dropdown"
@ -426,7 +423,6 @@ exports[`Table.filter should support getPopupContainer 1`] = `
<span
class="ant-table-filter-trigger ant-dropdown-trigger"
role="button"
style=""
tabindex="-1"
>
<span
@ -452,8 +448,8 @@ exports[`Table.filter should support getPopupContainer 1`] = `
</span>
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight"
style="left: -999px; top: -995px; min-width: 0;"
class="ant-dropdown"
style="opacity: 0;"
>
<div
class="ant-table-filter-dropdown"
@ -642,7 +638,6 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] =
<span
class="ant-table-filter-trigger ant-dropdown-trigger"
role="button"
style=""
tabindex="-1"
>
<span
@ -668,8 +663,8 @@ exports[`Table.filter should support getPopupContainer from ConfigProvider 1`] =
</span>
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomRight"
style="left: -999px; top: -995px; min-width: 0;"
class="ant-dropdown"
style="opacity: 0;"
>
<div
class="ant-table-filter-dropdown"

3
components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap

@ -531,8 +531,7 @@ exports[`Table.rowSelection fix selection column on the left when any other colu
exports[`Table.rowSelection render with default selection correctly 1`] = `
<div>
<div
class="ant-dropdown ant-dropdown-placement-bottomLeft ant-dropdown-hidden"
style="visibility:hidden"
class="ant-dropdown ant-dropdown-hidden"
>
<ul
class="ant-dropdown-menu ant-dropdown-menu-light ant-dropdown-menu-root ant-dropdown-menu-vertical"

5
components/time-picker/__tests__/__snapshots__/index.test.js.snap

@ -45,7 +45,6 @@ exports[`TimePicker prop locale should works 1`] = `
Array [
<span
class="ant-time-picker"
style=""
>
<input
class="ant-time-picker-input"
@ -105,8 +104,8 @@ Array [
</span>,
<div>
<div
class="ant-time-picker-panel ant-time-picker-panel-column-3 ant-time-picker-panel-placement-bottomLeft slide-up-appear"
style="left: -999px; top: -1001px;"
class="ant-time-picker-panel ant-time-picker-panel-column-3"
style="opacity: 0;"
>
<div
class="ant-time-picker-panel-inner"

11
components/tooltip/index.tsx

@ -2,6 +2,7 @@ import * as React from 'react';
import { polyfill } from 'react-lifecycles-compat';
import RcTooltip from 'rc-tooltip';
import classNames from 'classnames';
import { AlignType, ActionType, BuildInPlacements } from 'rc-trigger/lib/interface';
import getPlacements, { AdjustOverflow, PlacementsConfig } from './placements';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
@ -21,8 +22,6 @@ export type TooltipPlacement =
| 'rightTop'
| 'rightBottom';
export type TooltipTrigger = 'hover' | 'focus' | 'click' | 'contextMenu';
// https://github.com/react-component/tooltip
// https://github.com/yiminghe/dom-align
export interface TooltipAlignConfig {
@ -42,14 +41,14 @@ export interface AbstractTooltipProps {
className?: string;
overlayStyle?: React.CSSProperties;
placement?: TooltipPlacement;
builtinPlacements?: Object;
builtinPlacements?: BuildInPlacements;
defaultVisible?: boolean;
visible?: boolean;
onVisibleChange?: (visible: boolean) => void;
mouseEnterDelay?: number;
mouseLeaveDelay?: number;
transitionName?: string;
trigger?: TooltipTrigger;
trigger?: ActionType;
openClassName?: string;
arrowPointAtCenter?: boolean;
autoAdjustOverflow?: boolean | AdjustOverflow;
@ -58,7 +57,7 @@ export interface AbstractTooltipProps {
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
children?: React.ReactNode;
// align is a more higher api
align?: TooltipAlignConfig;
align?: AlignType;
/** Internal. Hide tooltip when hidden. This will be renamed in future. */
destroyTooltipOnHide?: boolean;
}
@ -174,7 +173,7 @@ class Tooltip extends React.Component<TooltipProps, any> {
};
getPopupDomNode() {
return this.tooltip.getPopupDomNode();
return (this.tooltip as any).getPopupDomNode();
}
getPlacements() {

7
components/tooltip/placements.tsx

@ -1,4 +1,5 @@
import { placements as rcPlacements } from 'rc-tooltip/lib/placements';
import { placements } from 'rc-tooltip/lib/placements';
import { BuildInPlacements } from 'rc-trigger';
const autoAdjustOverflowEnabled = {
adjustX: 1,
@ -42,7 +43,7 @@ export default function getPlacements(config: PlacementsConfig = {}) {
verticalArrowShift = 12,
autoAdjustOverflow = true,
} = config;
const placementMap: any = {
const placementMap: BuildInPlacements = {
left: {
points: ['cr', 'cl'],
offset: [-4, 0],
@ -100,7 +101,7 @@ export default function getPlacements(config: PlacementsConfig = {}) {
targetOffset,
}
: {
...rcPlacements[key],
...placements[key],
overflow: getOverflowOptions(autoAdjustOverflow),
};

6
package.json

@ -116,7 +116,7 @@
"rc-dropdown": "~3.0.0-alpha.0",
"rc-field-form": "^0.0.0-alpha.17",
"rc-input-number": "~4.5.0",
"rc-mentions": "~0.4.0",
"rc-mentions": "~1.0.0-alpha.0",
"rc-menu": "~8.0.0-alpha.4",
"rc-notification": "~3.3.1",
"rc-pagination": "~1.20.11",
@ -130,10 +130,10 @@
"rc-table": "~7.0.0-alpha.20",
"rc-tabs": "~9.7.0",
"rc-time-picker": "~4.0.0-alpha.2",
"rc-tooltip": "~3.7.3",
"rc-tooltip": "~4.0.0-alpha.3",
"rc-tree": "~3.0.0-alpha.37",
"rc-tree-select": "~3.0.0-alpha.5",
"rc-trigger": "^2.6.2",
"rc-trigger": "~4.0.0-alpha.6",
"rc-upload": "~2.9.1",
"rc-util": "^4.10.0",
"rc-virtual-list": "^0.0.0-alpha.25",

6
tests/__mocks__/rc-trigger.js

@ -1,7 +1,3 @@
/* eslint-disable no-underscore-dangle */
/* eslint-disable react/no-this-in-sfc */
const TriggerMock = require('rc-trigger/lib/mock'); // eslint-disable-line
const Trigger = TriggerMock;
import Trigger from 'rc-trigger/lib/mock';
export default Trigger;

2
typings/custom-typings.d.ts

@ -25,8 +25,6 @@ declare module 'rc-tabs*';
declare module 'rc-tree';
declare module 'rc-tree/lib/util';
declare module 'rc-tooltip*';
declare module 'rc-calendar';
declare module 'rc-input-number';

Loading…
Cancel
Save