From cc3c8b166dacbf70517bdd7e50cd938bddca198d Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 24 Nov 2023 14:26:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/form/index.js | 1 + src/form/slider.js | 4 +-- src/form/uploader.js | 76 +++++++++++++++++++++++++++++++++++++++++++ src/index.js | 1 - src/progress/index.js | 2 +- src/result/index.js | 2 +- 6 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 src/form/uploader.js diff --git a/src/form/index.js b/src/form/index.js index acc2971..dd4ef86 100644 --- a/src/form/index.js +++ b/src/form/index.js @@ -10,3 +10,4 @@ import './star.js' import './switch.js' import './textarea.js' import './slider.js' +import './uploader.js' diff --git a/src/form/slider.js b/src/form/slider.js index 4edca1c..57fec4b 100644 --- a/src/form/slider.js +++ b/src/form/slider.js @@ -1,6 +1,6 @@ /** - * {进度条} - * @author chensbox + * {滑块组件} + * @author yutent * @date 2023/04/28 16:14:10 */ diff --git a/src/form/uploader.js b/src/form/uploader.js new file mode 100644 index 0000000..bf3866a --- /dev/null +++ b/src/form/uploader.js @@ -0,0 +1,76 @@ +/** + * {上传组件} + * @author yutent + * @date 2023/04/28 16:14:10 + */ + +import { css, html, Component, bind, unbind } from 'wkit' +import './button.js' + +class Uploader extends Component { + static props = { + value: [], + tips: 'str!', + allow: '*/*', + maxSize: 0, + limit: 0, + drag: false, + multiple: false, + disabled: false + } + + static styles = [ + css` + :host { + display: flex; + width: 100%; + } + + .container { + position: relative; + -webkit-user-select: none; + user-select: none; + } + `, + // grid + css` + :host([grid]) { + } + `, + + // drag + css` + :host([drag]) { + } + `, + // thumb + css``, + // disabled + css` + :host([disabled]) { + cursor: not-allowed; + opacity: 0.6; + + .thumb::before { + cursor: not-allowed; + transform: unset; + } + } + ` + ] + + render() { + return html` +
+
+
+ +
+ ${this.tips} +
+
+ ` + } +} + +Uploader.reg('uploader') diff --git a/src/index.js b/src/index.js index 4abf854..f8c7ff4 100644 --- a/src/index.js +++ b/src/index.js @@ -15,7 +15,6 @@ import './notify/index.js' import './pager/index.js' import './sandbox/index.js' import './scroll/index.js' -import './slider/index.js' import './space/index.js' import './steps/index.js' import './swipe/index.js' diff --git a/src/progress/index.js b/src/progress/index.js index b072768..77813ac 100644 --- a/src/progress/index.js +++ b/src/progress/index.js @@ -1,6 +1,6 @@ /** * {进度条} - * @author chensbox + * @author yutent * @date 2023/04/28 16:14:10 */ diff --git a/src/result/index.js b/src/result/index.js index c1c1f0c..b8f1cc6 100644 --- a/src/result/index.js +++ b/src/result/index.js @@ -1,6 +1,6 @@ /** * {结果} - * @author chensbox + * @author yutent * @date 2023/04/28 16:14:10 */