ngwr 16.2.0 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/styles/_tag.scss +73 -1
- package/calendar/styles/_index.scss +22 -0
- package/cascader/styles/_rules.scss +7 -0
- package/color-picker/styles/_index.scss +21 -0
- package/date-picker/styles/_index.scss +19 -0
- package/dropdown/styles/_index.scss +13 -19
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert-testing.mjs +70 -0
- package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +17 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +3 -3
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +129 -11
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
- package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger-testing.mjs +45 -0
- package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-testing.mjs +18 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +500 -73
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +37 -16
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- 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 +26 -11
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +3 -3
- package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- 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-testing.mjs +3 -2
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +153 -37
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +10 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare-testing.mjs +84 -0
- package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +30 -4
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +342 -69
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +59 -8
- 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 +18 -18
- package/fesm2022/ngwr-directives.mjs +15 -15
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +51 -29
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +11 -3
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +52 -95
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +4 -3
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +186 -33
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +274 -15
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +3 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +102 -42
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +19 -4
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +19 -4
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +19 -4
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +19 -4
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +19 -4
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +19 -4
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +19 -4
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +19 -4
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +19 -4
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +19 -4
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +19 -4
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +19 -4
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +19 -4
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +19 -4
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +19 -4
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +19 -4
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +19 -4
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +19 -4
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +19 -4
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +19 -4
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +19 -4
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +19 -4
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-input-number-testing.mjs +11 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +68 -7
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +23 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +24 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +152 -36
- 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-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +15 -15
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +175 -13
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +5 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +31 -29
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +44 -63
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +7 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +58 -156
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +50 -9
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable-testing.mjs +113 -0
- package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
- package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-schema-form.mjs +415 -19
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select-testing.mjs +19 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +263 -83
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider-testing.mjs +6 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +21 -3
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +29 -12
- 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 +42 -11
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-testing.mjs +88 -2
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +891 -74
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-testing.mjs +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +15 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +11 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +128 -16
- 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 +40 -19
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-transfer-testing.mjs +6 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +24 -5
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +62 -2
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +966 -78
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +34 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +33 -22
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +156 -0
- package/i18n/ar.json +21 -4
- package/i18n/cs.json +21 -4
- package/i18n/de.json +21 -4
- package/i18n/en.json +21 -4
- package/i18n/es.json +21 -4
- package/i18n/fr.json +21 -4
- package/i18n/he.json +21 -4
- package/i18n/hi.json +21 -4
- package/i18n/id.json +21 -4
- package/i18n/it.json +21 -4
- package/i18n/ja.json +21 -4
- package/i18n/ko.json +21 -4
- package/i18n/nl.json +21 -4
- package/i18n/pl.json +21 -4
- package/i18n/pt.json +21 -4
- package/i18n/ru.json +21 -4
- package/i18n/sv.json +21 -4
- package/i18n/tr.json +21 -4
- package/i18n/uk.json +21 -4
- package/i18n/vi.json +21 -4
- package/i18n/zh-TW.json +21 -4
- package/i18n/zh.json +21 -4
- package/input/styles/_index.scss +68 -1
- package/input-otp/styles/_index.scss +14 -0
- package/llms-full.txt +52 -20
- package/overlay/styles/_arrow.scss +4 -4
- package/package.json +33 -1
- package/popconfirm/styles/_index.scss +3 -11
- package/progress/styles/_index.scss +32 -0
- package/schema-form/styles/_index.scss +78 -0
- package/schematics/use/rule.js +2 -0
- package/schematics/use/symbol-map.json +4 -0
- package/select/styles/_index.scss +114 -22
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +9 -1
- package/slider/styles/_index.scss +22 -0
- package/table/styles/_index.scss +167 -3
- package/textarea/styles/_index.scss +80 -0
- package/theme/styles/_focus.scss +5 -0
- package/theme/styles/_motion.scss +5 -0
- package/transfer/styles/_index.scss +84 -0
- package/tree/styles/_index.scss +138 -5
- package/types/ngwr-alert-testing.d.ts +88 -0
- package/types/ngwr-badge.d.ts +72 -2
- package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
- package/types/ngwr-burger-testing.d.ts +51 -0
- package/types/ngwr-calendar-testing.d.ts +18 -6
- package/types/ngwr-calendar.d.ts +272 -22
- package/types/ngwr-cascader.d.ts +10 -1
- package/types/ngwr-charts-chart-legend.d.ts +9 -4
- package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
- package/types/ngwr-charts-line-chart.d.ts +7 -4
- package/types/ngwr-color-picker-testing.d.ts +15 -4
- package/types/ngwr-color-picker.d.ts +76 -6
- package/types/ngwr-compare-testing.d.ts +72 -0
- package/types/ngwr-date-picker-testing.d.ts +23 -8
- package/types/ngwr-date-picker.d.ts +100 -9
- package/types/ngwr-date.d.ts +71 -1
- package/types/ngwr-drawer.d.ts +9 -0
- package/types/ngwr-dropdown-testing.d.ts +20 -0
- package/types/ngwr-dropdown.d.ts +24 -6
- package/types/ngwr-event-calendar.d.ts +66 -8
- package/types/ngwr-file-upload-testing.d.ts +31 -2
- package/types/ngwr-file-upload.d.ts +148 -1
- package/types/ngwr-form.d.ts +47 -3
- package/types/ngwr-graph-testing.d.ts +8 -3
- package/types/ngwr-graph.d.ts +147 -7
- package/types/ngwr-input-number-testing.d.ts +10 -0
- package/types/ngwr-input-number.d.ts +30 -1
- package/types/ngwr-input-otp.d.ts +10 -0
- package/types/ngwr-input-testing.d.ts +30 -0
- package/types/ngwr-input.d.ts +54 -3
- package/types/ngwr-overlay.d.ts +84 -5
- package/types/ngwr-pipes.d.ts +2 -1
- package/types/ngwr-popconfirm-testing.d.ts +12 -3
- package/types/ngwr-popconfirm.d.ts +28 -3
- package/types/ngwr-popover-testing.d.ts +19 -2
- package/types/ngwr-popover.d.ts +22 -2
- package/types/ngwr-progress.d.ts +29 -1
- package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
- package/types/ngwr-resizable-testing.d.ts +116 -0
- package/types/ngwr-schema-form-testing.d.ts +260 -0
- package/types/ngwr-schema-form.d.ts +76 -6
- package/types/ngwr-select-testing.d.ts +20 -0
- package/types/ngwr-select.d.ts +112 -11
- package/types/ngwr-sidebar-testing.d.ts +176 -0
- package/types/ngwr-slider-testing.d.ts +3 -1
- package/types/ngwr-slider.d.ts +21 -1
- package/types/ngwr-sortable-list.d.ts +6 -0
- package/types/ngwr-stepper.d.ts +20 -11
- package/types/ngwr-table-testing.d.ts +70 -6
- package/types/ngwr-table.d.ts +480 -50
- package/types/ngwr-tabs-testing.d.ts +14 -17
- package/types/ngwr-tabs.d.ts +6 -0
- package/types/ngwr-textarea-testing.d.ts +10 -0
- package/types/ngwr-textarea.d.ts +48 -2
- package/types/ngwr-toast.d.ts +8 -1
- package/types/ngwr-transfer-testing.d.ts +3 -0
- package/types/ngwr-transfer.d.ts +24 -1
- package/types/ngwr-tree-testing.d.ts +65 -1
- package/types/ngwr-tree.d.ts +333 -12
- package/types/ngwr-utils.d.ts +28 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +7 -4
package/fesm2022/ngwr-select.mjs
CHANGED
|
@@ -6,10 +6,10 @@ import { wrCheckStyles, wrIsComposing, wrRandomId, wrToClassList } from "ngwr/ut
|
|
|
6
6
|
import { useI18nFormatter, useI18nText } from "ngwr/i18n";
|
|
7
7
|
import { Directionality } from "@angular/cdk/bidi";
|
|
8
8
|
import { WrSpinner } from "ngwr/spinner";
|
|
9
|
+
import { WR_FORM_FIELD, useFormFieldAria } from "ngwr/form";
|
|
9
10
|
import { ScrollStrategyOptions } from "@angular/cdk/overlay";
|
|
10
11
|
import { TemplatePortal } from "@angular/cdk/portal";
|
|
11
12
|
import { takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
|
|
12
|
-
import { WR_FORM_FIELD, useFormFieldAria } from "ngwr/form";
|
|
13
13
|
import { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from "ngwr/overlay";
|
|
14
14
|
import { Subject, catchError, debounce, defer, finalize, from, isObservable, map, merge, of, skip, switchMap, tap, timer } from "rxjs";
|
|
15
15
|
/**
|
|
@@ -25,7 +25,7 @@ var WrSelectLoadError = class WrSelectLoadError {
|
|
|
25
25
|
}
|
|
26
26
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
27
27
|
minVersion: "12.0.0",
|
|
28
|
-
version: "22.2.
|
|
28
|
+
version: "22.2.6",
|
|
29
29
|
ngImport: i0,
|
|
30
30
|
type: WrSelectLoadError,
|
|
31
31
|
deps: [],
|
|
@@ -33,7 +33,7 @@ var WrSelectLoadError = class WrSelectLoadError {
|
|
|
33
33
|
});
|
|
34
34
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
35
35
|
minVersion: "14.0.0",
|
|
36
|
-
version: "22.2.
|
|
36
|
+
version: "22.2.6",
|
|
37
37
|
type: WrSelectLoadError,
|
|
38
38
|
isStandalone: true,
|
|
39
39
|
selector: "ng-template[wrSelectLoadError]",
|
|
@@ -42,7 +42,7 @@ var WrSelectLoadError = class WrSelectLoadError {
|
|
|
42
42
|
};
|
|
43
43
|
i0.ɵɵngDeclareClassMetadata({
|
|
44
44
|
minVersion: "12.0.0",
|
|
45
|
-
version: "22.2.
|
|
45
|
+
version: "22.2.6",
|
|
46
46
|
ngImport: i0,
|
|
47
47
|
type: WrSelectLoadError,
|
|
48
48
|
decorators: [{
|
|
@@ -63,7 +63,7 @@ var WrOptionLeading = class WrOptionLeading {
|
|
|
63
63
|
}
|
|
64
64
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
65
65
|
minVersion: "12.0.0",
|
|
66
|
-
version: "22.2.
|
|
66
|
+
version: "22.2.6",
|
|
67
67
|
ngImport: i0,
|
|
68
68
|
type: WrOptionLeading,
|
|
69
69
|
deps: [],
|
|
@@ -71,7 +71,7 @@ var WrOptionLeading = class WrOptionLeading {
|
|
|
71
71
|
});
|
|
72
72
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
73
73
|
minVersion: "14.0.0",
|
|
74
|
-
version: "22.2.
|
|
74
|
+
version: "22.2.6",
|
|
75
75
|
type: WrOptionLeading,
|
|
76
76
|
isStandalone: true,
|
|
77
77
|
selector: "ng-template[wrOptionLeading]",
|
|
@@ -80,7 +80,7 @@ var WrOptionLeading = class WrOptionLeading {
|
|
|
80
80
|
};
|
|
81
81
|
i0.ɵɵngDeclareClassMetadata({
|
|
82
82
|
minVersion: "12.0.0",
|
|
83
|
-
version: "22.2.
|
|
83
|
+
version: "22.2.6",
|
|
84
84
|
ngImport: i0,
|
|
85
85
|
type: WrOptionLeading,
|
|
86
86
|
decorators: [{
|
|
@@ -126,6 +126,7 @@ var WrOption = class WrOption {
|
|
|
126
126
|
const explicit = this.label();
|
|
127
127
|
return explicit !== null && explicit !== "" ? explicit : this.labelText();
|
|
128
128
|
}, ...ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []);
|
|
129
|
+
searchLabel = computed(() => this.resolvedLabel().toLowerCase(), ...ngDevMode ? [{ debugName: "searchLabel" }] : /* istanbul ignore next */ []);
|
|
129
130
|
selected = computed(() => {
|
|
130
131
|
const parent = this.parent;
|
|
131
132
|
if (!parent) return false;
|
|
@@ -139,7 +140,7 @@ var WrOption = class WrOption {
|
|
|
139
140
|
if (!parent?.isSearchable() || !parent.clientFilter()) return false;
|
|
140
141
|
const q = parent.searchQuery().trim().toLowerCase();
|
|
141
142
|
if (!q) return false;
|
|
142
|
-
return !this.
|
|
143
|
+
return !this.searchLabel().includes(q);
|
|
143
144
|
}, ...ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []);
|
|
144
145
|
classes = computed(() => {
|
|
145
146
|
const parts = [];
|
|
@@ -153,17 +154,25 @@ var WrOption = class WrOption {
|
|
|
153
154
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("select");
|
|
154
155
|
if (this.parent) {
|
|
155
156
|
const parent = this.parent;
|
|
156
|
-
|
|
157
|
+
const destroyRef = inject(DestroyRef);
|
|
158
|
+
let registered = false;
|
|
159
|
+
effect(() => {
|
|
157
160
|
untracked(() => this.syncLabel());
|
|
158
|
-
const
|
|
161
|
+
const reg = {
|
|
159
162
|
id: this.id,
|
|
160
163
|
value: this.value(),
|
|
161
164
|
disabled: this.disabled(),
|
|
162
165
|
label: this.resolvedLabel,
|
|
166
|
+
searchLabel: this.searchLabel,
|
|
163
167
|
host: this.host.nativeElement,
|
|
164
168
|
leading: this.leading
|
|
165
|
-
}
|
|
166
|
-
|
|
169
|
+
};
|
|
170
|
+
if (registered) {
|
|
171
|
+
parent.updateOption(reg);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
registered = true;
|
|
175
|
+
destroyRef.onDestroy(parent.registerOption(reg));
|
|
167
176
|
});
|
|
168
177
|
afterEveryRender(() => this.syncLabel());
|
|
169
178
|
}
|
|
@@ -183,7 +192,7 @@ var WrOption = class WrOption {
|
|
|
183
192
|
}
|
|
184
193
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
185
194
|
minVersion: "12.0.0",
|
|
186
|
-
version: "22.2.
|
|
195
|
+
version: "22.2.6",
|
|
187
196
|
ngImport: i0,
|
|
188
197
|
type: WrOption,
|
|
189
198
|
deps: [],
|
|
@@ -191,7 +200,7 @@ var WrOption = class WrOption {
|
|
|
191
200
|
});
|
|
192
201
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
193
202
|
minVersion: "17.0.0",
|
|
194
|
-
version: "22.2.
|
|
203
|
+
version: "22.2.6",
|
|
195
204
|
type: WrOption,
|
|
196
205
|
isStandalone: true,
|
|
197
206
|
selector: "wr-option",
|
|
@@ -260,7 +269,7 @@ var WrOption = class WrOption {
|
|
|
260
269
|
};
|
|
261
270
|
i0.ɵɵngDeclareClassMetadata({
|
|
262
271
|
minVersion: "12.0.0",
|
|
263
|
-
version: "22.2.
|
|
272
|
+
version: "22.2.6",
|
|
264
273
|
ngImport: i0,
|
|
265
274
|
type: WrOption,
|
|
266
275
|
decorators: [{
|
|
@@ -324,6 +333,18 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
324
333
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
325
334
|
*/
|
|
326
335
|
let listboxUid = 0;
|
|
336
|
+
const SELECT_ALL_INDEX = -2;
|
|
337
|
+
function searchLabelOf(option) {
|
|
338
|
+
return option.searchLabel ? option.searchLabel() : option.label().toLowerCase();
|
|
339
|
+
}
|
|
340
|
+
function byDocumentPosition(a, b) {
|
|
341
|
+
if (!a.host || !b.host || a.host === b.host) return 0;
|
|
342
|
+
const relation = a.host.compareDocumentPosition(b.host);
|
|
343
|
+
if (relation & Node.DOCUMENT_POSITION_DISCONNECTED) return 0;
|
|
344
|
+
if (relation & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
345
|
+
if (relation & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
346
|
+
return 0;
|
|
347
|
+
}
|
|
327
348
|
var WrSelect = class WrSelect {
|
|
328
349
|
placeholder = input(null, ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
329
350
|
clearLabel = input(null, ...ngDevMode ? [{ debugName: "clearLabel" }] : /* istanbul ignore next */ []);
|
|
@@ -452,6 +473,12 @@ var WrSelect = class WrSelect {
|
|
|
452
473
|
...ngDevMode ? { debugName: "maxItems" } : /* istanbul ignore next */ {},
|
|
453
474
|
transform: (v) => Math.max(0, Number(v) || 0)
|
|
454
475
|
});
|
|
476
|
+
selectAll = input(false, {
|
|
477
|
+
...ngDevMode ? { debugName: "selectAll" } : /* istanbul ignore next */ {},
|
|
478
|
+
transform: coerceBooleanProperty
|
|
479
|
+
});
|
|
480
|
+
selectAllLabel = input(null, ...ngDevMode ? [{ debugName: "selectAllLabel" }] : /* istanbul ignore next */ []);
|
|
481
|
+
resolvedSelectAll = useI18nText(this.selectAllLabel, "select.selectAll", "Select all");
|
|
455
482
|
maxTagCount = input(0, {
|
|
456
483
|
...ngDevMode ? { debugName: "maxTagCount" } : /* istanbul ignore next */ {},
|
|
457
484
|
transform: (v) => Math.max(0, Number(v) || 0)
|
|
@@ -461,22 +488,36 @@ var WrSelect = class WrSelect {
|
|
|
461
488
|
opened = output();
|
|
462
489
|
closed = output();
|
|
463
490
|
listboxId = `wr-select-listbox-${++listboxUid}`;
|
|
464
|
-
|
|
491
|
+
registrations = /* @__PURE__ */ new Map();
|
|
492
|
+
registryVersion = signal(0, ...ngDevMode ? [{ debugName: "registryVersion" }] : /* istanbul ignore next */ []);
|
|
493
|
+
registryByValue = computed(() => {
|
|
494
|
+
this.registryVersion();
|
|
495
|
+
const byValue = /* @__PURE__ */ new Map();
|
|
496
|
+
for (const reg of this.registrations.values()) if (!byValue.has(reg.value)) byValue.set(reg.value, reg);
|
|
497
|
+
return byValue;
|
|
498
|
+
}, ...ngDevMode ? [{ debugName: "registryByValue" }] : /* istanbul ignore next */ []);
|
|
499
|
+
ordered = [];
|
|
500
|
+
orderStale = false;
|
|
501
|
+
orderIsCreation = true;
|
|
465
502
|
orderedRegistry = computed(() => {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
503
|
+
this.panelAttached();
|
|
504
|
+
this.registryVersion();
|
|
505
|
+
if (this.orderStale) {
|
|
506
|
+
const list = [...this.registrations.values()];
|
|
507
|
+
this.ordered = list.length < 2 ? list : [...list].sort(byDocumentPosition);
|
|
508
|
+
this.orderIsCreation = this.ordered.every((reg, i) => reg === list[i]);
|
|
509
|
+
this.orderStale = false;
|
|
510
|
+
}
|
|
511
|
+
return this.ordered;
|
|
512
|
+
}, {
|
|
513
|
+
...ngDevMode ? { debugName: "orderedRegistry" } : /* istanbul ignore next */ {},
|
|
514
|
+
equal: () => false
|
|
515
|
+
});
|
|
516
|
+
panelAttached = signal(0, ...ngDevMode ? [{ debugName: "panelAttached" }] : /* istanbul ignore next */ []);
|
|
477
517
|
activeIndex = signal(-1, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
|
|
478
518
|
activeOptionId = computed(() => {
|
|
479
519
|
if (this.retryOffered() && !this.freeText()) return this.retryRowId;
|
|
520
|
+
if (this.selectAllActive()) return this.selectAllId;
|
|
480
521
|
const idx = this.activeIndex();
|
|
481
522
|
if (this.virtualActive()) {
|
|
482
523
|
const { start, end } = this.virtualWindow();
|
|
@@ -485,15 +526,16 @@ var WrSelect = class WrSelect {
|
|
|
485
526
|
const list = this.orderedRegistry();
|
|
486
527
|
return idx >= 0 && idx < list.length ? list[idx].id : null;
|
|
487
528
|
}, ...ngDevMode ? [{ debugName: "activeOptionId" }] : /* istanbul ignore next */ []);
|
|
488
|
-
|
|
489
|
-
|
|
529
|
+
openState = signal(false, ...ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []);
|
|
530
|
+
isOpen = this.openState.asReadonly();
|
|
531
|
+
panelOpen = this.isOpen;
|
|
490
532
|
defaultLeading = contentChild(WrOptionLeading, {
|
|
491
533
|
...ngDevMode ? { debugName: "defaultLeading" } : /* istanbul ignore next */ {},
|
|
492
534
|
descendants: false
|
|
493
535
|
});
|
|
494
536
|
optionLeading = computed(() => this.defaultLeading()?.template ?? null, ...ngDevMode ? [{ debugName: "optionLeading" }] : /* istanbul ignore next */ []);
|
|
495
537
|
leadingFor(value) {
|
|
496
|
-
const found = this.
|
|
538
|
+
const found = this.registryByValue().get(value);
|
|
497
539
|
if (found?.leading) return found.leading();
|
|
498
540
|
return this.optionLeading();
|
|
499
541
|
}
|
|
@@ -509,10 +551,10 @@ var WrSelect = class WrSelect {
|
|
|
509
551
|
selectedLabel = computed(() => {
|
|
510
552
|
const v = this.value();
|
|
511
553
|
if (this.isMulti()) return null;
|
|
512
|
-
const match = this.
|
|
554
|
+
const match = this.registryByValue().get(v);
|
|
513
555
|
if (match) return match.label();
|
|
514
556
|
if (v == null) return null;
|
|
515
|
-
if (this.isSearchable() || this.
|
|
557
|
+
if (this.isSearchable() || this.dynamicOptionSet().has(v)) return this.displayWith()(v);
|
|
516
558
|
return null;
|
|
517
559
|
}, ...ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []);
|
|
518
560
|
selectedChips = computed(() => {
|
|
@@ -523,9 +565,9 @@ var WrSelect = class WrSelect {
|
|
|
523
565
|
label: String(v),
|
|
524
566
|
leading: null
|
|
525
567
|
}));
|
|
526
|
-
const
|
|
568
|
+
const byValue = this.registryByValue();
|
|
527
569
|
return arr.map((v) => {
|
|
528
|
-
const found =
|
|
570
|
+
const found = byValue.get(v);
|
|
529
571
|
return {
|
|
530
572
|
value: v,
|
|
531
573
|
label: found?.label() ?? this.displayWith()(v),
|
|
@@ -564,6 +606,11 @@ var WrSelect = class WrSelect {
|
|
|
564
606
|
return parts.join(" ");
|
|
565
607
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
566
608
|
dynamicOptions = computed(() => this.loader() ? this.loadedOptions() : this.options(), ...ngDevMode ? [{ debugName: "dynamicOptions" }] : /* istanbul ignore next */ []);
|
|
609
|
+
dynamicOptionSet = computed(() => new Set(this.dynamicOptions()), ...ngDevMode ? [{ debugName: "dynamicOptionSet" }] : /* istanbul ignore next */ []);
|
|
610
|
+
dynamicSearchLabels = computed(() => {
|
|
611
|
+
const label = this.displayWith();
|
|
612
|
+
return this.dynamicOptions().map((it) => label(it).toLowerCase());
|
|
613
|
+
}, ...ngDevMode ? [{ debugName: "dynamicSearchLabels" }] : /* istanbul ignore next */ []);
|
|
567
614
|
static FALLBACK_ROW_PX = 34;
|
|
568
615
|
static FALLBACK_VIEWPORT_PX = 256;
|
|
569
616
|
projectedOptions = contentChildren(WrOption, {
|
|
@@ -575,8 +622,8 @@ var WrSelect = class WrSelect {
|
|
|
575
622
|
if (!this.clientFilter()) return items;
|
|
576
623
|
const q = this.searchQuery().trim().toLowerCase();
|
|
577
624
|
if (!q) return items;
|
|
578
|
-
const
|
|
579
|
-
return items.filter((
|
|
625
|
+
const labels = this.dynamicSearchLabels();
|
|
626
|
+
return items.filter((_, i) => labels[i].includes(q));
|
|
580
627
|
}, ...ngDevMode ? [{ debugName: "filteredDynamicOptions" }] : /* istanbul ignore next */ []);
|
|
581
628
|
virtualActive = computed(() => this.virtualScroll() && !this.isTag() && this.projectedOptions().length === 0, ...ngDevMode ? [{ debugName: "virtualActive" }] : /* istanbul ignore next */ []);
|
|
582
629
|
scrollTop = signal(0, ...ngDevMode ? [{ debugName: "scrollTop" }] : /* istanbul ignore next */ []);
|
|
@@ -658,8 +705,9 @@ var WrSelect = class WrSelect {
|
|
|
658
705
|
const panelRect = panel.getBoundingClientRect();
|
|
659
706
|
const rowRect = row.getBoundingClientRect();
|
|
660
707
|
const cur = panel.scrollTop;
|
|
661
|
-
const
|
|
662
|
-
const
|
|
708
|
+
const pinned = panel.querySelector(".wr-select-panel__select-all")?.getBoundingClientRect().height ?? 0;
|
|
709
|
+
const top = rowRect.top - panelRect.top + cur - pinned;
|
|
710
|
+
const vp = panel.clientHeight - pinned;
|
|
663
711
|
let next = cur;
|
|
664
712
|
if (top < cur) next = top;
|
|
665
713
|
else if (top + rowRect.height > cur + vp) next = top + rowRect.height - vp;
|
|
@@ -667,12 +715,13 @@ var WrSelect = class WrSelect {
|
|
|
667
715
|
}
|
|
668
716
|
visibleCount = computed(() => {
|
|
669
717
|
if (this.virtualActive()) return this.filteredDynamicOptions().length;
|
|
670
|
-
|
|
671
|
-
|
|
718
|
+
this.registryVersion();
|
|
719
|
+
const list = this.registrations;
|
|
720
|
+
if (!this.isSearchable() || !this.clientFilter()) return list.size;
|
|
672
721
|
const q = this.searchQuery().trim().toLowerCase();
|
|
673
|
-
if (!q) return list.
|
|
722
|
+
if (!q) return list.size;
|
|
674
723
|
let count = 0;
|
|
675
|
-
for (const o of list) if (o
|
|
724
|
+
for (const o of list.values()) if (searchLabelOf(o).includes(q)) count++;
|
|
676
725
|
return count;
|
|
677
726
|
}, ...ngDevMode ? [{ debugName: "visibleCount" }] : /* istanbul ignore next */ []);
|
|
678
727
|
meetsMinChars = computed(() => !this.isSearchable() || this.searchQuery().trim().length >= this.minChars(), ...ngDevMode ? [{ debugName: "meetsMinChars" }] : /* istanbul ignore next */ []);
|
|
@@ -696,11 +745,50 @@ var WrSelect = class WrSelect {
|
|
|
696
745
|
retryFn = () => this.onLoadErrorClick();
|
|
697
746
|
retryOffered = computed(() => this.retryable() && this.showLoadError() && this.visibleCount() === 0, ...ngDevMode ? [{ debugName: "retryOffered" }] : /* istanbul ignore next */ []);
|
|
698
747
|
retryRowId = `${this.listboxId}-retry`;
|
|
699
|
-
|
|
748
|
+
selectAllId = `${this.listboxId}-all`;
|
|
749
|
+
selectAllTargets = computed(() => {
|
|
750
|
+
if (!this.selectAll() || !this.isMulti()) return [];
|
|
751
|
+
if (this.virtualActive()) return this.filteredDynamicOptions();
|
|
752
|
+
return this.orderedRegistry().filter((option) => !option.disabled && !this.isOptionHidden(option)).map((option) => option.value);
|
|
753
|
+
}, ...ngDevMode ? [{ debugName: "selectAllTargets" }] : /* istanbul ignore next */ []);
|
|
754
|
+
showSelectAll = computed(() => this.selectAllTargets().length > 0, ...ngDevMode ? [{ debugName: "showSelectAll" }] : /* istanbul ignore next */ []);
|
|
755
|
+
selectAllState = computed(() => {
|
|
756
|
+
const targets = this.selectAllTargets();
|
|
757
|
+
const selected = this.selectedSet();
|
|
758
|
+
let count = 0;
|
|
759
|
+
for (const value of targets) if (selected.has(value)) count++;
|
|
760
|
+
if (count === 0) return "none";
|
|
761
|
+
return count === targets.length ? "all" : "some";
|
|
762
|
+
}, ...ngDevMode ? [{ debugName: "selectAllState" }] : /* istanbul ignore next */ []);
|
|
763
|
+
selectAllChecked = computed(() => {
|
|
764
|
+
const state = this.selectAllState();
|
|
765
|
+
return state === "all" ? "true" : state === "some" ? "mixed" : "false";
|
|
766
|
+
}, ...ngDevMode ? [{ debugName: "selectAllChecked" }] : /* istanbul ignore next */ []);
|
|
767
|
+
selectAllUnavailable = computed(() => this.selectAllState() === "none" && this.atCapacity(), ...ngDevMode ? [{ debugName: "selectAllUnavailable" }] : /* istanbul ignore next */ []);
|
|
768
|
+
selectAllActive = computed(() => this.showSelectAll() && this.activeIndex() === SELECT_ALL_INDEX, ...ngDevMode ? [{ debugName: "selectAllActive" }] : /* istanbul ignore next */ []);
|
|
769
|
+
toggleSelectAll() {
|
|
770
|
+
if (this.isReadonly() || this.isDisabled() || !this.showSelectAll()) return;
|
|
771
|
+
const targets = this.selectAllTargets();
|
|
772
|
+
const current = this.asArray(this.value());
|
|
773
|
+
const selected = this.selectedSet();
|
|
774
|
+
const missing = targets.filter((value) => !selected.has(value));
|
|
775
|
+
const cap = this.maxItems();
|
|
776
|
+
const room = cap > 0 ? Math.max(0, cap - current.length) : missing.length;
|
|
777
|
+
let next;
|
|
778
|
+
if (missing.length > 0 && room > 0) next = [...current, ...missing.slice(0, room)];
|
|
779
|
+
else {
|
|
780
|
+
const offered = new Set(targets);
|
|
781
|
+
next = current.filter((value) => !offered.has(value));
|
|
782
|
+
if (next.length === current.length) return;
|
|
783
|
+
}
|
|
784
|
+
this.value.set(next);
|
|
785
|
+
this.touch.emit();
|
|
786
|
+
}
|
|
787
|
+
isOptionHidden(option) {
|
|
700
788
|
if (!this.isSearchable() || !this.clientFilter()) return false;
|
|
701
789
|
const q = this.searchQuery().trim().toLowerCase();
|
|
702
790
|
if (!q) return false;
|
|
703
|
-
return !
|
|
791
|
+
return !searchLabelOf(option).includes(q);
|
|
704
792
|
}
|
|
705
793
|
panelTpl = viewChild.required("panelTpl", {
|
|
706
794
|
...ngDevMode ? { debugName: "panelTpl" } : /* istanbul ignore next */ {},
|
|
@@ -758,8 +846,11 @@ var WrSelect = class WrSelect {
|
|
|
758
846
|
const value = event.target.value;
|
|
759
847
|
this.searchQuery.set(value);
|
|
760
848
|
if (this.meetsMinChars()) {
|
|
761
|
-
if (!this.isOpen())
|
|
762
|
-
|
|
849
|
+
if (!this.isOpen()) {
|
|
850
|
+
this.reseedOnAttach = "first";
|
|
851
|
+
this.openState.set(true);
|
|
852
|
+
}
|
|
853
|
+
} else if (this.isOpen()) this.openState.set(false);
|
|
763
854
|
this.activeIndex.set(this.firstEnabled());
|
|
764
855
|
if (this.virtualActive()) {
|
|
765
856
|
this.scrollTop.set(0);
|
|
@@ -775,7 +866,7 @@ var WrSelect = class WrSelect {
|
|
|
775
866
|
if (!this.meetsMinChars()) return;
|
|
776
867
|
if (!this.isOpen()) {
|
|
777
868
|
this.seedActiveIndex();
|
|
778
|
-
this.
|
|
869
|
+
this.openState.set(true);
|
|
779
870
|
}
|
|
780
871
|
}
|
|
781
872
|
onSearchBlur() {
|
|
@@ -785,18 +876,29 @@ var WrSelect = class WrSelect {
|
|
|
785
876
|
this.touch.emit();
|
|
786
877
|
}
|
|
787
878
|
pressInPanel = false;
|
|
879
|
+
pressEnd = null;
|
|
788
880
|
onPanelPointerDown(event) {
|
|
881
|
+
this.endPanelPress();
|
|
789
882
|
this.pressInPanel = true;
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
883
|
+
const pressEnd = this.pressEnd = new AbortController();
|
|
884
|
+
const target = event.view ?? window;
|
|
885
|
+
const options = {
|
|
886
|
+
capture: true,
|
|
887
|
+
signal: pressEnd.signal
|
|
888
|
+
};
|
|
889
|
+
target.addEventListener("pointerup", () => this.endPanelPress(), options);
|
|
890
|
+
target.addEventListener("pointercancel", () => this.endPanelPress(), options);
|
|
891
|
+
}
|
|
892
|
+
endPanelPress() {
|
|
893
|
+
this.pressInPanel = false;
|
|
894
|
+
this.pressEnd?.abort();
|
|
895
|
+
this.pressEnd = null;
|
|
794
896
|
}
|
|
795
897
|
commitQuery() {
|
|
796
898
|
const q = this.searchQuery().trim();
|
|
797
899
|
if (!q) return;
|
|
798
900
|
this.value.set(q);
|
|
799
|
-
this.
|
|
901
|
+
this.openState.set(false);
|
|
800
902
|
}
|
|
801
903
|
onSearchKey(event) {
|
|
802
904
|
if (this.imeOwnsKey(event)) return;
|
|
@@ -809,7 +911,7 @@ var WrSelect = class WrSelect {
|
|
|
809
911
|
const q = this.searchQuery().trim();
|
|
810
912
|
const idx = this.activeIndex();
|
|
811
913
|
const list = this.orderedRegistry();
|
|
812
|
-
if (!(this.virtualActive() ? idx >= 0 && idx < this.filteredDynamicOptions().length : idx >= 0 && idx < list.length && !list[idx].disabled && !this.isOptionHidden(list[idx]
|
|
914
|
+
if (!(this.virtualActive() ? idx >= 0 && idx < this.filteredDynamicOptions().length : idx >= 0 && idx < list.length && !list[idx].disabled && !this.isOptionHidden(list[idx])) && q) {
|
|
813
915
|
event.preventDefault();
|
|
814
916
|
this.commitQuery();
|
|
815
917
|
this.touch.emit();
|
|
@@ -850,9 +952,12 @@ var WrSelect = class WrSelect {
|
|
|
850
952
|
overlayRef = null;
|
|
851
953
|
constructor() {
|
|
852
954
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("select");
|
|
853
|
-
this.destroyRef.onDestroy(() =>
|
|
955
|
+
this.destroyRef.onDestroy(() => {
|
|
956
|
+
this.endPanelPress();
|
|
957
|
+
this.closeOverlay(false);
|
|
958
|
+
});
|
|
854
959
|
effect(() => {
|
|
855
|
-
if (this.isDisabled() || this.isReadonly()) this.
|
|
960
|
+
if (this.isDisabled() || this.isReadonly()) this.openState.set(false);
|
|
856
961
|
});
|
|
857
962
|
effect(() => {
|
|
858
963
|
if (this.isOpen()) this.openOverlay();
|
|
@@ -972,11 +1077,33 @@ var WrSelect = class WrSelect {
|
|
|
972
1077
|
this.value.set(value);
|
|
973
1078
|
this.touch.emit();
|
|
974
1079
|
this.searchQuery.set("");
|
|
975
|
-
this.
|
|
1080
|
+
this.openState.set(false);
|
|
976
1081
|
}
|
|
977
1082
|
registerOption(reg) {
|
|
978
|
-
this.
|
|
979
|
-
|
|
1083
|
+
this.registrations.set(reg.id, reg);
|
|
1084
|
+
if (!this.orderStale) {
|
|
1085
|
+
const last = this.ordered.at(-1);
|
|
1086
|
+
const order = last ? byDocumentPosition(last, reg) : -1;
|
|
1087
|
+
if (order < 0 || order === 0 && this.orderIsCreation) this.ordered.push(reg);
|
|
1088
|
+
else this.orderStale = true;
|
|
1089
|
+
}
|
|
1090
|
+
this.registryVersion.update((n) => n + 1);
|
|
1091
|
+
return () => {
|
|
1092
|
+
this.registrations.delete(reg.id);
|
|
1093
|
+
this.orderStale = true;
|
|
1094
|
+
this.registryVersion.update((n) => n + 1);
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
updateOption(reg) {
|
|
1098
|
+
const previous = this.registrations.get(reg.id);
|
|
1099
|
+
if (!previous) return;
|
|
1100
|
+
this.registrations.set(reg.id, reg);
|
|
1101
|
+
if (!this.orderStale) {
|
|
1102
|
+
const slot = this.ordered.indexOf(previous);
|
|
1103
|
+
if (slot < 0) this.orderStale = true;
|
|
1104
|
+
else this.ordered[slot] = reg;
|
|
1105
|
+
}
|
|
1106
|
+
this.registryVersion.update((n) => n + 1);
|
|
980
1107
|
}
|
|
981
1108
|
removeChip(index, event) {
|
|
982
1109
|
event.stopPropagation();
|
|
@@ -1055,15 +1182,15 @@ var WrSelect = class WrSelect {
|
|
|
1055
1182
|
open() {
|
|
1056
1183
|
if (this.isDisabled() || this.isReadonly() || this.isTag() || this.isOpen() || !this.meetsMinChars()) return;
|
|
1057
1184
|
this.seedActiveIndex();
|
|
1058
|
-
this.
|
|
1185
|
+
this.openState.set(true);
|
|
1059
1186
|
}
|
|
1060
1187
|
close() {
|
|
1061
|
-
this.
|
|
1188
|
+
this.openState.set(false);
|
|
1062
1189
|
}
|
|
1063
1190
|
onTriggerClick() {
|
|
1064
1191
|
if (this.isDisabled() || this.isReadonly()) return;
|
|
1065
1192
|
if (this.isTag()) return;
|
|
1066
|
-
this.
|
|
1193
|
+
this.openState.update((v) => !v);
|
|
1067
1194
|
}
|
|
1068
1195
|
onTriggerKey(event) {
|
|
1069
1196
|
if (this.isDisabled() || this.isReadonly()) return;
|
|
@@ -1071,7 +1198,7 @@ var WrSelect = class WrSelect {
|
|
|
1071
1198
|
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
1072
1199
|
event.preventDefault();
|
|
1073
1200
|
this.seedActiveIndex();
|
|
1074
|
-
this.
|
|
1201
|
+
this.openState.set(true);
|
|
1075
1202
|
return;
|
|
1076
1203
|
}
|
|
1077
1204
|
if (event.key === "Backspace" && this.isMulti() && this.hasSelection() && (!this.hasChipSearch() || this.searchQuery() === "")) {
|
|
@@ -1083,7 +1210,7 @@ var WrSelect = class WrSelect {
|
|
|
1083
1210
|
}
|
|
1084
1211
|
switch (event.key) {
|
|
1085
1212
|
case "Tab":
|
|
1086
|
-
this.
|
|
1213
|
+
this.openState.set(false);
|
|
1087
1214
|
break;
|
|
1088
1215
|
case "ArrowDown":
|
|
1089
1216
|
event.preventDefault();
|
|
@@ -1095,7 +1222,7 @@ var WrSelect = class WrSelect {
|
|
|
1095
1222
|
break;
|
|
1096
1223
|
case "Home":
|
|
1097
1224
|
event.preventDefault();
|
|
1098
|
-
this.activeIndex.set(this.firstEnabled());
|
|
1225
|
+
this.activeIndex.set(this.showSelectAll() ? SELECT_ALL_INDEX : this.firstEnabled());
|
|
1099
1226
|
this.ensureVisible(this.activeIndex());
|
|
1100
1227
|
break;
|
|
1101
1228
|
case "End":
|
|
@@ -1106,6 +1233,10 @@ var WrSelect = class WrSelect {
|
|
|
1106
1233
|
case "Enter":
|
|
1107
1234
|
case " ": {
|
|
1108
1235
|
event.preventDefault();
|
|
1236
|
+
if (this.selectAllActive()) {
|
|
1237
|
+
this.toggleSelectAll();
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1109
1240
|
const idx = this.activeIndex();
|
|
1110
1241
|
if (this.virtualActive()) {
|
|
1111
1242
|
const list = this.filteredDynamicOptions();
|
|
@@ -1113,7 +1244,7 @@ var WrSelect = class WrSelect {
|
|
|
1113
1244
|
break;
|
|
1114
1245
|
}
|
|
1115
1246
|
const list = this.orderedRegistry();
|
|
1116
|
-
if (idx >= 0 && idx < list.length && !list[idx].disabled && !this.isOptionHidden(list[idx]
|
|
1247
|
+
if (idx >= 0 && idx < list.length && !list[idx].disabled && !this.isOptionHidden(list[idx])) {
|
|
1117
1248
|
const id = list[idx].id;
|
|
1118
1249
|
(this.overlayRef?.overlayElement.querySelector(`#${CSS.escape(id)}`))?.click();
|
|
1119
1250
|
}
|
|
@@ -1121,9 +1252,9 @@ var WrSelect = class WrSelect {
|
|
|
1121
1252
|
}
|
|
1122
1253
|
}
|
|
1123
1254
|
}
|
|
1124
|
-
reseedOnAttach =
|
|
1255
|
+
reseedOnAttach = null;
|
|
1125
1256
|
seedActiveIndex() {
|
|
1126
|
-
this.reseedOnAttach =
|
|
1257
|
+
this.reseedOnAttach = "selected";
|
|
1127
1258
|
if (this.virtualActive()) {
|
|
1128
1259
|
const idx = this.filteredDynamicOptions().findIndex((it) => this.isSelected(it));
|
|
1129
1260
|
this.activeIndex.set(idx >= 0 ? idx : this.firstEnabled());
|
|
@@ -1139,6 +1270,21 @@ var WrSelect = class WrSelect {
|
|
|
1139
1270
|
this.activeIndex.set(selectedIdx >= 0 ? selectedIdx : this.firstEnabled());
|
|
1140
1271
|
}
|
|
1141
1272
|
moveActive(delta) {
|
|
1273
|
+
if (this.showSelectAll()) {
|
|
1274
|
+
const current = this.activeIndex();
|
|
1275
|
+
if (current === SELECT_ALL_INDEX) {
|
|
1276
|
+
const landing = delta > 0 ? this.firstEnabled() : this.lastEnabled();
|
|
1277
|
+
if (landing >= 0) {
|
|
1278
|
+
this.activeIndex.set(landing);
|
|
1279
|
+
this.ensureVisible(landing);
|
|
1280
|
+
}
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
if (current === (delta > 0 ? this.lastEnabled() : this.firstEnabled()) || current < 0 && delta > 0) {
|
|
1284
|
+
this.activeIndex.set(SELECT_ALL_INDEX);
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1142
1288
|
if (this.virtualActive()) {
|
|
1143
1289
|
const len = this.filteredDynamicOptions().length;
|
|
1144
1290
|
if (len === 0) return;
|
|
@@ -1154,7 +1300,7 @@ var WrSelect = class WrSelect {
|
|
|
1154
1300
|
while (attempts-- > 0) {
|
|
1155
1301
|
i = (i + delta + list.length) % list.length;
|
|
1156
1302
|
const o = list[i];
|
|
1157
|
-
if (!o.disabled && !this.isOptionHidden(o
|
|
1303
|
+
if (!o.disabled && !this.isOptionHidden(o)) {
|
|
1158
1304
|
this.activeIndex.set(i);
|
|
1159
1305
|
this.ensureVisible(i);
|
|
1160
1306
|
return;
|
|
@@ -1163,14 +1309,14 @@ var WrSelect = class WrSelect {
|
|
|
1163
1309
|
}
|
|
1164
1310
|
firstEnabled() {
|
|
1165
1311
|
if (this.virtualActive()) return this.filteredDynamicOptions().length > 0 ? 0 : -1;
|
|
1166
|
-
return this.orderedRegistry().findIndex((o) => !o.disabled && !this.isOptionHidden(o
|
|
1312
|
+
return this.orderedRegistry().findIndex((o) => !o.disabled && !this.isOptionHidden(o));
|
|
1167
1313
|
}
|
|
1168
1314
|
lastEnabled() {
|
|
1169
1315
|
if (this.virtualActive()) return this.filteredDynamicOptions().length - 1;
|
|
1170
1316
|
const list = this.orderedRegistry();
|
|
1171
1317
|
let found = -1;
|
|
1172
1318
|
list.forEach((o, i) => {
|
|
1173
|
-
if (!o.disabled && !this.isOptionHidden(o
|
|
1319
|
+
if (!o.disabled && !this.isOptionHidden(o)) found = i;
|
|
1174
1320
|
});
|
|
1175
1321
|
return found;
|
|
1176
1322
|
}
|
|
@@ -1190,22 +1336,26 @@ var WrSelect = class WrSelect {
|
|
|
1190
1336
|
});
|
|
1191
1337
|
wrFollowDirection(this.overlayRef, this.dir, this.injector);
|
|
1192
1338
|
const portal = new TemplatePortal(this.panelTpl(), this.vcr);
|
|
1193
|
-
const registered = this.registry().length;
|
|
1194
1339
|
this.overlayRef.attach(portal);
|
|
1195
|
-
|
|
1196
|
-
this.
|
|
1340
|
+
this.orderStale = true;
|
|
1341
|
+
this.panelAttached.update((n) => n + 1);
|
|
1342
|
+
if (!this.virtualActive()) {
|
|
1343
|
+
if (this.reseedOnAttach === "selected") this.seedActiveIndex();
|
|
1344
|
+
else if (this.reseedOnAttach === "first") this.activeIndex.set(this.firstEnabled());
|
|
1345
|
+
}
|
|
1346
|
+
this.reseedOnAttach = null;
|
|
1197
1347
|
if (!this.virtualActive()) {
|
|
1198
1348
|
this.ensureVisible(this.activeIndex());
|
|
1199
1349
|
afterNextRender(() => this.ensureVisible(this.activeIndex()), { injector: this.injector });
|
|
1200
1350
|
}
|
|
1201
1351
|
this.outsideClick.outsidePointerEvents(this.overlayRef).pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
|
|
1202
1352
|
if (this.host.nativeElement.contains(event.target)) return;
|
|
1203
|
-
this.
|
|
1353
|
+
this.openState.set(false);
|
|
1204
1354
|
});
|
|
1205
1355
|
this.overlayRef.keydownEvents().pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
|
|
1206
1356
|
if (event.key === "Escape") {
|
|
1207
1357
|
event.preventDefault();
|
|
1208
|
-
this.
|
|
1358
|
+
this.openState.set(false);
|
|
1209
1359
|
}
|
|
1210
1360
|
});
|
|
1211
1361
|
this.opened.emit();
|
|
@@ -1233,7 +1383,7 @@ var WrSelect = class WrSelect {
|
|
|
1233
1383
|
}
|
|
1234
1384
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1235
1385
|
minVersion: "12.0.0",
|
|
1236
|
-
version: "22.2.
|
|
1386
|
+
version: "22.2.6",
|
|
1237
1387
|
ngImport: i0,
|
|
1238
1388
|
type: WrSelect,
|
|
1239
1389
|
deps: [],
|
|
@@ -1241,7 +1391,7 @@ var WrSelect = class WrSelect {
|
|
|
1241
1391
|
});
|
|
1242
1392
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1243
1393
|
minVersion: "17.0.0",
|
|
1244
|
-
version: "22.2.
|
|
1394
|
+
version: "22.2.6",
|
|
1245
1395
|
type: WrSelect,
|
|
1246
1396
|
isStandalone: true,
|
|
1247
1397
|
selector: "wr-select",
|
|
@@ -1484,6 +1634,20 @@ var WrSelect = class WrSelect {
|
|
|
1484
1634
|
isRequired: false,
|
|
1485
1635
|
transformFunction: null
|
|
1486
1636
|
},
|
|
1637
|
+
selectAll: {
|
|
1638
|
+
classPropertyName: "selectAll",
|
|
1639
|
+
publicName: "selectAll",
|
|
1640
|
+
isSignal: true,
|
|
1641
|
+
isRequired: false,
|
|
1642
|
+
transformFunction: null
|
|
1643
|
+
},
|
|
1644
|
+
selectAllLabel: {
|
|
1645
|
+
classPropertyName: "selectAllLabel",
|
|
1646
|
+
publicName: "selectAllLabel",
|
|
1647
|
+
isSignal: true,
|
|
1648
|
+
isRequired: false,
|
|
1649
|
+
transformFunction: null
|
|
1650
|
+
},
|
|
1487
1651
|
maxTagCount: {
|
|
1488
1652
|
classPropertyName: "maxTagCount",
|
|
1489
1653
|
publicName: "maxTagCount",
|
|
@@ -1567,7 +1731,7 @@ var WrSelect = class WrSelect {
|
|
|
1567
1731
|
}
|
|
1568
1732
|
],
|
|
1569
1733
|
ngImport: i0,
|
|
1570
|
-
template: "@if (isSearchTrigger()) {\n <!-- Search mode (or a searchable single): a real text input drives a filtered\n overlay panel. The wrapper isn't itself focusable — the input is the\n tabstop. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"wr-select__trigger wr-select__trigger--search\" (click)=\"focusSearchInput()\">\n <!-- The selected option's leading visual, before the field — the same class\n and the same `placement: 'value'` the button trigger uses, because it is\n the same surface and a consumer who styled one should not have to learn\n a second name. `searchLeading()` draws it only while the field is\n showing the VALUE, so it never stands in front of a query or a bare\n placeholder, and it sits OUTSIDE the input for the obvious reason: an\n `<input>` holds a string. `aria-hidden` keeps it out of the combobox's\n name, which is `resolvedAriaLabel()`, and out of its value, which is the\n input's own text. -->\n @if (searchLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <!-- `id` / `aria-describedby` / `aria-invalid` come from a surrounding\n `<wr-form-field>` and are null without one — see `controlId` in the\n component. They go on the tab stop, the only labelable element here.\n `aria-label` is the trigger's name and belongs on the same element for\n the same reason: this input carries `role=\"combobox\"`, and the four\n other trigger shapes all bind `resolvedAriaLabel()`. Without it a\n search select with no placeholder rendered a combobox with no name at\n all — the one shape where the documented `ariaLabel` input reached\n nothing. -->\n <!-- `aria-autocomplete` is static, and `list` rather than `both`: the panel\n is the only place a suggestion appears, nothing is written back into\n the field for the user. It describes a permanent CAPABILITY, which is\n why it does not track `isOpen()` — the same reasoning `wr-mention`\n records at its own host binding. -->\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"wr-select__search-input\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [readonly]=\"isReadonly()\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"searchDisplay()\"\n (input)=\"onSearchInput($event)\"\n (focus)=\"onSearchFocus()\"\n (keydown)=\"onSearchKey($event)\"\n (blur)=\"onSearchBlur()\"\n />\n <!-- Pointer-only, and the `keydown.enter` / `keydown.space` pair this used to\n carry was dead code rather than the keyboard path it looked like: the ×\n is `tabindex=\"-1\"` with no roving owner, so no key event ever originates\n here to bubble into a handler. It stays unfocusable because the same\n span sits inside the BUTTON trigger further down, where a focusable\n child is `nested-interactive` — the defect the window taskbar's close\n button already taught this repo. The keyboard reaches the function\n instead: Backspace on the empty field, which `onSearchKey` routes to\n `clearAll` for a single and to the last chip for a multi. -->\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </div>\n} @else if (isTag() || hasChipSearch()) {\n <!-- Chip trigger — tag mode, or a searchable multi. A focusable input lives\n inside, so the wrapper itself only exists to host chips and forward\n whitespace clicks to the input. Tag mode needs no role (users tab\n straight into the input); the searchable multi is a real combobox, so it\n carries the listbox wiring. The click handler is a mouse-only\n convenience. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"wr-select__trigger wr-select__trigger--tag\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"focusTagInput()\"\n >\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n <!-- At `maxItems` this input goes READONLY, never disabled: it is the only\n tab stop in the whole control (the chip × and the clear button are\n `tabindex=\"-1\"` spans), so disabling it left a full tag select with\n nothing focusable at all — and Backspace on an empty draft, the one\n keyboard way back UNDER the cap, is bound to this very element. It was\n never needed as enforcement either: `tryAddTag` already refuses past\n capacity. -->\n <!-- `aria-autocomplete` is conditional here, unlike the search input's:\n this field is only a combobox when a panel backs it. In plain tag\n mode there is no popup to suggest from, and claiming otherwise\n describes a control that does not exist. -->\n <input\n #tagInput\n type=\"text\"\n class=\"wr-select__tag-input\"\n autocomplete=\"off\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n spellcheck=\"false\"\n [value]=\"hasChipSearch() ? searchQuery() : draft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"isReadonly() || (isTag() && atCapacity())\"\n [attr.aria-readonly]=\"hasChipSearch() && isReadonly() ? true : null\"\n [placeholder]=\"hasSelection() ? '' : resolvedPlaceholder()\"\n [attr.role]=\"hasChipSearch() ? 'combobox' : null\"\n [attr.aria-haspopup]=\"hasChipSearch() ? 'listbox' : null\"\n [attr.aria-autocomplete]=\"hasChipSearch() ? 'list' : null\"\n [attr.aria-expanded]=\"hasChipSearch() ? isOpen() : null\"\n [attr.aria-controls]=\"hasChipSearch() ? listboxId : null\"\n [attr.aria-activedescendant]=\"hasChipSearch() && isOpen() ? activeOptionId() || null : null\"\n (input)=\"onChipsInput($event)\"\n (keydown)=\"onChipsKeydown($event)\"\n (paste)=\"onChipsPaste($event)\"\n (focus)=\"onChipsFocus()\"\n (blur)=\"onChipsBlur()\"\n />\n </span>\n\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <!-- Only for the searchable MULTI, never for tag mode. The two share this\n trigger and differ in the one thing a chevron stands for: the searchable\n multi's input is a `role=\"combobox\"` with `aria-haspopup=\"listbox\"` and\n a panel of options behind it, while tag mode takes free text and has no\n popup at all. Folding the second into this branch left it as the only\n combobox shape in the component with no affordance saying it opens —\n `mode=\"search\"` has one, a searchable single has one, the button trigger\n has one, and this one rendered a bare field. -->\n @if (hasChipSearch()) {\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n }\n </div>\n} @else {\n <button\n #trigger\n type=\"button\"\n class=\"wr-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKey($event)\"\n (blur)=\"touch.emit()\"\n >\n @if (isMulti()) {\n @if (hasSelection()) {\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n <!-- A selected chip draws its option's leading visual — one copy per\n VISIBLE chip, so `maxTagCount` caps these too. -->\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n </span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n } @else {\n @if (selectedLabel(); as label) {\n <!-- Beside the label, not inside it: the harness and the accessible name\n both read `.wr-select__value`, and the visual says nothing either should. -->\n @if (selectedLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <span class=\"wr-select__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n }\n\n @if (isMulti() && clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n}\n\n<ng-template #panelTpl>\n <div\n class=\"wr-select-panel\"\n (pointerdown)=\"onPanelPointerDown($event)\"\n [class.wr-select-panel--sm]=\"size() === 'sm'\"\n [class.wr-select-panel--lg]=\"size() === 'lg'\"\n [class.wr-select-panel--virtual]=\"virtualActive()\"\n role=\"listbox\"\n [attr.id]=\"listboxId\"\n [attr.aria-multiselectable]=\"isMulti() ? 'true' : null\"\n [attr.aria-busy]=\"isLoading() ? 'true' : null\"\n >\n <!-- `aria-busy` belongs on the listbox, not on this row: it is the container\n whose required `option` children are temporarily missing, and a global\n ARIA attribute on a role-less child makes that child an owned element the\n listbox may not own (axe `aria-required-children`, critical). Plain text\n inside the listbox is fine — only ELEMENTS are checked. -->\n <!-- While the error row is up, through a retry, it carries the loader. -->\n @if (isLoading() && !showLoadError()) {\n <div class=\"wr-select-panel__loading\">{{ resolvedLoading() }}</div>\n }\n\n @if (virtualActive()) {\n <!-- Windowed data-array rows: plain role=\"option\" elements (not <wr-option>),\n navigated via the trigger's aria-activedescendant, selected by value. -->\n <div class=\"wr-select-panel__vlist\" [style.max-height]=\"resolvedViewportHeight()\">\n @if (virtualWindow().padTop > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padTop\"></div>\n }\n @for (entry of windowOptions(); track entry.index) {\n <!-- Keyboard handled by the trigger via aria-activedescendant; the\n row is a pointer target only. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n role=\"option\"\n class=\"wr-option\"\n [id]=\"virtualRowId(entry.index)\"\n [class.wr-option--active]=\"entry.index === activeIndex()\"\n [class.wr-option--selected]=\"isSelected(entry.item)\"\n [class.wr-option--disabled]=\"atMaxItems() && !isSelected(entry.item)\"\n [attr.aria-selected]=\"isSelected(entry.item)\"\n [attr.aria-disabled]=\"atMaxItems() && !isSelected(entry.item) ? true : null\"\n [attr.aria-setsize]=\"filteredDynamicOptions().length\"\n [attr.aria-posinset]=\"entry.index + 1\"\n (click)=\"selectOption(entry.item)\"\n >\n <!-- Only the select-wide template reaches a virtual row — there is no\n `<wr-option>` here to declare one — and only rows inside the\n rendered window instantiate it. -->\n @if (optionLeading(); as leading) {\n <span class=\"wr-option__leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item, placement: 'option' }\"\n />\n </span>\n }\n {{ displayWith()(entry.item) }}\n </div>\n }\n @if (virtualWindow().padBottom > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padBottom\"></div>\n }\n </div>\n } @else {\n <!-- Dynamic options from [options], or from the async [loader] in search\n mode. Rendered as wr-option so the standard registration / filter\n pipeline applies uniformly. -->\n @for (item of dynamicOptions(); track $index) {\n <wr-option [value]=\"item\">{{ displayWith()(item) }}</wr-option>\n }\n }\n\n <!-- Projected static options — always present (a conditional `<ng-content>`\n would drop projected content). Empty whenever `virtualActive`. -->\n <ng-content />\n\n <!-- A listbox may only own `option` and `group` children, and as a bare `<div>`\n this row was the only thing in the tree when it showed — an\n `aria-required-children` critical. It cannot move out of the listbox the\n way the command palette's does: this element IS the listbox, and the id\n the trigger's `aria-controls` names is what gives it its accessible name.\n So it announces as a disabled option instead. Keyboard navigation skips\n it for free — arrow keys walk the registered `wr-option`s, and nothing\n registers this row. -->\n @if (hasNoResults()) {\n <div class=\"wr-select-panel__empty\" role=\"option\" aria-selected=\"false\" aria-disabled=\"true\">\n {{ resolvedNoResults() }}\n </div>\n }\n\n <!-- A failed load, in place of \"no results\". An option for the same reason as\n that row. While it offers a retry it is the option that runs the loader\n again: the field's aria-activedescendant names it, Enter there reaches it,\n and mousedown keeps focus in the field. The retry is DRAWN as a button but\n cannot be one, since a button inside an option is nested interactive\n content; it wears `.wr-btn` and takes the click. -->\n @if (showLoadError()) {\n <div\n class=\"wr-select-panel__error\"\n [class.wr-select-panel__error--retryable]=\"retryOffered()\"\n [class.wr-select-panel__error--active]=\"retryOffered() && !freeText()\"\n role=\"option\"\n aria-selected=\"false\"\n [attr.id]=\"retryOffered() ? retryRowId : null\"\n [attr.aria-disabled]=\"retryOffered() ? null : true\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (loadErrorTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"loadErrorContext()\" />\n } @else {\n {{ resolvedLoadError() }}\n @if (retryOffered()) {\n <!-- The spinner as `wr-btn` draws it while loading: hidden from the\n accessibility tree, since the row already reads the retry label. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <span\n class=\"wr-btn wr-btn--sm wr-select-panel__retry\"\n [class.wr-btn--loading]=\"retrying()\"\n (click)=\"onLoadErrorClick()\"\n >\n @if (retrying()) {\n <wr-spinner class=\"wr-btn__spin\" size=\"sm\" aria-hidden=\"true\" />\n }\n <span class=\"wr-btn__label\">{{ resolvedRetry() }}</span>\n </span>\n }\n }\n </div>\n }\n </div>\n</ng-template>\n",
|
|
1734
|
+
template: "@if (isSearchTrigger()) {\n <!-- Search mode (or a searchable single): a real text input drives a filtered\n overlay panel. The wrapper isn't itself focusable — the input is the\n tabstop. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"wr-select__trigger wr-select__trigger--search\" (click)=\"focusSearchInput()\">\n <!-- The selected option's leading visual, before the field — the same class\n and the same `placement: 'value'` the button trigger uses, because it is\n the same surface and a consumer who styled one should not have to learn\n a second name. `searchLeading()` draws it only while the field is\n showing the VALUE, so it never stands in front of a query or a bare\n placeholder, and it sits OUTSIDE the input for the obvious reason: an\n `<input>` holds a string. `aria-hidden` keeps it out of the combobox's\n name, which is `resolvedAriaLabel()`, and out of its value, which is the\n input's own text. -->\n @if (searchLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <!-- `id` / `aria-describedby` / `aria-invalid` come from a surrounding\n `<wr-form-field>` and are null without one — see `controlId` in the\n component. They go on the tab stop, the only labelable element here.\n `aria-label` is the trigger's name and belongs on the same element for\n the same reason: this input carries `role=\"combobox\"`, and the four\n other trigger shapes all bind `resolvedAriaLabel()`. Without it a\n search select with no placeholder rendered a combobox with no name at\n all — the one shape where the documented `ariaLabel` input reached\n nothing. -->\n <!-- `aria-autocomplete` is static, and `list` rather than `both`: the panel\n is the only place a suggestion appears, nothing is written back into\n the field for the user. It describes a permanent CAPABILITY, which is\n why it does not track `isOpen()` — the same reasoning `wr-mention`\n records at its own host binding. -->\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"wr-select__search-input\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [readonly]=\"isReadonly()\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"searchDisplay()\"\n (input)=\"onSearchInput($event)\"\n (focus)=\"onSearchFocus()\"\n (keydown)=\"onSearchKey($event)\"\n (blur)=\"onSearchBlur()\"\n />\n <!-- Pointer-only, and the `keydown.enter` / `keydown.space` pair this used to\n carry was dead code rather than the keyboard path it looked like: the ×\n is `tabindex=\"-1\"` with no roving owner, so no key event ever originates\n here to bubble into a handler. It stays unfocusable because the same\n span sits inside the BUTTON trigger further down, where a focusable\n child is `nested-interactive` — the defect the window taskbar's close\n button already taught this repo. The keyboard reaches the function\n instead: Backspace on the empty field, which `onSearchKey` routes to\n `clearAll` for a single and to the last chip for a multi. -->\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </div>\n} @else if (isTag() || hasChipSearch()) {\n <!-- Chip trigger — tag mode, or a searchable multi. A focusable input lives\n inside, so the wrapper itself only exists to host chips and forward\n whitespace clicks to the input. Tag mode needs no role (users tab\n straight into the input); the searchable multi is a real combobox, so it\n carries the listbox wiring. The click handler is a mouse-only\n convenience. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"wr-select__trigger wr-select__trigger--tag\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"focusTagInput()\"\n >\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n <!-- At `maxItems` this input goes READONLY, never disabled: it is the only\n tab stop in the whole control (the chip × and the clear button are\n `tabindex=\"-1\"` spans), so disabling it left a full tag select with\n nothing focusable at all — and Backspace on an empty draft, the one\n keyboard way back UNDER the cap, is bound to this very element. It was\n never needed as enforcement either: `tryAddTag` already refuses past\n capacity. -->\n <!-- `aria-autocomplete` is conditional here, unlike the search input's:\n this field is only a combobox when a panel backs it. In plain tag\n mode there is no popup to suggest from, and claiming otherwise\n describes a control that does not exist. -->\n <input\n #tagInput\n type=\"text\"\n class=\"wr-select__tag-input\"\n autocomplete=\"off\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n spellcheck=\"false\"\n [value]=\"hasChipSearch() ? searchQuery() : draft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"isReadonly() || (isTag() && atCapacity())\"\n [attr.aria-readonly]=\"hasChipSearch() && isReadonly() ? true : null\"\n [placeholder]=\"hasSelection() ? '' : resolvedPlaceholder()\"\n [attr.role]=\"hasChipSearch() ? 'combobox' : null\"\n [attr.aria-haspopup]=\"hasChipSearch() ? 'listbox' : null\"\n [attr.aria-autocomplete]=\"hasChipSearch() ? 'list' : null\"\n [attr.aria-expanded]=\"hasChipSearch() ? isOpen() : null\"\n [attr.aria-controls]=\"hasChipSearch() ? listboxId : null\"\n [attr.aria-activedescendant]=\"hasChipSearch() && isOpen() ? activeOptionId() || null : null\"\n (input)=\"onChipsInput($event)\"\n (keydown)=\"onChipsKeydown($event)\"\n (paste)=\"onChipsPaste($event)\"\n (focus)=\"onChipsFocus()\"\n (blur)=\"onChipsBlur()\"\n />\n </span>\n\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <!-- Only for the searchable MULTI, never for tag mode. The two share this\n trigger and differ in the one thing a chevron stands for: the searchable\n multi's input is a `role=\"combobox\"` with `aria-haspopup=\"listbox\"` and\n a panel of options behind it, while tag mode takes free text and has no\n popup at all. Folding the second into this branch left it as the only\n combobox shape in the component with no affordance saying it opens —\n `mode=\"search\"` has one, a searchable single has one, the button trigger\n has one, and this one rendered a bare field. -->\n @if (hasChipSearch()) {\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n }\n </div>\n} @else {\n <button\n #trigger\n type=\"button\"\n class=\"wr-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKey($event)\"\n (blur)=\"touch.emit()\"\n >\n @if (isMulti()) {\n @if (hasSelection()) {\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n <!-- A selected chip draws its option's leading visual — one copy per\n VISIBLE chip, so `maxTagCount` caps these too. -->\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n </span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n } @else {\n @if (selectedLabel(); as label) {\n <!-- Beside the label, not inside it: the harness and the accessible name\n both read `.wr-select__value`, and the visual says nothing either should. -->\n @if (selectedLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <span class=\"wr-select__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n }\n\n @if (isMulti() && clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n}\n\n<ng-template #panelTpl>\n <div\n class=\"wr-select-panel\"\n (pointerdown)=\"onPanelPointerDown($event)\"\n [class.wr-select-panel--sm]=\"size() === 'sm'\"\n [class.wr-select-panel--lg]=\"size() === 'lg'\"\n [class.wr-select-panel--virtual]=\"virtualActive()\"\n role=\"listbox\"\n [attr.id]=\"listboxId\"\n [attr.aria-multiselectable]=\"isMulti() ? 'true' : null\"\n [attr.aria-busy]=\"isLoading() ? 'true' : null\"\n >\n <!-- `aria-busy` belongs on the listbox, not on this row: it is the container\n whose required `option` children are temporarily missing, and a global\n ARIA attribute on a role-less child makes that child an owned element the\n listbox may not own (axe `aria-required-children`, critical). Plain text\n inside the listbox is fine — only ELEMENTS are checked. -->\n <!-- While the error row is up, through a retry, it carries the loader. -->\n @if (isLoading() && !showLoadError()) {\n <div class=\"wr-select-panel__loading\">{{ resolvedLoading() }}</div>\n }\n\n <!-- Multi mode under `selectAll`. An option, since a listbox owns only options\n and groups, and deliberately NOT a `.wr-option`: it carries no value, so a\n query for the options must not count it. Its state is `aria-checked`,\n which has the `mixed` that `aria-selected` lacks. Reached through the\n trigger's aria-activedescendant like every row, so it is a pointer\n target only. First in the panel and pinned there; the virtual list\n scrolls in its own box below it. No `aria-selected`, which the lint\n rule below asks of every option: ARIA 1.2 no longer requires it, and it\n asks authors not to put it beside `aria-checked` on one option. -->\n @if (showSelectAll()) {\n <!-- eslint-disable @angular-eslint/template/role-has-required-aria -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"wr-select-panel__select-all\"\n role=\"option\"\n [id]=\"selectAllId\"\n [class.wr-select-panel__select-all--active]=\"selectAllActive()\"\n [class.wr-select-panel__select-all--checked]=\"selectAllState() === 'all'\"\n [class.wr-select-panel__select-all--mixed]=\"selectAllState() === 'some'\"\n [class.wr-select-panel__select-all--disabled]=\"selectAllUnavailable()\"\n [attr.aria-checked]=\"selectAllChecked()\"\n [attr.aria-disabled]=\"selectAllUnavailable() ? true : null\"\n (click)=\"toggleSelectAll()\"\n >\n <span class=\"wr-select-panel__select-all-box\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n @switch (selectAllState()) {\n @case ('all') {\n <path d=\"m4 8.5 3 3 5-6\" stroke-linejoin=\"round\" />\n }\n @case ('some') {\n <path d=\"M4 8h8\" />\n }\n }\n </svg>\n </span>\n {{ resolvedSelectAll() }}\n </div>\n <!-- eslint-enable @angular-eslint/template/role-has-required-aria -->\n }\n\n @if (virtualActive()) {\n <!-- Windowed data-array rows: plain role=\"option\" elements (not <wr-option>),\n navigated via the trigger's aria-activedescendant, selected by value. -->\n <div class=\"wr-select-panel__vlist\" [style.max-height]=\"resolvedViewportHeight()\">\n @if (virtualWindow().padTop > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padTop\"></div>\n }\n @for (entry of windowOptions(); track entry.index) {\n <!-- Keyboard handled by the trigger via aria-activedescendant; the\n row is a pointer target only. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n role=\"option\"\n class=\"wr-option\"\n [id]=\"virtualRowId(entry.index)\"\n [class.wr-option--active]=\"entry.index === activeIndex()\"\n [class.wr-option--selected]=\"isSelected(entry.item)\"\n [class.wr-option--disabled]=\"atMaxItems() && !isSelected(entry.item)\"\n [attr.aria-selected]=\"isSelected(entry.item)\"\n [attr.aria-disabled]=\"atMaxItems() && !isSelected(entry.item) ? true : null\"\n [attr.aria-setsize]=\"filteredDynamicOptions().length\"\n [attr.aria-posinset]=\"entry.index + 1\"\n (click)=\"selectOption(entry.item)\"\n >\n <!-- Only the select-wide template reaches a virtual row — there is no\n `<wr-option>` here to declare one — and only rows inside the\n rendered window instantiate it. -->\n @if (optionLeading(); as leading) {\n <span class=\"wr-option__leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item, placement: 'option' }\"\n />\n </span>\n }\n {{ displayWith()(entry.item) }}\n </div>\n }\n @if (virtualWindow().padBottom > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padBottom\"></div>\n }\n </div>\n } @else {\n <!-- Dynamic options from [options], or from the async [loader] in search\n mode. Rendered as wr-option so the standard registration / filter\n pipeline applies uniformly. -->\n @for (item of dynamicOptions(); track $index) {\n <wr-option [value]=\"item\">{{ displayWith()(item) }}</wr-option>\n }\n }\n\n <!-- Projected static options — always present (a conditional `<ng-content>`\n would drop projected content). Empty whenever `virtualActive`. -->\n <ng-content />\n\n <!-- A listbox may only own `option` and `group` children, and as a bare `<div>`\n this row was the only thing in the tree when it showed — an\n `aria-required-children` critical. It cannot move out of the listbox the\n way the command palette's does: this element IS the listbox, and the id\n the trigger's `aria-controls` names is what gives it its accessible name.\n So it announces as a disabled option instead. Keyboard navigation skips\n it for free — arrow keys walk the registered `wr-option`s, and nothing\n registers this row. -->\n @if (hasNoResults()) {\n <div class=\"wr-select-panel__empty\" role=\"option\" aria-selected=\"false\" aria-disabled=\"true\">\n {{ resolvedNoResults() }}\n </div>\n }\n\n <!-- A failed load, in place of \"no results\". An option for the same reason as\n that row. While it offers a retry it is the option that runs the loader\n again: the field's aria-activedescendant names it, Enter there reaches it,\n and mousedown keeps focus in the field. The retry is DRAWN as a button but\n cannot be one, since a button inside an option is nested interactive\n content; it wears `.wr-btn` and takes the click. -->\n @if (showLoadError()) {\n <div\n class=\"wr-select-panel__error\"\n [class.wr-select-panel__error--retryable]=\"retryOffered()\"\n [class.wr-select-panel__error--active]=\"retryOffered() && !freeText()\"\n role=\"option\"\n aria-selected=\"false\"\n [attr.id]=\"retryOffered() ? retryRowId : null\"\n [attr.aria-disabled]=\"retryOffered() ? null : true\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (loadErrorTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"loadErrorContext()\" />\n } @else {\n {{ resolvedLoadError() }}\n @if (retryOffered()) {\n <!-- The spinner as `wr-btn` draws it while loading: hidden from the\n accessibility tree, since the row already reads the retry label. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <span\n class=\"wr-btn wr-btn--sm wr-select-panel__retry\"\n [class.wr-btn--loading]=\"retrying()\"\n (click)=\"onLoadErrorClick()\"\n >\n @if (retrying()) {\n <wr-spinner class=\"wr-btn__spin\" size=\"sm\" aria-hidden=\"true\" />\n }\n <span class=\"wr-btn__label\">{{ resolvedRetry() }}</span>\n </span>\n }\n }\n </div>\n }\n </div>\n</ng-template>\n",
|
|
1571
1735
|
dependencies: [
|
|
1572
1736
|
{
|
|
1573
1737
|
kind: "component",
|
|
@@ -1601,7 +1765,7 @@ var WrSelect = class WrSelect {
|
|
|
1601
1765
|
};
|
|
1602
1766
|
i0.ɵɵngDeclareClassMetadata({
|
|
1603
1767
|
minVersion: "12.0.0",
|
|
1604
|
-
version: "22.2.
|
|
1768
|
+
version: "22.2.6",
|
|
1605
1769
|
ngImport: i0,
|
|
1606
1770
|
type: WrSelect,
|
|
1607
1771
|
decorators: [{
|
|
@@ -1622,7 +1786,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1622
1786
|
provide: WR_SELECT,
|
|
1623
1787
|
useExisting: forwardRef(() => WrSelect)
|
|
1624
1788
|
}],
|
|
1625
|
-
template: "@if (isSearchTrigger()) {\n <!-- Search mode (or a searchable single): a real text input drives a filtered\n overlay panel. The wrapper isn't itself focusable — the input is the\n tabstop. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"wr-select__trigger wr-select__trigger--search\" (click)=\"focusSearchInput()\">\n <!-- The selected option's leading visual, before the field — the same class\n and the same `placement: 'value'` the button trigger uses, because it is\n the same surface and a consumer who styled one should not have to learn\n a second name. `searchLeading()` draws it only while the field is\n showing the VALUE, so it never stands in front of a query or a bare\n placeholder, and it sits OUTSIDE the input for the obvious reason: an\n `<input>` holds a string. `aria-hidden` keeps it out of the combobox's\n name, which is `resolvedAriaLabel()`, and out of its value, which is the\n input's own text. -->\n @if (searchLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <!-- `id` / `aria-describedby` / `aria-invalid` come from a surrounding\n `<wr-form-field>` and are null without one — see `controlId` in the\n component. They go on the tab stop, the only labelable element here.\n `aria-label` is the trigger's name and belongs on the same element for\n the same reason: this input carries `role=\"combobox\"`, and the four\n other trigger shapes all bind `resolvedAriaLabel()`. Without it a\n search select with no placeholder rendered a combobox with no name at\n all — the one shape where the documented `ariaLabel` input reached\n nothing. -->\n <!-- `aria-autocomplete` is static, and `list` rather than `both`: the panel\n is the only place a suggestion appears, nothing is written back into\n the field for the user. It describes a permanent CAPABILITY, which is\n why it does not track `isOpen()` — the same reasoning `wr-mention`\n records at its own host binding. -->\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"wr-select__search-input\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [readonly]=\"isReadonly()\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"searchDisplay()\"\n (input)=\"onSearchInput($event)\"\n (focus)=\"onSearchFocus()\"\n (keydown)=\"onSearchKey($event)\"\n (blur)=\"onSearchBlur()\"\n />\n <!-- Pointer-only, and the `keydown.enter` / `keydown.space` pair this used to\n carry was dead code rather than the keyboard path it looked like: the ×\n is `tabindex=\"-1\"` with no roving owner, so no key event ever originates\n here to bubble into a handler. It stays unfocusable because the same\n span sits inside the BUTTON trigger further down, where a focusable\n child is `nested-interactive` — the defect the window taskbar's close\n button already taught this repo. The keyboard reaches the function\n instead: Backspace on the empty field, which `onSearchKey` routes to\n `clearAll` for a single and to the last chip for a multi. -->\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </div>\n} @else if (isTag() || hasChipSearch()) {\n <!-- Chip trigger — tag mode, or a searchable multi. A focusable input lives\n inside, so the wrapper itself only exists to host chips and forward\n whitespace clicks to the input. Tag mode needs no role (users tab\n straight into the input); the searchable multi is a real combobox, so it\n carries the listbox wiring. The click handler is a mouse-only\n convenience. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"wr-select__trigger wr-select__trigger--tag\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"focusTagInput()\"\n >\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n <!-- At `maxItems` this input goes READONLY, never disabled: it is the only\n tab stop in the whole control (the chip × and the clear button are\n `tabindex=\"-1\"` spans), so disabling it left a full tag select with\n nothing focusable at all — and Backspace on an empty draft, the one\n keyboard way back UNDER the cap, is bound to this very element. It was\n never needed as enforcement either: `tryAddTag` already refuses past\n capacity. -->\n <!-- `aria-autocomplete` is conditional here, unlike the search input's:\n this field is only a combobox when a panel backs it. In plain tag\n mode there is no popup to suggest from, and claiming otherwise\n describes a control that does not exist. -->\n <input\n #tagInput\n type=\"text\"\n class=\"wr-select__tag-input\"\n autocomplete=\"off\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n spellcheck=\"false\"\n [value]=\"hasChipSearch() ? searchQuery() : draft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"isReadonly() || (isTag() && atCapacity())\"\n [attr.aria-readonly]=\"hasChipSearch() && isReadonly() ? true : null\"\n [placeholder]=\"hasSelection() ? '' : resolvedPlaceholder()\"\n [attr.role]=\"hasChipSearch() ? 'combobox' : null\"\n [attr.aria-haspopup]=\"hasChipSearch() ? 'listbox' : null\"\n [attr.aria-autocomplete]=\"hasChipSearch() ? 'list' : null\"\n [attr.aria-expanded]=\"hasChipSearch() ? isOpen() : null\"\n [attr.aria-controls]=\"hasChipSearch() ? listboxId : null\"\n [attr.aria-activedescendant]=\"hasChipSearch() && isOpen() ? activeOptionId() || null : null\"\n (input)=\"onChipsInput($event)\"\n (keydown)=\"onChipsKeydown($event)\"\n (paste)=\"onChipsPaste($event)\"\n (focus)=\"onChipsFocus()\"\n (blur)=\"onChipsBlur()\"\n />\n </span>\n\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <!-- Only for the searchable MULTI, never for tag mode. The two share this\n trigger and differ in the one thing a chevron stands for: the searchable\n multi's input is a `role=\"combobox\"` with `aria-haspopup=\"listbox\"` and\n a panel of options behind it, while tag mode takes free text and has no\n popup at all. Folding the second into this branch left it as the only\n combobox shape in the component with no affordance saying it opens —\n `mode=\"search\"` has one, a searchable single has one, the button trigger\n has one, and this one rendered a bare field. -->\n @if (hasChipSearch()) {\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n }\n </div>\n} @else {\n <button\n #trigger\n type=\"button\"\n class=\"wr-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKey($event)\"\n (blur)=\"touch.emit()\"\n >\n @if (isMulti()) {\n @if (hasSelection()) {\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n <!-- A selected chip draws its option's leading visual — one copy per\n VISIBLE chip, so `maxTagCount` caps these too. -->\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n </span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n } @else {\n @if (selectedLabel(); as label) {\n <!-- Beside the label, not inside it: the harness and the accessible name\n both read `.wr-select__value`, and the visual says nothing either should. -->\n @if (selectedLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <span class=\"wr-select__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n }\n\n @if (isMulti() && clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n}\n\n<ng-template #panelTpl>\n <div\n class=\"wr-select-panel\"\n (pointerdown)=\"onPanelPointerDown($event)\"\n [class.wr-select-panel--sm]=\"size() === 'sm'\"\n [class.wr-select-panel--lg]=\"size() === 'lg'\"\n [class.wr-select-panel--virtual]=\"virtualActive()\"\n role=\"listbox\"\n [attr.id]=\"listboxId\"\n [attr.aria-multiselectable]=\"isMulti() ? 'true' : null\"\n [attr.aria-busy]=\"isLoading() ? 'true' : null\"\n >\n <!-- `aria-busy` belongs on the listbox, not on this row: it is the container\n whose required `option` children are temporarily missing, and a global\n ARIA attribute on a role-less child makes that child an owned element the\n listbox may not own (axe `aria-required-children`, critical). Plain text\n inside the listbox is fine — only ELEMENTS are checked. -->\n <!-- While the error row is up, through a retry, it carries the loader. -->\n @if (isLoading() && !showLoadError()) {\n <div class=\"wr-select-panel__loading\">{{ resolvedLoading() }}</div>\n }\n\n @if (virtualActive()) {\n <!-- Windowed data-array rows: plain role=\"option\" elements (not <wr-option>),\n navigated via the trigger's aria-activedescendant, selected by value. -->\n <div class=\"wr-select-panel__vlist\" [style.max-height]=\"resolvedViewportHeight()\">\n @if (virtualWindow().padTop > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padTop\"></div>\n }\n @for (entry of windowOptions(); track entry.index) {\n <!-- Keyboard handled by the trigger via aria-activedescendant; the\n row is a pointer target only. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n role=\"option\"\n class=\"wr-option\"\n [id]=\"virtualRowId(entry.index)\"\n [class.wr-option--active]=\"entry.index === activeIndex()\"\n [class.wr-option--selected]=\"isSelected(entry.item)\"\n [class.wr-option--disabled]=\"atMaxItems() && !isSelected(entry.item)\"\n [attr.aria-selected]=\"isSelected(entry.item)\"\n [attr.aria-disabled]=\"atMaxItems() && !isSelected(entry.item) ? true : null\"\n [attr.aria-setsize]=\"filteredDynamicOptions().length\"\n [attr.aria-posinset]=\"entry.index + 1\"\n (click)=\"selectOption(entry.item)\"\n >\n <!-- Only the select-wide template reaches a virtual row — there is no\n `<wr-option>` here to declare one — and only rows inside the\n rendered window instantiate it. -->\n @if (optionLeading(); as leading) {\n <span class=\"wr-option__leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item, placement: 'option' }\"\n />\n </span>\n }\n {{ displayWith()(entry.item) }}\n </div>\n }\n @if (virtualWindow().padBottom > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padBottom\"></div>\n }\n </div>\n } @else {\n <!-- Dynamic options from [options], or from the async [loader] in search\n mode. Rendered as wr-option so the standard registration / filter\n pipeline applies uniformly. -->\n @for (item of dynamicOptions(); track $index) {\n <wr-option [value]=\"item\">{{ displayWith()(item) }}</wr-option>\n }\n }\n\n <!-- Projected static options — always present (a conditional `<ng-content>`\n would drop projected content). Empty whenever `virtualActive`. -->\n <ng-content />\n\n <!-- A listbox may only own `option` and `group` children, and as a bare `<div>`\n this row was the only thing in the tree when it showed — an\n `aria-required-children` critical. It cannot move out of the listbox the\n way the command palette's does: this element IS the listbox, and the id\n the trigger's `aria-controls` names is what gives it its accessible name.\n So it announces as a disabled option instead. Keyboard navigation skips\n it for free — arrow keys walk the registered `wr-option`s, and nothing\n registers this row. -->\n @if (hasNoResults()) {\n <div class=\"wr-select-panel__empty\" role=\"option\" aria-selected=\"false\" aria-disabled=\"true\">\n {{ resolvedNoResults() }}\n </div>\n }\n\n <!-- A failed load, in place of \"no results\". An option for the same reason as\n that row. While it offers a retry it is the option that runs the loader\n again: the field's aria-activedescendant names it, Enter there reaches it,\n and mousedown keeps focus in the field. The retry is DRAWN as a button but\n cannot be one, since a button inside an option is nested interactive\n content; it wears `.wr-btn` and takes the click. -->\n @if (showLoadError()) {\n <div\n class=\"wr-select-panel__error\"\n [class.wr-select-panel__error--retryable]=\"retryOffered()\"\n [class.wr-select-panel__error--active]=\"retryOffered() && !freeText()\"\n role=\"option\"\n aria-selected=\"false\"\n [attr.id]=\"retryOffered() ? retryRowId : null\"\n [attr.aria-disabled]=\"retryOffered() ? null : true\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (loadErrorTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"loadErrorContext()\" />\n } @else {\n {{ resolvedLoadError() }}\n @if (retryOffered()) {\n <!-- The spinner as `wr-btn` draws it while loading: hidden from the\n accessibility tree, since the row already reads the retry label. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <span\n class=\"wr-btn wr-btn--sm wr-select-panel__retry\"\n [class.wr-btn--loading]=\"retrying()\"\n (click)=\"onLoadErrorClick()\"\n >\n @if (retrying()) {\n <wr-spinner class=\"wr-btn__spin\" size=\"sm\" aria-hidden=\"true\" />\n }\n <span class=\"wr-btn__label\">{{ resolvedRetry() }}</span>\n </span>\n }\n }\n </div>\n }\n </div>\n</ng-template>\n"
|
|
1789
|
+
template: "@if (isSearchTrigger()) {\n <!-- Search mode (or a searchable single): a real text input drives a filtered\n overlay panel. The wrapper isn't itself focusable — the input is the\n tabstop. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"wr-select__trigger wr-select__trigger--search\" (click)=\"focusSearchInput()\">\n <!-- The selected option's leading visual, before the field — the same class\n and the same `placement: 'value'` the button trigger uses, because it is\n the same surface and a consumer who styled one should not have to learn\n a second name. `searchLeading()` draws it only while the field is\n showing the VALUE, so it never stands in front of a query or a bare\n placeholder, and it sits OUTSIDE the input for the obvious reason: an\n `<input>` holds a string. `aria-hidden` keeps it out of the combobox's\n name, which is `resolvedAriaLabel()`, and out of its value, which is the\n input's own text. -->\n @if (searchLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <!-- `id` / `aria-describedby` / `aria-invalid` come from a surrounding\n `<wr-form-field>` and are null without one — see `controlId` in the\n component. They go on the tab stop, the only labelable element here.\n `aria-label` is the trigger's name and belongs on the same element for\n the same reason: this input carries `role=\"combobox\"`, and the four\n other trigger shapes all bind `resolvedAriaLabel()`. Without it a\n search select with no placeholder rendered a combobox with no name at\n all — the one shape where the documented `ariaLabel` input reached\n nothing. -->\n <!-- `aria-autocomplete` is static, and `list` rather than `both`: the panel\n is the only place a suggestion appears, nothing is written back into\n the field for the user. It describes a permanent CAPABILITY, which is\n why it does not track `isOpen()` — the same reasoning `wr-mention`\n records at its own host binding. -->\n <input\n #searchInput\n type=\"text\"\n role=\"combobox\"\n class=\"wr-select__search-input\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [readonly]=\"isReadonly()\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"searchDisplay()\"\n (input)=\"onSearchInput($event)\"\n (focus)=\"onSearchFocus()\"\n (keydown)=\"onSearchKey($event)\"\n (blur)=\"onSearchBlur()\"\n />\n <!-- Pointer-only, and the `keydown.enter` / `keydown.space` pair this used to\n carry was dead code rather than the keyboard path it looked like: the ×\n is `tabindex=\"-1\"` with no roving owner, so no key event ever originates\n here to bubble into a handler. It stays unfocusable because the same\n span sits inside the BUTTON trigger further down, where a focusable\n child is `nested-interactive` — the defect the window taskbar's close\n button already taught this repo. The keyboard reaches the function\n instead: Backspace on the empty field, which `onSearchKey` routes to\n `clearAll` for a single and to the last chip for a multi. -->\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </div>\n} @else if (isTag() || hasChipSearch()) {\n <!-- Chip trigger — tag mode, or a searchable multi. A focusable input lives\n inside, so the wrapper itself only exists to host chips and forward\n whitespace clicks to the input. Tag mode needs no role (users tab\n straight into the input); the searchable multi is a real combobox, so it\n carries the listbox wiring. The click handler is a mouse-only\n convenience. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"wr-select__trigger wr-select__trigger--tag\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"focusTagInput()\"\n >\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n <!-- At `maxItems` this input goes READONLY, never disabled: it is the only\n tab stop in the whole control (the chip × and the clear button are\n `tabindex=\"-1\"` spans), so disabling it left a full tag select with\n nothing focusable at all — and Backspace on an empty draft, the one\n keyboard way back UNDER the cap, is bound to this very element. It was\n never needed as enforcement either: `tryAddTag` already refuses past\n capacity. -->\n <!-- `aria-autocomplete` is conditional here, unlike the search input's:\n this field is only a combobox when a panel backs it. In plain tag\n mode there is no popup to suggest from, and claiming otherwise\n describes a control that does not exist. -->\n <input\n #tagInput\n type=\"text\"\n class=\"wr-select__tag-input\"\n autocomplete=\"off\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n spellcheck=\"false\"\n [value]=\"hasChipSearch() ? searchQuery() : draft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"isReadonly() || (isTag() && atCapacity())\"\n [attr.aria-readonly]=\"hasChipSearch() && isReadonly() ? true : null\"\n [placeholder]=\"hasSelection() ? '' : resolvedPlaceholder()\"\n [attr.role]=\"hasChipSearch() ? 'combobox' : null\"\n [attr.aria-haspopup]=\"hasChipSearch() ? 'listbox' : null\"\n [attr.aria-autocomplete]=\"hasChipSearch() ? 'list' : null\"\n [attr.aria-expanded]=\"hasChipSearch() ? isOpen() : null\"\n [attr.aria-controls]=\"hasChipSearch() ? listboxId : null\"\n [attr.aria-activedescendant]=\"hasChipSearch() && isOpen() ? activeOptionId() || null : null\"\n (input)=\"onChipsInput($event)\"\n (keydown)=\"onChipsKeydown($event)\"\n (paste)=\"onChipsPaste($event)\"\n (focus)=\"onChipsFocus()\"\n (blur)=\"onChipsBlur()\"\n />\n </span>\n\n @if (clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <!-- Only for the searchable MULTI, never for tag mode. The two share this\n trigger and differ in the one thing a chevron stands for: the searchable\n multi's input is a `role=\"combobox\"` with `aria-haspopup=\"listbox\"` and\n a panel of options behind it, while tag mode takes free text and has no\n popup at all. Folding the second into this branch left it as the only\n combobox shape in the component with no affordance saying it opens —\n `mode=\"search\"` has one, a searchable single has one, the button trigger\n has one, and this one rendered a bare field. -->\n @if (hasChipSearch()) {\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n }\n </div>\n} @else {\n <button\n #trigger\n type=\"button\"\n class=\"wr-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"isOpen() ? activeOptionId() || null : null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKey($event)\"\n (blur)=\"touch.emit()\"\n >\n @if (isMulti()) {\n @if (hasSelection()) {\n <span class=\"wr-select__chips\">\n @for (chip of visibleChips(); track $index) {\n <span class=\"wr-select__chip\">\n <!-- A selected chip draws its option's leading visual — one copy per\n VISIBLE chip, so `maxTagCount` caps these too. -->\n @if (chip.leading; as leading) {\n <span class=\"wr-select__chip-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: chip.value, placement: 'chip' }\"\n />\n </span>\n }\n <span class=\"wr-select__chip-label\">{{ chip.label }}</span>\n @if (!isReadonly()) {\n <span\n class=\"wr-select__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip($index, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-select__chip wr-select__chip--more\">{{ moreLabel({ count: extra }) }}</span>\n }\n </span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n } @else {\n @if (selectedLabel(); as label) {\n <!-- Beside the label, not inside it: the harness and the accessible name\n both read `.wr-select__value`, and the visual says nothing either should. -->\n @if (selectedLeading(); as leading) {\n <span class=\"wr-select__value-leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), placement: 'value' }\"\n />\n </span>\n }\n <span class=\"wr-select__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-select__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n }\n\n @if (isMulti() && clearable() && hasSelection() && !isDisabled() && !isReadonly()) {\n <span\n class=\"wr-select__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clearAll($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-select__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n}\n\n<ng-template #panelTpl>\n <div\n class=\"wr-select-panel\"\n (pointerdown)=\"onPanelPointerDown($event)\"\n [class.wr-select-panel--sm]=\"size() === 'sm'\"\n [class.wr-select-panel--lg]=\"size() === 'lg'\"\n [class.wr-select-panel--virtual]=\"virtualActive()\"\n role=\"listbox\"\n [attr.id]=\"listboxId\"\n [attr.aria-multiselectable]=\"isMulti() ? 'true' : null\"\n [attr.aria-busy]=\"isLoading() ? 'true' : null\"\n >\n <!-- `aria-busy` belongs on the listbox, not on this row: it is the container\n whose required `option` children are temporarily missing, and a global\n ARIA attribute on a role-less child makes that child an owned element the\n listbox may not own (axe `aria-required-children`, critical). Plain text\n inside the listbox is fine — only ELEMENTS are checked. -->\n <!-- While the error row is up, through a retry, it carries the loader. -->\n @if (isLoading() && !showLoadError()) {\n <div class=\"wr-select-panel__loading\">{{ resolvedLoading() }}</div>\n }\n\n <!-- Multi mode under `selectAll`. An option, since a listbox owns only options\n and groups, and deliberately NOT a `.wr-option`: it carries no value, so a\n query for the options must not count it. Its state is `aria-checked`,\n which has the `mixed` that `aria-selected` lacks. Reached through the\n trigger's aria-activedescendant like every row, so it is a pointer\n target only. First in the panel and pinned there; the virtual list\n scrolls in its own box below it. No `aria-selected`, which the lint\n rule below asks of every option: ARIA 1.2 no longer requires it, and it\n asks authors not to put it beside `aria-checked` on one option. -->\n @if (showSelectAll()) {\n <!-- eslint-disable @angular-eslint/template/role-has-required-aria -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"wr-select-panel__select-all\"\n role=\"option\"\n [id]=\"selectAllId\"\n [class.wr-select-panel__select-all--active]=\"selectAllActive()\"\n [class.wr-select-panel__select-all--checked]=\"selectAllState() === 'all'\"\n [class.wr-select-panel__select-all--mixed]=\"selectAllState() === 'some'\"\n [class.wr-select-panel__select-all--disabled]=\"selectAllUnavailable()\"\n [attr.aria-checked]=\"selectAllChecked()\"\n [attr.aria-disabled]=\"selectAllUnavailable() ? true : null\"\n (click)=\"toggleSelectAll()\"\n >\n <span class=\"wr-select-panel__select-all-box\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n @switch (selectAllState()) {\n @case ('all') {\n <path d=\"m4 8.5 3 3 5-6\" stroke-linejoin=\"round\" />\n }\n @case ('some') {\n <path d=\"M4 8h8\" />\n }\n }\n </svg>\n </span>\n {{ resolvedSelectAll() }}\n </div>\n <!-- eslint-enable @angular-eslint/template/role-has-required-aria -->\n }\n\n @if (virtualActive()) {\n <!-- Windowed data-array rows: plain role=\"option\" elements (not <wr-option>),\n navigated via the trigger's aria-activedescendant, selected by value. -->\n <div class=\"wr-select-panel__vlist\" [style.max-height]=\"resolvedViewportHeight()\">\n @if (virtualWindow().padTop > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padTop\"></div>\n }\n @for (entry of windowOptions(); track entry.index) {\n <!-- Keyboard handled by the trigger via aria-activedescendant; the\n row is a pointer target only. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n role=\"option\"\n class=\"wr-option\"\n [id]=\"virtualRowId(entry.index)\"\n [class.wr-option--active]=\"entry.index === activeIndex()\"\n [class.wr-option--selected]=\"isSelected(entry.item)\"\n [class.wr-option--disabled]=\"atMaxItems() && !isSelected(entry.item)\"\n [attr.aria-selected]=\"isSelected(entry.item)\"\n [attr.aria-disabled]=\"atMaxItems() && !isSelected(entry.item) ? true : null\"\n [attr.aria-setsize]=\"filteredDynamicOptions().length\"\n [attr.aria-posinset]=\"entry.index + 1\"\n (click)=\"selectOption(entry.item)\"\n >\n <!-- Only the select-wide template reaches a virtual row — there is no\n `<wr-option>` here to declare one — and only rows inside the\n rendered window instantiate it. -->\n @if (optionLeading(); as leading) {\n <span class=\"wr-option__leading\" aria-hidden=\"true\">\n <ng-container\n [ngTemplateOutlet]=\"leading\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.item, placement: 'option' }\"\n />\n </span>\n }\n {{ displayWith()(entry.item) }}\n </div>\n }\n @if (virtualWindow().padBottom > 0) {\n <div class=\"wr-select-panel__vspacer\" aria-hidden=\"true\" [style.height.px]=\"virtualWindow().padBottom\"></div>\n }\n </div>\n } @else {\n <!-- Dynamic options from [options], or from the async [loader] in search\n mode. Rendered as wr-option so the standard registration / filter\n pipeline applies uniformly. -->\n @for (item of dynamicOptions(); track $index) {\n <wr-option [value]=\"item\">{{ displayWith()(item) }}</wr-option>\n }\n }\n\n <!-- Projected static options — always present (a conditional `<ng-content>`\n would drop projected content). Empty whenever `virtualActive`. -->\n <ng-content />\n\n <!-- A listbox may only own `option` and `group` children, and as a bare `<div>`\n this row was the only thing in the tree when it showed — an\n `aria-required-children` critical. It cannot move out of the listbox the\n way the command palette's does: this element IS the listbox, and the id\n the trigger's `aria-controls` names is what gives it its accessible name.\n So it announces as a disabled option instead. Keyboard navigation skips\n it for free — arrow keys walk the registered `wr-option`s, and nothing\n registers this row. -->\n @if (hasNoResults()) {\n <div class=\"wr-select-panel__empty\" role=\"option\" aria-selected=\"false\" aria-disabled=\"true\">\n {{ resolvedNoResults() }}\n </div>\n }\n\n <!-- A failed load, in place of \"no results\". An option for the same reason as\n that row. While it offers a retry it is the option that runs the loader\n again: the field's aria-activedescendant names it, Enter there reaches it,\n and mousedown keeps focus in the field. The retry is DRAWN as a button but\n cannot be one, since a button inside an option is nested interactive\n content; it wears `.wr-btn` and takes the click. -->\n @if (showLoadError()) {\n <div\n class=\"wr-select-panel__error\"\n [class.wr-select-panel__error--retryable]=\"retryOffered()\"\n [class.wr-select-panel__error--active]=\"retryOffered() && !freeText()\"\n role=\"option\"\n aria-selected=\"false\"\n [attr.id]=\"retryOffered() ? retryRowId : null\"\n [attr.aria-disabled]=\"retryOffered() ? null : true\"\n (mousedown)=\"$event.preventDefault()\"\n >\n @if (loadErrorTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"loadErrorContext()\" />\n } @else {\n {{ resolvedLoadError() }}\n @if (retryOffered()) {\n <!-- The spinner as `wr-btn` draws it while loading: hidden from the\n accessibility tree, since the row already reads the retry label. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <span\n class=\"wr-btn wr-btn--sm wr-select-panel__retry\"\n [class.wr-btn--loading]=\"retrying()\"\n (click)=\"onLoadErrorClick()\"\n >\n @if (retrying()) {\n <wr-spinner class=\"wr-btn__spin\" size=\"sm\" aria-hidden=\"true\" />\n }\n <span class=\"wr-btn__label\">{{ resolvedRetry() }}</span>\n </span>\n }\n }\n </div>\n }\n </div>\n</ng-template>\n"
|
|
1626
1790
|
}]
|
|
1627
1791
|
}],
|
|
1628
1792
|
ctorParameters: () => [],
|
|
@@ -1906,6 +2070,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1906
2070
|
required: false
|
|
1907
2071
|
}]
|
|
1908
2072
|
}],
|
|
2073
|
+
selectAll: [{
|
|
2074
|
+
type: i0.Input,
|
|
2075
|
+
args: [{
|
|
2076
|
+
isSignal: true,
|
|
2077
|
+
alias: "selectAll",
|
|
2078
|
+
required: false
|
|
2079
|
+
}]
|
|
2080
|
+
}],
|
|
2081
|
+
selectAllLabel: [{
|
|
2082
|
+
type: i0.Input,
|
|
2083
|
+
args: [{
|
|
2084
|
+
isSignal: true,
|
|
2085
|
+
alias: "selectAllLabel",
|
|
2086
|
+
required: false
|
|
2087
|
+
}]
|
|
2088
|
+
}],
|
|
1909
2089
|
maxTagCount: [{
|
|
1910
2090
|
type: i0.Input,
|
|
1911
2091
|
args: [{
|
|
@@ -1993,7 +2173,7 @@ var WrOptionGroup = class WrOptionGroup {
|
|
|
1993
2173
|
labelId = wrRandomId("wr-option-group-label");
|
|
1994
2174
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1995
2175
|
minVersion: "12.0.0",
|
|
1996
|
-
version: "22.2.
|
|
2176
|
+
version: "22.2.6",
|
|
1997
2177
|
ngImport: i0,
|
|
1998
2178
|
type: WrOptionGroup,
|
|
1999
2179
|
deps: [],
|
|
@@ -2001,7 +2181,7 @@ var WrOptionGroup = class WrOptionGroup {
|
|
|
2001
2181
|
});
|
|
2002
2182
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2003
2183
|
minVersion: "17.1.0",
|
|
2004
|
-
version: "22.2.
|
|
2184
|
+
version: "22.2.6",
|
|
2005
2185
|
type: WrOptionGroup,
|
|
2006
2186
|
isStandalone: true,
|
|
2007
2187
|
selector: "wr-option-group",
|
|
@@ -2024,7 +2204,7 @@ var WrOptionGroup = class WrOptionGroup {
|
|
|
2024
2204
|
};
|
|
2025
2205
|
i0.ɵɵngDeclareClassMetadata({
|
|
2026
2206
|
minVersion: "12.0.0",
|
|
2027
|
-
version: "22.2.
|
|
2207
|
+
version: "22.2.6",
|
|
2028
2208
|
ngImport: i0,
|
|
2029
2209
|
type: WrOptionGroup,
|
|
2030
2210
|
decorators: [{
|