@testgorilla/tgo-ui 8.1.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/components/alert-banner/index.d.ts +10 -3
  2. package/components/tag/index.d.ts +35 -35
  3. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +1 -1
  4. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
  5. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +12 -3
  6. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
  7. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +2 -2
  8. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
  9. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +2 -2
  10. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
  11. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1 -1
  12. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
  13. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +2 -2
  14. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
  15. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +2 -2
  16. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
  17. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +64 -106
  18. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
  19. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1 -1
  20. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
  21. package/mcp/catalog.json +1 -1
  22. package/package.json +1 -1
  23. package/projects/tgo-canopy-ui/theme/_alert-bars.scss +5 -0
  24. package/projects/tgo-canopy-ui/theme/_input.scss +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"testgorilla-tgo-ui-components-snackbar.mjs","sources":["../../../components/snackbar/snackbar.component.ts","../../../components/snackbar/snackbar.component.html","../../../components/snackbar/snackbar.service.ts","../../../components/snackbar/snackbar.component.module.ts","../../../components/snackbar/testgorilla-tgo-ui-components-snackbar.ts"],"sourcesContent":["import { animate, style, transition, trigger } from '@angular/animations';\nimport { Component, Inject, Input, OnInit, Optional } from '@angular/core';\nimport { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar';\nimport { IconName } from '@testgorilla/tgo-ui/components/icon';\nimport { SnackbarLink, SnackbarType, SnackbarVariant } from './snackbar.model';\nimport { alertBarsUtil } from '@testgorilla/tgo-ui/components/core';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { LinkTargetType } from '@testgorilla/tgo-ui/components/alert-banner';\n\n@Component({\n selector: 'ui-snackbar',\n templateUrl: './snackbar.component.html',\n styleUrls: ['./snackbar.component.scss'],\n animations: [\n trigger('openClose', [\n transition(':enter', [\n style({ bottom: '-55px', opacity: 0 }),\n animate('0.2s ease-out', style({ opacity: 1, bottom: '10px' })),\n ]),\n transition(':leave', [\n style({ bottom: '10px', opacity: 1 }),\n animate('0.2s ease-in', style({ bottom: '-55px', opacity: 0 })),\n ]),\n ]),\n ],\n standalone: false,\n})\nexport class SnackbarComponent implements OnInit {\n /**\n * Background color of the button while in active state\n *\n * @type {SnackbarType}\n * @memberof SnackbarComponent\n */\n @Input() snackbarType: SnackbarType = 'success';\n\n /**\n * Snackbar message\n *\n * @memberof SnackbarComponent\n */\n @Input() message = '';\n\n /**\n * Snackbar message from html\n *\n * @memberof SnackbarComponent\n */\n @Input() set html(value: string) {\n if (value) {\n this.safeHtml = value;\n }\n }\n\n /**\n * Set the time that the snackbar will be visible\n *\n * @memberof SnackbarComponent\n */\n @Input() seconds = 5;\n\n /**\n * Include dismmiss button\n *\n * @memberof SnackbarComponent\n */\n @Input() includeDismissButton = true;\n\n /**\n * Static or fixed position\n *\n * @memberof SnackbarComponent\n */\n @Input() fixed = true;\n\n /**\n * Link text that will appended at the end of message\n *\n * @memberof AlertBannerComponent\n */\n @Input() linkText? = '';\n\n /**\n * Link url\n *\n * @memberof AlertBannerComponent\n */\n @Input() linkUrl?: string;\n\n /**\n * Link target\n *\n * @type {@type {LinkTargetType}}\n * @memberof AlertBannerComponent\n */\n @Input() linkTarget?: LinkTargetType = '_blank';\n\n /**\n * The variant to be used\n *\n * @type {SnackbarVariant}\n * @memberof SnackbarComponent\n */\n @Input() variant: SnackbarVariant = 'desktop';\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof SnackbarComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * Close button tooltip\n *\n * @type {string}\n * @memberof SnackbarComponent\n */\n @Input() closeButtonTooltip = '';\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof SnackbarComponent\n */\n @Input() ariaDescribedby = '';\n\n iconName: IconName;\n showSnackbar = true;\n milisenconds: number;\n visible = false;\n timer?: number;\n timerStartedAt = 0;\n timerPausedAt = 0;\n position: string;\n safeHtml: string;\n\n translationContext = 'SNACKBAR.';\n protected readonly maxCharacters = 70;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme,\n @Inject(MAT_SNACK_BAR_DATA)\n private data: {\n snackbarType: SnackbarType;\n message: string;\n link?: SnackbarLink;\n applicationTheme?: ApplicationTheme;\n html?: string;\n seconds?: number;\n },\n private snackbarRef: MatSnackBarRef<SnackbarComponent>\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n\n this.snackbarType = data.snackbarType ?? 'success';\n this.message = data.message ?? '';\n this.safeHtml = data.html ?? '';\n this.linkText = data.link?.text ?? '';\n this.linkUrl = data.link?.url ?? '';\n this.seconds = data.seconds ?? 5;\n }\n\n ngOnInit(): void {\n this.milisenconds = this.seconds * 1000;\n this.iconName = alertBarsUtil.setIcon(this.snackbarType) as IconName;\n this.show();\n this.position = alertBarsUtil.setPosition(this.fixed);\n }\n\n //Show snackbar\n show() {\n this.timerStartedAt = Date.now();\n this.visible = true;\n this.timer = window.setTimeout(() => this.hide(), this.milisenconds);\n }\n\n //Hide snackbar\n hide() {\n this.visible = false;\n this.timerPausedAt = 0;\n this.timerStartedAt = 0;\n clearTimeout(this.timer);\n this.timer = undefined;\n this.dismissSnackbar();\n }\n\n //Pause timer when mouse enter\n onMouseEnter() {\n this.visible = true;\n this.timerPausedAt = Date.now();\n clearTimeout(this.timer);\n }\n\n //Continue timer when mouse leave\n onMouseLeave() {\n const diff = this.timerPausedAt - this.timerStartedAt;\n if (diff <= 0) {\n return this.hide();\n }\n this.timer = window.setTimeout(() => this.hide(), this.milisenconds - diff);\n }\n\n //Hide snackbar when dismiss button is clicked\n dismissClick() {\n this.visible = false;\n this.dismissSnackbar();\n }\n\n onLinkClick(event: Event): void {\n event?.preventDefault();\n\n if (this.data.link?.action) {\n this.data.link?.action();\n } else if (this.data.link?.url) {\n window.open(this.data.link?.url, '_blank');\n }\n }\n\n private dismissSnackbar(): void {\n if (Object.keys(this.snackbarRef).length > 0) {\n this.snackbarRef.dismiss();\n }\n }\n}\n","<ng-container>\n @if (visible) {\n <div\n [ngClass]=\"snackbarType + ' ' + position\"\n [@openClose]\n class=\"snackbar-container\"\n [attr.theme]=\"applicationTheme\"\n [class.mobile]=\"variant === 'mobile'\"\n [class.desktop]=\"variant === 'desktop'\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n data-testid=\"snackbar-wrapper\"\n [attr.data-test-snackbar-type]=\"snackbarType\"\n [attr.aria-describedby]=\"'describedby'\"\n role=\"alert\"\n [attr.aria-labelledby]=\"'labelledby'\"\n >\n <span style=\"position: absolute; left: -9999px\" id=\"labelledby\">{{\n 'ALERT_BANNER.' + (snackbarType | uppercase) | uiTranslate | async\n }}</span>\n <span style=\"position: absolute; left: -9999px\"\n >{{ message }}\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </span>\n <span [style.display]=\"'none'\" id=\"describedby\">{{ ariaDescribedby }}</span>\n <div\n aria-hidden=\"true\"\n class=\"snackbar-text\"\n [matTooltip]=\"message.length > maxCharacters ? message : ''\"\n data-testid=\"snackbar-content\"\n >\n @if (applicationTheme === 'classic') {\n <ui-icon [name]=\"iconName\" size=\"24\"></ui-icon>\n }\n {{ message.length > maxCharacters ? (message | slice: 0 : maxCharacters) + '..' : message }}\n @if (safeHtml) {\n <div [innerHTML]=\"safeHtml\"></div>\n }\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </div>\n @if (includeDismissButton && applicationTheme === 'classic') {\n <ui-button\n variant=\"text\"\n [label]=\"(translationContext + 'DISMISS' | uiTranslate | async)!\"\n [applicationTheme]=\"applicationTheme !== 'classic' ? 'light' : 'classic'\"\n (buttonClickEvent)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n ></ui-button>\n }\n @if (includeDismissButton && applicationTheme !== 'classic') {\n <ui-button\n [variant]=\"'icon-button'\"\n [applicationTheme]=\"'light'\"\n [iconName]=\"'Close-in-line'\"\n [size]=\"'small'\"\n [tooltip]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n (click)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n ></ui-button>\n }\n </div>\n }\n</ng-container>\n","import { Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { SnackbarComponent } from './snackbar.component';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { SnackbarLink, SnackbarType } from './snackbar.model';\n\n@Injectable()\nexport class SnackbarService {\n constructor(private snackBar: MatSnackBar) {}\n\n error(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('error', message, applicationTheme, html, link, seconds);\n }\n\n success(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('success', message, applicationTheme, html, link, seconds);\n }\n\n info(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('info', message, applicationTheme, html, link, seconds);\n }\n\n warning(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('warning', message, applicationTheme, html, link, seconds);\n }\n\n show(\n snackbarType: SnackbarType,\n message: string,\n applicationTheme?: ApplicationTheme,\n html?: string,\n link?: SnackbarLink,\n seconds?: number\n ) {\n const componentRef = this.snackBar.openFromComponent(SnackbarComponent, {\n data: {\n snackbarType,\n message,\n link,\n html,\n seconds,\n },\n });\n if (applicationTheme) {\n componentRef.instance.applicationTheme = applicationTheme;\n }\n return componentRef;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SnackbarComponent } from './snackbar.component';\nimport { SnackbarService } from './snackbar.service';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\n@NgModule({\n declarations: [SnackbarComponent],\n imports: [\n CommonModule,\n ButtonComponentModule,\n IconComponentModule,\n UiTranslatePipe,\n MatSnackBarModule,\n MatTooltipModule,\n ],\n exports: [SnackbarComponent],\n providers: [SnackbarService],\n})\nexport class SnackbarComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MA2Ba,iBAAiB,CAAA;AAgB5B;;;;AAIG;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,EAAE,CAAC,eAAe,CAAC;AAC7B,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"testgorilla-tgo-ui-components-snackbar.mjs","sources":["../../../components/snackbar/snackbar.component.ts","../../../components/snackbar/snackbar.component.html","../../../components/snackbar/snackbar.service.ts","../../../components/snackbar/snackbar.component.module.ts","../../../components/snackbar/testgorilla-tgo-ui-components-snackbar.ts"],"sourcesContent":["import { animate, style, transition, trigger } from '@angular/animations';\nimport { Component, Inject, Input, OnInit, Optional } from '@angular/core';\nimport { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar';\nimport { IconName } from '@testgorilla/tgo-ui/components/icon';\nimport { SnackbarLink, SnackbarType, SnackbarVariant } from './snackbar.model';\nimport { alertBarsUtil } from '@testgorilla/tgo-ui/components/core';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { LinkTargetType } from '@testgorilla/tgo-ui/components/alert-banner';\n\n@Component({\n selector: 'ui-snackbar',\n templateUrl: './snackbar.component.html',\n styleUrls: ['./snackbar.component.scss'],\n animations: [\n trigger('openClose', [\n transition(':enter', [\n style({ bottom: '-55px', opacity: 0 }),\n animate('0.2s ease-out', style({ opacity: 1, bottom: '10px' })),\n ]),\n transition(':leave', [\n style({ bottom: '10px', opacity: 1 }),\n animate('0.2s ease-in', style({ bottom: '-55px', opacity: 0 })),\n ]),\n ]),\n ],\n standalone: false,\n})\nexport class SnackbarComponent implements OnInit {\n /**\n * Background color of the button while in active state\n *\n * @type {SnackbarType}\n * @memberof SnackbarComponent\n */\n @Input() snackbarType: SnackbarType = 'success';\n\n /**\n * Snackbar message\n *\n * @memberof SnackbarComponent\n */\n @Input() message = '';\n\n /**\n * Snackbar message from html\n *\n * @memberof SnackbarComponent\n */\n @Input() set html(value: string) {\n if (value) {\n this.safeHtml = value;\n }\n }\n\n /**\n * Set the time that the snackbar will be visible\n *\n * @memberof SnackbarComponent\n */\n @Input() seconds = 5;\n\n /**\n * Include dismmiss button\n *\n * @memberof SnackbarComponent\n */\n @Input() includeDismissButton = true;\n\n /**\n * Static or fixed position\n *\n * @memberof SnackbarComponent\n */\n @Input() fixed = true;\n\n /**\n * Link text that will appended at the end of message\n *\n * @memberof AlertBannerComponent\n */\n @Input() linkText? = '';\n\n /**\n * Link url\n *\n * @memberof AlertBannerComponent\n */\n @Input() linkUrl?: string;\n\n /**\n * Link target\n *\n * @type {@type {LinkTargetType}}\n * @memberof AlertBannerComponent\n */\n @Input() linkTarget?: LinkTargetType = '_blank';\n\n /**\n * The variant to be used\n *\n * @type {SnackbarVariant}\n * @memberof SnackbarComponent\n */\n @Input() variant: SnackbarVariant = 'desktop';\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof SnackbarComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * Close button tooltip\n *\n * @type {string}\n * @memberof SnackbarComponent\n */\n @Input() closeButtonTooltip = '';\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof SnackbarComponent\n */\n @Input() ariaDescribedby = '';\n\n iconName: IconName;\n showSnackbar = true;\n milisenconds: number;\n visible = false;\n timer?: number;\n timerStartedAt = 0;\n timerPausedAt = 0;\n position: string;\n safeHtml: string;\n\n translationContext = 'SNACKBAR.';\n protected readonly maxCharacters = 70;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme,\n @Inject(MAT_SNACK_BAR_DATA)\n private data: {\n snackbarType: SnackbarType;\n message: string;\n link?: SnackbarLink;\n applicationTheme?: ApplicationTheme;\n html?: string;\n seconds?: number;\n },\n private snackbarRef: MatSnackBarRef<SnackbarComponent>\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n\n this.snackbarType = data.snackbarType ?? 'success';\n this.message = data.message ?? '';\n this.safeHtml = data.html ?? '';\n this.linkText = data.link?.text ?? '';\n this.linkUrl = data.link?.url ?? '';\n this.seconds = data.seconds ?? 5;\n }\n\n ngOnInit(): void {\n this.milisenconds = this.seconds * 1000;\n this.iconName = alertBarsUtil.setIcon(this.snackbarType) as IconName;\n this.show();\n this.position = alertBarsUtil.setPosition(this.fixed);\n }\n\n //Show snackbar\n show() {\n this.timerStartedAt = Date.now();\n this.visible = true;\n this.timer = window.setTimeout(() => this.hide(), this.milisenconds);\n }\n\n //Hide snackbar\n hide() {\n this.visible = false;\n this.timerPausedAt = 0;\n this.timerStartedAt = 0;\n clearTimeout(this.timer);\n this.timer = undefined;\n this.dismissSnackbar();\n }\n\n //Pause timer when mouse enter\n onMouseEnter() {\n this.visible = true;\n this.timerPausedAt = Date.now();\n clearTimeout(this.timer);\n }\n\n //Continue timer when mouse leave\n onMouseLeave() {\n const diff = this.timerPausedAt - this.timerStartedAt;\n if (diff <= 0) {\n return this.hide();\n }\n this.timer = window.setTimeout(() => this.hide(), this.milisenconds - diff);\n }\n\n //Hide snackbar when dismiss button is clicked\n dismissClick() {\n this.visible = false;\n this.dismissSnackbar();\n }\n\n onLinkClick(event: Event): void {\n event?.preventDefault();\n\n if (this.data.link?.action) {\n this.data.link?.action();\n } else if (this.data.link?.url) {\n window.open(this.data.link?.url, '_blank');\n }\n }\n\n private dismissSnackbar(): void {\n if (Object.keys(this.snackbarRef).length > 0) {\n this.snackbarRef.dismiss();\n }\n }\n}\n","<ng-container>\n @if (visible) {\n <div\n [ngClass]=\"snackbarType + ' ' + position\"\n [@openClose]\n class=\"snackbar-container\"\n [attr.theme]=\"applicationTheme\"\n [class.mobile]=\"variant === 'mobile'\"\n [class.desktop]=\"variant === 'desktop'\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n data-testid=\"snackbar-wrapper\"\n [attr.data-test-snackbar-type]=\"snackbarType\"\n [attr.aria-describedby]=\"'describedby'\"\n role=\"alert\"\n [attr.aria-labelledby]=\"'labelledby'\"\n >\n <span style=\"position: absolute; left: -9999px\" id=\"labelledby\">{{\n 'ALERT_BANNER.' + (snackbarType | uppercase) | uiTranslate | async\n }}</span>\n <span style=\"position: absolute; left: -9999px\"\n >{{ message }}\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </span>\n <span [style.display]=\"'none'\" id=\"describedby\">{{ ariaDescribedby }}</span>\n <div\n aria-hidden=\"true\"\n class=\"snackbar-text\"\n [matTooltip]=\"message.length > maxCharacters ? message : ''\"\n data-testid=\"snackbar-content\"\n >\n @if (applicationTheme === 'classic') {\n <ui-icon [name]=\"iconName\" size=\"24\"></ui-icon>\n }\n {{ message.length > maxCharacters ? (message | slice: 0 : maxCharacters) + '..' : message }}\n @if (safeHtml) {\n <div [innerHTML]=\"safeHtml\"></div>\n }\n @if (!!linkText) {\n <a [target]=\"linkTarget\" [href]=\"linkUrl\" (click)=\"onLinkClick($event)\">{{ linkText }}</a>\n }\n </div>\n @if (includeDismissButton && applicationTheme === 'classic') {\n <ui-button\n variant=\"text\"\n [label]=\"(translationContext + 'DISMISS' | uiTranslate | async)!\"\n [applicationTheme]=\"applicationTheme !== 'classic' ? 'light' : 'classic'\"\n (buttonClickEvent)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n ></ui-button>\n }\n @if (includeDismissButton && applicationTheme !== 'classic') {\n <ui-button\n [variant]=\"'icon-button'\"\n [applicationTheme]=\"'light'\"\n [iconName]=\"'Close-in-line'\"\n [size]=\"'small'\"\n [tooltip]=\"(closeButtonTooltip || ('COMMON.CLOSE' | uiTranslate | async))!\"\n (click)=\"dismissClick()\"\n data-testid=\"snackbar-dismiss-button\"\n ></ui-button>\n }\n </div>\n }\n</ng-container>\n","import { Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { SnackbarComponent } from './snackbar.component';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { SnackbarLink, SnackbarType } from './snackbar.model';\n\n@Injectable()\nexport class SnackbarService {\n constructor(private snackBar: MatSnackBar) {}\n\n error(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('error', message, applicationTheme, html, link, seconds);\n }\n\n success(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('success', message, applicationTheme, html, link, seconds);\n }\n\n info(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('info', message, applicationTheme, html, link, seconds);\n }\n\n warning(message: string, applicationTheme?: ApplicationTheme, html?: string, link?: SnackbarLink, seconds?: number) {\n return this.show('warning', message, applicationTheme, html, link, seconds);\n }\n\n show(\n snackbarType: SnackbarType,\n message: string,\n applicationTheme?: ApplicationTheme,\n html?: string,\n link?: SnackbarLink,\n seconds?: number\n ) {\n const componentRef = this.snackBar.openFromComponent(SnackbarComponent, {\n data: {\n snackbarType,\n message,\n link,\n html,\n seconds,\n },\n });\n if (applicationTheme) {\n componentRef.instance.applicationTheme = applicationTheme;\n }\n return componentRef;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SnackbarComponent } from './snackbar.component';\nimport { SnackbarService } from './snackbar.service';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\n@NgModule({\n declarations: [SnackbarComponent],\n imports: [\n CommonModule,\n ButtonComponentModule,\n IconComponentModule,\n UiTranslatePipe,\n MatSnackBarModule,\n MatTooltipModule,\n ],\n exports: [SnackbarComponent],\n providers: [SnackbarService],\n})\nexport class SnackbarComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"m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;AACjB,qBAAA;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,SAAS,EAAE,CAAC,eAAe,CAAC;AAC7B,iBAAA;;;ACtBD;;AAEG;;;;"}
@@ -1,40 +1,32 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, EventEmitter, signal, ViewChild, Output, Input, Optional, Inject, Component, NgModule } from '@angular/core';
2
+ import { input, booleanAttribute, model, inject, computed, output, signal, viewChild, effect, Component, NgModule } from '@angular/core';
3
3
  import { ReplaySubject, debounceTime, map } from 'rxjs';
4
- import * as i5 from '@testgorilla/tgo-ui/components/core';
4
+ import * as i4 from '@testgorilla/tgo-ui/components/core';
5
5
  import { IKeyboardEvent, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';
6
- import * as i1 from '@angular/common';
7
- import { CommonModule } from '@angular/common';
8
- import * as i2 from '@testgorilla/tgo-ui/components/icon';
6
+ import * as i1 from '@testgorilla/tgo-ui/components/icon';
9
7
  import { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
10
- import * as i3 from '@angular/material/tooltip';
8
+ import * as i2 from '@angular/material/tooltip';
11
9
  import { MatTooltipModule } from '@angular/material/tooltip';
12
- import * as i4 from '@testgorilla/tgo-ui/components/badge';
13
- import { BadgeComponentModule } from '@testgorilla/tgo-ui/components/badge';
10
+ import * as i3 from '@angular/common';
11
+ import { CommonModule } from '@angular/common';
14
12
  import { MatInputModule } from '@angular/material/input';
15
13
  import { TooltipComponentModule } from '@testgorilla/tgo-ui/components/tooltip';
16
14
 
17
15
  class TagComponent {
18
- /**
19
- * Tag's label
20
- *
21
- * @memberof TagComponent
22
- */
23
- set label(value) {
24
- this.labelText = value;
25
- if (this.labelElement) {
26
- this.isLabelEllipseActive();
27
- }
28
- }
29
- constructor(defaultAppTheme) {
30
- this.defaultAppTheme = defaultAppTheme;
16
+ constructor() {
17
+ /**
18
+ * Tag's label
19
+ *
20
+ * @memberof TagComponent
21
+ */
22
+ this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
31
23
  /**
32
24
  * Icon
33
25
  *
34
26
  * @type {string}
35
27
  * @memberof TagComponent
36
28
  */
37
- this.icon = '';
29
+ this.icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
38
30
  /**
39
31
  * Whether to allow the tag to be closed.
40
32
  *
@@ -42,7 +34,7 @@ class TagComponent {
42
34
  * @default false
43
35
  * @memberof TagComponent
44
36
  */
45
- this.allowClose = false;
37
+ this.allowClose = input(false, ...(ngDevMode ? [{ debugName: "allowClose", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
46
38
  /**
47
39
  * Whether the tag is in read-only mode.
48
40
  *
@@ -50,7 +42,7 @@ class TagComponent {
50
42
  * @default false
51
43
  * @memberof TagComponent
52
44
  */
53
- this.readOnly = false;
45
+ this.readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
54
46
  /**
55
47
  * Whether the tag is selected.
56
48
  *
@@ -58,7 +50,7 @@ class TagComponent {
58
50
  * @default false
59
51
  * @memberof TagComponent
60
52
  */
61
- this.isSelected = false;
53
+ this.isSelected = model(false, ...(ngDevMode ? [{ debugName: "isSelected" }] : []));
62
54
  /**
63
55
  * Display icon when is selected
64
56
  *
@@ -66,7 +58,7 @@ class TagComponent {
66
58
  * @default false
67
59
  * @memberof TagComponent
68
60
  */
69
- this.showIconWhenSelected = false;
61
+ this.showIconWhenSelected = input(false, ...(ngDevMode ? [{ debugName: "showIconWhenSelected", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
70
62
  /**
71
63
  * Specifies whether the element is disabled.
72
64
  *
@@ -74,22 +66,36 @@ class TagComponent {
74
66
  * @default false
75
67
  * @memberof TagComponent
76
68
  */
77
- this.isDisabled = false;
69
+ this.isDisabled = input(false, ...(ngDevMode ? [{ debugName: "isDisabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
78
70
  /**
79
71
  *
80
72
  * Defines the application theme
81
73
  *
82
- * @type {ApplicationTheme}
74
+ * @type {ApplicationTheme | undefined}
75
+ * @memberof TagComponent
76
+ *
77
+ * When not provided, the component falls back to the injected
78
+ * `CANOPYUI_DEFAULT_APPLICATION_THEME` token (if any), then to `'light'`.
79
+ */
80
+ this.applicationTheme = input(undefined, ...(ngDevMode ? [{ debugName: "applicationTheme" }] : []));
81
+ this.defaultAppTheme = inject('CANOPYUI_DEFAULT_APPLICATION_THEME', {
82
+ optional: true,
83
+ });
84
+ this.theme = computed(() => this.applicationTheme() ?? this.defaultAppTheme ?? 'light', ...(ngDevMode ? [{ debugName: "theme" }] : []));
85
+ /**
86
+ * A string representing the ARIA label for accessibility.
87
+ * This label is used to provide an accessible name for the input element.
88
+ * @type {string}
83
89
  * @memberof TagComponent
84
90
  */
85
- this.applicationTheme = 'light';
91
+ this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
86
92
  /**
87
93
  * A string representing the ARIA requirement for accessibility.
88
94
  * This attribute is used to indicate whether an input field is required for form submission.
89
95
  * @type {boolean}
90
96
  * @memberof TagComponent
91
97
  */
92
- this.ariaRequired = false;
98
+ this.ariaRequired = input(false, ...(ngDevMode ? [{ debugName: "ariaRequired", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
93
99
  /**
94
100
  * Whether to show the badge on the tag.
95
101
  * @type {boolean}
@@ -110,14 +116,14 @@ class TagComponent {
110
116
  * @event
111
117
  * @memberof TagComponent
112
118
  */
113
- this.close = new EventEmitter();
119
+ this.close = output();
114
120
  /**
115
121
  * Event triggered when a press action occurs.
116
122
  *
117
123
  * @event
118
124
  * @memberof TagComponent
119
125
  */
120
- this.press = new EventEmitter();
126
+ this.press = output();
121
127
  /**
122
128
  * Subject that needs to be triggered when Label input changes, to check if it's truncated
123
129
  * @private
@@ -133,41 +139,34 @@ class TagComponent {
133
139
  * @memberof TagComponent
134
140
  */
135
141
  this.isEllipseActiveObs$ = this.checkLabelEllipsis$.pipe(debounceTime(100), map(() => {
136
- const el = this.labelElement.nativeElement;
137
- return el.offsetWidth < el.scrollWidth;
142
+ const el = this.labelElement()?.nativeElement;
143
+ return !!el && el.offsetWidth < el.scrollWidth;
138
144
  }));
139
- this.labelText = '';
140
- this.isHovered = false;
145
+ this.isHovered = signal(false, ...(ngDevMode ? [{ debugName: "isHovered" }] : []));
141
146
  this.shrink = false;
142
- this.closeBtnFocused = signal(false, ...(ngDevMode ? [{ debugName: "closeBtnFocused" }] : []));
143
- if (defaultAppTheme) {
144
- this.applicationTheme = defaultAppTheme;
145
- }
146
- }
147
- ngOnInit() {
148
- this.iconToPass = this.icon;
147
+ this.iconToPass = computed(() => this.theme() !== 'classic' && this.isHovered() ? `${this.icon()}-filled` : this.icon(), ...(ngDevMode ? [{ debugName: "iconToPass" }] : []));
149
148
  this.iconColor = 'black';
150
- }
151
- ngAfterViewInit() {
152
- this.isLabelEllipseActive();
149
+ this.closeBtnFocused = signal(false, ...(ngDevMode ? [{ debugName: "closeBtnFocused" }] : []));
150
+ this.labelElement = viewChild('labelElement', ...(ngDevMode ? [{ debugName: "labelElement" }] : []));
151
+ this.tabIndex = computed(() => (this.isDisabled() || this.readOnly() ? -1 : 0), ...(ngDevMode ? [{ debugName: "tabIndex" }] : []));
152
+ this.filled = computed(() => this.readOnly() || this.allowClose() || this.isSelected(), ...(ngDevMode ? [{ debugName: "filled" }] : []));
153
+ effect(() => {
154
+ this.label(); // dep — re-run on label change
155
+ this.labelElement(); // dep — re-run once @ViewChild resolves
156
+ this.isLabelEllipseActive();
157
+ });
153
158
  }
154
159
  onPress() {
155
- if (!this.readOnly && !this.allowClose) {
156
- this.isSelected = this.showIconWhenSelected ? !this.isSelected : false;
157
- this.press.emit(this.isSelected);
160
+ if (!this.readOnly() && !this.allowClose()) {
161
+ const newSelected = this.showIconWhenSelected() ? !this.isSelected() : false;
162
+ this.isSelected.set(newSelected);
163
+ this.press.emit(newSelected);
158
164
  }
159
165
  }
160
166
  setHoverState(state) {
161
- this.isHovered = state;
162
- if (this.applicationTheme !== 'classic') {
163
- if (state) {
164
- this.iconToPass = `${this.icon}-filled`;
165
- }
166
- else {
167
- this.iconToPass = this.icon;
168
- }
169
- this.iconColor = this.isHovered ? 'white' : 'black';
170
- }
167
+ if (this.theme() === 'classic')
168
+ return;
169
+ this.isHovered.set(state);
171
170
  }
172
171
  setShrinkState(state) {
173
172
  this.shrink = state;
@@ -178,12 +177,6 @@ class TagComponent {
178
177
  isLabelEllipseActive() {
179
178
  this.checkLabelEllipsis$.next();
180
179
  }
181
- get tabIndex() {
182
- return this.isDisabled || this.readOnly ? -1 : 0;
183
- }
184
- get filled() {
185
- return this.readOnly || this.allowClose || this.isSelected;
186
- }
187
180
  onKeydown($event) {
188
181
  if (($event.key === IKeyboardEvent.ENTER || $event.key === IKeyboardEvent.SPACE) &&
189
182
  !this.closeBtnFocused()) {
@@ -194,45 +187,13 @@ class TagComponent {
194
187
  this.onClose();
195
188
  }
196
189
  }
197
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TagComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
198
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TagComponent, isStandalone: false, selector: "ui-tag", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: false, isRequired: false, transformFunction: null }, allowClose: { classPropertyName: "allowClose", publicName: "allowClose", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: false, isRequired: false, transformFunction: null }, isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: false, isRequired: false, transformFunction: null }, showIconWhenSelected: { classPropertyName: "showIconWhenSelected", publicName: "showIconWhenSelected", isSignal: false, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: false, isRequired: false, transformFunction: null }, applicationTheme: { classPropertyName: "applicationTheme", publicName: "applicationTheme", isSignal: false, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, ariaRequired: { classPropertyName: "ariaRequired", publicName: "ariaRequired", isSignal: false, isRequired: false, transformFunction: null }, showBadge: { classPropertyName: "showBadge", publicName: "showBadge", isSignal: true, isRequired: false, transformFunction: null }, notificationsAmount: { classPropertyName: "notificationsAmount", publicName: "notificationsAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", press: "press" }, viewQueries: [{ propertyName: "labelElement", first: true, predicate: ["labelElement"], descendants: true }], ngImport: i0, template: "<div class=\"tag-wrapper\">\n <div\n [matTooltip]=\"(isEllipseActiveObs$ | async) ? labelText : ''\"\n [matTooltipClass]=\"applicationTheme\"\n [tabindex]=\"tabIndex\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"{\n filled: filled,\n readonly: readOnly,\n disabled: isDisabled,\n outlined: !isSelected,\n shrink,\n }\"\n (click)=\"onPress()\"\n (mouseenter)=\"setHoverState(true)\"\n (mouseleave)=\"setHoverState(false)\"\n (mousedown)=\"setShrinkState(true)\"\n (mouseup)=\"setShrinkState(false)\"\n (touchstart)=\"setShrinkState(true)\"\n (touchend)=\"setShrinkState(false)\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-label]=\"ariaLabel || labelText\"\n [attr.aria-required]=\"ariaRequired\"\n >\n @if (icon) {\n <ui-icon class=\"icon\" [color]=\"iconColor\" [name]=\"iconToPass\" [applicationTheme]=\"applicationTheme\"></ui-icon>\n }\n @if (isSelected && showIconWhenSelected) {\n <ui-icon [color]=\"iconColor\" class=\"icon\" [name]=\"'Check'\" [applicationTheme]=\"applicationTheme\"></ui-icon>\n }\n <span class=\"tag-label\" #labelElement>{{ labelText }}</span>\n @if (showBadge()) {\n <ui-badge\n [notificationsAmount]=\"notificationsAmount()\"\n [applicationTheme]=\"applicationTheme\"\n [variant]=\"'notification'\"\n ></ui-badge>\n }\n @if (allowClose) {\n <ui-icon\n (focus)=\"closeBtnFocused.set(true)\"\n (blur)=\"closeBtnFocused.set(false)\"\n [tabindex]=\"tabIndex\"\n class=\"delete-icon\"\n [attr.aria-label]=\"'TAG.REMOVE' | uiTranslate | async\"\n [color]=\"iconColor\"\n (click)=\"onClose()\"\n [name]=\"'Close'\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-icon>\n }\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap\";.bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .tag-wrapper{max-width:264px}@keyframes focus-ring-animation{0%{outline-width:4px}to{outline-width:2px}}:host .tag-container{height:32px;max-width:264px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 8px;width:fit-content;cursor:pointer;margin:4px}:host .tag-container:focus-visible{outline:2px solid #242424;animation:focus-ring-animation .4s forwards;outline-offset:2px;position:relative}:host .tag-container:focus-visible:after{content:\"\";position:absolute;width:calc(100% + 4px);height:calc(100% + 4px);top:-2px;left:-2px;outline:2px solid #ffffff;border-radius:4px}:host .tag-container.outlined{border:1px solid #6894a0}:host .tag-container.filled{background:#e9f0f1;border:1px solid #e9f0f1}:host .tag-container.filled:hover{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled:active{background:#a9c2c9;border:1px solid #1b4754}:host .tag-container:hover{background:#f6f6f6;border:1px solid #6894a0}:host .tag-container:active{background:#e9f0f1}:host .tag-container.readonly{pointer-events:none}:host .tag-container.disabled{opacity:.5;border:1px solid #276678;background:#e9f0f1;pointer-events:none}:host .tag-container .tag-label{-webkit-user-select:none;user-select:none;font-size:14px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tag-container .icon{height:16px;width:16px;min-width:16px;margin-right:8px}:host .tag-container ui-badge{margin-left:8px}:host .tag-container .delete-icon{display:flex;align-items:center;justify-content:center;margin-left:8px;text-align:center;border-radius:50px}:host .tag-container[theme=dark],:host .tag-container[theme=light]{background:#f4f4f4;border:2px solid transparent}:host .tag-container[theme=dark].filled,:host .tag-container[theme=light].filled{background-color:#fff;border-color:#242424}:host .tag-container[theme=dark]:hover,:host .tag-container[theme=light]:hover{background-color:#666;color:#fff;border-color:#666;border-width:2px}:host .tag-container[theme=dark].shrink,:host .tag-container[theme=light].shrink{transform:scale(.98)}::ng-deep .mat-mdc-tooltip{background-color:#a9c2c9;font-family:Open Sans,serif;font-weight:400;font-size:12px;border-radius:4px;overflow:visible;max-width:248px;padding:6px 2px;--mdc-plain-tooltip-container-color: none;--mat-tooltip-container-color: none;--mdc-plain-tooltip-supporting-text-color: $tgo-black}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i4.BadgeComponent, selector: "ui-badge", inputs: ["label", "staticLabel", "icon", "iconColor", "trailingIcon", "trailingIconColor", "color", "variant", "notificationsAmount", "applicationTheme", "rebrandColor", "truncateLabel", "enableAnimation"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.UiTranslatePipe, name: "uiTranslate" }] }); }
190
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
191
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.20", type: TagComponent, isStandalone: false, selector: "ui-tag", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, allowClose: { classPropertyName: "allowClose", publicName: "allowClose", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: true, isRequired: false, transformFunction: null }, showIconWhenSelected: { classPropertyName: "showIconWhenSelected", publicName: "showIconWhenSelected", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, applicationTheme: { classPropertyName: "applicationTheme", publicName: "applicationTheme", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaRequired: { classPropertyName: "ariaRequired", publicName: "ariaRequired", isSignal: true, isRequired: false, transformFunction: null }, showBadge: { classPropertyName: "showBadge", publicName: "showBadge", isSignal: true, isRequired: false, transformFunction: null }, notificationsAmount: { classPropertyName: "notificationsAmount", publicName: "notificationsAmount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isSelected: "isSelectedChange", close: "close", press: "press" }, viewQueries: [{ propertyName: "labelElement", first: true, predicate: ["labelElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"tag-wrapper\">\n <div\n [matTooltip]=\"(isEllipseActiveObs$ | async) ? label() : ''\"\n [matTooltipClass]=\"theme()\"\n [tabindex]=\"tabIndex()\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [attr.theme]=\"theme()\"\n [class]=\"{\n filled: filled(),\n readonly: readOnly(),\n disabled: isDisabled(),\n outlined: !isSelected(),\n shrink,\n }\"\n (click)=\"onPress()\"\n (mouseenter)=\"setHoverState(true)\"\n (mouseleave)=\"setHoverState(false)\"\n (mousedown)=\"setShrinkState(true)\"\n (mouseup)=\"setShrinkState(false)\"\n (touchstart)=\"setShrinkState(true)\"\n (touchend)=\"setShrinkState(false)\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-label]=\"ariaLabel() || label()\"\n [attr.aria-required]=\"ariaRequired()\"\n >\n @if (icon()) {\n <ui-icon class=\"icon\" [color]=\"iconColor\" [name]=\"iconToPass()\" [applicationTheme]=\"theme()\"></ui-icon>\n }\n @if (isSelected() && showIconWhenSelected()) {\n <ui-icon [color]=\"iconColor\" class=\"icon\" [name]=\"'Check'\" [applicationTheme]=\"theme()\"></ui-icon>\n }\n <span class=\"tag-label\" #labelElement>{{ label() }}</span>\n @if (showBadge()) {\n <span class=\"count\" aria-hidden=\"true\">\n <span class=\"count-dot\">&bull;</span>\n <span class=\"count-value\">{{ notificationsAmount() }}</span>\n </span>\n }\n @if (allowClose()) {\n <ui-icon\n (focus)=\"closeBtnFocused.set(true)\"\n (blur)=\"closeBtnFocused.set(false)\"\n [tabindex]=\"tabIndex()\"\n class=\"delete-icon\"\n [attr.aria-label]=\"'TAG.REMOVE' | uiTranslate | async\"\n [color]=\"iconColor\"\n (click)=\"onClose(); $event.stopPropagation()\"\n [name]=\"'Close'\"\n [applicationTheme]=\"theme()\"\n ></ui-icon>\n }\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap\";.bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .tag-wrapper{max-width:264px}@keyframes focus-ring-animation{0%{outline-width:4px}to{outline-width:2px}}:host .tag-container{height:32px;max-width:264px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 8px;width:fit-content;cursor:pointer;margin:4px}:host .tag-container:focus-visible{outline:2px solid #242424;animation:focus-ring-animation .4s forwards;outline-offset:2px;position:relative}:host .tag-container:focus-visible:after{content:\"\";position:absolute;width:calc(100% + 4px);height:calc(100% + 4px);top:-2px;left:-2px;outline:2px solid #ffffff;border-radius:4px}:host .tag-container.outlined{border:1px solid #6894a0}:host .tag-container.filled{background:#e9f0f1;border:1px solid #e9f0f1}:host .tag-container.filled:hover{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled:active{background:#a9c2c9;border:1px solid #1b4754}:host .tag-container:hover{background:#f6f6f6;border:1px solid #6894a0}:host .tag-container:active{background:#e9f0f1}:host .tag-container.readonly{pointer-events:none}:host .tag-container.disabled{opacity:.5;border:1px solid #276678;background:#e9f0f1;pointer-events:none}:host .tag-container .tag-label{-webkit-user-select:none;user-select:none;font-size:14px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tag-container .icon{height:16px;width:16px;min-width:16px;margin-right:8px}:host .tag-container .delete-icon{display:flex;align-items:center;justify-content:center;margin-left:8px;text-align:center;border-radius:50px}:host .tag-container[theme=dark],:host .tag-container[theme=light]{border-radius:8px;background:#f4f4f4;border:1px solid #e9e9e9;color:#242424}:host .tag-container[theme=dark].outlined:not(.filled),:host .tag-container[theme=light].outlined:not(.filled){background:#fff;border-color:#919191}:host .tag-container[theme=dark].filled.readonly,:host .tag-container[theme=light].filled.readonly{border:none}:host .tag-container[theme=dark]:not(.readonly):not(.disabled):hover,:host .tag-container[theme=light]:not(.readonly):not(.disabled):hover{background:#d3d3d3;border-color:#d3d3d3;color:#242424}:host .tag-container[theme=dark]:not(.readonly):not(.disabled):focus-visible,:host .tag-container[theme=light]:not(.readonly):not(.disabled):focus-visible{outline:2px solid #242424;outline-offset:2px;border-radius:10px;animation:none}:host .tag-container[theme=dark]:not(.readonly):not(.disabled):focus-visible:after,:host .tag-container[theme=light]:not(.readonly):not(.disabled):focus-visible:after{display:none}:host .tag-container[theme=dark].shrink,:host .tag-container[theme=light].shrink{transform:scale(.98)}:host .tag-container[theme=dark].disabled,:host .tag-container[theme=light].disabled{pointer-events:none;--cnp-icon-color: #919191}:host .tag-container[theme=dark].disabled .tag-label,:host .tag-container[theme=dark].disabled .count-dot,:host .tag-container[theme=dark].disabled .count-value,:host .tag-container[theme=light].disabled .tag-label,:host .tag-container[theme=light].disabled .count-dot,:host .tag-container[theme=light].disabled .count-value{color:#919191}:host .tag-container[theme=dark] .count,:host .tag-container[theme=light] .count{display:inline-flex;align-items:center;gap:4px;margin-left:4px;font-size:14px;line-height:20px}:host .tag-container[theme=dark] .count-dot,:host .tag-container[theme=light] .count-dot{color:#666}:host .tag-container[theme=dark] .count-value,:host .tag-container[theme=light] .count-value{color:#242424;font-variant-numeric:tabular-nums}:host .tag-container[theme=dark] .icon,:host .tag-container[theme=light] .icon{margin-right:4px}:host .tag-container[theme=dark] .delete-icon,:host .tag-container[theme=light] .delete-icon{margin-left:4px;border-radius:4px;transition:outline-color .1s;outline:2px solid transparent}:host .tag-container[theme=dark] .delete-icon:focus-visible,:host .tag-container[theme=light] .delete-icon:focus-visible{outline-color:#242424}::ng-deep .mat-mdc-tooltip{background-color:#a9c2c9;font-family:Open Sans,serif;font-weight:400;font-size:12px;border-radius:4px;overflow:visible;max-width:248px;padding:6px 2px;--mdc-plain-tooltip-container-color: none;--mat-tooltip-container-color: none;--mdc-plain-tooltip-supporting-text-color: $tgo-black}\n"], dependencies: [{ kind: "component", type: i1.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.UiTranslatePipe, name: "uiTranslate" }] }); }
199
192
  }
200
193
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TagComponent, decorators: [{
201
194
  type: Component,
202
- args: [{ selector: 'ui-tag', standalone: false, template: "<div class=\"tag-wrapper\">\n <div\n [matTooltip]=\"(isEllipseActiveObs$ | async) ? labelText : ''\"\n [matTooltipClass]=\"applicationTheme\"\n [tabindex]=\"tabIndex\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"{\n filled: filled,\n readonly: readOnly,\n disabled: isDisabled,\n outlined: !isSelected,\n shrink,\n }\"\n (click)=\"onPress()\"\n (mouseenter)=\"setHoverState(true)\"\n (mouseleave)=\"setHoverState(false)\"\n (mousedown)=\"setShrinkState(true)\"\n (mouseup)=\"setShrinkState(false)\"\n (touchstart)=\"setShrinkState(true)\"\n (touchend)=\"setShrinkState(false)\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-label]=\"ariaLabel || labelText\"\n [attr.aria-required]=\"ariaRequired\"\n >\n @if (icon) {\n <ui-icon class=\"icon\" [color]=\"iconColor\" [name]=\"iconToPass\" [applicationTheme]=\"applicationTheme\"></ui-icon>\n }\n @if (isSelected && showIconWhenSelected) {\n <ui-icon [color]=\"iconColor\" class=\"icon\" [name]=\"'Check'\" [applicationTheme]=\"applicationTheme\"></ui-icon>\n }\n <span class=\"tag-label\" #labelElement>{{ labelText }}</span>\n @if (showBadge()) {\n <ui-badge\n [notificationsAmount]=\"notificationsAmount()\"\n [applicationTheme]=\"applicationTheme\"\n [variant]=\"'notification'\"\n ></ui-badge>\n }\n @if (allowClose) {\n <ui-icon\n (focus)=\"closeBtnFocused.set(true)\"\n (blur)=\"closeBtnFocused.set(false)\"\n [tabindex]=\"tabIndex\"\n class=\"delete-icon\"\n [attr.aria-label]=\"'TAG.REMOVE' | uiTranslate | async\"\n [color]=\"iconColor\"\n (click)=\"onClose()\"\n [name]=\"'Close'\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-icon>\n }\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap\";.bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .tag-wrapper{max-width:264px}@keyframes focus-ring-animation{0%{outline-width:4px}to{outline-width:2px}}:host .tag-container{height:32px;max-width:264px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 8px;width:fit-content;cursor:pointer;margin:4px}:host .tag-container:focus-visible{outline:2px solid #242424;animation:focus-ring-animation .4s forwards;outline-offset:2px;position:relative}:host .tag-container:focus-visible:after{content:\"\";position:absolute;width:calc(100% + 4px);height:calc(100% + 4px);top:-2px;left:-2px;outline:2px solid #ffffff;border-radius:4px}:host .tag-container.outlined{border:1px solid #6894a0}:host .tag-container.filled{background:#e9f0f1;border:1px solid #e9f0f1}:host .tag-container.filled:hover{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled:active{background:#a9c2c9;border:1px solid #1b4754}:host .tag-container:hover{background:#f6f6f6;border:1px solid #6894a0}:host .tag-container:active{background:#e9f0f1}:host .tag-container.readonly{pointer-events:none}:host .tag-container.disabled{opacity:.5;border:1px solid #276678;background:#e9f0f1;pointer-events:none}:host .tag-container .tag-label{-webkit-user-select:none;user-select:none;font-size:14px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tag-container .icon{height:16px;width:16px;min-width:16px;margin-right:8px}:host .tag-container ui-badge{margin-left:8px}:host .tag-container .delete-icon{display:flex;align-items:center;justify-content:center;margin-left:8px;text-align:center;border-radius:50px}:host .tag-container[theme=dark],:host .tag-container[theme=light]{background:#f4f4f4;border:2px solid transparent}:host .tag-container[theme=dark].filled,:host .tag-container[theme=light].filled{background-color:#fff;border-color:#242424}:host .tag-container[theme=dark]:hover,:host .tag-container[theme=light]:hover{background-color:#666;color:#fff;border-color:#666;border-width:2px}:host .tag-container[theme=dark].shrink,:host .tag-container[theme=light].shrink{transform:scale(.98)}::ng-deep .mat-mdc-tooltip{background-color:#a9c2c9;font-family:Open Sans,serif;font-weight:400;font-size:12px;border-radius:4px;overflow:visible;max-width:248px;padding:6px 2px;--mdc-plain-tooltip-container-color: none;--mat-tooltip-container-color: none;--mdc-plain-tooltip-supporting-text-color: $tgo-black}\n"] }]
203
- }], ctorParameters: () => [{ type: undefined, decorators: [{
204
- type: Optional
205
- }, {
206
- type: Inject,
207
- args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
208
- }] }], propDecorators: { label: [{
209
- type: Input
210
- }], icon: [{
211
- type: Input
212
- }], allowClose: [{
213
- type: Input
214
- }], readOnly: [{
215
- type: Input
216
- }], isSelected: [{
217
- type: Input
218
- }], showIconWhenSelected: [{
219
- type: Input
220
- }], isDisabled: [{
221
- type: Input
222
- }], applicationTheme: [{
223
- type: Input
224
- }], ariaLabel: [{
225
- type: Input
226
- }], ariaRequired: [{
227
- type: Input
228
- }], showBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBadge", required: false }] }], notificationsAmount: [{ type: i0.Input, args: [{ isSignal: true, alias: "notificationsAmount", required: false }] }], close: [{
229
- type: Output
230
- }], press: [{
231
- type: Output
232
- }], labelElement: [{
233
- type: ViewChild,
234
- args: ['labelElement']
235
- }] } });
195
+ args: [{ selector: 'ui-tag', standalone: false, template: "<div class=\"tag-wrapper\">\n <div\n [matTooltip]=\"(isEllipseActiveObs$ | async) ? label() : ''\"\n [matTooltipClass]=\"theme()\"\n [tabindex]=\"tabIndex()\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [attr.theme]=\"theme()\"\n [class]=\"{\n filled: filled(),\n readonly: readOnly(),\n disabled: isDisabled(),\n outlined: !isSelected(),\n shrink,\n }\"\n (click)=\"onPress()\"\n (mouseenter)=\"setHoverState(true)\"\n (mouseleave)=\"setHoverState(false)\"\n (mousedown)=\"setShrinkState(true)\"\n (mouseup)=\"setShrinkState(false)\"\n (touchstart)=\"setShrinkState(true)\"\n (touchend)=\"setShrinkState(false)\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-label]=\"ariaLabel() || label()\"\n [attr.aria-required]=\"ariaRequired()\"\n >\n @if (icon()) {\n <ui-icon class=\"icon\" [color]=\"iconColor\" [name]=\"iconToPass()\" [applicationTheme]=\"theme()\"></ui-icon>\n }\n @if (isSelected() && showIconWhenSelected()) {\n <ui-icon [color]=\"iconColor\" class=\"icon\" [name]=\"'Check'\" [applicationTheme]=\"theme()\"></ui-icon>\n }\n <span class=\"tag-label\" #labelElement>{{ label() }}</span>\n @if (showBadge()) {\n <span class=\"count\" aria-hidden=\"true\">\n <span class=\"count-dot\">&bull;</span>\n <span class=\"count-value\">{{ notificationsAmount() }}</span>\n </span>\n }\n @if (allowClose()) {\n <ui-icon\n (focus)=\"closeBtnFocused.set(true)\"\n (blur)=\"closeBtnFocused.set(false)\"\n [tabindex]=\"tabIndex()\"\n class=\"delete-icon\"\n [attr.aria-label]=\"'TAG.REMOVE' | uiTranslate | async\"\n [color]=\"iconColor\"\n (click)=\"onClose(); $event.stopPropagation()\"\n [name]=\"'Close'\"\n [applicationTheme]=\"theme()\"\n ></ui-icon>\n }\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap\";.bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}:host .tag-wrapper{max-width:264px}@keyframes focus-ring-animation{0%{outline-width:4px}to{outline-width:2px}}:host .tag-container{height:32px;max-width:264px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 8px;width:fit-content;cursor:pointer;margin:4px}:host .tag-container:focus-visible{outline:2px solid #242424;animation:focus-ring-animation .4s forwards;outline-offset:2px;position:relative}:host .tag-container:focus-visible:after{content:\"\";position:absolute;width:calc(100% + 4px);height:calc(100% + 4px);top:-2px;left:-2px;outline:2px solid #ffffff;border-radius:4px}:host .tag-container.outlined{border:1px solid #6894a0}:host .tag-container.filled{background:#e9f0f1;border:1px solid #e9f0f1}:host .tag-container.filled:hover{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled:active{background:#a9c2c9;border:1px solid #1b4754}:host .tag-container:hover{background:#f6f6f6;border:1px solid #6894a0}:host .tag-container:active{background:#e9f0f1}:host .tag-container.readonly{pointer-events:none}:host .tag-container.disabled{opacity:.5;border:1px solid #276678;background:#e9f0f1;pointer-events:none}:host .tag-container .tag-label{-webkit-user-select:none;user-select:none;font-size:14px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tag-container .icon{height:16px;width:16px;min-width:16px;margin-right:8px}:host .tag-container .delete-icon{display:flex;align-items:center;justify-content:center;margin-left:8px;text-align:center;border-radius:50px}:host .tag-container[theme=dark],:host .tag-container[theme=light]{border-radius:8px;background:#f4f4f4;border:1px solid #e9e9e9;color:#242424}:host .tag-container[theme=dark].outlined:not(.filled),:host .tag-container[theme=light].outlined:not(.filled){background:#fff;border-color:#919191}:host .tag-container[theme=dark].filled.readonly,:host .tag-container[theme=light].filled.readonly{border:none}:host .tag-container[theme=dark]:not(.readonly):not(.disabled):hover,:host .tag-container[theme=light]:not(.readonly):not(.disabled):hover{background:#d3d3d3;border-color:#d3d3d3;color:#242424}:host .tag-container[theme=dark]:not(.readonly):not(.disabled):focus-visible,:host .tag-container[theme=light]:not(.readonly):not(.disabled):focus-visible{outline:2px solid #242424;outline-offset:2px;border-radius:10px;animation:none}:host .tag-container[theme=dark]:not(.readonly):not(.disabled):focus-visible:after,:host .tag-container[theme=light]:not(.readonly):not(.disabled):focus-visible:after{display:none}:host .tag-container[theme=dark].shrink,:host .tag-container[theme=light].shrink{transform:scale(.98)}:host .tag-container[theme=dark].disabled,:host .tag-container[theme=light].disabled{pointer-events:none;--cnp-icon-color: #919191}:host .tag-container[theme=dark].disabled .tag-label,:host .tag-container[theme=dark].disabled .count-dot,:host .tag-container[theme=dark].disabled .count-value,:host .tag-container[theme=light].disabled .tag-label,:host .tag-container[theme=light].disabled .count-dot,:host .tag-container[theme=light].disabled .count-value{color:#919191}:host .tag-container[theme=dark] .count,:host .tag-container[theme=light] .count{display:inline-flex;align-items:center;gap:4px;margin-left:4px;font-size:14px;line-height:20px}:host .tag-container[theme=dark] .count-dot,:host .tag-container[theme=light] .count-dot{color:#666}:host .tag-container[theme=dark] .count-value,:host .tag-container[theme=light] .count-value{color:#242424;font-variant-numeric:tabular-nums}:host .tag-container[theme=dark] .icon,:host .tag-container[theme=light] .icon{margin-right:4px}:host .tag-container[theme=dark] .delete-icon,:host .tag-container[theme=light] .delete-icon{margin-left:4px;border-radius:4px;transition:outline-color .1s;outline:2px solid transparent}:host .tag-container[theme=dark] .delete-icon:focus-visible,:host .tag-container[theme=light] .delete-icon:focus-visible{outline-color:#242424}::ng-deep .mat-mdc-tooltip{background-color:#a9c2c9;font-family:Open Sans,serif;font-weight:400;font-size:12px;border-radius:4px;overflow:visible;max-width:248px;padding:6px 2px;--mdc-plain-tooltip-container-color: none;--mat-tooltip-container-color: none;--mdc-plain-tooltip-supporting-text-color: $tgo-black}\n"] }]
196
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], allowClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowClose", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], isSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSelected", required: false }] }, { type: i0.Output, args: ["isSelectedChange"] }], showIconWhenSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIconWhenSelected", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], applicationTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "applicationTheme", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaRequired", required: false }] }], showBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBadge", required: false }] }], notificationsAmount: [{ type: i0.Input, args: [{ isSignal: true, alias: "notificationsAmount", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], press: [{ type: i0.Output, args: ["press"] }], labelElement: [{ type: i0.ViewChild, args: ['labelElement', { isSignal: true }] }] } });
236
197
 
237
198
  class TagComponentModule {
238
199
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TagComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -241,14 +202,12 @@ class TagComponentModule {
241
202
  TooltipComponentModule,
242
203
  MatTooltipModule,
243
204
  MatInputModule,
244
- UiTranslatePipe,
245
- BadgeComponentModule], exports: [TagComponent] }); }
205
+ UiTranslatePipe], exports: [TagComponent] }); }
246
206
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TagComponentModule, imports: [CommonModule,
247
207
  IconComponentModule,
248
208
  TooltipComponentModule,
249
209
  MatTooltipModule,
250
- MatInputModule,
251
- BadgeComponentModule] }); }
210
+ MatInputModule] }); }
252
211
  }
253
212
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImport: i0, type: TagComponentModule, decorators: [{
254
213
  type: NgModule,
@@ -261,7 +220,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.20", ngImpo
261
220
  MatTooltipModule,
262
221
  MatInputModule,
263
222
  UiTranslatePipe,
264
- BadgeComponentModule,
265
223
  ],
266
224
  exports: [TagComponent],
267
225
  providers: [],
@@ -1 +1 @@
1
- {"version":3,"file":"testgorilla-tgo-ui-components-tag.mjs","sources":["../../../components/tag/tag.component.ts","../../../components/tag/tag.component.html","../../../components/tag/tag.component.module.ts","../../../components/tag/testgorilla-tgo-ui-components-tag.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n input,\n Input,\n OnInit,\n Optional,\n Output,\n signal,\n ViewChild,\n} from '@angular/core';\nimport { debounceTime, map, ReplaySubject } from 'rxjs';\nimport { IconColor, IconName } from '@testgorilla/tgo-ui/components/icon';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { IKeyboardEvent } from '@testgorilla/tgo-ui/components/core';\n\n@Component({\n selector: 'ui-tag',\n templateUrl: './tag.component.html',\n styleUrls: ['./tag.component.scss'],\n standalone: false,\n})\nexport class TagComponent implements AfterViewInit, OnInit {\n /**\n * Tag's label\n *\n * @memberof TagComponent\n */\n @Input() set label(value: string) {\n this.labelText = value;\n if (this.labelElement) {\n this.isLabelEllipseActive();\n }\n }\n\n /**\n * Icon\n *\n * @type {string}\n * @memberof TagComponent\n */\n @Input() icon: IconName = '';\n\n /**\n * Whether to allow the tag to be closed.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n @Input() allowClose = false;\n\n /**\n * Whether the tag is in read-only mode.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n @Input() readOnly = false;\n\n /**\n * Whether the tag is selected.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n @Input() isSelected = false;\n\n /**\n * Display icon when is selected\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n @Input() showIconWhenSelected = false;\n\n /**\n * Specifies whether the element is disabled.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n @Input() isDisabled = false;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof TagComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * A string representing the ARIA label for accessibility.\n * This label is used to provide an accessible name for the input element.\n * @type {string}\n * @memberof TagComponent\n */\n @Input() ariaLabel: string;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {boolean}\n * @memberof TagComponent\n */\n @Input() ariaRequired = false;\n\n /**\n * Whether to show the badge on the tag.\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n showBadge = input<boolean>(false);\n\n /**\n * The notifications amount to be displayed on the badge.\n * @type {number}\n * @default 0\n * @memberof TagComponent\n */\n notificationsAmount = input<number>(0);\n\n /**\n * Event triggered when the tag should be closed.\n *\n * @event\n * @memberof TagComponent\n */\n @Output() close = new EventEmitter<void>();\n\n /**\n * Event triggered when a press action occurs.\n *\n * @event\n * @memberof TagComponent\n */\n @Output() press = new EventEmitter<boolean>();\n\n /**\n * Subject that needs to be triggered when Label input changes, to check if it's truncated\n * @private\n * @type {void}\n * @memberof TagComponent\n */\n private checkLabelEllipsis$ = new ReplaySubject<void>(1);\n\n /**\n * Observable that indicates if the Label is truncated\n * debounceTime is used to wait for view to be initialized after receiving a new Label input\n * @protected\n * @type {boolean}\n * @memberof TagComponent\n */\n protected isEllipseActiveObs$ = this.checkLabelEllipsis$.pipe(\n debounceTime(100),\n map(() => {\n const el = this.labelElement.nativeElement;\n return el.offsetWidth < el.scrollWidth;\n })\n );\n protected labelText = '';\n protected isHovered = false;\n protected shrink = false;\n protected iconToPass: IconName;\n protected iconColor: IconColor;\n protected closeBtnFocused = signal(false);\n\n @ViewChild('labelElement') labelElement: ElementRef<HTMLElement>;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n ngOnInit(): void {\n this.iconToPass = this.icon;\n this.iconColor = 'black';\n }\n\n ngAfterViewInit(): void {\n this.isLabelEllipseActive();\n }\n\n onPress(): void {\n if (!this.readOnly && !this.allowClose) {\n this.isSelected = this.showIconWhenSelected ? !this.isSelected : false;\n this.press.emit(this.isSelected);\n }\n }\n\n setHoverState(state: boolean) {\n this.isHovered = state;\n if (this.applicationTheme !== 'classic') {\n if (state) {\n this.iconToPass = `${this.icon}-filled` as IconName;\n } else {\n this.iconToPass = this.icon;\n }\n this.iconColor = this.isHovered ? 'white' : 'black';\n }\n }\n\n setShrinkState(state: boolean) {\n this.shrink = state;\n }\n\n onClose(): void {\n this.close.emit();\n }\n\n private isLabelEllipseActive(): void {\n this.checkLabelEllipsis$.next();\n }\n\n get tabIndex(): number {\n return this.isDisabled || this.readOnly ? -1 : 0;\n }\n\n get filled(): boolean {\n return this.readOnly || this.allowClose || this.isSelected;\n }\n\n onKeydown($event: KeyboardEvent): void {\n if (\n ($event.key === (IKeyboardEvent.ENTER as string) || $event.key === (IKeyboardEvent.SPACE as string)) &&\n !this.closeBtnFocused()\n ) {\n this.onPress();\n } else if (\n this.closeBtnFocused() &&\n ($event.key === (IKeyboardEvent.ENTER as string) || $event.key === (IKeyboardEvent.SPACE as string))\n ) {\n this.onClose();\n }\n }\n}\n","<div class=\"tag-wrapper\">\n <div\n [matTooltip]=\"(isEllipseActiveObs$ | async) ? labelText : ''\"\n [matTooltipClass]=\"applicationTheme\"\n [tabindex]=\"tabIndex\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"{\n filled: filled,\n readonly: readOnly,\n disabled: isDisabled,\n outlined: !isSelected,\n shrink,\n }\"\n (click)=\"onPress()\"\n (mouseenter)=\"setHoverState(true)\"\n (mouseleave)=\"setHoverState(false)\"\n (mousedown)=\"setShrinkState(true)\"\n (mouseup)=\"setShrinkState(false)\"\n (touchstart)=\"setShrinkState(true)\"\n (touchend)=\"setShrinkState(false)\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-label]=\"ariaLabel || labelText\"\n [attr.aria-required]=\"ariaRequired\"\n >\n @if (icon) {\n <ui-icon class=\"icon\" [color]=\"iconColor\" [name]=\"iconToPass\" [applicationTheme]=\"applicationTheme\"></ui-icon>\n }\n @if (isSelected && showIconWhenSelected) {\n <ui-icon [color]=\"iconColor\" class=\"icon\" [name]=\"'Check'\" [applicationTheme]=\"applicationTheme\"></ui-icon>\n }\n <span class=\"tag-label\" #labelElement>{{ labelText }}</span>\n @if (showBadge()) {\n <ui-badge\n [notificationsAmount]=\"notificationsAmount()\"\n [applicationTheme]=\"applicationTheme\"\n [variant]=\"'notification'\"\n ></ui-badge>\n }\n @if (allowClose) {\n <ui-icon\n (focus)=\"closeBtnFocused.set(true)\"\n (blur)=\"closeBtnFocused.set(false)\"\n [tabindex]=\"tabIndex\"\n class=\"delete-icon\"\n [attr.aria-label]=\"'TAG.REMOVE' | uiTranslate | async\"\n [color]=\"iconColor\"\n (click)=\"onClose()\"\n [name]=\"'Close'\"\n [applicationTheme]=\"applicationTheme\"\n ></ui-icon>\n }\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { TooltipComponentModule } from '@testgorilla/tgo-ui/components/tooltip';\nimport { BadgeComponentModule } from '@testgorilla/tgo-ui/components/badge';\nimport { TagComponent } from './tag.component';\n\n@NgModule({\n declarations: [TagComponent],\n imports: [\n CommonModule,\n IconComponentModule,\n TooltipComponentModule,\n MatTooltipModule,\n MatInputModule,\n UiTranslatePipe,\n BadgeComponentModule,\n ],\n exports: [TagComponent],\n providers: [],\n})\nexport class TagComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAyBa,YAAY,CAAA;AACvB;;;;AAIG;IACH,IAAa,KAAK,CAAC,KAAa,EAAA;AAC9B,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;AACtB,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,oBAAoB,EAAE;QAC7B;IACF;AA+IA,IAAA,WAAA,CAC6E,eAAiC,EAAA;QAAjC,IAAA,CAAA,eAAe,GAAf,eAAe;AA9I5F;;;;;AAKG;QACM,IAAA,CAAA,IAAI,GAAa,EAAE;AAE5B;;;;;;AAMG;QACM,IAAA,CAAA,UAAU,GAAG,KAAK;AAE3B;;;;;;AAMG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK;AAEzB;;;;;;AAMG;QACM,IAAA,CAAA,UAAU,GAAG,KAAK;AAE3B;;;;;;AAMG;QACM,IAAA,CAAA,oBAAoB,GAAG,KAAK;AAErC;;;;;;AAMG;QACM,IAAA,CAAA,UAAU,GAAG,KAAK;AAE3B;;;;;;AAMG;QACM,IAAA,CAAA,gBAAgB,GAAqB,OAAO;AAUrD;;;;;AAKG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK;AAE7B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,KAAK,qDAAC;AAEjC;;;;;AAKG;AACH,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK,CAAS,CAAC,+DAAC;AAEtC;;;;;AAKG;AACO,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAAQ;AAE1C;;;;;AAKG;AACO,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAAW;AAE7C;;;;;AAKG;AACK,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,aAAa,CAAO,CAAC,CAAC;AAExD;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A,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,YAAY,CAAC;AAC5B,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,sBAAsB;wBACtB,gBAAgB;wBAChB,cAAc;wBACd,eAAe;wBACf,oBAAoB;AACrB,qBAAA;oBACD,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACvBD;;AAEG;;;;"}
1
+ {"version":3,"file":"testgorilla-tgo-ui-components-tag.mjs","sources":["../../../components/tag/tag.component.ts","../../../components/tag/tag.component.html","../../../components/tag/tag.component.module.ts","../../../components/tag/testgorilla-tgo-ui-components-tag.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { debounceTime, map, ReplaySubject } from 'rxjs';\nimport { IconColor, IconName } from '@testgorilla/tgo-ui/components/icon';\nimport { ApplicationTheme, IKeyboardEvent } from '@testgorilla/tgo-ui/components/core';\n\n@Component({\n selector: 'ui-tag',\n templateUrl: './tag.component.html',\n styleUrls: ['./tag.component.scss'],\n standalone: false,\n})\nexport class TagComponent {\n /**\n * Tag's label\n *\n * @memberof TagComponent\n */\n label = input<string>('');\n\n /**\n * Icon\n *\n * @type {string}\n * @memberof TagComponent\n */\n icon = input<IconName>('');\n\n /**\n * Whether to allow the tag to be closed.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n allowClose = input(false, { transform: booleanAttribute });\n\n /**\n * Whether the tag is in read-only mode.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n readOnly = input(false, { transform: booleanAttribute });\n\n /**\n * Whether the tag is selected.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n isSelected = model(false);\n\n /**\n * Display icon when is selected\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n showIconWhenSelected = input(false, { transform: booleanAttribute });\n\n /**\n * Specifies whether the element is disabled.\n *\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n isDisabled = input(false, { transform: booleanAttribute });\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme | undefined}\n * @memberof TagComponent\n *\n * When not provided, the component falls back to the injected\n * `CANOPYUI_DEFAULT_APPLICATION_THEME` token (if any), then to `'light'`.\n */\n applicationTheme = input<ApplicationTheme | undefined>(undefined);\n private readonly defaultAppTheme = inject<ApplicationTheme>('CANOPYUI_DEFAULT_APPLICATION_THEME' as any, {\n optional: true,\n });\n readonly theme = computed<ApplicationTheme>(() => this.applicationTheme() ?? this.defaultAppTheme ?? 'light');\n\n /**\n * A string representing the ARIA label for accessibility.\n * This label is used to provide an accessible name for the input element.\n * @type {string}\n * @memberof TagComponent\n */\n ariaLabel = input<string | undefined>(undefined);\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {boolean}\n * @memberof TagComponent\n */\n ariaRequired = input(false, { transform: booleanAttribute });\n\n /**\n * Whether to show the badge on the tag.\n * @type {boolean}\n * @default false\n * @memberof TagComponent\n */\n showBadge = input<boolean>(false);\n\n /**\n * The notifications amount to be displayed on the badge.\n * @type {number}\n * @default 0\n * @memberof TagComponent\n */\n notificationsAmount = input<number>(0);\n\n /**\n * Event triggered when the tag should be closed.\n *\n * @event\n * @memberof TagComponent\n */\n close = output<void>();\n\n /**\n * Event triggered when a press action occurs.\n *\n * @event\n * @memberof TagComponent\n */\n press = output<boolean>();\n\n /**\n * Subject that needs to be triggered when Label input changes, to check if it's truncated\n * @private\n * @type {void}\n * @memberof TagComponent\n */\n private checkLabelEllipsis$ = new ReplaySubject<void>(1);\n\n /**\n * Observable that indicates if the Label is truncated\n * debounceTime is used to wait for view to be initialized after receiving a new Label input\n * @protected\n * @type {boolean}\n * @memberof TagComponent\n */\n protected isEllipseActiveObs$ = this.checkLabelEllipsis$.pipe(\n debounceTime(100),\n map(() => {\n const el = this.labelElement()?.nativeElement;\n return !!el && el.offsetWidth < el.scrollWidth;\n })\n );\n protected readonly isHovered = signal(false);\n protected shrink = false;\n protected readonly iconToPass = computed<IconName>(() =>\n this.theme() !== 'classic' && this.isHovered() ? (`${this.icon()}-filled` as IconName) : this.icon()\n );\n protected iconColor: IconColor = 'black';\n protected closeBtnFocused = signal(false);\n\n protected readonly labelElement = viewChild<ElementRef<HTMLElement>>('labelElement');\n\n constructor() {\n effect(() => {\n this.label(); // dep — re-run on label change\n this.labelElement(); // dep — re-run once @ViewChild resolves\n this.isLabelEllipseActive();\n });\n }\n\n onPress(): void {\n if (!this.readOnly() && !this.allowClose()) {\n const newSelected = this.showIconWhenSelected() ? !this.isSelected() : false;\n this.isSelected.set(newSelected);\n this.press.emit(newSelected);\n }\n }\n\n setHoverState(state: boolean) {\n if (this.theme() === 'classic') return;\n this.isHovered.set(state);\n }\n\n setShrinkState(state: boolean) {\n this.shrink = state;\n }\n\n onClose(): void {\n this.close.emit();\n }\n\n private isLabelEllipseActive(): void {\n this.checkLabelEllipsis$.next();\n }\n\n readonly tabIndex = computed(() => (this.isDisabled() || this.readOnly() ? -1 : 0));\n\n readonly filled = computed(() => this.readOnly() || this.allowClose() || this.isSelected());\n\n onKeydown($event: KeyboardEvent): void {\n if (\n ($event.key === (IKeyboardEvent.ENTER as string) || $event.key === (IKeyboardEvent.SPACE as string)) &&\n !this.closeBtnFocused()\n ) {\n this.onPress();\n } else if (\n this.closeBtnFocused() &&\n ($event.key === (IKeyboardEvent.ENTER as string) || $event.key === (IKeyboardEvent.SPACE as string))\n ) {\n this.onClose();\n }\n }\n}\n","<div class=\"tag-wrapper\">\n <div\n [matTooltip]=\"(isEllipseActiveObs$ | async) ? label() : ''\"\n [matTooltipClass]=\"theme()\"\n [tabindex]=\"tabIndex()\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [attr.theme]=\"theme()\"\n [class]=\"{\n filled: filled(),\n readonly: readOnly(),\n disabled: isDisabled(),\n outlined: !isSelected(),\n shrink,\n }\"\n (click)=\"onPress()\"\n (mouseenter)=\"setHoverState(true)\"\n (mouseleave)=\"setHoverState(false)\"\n (mousedown)=\"setShrinkState(true)\"\n (mouseup)=\"setShrinkState(false)\"\n (touchstart)=\"setShrinkState(true)\"\n (touchend)=\"setShrinkState(false)\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-label]=\"ariaLabel() || label()\"\n [attr.aria-required]=\"ariaRequired()\"\n >\n @if (icon()) {\n <ui-icon class=\"icon\" [color]=\"iconColor\" [name]=\"iconToPass()\" [applicationTheme]=\"theme()\"></ui-icon>\n }\n @if (isSelected() && showIconWhenSelected()) {\n <ui-icon [color]=\"iconColor\" class=\"icon\" [name]=\"'Check'\" [applicationTheme]=\"theme()\"></ui-icon>\n }\n <span class=\"tag-label\" #labelElement>{{ label() }}</span>\n @if (showBadge()) {\n <span class=\"count\" aria-hidden=\"true\">\n <span class=\"count-dot\">&bull;</span>\n <span class=\"count-value\">{{ notificationsAmount() }}</span>\n </span>\n }\n @if (allowClose()) {\n <ui-icon\n (focus)=\"closeBtnFocused.set(true)\"\n (blur)=\"closeBtnFocused.set(false)\"\n [tabindex]=\"tabIndex()\"\n class=\"delete-icon\"\n [attr.aria-label]=\"'TAG.REMOVE' | uiTranslate | async\"\n [color]=\"iconColor\"\n (click)=\"onClose(); $event.stopPropagation()\"\n [name]=\"'Close'\"\n [applicationTheme]=\"theme()\"\n ></ui-icon>\n }\n </div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { TooltipComponentModule } from '@testgorilla/tgo-ui/components/tooltip';\nimport { TagComponent } from './tag.component';\n\n@NgModule({\n declarations: [TagComponent],\n imports: [\n CommonModule,\n IconComponentModule,\n TooltipComponentModule,\n MatTooltipModule,\n MatInputModule,\n UiTranslatePipe,\n ],\n exports: [TagComponent],\n providers: [],\n})\nexport class TagComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAuBa,YAAY,CAAA;AA6JvB,IAAA,WAAA,GAAA;AA5JA;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AAEzB;;;;;AAKG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAW,EAAE,gDAAC;AAE1B;;;;;;AAMG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,8CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AAE1D;;;;;;AAMG;AACH,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,4CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AAExD;;;;;;AAMG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,sDAAC;AAEzB;;;;;;AAMG;AACH,QAAA,IAAA,CAAA,oBAAoB,GAAG,KAAK,CAAC,KAAK,wDAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AAEpE;;;;;;AAMG;AACH,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,8CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AAE1D;;;;;;;;;AASG;AACH,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAA+B,SAAS,4DAAC;AAChD,QAAA,IAAA,CAA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