68 lines
2.3 KiB
JavaScript
68 lines
2.3 KiB
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{-ms-flex-pack:justify;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-content:space-between}.p-toolbar,.p-toolbar-group-left,.p-toolbar-group-right{-ms-flex-align:center;align-items:center;display:-ms-flexbox;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
|