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
package/fesm2022/ngwr-scroll.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Service, inject } from "@angular/core";
|
|
2
|
+
import { DestroyRef, Directive, ElementRef, Service, afterNextRender, computed, effect, inject, input, signal, untracked } from "@angular/core";
|
|
3
|
+
import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
|
|
3
4
|
import { DOCUMENT as DOCUMENT$1 } from "@angular/common";
|
|
4
5
|
import { WrPlatform } from "ngwr/platform";
|
|
5
6
|
/**
|
|
@@ -21,7 +22,7 @@ var WrScroll = class WrScroll {
|
|
|
21
22
|
if (typeof target === "object" && "top" in target) {
|
|
22
23
|
this.scroll(container, {
|
|
23
24
|
top: target.top - offset,
|
|
24
|
-
left: target.left
|
|
25
|
+
...target.left === void 0 ? {} : { left: target.left },
|
|
25
26
|
behavior
|
|
26
27
|
});
|
|
27
28
|
return;
|
|
@@ -33,7 +34,6 @@ var WrScroll = class WrScroll {
|
|
|
33
34
|
const top = rect.top + win.scrollY - offset;
|
|
34
35
|
this.scroll(container, {
|
|
35
36
|
top,
|
|
36
|
-
left: 0,
|
|
37
37
|
behavior
|
|
38
38
|
});
|
|
39
39
|
} else {
|
|
@@ -42,7 +42,6 @@ var WrScroll = class WrScroll {
|
|
|
42
42
|
const top = rect.top - ctxRect.top + ctx.scrollTop - offset;
|
|
43
43
|
this.scroll(container, {
|
|
44
44
|
top,
|
|
45
|
-
left: 0,
|
|
46
45
|
behavior
|
|
47
46
|
});
|
|
48
47
|
}
|
|
@@ -62,8 +61,8 @@ var WrScroll = class WrScroll {
|
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
behavior(requested) {
|
|
65
|
-
if (requested === false) return "
|
|
66
|
-
if (this.platform.prefersReducedMotion()) return "
|
|
64
|
+
if (requested === false) return "instant";
|
|
65
|
+
if (this.platform.prefersReducedMotion()) return "instant";
|
|
67
66
|
return "smooth";
|
|
68
67
|
}
|
|
69
68
|
scroll(container, options) {
|
|
@@ -72,7 +71,7 @@ var WrScroll = class WrScroll {
|
|
|
72
71
|
}
|
|
73
72
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
74
73
|
minVersion: "12.0.0",
|
|
75
|
-
version: "22.
|
|
74
|
+
version: "22.3.0",
|
|
76
75
|
ngImport: i0,
|
|
77
76
|
type: WrScroll,
|
|
78
77
|
deps: [],
|
|
@@ -80,18 +79,242 @@ var WrScroll = class WrScroll {
|
|
|
80
79
|
});
|
|
81
80
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
82
81
|
minVersion: "22.0.0",
|
|
83
|
-
version: "22.
|
|
82
|
+
version: "22.3.0",
|
|
84
83
|
ngImport: i0,
|
|
85
84
|
type: WrScroll
|
|
86
85
|
});
|
|
87
86
|
};
|
|
88
87
|
i0.ɵɵngDeclareClassMetadata({
|
|
89
88
|
minVersion: "12.0.0",
|
|
90
|
-
version: "22.
|
|
89
|
+
version: "22.3.0",
|
|
91
90
|
ngImport: i0,
|
|
92
91
|
type: WrScroll,
|
|
93
92
|
decorators: [{ type: Service }]
|
|
94
93
|
});
|
|
95
|
-
|
|
94
|
+
/**
|
|
95
|
+
* @license
|
|
96
|
+
*
|
|
97
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
98
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
99
|
+
*/
|
|
100
|
+
const WRAPPER_DEPTH = 3;
|
|
101
|
+
var WrScrollFollow = class WrScrollFollow {
|
|
102
|
+
wrScrollFollow = input(true, {
|
|
103
|
+
...ngDevMode ? { debugName: "wrScrollFollow" } : /* istanbul ignore next */ {},
|
|
104
|
+
transform: coerceBooleanProperty
|
|
105
|
+
});
|
|
106
|
+
wrScrollFollowThreshold = input(80, {
|
|
107
|
+
...ngDevMode ? { debugName: "wrScrollFollowThreshold" } : /* istanbul ignore next */ {},
|
|
108
|
+
transform: (value) => Math.max(0, coerceNumberProperty(value, 80))
|
|
109
|
+
});
|
|
110
|
+
el = inject(ElementRef);
|
|
111
|
+
scroll = inject(WrScroll);
|
|
112
|
+
atEnd = signal(true, ...ngDevMode ? [{ debugName: "atEnd" }] : /* istanbul ignore next */ []);
|
|
113
|
+
following = computed(() => this.wrScrollFollow() && this.atEnd(), ...ngDevMode ? [{ debugName: "following" }] : /* istanbul ignore next */ []);
|
|
114
|
+
started = false;
|
|
115
|
+
lastTop = 0;
|
|
116
|
+
anchors = [];
|
|
117
|
+
anchorsTop = 0;
|
|
118
|
+
constructor() {
|
|
119
|
+
const destroyRef = inject(DestroyRef);
|
|
120
|
+
afterNextRender(() => {
|
|
121
|
+
const host = this.el.nativeElement;
|
|
122
|
+
const onScroll = () => this.onScroll();
|
|
123
|
+
const resize = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => this.sync());
|
|
124
|
+
const mutation = new MutationObserver((records) => {
|
|
125
|
+
for (const record of records) {
|
|
126
|
+
if (record.target !== host) continue;
|
|
127
|
+
for (const node of record.addedNodes) if (node instanceof Element) resize?.observe(node);
|
|
128
|
+
for (const node of record.removedNodes) if (node instanceof Element) resize?.unobserve(node);
|
|
129
|
+
}
|
|
130
|
+
this.sync();
|
|
131
|
+
});
|
|
132
|
+
host.addEventListener("scroll", onScroll, { passive: true });
|
|
133
|
+
resize?.observe(host);
|
|
134
|
+
for (const child of host.children) resize?.observe(child);
|
|
135
|
+
mutation.observe(host, {
|
|
136
|
+
childList: true,
|
|
137
|
+
characterData: true,
|
|
138
|
+
subtree: true
|
|
139
|
+
});
|
|
140
|
+
this.started = true;
|
|
141
|
+
this.sync();
|
|
142
|
+
destroyRef.onDestroy(() => {
|
|
143
|
+
host.removeEventListener("scroll", onScroll);
|
|
144
|
+
resize?.disconnect();
|
|
145
|
+
mutation.disconnect();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
effect(() => {
|
|
149
|
+
const on = this.wrScrollFollow();
|
|
150
|
+
if (!this.started) return;
|
|
151
|
+
untracked(() => {
|
|
152
|
+
if (on) this.atEnd.set(this.distance() <= this.wrScrollFollowThreshold());
|
|
153
|
+
this.sync();
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
toEnd(options = {}) {
|
|
158
|
+
if (!this.started) return;
|
|
159
|
+
const host = this.el.nativeElement;
|
|
160
|
+
this.atEnd.set(true);
|
|
161
|
+
this.anchors = [];
|
|
162
|
+
this.scroll.to({ top: host.scrollHeight }, {
|
|
163
|
+
...options,
|
|
164
|
+
container: host
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
distance() {
|
|
168
|
+
const host = this.el.nativeElement;
|
|
169
|
+
return host.scrollHeight - host.scrollTop - host.clientHeight;
|
|
170
|
+
}
|
|
171
|
+
onScroll() {
|
|
172
|
+
this.read(true);
|
|
173
|
+
if (this.following()) {
|
|
174
|
+
this.anchors = [];
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (!this.wrScrollFollow()) return;
|
|
178
|
+
this.restore();
|
|
179
|
+
this.lastTop = this.el.nativeElement.scrollTop;
|
|
180
|
+
this.capture();
|
|
181
|
+
}
|
|
182
|
+
read(scrolled) {
|
|
183
|
+
const top = this.el.nativeElement.scrollTop;
|
|
184
|
+
const distance = this.distance();
|
|
185
|
+
if (top < this.lastTop && distance > 1) this.atEnd.set(false);
|
|
186
|
+
else if (scrolled && top > this.lastTop && distance <= this.wrScrollFollowThreshold()) this.atEnd.set(true);
|
|
187
|
+
this.lastTop = top;
|
|
188
|
+
}
|
|
189
|
+
sync() {
|
|
190
|
+
const host = this.el.nativeElement;
|
|
191
|
+
this.read(true);
|
|
192
|
+
if (!this.wrScrollFollow()) {
|
|
193
|
+
this.anchors = [];
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (this.atEnd()) {
|
|
197
|
+
this.move(host.scrollHeight);
|
|
198
|
+
this.anchors = [];
|
|
199
|
+
} else {
|
|
200
|
+
this.restore();
|
|
201
|
+
this.capture();
|
|
202
|
+
}
|
|
203
|
+
this.lastTop = host.scrollTop;
|
|
204
|
+
}
|
|
205
|
+
move(top) {
|
|
206
|
+
this.el.nativeElement.scrollTo({
|
|
207
|
+
top,
|
|
208
|
+
behavior: "instant"
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
capture() {
|
|
212
|
+
const host = this.el.nativeElement;
|
|
213
|
+
const box = host.getBoundingClientRect();
|
|
214
|
+
const anchors = [];
|
|
215
|
+
let parent = host;
|
|
216
|
+
for (let depth = 0; depth < WRAPPER_DEPTH; depth++) {
|
|
217
|
+
let found = null;
|
|
218
|
+
let boxes = 0;
|
|
219
|
+
for (let child = parent.lastElementChild; child; child = child.previousElementSibling) {
|
|
220
|
+
const rect = child.getBoundingClientRect();
|
|
221
|
+
if (!rect.width && !rect.height) continue;
|
|
222
|
+
boxes++;
|
|
223
|
+
if (!found && rect.top < box.bottom) found = {
|
|
224
|
+
node: child,
|
|
225
|
+
offset: rect.top - box.top
|
|
226
|
+
};
|
|
227
|
+
if (found && boxes > 1) break;
|
|
228
|
+
}
|
|
229
|
+
if (!found) break;
|
|
230
|
+
anchors.push(found);
|
|
231
|
+
if (boxes > 1) break;
|
|
232
|
+
parent = found.node;
|
|
233
|
+
}
|
|
234
|
+
this.anchors = anchors;
|
|
235
|
+
this.anchorsTop = host.scrollTop;
|
|
236
|
+
}
|
|
237
|
+
restore() {
|
|
238
|
+
const host = this.el.nativeElement;
|
|
239
|
+
const scrolledSince = host.scrollTop - this.anchorsTop;
|
|
240
|
+
for (let i = this.anchors.length - 1; i >= 0; i--) {
|
|
241
|
+
const { node, offset } = this.anchors[i];
|
|
242
|
+
if (!host.contains(node)) continue;
|
|
243
|
+
const rect = node.getBoundingClientRect();
|
|
244
|
+
if (!rect.width && !rect.height) continue;
|
|
245
|
+
const delta = rect.top - host.getBoundingClientRect().top - (offset - scrolledSince);
|
|
246
|
+
if (Math.abs(delta) >= 1) this.move(host.scrollTop + delta);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
251
|
+
minVersion: "12.0.0",
|
|
252
|
+
version: "22.3.0",
|
|
253
|
+
ngImport: i0,
|
|
254
|
+
type: WrScrollFollow,
|
|
255
|
+
deps: [],
|
|
256
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
257
|
+
});
|
|
258
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
259
|
+
minVersion: "17.1.0",
|
|
260
|
+
version: "22.3.0",
|
|
261
|
+
type: WrScrollFollow,
|
|
262
|
+
isStandalone: true,
|
|
263
|
+
selector: "[wrScrollFollow]",
|
|
264
|
+
inputs: {
|
|
265
|
+
wrScrollFollow: {
|
|
266
|
+
classPropertyName: "wrScrollFollow",
|
|
267
|
+
publicName: "wrScrollFollow",
|
|
268
|
+
isSignal: true,
|
|
269
|
+
isRequired: false,
|
|
270
|
+
transformFunction: null
|
|
271
|
+
},
|
|
272
|
+
wrScrollFollowThreshold: {
|
|
273
|
+
classPropertyName: "wrScrollFollowThreshold",
|
|
274
|
+
publicName: "wrScrollFollowThreshold",
|
|
275
|
+
isSignal: true,
|
|
276
|
+
isRequired: false,
|
|
277
|
+
transformFunction: null
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
host: { properties: { "style.overflow-anchor": "wrScrollFollow() ? \"none\" : null" } },
|
|
281
|
+
exportAs: ["wrScrollFollow"],
|
|
282
|
+
ngImport: i0
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
286
|
+
minVersion: "12.0.0",
|
|
287
|
+
version: "22.3.0",
|
|
288
|
+
ngImport: i0,
|
|
289
|
+
type: WrScrollFollow,
|
|
290
|
+
decorators: [{
|
|
291
|
+
type: Directive,
|
|
292
|
+
args: [{
|
|
293
|
+
selector: "[wrScrollFollow]",
|
|
294
|
+
exportAs: "wrScrollFollow",
|
|
295
|
+
host: { "[style.overflow-anchor]": "wrScrollFollow() ? \"none\" : null" }
|
|
296
|
+
}]
|
|
297
|
+
}],
|
|
298
|
+
ctorParameters: () => [],
|
|
299
|
+
propDecorators: {
|
|
300
|
+
wrScrollFollow: [{
|
|
301
|
+
type: i0.Input,
|
|
302
|
+
args: [{
|
|
303
|
+
isSignal: true,
|
|
304
|
+
alias: "wrScrollFollow",
|
|
305
|
+
required: false
|
|
306
|
+
}]
|
|
307
|
+
}],
|
|
308
|
+
wrScrollFollowThreshold: [{
|
|
309
|
+
type: i0.Input,
|
|
310
|
+
args: [{
|
|
311
|
+
isSignal: true,
|
|
312
|
+
alias: "wrScrollFollowThreshold",
|
|
313
|
+
required: false
|
|
314
|
+
}]
|
|
315
|
+
}]
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
export { WrScroll, WrScrollFollow };
|
|
96
319
|
|
|
97
320
|
//# sourceMappingURL=ngwr-scroll.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-scroll.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/scroll/wr-scroll.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 { DOCUMENT } from '@angular/common';\nimport { Service, inject } from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\n\nimport type { WrScrollOptions, WrScrollTarget } from './types';\n\n/**\n * Smooth-scroll utility. Resolves `id` / selector / element / coords\n * targets; subtracts an `offset` (for sticky headers); respects\n * `prefers-reduced-motion` — automatically falls back to instant\n * scrolling when the user has opted out.\n *\n * SSR-safe — all methods no-op on the server.\n *\n * @example\n * ```ts\n * const scroll = inject(WrScroll);\n * scroll.to('#section-three', { offset: 80 });\n * scroll.toTop({ smooth: false });\n * scroll.intoView(myEl, { offset: 64 });\n * ```\n *\n * @see https://ngwr.dev/reference/services/scroll\n */\n@Service()\nexport class WrScroll {\n private readonly doc = inject(DOCUMENT);\n private readonly platform = inject(WrPlatform);\n\n /** Scroll to an arbitrary target. */\n to(target: WrScrollTarget, options: WrScrollOptions = {}): void {\n if (!this.platform.isBrowser) return;\n const win = this.doc.defaultView;\n if (!win) return;\n\n const offset = options.offset ?? 0;\n const behavior = this.behavior(options.smooth);\n const container = options.container ?? win;\n\n if (typeof target === 'object' && 'top' in target) {\n this.scroll(container, { top: target.top - offset, left: target.left ?? 0, behavior });\n return;\n }\n\n const el = typeof target === 'string' ? this.resolveSelector(target) : target;\n if (!el) return;\n\n const rect = el.getBoundingClientRect();\n if (container === win) {\n const top = rect.top + win.scrollY - offset;\n this.scroll(container, { top, left: 0, behavior });\n } else {\n const ctx = container as Element;\n const ctxRect = ctx.getBoundingClientRect();\n const top = rect.top - ctxRect.top + ctx.scrollTop - offset;\n this.scroll(container, { top, left: 0, behavior });\n }\n }\n\n /** Convenience for an element — accepts the same options. */\n intoView(el: Element, options: WrScrollOptions = {}): void {\n this.to(el, options);\n }\n\n /** Scroll the page (or container) to the top. */\n toTop(options: WrScrollOptions = {}): void {\n this.to({ top: 0 }, options);\n }\n\n // Internals\n\n private resolveSelector(value: string): Element | null {\n if (value.startsWith('#')) {\n return this.doc.getElementById(value.slice(1));\n }\n try {\n return this.doc.querySelector(value);\n } catch {\n return null;\n }\n }\n\n private behavior(requested: boolean | undefined): ScrollBehavior {\n if (requested === false) return 'auto';\n if (this.platform.prefersReducedMotion()) return 'auto';\n return 'smooth';\n }\n\n private scroll(container: Window | Element, options: ScrollToOptions): void {\n if (container instanceof Window) container.scrollTo(options);\n else container.scrollTo(options);\n }\n}\n"],"mappings":";;;;;;;;;;AAiCA,IAAa,WAAb,MAAa,SAAQ;CACF,MAAM,OAAOA,UAAQ;CACrB,WAAW,OAAO,UAAU;CAG7C,GAAG,QAAwB,UAA2B,CAAA,GAAE;EACtD,IAAI,CAAC,KAAK,SAAS,WAAW;EAC9B,MAAM,MAAM,KAAK,IAAI;EACrB,IAAI,CAAC,KAAK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UAAU,SAAS,OAAO;CACjC;CAlEW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,QAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;CAAQ,CAAA;;AAAR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA,EADpB,MAAA,Q"}
|
|
1
|
+
{"version":3,"file":"ngwr-scroll.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/scroll/wr-scroll.ts","../../../projects/lib/scroll/scroll-follow.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 { DOCUMENT } from '@angular/common';\nimport { Service, inject } from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\n\nimport type { WrScrollOptions, WrScrollTarget } from './types';\n\n/**\n * Smooth-scroll utility. Resolves `id` / selector / element / coords\n * targets; subtracts an `offset` (for sticky headers); respects\n * `prefers-reduced-motion` — automatically falls back to instant\n * scrolling when the user has opted out.\n *\n * SSR-safe — all methods no-op on the server.\n *\n * @example\n * ```ts\n * const scroll = inject(WrScroll);\n * scroll.to('#section-three', { offset: 80 });\n * scroll.toTop({ smooth: false });\n * scroll.intoView(myEl, { offset: 64 });\n * ```\n *\n * @see https://ngwr.dev/reference/services/scroll\n */\n@Service()\nexport class WrScroll {\n private readonly doc = inject(DOCUMENT);\n private readonly platform = inject(WrPlatform);\n\n /** Scroll to an arbitrary target. */\n to(target: WrScrollTarget, options: WrScrollOptions = {}): void {\n if (!this.platform.isBrowser) return;\n const win = this.doc.defaultView;\n if (!win) return;\n\n const offset = options.offset ?? 0;\n const behavior = this.behavior(options.smooth);\n const container = options.container ?? win;\n\n if (typeof target === 'object' && 'top' in target) {\n this.scroll(container, {\n top: target.top - offset,\n ...(target.left === undefined ? {} : { left: target.left }),\n behavior,\n });\n return;\n }\n\n const el = typeof target === 'string' ? this.resolveSelector(target) : target;\n if (!el) return;\n\n const rect = el.getBoundingClientRect();\n if (container === win) {\n const top = rect.top + win.scrollY - offset;\n this.scroll(container, { top, behavior });\n } else {\n const ctx = container as Element;\n const ctxRect = ctx.getBoundingClientRect();\n const top = rect.top - ctxRect.top + ctx.scrollTop - offset;\n this.scroll(container, { top, behavior });\n }\n }\n\n /** Convenience for an element — accepts the same options. */\n intoView(el: Element, options: WrScrollOptions = {}): void {\n this.to(el, options);\n }\n\n /** Scroll the page (or container) to the top. */\n toTop(options: WrScrollOptions = {}): void {\n this.to({ top: 0 }, options);\n }\n\n // Internals\n\n private resolveSelector(value: string): Element | null {\n if (value.startsWith('#')) {\n return this.doc.getElementById(value.slice(1));\n }\n try {\n return this.doc.querySelector(value);\n } catch {\n return null;\n }\n }\n\n /** `instant`, not `auto`: `auto` follows the container's `scroll-behavior`, which may be smooth. */\n private behavior(requested: boolean | undefined): ScrollBehavior {\n if (requested === false) return 'instant';\n if (this.platform.prefersReducedMotion()) return 'instant';\n return 'smooth';\n }\n\n private scroll(container: Window | Element, options: ScrollToOptions): void {\n if (container instanceof Window) container.scrollTo(options);\n else container.scrollTo(options);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n type Signal,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport type { WrScrollOptions } from './types';\nimport { WrScroll } from './wr-scroll';\n\n/** A row the view is held to, and where its top edge sat under the container's. */\ninterface Anchor {\n readonly node: Element;\n readonly offset: number;\n}\n\n/** A wrapper around the rows is looked through this many levels deep. */\nconst WRAPPER_DEPTH = 3;\n\n/**\n * Keeps a scroll container at its end while content grows, and holds the\n * reader's place while they are somewhere else.\n *\n * The container starts at its end and stays there as rows are added, as a row\n * grows (streamed text, an image that loads) and as the container is resized.\n * Scrolling up stops the following at once; scrolling back to within\n * `wrScrollFollowThreshold` of the end resumes it. While it is not following,\n * the lowest row in view keeps its place when content above it changes, so\n * older rows loaded at the top do not push the page down.\n *\n * `following` says which of the two it is doing, for a \"jump to latest\" button,\n * and `toEnd()` is what that button calls.\n *\n * The rows are the container's children, or the children of its only child.\n * The container scrolls vertically in the normal direction: RTL changes\n * nothing, and a `column-reverse` container is not supported. Nothing runs on\n * the server.\n *\n * @example\n * ```html\n * <div class=\"log\" wrScrollFollow #log=\"wrScrollFollow\">\n * @for (message of messages(); track message.id) {\n * <p>{{ message.text }}</p>\n * }\n * </div>\n * @if (!log.following()) {\n * <button type=\"button\" (click)=\"log.toEnd()\">Jump to latest</button>\n * }\n * ```\n *\n * @see https://ngwr.dev/reference/services/scroll\n */\n@Directive({\n selector: '[wrScrollFollow]',\n exportAs: 'wrScrollFollow',\n host: {\n // The browser's own scroll anchoring would move the view a second time.\n '[style.overflow-anchor]': 'wrScrollFollow() ? \"none\" : null',\n },\n})\nexport class WrScrollFollow {\n /** `false` switches it off and hands scroll anchoring back to the browser. Bare `wrScrollFollow` is on. */\n readonly wrScrollFollow = input(true, { transform: coerceBooleanProperty });\n\n /** How close to the end, in pixels, the reader has to scroll back for the following to resume. */\n readonly wrScrollFollowThreshold = input(80, {\n transform: (value: unknown) => Math.max(0, coerceNumberProperty(value, 80)),\n });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly scroll = inject(WrScroll);\n\n private readonly atEnd = signal(true);\n\n /** Whether the container is held at its end. `false` once the reader scrolls up, and while switched off. */\n readonly following: Signal<boolean> = computed(() => this.wrScrollFollow() && this.atEnd());\n\n private started = false;\n private lastTop = 0;\n private anchors: Anchor[] = [];\n /** `scrollTop` when `anchors` was measured, so a scroll since then is not undone. */\n private anchorsTop = 0;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n const host = this.el.nativeElement;\n const onScroll = (): void => this.onScroll();\n const resize = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => this.sync());\n const mutation = new MutationObserver(records => {\n for (const record of records) {\n if (record.target !== host) continue;\n for (const node of record.addedNodes) if (node instanceof Element) resize?.observe(node);\n for (const node of record.removedNodes) if (node instanceof Element) resize?.unobserve(node);\n }\n this.sync();\n });\n\n host.addEventListener('scroll', onScroll, { passive: true });\n // The host for its own height, its children for growth no mutation reports (an image, a font).\n resize?.observe(host);\n for (const child of host.children) resize?.observe(child);\n mutation.observe(host, { childList: true, characterData: true, subtree: true });\n\n this.started = true;\n this.sync();\n\n destroyRef.onDestroy(() => {\n host.removeEventListener('scroll', onScroll);\n resize?.disconnect();\n mutation.disconnect();\n });\n });\n\n effect(() => {\n const on = this.wrScrollFollow();\n if (!this.started) return;\n untracked(() => {\n if (on) this.atEnd.set(this.distance() <= this.wrScrollFollowThreshold());\n this.sync();\n });\n });\n }\n\n /**\n * Scroll to the end and follow again. Smooth unless `smooth` is `false` or\n * the reader prefers reduced motion.\n */\n toEnd(options: Pick<WrScrollOptions, 'smooth'> = {}): void {\n if (!this.started) return;\n const host = this.el.nativeElement;\n this.atEnd.set(true);\n this.anchors = [];\n this.scroll.to({ top: host.scrollHeight }, { ...options, container: host });\n }\n\n private distance(): number {\n const host = this.el.nativeElement;\n return host.scrollHeight - host.scrollTop - host.clientHeight;\n }\n\n private onScroll(): void {\n this.read(true);\n if (this.following()) {\n this.anchors = [];\n return;\n }\n if (!this.wrScrollFollow()) return;\n // A row above may have changed size with its resize callback still to come\n // (scroll events run first): correct for it before the anchor is replaced.\n this.restore();\n this.lastTop = this.el.nativeElement.scrollTop;\n this.capture();\n }\n\n /**\n * Any move up stops the following, so a reader can leave while text streams\n * in; within a pixel of the end it is the browser clamping to shorter content.\n * Only a move down resumes it: the directive's own writes are never read as one.\n */\n private read(scrolled: boolean): void {\n const top = this.el.nativeElement.scrollTop;\n const distance = this.distance();\n\n if (top < this.lastTop && distance > 1) this.atEnd.set(false);\n else if (scrolled && top > this.lastTop && distance <= this.wrScrollFollowThreshold()) this.atEnd.set(true);\n\n this.lastTop = top;\n }\n\n /** Content or the container changed size: hold the end, or hold the reader's place. */\n private sync(): void {\n const host = this.el.nativeElement;\n // A scroll whose event is still on its way must not be pinned over, and a\n // move down into the threshold resumes following here, before `lastTop`\n // moves past it and the scroll event finds nothing to read.\n this.read(true);\n\n if (!this.wrScrollFollow()) {\n this.anchors = [];\n return;\n }\n\n if (this.atEnd()) {\n this.move(host.scrollHeight);\n this.anchors = [];\n } else {\n this.restore();\n this.capture();\n }\n this.lastTop = host.scrollTop;\n }\n\n /** Instant whatever `scroll-behavior` the container has: an animated correction is a visible jump. */\n private move(top: number): void {\n this.el.nativeElement.scrollTo({ top, behavior: 'instant' });\n }\n\n /** Remember the lowest row in view. A row at the top would be the \"load older\" button. */\n private capture(): void {\n const host = this.el.nativeElement;\n const box = host.getBoundingClientRect();\n const anchors: Anchor[] = [];\n\n let parent: Element = host;\n for (let depth = 0; depth < WRAPPER_DEPTH; depth++) {\n let found: Anchor | null = null;\n let boxes = 0;\n for (let child = parent.lastElementChild; child; child = child.previousElementSibling) {\n const rect = child.getBoundingClientRect();\n // `display: none` and `display: contents` have no box to hold on to.\n if (!rect.width && !rect.height) continue;\n boxes++;\n if (!found && rect.top < box.bottom) found = { node: child, offset: rect.top - box.top };\n if (found && boxes > 1) break;\n }\n if (!found) break;\n anchors.push(found);\n // An only child is a wrapper, and its top does not move when rows are added inside it.\n if (boxes > 1) break;\n parent = found.node;\n }\n\n this.anchors = anchors;\n this.anchorsTop = host.scrollTop;\n }\n\n /** Put the remembered row back where it was. */\n private restore(): void {\n const host = this.el.nativeElement;\n const scrolledSince = host.scrollTop - this.anchorsTop;\n\n for (let i = this.anchors.length - 1; i >= 0; i--) {\n const { node, offset } = this.anchors[i];\n if (!host.contains(node)) continue;\n const rect = node.getBoundingClientRect();\n if (!rect.width && !rect.height) continue;\n\n const delta = rect.top - host.getBoundingClientRect().top - (offset - scrolledSince);\n if (Math.abs(delta) >= 1) this.move(host.scrollTop + delta);\n return;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAiCA,IAAa,WAAb,MAAa,SAAQ;CACF,MAAM,OAAOA,UAAQ;CACrB,WAAW,OAAO,UAAU;CAG7C,GAAG,QAAwB,UAA2B,CAAA,GAAE;EACtD,IAAI,CAAC,KAAK,SAAS,WAAW;EAC9B,MAAM,MAAM,KAAK,IAAI;EACrB,IAAI,CAAC,KAAK;EAEV,MAAM,SAAS,QAAQ,UAAU;EACjC,MAAM,WAAW,KAAK,SAAS,QAAQ,MAAM;EAC7C,MAAM,YAAY,QAAQ,aAAa;EAEvC,IAAI,OAAO,WAAW,YAAY,SAAS,QAAQ;GACjD,KAAK,OAAO,WAAW;IACrB,KAAK,OAAO,MAAM;IAClB,GAAI,OAAO,SAAS,SAAY,CAAA,IAAK,EAAE,MAAM,OAAO,KAAI;IACxD;GACD,CAAA;GACD;EACF;EAEA,MAAM,KAAK,OAAO,WAAW,WAAW,KAAK,gBAAgB,MAAM,IAAI;EACvE,IAAI,CAAC,IAAI;EAET,MAAM,OAAO,GAAG,sBAAqB;EACrC,IAAI,cAAc,KAAK;GACrB,MAAM,MAAM,KAAK,MAAM,IAAI,UAAU;GACrC,KAAK,OAAO,WAAW;IAAE;IAAK;GAAQ,CAAE;EAC1C,OAAO;GACL,MAAM,MAAM;GACZ,MAAM,UAAU,IAAI,sBAAqB;GACzC,MAAM,MAAM,KAAK,MAAM,QAAQ,MAAM,IAAI,YAAY;GACrD,KAAK,OAAO,WAAW;IAAE;IAAK;GAAQ,CAAE;EAC1C;CACF;CAGA,SAAS,IAAa,UAA2B,CAAA,GAAE;EACjD,KAAK,GAAG,IAAI,OAAO;CACrB;C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EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAc,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,gBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,yBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,yBAAA,qCAAA,EAAA;EAAA,UAAA,CAAA,gBAAA;EAAA,UAAA;CAAA,CAAA;;AAAd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAR1B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM,EAEJ,2BAA2B,qCAC5B;EACF,CAAA"}
|
|
@@ -24,6 +24,10 @@ var WrSegmented = class WrSegmented {
|
|
|
24
24
|
transform: coerceBooleanProperty
|
|
25
25
|
});
|
|
26
26
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
27
|
+
block = input(false, {
|
|
28
|
+
...ngDevMode ? { debugName: "block" } : /* istanbul ignore next */ {},
|
|
29
|
+
transform: coerceBooleanProperty
|
|
30
|
+
});
|
|
27
31
|
host = inject(ElementRef);
|
|
28
32
|
field = inject(WR_FORM_FIELD, { optional: true });
|
|
29
33
|
controlId = computed(() => this.field?.controlId() ?? null, ...ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []);
|
|
@@ -56,6 +60,7 @@ var WrSegmented = class WrSegmented {
|
|
|
56
60
|
const parts = [];
|
|
57
61
|
const size = this.size();
|
|
58
62
|
if (size !== "md") parts.push(`wr-segmented--${size}`);
|
|
63
|
+
if (this.block()) parts.push("wr-segmented--block");
|
|
59
64
|
if (this.disabled()) parts.push("wr-segmented--disabled");
|
|
60
65
|
else if (this.readonly()) parts.push("wr-segmented--readonly");
|
|
61
66
|
if (this.selectedIndex() < 0) parts.push("wr-segmented--unselected");
|
|
@@ -92,7 +97,7 @@ var WrSegmented = class WrSegmented {
|
|
|
92
97
|
}
|
|
93
98
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
94
99
|
minVersion: "12.0.0",
|
|
95
|
-
version: "22.
|
|
100
|
+
version: "22.3.0",
|
|
96
101
|
ngImport: i0,
|
|
97
102
|
type: WrSegmented,
|
|
98
103
|
deps: [],
|
|
@@ -100,7 +105,7 @@ var WrSegmented = class WrSegmented {
|
|
|
100
105
|
});
|
|
101
106
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
102
107
|
minVersion: "17.0.0",
|
|
103
|
-
version: "22.
|
|
108
|
+
version: "22.3.0",
|
|
104
109
|
type: WrSegmented,
|
|
105
110
|
isStandalone: true,
|
|
106
111
|
selector: "wr-segmented",
|
|
@@ -139,6 +144,13 @@ var WrSegmented = class WrSegmented {
|
|
|
139
144
|
isSignal: true,
|
|
140
145
|
isRequired: false,
|
|
141
146
|
transformFunction: null
|
|
147
|
+
},
|
|
148
|
+
block: {
|
|
149
|
+
classPropertyName: "block",
|
|
150
|
+
publicName: "block",
|
|
151
|
+
isSignal: true,
|
|
152
|
+
isRequired: false,
|
|
153
|
+
transformFunction: null
|
|
142
154
|
}
|
|
143
155
|
},
|
|
144
156
|
outputs: {
|
|
@@ -170,7 +182,7 @@ var WrSegmented = class WrSegmented {
|
|
|
170
182
|
};
|
|
171
183
|
i0.ɵɵngDeclareClassMetadata({
|
|
172
184
|
minVersion: "12.0.0",
|
|
173
|
-
version: "22.
|
|
185
|
+
version: "22.3.0",
|
|
174
186
|
ngImport: i0,
|
|
175
187
|
type: WrSegmented,
|
|
176
188
|
decorators: [{
|
|
@@ -240,6 +252,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
240
252
|
alias: "size",
|
|
241
253
|
required: false
|
|
242
254
|
}]
|
|
255
|
+
}],
|
|
256
|
+
block: [{
|
|
257
|
+
type: i0.Input,
|
|
258
|
+
args: [{
|
|
259
|
+
isSignal: true,
|
|
260
|
+
alias: "block",
|
|
261
|
+
required: false
|
|
262
|
+
}]
|
|
243
263
|
}]
|
|
244
264
|
}
|
|
245
265
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-segmented.mjs","names":[],"sources":["../../../projects/lib/segmented/segmented.ts","../../../projects/lib/segmented/segmented.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n HostAttributeToken,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { WrIcon } from 'ngwr/icon';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrSegmentedOption } from './types';\n\n/**\n * Single-choice picker rendered as a segmented control. Two-way binds\n * the selected `value`.\n *\n * A signal-forms native control: it implements `FormValueControl<T | null>`, so\n * `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone, and classic\n * `[(ngModel)]` / reactive forms keep working through Angular's bridge.\n *\n * It stays a `role=\"group\"` of `aria-pressed` toggle buttons rather than\n * becoming a `radiogroup`: being a form control changes what the value is bound\n * to, not what the widget is, and a radiogroup would owe a roving tab stop and\n * arrow-key selection — a different keyboard contract for every consumer who\n * already ships this. The group is what the field describes (`aria-describedby`\n * / `aria-invalid` land on the host), while the `<label for>` has to name a\n * labelable element, so the id goes on the first segment.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-segmented [options]=\"ranges\" [formField]=\"form.range\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-segmented\n * [options]=\"[\n * { value: 'day', label: 'Day' },\n * { value: 'week', label: 'Week' },\n * { value: 'month', label: 'Month' },\n * ]\"\n * [(value)]=\"range\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/segmented\n */\nexport type WrSegmentedSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-segmented',\n templateUrl: './segmented.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-segmented',\n '[class]': 'classes()',\n '[style]': 'thumbStyle()',\n role: 'group',\n // `<label for>` binds only to a labelable element, which a `role=\"group\"`\n // is not — so inside a `<wr-form-field label=\"…\">` the strip had no name,\n // while the field's own `for` landed on the FIRST segment, making a click\n // on the label select it.\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'ariaInvalid()',\n '(focusout)': 'onFocusOut($event)',\n },\n imports: [WrIcon],\n})\nexport class WrSegmented<T = unknown> implements FormValueControl<T | null> {\n /** The segments to render. */\n readonly options = input.required<readonly WrSegmentedOption<T>[]>();\n\n // The model keeps the component's own `T`, and the contract is satisfied as\n // `FormValueControl<T | null>` — legal because `FormField<T>` infers its type from\n // the FIELD it is handed and never from the host component, so the interface's\n // parameter describes this model rather than constraining the binding.\n // `wr-cascader` and `wr-tree` widen theirs to `unknown` because their value SHAPE\n // changes with a mode input (`TId | null` in single mode, a `readonly TId[]` in\n // multi) and no one type is true of both. A segmented control has one shape, so\n // widening here would only throw away what `[options]` already proved: every\n // `(valueChange)=\"pick($event)\"` in a typed app would start receiving `unknown`.\n // With the default type parameter this degenerates to exactly the catalog's\n // `FormValueControl<unknown>`.\n /**\n * The picked segment's `value`, `null` when nothing is selected. Bound by\n * `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<T | null>(null);\n\n /** Emitted when focus leaves the strip, so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /**\n * Disable the whole control. Bound automatically from the field's disabled\n * state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while every segment stays focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * NOTHING is mirrored into ARIA here, deliberately: the strip is a\n * `role=\"group\"` of `aria-pressed` buttons, and ARIA defines `aria-readonly`\n * for neither role — it is a state of `checkbox` / `radiogroup` / `textbox`\n * and their kin, and it is not global. `aria-disabled` is the only attribute\n * that would apply to a button, and it says the wrong thing: these segments\n * are still focusable and the value still submits. So the state is honest in\n * the DOM (`wr-segmented--readonly`) and silent in the accessibility tree\n * rather than announced with a word that means something else.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrSegmentedSize>('md');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Id the surrounding `<wr-form-field>`'s `<label for>` points at, stamped on the\n * FIRST segment.\n *\n * The field renders its label before it can see what was projected into it, so the\n * id travels the other way and the control adopts it, exactly as `[wrInput]`,\n * `wr-slider` and `wr-select` do. Without this the `for` named an element that was\n * nowhere in the document: clicking the label did nothing.\n *\n * It cannot go on the host — only a labelable element can be a label's target, and\n * `<wr-segmented>` is not one — and there is no single control to put it on, so it\n * goes where clicking the label should land a user: the first segment, which is\n * also the strip's first tab stop. The same choice `wr-slider` makes with its low\n * thumb.\n *\n * What this does NOT change is that segment's NAME: it is named by its own label,\n * and a `<label for>` cannot outrank text content in the accname order anyway.\n *\n * The one shape this reads wrong is a strip NESTED inside another control that is\n * itself the field — `<wr-color-picker>`'s own format tabs are the only case in\n * the library — where the id lands on a tab instead of on the picker. That is the\n * same exposure `[wrInput]`, `wr-slider` and `wr-select` all carry, and the fix\n * belongs to the outer control (shield its subtree by providing `WR_FORM_FIELD`\n * as `null`), not to a strip that cannot tell whose field it is in.\n */\n protected readonly controlId = computed(() => this.field?.controlId() ?? null);\n\n /**\n * The field's error message, wired to the GROUP rather than to a segment.\n *\n * A segmented control is one field made of several buttons, so the description\n * belongs to the thing the field describes — repeated on every segment it would be\n * announced once per Tab. `role=\"group\"` supports neither state as a role-specific\n * attribute, but both are ARIA globals, so this is valid where an `aria-checked`\n * would not be.\n *\n * `aria-invalid` is keyed on the message EXISTING rather than on `errorKeys()`,\n * because the field only publishes an id once it is showing something — announcing\n * \"invalid\" while pointing at nothing is worse than staying quiet.\n */\n // Through the shared helper, not a local pair: the hint is described by\n // `hintId`, which only `useFormFieldAria()` composes, and `aria-invalid` keys\n // on the error COUNT rather than on \"something is described\". Hand-rolled here,\n // these three announced the error and never the hint — and `<input wrInput>` is\n // the control the report was filed against.\n private readonly fieldAria = useFormFieldAria();\n /**\n * The author's own `aria-labelledby`, read as a static host attribute.\n *\n * A host binding WRITES the attribute, so binding the field's label\n * unconditionally would REMOVE a reference the consumer put there by hand:\n * `<wr-segmented aria-labelledby=\"range-question\">` went nameless the moment\n * the field's label was `null`, which a harness spec caught one commit after\n * it was introduced. `HostAttributeToken` reads it at construction without\n * touching the DOM, so this stays SSR-safe, and the author's own reference\n * wins — the same precedence `[ariaLabel]` has everywhere else.\n */\n private readonly ownLabelledBy = inject(new HostAttributeToken('aria-labelledby'), { optional: true });\n\n /** The surrounding field's label, unless the author named the control. */\n protected readonly labelledBy = computed(() => this.ownLabelledBy ?? this.fieldAria.labelledBy());\n\n protected readonly describedBy = this.fieldAria.describedBy;\n protected readonly ariaInvalid = this.fieldAria.ariaInvalid;\n\n /** Index of the selected option, or `-1` when nothing is selected. */\n protected readonly selectedIndex = computed(() => {\n const v = this.value();\n return this.options().findIndex(o => o.value === v);\n });\n\n /** Flips true after the first paint so the thumb only animates user-driven changes, not the initial snap. */\n private readonly mounted = signal(false);\n\n /**\n * True for the tick in which the reading direction changed.\n *\n * Mirroring moves the thumb's SLOT by the whole width of the strip (see\n * `thumbStyle`), and animating that is a quarter-second of the pill travelling\n * across options it does not mark — caught under the wrong label every time the\n * docs site's LTR / RTL switch was used, which is a strip inside an overlay that\n * mirrors underneath it. The selection did not move, so neither should the pill:\n * the stylesheet drops its transition while this is set, and the new slot lands\n * in the same pass that removes it.\n *\n * Cleared from a task rather than `afterNextRender`, which runs inside the very\n * change detection that set this and would put the transition back before the\n * new position is painted.\n */\n private readonly flipping = signal(false);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('segmented');\n afterNextRender(() => this.mounted.set(true));\n\n // `null` until the first run: an effect always runs once, and that run is not\n // a flip.\n let previous: boolean | null = null;\n effect(() => {\n const rtl = this.isRtl();\n if (previous === rtl) return;\n const flipped = previous !== null;\n previous = rtl;\n if (!flipped || typeof setTimeout !== 'function') return;\n\n untracked(() => this.flipping.set(true));\n setTimeout(() => this.flipping.set(false));\n });\n }\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-segmented--${size}`);\n if (this.disabled()) parts.push('wr-segmented--disabled');\n else if (this.readonly()) parts.push('wr-segmented--readonly');\n if (this.selectedIndex() < 0) parts.push('wr-segmented--unselected');\n if (this.mounted()) parts.push('wr-segmented--mounted');\n if (this.flipping()) parts.push('wr-segmented--flipping');\n return parts.join(' ');\n });\n\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * Reading direction of the strip. `Directionality` is root-provided, so this\n * always resolves — `optional` only guards a consumer who has deliberately\n * torn the provider out. A subtree that overrides the direction does it with\n * the CDK's `Dir` directive, which writes `valueSignal`, so `thumbStyle`\n * re-renders instead of leaving the thumb parked on the old segment.\n */\n private readonly isRtl = computed(() => this.dir?.valueSignal() === 'rtl');\n\n /**\n * Inline CSS vars driving the sliding thumb position.\n *\n * `--wr-segmented-thumb-index` is the SLOT the thumb parks in, counted from the\n * physical left, which is the selected index only in LTR. The stylesheet anchors\n * the thumb with a physical `left` and slides it with `translateX` — neither has\n * a logical form — while the options are a grid that mirrors, so under `dir=\"rtl\"`\n * the segment at logical index `i` occupies slot `count - 1 - i`. Left unsigned,\n * the pill sat under a different label than the one it marks (the whole strip's\n * worth of offset at the far end), which is the carousel's `trackStyle` problem\n * one component over.\n */\n protected readonly thumbStyle = computed<Record<string, string>>(() => {\n const i = Math.max(0, this.selectedIndex());\n const count = Math.max(1, this.options().length);\n const slot = this.isRtl() ? count - 1 - i : i;\n return {\n '--wr-segmented-thumb-index': `${slot}`,\n '--wr-segmented-thumb-count': `${count}`,\n };\n });\n\n /**\n * Focus the strip — what Signal Forms calls to focus this control. The first\n * enabled segment takes it, which is where Tab lands: the `role=\"group\"` host\n * has no tab stop of its own, and a disabled segment has none either.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement.querySelector<HTMLButtonElement>('.wr-segmented__option:not(:disabled)')?.focus(options);\n }\n\n protected isSelected(option: WrSegmentedOption<T>): boolean {\n return this.value() === option.value;\n }\n\n protected select(option: WrSegmentedOption<T>): void {\n if (this.disabled() || this.readonly() || option.disabled || this.isSelected(option)) return;\n this.value.set(option.value);\n }\n\n protected trackByValue(_: number, option: WrSegmentedOption<T>): unknown {\n return option.value;\n }\n\n /**\n * A bound field learns it may show its validation copy from `touch`, and a click\n * cannot be the source: a strip tabbed into and out of without a pick left the\n * field untouched forever — which is exactly the case `touched` exists for.\n *\n * `wr-knob` and `wr-rating` bind `(blur)` on the one element they own; this\n * component owns one button per option, so it listens for the bubbling `focusout`\n * on its host instead — and ignores the one that only moves focus from one segment\n * to the next, the way `wr-slider` ignores the hop between its two thumbs.\n */\n protected onFocusOut(event: FocusEvent): void {\n if (this.host.nativeElement.contains(event.relatedTarget as Node | null)) return;\n this.touch.emit();\n }\n}\n","<span class=\"wr-segmented__thumb\" aria-hidden=\"true\"></span>\n\n<!--\n `id` on the FIRST segment only: it is the id a surrounding `<wr-form-field>`\n already points its `<label for>` at, and a `for` may only name a labelable\n element — see `controlId` in the component. `null` without a field, so a bare\n strip stamps no document-global id on anything.\n-->\n@for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"wr-segmented__option\"\n [attr.id]=\"$first ? controlId() : null\"\n [class.wr-segmented__option--selected]=\"isSelected(option)\"\n [disabled]=\"disabled() || !!option.disabled\"\n [attr.aria-pressed]=\"isSelected(option)\"\n [attr.aria-label]=\"option.label ? null : (option.ariaLabel ?? option.value)\"\n (click)=\"select(option)\"\n >\n @if (option.icon) {\n <wr-icon class=\"wr-segmented__icon\" [name]=\"option.icon\" />\n }\n @if (option.label) {\n <span class=\"wr-segmented__label\">{{ option.label }}</span>\n }\n </button>\n}\n"],"mappings":";;;;;;;;;;;;;AAyFA,IAAa,cAAb,MAAa,YAAW;CAEb,UAAU,MAAM,SAA2C,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAiB3D,QAAQ,MAAgB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7B,QAAQ,OAAM;CAQd,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAkB1D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,OAAO,MAAuB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAE3B,OAAO,OAAgC,UAAU;CACjD,QAAQ,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CA2B9C,YAAY,eAAe,KAAK,OAAO,UAAS,KAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAoB7D,YAAY,iBAAgB;CAY5B,gBAAgB,OAAO,IAAI,mBAAmB,iBAAiB,GAAG,EAAE,U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A"}
|
|
1
|
+
{"version":3,"file":"ngwr-segmented.mjs","names":[],"sources":["../../../projects/lib/segmented/segmented.ts","../../../projects/lib/segmented/segmented.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n HostAttributeToken,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { WrIcon } from 'ngwr/icon';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrSegmentedOption } from './types';\n\n/**\n * Single-choice picker rendered as a segmented control. Two-way binds\n * the selected `value`.\n *\n * A signal-forms native control: it implements `FormValueControl<T | null>`, so\n * `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone, and classic\n * `[(ngModel)]` / reactive forms keep working through Angular's bridge.\n *\n * It stays a `role=\"group\"` of `aria-pressed` toggle buttons rather than\n * becoming a `radiogroup`: being a form control changes what the value is bound\n * to, not what the widget is, and a radiogroup would owe a roving tab stop and\n * arrow-key selection — a different keyboard contract for every consumer who\n * already ships this. The group is what the field describes (`aria-describedby`\n * / `aria-invalid` land on the host), while the `<label for>` has to name a\n * labelable element, so the id goes on the first segment.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-segmented [options]=\"ranges\" [formField]=\"form.range\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-segmented\n * [options]=\"[\n * { value: 'day', label: 'Day' },\n * { value: 'week', label: 'Week' },\n * { value: 'month', label: 'Month' },\n * ]\"\n * [(value)]=\"range\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/segmented\n */\nexport type WrSegmentedSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-segmented',\n templateUrl: './segmented.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-segmented',\n '[class]': 'classes()',\n '[style]': 'thumbStyle()',\n role: 'group',\n // `<label for>` binds only to a labelable element, which a `role=\"group\"`\n // is not — so inside a `<wr-form-field label=\"…\">` the strip had no name,\n // while the field's own `for` landed on the FIRST segment, making a click\n // on the label select it.\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'ariaInvalid()',\n '(focusout)': 'onFocusOut($event)',\n },\n imports: [WrIcon],\n})\nexport class WrSegmented<T = unknown> implements FormValueControl<T | null> {\n /** The segments to render. */\n readonly options = input.required<readonly WrSegmentedOption<T>[]>();\n\n // The model keeps the component's own `T`, and the contract is satisfied as\n // `FormValueControl<T | null>` — legal because `FormField<T>` infers its type from\n // the FIELD it is handed and never from the host component, so the interface's\n // parameter describes this model rather than constraining the binding.\n // `wr-cascader` and `wr-tree` widen theirs to `unknown` because their value SHAPE\n // changes with a mode input (`TId | null` in single mode, a `readonly TId[]` in\n // multi) and no one type is true of both. A segmented control has one shape, so\n // widening here would only throw away what `[options]` already proved: every\n // `(valueChange)=\"pick($event)\"` in a typed app would start receiving `unknown`.\n // With the default type parameter this degenerates to exactly the catalog's\n // `FormValueControl<unknown>`.\n /**\n * The picked segment's `value`, `null` when nothing is selected. Bound by\n * `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<T | null>(null);\n\n /** Emitted when focus leaves the strip, so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /**\n * Disable the whole control. Bound automatically from the field's disabled\n * state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while every segment stays focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * NOTHING is mirrored into ARIA here, deliberately: the strip is a\n * `role=\"group\"` of `aria-pressed` buttons, and ARIA defines `aria-readonly`\n * for neither role — it is a state of `checkbox` / `radiogroup` / `textbox`\n * and their kin, and it is not global. `aria-disabled` is the only attribute\n * that would apply to a button, and it says the wrong thing: these segments\n * are still focusable and the value still submits. So the state is honest in\n * the DOM (`wr-segmented--readonly`) and silent in the accessibility tree\n * rather than announced with a word that means something else.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrSegmentedSize>('md');\n\n /** Stretch the strip to fill its parent's width, shared equally by the segments. @default false */\n readonly block = input(false, { transform: coerceBooleanProperty });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Id the surrounding `<wr-form-field>`'s `<label for>` points at, stamped on the\n * FIRST segment.\n *\n * The field renders its label before it can see what was projected into it, so the\n * id travels the other way and the control adopts it, exactly as `[wrInput]`,\n * `wr-slider` and `wr-select` do. Without this the `for` named an element that was\n * nowhere in the document: clicking the label did nothing.\n *\n * It cannot go on the host — only a labelable element can be a label's target, and\n * `<wr-segmented>` is not one — and there is no single control to put it on, so it\n * goes where clicking the label should land a user: the first segment, which is\n * also the strip's first tab stop. The same choice `wr-slider` makes with its low\n * thumb.\n *\n * What this does NOT change is that segment's NAME: it is named by its own label,\n * and a `<label for>` cannot outrank text content in the accname order anyway.\n *\n * The one shape this reads wrong is a strip NESTED inside another control that is\n * itself the field — `<wr-color-picker>`'s own format tabs are the only case in\n * the library — where the id lands on a tab instead of on the picker. That is the\n * same exposure `[wrInput]`, `wr-slider` and `wr-select` all carry, and the fix\n * belongs to the outer control (shield its subtree by providing `WR_FORM_FIELD`\n * as `null`), not to a strip that cannot tell whose field it is in.\n */\n protected readonly controlId = computed(() => this.field?.controlId() ?? null);\n\n /**\n * The field's error message, wired to the GROUP rather than to a segment.\n *\n * A segmented control is one field made of several buttons, so the description\n * belongs to the thing the field describes — repeated on every segment it would be\n * announced once per Tab. `role=\"group\"` supports neither state as a role-specific\n * attribute, but both are ARIA globals, so this is valid where an `aria-checked`\n * would not be.\n *\n * `aria-invalid` is keyed on the message EXISTING rather than on `errorKeys()`,\n * because the field only publishes an id once it is showing something — announcing\n * \"invalid\" while pointing at nothing is worse than staying quiet.\n */\n // Through the shared helper, not a local pair: the hint is described by\n // `hintId`, which only `useFormFieldAria()` composes, and `aria-invalid` keys\n // on the error COUNT rather than on \"something is described\". Hand-rolled here,\n // these three announced the error and never the hint — and `<input wrInput>` is\n // the control the report was filed against.\n private readonly fieldAria = useFormFieldAria();\n /**\n * The author's own `aria-labelledby`, read as a static host attribute.\n *\n * A host binding WRITES the attribute, so binding the field's label\n * unconditionally would REMOVE a reference the consumer put there by hand:\n * `<wr-segmented aria-labelledby=\"range-question\">` went nameless the moment\n * the field's label was `null`, which a harness spec caught one commit after\n * it was introduced. `HostAttributeToken` reads it at construction without\n * touching the DOM, so this stays SSR-safe, and the author's own reference\n * wins — the same precedence `[ariaLabel]` has everywhere else.\n */\n private readonly ownLabelledBy = inject(new HostAttributeToken('aria-labelledby'), { optional: true });\n\n /** The surrounding field's label, unless the author named the control. */\n protected readonly labelledBy = computed(() => this.ownLabelledBy ?? this.fieldAria.labelledBy());\n\n protected readonly describedBy = this.fieldAria.describedBy;\n protected readonly ariaInvalid = this.fieldAria.ariaInvalid;\n\n /** Index of the selected option, or `-1` when nothing is selected. */\n protected readonly selectedIndex = computed(() => {\n const v = this.value();\n return this.options().findIndex(o => o.value === v);\n });\n\n /** Flips true after the first paint so the thumb only animates user-driven changes, not the initial snap. */\n private readonly mounted = signal(false);\n\n /**\n * True for the tick in which the reading direction changed.\n *\n * Mirroring moves the thumb's SLOT by the whole width of the strip (see\n * `thumbStyle`), and animating that is a quarter-second of the pill travelling\n * across options it does not mark — caught under the wrong label every time the\n * docs site's LTR / RTL switch was used, which is a strip inside an overlay that\n * mirrors underneath it. The selection did not move, so neither should the pill:\n * the stylesheet drops its transition while this is set, and the new slot lands\n * in the same pass that removes it.\n *\n * Cleared from a task rather than `afterNextRender`, which runs inside the very\n * change detection that set this and would put the transition back before the\n * new position is painted.\n */\n private readonly flipping = signal(false);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('segmented');\n afterNextRender(() => this.mounted.set(true));\n\n // `null` until the first run: an effect always runs once, and that run is not\n // a flip.\n let previous: boolean | null = null;\n effect(() => {\n const rtl = this.isRtl();\n if (previous === rtl) return;\n const flipped = previous !== null;\n previous = rtl;\n if (!flipped || typeof setTimeout !== 'function') return;\n\n untracked(() => this.flipping.set(true));\n setTimeout(() => this.flipping.set(false));\n });\n }\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-segmented--${size}`);\n if (this.block()) parts.push('wr-segmented--block');\n if (this.disabled()) parts.push('wr-segmented--disabled');\n else if (this.readonly()) parts.push('wr-segmented--readonly');\n if (this.selectedIndex() < 0) parts.push('wr-segmented--unselected');\n if (this.mounted()) parts.push('wr-segmented--mounted');\n if (this.flipping()) parts.push('wr-segmented--flipping');\n return parts.join(' ');\n });\n\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * Reading direction of the strip. `Directionality` is root-provided, so this\n * always resolves — `optional` only guards a consumer who has deliberately\n * torn the provider out. A subtree that overrides the direction does it with\n * the CDK's `Dir` directive, which writes `valueSignal`, so `thumbStyle`\n * re-renders instead of leaving the thumb parked on the old segment.\n */\n private readonly isRtl = computed(() => this.dir?.valueSignal() === 'rtl');\n\n /**\n * Inline CSS vars driving the sliding thumb position.\n *\n * `--wr-segmented-thumb-index` is the SLOT the thumb parks in, counted from the\n * physical left, which is the selected index only in LTR. The stylesheet anchors\n * the thumb with a physical `left` and slides it with `translateX` — neither has\n * a logical form — while the options are a grid that mirrors, so under `dir=\"rtl\"`\n * the segment at logical index `i` occupies slot `count - 1 - i`. Left unsigned,\n * the pill sat under a different label than the one it marks (the whole strip's\n * worth of offset at the far end), which is the carousel's `trackStyle` problem\n * one component over.\n */\n protected readonly thumbStyle = computed<Record<string, string>>(() => {\n const i = Math.max(0, this.selectedIndex());\n const count = Math.max(1, this.options().length);\n const slot = this.isRtl() ? count - 1 - i : i;\n return {\n '--wr-segmented-thumb-index': `${slot}`,\n '--wr-segmented-thumb-count': `${count}`,\n };\n });\n\n /**\n * Focus the strip — what Signal Forms calls to focus this control. The first\n * enabled segment takes it, which is where Tab lands: the `role=\"group\"` host\n * has no tab stop of its own, and a disabled segment has none either.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement.querySelector<HTMLButtonElement>('.wr-segmented__option:not(:disabled)')?.focus(options);\n }\n\n protected isSelected(option: WrSegmentedOption<T>): boolean {\n return this.value() === option.value;\n }\n\n protected select(option: WrSegmentedOption<T>): void {\n if (this.disabled() || this.readonly() || option.disabled || this.isSelected(option)) return;\n this.value.set(option.value);\n }\n\n protected trackByValue(_: number, option: WrSegmentedOption<T>): unknown {\n return option.value;\n }\n\n /**\n * A bound field learns it may show its validation copy from `touch`, and a click\n * cannot be the source: a strip tabbed into and out of without a pick left the\n * field untouched forever — which is exactly the case `touched` exists for.\n *\n * `wr-knob` and `wr-rating` bind `(blur)` on the one element they own; this\n * component owns one button per option, so it listens for the bubbling `focusout`\n * on its host instead — and ignores the one that only moves focus from one segment\n * to the next, the way `wr-slider` ignores the hop between its two thumbs.\n */\n protected onFocusOut(event: FocusEvent): void {\n if (this.host.nativeElement.contains(event.relatedTarget as Node | null)) return;\n this.touch.emit();\n }\n}\n","<span class=\"wr-segmented__thumb\" aria-hidden=\"true\"></span>\n\n<!--\n `id` on the FIRST segment only: it is the id a surrounding `<wr-form-field>`\n already points its `<label for>` at, and a `for` may only name a labelable\n element — see `controlId` in the component. `null` without a field, so a bare\n strip stamps no document-global id on anything.\n-->\n@for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"wr-segmented__option\"\n [attr.id]=\"$first ? controlId() : null\"\n [class.wr-segmented__option--selected]=\"isSelected(option)\"\n [disabled]=\"disabled() || !!option.disabled\"\n [attr.aria-pressed]=\"isSelected(option)\"\n [attr.aria-label]=\"option.label ? null : (option.ariaLabel ?? option.value)\"\n (click)=\"select(option)\"\n >\n @if (option.icon) {\n <wr-icon class=\"wr-segmented__icon\" [name]=\"option.icon\" />\n }\n @if (option.label) {\n <span class=\"wr-segmented__label\">{{ option.label }}</span>\n }\n </button>\n}\n"],"mappings":";;;;;;;;;;;;;AAyFA,IAAa,cAAb,MAAa,YAAW;CAEb,UAAU,MAAM,SAA2C,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAiB3D,QAAQ,MAAgB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7B,QAAQ,OAAM;CAQd,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAkB1D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,OAAO,MAAuB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGnC,QAAQ,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAE/C,OAAO,OAAgC,UAAU;CACjD,QAAQ,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CA2B9C,YAAY,eAAe,KAAK,OAAO,UAAS,KAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAoB7D,YAAY,iBAAgB;CAY5B,gBAAgB,OAAO,IAAI,mBAAmB,iBAAiB,GAAG,EAAE,UAAU,KAAI,CAAE;CAGlF,aAAa,eAA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