ngwr 10.2.1 → 11.1.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 +39 -19
- package/action-sheet/styles/_index.scss +4 -1
- package/anchor/styles/_index.scss +6 -5
- package/back-top/styles/_index.scss +6 -1
- package/blur-text/styles/_index.scss +13 -0
- package/button/styles/_index.scss +11 -6
- package/calendar/styles/_index.scss +11 -2
- package/carousel/styles/_index.scss +13 -2
- package/cascader/styles/_index.scss +5 -3
- package/circular-text/styles/_index.scss +2 -0
- package/collapse/styles/_index.scss +1 -1
- package/color-picker/styles/_index.scss +6 -1
- package/command-palette/styles/_index.scss +2 -1
- package/compare/styles/_index.scss +1 -2
- package/context-menu/styles/_index.scss +8 -2
- package/descriptions/styles/_index.scss +2 -2
- package/dialog/styles/_index.scss +7 -0
- package/drawer/styles/_index.scss +20 -1
- package/dropdown/styles/_index.scss +19 -5
- package/empty/styles/_index.scss +10 -0
- package/falling-text/styles/_index.scss +2 -1
- package/fesm2022/ngwr-action-sheet.mjs +13 -3
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-affix.mjs +40 -13
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +18 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-aurora.mjs +2 -2
- package/fesm2022/ngwr-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +31 -7
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +6 -2
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +1 -1
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +30 -9
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +2 -2
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +2 -2
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +9 -4
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button-testing.mjs +96 -0
- package/fesm2022/ngwr-button-testing.mjs.map +1 -0
- package/fesm2022/ngwr-button.mjs +31 -14
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +40 -8
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +20 -1
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +2 -2
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +377 -0
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
- package/fesm2022/ngwr-carousel.mjs +67 -13
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs +534 -0
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
- package/fesm2022/ngwr-cascader.mjs +2 -2
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
- package/fesm2022/ngwr-checkbox.mjs +9 -3
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +2 -2
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +2 -2
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-collapse-testing.mjs +368 -0
- package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
- package/fesm2022/ngwr-color-picker.mjs +134 -14
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
- package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
- package/fesm2022/ngwr-command-palette.mjs +58 -8
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +103 -13
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs +106 -0
- package/fesm2022/ngwr-config.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu.mjs +94 -8
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +5 -1
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +11 -3
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter-luxon.mjs +52 -4
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter.mjs +54 -8
- package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker.mjs +73 -3
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +27 -9
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +89 -0
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
- package/fesm2022/ngwr-directives.mjs +36 -12
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +22 -5
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer-testing.mjs +250 -0
- package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown.mjs +10 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +24 -7
- package/fesm2022/ngwr-empty.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +57 -10
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +2 -2
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form-testing.mjs +451 -0
- package/fesm2022/ngwr-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form.mjs +19 -3
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +9 -2
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +19 -5
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +2 -2
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +2 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +50 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +48 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +23 -0
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs +306 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-number.mjs +35 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-otp.mjs +36 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +102 -0
- package/fesm2022/ngwr-input-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input.mjs +47 -10
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +44 -8
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +21 -5
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +33 -6
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +17 -4
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown-testing.mjs +516 -0
- package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-markdown.mjs +1492 -0
- package/fesm2022/ngwr-markdown.mjs.map +1 -0
- package/fesm2022/ngwr-marquee.mjs +17 -6
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-mention-testing.mjs +513 -0
- package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
- package/fesm2022/ngwr-mention.mjs +10 -1
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +22 -7
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +19 -5
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +41 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +389 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pagination.mjs +14 -2
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popconfirm.mjs +95 -17
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +316 -0
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popover.mjs +21 -3
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +17 -2
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +13 -3
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio-testing.mjs +392 -0
- package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
- package/fesm2022/ngwr-radio.mjs +10 -3
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating-testing.mjs +384 -0
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
- package/fesm2022/ngwr-rating.mjs +37 -2
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-segmented-testing.mjs +512 -0
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select-testing.mjs +268 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select.mjs +87 -16
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +2 -2
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +65 -12
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +478 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
- package/fesm2022/ngwr-slider.mjs +57 -13
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +26 -6
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +37 -4
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +12 -3
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +2 -2
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-split-text.mjs +2 -2
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +70 -9
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +2 -2
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +2 -2
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +24 -7
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs +477 -0
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch-testing.mjs +77 -0
- package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch.mjs +9 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +580 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -0
- package/fesm2022/ngwr-table.mjs +87 -14
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +617 -0
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tabs.mjs +38 -6
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +238 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
- package/fesm2022/ngwr-textarea.mjs +32 -4
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +2 -2
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +101 -0
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
- package/fesm2022/ngwr-toast.mjs +2 -2
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +61 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs +538 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-transfer.mjs +45 -14
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +734 -0
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +73 -7
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +5 -3
- package/fesm2022/ngwr-typewriter.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 +31 -5
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +3 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +8 -0
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +7 -2
- package/gauge/styles/_index.scss +1 -1
- package/glitch-text/styles/_index.scss +4 -0
- package/i18n/en.json +48 -0
- package/i18n/ru.json +48 -0
- package/image-cropper/styles/_index.scss +13 -1
- package/input/styles/_index.scss +2 -2
- package/input-number/styles/_index.scss +7 -2
- package/knob/styles/_index.scss +8 -1
- package/layout/styles/_index.scss +3 -3
- package/lightbox/styles/_index.scss +10 -2
- package/line-chart/styles/_index.scss +6 -0
- package/llms-full.txt +151 -4
- package/llms.txt +57 -8
- package/loading-bar/styles/_index.scss +1 -2
- package/markdown/styles/_index.scss +296 -0
- package/marquee/styles/_index.scss +12 -0
- package/mcp/api.js +512 -0
- package/mcp/catalog.js +157 -0
- package/mcp/server.js +273 -0
- package/mcp/tools.js +366 -0
- package/meter-group/styles/_index.scss +1 -1
- package/package.json +186 -35
- package/pagination/styles/_index.scss +6 -6
- package/popover/styles/_index.scss +37 -5
- package/rating/styles/_index.scss +10 -0
- package/result/styles/_index.scss +3 -1
- package/schematics/use/symbol-map.json +2 -0
- package/segmented/styles/_index.scss +12 -1
- package/select/styles/_index.scss +32 -10
- package/sidebar/styles/_index.scss +30 -5
- package/slider/styles/_index.scss +15 -0
- package/speed-dial/styles/_index.scss +20 -0
- package/split-text/styles/_index.scss +13 -0
- package/star-border/styles/_index.scss +2 -0
- package/stepper/styles/_index.scss +19 -3
- package/styles/_grid.scss +4 -4
- package/styles.scss +1 -0
- package/switch/styles/_index.scss +5 -3
- package/table/styles/_index.scss +25 -12
- package/tabs/styles/_index.scss +11 -1
- package/textarea/styles/_index.scss +5 -0
- package/theme/styles/_colors.scss +44 -15
- package/theme/styles/_dark.scss +35 -15
- package/theme/styles/_mixins.scss +3 -0
- package/timeline/styles/_index.scss +2 -2
- package/toast/styles/_index.scss +17 -8
- package/toolbar/styles/_index.scss +3 -3
- package/tour/styles/_index.scss +7 -1
- package/tree/styles/_index.scss +9 -5
- package/types/ngwr-action-sheet.d.ts +9 -1
- package/types/ngwr-affix.d.ts +7 -1
- package/types/ngwr-anchor.d.ts +8 -1
- package/types/ngwr-avatar.d.ts +13 -3
- package/types/ngwr-bar-chart.d.ts +16 -0
- package/types/ngwr-burger.d.ts +6 -2
- package/types/ngwr-button-testing.d.ts +85 -0
- package/types/ngwr-button.d.ts +26 -10
- package/types/ngwr-calendar-heatmap.d.ts +16 -2
- package/types/ngwr-calendar.d.ts +10 -0
- package/types/ngwr-carousel-testing.d.ts +257 -0
- package/types/ngwr-carousel.d.ts +20 -4
- package/types/ngwr-cascader-testing.d.ts +392 -0
- package/types/ngwr-checkbox-testing.d.ts +77 -0
- package/types/ngwr-checkbox.d.ts +7 -2
- package/types/ngwr-collapse-testing.d.ts +290 -0
- package/types/ngwr-color-picker.d.ts +20 -11
- package/types/ngwr-command-palette-testing.d.ts +437 -0
- package/types/ngwr-command-palette.d.ts +25 -2
- package/types/ngwr-compare.d.ts +50 -2
- package/types/ngwr-config.d.ts +176 -0
- package/types/ngwr-context-menu-testing.d.ts +401 -0
- package/types/ngwr-context-menu.d.ts +65 -17
- package/types/ngwr-counter.d.ts +6 -1
- package/types/ngwr-date-adapter-luxon.d.ts +26 -0
- package/types/ngwr-date-picker-testing.d.ts +518 -0
- package/types/ngwr-date-picker.d.ts +4 -0
- package/types/ngwr-dialog-testing.d.ts +79 -0
- package/types/ngwr-directives.d.ts +10 -1
- package/types/ngwr-donut-chart.d.ts +8 -1
- package/types/ngwr-drawer-testing.d.ts +196 -0
- package/types/ngwr-dropdown-testing.d.ts +202 -0
- package/types/ngwr-dropdown.d.ts +7 -1
- package/types/ngwr-empty.d.ts +19 -4
- package/types/ngwr-event-calendar.d.ts +26 -1
- package/types/ngwr-file-upload-testing.d.ts +194 -0
- package/types/ngwr-form-testing.d.ts +379 -0
- package/types/ngwr-form.d.ts +17 -0
- package/types/ngwr-gauge.d.ts +13 -1
- package/types/ngwr-image-cropper.d.ts +10 -0
- package/types/ngwr-input-number-testing.d.ts +226 -0
- package/types/ngwr-input-number.d.ts +29 -1
- package/types/ngwr-input-otp-testing.d.ts +299 -0
- package/types/ngwr-input-otp.d.ts +23 -2
- package/types/ngwr-input-testing.d.ts +84 -0
- package/types/ngwr-input.d.ts +20 -6
- package/types/ngwr-knob.d.ts +18 -0
- package/types/ngwr-layout.d.ts +1 -0
- package/types/ngwr-lightbox.d.ts +17 -3
- package/types/ngwr-line-chart.d.ts +9 -2
- package/types/ngwr-markdown-testing.d.ts +462 -0
- package/types/ngwr-markdown.d.ts +534 -0
- package/types/ngwr-marquee.d.ts +12 -2
- package/types/ngwr-mention-testing.d.ts +359 -0
- package/types/ngwr-meta.d.ts +4 -2
- package/types/ngwr-meter-group.d.ts +11 -1
- package/types/ngwr-overlay.d.ts +33 -2
- package/types/ngwr-pagination-testing.d.ts +291 -0
- package/types/ngwr-pagination.d.ts +1 -0
- package/types/ngwr-popconfirm-testing.d.ts +235 -0
- package/types/ngwr-popconfirm.d.ts +31 -21
- package/types/ngwr-popover-testing.d.ts +221 -0
- package/types/ngwr-popover.d.ts +9 -0
- package/types/ngwr-pull-to-refresh.d.ts +7 -0
- package/types/ngwr-qr.d.ts +9 -1
- package/types/ngwr-radio-testing.d.ts +296 -0
- package/types/ngwr-radio.d.ts +8 -2
- package/types/ngwr-rating-testing.d.ts +291 -0
- package/types/ngwr-rating.d.ts +23 -0
- package/types/ngwr-segmented-testing.d.ts +401 -0
- package/types/ngwr-select-testing.d.ts +175 -0
- package/types/ngwr-select.d.ts +45 -4
- package/types/ngwr-sidebar.d.ts +17 -2
- package/types/ngwr-slider-testing.d.ts +329 -0
- package/types/ngwr-slider.d.ts +35 -1
- package/types/ngwr-sparkline.d.ts +12 -2
- package/types/ngwr-speed-dial.d.ts +17 -18
- package/types/ngwr-spinner.d.ts +8 -1
- package/types/ngwr-splitter.d.ts +24 -1
- package/types/ngwr-statistic.d.ts +12 -2
- package/types/ngwr-stepper-testing.d.ts +346 -0
- package/types/ngwr-switch-testing.d.ts +66 -0
- package/types/ngwr-switch.d.ts +7 -2
- package/types/ngwr-table-testing.d.ts +423 -0
- package/types/ngwr-table.d.ts +42 -0
- package/types/ngwr-tabs-testing.d.ts +470 -0
- package/types/ngwr-tabs.d.ts +9 -0
- package/types/ngwr-textarea-testing.d.ts +184 -0
- package/types/ngwr-textarea.d.ts +7 -2
- package/types/ngwr-toast-testing.d.ts +80 -0
- package/types/ngwr-tour.d.ts +27 -0
- package/types/ngwr-transfer-testing.d.ts +444 -0
- package/types/ngwr-transfer.d.ts +16 -1
- package/types/ngwr-tree-testing.d.ts +501 -0
- package/types/ngwr-tree.d.ts +33 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-virtual-scroll.d.ts +13 -1
- package/typewriter/styles/_index.scss +1 -1
- package/typography/styles/_index.scss +1 -1
- package/window/styles/_index.scss +32 -9
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
1
2
|
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
2
3
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
3
4
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { input, output, ViewEncapsulation, Component, inject, ElementRef, ViewContainerRef, DestroyRef, Directive } from '@angular/core';
|
|
5
|
+
import { input, output, ViewEncapsulation, Component, inject, ElementRef, ViewContainerRef, DestroyRef, signal, Directive } from '@angular/core';
|
|
5
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
-
import {
|
|
7
|
+
import { useI18nText } from 'ngwr/i18n';
|
|
8
|
+
import { WR_OVERLAY, WrOutsideClick, wrMirrorOffsets } from 'ngwr/overlay';
|
|
7
9
|
import { WrButton } from 'ngwr/button';
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -35,6 +37,9 @@ const WR_POPCONFIRM_POSITIONS = {
|
|
|
35
37
|
class WrPopconfirmPanel {
|
|
36
38
|
message = input.required(/* @ts-ignore */
|
|
37
39
|
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
40
|
+
/** Id the anchoring directive points `aria-describedby` at. */
|
|
41
|
+
messageId = input(null, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "messageId" }] : /* istanbul ignore next */ []));
|
|
38
43
|
confirmText = input('Confirm', /* @ts-ignore */
|
|
39
44
|
...(ngDevMode ? [{ debugName: "confirmText" }] : /* istanbul ignore next */ []));
|
|
40
45
|
cancelText = input('Cancel', /* @ts-ignore */
|
|
@@ -44,12 +49,12 @@ class WrPopconfirmPanel {
|
|
|
44
49
|
confirmed = output();
|
|
45
50
|
cancelled = output();
|
|
46
51
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrPopconfirmPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.1", type: WrPopconfirmPanel, isStandalone: true, selector: "wr-popconfirm", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { classAttribute: "wr-popconfirm" }, ngImport: i0, template: "<p class=\"wr-popconfirm__message\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn size=\"sm\" (click)=\"cancelled.emit()\"
|
|
52
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.1", type: WrPopconfirmPanel, isStandalone: true, selector: "wr-popconfirm", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, messageId: { classPropertyName: "messageId", publicName: "messageId", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { classAttribute: "wr-popconfirm" }, ngImport: i0, template: "<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n", dependencies: [{ kind: "component", type: WrButton, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: ["color", "size", "shape", "icon", "iconPosition", "disabled", "outlined", "block", "loading", "isDisabledWhenLoading"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
48
53
|
}
|
|
49
54
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrPopconfirmPanel, decorators: [{
|
|
50
55
|
type: Component,
|
|
51
|
-
args: [{ selector: 'wr-popconfirm', encapsulation: ViewEncapsulation.None, host: { class: 'wr-popconfirm' }, imports: [WrButton], template: "<p class=\"wr-popconfirm__message\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn size=\"sm\" (click)=\"cancelled.emit()\"
|
|
52
|
-
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], confirmColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmColor", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
56
|
+
args: [{ selector: 'wr-popconfirm', encapsulation: ViewEncapsulation.None, host: { class: 'wr-popconfirm' }, imports: [WrButton], template: "<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n" }]
|
|
57
|
+
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], messageId: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageId", required: false }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], confirmColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmColor", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
53
58
|
|
|
54
59
|
/**
|
|
55
60
|
* @license
|
|
@@ -74,6 +79,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
74
79
|
*
|
|
75
80
|
* @see https://ngwr.dev/reference/components/popconfirm
|
|
76
81
|
*/
|
|
82
|
+
let popconfirmUid = 0;
|
|
77
83
|
class WrPopconfirm {
|
|
78
84
|
/** Confirmation message. */
|
|
79
85
|
message = input.required({ ...(ngDevMode ? { debugName: "message" } : /* istanbul ignore next */ {}), alias: 'wrPopconfirm' });
|
|
@@ -81,11 +87,25 @@ class WrPopconfirm {
|
|
|
81
87
|
position = input('top', /* @ts-ignore */
|
|
82
88
|
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
83
89
|
/** Label for the confirm button. @default 'Confirm' */
|
|
84
|
-
|
|
90
|
+
/** Confirm button text. Falls back to `popconfirm.confirm`. */
|
|
91
|
+
confirmText = input(null, /* @ts-ignore */
|
|
85
92
|
...(ngDevMode ? [{ debugName: "confirmText" }] : /* istanbul ignore next */ []));
|
|
86
93
|
/** Label for the cancel button. @default 'Cancel' */
|
|
87
|
-
|
|
94
|
+
/** Cancel button text. Falls back to `popconfirm.cancel`. */
|
|
95
|
+
cancelText = input(null, /* @ts-ignore */
|
|
88
96
|
...(ngDevMode ? [{ debugName: "cancelText" }] : /* istanbul ignore next */ []));
|
|
97
|
+
/**
|
|
98
|
+
* Accessible name of the confirmation dialog. `role="dialog"` with no name
|
|
99
|
+
* announces as a bare "dialog". Falls back to `popconfirm.label`.
|
|
100
|
+
*/
|
|
101
|
+
ariaLabel = input(null, /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
103
|
+
// The catalog has carried these translated for as long as the component has
|
|
104
|
+
// existed; the labels were hard-coded English defaults, so a localized app got
|
|
105
|
+
// English buttons with the right strings sitting one file away.
|
|
106
|
+
resolvedConfirm = useI18nText(this.confirmText, 'popconfirm.confirm', 'Confirm');
|
|
107
|
+
resolvedCancel = useI18nText(this.cancelText, 'popconfirm.cancel', 'Cancel');
|
|
108
|
+
resolvedAriaLabel = useI18nText(this.ariaLabel, 'popconfirm.label', 'Confirm action');
|
|
89
109
|
/** Color of the confirm button. @default 'primary' */
|
|
90
110
|
confirmColor = input('primary', /* @ts-ignore */
|
|
91
111
|
...(ngDevMode ? [{ debugName: "confirmColor" }] : /* istanbul ignore next */ []));
|
|
@@ -95,11 +115,19 @@ class WrPopconfirm {
|
|
|
95
115
|
cancelled = output();
|
|
96
116
|
host = inject(ElementRef);
|
|
97
117
|
overlay = inject(WR_OVERLAY);
|
|
118
|
+
dir = inject(Directionality, { optional: true });
|
|
98
119
|
outsideClick = inject(WrOutsideClick);
|
|
99
120
|
vcr = inject(ViewContainerRef);
|
|
100
121
|
scrollStrategies = inject(ScrollStrategyOptions);
|
|
101
122
|
destroyRef = inject(DestroyRef);
|
|
123
|
+
/** @internal Public so the host bindings can read it. */
|
|
124
|
+
isOpen = signal(false, /* @ts-ignore */
|
|
125
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
102
126
|
overlayRef = null;
|
|
127
|
+
uid = ++popconfirmUid;
|
|
128
|
+
/** @internal Public so the host binding can read it. */
|
|
129
|
+
panelId = `wr-popconfirm-${this.uid}`;
|
|
130
|
+
messageId = `wr-popconfirm-message-${this.uid}`;
|
|
103
131
|
constructor() {
|
|
104
132
|
this.destroyRef.onDestroy(() => this.dispose());
|
|
105
133
|
}
|
|
@@ -119,19 +147,38 @@ class WrPopconfirm {
|
|
|
119
147
|
const positionStrategy = this.overlay
|
|
120
148
|
.position()
|
|
121
149
|
.flexibleConnectedTo(this.host)
|
|
122
|
-
.withPositions(WR_POPCONFIRM_POSITIONS[this.position()])
|
|
150
|
+
.withPositions(wrMirrorOffsets(WR_POPCONFIRM_POSITIONS[this.position()], this.isRtl()))
|
|
123
151
|
.withPush(true);
|
|
124
152
|
this.overlayRef = this.overlay.create({
|
|
125
153
|
positionStrategy,
|
|
126
154
|
scrollStrategy: this.scrollStrategies.reposition(),
|
|
127
155
|
panelClass: ['wr-popconfirm-overlay', `wr-popconfirm-overlay--${this.position()}`],
|
|
128
156
|
});
|
|
157
|
+
// Non-modal by choice, like `wr-popover`: an outside click or Escape closes it,
|
|
158
|
+
// so trapping focus would only make it harder to leave. It still needs a role, a
|
|
159
|
+
// name and the question read out as its description.
|
|
160
|
+
const pane = this.overlayRef.overlayElement;
|
|
161
|
+
pane.id = this.panelId;
|
|
162
|
+
pane.setAttribute('role', 'dialog');
|
|
163
|
+
pane.setAttribute('aria-modal', 'false');
|
|
164
|
+
pane.setAttribute('aria-label', this.resolvedAriaLabel());
|
|
165
|
+
pane.setAttribute('aria-describedby', this.messageId);
|
|
129
166
|
const portal = new ComponentPortal(WrPopconfirmPanel, this.vcr);
|
|
130
167
|
const ref = this.overlayRef.attach(portal);
|
|
131
168
|
ref.setInput('message', this.message());
|
|
132
|
-
ref.setInput('
|
|
133
|
-
ref.setInput('
|
|
169
|
+
ref.setInput('messageId', this.messageId);
|
|
170
|
+
ref.setInput('confirmText', this.resolvedConfirm());
|
|
171
|
+
ref.setInput('cancelText', this.resolvedCancel());
|
|
134
172
|
ref.setInput('confirmColor', this.confirmColor());
|
|
173
|
+
// Render now rather than next frame: the buttons have to exist before focus can
|
|
174
|
+
// move to one, and a deferred focus is the class of bug this repo keeps finding.
|
|
175
|
+
ref.changeDetectorRef.detectChanges();
|
|
176
|
+
// Focus has to enter the panel — the overlay container sits at the end of
|
|
177
|
+
// `<body>`, so Tab from the trigger went to the next thing on the PAGE and the
|
|
178
|
+
// only way to confirm was unreachable. Cancel first: the action being confirmed
|
|
179
|
+
// is usually the destructive one.
|
|
180
|
+
pane.querySelector('.wr-popconfirm__actions wr-btn')?.focus();
|
|
181
|
+
this.isOpen.set(true);
|
|
135
182
|
ref.instance.confirmed.subscribe(() => {
|
|
136
183
|
this.confirmed.emit();
|
|
137
184
|
this.close();
|
|
@@ -165,21 +212,52 @@ class WrPopconfirm {
|
|
|
165
212
|
this.dispose();
|
|
166
213
|
}
|
|
167
214
|
dispose() {
|
|
168
|
-
if (this.overlayRef)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
215
|
+
if (!this.overlayRef)
|
|
216
|
+
return;
|
|
217
|
+
// Focus lives inside the panel while it is open, and removing the panel would
|
|
218
|
+
// drop it to `<body>` — hand it back to the trigger instead, as `wr-dropdown`
|
|
219
|
+
// does on Escape. Only when focus is still IN there: if the user has already
|
|
220
|
+
// clicked elsewhere, taking it back would be stealing.
|
|
221
|
+
const returnFocus = this.overlayRef.overlayElement.contains(document.activeElement);
|
|
222
|
+
this.overlayRef.dispose();
|
|
223
|
+
this.overlayRef = null;
|
|
224
|
+
this.isOpen.set(false);
|
|
225
|
+
if (returnFocus)
|
|
226
|
+
this.host.nativeElement.focus();
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Whether the app reads right-to-left.
|
|
230
|
+
*
|
|
231
|
+
* Optional inject: `Directionality` is root-provided, so this is never null in
|
|
232
|
+
* an app — but a bare `TestBed` that provides nothing should still get a
|
|
233
|
+
* component that works, and defaulting to LTR is the honest fallback.
|
|
234
|
+
*/
|
|
235
|
+
isRtl() {
|
|
236
|
+
return this.dir?.value === 'rtl';
|
|
172
237
|
}
|
|
173
238
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrPopconfirm, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
174
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: WrPopconfirm, isStandalone: true, selector: "[wrPopconfirm]", inputs: { message: { classPropertyName: "message", publicName: "wrPopconfirm", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { listeners: { "click": "toggle($event)" } }, ngImport: i0 });
|
|
239
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: WrPopconfirm, isStandalone: true, selector: "[wrPopconfirm]", inputs: { message: { classPropertyName: "message", publicName: "wrPopconfirm", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { listeners: { "click": "toggle($event)" }, properties: { "attr.aria-haspopup": "\"dialog\"", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "isOpen() ? panelId : null" }, classAttribute: "wr-popconfirm-trigger" }, ngImport: i0 });
|
|
175
240
|
}
|
|
176
241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrPopconfirm, decorators: [{
|
|
177
242
|
type: Directive,
|
|
178
243
|
args: [{
|
|
179
244
|
selector: '[wrPopconfirm]',
|
|
180
|
-
host: {
|
|
245
|
+
host: {
|
|
246
|
+
// Marks the trigger the way `[wrPopover]` and `[wrDropdown]` mark theirs. The
|
|
247
|
+
// question is normally BOUND (`[wrPopconfirm]="question"`), which leaves no
|
|
248
|
+
// attribute in the DOM at all, so without this there is nothing to find a
|
|
249
|
+
// trigger by once the panel is shut.
|
|
250
|
+
class: 'wr-popconfirm-trigger',
|
|
251
|
+
'(click)': 'toggle($event)',
|
|
252
|
+
'[attr.aria-haspopup]': '"dialog"',
|
|
253
|
+
'[attr.aria-expanded]': 'isOpen()',
|
|
254
|
+
// Names the dialog this trigger opened, as every other overlay trigger in the
|
|
255
|
+
// catalog does. `aria-haspopup="dialog"` promises a dialog and `aria-expanded`
|
|
256
|
+
// says it is showing; without the id, which one is left to guess.
|
|
257
|
+
'[attr.aria-controls]': 'isOpen() ? panelId : null',
|
|
258
|
+
},
|
|
181
259
|
}]
|
|
182
|
-
}], ctorParameters: () => [], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrPopconfirm", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], confirmColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmColor", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
260
|
+
}], ctorParameters: () => [], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrPopconfirm", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], confirmColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmColor", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
183
261
|
|
|
184
262
|
/**
|
|
185
263
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-popconfirm.mjs","sources":["../../../projects/lib/popconfirm/interfaces/popconfirm-position.ts","../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/popconfirm.ts","../../../projects/lib/popconfirm/ngwr-popconfirm.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\n\nexport type WrPopconfirmPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/** @internal */\nexport const WR_POPCONFIRM_POSITIONS: Record<WrPopconfirmPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -8 }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 8 }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8 }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8 }],\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\n\n/**\n * Confirmation panel rendered inside the popconfirm overlay. Not part\n * of the public template API — use `[wrPopconfirm]` instead.\n *\n * @internal\n */\n@Component({\n selector: 'wr-popconfirm',\n templateUrl: './popconfirm-panel.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-popconfirm' },\n imports: [WrButton],\n})\nexport class WrPopconfirmPanel {\n readonly message = input.required<string>();\n readonly confirmText = input<string>('Confirm');\n readonly cancelText = input<string>('Cancel');\n readonly confirmColor = input<WrColor>('primary');\n\n readonly confirmed = output<void>();\n readonly cancelled = output<void>();\n}\n","<p class=\"wr-popconfirm__message\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn size=\"sm\" (click)=\"cancelled.emit()\">{{ cancelText() }}</wr-btn>\n <wr-btn size=\"sm\" [color]=\"confirmColor()\" (click)=\"confirmed.emit()\">{{ confirmText() }}</wr-btn>\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { DestroyRef, Directive, ElementRef, ViewContainerRef, inject, input, output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WrOutsideClick } from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\n\nimport { WR_POPCONFIRM_POSITIONS, type WrPopconfirmPosition } from './interfaces';\nimport { WrPopconfirmPanel } from './popconfirm-panel';\n\n/**\n * Small \"Are you sure?\" panel anchored to its trigger. Fires `confirmed`\n * or `cancelled` and closes automatically. Built on CDK Overlay.\n *\n * @example\n * ```html\n * <wr-btn\n * color=\"danger\"\n * [wrPopconfirm]=\"'Delete this item?'\"\n * confirmColor=\"danger\"\n * confirmText=\"Delete\"\n * (confirmed)=\"remove()\"\n * >Delete</wr-btn>\n * ```\n *\n * @see https://ngwr.dev/reference/components/popconfirm\n */\n@Directive({\n selector: '[wrPopconfirm]',\n host: { '(click)': 'toggle($event)' },\n})\nexport class WrPopconfirm {\n /** Confirmation message. */\n readonly message = input.required<string>({ alias: 'wrPopconfirm' });\n\n /** Anchor side. @default 'top' */\n readonly position = input<WrPopconfirmPosition>('top');\n\n /** Label for the confirm button. @default 'Confirm' */\n readonly confirmText = input<string>('Confirm');\n\n /** Label for the cancel button. @default 'Cancel' */\n readonly cancelText = input<string>('Cancel');\n\n /** Color of the confirm button. @default 'primary' */\n readonly confirmColor = input<WrColor>('primary');\n\n /** Fires when the user clicks confirm. */\n readonly confirmed = output<void>();\n\n /** Fires when the user clicks cancel or dismisses the overlay. */\n readonly cancelled = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** @internal */\n protected toggle(event: MouseEvent): void {\n event.stopPropagation();\n if (this.overlayRef) {\n this.close();\n } else {\n this.open();\n }\n }\n\n open(): void {\n if (this.overlayRef) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(WR_POPCONFIRM_POSITIONS[this.position()])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: ['wr-popconfirm-overlay', `wr-popconfirm-overlay--${this.position()}`],\n });\n\n const portal = new ComponentPortal(WrPopconfirmPanel, this.vcr);\n const ref = this.overlayRef.attach(portal);\n ref.setInput('message', this.message());\n ref.setInput('confirmText', this.confirmText());\n ref.setInput('cancelText', this.cancelText());\n ref.setInput('confirmColor', this.confirmColor());\n\n ref.instance.confirmed.subscribe(() => {\n this.confirmed.emit();\n this.close();\n });\n ref.instance.cancelled.subscribe(() => this.dismiss());\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.dismiss();\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n close(): void {\n this.dispose();\n }\n\n private dismiss(): void {\n if (!this.overlayRef) return;\n this.cancelled.emit();\n this.dispose();\n }\n\n private dispose(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAMH;AACO,MAAM,uBAAuB,GAAsD;IACxF,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KA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AAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,YAAA,EAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE;AACtC,iBAAA;;;ACtCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-popconfirm.mjs","sources":["../../../projects/lib/popconfirm/interfaces/popconfirm-position.ts","../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/popconfirm.ts","../../../projects/lib/popconfirm/ngwr-popconfirm.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\n\nexport type WrPopconfirmPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/** @internal */\nexport const WR_POPCONFIRM_POSITIONS: Record<WrPopconfirmPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -8 }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 8 }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8 }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8 }],\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\n\n/**\n * Confirmation panel rendered inside the popconfirm overlay. Not part\n * of the public template API — use `[wrPopconfirm]` instead.\n *\n * @internal\n */\n@Component({\n selector: 'wr-popconfirm',\n templateUrl: './popconfirm-panel.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-popconfirm' },\n imports: [WrButton],\n})\nexport class WrPopconfirmPanel {\n readonly message = input.required<string>();\n\n /** Id the anchoring directive points `aria-describedby` at. */\n readonly messageId = input<string | null>(null);\n readonly confirmText = input<string>('Confirm');\n readonly cancelText = input<string>('Cancel');\n readonly confirmColor = input<WrColor>('primary');\n\n readonly confirmed = output<void>();\n readonly cancelled = output<void>();\n}\n","<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { DestroyRef, Directive, ElementRef, ViewContainerRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrMirrorOffsets } from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\n\nimport { WR_POPCONFIRM_POSITIONS, type WrPopconfirmPosition } from './interfaces';\nimport { WrPopconfirmPanel } from './popconfirm-panel';\n\n/**\n * Small \"Are you sure?\" panel anchored to its trigger. Fires `confirmed`\n * or `cancelled` and closes automatically. Built on CDK Overlay.\n *\n * @example\n * ```html\n * <wr-btn\n * color=\"danger\"\n * [wrPopconfirm]=\"'Delete this item?'\"\n * confirmColor=\"danger\"\n * confirmText=\"Delete\"\n * (confirmed)=\"remove()\"\n * >Delete</wr-btn>\n * ```\n *\n * @see https://ngwr.dev/reference/components/popconfirm\n */\nlet popconfirmUid = 0;\n\n@Directive({\n selector: '[wrPopconfirm]',\n host: {\n // Marks the trigger the way `[wrPopover]` and `[wrDropdown]` mark theirs. The\n // question is normally BOUND (`[wrPopconfirm]=\"question\"`), which leaves no\n // attribute in the DOM at all, so without this there is nothing to find a\n // trigger by once the panel is shut.\n class: 'wr-popconfirm-trigger',\n '(click)': 'toggle($event)',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n // Names the dialog this trigger opened, as every other overlay trigger in the\n // catalog does. `aria-haspopup=\"dialog\"` promises a dialog and `aria-expanded`\n // says it is showing; without the id, which one is left to guess.\n '[attr.aria-controls]': 'isOpen() ? panelId : null',\n },\n})\nexport class WrPopconfirm {\n /** Confirmation message. */\n readonly message = input.required<string>({ alias: 'wrPopconfirm' });\n\n /** Anchor side. @default 'top' */\n readonly position = input<WrPopconfirmPosition>('top');\n\n /** Label for the confirm button. @default 'Confirm' */\n /** Confirm button text. Falls back to `popconfirm.confirm`. */\n readonly confirmText = input<string | null>(null);\n\n /** Label for the cancel button. @default 'Cancel' */\n /** Cancel button text. Falls back to `popconfirm.cancel`. */\n readonly cancelText = input<string | null>(null);\n\n /**\n * Accessible name of the confirmation dialog. `role=\"dialog\"` with no name\n * announces as a bare \"dialog\". Falls back to `popconfirm.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n // The catalog has carried these translated for as long as the component has\n // existed; the labels were hard-coded English defaults, so a localized app got\n // English buttons with the right strings sitting one file away.\n private readonly resolvedConfirm = useI18nText(this.confirmText, 'popconfirm.confirm', 'Confirm');\n private readonly resolvedCancel = useI18nText(this.cancelText, 'popconfirm.cancel', 'Cancel');\n private readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'popconfirm.label', 'Confirm action');\n\n /** Color of the confirm button. @default 'primary' */\n readonly confirmColor = input<WrColor>('primary');\n\n /** Fires when the user clicks confirm. */\n readonly confirmed = output<void>();\n\n /** Fires when the user clicks cancel or dismisses the overlay. */\n readonly cancelled = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n /** @internal Public so the host bindings can read it. */\n readonly isOpen = signal(false);\n\n private overlayRef: OverlayRef | null = null;\n\n private readonly uid = ++popconfirmUid;\n\n /** @internal Public so the host binding can read it. */\n protected readonly panelId = `wr-popconfirm-${this.uid}`;\n\n private readonly messageId = `wr-popconfirm-message-${this.uid}`;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** @internal */\n protected toggle(event: MouseEvent): void {\n event.stopPropagation();\n if (this.overlayRef) {\n this.close();\n } else {\n this.open();\n }\n }\n\n open(): void {\n if (this.overlayRef) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(WR_POPCONFIRM_POSITIONS[this.position()], this.isRtl()))\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: ['wr-popconfirm-overlay', `wr-popconfirm-overlay--${this.position()}`],\n });\n\n // Non-modal by choice, like `wr-popover`: an outside click or Escape closes it,\n // so trapping focus would only make it harder to leave. It still needs a role, a\n // name and the question read out as its description.\n const pane = this.overlayRef.overlayElement;\n pane.id = this.panelId;\n pane.setAttribute('role', 'dialog');\n pane.setAttribute('aria-modal', 'false');\n pane.setAttribute('aria-label', this.resolvedAriaLabel());\n pane.setAttribute('aria-describedby', this.messageId);\n\n const portal = new ComponentPortal(WrPopconfirmPanel, this.vcr);\n const ref = this.overlayRef.attach(portal);\n ref.setInput('message', this.message());\n ref.setInput('messageId', this.messageId);\n ref.setInput('confirmText', this.resolvedConfirm());\n ref.setInput('cancelText', this.resolvedCancel());\n ref.setInput('confirmColor', this.confirmColor());\n // Render now rather than next frame: the buttons have to exist before focus can\n // move to one, and a deferred focus is the class of bug this repo keeps finding.\n ref.changeDetectorRef.detectChanges();\n // Focus has to enter the panel — the overlay container sits at the end of\n // `<body>`, so Tab from the trigger went to the next thing on the PAGE and the\n // only way to confirm was unreachable. Cancel first: the action being confirmed\n // is usually the destructive one.\n pane.querySelector<HTMLElement>('.wr-popconfirm__actions wr-btn')?.focus();\n this.isOpen.set(true);\n\n ref.instance.confirmed.subscribe(() => {\n this.confirmed.emit();\n this.close();\n });\n ref.instance.cancelled.subscribe(() => this.dismiss());\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.dismiss();\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n close(): void {\n this.dispose();\n }\n\n private dismiss(): void {\n if (!this.overlayRef) return;\n this.cancelled.emit();\n this.dispose();\n }\n\n private dispose(): void {\n if (!this.overlayRef) return;\n // Focus lives inside the panel while it is open, and removing the panel would\n // drop it to `<body>` — hand it back to the trigger instead, as `wr-dropdown`\n // does on Escape. Only when focus is still IN there: if the user has already\n // clicked elsewhere, taking it back would be stealing.\n const returnFocus = this.overlayRef.overlayElement.contains(document.activeElement);\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.isOpen.set(false);\n if (returnFocus) this.host.nativeElement.focus();\n }\n\n /**\n * Whether the app reads right-to-left.\n *\n * Optional inject: `Directionality` is root-provided, so this is never null in\n * an app — but a bare `TestBed` that provides nothing should still get a\n * component that works, and defaulting to LTR is the honest fallback.\n */\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAMH;AACO,MAAM,uBAAuB,GAAsD;IACxF,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC;IACjG,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACnG,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EA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AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE;;;;;AAKJ,wBAAA,KAAK,EAAE,uBAAuB;AAC9B,wBAAA,SAAS,EAAE,gBAAgB;AAC3B,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,sBAAsB,EAAE,UAAU;;;;AAIlC,wBAAA,sBAAsB,EAAE,2BAA2B;AACpD,qBAAA;AACF,iBAAA;;;ACvDD;;AAEG;;;;"}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { ContentContainerComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
8
|
+
*/
|
|
9
|
+
/** How long the waiters poll before giving up, in ms. Generous next to the 120ms default delays. */
|
|
10
|
+
const DEFAULT_TIMEOUT = 1000;
|
|
11
|
+
/** How often they re-check, in ms. */
|
|
12
|
+
const POLL_STEP = 10;
|
|
13
|
+
/**
|
|
14
|
+
* The real `setTimeout`, captured at module load — before a spec can install
|
|
15
|
+
* fake timers.
|
|
16
|
+
*
|
|
17
|
+
* The waiters have to let REAL time pass: the show / hide delays are plain
|
|
18
|
+
* `setTimeout`s inside the directive, and under zoneless change detection
|
|
19
|
+
* `whenStable()` resolves without waiting for a macrotask. Reading the faked
|
|
20
|
+
* global instead would mean the sleep never fires at all, and the harness would
|
|
21
|
+
* hang where it should fail with the message it prepared.
|
|
22
|
+
*/
|
|
23
|
+
const realSetTimeout = globalThis.setTimeout;
|
|
24
|
+
function sleep(ms) {
|
|
25
|
+
return new Promise(resolve => {
|
|
26
|
+
realSetTimeout(resolve, ms);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Test harness for `[wrPopover]` — both shapes the one directive ships:
|
|
31
|
+
*
|
|
32
|
+
* - **popover** — template content, opens on click (or hover), announces
|
|
33
|
+
* `role="dialog"` and is what the trigger's `aria-expanded` describes;
|
|
34
|
+
* - **tooltip** — string content, opens on hover AND focus after a delay,
|
|
35
|
+
* announces `role="tooltip"` and DESCRIBES its trigger instead of being
|
|
36
|
+
* owned by it.
|
|
37
|
+
*
|
|
38
|
+
* The panel is never inside the trigger: it is a portal in the overlay
|
|
39
|
+
* container, a sibling of the whole app. It is reached through the document
|
|
40
|
+
* root, scoped by the id the trigger publishes while the panel is showing —
|
|
41
|
+
* `aria-controls` in popover mode, `aria-describedby` in tooltip mode. That id
|
|
42
|
+
* is what lets two popovers be open at once without reading each other's
|
|
43
|
+
* content, and it is why every panel reader throws while the panel is shut:
|
|
44
|
+
* there is no element to answer about.
|
|
45
|
+
*
|
|
46
|
+
* Being a CONTENT CONTAINER is the point in popover mode — the panel holds the
|
|
47
|
+
* consumer's own components, so `popover.getHarness(WrButtonHarness…)` reaches
|
|
48
|
+
* them without the spec ever touching the overlay.
|
|
49
|
+
*
|
|
50
|
+
* **Timing.** A tooltip opens on `showDelay` and hides on `hideDelay`; a hover
|
|
51
|
+
* popover hides 120ms after the pointer leaves. `open()`, `close()` and the two
|
|
52
|
+
* waiters sit out that REAL time, so a spec that installs fake timers should
|
|
53
|
+
* drive the clock itself and read `isOpen()` rather than call them.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const loader = TestbedHarnessEnvironment.loader(fixture);
|
|
58
|
+
* const details = await loader.getHarness(WrPopoverHarness.with({ triggerText: 'Details' }));
|
|
59
|
+
*
|
|
60
|
+
* await details.open();
|
|
61
|
+
* expect(await details.getRole()).toBe('dialog');
|
|
62
|
+
* await (await details.getHarness(WrButtonHarness.with({ text: 'Confirm' }))).click();
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @see https://ngwr.dev/guides/testing
|
|
66
|
+
*/
|
|
67
|
+
class WrPopoverHarness extends ContentContainerComponentHarness {
|
|
68
|
+
/**
|
|
69
|
+
* The directive's host — whatever element the consumer put `[wrPopover]` on.
|
|
70
|
+
*
|
|
71
|
+
* Matched by the marker class, not by `[wrPopover]`: popover-mode content is a
|
|
72
|
+
* `TemplateRef` and so is always BOUND (`[wrPopover]="tpl"`), which leaves no
|
|
73
|
+
* attribute in the DOM at all, and a CLOSED tooltip publishes no ARIA either.
|
|
74
|
+
* (A tooltip written with the static string form, `wrPopover="Save changes"`,
|
|
75
|
+
* does keep the attribute — but only that one shape would be findable by it.)
|
|
76
|
+
* Same shape as `.wr-dropdown-trigger`.
|
|
77
|
+
*/
|
|
78
|
+
static hostSelector = '.wr-popover-trigger';
|
|
79
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
80
|
+
static with(options = {}) {
|
|
81
|
+
return new HarnessPredicate(WrPopoverHarness, options)
|
|
82
|
+
.addOption('triggerText', options.triggerText, (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text))
|
|
83
|
+
.addOption('mode', options.mode, async (harness, mode) => (await harness.getMode()) === mode)
|
|
84
|
+
.addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Which shape this trigger carries.
|
|
88
|
+
*
|
|
89
|
+
* Read from the ARIA contract, not from the `mode` input: a bound `[mode]`
|
|
90
|
+
* never reaches the DOM, while `aria-haspopup="dialog"` is on every popover
|
|
91
|
+
* trigger and on no tooltip trigger — a tooltip is a description of the
|
|
92
|
+
* control, not a popup it owns.
|
|
93
|
+
*/
|
|
94
|
+
async getMode() {
|
|
95
|
+
return (await (await this.host()).getAttribute('aria-haspopup')) === 'dialog' ? 'popover' : 'tooltip';
|
|
96
|
+
}
|
|
97
|
+
/** The trigger's own visible text. The panel's content is `getContentText()`. */
|
|
98
|
+
async getTriggerText() {
|
|
99
|
+
return (await this.host()).text();
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Whether the panel is showing.
|
|
103
|
+
*
|
|
104
|
+
* Two different signals because the two modes advertise different things: a
|
|
105
|
+
* popover flips `aria-expanded` on its trigger, a tooltip has none at all and
|
|
106
|
+
* links its description instead. So a tooltip's answer is only as good as the
|
|
107
|
+
* directive's claim on `aria-describedby` — put the tooltip on a control that
|
|
108
|
+
* is ALSO described by something else (a `<wr-form-field>` hint, say) and the
|
|
109
|
+
* two bindings fight over one attribute.
|
|
110
|
+
*/
|
|
111
|
+
async isOpen() {
|
|
112
|
+
const host = await this.host();
|
|
113
|
+
return (await this.getMode()) === 'popover'
|
|
114
|
+
? (await host.getAttribute('aria-expanded')) === 'true'
|
|
115
|
+
: (await host.getAttribute('aria-describedby')) !== null;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Open the panel with the gesture this trigger actually answers to, and wait
|
|
119
|
+
* until it is showing.
|
|
120
|
+
*
|
|
121
|
+
* `trigger` is an input, so the DOM does not say which gesture this popover
|
|
122
|
+
* wants — the harness moves the pointer on first and falls back to a click.
|
|
123
|
+
* Hover leads because a click is an outside pointer event for every OTHER open
|
|
124
|
+
* panel, so leading with it would dismiss someone else's popover on the way to
|
|
125
|
+
* opening this one; a click-driven popover ignores the hover outright. A
|
|
126
|
+
* tooltip is never clicked at all — hover and focus are its only gestures.
|
|
127
|
+
*
|
|
128
|
+
* Throws when nothing appears: a tooltip with an empty string never opens, and
|
|
129
|
+
* a spec on fake timers has to advance the clock itself.
|
|
130
|
+
*/
|
|
131
|
+
async open(timeout = DEFAULT_TIMEOUT) {
|
|
132
|
+
if (await this.isOpen())
|
|
133
|
+
return;
|
|
134
|
+
const host = await this.host();
|
|
135
|
+
await host.hover();
|
|
136
|
+
if ((await this.getMode()) === 'tooltip')
|
|
137
|
+
return this.waitUntilOpen(timeout);
|
|
138
|
+
if (await this.isOpen())
|
|
139
|
+
return;
|
|
140
|
+
await host.click();
|
|
141
|
+
return this.waitUntilOpen(timeout);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Dismiss the panel and wait until it is gone.
|
|
145
|
+
*
|
|
146
|
+
* Escape, because it is the one gesture both modes honour immediately: a
|
|
147
|
+
* popover is closed by the overlay's keyboard dispatcher, a tooltip by the
|
|
148
|
+
* directive's own binding — no delay in either. To exercise the delayed
|
|
149
|
+
* pointer path instead, call `mouseAway()` and then `waitUntilClosed()`.
|
|
150
|
+
*/
|
|
151
|
+
async close(timeout = DEFAULT_TIMEOUT) {
|
|
152
|
+
if (!(await this.isOpen()))
|
|
153
|
+
return;
|
|
154
|
+
await this.sendEscape();
|
|
155
|
+
return this.waitUntilClosed(timeout);
|
|
156
|
+
}
|
|
157
|
+
/** Click the trigger. Opens a click-driven popover, toggles it shut again, and does nothing else. */
|
|
158
|
+
async click() {
|
|
159
|
+
return (await this.host()).click();
|
|
160
|
+
}
|
|
161
|
+
/** Move the pointer onto the trigger — opens a hover popover at once, a tooltip after `showDelay`. */
|
|
162
|
+
async hover() {
|
|
163
|
+
return (await this.host()).hover();
|
|
164
|
+
}
|
|
165
|
+
/** Move the pointer off the trigger. The panel goes after the grace period, not instantly. */
|
|
166
|
+
async mouseAway() {
|
|
167
|
+
return (await this.host()).mouseAway();
|
|
168
|
+
}
|
|
169
|
+
/** Focus the trigger — a tooltip's other opening gesture, so keyboard users get the hint too. */
|
|
170
|
+
async focus() {
|
|
171
|
+
return (await this.host()).focus();
|
|
172
|
+
}
|
|
173
|
+
/** Blur the trigger, which hides a tooltip after `hideDelay`. */
|
|
174
|
+
async blur() {
|
|
175
|
+
return (await this.host()).blur();
|
|
176
|
+
}
|
|
177
|
+
/** Press Escape on the trigger. Both modes dismiss on it, and neither moves focus. */
|
|
178
|
+
async sendEscape() {
|
|
179
|
+
return (await this.host()).sendKeys(TestKey.ESCAPE);
|
|
180
|
+
}
|
|
181
|
+
/** Wait out a pending show. Resolves at once when the panel is already up. */
|
|
182
|
+
async waitUntilOpen(timeout = DEFAULT_TIMEOUT) {
|
|
183
|
+
if (await this.settled(true, timeout))
|
|
184
|
+
return;
|
|
185
|
+
throw new Error(`WrPopoverHarness.waitUntilOpen(): nothing opened within ${timeout}ms. A tooltip waits out its ` +
|
|
186
|
+
'showDelay (and never opens at all for an empty string); this wait uses real time, so a spec on ' +
|
|
187
|
+
'fake timers has to advance the clock itself and read isOpen().');
|
|
188
|
+
}
|
|
189
|
+
/** Wait out a pending hide. Resolves at once when the panel is already gone. */
|
|
190
|
+
async waitUntilClosed(timeout = DEFAULT_TIMEOUT) {
|
|
191
|
+
if (await this.settled(false, timeout))
|
|
192
|
+
return;
|
|
193
|
+
throw new Error(`WrPopoverHarness.waitUntilClosed(): still showing after ${timeout}ms. A hover popover closes 120ms ` +
|
|
194
|
+
'after the pointer leaves — and only if it left at all, since a mouseleave INTO that panel is ' +
|
|
195
|
+
'deliberately not a leave. A tooltip closes on its hideDelay after mouseleave or blur.');
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The panel's text.
|
|
199
|
+
*
|
|
200
|
+
* In tooltip mode that is the string itself, rendered into the small text
|
|
201
|
+
* panel; in popover mode it is everything the projected template renders.
|
|
202
|
+
*/
|
|
203
|
+
async getContentText() {
|
|
204
|
+
return (await this.panel()).text();
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The role the open panel announces: `'dialog'` for a popover, `'tooltip'` for
|
|
208
|
+
* a tooltip.
|
|
209
|
+
*
|
|
210
|
+
* Worth asserting rather than assuming, twice over: the directive sets it on
|
|
211
|
+
* the OVERLAY PANE, not on the content a consumer wrote, and in tooltip mode
|
|
212
|
+
* the pane is deliberately the only element carrying it — the text panel
|
|
213
|
+
* inside has none, or the description would nest a tooltip in a tooltip.
|
|
214
|
+
*/
|
|
215
|
+
async getRole() {
|
|
216
|
+
return (await this.panel()).getAttribute('role');
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The panel's accessible name — `null` in tooltip mode.
|
|
220
|
+
*
|
|
221
|
+
* A popover is a named `role="dialog"`: the `ariaLabel` input, or the i18n
|
|
222
|
+
* catalog's `popover.label` when the consumer says nothing, because an unnamed
|
|
223
|
+
* dialog announces as "dialog" and nothing else. A tooltip has no name of its
|
|
224
|
+
* own; it IS the trigger's description, which is `getDescriptionText()`.
|
|
225
|
+
*/
|
|
226
|
+
async getLabel() {
|
|
227
|
+
return (await this.panel()).getAttribute('aria-label');
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Whether the panel claims modality.
|
|
231
|
+
*
|
|
232
|
+
* `false`, deliberately, and worth pinning: the popover sets
|
|
233
|
+
* `aria-modal="false"` because focus is NOT trapped and the panel dismisses on
|
|
234
|
+
* outside click / Escape rather than blocking the page.
|
|
235
|
+
*/
|
|
236
|
+
async isModal() {
|
|
237
|
+
return (await (await this.panel()).getAttribute('aria-modal')) === 'true';
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Where the panel sits relative to the trigger, or `null` when it is presented
|
|
241
|
+
* as a sheet and has no anchor.
|
|
242
|
+
*
|
|
243
|
+
* The resolved position — the directive defaults it per mode (`bottom` for a
|
|
244
|
+
* popover, `top` for a tooltip) — read off the pane's public modifier class.
|
|
245
|
+
* The arrow itself is a `::after` pseudo-element, so it exists for no DOM query
|
|
246
|
+
* at all; this class is the placement, and it is what the arrow's own CSS keys
|
|
247
|
+
* off.
|
|
248
|
+
*/
|
|
249
|
+
async getPosition() {
|
|
250
|
+
const classes = (await (await this.panel()).getAttribute('class')) ?? '';
|
|
251
|
+
const modifier = /wr-(?:popover|tooltip)-overlay--([a-z-]+)/.exec(classes);
|
|
252
|
+
return modifier ? modifier[1] : null;
|
|
253
|
+
}
|
|
254
|
+
/** Whether the popover is presented as a full-width bottom sheet instead of an anchored panel. */
|
|
255
|
+
async isSheet() {
|
|
256
|
+
return (await this.panel()).hasClass('wr-overlay-sheet');
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* The text a screen reader reads as the TRIGGER'S DESCRIPTION, or `null` when
|
|
260
|
+
* it describes nothing.
|
|
261
|
+
*
|
|
262
|
+
* This resolves `aria-describedby` the way an assistive technology would, so
|
|
263
|
+
* it answers the whole of tooltip mode's naming contract in one call. Always
|
|
264
|
+
* `null` for a popover, open or shut — a popover is a thing the trigger owns
|
|
265
|
+
* (`aria-haspopup` / `aria-expanded`), never a description of it.
|
|
266
|
+
*/
|
|
267
|
+
async getDescriptionText() {
|
|
268
|
+
const id = await (await this.host()).getAttribute('aria-describedby');
|
|
269
|
+
if (!id)
|
|
270
|
+
return null;
|
|
271
|
+
const described = await this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();
|
|
272
|
+
return described ? described.text() : null;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Harnesses for the consumer's own components are resolved inside THIS
|
|
276
|
+
* instance's panel.
|
|
277
|
+
*
|
|
278
|
+
* Scoped by the published id rather than by `.wr-popover-overlay`: the overlay
|
|
279
|
+
* container is shared, so a class query would answer with whichever popover
|
|
280
|
+
* opened first.
|
|
281
|
+
*/
|
|
282
|
+
async getRootHarnessLoader() {
|
|
283
|
+
return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);
|
|
284
|
+
}
|
|
285
|
+
/** Poll until `isOpen()` reports `open`, and say whether it did. */
|
|
286
|
+
async settled(open, timeout) {
|
|
287
|
+
for (let waited = 0; waited <= timeout; waited += POLL_STEP) {
|
|
288
|
+
if ((await this.isOpen()) === open)
|
|
289
|
+
return true;
|
|
290
|
+
await sleep(POLL_STEP);
|
|
291
|
+
await this.forceStabilize();
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
/** This instance's overlay pane. */
|
|
296
|
+
async panel() {
|
|
297
|
+
return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();
|
|
298
|
+
}
|
|
299
|
+
/** The id the trigger publishes for its panel, which only exists while the panel does. */
|
|
300
|
+
async panelId() {
|
|
301
|
+
const attribute = (await this.getMode()) === 'popover' ? 'aria-controls' : 'aria-describedby';
|
|
302
|
+
const id = await (await this.host()).getAttribute(attribute);
|
|
303
|
+
if (!id) {
|
|
304
|
+
throw new Error(`WrPopoverHarness: nothing is showing. The trigger publishes its panel id as ${attribute} only ` +
|
|
305
|
+
'while the panel is open — call open() first (a tooltip also has to wait out its showDelay).');
|
|
306
|
+
}
|
|
307
|
+
return id;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Generated bundle index. Do not edit.
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
export { WrPopoverHarness };
|
|
316
|
+
//# sourceMappingURL=ngwr-popover-testing.mjs.map
|