ngx-bootstrap-ci
Version:
Native Angular Bootstrap Components
10 lines • 6.93 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("ngx-bootstrap/utils",["exports","@angular/core"],e):e((t["ngx-bootstrap"]=t["ngx-bootstrap"]||{},t["ngx-bootstrap"].utils={}),t.ng.core)}(this,function(t,e){"use strict";var o=function(){function t(t,e){this.open=t,this.close=e||t}return t.prototype.isManual=function(){return"manual"===this.open||"manual"===this.close},t}(),s={hover:["mouseover","mouseout"],focus:["focusin","focusout"]};function h(t,n){void 0===n&&(n=s);var e=(t||"").trim();if(0===e.length)return[];var r=e.split(/\s+/).map(function(t){return t.split(":")}).map(function(t){var e=n[t[0]]||t;return new o(e[0],e[1])}),i=r.filter(function(t){return t.isManual()});if(1<i.length)throw new Error("Triggers parse error: only one manual trigger is allowed");if(1===i.length&&1<r.length)throw new Error("Triggers parse error: manual trigger can't be mixed with other triggers");return r}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var r,i="undefined"!=typeof window&&window||{},n=i.document;i.location,i.gc,i.performance&&i.performance,i.Event,i.MouseEvent,i.KeyboardEvent,i.EventTarget,i.History,i.Location,i.EventListener;var u=function(){function t(){this.length=0,this.asArray=[]}return t.prototype.get=function(t){if(!(0===this.length||t<0||t>=this.length)){for(var e=this.head,n=0;n<t;n++)e=e.next;return e.value}},t.prototype.add=function(t,e){if(void 0===e&&(e=this.length),e<0||e>this.length)throw new Error("Position is out of the list");var n={value:t,next:undefined,previous:undefined};if(0===this.length)this.head=n,this.tail=n,this.current=n;else if(0===e)n.next=this.head,this.head.previous=n,this.head=n;else if(e===this.length)(this.tail.next=n).previous=this.tail,this.tail=n;else{var r=this.getNode(e-1),i=r.next;r.next=n,(i.previous=n).previous=r,n.next=i}this.length++,this.createInternalArrayRepresentation()},t.prototype.remove=function(t){if(void 0===t&&(t=0),0===this.length||t<0||t>=this.length)throw new Error("Position is out of the list");if(0===t)this.head=this.head.next,this.head?this.head.previous=undefined:this.tail=undefined;else if(t===this.length-1)this.tail=this.tail.previous,this.tail.next=undefined;else{var e=this.getNode(t);e.next.previous=e.previous,e.previous.next=e.next}this.length--,this.createInternalArrayRepresentation()},t.prototype.set=function(t,e){if(0===this.length||t<0||t>=this.length)throw new Error("Position is out of the list");this.getNode(t).value=e,this.createInternalArrayRepresentation()},t.prototype.toArray=function(){return this.asArray},t.prototype.findAll=function(t){for(var e=this.head,n=[],r=0;r<this.length;r++)t(e.value,r)&&n.push({index:r,value:e.value}),e=e.next;return n},t.prototype.push=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.forEach(function(t){e.add(t)}),this.length},t.prototype.pop=function(){if(0===this.length)return undefined;var t=this.tail;return this.remove(this.length-1),t.value},t.prototype.unshift=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.reverse(),t.forEach(function(t){e.add(t,0)}),this.length},t.prototype.shift=function(){if(0===this.length)return undefined;var t=this.head.value;return this.remove(),t},t.prototype.forEach=function(t){for(var e=this.head,n=0;n<this.length;n++)t(e.value,n),e=e.next},t.prototype.indexOf=function(t){for(var e=this.head,n=0,r=0;r<this.length;r++){if(e.value===t){n=r;break}e=e.next}return n},t.prototype.some=function(t){for(var e=this.head,n=!1;e&&!n;){if(t(e.value)){n=!0;break}e=e.next}return n},t.prototype.every=function(t){for(var e=this.head,n=!0;e&&n;)t(e.value)||(n=!1),e=e.next;return n},t.prototype.toString=function(){return"[Linked List]"},t.prototype.find=function(t){for(var e,n=this.head,r=0;r<this.length;r++){if(t(n.value,r)){e=n.value;break}n=n.next}return e},t.prototype.findIndex=function(t){for(var e,n=this.head,r=0;r<this.length;r++){if(t(n.value,r)){e=r;break}n=n.next}return e},t.prototype.getNode=function(t){if(0===this.length||t<0||t>=this.length)throw new Error("Position is out of the list");for(var e=this.head,n=0;n<t;n++)e=e.next;return e},t.prototype.createInternalArrayRepresentation=function(){for(var t=[],e=this.head;e;)t.push(e.value),e=e.next;this.asArray=t},t}();var a=function(){function t(){}return t.reflow=function(t){t.offsetHeight},t.getStyles=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=i),e.getComputedStyle(t)},t}(),f={},l="undefined"==typeof console||!("warn"in console);t.isBs3=function c(){return void 0===i||("undefined"==typeof i.__theme?r?"bs3"===r:"bs3"===(r=function n(){if("undefined"==typeof document)return null;var t=document.createElement("span");t.innerText="test bs version",document.body.appendChild(t),t.classList.add("d-none");var e=t.getBoundingClientRect();return document.body.removeChild(t),e&&0===e.top?"bs4":"bs3"}()):"bs4"!==i.__theme)},t.LinkedList=u,t.listenToTriggersV2=function d(r,i){var t=h(i.triggers),o=i.target;if(1===t.length&&t[0].isManual())return Function.prototype;var s=[],u=[],a=function(){u.forEach(function(t){return s.push(t())}),u.length=0};return t.forEach(function(t){var e=t.open===t.close,n=e?i.toggle:i.show;e||u.push(function(){return r.listen(o,t.close,i.hide)}),s.push(r.listen(o,t.open,function(){return n(a)}))}),function(){s.forEach(function(t){return t()})}},t.registerOutsideClick=function p(t,n){return n.outsideClick?t.listen("document","click",function(e){return n.target&&n.target.contains(e.target)?undefined:n.targets&&n.targets.some(function(t){return t.contains(e.target)})?undefined:void n.hide()}):Function.prototype},t.registerEscClick=function g(t,n){return n.outsideEsc?t.listen("document","keyup.esc",function(e){return n.target&&n.target.contains(e.target)?undefined:n.targets&&n.targets.some(function(t){return t.contains(e.target)})?undefined:void n.hide()}):Function.prototype},t.OnChange=function v(t){return function(t,e){var n=" __"+e+"Value";Object.defineProperty(t,e,{get:function(){return this[n]},set:function(t){this[n]!==(this[n]=t)&&this[e+"Change"]&&this[e+"Change"].emit(t)}})}},t.setTheme=function y(t){r=t},t.Trigger=o,t.Utils=a,t.window=i,t.document=n,t.warnOnce=function m(t){!e.isDevMode()||l||t in f||(f[t]=!0,console.warn(t))},t.parseTriggers=h,t.listenToTriggers=function x(e,n,t,r,i,o){var s=h(t),u=[];return 1===s.length&&s[0].isManual()?Function.prototype:(s.forEach(function(t){t.open!==t.close?u.push(e.listen(n,t.open,r),e.listen(n,t.close,i)):u.push(e.listen(n,t.open,o))}),function(){u.forEach(function(t){return t()})})},Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-bootstrap-utils.umd.min.js.map