芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.9/vendor/bootstrap/js/toast.min.js
import{B as BaseComponent,E as EventHandler,r as reflow,M as Manipulator,a as typeCheckConfig,d as defineJQueryPlugin}from"./dom.min.js?1629745661";const NAME="toast",DATA_KEY="bs.toast",EVENT_KEY=".bs.toast",EVENT_CLICK_DISMISS="click.dismiss.bs.toast",EVENT_MOUSEOVER="mouseover.bs.toast",EVENT_MOUSEOUT="mouseout.bs.toast",EVENT_FOCUSIN="focusin.bs.toast",EVENT_FOCUSOUT="focusout.bs.toast",EVENT_HIDE="hide.bs.toast",EVENT_HIDDEN="hidden.bs.toast",EVENT_SHOW="show.bs.toast",EVENT_SHOWN="shown.bs.toast",CLASS_NAME_FADE="fade",CLASS_NAME_HIDE="hide",CLASS_NAME_SHOW="show",CLASS_NAME_SHOWING="showing",DefaultType={animation:"boolean",autohide:"boolean",delay:"number"},Default={animation:!0,autohide:!0,delay:5e3},SELECTOR_DATA_DISMISS='[data-bs-dismiss="toast"]';class Toast extends BaseComponent{constructor(t,e){super(t),this._config=this._getConfig(e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get DefaultType(){return DefaultType}static get Default(){return Default}static get NAME(){return NAME}show(){if(EventHandler.trigger(this._element,EVENT_SHOW).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove("hide"),reflow(this._element),this._element.classList.add("showing"),this._queueCallback((()=>{this._element.classList.remove("showing"),this._element.classList.add("show"),EventHandler.trigger(this._element,EVENT_SHOWN),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this._element.classList.contains("show"))return;if(EventHandler.trigger(this._element,EVENT_HIDE).defaultPrevented)return;this._element.classList.remove("show"),this._queueCallback((()=>{this._element.classList.add("hide"),EventHandler.trigger(this._element,EVENT_HIDDEN)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),super.dispose()}_getConfig(t){return t={...Default,...Manipulator.getDataAttributes(this._element),..."object"==typeof t&&t?t:{}},typeCheckConfig(NAME,t,this.constructor.DefaultType),t}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const s=t.relatedTarget;this._element===s||this._element.contains(s)||this._maybeScheduleHide()}_setListeners(){EventHandler.on(this._element,EVENT_CLICK_DISMISS,SELECTOR_DATA_DISMISS,(()=>this.hide())),EventHandler.on(this._element,EVENT_MOUSEOVER,(t=>this._onInteraction(t,!0))),EventHandler.on(this._element,EVENT_MOUSEOUT,(t=>this._onInteraction(t,!1))),EventHandler.on(this._element,EVENT_FOCUSIN,(t=>this._onInteraction(t,!0))),EventHandler.on(this._element,EVENT_FOCUSOUT,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Toast.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}if(defineJQueryPlugin(Toast),window.bootstrap=window.bootstrap||{},window.bootstrap.Toast=Toast,Joomla&&Joomla.getOptions){const t=Joomla.getOptions("bootstrap.toast");"object"==typeof t&&null!==t&&Object.keys(t).forEach((e=>{const s=t[e],i={animation:!s.animation||s.animation,autohide:!s.autohide||s.autohide,delay:s.delay?s.delay:5e3},o=Array.from(document.querySelectorAll(e));o.length&&o.map((t=>new window.bootstrap.Toast(t,i)))}))}export{Toast as T};