primeng
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primeng) [ • 2.25 kB
JavaScript
import { Component, ChangeDetectionStrategy, ViewEncapsulation, ElementRef, Input, ContentChildren, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PrimeTemplate } from 'primeng/api';
class Toolbar {
constructor(el) {
this.el = el;
}
getBlockableElement() {
return this.el.nativeElement.children[0];
}
ngAfterContentInit() {
this.templates.forEach((item) => {
switch (item.getType()) {
case 'left':
this.leftTemplate = item.template;
break;
case 'right':
this.rightTemplate = item.template;
break;
}
});
}
}
Toolbar.decorators = [
{ type: Component, args: [{
selector: 'p-toolbar',
template: `
<div [ngClass]="'p-toolbar p-component'" [ngStyle]="style" [class]="styleClass" role="toolbar">
<ng-content></ng-content>
<div class="p-toolbar-group-left" *ngIf="leftTemplate">
<ng-container *ngTemplateOutlet="leftTemplate"></ng-container>
</div>
<div class="p-toolbar-group-right" *ngIf="rightTemplate">
<ng-container *ngTemplateOutlet="rightTemplate"></ng-container>
</div>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
styles: [".p-toolbar{flex-wrap:wrap;justify-content:space-between}.p-toolbar,.p-toolbar-group-left,.p-toolbar-group-right{align-items:center;display:flex}"]
},] }
];
Toolbar.ctorParameters = () => [
{ type: ElementRef }
];
Toolbar.propDecorators = {
style: [{ type: Input }],
styleClass: [{ type: Input }],
templates: [{ type: ContentChildren, args: [PrimeTemplate,] }]
};
class ToolbarModule {
}
ToolbarModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule],
exports: [Toolbar],
declarations: [Toolbar]
},] }
];
/**
* Generated bundle index. Do not edit.
*/
export { Toolbar, ToolbarModule };
//# sourceMappingURL=primeng-toolbar.js.map