@taiga-ui/kit
Version:
Taiga UI Angular main components kit
1 lines • 1.56 kB
Source Map (JSON)
{"version":3,"file":"taiga-ui-kit-pipes-flag.mjs","sources":["../../../projects/kit/pipes/flag/flag.pipe.ts","../../../projects/kit/pipes/flag/taiga-ui-kit-pipes-flag.ts"],"sourcesContent":["import {inject, Pipe, type PipeTransform} from '@angular/core';\nimport {TUI_ASSETS_PATH} from '@taiga-ui/core/tokens';\nimport {type TuiCountryIsoCode} from '@taiga-ui/i18n/types';\n\ntype IsoCode = TuiCountryIsoCode | string;\n\n@Pipe({name: 'tuiFlag'})\nexport class TuiFlagPipe implements PipeTransform {\n private readonly staticPath = inject(TUI_ASSETS_PATH);\n\n public transform(countryIsoCode: IsoCode): string;\n public transform(countryIsoCode: IsoCode | undefined): string | null;\n public transform(countryIsoCode?: IsoCode | null): string | null;\n public transform(countryIsoCode?: IsoCode | null): string | null {\n return countryIsoCode\n ? `${this.staticPath}/flags/${countryIsoCode.toLowerCase()}.svg`\n : null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,WAAW,CAAA;AADxB,IAAA,WAAA,GAAA;AAEqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC;AAUxD,IAAA;AALU,IAAA,SAAS,CAAC,cAA+B,EAAA;AAC5C,QAAA,OAAO;cACD,CAAA,EAAG,IAAI,CAAC,UAAU,UAAU,cAAc,CAAC,WAAW,EAAE,CAAA,IAAA;cACxD,IAAI;IACd;+GAVS,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,CAAA;;4FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBADvB,IAAI;mBAAC,EAAC,IAAI,EAAE,SAAS,EAAC;;;ACNvB;;AAEG;;;;"}