Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AfterContentInit, ContentChild, Directive, TemplateRef } from '@angular/core';
import { DataTableComponent } from '../components/datatable/datatable.component';
/**
* Directive selectors without adf- prefix will be deprecated on 3.0.0
*/
@Directive({
selector: 'adf-no-content-template, no-content-template'
})
export class NoContentTemplateDirective implements AfterContentInit {
@ContentChild(TemplateRef)
template: any;
constructor(private dataTable: DataTableComponent) {
}
ngAfterContentInit() {
if (this.dataTable) {
this.dataTable.noContentTemplate = this.template;
}
}
}
import { Directive, ElementRef, HostListener, HostBinding } from '@angular/core';
import { BaThemeConfigProvider } from '../../../shared/theme';
import { BaCardBlurHelper } from './ba-card-blur-helper.service';
import { BgMetrics } from './bg-metrics';
@Directive({
selector: '[baCardBlur]',
providers: [BaCardBlurHelper]
})
export class BaCardBlurDirective {
@HostBinding('class.card-blur') isEnabled = false;
private _bodyBgSize: BgMetrics;
constructor(private _baConfig: BaThemeConfigProvider, private _baCardBlurHelper: BaCardBlurHelper, private _el: ElementRef) {
if (this._isEnabled()) {
this._baCardBlurHelper.init();
this._getBodyImageSizesOnBgLoad();
this._recalculateCardStylesOnBgLoad();
this.isEnabled = true;
import { Directive, HostListener } from '@angular/core';
@Directive({
selector: '[appScrollMonitor]'
})
export class ScrollMonitorDirective {
@HostListener('scroll', ['$event.target'])
onScroll({scrollHeight, clientHeight, scrollTop}: {scrollHeight: number; clientHeight: number; scrollTop: number}) {
const limit = scrollHeight - clientHeight;
console.log(scrollTop, limit);
}
}
import { Directive, Self, OnInit, Optional } from '@angular/core';
import { LayerListService } from '@igo2/geo';
import { ShareMapComponent } from './share-map.component';
import { RouteService } from '@igo2/core';
@Directive({
selector: '[igoShareMapBinding]'
})
export class ShareMapBindingDirective implements OnInit {
private component: ShareMapComponent;
constructor(
@Self() component: ShareMapComponent,
private layerListService: LayerListService,
@Optional() private route: RouteService
) {
this.component = component;
}
ngOnInit() {
this.initRoutes();
}
import {Directive, HostListener, Input, ViewContainerRef} from "@angular/core";
import {MenuItem} from "../menu/menu-item";
import {ContextService} from "./context.service";
@Directive({
selector: "[ct-context]"
})
export class ContextDirective {
@Input("ct-context")
private contextMenuItems: MenuItem[];
constructor(private context: ContextService,
private viewContainer: ViewContainerRef) {
}
@HostListener("contextmenu", ["$event"])
private onRightClick(event: MouseEvent) {
event.preventDefault();
if (!this.contextMenuItems) {
return;
*
* ## Further Customizing Refresher Content
*
* The `ion-refresher` component holds the refresh logic.
* It requires a child component in order to display the content.
* Ionic uses `ion-refresher-content` by default. This component
* displays the refresher and changes the look depending
* on the refresher's state. Separating these components
* allows developers to create their own refresher content
* components. You could replace our default content with
* custom SVG or CSS animations.
*
* @demo /docs/demos/src/refresher/
*
*/
@Directive({
selector: 'ion-refresher',
host: {
'[class.refresher-active]': 'state !== "inactive"',
'[style.top]': '_top'
}
})
export class Refresher {
_appliedStyles: boolean = false;
_didStart: boolean;
_lastCheck: number = 0;
_isEnabled: boolean = true;
_gesture: GestureDelegate;
_events: UIEventManager;
_pointerEvents: PointerEvents;
_top: string = '';
import { environment } from '@sunbird/environment';
import { animate, AnimationBuilder, AnimationMetadata, AnimationPlayer, style } from '@angular/animations';
import { AfterViewInit, Directive, ElementRef, Inject, OnDestroy, NgZone, ChangeDetectorRef, } from '@angular/core';
import { fromEvent, Subject } from 'rxjs';
import { distinctUntilChanged, filter, map, pairwise, share, throttleTime, takeUntil, tap } from 'rxjs/operators';
enum Direction {
Up = 'Up',
Down = 'Down',
None = 'None'
}
/** @dynamic */
@Directive({
selector: '[appStickyHeader]'
})
export class StickyHeaderDirective implements AfterViewInit, OnDestroy {
player: AnimationPlayer;
public unsubscribe = new Subject();
isOffline: boolean = environment.isOffline;
set show(show: boolean) {
if (this.player) {
this.player.destroy();
}
const metadata = show ? this.fadeIn() : this.fadeOut();
const factory = this.builder.build(metadata);
const player = factory.create(this.el.nativeElement);
import { Directive, TemplateRef } from '@angular/core';
@Directive({selector: '[nglDatatableHeading]'})
export class NglDatatableHeadingTemplateDirective {
constructor(public templateRef: TemplateRef) {
}
}
import { Directive, ElementRef, Injector, Input } from '@angular/core';
import { UpgradeComponent } from '@angular/upgrade/static';
@Directive({
selector: 'sankey'
})
export class SankeyNg1Component extends UpgradeComponent {
@Input() chartSize: any;
@Input() chartData: any;
@Input() options: any;
@Input() click: any;
constructor(elementRef: ElementRef, injector: Injector) {
super('uxSankeyNg1', elementRef, injector);
}
}
import { Directive, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
@Directive({selector: '[nglPolymorphicItem]'})
export class NglLookupScopeItem {
@Input() scopes: any[] = [];
@Output() scopeChange = new EventEmitter();
constructor(public templateRef: TemplateRef) {}
}