ant-design / ant-design
Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -1,5 +1,4 @@
Loading
1 1
import * as React from 'react';
2 -
import * as PropTypes from 'prop-types';
3 2
import RcDrawer from 'rc-drawer';
4 3
import createReactContext from '@ant-design/create-react-context';
5 4
import warning from '../_util/warning';
@@ -10,7 +9,9 @@
Loading
10 9
11 10
const DrawerContext = createReactContext<Drawer | null>(null);
12 11
13 -
type EventType = React.MouseEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement>;
12 +
type EventType =
13 +
  | React.KeyboardEvent<HTMLDivElement>
14 +
  | React.MouseEvent<HTMLDivElement | HTMLButtonElement>;
14 15
15 16
type getContainerFunc = () => HTMLElement;
16 17
@@ -39,6 +40,7 @@
Loading
39 40
  afterVisibleChange?: (visible: boolean) => void;
40 41
  className?: string;
41 42
  handler?: React.ReactNode;
43 +
  keyboard?: boolean;
42 44
}
43 45
44 46
export interface IDrawerState {
@@ -46,30 +48,6 @@
Loading
46 48
}
47 49
48 50
class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerState> {
49 -
  static propTypes = {
50 -
    closable: PropTypes.bool,
51 -
    destroyOnClose: PropTypes.bool,
52 -
    getContainer: PropTypes.oneOfType([
53 -
      PropTypes.string,
54 -
      PropTypes.object as PropTypes.Requireable<HTMLElement>,
55 -
      PropTypes.func,
56 -
      PropTypes.bool,
57 -
    ]),
58 -
    maskClosable: PropTypes.bool,
59 -
    mask: PropTypes.bool,
60 -
    maskStyle: PropTypes.object,
61 -
    style: PropTypes.object,
62 -
    title: PropTypes.node,
63 -
    visible: PropTypes.bool,
64 -
    width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
65 -
    zIndex: PropTypes.number,
66 -
    prefixCls: PropTypes.string,
67 -
    placement: PropTypes.oneOf(PlacementTypes),
68 -
    onClose: PropTypes.func,
69 -
    afterVisibleChange: PropTypes.func,
70 -
    className: PropTypes.string,
71 -
  };
72 -
73 51
  static defaultProps = {
74 52
    width: 256,
75 53
    height: 256,
@@ -78,6 +56,7 @@
Loading
78 56
    maskClosable: true,
79 57
    mask: true,
80 58
    level: null,
59 +
    keyboard: true,
81 60
  };
82 61
83 62
  readonly state = {
@@ -106,7 +85,7 @@
Loading
106 85
  };
107 86
108 87
  onMaskClick = (e: EventType) => {
109 -
    if (!this.props.maskClosable) {
88 +
    if (!this.props.maskClosable && !(e.nativeEvent instanceof KeyboardEvent)) {
110 89
      return;
111 90
    }
112 91
    this.close(e);
Files Coverage
components 96.01%
Project Totals (263 files) 96.01%
Notifications are pending CI completion. Waiting for GitHub's status webhook to queue notifications. Push notifications now.
1
codecov:
2
  branch: master
3

4
coverage:
5
  status:
6
    project:
7
      default:
8
        # Fail the status if coverage drops by >= 0.1%
9
        threshold: 0.1
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading