vue-devui 1.6.9 → 1.6.11
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/auto-complete/index.es.js +8 -24
- package/auto-complete/index.umd.js +15 -15
- package/category-search/index.es.js +19 -36
- package/category-search/index.umd.js +18 -18
- package/checkbox/index.es.js +16 -33
- package/checkbox/index.umd.js +17 -17
- package/data-grid/index.es.js +11 -28
- package/data-grid/index.umd.js +7 -7
- package/date-picker-pro/index.es.js +36 -30
- package/date-picker-pro/index.umd.js +11 -11
- package/editor-md/index.es.js +0 -1
- package/editor-md/index.umd.js +4 -4
- package/form/index.es.js +14 -30
- package/form/index.umd.js +12 -12
- package/input/index.es.js +14 -30
- package/input/index.umd.js +10 -10
- package/input-number/index.es.js +14 -30
- package/input-number/index.umd.js +13 -13
- package/mention/index.es.js +8 -24
- package/mention/index.umd.js +13 -13
- package/menu/index.es.js +26 -2
- package/menu/index.umd.js +5 -1
- package/menu/style.css +1 -1
- package/modal/index.es.js +18 -12
- package/modal/index.umd.js +7 -7
- package/package.json +1 -1
- package/pagination/index.es.js +10 -27
- package/pagination/index.umd.js +7 -7
- package/radio/index.es.js +14 -30
- package/radio/index.umd.js +19 -19
- package/search/index.es.js +20 -30
- package/search/index.umd.js +11 -11
- package/search/style.css +1 -1
- package/select/index.es.js +16 -33
- package/select/index.umd.js +9 -9
- package/style.css +1 -1
- package/switch/index.es.js +8 -24
- package/switch/index.umd.js +15 -15
- package/table/index.es.js +10 -27
- package/table/index.umd.js +7 -7
- package/textarea/index.es.js +14 -30
- package/textarea/index.umd.js +18 -18
- package/time-picker/index.es.js +8 -24
- package/time-picker/index.umd.js +9 -9
- package/time-select/index.es.js +16 -33
- package/time-select/index.umd.js +14 -14
- package/tree/index.es.js +10 -27
- package/tree/index.umd.js +9 -9
- package/types/checkbox/src/checkbox-types.d.ts +0 -2
- package/types/date-picker-pro/src/date-picker-pro-types.d.ts +13 -0
- package/types/date-picker-pro/src/range-date-picker-types.d.ts +4 -0
- package/types/form/src/components/form-item/form-item-types.d.ts +4 -0
- package/types/form/src/components/form-item/form-item.d.ts +9 -0
- package/types/search/src/search-types.d.ts +4 -0
- package/types/search/src/search.d.ts +9 -0
- package/vue-devui.es.js +79 -59
- package/vue-devui.umd.js +43 -43
package/menu/index.es.js
CHANGED
|
@@ -570,6 +570,26 @@ function useShowSubMenu(eventName, e, wrapper) {
|
|
|
570
570
|
wrapper.classList.add(menuItemHorizontalWrapperHidden);
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
+
function SelectArrowIcon() {
|
|
574
|
+
return createVNode("svg", {
|
|
575
|
+
"width": "16px",
|
|
576
|
+
"height": "16px",
|
|
577
|
+
"viewBox": "0 0 16 16",
|
|
578
|
+
"version": "1.1",
|
|
579
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
580
|
+
}, [createVNode("g", {
|
|
581
|
+
"stroke": "none",
|
|
582
|
+
"stroke-width": "1",
|
|
583
|
+
"fill": "none",
|
|
584
|
+
"fill-rule": "evenodd"
|
|
585
|
+
}, [createVNode("path", {
|
|
586
|
+
"d": `M3.64644661,5.64644661 C3.82001296,5.47288026 4.08943736,5.45359511 4.2843055,5.58859116 L4.35355339,5.64644661
|
|
587
|
+
L8,9.293 L11.6464466,5.64644661 C11.820013,5.47288026 12.0894374,5.45359511 12.2843055,5.58859116 L12.3535534,5.64644661
|
|
588
|
+
C12.5271197,5.82001296 12.5464049,6.08943736 12.4114088,6.2843055 L12.3535534,6.35355339 L8.35355339,10.3535534
|
|
589
|
+
C8.17998704,10.5271197 7.91056264,10.5464049 7.7156945,10.4114088 L7.64644661,10.3535534 L3.64644661,6.35355339
|
|
590
|
+
C3.45118446,6.15829124 3.45118446,5.84170876 3.64644661,5.64644661 Z`
|
|
591
|
+
}, null)])]);
|
|
592
|
+
}
|
|
573
593
|
const ns = useNamespace("menu");
|
|
574
594
|
const subNs = useNamespace("submenu");
|
|
575
595
|
const subMenuClass = subNs.b();
|
|
@@ -698,9 +718,13 @@ var SubMenu = defineComponent({
|
|
|
698
718
|
"class": `${ns.b()}-icon`
|
|
699
719
|
}, [(_b = (_a = ctx.slots) == null ? void 0 : _a.icon) == null ? void 0 : _b.call(_a)]), withDirectives(createVNode("span", {
|
|
700
720
|
"class": `${subMenuClass}-title-content`
|
|
701
|
-
}, [props.title]), [[vShow, !isCollapsed.value]]), withDirectives(createVNode(
|
|
721
|
+
}, [props.title]), [[vShow, !isCollapsed.value]]), withDirectives(createVNode(SelectArrowIcon, {
|
|
722
|
+
"class": [ns.e("arrow-icon"), {
|
|
723
|
+
"is-opened": isOpen.value
|
|
724
|
+
}]
|
|
725
|
+
}, null), [[vShow, !isCollapsed.value && key !== "overflowContainer" && class_layer.value !== `layer_${subMenuClass}`]]), withDirectives(createVNode("i", {
|
|
702
726
|
"class": {
|
|
703
|
-
"icon icon-chevron-up":
|
|
727
|
+
"icon icon-chevron-up": false,
|
|
704
728
|
"icon icon-chevron-right": class_layer.value === `layer_${subMenuClass}`,
|
|
705
729
|
"is-opened": isOpen.value
|
|
706
730
|
}
|
package/menu/index.umd.js
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
var ze=Object.defineProperty;var Pe=(h,n,C)=>n in h?ze(h,n,{enumerable:!0,configurable:!0,writable:!0,value:C}):h[n]=C;var ce=(h,n,C)=>(Pe(h,typeof n!="symbol"?n+"":n,C),C);(function(h,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue"),require("clipboard")):typeof define=="function"&&define.amd?define(["exports","vue","clipboard"],n):(h=typeof globalThis!="undefined"?globalThis:h||self,n(h.index={},h.Vue))})(this,function(h,n){"use strict";function C(e,l,t){let s=e;return l&&(s+=`__${l}`),t&&(s+=`--${t}`),s}function E(e,l=!1){const t=l?`.devui-${e}`:`devui-${e}`;return{b:()=>C(t),e:f=>f?C(t,f):"",m:f=>f?C(t,"",f):"",em:(f,m)=>f&&m?C(t,f,m):""}}const Q=[];let U=[];const W=n.ref(24),x=E("menu"),de=E("submenu"),_=x.b(),X=`${x.b()}-item-horizontal-wrapper`,Y=`${x.b()}-item-select`,Z=`${x.b()}-active-parent`;function ue(e){W.value=e}function fe(e){Q.push(e)}function me(){U=[],Q.forEach(t=>{U.push(t.el.parentElement)});const e=[...U],l=t=>{var s;return(s=/layer_(\d*)/gim.exec(t))==null?void 0:s[1]};for(;e.length;){const t=e.shift();if(t==null?void 0:t.classList.contains(_)){const s=t.children;e.unshift(...Array.from(s));continue}else{if(t.tagName==="DIV")if(t.classList.contains(`${x.b()}-item-vertical-wrapper`)||t.classList.contains(`${de.b()}-menu-item-vertical-wrapper`)){const s=t.parentElement;if(e.unshift(...Array.from(t.children)),s==null?void 0:s.classList.contains(_))t.classList.add("layer_1");else{let a=l((s==null?void 0:s.classList.value)||"");a=Number(a),t.classList.add(`layer_${a}`)}}else{const s=t.parentElement;let a=l((s==null?void 0:s.classList.value)||"");a=Number(a),t.classList.add(`layer_${a}`),t.style.paddingLeft=`${(a===2?1:a-1)*W.value}px`}if(t.tagName==="UL"){const s=t.parentElement,a=t.children;for(let f=0;f<a.length;f++)e.unshift(a[f]);const o=(s==null?void 0:s.classList.value)||"";let d=l(o);(s==null?void 0:s.classList.contains(_))?(d=1,t.classList.add(`layer_${2}`)):(t.classList.add(`layer_${Number(d)+1}`),d=Number(d)+1)}if(t.tagName==="LI"){const s=t.parentElement,a=(s==null?void 0:s.classList.value)||"";let o=l(a);l(a),o=Number(o),t.style.padding=`0 ${o*W.value}px`}}}}function pe(e){var s;const l=e;let t=null;for(let a=0;a<l.length;a++){const o=l[a];((s=o==null?void 0:o.classList)==null?void 0:s.contains(`${x.b()}-horizontal`))&&(t=o)}return t}function he(e,l){let t=l.target,s=[];const a=pe(l.composedPath());for(s=[...Array.from(a.children)],t.tagName==="SPAN"&&(t=t.parentElement);s.length;){const o=s.shift();if((o==null?void 0:o.tagName)==="UL"||(o==null?void 0:o.classList.contains(X))){const d=o==null?void 0:o.children;s.unshift(...Array.from(d))}o!==t&&(o==null||o.classList.remove(Y),o==null||o.classList.remove(Z))}}function ge(e,l){const t=[],s=l.path||l.composedPath&&l.composedPath();for(let a=0;a<s.length;a++){const o=s[a];if(!o.classList.contains(_))t.push(...Array.from(o.children));else{t.push(...Array.from(o.children));break}}for(;t.length;){const a=t.shift();((a==null?void 0:a.tagName)==="UL"||(a==null?void 0:a.classList.contains(X)))&&t.push(...Array.from(a==null?void 0:a.children)),a!==e&&((a==null?void 0:a.tagName)==="DIV"&&t.unshift(...Array.from(a==null?void 0:a.children)),a==null||a.classList.remove(Y),a==null||a.classList.remove(Z))}}function ee(e,l,t=!1){t?he(e,l):ge(e,l)}function ye(e){var s;const l=/layer_(\d{1,})/gim,t=e.className;return(s=l.exec(t))==null?void 0:s[1]}const be={disabled:{type:Boolean,default:!1},href:{type:String,default:""},route:{type:[String,Object]}},te=E("menu");function ne(e,l,t,s){const a=n.ref(!1);return t?e.includes(l)?a.value=!0:a.value=!1:e[0]===l&&!s.value?a.value=!0:a.value=!1,a.value}function ve(e){var t,s;let l=e.parentElement;for(;!l.classList.contains(te.b());)((t=l.firstElementChild)==null?void 0:t.tagName)==="DIV"&&((s=l==null?void 0:l.firstElementChild)==null||s.classList.add(`${te.b()}-active-parent`)),l=l.parentElement;return l}function Le(e,l,t,s){if(t&&l){const a=e.route||s,o=l.push(a).then(d=>d);return{route:a,routerResult:o}}}const q=E("menu");function se(e){const l=e.composedPath();for(let t=0;t<l.length;t++){const s=l[t];if(s.classList.contains(`${q.b()}-horizontal`))break;if(s.classList.contains(`${q.b()}-item-horizontal-wrapper`))continue;s.tagName!=="SPAN"&&s.classList.add(`${q.b()}-item-select`)}}const V=E("menu"),B=`${V.b()}-item-select`,we=`${V.b()}-item-disabled`;var F=n.defineComponent({name:"DMenuItem",props:be,setup(e,l){var c,b;const t=n.getCurrentInstance(),s=String(t==null?void 0:t.vnode.key),a=n.inject("menuStore"),o=n.inject("mode"),d=n.inject("multiple"),f=n.inject("defaultIndent"),m=n.inject("isCollapsed"),v=n.inject("defaultSelectKey"),{disabled:z}=n.toRefs(e),L=n.ref(ne(v.value,s,d,z)),S=n.ref(!0),A=n.inject("rootMenuEmit"),k=n.inject("useRouter"),P=t==null?void 0:t.appContext.config.globalProperties.$router,w=n.computed(()=>({[`${V.b()}-item`]:!0,[`${V.b()}-item-isCollapsed`]:m.value,[B]:L.value,[we]:z.value}));a.on("menuItem:clear:select",()=>{L.value=!1});const N=r=>{var u;r.stopPropagation();const i=r.currentTarget;let p;if(e.disabled&&r.preventDefault(),!e.disabled){if(!d)a.emit("menuItem:clear:select"),ee(i,r,o.value==="horizontal"),o.value==="horizontal"&&se(r),L.value=!0,p=Le(e,P,k.value,s);else if(i.classList.contains(B)){A("deselect",{type:"deselect",key:s,el:i,e:r}),L.value=!1;return}else L.value=!0,i.classList.add(B);p===void 0?A("select",{type:"select",key:s,el:i,e:r}):A("select",{type:"select",key:s,el:i,e:r,route:p})}if(o.value==="vertical"){const g=r.currentTarget;ve(g)}if(o.value==="horizontal"){const g=(u=i.parentElement)==null?void 0:u.parentElement;g==null||g.classList.add(`${V.b()}-active-parent`)}},$=n.createVNode("span",{class:`${V.b()}-icon`},[(b=(c=l.slots).icon)==null?void 0:b.call(c)]),y=n.ref(null);return n.watch(z,()=>{d||(w.value[B]=!1)}),n.watch(()=>[...v.value],r=>{L.value=ne(r,s,d,z),w.value[B]=L.value}),n.onMounted(()=>{var p,u;let r="";const i=y.value;o.value==="vertical"&&(((u=(p=i.parentElement)==null?void 0:p.parentElement)==null?void 0:u.classList.contains(V.b()))?(S.value=!0,S.value&&(i.style.paddingRight="",i.style.paddingLeft=`${f}px`),n.watch(m,g=>{g?(i.style.padding!=="0"&&(r=i.style.padding),setTimeout(()=>{i.style.padding="0",i.style.width="",i.style.textAlign="center"},300),i.style.display="block"):(i.style.padding=`${r}`,i.style.textAlign="",i.style.display="flex")})):S.value=!1)}),()=>o.value==="vertical"?n.createVNode("div",{class:`${V.b()}-item-vertical-wrapper`},[n.createVNode("li",{class:w.value,onClick:N,ref:y},[l.slots.icon!==void 0&&$,e.href===""?n.createVNode(n.Transition,{name:"fade"},{default:()=>{var r,i;return[n.withDirectives(n.createVNode("span",null,[(i=(r=l.slots).default)==null?void 0:i.call(r)]),[[n.vShow,!m.value]])]}}):n.createVNode("a",{href:e.href},[n.createVNode(n.Transition,{name:"fade"},{default:()=>{var r,i;return[(i=(r=l.slots).default)==null?void 0:i.call(r)]}})])])]):n.createVNode("li",{class:w.value,onClick:N,ref:y},[l.slots.icon!==void 0&&$,e.href===""?n.createVNode(n.Transition,{name:"fade"},{default:()=>{var r,i;return[n.withDirectives(n.createVNode("span",null,[(i=(r=l.slots).default)==null?void 0:i.call(r)]),[[n.vShow,!m.value]])]}}):n.createVNode("a",{href:e.href},[n.createVNode(n.Transition,{name:"fade"},{default:()=>{var r,i;return[(i=(r=l.slots).default)==null?void 0:i.call(r)]}})])])}});function ae(e=8){const l="abcdefghijklmnopqrstuvwxyz0123456789";let t="";for(let s=0;s<e;s++)t+=l[parseInt((Math.random()*l.length).toString())];return t}function le(e){for(;e&&e.tagName!=="LI"&&e.tagName!=="UL";)e=e.parentElement;return e}const oe="0.3s height ease-in-out, 0.3s padding-top ease-in-out, 0.3s padding-bottom ease-in-out",D={"before-enter"(e){e.style.transition=oe,e.setAttribute("data-oldPadding",e.style.padding),e.setAttribute("data-oldMargin",e.style.margin),e.style.height="0",e.style.padding="0",e.style.margin="0"},enter(e){e.dataset.oldOverflow=e.style.overflow,e.scrollHeight!==0?e.style.height=e.scrollHeight+"px":e.style.height="",e.style.padding=e.getAttribute("data-oldPadding"),e.style.margin=e.getAttribute("data-oldMargin"),e.style.overflow="hidden"},"after-enter"(e){e.style.transition="",e.style.transition="",e.style.height="",e.style.overflow=e.getAttribute("data-overflow")},"before-leave"(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.dataset.oldOverflow=e.style.overflow,e.style.height=e.scrollHeight+"px",e.style.overflow="hidden"},leave(e){e.scrollHeight!==0&&(e.style.transition=oe,e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0")},"after-leave"(e){e.style.transition="",e.style.height="",e.style.overflow=e.dataset.oldOverflow,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom}};var Ne=n.defineComponent({name:"DMenuTransition",setup(e,l){return()=>n.createVNode(n.Transition,{onBeforeEnter:t=>D["before-enter"](t),onBeforeLeave:t=>D["before-leave"](t),onEnter:t=>D.enter(t),onAfterEnter:t=>D["after-enter"](t),onLeave:t=>D.leave(t),onAfterLeave:t=>D["after-leave"](t)},{default:()=>{var t,s;return[(s=(t=l.slots).default)==null?void 0:s.call(t)]}})}});const $e={title:{type:String,default:""},disabled:{type:Boolean,default:!1}},R=E("menu"),Se=E("submenu"),I=`${R.b()}-item-horizontal-wrapper-hidden`,H=`${R.b()}-item-horizontal-wrapper-show`;function j(e,l,t){const s=l.currentTarget,a=s.parentElement,o=t.children;if(t.style.padding="0 20px !important",e==="mouseenter"){if((a==null?void 0:a.tagName)==="DIV"){t.classList.add(`${R.b()}-item-horizontal-wrapper-level`);const{width:d}=s.getClientRects()[0];t.style.top="0px",t.style.left=`${d}px`}else t.style.top="26px",t.style.left="0px";t.classList.remove(I),t.classList.add(H);for(let d=0;d<o.length;d++){const f=o[d];if(f.tagName==="UL"&&f.classList.contains(Se.b())){const m=f.getElementsByClassName(`${R.b()}-item-horizontal-wrapper`)[0];f.addEventListener("mouseenter",v=>{v.stopPropagation(),j("mouseenter",v,m),m.classList.remove(I),m.classList.add(H)}),f.addEventListener("mouseleave",v=>{v.stopPropagation(),j("mouseleave",v,m),m.classList.remove(H),m.classList.add(I)})}}}e==="mouseleave"&&(t.classList.remove(H),t.classList.add(I))}const G=E("menu"),T=E("submenu").b();var K=n.defineComponent({name:"DSubMenu",props:$e,setup(e,l){const t=n.ref(!0),{vnode:{key:s}}=n.getCurrentInstance();let a=String(s);const o=n.inject("openKeys"),d=n.ref(o.value.includes(a)),f=n.inject("defaultIndent"),m=n.inject("isCollapsed"),v=n.inject("mode"),z=n.ref(null),L=n.inject("rootMenuEmit"),S=v.value==="horizontal";a==="null"&&(console.warn("[devui][menu]: Key can not be null"),a=`randomKey-${ae(16)}`);const A=c=>{c.stopPropagation();const b=le(c.target);if(!(b.classList.contains(T)&&S)&&(S&&(ee(b,c,!0),se(c)),!e.disabled&&v.value!=="horizontal")){const r=le(c.target),i=o.value.indexOf(a);i>=0&&r.tagName==="UL"?o.value.splice(i,1):r.tagName==="UL"&&o.value.push(a),d.value=o.value.indexOf(a)>=0,L("submenu-change",{type:"submenu-change",state:d.value,key:a,el:b})}},k=n.ref(null);let P;const w=n.ref(null),N=n.ref(null);let $="";const y=n.ref("");return n.watchEffect(()=>{P=k.value,fe({el:w.value})},{flush:"post"}),n.watch(()=>o,c=>{c.value.includes(a)?d.value=!0:d.value=!1},{deep:!0}),n.onMounted(()=>{var r;const c=N.value,b=w.value;me(),y.value=`layer_${(r=Array.from(b.classList).at(-1))==null?void 0:r.replace("layer_","")}`,S&&!e.disabled&&(w.value.addEventListener("mouseenter",i=>{i.stopPropagation(),j("mouseenter",i,P)}),w.value.addEventListener("mouseleave",i=>{i.stopPropagation(),j("mouseleave",i,P)})),n.watch(m,i=>{const p=Number(ye(b));Number.isNaN(p)||p>2&&(t.value=!m.value),i?(c.style.padding!=="0"&&($=c.style.padding),setTimeout(()=>{c.style.padding="0",c.style.width="",c.style.textAlign="center"},300),c.style.display="block"):(c.style.padding=`${$}`,c.style.textAlign="",c.style.display="flex")})}),()=>{var c,b,r,i;return n.withDirectives(n.createVNode("ul",{onClick:A,class:[T,y.value,e.disabled&&`${T}-disabled`],ref:w},[n.createVNode("div",{class:[`${T}-title`],style:`padding: 0 ${f}px`,ref:N},[n.createVNode("span",{class:`${G.b()}-icon`},[(b=(c=l.slots)==null?void 0:c.icon)==null?void 0:b.call(c)]),n.withDirectives(n.createVNode("span",{class:`${T}-title-content`},[e.title]),[[n.vShow,!m.value]]),n.withDirectives(n.createVNode("i",{class:{"icon icon-chevron-up":y.value!==`layer_${T}`,"icon icon-chevron-right":y.value===`layer_${T}`,"is-opened":d.value}},null),[[n.vShow,!m.value&&s!=="overflowContainer"]])]),S?n.withDirectives(n.createVNode("div",{class:`${G.b()}-item-horizontal-wrapper ${G.b()}-item-horizontal-wrapper-hidden`,ref:k},[(i=(r=l.slots).default)==null?void 0:i.call(r)]),[[n.vShow,!e.disabled]]):n.createVNode(Ne,null,{default:()=>{var p,u;return[n.withDirectives(n.createVNode("div",{class:[`${T}-menu-item-vertical-wrapper`],ref:z},[(u=(p=l.slots).default)==null?void 0:u.call(p)]),[[n.vShow,d.value]])]}})]),[[n.vShow,t.value]])}}});const Ce={width:{type:String,default:""},collapsed:{type:Boolean,default:!1},collapsedIndent:{type:Number,default:24},indentSize:{type:Number,default:24},multiple:{type:Boolean,default:!1},openKeys:{type:Array,default:[]},defaultSelectKeys:{type:Array,default:[]},mode:{type:String,default:"vertical"},router:{type:Boolean,default:!1},disableOverflowStyle:{type:Boolean,default:!1}};var Te="";const M={};class Ee{constructor(l){ce(this,"rootMenuName");this.rootMenuName=l}on(l,t){var s;((s=M==null?void 0:M[this.rootMenuName])==null?void 0:s[l])||Reflect.set(M[this.rootMenuName],l,[]),M[this.rootMenuName][l].push(t)}emit(l,...t){M[this.rootMenuName][l].forEach(s=>s(...t))}off(l,t){const s=M[this.rootMenuName][l].indexOf(t);s>=0&&M[this.rootMenuName][l].splice(s,1)}}function Me(e){return M[e]||Reflect.set(M,e,{}),new Ee(e)}var J=n.defineComponent({name:"DMenu",props:Ce,emits:["select","deselect","submenu-change"],setup(e,l){const t=E("menu"),{openKeys:s,mode:a,collapsed:o,defaultSelectKeys:d,router:f}=n.toRefs(e),m=ae(16),v=Me(m);n.provide("menuStore",v),n.provide("isCollapsed",o),n.provide("defaultIndent",e.indentSize),n.provide("multiple",e.multiple),n.provide("openKeys",s),n.provide("defaultSelectKey",d),n.provide("mode",a),n.provide("collapsedIndent",e.collapsedIndent),n.provide("rootMenuEmit",l.emit),n.provide("useRouter",f),ue(e.indentSize);const z=n.ref(null),L=n.ref(0),S=n.ref(null),A=`${t.b()}-item-select`,k=n.computed(()=>({[`${t.b()}`]:!0,[`${t.b()}-vertical`]:a.value==="vertical",[`${t.b()}-horizontal`]:a.value==="horizontal",[`${t.b()}-collapsed`]:o.value})),P=n.reactive({[A]:!1,[`${t.b()}-overflow-container`]:!0}),w=N=>{const $=Array.from(N.children);for(const y of $)if(y.classList.contains(A)){P[A]=!0;break}else P[A]=!1};return n.onMounted(()=>{var N;if(e.mode==="horizontal"){let $=!1;const y=(N=S.value)==null?void 0:N.$el,c=z.value,b=c.children,r=y.children[1],i=new IntersectionObserver(p=>{p.forEach(u=>{if(!u.isIntersecting&&!e.disableOverflowStyle){const g=u.target.cloneNode(!0);u.target.classList.contains(`${t.b()}-overflow-container`)?$&&u.target.previousElementSibling&&r.children.length?c.appendChild(u.target.previousElementSibling):$=!0:(L.value+=1,u.target.style.visibility="hidden",y.nextSibling?c.insertBefore(u.target,y.nextSibling):c.appendChild(u.target),r.appendChild(g),w(r))}else if(!u.target.classList.contains(`${t.b()}-overflow-container`)&&u.target.style.visibility==="hidden"){i.unobserve(u.target),c.insertBefore(u.target,y),u.target.style.visibility="";const g=y.previousElementSibling;if(g&&u.boundingClientRect.width%u.target.getBoundingClientRect().width===0&&i.observe(g),g==null?void 0:g.classList.contains("devui-submenu")){const ie=g,re=g.children[1];ie.addEventListener("mouseenter",O=>{O.stopPropagation(),j("mouseenter",O,re)}),ie.addEventListener("mouseleave",O=>{O.stopPropagation(),j("mouseleave",O,re)})}L.value-=1,i.observe(u.target),r.lastChild&&r.removeChild(r.lastChild),w(r)}})},{root:c,threshold:1,rootMargin:"8px"});for(let p=0;p<b.length;p++)i.observe(b[p])}}),()=>{var N,$;return n.createVNode("ul",{ref:z,class:k.value,style:[e.collapsed?`width:${e.collapsedIndent*2}px`:`width: ${e.width}`]},[($=(N=l.slots).default)==null?void 0:$.call(N),n.withDirectives(n.createVNode(K,{ref:S,key:"overflowContainer",title:"...",class:P},null),[[n.vShow,L.value>0&&a.value==="horizontal"&&!e.disableOverflowStyle]])])}}}),Ae={title:"Menu \u83DC\u5355",category:"\u5BFC\u822A",status:"100%",install(e){e.component(J.name,J),e.component(F.name,F),e.component(K.name,K)}};h.Menu=J,h.MenuItem=F,h.SubMenu=K,h.default=Ae,Object.defineProperty(h,"__esModule",{value:!0}),h[Symbol.toStringTag]="Module"});
|
|
1
|
+
var ze=Object.defineProperty;var Pe=(h,t,C)=>t in h?ze(h,t,{enumerable:!0,configurable:!0,writable:!0,value:C}):h[t]=C;var ce=(h,t,C)=>(Pe(h,typeof t!="symbol"?t+"":t,C),C);(function(h,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("clipboard")):typeof define=="function"&&define.amd?define(["exports","vue","clipboard"],t):(h=typeof globalThis!="undefined"?globalThis:h||self,t(h.index={},h.Vue))})(this,function(h,t){"use strict";function C(e,l,n){let s=e;return l&&(s+=`__${l}`),n&&(s+=`--${n}`),s}function E(e,l=!1){const n=l?`.devui-${e}`:`devui-${e}`;return{b:()=>C(n),e:f=>f?C(n,f):"",m:f=>f?C(n,"",f):"",em:(f,m)=>f&&m?C(n,f,m):""}}const J=[];let W=[];const q=t.ref(24),D=E("menu"),de=E("submenu"),_=D.b(),Q=`${D.b()}-item-horizontal-wrapper`,X=`${D.b()}-item-select`,Y=`${D.b()}-active-parent`;function ue(e){q.value=e}function fe(e){J.push(e)}function me(){W=[],J.forEach(n=>{W.push(n.el.parentElement)});const e=[...W],l=n=>{var s;return(s=/layer_(\d*)/gim.exec(n))==null?void 0:s[1]};for(;e.length;){const n=e.shift();if(n==null?void 0:n.classList.contains(_)){const s=n.children;e.unshift(...Array.from(s));continue}else{if(n.tagName==="DIV")if(n.classList.contains(`${D.b()}-item-vertical-wrapper`)||n.classList.contains(`${de.b()}-menu-item-vertical-wrapper`)){const s=n.parentElement;if(e.unshift(...Array.from(n.children)),s==null?void 0:s.classList.contains(_))n.classList.add("layer_1");else{let a=l((s==null?void 0:s.classList.value)||"");a=Number(a),n.classList.add(`layer_${a}`)}}else{const s=n.parentElement;let a=l((s==null?void 0:s.classList.value)||"");a=Number(a),n.classList.add(`layer_${a}`),n.style.paddingLeft=`${(a===2?1:a-1)*q.value}px`}if(n.tagName==="UL"){const s=n.parentElement,a=n.children;for(let f=0;f<a.length;f++)e.unshift(a[f]);const o=(s==null?void 0:s.classList.value)||"";let d=l(o);(s==null?void 0:s.classList.contains(_))?(d=1,n.classList.add(`layer_${2}`)):(n.classList.add(`layer_${Number(d)+1}`),d=Number(d)+1)}if(n.tagName==="LI"){const s=n.parentElement,a=(s==null?void 0:s.classList.value)||"";let o=l(a);l(a),o=Number(o),n.style.padding=`0 ${o*q.value}px`}}}}function pe(e){var s;const l=e;let n=null;for(let a=0;a<l.length;a++){const o=l[a];((s=o==null?void 0:o.classList)==null?void 0:s.contains(`${D.b()}-horizontal`))&&(n=o)}return n}function he(e,l){let n=l.target,s=[];const a=pe(l.composedPath());for(s=[...Array.from(a.children)],n.tagName==="SPAN"&&(n=n.parentElement);s.length;){const o=s.shift();if((o==null?void 0:o.tagName)==="UL"||(o==null?void 0:o.classList.contains(Q))){const d=o==null?void 0:o.children;s.unshift(...Array.from(d))}o!==n&&(o==null||o.classList.remove(X),o==null||o.classList.remove(Y))}}function ge(e,l){const n=[],s=l.path||l.composedPath&&l.composedPath();for(let a=0;a<s.length;a++){const o=s[a];if(!o.classList.contains(_))n.push(...Array.from(o.children));else{n.push(...Array.from(o.children));break}}for(;n.length;){const a=n.shift();((a==null?void 0:a.tagName)==="UL"||(a==null?void 0:a.classList.contains(Q)))&&n.push(...Array.from(a==null?void 0:a.children)),a!==e&&((a==null?void 0:a.tagName)==="DIV"&&n.unshift(...Array.from(a==null?void 0:a.children)),a==null||a.classList.remove(X),a==null||a.classList.remove(Y))}}function ee(e,l,n=!1){n?he(e,l):ge(e,l)}function ye(e){var s;const l=/layer_(\d{1,})/gim,n=e.className;return(s=l.exec(n))==null?void 0:s[1]}const be={disabled:{type:Boolean,default:!1},href:{type:String,default:""},route:{type:[String,Object]}},te=E("menu");function ne(e,l,n,s){const a=t.ref(!1);return n?e.includes(l)?a.value=!0:a.value=!1:e[0]===l&&!s.value?a.value=!0:a.value=!1,a.value}function ve(e){var n,s;let l=e.parentElement;for(;!l.classList.contains(te.b());)((n=l.firstElementChild)==null?void 0:n.tagName)==="DIV"&&((s=l==null?void 0:l.firstElementChild)==null||s.classList.add(`${te.b()}-active-parent`)),l=l.parentElement;return l}function we(e,l,n,s){if(n&&l){const a=e.route||s,o=l.push(a).then(d=>d);return{route:a,routerResult:o}}}const F=E("menu");function se(e){const l=e.composedPath();for(let n=0;n<l.length;n++){const s=l[n];if(s.classList.contains(`${F.b()}-horizontal`))break;if(s.classList.contains(`${F.b()}-item-horizontal-wrapper`))continue;s.tagName!=="SPAN"&&s.classList.add(`${F.b()}-item-select`)}}const P=E("menu"),j=`${P.b()}-item-select`,Le=`${P.b()}-item-disabled`;var Z=t.defineComponent({name:"DMenuItem",props:be,setup(e,l){var c,b;const n=t.getCurrentInstance(),s=String(n==null?void 0:n.vnode.key),a=t.inject("menuStore"),o=t.inject("mode"),d=t.inject("multiple"),f=t.inject("defaultIndent"),m=t.inject("isCollapsed"),v=t.inject("defaultSelectKey"),{disabled:A}=t.toRefs(e),w=t.ref(ne(v.value,s,d,A)),S=t.ref(!0),V=t.inject("rootMenuEmit"),B=t.inject("useRouter"),z=n==null?void 0:n.appContext.config.globalProperties.$router,L=t.computed(()=>({[`${P.b()}-item`]:!0,[`${P.b()}-item-isCollapsed`]:m.value,[j]:w.value,[Le]:A.value}));a.on("menuItem:clear:select",()=>{w.value=!1});const N=r=>{var u;r.stopPropagation();const i=r.currentTarget;let p;if(e.disabled&&r.preventDefault(),!e.disabled){if(!d)a.emit("menuItem:clear:select"),ee(i,r,o.value==="horizontal"),o.value==="horizontal"&&se(r),w.value=!0,p=we(e,z,B.value,s);else if(i.classList.contains(j)){V("deselect",{type:"deselect",key:s,el:i,e:r}),w.value=!1;return}else w.value=!0,i.classList.add(j);p===void 0?V("select",{type:"select",key:s,el:i,e:r}):V("select",{type:"select",key:s,el:i,e:r,route:p})}if(o.value==="vertical"){const g=r.currentTarget;ve(g)}if(o.value==="horizontal"){const g=(u=i.parentElement)==null?void 0:u.parentElement;g==null||g.classList.add(`${P.b()}-active-parent`)}},$=t.createVNode("span",{class:`${P.b()}-icon`},[(b=(c=l.slots).icon)==null?void 0:b.call(c)]),y=t.ref(null);return t.watch(A,()=>{d||(L.value[j]=!1)}),t.watch(()=>[...v.value],r=>{w.value=ne(r,s,d,A),L.value[j]=w.value}),t.onMounted(()=>{var p,u;let r="";const i=y.value;o.value==="vertical"&&(((u=(p=i.parentElement)==null?void 0:p.parentElement)==null?void 0:u.classList.contains(P.b()))?(S.value=!0,S.value&&(i.style.paddingRight="",i.style.paddingLeft=`${f}px`),t.watch(m,g=>{g?(i.style.padding!=="0"&&(r=i.style.padding),setTimeout(()=>{i.style.padding="0",i.style.width="",i.style.textAlign="center"},300),i.style.display="block"):(i.style.padding=`${r}`,i.style.textAlign="",i.style.display="flex")})):S.value=!1)}),()=>o.value==="vertical"?t.createVNode("div",{class:`${P.b()}-item-vertical-wrapper`},[t.createVNode("li",{class:L.value,onClick:N,ref:y},[l.slots.icon!==void 0&&$,e.href===""?t.createVNode(t.Transition,{name:"fade"},{default:()=>{var r,i;return[t.withDirectives(t.createVNode("span",null,[(i=(r=l.slots).default)==null?void 0:i.call(r)]),[[t.vShow,!m.value]])]}}):t.createVNode("a",{href:e.href},[t.createVNode(t.Transition,{name:"fade"},{default:()=>{var r,i;return[(i=(r=l.slots).default)==null?void 0:i.call(r)]}})])])]):t.createVNode("li",{class:L.value,onClick:N,ref:y},[l.slots.icon!==void 0&&$,e.href===""?t.createVNode(t.Transition,{name:"fade"},{default:()=>{var r,i;return[t.withDirectives(t.createVNode("span",null,[(i=(r=l.slots).default)==null?void 0:i.call(r)]),[[t.vShow,!m.value]])]}}):t.createVNode("a",{href:e.href},[t.createVNode(t.Transition,{name:"fade"},{default:()=>{var r,i;return[(i=(r=l.slots).default)==null?void 0:i.call(r)]}})])])}});function ae(e=8){const l="abcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let s=0;s<e;s++)n+=l[parseInt((Math.random()*l.length).toString())];return n}function le(e){for(;e&&e.tagName!=="LI"&&e.tagName!=="UL";)e=e.parentElement;return e}const oe="0.3s height ease-in-out, 0.3s padding-top ease-in-out, 0.3s padding-bottom ease-in-out",T={"before-enter"(e){e.style.transition=oe,e.setAttribute("data-oldPadding",e.style.padding),e.setAttribute("data-oldMargin",e.style.margin),e.style.height="0",e.style.padding="0",e.style.margin="0"},enter(e){e.dataset.oldOverflow=e.style.overflow,e.scrollHeight!==0?e.style.height=e.scrollHeight+"px":e.style.height="",e.style.padding=e.getAttribute("data-oldPadding"),e.style.margin=e.getAttribute("data-oldMargin"),e.style.overflow="hidden"},"after-enter"(e){e.style.transition="",e.style.transition="",e.style.height="",e.style.overflow=e.getAttribute("data-overflow")},"before-leave"(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.dataset.oldOverflow=e.style.overflow,e.style.height=e.scrollHeight+"px",e.style.overflow="hidden"},leave(e){e.scrollHeight!==0&&(e.style.transition=oe,e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0")},"after-leave"(e){e.style.transition="",e.style.height="",e.style.overflow=e.dataset.oldOverflow,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom}};var Ne=t.defineComponent({name:"DMenuTransition",setup(e,l){return()=>t.createVNode(t.Transition,{onBeforeEnter:n=>T["before-enter"](n),onBeforeLeave:n=>T["before-leave"](n),onEnter:n=>T.enter(n),onAfterEnter:n=>T["after-enter"](n),onLeave:n=>T.leave(n),onAfterLeave:n=>T["after-leave"](n)},{default:()=>{var n,s;return[(s=(n=l.slots).default)==null?void 0:s.call(n)]}})}});const $e={title:{type:String,default:""},disabled:{type:Boolean,default:!1}},R=E("menu"),Se=E("submenu"),I=`${R.b()}-item-horizontal-wrapper-hidden`,H=`${R.b()}-item-horizontal-wrapper-show`;function k(e,l,n){const s=l.currentTarget,a=s.parentElement,o=n.children;if(n.style.padding="0 20px !important",e==="mouseenter"){if((a==null?void 0:a.tagName)==="DIV"){n.classList.add(`${R.b()}-item-horizontal-wrapper-level`);const{width:d}=s.getClientRects()[0];n.style.top="0px",n.style.left=`${d}px`}else n.style.top="26px",n.style.left="0px";n.classList.remove(I),n.classList.add(H);for(let d=0;d<o.length;d++){const f=o[d];if(f.tagName==="UL"&&f.classList.contains(Se.b())){const m=f.getElementsByClassName(`${R.b()}-item-horizontal-wrapper`)[0];f.addEventListener("mouseenter",v=>{v.stopPropagation(),k("mouseenter",v,m),m.classList.remove(I),m.classList.add(H)}),f.addEventListener("mouseleave",v=>{v.stopPropagation(),k("mouseleave",v,m),m.classList.remove(H),m.classList.add(I)})}}}e==="mouseleave"&&(n.classList.remove(H),n.classList.add(I))}function Ce(){return t.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("path",{d:`M3.64644661,5.64644661 C3.82001296,5.47288026 4.08943736,5.45359511 4.2843055,5.58859116 L4.35355339,5.64644661
|
|
2
|
+
L8,9.293 L11.6464466,5.64644661 C11.820013,5.47288026 12.0894374,5.45359511 12.2843055,5.58859116 L12.3535534,5.64644661
|
|
3
|
+
C12.5271197,5.82001296 12.5464049,6.08943736 12.4114088,6.2843055 L12.3535534,6.35355339 L8.35355339,10.3535534
|
|
4
|
+
C8.17998704,10.5271197 7.91056264,10.5464049 7.7156945,10.4114088 L7.64644661,10.3535534 L3.64644661,6.35355339
|
|
5
|
+
C3.45118446,6.15829124 3.45118446,5.84170876 3.64644661,5.64644661 Z`},null)])])}const K=E("menu"),x=E("submenu").b();var U=t.defineComponent({name:"DSubMenu",props:$e,setup(e,l){const n=t.ref(!0),{vnode:{key:s}}=t.getCurrentInstance();let a=String(s);const o=t.inject("openKeys"),d=t.ref(o.value.includes(a)),f=t.inject("defaultIndent"),m=t.inject("isCollapsed"),v=t.inject("mode"),A=t.ref(null),w=t.inject("rootMenuEmit"),S=v.value==="horizontal";a==="null"&&(console.warn("[devui][menu]: Key can not be null"),a=`randomKey-${ae(16)}`);const V=c=>{c.stopPropagation();const b=le(c.target);if(!(b.classList.contains(x)&&S)&&(S&&(ee(b,c,!0),se(c)),!e.disabled&&v.value!=="horizontal")){const r=le(c.target),i=o.value.indexOf(a);i>=0&&r.tagName==="UL"?o.value.splice(i,1):r.tagName==="UL"&&o.value.push(a),d.value=o.value.indexOf(a)>=0,w("submenu-change",{type:"submenu-change",state:d.value,key:a,el:b})}},B=t.ref(null);let z;const L=t.ref(null),N=t.ref(null);let $="";const y=t.ref("");return t.watchEffect(()=>{z=B.value,fe({el:L.value})},{flush:"post"}),t.watch(()=>o,c=>{c.value.includes(a)?d.value=!0:d.value=!1},{deep:!0}),t.onMounted(()=>{var r;const c=N.value,b=L.value;me(),y.value=`layer_${(r=Array.from(b.classList).at(-1))==null?void 0:r.replace("layer_","")}`,S&&!e.disabled&&(L.value.addEventListener("mouseenter",i=>{i.stopPropagation(),k("mouseenter",i,z)}),L.value.addEventListener("mouseleave",i=>{i.stopPropagation(),k("mouseleave",i,z)})),t.watch(m,i=>{const p=Number(ye(b));Number.isNaN(p)||p>2&&(n.value=!m.value),i?(c.style.padding!=="0"&&($=c.style.padding),setTimeout(()=>{c.style.padding="0",c.style.width="",c.style.textAlign="center"},300),c.style.display="block"):(c.style.padding=`${$}`,c.style.textAlign="",c.style.display="flex")})}),()=>{var c,b,r,i;return t.withDirectives(t.createVNode("ul",{onClick:V,class:[x,y.value,e.disabled&&`${x}-disabled`],ref:L},[t.createVNode("div",{class:[`${x}-title`],style:`padding: 0 ${f}px`,ref:N},[t.createVNode("span",{class:`${K.b()}-icon`},[(b=(c=l.slots)==null?void 0:c.icon)==null?void 0:b.call(c)]),t.withDirectives(t.createVNode("span",{class:`${x}-title-content`},[e.title]),[[t.vShow,!m.value]]),t.withDirectives(t.createVNode(Ce,{class:[K.e("arrow-icon"),{"is-opened":d.value}]},null),[[t.vShow,!m.value&&s!=="overflowContainer"&&y.value!==`layer_${x}`]]),t.withDirectives(t.createVNode("i",{class:{"icon icon-chevron-up":!1,"icon icon-chevron-right":y.value===`layer_${x}`,"is-opened":d.value}},null),[[t.vShow,!m.value&&s!=="overflowContainer"]])]),S?t.withDirectives(t.createVNode("div",{class:`${K.b()}-item-horizontal-wrapper ${K.b()}-item-horizontal-wrapper-hidden`,ref:B},[(i=(r=l.slots).default)==null?void 0:i.call(r)]),[[t.vShow,!e.disabled]]):t.createVNode(Ne,null,{default:()=>{var p,u;return[t.withDirectives(t.createVNode("div",{class:[`${x}-menu-item-vertical-wrapper`],ref:A},[(u=(p=l.slots).default)==null?void 0:u.call(p)]),[[t.vShow,d.value]])]}})]),[[t.vShow,n.value]])}}});const Ee={width:{type:String,default:""},collapsed:{type:Boolean,default:!1},collapsedIndent:{type:Number,default:24},indentSize:{type:Number,default:24},multiple:{type:Boolean,default:!1},openKeys:{type:Array,default:[]},defaultSelectKeys:{type:Array,default:[]},mode:{type:String,default:"vertical"},router:{type:Boolean,default:!1},disableOverflowStyle:{type:Boolean,default:!1}};var De="";const M={};class Me{constructor(l){ce(this,"rootMenuName");this.rootMenuName=l}on(l,n){var s;((s=M==null?void 0:M[this.rootMenuName])==null?void 0:s[l])||Reflect.set(M[this.rootMenuName],l,[]),M[this.rootMenuName][l].push(n)}emit(l,...n){M[this.rootMenuName][l].forEach(s=>s(...n))}off(l,n){const s=M[this.rootMenuName][l].indexOf(n);s>=0&&M[this.rootMenuName][l].splice(s,1)}}function Ve(e){return M[e]||Reflect.set(M,e,{}),new Me(e)}var G=t.defineComponent({name:"DMenu",props:Ee,emits:["select","deselect","submenu-change"],setup(e,l){const n=E("menu"),{openKeys:s,mode:a,collapsed:o,defaultSelectKeys:d,router:f}=t.toRefs(e),m=ae(16),v=Ve(m);t.provide("menuStore",v),t.provide("isCollapsed",o),t.provide("defaultIndent",e.indentSize),t.provide("multiple",e.multiple),t.provide("openKeys",s),t.provide("defaultSelectKey",d),t.provide("mode",a),t.provide("collapsedIndent",e.collapsedIndent),t.provide("rootMenuEmit",l.emit),t.provide("useRouter",f),ue(e.indentSize);const A=t.ref(null),w=t.ref(0),S=t.ref(null),V=`${n.b()}-item-select`,B=t.computed(()=>({[`${n.b()}`]:!0,[`${n.b()}-vertical`]:a.value==="vertical",[`${n.b()}-horizontal`]:a.value==="horizontal",[`${n.b()}-collapsed`]:o.value})),z=t.reactive({[V]:!1,[`${n.b()}-overflow-container`]:!0}),L=N=>{const $=Array.from(N.children);for(const y of $)if(y.classList.contains(V)){z[V]=!0;break}else z[V]=!1};return t.onMounted(()=>{var N;if(e.mode==="horizontal"){let $=!1;const y=(N=S.value)==null?void 0:N.$el,c=A.value,b=c.children,r=y.children[1],i=new IntersectionObserver(p=>{p.forEach(u=>{if(!u.isIntersecting&&!e.disableOverflowStyle){const g=u.target.cloneNode(!0);u.target.classList.contains(`${n.b()}-overflow-container`)?$&&u.target.previousElementSibling&&r.children.length?c.appendChild(u.target.previousElementSibling):$=!0:(w.value+=1,u.target.style.visibility="hidden",y.nextSibling?c.insertBefore(u.target,y.nextSibling):c.appendChild(u.target),r.appendChild(g),L(r))}else if(!u.target.classList.contains(`${n.b()}-overflow-container`)&&u.target.style.visibility==="hidden"){i.unobserve(u.target),c.insertBefore(u.target,y),u.target.style.visibility="";const g=y.previousElementSibling;if(g&&u.boundingClientRect.width%u.target.getBoundingClientRect().width===0&&i.observe(g),g==null?void 0:g.classList.contains("devui-submenu")){const ie=g,re=g.children[1];ie.addEventListener("mouseenter",O=>{O.stopPropagation(),k("mouseenter",O,re)}),ie.addEventListener("mouseleave",O=>{O.stopPropagation(),k("mouseleave",O,re)})}w.value-=1,i.observe(u.target),r.lastChild&&r.removeChild(r.lastChild),L(r)}})},{root:c,threshold:1,rootMargin:"8px"});for(let p=0;p<b.length;p++)i.observe(b[p])}}),()=>{var N,$;return t.createVNode("ul",{ref:A,class:B.value,style:[e.collapsed?`width:${e.collapsedIndent*2}px`:`width: ${e.width}`]},[($=(N=l.slots).default)==null?void 0:$.call(N),t.withDirectives(t.createVNode(U,{ref:S,key:"overflowContainer",title:"...",class:z},null),[[t.vShow,w.value>0&&a.value==="horizontal"&&!e.disableOverflowStyle]])])}}}),Ae={title:"Menu \u83DC\u5355",category:"\u5BFC\u822A",status:"100%",install(e){e.component(G.name,G),e.component(Z.name,Z),e.component(U.name,U)}};h.Menu=G,h.MenuItem=Z,h.SubMenu=U,h.default=Ae,Object.defineProperty(h,"__esModule",{value:!0}),h[Symbol.toStringTag]="Module"});
|
package/menu/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-menu-vertical a,.devui-menu-vertical a:hover,.devui-menu-vertical a:active,.devui-menu-vertical a:visited,.devui-menu-horizontal a,.devui-menu-horizontal a:hover,.devui-menu-horizontal a:active,.devui-menu-horizontal a:visited{text-decoration:none}.devui-menu-vertical ul,.devui-menu-vertical li,.devui-menu-horizontal ul,.devui-menu-horizontal li{list-style:none;white-space:nowrap}.devui-menu-horizontal{display:flex;box-sizing:border-box;line-height:var(--devui-line-height-base, 1.5);background:var(--devui-global-bg-normal);padding:14px 20px}.devui-menu-horizontal .devui-menu-item{display:flex;position:relative;box-sizing:content-box;padding:0 20px!important;line-height:24px;cursor:pointer}.devui-menu-horizontal .devui-menu-item:after{content:"";display:block;position:absolute;left:20px;right:20px;bottom:0;width:auto;height:2px}.devui-menu-horizontal :after{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));background:transparent}.devui-menu-horizontal .devui-menu-item-select .devui-submenu-title-content,.devui-menu-horizontal .devui-menu-active-parent .devui-submenu-title-content{color:var(--devui-menu-item-hover)}.devui-menu-horizontal .devui-menu-item-select:after,.devui-menu-horizontal .devui-menu-active-parent:after{display:block;position:absolute;left:20px;right:20px;bottom:0;width:auto;height:2px;content:"";opacity:1;background:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-menu-item span,.devui-menu-horizontal .devui-menu-item a{color:var(--devui-text, #252b3a)}.devui-menu-horizontal .devui-menu-item:hover span,.devui-menu-horizontal .devui-menu-item:hover a{color:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-menu-item:hover:after{background:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-submenu{margin:0;padding:0;position:relative}.devui-menu-horizontal .devui-submenu div.devui-submenu-title{padding:0 20px}.devui-menu-horizontal .devui-submenu div.devui-submenu-title span{margin:0}.devui-menu-horizontal .devui-submenu div.devui-submenu-title .icon-chevron-up,.devui-menu-horizontal .devui-submenu div.devui-submenu-title .icon-chevron-right{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-horizontal .devui-submenu:after{content:"";display:block;position:absolute;left:20px;right:20px;bottom:0;width:auto;height:2px}.devui-menu-horizontal .devui-submenu:hover{cursor:pointer}.devui-menu-horizontal .devui-submenu:hover:after{background:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-submenu:hover>div>i.icon-chevron-up{transform:rotate(180deg)}.devui-menu-horizontal .devui-submenu:hover>div>i.icon-chevron-right{transform:rotate(180deg)}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1)),left 0 linear;background:var(--devui-global-bg-normal);z-index:var(--devui-z-index-modal, 1050)}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));opacity:1;visibility:visible;max-height:100vh;padding:10px 0!important;border-radius:8px;position:absolute}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-menu-item{margin-top:5px}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-submenu{margin:5px 0;padding:0 20px!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-submenu div.devui-submenu-title{padding:0!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-menu-item-horizontal-wrapper-level .devui-submenu{padding:0 20px!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));visibility:hidden;position:absolute;padding:0!important;max-height:0;overflow:hidden;opacity:0}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden .devui-menu-item{margin-top:5px}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden .devui-submenu{margin:5px 0;padding:0 20px!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden .devui-submenu div.devui-submenu-title{padding:0!important}.devui-menu-horizontal .devui-menu-item-disabled span,.devui-menu-horizontal .devui-menu-item-disabled a,.devui-menu-horizontal .devui-submenu-disabled span,.devui-menu-horizontal .devui-submenu-disabled a{color:var(--devui-menu-disabled)!important;cursor:not-allowed}.devui-menu-horizontal .devui-menu-item-disabled:after,.devui-menu-horizontal .devui-submenu-disabled:after{content:unset!important}.devui-menu-horizontal .devui-menu-item-disabled+.devui-menu-item-horizontal-wrapper,.devui-menu-horizontal .devui-submenu-disabled+.devui-menu-item-horizontal-wrapper{display:none}.devui-submenu-menu-item-vertical-wrapper{overflow:hidden}.devui-submenu-menu-item{color:var(--devui-menu-item)}.devui-menu-vertical{padding:0;transition:width var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1)),padding var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));border-right:var(--devui-line, #d7d8da) 1px solid}.devui-menu-vertical :after{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));background:transparent}.devui-menu-vertical .layer_1{margin:0!important}.devui-menu-vertical .layer_2>div.devui-submenu-title{margin:0!important;background:var(--devui-block, #ffffff)}.devui-menu-vertical.devui-menu-collapsed .devui-menu-icon{margin:auto}.devui-menu-vertical.devui-menu-collapsed ul li{display:none!important}.devui-menu-vertical.devui-menu-collapsed .devui-submenu div.devui-submenu-title .devui-menu-icon{margin:auto}.devui-menu-vertical .devui-menu-item-vertical-wrapper{padding-left:0!important}.devui-menu-vertical .devui-menu-item{width:100%;height:40px;flex-grow:1;line-height:40px;cursor:pointer;color:var(--devui-menu-item);background:var(--devui-block, #ffffff);display:flex;transition:background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-vertical .devui-menu-item:hover{color:var(--devui-list-item-hover-text, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.devui-menu-vertical .devui-menu-item span:nth-child(2){text-align:left}.devui-menu-vertical div:not(.devui-submenu-menu-item-vertical-wrapper){display:flex;flex:auto}.devui-menu-vertical .devui-menu-item:after{display:block;position:absolute;right:0;top:0;transform:scaleX(0);content:"";opacity:1;background:var(--devui-primary-hover, #5e7ce0)}.devui-menu-vertical ul.devui-submenu{margin:0;padding:0}.devui-menu-vertical ul.devui-submenu .devui-menu-item{display:flex}.devui-menu-vertical ul.devui-submenu .devui-menu-item>span{flex:auto;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));color:var(--devui-menu-item)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title{display:flex;cursor:pointer;width:100%;height:40px;margin:4px 0;line-height:40px;padding-left:18px;align-items:center;color:var(--devui-menu-item);transition:background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title:hover{color:var(--devui-list-item-hover-text, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title:nth-child(1){font-size:var(--devui-font-size-lg, 14px)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title span.devui-submenu-title-content{font-size:var(--devui-font-size-lg, 14px);flex:auto;color:var(--devui-menu-item)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title span.devui-menu-icon{text-align:center}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title .icon-chevron-up{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title i.icon-chevron-up.is-opened{transform:rotate(180deg)}.devui-menu-vertical ul.devui-submenu .devui-submenu-title:hover span{color:var(--devui-menu-item-hover)!important}.devui-menu-vertical ul.devui-submenu .devui-menu-item:hover span{color:var(--devui-menu-item-hover)}.devui-menu-vertical ul.devui-submenu .devui-menu-item-select *{color:var(--devui-menu-item-hover)!important}.devui-menu-vertical .devui-menu-item-select{background:var(--devui-primary-bg, #f2f5fc)!important;position:relative}.devui-menu-vertical .devui-menu-item-select span,.devui-menu-vertical .devui-menu-item-select a{color:var(--devui-menu-item-hover)}.devui-menu-vertical .devui-menu-item-select:after{display:block;position:absolute;right:0;top:0;height:100%;width:4px;content:"";opacity:1;background:var(--devui-brand, #5e7ce0);transform:scaleX(1)}.devui-menu-vertical .devui-menu-item:hover{color:var(--devui-menu-item-hover)}.devui-menu-vertical li.devui-menu-item,.devui-menu-vertical div.devui-submenu-title{white-space:nowrap;overflow:hidden}.devui-menu-vertical li.devui-menu-item span:nth-child(2),.devui-menu-vertical div.devui-submenu-title span:nth-child(2){overflow:hidden;text-overflow:ellipsis}.devui-menu-vertical li.devui-menu-item span:nth-child(2) span,.devui-menu-vertical div.devui-submenu-title span:nth-child(2) span{overflow:hidden;text-overflow:ellipsis}.devui-menu-vertical .devui-menu-item-isCollapsed{width:fit-content}.devui-menu-vertical .devui-menu-item-isCollapsed .devui-menu-icon{margin:auto}.devui-menu-vertical ul li~ul>div{margin-top:0!important}.devui-menu-vertical .devui-menu-item-disabled *,.devui-menu-vertical .devui-submenu-disabled *{color:var(--devui-menu-disabled)!important;cursor:not-allowed!important;background:var(--devui-block, #ffffff)!important}.devui-menu-vertical .devui-menu-item-disabled:after,.devui-menu-vertical .devui-submenu-disabled:after{content:unset}.devui-menu-icon+span{margin-left:10px}.devui-menu-item-disabled:hover,.devui-submenu-disabled:hover{color:var(--devui-menu-disabled)!important;cursor:not-allowed!important}.devui-submenu-disabled:hover span{color:var(--devui-menu-disabled)!important}.fade-enter-active,.fade-leave-active{transition:opacity var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1))}.fade-leave-to{display:none}.fade-enter-from,.fade-leave-to{opacity:0}.devui-menu-item-disabled,.devui-menu-item-disabled.devui-menu-vertical .devui-menu-item-disabled.devui-menu-item-select .devui-submenu-disabled,.devui-submenu-disabled.devui-menu-vertical,.devui-submenu-disabled.devui-menu-item-select{color:var(--devui-menu-disabled)!important;cursor:not-allowed!important}
|
|
1
|
+
.devui-menu-vertical a,.devui-menu-vertical a:hover,.devui-menu-vertical a:active,.devui-menu-vertical a:visited,.devui-menu-horizontal a,.devui-menu-horizontal a:hover,.devui-menu-horizontal a:active,.devui-menu-horizontal a:visited{text-decoration:none}.devui-menu-vertical ul,.devui-menu-vertical li,.devui-menu-horizontal ul,.devui-menu-horizontal li{list-style:none;white-space:nowrap}.devui-menu-horizontal{display:flex;box-sizing:border-box;line-height:var(--devui-line-height-base, 1.5);background:var(--devui-global-bg-normal);padding:14px 20px}.devui-menu-horizontal .devui-menu-item{display:flex;position:relative;box-sizing:content-box;padding:0 20px!important;line-height:24px;cursor:pointer}.devui-menu-horizontal .devui-menu-item:after{content:"";display:block;position:absolute;left:20px;right:20px;bottom:0;width:auto;height:2px}.devui-menu-horizontal :after{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));background:transparent}.devui-menu-horizontal .devui-menu-item-select .devui-submenu-title-content,.devui-menu-horizontal .devui-menu-active-parent .devui-submenu-title-content{color:var(--devui-menu-item-hover)}.devui-menu-horizontal .devui-menu-item-select:after,.devui-menu-horizontal .devui-menu-active-parent:after{display:block;position:absolute;left:20px;right:20px;bottom:0;width:auto;height:2px;content:"";opacity:1;background:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-menu-item span,.devui-menu-horizontal .devui-menu-item a{color:var(--devui-text, #252b3a)}.devui-menu-horizontal .devui-menu-item:hover span,.devui-menu-horizontal .devui-menu-item:hover a{color:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-menu-item:hover:after{background:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-submenu{margin:0;padding:0;position:relative}.devui-menu-horizontal .devui-submenu div.devui-submenu-title{padding:0 20px}.devui-menu-horizontal .devui-submenu div.devui-submenu-title span{margin:0}.devui-menu-horizontal .devui-submenu div.devui-submenu-title .icon-chevron-up,.devui-menu-horizontal .devui-submenu div.devui-submenu-title .icon-chevron-right{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-horizontal .devui-submenu:after{content:"";display:block;position:absolute;left:20px;right:20px;bottom:0;width:auto;height:2px}.devui-menu-horizontal .devui-submenu:hover{cursor:pointer}.devui-menu-horizontal .devui-submenu:hover:after{background:var(--devui-brand, #5e7ce0)}.devui-menu-horizontal .devui-submenu:hover>div>i.icon-chevron-up{transform:rotate(180deg)}.devui-menu-horizontal .devui-submenu:hover>div>i.icon-chevron-right{transform:rotate(180deg)}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1)),left 0 linear;background:var(--devui-global-bg-normal);z-index:var(--devui-z-index-modal, 1050)}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));opacity:1;visibility:visible;max-height:100vh;padding:10px 0!important;border-radius:8px;position:absolute}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-menu-item{margin-top:5px}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-submenu{margin:5px 0;padding:0 20px!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-submenu div.devui-submenu-title{padding:0!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-show .devui-menu-item-horizontal-wrapper-level .devui-submenu{padding:0 20px!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));visibility:hidden;position:absolute;padding:0!important;max-height:0;overflow:hidden;opacity:0}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden .devui-menu-item{margin-top:5px}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden .devui-submenu{margin:5px 0;padding:0 20px!important}.devui-menu-horizontal .devui-submenu div.devui-menu-item-horizontal-wrapper-hidden .devui-submenu div.devui-submenu-title{padding:0!important}.devui-menu-horizontal .devui-menu-item-disabled span,.devui-menu-horizontal .devui-menu-item-disabled a,.devui-menu-horizontal .devui-submenu-disabled span,.devui-menu-horizontal .devui-submenu-disabled a{color:var(--devui-menu-disabled)!important;cursor:not-allowed}.devui-menu-horizontal .devui-menu-item-disabled:after,.devui-menu-horizontal .devui-submenu-disabled:after{content:unset!important}.devui-menu-horizontal .devui-menu-item-disabled+.devui-menu-item-horizontal-wrapper,.devui-menu-horizontal .devui-submenu-disabled+.devui-menu-item-horizontal-wrapper{display:none}.devui-submenu-menu-item-vertical-wrapper{overflow:hidden}.devui-submenu-menu-item{color:var(--devui-menu-item)}.devui-menu-vertical{padding:0;transition:width var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1)),padding var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));border-right:var(--devui-line, #d7d8da) 1px solid}.devui-menu-vertical :after{transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));background:transparent}.devui-menu-vertical .layer_1{margin:0!important}.devui-menu-vertical .layer_2>div.devui-submenu-title{margin:0!important;background:var(--devui-block, #ffffff)}.devui-menu-vertical.devui-menu-collapsed .devui-menu-icon{margin:auto}.devui-menu-vertical.devui-menu-collapsed ul li{display:none!important}.devui-menu-vertical.devui-menu-collapsed .devui-submenu div.devui-submenu-title .devui-menu-icon{margin:auto}.devui-menu-vertical .devui-menu-item-vertical-wrapper{padding-left:0!important;margin:4px 0!important}.devui-menu-vertical .devui-menu-item{width:100%;height:40px;flex-grow:1;line-height:40px;cursor:pointer;color:var(--devui-menu-item);background:var(--devui-block, #ffffff);display:flex;transition:background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-vertical .devui-menu-item:hover{color:var(--devui-list-item-hover-text, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.devui-menu-vertical .devui-menu-item span:nth-child(2){text-align:left}.devui-menu-vertical div:not(.devui-submenu-menu-item-vertical-wrapper){display:flex;flex:auto}.devui-menu-vertical .devui-menu-item:after{display:block;position:absolute;right:0;top:0;transform:scaleX(0);content:"";opacity:1;background:var(--devui-primary-hover, #5e7ce0)}.devui-menu-vertical ul.devui-submenu{margin:0;padding:0}.devui-menu-vertical ul.devui-submenu .devui-menu-item{display:flex}.devui-menu-vertical ul.devui-submenu .devui-menu-item>span{flex:auto;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transition:all var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1));color:var(--devui-menu-item)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title{display:flex;cursor:pointer;width:100%;height:40px;line-height:40px;padding-left:18px;align-items:center;color:var(--devui-menu-item);transition:background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title:hover{color:var(--devui-list-item-hover-text, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title:nth-child(1){font-size:var(--devui-font-size-lg, 14px)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title span.devui-submenu-title-content{font-size:var(--devui-font-size-lg, 14px);flex:auto;color:var(--devui-menu-item)}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title span.devui-menu-icon{text-align:center}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title .icon-chevron-up{transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-vertical ul.devui-submenu div.devui-submenu-title i.icon-chevron-up.is-opened{transform:rotate(180deg)}.devui-menu-vertical ul.devui-submenu .devui-submenu-title:hover span{color:var(--devui-menu-item-hover)!important}.devui-menu-vertical ul.devui-submenu .devui-menu-item:hover span{color:var(--devui-menu-item-hover)}.devui-menu-vertical ul.devui-submenu .devui-menu-item-select *{color:var(--devui-menu-item-hover)!important}.devui-menu-vertical .devui-menu-item-select{background:var(--devui-primary-bg, #f2f5fc)!important;position:relative}.devui-menu-vertical .devui-menu-item-select span,.devui-menu-vertical .devui-menu-item-select a{color:var(--devui-menu-item-hover)}.devui-menu-vertical .devui-menu-item-select:after{display:block;position:absolute;right:0;top:0;height:100%;width:4px;content:"";opacity:1;background:var(--devui-brand, #5e7ce0);transform:scaleX(1)}.devui-menu-vertical .devui-menu-item:hover{color:var(--devui-menu-item-hover)}.devui-menu-vertical li.devui-menu-item,.devui-menu-vertical div.devui-submenu-title{white-space:nowrap;overflow:hidden}.devui-menu-vertical li.devui-menu-item span:nth-child(2),.devui-menu-vertical div.devui-submenu-title span:nth-child(2){overflow:hidden;text-overflow:ellipsis}.devui-menu-vertical li.devui-menu-item span:nth-child(2) span,.devui-menu-vertical div.devui-submenu-title span:nth-child(2) span{overflow:hidden;text-overflow:ellipsis}.devui-menu-vertical .devui-menu-item-isCollapsed{width:fit-content}.devui-menu-vertical .devui-menu-item-isCollapsed .devui-menu-icon{margin:auto}.devui-menu-vertical ul li~ul>div{margin-top:0!important}.devui-menu-vertical .devui-menu-item-disabled *,.devui-menu-vertical .devui-submenu-disabled *{color:var(--devui-menu-disabled)!important;cursor:not-allowed!important;background:var(--devui-block, #ffffff)!important}.devui-menu-vertical .devui-menu-item-disabled:after,.devui-menu-vertical .devui-submenu-disabled:after{content:unset}.devui-menu-vertical .devui-menu__arrow-icon{width:16px;height:16px;transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-menu-vertical .devui-menu__arrow-icon path{fill:var(--devui-text-weak, #575d6c)}.devui-menu-vertical .devui-menu__arrow-icon.is-opened{transform:rotate(180deg)}.devui-menu-icon+span{margin-left:10px}.devui-menu-item-disabled:hover,.devui-submenu-disabled:hover{color:var(--devui-menu-disabled)!important;cursor:not-allowed!important}.devui-submenu-disabled:hover span{color:var(--devui-menu-disabled)!important}.fade-enter-active,.fade-leave-active{transition:opacity var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1))}.fade-leave-to{display:none}.fade-enter-from,.fade-leave-to{opacity:0}.devui-menu-item-disabled,.devui-menu-item-disabled.devui-menu-vertical .devui-menu-item-disabled.devui-menu-item-select .devui-submenu-disabled,.devui-submenu-disabled.devui-menu-vertical,.devui-submenu-disabled.devui-menu-item-select{color:var(--devui-menu-disabled)!important;cursor:not-allowed!important}
|
package/modal/index.es.js
CHANGED
|
@@ -711,27 +711,33 @@ var ModalBody = defineComponent({
|
|
|
711
711
|
});
|
|
712
712
|
function CloseIcon() {
|
|
713
713
|
return createVNode("svg", {
|
|
714
|
-
"width": "
|
|
715
|
-
"height": "
|
|
714
|
+
"width": "18px",
|
|
715
|
+
"height": "18px",
|
|
716
716
|
"viewBox": "0 0 16 16",
|
|
717
717
|
"version": "1.1",
|
|
718
718
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
719
719
|
}, [createVNode("g", {
|
|
720
|
+
"id": "modal-close",
|
|
720
721
|
"stroke": "none",
|
|
721
722
|
"stroke-width": "1",
|
|
722
723
|
"fill": "none",
|
|
723
724
|
"fill-rule": "evenodd"
|
|
725
|
+
}, [createVNode("g", {
|
|
726
|
+
"transform": "translate(3.000000, 3.000000)",
|
|
727
|
+
"fill": "#71757F",
|
|
728
|
+
"fill-rule": "nonzero",
|
|
729
|
+
"id": "modal-close-road"
|
|
724
730
|
}, [createVNode("path", {
|
|
725
|
-
"d": `
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
}, null)])]);
|
|
731
|
+
"d": `M-0.353553391,-0.353553391 C-0.179987039,-0.527119742 0.0894373624,-0.546404893 0.284305503,-0.411408841 L0.353553391,-0.353553391
|
|
732
|
+
L10.3535534,9.64644661 C10.5488155,9.84170876 10.5488155,10.1582912 10.3535534,10.3535534 C10.179987,10.5271197 9.91056264,10.5464049
|
|
733
|
+
9.7156945,10.4114088 L9.64644661,10.3535534 L-0.353553391,0.353553391 C-0.548815536,0.158291245 -0.548815536,-0.158291245
|
|
734
|
+
-0.353553391,-0.353553391 Z`
|
|
735
|
+
}, null), createVNode("path", {
|
|
736
|
+
"d": `M9.64644661,-0.353553391 C9.84170876,-0.548815536 10.1582912,-0.548815536 10.3535534,-0.353553391 C10.5271197,-0.179987039
|
|
737
|
+
10.5464049,0.0894373624 10.4114088,0.284305503 L10.3535534,0.353553391 L0.353553391,10.3535534 C0.158291245,10.5488155
|
|
738
|
+
-0.158291245,10.5488155 -0.353553391,10.3535534 C-0.527119742,10.179987 -0.546404893,9.91056264 -0.411408841,9.7156945 L-0.353553391,9.64644661
|
|
739
|
+
L9.64644661,-0.353553391 Z`
|
|
740
|
+
}, null)])])]);
|
|
735
741
|
}
|
|
736
742
|
var modal = "";
|
|
737
743
|
var Modal = defineComponent({
|
package/modal/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var we=Object.defineProperty,ge=Object.defineProperties;var be=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var T=(c,e,u)=>e in c?we(c,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):c[e]=u,$=(c,e)=>{for(var u in e||(e={}))_.call(e,u)&&T(c,u,e[u]);if(P)for(var u of P(e))q.call(e,u)&&T(c,u,e[u]);return c},I=(c,e)=>ge(c,be(e));var W=(c,e)=>{var u={};for(var b in c)_.call(c,b)&&e.indexOf(b)<0&&(u[b]=c[b]);if(c!=null&&P)for(var b of P(c))e.indexOf(b)<0&&q.call(c,b)&&(u[b]=c[b]);return u};var G=(c,e,u)=>(T(c,typeof e!="symbol"?e+"":e,u),u);(function(c,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):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue,c.dom))})(this,function(c,e,u){"use strict";const b={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function},escapable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showAnimation:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!0},type:{type:String,default:""},keepLast:{type:Boolean,default:!1}},K={name:{type:String,default:""},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]}},Z={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function O(t,o,n){let l=t;return o&&(l+=`__${o}`),n&&(l+=`--${n}`),l}function C(t,o=!1){const n=o?`.devui-${t}`:`devui-${t}`;return{b:()=>O(n),e:r=>r?O(n,r):"",m:r=>r?O(n,"",r):"",em:(r,d)=>r&&d?O(n,r,d):""}}var Ve="",J=e.defineComponent({name:"DSvgIcon",props:Z,setup(t){const{name:o,color:n,size:l}=e.toRefs(t),a=C("svg-icon"),i=e.computed(()=>`#icon-${o.value}`),s=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:s.value,height:s.value};return()=>e.createVNode("svg",{class:a.b(),style:r},[e.createVNode("use",{"xlink:href":i.value,fill:n.value},null)])}});function Q(t){return/^((http|https):)?\/\//.test(t)}function ee(t,o){const{component:n,name:l,size:a,color:i,classPrefix:s,rotate:r}=e.toRefs(t),d=C("icon"),f=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),m=n.value?e.resolveDynamicComponent(n.value):e.resolveDynamicComponent(J),p=()=>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"&&d.m("spin")],style:{width:f.value||"",transform:`rotate(${r==null?void 0:r.value}deg)`,verticalAlign:"middle"}},o.attrs),null),h=()=>e.createVNode(m,e.mergeProps({name:l.value,color:i.value,size:f.value,class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null),v=()=>{const g=/^icon-/.test(l.value)?l.value:`${s.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[s.value,g,(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{fontSize:f.value,color:i.value,transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null)};return{iconDom:()=>n.value?h():Q(l.value)?p():v()}}var R=e.defineComponent({name:"DIcon",props:K,emits:["click"],setup(t,o){const{disabled:n,operable:l}=e.toRefs(t),{iconDom:a}=ee(t,o),i=C("icon"),s=e.computed(()=>({[i.e("container")]:!0,[i.m("disabled")]:n.value,[i.m("operable")]:l.value,[i.m("no-slots")]:!Object.keys(o.slots).length})),r=d=>{n.value||o.emit("click",d)};return()=>{var d,f,m,p;return e.createVNode("div",{class:s.value,onClick:r},[(f=(d=o.slots).prefix)==null?void 0:f.call(d),a(),(p=(m=o.slots).suffix)==null?void 0:p.call(m)])}}}),Ee="";e.defineComponent({name:"DIconGroup",setup(t,o){const n=C("icon-group");return()=>{var l,a;return e.createVNode("div",{class:n.b()},[(a=(l=o.slots).default)==null?void 0:a.call(l)])}}});const te={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function z(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const t=document.documentElement.scrollTop,o=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${t}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{o?document.documentElement.setAttribute("style",o):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=t}}}function oe(t,o){let n;const l=i=>{i.preventDefault(),o.emit("click",i),t.closeOnClickOverlay&&o.emit("update:modelValue",!1)},a=()=>{n==null||n()};return e.watch(()=>t.modelValue,i=>{i?t.lockScroll&&(n=z()):a()}),e.onUnmounted(a),{onClick:l}}var Ne="";const ne=e.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:te,emits:["update:modelValue","click"],setup(t,o){const{modelValue:n}=e.toRefs(t),l=C("fixed-overlay"),{onClick:a}=oe(t,o);return()=>e.createVNode(e.Transition,{name:l.m("fade")},{default:()=>{var i,s;return[n.value&&e.createVNode("div",e.mergeProps({class:l.b()},o.attrs,{onClick:a}),[(s=(i=o.slots).default)==null?void 0:s.call(i)])]}})}}),le={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},clickEventBubble:{type:Boolean,default:!1}};function ae(t){const o=/(auto|scroll|hidden)/;for(let n=t;n=n.parentElement;n.parentElement!==document.body){const l=window.getComputedStyle(n);if(o.test(l.overflow+l.overflowX+l.overflowY))return n}return window}function re(t,o,n,l){let{x:a,y:i}=o;if(!t){const{width:s,height:r}=l;a&&n.includes("start")&&(a=12),a&&n.includes("end")&&(a=Math.round(s-24)),i&&n.includes("start")&&(i=10),i&&n.includes("end")&&(i=r-14)}return{x:a,y:i}}function ie(t,o){const n=e.ref(),l=e.ref();let a=null;const i=(r,d,f,m)=>{const{x:p,y:h}=re(t.isArrowCenter,f,d,m.getBoundingClientRect()),v={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];Object.assign(r.style,{left:p?`${p}px`:"",top:h?`${h}px`:"",right:"",bottom:"",[v]:"-4px"})},s=async()=>{const r=t.origin,d=e.unref(n.value),f=e.unref(l.value),m=[u.offset(t.offset),u.autoPlacement({alignment:t.align,allowedPlacements:t.position})];if(t.showArrow&&m.push(u.arrow({element:f})),t.shiftOffset!==void 0&&m.push(u.shift()),!d)return;const{x:p,y:h,placement:v,middlewareData:w}=await u.computePosition(r,d,{strategy:"fixed",middleware:m});let g=p,V=h;if(t.shiftOffset!==void 0){const{x:N,y:x}=w.shift;N<0&&(g-=t.shiftOffset),N>0&&(g+=t.shiftOffset),x<0&&(V-=t.shiftOffset),x>0&&(V+=t.shiftOffset)}o("positionChange",v),Object.assign(d.style,{top:`${V}px`,left:`${g}px`}),t.showArrow&&i(f,v,w.arrow,d)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(a=ae(t.origin),e.nextTick(s),a==null||a.addEventListener("scroll",s),a!==window&&window.addEventListener("scroll",s),window.addEventListener("resize",s)):(a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s))}),e.onUnmounted(()=>{a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),{arrowRef:l,overlayRef:n,updatePosition:s}}var xe="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:le,emits:["update:modelValue","positionChange"],setup(t,{slots:o,attrs:n,emit:l,expose:a}){const i=C("flexible-overlay"),{clickEventBubble:s}=e.toRefs(t),{arrowRef:r,overlayRef:d,updatePosition:f}=ie(t,l);return a({updatePosition:f}),()=>{var m;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:d,class:i.b()},n,{onClick:e.withModifiers(()=>({}),[s.value?"":"stop"]),onPointerup:e.withModifiers(()=>({}),["stop"])}),[(m=o.default)==null?void 0:m.call(o),t.showArrow&&e.createVNode("div",{ref:r,class:i.e("arrow")},null)])}}});const se=typeof window!="undefined";function ce(t,o){function n(){o("update:modelValue",!1),o("close")}function l(){t.beforeClose?t.beforeClose(n):n()}function a(i){i.code==="Escape"&&l()}return e.onMounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),e.onUnmounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),{execClose:l}}function de(t){let o;const n=()=>{o==null||o()};e.watch(()=>t.modelValue,l=>{l?t.lockScroll&&(o=z()):n()},{immediate:!0}),e.onUnmounted(n)}function F(t,o="px"){return t?typeof t=="string"?t:typeof t=="number"?`${t}${o}`:"":""}const ue=(t,o,n)=>{const l=e.ref("translate(-50%, -50%)");let a={offsetX:0,offsetY:0};const i=f=>{const m=f.clientX,p=f.clientY,{offsetX:h,offsetY:v}=a,w=t.value.getBoundingClientRect(),g=w.left,V=w.top,N=w.width,x=w.height,E=document.documentElement.clientWidth,y=document.documentElement.clientHeight,S=-g+h,ye=-V+v,he=E-g-N+h,ve=y-V-x+v,X=U=>{const H=Math.min(Math.max(h+U.clientX-m,S),he),j=Math.min(Math.max(v+U.clientY-p,ye),ve);a={offsetX:H,offsetY:j},l.value=`translate(calc(-50% + ${F(H)}), calc(-50% + ${F(j)}))`},Y=()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",Y)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",Y)},s=()=>{o.value&&t.value&&o.value.addEventListener("mousedown",i)},r=()=>{o.value&&t.value&&o.value.removeEventListener("mousedown",i)};return e.onMounted(()=>{e.watchEffect(()=>{n.value?s():r()})}),e.onBeforeUnmount(()=>{r()}),{clearPosition:()=>{a={offsetX:0,offsetY:0},l.value="translate(-50%, -50%)"},modalPosition:l}};var L=e.defineComponent({name:"DModalHeader",setup(t,{slots:o}){const n=C("modal");return()=>{var l;return e.createVNode("div",{class:n.e("header")},[(l=o.default)==null?void 0:l.call(o)])}}}),M=e.defineComponent({name:"DModalBody",setup(t,{slots:o}){const n=C("modal");return()=>{var l;return e.createVNode("div",{class:n.e("body")},[(l=o.default)==null?void 0:l.call(o)])}}});function fe(){return e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:`M14.6887175,1.25368865 C15.0770801,1.64205125 15.0121881,2.34244569 14.544513,2.81012074 L9.383,7.971 L14.544513,13.1322854
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var ge=Object.defineProperty,ve=Object.defineProperties;var be=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var T=(c,e,u)=>e in c?ge(c,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):c[e]=u,$=(c,e)=>{for(var u in e||(e={}))_.call(e,u)&&T(c,u,e[u]);if(P)for(var u of P(e))q.call(e,u)&&T(c,u,e[u]);return c},I=(c,e)=>ve(c,be(e));var W=(c,e)=>{var u={};for(var b in c)_.call(c,b)&&e.indexOf(b)<0&&(u[b]=c[b]);if(c!=null&&P)for(var b of P(c))e.indexOf(b)<0&&q.call(c,b)&&(u[b]=c[b]);return u};var G=(c,e,u)=>(T(c,typeof e!="symbol"?e+"":e,u),u);(function(c,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):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue,c.dom))})(this,function(c,e,u){"use strict";const b={modelValue:{type:Boolean,default:!1},title:{type:String,default:""},lockScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},beforeClose:{type:Function},escapable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showAnimation:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!0},type:{type:String,default:""},keepLast:{type:Boolean,default:!1}},K={name:{type:String,default:""},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]}},Z={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function M(t,o,n){let l=t;return o&&(l+=`__${o}`),n&&(l+=`--${n}`),l}function V(t,o=!1){const n=o?`.devui-${t}`:`devui-${t}`;return{b:()=>M(n),e:r=>r?M(n,r):"",m:r=>r?M(n,"",r):"",em:(r,d)=>r&&d?M(n,r,d):""}}var Ce="",J=e.defineComponent({name:"DSvgIcon",props:Z,setup(t){const{name:o,color:n,size:l}=e.toRefs(t),a=V("svg-icon"),i=e.computed(()=>`#icon-${o.value}`),s=e.computed(()=>typeof l.value=="number"?`${l.value}px`:l.value),r={width:s.value,height:s.value};return()=>e.createVNode("svg",{class:a.b(),style:r},[e.createVNode("use",{"xlink:href":i.value,fill:n.value},null)])}});function Q(t){return/^((http|https):)?\/\//.test(t)}function ee(t,o){const{component:n,name:l,size:a,color:i,classPrefix:s,rotate:r}=e.toRefs(t),d=V("icon"),f=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),m=n.value?e.resolveDynamicComponent(n.value):e.resolveDynamicComponent(J),p=()=>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"&&d.m("spin")],style:{width:f.value||"",transform:`rotate(${r==null?void 0:r.value}deg)`,verticalAlign:"middle"}},o.attrs),null),h=()=>e.createVNode(m,e.mergeProps({name:l.value,color:i.value,size:f.value,class:[(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null),w=()=>{const v=/^icon-/.test(l.value)?l.value:`${s.value}-${l.value}`;return e.createVNode("i",e.mergeProps({class:[s.value,v,(r==null?void 0:r.value)==="infinite"&&d.m("spin")],style:{fontSize:f.value,color:i.value,transform:`rotate(${r==null?void 0:r.value}deg)`}},o.attrs),null)};return{iconDom:()=>n.value?h():Q(l.value)?p():w()}}var R=e.defineComponent({name:"DIcon",props:K,emits:["click"],setup(t,o){const{disabled:n,operable:l}=e.toRefs(t),{iconDom:a}=ee(t,o),i=V("icon"),s=e.computed(()=>({[i.e("container")]:!0,[i.m("disabled")]:n.value,[i.m("operable")]:l.value,[i.m("no-slots")]:!Object.keys(o.slots).length})),r=d=>{n.value||o.emit("click",d)};return()=>{var d,f,m,p;return e.createVNode("div",{class:s.value,onClick:r},[(f=(d=o.slots).prefix)==null?void 0:f.call(d),a(),(p=(m=o.slots).suffix)==null?void 0:p.call(m)])}}}),Ee="";e.defineComponent({name:"DIconGroup",setup(t,o){const n=V("icon-group");return()=>{var l,a;return e.createVNode("div",{class:n.b()},[(a=(l=o.slots).default)==null?void 0:a.call(l)])}}});const te={modelValue:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}};function z(){if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const t=document.documentElement.scrollTop,o=document.documentElement.getAttribute("style");return document.documentElement.style.position="fixed",document.documentElement.style.top=`-${t}px`,document.documentElement.style.width=document.documentElement.style.width||"100%",document.documentElement.style.overflowY="scroll",()=>{o?document.documentElement.setAttribute("style",o):document.documentElement.removeAttribute("style"),document.documentElement.scrollTop=t}}}function oe(t,o){let n;const l=i=>{i.preventDefault(),o.emit("click",i),t.closeOnClickOverlay&&o.emit("update:modelValue",!1)},a=()=>{n==null||n()};return e.watch(()=>t.modelValue,i=>{i?t.lockScroll&&(n=z()):a()}),e.onUnmounted(a),{onClick:l}}var Ne="";const ne=e.defineComponent({name:"DFixedOverlay",inheritAttrs:!1,props:te,emits:["update:modelValue","click"],setup(t,o){const{modelValue:n}=e.toRefs(t),l=V("fixed-overlay"),{onClick:a}=oe(t,o);return()=>e.createVNode(e.Transition,{name:l.m("fade")},{default:()=>{var i,s;return[n.value&&e.createVNode("div",e.mergeProps({class:l.b()},o.attrs,{onClick:a}),[(s=(i=o.slots).default)==null?void 0:s.call(i)])]}})}}),le={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},clickEventBubble:{type:Boolean,default:!1}};function ae(t){const o=/(auto|scroll|hidden)/;for(let n=t;n=n.parentElement;n.parentElement!==document.body){const l=window.getComputedStyle(n);if(o.test(l.overflow+l.overflowX+l.overflowY))return n}return window}function re(t,o,n,l){let{x:a,y:i}=o;if(!t){const{width:s,height:r}=l;a&&n.includes("start")&&(a=12),a&&n.includes("end")&&(a=Math.round(s-24)),i&&n.includes("start")&&(i=10),i&&n.includes("end")&&(i=r-14)}return{x:a,y:i}}function ie(t,o){const n=e.ref(),l=e.ref();let a=null;const i=(r,d,f,m)=>{const{x:p,y:h}=re(t.isArrowCenter,f,d,m.getBoundingClientRect()),w={top:"bottom",right:"left",bottom:"top",left:"right"}[d.split("-")[0]];Object.assign(r.style,{left:p?`${p}px`:"",top:h?`${h}px`:"",right:"",bottom:"",[w]:"-4px"})},s=async()=>{const r=t.origin,d=e.unref(n.value),f=e.unref(l.value),m=[u.offset(t.offset),u.autoPlacement({alignment:t.align,allowedPlacements:t.position})];if(t.showArrow&&m.push(u.arrow({element:f})),t.shiftOffset!==void 0&&m.push(u.shift()),!d)return;const{x:p,y:h,placement:w,middlewareData:g}=await u.computePosition(r,d,{strategy:"fixed",middleware:m});let v=p,C=h;if(t.shiftOffset!==void 0){const{x:N,y:x}=g.shift;N<0&&(v-=t.shiftOffset),N>0&&(v+=t.shiftOffset),x<0&&(C-=t.shiftOffset),x>0&&(C+=t.shiftOffset)}o("positionChange",w),Object.assign(d.style,{top:`${C}px`,left:`${v}px`}),t.showArrow&&i(f,w,g.arrow,d)};return e.watch(()=>t.modelValue,()=>{t.modelValue&&t.origin?(a=ae(t.origin),e.nextTick(s),a==null||a.addEventListener("scroll",s),a!==window&&window.addEventListener("scroll",s),window.addEventListener("resize",s)):(a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s))}),e.onUnmounted(()=>{a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),{arrowRef:l,overlayRef:n,updatePosition:s}}var xe="";e.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:le,emits:["update:modelValue","positionChange"],setup(t,{slots:o,attrs:n,emit:l,expose:a}){const i=V("flexible-overlay"),{clickEventBubble:s}=e.toRefs(t),{arrowRef:r,overlayRef:d,updatePosition:f}=ie(t,l);return a({updatePosition:f}),()=>{var m;return t.modelValue&&e.createVNode("div",e.mergeProps({ref:d,class:i.b()},n,{onClick:e.withModifiers(()=>({}),[s.value?"":"stop"]),onPointerup:e.withModifiers(()=>({}),["stop"])}),[(m=o.default)==null?void 0:m.call(o),t.showArrow&&e.createVNode("div",{ref:r,class:i.e("arrow")},null)])}}});const se=typeof window!="undefined";function ce(t,o){function n(){o("update:modelValue",!1),o("close")}function l(){t.beforeClose?t.beforeClose(n):n()}function a(i){i.code==="Escape"&&l()}return e.onMounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),e.onUnmounted(()=>{t.escapable&&window.addEventListener("keydown",a)}),{execClose:l}}function de(t){let o;const n=()=>{o==null||o()};e.watch(()=>t.modelValue,l=>{l?t.lockScroll&&(o=z()):n()},{immediate:!0}),e.onUnmounted(n)}function F(t,o="px"){return t?typeof t=="string"?t:typeof t=="number"?`${t}${o}`:"":""}const ue=(t,o,n)=>{const l=e.ref("translate(-50%, -50%)");let a={offsetX:0,offsetY:0};const i=f=>{const m=f.clientX,p=f.clientY,{offsetX:h,offsetY:w}=a,g=t.value.getBoundingClientRect(),v=g.left,C=g.top,N=g.width,x=g.height,E=document.documentElement.clientWidth,y=document.documentElement.clientHeight,A=-v+h,ye=-C+w,he=E-v-N+h,we=y-C-x+w,X=U=>{const H=Math.min(Math.max(h+U.clientX-m,A),he),j=Math.min(Math.max(w+U.clientY-p,ye),we);a={offsetX:H,offsetY:j},l.value=`translate(calc(-50% + ${F(H)}), calc(-50% + ${F(j)}))`},Y=()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",Y)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",Y)},s=()=>{o.value&&t.value&&o.value.addEventListener("mousedown",i)},r=()=>{o.value&&t.value&&o.value.removeEventListener("mousedown",i)};return e.onMounted(()=>{e.watchEffect(()=>{n.value?s():r()})}),e.onBeforeUnmount(()=>{r()}),{clearPosition:()=>{a={offsetX:0,offsetY:0},l.value="translate(-50%, -50%)"},modalPosition:l}};var O=e.defineComponent({name:"DModalHeader",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("header")},[(l=o.default)==null?void 0:l.call(o)])}}}),B=e.defineComponent({name:"DModalBody",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("body")},[(l=o.default)==null?void 0:l.call(o)])}}});function fe(){return e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{id:"modal-close",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(3.000000, 3.000000)",fill:"#71757F","fill-rule":"nonzero",id:"modal-close-road"},[e.createVNode("path",{d:`M-0.353553391,-0.353553391 C-0.179987039,-0.527119742 0.0894373624,-0.546404893 0.284305503,-0.411408841 L0.353553391,-0.353553391
|
|
2
|
+
L10.3535534,9.64644661 C10.5488155,9.84170876 10.5488155,10.1582912 10.3535534,10.3535534 C10.179987,10.5271197 9.91056264,10.5464049
|
|
3
|
+
9.7156945,10.4114088 L9.64644661,10.3535534 L-0.353553391,0.353553391 C-0.548815536,0.158291245 -0.548815536,-0.158291245
|
|
4
|
+
-0.353553391,-0.353553391 Z`},null),e.createVNode("path",{d:`M9.64644661,-0.353553391 C9.84170876,-0.548815536 10.1582912,-0.548815536 10.3535534,-0.353553391 C10.5271197,-0.179987039
|
|
5
|
+
10.5464049,0.0894373624 10.4114088,0.284305503 L10.3535534,0.353553391 L0.353553391,10.3535534 C0.158291245,10.5488155
|
|
6
|
+
-0.158291245,10.5488155 -0.353553391,10.3535534 C-0.527119742,10.179987 -0.546404893,9.91056264 -0.411408841,9.7156945 L-0.353553391,9.64644661
|
|
7
|
+
L9.64644661,-0.353553391 Z`},null)])])])}var Oe="",L=e.defineComponent({name:"DModal",inheritAttrs:!1,props:b,emits:["update:modelValue","close"],setup(t,{slots:o,attrs:n,emit:l}){const a=V("modal"),{modelValue:i,title:s,showClose:r,showOverlay:d,appendToBody:f,closeOnClickOverlay:m,keepLast:p}=e.toRefs(t),{execClose:h}=ce(t,l);de(t);const w=e.ref(),g=e.ref(),v=e.computed(()=>t.draggable),{clearPosition:C,modalPosition:N}=ue(w,g,v);e.watch(i,E=>{E&&!p.value&&(C(),e.nextTick(()=>{const y=document==null?void 0:document.querySelector("[autofocus]");y&&y.focus()}))});const x=()=>{const y=[{type:"success",text:"\u6210\u529F",icon:"right-o",color:"var(--devui-success)"},{type:"failed",text:"\u9519\u8BEF",icon:"error-o",color:"var(--devui-danger)"},{type:"warning",text:"\u8B66\u544A",icon:"warning-o",color:"var(--devui-warning)"},{type:"info",text:"\u4FE1\u606F",icon:"info-o",color:"var(--devui-info)"}].find(A=>A.type===t.type);return e.createVNode("div",{style:{cursor:t.draggable?"move":"default"},ref:g},[e.createVNode(O,null,{default:()=>[e.createVNode("div",{class:"type-content"},[e.createVNode("div",{class:"type-content-icon"},[e.createVNode(R,{name:y==null?void 0:y.icon,color:y==null?void 0:y.color},null)]),e.createVNode("div",{class:"type-content-text"},[y==null?void 0:y.text])])]})])};return()=>e.createVNode(e.Teleport,{to:"body",disabled:!f.value},{default:()=>[d.value&&e.createVNode(ne,e.mergeProps({modelValue:i.value},{"onUpdate:modelValue":h},{class:a.e("overlay"),"lock-scroll":!1,"close-on-click-overlay":m.value,style:{zIndex:"calc(var(--devui-z-index-modal, 1050) - 1)"}}),null),e.createVNode(e.Transition,{name:t.showAnimation?a.m("wipe"):""},{default:()=>{var E;return[i.value&&e.createVNode("div",e.mergeProps({ref:w,class:a.b()},n,{onClick:y=>y.stopPropagation(),style:{transform:N.value}}),[r.value&&e.createVNode("div",{onClick:h,class:"btn-close"},[e.createVNode(R,{operable:!0,component:fe()},null)]),t.type?x():e.createVNode("div",{style:{cursor:t.draggable?"move":"default"},ref:g},[o.header?o.header():s.value&&e.createVNode(O,null,{default:()=>[s.value]})]),e.createVNode(B,null,{default:()=>{var y;return[(y=o.default)==null?void 0:y.call(o)]}}),(E=o.footer)==null?void 0:E.call(o)])]}})]})}}),D=e.defineComponent({name:"DModalFooter",setup(t,{slots:o}){const n=V("modal");return()=>{var l;return e.createVNode("div",{class:n.e("footer")},[(l=o.default)==null?void 0:l.call(o)])}}});class me{constructor(o){this.anchorContainer=o}renderModal(o,n,l){const a=e.h(this.component(),n,l);return e.render(a,o),a}renderNull(o){setTimeout(()=>{e.render(null,o)},500)}}let k;class S extends me{component(){return L}open(o={}){const n=document.createElement("div");this.anchorContainer.appendChild(n);const m=o,{header:l,content:a,footer:i}=m,s=W(m,["header","content","footer"]),r=(p,h)=>this.renderModal(n,I($({},p),{modelValue:!0,"onUpdate:modelValue":h}),{header:l,default:a,footer:i}),d=()=>{var h,w,g;const p=v=>{v||d()};r(s,v=>{v?r(s,p):(this.renderModal(n,I($({},s),{modelValue:!1})),this.renderNull(n))}),(g=(w=(h=k==null?void 0:k.component)==null?void 0:h.exposed)==null?void 0:w.handleVisibleChange)==null||g.call(w,!1)},f=p=>{p||d()};return this.renderModal(n,{modelValue:!1}),k=r(s,f),{hide:d}}}G(S,"token","MODAL_SERVICE_TOKEN");var pe={title:"Modal \u5F39\u7A97",category:"\u53CD\u9988",status:"100%",install(t){if(t.component(L.name,L),t.component(O.name,O),t.component(B.name,B),t.component(D.name,D),!se)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(S.token,new S(o))}};c.Modal=L,c.ModalBody=B,c.ModalFooter=D,c.ModalHeader=O,c.default=pe,c.modalProps=b,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|
package/package.json
CHANGED
package/pagination/index.es.js
CHANGED
|
@@ -5732,6 +5732,10 @@ const formItemProps = {
|
|
|
5732
5732
|
extraInfo: {
|
|
5733
5733
|
type: String,
|
|
5734
5734
|
default: ""
|
|
5735
|
+
},
|
|
5736
|
+
isAsyncValidate: {
|
|
5737
|
+
type: Boolean,
|
|
5738
|
+
default: false
|
|
5735
5739
|
}
|
|
5736
5740
|
};
|
|
5737
5741
|
const FORM_ITEM_TOKEN = "dFormItem";
|
|
@@ -6536,7 +6540,6 @@ var FormControl = defineComponent({
|
|
|
6536
6540
|
const formControl2 = ref();
|
|
6537
6541
|
const popoverRef = ref();
|
|
6538
6542
|
const ns2 = useNamespace("form");
|
|
6539
|
-
const showPopoverClick = ref(true);
|
|
6540
6543
|
const {
|
|
6541
6544
|
controlClasses,
|
|
6542
6545
|
controlContainerClasses,
|
|
@@ -6560,27 +6563,6 @@ var FormControl = defineComponent({
|
|
|
6560
6563
|
}
|
|
6561
6564
|
return void 0;
|
|
6562
6565
|
});
|
|
6563
|
-
const onDocumentClick = (e) => {
|
|
6564
|
-
const composedPath = e.composedPath();
|
|
6565
|
-
if (composedPath.includes(popoverRef.value.triggerEl)) {
|
|
6566
|
-
showPopoverClick.value = true;
|
|
6567
|
-
} else {
|
|
6568
|
-
showPopoverClick.value = false;
|
|
6569
|
-
}
|
|
6570
|
-
};
|
|
6571
|
-
watch(showPopover, (val) => {
|
|
6572
|
-
if (val) {
|
|
6573
|
-
setTimeout(() => {
|
|
6574
|
-
document.addEventListener("click", onDocumentClick);
|
|
6575
|
-
});
|
|
6576
|
-
} else {
|
|
6577
|
-
showPopoverClick.value = true;
|
|
6578
|
-
document.removeEventListener("click", onDocumentClick);
|
|
6579
|
-
}
|
|
6580
|
-
});
|
|
6581
|
-
onUnmounted(() => {
|
|
6582
|
-
document.removeEventListener("click", onDocumentClick);
|
|
6583
|
-
});
|
|
6584
6566
|
return () => createVNode("div", {
|
|
6585
6567
|
"class": controlClasses.value,
|
|
6586
6568
|
"ref": formControl2
|
|
@@ -6588,7 +6570,7 @@ var FormControl = defineComponent({
|
|
|
6588
6570
|
"class": controlContainerClasses.value
|
|
6589
6571
|
}, [createVNode(Popover, {
|
|
6590
6572
|
"ref": popoverRef,
|
|
6591
|
-
"is-open": showPopover.value
|
|
6573
|
+
"is-open": showPopover.value,
|
|
6592
6574
|
"trigger": "manually",
|
|
6593
6575
|
"content": errorMessage.value,
|
|
6594
6576
|
"pop-type": "error",
|
|
@@ -7718,7 +7700,9 @@ function useFormItemValidate(props, _rules) {
|
|
|
7718
7700
|
callback == null ? void 0 : callback(true);
|
|
7719
7701
|
return true;
|
|
7720
7702
|
}
|
|
7721
|
-
|
|
7703
|
+
if (props.isAsyncValidate) {
|
|
7704
|
+
validateState.value = "pending";
|
|
7705
|
+
}
|
|
7722
7706
|
return execValidate(rules2).then(() => {
|
|
7723
7707
|
callback == null ? void 0 : callback(true);
|
|
7724
7708
|
return true;
|
|
@@ -8328,8 +8312,7 @@ const commonProps = {
|
|
|
8328
8312
|
default: void 0
|
|
8329
8313
|
},
|
|
8330
8314
|
size: {
|
|
8331
|
-
type: String
|
|
8332
|
-
default: "md"
|
|
8315
|
+
type: String
|
|
8333
8316
|
},
|
|
8334
8317
|
showGlowStyle: {
|
|
8335
8318
|
type: Boolean,
|
|
@@ -8529,7 +8512,7 @@ function useCheckboxGroup(props, ctx2) {
|
|
|
8529
8512
|
formItemContext == null ? void 0 : formItemContext.validate("change").catch(() => {
|
|
8530
8513
|
});
|
|
8531
8514
|
}, { deep: true });
|
|
8532
|
-
const checkboxGroupSize = computed(() => props.size || (formContext == null ? void 0 : formContext.size) || "");
|
|
8515
|
+
const checkboxGroupSize = computed(() => props.size || (formContext == null ? void 0 : formContext.size) || "md");
|
|
8533
8516
|
provide(checkboxGroupInjectionKey, {
|
|
8534
8517
|
disabled: toRef(props, "disabled"),
|
|
8535
8518
|
isShowTitle: toRef(props, "isShowTitle"),
|