111 lines
13 KiB
JavaScript
111 lines
13 KiB
JavaScript
|
import { CommonModule } from '@angular/common';
|
||
|
import { ChangeDetectionStrategy, Component, ContentChildren, Input, NgModule, ViewEncapsulation } from '@angular/core';
|
||
|
import { PrimeTemplate } from 'primeng/api';
|
||
|
import * as i0 from "@angular/core";
|
||
|
import * as i1 from "@angular/common";
|
||
|
/**
|
||
|
* Toolbar is a grouping component for buttons and other content.
|
||
|
* @group Components
|
||
|
*/
|
||
|
export class Toolbar {
|
||
|
el;
|
||
|
/**
|
||
|
* Inline style of the component.
|
||
|
* @group Props
|
||
|
*/
|
||
|
style;
|
||
|
/**
|
||
|
* Style class of the component.
|
||
|
* @group Props
|
||
|
*/
|
||
|
styleClass;
|
||
|
/**
|
||
|
* Defines a string value that labels an interactive element.
|
||
|
* @group Props
|
||
|
*/
|
||
|
ariaLabelledBy;
|
||
|
templates;
|
||
|
startTemplate;
|
||
|
endTemplate;
|
||
|
centerTemplate;
|
||
|
constructor(el) {
|
||
|
this.el = el;
|
||
|
}
|
||
|
getBlockableElement() {
|
||
|
return this.el.nativeElement.children[0];
|
||
|
}
|
||
|
ngAfterContentInit() {
|
||
|
this.templates.forEach((item) => {
|
||
|
switch (item.getType()) {
|
||
|
case 'start':
|
||
|
case 'left':
|
||
|
this.startTemplate = item.template;
|
||
|
break;
|
||
|
case 'end':
|
||
|
case 'right':
|
||
|
this.endTemplate = item.template;
|
||
|
break;
|
||
|
case 'center':
|
||
|
this.centerTemplate = item.template;
|
||
|
break;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Toolbar, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
||
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: Toolbar, selector: "p-toolbar", inputs: { style: "style", styleClass: "styleClass", ariaLabelledBy: "ariaLabelledBy" }, host: { classAttribute: "p-element" }, queries: [{ propertyName: "templates", predicate: PrimeTemplate }], ngImport: i0, template: `
|
||
|
<div [ngClass]="'p-toolbar p-component'" [attr.aria-labelledby]="ariaLabelledBy" [ngStyle]="style" [class]="styleClass" role="toolbar" [attr.data-pc-name]="'toolbar'">
|
||
|
<ng-content></ng-content>
|
||
|
<div class="p-toolbar-group-left p-toolbar-group-start" *ngIf="startTemplate" [attr.data-pc-section]="'start'">
|
||
|
<ng-container *ngTemplateOutlet="startTemplate"></ng-container>
|
||
|
</div>
|
||
|
<div class="p-toolbar-group-center" *ngIf="centerTemplate" [attr.data-pc-section]="'center'">
|
||
|
<ng-container *ngTemplateOutlet="centerTemplate"></ng-container>
|
||
|
</div>
|
||
|
<div class="p-toolbar-group-right p-toolbar-group-end" *ngIf="endTemplate" [attr.data-pc-section]="'end'">
|
||
|
<ng-container *ngTemplateOutlet="endTemplate"></ng-container>
|
||
|
</div>
|
||
|
</div>
|
||
|
`, isInline: true, styles: ["@layer primeng{.p-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap}.p-toolbar-group-start,.p-toolbar-group-center,.p-toolbar-group-end,.p-toolbar-group-left,.p-toolbar-group-right{display:flex;align-items:center}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
||
|
}
|
||
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Toolbar, decorators: [{
|
||
|
type: Component,
|
||
|
args: [{ selector: 'p-toolbar', template: `
|
||
|
<div [ngClass]="'p-toolbar p-component'" [attr.aria-labelledby]="ariaLabelledBy" [ngStyle]="style" [class]="styleClass" role="toolbar" [attr.data-pc-name]="'toolbar'">
|
||
|
<ng-content></ng-content>
|
||
|
<div class="p-toolbar-group-left p-toolbar-group-start" *ngIf="startTemplate" [attr.data-pc-section]="'start'">
|
||
|
<ng-container *ngTemplateOutlet="startTemplate"></ng-container>
|
||
|
</div>
|
||
|
<div class="p-toolbar-group-center" *ngIf="centerTemplate" [attr.data-pc-section]="'center'">
|
||
|
<ng-container *ngTemplateOutlet="centerTemplate"></ng-container>
|
||
|
</div>
|
||
|
<div class="p-toolbar-group-right p-toolbar-group-end" *ngIf="endTemplate" [attr.data-pc-section]="'end'">
|
||
|
<ng-container *ngTemplateOutlet="endTemplate"></ng-container>
|
||
|
</div>
|
||
|
</div>
|
||
|
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
||
|
class: 'p-element'
|
||
|
}, styles: ["@layer primeng{.p-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap}.p-toolbar-group-start,.p-toolbar-group-center,.p-toolbar-group-end,.p-toolbar-group-left,.p-toolbar-group-right{display:flex;align-items:center}}\n"] }]
|
||
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { style: [{
|
||
|
type: Input
|
||
|
}], styleClass: [{
|
||
|
type: Input
|
||
|
}], ariaLabelledBy: [{
|
||
|
type: Input
|
||
|
}], templates: [{
|
||
|
type: ContentChildren,
|
||
|
args: [PrimeTemplate]
|
||
|
}] } });
|
||
|
export class ToolbarModule {
|
||
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: ToolbarModule, declarations: [Toolbar], imports: [CommonModule], exports: [Toolbar] });
|
||
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ToolbarModule, imports: [CommonModule] });
|
||
|
}
|
||
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ToolbarModule, decorators: [{
|
||
|
type: NgModule,
|
||
|
args: [{
|
||
|
imports: [CommonModule],
|
||
|
exports: [Toolbar],
|
||
|
declarations: [Toolbar]
|
||
|
}]
|
||
|
}] });
|
||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy90b29sYmFyL3Rvb2xiYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBb0IsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLGVBQWUsRUFBYyxLQUFLLEVBQUUsUUFBUSxFQUEwQixpQkFBaUIsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUM5SyxPQUFPLEVBQWUsYUFBYSxFQUFFLE1BQU0sYUFBYSxDQUFDOzs7QUFDekQ7OztHQUdHO0FBd0JILE1BQU0sT0FBTyxPQUFPO0lBeUJJO0lBeEJwQjs7O09BR0c7SUFDTSxLQUFLLENBQThDO0lBQzVEOzs7T0FHRztJQUNNLFVBQVUsQ0FBcUI7SUFDeEM7OztPQUdHO0lBQ00sY0FBYyxDQUFxQjtJQUVaLFNBQVMsQ0FBdUM7SUFFaEYsYUFBYSxDQUErQjtJQUU1QyxXQUFXLENBQStCO0lBRTFDLGNBQWMsQ0FBK0I7SUFFN0MsWUFBb0IsRUFBYztRQUFkLE9BQUUsR0FBRixFQUFFL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