ngwr 16.5.0 → 16.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/avatar/styles/_index.scss +39 -0
- package/back-top/styles/_index.scss +6 -0
- package/breadcrumbs/styles/_rules.scss +34 -0
- package/button/styles/_index.scss +45 -2
- package/cascader/styles/_rules.scss +7 -0
- package/charts/chart-legend/styles/_index.scss +1 -9
- package/copy-value/styles/_index.scss +4 -0
- package/counter/styles/_index.scss +1 -8
- package/date-picker/styles/_index.scss +15 -9
- package/dialog/styles/_index.scss +37 -0
- package/dropdown/styles/_index.scss +17 -0
- package/editor/styles/_index.scss +1 -8
- package/event-calendar/styles/_index.scss +2 -6
- package/fesm2022/ngwr-affix.mjs +4 -4
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +12 -5
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs.map +1 -1
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs.map +1 -1
- 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-orbit.mjs.map +1 -1
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-tilt.mjs +23 -16
- package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
- 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 +47 -13
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +38 -9
- 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 +14 -8
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +27 -7
- 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 +18 -11
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- 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 +7 -5
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- 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 +9 -8
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +27 -7
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- 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 +16 -17
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- 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 +151 -54
- 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 +35 -24
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +189 -23
- 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 +27 -15
- 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 +181 -12
- 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 +21 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +21 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +21 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +21 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +21 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +21 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +21 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +21 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +21 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +21 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +21 -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 +21 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +21 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +21 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +21 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +21 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +21 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +21 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +21 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +21 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +21 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +21 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +91 -20
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- 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 +27 -4
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +5 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +25 -17
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +9 -9
- 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-router.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +8 -8
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +14 -6
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +15 -12
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +9 -9
- package/fesm2022/ngwr-page-header.mjs +24 -3
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +3 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +34 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +35 -28
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +9 -7
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +162 -18
- 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 +9 -5
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +77 -11
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- 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 +20 -7
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +233 -10
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +23 -3
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +106 -26
- 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 +27 -15
- 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 +4 -4
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +5 -5
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- 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 +307 -47
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +9 -5
- 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 +5 -5
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +43 -15
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +9 -8
- 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 +23 -3
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +74 -4
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +33 -1
- package/fesm2022/ngwr-validators.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/form/styles/_index.scss +37 -0
- package/graph/styles/_index.scss +49 -9
- package/i18n/ar.json +19 -2
- package/i18n/cs.json +19 -2
- package/i18n/de.json +19 -2
- package/i18n/en.json +19 -2
- package/i18n/es.json +19 -2
- package/i18n/fr.json +19 -2
- package/i18n/he.json +19 -2
- package/i18n/hi.json +19 -2
- package/i18n/id.json +19 -2
- package/i18n/it.json +19 -2
- package/i18n/ja.json +19 -2
- package/i18n/kk.json +567 -0
- package/i18n/ko.json +19 -2
- package/i18n/nl.json +19 -2
- package/i18n/pl.json +19 -2
- package/i18n/pt.json +19 -2
- package/i18n/ru.json +19 -2
- package/i18n/sv.json +19 -2
- package/i18n/tr.json +19 -2
- package/i18n/uk.json +19 -2
- package/i18n/vi.json +19 -2
- package/i18n/zh-TW.json +19 -2
- package/i18n/zh.json +19 -2
- package/image-cropper/styles/_index.scss +1 -9
- package/input-number/styles/_index.scss +7 -0
- package/layout/styles/_index.scss +13 -1
- package/llms-full.txt +37 -26
- package/llms.txt +4 -1
- package/loading-bar/styles/_rules.scss +6 -0
- package/package.json +16 -8
- package/page-header/styles/_index.scss +18 -0
- package/pagination/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +9 -0
- package/progress/styles/_index.scss +64 -0
- package/schematics/use/symbol-map.json +7 -0
- package/segmented/styles/_index.scss +7 -0
- package/select/styles/_index.scss +7 -0
- package/sidebar/styles/_index.scss +64 -6
- package/skills/ngwr/SKILL.md +7 -6
- package/skills/ngwr/references/catalog.md +7 -5
- package/sortable-list/styles/_rules.scss +1 -9
- package/speed-dial/styles/_index.scss +6 -0
- package/stepper/styles/_index.scss +1 -9
- package/table/styles/_index.scss +168 -30
- package/tabs/styles/_index.scss +9 -0
- package/theme/_index.scss +12 -1
- package/theme/styles/_colors.scss +11 -0
- package/theme/styles/_contrast.scss +6 -0
- package/theme/styles/_focus.scss +3 -1
- package/theme/styles/_index.scss +1 -0
- package/theme/styles/_mixins.scss +45 -0
- package/theme/styles/_print.scss +17 -0
- package/toast/styles/_index.scss +7 -0
- package/tour/styles/_index.scss +9 -0
- package/tree/styles/_index.scss +1 -9
- package/types/ngwr-anchor.d.ts +3 -0
- package/types/ngwr-animations-aurora.d.ts +6 -0
- package/types/ngwr-animations-blur-reveal.d.ts +6 -0
- package/types/ngwr-animations-click-sparks.d.ts +6 -0
- package/types/ngwr-animations-confetti.d.ts +6 -0
- package/types/ngwr-animations-decode.d.ts +6 -0
- package/types/ngwr-animations-destruct.d.ts +6 -0
- package/types/ngwr-animations-dot-grid.d.ts +6 -0
- package/types/ngwr-animations-falling-letters.d.ts +6 -0
- package/types/ngwr-animations-flow-lines.d.ts +6 -0
- package/types/ngwr-animations-fluid-cursor.d.ts +6 -0
- package/types/ngwr-animations-glitch.d.ts +6 -0
- package/types/ngwr-animations-glow-border.d.ts +6 -0
- package/types/ngwr-animations-gradient-flow.d.ts +6 -0
- package/types/ngwr-animations-marquee.d.ts +6 -0
- package/types/ngwr-animations-orbit.d.ts +6 -0
- package/types/ngwr-animations-reveal.d.ts +6 -0
- package/types/ngwr-animations-ripple-grid.d.ts +6 -0
- package/types/ngwr-animations-rotate-reveal.d.ts +6 -0
- package/types/ngwr-animations-shimmer.d.ts +6 -0
- package/types/ngwr-animations-spotlight.d.ts +6 -0
- package/types/ngwr-animations-thread-lines.d.ts +6 -0
- package/types/ngwr-animations-tilt.d.ts +10 -0
- package/types/ngwr-animations-typewriter.d.ts +6 -0
- package/types/ngwr-avatar.d.ts +39 -0
- package/types/ngwr-breadcrumbs.d.ts +25 -0
- package/types/ngwr-button.d.ts +35 -3
- package/types/ngwr-carousel.d.ts +2 -0
- package/types/ngwr-cascader.d.ts +7 -0
- package/types/ngwr-charts-core.d.ts +16 -0
- package/types/ngwr-charts-meter-group.d.ts +2 -0
- package/types/ngwr-checkbox.d.ts +1 -0
- package/types/ngwr-color-picker.d.ts +1 -0
- package/types/ngwr-context-menu.d.ts +1 -1
- package/types/ngwr-date-picker-testing.d.ts +22 -0
- package/types/ngwr-date-picker.d.ts +97 -17
- package/types/ngwr-date.d.ts +51 -0
- package/types/ngwr-dialog.d.ts +39 -8
- package/types/ngwr-directives.d.ts +57 -4
- package/types/ngwr-drawer.d.ts +1 -1
- package/types/ngwr-dropdown-testing.d.ts +8 -1
- package/types/ngwr-dropdown.d.ts +30 -1
- package/types/ngwr-event-calendar.d.ts +4 -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 +87 -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-i18n.d.ts +65 -5
- package/types/ngwr-image-cropper.d.ts +6 -0
- package/types/ngwr-input-number.d.ts +8 -0
- package/types/ngwr-input.d.ts +7 -0
- package/types/ngwr-layout.d.ts +1 -1
- package/types/ngwr-loading-bar-router.d.ts +6 -0
- package/types/ngwr-page-header.d.ts +23 -1
- package/types/ngwr-pagination-testing.d.ts +8 -0
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-popconfirm.d.ts +1 -1
- package/types/ngwr-popover.d.ts +67 -4
- package/types/ngwr-progress.d.ts +63 -1
- package/types/ngwr-radio.d.ts +47 -5
- package/types/ngwr-scroll.d.ts +86 -0
- package/types/ngwr-segmented.d.ts +7 -0
- package/types/ngwr-select.d.ts +88 -25
- package/types/ngwr-sidebar-testing.d.ts +21 -7
- package/types/ngwr-sidebar.d.ts +66 -4
- package/types/ngwr-sortable-list.d.ts +20 -7
- package/types/ngwr-table-router.d.ts +49 -0
- package/types/ngwr-table-testing.d.ts +7 -0
- package/types/ngwr-table.d.ts +241 -10
- package/types/ngwr-tabs-router.d.ts +7 -1
- package/types/ngwr-tabs-testing.d.ts +5 -1
- package/types/ngwr-tabs.d.ts +34 -1
- package/types/ngwr-toast.d.ts +11 -0
- package/types/ngwr-tour.d.ts +0 -1
- package/types/ngwr-typography.d.ts +7 -0
- package/types/ngwr-utils-router.d.ts +6 -0
- package/types/ngwr-utils.d.ts +69 -2
- package/types/ngwr-validators.d.ts +49 -1
- package/types/ngwr-version.d.ts +1 -1
- package/typography/styles/_index.scss +4 -0
- package/window/styles/_index.scss +1 -9
|
@@ -17,6 +17,10 @@ const MATCH = {
|
|
|
17
17
|
fragment: "ignored",
|
|
18
18
|
matrixParams: "ignored"
|
|
19
19
|
};
|
|
20
|
+
const MATCH_EXACT = {
|
|
21
|
+
...MATCH,
|
|
22
|
+
paths: "exact"
|
|
23
|
+
};
|
|
20
24
|
var WrTabsRouting = class WrTabsRouting {
|
|
21
25
|
router = inject(Router);
|
|
22
26
|
locationStrategy = inject(LocationStrategy);
|
|
@@ -26,9 +30,9 @@ var WrTabsRouting = class WrTabsRouting {
|
|
|
26
30
|
this.url();
|
|
27
31
|
return this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.tree(commands)));
|
|
28
32
|
}
|
|
29
|
-
isActive(commands) {
|
|
33
|
+
isActive(commands, exact = false) {
|
|
30
34
|
this.url();
|
|
31
|
-
return this.router.isActive(this.tree(commands), MATCH);
|
|
35
|
+
return this.router.isActive(this.tree(commands), exact ? MATCH_EXACT : MATCH);
|
|
32
36
|
}
|
|
33
37
|
navigate(commands, event) {
|
|
34
38
|
if (event.button !== 0 || event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) return;
|
|
@@ -41,7 +45,7 @@ var WrTabsRouting = class WrTabsRouting {
|
|
|
41
45
|
}
|
|
42
46
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
43
47
|
minVersion: "12.0.0",
|
|
44
|
-
version: "22.
|
|
48
|
+
version: "22.3.0",
|
|
45
49
|
ngImport: i0,
|
|
46
50
|
type: WrTabsRouting,
|
|
47
51
|
deps: [],
|
|
@@ -49,7 +53,7 @@ var WrTabsRouting = class WrTabsRouting {
|
|
|
49
53
|
});
|
|
50
54
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
51
55
|
minVersion: "14.0.0",
|
|
52
|
-
version: "22.
|
|
56
|
+
version: "22.3.0",
|
|
53
57
|
type: WrTabsRouting,
|
|
54
58
|
isStandalone: true,
|
|
55
59
|
selector: "[wrTabsRouting]",
|
|
@@ -63,7 +67,7 @@ var WrTabsRouting = class WrTabsRouting {
|
|
|
63
67
|
};
|
|
64
68
|
i0.ɵɵngDeclareClassMetadata({
|
|
65
69
|
minVersion: "12.0.0",
|
|
66
|
-
version: "22.
|
|
70
|
+
version: "22.3.0",
|
|
67
71
|
ngImport: i0,
|
|
68
72
|
type: WrTabsRouting,
|
|
69
73
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-tabs-router.mjs","names":[],"sources":["../../../projects/lib/tabs/router/tabs-routing.ts"
|
|
1
|
+
{"version":3,"file":"ngwr-tabs-router.mjs","names":[],"sources":["../../../projects/lib/tabs/router/tabs-routing.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 { LocationStrategy } from '@angular/common';\nimport { Directive, forwardRef, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, type IsActiveMatchOptions, NavigationEnd, Router, type UrlTree } from '@angular/router';\n\nimport { filter, map, startWith } from 'rxjs';\n\nimport { WR_TABS_ROUTING, type WrTabsRoutingAdapter } from 'ngwr/tabs';\n\n/**\n * How `routerLinkActive` matches when no `[routerLinkActiveOptions]` is given:\n * a path PREFIX, so `/settings/profile` still selects a `/settings` tab, and a\n * fragment or a matrix param never unselects one.\n */\nconst MATCH: IsActiveMatchOptions = {\n paths: 'subset',\n queryParams: 'subset',\n fragment: 'ignored',\n matrixParams: 'ignored',\n};\n\n/** `exact` on a tab: the path must match whole, everything else as in `MATCH`. */\nconst MATCH_EXACT: IsActiveMatchOptions = { ...MATCH, paths: 'exact' };\n\n/**\n * Router support for `<wr-tabs>`. Add it to the `imports` of the component that\n * declares a strip whose `<wr-tab>`s carry a `routerLink`:\n *\n * @example\n * ```ts\n * import { WrTab, WrTabs } from 'ngwr/tabs';\n * import { WrTabsRouting } from 'ngwr/tabs/router';\n *\n * @Component({ imports: [WrTabs, WrTab, WrTabsRouting], template: `\n * <wr-tabs wrTabsRouting>\n * <wr-tab title=\"Overview\" routerLink=\"overview\" />\n * <wr-tab title=\"Details\" routerLink=\"details\" />\n * </wr-tabs>\n * <router-outlet />\n * ` })\n * export class SettingsPage {}\n * ```\n *\n * Two mechanical edits per strip, both codemoddable: the symbol in `imports`,\n * and `wrTabsRouting` on the element. An attribute rather than a selector on\n * `wr-tabs` itself, for two reasons — where the router enters a template should\n * be visible in that template, and the docs' selector map keys a `wr-` tag\n * even when it is qualified, so `wr-tabs[wrTabsRouting]` would be a second claim\n * on the `wr-tabs` tag. Putting it on an ANCESTOR of the strip also works: the\n * token is read through the element injector, which walks up.\n *\n * **Why it is a separate entry point.** A directive listed in `imports: []`\n * lands in the compiled component's `dependencies` whether or not the branch of\n * the template that matches it ever runs, so `RouterLink` + `RouterLinkActive`\n * on the strip charged every CONTENT tab strip 73.9 kB of `@angular/router` —\n * 51% of what `ngwr/tabs` cost in an app that declares no routes. Measured with\n * source-map attribution against a routerless baseline. `@angular/router` is\n * already an optional peer dependency of the package; this is what makes that\n * true in bytes.\n *\n * **Why a directive rather than a provider function.** A relative `routerLink`\n * (`routerLink=\"overview\"`) resolves against the `ActivatedRoute` of the\n * component that declares the strip. A root-level provider would resolve every\n * one of them against the root route instead, and quietly build the wrong\n * hrefs; a directive on the element reads the same `ActivatedRoute` the old\n * `RouterLink` inside the strip's template did.\n */\n@Directive({\n selector: '[wrTabsRouting]',\n exportAs: 'wrTabsRouting',\n providers: [\n {\n provide: WR_TABS_ROUTING,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrTabsRouting),\n },\n ],\n})\nexport class WrTabsRouting implements WrTabsRoutingAdapter {\n private readonly router = inject(Router);\n private readonly locationStrategy = inject(LocationStrategy);\n private readonly route = inject(ActivatedRoute);\n\n /**\n * The current URL, as a signal, so `href()` and `isActive()` are reactive to\n * navigation when read from a computed. `isActive` obviously has to be; so\n * does `href`, because a RELATIVE link is resolved against the active route\n * and its target moves when the route does — which is why `RouterLink`\n * recomputes its own href on every navigation too.\n */\n private readonly url = toSignal(\n this.router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n map(e => e.urlAfterRedirects),\n startWith(this.router.url)\n ),\n { initialValue: this.router.url }\n );\n\n href(commands: string | readonly string[]): string {\n // Read for the dependency, the same reason `isActive` does: a RELATIVE link\n // resolves against the active route, so its target moves when the route\n // does. Without this a strip inside `/users/:id` kept rendering\n // `/users/1/profile` after navigating to user 2 — the click still routed,\n // because `navigate()` rebuilds the tree, but the visible href pointed at\n // the previous user. The docblock above already promised this; the code did\n // not do it.\n this.url();\n\n // `prepareExternalUrl`, not a bare `serializeUrl`, because that is what\n // `RouterLink` writes and the href exists precisely so the BROWSER can use\n // it. Under `withHashLocation()` a serialized `/one` renders as an href the\n // app does not serve: a plain click survives (`navigateByUrl` ignores the\n // strategy and `preventDefault` stops the bad navigation) but cmd-click,\n // middle-click, \"open in new tab\" and \"copy link address\" all take the href\n // at face value — the four things rendering one is for. A `--base-href` is\n // the same defect by another door.\n return this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.tree(commands)));\n }\n\n isActive(commands: string | readonly string[], exact = false): boolean {\n // Read for the dependency, not for the value: `isActive` asks the router,\n // which is not a signal, so without this the computed that calls it would\n // never recompute and the strip would announce its first selection forever.\n this.url();\n return this.router.isActive(this.tree(commands), exact ? MATCH_EXACT : MATCH);\n }\n\n navigate(commands: string | readonly string[], event: MouseEvent): void {\n // Exactly the guard `RouterLink` applies: a middle click, or any click with\n // a modifier held, belongs to the browser — preventing it would make a tab\n // the one link on the page that cannot be opened in a new window.\n if (event.button !== 0 || event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) return;\n event.preventDefault();\n void this.router.navigateByUrl(this.tree(commands));\n }\n\n private tree(commands: string | readonly string[]): UrlTree {\n // A bare string is one command, the way `[routerLink]=\"'overview'\"` is —\n // spread as characters it would navigate to `/o/v/e/r/v/i/e/w`.\n const segments = typeof commands === 'string' ? [commands] : [...commands];\n return this.router.createUrlTree(segments, { relativeTo: this.route });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,MAAM,QAA8B;CAClC,OAAO;CACP,aAAa;CACb,UAAU;CACV,cAAc;AACf;AAGD,MAAM,cAAoC;CAAE,GAAG;CAAO,OAAO;AAAO;AAwDpE,IAAa,gBAAb,MAAa,cAAa;CACP,SAAS,OAAO,MAAM;CACtB,mBAAmB,OAAO,gBAAgB;CAC1C,QAAQ,OAAO,cAAc;CAS7B,MAAM,SACrB,KAAK,OAAO,OAAO,KACjB,QAAQ,MAA0B,aAAa,aAAa,GAC5D,KAAI,MAAK,EAAE,iBAAiB,GAC5B,UAAU,KAAK,OAAO,GAAG,CAAC,GAE5B,EAAE,cAAc,KAAK,OAAO,IAAG,CAAE;CAGnC,KAAK,UAAoC;EAQvC,KAAK,IAAG;EAUR,OAAO,KAAK,iBAAiB,mBAAmB,KAAK,OAAO,aAAa,KAAK,KAAK,QAAQ,CAAC,CAAC;CAC/F;CAEA,SAAS,UAAsC,QAAQ,OAAK;EAI1D,KAAK,IAAG;EACR,OAAO,KAAK,OAAO,SAAS,KAAK,KAAK,QAAQ,GAAG,QAAQ,cAAc,KAAK;CAC9E;CAEA,SAAS,UAAsC,OAAiB;EAI9D,IAAI,MAAM,WAAW,KAAK,MAAM,WAAW,MAAM,YAAY,MAAM,UAAU,MAAM,SAAS;EAC5F,MAAM,eAAc;EACpB,AAAK,KAAK,OAAO,cAAc,KAAK,KAAK,QAAQ,CAAC;CACpD;CAEQ,KAAK,UAAoC;EAG/C,MAAM,WAAW,OAAO,aAAa,WAAW,CAAC,QAAQ,IAAI,CAAC,GAAG,QAAQ;EACzE,OAAO,KAAK,OAAO,cAAc,UAAU,EAAE,YAAY,KAAK,MAAK,CAAE;CACvE;CAhEW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,WARb,CACT;GACE,SAAS;GAET,aAAa,iBAAiB,aAAa;EAC5C,CACF;EAAA,UAAA,CAAA,eAAA;EAAA,UAAA;CAAA,CAAA;;AAEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAXzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,WAAW,CACT;IACE,SAAS;IAET,aAAa,iBAAgB,aAAc;GAC5C,CACF;EACF,CAAA"}
|
|
@@ -11,7 +11,14 @@ var WrTabHarness = class WrTabHarness extends ContentContainerComponentHarness {
|
|
|
11
11
|
return new HarnessPredicate(WrTabHarness, options).addOption("label", options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label)).addOption("selected", options.selected, async (harness, selected) => await harness.isSelected() === selected).addOption("disabled", options.disabled, async (harness, disabled) => await harness.isDisabled() === disabled);
|
|
12
12
|
}
|
|
13
13
|
async getLabel() {
|
|
14
|
-
return (await this.
|
|
14
|
+
return (await this.locatorFor(".wr-tabs__tab-label")()).text();
|
|
15
|
+
}
|
|
16
|
+
async getCount() {
|
|
17
|
+
const badge = await this.locatorForOptional(".wr-tabs__count")();
|
|
18
|
+
return badge ? Number(await badge.text()) : null;
|
|
19
|
+
}
|
|
20
|
+
async getAccessibleName() {
|
|
21
|
+
return await (await this.host()).getAttribute("aria-label") ?? await this.getLabel();
|
|
15
22
|
}
|
|
16
23
|
async getId() {
|
|
17
24
|
return (await this.host()).getAttribute("id");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-tabs-testing.mjs","names":[],"sources":["../../../projects/lib/tabs/testing/wr-tab-harness.ts","../../../projects/lib/tabs/testing/wr-tabs-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 ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters } from './types';\n\n/**\n * Test harness for one tab of a `<wr-tabs>` strip — the header, and the panel it\n * controls.\n *\n * Its host is the RENDERED HEADER, not the `<wr-tab>` element. A `<wr-tab>` is\n * `display:none` and holds nothing but a `<ng-template>`: the label, the selection\n * state, the tab stop and the click target all live on the element the parent\n * renders for it, which is a `<button role=\"tab\">` in content mode and an\n * `<a role=\"tab\">` in router mode. A harness hosted on `wr-tab` would answer every\n * question with nothing.\n *\n * Also a CONTENT CONTAINER, scoped to the panel this tab controls, so\n * `tab.getHarness(WrButtonHarness…)` reaches the consumer's own components inside\n * the tab's content. The panel is not a descendant of the header — it is a sibling\n * of the whole strip — so it is resolved through the `aria-controls` id, which is\n * also the pairing {@link isPanelBound} checks. Only the SELECTED tab has a panel\n * to reach: `<wr-tabs>` renders one panel and destroys it on every switch.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n * const [first] = await tabs.getTabs();\n *\n * expect(await first.isSelected()).toBe(true);\n * expect(await first.isPanelBound()).toBe(true);\n * await (await first.getHarness(WrButtonHarness.with({ text: 'Save' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabHarness extends ContentContainerComponentHarness {\n /** The header the strip renders for a `<wr-tab>` — a `<button>`, or an `<a>` in router mode. */\n static hostSelector = '.wr-tabs__tab';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabHarnessFilters = {}): HarnessPredicate<WrTabHarness> {\n return new HarnessPredicate(WrTabHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The tab's visible label, trimmed — the `<wr-tab>`'s `title`. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * The header's own id, which is what the panel points back at with\n * `aria-labelledby` — the tab is the panel's accessible name.\n *\n * Generated from the tab's `key`, so two strips on one page whose tabs share keys\n * publish the same ids and each panel then names whichever header came first.\n */\n async getId(): Promise<string | null> {\n return (await this.host()).getAttribute('id');\n }\n\n /**\n * Whether this is the strip's selected tab.\n *\n * `aria-selected` first, because that is the state a screen reader acts on and\n * the `--active` class is only what it looks like. Both shapes carry it now — a\n * router tab publishes it off the same `routerActive()` that paints the class —\n * so the class is a fallback for a tab that has neither yet, not a second reading\n * of the same thing. The order is not interchangeable: reading the class first\n * would report a tab as selected while `aria-selected=\"false\"` told assistive tech\n * otherwise.\n */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n const selected = await host.getAttribute('aria-selected');\n if (selected !== null) return selected === 'true';\n return host.hasClass('wr-tabs__tab--active');\n }\n\n /**\n * Whether the tab refuses activation.\n *\n * The two shapes say it differently and both are read: a content tab is a real\n * `<button>` and carries the native `disabled`, a router tab is an `<a>` — which\n * cannot be disabled natively — and carries `aria-disabled` with `tabindex=\"-1\"`.\n * The `--disabled` class is on both and is deliberately not the source: a class\n * says how the tab looks, these two say what it refuses.\n */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n if ((await host.getAttribute('aria-disabled')) === 'true') return true;\n return (await host.getProperty<boolean | undefined>('disabled')) === true;\n }\n\n /** Whether this tab is a link — the router shape, where selection follows the route. */\n async isLink(): Promise<boolean> {\n return (await this.host()).matchesSelector('a');\n }\n\n /**\n * The resolved href of a router tab, or `null` for a content tab.\n *\n * `null` is the answer for a `<button>` rather than a gap — a content tab\n * navigates nowhere, it swaps a panel.\n */\n async getHref(): Promise<string | null> {\n return (await this.host()).getAttribute('href');\n }\n\n /**\n * Whether a Tab press can land on this header.\n *\n * Either strip is ONE tab stop: a content strip hands it to the selected tab, or\n * to the first enabled one while the selected tab is disabled; a router strip to\n * the tab the route selects, or to the first enabled one while no route matches.\n * See `WrTabsHarness.getTabStopLabels()`.\n *\n * `disabled` is read as well as `tabindex`, because no Tab press reaches a\n * disabled button whatever its `tabindex` says, and jsdom will focus one anyway.\n */\n async isTabStop(): Promise<boolean> {\n if (await this.isDisabled()) return false;\n const tabIndex = await (await this.host()).getAttribute('tabindex');\n return Number.parseInt(tabIndex ?? '-1', 10) >= 0;\n }\n\n /**\n * The id of the panel this tab controls, or `null` when it controls none.\n *\n * `null` for a router tab — the strip renders no panel in that mode, the consumer\n * drops a `<router-outlet>` after it — and that missing `aria-controls` is the\n * honest report: there is nothing for the header to point at.\n */\n async getPanelId(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-controls');\n }\n\n /** Whether this tab's panel is in the DOM right now — true only for the selected tab. */\n async hasPanel(): Promise<boolean> {\n return (await this.panelOrNull()) !== null;\n }\n\n /**\n * Whether the panel and this header really name each other.\n *\n * Both halves, because each covers a different failure: the header's\n * `aria-controls` has to reach the panel that is showing, and the panel's\n * `aria-labelledby` has to come back to THIS header. A panel wired to the wrong\n * tab looks perfect on screen — the right content is under the right header — and\n * announces the wrong name, which is the whole of a tabbed interface for anyone\n * not looking at it. It also has to be a `tabpanel`: the reference resolving to\n * some other element is a broken pairing, not a styling detail.\n *\n * Throws when there is no panel at all, which is a different fact from a broken\n * pairing — see {@link getPanelText}.\n */\n async isPanelBound(): Promise<boolean> {\n const panel = await this.panelOrThrow('isPanelBound');\n if ((await panel.getAttribute('role')) !== 'tabpanel') return false;\n return (await panel.getAttribute('aria-labelledby')) === (await this.getId());\n }\n\n /**\n * The text of this tab's panel, trimmed.\n *\n * Throws rather than answering `''` for a tab whose panel is not rendered, and\n * the message says which of the two reasons it is: `<wr-tabs>` keeps only the\n * selected tab's panel in the DOM (the content of every other tab sits in an\n * unrendered `<ng-template>`, so switching tabs destroys a panel and builds the\n * next one), and a router strip renders no panel at all.\n */\n async getPanelText(): Promise<string> {\n return (await this.panelOrThrow('getPanelText')).text();\n }\n\n /**\n * Activate this tab the way a pointer does.\n *\n * A disabled CONTENT tab is left alone: it is a real `<button disabled>`, which\n * fires no click at all. A disabled ROUTER tab is an `<a>`, where `disabled` is\n * not a thing — it carries `aria-disabled=\"true\"` and `tabindex=\"-1\"` to stay off\n * the keyboard path, renders NO href, and the component drops the click rather\n * than routing it. So the click lands and nothing moves, which is why a router\n * strip's expectations belong on the resolved route rather than on the click.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move keyboard focus onto this header. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Take focus off this header. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether this header holds keyboard focus — the roving cursor, not the selection. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** `getHarness(…)` searches this tab's PANEL, which is where its content is. */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n // Both checks, in this order, so the failure names the reason — no panel in this\n // mode, or a panel that is not the one showing — instead of the CDK's generic\n // \"no element matching selector\".\n const id = await this.panelIdOrThrow('getHarness');\n await this.panelOrThrow('getHarness');\n return this.documentRootLocatorFactory().harnessLoaderFor(WrTabHarness.byId(id));\n }\n\n /** The panel element, or `null` when this tab has none rendered. */\n private async panelOrNull(): Promise<TestElement | null> {\n const id = await this.getPanelId();\n if (id === null) return null;\n // From the document root: the panel is a sibling of the strip, not a descendant\n // of the header this harness is hosted on.\n return this.documentRootLocatorFactory().locatorForOptional(WrTabHarness.byId(id))();\n }\n\n /** The panel element, or a failure naming which of the two reasons there isn't one. */\n private async panelOrThrow(method: string): Promise<TestElement> {\n await this.panelIdOrThrow(method);\n const panel = await this.panelOrNull();\n if (!panel) {\n throw new Error(\n `WrTabHarness.${method}(): the panel for \"${await this.getLabel()}\" is not rendered. <wr-tabs> keeps ` +\n 'only the SELECTED panel in the DOM — the content of every other tab waits in an unrendered ' +\n '<ng-template> — so select the tab first.'\n );\n }\n return panel;\n }\n\n /** This tab's `aria-controls`, or a failure saying a router strip has no panels. */\n private async panelIdOrThrow(method: string): Promise<string> {\n const id = await this.getPanelId();\n if (id === null) {\n throw new Error(\n `WrTabHarness.${method}(): \"${await this.getLabel()}\" controls no panel. A router strip renders none ` +\n '— its tabs navigate and the consumer drops a <router-outlet> after the strip — so assert the ' +\n 'routed content instead.'\n );\n }\n return id;\n }\n\n /**\n * An id selector that survives the id it is given.\n *\n * `[id=\"…\"]` rather than `#…`: the ids here are built from the consumer's `key`,\n * and a key holding a dot, a colon or a leading digit turns `#id` into a selector\n * that either throws or matches something else entirely.\n */\n private static byId(id: string): string {\n return `[id=\"${id}\"]`;\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 {\n ComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters, WrTabsHarnessFilters, WrTabsHarnessSize } from './types';\nimport { WrTabHarness } from './wr-tab-harness';\n\n/**\n * Test harness for `<wr-tabs>`, with {@link WrTabHarness} for one tab and the panel\n * it controls.\n *\n * The component has two modes and they answer \"which tab is active\" differently,\n * which is most of what this harness exists to keep straight:\n *\n * - **Content** — the tabs are `<button role=\"tab\">`s, the strip is ONE tab stop\n * (the roving `tabindex` sits on the selected tab), and the arrow keys ACTIVATE\n * the tab they move to, the APG's automatic-activation pattern. `<wr-tabs>`\n * renders exactly one panel: the selected tab's.\n * - **Router** — one `routerLink` on any child switches the whole strip over. The\n * tabs become `<a role=\"tab\">`s whose `aria-selected` follows the resolved route\n * (the same `routerActive()` that paints `--active`) and the strip renders NO\n * panel. It is still ONE tab stop — on the tab the route selects, or the first\n * enabled tab when no route matches — and Space activates a tab as Enter does.\n * The arrow keys move focus, but they select nothing: the route does that.\n *\n * So {@link getSelectedLabel} and {@link getFocusedLabel} are two different\n * questions, and {@link getTabStopLabels} is a third. They coincide in content mode\n * and come apart in router mode; a spec that asserts one and means another passes\n * through the bug.\n *\n * Everything here is driven from the KEYBOARD rather than by clicking a coordinate:\n * a unit test has no layout, so a hit test would answer with nothing, and the\n * keyboard is the accessible path anyway. {@link select} is the exception — a\n * no-arg click needs no coordinate.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n *\n * expect(await tabs.getTabLabels()).toEqual(['One', 'Two', 'Three']);\n * await tabs.select({ label: 'Two' });\n * expect(await tabs.getPanelText()).toContain('Second panel');\n * ```\n *\n * @see https://ngwr.dev/reference/components/tabs\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabsHarness extends ComponentHarness {\n static hostSelector = 'wr-tabs';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabsHarnessFilters = {}): HarnessPredicate<WrTabsHarness> {\n return new HarnessPredicate(WrTabsHarness, options)\n .addOption('tabLabel', options.tabLabel, async (harness, label) => {\n for (const tab of await harness.getTabLabels()) {\n if (await HarnessPredicate.stringMatches(tab, label)) return true;\n }\n return false;\n })\n .addOption('selectedLabel', options.selectedLabel, async (harness, label) => {\n const selected = await harness.getSelectedLabel();\n return selected === null ? false : HarnessPredicate.stringMatches(selected, label);\n })\n .addOption('size', options.size, async (harness, size) => (await harness.getSize()) === size)\n .addOption('router', options.router, async (harness, router) => (await harness.isRouterMode()) === router);\n }\n\n /**\n * The role the strip announces — `tablist`.\n *\n * Read off the strip, not the host: `<wr-tabs>` carries the `wr-tabs` class and no\n * role of its own, and the `tablist` is the scrolling `.wr-tabs__strip` inside it.\n * Without that role the headers are a row of buttons: nothing tells a screen\n * reader how many tabs there are or which one of them is showing.\n */\n async getRole(): Promise<string | null> {\n return (await this.strip()).getAttribute('role');\n }\n\n /**\n * The axis the strip announces, which decides which arrow keys a screen-reader\n * user is told to press.\n *\n * `<wr-tabs>` ships one orientation — the strip is a horizontal scroller and hard\n * codes `aria-orientation=\"horizontal\"` — so today this always answers\n * `'horizontal'`. It is read from the DOM and normalized the way ARIA reads it:\n * anything that is not `vertical`, a missing attribute included, is `'horizontal'`,\n * the default for a `tablist`.\n *\n * Which means an assertion here catches a strip that starts ANNOUNCING `vertical`\n * while its arrow keys still walk the horizontal axis — and cannot catch the\n * mirror image, a vertical mode that forgets to update the attribute: that one\n * answers `'horizontal'` and looks unchanged. One attribute is all this reads.\n */\n async getOrientation(): Promise<'horizontal' | 'vertical'> {\n return (await (await this.strip()).getAttribute('aria-orientation')) === 'vertical' ? 'vertical' : 'horizontal';\n }\n\n /**\n * The size the strip renders at, from the host modifier.\n *\n * `md` is the default and paints no modifier of its own, so its absence is the\n * answer rather than a missing one.\n */\n async getSize(): Promise<WrTabsHarnessSize> {\n const host = await this.host();\n if (await host.hasClass('wr-tabs--sm')) return 'sm';\n if (await host.hasClass('wr-tabs--lg')) return 'lg';\n return 'md';\n }\n\n /**\n * Whether this strip navigates instead of swapping panels.\n *\n * Derived from what got RENDERED — a router tab is an `<a>` — rather than from the\n * `routerLink` inputs, because the switch is all-or-nothing: one `routerLink`\n * anywhere in the strip turns every tab into a link and drops the panel. A strip\n * with no tabs at all is content mode, which is what the component does with it.\n */\n async isRouterMode(): Promise<boolean> {\n const tabs = await this.getTabs();\n for (const tab of tabs) {\n if (await tab.isLink()) return true;\n }\n return false;\n }\n\n /**\n * This strip's tabs, in render order.\n *\n * Scoped to this strip rather than to the host, which is what keeps a `<wr-tabs>`\n * NESTED in a panel from answering for its parent: the inner strip is a descendant\n * of the outer host, so a host-wide query would hand back both sets of tabs as one\n * flat list.\n */\n async getTabs(filters: WrTabHarnessFilters = {}): Promise<WrTabHarness[]> {\n return (await this.stripLoader()).getAllHarnesses(WrTabHarness.with(filters));\n }\n\n /** The label of every tab, in render order. */\n async getTabLabels(): Promise<string[]> {\n const tabs = await this.getTabs();\n return Promise.all(tabs.map(tab => tab.getLabel()));\n }\n\n /**\n * The selected tab, or `null` when none is.\n *\n * A content strip always has one — it falls back to the first tab when `active`\n * matches nothing — so `null` means a router strip whose current route matches no\n * tab, or a strip with no tabs.\n */\n async getSelectedTab(): Promise<WrTabHarness | null> {\n const [selected] = await this.getTabs({ selected: true });\n return selected ?? null;\n }\n\n /** The label of the selected tab, or `null` when none is selected. */\n async getSelectedLabel(): Promise<string | null> {\n const selected = await this.getSelectedTab();\n return selected ? selected.getLabel() : null;\n }\n\n /**\n * Select the first tab matching the filters, the way a pointer does.\n *\n * Throws when nothing matches, naming the tabs that do exist, and throws again\n * when the tab is still unselected afterwards — with both causes named, because a\n * click that quietly did nothing surfaces as an unrelated assertion three lines\n * later. Those causes are a disabled CONTENT tab (a `<button disabled>` never sees\n * the click at all) and a router strip whose navigation did not land on this tab.\n *\n * A router strip is otherwise fine here: the click starts a route change, the\n * harness stabilizes the pending navigation before it re-reads the strip, and\n * `routerActive()` has painted the selection by then — so this resolves. It is a\n * guard, a redirect or an unmatched path that leaves the tab unselected. A\n * DISABLED router tab is a different shape and no longer navigates: it renders\n * no href and the component drops the click, so the click lands and nothing\n * moves — see {@link WrTabHarness.click}.\n */\n async select(filters: WrTabHarnessFilters): Promise<void> {\n const [tab] = await this.getTabs(filters);\n if (!tab) {\n const labels = await this.getTabLabels();\n const offered =\n labels.length > 0 ? `This strip offers: ${labels.join(', ')}.` : 'This strip renders no tabs at all.';\n throw new Error(`WrTabsHarness.select(): no tab matched ${JSON.stringify(filters)}. ${offered}`);\n }\n await this.activate(tab, 'select');\n }\n\n /**\n * Select the tab at this position in render order, counting from 0.\n *\n * Throws on an index the strip does not have, naming its length: a silent no-op\n * there reads as \"the tab did not react\" when the tab was never addressed.\n */\n async selectByIndex(index: number): Promise<void> {\n const tabs = await this.getTabs();\n const tab = tabs[index];\n if (!tab) {\n throw new Error(\n `WrTabsHarness.selectByIndex(): this strip has ${tabs.length} tab(s), so index ${index} is out of ` +\n 'range — they are numbered from 0 in render order.'\n );\n }\n await this.activate(tab, 'selectByIndex');\n }\n\n /**\n * The labels of every tab a Tab press can land on, in render order.\n *\n * A LIST rather than one label, because the count is what breaks: both modes\n * rove a single `tabindex=\"0\"` and answer with exactly one label — the selected\n * tab, or the first enabled one while the selected tab is disabled or, in router\n * mode, while no route matches — and a router strip used to answer with every\n * enabled tab. Either way a disabled tab is never in here.\n */\n async getTabStopLabels(): Promise<string[]> {\n const labels: string[] = [];\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) labels.push(await tab.getLabel());\n }\n return labels;\n }\n\n /**\n * Whether the strip is a single tab stop — the roving-`tabindex` pattern the APG\n * asks a `tablist` for.\n *\n * True for both modes; false means more than one tab is in the page tab order,\n * which is what a router strip did before it roved too. A strip whose every tab\n * is disabled has no stop at all and answers `true`: nothing to rove, and Tab\n * skips it.\n */\n async isRoving(): Promise<boolean> {\n return (await this.getTabStopLabels()).length <= 1;\n }\n\n /**\n * The label of the tab holding keyboard focus, or `null` when focus is elsewhere.\n *\n * The other answer to \"which tab is active\", and not the same as\n * {@link getSelectedLabel}: the arrow keys move this. In content mode they also\n * select what they land on, so the two stay together; in router mode focus walks\n * the strip while the selection stays on whatever the route resolved to.\n */\n async getFocusedLabel(): Promise<string | null> {\n for (const tab of await this.getTabs()) {\n if (await tab.isFocused()) return tab.getLabel();\n }\n return null;\n }\n\n /**\n * Put focus where a Tab press would put it — the first tab stop in render order.\n *\n * That is the selected tab in content mode, or the first enabled one while it is\n * disabled, and the first enabled tab in a router strip. Throws when the strip\n * has no stop at all, because Tab then skips past it rather than entering it — a\n * strip whose every tab is disabled has none, and neither has one with no tabs.\n */\n async focusTabStop(): Promise<void> {\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) {\n await tab.focus();\n return;\n }\n }\n\n throw new Error(\n 'WrTabsHarness.focusTabStop(): this strip has no tab stop — every tab is disabled, or it renders ' +\n 'no tabs — so Tab skips it rather than entering it.'\n );\n }\n\n /**\n * ArrowRight on the strip — one tab toward the visual RIGHT, wrapping at the end\n * and skipping disabled tabs.\n *\n * The physical key, because that is what a keyboard has. The component follows\n * visual order per the APG, so under `dir=\"rtl\"` this moves to the PREVIOUS tab —\n * a spec exercising a mirrored strip swaps this and {@link pressArrowLeft}.\n *\n * In content mode the tab it lands on is also SELECTED (automatic activation); in\n * router mode only focus moves.\n */\n async pressArrowRight(): Promise<void> {\n await this.press(TestKey.RIGHT_ARROW);\n }\n\n /** ArrowLeft on the strip — one tab toward the visual LEFT, mirrored under `dir=\"rtl\"`. */\n async pressArrowLeft(): Promise<void> {\n await this.press(TestKey.LEFT_ARROW);\n }\n\n /**\n * Home on the strip — the FIRST enabled tab.\n *\n * Home and End name a position in the tab list rather than an edge of the strip,\n * so unlike the arrows they read the same in both reading directions.\n */\n async pressHome(): Promise<void> {\n await this.press(TestKey.HOME);\n }\n\n /** End on the strip — the LAST enabled tab, in both reading directions. */\n async pressEnd(): Promise<void> {\n await this.press(TestKey.END);\n }\n\n /** Whether this strip is showing a panel at all — false for a router strip. */\n async hasPanel(): Promise<boolean> {\n const selected = await this.getSelectedTab();\n return selected === null ? false : selected.hasPanel();\n }\n\n /**\n * The text of the panel that is showing, trimmed — the selected tab's content, and\n * the only tab content in the DOM.\n *\n * Throws when nothing is selected. Delegates to the selected tab, so the panel it\n * reads is the one that tab's `aria-controls` points at rather than \"the first\n * `.wr-tabs__panel` around\" — the two are only the same page when the wiring is\n * right, and {@link WrTabHarness.isPanelBound} is what says whether it is.\n */\n async getPanelText(): Promise<string> {\n const selected = await this.getSelectedTab();\n if (!selected) {\n throw new Error(\n 'WrTabsHarness.getPanelText(): no tab is selected, so no panel is rendered. A router strip whose ' +\n 'route matches none of its tabs looks like this, as does a strip with no tabs.'\n );\n }\n return selected.getPanelText();\n }\n\n /**\n * Which edges of the strip are faded out, from the public `--fade-start` /\n * `--fade-end` host modifiers — the cue that there are more tabs than fit, on the\n * side they are on.\n *\n * The component computes these from the strip's scroll metrics, so in a unit test\n * both are always `false`: jsdom lays nothing out, every element measures 0x0, and\n * a strip that never overflows never fades. Assert this in a real browser, or\n * declare the metrics and dispatch a `scroll` the way the component's own spec\n * does.\n */\n async getFades(): Promise<{ start: boolean; end: boolean }> {\n const host = await this.host();\n return {\n start: await host.hasClass('wr-tabs--fade-start'),\n end: await host.hasClass('wr-tabs--fade-end'),\n };\n }\n\n /** Click a tab and check it took, or say which of the two reasons it did not. */\n private async activate(tab: WrTabHarness, method: string): Promise<void> {\n await tab.click();\n if (await tab.isSelected()) return;\n\n throw new Error(\n `WrTabsHarness.${method}(): \"${await tab.getLabel()}\" is still unselected after being clicked — ` +\n 'either it is a content tab carrying `disabled`, which fires no click at all, or this is a router ' +\n 'strip whose navigation did not land on this tab: a guard, a redirect or an unmatched path leaves ' +\n '`routerActive()` painting some other one.'\n );\n }\n\n /**\n * Send a key to the `role=\"tablist\"` strip.\n *\n * The strip owns the keydown handler, and a real user's keypress on the focused\n * header bubbles to exactly here — so this is the honest target, and the one that\n * still works when jsdom has left real focus on `<body>`. It is also the target\n * that leaves the headers alone: the CDK types into whatever element it is handed,\n * which on a `<button>` means writing a `value` attribute onto a tab.\n */\n private async press(key: TestKey): Promise<void> {\n await (await this.strip()).sendKeys(key);\n }\n\n /** This strip's own `role=\"tablist\"` element — the first one under the host. */\n private async strip(): Promise<TestElement> {\n return this.locatorFor('.wr-tabs__strip')();\n }\n\n /**\n * A loader rooted at this strip, so tab queries cannot reach a nested strip's tabs:\n * a nested `<wr-tabs>` lives in the PANEL, which is outside this element.\n */\n private async stripLoader(): Promise<HarnessLoader> {\n return this.locatorFactory.harnessLoaderFor('.wr-tabs__strip');\n }\n}\n"],"mappings":";;;;;;;AA8CA,IAAa,eAAb,MAAa,qBAAqB,iCAAgC;CAEhE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAA+B,CAAA,GAAE;EAC3C,OAAO,IAAI,iBAAiB,cAAc,OAAO,CAAC,CAC/C,UAAU,SAAS,QAAQ,QAA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AM,KAAK,MAAK,EAAA,CAAI,SAAS,GAAG;CACzC;CAGQ,MAAM,QAAK;EACjB,OAAO,KAAK,WAAW,iBAAiB,CAAC,CAAA;CAC3C;CAMQ,MAAM,cAAW;EACvB,OAAO,KAAK,eAAe,iBAAiB,iBAAiB;CAC/D"}
|
|
1
|
+
{"version":3,"file":"ngwr-tabs-testing.mjs","names":[],"sources":["../../../projects/lib/tabs/testing/wr-tab-harness.ts","../../../projects/lib/tabs/testing/wr-tabs-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 ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters } from './types';\n\n/**\n * Test harness for one tab of a `<wr-tabs>` strip — the header, and the panel it\n * controls.\n *\n * Its host is the RENDERED HEADER, not the `<wr-tab>` element. A `<wr-tab>` is\n * `display:none` and holds nothing but a `<ng-template>`: the label, the selection\n * state, the tab stop and the click target all live on the element the parent\n * renders for it, which is a `<button role=\"tab\">` in content mode and an\n * `<a role=\"tab\">` in router mode. A harness hosted on `wr-tab` would answer every\n * question with nothing.\n *\n * Also a CONTENT CONTAINER, scoped to the panel this tab controls, so\n * `tab.getHarness(WrButtonHarness…)` reaches the consumer's own components inside\n * the tab's content. The panel is not a descendant of the header — it is a sibling\n * of the whole strip — so it is resolved through the `aria-controls` id, which is\n * also the pairing {@link isPanelBound} checks. Only the SELECTED tab has a panel\n * to reach: `<wr-tabs>` renders one panel and destroys it on every switch.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n * const [first] = await tabs.getTabs();\n *\n * expect(await first.isSelected()).toBe(true);\n * expect(await first.isPanelBound()).toBe(true);\n * await (await first.getHarness(WrButtonHarness.with({ text: 'Save' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabHarness extends ContentContainerComponentHarness {\n /** The header the strip renders for a `<wr-tab>` — a `<button>`, or an `<a>` in router mode. */\n static hostSelector = '.wr-tabs__tab';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabHarnessFilters = {}): HarnessPredicate<WrTabHarness> {\n return new HarnessPredicate(WrTabHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The tab's visible label, trimmed — the `<wr-tab>`'s `title`. The count is not part of it. */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-tabs__tab-label')()).text();\n }\n\n /** The count shown after the label, or `null` while the tab has none. */\n async getCount(): Promise<number | null> {\n const badge = await this.locatorForOptional('.wr-tabs__count')();\n return badge ? Number(await badge.text()) : null;\n }\n\n /** The accessible name the header announces: the label, plus the count when it has one (\"Inbox, 3\"). */\n async getAccessibleName(): Promise<string> {\n return (await (await this.host()).getAttribute('aria-label')) ?? (await this.getLabel());\n }\n\n /**\n * The header's own id, which is what the panel points back at with\n * `aria-labelledby` — the tab is the panel's accessible name.\n *\n * Generated from the tab's `key`, so two strips on one page whose tabs share keys\n * publish the same ids and each panel then names whichever header came first.\n */\n async getId(): Promise<string | null> {\n return (await this.host()).getAttribute('id');\n }\n\n /**\n * Whether this is the strip's selected tab.\n *\n * `aria-selected` first, because that is the state a screen reader acts on and\n * the `--active` class is only what it looks like. Both shapes carry it now — a\n * router tab publishes it off the same `routerActive()` that paints the class —\n * so the class is a fallback for a tab that has neither yet, not a second reading\n * of the same thing. The order is not interchangeable: reading the class first\n * would report a tab as selected while `aria-selected=\"false\"` told assistive tech\n * otherwise.\n */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n const selected = await host.getAttribute('aria-selected');\n if (selected !== null) return selected === 'true';\n return host.hasClass('wr-tabs__tab--active');\n }\n\n /**\n * Whether the tab refuses activation.\n *\n * The two shapes say it differently and both are read: a content tab is a real\n * `<button>` and carries the native `disabled`, a router tab is an `<a>` — which\n * cannot be disabled natively — and carries `aria-disabled` with `tabindex=\"-1\"`.\n * The `--disabled` class is on both and is deliberately not the source: a class\n * says how the tab looks, these two say what it refuses.\n */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n if ((await host.getAttribute('aria-disabled')) === 'true') return true;\n return (await host.getProperty<boolean | undefined>('disabled')) === true;\n }\n\n /** Whether this tab is a link — the router shape, where selection follows the route. */\n async isLink(): Promise<boolean> {\n return (await this.host()).matchesSelector('a');\n }\n\n /**\n * The resolved href of a router tab, or `null` for a content tab.\n *\n * `null` is the answer for a `<button>` rather than a gap — a content tab\n * navigates nowhere, it swaps a panel.\n */\n async getHref(): Promise<string | null> {\n return (await this.host()).getAttribute('href');\n }\n\n /**\n * Whether a Tab press can land on this header.\n *\n * Either strip is ONE tab stop: a content strip hands it to the selected tab, or\n * to the first enabled one while the selected tab is disabled; a router strip to\n * the tab the route selects, or to the first enabled one while no route matches.\n * See `WrTabsHarness.getTabStopLabels()`.\n *\n * `disabled` is read as well as `tabindex`, because no Tab press reaches a\n * disabled button whatever its `tabindex` says, and jsdom will focus one anyway.\n */\n async isTabStop(): Promise<boolean> {\n if (await this.isDisabled()) return false;\n const tabIndex = await (await this.host()).getAttribute('tabindex');\n return Number.parseInt(tabIndex ?? '-1', 10) >= 0;\n }\n\n /**\n * The id of the panel this tab controls, or `null` when it controls none.\n *\n * `null` for a router tab — the strip renders no panel in that mode, the consumer\n * drops a `<router-outlet>` after it — and that missing `aria-controls` is the\n * honest report: there is nothing for the header to point at.\n */\n async getPanelId(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-controls');\n }\n\n /** Whether this tab's panel is in the DOM right now — true only for the selected tab. */\n async hasPanel(): Promise<boolean> {\n return (await this.panelOrNull()) !== null;\n }\n\n /**\n * Whether the panel and this header really name each other.\n *\n * Both halves, because each covers a different failure: the header's\n * `aria-controls` has to reach the panel that is showing, and the panel's\n * `aria-labelledby` has to come back to THIS header. A panel wired to the wrong\n * tab looks perfect on screen — the right content is under the right header — and\n * announces the wrong name, which is the whole of a tabbed interface for anyone\n * not looking at it. It also has to be a `tabpanel`: the reference resolving to\n * some other element is a broken pairing, not a styling detail.\n *\n * Throws when there is no panel at all, which is a different fact from a broken\n * pairing — see {@link getPanelText}.\n */\n async isPanelBound(): Promise<boolean> {\n const panel = await this.panelOrThrow('isPanelBound');\n if ((await panel.getAttribute('role')) !== 'tabpanel') return false;\n return (await panel.getAttribute('aria-labelledby')) === (await this.getId());\n }\n\n /**\n * The text of this tab's panel, trimmed.\n *\n * Throws rather than answering `''` for a tab whose panel is not rendered, and\n * the message says which of the two reasons it is: `<wr-tabs>` keeps only the\n * selected tab's panel in the DOM (the content of every other tab sits in an\n * unrendered `<ng-template>`, so switching tabs destroys a panel and builds the\n * next one), and a router strip renders no panel at all.\n */\n async getPanelText(): Promise<string> {\n return (await this.panelOrThrow('getPanelText')).text();\n }\n\n /**\n * Activate this tab the way a pointer does.\n *\n * A disabled CONTENT tab is left alone: it is a real `<button disabled>`, which\n * fires no click at all. A disabled ROUTER tab is an `<a>`, where `disabled` is\n * not a thing — it carries `aria-disabled=\"true\"` and `tabindex=\"-1\"` to stay off\n * the keyboard path, renders NO href, and the component drops the click rather\n * than routing it. So the click lands and nothing moves, which is why a router\n * strip's expectations belong on the resolved route rather than on the click.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move keyboard focus onto this header. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Take focus off this header. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether this header holds keyboard focus — the roving cursor, not the selection. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** `getHarness(…)` searches this tab's PANEL, which is where its content is. */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n // Both checks, in this order, so the failure names the reason — no panel in this\n // mode, or a panel that is not the one showing — instead of the CDK's generic\n // \"no element matching selector\".\n const id = await this.panelIdOrThrow('getHarness');\n await this.panelOrThrow('getHarness');\n return this.documentRootLocatorFactory().harnessLoaderFor(WrTabHarness.byId(id));\n }\n\n /** The panel element, or `null` when this tab has none rendered. */\n private async panelOrNull(): Promise<TestElement | null> {\n const id = await this.getPanelId();\n if (id === null) return null;\n // From the document root: the panel is a sibling of the strip, not a descendant\n // of the header this harness is hosted on.\n return this.documentRootLocatorFactory().locatorForOptional(WrTabHarness.byId(id))();\n }\n\n /** The panel element, or a failure naming which of the two reasons there isn't one. */\n private async panelOrThrow(method: string): Promise<TestElement> {\n await this.panelIdOrThrow(method);\n const panel = await this.panelOrNull();\n if (!panel) {\n throw new Error(\n `WrTabHarness.${method}(): the panel for \"${await this.getLabel()}\" is not rendered. <wr-tabs> keeps ` +\n 'only the SELECTED panel in the DOM — the content of every other tab waits in an unrendered ' +\n '<ng-template> — so select the tab first.'\n );\n }\n return panel;\n }\n\n /** This tab's `aria-controls`, or a failure saying a router strip has no panels. */\n private async panelIdOrThrow(method: string): Promise<string> {\n const id = await this.getPanelId();\n if (id === null) {\n throw new Error(\n `WrTabHarness.${method}(): \"${await this.getLabel()}\" controls no panel. A router strip renders none ` +\n '— its tabs navigate and the consumer drops a <router-outlet> after the strip — so assert the ' +\n 'routed content instead.'\n );\n }\n return id;\n }\n\n /**\n * An id selector that survives the id it is given.\n *\n * `[id=\"…\"]` rather than `#…`: the ids here are built from the consumer's `key`,\n * and a key holding a dot, a colon or a leading digit turns `#id` into a selector\n * that either throws or matches something else entirely.\n */\n private static byId(id: string): string {\n return `[id=\"${id}\"]`;\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 {\n ComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters, WrTabsHarnessFilters, WrTabsHarnessSize } from './types';\nimport { WrTabHarness } from './wr-tab-harness';\n\n/**\n * Test harness for `<wr-tabs>`, with {@link WrTabHarness} for one tab and the panel\n * it controls.\n *\n * The component has two modes and they answer \"which tab is active\" differently,\n * which is most of what this harness exists to keep straight:\n *\n * - **Content** — the tabs are `<button role=\"tab\">`s, the strip is ONE tab stop\n * (the roving `tabindex` sits on the selected tab), and the arrow keys ACTIVATE\n * the tab they move to, the APG's automatic-activation pattern. `<wr-tabs>`\n * renders exactly one panel: the selected tab's.\n * - **Router** — one `routerLink` on any child switches the whole strip over. The\n * tabs become `<a role=\"tab\">`s whose `aria-selected` follows the resolved route\n * (the same `routerActive()` that paints `--active`) and the strip renders NO\n * panel. It is still ONE tab stop — on the tab the route selects, or the first\n * enabled tab when no route matches — and Space activates a tab as Enter does.\n * The arrow keys move focus, but they select nothing: the route does that.\n *\n * So {@link getSelectedLabel} and {@link getFocusedLabel} are two different\n * questions, and {@link getTabStopLabels} is a third. They coincide in content mode\n * and come apart in router mode; a spec that asserts one and means another passes\n * through the bug.\n *\n * Everything here is driven from the KEYBOARD rather than by clicking a coordinate:\n * a unit test has no layout, so a hit test would answer with nothing, and the\n * keyboard is the accessible path anyway. {@link select} is the exception — a\n * no-arg click needs no coordinate.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n *\n * expect(await tabs.getTabLabels()).toEqual(['One', 'Two', 'Three']);\n * await tabs.select({ label: 'Two' });\n * expect(await tabs.getPanelText()).toContain('Second panel');\n * ```\n *\n * @see https://ngwr.dev/reference/components/tabs\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabsHarness extends ComponentHarness {\n static hostSelector = 'wr-tabs';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabsHarnessFilters = {}): HarnessPredicate<WrTabsHarness> {\n return new HarnessPredicate(WrTabsHarness, options)\n .addOption('tabLabel', options.tabLabel, async (harness, label) => {\n for (const tab of await harness.getTabLabels()) {\n if (await HarnessPredicate.stringMatches(tab, label)) return true;\n }\n return false;\n })\n .addOption('selectedLabel', options.selectedLabel, async (harness, label) => {\n const selected = await harness.getSelectedLabel();\n return selected === null ? false : HarnessPredicate.stringMatches(selected, label);\n })\n .addOption('size', options.size, async (harness, size) => (await harness.getSize()) === size)\n .addOption('router', options.router, async (harness, router) => (await harness.isRouterMode()) === router);\n }\n\n /**\n * The role the strip announces — `tablist`.\n *\n * Read off the strip, not the host: `<wr-tabs>` carries the `wr-tabs` class and no\n * role of its own, and the `tablist` is the scrolling `.wr-tabs__strip` inside it.\n * Without that role the headers are a row of buttons: nothing tells a screen\n * reader how many tabs there are or which one of them is showing.\n */\n async getRole(): Promise<string | null> {\n return (await this.strip()).getAttribute('role');\n }\n\n /**\n * The axis the strip announces, which decides which arrow keys a screen-reader\n * user is told to press.\n *\n * `<wr-tabs>` ships one orientation — the strip is a horizontal scroller and hard\n * codes `aria-orientation=\"horizontal\"` — so today this always answers\n * `'horizontal'`. It is read from the DOM and normalized the way ARIA reads it:\n * anything that is not `vertical`, a missing attribute included, is `'horizontal'`,\n * the default for a `tablist`.\n *\n * Which means an assertion here catches a strip that starts ANNOUNCING `vertical`\n * while its arrow keys still walk the horizontal axis — and cannot catch the\n * mirror image, a vertical mode that forgets to update the attribute: that one\n * answers `'horizontal'` and looks unchanged. One attribute is all this reads.\n */\n async getOrientation(): Promise<'horizontal' | 'vertical'> {\n return (await (await this.strip()).getAttribute('aria-orientation')) === 'vertical' ? 'vertical' : 'horizontal';\n }\n\n /**\n * The size the strip renders at, from the host modifier.\n *\n * `md` is the default and paints no modifier of its own, so its absence is the\n * answer rather than a missing one.\n */\n async getSize(): Promise<WrTabsHarnessSize> {\n const host = await this.host();\n if (await host.hasClass('wr-tabs--sm')) return 'sm';\n if (await host.hasClass('wr-tabs--lg')) return 'lg';\n return 'md';\n }\n\n /**\n * Whether this strip navigates instead of swapping panels.\n *\n * Derived from what got RENDERED — a router tab is an `<a>` — rather than from the\n * `routerLink` inputs, because the switch is all-or-nothing: one `routerLink`\n * anywhere in the strip turns every tab into a link and drops the panel. A strip\n * with no tabs at all is content mode, which is what the component does with it.\n */\n async isRouterMode(): Promise<boolean> {\n const tabs = await this.getTabs();\n for (const tab of tabs) {\n if (await tab.isLink()) return true;\n }\n return false;\n }\n\n /**\n * This strip's tabs, in render order.\n *\n * Scoped to this strip rather than to the host, which is what keeps a `<wr-tabs>`\n * NESTED in a panel from answering for its parent: the inner strip is a descendant\n * of the outer host, so a host-wide query would hand back both sets of tabs as one\n * flat list.\n */\n async getTabs(filters: WrTabHarnessFilters = {}): Promise<WrTabHarness[]> {\n return (await this.stripLoader()).getAllHarnesses(WrTabHarness.with(filters));\n }\n\n /** The label of every tab, in render order. */\n async getTabLabels(): Promise<string[]> {\n const tabs = await this.getTabs();\n return Promise.all(tabs.map(tab => tab.getLabel()));\n }\n\n /**\n * The selected tab, or `null` when none is.\n *\n * A content strip always has one — it falls back to the first tab when `active`\n * matches nothing — so `null` means a router strip whose current route matches no\n * tab, or a strip with no tabs.\n */\n async getSelectedTab(): Promise<WrTabHarness | null> {\n const [selected] = await this.getTabs({ selected: true });\n return selected ?? null;\n }\n\n /** The label of the selected tab, or `null` when none is selected. */\n async getSelectedLabel(): Promise<string | null> {\n const selected = await this.getSelectedTab();\n return selected ? selected.getLabel() : null;\n }\n\n /**\n * Select the first tab matching the filters, the way a pointer does.\n *\n * Throws when nothing matches, naming the tabs that do exist, and throws again\n * when the tab is still unselected afterwards — with both causes named, because a\n * click that quietly did nothing surfaces as an unrelated assertion three lines\n * later. Those causes are a disabled CONTENT tab (a `<button disabled>` never sees\n * the click at all) and a router strip whose navigation did not land on this tab.\n *\n * A router strip is otherwise fine here: the click starts a route change, the\n * harness stabilizes the pending navigation before it re-reads the strip, and\n * `routerActive()` has painted the selection by then — so this resolves. It is a\n * guard, a redirect or an unmatched path that leaves the tab unselected. A\n * DISABLED router tab is a different shape and no longer navigates: it renders\n * no href and the component drops the click, so the click lands and nothing\n * moves — see {@link WrTabHarness.click}.\n */\n async select(filters: WrTabHarnessFilters): Promise<void> {\n const [tab] = await this.getTabs(filters);\n if (!tab) {\n const labels = await this.getTabLabels();\n const offered =\n labels.length > 0 ? `This strip offers: ${labels.join(', ')}.` : 'This strip renders no tabs at all.';\n throw new Error(`WrTabsHarness.select(): no tab matched ${JSON.stringify(filters)}. ${offered}`);\n }\n await this.activate(tab, 'select');\n }\n\n /**\n * Select the tab at this position in render order, counting from 0.\n *\n * Throws on an index the strip does not have, naming its length: a silent no-op\n * there reads as \"the tab did not react\" when the tab was never addressed.\n */\n async selectByIndex(index: number): Promise<void> {\n const tabs = await this.getTabs();\n const tab = tabs[index];\n if (!tab) {\n throw new Error(\n `WrTabsHarness.selectByIndex(): this strip has ${tabs.length} tab(s), so index ${index} is out of ` +\n 'range — they are numbered from 0 in render order.'\n );\n }\n await this.activate(tab, 'selectByIndex');\n }\n\n /**\n * The labels of every tab a Tab press can land on, in render order.\n *\n * A LIST rather than one label, because the count is what breaks: both modes\n * rove a single `tabindex=\"0\"` and answer with exactly one label — the selected\n * tab, or the first enabled one while the selected tab is disabled or, in router\n * mode, while no route matches — and a router strip used to answer with every\n * enabled tab. Either way a disabled tab is never in here.\n */\n async getTabStopLabels(): Promise<string[]> {\n const labels: string[] = [];\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) labels.push(await tab.getLabel());\n }\n return labels;\n }\n\n /**\n * Whether the strip is a single tab stop — the roving-`tabindex` pattern the APG\n * asks a `tablist` for.\n *\n * True for both modes; false means more than one tab is in the page tab order,\n * which is what a router strip did before it roved too. A strip whose every tab\n * is disabled has no stop at all and answers `true`: nothing to rove, and Tab\n * skips it.\n */\n async isRoving(): Promise<boolean> {\n return (await this.getTabStopLabels()).length <= 1;\n }\n\n /**\n * The label of the tab holding keyboard focus, or `null` when focus is elsewhere.\n *\n * The other answer to \"which tab is active\", and not the same as\n * {@link getSelectedLabel}: the arrow keys move this. In content mode they also\n * select what they land on, so the two stay together; in router mode focus walks\n * the strip while the selection stays on whatever the route resolved to.\n */\n async getFocusedLabel(): Promise<string | null> {\n for (const tab of await this.getTabs()) {\n if (await tab.isFocused()) return tab.getLabel();\n }\n return null;\n }\n\n /**\n * Put focus where a Tab press would put it — the first tab stop in render order.\n *\n * That is the selected tab in content mode, or the first enabled one while it is\n * disabled, and the first enabled tab in a router strip. Throws when the strip\n * has no stop at all, because Tab then skips past it rather than entering it — a\n * strip whose every tab is disabled has none, and neither has one with no tabs.\n */\n async focusTabStop(): Promise<void> {\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) {\n await tab.focus();\n return;\n }\n }\n\n throw new Error(\n 'WrTabsHarness.focusTabStop(): this strip has no tab stop — every tab is disabled, or it renders ' +\n 'no tabs — so Tab skips it rather than entering it.'\n );\n }\n\n /**\n * ArrowRight on the strip — one tab toward the visual RIGHT, wrapping at the end\n * and skipping disabled tabs.\n *\n * The physical key, because that is what a keyboard has. The component follows\n * visual order per the APG, so under `dir=\"rtl\"` this moves to the PREVIOUS tab —\n * a spec exercising a mirrored strip swaps this and {@link pressArrowLeft}.\n *\n * In content mode the tab it lands on is also SELECTED (automatic activation); in\n * router mode only focus moves.\n */\n async pressArrowRight(): Promise<void> {\n await this.press(TestKey.RIGHT_ARROW);\n }\n\n /** ArrowLeft on the strip — one tab toward the visual LEFT, mirrored under `dir=\"rtl\"`. */\n async pressArrowLeft(): Promise<void> {\n await this.press(TestKey.LEFT_ARROW);\n }\n\n /**\n * Home on the strip — the FIRST enabled tab.\n *\n * Home and End name a position in the tab list rather than an edge of the strip,\n * so unlike the arrows they read the same in both reading directions.\n */\n async pressHome(): Promise<void> {\n await this.press(TestKey.HOME);\n }\n\n /** End on the strip — the LAST enabled tab, in both reading directions. */\n async pressEnd(): Promise<void> {\n await this.press(TestKey.END);\n }\n\n /** Whether this strip is showing a panel at all — false for a router strip. */\n async hasPanel(): Promise<boolean> {\n const selected = await this.getSelectedTab();\n return selected === null ? false : selected.hasPanel();\n }\n\n /**\n * The text of the panel that is showing, trimmed — the selected tab's content, and\n * the only tab content in the DOM.\n *\n * Throws when nothing is selected. Delegates to the selected tab, so the panel it\n * reads is the one that tab's `aria-controls` points at rather than \"the first\n * `.wr-tabs__panel` around\" — the two are only the same page when the wiring is\n * right, and {@link WrTabHarness.isPanelBound} is what says whether it is.\n */\n async getPanelText(): Promise<string> {\n const selected = await this.getSelectedTab();\n if (!selected) {\n throw new Error(\n 'WrTabsHarness.getPanelText(): no tab is selected, so no panel is rendered. A router strip whose ' +\n 'route matches none of its tabs looks like this, as does a strip with no tabs.'\n );\n }\n return selected.getPanelText();\n }\n\n /**\n * Which edges of the strip are faded out, from the public `--fade-start` /\n * `--fade-end` host modifiers — the cue that there are more tabs than fit, on the\n * side they are on.\n *\n * The component computes these from the strip's scroll metrics, so in a unit test\n * both are always `false`: jsdom lays nothing out, every element measures 0x0, and\n * a strip that never overflows never fades. Assert this in a real browser, or\n * declare the metrics and dispatch a `scroll` the way the component's own spec\n * does.\n */\n async getFades(): Promise<{ start: boolean; end: boolean }> {\n const host = await this.host();\n return {\n start: await host.hasClass('wr-tabs--fade-start'),\n end: await host.hasClass('wr-tabs--fade-end'),\n };\n }\n\n /** Click a tab and check it took, or say which of the two reasons it did not. */\n private async activate(tab: WrTabHarness, method: string): Promise<void> {\n await tab.click();\n if (await tab.isSelected()) return;\n\n throw new Error(\n `WrTabsHarness.${method}(): \"${await tab.getLabel()}\" is still unselected after being clicked — ` +\n 'either it is a content tab carrying `disabled`, which fires no click at all, or this is a router ' +\n 'strip whose navigation did not land on this tab: a guard, a redirect or an unmatched path leaves ' +\n '`routerActive()` painting some other one.'\n );\n }\n\n /**\n * Send a key to the `role=\"tablist\"` strip.\n *\n * The strip owns the keydown handler, and a real user's keypress on the focused\n * header bubbles to exactly here — so this is the honest target, and the one that\n * still works when jsdom has left real focus on `<body>`. It is also the target\n * that leaves the headers alone: the CDK types into whatever element it is handed,\n * which on a `<button>` means writing a `value` attribute onto a tab.\n */\n private async press(key: TestKey): Promise<void> {\n await (await this.strip()).sendKeys(key);\n }\n\n /** This strip's own `role=\"tablist\"` element — the first one under the host. */\n private async strip(): Promise<TestElement> {\n return this.locatorFor('.wr-tabs__strip')();\n }\n\n /**\n * A loader rooted at this strip, so tab queries cannot reach a nested strip's tabs:\n * a nested `<wr-tabs>` lives in the PANEL, which is outside this element.\n */\n private async stripLoader(): Promise<HarnessLoader> {\n return this.locatorFactory.harnessLoaderFor('.wr-tabs__strip');\n }\n}\n"],"mappings":";;;;;;;AA8CA,IAAa,eAAb,MAAa,qBAAqB,iCAAgC;CAEhE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAA+B,CAAA,GAAE;EAC3C,OAAO,IAAI,iBAAiB,cAAc,OAAO,CAAC,CAC/C,UAAU,SAAS,QAAQ,QAAQ,SAAS,UAAU,iBAAiB,cAAc,QAAQ,SAAQ,GAAI,KAAK,CAAC,CAAC,CAChH,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ,CAAC,CAC/G,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ;CACnH;CAGA,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,WAAW,qBAAqB,CAAC,CAAA,EAAA,CAAI,KAAI;CAC9D;CAGA,MAAM,WAAQ;EACZ,MAAM,QAAQ,MAAM,KAAK,mBAAmB,iBAAiB,CAAC,CAAA;EAC9D,OAAO,QAAQ,OAAO,MAAM,MAAM,KAAI,CAAE,IAAI;CAC9C;CAGA,MAAM,oBAAiB;EACrB,OAAQ,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,YAAY,KAAO,MAAM,KAAK,SAAQ;CACvF;CASA,MAAM,QAAK;EACT,QAAQ,MAAM,KAAK,KAAI,EAAA,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M,kBAAe;EACnB,MAAM,KAAK,MAAM,QAAQ,WAAW;CACtC;CAGA,MAAM,iBAAc;EAClB,MAAM,KAAK,MAAM,QAAQ,UAAU;CACrC;CAQA,MAAM,YAAS;EACb,MAAM,KAAK,MAAM,QAAQ,IAAI;CAC/B;CAGA,MAAM,WAAQ;EACZ,MAAM,KAAK,MAAM,QAAQ,GAAG;CAC9B;CAGA,MAAM,WAAQ;EACZ,MAAM,WAAW,MAAM,KAAK,eAAc;EAC1C,OAAO,aAAa,OAAO,QAAQ,SAAS,SAAQ;CACtD;CAWA,MAAM,eAAY;EAChB,MAAM,WAAW,MAAM,KAAK,eAAc;EAC1C,IAAI,CAAC,UACH,MAAM,IAAI,MACR,+KACiF;EAGrF,OAAO,SAAS,aAAY;CAC9B;CAaA,MAAM,WAAQ;EACZ,MAAM,OAAO,MAAM,KAAK,KAAI;EAC5B,OAAO;GACL,OAAO,MAAM,KAAK,SAAS,qBAAqB;GAChD,KAAK,MAAM,KAAK,SAAS,mBAAmB;EAC7C;CACH;CAGQ,MAAM,SAAS,KAAmB,QAAc;EACtD,MAAM,IAAI,MAAK;EACf,IAAI,MAAM,IAAI,WAAU,GAAI;EAE5B,MAAM,IAAI,MACR,iBAAiB,OAAM,OAAQ,MAAM,IAAI,SAAQ,EAAE,4RAGN;CAEjD;CAWQ,MAAM,MAAM,KAAY;EAC9B,OAAO,MAAM,KAAK,MAAK,EAAA,CAAI,SAAS,GAAG;CACzC;CAGQ,MAAM,QAAK;EACjB,OAAO,KAAK,WAAW,iBAAiB,CAAC,CAAA;CAC3C;CAMQ,MAAM,cAAW;EACvB,OAAO,KAAK,eAAe,iBAAiB,iBAAiB;CAC/D"}
|
package/fesm2022/ngwr-tabs.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
|
4
4
|
import { NgTemplateOutlet } from "@angular/common";
|
|
5
5
|
import { wrCheckStyles, wrRandomId } from "ngwr/utils";
|
|
6
6
|
import { Directionality } from "@angular/cdk/bidi";
|
|
7
|
+
import { WrBadge } from "ngwr/badge";
|
|
7
8
|
/**
|
|
8
9
|
* @license
|
|
9
10
|
*
|
|
@@ -28,6 +29,11 @@ var WrTab = class WrTab {
|
|
|
28
29
|
title = input.required(...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
29
30
|
key = input(wrRandomId("wr-tab"), ...ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []);
|
|
30
31
|
routerLink = input(null, ...ngDevMode ? [{ debugName: "routerLink" }] : /* istanbul ignore next */ []);
|
|
32
|
+
exact = input(false, {
|
|
33
|
+
...ngDevMode ? { debugName: "exact" } : /* istanbul ignore next */ {},
|
|
34
|
+
transform: coerceBooleanProperty
|
|
35
|
+
});
|
|
36
|
+
count = input(null, ...ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []);
|
|
31
37
|
disabled = input(false, {
|
|
32
38
|
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
33
39
|
transform: coerceBooleanProperty
|
|
@@ -36,6 +42,10 @@ var WrTab = class WrTab {
|
|
|
36
42
|
parent = inject(WR_TABS, { optional: true });
|
|
37
43
|
destroyRef = inject(DestroyRef);
|
|
38
44
|
routing = inject(WR_TABS_ROUTING, { optional: true });
|
|
45
|
+
accessibleName = computed(() => {
|
|
46
|
+
const count = this.count();
|
|
47
|
+
return count === null ? null : `${this.title()}, ${count}`;
|
|
48
|
+
}, ...ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []);
|
|
39
49
|
isRouter = computed(() => this.routerLink() !== null, ...ngDevMode ? [{ debugName: "isRouter" }] : /* istanbul ignore next */ []);
|
|
40
50
|
routerHref = computed(() => {
|
|
41
51
|
const link = this.routerLink();
|
|
@@ -45,7 +55,7 @@ var WrTab = class WrTab {
|
|
|
45
55
|
routerActive = computed(() => {
|
|
46
56
|
const link = this.routerLink();
|
|
47
57
|
if (link === null || this.disabled()) return false;
|
|
48
|
-
return this.routing?.isActive(link) ?? false;
|
|
58
|
+
return this.routing?.isActive(link, this.exact()) ?? false;
|
|
49
59
|
}, ...ngDevMode ? [{ debugName: "routerActive" }] : /* istanbul ignore next */ []);
|
|
50
60
|
navigate(event) {
|
|
51
61
|
const link = this.routerLink();
|
|
@@ -64,7 +74,7 @@ var WrTab = class WrTab {
|
|
|
64
74
|
}
|
|
65
75
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
66
76
|
minVersion: "12.0.0",
|
|
67
|
-
version: "22.
|
|
77
|
+
version: "22.3.0",
|
|
68
78
|
ngImport: i0,
|
|
69
79
|
type: WrTab,
|
|
70
80
|
deps: [],
|
|
@@ -72,7 +82,7 @@ var WrTab = class WrTab {
|
|
|
72
82
|
});
|
|
73
83
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
74
84
|
minVersion: "17.2.0",
|
|
75
|
-
version: "22.
|
|
85
|
+
version: "22.3.0",
|
|
76
86
|
type: WrTab,
|
|
77
87
|
isStandalone: true,
|
|
78
88
|
selector: "wr-tab",
|
|
@@ -98,6 +108,20 @@ var WrTab = class WrTab {
|
|
|
98
108
|
isRequired: false,
|
|
99
109
|
transformFunction: null
|
|
100
110
|
},
|
|
111
|
+
exact: {
|
|
112
|
+
classPropertyName: "exact",
|
|
113
|
+
publicName: "exact",
|
|
114
|
+
isSignal: true,
|
|
115
|
+
isRequired: false,
|
|
116
|
+
transformFunction: null
|
|
117
|
+
},
|
|
118
|
+
count: {
|
|
119
|
+
classPropertyName: "count",
|
|
120
|
+
publicName: "count",
|
|
121
|
+
isSignal: true,
|
|
122
|
+
isRequired: false,
|
|
123
|
+
transformFunction: null
|
|
124
|
+
},
|
|
101
125
|
disabled: {
|
|
102
126
|
classPropertyName: "disabled",
|
|
103
127
|
publicName: "disabled",
|
|
@@ -125,7 +149,7 @@ var WrTab = class WrTab {
|
|
|
125
149
|
};
|
|
126
150
|
i0.ɵɵngDeclareClassMetadata({
|
|
127
151
|
minVersion: "12.0.0",
|
|
128
|
-
version: "22.
|
|
152
|
+
version: "22.3.0",
|
|
129
153
|
ngImport: i0,
|
|
130
154
|
type: WrTab,
|
|
131
155
|
decorators: [{
|
|
@@ -166,6 +190,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
166
190
|
required: false
|
|
167
191
|
}]
|
|
168
192
|
}],
|
|
193
|
+
exact: [{
|
|
194
|
+
type: i0.Input,
|
|
195
|
+
args: [{
|
|
196
|
+
isSignal: true,
|
|
197
|
+
alias: "exact",
|
|
198
|
+
required: false
|
|
199
|
+
}]
|
|
200
|
+
}],
|
|
201
|
+
count: [{
|
|
202
|
+
type: i0.Input,
|
|
203
|
+
args: [{
|
|
204
|
+
isSignal: true,
|
|
205
|
+
alias: "count",
|
|
206
|
+
required: false
|
|
207
|
+
}]
|
|
208
|
+
}],
|
|
169
209
|
disabled: [{
|
|
170
210
|
type: i0.Input,
|
|
171
211
|
args: [{
|
|
@@ -306,7 +346,7 @@ var WrTabs = class WrTabs {
|
|
|
306
346
|
}
|
|
307
347
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
308
348
|
minVersion: "12.0.0",
|
|
309
|
-
version: "22.
|
|
349
|
+
version: "22.3.0",
|
|
310
350
|
ngImport: i0,
|
|
311
351
|
type: WrTabs,
|
|
312
352
|
deps: [],
|
|
@@ -314,7 +354,7 @@ var WrTabs = class WrTabs {
|
|
|
314
354
|
});
|
|
315
355
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
316
356
|
minVersion: "17.0.0",
|
|
317
|
-
version: "22.
|
|
357
|
+
version: "22.3.0",
|
|
318
358
|
type: WrTabs,
|
|
319
359
|
isStandalone: true,
|
|
320
360
|
selector: "wr-tabs",
|
|
@@ -361,7 +401,7 @@ var WrTabs = class WrTabs {
|
|
|
361
401
|
isSignal: true
|
|
362
402
|
}],
|
|
363
403
|
ngImport: i0,
|
|
364
|
-
template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === contentStop() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n",
|
|
404
|
+
template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-label]=\"tab.accessibleName()\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\n >\n <span class=\"wr-tabs__tab-label\">{{ tab.title() }}</span>\n @if (tab.count() !== null) {\n <wr-badge class=\"wr-tabs__count\" size=\"sm\" shape=\"pill\" [color]=\"null\">{{ tab.count() }}</wr-badge>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-label]=\"tab.accessibleName()\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === contentStop() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n <span class=\"wr-tabs__tab-label\">{{ tab.title() }}</span>\n @if (tab.count() !== null) {\n <wr-badge class=\"wr-tabs__count\" size=\"sm\" shape=\"pill\" [color]=\"null\">{{ tab.count() }}</wr-badge>\n }\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n",
|
|
365
405
|
dependencies: [{
|
|
366
406
|
kind: "directive",
|
|
367
407
|
type: NgTemplateOutlet,
|
|
@@ -371,13 +411,23 @@ var WrTabs = class WrTabs {
|
|
|
371
411
|
"ngTemplateOutlet",
|
|
372
412
|
"ngTemplateOutletInjector"
|
|
373
413
|
]
|
|
414
|
+
}, {
|
|
415
|
+
kind: "component",
|
|
416
|
+
type: WrBadge,
|
|
417
|
+
selector: "wr-badge",
|
|
418
|
+
inputs: [
|
|
419
|
+
"color",
|
|
420
|
+
"size",
|
|
421
|
+
"shape",
|
|
422
|
+
"outlined"
|
|
423
|
+
]
|
|
374
424
|
}],
|
|
375
425
|
encapsulation: i0.ViewEncapsulation.None
|
|
376
426
|
});
|
|
377
427
|
};
|
|
378
428
|
i0.ɵɵngDeclareClassMetadata({
|
|
379
429
|
minVersion: "12.0.0",
|
|
380
|
-
version: "22.
|
|
430
|
+
version: "22.3.0",
|
|
381
431
|
ngImport: i0,
|
|
382
432
|
type: WrTabs,
|
|
383
433
|
decorators: [{
|
|
@@ -392,12 +442,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
392
442
|
"[class.wr-tabs--sm]": "size() === 'sm'",
|
|
393
443
|
"[class.wr-tabs--lg]": "size() === 'lg'"
|
|
394
444
|
},
|
|
395
|
-
imports: [NgTemplateOutlet],
|
|
445
|
+
imports: [NgTemplateOutlet, WrBadge],
|
|
396
446
|
providers: [{
|
|
397
447
|
provide: WR_TABS,
|
|
398
448
|
useExisting: forwardRef(() => WrTabs)
|
|
399
449
|
}],
|
|
400
|
-
template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === contentStop() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n"
|
|
450
|
+
template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-label]=\"tab.accessibleName()\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\n >\n <span class=\"wr-tabs__tab-label\">{{ tab.title() }}</span>\n @if (tab.count() !== null) {\n <wr-badge class=\"wr-tabs__count\" size=\"sm\" shape=\"pill\" [color]=\"null\">{{ tab.count() }}</wr-badge>\n }\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-label]=\"tab.accessibleName()\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === contentStop() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n <span class=\"wr-tabs__tab-label\">{{ tab.title() }}</span>\n @if (tab.count() !== null) {\n <wr-badge class=\"wr-tabs__count\" size=\"sm\" shape=\"pill\" [color]=\"null\">{{ tab.count() }}</wr-badge>\n }\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n"
|
|
401
451
|
}]
|
|
402
452
|
}],
|
|
403
453
|
ctorParameters: () => [],
|