vue-devui 1.0.0-beta.9 → 1.0.0-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -66
- package/accordion/index.es.js +522 -39
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.es.js +6 -7
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/{toast → auto-complete}/index.d.ts +0 -0
- package/auto-complete/index.es.js +976 -0
- package/auto-complete/index.umd.js +1 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/back-top/index.es.js +1 -1
- package/back-top/index.umd.js +1 -1
- package/badge/index.es.js +12 -18
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +262 -82
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/carousel/index.es.js +7 -6
- package/carousel/index.umd.js +1 -1
- package/cascader/index.es.js +5392 -772
- package/cascader/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/color-picker/index.d.ts +7 -0
- package/color-picker/index.es.js +8187 -0
- package/color-picker/index.umd.js +27 -0
- package/color-picker/package.json +7 -0
- package/color-picker/style.css +1 -0
- package/comment/index.es.js +42 -13
- package/comment/index.umd.js +1 -1
- package/comment/style.css +1 -1
- package/countdown/index.es.js +27 -18
- package/countdown/index.umd.js +1 -1
- package/countdown/style.css +1 -1
- package/date-picker/index.es.js +10 -11
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.es.js +135 -10
- package/dragdrop/index.umd.js +1 -1
- package/drawer/index.es.js +169 -223
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +408 -300
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +293 -5663
- package/editable-select/index.umd.js +1 -27
- package/editable-select/style.css +1 -1
- package/form/index.es.js +6129 -461
- package/form/index.umd.js +27 -1
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +110 -128
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/gantt/index.es.js +6 -18
- package/gantt/index.umd.js +1 -1
- package/gantt/style.css +1 -1
- package/grid/index.es.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +2 -1
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +33 -15
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +4 -5
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-icon/index.es.js +6 -6
- package/input-icon/index.umd.js +1 -1
- package/input-icon/style.css +1 -1
- package/input-number/index.es.js +2 -1
- package/input-number/index.umd.js +1 -1
- package/list/index.d.ts +7 -0
- package/list/index.es.js +39 -0
- package/list/index.umd.js +1 -0
- package/{toast → list}/package.json +1 -1
- package/list/style.css +1 -0
- package/loading/index.es.js +2 -2
- package/modal/index.es.js +293 -759
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.es.js +1 -675
- package/nav-sprite/index.umd.js +1 -1
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +286 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/CarouselItem.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/ColorPicker.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/List.js +3 -0
- package/nuxt/components/ListItem.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimeAxis.js +3 -0
- package/nuxt/components/TimeAxisItem.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/overlayEmits.js +3 -0
- package/nuxt/components/overlayProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.es.js +142 -198
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +10 -18
- package/pagination/index.es.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +3 -3
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +5947 -189
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/progress/index.es.js +8 -8
- package/progress/index.umd.js +3 -3
- package/quadrant-diagram/index.es.js +5405 -166
- package/quadrant-diagram/index.umd.js +27 -1
- package/radio/index.es.js +5 -5
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/read-tip/style.css +1 -1
- package/result/index.es.js +2 -1
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +1 -1
- package/search/index.es.js +5426 -195
- package/search/index.umd.js +27 -1
- package/search/style.css +1 -1
- package/select/index.es.js +3 -2
- package/select/index.umd.js +1 -1
- package/select/style.css +1 -1
- package/slider/index.es.js +2 -5
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +5881 -36
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +19 -32
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/style.css +1 -1
- package/sticky/index.umd.js +1 -1
- package/style.css +1 -1
- package/table/index.es.js +698 -358
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +3 -4
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +2 -2
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +0 -12
- package/tag-input/index.umd.js +1 -1
- package/textarea/style.css +1 -1
- package/{theme → theme/theme.scss} +0 -0
- package/time-axis/index.es.js +2 -1
- package/time-axis/index.umd.js +1 -1
- package/time-picker/index.es.js +269 -84
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/tooltip/index.es.js +5798 -141
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/transfer/index.es.js +6522 -638
- package/transfer/index.umd.js +27 -1
- package/transfer/style.css +1 -1
- package/tree/index.es.js +5775 -192
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/tree-select/index.es.js +130 -35
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.es.js +463 -2680
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14261 -14065
- package/vue-devui.umd.js +19 -19
- package/toast/index.es.js +0 -2059
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
package/modal/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var pe=Object.defineProperty,ge=Object.defineProperties;var ve=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var D=(s,t,p)=>t in s?pe(s,t,{enumerable:!0,configurable:!0,writable:!0,value:p}):s[t]=p,k=(s,t)=>{for(var p in t||(t={}))K.call(t,p)&&D(s,p,t[p]);if(Y)for(var p of Y(t))W.call(t,p)&&D(s,p,t[p]);return s},O=(s,t)=>ge(s,ve(t));var $=(s,t)=>{var p={};for(var S in s)K.call(s,S)&&t.indexOf(S)<0&&(p[S]=s[S]);if(s!=null&&Y)for(var S of Y(s))t.indexOf(S)<0&&W.call(s,S)&&(p[S]=s[S]);return p};var H=(s,t,p)=>(D(s,typeof t!="symbol"?t+"":t,p),p);(function(s,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(s=typeof globalThis!="undefined"?globalThis:s||self,t(s.index={},s.Vue))})(this,function(s,t){"use strict";const p={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Object,Function]},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}};var S="";function G(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const F=t.defineComponent({setup(e,n){return()=>{let o;return t.createVNode(t.Teleport,{to:"#d-overlay-anchor"},{default:()=>[t.createVNode(t.Transition,{name:"devui-overlay-fade"},G(o=t.renderSlot(n.slots,"default"))?o:{default:()=>[o]})]})}}}),P={visible:{type:Boolean},"onUpdate:visible":{type:Function},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},U=["onUpdate:visible","backdropClick"],J=O(k({},P),{overlayStyle:{type:[String,Object],default:void 0}}),Q=k({origin:{type:Object,require:!0},position:{type:Object,default:()=>({originX:"left",originY:"top",overlayX:"left",overlayY:"top"})}},P);function j(e){const n=t.computed(()=>["devui-overlay-background",e.backgroundClass,e.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),o=t.computed(()=>"devui-overlay"),i=l=>{var u,r;l.preventDefault(),(u=e.onBackdropClick)==null||u.call(e),e.backdropClose&&((r=e["onUpdate:visible"])==null||r.call(e,!1))},a=l=>l.cancelBubble=!0;return t.onMounted(()=>{const l=document.body,u=l.style.overflow,r=l.style.position;t.watch([()=>e.visible,()=>e.backgroundBlock],([c,b])=>{if(b){const m=l.getBoundingClientRect().y;c?(l.style.overflowY="scroll",l.style.position=c?"fixed":"",l.style.top=`${m}px`):(l.style.overflowY=u,l.style.position=r,l.style.top="",window.scrollTo(0,-m))}}),t.onUnmounted(()=>{document.body.style.overflow=u})}),{backgroundClass:n,overlayClass:o,handleBackdropClick:i,handleOverlayBubbleCancel:a}}const R=t.defineComponent({name:"DFixedOverlay",props:J,emits:U,setup(e,n){const{backgroundClass:o,overlayClass:i,handleBackdropClick:a,handleOverlayBubbleCancel:l}=j(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{class:o.value,style:e.backgroundStyle,onClick:a},[t.createVNode("div",{class:i.value,style:e.overlayStyle,onClick:l},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function ee(e){return!!(e==null?void 0:e.$el)}function T(e){return e instanceof Element?e:e&&typeof e=="object"&&e.$el instanceof Element?e.$el:null}const L=t.defineComponent({name:"DFlexibleOverlay",props:Q,emits:U,setup(e,n){const o=t.ref(null),i=t.reactive({position:"absolute"});t.onMounted(async()=>{const c=(y,d,h)=>{const g=ne(y,d,h);i.left=`${g.x}px`,i.top=`${g.y}px`},b=t.computed(()=>{const y=o.value,d=te(e.origin);if(!(!y||!d))return{origin:d,overlay:y}}),m=t.toRef(e,"visible"),f=t.toRef(e,"position");t.watch([b,m,f],async([y,d,h],g,V)=>{if(!d||!y)return;const{origin:v,overlay:C}=y;c(h,C.getBoundingClientRect(),v);const X=[ie(()=>c(h,C.getBoundingClientRect(),v)),re(C,N=>c(h,N[0].contentRect,v)),de(v,()=>c(h,C.getBoundingClientRect(),v))];V(()=>{X.forEach(N=>N())})})});const{backgroundClass:a,overlayClass:l,handleBackdropClick:u,handleOverlayBubbleCancel:r}=j(e);return()=>t.createVNode(F,null,{default:()=>[t.withDirectives(t.createVNode("div",{style:e.backgroundStyle,class:a.value,onClick:u},[t.createVNode("div",{ref:o,class:l.value,style:i,onClick:r},[t.renderSlot(n.slots,"default")])]),[[t.vShow,e.visible]])]})}});function te(e){return e instanceof Element?e:t.isRef(e)?T(e.value):ee(e)?T(e):e}function ne(e,n,o){const i=oe(o),a=ae(i,e);return le(a,n,e)}function oe(e){if(e instanceof Element)return e.getBoundingClientRect();const n=e.width||0,o=e.height||0;return{top:e.y,bottom:e.y+o,left:e.x,right:e.x+n,height:o,width:n}}function le(e,n,o){let i;const{width:a,height:l}=n;o.overlayX=="center"?i=e.x-a/2:i=o.overlayX=="left"?e.x:e.x-a;let u;return o.overlayY=="center"?u=e.y-l/2:u=o.overlayY=="top"?e.y:e.y-l,{x:i,y:u}}function ae(e,n){let o;if(n.originX=="center")o=e.left+e.width/2;else{const a=e.left,l=e.right;o=n.originX=="left"?a:l}let i;return n.originY=="center"?i=e.top+e.height/2:i=n.originY=="top"?e.top:e.bottom,{x:o,y:i}}function ie(e){return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}}function re(e,n){if(e instanceof Element){const o=new ResizeObserver(n);return o.observe(e),()=>o.disconnect()}return()=>{}}function de(e,n){if(e instanceof Element){const o=new MutationObserver(n);return o.observe(e,{attributeFilter:["style"]}),()=>o.disconnect()}return()=>{}}const ce=typeof window!="undefined";L.install=function(e){e.component(L.name,L)},R.install=function(e){e.component(R.name,R)};var Ce="",B=t.defineComponent({name:"DModal",props:p,emits:["onUpdate:modelValue"],setup(e,n){const o=t.computed(()=>e.showAnimation?e.modelValue:!0),i=a=>{var u;const l=e["onUpdate:modelValue"];if(a)l==null||l(a);else{const r=e.beforeHidden,c=m=>{var f;m&&(l==null||l(!1),(f=e.onClose)==null||f.call(e))},b=(u=typeof r=="function"?r():r)!=null?u:!0;b instanceof Promise?b.then(c):c(b)}};return n.expose({onVisibleChange:i}),()=>t.createVNode(R,{visible:e.modelValue,"onUpdate:visible":i,backgroundClass:"devui-modal-wrapper",backgroundBlock:!e.bodyScrollable,backdropClose:e.backdropCloseable},{default:()=>[t.createVNode(t.Transition,{name:"devui-modal-wipe"},{default:()=>{var a,l;return[o.value?(l=(a=n.slots).default)==null?void 0:l.call(a):null]}})]})}});class _{constructor(n){this.anchorContainer=n}renderModal(n,o,i){const a=t.h(this.component(),o,i);return t.render(a,n),a}renderNull(n){setTimeout(()=>{t.render(null,n)},500)}}class I extends _{component(){return B}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const c=n,{content:i}=c,a=$(c,["content"]),l=b=>{b||r()},u=(b,m=l)=>this.renderModal(o,O(k({},b),{modelValue:!0,"onUpdate:modelValue":m}),{default:i}),r=()=>{var m,f;(f=(m=u(a,y=>{y?u(a):(this.renderModal(o,O(k({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).onVisibleChange)==null||f.call(m,!1)};return this.renderModal(o,{modelValue:!1}),u(a),{hide:r}}}H(I,"token","MODAL_SERVICE_TOKEN");const se={width:{type:String,default:"300px"},maxHeight:{type:String},zIndex:{type:Number,default:1050},backdropZIndex:{type:Number,default:1049},placement:{type:String,default:"center"},offsetX:{type:String,default:"0px"},offsetY:{type:String,default:"0px"},title:{type:String},showAnimation:{type:Boolean,default:!0},backdropCloseable:{type:Boolean,default:!1},bodyScrollable:{type:Boolean,default:!0},escapeable:{type:Boolean,default:!0},onClose:{type:Function},beforeHidden:{type:[Promise,Function]},buttons:{type:Array,default:[]},dialogType:{type:String,default:"standard"},modelValue:{type:Boolean},"onUpdate:modelValue":{type:Function}},ue=(e=!0)=>{const n=t.ref(0),o=t.ref(0),i=()=>{n.value=0,o.value=0},a=t.ref(),l=t.ref(),u=t.isRef(e)?e:t.ref(e);return t.watch([l,a],([r,c],b,m)=>{if(!(c instanceof HTMLElement&&r instanceof HTMLElement))return;c.style.cursor="all-scroll";let f=0,y=0,d=0,h=0,g=r.getBoundingClientRect(),V=document.body.getBoundingClientRect(),v=!1;const C=w=>{if(w.preventDefault(),!u.value)return;f=w.clientX,y=w.clientY;const x=c.getBoundingClientRect();(c===w.target||c.contains(w.target))&&x.x<f&&x.y<y&&x.width+x.x>=f&&x.height+x.y>=y&&(v=!0,d=n.value,h=o.value,V=document.body.getBoundingClientRect(),g=r.getBoundingClientRect())},X=w=>{if(w.preventDefault(),!v)return;const x=d+w.clientX-f,he=h+w.clientY-y,Z=g.x-d,q=g.y-h;n.value=A(x,-Z,V.width-g.width-Z),o.value=A(he,-q,V.height-g.height-q)},N=w=>{w.preventDefault(),!!v&&(v=!1)};window.addEventListener("mousedown",C),window.addEventListener("mousemove",X),window.addEventListener("mouseup",N),m(()=>{window.removeEventListener("mousedown",C),window.removeEventListener("mousemove",X),window.removeEventListener("mouseup",N)})}),{movingX:t.readonly(n),movingY:t.readonly(o),handleRef:a,moveElRef:l,reset:i}},A=(e,n,o)=>e<n?n:e>o?o:e;var E=t.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(e){return k({},e)},render(){const{name:e,size:n,color:o,classPrefix:i}=this;return/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:n}},null):t.createVNode("i",{class:`${i} ${i}-${e}`,style:{fontSize:n,color:o}},null)}});E.install=function(e){e.component(E.name,E)};const fe={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var we="",M=t.defineComponent({name:"DButton",props:fe,setup(e,n){const o=t.ref(null),i=r=>{var c;e.showLoading||(c=e.onClick)==null||c.call(e,r)},a=t.computed(()=>n.slots.default),l=t.computed(()=>{const{btnStyle:r,size:c,position:b,bordered:m,icon:f}=e,y=`devui-btn devui-btn-${r} devui-btn-${c} devui-btn-${b}`,d=m?"bordered":"",h=!!f&&!a.value&&r!=="primary"?"d-btn-icon":"";return`${y} ${d} ${h} ${f?"d-btn-icon-wrap":""}`}),u=t.computed(()=>{if(!e.icon)return;const r="devui-icon-fix icon";return a.value?`${r} clear-right-5`:r});return()=>{var y,d;const{icon:r,type:c,disabled:b,showLoading:m,width:f}=e;return t.createVNode("div",t.mergeProps({class:"devui-btn-host"},n.attrs),[t.createVNode("button",{class:l.value,type:c,disabled:b,style:{width:f},onClick:i},[r?t.createVNode(E,{name:e.icon,class:u.value},null):null,t.createVNode("span",{class:"button-content",ref:o},[(d=(y=n.slots).default)==null?void 0:d.call(y)])])])}}});M.install=function(e){e.component(M.name,M)};function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}var me=t.defineComponent({name:"DModal",inheritAttrs:!1,props:se,emits:["onUpdate:modelValue"],setup(e,n){const{movingX:o,movingY:i,handleRef:a,moveElRef:l,reset:u}=ue();t.watch(()=>e.modelValue,d=>{d&&u()});const r=t.computed(()=>({position:"relative",left:`${o.value}px`,top:`${i.value}px`})),c=t.computed(()=>({width:e.width,maxHeight:e.maxHeight,transform:`translate(${e.offsetX}, ${e.offsetY})`,zIndex:e.zIndex})),b=t.computed(()=>{switch(e.dialogType){case"standard":return"";case"info":return"icon-info-o";case"success":return"icon-right-o";case"warning":return"icon-warning-o";case"failed":return"icon-error-o";default:return""}}),m=t.computed(()=>e.buttons.map((d,h)=>{const{btnStyle:g,disabled:V,handler:v,text:C}=d;return t.createVNode(M,{key:h,style:{display:"inline-block",margin:"0 5px"},btnStyle:g,disabled:V,onClick:v},ye(C)?C:{default:()=>[C]})})),f=t.ref(),y=()=>{var d,h;(h=(d=f.value)==null?void 0:d.onVisibleChange)==null||h.call(d,!1)};return n.expose({closeModal:y}),()=>t.createVNode(B,{ref:f,width:e.width,maxHeight:e.maxHeight,offsetX:e.offsetX,offsetY:e.offsetY,zIndex:e.zIndex,backdropZIndex:e.backdropZIndex,backdropCloseable:e.backdropCloseable,bodyScrollable:e.bodyScrollable,placement:e.placement,onClose:e.onClose,beforeHidden:e.beforeHidden,modelValue:e.modelValue,"onUpdate:modelValue":e["onUpdate:modelValue"]},{default:()=>{var d,h;return[t.createVNode("div",{class:"devui-modal-content",style:[c.value,r.value],ref:l},[t.createVNode("div",{class:"devui-modal-header",ref:a},[b.value?t.createVNode(E,{name:b.value,size:"24px",class:"header-alert-icon"},null):null,t.createVNode("span",null,[e.title]),t.createVNode(M,{class:"btn-close",icon:"close",btnStyle:"text-dark",onClick:y},null)]),t.createVNode("div",{class:"devui-modal-body"},[(h=(d=n.slots).default)==null?void 0:h.call(d)]),t.createVNode("div",{class:"devui-modal-footer"},[m.value])])]}})}});class z extends _{component(){return me}open(n={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const b=n,{content:i}=b,a=$(b,["content"]),l=m=>{m||r()},u=(m,f=l)=>this.renderModal(o,O(k({},m),{modelValue:!0,"onUpdate:modelValue":f}),{default:i}),r=()=>{var f,y;(y=(f=u(a,d=>{d?u(a):(this.renderModal(o,O(k({},a),{modelValue:!1})),this.renderNull(o))}).component.exposed).closeModal)==null||y.call(f)},c=m=>{const h=a,{buttons:f}=h,y=$(h,["buttons"]),d=f.map((g,V)=>k(k({},g),m[V]));u(O(k({},y),{buttons:d}))};return this.renderModal(o,{modelValue:!1}),u(a),{hide:r,updateButtonOptions:c}}}H(z,"token","DIALOG_SERVICE_TOKEN"),B.install=function(e){e.component(B.name,B)};var be={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(e){if(e.use(B),!ce)return;let n=document.getElementById("d-modal-anchors-container");n||(n=document.createElement("div"),n.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(n)),e.provide(I.token,new I(n)),e.provide(z.token,new z(n))}};s.Modal=B,s.default=be,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
|
1
|
+
var X=Object.defineProperty,G=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var B=(r,e,d)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[e]=d,g=(r,e)=>{for(var d in e||(e={}))P.call(e,d)&&B(r,d,e[d]);if(h)for(var d of h(e))M.call(e,d)&&B(r,d,e[d]);return r},C=(r,e)=>G(r,J(e));var A=(r,e)=>{var d={};for(var p in r)P.call(r,p)&&e.indexOf(p)<0&&(d[p]=r[p]);if(r!=null&&h)for(var p of h(r))e.indexOf(p)<0&&M.call(r,p)&&(d[p]=r[p]);return d};var j=(r,e,d)=>(B(r,typeof e!="symbol"?e+"":e,d),d);(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue,r.dom))})(this,function(r,e,d){"use strict";const p={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function}};var v=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(t){return g({},t)},render(){const{name:t,size:o,color:n,classPrefix:i}=this;return/^((https?):)?\/\//.test(t)?e.createVNode("img",{src:t,alt:t.split("/")[t.split("/").length-1],style:{width:o,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${i} ${i}-${t}`,style:{fontSize:o,color:n}},null)}});v.install=function(t){t.component(v.name,v)};var Q="";function D(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const L=e.defineComponent({setup(t,o){return()=>{let n;return e.createVNode(e.Teleport,{to:"#d-overlay-anchor"},{default:()=>[e.createVNode(e.Transition,{name:"devui-overlay-fade"},D(n=e.renderSlot(o.slots,"default"))?n:{default:()=>[n]})]})}}}),T={visible:{type:Boolean},backgroundBlock:{type:Boolean,default:!1},backgroundClass:{type:String,default:""},backgroundStyle:{type:[String,Object]},onBackdropClick:{type:Function},backdropClose:{type:Boolean,default:!0},hasBackdrop:{type:Boolean,default:!0}},_=["update:visible","backdropClick"],R=C(g({},T),{overlayStyle:{type:[String,Object],default:void 0}}),z={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function F(t,o){const n=e.computed(()=>["devui-overlay-background",t.backgroundClass,t.hasBackdrop?"devui-overlay-background__color":"devui-overlay-background__disabled"]),i=e.computed(()=>"devui-overlay"),c=l=>{var s;l.preventDefault(),(s=t.onBackdropClick)==null||s.call(t),t.backdropClose&&o.emit("update:visible",!1)},a=l=>l.cancelBubble=!0;return e.onMounted(()=>{const l=document.body,s=l.style.overflow,m=l.style.position;e.watch([()=>t.visible,()=>t.backgroundBlock],([f,y])=>{if(y){const u=l.getBoundingClientRect().y;f?(l.style.overflowY="scroll",l.style.position=f?"fixed":"",l.style.top=`${u}px`):(l.style.overflowY=s,l.style.position=m,l.style.top="",window.scrollTo(0,-u))}}),e.onUnmounted(()=>{document.body.style.overflow=s})}),{backgroundClass:n,overlayClass:i,handleBackdropClick:c,handleOverlayBubbleCancel:a}}const $=e.defineComponent({name:"DFixedOverlay",props:R,emits:_,setup(t,o){const{backgroundClass:n,overlayClass:i,handleBackdropClick:c,handleOverlayBubbleCancel:a}=F(t,o);return()=>e.createVNode(L,null,{default:()=>[t.visible&&e.createVNode("div",{class:n.value,style:t.backgroundStyle,onClick:c},[e.createVNode("div",{class:i.value,style:t.overlayStyle,onClick:a},[e.renderSlot(o.slots,"default")])])]})}});function S(t){const o=/(auto|scroll|hidden)/;for(let n=t;n=n.parentElement;n.parentElement!==document.body){const i=window.getComputedStyle(n);if(o.test(i.overflow+i.overflowX+i.overflowY))return n}return window}function q(t,o,n,i){let{x:c,y:a}=o;if(!t){const{width:l,height:s}=i;c&&n.includes("start")&&(c=12),c&&n.includes("end")&&(c=Math.round(l-24)),a&&n.includes("start")&&(a=10),a&&n.includes("end")&&(a=s-14)}return{x:c,y:a}}function I(t,o){const n=e.ref(),i=e.ref(),c=(l,s,m,f)=>{const{x:y,y:u}=q(t.isArrowCenter,m,s,f.getBoundingClientRect()),b={top:"bottom",right:"left",bottom:"top",left:"right"}[s.split("-")[0]];Object.assign(l.style,{left:y?`${y}px`:"",top:u?`${u}px`:"",right:"",bottom:"",[b]:"-4px"})},a=async()=>{const l=t.origin,s=e.unref(n.value),m=e.unref(i.value),f=[d.offset(t.offset),d.autoPlacement({alignment:t.align,allowedPlacements:t.position})];t.showArrow&&f.push(d.arrow({element:m}));const{x:y,y:u,placement:b,middlewareData:x}=await d.computePosition(l,s,{strategy:"fixed",middleware:f});o("positionChange",b),Object.assign(s.style,{top:`${u}px`,left:`${y}px`}),t.showArrow&&c(m,b,x.arrow,s)};return e.watch(()=>t.modelValue,()=>{const l=S(t.origin);t.modelValue&&t.origin?(e.nextTick(a),l.addEventListener("scroll",a),l!==window&&window.addEventListener("scroll",a),window.addEventListener("resize",a)):(l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a))}),e.onUnmounted(()=>{const l=S(t.origin);l.removeEventListener("scroll",a),l!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),{arrowRef:i,overlayRef:n}}var W="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:z,emits:["update:modelValue","positionChange"],setup(t,{slots:o,attrs:n,emit:i}){const{arrowRef:c,overlayRef:a}=I(t,i);return()=>{var l;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:a,class:"devui-flexible-overlay"},n),[(l=o.default)==null?void 0:l.call(o),t.showArrow&&e.createVNode("div",{ref:c,class:"devui-flexible-overlay-arrow"},null)])}}});const U=typeof window!="undefined";function H(t,o){function n(){o("update:modelValue",!1)}function i(c){c||(t.beforeClose?t.beforeClose(n):n())}return{handleVisibleChange:i}}var k=e.defineComponent({name:"DModalHeader",setup(t,{slots:o}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-header"},[(n=o.default)==null?void 0:n.call(o)])}}}),V=e.defineComponent({name:"DModalBody",setup(t,{slots:o}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-body"},[(n=o.default)==null?void 0:n.call(o)])}}}),Z="",w=e.defineComponent({name:"DModal",inheritAttrs:!1,props:p,emits:["update:modelValue"],setup(t,{slots:o,attrs:n,emit:i,expose:c}){const{modelValue:a,lockScroll:l,closeOnClickOverlay:s,title:m}=e.toRefs(t),{handleVisibleChange:f}=H(t,i);return c({handleVisibleChange:f}),()=>e.createVNode($,{visible:a.value,"onUpdate:visible":f,"background-class":"devui-modal-mask","background-block":l.value,"backdrop-close":s.value},{default:()=>[e.createVNode(e.Transition,{name:"devui-modal-wipe"},{default:()=>{var y;return[e.createVNode("div",e.mergeProps({class:"devui-modal"},n),[e.createVNode(v,{name:"close",class:"btn-close",size:"var(--devui-font-size-md,12px)",onClick:()=>f(!1)},null),o.header?o.header():m.value&&e.createVNode(k,null,{default:()=>[m.value]}),e.createVNode(V,null,{default:()=>{var u;return[(u=o.default)==null?void 0:u.call(o)]}}),(y=o.footer)==null?void 0:y.call(o)])]}})]})}}),N=e.defineComponent({name:"DModalFooter",setup(t,{slots:o}){return()=>{var n;return e.createVNode("div",{class:"devui-modal-footer"},[(n=o.default)==null?void 0:n.call(o)])}}});class Y{constructor(o){this.anchorContainer=o}renderModal(o,n,i){const c=e.h(this.component(),n,i);return e.render(c,o),c}renderNull(o){setTimeout(()=>{e.render(null,o)},500)}}let E;class O extends Y{component(){return w}open(o={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const y=o,{header:i,content:c,footer:a}=y,l=A(y,["header","content","footer"]),s=u=>{u||f()},m=(u,b=s)=>this.renderModal(n,C(g({},u),{modelValue:!0,"onUpdate:modelValue":b}),{header:i,default:c,footer:a}),f=()=>{var u,b;m(l,x=>{x?m(l):(this.renderModal(n,C(g({},l),{modelValue:!1})),this.renderNull(n))}),(b=(u=E.component.exposed).handleVisibleChange)==null||b.call(u,!1)};return this.renderModal(n,{modelValue:!1}),E=m(l),{hide:f}}}j(O,"token","MODAL_SERVICE_TOKEN");var K={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(t){if(t.component(w.name,w),t.component(k.name,k),t.component(V.name,V),t.component(N.name,N),!U)return;let o=document.getElementById("d-modal-anchors-container");o||(o=document.createElement("div"),o.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(o)),t.provide(O.token,new O(o))}};r.Modal=w,r.default=K,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
|
package/modal/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-overlay-background{position:fixed;top:0;left:0;height:100vh;width:100vw;display:flex}.devui-overlay-background__color{background:rgba(0,0,0,.4)}.devui-overlay-background .devui-overlay{position:relative;z-index:1000;pointer-events:auto}.devui-overlay-background__disabled{pointer-events:none}@keyframes d-overlay-fade{0%{opacity:0}to{opacity:1}}.devui-overlay-fade-enter{opacity:0}.devui-overlay-fade-enter-active{animation-name:d-overlay-fade;animation-duration:.3s}.devui-overlay-fade-leave{opacity:1}.devui-overlay-fade-leave-active{animation-name:d-overlay-fade;animation-duration:.3s;animation-direction:reverse}.devui-
|
|
1
|
+
.devui-overlay-background{position:fixed;top:0;left:0;height:100vh;width:100vw;display:flex}.devui-overlay-background__color{background:rgba(0,0,0,.4)}.devui-overlay-background .devui-overlay{position:relative;z-index:1000;pointer-events:auto}.devui-overlay-background__disabled{pointer-events:none}@keyframes d-overlay-fade{0%{opacity:0}to{opacity:1}}.devui-overlay-fade-enter{opacity:0}.devui-overlay-fade-enter-active{animation-name:d-overlay-fade;animation-duration:.3s}.devui-overlay-fade-leave{opacity:1}.devui-overlay-fade-leave-active{animation-name:d-overlay-fade;animation-duration:.3s;animation-direction:reverse}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-connected-overlay, 0 2px 8px 0) var(--devui-shadow, rgba(0, 0, 0, .2));z-index:1000}.devui-flexible-overlay-arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-modal-mask{justify-content:center;align-items:center;background-color:var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-modal{position:relative;width:300px;background-color:var(--devui-global-bg-normal, #ffffff)}.devui-modal .btn-close{position:absolute;right:20px;top:20px;width:20px;height:20px;line-height:20px;text-align:center;color:#000;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.devui-modal .btn-close:hover{color:var(--devui-icon-fill-active-hover, #526ecc);background-color:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-modal-content{background:var(--devui-fullscreen-overlay-bg, #ffffff);border-radius:var(--devui-border-radius, 2px)}.devui-modal-header{width:100%;height:56px;padding:32px 32px 0;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;box-sizing:border-box;border:none;user-select:none}.devui-modal-header .header-alert-icon{display:inline-block;vertical-align:middle;margin-right:8px;line-height:16px;text-align:center}.devui-modal-body{padding:20px 32px;font-size:var(--devui-font-size, 12px);color:var(--devui-text-weak, #575d6c);box-sizing:border-box}.devui-modal-footer{width:100%;border-top:none;text-align:center;padding:0 32px 24px;box-sizing:border-box}.devui-modal-footer>*{margin:0 4px}@keyframes wipe-in-out{0%{opacity:.2;transform:translateY(-24px)}to{opacity:1;transform:translateY(0)}}.devui-modal-wipe-enter-from{opacity:.2}.devui-modal-wipe-enter-active{animation-name:wipe-in-out;animation-duration:.3s}.devui-modal-wipe-leave-to{opacity:1}.devui-modal-wipe-leave-active{animation-name:wipe-in-out;animation-duration:.3s;animation-direction:reverse}
|