{"version":3,"file":"ngwr-layout.mjs","sources":["../../../projects/lib/layout/layout-sider.ts","../../../projects/lib/layout/layout.ts","../../../projects/lib/layout/layout-header.ts","../../../projects/lib/layout/layout-content.ts","../../../projects/lib/layout/layout-footer.ts","../../../projects/lib/layout/ngwr-layout.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, model, output } from '@angular/core';\n\n/**\n * Collapsible side panel. Lives inside a row `<wr-layout>` next to a\n * `<wr-layout-content>`. Two-way `[(collapsed)]` controls width.\n *\n * @example\n * ```html\n * <wr-layout>\n *   <wr-layout-sider [(collapsed)]=\"collapsed\" width=\"14rem\" collapsedWidth=\"3rem\">\n *     …\n *   </wr-layout-sider>\n *   <wr-layout-content>Main</wr-layout-content>\n * </wr-layout>\n * ```\n */\n@Component({\n  selector: 'wr-layout-sider',\n  template: '<ng-content />',\n  encapsulation: ViewEncapsulation.None,\n  host: {\n    '[class]': 'classes()',\n    '[style.width]': 'collapsed() ? collapsedWidth() : width()',\n    role: 'complementary',\n  },\n})\nexport class WrLayoutSider {\n  /** Two-way bindable collapsed state. @default false */\n  readonly collapsed = model(false);\n\n  /** Width when expanded. Any CSS length. @default '16rem' */\n  readonly width = input<string>('16rem');\n\n  /** Width when collapsed. Any CSS length. `0` to fully hide. @default '4rem' */\n  readonly collapsedWidth = input<string>('4rem');\n\n  /** Place the sider on the right edge instead of the left. @default false */\n  readonly reverse = input(false, { transform: coerceBooleanProperty });\n\n  /** Emits whenever `collapsed` changes (in addition to the two-way `[(collapsed)]`). */\n  readonly collapsedChanged = output<boolean>();\n\n  protected readonly classes = computed(() => {\n    const parts = ['wr-layout-sider'];\n    if (this.collapsed()) parts.push('wr-layout-sider--collapsed');\n    if (this.reverse()) parts.push('wr-layout-sider--reverse');\n    return parts.join(' ');\n  });\n\n  /** Imperative toggle helper — `[(collapsed)]` still works alongside this. */\n  toggle(): void {\n    const next = !this.collapsed();\n    this.collapsed.set(next);\n    this.collapsedChanged.emit(next);\n  }\n}\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, computed, contentChildren } from '@angular/core';\n\nimport { WrLayoutSider } from './layout-sider';\n\n/**\n * App-shell layout container. Lays its children out as a flex column by\n * default; switches to a row when a `<wr-layout-sider>` is among the\n * direct children (so `header → [sider + content] → footer` falls into\n * place automatically — same convention as ng-zorro / antd Layout).\n *\n * @example\n * ```html\n * <wr-layout>\n *   <wr-layout-header>App bar</wr-layout-header>\n *   <wr-layout>\n *     <wr-layout-sider [(collapsed)]=\"collapsed\">Sidebar</wr-layout-sider>\n *     <wr-layout-content>Main</wr-layout-content>\n *   </wr-layout>\n *   <wr-layout-footer>© 2026</wr-layout-footer>\n * </wr-layout>\n * ```\n *\n * @see https://ngwr.dev/components/layout\n */\n@Component({\n  selector: 'wr-layout',\n  template: '<ng-content />',\n  encapsulation: ViewEncapsulation.None,\n  host: { '[class]': 'classes()' },\n})\nexport class WrLayout {\n  protected readonly siders = contentChildren(WrLayoutSider);\n\n  protected readonly classes = computed(() => {\n    const parts = ['wr-layout'];\n    if (this.siders().length > 0) parts.push('wr-layout--has-sider');\n    return parts.join(' ');\n  });\n}\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 } from '@angular/core';\n\n/**\n * Top bar of a {@link WrLayout}. Stretches across the parent;\n * size and stickiness are app-controlled via CSS.\n */\n@Component({\n  selector: 'wr-layout-header',\n  template: '<ng-content />',\n  encapsulation: ViewEncapsulation.None,\n  host: { class: 'wr-layout-header', role: 'banner' },\n})\nexport class WrLayoutHeader {}\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 } from '@angular/core';\n\n/**\n * Main content area of a {@link WrLayout}. Flex-grows to fill\n * remaining space.\n */\n@Component({\n  selector: 'wr-layout-content',\n  template: '<ng-content />',\n  encapsulation: ViewEncapsulation.None,\n  host: { class: 'wr-layout-content', role: 'main' },\n})\nexport class WrLayoutContent {}\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 } from '@angular/core';\n\n/**\n * Bottom bar of a {@link WrLayout}. Doesn't grow — sized by its\n * children.\n */\n@Component({\n  selector: 'wr-layout-footer',\n  template: '<ng-content />',\n  encapsulation: ViewEncapsulation.None,\n  host: { class: 'wr-layout-footer', role: 'contentinfo' },\n})\nexport class WrLayoutFooter {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;;;;;AAaG;MAWU,aAAa,CAAA;;IAEf,SAAS,GAAG,KAAK,CAAC,KAAK;kFAAC;;IAGxB,KAAK,GAAG,KAAK,CAAS,OAAO;8EAAC;;IAG9B,cAAc,GAAG,KAAK,CAAS,MAAM;uFAAC;;IAGtC,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAG5D,gBAAgB,GAAG,MAAM,EAAW;AAE1B,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,CAAC,iBAAiB,CAAC;QACjC,IAAI,IAAI,CAAC,SAAS,EAAE;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC;QAC9D,IAAI,IAAI,CAAC,OAAO,EAAE;AAAE,YAAA,KAAK,CAAC,I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