{"version":3,"file":"lucca-front-ng-highlight-data.mjs","sources":["../../../packages/ng/highlight-data/highlight-data.component.ts","../../../packages/ng/highlight-data/highlight-data.component.html","../../../packages/ng/highlight-data/lucca-front-ng-highlight-data.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, computed, effect, inject, input, ViewEncapsulation } from '@angular/core';\nimport { LuClass, PortalContent, PortalDirective } from '@lucca-front/ng/core';\n\ntype IllustrationType =\n\t| 'calculator'\n\t| 'calendar'\n\t| 'cleemy-card'\n\t| 'coffee'\n\t| 'headphone'\n\t| 'mail'\n\t| 'magnifying-glass'\n\t/** @deprecated use 'magnifying-glass' instead */\n\t| 'manifying-glass'\n\t| 'medallon'\n\t| 'piggy-bank'\n\t| 'polaroid-female'\n\t| 'polaroid-male'\n\t| 'polaroids'\n\t| string;\n\n@Component({\n\tselector: 'lu-highlight-data',\n\ttemplateUrl: './highlight-data.component.html',\n\tstyleUrl: './highlight-data.component.scss',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n\timports: [PortalDirective],\n\tproviders: [LuClass],\n\thost: {\n\t\tclass: 'highlightData',\n\t\t'[class.mod-light]': 'lightClass',\n\t\t'[class.mod-dark]': 'darkClass',\n\t},\n})\nexport class HighlightDataComponent {\n\t#luClass = inject(LuClass);\n\n\t/**\n\t * The title of the highlight date\n\t */\n\treadonly heading = input.required<PortalContent>();\n\n\t/**\n\t * The content of the highlight date\n\t */\n\treadonly value = input.required<PortalContent>();\n\n\t/**\n\t * Add text below the content\n\t */\n\treadonly subText = input<PortalContent>();\n\n\t/**\n\t * Define a bubble style based on the CDN image bubble number\n\t */\n\treadonly bubble = input<1 | 2 | 3 | 4 | number>();\n\n\t/**\n\t * Define a specific them white light or dark. (White by default)\n\t */\n\treadonly theme = input<'white' | 'light' | 'dark'>('white');\n\n\t/**\n\t * Apply product name to illustration URL and CSS component palette\n\t * This specific palette must be set up on config.scss\n\t */\n\treadonly palette = input<'lucca' | 'cleemy' | 'timmi' | 'poplee' | 'coreHR' | 'pagga' | 'cc' | 'success' | 'warning' | 'critical' | string>('lucca');\n\n\t/**\n\t * Main illustration\n\t * An URL can be apply for custom images\n\t */\n\treadonly illustration = input<IllustrationType>();\n\n\t/**\n\t * Which size should the highlight data be? XS to medium\n\t */\n\treadonly size = input<'XS' | 'S' | 'M' | null>(null);\n\n\t/**\n\t * Adjust layout to text value\n\t */\n\treadonly valueFirst = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Displayed in nested mode\n\t */\n\treadonly nested = input(false, { transform: booleanAttribute });\n\n\tget lightClass() {\n\t\treturn this.theme() === 'light';\n\t}\n\n\tget darkClass() {\n\t\treturn this.theme() === 'dark';\n\t}\n\n\treadonly illustrationSrc = computed(() =>\n\t\tthis.illustration().includes('/') ? this.illustration() : `https://cdn.lucca.fr/transverse/prisme/visuals/highlight-data/generic/${this.illustration()}.svg`,\n\t);\n\n\treadonly bubbleSrc = computed(() => `https://cdn.lucca.fr/transverse/prisme/visuals/highlight-data/${this.palette()}/bubbles-${this.bubbleTheme()}-${this.bubble()}.svg`);\n\n\treadonly bubbleTheme = computed(() => (this.theme() === 'dark' ? 'dark' : 'light'));\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tthis.#luClass.setState({\n\t\t\t\t[`mod-${this.size()}`]: !!this.size(),\n\t\t\t\t'mod-valueFirst': this.valueFirst(),\n\t\t\t\t'mod-nested': this.nested(),\n\t\t\t\t[`palette-${this.palette()}`]: !!this.palette(),\n\t\t\t});\n\t\t});\n\t}\n}\n","<dl class=\"highlightData-content\">\n\t<dt class=\"highlightData-content-title\"><ng-container *luPortal=\"heading()\" /></dt>\n\t<dd class=\"highlightData-content-value\"><ng-container *luPortal=\"value()\" /></dd>\n\t@if (subText()) {\n\t\t<dd class=\"highlightData-content-subText\"><ng-container *luPortal=\"subText()\" /></dd>\n\t}\n\t<dd class=\"highlightData-content-action\"><ng-content /></dd>\n</dl>\n\n@if (bubble() || illustration()) {\n\t<div class=\"highlightData-illustrations\">\n\t\t@if (bubble()) {\n\t\t\t<img alt=\"\" class=\"highlightData-illustrations-back\" [attr.src]=\"bubbleSrc()\" />\n\t\t}\n\t\t@if (illustration()) {\n\t\t\t<img alt=\"\" class=\"highlightData-illustrations-front\" [attr.src]=\"illustrationSrc()\" />\n\t\t}\n\t</div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAkCa,sBAAsB,CAAA;AAClC,IAAA,QAAQ;AAsDR,IAAA,IAAI,UAAU,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE,KAAK,OAAO;IAChC;AAEA,IAAA,IAAI,SAAS,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE,KAAK,MAAM;IAC/B;AAUA,IAAA,WAAA,GAAA;AAtEA,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;AAE1B;;AAEG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAiB;AAElD;;AAEG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAiB;AAEhD;;AAEG;QACM,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAiB;AAEzC;;AAEG;QACM,IAAA,CAAA,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAA0B;AAEjD;;AAEG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAA6B,OAAO,iDAAC;AAE3D;;;AAGG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAoH,OAAO,mDAAC;AAEpJ;;;AAGG;QAC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