{"version":3,"file":"daffodil-design-text-snippet.mjs","sources":["../../../libs/design/text-snippet/src/text-snippet.component.ts","../../../libs/design/text-snippet/src/text-snippet.component.html","../../../libs/design/text-snippet/src/daffodil-design-text-snippet.ts"],"sourcesContent":["import {\n  Component,\n  Input,\n  ChangeDetectionStrategy,\n  EventEmitter,\n  Output,\n  ElementRef,\n  ViewChild,\n} from '@angular/core';\n\n@Component({\n  selector: 'daff-text-snippet',\n  templateUrl: './text-snippet.component.html',\n  styleUrls: ['./text-snippet.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  host: {\n    class: 'daff-text-snippet',\n  },\n})\nexport class DaffTextSnippetComponent {\n\n  /**\n   * Whether or not the component should render a condensed version of the content.\n   */\n  @Input() condensed = true;\n\n  /**\n   * The HTML content to render inside the snippet.\n   */\n  @Input() html = '';\n\n  /**\n   * @docs-private\n   */\n  ariaExpanded() {\n    return !this.condensed ? true : false;\n  }\n\n  /**\n   * @docs-private\n   */\n  @ViewChild('contentEl', { read: ElementRef }) contentRef: ElementRef;\n\n  /**\n   * @docs-private\n   */\n  @ViewChild('htmlEl', { read: ElementRef }) htmlRef: ElementRef;\n\n  /**\n   * An output event that can be used to track the state of the component externally.\n   */\n  // eslint-disable-next-line @angular-eslint/no-output-native\n  @Output() toggle: EventEmitter<boolean> = new EventEmitter();\n\n  /**\n   * @docs-private\n   */\n  toggleSnippet() {\n    this.condensed = !this.condensed;\n    this.toggle.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    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