Skip to content

Fix dialog z index #842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ flow

[options]
esproposal.class_static_fields=enable
unsafe.enable_getters_and_setters=true
18 changes: 5 additions & 13 deletions flow/modules.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
declare module 'classnames' {
declare var exports: {
(): any
}
declare export default function classnames(): any
}

declare module 'react-click-outside' {
declare var exports: {
(module: any): any
}
declare export default function enhanceWithClickOutside(module: any): any
}

declare module 'throttle-debounce/throttle' {
declare var exports: {
(...args: Array<any>): any
}
declare export default function throttle(...args: Array<any>): any
}

declare module 'throttle-debounce/debounce' {
declare var exports: {
(...args: Array<any>): any
}
declare export default function debounce(...args: Array<any>): any
}

declare module 'async-validator' {
declare class AsyncValidator {
constructor(options: Object): void;
validate(...args: Array<any>): void;
}
declare var exports: typeof AsyncValidator;
declare export default typeof AsyncValidator;
}
8 changes: 3 additions & 5 deletions libs/collapse/index.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/* @flow */

import React, { Component } from 'react';
import * as React from 'react';

const ANIMATION_DURATION = 300;

type Props = {
isShow: boolean,
children?: React.Element<any>
children?: React.Node
};

export default class CollapseTransition extends Component {
props: Props;

export default class CollapseTransition extends React.Component <Props> {
selfRef: any;
leaveTimer: any;
enterTimer: any;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"homepage": "https://github.com/eleme/element-react",
"devDependencies": {
"@types/react": "^15.6.7",
"@types/react": "^16.3.18",
"babel-cli": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-jest": "^21.2.0",
Expand All @@ -51,13 +51,13 @@
"enzyme-adapter-react-16": "^1.1.0",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-plugin-flowtype": "^2.46.3",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^5.1.0",
"eslint-plugin-react": "^7.8.1",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.5",
"flow-bin": "^0.51.1",
"flow-bin": "^0.78.0",
"html-webpack-plugin": "^2.30.1",
"jest": "^21.2.1",
"marked": "^0.3.6",
Expand Down Expand Up @@ -87,8 +87,8 @@
"throttle-debounce": "^1.0.1"
},
"peerDependencies": {
"react": "*",
"react-dom": "*"
"react": ">=16.3.0",
"react-dom": ">=16.3.0"
},
"jest": {
"testRegex": "(/jest/.+\\.(js|jsx)$)|_test.jsx?$",
Expand Down
4 changes: 2 additions & 2 deletions src/auto-complete/AutoComplete.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import ReactDOM from 'react-dom';
import ClickOutside from 'react-click-outside';
import { Component, PropTypes } from '../../libs';
Expand Down Expand Up @@ -172,7 +172,7 @@ class AutoComplete extends Component {
return (isValidData || this.state.loading) && this.state.isFocus;
}

onKeyDown(e: SyntheticKeyboardEvent): void {
onKeyDown(e: SyntheticKeyboardEvent<HTMLInputElement>): void {
const { highlightedIndex } = this.state;

switch (e.keyCode) {
Expand Down
5 changes: 2 additions & 3 deletions src/auto-complete/Suggestions.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import ReactDOM from 'react-dom';
import Popper from '../../libs/utils/popper';
import { Component, PropTypes, Transition, View } from '../../libs';
Expand Down Expand Up @@ -72,8 +72,7 @@ export default class Suggestions extends Component {
'is-loading': loading
})}
style={{
width: dropdownWidth,
zIndex: 1
width: dropdownWidth
}}
>
<Scrollbar
Expand Down
4 changes: 2 additions & 2 deletions src/badge/Badge.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../libs';

type Props = {
children: React.Element<any>,
children: React.Node,
value: number | string,
max: number,
isDot: boolean,
Expand Down
4 changes: 2 additions & 2 deletions src/button/Button.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../libs';

export default class Button extends Component {
onClick(e: SyntheticEvent): void {
onClick(e: SyntheticEvent<HTMLButtonElement>): void {
if (!this.props.loading) {
this.props.onClick && this.props.onClick(e);
}
Expand Down
2 changes: 1 addition & 1 deletion src/button/ButtonGroup.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component } from '../../libs';

export default class ButtonGroup extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/card/Card.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../libs';

export default class Card extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/carousel/Carousel.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import throttle from 'throttle-debounce/throttle';
import { Component, PropTypes, Transition, View } from '../../libs';
import { addResizeListener, removeResizeListener } from '../../libs/utils/resize-event';
Expand Down
2 changes: 1 addition & 1 deletion src/cascader/Cascader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class Cascader extends Component {
return flatOptions;
}

clearValue(e: SyntheticEvent) {
clearValue(e: SyntheticEvent<HTMLElement>) {
e.stopPropagation();

this.handlePick([], true);
Expand Down
2 changes: 1 addition & 1 deletion src/cascader/Menu.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes, Transition, View } from '../../libs';

type State = {
Expand Down
4 changes: 2 additions & 2 deletions src/checkbox/CheckBox.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react'
import * as React from 'react'
import { Component, PropTypes } from '../../libs'

type State = {
Expand Down Expand Up @@ -42,7 +42,7 @@ export default class Checkbox extends Component {
});
}

onChange(e: SyntheticEvent): void {
onChange(e: SyntheticEvent<HTMLInputElement>): void {
if (e.target instanceof HTMLInputElement) {
const { label } = this.state;
const { trueLabel, falseLabel} = this.props;
Expand Down
2 changes: 1 addition & 1 deletion src/checkbox/CheckBoxButton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import CheckBox from './CheckBox';

export default class CheckboxButton extends CheckBox {
Expand Down
2 changes: 1 addition & 1 deletion src/checkbox/CheckBoxGroup.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../libs'

type State = {
Expand Down
2 changes: 1 addition & 1 deletion src/collapse/Collapse.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../libs';

type State = {
Expand Down
2 changes: 1 addition & 1 deletion src/collapse/CollapseItem.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes, CollapseTransition } from '../../libs';

export default class CollapseItem extends Component {
Expand Down
2 changes: 1 addition & 1 deletion src/color-picker/ColorPicker.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import ClickOutside from 'react-click-outside';
import { Component, PropTypes } from '../../libs';
import PickerDropdown from './components/PickerDropdown';
Expand Down
4 changes: 2 additions & 2 deletions src/color-picker/Types.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ export type SvPanelState = {
};

export type DragOptions = {
drag: (event: SyntheticMouseEvent) => void,
end: (event: SyntheticMouseEvent) => void
drag: (event: SyntheticMouseEvent<HTMLDivElement>) => void,
end: (event: SyntheticMouseEvent<HTMLDivElement>) => void
};
6 changes: 3 additions & 3 deletions src/color-picker/components/AlphaSlider.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../../libs';
import draggable from '../draggable';
import type { AlphaSliderState, DragOptions } from '../Types';
Expand Down Expand Up @@ -32,15 +32,15 @@ export default class AlphaSlider extends Component {
this.update();
}

handleClick(event: SyntheticMouseEvent): void {
handleClick(event: SyntheticMouseEvent<HTMLDivElement>): void {
const thumb = this.refs.thumb;
const target = event.target;
if (target !== thumb) {
this.handleDrag(event);
}
}

handleDrag(event: SyntheticMouseEvent): void {
handleDrag(event: SyntheticMouseEvent<HTMLDivElement>): void {
const { vertical, color } = this.props;
const { onChange } = this.context;
const rect = this.$el.getBoundingClientRect();
Expand Down
6 changes: 3 additions & 3 deletions src/color-picker/components/HueSlider.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../../libs';
import draggable from '../draggable';
import type { HueSliderState, DragOptions } from '../Types';
Expand Down Expand Up @@ -31,15 +31,15 @@ export default class HueSlider extends Component {
this.update();
}

handleClick(event: SyntheticMouseEvent): void {
handleClick(event: SyntheticMouseEvent<HTMLDivElement>): void {
const thumb = this.refs.thumb;
const target = event.target;
if (target !== thumb) {
this.handleDrag(event);
}
}

handleDrag(event: SyntheticMouseEvent): void {
handleDrag(event: SyntheticMouseEvent<HTMLDivElement>): void {
const rect = this.$el.getBoundingClientRect();
const { thumb } = this.refs;
const { vertical, color } = this.props;
Expand Down
2 changes: 1 addition & 1 deletion src/color-picker/components/PickerDropdown.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import SvPanel from './SvPanel';
import HueSlider from './HueSlider';
import AlphaSlider from './AlphaSlider';
Expand Down
4 changes: 2 additions & 2 deletions src/color-picker/components/SvPanel.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import React from 'react';
import * as React from 'react';
import { Component, PropTypes } from '../../../libs';
import draggable from '../draggable';
import type { SvPanelState, DragOptions } from '../Types';
Expand Down Expand Up @@ -52,7 +52,7 @@ export default class SvPanel extends Component {
});
}

handleDrag(event: SyntheticMouseEvent): void {
handleDrag(event: SyntheticMouseEvent<HTMLDivElement>): void {
const { color } = this.props;
const { onChange } = this.context;
const el = this.$el;
Expand Down
4 changes: 2 additions & 2 deletions src/date-picker/BasePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default class BasePicker extends Component {
this.props.onBlur(this);
}

handleKeydown(evt: SyntheticKeyboardEvent) {
handleKeydown(evt: SyntheticKeyboardEvent<HTMLInputElement>) {
const keyCode = evt.keyCode;
// tab
if (keyCode === 9 || keyCode === 27) {
Expand Down Expand Up @@ -234,7 +234,7 @@ export default class BasePicker extends Component {
return true
}

handleClickOutside(evt: SyntheticEvent) {
handleClickOutside(evt: SyntheticEvent<*>) {
const { value, pickerVisible } = this.state
if (!this.isInputFocus && !pickerVisible) {
return
Expand Down
7 changes: 7 additions & 0 deletions src/date-picker/Types.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ type Range<T> = [T, Date]
type TimeSpinnerSelectableRange = Range<any>[]
type TimeSpinnerOnSelectRangeChange = (range: Range<number>)=>void
export type TimeTypes = 'hours' | 'minutes' | 'seconds'

export type TimeTypeProps = {
hours: ?number,
minutes: ?number,
seconds: ?number
}

export type TimeSpinnerProps = {
hours: ?number,
minutes: ?number,
Expand Down
Loading