Files
zsglpt/static/app/assets/aria-DLpFpzDe.js
2026-05-27 20:39:46 +08:00

2 lines
1.3 KiB
JavaScript

class a extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function d(t,e){throw new a(`[${t}] ${e}`)}function E(t,e){}const f="update:modelValue",l="change",b="input",u='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',o=t=>typeof Element>"u"?!1:t instanceof Element,c=t=>getComputedStyle(t).position==="fixed"?!1:t.offsetParent!==null,p=t=>Array.from(t.querySelectorAll(u)).filter(e=>i(e)&&c(e)),i=t=>{if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.tabIndex<0||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true")return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return!(t.type==="hidden"||t.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},A=function(t,e,...n){let s;e.includes("mouse")||e.includes("click")?s="MouseEvents":e.includes("key")?s="KeyboardEvent":s="HTMLEvents";const r=document.createEvent(s);return r.initEvent(e,...n),t.dispatchEvent(r),t},T=(t,e)=>{if(!t||!t.focus)return;let n=!1;o(t)&&!i(t)&&!t.getAttribute("tabindex")&&(t.setAttribute("tabindex","-1"),n=!0),t.focus(e),o(t)&&n&&t.removeAttribute("tabindex")};export{l as C,b as I,f as U,A as a,E as d,T as f,i,p as o,d as t};