From bb53c3c758abae954dfe193b3857e6940c44bb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Sun, 19 Jan 2020 19:29:30 +0800 Subject: [PATCH] chore: sort imports --- src/action-sheet/index.tsx | 5 ++++ src/address-edit/Detail.js | 3 +++ src/address-edit/index.js | 3 +++ src/address-list/Item.tsx | 5 +++- src/address-list/index.tsx | 3 +++ src/button/index.tsx | 3 +++ src/calendar/index.js | 2 ++ src/card/index.tsx | 3 +++ src/cell-group/index.tsx | 1 + src/cell/index.tsx | 5 +++- src/collapse-item/index.js | 7 +++++- src/contact-card/index.tsx | 3 +++ src/contact-edit/index.js | 9 ++++--- src/contact-list/index.tsx | 9 ++++--- src/coupon-cell/index.tsx | 3 +++ src/coupon-list/index.js | 3 +++ src/divider/index.tsx | 1 + src/dropdown-item/index.js | 7 +++++- src/dropdown-menu/index.js | 5 +++- src/field/index.js | 13 +++++++---- src/grid-item/index.js | 7 +++++- src/grid/index.js | 2 +- src/icon/index.tsx | 3 +++ src/image-preview/ImagePreview.js | 7 +++++- src/index-bar/index.js | 35 ++++++++++++++++------------ src/info/index.tsx | 1 + src/list/index.js | 7 +++++- src/loading/index.tsx | 1 + src/nav-bar/index.tsx | 3 +++ src/notify/Notify.tsx | 5 ++++ src/overlay/index.tsx | 1 + src/panel/index.tsx | 3 +++ src/password-input/index.tsx | 1 + src/picker/index.js | 5 +++- src/pull-refresh/index.js | 7 +++++- src/search/index.tsx | 3 +++ src/skeleton/index.tsx | 1 + src/sku/components/SkuActions.tsx | 5 +++- src/sku/components/SkuHeader.tsx | 1 + src/sku/components/SkuHeaderItem.tsx | 1 + src/sku/components/SkuImgUploader.js | 3 +++ src/sku/components/SkuMessages.js | 9 ++++--- src/sku/components/SkuRow.tsx | 1 + src/sku/components/SkuStepper.js | 2 +- src/sku/index.js | 9 ++++--- src/submit-bar/index.tsx | 5 +++- src/swipe-cell/index.js | 3 +++ src/swipe/index.js | 7 ++++-- src/switch-cell/index.tsx | 3 +++ src/switch/index.tsx | 5 +++- src/tabbar-item/index.js | 9 +++++-- src/tabs/index.js | 10 +++++--- src/tag/index.tsx | 3 +++ src/toast/Toast.js | 7 +++++- src/tree-select/index.tsx | 3 +++ src/uploader/index.js | 3 +++ 56 files changed, 219 insertions(+), 55 deletions(-) diff --git a/src/action-sheet/index.tsx b/src/action-sheet/index.tsx index 49dc369a9..f6d2c7ba5 100644 --- a/src/action-sheet/index.tsx +++ b/src/action-sheet/index.tsx @@ -1,7 +1,12 @@ +// Utils import { createNamespace } from '../utils'; import { emit, inherit } from '../utils/functional'; import { BORDER_TOP } from '../utils/constant'; + +// Mixins import { popupMixinProps } from '../mixins/popup'; + +// Components import Icon from '../icon'; import Popup from '../popup'; import Loading from '../loading'; diff --git a/src/address-edit/Detail.js b/src/address-edit/Detail.js index 71621c09b..0ff606452 100644 --- a/src/address-edit/Detail.js +++ b/src/address-edit/Detail.js @@ -1,5 +1,8 @@ +// Utils import { createNamespace } from '../utils'; import { isAndroid } from '../utils/validate/system'; + +// Components import Cell from '../cell'; import Field from '../field'; diff --git a/src/address-edit/index.js b/src/address-edit/index.js index c02d6108b..d0be37062 100644 --- a/src/address-edit/index.js +++ b/src/address-edit/index.js @@ -1,5 +1,8 @@ +// Utils import { createNamespace, isObj } from '../utils'; import { isMobile } from '../utils/validate/mobile'; + +// Components import Area from '../area'; import Field from '../field'; import Popup from '../popup'; diff --git a/src/address-list/Item.tsx b/src/address-list/Item.tsx index ea04dc14e..de936a08e 100644 --- a/src/address-list/Item.tsx +++ b/src/address-list/Item.tsx @@ -1,9 +1,12 @@ +// Utils import { createNamespace } from '../utils'; import { emit, inherit } from '../utils/functional'; + +// Components +import Tag from '../tag'; import Icon from '../icon'; import Cell from '../cell'; import Radio from '../radio'; -import Tag from '../tag'; // Types import { CreateElement, RenderContext } from 'vue/types'; diff --git a/src/address-list/index.tsx b/src/address-list/index.tsx index eb9f7e9cd..06bb14b1f 100644 --- a/src/address-list/index.tsx +++ b/src/address-list/index.tsx @@ -1,5 +1,8 @@ +// Utils import { createNamespace } from '../utils'; import { emit, inherit } from '../utils/functional'; + +// Components import Button from '../button'; import RadioGroup from '../radio-group'; import AddressItem, { AddressItemData } from './Item'; diff --git a/src/button/index.tsx b/src/button/index.tsx index 033bdeda0..17032eec4 100644 --- a/src/button/index.tsx +++ b/src/button/index.tsx @@ -1,7 +1,10 @@ +// Utils import { createNamespace } from '../utils'; import { emit, inherit } from '../utils/functional'; import { BORDER_SURROUND, WHITE } from '../utils/constant'; import { routeProps, RouteProps, functionalRoute } from '../utils/router'; + +// Components import Icon from '../icon'; import Loading, { LoadingType } from '../loading'; diff --git a/src/calendar/index.js b/src/calendar/index.js index 24d3091dc..e6b96dc4a 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -1,3 +1,4 @@ +// Utils import { isDate } from '../utils/validate/date'; import { getScrollTop } from '../utils/dom/scroll'; import { @@ -11,6 +12,7 @@ import { ROW_HEIGHT, } from './utils'; +// Components import Popup from '../popup'; import Button from '../button'; import Toast from '../toast'; diff --git a/src/card/index.tsx b/src/card/index.tsx index 33e33adb7..9c5a9da0c 100644 --- a/src/card/index.tsx +++ b/src/card/index.tsx @@ -1,5 +1,8 @@ +// Utils import { createNamespace, isDef } from '../utils'; import { emit, inherit } from '../utils/functional'; + +// Components import Tag from '../tag'; import Image from '../image'; diff --git a/src/cell-group/index.tsx b/src/cell-group/index.tsx index 78019a211..d7e99b8c6 100644 --- a/src/cell-group/index.tsx +++ b/src/cell-group/index.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace } from '../utils'; import { inherit } from '../utils/functional'; import { BORDER_TOP_BOTTOM } from '../utils/constant'; diff --git a/src/cell/index.tsx b/src/cell/index.tsx index 3ff175ee9..505237476 100644 --- a/src/cell/index.tsx +++ b/src/cell/index.tsx @@ -1,7 +1,10 @@ +// Utils import { createNamespace, isDef } from '../utils'; -import { cellProps, SharedCellProps } from './shared'; import { emit, inherit } from '../utils/functional'; import { routeProps, RouteProps, functionalRoute } from '../utils/router'; +import { cellProps, SharedCellProps } from './shared'; + +// Components import Icon from '../icon'; // Types diff --git a/src/collapse-item/index.js b/src/collapse-item/index.js index 6a16a4a6b..7f3f2dda7 100644 --- a/src/collapse-item/index.js +++ b/src/collapse-item/index.js @@ -1,9 +1,14 @@ +// Utils import { createNamespace, isDef } from '../utils'; import { BORDER_TOP } from '../utils/constant'; import { raf, doubleRaf } from '../utils/dom/raf'; + +// Mixins +import { ChildrenMixin } from '../mixins/relation'; + +// Components import Cell from '../cell'; import { cellProps } from '../cell/shared'; -import { ChildrenMixin } from '../mixins/relation'; const [createComponent, bem] = createNamespace('collapse-item'); diff --git a/src/contact-card/index.tsx b/src/contact-card/index.tsx index fce43ca47..4f5032406 100644 --- a/src/contact-card/index.tsx +++ b/src/contact-card/index.tsx @@ -1,5 +1,8 @@ +// Utils import { createNamespace } from '../utils'; import { emit, inherit } from '../utils/functional'; + +// Components import Cell from '../cell'; // Types diff --git a/src/contact-edit/index.js b/src/contact-edit/index.js index 54c03e6ff..5a25d8f8d 100644 --- a/src/contact-edit/index.js +++ b/src/contact-edit/index.js @@ -1,10 +1,13 @@ +// Utils import { createNamespace } from '../utils'; -import Button from '../button'; +import { isMobile } from '../utils/validate/mobile'; + +// Components +import Cell from '../cell'; import Field from '../field'; +import Button from '../button'; import Dialog from '../dialog'; import Switch from '../switch'; -import Cell from '../cell'; -import { isMobile } from '../utils/validate/mobile'; const [createComponent, bem, t] = createNamespace('contact-edit'); diff --git a/src/contact-list/index.tsx b/src/contact-list/index.tsx index 402d9c181..433f62dc0 100644 --- a/src/contact-list/index.tsx +++ b/src/contact-list/index.tsx @@ -1,16 +1,19 @@ +// Utils import { createNamespace } from '../utils'; import { RED } from '../utils/constant'; import { emit, inherit } from '../utils/functional'; + +// Components +import Tag from '../tag'; import Icon from '../icon'; import Cell from '../cell'; -import Tag from '../tag'; -import Button from '../button'; import Radio from '../radio'; +import Button from '../button'; import RadioGroup from '../radio-group'; // Types -import { CreateElement, RenderContext, VNode } from 'vue/types'; import { DefaultSlots } from '../utils/types'; +import { CreateElement, RenderContext, VNode } from 'vue/types'; export type ContactListItem = { id: string | number; diff --git a/src/coupon-cell/index.tsx b/src/coupon-cell/index.tsx index d9f2eb184..f9346318e 100644 --- a/src/coupon-cell/index.tsx +++ b/src/coupon-cell/index.tsx @@ -1,5 +1,8 @@ +// Utils import { createNamespace } from '../utils'; import { inherit } from '../utils/functional'; + +// Components import Cell from '../cell'; // Types diff --git a/src/coupon-list/index.js b/src/coupon-list/index.js index e28e3a50e..27d12bed8 100644 --- a/src/coupon-list/index.js +++ b/src/coupon-list/index.js @@ -1,4 +1,7 @@ +// Utils import { createNamespace } from '../utils'; + +// Components import Tab from '../tab'; import Tabs from '../tabs'; import Field from '../field'; diff --git a/src/divider/index.tsx b/src/divider/index.tsx index 032ac33ed..ba400221e 100644 --- a/src/divider/index.tsx +++ b/src/divider/index.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace } from '../utils'; import { inherit } from '../utils/functional'; diff --git a/src/dropdown-item/index.js b/src/dropdown-item/index.js index cac652759..20b9acef3 100644 --- a/src/dropdown-item/index.js +++ b/src/dropdown-item/index.js @@ -1,7 +1,12 @@ +// Utils import { createNamespace } from '../utils'; +import { on, off } from '../utils/dom/event'; + +// Mixins import { PortalMixin } from '../mixins/portal'; import { ChildrenMixin } from '../mixins/relation'; -import { on, off } from '../utils/dom/event'; + +// Components import Cell from '../cell'; import Icon from '../icon'; import Popup from '../popup'; diff --git a/src/dropdown-menu/index.js b/src/dropdown-menu/index.js index d898413cb..cad919636 100644 --- a/src/dropdown-menu/index.js +++ b/src/dropdown-menu/index.js @@ -1,8 +1,11 @@ +// Utils import { createNamespace } from '../utils'; import { BORDER_TOP_BOTTOM } from '../utils/constant'; +import { getScroller } from '../utils/dom/scroll'; + +// Mixins import { ParentMixin } from '../mixins/relation'; import { ClickOutsideMixin } from '../mixins/click-outside'; -import { getScroller } from '../utils/dom/scroll'; const [createComponent, bem] = createNamespace('dropdown-menu'); diff --git a/src/field/index.js b/src/field/index.js index 10c15af45..57bcf1704 100644 --- a/src/field/index.js +++ b/src/field/index.js @@ -1,11 +1,14 @@ +// Utils +import { formatNumber } from './utils'; +import { isIOS } from '../utils/validate/system'; +import { preventDefault } from '../utils/dom/event'; +import { resetScroll } from '../utils/dom/reset-scroll'; +import { createNamespace, isObj, isDef, addUnit } from '../utils'; + +// Components import Icon from '../icon'; import Cell from '../cell'; import { cellProps } from '../cell/shared'; -import { preventDefault } from '../utils/dom/event'; -import { resetScroll } from '../utils/dom/reset-scroll'; -import { isIOS } from '../utils/validate/system'; -import { formatNumber } from './utils'; -import { createNamespace, isObj, isDef, addUnit } from '../utils'; const [createComponent, bem] = createNamespace('field'); diff --git a/src/grid-item/index.js b/src/grid-item/index.js index 8d9f2b680..6ac4a3276 100644 --- a/src/grid-item/index.js +++ b/src/grid-item/index.js @@ -1,7 +1,12 @@ +// Utils import { createNamespace, addUnit } from '../utils'; import { BORDER } from '../utils/constant'; -import { ChildrenMixin } from '../mixins/relation'; import { route, routeProps } from '../utils/router'; + +// Mixins +import { ChildrenMixin } from '../mixins/relation'; + +// Components import Info from '../info'; import Icon from '../icon'; diff --git a/src/grid/index.js b/src/grid/index.js index 0c4ab9de5..bd8c9865f 100644 --- a/src/grid/index.js +++ b/src/grid/index.js @@ -1,6 +1,6 @@ import { createNamespace, addUnit } from '../utils'; -import { ParentMixin } from '../mixins/relation'; import { BORDER_TOP } from '../utils/constant'; +import { ParentMixin } from '../mixins/relation'; const [createComponent, bem] = createNamespace('grid'); diff --git a/src/icon/index.tsx b/src/icon/index.tsx index acbb2c8df..ecfd1c4d8 100644 --- a/src/icon/index.tsx +++ b/src/icon/index.tsx @@ -1,5 +1,8 @@ +// Utils import { createNamespace, addUnit } from '../utils'; import { inherit } from '../utils/functional'; + +// Components import Info from '../info'; // Types diff --git a/src/image-preview/ImagePreview.js b/src/image-preview/ImagePreview.js index 99ce67827..5db4d416d 100644 --- a/src/image-preview/ImagePreview.js +++ b/src/image-preview/ImagePreview.js @@ -1,11 +1,16 @@ +// Utils import { createNamespace } from '../utils'; import { range } from '../utils/format/number'; import { on, preventDefault } from '../utils/dom/event'; + +// Mixins import { PopupMixin } from '../mixins/popup'; import { TouchMixin } from '../mixins/touch'; + +// Components import Image from '../image'; -import Loading from '../loading'; import Swipe from '../swipe'; +import Loading from '../loading'; import SwipeItem from '../swipe-item'; const [createComponent, bem] = createNamespace('image-preview'); diff --git a/src/index-bar/index.js b/src/index-bar/index.js index ae3fa2baa..cca4e7466 100644 --- a/src/index-bar/index.js +++ b/src/index-bar/index.js @@ -1,18 +1,32 @@ +// Utils import { createNamespace } from '../utils'; -import { TouchMixin } from '../mixins/touch'; -import { ParentMixin } from '../mixins/relation'; -import { BindEventMixin } from '../mixins/bind-event'; import { GREEN } from '../utils/constant'; -import { preventDefault } from '../utils/dom/event'; import { isHidden } from '../utils/dom/style'; +import { preventDefault } from '../utils/dom/event'; import { + getScroller, getScrollTop, getElementTop, getRootScrollTop, setRootScrollTop, - getScroller, } from '../utils/dom/scroll'; +// Mixins +import { TouchMixin } from '../mixins/touch'; +import { ParentMixin } from '../mixins/relation'; +import { BindEventMixin } from '../mixins/bind-event'; + +function genAlphabet() { + const indexList = []; + const charCodeOfA = 'A'.charCodeAt(0); + + for (let i = 0; i < 26; i++) { + indexList.push(String.fromCharCode(charCodeOfA + i)); + } + + return indexList; +} + const [createComponent, bem] = createNamespace('index-bar'); export default createComponent({ @@ -47,16 +61,7 @@ export default createComponent({ }, indexList: { type: Array, - default() { - const indexList = []; - const charCodeOfA = 'A'.charCodeAt(0); - - for (let i = 0; i < 26; i++) { - indexList.push(String.fromCharCode(charCodeOfA + i)); - } - - return indexList; - }, + default: genAlphabet, }, }, diff --git a/src/info/index.tsx b/src/info/index.tsx index d7bbeb954..400826de4 100644 --- a/src/info/index.tsx +++ b/src/info/index.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace, isDef } from '../utils'; import { inherit } from '../utils/functional'; diff --git a/src/list/index.js b/src/list/index.js index 20ea3ec0d..22fcd669a 100644 --- a/src/list/index.js +++ b/src/list/index.js @@ -1,7 +1,12 @@ +// Utils import { createNamespace } from '../utils'; import { isHidden } from '../utils/dom/style'; -import { BindEventMixin } from '../mixins/bind-event'; import { getScroller } from '../utils/dom/scroll'; + +// Mixins +import { BindEventMixin } from '../mixins/bind-event'; + +// Components import Loading from '../loading'; const [createComponent, bem, t] = createNamespace('list'); diff --git a/src/loading/index.tsx b/src/loading/index.tsx index 061e16638..a13371607 100644 --- a/src/loading/index.tsx +++ b/src/loading/index.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace, addUnit } from '../utils'; import { inherit } from '../utils/functional'; diff --git a/src/nav-bar/index.tsx b/src/nav-bar/index.tsx index 6b73bb989..c732ad29b 100644 --- a/src/nav-bar/index.tsx +++ b/src/nav-bar/index.tsx @@ -1,6 +1,9 @@ +// Utils import { createNamespace, noop } from '../utils'; import { inherit } from '../utils/functional'; import { BORDER_BOTTOM } from '../utils/constant'; + +// Components import Icon from '../icon'; // Types diff --git a/src/notify/Notify.tsx b/src/notify/Notify.tsx index a46f507fb..8ccfbcc4d 100644 --- a/src/notify/Notify.tsx +++ b/src/notify/Notify.tsx @@ -1,7 +1,12 @@ +// Utils import { createNamespace } from '../utils'; import { WHITE } from '../utils/constant'; import { inherit } from '../utils/functional'; + +// Mixins import { popupMixinProps } from '../mixins/popup'; + +// Components import Popup from '../popup'; // Types diff --git a/src/overlay/index.tsx b/src/overlay/index.tsx index 6fba280ca..dcf9d8ebd 100644 --- a/src/overlay/index.tsx +++ b/src/overlay/index.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace, isDef } from '../utils'; import { inherit } from '../utils/functional'; import { preventDefault } from '../utils/dom/event'; diff --git a/src/panel/index.tsx b/src/panel/index.tsx index d1e34f118..b6b173437 100644 --- a/src/panel/index.tsx +++ b/src/panel/index.tsx @@ -1,6 +1,9 @@ +// Utils import { createNamespace } from '../utils'; import { inherit } from '../utils/functional'; import { BORDER_TOP } from '../utils/constant'; + +// Components import Cell from '../cell'; import CellGroup from '../cell-group'; diff --git a/src/password-input/index.tsx b/src/password-input/index.tsx index 8ce64c627..8b63f3a30 100644 --- a/src/password-input/index.tsx +++ b/src/password-input/index.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace, addUnit } from '../utils'; import { emit, inherit } from '../utils/functional'; import { BORDER_LEFT, BORDER_SURROUND } from '../utils/constant'; diff --git a/src/picker/index.js b/src/picker/index.js index c6d2b1e9f..aac677a0b 100644 --- a/src/picker/index.js +++ b/src/picker/index.js @@ -1,8 +1,11 @@ +// Utils import { createNamespace } from '../utils'; import { preventDefault } from '../utils/dom/event'; import { deepClone } from '../utils/deep-clone'; -import { pickerProps } from './shared'; import { BORDER_TOP_BOTTOM, BORDER_UNSET_TOP_BOTTOM } from '../utils/constant'; +import { pickerProps } from './shared'; + +// Components import Loading from '../loading'; import PickerColumn from './PickerColumn'; diff --git a/src/pull-refresh/index.js b/src/pull-refresh/index.js index cf36ad745..5719dfc0c 100644 --- a/src/pull-refresh/index.js +++ b/src/pull-refresh/index.js @@ -1,7 +1,12 @@ +// Utils import { createNamespace } from '../utils'; import { preventDefault } from '../utils/dom/event'; -import { TouchMixin } from '../mixins/touch'; import { getScrollTop, getScroller } from '../utils/dom/scroll'; + +// Mixins +import { TouchMixin } from '../mixins/touch'; + +// Components import Loading from '../loading'; const [createComponent, bem, t] = createNamespace('pull-refresh'); diff --git a/src/search/index.tsx b/src/search/index.tsx index e3cca0847..6cc5352e6 100644 --- a/src/search/index.tsx +++ b/src/search/index.tsx @@ -1,6 +1,9 @@ +// Utils import { createNamespace } from '../utils'; import { inherit, emit } from '../utils/functional'; import { preventDefault } from '../utils/dom/event'; + +// Components import Field from '../field'; // Types diff --git a/src/skeleton/index.tsx b/src/skeleton/index.tsx index eb529662f..a226af6a7 100644 --- a/src/skeleton/index.tsx +++ b/src/skeleton/index.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace, addUnit } from '../utils'; import { inherit } from '../utils/functional'; diff --git a/src/sku/components/SkuActions.tsx b/src/sku/components/SkuActions.tsx index 81385e6f3..0fdd7769c 100644 --- a/src/sku/components/SkuActions.tsx +++ b/src/sku/components/SkuActions.tsx @@ -1,10 +1,13 @@ +// Utils import { createNamespace } from '../../utils'; import { inherit } from '../../utils/functional'; + +// Components import Button from '../../button'; // Types -import Vue, { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../../utils/types'; +import Vue, { CreateElement, RenderContext } from 'vue/types'; export type SkuActionsProps = { buyText?: string; diff --git a/src/sku/components/SkuHeader.tsx b/src/sku/components/SkuHeader.tsx index fc4524601..1a08ed73f 100644 --- a/src/sku/components/SkuHeader.tsx +++ b/src/sku/components/SkuHeader.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace } from '../../utils'; import { inherit } from '../../utils/functional'; import { BORDER_BOTTOM } from '../../utils/constant'; diff --git a/src/sku/components/SkuHeaderItem.tsx b/src/sku/components/SkuHeaderItem.tsx index c72ed50a2..5f16c29dd 100644 --- a/src/sku/components/SkuHeaderItem.tsx +++ b/src/sku/components/SkuHeaderItem.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace } from '../../utils'; import { inherit } from '../../utils/functional'; diff --git a/src/sku/components/SkuImgUploader.js b/src/sku/components/SkuImgUploader.js index baf0a702d..47452098e 100644 --- a/src/sku/components/SkuImgUploader.js +++ b/src/sku/components/SkuImgUploader.js @@ -1,4 +1,7 @@ +// Utils import { createNamespace } from '../../utils'; + +// Components import Icon from '../../icon'; import Loading from '../../loading'; import Uploader from '../../uploader'; diff --git a/src/sku/components/SkuMessages.js b/src/sku/components/SkuMessages.js index 31335b6e9..50c12f507 100644 --- a/src/sku/components/SkuMessages.js +++ b/src/sku/components/SkuMessages.js @@ -1,9 +1,12 @@ +// Utils import { createNamespace } from '../../utils'; -import Cell from '../../cell'; -import CellGroup from '../../cell-group'; -import Field from '../../field'; import { isEmail } from '../../utils/validate/email'; import { isNumeric } from '../../utils/validate/number'; + +// Components +import Cell from '../../cell'; +import Field from '../../field'; +import CellGroup from '../../cell-group'; import SkuImgUploader from './SkuImgUploader'; const [createComponent, bem, t] = createNamespace('sku-messages'); diff --git a/src/sku/components/SkuRow.tsx b/src/sku/components/SkuRow.tsx index 787d4cab2..21ecee879 100644 --- a/src/sku/components/SkuRow.tsx +++ b/src/sku/components/SkuRow.tsx @@ -1,3 +1,4 @@ +// Utils import { createNamespace } from '../../utils'; import { inherit } from '../../utils/functional'; import { BORDER_BOTTOM } from '../../utils/constant'; diff --git a/src/sku/components/SkuStepper.js b/src/sku/components/SkuStepper.js index f1e1266f8..e0b720e9f 100644 --- a/src/sku/components/SkuStepper.js +++ b/src/sku/components/SkuStepper.js @@ -1,6 +1,6 @@ import { createNamespace } from '../../utils'; -import Stepper from '../../stepper'; import { LIMIT_TYPE } from '../constants'; +import Stepper from '../../stepper'; const namespace = createNamespace('sku-stepper'); const createComponent = namespace[0]; diff --git a/src/sku/index.js b/src/sku/index.js index cd1ea96e6..aee33e773 100644 --- a/src/sku/index.js +++ b/src/sku/index.js @@ -1,6 +1,11 @@ +// Utils import lang from './lang'; -import Locale from '../locale'; +import constants from './constants'; +import skuHelper from './utils/skuHelper'; + +// Components import Sku from './Sku'; +import Locale from '../locale'; import SkuActions from './components/SkuActions'; import SkuHeader from './components/SkuHeader'; import SkuHeaderItem from './components/SkuHeaderItem'; @@ -9,8 +14,6 @@ import SkuStepper from './components/SkuStepper'; import SkuRow from './components/SkuRow'; import SkuRowItem from './components/SkuRowItem'; import SkuRowPropItem from './components/SkuRowPropItem'; -import skuHelper from './utils/skuHelper'; -import constants from './constants'; Locale.add(lang); diff --git a/src/submit-bar/index.tsx b/src/submit-bar/index.tsx index eace002c7..8d0cf9b76 100644 --- a/src/submit-bar/index.tsx +++ b/src/submit-bar/index.tsx @@ -1,7 +1,10 @@ +// Utils import { createNamespace } from '../utils'; import { emit, inherit } from '../utils/functional'; -import Button, { ButtonType } from '../button'; + +// Components import Icon from '../icon'; +import Button, { ButtonType } from '../button'; // Types import { CreateElement, RenderContext } from 'vue/types'; diff --git a/src/swipe-cell/index.js b/src/swipe-cell/index.js index 157172940..4c0fea514 100644 --- a/src/swipe-cell/index.js +++ b/src/swipe-cell/index.js @@ -1,6 +1,9 @@ +// Utils import { createNamespace } from '../utils'; import { range } from '../utils/format/number'; import { preventDefault } from '../utils/dom/event'; + +// Mixins import { TouchMixin } from '../mixins/touch'; import { ClickOutsideMixin } from '../mixins/click-outside'; diff --git a/src/swipe/index.js b/src/swipe/index.js index 56ac4bcfc..16cc29f10 100644 --- a/src/swipe/index.js +++ b/src/swipe/index.js @@ -1,10 +1,13 @@ +// Utils import { createNamespace } from '../utils'; import { preventDefault } from '../utils/dom/event'; -import { TouchMixin } from '../mixins/touch'; -import { BindEventMixin } from '../mixins/bind-event'; import { doubleRaf } from '../utils/dom/raf'; import { range } from '../utils/format/number'; +// Mixins +import { TouchMixin } from '../mixins/touch'; +import { BindEventMixin } from '../mixins/bind-event'; + const [createComponent, bem] = createNamespace('swipe'); export default createComponent({ diff --git a/src/switch-cell/index.tsx b/src/switch-cell/index.tsx index 2ee2a563c..a07f8fcf2 100644 --- a/src/switch-cell/index.tsx +++ b/src/switch-cell/index.tsx @@ -1,5 +1,8 @@ +// Utils import { createNamespace } from '../utils'; import { inherit } from '../utils/functional'; + +// Components import Cell from '../cell'; import Switch, { SwitchEvents } from '../switch'; import { switchProps, SharedSwitchProps } from '../switch/shared'; diff --git a/src/switch/index.tsx b/src/switch/index.tsx index b9fc82535..ad288100f 100644 --- a/src/switch/index.tsx +++ b/src/switch/index.tsx @@ -1,7 +1,10 @@ +// Utils import { createNamespace, addUnit } from '../utils'; import { BLUE } from '../utils/constant'; -import { switchProps, SharedSwitchProps } from './shared'; import { emit, inherit } from '../utils/functional'; +import { switchProps, SharedSwitchProps } from './shared'; + +// Components import Loading from '../loading'; // Types diff --git a/src/tabbar-item/index.js b/src/tabbar-item/index.js index d78b89545..f5bf826a2 100644 --- a/src/tabbar-item/index.js +++ b/src/tabbar-item/index.js @@ -1,8 +1,13 @@ +// Utils import { createNamespace, isObj, isDef } from '../utils'; +import { route, routeProps } from '../utils/router'; + +// Mixins +import { ChildrenMixin } from '../mixins/relation'; + +// Components import Icon from '../icon'; import Info from '../info'; -import { route, routeProps } from '../utils/router'; -import { ChildrenMixin } from '../mixins/relation'; const [createComponent, bem] = createNamespace('tabbar-item'); diff --git a/src/tabs/index.js b/src/tabs/index.js index e965eb29f..4fed80144 100644 --- a/src/tabs/index.js +++ b/src/tabs/index.js @@ -1,10 +1,9 @@ +// Utils import { createNamespace, isDef, addUnit } from '../utils'; import { scrollLeftTo, scrollTopTo } from './utils'; import { route } from '../utils/router'; import { isHidden } from '../utils/dom/style'; import { on, off } from '../utils/dom/event'; -import { ParentMixin } from '../mixins/relation'; -import { BindEventMixin } from '../mixins/bind-event'; import { BORDER_TOP_BOTTOM } from '../utils/constant'; import { setRootScrollTop, @@ -13,9 +12,14 @@ import { getVisibleTop, } from '../utils/dom/scroll'; +// Mixins +import { ParentMixin } from '../mixins/relation'; +import { BindEventMixin } from '../mixins/bind-event'; + +// Components import Title from './Title'; -import Content from './Content'; import Sticky from '../sticky'; +import Content from './Content'; const [createComponent, bem] = createNamespace('tabs'); diff --git a/src/tag/index.tsx b/src/tag/index.tsx index 64373d8e9..7c0dcd604 100644 --- a/src/tag/index.tsx +++ b/src/tag/index.tsx @@ -1,6 +1,9 @@ +// Utils import { createNamespace } from '../utils'; import { inherit, emit } from '../utils/functional'; import { BORDER_SURROUND } from '../utils/constant'; + +// Components import Icon from '../icon'; // Types diff --git a/src/toast/Toast.js b/src/toast/Toast.js index 3b16fcf8a..8ab8ceb23 100644 --- a/src/toast/Toast.js +++ b/src/toast/Toast.js @@ -1,6 +1,11 @@ +// Utils import { createNamespace, isDef } from '../utils'; -import { PopupMixin } from '../mixins/popup'; import { lockClick } from './lock-click'; + +// Mixins +import { PopupMixin } from '../mixins/popup'; + +// Components import Icon from '../icon'; import Loading from '../loading'; diff --git a/src/tree-select/index.tsx b/src/tree-select/index.tsx index 74891bd9b..9296522e1 100644 --- a/src/tree-select/index.tsx +++ b/src/tree-select/index.tsx @@ -1,5 +1,8 @@ +// Utils import { createNamespace, addUnit } from '../utils'; import { emit, inherit } from '../utils/functional'; + +// Components import Icon from '../icon'; import Sidebar from '../sidebar'; import SidebarItem from '../sidebar-item'; diff --git a/src/uploader/index.js b/src/uploader/index.js index c73d84e44..1e83d6fef 100644 --- a/src/uploader/index.js +++ b/src/uploader/index.js @@ -1,5 +1,8 @@ +// Utils import { createNamespace, addUnit, noop } from '../utils'; import { toArray, readFile, isOversize, isImageFile } from './utils'; + +// Components import Icon from '../icon'; import Image from '../image'; import ImagePreview from '../image-preview';