@slotted/angular 0.1.0-beta.3 → 0.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/calendar.json +7 -0
- package/docs/calendar.md +1 -0
- package/docs/date-field.json +8 -1
- package/docs/date-field.md +2 -1
- package/docs/date-picker.examples.md +36 -0
- package/docs/date-picker.json +20 -5
- package/docs/date-picker.md +5 -4
- package/docs/guidelines/composition.md +10 -0
- package/docs/guidelines/index.md +2 -0
- package/docs/guidelines/list-pages.md +12 -1
- package/docs/page.json +1 -0
- package/docs/page.md +1 -0
- package/docs/skills/compose-screen/SKILL.md +7 -0
- package/docs/table.json +13 -0
- package/docs/table.md +3 -1
- package/docs/text-field.json +1 -1
- package/docs/text-field.md +1 -1
- package/fesm2022/slotted-angular-calendar.mjs +158 -33
- package/fesm2022/slotted-angular-calendar.mjs.map +1 -1
- package/fesm2022/slotted-angular-combobox.mjs +25 -4
- package/fesm2022/slotted-angular-combobox.mjs.map +1 -1
- package/fesm2022/slotted-angular-data-grid.mjs +2 -2
- package/fesm2022/slotted-angular-data-grid.mjs.map +1 -1
- package/fesm2022/slotted-angular-date-field.mjs +35 -12
- package/fesm2022/slotted-angular-date-field.mjs.map +1 -1
- package/fesm2022/slotted-angular-date-picker.mjs +91 -27
- package/fesm2022/slotted-angular-date-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-date-range-picker.mjs +1 -1
- package/fesm2022/slotted-angular-date-range-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-datetime-picker.mjs +1 -1
- package/fesm2022/slotted-angular-datetime-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-datetime-range-picker.mjs +1 -1
- package/fesm2022/slotted-angular-datetime-range-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-filter-bar.mjs +1 -1
- package/fesm2022/slotted-angular-filter-bar.mjs.map +1 -1
- package/fesm2022/slotted-angular-import-export-center.mjs +1 -1
- package/fesm2022/slotted-angular-import-export-center.mjs.map +1 -1
- package/fesm2022/slotted-angular-multi-select.mjs +24 -3
- package/fesm2022/slotted-angular-multi-select.mjs.map +1 -1
- package/fesm2022/slotted-angular-page.mjs +20 -1
- package/fesm2022/slotted-angular-page.mjs.map +1 -1
- package/fesm2022/slotted-angular-table.mjs +15 -4
- package/fesm2022/slotted-angular-table.mjs.map +1 -1
- package/package.json +3 -3
- package/types/slotted-angular-calendar.d.ts +28 -2
- package/types/slotted-angular-calendar.d.ts.map +1 -1
- package/types/slotted-angular-combobox.d.ts +4 -0
- package/types/slotted-angular-combobox.d.ts.map +1 -1
- package/types/slotted-angular-date-field.d.ts +11 -1
- package/types/slotted-angular-date-field.d.ts.map +1 -1
- package/types/slotted-angular-date-picker.d.ts +38 -11
- package/types/slotted-angular-date-picker.d.ts.map +1 -1
- package/types/slotted-angular-multi-select.d.ts +4 -0
- package/types/slotted-angular-multi-select.d.ts.map +1 -1
- package/types/slotted-angular-page.d.ts.map +1 -1
- package/types/slotted-angular-table.d.ts +16 -2
- package/types/slotted-angular-table.d.ts.map +1 -1
|
@@ -6,7 +6,7 @@ import * as i1 from '@slotted/angular/typography';
|
|
|
6
6
|
import { SlHeadingLevel } from '@slotted/angular/typography';
|
|
7
7
|
import { pageMessages } from '@slotted/core/i18n';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
|
-
import { InjectionToken, inject, input, booleanAttribute, ElementRef, HostAttributeToken, computed, DestroyRef, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, effect } from '@angular/core';
|
|
9
|
+
import { InjectionToken, inject, input, booleanAttribute, ElementRef, HostAttributeToken, computed, DestroyRef, afterNextRender, isDevMode, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, effect } from '@angular/core';
|
|
10
10
|
|
|
11
11
|
const FALLBACK = {
|
|
12
12
|
ground: 'sunken',
|
|
@@ -38,6 +38,23 @@ function injectPageDefaults() {
|
|
|
38
38
|
|
|
39
39
|
/** The custom property the scroller carries for what sticks above the footer. */
|
|
40
40
|
const STICKY_BOTTOM_PROPERTY = '--slotted-page-sticky-bottom';
|
|
41
|
+
/**
|
|
42
|
+
* The inset lives on the body, so content written straight into the page is
|
|
43
|
+
* drawn against the viewport's edges and nothing else says why. A header is
|
|
44
|
+
* not that content — it carries its own inset — so it is the one child the
|
|
45
|
+
* check passes over.
|
|
46
|
+
*/
|
|
47
|
+
function warnWithoutBody(root) {
|
|
48
|
+
const scroll = root.querySelector(':scope > [data-part="scroll"]');
|
|
49
|
+
if (scroll === null)
|
|
50
|
+
return;
|
|
51
|
+
const content = [...scroll.children].filter((child) => child.getAttribute('data-ui') !== 'page-header');
|
|
52
|
+
if (content.length === 0)
|
|
53
|
+
return;
|
|
54
|
+
if (content.some((child) => child.getAttribute('data-part') === 'body'))
|
|
55
|
+
return;
|
|
56
|
+
console.warn('slPage has content outside slPageBody. Content outside the body receives no inset: wrap it in an element carrying slPageBody.');
|
|
57
|
+
}
|
|
41
58
|
/**
|
|
42
59
|
* The column of a screen: who scrolls, how wide the content is, where the
|
|
43
60
|
* footer stays, how much air the body has.
|
|
@@ -117,6 +134,8 @@ class SlPage {
|
|
|
117
134
|
constructor() {
|
|
118
135
|
const destroyRef = inject(DestroyRef);
|
|
119
136
|
afterNextRender(() => {
|
|
137
|
+
if (isDevMode())
|
|
138
|
+
warnWithoutBody(this.native);
|
|
120
139
|
if (typeof ResizeObserver === 'undefined')
|
|
121
140
|
return;
|
|
122
141
|
const target = findScrollParent(this.native) ?? this.native.ownerDocument.documentElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotted-angular-page.mjs","sources":["../../page/src/page-defaults.ts","../../page/src/page.ts","../../page/src/slotted-angular-page.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/** The width of the content column: the container's own sizes. */\nexport type PageWidth = 'measure' | 'content' | 'wide' | 'full' | 'bleed';\n\n/** The inset of the content column from the edge of the page: the container's own steps. */\nexport type PageInset = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\n/**\n * Who scrolls. `ancestor` puts the page inside whatever scrolls and makes it\n * at least as tall as that, so the footer has a bottom to stick to. `self`\n * makes the page's own scroll part the scroller, with the footer below it.\n */\nexport type PageScroll = 'ancestor' | 'self';\n\n/** The ground: the sunken canvas of an application, or the plain surface of a document. */\nexport type PageGround = 'sunken' | 'surface';\n\n/** Whether the root is the document's `main` landmark. */\nexport type PageLandmark = 'main' | 'none';\n\nexport interface PageDefaults {\n ground: PageGround;\n inset: PageInset;\n landmark: PageLandmark;\n scroll: PageScroll;\n width: PageWidth;\n}\n\nconst FALLBACK: PageDefaults = {\n ground: 'sunken',\n inset: 6,\n landmark: 'main',\n scroll: 'ancestor',\n width: 'wide',\n};\n\nexport const PAGE_DEFAULTS = new InjectionToken<PageDefaults>('slotted page defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once how its pages are laid out — the measure, the\n * inset, who scrolls, the ground — rather than repeating the same inputs on\n * every route. A page that states any of them itself still wins. Its words\n * come from the language in force (`provideSlotted`).\n */\nexport function providePageDefaults(defaults: Partial<PageDefaults>) {\n return {\n provide: PAGE_DEFAULTS,\n useFactory: (): PageDefaults => ({ ...FALLBACK, ...defaults }),\n };\n}\n\n/** What a page renders as here, before it states anything of its own. */\nexport function injectPageDefaults(): PageDefaults {\n return inject(PAGE_DEFAULTS);\n}\n","import { createPresence } from '@slotted/core/presence';\nimport type { PresenceStatus } from '@slotted/core/presence';\nimport { findScrollParent } from '@slotted/core/sticky-header';\nimport { SlContainer } from '@slotted/angular/container';\nimport { injectMessages } from '@slotted/angular/i18n';\nimport { SlHeadingLevel } from '@slotted/angular/typography';\nimport { pageMessages, type PageMessages, type PartialMessages } from '@slotted/core/i18n';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n HostAttributeToken,\n inject,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { injectPageDefaults } from './page-defaults';\nimport type { PageGround, PageInset, PageLandmark, PageScroll, PageWidth } from './page-defaults';\n\nexport type {\n PageDefaults,\n PageGround,\n PageInset,\n PageLandmark,\n PageScroll,\n PageWidth,\n} from './page-defaults';\n\n/** The custom property the scroller carries for what sticks above the footer. */\nexport const STICKY_BOTTOM_PROPERTY = '--slotted-page-sticky-bottom';\n\n/**\n * The column of a screen: who scrolls, how wide the content is, where the\n * footer stays, how much air the body has.\n *\n * **The header is a direct child of what scrolls.** There is no header part: a\n * `sticky` element never leaves the box that contains it, so a wrapper exactly\n * the header's height would pin nothing. The element carrying `slPageHeader`\n * is projected first into the scroll part, beside the body.\n *\n * **The footer is projected outside the scroll part** — below the scroller\n * under `self`, stuck to the bottom of the root under `ancestor` — which is\n * what content projection is for. It keeps its box through its exit on\n * `open`, so the bar slides out rather than vanishing.\n *\n * **The element is the consumer's.** `<main slPage>` is the main landmark and\n * the directive adds nothing; `<div slPage>` gets `role=\"main\"` unless\n * `landmark=\"none\"` says the document already has one.\n */\n@Component({\n selector: '[slPage]',\n standalone: true,\n exportAs: 'slPage',\n template: `<div data-part=\"scroll\">\n <ng-content select=\"[slPageHeader]\" />\n <ng-content />\n </div>\n <ng-content select=\"[slPageFooter]\" />`,\n styleUrl: '../../../styles/src/page/page.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'page',\n 'data-part': 'root',\n '[attr.role]': 'role()',\n '[attr.data-width]': 'resolvedWidth()',\n '[attr.data-scroll]': 'resolvedScroll()',\n '[attr.data-ground]': 'resolvedGround()',\n '[attr.data-fill]': \"fill() ? '' : null\",\n '[attr.data-loading]': \"loading() ? '' : null\",\n },\n})\nexport class SlPage {\n /** Defaults to the provider, then `wide`. */\n readonly width = input<PageWidth | undefined>(undefined);\n /** Defaults to the provider, then `6`. */\n readonly inset = input<PageInset | undefined>(undefined);\n /** Defaults to the provider, then `ancestor`. */\n readonly scroll = input<PageScroll | undefined>(undefined);\n /** Defaults to the provider, then `sunken`. */\n readonly ground = input<PageGround | undefined>(undefined);\n /** Defaults to the provider, then `main`. */\n readonly landmark = input<PageLandmark | undefined>(undefined);\n /**\n * Fills the height it was given: the body stops growing with its content and\n * the container inside it stretches to what is left. With `scroll=\"self\"`\n * nothing then scrolls outside the body, so the body's principal scroller —\n * not a form control, and at least half the body's height — is what\n * collapses the header: past 16 pixels down it snaps the area shut, and back\n * at its top it opens it again. From 600 pixels of the page's width up;\n * below it the page scrolls as it does without `fill`.\n */\n readonly fill = input(false, { transform: booleanAttribute });\n /** The body carries `aria-busy`; what stands in for the content is each family's own placeholder. */\n readonly loading = input(false, { transform: booleanAttribute });\n /**\n * Words laid over the catalog of the language in force: the footer's\n * accessible name (`footer`). A static `aria-label` on the footer still wins.\n */\n readonly messages = input<PartialMessages<PageMessages> | undefined>(undefined);\n\n private readonly defaults = injectPageDefaults();\n private readonly native: HTMLElement = inject(ElementRef).nativeElement;\n private readonly writtenRole = inject(new HostAttributeToken('role'), { optional: true });\n\n readonly resolvedWidth = computed(() => this.width() ?? this.defaults.width);\n readonly resolvedInset = computed(() => this.inset() ?? this.defaults.inset);\n readonly resolvedScroll = computed(() => this.scroll() ?? this.defaults.scroll);\n readonly resolvedGround = computed(() => this.ground() ?? this.defaults.ground);\n readonly resolvedLandmark = computed(() => this.landmark() ?? this.defaults.landmark);\n /** The family's words in the language in force, with this page's `messages` laid over them. */\n readonly t = injectMessages(pageMessages, this.messages);\n\n /** `role=\"main\"` only where the element is not already `main`, and only when asked. */\n protected readonly role = computed(() => {\n if (this.writtenRole !== null) return this.writtenRole;\n if (this.resolvedLandmark() !== 'main') return null;\n return this.native.tagName === 'MAIN' ? null : 'main';\n });\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n if (typeof ResizeObserver === 'undefined') return;\n const target = findScrollParent(this.native) ?? this.native.ownerDocument.documentElement;\n const bar = () => this.native.querySelector<HTMLElement>(':scope > [data-part=\"footer\"]');\n const publish = () => {\n const height = this.resolvedScroll() === 'self' ? 0 : (bar()?.offsetHeight ?? 0);\n target.style.setProperty(STICKY_BOTTOM_PROPERTY, `${height}px`);\n };\n const observer = new ResizeObserver(publish);\n observer.observe(this.native);\n const footer = bar();\n if (footer !== null) observer.observe(footer);\n publish();\n destroyRef.onDestroy(() => {\n observer.disconnect();\n target.style.removeProperty(STICKY_BOTTOM_PROPERTY);\n });\n });\n }\n}\n\n/**\n * The padded column: one container at the page's width and inset, and one\n * outline step deeper than the header — `slHeadingLevel` is a host directive,\n * so a section written directly in the body takes `h2`.\n */\n@Component({\n selector: '[slPageBody]',\n standalone: true,\n exportAs: 'slPageBody',\n imports: [SlContainer],\n hostDirectives: [SlHeadingLevel],\n template: `<div slContainer [size]=\"page?.resolvedWidth()\" [inset]=\"page?.resolvedInset()\">\n <ng-content />\n </div>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-part': 'body',\n '[attr.aria-busy]': \"page?.loading() ? 'true' : null\",\n },\n})\nexport class SlPageBody {\n protected readonly page = inject(SlPage, { optional: true });\n}\n\n/**\n * The bar for the actions that finish the task. In the flow and never fixed:\n * it takes its own height, so the last line of content scrolls up to it\n * rather than under it. `open` keeps the element through its exit, so the bar\n * slides out rather than vanishing; the status reaches the DOM for the\n * stylesheet to transition on.\n */\n@Component({\n selector: '[slPageFooter]',\n standalone: true,\n exportAs: 'slPageFooter',\n imports: [SlContainer],\n template: `<div slContainer [size]=\"page?.resolvedWidth()\" [inset]=\"page?.resolvedInset()\">\n <div data-part=\"actions\"><ng-content /></div>\n </div>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-part': 'footer',\n '[attr.aria-label]': 'label()',\n '[attr.data-status]': 'status()',\n '[attr.hidden]': \"status() === 'unmounted' ? '' : null\",\n },\n})\nexport class SlPageFooter {\n /** Whether the bar is shown. `false` slides it out and hides it once it has left. */\n readonly open = input(true, { transform: booleanAttribute });\n\n protected readonly page = inject(SlPage, { optional: true });\n private readonly written = inject(new HostAttributeToken('aria-label'), { optional: true });\n private readonly native: HTMLElement = inject(ElementRef).nativeElement;\n protected readonly status = signal<PresenceStatus>('open');\n /** A footer outside a page still speaks the language in force. */\n private readonly own = injectMessages(pageMessages);\n\n protected readonly label = computed(\n () => this.written ?? (this.page === null ? this.own('footer') : this.page.t('footer')),\n );\n\n constructor() {\n const presence = createPresence({\n present: this.open(),\n skipInitialAnimation: true,\n onStatusChange: (next) => this.status.set(next),\n });\n presence.setNode(this.native);\n effect(() => presence.sync(this.open()));\n inject(DestroyRef).onDestroy(() => presence.destroy());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AA6BA,MAAM,QAAQ,GAAiB;AAC7B,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,KAAK,EAAE,MAAM;CACd;MAEY,aAAa,GAAG,IAAI,cAAc,CAAe,uBAAuB,EAAE;AACrF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,QAAQ;AACxB,CAAA;AAED;;;;;AAKG;AACG,SAAU,mBAAmB,CAAC,QAA+B,EAAA;IACjE,OAAO;AACL,QAAA,OAAO,EAAE,aAAa;AACtB,QAAA,UAAU,EAAE,OAAqB,EAAE,GAAG,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC;KAC/D;AACH;AAEA;SACgB,kBAAkB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,aAAa,CAAC;AAC9B;;ACvBA;AACO,MAAM,sBAAsB,GAAG;AAEtC;;;;;;;;;;;;;;;;;AAiBG;MAwBU,MAAM,CAAA;;IAER,KAAK,G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UAAA,EAAA,aAAA,EAAA,sCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAZb,CAAA;;AAEH,QAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAHG,WAAW,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAaV,YAAY,EAAA,UAAA,EAAA,CAAA;kBAjBxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;oBACxB,OAAO,EAAE,CAAC,WAAW,CAAC;AACtB,oBAAA,QAAQ,EAAE,CAAA;;AAEH,QAAA,CAAA;oBACP,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,QAAQ;AACrB,wBAAA,mBAAmB,EAAE,SAAS;AAC9B,wBAAA,oBAAoB,EAAE,UAAU;AAChC,wBAAA,eAAe,EAAE,sCAAsC;AACxD,qBAAA;AACF,iBAAA;;;ACtMD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"slotted-angular-page.mjs","sources":["../../page/src/page-defaults.ts","../../page/src/page.ts","../../page/src/slotted-angular-page.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/** The width of the content column: the container's own sizes. */\nexport type PageWidth = 'measure' | 'content' | 'wide' | 'full' | 'bleed';\n\n/** The inset of the content column from the edge of the page: the container's own steps. */\nexport type PageInset = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\n/**\n * Who scrolls. `ancestor` puts the page inside whatever scrolls and makes it\n * at least as tall as that, so the footer has a bottom to stick to. `self`\n * makes the page's own scroll part the scroller, with the footer below it.\n */\nexport type PageScroll = 'ancestor' | 'self';\n\n/** The ground: the sunken canvas of an application, or the plain surface of a document. */\nexport type PageGround = 'sunken' | 'surface';\n\n/** Whether the root is the document's `main` landmark. */\nexport type PageLandmark = 'main' | 'none';\n\nexport interface PageDefaults {\n ground: PageGround;\n inset: PageInset;\n landmark: PageLandmark;\n scroll: PageScroll;\n width: PageWidth;\n}\n\nconst FALLBACK: PageDefaults = {\n ground: 'sunken',\n inset: 6,\n landmark: 'main',\n scroll: 'ancestor',\n width: 'wide',\n};\n\nexport const PAGE_DEFAULTS = new InjectionToken<PageDefaults>('slotted page defaults', {\n providedIn: 'root',\n factory: () => FALLBACK,\n});\n\n/**\n * An application decides once how its pages are laid out — the measure, the\n * inset, who scrolls, the ground — rather than repeating the same inputs on\n * every route. A page that states any of them itself still wins. Its words\n * come from the language in force (`provideSlotted`).\n */\nexport function providePageDefaults(defaults: Partial<PageDefaults>) {\n return {\n provide: PAGE_DEFAULTS,\n useFactory: (): PageDefaults => ({ ...FALLBACK, ...defaults }),\n };\n}\n\n/** What a page renders as here, before it states anything of its own. */\nexport function injectPageDefaults(): PageDefaults {\n return inject(PAGE_DEFAULTS);\n}\n","import { createPresence } from '@slotted/core/presence';\nimport type { PresenceStatus } from '@slotted/core/presence';\nimport { findScrollParent } from '@slotted/core/sticky-header';\nimport { SlContainer } from '@slotted/angular/container';\nimport { injectMessages } from '@slotted/angular/i18n';\nimport { SlHeadingLevel } from '@slotted/angular/typography';\nimport { pageMessages, type PageMessages, type PartialMessages } from '@slotted/core/i18n';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n HostAttributeToken,\n inject,\n input,\n isDevMode,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { injectPageDefaults } from './page-defaults';\nimport type { PageGround, PageInset, PageLandmark, PageScroll, PageWidth } from './page-defaults';\n\nexport type {\n PageDefaults,\n PageGround,\n PageInset,\n PageLandmark,\n PageScroll,\n PageWidth,\n} from './page-defaults';\n\n/** The custom property the scroller carries for what sticks above the footer. */\nexport const STICKY_BOTTOM_PROPERTY = '--slotted-page-sticky-bottom';\n\n/**\n * The inset lives on the body, so content written straight into the page is\n * drawn against the viewport's edges and nothing else says why. A header is\n * not that content — it carries its own inset — so it is the one child the\n * check passes over.\n */\nfunction warnWithoutBody(root: HTMLElement) {\n const scroll = root.querySelector(':scope > [data-part=\"scroll\"]');\n if (scroll === null) return;\n const content = [...scroll.children].filter(\n (child) => child.getAttribute('data-ui') !== 'page-header',\n );\n if (content.length === 0) return;\n if (content.some((child) => child.getAttribute('data-part') === 'body')) return;\n console.warn(\n 'slPage has content outside slPageBody. Content outside the body receives no inset: wrap it in an element carrying slPageBody.',\n );\n}\n\n/**\n * The column of a screen: who scrolls, how wide the content is, where the\n * footer stays, how much air the body has.\n *\n * **The header is a direct child of what scrolls.** There is no header part: a\n * `sticky` element never leaves the box that contains it, so a wrapper exactly\n * the header's height would pin nothing. The element carrying `slPageHeader`\n * is projected first into the scroll part, beside the body.\n *\n * **The footer is projected outside the scroll part** — below the scroller\n * under `self`, stuck to the bottom of the root under `ancestor` — which is\n * what content projection is for. It keeps its box through its exit on\n * `open`, so the bar slides out rather than vanishing.\n *\n * **The element is the consumer's.** `<main slPage>` is the main landmark and\n * the directive adds nothing; `<div slPage>` gets `role=\"main\"` unless\n * `landmark=\"none\"` says the document already has one.\n */\n@Component({\n selector: '[slPage]',\n standalone: true,\n exportAs: 'slPage',\n template: `<div data-part=\"scroll\">\n <ng-content select=\"[slPageHeader]\" />\n <ng-content />\n </div>\n <ng-content select=\"[slPageFooter]\" />`,\n styleUrl: '../../../styles/src/page/page.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'page',\n 'data-part': 'root',\n '[attr.role]': 'role()',\n '[attr.data-width]': 'resolvedWidth()',\n '[attr.data-scroll]': 'resolvedScroll()',\n '[attr.data-ground]': 'resolvedGround()',\n '[attr.data-fill]': \"fill() ? '' : null\",\n '[attr.data-loading]': \"loading() ? '' : null\",\n },\n})\nexport class SlPage {\n /** Defaults to the provider, then `wide`. */\n readonly width = input<PageWidth | undefined>(undefined);\n /** Defaults to the provider, then `6`. */\n readonly inset = input<PageInset | undefined>(undefined);\n /** Defaults to the provider, then `ancestor`. */\n readonly scroll = input<PageScroll | undefined>(undefined);\n /** Defaults to the provider, then `sunken`. */\n readonly ground = input<PageGround | undefined>(undefined);\n /** Defaults to the provider, then `main`. */\n readonly landmark = input<PageLandmark | undefined>(undefined);\n /**\n * Fills the height it was given: the body stops growing with its content and\n * the container inside it stretches to what is left. With `scroll=\"self\"`\n * nothing then scrolls outside the body, so the body's principal scroller —\n * not a form control, and at least half the body's height — is what\n * collapses the header: past 16 pixels down it snaps the area shut, and back\n * at its top it opens it again. From 600 pixels of the page's width up;\n * below it the page scrolls as it does without `fill`.\n */\n readonly fill = input(false, { transform: booleanAttribute });\n /** The body carries `aria-busy`; what stands in for the content is each family's own placeholder. */\n readonly loading = input(false, { transform: booleanAttribute });\n /**\n * Words laid over the catalog of the language in force: the footer's\n * accessible name (`footer`). A static `aria-label` on the footer still wins.\n */\n readonly messages = input<PartialMessages<PageMessages> | undefined>(undefined);\n\n private readonly defaults = injectPageDefaults();\n private readonly native: HTMLElement = inject(ElementRef).nativeElement;\n private readonly writtenRole = inject(new HostAttributeToken('role'), { optional: true });\n\n readonly resolvedWidth = computed(() => this.width() ?? this.defaults.width);\n readonly resolvedInset = computed(() => this.inset() ?? this.defaults.inset);\n readonly resolvedScroll = computed(() => this.scroll() ?? this.defaults.scroll);\n readonly resolvedGround = computed(() => this.ground() ?? this.defaults.ground);\n readonly resolvedLandmark = computed(() => this.landmark() ?? this.defaults.landmark);\n /** The family's words in the language in force, with this page's `messages` laid over them. */\n readonly t = injectMessages(pageMessages, this.messages);\n\n /** `role=\"main\"` only where the element is not already `main`, and only when asked. */\n protected readonly role = computed(() => {\n if (this.writtenRole !== null) return this.writtenRole;\n if (this.resolvedLandmark() !== 'main') return null;\n return this.native.tagName === 'MAIN' ? null : 'main';\n });\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n if (isDevMode()) warnWithoutBody(this.native);\n if (typeof ResizeObserver === 'undefined') return;\n const target = findScrollParent(this.native) ?? this.native.ownerDocument.documentElement;\n const bar = () => this.native.querySelector<HTMLElement>(':scope > [data-part=\"footer\"]');\n const publish = () => {\n const height = this.resolvedScroll() === 'self' ? 0 : (bar()?.offsetHeight ?? 0);\n target.style.setProperty(STICKY_BOTTOM_PROPERTY, `${height}px`);\n };\n const observer = new ResizeObserver(publish);\n observer.observe(this.native);\n const footer = bar();\n if (footer !== null) observer.observe(footer);\n publish();\n destroyRef.onDestroy(() => {\n observer.disconnect();\n target.style.removeProperty(STICKY_BOTTOM_PROPERTY);\n });\n });\n }\n}\n\n/**\n * The padded column: one container at the page's width and inset, and one\n * outline step deeper than the header — `slHeadingLevel` is a host directive,\n * so a section written directly in the body takes `h2`.\n */\n@Component({\n selector: '[slPageBody]',\n standalone: true,\n exportAs: 'slPageBody',\n imports: [SlContainer],\n hostDirectives: [SlHeadingLevel],\n template: `<div slContainer [size]=\"page?.resolvedWidth()\" [inset]=\"page?.resolvedInset()\">\n <ng-content />\n </div>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-part': 'body',\n '[attr.aria-busy]': \"page?.loading() ? 'true' : null\",\n },\n})\nexport class SlPageBody {\n protected readonly page = inject(SlPage, { optional: true });\n}\n\n/**\n * The bar for the actions that finish the task. In the flow and never fixed:\n * it takes its own height, so the last line of content scrolls up to it\n * rather than under it. `open` keeps the element through its exit, so the bar\n * slides out rather than vanishing; the status reaches the DOM for the\n * stylesheet to transition on.\n */\n@Component({\n selector: '[slPageFooter]',\n standalone: true,\n exportAs: 'slPageFooter',\n imports: [SlContainer],\n template: `<div slContainer [size]=\"page?.resolvedWidth()\" [inset]=\"page?.resolvedInset()\">\n <div data-part=\"actions\"><ng-content /></div>\n </div>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-part': 'footer',\n '[attr.aria-label]': 'label()',\n '[attr.data-status]': 'status()',\n '[attr.hidden]': \"status() === 'unmounted' ? '' : null\",\n },\n})\nexport class SlPageFooter {\n /** Whether the bar is shown. `false` slides it out and hides it once it has left. */\n readonly open = input(true, { transform: booleanAttribute });\n\n protected readonly page = inject(SlPage, { optional: true });\n private readonly written = inject(new HostAttributeToken('aria-label'), { optional: true });\n private readonly native: HTMLElement = inject(ElementRef).nativeElement;\n protected readonly status = signal<PresenceStatus>('open');\n /** A footer outside a page still speaks the language in force. */\n private readonly own = injectMessages(pageMessages);\n\n protected readonly label = computed(\n () => this.written ?? (this.page === null ? this.own('footer') : this.page.t('footer')),\n );\n\n constructor() {\n const presence = createPresence({\n present: this.open(),\n skipInitialAnimation: true,\n onStatusChange: (next) => this.status.set(next),\n });\n presence.setNode(this.native);\n effect(() => presence.sync(this.open()));\n inject(DestroyRef).onDestroy(() => presence.destroy());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AA6BA,MAAM,QAAQ,GAAiB;AAC7B,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,QAAQ,EAAE,MAAM;AAChB,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,KAAK,EAAE,MAAM;CACd;MAEY,aAAa,GAAG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