PageSourceSearch

https://cdn-img.daxuesoutijiang.com/dx-college/_nuxt/vdnvoQ-f.js

js daxuesoutijiang.com collected 2026-10-01 13:04:59 UTC 6,256 bytes, 2 lines download raw bytes

1import{aj as $,r as _,o as R,ab as I,al as M,ar as Z,a7 as se,d as oe,a5 as re,D as g,i as T,n as j,aR as ae,aa as ue}from"./DC3gTA0r.js";import{i as ce}from"./CiS8iwFx.js";const ie='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',de=e=>getComputedStyle(e).position==="fixed"?!1:e.offsetParent!==null,Ae=e=>Array.from(e.querySelectorAll(ie)).filter(n=>ee(n)&&de(n)),ee=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true")return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return!(e.type==="hidden"||e.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},w="focus-trap.focus-after-trapped",O="focus-trap.focus-after-released",fe="focus-trap.focusout-prevented",q={cancelable:!0,bubbles:!1},le={cancelable:!0,bubbles:!1},W="focusAfterTrapped",J="focusAfterReleased",ve=Symbol("elFocusTrap"),N=_(),S=_(0),U=_(0);let m=0;const te=e=>{const n=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)n.push(s.currentNode);return n},X=(e,n)=>{for(const s of e)if(!Ee(s,n))return s},Ee=(e,n)=>{if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},pe=e=>{const n=te(e),s=X(n,e),o=X(n.reverse(),e);return[s,o]},be=e=>e instanceof HTMLInputElement&&"select"in e,l=(e,n)=>{if(e&&e.focus){const s=document.activeElement;let o=!1;$(e)&&!ee(e)&&!e.getAttribute("tabindex")&&(e.setAttribute("tabindex","-1"),o=!0),e.focus({preventScroll:!0}),U.value=window.performance.now(),e!==s&&be(e)&&n&&e.select(),$(e)&&o&&e.removeAttribute("tabindex")}};function Y(e,n){const s=[...e],o=e.indexOf(n);return o!==-1&&s.splice(o,1),s}const Te=()=>{let e=[];return{push:o=>{const a=e[0];a&&o!==a&&a.pause(),e=Y(e,o),e.unshift(o)},remove:o=>{var a,d;e=Y(e,o),(d=(a=e[0])==null?void 0:a.resume)==null||d.call(a)}}},me=(e,n=!1)=>{const s=document.activeElement;for(const o of e)if(l(o,n),document.activeElement!==s)return},z=Te(),Fe=()=>S.value>U.value,F=()=>{N.value="pointer",S.value=window.performance.now()},G=()=>{N.value="keyboard",S.value=window.performance.now()},ye=()=>(R(()=>{m===0&&(document.addEventListener("mousedown",F),document.addEventListener("touchstart",F),document.addEventListener("keydown",G)),m++}),I(()=>{m--,m<=0&&(document.removeEventListener("mousedown",F),document.removeEventListener("touchstart",F),document.removeEventListener("keydown",G))}),{focusReason:N,lastUserFocusTimestamp:S,lastAutomatedFocusTimestamp:U}),y=e=>new CustomEvent(fe,{...le,detail:e});let E=[];const Q=e=>{e.code===Z.esc&&E.forEach(n=>n(e))},_e=e=>{R(()=>{E.length===0&&document.addEventListener("keydown",Q),M&&E.push(e)}),I(()=>{E=E.filter(n=>n!==e),E.length===0&&M&&document.removeEventListener("keydown",Q)})},Se=oe({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[W,J,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:n}){const s=_();let o,a;const{focusReason:d}=ye();_e(t=>{e.trapped&&!v.paused&&n("release-requested",t)});const v={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},p=t=>{if(!e.loop&&!e.trapped||v.paused)return;const{code:r,altKey:u,ctrlKey:c,metaKey:i,currentTarget:B,shiftKey:V}=t,{loop:H}=e,ne=r===Z.tab&&!u&&!c&&!i,b=document.activeElement;if(ne&&b){const P=B,[C,A]=pe(P);if(C&&A){if(!V&&b===A){const f=y({focusReason:d.value});n("focusout-prevented",f),f.defaultPrevented||(t.preventDefault(),H&&l(C,!0))}else if(V&&[C,P].includes(b)){const f=y({focusReason:d.value});n("focusout-prevented",f),f.defaultPrevented||(t.preventDefault(),H&&l(A,!0))}}else if(b===P){const f=y({focusReason:d.value});n("focusout-prevented",f),f.defaultPrevented||t.preventDefault()}}};ue(ve,{focusTrapRef:s,onKeydown:p}),g(()=>e.focusTrapEl,t=>{t&&(s.value=t)},{immediate:!0}),g([s],([t],[r])=>{t&&(t.addEventListener("keydown",p),t.addEventListener("focusin",L),t.addEventListener("focusout",h)),r&&(r.removeEventListener("keydown",p),r.removeEventListener("focusin",L),r.removeEventListener("focusout",h))});const k=t=>{n(W,t)},x=t=>n(J,t),L=t=>{const r=T(s);if(!r)return;const u=t.target,c=t.relatedTarget,i=u&&r.contains(u);e.trapped||c&&r.contains(c)||(o=c),i&&n("focusin",t),!v.paused&&e.trapped&&(i?a=u:l(a,!0))},h=t=>{const r=T(s);if(!(v.paused||!r))if(e.trapped){const u=t.relatedTarget;!ce(u)&&!r.contains(u)&&setTimeout(()=>
1{if(!v.paused&&e.trapped){const c=y({focusReason:d.value});n("focusout-prevented",c),c.defaultPrevented||l(a,!0)}},0)}else{const u=t.target;u&&r.contains(u)||n("focusout",t)}};async function K(){await j();const t=T(s);if(t){z.push(v);const r=t.contains(document.activeElement)?o:document.activeElement;if(o=r,!t.contains(r)){const c=new Event(w,q);t.addEventListener(w,k),t.dispatchEvent(c),c.defaultPrevented||j(()=>{let i=e.focusStartEl;ae(i)||(l(i),document.activeElement!==i&&(i="first")),i==="first"&&me(te(t),!0),(document.activeElement===r||i==="container")&&l(t)})}}}function D(){const t=T(s);if(t){t.removeEventListener(w,k);const r=new CustomEvent(O,{...q,detail:{focusReason:d.value}});t.addEventListener(O,x),t.dispatchEvent(r),!r.defaultPrevented&&(d.value=="keyboard"||!Fe()||t.contains(document.activeElement))&&l(o??document.body),t.removeEventListener(O,x),z.remove(v)}}return R(()=>{e.trapped&&K(),g(()=>e.trapped,t=>{t?K():D()})}),I(()=>{e.trapped&&D(),s.value&&(s.value.removeEventListener("keydown",p),s.value.removeEventListener("focusin",L),s.value.removeEventListener("focusout",h),s.value=void 0)}),{onKeydown:p}}});function Le(e,n,s,o,a,d){return re(e.$slots,"default",{handleKeydown:e.onKeydown})}var ge=se(Se,[["render",Le],["__file","focus-trap.vue"]]);export{ge as E,ve as F,ee as i,Ae as o,l as t};
2//# sourceMappingURL=vdnvoQ-f.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.