{"version":3,"file":"ngwr-descriptions.mjs","sources":["../../../projects/lib/descriptions/descriptions.ts","../../../projects/lib/descriptions/descriptions.html","../../../projects/lib/descriptions/description-item.ts","../../../projects/lib/descriptions/ngwr-descriptions.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\n/**\n * Read-only labeled key / value list. Project `<wr-description-item>`\n * children. `title` is optional. Default layout stacks vertically; set\n * `[inline]=\"true\"` for label-left / value-right rows.\n *\n * @example\n * ```html\n * <wr-descriptions title=\"Account\" inline>\n *   <wr-description-item label=\"Name\">Ada Lovelace</wr-description-item>\n *   <wr-description-item label=\"Email\">ada@example.com</wr-description-item>\n *   <wr-description-item label=\"Joined\">2024-03-12</wr-description-item>\n * </wr-descriptions>\n * ```\n *\n * @see https://ngwr.dev/components/descriptions\n */\n@Component({\n  selector: 'wr-descriptions',\n  templateUrl: './descriptions.html',\n  encapsulation: ViewEncapsulation.None,\n  host: { '[class]': 'classes()' },\n})\nexport class WrDescriptions {\n  /** Optional title shown above the list. */\n  readonly title = input<string>('');\n\n  /** Two-column rows (label left, value right) instead of stacked. @default false */\n  readonly inline = input(false, { transform: coerceBooleanProperty });\n\n  /** Add visible borders around each row. @default false */\n  readonly bordered = input(false, { transform: coerceBooleanProperty });\n\n  /**\n   * Reflow `inline` rows back to a stacked layout when the box itself is\n   * narrow (a container query on its own width, not the viewport — so it\n   * adapts inside a narrow card or side panel). Makes the box fill its\n   * container's width. @default false\n   */\n  readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n  protected readonly classes = computed(() => {\n    const parts = ['wr-descriptions'];\n    if (this.inline()) parts.push('wr-descriptions--inline');\n    if (this.bordered()) parts.push('wr-descriptions--bordered');\n    if (this.responsive()) parts.push('wr-descriptions--responsive');\n    return parts.join(' ');\n  });\n}\n","@if (title()) {\n  <div class=\"wr-descriptions__title\">{{ title() }}</div>\n}\n<dl class=\"wr-descriptions__list\">\n  <ng-content />\n</dl>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, input } from '@angular/core';\n\n/**\n * One row in a {@link WrDescriptions}. The label comes from the\n * `label` input; the value is the projected content.\n */\n@Component({\n  selector: 'wr-description-item',\n  template:\n    '<dt class=\"wr-descriptions__label\">{{ label() }}</dt><dd class=\"wr-descriptions__value\"><ng-content /></dd>',\n  encapsulation: ViewEncapsulation.None,\n  host: { class: 'wr-descriptions__row' },\n})\nexport class WrDescriptionItem {\n  readonly label = input<string>('');\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;;;;;;;AAeG;MAOU,cAAc,CAAA;;IAEhB,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;;IAGzB,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAG3D,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEtE;;;;;AAKG;IACM,UAAU,GAAG,KAAK,CAAC,KAAK,kFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAErD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,CAAC,iBAAiB,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,EAAE;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC;QACxD,IAAI,IAAI,CAAC,QAAQ,EAAE;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC;QAC5D,IAAI,IAAI,CAAC,UAAU,EAAE;A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