ngwr 14.3.1 → 14.5.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/README.md +4 -4
- package/avatar/styles/_index.scss +4 -2
- package/badge/styles/_index.scss +4 -1
- package/badge/styles/_tag.scss +3 -0
- package/cascader/styles/_rules.scss +3 -0
- package/command-palette/styles/_index.scss +23 -0
- package/context-menu/styles/_index.scss +13 -1
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs +17 -4
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +4 -4
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-aurora.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-bar-chart-testing.mjs +18 -2
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs +3 -3
- package/fesm2022/ngwr-border-glow.mjs +3 -3
- package/fesm2022/ngwr-breadcrumbs.mjs +7 -7
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs +12 -9
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +35 -7
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +32 -4
- 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-testing.mjs +87 -17
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +76 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs +13 -2
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +42 -7
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +3 -3
- package/fesm2022/ngwr-click-spark.mjs +3 -3
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +24 -8
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +16 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-confetti.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +47 -15
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
- package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
- package/fesm2022/ngwr-date-picker.mjs +111 -28
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +3 -3
- package/fesm2022/ngwr-decrypt-text.mjs +3 -3
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +27 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +12 -12
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-donut-chart-testing.mjs +18 -2
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +4 -4
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +7 -7
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +66 -20
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +54 -16
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +6 -6
- package/fesm2022/ngwr-falling-text.mjs +3 -3
- package/fesm2022/ngwr-file-upload.mjs +18 -5
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +66 -14
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
- package/fesm2022/ngwr-gauge-testing.mjs +16 -2
- package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +3 -3
- package/fesm2022/ngwr-glitch-text.mjs +3 -3
- package/fesm2022/ngwr-gradient-text.mjs +3 -3
- package/fesm2022/ngwr-graph-testing.mjs +243 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -0
- package/fesm2022/ngwr-graph.mjs +1112 -0
- package/fesm2022/ngwr-graph.mjs.map +1 -0
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +7 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +7 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +7 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +23 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +7 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +7 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +7 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +7 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +7 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +7 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +7 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +7 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +7 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +7 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +7 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +7 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +7 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +7 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +7 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +7 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +7 -0
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +7 -0
- 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.mjs +15 -6
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +38 -6
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob-testing.mjs +11 -3
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +19 -4
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +27 -6
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart-testing.mjs +18 -2
- package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +22 -4
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +7 -7
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-markdown.mjs +6 -6
- package/fesm2022/ngwr-marquee.mjs +3 -3
- package/fesm2022/ngwr-media.mjs +3 -3
- package/fesm2022/ngwr-mention.mjs +24 -8
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-meter-group.mjs +3 -3
- package/fesm2022/ngwr-overlay.mjs +125 -10
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +33 -6
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +21 -21
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +25 -9
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +22 -5
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +243 -37
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +3 -3
- 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-testing.mjs +12 -3
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +19 -4
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +13 -13
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text.mjs +3 -3
- package/fesm2022/ngwr-schema-form.mjs +3 -3
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +37 -4
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +24 -10
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +6 -6
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +18 -5
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +3 -3
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splash-cursor.mjs +3 -3
- package/fesm2022/ngwr-split-text.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-spotlight-card.mjs +6 -6
- package/fesm2022/ngwr-squircle.mjs +28 -9
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +20 -13
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table.mjs +18 -18
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs.mjs +6 -6
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-tilt-card.mjs +6 -6
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +29 -12
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +26 -12
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +88 -11
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +24 -0
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +81 -9
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +3 -3
- package/fesm2022/ngwr-typography.mjs +3 -3
- 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-waves.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +30 -13
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/form/styles/_index.scss +63 -0
- package/graph/styles/_index.scss +113 -0
- package/i18n/ar.json +9 -2
- package/i18n/cs.json +9 -2
- package/i18n/de.json +9 -2
- package/i18n/en.json +11 -4
- package/i18n/es.json +9 -2
- package/i18n/fr.json +9 -2
- package/i18n/he.json +9 -2
- package/i18n/hi.json +9 -2
- package/i18n/id.json +9 -2
- package/i18n/it.json +9 -2
- package/i18n/ja.json +9 -2
- package/i18n/ko.json +9 -2
- package/i18n/nl.json +9 -2
- package/i18n/pl.json +9 -2
- package/i18n/pt.json +9 -2
- package/i18n/ru.json +9 -2
- package/i18n/sv.json +9 -2
- package/i18n/tr.json +9 -2
- package/i18n/uk.json +9 -2
- package/i18n/vi.json +9 -2
- package/i18n/zh-TW.json +9 -2
- package/i18n/zh.json +9 -2
- package/input-otp/styles/_index.scss +5 -1
- package/line-chart/styles/_index.scss +5 -3
- package/llms-full.txt +13 -3
- package/llms.txt +8 -6
- package/markdown/styles/_index.scss +4 -1
- package/mention/styles/_index.scss +22 -1
- package/package.json +10 -1
- package/radio/styles/_index.scss +3 -0
- package/result/styles/_index.scss +12 -0
- package/schematics/migrations/v14/index.js +6 -3
- package/schematics/migrations.json +1 -1
- package/schematics/ng-add/index.js +34 -5
- package/schematics/use/symbol-map.json +2 -0
- package/segmented/styles/_index.scss +12 -1
- package/select/styles/_index.scss +20 -1
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +2 -0
- package/statistic/styles/_index.scss +4 -0
- package/stepper/styles/_index.scss +36 -0
- package/styles.scss +1 -0
- package/switch/styles/_index.scss +3 -0
- package/table/styles/_index.scss +12 -0
- package/tabs/styles/_index.scss +4 -1
- package/textarea/styles/_index.scss +6 -1
- package/theme/styles/_colors.scss +11 -0
- package/theme/styles/_contrast.scss +136 -0
- package/theme/styles/_focus.scss +7 -0
- package/theme/styles/_index.scss +1 -0
- package/theme/styles/_mixins.scss +15 -8
- package/timeline/styles/_index.scss +28 -1
- package/toast/styles/_index.scss +11 -0
- package/tree/styles/_index.scss +27 -1
- package/types/ngwr-badge.d.ts +1 -1
- package/types/ngwr-bar-chart-testing.d.ts +11 -1
- package/types/ngwr-button.d.ts +1 -1
- package/types/ngwr-calendar-heatmap-testing.d.ts +10 -5
- package/types/ngwr-calendar-heatmap.d.ts +22 -0
- package/types/ngwr-calendar.d.ts +21 -0
- package/types/ngwr-cascader-testing.d.ts +74 -17
- package/types/ngwr-cascader.d.ts +35 -0
- package/types/ngwr-checkbox-testing.d.ts +12 -1
- package/types/ngwr-checkbox.d.ts +10 -0
- package/types/ngwr-clipboard.d.ts +1 -1
- package/types/ngwr-color-picker.d.ts +8 -0
- package/types/ngwr-confetti.d.ts +1 -1
- package/types/ngwr-context-menu.d.ts +10 -0
- package/types/ngwr-cookie.d.ts +1 -1
- package/types/ngwr-date-adapters-fns.d.ts +1 -1
- package/types/ngwr-date-adapters-luxon.d.ts +1 -1
- package/types/ngwr-date-picker.d.ts +16 -0
- package/types/ngwr-date.d.ts +9 -3
- package/types/ngwr-density.d.ts +1 -1
- package/types/ngwr-dialog.d.ts +2 -1
- package/types/ngwr-donut-chart-testing.d.ts +11 -1
- package/types/ngwr-drawer.d.ts +29 -1
- package/types/ngwr-dropdown.d.ts +25 -0
- package/types/ngwr-file-upload.d.ts +11 -0
- package/types/ngwr-form.d.ts +25 -0
- package/types/ngwr-gauge-testing.d.ts +9 -1
- package/types/ngwr-graph-testing.d.ts +190 -0
- package/types/ngwr-graph.d.ts +203 -0
- package/types/ngwr-hotkey.d.ts +1 -1
- package/types/ngwr-i18n.d.ts +1 -1
- package/types/ngwr-input-number.d.ts +12 -2
- package/types/ngwr-input-otp.d.ts +12 -0
- package/types/ngwr-knob-testing.d.ts +11 -3
- package/types/ngwr-knob.d.ts +13 -0
- package/types/ngwr-lightbox.d.ts +15 -0
- package/types/ngwr-line-chart-testing.d.ts +11 -1
- package/types/ngwr-line-chart.d.ts +18 -0
- package/types/ngwr-loading-bar.d.ts +1 -1
- package/types/ngwr-markdown.d.ts +1 -1
- package/types/ngwr-media.d.ts +1 -1
- package/types/ngwr-mention.d.ts +7 -0
- package/types/ngwr-meta.d.ts +1 -1
- package/types/ngwr-overlay.d.ts +64 -6
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-platform.d.ts +3 -3
- package/types/ngwr-popconfirm.d.ts +1 -0
- package/types/ngwr-popover-testing.d.ts +22 -5
- package/types/ngwr-popover.d.ts +44 -8
- package/types/ngwr-rating-testing.d.ts +12 -3
- package/types/ngwr-rating.d.ts +13 -0
- package/types/ngwr-scroll.d.ts +1 -1
- package/types/ngwr-segmented.d.ts +16 -0
- package/types/ngwr-select.d.ts +7 -0
- package/types/ngwr-squircle.d.ts +22 -3
- package/types/ngwr-statistic.d.ts +0 -1
- package/types/ngwr-storage.d.ts +1 -1
- package/types/ngwr-theme.d.ts +1 -1
- package/types/ngwr-toast.d.ts +3 -1
- package/types/ngwr-tour.d.ts +7 -1
- package/types/ngwr-transfer.d.ts +52 -0
- package/types/ngwr-tree-testing.d.ts +20 -0
- package/types/ngwr-tree.d.ts +43 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +2 -1
- package/typography/styles/_index.scss +26 -4
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
1
2
|
import { Directionality } from '@angular/cdk/bidi';
|
|
2
3
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
3
4
|
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
4
5
|
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
5
6
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { input, ViewEncapsulation, Component, output,
|
|
7
|
+
import { inject, DestroyRef, PLATFORM_ID, Service, input, ViewEncapsulation, Component, output, ElementRef, ViewContainerRef, Injector, signal, computed, effect, afterNextRender, Directive } from '@angular/core';
|
|
7
8
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
9
|
import { useI18nText } from 'ngwr/i18n';
|
|
9
|
-
import { WR_OVERLAY, WrOutsideClick, WR_RESPONSIVE_OVERLAYS, wrPresentAsSheet, wrMirrorOffsets } from 'ngwr/overlay';
|
|
10
|
-
import { numAttr } from 'ngwr/utils';
|
|
10
|
+
import { WR_OVERLAY, WrOutsideClick, WR_RESPONSIVE_OVERLAYS, wrPresentAsSheet, wrMirrorOffsets, wrFollowDirection } from 'ngwr/overlay';
|
|
11
|
+
import { KEYS, numAttr } from 'ngwr/utils';
|
|
12
|
+
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* @license
|
|
@@ -98,6 +100,83 @@ function wrPopoverPositions(position, paneClass) {
|
|
|
98
100
|
}));
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
/**
|
|
104
|
+
* @license
|
|
105
|
+
*
|
|
106
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
107
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
108
|
+
*/
|
|
109
|
+
/** `FocusMonitor._setOrigin`'s own window — see the class docs for why it matches. */
|
|
110
|
+
const KEYSTROKE_WINDOW_MS = 1;
|
|
111
|
+
/**
|
|
112
|
+
* The key of the keystroke being handled RIGHT NOW — `null` between them.
|
|
113
|
+
*
|
|
114
|
+
* `FocusMonitor` answers "the most recent input modality was a keyboard", which
|
|
115
|
+
* is a weaker statement than "the user's own key put focus here", and the gap
|
|
116
|
+
* between the two is exactly where a tooltip goes wrong. The origin is whatever
|
|
117
|
+
* was pressed within the last millisecond (`_setOrigin` clears it on a 1ms
|
|
118
|
+
* timer), and an overlay dismissed with Escape hands focus BACK to its trigger
|
|
119
|
+
* synchronously, inside that same keystroke — CDK's keyboard dispatcher listens
|
|
120
|
+
* on `<body>` in the bubble phase, the modality detector on `document` in
|
|
121
|
+
* capture, so the modality is always already `keyboard` by the time the drawer
|
|
122
|
+
* runs. Same for a ✕ activated with Enter. So the CDK reports `keyboard` for a
|
|
123
|
+
* hand-back and a tooltip reading the origin alone still shows itself unbidden,
|
|
124
|
+
* which is the whole failure it was meant to stop.
|
|
125
|
+
*
|
|
126
|
+
* The KEY separates them: `Tab` and the arrows are how a user moves focus,
|
|
127
|
+
* `Escape` and `Enter` dismiss and activate. A focus that lands during one of
|
|
128
|
+
* those was moved by a script.
|
|
129
|
+
*
|
|
130
|
+
* One passive capture listener for the whole app, constructed with the first
|
|
131
|
+
* `[wrPopover]` and never before it — beside the three `InputModalityDetector`
|
|
132
|
+
* already installs.
|
|
133
|
+
*
|
|
134
|
+
* The key expires on the CDK's own 1ms window rather than on a bare macrotask,
|
|
135
|
+
* and matching it is the point: the key is only ever read to EXPLAIN a keyboard
|
|
136
|
+
* origin, so it must not run out while the origin it explains is still live. A
|
|
137
|
+
* `setTimeout(0)` close would land in exactly that gap — key already forgotten,
|
|
138
|
+
* origin still `keyboard` — and read as a Tab. Everything a keystroke does
|
|
139
|
+
* synchronously, its default action and the click Enter dispatches included,
|
|
140
|
+
* happens long before either timer; anything that waits past them is judged
|
|
141
|
+
* `program` by the CDK and never reaches this question.
|
|
142
|
+
*
|
|
143
|
+
* Popover-local on purpose; no other component in the catalog asks this yet.
|
|
144
|
+
*/
|
|
145
|
+
class WrCurrentKeystroke {
|
|
146
|
+
doc = inject(DOCUMENT);
|
|
147
|
+
destroyRef = inject(DestroyRef);
|
|
148
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
149
|
+
current = null;
|
|
150
|
+
clearTimer = null;
|
|
151
|
+
/** `KeyboardEvent.key` for the keystroke in flight, `null` outside one. */
|
|
152
|
+
get key() {
|
|
153
|
+
return this.current;
|
|
154
|
+
}
|
|
155
|
+
constructor() {
|
|
156
|
+
if (!this.isBrowser)
|
|
157
|
+
return;
|
|
158
|
+
const record = (event) => {
|
|
159
|
+
this.current = event.key;
|
|
160
|
+
if (this.clearTimer)
|
|
161
|
+
clearTimeout(this.clearTimer);
|
|
162
|
+
this.clearTimer = setTimeout(() => (this.current = null), KEYSTROKE_WINDOW_MS);
|
|
163
|
+
};
|
|
164
|
+
// Capture, so the key is on record before any handler deeper in the tree
|
|
165
|
+
// gets to move focus with it.
|
|
166
|
+
this.doc.addEventListener('keydown', record, { capture: true, passive: true });
|
|
167
|
+
this.destroyRef.onDestroy(() => {
|
|
168
|
+
if (this.clearTimer)
|
|
169
|
+
clearTimeout(this.clearTimer);
|
|
170
|
+
this.doc.removeEventListener('keydown', record, { capture: true });
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCurrentKeystroke, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
174
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.6", ngImport: i0, type: WrCurrentKeystroke });
|
|
175
|
+
}
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCurrentKeystroke, decorators: [{
|
|
177
|
+
type: Service
|
|
178
|
+
}], ctorParameters: () => [] });
|
|
179
|
+
|
|
101
180
|
/**
|
|
102
181
|
* @license
|
|
103
182
|
*
|
|
@@ -114,10 +193,10 @@ function wrPopoverPositions(position, paneClass) {
|
|
|
114
193
|
class WrPopoverTextPanel {
|
|
115
194
|
text = input.required(/* @ts-ignore */
|
|
116
195
|
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
117
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
118
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopoverTextPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: WrPopoverTextPanel, isStandalone: true, selector: "wr-popover-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "wr-tooltip" }, ngImport: i0, template: '{{ text() }}', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
119
198
|
}
|
|
120
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopoverTextPanel, decorators: [{
|
|
121
200
|
type: Component,
|
|
122
201
|
args: [{
|
|
123
202
|
selector: 'wr-popover-text',
|
|
@@ -136,6 +215,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
136
215
|
* Use of this source code is governed by an MIT-style license that can be
|
|
137
216
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
138
217
|
*/
|
|
218
|
+
/**
|
|
219
|
+
* Keys the USER moves focus with: Tab through the page, the arrows / Home /
|
|
220
|
+
* End through a composite that roves its own tabindex.
|
|
221
|
+
*
|
|
222
|
+
* A roving arrow move is a script `.focus()` call too — the difference from a
|
|
223
|
+
* dismissal is not who called `focus()` but whether the keystroke was a
|
|
224
|
+
* NAVIGATION or an action. Anything absent from this list (Escape, Enter,
|
|
225
|
+
* Space, a character) does something else for a living, so focus that lands
|
|
226
|
+
* during one of them was placed by a script and a tooltip stays shut.
|
|
227
|
+
*/
|
|
228
|
+
const NAVIGATION_KEYS = new Set([
|
|
229
|
+
KEYS.TAB,
|
|
230
|
+
KEYS.ARROW_UP,
|
|
231
|
+
KEYS.ARROW_DOWN,
|
|
232
|
+
KEYS.ARROW_LEFT,
|
|
233
|
+
KEYS.ARROW_RIGHT,
|
|
234
|
+
KEYS.HOME,
|
|
235
|
+
KEYS.END,
|
|
236
|
+
KEYS.PAGE_UP,
|
|
237
|
+
KEYS.PAGE_DOWN,
|
|
238
|
+
]);
|
|
139
239
|
/**
|
|
140
240
|
* Anchored content panel. The same directive covers two shapes:
|
|
141
241
|
*
|
|
@@ -144,9 +244,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
144
244
|
* forms, summaries, menus.
|
|
145
245
|
*
|
|
146
246
|
* - **Tooltip** (`mode="tooltip"`) — `[wrPopover]` takes a plain string.
|
|
147
|
-
* Shown on hover and focus
|
|
148
|
-
*
|
|
149
|
-
*
|
|
247
|
+
* Shown on hover and when the KEYBOARD puts focus on the trigger — never for
|
|
248
|
+
* a `.focus()` call, which is what a dialog or drawer does when it hands
|
|
249
|
+
* focus back. Dismissed when focus leaves / on pointer-leave / Escape. Uses
|
|
250
|
+
* `aria-describedby` instead of `aria-haspopup` and is rendered into a small
|
|
251
|
+
* dark text panel.
|
|
150
252
|
*
|
|
151
253
|
* Built on CDK Overlay so it auto-flips, closes on outside-click and Escape.
|
|
152
254
|
*
|
|
@@ -179,14 +281,14 @@ class WrPopover {
|
|
|
179
281
|
*
|
|
180
282
|
* - `'popover'` (default) — template content, click trigger, dialog
|
|
181
283
|
* semantics.
|
|
182
|
-
* - `'tooltip'` — text content, hover
|
|
183
|
-
* `aria-describedby` on the host.
|
|
284
|
+
* - `'tooltip'` — text content, hover / keyboard-focus trigger,
|
|
285
|
+
* `role="tooltip"`, `aria-describedby` on the host.
|
|
184
286
|
*/
|
|
185
287
|
mode = input('popover', /* @ts-ignore */
|
|
186
288
|
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
187
289
|
/**
|
|
188
|
-
* How the popover opens. Ignored in tooltip mode —
|
|
189
|
-
*
|
|
290
|
+
* How the popover opens. Ignored in tooltip mode — a tooltip is always hover
|
|
291
|
+
* plus keyboard focus. @default 'click'
|
|
190
292
|
*/
|
|
191
293
|
trigger = input('click', /* @ts-ignore */
|
|
192
294
|
...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
|
|
@@ -217,6 +319,8 @@ class WrPopover {
|
|
|
217
319
|
/** Fires after the panel closes. */
|
|
218
320
|
closed = output();
|
|
219
321
|
host = inject(ElementRef);
|
|
322
|
+
focusMonitor = inject(FocusMonitor);
|
|
323
|
+
keystroke = inject(WrCurrentKeystroke);
|
|
220
324
|
overlay = inject(WR_OVERLAY);
|
|
221
325
|
dir = inject(Directionality, { optional: true });
|
|
222
326
|
outsideClick = inject(WrOutsideClick);
|
|
@@ -224,6 +328,7 @@ class WrPopover {
|
|
|
224
328
|
vcr = inject(ViewContainerRef);
|
|
225
329
|
scrollStrategies = inject(ScrollStrategyOptions);
|
|
226
330
|
destroyRef = inject(DestroyRef);
|
|
331
|
+
injector = inject(Injector);
|
|
227
332
|
/** @internal */
|
|
228
333
|
isOpen = signal(false, /* @ts-ignore */
|
|
229
334
|
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
@@ -237,6 +342,8 @@ class WrPopover {
|
|
|
237
342
|
...(ngDevMode ? [{ debugName: "resolvedPosition" }] : /* istanbul ignore next */ []));
|
|
238
343
|
overlayRef = null;
|
|
239
344
|
textPanelRef = null;
|
|
345
|
+
/** Whether the HOST itself holds focus — not a descendant of it. */
|
|
346
|
+
hostFocused = false;
|
|
240
347
|
hoverCloseTimer = null;
|
|
241
348
|
showTimer = null;
|
|
242
349
|
hideTimer = null;
|
|
@@ -259,9 +366,66 @@ class WrPopover {
|
|
|
259
366
|
const content = this.content();
|
|
260
367
|
this.textPanelRef?.setInput('text', typeof content === 'string' ? content : '');
|
|
261
368
|
});
|
|
369
|
+
// A tooltip answers the USER'S KEYBOARD, not every focus there is.
|
|
370
|
+
//
|
|
371
|
+
// `(focus)` fired for a programmatic one too, and something hands focus back
|
|
372
|
+
// to a trigger constantly: `WrDrawer` and `WrDialog` restore the element that
|
|
373
|
+
// was active when they opened, this directive does the same for its own
|
|
374
|
+
// popover, and any app may call `.focus()`. So closing a drawer opened from a
|
|
375
|
+
// button with a tooltip re-showed that tooltip with NOTHING left to dismiss
|
|
376
|
+
// it — the pointer is elsewhere, so no `mouseleave`, and focus stays on the
|
|
377
|
+
// button, so no blur. A pane stranded under the trigger, reported from a real
|
|
378
|
+
// app. The event alone cannot tell those apart; `FocusMonitor` is the CDK's
|
|
379
|
+
// answer to where a focus came from, and it is what Material's tooltip reads
|
|
380
|
+
// for the same reason. Mouse and touch origins are deliberately ignored:
|
|
381
|
+
// hover already drives both, and acting on them would show the tooltip twice
|
|
382
|
+
// over.
|
|
383
|
+
//
|
|
384
|
+
// The origin alone is NOT enough, though, and reading it as if it were leaves
|
|
385
|
+
// the reported bug half open: the CDK's `keyboard` means "a key went down
|
|
386
|
+
// within the last millisecond", and the dismissal that hands focus back is
|
|
387
|
+
// itself a keystroke — Escape on a drawer, Enter on its ✕. See
|
|
388
|
+
// `WrCurrentKeystroke` for the key that tells a navigation from a dismissal.
|
|
389
|
+
//
|
|
390
|
+
// Monitored in EVERY mode rather than only under `mode="tooltip"` — the mode
|
|
391
|
+
// is an input and may flip after this runs, and a subscription that only
|
|
392
|
+
// half-exists is the failure this fix is about. The handler asks instead. The
|
|
393
|
+
// cost is the CDK's own `cdk-*-focused` classes on the host, which nothing in
|
|
394
|
+
// ngwr styles.
|
|
395
|
+
//
|
|
396
|
+
// `afterNextRender` because monitoring binds document listeners: there is no
|
|
397
|
+
// DOM to bind them to on the server.
|
|
398
|
+
afterNextRender(() => {
|
|
399
|
+
this.focusMonitor
|
|
400
|
+
.monitor(this.host)
|
|
401
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
402
|
+
.subscribe(origin => {
|
|
403
|
+
if (origin) {
|
|
404
|
+
this.hostFocused = true;
|
|
405
|
+
if (this.isTooltip() && origin === 'keyboard' && this.fromNavigationKey())
|
|
406
|
+
this.scheduleShow();
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
// A null origin is a blur, and the CDK reports one for a DESCENDANT
|
|
410
|
+
// too: `_onFocus` bails when the event target is not the monitored
|
|
411
|
+
// element, `_onBlur` has no such guard. The old `(blur)` binding never
|
|
412
|
+
// bubbled, so hiding on one is new — hover a wrapper, click the button
|
|
413
|
+
// inside it, tab away, and the tooltip the POINTER opened vanished
|
|
414
|
+
// while the pointer never moved. Only the host's own focus counts.
|
|
415
|
+
if (!this.hostFocused)
|
|
416
|
+
return;
|
|
417
|
+
this.hostFocused = false;
|
|
418
|
+
if (this.isTooltip())
|
|
419
|
+
this.scheduleHide();
|
|
420
|
+
});
|
|
421
|
+
});
|
|
262
422
|
this.destroyRef.onDestroy(() => {
|
|
263
423
|
this.clearTimers();
|
|
264
|
-
this.closeOverlay();
|
|
424
|
+
this.closeOverlay(false);
|
|
425
|
+
// Completes the subject `monitor()` handed out and drops the global
|
|
426
|
+
// listeners it registered for this element; the pipe above unsubscribes
|
|
427
|
+
// either way, but the CDK's own bookkeeping only clears from here.
|
|
428
|
+
this.focusMonitor.stopMonitoring(this.host);
|
|
265
429
|
});
|
|
266
430
|
}
|
|
267
431
|
open() {
|
|
@@ -314,24 +478,34 @@ class WrPopover {
|
|
|
314
478
|
this.scheduleHoverClose();
|
|
315
479
|
}
|
|
316
480
|
/** @internal */
|
|
317
|
-
onFocus() {
|
|
318
|
-
if (!this.isTooltip())
|
|
319
|
-
return;
|
|
320
|
-
this.scheduleShow();
|
|
321
|
-
}
|
|
322
|
-
/** @internal */
|
|
323
|
-
onBlur() {
|
|
324
|
-
if (!this.isTooltip())
|
|
325
|
-
return;
|
|
326
|
-
this.scheduleHide();
|
|
327
|
-
}
|
|
328
|
-
/** @internal */
|
|
329
481
|
onEscape() {
|
|
330
482
|
if (!this.isTooltip())
|
|
331
483
|
return;
|
|
332
484
|
this.clearTimers();
|
|
333
485
|
this.isOpen.set(false);
|
|
334
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Whether the keystroke in flight is one the user moves focus with.
|
|
489
|
+
*
|
|
490
|
+
* Asked only of a `keyboard` origin, which the CDK grants to any focus landing
|
|
491
|
+
* within a millisecond of a keydown — including the hand-back a drawer
|
|
492
|
+
* performs while Escape is still being handled. That is the reported bug's
|
|
493
|
+
* keyboard half, and the origin cannot see it.
|
|
494
|
+
*
|
|
495
|
+
* NO key on record answers `true`, and that polarity is chosen rather than
|
|
496
|
+
* inherited: a keyboard modality with no keystroke behind it is a screen
|
|
497
|
+
* reader's virtual cursor (the CDK reads its synthetic mousedown as
|
|
498
|
+
* `keyboard`) or a deliberate `focusVia(el, 'keyboard')`, and both are the
|
|
499
|
+
* user. Refusing wants positive evidence of a key that does something other
|
|
500
|
+
* than navigate — silence must not cost an AT user the hint. The two windows
|
|
501
|
+
* are aligned so that "keyboard origin, no key" cannot mean "the key just
|
|
502
|
+
* expired"; what it does still admit is a `FocusMonitorDetectionMode.EVENTUAL`
|
|
503
|
+
* app, where the CDK never expires an origin at all.
|
|
504
|
+
*/
|
|
505
|
+
fromNavigationKey() {
|
|
506
|
+
const key = this.keystroke.key;
|
|
507
|
+
return key === null || NAVIGATION_KEYS.has(key);
|
|
508
|
+
}
|
|
335
509
|
// Tooltip timers
|
|
336
510
|
scheduleShow() {
|
|
337
511
|
if (this.isOpen()) {
|
|
@@ -369,13 +543,17 @@ class WrPopover {
|
|
|
369
543
|
// from the trigger and slide the panel up from the bottom edge.
|
|
370
544
|
const asSheet = !tooltip && wrPresentAsSheet(this.responsive(), this.responsiveConfig);
|
|
371
545
|
const paneClass = tooltip ? 'wr-tooltip-overlay' : 'wr-popover-overlay';
|
|
372
|
-
|
|
373
|
-
|
|
546
|
+
// Kept as its own binding rather than inlined into the ternary: it is the
|
|
547
|
+
// half a direction flip has to rebuild, and a sheet — anchored to nothing —
|
|
548
|
+
// has no list at all, which is what `null` says here.
|
|
549
|
+
const connected = asSheet
|
|
550
|
+
? null
|
|
374
551
|
: this.overlay
|
|
375
552
|
.position()
|
|
376
553
|
.flexibleConnectedTo(this.host)
|
|
377
554
|
.withPositions(wrMirrorOffsets(wrPopoverPositions(position, paneClass), this.isRtl()))
|
|
378
555
|
.withPush(true);
|
|
556
|
+
const positionStrategy = connected ?? this.overlay.position().global().centerHorizontally().bottom('0');
|
|
379
557
|
// The `--<placement>` half is no longer set here: each fallback position
|
|
380
558
|
// carries its own, so the pane names the placement it landed on instead of
|
|
381
559
|
// the one that was requested, and the arrow follows a flip. A sheet has no
|
|
@@ -389,6 +567,15 @@ class WrPopover {
|
|
|
389
567
|
backdropClass: asSheet ? 'wr-overlay-backdrop' : undefined,
|
|
390
568
|
panelClass: overlayClass,
|
|
391
569
|
});
|
|
570
|
+
// The CDK read the direction once, just now, and will never look again — so
|
|
571
|
+
// an app that flips while this panel is up mirrors the page around a pane
|
|
572
|
+
// still rendering `ltr`, with `wr-segmented` and friends inside it already
|
|
573
|
+
// laying themselves out the other way. Rebuilding the list matters as much
|
|
574
|
+
// as the attribute: `wrMirrorOffsets` turned the 8px gap around at open, and
|
|
575
|
+
// an unmirrored offset puts a side-placed panel back on top of its trigger.
|
|
576
|
+
// A sheet has no list, and `connected?.` is what says so — the arguments are
|
|
577
|
+
// never evaluated for one.
|
|
578
|
+
wrFollowDirection(this.overlayRef, this.dir, this.injector, direction => connected?.withPositions(wrMirrorOffsets(wrPopoverPositions(position, paneClass), direction === 'rtl')));
|
|
392
579
|
if (asSheet) {
|
|
393
580
|
this.overlayRef
|
|
394
581
|
.backdropClick()
|
|
@@ -469,7 +656,23 @@ class WrPopover {
|
|
|
469
656
|
}
|
|
470
657
|
this.opened.emit();
|
|
471
658
|
}
|
|
472
|
-
|
|
659
|
+
/**
|
|
660
|
+
* Tear the overlay down, and tell the host — unless the host is going away
|
|
661
|
+
* with it.
|
|
662
|
+
*
|
|
663
|
+
* `notify: false` is the DESTROY path, and it is not a nicety. An `output()`
|
|
664
|
+
* belongs to the view that declares it, so emitting from `onDestroy` is
|
|
665
|
+
* refused: Angular logs `NG0953: Unexpected emit for destroyed OutputRef` and
|
|
666
|
+
* the listener never runs. Measured — a `(closed)` handler on a dropdown whose
|
|
667
|
+
* host view is removed while the menu is open fired zero times and left a
|
|
668
|
+
* console error behind. There is nobody to notify at that point, because the
|
|
669
|
+
* consumer's own view is being torn down in the same pass; `wr-popconfirm`
|
|
670
|
+
* already disposes without emitting, and this brings the other two into line.
|
|
671
|
+
*
|
|
672
|
+
* The focus hand-back is skipped for the same reason — the host element is on
|
|
673
|
+
* its way out of the document.
|
|
674
|
+
*/
|
|
675
|
+
closeOverlay(notify = true) {
|
|
473
676
|
if (!this.overlayRef)
|
|
474
677
|
return;
|
|
475
678
|
if (this.isTooltip() || this.trigger() === 'hover') {
|
|
@@ -493,9 +696,11 @@ class WrPopover {
|
|
|
493
696
|
this.overlayRef = null;
|
|
494
697
|
// Disposing destroys the panel component; a retained ref would pin its view.
|
|
495
698
|
this.textPanelRef = null;
|
|
496
|
-
if (
|
|
497
|
-
|
|
498
|
-
|
|
699
|
+
if (notify) {
|
|
700
|
+
if (focusWasInside)
|
|
701
|
+
this.host.nativeElement.focus();
|
|
702
|
+
this.closed.emit();
|
|
703
|
+
}
|
|
499
704
|
}
|
|
500
705
|
onOverlayLeave = (event) => {
|
|
501
706
|
const related = event.relatedTarget;
|
|
@@ -536,10 +741,10 @@ class WrPopover {
|
|
|
536
741
|
isRtl() {
|
|
537
742
|
return this.dir?.value === 'rtl';
|
|
538
743
|
}
|
|
539
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
540
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.
|
|
744
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopover, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
745
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: WrPopover, isStandalone: true, selector: "[wrPopover]", inputs: { content: { classPropertyName: "content", publicName: "wrPopover", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "showDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "hideDelay", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, host: { listeners: { "click": "onClick($event)", "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave($event)", "keydown.escape": "onEscape()" }, properties: { "attr.aria-haspopup": "isTooltip() ? null : \"dialog\"", "attr.aria-expanded": "isTooltip() ? null : isOpen()", "attr.aria-controls": "!isTooltip() && isOpen() ? panelId : null", "attr.aria-describedby": "isTooltip() && isOpen() ? panelId : null" }, classAttribute: "wr-popover-trigger" }, exportAs: ["wrPopover"], ngImport: i0 });
|
|
541
746
|
}
|
|
542
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
747
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopover, decorators: [{
|
|
543
748
|
type: Directive,
|
|
544
749
|
args: [{
|
|
545
750
|
selector: '[wrPopover]',
|
|
@@ -558,8 +763,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
558
763
|
'(click)': 'onClick($event)',
|
|
559
764
|
'(mouseenter)': 'onMouseEnter()',
|
|
560
765
|
'(mouseleave)': 'onMouseLeave($event)',
|
|
561
|
-
|
|
562
|
-
|
|
766
|
+
// No `(focus)` / `(blur)` here: a tooltip answers the KEYBOARD, and a plain
|
|
767
|
+
// focus event cannot say where the focus came from. `FocusMonitor` can — see
|
|
768
|
+
// the constructor.
|
|
563
769
|
'(keydown.escape)': 'onEscape()',
|
|
564
770
|
},
|
|
565
771
|
}]
|