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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Pe=Object.defineProperty;var re=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var O=(p,t,m)=>t in p?Pe(p,t,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[t]=m,E=(p,t)=>{for(var m in t||(t={}))Oe.call(t,m)&&O(p,m,t[m]);if(re)for(var m of re(t))je.call(t,m)&&O(p,m,t[m]);return p};var C=(p,t,m)=>(O(p,typeof t!="symbol"?t+"":t,m),m);(function(p,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(p=typeof globalThis!="undefined"?globalThis:p||self,t(p.index={},p.Vue,p.dom))})(this,function(p,t,m){"use strict";const se={modelValue:{type:String,default:""},source:{type:Array,default:null},allowEmptyValueSearch:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},appendToBodyDirections:{type:Object,default:()=>({originX:"left",originY:"bottom",overlayX:"left",overlayY:"top"})},disabled:{type:Boolean,default:!1},delay:{type:Number,default:300},disabledKey:{type:String,default:null},formatter:{type:Function,default:e=>e?e.label||e.toString():""},isSearching:{type:Boolean,default:!1},sceneType:{type:String,default:null},searchFn:{type:Function,default:null},tipsText:{type:String,default:"\u6700\u8FD1\u8F93\u5165"},latestSource:{type:Array,default:null},valueParser:{type:Function,default:e=>e},enableLazyLoad:{type:Boolean,default:!1},dAutoCompleteWidth:{type:Number,default:null},showAnimation:{type:Boolean,default:!0},maxHeight:{type:Number,default:300},transInputFocusEmit:{type:Function,default:null},selectValue:{type:Function,default:null},loadMore:{type:Function,default:null}},j=Symbol("DropdownPropsKey");function ie(e,n){const o=(r,d)=>{const i={item:r,index:d};return e.slots.itemTemplate?e.slots.itemTemplate(i):null},l=()=>e.slots.noResultItemTemplate?e.slots.noResultItemTemplate(n.value):null,s=()=>e.slots.searchingTemplate?e.slots.searchingTemplate(n.value):null;return{customRenderSolts:()=>{const r={};return e.slots.itemTemplate&&(r.itemTemplate=o),e.slots.noResultItemTemplate&&(r.noResultItemTemplate=l),e.slots.searchingTemplate&&(r.searchingTemplate=s),r}}}function ue(e,n,o,l,s){const a=t.ref([]),r=t.ref(!1);return{handleSearch:async(u,c)=>{if(u==""&&!n.value){a.value=[],r.value=!1;return}let v=[];u=u.toLowerCase(),c?v=o.value:l.value?v=await l.value(u):o.value.forEach(f=>{let y=s.value(f);y=y.toLowerCase(),y.startsWith(u)&&v.push(f)}),a.value=v,a.value.length==0?r.value=!0:r.value=!1},recentlyFocus:u=>{u&&(a.value=u)},searchList:a,showNoResultItemTemplate:r}}function de(e,n,o,l,s,a,r,d,i,u){const c=t.ref(!1),v=t.ref(),f=t.ref(!1),h=((S,D)=>{let g;return(...b)=>{g&&clearTimeout(g),g=setTimeout(async()=>{f.value=!0,await S(...b),f.value=!1},D)}})(async S=>{await r(S),c.value=!0},a.value),T=S=>{const D=S.target;f.value=!1,o.value=!1,e.emit("update:modelValue",D.value),h(D.value)},A=()=>{r(l.value),i(u.value),d.value&&d.value()},V=()=>{c.value=!1,f.value=!1,o.value=!1};return{handleClose:V,toggleMenu:()=>{s.value||(c.value?V():(c.value=!0,e.slots.noResultItemTemplate&&n.value.length==0&&l.value.trim()!=""&&(o.value=!0)))},onInput:T,onFocus:A,inputRef:v,visible:c,searchStatus:f}}function ce(e,n,o,l,s,a){const r=t.ref(0),d=u=>{if(n.value.length==0)return 0;const c=n.value.indexOf(u);return c==-1?0:c};return{selectedIndex:r,selectOptionClick:async u=>{const c=s.value(u);e.emit("update:modelValue",c),a(),await l(c),r.value=d(c),o.value&&o.value()}}}function fe(e,n,o){const l=t.ref(!1),s=t.ref(),a=()=>{if(!e.enableLazyLoad&&l)return;const d=s.value,i=d.scrollHeight,u=d.clientHeight+d.scrollTop;u>=i&&u>=e.maxHeight&&(e.loadMore(),l.value=!0)};n.expose({loadFinish:r});async function r(){await o(e.modelValue,e.enableLazyLoad),l.value=!1}return{showLoading:l,dropDownRef:s,loadMore:a}}function pe(e,n,o,l,s,a,r,d){var v;const i=t.ref((v=l.value)!=null?v:0),u=f=>{const y=e.value,w=y.children[f];t.nextTick(()=>{if(w.scrollIntoViewIfNeeded)w.scrollIntoViewIfNeeded(!1);else{const h=y.getBoundingClientRect(),T=w.getBoundingClientRect();(T.bottom>h.bottom||T.top<h.top)&&w.scrollIntoView(!1)}})};return{hoverIndex:i,handlekeyDown:f=>{var h;const y=f.key||f.code;if(y==="Escape"&&(n.value&&o.value.length||s.value||a.value)){d();return}const w=n.value&&o.value.length&&!s.value&&!a.value;if(y==="ArrowDown"&&w){if(i.value===o.value.length-1){i.value=0,u(i.value);return}i.value=i.value+1,u(i.value)}else if(y==="ArrowUp"&&w){if(i.value===0){i.value=o.value.length-1,u(i.value);return}i.value=i.value-1,u(i.value)}if(y==="Enter"&&w){r(o.value[i.value]),i.value=(h=l.value)!=null?h:0;return}}}}var ze="";class M{constructor(){C(this,"top","50%");C(this,"left","50%")}}const ve={message:String,backdrop:Boolean,view:{type:Object,default:()=>new M},zIndex:Number,isFull:{type:Boolean,default:!1}};class me{constructor(){C(this,"target");C(this,"message");C(this,"loadingTemplateRef");C(this,"backdrop",!0);C(this,"positionType","relative");C(this,"view",new M);C(this,"zIndex")}}var _e="",ye=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:ve,setup(e){const n={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(n.background="none");const o=t.ref(!1);return{style:n,isShow:o,open:()=>{o.value=!0},close:()=>{o.value=!1}}},render(){var r;const{isShow:e,isFull:n,backdrop:o,style:l,message:s,$slots:a}=this;return e&&t.createVNode("div",{class:["devui-loading-contanier",n?"devui-loading--full":""]},[((r=a.default)==null?void 0:r.call(a))||t.createVNode("div",{class:"devui-loading-wrapper"},[o?t.createVNode("div",{class:"devui-loading-mask"},null):null,t.createVNode("div",{style:l,class:"devui-loading-area"},[t.createVNode("div",{class:"devui-busy-default-spinner"},[t.createVNode("div",{class:"devui-loading-bar1"},null),t.createVNode("div",{class:"devui-loading-bar2"},null),t.createVNode("div",{class:"devui-loading-bar3"},null),t.createVNode("div",{class:"devui-loading-bar4"},null)]),s?t.createVNode("span",{class:"devui-loading-text"},[s]):null])])])}});const H=Symbol("dev_component_container");function ge(e,n,o=null){const l=t.h(e,E({},n),o),s=document.createElement("div");return l[H]=s,t.render(l,s),l.component}function we(e){t.render(null,e==null?void 0:e.vnode[H])}const he=t.defineComponent(ye),F=new WeakSet,R=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},z=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),be=e=>{switch(z(e)){case"promise":return[e];case"array":return e.some(o=>z(o)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},_=e=>{F.delete(e),e.instance.proxy.close(),we(e.instance)},K=(e,n)=>{if(n.value){const o=be(n.value);if(o==="error")return;e.instance.proxy.open(),e.appendChild(e.mask),F.add(e),o&&Promise.all(o).catch(l=>{console.error(new Error("Promise handling errors"),l)}).finally(()=>{_(e)})}else _(e)},$=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},W=(e,n)=>{const o=E(E({},new me),n),l=o.loadingTemplateRef,s=ge(he,E({},o),l?()=>l:null);e.style.position=o.positionType,e.options=o,e.instance=s,e.mask=s.proxy.$el},Te={mounted:function(e,n,o){W(e,o.props),$(e),!R(n.value)&&K(e,n)},updated:function(e,n,o){!R(n.value)&&F.has(e)||R(n.value)&&!F.has(e)||(!F.has(e)&&W(e,o.props),$(e),K(e,n))}};var Y=t.defineComponent({name:"DAutoCompleteDropdown",directives:{dLoading:Te},setup(e,n){const o=t.inject(j),{visible:l,selectedIndex:s,selectOptionClick:a,searchList:r,searchStatus:d,dropDownRef:i,loadMore:u,showLoading:c,showNoResultItemTemplate:v,latestSource:f,modelValue:y,hoverIndex:w}=o,{disabled:h,maxHeight:T,appendToBody:A,formatter:V,disabledKey:k,isSearching:S}=o.props,D=g=>{g[k]||a(g)};return()=>t.withDirectives(t.createVNode("div",{class:["devui-dropdown-menu",A&&"devui-dropdown-menu-cdk",h&&"disabled",f.value&&"devui-dropdown-latestSource"]},[t.createVNode("ul",{ref:i,class:"devui-list-unstyled scroll-height",style:{maxHeight:`${T}px`},onScroll:u},[S&&n.slots.searchingTemplate&&d.value&&t.createVNode("li",{class:"devui-is-searching-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[n.slots.searchingTemplate()])]),f.value&&!y.value&&t.createVNode("li",{class:"devui-popup-tips"},[t.createTextVNode("\u6700\u8FD1\u8F93\u5165")]),!v.value&&!d.value&&r!=null&&r.value.length>0&&r.value.map((g,b)=>t.createVNode("li",{onClick:()=>D(g),class:["devui-dropdown-item",s.value==b&&"selected",{disabled:k&&g[k]},{"devui-dropdown-bg":w.value==b}],title:V(g),key:V(g)},[n.slots.itemTemplate?n.slots.itemTemplate(g,b):V(g)])),!d.value&&r.value.length==0&&n.slots.noResultItemTemplate&&v.value&&t.createVNode("li",{class:"devui-no-result-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[n.slots.noResultItemTemplate()])])])]),[[t.resolveDirective("dLoading"),c.value],[t.vShow,l.value&&r.value.length>0||n.slots.noResultItemTemplate&&v.value||S&&n.slots.searchingTemplate&&d.value]])}});const Ve=typeof window!="undefined";function q(e,n,o){document.addEventListener?e&&n&&o&&e.addEventListener(n,o,!1):e&&n&&o&&e.attachEvent("on"+n,o)}const N=Symbol("@@clickoutside"),x=new Map;let U,B=0,X=!0;function G(e,n,o){return Ve&&X&&(X=!1,q(document,"mousedown",l=>{U=l}),q(document,"mouseup",l=>{for(const[s,a]of x)a[N].documentHandler(l,U)})),function(l,s){!o||!n.instance||!l.target||!s.target||e.contains(l.target)||e.contains(s.target)||e===l.target||e[N].bindingFn&&e[N].bindingFn()}}const Se={beforeMount:function(e,n,o){B++,x.set(B,e),e[N]={nid:B,documentHandler:G(e,n,o),bindingFn:n.value}},updated:function(e,n,o){e[N].documentHandler=G(e,n,o),e[N].bindingFn=n.value},unmounted:function(e){x.delete(e[N].nid),delete e[N]}},Ce={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 J(e){const n=/(auto|scroll|hidden)/;for(let o=e;o=o.parentElement;o.parentElement!==document.body){const l=window.getComputedStyle(o);if(n.test(l.overflow+l.overflowX+l.overflowY))return o}return window}function Ne(e,n,o,l){let{x:s,y:a}=n;if(!e){const{width:r,height:d}=l;s&&o.includes("start")&&(s=12),s&&o.includes("end")&&(s=Math.round(r-24)),a&&o.includes("start")&&(a=10),a&&o.includes("end")&&(a=d-14)}return{x:s,y:a}}function Ae(e,n){const o=t.ref(),l=t.ref(),s=(r,d,i,u)=>{const{x:c,y:v}=Ne(e.isArrowCenter,i,d,u.getBoundingClientRect()),f={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];Object.assign(r.style,{left:c?`${c}px`:"",top:v?`${v}px`:"",right:"",bottom:"",[f]:"-4px"})},a=async()=>{const r=e.origin,d=t.unref(o.value),i=t.unref(l.value),u=[m.offset(e.offset),m.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&u.push(m.arrow({element:i}));const{x:c,y:v,placement:f,middlewareData:y}=await m.computePosition(r,d,{strategy:"fixed",middleware:u});n("positionChange",f),Object.assign(d.style,{top:`${v}px`,left:`${c}px`}),e.showArrow&&s(i,f,y.arrow,d)};return t.watch(()=>e.modelValue,()=>{const r=J(e.origin);e.modelValue&&e.origin?(t.nextTick(a),r.addEventListener("scroll",a),r!==window&&window.addEventListener("scroll",a),window.addEventListener("resize",a)):(r.removeEventListener("scroll",a),r!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a))}),t.onUnmounted(()=>{const r=J(e.origin);r.removeEventListener("scroll",a),r!==window&&window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}),{arrowRef:l,overlayRef:o}}var Ke="";const De=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:Ce,emits:["update:modelValue","positionChange"],setup(e,{slots:n,attrs:o,emit:l}){const{arrowRef:s,overlayRef:a}=Ae(e,l);return()=>{var r;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:a,class:"devui-flexible-overlay"},o),[(r=n.default)==null?void 0:r.call(n),e.showArrow&&t.createVNode("div",{ref:s,class:"devui-flexible-overlay-arrow"},null)])}}});function Q(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}var L=t.defineComponent({name:"DAutoComplete",directives:{ClickOutside:Se},props:se,emits:["update:modelValue"],setup(e,n){const{disabled:o,modelValue:l,appendToBody:s,dAutoCompleteWidth:a,delay:r,allowEmptyValueSearch:d,formatter:i,transInputFocusEmit:u,selectValue:c,source:v,searchFn:f,appendToBodyDirections:y,latestSource:w,showAnimation:h}=t.toRefs(e),{handleSearch:T,searchList:A,showNoResultItemTemplate:V,recentlyFocus:k}=ue(n,d,v,f,i),{onInput:S,onFocus:D,inputRef:g,visible:b,searchStatus:Z,handleClose:P,toggleMenu:ke}=de(n,A,V,l,o,r,T,u,k,w),{selectedIndex:ee,selectOptionClick:te}=ce(n,A,c,T,i,P),{showLoading:Fe,dropDownRef:oe,loadMore:Le}=fe(e,n,T),{customRenderSolts:ne}=ie(n,l),{hoverIndex:Ee,handlekeyDown:Re}=pe(oe,b,A,ee,Z,V,te,P);t.provide(j,{props:e,visible:b,term:"",searchList:A,selectedIndex:ee,searchStatus:Z,selectOptionClick:te,dropDownRef:oe,showLoading:Fe,loadMore:Le,latestSource:w,modelValue:l,showNoResultItemTemplate:V,hoverIndex:Ee});const le=t.ref(),ae=t.reactive({appendToBodyDirections:{}});ae.appendToBodyDirections=y;const xe=()=>{if(s.value){let I;return t.createVNode(De,{hasBackdrop:!1,origin:le,position:ae.appendToBodyDirections,visible:b.value,"onUpdate:visible":Be=>b.value=Be},{default:()=>[t.createVNode("div",{class:"devui-dropdown devui-auto-complete-menu",style:{width:a.value>0&&a.value+"px"}},[t.createVNode(Y,null,Q(I=ne())?I:{default:()=>[I]})])]})}else{let I;return t.createVNode("div",{class:"devui-dropdown",style:{width:a.value>0&&a.value+"px"}},[t.createVNode(t.Transition,{name:h?"fade":""},{default:()=>[t.createVNode(Y,null,Q(I=ne())?I:{default:()=>[I]})]})])}};return()=>t.withDirectives(t.createVNode("div",{class:["devui-auto-complete","devui-form-group","devui-has-feedback",b.value&&"devui-select-open"],ref:le,style:{width:a.value>0&&a.value+"px"}},[t.createVNode("input",{disabled:o.value,type:"text",onClick:ke,class:["devui-form-control","devui-dropdown-origin","devui-dropdown-origin-open",o.value&&"disabled"],placeholder:"Search",onInput:S,onFocus:D,value:l.value,ref:g,onKeydown:Re},null),xe()]),[[t.resolveDirective("click-outside"),P]])}});L.install=function(e){e.component(L.name,L)};var Ie={title:"AutoComplete \u81EA\u52A8\u8865\u5168",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.use(L)}};p.AutoComplete=L,p.default=Ie,Object.defineProperty(p,"__esModule",{value:!0}),p[Symbol.toStringTag]="Module"});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.devui-auto-complete .devui-dropdown-menu,.devui-auto-complete-menu .devui-dropdown-menu{left:0!important;top:0!important}.devui-auto-complete .active{background:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-auto-complete .devui-dropdown-menu{width:100%;display:block}.devui-auto-complete .devui-dropdown-menu-cdk{position:static}.devui-auto-complete .devui-dropdown-item{cursor:pointer;display:block;width:100%;padding:8px 12px;clear:both;border:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:14px}.devui-auto-complete .devui-dropdown-menu .devui-dropdown-item:not(.disabled).selected{color:var(--devui-list-item-active-text, #ffffff);background-color:var(--devui-list-item-active-bg, #5e7ce0)}.devui-auto-complete .devui-no-result-template,.devui-auto-complete .devui-is-searching-template{display:block;width:100%;padding:8px 12px;clear:both;border:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:not-allowed;background-color:var(--devui-disabled-bg, #f5f5f6);color:var(--devui-disabled-text, #adb0b8);line-height:14px}.devui-auto-complete .devui-no-result-template:hover,.devui-auto-complete .devui-no-result-template:active,.devui-auto-complete .devui-no-result-template:hover:active,.devui-auto-complete .devui-is-searching-template:hover,.devui-auto-complete .devui-is-searching-template:active,.devui-auto-complete .devui-is-searching-template:hover:active{background-color:var(--devui-unavailable, #f5f5f6)}.devui-auto-complete .devui-dropdown-item.disabled,.devui-auto-complete .devui-dropdown-item.disabled:hover{cursor:not-allowed;color:var(--devui-disabled-text, #adb0b8)}.devui-auto-complete ul.devui-list-unstyled{margin:0;overflow-y:auto}.devui-auto-complete .devui-dropdown-bg{background:var(--devui-list-item-hover-bg, #f2f5fc);color:var(--devui-list-item-hover-text, #526ecc)}.devui-auto-complete .devui-popup-tips{color:var(--devui-text-weak, #575d6c);padding:4px 12px}.devui-auto-complete .devui-dropdown-latestSource ul{line-height:initial!important}@keyframes devui-busy-spinner-anim{0%{transform:rotate(0) scale(1)}50%{transform:rotate(135deg) scale(1.5)}to{transform:rotate(270deg) scale(1)}}.devui-loading-mask{position:absolute;left:0;right:0;bottom:0;top:0;background-color:var(--devui-line, #adb0b8);opacity:.3}.devui-loading-wrapper{text-align:center}.devui-loading--full{position:fixed;left:0;right:0;bottom:0;top:0;z-index:9999}.devui-loading--hidden{overflow:hidden}.devui-loading-text{margin-left:10px}.devui-loading-area{position:absolute;transform:translate(-50%,-50%);padding:12px 14px;background:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px)}.devui-busy-default-spinner{position:relative;display:inline-block;width:15px;height:15px;animation:devui-busy-spinner-anim 1s linear infinite}.devui-busy-default-spinner div{position:absolute;left:44.5%;top:37%;width:6px;height:6px;border-radius:50%}.devui-busy-default-spinner .devui-loading-bar1{top:0;left:0;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-busy-default-spinner .devui-loading-bar2{top:0;left:9px;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-busy-default-spinner .devui-loading-bar3{top:9px;left:0;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-busy-default-spinner .devui-loading-bar4{top:9px;left:9px;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.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}
|
package/back-top/index.es.js
CHANGED
|
@@ -94,7 +94,7 @@ var BackTop = defineComponent({
|
|
|
94
94
|
const slots = ctx.slots;
|
|
95
95
|
const backTopRef = ref(null);
|
|
96
96
|
const position = usePosition(props);
|
|
97
|
-
|
|
97
|
+
const isVisible = useVisibility(props, backTopRef);
|
|
98
98
|
const scrollToTop = () => {
|
|
99
99
|
window && window.scrollTo({
|
|
100
100
|
top: 0,
|
package/back-top/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var m=Object.defineProperty,w=Object.defineProperties;var f=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var g=(e,t,o)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,r=(e,t)=>{for(var o in t||(t={}))y.call(t,o)&&g(e,o,t[o]);if(N)for(var o of N(t))A.call(t,o)&&g(e,o,t[o]);return e},a=(e,t)=>w(e,f(t));(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){"use strict";const o={bottom:{type:String,default:"50px"},right:{type:String,default:"30px"},target:{type:String,default:"window"},visibleHeight:{type:Number,default:300}};function d(M){const{bottom:n,right:i}=M;return{bottom:n,right:i}}function j(M,n){const i=M.target;return i==="window"?window||document.documentElement||document.body:(()=>{const u=document.querySelector(i);if(!u)throw new Error(`props ${i} is not existed`);return u.parentElement.style.position="relative",n.value.style.position="absolute",u})()}function I(M,n){const i=M.visibleHeight,c=t.ref(0),
|
|
1
|
+
var m=Object.defineProperty,w=Object.defineProperties;var f=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var g=(e,t,o)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,r=(e,t)=>{for(var o in t||(t={}))y.call(t,o)&&g(e,o,t[o]);if(N)for(var o of N(t))A.call(t,o)&&g(e,o,t[o]);return e},a=(e,t)=>w(e,f(t));(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){"use strict";const o={bottom:{type:String,default:"50px"},right:{type:String,default:"30px"},target:{type:String,default:"window"},visibleHeight:{type:Number,default:300}};function d(M){const{bottom:n,right:i}=M;return{bottom:n,right:i}}function j(M,n){const i=M.target;return i==="window"?window||document.documentElement||document.body:(()=>{const u=document.querySelector(i);if(!u)throw new Error(`props ${i} is not existed`);return u.parentElement.style.position="relative",n.value.style.position="absolute",u})()}function I(M,n){const i=M.visibleHeight,c=t.ref(0),s=function(){c.value=u===window?window.pageYOffset:u.scrollTop};let u=null;return t.onMounted(()=>{u=j(M,n),D(u,"scroll",T(s,150))}),t.computed(()=>c.value>=i)}function D(M,n,i){M&&M.addEventListener(n,i)}function T(M,n){let i=null;return(...c)=>{const s=+Date.now();if(s-i>n)return i=s,M.apply(this,c)}}var b="",p="data:image/svg+xml;base64,PHN2ZyB0PSIxNjM2MjU2NTI0MjUxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM0NTciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTAgMGgxMDI0djEwMjRIMHoiIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMCIgcC1pZD0iMzQ1OCI+PC9wYXRoPjxwYXRoIGQ9Ik04NzguOTMzMzMzIDY1OC40MTA2NjdhNDEuNjg1MzMzIDQxLjY4NTMzMyAwIDAgMS01OC45NDQgMC4zMmwtMzA3Ljk2OC0zMDQuNjRMMjA0LjAxMDY2NyA2NTguNzczMzMzYTQxLjY4NTMzMyA0MS42ODUzMzMgMCAwIDEtNTguNTYgMC4wNjQgNDAuNjE4NjY3IDQwLjYxODY2NyAwIDAgMS0wLjA2NC01Ny44MTMzMzNsMzM1LjQyNC0zMzEuNzMzMzMzYTQxLjU3ODY2NyA0MS41Nzg2NjcgMCAwIDEgMzEuMDQtMTIuMDEwNjY3IDQxLjQ5MzMzMyA0MS40OTMzMzMgMCAwIDEgMzEuMzYgMTEuOTg5MzMzbDMzNS40MDI2NjYgMzMxLjczMzMzNGMxNS45MzYgMTUuNzg2NjY3IDE2LjA4NTMzMyA0MS40OTMzMzMgMC4zMiA1Ny40MjkzMzN6IiBmaWxsPSIjZmZmZmZmIiBwLWlkPSIzNDU5Ij48L3BhdGg+PHBhdGggZD0iTTU1NC42NjY2NjcgMzYyLjY2NjY2N3Y1MzMuMzMzMzMzYTQyLjY2NjY2NyA0Mi42NjY2NjcgMCAxIDEtODUuMzMzMzM0IDBWMzYyLjY2NjY2N2E0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDg1LjMzMzMzNCAwek0xMjggODUuMzMzMzMzaDc2OGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAgODUuMzMzMzM0SDEyOGE0Mi42NjY2NjcgNDIuNjY2NjY3IDAgMSAxIDAtODUuMzMzMzM0eiIgZmlsbD0iI2ZmZmZmZiIgcC1pZD0iMzQ2MCI+PC9wYXRoPjwvc3ZnPg==",l=t.defineComponent({name:"DBackTop",props:o,emits:[],setup(M,n){const i=n.slots,c=t.ref(null),s=d(M),u=I(M,c),z=()=>{window&&window.scrollTo({top:0,left:0,behavior:"smooth"})};return()=>t.createVNode("div",{class:"devui-back-top",ref:c,style:a(r({},s),{display:u.value?"block":"none"}),onClick:z},[t.createVNode("div",{class:["devui-back-top-base",i.default?"devui-backtop-custom":"devui-back-top-content"]},[i.default?i.default():t.createVNode(p,null,null)])])}});l.install=function(M){M.component(l.name,l)};var Y={title:"BackTop \u56DE\u5230\u9876\u90E8",category:"\u5BFC\u822A",status:"60%",install(M){M.use(l)}};e.BackTop=l,e.default=Y,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
|
package/badge/index.es.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode } from "vue";
|
|
2
|
-
var badge = "";
|
|
3
2
|
const badgeStatusType = ["danger", "warning", "waiting", "success", "info"];
|
|
4
3
|
const badgePositionType = ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
5
4
|
const badgeProps = {
|
|
@@ -18,12 +17,12 @@ const badgeProps = {
|
|
|
18
17
|
type: String,
|
|
19
18
|
validator: (val) => badgeStatusType.includes(val)
|
|
20
19
|
},
|
|
21
|
-
|
|
20
|
+
position: {
|
|
22
21
|
type: String,
|
|
23
22
|
default: "top-right",
|
|
24
23
|
validator: (val) => badgePositionType.includes(val)
|
|
25
24
|
},
|
|
26
|
-
|
|
25
|
+
offset: {
|
|
27
26
|
type: Array
|
|
28
27
|
},
|
|
29
28
|
bgColor: {
|
|
@@ -33,29 +32,27 @@ const badgeProps = {
|
|
|
33
32
|
type: String
|
|
34
33
|
}
|
|
35
34
|
};
|
|
35
|
+
var badge = "";
|
|
36
36
|
var Badge = defineComponent({
|
|
37
37
|
name: "DBadge",
|
|
38
38
|
props: badgeProps,
|
|
39
|
-
emits: [],
|
|
40
39
|
setup(props, ctx) {
|
|
41
40
|
const className = computed(() => {
|
|
42
41
|
const base = "devui-badge-content";
|
|
43
|
-
return [base, props.showDot ? `${base}-dot` : `${base}-count`, props.status && `${base}-${props.status}`, ctx.slots.default && props.
|
|
42
|
+
return [base, props.showDot ? `${base}-dot` : `${base}-count`, props.status && `${base}-${props.status}`, ctx.slots.default && props.position && `${base}-${props.position}`, ctx.slots.default && `${base}-fixed`].join(" ");
|
|
44
43
|
});
|
|
45
44
|
const style = computed(() => {
|
|
46
45
|
const styleMap = {
|
|
47
46
|
bgColor: "background",
|
|
48
47
|
textColor: "color"
|
|
49
48
|
};
|
|
50
|
-
const ret = Object.keys(styleMap).reduce((
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
return ret2;
|
|
49
|
+
const ret = Object.keys(styleMap).reduce((result, key) => {
|
|
50
|
+
props[key] && (result[styleMap[key]] = props[key]);
|
|
51
|
+
return result;
|
|
55
52
|
}, {});
|
|
56
|
-
if (ctx.slots.default && props.
|
|
57
|
-
const [x, y] = props.
|
|
58
|
-
const [yName, xName] = props.
|
|
53
|
+
if (ctx.slots.default && props.offset) {
|
|
54
|
+
const [x, y] = props.offset;
|
|
55
|
+
const [yName, xName] = props.position.split("-");
|
|
59
56
|
ret[yName] = y + "px";
|
|
60
57
|
ret[xName] = x + "px";
|
|
61
58
|
}
|
|
@@ -81,15 +78,12 @@ var Badge = defineComponent({
|
|
|
81
78
|
};
|
|
82
79
|
}
|
|
83
80
|
});
|
|
84
|
-
Badge.install = function(app) {
|
|
85
|
-
app.component(Badge.name, Badge);
|
|
86
|
-
};
|
|
87
81
|
var index = {
|
|
88
82
|
title: "Badge \u5FBD\u6807",
|
|
89
83
|
category: "\u6570\u636E\u5C55\u793A",
|
|
90
84
|
status: "100%",
|
|
91
85
|
install(app) {
|
|
92
|
-
app.
|
|
86
|
+
app.component(Badge.name, Badge);
|
|
93
87
|
}
|
|
94
88
|
};
|
|
95
|
-
export { Badge, index as default };
|
|
89
|
+
export { Badge, badgeProps, index as default };
|
package/badge/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o
|
|
1
|
+
(function(n,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(n=typeof globalThis!="undefined"?globalThis:n||self,o(n.index={},n.Vue))})(this,function(n,o){"use strict";const c=["danger","warning","waiting","success","info"],f=["top-left","top-right","bottom-left","bottom-right"],l={count:{type:[Number,String]},maxCount:{type:Number,default:99},showDot:{type:Boolean,default:!1},status:{type:String,validator:t=>c.includes(t)},position:{type:String,default:"top-right",validator:t=>f.includes(t)},offset:{type:Array},bgColor:{type:String},textColor:{type:String}};var x="",s=o.defineComponent({name:"DBadge",props:l,setup(t,i){const g=o.computed(()=>{const e="devui-badge-content";return[e,t.showDot?`${e}-dot`:`${e}-count`,t.status&&`${e}-${t.status}`,i.slots.default&&t.position&&`${e}-${t.position}`,i.slots.default&&`${e}-fixed`].join(" ")}),m=o.computed(()=>{const e={bgColor:"background",textColor:"color"},u=Object.keys(e).reduce((d,a)=>(t[a]&&(d[e[a]]=t[a]),d),{});if(i.slots.default&&t.offset){const[d,a]=t.offset,[b,v]=t.position.split("-");u[b]=a+"px",u[v]=d+"px"}return u}),y=o.computed(()=>{if(!t.showDot)return typeof t.count=="number"&&typeof t.maxCount=="number"&&t.count>t.maxCount?`${t.maxCount}+`:t.count});return()=>{var e,u;return o.createVNode("div",{class:"devui-badge"},[(u=(e=i.slots).default)==null?void 0:u.call(e),o.createVNode("div",{class:g.value,style:m.value},[y.value])])}}}),r={title:"Badge \u5FBD\u6807",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(s.name,s)}};n.Badge=s,n.badgeProps=l,n.default=r,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
|
package/button/index.es.js
CHANGED
|
@@ -14,7 +14,11 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
var __publicField = (obj, key, value) => {
|
|
18
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
import { defineComponent, createVNode, ref, h, render, computed, toRefs, withDirectives, resolveDirective } from "vue";
|
|
18
22
|
var Icon = defineComponent({
|
|
19
23
|
name: "DIcon",
|
|
20
24
|
props: {
|
|
@@ -49,7 +53,8 @@ var Icon = defineComponent({
|
|
|
49
53
|
"src": name,
|
|
50
54
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
51
55
|
"style": {
|
|
52
|
-
width: size
|
|
56
|
+
width: size,
|
|
57
|
+
verticalAlign: "text-bottom"
|
|
53
58
|
}
|
|
54
59
|
}, null) : createVNode("i", {
|
|
55
60
|
"class": `${classPrefix} ${classPrefix}-${name}`,
|
|
@@ -63,127 +68,302 @@ var Icon = defineComponent({
|
|
|
63
68
|
Icon.install = function(app) {
|
|
64
69
|
app.component(Icon.name, Icon);
|
|
65
70
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
class View {
|
|
72
|
+
constructor() {
|
|
73
|
+
__publicField(this, "top", "50%");
|
|
74
|
+
__publicField(this, "left", "50%");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const componentProps = {
|
|
78
|
+
message: String,
|
|
79
|
+
backdrop: Boolean,
|
|
80
|
+
view: {
|
|
81
|
+
type: Object,
|
|
82
|
+
default: () => new View()
|
|
83
|
+
},
|
|
84
|
+
zIndex: Number,
|
|
85
|
+
isFull: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
class LoadingProps {
|
|
91
|
+
constructor() {
|
|
92
|
+
__publicField(this, "target");
|
|
93
|
+
__publicField(this, "message");
|
|
94
|
+
__publicField(this, "loadingTemplateRef");
|
|
95
|
+
__publicField(this, "backdrop", true);
|
|
96
|
+
__publicField(this, "positionType", "relative");
|
|
97
|
+
__publicField(this, "view", new View());
|
|
98
|
+
__publicField(this, "zIndex");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
var loading = "";
|
|
102
|
+
var Loading = defineComponent({
|
|
103
|
+
name: "DLoading",
|
|
104
|
+
inheritAttrs: false,
|
|
105
|
+
props: componentProps,
|
|
106
|
+
setup(props) {
|
|
107
|
+
const style = {
|
|
108
|
+
top: props.view.top,
|
|
109
|
+
left: props.view.left,
|
|
110
|
+
zIndex: props.zIndex
|
|
111
|
+
};
|
|
112
|
+
if (!props.message) {
|
|
113
|
+
style.background = "none";
|
|
114
|
+
}
|
|
115
|
+
const isShow = ref(false);
|
|
116
|
+
const open = () => {
|
|
117
|
+
isShow.value = true;
|
|
118
|
+
};
|
|
119
|
+
const close = () => {
|
|
120
|
+
isShow.value = false;
|
|
121
|
+
};
|
|
122
|
+
return {
|
|
123
|
+
style,
|
|
124
|
+
isShow,
|
|
125
|
+
open,
|
|
126
|
+
close
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
render() {
|
|
130
|
+
var _a;
|
|
131
|
+
const {
|
|
132
|
+
isShow,
|
|
133
|
+
isFull,
|
|
134
|
+
backdrop,
|
|
135
|
+
style,
|
|
136
|
+
message,
|
|
137
|
+
$slots
|
|
138
|
+
} = this;
|
|
139
|
+
return isShow && createVNode("div", {
|
|
140
|
+
"class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
|
|
141
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
142
|
+
"class": "devui-loading-wrapper"
|
|
143
|
+
}, [backdrop ? createVNode("div", {
|
|
144
|
+
"class": "devui-loading-mask"
|
|
145
|
+
}, null) : null, createVNode("div", {
|
|
146
|
+
"style": style,
|
|
147
|
+
"class": "devui-loading-area"
|
|
148
|
+
}, [createVNode("div", {
|
|
149
|
+
"class": "devui-busy-default-spinner"
|
|
150
|
+
}, [createVNode("div", {
|
|
151
|
+
"class": "devui-loading-bar1"
|
|
152
|
+
}, null), createVNode("div", {
|
|
153
|
+
"class": "devui-loading-bar2"
|
|
154
|
+
}, null), createVNode("div", {
|
|
155
|
+
"class": "devui-loading-bar3"
|
|
156
|
+
}, null), createVNode("div", {
|
|
157
|
+
"class": "devui-loading-bar4"
|
|
158
|
+
}, null)]), message ? createVNode("span", {
|
|
159
|
+
"class": "devui-loading-text"
|
|
160
|
+
}, [message]) : null])])]);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
164
|
+
function createComponent(Component, props, children = null) {
|
|
165
|
+
const vnode = h(Component, __spreadValues({}, props), children);
|
|
166
|
+
const container = document.createElement("div");
|
|
167
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
168
|
+
render(vnode, container);
|
|
169
|
+
return vnode.component;
|
|
170
|
+
}
|
|
171
|
+
function unmountComponent(ComponnetInstance) {
|
|
172
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
173
|
+
}
|
|
174
|
+
const loadingConstructor = defineComponent(Loading);
|
|
175
|
+
const cacheInstance = /* @__PURE__ */ new WeakSet();
|
|
176
|
+
const isEmpty = (val) => {
|
|
177
|
+
if (!val)
|
|
178
|
+
return true;
|
|
179
|
+
if (Array.isArray(val))
|
|
180
|
+
return val.length === 0;
|
|
181
|
+
if (val instanceof Set || val instanceof Map)
|
|
182
|
+
return val.size === 0;
|
|
183
|
+
if (val instanceof Promise)
|
|
184
|
+
return false;
|
|
185
|
+
if (typeof val === "object") {
|
|
186
|
+
try {
|
|
187
|
+
return Object.keys(val).length === 0;
|
|
188
|
+
} catch (e) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
};
|
|
194
|
+
const getType = (vari) => {
|
|
195
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
196
|
+
};
|
|
197
|
+
const isPromise = (value) => {
|
|
198
|
+
const type = getType(value);
|
|
199
|
+
switch (type) {
|
|
200
|
+
case "promise":
|
|
201
|
+
return [value];
|
|
202
|
+
case "array":
|
|
203
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
204
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
205
|
+
return "error";
|
|
206
|
+
}
|
|
207
|
+
return value;
|
|
208
|
+
default:
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const unmount = (el) => {
|
|
213
|
+
cacheInstance.delete(el);
|
|
214
|
+
el.instance.proxy.close();
|
|
215
|
+
unmountComponent(el.instance);
|
|
216
|
+
};
|
|
217
|
+
const toggleLoading = (el, binding) => {
|
|
218
|
+
if (binding.value) {
|
|
219
|
+
const vals = isPromise(binding.value);
|
|
220
|
+
if (vals === "error")
|
|
221
|
+
return;
|
|
222
|
+
el.instance.proxy.open();
|
|
223
|
+
el.appendChild(el.mask);
|
|
224
|
+
cacheInstance.add(el);
|
|
225
|
+
if (vals) {
|
|
226
|
+
Promise.all(vals).catch((err) => {
|
|
227
|
+
console.error(new Error("Promise handling errors"), err);
|
|
228
|
+
}).finally(() => {
|
|
229
|
+
unmount(el);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
unmount(el);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const removeAttribute = (el) => {
|
|
237
|
+
el.removeAttribute("zindex");
|
|
238
|
+
el.removeAttribute("positiontype");
|
|
239
|
+
el.removeAttribute("backdrop");
|
|
240
|
+
el.removeAttribute("message");
|
|
241
|
+
el.removeAttribute("view");
|
|
242
|
+
el.removeAttribute("loadingtemplateref");
|
|
243
|
+
};
|
|
244
|
+
const handleProps = (el, vprops) => {
|
|
245
|
+
const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
|
|
246
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
247
|
+
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
248
|
+
el.style.position = props.positionType;
|
|
249
|
+
el.options = props;
|
|
250
|
+
el.instance = loadingInstance;
|
|
251
|
+
el.mask = loadingInstance.proxy.$el;
|
|
252
|
+
};
|
|
253
|
+
const loadingDirective = {
|
|
254
|
+
mounted: function(el, binding, vnode) {
|
|
255
|
+
handleProps(el, vnode.props);
|
|
256
|
+
removeAttribute(el);
|
|
257
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
70
258
|
},
|
|
71
|
-
|
|
259
|
+
updated: function(el, binding, vnode) {
|
|
260
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
|
|
261
|
+
return;
|
|
262
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
263
|
+
removeAttribute(el);
|
|
264
|
+
toggleLoading(el, binding);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
const buttonProps = {
|
|
268
|
+
variant: {
|
|
72
269
|
type: String,
|
|
73
|
-
default: "
|
|
270
|
+
default: "outline"
|
|
74
271
|
},
|
|
75
272
|
size: {
|
|
76
273
|
type: String,
|
|
77
274
|
default: "md"
|
|
78
275
|
},
|
|
79
|
-
|
|
80
|
-
type: String
|
|
81
|
-
default: "default"
|
|
82
|
-
},
|
|
83
|
-
bordered: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: false
|
|
276
|
+
color: {
|
|
277
|
+
type: String
|
|
86
278
|
},
|
|
87
279
|
icon: {
|
|
88
280
|
type: String,
|
|
89
281
|
default: ""
|
|
90
282
|
},
|
|
91
|
-
|
|
283
|
+
loading: {
|
|
92
284
|
type: Boolean,
|
|
93
285
|
default: false
|
|
94
286
|
},
|
|
95
|
-
width: {
|
|
96
|
-
type: String
|
|
97
|
-
},
|
|
98
287
|
disabled: {
|
|
99
288
|
type: Boolean,
|
|
100
289
|
default: false
|
|
101
|
-
},
|
|
102
|
-
autofocus: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: false
|
|
105
|
-
},
|
|
106
|
-
onClick: {
|
|
107
|
-
type: Function
|
|
108
290
|
}
|
|
109
291
|
};
|
|
292
|
+
function useButton(props, ctx) {
|
|
293
|
+
const hasContent = computed(() => ctx.slots.default);
|
|
294
|
+
const colorMap = {
|
|
295
|
+
solid: "primary",
|
|
296
|
+
outline: "secondary",
|
|
297
|
+
text: "secondary"
|
|
298
|
+
};
|
|
299
|
+
const defaultColor = colorMap[props.variant];
|
|
300
|
+
const classes = computed(() => ({
|
|
301
|
+
"devui-btn": true,
|
|
302
|
+
[`devui-btn-${props.variant}`]: true,
|
|
303
|
+
[`devui-btn-${props.variant}-${props.color || defaultColor}`]: true,
|
|
304
|
+
[`devui-btn-${props.size}`]: true,
|
|
305
|
+
"devui-btn-icon-wrap": props.icon,
|
|
306
|
+
"devui-btn-icon": props.icon && !hasContent.value && props.variant !== "solid"
|
|
307
|
+
}));
|
|
308
|
+
const iconClass = computed(() => {
|
|
309
|
+
if (!props.icon) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const origin = "devui-icon-fix icon";
|
|
313
|
+
if (hasContent.value) {
|
|
314
|
+
return `${origin} clear-right-5`;
|
|
315
|
+
} else {
|
|
316
|
+
return origin;
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
return { classes, iconClass };
|
|
320
|
+
}
|
|
110
321
|
var button = "";
|
|
111
322
|
var Button = defineComponent({
|
|
112
323
|
name: "DButton",
|
|
324
|
+
directives: {
|
|
325
|
+
devLoading: loadingDirective
|
|
326
|
+
},
|
|
113
327
|
props: buttonProps,
|
|
328
|
+
emits: ["click"],
|
|
114
329
|
setup(props, ctx) {
|
|
115
|
-
const
|
|
330
|
+
const {
|
|
331
|
+
icon,
|
|
332
|
+
disabled,
|
|
333
|
+
loading: loading2
|
|
334
|
+
} = toRefs(props);
|
|
335
|
+
const {
|
|
336
|
+
classes,
|
|
337
|
+
iconClass
|
|
338
|
+
} = useButton(props, ctx);
|
|
116
339
|
const onClick = (e) => {
|
|
117
|
-
|
|
118
|
-
if (props.showLoading) {
|
|
340
|
+
if (loading2.value) {
|
|
119
341
|
return;
|
|
120
342
|
}
|
|
121
|
-
|
|
343
|
+
ctx.emit("click", e);
|
|
122
344
|
};
|
|
123
|
-
const hasContent = computed(() => ctx.slots.default);
|
|
124
|
-
const btnClass = computed(() => {
|
|
125
|
-
const {
|
|
126
|
-
btnStyle,
|
|
127
|
-
size,
|
|
128
|
-
position,
|
|
129
|
-
bordered,
|
|
130
|
-
icon
|
|
131
|
-
} = props;
|
|
132
|
-
const origin = `devui-btn devui-btn-${btnStyle} devui-btn-${size} devui-btn-${position}`;
|
|
133
|
-
const borderedClass = bordered ? "bordered" : "";
|
|
134
|
-
const btnIcon = !!icon && !hasContent.value && btnStyle !== "primary" ? "d-btn-icon" : "";
|
|
135
|
-
const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
|
|
136
|
-
return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
|
|
137
|
-
});
|
|
138
|
-
const iconClass = computed(() => {
|
|
139
|
-
if (!props.icon) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
const origin = "devui-icon-fix icon";
|
|
143
|
-
if (hasContent.value) {
|
|
144
|
-
return `${origin} clear-right-5`;
|
|
145
|
-
} else {
|
|
146
|
-
return origin;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
345
|
return () => {
|
|
150
346
|
var _a, _b;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
disabled,
|
|
155
|
-
showLoading,
|
|
156
|
-
width
|
|
157
|
-
} = props;
|
|
158
|
-
return createVNode("div", mergeProps({
|
|
159
|
-
"class": "devui-btn-host"
|
|
160
|
-
}, ctx.attrs), [createVNode("button", {
|
|
161
|
-
"class": btnClass.value,
|
|
162
|
-
"type": type,
|
|
163
|
-
"disabled": disabled,
|
|
164
|
-
"style": {
|
|
165
|
-
width
|
|
166
|
-
},
|
|
347
|
+
return withDirectives(createVNode("button", {
|
|
348
|
+
"class": classes.value,
|
|
349
|
+
"disabled": disabled.value,
|
|
167
350
|
"onClick": onClick
|
|
168
|
-
}, [
|
|
169
|
-
"name":
|
|
351
|
+
}, [icon.value && createVNode(Icon, {
|
|
352
|
+
"name": icon.value,
|
|
353
|
+
"size": "12px",
|
|
170
354
|
"class": iconClass.value
|
|
171
|
-
}, null)
|
|
172
|
-
"class": "button-content"
|
|
173
|
-
|
|
174
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]);
|
|
355
|
+
}, null), createVNode("span", {
|
|
356
|
+
"class": "button-content"
|
|
357
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("dLoading"), loading2.value]]);
|
|
175
358
|
};
|
|
176
359
|
}
|
|
177
360
|
});
|
|
178
|
-
Button.install = function(app) {
|
|
179
|
-
app.component(Button.name, Button);
|
|
180
|
-
};
|
|
181
361
|
var index = {
|
|
182
362
|
title: "Button \u6309\u94AE",
|
|
183
363
|
category: "\u901A\u7528",
|
|
184
364
|
status: "100%",
|
|
185
365
|
install(app) {
|
|
186
|
-
app.
|
|
366
|
+
app.component(Button.name, Button);
|
|
187
367
|
}
|
|
188
368
|
};
|
|
189
369
|
export { Button, buttonProps, index as default };
|
package/button/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var D=Object.defineProperty;var P=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var v=(i,t,r)=>t in i?D(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r,u=(i,t)=>{for(var r in t||(t={}))_.call(t,r)&&v(i,r,t[r]);if(P)for(var r of P(t))I.call(t,r)&&v(i,r,t[r]);return i};var l=(i,t,r)=>(v(i,typeof t!="symbol"?t+"":t,r),r);(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue))})(this,function(i,t){"use strict";var r=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 u({},e)},render(){const{name:e,size:o,color:n,classPrefix:a}=this;return/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:o,verticalAlign:"text-bottom"}},null):t.createVNode("i",{class:`${a} ${a}-${e}`,style:{fontSize:o,color:n}},null)}});r.install=function(e){e.component(r.name,r)};class b{constructor(){l(this,"top","50%");l(this,"left","50%")}}const C={message:String,backdrop:Boolean,view:{type:Object,default:()=>new b},zIndex:Number,isFull:{type:Boolean,default:!1}};class z{constructor(){l(this,"target");l(this,"message");l(this,"loadingTemplateRef");l(this,"backdrop",!0);l(this,"positionType","relative");l(this,"view",new b);l(this,"zIndex")}}var R="",T=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:C,setup(e){const o={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(o.background="none");const n=t.ref(!1);return{style:o,isShow:n,open:()=>{n.value=!0},close:()=>{n.value=!1}}},render(){var d;const{isShow:e,isFull:o,backdrop:n,style:a,message:s,$slots:c}=this;return e&&t.createVNode("div",{class:["devui-loading-contanier",o?"devui-loading--full":""]},[((d=c.default)==null?void 0:d.call(c))||t.createVNode("div",{class:"devui-loading-wrapper"},[n?t.createVNode("div",{class:"devui-loading-mask"},null):null,t.createVNode("div",{style:a,class:"devui-loading-area"},[t.createVNode("div",{class:"devui-busy-default-spinner"},[t.createVNode("div",{class:"devui-loading-bar1"},null),t.createVNode("div",{class:"devui-loading-bar2"},null),t.createVNode("div",{class:"devui-loading-bar3"},null),t.createVNode("div",{class:"devui-loading-bar4"},null)]),s?t.createVNode("span",{class:"devui-loading-text"},[s]):null])])])}});const h=Symbol("dev_component_container");function B(e,o,n=null){const a=t.h(e,u({},o),n),s=document.createElement("div");return a[h]=s,t.render(a,s),a.component}function L(e){t.render(null,e==null?void 0:e.vnode[h])}const O=t.defineComponent(T),f=new WeakSet,g=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},w=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),$=e=>{switch(w(e)){case"promise":return[e];case"array":return e.some(n=>w(n)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},N=e=>{f.delete(e),e.instance.proxy.close(),L(e.instance)},S=(e,o)=>{if(o.value){const n=$(o.value);if(n==="error")return;e.instance.proxy.open(),e.appendChild(e.mask),f.add(e),n&&Promise.all(n).catch(a=>{console.error(new Error("Promise handling errors"),a)}).finally(()=>{N(e)})}else N(e)},V=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},k=(e,o)=>{const n=u(u({},new z),o),a=n.loadingTemplateRef,s=B(O,u({},n),a?()=>a:null);e.style.position=n.positionType,e.options=n,e.instance=s,e.mask=s.proxy.$el},E={mounted:function(e,o,n){k(e,n.props),V(e),!g(o.value)&&S(e,o)},updated:function(e,o,n){!g(o.value)&&f.has(e)||g(o.value)&&!f.has(e)||(!f.has(e)&&k(e,n.props),V(e),S(e,o))}},x={variant:{type:String,default:"outline"},size:{type:String,default:"md"},color:{type:String},icon:{type:String,default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}};function M(e,o){const n=t.computed(()=>o.slots.default),s={solid:"primary",outline:"secondary",text:"secondary"}[e.variant],c=t.computed(()=>({"devui-btn":!0,[`devui-btn-${e.variant}`]:!0,[`devui-btn-${e.variant}-${e.color||s}`]:!0,[`devui-btn-${e.size}`]:!0,"devui-btn-icon-wrap":e.icon,"devui-btn-icon":e.icon&&!n.value&&e.variant!=="solid"})),d=t.computed(()=>{if(!e.icon)return;const p="devui-icon-fix icon";return n.value?`${p} clear-right-5`:p});return{classes:c,iconClass:d}}var q="",y=t.defineComponent({name:"DButton",directives:{devLoading:E},props:x,emits:["click"],setup(e,o){const{icon:n,disabled:a,loading:s}=t.toRefs(e),{classes:c,iconClass:d}=M(e,o),p=m=>{s.value||o.emit("click",m)};return()=>{var m,A;return t.withDirectives(t.createVNode("button",{class:c.value,disabled:a.value,onClick:p},[n.value&&t.createVNode(r,{name:n.value,size:"12px",class:d.value},null),t.createVNode("span",{class:"button-content"},[(A=(m=o.slots).default)==null?void 0:A.call(m)])]),[[t.resolveDirective("dLoading"),s.value]])}}}),j={title:"Button \u6309\u94AE",category:"\u901A\u7528",status:"100%",install(e){e.component(y.name,y)}};i.Button=y,i.buttonProps=x,i.default=j,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|