UNPKG

primeng

Version:

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

168 lines (149 loc) 6.26 kB
import { CommonModule } from '@angular/common'; import * as i0 from '@angular/core'; import { Injectable, inject, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core'; import { BaseComponent } from 'primeng/basecomponent'; import { BaseStyle } from 'primeng/base'; const theme = ({ dt }) => ` .p-buttongroup .p-button { margin: 0; } .p-buttongroup .p-button:not(:last-child), .p-buttongroup .p-button:not(:last-child):hover { border-right: 0 none; } .p-buttongroup .p-button:not(:first-of-type):not(:last-of-type) { border-radius: 0; } .p-buttongroup .p-button:first-of-type:not(:only-of-type) { border-start-end-radius: 0; border-end-end-radius: 0; } .p-buttongroup .p-button:last-of-type:not(:only-of-type) { border-start-start-radius: 0; border-end-start-radius: 0; } .p-buttongroup .p-button:focus { position: relative; z-index: 1; } .p-buttongroup { display:flex; } .p-buttongroup > .p-button { flex: 1; } /* For PrimeNG */ .p-buttongroup .p-button:focus, .p-buttongroup p-button:focus .p-button, .p-buttonset .p-button:focus, .p-buttonset .p-button:focus, .p-buttonset p-button:focus .p-button, .p-buttonset .p-button:focus { position: relative; z-index: 1; } .p-buttongroup .p-button:not(:last-child), .p-buttongroup .p-button:not(:last-child):hover, .p-buttongroup p-button:not(:last-child) .p-button, .p-buttongroup p-button:not(:last-child) .p-button:hover, .p-buttonset .p-button:not(:last-child), .p-buttonset .p-button:not(:last-child):hover, .p-buttonset p-button:not(:last-child) .p-button, .p-buttonset p-button:not(:last-child) .p-button:hover { border-right: 0 none; } .p-buttongroup .p-button:not(:first-of-type):not(:last-of-type), .p-buttongroup p-button:not(:first-of-type):not(:last-of-type) .p-button, .p-buttonset .p-button:not(:first-of-type):not(:last-of-type), .p-buttonset p-button:not(:first-of-type):not(:last-of-type) .p-button { border-radius: 0; } .p-buttongroup .p-button:first-of-type:not(:only-of-type), .p-buttongroup p-button:first-of-type:not(:only-of-type) .p-button, .p-buttonset .p-button:first-of-type:not(:only-of-type), .p-buttonset p-button:first-of-type:not(:only-of-type) .p-button { border-start-end-radius: 0; border-end-end-radius: 0; } .p-buttongroup .p-button:last-of-type:not(:only-of-type), .p-buttongroup p-button:last-of-type:not(:only-of-type) .p-button, .p-buttonset .p-button:last-of-type:not(:only-of-type), .p-buttonset p-button:last-of-type:not(:only-of-type) .p-button { border-start-start-radius: 0; border-end-start-radius: 0; } p-button[iconpos='right'] spinnericon { order: 1; } `; const classes = { root: 'p-buttongroup p-component' }; class ButtonGroupStyle extends BaseStyle { name = 'buttongroup'; theme = theme; classes = classes; static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroupStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroupStyle }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroupStyle, decorators: [{ type: Injectable }] }); /** * * A set of Buttons can be displayed together using the ButtonGroup component. * * [Live Demo](https://www.primeng.org/button/) * * @module buttongroupstyle * */ var ButtonGroupClasses; (function (ButtonGroupClasses) { /** * Class name of the root element */ ButtonGroupClasses["root"] = "p-buttongroup"; })(ButtonGroupClasses || (ButtonGroupClasses = {})); class ButtonGroup extends BaseComponent { _componentStyle = inject(ButtonGroupStyle); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroup, deps: null, target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: ButtonGroup, isStandalone: true, selector: "p-buttonGroup, p-buttongroup, p-button-group", providers: [ButtonGroupStyle], usesInheritance: true, ngImport: i0, template: ` <span class="p-buttongroup p-component" role="group"> <ng-content></ng-content> </span> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroup, decorators: [{ type: Component, args: [{ selector: 'p-buttonGroup, p-buttongroup, p-button-group', standalone: true, imports: [CommonModule], template: ` <span class="p-buttongroup p-component" role="group"> <ng-content></ng-content> </span> `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [ButtonGroupStyle] }] }] }); class ButtonGroupModule { static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroupModule, imports: [ButtonGroup], exports: [ButtonGroup] }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroupModule, imports: [ButtonGroup] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ButtonGroupModule, decorators: [{ type: NgModule, args: [{ imports: [ButtonGroup], exports: [ButtonGroup] }] }] }); /** * Generated bundle index. Do not edit. */ export { ButtonGroup, ButtonGroupClasses, ButtonGroupModule, ButtonGroupStyle }; //# sourceMappingURL=primeng-buttongroup.mjs.map