@qynpm/ui 1.0.29 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -7
- package/dist/index.cjs +7 -5
- package/dist/index.mjs +70 -61
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-button/index.cjs +1 -1
- package/dist/qy-button/index.mjs +1 -1
- package/dist/qy-checkbox/index.cjs +1 -1
- package/dist/qy-checkbox/index.mjs +1 -1
- package/dist/qy-checkbox-group/index.cjs +1 -1
- package/dist/qy-checkbox-group/index.mjs +1 -1
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +1 -1
- package/dist/qy-drawer/index.cjs +1 -0
- package/dist/qy-drawer/index.mjs +5 -0
- package/dist/qy-dropdown/index.cjs +1 -1
- package/dist/qy-dropdown/index.mjs +1 -1
- package/dist/qy-file-picker/index.cjs +1 -1
- package/dist/qy-file-picker/index.mjs +1 -1
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +1 -1
- package/dist/qy-fullscreen/index.cjs +1 -1
- package/dist/qy-fullscreen/index.mjs +1 -1
- package/dist/qy-icon-picker/index.cjs +1 -1
- package/dist/qy-icon-picker/index.mjs +1 -1
- package/dist/qy-image/index.cjs +1 -1
- package/dist/qy-image/index.mjs +1 -1
- package/dist/qy-image-upload/index.cjs +1 -1
- package/dist/qy-image-upload/index.mjs +1 -1
- package/dist/qy-input/index.cjs +1 -1
- package/dist/qy-input/index.mjs +1 -1
- package/dist/qy-input-number/index.cjs +1 -1
- package/dist/qy-input-number/index.mjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
- package/dist/qy-loading/index.cjs +1 -0
- package/dist/qy-loading/index.mjs +9 -0
- package/dist/qy-menu-actions/index.cjs +1 -1
- package/dist/qy-menu-actions/index.mjs +1 -1
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +1 -1
- package/dist/qy-radio/index.cjs +1 -1
- package/dist/qy-radio/index.mjs +1 -1
- package/dist/qy-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/index.mjs +1 -1
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +1 -1
- package/dist/qy-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +1 -1
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +1 -1
- package/dist/qy-result/index.cjs +1 -0
- package/dist/qy-result/index.mjs +7 -0
- package/dist/qy-scrollbar/index.cjs +1 -1
- package/dist/qy-scrollbar/index.mjs +1 -1
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +1 -1
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +1 -1
- package/dist/qy-selection-dialog/index.cjs +1 -1
- package/dist/qy-selection-dialog/index.mjs +1 -1
- package/dist/qy-switch/index.cjs +1 -1
- package/dist/qy-switch/index.mjs +1 -1
- package/dist/qy-table-column-settings/index.cjs +1 -1
- package/dist/qy-table-column-settings/index.mjs +1 -1
- package/dist/qy-tag/index.cjs +1 -1
- package/dist/qy-tag/index.mjs +1 -1
- package/dist/qy-tree/index.cjs +1 -1
- package/dist/qy-tree/index.mjs +1 -1
- package/dist/qy-tree-select/index.cjs +1 -1
- package/dist/qy-tree-select/index.mjs +1 -1
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +1 -1
- package/dist/shared/{index-C7V-LeFg.mjs → index-1LT6Q6XJ.mjs} +1 -1
- package/dist/shared/{index-DHJf8Zto.mjs → index-B0zL9hEY.mjs} +1 -1
- package/dist/shared/index-B1zDCCqy.mjs +78 -0
- package/dist/shared/{index-B9RYNZUh.cjs → index-BWDaV6FO.cjs} +1 -1
- package/dist/shared/{index-Czrv5jUt.mjs → index-BmJPEXUM.mjs} +1 -1
- package/dist/shared/{index-DJT4yz0h.mjs → index-CaDqecpT.mjs} +8 -8
- package/dist/shared/{index-BNQxyXzB.cjs → index-D-YyFaZ6.cjs} +1 -1
- package/dist/shared/{index-DjyaOKUS.cjs → index-D5DmmUX2.cjs} +1 -1
- package/dist/shared/{index-C509sCx9.cjs → index-DqsG1Mam.cjs} +1 -1
- package/dist/shared/index-Dvf1zJ7h.cjs +1 -0
- package/dist/shared/index-gcsw_rtX.mjs +3529 -0
- package/dist/shared/index-uhxRj2ZT.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BLF3RNlY.mjs +331 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXtovY1E.mjs → index.vue_vue_type_script_setup_true_lang-C91DUwOD.mjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXGjuA2f.cjs → index.vue_vue_type_script_setup_true_lang-CuXBYNXZ.cjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CUox3Lm-.mjs → index.vue_vue_type_script_setup_true_lang-DP-jqqo2.mjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-kje3Rtlw.cjs → index.vue_vue_type_script_setup_true_lang-DkDEcB4G.cjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-S6QPMZay.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-BTqKOZ4L.cjs → index.vue_vue_type_style_index_0_lang-CL_IFx-Z.cjs} +1 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CUqnwExG.mjs +80 -0
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-Bc-Ya_zS.mjs → index.vue_vue_type_style_index_0_lang-DXQ9l1XF.mjs} +1 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-lmRmXLwB.cjs +1 -0
- package/index.d.ts +39 -1
- package/package.json +459 -440
- package/qy-alert/index.d.ts +64 -64
- package/qy-autocomplete/index.d.ts +5 -5
- package/qy-avatar/index.d.ts +67 -67
- package/qy-badge/index.d.ts +63 -63
- package/qy-card/index.d.ts +64 -64
- package/qy-cascader/index.d.ts +198 -198
- package/qy-collapse/index.d.ts +59 -59
- package/qy-collapse-item/index.d.ts +45 -45
- package/qy-descriptions/index.d.ts +47 -47
- package/qy-descriptions-item/index.d.ts +46 -46
- package/qy-dialog/index.d.ts +60 -2
- package/qy-divider/index.d.ts +53 -53
- package/qy-drawer/index.d.ts +55 -0
- package/qy-empty/index.d.ts +51 -51
- package/qy-image/index.d.ts +28 -28
- package/qy-image-preview/index.d.ts +20 -20
- package/qy-link/index.d.ts +69 -69
- package/qy-loading/index.d.ts +25 -0
- package/qy-menu-actions/index.d.ts +29 -29
- package/qy-progress/index.d.ts +74 -74
- package/qy-result/index.d.ts +64 -0
- package/qy-scrollbar/index.d.ts +85 -85
- package/qy-skeleton/index.d.ts +54 -54
- package/qy-skeleton-item/index.d.ts +48 -48
- package/qy-step/index.d.ts +55 -55
- package/qy-steps/index.d.ts +62 -62
- package/qy-tab-pane/index.d.ts +40 -40
- package/qy-table-column-settings/index.d.ts +18 -18
- package/qy-tabs/index.d.ts +84 -84
- package/qy-tree/index.d.ts +132 -132
- package/qy-tree-select/index.d.ts +123 -123
- package/dist/shared/index-BQj_q6rA.mjs +0 -3446
- package/dist/shared/index-qwzyfx9S.cjs +0 -1
- /package/dist/shared/{index-D7A0RzWH.cjs → index-BDdhBEFr.cjs} +0 -0
- /package/dist/shared/{index-PlyLRNmb.cjs → index-Bmw9BNXm.cjs} +0 -0
- /package/dist/shared/{index-UGOgNLvm.cjs → index-BpI0jwYK.cjs} +0 -0
- /package/dist/shared/{index-C2n0R6rA.mjs → index-Bs2OQHXk.mjs} +0 -0
- /package/dist/shared/{index-DA3GVIZY.cjs → index-BxvS3vlc.cjs} +0 -0
- /package/dist/shared/{index-DMiZy6gD.cjs → index-Bxz4crCd.cjs} +0 -0
- /package/dist/shared/{index-YsBzyp9n.mjs → index-C-ZAw_DP.mjs} +0 -0
- /package/dist/shared/{index-CUITnlPr.mjs → index-C31wpivi.mjs} +0 -0
- /package/dist/shared/{index-BqV6vW9P.cjs → index-CCZttbsg.cjs} +0 -0
- /package/dist/shared/{index-mTWXYnLm.mjs → index-CmRclPWX.mjs} +0 -0
- /package/dist/shared/{index-DvA3Wy_F.mjs → index-Co0_4YEV.mjs} +0 -0
- /package/dist/shared/{index-YM4DcbBZ.cjs → index-CwzztWPU.cjs} +0 -0
- /package/dist/shared/{index-WP9Dbscv.mjs → index-D6ybNdgn.mjs} +0 -0
- /package/dist/shared/{index-CtF8Nz3g.mjs → index-DEZF-Fkt.mjs} +0 -0
- /package/dist/shared/{index-D30m6gKz.cjs → index-DIs6iPjF.cjs} +0 -0
- /package/dist/shared/{index-Bs6yjkZ5.cjs → index-DLLDXfic.cjs} +0 -0
- /package/dist/shared/{index-BSxEaYHx.mjs → index-D_rRdrge.mjs} +0 -0
- /package/dist/shared/{index-CR6yQfR2.mjs → index-DfR8Z9MN.mjs} +0 -0
- /package/dist/shared/{index-4cLP6sJP.cjs → index-rcu9CzSn.cjs} +0 -0
- /package/dist/shared/{index-D0L-u1nt.mjs → index-seQHtqdh.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CJaF7Ecm.mjs → index.vue_vue_type_style_index_0_lang-B-FeHatv.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CqKs13Fp.cjs → index.vue_vue_type_style_index_0_lang-Cn3P9d4L.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CC2-igG3.cjs → index.vue_vue_type_style_index_0_lang-DOfJV2oz.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Dc84vYSd.mjs → index.vue_vue_type_style_index_0_lang-DzfGx6ce.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("vue"),F=require("element-plus"),T={class:"qy-drawer__header"},x={class:"qy-drawer__header-content"},P={class:"qy-drawer__title"},N=o.defineComponent({name:"QyDrawerElementRenderer",inheritAttrs:!1,__name:"ElementDrawerRenderer",props:{id:{},modelValue:{type:Boolean},direction:{},size:{},teleportTo:{},title:{},showHeader:{type:Boolean},showClose:{type:Boolean},showOverlay:{type:Boolean},destroyOnClose:{type:Boolean},bodyPadding:{},overlayVariant:{},close:{type:Function}},emits:["opened","closed"],setup(e,{expose:n}){const t=e,a=o.computed(()=>t.bodyPadding==="none"?"qy-drawer__body--none":"qy-drawer__body--default"),y=o.computed(()=>t.overlayVariant==="transparent"?"qy-drawer__overlay--transparent":"qy-drawer__overlay--default"),d=o.computed(()=>["qy-drawer",`qy-drawer--body-${t.bodyPadding}`,`qy-drawer--overlay-${t.overlayVariant}`]),i=t.close;function m(){return typeof document>"u"?null:document.querySelector(`[data-qy-drawer-id="${t.id}"]`)}function p(){const r=m();return(r==null?void 0:r.closest(".el-overlay"))||null}return n({getPanelElement:m,getOverlayElement:p}),(r,u)=>(o.openBlock(),o.createBlock(o.unref(F.ElDrawer),{"model-value":e.modelValue,direction:e.direction,size:e.size,"append-to":e.teleportTo,title:e.title,"with-header":e.showHeader,"show-close":!1,modal:e.showOverlay,"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":e.destroyOnClose,"lock-scroll":!1,"body-class":a.value,"modal-class":y.value,class:o.normalizeClass(d.value),"data-qy-drawer-id":e.id,onOpened:u[1]||(u[1]=v=>r.$emit("opened")),onClosed:u[2]||(u[2]=v=>r.$emit("closed"))},o.createSlots({header:o.withCtx(({titleId:v})=>[o.createElementVNode("div",T,[o.createElementVNode("div",x,[o.renderSlot(r.$slots,"header",{close:o.unref(i),titleId:v},()=>[o.createElementVNode("span",P,o.toDisplayString(e.title),1)])]),e.showClose?(o.openBlock(),o.createElementBlock("button",{key:0,"data-testid":"qy-drawer-close",class:"qy-drawer__close",type:"button","aria-label":"关闭抽屉",onClick:u[0]||(u[0]=(...w)=>o.unref(i)&&o.unref(i)(...w))},[...u[3]||(u[3]=[o.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{close:o.unref(i)})]),_:2},[r.$slots.footer?{name:"footer",fn:o.withCtx(()=>[o.renderSlot(r.$slots,"footer",{close:o.unref(i)})]),key:"0"}:void 0]),1032,["model-value","direction","size","append-to","title","with-header","modal","destroy-on-close","body-class","modal-class","class","data-qy-drawer-id"]))}}),S=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed",'[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function I(){if(typeof document>"u")return null;const e=document.activeElement;return e instanceof HTMLElement?e:null}function A(e){var t,a;if(!e)return;(a=(t=e.querySelector(S)||e).focus)==null||a.call(t)}function M(e){return!!(e!=null&&e.querySelector(S))}function _(e){!e||!e.isConnected||e.focus()}const f=[],h=new Set;let C=null;function V(){return[...f].reverse().find(e=>e.isOpen())}function g(e){if(!e.isConnected)return!1;const n=window.getComputedStyle(e);return n.display!=="none"&&n.visibility!=="hidden"}function R(e){const{panel:n,overlay:t}=e.getLayerElements();return t&&g(t)?t:n&&g(n)?n:null}function B(e){const n=Number.parseInt(window.getComputedStyle(e).zIndex,10);return Number.isFinite(n)?n:0}function H(e,n){const t=B(e),a=B(n);return t!==a?t>a:!!(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)}function G(e){return Array.from(document.querySelectorAll(".el-overlay, .el-drawer, .el-dialog")).filter(g).some(t=>t===e||!t.matches(".el-overlay")&&t.closest(".el-overlay")?!1:H(t,e))}function U(e){const n=R(e);return!!(n&&!G(n))}function Z(e){return f.some(n=>n.id!==e&&n.isOpen())}function j(e){return[...f].reverse().filter(n=>n.id!==e).map(n=>n.getFocusTarget()).find(n=>n==null?void 0:n.isConnected)||null}function Q(e){return f.push(e),()=>{const n=f.indexOf(e);n>=0&&f.splice(n,1)}}function K(e){const n=f.findIndex(a=>a.id===e);if(n<0)return;const[t]=f.splice(n,1);f.push(t)}function O(e,n){if(!(typeof document>"u"||!document.body)){if(n){if(h.has(e))return;h.size===0&&(C=document.body.style.overflow),h.add(e),document.body.style.overflow="hidden";return}!h.delete(e)||h.size>0||(document.body.style.overflow=C??"",C=null)}}function W(e){if(e.key!=="Escape"&&e.code!=="Escape")return;const n=V();!n||!U(n)||(e.preventDefault(),e.stopPropagation(),n.requestClose("escape"))}function J(e){const n=V();!n||!n.isMaskTarget(e.target)||(e.preventDefault(),e.stopPropagation(),n.requestClose("mask"))}typeof window<"u"&&(window.addEventListener("keydown",W,!0),document.addEventListener("click",J,!0));const X={class:"qy-drawer__title"},Y=o.defineComponent({name:"QyDrawer",inheritAttrs:!1,__name:"index",props:{modelValue:{type:Boolean},placement:{default:"right"},size:{default:"30%"},title:{default:""},showHeader:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeOnMask:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},restoreFocus:{type:Boolean,default:!0},closeDisabled:{type:Boolean,default:!1},teleportTo:{default:"body"},bodyPadding:{default:"default"},overlayVariant:{default:"default"}},emits:["update:modelValue","close","opened","closed"],setup(e,{emit:n}){const t=e,a=n,y=o.ref(null),d=`qy-drawer-${Math.random().toString(36).slice(2,10)}`,i=o.ref(!1),m=o.ref(!1),p=o.ref(null);let r;const u=o.computed(()=>({left:"ltr",right:"rtl",top:"ttb",bottom:"btt"})[t.placement]),v=o.computed(()=>typeof t.size=="number"?`${t.size}px`:t.size),w=()=>E("close-button");function D(){return t.modelValue}function $(l){var b,q;if(!t.showOverlay||!t.closeOnMask)return!1;const s=(b=y.value)==null?void 0:b.getPanelElement(),c=(q=y.value)==null?void 0:q.getOverlayElement();return!s||!c||!(l instanceof Node)?!1:c.contains(l)&&!s.contains(l)}function E(l){!t.modelValue||t.closeDisabled||l==="mask"&&!t.closeOnMask||l==="escape"&&!t.closeOnEscape||i.value||(i.value=!0,a("update:modelValue",!1),a("close",l))}function k(){t.modelValue&&(i.value=!1,m.value=!0,p.value=I(),K(d),O(d,t.lockScroll))}function z(){!t.modelValue||!m.value||(t.autoFocus&&o.nextTick(()=>{var c;const l=((c=y.value)==null?void 0:c.getPanelElement())||null,s=(l==null?void 0:l.querySelector(".el-drawer__body"))||null;A(M(s)?s:l)}),a("opened"))}function L(){var s;if(t.modelValue||!m.value)return;m.value=!1,O(d,!1),a("closed");const l=Z(d);if(t.restoreFocus&&!l){const c=(s=p.value)!=null&&s.isConnected?p.value:j(d);_(c)}l||(p.value=null),i.value=!1}return o.watch(()=>t.modelValue,(l,s)=>{l&&k()}),o.onMounted(()=>{r=Q({id:d,isOpen:D,isMaskTarget:$,requestClose:E,getFocusTarget:()=>p.value,getLayerElements:()=>{var l,s;return{panel:((l=y.value)==null?void 0:l.getPanelElement())||null,overlay:((s=y.value)==null?void 0:s.getOverlayElement())||null}}}),k()}),o.onBeforeUnmount(()=>{r==null||r(),O(d,!1),m.value=!1}),(l,s)=>(o.openBlock(),o.createBlock(N,{ref_key:"rendererRef",ref:y,id:d,"model-value":t.modelValue,direction:u.value,size:v.value,"teleport-to":t.teleportTo,title:t.title,"show-header":t.showHeader,"show-close":t.showClose,"show-overlay":t.showOverlay,"destroy-on-close":t.destroyOnClose,"body-padding":t.bodyPadding,"overlay-variant":t.overlayVariant,close:w,onOpened:z,onClosed:L},o.createSlots({header:o.withCtx(({close:c,titleId:b})=>[o.renderSlot(l.$slots,"header",{close:c,titleId:b},()=>[o.createElementVNode("span",X,o.toDisplayString(t.title),1)])]),default:o.withCtx(()=>[o.renderSlot(l.$slots,"default",{close:w})]),_:2},[l.$slots.footer?{name:"footer",fn:o.withCtx(()=>[o.renderSlot(l.$slots,"footer",{close:w})]),key:"0"}:void 0]),1032,["model-value","direction","size","teleport-to","title","show-header","show-close","show-overlay","destroy-on-close","body-padding","overlay-variant"]))}});exports._sfc_main=Y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),E=require("./index-B6xIO6kg.cjs"),K=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),E=require("./index-B6xIO6kg.cjs"),K=require("./index-rcu9CzSn.cjs"),j=require("../qy-popover/index.cjs"),L=require("./index-AirHUQwm.cjs");function F(l,p){const f=p==null?"":String(p),n=l&&f?l.resolve(f):void 0;return Object.freeze({value:f,known:!!n,canonicalName:n==null?void 0:n.name,definition:n})}function Y(l,p,f=""){const n=(l==null?void 0:l.list())??[],c=p===void 0?void 0:new Set(p.map(r=>{var s;return(s=l==null?void 0:l.resolve(r))==null?void 0:s.name}).filter(r=>!!r).map(P)),h=String(f).trim().toLocaleLowerCase();return Object.freeze(n.filter(r=>c&&!c.has(P(r.name))?!1:h?[r.name,r.label,...r.keywords??[]].some(s=>typeof s=="string"&&s.toLocaleLowerCase().includes(h)):!0))}function P(l){return L.normalizeQyIconName(l).toLocaleLowerCase()}const W={class:"qy-icon-picker"},G=["onKeydown"],H={class:"qy-icon-picker__preview","aria-hidden":"true"},J={key:1,class:"qy-icon-picker__missing","aria-hidden":"true"},X=["id"],Z={class:"qy-icon-picker__search","data-testid":"qy-icon-picker-search"},ee=["aria-label"],ae=["id","data-qy-icon-option","data-qy-icon-active","aria-selected","tabindex","onClick","onFocus","onKeydown"],ne={class:"qy-icon-picker__option-label"},oe={key:1,class:"qy-icon-picker__empty"};let te=0;const le=e.defineComponent({name:"QyIconPicker",__name:"index",props:{modelValue:{default:""},allowedNames:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},size:{default:"default"},placeholder:{default:"点击选择图标"},searchPlaceholder:{default:"搜索图标名称、标签或关键词"},emptyText:{default:"暂无匹配图标"},panelWidth:{default:540},open:{type:Boolean,default:void 0},id:{},ariaLabel:{}},emits:["update:modelValue","change","clear","update:open","open-change"],setup(l,{expose:p,emit:f}){const n=l,c=f,h=e.inject(L.QY_ICON_REGISTRY_KEY,null),r=e.ref(""),s=e.ref(!1),i=e.ref(-1),b=e.ref([]),y=e.ref(null),x=e.ref(null),w=e.ref("pointer"),Q=`qy-icon-picker-${++te}`,v=e.computed(()=>F(h,n.modelValue)),d=e.computed(()=>Y(h,n.allowedNames,r.value)),k=e.computed(()=>n.open!==void 0),m=e.computed(()=>k.value?n.open===!0:s.value),R=e.computed(()=>"click"),g=e.computed(()=>`${n.id||Q}-panel`);e.watch(m,(a,o)=>{!a||o||(r.value="",i.value=M(),b.value=[],w.value==="keyboard"&&e.nextTick(()=>{var t,u;return(u=(t=x.value)==null?void 0:t.focus)==null?void 0:u.call(t)}))}),e.watch(d,()=>{if(!d.value.length){i.value=-1;return}i.value>=d.value.length&&(i.value=0),i.value<0&&(i.value=0)});function N(){n.disabled||(w.value="keyboard",I("keyboard"))}function T(a){n.disabled||k.value&&n.open!==!1||(a.stopImmediatePropagation(),I("pointer"))}function z(a){q(a)}function $(a){a===m.value&&(k.value||(s.value=a),c("open-change",a),a||e.nextTick(()=>{var o,t;return(t=(o=y.value)==null?void 0:o.focus)==null?void 0:t.call(o)}))}function q(a){a&&n.disabled||a!==m.value&&(k.value||(s.value=a),c("update:open",a))}function I(a="programmatic"){w.value=a,q(!0)}function B(){q(!1),e.nextTick(()=>{var a,o;return(o=(a=y.value)==null?void 0:a.focus)==null?void 0:o.call(a)})}function V(){n.disabled||(c("update:modelValue",""),c("change",""),c("clear"))}function C(a){n.disabled||(c("update:modelValue",a.name),c("change",a.name),B())}function S(a){if(a.key==="Escape"){a.preventDefault(),B();return}if(!d.value.length||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(a.key))return;a.preventDefault();const o=a.key==="ArrowUp"||a.key==="ArrowLeft"?-1:1,t=d.value.length;i.value=(i.value+o+t)%t,e.nextTick(()=>{var u;return(u=b.value[i.value])==null?void 0:u.focus()})}function M(){const a=v.value.canonicalName;if(!a)return d.value.length?0:-1;const o=d.value.findIndex(({name:t})=>t===a);return o>=0?o:d.value.length?0:-1}function A(a,o){a instanceof HTMLElement&&(b.value[o]=a)}function O(a){return`${g.value}-${encodeURIComponent(a)}`}function D(){var a,o;(o=(a=y.value)==null?void 0:a.focus)==null||o.call(a)}function U(){var a,o;(o=(a=y.value)==null?void 0:a.blur)==null||o.call(a)}return p({focus:D,blur:U,open:I,close:B}),(a,o)=>(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(e.unref(j.QyPopover),{ref:"popoverRef",class:"qy-icon-picker__popover",open:m.value,trigger:R.value,placement:"bottom-start",width:n.panelWidth,"show-delay":0,"hide-delay":0,disabled:n.disabled||k.value&&n.open===!1,"onUpdate:open":z,onOpenChange:$},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:"qy-icon-picker__trigger","data-testid":"qy-icon-picker-trigger",onClick:T,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[e.createVNode(e.unref(K.QyInput),{ref_key:"triggerRef",ref:y,id:n.id,"model-value":v.value.value,size:n.size,disabled:n.disabled,clearable:n.clearable,readonly:"",placeholder:n.placeholder,"aria-label":n.ariaLabel,"aria-haspopup":"listbox","aria-expanded":m.value?"true":"false","aria-controls":g.value,onClear:V},{prefix:e.withCtx(()=>[e.createElementVNode("span",H,[v.value.definition?(e.openBlock(),e.createBlock(e.unref(E.QyIcon),{key:0,name:v.value.definition.name,size:18},null,8,["name"])):(e.openBlock(),e.createElementBlock("span",J,"?"))])]),suffix:e.withCtx(()=>[n.clearable&&v.value.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"qy-icon-picker__clear","data-testid":"qy-icon-picker-clear","aria-label":"清空图标",onClick:e.withModifiers(V,["stop","prevent"])},[...o[1]||(o[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0)]),_:1},8,["id","model-value","size","disabled","clearable","placeholder","aria-label","aria-expanded","aria-controls"])],40,G)]),default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:g.value,class:"qy-icon-picker__panel",onKeydown:S},[e.createElementVNode("div",Z,[e.createVNode(e.unref(K.QyInput),{ref_key:"searchRef",ref:x,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=t=>r.value=t),type:"search",clearable:"",placeholder:n.searchPlaceholder,"aria-label":"搜索图标"},null,8,["modelValue","placeholder"])]),d.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-icon-picker__grid",role:"listbox","aria-label":n.ariaLabel||"图标列表"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(t,u)=>(e.openBlock(),e.createElementBlock("div",{id:O(t.name),key:t.name,ref_for:!0,ref:_=>A(_,u),class:e.normalizeClass(["qy-icon-picker__option",{"is-active":i.value===u}]),"data-qy-icon-option":t.name,"data-qy-icon-active":i.value===u?"true":void 0,role:"option","aria-selected":v.value.canonicalName===t.name?"true":"false",tabindex:i.value===u?0:-1,onClick:_=>C(t),onFocus:_=>i.value=u,onKeydown:[e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["enter"]),e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["space"])]},[e.createVNode(e.unref(E.QyIcon),{name:t.name,size:18,"aria-hidden":"true"},null,8,["name"]),e.createElementVNode("span",ne,e.toDisplayString(t.label||t.name),1)],42,ae))),128))],8,ee)):(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)])]))],40,X)):e.createCommentVNode("",!0)]),_:3},8,["open","trigger","width","disabled"])]))}});exports._sfc_main=le;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent as m, computed as a, h as s } from "vue";
|
|
2
|
+
import { ElResult as o } from "element-plus";
|
|
3
|
+
const u = ["success", "warning", "info", "error"], r = ["401", "403", "404", "500"], g = (t) => t === "class" || t === "style" || t === "id" || t === "role" || t === "title" || t.startsWith("data-") || t.startsWith("aria-"), v = {
|
|
4
|
+
status: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: "info",
|
|
7
|
+
validator: (t) => [...u, ...r].includes(t)
|
|
8
|
+
},
|
|
9
|
+
title: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
description: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
image: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
imageAlt: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
}
|
|
25
|
+
}, h = m({
|
|
26
|
+
name: "QyResult",
|
|
27
|
+
inheritAttrs: !1,
|
|
28
|
+
props: v,
|
|
29
|
+
setup(t, { attrs: l, slots: e }) {
|
|
30
|
+
const n = a(
|
|
31
|
+
() => Object.fromEntries(Object.entries(l).filter(([i]) => g(i)))
|
|
32
|
+
), c = a(() => [
|
|
33
|
+
"qy-result",
|
|
34
|
+
`qy-result--${t.status}`,
|
|
35
|
+
n.value.class
|
|
36
|
+
]), d = a(() => [
|
|
37
|
+
"qy-result__renderer",
|
|
38
|
+
`qy-result--${t.status}`
|
|
39
|
+
]), f = () => {
|
|
40
|
+
if (e.visual) return e.visual();
|
|
41
|
+
if (t.image)
|
|
42
|
+
return s("img", {
|
|
43
|
+
class: "qy-result__image",
|
|
44
|
+
src: t.image,
|
|
45
|
+
alt: t.imageAlt
|
|
46
|
+
});
|
|
47
|
+
if (r.includes(t.status))
|
|
48
|
+
return s(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
class: "qy-result__http-visual",
|
|
52
|
+
"aria-hidden": "true"
|
|
53
|
+
},
|
|
54
|
+
t.status
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
return () => {
|
|
58
|
+
const i = {};
|
|
59
|
+
return (e.visual || t.image || r.includes(t.status)) && (i.icon = f), e.title && (i.title = e.title), e.description && (i["sub-title"] = e.description), e.actions && (i.extra = e.actions), s("div", {
|
|
60
|
+
...n.value,
|
|
61
|
+
class: c.value,
|
|
62
|
+
title: t.title
|
|
63
|
+
}, [
|
|
64
|
+
s(
|
|
65
|
+
o,
|
|
66
|
+
{
|
|
67
|
+
class: d.value,
|
|
68
|
+
icon: u.includes(t.status) ? t.status : void 0,
|
|
69
|
+
title: e.title ? "" : t.title,
|
|
70
|
+
subTitle: e.description ? "" : t.description
|
|
71
|
+
},
|
|
72
|
+
i
|
|
73
|
+
)
|
|
74
|
+
]);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
h as _
|
|
80
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as oe, inject as le, ref as m, computed as _, watch as E, nextTick as L, openBlock as d, createElementBlock as f, createVNode as P, unref as q, withCtx as Q, createElementVNode as I, Fragment as te, renderList as re, withKeys as R, withModifiers as C, normalizeClass as ie, toDisplayString as O, renderSlot as ce, createTextVNode as ue, createCommentVNode as U, createBlock as se } from "vue";
|
|
2
2
|
import { Q as D } from "./index-xuTVtF4x.mjs";
|
|
3
|
-
import { Q as j } from "./index-
|
|
3
|
+
import { Q as j } from "./index-Bs2OQHXk.mjs";
|
|
4
4
|
import { QyPopover as de } from "../qy-popover/index.mjs";
|
|
5
5
|
import { n as pe, Q as fe } from "./index-CaNxcPSD.mjs";
|
|
6
6
|
function ve(l, p) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("vue"),f=require("element-plus"),n=["success","warning","info","error"],a=["401","403","404","500"],m=t=>t==="class"||t==="style"||t==="id"||t==="role"||t==="title"||t.startsWith("data-")||t.startsWith("aria-"),o={status:{type:String,default:"info",validator:t=>[...n,...a].includes(t)},title:{type:String,default:""},description:{type:String,default:""},image:{type:String,default:""},imageAlt:{type:String,default:""}},v=i.defineComponent({name:"QyResult",inheritAttrs:!1,props:o,setup(t,{attrs:r,slots:e}){const u=i.computed(()=>Object.fromEntries(Object.entries(r).filter(([s])=>m(s)))),l=i.computed(()=>["qy-result",`qy-result--${t.status}`,u.value.class]),c=i.computed(()=>["qy-result__renderer",`qy-result--${t.status}`]),d=()=>{if(e.visual)return e.visual();if(t.image)return i.h("img",{class:"qy-result__image",src:t.image,alt:t.imageAlt});if(a.includes(t.status))return i.h("div",{class:"qy-result__http-visual","aria-hidden":"true"},t.status)};return()=>{const s={};return(e.visual||t.image||a.includes(t.status))&&(s.icon=d),e.title&&(s.title=e.title),e.description&&(s["sub-title"]=e.description),e.actions&&(s.extra=e.actions),i.h("div",{...u.value,class:l.value,title:t.title},[i.h(f.ElResult,{class:c.value,icon:n.includes(t.status)?t.status:void 0,title:e.title?"":t.title,subTitle:e.description?"":t.description},s)])}}});exports._sfc_main=v;
|
package/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type QyTabPaneComponent from './qy-tab-pane'
|
|
|
19
19
|
import type QyStepsComponent from './qy-steps'
|
|
20
20
|
import type QyStepComponent from './qy-step'
|
|
21
21
|
import type QyFullscreenComponent from './qy-fullscreen'
|
|
22
|
+
import type QyDrawerComponent from './qy-drawer'
|
|
22
23
|
import type QyIconComponent from './qy-icon'
|
|
23
24
|
import type QyIconPickerComponent from './qy-icon-picker'
|
|
24
25
|
import type QyRowComponent from './qy-row'
|
|
@@ -35,6 +36,8 @@ import type QyDividerComponent from './qy-divider'
|
|
|
35
36
|
import type QyEmptyComponent from './qy-empty'
|
|
36
37
|
import type QyAlertComponent from './qy-alert'
|
|
37
38
|
import type QyCardComponent from './qy-card'
|
|
39
|
+
import type QyResultComponent from './qy-result'
|
|
40
|
+
import type QyDialogComponent from './qy-dialog'
|
|
38
41
|
import type QyScrollbarComponent from './qy-scrollbar'
|
|
39
42
|
import type QyProgressComponent from './qy-progress'
|
|
40
43
|
import type QyStatisticComponent from './qy-statistic'
|
|
@@ -174,6 +177,11 @@ export type {
|
|
|
174
177
|
QyPopoverProps,
|
|
175
178
|
QyPopoverTrigger
|
|
176
179
|
} from './qy-popover'
|
|
180
|
+
export type {
|
|
181
|
+
QyDialogCloseReason,
|
|
182
|
+
QyDialogEmits,
|
|
183
|
+
QyDialogProps
|
|
184
|
+
} from './qy-dialog'
|
|
177
185
|
export type {
|
|
178
186
|
QySkeletonAttrs,
|
|
179
187
|
QySkeletonProps,
|
|
@@ -236,6 +244,20 @@ export type {
|
|
|
236
244
|
QyFullscreenSize,
|
|
237
245
|
QyFullscreenSlots
|
|
238
246
|
} from './qy-fullscreen'
|
|
247
|
+
export type {
|
|
248
|
+
QyLoadingDirectiveOptions,
|
|
249
|
+
QyLoadingDirectiveValue,
|
|
250
|
+
QyLoadingHandle,
|
|
251
|
+
QyLoadingServiceOptions
|
|
252
|
+
} from './qy-loading'
|
|
253
|
+
export type {
|
|
254
|
+
QyDrawerCloseReason,
|
|
255
|
+
QyDrawerEmits,
|
|
256
|
+
QyDrawerPlacement,
|
|
257
|
+
QyDrawerProps,
|
|
258
|
+
QyDrawerSlotProps,
|
|
259
|
+
QyDrawerSlots
|
|
260
|
+
} from './qy-drawer'
|
|
239
261
|
export type {
|
|
240
262
|
QyIconPickerEmits,
|
|
241
263
|
QyIconPickerExposed,
|
|
@@ -344,6 +366,12 @@ export type {
|
|
|
344
366
|
QyCardShadow,
|
|
345
367
|
QyCardSlots
|
|
346
368
|
} from './qy-card'
|
|
369
|
+
export type {
|
|
370
|
+
QyResultAttrs,
|
|
371
|
+
QyResultProps,
|
|
372
|
+
QyResultSlots,
|
|
373
|
+
QyResultStatus
|
|
374
|
+
} from './qy-result'
|
|
347
375
|
export type {
|
|
348
376
|
QyScrollbarAttrs,
|
|
349
377
|
QyScrollbarDirection,
|
|
@@ -418,7 +446,7 @@ export const QyUpload: Plugin
|
|
|
418
446
|
export const QyImage: Plugin
|
|
419
447
|
export const QyImagePreview: Plugin
|
|
420
448
|
export const QyImageUpload: Plugin
|
|
421
|
-
export const QyDialog:
|
|
449
|
+
export const QyDialog: typeof QyDialogComponent
|
|
422
450
|
export const QyButton: Plugin
|
|
423
451
|
export const QyDropdown: Plugin
|
|
424
452
|
export const QyInput: typeof QyInputComponent
|
|
@@ -455,6 +483,10 @@ export const QyTabPane: typeof QyTabPaneComponent
|
|
|
455
483
|
export const QySteps: typeof QyStepsComponent
|
|
456
484
|
export const QyStep: typeof QyStepComponent
|
|
457
485
|
export const QyFullscreen: typeof QyFullscreenComponent
|
|
486
|
+
export const QyDrawer: typeof QyDrawerComponent
|
|
487
|
+
export const QyLoading: Plugin
|
|
488
|
+
export const vQyLoading: typeof import('./qy-loading').vQyLoading
|
|
489
|
+
export const openQyLoading: typeof import('./qy-loading').openQyLoading
|
|
458
490
|
export const QyIcon: typeof QyIconComponent
|
|
459
491
|
export const QyIconPicker: typeof QyIconPickerComponent
|
|
460
492
|
export const QyRow: typeof QyRowComponent
|
|
@@ -471,6 +503,7 @@ export const QyDivider: typeof QyDividerComponent
|
|
|
471
503
|
export const QyEmpty: typeof QyEmptyComponent
|
|
472
504
|
export const QyAlert: typeof QyAlertComponent
|
|
473
505
|
export const QyCard: typeof QyCardComponent
|
|
506
|
+
export const QyResult: typeof QyResultComponent
|
|
474
507
|
export const QyScrollbar: typeof QyScrollbarComponent
|
|
475
508
|
export const QyProgress: typeof QyProgressComponent
|
|
476
509
|
export const QyStatistic: typeof QyStatisticComponent
|
|
@@ -535,6 +568,10 @@ declare const _default: Plugin & {
|
|
|
535
568
|
QySteps: typeof QyStepsComponent
|
|
536
569
|
QyStep: typeof QyStepComponent
|
|
537
570
|
QyFullscreen: typeof QyFullscreenComponent
|
|
571
|
+
QyDrawer: typeof QyDrawerComponent
|
|
572
|
+
QyLoading: typeof QyLoading
|
|
573
|
+
vQyLoading: typeof vQyLoading
|
|
574
|
+
openQyLoading: typeof openQyLoading
|
|
538
575
|
QyIcon: typeof QyIconComponent
|
|
539
576
|
QyIconPicker: typeof QyIconPickerComponent
|
|
540
577
|
QyRow: typeof QyRowComponent
|
|
@@ -551,6 +588,7 @@ declare const _default: Plugin & {
|
|
|
551
588
|
QyEmpty: typeof QyEmptyComponent
|
|
552
589
|
QyAlert: typeof QyAlertComponent
|
|
553
590
|
QyCard: typeof QyCardComponent
|
|
591
|
+
QyResult: typeof QyResultComponent
|
|
554
592
|
QyScrollbar: typeof QyScrollbarComponent
|
|
555
593
|
QyProgress: typeof QyProgressComponent
|
|
556
594
|
QyStatistic: typeof QyStatisticComponent
|