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

215 lines (206 loc) 8.32 kB
import * as i1 from '@angular/common'; import { CommonModule } from '@angular/common'; import * as i0 from '@angular/core'; import { Injectable, inject, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core'; import { SharedModule } from 'primeng/api'; import { BaseComponent } from 'primeng/basecomponent'; import { BaseStyle } from 'primeng/base'; const theme = ({ dt }) => ` .p-progressspinner { position: relative; margin: 0 auto; width: 100px; height: 100px; display: inline-block; } .p-progressspinner::before { content: ""; display: block; padding-top: 100%; } .p-progressspinner-spin { height: 100%; transform-origin: center center; width: 100%; position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; animation: p-progressspinner-rotate 2s linear infinite; } .p-progressspinner-circle { stroke-dasharray: 89, 200; stroke-dashoffset: 0; stroke: ${dt('progressspinner.color.1')}; animation: p-progressspinner-dash 1.5s ease-in-out infinite, p-progressspinner-color 6s ease-in-out infinite; stroke-linecap: round; } @keyframes p-progressspinner-rotate { 100% { transform: rotate(360deg); } } @keyframes p-progressspinner-dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } } @keyframes p-progressspinner-color { 100%, 0% { stroke: ${dt('progressspinner.color.1')}; } 40% { stroke: ${dt('progressspinner.color.2')}; } 66% { stroke: ${dt('progressspinner.color.3')}; } 80%, 90% { stroke: ${dt('progressspinner.color.4')}; } } `; const classes = { root: 'p-progressspinner', spin: 'p-progressspinner-spin', circle: 'p-progressspinner-circle' }; class ProgressSpinnerStyle extends BaseStyle { name = 'progressspinner'; theme = theme; classes = classes; static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinnerStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinnerStyle }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinnerStyle, decorators: [{ type: Injectable }] }); /** * * ProgressSpinner is a process status indicator. * * [Live Demo](https://www.primeng.org/progressspinner) * * @module progressspinnerstyle * */ var ProgressSpinnerClasses; (function (ProgressSpinnerClasses) { /** * Class name of the root element */ ProgressSpinnerClasses["root"] = "p-progressspinner"; /** * Class name of the spin element */ ProgressSpinnerClasses["spin"] = "p-progressspinner-spin"; /** * Class name of the circle element */ ProgressSpinnerClasses["circle"] = "p-progressspinner-circle"; })(ProgressSpinnerClasses || (ProgressSpinnerClasses = {})); /** * ProgressSpinner is a process status indicator. * @group Components */ class ProgressSpinner extends BaseComponent { /** * Class of the element. * @group Props */ styleClass; /** * Inline style of the element. * @group Props */ style; /** * Width of the circle stroke. * @group Props */ strokeWidth = '2'; /** * Color for the background of the circle. * @group Props */ fill = 'none'; /** * Duration of the rotate animation. * @group Props */ animationDuration = '2s'; /** * Used to define a aria label attribute the current element. * @group Props */ ariaLabel; _componentStyle = inject(ProgressSpinnerStyle); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinner, deps: null, target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: ProgressSpinner, isStandalone: true, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: { styleClass: "styleClass", style: "style", strokeWidth: "strokeWidth", fill: "fill", animationDuration: "animationDuration", ariaLabel: "ariaLabel" }, providers: [ProgressSpinnerStyle], usesInheritance: true, ngImport: i0, template: ` <div class="p-progressspinner" [ngStyle]="style" [ngClass]="styleClass" role="progressbar" [attr.aria-label]="ariaLabel" [attr.aria-busy]="true" [attr.data-pc-name]="'progressspinner'" [attr.data-pc-section]="'root'"> <svg class="p-progressspinner-spin" viewBox="25 25 50 50" [style.animation-duration]="animationDuration" [attr.data-pc-section]="'root'"> <circle class="p-progressspinner-circle" cx="50" cy="50" r="20" [attr.fill]="fill" [attr.stroke-width]="strokeWidth" stroke-miterlimit="10" /> </svg> </div> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: SharedModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinner, decorators: [{ type: Component, args: [{ selector: 'p-progressSpinner, p-progress-spinner, p-progressspinner', standalone: true, imports: [CommonModule, SharedModule], template: ` <div class="p-progressspinner" [ngStyle]="style" [ngClass]="styleClass" role="progressbar" [attr.aria-label]="ariaLabel" [attr.aria-busy]="true" [attr.data-pc-name]="'progressspinner'" [attr.data-pc-section]="'root'"> <svg class="p-progressspinner-spin" viewBox="25 25 50 50" [style.animation-duration]="animationDuration" [attr.data-pc-section]="'root'"> <circle class="p-progressspinner-circle" cx="50" cy="50" r="20" [attr.fill]="fill" [attr.stroke-width]="strokeWidth" stroke-miterlimit="10" /> </svg> </div> `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [ProgressSpinnerStyle] }] }], propDecorators: { styleClass: [{ type: Input }], style: [{ type: Input }], strokeWidth: [{ type: Input }], fill: [{ type: Input }], animationDuration: [{ type: Input }], ariaLabel: [{ type: Input }] } }); class ProgressSpinnerModule { static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinnerModule, imports: [ProgressSpinner, SharedModule], exports: [ProgressSpinner, SharedModule] }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinnerModule, imports: [ProgressSpinner, SharedModule, SharedModule] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ProgressSpinnerModule, decorators: [{ type: NgModule, args: [{ imports: [ProgressSpinner, SharedModule], exports: [ProgressSpinner, SharedModule] }] }] }); /** * Generated bundle index. Do not edit. */ export { ProgressSpinner, ProgressSpinnerClasses, ProgressSpinnerModule, ProgressSpinnerStyle }; //# sourceMappingURL=primeng-progressspinner.mjs.map