ngwr 16.6.0 → 16.7.1
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/avatar/styles/_index.scss +39 -0
- package/button/styles/_index.scss +45 -2
- package/checkbox/styles/_index.scss +4 -0
- package/copy-value/styles/_index.scss +4 -0
- package/dropdown/styles/_index.scss +17 -0
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +4 -3
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +171 -6
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-breadcrumbs.mjs +9 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +26 -6
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +5 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +9 -9
- package/fesm2022/ngwr-charts-core.mjs +6 -6
- package/fesm2022/ngwr-charts-donut-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-meter-group.mjs +3 -3
- package/fesm2022/ngwr-charts-radar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-scatter-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +6 -6
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +7 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +35 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +103 -53
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +40 -16
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +19 -18
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +181 -18
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-dropdown-testing.mjs +5 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +59 -16
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +6 -5
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +7 -6
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +5 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +68 -13
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +18 -16
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +30 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +100 -11
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +6 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +6 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +6 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +6 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +6 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +6 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +6 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +6 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +6 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +6 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +6 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-kk.mjs +520 -0
- package/fesm2022/ngwr-i18n-kk.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ko.mjs +6 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +6 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +6 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +6 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +6 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +6 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +6 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +6 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +6 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +8 -4
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-otp.mjs +3 -3
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +16 -15
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +9 -9
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination-testing.mjs +3 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +32 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +27 -27
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +7 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +126 -16
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +75 -10
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form.mjs +10 -6
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +255 -7
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select.mjs +28 -19
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +17 -1
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +66 -11
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-sortable-list.mjs +11 -11
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-router.mjs +89 -0
- package/fesm2022/ngwr-table-router.mjs.map +1 -0
- package/fesm2022/ngwr-table-testing.mjs +5 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +282 -43
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +11 -7
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +8 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +60 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +15 -15
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +7 -6
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +30 -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-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +18 -13
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +16 -0
- package/graph/styles/_index.scss +48 -0
- package/i18n/ar.json +4 -2
- package/i18n/cs.json +4 -2
- package/i18n/de.json +4 -2
- package/i18n/en.json +4 -2
- package/i18n/es.json +4 -2
- package/i18n/fr.json +4 -2
- package/i18n/he.json +4 -2
- package/i18n/hi.json +4 -2
- package/i18n/id.json +4 -2
- package/i18n/it.json +4 -2
- package/i18n/ja.json +4 -2
- package/i18n/kk.json +567 -0
- package/i18n/ko.json +4 -2
- package/i18n/nl.json +4 -2
- package/i18n/pl.json +4 -2
- package/i18n/pt.json +4 -2
- package/i18n/ru.json +4 -2
- package/i18n/sv.json +4 -2
- package/i18n/tr.json +4 -2
- package/i18n/uk.json +4 -2
- package/i18n/vi.json +4 -2
- package/i18n/zh-TW.json +4 -2
- package/i18n/zh.json +4 -2
- package/llms-full.txt +29 -18
- package/llms.txt +4 -1
- package/package.json +15 -7
- package/pagination/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +4 -2
- package/progress/styles/_index.scss +64 -0
- package/radio/styles/_index.scss +4 -0
- package/schematics/use/symbol-map.json +5 -0
- package/sidebar/styles/_index.scss +58 -6
- package/skills/ngwr/SKILL.md +7 -6
- package/skills/ngwr/references/catalog.md +6 -4
- package/switch/styles/_index.scss +4 -0
- package/table/styles/_index.scss +128 -32
- package/tabs/styles/_index.scss +9 -0
- package/theme/styles/_focus.scss +3 -1
- package/tour/styles/_index.scss +3 -2
- package/types/ngwr-avatar.d.ts +39 -0
- package/types/ngwr-button.d.ts +12 -0
- package/types/ngwr-date-picker-testing.d.ts +22 -0
- package/types/ngwr-date-picker.d.ts +84 -17
- package/types/ngwr-date.d.ts +51 -0
- package/types/ngwr-directives.d.ts +45 -0
- package/types/ngwr-dropdown-testing.d.ts +8 -1
- package/types/ngwr-dropdown.d.ts +29 -0
- package/types/ngwr-file-upload-testing.d.ts +10 -0
- package/types/ngwr-file-upload.d.ts +55 -1
- package/types/ngwr-form.d.ts +3 -1
- package/types/ngwr-graph-testing.d.ts +28 -1
- package/types/ngwr-graph.d.ts +53 -3
- package/types/ngwr-i18n-kk.d.ts +3 -0
- package/types/ngwr-image-cropper.d.ts +6 -0
- package/types/ngwr-pagination-testing.d.ts +8 -0
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-popover.d.ts +39 -0
- package/types/ngwr-progress.d.ts +63 -1
- package/types/ngwr-scroll.d.ts +95 -0
- package/types/ngwr-select.d.ts +31 -12
- package/types/ngwr-sidebar-testing.d.ts +21 -7
- package/types/ngwr-sidebar.d.ts +66 -4
- package/types/ngwr-table-router.d.ts +49 -0
- package/types/ngwr-table-testing.d.ts +7 -0
- package/types/ngwr-table.d.ts +185 -6
- package/types/ngwr-tabs-router.d.ts +4 -5
- package/types/ngwr-tabs-testing.d.ts +5 -1
- package/types/ngwr-tabs.d.ts +34 -1
- package/types/ngwr-utils.d.ts +13 -0
- package/types/ngwr-version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-form.mjs","names":[],"sources":["../../../projects/lib/form/form.ts","../../../projects/lib/form/form-item.ts","../../../projects/lib/form/tokens.ts","../../../projects/lib/form/form-field.ts","../../../projects/lib/form/form-field.html","../../../projects/lib/form/field-aria.ts","../../../projects/lib/form/schema.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Directive, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Lays out the fields of a form: a column with a gap by default, a wrapping\n * row with `inline`, or rows of `columns` equal columns that fall back to one\n * column when the form itself is narrow.\n *\n * @example\n * ```html\n * <form wrForm columns=\"2\">\n * <wr-form-field label=\"First name\"><input wrInput /></wr-form-field>\n * <wr-form-field label=\"Last name\"><input wrInput /></wr-form-field>\n * <wr-form-field label=\"Email\" wrFormSpan><input wrInput /></wr-form-field>\n * </form>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form\n */\n@Directive({\n selector: '[wrForm]',\n host: {\n class: 'wr-form',\n '[class.wr-form--inline]': 'inline()',\n '[class.wr-form--columns]': 'grid()',\n '[style.--wr-form-columns]': 'columns()',\n },\n})\nexport class WrForm {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * Lay the fields out in a wrapping row, aligned on their bottom edge.\n * `columns` is ignored.\n *\n * @default false\n */\n readonly inline = input(false, { transform: coerceBooleanProperty });\n\n /**\n * How many equal columns a row holds. Below a form width of `30rem` every\n * field takes a full row.\n *\n * @default 1\n */\n readonly columns = input(1, {\n transform: (value: unknown): number => Math.max(1, Math.floor(coerceNumberProperty(value, 1))),\n });\n\n protected readonly grid = computed(() => !this.inline() && this.columns() > 1);\n}\n\n/**\n * Stretches a child of `[wrForm]` over several columns: all of them with no\n * value, or the given number.\n *\n * @example\n * ```html\n * <wr-form-field label=\"Address\" wrFormSpan=\"2\"><input wrInput /></wr-form-field>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form\n */\n@Directive({\n selector: '[wrFormSpan]',\n host: { class: 'wr-form__span', '[style.--wr-form-span]': 'track()' },\n})\nexport class WrFormSpan {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * Columns to span. Empty or `'full'` takes the whole row.\n *\n * @default 'full'\n */\n readonly span = input<number | 'full', unknown>('full', {\n alias: 'wrFormSpan',\n transform: value => {\n const count = Math.floor(coerceNumberProperty(value, 0));\n return count >= 1 ? count : 'full';\n },\n });\n\n protected readonly track = computed(() => {\n const span = this.span();\n return span === 'full' ? '1 / -1' : `span ${span}`;\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Wraps a label + control + error message into a single field row.\n *\n * Toggle `hasError` to apply error styling to the projected label and\n * any descendant input / textarea / checkbox.\n *\n * @example\n * ```html\n * <wr-form-item [hasError]=\"form.controls.email.invalid\">\n * <label>Email</label>\n * <input wrInput formControlName=\"email\" />\n * <wr-form-error>Invalid email</wr-form-error>\n * </wr-form-item>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form\n */\n@Component({\n selector: 'wr-form-item',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-form-item', '[class]': 'classes()' },\n})\nexport class WrFormItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * When `true`, applies error coloring to the projected label and inputs.\n *\n * @default false\n */\n readonly hasError = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.hasError()) parts.push('wr-form-item--error');\n return parts.join(' ');\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * What a projected control can read from its surrounding `<wr-form-field>`.\n *\n * The field renders `<label [for]>` before it can see what was projected into\n * it, so the id has to travel the other way: the control adopts the id the\n * label already points at. Doing it through DI keeps it a render-time binding,\n * which is what SSR needs — stamping the id from `afterNextRender` would leave\n * every prerendered page with a label pointing at nothing.\n */\nexport interface WrFormFieldContext {\n /** Id the field's `<label for>` points at. */\n readonly controlId: Signal<string>;\n\n /**\n * The reverse direction, for the one case the paragraph above does not cover: a\n * projected control that already carries its own `id` keeps it, and the label has\n * to follow, or `for` names an element that does not exist and the field ends up\n * with no label at all. Called during the control's construction, so the label's\n * binding still resolves in the same render pass.\n */\n adoptControlId(id: string): void;\n\n /**\n * Validator keys currently in error, once the control is touched or dirty.\n * Empty when the field is valid or has not been interacted with.\n */\n readonly errorKeys: Signal<readonly string[]>;\n\n /** Id of the element listing the visible messages, or `null` when there are none. */\n readonly describedBy: Signal<string | null>;\n\n /**\n * Id of the field's own `<label>`, or `null` when it renders none.\n *\n * For the controls `<label for>` cannot reach. `for` only binds to a LABELABLE\n * element — button, input, meter, output, progress, select, textarea — so a\n * control whose focusable part is a `div[role=\"slider\"]`, a `role=\"button\"`\n * drop zone or a radiogroup got a label pointing at nothing: measured, five of\n * the eighteen value controls resolved `for` to no element in the document at\n * all. Those point `aria-labelledby` back at this instead, which is the\n * direction that works for a role.\n */\n readonly labelId?: Signal<string | null>;\n\n /**\n * Id of the field's hint, or `null` when it is showing none — including while\n * an error has replaced it, since the two never render together and an\n * `aria-describedby` naming an absent element is an author error.\n *\n * Separate from {@link describedBy} rather than folded into it because the two\n * carry different weight: a control keyed `aria-invalid` on \"the field is\n * describing me\" would announce itself invalid for a plain hint. Compose the\n * pair with `useFormFieldAria()` instead of reading either one directly.\n *\n * Optional so an app that provides its own `WR_FORM_FIELD` keeps compiling; a\n * field without it simply describes nothing but its errors.\n */\n readonly hintId?: Signal<string | null>;\n\n /**\n * Whether the field is marked `required`. Read through `useFormFieldAria()` as\n * `aria-required`. Optional so an app that provides its own `WR_FORM_FIELD`\n * keeps compiling.\n */\n readonly required?: Signal<boolean>;\n}\n\n/** Present only inside a `<wr-form-field>`; inject with `{ optional: true }`. */\nexport const WR_FORM_FIELD = new InjectionToken<WrFormFieldContext>('WR_FORM_FIELD');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n type AfterContentChecked,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n contentChild,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n isDevMode,\n signal,\n untracked,\n} from '@angular/core';\nimport { AbstractControl, NgControl, type ValidationErrors } from '@angular/forms';\n\nimport { EMPTY, type Subscription } from 'rxjs';\n\nimport { WrI18n, useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_FORM_FIELD, type WrFormFieldContext } from './tokens';\n\nlet uid = 0;\n\n/**\n * Error keys already reported on the server. Every prerendered route and every\n * request builds its fields afresh, so the per-field memo alone would repeat one\n * warning per page; the browser keeps it per field, where it names the field the\n * developer is looking at.\n */\nconst warnedOnServer = new Set<string>();\n\n/** Validator payloads are plain objects; anything else interpolates nothing. */\nfunction toParams(error: unknown): Record<string, unknown> | undefined {\n return error && typeof error === 'object' ? (error as Record<string, unknown>) : undefined;\n}\n\n/**\n * The sentence the validator carries itself, or `null`.\n *\n * Signal Forms validators take `{ message }` and keep it on the error object, and\n * the interop `NgControl` this field reads lists that object AS IS under its\n * `kind` (`signalErrorsToValidationErrors` in `@angular/forms`), so the message\n * arrives here untouched. A custom control's parse errors take the same road in\n * both forms flavours, which is how a `wr-date-picker` refusal is read. A classic\n * validator's payload has no `message` unless the app put one there.\n */\nfunction ownMessage(error: unknown): string | null {\n const message = toParams(error)?.['message'];\n return typeof message === 'string' && message.trim() !== '' ? message : null;\n}\n\n/**\n * The two Signal Forms kinds whose spelling and payload differ from the classic\n * validator that means the same thing.\n *\n * Reactive forms emit `minlength` / `maxlength` carrying `requiredLength`;\n * Signal Forms emit `minLength` / `maxLength` carrying `minLength` / `maxLength`.\n * Restated before the catalog lookup so one `validation.minlength` entry in an\n * app's catalog answers both spellings, with `{{requiredLength}}` filled either\n * way — the message is the SAME message, one sentence about a length reached by\n * two spellings of one rule, and asking every app for two keys would only get\n * one of them written.\n */\nconst SIGNAL_FORMS_ALIASES: Readonly<Record<string, { readonly key: string; readonly from: string }>> = {\n minLength: { key: 'minlength', from: 'minLength' },\n maxLength: { key: 'maxlength', from: 'maxLength' },\n};\n\n/**\n * A Signal Forms length error, restated in the classic shape the catalog lookup\n * reads. Anything else passes through untouched.\n */\nfunction normalizeError(key: string, error: unknown): { readonly key: string; readonly error: unknown } {\n const alias = SIGNAL_FORMS_ALIASES[key];\n if (!alias) return { key, error };\n\n const params = toParams(error);\n const bound = params?.[alias.from];\n return {\n key: alias.key,\n error: bound === undefined ? error : { ...params, requiredLength: bound },\n };\n}\n\n/**\n * One error message tied to a validator key. Renders only when the parent\n * form-field has a matching error in `control.errors`, and only once the\n * control is touched or dirty.\n *\n * A keyed message CLAIMS its key: the field renders no automatic message for it,\n * so per-field markup wins over the validator's own `message` and over the app's\n * `validation.*` catalog.\n *\n * @example\n * ```html\n * <wr-form-error key=\"required\">This field is required.</wr-form-error>\n * <wr-form-error key=\"email\">That doesn't look right.</wr-form-error>\n * ```\n */\n@Component({\n selector: 'wr-form-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-form-error wr-form-field__error',\n role: 'alert',\n '[attr.data-key]': 'key() ?? null',\n '[class.wr-form-field__error--hidden]': '!visible()',\n },\n})\nexport class WrFormError {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * Validator key this message corresponds to (e.g. `'required'`).\n * Optional — without a key the message always renders, which is the\n * plain inline-error usage inside `<wr-form-item>`.\n */\n readonly key = input<string>();\n\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Whether this message is the one the current error calls for.\n *\n * The parent projects every `<wr-form-error>` through a single\n * `<ng-content select>`, which cannot filter — so each message decides for\n * itself. Without this, one invalid control rendered \"Email is required.\"\n * and \"That isn't a valid email.\" side by side, which is what the docs have\n * always described as gated behaviour.\n *\n * A keyless message always shows: that is the plain inline-error usage inside\n * `<wr-form-item>`, which has no error discovery at all.\n */\n protected readonly visible = computed(() => {\n const key = this.key();\n if (!key || !this.field) return true;\n return this.field.errorKeys().includes(key);\n });\n}\n\n/**\n * Wraps a label + control + hint + error messages into a single block —\n * the layout primitive every form ends up reinventing.\n *\n * - Auto-binds `label[for]` to the projected control via a generated id\n * (or use the form-control's `[id]` if you set one).\n * - Reads the projected control's `NgControl` to surface validation\n * errors only once the control is touched or dirty. A submit shows them\n * only by marking the controls touched, as `markAllAsTouched()` and Signal\n * Forms' `submit()` do.\n * - Optional `[required]` / `[optional]` markers next to the label.\n *\n * **ngwr ships no error texts.** Each error shows the first copy that exists for\n * it: a projected `<wr-form-error key>`, then the validator's own `message`\n * (`required(path.email, { message: 'Enter your email.' })`), then\n * `validation.<key>` in the app's i18n catalog, interpolated with the error's\n * payload. A key none of them answers renders nothing, and dev mode says so once.\n *\n * @example\n * ```html\n * <wr-form-field label=\"Email\" hint=\"We'll never share it.\">\n * <input wrInput [formControl]=\"email\" type=\"email\" />\n * <wr-form-error key=\"required\">Email is required.</wr-form-error>\n * <wr-form-error key=\"email\">Not a valid email.</wr-form-error>\n * </wr-form-field>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form-field\n */\n@Component({\n selector: 'wr-form-field',\n templateUrl: './form-field.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-form-field', '[class]': 'classes()' },\n providers: [\n {\n provide: WR_FORM_FIELD,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrFormField),\n },\n ],\n})\nexport class WrFormField implements WrFormFieldContext, AfterContentChecked {\n /** Label text shown above the control. */\n readonly label = input<string>('');\n\n /** Hint text shown below the control. Hidden when an error is visible. */\n readonly hint = input<string>('');\n\n /** Show a `*` next to the label and set `aria-required` on the projected control. @default false */\n readonly required = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show an \"optional\" marker next to the label — the word comes from\n * `optionalLabel`. Mutually exclusive with `required`. @default false\n */\n readonly optional = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Word inside the optional marker's parentheses. Falls back to\n * `form.optional`, then `'optional'`. The parentheses are the template's, so\n * no locale has to repeat punctuation.\n */\n readonly optionalLabel = input<string | null>(null);\n\n // Unlike the `*` marker beside it, this one is NOT `aria-hidden` — it sits\n // inside the `<label>` and is read as part of the control's accessible name,\n // so an English word here reached a Russian screen reader.\n protected readonly resolvedOptional = useI18nText(this.optionalLabel, 'form.optional', 'optional');\n\n /**\n * Force a specific id on the label's `for` attribute. Auto-generated\n * otherwise, and adopted by the projected `wrInput` unless that element\n * already carries an `id` of its own.\n */\n readonly controlId = input<string>(`wr-form-field-${++uid}`);\n\n // What a projected control reported it actually kept. `null` until one does — most\n // controls simply adopt `controlId`, and only a control with its own `id` overrides\n // it from the other direction.\n private readonly adoptedId = signal<string | null>(null);\n\n /**\n * Id the `<label for>` renders. A control that came with its own `id` keeps it, so\n * the label follows that instead of the generated one — otherwise `for` points at\n * an element that is not in the document and the field is unlabelled.\n */\n protected readonly labelFor = computed(() => this.adoptedId() ?? this.controlId());\n\n /** @internal `WrFormFieldContext` — see the token's docs. */\n adoptControlId(id: string): void {\n this.adoptedId.set(id);\n }\n\n /**\n * Projected `NgControl` — used to read touched / dirty / errors.\n *\n * This catches `[formField]` too: Angular's Signal Forms directive provides\n * `NgControl` via its interop shim, so both forms flavours land here.\n */\n protected readonly ngControl = contentChild(NgControl);\n\n /**\n * Bumped on every event the projected control emits.\n *\n * `AbstractControl`'s `touched` / `dirty` / `errors` accessors are NOT\n * reactive under classic forms — Angular reads them inside `untracked()`, and\n * `errors` is a plain assigned field. A `computed` over them therefore caches\n * its first value and never recomputes, which in a zoneless app means the\n * error block never appears at all. `control.events` is the reactive source\n * Angular does expose, so the computed depends on this counter instead.\n * Signal Forms needs none of this — its interop getters read live signals —\n * and harmlessly contributes no events.\n *\n * Events are not the whole story, which is what {@link ngAfterContentChecked} is for.\n */\n private readonly revision = signal(0);\n\n /** What the last check saw on a reactive control — see {@link ngAfterContentChecked}. */\n private seen: {\n readonly errors: ValidationErrors | null;\n readonly touched: boolean;\n readonly dirty: boolean;\n } | null = null;\n\n /**\n * Catch the changes a reactive control makes WITHOUT an event.\n *\n * `updateValueAndValidity({ emitEvent: false })`, `markAsTouched({ emitEvent: false })`\n * and their siblings change `errors`, `touched` and `dirty` and emit nothing, so the\n * subscription above never hears them and the message stays whatever it was. That is\n * not only an app's own silent write: Angular reports a custom control's PARSE errors\n * to a `FormControl` exactly that way — a validator re-run with `emitEvent: false` —\n * so a `wr-date-picker` refusing typed text made its control invalid while the field\n * went on showing the message from before, or nothing — and a later pass of change\n * detection did not help, because the message was memoised on a revision only events\n * move.\n *\n * This runs whenever the view holding the field is checked, which is when the page\n * around the control changes — for the date picker, the moment its refusal turns\n * visible. It is `ngAfterContentChecked` and not `ngDoCheck` for an ordering reason\n * read out of Angular's `refreshView`: check hooks run BEFORE the view's effects, and\n * Angular's parse-error validator is re-run from an effect in that same view, so a\n * `DoCheck` saw the errors one pass late and lost the message whenever nothing\n * refreshed the view again. Content-checked hooks run after those effects and before\n * the field's own bindings. Only a change moves the revision.\n *\n * Signal Forms' interop control is skipped: it is reactive already, and its `errors`\n * getter builds a fresh object on every read, which a reference check would call a\n * change on every pass — and re-resolve every message with it.\n */\n ngAfterContentChecked(): void {\n const control = this.ngControl()?.control;\n if (!(control instanceof AbstractControl)) {\n this.seen = null;\n return;\n }\n const { errors, touched, dirty } = control;\n const seen = this.seen;\n if (seen?.errors === errors && seen.touched === touched && seen.dirty === dirty) return;\n this.seen = { errors, touched, dirty };\n // The first sighting is only the baseline: `errors` reads `ngControl()`, so the\n // message already recomputed when the control appeared.\n if (seen) this.revision.update(n => n + 1);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n let sub: Subscription | null = null;\n effect(() => {\n const control = this.ngControl()?.control;\n sub?.unsubscribe();\n sub = (control?.events ?? EMPTY).subscribe(() => this.revision.update(n => n + 1));\n });\n inject(DestroyRef).onDestroy(() => sub?.unsubscribe());\n }\n\n protected readonly errors = computed(() => {\n this.revision();\n const c = this.ngControl();\n if (!c) return null;\n if (!c.touched && !c.dirty) return null;\n return c.errors;\n });\n\n protected readonly hasError = computed(() => {\n const errs = this.errors();\n return !!errs && Object.keys(errs).length > 0;\n });\n\n /** @internal Read by the projected `<wr-form-error>` children to decide which of them renders. */\n readonly errorKeys = computed<readonly string[]>(() => Object.keys(this.errors() ?? {}));\n\n /** @internal Read by the projected control so a screen reader is pointed at the message. */\n readonly describedBy = computed(() => (this.hasError() ? `${this.controlId()}-errors` : null));\n\n /**\n * @internal Read by the projected control so the hint is announced with the field.\n *\n * The hint used to carry no id at all, so the only thing `aria-describedby`\n * could ever name was the error block: the sentence explaining what to type was\n * on screen and reached a screen-reader user through no path whatsoever, and\n * the one gate that could have said so does not exist — axe has no rule that\n * visible help text must be programmatically associated.\n *\n * `null` while an error is showing, because the template swaps the hint out for\n * the message; publishing the id anyway would point every control at an element\n * that had just left the document.\n */\n readonly hintId = computed(() => (!this.hasError() && this.hint() ? `${this.controlId()}-hint` : null));\n\n /** @internal `WrFormFieldContext` — the id a role-based control points `aria-labelledby` at. */\n readonly labelId = computed(() => (this.label() ? `${this.controlId()}-label` : null));\n\n /**\n * Render a message for any error the markup does not already answer: the\n * validator's own `message`, else `validation.<key>` from the app's i18n\n * catalog. ngwr ships no error texts, so a key neither of them answers renders\n * nothing, and dev mode warns once for it.\n *\n * On by default: a field with no `<wr-form-error>` at all is the common case.\n * Turn it off for a field whose copy is entirely hand-written. @default true\n */\n readonly autoErrors = input(true, { transform: coerceBooleanProperty });\n\n private readonly projectedErrors = contentChildren(WrFormError);\n private readonly i18n = inject(WrI18n, { optional: true });\n private readonly isServer = !isPlatformBrowser(inject(PLATFORM_ID));\n\n /** Error keys this field has already warned about — see {@link warnNoCopy}. */\n private readonly warned = new Set<string>();\n\n /**\n * Errors with no projected `<wr-form-error key>` to answer them, resolved to\n * text. Per-field markup always wins — it is the most specific thing the author\n * wrote — and a key nothing answers is left out rather than rendered empty.\n */\n protected readonly autoMessages = computed<readonly { key: string; text: string }[]>(() => {\n if (!this.autoErrors()) return [];\n const errors = this.errors();\n if (!errors) return [];\n\n const claimed = new Set(\n this.projectedErrors()\n .map(e => e.key())\n .filter(Boolean)\n );\n\n const messages: { key: string; text: string }[] = [];\n for (const [key, error] of Object.entries(errors)) {\n if (claimed.has(key)) continue;\n const text = this.resolve(key, error);\n if (text) messages.push({ key, text });\n else if (isDevMode()) untracked(() => this.warnNoCopy(key));\n }\n return messages;\n });\n\n private resolve(rawKey: string, rawError: unknown): string | null {\n const own = ownMessage(rawError);\n if (own) return own;\n\n // `t()` reads the service's revision signal, so this recomputes on a locale\n // switch and when a loader-backed catalog lands; a miss returns the key itself.\n // ngwr's own catalogs carry no `validation` namespace, so only the app answers.\n const { key, error } = normalizeError(rawKey, rawError);\n const translated = this.i18n?.t(`validation.${key}`, toParams(error));\n return translated && translated !== `validation.${key}` ? translated : null;\n }\n\n /**\n * Say once, in dev, that an error is showing with nothing to read.\n *\n * Nothing on screen gives it away: the field still goes red and the control is\n * still marked invalid, so an empty error block survives review. With no\n * built-in copy that is the ordinary state of a validator nobody wrote words\n * for, not an edge case. Once per field and key — and once per key on the\n * server, where every prerendered page builds its fields again. The catalog key\n * is the normalised one, the markup key the one the control reported, because\n * those are what each of the two reads.\n */\n private warnNoCopy(rawKey: string): void {\n if (this.warned.has(rawKey)) return;\n this.warned.add(rawKey);\n if (this.isServer) {\n if (warnedOnServer.has(rawKey)) return;\n warnedOnServer.add(rawKey);\n }\n\n const catalogKey = normalizeError(rawKey, undefined).key;\n const field = this.label() ? `\"${this.label()}\"` : `#${this.labelFor()}`;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-form-field> ${field}: the \"${rawKey}\" error has no copy, so nothing is shown for it — ` +\n `ngwr ships no error texts. Supply one: { message } on the validator, \"validation.${catalogKey}\" ` +\n `in the app's i18n catalog, or <wr-form-error key=\"${rawKey}\"> inside the field.`\n );\n }\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.hasError()) parts.push('wr-form-field--invalid');\n if (this.required()) parts.push('wr-form-field--required');\n return parts.join(' ');\n });\n}\n","@if (label()) {\n <label class=\"wr-form-field__label\" [attr.id]=\"labelId()\" [attr.for]=\"labelFor()\">\n {{ label() }}\n @if (required()) {\n <span class=\"wr-form-field__required\" aria-hidden=\"true\">*</span>\n } @else if (optional()) {\n <span class=\"wr-form-field__optional\">({{ resolvedOptional() }})</span>\n }\n </label>\n}\n\n<div class=\"wr-form-field__control\"><ng-content /></div>\n\n@if (hasError()) {\n <div class=\"wr-form-field__errors\" [attr.id]=\"describedBy()\">\n <ng-content select=\"wr-form-error\" />\n @for (message of autoMessages(); track message.key) {\n <div class=\"wr-form-error wr-form-field__error\" role=\"alert\" [attr.data-key]=\"message.key\">\n {{ message.text }}\n </div>\n }\n </div>\n} @else if (hint()) {\n <small class=\"wr-form-field__hint\" [attr.id]=\"hintId()\">{{ hint() }}</small>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject } from '@angular/core';\n\nimport { WR_FORM_FIELD } from './tokens';\n\n/** What {@link useFormFieldAria} hands a control to bind on its own element. */\nexport interface WrFormFieldAria {\n /**\n * Id of the field's message block while it is showing one, of its hint\n * otherwise, and `null` when it is showing neither.\n */\n readonly describedBy: Signal<string | null>;\n /** `'true'` while the field has a validation error, `null` otherwise. */\n readonly ariaInvalid: Signal<'true' | null>;\n /** `'true'` while the field is `required`, `null` otherwise. */\n readonly ariaRequired: Signal<'true' | null>;\n /**\n * Id of the field's `<label>`, for a control `<label for>` cannot reach.\n *\n * `for` binds only to a LABELABLE element, so a control whose focusable part\n * is a `div` with a role gets nothing from it — measured, `wr-rating`,\n * `wr-knob` and `wr-file-upload` all rendered a field label whose `for` named\n * no element in the document. Point `aria-labelledby` at this instead; a\n * control that IS labelable should ignore it and let `for` do the work, or the\n * name is announced twice.\n */\n readonly labelledBy: Signal<string | null>;\n}\n\n/**\n * The two attributes that make a `<wr-form-field>`'s visible text — its error\n * message, or its hint — reach a screen reader. Bind both on whichever element\n * carries the control's role.\n *\n * Without them the copy the field renders is visible and nothing else: the\n * control announces itself as valid, and the text is associated with nothing.\n * No automated gate catches that — axe has no rule that a visible error or hint\n * must be programmatically associated with its control — so this helper exists\n * to make the wiring one line per control rather than three, and the specs are\n * the gate.\n *\n * The field renders an error OR a hint, never both, so `describedBy` names\n * whichever is on screen and `aria-invalid` is keyed SEPARATELY, on the field's\n * `errorKeys()`. Deriving it from `describedBy` instead — which is what every\n * control did while a hint had no id to name — makes a field with a plain hint\n * announce its control as invalid the moment the hint becomes describable.\n *\n * Must be called from an injection context (a field initialiser or a\n * constructor). Returns inert signals outside a `<wr-form-field>`.\n *\n * Pass `skipSelf` from a COMPOSITE control — one whose own template renders\n * other ngwr controls. Such a component shields its subtree by re-providing\n * `WR_FORM_FIELD` as `null`, or the inner parts each announce the outer field's\n * error as their own; a component sees its own providers, so it has to read the\n * real field from one level up.\n *\n * @example\n * ```ts\n * protected readonly fieldAria = useFormFieldAria();\n * ```\n * ```html\n * <input [attr.aria-invalid]=\"fieldAria.ariaInvalid()\" [attr.aria-describedby]=\"fieldAria.describedBy()\" />\n * ```\n */\nexport function useFormFieldAria(options?: { readonly skipSelf?: boolean }): WrFormFieldAria {\n const field = inject(WR_FORM_FIELD, { optional: true, skipSelf: options?.skipSelf ?? false });\n return {\n // `hintId` is optional on the interface so an app-provided field keeps\n // compiling; one without it describes nothing but its errors, as before.\n describedBy: computed(() => field?.describedBy() ?? field?.hintId?.() ?? null),\n ariaInvalid: computed<'true' | null>(() => ((field?.errorKeys().length ?? 0) > 0 ? 'true' : null)),\n ariaRequired: computed<'true' | null>(() => (field?.required?.() ? 'true' : null)),\n // `null` for a control that `<label for>` already reaches — pointing at the\n // same label twice would name it twice. Only the role-based controls read\n // this, and only because `for` cannot bind to a role.\n labelledBy: computed(() => field?.labelId?.() ?? null),\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { createMetadataKey } from '@angular/forms/signals';\n\n/**\n * How a field is DRAWN, attached to the same Signal Forms schema that already\n * says how it is validated.\n *\n * The alternative was a second schema — one for rules, one for presentation —\n * and it was rejected before it was written: two descriptions of one form drift\n * the moment someone renames a field in one of them, and nothing would report\n * it. Angular's `metadata()` takes a typed key and a `LogicFn`, so the\n * presentation rides on the schema the validators are already in, and it is\n * REACTIVE for free: a label, a set of options or a placeholder may depend on\n * the value of another field.\n *\n * What this deliberately does NOT carry: `required`, `disabled`, `readonly`,\n * `hidden`, `min`, `max`, and every validation rule. Those are Angular's own\n * schema functions, they already drive the control through `[formField]`, and\n * duplicating them here would create a second source of truth for state the form\n * already owns. That is not only a judgement call — Angular REFUSES a `[min]` or\n * `[required]` binding on a field-bound control (NG8022), so the second source\n * of truth is a compile error rather than a drift.\n */\nexport type WrFieldKind =\n | 'input'\n | 'textarea'\n | 'number'\n | 'select'\n | 'multiselect'\n | 'tags'\n | 'checkbox'\n | 'switch'\n | 'radio'\n | 'segmented'\n | 'date'\n | 'daterange'\n | 'slider'\n | 'rating'\n | 'file'\n | 'array';\n\n/** One choice, for the kinds that offer a list. */\nexport interface WrFieldOption {\n readonly value: unknown;\n readonly label: string;\n readonly disabled?: boolean;\n}\n\n/**\n * A titled group of fields, drawn as a `<fieldset>` with a `<legend>`.\n *\n * Fields that name the same `title` are drawn together, where the first of them\n * stands in the model's key order. The description and the column count come\n * from the first field that states them.\n */\nexport interface WrFieldSection {\n readonly title: string;\n /** A line under the title, announced as the group's description. */\n readonly description?: string;\n /** Grid columns inside the section. Defaults to the form's own `columns`. */\n readonly columns?: number;\n}\n\n/**\n * The presentation of one field.\n *\n * `kind` is the only required member: everything else has a sane default, and a\n * schema that says no more than `{ kind: 'input' }` still renders a labelled,\n * error-bound control — the label falls back to the field's own name.\n */\nexport interface WrFieldSpec {\n readonly kind: WrFieldKind;\n /** Defaults to the field's key, de-camel-cased — `workEmail` becomes \"Work email\". */\n readonly label?: string;\n readonly placeholder?: string;\n /** Help text under the control. Errors replace it while the field is invalid. */\n readonly hint?: string;\n /** For `select`, `multiselect`, `radio` and `segmented`. Ignored by every other kind. */\n readonly options?: readonly WrFieldOption[];\n /** Native `type` for `kind: 'input'` — `email`, `password`, `url`, `tel`. */\n readonly type?: string;\n /**\n * Granularity for `number` and `slider`. The BOUNDS are deliberately absent:\n * Angular refuses a `[min]` or `[max]` binding on a `[formField]`-bound\n * control outright (NG8022), because the field owns them — write `min(path.x,\n * 18)` in the schema and the control picks it up. `step` is presentation, has\n * no schema function, and stays here.\n */\n readonly step?: number;\n /**\n * Columns this field spans in `<wr-schema-form>`'s grid. Clamped to the form's\n * own `columns`, and 1 by default — a field is one cell unless it asks to be\n * wider.\n */\n readonly span?: number;\n /**\n * The section this field is drawn in: a title, or a title with a description\n * and its own column count. A field with none is drawn straight on the form's\n * grid.\n */\n readonly section?: string | WrFieldSection;\n /** For `file`: accept several files, so the field holds `File[]` rather than `File | null`. */\n readonly multiple?: boolean;\n /** For `file`: the native `accept` list, e.g. `'image/*,.pdf'`. */\n readonly accept?: string;\n /**\n * For `array`: the value a new item starts as. It is what draws the Add\n * button, and an array with no `item` is a fixed list whose items can only be\n * removed. Describe the item's own fields with `applyEach(path.x, item => …)`,\n * and bound the list with `minLength` and `maxLength` on the array itself.\n */\n readonly item?: () => unknown;\n /**\n * For `array`: what one item is called, numbered in the item's heading:\n * \"Address 2\". Defaults to the field's label.\n */\n readonly itemLabel?: string;\n /** For `array`: grid columns inside each item. Defaults to 1. */\n readonly columns?: number;\n}\n\n/**\n * The metadata key `<wr-schema-form>` reads.\n *\n * ```ts\n * const userSchema = schema<User>(path => {\n * required(path.email, { message: 'Enter your email.' });\n * email(path.email, { message: 'That is not an email address.' });\n * metadata(path.email, WR_FIELD, () => ({ kind: 'input', type: 'email', label: 'Work email' }));\n * metadata(path.role, WR_FIELD, () => ({ kind: 'select', options: ROLES }));\n *\n * // A repeating group: the array is described once, its items through `applyEach`.\n * metadata(path.addresses, WR_FIELD, () => ({ kind: 'array', item: () => ({ city: '' }) }));\n * applyEach(path.addresses, item => {\n * metadata(item.city, WR_FIELD, () => ({ kind: 'input' }));\n * });\n * });\n * ```\n *\n * A field with no `WR_FIELD` metadata is not an error and is not guessed at —\n * `<wr-schema-form>` skips it, so a schema can describe more than one screen shows.\n */\nexport const WR_FIELD = createMetadataKey<WrFieldSpec>();\n\n/** `workEmail` -> `Work email`. The fallback label, and only ever a fallback. */\nexport function wrFieldLabel(key: string): string {\n const spaced = key.replace(/([a-z\\d])([A-Z])/g, '$1 $2').replace(/[_-]+/g, ' ');\n return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,IAAa,SAAb,MAAa,OAAM;CACjB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,MAAM;CACzE;CAQS,SAAS,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAQxD,UAAU,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EACxB,YAAY,UAA2B,KAAK,IAAI,GAAG,KAAK,MAAM,qBAAqB,OAAO,CAAC,CAAC,CAAC;CAAC,CAAA;CAG7E,OAAO,eAAe,CAAC,KAAK,OAAM,KAAM,KAAK,QAAO,IAAK,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAvBnE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UA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C,SAAgB,aAAa,KAAW;CACtC,MAAM,SAAS,IAAI,QAAQ,qBAAqB,OAAO,CAAC,CAAC,QAAQ,UAAU,GAAG;CAC9E,OAAO,OAAO,OAAO,CAAC,CAAC,CAAC,YAAW,IAAK,OAAO,MAAM,CAAC,CAAC,CAAC,YAAW;AACrE"}
|
|
1
|
+
{"version":3,"file":"ngwr-form.mjs","names":[],"sources":["../../../projects/lib/form/form.ts","../../../projects/lib/form/form-item.ts","../../../projects/lib/form/tokens.ts","../../../projects/lib/form/form-field.ts","../../../projects/lib/form/form-field.html","../../../projects/lib/form/field-aria.ts","../../../projects/lib/form/schema.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Directive, computed, inject, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Lays out the fields of a form: a column with a gap by default, a wrapping\n * row with `inline`, or rows of `columns` equal columns that fall back to one\n * column when the form itself is narrow.\n *\n * @example\n * ```html\n * <form wrForm columns=\"2\">\n * <wr-form-field label=\"First name\"><input wrInput /></wr-form-field>\n * <wr-form-field label=\"Last name\"><input wrInput /></wr-form-field>\n * <wr-form-field label=\"Email\" wrFormSpan><input wrInput /></wr-form-field>\n * </form>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form\n */\n@Directive({\n selector: '[wrForm]',\n host: {\n class: 'wr-form',\n '[class.wr-form--inline]': 'inline()',\n '[class.wr-form--columns]': 'grid()',\n '[style.--wr-form-columns]': 'columns()',\n },\n})\nexport class WrForm {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * Lay the fields out in a wrapping row, aligned on their bottom edge.\n * `columns` is ignored.\n *\n * @default false\n */\n readonly inline = input(false, { transform: coerceBooleanProperty });\n\n /**\n * How many equal columns a row holds. Below a form width of `30rem` every\n * field takes a full row.\n *\n * @default 1\n */\n readonly columns = input(1, {\n transform: (value: unknown): number => Math.max(1, Math.floor(coerceNumberProperty(value, 1))),\n });\n\n protected readonly grid = computed(() => !this.inline() && this.columns() > 1);\n}\n\n/**\n * Stretches a child of `[wrForm]` over several columns: all of them with no\n * value, or the given number.\n *\n * @example\n * ```html\n * <wr-form-field label=\"Address\" wrFormSpan=\"2\"><input wrInput /></wr-form-field>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form\n */\n@Directive({\n selector: '[wrFormSpan]',\n host: { class: 'wr-form__span', '[style.--wr-form-span]': 'track()' },\n})\nexport class WrFormSpan {\n private readonly form = inject(WrForm, { optional: true });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * Columns to span. Empty or `'full'` takes the whole row. A number above\n * the form's `columns` spans them all.\n *\n * @default 'full'\n */\n readonly span = input<number | 'full', unknown>('full', {\n alias: 'wrFormSpan',\n transform: value => {\n const count = Math.floor(coerceNumberProperty(value, 0));\n return count >= 1 ? count : 'full';\n },\n });\n\n protected readonly track = computed(() => {\n const span = this.span();\n if (span === 'full') return '1 / -1';\n return `span ${this.form ? Math.min(span, this.form.columns()) : span}`;\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Wraps a label + control + error message into a single field row.\n *\n * Toggle `hasError` to apply error styling to the projected label and\n * any descendant input / textarea / checkbox.\n *\n * @example\n * ```html\n * <wr-form-item [hasError]=\"form.controls.email.invalid\">\n * <label>Email</label>\n * <input wrInput formControlName=\"email\" />\n * <wr-form-error>Invalid email</wr-form-error>\n * </wr-form-item>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form\n */\n@Component({\n selector: 'wr-form-item',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-form-item', '[class]': 'classes()' },\n})\nexport class WrFormItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * When `true`, applies error coloring to the projected label and inputs.\n *\n * @default false\n */\n readonly hasError = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.hasError()) parts.push('wr-form-item--error');\n return parts.join(' ');\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * What a projected control can read from its surrounding `<wr-form-field>`.\n *\n * The field renders `<label [for]>` before it can see what was projected into\n * it, so the id has to travel the other way: the control adopts the id the\n * label already points at. Doing it through DI keeps it a render-time binding,\n * which is what SSR needs — stamping the id from `afterNextRender` would leave\n * every prerendered page with a label pointing at nothing.\n */\nexport interface WrFormFieldContext {\n /** Id the field's `<label for>` points at. */\n readonly controlId: Signal<string>;\n\n /**\n * The reverse direction, for the one case the paragraph above does not cover: a\n * projected control that already carries its own `id` keeps it, and the label has\n * to follow, or `for` names an element that does not exist and the field ends up\n * with no label at all. Called during the control's construction, so the label's\n * binding still resolves in the same render pass.\n */\n adoptControlId(id: string): void;\n\n /**\n * Validator keys currently in error, once the control is touched or dirty.\n * Empty when the field is valid or has not been interacted with.\n */\n readonly errorKeys: Signal<readonly string[]>;\n\n /** Id of the element listing the visible messages, or `null` when there are none. */\n readonly describedBy: Signal<string | null>;\n\n /**\n * Id of the field's own `<label>`, or `null` when it renders none.\n *\n * For the controls `<label for>` cannot reach. `for` only binds to a LABELABLE\n * element — button, input, meter, output, progress, select, textarea — so a\n * control whose focusable part is a `div[role=\"slider\"]`, a `role=\"button\"`\n * drop zone or a radiogroup got a label pointing at nothing: measured, five of\n * the eighteen value controls resolved `for` to no element in the document at\n * all. Those point `aria-labelledby` back at this instead, which is the\n * direction that works for a role.\n */\n readonly labelId?: Signal<string | null>;\n\n /**\n * Id of the field's hint, or `null` when it is showing none — including while\n * an error has replaced it, since the two never render together and an\n * `aria-describedby` naming an absent element is an author error.\n *\n * Separate from {@link describedBy} rather than folded into it because the two\n * carry different weight: a control keyed `aria-invalid` on \"the field is\n * describing me\" would announce itself invalid for a plain hint. Compose the\n * pair with `useFormFieldAria()` instead of reading either one directly.\n *\n * Optional so an app that provides its own `WR_FORM_FIELD` keeps compiling; a\n * field without it simply describes nothing but its errors.\n */\n readonly hintId?: Signal<string | null>;\n\n /**\n * Whether the field is marked `required`. Read through `useFormFieldAria()` as\n * `aria-required`. Optional so an app that provides its own `WR_FORM_FIELD`\n * keeps compiling.\n */\n readonly required?: Signal<boolean>;\n}\n\n/** Present only inside a `<wr-form-field>`; inject with `{ optional: true }`. */\nexport const WR_FORM_FIELD = new InjectionToken<WrFormFieldContext>('WR_FORM_FIELD');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n type AfterContentChecked,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n contentChild,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n isDevMode,\n signal,\n untracked,\n} from '@angular/core';\nimport { AbstractControl, NgControl, type ValidationErrors } from '@angular/forms';\n\nimport { EMPTY, type Subscription } from 'rxjs';\n\nimport { WrI18n, useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_FORM_FIELD, type WrFormFieldContext } from './tokens';\n\nlet uid = 0;\n\n/**\n * Error keys already reported on the server. Every prerendered route and every\n * request builds its fields afresh, so the per-field memo alone would repeat one\n * warning per page; the browser keeps it per field, where it names the field the\n * developer is looking at.\n */\nconst warnedOnServer = new Set<string>();\n\n/** Validator payloads are plain objects; anything else interpolates nothing. */\nfunction toParams(error: unknown): Record<string, unknown> | undefined {\n return error && typeof error === 'object' ? (error as Record<string, unknown>) : undefined;\n}\n\n/**\n * The sentence the validator carries itself, or `null`.\n *\n * Signal Forms validators take `{ message }` and keep it on the error object, and\n * the interop `NgControl` this field reads lists that object AS IS under its\n * `kind` (`signalErrorsToValidationErrors` in `@angular/forms`), so the message\n * arrives here untouched. A custom control's parse errors take the same road in\n * both forms flavours, which is how a `wr-date-picker` refusal is read. A classic\n * validator's payload has no `message` unless the app put one there.\n */\nfunction ownMessage(error: unknown): string | null {\n const message = toParams(error)?.['message'];\n return typeof message === 'string' && message.trim() !== '' ? message : null;\n}\n\n/**\n * The two Signal Forms kinds whose spelling and payload differ from the classic\n * validator that means the same thing.\n *\n * Reactive forms emit `minlength` / `maxlength` carrying `requiredLength`;\n * Signal Forms emit `minLength` / `maxLength` carrying `minLength` / `maxLength`.\n * Restated before the catalog lookup so one `validation.minlength` entry in an\n * app's catalog answers both spellings, with `{{requiredLength}}` filled either\n * way — the message is the SAME message, one sentence about a length reached by\n * two spellings of one rule, and asking every app for two keys would only get\n * one of them written.\n */\nconst SIGNAL_FORMS_ALIASES: Readonly<Record<string, { readonly key: string; readonly from: string }>> = {\n minLength: { key: 'minlength', from: 'minLength' },\n maxLength: { key: 'maxlength', from: 'maxLength' },\n};\n\n/**\n * A Signal Forms length error, restated in the classic shape the catalog lookup\n * reads. Anything else passes through untouched.\n */\nfunction normalizeError(key: string, error: unknown): { readonly key: string; readonly error: unknown } {\n const alias = SIGNAL_FORMS_ALIASES[key];\n if (!alias) return { key, error };\n\n const params = toParams(error);\n const bound = params?.[alias.from];\n return {\n key: alias.key,\n error: bound === undefined ? error : { ...params, requiredLength: bound },\n };\n}\n\n/**\n * One error message tied to a validator key. Renders only when the parent\n * form-field has a matching error in `control.errors`, and only once the\n * control is touched or dirty.\n *\n * A keyed message CLAIMS its key: the field renders no automatic message for it,\n * so per-field markup wins over the validator's own `message` and over the app's\n * `validation.*` catalog.\n *\n * @example\n * ```html\n * <wr-form-error key=\"required\">This field is required.</wr-form-error>\n * <wr-form-error key=\"email\">That doesn't look right.</wr-form-error>\n * ```\n */\n@Component({\n selector: 'wr-form-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-form-error wr-form-field__error',\n role: 'alert',\n '[attr.data-key]': 'key() ?? null',\n '[class.wr-form-field__error--hidden]': '!visible()',\n },\n})\nexport class WrFormError {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n }\n\n /**\n * Validator key this message corresponds to (e.g. `'required'`).\n * Optional — without a key the message always renders, which is the\n * plain inline-error usage inside `<wr-form-item>`.\n */\n readonly key = input<string>();\n\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Whether this message is the one the current error calls for.\n *\n * The parent projects every `<wr-form-error>` through a single\n * `<ng-content select>`, which cannot filter — so each message decides for\n * itself. Without this, one invalid control rendered \"Email is required.\"\n * and \"That isn't a valid email.\" side by side, which is what the docs have\n * always described as gated behaviour.\n *\n * A keyless message always shows: that is the plain inline-error usage inside\n * `<wr-form-item>`, which has no error discovery at all.\n */\n protected readonly visible = computed(() => {\n const key = this.key();\n if (!key || !this.field) return true;\n return this.field.errorKeys().includes(key);\n });\n}\n\n/**\n * Wraps a label + control + hint + error messages into a single block —\n * the layout primitive every form ends up reinventing.\n *\n * - Auto-binds `label[for]` to the projected control via a generated id\n * (or use the form-control's `[id]` if you set one).\n * - Reads the projected control's `NgControl` to surface validation\n * errors only once the control is touched or dirty. A submit shows them\n * only by marking the controls touched, as `markAllAsTouched()` and Signal\n * Forms' `submit()` do.\n * - Optional `[required]` / `[optional]` markers next to the label.\n *\n * **ngwr ships no error texts.** Each error shows the first copy that exists for\n * it: a projected `<wr-form-error key>`, then the validator's own `message`\n * (`required(path.email, { message: 'Enter your email.' })`), then\n * `validation.<key>` in the app's i18n catalog, interpolated with the error's\n * payload. A key none of them answers renders nothing, and dev mode says so once.\n *\n * @example\n * ```html\n * <wr-form-field label=\"Email\" hint=\"We'll never share it.\">\n * <input wrInput [formControl]=\"email\" type=\"email\" />\n * <wr-form-error key=\"required\">Email is required.</wr-form-error>\n * <wr-form-error key=\"email\">Not a valid email.</wr-form-error>\n * </wr-form-field>\n * ```\n *\n * @see https://ngwr.dev/reference/components/form-field\n */\n@Component({\n selector: 'wr-form-field',\n templateUrl: './form-field.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-form-field', '[class]': 'classes()' },\n providers: [\n {\n provide: WR_FORM_FIELD,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrFormField),\n },\n ],\n})\nexport class WrFormField implements WrFormFieldContext, AfterContentChecked {\n /** Label text shown above the control. */\n readonly label = input<string>('');\n\n /** Hint text shown below the control. Hidden when an error is visible. */\n readonly hint = input<string>('');\n\n /** Show a `*` next to the label and set `aria-required` on the projected control. @default false */\n readonly required = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show an \"optional\" marker next to the label — the word comes from\n * `optionalLabel`. Mutually exclusive with `required`. @default false\n */\n readonly optional = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Word inside the optional marker's parentheses. Falls back to\n * `form.optional`, then `'optional'`. The parentheses are the template's, so\n * no locale has to repeat punctuation.\n */\n readonly optionalLabel = input<string | null>(null);\n\n // Unlike the `*` marker beside it, this one is NOT `aria-hidden` — it sits\n // inside the `<label>` and is read as part of the control's accessible name,\n // so an English word here reached a Russian screen reader.\n protected readonly resolvedOptional = useI18nText(this.optionalLabel, 'form.optional', 'optional');\n\n /**\n * Force a specific id on the label's `for` attribute. Auto-generated\n * otherwise, and adopted by the projected `wrInput` unless that element\n * already carries an `id` of its own.\n */\n readonly controlId = input<string>(`wr-form-field-${++uid}`);\n\n // What a projected control reported it actually kept. `null` until one does — most\n // controls simply adopt `controlId`, and only a control with its own `id` overrides\n // it from the other direction.\n private readonly adoptedId = signal<string | null>(null);\n\n /**\n * Id the `<label for>` renders. A control that came with its own `id` keeps it, so\n * the label follows that instead of the generated one — otherwise `for` points at\n * an element that is not in the document and the field is unlabelled.\n */\n protected readonly labelFor = computed(() => this.adoptedId() ?? this.controlId());\n\n /** @internal `WrFormFieldContext` — see the token's docs. */\n adoptControlId(id: string): void {\n this.adoptedId.set(id);\n }\n\n /**\n * Projected `NgControl` — used to read touched / dirty / errors.\n *\n * This catches `[formField]` too: Angular's Signal Forms directive provides\n * `NgControl` via its interop shim, so both forms flavours land here.\n */\n protected readonly ngControl = contentChild(NgControl);\n\n /**\n * Bumped on every event the projected control emits.\n *\n * `AbstractControl`'s `touched` / `dirty` / `errors` accessors are NOT\n * reactive under classic forms — Angular reads them inside `untracked()`, and\n * `errors` is a plain assigned field. A `computed` over them therefore caches\n * its first value and never recomputes, which in a zoneless app means the\n * error block never appears at all. `control.events` is the reactive source\n * Angular does expose, so the computed depends on this counter instead.\n * Signal Forms needs none of this — its interop getters read live signals —\n * and harmlessly contributes no events.\n *\n * Events are not the whole story, which is what {@link ngAfterContentChecked} is for.\n */\n private readonly revision = signal(0);\n\n /** What the last check saw on a reactive control — see {@link ngAfterContentChecked}. */\n private seen: {\n readonly errors: ValidationErrors | null;\n readonly touched: boolean;\n readonly dirty: boolean;\n } | null = null;\n\n /**\n * Catch the changes a reactive control makes WITHOUT an event.\n *\n * `updateValueAndValidity({ emitEvent: false })`, `markAsTouched({ emitEvent: false })`\n * and their siblings change `errors`, `touched` and `dirty` and emit nothing, so the\n * subscription above never hears them and the message stays whatever it was. That is\n * not only an app's own silent write: Angular reports a custom control's PARSE errors\n * to a `FormControl` exactly that way — a validator re-run with `emitEvent: false` —\n * so a `wr-date-picker` refusing typed text made its control invalid while the field\n * went on showing the message from before, or nothing — and a later pass of change\n * detection did not help, because the message was memoised on a revision only events\n * move.\n *\n * This runs whenever the view holding the field is checked, which is when the page\n * around the control changes — for the date picker, the moment its refusal turns\n * visible. It is `ngAfterContentChecked` and not `ngDoCheck` for an ordering reason\n * read out of Angular's `refreshView`: check hooks run BEFORE the view's effects, and\n * Angular's parse-error validator is re-run from an effect in that same view, so a\n * `DoCheck` saw the errors one pass late and lost the message whenever nothing\n * refreshed the view again. Content-checked hooks run after those effects and before\n * the field's own bindings. Only a change moves the revision.\n *\n * Signal Forms' interop control is skipped: it is reactive already, and its `errors`\n * getter builds a fresh object on every read, which a reference check would call a\n * change on every pass — and re-resolve every message with it.\n */\n ngAfterContentChecked(): void {\n const control = this.ngControl()?.control;\n if (!(control instanceof AbstractControl)) {\n this.seen = null;\n return;\n }\n const { errors, touched, dirty } = control;\n const seen = this.seen;\n if (seen?.errors === errors && seen.touched === touched && seen.dirty === dirty) return;\n this.seen = { errors, touched, dirty };\n // The first sighting is only the baseline: `errors` reads `ngControl()`, so the\n // message already recomputed when the control appeared.\n if (seen) this.revision.update(n => n + 1);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('form');\n let sub: Subscription | null = null;\n effect(() => {\n const control = this.ngControl()?.control;\n sub?.unsubscribe();\n sub = (control?.events ?? EMPTY).subscribe(() => this.revision.update(n => n + 1));\n });\n inject(DestroyRef).onDestroy(() => sub?.unsubscribe());\n }\n\n protected readonly errors = computed(() => {\n this.revision();\n const c = this.ngControl();\n if (!c) return null;\n if (!c.touched && !c.dirty) return null;\n return c.errors;\n });\n\n protected readonly hasError = computed(() => {\n const errs = this.errors();\n return !!errs && Object.keys(errs).length > 0;\n });\n\n /** @internal Read by the projected `<wr-form-error>` children to decide which of them renders. */\n readonly errorKeys = computed<readonly string[]>(() => Object.keys(this.errors() ?? {}));\n\n /** @internal Read by the projected control so a screen reader is pointed at the message. */\n readonly describedBy = computed(() => (this.hasError() ? `${this.controlId()}-errors` : null));\n\n /**\n * @internal Read by the projected control so the hint is announced with the field.\n *\n * The hint used to carry no id at all, so the only thing `aria-describedby`\n * could ever name was the error block: the sentence explaining what to type was\n * on screen and reached a screen-reader user through no path whatsoever, and\n * the one gate that could have said so does not exist — axe has no rule that\n * visible help text must be programmatically associated.\n *\n * `null` while an error is showing, because the template swaps the hint out for\n * the message; publishing the id anyway would point every control at an element\n * that had just left the document.\n */\n readonly hintId = computed(() => (!this.hasError() && this.hint() ? `${this.controlId()}-hint` : null));\n\n /** @internal `WrFormFieldContext` — the id a role-based control points `aria-labelledby` at. */\n readonly labelId = computed(() => (this.label() ? `${this.controlId()}-label` : null));\n\n /**\n * Render a message for any error the markup does not already answer: the\n * validator's own `message`, else `validation.<key>` from the app's i18n\n * catalog. ngwr ships no error texts, so a key neither of them answers renders\n * nothing, and dev mode warns once for it.\n *\n * On by default: a field with no `<wr-form-error>` at all is the common case.\n * Turn it off for a field whose copy is entirely hand-written. @default true\n */\n readonly autoErrors = input(true, { transform: coerceBooleanProperty });\n\n private readonly projectedErrors = contentChildren(WrFormError);\n private readonly i18n = inject(WrI18n, { optional: true });\n private readonly isServer = !isPlatformBrowser(inject(PLATFORM_ID));\n\n /** Error keys this field has already warned about — see {@link warnNoCopy}. */\n private readonly warned = new Set<string>();\n\n /**\n * Errors with no projected `<wr-form-error key>` to answer them, resolved to\n * text. Per-field markup always wins — it is the most specific thing the author\n * wrote — and a key nothing answers is left out rather than rendered empty.\n */\n protected readonly autoMessages = computed<readonly { key: string; text: string }[]>(() => {\n if (!this.autoErrors()) return [];\n const errors = this.errors();\n if (!errors) return [];\n\n const claimed = new Set(\n this.projectedErrors()\n .map(e => e.key())\n .filter(Boolean)\n );\n\n const messages: { key: string; text: string }[] = [];\n for (const [key, error] of Object.entries(errors)) {\n if (claimed.has(key)) continue;\n const text = this.resolve(key, error);\n if (text) messages.push({ key, text });\n else if (isDevMode()) untracked(() => this.warnNoCopy(key));\n }\n return messages;\n });\n\n private resolve(rawKey: string, rawError: unknown): string | null {\n const own = ownMessage(rawError);\n if (own) return own;\n\n // `t()` reads the service's revision signal, so this recomputes on a locale\n // switch and when a loader-backed catalog lands; a miss returns the key itself.\n // ngwr's own catalogs carry no `validation` namespace, so only the app answers.\n const { key, error } = normalizeError(rawKey, rawError);\n const translated = this.i18n?.t(`validation.${key}`, toParams(error));\n return translated && translated !== `validation.${key}` ? translated : null;\n }\n\n /**\n * Say once, in dev, that an error is showing with nothing to read.\n *\n * Nothing on screen gives it away: the field still goes red and the control is\n * still marked invalid, so an empty error block survives review. With no\n * built-in copy that is the ordinary state of a validator nobody wrote words\n * for, not an edge case. Once per field and key — and once per key on the\n * server, where every prerendered page builds its fields again. The catalog key\n * is the normalised one, the markup key the one the control reported, because\n * those are what each of the two reads.\n */\n private warnNoCopy(rawKey: string): void {\n if (this.warned.has(rawKey)) return;\n this.warned.add(rawKey);\n if (this.isServer) {\n if (warnedOnServer.has(rawKey)) return;\n warnedOnServer.add(rawKey);\n }\n\n const catalogKey = normalizeError(rawKey, undefined).key;\n const field = this.label() ? `\"${this.label()}\"` : `#${this.labelFor()}`;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-form-field> ${field}: the \"${rawKey}\" error has no copy, so nothing is shown for it — ` +\n `ngwr ships no error texts. Supply one: { message } on the validator, \"validation.${catalogKey}\" ` +\n `in the app's i18n catalog, or <wr-form-error key=\"${rawKey}\"> inside the field.`\n );\n }\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.hasError()) parts.push('wr-form-field--invalid');\n if (this.required()) parts.push('wr-form-field--required');\n return parts.join(' ');\n });\n}\n","@if (label()) {\n <label class=\"wr-form-field__label\" [attr.id]=\"labelId()\" [attr.for]=\"labelFor()\">\n {{ label() }}\n @if (required()) {\n <span class=\"wr-form-field__required\" aria-hidden=\"true\">*</span>\n } @else if (optional()) {\n <span class=\"wr-form-field__optional\">({{ resolvedOptional() }})</span>\n }\n </label>\n}\n\n<div class=\"wr-form-field__control\"><ng-content /></div>\n\n@if (hasError()) {\n <div class=\"wr-form-field__errors\" [attr.id]=\"describedBy()\">\n <ng-content select=\"wr-form-error\" />\n @for (message of autoMessages(); track message.key) {\n <div class=\"wr-form-error wr-form-field__error\" role=\"alert\" [attr.data-key]=\"message.key\">\n {{ message.text }}\n </div>\n }\n </div>\n} @else if (hint()) {\n <small class=\"wr-form-field__hint\" [attr.id]=\"hintId()\">{{ hint() }}</small>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject } from '@angular/core';\n\nimport { WR_FORM_FIELD } from './tokens';\n\n/** What {@link useFormFieldAria} hands a control to bind on its own element. */\nexport interface WrFormFieldAria {\n /**\n * Id of the field's message block while it is showing one, of its hint\n * otherwise, and `null` when it is showing neither.\n */\n readonly describedBy: Signal<string | null>;\n /** `'true'` while the field has a validation error, `null` otherwise. */\n readonly ariaInvalid: Signal<'true' | null>;\n /** `'true'` while the field is `required`, `null` otherwise. */\n readonly ariaRequired: Signal<'true' | null>;\n /**\n * Id of the field's `<label>`, for a control `<label for>` cannot reach.\n *\n * `for` binds only to a LABELABLE element, so a control whose focusable part\n * is a `div` with a role gets nothing from it — measured, `wr-rating`,\n * `wr-knob` and `wr-file-upload` all rendered a field label whose `for` named\n * no element in the document. Point `aria-labelledby` at this instead; a\n * control that IS labelable should ignore it and let `for` do the work, or the\n * name is announced twice.\n */\n readonly labelledBy: Signal<string | null>;\n}\n\n/**\n * The two attributes that make a `<wr-form-field>`'s visible text — its error\n * message, or its hint — reach a screen reader. Bind both on whichever element\n * carries the control's role.\n *\n * Without them the copy the field renders is visible and nothing else: the\n * control announces itself as valid, and the text is associated with nothing.\n * No automated gate catches that — axe has no rule that a visible error or hint\n * must be programmatically associated with its control — so this helper exists\n * to make the wiring one line per control rather than three, and the specs are\n * the gate.\n *\n * The field renders an error OR a hint, never both, so `describedBy` names\n * whichever is on screen and `aria-invalid` is keyed SEPARATELY, on the field's\n * `errorKeys()`. Deriving it from `describedBy` instead — which is what every\n * control did while a hint had no id to name — makes a field with a plain hint\n * announce its control as invalid the moment the hint becomes describable.\n *\n * Must be called from an injection context (a field initialiser or a\n * constructor). Returns inert signals outside a `<wr-form-field>`.\n *\n * Pass `skipSelf` from a COMPOSITE control — one whose own template renders\n * other ngwr controls. Such a component shields its subtree by re-providing\n * `WR_FORM_FIELD` as `null`, or the inner parts each announce the outer field's\n * error as their own; a component sees its own providers, so it has to read the\n * real field from one level up.\n *\n * @example\n * ```ts\n * protected readonly fieldAria = useFormFieldAria();\n * ```\n * ```html\n * <input [attr.aria-invalid]=\"fieldAria.ariaInvalid()\" [attr.aria-describedby]=\"fieldAria.describedBy()\" />\n * ```\n */\nexport function useFormFieldAria(options?: { readonly skipSelf?: boolean }): WrFormFieldAria {\n const field = inject(WR_FORM_FIELD, { optional: true, skipSelf: options?.skipSelf ?? false });\n return {\n // `hintId` is optional on the interface so an app-provided field keeps\n // compiling; one without it describes nothing but its errors, as before.\n describedBy: computed(() => field?.describedBy() ?? field?.hintId?.() ?? null),\n ariaInvalid: computed<'true' | null>(() => ((field?.errorKeys().length ?? 0) > 0 ? 'true' : null)),\n ariaRequired: computed<'true' | null>(() => (field?.required?.() ? 'true' : null)),\n // `null` for a control that `<label for>` already reaches — pointing at the\n // same label twice would name it twice. Only the role-based controls read\n // this, and only because `for` cannot bind to a role.\n labelledBy: computed(() => field?.labelId?.() ?? null),\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { createMetadataKey } from '@angular/forms/signals';\n\n/**\n * How a field is DRAWN, attached to the same Signal Forms schema that already\n * says how it is validated.\n *\n * The alternative was a second schema — one for rules, one for presentation —\n * and it was rejected before it was written: two descriptions of one form drift\n * the moment someone renames a field in one of them, and nothing would report\n * it. Angular's `metadata()` takes a typed key and a `LogicFn`, so the\n * presentation rides on the schema the validators are already in, and it is\n * REACTIVE for free: a label, a set of options or a placeholder may depend on\n * the value of another field.\n *\n * What this deliberately does NOT carry: `required`, `disabled`, `readonly`,\n * `hidden`, `min`, `max`, and every validation rule. Those are Angular's own\n * schema functions, they already drive the control through `[formField]`, and\n * duplicating them here would create a second source of truth for state the form\n * already owns. That is not only a judgement call — Angular REFUSES a `[min]` or\n * `[required]` binding on a field-bound control (NG8022), so the second source\n * of truth is a compile error rather than a drift.\n */\nexport type WrFieldKind =\n | 'input'\n | 'textarea'\n | 'number'\n | 'select'\n | 'multiselect'\n | 'tags'\n | 'checkbox'\n | 'switch'\n | 'radio'\n | 'segmented'\n | 'date'\n | 'daterange'\n | 'slider'\n | 'rating'\n | 'file'\n | 'array';\n\n/** One choice, for the kinds that offer a list. */\nexport interface WrFieldOption {\n readonly value: unknown;\n readonly label: string;\n readonly disabled?: boolean;\n}\n\n/**\n * A titled group of fields, drawn as a `<fieldset>` with a `<legend>`.\n *\n * Fields that name the same `title` are drawn together, where the first of them\n * stands in the model's key order. The description and the column count come\n * from the first field that states them.\n */\nexport interface WrFieldSection {\n readonly title: string;\n /** A line under the title, announced as the group's description. */\n readonly description?: string;\n /** Grid columns inside the section. Defaults to the form's own `columns`. */\n readonly columns?: number;\n}\n\n/**\n * The presentation of one field.\n *\n * `kind` is the only required member: everything else has a sane default, and a\n * schema that says no more than `{ kind: 'input' }` still renders a labelled,\n * error-bound control — the label falls back to the field's own name.\n */\nexport interface WrFieldSpec {\n readonly kind: WrFieldKind;\n /** Defaults to the field's key, de-camel-cased — `workEmail` becomes \"Work email\". */\n readonly label?: string;\n readonly placeholder?: string;\n /** Help text under the control. Errors replace it while the field is invalid. */\n readonly hint?: string;\n /** For `select`, `multiselect`, `radio` and `segmented`. Ignored by every other kind. */\n readonly options?: readonly WrFieldOption[];\n /** Native `type` for `kind: 'input'` — `email`, `password`, `url`, `tel`. */\n readonly type?: string;\n /**\n * Granularity for `number` and `slider`. The BOUNDS are deliberately absent:\n * Angular refuses a `[min]` or `[max]` binding on a `[formField]`-bound\n * control outright (NG8022), because the field owns them — write `min(path.x,\n * 18)` in the schema and the control picks it up. `step` is presentation, has\n * no schema function, and stays here.\n */\n readonly step?: number;\n /**\n * Columns this field spans in `<wr-schema-form>`'s grid. Clamped to the form's\n * own `columns`, and 1 by default — a field is one cell unless it asks to be\n * wider.\n */\n readonly span?: number;\n /**\n * The section this field is drawn in: a title, or a title with a description\n * and its own column count. A field with none is drawn straight on the form's\n * grid.\n */\n readonly section?: string | WrFieldSection;\n /** For `file`: accept several files, so the field holds `File[]` rather than `File | null`. */\n readonly multiple?: boolean;\n /** For `file`: the native `accept` list, e.g. `'image/*,.pdf'`. */\n readonly accept?: string;\n /**\n * For `array`: the value a new item starts as. It is what draws the Add\n * button, and an array with no `item` is a fixed list whose items can only be\n * removed. Describe the item's own fields with `applyEach(path.x, item => …)`,\n * and bound the list with `minLength` and `maxLength` on the array itself.\n */\n readonly item?: () => unknown;\n /**\n * For `array`: what one item is called, numbered in the item's heading:\n * \"Address 2\". Defaults to the field's label.\n */\n readonly itemLabel?: string;\n /** For `array`: grid columns inside each item. Defaults to 1. */\n readonly columns?: number;\n}\n\n/**\n * The metadata key `<wr-schema-form>` reads.\n *\n * ```ts\n * const userSchema = schema<User>(path => {\n * required(path.email, { message: 'Enter your email.' });\n * email(path.email, { message: 'That is not an email address.' });\n * metadata(path.email, WR_FIELD, () => ({ kind: 'input', type: 'email', label: 'Work email' }));\n * metadata(path.role, WR_FIELD, () => ({ kind: 'select', options: ROLES }));\n *\n * // A repeating group: the array is described once, its items through `applyEach`.\n * metadata(path.addresses, WR_FIELD, () => ({ kind: 'array', item: () => ({ city: '' }) }));\n * applyEach(path.addresses, item => {\n * metadata(item.city, WR_FIELD, () => ({ kind: 'input' }));\n * });\n * });\n * ```\n *\n * A field with no `WR_FIELD` metadata is not an error and is not guessed at —\n * `<wr-schema-form>` skips it, so a schema can describe more than one screen shows.\n */\nexport const WR_FIELD = createMetadataKey<WrFieldSpec>();\n\n/** `workEmail` -> `Work email`. The fallback label, and only ever a fallback. */\nexport function wrFieldLabel(key: string): string {\n const spaced = key.replace(/([a-z\\d])([A-Z])/g, '$1 $2').replace(/[_-]+/g, ' ');\n return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,IAAa,SAAb,MAAa,OAAM;CACjB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,MAAM;CACzE;CAQS,SAAS,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAQxD,UAAU,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EACxB,YAAY,UAA2B,KAAK,IAAI,GAAG,KAAK,MAAM,qBAAqB,OAAO,CAAC,CAAC,CAAC;CAAC,CAAA;CAG7E,OAAO,eAAe,CAAC,KAAK,OAAM,KAAM,KAAK,QAAO,IAAK,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAvBnE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAM,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAN,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAM,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA;IAAA,yBAAA;IAAA,0BAAA;IAAA,2BAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAN,GAA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:scope > ${SR_ONLY}`;
|
|
10
|
+
const SELECT = ":scope > .wr-graph__select";
|
|
10
11
|
const NOT_DRAWN_BY_NODE = `${SR_ONLY}, wr-graph`;
|
|
11
12
|
var WrGraphNodeHarness = class extends ComponentHarness {
|
|
12
13
|
static hostSelector = ".wr-graph__node";
|
|
@@ -20,6 +21,28 @@ var WrGraphNodeHarness = class extends ComponentHarness {
|
|
|
20
21
|
const relation = await this.locatorForOptional(RELATION)();
|
|
21
22
|
return relation ? relation.text() : null;
|
|
22
23
|
}
|
|
24
|
+
async isSelected() {
|
|
25
|
+
return await (await this.locatorForOptional(SELECT)())?.getAttribute("aria-pressed") === "true";
|
|
26
|
+
}
|
|
27
|
+
async isLinked() {
|
|
28
|
+
return (await this.host()).hasClass("wr-graph__node--linked");
|
|
29
|
+
}
|
|
30
|
+
async isDimmed() {
|
|
31
|
+
return (await this.host()).hasClass("wr-graph__node--dimmed");
|
|
32
|
+
}
|
|
33
|
+
async select() {
|
|
34
|
+
const button = await this.selectButton("select");
|
|
35
|
+
if (await button.getAttribute("aria-pressed") !== "true") await button.click();
|
|
36
|
+
}
|
|
37
|
+
async deselect() {
|
|
38
|
+
const button = await this.selectButton("deselect");
|
|
39
|
+
if (await button.getAttribute("aria-pressed") === "true") await button.click();
|
|
40
|
+
}
|
|
41
|
+
async selectButton(method) {
|
|
42
|
+
const button = await this.locatorForOptional(SELECT)();
|
|
43
|
+
if (button) return button;
|
|
44
|
+
throw new Error(`WrGraphNodeHarness.${method}(): the graph is not selectable, so its nodes are not buttons and a click selects nothing — bind \`selectable\` on <wr-graph> first.`);
|
|
45
|
+
}
|
|
23
46
|
};
|
|
24
47
|
/**
|
|
25
48
|
* @license
|
|
@@ -73,6 +96,13 @@ var WrGraphHarness = class WrGraphHarness extends ComponentHarness {
|
|
|
73
96
|
};
|
|
74
97
|
}));
|
|
75
98
|
}
|
|
99
|
+
async isSelectable() {
|
|
100
|
+
return (await this.host()).hasClass("wr-graph--selectable");
|
|
101
|
+
}
|
|
102
|
+
async getSelectedNode() {
|
|
103
|
+
for (const node of await this.getNodes()) if (await node.isSelected()) return node;
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
76
106
|
async isZoomable() {
|
|
77
107
|
return (await this.host()).hasClass("wr-graph--zoomable");
|
|
78
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-graph-testing.mjs","names":[],"sources":["../../../projects/lib/graph/testing/wr-graph-node-harness.ts","../../../projects/lib/graph/testing/wr-graph-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, type ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrGraphNodeHarnessFilters } from './types';\n\n/** The visually hidden relation sentence the graph writes into every node that has an edge. */\nconst SR_ONLY = '.wr-graph__sr-only';\n\n/**\n * The node's OWN sentence. Anchored with `:scope >` because the graph writes it as a\n * direct child, after whatever the template drew — so a `<wr-graph>` nested inside a\n * node template would otherwise hand its first node's sentence to the outer node.\n */\nconst RELATION = `:scope > ${SR_ONLY}`;\n\n/**\n * What {@link WrGraphNodeHarness.getText} leaves out: the node's own sentence, and any\n * `<wr-graph>` a template drew inside the node. That inner graph is a graph of its own —\n * its cards are its nodes, read through its own harness — so counting its text as the\n * outer node's would let a RegExp label match the outer graph by a node it does not own.\n */\nconst NOT_DRAWN_BY_NODE = `${SR_ONLY}, wr-graph`;\n\n/**\n * Test harness for one node of a `<wr-graph>` — a `role=\"listitem\"` block.\n *\n * A node answers two questions, and they are kept apart on purpose. {@link getText} is\n * what is DRAWN: the default card, or whatever a `wrGraphNode` template rendered.\n * {@link getRelationText} is what is ANNOUNCED about its place in the graph: the\n * lines are `aria-hidden`, so the visually hidden sentence naming the parents and the\n * children is the only form the structure takes for a screen reader. A spec that read\n * the node's whole text would get both glued together, and would keep passing on a\n * graph whose relation sentences named the wrong neighbours.\n *\n * There is no `getId()`. The component writes a node's id nowhere in the DOM — only\n * an edge carries ids, on its `data-from` / `data-to` — so a node is addressed by what\n * it draws, and {@link WrGraphHarness.getEdges} is where ids are read.\n *\n * @example\n * ```ts\n * const birch = await graph.getNode({ label: 'Birch' });\n *\n * expect(await birch.getText()).toBe('Birch');\n * expect(await birch.getRelationText()).toBe('Parents: Atlas. Children: Dune.');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGraphNodeHarness extends ComponentHarness {\n static hostSelector = '.wr-graph__node';\n\n /**\n * Build a predicate that narrows the query.\n *\n * Typed on `this`, so the predicate is built for whichever node harness it is called\n * on — {@link WrGraphHarness.getNodes} narrows its own, direct-child query through\n * the same options.\n */\n static with<T extends WrGraphNodeHarness>(\n this: ComponentHarnessConstructor<T>,\n options: WrGraphNodeHarnessFilters = {}\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options).addOption('label', options.label, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getText(), label)\n );\n }\n\n /**\n * The text the node DRAWS, trimmed, with the relation sentence left out.\n *\n * The sentence is a real text node inside the block — visually hidden, not removed —\n * so a plain text read would end in `Parents: Atlas. Children: Dune.`. It is excluded\n * rather than subtracted.\n *\n * A `<wr-graph>` a template nests inside the node is left out whole, cards and\n * sentences alike: it is a graph of its own, and its nodes answer to its own harness.\n * So a node drawing `Harbor` above an inner graph of `Kestrel` and `Lark` reads\n * `Harbor`, and a `/Lark/` label does not match it.\n */\n async getText(): Promise<string> {\n return (await this.host()).text({ exclude: NOT_DRAWN_BY_NODE });\n }\n\n /**\n * The sentence a screen reader hears about the node's place in the graph — its\n * parents, then its children, as the catalog words them — or `null` for a node with\n * no edges, which the graph gives no sentence at all.\n *\n * `null` rather than `''`: the component never writes an empty sentence, so an empty\n * string could only mean the element exists and says nothing, which is a different\n * failure from a node that has nothing to say.\n */\n async getRelationText(): Promise<string | null> {\n const relation = await this.locatorForOptional(RELATION)();\n return relation ? relation.text() : null;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrGraphHarnessFilters, WrGraphNodeHarnessFilters } from './types';\nimport { WrGraphNodeHarness } from './wr-graph-node-harness';\n\n/**\n * Every part of the graph is reached down one fixed chain of direct children. A node\n * template may draw anything, including another `<wr-graph>`, and a descendant query\n * from the outer host would count the inner graph's nodes and edges as its own.\n */\nconst VIEWPORT = ':scope > .wr-graph__viewport';\nconst STAGE = `${VIEWPORT} > .wr-graph__stage`;\nconst CONTROL = ':scope > .wr-graph__controls > .wr-graph__control';\nconst EDGE = `${STAGE} > .wr-graph__edges > .wr-graph__edge`;\nconst NODE = `${STAGE} > .wr-graph__nodes > .wr-graph__node`;\n\n/**\n * The same node harness, anchored to one graph. Not exported: queried from any other\n * root the `:scope` would be the wrong element, so a consumer loads\n * {@link WrGraphNodeHarness} and this class only ever comes back from\n * {@link WrGraphHarness.getNodes}.\n */\nclass WrGraphOwnNodeHarness extends WrGraphNodeHarness {\n static override hostSelector = NODE;\n}\n\n/**\n * The filters as a failure message should show them. Not `JSON.stringify`: it prints a\n * RegExp as `{}`, so a caller who had already passed one was shown nothing and then told\n * to use a RegExp. A RegExp reads as its literal, `/source/flags`; everything else as JSON.\n */\nfunction describeFilters(filters: WrGraphNodeHarnessFilters): string {\n const entries: [string, unknown][] = Object.entries(filters);\n const shown = entries\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => `${key}: ${value instanceof RegExp ? String(value) : JSON.stringify(value)}`);\n return shown.length ? `{ ${shown.join(', ')} }` : '{}';\n}\n\n/**\n * Test harness for `<wr-graph>` — blocks joined by parent-child lines, laid out in\n * layers, display only.\n *\n * The graph is read the way assistive technology reads it: the viewport's name, the\n * nodes as a list in READING order (layer, then inline position — which is DOM order),\n * each node's drawn text and its relation sentence, and the edges as the `from` / `to`\n * ids the component writes on each line. Those are what break when the data wiring\n * does.\n *\n * Three methods are deliberately absent, and each would answer the same for a working\n * graph and a broken one:\n *\n * - **No edge path `d`.** A path is a rendering detail: rounded to two decimals, mirrored\n * under RTL, and moved by every node size and gap. The same rule as\n * `WrLineChartHarness`.\n * - **No node positions.** jsdom lays nothing out, so every measured box is 0×0. The\n * inline `transform` IS the component's own write and would be readable, but its\n * numbers belong to the layout, built-in or provided — a harness method returning\n * them would make every layout improvement a breaking change to consumer specs. Coordinates are pinned in the layout's own pure spec, where the arithmetic is.\n * - **No \"is scrollable\".** Overflow is layout: in jsdom `scrollWidth` and `clientWidth`\n * are both 0 for a graph that fits and for one ten times wider. The viewport's\n * `tabindex` is no proxy either — it is always `0`, precisely so the tab stop never\n * depends on a measurement.\n *\n * A `zoomable` graph is driven through its own three buttons, and its zoom is read off\n * the `scale()` the component wrote on the stage. The pan is not readable here for the\n * reason node positions are not: its pixels depend on a viewport box jsdom does not\n * have. Gestures have no method either, since the wheel, a drag and a pinch all read\n * that box.\n *\n * An empty graph and a graph whose layout drew nothing render the same DOM, so the\n * harness cannot tell them apart. {@link getNodes} answers `[]` for both, which is the\n * honest way to assert emptiness; {@link getEdges} refuses instead, because \"no edges\"\n * would be vacuously true of a graph that drew nothing at all.\n *\n * @example\n * ```ts\n * const graph = await loader.getHarness(WrGraphHarness.with({ ariaLabel: 'Team structure' }));\n *\n * expect(await graph.getEdges()).toEqual([{ from: 'atlas', to: 'birch' }]);\n * const birch = await graph.getNode({ label: 'Birch' });\n * expect(await birch.getRelationText()).toBe('Parents: Atlas.');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGraphHarness extends ComponentHarness {\n static hostSelector = 'wr-graph';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGraphHarnessFilters = {}): HarnessPredicate<WrGraphHarness> {\n return new HarnessPredicate(WrGraphHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption(\n 'nodeLabel',\n options.nodeLabel,\n async (harness, label) => (await harness.getNodes({ label })).length > 0\n );\n }\n\n /**\n * The viewport's accessible name — the scroller is the graph's one tab stop and the\n * element that carries it, never the host.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.locatorFor(VIEWPORT)()).getAttribute('aria-label');\n }\n\n /**\n * Whether an asynchronous layout is still running, from the host's\n * `wr-graph--pending`. The graph draws its previous picture meanwhile, so wait\n * for this to turn `false` before reading the nodes of the new one.\n */\n async isPending(): Promise<boolean> {\n return (await this.host()).hasClass('wr-graph--pending');\n }\n\n /**\n * This graph's nodes, in reading order, narrowed by the filters.\n *\n * Only the graph's own: a graph drawn inside one of its node templates has nodes of\n * its own, and they are not this graph's. `[]` for a graph that draws no node — see\n * the class note for why that answer cannot tell empty data from a layout that drew\n * nothing.\n */\n async getNodes(filters: WrGraphNodeHarnessFilters = {}): Promise<WrGraphNodeHarness[]> {\n return this.locatorForAll(WrGraphOwnNodeHarness.with(filters))();\n }\n\n /** The first node matching the filters, or a failure that says what the graph draws. */\n async getNode(filters: WrGraphNodeHarnessFilters): Promise<WrGraphNodeHarness> {\n const [node] = await this.getNodes(filters);\n if (node) return node;\n\n const nodes = await this.getNodes();\n if (!nodes.length) {\n throw new Error(\n `WrGraphHarness.getNode(): no node matched ${describeFilters(filters)} because the graph draws no nodes ` +\n 'at all — its nodes are empty, or its layout returned nothing it could draw.'\n );\n }\n const texts = await Promise.all(nodes.map(each => each.getText()));\n throw new Error(\n `WrGraphHarness.getNode(): no node matched ${describeFilters(filters)}. The graph draws ` +\n `[${texts.join(', ')}] — a label is matched against the DRAWN text, so a template that renders more ` +\n 'than the label needs a RegExp.'\n );\n }\n\n /**\n * One `{ from, to }` per line drawn, read off the path's `data-from` / `data-to` —\n * node ids, the only place the DOM writes one — in the order the edges were given,\n * with the edges the graph skipped left out. Parallel edges each appear, since each is\n * its own line.\n *\n * Throws on a graph that draws no nodes, rather than answering `[]`: that answer would\n * be the same for empty data and for a layout that drew nothing, and a spec asserting\n * \"no edges\" would pass on both.\n */\n async getEdges(): Promise<{ from: string; to: string }[]> {\n if (!(await this.locatorForAll(NODE)()).length) {\n throw new Error(\n 'WrGraphHarness.getEdges(): the graph draws no nodes, so an empty edge list would be vacuously true — ' +\n 'it reads the same for empty data and for a layout that drew nothing. Assert getNodes() is empty ' +\n 'when an empty graph is what the spec means.'\n );\n }\n\n const paths = await this.locatorForAll(EDGE)();\n return Promise.all(\n paths.map(async (path, index) => {\n const [from, to] = await Promise.all([path.getAttribute('data-from'), path.getAttribute('data-to')]);\n if (from === null || to === null) {\n throw new Error(\n `WrGraphHarness.getEdges(): line #${index} carries no data-from / data-to, so which nodes it joins ` +\n 'is not written anywhere a test can read.'\n );\n }\n return { from, to };\n })\n );\n }\n\n /** Whether the graph zooms and pans, from the host's `wr-graph--zoomable`. */\n async isZoomable(): Promise<boolean> {\n return (await this.host()).hasClass('wr-graph--zoomable');\n }\n\n /** Clicks the zoom-in button: one step, around the middle of the viewport. Throws unless `zoomable`. */\n async zoomIn(): Promise<void> {\n await (await this.control('zoom-in', 'zoomIn')).click();\n }\n\n /** Clicks the zoom-out button: one step, around the middle of the viewport. Throws unless `zoomable`. */\n async zoomOut(): Promise<void> {\n await (await this.control('zoom-out', 'zoomOut')).click();\n }\n\n /**\n * Clicks the fit button. Throws unless `zoomable`.\n *\n * A fit needs the viewport's box, and jsdom gives every element a 0×0 one, so there\n * the click changes nothing. A spec that asserts the fitted zoom has to stub\n * `getBoundingClientRect` on the `.wr-graph__viewport` element first.\n */\n async fit(): Promise<void> {\n await (await this.control('fit', 'fit')).click();\n }\n\n /**\n * The zoom the component drew, where `1` is 100%: the `scale()` in the stage's inline\n * `transform`, or `1` when it wrote none. Throws unless `zoomable`, where no zoom is\n * ever drawn and `1` would be vacuously true.\n */\n async getZoom(): Promise<number> {\n if (!(await this.isZoomable())) throw new Error(this.notZoomable('getZoom'));\n const style = (await (await this.locatorFor(STAGE)()).getAttribute('style')) ?? '';\n const scale = /scale\\(([\\d.]+)\\)/.exec(style);\n return scale ? Number(scale[1]) : 1;\n }\n\n private async control(name: string, method: string): Promise<TestElement> {\n const button = await this.locatorForOptional(`${CONTROL}--${name}`)();\n if (!button) throw new Error(this.notZoomable(method));\n return button;\n }\n\n private notZoomable(method: string): string {\n return (\n `WrGraphHarness.${method}(): the graph is not zoomable, so it draws no zoom buttons and never zooms — ` +\n 'bind `zoomable` on <wr-graph> first.'\n );\n }\n}\n"],"mappings":";;;;;;;AAYA,MAAM,UAAU;AAOhB,MAAM,WAAW,YAAY;AAQ7B,MAAM,oBAAoB,GAAG,QAAO;AA2BpC,IAAa,qBAAb,cAAwC,iBAAgB;CACtD,OAAO,eAAe;CAStB,OAAO,KAEL,UAAqC,CAAA,GAAE;EAEvC,OAAO,IAAI,iBAAiB,MAAM,OAAO,CAAC,CAAC,UAAU,SAAS,QAAQ,QAAQ,SAAS,UACrF,iBAAiB,cAAc,QAAQ,QAAO,GAAI,KAAK,CAAC;CAE5D;CAcA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,KAAK,EAAE,SAAS,kBAAiB,CAAE;CAChE;CAWA,MAAM,kBAAe;EACnB,MAAM,WAAW,MAAM,KAAK,mBAAmB,QAAQ,CAAC,CAAA;EACxD,OAAO,WAAW,SAAS,KAAI,IAAK;CACtC;;;;;;;;ACpFF,MAAM,WAAW;AACjB,MAAM,QAAQ,GAAG,SAAQ;AACzB,MAAM,UAAU;AAChB,MAAM,OAAO,GAAG,MAAK;AACrB,MAAM,OAAO,GAAG,MAAK;AAQrB,IAAM,wBAAN,cAAoC,mBAAkB;CACpD,OAAgB,eAAe;;AAQjC,SAAS,gBAAgB,SAAkC;CAEzD,MAAM,QAD+B,OAAO,QAAQ,OACtC,CAAA,CACX,QAAQ,GAAG,WAAW,UAAU,MAAS,CAAC,CAC1C,KAAK,C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AC;EACrD,OAAO;CACT;CAEQ,YAAY,QAAc;EAChC,OACE,kBAAkB,OAAM;CAG5B"}
|
|
1
|
+
{"version":3,"file":"ngwr-graph-testing.mjs","names":[],"sources":["../../../projects/lib/graph/testing/wr-graph-node-harness.ts","../../../projects/lib/graph/testing/wr-graph-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ComponentHarness,\n type ComponentHarnessConstructor,\n HarnessPredicate,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrGraphNodeHarnessFilters } from './types';\n\n/** The visually hidden relation sentence the graph writes into every node that has an edge. */\nconst SR_ONLY = '.wr-graph__sr-only';\n\n/**\n * The node's OWN sentence. Anchored with `:scope >` because the graph writes it as a\n * direct child, after whatever the template drew — so a `<wr-graph>` nested inside a\n * node template would otherwise hand its first node's sentence to the outer node.\n */\nconst RELATION = `:scope > ${SR_ONLY}`;\n\n/** The button a node is while the graph is `selectable`. */\nconst SELECT = ':scope > .wr-graph__select';\n\n/**\n * What {@link WrGraphNodeHarness.getText} leaves out: the node's own sentence, and any\n * `<wr-graph>` a template drew inside the node. That inner graph is a graph of its own —\n * its cards are its nodes, read through its own harness — so counting its text as the\n * outer node's would let a RegExp label match the outer graph by a node it does not own.\n */\nconst NOT_DRAWN_BY_NODE = `${SR_ONLY}, wr-graph`;\n\n/**\n * Test harness for one node of a `<wr-graph>` — a `role=\"listitem\"` block.\n *\n * A node answers two questions, and they are kept apart on purpose. {@link getText} is\n * what is DRAWN: the default card, or whatever a `wrGraphNode` template rendered.\n * {@link getRelationText} is what is ANNOUNCED about its place in the graph: the\n * lines are `aria-hidden`, so the visually hidden sentence naming the parents and the\n * children is the only form the structure takes for a screen reader. A spec that read\n * the node's whole text would get both glued together, and would keep passing on a\n * graph whose relation sentences named the wrong neighbours.\n *\n * There is no `getId()`. The component writes a node's id nowhere in the DOM — only\n * an edge carries ids, on its `data-from` / `data-to` — so a node is addressed by what\n * it draws, and {@link WrGraphHarness.getEdges} is where ids are read.\n *\n * @example\n * ```ts\n * const birch = await graph.getNode({ label: 'Birch' });\n *\n * expect(await birch.getText()).toBe('Birch');\n * expect(await birch.getRelationText()).toBe('Parents: Atlas. Children: Dune.');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGraphNodeHarness extends ComponentHarness {\n static hostSelector = '.wr-graph__node';\n\n /**\n * Build a predicate that narrows the query.\n *\n * Typed on `this`, so the predicate is built for whichever node harness it is called\n * on — {@link WrGraphHarness.getNodes} narrows its own, direct-child query through\n * the same options.\n */\n static with<T extends WrGraphNodeHarness>(\n this: ComponentHarnessConstructor<T>,\n options: WrGraphNodeHarnessFilters = {}\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options).addOption('label', options.label, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getText(), label)\n );\n }\n\n /**\n * The text the node DRAWS, trimmed, with the relation sentence left out.\n *\n * The sentence is a real text node inside the block — visually hidden, not removed —\n * so a plain text read would end in `Parents: Atlas. Children: Dune.`. It is excluded\n * rather than subtracted.\n *\n * A `<wr-graph>` a template nests inside the node is left out whole, cards and\n * sentences alike: it is a graph of its own, and its nodes answer to its own harness.\n * So a node drawing `Harbor` above an inner graph of `Kestrel` and `Lark` reads\n * `Harbor`, and a `/Lark/` label does not match it.\n */\n async getText(): Promise<string> {\n return (await this.host()).text({ exclude: NOT_DRAWN_BY_NODE });\n }\n\n /**\n * The sentence a screen reader hears about the node's place in the graph — its\n * parents, then its children, as the catalog words them — or `null` for a node with\n * no edges, which the graph gives no sentence at all.\n *\n * `null` rather than `''`: the component never writes an empty sentence, so an empty\n * string could only mean the element exists and says nothing, which is a different\n * failure from a node that has nothing to say.\n */\n async getRelationText(): Promise<string | null> {\n const relation = await this.locatorForOptional(RELATION)();\n return relation ? relation.text() : null;\n }\n\n /**\n * Whether the node is the selected one, from its button's `aria-pressed`. `false`\n * on a graph that is not `selectable`, where no node is ever selected.\n */\n async isSelected(): Promise<boolean> {\n const button = await this.locatorForOptional(SELECT)();\n return (await button?.getAttribute('aria-pressed')) === 'true';\n }\n\n /**\n * Whether the node is lit as a neighbour of the selected one: an edge joins the\n * two. `false` for the selected node itself, and while nothing is selected.\n */\n async isLinked(): Promise<boolean> {\n return (await this.host()).hasClass('wr-graph__node--linked');\n }\n\n /**\n * Whether the node is dimmed: another node is selected and no edge joins the two.\n * `false` while nothing is selected.\n */\n async isDimmed(): Promise<boolean> {\n return (await this.host()).hasClass('wr-graph__node--dimmed');\n }\n\n /** Selects the node with a click on its button; leaves a selected node as it is. Throws unless `selectable`. */\n async select(): Promise<void> {\n const button = await this.selectButton('select');\n if ((await button.getAttribute('aria-pressed')) !== 'true') await button.click();\n }\n\n /** Clears the selection if this node holds it, with a click on its button. Throws unless `selectable`. */\n async deselect(): Promise<void> {\n const button = await this.selectButton('deselect');\n if ((await button.getAttribute('aria-pressed')) === 'true') await button.click();\n }\n\n private async selectButton(method: string): Promise<TestElement> {\n const button = await this.locatorForOptional(SELECT)();\n if (button) return button;\n throw new Error(\n `WrGraphNodeHarness.${method}(): the graph is not selectable, so its nodes are not buttons and a click ` +\n 'selects nothing — bind `selectable` on <wr-graph> first.'\n );\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrGraphHarnessFilters, WrGraphNodeHarnessFilters } from './types';\nimport { WrGraphNodeHarness } from './wr-graph-node-harness';\n\n/**\n * Every part of the graph is reached down one fixed chain of direct children. A node\n * template may draw anything, including another `<wr-graph>`, and a descendant query\n * from the outer host would count the inner graph's nodes and edges as its own.\n */\nconst VIEWPORT = ':scope > .wr-graph__viewport';\nconst STAGE = `${VIEWPORT} > .wr-graph__stage`;\nconst CONTROL = ':scope > .wr-graph__controls > .wr-graph__control';\nconst EDGE = `${STAGE} > .wr-graph__edges > .wr-graph__edge`;\nconst NODE = `${STAGE} > .wr-graph__nodes > .wr-graph__node`;\n\n/**\n * The same node harness, anchored to one graph. Not exported: queried from any other\n * root the `:scope` would be the wrong element, so a consumer loads\n * {@link WrGraphNodeHarness} and this class only ever comes back from\n * {@link WrGraphHarness.getNodes}.\n */\nclass WrGraphOwnNodeHarness extends WrGraphNodeHarness {\n static override hostSelector = NODE;\n}\n\n/**\n * The filters as a failure message should show them. Not `JSON.stringify`: it prints a\n * RegExp as `{}`, so a caller who had already passed one was shown nothing and then told\n * to use a RegExp. A RegExp reads as its literal, `/source/flags`; everything else as JSON.\n */\nfunction describeFilters(filters: WrGraphNodeHarnessFilters): string {\n const entries: [string, unknown][] = Object.entries(filters);\n const shown = entries\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => `${key}: ${value instanceof RegExp ? String(value) : JSON.stringify(value)}`);\n return shown.length ? `{ ${shown.join(', ')} }` : '{}';\n}\n\n/**\n * Test harness for `<wr-graph>` — blocks joined by parent-child lines, laid out in\n * layers.\n *\n * The graph is read the way assistive technology reads it: the viewport's name, the\n * nodes as a list in READING order (layer, then inline position — which is DOM order),\n * each node's drawn text and its relation sentence, and the edges as the `from` / `to`\n * ids the component writes on each line. Those are what break when the data wiring\n * does.\n *\n * Three methods are deliberately absent, and each would answer the same for a working\n * graph and a broken one:\n *\n * - **No edge path `d`.** A path is a rendering detail: rounded to two decimals, mirrored\n * under RTL, and moved by every node size and gap. The same rule as\n * `WrLineChartHarness`.\n * - **No node positions.** jsdom lays nothing out, so every measured box is 0×0. The\n * inline `transform` IS the component's own write and would be readable, but its\n * numbers belong to the layout, built-in or provided — a harness method returning\n * them would make every layout improvement a breaking change to consumer specs. Coordinates are pinned in the layout's own pure spec, where the arithmetic is.\n * - **No \"is scrollable\".** Overflow is layout: in jsdom `scrollWidth` and `clientWidth`\n * are both 0 for a graph that fits and for one ten times wider. The viewport's\n * `tabindex` is no proxy either — it is always `0`, precisely so the tab stop never\n * depends on a measurement.\n *\n * A `zoomable` graph is driven through its own three buttons, and its zoom is read off\n * the `scale()` the component wrote on the stage. The pan is not readable here for the\n * reason node positions are not: its pixels depend on a viewport box jsdom does not\n * have. Gestures have no method either, since the wheel, a drag and a pinch all read\n * that box.\n *\n * An empty graph and a graph whose layout drew nothing render the same DOM, so the\n * harness cannot tell them apart. {@link getNodes} answers `[]` for both, which is the\n * honest way to assert emptiness; {@link getEdges} refuses instead, because \"no edges\"\n * would be vacuously true of a graph that drew nothing at all.\n *\n * @example\n * ```ts\n * const graph = await loader.getHarness(WrGraphHarness.with({ ariaLabel: 'Team structure' }));\n *\n * expect(await graph.getEdges()).toEqual([{ from: 'atlas', to: 'birch' }]);\n * const birch = await graph.getNode({ label: 'Birch' });\n * expect(await birch.getRelationText()).toBe('Parents: Atlas.');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGraphHarness extends ComponentHarness {\n static hostSelector = 'wr-graph';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGraphHarnessFilters = {}): HarnessPredicate<WrGraphHarness> {\n return new HarnessPredicate(WrGraphHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption(\n 'nodeLabel',\n options.nodeLabel,\n async (harness, label) => (await harness.getNodes({ label })).length > 0\n );\n }\n\n /**\n * The viewport's accessible name — the scroller is the graph's one tab stop and the\n * element that carries it, never the host.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.locatorFor(VIEWPORT)()).getAttribute('aria-label');\n }\n\n /**\n * Whether an asynchronous layout is still running, from the host's\n * `wr-graph--pending`. The graph draws its previous picture meanwhile, so wait\n * for this to turn `false` before reading the nodes of the new one.\n */\n async isPending(): Promise<boolean> {\n return (await this.host()).hasClass('wr-graph--pending');\n }\n\n /**\n * This graph's nodes, in reading order, narrowed by the filters.\n *\n * Only the graph's own: a graph drawn inside one of its node templates has nodes of\n * its own, and they are not this graph's. `[]` for a graph that draws no node — see\n * the class note for why that answer cannot tell empty data from a layout that drew\n * nothing.\n */\n async getNodes(filters: WrGraphNodeHarnessFilters = {}): Promise<WrGraphNodeHarness[]> {\n return this.locatorForAll(WrGraphOwnNodeHarness.with(filters))();\n }\n\n /** The first node matching the filters, or a failure that says what the graph draws. */\n async getNode(filters: WrGraphNodeHarnessFilters): Promise<WrGraphNodeHarness> {\n const [node] = await this.getNodes(filters);\n if (node) return node;\n\n const nodes = await this.getNodes();\n if (!nodes.length) {\n throw new Error(\n `WrGraphHarness.getNode(): no node matched ${describeFilters(filters)} because the graph draws no nodes ` +\n 'at all — its nodes are empty, or its layout returned nothing it could draw.'\n );\n }\n const texts = await Promise.all(nodes.map(each => each.getText()));\n throw new Error(\n `WrGraphHarness.getNode(): no node matched ${describeFilters(filters)}. The graph draws ` +\n `[${texts.join(', ')}] — a label is matched against the DRAWN text, so a template that renders more ` +\n 'than the label needs a RegExp.'\n );\n }\n\n /**\n * One `{ from, to }` per line drawn, read off the path's `data-from` / `data-to` —\n * node ids, the only place the DOM writes one — in the order the edges were given,\n * with the edges the graph skipped left out. Parallel edges each appear, since each is\n * its own line.\n *\n * Throws on a graph that draws no nodes, rather than answering `[]`: that answer would\n * be the same for empty data and for a layout that drew nothing, and a spec asserting\n * \"no edges\" would pass on both.\n */\n async getEdges(): Promise<{ from: string; to: string }[]> {\n if (!(await this.locatorForAll(NODE)()).length) {\n throw new Error(\n 'WrGraphHarness.getEdges(): the graph draws no nodes, so an empty edge list would be vacuously true — ' +\n 'it reads the same for empty data and for a layout that drew nothing. Assert getNodes() is empty ' +\n 'when an empty graph is what the spec means.'\n );\n }\n\n const paths = await this.locatorForAll(EDGE)();\n return Promise.all(\n paths.map(async (path, index) => {\n const [from, to] = await Promise.all([path.getAttribute('data-from'), path.getAttribute('data-to')]);\n if (from === null || to === null) {\n throw new Error(\n `WrGraphHarness.getEdges(): line #${index} carries no data-from / data-to, so which nodes it joins ` +\n 'is not written anywhere a test can read.'\n );\n }\n return { from, to };\n })\n );\n }\n\n /** Whether a node can be selected, from the host's `wr-graph--selectable`. */\n async isSelectable(): Promise<boolean> {\n return (await this.host()).hasClass('wr-graph--selectable');\n }\n\n /**\n * The selected node, or `null` while none is — which is also the answer on a graph\n * that is not `selectable`, and for a `selected` id no drawn node has.\n */\n async getSelectedNode(): Promise<WrGraphNodeHarness | null> {\n for (const node of await this.getNodes()) {\n if (await node.isSelected()) return node;\n }\n return null;\n }\n\n /** Whether the graph zooms and pans, from the host's `wr-graph--zoomable`. */\n async isZoomable(): Promise<boolean> {\n return (await this.host()).hasClass('wr-graph--zoomable');\n }\n\n /** Clicks the zoom-in button: one step, around the middle of the viewport. Throws unless `zoomable`. */\n async zoomIn(): Promise<void> {\n await (await this.control('zoom-in', 'zoomIn')).click();\n }\n\n /** Clicks the zoom-out button: one step, around the middle of the viewport. Throws unless `zoomable`. */\n async zoomOut(): Promise<void> {\n await (await this.control('zoom-out', 'zoomOut')).click();\n }\n\n /**\n * Clicks the fit button. Throws unless `zoomable`.\n *\n * A fit needs the viewport's box, and jsdom gives every element a 0×0 one, so there\n * the click changes nothing. A spec that asserts the fitted zoom has to stub\n * `getBoundingClientRect` on the `.wr-graph__viewport` element first.\n */\n async fit(): Promise<void> {\n await (await this.control('fit', 'fit')).click();\n }\n\n /**\n * The zoom the component drew, where `1` is 100%: the `scale()` in the stage's inline\n * `transform`, or `1` when it wrote none. Throws unless `zoomable`, where no zoom is\n * ever drawn and `1` would be vacuously true.\n */\n async getZoom(): Promise<number> {\n if (!(await this.isZoomable())) throw new Error(this.notZoomable('getZoom'));\n const style = (await (await this.locatorFor(STAGE)()).getAttribute('style')) ?? '';\n const scale = /scale\\(([\\d.]+)\\)/.exec(style);\n return scale ? Number(scale[1]) : 1;\n }\n\n private async control(name: string, method: string): Promise<TestElement> {\n const button = await this.locatorForOptional(`${CONTROL}--${name}`)();\n if (!button) throw new Error(this.notZoomable(method));\n return button;\n }\n\n private notZoomable(method: string): string {\n return (\n `WrGraphHarness.${method}(): the graph is not zoomable, so it draws no zoom buttons and never zooms — ` +\n 'bind `zoomable` on <wr-graph> first.'\n );\n }\n}\n"],"mappings":";;;;;;;AAiBA,MAAM,UAAU;AAOhB,MAAM,WAAW,YAAY;AAG7B,MAAM,SAAS;AAQf,MAAM,oBAAoB,GAAG,QAAO;AA2BpC,IAAa,qBAAb,cAAwC,iBAAgB;CACtD,OAAO,eAAe;CAStB,OAAO,KAEL,UAAqC,CAAA,GAAE;EAEvC,OAAO,IAAI,iBAAiB,MAAM,OAAO,CAAC,CAAC,UAAU,SAAS,QAAQ,QAAQ,SAAS,UACrF,iBAAiB,cAAc,QAAQ,QAAO,GAAI,KAAK,CAAC;CAE5D;CAcA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,KAAK,EAAE,SAAS,kBAAiB,CAAE;CAChE;CAWA,MAAM,kBAAe;EACnB,MAAM,WAAW,MAAM,KAAK,mBAAmB,QAAQ,CAAC,CAAA;EACxD,OAAO,WAAW,SAAS,KAAI,IAAK;CACtC;CAMA,MAAM,aAAU;EAEd,OAAQ,OAAM,MADO,KAAK,mBAAmB,MAAM,CAAC,CAAA,EACtC,EAAQ,aAAa,cAAc,MAAO;CAC1D;CAMA,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,SAAS,wBAAwB;CAC9D;CAMA,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,SAAS,wBAAwB;CAC9D;CAGA,MAAM,SAAM;EACV,MAAM,SAAS,MAAM,KAAK,aAAa,QAAQ;EAC/C,IAAK,MAAM,OAAO,aAAa,cAAc,MAAO,QAAQ,MAAM,OAAO,MAAK;CAChF;CAGA,MAAM,WAAQ;EACZ,MAAM,SAAS,MAAM,KAAK,aAAa,UAAU;EACjD,IAAK,MAAM,OAAO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