7 lines
26 KiB
JavaScript
Raw Normal View History

2020-05-19 11:43:42 +03:00
/*!
* AngularJS Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.18-master-97a1616
*/
!function(t,l){"use strict";p.$inject=["presets","$rootElement","$rootScope","$injector","$window"],l.module("material.components.panel",["material.core","material.components.backdrop"]).provider("$mdPanel",function(){return{definePreset:e,getAllPresets:o,clearPresets:r,$get:["$rootElement","$rootScope","$injector","$window",function(t,e,n,o){return new p(i,t,e,n,o)}]}});var s=80,a="_md-panel-hidden",n=l.element('<div class="_md-panel-focus-trap" tabindex="0"></div>'),i={};function e(t,e){if(!t||!e)throw new Error("mdPanelProvider: The panel preset definition is malformed. The name and preset object are required.");if(i.hasOwnProperty(t))throw new Error("mdPanelProvider: The panel preset you have requested has already been defined.");delete e.id,delete e.position,delete e.animation,i[t]=e}function o(){return l.copy(i)}function r(){i={}}function p(t,e,n,o,i){this._defaultConfigOptions={bindToController:!0,clickOutsideToClose:!1,disableParentScroll:!1,escapeToClose:!1,focusOnOpen:!0,fullscreen:!1,hasBackdrop:!1,propagateContainerEvents:!1,transformTemplate:l.bind(this,this._wrapTemplate),trapFocus:!1,zIndex:s},this._config={},this._presets=t,this._$rootElement=e,this._$rootScope=n,this._$injector=o,this._$window=i,this._$mdUtil=this._$injector.get("$mdUtil"),this._trackedPanels={},this._groups=Object.create(null),this.animation=c.animation,this.xPosition=d.xPosition,this.yPosition=d.yPosition,this.interceptorTypes=h.interceptorTypes,this.closeReasons=h.closeReasons,this.absPosition=d.absPosition}function h(t,e){this._$q=e.get("$q"),this._$mdCompiler=e.get("$mdCompiler"),this._$mdConstant=e.get("$mdConstant"),this._$mdUtil=e.get("$mdUtil"),this._$mdTheming=e.get("$mdTheming"),this._$rootScope=e.get("$rootScope"),this._$animate=e.get("$animate"),this._$mdPanel=e.get("$mdPanel"),this._$log=e.get("$log"),this._$window=e.get("$window"),this._$$rAF=e.get("$$rAF"),this.id=t.id,this.config=t,this.panelContainer,this.panelEl,this.isAttached=!1,this._removeListeners=[],this._topFocusTrap,this._bottomFocusTrap,this._backdropRef,this._restoreScroll=null,this._interceptors=Object.create(null),this._compilerCleanup=null,this._restoreCache={styles:"",classes:""}}function d(t){this._$window=t.get("$window"),this._isRTL="rtl"===t.get("$mdUtil").bidi(),this._$mdConstant=t.get("$mdConstant"),this._absolute=!1,this._relativeToEl,this._top="",this._bottom="",this._left="",this._right="",this._translateX=[],this._translateY=[],this._positions=[],this._actualPosition}function c(t){this._$mdUtil=t.get("$mdUtil"),this._openFrom,this._closeTo,this._animationClass="",this._openDuration,this._closeDuration,this._rawDuration}function u(t){var e=l.isString(t)?document.querySelector(t):t;return l.element(e)}function f(t){return l.isNumber(t)?t+"px":t}p.prototype.create=function(t,e){if("string"==typeof t?t=this._getPresetByName(t):"object"!=typeof t||!l.isUndefined(e)&&e||(e=t,t={}),t=t||{},e=e||{},l.isDefined(e.id)&&this._trackedPanels[e.id]){var n=this._trackedPanels[e.id];return l.extend(n.config,e),n}this._config=l.extend({id:e.id||"panel_"+this._$mdUtil.nextUid(),scope:this._$rootScope.$new(!0),attachTo:this._$rootElement},this._defaultConfigOptions,e,t);var o=new h(this._config,this._$injector);return this._trackedPanels[this._config.id]=o,this._config.groupName&&(l.isString(this._config.groupName)&&(this._config.groupName=[this._config.groupName]),l.forEach(this._config.groupName,function(t){o.addToGroup(t)})),this._config.scope.$on("$destroy",l.bind(o,o.detach)),o},p.prototype.open=function(t,e){var n=this.create(t,e);return n.open().then(function(){return n})},p.prototype._getPresetByName=function(t){if(!this._presets[t])throw new Error("mdPanel: The panel preset configuration that you requested does not exist. Use the $mdPanelProvider to create a preset before requesting one.");return this._presets[t]},p.prototype.newPanelPosition=function(){return new d(this._$injector)},p.prototype.newPanelAnimation=function(){return new c(this._$injector)},p.prototype.newPanelGroup=function(t,e){if(!this._groups[t]){var n={panels:[],openPanels:[],maxOpen:0