@slotted/angular 0.1.0-beta.3 → 0.1.0-beta.5
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/AGENTS.snippet.md +2 -0
- package/docs/app-shell.examples.md +1 -1
- package/docs/app-shell.json +4 -4
- package/docs/app-shell.md +2 -2
- 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/README.md +2 -2
- package/docs/guidelines/composition.md +10 -0
- package/docs/guidelines/index.md +3 -1
- package/docs/guidelines/list-pages.md +12 -1
- package/docs/guidelines/own-elements.md +1 -1
- package/docs/page-header.json +1 -0
- package/docs/page-header.md +1 -1
- package/docs/page.json +1 -0
- package/docs/page.md +1 -0
- package/docs/skills/build-own-element/SKILL.md +6 -6
- package/docs/skills/compose-screen/SKILL.md +13 -6
- package/docs/skills/review-screen/SKILL.md +6 -6
- package/docs/skills/theme-app/SKILL.md +1 -1
- package/docs/skills/waiting-states/SKILL.md +2 -2
- package/docs/table.json +13 -0
- package/docs/table.md +3 -1
- package/docs/tabs.json +13 -3
- package/docs/tabs.md +3 -2
- package/docs/text-field.json +1 -1
- package/docs/text-field.md +1 -1
- package/fesm2022/slotted-angular-app-shell.mjs +15 -9
- package/fesm2022/slotted-angular-app-shell.mjs.map +1 -1
- package/fesm2022/slotted-angular-calendar.mjs +158 -33
- package/fesm2022/slotted-angular-calendar.mjs.map +1 -1
- package/fesm2022/slotted-angular-cascader.mjs +7 -1
- package/fesm2022/slotted-angular-cascader.mjs.map +1 -1
- package/fesm2022/slotted-angular-chart.mjs +13 -3
- package/fesm2022/slotted-angular-chart.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 +95 -33
- package/fesm2022/slotted-angular-date-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-date-range-picker.mjs +5 -7
- package/fesm2022/slotted-angular-date-range-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-datetime-picker.mjs +5 -7
- package/fesm2022/slotted-angular-datetime-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-datetime-range-picker.mjs +5 -7
- package/fesm2022/slotted-angular-datetime-range-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-entity-picker.mjs +7 -1
- package/fesm2022/slotted-angular-entity-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-header.mjs +2 -2
- package/fesm2022/slotted-angular-page-header.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-popover.mjs +7 -1
- package/fesm2022/slotted-angular-popover.mjs.map +1 -1
- package/fesm2022/slotted-angular-scroll-area.mjs +6 -2
- package/fesm2022/slotted-angular-scroll-area.mjs.map +1 -1
- package/fesm2022/slotted-angular-select.mjs +49 -17
- package/fesm2022/slotted-angular-select.mjs.map +1 -1
- package/fesm2022/slotted-angular-stat-card.mjs +2 -2
- package/fesm2022/slotted-angular-stat-card.mjs.map +1 -1
- package/fesm2022/slotted-angular-table.mjs +24 -6
- package/fesm2022/slotted-angular-table.mjs.map +1 -1
- package/fesm2022/slotted-angular-tabs.mjs +13 -6
- package/fesm2022/slotted-angular-tabs.mjs.map +1 -1
- package/fesm2022/slotted-angular-time-picker.mjs +4 -6
- package/fesm2022/slotted-angular-time-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-time-range-picker.mjs +4 -6
- package/fesm2022/slotted-angular-time-range-picker.mjs.map +1 -1
- package/fesm2022/slotted-angular-tooltip.mjs +7 -1
- package/fesm2022/slotted-angular-tooltip.mjs.map +1 -1
- package/package.json +3 -3
- package/types/slotted-angular-app-shell.d.ts +5 -3
- package/types/slotted-angular-app-shell.d.ts.map +1 -1
- package/types/slotted-angular-calendar.d.ts +28 -2
- package/types/slotted-angular-calendar.d.ts.map +1 -1
- package/types/slotted-angular-cascader.d.ts.map +1 -1
- package/types/slotted-angular-chart.d.ts +1 -0
- package/types/slotted-angular-chart.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 -12
- package/types/slotted-angular-date-picker.d.ts.map +1 -1
- package/types/slotted-angular-date-range-picker.d.ts +0 -1
- package/types/slotted-angular-date-range-picker.d.ts.map +1 -1
- package/types/slotted-angular-datetime-picker.d.ts +0 -1
- package/types/slotted-angular-datetime-picker.d.ts.map +1 -1
- package/types/slotted-angular-datetime-range-picker.d.ts +0 -1
- package/types/slotted-angular-datetime-range-picker.d.ts.map +1 -1
- package/types/slotted-angular-entity-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-popover.d.ts.map +1 -1
- package/types/slotted-angular-scroll-area.d.ts.map +1 -1
- package/types/slotted-angular-select.d.ts +12 -2
- package/types/slotted-angular-select.d.ts.map +1 -1
- package/types/slotted-angular-table.d.ts +17 -2
- package/types/slotted-angular-table.d.ts.map +1 -1
- package/types/slotted-angular-tabs.d.ts +3 -4
- package/types/slotted-angular-tabs.d.ts.map +1 -1
- package/types/slotted-angular-time-picker.d.ts +0 -1
- package/types/slotted-angular-time-picker.d.ts.map +1 -1
- package/types/slotted-angular-time-range-picker.d.ts +0 -1
- package/types/slotted-angular-time-range-picker.d.ts.map +1 -1
- package/types/slotted-angular-tooltip.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slotted-angular-scroll-area.mjs","sources":["../../scroll-area/src/scroll-area-defaults.ts","../../scroll-area/src/scroll-area.ts","../../scroll-area/src/slotted-angular-scroll-area.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/** Which axes scroll. Logical, so a vertical writing mode needs no second vocabulary. */\nexport type ScrollAreaAxis = 'block' | 'inline' | 'both';\n\n/**\n * What the scrollbar does. `auto` is `overflow: auto`; `always` is\n * `overflow: scroll`; `hover` paints the bar transparent until a pointer or the\n * keyboard is inside; `none` removes the bar and leaves the scrolling.\n *\n * `scroll` — visible only while scrolling, which Radix and Mantine both ship —\n * is folded into `hover`, because it is what a platform overlay scrollbar\n * already does on its own.\n */\nexport type ScrollAreaScrollbars = 'auto' | 'always' | 'hover' | 'none';\n\n/** `scrollbar-gutter`, and `stable` is the default because content that shifts is the defect. */\nexport type ScrollAreaGutter = 'auto' | 'stable' | 'both-edges';\n\n/**\n * Where the veil is drawn. `both` dims what the reader has passed as well as\n * what is ahead; `end` only what is ahead; `none` leaves the scrollbar to say\n * there is more.\n */\nexport type ScrollAreaFade = 'both' | 'end' | 'none';\n\n/** `overscroll-behavior`, and `contain` is the default. */\nexport type ScrollAreaOverscroll = 'contain' | 'auto' | 'none';\n\nexport interface ScrollAreaDefaults {\n axis: ScrollAreaAxis;\n scrollbars: ScrollAreaScrollbars;\n gutter: ScrollAreaGutter;\n fade: ScrollAreaFade;\n overscroll: ScrollAreaOverscroll;\n}\n\nconst FALLBACK: ScrollAreaDefaults = {\n axis: 'block',\n fade: 'both',\n gutter: 'stable',\n overscroll: 'contain',\n scrollbars: 'auto',\n};\n\nexport const SCROLL_AREA_DEFAULTS = new InjectionToken<ScrollAreaDefaults>(\n 'slotted scroll-area defaults',\n { providedIn: 'root', factory: () => FALLBACK },\n);\n\n/**\n * An application decides once what its scroll areas look like — whether the\n * bar waits for a hand, whether the veil dims both ends — rather than repeating\n * it on fifty of them. A region's name comes from the language in force\n * (`provideSlotted`).\n *\n * None of the five surveyed implementations has an equivalent: each takes its\n * policy per instance, and Mantine's `type` in particular is written on every\n * call site of every product that uses it.\n */\nexport function provideScrollAreaDefaults(defaults: Partial<ScrollAreaDefaults>) {\n return {\n provide: SCROLL_AREA_DEFAULTS,\n useFactory: (): ScrollAreaDefaults => ({ ...FALLBACK, ...defaults }),\n };\n}\n\n/** What a scroll area is here, before it states anything of its own. */\nexport function injectScrollAreaDefaults(): ScrollAreaDefaults {\n return inject(SCROLL_AREA_DEFAULTS);\n}\n","import {\n createScrollEdges,\n NO_SCROLL_EDGES,\n scrollEdgeAttributes,\n type LogicalEdge,\n type ScrollEdgesHandle,\n type ScrollEdgesState,\n type ScrollPosition,\n} from '@slotted/core/overflow';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectMessages } from '@slotted/angular/i18n';\nimport {\n scrollAreaMessages,\n type PartialMessages,\n type ScrollAreaMessages,\n} from '@slotted/core/i18n';\n\nimport { injectScrollAreaDefaults } from './scroll-area-defaults';\nimport type {\n ScrollAreaAxis,\n ScrollAreaFade,\n ScrollAreaGutter,\n ScrollAreaOverscroll,\n ScrollAreaScrollbars,\n} from './scroll-area-defaults';\n\n/** What `scrollChange` carries: where the scroller is, and the event that moved it. */\nexport interface ScrollAreaScrollEvent {\n readonly position: ScrollPosition;\n readonly source: Event;\n}\n\n/**\n * A scrollport, and the box that frames it.\n *\n * The scrollbar is the platform's, themed by the stylesheet through\n * `scrollbar-color`; the keyboard is the platform's too. What this component\n * adds is the measurement of whether the content overflows and which of its\n * ends show, published on the frame for CSS and emitted to the consumer, and\n * the tab stop a scrolling region owes a keyboard together with the name that\n * tab stop owes a screen reader — both written only while the content actually\n * overflows, which is the pattern `prose` shipped first for one block inside a\n * document.\n *\n * The frame is the consumer's own element — `<div slScrollArea>` — and the\n * scrollport is the component's, projected into: the frame is where a border,\n * a radius and a ground go, and the scrollport is the element the veil is on.\n * A consumer's own attributes on the host are never written over, because the\n * family writes its role, its tab stop and its name on an element it owns.\n *\n * The scroll position is never held. The browser moves it on a wheel, a\n * fling, a `Tab` into a child, an anchor navigation and a printed page, and a\n * consumer holding the value would have to accept every one of those or fight\n * the platform. It is emitted, and the instance moves it.\n */\n@Component({\n selector: '[slScrollArea]',\n standalone: true,\n exportAs: 'slScrollArea',\n template: `\n <div\n #viewport\n data-part=\"viewport\"\n [attr.role]=\"wired() ? 'region' : null\"\n [attr.tabindex]=\"wired() ? '0' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n (scroll)=\"onScroll($event)\"\n >\n <ng-content />\n </div>\n `,\n styleUrl: '../../../styles/src/scroll-area/scroll-area.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'scroll-area',\n 'data-part': 'root',\n '[attr.data-axis]': 'resolvedAxis()',\n '[attr.data-scrollbars]': 'resolvedScrollbars()',\n '[attr.data-gutter]': 'resolvedGutter()',\n '[attr.data-fade]': 'resolvedFade()',\n '[attr.data-overscroll]': 'resolvedOverscroll()',\n '[attr.data-overflowing]': \"edgeAttributes()['data-overflowing'] ?? null\",\n '[attr.data-at-block-start]': \"edgeAttributes()['data-at-block-start'] ?? null\",\n '[attr.data-at-block-end]': \"edgeAttributes()['data-at-block-end'] ?? null\",\n '[attr.data-at-inline-start]': \"edgeAttributes()['data-at-inline-start'] ?? null\",\n '[attr.data-at-inline-end]': \"edgeAttributes()['data-at-inline-end'] ?? null\",\n '[attr.data-sideways]': \"sideways() ? '' : null\",\n '[style.max-block-size]': 'maxBlockSize() ?? null',\n '[style.max-inline-size]': 'maxInlineSize() ?? null',\n },\n})\nexport class SlScrollArea {\n readonly axis = input<ScrollAreaAxis | undefined>(undefined);\n readonly scrollbars = input<ScrollAreaScrollbars | undefined>(undefined);\n readonly gutter = input<ScrollAreaGutter | undefined>(undefined);\n readonly fade = input<ScrollAreaFade | undefined>(undefined);\n readonly overscroll = input<ScrollAreaOverscroll | undefined>(undefined);\n\n /**\n * Scroll only past this size, as any CSS length. It is Mantine's\n * `ScrollArea.Autosize` as one binding rather than a second component.\n */\n readonly maxBlockSize = input<string | undefined>(undefined);\n readonly maxInlineSize = input<string | undefined>(undefined);\n\n /**\n * Whether the scrollport joins the tab sequence while it overflows.\n *\n * On by default, because content that scrolls has to be scrollable by\n * keyboard and a scrollport with no tab stop is not — unless a child of it\n * already takes focus. A consumer who knows the content is reachable another\n * way turns it off and carries the reason.\n */\n readonly tabbable = input(true, { transform: booleanAttribute });\n\n /**\n * The name the region is announced by. Resolved in one order: `labelledBy`,\n * then `messages.label`, then the catalog of the language in force.\n */\n readonly labelledBy = input<string | undefined>(undefined);\n /** Words laid over the catalog of the language in force: the region's name (`label`). */\n readonly messages = input<PartialMessages<ScrollAreaMessages> | undefined>(undefined);\n\n /**\n * The position, as a distance from each logical start, on every scroll. It\n * is a report and not a request: the browser moves the position on a wheel,\n * a fling, a `Tab` into a child and a printed page, and a consumer holding it\n * would have to accept every one of those.\n */\n readonly scrollChange = output<ScrollAreaScrollEvent>();\n\n /** The measurement, and only a new one: which axes overflow, and which ends show. */\n readonly overflowChange = output<ScrollEdgesState>();\n\n private readonly defaults = injectScrollAreaDefaults();\n /** The family's words in the language in force, with this area's `messages` laid over them. */\n readonly t = injectMessages(scrollAreaMessages, this.messages);\n private readonly element = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewportRef = viewChild.required<ElementRef<HTMLElement>>('viewport');\n\n /**\n * The measurement, as a signal, so the attributes it becomes are rendered.\n * Before the first render it is the state of content that fits — four ends\n * showing and nothing overflowing — which paints no veil and writes no tab\n * stop, so a server render and its hydration agree and the veil does not\n * flash on before the browser has said whether there is anything behind it.\n */\n private readonly measured = signal<ScrollEdgesState>(NO_SCROLL_EDGES);\n protected readonly sideways = signal(false);\n private edges: ScrollEdgesHandle | null = null;\n\n protected readonly resolvedAxis = computed(() => this.axis() ?? this.defaults.axis);\n protected readonly resolvedScrollbars = computed(\n () => this.scrollbars() ?? this.defaults.scrollbars,\n );\n protected readonly resolvedGutter = computed(() => this.gutter() ?? this.defaults.gutter);\n protected readonly resolvedFade = computed(() => this.fade() ?? this.defaults.fade);\n protected readonly resolvedOverscroll = computed(\n () => this.overscroll() ?? this.defaults.overscroll,\n );\n\n protected readonly edgeAttributes = computed(() => scrollEdgeAttributes(this.measured()));\n\n protected readonly overflowing = computed(() => {\n const state = this.measured();\n return state.block.overflowing || state.inline.overflowing;\n });\n protected readonly wired = computed(() => this.overflowing() && this.tabbable());\n protected readonly ariaLabelledBy = computed(() =>\n this.wired() ? (this.labelledBy() ?? null) : null,\n );\n protected readonly ariaLabel = computed(() => {\n if (!this.wired() || this.labelledBy() !== undefined) return null;\n return this.t('label');\n });\n\n constructor() {\n /**\n * After the first render and only in a browser: Angular builds the\n * component during a server render too, and there is nothing to measure\n * there. The wiring appears at the first moment a browser can say whether\n * the content overflows at all.\n */\n afterNextRender(() => {\n const viewport = this.viewportRef().nativeElement;\n const handle = createScrollEdges(viewport, {\n onChange: (next) => {\n this.measured.set(next);\n if (this.edges !== null) this.sideways.set(this.edges.sideways());\n this.overflowChange.emit(next);\n },\n });\n this.edges = handle;\n this.measured.set(handle.state());\n this.sideways.set(handle.sideways());\n });\n\n this.destroyRef.onDestroy(() => {\n this.edges?.destroy();\n this.edges = null;\n });\n }\n\n /** The frame: the consumer's own element. */\n get root(): HTMLElement {\n return this.element;\n }\n\n /** The scrollport: the element that scrolls and takes focus. */\n get viewport(): HTMLElement {\n return this.viewportRef().nativeElement;\n }\n\n /** The last measurement: whether each axis overflows, and which of its ends show. */\n state(): ScrollEdgesState {\n return this.edges?.state() ?? NO_SCROLL_EDGES;\n }\n\n /** The distance from each logical start, read now. */\n position(): ScrollPosition {\n return this.edges?.position() ?? { block: 0, inline: 0 };\n }\n\n /** Moves to a logical position. An axis left out is an axis left alone. */\n scrollTo(target: Partial<ScrollPosition>): void {\n this.edges?.scrollTo(target);\n }\n\n /** Moves to one end of one axis. */\n scrollToEdge(edge: LogicalEdge): void {\n this.edges?.scrollToEdge(edge);\n }\n\n /** Brings one element into view by the shortest movement that does it, without moving anything else. */\n reveal(element: Element): void {\n this.edges?.reveal(element);\n }\n\n /** Measures again, after content the observer could not see changed. */\n refresh(): void {\n this.edges?.refresh();\n }\n\n /** Moves focus to the scrollport. */\n focus(): void {\n this.viewport.focus();\n }\n\n protected onScroll(event: Event) {\n if (this.edges === null) return;\n this.scrollChange.emit({ position: this.edges.position(), source: event });\n }\n}\n\n/**\n * The inset that scrolls with the content.\n *\n * Padding on a scrollport is not applied at the end edge of its scrollable\n * overflow in every engine, so an inset that has to survive a scroll to the\n * end goes on an element inside it. The family states no inset of its own: the\n * directive exists to give the consumer's one a place to live, on the\n * consumer's own element, and an area whose content already carries its own\n * inset uses no `slScrollAreaContent` at all.\n */\n@Directive({\n selector: '[slScrollAreaContent]',\n standalone: true,\n exportAs: 'slScrollAreaContent',\n host: { 'data-part': 'content' },\n})\nexport class SlScrollAreaContent {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAqCA,MAAM,QAAQ,GAAuB;AACnC,IAAA,IAAI,EAAE,OAAO;A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,CAAA,EAAA,EAAA,CAAA;AAoHvF;;;;;;;;;AASG;MAOU,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,SAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,IAAI,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE;AACjC,iBAAA;;;AC/RD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"slotted-angular-scroll-area.mjs","sources":["../../scroll-area/src/scroll-area-defaults.ts","../../scroll-area/src/scroll-area.ts","../../scroll-area/src/slotted-angular-scroll-area.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\n/** Which axes scroll. Logical, so a vertical writing mode needs no second vocabulary. */\nexport type ScrollAreaAxis = 'block' | 'inline' | 'both';\n\n/**\n * What the scrollbar does. `auto` is `overflow: auto`; `always` is\n * `overflow: scroll`; `hover` paints the bar transparent until a pointer or the\n * keyboard is inside; `none` removes the bar and leaves the scrolling.\n *\n * `scroll` — visible only while scrolling, which Radix and Mantine both ship —\n * is folded into `hover`, because it is what a platform overlay scrollbar\n * already does on its own.\n */\nexport type ScrollAreaScrollbars = 'auto' | 'always' | 'hover' | 'none';\n\n/** `scrollbar-gutter`, and `stable` is the default because content that shifts is the defect. */\nexport type ScrollAreaGutter = 'auto' | 'stable' | 'both-edges';\n\n/**\n * Where the veil is drawn. `both` dims what the reader has passed as well as\n * what is ahead; `end` only what is ahead; `none` leaves the scrollbar to say\n * there is more.\n */\nexport type ScrollAreaFade = 'both' | 'end' | 'none';\n\n/** `overscroll-behavior`, and `contain` is the default. */\nexport type ScrollAreaOverscroll = 'contain' | 'auto' | 'none';\n\nexport interface ScrollAreaDefaults {\n axis: ScrollAreaAxis;\n scrollbars: ScrollAreaScrollbars;\n gutter: ScrollAreaGutter;\n fade: ScrollAreaFade;\n overscroll: ScrollAreaOverscroll;\n}\n\nconst FALLBACK: ScrollAreaDefaults = {\n axis: 'block',\n fade: 'both',\n gutter: 'stable',\n overscroll: 'contain',\n scrollbars: 'auto',\n};\n\nexport const SCROLL_AREA_DEFAULTS = new InjectionToken<ScrollAreaDefaults>(\n 'slotted scroll-area defaults',\n { providedIn: 'root', factory: () => FALLBACK },\n);\n\n/**\n * An application decides once what its scroll areas look like — whether the\n * bar waits for a hand, whether the veil dims both ends — rather than repeating\n * it on fifty of them. A region's name comes from the language in force\n * (`provideSlotted`).\n *\n * None of the five surveyed implementations has an equivalent: each takes its\n * policy per instance, and Mantine's `type` in particular is written on every\n * call site of every product that uses it.\n */\nexport function provideScrollAreaDefaults(defaults: Partial<ScrollAreaDefaults>) {\n return {\n provide: SCROLL_AREA_DEFAULTS,\n useFactory: (): ScrollAreaDefaults => ({ ...FALLBACK, ...defaults }),\n };\n}\n\n/** What a scroll area is here, before it states anything of its own. */\nexport function injectScrollAreaDefaults(): ScrollAreaDefaults {\n return inject(SCROLL_AREA_DEFAULTS);\n}\n","import { createFocusOrigin } from '@slotted/core/focus';\nimport {\n createScrollEdges,\n NO_SCROLL_EDGES,\n scrollEdgeAttributes,\n type LogicalEdge,\n type ScrollEdgesHandle,\n type ScrollEdgesState,\n type ScrollPosition,\n} from '@slotted/core/overflow';\nimport {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectMessages } from '@slotted/angular/i18n';\nimport {\n scrollAreaMessages,\n type PartialMessages,\n type ScrollAreaMessages,\n} from '@slotted/core/i18n';\n\nimport { injectScrollAreaDefaults } from './scroll-area-defaults';\nimport type {\n ScrollAreaAxis,\n ScrollAreaFade,\n ScrollAreaGutter,\n ScrollAreaOverscroll,\n ScrollAreaScrollbars,\n} from './scroll-area-defaults';\n\n/** What `scrollChange` carries: where the scroller is, and the event that moved it. */\nexport interface ScrollAreaScrollEvent {\n readonly position: ScrollPosition;\n readonly source: Event;\n}\n\n/**\n * A scrollport, and the box that frames it.\n *\n * The scrollbar is the platform's, themed by the stylesheet through\n * `scrollbar-color`; the keyboard is the platform's too. What this component\n * adds is the measurement of whether the content overflows and which of its\n * ends show, published on the frame for CSS and emitted to the consumer, and\n * the tab stop a scrolling region owes a keyboard together with the name that\n * tab stop owes a screen reader — both written only while the content actually\n * overflows, which is the pattern `prose` shipped first for one block inside a\n * document.\n *\n * The frame is the consumer's own element — `<div slScrollArea>` — and the\n * scrollport is the component's, projected into: the frame is where a border,\n * a radius and a ground go, and the scrollport is the element the veil is on.\n * A consumer's own attributes on the host are never written over, because the\n * family writes its role, its tab stop and its name on an element it owns.\n *\n * The scroll position is never held. The browser moves it on a wheel, a\n * fling, a `Tab` into a child, an anchor navigation and a printed page, and a\n * consumer holding the value would have to accept every one of those or fight\n * the platform. It is emitted, and the instance moves it.\n */\n@Component({\n selector: '[slScrollArea]',\n standalone: true,\n exportAs: 'slScrollArea',\n template: `\n <div\n #viewport\n data-part=\"viewport\"\n [attr.role]=\"wired() ? 'region' : null\"\n [attr.tabindex]=\"wired() ? '0' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n (scroll)=\"onScroll($event)\"\n >\n <ng-content />\n </div>\n `,\n styleUrl: '../../../styles/src/scroll-area/scroll-area.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'data-ui': 'scroll-area',\n 'data-part': 'root',\n '[attr.data-axis]': 'resolvedAxis()',\n '[attr.data-scrollbars]': 'resolvedScrollbars()',\n '[attr.data-gutter]': 'resolvedGutter()',\n '[attr.data-fade]': 'resolvedFade()',\n '[attr.data-overscroll]': 'resolvedOverscroll()',\n '[attr.data-overflowing]': \"edgeAttributes()['data-overflowing'] ?? null\",\n '[attr.data-at-block-start]': \"edgeAttributes()['data-at-block-start'] ?? null\",\n '[attr.data-at-block-end]': \"edgeAttributes()['data-at-block-end'] ?? null\",\n '[attr.data-at-inline-start]': \"edgeAttributes()['data-at-inline-start'] ?? null\",\n '[attr.data-at-inline-end]': \"edgeAttributes()['data-at-inline-end'] ?? null\",\n '[attr.data-sideways]': \"sideways() ? '' : null\",\n '[style.max-block-size]': 'maxBlockSize() ?? null',\n '[style.max-inline-size]': 'maxInlineSize() ?? null',\n },\n})\nexport class SlScrollArea {\n readonly axis = input<ScrollAreaAxis | undefined>(undefined);\n readonly scrollbars = input<ScrollAreaScrollbars | undefined>(undefined);\n readonly gutter = input<ScrollAreaGutter | undefined>(undefined);\n readonly fade = input<ScrollAreaFade | undefined>(undefined);\n readonly overscroll = input<ScrollAreaOverscroll | undefined>(undefined);\n\n /**\n * Scroll only past this size, as any CSS length. It is Mantine's\n * `ScrollArea.Autosize` as one binding rather than a second component.\n */\n readonly maxBlockSize = input<string | undefined>(undefined);\n readonly maxInlineSize = input<string | undefined>(undefined);\n\n /**\n * Whether the scrollport joins the tab sequence while it overflows.\n *\n * On by default, because content that scrolls has to be scrollable by\n * keyboard and a scrollport with no tab stop is not — unless a child of it\n * already takes focus. A consumer who knows the content is reachable another\n * way turns it off and carries the reason.\n */\n readonly tabbable = input(true, { transform: booleanAttribute });\n\n /**\n * The name the region is announced by. Resolved in one order: `labelledBy`,\n * then `messages.label`, then the catalog of the language in force.\n */\n readonly labelledBy = input<string | undefined>(undefined);\n /** Words laid over the catalog of the language in force: the region's name (`label`). */\n readonly messages = input<PartialMessages<ScrollAreaMessages> | undefined>(undefined);\n\n /**\n * The position, as a distance from each logical start, on every scroll. It\n * is a report and not a request: the browser moves the position on a wheel,\n * a fling, a `Tab` into a child and a printed page, and a consumer holding it\n * would have to accept every one of those.\n */\n readonly scrollChange = output<ScrollAreaScrollEvent>();\n\n /** The measurement, and only a new one: which axes overflow, and which ends show. */\n readonly overflowChange = output<ScrollEdgesState>();\n\n private readonly defaults = injectScrollAreaDefaults();\n /** The family's words in the language in force, with this area's `messages` laid over them. */\n readonly t = injectMessages(scrollAreaMessages, this.messages);\n private readonly element = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n private readonly destroyRef = inject(DestroyRef);\n private readonly viewportRef = viewChild.required<ElementRef<HTMLElement>>('viewport');\n\n /**\n * The measurement, as a signal, so the attributes it becomes are rendered.\n * Before the first render it is the state of content that fits — four ends\n * showing and nothing overflowing — which paints no veil and writes no tab\n * stop, so a server render and its hydration agree and the veil does not\n * flash on before the browser has said whether there is anything behind it.\n */\n private readonly measured = signal<ScrollEdgesState>(NO_SCROLL_EDGES);\n protected readonly sideways = signal(false);\n private edges: ScrollEdgesHandle | null = null;\n\n protected readonly resolvedAxis = computed(() => this.axis() ?? this.defaults.axis);\n protected readonly resolvedScrollbars = computed(\n () => this.scrollbars() ?? this.defaults.scrollbars,\n );\n protected readonly resolvedGutter = computed(() => this.gutter() ?? this.defaults.gutter);\n protected readonly resolvedFade = computed(() => this.fade() ?? this.defaults.fade);\n protected readonly resolvedOverscroll = computed(\n () => this.overscroll() ?? this.defaults.overscroll,\n );\n\n protected readonly edgeAttributes = computed(() => scrollEdgeAttributes(this.measured()));\n\n protected readonly overflowing = computed(() => {\n const state = this.measured();\n return state.block.overflowing || state.inline.overflowing;\n });\n protected readonly wired = computed(() => this.overflowing() && this.tabbable());\n protected readonly ariaLabelledBy = computed(() =>\n this.wired() ? (this.labelledBy() ?? null) : null,\n );\n protected readonly ariaLabel = computed(() => {\n if (!this.wired() || this.labelledBy() !== undefined) return null;\n return this.t('label');\n });\n\n constructor() {\n /**\n * After the first render and only in a browser: Angular builds the\n * component during a server render too, and there is nothing to measure\n * there. The wiring appears at the first moment a browser can say whether\n * the content overflows at all.\n */\n afterNextRender(() => {\n const viewport = this.viewportRef().nativeElement;\n const handle = createScrollEdges(viewport, {\n onChange: (next) => {\n this.measured.set(next);\n if (this.edges !== null) this.sideways.set(this.edges.sideways());\n this.overflowChange.emit(next);\n },\n });\n this.edges = handle;\n this.measured.set(handle.state());\n this.sideways.set(handle.sideways());\n\n /** A click on the content focuses the scrollport; its ring is for the keyboard (`createFocusOrigin`). */\n const origin = createFocusOrigin(viewport);\n this.destroyRef.onDestroy(origin.destroy);\n });\n\n this.destroyRef.onDestroy(() => {\n this.edges?.destroy();\n this.edges = null;\n });\n }\n\n /** The frame: the consumer's own element. */\n get root(): HTMLElement {\n return this.element;\n }\n\n /** The scrollport: the element that scrolls and takes focus. */\n get viewport(): HTMLElement {\n return this.viewportRef().nativeElement;\n }\n\n /** The last measurement: whether each axis overflows, and which of its ends show. */\n state(): ScrollEdgesState {\n return this.edges?.state() ?? NO_SCROLL_EDGES;\n }\n\n /** The distance from each logical start, read now. */\n position(): ScrollPosition {\n return this.edges?.position() ?? { block: 0, inline: 0 };\n }\n\n /** Moves to a logical position. An axis left out is an axis left alone. */\n scrollTo(target: Partial<ScrollPosition>): void {\n this.edges?.scrollTo(target);\n }\n\n /** Moves to one end of one axis. */\n scrollToEdge(edge: LogicalEdge): void {\n this.edges?.scrollToEdge(edge);\n }\n\n /** Brings one element into view by the shortest movement that does it, without moving anything else. */\n reveal(element: Element): void {\n this.edges?.reveal(element);\n }\n\n /** Measures again, after content the observer could not see changed. */\n refresh(): void {\n this.edges?.refresh();\n }\n\n /** Moves focus to the scrollport. */\n focus(): void {\n this.viewport.focus();\n }\n\n protected onScroll(event: Event) {\n if (this.edges === null) return;\n this.scrollChange.emit({ position: this.edges.position(), source: event });\n }\n}\n\n/**\n * The inset that scrolls with the content.\n *\n * Padding on a scrollport is not applied at the end edge of its scrollable\n * overflow in every engine, so an inset that has to survive a scroll to the\n * end goes on an element inside it. The family states no inset of its own: the\n * directive exists to give the consumer's one a place to live, on the\n * consumer's own element, and an area whose content already carries its own\n * inset uses no `slScrollAreaContent` at all.\n */\n@Directive({\n selector: '[slScrollAreaContent]',\n standalone: true,\n exportAs: 'slScrollAreaContent',\n host: { 'data-part': 'content' },\n})\nexport class SlScrollAreaContent {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAqCA,MAAM,QAAQ,GAAuB;AACnC,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,UAAU,EAAE,MAAM;CACnB;MAEY,oBAAoB,GAAG,IAAI,cAAc,CACpD,8BAA8B,EAC9B,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,EAAE;AAGjD;;;;;;;;;AASG;AACG,SAAU,yBAAyB,CAAC,QAAqC,EAAA;IAC7E,OAAO;AACL,QAAA,OAAO,EAAE,oBAAoB;AAC7B,QAAA,UAAU,EAAE,OAA2B,EAAE,GAAG,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC;KACrE;AACH;AAEA;SACgB,wBAAwB,GAAA;AACtC,IAAA,OAAO,MAAM,CAAC,oBAAoB,CAAC;AACrC;;ACtBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;MAuCU,YAAY,CAAA;IACd,IAAI,GAAG,KAAK,CAA6B,SAAS;6EAAC;IACnD,UAAU,GAAG,KAAK,CAAmC,SAAS;mFAAC;IAC/D,MAAM,GAAG,KAAK,CAA+B,SAAS;+EAAC;IACvD,IAAI,GAAG,KAAK,CAA6B,SAAS;6EAAC;IACnD,UAAU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;;ACpSD;;AAEG;;"}
|
|
@@ -422,6 +422,11 @@ class SlSelect {
|
|
|
422
422
|
constructor() {
|
|
423
423
|
const destroyRef = inject(DestroyRef);
|
|
424
424
|
const host = inject((ElementRef));
|
|
425
|
+
/* Every press resets the record in the capture phase; one on the frame sets it after. */
|
|
426
|
+
const doc = host.nativeElement.ownerDocument;
|
|
427
|
+
const resetPress = () => (this.pressedFrame = false);
|
|
428
|
+
doc.addEventListener('pointerdown', resetPress, true);
|
|
429
|
+
destroyRef.onDestroy(() => doc.removeEventListener('pointerdown', resetPress, true));
|
|
425
430
|
effect(() => {
|
|
426
431
|
const row = this.tags()?.nativeElement ?? null;
|
|
427
432
|
const trigger = this.chipOverflow()?.nativeElement ?? null;
|
|
@@ -516,10 +521,26 @@ class SlSelect {
|
|
|
516
521
|
* Whether a click landed on the control's frame. A click a `label` elsewhere
|
|
517
522
|
* forwards to the button carries the label's coordinates, which lie outside it.
|
|
518
523
|
*/
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
524
|
+
/** The last press went down on the frame; see `onTriggerClick`. */
|
|
525
|
+
pressedFrame = false;
|
|
526
|
+
onFramePointerDown() {
|
|
527
|
+
this.pressedFrame = true;
|
|
528
|
+
this.prepare();
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* The reader is about to open the popup: the control took focus or a press.
|
|
532
|
+
* The portal's layer is made then, because making it reads the trigger's
|
|
533
|
+
* computed style, and a read in the open's own task is a style recalculation
|
|
534
|
+
* the first frame waits for. A press focuses before it clicks, in a task of
|
|
535
|
+
* its own.
|
|
536
|
+
*/
|
|
537
|
+
prepare() {
|
|
538
|
+
if (this.portalRoot !== null)
|
|
539
|
+
return;
|
|
540
|
+
this.portalRoot = createPortalRoot({
|
|
541
|
+
origin: this.triggerRef().nativeElement,
|
|
542
|
+
disabled: this.portal() === false,
|
|
543
|
+
});
|
|
523
544
|
}
|
|
524
545
|
scrollToKey(value) {
|
|
525
546
|
const option = this.options().find((candidate) => candidate.dataset['value'] === value);
|
|
@@ -613,11 +634,16 @@ class SlSelect {
|
|
|
613
634
|
}
|
|
614
635
|
onTriggerClick(event) {
|
|
615
636
|
/* A press on the field's label arrives here as the click the label
|
|
616
|
-
forwards: a pointer click
|
|
617
|
-
It focuses the control and does not open the list — the
|
|
618
|
-
example's label only focuses, and so does a native
|
|
619
|
-
or assistive-technology click carries detail 0 and
|
|
620
|
-
|
|
637
|
+
forwards: a pointer click whose press went down on the label, not on
|
|
638
|
+
the frame. It focuses the control and does not open the list — the
|
|
639
|
+
select-only example's label only focuses, and so does a native
|
|
640
|
+
select's. A keyboard or assistive-technology click carries detail 0 and
|
|
641
|
+
opens. The press is recorded rather than the click's coordinates
|
|
642
|
+
compared with the frame's box: that box is a layout read in the click's
|
|
643
|
+
own task, after the release changed the frame's style. */
|
|
644
|
+
const fromFrame = this.pressedFrame;
|
|
645
|
+
this.pressedFrame = false;
|
|
646
|
+
if (event.detail > 0 && !fromFrame) {
|
|
621
647
|
this.focus();
|
|
622
648
|
return;
|
|
623
649
|
}
|
|
@@ -856,17 +882,14 @@ class SlSelect {
|
|
|
856
882
|
this.view.detectChanges();
|
|
857
883
|
return;
|
|
858
884
|
}
|
|
859
|
-
this.
|
|
860
|
-
origin: this.triggerRef().nativeElement,
|
|
861
|
-
disabled: this.portal() === false,
|
|
862
|
-
});
|
|
885
|
+
this.prepare();
|
|
863
886
|
this.view = this.viewContainer.createEmbeddedView(this.template());
|
|
864
887
|
this.view.detectChanges();
|
|
865
888
|
this.layerNode = this.view.rootNodes.find((node) => node instanceof HTMLElement);
|
|
866
889
|
this.surfaceNode = this.layerNode?.querySelector("[data-part='content']") ?? null;
|
|
867
890
|
if (this.layerNode === null)
|
|
868
891
|
return;
|
|
869
|
-
this.portalRoot
|
|
892
|
+
this.portalRoot?.container?.append(this.layerNode);
|
|
870
893
|
this.presence = createPresence({ present: this.isOpen() });
|
|
871
894
|
this.presence.setNode(this.layerNode);
|
|
872
895
|
this.recount();
|
|
@@ -892,8 +915,15 @@ class SlSelect {
|
|
|
892
915
|
strategy: this.strategy() ?? this.defaults.strategy,
|
|
893
916
|
});
|
|
894
917
|
/* The height that bounds the list arrives with the position, after the
|
|
895
|
-
highlight has landed, so the highlighted row is revealed again
|
|
896
|
-
|
|
918
|
+
highlight has landed, so the highlighted row is revealed again — in the
|
|
919
|
+
next frame, whose layout the browser computes anyway, rather than by a
|
|
920
|
+
read here after the position's writes. */
|
|
921
|
+
void this.positioner.update().then(() => {
|
|
922
|
+
const view = this.layerNode?.ownerDocument.defaultView;
|
|
923
|
+
if (view === null || view === undefined)
|
|
924
|
+
return;
|
|
925
|
+
view.requestAnimationFrame(() => this.reveal(this.highlightedValue()));
|
|
926
|
+
});
|
|
897
927
|
}
|
|
898
928
|
bind() {
|
|
899
929
|
if (this.layerNode === null)
|
|
@@ -1020,7 +1050,7 @@ class SlSelect {
|
|
|
1020
1050
|
return this.selection().length === 0 ? { required: true } : null;
|
|
1021
1051
|
}
|
|
1022
1052
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: SlSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1023
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlSelect, isStandalone: true, selector: "sl-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, highlightedValue: { classPropertyName: "highlightedValue", publicName: "highlightedValue", isSignal: true, isRequired: false, transformFunction: null }, searchValue: { classPropertyName: "searchValue", publicName: "searchValue", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, mount: { classPropertyName: "mount", publicName: "mount", isSignal: true, isRequired: false, transformFunction: null }, strategy: { classPropertyName: "strategy", publicName: "strategy", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "alignOffset", isSignal: true, isRequired: false, transformFunction: null }, collisionPadding: { classPropertyName: "collisionPadding", publicName: "collisionPadding", isSignal: true, isRequired: false, transformFunction: null }, typeaheadTimeout: { classPropertyName: "typeaheadTimeout", publicName: "typeaheadTimeout", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, highlightMatch: { classPropertyName: "highlightMatch", publicName: "highlightMatch", isSignal: true, isRequired: false, transformFunction: null }, typeahead: { classPropertyName: "typeahead", publicName: "typeahead", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsidePress: { classPropertyName: "closeOnOutsidePress", publicName: "closeOnOutsidePress", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "flip", isSignal: true, isRequired: false, transformFunction: null }, shift: { classPropertyName: "shift", publicName: "shift", isSignal: true, isRequired: false, transformFunction: null }, hideWhenDetached: { classPropertyName: "hideWhenDetached", publicName: "hideWhenDetached", isSignal: true, isRequired: false, transformFunction: null }, portal: { classPropertyName: "portal", publicName: "portal", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", valueChangeRequest: "valueChangeRequest", open: "openChange", openChangeRequest: "openChangeRequest", highlightedValue: "highlightedValueChange", highlightedValueChangeRequest: "highlightedValueChangeRequest", searchValue: "searchValueChange", searchValueChangeRequest: "searchValueChangeRequest" }, host: { attributes: { "data-ui": "select", "data-part": "root" }, properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.data-size": "resolvedSize()", "attr.data-variant": "resolvedVariant()", "attr.data-full-width": "resolvedFullWidth() ? '' : null", "attr.data-multiple": "resolvedMultiple() ? '' : null", "attr.data-open": "isOpen() ? '' : null", "attr.data-disabled": "resolvedDisabled() ? '' : null", "attr.data-readonly": "resolvedReadOnly() ? '' : null", "attr.data-invalid": "resolvedInvalid() ? '' : null", "attr.data-required": "resolvedRequired() ? '' : null", "attr.data-loading": "loading() ? '' : null", "attr.data-narrow": "narrow() ? '' : null" } }, providers: [
|
|
1053
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: SlSelect, isStandalone: true, selector: "sl-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, highlightedValue: { classPropertyName: "highlightedValue", publicName: "highlightedValue", isSignal: true, isRequired: false, transformFunction: null }, searchValue: { classPropertyName: "searchValue", publicName: "searchValue", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, mount: { classPropertyName: "mount", publicName: "mount", isSignal: true, isRequired: false, transformFunction: null }, strategy: { classPropertyName: "strategy", publicName: "strategy", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "alignOffset", isSignal: true, isRequired: false, transformFunction: null }, collisionPadding: { classPropertyName: "collisionPadding", publicName: "collisionPadding", isSignal: true, isRequired: false, transformFunction: null }, typeaheadTimeout: { classPropertyName: "typeaheadTimeout", publicName: "typeaheadTimeout", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, highlightMatch: { classPropertyName: "highlightMatch", publicName: "highlightMatch", isSignal: true, isRequired: false, transformFunction: null }, typeahead: { classPropertyName: "typeahead", publicName: "typeahead", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsidePress: { classPropertyName: "closeOnOutsidePress", publicName: "closeOnOutsidePress", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "flip", isSignal: true, isRequired: false, transformFunction: null }, shift: { classPropertyName: "shift", publicName: "shift", isSignal: true, isRequired: false, transformFunction: null }, hideWhenDetached: { classPropertyName: "hideWhenDetached", publicName: "hideWhenDetached", isSignal: true, isRequired: false, transformFunction: null }, portal: { classPropertyName: "portal", publicName: "portal", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", valueChangeRequest: "valueChangeRequest", open: "openChange", openChangeRequest: "openChangeRequest", highlightedValue: "highlightedValueChange", highlightedValueChangeRequest: "highlightedValueChangeRequest", searchValue: "searchValueChange", searchValueChangeRequest: "searchValueChangeRequest" }, host: { attributes: { "data-ui": "select", "data-part": "root" }, listeners: { "pointerdown": "onFramePointerDown()", "focusin": "prepare()" }, properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.data-size": "resolvedSize()", "attr.data-variant": "resolvedVariant()", "attr.data-full-width": "resolvedFullWidth() ? '' : null", "attr.data-multiple": "resolvedMultiple() ? '' : null", "attr.data-open": "isOpen() ? '' : null", "attr.data-disabled": "resolvedDisabled() ? '' : null", "attr.data-readonly": "resolvedReadOnly() ? '' : null", "attr.data-invalid": "resolvedInvalid() ? '' : null", "attr.data-required": "resolvedRequired() ? '' : null", "attr.data-loading": "loading() ? '' : null", "attr.data-narrow": "narrow() ? '' : null" } }, providers: [
|
|
1024
1054
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SlSelect), multi: true },
|
|
1025
1055
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => SlSelect), multi: true },
|
|
1026
1056
|
], queries: [{ propertyName: "summaryTemplate", first: true, predicate: SlSelectValue, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "template", first: true, predicate: ["layer"], descendants: true, isSignal: true }, { propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "tags", first: true, predicate: ["tags"], descendants: true, isSignal: true }, { propertyName: "chipOverflow", first: true, predicate: ["chipOverflow"], descendants: true, isSignal: true }], exportAs: ["slSelect"], ngImport: i0, template: `
|
|
@@ -1305,6 +1335,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
1305
1335
|
'[attr.data-full-width]': "resolvedFullWidth() ? '' : null",
|
|
1306
1336
|
'[attr.data-multiple]': "resolvedMultiple() ? '' : null",
|
|
1307
1337
|
'[attr.data-open]': "isOpen() ? '' : null",
|
|
1338
|
+
'(pointerdown)': 'onFramePointerDown()',
|
|
1339
|
+
'(focusin)': 'prepare()',
|
|
1308
1340
|
'[attr.data-disabled]': "resolvedDisabled() ? '' : null",
|
|
1309
1341
|
'[attr.data-readonly]': "resolvedReadOnly() ? '' : null",
|
|
1310
1342
|
'[attr.data-invalid]': "resolvedInvalid() ? '' : null",
|