ngwr 16.0.0 → 16.1.0
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/badge/styles/_tag.scss +8 -4
- package/button/styles/_index.scss +13 -7
- package/cascader/styles/_rules.scss +4 -2
- package/checkbox/styles/_index.scss +4 -2
- package/date-picker/styles/_index.scss +6 -2
- package/date-stamp/styles/_index.scss +38 -0
- package/dialog/styles/_index.scss +38 -0
- package/fesm2022/internal-CVLvP9b_.mjs +33 -0
- package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +11 -7
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +11 -7
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +10 -6
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +18 -6
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +9 -6
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +8 -4
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +19 -8
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -5
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +11 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +10 -6
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +2 -1
- package/fesm2022/ngwr-clipboard.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +9 -5
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +4 -2
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-comment.mjs +13 -7
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +9 -3
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +4 -2
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +11 -6
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +86 -30
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
- package/fesm2022/ngwr-date-stamp.mjs +149 -0
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
- package/fesm2022/ngwr-date.mjs +279 -50
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +9 -5
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +23 -2
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +45 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +102 -11
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +4 -2
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +29 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +4 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +5 -2
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +4 -2
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +9 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +18 -6
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +2 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +2 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +2 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +2 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +2 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +2 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +2 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +2 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +2 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +2 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +2 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +2 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +2 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +2 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +2 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +2 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +2 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +2 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +2 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +2 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +2 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +2 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +34 -8
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +9 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +4 -2
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +20 -10
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +9 -3
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +9 -3
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +13 -5
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +9 -5
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +13 -5
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +9 -5
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +84 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +3 -2
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +21 -5
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +93 -4
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +4 -2
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +9 -5
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +9 -3
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-resizable.mjs +503 -0
- package/fesm2022/ngwr-resizable.mjs.map +1 -0
- package/fesm2022/ngwr-result.mjs +9 -5
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +4 -2
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +13 -5
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +4 -2
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +4 -2
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +4 -2
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +4 -2
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +17 -21
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +9 -3
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +9 -5
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +5 -1
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +167 -10
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +9 -3
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +18 -8
- package/fesm2022/ngwr-timeline.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +6 -1
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +529 -104
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -2
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +4 -2
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +9 -3
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils-router.mjs +18 -2
- package/fesm2022/ngwr-utils-router.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +9 -2
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +7 -4
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/fesm2022/ngwr.mjs.map +1 -1
- package/i18n/ar.json +6 -0
- package/i18n/cs.json +6 -0
- package/i18n/de.json +6 -0
- package/i18n/en.json +6 -0
- package/i18n/es.json +6 -0
- package/i18n/fr.json +6 -0
- package/i18n/he.json +6 -0
- package/i18n/hi.json +6 -0
- package/i18n/id.json +6 -0
- package/i18n/it.json +6 -0
- package/i18n/ja.json +6 -0
- package/i18n/ko.json +6 -0
- package/i18n/nl.json +6 -0
- package/i18n/pl.json +6 -0
- package/i18n/pt.json +6 -0
- package/i18n/ru.json +6 -0
- package/i18n/sv.json +6 -0
- package/i18n/tr.json +6 -0
- package/i18n/uk.json +6 -0
- package/i18n/vi.json +6 -0
- package/i18n/zh-TW.json +6 -0
- package/i18n/zh.json +6 -0
- package/input/styles/_index.scss +10 -5
- package/input-number/styles/_index.scss +6 -3
- package/input-otp/styles/_index.scss +4 -2
- package/llms-full.txt +29 -10
- package/llms.txt +8 -4
- package/package.json +15 -1
- package/radio/styles/_index.scss +4 -2
- package/resizable/styles/_index.scss +154 -0
- package/schematics/use/rule.js +1 -0
- package/schematics/use/symbol-map.json +4 -0
- package/select/styles/_index.scss +6 -3
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +4 -1
- package/skills/ngwr/references/setup.md +3 -0
- package/switch/styles/_index.scss +4 -2
- package/table/styles/_index.scss +53 -0
- package/textarea/styles/_index.scss +4 -2
- package/theme/styles/_motion.scss +6 -0
- package/toast/styles/_index.scss +19 -0
- package/types/ngwr-burger.d.ts +0 -1
- package/types/ngwr-calendar.d.ts +7 -0
- package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
- package/types/ngwr-clipboard.d.ts +7 -0
- package/types/ngwr-date-picker.d.ts +9 -2
- package/types/ngwr-date-stamp-testing.d.ts +47 -0
- package/types/ngwr-date-stamp.d.ts +81 -0
- package/types/ngwr-date.d.ts +135 -24
- package/types/ngwr-dialog-testing.d.ts +10 -0
- package/types/ngwr-dialog.d.ts +72 -4
- package/types/ngwr-directives.d.ts +36 -1
- package/types/ngwr-drawer.d.ts +21 -0
- package/types/ngwr-i18n.d.ts +44 -14
- package/types/ngwr-overlay.d.ts +36 -0
- package/types/ngwr-pipes.d.ts +15 -0
- package/types/ngwr-popover.d.ts +39 -1
- package/types/ngwr-resizable.d.ts +228 -0
- package/types/ngwr-table-testing.d.ts +3 -1
- package/types/ngwr-table.d.ts +120 -4
- package/types/ngwr-toast-testing.d.ts +12 -1
- package/types/ngwr-toast.d.ts +215 -18
- package/types/ngwr-utils-router.d.ts +22 -0
- package/types/ngwr-utils.d.ts +8 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-cascader.mjs","names":[],"sources":["../../../projects/lib/cascader/cascader.ts","../../../projects/lib/cascader/cascader.html"],"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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\nimport { wrIsPrintableKey, wrToClassList, type WrClassInput } from 'ngwr/utils';\n\nimport type { WrCascaderOption } from './types';\n\nlet panelUid = 0;\n\n/**\n * Whether a keydown is a Tab that takes focus out of the open panel. The pane\n * lives in the overlay container at the end of `<body>`, so the browser's own Tab\n * out of it went to `<body>` — the top of the page — with the panel left standing.\n * The caller focuses the trigger synchronously and does NOT `preventDefault`, so\n * the browser's Tab carries on from there to the trigger's real neighbour — the\n * move `wr-dropdown` makes for its menu.\n *\n * Every Tab inside the pane leaves it, in either direction: the panel holds ONE\n * tab stop (the roving one, see `tabStop`), so there is nowhere else inside it for\n * Tab to go. Asking \"is there a later stop\" instead would also answer wrongly for\n * the moment between an arrow key moving focus and the render that moves the\n * `tabindex=\"0\"` after it.\n */\nfunction tabLeavesPane(pane: HTMLElement, event: KeyboardEvent): boolean {\n if (event.key !== 'Tab' || event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return false;\n const active = pane.ownerDocument.activeElement;\n return !!active && pane.contains(active);\n}\n\n/** How long a pause ends a type-ahead run, in milliseconds — the figure APG's examples use. */\nconst TYPEAHEAD_MS = 500;\n\n/**\n * Multi-level select — drills down through hierarchical categories\n * (e.g. country → state → city). Each level renders as a column; clicks\n * advance to the next column. Selecting a leaf (no children) commits\n * the full path.\n *\n * A signal-forms native control: it implements `FormValueControl<unknown>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. The value\n * is the path through the tree (an array from root to leaf).\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-cascader [options]=\"locations\" [formField]=\"form.path\" placeholder=\"Pick a location\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-cascader [options]=\"locations\" [(value)]=\"path\" placeholder=\"Pick a location\" />\n * ```\n *\n * ```ts\n * locations: WrCascaderOption[] = [\n * {\n * value: 'us', label: 'United States', children: [\n * { value: 'ny', label: 'New York', children: [\n * { value: 'nyc', label: 'NYC' },\n * { value: 'buf', label: 'Buffalo' },\n * ] },\n * ],\n * },\n * ];\n * ```\n *\n * @see https://ngwr.dev/reference/components/cascader\n */\nexport type WrCascaderSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-cascader',\n templateUrl: './cascader.html',\n styleUrl: './cascader.scss',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n})\nexport class WrCascader<T = string> implements FormValueControl<unknown> {\n /** Accessible name. Falls back to `select.clearSelection`, then `'Clear selection'`. */\n readonly clearLabel = input<string | null>(null);\n\n protected readonly resolvedClearLabel = useI18nText(this.clearLabel, 'select.clearSelection', 'Clear selection');\n\n /** Root-level options. Each may have `children` for deeper levels. */\n readonly options = input.required<readonly WrCascaderOption<T>[]>();\n\n /** Placeholder shown when no path is selected. @default '' */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name of the trigger. Falls back to the placeholder, then to\n * `select.label` — a `role=\"combobox\"` with nothing selected and no\n * placeholder otherwise has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly labelText = useI18nText(this.ariaLabel, 'select.label', 'Select');\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder must fall through to the catalog string.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.placeholder();\n return placeholder ? placeholder : this.labelText();\n });\n\n /**\n * Disable the cascader. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while the trigger stays focusable and the path still submits.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The panel is where every edit happens, so a read-only cascader simply does\n * not open — there is nothing to browse that is not already on the trigger —\n * and the clear button goes away with it. Mirrored as `aria-readonly`, which\n * role `combobox` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /**\n * The field's own label, when it renders one — `null` otherwise, and `null`\n * when `[ariaLabel]` was set deliberately.\n *\n * `aria-label` outranks a `<label for>` in the accname order, so without this\n * a cascader inside `<wr-form-field label=\"Region\">` announced its\n * PLACEHOLDER, or the generic `select.label` default, and the visible label\n * reached nobody. Nothing catches it: the control has a name, so axe is\n * satisfied, and the name is plausible, so a reader is too — it fails WCAG\n * 2.5.3, where the visible label has to be IN the accessible name. Same call\n * `wr-rating` and `wr-knob` already make.\n */\n protected readonly labelledBy = computed(() => (this.ariaLabel() ? null : this.fieldAria.labelledBy()));\n\n /** `null` once `aria-labelledby` is carrying the name — see {@link labelledBy}. */\n protected readonly nameLabel = computed(() => (this.labelledBy() ? null : this.resolvedAriaLabel()));\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrCascaderSize>('md');\n\n /** Show a clear-all (×) button on the trigger when a path is selected. @default true */\n readonly clearable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Allow selecting non-leaf (parent) nodes. When `false`, only leaves\n * (nodes without children) commit a selection. @default false\n */\n readonly changeOnSelect = input(false, { transform: coerceBooleanProperty });\n\n /** Separator between labels in the trigger display. @default '/' */\n readonly separator = input<string>('/');\n\n /**\n * Extra CSS classes for the column panel's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Committed selection path (full array from root to leaf). Bound by\n * `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<unknown>([]);\n\n /** Emitted on blur / commit so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** Fires after the panel opens. */\n readonly opened = output<void>();\n\n /** Fires after the panel closes. */\n readonly closed = output<void>();\n\n /** Committed selection path (full T[] from root to leaf). @internal */\n protected readonly path = signal<readonly T[]>([]);\n\n /** Currently-expanded column path — drives which columns the panel shows. @internal */\n protected readonly activePath = signal<readonly T[]>([]);\n\n protected readonly isOpen = signal(false);\n\n /**\n * The option the user last moved to inside the open panel — `null` until they\n * move, and again on every open. Written by an option's `focus` event, so\n * whatever moved the caret (an arrow, a click, a harness, a type-ahead letter)\n * moves the tab stop with it.\n */\n private readonly cursor = signal<{ readonly col: number; readonly value: T } | null>(null);\n\n /**\n * The panel's ONE tab stop, as in the APG tree pattern: the option the user\n * moved to, else the selected path's leaf, else the first enabled root. Every\n * other option carries `tabindex=\"-1\"` and is reached with the arrows, so a\n * deep tree is one Tab to enter and one to leave instead of a stop per option.\n *\n * Validated against what is ON SCREEN rather than trusted: choosing a sibling\n * prunes the deeper columns, and a value written from outside replaces the\n * path, so a remembered position can name an option that is gone. A disabled\n * option is never the stop — `focus()` would land on a choice nobody can make.\n * When the leaf itself is not on screen or is disabled, the deepest ancestor on\n * the path that is takes its place.\n */\n protected readonly tabStop = computed<{ readonly col: number; readonly value: T } | null>(() => {\n const cols = this.columns();\n const enabledAt = (col: number, value: T): boolean => !!cols[col]?.some(o => o.value === value && !o.disabled);\n\n const at = this.cursor();\n if (at && enabledAt(at.col, at.value)) return at;\n\n const path = this.path();\n const active = this.activePath();\n for (let col = Math.min(path.length, cols.length) - 1; col >= 0; col--) {\n // Column `col` lists the children of the ACTIVE path above it, so the path's\n // node at that depth is on screen only while the two agree that far down.\n if (!this.pathsEqual(path.slice(0, col), active.slice(0, col))) continue;\n if (enabledAt(col, path[col])) return { col, value: path[col] };\n }\n\n const first = cols[0]?.find(o => !o.disabled);\n return first ? { col: 0, value: first.value } : null;\n });\n\n /** Letters typed in quick succession, for type-ahead. */\n private typeahead = '';\n private typeaheadAt = 0;\n\n /** Panel id used by the trigger's `aria-controls`. */\n protected readonly panelId = `wr-cascader-panel-${++panelUid}`;\n\n /**\n * Columns visible in the panel. Each column shows the children of the\n * preceding activePath entry. Column 0 = root options. The last\n * column is whatever the deepest active node's children resolve to —\n * we only render a column when there are children to show.\n */\n protected readonly columns = computed<readonly (readonly WrCascaderOption<T>[])[]>(() => {\n const cols: (readonly WrCascaderOption<T>[])[] = [this.options()];\n const trail = this.activePath();\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of trail) {\n const node = list.find(o => o.value === v);\n if (!node?.children?.length) break;\n cols.push(node.children);\n list = node.children;\n }\n return cols;\n });\n\n /** Label trail joined by `separator()` — what the trigger shows. */\n protected readonly displayLabel = computed(() => {\n const p = this.path();\n if (p.length === 0) return null;\n const labels: string[] = [];\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of p) {\n const node = list.find(o => o.value === v);\n if (!node) return null;\n labels.push(node.label);\n list = node.children ?? [];\n }\n const sep = ` ${this.separator()} `;\n return labels.join(sep);\n });\n\n protected readonly hasSelection = computed(() => this.path().length > 0);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-cascader'];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-cascader--${size}`);\n if (this.isOpen()) parts.push('wr-cascader--open');\n if (this.disabled()) parts.push('wr-cascader--disabled');\n else if (this.readonly()) parts.push('wr-cascader--readonly');\n return parts.join(' ');\n });\n\n protected readonly panelTpl = viewChild.required('panelTpl', { read: TemplateRef });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n /**\n * Ambient reading direction, for the open panel alone — nothing in this\n * component reads it directly. Optional so a bare `TestBed` needs no\n * provider; `Directionality` is root-provided anyway, and a missing one\n * simply reads as `ltr`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // Same contract as wr-select / wr-dropdown / wr-lightbox: an overlay lives in\n // the CDK container, not in this component's view, so destroying the\n // component while the panel is open would strand the pane and its scroll\n // strategy.\n this.destroyRef.onDestroy(() => this.closeOverlay(false));\n\n effect(() => {\n if (this.isOpen()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n\n // Close the panel if the control becomes disabled or read-only while open.\n effect(() => {\n if (this.disabled() || this.readonly()) this.isOpen.set(false);\n });\n\n // Mirror an external `value` write into the internal path/activePath\n // (the old `writeValue`). Skipped when the write merely echoes the\n // committed path, so a live drill-down can never be clobbered.\n effect(() => {\n // Coerce null/undefined/non-array to an empty path — a classic-forms\n // binding can write null, which the old `writeValue(value: unknown)`\n // treated as \"no selection\" too.\n const value = this.value();\n untracked(() => {\n const next: readonly T[] = Array.isArray(value) ? (value as readonly T[]) : [];\n if (this.pathsEqual(this.path(), next)) return;\n this.path.set(next);\n this.activePath.set(next);\n });\n });\n }\n\n /**\n * Focus the trigger — what Signal Forms calls to focus this control. The\n * panel stays shut: ArrowDown or a click opens it, the way it does after Tab.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus(options);\n }\n\n /** Open the panel on the selected path, as the trigger does. Refused while disabled or read-only. */\n open(): void {\n if (this.disabled() || this.readonly() || this.isOpen()) return;\n this.activePath.set(this.path());\n this.isOpen.set(true);\n }\n\n /** Close the panel. */\n close(): void {\n this.isOpen.set(false);\n }\n\n // Template handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n if (!this.isOpen()) this.activePath.set(this.path());\n this.isOpen.update(v => !v);\n }\n\n /**\n * ArrowDown / ArrowUp open the panel, Alt+ArrowDown included — the combobox way in,\n * and the shape `wr-dropdown`'s trigger uses. Enter and Space need no branch: the\n * trigger is a real `<button>`, so the browser turns them into the click above.\n *\n * Only while closed. Once the panel is up the caret is inside it, and its options\n * own their own keys.\n */\n protected onTriggerKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.readonly() || this.isOpen()) return;\n\n // Backspace is the × from the keyboard, and it has to be: the × is a\n // `tabindex=\"-1\"` span INSIDE this button, and a keydown goes to the focused\n // element, so the `(keydown.enter)` / `(keydown.space)` it used to carry could\n // never fire. Clearing was reachable by pointer alone — a WCAG 2.1.1 failure,\n // not a missing convenience. The span stays unfocusable, because a focusable\n // child of a button is `nested-interactive`. Same key, same gating as\n // `wr-select`: `clearable()` IS the clear control, so a consumer who turned\n // the × off did not ask for a keyboard twin of it.\n if (event.key === 'Backspace') {\n if (!this.clearable() || !this.hasSelection()) return;\n event.preventDefault();\n this.clearSelection(event);\n return;\n }\n\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n event.preventDefault();\n this.activePath.set(this.path());\n this.isOpen.set(true);\n }\n\n protected onOptionClick(colIndex: number, opt: WrCascaderOption<T>, event: Event): void {\n event.stopPropagation();\n if (opt.disabled || this.disabled() || this.readonly()) return;\n\n const head = this.activePath().slice(0, colIndex);\n const newPath = [...head, opt.value];\n\n const hasChildren = !!opt.children?.length;\n\n // Always update active column for visual feedback / next column.\n this.activePath.set(newPath);\n // A pointer click focuses the option anyway (see `onOptionFocus`); a scripted\n // `click()` does not, and the tab stop belongs where the choice was made.\n this.cursor.set({ col: colIndex, value: opt.value });\n\n // Commit when we've reached a leaf, or when changeOnSelect is on.\n if (!hasChildren || this.changeOnSelect()) {\n this.path.set(newPath);\n this.value.set(newPath);\n this.touch.emit();\n // Close once we hit a true leaf — parent commits keep the panel open.\n if (!hasChildren) this.isOpen.set(false);\n }\n }\n\n /**\n * The tree keys the panel's roles promise, per the APG tree pattern: Up / Down\n * within a column, Home / End to its ends, the inline-end arrow into a branch's\n * children — opening the next column on the way — and the inline-start arrow back\n * to the option the column belongs to, or, from a root, closing the column it\n * opened. A letter moves to the next option in the column whose label starts with\n * what was typed. Enter and Space stay the commit.\n *\n * These are the ONLY way between options: the panel holds one tab stop (see\n * {@link tabStop}), and Tab leaves it.\n */\n protected onOptionKeydown(colIndex: number, opt: WrCascaderOption<T>, event: KeyboardEvent): void {\n const current = event.currentTarget as HTMLElement;\n const column = current.closest<HTMLElement>('[role=\"group\"]');\n if (!column) return;\n // Before the modifier check, because Shift is how a capital letter is typed.\n if (wrIsPrintableKey(event) && event.key !== ' ') {\n this.typeAhead(column, current, event.key);\n event.preventDefault();\n return;\n }\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const rtl = this.dir?.value === 'rtl';\n const inward = rtl ? 'ArrowLeft' : 'ArrowRight';\n const outward = rtl ? 'ArrowRight' : 'ArrowLeft';\n const enabled = [...column.querySelectorAll<HTMLElement>('[role=\"treeitem\"]')].filter(\n o => o.getAttribute('aria-disabled') !== 'true'\n );\n const at = enabled.indexOf(current);\n\n switch (event.key) {\n case 'ArrowDown':\n enabled[at + 1]?.focus();\n break;\n case 'ArrowUp':\n if (at > 0) enabled[at - 1].focus();\n break;\n case 'Home':\n enabled[0]?.focus();\n break;\n case 'End':\n enabled[enabled.length - 1]?.focus();\n break;\n case inward: {\n if (opt.disabled || !opt.children?.length || this.disabled() || this.readonly()) break;\n this.activePath.set([...this.activePath().slice(0, colIndex), opt.value]);\n // The column is not in the DOM until the render this write schedules.\n afterNextRender(\n () =>\n this.overlayRef?.overlayElement\n .querySelector<HTMLElement>(\n `#${this.columnId(colIndex + 1)} [role=\"treeitem\"]:not([aria-disabled=\"true\"])`\n )\n ?.focus(),\n { injector: this.injector }\n );\n break;\n }\n case outward: {\n if (colIndex > 0) {\n const parent = this.parentOptionId(colIndex);\n if (parent) this.overlayRef?.overlayElement.querySelector<HTMLElement>(`#${parent}`)?.focus();\n } else if (opt.children?.length && this.isActiveAt(colIndex, opt.value)) {\n this.activePath.set([]);\n }\n break;\n }\n case ' ':\n // The commit is `(keydown.space)`'s; the page scrolling a screen under the\n // panel is the browser's, and it went with every Space on an option.\n break;\n default:\n return;\n }\n event.preventDefault();\n }\n\n /** The caret reached an option, by whatever route — the tab stop follows it. */\n protected onOptionFocus(colIndex: number, opt: WrCascaderOption<T>): void {\n if (opt.disabled) return;\n this.cursor.set({ col: colIndex, value: opt.value });\n }\n\n /** Whether this option is the panel's one `tabindex=\"0\"`. */\n protected isTabStop(colIndex: number, opt: WrCascaderOption<T>): boolean {\n const stop = this.tabStop();\n return !opt.disabled && stop !== null && stop.col === colIndex && stop.value === opt.value;\n }\n\n /**\n * Move to the next enabled option in `column` whose label starts with the letters\n * typed so far. A pause of {@link TYPEAHEAD_MS} starts a new run. One letter\n * pressed again cycles through the options that start with it; a longer run keeps\n * the option it already matches, so `g` then `e` stays on \"Germany\".\n */\n private typeAhead(column: HTMLElement, current: HTMLElement, key: string): void {\n const now = Date.now();\n this.typeahead = now - this.typeaheadAt > TYPEAHEAD_MS ? key : this.typeahead + key;\n this.typeaheadAt = now;\n\n const typed = this.typeahead.toLocaleLowerCase();\n const repeated = [...typed].every(ch => ch === typed[0]);\n const search = repeated ? typed[0] : typed;\n const enabled = [...column.querySelectorAll<HTMLElement>('[role=\"treeitem\"]')].filter(\n o => o.getAttribute('aria-disabled') !== 'true'\n );\n const from = enabled.indexOf(current);\n // A fresh letter (or a repeated one) starts AFTER the current option; a longer\n // run starts AT it, so the option that matched the first letters can keep the\n // match.\n const start = search.length === 1 ? from + 1 : Math.max(from, 0);\n const label = (o: HTMLElement): string =>\n (o.querySelector('.wr-cascader__opt-label')?.textContent ?? '').trim().toLocaleLowerCase();\n for (let i = 0; i < enabled.length; i++) {\n const candidate = enabled[(start + i) % enabled.length];\n if (label(candidate).startsWith(search)) {\n candidate.focus();\n return;\n }\n }\n }\n\n protected clearSelection(event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n this.path.set([]);\n this.activePath.set([]);\n this.value.set([]);\n this.touch.emit();\n }\n\n protected isActiveAt(colIndex: number, value: T): boolean {\n return this.activePath()[colIndex] === value;\n }\n\n /**\n * Whether this option is the committed choice — `null` when it is not a\n * choice at all.\n *\n * Two questions the panel has to keep apart, and `--active` answers only the\n * first: `activePath()` is where the user has NAVIGATED to, `path()` is what\n * they have COMMITTED. They agree once a leaf is picked and diverge for the\n * whole walk down.\n *\n * `null` — the attribute absent — on a branch while `changeOnSelect` is off,\n * because such a branch genuinely cannot be chosen; ARIA reads a missing\n * `aria-selected` as \"not selectable\", which is exactly true here. That makes\n * this binding the first expression the `changeOnSelect` contract has ever had\n * in ARIA, in both directions.\n */\n protected isSelectedAt(colIndex: number, opt: WrCascaderOption<T>): boolean | null {\n const committable = !opt.children?.length || this.changeOnSelect();\n if (!committable) return null;\n const path = this.path();\n return colIndex === path.length - 1 && path[colIndex] === opt.value;\n }\n\n /** Stable id for one option — what a column's `aria-labelledby` points at. */\n protected optionId(colIndex: number, optIndex: number): string {\n return `${this.panelId}-opt-${colIndex}-${optIndex}`;\n }\n\n /** Stable id for one column — what an expanded branch's `aria-controls` points at. */\n protected columnId(colIndex: number): string {\n return `${this.panelId}-col-${colIndex}`;\n }\n\n /**\n * The option whose children a column holds, by id — its accessible name.\n *\n * The columns are DOM SIBLINGS, so nothing in the markup says the second one\n * belongs to \"Europe\". Column 0 has no parent and stays unnamed; the tree\n * itself already carries the control's name.\n */\n protected parentOptionId(colIndex: number): string | null {\n if (colIndex === 0) return null;\n const parent = this.columns()[colIndex - 1] ?? [];\n const index = parent.findIndex(o => this.isActiveAt(colIndex - 1, o.value));\n return index < 0 ? null : this.optionId(colIndex - 1, index);\n }\n\n private pathsEqual(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n }\n\n // Overlay\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n // Each open starts from the selected path, not from where the last visit ended.\n this.cursor.set(null);\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: wrToClassList('wr-cascader-overlay', this.panelClass()),\n });\n\n // The columns cascade inline-wards, and the CDK captured the direction as a\n // string when this ref was created — so a flip while the panel is open left\n // the whole cascade running the other way from the page around it.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Move the caret into the panel it just opened. Nothing did, and the pane is\n // appended to `<body>`, so an opened cascader left focus on the trigger and its\n // options were reachable only by tabbing past the whole rest of the page —\n // `wr-tree` and `wr-context-menu` were the same defect. `closeOverlay` below\n // already assumes this is where the caret lives.\n //\n // `afterNextRender`, NOT `queueMicrotask`: under zoneless CD change detection runs\n // in a macrotask, so a microtask queued here fires before the columns are in the\n // DOM — the trap that once left `wr-calendar`'s ring and its real focus on\n // different days.\n afterNextRender(() => this.focusPanelOption(), { injector: this.injector });\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.isOpen.set(false);\n return;\n }\n if (this.overlayRef && tabLeavesPane(this.overlayRef.overlayElement, event)) {\n this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus();\n this.isOpen.set(false);\n }\n });\n\n this.opened.emit();\n }\n\n /**\n * The option the panel opens on: its tab stop, which on open is the selected path's\n * leaf, else the first enabled root (see {@link tabStop}). A disabled option is\n * never the stop, so `focus()` cannot land on a choice nobody can make.\n */\n private focusPanelOption(): void {\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[role=\"treeitem\"][tabindex=\"0\"]')?.focus();\n }\n\n /** `notify: false` is the destroy path: an output cannot emit from a destroyed view. */\n private closeOverlay(notify = true): void {\n if (!this.overlayRef) return;\n // Opening moves the caret onto the panel's tab stop and every option commits\n // on Enter, so on the keyboard the caret is INSIDE the pane by design — and\n // the ordinary way to finish choosing (`onOptionClick` on a leaf) closes it.\n // Disposing without handing focus back dropped it on `<body>` on the SUCCESS\n // path, not merely on dismissal: a keyboard user who had just picked a value\n // then had to Tab from the top of the document to get back to the control.\n // Untouched when focus had already moved elsewhere — that click is usually\n // what closed us, and stealing the caret back would fight the user for it.\n const pane = this.overlayRef.overlayElement;\n const focusWasInside = pane.contains(this.host.nativeElement.ownerDocument.activeElement);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (!notify) return;\n if (focusWasInside) this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus();\n this.closed.emit();\n }\n}\n\nexport type { WrCascaderOption } from './types';\n","<button\n type=\"button\"\n class=\"wr-cascader__trigger\"\n role=\"combobox\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [disabled]=\"disabled()\"\n [attr.aria-haspopup]=\"'tree'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (blur)=\"touch.emit()\"\n>\n @if (displayLabel(); as label) {\n <span class=\"wr-cascader__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-cascader__placeholder\">{{ placeholder() }}</span>\n }\n\n @if (clearable() && hasSelection() && !disabled() && !readonly()) {\n <span\n class=\"wr-cascader__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClearLabel()\"\n tabindex=\"-1\"\n (click)=\"clearSelection($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-cascader__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n</button>\n\n<ng-template #panelTpl>\n <div\n class=\"wr-cascader-panel\"\n [class.wr-cascader-panel--sm]=\"size() === 'sm'\"\n [class.wr-cascader-panel--lg]=\"size() === 'lg'\"\n role=\"tree\"\n [attr.id]=\"panelId\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <!--\n tree / group / treeitem, and NOT menu. A combobox's popup may be a listbox,\n a tree, a grid or a dialog and nothing else, so `aria-haspopup=\"menu\"` on\n the trigger was an author error — and a `menu` may own menuitems and\n groups, never other menus, so the columns were a second one. Neither is\n visible to axe: `menu` is a valid token for the global `aria-haspopup`, and\n `aria-required-children` passes a menu-inside-menu (measured against this\n exact fragment). A tree is what this control has always been — the value is\n a PATH, and only `treeitem` supports aria-expanded, aria-level,\n aria-setsize, aria-posinset and aria-selected at once.\n\n The columns stay `group` rather than collapsing to `role=\"presentation\"`,\n which is also axe-clean: the DOM is column-MAJOR, so a flat tree would\n leave level plus document order as the only structure, and \"Germany\"\n (level 2) would read as a child of \"Antarctica\" (level 1, the item\n immediately before it in source order).\n -->\n @for (col of columns(); track $index; let colIndex = $index) {\n <ul\n class=\"wr-cascader__col\"\n role=\"group\"\n [attr.id]=\"columnId(colIndex)\"\n [attr.aria-labelledby]=\"parentOptionId(colIndex)\"\n >\n @for (opt of col; track opt.value; let optIndex = $index) {\n <!--\n `aria-expanded` is exactly `isActiveAt`: `columns()` renders the next\n column for the active option and only when it has children, so the\n state can never claim a column that is not on screen — and\n `aria-controls` rides that same invariant, which is what makes\n \"expanded\" refer to something when the expanded content is a SIBLING\n rather than a descendant. It is emitted only while expanded: a\n reference to an absent id is a violation with `aria-expanded=\"true\"`\n and clean while collapsed.\n\n `aria-level` is load-bearing rather than decorative. The columns are\n siblings, so the DOM ancestry represents no level at all and every\n option would read as level 1. `aria-setsize` / `aria-posinset` are\n not strictly required — each column IS a complete sibling set — and\n are written anyway, because a tree that owns sibling groups is the\n uncommon shape where browser/AT pairs are known to miscompute both.\n\n `aria-selected` is written on every option that can be COMMITTED,\n `false` included, matching `wr-tree`. The alternative a reviewer may\n prefer: only the selected node, leaning on treeitem's implicit false,\n which is quieter in a long column and loses the \"this row is\n selectable\" signal that presence carries.\n\n `tabindex` is a ROVING stop, as in the APG tree pattern: one option\n carries `0` (see `tabStop`) and every other one `-1`, so the panel is\n one Tab to enter and one to leave, and the arrows move between options.\n -->\n <li\n class=\"wr-cascader__opt\"\n role=\"treeitem\"\n [attr.id]=\"optionId(colIndex, optIndex)\"\n [class.wr-cascader__opt--active]=\"isActiveAt(colIndex, opt.value)\"\n [class.wr-cascader__opt--disabled]=\"opt.disabled\"\n [attr.tabindex]=\"isTabStop(colIndex, opt) ? 0 : -1\"\n [attr.aria-disabled]=\"opt.disabled ? true : null\"\n [attr.aria-level]=\"colIndex + 1\"\n [attr.aria-setsize]=\"$count\"\n [attr.aria-posinset]=\"optIndex + 1\"\n [attr.aria-selected]=\"isSelectedAt(colIndex, opt)\"\n [attr.aria-expanded]=\"opt.children?.length ? isActiveAt(colIndex, opt.value) : null\"\n [attr.aria-controls]=\"\n opt.children?.length && isActiveAt(colIndex, opt.value) ? columnId(colIndex + 1) : null\n \"\n (click)=\"onOptionClick(colIndex, opt, $event)\"\n (focus)=\"onOptionFocus(colIndex, opt)\"\n (keydown)=\"onOptionKeydown(colIndex, opt, $event)\"\n (keydown.enter)=\"onOptionClick(colIndex, opt, $event)\"\n (keydown.space)=\"onOptionClick(colIndex, opt, $event)\"\n >\n <span class=\"wr-cascader__opt-label\">{{ opt.label }}</span>\n @if (opt.children?.length) {\n <svg\n class=\"wr-icon__svg wr-cascader__opt-arrow\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n }\n </li>\n }\n </ul>\n }\n </div>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,IAAI,WAAW;AAgBf,SAAS,cAAc,MAAmB,OAAoB;CAC5D,IAAI,MAAM,QAAQ,SAAS,MAAM,oBAAoB,MAAM,UAAU,MAAM,WAAW,MAAM,SAAS,OAAO;CAC5G,MAAM,SAAS,KAAK,cAAc;CAClC,OAAO,CAAC,CAAC,UAAU,KAAK,SAAS,MA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AA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAU;IAAI,MAAM;IAAa,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-cascader.mjs","names":[],"sources":["../../../projects/lib/cascader/cascader.ts","../../../projects/lib/cascader/cascader.html"],"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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\nimport { wrIsPrintableKey, wrToClassList, type WrClassInput } from 'ngwr/utils';\n\nimport type { WrCascaderOption } from './types';\n\nlet panelUid = 0;\n\n/**\n * Whether a keydown is a Tab that takes focus out of the open panel. The pane\n * lives in the overlay container at the end of `<body>`, so the browser's own Tab\n * out of it went to `<body>` — the top of the page — with the panel left standing.\n * The caller focuses the trigger synchronously and does NOT `preventDefault`, so\n * the browser's Tab carries on from there to the trigger's real neighbour — the\n * move `wr-dropdown` makes for its menu.\n *\n * Every Tab inside the pane leaves it, in either direction: the panel holds ONE\n * tab stop (the roving one, see `tabStop`), so there is nowhere else inside it for\n * Tab to go. Asking \"is there a later stop\" instead would also answer wrongly for\n * the moment between an arrow key moving focus and the render that moves the\n * `tabindex=\"0\"` after it.\n */\nfunction tabLeavesPane(pane: HTMLElement, event: KeyboardEvent): boolean {\n if (event.key !== 'Tab' || event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return false;\n const active = pane.ownerDocument.activeElement;\n return !!active && pane.contains(active);\n}\n\n/** How long a pause ends a type-ahead run, in milliseconds — the figure APG's examples use. */\nconst TYPEAHEAD_MS = 500;\n\n/**\n * Multi-level select — drills down through hierarchical categories\n * (e.g. country → state → city). Each level renders as a column; clicks\n * advance to the next column. Selecting a leaf (no children) commits\n * the full path.\n *\n * A signal-forms native control: it implements `FormValueControl<unknown>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. The value\n * is the path through the tree (an array from root to leaf).\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-cascader [options]=\"locations\" [formField]=\"form.path\" placeholder=\"Pick a location\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-cascader [options]=\"locations\" [(value)]=\"path\" placeholder=\"Pick a location\" />\n * ```\n *\n * ```ts\n * locations: WrCascaderOption[] = [\n * {\n * value: 'us', label: 'United States', children: [\n * { value: 'ny', label: 'New York', children: [\n * { value: 'nyc', label: 'NYC' },\n * { value: 'buf', label: 'Buffalo' },\n * ] },\n * ],\n * },\n * ];\n * ```\n *\n * @see https://ngwr.dev/reference/components/cascader\n */\nexport type WrCascaderSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-cascader',\n templateUrl: './cascader.html',\n styleUrl: './cascader.scss',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-cascader', '[class]': 'classes()' },\n})\nexport class WrCascader<T = string> implements FormValueControl<unknown> {\n /** Accessible name. Falls back to `select.clearSelection`, then `'Clear selection'`. */\n readonly clearLabel = input<string | null>(null);\n\n protected readonly resolvedClearLabel = useI18nText(this.clearLabel, 'select.clearSelection', 'Clear selection');\n\n /** Root-level options. Each may have `children` for deeper levels. */\n readonly options = input.required<readonly WrCascaderOption<T>[]>();\n\n /** Placeholder shown when no path is selected. @default '' */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name of the trigger. Falls back to the placeholder, then to\n * `select.label` — a `role=\"combobox\"` with nothing selected and no\n * placeholder otherwise has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly labelText = useI18nText(this.ariaLabel, 'select.label', 'Select');\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder must fall through to the catalog string.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.placeholder();\n return placeholder ? placeholder : this.labelText();\n });\n\n /**\n * Disable the cascader. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while the trigger stays focusable and the path still submits.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The panel is where every edit happens, so a read-only cascader simply does\n * not open — there is nothing to browse that is not already on the trigger —\n * and the clear button goes away with it. Mirrored as `aria-readonly`, which\n * role `combobox` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /**\n * The field's own label, when it renders one — `null` otherwise, and `null`\n * when `[ariaLabel]` was set deliberately.\n *\n * `aria-label` outranks a `<label for>` in the accname order, so without this\n * a cascader inside `<wr-form-field label=\"Region\">` announced its\n * PLACEHOLDER, or the generic `select.label` default, and the visible label\n * reached nobody. Nothing catches it: the control has a name, so axe is\n * satisfied, and the name is plausible, so a reader is too — it fails WCAG\n * 2.5.3, where the visible label has to be IN the accessible name. Same call\n * `wr-rating` and `wr-knob` already make.\n */\n protected readonly labelledBy = computed(() => (this.ariaLabel() ? null : this.fieldAria.labelledBy()));\n\n /** `null` once `aria-labelledby` is carrying the name — see {@link labelledBy}. */\n protected readonly nameLabel = computed(() => (this.labelledBy() ? null : this.resolvedAriaLabel()));\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrCascaderSize>('md');\n\n /** Show a clear-all (×) button on the trigger when a path is selected. @default true */\n readonly clearable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Allow selecting non-leaf (parent) nodes. When `false`, only leaves\n * (nodes without children) commit a selection. @default false\n */\n readonly changeOnSelect = input(false, { transform: coerceBooleanProperty });\n\n /** Separator between labels in the trigger display. @default '/' */\n readonly separator = input<string>('/');\n\n /**\n * Extra CSS classes for the column panel's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Committed selection path (full array from root to leaf). Bound by\n * `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<unknown>([]);\n\n /** Emitted on blur / commit so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** Fires after the panel opens. */\n readonly opened = output<void>();\n\n /** Fires after the panel closes. */\n readonly closed = output<void>();\n\n /** Committed selection path (full T[] from root to leaf). @internal */\n protected readonly path = signal<readonly T[]>([]);\n\n /** Currently-expanded column path — drives which columns the panel shows. @internal */\n protected readonly activePath = signal<readonly T[]>([]);\n\n protected readonly isOpen = signal(false);\n\n /**\n * The option the user last moved to inside the open panel — `null` until they\n * move, and again on every open. Written by an option's `focus` event, so\n * whatever moved the caret (an arrow, a click, a harness, a type-ahead letter)\n * moves the tab stop with it.\n */\n private readonly cursor = signal<{ readonly col: number; readonly value: T } | null>(null);\n\n /**\n * The panel's ONE tab stop, as in the APG tree pattern: the option the user\n * moved to, else the selected path's leaf, else the first enabled root. Every\n * other option carries `tabindex=\"-1\"` and is reached with the arrows, so a\n * deep tree is one Tab to enter and one to leave instead of a stop per option.\n *\n * Validated against what is ON SCREEN rather than trusted: choosing a sibling\n * prunes the deeper columns, and a value written from outside replaces the\n * path, so a remembered position can name an option that is gone. A disabled\n * option is never the stop — `focus()` would land on a choice nobody can make.\n * When the leaf itself is not on screen or is disabled, the deepest ancestor on\n * the path that is takes its place.\n */\n protected readonly tabStop = computed<{ readonly col: number; readonly value: T } | null>(() => {\n const cols = this.columns();\n const enabledAt = (col: number, value: T): boolean => !!cols[col]?.some(o => o.value === value && !o.disabled);\n\n const at = this.cursor();\n if (at && enabledAt(at.col, at.value)) return at;\n\n const path = this.path();\n const active = this.activePath();\n for (let col = Math.min(path.length, cols.length) - 1; col >= 0; col--) {\n // Column `col` lists the children of the ACTIVE path above it, so the path's\n // node at that depth is on screen only while the two agree that far down.\n if (!this.pathsEqual(path.slice(0, col), active.slice(0, col))) continue;\n if (enabledAt(col, path[col])) return { col, value: path[col] };\n }\n\n const first = cols[0]?.find(o => !o.disabled);\n return first ? { col: 0, value: first.value } : null;\n });\n\n /** Letters typed in quick succession, for type-ahead. */\n private typeahead = '';\n private typeaheadAt = 0;\n\n /** Panel id used by the trigger's `aria-controls`. */\n protected readonly panelId = `wr-cascader-panel-${++panelUid}`;\n\n /**\n * Columns visible in the panel. Each column shows the children of the\n * preceding activePath entry. Column 0 = root options. The last\n * column is whatever the deepest active node's children resolve to —\n * we only render a column when there are children to show.\n */\n protected readonly columns = computed<readonly (readonly WrCascaderOption<T>[])[]>(() => {\n const cols: (readonly WrCascaderOption<T>[])[] = [this.options()];\n const trail = this.activePath();\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of trail) {\n const node = list.find(o => o.value === v);\n if (!node?.children?.length) break;\n cols.push(node.children);\n list = node.children;\n }\n return cols;\n });\n\n /** Label trail joined by `separator()` — what the trigger shows. */\n protected readonly displayLabel = computed(() => {\n const p = this.path();\n if (p.length === 0) return null;\n const labels: string[] = [];\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of p) {\n const node = list.find(o => o.value === v);\n if (!node) return null;\n labels.push(node.label);\n list = node.children ?? [];\n }\n const sep = ` ${this.separator()} `;\n return labels.join(sep);\n });\n\n protected readonly hasSelection = computed(() => this.path().length > 0);\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-cascader--${size}`);\n if (this.isOpen()) parts.push('wr-cascader--open');\n if (this.disabled()) parts.push('wr-cascader--disabled');\n else if (this.readonly()) parts.push('wr-cascader--readonly');\n return parts.join(' ');\n });\n\n protected readonly panelTpl = viewChild.required('panelTpl', { read: TemplateRef });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n /**\n * Ambient reading direction, for the open panel alone — nothing in this\n * component reads it directly. Optional so a bare `TestBed` needs no\n * provider; `Directionality` is root-provided anyway, and a missing one\n * simply reads as `ltr`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // Same contract as wr-select / wr-dropdown / wr-lightbox: an overlay lives in\n // the CDK container, not in this component's view, so destroying the\n // component while the panel is open would strand the pane and its scroll\n // strategy.\n this.destroyRef.onDestroy(() => this.closeOverlay(false));\n\n effect(() => {\n if (this.isOpen()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n\n // Close the panel if the control becomes disabled or read-only while open.\n effect(() => {\n if (this.disabled() || this.readonly()) this.isOpen.set(false);\n });\n\n // Mirror an external `value` write into the internal path/activePath\n // (the old `writeValue`). Skipped when the write merely echoes the\n // committed path, so a live drill-down can never be clobbered.\n effect(() => {\n // Coerce null/undefined/non-array to an empty path — a classic-forms\n // binding can write null, which the old `writeValue(value: unknown)`\n // treated as \"no selection\" too.\n const value = this.value();\n untracked(() => {\n const next: readonly T[] = Array.isArray(value) ? (value as readonly T[]) : [];\n if (this.pathsEqual(this.path(), next)) return;\n this.path.set(next);\n this.activePath.set(next);\n });\n });\n }\n\n /**\n * Focus the trigger — what Signal Forms calls to focus this control. The\n * panel stays shut: ArrowDown or a click opens it, the way it does after Tab.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus(options);\n }\n\n /** Open the panel on the selected path, as the trigger does. Refused while disabled or read-only. */\n open(): void {\n if (this.disabled() || this.readonly() || this.isOpen()) return;\n this.activePath.set(this.path());\n this.isOpen.set(true);\n }\n\n /** Close the panel. */\n close(): void {\n this.isOpen.set(false);\n }\n\n // Template handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n if (!this.isOpen()) this.activePath.set(this.path());\n this.isOpen.update(v => !v);\n }\n\n /**\n * ArrowDown / ArrowUp open the panel, Alt+ArrowDown included — the combobox way in,\n * and the shape `wr-dropdown`'s trigger uses. Enter and Space need no branch: the\n * trigger is a real `<button>`, so the browser turns them into the click above.\n *\n * Only while closed. Once the panel is up the caret is inside it, and its options\n * own their own keys.\n */\n protected onTriggerKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.readonly() || this.isOpen()) return;\n\n // Backspace is the × from the keyboard, and it has to be: the × is a\n // `tabindex=\"-1\"` span INSIDE this button, and a keydown goes to the focused\n // element, so the `(keydown.enter)` / `(keydown.space)` it used to carry could\n // never fire. Clearing was reachable by pointer alone — a WCAG 2.1.1 failure,\n // not a missing convenience. The span stays unfocusable, because a focusable\n // child of a button is `nested-interactive`. Same key, same gating as\n // `wr-select`: `clearable()` IS the clear control, so a consumer who turned\n // the × off did not ask for a keyboard twin of it.\n if (event.key === 'Backspace') {\n if (!this.clearable() || !this.hasSelection()) return;\n event.preventDefault();\n this.clearSelection(event);\n return;\n }\n\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n event.preventDefault();\n this.activePath.set(this.path());\n this.isOpen.set(true);\n }\n\n protected onOptionClick(colIndex: number, opt: WrCascaderOption<T>, event: Event): void {\n event.stopPropagation();\n if (opt.disabled || this.disabled() || this.readonly()) return;\n\n const head = this.activePath().slice(0, colIndex);\n const newPath = [...head, opt.value];\n\n const hasChildren = !!opt.children?.length;\n\n // Always update active column for visual feedback / next column.\n this.activePath.set(newPath);\n // A pointer click focuses the option anyway (see `onOptionFocus`); a scripted\n // `click()` does not, and the tab stop belongs where the choice was made.\n this.cursor.set({ col: colIndex, value: opt.value });\n\n // Commit when we've reached a leaf, or when changeOnSelect is on.\n if (!hasChildren || this.changeOnSelect()) {\n this.path.set(newPath);\n this.value.set(newPath);\n this.touch.emit();\n // Close once we hit a true leaf — parent commits keep the panel open.\n if (!hasChildren) this.isOpen.set(false);\n }\n }\n\n /**\n * The tree keys the panel's roles promise, per the APG tree pattern: Up / Down\n * within a column, Home / End to its ends, the inline-end arrow into a branch's\n * children — opening the next column on the way — and the inline-start arrow back\n * to the option the column belongs to, or, from a root, closing the column it\n * opened. A letter moves to the next option in the column whose label starts with\n * what was typed. Enter and Space stay the commit.\n *\n * These are the ONLY way between options: the panel holds one tab stop (see\n * {@link tabStop}), and Tab leaves it.\n */\n protected onOptionKeydown(colIndex: number, opt: WrCascaderOption<T>, event: KeyboardEvent): void {\n const current = event.currentTarget as HTMLElement;\n const column = current.closest<HTMLElement>('[role=\"group\"]');\n if (!column) return;\n // Before the modifier check, because Shift is how a capital letter is typed.\n if (wrIsPrintableKey(event) && event.key !== ' ') {\n this.typeAhead(column, current, event.key);\n event.preventDefault();\n return;\n }\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const rtl = this.dir?.value === 'rtl';\n const inward = rtl ? 'ArrowLeft' : 'ArrowRight';\n const outward = rtl ? 'ArrowRight' : 'ArrowLeft';\n const enabled = [...column.querySelectorAll<HTMLElement>('[role=\"treeitem\"]')].filter(\n o => o.getAttribute('aria-disabled') !== 'true'\n );\n const at = enabled.indexOf(current);\n\n switch (event.key) {\n case 'ArrowDown':\n enabled[at + 1]?.focus();\n break;\n case 'ArrowUp':\n if (at > 0) enabled[at - 1].focus();\n break;\n case 'Home':\n enabled[0]?.focus();\n break;\n case 'End':\n enabled[enabled.length - 1]?.focus();\n break;\n case inward: {\n if (opt.disabled || !opt.children?.length || this.disabled() || this.readonly()) break;\n this.activePath.set([...this.activePath().slice(0, colIndex), opt.value]);\n // The column is not in the DOM until the render this write schedules.\n afterNextRender(\n () =>\n this.overlayRef?.overlayElement\n .querySelector<HTMLElement>(\n `#${this.columnId(colIndex + 1)} [role=\"treeitem\"]:not([aria-disabled=\"true\"])`\n )\n ?.focus(),\n { injector: this.injector }\n );\n break;\n }\n case outward: {\n if (colIndex > 0) {\n const parent = this.parentOptionId(colIndex);\n if (parent) this.overlayRef?.overlayElement.querySelector<HTMLElement>(`#${parent}`)?.focus();\n } else if (opt.children?.length && this.isActiveAt(colIndex, opt.value)) {\n this.activePath.set([]);\n }\n break;\n }\n case ' ':\n // The commit is `(keydown.space)`'s; the page scrolling a screen under the\n // panel is the browser's, and it went with every Space on an option.\n break;\n default:\n return;\n }\n event.preventDefault();\n }\n\n /** The caret reached an option, by whatever route — the tab stop follows it. */\n protected onOptionFocus(colIndex: number, opt: WrCascaderOption<T>): void {\n if (opt.disabled) return;\n this.cursor.set({ col: colIndex, value: opt.value });\n }\n\n /** Whether this option is the panel's one `tabindex=\"0\"`. */\n protected isTabStop(colIndex: number, opt: WrCascaderOption<T>): boolean {\n const stop = this.tabStop();\n return !opt.disabled && stop !== null && stop.col === colIndex && stop.value === opt.value;\n }\n\n /**\n * Move to the next enabled option in `column` whose label starts with the letters\n * typed so far. A pause of {@link TYPEAHEAD_MS} starts a new run. One letter\n * pressed again cycles through the options that start with it; a longer run keeps\n * the option it already matches, so `g` then `e` stays on \"Germany\".\n */\n private typeAhead(column: HTMLElement, current: HTMLElement, key: string): void {\n const now = Date.now();\n this.typeahead = now - this.typeaheadAt > TYPEAHEAD_MS ? key : this.typeahead + key;\n this.typeaheadAt = now;\n\n const typed = this.typeahead.toLocaleLowerCase();\n const repeated = [...typed].every(ch => ch === typed[0]);\n const search = repeated ? typed[0] : typed;\n const enabled = [...column.querySelectorAll<HTMLElement>('[role=\"treeitem\"]')].filter(\n o => o.getAttribute('aria-disabled') !== 'true'\n );\n const from = enabled.indexOf(current);\n // A fresh letter (or a repeated one) starts AFTER the current option; a longer\n // run starts AT it, so the option that matched the first letters can keep the\n // match.\n const start = search.length === 1 ? from + 1 : Math.max(from, 0);\n const label = (o: HTMLElement): string =>\n (o.querySelector('.wr-cascader__opt-label')?.textContent ?? '').trim().toLocaleLowerCase();\n for (let i = 0; i < enabled.length; i++) {\n const candidate = enabled[(start + i) % enabled.length];\n if (label(candidate).startsWith(search)) {\n candidate.focus();\n return;\n }\n }\n }\n\n protected clearSelection(event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n this.path.set([]);\n this.activePath.set([]);\n this.value.set([]);\n this.touch.emit();\n }\n\n protected isActiveAt(colIndex: number, value: T): boolean {\n return this.activePath()[colIndex] === value;\n }\n\n /**\n * Whether this option is the committed choice — `null` when it is not a\n * choice at all.\n *\n * Two questions the panel has to keep apart, and `--active` answers only the\n * first: `activePath()` is where the user has NAVIGATED to, `path()` is what\n * they have COMMITTED. They agree once a leaf is picked and diverge for the\n * whole walk down.\n *\n * `null` — the attribute absent — on a branch while `changeOnSelect` is off,\n * because such a branch genuinely cannot be chosen; ARIA reads a missing\n * `aria-selected` as \"not selectable\", which is exactly true here. That makes\n * this binding the first expression the `changeOnSelect` contract has ever had\n * in ARIA, in both directions.\n */\n protected isSelectedAt(colIndex: number, opt: WrCascaderOption<T>): boolean | null {\n const committable = !opt.children?.length || this.changeOnSelect();\n if (!committable) return null;\n const path = this.path();\n return colIndex === path.length - 1 && path[colIndex] === opt.value;\n }\n\n /** Stable id for one option — what a column's `aria-labelledby` points at. */\n protected optionId(colIndex: number, optIndex: number): string {\n return `${this.panelId}-opt-${colIndex}-${optIndex}`;\n }\n\n /** Stable id for one column — what an expanded branch's `aria-controls` points at. */\n protected columnId(colIndex: number): string {\n return `${this.panelId}-col-${colIndex}`;\n }\n\n /**\n * The option whose children a column holds, by id — its accessible name.\n *\n * The columns are DOM SIBLINGS, so nothing in the markup says the second one\n * belongs to \"Europe\". Column 0 has no parent and stays unnamed; the tree\n * itself already carries the control's name.\n */\n protected parentOptionId(colIndex: number): string | null {\n if (colIndex === 0) return null;\n const parent = this.columns()[colIndex - 1] ?? [];\n const index = parent.findIndex(o => this.isActiveAt(colIndex - 1, o.value));\n return index < 0 ? null : this.optionId(colIndex - 1, index);\n }\n\n private pathsEqual(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n }\n\n // Overlay\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n // Each open starts from the selected path, not from where the last visit ended.\n this.cursor.set(null);\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: wrToClassList('wr-cascader-overlay', this.panelClass()),\n });\n\n // The columns cascade inline-wards, and the CDK captured the direction as a\n // string when this ref was created — so a flip while the panel is open left\n // the whole cascade running the other way from the page around it.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Move the caret into the panel it just opened. Nothing did, and the pane is\n // appended to `<body>`, so an opened cascader left focus on the trigger and its\n // options were reachable only by tabbing past the whole rest of the page —\n // `wr-tree` and `wr-context-menu` were the same defect. `closeOverlay` below\n // already assumes this is where the caret lives.\n //\n // `afterNextRender`, NOT `queueMicrotask`: under zoneless CD change detection runs\n // in a macrotask, so a microtask queued here fires before the columns are in the\n // DOM — the trap that once left `wr-calendar`'s ring and its real focus on\n // different days.\n afterNextRender(() => this.focusPanelOption(), { injector: this.injector });\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.isOpen.set(false);\n return;\n }\n if (this.overlayRef && tabLeavesPane(this.overlayRef.overlayElement, event)) {\n this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus();\n this.isOpen.set(false);\n }\n });\n\n this.opened.emit();\n }\n\n /**\n * The option the panel opens on: its tab stop, which on open is the selected path's\n * leaf, else the first enabled root (see {@link tabStop}). A disabled option is\n * never the stop, so `focus()` cannot land on a choice nobody can make.\n */\n private focusPanelOption(): void {\n this.overlayRef?.overlayElement.querySelector<HTMLElement>('[role=\"treeitem\"][tabindex=\"0\"]')?.focus();\n }\n\n /** `notify: false` is the destroy path: an output cannot emit from a destroyed view. */\n private closeOverlay(notify = true): void {\n if (!this.overlayRef) return;\n // Opening moves the caret onto the panel's tab stop and every option commits\n // on Enter, so on the keyboard the caret is INSIDE the pane by design — and\n // the ordinary way to finish choosing (`onOptionClick` on a leaf) closes it.\n // Disposing without handing focus back dropped it on `<body>` on the SUCCESS\n // path, not merely on dismissal: a keyboard user who had just picked a value\n // then had to Tab from the top of the document to get back to the control.\n // Untouched when focus had already moved elsewhere — that click is usually\n // what closed us, and stealing the caret back would fight the user for it.\n const pane = this.overlayRef.overlayElement;\n const focusWasInside = pane.contains(this.host.nativeElement.ownerDocument.activeElement);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (!notify) return;\n if (focusWasInside) this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus();\n this.closed.emit();\n }\n}\n\nexport type { WrCascaderOption } from './types';\n","<button\n type=\"button\"\n class=\"wr-cascader__trigger\"\n role=\"combobox\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [disabled]=\"disabled()\"\n [attr.aria-haspopup]=\"'tree'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (blur)=\"touch.emit()\"\n>\n @if (displayLabel(); as label) {\n <span class=\"wr-cascader__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-cascader__placeholder\">{{ placeholder() }}</span>\n }\n\n @if (clearable() && hasSelection() && !disabled() && !readonly()) {\n <span\n class=\"wr-cascader__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClearLabel()\"\n tabindex=\"-1\"\n (click)=\"clearSelection($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-cascader__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n</button>\n\n<ng-template #panelTpl>\n <div\n class=\"wr-cascader-panel\"\n [class.wr-cascader-panel--sm]=\"size() === 'sm'\"\n [class.wr-cascader-panel--lg]=\"size() === 'lg'\"\n role=\"tree\"\n [attr.id]=\"panelId\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <!--\n tree / group / treeitem, and NOT menu. A combobox's popup may be a listbox,\n a tree, a grid or a dialog and nothing else, so `aria-haspopup=\"menu\"` on\n the trigger was an author error — and a `menu` may own menuitems and\n groups, never other menus, so the columns were a second one. Neither is\n visible to axe: `menu` is a valid token for the global `aria-haspopup`, and\n `aria-required-children` passes a menu-inside-menu (measured against this\n exact fragment). A tree is what this control has always been — the value is\n a PATH, and only `treeitem` supports aria-expanded, aria-level,\n aria-setsize, aria-posinset and aria-selected at once.\n\n The columns stay `group` rather than collapsing to `role=\"presentation\"`,\n which is also axe-clean: the DOM is column-MAJOR, so a flat tree would\n leave level plus document order as the only structure, and \"Germany\"\n (level 2) would read as a child of \"Antarctica\" (level 1, the item\n immediately before it in source order).\n -->\n @for (col of columns(); track $index; let colIndex = $index) {\n <ul\n class=\"wr-cascader__col\"\n role=\"group\"\n [attr.id]=\"columnId(colIndex)\"\n [attr.aria-labelledby]=\"parentOptionId(colIndex)\"\n >\n @for (opt of col; track opt.value; let optIndex = $index) {\n <!--\n `aria-expanded` is exactly `isActiveAt`: `columns()` renders the next\n column for the active option and only when it has children, so the\n state can never claim a column that is not on screen — and\n `aria-controls` rides that same invariant, which is what makes\n \"expanded\" refer to something when the expanded content is a SIBLING\n rather than a descendant. It is emitted only while expanded: a\n reference to an absent id is a violation with `aria-expanded=\"true\"`\n and clean while collapsed.\n\n `aria-level` is load-bearing rather than decorative. The columns are\n siblings, so the DOM ancestry represents no level at all and every\n option would read as level 1. `aria-setsize` / `aria-posinset` are\n not strictly required — each column IS a complete sibling set — and\n are written anyway, because a tree that owns sibling groups is the\n uncommon shape where browser/AT pairs are known to miscompute both.\n\n `aria-selected` is written on every option that can be COMMITTED,\n `false` included, matching `wr-tree`. The alternative a reviewer may\n prefer: only the selected node, leaning on treeitem's implicit false,\n which is quieter in a long column and loses the \"this row is\n selectable\" signal that presence carries.\n\n `tabindex` is a ROVING stop, as in the APG tree pattern: one option\n carries `0` (see `tabStop`) and every other one `-1`, so the panel is\n one Tab to enter and one to leave, and the arrows move between options.\n -->\n <li\n class=\"wr-cascader__opt\"\n role=\"treeitem\"\n [attr.id]=\"optionId(colIndex, optIndex)\"\n [class.wr-cascader__opt--active]=\"isActiveAt(colIndex, opt.value)\"\n [class.wr-cascader__opt--disabled]=\"opt.disabled\"\n [attr.tabindex]=\"isTabStop(colIndex, opt) ? 0 : -1\"\n [attr.aria-disabled]=\"opt.disabled ? true : null\"\n [attr.aria-level]=\"colIndex + 1\"\n [attr.aria-setsize]=\"$count\"\n [attr.aria-posinset]=\"optIndex + 1\"\n [attr.aria-selected]=\"isSelectedAt(colIndex, opt)\"\n [attr.aria-expanded]=\"opt.children?.length ? isActiveAt(colIndex, opt.value) : null\"\n [attr.aria-controls]=\"\n opt.children?.length && isActiveAt(colIndex, opt.value) ? columnId(colIndex + 1) : null\n \"\n (click)=\"onOptionClick(colIndex, opt, $event)\"\n (focus)=\"onOptionFocus(colIndex, opt)\"\n (keydown)=\"onOptionKeydown(colIndex, opt, $event)\"\n (keydown.enter)=\"onOptionClick(colIndex, opt, $event)\"\n (keydown.space)=\"onOptionClick(colIndex, opt, $event)\"\n >\n <span class=\"wr-cascader__opt-label\">{{ opt.label }}</span>\n @if (opt.children?.length) {\n <svg\n class=\"wr-icon__svg wr-cascader__opt-arrow\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n }\n </li>\n }\n </ul>\n }\n </div>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,IAAI,WAAW;AAgBf,SAAS,cAAc,MAAmB,OAAoB;CAC5D,IAAI,MAAM,QAAQ,SAAS,MAAM,oBAAoB,MAAM,UAAU,MAAM,WAAW,MAAM,SAAS,OAAO;CAC5G,MAAM,SAAS,KAAK,cAAc;CAClC,OAAO,CAAC,CAAC,UAAU,KAAK,SAAS,MAAM;AACzC;AAGA,MAAM,eAAe;AA8CrB,IAAa,aAAb,MAAa,WAAU;CAEZ,aAAa,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAE7B,qBAAqB,YAAY,KAAK,YAAY,yBAAyB,iBAAiB;CAGtG,UAAU,MAAM,SAA0C,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAG1D,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAO/B,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE9B,YAAY,YAAY,KAAK,WAAW,gBAAgB,QAAQ;CAC9D,oBAAoB,eAAc;EAEnD,MAAM,WAAW,KAAK,UAAS;EAC/B,IAAI,UAAU,OAAO;EACrB,MAAM,cAAc,KAAK,YAAW;EACpC,OAAO,cAAc,cAAc,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7 +3,7 @@ import { Component, DestroyRef, ElementRef, ViewEncapsulation, afterNextRender,
|
|
|
3
3
|
import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
|
|
4
4
|
import { wrCheckStyles } from "ngwr/utils";
|
|
5
5
|
import { useI18nFormatter, useI18nText } from "ngwr/i18n";
|
|
6
|
-
import {
|
|
6
|
+
import { wrDateLocale } from "ngwr/date";
|
|
7
7
|
import { WrChartTable, useChartNumbers } from "ngwr/charts/core";
|
|
8
8
|
import { useChartTooltip } from "ngwr/popover";
|
|
9
9
|
/**
|
|
@@ -71,7 +71,10 @@ var WrCalendarHeatmap = class WrCalendarHeatmap {
|
|
|
71
71
|
daysEl = viewChild("days", ...ngDevMode ? [{ debugName: "daysEl" }] : /* istanbul ignore next */ []);
|
|
72
72
|
gridEl = viewChild("grid", ...ngDevMode ? [{ debugName: "gridEl" }] : /* istanbul ignore next */ []);
|
|
73
73
|
scrollable = signal(false, ...ngDevMode ? [{ debugName: "scrollable" }] : /* istanbul ignore next */ []);
|
|
74
|
-
|
|
74
|
+
dateLocale = wrDateLocale();
|
|
75
|
+
get locale() {
|
|
76
|
+
return this.dateLocale();
|
|
77
|
+
}
|
|
75
78
|
weekdayLabels = computed(() => {
|
|
76
79
|
const formatter = new Intl.DateTimeFormat(this.locale, { weekday: "short" });
|
|
77
80
|
const sunday = new Date(2024, 0, 7);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-charts-calendar-heatmap.mjs","names":[],"sources":["../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.ts","../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.html"],"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, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartTable, type WrChartTableData, useChartNumbers } from 'ngwr/charts/core';\nimport { WR_DATE_LOCALE } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrHeatmapDatum } from './types';\n\ninterface Cell {\n readonly iso: string;\n /** The day as the reader's locale writes it — see `cellTitle`. */\n readonly date: Date;\n readonly value: number;\n readonly intensity: number;\n readonly week: number;\n readonly day: number;\n}\n\nfunction toIso(d: Date): string {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const day = String(d.getDate()).padStart(2, '0');\n return `${y}-${m}-${day}`;\n}\n\nfunction parseInput(value: string | Date): Date {\n return value instanceof Date ? new Date(value) : new Date(`${value}T00:00:00`);\n}\n\n/** Which rows carry a weekday label: three of seven, or they do not fit. */\nconst LABELLED_ROWS = new Set([1, 3, 5]);\n\n/**\n * A day's contribution, with anything non-finite read as `0`.\n *\n * One `NaN` used to flatten the entire rendered window rather than its own day:\n * `Math.max(a, NaN)` is `NaN`, so the data set's maximum became `NaN`, `max > 0`\n * was false, and every cell fell to intensity 0 — a map that reads as a stretch\n * with no activity at all. The bad day also printed the literal text `NaN` in its\n * `title`.\n */\nfunction amount(raw: number): number {\n return Number.isFinite(raw) ? raw : 0;\n}\n\n/**\n * GitHub-style year-grid heatmap. One column per ISO week, one row per\n * weekday — cells coloured by `value` relative to the data set's max.\n *\n * **A year does not reflow.** Its 53 columns are a fixed cell size, so in a container\n * narrower than the grid the host scrolls sideways. While it does, it is a tab stop with\n * the shared focus ring, so the keyboard can scroll it too — WebKit makes no scroller\n * focusable by itself — and it opens on the inline END, the newest weeks, rather than on\n * the oldest. The stop carries no name of its own: focus lands on the grid's picture,\n * named by `ariaLabel`.\n *\n * **What a screen reader gets.** The grid is one named `role=\"img\"` and every square is\n * hidden, so the days' values are not in text anywhere unless `dataTable` renders them;\n * without it, say what the year shows in `ariaLabel`.\n *\n * @example\n * ```html\n * <wr-calendar-heatmap [data]=\"contributions\" />\n * <wr-calendar-heatmap [data]=\"data\" [endDate]=\"today\" [weeks]=\"26\" color=\"#10b981\" />\n * ```\n *\n * @see https://ngwr.dev/charts/calendar-heatmap\n */\n@Component({\n selector: 'wr-calendar-heatmap',\n templateUrl: './calendar-heatmap.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-calendar-heatmap',\n // A tab stop only while the year is wider than its container: see `scrollable`.\n '[attr.tabindex]': 'scrollable() ? 0 : null',\n },\n imports: [WrChartTable],\n})\nexport class WrCalendarHeatmap {\n /**\n * One entry per day — `{ date, value }`. Days you pass nothing for render as\n * empty cells, so a sparse array is the normal shape rather than a gap.\n */\n readonly data = input<readonly WrHeatmapDatum[]>([]);\n\n /**\n * Accessible name of the whole grid. Its cells are bare spans whose `title` a screen\n * reader on a role-less element does not read, so the map used to be several hundred\n * anonymous nodes with no name. Falls back to `calendarHeatmap.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'calendarHeatmap.label', 'Calendar heatmap');\n\n private readonly cellText = useI18nFormatter('calendarHeatmap.cell', '{{date}}: {{count}}');\n\n /**\n * A cell's tooltip, with both halves formatted and the sentence in the catalog.\n *\n * It used to be `` `${cell.iso}: ${cell.value}` `` — a raw ISO date beside an\n * unformatted number, joined by a hard-coded `': '`. Three things were wrong\n * at once and none of them are visible from the template: `2026-09-10` is not\n * how most of the world writes a date, `1234` is not how every locale groups\n * digits (`ar-SA` does not even use these ones), and the separator and order\n * were frozen into a shape a translator could not reach.\n *\n * Both halves go through `Intl`: the date in `WR_DATE_LOCALE`, which the weekday\n * and month labels use too and which follows Angular's `LOCALE_ID` unless\n * `withDates()` pins it, and the count in `LOCALE_ID` itself — or through\n * `valueFormat` — as every chart writes its numbers. The key ships as\n * `{{date}}: {{count}}` everywhere, so nothing reorders today and every locale can.\n */\n protected cellTitle(cell: { readonly date: Date; readonly value: number }): string {\n return this.cellText({ date: this.dateFormat().format(cell.date), count: this.numbers.value(cell.value) });\n }\n\n /**\n * The formatters, built once. They were built per call, and with `tooltip` off\n * the template asks for every square's title on every pass — so each `mousemove`\n * over the grid, which still marks the view for check, built 740 of them: 44,400\n * for 60 moves, measured in dev mode at 907–931ms against 348–358ms with the\n * tooltip on.\n */\n private readonly dateFormat = computed(() => new Intl.DateTimeFormat(this.locale, { dateStyle: 'medium' }));\n\n /**\n * Every square's `title`, and only while the tooltip is off — the tooltip carries the\n * same sentence, and the browser would open a second copy a moment later. Worked out\n * when the days or the catalog change, not on every pass of the template.\n */\n protected readonly titles = computed(() => (this.tooltip() ? null : this.cells().map(cell => this.cellTitle(cell))));\n\n /** Last day to render. @default today */\n readonly endDate = input<string | Date | null>(null);\n\n /** Number of weeks (columns) to render. @default 53 */\n readonly weeks = input(53, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 53)) });\n\n /** Cell side in CSS pixels. @default 11 */\n readonly cellSize = input(11, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 11)) });\n\n /** Pixel gap between cells. @default 2 */\n readonly cellGap = input(2, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 2)) });\n\n /** Cell fill colour at full intensity. @default 'var(--wr-color-primary)' */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /** Background colour for zero-value days. @default color-mix(in srgb, var(--wr-border-base) 50%, transparent) */\n readonly emptyColor = input<string>('color-mix(in srgb, var(--wr-border-base) 50%, transparent)');\n\n /** Show the weekday + month labels around the grid. @default true */\n readonly showLabels = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the day and its count on hover. It is the sentence the\n * square's `title` carried, so the `title` is written only while this is off —\n * or the browser would open a second copy a moment later. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes each day's count in the tooltip, the `title` and the data table. `null` uses\n * `Intl.NumberFormat` in `LOCALE_ID`.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /**\n * Render the days' values as a table that only assistive technology reaches: a row per\n * week, headed by its dates, and a column per weekday, each day's count written the way\n * the tooltip writes it. A day after the last one drawn is an empty cell.\n *\n * The grid is one named `role=\"img\"`, which hides everything inside it, so without the\n * table the values are nowhere a screen reader can walk. It is rendered beside the grid,\n * clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /** A day's count as the tooltip, the `title` and the data table write it, in `LOCALE_ID`: never compact. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly daysEl = viewChild<ElementRef<HTMLElement>>('days');\n\n private readonly gridEl = viewChild<ElementRef<HTMLElement>>('grid');\n\n /**\n * Whether the year is wider than the host, which then scrolls it — and is a tab stop\n * while it does. `axe`'s `scrollable-region-focusable` named the scroller with no stop\n * at all, and in WebKit, which makes no scroller focusable by itself, a keyboard could\n * not reach the newest weeks. Measured in the browser after render and on every resize;\n * `false` on the server and in jsdom, which lay nothing out.\n */\n protected readonly scrollable = signal(false);\n\n private readonly locale = inject(WR_DATE_LOCALE);\n\n /**\n * Weekday names from the locale rather than a hard-coded English list — the row order is\n * Sunday-first, matching the grid's own alignment, so 7 Jan 2024 (a Sunday) is the\n * reference. Rows without a label stay blank on purpose: seven labels do not fit.\n */\n protected readonly weekdayLabels = computed<readonly string[]>(() => {\n const formatter = new Intl.DateTimeFormat(this.locale, { weekday: 'short' });\n const sunday = new Date(2024, 0, 7);\n return Array.from({ length: 7 }, (_, row) => {\n if (!LABELLED_ROWS.has(row)) return '';\n const day = new Date(sunday);\n day.setDate(sunday.getDate() + row);\n return formatter.format(day);\n });\n });\n\n private readonly monthNames = computed<readonly string[]>(() => {\n const formatter = new Intl.DateTimeFormat(this.locale, { month: 'short' });\n return Array.from({ length: 12 }, (_, month) => formatter.format(new Date(2024, month, 15)));\n });\n\n protected readonly cells = computed<readonly Cell[]>(() => {\n const end = this.endDate() ? parseInput(this.endDate()!) : new Date();\n end.setHours(0, 0, 0, 0);\n const weeks = this.weeks();\n\n // Build value lookup.\n const map = new Map<string, number>();\n for (const d of this.data()) {\n const iso = toIso(parseInput(d.date));\n map.set(iso, (map.get(iso) ?? 0) + amount(d.value));\n }\n const max = [...map.values()].reduce((a, b) => Math.max(a, b), 0);\n\n // Walk backwards from end day; arrange into columns by week, rows by weekday.\n const out: Cell[] = [];\n // Exactly `weeks` columns, the last of them the week `end` falls in, every\n // column starting on a Sunday (matches GitHub).\n //\n // Counted in WEEKS rather than in days. It used to allocate `weeks * 7`\n // days and then align the start back to a Sunday, which adds up to six\n // more — so any alignment at all produced one column more than asked for:\n // 54 for the default 53, with `--wr-calendar-heatmap-columns` reporting 54 and a\n // container sized from `weeks * (cellSize + cellGap)` one column short.\n const start = new Date(end);\n start.setDate(end.getDate() - end.getDay() - (weeks - 1) * 7);\n\n const cursor = new Date(start);\n let column = 0;\n while (cursor <= end) {\n for (let row = 0; row < 7; row++) {\n // Stop at `end`. The inner loop always walks a whole week, so once the\n // cursor crossed `end` mid-week it kept going to Saturday — up to six\n // days AFTER the last day to render, drawn as ordinary `value: 0`\n // squares and indistinguishable from a past day of no activity. With\n // the default that is today plus five future days.\n if (cursor > end) break;\n const iso = toIso(cursor);\n const value = map.get(iso) ?? 0;\n // Clamped at the BOTTOM as well as the top. A negative value produced a\n // negative intensity, which is not zero — so `colorFor` painted it in\n // the accent colour and `opacityFor` put it in the lightest band,\n // rendering a day of negative activity exactly like a day of light\n // activity, and unlike the empty day it should have matched. The scale\n // has no negative half; the honest floor is \"nothing\".\n const intensity = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;\n out.push({ iso, date: new Date(cursor), value, intensity, week: column, day: row });\n cursor.setDate(cursor.getDate() + 1);\n }\n column++;\n }\n return out;\n });\n\n /** Every weekday's full name, Sunday first as the rows are: the data table's columns. */\n private readonly weekdayNames = computed<readonly string[]>(() => {\n const formatter = new Intl.DateTimeFormat(this.locale, { weekday: 'long' });\n return Array.from({ length: 7 }, (_, row) => formatter.format(new Date(2024, 0, 7 + row)));\n });\n\n /**\n * The figures for `dataTable`: the grid's name as the caption, a column per weekday and\n * a row per week, headed by the week's first and last day drawn — `formatRange`, so the\n * locale writes the span its own way — and every day's count as the tooltip writes it.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const range = this.dateFormat();\n const weeks: (Cell | undefined)[][] = [];\n for (const cell of this.cells()) (weeks[cell.week] ??= [])[cell.day] = cell;\n return {\n caption: this.resolvedAriaLabel(),\n columns: this.weekdayNames(),\n groups: [\n {\n rows: weeks.map(days => {\n const drawn = days.filter((day): day is Cell => day !== undefined);\n return {\n header: range.formatRange(drawn[0].date, drawn[drawn.length - 1].date),\n cells: Array.from({ length: 7 }, (_, d) => (days[d] ? this.numbers.value(days[d].value) : '')),\n };\n }),\n },\n ],\n };\n });\n\n protected readonly monthLabels = computed(() => {\n // Pull the first cell of each visible month → render a label centered\n // over its column.\n const cells = this.cells();\n const seen = new Set<string>();\n return cells\n .filter(cell => {\n const date = new Date(`${cell.iso}T00:00:00`);\n if (date.getDate() !== 1) return false;\n const key = `${date.getFullYear()}-${date.getMonth()}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n })\n .map(cell => ({\n label: this.monthNames()[new Date(`${cell.iso}T00:00:00`).getMonth()],\n week: cell.week,\n }));\n });\n\n protected readonly columnCount = computed(() => {\n const cells = this.cells();\n return cells.length === 0 ? 0 : cells[cells.length - 1].week + 1;\n });\n\n /** Each day's position in `cells()`, for the square the pointer lands on. */\n private readonly indexByIso = computed(() => new Map(this.cells().map((cell, index) => [cell.iso, index])));\n\n /**\n * One tooltip for the whole year, pointing at the hovered day: above its square,\n * below it when there is no room above, and slid along the viewport edge for the\n * first and last weeks with the arrow still on the square. A listener on the grid\n * rather than one per square: a year is 371 of them.\n *\n * The box is the square's LAYOUT box rather than its client rect. The hovered square\n * grows by `:hover` over a transition, and a rect read part way through it would\n * move the chip by up to a fifth of a square depending on when it was measured;\n * the scale is centred, so the layout box is the rect's centre and the square's\n * own size.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const cell = this.cells()[index];\n // The squares are the container's only children, drawn in `cells()` order.\n const square = cell ? this.daysEl()?.nativeElement.children.item(index) : null;\n if (!cell || !(square instanceof HTMLElement)) return null;\n const rect = square.getBoundingClientRect();\n const width = square.offsetWidth;\n const height = square.offsetHeight;\n return {\n datum: { value: this.cellTitle(cell) },\n anchor: {\n x: (rect.left + rect.right - width) / 2,\n y: (rect.top + rect.bottom - height) / 2,\n width,\n height,\n },\n };\n });\n\n /**\n * Which square the pointer is on, from a `mousemove` on the grid. Over the gap\n * between two squares it is on none, and the tooltip starts to leave.\n */\n protected onCellsPointer(event: MouseEvent): void {\n const iso = (event.target as Element | null)?.closest<HTMLElement>('.wr-calendar-heatmap__cell')?.dataset['date'];\n const index = iso === undefined ? undefined : this.indexByIso().get(iso);\n if (index === undefined) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/calendar-heatmap');\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const destroyRef = inject(DestroyRef);\n // Measured after render, in a browser, and again whenever the host or the grid changes\n // size: the host when its container does, the grid when `weeks` or `cellSize` does.\n // The observer's first report is the first measurement, so a year that boots narrower\n // than its container opens on its newest weeks, and so does one that starts to\n // overflow later — a chart that booted hidden, a window made narrow. A host that\n // already scrolled is left where the reader put it.\n afterNextRender(() => {\n const grid = this.gridEl()?.nativeElement;\n if (typeof ResizeObserver === 'undefined') return;\n const measure = (): void => {\n const overflows = host.scrollWidth > host.clientWidth;\n if (overflows && !this.scrollable()) WrCalendarHeatmap.scrollToEnd(host);\n this.scrollable.set(overflows);\n };\n const observer = new ResizeObserver(measure);\n observer.observe(host);\n if (grid) observer.observe(grid);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n /**\n * Scrolls the host to its inline end, where the newest weeks are: the right in LTR and\n * the left under RTL, where `scrollLeft` runs from 0 down to minus the overflow. The\n * value is clamped by the browser, so either sign of the whole width lands on the end.\n */\n private static scrollToEnd(host: HTMLElement): void {\n const rtl = getComputedStyle(host).direction === 'rtl';\n host.scrollLeft = rtl ? -host.scrollWidth : host.scrollWidth;\n }\n\n protected colorFor(intensity: number): string {\n if (intensity === 0) return this.emptyColor();\n return this.color();\n }\n\n protected opacityFor(intensity: number): number {\n if (intensity === 0) return 1;\n // 4 levels — match the GitHub aesthetic.\n if (intensity < 0.25) return 0.25;\n if (intensity < 0.5) return 0.5;\n if (intensity < 0.75) return 0.75;\n return 1;\n }\n}\n\nexport type { WrHeatmapDatum } from './types';\n","<div\n #grid\n class=\"wr-calendar-heatmap__grid\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.--wr-calendar-heatmap-cell-size.px]=\"cellSize()\"\n [style.--wr-calendar-heatmap-cell-gap.px]=\"cellGap()\"\n [style.--wr-calendar-heatmap-columns]=\"columnCount()\"\n>\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__weekdays\">\n @for (label of weekdayLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__weekday\">{{ label }}</span>\n }\n </div>\n }\n\n <div #days class=\"wr-calendar-heatmap__cells\" (mousemove)=\"onCellsPointer($event)\" (mouseleave)=\"tip.leave($event)\">\n @for (cell of cells(); track cell.iso) {\n <span\n class=\"wr-calendar-heatmap__cell\"\n [style.background]=\"colorFor(cell.intensity)\"\n [style.opacity]=\"opacityFor(cell.intensity)\"\n [style.grid-column]=\"cell.week + 1\"\n [style.grid-row]=\"cell.day + 1\"\n [attr.title]=\"titles()?.[$index] ?? null\"\n [attr.data-date]=\"cell.iso\"\n [attr.data-value]=\"cell.value\"\n aria-hidden=\"true\"\n ></span>\n }\n </div>\n\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__months\">\n @for (m of monthLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__month\" [style.grid-column]=\"m.week + 1\">{{ m.label }}</span>\n }\n </div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the grid's `img` and never inside it: `img`\n makes everything it holds presentational. Clipped to nothing by its own stylesheet,\n so it takes no room, draws nothing and adds nothing to the scroll. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;AAuCA,SAAS,MAAM,GAAO;CAIpB,OAAO,GAHG,EAAE,YAGF,EAAC,GAFD,OAAO,EAAE,SAAQ,IAAK,CAAC,CAAC,CAAC,SAAS,GAAG,GAEhC,EAAC,GADJ,OAAO,EAAE,QAAO,CAAE,CAAC,CAAC,SAAS,GAAG,GACxB;AACtB;AAEA,SAAS,WAAW,OAAoB;CACtC,OAAO,iBAAiB,OAAO,IAAI,KAAK,KAAK,oBAAI,IAAI,KAAK,GAAG,MAAK,UAAW;AAC/E;AAGA,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAG;CAAG;AAAC,CAAC;AAWvC,SAAS,OAAO,KAAW;CACzB,OAAO,OAAO,SAAS,GAAG,IAAI,MAAM;AACtC;AAoCA,IAAa,oBAAb,MAAa,kBAAiB;CAKnB,OAAO,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAO3C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,yBAAyB,kBAAkB;CAE7F,WAAW,iBAAiB,wBAAwB,qBAAqB;CAkBhF,UAAU,MAAqD;EACvE,OAAO,KAAK,SAAS;GAAE,MAAM,KAAK,WAAU,CAAE,CAAC,OAAO,KAAK,IAAI;GAAG,OAAO,KAAK,QAAQ,MAAM,KAAK,KAAK;EAAC,CAAE;CAC3G;CASiB,aAAa,eAAe,IAAI,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AAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAEN,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-charts-calendar-heatmap.mjs","names":[],"sources":["../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.ts","../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.html"],"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, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartTable, type WrChartTableData, useChartNumbers } from 'ngwr/charts/core';\nimport { wrDateLocale } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrHeatmapDatum } from './types';\n\ninterface Cell {\n readonly iso: string;\n /** The day as the reader's locale writes it — see `cellTitle`. */\n readonly date: Date;\n readonly value: number;\n readonly intensity: number;\n readonly week: number;\n readonly day: number;\n}\n\nfunction toIso(d: Date): string {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const day = String(d.getDate()).padStart(2, '0');\n return `${y}-${m}-${day}`;\n}\n\nfunction parseInput(value: string | Date): Date {\n return value instanceof Date ? new Date(value) : new Date(`${value}T00:00:00`);\n}\n\n/** Which rows carry a weekday label: three of seven, or they do not fit. */\nconst LABELLED_ROWS = new Set([1, 3, 5]);\n\n/**\n * A day's contribution, with anything non-finite read as `0`.\n *\n * One `NaN` used to flatten the entire rendered window rather than its own day:\n * `Math.max(a, NaN)` is `NaN`, so the data set's maximum became `NaN`, `max > 0`\n * was false, and every cell fell to intensity 0 — a map that reads as a stretch\n * with no activity at all. The bad day also printed the literal text `NaN` in its\n * `title`.\n */\nfunction amount(raw: number): number {\n return Number.isFinite(raw) ? raw : 0;\n}\n\n/**\n * GitHub-style year-grid heatmap. One column per ISO week, one row per\n * weekday — cells coloured by `value` relative to the data set's max.\n *\n * **A year does not reflow.** Its 53 columns are a fixed cell size, so in a container\n * narrower than the grid the host scrolls sideways. While it does, it is a tab stop with\n * the shared focus ring, so the keyboard can scroll it too — WebKit makes no scroller\n * focusable by itself — and it opens on the inline END, the newest weeks, rather than on\n * the oldest. The stop carries no name of its own: focus lands on the grid's picture,\n * named by `ariaLabel`.\n *\n * **What a screen reader gets.** The grid is one named `role=\"img\"` and every square is\n * hidden, so the days' values are not in text anywhere unless `dataTable` renders them;\n * without it, say what the year shows in `ariaLabel`.\n *\n * @example\n * ```html\n * <wr-calendar-heatmap [data]=\"contributions\" />\n * <wr-calendar-heatmap [data]=\"data\" [endDate]=\"today\" [weeks]=\"26\" color=\"#10b981\" />\n * ```\n *\n * @see https://ngwr.dev/charts/calendar-heatmap\n */\n@Component({\n selector: 'wr-calendar-heatmap',\n templateUrl: './calendar-heatmap.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-calendar-heatmap',\n // A tab stop only while the year is wider than its container: see `scrollable`.\n '[attr.tabindex]': 'scrollable() ? 0 : null',\n },\n imports: [WrChartTable],\n})\nexport class WrCalendarHeatmap {\n /**\n * One entry per day — `{ date, value }`. Days you pass nothing for render as\n * empty cells, so a sparse array is the normal shape rather than a gap.\n */\n readonly data = input<readonly WrHeatmapDatum[]>([]);\n\n /**\n * Accessible name of the whole grid. Its cells are bare spans whose `title` a screen\n * reader on a role-less element does not read, so the map used to be several hundred\n * anonymous nodes with no name. Falls back to `calendarHeatmap.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'calendarHeatmap.label', 'Calendar heatmap');\n\n private readonly cellText = useI18nFormatter('calendarHeatmap.cell', '{{date}}: {{count}}');\n\n /**\n * A cell's tooltip, with both halves formatted and the sentence in the catalog.\n *\n * It used to be `` `${cell.iso}: ${cell.value}` `` — a raw ISO date beside an\n * unformatted number, joined by a hard-coded `': '`. Three things were wrong\n * at once and none of them are visible from the template: `2026-09-10` is not\n * how most of the world writes a date, `1234` is not how every locale groups\n * digits (`ar-SA` does not even use these ones), and the separator and order\n * were frozen into a shape a translator could not reach.\n *\n * Both halves go through `Intl`: the date in `WR_DATE_LOCALE`, which the weekday\n * and month labels use too and which follows Angular's `LOCALE_ID` unless\n * `withDates()` pins it, and the count in `LOCALE_ID` itself — or through\n * `valueFormat` — as every chart writes its numbers. The key ships as\n * `{{date}}: {{count}}` everywhere, so nothing reorders today and every locale can.\n */\n protected cellTitle(cell: { readonly date: Date; readonly value: number }): string {\n return this.cellText({ date: this.dateFormat().format(cell.date), count: this.numbers.value(cell.value) });\n }\n\n /**\n * The formatters, built once. They were built per call, and with `tooltip` off\n * the template asks for every square's title on every pass — so each `mousemove`\n * over the grid, which still marks the view for check, built 740 of them: 44,400\n * for 60 moves, measured in dev mode at 907–931ms against 348–358ms with the\n * tooltip on.\n */\n private readonly dateFormat = computed(() => new Intl.DateTimeFormat(this.locale, { dateStyle: 'medium' }));\n\n /**\n * Every square's `title`, and only while the tooltip is off — the tooltip carries the\n * same sentence, and the browser would open a second copy a moment later. Worked out\n * when the days or the catalog change, not on every pass of the template.\n */\n protected readonly titles = computed(() => (this.tooltip() ? null : this.cells().map(cell => this.cellTitle(cell))));\n\n /** Last day to render. @default today */\n readonly endDate = input<string | Date | null>(null);\n\n /** Number of weeks (columns) to render. @default 53 */\n readonly weeks = input(53, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 53)) });\n\n /** Cell side in CSS pixels. @default 11 */\n readonly cellSize = input(11, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 11)) });\n\n /** Pixel gap between cells. @default 2 */\n readonly cellGap = input(2, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 2)) });\n\n /** Cell fill colour at full intensity. @default 'var(--wr-color-primary)' */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /** Background colour for zero-value days. @default color-mix(in srgb, var(--wr-border-base) 50%, transparent) */\n readonly emptyColor = input<string>('color-mix(in srgb, var(--wr-border-base) 50%, transparent)');\n\n /** Show the weekday + month labels around the grid. @default true */\n readonly showLabels = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the day and its count on hover. It is the sentence the\n * square's `title` carried, so the `title` is written only while this is off —\n * or the browser would open a second copy a moment later. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes each day's count in the tooltip, the `title` and the data table. `null` uses\n * `Intl.NumberFormat` in `LOCALE_ID`.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /**\n * Render the days' values as a table that only assistive technology reaches: a row per\n * week, headed by its dates, and a column per weekday, each day's count written the way\n * the tooltip writes it. A day after the last one drawn is an empty cell.\n *\n * The grid is one named `role=\"img\"`, which hides everything inside it, so without the\n * table the values are nowhere a screen reader can walk. It is rendered beside the grid,\n * clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /** A day's count as the tooltip, the `title` and the data table write it, in `LOCALE_ID`: never compact. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly daysEl = viewChild<ElementRef<HTMLElement>>('days');\n\n private readonly gridEl = viewChild<ElementRef<HTMLElement>>('grid');\n\n /**\n * Whether the year is wider than the host, which then scrolls it — and is a tab stop\n * while it does. `axe`'s `scrollable-region-focusable` named the scroller with no stop\n * at all, and in WebKit, which makes no scroller focusable by itself, a keyboard could\n * not reach the newest weeks. Measured in the browser after render and on every resize;\n * `false` on the server and in jsdom, which lay nothing out.\n */\n protected readonly scrollable = signal(false);\n\n private readonly dateLocale = wrDateLocale();\n\n private get locale(): string {\n return this.dateLocale();\n }\n\n /**\n * Weekday names from the locale rather than a hard-coded English list — the row order is\n * Sunday-first, matching the grid's own alignment, so 7 Jan 2024 (a Sunday) is the\n * reference. Rows without a label stay blank on purpose: seven labels do not fit.\n */\n protected readonly weekdayLabels = computed<readonly string[]>(() => {\n const formatter = new Intl.DateTimeFormat(this.locale, { weekday: 'short' });\n const sunday = new Date(2024, 0, 7);\n return Array.from({ length: 7 }, (_, row) => {\n if (!LABELLED_ROWS.has(row)) return '';\n const day = new Date(sunday);\n day.setDate(sunday.getDate() + row);\n return formatter.format(day);\n });\n });\n\n private readonly monthNames = computed<readonly string[]>(() => {\n const formatter = new Intl.DateTimeFormat(this.locale, { month: 'short' });\n return Array.from({ length: 12 }, (_, month) => formatter.format(new Date(2024, month, 15)));\n });\n\n protected readonly cells = computed<readonly Cell[]>(() => {\n const end = this.endDate() ? parseInput(this.endDate()!) : new Date();\n end.setHours(0, 0, 0, 0);\n const weeks = this.weeks();\n\n // Build value lookup.\n const map = new Map<string, number>();\n for (const d of this.data()) {\n const iso = toIso(parseInput(d.date));\n map.set(iso, (map.get(iso) ?? 0) + amount(d.value));\n }\n const max = [...map.values()].reduce((a, b) => Math.max(a, b), 0);\n\n // Walk backwards from end day; arrange into columns by week, rows by weekday.\n const out: Cell[] = [];\n // Exactly `weeks` columns, the last of them the week `end` falls in, every\n // column starting on a Sunday (matches GitHub).\n //\n // Counted in WEEKS rather than in days. It used to allocate `weeks * 7`\n // days and then align the start back to a Sunday, which adds up to six\n // more — so any alignment at all produced one column more than asked for:\n // 54 for the default 53, with `--wr-calendar-heatmap-columns` reporting 54 and a\n // container sized from `weeks * (cellSize + cellGap)` one column short.\n const start = new Date(end);\n start.setDate(end.getDate() - end.getDay() - (weeks - 1) * 7);\n\n const cursor = new Date(start);\n let column = 0;\n while (cursor <= end) {\n for (let row = 0; row < 7; row++) {\n // Stop at `end`. The inner loop always walks a whole week, so once the\n // cursor crossed `end` mid-week it kept going to Saturday — up to six\n // days AFTER the last day to render, drawn as ordinary `value: 0`\n // squares and indistinguishable from a past day of no activity. With\n // the default that is today plus five future days.\n if (cursor > end) break;\n const iso = toIso(cursor);\n const value = map.get(iso) ?? 0;\n // Clamped at the BOTTOM as well as the top. A negative value produced a\n // negative intensity, which is not zero — so `colorFor` painted it in\n // the accent colour and `opacityFor` put it in the lightest band,\n // rendering a day of negative activity exactly like a day of light\n // activity, and unlike the empty day it should have matched. The scale\n // has no negative half; the honest floor is \"nothing\".\n const intensity = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;\n out.push({ iso, date: new Date(cursor), value, intensity, week: column, day: row });\n cursor.setDate(cursor.getDate() + 1);\n }\n column++;\n }\n return out;\n });\n\n /** Every weekday's full name, Sunday first as the rows are: the data table's columns. */\n private readonly weekdayNames = computed<readonly string[]>(() => {\n const formatter = new Intl.DateTimeFormat(this.locale, { weekday: 'long' });\n return Array.from({ length: 7 }, (_, row) => formatter.format(new Date(2024, 0, 7 + row)));\n });\n\n /**\n * The figures for `dataTable`: the grid's name as the caption, a column per weekday and\n * a row per week, headed by the week's first and last day drawn — `formatRange`, so the\n * locale writes the span its own way — and every day's count as the tooltip writes it.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const range = this.dateFormat();\n const weeks: (Cell | undefined)[][] = [];\n for (const cell of this.cells()) (weeks[cell.week] ??= [])[cell.day] = cell;\n return {\n caption: this.resolvedAriaLabel(),\n columns: this.weekdayNames(),\n groups: [\n {\n rows: weeks.map(days => {\n const drawn = days.filter((day): day is Cell => day !== undefined);\n return {\n header: range.formatRange(drawn[0].date, drawn[drawn.length - 1].date),\n cells: Array.from({ length: 7 }, (_, d) => (days[d] ? this.numbers.value(days[d].value) : '')),\n };\n }),\n },\n ],\n };\n });\n\n protected readonly monthLabels = computed(() => {\n // Pull the first cell of each visible month → render a label centered\n // over its column.\n const cells = this.cells();\n const seen = new Set<string>();\n return cells\n .filter(cell => {\n const date = new Date(`${cell.iso}T00:00:00`);\n if (date.getDate() !== 1) return false;\n const key = `${date.getFullYear()}-${date.getMonth()}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n })\n .map(cell => ({\n label: this.monthNames()[new Date(`${cell.iso}T00:00:00`).getMonth()],\n week: cell.week,\n }));\n });\n\n protected readonly columnCount = computed(() => {\n const cells = this.cells();\n return cells.length === 0 ? 0 : cells[cells.length - 1].week + 1;\n });\n\n /** Each day's position in `cells()`, for the square the pointer lands on. */\n private readonly indexByIso = computed(() => new Map(this.cells().map((cell, index) => [cell.iso, index])));\n\n /**\n * One tooltip for the whole year, pointing at the hovered day: above its square,\n * below it when there is no room above, and slid along the viewport edge for the\n * first and last weeks with the arrow still on the square. A listener on the grid\n * rather than one per square: a year is 371 of them.\n *\n * The box is the square's LAYOUT box rather than its client rect. The hovered square\n * grows by `:hover` over a transition, and a rect read part way through it would\n * move the chip by up to a fifth of a square depending on when it was measured;\n * the scale is centred, so the layout box is the rect's centre and the square's\n * own size.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const cell = this.cells()[index];\n // The squares are the container's only children, drawn in `cells()` order.\n const square = cell ? this.daysEl()?.nativeElement.children.item(index) : null;\n if (!cell || !(square instanceof HTMLElement)) return null;\n const rect = square.getBoundingClientRect();\n const width = square.offsetWidth;\n const height = square.offsetHeight;\n return {\n datum: { value: this.cellTitle(cell) },\n anchor: {\n x: (rect.left + rect.right - width) / 2,\n y: (rect.top + rect.bottom - height) / 2,\n width,\n height,\n },\n };\n });\n\n /**\n * Which square the pointer is on, from a `mousemove` on the grid. Over the gap\n * between two squares it is on none, and the tooltip starts to leave.\n */\n protected onCellsPointer(event: MouseEvent): void {\n const iso = (event.target as Element | null)?.closest<HTMLElement>('.wr-calendar-heatmap__cell')?.dataset['date'];\n const index = iso === undefined ? undefined : this.indexByIso().get(iso);\n if (index === undefined) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/calendar-heatmap');\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const destroyRef = inject(DestroyRef);\n // Measured after render, in a browser, and again whenever the host or the grid changes\n // size: the host when its container does, the grid when `weeks` or `cellSize` does.\n // The observer's first report is the first measurement, so a year that boots narrower\n // than its container opens on its newest weeks, and so does one that starts to\n // overflow later — a chart that booted hidden, a window made narrow. A host that\n // already scrolled is left where the reader put it.\n afterNextRender(() => {\n const grid = this.gridEl()?.nativeElement;\n if (typeof ResizeObserver === 'undefined') return;\n const measure = (): void => {\n const overflows = host.scrollWidth > host.clientWidth;\n if (overflows && !this.scrollable()) WrCalendarHeatmap.scrollToEnd(host);\n this.scrollable.set(overflows);\n };\n const observer = new ResizeObserver(measure);\n observer.observe(host);\n if (grid) observer.observe(grid);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n /**\n * Scrolls the host to its inline end, where the newest weeks are: the right in LTR and\n * the left under RTL, where `scrollLeft` runs from 0 down to minus the overflow. The\n * value is clamped by the browser, so either sign of the whole width lands on the end.\n */\n private static scrollToEnd(host: HTMLElement): void {\n const rtl = getComputedStyle(host).direction === 'rtl';\n host.scrollLeft = rtl ? -host.scrollWidth : host.scrollWidth;\n }\n\n protected colorFor(intensity: number): string {\n if (intensity === 0) return this.emptyColor();\n return this.color();\n }\n\n protected opacityFor(intensity: number): number {\n if (intensity === 0) return 1;\n // 4 levels — match the GitHub aesthetic.\n if (intensity < 0.25) return 0.25;\n if (intensity < 0.5) return 0.5;\n if (intensity < 0.75) return 0.75;\n return 1;\n }\n}\n\nexport type { WrHeatmapDatum } from './types';\n","<div\n #grid\n class=\"wr-calendar-heatmap__grid\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.--wr-calendar-heatmap-cell-size.px]=\"cellSize()\"\n [style.--wr-calendar-heatmap-cell-gap.px]=\"cellGap()\"\n [style.--wr-calendar-heatmap-columns]=\"columnCount()\"\n>\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__weekdays\">\n @for (label of weekdayLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__weekday\">{{ label }}</span>\n }\n </div>\n }\n\n <div #days class=\"wr-calendar-heatmap__cells\" (mousemove)=\"onCellsPointer($event)\" (mouseleave)=\"tip.leave($event)\">\n @for (cell of cells(); track cell.iso) {\n <span\n class=\"wr-calendar-heatmap__cell\"\n [style.background]=\"colorFor(cell.intensity)\"\n [style.opacity]=\"opacityFor(cell.intensity)\"\n [style.grid-column]=\"cell.week + 1\"\n [style.grid-row]=\"cell.day + 1\"\n [attr.title]=\"titles()?.[$index] ?? null\"\n [attr.data-date]=\"cell.iso\"\n [attr.data-value]=\"cell.value\"\n aria-hidden=\"true\"\n ></span>\n }\n </div>\n\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__months\">\n @for (m of monthLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__month\" [style.grid-column]=\"m.week + 1\">{{ m.label }}</span>\n }\n </div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the grid's `img` and never inside it: `img`\n makes everything it holds presentational. Clipped to nothing by its own stylesheet,\n so it takes no room, draws nothing and adds nothing to the scroll. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;AAuCA,SAAS,MAAM,GAAO;CAIpB,OAAO,GAHG,EAAE,YAGF,EAAC,GAFD,OAAO,EAAE,SAAQ,IAAK,CAAC,CAAC,CAAC,SAAS,GAAG,GAEhC,EAAC,GADJ,OAAO,EAAE,QAAO,CAAE,CAAC,CAAC,SAAS,GAAG,GACxB;AACtB;AAEA,SAAS,WAAW,OAAoB;CACtC,OAAO,iBAAiB,OAAO,IAAI,KAAK,KAAK,oBAAI,IAAI,KAAK,GAAG,MAAK,UAAW;AAC/E;AAGA,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAG;CAAG;AAAC,CAAC;AAWvC,SAAS,OAAO,KAAW;CACzB,OAAO,OAAO,SAAS,GAAG,IAAI,MAAM;AACtC;AAoCA,IAAa,oBAAb,MAAa,kBAAiB;CAKnB,OAAO,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAO3C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,yBAAyB,kBAAkB;CAE7F,WAAW,iBAAiB,wBAAwB,qBAAqB;CAkBhF,UAAU,MAAqD;EACvE,OAAO,KAAK,SAAS;GAAE,MAAM,KAAK,WAAU,CAAE,CAAC,OAAO,KAAK,IAAI;GAAG,OAAO,KAAK,QAAQ,MAAM,KAAK,KAAK;EAAC,CAAE;CAC3G;CASiB,aAAa,eAAe,IAAI,KAA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AA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAEN,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -62,7 +62,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
62
62
|
ariaInvalid = computed(() => this.group ? null : this.fieldAria.ariaInvalid(), ...ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []);
|
|
63
63
|
describedBy = computed(() => this.group ? null : this.fieldAria.describedBy(), ...ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []);
|
|
64
64
|
classes = computed(() => {
|
|
65
|
-
const parts = [
|
|
65
|
+
const parts = [];
|
|
66
66
|
const size = this.size();
|
|
67
67
|
if (size !== "md") parts.push(`wr-checkbox--${size}`);
|
|
68
68
|
if (this.indeterminate()) parts.push("wr-checkbox--indeterminate");
|
|
@@ -184,11 +184,14 @@ var WrCheckbox = class WrCheckbox {
|
|
|
184
184
|
checked: "checkedChange",
|
|
185
185
|
touch: "touch"
|
|
186
186
|
},
|
|
187
|
-
host: {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
host: {
|
|
188
|
+
properties: {
|
|
189
|
+
"class": "classes()",
|
|
190
|
+
"attr.id": "null",
|
|
191
|
+
"attr.data-checkbox-value": "reflectedValue()"
|
|
192
|
+
},
|
|
193
|
+
classAttribute: "wr-checkbox"
|
|
194
|
+
},
|
|
192
195
|
viewQueries: [{
|
|
193
196
|
propertyName: "native",
|
|
194
197
|
first: true,
|
|
@@ -218,6 +221,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
218
221
|
selector: "wr-checkbox",
|
|
219
222
|
encapsulation: ViewEncapsulation.None,
|
|
220
223
|
host: {
|
|
224
|
+
class: "wr-checkbox",
|
|
221
225
|
"[class]": "classes()",
|
|
222
226
|
"[attr.id]": "null",
|
|
223
227
|
"[attr.data-checkbox-value]": "reflectedValue()"
|