{"version":3,"file":"daffodil-design-text-snippet.mjs","names":[],"sources":["../../../libs/design/text-snippet/src/text-snippet.component.ts","../../../libs/design/text-snippet/src/text-snippet.component.html"],"sourcesContent":["import {\n  Component,\n  ChangeDetectionStrategy,\n  ElementRef,\n  input,\n  model,\n  output,\n  viewChild,\n} from '@angular/core';\n\n@Component({\n  selector: 'daff-text-snippet',\n  templateUrl: './text-snippet.component.html',\n  styleUrl: './text-snippet.component.scss',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  host: {\n    class: 'daff-text-snippet',\n  },\n})\nexport class DaffTextSnippetComponent {\n  /**\n   * Whether or not the component should render a condensed version of the content.\n   */\n  condensed = model(true);\n\n  /**\n   * The HTML content to render inside the snippet.\n   */\n  html = input('');\n\n  /**\n   * @docs-private\n   */\n  ariaExpanded() {\n    return !this.condensed() ? true : false;\n  }\n\n  /**\n   * @docs-private\n   */\n  contentRef = viewChild('contentEl', { read: ElementRef });\n\n  /**\n   * @docs-private\n   */\n  htmlRef = viewChild('htmlEl', { read: ElementRef });\n\n  /**\n   * An output event that can be used to track the state of the component externally.\n   */\n  toggled = output<boolean>();\n\n  /**\n   * @docs-private\n   */\n  toggleSnippet() {\n    this.condensed.set(!this.condensed());\n    this.toggled.emit(this.condensed());\n  }\n}\n","@if (html()) {\n  <div class=\"daff-text-snippet__content daff-text-snippet__html\" #htmlEl [class.condensed]=\"condensed()\" [innerHtml]=\"html()\"></div>\n} @else {\n  <div class=\"daff-text-snippet__content daff-text-snippet__ngcontent\" #contentEl [class.condensed]=\"condensed()\">\n    <ng-content></ng-content>\n  </div>\n}\n<button\n  class=\"daff-text-snippet__toggle\"\n  [attr.aria-expanded]=\"ariaExpanded()\"\n  (click)=\"toggleSnippet()\">\n    @if (condensed()) {\n      Show more\n    } @else {\n      Show less\n    }\n</button>\n"],"mappings":";;AAmBA,IAAa,2BAAb,MAAa,yBAAwB;CATrC,cAAA;EAaE,KAAA,YAAY,MAAM,MAAK,GAAA,YAAA,CAAA,EAA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