diff --git a/src/app/components/api/shared.ts b/src/app/components/api/shared.ts index 88735641065..cb5ecbe7e84 100755 --- a/src/app/components/api/shared.ts +++ b/src/app/components/api/shared.ts @@ -1,20 +1,22 @@ -import { CommonModule } from '@angular/common'; import { Component, Directive, Input, NgModule, TemplateRef } from '@angular/core'; @Component({ selector: 'p-header', + standalone: true, template: '' }) export class Header {} @Component({ selector: 'p-footer', + standalone: true, template: '' }) export class Footer {} @Directive({ selector: '[pTemplate]', + standalone: true, host: {} }) export class PrimeTemplate { @@ -30,8 +32,7 @@ export class PrimeTemplate { } @NgModule({ - imports: [CommonModule], - exports: [Header, Footer, PrimeTemplate], - declarations: [Header, Footer, PrimeTemplate] + imports: [Header, Footer, PrimeTemplate], + exports: [Header, Footer, PrimeTemplate] }) export class SharedModule {} diff --git a/src/app/components/autocomplete/autocomplete.spec.ts b/src/app/components/autocomplete/autocomplete.spec.ts index 9fdd29e6bd4..e2d7101bc9d 100755 --- a/src/app/components/autocomplete/autocomplete.spec.ts +++ b/src/app/components/autocomplete/autocomplete.spec.ts @@ -5,10 +5,10 @@ import { By } from '@angular/platform-browser'; import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ButtonModule } from 'primeng/button'; -import { OverlayModule } from 'primeng/overlay'; -import { AutoComplete } from './autocomplete'; import { ChevronDownIcon } from 'primeng/icons/chevrondown'; import { TimesCircleIcon } from 'primeng/icons/timescircle'; +import { OverlayModule } from 'primeng/overlay'; +import { AutoComplete } from './autocomplete'; @Component({ template: ` diff --git a/src/app/components/autofocus/autofocus.ts b/src/app/components/autofocus/autofocus.ts index 45fc91426a0..4754cce80a5 100644 --- a/src/app/components/autofocus/autofocus.ts +++ b/src/app/components/autofocus/autofocus.ts @@ -1,4 +1,4 @@ -import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common'; +import { DOCUMENT, isPlatformBrowser } from '@angular/common'; import { Directive, ElementRef, Input, NgModule, PLATFORM_ID, booleanAttribute, inject } from '@angular/core'; import { DomHandler } from 'primeng/dom'; /** @@ -7,6 +7,7 @@ import { DomHandler } from 'primeng/dom'; */ @Directive({ selector: '[pAutoFocus]', + standalone: true, host: { class: 'p-element' } @@ -64,8 +65,7 @@ export class AutoFocus { } @NgModule({ - imports: [CommonModule], - exports: [AutoFocus], - declarations: [AutoFocus] + imports: [AutoFocus], + exports: [AutoFocus] }) export class AutoFocusModule {} diff --git a/src/app/components/button/button.css b/src/app/components/button/button.css index 80f832c468b..4958987c6cc 100755 --- a/src/app/components/button/button.css +++ b/src/app/components/button/button.css @@ -49,17 +49,17 @@ .p-button-group .p-button:focus, .p-button-group p-button:focus .p-button, - .p-buttonset .p-button:focus, - .p-buttonset .p-button:focus, + .p-buttonset .p-button:focus, + .p-buttonset .p-button:focus, .p-buttonset p-button:focus .p-button, - .p-buttonset .p-button:focus{ + .p-buttonset .p-button:focus { position: relative; z-index: 1; } .p-button-group .p-button:not(:last-child), - .p-button-group .p-button:not(:last-child):hover, - .p-button-group p-button:not(:last-child) .p-button, + .p-button-group .p-button:not(:last-child):hover, + .p-button-group p-button:not(:last-child) .p-button, .p-button-group p-button:not(:last-child) .p-button:hover, .p-buttonset .p-button:not(:last-child), .p-buttonset .p-button:not(:last-child):hover, @@ -75,7 +75,6 @@ border-radius: 0; } - .p-button-group .p-button:first-of-type:not(:only-of-type), .p-button-group p-button:first-of-type:not(:only-of-type) .p-button, .p-buttonset .p-button:first-of-type:not(:only-of-type), @@ -92,7 +91,6 @@ border-bottom-left-radius: 0; } - p-button[iconpos='right'] spinnericon { order: 1; } diff --git a/src/app/components/button/button.spec.ts b/src/app/components/button/button.spec.ts index 523eabe27d7..07edd6a7e2c 100755 --- a/src/app/components/button/button.spec.ts +++ b/src/app/components/button/button.spec.ts @@ -1,7 +1,7 @@ -import { TestBed, ComponentFixture } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Button } from './button'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { Button } from './button'; describe('Button', () => { let button: Button; @@ -9,8 +9,7 @@ describe('Button', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [Button] + imports: [NoopAnimationsModule, Button] }); fixture = TestBed.createComponent(Button); diff --git a/src/app/components/button/button.ts b/src/app/components/button/button.ts index 8e3b45b71c3..225e8c6dc78 100755 --- a/src/app/components/button/button.ts +++ b/src/app/components/button/button.ts @@ -1,4 +1,4 @@ -import { CommonModule, DOCUMENT } from '@angular/common'; +import { DOCUMENT, NgClass, NgIf, NgStyle, NgTemplateOutlet } from '@angular/common'; import { AfterContentInit, AfterViewInit, @@ -20,11 +20,11 @@ import { numberAttribute } from '@angular/core'; import { PrimeTemplate, SharedModule } from 'primeng/api'; +import { AutoFocus } from 'primeng/autofocus'; import { DomHandler } from 'primeng/dom'; import { SpinnerIcon } from 'primeng/icons/spinner'; -import { RippleModule } from 'primeng/ripple'; +import { Ripple } from 'primeng/ripple'; import { ObjectUtils } from 'primeng/utils'; -import { AutoFocusModule } from 'primeng/autofocus'; type ButtonIconPosition = 'left' | 'right' | 'top' | 'bottom'; @@ -36,12 +36,14 @@ const INTERNAL_BUTTON_CLASSES = { loading: 'p-button-loading', labelOnly: 'p-button-loading-label-only' } as const; + /** * Button directive is an extension to button component. * @group Components */ @Directive({ selector: '[pButton]', + standalone: true, host: { class: 'p-element' } @@ -329,6 +331,8 @@ export class ButtonDirective implements AfterViewInit, OnDestroy { */ @Component({ selector: 'p-button', + standalone: true, + imports: [NgIf, NgTemplateOutlet, NgStyle, NgClass, Ripple, AutoFocus, SpinnerIcon], template: `