diff --git a/src/views/avatar.js b/src/avatar/avatar.js similarity index 98% rename from src/views/avatar.js rename to src/avatar/avatar.js index 1badf2a..7924ae8 100644 --- a/src/views/avatar.js +++ b/src/avatar/avatar.js @@ -4,7 +4,7 @@ * @date 2023/04/25 09:27:25 */ import { html, css, Component } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Avatar extends Component { static props = { diff --git a/src/views/badge.js b/src/badge/badge.js similarity index 100% rename from src/views/badge.js rename to src/badge/badge.js diff --git a/src/views/breadcrumb.js b/src/breadcrumb/breadcrumb.js similarity index 100% rename from src/views/breadcrumb.js rename to src/breadcrumb/breadcrumb.js diff --git a/src/base/button.js b/src/button/button.js similarity index 99% rename from src/base/button.js rename to src/button/button.js index d554f44..9d211fc 100644 --- a/src/base/button.js +++ b/src/button/button.js @@ -5,7 +5,7 @@ */ import { css, html, Component, nextTick, styleMap } from 'wkit' -import './icon.js' +import '../icon/icon.js' class Button extends Component { static props = { diff --git a/src/views/card.js b/src/card/card.js similarity index 100% rename from src/views/card.js rename to src/card/card.js diff --git a/src/form/checkbox.js b/src/checkbox/checkbox.js similarity index 100% rename from src/form/checkbox.js rename to src/checkbox/checkbox.js diff --git a/src/views/code/index.js b/src/code/code.js similarity index 99% rename from src/views/code/index.js rename to src/code/code.js index 9d164fa..a67db25 100644 --- a/src/views/code/index.js +++ b/src/code/code.js @@ -5,8 +5,8 @@ */ import { html, raw, css, Component, nextTick } from 'wkit' import { colorHtml, colorJs, colorCss, colorMd } from './colorful.js' -import '../../base/icon.js' -import '../../modal/layer.js' +import '../icon/icon.js' +import '../layer/layer.js' function trim(str) { return str diff --git a/src/views/code/colorful.js b/src/code/colorful.js similarity index 100% rename from src/views/code/colorful.js rename to src/code/colorful.js diff --git a/src/views/collapse.js b/src/collapse/collapse.js similarity index 99% rename from src/views/collapse.js rename to src/collapse/collapse.js index 7dfc42a..cfe48a2 100644 --- a/src/views/collapse.js +++ b/src/collapse/collapse.js @@ -5,7 +5,7 @@ */ import { css, html, Component, styleMap, nextTick } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Collapse extends Component { static props = { diff --git a/src/form/color.js b/src/color/color.js similarity index 100% rename from src/form/color.js rename to src/color/color.js diff --git a/src/other/divider.js b/src/divider/divider.js similarity index 100% rename from src/other/divider.js rename to src/divider/divider.js diff --git a/src/modal/drag/core.js b/src/drag/core.js similarity index 100% rename from src/modal/drag/core.js rename to src/drag/core.js diff --git a/src/modal/drag/index.js b/src/drag/index.js similarity index 100% rename from src/modal/drag/index.js rename to src/drag/index.js diff --git a/src/modal/drawer.js b/src/drawer/drawer.js similarity index 99% rename from src/modal/drawer.js rename to src/drawer/drawer.js index 948c565..c15eebc 100644 --- a/src/modal/drawer.js +++ b/src/drawer/drawer.js @@ -6,7 +6,7 @@ import { css, html, Component, nextTick, styleMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' const ANIMATION = { left: { diff --git a/src/nav/dropdown.js b/src/dropdown/dropdown.js similarity index 98% rename from src/nav/dropdown.js rename to src/dropdown/dropdown.js index c3ec220..2739ae9 100644 --- a/src/nav/dropdown.js +++ b/src/dropdown/dropdown.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component, bind } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' import '../option/index.js' class Dropdown extends Component { diff --git a/src/form/index.js b/src/form/index.js deleted file mode 100644 index aa175bc..0000000 --- a/src/form/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import '../base/button.js' -import '../base/link.js' -import './checkbox.js' -import './color.js' -import './input.js' -import './number.js' -import './passwd.js' -import './radio.js' -import './select.js' -import './slider.js' -import './star.js' -import './switch.js' -import './textarea.js' -import './uploader.js' -import './image-uploader.js' diff --git a/src/base/icon.js b/src/icon/icon.js similarity index 100% rename from src/base/icon.js rename to src/icon/icon.js diff --git a/src/base/svg-path.js b/src/icon/svg-path.js similarity index 100% rename from src/base/svg-path.js rename to src/icon/svg-path.js diff --git a/src/views/image.js b/src/image/image.js similarity index 98% rename from src/views/image.js rename to src/image/image.js index 0a98201..673206e 100644 --- a/src/views/image.js +++ b/src/image/image.js @@ -5,7 +5,7 @@ */ import { css, html, Component, styleMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Image extends Component { static props = { diff --git a/src/views/image-preview.js b/src/image/preview.js similarity index 99% rename from src/views/image-preview.js rename to src/image/preview.js index c68b2a1..fabefb3 100644 --- a/src/views/image-preview.js +++ b/src/image/preview.js @@ -5,7 +5,7 @@ */ import { css, html, Component, styleMap, bind, unbind } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class ImagePreview extends Component { static props = { diff --git a/src/form/image-uploader.js b/src/image/uploader.js similarity index 99% rename from src/form/image-uploader.js rename to src/image/uploader.js index 2de83bf..33780eb 100644 --- a/src/form/image-uploader.js +++ b/src/image/uploader.js @@ -6,7 +6,7 @@ import { css, html, Component, offset, bind, unbind, styleMap } from 'wkit' import { parseSize } from '../base/fs.js' -import '../base/icon.js' +import '../icon/icon.js' const EV_OPTION = { once: true } const DOC = document diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 530d062..0000000 --- a/src/index.js +++ /dev/null @@ -1,40 +0,0 @@ -import './base/button.js' -import './base/icon.js' -import './base/link.js' -import './base/space.js' - -import './form/index.js' - -import './views/avatar.js' -import './views/badge.js' -import './views/breadcrumb.js' -import './views/code/index.js' -import './views/card.js' -import './views/collapse.js' -import './views/image.js' -import './views/image-preview.js' -import './views/markd/index.js' -import './views/progress.js' -import './views/result.js' -import './views/swiper.js' -import './views/tabs.js' -import './views/tag.js' -import './views/time.js' -import './views/timeline.js' - -import './nav/dropdown.js' -import './nav/pager.js' -import './nav/steps.js' - -import './modal/drag/index.js' -import './modal/drawer.js' -import './modal/layer.js' -import './modal/loading.js' -import './modal/notify.js' -import './modal/popconfirm.js' -import './modal/tooltip.js' - -import './other/chatbubble.js' -import './other/divider.js' -import './other/sandbox.js' -import './other/scroll.js' diff --git a/src/form/input.js b/src/input/input.js similarity index 99% rename from src/form/input.js rename to src/input/input.js index fa82bdb..56e66e0 100644 --- a/src/form/input.js +++ b/src/input/input.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component, classMap, outsideClick } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' const ANIMATION = { duration: 100, diff --git a/src/form/textarea.js b/src/input/textarea.js similarity index 100% rename from src/form/textarea.js rename to src/input/textarea.js diff --git a/src/modal/layer.js b/src/layer/layer.js similarity index 100% rename from src/modal/layer.js rename to src/layer/layer.js diff --git a/src/base/link.js b/src/link/link.js similarity index 100% rename from src/base/link.js rename to src/link/link.js diff --git a/src/modal/loading.js b/src/loading/loading.js similarity index 100% rename from src/modal/loading.js rename to src/loading/loading.js diff --git a/src/views/markd/core.js b/src/markd/core.js similarity index 100% rename from src/views/markd/core.js rename to src/markd/core.js diff --git a/src/views/markd/index.js b/src/markd/index.js similarity index 98% rename from src/views/markd/index.js rename to src/markd/index.js index 13bad61..1ed8ee9 100644 --- a/src/views/markd/index.js +++ b/src/markd/index.js @@ -7,8 +7,8 @@ import { css, html, raw, Component, bind, styleMap, classMap } from 'wkit' import md2html from './core.js' -import '../code/index.js' -import '../../form/checkbox.js' +import '../code/code.js' +import '../form/checkbox.js' export default md2html diff --git a/src/modal/notify.js b/src/notify/notify.js similarity index 99% rename from src/modal/notify.js rename to src/notify/notify.js index 504da32..c5f8a2d 100644 --- a/src/modal/notify.js +++ b/src/notify/notify.js @@ -5,7 +5,7 @@ */ import { css, html, Component, bind, styleMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' const ANIMATION = [ { transform: 'translateX(60%)', opacity: 0 }, diff --git a/src/form/number.js b/src/number/number.js similarity index 100% rename from src/form/number.js rename to src/number/number.js diff --git a/src/other/sandbox.js b/src/other/sandbox.js index 3c4df7c..885f59f 100644 --- a/src/other/sandbox.js +++ b/src/other/sandbox.js @@ -5,9 +5,9 @@ */ import { css, html, raw, bind, Component, nextTick, classMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' import { gzip } from '@bytedo/gzip' -import { colorHtml, colorJs, colorCss } from '../views/code/colorful.js' +import { colorHtml, colorJs, colorCss } from '../code/colorful.js' const template = ` diff --git a/src/nav/pager.js b/src/pager/pager.js similarity index 99% rename from src/nav/pager.js rename to src/pager/pager.js index d191efa..1041695 100644 --- a/src/nav/pager.js +++ b/src/pager/pager.js @@ -5,7 +5,7 @@ */ import { css, html, Component } from 'wkit' -import '../base/button.js' +import '../button/button.js' const LAYOUT_DICT = { home: e => diff --git a/src/form/passwd.js b/src/passwd/passwd.js similarity index 99% rename from src/form/passwd.js rename to src/passwd/passwd.js index e19d049..bda67c3 100644 --- a/src/form/passwd.js +++ b/src/passwd/passwd.js @@ -4,7 +4,7 @@ * @date 2023/03/16 18:05:43 */ import { css, html, Component, bind, unbind, nextTick } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Passwd extends Component { static props = { diff --git a/src/modal/popconfirm.js b/src/popconfirm/popconfirm.js similarity index 99% rename from src/modal/popconfirm.js rename to src/popconfirm/popconfirm.js index b174bc6..38cc066 100644 --- a/src/modal/popconfirm.js +++ b/src/popconfirm/popconfirm.js @@ -16,7 +16,7 @@ import { clearOutsideClick } from 'wkit' -import '../base/button.js' +import '../button/button.js' const DEFAULT_TIPS = '请确认你的操作!' diff --git a/src/views/progress.js b/src/progress/progress.js similarity index 100% rename from src/views/progress.js rename to src/progress/progress.js diff --git a/src/form/radio.js b/src/radio/radio.js similarity index 100% rename from src/form/radio.js rename to src/radio/radio.js diff --git a/src/views/result.js b/src/result/result.js similarity index 98% rename from src/views/result.js rename to src/result/result.js index 0ca36f2..421e684 100644 --- a/src/views/result.js +++ b/src/result/result.js @@ -5,7 +5,7 @@ */ import { css, html, Component } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Result extends Component { static props = { diff --git a/src/other/scroll.js b/src/scroll/scroll.js similarity index 100% rename from src/other/scroll.js rename to src/scroll/scroll.js diff --git a/src/form/select.js b/src/select/select.js similarity index 95% rename from src/form/select.js rename to src/select/select.js index 9aa64b0..699c543 100644 --- a/src/form/select.js +++ b/src/select/select.js @@ -5,9 +5,9 @@ */ import { nextTick, css, html, Component } from 'wkit' -import '../base/icon.js' -import '../form/input.js' -import '../other/scroll.js' +import '../icon/icon.js' +import '../input/input.js' +import '../scroll/scroll.js' import '../option/index.js' class Select extends Component { diff --git a/src/form/slider.js b/src/slider/slider.js similarity index 100% rename from src/form/slider.js rename to src/slider/slider.js diff --git a/src/base/space.js b/src/space/space.js similarity index 100% rename from src/base/space.js rename to src/space/space.js diff --git a/src/form/star.js b/src/star/star.js similarity index 99% rename from src/form/star.js rename to src/star/star.js index 02d7096..7ccb4bc 100644 --- a/src/form/star.js +++ b/src/star/star.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component, classMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Star extends Component { static props = { diff --git a/src/nav/steps.js b/src/steps/steps.js similarity index 99% rename from src/nav/steps.js rename to src/steps/steps.js index 2d2d6c8..73f54cc 100644 --- a/src/nav/steps.js +++ b/src/steps/steps.js @@ -5,7 +5,7 @@ */ import { css, html, Component, bind, styleMap, classMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Steps extends Component { static props = { diff --git a/src/views/swiper.js b/src/swiper/swiper.js similarity index 99% rename from src/views/swiper.js rename to src/swiper/swiper.js index a8bea37..978f612 100644 --- a/src/views/swiper.js +++ b/src/swiper/swiper.js @@ -5,7 +5,7 @@ */ import { css, html, Component, nextTick, styleMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' const CARD_SCALE = 0.83 function createWatcher(object, key, effect) { diff --git a/src/form/switch.js b/src/switch/switch.js similarity index 100% rename from src/form/switch.js rename to src/switch/switch.js diff --git a/src/views/tabs.js b/src/tabs/tabs.js similarity index 99% rename from src/views/tabs.js rename to src/tabs/tabs.js index be3b4d6..6c01f4c 100644 --- a/src/views/tabs.js +++ b/src/tabs/tabs.js @@ -5,7 +5,7 @@ */ import { css, html, bind, Component, nextTick, styleMap, classMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' class Tabs extends Component { static props = { diff --git a/src/views/tag.js b/src/tag/tag.js similarity index 99% rename from src/views/tag.js rename to src/tag/tag.js index 22263dd..a20a174 100644 --- a/src/views/tag.js +++ b/src/tag/tag.js @@ -5,7 +5,7 @@ */ import { css, html, Component } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' const ANIMATION = { type: 'scale' } diff --git a/src/views/time.js b/src/time/time.js similarity index 100% rename from src/views/time.js rename to src/time/time.js diff --git a/src/views/timeline.js b/src/timeline/timeline.js similarity index 99% rename from src/views/timeline.js rename to src/timeline/timeline.js index e7e9c8b..8577886 100644 --- a/src/views/timeline.js +++ b/src/timeline/timeline.js @@ -5,7 +5,7 @@ */ import { css, html, Component, bind, styleMap, classMap } from 'wkit' -import '../base/icon.js' +import '../icon/icon.js' function pad(n) { return n < 10 ? '0' + n : n diff --git a/src/modal/tooltip.js b/src/tooltip/tooltip.js similarity index 100% rename from src/modal/tooltip.js rename to src/tooltip/tooltip.js diff --git a/src/form/uploader.js b/src/uploader/uploader.js similarity index 99% rename from src/form/uploader.js rename to src/uploader/uploader.js index 8c60e4a..9f93efb 100644 --- a/src/form/uploader.js +++ b/src/uploader/uploader.js @@ -6,7 +6,7 @@ import { css, html, Component, bind, unbind, styleMap } from 'wkit' import { resolveFiles, parseSize, filename } from '../base/fs.js' -import '../base/icon.js' +import '../icon/icon.js' function uuid() { return Math.random().toString(16).slice(2)