ngx-bootstrap-fix-datepicker
Version:
Native Angular Bootstrap Components
10 lines • 6.85 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=t||self)["ngx-bootstrap"]=t["ngx-bootstrap"]||{},t["ngx-bootstrap"].utils={}),t.ng.core)}(this,(function(t,e){"use strict";var n=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}();var r={hover:["mouseover","mouseout"],focus:["focusin","focusout"]};function i(t,e){void 0===e&&(e=r);var i=(t||"").trim();if(0===i.length)return[];var o=i.split(/\s+/).map((function(t){return t.split(":")})).map((function(t){var r=e[t[0]]||t;return new n(r[0],r[1])})),s=o.filter((function(t){return t.isManual()}));if(s.length>1)throw new Error("Triggers parse error: only one manual trigger is allowed");if(1===s.length&&o.length>1)throw new Error("Triggers parse error: manual trigger can't be mixed with other triggers");return o}
/**
* @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 o,s="undefined"!=typeof window&&window||{},u=s.document;s.location,s.gc,s.performance&&s.performance,s.Event,s.MouseEvent,s.KeyboardEvent,s.EventTarget,s.History,s.Location,s.EventListener;var a=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:void 0,previous:void 0};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,n.previous=this.tail,this.tail=n;else{var r=this.getNode(e-1),i=r.next;r.next=n,i.previous=n,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=void 0:this.tail=void 0;else if(t===this.length-1)this.tail=this.tail.previous,this.tail.next=void 0;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 t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.forEach((function(e){t.add(e)})),this.length},t.prototype.pop=function(){if(0!==this.length){var t=this.tail;return this.remove(this.length-1),t.value}},t.prototype.unshift=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.reverse(),e.forEach((function(e){t.add(e,0)})),this.length},t.prototype.shift=function(){if(0!==this.length){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 h=function(){function t(){}return t.reflow=function(t){t.offsetHeight},t.getStyles=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=s),e.getComputedStyle(t)},t}(),f={},l="undefined"==typeof console||!("warn"in console);t.LinkedList=a,t.OnChange=function(t){return function(t,e){var n=" __"+e+"Value";Object.defineProperty(t,e,{get:function(){return this[n]},set:function(t){var r=this[n];this[n]=t,r!==t&&this[e+"Change"]&&this[e+"Change"].emit(t)}})}},t.Trigger=n,t.Utils=h,t.document=u,t.isBs3=function(){return void 0===s||(void 0===s.__theme?o?"bs3"===o:"bs3"===(o=function(){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"!==s.__theme)},t.listenToTriggers=function(t,e,n,r,o,s){var u=i(n),a=[];return 1===u.length&&u[0].isManual()?Function.prototype:(u.forEach((function(n){n.open!==n.close?a.push(t.listen(e,n.open,r),t.listen(e,n.close,o)):a.push(t.listen(e,n.open,s))})),function(){a.forEach((function(t){return t()}))})},t.listenToTriggersV2=function(t,e){var n=i(e.triggers),r=e.target;if(1===n.length&&n[0].isManual())return Function.prototype;var o=[],s=[],u=function(){s.forEach((function(t){return o.push(t())})),s.length=0};return n.forEach((function(n){var i=n.open===n.close,a=i?e.toggle:e.show;i||s.push((function(){return t.listen(r,n.close,e.hide)})),o.push(t.listen(r,n.open,(function(){return a(u)})))})),function(){o.forEach((function(t){return t()}))}},t.parseTriggers=i,t.registerEscClick=function(t,e){return e.outsideEsc?t.listen("document","keyup.esc",(function(t){e.target&&e.target.contains(t.target)||e.targets&&e.targets.some((function(e){return e.contains(t.target)}))||e.hide()})):Function.prototype},t.registerOutsideClick=function(t,e){return e.outsideClick?t.listen("document","click",(function(t){e.target&&e.target.contains(t.target)||e.targets&&e.targets.some((function(e){return e.contains(t.target)}))||e.hide()})):Function.prototype},t.setTheme=function(t){o=t},t.warnOnce=function(t){!e.isDevMode()||l||t in f||(f[t]=!0,console.warn(t))},t.window=s,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-bootstrap-utils.umd.min.js.map