UNPKG

primeng

Version:

PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,

168 lines (163 loc) 8.81 kB
export * from 'primeng/types/toolbar'; import { NgTemplateOutlet } from '@angular/common'; import * as i0 from '@angular/core'; import { Injectable, InjectionToken, inject, input, contentChild, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core'; import { SharedModule } from 'primeng/api'; import { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent'; import * as i1 from 'primeng/bind'; import { Bind, BindModule } from 'primeng/bind'; import { style } from '@primeuix/styles/toolbar'; import { BaseStyle } from 'primeng/base'; const classes = { root: () => ['p-toolbar p-component'], start: 'p-toolbar-start', center: 'p-toolbar-center', end: 'p-toolbar-end' }; class ToolbarStyle extends BaseStyle { name = 'toolbar'; style = style; classes = classes; static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToolbarStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToolbarStyle }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToolbarStyle, decorators: [{ type: Injectable }] }); /** * * Toolbar is a grouping component for buttons and other content. * * [Live Demo](https://www.primeng.org/toolbar/) * * @module toolbarstyle * */ var ToolbarClasses; (function (ToolbarClasses) { /** * Class name of the root element */ ToolbarClasses["root"] = "p-toolbar"; /** * Class name of the start element */ ToolbarClasses["start"] = "p-toolbar-start"; /** * Class name of the center element */ ToolbarClasses["center"] = "p-toolbar-center"; /** * Class name of the end element */ ToolbarClasses["end"] = "p-toolbar-end"; })(ToolbarClasses || (ToolbarClasses = {})); const TOOLBAR_INSTANCE = new InjectionToken('TOOLBAR_INSTANCE'); /** * Toolbar is a grouping component for buttons and other content. * @group Components */ class Toolbar extends BaseComponent { componentName = 'Toolbar'; $pcToolbar = inject(TOOLBAR_INSTANCE, { optional: true, skipSelf: true }) ?? undefined; bindDirectiveInstance = inject(Bind, { self: true }); onAfterViewChecked() { this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root'])); } /** * Defines a string value that labels an interactive element. * @group Props */ ariaLabelledBy = input(/* @ts-ignore */ ...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ [])); _componentStyle = inject(ToolbarStyle); getBlockableElement() { return this.el.nativeElement.children[0]; } /** * Custom start template. * @group Templates */ startTemplate = contentChild('start', { ...(ngDevMode ? { debugName: "startTemplate" } : /* istanbul ignore next */ {}), descendants: false }); /** * Custom end template. * @group Templates */ endTemplate = contentChild('end', { ...(ngDevMode ? { debugName: "endTemplate" } : /* istanbul ignore next */ {}), descendants: false }); /** * Custom center template. * @group Templates */ centerTemplate = contentChild('center', { ...(ngDevMode ? { debugName: "centerTemplate" } : /* istanbul ignore next */ {}), descendants: false }); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: Toolbar, deps: null, target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: Toolbar, isStandalone: true, selector: "p-toolbar", inputs: { ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "toolbar" }, properties: { "class": "cx(\"root\")", "attr.aria-labelledby": "ariaLabelledBy()" } }, providers: [ToolbarStyle, { provide: TOOLBAR_INSTANCE, useExisting: Toolbar }, { provide: PARENT_INSTANCE, useExisting: Toolbar }], queries: [{ propertyName: "startTemplate", first: true, predicate: ["start"], isSignal: true }, { propertyName: "endTemplate", first: true, predicate: ["end"], isSignal: true }, { propertyName: "centerTemplate", first: true, predicate: ["center"], isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0, template: ` <ng-content></ng-content> @if (startTemplate()) { <div [class]="cx('start')" [pBind]="ptm('start')"> <ng-container *ngTemplateOutlet="startTemplate()"></ng-container> </div> } @if (centerTemplate()) { <div [class]="cx('center')" [pBind]="ptm('center')"> <ng-container *ngTemplateOutlet="centerTemplate()"></ng-container> </div> } @if (endTemplate()) { <div [class]="cx('end')" [pBind]="ptm('end')"> <ng-container *ngTemplateOutlet="endTemplate()"></ng-container> </div> } `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i1.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: Toolbar, decorators: [{ type: Component, args: [{ selector: 'p-toolbar', standalone: true, imports: [NgTemplateOutlet, SharedModule, BindModule], template: ` <ng-content></ng-content> @if (startTemplate()) { <div [class]="cx('start')" [pBind]="ptm('start')"> <ng-container *ngTemplateOutlet="startTemplate()"></ng-container> </div> } @if (centerTemplate()) { <div [class]="cx('center')" [pBind]="ptm('center')"> <ng-container *ngTemplateOutlet="centerTemplate()"></ng-container> </div> } @if (endTemplate()) { <div [class]="cx('end')" [pBind]="ptm('end')"> <ng-container *ngTemplateOutlet="endTemplate()"></ng-container> </div> } `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [ToolbarStyle, { provide: TOOLBAR_INSTANCE, useExisting: Toolbar }, { provide: PARENT_INSTANCE, useExisting: Toolbar }], host: { '[class]': 'cx("root")', role: 'toolbar', '[attr.aria-labelledby]': 'ariaLabelledBy()' }, hostDirectives: [Bind] }] }], propDecorators: { ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], startTemplate: [{ type: i0.ContentChild, args: ['start', { ...{ descendants: false }, isSignal: true }] }], endTemplate: [{ type: i0.ContentChild, args: ['end', { ...{ descendants: false }, isSignal: true }] }], centerTemplate: [{ type: i0.ContentChild, args: ['center', { ...{ descendants: false }, isSignal: true }] }] } }); class ToolbarModule { static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: ToolbarModule, imports: [Toolbar, SharedModule, BindModule], exports: [Toolbar, SharedModule, BindModule] }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToolbarModule, imports: [Toolbar, SharedModule, BindModule, SharedModule, BindModule] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ToolbarModule, decorators: [{ type: NgModule, args: [{ imports: [Toolbar, SharedModule, BindModule], exports: [Toolbar, SharedModule, BindModule] }] }] }); /** * Generated bundle index. Do not edit. */ export { Toolbar, ToolbarClasses, ToolbarModule, ToolbarStyle }; //# sourceMappingURL=primeng-toolbar.mjs.map