diff --git a/src/Scoped.tsx b/src/Scoped.tsx index 3d458424..e28a2a6b 100644 --- a/src/Scoped.tsx +++ b/src/Scoped.tsx @@ -4,9 +4,9 @@ */ import React from 'react'; -import find = require('lodash/find'); +import find from 'lodash/find'; import PropTypes from 'prop-types'; -import hoistNonReactStatic = require('hoist-non-react-statics'); +import hoistNonReactStatic from 'hoist-non-react-statics'; import qs from 'qs'; import {dataMapping} from './utils/tpl-builtin'; import {RendererEnv, RendererProps} from './factory'; diff --git a/src/components/Checkboxes.tsx b/src/components/Checkboxes.tsx index 44a9dc1c..67dd47b7 100644 --- a/src/components/Checkboxes.tsx +++ b/src/components/Checkboxes.tsx @@ -5,14 +5,14 @@ */ import React from "react"; -import uncontrollable = require("uncontrollable"); +import uncontrollable from "uncontrollable"; import Checkbox from "./Checkbox"; -import find = require("lodash/find"); -import chunk = require("lodash/chunk"); +import find from "lodash/find"; +import chunk from "lodash/chunk"; import { flattenTree, isObject } from "../utils/helper"; import { ClassNamesFn, themeable } from "../theme"; import { optionValueCompare } from "./Select"; -// import isPlainObject = require('lodash/isPlainObject'); +// import isPlainObject from 'lodash/isPlainObject'; export interface Option { label?: string; diff --git a/src/components/Collapse.tsx b/src/components/Collapse.tsx index 09e9880f..ff9a6adf 100644 --- a/src/components/Collapse.tsx +++ b/src/components/Collapse.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; -import css = require('dom-helpers/style/index'); +import css from 'dom-helpers/style/index'; import {ClassNamesFn, themeable} from '../theme'; import Transition, { EXITED, diff --git a/src/components/ColorPicker.tsx b/src/components/ColorPicker.tsx index a35b4750..cc1eb4bc 100644 --- a/src/components/ColorPicker.tsx +++ b/src/components/ColorPicker.tsx @@ -10,7 +10,7 @@ import {findDOMNode} from 'react-dom'; import {SketchPicker, GithubPicker, ColorResult} from 'react-color'; import {Icon} from './icons'; import Overlay from './Overlay'; -import uncontrollable = require('uncontrollable'); +import uncontrollable from 'uncontrollable'; import PopOver from './PopOver'; import {ClassNamesFn, themeable} from '../theme'; import {autobind} from '../utils/helper'; diff --git a/src/components/DateRangePicker.tsx b/src/components/DateRangePicker.tsx index 124fd34f..8e1346ff 100644 --- a/src/components/DateRangePicker.tsx +++ b/src/components/DateRangePicker.tsx @@ -4,8 +4,8 @@ * @author fex */ -import React = require('react'); -import moment = require('moment'); +import React from 'react'; +import moment from 'moment'; import {findDOMNode} from 'react-dom'; import cx from 'classnames'; import {Icon} from './icons'; diff --git a/src/components/LazyComponent.tsx b/src/components/LazyComponent.tsx index b6064174..b8810289 100644 --- a/src/components/LazyComponent.tsx +++ b/src/components/LazyComponent.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; -import VisibilitySensor = require('react-visibility-sensor'); +import VisibilitySensor from 'react-visibility-sensor'; import Spinner from './Spinner'; export interface LazyComponentProps { diff --git a/src/components/Radios.tsx b/src/components/Radios.tsx index 79dc5ee2..d7756479 100644 --- a/src/components/Radios.tsx +++ b/src/components/Radios.tsx @@ -14,10 +14,10 @@ */ import React from 'react'; -import uncontrollable = require('uncontrollable'); +import uncontrollable from 'uncontrollable'; import Checkbox from './Checkbox'; import {value2array, OptionProps, Option} from './Checkboxes'; -import chunk = require('lodash/chunk'); +import chunk from 'lodash/chunk'; import {ClassNamesFn, themeable} from '../theme'; interface RadioProps extends OptionProps { diff --git a/src/components/Range.tsx b/src/components/Range.tsx index 1e54c9a1..9d79c1fa 100644 --- a/src/components/Range.tsx +++ b/src/components/Range.tsx @@ -6,7 +6,7 @@ import React from 'react'; import InputRange from 'react-input-range'; -import uncontrollable = require('uncontrollable'); +import uncontrollable from 'uncontrollable'; import cx from 'classnames'; import {RendererProps} from '../factory'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 884dd648..b142eb63 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -5,7 +5,7 @@ * @date 2017-11-07 */ -import uncontrollable = require('uncontrollable'); +import uncontrollable from 'uncontrollable'; import React from 'react'; import 'react-datetime/css/react-datetime.css'; import Overlay from './Overlay'; @@ -15,9 +15,9 @@ import {closeIcon, Icon} from './icons'; // @ts-ignore import matchSorter from 'match-sorter'; import {noop, isObject} from '../utils/helper'; -import find = require('lodash/find'); -import isPlainObject = require('lodash/isPlainObject'); -import union = require('lodash/union'); +import find from 'lodash/find'; +import isPlainObject from 'lodash/isPlainObject'; +import union from 'lodash/union'; import {highlight} from '../renderers/Form/Options'; import {findDOMNode} from 'react-dom'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/TooltipWrapper.tsx b/src/components/TooltipWrapper.tsx index 76a60519..185f8436 100644 --- a/src/components/TooltipWrapper.tsx +++ b/src/components/TooltipWrapper.tsx @@ -4,9 +4,9 @@ * @author fex */ -import React = require('react'); +import React from 'react'; import Html from './Html'; -import uncontrollable = require('uncontrollable'); +import uncontrollable from 'uncontrollable'; import {findDOMNode} from 'react-dom'; import Tooltip from './Tooltip'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/factory.tsx b/src/factory.tsx index a353319c..22000979 100644 --- a/src/factory.tsx +++ b/src/factory.tsx @@ -29,13 +29,13 @@ import { } from './types'; import {observer} from 'mobx-react'; import getExprProperties from './utils/filter-schema'; -import hoistNonReactStatic = require('hoist-non-react-statics'); -import omit = require('lodash/omit'); -import difference = require('lodash/difference'); -import isPlainObject = require('lodash/isPlainObject'); +import hoistNonReactStatic from 'hoist-non-react-statics'; +import omit from 'lodash/omit'; +import difference from 'lodash/difference'; +import isPlainObject from 'lodash/isPlainObject'; import Scoped from './Scoped'; import {getTheme, ThemeInstance, ClassNamesFn, ThemeContext} from './theme'; -import find = require('lodash/find'); +import find from 'lodash/find'; import Alert from './components/Alert2'; import {LazyComponent} from './components'; import ImageGallery from './components/ImageGallery'; diff --git a/src/renderers/Action.tsx b/src/renderers/Action.tsx index 5dd3ae81..f9b4ba92 100644 --- a/src/renderers/Action.tsx +++ b/src/renderers/Action.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {filter} from '../utils/tpl'; import Button from '../components/Button'; -import pick = require('lodash/pick'); +import pick from 'lodash/pick'; const ActionProps = [ 'dialog', 'drawer', diff --git a/src/renderers/Alert.tsx b/src/renderers/Alert.tsx index 6d5f7c9c..f1ddbb00 100644 --- a/src/renderers/Alert.tsx +++ b/src/renderers/Alert.tsx @@ -1,5 +1,5 @@ import {Renderer, RendererProps} from '../factory'; -import React = require('react'); +import React from 'react'; import Alert, {AlertProps} from '../components/Alert2'; @Renderer({ diff --git a/src/renderers/Audio.tsx b/src/renderers/Audio.tsx index dd7e78c8..7332c5f9 100644 --- a/src/renderers/Audio.tsx +++ b/src/renderers/Audio.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import upperFirst = require('lodash/upperFirst'); +import upperFirst from 'lodash/upperFirst'; import {Renderer, RendererProps} from '../factory'; import {autobind} from '../utils/helper'; import {Icon} from '../components/icons'; diff --git a/src/renderers/CRUD.tsx b/src/renderers/CRUD.tsx index cde1b09b..7f235da9 100644 --- a/src/renderers/CRUD.tsx +++ b/src/renderers/CRUD.tsx @@ -14,18 +14,18 @@ import { qsstringify } from '../utils/helper'; import {observer} from 'mobx-react'; -import partition = require('lodash/partition'); +import partition from 'lodash/partition'; import Scoped, {ScopedContext, IScopedContext} from '../Scoped'; import Button from '../components/Button'; import Select from '../components/Select'; import getExprProperties from '../utils/filter-schema'; -import pick = require('lodash/pick'); +import pick from 'lodash/pick'; import qs from 'qs'; import {findDOMNode} from 'react-dom'; import {evalExpression, filter} from '../utils/tpl'; import {isValidApi, buildApi, isEffectiveApi} from '../utils/api'; -import omit = require('lodash/omit'); -import find = require('lodash/find'); +import omit from 'lodash/omit'; +import find from 'lodash/find'; import Html from '../components/Html'; import {Spinner} from '../components'; diff --git a/src/renderers/Cards.tsx b/src/renderers/Cards.tsx index 33dd126e..d265aa19 100644 --- a/src/renderers/Cards.tsx +++ b/src/renderers/Cards.tsx @@ -13,9 +13,9 @@ import { ucFirst } from '../utils/helper'; import {resolveVariable} from '../utils/tpl-builtin'; -import Sortable = require('sortablejs'); +import Sortable from 'sortablejs'; import {filter} from '../utils/tpl'; -import debounce = require('lodash/debounce'); +import debounce from 'lodash/debounce'; import {resizeSensor} from '../utils/resize-sensor'; export interface Column { diff --git a/src/renderers/Copyable.tsx b/src/renderers/Copyable.tsx index d84f9133..c06950ae 100644 --- a/src/renderers/Copyable.tsx +++ b/src/renderers/Copyable.tsx @@ -6,7 +6,7 @@ import React from 'react'; import {RendererProps} from '../factory'; import cx from 'classnames'; -import hoistNonReactStatic = require('hoist-non-react-statics'); +import hoistNonReactStatic from 'hoist-non-react-statics'; import Button from '../components/Button'; import {filter} from '../utils/tpl'; diff --git a/src/renderers/Dialog.tsx b/src/renderers/Dialog.tsx index a79798a2..dbc145a6 100644 --- a/src/renderers/Dialog.tsx +++ b/src/renderers/Dialog.tsx @@ -4,7 +4,7 @@ import {Renderer, RendererProps} from '../factory'; import {SchemaNode, Schema, Action} from '../types'; import {filter} from '../utils/tpl'; import Modal from '../components/Modal'; -import findLast = require('lodash/findLast'); +import findLast from 'lodash/findLast'; import {guid, isVisible} from '../utils/helper'; import {reaction} from 'mobx'; import {Icon} from '../components/icons'; diff --git a/src/renderers/Drawer.tsx b/src/renderers/Drawer.tsx index e1b86883..bf1c7387 100644 --- a/src/renderers/Drawer.tsx +++ b/src/renderers/Drawer.tsx @@ -3,7 +3,7 @@ import {ScopedContext, IScopedContext} from '../Scoped'; import {Renderer, RendererProps} from '../factory'; import {SchemaNode, Schema, Action} from '../types'; import {default as DrawerContainer} from '../components/Drawer'; -import findLast = require('lodash/findLast'); +import findLast from 'lodash/findLast'; import {guid, isVisible} from '../utils/helper'; import {reaction} from 'mobx'; import {findDOMNode} from 'react-dom'; diff --git a/src/renderers/Form/Checkboxes.tsx b/src/renderers/Form/Checkboxes.tsx index 71970ae6..57c46146 100644 --- a/src/renderers/Form/Checkboxes.tsx +++ b/src/renderers/Form/Checkboxes.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {OptionsControl, OptionsControlProps, Option} from './Options'; import cx from 'classnames'; import Checkbox from '../../components/Checkbox'; -import chunk = require('lodash/chunk'); +import chunk from 'lodash/chunk'; export interface CheckboxesProps extends OptionsControlProps { placeholder?: any; diff --git a/src/renderers/Form/Combo.tsx b/src/renderers/Form/Combo.tsx index da7a61f3..309386b4 100644 --- a/src/renderers/Form/Combo.tsx +++ b/src/renderers/Form/Combo.tsx @@ -14,9 +14,9 @@ import { autobind, isObjectShallowModified } from '../../utils/helper'; -import Sortable = require('sortablejs'); +import Sortable from 'sortablejs'; import {evalExpression, filter} from '../../utils/tpl'; -import find = require('lodash/find'); +import find from 'lodash/find'; import Select from '../../components/Select'; import {dataMapping, resolveVariable} from '../../utils/tpl-builtin'; import {isEffectiveApi} from '../../utils/api'; diff --git a/src/renderers/Form/Control.tsx b/src/renderers/Form/Control.tsx index 64d62bcf..c6781bad 100644 --- a/src/renderers/Form/Control.tsx +++ b/src/renderers/Form/Control.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {IFormStore, IFormItemStore} from '../../store/form'; -import debouce = require('lodash/debounce'); +import debouce from 'lodash/debounce'; import {RendererProps, Renderer} from '../../factory'; import {ComboStore, IComboStore, IUniqueGroup} from '../../store/combo'; diff --git a/src/renderers/Form/DiffEditor.tsx b/src/renderers/Form/DiffEditor.tsx index b475fb61..3563dda8 100644 --- a/src/renderers/Form/DiffEditor.tsx +++ b/src/renderers/Form/DiffEditor.tsx @@ -4,7 +4,7 @@ import {FormItem, FormControlProps} from './Item'; import {filter} from '../../utils/tpl'; import cx from 'classnames'; import LazyComponent from '../../components/LazyComponent'; -import debouce = require('lodash/debounce'); +import debouce from 'lodash/debounce'; import {isPureVariable} from '../../utils/tpl-builtin'; function loadComponent(): Promise { diff --git a/src/renderers/Form/Editor.tsx b/src/renderers/Form/Editor.tsx index 934534b4..8fc92d4f 100644 --- a/src/renderers/Form/Editor.tsx +++ b/src/renderers/Form/Editor.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {FormItem, FormControlProps} from './Item'; import LazyComponent from '../../components/LazyComponent'; -import debouce = require('lodash/debounce'); +import debouce from 'lodash/debounce'; import Editor from '../../components/Editor'; export interface EditorProps extends FormControlProps { diff --git a/src/renderers/Form/File.tsx b/src/renderers/Form/File.tsx index 38f54e62..100ac768 100644 --- a/src/renderers/Form/File.tsx +++ b/src/renderers/Form/File.tsx @@ -2,8 +2,8 @@ import React from 'react'; import {FormItem, FormControlProps} from './Item'; import cx from 'classnames'; import qs from 'qs'; -import find = require('lodash/find'); -import isPlainObject = require('lodash/isPlainObject'); +import find from 'lodash/find'; +import isPlainObject from 'lodash/isPlainObject'; import {mapLimit} from 'async'; import ImageControl from './Image'; import {Payload, ApiObject, ApiString} from '../../types'; diff --git a/src/renderers/Form/Grid.tsx b/src/renderers/Form/Grid.tsx index 91306412..15d88556 100644 --- a/src/renderers/Form/Grid.tsx +++ b/src/renderers/Form/Grid.tsx @@ -3,7 +3,7 @@ import Grid, {ColumnNode, Column, ColProps, ColumnArray} from '../Grid'; import {Schema} from '../../types'; import {FormItem, FormControlProps} from './Item'; -import pick = require('lodash/pick'); +import pick from 'lodash/pick'; import React from 'react'; import cx from 'classnames'; diff --git a/src/renderers/Form/Image.tsx b/src/renderers/Form/Image.tsx index 8a49344a..7a1cc81b 100644 --- a/src/renderers/Form/Image.tsx +++ b/src/renderers/Form/Image.tsx @@ -4,7 +4,7 @@ import {FormItem, FormControlProps} from './Item'; import Cropper from 'react-cropper'; import DropZone from 'react-dropzone'; import 'blueimp-canvastoblob'; -import find = require('lodash/find'); +import find from 'lodash/find'; import qs from 'qs'; import {Payload} from '../../types'; import {buildApi} from '../../utils/api'; diff --git a/src/renderers/Form/Item.tsx b/src/renderers/Form/Item.tsx index 64a7e29b..f1d5bf9a 100644 --- a/src/renderers/Form/Item.tsx +++ b/src/renderers/Form/Item.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import hoistNonReactStatic = require('hoist-non-react-statics'); +import hoistNonReactStatic from 'hoist-non-react-statics'; import {IFormItemStore, IFormStore} from '../../store/form'; import {reaction} from 'mobx'; diff --git a/src/renderers/Form/NestedSelect.tsx b/src/renderers/Form/NestedSelect.tsx index 9ebb1c5f..07e38f3d 100644 --- a/src/renderers/Form/NestedSelect.tsx +++ b/src/renderers/Form/NestedSelect.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import xorBy = require('lodash/xorBy'); -import unionBy = require('lodash/unionBy'); +import xorBy from 'lodash/xorBy'; +import unionBy from 'lodash/unionBy'; import Overlay from '../../components/Overlay'; import Checkbox from '../../components/Checkbox'; import PopOver from '../../components/PopOver'; diff --git a/src/renderers/Form/Picker.tsx b/src/renderers/Form/Picker.tsx index ae957857..ba979466 100644 --- a/src/renderers/Form/Picker.tsx +++ b/src/renderers/Form/Picker.tsx @@ -3,7 +3,7 @@ import {OptionsControl, OptionsControlProps, Option} from './Options'; import cx from 'classnames'; import Button from '../../components/Button'; import {SchemaNode, Schema, Action} from '../../types'; -import find = require('lodash/find'); +import find from 'lodash/find'; import { anyChanged, autobind, @@ -11,7 +11,7 @@ import { noop, createObject } from '../../utils/helper'; -import findIndex = require('lodash/findIndex'); +import findIndex from 'lodash/findIndex'; import Html from '../../components/Html'; import {filter} from '../../utils/tpl'; import {Icon} from '../../components/icons'; diff --git a/src/renderers/Form/Range.tsx b/src/renderers/Form/Range.tsx index 2b748589..e067646b 100644 --- a/src/renderers/Form/Range.tsx +++ b/src/renderers/Form/Range.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import isNumber = require('lodash/isNumber'); -import isObject = require('lodash/isObject'); -import isEqual = require('lodash/isEqual'); +import isNumber from 'lodash/isNumber'; +import isObject from 'lodash/isObject'; +import isEqual from 'lodash/isEqual'; import {FormItem, FormControlProps} from './Item'; import cx from 'classnames'; import InputRange from '../../components/Range'; diff --git a/src/renderers/Form/Select.tsx b/src/renderers/Form/Select.tsx index c798d85d..4c3def1f 100644 --- a/src/renderers/Form/Select.tsx +++ b/src/renderers/Form/Select.tsx @@ -2,8 +2,8 @@ import React from 'react'; import cx from 'classnames'; import {OptionsControl, OptionsControlProps, Option} from './Options'; import Select from '../../components/Select'; -import find = require('lodash/find'); -import debouce = require('lodash/debounce'); +import find from 'lodash/find'; +import debouce from 'lodash/debounce'; import {Api} from '../../types'; import {isEffectiveApi} from '../../utils/api'; import {isEmpty, createObject} from '../../utils/helper'; diff --git a/src/renderers/Form/SubForm.tsx b/src/renderers/Form/SubForm.tsx index aa14a3b8..4f4cc9ae 100644 --- a/src/renderers/Form/SubForm.tsx +++ b/src/renderers/Form/SubForm.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {FormItem, FormControlProps} from './Item'; import cx from 'classnames'; -import omit = require('lodash/omit'); -import pick = require('lodash/pick'); +import omit from 'lodash/omit'; +import pick from 'lodash/pick'; import {createObject} from '../../utils/helper'; export interface SubFormProps extends FormControlProps { diff --git a/src/renderers/Form/Table.tsx b/src/renderers/Form/Table.tsx index abee1172..3bece206 100644 --- a/src/renderers/Form/Table.tsx +++ b/src/renderers/Form/Table.tsx @@ -6,10 +6,10 @@ import {createObject, isObjectShallowModified} from '../../utils/helper'; import {RendererData, Action, Api, Payload} from '../../types'; import {isEffectiveApi} from '../../utils/api'; import {filter} from '../../utils/tpl'; -import omit = require('lodash/omit'); +import omit from 'lodash/omit'; import {dataMapping} from '../../utils/tpl-builtin'; -import findIndex = require('lodash/findIndex'); -import memoize = require('lodash/memoize'); +import findIndex from 'lodash/findIndex'; +import memoize from 'lodash/memoize'; export interface TableProps extends FormControlProps { placeholder?: string; diff --git a/src/renderers/Form/Tag.tsx b/src/renderers/Form/Tag.tsx index f909a09d..2dc0b2b4 100644 --- a/src/renderers/Form/Tag.tsx +++ b/src/renderers/Form/Tag.tsx @@ -4,8 +4,8 @@ import cx from 'classnames'; import {Action} from '../../types'; import Downshift from 'downshift'; import matchSorter from 'match-sorter'; -import debouce = require('lodash/debounce'); -import find = require('lodash/find'); +import debouce from 'lodash/debounce'; +import find from 'lodash/find'; import {Icon} from '../../components/icons'; import {Portal} from 'react-overlays'; import {findDOMNode} from 'react-dom'; diff --git a/src/renderers/Form/Text.tsx b/src/renderers/Form/Text.tsx index 2f0c4c8c..769be3e6 100644 --- a/src/renderers/Form/Text.tsx +++ b/src/renderers/Form/Text.tsx @@ -5,9 +5,9 @@ import {Action} from '../../types'; import Downshift, {StateChangeOptions} from 'downshift'; // @ts-ignore import matchSorter from 'match-sorter'; -import debouce = require('lodash/debounce'); +import debouce from 'lodash/debounce'; import {filter} from '../../utils/tpl'; -import find = require('lodash/find'); +import find from 'lodash/find'; import {Icon} from '../../components/icons'; import Input from '../../components/Input'; import {autobind, createObject, setVariable} from '../../utils/helper'; diff --git a/src/renderers/Form/TreeSelect.tsx b/src/renderers/Form/TreeSelect.tsx index c51b9645..81636dab 100644 --- a/src/renderers/Form/TreeSelect.tsx +++ b/src/renderers/Form/TreeSelect.tsx @@ -8,8 +8,8 @@ import {Icon} from '../../components/icons'; import TreeSelector from '../../components/Tree'; // @ts-ignore import matchSorter from 'match-sorter'; -import debouce = require('lodash/debounce'); -import find = require('lodash/find'); +import debouce from 'lodash/debounce'; +import find from 'lodash/find'; import {Api} from '../../types'; import {isEffectiveApi} from '../../utils/api'; diff --git a/src/renderers/Form/index.tsx b/src/renderers/Form/index.tsx index 7be8ee04..88c2e956 100644 --- a/src/renderers/Form/index.tsx +++ b/src/renderers/Form/index.tsx @@ -16,16 +16,16 @@ import { isVisible, cloneObject } from '../../utils/helper'; -import debouce = require('lodash/debounce'); -import flatten = require('lodash/flatten'); -import find = require('lodash/find'); +import debouce from 'lodash/debounce'; +import flatten from 'lodash/flatten'; +import find from 'lodash/find'; import Scoped, { ScopedContext, IScopedContext, ScopedComponentType } from '../../Scoped'; import {IComboStore} from '../../store/combo'; -import qs = require('qs'); +import qs from 'qs'; import {dataMapping} from '../../utils/tpl-builtin'; import {isApiOutdated, isEffectiveApi} from '../../utils/api'; import Spinner from '../../components/Spinner'; diff --git a/src/renderers/Grid.tsx b/src/renderers/Grid.tsx index 854434b4..4b132a30 100644 --- a/src/renderers/Grid.tsx +++ b/src/renderers/Grid.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {Schema} from '../types'; import cx from 'classnames'; -import pick = require('lodash/pick'); +import pick from 'lodash/pick'; export const ColProps = ['lg', 'md', 'sm', 'xs']; diff --git a/src/renderers/List.tsx b/src/renderers/List.tsx index be227098..dbb82632 100644 --- a/src/renderers/List.tsx +++ b/src/renderers/List.tsx @@ -19,7 +19,7 @@ import { import {resolveVariable} from '../utils/tpl-builtin'; import QuickEdit from './QuickEdit'; import PopOver from './PopOver'; -import Sortable = require('sortablejs'); +import Sortable from 'sortablejs'; import {TableCell} from './Table'; import Copyable from './Copyable'; diff --git a/src/renderers/PopOver.tsx b/src/renderers/PopOver.tsx index fb3308c3..201862e1 100644 --- a/src/renderers/PopOver.tsx +++ b/src/renderers/PopOver.tsx @@ -7,7 +7,7 @@ import React from 'react'; import {findDOMNode} from 'react-dom'; import {RendererProps} from '../factory'; import cx from 'classnames'; -import hoistNonReactStatic = require('hoist-non-react-statics'); +import hoistNonReactStatic from 'hoist-non-react-statics'; import {RootCloseWrapper} from 'react-overlays'; import PopOver, {Offset} from '../components/PopOver'; import Overlay from '../components/Overlay'; diff --git a/src/renderers/QRCode.tsx b/src/renderers/QRCode.tsx index 8cebbc85..596a0713 100644 --- a/src/renderers/QRCode.tsx +++ b/src/renderers/QRCode.tsx @@ -3,7 +3,7 @@ import cx from 'classnames'; import {Renderer, RendererProps} from '../factory'; import {FormItem, FormControlProps} from './Form/Item'; import {filter} from '../utils/tpl'; -import QrCode = require('qrcode.react'); +import QrCode from 'qrcode.react'; export interface QRCodeProps extends FormControlProps { codeSize?: number; diff --git a/src/renderers/QuickEdit.tsx b/src/renderers/QuickEdit.tsx index a2e98f5e..1768340a 100644 --- a/src/renderers/QuickEdit.tsx +++ b/src/renderers/QuickEdit.tsx @@ -5,16 +5,16 @@ import React from 'react'; import {findDOMNode} from 'react-dom'; -import find = require('lodash/find'); +import find from 'lodash/find'; import PropTypes from 'prop-types'; -import isPlainObject = require('lodash/isPlainObject'); +import isPlainObject from 'lodash/isPlainObject'; import {RendererProps} from '../factory'; import cx from 'classnames'; -import hoistNonReactStatic = require('hoist-non-react-statics'); +import hoistNonReactStatic from 'hoist-non-react-statics'; import onClickOutside from 'react-onclickoutside'; import {Action} from '../types'; import keycode from 'keycode'; -import matches = require('dom-helpers/query/matches'); +import matches from 'dom-helpers/query/matches'; import Overlay from '../components/Overlay'; import PopOver from '../components/PopOver'; diff --git a/src/renderers/Table.tsx b/src/renderers/Table.tsx index e5217a56..fdfe1230 100644 --- a/src/renderers/Table.tsx +++ b/src/renderers/Table.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {findDOMNode} from 'react-dom'; import {Renderer, RendererProps} from '../factory'; import {SchemaNode, Action, Schema, Api, ApiObject} from '../types'; -import forEach = require('lodash/forEach'); +import forEach from 'lodash/forEach'; import {filter} from '../utils/tpl'; import cx from 'classnames'; import DropDownButton from './DropDownButton'; @@ -25,15 +25,15 @@ import { buildApi, normalizeApi } from '../utils/api'; -import debounce = require('lodash/debounce'); -import xor = require('lodash/xor'); +import debounce from 'lodash/debounce'; +import xor from 'lodash/xor'; import QuickEdit from './QuickEdit'; import PopOver from '../components/PopOver'; import Copyable from './Copyable'; -import Sortable = require('sortablejs'); -import flatMap = require('lodash/flatMap'); +import Sortable from 'sortablejs'; +import flatMap from 'lodash/flatMap'; import {resizeSensor} from '../utils/resize-sensor'; -import find = require('lodash/find'); +import find from 'lodash/find'; import Overlay from '../components/Overlay'; import PopOverable from './PopOver'; diff --git a/src/renderers/Tabs.tsx b/src/renderers/Tabs.tsx index 16c6d310..f1aabfb2 100644 --- a/src/renderers/Tabs.tsx +++ b/src/renderers/Tabs.tsx @@ -1,9 +1,9 @@ import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {Action, Schema, SchemaNode} from '../types'; -import find = require('lodash/find'); +import find from 'lodash/find'; import {isVisible, autobind, isDisabled} from '../utils/helper'; -import findIndex = require('lodash/findIndex'); +import findIndex from 'lodash/findIndex'; import {Tabs as CTabs, Tab} from '../components/Tabs'; import {ClassNamesFn} from '../theme'; diff --git a/src/renderers/Tasks.tsx b/src/renderers/Tasks.tsx index 9fa48918..74f18da4 100644 --- a/src/renderers/Tasks.tsx +++ b/src/renderers/Tasks.tsx @@ -4,7 +4,7 @@ import {ServiceStore, IServiceStore} from '../store/service'; import cx from 'classnames'; import getExprProperties from '../utils/filter-schema'; import {Api, Payload} from '../types'; -import update = require('react-addons-update'); +import update from 'react-addons-update'; import {isEffectiveApi, isApiOutdated} from '../utils/api'; import {ScopedContext, IScopedContext} from '../Scoped'; diff --git a/src/store/crud.ts b/src/store/crud.ts index 5b99c371..ac8e8b68 100644 --- a/src/store/crud.ts +++ b/src/store/crud.ts @@ -18,7 +18,7 @@ import { } from '../utils/helper'; import {Api, Payload, fetchOptions, Action} from '../types'; import qs from 'qs'; -import pick = require('lodash/pick'); +import pick from 'lodash/pick'; import {resolveVariableAndFilter} from '../utils/tpl-builtin'; class ServerError extends Error { diff --git a/src/store/form.ts b/src/store/form.ts index d29f7a93..61f8373d 100644 --- a/src/store/form.ts +++ b/src/store/form.ts @@ -1,5 +1,5 @@ import {types, getEnv, flow, getRoot, detach} from 'mobx-state-tree'; -import debounce = require('lodash/debounce'); +import debounce from 'lodash/debounce'; import {ServiceStore} from './service'; import {FormItemStore, IFormItemStore, SFormItemStore} from './formItem'; import {Api, fetchOptions, Payload} from '../types'; @@ -17,7 +17,7 @@ import { mapObject } from '../utils/helper'; import {IComboStore} from './combo'; -import isEqual = require('lodash/isEqual'); +import isEqual from 'lodash/isEqual'; import {IRendererStore} from '.'; export const FormStore = ServiceStore.named('FormStore') diff --git a/src/store/formItem.ts b/src/store/formItem.ts index 98e40039..103e7f83 100644 --- a/src/store/formItem.ts +++ b/src/store/formItem.ts @@ -11,7 +11,7 @@ import {str2rules, validate as doValidate} from '../utils/validations'; import {Api, Payload, fetchOptions} from '../types'; import {ComboStore, IComboStore, IUniqueGroup} from './combo'; import {evalExpression} from '../utils/tpl'; -import findIndex = require('lodash/findIndex'); +import findIndex from 'lodash/findIndex'; import { isArrayChildrenModified, isObject, @@ -22,9 +22,9 @@ import { import {flattenTree} from '../utils/helper'; import {IRendererStore} from '.'; import {normalizeOptions, optionValueCompare} from '../components/Select'; -import find = require('lodash/find'); +import find from 'lodash/find'; import {SimpleMap} from '../utils/SimpleMap'; -import memoize = require('lodash/memoize'); +import memoize from 'lodash/memoize'; interface IOption { value?: string | number | null; diff --git a/src/store/list.ts b/src/store/list.ts index cb034f7b..67c61121 100644 --- a/src/store/list.ts +++ b/src/store/list.ts @@ -7,8 +7,8 @@ import { getRoot } from 'mobx-state-tree'; import {iRendererStore} from './iRenderer'; -import isEqual = require('lodash/isEqual'); -import find = require('lodash/find'); +import isEqual from 'lodash/isEqual'; +import find from 'lodash/find'; import {createObject, isObject, guid} from '../utils/helper'; import {evalExpression} from '../utils/tpl'; diff --git a/src/store/table.ts b/src/store/table.ts index b7246b69..52770cc9 100644 --- a/src/store/table.ts +++ b/src/store/table.ts @@ -10,8 +10,8 @@ import { } from 'mobx-state-tree'; import {iRendererStore} from './iRenderer'; import {resolveVariable} from '../utils/tpl-builtin'; -import isEqual = require('lodash/isEqual'); -import find = require('lodash/find'); +import isEqual from 'lodash/isEqual'; +import find from 'lodash/find'; import { isBreakpoint, createObject, diff --git a/src/theme.tsx b/src/theme.tsx index a21f8473..9e70e283 100644 --- a/src/theme.tsx +++ b/src/theme.tsx @@ -1,7 +1,7 @@ // 主题管理 import cx from 'classnames'; import React from 'react'; -import hoistNonReactStatic = require('hoist-non-react-statics'); +import hoistNonReactStatic from 'hoist-non-react-statics'; import {ExtractProps, Omit} from './types'; export type ClassValue = diff --git a/src/utils/SimpleMap.ts b/src/utils/SimpleMap.ts index 84a279ac..21451457 100644 --- a/src/utils/SimpleMap.ts +++ b/src/utils/SimpleMap.ts @@ -1,5 +1,5 @@ -import find = require('lodash/find'); -import findIndex = require('lodash/findIndex'); +import find from 'lodash/find'; +import findIndex from 'lodash/findIndex'; export class SimpleMap { private readonly list: Array<{ diff --git a/src/utils/dom.tsx b/src/utils/dom.tsx index 10ff12c6..66dd6027 100644 --- a/src/utils/dom.tsx +++ b/src/utils/dom.tsx @@ -1,11 +1,11 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import hoistNonReactStatic = require('hoist-non-react-statics'); -import domOwnerDocument = require('dom-helpers/ownerDocument'); -import css = require('dom-helpers/style/index'); -import getOffset = require('dom-helpers/query/offset'); -import getPosition = require('dom-helpers/query/position'); -import getScrollTop = require('dom-helpers/query/scrollTop'); +import hoistNonReactStatic from 'hoist-non-react-statics'; +import domOwnerDocument from 'dom-helpers/ownerDocument'; +import css from 'dom-helpers/style/index'; +import getOffset from 'dom-helpers/query/offset'; +import getPosition from 'dom-helpers/query/position'; +import getScrollTop from 'dom-helpers/query/scrollTop'; const bsMapping: { [propName: string]: string; diff --git a/src/utils/helper.ts b/src/utils/helper.ts index c4d719fa..772c9895 100644 --- a/src/utils/helper.ts +++ b/src/utils/helper.ts @@ -1,8 +1,8 @@ -import isPlainObject = require('lodash/isPlainObject'); -import transform = require('lodash/transform'); -import isEqual = require('lodash/isEqual'); -import lodashIsObject = require('lodash/isObject'); -import uniq = require('lodash/uniq'); +import isPlainObject from 'lodash/isPlainObject'; +import transform from 'lodash/transform'; +import isEqual from 'lodash/isEqual'; +import lodashIsObject from 'lodash/isObject'; +import uniq from 'lodash/uniq'; import {Schema, PlainObject, FunctionPropertyNames} from '../types'; import {evalExpression} from './tpl'; import {boundMethod} from 'autobind-decorator'; diff --git a/src/utils/tpl-builtin.ts b/src/utils/tpl-builtin.ts index 659eb9ea..86a6a0fb 100644 --- a/src/utils/tpl-builtin.ts +++ b/src/utils/tpl-builtin.ts @@ -1,7 +1,7 @@ import {reigsterTplEnginer, filter} from './tpl'; import moment from 'moment'; import {PlainObject} from '../types'; -import isPlainObject = require('lodash/isPlainObject'); +import isPlainObject from 'lodash/isPlainObject'; import {createObject, isObject, setVariable, qsstringify} from './helper'; const UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; diff --git a/src/utils/tpl-lodash.ts b/src/utils/tpl-lodash.ts index 7748c9df..4cd20b83 100644 --- a/src/utils/tpl-lodash.ts +++ b/src/utils/tpl-lodash.ts @@ -1,5 +1,5 @@ import {reigsterTplEnginer, filter} from './tpl'; -import template = require('lodash/template'); +import template from 'lodash/template'; import {getFilters} from './tpl-builtin'; import React from 'react'; import moment from 'moment';