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 */