Browse Source

Fix CI

pull/13073/head
ztplz 6 years ago
committed by 偏右
parent
commit
6ad23c370e
  1. 3
      components/affix/index.tsx
  2. 7
      components/alert/index.tsx
  3. 2
      components/cascader/index.tsx
  4. 2
      components/checkbox/Checkbox.tsx
  5. 2
      components/date-picker/RangePicker.tsx
  6. 2
      components/drawer/index.tsx
  7. 6
      components/input/calculateNodeHeight.tsx
  8. 2
      components/radio/radio.tsx
  9. 8
      components/table/SelectionCheckboxAll.tsx
  10. 28
      components/table/Table.tsx
  11. 4
      components/tabs/index.tsx
  12. 2
      components/tree/Tree.tsx
  13. 12
      components/upload/Upload.tsx
  14. 2
      components/upload/UploadList.tsx

3
components/affix/index.tsx

@ -133,7 +133,8 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
@throttleByAnimationFrameDecorator()
updatePosition(e: Event) {
let { offsetTop, offsetBottom, offset, target = getDefaultTarget } = this.props;
const { offsetBottom, offset, target = getDefaultTarget } = this.props;
let { offsetTop } = this.props;
const targetNode = target();
// Backwards support

7
components/alert/index.tsx

@ -68,10 +68,11 @@ export default class Alert extends React.Component<AlertProps, AlertState> {
}
render() {
let {
closable, description, type, prefixCls = 'ant-alert', message, closeText, showIcon, banner,
className = '', style, iconType, icon,
const {
description, prefixCls = 'ant-alert', message, closeText, banner,
className = '', style, icon,
} = this.props;
let { closable, type, showIcon, iconType } = this.props;
// banner模式默认有 Icon
showIcon = banner && showIcon === undefined ? true : showIcon;

2
components/cascader/index.tsx

@ -291,7 +291,7 @@ export default class Cascader extends React.Component<CascaderProps, CascaderSta
) {
const names: FilledFieldNamesType = getFilledFieldNames(props);
let flattenOptions = [] as CascaderOptionType[][];
let childrenName = names.children;
const childrenName = names.children;
options.forEach((option) => {
const path = ancestor.concat(option);
if (props.changeOnSelect || !option[childrenName] || !option[childrenName].length) {

2
components/checkbox/Checkbox.tsx

@ -84,7 +84,7 @@ export default class Checkbox extends React.Component<CheckboxProps, {}, {}> {
...restProps
} = props;
const { checkboxGroup } = context;
let checkboxProps: CheckboxProps = { ...restProps };
const checkboxProps: CheckboxProps = { ...restProps };
if (checkboxGroup) {
checkboxProps.onChange = (...args) => {
if (restProps.onChange) {

2
components/date-picker/RangePicker.tsx

@ -269,7 +269,7 @@ class RangePicker extends React.Component<any, RangePickerState> {
});
// 需要选择时间时,点击 ok 时才触发 onChange
let pickerChangeHandler = {
const pickerChangeHandler = {
onChange: this.handleChange,
};
let calendarProps: any = {

2
components/drawer/index.tsx

@ -216,7 +216,7 @@ export default class Drawer extends React.Component<DrawerProps, IDrawerState> {
// render Provider for Multi-level drawe
renderProvider = (value: Drawer) => {
let { zIndex, style, placement, className, wrapClassName, width, height, ...rest } = this.props;
const { zIndex, style, placement, className, wrapClassName, width, height, ...rest } = this.props;
warning(wrapClassName === undefined, 'wrapClassName is deprecated, please use className instead.');
const haveMask = rest.mask ? "" : "no-mask";
this.parentDrawer = value;

6
components/input/calculateNodeHeight.tsx

@ -41,7 +41,7 @@ export interface NodeType {
boxSizing: string;
}
let computedStyleCache: {[key: string]: NodeType} = {};
const computedStyleCache: {[key: string]: NodeType} = {};
let hiddenTextarea: HTMLTextAreaElement;
function calculateNodeStyling(node: HTMLElement, useCache = false) {
@ -112,7 +112,7 @@ export default function calculateNodeHeight(
// Copy all CSS properties that have an impact on the height of the content in
// the textbox
let {
const {
paddingSize, borderSize,
boxSizing, sizingStyle,
} = calculateNodeStyling(uiTextNode, useCache);
@ -139,7 +139,7 @@ export default function calculateNodeHeight(
if (minRows !== null || maxRows !== null) {
// measure height of a textarea with a single row
hiddenTextarea.value = ' ';
let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
if (minRows !== null) {
minHeight = singleRowHeight * minRows;
if (boxSizing === 'border-box') {

2
components/radio/radio.tsx

@ -52,7 +52,7 @@ export default class Radio extends React.Component<RadioProps, {}> {
...restProps
} = props;
const { radioGroup } = context;
let radioProps: RadioProps = { ...restProps };
const radioProps: RadioProps = { ...restProps };
if (radioGroup) {
radioProps.name = radioGroup.name;
radioProps.onChange = radioGroup.onChange;

8
components/table/SelectionCheckboxAll.tsx

@ -69,7 +69,7 @@ export default class SelectionCheckboxAll<T> extends
const checked = this.getCheckState(props);
const indeterminate = this.getIndeterminateState(props);
this.setState((prevState) => {
let newState: SelectionCheckboxAllState = {};
const newState: SelectionCheckboxAllState = {};
if (indeterminate !== prevState.indeterminate) {
newState.indeterminate = indeterminate;
}
@ -118,7 +118,7 @@ export default class SelectionCheckboxAll<T> extends
}
handleSelectAllChagne = (e: CheckboxChangeEvent) => {
let checked = e.target.checked;
const checked = e.target.checked;
this.props.onSelect(checked ? 'all' : 'removeAll', 0, null);
}
@ -142,12 +142,12 @@ export default class SelectionCheckboxAll<T> extends
const { disabled, prefixCls, selections, getPopupContainer } = this.props;
const { checked, indeterminate } = this.state;
let selectionPrefixCls = `${prefixCls}-selection`;
const selectionPrefixCls = `${prefixCls}-selection`;
let customSelections: React.ReactNode = null;
if (selections) {
let newSelections = Array.isArray(selections) ? this.defaultSelections.concat(selections)
const newSelections = Array.isArray(selections) ? this.defaultSelections.concat(selections)
: this.defaultSelections;
const menu = (

28
components/table/Table.tsx

@ -301,7 +301,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
}
getFiltersFromColumns(columns?: ColumnProps<T>[]) {
let filters: any = {};
const filters: any = {};
this.getFilteredValueColumns(columns).forEach((col: ColumnProps<T>) => {
const colKey = this.getColumnKey(col) as string;
filters[colKey] = col.filteredValue;
@ -312,7 +312,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
getDefaultSortOrder(columns?: ColumnProps<T>[]) {
const definedSortState = this.getSortStateFromColumns(columns);
let defaultSortedColumn = flatFilter(columns || [], (column: ColumnProps<T>) => column.defaultSortOrder != null)[0];
const defaultSortedColumn = flatFilter(columns || [], (column: ColumnProps<T>) => column.defaultSortOrder != null)[0];
if (defaultSortedColumn && !definedSortState.sortColumn) {
return {
@ -408,7 +408,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
handleFilter = (column: ColumnProps<T>, nextFilters: string[]) => {
const props = this.props;
let pagination = { ...this.state.pagination };
const pagination = { ...this.state.pagination };
const filters = {
...this.state.filters,
[this.getColumnKey(column) as string]: nextFilters,
@ -477,7 +477,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
const nativeEvent = e.nativeEvent;
const defaultSelection = this.store.getState().selectionDirty ? [] : this.getDefaultSelection();
let selectedRowKeys = this.store.getState().selectedRowKeys.concat(defaultSelection);
let key = this.getRecordKey(record, rowIndex);
const key = this.getRecordKey(record, rowIndex);
const { pivot } = this.state;
const rows = this.getFlatCurrentPageData();
let realIndex = rowIndex;
@ -546,7 +546,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
const nativeEvent = e.nativeEvent;
const defaultSelection = this.store.getState().selectionDirty ? [] : this.getDefaultSelection();
let selectedRowKeys = this.store.getState().selectedRowKeys.concat(defaultSelection);
let key = this.getRecordKey(record, rowIndex);
const key = this.getRecordKey(record, rowIndex);
selectedRowKeys = [key];
this.store.setState({
selectionDirty: true,
@ -568,7 +568,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
.filter((item, i) => !this.getCheckboxPropsByItem(item, i).disabled)
.map((item, i) => this.getRecordKey(item, i));
let changeRowKeys: string[] = [];
const changeRowKeys: string[] = [];
let selectWay: TableSelectWay = 'onSelectAll';
let checked;
// handle default selection
@ -629,7 +629,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
handlePageChange = (current: number, ...otherArguments: any[]) => {
const props = this.props;
let pagination = { ...this.state.pagination };
const pagination = { ...this.state.pagination };
if (current) {
pagination.current = current;
} else {
@ -715,7 +715,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
}
return true;
});
let selectionColumnClass = classNames(`${prefixCls}-selection-column`, {
const selectionColumnClass = classNames(`${prefixCls}-selection-column`, {
[`${prefixCls}-selection-column-custom`]: rowSelection.selections,
});
const selectionColumn: ColumnProps<any> = {
@ -787,7 +787,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
let sortButton;
const isSortColumn = this.isSortColumn(column);
if ((column.filters && column.filters.length > 0) || column.filterDropdown) {
let colFilters = this.state.filters[key] || [];
const colFilters = this.state.filters[key] || [];
filterDropdown = (
<FilterDropdown
locale={locale}
@ -886,8 +886,8 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
} else if (this.props.size as string === 'middle' || this.props.size === 'small') {
size = 'small';
}
let position = pagination.position || 'bottom';
let total = pagination.total || this.getLocalData().length;
const position = pagination.position || 'bottom';
const total = pagination.total || this.getLocalData().length;
return (total > 0 && (position === paginationPosition || position === 'both')) ? (
<Pagination
key={`pagination-${paginationPosition}`}
@ -938,7 +938,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
let data = this.getLocalData();
let current: number;
let pageSize: number;
let state = this.state;
const state = this.state;
// 如果没有分页的话,默认全部展示
if (!this.hasPagination()) {
pageSize = Number.MAX_VALUE;
@ -989,11 +989,11 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
// 筛选
if (currentState.filters) {
Object.keys(currentState.filters).forEach((columnKey) => {
let col = this.findColumn(columnKey) as any;
const col = this.findColumn(columnKey) as any;
if (!col) {
return;
}
let values = currentState.filters[columnKey] || [];
const values = currentState.filters[columnKey] || [];
if (values.length === 0) {
return;
}

4
components/tabs/index.tsx

@ -88,7 +88,7 @@ export default class Tabs extends React.Component<TabsProps, any> {
}
render() {
let {
const {
prefixCls,
className = '',
size,
@ -96,9 +96,9 @@ export default class Tabs extends React.Component<TabsProps, any> {
tabPosition,
children,
animated = true,
tabBarExtraContent,
hideAdd,
} = this.props;
let { tabBarExtraContent } = this.props;
let tabPaneAnimated = typeof animated === 'object' ? animated.tabPane : animated;

2
components/tree/Tree.tsx

@ -208,7 +208,7 @@ export default class Tree extends React.Component<TreeProps, any> {
render() {
const props = this.props;
const { prefixCls, className, showIcon } = props;
let checkable = props.checkable;
const checkable = props.checkable;
return (
<RcTree
ref={this.setTreeRef}

12
components/upload/Upload.tsx

@ -109,8 +109,8 @@ class Upload extends React.Component<UploadProps, UploadState> {
}
} catch (e) { /* do nothing */
}
let fileList = this.state.fileList;
let targetItem = getFileItem(file, fileList);
const fileList = this.state.fileList;
const targetItem = getFileItem(file, fileList);
// removed
if (!targetItem) {
return;
@ -124,8 +124,8 @@ class Upload extends React.Component<UploadProps, UploadState> {
}
onProgress = (e: { percent: number }, file: UploadFile) => {
let fileList = this.state.fileList;
let targetItem = getFileItem(file, fileList);
const fileList = this.state.fileList;
const targetItem = getFileItem(file, fileList);
// removed
if (!targetItem) {
return;
@ -140,8 +140,8 @@ class Upload extends React.Component<UploadProps, UploadState> {
onError = (error: Error, response: any, file: UploadFile) => {
this.clearProgressTimer();
let fileList = this.state.fileList;
let targetItem = getFileItem(file, fileList);
const fileList = this.state.fileList;
const targetItem = getFileItem(file, fileList);
// removed
if (!targetItem) {
return;

2
components/upload/UploadList.tsx

@ -106,7 +106,7 @@ export default class UploadList extends React.Component<UploadListProps, any> {
} else if (!file.thumbUrl && !file.url) {
icon = <Icon className={`${prefixCls}-list-item-thumbnail`} type="picture" />;
} else {
let thumbnail = isImageUrl(file)
const thumbnail = isImageUrl(file)
? <img src={file.thumbUrl || file.url} alt={file.name} />
: <Icon type="file" className={`${prefixCls}-list-item-icon`} />;
icon = (

Loading…
Cancel
Save