PageSourceSearch

https://www.codeur.com/vite/assets/bootstrap_dropdown_controller-D4UlfGo2.js

js codeur.com collected 2026-10-02 03:26:51 UTC 6,506 bytes, 2 lines download raw bytes

1import{C as M}from"./index-DnVtRDJT.js";import{$ as e}from"./jquery-KhFK8iXK.js";import{P}from"./popper-Lu3qO3BQ.js";import{U as g}from"./util-BqlQW-Tl.js";import"./jquery-B2HoIvm_.js";const f="dropdown",R="4.6.2",_="bs.dropdown",l=".".concat(_),N=".data-api",$=e.fn[f],p=27,O=32,S=9,C=38,T=40,K=3,H=new RegExp("".concat(C,"|").concat(T,"|").concat(p)),u="disabled",a="show",V="dropup",Y="dropright",k="dropleft",w="dropdown-menu-right",F="position-static",b="hide".concat(l),D="hidden".concat(l),U="show".concat(l),x="shown".concat(l),W="click".concat(l),m="click".concat(l).concat(N),L="keydown".concat(l).concat(N),j="keyup".concat(l).concat(N),d='[data-toggle="dropdown"]',v=".dropdown form",A=".dropdown-menu",B=".navbar-nav",q=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",G="top-start",Q="top-end",J="bottom-start",X="bottom-end",z="right-start",Z="left-start",tt={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},et={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"};class r{constructor(t,s){this._element=t,this._popper=null,this._config=this._getConfig(s),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}static get VERSION(){return R}static get Default(){return tt}static get DefaultType(){return et}toggle(){if(this._element.disabled||e(this._element).hasClass(u))return;const t=e(this._menu).hasClass(a);r._clearMenus(),!t&&this.show(!0)}show(t=!1){if(this._element.disabled||e(this._element).hasClass(u)||e(this._menu).hasClass(a))return;const s={relatedTarget:this._element},n=e.Event(U,s),i=r._getParentFromElement(this._element);if(e(i).trigger(n),!n.isDefaultPrevented()){if(!this._inNavbar&&t){if(typeof P>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let o=this._element;this._config.reference==="parent"?o=i:g.isElement(this._config.reference)&&(o=this._config.reference,typeof this._config.reference.jquery<"u"&&(o=this._config.reference[0])),this._config.boundary!=="scrollParent"&&e(i).addClass(F),this._popper=new P(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&e(i).closest(B).length===0&&e(document.body).children().on("mouseover",null,e.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),e(this._menu).toggleClass(a),e(i).toggleClass(a).trigger(e.Event(x,s))}}hide(){if(this._element.disabled||e(this._element).hasClass(u)||!e(this._menu).hasClass(a))return;const t={relatedTarget:this._element},s=e.Event(b,t),n=r._getParentFromElement(this._element);e(n).trigger(s),!s.isDefaultPrevented()&&(this._popper&&this._popper.destroy(),e(this._menu).toggleClass(a),e(n).toggleClass(a).trigger(e.Event(D,t)))}dispose(){e.removeData(this._element,_),e(this._element).off(l),this._element=null,this._menu=null,this._popper!==null&&(this._popper.destroy(),this._popper=null)}update(){this._inNavbar=this._detectNavbar(),this._popper!==null&&this._popper.scheduleUpdate()}_addEventListeners(){e(this._element).on(W,t=>{t.preventDefault(),t.stopPropagation(),this.toggle()})}_getConfig(t){return t={...this.constructor.Default,...e(this._element).data(),...t},g.typeCheckConfig(f,t,this.constructor.DefaultType),t}_getMenuElement(){if(!this._menu){const t=r._getParentFromElement(this._element);t&&(this._menu=t.querySelector(A))}return this._menu}_getPlacement(){const t=e(this._element.parentNode);let s=J;return t.hasClass(V)?s=e(this._menu).hasClass(w)?Q:G:t.hasClass(Y)?s=z:t.hasClass(k)?s=Z:e(this._menu).hasClass(w)&&(s=X),s}_detectNavbar(){return e(this._element).closest(".navbar").length>0}_getOffset(){const t={};return typeof this._config.offset=="function"?t.fn=s=>(s.offsets={...s.offsets,...this._config.offset(s.offsets,this._element)},s):t.offset=this._config.offset,t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip}
1,preventOverflow:{boundariesElement:this._config.boundary}}};return this._config.display==="static"&&(t.modifiers.applyStyle={enabled:!1}),{...t,...this._config.popperConfig}}static _jQueryInterface(t){return this.each(function(){let s=e(this).data(_);const n=typeof t=="object"?t:null;if(s||(s=new r(this,n),e(this).data(_,s)),typeof t=="string"){if(typeof s[t]>"u")throw new TypeError('No method named "'.concat(t,'"'));s[t]()}})}static _clearMenus(t){if(t&&(t.which===K||t.type==="keyup"&&t.which!==S))return;const s=[].slice.call(document.querySelectorAll(d));for(let n=0,i=s.length;n<i;n++){const o=r._getParentFromElement(s[n]),c=e(s[n]).data(_),E={relatedTarget:s[n]};if(t&&t.type==="click"&&(E.clickEvent=t),!c)continue;const I=c._menu;if(!e(o).hasClass(a)||t&&(t.type==="click"&&/input|textarea/i.test(t.target.tagName)||t.type==="keyup"&&t.which===S)&&e.contains(o,t.target))continue;const y=e.Event(b,E);e(o).trigger(y),!y.isDefaultPrevented()&&("ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),s[n].setAttribute("aria-expanded","false"),c._popper&&c._popper.destroy(),e(I).removeClass(a),e(o).removeClass(a).trigger(e.Event(D,E)))}}static _getParentFromElement(t){let s;const n=g.getSelectorFromElement(t);return n&&(s=document.querySelector(n)),s||t.parentNode}static _dataApiKeydownHandler(t){if((/input|textarea/i.test(t.target.tagName)?t.which===O||t.which!==p&&(t.which!==T&&t.which!==C||e(t.target).closest(A).length):!H.test(t.which))||this.disabled||e(this).hasClass(u))return;const s=r._getParentFromElement(this),n=e(s).hasClass(a);if(!n&&t.which===p)return;if(t.preventDefault(),t.stopPropagation(),!n||t.which===p||t.which===O){t.which===p&&e(s.querySelector(d)).trigger("focus"),e(this).trigger("click");return}const i=[].slice.call(s.querySelectorAll(q)).filter(c=>e(c).is(":visible"));if(i.length===0)return;let o=i.indexOf(t.target);t.which===C&&o>0&&o--,t.which===T&&o<i.length-1&&o++,o<0&&(o=0),i[o].focus()}}e(document).on(L,d,r._dataApiKeydownHandler).on(L,A,r._dataApiKeydownHandler).on("".concat(m," ").concat(j),r._clearMenus).on(m,d,function(h){h.preventDefault(),h.stopPropagation(),r._jQueryInterface.call(e(this),"toggle")}).on(m,v,h=>{h.stopPropagation()});e.fn[f]=r._jQueryInterface;e.fn[f].Constructor=r;e.fn[f].noConflict=()=>(e.fn[f]=$,r._jQueryInterface);class at extends M{}export{at as default};
2//# sourceMappingURL=bootstrap_dropdown_controller-D4UlfGo2.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.