source: trip-planner-front/node_modules/angular-material/modules/js/dialog/dialog.min.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 9.6 KB
Line 
1/*!
2 * AngularJS Material Design
3 * https://github.com/angular/material
4 * @license MIT
5 * v1.2.2-master-0a06f99
6 */
7!function(e,$){"use strict";function t(e,t,a){return{restrict:"E",link:function(o,i){i.addClass("_md"),t(i),e(function(){var e,t=i[0].querySelector("md-dialog-content");function n(){i.toggleClass("md-content-overflow",t.scrollHeight>t.clientHeight)}t&&(e=t.getElementsByTagName("img"),n(),$.element(e).on("load",n)),o.$on("$destroy",function(){a.destroy(i)})})}}}function n(e){var v,b,C;return n.$inject=["$mdDialog","$mdConstant"],o.$inject=["$mdDialog","$mdAria","$mdUtil","$mdConstant","$animate","$document","$window","$rootElement","$log","$injector","$mdTheming","$interpolate","$mdInteraction"],e("$mdDialog").setDefaults({methods:["disableParentScroll","hasBackdrop","clickOutsideToClose","escapeToClose","targetEvent","closeTo","openFrom","parent","fullscreen","multiple"],options:o}).addPreset("alert",{methods:["title","htmlContent","textContent","ariaLabel","ok","theme","css"],options:t}).addPreset("confirm",{methods:["title","htmlContent","textContent","ariaLabel","ok","cancel","theme","css"],options:t}).addPreset("prompt",{methods:["title","htmlContent","textContent","initialValue","placeholder","ariaLabel","ok","cancel","theme","css","required"],options:t});function t(){return{template:['<md-dialog md-theme="{{ dialog.theme || dialog.defaultTheme }}" aria-label="{{ dialog.ariaLabel }}" ng-class="dialog.css">',' <md-dialog-content class="md-dialog-content" role="document" tabIndex="-1">',' <h2 class="md-title">{{ dialog.title }}</h2>',' <div ng-if="::dialog.mdHtmlContent" class="md-dialog-content-body" ',' ng-bind-html="::dialog.mdHtmlContent"></div>',' <div ng-if="::!dialog.mdHtmlContent" class="md-dialog-content-body">'," <p>{{::dialog.mdTextContent}}</p>"," </div>",' <md-input-container md-no-float ng-if="::dialog.$type == \'prompt\'" class="md-prompt-input-container">',' <input ng-keypress="dialog.keypress($event)" md-autofocus ng-model="dialog.result" placeholder="{{::dialog.placeholder}}" ng-required="dialog.required">'," </md-input-container>"," </md-dialog-content>"," <md-dialog-actions>",' <md-button ng-if="dialog.$type === \'confirm\' || dialog.$type === \'prompt\'" ng-click="dialog.abort()" class="md-primary md-cancel-button">'," {{ dialog.cancel }}"," </md-button>",' <md-button ng-click="dialog.hide()" class="md-primary md-confirm-button" md-autofocus="dialog.$type===\'alert\'" ng-disabled="dialog.required && !dialog.result">'," {{ dialog.ok }}"," </md-button>"," </md-dialog-actions>","</md-dialog>"].join("").replace(/\s\s+/g,""),controller:n,controllerAs:"dialog",bindToController:!0}}function n(o,i){this.$onInit=function(){var n="prompt"===this.$type;n&&this.initialValue&&(this.result=this.initialValue),this.hide=function(){o.hide(!n||this.result)},this.abort=function(){o.cancel()},this.keypress=function(e){var t=n&&this.required&&!$.isDefined(this.result);e.keyCode!==i.KEY_CODE.ENTER||t||o.hide(this.result)}}}function o(u,l,g,f,i,d,p,a,r,s,t,c,m){return{hasBackdrop:!0,isolateScope:!0,onCompiling:function(e){e.defaultTheme=t.defaultTheme(),function(t){var e;t.targetEvent&&t.targetEvent.target&&(e=$.element(t.targetEvent.target));var n=e&&e.controller("mdTheme");if(t.hasTheme=!!n,!t.hasTheme)return;t.themeWatch=n.$shouldWatch;var o=t.theme||n.$mdTheme;o&&(t.scope.theme=o);var i=n.registerChanges(function(e){t.scope.theme=e,t.themeWatch||i()})}(e)},onShow:function(e,t,n){$.element(d[0].body).addClass("md-dialog-is-showing");var o=t.find("md-dialog");if(o.hasClass("ng-cloak")){r.warn("$mdDialog: using `<md-dialog ng-cloak>` will affect the dialog opening animations.",t[0])}return function(e){e.origin=$.extend({element:null,bounds:null,focus:$.noop},e.origin||{}),e.parent=n(e.parent,a),e.closeTo=t(n(e.closeTo)),e.openFrom=t(n(e.openFrom)),e.targetEvent&&(e.origin=t(e.targetEvent.target,e.origin),e.originInteraction=m.getLastInteractionType());function t(e,t){var n=$.element(e||{});if(n&&n.length){var o=$.isFunction(n[0].getBoundingClientRect);return $.extend(t||{},{element:o?n:void 0,bounds:o?n[0].getBoundingClientRect():$.extend({},{top:0,left:0,height:0,width:0},n[0]),focus:$.bind(n,n.focus)})}}function n(e,t){return $.isString(e)&&(e=d[0].querySelector(e)),$.element(e||t)}}(n),function(n,t){var e="alert"===t.$type?"alertdialog":"dialog",o=n.find("md-dialog-content"),i=n.attr("id"),a="dialogContent_"+(i||g.nextUid());n.attr({role:e,tabIndex:"-1"}),0===o.length&&(o=n,i&&(a=i));o.attr("id",a),n.attr("aria-describedby",a),t.ariaLabel?l.expect(n,"aria-label",t.ariaLabel):l.expectAsync(n,"aria-label",function(){if(t.title)return t.title;var e=o.text().split(/\s+/);return 3<e.length&&(e=e.slice(0,3).concat("...")),e.join(" ")});(v=document.createElement("div")).classList.add("md-dialog-focus-trap"),v.tabIndex=0,b=v.cloneNode(!1);function r(e){if(e.target&&e.target.nextSibling&&"MD-DIALOG"===e.target.nextSibling.nodeName){var t=g.getLastTabbableElement(n[0]);$.isElement(t)&&t.focus()}else n.focus()}v.addEventListener("focus",r),b.addEventListener("focus",r),C=function(){v.removeEventListener("focus",r),b.removeEventListener("focus",r),v&&v.parentNode&&v.parentNode.removeChild(v),b&&b.parentNode&&b.parentNode.removeChild(b)},n[0].parentNode.insertBefore(v,n[0]),n.after(b)}(o,n),function(e,t,n){n.disableParentScroll&&(n.restoreScroll=g.disableScrollAround(t,n.parent));n.hasBackdrop&&(n.backdrop=g.createBackdrop(e,"md-dialog-backdrop md-opaque"),i.enter(n.backdrop,n.parent));n.hideBackdrop=function(e){n.backdrop&&(e?n.backdrop.remove():i.leave(n.backdrop)),n.disableParentScroll&&(n.restoreScroll&&n.restoreScroll(),delete n.restoreScroll),n.hideBackdrop=null}}(e,t,n),function(e,t){function n(){var e="alert"===t.$type?u.hide:u.cancel;g.nextTick(e,!0)}var o=$.element(p),i=g.debounce(function(){h(e,t)},60),a=[];if(t.escapeToClose){var r=t.parent,l=function(e){e.keyCode===f.KEY_CODE.ESCAPE&&(e.stopImmediatePropagation(),e.preventDefault(),n())};e.on("keydown",l),r.on("keydown",l),a.push(function(){e.off("keydown",l),r.off("keydown",l)})}if(o.on("resize",i),a.push(function(){o.off("resize",i)}),t.clickOutsideToClose){var d,s=e,c=function(e){d=e.target},m=function(e){d===s[0]&&e.target===s[0]&&(e.stopPropagation(),e.preventDefault(),n())};s.on("mousedown",c),s.on("mouseup",m),a.push(function(){s.off("mousedown",c),s.off("mouseup",m)})}t.deactivateListeners=function(){a.forEach(function(e){e()}),t.deactivateListeners=null}}(t,n),function(e,t){t.parent.append(e),t.reverseContainerStretch=h(e,t);var n=e.find("md-dialog"),o=g.dom.animator,i=o.calculateZoomToOrigin,a={transitionInClass:"md-transition-in",transitionOutClass:"md-transition-out"},r=o.toTransformCss(i(n,t.openFrom||t.origin)),l=o.toTransformCss("");return n.toggleClass("md-dialog-fullscreen",!!t.fullscreen),o.translate3d(n,r,l,a).then(function(e){return t.reverseAnimate=function(){return delete t.reverseAnimate,t.closeTo?(a={transitionInClass:"md-transition-out",transitionOutClass:"md-transition-in"},r=l,l=o.toTransformCss(i(n,t.closeTo)),o.translate3d(n,r,l,a)):e(l=o.toTransformCss(i(n,t.origin)))},t.clearAnimate=function(){return delete t.clearAnimate,n.removeClass([a.transitionOutClass,a.transitionInClass].join(" ")),o.translate3d(n,l,o.toTransformCss(""),{})},!0})}(t,n).then(function(){!function(e,t){var o=!0;function n(e){for(var t=function(e){for(var t,n=[];e.parentNode;){if(e===document.body)return n;for(var o=e.parentNode.children,i=0;i<o.length;i++)e===o[i]||(t=o[i],-1!==["SCRIPT","STYLE"].indexOf(t.nodeName))||o[i].hasAttribute("aria-live")||n.push(o[i]);e=e.parentNode}return n}(e),n=0;n<t.length;n++)t[n].setAttribute("aria-hidden",o)}n(e[0]),t.unlockScreenReader=function(){o=!1,n(e[0]),t.unlockScreenReader=null}}(t,n),function(){if(n.focusOnOpen){(g.findFocusTarget(t)||t[0].querySelector(".dialog-close, md-dialog-actions button:last-child")||o).focus()}}()})},onShowing:function(e,t,n,o){if(o){var i=o.htmlContent||n.htmlContent||"",a=o.textContent||n.textContent||"";if(i&&!s.has("$sanitize"))throw Error("The ngSanitize module must be loaded in order to use htmlContent.");if(i&&a)throw Error("md-dialog cannot have both `htmlContent` and `textContent`");o.mdHtmlContent=i,o.mdTextContent=a}},onRemove:function(e,t,n){n.deactivateListeners(),n.unlockScreenReader(),n.hideBackdrop(n.$destroy),C&&(C(),C=null);return n.$destroy?o():function(e,t){return t.reverseAnimate().then(function(){t.contentElement&&t.clearAnimate()})}(0,n).then(o);function o(){$.element(d[0].body).removeClass("md-dialog-is-showing"),n.contentElement&&n.reverseContainerStretch(),n.cleanupElement(),n.$destroy||"keyboard"!==n.originInteraction||n.origin.focus()}},clickOutsideToClose:!1,escapeToClose:!0,targetEvent:null,closeTo:null,openFrom:null,focusOnOpen:!0,disableParentScroll:!0,autoWrap:!0,fullscreen:!1,transformTemplate:function(e,t){var n,o=c.startSymbol(),i=c.endSymbol(),a=o+(t.themeWatch?"":"::")+"theme"+i;return'<div class="md-dialog-container" tabindex="-1" '+(t.hasTheme?'md-theme="'+a+'"':"")+">"+(n=e,t.autoWrap&&!/<\/md-dialog>/g.test(n)?"<md-dialog>"+(n||"")+"</md-dialog>":n||"")+"</div>"}};function h(e,t){var n="fixed"===p.getComputedStyle(d[0].body).position,o=t.backdrop?p.getComputedStyle(t.backdrop[0]):null,i=o?Math.min(d[0].body.clientHeight,Math.ceil(Math.abs(parseInt(o.height,10)))):0,a={top:e.css("top"),height:e.css("height")},r=Math.abs(t.parent[0].getBoundingClientRect().top);return e.css({top:(n?r:0)+"px",height:i?i+"px":"100%"}),function(){e.css(a)}}}}t.$inject=["$$rAF","$mdTheming","$mdDialog"],n.$inject=["$$interimElementProvider"],$.module("material.components.dialog",["material.core","material.components.backdrop"]).directive("mdDialog",t).provider("$mdDialog",n)}(window,window.angular);
Note: See TracBrowser for help on using the repository browser.