Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong type definition on Badge component #17634

Open
1 of 4 tasks
quentinFonck opened this issue Feb 10, 2025 · 0 comments
Open
1 of 4 tasks

Wrong type definition on Badge component #17634

quentinFonck opened this issue Feb 10, 2025 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@quentinFonck
Copy link

Describe the bug

On V19.0.6, the badge component type definition doesn't allow null assignment for severity, badgeSize and size.
Source code seems to be right, but the type definition after install doesn't have it.

I am in the process of migrating our ui library from v17 to v19 and I cannot set null values anymore.

// node_modules/primeng/badge/badge.d.ts
/**
 * Badge is a small status indicator for another element.
 * @group Components
 */
export declare class Badge extends BaseComponent {
    /**
     * Size of the badge, valid options are "large" and "xlarge".
     * @group Props
     */
    badgeSize: import("@angular/core").InputSignal<"small" | "large" | "xlarge">;
    /**
     * Size of the badge, valid options are "large" and "xlarge".
     * @group Props
     */
    size: import("@angular/core").InputSignal<"small" | "large" | "xlarge">;
    /**
     * Severity type of the badge.
     * @group Props
     */
    severity: import("@angular/core").InputSignal<"info" | "success" | "warn" | "danger" | "secondary" | "contrast">;
    // ... 
}
export declare class BadgeModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<BadgeModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<BadgeModule, never, [typeof Badge, typeof BadgeDirective, typeof i1.SharedModule], [typeof Badge, typeof BadgeDirective, typeof i1.SharedModule]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<BadgeModule>;
}

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

Most probably doesn't need a fix but an update on the package.

Reproducer

https://stackblitz.com/edit/bolt-angular-2u7tud1n?file=.gitignore

Environment

Google chrome
angular 19.1.4
primeng 19.0.6

Angular version

19.1.4

PrimeNG version

v19

Node version

20.15.0

Browser(s)

chrome 132.0.6834.160

Steps to reproduce the behavior

  • display a badge component with a severity set to null:
    <p-badge [value]="2" [severity]="null" />

  • it triggers a type error

Expected behavior

Should allow for null

@quentinFonck quentinFonck added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant