vue-devui 1.0.0-pre.0 → 1.0.0-rc.10
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 +149 -187
- package/alert/index.es.js +74 -45
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8182 -296
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +30 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5741 -127
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +59 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8060 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +379 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +5 -7
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8159 -288
- package/date-picker/index.umd.js +27 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +297 -181
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +525 -154
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1039 -1175
- package/form/index.umd.js +15 -15
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +42 -21
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +197 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +55 -31
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8066 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +269 -183
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +412 -204
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +307 -57
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +127 -149
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +10 -44
- package/pagination/index.es.js +158 -148
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +317 -246
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7964 -157
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +184 -57
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3644 -1122
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9144 -597
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +63 -41
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +109 -75
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +469 -349
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/status/index.es.js +27 -6
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +7794 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10119 -1206
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +342 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +49 -24
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7913 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/{anchor → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +425 -0
- package/timeline/index.umd.js +1 -0
- package/{back-top → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +308 -236
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +4189 -1851
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +380 -123
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +18121 -23161
- package/vue-devui.umd.js +25 -15
- package/accordion/index.es.js +0 -720
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5963
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8187
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -258
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -329
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.es.js +0 -299
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/modal/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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"});
|
|
1
|
+
var le=Object.defineProperty,ae=Object.defineProperties;var re=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var D=(d,e,u)=>e in d?le(d,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):d[e]=u,S=(d,e)=>{for(var u in e||(e={}))$.call(e,u)&&D(d,u,e[u]);if(E)for(var u of E(e))z.call(e,u)&&D(d,u,e[u]);return d},A=(d,e)=>ae(d,re(e));var R=(d,e)=>{var u={};for(var v in d)$.call(d,v)&&e.indexOf(v)<0&&(u[v]=d[v]);if(d!=null&&E)for(var v of E(d))e.indexOf(v)<0&&z.call(d,v)&&(u[v]=d[v]);return u};var L=(d,e,u)=>(D(d,typeof e!="symbol"?e+"":e,u),u);(function(d,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):(d=typeof globalThis!="undefined"?globalThis:d||self,e(d.index={},d.Vue,d.dom))})(this,function(d,e,u){"use strict";const v={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function},escapable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!0}},F={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},U={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function b(n,t,o){let l=n;return t&&(l+=`__${t}`),o&&(l+=`--${o}`),l}function C(n,t=!1){const o=t?`.devui-${n}`:`devui-${n}`;return{b:()=>b(o),e:r=>r?b(o,r):"",m:r=>r?b(o,"",r):"",em:(r,c)=>r&&c?b(o,r,c):""}}var se="",_=e.defineComponent({name:"DSvgIcon",props:U,setup(n){const{name:t,color:o,size:l}=e.toRefs(n),a=C("svg-icon"),s=e.computed(()=>`#icon-${t.value}`),i=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:i.value,height:i.value};return()=>e.createVNode("svg",{class:a.b(),style:r},[e.createVNode("use",{"xlink:href":s.value,fill:o.value},null)])}});function j(n){return/^((http|https):)?\/\//.test(n)}function H(n,t){const{component:o,name:l,size:a,color:s,classPrefix:i,rotate:r}=e.toRefs(n),c=C("icon"),f=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),p=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(_),m=()=>e.createVNode("img",e.mergeProps({src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],class:[(r==null?void 0:r.value)==="infinite"&&c.m("spin")],style:{width:f.value||"",transform:`rotate(${r==null?void 0:r.value}deg)`}},t.attrs),null),y=()=>e.createVNode(p,e.mergeProps({name:l.value,color:s.value,size:f.value,class:[(r==null?void 0:r.value)==="infinite"&&c.m("spin")],style:{transform:`rotate(${r==null?void 0:r.value}deg)`}},t.attrs),null),h=()=>{const w=/^icon-/.test(l.value)?l.value:`${i.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[i.value,w,(r==null?void 0:r.value)==="infinite"&&c.m("spin")],style:{fontSize:f.value,color:s.value,transform:`rotate(${r==null?void 0:r.value}deg)`}},t.attrs),null)};return{iconDom:()=>o.value?y():j(l.value)?m():h()}}var q=e.defineComponent({name:"DIcon",props:F,setup(n,t){const{disabled:o,operable:l}=e.toRefs(n),{iconDom:a}=H(n,t),s=C("icon"),i=e.computed(()=>({[s.e("container")]:!0,[s.m("disabled")]:o.value,[s.m("operable")]:l.value})),r=c=>{o.value&&(c.preventDefault(),c.stopImmediatePropagation())};return()=>{var c,f,p,m;return e.createVNode("div",{class:i.value,onClick:r},[(f=(c=t.slots).prefix)==null?void 0:f.call(c),a(),(m=(p=t.slots).suffix)==null?void 0:m.call(p)])}}}),de="";e.defineComponent({name:"DIconGroup",setup(n,t){const o=C("icon-group");return()=>{var l,a;return e.createVNode("div",{class:o.b()},[(a=(l=t.slots).default)==null?void 0:a.call(l)])}}});const X={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function P(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const n=document.documentElement.scrollTop,t=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${n}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{t?document.documentElement.setAttribute("style",t):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=n}}}function Y(n,t){let o;const l=s=>{s.preventDefault(),t.emit("click",s),n.closeOnClickOverlay&&t.emit("update:modelValue",!1)},a=()=>{o==null||o()};return e.watch(()=>n.modelValue,s=>{s?n.lockScroll&&(o=P()):a()}),e.onUnmounted(a),{onClick:l}}var ce="";const G=e.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:X,emits:["update:modelValue","click"],setup(n,t){const{modelValue:o}=e.toRefs(n),l=C("fixed-overlay"),{onClick:a}=Y(n,t);return()=>e.createVNode(e.Transition,{name:l.m("fade")},{default:()=>{var s,i;return[o.value&&e.createVNode("div",e.mergeProps({class:l.b()},t.attrs,{onClick:a}),[(i=(s=t.slots).default)==null?void 0:i.call(s)])]}})}}),K={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function J(n){const t=/(auto|scroll|hidden)/;for(let o=n;o=o.parentElement;o.parentElement!==document.body){const l=window.getComputedStyle(o);if(t.test(l.overflow+l.overflowX+l.overflowY))return o}return window}function Q(n,t,o,l){let{x:a,y:s}=t;if(!n){const{width:i,height:r}=l;a&&o.includes("start")&&(a=12),a&&o.includes("end")&&(a=Math.round(i-24)),s&&o.includes("start")&&(s=10),s&&o.includes("end")&&(s=r-14)}return{x:a,y:s}}function W(n,t){const o=e.ref(),l=e.ref();let a=null;const s=(r,c,f,p)=>{const{x:m,y}=Q(n.isArrowCenter,f,c,p.getBoundingClientRect()),h={top:"bottom",right:"left",bottom:"top",left:"right"}[c.split("-")[0]];Object.assign(r.style,{left:m?`${m}px`:"",top:y?`${y}px`:"",right:"",bottom:"",[h]:"-4px"})},i=async()=>{const r=n.origin,c=e.unref(o.value),f=e.unref(l.value),p=[u.offset(n.offset),u.autoPlacement({alignment:n.align,allowedPlacements:n.position})];n.showArrow&&p.push(u.arrow({element:f})),n.shiftOffset!==void 0&&p.push(u.shift());const{x:m,y,placement:h,middlewareData:g}=await u.computePosition(r,c,{strategy:"fixed",middleware:p});let w=m,B=y;if(n.shiftOffset!==void 0){const{x:I,y:T}=g.shift;I<0&&(w-=n.shiftOffset),I>0&&(w+=n.shiftOffset),T<0&&(B-=n.shiftOffset),T>0&&(B+=n.shiftOffset)}t("positionChange",h),Object.assign(c.style,{top:`${B}px`,left:`${w}px`}),n.showArrow&&s(f,h,g.arrow,c)};return e.watch(()=>n.modelValue,()=>{n.modelValue&&n.origin?(a=J(n.origin),e.nextTick(i),a==null||a.addEventListener("scroll",i),a!==window&&window.addEventListener("scroll",i),window.addEventListener("resize",i)):(a==null||a.removeEventListener("scroll",i),a!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i))}),e.onUnmounted(()=>{a==null||a.removeEventListener("scroll",i),a!==window&&window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}),{arrowRef:l,overlayRef:o,updatePosition:i}}var ue="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:K,emits:["update:modelValue","positionChange"],setup(n,{slots:t,attrs:o,emit:l,expose:a}){const s=C("flexible-overlay"),{arrowRef:i,overlayRef:r,updatePosition:c}=W(n,l);return a({updatePosition:c}),()=>{var f;return n.modelValue&&e.createVNode("div",e.mergeProps({ref:r,class:s.b()},o),[(f=t.default)==null?void 0:f.call(t),n.showArrow&&e.createVNode("div",{ref:i,class:s.e("arrow")},null)])}}});const Z=typeof window!="undefined";function ee(n,t){function o(){t("update:modelValue",!1)}function l(){n.beforeClose?n.beforeClose(o):o()}function a(){n.closeOnClickOverlay&&l()}function s(){l()}function i(r){r.keyCode===27&&l()}return e.onMounted(()=>{n.escapable&&window.addEventListener("keydown",i)}),e.onUnmounted(()=>{n.escapable&&window.addEventListener("keydown",i)}),{onCloseBtnClick:s,onOverlayClick:a}}function te(n){const t=e.ref(!1),o=e.ref(!1);let l;const a=()=>{l==null||l()};return e.watch(()=>n.modelValue,s=>{s?(n.lockScroll&&(l=P()),t.value=!0,e.nextTick(()=>{o.value=!0})):(a(),o.value=!1,setTimeout(()=>{t.value=!1},100))}),e.onUnmounted(a),{showContainer:t,showModal:o}}var N=e.defineComponent({name:"DModalHeader",setup(n,{slots:t}){const o=C("modal");return()=>{var l;return e.createVNode("div",{class:o.e("header")},[(l=t.default)==null?void 0:l.call(t)])}}}),x=e.defineComponent({name:"DModalBody",setup(n,{slots:t}){const o=C("modal");return()=>{var l;return e.createVNode("div",{class:o.e("body")},[(l=t.default)==null?void 0:l.call(t)])}}}),fe="",V=e.defineComponent({name:"DModal",inheritAttrs:!1,props:v,emits:["update:modelValue"],setup(n,{slots:t,attrs:o,emit:l}){const a=C("modal"),{modelValue:s,title:i,showClose:r,showOverlay:c,appendToBody:f}=e.toRefs(n),{onCloseBtnClick:p,onOverlayClick:m}=ee(n,l),{showContainer:y,showModal:h}=te(n);return()=>e.createVNode(e.Teleport,{to:"body",disabled:!f.value},{default:()=>[c.value&&e.createVNode(G,{modelValue:s.value,"onUpdate:modelValue":g=>s.value=g,"lock-scroll":!1,style:{zIndex:"calc(var(--devui-z-index-modal, 1050) - 1)"}},null),y.value&&e.createVNode("div",{class:a.e("container"),onClick:m},[e.createVNode(e.Transition,{name:a.m("wipe")},{default:()=>{var g;return[h.value&&e.createVNode("div",e.mergeProps({class:a.b()},o),[r.value&&e.createVNode(q,{name:"close",class:"btn-close",size:"var(--devui-font-size-md,12px)",onClick:p},null),t.header?t.header():i.value&&e.createVNode(N,null,{default:()=>[i.value]}),e.createVNode(x,null,{default:()=>{var w;return[(w=t.default)==null?void 0:w.call(t)]}}),(g=t.footer)==null?void 0:g.call(t)])]}})])]})}}),M=e.defineComponent({name:"DModalFooter",setup(n,{slots:t}){const o=C("modal");return()=>{var l;return e.createVNode("div",{class:o.e("footer")},[(l=t.default)==null?void 0:l.call(t)])}}});class ne{constructor(t){this.anchorContainer=t}renderModal(t,o,l){const a=e.h(this.component(),o,l);return e.render(a,t),a}renderNull(t){setTimeout(()=>{e.render(null,t)},500)}}let O;class k extends ne{component(){return V}open(t={}){const o=document.createElement("div");this.anchorContainer.appendChild(o);const p=t,{header:l,content:a,footer:s}=p,i=R(p,["header","content","footer"]),r=(m,y)=>this.renderModal(o,A(S({},m),{modelValue:!0,"onUpdate:modelValue":y}),{header:l,default:a,footer:s}),c=()=>{var y,h,g;const m=w=>{w||c()};r(i,w=>{w?r(i,m):(this.renderModal(o,A(S({},i),{modelValue:!1})),this.renderNull(o))}),(g=(h=(y=O==null?void 0:O.component)==null?void 0:y.exposed)==null?void 0:h.handleVisibleChange)==null||g.call(h,!1)},f=m=>{m||c()};return this.renderModal(o,{modelValue:!1}),O=r(i,f),{hide:c}}}L(k,"token","MODAL_SERVICE_TOKEN");var oe={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(n){if(n.component(V.name,V),n.component(N.name,N),n.component(x.name,x),n.component(M.name,M),!Z)return;let t=document.getElementById("d-modal-anchors-container");t||(t=document.createElement("div"),t.setAttribute("id","d-modal-anchors-container"),document.body.appendChild(t)),n.provide(k.token,new k(t))}};d.Modal=V,d.default=oe,d.modalProps=v,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
package/modal/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
1
|
+
.devui-icon__container{display:inline-flex;align-items:center;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--disabled{color:var(--devui-disabled-text, #cfd0d3);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #cfd0d3)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 4px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}.devui-fixed-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1050}.devui-fixed-overlay--fade-enter-active,.devui-fixed-overlay--fade-leave-active{transition:opacity .1s cubic-bezier(0,0,1,1)}.devui-fixed-overlay--fade-enter-from,.devui-fixed-overlay--fade-leave-to{opacity:0}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 4px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}.devui-modal__container{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--devui-z-index-modal, 1050);outline:0;overflow-y:auto;display:flex;flex-direction:column}.devui-modal{position:relative;width:300px;margin:auto;border-radius:var(--devui-border-radius, 4px);border:none;opacity:1;transform:translateY(0);background-color:var(--devui-fullscreen-overlay-bg, #ffffff);background-clip:padding-box;outline:0;box-shadow:var(--devui-shadow-length-fullscreen-overlay, 0 12px 24px 0) var(--devui-shadow, rgba(37, 43, 58, .2))}.devui-modal .btn-close{position:absolute;right:16px;top:16px;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, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.devui-modal-content{background:var(--devui-fullscreen-overlay-bg, #ffffff);border-radius:var(--devui-border-radius, 4px)}.devui-modal__header{width:100%;height:56px;padding:32px 32px 0;font-size:var(--devui-font-size-card-title, 16px);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, 14px);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}.devui-modal--wipe-enter-active{transition:opacity .1s cubic-bezier(.16,.75,.5,1),transform .1s cubic-bezier(0,0,1,1)}.devui-modal--wipe-leave-active{transition:opacity .1s cubic-bezier(.5,0,.84,.25),transform .1s cubic-bezier(0,0,1,1)}.devui-modal--wipe-enter-from,.devui-modal--wipe-leave-to{opacity:.2;transform:translateY(-24px)}
|
package/notification/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, createVNode,
|
|
20
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, Transition, reactive, createApp, onUnmounted, isVNode } from "vue";
|
|
21
21
|
const notificationProps = {
|
|
22
22
|
modelValue: {
|
|
23
23
|
type: Boolean,
|
|
@@ -39,62 +39,219 @@ const notificationProps = {
|
|
|
39
39
|
type: Function
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
size: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "inherit"
|
|
52
|
-
},
|
|
53
|
-
color: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: "inherit"
|
|
56
|
-
},
|
|
57
|
-
classPrefix: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: "icon"
|
|
60
|
-
}
|
|
42
|
+
const DEFAULT_PREFIX = "icon";
|
|
43
|
+
const iconProps = {
|
|
44
|
+
name: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "",
|
|
47
|
+
required: true
|
|
61
48
|
},
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
size: {
|
|
50
|
+
type: [Number, String],
|
|
51
|
+
default: "inherit"
|
|
52
|
+
},
|
|
53
|
+
color: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "inherit"
|
|
56
|
+
},
|
|
57
|
+
component: {
|
|
58
|
+
type: Object,
|
|
59
|
+
default: null
|
|
60
|
+
},
|
|
61
|
+
classPrefix: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: DEFAULT_PREFIX
|
|
64
|
+
},
|
|
65
|
+
operable: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
64
68
|
},
|
|
65
|
-
|
|
69
|
+
disabled: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
rotate: {
|
|
74
|
+
type: [Number, String]
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const svgIconProps = {
|
|
78
|
+
name: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "",
|
|
81
|
+
required: true
|
|
82
|
+
},
|
|
83
|
+
color: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: "inherit"
|
|
86
|
+
},
|
|
87
|
+
size: {
|
|
88
|
+
type: [Number, String],
|
|
89
|
+
default: "inherit"
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
function createBem(namespace, element, modifier) {
|
|
93
|
+
let cls = namespace;
|
|
94
|
+
if (element) {
|
|
95
|
+
cls += `__${element}`;
|
|
96
|
+
}
|
|
97
|
+
if (modifier) {
|
|
98
|
+
cls += `--${modifier}`;
|
|
99
|
+
}
|
|
100
|
+
return cls;
|
|
101
|
+
}
|
|
102
|
+
function useNamespace(block, needDot = false) {
|
|
103
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
104
|
+
const b = () => createBem(namespace);
|
|
105
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
106
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
107
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
108
|
+
return {
|
|
109
|
+
b,
|
|
110
|
+
e,
|
|
111
|
+
m,
|
|
112
|
+
em
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
var icon = "";
|
|
116
|
+
var svgIcon = defineComponent({
|
|
117
|
+
name: "DSvgIcon",
|
|
118
|
+
props: svgIconProps,
|
|
119
|
+
setup(props) {
|
|
66
120
|
const {
|
|
67
121
|
name,
|
|
68
|
-
size,
|
|
69
122
|
color,
|
|
70
|
-
|
|
71
|
-
} =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
123
|
+
size
|
|
124
|
+
} = toRefs(props);
|
|
125
|
+
const ns2 = useNamespace("svg-icon");
|
|
126
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
127
|
+
const iconSize = computed(() => {
|
|
128
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
129
|
+
});
|
|
130
|
+
const styles = {
|
|
131
|
+
width: iconSize.value,
|
|
132
|
+
height: iconSize.value
|
|
133
|
+
};
|
|
134
|
+
return () => {
|
|
135
|
+
return createVNode("svg", {
|
|
136
|
+
"class": ns2.b(),
|
|
137
|
+
"style": styles
|
|
138
|
+
}, [createVNode("use", {
|
|
139
|
+
"xlink:href": iconName.value,
|
|
140
|
+
"fill": color.value
|
|
141
|
+
}, null)]);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
function isUrl(value) {
|
|
146
|
+
return /^((http|https):)?\/\//.test(value);
|
|
147
|
+
}
|
|
148
|
+
function useIconDom(props, ctx) {
|
|
149
|
+
const {
|
|
150
|
+
component,
|
|
151
|
+
name,
|
|
152
|
+
size,
|
|
153
|
+
color,
|
|
154
|
+
classPrefix,
|
|
155
|
+
rotate
|
|
156
|
+
} = toRefs(props);
|
|
157
|
+
const ns2 = useNamespace("icon");
|
|
158
|
+
const iconSize = computed(() => {
|
|
159
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
160
|
+
});
|
|
161
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
162
|
+
const imgIconDom = () => {
|
|
163
|
+
return createVNode("img", mergeProps({
|
|
164
|
+
"src": name.value,
|
|
165
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
166
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
167
|
+
"style": {
|
|
168
|
+
width: iconSize.value || "",
|
|
169
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
170
|
+
}
|
|
171
|
+
}, ctx.attrs), null);
|
|
172
|
+
};
|
|
173
|
+
const svgIconDom = () => {
|
|
174
|
+
return createVNode(IconComponent, mergeProps({
|
|
175
|
+
"name": name.value,
|
|
176
|
+
"color": color.value,
|
|
177
|
+
"size": iconSize.value,
|
|
178
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
75
179
|
"style": {
|
|
76
|
-
|
|
77
|
-
verticalAlign: "text-bottom"
|
|
180
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
78
181
|
}
|
|
79
|
-
},
|
|
80
|
-
|
|
182
|
+
}, ctx.attrs), null);
|
|
183
|
+
};
|
|
184
|
+
const fontIconDom = () => {
|
|
185
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
186
|
+
return createVNode("i", mergeProps({
|
|
187
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
81
188
|
"style": {
|
|
82
|
-
fontSize:
|
|
83
|
-
color
|
|
189
|
+
fontSize: iconSize.value,
|
|
190
|
+
color: color.value,
|
|
191
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
84
192
|
}
|
|
85
|
-
}, null);
|
|
193
|
+
}, ctx.attrs), null);
|
|
194
|
+
};
|
|
195
|
+
const iconDom = () => {
|
|
196
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
197
|
+
};
|
|
198
|
+
return {
|
|
199
|
+
iconDom
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
var Icon = defineComponent({
|
|
203
|
+
name: "DIcon",
|
|
204
|
+
props: iconProps,
|
|
205
|
+
setup(props, ctx) {
|
|
206
|
+
const {
|
|
207
|
+
disabled,
|
|
208
|
+
operable
|
|
209
|
+
} = toRefs(props);
|
|
210
|
+
const {
|
|
211
|
+
iconDom
|
|
212
|
+
} = useIconDom(props, ctx);
|
|
213
|
+
const ns2 = useNamespace("icon");
|
|
214
|
+
const wrapClassed = computed(() => ({
|
|
215
|
+
[ns2.e("container")]: true,
|
|
216
|
+
[ns2.m("disabled")]: disabled.value,
|
|
217
|
+
[ns2.m("operable")]: operable.value
|
|
218
|
+
}));
|
|
219
|
+
const onClick = (e) => {
|
|
220
|
+
if (disabled.value) {
|
|
221
|
+
e.preventDefault();
|
|
222
|
+
e.stopImmediatePropagation();
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
return () => {
|
|
226
|
+
var _a, _b, _c, _d;
|
|
227
|
+
return createVNode("div", {
|
|
228
|
+
"class": wrapClassed.value,
|
|
229
|
+
"onClick": onClick
|
|
230
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
var iconGroup = "";
|
|
235
|
+
defineComponent({
|
|
236
|
+
name: "DIconGroup",
|
|
237
|
+
setup(_, ctx) {
|
|
238
|
+
const ns2 = useNamespace("icon-group");
|
|
239
|
+
return () => {
|
|
240
|
+
var _a, _b;
|
|
241
|
+
return createVNode("div", {
|
|
242
|
+
"class": ns2.b()
|
|
243
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
244
|
+
};
|
|
86
245
|
}
|
|
87
246
|
});
|
|
88
|
-
Icon.install = function(app) {
|
|
89
|
-
app.component(Icon.name, Icon);
|
|
90
|
-
};
|
|
91
247
|
var Close = defineComponent({
|
|
92
248
|
emits: ["click"],
|
|
93
249
|
setup(props, {
|
|
94
250
|
emit
|
|
95
251
|
}) {
|
|
252
|
+
const ns2 = useNamespace("notification");
|
|
96
253
|
return () => createVNode("div", {
|
|
97
|
-
"class": "
|
|
254
|
+
"class": ns2.e("icon-close"),
|
|
98
255
|
"onClick": (e) => emit("click", e)
|
|
99
256
|
}, [createVNode(Icon, {
|
|
100
257
|
"name": "close",
|
|
@@ -102,6 +259,106 @@ var Close = defineComponent({
|
|
|
102
259
|
}, null)]);
|
|
103
260
|
}
|
|
104
261
|
});
|
|
262
|
+
const ns = useNamespace("notification");
|
|
263
|
+
function SuccessIcon() {
|
|
264
|
+
return createVNode("svg", {
|
|
265
|
+
"width": "16px",
|
|
266
|
+
"height": "16px",
|
|
267
|
+
"viewBox": "0 0 16 16",
|
|
268
|
+
"version": "1.1",
|
|
269
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
270
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
271
|
+
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
272
|
+
"id": "path-s",
|
|
273
|
+
"points": "6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"
|
|
274
|
+
}, null)]), createVNode("g", {
|
|
275
|
+
"id": "correct",
|
|
276
|
+
"stroke": "none",
|
|
277
|
+
"stroke-width": "1",
|
|
278
|
+
"fill": "none",
|
|
279
|
+
"fill-rule": "evenodd"
|
|
280
|
+
}, [createVNode("mask", {
|
|
281
|
+
"id": "mask-2",
|
|
282
|
+
"fill": "white"
|
|
283
|
+
}, [createVNode("use", {
|
|
284
|
+
"xlink:href": "#path-s"
|
|
285
|
+
}, null)]), createVNode("use", {
|
|
286
|
+
"id": "Mask",
|
|
287
|
+
"class": ns.e("image-success-path"),
|
|
288
|
+
"xlink:href": "#path-s"
|
|
289
|
+
}, null)])]);
|
|
290
|
+
}
|
|
291
|
+
function WarningIcon() {
|
|
292
|
+
return createVNode("svg", {
|
|
293
|
+
"width": "16px",
|
|
294
|
+
"height": "16px",
|
|
295
|
+
"viewBox": "0 0 16 16",
|
|
296
|
+
"version": "1.1",
|
|
297
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
298
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
299
|
+
}, [createVNode("g", {
|
|
300
|
+
"stroke": "none",
|
|
301
|
+
"stroke-width": "1",
|
|
302
|
+
"fill": "none",
|
|
303
|
+
"fill-rule": "evenodd"
|
|
304
|
+
}, [createVNode("path", {
|
|
305
|
+
"class": ns.e("warning-outer"),
|
|
306
|
+
"d": "M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"
|
|
307
|
+
}, null), createVNode("path", {
|
|
308
|
+
"class": ns.e("warning-inner"),
|
|
309
|
+
"stroke-width": "0.3",
|
|
310
|
+
"fill-rule": "nonzero",
|
|
311
|
+
"d": "M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"
|
|
312
|
+
}, null)])]);
|
|
313
|
+
}
|
|
314
|
+
function InfoIcon() {
|
|
315
|
+
return createVNode("svg", {
|
|
316
|
+
"width": "16px",
|
|
317
|
+
"height": "16px",
|
|
318
|
+
"viewBox": "0 0 16 16",
|
|
319
|
+
"version": "1.1",
|
|
320
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
321
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
322
|
+
}, [createVNode("g", {
|
|
323
|
+
"id": "info",
|
|
324
|
+
"stroke": "none",
|
|
325
|
+
"stroke-width": "1",
|
|
326
|
+
"fill": "none",
|
|
327
|
+
"fill-rule": "evenodd"
|
|
328
|
+
}, [createVNode("path", {
|
|
329
|
+
"class": ns.e("image-info-path"),
|
|
330
|
+
"d": "M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",
|
|
331
|
+
"id": "info"
|
|
332
|
+
}, null)])]);
|
|
333
|
+
}
|
|
334
|
+
function ErrorIcon() {
|
|
335
|
+
return createVNode("svg", {
|
|
336
|
+
"width": "16px",
|
|
337
|
+
"height": "16px",
|
|
338
|
+
"viewBox": "0 0 16 16",
|
|
339
|
+
"version": "1.1",
|
|
340
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
341
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
342
|
+
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
343
|
+
"id": "path-e",
|
|
344
|
+
"points": "8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"
|
|
345
|
+
}, null)]), createVNode("g", {
|
|
346
|
+
"id": "error",
|
|
347
|
+
"stroke": "none",
|
|
348
|
+
"stroke-width": "1",
|
|
349
|
+
"fill": "none",
|
|
350
|
+
"fill-rule": "evenodd"
|
|
351
|
+
}, [createVNode("mask", {
|
|
352
|
+
"id": "mask-2",
|
|
353
|
+
"fill": "white"
|
|
354
|
+
}, [createVNode("use", {
|
|
355
|
+
"xlink:href": "#path-e"
|
|
356
|
+
}, null)]), createVNode("use", {
|
|
357
|
+
"id": "Mask",
|
|
358
|
+
"class": ns.e("image-error-path"),
|
|
359
|
+
"xlink:href": "#path-e"
|
|
360
|
+
}, null)])]);
|
|
361
|
+
}
|
|
105
362
|
var TypeIcon = defineComponent({
|
|
106
363
|
props: {
|
|
107
364
|
type: {
|
|
@@ -113,22 +370,14 @@ var TypeIcon = defineComponent({
|
|
|
113
370
|
const {
|
|
114
371
|
type
|
|
115
372
|
} = toRefs(props);
|
|
373
|
+
const ns2 = useNamespace("notification");
|
|
116
374
|
const classes = computed(() => ({
|
|
117
|
-
"
|
|
118
|
-
[
|
|
375
|
+
[ns2.e("image")]: true,
|
|
376
|
+
[ns2.em("image", type.value)]: true
|
|
119
377
|
}));
|
|
120
|
-
const severityIconMap = {
|
|
121
|
-
info: "info-o",
|
|
122
|
-
success: "right-o",
|
|
123
|
-
warning: "warning-o",
|
|
124
|
-
error: "error-o"
|
|
125
|
-
};
|
|
126
378
|
return () => createVNode("span", {
|
|
127
379
|
"class": classes.value
|
|
128
|
-
}, [type.value !== "normal" && createVNode(
|
|
129
|
-
"name": severityIconMap[type.value],
|
|
130
|
-
"size": "16px"
|
|
131
|
-
}, null)]);
|
|
380
|
+
}, [type.value && type.value !== "normal" && (type.value === "success" && createVNode(SuccessIcon, null, null) || type.value === "info" && createVNode(InfoIcon, null, null) || type.value === "warning" && createVNode(WarningIcon, null, null) || type.value === "error" && createVNode(ErrorIcon, null, null))]);
|
|
132
381
|
}
|
|
133
382
|
});
|
|
134
383
|
function useNotification(props) {
|
|
@@ -196,6 +445,7 @@ var Notification = defineComponent({
|
|
|
196
445
|
close: close2,
|
|
197
446
|
handleDestroy
|
|
198
447
|
} = useEvent(props, emit);
|
|
448
|
+
const ns2 = useNamespace("notification");
|
|
199
449
|
return () => createVNode(Transition, {
|
|
200
450
|
"name": "notification-fade",
|
|
201
451
|
"onAfterLeave": handleDestroy
|
|
@@ -203,23 +453,23 @@ var Notification = defineComponent({
|
|
|
203
453
|
default: () => {
|
|
204
454
|
var _a;
|
|
205
455
|
return [modelValue.value && createVNode("div", {
|
|
206
|
-
"class":
|
|
456
|
+
"class": ns2.b()
|
|
207
457
|
}, [createVNode("div", {
|
|
208
458
|
"class": classes.value,
|
|
209
459
|
"onMouseenter": interrupt,
|
|
210
460
|
"onMouseleave": removeReset
|
|
211
461
|
}, [createVNode("div", {
|
|
212
|
-
"class": "
|
|
462
|
+
"class": ns2.e("item")
|
|
213
463
|
}, [createVNode(Close, {
|
|
214
464
|
"onClick": close2
|
|
215
465
|
}, null), title.value && createVNode(TypeIcon, {
|
|
216
466
|
"type": type.value
|
|
217
467
|
}, null), createVNode("div", {
|
|
218
|
-
"class": "
|
|
468
|
+
"class": ns2.e("message")
|
|
219
469
|
}, [createVNode("span", {
|
|
220
|
-
"class": "
|
|
470
|
+
"class": ns2.e("title")
|
|
221
471
|
}, [title.value]), createVNode("span", {
|
|
222
|
-
"class": "
|
|
472
|
+
"class": ns2.e("content")
|
|
223
473
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])])])])])];
|
|
224
474
|
}
|
|
225
475
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O=Object.defineProperty,X=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var k=(a,e,u)=>e in a?O(a,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[e]=u,y=(a,e)=>{for(var u in e||(e={}))H.call(e,u)&&k(a,u,e[u]);if(x)for(var u of x(e))J.call(e,u)&&k(a,u,e[u]);return a},C=(a,e)=>X(a,W(e));(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const u={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:"normal"},duration:{type:Number,default:3e3},onClose:{type:Function}},b={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},S={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function N(n,t,o){let l=n;return t&&(l+=`__${t}`),o&&(l+=`--${o}`),l}function m(n,t=!1){const o=t?`.devui-${n}`:`devui-${n}`;return{b:()=>N(o),e:i=>i?N(o,i):"",m:i=>i?N(o,"",i):"",em:(i,r)=>i&&r?N(o,i,r):""}}var Q="",D=e.defineComponent({name:"DSvgIcon",props:S,setup(n){const{name:t,color:o,size:l}=e.toRefs(n),s=m("svg-icon"),c=e.computed(()=>`#icon-${t.value}`),d=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),i={width:d.value,height:d.value};return()=>e.createVNode("svg",{class:s.b(),style:i},[e.createVNode("use",{"xlink:href":c.value,fill:o.value},null)])}});function I(n){return/^((http|https):)?\/\//.test(n)}function L(n,t){const{component:o,name:l,size:s,color:c,classPrefix:d,rotate:i}=e.toRefs(n),r=m("icon"),p=e.computed(()=>typeof s.value=="number"?`${s.value}px`:s.value),g=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(D),f=()=>e.createVNode("img",e.mergeProps({src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],class:[(i==null?void 0:i.value)==="infinite"&&r.m("spin")],style:{width:p.value||"",transform:`rotate(${i==null?void 0:i.value}deg)`}},t.attrs),null),V=()=>e.createVNode(g,e.mergeProps({name:l.value,color:c.value,size:p.value,class:[(i==null?void 0:i.value)==="infinite"&&r.m("spin")],style:{transform:`rotate(${i==null?void 0:i.value}deg)`}},t.attrs),null),q=()=>{const G=/^icon-/.test(l.value)?l.value:`${d.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[d.value,G,(i==null?void 0:i.value)==="infinite"&&r.m("spin")],style:{fontSize:p.value,color:c.value,transform:`rotate(${i==null?void 0:i.value}deg)`}},t.attrs),null)};return{iconDom:()=>o.value?V():I(l.value)?f():q()}}var P=e.defineComponent({name:"DIcon",props:b,setup(n,t){const{disabled:o,operable:l}=e.toRefs(n),{iconDom:s}=L(n,t),c=m("icon"),d=e.computed(()=>({[c.e("container")]:!0,[c.m("disabled")]:o.value,[c.m("operable")]:l.value})),i=r=>{o.value&&(r.preventDefault(),r.stopImmediatePropagation())};return()=>{var r,p,g,f;return e.createVNode("div",{class:d.value,onClick:i},[(p=(r=t.slots).prefix)==null?void 0:p.call(r),s(),(f=(g=t.slots).suffix)==null?void 0:f.call(g)])}}}),Y="";e.defineComponent({name:"DIconGroup",setup(n,t){const o=m("icon-group");return()=>{var l,s;return e.createVNode("div",{class:o.b()},[(s=(l=t.slots).default)==null?void 0:s.call(l)])}}});var T=e.defineComponent({emits:["click"],setup(n,{emit:t}){const o=m("notification");return()=>e.createVNode("div",{class:o.e("icon-close"),onClick:l=>t("click",l)},[e.createVNode(P,{name:"close",size:"14px"},null)])}});const h=m("notification");function $(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-s",points:"6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"},null)]),e.createVNode("g",{id:"correct",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-s"},null)]),e.createVNode("use",{id:"Mask",class:h.e("image-success-path"),"xlink:href":"#path-s"},null)])])}function M(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:h.e("warning-outer"),d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:h.e("warning-inner"),"stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)])])}function z(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{id:"info",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:h.e("image-info-path"),d:"M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",id:"info"},null)])])}function R(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("defs",null,[e.createVNode("polygon",{id:"path-e",points:"8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"},null)]),e.createVNode("g",{id:"error",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("mask",{id:"mask-2",fill:"white"},[e.createVNode("use",{"xlink:href":"#path-e"},null)]),e.createVNode("use",{id:"Mask",class:h.e("image-error-path"),"xlink:href":"#path-e"},null)])])}var B=e.defineComponent({props:{type:{type:String,default:"normal"}},setup(n){const{type:t}=e.toRefs(n),o=m("notification"),l=e.computed(()=>({[o.e("image")]:!0,[o.em("image",t.value)]:!0}));return()=>e.createVNode("span",{class:l.value},[t.value&&t.value!=="normal"&&(t.value==="success"&&e.createVNode($,null,null)||t.value==="info"&&e.createVNode(z,null,null)||t.value==="warning"&&e.createVNode(M,null,null)||t.value==="error"&&e.createVNode(R,null,null))])}});function E(n){return{classes:e.computed(()=>({"devui-notification-item-container":!0,[`devui-notification-message-${n.type}`]:!0}))}}function _(n,t){let o=null,l;const s=()=>{var r;clearTimeout(o),o=null,(r=n.onClose)==null||r.call(n),t("update:modelValue",!1)},c=()=>{o&&(clearTimeout(o),o=null)},d=()=>{if(!n.modelValue){const r=n.duration-(Date.now()-l);o=setTimeout(s,r)}},i=()=>{t("destroy")};return e.watch(()=>n.modelValue,r=>{r&&(l=Date.now(),n.duration&&(o=setTimeout(s,n.duration)))}),{interrupt:c,removeReset:d,close:s,handleDestroy:i}}var ee="",w=e.defineComponent({name:"DNotification",props:u,emits:["update:modelValue","destroy"],setup(n,{emit:t,slots:o}){const{modelValue:l,title:s,type:c}=e.toRefs(n),{classes:d}=E(n),{interrupt:i,removeReset:r,close:p,handleDestroy:g}=_(n,t),f=m("notification");return()=>e.createVNode(e.Transition,{name:"notification-fade",onAfterLeave:g},{default:()=>{var V;return[l.value&&e.createVNode("div",{class:f.b()},[e.createVNode("div",{class:d.value,onMouseenter:i,onMouseleave:r},[e.createVNode("div",{class:f.e("item")},[e.createVNode(T,{onClick:p},null),s.value&&e.createVNode(B,{type:c.value},null),e.createVNode("div",{class:f.e("message")},[e.createVNode("span",{class:f.e("title")},[s.value]),e.createVNode("span",{class:f.e("content")},[(V=o.default)==null?void 0:V.call(o)])])])])])]}})}});function j(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const A={modelValue:!1,duration:3e3,type:"normal"};function F(n,t){const o=document.createElement("div"),l=e.createApp({setup(){return e.onUnmounted(()=>{document.body.removeChild(o)}),()=>e.createVNode(w,e.mergeProps(n,{onDestroy:l.unmount}),j(t)?t:{default:()=>[t]})}});return document.body.appendChild(o),l.mount(o),l}function Z(n,t){n.modelValue=!1,t==null||t()}class v{static open(t){const o=t.onClose||null,l=t.content;let s;delete t.content;const c=e.reactive(C(y(y({},A),t),{onClose:()=>{Z(c,o)}}));F(c,l),c.modelValue=!0,clearTimeout(s),t.duration&&(s=setTimeout(c.onClose,t.duration))}}var U={title:"Notification \u5168\u5C40\u901A\u77E5",category:"\u53CD\u9988",status:"100%",install(n){n.component(w.name,w),n.config.globalProperties.$notificationService=v}};a.Notification=w,a.NotificationService=v,a.default=U,a.notificationProps=u,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
package/notification/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0
|
|
1
|
+
.devui-icon__container{display:inline-flex;align-items:center;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--disabled{color:var(--devui-disabled-text, #cfd0d3);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #cfd0d3)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 4px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}.devui-notification{position:fixed;top:50px;right:20px;width:20em;word-break:normal;word-wrap:break-word;z-index:1060}.devui-notification a:link,.devui-notification a:visited{color:var(--devui-link-light, #96adfa)}.devui-notification a:hover,.devui-notification a:active{color:var(--devui-link-light-active, #beccfa)}.devui-notification-item-container{position:relative;margin:0 0 8px;opacity:.95;filter:alpha(opacity=95);box-shadow:var(--devui-shadow-length-feedback-overlay, 0 8px 16px 0) var(--devui-shadow, rgba(37, 43, 58, .2));border-radius:var(--devui-border-radius-feedback, 4px);color:var(--devui-feedback-overlay-text, #dfe1e6);background-color:var(--devui-feedback-overlay-bg, #464d6e)}.devui-notification__item{position:relative;display:block;padding:12px 16px}.devui-notification__icon-close{position:absolute;top:7px;right:10px;cursor:pointer}.devui-notification__icon-close i.icon{color:var(--devui-light-text, #ffffff)!important}.devui-notification__title{font-size:var(--devui-font-size-card-title, 16px);padding:0 0 calc(.5em - 2px) 0;display:block;font-weight:700}.devui-notification__image{position:absolute;display:inline-block;width:16px;height:16px;border-radius:50%;left:16px;top:14px;padding:0;line-height:1}.devui-notification__image.devui-notification__image--warning path.devui-notification__warning-outer{fill:var(--devui-warning-line, #fa9841)}.devui-notification__image.devui-notification__image--warning path.devui-notification__warning-inner{fill:var(--devui-light-text, #ffffff);stroke:var(--devui-light-text, #ffffff)}.devui-notification__image.devui-notification__image--info{background-color:var(--devui-info, #5e7ce0)}.devui-notification__image.devui-notification__image--error{background-color:var(--devui-danger, #f66f6a)}.devui-notification__image.devui-notification__image--success{background-color:var(--devui-success, #50d4ab)}.devui-notification__image .devui-notification__image-info-path,.devui-notification__image .devui-notification__image-error-path,.devui-notification__image .devui-notification__image-success-path{fill:var(--devui-light-text, #ffffff)}.devui-notification__message{margin-left:20px}.devui-notification__message .devui-notification__content{font-size:var(--devui-font-size, 14px);margin-top:4px}.devui-notification-message-common .devui-notification__message{margin-left:0}.devui-notification__message p{font-size:var(--devui-font-size, 14px);margin-top:4px}.notification-fade-enter-active,.notification-fade-leave-active{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95))}.notification-fade-enter-from,.notification-fade-leave-to{transform:translate(100%)}
|
package/nuxt/components/Icon.js
CHANGED