ng-responsive-nav
Version:
A mobile friendly navigation solution
841 lines (798 loc) • 42.2 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/router'), require('rxjs'), require('@fortawesome/free-solid-svg-icons/faBars'), require('@fortawesome/free-solid-svg-icons'), require('@fortawesome/angular-fontawesome')) :
typeof define === 'function' && define.amd ? define('ng-responsive-nav', ['exports', '@angular/core', '@angular/common', '@angular/platform-browser', '@angular/router', 'rxjs', '@fortawesome/free-solid-svg-icons/faBars', '@fortawesome/free-solid-svg-icons', '@fortawesome/angular-fontawesome'], factory) :
(global = global || self, factory(global['ng-responsive-nav'] = {}, global.ng.core, global.ng.common, global.ng.platformBrowser, global.ng.router, global.rxjs, global.faBars, global.freeSolidSvgIcons, global.angularFontawesome));
}(this, (function (exports, core, common, platformBrowser, router, rxjs, faBars, freeSolidSvgIcons, angularFontawesome) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __exportStar(m, exports) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
function __values(o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result.default = mod;
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
/**
* @fileoverview added by tsickle
* Generated from: app/ng-responsive-nav.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgResponsiveNavComponent = /** @class */ (function () {
function NgResponsiveNavComponent() {
}
NgResponsiveNavComponent.decorators = [
{ type: core.Component, args: [{
selector: 'ng-responsive-nav',
template: "<app-desktop-navigation class=\"display-flex\">\r\n <div desktopExtras>\r\n <ng-content select=\"[ngDesktopNavExtras]\"></ng-content>\r\n </div>\r\n</app-desktop-navigation>\r\n\r\n<app-mobile-navigation-component>\r\n <div mobileExtras>\r\n <ng-content select=\"[ngMobileNavExtras]\"></ng-content>\r\n </div>\r\n</app-mobile-navigation-component>\r\n",
styles: [".link.desktop-link{margin:0 7px}.link.desktop-link.primary{text-decoration:none}.link.desktop-link.primary:hover{-webkit-filter:brightness(60%);filter:brightness(60%);text-decoration:underline}.link.desktop-link.primary:active{-webkit-filter:brightness(60%);filter:brightness(60%)}.link.mobile-link{margin:7px 0}.link.mobile-link.primary:active{-webkit-filter:brightness(60%);filter:brightness(60%)}.display-flex{display:flex}"]
}] }
];
return NgResponsiveNavComponent;
}());
/**
* @fileoverview added by tsickle
* Generated from: app/models/nav.config.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @abstract
*/
var /**
* @abstract
*/
NavConfig = /** @class */ (function () {
function NavConfig() {
}
return NavConfig;
}());
if (false) {
/** @type {?} */
NavConfig.prototype.navBrandConfig;
/** @type {?} */
NavConfig.prototype.navigationMenuRoutes;
/** @type {?} */
NavConfig.prototype.navigationHomeRoute;
}
/**
* @fileoverview added by tsickle
* Generated from: app/window/window.provider.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var WINDOW = new core.InjectionToken('WindowToken');
/**
* @fileoverview added by tsickle
* Generated from: app/desktop-navigation/desktop-navigation.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var DesktopNavigationComponent = /** @class */ (function () {
function DesktopNavigationComponent(navConfig, window) {
this.canFadeBoxShadowOut = false;
this.navConfig = navConfig;
this._window = window;
}
/**
* @return {?}
*/
DesktopNavigationComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this._window.addEventListener('scroll', (/**
* @return {?}
*/
function () {
_this.canFadeBoxShadowOut = _this._window.scrollY > 0;
}));
};
DesktopNavigationComponent.decorators = [
{ type: core.Component, args: [{
selector: 'app-desktop-navigation',
template: "<div class=\"navigation-container\"\r\n [ngStyle]=\"{\r\n 'background-color': navConfig.navBrandConfig.colorPalette.backGroundColor,\r\n 'z-index': navConfig.navBrandConfig.zIndex,\r\n 'box-shadow': navConfig.navBrandConfig.boxShadow === true ? '0 0.5rem 1rem rgba(0, 0, 0, 0.15)' : 'none'\r\n}\">\r\n <div class=\"navigation-inner-container\">\r\n <div class=\"navigation-links\">\r\n <img class=\"navigation-image\"\r\n [routerLink]=\"navConfig.navigationHomeRoute.routePath\"\r\n [src]=\"navConfig.navBrandConfig.brandImageUrl\">\r\n <a class=\"link desktop-link primary\"\r\n [ngStyle]=\"{ 'color': navConfig.navBrandConfig.colorPalette.linkColor }\"\r\n *ngFor=\"let route of navConfig.navigationMenuRoutes\"\r\n [routerLink]=\"route.routePath\">{{route.routeName}}</a>\r\n </div>\r\n\r\n <div class=\"navigation-extras\">\r\n <ng-content select=\"[desktopExtras]\"></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n",
styles: [".link.desktop-link{margin:0 7px}.link.desktop-link.primary{text-decoration:none}.link.desktop-link.primary:hover{-webkit-filter:brightness(60%);filter:brightness(60%);text-decoration:underline}.link.desktop-link.primary:active{-webkit-filter:brightness(60%);filter:brightness(60%)}.link.mobile-link{margin:7px 0}.link.mobile-link.primary:active{-webkit-filter:brightness(60%);filter:brightness(60%)}.display-flex{display:flex}.navigation-container{height:64px;width:100%;position:fixed}@media only screen and (max-width:576px){.navigation-container{display:none}}.navigation-container .navigation-inner-container{display:flex!important;justify-content:space-between!important;height:100%}.navigation-container .navigation-inner-container .navigation-links{display:flex!important;align-items:center!important;height:100%}.navigation-container .navigation-inner-container .navigation-links .navigation-image{height:100%;cursor:pointer}.navigation-container .navigation-inner-container .navigation-extras{display:flex!important;align-items:center!important;height:100%;padding-right:1rem}"]
}] }
];
/** @nocollapse */
DesktopNavigationComponent.ctorParameters = function () { return [
{ type: NavConfig },
{ type: Window, decorators: [{ type: core.Inject, args: [WINDOW,] }] }
]; };
return DesktopNavigationComponent;
}());
if (false) {
/** @type {?} */
DesktopNavigationComponent.prototype.navConfig;
/** @type {?} */
DesktopNavigationComponent.prototype.canFadeBoxShadowOut;
/**
* @type {?}
* @private
*/
DesktopNavigationComponent.prototype._window;
}
/**
* @fileoverview added by tsickle
* Generated from: app/mobile-navigation/mobile-navigation.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var MobileNavigationComponent = /** @class */ (function () {
function MobileNavigationComponent(router, document, navConfig) {
this.faBars = faBars.faBars;
this.faTimes = freeSolidSvgIcons.faTimes;
this.canActivateMobileNav = false;
this._subscriptions = new rxjs.Subscription();
this._router = router;
this._document = document;
this.navConfig = navConfig;
}
/**
* @return {?}
*/
MobileNavigationComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this._document.body.style.overflowY = 'scroll';
this._watchNavigationChanges(this._router);
};
/**
* @return {?}
*/
MobileNavigationComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.canActivateMobileNav = false;
this._setOverFlowY();
this._subscriptions.unsubscribe();
};
/**
* @return {?}
*/
MobileNavigationComponent.prototype.toggleCanActivateMobileNavBar = /**
* @return {?}
*/
function () {
this.canActivateMobileNav = !this.canActivateMobileNav;
this._setOverFlowY();
};
/**
* @private
* @return {?}
*/
MobileNavigationComponent.prototype._setOverFlowY = /**
* @private
* @return {?}
*/
function () {
this.canActivateMobileNav
? this._document.body.style.overflowY = 'hidden'
: this._document.body.style.overflowY = 'scroll';
};
/**
* @private
* @param {?} router
* @return {?}
*/
MobileNavigationComponent.prototype._watchNavigationChanges = /**
* @private
* @param {?} router
* @return {?}
*/
function (router$1) {
var _this = this;
this._subscriptions.add(router$1.events.subscribe((/**
* @param {?} event
* @return {?}
*/
function (event) {
if (event instanceof router.NavigationEnd && _this.canActivateMobileNav) {
_this.toggleCanActivateMobileNavBar();
}
})));
};
MobileNavigationComponent.decorators = [
{ type: core.Component, args: [{
selector: 'app-mobile-navigation-component',
template: "<div class=\"mobile-navigation-burger-menu-button circle-container\"\r\n [ngStyle]=\"{\r\n 'background-color': navConfig.navBrandConfig.colorPalette.primaryColor,\r\n 'z-index': navConfig.navBrandConfig.zIndex + 1\r\n }\"\r\n (click)=\"toggleCanActivateMobileNavBar()\"\r\n [class.animation-slide-burger-right]=\"canActivateMobileNav\"\r\n [class.animation-slide-burger-left]=\"!canActivateMobileNav\" >\r\n\r\n <div class=\"mobile-navigation-burger-menu-button-inner\" [ngStyle]=\"{'z-index': navConfig.navBrandConfig.zIndex + 1}\">\r\n <fa-icon class=\"icon\" *ngIf=\"!canActivateMobileNav\" [ngStyle]=\"{ 'color': navConfig.navBrandConfig.colorPalette.secondaryColor }\" [icon]=\"faBars\"></fa-icon>\r\n <fa-icon class=\"icon\" *ngIf=\"canActivateMobileNav\" [ngStyle]=\"{ 'color': navConfig.navBrandConfig.colorPalette.primaryColor }\" [icon]=\"faTimes\"></fa-icon>\r\n </div>\r\n</div>\r\n\r\n<div appCheckOrientation class=\"mobile-navigation-menu\" *ngIf=\"canActivateMobileNav\" [ngStyle]=\"{'z-index': navConfig.navBrandConfig.zIndex}\">\r\n <div class=\"mobile-navigation-menu-items\"\r\n [ngStyle]=\"{ 'background-color': navConfig.navBrandConfig.colorPalette.backGroundColor }\"\r\n [class.animation-slide-in-nav-menu]=\"canActivateMobileNav\"\r\n [class.animation-slide-out-nav-menu]=\"!canActivateMobileNav\">\r\n\r\n <div class=\"mobile-navigation-button-runner\"\r\n [ngStyle]=\"{ 'background-color': navConfig.navBrandConfig.colorPalette.primaryColor }\"\r\n *ngIf=\"canActivateMobileNav\">\r\n <div class=\"runner-inner\"></div>\r\n </div>\r\n\r\n <div class=\"mobile-navigation-links\">\r\n <div class=\"mobile-navigation-links-inner\">\r\n <img class=\"mobile-navigation-inner-icon\"\r\n [routerLink]=\"navConfig.navigationHomeRoute.routePath\"\r\n [src]=\"navConfig.navBrandConfig.brandImageUrl\" />\r\n </div>\r\n <a class=\"link mobile-link\"\r\n *ngFor=\"let route of navConfig.navigationMenuRoutes\"\r\n [routerLink]=\"route.routePath\"\r\n [ngStyle]=\"{ 'color': navConfig.navBrandConfig.colorPalette.primaryColor }\">{{route.routeName}}</a>\r\n </div>\r\n\r\n <div class=\"mobile-navigation-extras\">\r\n <ng-content select=\"[mobileExtras]\"></ng-content>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n\r\n",
styles: ["@-webkit-keyframes slide-burger-right{to{right:29%;margin:18px 0 0;background-color:transparent;color:#1976d2}}@keyframes slide-burger-right{to{right:29%;margin:18px 0 0;background-color:transparent;color:#1976d2}}@-webkit-keyframes slide-burger-left{from{right:29%}to{right:68%}}@keyframes slide-burger-left{from{right:29%}to{right:68%}}@-webkit-keyframes animation-slide-in-nav-left{from{right:100%}to{right:25%}}@keyframes animation-slide-in-nav-left{from{right:100%}to{right:25%}}@-webkit-keyframes animation-slide-in-left{from{right:100%}to{right:0}}@keyframes animation-slide-in-left{from{right:100%}to{right:0}}@-webkit-keyframes animation-slide-out-nav-right{from{right:0}to{right:100%}}@keyframes animation-slide-out-nav-right{from{right:0}to{right:100%}}@-webkit-keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes rotate-clockwise{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotate-clockwise{from{transform:rotate(0)}to{transform:rotate(360deg)}}.animation-slide-burger-right{-webkit-animation:.2s 75ms forwards slide-burger-right;animation:.2s 75ms forwards slide-burger-right}.animation-slide-burger-left{-webkit-animation:.2s forwards slide-burger-left;animation:.2s forwards slide-burger-left}.animation-slide-in-nav-menu{-webkit-animation:.2s forwards animation-slide-in-nav-left;animation:.2s forwards animation-slide-in-nav-left}.animation-slide-out-nav-menu{-webkit-animation:.2s forwards animation-slide-out-nav-right;animation:.2s forwards animation-slide-out-nav-right}.link.desktop-link{margin:0 7px}.link.desktop-link.primary{text-decoration:none}.link.desktop-link.primary:hover{-webkit-filter:brightness(60%);filter:brightness(60%);text-decoration:underline}.link.desktop-link.primary:active{-webkit-filter:brightness(60%);filter:brightness(60%)}.link.mobile-link{margin:7px 0}.link.mobile-link.primary:active{-webkit-filter:brightness(60%);filter:brightness(60%)}.display-flex{display:flex}.mobile-navigation-burger-menu-button{position:fixed;z-index:1001;font-size:1.25rem;color:#fff;width:50px;height:50px;text-align:center;cursor:pointer;margin:18px 59px 0 0;right:68%}.mobile-navigation-burger-menu-button .mobile-navigation-burger-menu-button-inner{padding-top:27%}.mobile-navigation-burger-menu-button .mobile-navigation-burger-menu-button-inner .icon{font-weight:600!important;padding-top:14px}.mobile-navigation-burger-menu-button.circle-container{border-radius:50%;color:#fff;border:none}.mobile-navigation-menu{height:100%;z-index:1}@media only screen and (min-width:576px){.mobile-navigation-burger-menu-button,.mobile-navigation-menu{display:none}}.mobile-navigation-menu .mobile-navigation-menu-items{box-shadow:7px 4px 12px -8px rgba(0,0,0,.75);width:75%;height:100%;z-index:1;position:fixed;color:#fff}.mobile-navigation-menu .mobile-navigation-menu-items .mobile-navigation-extras{padding:12px!important;height:50vh;display:flex!important;flex-direction:column!important}.mobile-navigation-menu .mobile-navigation-menu-items .mobile-navigation-button-runner{padding-right:3rem;z-index:13;height:3px;width:60%;margin-top:41px}.mobile-navigation-menu .mobile-navigation-menu-items .mobile-navigation-button-runner .runner-inner{border-radius:50%;height:inherit;margin-top:.25rem;width:100%}.mobile-navigation-menu .mobile-navigation-menu-items .mobile-navigation-links{display:flex!important;flex-direction:column!important;height:50vh;margin-top:3rem!important;text-align:center}.mobile-navigation-menu .mobile-navigation-menu-items .mobile-navigation-links .mobile-navigation-links-inner{display:flex!important;justify-content:center!important}.mobile-navigation-menu .mobile-navigation-menu-items .mobile-navigation-links .mobile-navigation-inner-icon{width:80px;height:80px;margin-bottom:12px;padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%}.mobile-navigation-menu .mobile-navigation-menu-items .sticky-bottom{height:400px}"]
}] }
];
/** @nocollapse */
MobileNavigationComponent.ctorParameters = function () { return [
{ type: router.Router },
{ type: Document, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
{ type: NavConfig }
]; };
return MobileNavigationComponent;
}());
if (false) {
/** @type {?} */
MobileNavigationComponent.prototype.navConfig;
/** @type {?} */
MobileNavigationComponent.prototype.faBars;
/** @type {?} */
MobileNavigationComponent.prototype.faTimes;
/** @type {?} */
MobileNavigationComponent.prototype.canActivateMobileNav;
/**
* @type {?}
* @private
*/
MobileNavigationComponent.prototype._document;
/**
* @type {?}
* @private
*/
MobileNavigationComponent.prototype._router;
/**
* @type {?}
* @private
*/
MobileNavigationComponent.prototype._subscriptions;
}
/**
* @fileoverview added by tsickle
* Generated from: app/directives/orientation.directive.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var OrientationDirective = /** @class */ (function () {
function OrientationDirective(document, window, mobileNavMenu) {
this.window = window;
this.mobileNavMenu = mobileNavMenu;
this.onInitialise();
}
/**
* @return {?}
*/
OrientationDirective.prototype.onInitialise = /**
* @return {?}
*/
function () {
var _this = this;
this.window.addEventListener('orientationchange', (/**
* @return {?}
*/
function () {
if (_this._isLandScape()) {
_this.mobileNavMenu.canActivateMobileNav = false;
document.body.style.overflowY = 'scroll';
}
}));
};
/**
* @private
* @return {?}
*/
OrientationDirective.prototype._isLandScape = /**
* @private
* @return {?}
*/
function () {
return this.window.outerWidth < this.window.outerHeight;
};
OrientationDirective.decorators = [
{ type: core.Directive, args: [{
selector: '[appCheckOrientation]'
},] }
];
/** @nocollapse */
OrientationDirective.ctorParameters = function () { return [
{ type: Document, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] }] },
{ type: Window, decorators: [{ type: core.Inject, args: [WINDOW,] }] },
{ type: MobileNavigationComponent }
]; };
return OrientationDirective;
}());
if (false) {
/**
* @type {?}
* @private
*/
OrientationDirective.prototype.window;
/**
* @type {?}
* @private
*/
OrientationDirective.prototype.mobileNavMenu;
}
/**
* @fileoverview added by tsickle
* Generated from: app/window/window.ref.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @abstract
*/
var /**
* @abstract
*/
WindowRef = /** @class */ (function () {
function WindowRef() {
}
Object.defineProperty(WindowRef.prototype, "nativeWindow", {
get: /**
* @return {?}
*/
function () {
throw new Error('Not Implemented');
},
enumerable: true,
configurable: true
});
return WindowRef;
}());
/**
* @fileoverview added by tsickle
* Generated from: app/window/browser-window.ref.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var BrowserWindowRef = /** @class */ (function (_super) {
__extends(BrowserWindowRef, _super);
function BrowserWindowRef() {
return _super.call(this) || this;
}
Object.defineProperty(BrowserWindowRef.prototype, "nativeWindow", {
get: /**
* @return {?}
*/
function () {
return window;
},
enumerable: true,
configurable: true
});
return BrowserWindowRef;
}(WindowRef));
/**
* @fileoverview added by tsickle
* Generated from: app/window/window.factory.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} browserWindowRef
* @param {?} platformId
* @return {?}
*/
function WindowFactory(browserWindowRef, platformId) {
if (common.isPlatformBrowser(platformId)) {
return browserWindowRef.nativeWindow;
}
return {};
}
/**
* @fileoverview added by tsickle
* Generated from: app/window/browser-window.provider.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var browserWindowProvider = {
provide: WindowRef,
useClass: BrowserWindowRef
};
var ɵ0 = WindowFactory;
/** @type {?} */
var windowProvider = {
provide: WINDOW,
useFactory: ɵ0,
deps: [WindowRef, core.PLATFORM_ID]
};
/** @type {?} */
var WINDOW_PROVIDERS = [
browserWindowProvider,
windowProvider
];
/**
* @fileoverview added by tsickle
* Generated from: app/factories/default-config.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var defaultConfig = {
navBrandConfig: {
colorPalette: {
primaryColor: '#1976D2',
secondaryColor: '#ffffff',
linkActiveColor: '#1976D2',
linkColor: '#1976D2',
tertiaryColor: '#1976D2',
backGroundColor: '#ffffff'
},
brandImageUrl: 'https://placehold.it/300x300',
zIndex: 1,
boxShadow: true,
},
navigationHomeRoute: {
routePath: '/',
routeName: 'home'
},
navigationMenuRoutes: []
};
/**
* @fileoverview added by tsickle
* Generated from: app/factories/nav-config.factory.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
// @dynamic
var
// @dynamic
NavConfigFactory = /** @class */ (function () {
function NavConfigFactory() {
}
/**
* @private
* @param {?} navLinks
* @return {?}
*/
NavConfigFactory.prototype._mapNavigationMenuRoutes = /**
* @private
* @param {?} navLinks
* @return {?}
*/
function (navLinks) {
return navLinks ? navLinks : defaultConfig.navigationMenuRoutes;
};
/**
* @private
* @param {?} homeRoute
* @return {?}
*/
NavConfigFactory.prototype._mapNavigationHomeRoute = /**
* @private
* @param {?} homeRoute
* @return {?}
*/
function (homeRoute) {
return homeRoute ? homeRoute : defaultConfig.navigationHomeRoute;
};
/**
* @private
* @param {?} styles
* @return {?}
*/
NavConfigFactory.prototype._mapBrandConfig = /**
* @private
* @param {?} styles
* @return {?}
*/
function (styles) {
if (styles !== undefined) {
return {
brandImageUrl: styles.brandImageUrl ? styles.brandImageUrl : defaultConfig.navBrandConfig.brandImageUrl,
colorPalette: this._mapColorPalette(styles.colorPalette),
zIndex: styles.zIndex ? styles.zIndex : defaultConfig.navBrandConfig.zIndex,
boxShadow: (styles.boxShadow === false || styles.boxShadow === true) ? styles.boxShadow : defaultConfig.navBrandConfig.boxShadow,
};
}
return defaultConfig.navBrandConfig;
};
/**
* @private
* @param {?} colorPalette
* @return {?}
*/
NavConfigFactory.prototype._mapColorPalette = /**
* @private
* @param {?} colorPalette
* @return {?}
*/
function (colorPalette) {
if (colorPalette) {
return {
primaryColor: colorPalette.primaryColor,
secondaryColor: colorPalette.secondaryColor,
linkActiveColor: colorPalette.linkActiveColor,
linkColor: colorPalette.linkColor,
tertiaryColor: colorPalette.tertiaryColor,
backGroundColor: colorPalette.backGroundColor,
};
}
return {
primaryColor: defaultConfig.navBrandConfig.colorPalette.primaryColor,
secondaryColor: defaultConfig.navBrandConfig.colorPalette.secondaryColor,
linkActiveColor: defaultConfig.navBrandConfig.colorPalette.linkActiveColor,
linkColor: defaultConfig.navBrandConfig.colorPalette.linkColor,
tertiaryColor: defaultConfig.navBrandConfig.colorPalette.tertiaryColor,
backGroundColor: defaultConfig.navBrandConfig.colorPalette.backGroundColor,
};
};
/**
* @param {?} config
* @return {?}
*/
NavConfigFactory.prototype.for = /**
* @param {?} config
* @return {?}
*/
function (config) {
return {
navigationMenuRoutes: this._mapNavigationMenuRoutes(config.navigationMenuRoutes),
navigationHomeRoute: this._mapNavigationHomeRoute(config.navigationHomeRoute),
navBrandConfig: this._mapBrandConfig(config.navBrandConfig)
};
};
return NavConfigFactory;
}());
/**
* @fileoverview added by tsickle
* Generated from: app/ng-responsive-nav.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var declarations = [
DesktopNavigationComponent,
MobileNavigationComponent,
OrientationDirective,
NgResponsiveNavComponent
];
var NgResponsiveNavModule = /** @class */ (function () {
function NgResponsiveNavModule() {
}
/**
* @param {?} navConfig
* @return {?}
*/
NgResponsiveNavModule.forRoot = /**
* @param {?} navConfig
* @return {?}
*/
function (navConfig) {
/** @type {?} */
var navFactory = new NavConfigFactory();
/** @type {?} */
var navigationConfig = navFactory.for(navConfig);
return {
ngModule: NgResponsiveNavModule,
providers: [
{ provide: NavConfig, useValue: navigationConfig }
]
};
};
NgResponsiveNavModule.decorators = [
{ type: core.NgModule, args: [{
declarations: __spread(declarations),
imports: [
common.CommonModule,
platformBrowser.BrowserModule,
router.RouterModule,
angularFontawesome.FontAwesomeModule
],
exports: [
NgResponsiveNavComponent
],
providers: [
WINDOW_PROVIDERS
]
},] }
];
return NgResponsiveNavModule;
}());
/**
* @fileoverview added by tsickle
* Generated from: app/models/nav-brand.config.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @abstract
*/
var /**
* @abstract
*/
NavBrandConfig = /** @class */ (function () {
function NavBrandConfig() {
}
return NavBrandConfig;
}());
if (false) {
/** @type {?} */
NavBrandConfig.prototype.colorPalette;
/** @type {?} */
NavBrandConfig.prototype.brandImageUrl;
/** @type {?} */
NavBrandConfig.prototype.zIndex;
/** @type {?} */
NavBrandConfig.prototype.boxShadow;
}
/**
* @fileoverview added by tsickle
* Generated from: app/models/nav-routes.config.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @abstract
*/
var /**
* @abstract
*/
NavigationMenuRoute = /** @class */ (function () {
function NavigationMenuRoute() {
}
return NavigationMenuRoute;
}());
if (false) {
/** @type {?} */
NavigationMenuRoute.prototype.routeName;
/** @type {?} */
NavigationMenuRoute.prototype.routePath;
}
exports.BrowserWindowRef = BrowserWindowRef;
exports.DesktopNavigationComponent = DesktopNavigationComponent;
exports.MobileNavigationComponent = MobileNavigationComponent;
exports.NavBrandConfig = NavBrandConfig;
exports.NavConfig = NavConfig;
exports.NavigationMenuRoute = NavigationMenuRoute;
exports.NgResponsiveNavComponent = NgResponsiveNavComponent;
exports.NgResponsiveNavModule = NgResponsiveNavModule;
exports.WINDOW = WINDOW;
exports.WINDOW_PROVIDERS = WINDOW_PROVIDERS;
exports.WindowFactory = WindowFactory;
exports.WindowRef = WindowRef;
exports.ɵa = OrientationDirective;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=ng-responsive-nav.umd.js.map