From 0e662617575754a74e460f7d7290b4a0caf231d2 Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 24 Nov 2023 15:50:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/{form => base}/button.js | 2 +- src/{icon/index.js => base/icon.js} | 2 +- src/{form => base}/link.js | 0 src/{space/index.js => base/space.js} | 0 src/{icon/svg.js => base/svg-path.js} | 0 src/editor/index.js | 2 +- src/form/checkbox.js | 2 +- src/{color/index.js => form/color.js} | 0 src/form/index.js | 7 +- src/form/input.js | 2 +- src/form/passwd.js | 2 +- src/form/select.js | 4 +- src/form/star.js | 2 +- src/form/uploader.js | 2 +- src/index.js | 64 +++++++++++-------- src/meditor/index.js | 4 +- src/{ => modal}/drag/core.js | 0 src/{ => modal}/drag/index.js | 0 src/{drawer/index.js => modal/drawer.js} | 2 +- src/{layer/index.js => modal/layer.js} | 0 src/{loading/index.js => modal/loading.js} | 0 src/{notify/index.js => modal/notify.js} | 2 +- .../index.js => modal/popconfirm.js} | 2 +- src/{tooltip/index.js => modal/tooltip.js} | 0 src/{dropdown/index.js => nav/dropdown.js} | 2 +- src/{pager/index.js => nav/pager.js} | 2 +- src/{steps/index.js => nav/steps.js} | 2 +- src/option/index.js | 2 +- .../index.js => other/chatbubble.js} | 2 +- src/{divider/index.js => other/divider.js} | 0 src/{sandbox/index.js => other/sandbox.js} | 4 +- src/{scroll/index.js => other/scroll.js} | 0 src/{avatar/index.js => views/avatar.js} | 2 +- src/{badge/index.js => views/badge.js} | 0 .../index.js => views/breadcrumb.js} | 0 src/{card/index.js => views/card.js} | 10 +-- src/{ => views}/code/colorful.js | 0 src/{ => views}/code/index.js | 14 ++-- src/{collapse/index.js => views/collapse.js} | 2 +- .../index.js => views/image-preview.js} | 2 +- src/{image/index.js => views/image.js} | 2 +- src/{ => views}/markd/core.js | 0 src/{ => views}/markd/index.js | 2 +- src/{progress/index.js => views/progress.js} | 0 src/{result/index.js => views/result.js} | 2 +- src/{swipe/index.js => views/swiper.js} | 2 +- src/{tabs/index.js => views/tabs.js} | 2 +- src/{tag/index.js => views/tag.js} | 2 +- src/{time/index.js => views/time.js} | 0 src/{timeline/index.js => views/timeline.js} | 2 +- 50 files changed, 87 insertions(+), 72 deletions(-) rename src/{form => base}/button.js (99%) rename src/{icon/index.js => base/icon.js} (98%) rename src/{form => base}/link.js (100%) rename src/{space/index.js => base/space.js} (100%) rename src/{icon/svg.js => base/svg-path.js} (100%) rename src/{color/index.js => form/color.js} (100%) rename src/{ => modal}/drag/core.js (100%) rename src/{ => modal}/drag/index.js (100%) rename src/{drawer/index.js => modal/drawer.js} (99%) rename src/{layer/index.js => modal/layer.js} (100%) rename src/{loading/index.js => modal/loading.js} (100%) rename src/{notify/index.js => modal/notify.js} (99%) rename src/{popconfirm/index.js => modal/popconfirm.js} (99%) rename src/{tooltip/index.js => modal/tooltip.js} (100%) rename src/{dropdown/index.js => nav/dropdown.js} (98%) rename src/{pager/index.js => nav/pager.js} (99%) rename src/{steps/index.js => nav/steps.js} (99%) rename src/{chatbubble/index.js => other/chatbubble.js} (99%) rename src/{divider/index.js => other/divider.js} (100%) rename src/{sandbox/index.js => other/sandbox.js} (98%) rename src/{scroll/index.js => other/scroll.js} (100%) rename src/{avatar/index.js => views/avatar.js} (98%) rename src/{badge/index.js => views/badge.js} (100%) rename src/{breadcrumb/index.js => views/breadcrumb.js} (100%) rename src/{card/index.js => views/card.js} (89%) rename src/{ => views}/code/colorful.js (100%) rename src/{ => views}/code/index.js (97%) rename src/{collapse/index.js => views/collapse.js} (99%) rename src/{image-preview/index.js => views/image-preview.js} (99%) rename src/{image/index.js => views/image.js} (98%) rename src/{ => views}/markd/core.js (100%) rename src/{ => views}/markd/index.js (99%) rename src/{progress/index.js => views/progress.js} (100%) rename src/{result/index.js => views/result.js} (98%) rename src/{swipe/index.js => views/swiper.js} (99%) rename src/{tabs/index.js => views/tabs.js} (99%) rename src/{tag/index.js => views/tag.js} (99%) rename src/{time/index.js => views/time.js} (100%) rename src/{timeline/index.js => views/timeline.js} (99%) diff --git a/src/form/button.js b/src/base/button.js similarity index 99% rename from src/form/button.js rename to src/base/button.js index 357af41..088991f 100644 --- a/src/form/button.js +++ b/src/base/button.js @@ -5,7 +5,7 @@ */ import { css, html, Component, nextTick, styleMap } from 'wkit' -import '../icon/index.js' +import './icon.js' class Button extends Component { static props = { diff --git a/src/icon/index.js b/src/base/icon.js similarity index 98% rename from src/icon/index.js rename to src/base/icon.js index c2faa7c..589b12c 100644 --- a/src/icon/index.js +++ b/src/base/icon.js @@ -6,7 +6,7 @@ import { css, svg, html, Component, classMap } from 'wkit' -import SVG_DICT from './svg.js' +import SVG_DICT from './svg-path.js' let dict = SVG_DICT if (window.EXT_SVG_DICT) { diff --git a/src/form/link.js b/src/base/link.js similarity index 100% rename from src/form/link.js rename to src/base/link.js diff --git a/src/space/index.js b/src/base/space.js similarity index 100% rename from src/space/index.js rename to src/base/space.js diff --git a/src/icon/svg.js b/src/base/svg-path.js similarity index 100% rename from src/icon/svg.js rename to src/base/svg-path.js diff --git a/src/editor/index.js b/src/editor/index.js index 1ef8c9e..ec10e31 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -16,7 +16,7 @@ import { } from 'wkit' import ICONS from './svg.js' import '../form/input.js' -import '../form/button.js' +import '../base/button.js' const ACTTION = { bold: 'bold', diff --git a/src/form/checkbox.js b/src/form/checkbox.js index ff79ab4..4c100e9 100644 --- a/src/form/checkbox.js +++ b/src/form/checkbox.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Checkbox extends Component { static props = { diff --git a/src/color/index.js b/src/form/color.js similarity index 100% rename from src/color/index.js rename to src/form/color.js diff --git a/src/form/index.js b/src/form/index.js index dd4ef86..84738a3 100644 --- a/src/form/index.js +++ b/src/form/index.js @@ -1,13 +1,14 @@ -import './button.js' +import '../base/button.js' +import '../base/link.js' import './checkbox.js' +import './color.js' import './input.js' -import './link.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 './slider.js' import './uploader.js' diff --git a/src/form/input.js b/src/form/input.js index a51a85c..5525b93 100644 --- a/src/form/input.js +++ b/src/form/input.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component, classMap, outsideClick } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' const ANIMATION = { duration: 100, diff --git a/src/form/passwd.js b/src/form/passwd.js index d6e7052..f2e137a 100644 --- a/src/form/passwd.js +++ b/src/form/passwd.js @@ -4,7 +4,7 @@ * @date 2023/03/16 18:05:43 */ import { css, html, Component, bind, unbind, nextTick } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Passwd extends Component { static props = { diff --git a/src/form/select.js b/src/form/select.js index 56694f7..9aa64b0 100644 --- a/src/form/select.js +++ b/src/form/select.js @@ -5,9 +5,9 @@ */ import { nextTick, css, html, Component } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' import '../form/input.js' -import '../scroll/index.js' +import '../other/scroll.js' import '../option/index.js' class Select extends Component { diff --git a/src/form/star.js b/src/form/star.js index b41d62f..79f13e2 100644 --- a/src/form/star.js +++ b/src/form/star.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component, classMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Star extends Component { static props = { diff --git a/src/form/uploader.js b/src/form/uploader.js index bf3866a..307e3e5 100644 --- a/src/form/uploader.js +++ b/src/form/uploader.js @@ -5,7 +5,7 @@ */ import { css, html, Component, bind, unbind } from 'wkit' -import './button.js' +import '../base/button.js' class Uploader extends Component { static props = { diff --git a/src/index.js b/src/index.js index 527984c..530d062 100644 --- a/src/index.js +++ b/src/index.js @@ -1,26 +1,40 @@ -import './avatar/index.js' -import './badge/index.js' -import './breadcrumb/index.js' -import './card/index.js' -import './code/index.js' -import './collapse/index.js' -import './color/index.js' -import './drag/index.js' -import './drawer/index.js' +import './base/button.js' +import './base/icon.js' +import './base/link.js' +import './base/space.js' + import './form/index.js' -import './icon/index.js' -import './image/index.js' -import './image-preview/index.js' -import './layer/index.js' -import './notify/index.js' -import './pager/index.js' -import './sandbox/index.js' -import './scroll/index.js' -import './space/index.js' -import './steps/index.js' -import './swipe/index.js' -import './tabs/index.js' -import './timeline/index.js' -import './result/index.js' -import './progress/index.js' -import './tag/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/meditor/index.js b/src/meditor/index.js index fbf7e2b..88c0f26 100644 --- a/src/meditor/index.js +++ b/src/meditor/index.js @@ -15,9 +15,9 @@ import { clearOutsideClick } from 'wkit' -import '../markd/index.js' +import '../views/markd/index.js' import '../form/input.js' -import '../form/button.js' +import '../base/button.js' import { DEFAULT_TOOLS, html2md, Addon } from './helper.js' import ICONS from './svg.js' diff --git a/src/drag/core.js b/src/modal/drag/core.js similarity index 100% rename from src/drag/core.js rename to src/modal/drag/core.js diff --git a/src/drag/index.js b/src/modal/drag/index.js similarity index 100% rename from src/drag/index.js rename to src/modal/drag/index.js diff --git a/src/drawer/index.js b/src/modal/drawer.js similarity index 99% rename from src/drawer/index.js rename to src/modal/drawer.js index d07a230..948c565 100644 --- a/src/drawer/index.js +++ b/src/modal/drawer.js @@ -6,7 +6,7 @@ import { css, html, Component, nextTick, styleMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' const ANIMATION = { left: { diff --git a/src/layer/index.js b/src/modal/layer.js similarity index 100% rename from src/layer/index.js rename to src/modal/layer.js diff --git a/src/loading/index.js b/src/modal/loading.js similarity index 100% rename from src/loading/index.js rename to src/modal/loading.js diff --git a/src/notify/index.js b/src/modal/notify.js similarity index 99% rename from src/notify/index.js rename to src/modal/notify.js index b5b0852..504da32 100644 --- a/src/notify/index.js +++ b/src/modal/notify.js @@ -5,7 +5,7 @@ */ import { css, html, Component, bind, styleMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' const ANIMATION = [ { transform: 'translateX(60%)', opacity: 0 }, diff --git a/src/popconfirm/index.js b/src/modal/popconfirm.js similarity index 99% rename from src/popconfirm/index.js rename to src/modal/popconfirm.js index fcda125..37e2ad2 100644 --- a/src/popconfirm/index.js +++ b/src/modal/popconfirm.js @@ -16,7 +16,7 @@ import { clearOutsideClick } from 'wkit' -import '../form/button.js' +import '../base/button.js' const DEFAULT_TIPS = '请确认你的操作!' diff --git a/src/tooltip/index.js b/src/modal/tooltip.js similarity index 100% rename from src/tooltip/index.js rename to src/modal/tooltip.js diff --git a/src/dropdown/index.js b/src/nav/dropdown.js similarity index 98% rename from src/dropdown/index.js rename to src/nav/dropdown.js index 8ea60f0..c3ec220 100644 --- a/src/dropdown/index.js +++ b/src/nav/dropdown.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component, bind } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' import '../option/index.js' class Dropdown extends Component { diff --git a/src/pager/index.js b/src/nav/pager.js similarity index 99% rename from src/pager/index.js rename to src/nav/pager.js index 27546bb..d191efa 100644 --- a/src/pager/index.js +++ b/src/nav/pager.js @@ -5,7 +5,7 @@ */ import { css, html, Component } from 'wkit' -import '../form/button.js' +import '../base/button.js' const LAYOUT_DICT = { home: e => diff --git a/src/steps/index.js b/src/nav/steps.js similarity index 99% rename from src/steps/index.js rename to src/nav/steps.js index ee8208d..2d2d6c8 100644 --- a/src/steps/index.js +++ b/src/nav/steps.js @@ -5,7 +5,7 @@ */ import { css, html, Component, bind, styleMap, classMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Steps extends Component { static props = { diff --git a/src/option/index.js b/src/option/index.js index 91f8d1e..530b9e9 100644 --- a/src/option/index.js +++ b/src/option/index.js @@ -5,7 +5,7 @@ */ import { nextTick, css, html, Component, bind } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' const MACOS_KEYS = { Cmd: '⌘', diff --git a/src/chatbubble/index.js b/src/other/chatbubble.js similarity index 99% rename from src/chatbubble/index.js rename to src/other/chatbubble.js index ebd2902..c3c97c3 100644 --- a/src/chatbubble/index.js +++ b/src/other/chatbubble.js @@ -5,7 +5,7 @@ */ import { css, html, Component, classMap } from 'wkit' -import '../avatar/index.js' +import '../views/avatar.js' class Bubble extends Component { static props = { diff --git a/src/divider/index.js b/src/other/divider.js similarity index 100% rename from src/divider/index.js rename to src/other/divider.js diff --git a/src/sandbox/index.js b/src/other/sandbox.js similarity index 98% rename from src/sandbox/index.js rename to src/other/sandbox.js index 021f2f1..3c4df7c 100644 --- a/src/sandbox/index.js +++ b/src/other/sandbox.js @@ -5,9 +5,9 @@ */ import { css, html, raw, bind, Component, nextTick, classMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' import { gzip } from '@bytedo/gzip' -import { colorHtml, colorJs, colorCss } from '../code/colorful.js' +import { colorHtml, colorJs, colorCss } from '../views/code/colorful.js' const template = ` diff --git a/src/scroll/index.js b/src/other/scroll.js similarity index 100% rename from src/scroll/index.js rename to src/other/scroll.js diff --git a/src/avatar/index.js b/src/views/avatar.js similarity index 98% rename from src/avatar/index.js rename to src/views/avatar.js index f9d373e..1badf2a 100644 --- a/src/avatar/index.js +++ b/src/views/avatar.js @@ -4,7 +4,7 @@ * @date 2023/04/25 09:27:25 */ import { html, css, Component } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Avatar extends Component { static props = { diff --git a/src/badge/index.js b/src/views/badge.js similarity index 100% rename from src/badge/index.js rename to src/views/badge.js diff --git a/src/breadcrumb/index.js b/src/views/breadcrumb.js similarity index 100% rename from src/breadcrumb/index.js rename to src/views/breadcrumb.js diff --git a/src/card/index.js b/src/views/card.js similarity index 89% rename from src/card/index.js rename to src/views/card.js index 37084cf..f3d3ca8 100644 --- a/src/card/index.js +++ b/src/views/card.js @@ -17,7 +17,7 @@ class Card extends Component { border-radius: 3px; } - .card-box { + .container { display: flex; flex-direction: column; position: relative; @@ -50,18 +50,18 @@ class Card extends Component { } } - :host([shadow='never']) .card-box, - :host([shadow='hover']) .card-box { + :host([shadow='never']) .container, + :host([shadow='hover']) .container { box-shadow: none; } - :host([shadow='hover']:hover) .card-box { + :host([shadow='hover']:hover) .container { box-shadow: 0 0 12px rgba(0, 0, 0, 0.12); } ` render() { return html` -
+
${this.header}
diff --git a/src/code/colorful.js b/src/views/code/colorful.js similarity index 100% rename from src/code/colorful.js rename to src/views/code/colorful.js diff --git a/src/code/index.js b/src/views/code/index.js similarity index 97% rename from src/code/index.js rename to src/views/code/index.js index 377aa1e..9d164fa 100644 --- a/src/code/index.js +++ b/src/views/code/index.js @@ -5,8 +5,8 @@ */ import { html, raw, css, Component, nextTick } from 'wkit' import { colorHtml, colorJs, colorCss, colorMd } from './colorful.js' -import '../icon/index.js' -import '../layer/index.js' +import '../../base/icon.js' +import '../../modal/layer.js' function trim(str) { return str @@ -35,7 +35,7 @@ class Code extends Component { display: flex; border-radius: 3px; } - .code-box { + .container { display: flex; flex-direction: column; position: relative; @@ -251,7 +251,7 @@ class Code extends Component { render() { return html` -
+
${this.lang}
@@ -262,10 +262,10 @@ class Code extends Component { @click=${this.copyCode} >
-
+
-
+ +
` } } diff --git a/src/collapse/index.js b/src/views/collapse.js similarity index 99% rename from src/collapse/index.js rename to src/views/collapse.js index b4b961f..7dfc42a 100644 --- a/src/collapse/index.js +++ b/src/views/collapse.js @@ -5,7 +5,7 @@ */ import { css, html, Component, styleMap, nextTick } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Collapse extends Component { static props = { diff --git a/src/image-preview/index.js b/src/views/image-preview.js similarity index 99% rename from src/image-preview/index.js rename to src/views/image-preview.js index 03760a7..c68b2a1 100644 --- a/src/image-preview/index.js +++ b/src/views/image-preview.js @@ -5,7 +5,7 @@ */ import { css, html, Component, styleMap, bind, unbind } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class ImagePreview extends Component { static props = { diff --git a/src/image/index.js b/src/views/image.js similarity index 98% rename from src/image/index.js rename to src/views/image.js index a335b0c..0a98201 100644 --- a/src/image/index.js +++ b/src/views/image.js @@ -5,7 +5,7 @@ */ import { css, html, Component, styleMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Image extends Component { static props = { diff --git a/src/markd/core.js b/src/views/markd/core.js similarity index 100% rename from src/markd/core.js rename to src/views/markd/core.js diff --git a/src/markd/index.js b/src/views/markd/index.js similarity index 99% rename from src/markd/index.js rename to src/views/markd/index.js index c79a5d7..13bad61 100644 --- a/src/markd/index.js +++ b/src/views/markd/index.js @@ -8,7 +8,7 @@ import { css, html, raw, Component, bind, styleMap, classMap } from 'wkit' import md2html from './core.js' import '../code/index.js' -import '../form/checkbox.js' +import '../../form/checkbox.js' export default md2html diff --git a/src/progress/index.js b/src/views/progress.js similarity index 100% rename from src/progress/index.js rename to src/views/progress.js diff --git a/src/result/index.js b/src/views/result.js similarity index 98% rename from src/result/index.js rename to src/views/result.js index b8f1cc6..0ca36f2 100644 --- a/src/result/index.js +++ b/src/views/result.js @@ -5,7 +5,7 @@ */ import { css, html, Component } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Result extends Component { static props = { diff --git a/src/swipe/index.js b/src/views/swiper.js similarity index 99% rename from src/swipe/index.js rename to src/views/swiper.js index 2fd7984..a8bea37 100644 --- a/src/swipe/index.js +++ b/src/views/swiper.js @@ -5,7 +5,7 @@ */ import { css, html, Component, nextTick, styleMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' const CARD_SCALE = 0.83 function createWatcher(object, key, effect) { diff --git a/src/tabs/index.js b/src/views/tabs.js similarity index 99% rename from src/tabs/index.js rename to src/views/tabs.js index 211388b..be3b4d6 100644 --- a/src/tabs/index.js +++ b/src/views/tabs.js @@ -5,7 +5,7 @@ */ import { css, html, bind, Component, nextTick, styleMap, classMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' class Tabs extends Component { static props = { diff --git a/src/tag/index.js b/src/views/tag.js similarity index 99% rename from src/tag/index.js rename to src/views/tag.js index 3a82350..b2ec5dd 100644 --- a/src/tag/index.js +++ b/src/views/tag.js @@ -5,7 +5,7 @@ */ import { css, html, Component } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' const ANIMATION = { type: 'scale' } diff --git a/src/time/index.js b/src/views/time.js similarity index 100% rename from src/time/index.js rename to src/views/time.js diff --git a/src/timeline/index.js b/src/views/timeline.js similarity index 99% rename from src/timeline/index.js rename to src/views/timeline.js index 2e34767..e7e9c8b 100644 --- a/src/timeline/index.js +++ b/src/views/timeline.js @@ -5,7 +5,7 @@ */ import { css, html, Component, bind, styleMap, classMap } from 'wkit' -import '../icon/index.js' +import '../base/icon.js' function pad(n) { return n < 10 ? '0' + n : n