ngwr 16.1.0 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/styles/_tag.scss +73 -1
- package/calendar/styles/_index.scss +22 -0
- package/cascader/styles/_rules.scss +7 -0
- package/color-picker/styles/_index.scss +21 -0
- package/date-picker/styles/_index.scss +108 -1
- package/dropdown/styles/_index.scss +40 -10
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert-testing.mjs +70 -0
- package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +17 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +3 -3
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +129 -11
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
- package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger-testing.mjs +45 -0
- package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-testing.mjs +18 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +500 -73
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +37 -16
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +3 -3
- package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +153 -37
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +10 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare-testing.mjs +84 -0
- package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +48 -4
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +492 -75
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +76 -12
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +144 -12
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +18 -18
- package/fesm2022/ngwr-directives.mjs +15 -15
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +51 -29
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +48 -5
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +407 -116
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +4 -3
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +186 -33
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +274 -15
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +3 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +102 -42
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +26 -6
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +26 -6
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +26 -6
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +26 -6
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +26 -6
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +26 -6
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +26 -6
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +26 -6
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +26 -6
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +26 -6
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +26 -6
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +26 -6
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +26 -6
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +26 -6
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +26 -6
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +26 -6
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +26 -6
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +26 -6
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +26 -6
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +26 -6
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +26 -6
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +26 -6
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-input-number-testing.mjs +11 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +68 -7
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +23 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +24 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +152 -36
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +249 -13
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +15 -15
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +175 -13
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +5 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +57 -33
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +44 -63
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +7 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +58 -156
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +50 -9
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable-testing.mjs +113 -0
- package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
- package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-schema-form.mjs +418 -19
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select-testing.mjs +19 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +263 -83
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider-testing.mjs +23 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +108 -14
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
- package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sortable-list.mjs +284 -63
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +42 -11
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-testing.mjs +88 -2
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +891 -74
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-testing.mjs +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +15 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +11 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +128 -16
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +40 -19
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-transfer-testing.mjs +6 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +24 -5
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +62 -2
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +966 -78
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +34 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +33 -22
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +156 -0
- package/i18n/ar.json +28 -6
- package/i18n/cs.json +28 -6
- package/i18n/de.json +28 -6
- package/i18n/en.json +28 -6
- package/i18n/es.json +28 -6
- package/i18n/fr.json +28 -6
- package/i18n/he.json +28 -6
- package/i18n/hi.json +28 -6
- package/i18n/id.json +28 -6
- package/i18n/it.json +28 -6
- package/i18n/ja.json +28 -6
- package/i18n/ko.json +28 -6
- package/i18n/nl.json +28 -6
- package/i18n/pl.json +28 -6
- package/i18n/pt.json +28 -6
- package/i18n/ru.json +28 -6
- package/i18n/sv.json +28 -6
- package/i18n/tr.json +28 -6
- package/i18n/uk.json +28 -6
- package/i18n/vi.json +28 -6
- package/i18n/zh-TW.json +28 -6
- package/i18n/zh.json +28 -6
- package/input/styles/_index.scss +68 -1
- package/input-otp/styles/_index.scss +14 -0
- package/lightbox/styles/_rules.scss +96 -0
- package/llms-full.txt +61 -25
- package/llms.txt +12 -0
- package/overlay/styles/_arrow.scss +4 -4
- package/package.json +37 -1
- package/popconfirm/styles/_index.scss +3 -11
- package/progress/styles/_index.scss +32 -0
- package/schema-form/styles/_index.scss +78 -0
- package/schematics/use/rule.js +2 -0
- package/schematics/use/symbol-map.json +5 -0
- package/select/styles/_index.scss +114 -22
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +11 -2
- package/slider/styles/_index.scss +128 -0
- package/sortable-list/styles/_rules.scss +23 -1
- package/table/styles/_index.scss +167 -3
- package/textarea/styles/_index.scss +80 -0
- package/theme/styles/_focus.scss +5 -0
- package/theme/styles/_motion.scss +5 -0
- package/transfer/styles/_index.scss +84 -0
- package/tree/styles/_index.scss +138 -5
- package/types/ngwr-alert-testing.d.ts +88 -0
- package/types/ngwr-badge.d.ts +72 -2
- package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
- package/types/ngwr-burger-testing.d.ts +51 -0
- package/types/ngwr-calendar-testing.d.ts +18 -6
- package/types/ngwr-calendar.d.ts +272 -22
- package/types/ngwr-cascader.d.ts +10 -1
- package/types/ngwr-charts-chart-legend.d.ts +9 -4
- package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
- package/types/ngwr-charts-line-chart.d.ts +7 -4
- package/types/ngwr-color-picker-testing.d.ts +15 -4
- package/types/ngwr-color-picker.d.ts +76 -6
- package/types/ngwr-compare-testing.d.ts +72 -0
- package/types/ngwr-date-picker-testing.d.ts +40 -8
- package/types/ngwr-date-picker.d.ts +178 -10
- package/types/ngwr-date-stamp-testing.d.ts +1 -1
- package/types/ngwr-date-stamp.d.ts +53 -7
- package/types/ngwr-date.d.ts +188 -15
- package/types/ngwr-drawer.d.ts +9 -0
- package/types/ngwr-dropdown-testing.d.ts +73 -5
- package/types/ngwr-dropdown.d.ts +124 -6
- package/types/ngwr-event-calendar.d.ts +66 -8
- package/types/ngwr-file-upload-testing.d.ts +31 -2
- package/types/ngwr-file-upload.d.ts +148 -1
- package/types/ngwr-form.d.ts +47 -3
- package/types/ngwr-graph-testing.d.ts +8 -3
- package/types/ngwr-graph.d.ts +147 -7
- package/types/ngwr-input-number-testing.d.ts +10 -0
- package/types/ngwr-input-number.d.ts +30 -1
- package/types/ngwr-input-otp.d.ts +10 -0
- package/types/ngwr-input-testing.d.ts +30 -0
- package/types/ngwr-input.d.ts +54 -3
- package/types/ngwr-lightbox-testing.d.ts +27 -0
- package/types/ngwr-lightbox.d.ts +71 -6
- package/types/ngwr-overlay.d.ts +84 -5
- package/types/ngwr-pipes.d.ts +34 -13
- package/types/ngwr-popconfirm-testing.d.ts +12 -3
- package/types/ngwr-popconfirm.d.ts +28 -3
- package/types/ngwr-popover-testing.d.ts +19 -2
- package/types/ngwr-popover.d.ts +22 -2
- package/types/ngwr-progress.d.ts +29 -1
- package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
- package/types/ngwr-resizable-testing.d.ts +116 -0
- package/types/ngwr-schema-form-testing.d.ts +260 -0
- package/types/ngwr-schema-form.d.ts +76 -6
- package/types/ngwr-select-testing.d.ts +20 -0
- package/types/ngwr-select.d.ts +112 -11
- package/types/ngwr-sidebar-testing.d.ts +176 -0
- package/types/ngwr-slider-testing.d.ts +10 -1
- package/types/ngwr-slider.d.ts +109 -3
- package/types/ngwr-sortable-list-testing.d.ts +79 -0
- package/types/ngwr-sortable-list.d.ts +119 -10
- package/types/ngwr-stepper.d.ts +20 -11
- package/types/ngwr-table-testing.d.ts +70 -6
- package/types/ngwr-table.d.ts +480 -50
- package/types/ngwr-tabs-testing.d.ts +14 -17
- package/types/ngwr-tabs.d.ts +6 -0
- package/types/ngwr-textarea-testing.d.ts +10 -0
- package/types/ngwr-textarea.d.ts +48 -2
- package/types/ngwr-toast.d.ts +8 -1
- package/types/ngwr-transfer-testing.d.ts +3 -0
- package/types/ngwr-transfer.d.ts +24 -1
- package/types/ngwr-tree-testing.d.ts +65 -1
- package/types/ngwr-tree.d.ts +333 -12
- package/types/ngwr-utils.d.ts +28 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +7 -4
|
@@ -78,7 +78,7 @@ var WrPlatform = class WrPlatform {
|
|
|
78
78
|
}
|
|
79
79
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
80
80
|
minVersion: "12.0.0",
|
|
81
|
-
version: "22.2.
|
|
81
|
+
version: "22.2.6",
|
|
82
82
|
ngImport: i0,
|
|
83
83
|
type: WrPlatform,
|
|
84
84
|
deps: [],
|
|
@@ -86,14 +86,14 @@ var WrPlatform = class WrPlatform {
|
|
|
86
86
|
});
|
|
87
87
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
88
88
|
minVersion: "22.0.0",
|
|
89
|
-
version: "22.2.
|
|
89
|
+
version: "22.2.6",
|
|
90
90
|
ngImport: i0,
|
|
91
91
|
type: WrPlatform
|
|
92
92
|
});
|
|
93
93
|
};
|
|
94
94
|
i0.ɵɵngDeclareClassMetadata({
|
|
95
95
|
minVersion: "12.0.0",
|
|
96
|
-
version: "22.2.
|
|
96
|
+
version: "22.2.6",
|
|
97
97
|
ngImport: i0,
|
|
98
98
|
type: WrPlatform,
|
|
99
99
|
decorators: [{ type: Service }]
|
|
@@ -159,7 +159,7 @@ var WrHaptics = class WrHaptics {
|
|
|
159
159
|
}
|
|
160
160
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
161
161
|
minVersion: "12.0.0",
|
|
162
|
-
version: "22.2.
|
|
162
|
+
version: "22.2.6",
|
|
163
163
|
ngImport: i0,
|
|
164
164
|
type: WrHaptics,
|
|
165
165
|
deps: [],
|
|
@@ -167,14 +167,14 @@ var WrHaptics = class WrHaptics {
|
|
|
167
167
|
});
|
|
168
168
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
169
169
|
minVersion: "22.0.0",
|
|
170
|
-
version: "22.2.
|
|
170
|
+
version: "22.2.6",
|
|
171
171
|
ngImport: i0,
|
|
172
172
|
type: WrHaptics
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
175
|
i0.ɵɵngDeclareClassMetadata({
|
|
176
176
|
minVersion: "12.0.0",
|
|
177
|
-
version: "22.2.
|
|
177
|
+
version: "22.2.6",
|
|
178
178
|
ngImport: i0,
|
|
179
179
|
type: WrHaptics,
|
|
180
180
|
decorators: [{ type: Service }]
|
|
@@ -228,7 +228,7 @@ var WrPollTicker = class WrPollTicker {
|
|
|
228
228
|
}
|
|
229
229
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
230
230
|
minVersion: "12.0.0",
|
|
231
|
-
version: "22.2.
|
|
231
|
+
version: "22.2.6",
|
|
232
232
|
ngImport: i0,
|
|
233
233
|
type: WrPollTicker,
|
|
234
234
|
deps: [],
|
|
@@ -236,14 +236,14 @@ var WrPollTicker = class WrPollTicker {
|
|
|
236
236
|
});
|
|
237
237
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
238
238
|
minVersion: "22.0.0",
|
|
239
|
-
version: "22.2.
|
|
239
|
+
version: "22.2.6",
|
|
240
240
|
ngImport: i0,
|
|
241
241
|
type: WrPollTicker
|
|
242
242
|
});
|
|
243
243
|
};
|
|
244
244
|
i0.ɵɵngDeclareClassMetadata({
|
|
245
245
|
minVersion: "12.0.0",
|
|
246
|
-
version: "22.2.
|
|
246
|
+
version: "22.2.6",
|
|
247
247
|
ngImport: i0,
|
|
248
248
|
type: WrPollTicker,
|
|
249
249
|
decorators: [{ type: Service }],
|
|
@@ -9,7 +9,7 @@ import { WR_COLORS } from "ngwr/theme";
|
|
|
9
9
|
var WrPopconfirmHarness = class WrPopconfirmHarness extends ContentContainerComponentHarness {
|
|
10
10
|
static hostSelector = ".wr-popconfirm-trigger";
|
|
11
11
|
static with(options = {}) {
|
|
12
|
-
return new HarnessPredicate(WrPopconfirmHarness, options).addOption("triggerText", options.triggerText, (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text)).addOption("open", options.open, async (harness, open) => await harness.isOpen() === open);
|
|
12
|
+
return new HarnessPredicate(WrPopconfirmHarness, options).addOption("triggerText", options.triggerText, (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text)).addOption("open", options.open, async (harness, open) => await harness.isOpen() === open).addOption("disabled", options.disabled, async (harness, disabled) => await harness.isDisabled() === disabled);
|
|
13
13
|
}
|
|
14
14
|
async getTriggerText() {
|
|
15
15
|
return (await this.host()).text();
|
|
@@ -17,6 +17,9 @@ var WrPopconfirmHarness = class WrPopconfirmHarness extends ContentContainerComp
|
|
|
17
17
|
async isOpen() {
|
|
18
18
|
return await (await this.host()).getAttribute("aria-expanded") === "true";
|
|
19
19
|
}
|
|
20
|
+
async isDisabled() {
|
|
21
|
+
return (await this.host()).hasClass("wr-popconfirm-trigger--disabled");
|
|
22
|
+
}
|
|
20
23
|
async isTriggerFocused() {
|
|
21
24
|
return (await this.host()).isFocused();
|
|
22
25
|
}
|
|
@@ -85,7 +88,7 @@ var WrPopconfirmHarness = class WrPopconfirmHarness extends ContentContainerComp
|
|
|
85
88
|
}
|
|
86
89
|
async getPosition() {
|
|
87
90
|
const classes = await (await this.pane()).getAttribute("class") ?? "";
|
|
88
|
-
const modifier = /wr-popconfirm-overlay--([a-z]+)/.exec(classes);
|
|
91
|
+
const modifier = /wr-popconfirm-overlay--([a-z-]+)/.exec(classes);
|
|
89
92
|
return modifier ? modifier[1] : null;
|
|
90
93
|
}
|
|
91
94
|
async getRootHarnessLoader() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-popconfirm-testing.mjs","names":[],"sources":["../../../projects/lib/popconfirm/testing/wr-popconfirm-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrPopconfirmPosition } from 'ngwr/popconfirm';\nimport { WR_COLORS, type WrColor } from 'ngwr/theme';\n\nimport type { WrPopconfirmHarnessFilters } from './types';\n\n/** The two answers a popconfirm offers, which are also its two action modifiers. */\ntype WrPopconfirmAction = 'confirm' | 'cancel';\n\n/**\n * Test harness for `[wrPopconfirm]` — the \"are you sure?\" dialog anchored to its\n * trigger.\n *\n * The panel is NOT inside the trigger: it is a component portal in the overlay\n * container, a sibling of the whole app. So everything about it is reached\n * through the document root, scoped by the `aria-controls` id the trigger\n * publishes while the dialog is showing — which is what keeps two popconfirms\n * from reading each other's question, and why every panel reader throws while the\n * dialog is shut: there is no element to answer about.\n *\n * **The two actions are told apart by their own modifiers**, never by position.\n * `.wr-popconfirm__action--cancel` and `--confirm` are what `cancel()` and\n * `confirm()` click, so a template that ever reorders the pair cannot silently\n * turn a spec's \"cancel\" into a delete.\n *\n * Being a CONTENT CONTAINER means a consumer's own harnesses resolve INSIDE this\n * instance's panel — `popconfirm.getHarness(WrButtonHarness…)` reaches the\n * buttons without the spec ever naming the overlay.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const remove = await loader.getHarness(WrPopconfirmHarness.with({ triggerText: 'Delete' }));\n *\n * await remove.open();\n * expect(await remove.getMessage()).toBe('Delete this item?');\n * await remove.confirm();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrPopconfirmHarness extends ContentContainerComponentHarness {\n /**\n * The directive's host — whatever element the consumer put `[wrPopconfirm]` on.\n *\n * Matched by the marker class, not by `[wrPopconfirm]`: the question is normally\n * BOUND (`[wrPopconfirm]=\"question\"`), and a property binding leaves no\n * attribute in the DOM at all. Same shape as `.wr-popover-trigger` and\n * `.wr-dropdown-trigger`.\n */\n static hostSelector = '.wr-popconfirm-trigger';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrPopconfirmHarnessFilters = {}): HarnessPredicate<WrPopconfirmHarness> {\n return new HarnessPredicate(WrPopconfirmHarness, options)\n .addOption('triggerText', options.triggerText, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getTriggerText(), text)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n /** The trigger's own visible label. The question inside the panel is `getMessage()`. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * Whether the dialog is showing.\n *\n * Read from `aria-expanded` rather than from a class, because that is the whole\n * of what the trigger tells a screen reader — the directive puts no state class\n * on its host at all.\n */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /** Whether the trigger currently has keyboard focus — the state it is handed back on close. */\n async isTriggerFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Press the trigger to open the dialog.\n *\n * Throws when nothing opens, because the reason is always worth failing on: a\n * native `<button disabled>` trigger never receives the click at all. (A\n * DISABLED `<wr-btn>` is a jsdom blind spot in the other direction — it is kept\n * inert by `pointer-events: none`, which jsdom does not apply, so it opens here\n * and would not in a browser.)\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrPopconfirmHarness.open(): the dialog did not open. A disabled trigger takes no click — assert ' +\n 'the disabled state instead of trying to open it.'\n );\n }\n\n /**\n * Press the trigger again to take the question back.\n *\n * This is the ONE way out that answers nothing: the directive treats a second\n * press as withdrawing the question, so `cancelled` does NOT fire — unlike\n * `cancel()`, `sendEscape()` and `clickOutside()`, which all emit it. Use this\n * when a spec needs the panel gone without recording an answer.\n */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.host()).click();\n if (!(await this.isOpen())) return;\n\n throw new Error('WrPopconfirmHarness.close(): the dialog is still open after a second press of the trigger.');\n }\n\n /** The question being asked. */\n async getMessage(): Promise<string> {\n return (await this.inPanel('.wr-popconfirm__message')).text();\n }\n\n /**\n * The confirm button's label.\n *\n * Resolved, not given: `confirmText` falls back to the `popconfirm.confirm`\n * catalog entry, so a localized app reads its own word here and a spec that\n * asserted the English default would be asserting the wrong thing.\n */\n async getConfirmText(): Promise<string> {\n return (await this.action('confirm')).text();\n }\n\n /** The cancel button's label — `cancelText`, or the `popconfirm.cancel` catalog entry. */\n async getCancelText(): Promise<string> {\n return (await this.action('cancel')).text();\n }\n\n /**\n * Both action labels in the order they are rendered: cancel first, confirm\n * second.\n *\n * That order is deliberate and worth reading — the destructive choice is the one\n * being confirmed, so the safe one comes first and takes the initial focus.\n */\n async getActionLabels(): Promise<string[]> {\n const actions = await this.allInPanel('.wr-popconfirm__action');\n return Promise.all(actions.map(action => action.text()));\n }\n\n /**\n * The confirm button's intent colour.\n *\n * Checked against `WR_COLORS` rather than pattern-matched out of the class list:\n * `wr-btn--*` also spells the size, the shape and the icon position, so only the\n * intent list can say which of them is a colour. Today `WrButton` happens to\n * emit the colour first, so a first-match regex would agree — but that order is\n * not a contract, and the same regex on a button with no colour answers `sm`.\n * Never `null` in practice — `confirmColor` defaults to `primary` — but typed\n * for it, since the button itself allows no colour at all.\n */\n async getConfirmColor(): Promise<WrColor | null> {\n const classes = (await (await this.action('confirm')).getAttribute('class')) ?? '';\n const present = classes.split(/\\s+/);\n return WR_COLORS.find(color => present.includes(`wr-btn--${color}`)) ?? null;\n }\n\n /** Which action holds keyboard focus, by label, or `null` when focus is elsewhere. */\n async getFocusedActionLabel(): Promise<string | null> {\n for (const action of await this.allInPanel('.wr-popconfirm__action')) {\n if (await action.isFocused()) return action.text();\n }\n return null;\n }\n\n /** Answer the question: click confirm, which emits `confirmed` and closes the dialog. */\n async confirm(): Promise<void> {\n return (await this.action('confirm')).click();\n }\n\n /** Decline: click cancel, which emits `cancelled` and closes the dialog. */\n async cancel(): Promise<void> {\n return (await this.action('cancel')).click();\n }\n\n /**\n * Dismiss with Escape, which emits `cancelled`.\n *\n * Sent at the pane rather than at the focused button, because the target makes\n * no difference: the key is picked up by the overlay's keyboard dispatcher,\n * which keeps one listener on the document and routes to the topmost overlay.\n * The pane is the one element guaranteed to be there.\n */\n async sendEscape(): Promise<void> {\n return (await this.pane()).sendKeys(TestKey.ESCAPE);\n }\n\n /**\n * Dismiss by pressing outside the panel, which emits `cancelled`.\n *\n * The press lands on the overlay CONTAINER — an ancestor of the pane (the CDK\n * puts a host `<div>` between the two), and so outside the panel by the only\n * measure that matters here, since the dismissal is decided by whether the press\n * started inside the pane. With two dialogs showing it dismisses BOTH: neither\n * pane contains the container. jsdom has no layout\n * and no `document.elementFromPoint`, so a harness cannot aim at \"whatever is\n * under the pointer\"; to dismiss by pressing a specific element instead, click\n * that element's own `TestElement`.\n */\n async clickOutside(): Promise<void> {\n const id = await this.panelId();\n const container = await this.documentRootLocatorFactory().locatorFor('.cdk-overlay-container')();\n\n await container.click();\n if (!(await this.isOpen())) return;\n\n throw new Error(\n `WrPopconfirmHarness.clickOutside(): the dialog (#${id}) is still open. An outside press is judged ` +\n 'by where it started, so a press that began inside the panel does not dismiss it.'\n );\n }\n\n /**\n * The role the open panel announces — `'dialog'`.\n *\n * Worth asserting rather than assuming: the directive sets it on the OVERLAY\n * PANE, not on the panel component a consumer can see in the template.\n */\n async getRole(): Promise<string | null> {\n return (await this.pane()).getAttribute('role');\n }\n\n /**\n * The dialog's accessible name — the `ariaLabel` input, or the catalog's\n * `popconfirm.label`.\n *\n * A `role=\"dialog\"` with no name announces as a bare \"dialog\" and trips axe's\n * `aria-dialog-name`, which is why there is always one.\n */\n async getLabel(): Promise<string | null> {\n return (await this.pane()).getAttribute('aria-label');\n }\n\n /**\n * Whether the dialog claims modality.\n *\n * `false`, deliberately, and worth pinning: focus is moved into the panel but\n * NOT trapped, because Escape and an outside click both dismiss — trapping\n * would only make it harder to leave.\n */\n async isModal(): Promise<boolean> {\n return (await (await this.pane()).getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * The text a screen reader reads as the dialog's DESCRIPTION, resolved through\n * `aria-describedby` the way an assistive technology would.\n *\n * This is the question, and it is the entire content of a confirmation: without\n * the link the dialog announces its name and then nothing at all.\n */\n async getDescriptionText(): Promise<string | null> {\n const id = await (await this.pane()).getAttribute('aria-describedby');\n if (!id) return null;\n\n const described = await this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();\n return described ? described.text() : null;\n }\n\n /**\n * Which side of the trigger the panel is anchored to.\n *\n * Read off the pane's public modifier class — `position` is an input, so a\n * bound one never reaches the DOM, and the panel's own offset is a CDK inline\n * style that says nothing in a layout-less jsdom. The class names the side the\n * panel LANDED on, which is the one asked for unless it had no room there and\n * flipped; in jsdom, with no layout to run out of, the two are the same.\n */\n async getPosition(): Promise<WrPopconfirmPosition | null> {\n const classes = (await (await this.pane()).getAttribute('class')) ?? '';\n const modifier = /wr-popconfirm-overlay--([a-z]+)/.exec(classes);\n return modifier ? (modifier[1] as WrPopconfirmPosition) : null;\n }\n\n /**\n * Harnesses for anything inside the panel resolve within THIS instance's dialog.\n *\n * Scoped by the published id rather than by `.wr-popconfirm`: the overlay\n * container is shared, so a class query would answer with whichever popconfirm\n * opened first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);\n }\n\n /**\n * One of the two action buttons.\n *\n * By its own modifier class, never by index: both are a `<wr-btn size=\"sm\">`, so\n * before the modifiers existed the only thing telling them apart was document\n * order — and a harness that clicked \"the second button\" would go on passing\n * while it started confirming what a spec meant to cancel.\n */\n private async action(role: WrPopconfirmAction): Promise<TestElement> {\n return this.inPanel(`.wr-popconfirm__action--${role}`);\n }\n\n /** One element inside THIS instance's panel. */\n private async inPanel(selector: string): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()} ${selector}`)();\n }\n\n /** Every matching element inside THIS instance's panel, in document order. */\n private async allInPanel(selector: string): Promise<TestElement[]> {\n return this.documentRootLocatorFactory().locatorForAll(`#${await this.panelId()} ${selector}`)();\n }\n\n /** This instance's overlay pane — the element carrying the dialog semantics. */\n private async pane(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();\n }\n\n /** The id the trigger publishes for its dialog, which exists only while the dialog does. */\n private async panelId(): Promise<string> {\n const id = await (await this.host()).getAttribute('aria-controls');\n\n if (!id) {\n throw new Error(\n 'WrPopconfirmHarness: nothing is showing. The trigger publishes its dialog id as aria-controls ' +\n 'only while the dialog is open — call open() first.'\n );\n }\n return id;\n }\n}\n"],"mappings":";;;;;;;;AAuDA,IAAa,sBAAb,MAAa,4BAA4B,iCAAgC;CASvE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAsC,CAAA,GAAE;EAClD,OAAO,IAAI,iBAAiB,qBAAqB,OAAO,CAAC,CACtD,UAAU,eAAe,QAAQ,cAAc,SAAS,SACvD,iBAAiB,cAAc,QAAQ,eAAc,GAAI,IAAI,CAAC,CAC/D,CACA,UAAU,QAAQ,QAAQ,MAAM,OAAO,SAAS,SAAU,MAAM,QAAQ,OAAM,MAAQ,IAAI;CAC/F;CAGA,MAAM,iBAAc;EAClB,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,KAAI;CACjC;CASA,MAAM,SAAM;EACV,OAAQ,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,eAAe,MAAO;CACvE;CAGA,MAAM,mBAAgB;EACpB,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,UAAS;CACtC;CAWA,MAAM,OAAI;EACR,IAAI,MAAM,KAAK,OAAM,GAAI;EAEzB,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,MAAK;EAC/B,IAAI,MAAM,KAAK,OAAM,GAAI;EAEzB,MAAM,IAAI,MACR,kJACoD;CAExD;CAUA,MAAM,QAAK;EACT,IAAI,CAAE,MAAM,KAAK,OAAM,GAAK;EAE5B,OAAO,MAAM,KAAK,KA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AAE,CAAC,WAAW,IAAI,MAAM,KAAK,QAAO,GAAI,CAAC,CAAA;CACjF;CAGQ,MAAM,UAAO;EACnB,MAAM,KAAK,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,eAAe;EAEjE,IAAI,CAAC,IACH,MAAM,IAAI,MACR,kJACsD;EAG1D,OAAO;CACT"}
|
|
1
|
+
{"version":3,"file":"ngwr-popconfirm-testing.mjs","names":[],"sources":["../../../projects/lib/popconfirm/testing/wr-popconfirm-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrPopconfirmPosition } from 'ngwr/popconfirm';\nimport { WR_COLORS, type WrColor } from 'ngwr/theme';\n\nimport type { WrPopconfirmHarnessFilters } from './types';\n\n/** The two answers a popconfirm offers, which are also its two action modifiers. */\ntype WrPopconfirmAction = 'confirm' | 'cancel';\n\n/**\n * Test harness for `[wrPopconfirm]` — the \"are you sure?\" dialog anchored to its\n * trigger.\n *\n * The panel is NOT inside the trigger: it is a component portal in the overlay\n * container, a sibling of the whole app. So everything about it is reached\n * through the document root, scoped by the `aria-controls` id the trigger\n * publishes while the dialog is showing — which is what keeps two popconfirms\n * from reading each other's question, and why every panel reader throws while the\n * dialog is shut: there is no element to answer about.\n *\n * **The two actions are told apart by their own modifiers**, never by position.\n * `.wr-popconfirm__action--cancel` and `--confirm` are what `cancel()` and\n * `confirm()` click, so a template that ever reorders the pair cannot silently\n * turn a spec's \"cancel\" into a delete.\n *\n * Being a CONTENT CONTAINER means a consumer's own harnesses resolve INSIDE this\n * instance's panel — `popconfirm.getHarness(WrButtonHarness…)` reaches the\n * buttons without the spec ever naming the overlay.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const remove = await loader.getHarness(WrPopconfirmHarness.with({ triggerText: 'Delete' }));\n *\n * await remove.open();\n * expect(await remove.getMessage()).toBe('Delete this item?');\n * await remove.confirm();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrPopconfirmHarness extends ContentContainerComponentHarness {\n /**\n * The directive's host — whatever element the consumer put `[wrPopconfirm]` on.\n *\n * Matched by the marker class, not by `[wrPopconfirm]`: the question is normally\n * BOUND (`[wrPopconfirm]=\"question\"`), and a property binding leaves no\n * attribute in the DOM at all. Same shape as `.wr-popover-trigger` and\n * `.wr-dropdown-trigger`.\n */\n static hostSelector = '.wr-popconfirm-trigger';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrPopconfirmHarnessFilters = {}): HarnessPredicate<WrPopconfirmHarness> {\n return new HarnessPredicate(WrPopconfirmHarness, options)\n .addOption('triggerText', options.triggerText, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getTriggerText(), text)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The trigger's own visible label. The question inside the panel is `getMessage()`. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * Whether the dialog is showing.\n *\n * Read from `aria-expanded` rather than from a class, because that is the whole\n * of what the trigger tells a screen reader — the directive puts no open-state\n * class on its host at all.\n */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /**\n * Whether `wrPopconfirmDisabled` has turned the question off — read from\n * `wr-popconfirm-trigger--disabled`, the one mark a disabled trigger carries.\n * The HOST's own `disabled` is another question: the directive never sets it,\n * so ask the host's harness (`WrButtonHarness.isDisabled()`).\n */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('wr-popconfirm-trigger--disabled');\n }\n\n /** Whether the trigger currently has keyboard focus — the state it is handed back on close. */\n async isTriggerFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Press the trigger to open the dialog.\n *\n * Throws when nothing opens, because the reason is always worth failing on: a\n * native `<button disabled>` trigger never receives the click at all. (A\n * DISABLED `<wr-btn>` is a jsdom blind spot in the other direction — it is kept\n * inert by `pointer-events: none`, which jsdom does not apply, so it opens here\n * and would not in a browser.)\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrPopconfirmHarness.open(): the dialog did not open. A disabled trigger takes no click — assert ' +\n 'the disabled state instead of trying to open it.'\n );\n }\n\n /**\n * Press the trigger again to take the question back.\n *\n * This is the ONE way out that answers nothing: the directive treats a second\n * press as withdrawing the question, so `cancelled` does NOT fire — unlike\n * `cancel()`, `sendEscape()` and `clickOutside()`, which all emit it. Use this\n * when a spec needs the panel gone without recording an answer.\n */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.host()).click();\n if (!(await this.isOpen())) return;\n\n throw new Error('WrPopconfirmHarness.close(): the dialog is still open after a second press of the trigger.');\n }\n\n /** The question being asked. */\n async getMessage(): Promise<string> {\n return (await this.inPanel('.wr-popconfirm__message')).text();\n }\n\n /**\n * The confirm button's label.\n *\n * Resolved, not given: `confirmText` falls back to the `popconfirm.confirm`\n * catalog entry, so a localized app reads its own word here and a spec that\n * asserted the English default would be asserting the wrong thing.\n */\n async getConfirmText(): Promise<string> {\n return (await this.action('confirm')).text();\n }\n\n /** The cancel button's label — `cancelText`, or the `popconfirm.cancel` catalog entry. */\n async getCancelText(): Promise<string> {\n return (await this.action('cancel')).text();\n }\n\n /**\n * Both action labels in the order they are rendered: cancel first, confirm\n * second.\n *\n * That order is deliberate and worth reading — the destructive choice is the one\n * being confirmed, so the safe one comes first and takes the initial focus.\n */\n async getActionLabels(): Promise<string[]> {\n const actions = await this.allInPanel('.wr-popconfirm__action');\n return Promise.all(actions.map(action => action.text()));\n }\n\n /**\n * The confirm button's intent colour.\n *\n * Checked against `WR_COLORS` rather than pattern-matched out of the class list:\n * `wr-btn--*` also spells the size, the shape and the icon position, so only the\n * intent list can say which of them is a colour. Today `WrButton` happens to\n * emit the colour first, so a first-match regex would agree — but that order is\n * not a contract, and the same regex on a button with no colour answers `sm`.\n * Never `null` in practice — `confirmColor` defaults to `primary` — but typed\n * for it, since the button itself allows no colour at all.\n */\n async getConfirmColor(): Promise<WrColor | null> {\n const classes = (await (await this.action('confirm')).getAttribute('class')) ?? '';\n const present = classes.split(/\\s+/);\n return WR_COLORS.find(color => present.includes(`wr-btn--${color}`)) ?? null;\n }\n\n /** Which action holds keyboard focus, by label, or `null` when focus is elsewhere. */\n async getFocusedActionLabel(): Promise<string | null> {\n for (const action of await this.allInPanel('.wr-popconfirm__action')) {\n if (await action.isFocused()) return action.text();\n }\n return null;\n }\n\n /** Answer the question: click confirm, which emits `confirmed` and closes the dialog. */\n async confirm(): Promise<void> {\n return (await this.action('confirm')).click();\n }\n\n /** Decline: click cancel, which emits `cancelled` and closes the dialog. */\n async cancel(): Promise<void> {\n return (await this.action('cancel')).click();\n }\n\n /**\n * Dismiss with Escape, which emits `cancelled`.\n *\n * Sent at the pane rather than at the focused button, because the target makes\n * no difference: the key is picked up by the overlay's keyboard dispatcher,\n * which keeps one listener on the document and routes to the topmost overlay.\n * The pane is the one element guaranteed to be there.\n */\n async sendEscape(): Promise<void> {\n return (await this.pane()).sendKeys(TestKey.ESCAPE);\n }\n\n /**\n * Dismiss by pressing outside the panel, which emits `cancelled`.\n *\n * The press lands on the overlay CONTAINER — an ancestor of the pane (the CDK\n * puts a host `<div>` between the two), and so outside the panel by the only\n * measure that matters here, since the dismissal is decided by whether the press\n * started inside the pane. With two dialogs showing it dismisses BOTH: neither\n * pane contains the container. jsdom has no layout\n * and no `document.elementFromPoint`, so a harness cannot aim at \"whatever is\n * under the pointer\"; to dismiss by pressing a specific element instead, click\n * that element's own `TestElement`.\n */\n async clickOutside(): Promise<void> {\n const id = await this.panelId();\n const container = await this.documentRootLocatorFactory().locatorFor('.cdk-overlay-container')();\n\n await container.click();\n if (!(await this.isOpen())) return;\n\n throw new Error(\n `WrPopconfirmHarness.clickOutside(): the dialog (#${id}) is still open. An outside press is judged ` +\n 'by where it started, so a press that began inside the panel does not dismiss it.'\n );\n }\n\n /**\n * The role the open panel announces — `'dialog'`.\n *\n * Worth asserting rather than assuming: the directive sets it on the OVERLAY\n * PANE, not on the panel component a consumer can see in the template.\n */\n async getRole(): Promise<string | null> {\n return (await this.pane()).getAttribute('role');\n }\n\n /**\n * The dialog's accessible name — the `ariaLabel` input, or the catalog's\n * `popconfirm.label`.\n *\n * A `role=\"dialog\"` with no name announces as a bare \"dialog\" and trips axe's\n * `aria-dialog-name`, which is why there is always one.\n */\n async getLabel(): Promise<string | null> {\n return (await this.pane()).getAttribute('aria-label');\n }\n\n /**\n * Whether the dialog claims modality.\n *\n * `false`, deliberately, and worth pinning: focus is moved into the panel but\n * NOT trapped, because Escape and an outside click both dismiss — trapping\n * would only make it harder to leave.\n */\n async isModal(): Promise<boolean> {\n return (await (await this.pane()).getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * The text a screen reader reads as the dialog's DESCRIPTION, resolved through\n * `aria-describedby` the way an assistive technology would.\n *\n * This is the question, and it is the entire content of a confirmation: without\n * the link the dialog announces its name and then nothing at all.\n */\n async getDescriptionText(): Promise<string | null> {\n const id = await (await this.pane()).getAttribute('aria-describedby');\n if (!id) return null;\n\n const described = await this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();\n return described ? described.text() : null;\n }\n\n /**\n * Which side of the trigger the panel is anchored to, and how it is aligned.\n *\n * Read off the pane's public modifier class — `position` is an input, so a\n * bound one never reaches the DOM, and the panel's own offset is a CDK inline\n * style that says nothing in a layout-less jsdom. The class names the side the\n * panel LANDED on, which is the one asked for unless it had no room there and\n * flipped; in jsdom, with no layout to run out of, the two are the same.\n */\n async getPosition(): Promise<WrPopconfirmPosition | null> {\n const classes = (await (await this.pane()).getAttribute('class')) ?? '';\n const modifier = /wr-popconfirm-overlay--([a-z-]+)/.exec(classes);\n return modifier ? (modifier[1] as WrPopconfirmPosition) : null;\n }\n\n /**\n * Harnesses for anything inside the panel resolve within THIS instance's dialog.\n *\n * Scoped by the published id rather than by `.wr-popconfirm`: the overlay\n * container is shared, so a class query would answer with whichever popconfirm\n * opened first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);\n }\n\n /**\n * One of the two action buttons.\n *\n * By its own modifier class, never by index: both are a `<wr-btn size=\"sm\">`, so\n * before the modifiers existed the only thing telling them apart was document\n * order — and a harness that clicked \"the second button\" would go on passing\n * while it started confirming what a spec meant to cancel.\n */\n private async action(role: WrPopconfirmAction): Promise<TestElement> {\n return this.inPanel(`.wr-popconfirm__action--${role}`);\n }\n\n /** One element inside THIS instance's panel. */\n private async inPanel(selector: string): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()} ${selector}`)();\n }\n\n /** Every matching element inside THIS instance's panel, in document order. */\n private async allInPanel(selector: string): Promise<TestElement[]> {\n return this.documentRootLocatorFactory().locatorForAll(`#${await this.panelId()} ${selector}`)();\n }\n\n /** This instance's overlay pane — the element carrying the dialog semantics. */\n private async pane(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();\n }\n\n /** The id the trigger publishes for its dialog, which exists only while the dialog does. */\n private async panelId(): Promise<string> {\n const id = await (await this.host()).getAttribute('aria-controls');\n\n if (!id) {\n throw new Error(\n 'WrPopconfirmHarness: nothing is showing. The trigger publishes its dialog id as aria-controls ' +\n 'only while the dialog is open — call open() first.'\n );\n }\n return id;\n }\n}\n"],"mappings":";;;;;;;;AAuDA,IAAa,sBAAb,MAAa,4BAA4B,iCAAgC;CASvE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAsC,CAAA,GAAE;EAClD,OAAO,IA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ject, input, output, signal } from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, Directive, ElementRef, Injector, ViewContainerRef, ViewEncapsulation, effect, inject, input, output, signal } from "@angular/core";
|
|
3
|
+
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
3
4
|
import { wrCheckStyles, wrRestoreFocus, wrToClassList } from "ngwr/utils";
|
|
4
5
|
import { useI18nText } from "ngwr/i18n";
|
|
5
6
|
import { Directionality } from "@angular/cdk/bidi";
|
|
@@ -7,7 +8,7 @@ import { WrButton } from "ngwr/button";
|
|
|
7
8
|
import { ScrollStrategyOptions } from "@angular/cdk/overlay";
|
|
8
9
|
import { ComponentPortal } from "@angular/cdk/portal";
|
|
9
10
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
10
|
-
import { WR_OVERLAY, WrOutsideClick, wrFollowDirection, wrMirrorOffsets } from "ngwr/overlay";
|
|
11
|
+
import { WR_OVERLAY, WrOutsideClick, wrAnchoredPositions, wrFollowDirection, wrMirrorOffsets } from "ngwr/overlay";
|
|
11
12
|
import { FocusMonitor } from "@angular/cdk/a11y";
|
|
12
13
|
/**
|
|
13
14
|
* @license
|
|
@@ -28,7 +29,7 @@ var WrPopconfirmPanel = class WrPopconfirmPanel {
|
|
|
28
29
|
cancelled = output();
|
|
29
30
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
30
31
|
minVersion: "12.0.0",
|
|
31
|
-
version: "22.2.
|
|
32
|
+
version: "22.2.6",
|
|
32
33
|
ngImport: i0,
|
|
33
34
|
type: WrPopconfirmPanel,
|
|
34
35
|
deps: [],
|
|
@@ -36,7 +37,7 @@ var WrPopconfirmPanel = class WrPopconfirmPanel {
|
|
|
36
37
|
});
|
|
37
38
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
38
39
|
minVersion: "17.1.0",
|
|
39
|
-
version: "22.2.
|
|
40
|
+
version: "22.2.6",
|
|
40
41
|
type: WrPopconfirmPanel,
|
|
41
42
|
isStandalone: true,
|
|
42
43
|
selector: "wr-popconfirm",
|
|
@@ -106,7 +107,7 @@ var WrPopconfirmPanel = class WrPopconfirmPanel {
|
|
|
106
107
|
};
|
|
107
108
|
i0.ɵɵngDeclareClassMetadata({
|
|
108
109
|
minVersion: "12.0.0",
|
|
109
|
-
version: "22.2.
|
|
110
|
+
version: "22.2.6",
|
|
110
111
|
ngImport: i0,
|
|
111
112
|
type: WrPopconfirmPanel,
|
|
112
113
|
decorators: [{
|
|
@@ -177,57 +178,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
177
178
|
* Use of this source code is governed by an MIT-style license that can be
|
|
178
179
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
179
180
|
*/
|
|
180
|
-
const WR_POPCONFIRM_POSITIONS = {
|
|
181
|
-
top: {
|
|
182
|
-
originX: "center",
|
|
183
|
-
originY: "top",
|
|
184
|
-
overlayX: "center",
|
|
185
|
-
overlayY: "bottom",
|
|
186
|
-
offsetY: -8
|
|
187
|
-
},
|
|
188
|
-
bottom: {
|
|
189
|
-
originX: "center",
|
|
190
|
-
originY: "bottom",
|
|
191
|
-
overlayX: "center",
|
|
192
|
-
overlayY: "top",
|
|
193
|
-
offsetY: 8
|
|
194
|
-
},
|
|
195
|
-
left: {
|
|
196
|
-
originX: "start",
|
|
197
|
-
originY: "center",
|
|
198
|
-
overlayX: "end",
|
|
199
|
-
overlayY: "center",
|
|
200
|
-
offsetX: -8
|
|
201
|
-
},
|
|
202
|
-
right: {
|
|
203
|
-
originX: "end",
|
|
204
|
-
originY: "center",
|
|
205
|
-
overlayX: "start",
|
|
206
|
-
overlayY: "center",
|
|
207
|
-
offsetX: 8
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
const WR_POPCONFIRM_FALLBACKS = {
|
|
211
|
-
top: ["top", "bottom"],
|
|
212
|
-
bottom: ["bottom", "top"],
|
|
213
|
-
left: [
|
|
214
|
-
"left",
|
|
215
|
-
"right",
|
|
216
|
-
"bottom",
|
|
217
|
-
"top"
|
|
218
|
-
],
|
|
219
|
-
right: [
|
|
220
|
-
"right",
|
|
221
|
-
"left",
|
|
222
|
-
"bottom",
|
|
223
|
-
"top"
|
|
224
|
-
]
|
|
225
|
-
};
|
|
226
181
|
function wrPopconfirmPositions(position) {
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
})
|
|
182
|
+
return wrAnchoredPositions(position, {
|
|
183
|
+
gap: 8,
|
|
184
|
+
paneClass: "wr-popconfirm-overlay"
|
|
185
|
+
});
|
|
231
186
|
}
|
|
232
187
|
/**
|
|
233
188
|
* @license
|
|
@@ -251,6 +206,11 @@ var WrPopconfirm = class WrPopconfirm {
|
|
|
251
206
|
resolvedAriaLabel = useI18nText(this.ariaLabel, "popconfirm.label", "Confirm action");
|
|
252
207
|
confirmColor = input("primary", ...ngDevMode ? [{ debugName: "confirmColor" }] : /* istanbul ignore next */ []);
|
|
253
208
|
panelClass = input(null, ...ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []);
|
|
209
|
+
disabled = input(false, {
|
|
210
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
211
|
+
alias: "wrPopconfirmDisabled",
|
|
212
|
+
transform: coerceBooleanProperty
|
|
213
|
+
});
|
|
254
214
|
confirmed = output();
|
|
255
215
|
cancelled = output();
|
|
256
216
|
host = inject(ElementRef);
|
|
@@ -271,14 +231,18 @@ var WrPopconfirm = class WrPopconfirm {
|
|
|
271
231
|
constructor() {
|
|
272
232
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("popconfirm");
|
|
273
233
|
this.destroyRef.onDestroy(() => this.dispose());
|
|
234
|
+
effect(() => {
|
|
235
|
+
if (this.disabled()) this.close();
|
|
236
|
+
});
|
|
274
237
|
}
|
|
275
238
|
toggle(event) {
|
|
239
|
+
if (this.disabled()) return;
|
|
276
240
|
event.stopPropagation();
|
|
277
241
|
if (this.overlayRef) this.close();
|
|
278
242
|
else this.open();
|
|
279
243
|
}
|
|
280
244
|
open() {
|
|
281
|
-
if (this.overlayRef) return;
|
|
245
|
+
if (this.disabled() || this.overlayRef) return;
|
|
282
246
|
const positions = wrPopconfirmPositions(this.position());
|
|
283
247
|
const positionStrategy = this.overlay.position().flexibleConnectedTo(this.host).withPositions(wrMirrorOffsets(positions, this.isRtl())).withPush(true).withViewportMargin(VIEWPORT_MARGIN);
|
|
284
248
|
this.overlayRef = this.overlay.create({
|
|
@@ -369,7 +333,7 @@ var WrPopconfirm = class WrPopconfirm {
|
|
|
369
333
|
}
|
|
370
334
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
371
335
|
minVersion: "12.0.0",
|
|
372
|
-
version: "22.2.
|
|
336
|
+
version: "22.2.6",
|
|
373
337
|
ngImport: i0,
|
|
374
338
|
type: WrPopconfirm,
|
|
375
339
|
deps: [],
|
|
@@ -377,7 +341,7 @@ var WrPopconfirm = class WrPopconfirm {
|
|
|
377
341
|
});
|
|
378
342
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
379
343
|
minVersion: "17.1.0",
|
|
380
|
-
version: "22.2.
|
|
344
|
+
version: "22.2.6",
|
|
381
345
|
type: WrPopconfirm,
|
|
382
346
|
isStandalone: true,
|
|
383
347
|
selector: "[wrPopconfirm]",
|
|
@@ -430,6 +394,13 @@ var WrPopconfirm = class WrPopconfirm {
|
|
|
430
394
|
isSignal: true,
|
|
431
395
|
isRequired: false,
|
|
432
396
|
transformFunction: null
|
|
397
|
+
},
|
|
398
|
+
disabled: {
|
|
399
|
+
classPropertyName: "disabled",
|
|
400
|
+
publicName: "wrPopconfirmDisabled",
|
|
401
|
+
isSignal: true,
|
|
402
|
+
isRequired: false,
|
|
403
|
+
transformFunction: null
|
|
433
404
|
}
|
|
434
405
|
},
|
|
435
406
|
outputs: {
|
|
@@ -439,8 +410,9 @@ var WrPopconfirm = class WrPopconfirm {
|
|
|
439
410
|
host: {
|
|
440
411
|
listeners: { "click": "toggle($event)" },
|
|
441
412
|
properties: {
|
|
442
|
-
"
|
|
443
|
-
"attr.aria-
|
|
413
|
+
"class.wr-popconfirm-trigger--disabled": "disabled()",
|
|
414
|
+
"attr.aria-haspopup": "disabled() ? null : \"dialog\"",
|
|
415
|
+
"attr.aria-expanded": "disabled() ? null : isOpen()",
|
|
444
416
|
"attr.aria-controls": "isOpen() ? panelId : null"
|
|
445
417
|
},
|
|
446
418
|
classAttribute: "wr-popconfirm-trigger"
|
|
@@ -451,7 +423,7 @@ var WrPopconfirm = class WrPopconfirm {
|
|
|
451
423
|
};
|
|
452
424
|
i0.ɵɵngDeclareClassMetadata({
|
|
453
425
|
minVersion: "12.0.0",
|
|
454
|
-
version: "22.2.
|
|
426
|
+
version: "22.2.6",
|
|
455
427
|
ngImport: i0,
|
|
456
428
|
type: WrPopconfirm,
|
|
457
429
|
decorators: [{
|
|
@@ -461,9 +433,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
461
433
|
exportAs: "wrPopconfirm",
|
|
462
434
|
host: {
|
|
463
435
|
class: "wr-popconfirm-trigger",
|
|
436
|
+
"[class.wr-popconfirm-trigger--disabled]": "disabled()",
|
|
464
437
|
"(click)": "toggle($event)",
|
|
465
|
-
"[attr.aria-haspopup]": "\"dialog\"",
|
|
466
|
-
"[attr.aria-expanded]": "isOpen()",
|
|
438
|
+
"[attr.aria-haspopup]": "disabled() ? null : \"dialog\"",
|
|
439
|
+
"[attr.aria-expanded]": "disabled() ? null : isOpen()",
|
|
467
440
|
"[attr.aria-controls]": "isOpen() ? panelId : null"
|
|
468
441
|
}
|
|
469
442
|
}]
|
|
@@ -526,6 +499,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
526
499
|
required: false
|
|
527
500
|
}]
|
|
528
501
|
}],
|
|
502
|
+
disabled: [{
|
|
503
|
+
type: i0.Input,
|
|
504
|
+
args: [{
|
|
505
|
+
isSignal: true,
|
|
506
|
+
alias: "wrPopconfirmDisabled",
|
|
507
|
+
required: false
|
|
508
|
+
}]
|
|
509
|
+
}],
|
|
529
510
|
confirmed: [{
|
|
530
511
|
type: i0.Output,
|
|
531
512
|
args: ["confirmed"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-popconfirm.mjs","names":[],"sources":["../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/types/popconfirm-position.ts","../../../projects/lib/popconfirm/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 { Component, ViewEncapsulation, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrCheckStyles } from 'ngwr/utils';\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 constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\n }\n\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 type { ConnectedPosition } from '@angular/cdk/overlay';\n\nexport type WrPopconfirmPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * The CDK geometry for each placement — one position each. The 8px offset is\n * the gap between the trigger and the panel, the same one `wr-popover` keeps.\n *\n * @internal\n */\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/**\n * What each placement may flip to when it does not fit, best first — the chains\n * `wr-popover` uses for the same four sides, for the same reasons. The requested\n * placement leads, so a panel that fits never moves; a side placement may also\n * fall below or above, because on a phone neither side of a mid-page trigger has\n * the room.\n *\n * Each list used to hold ONE position, with `withPush(true)` and nothing to fall\n * back to. A `top` panel opened 60px under the top of a 1440×900 viewport was\n * pushed back down over its own trigger, by 20px, and a `right` panel on a 390px\n * phone ran off the edge with its Confirm button clipped — the panel covering the\n * control it was asking about, while the docs said it flips.\n *\n * @internal\n */\nexport const WR_POPCONFIRM_FALLBACKS: Record<WrPopconfirmPosition, readonly WrPopconfirmPosition[]> = {\n top: ['top', 'bottom'],\n bottom: ['bottom', 'top'],\n left: ['left', 'right', 'bottom', 'top'],\n right: ['right', 'left', 'bottom', 'top'],\n};\n\n/**\n * The list `withPositions()` wants, every link tagged with the pane class of the\n * side it puts the panel on, so the arrow (`.wr-popconfirm-overlay--<side>`)\n * follows a flip. The CDK applies a position's own `panelClass` when it lands on\n * it and clears it on the next one; the gap is an offset rather than padding, so\n * taking the class off before it measures changes nothing.\n *\n * @internal\n */\nexport function wrPopconfirmPositions(position: WrPopconfirmPosition): ConnectedPosition[] {\n return WR_POPCONFIRM_FALLBACKS[position].map(name => ({\n ...WR_POPCONFIRM_POSITIONS[name],\n panelClass: `wr-popconfirm-overlay--${name}`,\n }));\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection, wrMirrorOffsets } from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrPopconfirmPanel } from './popconfirm-panel';\nimport { type WrPopconfirmPosition, wrPopconfirmPositions } from './types';\n\n/**\n * How close, in px, `withPush` may park the panel to the viewport edge — the\n * `--wr-space-sm` step, and the value `wr-popover` uses.\n */\nconst VIEWPORT_MARGIN = 8;\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 exportAs: '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; the panel flips to another side when this one has no room. @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 /**\n * Extra CSS classes for the confirmation bubble's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\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 focusMonitor = inject(FocusMonitor);\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 injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly openState = signal(false);\n\n /** Whether the popconfirm is open. Read-only: `open()` and `close()` change it. */\n readonly isOpen = this.openState.asReadonly();\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 if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\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 // Read ONCE, here, and mirror this list rather than the input: the side is\n // chosen at open and a later `position` write moves nothing, so a follower\n // that re-read the signal would let a direction flip quietly adopt a\n // position the panel never opened with.\n //\n // The list is a fallback CHAIN, each link tagged with its own\n // `wr-popconfirm-overlay--<side>` class, so the panel flips when the side\n // asked for has no room and the arrow names the side it landed on. The\n // viewport margin is `wr-popover`'s, for the same reason: without it a pushed\n // panel parks its border on the glass.\n const positions = wrPopconfirmPositions(this.position());\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(positions, this.isRtl()))\n .withPush(true)\n .withViewportMargin(VIEWPORT_MARGIN);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: wrToClassList('wr-popconfirm-overlay', this.panelClass()),\n });\n\n // `isRtl()` above answered once, at `create()`, and so did the CDK's own\n // capture of the direction — neither is revisited if the app flips while the\n // question is still on screen. Both halves have to move: the `dir` on the\n // host, so `start` / `end` resolve to the other edge, and the mirrored list,\n // because `offsetX` is added to the final PHYSICAL x. Leave the list behind\n // and the 8px gap on `left` / `right` becomes an 8px overlap over the very\n // control the panel is asking about.\n wrFollowDirection(this.overlayRef, this.dir, this.injector, direction =>\n positionStrategy.withPositions(wrMirrorOffsets(positions, direction === 'rtl'))\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 // And it has to LEAVE with the panel: Tab past Confirm went on to the end of\n // `<body>` and Shift+Tab before Cancel to the foot of the page, each with the\n // question still on screen and `aria-expanded` still true. See `onPaneKeydown`.\n pane.addEventListener('keydown', this.onPaneKeydown);\n pane.addEventListener('focusout', this.onPaneFocusOut);\n this.openState.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 pane = this.overlayRef.overlayElement;\n const returnFocus = pane.contains(document.activeElement);\n // Before the dispose: Chromium fires `focusout` for a focused node as it is\n // removed, and the pane is about to be.\n pane.removeEventListener('keydown', this.onPaneKeydown);\n pane.removeEventListener('focusout', this.onPaneFocusOut);\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.openState.set(false);\n if (returnFocus) wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n }\n\n /**\n * Tab off either end of the panel dismisses it and takes focus back to the\n * trigger — `wr-popover`'s disclosure behaviour, for a non-modal panel whose\n * DOM sits nowhere near its trigger. Leaving is a dismissal, so `cancelled`\n * fires, as it does for Escape and an outside click.\n *\n * Forward, the trigger is focused WITHOUT `preventDefault`, so the browser's\n * own Tab runs on from there and lands on whatever follows the trigger, where a\n * panel rendered in place would have let it go. Backward, the trigger itself is\n * the destination, so the default is stopped. The panel holds two stops, Cancel\n * and Confirm, in that order.\n */\n private readonly onPaneKeydown = (event: KeyboardEvent): void => {\n const pane = this.overlayRef?.overlayElement;\n if (!pane || event.key !== 'Tab' || event.defaultPrevented) return;\n const stops = [...pane.querySelectorAll<HTMLElement>('.wr-popconfirm__action')];\n const active = document.activeElement;\n if (event.shiftKey) {\n if (active !== stops[0]) return;\n event.preventDefault();\n } else if (active !== stops.at(-1)) {\n return;\n }\n wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n this.dismiss();\n };\n\n /**\n * Focus that leaves the panel by any other road (a click on something\n * focusable elsewhere) dismisses it too, and is left where it went. A `null`\n * destination is the window losing focus or a focused node being removed,\n * neither of which is leaving.\n */\n private readonly onPaneFocusOut = (event: FocusEvent): void => {\n const next = event.relatedTarget as Node | null;\n if (!next || this.holdsFocus(next)) return;\n this.dismiss();\n };\n\n /**\n * Whether focus on `node` still belongs to this panel: inside the pane, on the\n * trigger (a press there is about to toggle it), or in an overlay opened AFTER\n * this one — the stacking `wr-popover` and `WrOutsideClick` honour, so a\n * second panel raised by `open()` does not dismiss the first by taking focus.\n */\n private holdsFocus(node: Node): boolean {\n const ref = this.overlayRef;\n if (!ref) return false;\n if (ref.overlayElement.contains(node) || this.host.nativeElement.contains(node)) return true;\n const box = ref.hostElement;\n return (\n (box.parentElement?.contains(node) ?? false) &&\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n (box.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0\n );\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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mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,YAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,WAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,YAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,WAAA;GAAA,WAAA;EAAA;EAAA,MAAA;GAAA,WAAA,EAAA,SAAA,iBAAA;GAAA,YAAA;IAAA,sBAAA;IAAA,sBAAA;IAAA,sBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,cAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAlBxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IAKJ,OAAO;IACP,WAAW;IACX,wBAAwB;IACxB,wBAAwB;IAIxB,wBAAwB;GACzB;EACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-popconfirm.mjs","names":[],"sources":["../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/types/popconfirm-position.ts","../../../projects/lib/popconfirm/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 { Component, ViewEncapsulation, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrCheckStyles } from 'ngwr/utils';\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 constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\n }\n\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 type { ConnectedPosition } from '@angular/cdk/overlay';\n\nimport { type WrAnchoredPosition, wrAnchoredPositions } from 'ngwr/overlay';\n\n/** Where the popconfirm panel sits relative to its trigger. */\nexport type WrPopconfirmPosition = WrAnchoredPosition;\n\n/**\n * The list `withPositions()` wants: the shared fallback chain `wr-popover`\n * walks, with its 8px gap, every link tagged with the pane class of the\n * placement it puts the panel on, so the arrow\n * (`.wr-popconfirm-overlay--<placement>`) follows a flip. The CDK applies a\n * position's own `panelClass` when it lands on it and clears it on the next one;\n * the gap is an offset rather than padding, so taking the class off before it\n * measures changes nothing.\n *\n * @internal\n */\nexport function wrPopconfirmPositions(position: WrPopconfirmPosition): ConnectedPosition[] {\n return wrAnchoredPositions(position, { gap: 8, paneClass: 'wr-popconfirm-overlay' });\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 { FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection, wrMirrorOffsets } from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\nimport { wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrPopconfirmPanel } from './popconfirm-panel';\nimport { type WrPopconfirmPosition, wrPopconfirmPositions } from './types';\n\n/**\n * How close, in px, `withPush` may park the panel to the viewport edge — the\n * `--wr-space-sm` step, and the value `wr-popover` uses.\n */\nconst VIEWPORT_MARGIN = 8;\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 exportAs: '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 '[class.wr-popconfirm-trigger--disabled]': 'disabled()',\n '(click)': 'toggle($event)',\n '[attr.aria-haspopup]': 'disabled() ? null : \"dialog\"',\n '[attr.aria-expanded]': 'disabled() ? null : 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 /**\n * Anchor side and alignment, the twelve placements `wr-popover` takes; the\n * panel flips to another side when this one has no room.\n * @default 'top'\n */\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 /**\n * Extra CSS classes for the confirmation bubble's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Turns the question off: a click on the host opens nothing and is left to\n * propagate, `open()` does nothing, and an open panel closes without\n * `cancelled`. The host publishes no popup ARIA meanwhile and carries\n * `wr-popconfirm-trigger--disabled`.\n *\n * The host's own `disabled` stays yours: the directive never sets it, so the\n * button still takes its own `(click)` — the way to skip the question when\n * there is nothing to confirm.\n *\n * @default false\n */\n readonly disabled = input(false, { alias: 'wrPopconfirmDisabled', transform: coerceBooleanProperty });\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 focusMonitor = inject(FocusMonitor);\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 injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly openState = signal(false);\n\n /** Whether the popconfirm is open. Read-only: `open()` and `close()` change it. */\n readonly isOpen = this.openState.asReadonly();\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 if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('popconfirm');\n this.destroyRef.onDestroy(() => this.dispose());\n effect(() => {\n if (this.disabled()) this.close();\n });\n }\n\n /** @internal */\n protected toggle(event: MouseEvent): void {\n if (this.disabled()) return;\n event.stopPropagation();\n if (this.overlayRef) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Open the panel. Does nothing while the trigger is disabled. */\n open(): void {\n if (this.disabled() || this.overlayRef) return;\n\n // Read ONCE, here, and mirror this list rather than the input: the side is\n // chosen at open and a later `position` write moves nothing, so a follower\n // that re-read the signal would let a direction flip quietly adopt a\n // position the panel never opened with.\n //\n // The list is a fallback CHAIN, each link tagged with its own\n // `wr-popconfirm-overlay--<side>` class, so the panel flips when the side\n // asked for has no room and the arrow names the side it landed on. The\n // viewport margin is `wr-popover`'s, for the same reason: without it a pushed\n // panel parks its border on the glass.\n const positions = wrPopconfirmPositions(this.position());\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(positions, this.isRtl()))\n .withPush(true)\n .withViewportMargin(VIEWPORT_MARGIN);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: wrToClassList('wr-popconfirm-overlay', this.panelClass()),\n });\n\n // `isRtl()` above answered once, at `create()`, and so did the CDK's own\n // capture of the direction — neither is revisited if the app flips while the\n // question is still on screen. Both halves have to move: the `dir` on the\n // host, so `start` / `end` resolve to the other edge, and the mirrored list,\n // because `offsetX` is added to the final PHYSICAL x. Leave the list behind\n // and the 8px gap on `left` / `right` becomes an 8px overlap over the very\n // control the panel is asking about.\n wrFollowDirection(this.overlayRef, this.dir, this.injector, direction =>\n positionStrategy.withPositions(wrMirrorOffsets(positions, direction === 'rtl'))\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 // And it has to LEAVE with the panel: Tab past Confirm went on to the end of\n // `<body>` and Shift+Tab before Cancel to the foot of the page, each with the\n // question still on screen and `aria-expanded` still true. See `onPaneKeydown`.\n pane.addEventListener('keydown', this.onPaneKeydown);\n pane.addEventListener('focusout', this.onPaneFocusOut);\n this.openState.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 pane = this.overlayRef.overlayElement;\n const returnFocus = pane.contains(document.activeElement);\n // Before the dispose: Chromium fires `focusout` for a focused node as it is\n // removed, and the pane is about to be.\n pane.removeEventListener('keydown', this.onPaneKeydown);\n pane.removeEventListener('focusout', this.onPaneFocusOut);\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.openState.set(false);\n if (returnFocus) wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n }\n\n /**\n * Tab off either end of the panel dismisses it and takes focus back to the\n * trigger — `wr-popover`'s disclosure behaviour, for a non-modal panel whose\n * DOM sits nowhere near its trigger. Leaving is a dismissal, so `cancelled`\n * fires, as it does for Escape and an outside click.\n *\n * Forward, the trigger is focused WITHOUT `preventDefault`, so the browser's\n * own Tab runs on from there and lands on whatever follows the trigger, where a\n * panel rendered in place would have let it go. Backward, the trigger itself is\n * the destination, so the default is stopped. The panel holds two stops, Cancel\n * and Confirm, in that order.\n */\n private readonly onPaneKeydown = (event: KeyboardEvent): void => {\n const pane = this.overlayRef?.overlayElement;\n if (!pane || event.key !== 'Tab' || event.defaultPrevented) return;\n const stops = [...pane.querySelectorAll<HTMLElement>('.wr-popconfirm__action')];\n const active = document.activeElement;\n if (event.shiftKey) {\n if (active !== stops[0]) return;\n event.preventDefault();\n } else if (active !== stops.at(-1)) {\n return;\n }\n wrRestoreFocus(this.host.nativeElement, this.focusMonitor);\n this.dismiss();\n };\n\n /**\n * Focus that leaves the panel by any other road (a click on something\n * focusable elsewhere) dismisses it too, and is left where it went. A `null`\n * destination is the window losing focus or a focused node being removed,\n * neither of which is leaving.\n */\n private readonly onPaneFocusOut = (event: FocusEvent): void => {\n const next = event.relatedTarget as Node | null;\n if (!next || this.holdsFocus(next)) return;\n this.dismiss();\n };\n\n /**\n * Whether focus on `node` still belongs to this panel: inside the pane, on the\n * trigger (a press there is about to toggle it), or in an overlay opened AFTER\n * this one — the stacking `wr-popover` and `WrOutsideClick` honour, so a\n * second panel raised by `open()` does not dismiss the first by taking focus.\n */\n private holdsFocus(node: Node): boolean {\n const ref = this.overlayRef;\n if (!ref) return false;\n if (ref.overlayElement.contains(node) || this.host.nativeElement.contains(node)) return true;\n const box = ref.hostElement;\n return (\n (box.parentElement?.contains(node) ?? false) &&\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n (box.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0\n );\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"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,IAAa,oBAAb,MAAa,kBAAiB;CAC5B,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,YAAY;CAC/E;CAES,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAGlC,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACtC,cAAc,MAAc,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CACtC,aAAa,MAAc,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,eAAe,MAAe,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAExC,YAAY,OAAM;CAClB,YAAY,OAAM;CAdhB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAiB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAA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
16
|
var WrPopoverHarness = class WrPopoverHarness extends ContentContainerComponentHarness {
|
|
17
17
|
static hostSelector = ".wr-popover-trigger";
|
|
18
18
|
static with(options = {}) {
|
|
19
|
-
return new HarnessPredicate(WrPopoverHarness, options).addOption("triggerText", options.triggerText, (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text)).addOption("mode", options.mode, async (harness, mode) => await harness.getMode() === mode).addOption("open", options.open, async (harness, open) => await harness.isOpen() === open);
|
|
19
|
+
return new HarnessPredicate(WrPopoverHarness, options).addOption("triggerText", options.triggerText, (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text)).addOption("mode", options.mode, async (harness, mode) => !await harness.isDisabled() && await harness.getMode() === mode).addOption("open", options.open, async (harness, open) => await harness.isOpen() === open).addOption("disabled", options.disabled, async (harness, disabled) => await harness.isDisabled() === disabled);
|
|
20
20
|
}
|
|
21
21
|
async getMode() {
|
|
22
|
+
if (await this.isDisabled()) throw new Error("WrPopoverHarness.getMode(): the trigger is disabled (`wrPopoverDisabled`), and a disabled trigger publishes no ARIA to tell a popover from a tooltip by. Assert isDisabled() instead.");
|
|
22
23
|
return await (await this.host()).getAttribute("aria-haspopup") === "dialog" ? "popover" : "tooltip";
|
|
23
24
|
}
|
|
24
25
|
async getTriggerText() {
|
|
25
26
|
return (await this.host()).text();
|
|
26
27
|
}
|
|
28
|
+
async isDisabled() {
|
|
29
|
+
return (await this.host()).hasClass("wr-popover-trigger--disabled");
|
|
30
|
+
}
|
|
27
31
|
async isOpen() {
|
|
32
|
+
if (await this.isDisabled()) return false;
|
|
28
33
|
const host = await this.host();
|
|
29
34
|
return await this.getMode() === "popover" ? await host.getAttribute("aria-expanded") === "true" : await host.getAttribute("aria-describedby") !== null;
|
|
30
35
|
}
|
|
31
36
|
async open(timeout = DEFAULT_TIMEOUT) {
|
|
37
|
+
if (await this.isDisabled()) throw new Error("WrPopoverHarness.open(): the trigger is disabled (`wrPopoverDisabled`), so nothing opens it. Assert isDisabled() instead of trying to open it.");
|
|
32
38
|
if (await this.isOpen()) return;
|
|
33
39
|
const host = await this.host();
|
|
34
40
|
await host.hover();
|