From 3af11ec2f1165a8413ad87f156c9915952021d0d Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Mon, 10 Jun 2019 22:53:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20allowSyntheticDefaultImpor?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fis-conf.js | 7 +++++-- package.json | 2 +- src/Scoped.tsx | 6 +++--- src/components/404.tsx | 2 +- src/components/Alert.tsx | 2 +- src/components/Alert2.tsx | 2 +- src/components/AsideNav.tsx | 4 ++-- src/components/Button.tsx | 2 +- src/components/Checkbox.tsx | 4 ++-- src/components/Checkboxes.tsx | 2 +- src/components/ColorPicker.tsx | 4 ++-- src/components/DatePicker.tsx | 10 +++++----- src/components/DateRangePicker.tsx | 2 +- src/components/Drawer.tsx | 4 ++-- src/components/Editor.tsx | 4 ++-- src/components/Html.tsx | 4 ++-- src/components/Layout.tsx | 4 ++-- src/components/LazyComponent.tsx | 2 +- src/components/Modal.tsx | 4 ++-- src/components/ModalManager.ts | 2 +- src/components/Overlay.tsx | 2 +- src/components/PopOver.tsx | 2 +- src/components/Radios.tsx | 2 +- src/components/Range.tsx | 6 +++--- src/components/Rating.tsx | 4 ++-- src/components/RichText.tsx | 4 ++-- src/components/Select.tsx | 6 +++--- src/components/Spinner.tsx | 2 +- src/components/Switch.tsx | 4 ++-- src/components/Textarea.tsx | 2 +- src/components/TitleBar.tsx | 2 +- src/components/Toast.tsx | 4 ++-- src/components/Tooltip.tsx | 4 ++-- src/components/Tree.tsx | 2 +- src/components/icons.tsx | 2 +- src/components/index.tsx | 2 +- src/factory.tsx | 4 ++-- src/index.tsx | 2 +- src/renderers/Action.tsx | 2 +- src/renderers/Audio.tsx | 2 +- src/renderers/ButtonGroup.tsx | 2 +- src/renderers/ButtonToolbar.tsx | 2 +- src/renderers/CRUD.tsx | 6 +++--- src/renderers/Card.tsx | 4 ++-- src/renderers/Cards.tsx | 4 ++-- src/renderers/Carousel.tsx | 2 +- src/renderers/Chart.tsx | 6 +++--- src/renderers/Collapse.tsx | 4 ++-- src/renderers/Container.tsx | 2 +- src/renderers/Copyable.tsx | 4 ++-- src/renderers/Date.tsx | 6 +++--- src/renderers/Dialog.tsx | 4 ++-- src/renderers/Divider.tsx | 4 ++-- src/renderers/Drawer.tsx | 6 +++--- src/renderers/DropDownButton.tsx | 4 ++-- src/renderers/Each.tsx | 2 +- src/renderers/Form/Array.tsx | 2 +- src/renderers/Form/Button.tsx | 4 ++-- src/renderers/Form/ButtonGroup.tsx | 4 ++-- src/renderers/Form/ButtonToolbar.tsx | 4 ++-- src/renderers/Form/ChainedSelect.tsx | 4 ++-- src/renderers/Form/Checkbox.tsx | 4 ++-- src/renderers/Form/Checkboxes.tsx | 4 ++-- src/renderers/Form/City.tsx | 2 +- src/renderers/Form/Color.tsx | 4 ++-- src/renderers/Form/Combo.tsx | 4 ++-- src/renderers/Form/Container.tsx | 4 ++-- src/renderers/Form/Control.tsx | 4 ++-- src/renderers/Form/Date.tsx | 6 +++--- src/renderers/Form/DateRange.tsx | 6 +++--- src/renderers/Form/DiffEditor.tsx | 4 ++-- src/renderers/Form/Editor.tsx | 4 ++-- src/renderers/Form/FieldSet.tsx | 4 ++-- src/renderers/Form/File.tsx | 6 +++--- src/renderers/Form/Formula.tsx | 2 +- src/renderers/Form/Grid.tsx | 4 ++-- src/renderers/Form/Group.tsx | 4 ++-- src/renderers/Form/HBox.tsx | 4 ++-- src/renderers/Form/Hidden.tsx | 2 +- src/renderers/Form/IconPicker.tsx | 8 ++++---- src/renderers/Form/Image.tsx | 8 ++++---- src/renderers/Form/InputGroup.tsx | 4 ++-- src/renderers/Form/Item.tsx | 4 ++-- src/renderers/Form/List.tsx | 2 +- src/renderers/Form/Matrix.tsx | 4 ++-- src/renderers/Form/NestedSelect.tsx | 2 +- src/renderers/Form/Number.tsx | 6 +++--- src/renderers/Form/Options.tsx | 2 +- src/renderers/Form/Panel.tsx | 4 ++-- src/renderers/Form/Picker.tsx | 4 ++-- src/renderers/Form/Radios.tsx | 4 ++-- src/renderers/Form/Range.tsx | 4 ++-- src/renderers/Form/Rating.tsx | 2 +- src/renderers/Form/Repeat.tsx | 4 ++-- src/renderers/Form/RichText.tsx | 4 ++-- src/renderers/Form/Select.tsx | 4 ++-- src/renderers/Form/Service.tsx | 4 ++-- src/renderers/Form/Static.tsx | 4 ++-- src/renderers/Form/SubForm.tsx | 4 ++-- src/renderers/Form/Switch.tsx | 4 ++-- src/renderers/Form/Table.tsx | 4 ++-- src/renderers/Form/Tabs.tsx | 2 +- src/renderers/Form/Tag.tsx | 6 +++--- src/renderers/Form/Text.tsx | 6 +++--- src/renderers/Form/Textarea.tsx | 4 ++-- src/renderers/Form/TransferSelect.tsx | 2 +- src/renderers/Form/Tree.tsx | 4 ++-- src/renderers/Form/TreeSelect.tsx | 6 +++--- src/renderers/Form/index.tsx | 6 +++--- src/renderers/Grid.tsx | 4 ++-- src/renderers/HBox.tsx | 4 ++-- src/renderers/IFrame.tsx | 2 +- src/renderers/Icon.tsx | 2 +- src/renderers/Image.tsx | 6 +++--- src/renderers/Json.tsx | 4 ++-- src/renderers/Link.tsx | 2 +- src/renderers/List.tsx | 4 ++-- src/renderers/Mapping.tsx | 4 ++-- src/renderers/Nav.tsx | 6 +++--- src/renderers/Operation.tsx | 6 +++--- src/renderers/Page.tsx | 8 ++++---- src/renderers/Pagination.tsx | 2 +- src/renderers/Panel.tsx | 2 +- src/renderers/Plain.tsx | 4 ++-- src/renderers/PopOver.tsx | 4 ++-- src/renderers/Progress.tsx | 4 ++-- src/renderers/QRCode.tsx | 4 ++-- src/renderers/QuickEdit.tsx | 8 ++++---- src/renderers/Remark.tsx | 4 ++-- src/renderers/Service.tsx | 6 +++--- src/renderers/Status.tsx | 4 ++-- src/renderers/Switch.tsx | 4 ++-- src/renderers/Table.tsx | 4 ++-- src/renderers/Tabs.tsx | 2 +- src/renderers/Tasks.tsx | 4 ++-- src/renderers/Tpl.tsx | 4 ++-- src/renderers/VBox.tsx | 4 ++-- src/renderers/Video.tsx | 4 ++-- src/renderers/Wizard.tsx | 4 ++-- src/renderers/Wrapper.tsx | 4 ++-- src/store/crud.ts | 2 +- src/theme.tsx | 6 +++--- src/utils/api.ts | 2 +- src/utils/dom.tsx | 4 ++-- src/utils/tpl-builtin.ts | 2 +- src/utils/tpl-lodash.ts | 4 ++-- tsconfig.json | 1 + 147 files changed, 282 insertions(+), 278 deletions(-) diff --git a/fis-conf.js b/fis-conf.js index f8a9695c..e9a62b0d 100644 --- a/fis-conf.js +++ b/fis-conf.js @@ -60,6 +60,7 @@ fis.match('/docs/**.md', { fis.match('{*.jsx,*.tsx,/src/**.js,/src/**.ts}', { parser: [fis.plugin('typescript', { importHelpers: true, + esModuleInterop: true, experimentalDecorators: true, sourceMap: true }), @@ -160,7 +161,8 @@ if (fis.project.currentMedia() === 'publish') { fis.plugin('typescript', { importHelpers: true, sourceMap: true, - experimentalDecorators: true + experimentalDecorators: true, + esModuleInterop: true }), function (contents) { return contents.replace(/(?:\w+\.)?\b__uri\s*\(\s*('|")(.*?)\1\s*\)/g, function (_, quote, value) { @@ -394,7 +396,8 @@ if (fis.project.currentMedia() === 'publish') { }, parser: fis.plugin('typescript', { sourceMap: false, - importHelpers: true + importHelpers: true, + esModuleInterop: true }) }); ghPages.match('*', { diff --git a/package.json b/package.json index 6731c790..654eec71 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "redux": "3.7.2", "setimmediate": "1.0.5", "sortablejs": "1.7.0", - "tslib": "1.8.0", + "tslib": "^1.9.3", "uncontrollable": "4.1.0", "video-react": "0.9.4" }, diff --git a/src/Scoped.tsx b/src/Scoped.tsx index cb0058df..3493a3fb 100644 --- a/src/Scoped.tsx +++ b/src/Scoped.tsx @@ -3,11 +3,11 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import find = require('lodash/find'); -import * as PropTypes from 'prop-types'; +import PropTypes from 'prop-types'; import hoistNonReactStatic = require('hoist-non-react-statics'); -import * as qs from 'qs'; +import qs from 'qs'; import { dataMapping } from './utils/tpl-builtin'; import { RendererEnv, RendererProps } from './factory'; import { noop, autobind } from './utils/helper'; diff --git a/src/components/404.tsx b/src/components/404.tsx index bfdb07db..07e2e1dc 100644 --- a/src/components/404.tsx +++ b/src/components/404.tsx @@ -3,7 +3,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import {themeable, ClassNamesFn} from '../theme'; interface NotFoundProps { diff --git a/src/components/Alert.tsx b/src/components/Alert.tsx index ed22e0c4..71121078 100644 --- a/src/components/Alert.tsx +++ b/src/components/Alert.tsx @@ -3,7 +3,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import {render} from 'react-dom'; import Modal from './Modal'; import Button from './Button'; diff --git a/src/components/Alert2.tsx b/src/components/Alert2.tsx index 8e28bfd0..9759188d 100644 --- a/src/components/Alert2.tsx +++ b/src/components/Alert2.tsx @@ -3,7 +3,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import {ClassNamesFn, themeable} from '../theme'; export interface AlertProps { diff --git a/src/components/AsideNav.tsx b/src/components/AsideNav.tsx index 28e654a2..3e9728b9 100644 --- a/src/components/AsideNav.tsx +++ b/src/components/AsideNav.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {mapTree} from '../utils/helper'; import {classPrefix, classnames} from '../themes/default'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 5442772f..198c5e4e 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -3,7 +3,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import TooltipWrapper, {TooltipObject, Trigger} from './TooltipWrapper'; import {pickEventsProps} from '../utils/helper'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx index 988667fb..fc02243b 100644 --- a/src/components/Checkbox.tsx +++ b/src/components/Checkbox.tsx @@ -3,8 +3,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {ClassNamesFn, themeable} from '../theme'; import {autobind} from '../utils/helper'; diff --git a/src/components/Checkboxes.tsx b/src/components/Checkboxes.tsx index 65793efc..e2c39665 100644 --- a/src/components/Checkboxes.tsx +++ b/src/components/Checkboxes.tsx @@ -4,7 +4,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import uncontrollable = require('uncontrollable'); import Checkbox from './Checkbox'; import find = require('lodash/find'); diff --git a/src/components/ColorPicker.tsx b/src/components/ColorPicker.tsx index d81b0410..5de0ac20 100644 --- a/src/components/ColorPicker.tsx +++ b/src/components/ColorPicker.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {findDOMNode} from 'react-dom'; import {SketchPicker, ColorResult} from 'react-color'; import {closeIcon} from './icons'; diff --git a/src/components/DatePicker.tsx b/src/components/DatePicker.tsx index 55671ea6..9da947f4 100644 --- a/src/components/DatePicker.tsx +++ b/src/components/DatePicker.tsx @@ -4,14 +4,14 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; -import * as moment from 'moment'; +import React from 'react'; +import cx from 'classnames'; +import moment from 'moment'; import 'moment/locale/zh-cn'; // hack 进去,让 days view 用 CustomDaysView 代替 -import * as CalendarContainer from 'react-datetime/src/CalendarContainer'; -import * as ReactDatePicker from 'react-datetime'; +import CalendarContainer from 'react-datetime/src/CalendarContainer'; +import ReactDatePicker from 'react-datetime'; import Select from './Select'; import {closeIcon} from './icons'; import PopOver from './PopOver'; diff --git a/src/components/DateRangePicker.tsx b/src/components/DateRangePicker.tsx index b17ad63e..bad8a31a 100644 --- a/src/components/DateRangePicker.tsx +++ b/src/components/DateRangePicker.tsx @@ -7,7 +7,7 @@ import React = require('react'); import moment = require('moment'); import {findDOMNode} from 'react-dom'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {closeIcon} from './icons'; import Overlay from './Overlay'; import {BaseDatePicker} from './DatePicker'; diff --git a/src/components/Drawer.tsx b/src/components/Drawer.tsx index 2908e5dd..f34c1b50 100644 --- a/src/components/Drawer.tsx +++ b/src/components/Drawer.tsx @@ -4,11 +4,11 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import Transition, {ENTERED, ENTERING, EXITING} from 'react-transition-group/Transition'; import {Portal} from 'react-overlays'; import {closeIcon} from './icons'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {current, addModal, removeModal} from './ModalManager'; import {ClassNamesFn, themeable} from '../theme'; import {noop, autobind} from '../utils/helper'; diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 46c579af..d8b9b079 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {ClassNamesFn, themeable} from '../theme'; function noJsExt(raw: string) { diff --git a/src/components/Html.tsx b/src/components/Html.tsx index 99b88939..2ab14227 100644 --- a/src/components/Html.tsx +++ b/src/components/Html.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {classPrefix, classnames} from '../themes/default'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index e2c54b08..e92ec46d 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -16,8 +16,8 @@ * * contentClassName 内容区域附加样式名称 */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {ClassNamesFn, themeable} from '../theme'; interface LayoutProps { diff --git a/src/components/LazyComponent.tsx b/src/components/LazyComponent.tsx index 0646a84b..c640526f 100644 --- a/src/components/LazyComponent.tsx +++ b/src/components/LazyComponent.tsx @@ -4,7 +4,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import VisibilitySensor = require('react-visibility-sensor'); export interface LazyComponentProps { diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 6b5c6a3b..2ababdb6 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -4,10 +4,10 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import Transition, {ENTERED, ENTERING} from 'react-transition-group/Transition'; import {Portal} from 'react-overlays'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {current, addModal, removeModal} from './ModalManager'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/ModalManager.ts b/src/components/ModalManager.ts index 55ce4baa..6538929a 100644 --- a/src/components/ModalManager.ts +++ b/src/components/ModalManager.ts @@ -4,7 +4,7 @@ * @author fex */ -import * as keycode from 'keycode'; +import keycode from 'keycode'; interface ModalComponent extends React.Component<{ diff --git a/src/components/Overlay.tsx b/src/components/Overlay.tsx index ffa97ca2..14229397 100644 --- a/src/components/Overlay.tsx +++ b/src/components/Overlay.tsx @@ -6,7 +6,7 @@ import {Position, Overlay as BaseOverlay} from 'react-overlays'; import {findDOMNode} from 'react-dom'; -import * as React from 'react'; +import React from 'react'; import {calculatePosition, getContainer, ownerDocument} from '../utils/dom'; Position.propTypes.placement = BaseOverlay.propTypes.placement = () => null; diff --git a/src/components/PopOver.tsx b/src/components/PopOver.tsx index 67d24e8e..b8eb39e0 100644 --- a/src/components/PopOver.tsx +++ b/src/components/PopOver.tsx @@ -4,7 +4,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import {findDOMNode} from 'react-dom'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Radios.tsx b/src/components/Radios.tsx index 49a31b26..a7dbf653 100644 --- a/src/components/Radios.tsx +++ b/src/components/Radios.tsx @@ -13,7 +13,7 @@ * ] */ -import * as React from 'react'; +import React from 'react'; import uncontrollable = require('uncontrollable'); import Checkbox from './Checkbox'; import {value2array, OptionProps, Option} from './Checkboxes'; diff --git a/src/components/Range.tsx b/src/components/Range.tsx index f97dc7ed..8dc49b78 100644 --- a/src/components/Range.tsx +++ b/src/components/Range.tsx @@ -4,10 +4,10 @@ * @author fex */ -import * as React from 'react'; -import * as InputRange from 'react-input-range'; +import React from 'react'; +import InputRange from 'react-input-range'; import uncontrollable = require('uncontrollable'); -import * as cx from 'classnames'; +import cx from 'classnames'; import {RendererProps} from '../factory'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Rating.tsx b/src/components/Rating.tsx index 9a706216..87bd3112 100644 --- a/src/components/Rating.tsx +++ b/src/components/Rating.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {ClassNamesFn, themeable} from '../theme'; interface RatingProps { diff --git a/src/components/RichText.tsx b/src/components/RichText.tsx index 537225fb..4bb9ba33 100644 --- a/src/components/RichText.tsx +++ b/src/components/RichText.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as $ from 'jquery'; +import React from 'react'; +import $ from 'jquery'; // Require Editor JS files. // import 'froala-editor/js/froala_editor.pkgd.min.js'; diff --git a/src/components/Select.tsx b/src/components/Select.tsx index a3c89cdf..bc1648eb 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -6,14 +6,14 @@ */ import uncontrollable = require('uncontrollable'); -import * as React from 'react'; +import React from 'react'; import 'react-datetime/css/react-datetime.css'; import Overlay from './Overlay'; import PopOver from './PopOver'; import Downshift, {ControllerStateAndHelpers} from 'downshift'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {closeIcon} from './icons'; -import * as matchSorter from 'match-sorter'; +import matchSorter from 'match-sorter'; import {noop} from '../utils/helper'; import find = require('lodash/find'); import isPlainObject = require('lodash/isPlainObject'); diff --git a/src/components/Spinner.tsx b/src/components/Spinner.tsx index 446bd1ac..8b3885cd 100644 --- a/src/components/Spinner.tsx +++ b/src/components/Spinner.tsx @@ -5,7 +5,7 @@ * @date 2017-11-07 */ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ClassNamesFn, themeable} from '../theme'; import {classPrefix, classnames} from '../themes/default'; diff --git a/src/components/Switch.tsx b/src/components/Switch.tsx index a8ab3e69..35e62e43 100644 --- a/src/components/Switch.tsx +++ b/src/components/Switch.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {ClassNamesFn, themeable} from '../theme'; import {classPrefix, classnames} from '../themes/default'; diff --git a/src/components/Textarea.tsx b/src/components/Textarea.tsx index c790115c..9c76b6ab 100644 --- a/src/components/Textarea.tsx +++ b/src/components/Textarea.tsx @@ -1,2 +1,2 @@ -import * as Textarea from 'react-textarea-autosize'; +import Textarea from 'react-textarea-autosize'; export default Textarea; diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx index 8a7e65c5..e770a0ba 100644 --- a/src/components/TitleBar.tsx +++ b/src/components/TitleBar.tsx @@ -8,7 +8,7 @@ * right 可以传入右侧节点, 当有右侧时自动采用 hbox 来左右布局。 */ -import * as React from 'react'; +import React from 'react'; import {classPrefix, classnames} from '../themes/default'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Toast.tsx b/src/components/Toast.tsx index ed4be915..7a419432 100644 --- a/src/components/Toast.tsx +++ b/src/components/Toast.tsx @@ -5,8 +5,8 @@ */ import Transition, {ENTERED, ENTERING, EXITING, EXITED} from 'react-transition-group/Transition'; -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import Html from './Html'; import {uuid, autobind} from '../utils/helper'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx index 767ded86..9675aa4a 100644 --- a/src/components/Tooltip.tsx +++ b/src/components/Tooltip.tsx @@ -4,8 +4,8 @@ * @author fex */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {classPrefix, classnames} from '../themes/default'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/Tree.tsx b/src/components/Tree.tsx index fc721651..72f75280 100644 --- a/src/components/Tree.tsx +++ b/src/components/Tree.tsx @@ -4,7 +4,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import {eachTree, isVisible} from '../utils/helper'; import {Option, Options, value2array} from './Checkboxes'; import {ClassNamesFn, themeable} from '../theme'; diff --git a/src/components/icons.tsx b/src/components/icons.tsx index 4a02c5a4..20388633 100644 --- a/src/components/icons.tsx +++ b/src/components/icons.tsx @@ -4,7 +4,7 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; export const closeIcon = ( ; -import * as React from 'react'; +import React from 'react'; import { resolveVariableAndFilter } from '../../utils/tpl-builtin'; import { evalExpression } from '../../utils/tpl'; import { Option, OptionProps, normalizeOptions } from '../../components/Select'; diff --git a/src/renderers/Form/Panel.tsx b/src/renderers/Form/Panel.tsx index ece7900c..29b4ee9f 100644 --- a/src/renderers/Form/Panel.tsx +++ b/src/renderers/Form/Panel.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; +import React from 'react'; import { Renderer, RendererProps } from '../../factory'; import Panel from '../Panel'; import { Schema } from '../../types'; -import * as cx from 'classnames'; +import cx from 'classnames'; @Renderer({ test: /(^|\/)form(?:\/.+)?\/control\/(?:\d+\/)?panel$/, diff --git a/src/renderers/Form/Picker.tsx b/src/renderers/Form/Picker.tsx index 37bb127f..0789c69d 100644 --- a/src/renderers/Form/Picker.tsx +++ b/src/renderers/Form/Picker.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import React from 'react'; import { OptionsControl, OptionsControlProps, Option } from './Options'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Button from '../../components/Button'; import { SchemaNode, diff --git a/src/renderers/Form/Radios.tsx b/src/renderers/Form/Radios.tsx index 16f259e6..740aaa9e 100644 --- a/src/renderers/Form/Radios.tsx +++ b/src/renderers/Form/Radios.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Radios from '../../components/Radios'; import { OptionsControl, diff --git a/src/renderers/Form/Range.tsx b/src/renderers/Form/Range.tsx index 6a650a88..539187e7 100644 --- a/src/renderers/Form/Range.tsx +++ b/src/renderers/Form/Range.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import isNumber = require('lodash/isNumber'); import isObject = require('lodash/isObject'); import isEqual = require('lodash/isEqual'); @@ -6,7 +6,7 @@ import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import InputRange from '../../components/Range'; import { closeIcon } from '../../components/icons'; diff --git a/src/renderers/Form/Rating.tsx b/src/renderers/Form/Rating.tsx index 2a2dc010..ccdfa98c 100644 --- a/src/renderers/Form/Rating.tsx +++ b/src/renderers/Form/Rating.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps diff --git a/src/renderers/Form/Repeat.tsx b/src/renderers/Form/Repeat.tsx index c42f7ddc..e107863f 100644 --- a/src/renderers/Form/Repeat.tsx +++ b/src/renderers/Form/Repeat.tsx @@ -4,8 +4,8 @@ */ /* eslint fecs-indent: [0, "space", 2, 2] */ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import { FormItem, FormControlProps diff --git a/src/renderers/Form/RichText.tsx b/src/renderers/Form/RichText.tsx index 2c6e25a6..c0a61d20 100644 --- a/src/renderers/Form/RichText.tsx +++ b/src/renderers/Form/RichText.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import LazyComponent from '../../components/LazyComponent'; import { noop } from '../../utils/helper'; diff --git a/src/renderers/Form/Select.tsx b/src/renderers/Form/Select.tsx index 5d57eaef..361ee264 100644 --- a/src/renderers/Form/Select.tsx +++ b/src/renderers/Form/Select.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import { OptionsControl, OptionsControlProps, diff --git a/src/renderers/Form/Service.tsx b/src/renderers/Form/Service.tsx index 1ecc548d..43cc7ed3 100644 --- a/src/renderers/Form/Service.tsx +++ b/src/renderers/Form/Service.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import { Renderer, RendererProps diff --git a/src/renderers/Form/Static.tsx b/src/renderers/Form/Static.tsx index 88acea88..719b2db1 100644 --- a/src/renderers/Form/Static.tsx +++ b/src/renderers/Form/Static.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {TableCell} from '../Table'; import PopOver from '../PopOver'; import QuickEdit from '../QuickEdit'; diff --git a/src/renderers/Form/SubForm.tsx b/src/renderers/Form/SubForm.tsx index e70b265d..2539f922 100644 --- a/src/renderers/Form/SubForm.tsx +++ b/src/renderers/Form/SubForm.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import omit = require('lodash/omit'); import pick = require('lodash/pick'); import { createObject } from '../../utils/helper'; diff --git a/src/renderers/Form/Switch.tsx b/src/renderers/Form/Switch.tsx index 69f39be0..478002ea 100644 --- a/src/renderers/Form/Switch.tsx +++ b/src/renderers/Form/Switch.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Switch from '../../components/Switch'; export interface SwitchProps extends FormControlProps { diff --git a/src/renderers/Form/Table.tsx b/src/renderers/Form/Table.tsx index 1201917e..79fe26a8 100644 --- a/src/renderers/Form/Table.tsx +++ b/src/renderers/Form/Table.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Button from '../../components/Button'; import {createObject, isObjectShallowModified} from '../../utils/helper'; import { RendererData, Action, Api, Payload } from '../../types'; diff --git a/src/renderers/Form/Tabs.tsx b/src/renderers/Form/Tabs.tsx index 28e2d512..f23df813 100644 --- a/src/renderers/Form/Tabs.tsx +++ b/src/renderers/Form/Tabs.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import { Renderer, RendererProps diff --git a/src/renderers/Form/Tag.tsx b/src/renderers/Form/Tag.tsx index b1035807..a27c2964 100644 --- a/src/renderers/Form/Tag.tsx +++ b/src/renderers/Form/Tag.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; +import React from 'react'; import { OptionsControl, OptionsControlProps, Option} from './Options'; -import * as cx from 'classnames'; +import cx from 'classnames'; import { Action } from '../../types'; import Downshift from 'downshift'; -import * as matchSorter from 'match-sorter'; +import matchSorter from 'match-sorter'; import debouce = require('lodash/debounce'); import find = require('lodash/find'); import { closeIcon } from '../../components/icons'; diff --git a/src/renderers/Form/Text.tsx b/src/renderers/Form/Text.tsx index 817c9cd7..af2d84c6 100644 --- a/src/renderers/Form/Text.tsx +++ b/src/renderers/Form/Text.tsx @@ -1,13 +1,13 @@ -import * as React from 'react'; +import React from 'react'; import { OptionsControl, OptionsControlProps, highlight, } from './Options'; -import * as cx from 'classnames'; +import cx from 'classnames'; import { Action } from '../../types'; import Downshift, { StateChangeOptions } from 'downshift'; -import * as matchSorter from 'match-sorter'; +import matchSorter from 'match-sorter'; import debouce = require('lodash/debounce'); import { filter } from '../../utils/tpl'; import find = require('lodash/find'); diff --git a/src/renderers/Form/Textarea.tsx b/src/renderers/Form/Textarea.tsx index 31678af5..33384127 100644 --- a/src/renderers/Form/Textarea.tsx +++ b/src/renderers/Form/Textarea.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import { FormItem, FormControlProps } from './Item'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Textarea from '../../components/Textarea'; import { findDOMNode } from 'react-dom'; import { autobind } from '../../utils/helper'; diff --git a/src/renderers/Form/TransferSelect.tsx b/src/renderers/Form/TransferSelect.tsx index 17df14ae..730e406b 100644 --- a/src/renderers/Form/TransferSelect.tsx +++ b/src/renderers/Form/TransferSelect.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import { OptionsControl, OptionsControlProps, diff --git a/src/renderers/Form/Tree.tsx b/src/renderers/Form/Tree.tsx index 0b6fb101..be7cdd5d 100644 --- a/src/renderers/Form/Tree.tsx +++ b/src/renderers/Form/Tree.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import TreeSelector from '../../components/Tree'; import { OptionsControl, diff --git a/src/renderers/Form/TreeSelect.tsx b/src/renderers/Form/TreeSelect.tsx index bcd175d6..95e6c22e 100644 --- a/src/renderers/Form/TreeSelect.tsx +++ b/src/renderers/Form/TreeSelect.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import Overlay from '../../components/Overlay'; import PopOver from '../../components/PopOver'; @@ -10,7 +10,7 @@ import { } from './Options'; import { closeIcon } from '../../components/icons'; import TreeSelector from '../../components/Tree'; -import * as matchSorter from 'match-sorter'; +import matchSorter from 'match-sorter'; import debouce = require('lodash/debounce'); import find = require('lodash/find'); diff --git a/src/renderers/Form/index.tsx b/src/renderers/Form/index.tsx index 9114be75..44006bdd 100644 --- a/src/renderers/Form/index.tsx +++ b/src/renderers/Form/index.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import { Renderer, RendererProps @@ -17,7 +17,7 @@ import { import { filter, evalExpression } from '../../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; import getExprProperties from '../../utils/filter-schema'; import { promisify, diff --git a/src/renderers/Grid.tsx b/src/renderers/Grid.tsx index 17309253..e53c0545 100644 --- a/src/renderers/Grid.tsx +++ b/src/renderers/Grid.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {Schema} from '../types'; -import * as cx from 'classnames'; +import cx from 'classnames'; import pick = require('lodash/pick'); export const ColProps = ['lg', 'md', 'sm', 'xs']; diff --git a/src/renderers/HBox.tsx b/src/renderers/HBox.tsx index 4f13757c..c38296d9 100644 --- a/src/renderers/HBox.tsx +++ b/src/renderers/HBox.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {Api, SchemaNode, Schema, Action} from '../types'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {isVisible} from '../utils/helper'; export type Column = Schema & { diff --git a/src/renderers/IFrame.tsx b/src/renderers/IFrame.tsx index 873c737a..98882aa4 100644 --- a/src/renderers/IFrame.tsx +++ b/src/renderers/IFrame.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {filter} from '../utils/tpl'; diff --git a/src/renderers/Icon.tsx b/src/renderers/Icon.tsx index a0355af6..18c070ef 100644 --- a/src/renderers/Icon.tsx +++ b/src/renderers/Icon.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; export interface IconProps extends RendererProps { diff --git a/src/renderers/Image.tsx b/src/renderers/Image.tsx index 44a0a05a..0a0ab4c1 100644 --- a/src/renderers/Image.tsx +++ b/src/renderers/Image.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; -import * as moment from 'moment'; +import cx from 'classnames'; +import moment from 'moment'; export interface ImageProps extends RendererProps { className?: string; diff --git a/src/renderers/Json.tsx b/src/renderers/Json.tsx index e020ffba..e70dd018 100644 --- a/src/renderers/Json.tsx +++ b/src/renderers/Json.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; import JSONTree from 'react-json-tree'; diff --git a/src/renderers/Link.tsx b/src/renderers/Link.tsx index 920a23c6..d973fd08 100644 --- a/src/renderers/Link.tsx +++ b/src/renderers/Link.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {filter} from '../utils/tpl'; diff --git a/src/renderers/List.tsx b/src/renderers/List.tsx index 40fc6485..61f588fc 100644 --- a/src/renderers/List.tsx +++ b/src/renderers/List.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import {findDOMNode} from 'react-dom'; import {Renderer, RendererProps} from '../factory'; import {SchemaNode, Schema, Action} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Button from '../components/Button'; import Checkbox from '../components/Checkbox'; import {ListStore, IListStore, IItem} from '../store/list'; diff --git a/src/renderers/Mapping.tsx b/src/renderers/Mapping.tsx index 99e44fbc..420eb7cb 100644 --- a/src/renderers/Mapping.tsx +++ b/src/renderers/Mapping.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, PlainObject} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; export interface MappingProps extends RendererProps { className?: string; diff --git a/src/renderers/Nav.tsx b/src/renderers/Nav.tsx index 73396b1f..3f8e9fe7 100644 --- a/src/renderers/Nav.tsx +++ b/src/renderers/Nav.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; -import * as cx from 'classnames'; +import cx from 'classnames'; import getExprProperties from '../utils/filter-schema'; import {filter, evalExpression} from '../utils/tpl'; import {createObject, mapTree, someTree} from '../utils/helper'; diff --git a/src/renderers/Operation.tsx b/src/renderers/Operation.tsx index 74d7582b..5c5d9270 100644 --- a/src/renderers/Operation.tsx +++ b/src/renderers/Operation.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, Action} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; -import * as moment from 'moment'; +import cx from 'classnames'; +import moment from 'moment'; export interface OperationProps extends RendererProps { className?: string; diff --git a/src/renderers/Page.tsx b/src/renderers/Page.tsx index 7a52cf5d..a5b75e57 100644 --- a/src/renderers/Page.tsx +++ b/src/renderers/Page.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import {Renderer, RendererProps} from '../factory'; import {observer} from 'mobx-react'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, Action, Location, ApiObject, FunctionPropertyNames} from '../types'; import {filter, evalExpression} from '../utils/tpl'; -import * as cx from 'classnames'; -import * as qs from 'qs'; +import cx from 'classnames'; +import qs from 'qs'; import {isVisible, autobind, bulkBindFunctions} from '../utils/helper'; import {ScopedContext, IScopedContext} from '../Scoped'; import Alert from '../components/Alert2'; diff --git a/src/renderers/Pagination.tsx b/src/renderers/Pagination.tsx index 49350bca..54acdc41 100644 --- a/src/renderers/Pagination.tsx +++ b/src/renderers/Pagination.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import { autobind } from '../utils/helper'; diff --git a/src/renderers/Panel.tsx b/src/renderers/Panel.tsx index 47de093c..9b45e38e 100644 --- a/src/renderers/Panel.tsx +++ b/src/renderers/Panel.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {SchemaNode, Action} from '../types'; import {getScrollParent} from '../utils/helper'; diff --git a/src/renderers/Plain.tsx b/src/renderers/Plain.tsx index 900e9308..6c2b9705 100644 --- a/src/renderers/Plain.tsx +++ b/src/renderers/Plain.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; export interface PlainProps extends RendererProps { className?: string; diff --git a/src/renderers/PopOver.tsx b/src/renderers/PopOver.tsx index 66143567..00bbbbe8 100644 --- a/src/renderers/PopOver.tsx +++ b/src/renderers/PopOver.tsx @@ -3,10 +3,10 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import {findDOMNode} from 'react-dom'; import {RendererProps} from '../factory'; -import * as cx from 'classnames'; +import cx from 'classnames'; import hoistNonReactStatic = require('hoist-non-react-statics'); import {RootCloseWrapper} from 'react-overlays'; import PopOver from '../components/PopOver'; diff --git a/src/renderers/Progress.tsx b/src/renderers/Progress.tsx index 35e09a16..4b8ce7dd 100644 --- a/src/renderers/Progress.tsx +++ b/src/renderers/Progress.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, PlainObject} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; export interface ProgressProps extends RendererProps { className?: string; diff --git a/src/renderers/QRCode.tsx b/src/renderers/QRCode.tsx index 418e7701..91724523 100644 --- a/src/renderers/QRCode.tsx +++ b/src/renderers/QRCode.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as cx from 'classnames'; +import React from 'react'; +import cx from 'classnames'; import {Renderer, RendererProps} from '../factory'; import {FormItem, FormControlProps} from './Form/Item'; import {filter} from '../utils/tpl'; diff --git a/src/renderers/QuickEdit.tsx b/src/renderers/QuickEdit.tsx index 30b82013..0db704d7 100644 --- a/src/renderers/QuickEdit.tsx +++ b/src/renderers/QuickEdit.tsx @@ -3,17 +3,17 @@ * @author fex */ -import * as React from 'react'; +import React from 'react'; import {findDOMNode} from 'react-dom'; import find = require('lodash/find'); -import * as PropTypes from 'prop-types'; +import PropTypes from 'prop-types'; import isPlainObject = require('lodash/isPlainObject'); import {RendererProps} from '../factory'; -import * as cx from 'classnames'; +import cx from 'classnames'; import hoistNonReactStatic = require('hoist-non-react-statics'); import onClickOutside from 'react-onclickoutside'; import {Action} from '../types'; -import * as keycode from 'keycode'; +import keycode from 'keycode'; import matches = require('dom-helpers/query/matches'); import Overlay from '../components/Overlay'; import PopOver from '../components/PopOver'; diff --git a/src/renderers/Remark.tsx b/src/renderers/Remark.tsx index 59cbcf77..0b26763a 100644 --- a/src/renderers/Remark.tsx +++ b/src/renderers/Remark.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {Api, SchemaNode, Schema, Action} from '../types'; -import * as cx from 'classnames'; +import cx from 'classnames'; import TooltipWrapper from '../components/TooltipWrapper'; import {filter} from '../utils/tpl'; diff --git a/src/renderers/Service.tsx b/src/renderers/Service.tsx index c0d3f785..daf9b2ed 100644 --- a/src/renderers/Service.tsx +++ b/src/renderers/Service.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, ApiObject, RendererData} from '../types'; import {filter, evalExpression} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Scoped, {ScopedContext, IScopedContext} from '../Scoped'; import {observer} from 'mobx-react'; import {isApiOutdated} from '../utils/api'; diff --git a/src/renderers/Status.tsx b/src/renderers/Status.tsx index 3a8d12e8..13853622 100644 --- a/src/renderers/Status.tsx +++ b/src/renderers/Status.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, PlainObject} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; export interface StatusProps extends RendererProps { className?: string; diff --git a/src/renderers/Switch.tsx b/src/renderers/Switch.tsx index c5b6597a..89f53079 100644 --- a/src/renderers/Switch.tsx +++ b/src/renderers/Switch.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, PlainObject} from '../types'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; import Switch from '../components/Switch'; export interface SwitchProps extends RendererProps { diff --git a/src/renderers/Table.tsx b/src/renderers/Table.tsx index 1e851400..3dd7840e 100644 --- a/src/renderers/Table.tsx +++ b/src/renderers/Table.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import React from 'react'; import {findDOMNode} from 'react-dom'; import {Renderer, RendererProps} from '../factory'; import {SchemaNode, Action, Schema, Api} from '../types'; import forEach = require('lodash/forEach'); import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; import DropDownButton from './DropDownButton'; import Checkbox from '../components/Checkbox'; import Button from '../components/Button'; diff --git a/src/renderers/Tabs.tsx b/src/renderers/Tabs.tsx index 3df0f6da..4917290d 100644 --- a/src/renderers/Tabs.tsx +++ b/src/renderers/Tabs.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; import {Api, SchemaNode, Schema, Action} from '../types'; diff --git a/src/renderers/Tasks.tsx b/src/renderers/Tasks.tsx index 5cd7f642..ea068648 100644 --- a/src/renderers/Tasks.tsx +++ b/src/renderers/Tasks.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {ServiceStore, IServiceStore} from '../store/service'; -import * as cx from 'classnames'; +import cx from 'classnames'; import getExprProperties from '../utils/filter-schema'; import {Api, Payload} from '../types'; import update = require('react-addons-update'); diff --git a/src/renderers/Tpl.tsx b/src/renderers/Tpl.tsx index bc8965fb..8d058870 100644 --- a/src/renderers/Tpl.tsx +++ b/src/renderers/Tpl.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {filter} from '../utils/tpl'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {anyChanged} from '../utils/helper'; import {escapeHtml} from '../utils/tpl-builtin'; diff --git a/src/renderers/VBox.tsx b/src/renderers/VBox.tsx index afd0a708..e055f2d0 100644 --- a/src/renderers/VBox.tsx +++ b/src/renderers/VBox.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {Api, SchemaNode, Schema, Action} from '../types'; -import * as cx from 'classnames'; +import cx from 'classnames'; export type Row = Schema & { rowClassName?: string; diff --git a/src/renderers/Video.tsx b/src/renderers/Video.tsx index c1572066..2800467c 100644 --- a/src/renderers/Video.tsx +++ b/src/renderers/Video.tsx @@ -4,10 +4,10 @@ */ /* eslint fecs-indent: [0, "space", 2, 2] */ -import * as React from 'react'; +import React from 'react'; import {Player, Shortcut, BigPlayButton, ControlBar, PlaybackRateMenuButton} from 'video-react'; import {padArr} from '../utils/helper'; -import * as cx from 'classnames'; +import cx from 'classnames'; import {Renderer, RendererProps} from '../factory'; import {resolveVariable} from '../utils/tpl-builtin'; import {filter} from '../utils/tpl'; diff --git a/src/renderers/Wizard.tsx b/src/renderers/Wizard.tsx index dc33fbeb..f2f7ffb6 100644 --- a/src/renderers/Wizard.tsx +++ b/src/renderers/Wizard.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as PropTypes from 'prop-types'; +import React from 'react'; +import PropTypes from 'prop-types'; import Scoped, {ScopedContext, IScopedContext} from '../Scoped'; import {Renderer, RendererProps} from '../factory'; diff --git a/src/renderers/Wrapper.tsx b/src/renderers/Wrapper.tsx index fe697461..9e4fe590 100644 --- a/src/renderers/Wrapper.tsx +++ b/src/renderers/Wrapper.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {Renderer, RendererProps} from '../factory'; import {SchemaNode} from '../types'; -import * as cx from 'classnames'; +import cx from 'classnames'; export interface WrapperProps extends RendererProps { body?: SchemaNode; diff --git a/src/store/crud.ts b/src/store/crud.ts index 41310e54..5463ec19 100644 --- a/src/store/crud.ts +++ b/src/store/crud.ts @@ -16,7 +16,7 @@ import { fetchOptions, Action } from '../types'; -import * as qs from 'qs'; +import qs from 'qs'; import pick = require("lodash/pick"); import { resolveVariableAndFilter } from '../utils/tpl-builtin'; diff --git a/src/theme.tsx b/src/theme.tsx index 3c0ed0cc..690833e5 100644 --- a/src/theme.tsx +++ b/src/theme.tsx @@ -1,9 +1,9 @@ // 主题管理 -import * as cx from 'classnames'; -import * as React from 'react'; +import cx from 'classnames'; +import React from 'react'; import hoistNonReactStatic = require('hoist-non-react-statics'); import { ExtractProps, Omit } from './types'; -import * as PropTypes from 'prop-types'; +import PropTypes from 'prop-types'; export type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | boolean; diff --git a/src/utils/api.ts b/src/utils/api.ts index 20fef9b1..0ff10221 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -12,7 +12,7 @@ import { dataMapping } from './tpl-builtin'; const rSchema = /(?:^|raw\:)(get|post|put|delete|patch):/i; -import * as qs from 'qs'; +import qs from 'qs'; import { evalExpression } from './tpl'; import { isObjectShallowModified diff --git a/src/utils/dom.tsx b/src/utils/dom.tsx index 677b54c5..99b0689e 100644 --- a/src/utils/dom.tsx +++ b/src/utils/dom.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; +import React from 'react'; +import ReactDOM from 'react-dom'; import hoistNonReactStatic = require('hoist-non-react-statics'); import domHelperWwnerDocument = require('dom-helpers/ownerDocument'); import getOffset = require('dom-helpers/query/offset'); diff --git a/src/utils/tpl-builtin.ts b/src/utils/tpl-builtin.ts index 5654ffa0..218f5481 100644 --- a/src/utils/tpl-builtin.ts +++ b/src/utils/tpl-builtin.ts @@ -1,5 +1,5 @@ import {reigsterTplEnginer, filter} from "./tpl"; -import * as moment from "moment"; +import moment from "moment"; import {PlainObject} from "../types"; import isPlainObject = require("lodash/isPlainObject"); import {createObject, isObject, setVariable} from "./helper"; diff --git a/src/utils/tpl-lodash.ts b/src/utils/tpl-lodash.ts index e784ea36..88bd12d3 100644 --- a/src/utils/tpl-lodash.ts +++ b/src/utils/tpl-lodash.ts @@ -1,8 +1,8 @@ import { reigsterTplEnginer, filter } from "./tpl"; import template = require('lodash/template'); import { filters } from "./tpl-builtin"; -import * as React from 'react'; -import * as moment from 'moment'; +import React from 'react'; +import moment from 'moment'; const imports = { diff --git a/tsconfig.json b/tsconfig.json index 2296d6aa..aca26a22 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ "moduleResolution": "node", "rootDir": "src", "importHelpers": true, + "allowSyntheticDefaultImports": true, "sourceRoot": "src", "noImplicitReturns": true, "noImplicitThis": true,