PageSourceSearch

https://npm.org/wp-content/plugins/wp-tabs-pro/public/js/collapse.min.js?ver=2.1.6

js npm.org collected 2026-09-24 09:36:00 UTC 12,045 bytes, 6 lines download raw bytes

1/*!
2  * Bootstrap collapse.js v4.3.1 (https://getbootstrap.com/)
3  * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5  */
6!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],factory):(global=global||self).SP_Collapse_Pro=factory(global.jQuery,global.Util)}(this,(function($,Util){"use strict";function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter((function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable})))),ownKeys.forEach((function(key){_defineProperty(target,key,source[key])}))}return target}$=$&&$.hasOwnProperty("default")?$.default:$,Util=Util&&Util.hasOwnProperty("default")?Util.default:Util;var TRANSITION_END="transitionend",MILLISECONDS_MULTIPLIER=1e3;function toType(obj){return{}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()}function getSpecialTransitionEndEvent(){return{bindType:TRANSITION_END,delegateType:TRANSITION_END,handle:function handle(event){if($(event.target).is(this))return event.handleObj.handler.apply(this,arguments)}}}function transitionEndEmulator(duration){var _this=this,called=!1;return $(this).one(Util.TRANSITION_END,(function(){called=!0})),setTimeout((function(){called||Util.triggerTransitionEnd(_this)}),duration),this}function setTransitionEndSupport(){$.fn.emulateTransitionEnd=transitionEndEmulator,$.event.special[Util.TRANSITION_END]=getSpecialTransitionEndEvent()}var Util={TRANSITION_END:"bsTransitionEnd",getUID:function getUID(prefix){do{prefix+=~~(Math.random()*MAX_UID)}while(document.getElementById(prefix));return prefix},getSelectorFromElement:function getSelectorFromElement(element){var selector=element.getAttribute("data-target");if(!selector||"#"===selector){var forAttr=element.getAttribute("for");selector=forAttr&&"#"!==forAttr?forAttr.trim():""}try{return document.querySelector(selector)?selector:null}catch(err){return null}},getTransitionDurationFromElement:function getTransitionDurationFromElement(element){if(!element)return 0;var transitionDuration=$(element).css("transition-duration"),transitionDelay=$(element).css("transition-delay"),floatTransitionDuration=parseFloat(transitionDuration),floatTransitionDelay=parseFloat(transitionDelay);return floatTransitionDuration||floatTransitionDelay?(transitionDuration=transitionDuration.split(",")[0],transitionDelay=transitionDelay.split(",")[0],1e3*(parseFloat(transitionDuration)+parseFloat(transitionDelay))):0},reflow:function reflow(element){return element.offsetHeight},triggerTransitionEnd:function triggerTransitionEnd(element){$(element).trigger(TRANSITION_END)},supportsTransitionEnd:function supportsTransitionEnd(){return Boolean(TRANSITION_END)},isElement:function isElement(obj){return(obj[0]||obj).nodeType},typeCheckConfig:function typeCheckConfig(componentName,config,configTypes){for(var property in configTypes)if(Object.prototype.hasOwnProperty.call(configTypes,property)){var expectedTypes=configTypes[property],value=config[property],valueType=value&&Util.isElement(value)?"element":toType(value);if(!new RegExp(expectedTypes).test(valueType))throw new Error(componentName.toUpperCase()+': Option "'+property+'" provided type "'+valueType+'" but expected type "'+expectedTypes+'".')}},findShadowRoot:function findShadowRoot(element){if(!document.documentElement.attachShadow)return null;if("function"==typeof element.getRootNode){var root=element.getRootNode();return root instanceof ShadowRoot?root:null}return element instanceof ShadowRoot?element:element.parentNode?Util.findShadowRoot(element.parentNode):null}};setTransitionEndSupport();var NAME="collapse",VERSION="4.3.1",DATA_KEY="bs.collapse",EVENT_KEY="."+DATA_KEY,DATA_API_KEY=".data-api",JQUERY_NO_CONFLICT=$.fn[NAME],Default={toggle:!0,parent:""},DefaultType={toggle:"boolean",parent:"(string|element)"},Event={SHOW:"show"+EVENT_KEY,SHOWN:"shown"+EVENT_KEY,HIDE:"hide"+EVENT_KEY,HIDDEN:"hidden"+EVENT_KEY,CLICK_DATA_API:"click.bs.collapse.data-api"},ClassName_SHOW="sp-tab__show",ClassName_COLLAPSE="sp-tab__collapse",ClassName_COLLAPSING="collapsing",ClassName_COLLAPSED="collapsed",Dimension_WIDTH="width",Dimension_HEIGHT="height",Selector_ACTIVES=".sp-tab__show, .collapsing",Selector_DATA_TOGGLE='[data-sptoggle="collapse"]',SP_
6Collapse_Pro=function(){function SP_Collapse_Pro(element,config){this._isTransitioning=!1,this._element=element,this._config=this._getConfig(config),this._triggerArray=[].slice.call(document.querySelectorAll('[data-sptoggle="collapse"][for="#'+element.id+'"],[data-sptoggle="collapse"][data-target="#'+element.id+'"]'));for(var toggleList=[].slice.call(document.querySelectorAll(Selector_DATA_TOGGLE)),i=0,len=toggleList.length;i<len;i++){var elem=toggleList[i],selector=Util.getSelectorFromElement(elem),filterElement=[].slice.call(document.querySelectorAll(selector)).filter((function(foundElem){return foundElem===element}));null!==selector&&filterElement.length>0&&(this._selector=selector,this._triggerArray.push(elem))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var _proto=SP_Collapse_Pro.prototype;return _proto.toggle=function toggle(){$(this._element).hasClass(ClassName_SHOW)?this.hide():this.show()},_proto.show=function show(){var _this=this,actives,activesData;if(!this._isTransitioning&&!$(this._element).hasClass(ClassName_SHOW)&&(this._parent&&0===(actives=[].slice.call(this._parent.querySelectorAll(Selector_ACTIVES)).filter((function(elem){return"string"==typeof _this._config.parent?elem.getAttribute("data-parent")===_this._config.parent:elem.classList.contains(ClassName_COLLAPSE)}))).length&&(actives=null),!(actives&&(activesData=$(actives).not(this._selector).data(DATA_KEY))&&activesData._isTransitioning))){var startEvent=$.Event(Event.SHOW);if($(this._element).trigger(startEvent),!startEvent.isDefaultPrevented()){actives&&(SP_Collapse_Pro._jQueryInterface.call($(actives).not(this._selector),"hide"),activesData||$(actives).data(DATA_KEY,null));var dimension=this._getDimension();$(this._element).removeClass(ClassName_COLLAPSE).addClass(ClassName_COLLAPSING),this._element.style[dimension]=0,this._triggerArray.length&&$(this._triggerArray).removeClass(ClassName_COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var complete=function complete(){$(_this._element).removeClass(ClassName_COLLAPSING).addClass(ClassName_COLLAPSE).addClass(ClassName_SHOW),_this._element.style[dimension]="",_this.setTransitioning(!1),$(_this._element).trigger(Event.SHOWN)},capitalizedDimension,scrollSize="scroll"+(dimension[0].toUpperCase()+dimension.slice(1)),transitionDuration=Util.getTransitionDurationFromElement(this._element);$(this._element).one(Util.TRANSITION_END,complete).emulateTransitionEnd(transitionDuration),this._element.style[dimension]=this._element[scrollSize]+"px"}}},_proto.hide=function hide(){var _this2=this;if(!this._isTransitioning&&$(this._element).hasClass(ClassName_SHOW)){var startEvent=$.Event(Event.HIDE);if($(this._element).trigger(startEvent),!startEvent.isDefaultPrevented()){var dimension=this._getDimension();this._element.style[dimension]=this._element.getBoundingClientRect()[dimension]+"px",Util.reflow(this._element),$(this._element).addClass(ClassName_COLLAPSING).removeClass(ClassName_COLLAPSE).removeClass(ClassName_SHOW);var triggerArrayLength=this._triggerArray.length;if(triggerArrayLength>0)for(var i=0;i<triggerArrayLength;i++){var trigger=this._triggerArray[i],selector=Util.getSelectorFromElement(trigger),$elem;if(null!==selector)$([].slice.call(document.querySelectorAll(selector))).hasClass(ClassName_SHOW)||$(trigger).addClass(ClassName_COLLAPSED).attr("aria-expanded",!1)}this.setTransitioning(!0);var complete=function complete(){_this2.setTransitioning(!1),$(_this2._element).removeClass(ClassName_COLLAPSING).addClass(ClassName_COLLAPSE).trigger(Event.HIDDEN)};this._element.style[dimension]="";var transitionDuration=Util.getTransitionDurationFromElement(this._element);$(this._element).one(Util.TRANSITION_END,complete).emulateTransitionEnd(transitionDuration)}}},_proto.setTransitioning=function setTransitioning(isTransitioning){this._isTransitioning=isTransitioning},_proto.dispose=function dispose(){$.removeData(this._element,DATA_KEY),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},_proto._getConfig=function _getConfig(config){return(config=_objectSpread({},Default,config)).toggle=Boolean(config.toggle),Util.typeCheckConfig(NAME,config,DefaultType),config},_proto._getDimension=function _getDimension(){var hasWidth;return $(this._element).hasClass(Dimension_WIDTH)?Dimension_WIDTH:Dimension_HEIGHT},_proto._getParent=function _getParent(){var _this3=this,parent;Util.isElement(this._config.parent)?(parent=this._config.parent,void 0!==this._config.parent.jquery&&(parent=this._config.parent[0])):parent=document.querySelector(this._config.parent);var selector='[data-sptoggle="collapse"][data-parent="'+this._config.parent+'"]',children=[].slice.call(parent.querySelectorAll(selector));return $(children).each((function(i,element){_this3._addAriaAndCollapsedClass(SP_Collapse_Pro._getTargetFromElement(element),[element])})),parent},_proto._addAriaAndCollapsedClass=function _addAriaAndCollapsedClass(element,triggerArray){var isOpen=$(element).hasClass(ClassName_SHOW);triggerArray.length&&$(triggerArray).toggleClass(ClassName_COLLAPSED,!isOpen).attr("aria-expanded",isOpen)},SP_Collapse_Pro._getTargetFromElement=function _getTargetFromElement(element){var selector=Util.getSelectorFromElement(element);return selector?document.querySelector(selector):null},SP_Collapse_Pro._jQueryInterface=function _jQueryInterface(config){return this.each((function(){var $this=$(this),data=$this.data(DATA_KEY),_config=_objectSpread({},Default,$this.data(),"object"==typeof config&&config?config:{});if(!data&&_config.toggle&&/show|hide/.test(config)&&(_config.toggle=!1),data||(data=new SP_Collapse_Pro(this,_config),$this.data(DATA_KEY,data)),"string"==typeof config){if(void 0===data[config])throw new TypeError('No method n
6amed "'+config+'"');data[config]()}}))},_createClass(SP_Collapse_Pro,null,[{key:"VERSION",get:function get(){return"4.3.1"}},{key:"Default",get:function get(){return Default}}]),SP_Collapse_Pro}();return $(document).on(Event.CLICK_DATA_API,Selector_DATA_TOGGLE,(function(event){"A"===event.currentTarget.tagName&&event.preventDefault();var $trigger=$(this),selector=Util.getSelectorFromElement(this),selectors=[].slice.call(document.querySelectorAll(selector));$(selectors).each((function(){var $target=$(this),data,config=$target.data(DATA_KEY)?"toggle":$trigger.data();SP_Collapse_Pro._jQueryInterface.call($target,config)}))})),$.fn[NAME]=SP_Collapse_Pro._jQueryInterface,$.fn[NAME].Constructor=SP_Collapse_Pro,$.fn[NAME].noConflict=function(){return $.fn[NAME]=JQUERY_NO_CONFLICT,SP_Collapse_Pro._jQueryInterface},SP_Collapse_Pro}));

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.