ng-sidebar
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +11,4 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { Directive } from '@angular/core'; | ||
import { SidebarService } from './sidebar.service'; | ||
var core_1 = require("@angular/core"); | ||
var sidebar_service_1 = require("./sidebar.service"); | ||
var CloseSidebar = (function () { | ||
@@ -24,3 +25,3 @@ function CloseSidebar(_sidebarService) { | ||
CloseSidebar = __decorate([ | ||
Directive({ | ||
core_1.Directive({ | ||
selector: '[closeSidebar]', | ||
@@ -31,4 +32,4 @@ host: { | ||
}), | ||
__metadata("design:paramtypes", [SidebarService]) | ||
__metadata("design:paramtypes", [sidebar_service_1.SidebarService]) | ||
], CloseSidebar); | ||
export { CloseSidebar }; | ||
exports.CloseSidebar = CloseSidebar; |
@@ -1,5 +0,11 @@ | ||
export { CloseSidebar } from './close.directive'; | ||
export { Sidebar } from './sidebar.component'; | ||
export { SidebarModule } from './sidebar.module'; | ||
export { SidebarService } from './sidebar.service'; | ||
export { SidebarContainer } from './sidebar-container.component'; | ||
"use strict"; | ||
var close_directive_1 = require("./close.directive"); | ||
exports.CloseSidebar = close_directive_1.CloseSidebar; | ||
var sidebar_component_1 = require("./sidebar.component"); | ||
exports.Sidebar = sidebar_component_1.Sidebar; | ||
var sidebar_module_1 = require("./sidebar.module"); | ||
exports.SidebarModule = sidebar_module_1.SidebarModule; | ||
var sidebar_service_1 = require("./sidebar.service"); | ||
exports.SidebarService = sidebar_service_1.SidebarService; | ||
var sidebar_container_component_1 = require("./sidebar-container.component"); | ||
exports.SidebarContainer = sidebar_container_component_1.SidebarContainer; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +11,4 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, Input, QueryList, ViewEncapsulation } from '@angular/core'; | ||
import { Sidebar } from './sidebar.component'; | ||
var core_1 = require("@angular/core"); | ||
var sidebar_component_1 = require("./sidebar.component"); | ||
// Based on https://github.com/angular/material2/tree/master/src/lib/sidenav | ||
@@ -122,19 +123,19 @@ var SidebarContainer = (function () { | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], SidebarContainer.prototype, "backdropClass", void 0); | ||
__decorate([ | ||
ContentChildren(Sidebar), | ||
__metadata("design:type", QueryList) | ||
core_1.ContentChildren(sidebar_component_1.Sidebar), | ||
__metadata("design:type", core_1.QueryList) | ||
], SidebarContainer.prototype, "_sidebars", void 0); | ||
SidebarContainer = __decorate([ | ||
Component({ | ||
core_1.Component({ | ||
selector: 'ng-sidebar-container', | ||
template: "\n <ng-content select=\"ng-sidebar\"></ng-content>\n\n <div *ngIf=\"_showBackdrop\"\n aria-hidden=\"true\"\n class=\"ng-sidebar__backdrop\"\n [ngClass]=\"backdropClass\"></div>\n\n <div class=\"ng-sidebar__content\" [ngStyle]=\"_getStyles()\">\n <ng-content></ng-content>\n </div>\n ", | ||
styles: ["\n ng-sidebar-container {\n box-sizing: border-box;\n display: block;\n position: relative;\n }\n\n .ng-sidebar__backdrop {\n background: #000;\n height: 100%;\n left: 0;\n opacity: 0.75;\n pointer-events: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 99999998;\n }\n\n .ng-sidebar__content {\n display: block;\n height: 100%;\n overflow: auto;\n }\n "], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None | ||
changeDetection: core_1.ChangeDetectionStrategy.OnPush, | ||
encapsulation: core_1.ViewEncapsulation.None | ||
}), | ||
__metadata("design:paramtypes", [ChangeDetectorRef]) | ||
__metadata("design:paramtypes", [core_1.ChangeDetectorRef]) | ||
], SidebarContainer); | ||
export { SidebarContainer }; | ||
exports.SidebarContainer = SidebarContainer; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -13,5 +14,5 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Inject, Input, Output, ViewChild, ViewEncapsulation } from '@angular/core'; | ||
import { DOCUMENT } from '@angular/platform-browser'; | ||
import { SidebarService } from './sidebar.service'; | ||
var core_1 = require("@angular/core"); | ||
var platform_browser_1 = require("@angular/platform-browser"); | ||
var sidebar_service_1 = require("./sidebar.service"); | ||
var Sidebar = (function () { | ||
@@ -23,3 +24,3 @@ function Sidebar(_document /*: HTMLDocument */, _sidebarService) { | ||
this.opened = false; | ||
this.openedChange = new EventEmitter(); | ||
this.openedChange = new core_1.EventEmitter(); | ||
this.mode = 'over'; | ||
@@ -35,8 +36,8 @@ this.dockedSize = '0px'; | ||
this.keyCode = 27; // Default to ESCAPE key | ||
this.onOpenStart = new EventEmitter(); | ||
this.onOpened = new EventEmitter(); | ||
this.onCloseStart = new EventEmitter(); | ||
this.onClosed = new EventEmitter(); | ||
this.onModeChange = new EventEmitter(); | ||
this.onPositionChange = new EventEmitter(); | ||
this.onOpenStart = new core_1.EventEmitter(); | ||
this.onOpened = new core_1.EventEmitter(); | ||
this.onCloseStart = new core_1.EventEmitter(); | ||
this.onClosed = new core_1.EventEmitter(); | ||
this.onModeChange = new core_1.EventEmitter(); | ||
this.onPositionChange = new core_1.EventEmitter(); | ||
this._focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]),' + | ||
@@ -141,8 +142,8 @@ 'textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]'; | ||
transformStyle = "translate" + ((this.position === 'left' || this.position === 'right') ? 'X' : 'Y'); | ||
var leftOrTop = this.position === 'left' || this.position === 'top'; | ||
var isLeftOrTop = this.position === 'left' || this.position === 'top'; | ||
var isDockMode = this.mode === 'dock'; | ||
// We use 110% for non-docked modes in an attempt to hide any box-shadow | ||
var translateAmt = "" + (leftOrTop ? '-' : '') + (isDockMode ? '100' : '110') + "%"; | ||
var translateAmt = "" + (isLeftOrTop ? '-' : '') + (isDockMode ? '100' : '110') + "%"; | ||
if (isDockMode && parseFloat(this.dockedSize) > 0) { | ||
transformStyle += "(calc(" + translateAmt + " " + (leftOrTop ? '+' : '-') + " " + this.dockedSize + "))"; | ||
transformStyle += "(calc(" + translateAmt + " " + (isLeftOrTop ? '+' : '-') + " " + this.dockedSize + "))"; | ||
} | ||
@@ -394,96 +395,96 @@ else { | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Boolean) | ||
], Sidebar.prototype, "opened", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
core_1.Output(), | ||
__metadata("design:type", core_1.EventEmitter) | ||
], Sidebar.prototype, "openedChange", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], Sidebar.prototype, "mode", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], Sidebar.prototype, "dockedSize", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], Sidebar.prototype, "position", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Boolean) | ||
], Sidebar.prototype, "animate", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], Sidebar.prototype, "sidebarClass", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", String) | ||
], Sidebar.prototype, "ariaLabel", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Boolean) | ||
], Sidebar.prototype, "trapFocus", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Boolean) | ||
], Sidebar.prototype, "autoFocus", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Boolean) | ||
], Sidebar.prototype, "showBackdrop", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Boolean) | ||
], Sidebar.prototype, "closeOnClickOutside", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Boolean) | ||
], Sidebar.prototype, "keyClose", void 0); | ||
__decorate([ | ||
Input(), | ||
core_1.Input(), | ||
__metadata("design:type", Number) | ||
], Sidebar.prototype, "keyCode", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
core_1.Output(), | ||
__metadata("design:type", core_1.EventEmitter) | ||
], Sidebar.prototype, "onOpenStart", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
core_1.Output(), | ||
__metadata("design:type", core_1.EventEmitter) | ||
], Sidebar.prototype, "onOpened", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
core_1.Output(), | ||
__metadata("design:type", core_1.EventEmitter) | ||
], Sidebar.prototype, "onCloseStart", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
core_1.Output(), | ||
__metadata("design:type", core_1.EventEmitter) | ||
], Sidebar.prototype, "onClosed", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
core_1.Output(), | ||
__metadata("design:type", core_1.EventEmitter) | ||
], Sidebar.prototype, "onModeChange", void 0); | ||
__decorate([ | ||
Output(), | ||
__metadata("design:type", EventEmitter) | ||
core_1.Output(), | ||
__metadata("design:type", core_1.EventEmitter) | ||
], Sidebar.prototype, "onPositionChange", void 0); | ||
__decorate([ | ||
ViewChild('sidebar'), | ||
__metadata("design:type", ElementRef) | ||
core_1.ViewChild('sidebar'), | ||
__metadata("design:type", core_1.ElementRef) | ||
], Sidebar.prototype, "_elSidebar", void 0); | ||
Sidebar = __decorate([ | ||
Component({ | ||
core_1.Component({ | ||
selector: 'ng-sidebar', | ||
template: "\n <aside #sidebar\n role=\"complementary\"\n [attr.aria-hidden]=\"!opened\"\n [attr.aria-label]=\"ariaLabel\"\n class=\"ng-sidebar ng-sidebar--{{opened ? 'opened' : 'closed'}} ng-sidebar--{{position}} ng-sidebar--{{mode}}\"\n [class.ng-sidebar--inert]=\"!opened && mode !== 'dock'\"\n [class.ng-sidebar--animate]=\"animate\"\n [ngClass]=\"sidebarClass\"\n [ngStyle]=\"_getTransformStyle()\">\n <ng-content></ng-content>\n </aside>\n ", | ||
styles: ["\n .ng-sidebar {\n background-color: #fff;\n overflow: auto;\n pointer-events: auto;\n position: absolute;\n will-change: initial;\n z-index: 99999999;\n }\n\n .ng-sidebar--left {\n bottom: 0;\n left: 0;\n top: 0;\n }\n\n .ng-sidebar--right {\n bottom: 0;\n right: 0;\n top: 0;\n }\n\n .ng-sidebar--top {\n left: 0;\n right: 0;\n top: 0;\n }\n\n .ng-sidebar--bottom {\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n .ng-sidebar--inert {\n pointer-events: none;\n will-change: transform;\n }\n\n .ng-sidebar--animate.ng-sidebar {\n -webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.3, 1);\n transition: transform 0.3s cubic-bezier(0, 0, 0.3, 1);\n }\n "], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
encapsulation: ViewEncapsulation.None | ||
changeDetection: core_1.ChangeDetectionStrategy.OnPush, | ||
encapsulation: core_1.ViewEncapsulation.None | ||
}), | ||
__param(0, Inject(DOCUMENT)), | ||
__metadata("design:paramtypes", [Object, SidebarService]) | ||
__param(0, core_1.Inject(platform_browser_1.DOCUMENT)), | ||
__metadata("design:paramtypes", [Object, sidebar_service_1.SidebarService]) | ||
], Sidebar); | ||
export { Sidebar }; | ||
exports.Sidebar = Sidebar; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,11 +8,8 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Sidebar } from './sidebar.component'; | ||
import { SidebarContainer } from './sidebar-container.component'; | ||
import { SidebarService } from './sidebar.service'; | ||
import { CloseSidebar } from './close.directive'; | ||
var core_1 = require("@angular/core"); | ||
var common_1 = require("@angular/common"); | ||
var sidebar_component_1 = require("./sidebar.component"); | ||
var sidebar_container_component_1 = require("./sidebar-container.component"); | ||
var sidebar_service_1 = require("./sidebar.service"); | ||
var close_directive_1 = require("./close.directive"); | ||
var SidebarModule = (function () { | ||
@@ -23,10 +21,9 @@ function SidebarModule() { | ||
SidebarModule = __decorate([ | ||
NgModule({ | ||
declarations: [Sidebar, SidebarContainer, CloseSidebar], | ||
imports: [CommonModule], | ||
exports: [Sidebar, SidebarContainer, CloseSidebar], | ||
providers: [SidebarService] | ||
}), | ||
__metadata("design:paramtypes", []) | ||
core_1.NgModule({ | ||
declarations: [sidebar_component_1.Sidebar, sidebar_container_component_1.SidebarContainer, close_directive_1.CloseSidebar], | ||
imports: [common_1.CommonModule], | ||
exports: [sidebar_component_1.Sidebar, sidebar_container_component_1.SidebarContainer, close_directive_1.CloseSidebar], | ||
providers: [sidebar_service_1.SidebarService] | ||
}) | ||
], SidebarModule); | ||
export { SidebarModule }; | ||
exports.SidebarModule = SidebarModule; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,11 +8,8 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { Injectable } from '@angular/core'; | ||
import { Subject } from 'rxjs/Subject'; | ||
var core_1 = require("@angular/core"); | ||
var Subject_1 = require("rxjs/Subject"); | ||
var SidebarService = (function () { | ||
function SidebarService() { | ||
this._openObserver = new Subject(); | ||
this._closeObserver = new Subject(); | ||
this._openObserver = new Subject_1.Subject(); | ||
this._closeObserver = new Subject_1.Subject(); | ||
} | ||
@@ -33,5 +31,4 @@ SidebarService.prototype.open = function () { | ||
SidebarService = __decorate([ | ||
Injectable(), | ||
__metadata("design:paramtypes", []) | ||
core_1.Injectable() | ||
], SidebarService); | ||
export { SidebarService }; | ||
exports.SidebarService = SidebarService; |
{ | ||
"name": "ng-sidebar", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Angular 2+ sidebar component.", | ||
@@ -42,13 +42,13 @@ "repository": { | ||
"devDependencies": { | ||
"@angular/common": "^2.4.2", | ||
"@angular/compiler": "^2.4.2", | ||
"@angular/compiler-cli": "^2.4.2", | ||
"@angular/core": "^2.4.2", | ||
"@angular/platform-browser": "^2.4.2", | ||
"@angular/common": "^2.4.3", | ||
"@angular/compiler": "^2.4.3", | ||
"@angular/compiler-cli": "^2.4.3", | ||
"@angular/core": "^2.4.3", | ||
"@angular/platform-browser": "^2.4.3", | ||
"rimraf": "^2.5.4", | ||
"rxjs": "5.0.3", | ||
"tslint": "^4.3.1", | ||
"typescript": "^2.1.4", | ||
"typescript": "^2.1.5", | ||
"zone.js": "^0.7.4" | ||
} | ||
} |
@@ -242,10 +242,10 @@ import { | ||
const leftOrTop: boolean = this.position === 'left' || this.position === 'top'; | ||
const isLeftOrTop: boolean = this.position === 'left' || this.position === 'top'; | ||
const isDockMode: boolean = this.mode === 'dock'; | ||
// We use 110% for non-docked modes in an attempt to hide any box-shadow | ||
const translateAmt: string = `${leftOrTop ? '-' : ''}${isDockMode ? '100' : '110'}%`; | ||
const translateAmt: string = `${isLeftOrTop ? '-' : ''}${isDockMode ? '100' : '110'}%`; | ||
if (isDockMode && parseFloat(this.dockedSize) > 0) { | ||
transformStyle += `(calc(${translateAmt} ${leftOrTop ? '+' : '-'} ${this.dockedSize}))`; | ||
transformStyle += `(calc(${translateAmt} ${isLeftOrTop ? '+' : '-'} ${this.dockedSize}))`; | ||
} else { | ||
@@ -252,0 +252,0 @@ transformStyle += `(${translateAmt})`; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85902
1510