{"version":3,"file":"chunk-o5e4quhm.js","sources":["packages/design-system/ui/pill/src/pill.component.ts"],"sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n DestroyRef,\n Input,\n QueryList,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { DS_ATOMS } from '@frontend/ui/shared';\n\nexport const DS_PILL_VARIANTS_ARRAY = ['current', 'subtle', 'strong'] as const;\nexport type DsPillVariant = (typeof DS_PILL_VARIANTS_ARRAY)[number];\n\nexport const DS_PILL_SIZE_ARRAY = ['small', 'medium'] as const;\nexport type DsPillSize = (typeof DS_PILL_SIZE_ARRAY)[number];\n\n@Component({\n selector: '[ds-pill]',\n template: `\n \n \n \n \n \n \n `,\n host: {\n 'class': 'ds-pill',\n '[class]': '[\"ds-pill-\" + variant, \"ds-pill-\" + size]',\n '[class.ds-pill-selected]': 'selected',\n '[class.ds-pill-disabled]': 'disabled',\n '[attr.disabled]': 'disabled ? true : null',\n '[class.ds-pill-rounded-padding]': 'roundedPadding()',\n '[class.ds-pill-inverse]': 'inverse',\n '[attr.aria-disabled]': 'disabled',\n },\n styleUrl: 'pill.component.scss',\n standalone: true,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DsPill implements AfterContentInit {\n private destroyRef = inject(DestroyRef);\n\n @Input({ transform: booleanAttribute }) selected = false;\n\n @Input() variant: DsPillVariant = 'current';\n\n @Input() size: DsPillSize = 'medium';\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n @Input({ transform: booleanAttribute }) inverse = false;\n\n //TODO use signal-based content queries\n /**\n * Retrieves and holds the list of child components or directives that implement the `DsAtoms` interface when\n * they are projected into the current component's content slots and are instances of the injection token `DS_ATOMS`.\n * If there are any children that implement `DsAtoms` interface are present, the host class `ds-pill-rounded-padding`\n * is added to the `ds-pill` component.\n */\n @ContentChildren(DS_ATOMS) dsAtoms?: QueryList;\n\n roundedPadding = signal(false);\n\n ngAfterContentInit() {\n this.setRoundedPadding();\n this.dsAtoms?.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.setRoundedPadding();\n });\n }\n\n private setRoundedPadding() {\n const includesNotificationBubble = this.dsAtoms?.some((item) => item === 'ds-notification-bubble');\n this.roundedPadding.set(!!includesNotificationBubble);\n }\n}\n"],"names":["DsPill","constructor","destroyRef","inject","DestroyRef","selected","variant","size","disabled","inverse","roundedPadding","signal","ngAfterContentInit","setRoundedPadding","dsAtoms","changes","pipe","takeUntilDestroyed","subscribe","includesNotificationBubble","some","item","set","selectors","contentQueries","rf","ctx","dirIndex","y","DS_ATOMS","ɵɵclassMap","ɵɵpureFunction2","_c0","ɵɵclassProp","booleanAttribute","standalone","features","ɵɵInputTransformsFeature","ɵɵStandaloneFeature","attrs","_c1","ngContentSelectors","_c3","decls","vars","consts","template","ɵɵprojection","ɵɵelementStart","ɵɵelementEnd","ɵɵelement","_DsPill"],"mappings":"6WAgDaA,IAAAA,CAAAA,CAAAA,CAAM,IAAA,CAAb,IAAOA,EAAP,MAAOA,CAAM,CAzBnBC,WAAAA,EAAA,CA0BY,IAAA,CAAAC,WAAaC,CAAOC,CAAAA,EAAU,EAEE,IAAAC,CAAAA,QAAAA,CAAW,GAE1C,IAAAC,CAAAA,OAAAA,CAAyB,SAEzB,CAAA,IAAA,CAAAC,IAAmB,CAAA,QAAA,CAEY,KAAAC,QAAW,CAAA,CAAA,CAAA,CAEX,KAAAC,OAAU,CAAA,CAAA,CAAA,CAWlD,KAAAC,cAAiBC,CAAAA,EAAAA,CAAO,CAAK,CAAA,EAAA,CAE7BC,kBAAkB,EAAA,CACd,KAAKC,iBAAiB,EAAA,CACtB,IAAKC,CAAAA,OAAAA,EAASC,OAAQC,CAAAA,IAAAA,CAAKC,GAAmB,IAAKf,CAAAA,UAAU,CAAC,CAAA,CAAEgB,SAAU,CAAA,IAAK,C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