ngwr 11.2.0 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -26
- package/burger/styles/_index.scss +1 -1
- package/button/styles/_index.scss +2 -2
- package/calendar/styles/_index.scss +32 -12
- package/calendar-heatmap/styles/_index.scss +20 -0
- package/carousel/styles/_index.scss +23 -1
- package/cascader/styles/_index.scss +15 -3
- package/checkbox/styles/_index.scss +2 -2
- package/collapse/styles/_index.scss +2 -2
- package/color-picker/styles/_index.scss +3 -3
- package/compare/styles/_index.scss +18 -2
- package/context-menu/styles/_index.scss +21 -2
- package/date-picker/styles/_index.scss +5 -5
- package/descriptions/styles/_index.scss +1 -1
- package/drag-drop/styles/_index.scss +28 -1
- package/drawer/styles/_index.scss +37 -0
- package/dropdown/styles/_index.scss +2 -2
- package/event-calendar/styles/_index.scss +67 -10
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-aurora.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-bar-chart-testing.mjs +20 -2
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +4 -4
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +29 -17
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-heatmap.mjs +17 -5
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +187 -9
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +10 -10
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +124 -24
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +48 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-circular-text.mjs +4 -4
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +27 -7
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +26 -6
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +98 -8
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +14 -5
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-confetti.mjs +31 -6
- package/fesm2022/ngwr-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs +9 -0
- package/fesm2022/ngwr-config.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs +30 -11
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +333 -43
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +25 -9
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/{ngwr-date-adapter-fns.mjs → ngwr-date-adapters-fns.mjs} +37 -10
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -0
- package/fesm2022/{ngwr-date-adapter-luxon.mjs → ngwr-date-adapters-luxon.mjs} +5 -5
- package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker-testing.mjs +11 -6
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +119 -37
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/{ngwr-date-adapter.mjs → ngwr-date.mjs} +36 -10
- package/fesm2022/ngwr-date.mjs.map +1 -0
- package/fesm2022/ngwr-decrypt-text.mjs +3 -3
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +73 -18
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +12 -12
- package/fesm2022/ngwr-divider.mjs +52 -5
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart-testing.mjs +8 -4
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +7 -7
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +160 -11
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +121 -58
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +26 -10
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +28 -15
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text-testing.mjs +5 -3
- package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +75 -46
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +3 -3
- package/fesm2022/ngwr-form.mjs +32 -15
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +21 -11
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +3 -3
- package/fesm2022/ngwr-glitch-text-testing.mjs +51 -17
- package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +7 -7
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text-testing.mjs +46 -11
- package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +4 -4
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +24 -9
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +73 -1
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +55 -1
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +26 -15
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper-testing.mjs +53 -9
- package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +150 -12
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs +15 -10
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +17 -10
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs +12 -6
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +24 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +4 -4
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +73 -26
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +7 -7
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +7 -7
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +66 -8
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +4 -4
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-media.mjs +3 -3
- package/fesm2022/ngwr-mention.mjs +108 -13
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-meter-group-testing.mjs +26 -6
- package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +3 -3
- package/fesm2022/ngwr-overlay.mjs +6 -6
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination-testing.mjs +6 -6
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +83 -16
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +39 -26
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +6 -6
- package/fesm2022/ngwr-popover-testing.mjs +7 -2
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +155 -33
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +3 -3
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +42 -5
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +21 -30
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text.mjs +3 -3
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented-testing.mjs +85 -1
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +123 -10
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +159 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +11 -9
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +31 -16
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +100 -9
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +3 -3
- package/fesm2022/ngwr-speed-dial-testing.mjs +15 -13
- package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +27 -12
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splash-cursor.mjs +3 -3
- package/fesm2022/ngwr-split-text.mjs +17 -5
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-spotlight-card.mjs +7 -7
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +6 -6
- package/fesm2022/ngwr-star-border.mjs +4 -4
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper-testing.mjs +8 -8
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +33 -8
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +17 -5
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table.mjs +99 -39
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +11 -10
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +36 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +181 -4
- package/fesm2022/ngwr-theme.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +7 -7
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +9 -9
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +34 -10
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +3 -3
- package/fesm2022/ngwr-tree.mjs +28 -10
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter-testing.mjs +15 -1
- package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +13 -5
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +5 -2
- 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 +4 -4
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +4 -4
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +94 -24
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +2 -2
- package/glitch-text/styles/_index.scss +27 -12
- package/i18n/en.json +56 -6
- package/i18n/ru.json +56 -6
- package/image-cropper/styles/_index.scss +19 -0
- package/input/styles/_index.scss +2 -2
- package/input-number/styles/_index.scss +2 -2
- package/input-otp/styles/_index.scss +9 -2
- package/knob/styles/_index.scss +1 -1
- package/lightbox/styles/_index.scss +16 -2
- package/line-chart/styles/_index.scss +28 -14
- package/list/styles/_index.scss +1 -1
- package/llms-full.txt +19 -24
- package/llms.txt +46 -8
- package/markdown/styles/_index.scss +3 -3
- package/mcp/api.js +6 -4
- package/mcp/catalog.js +40 -3
- package/mcp/providers.js +16 -3
- package/mcp/tools.js +21 -1
- package/meter-group/styles/_index.scss +1 -1
- package/overlay/styles/_index.scss +33 -1
- package/package.json +17 -12
- package/pagination/styles/_index.scss +23 -1
- package/popover/styles/_index.scss +16 -7
- package/progress/styles/_index.scss +1 -1
- package/radio/styles/_index.scss +2 -2
- package/rating/styles/_index.scss +1 -1
- package/schematics/collection.json +1 -1
- package/schematics/migrations/v12/index.js +65 -0
- package/schematics/migrations/v7/index.js +12 -1
- package/schematics/migrations/v8/index.js +10 -1
- package/schematics/migrations.json +5 -0
- package/schematics/ng-add/index.js +8 -3
- package/schematics/provider/index.js +80 -13
- package/schematics/use/index.js +9 -129
- package/schematics/use/rule.js +206 -0
- package/schematics/use/symbol-map.json +4 -4
- package/segmented/styles/_index.scss +14 -3
- package/select/styles/_index.scss +14 -2
- package/sidebar/styles/_index.scss +12 -10
- package/skills/ngwr/SKILL.md +7 -5
- package/skills/ngwr/references/catalog.md +9 -9
- package/skills/ngwr/references/setup.md +10 -5
- package/slider/styles/_index.scss +1 -1
- package/speed-dial/styles/_index.scss +1 -1
- package/stepper/styles/_index.scss +12 -3
- package/switch/styles/_index.scss +2 -2
- package/table/styles/_index.scss +61 -12
- package/tabs/styles/_index.scss +1 -1
- package/textarea/styles/_index.scss +1 -1
- package/theme/styles/_colors.scss +142 -56
- package/theme/styles/_dark.scss +46 -3
- package/theme/styles/_focus.scss +28 -5
- package/theme/styles/_mixins.scss +1 -1
- package/theme/styles/_variables.scss +67 -0
- package/transfer/styles/_index.scss +26 -3
- package/tree/styles/_index.scss +29 -6
- package/types/ngwr-bar-chart-testing.d.ts +9 -1
- package/types/ngwr-blur-text.d.ts +8 -4
- package/types/ngwr-breadcrumbs.d.ts +17 -10
- package/types/ngwr-calendar-testing.d.ts +1 -1
- package/types/ngwr-calendar.d.ts +66 -0
- package/types/ngwr-carousel.d.ts +85 -6
- package/types/ngwr-cascader.d.ts +17 -0
- package/types/ngwr-click-spark.d.ts +4 -0
- package/types/ngwr-color-picker-testing.d.ts +8 -0
- package/types/ngwr-color-picker.d.ts +21 -1
- package/types/ngwr-confetti.d.ts +8 -0
- package/types/ngwr-config.d.ts +10 -1
- package/types/ngwr-context-menu-testing.d.ts +24 -11
- package/types/ngwr-context-menu.d.ts +56 -0
- package/types/ngwr-counter.d.ts +1 -0
- package/types/{ngwr-date-adapter-fns.d.ts → ngwr-date-adapters-fns.d.ts} +33 -6
- package/types/{ngwr-date-adapter-luxon.d.ts → ngwr-date-adapters-luxon.d.ts} +1 -1
- package/types/ngwr-date-picker-testing.d.ts +11 -6
- package/types/ngwr-date-picker.d.ts +8 -4
- package/types/{ngwr-date-adapter.d.ts → ngwr-date.d.ts} +24 -5
- package/types/ngwr-dialog.d.ts +38 -1
- package/types/ngwr-divider.d.ts +25 -0
- package/types/ngwr-donut-chart-testing.d.ts +7 -3
- package/types/ngwr-donut-chart.d.ts +3 -3
- package/types/ngwr-drag-drop.d.ts +56 -2
- package/types/ngwr-drawer.d.ts +56 -5
- package/types/ngwr-event-calendar.d.ts +8 -2
- package/types/ngwr-falling-text-testing.d.ts +5 -3
- package/types/ngwr-falling-text.d.ts +1 -1
- package/types/ngwr-form.d.ts +12 -2
- package/types/ngwr-glitch-text-testing.d.ts +37 -8
- package/types/ngwr-gradient-text-testing.d.ts +16 -3
- package/types/ngwr-i18n.d.ts +13 -4
- package/types/ngwr-image-cropper-testing.d.ts +49 -10
- package/types/ngwr-image-cropper.d.ts +70 -5
- package/types/ngwr-input-number-testing.d.ts +15 -10
- package/types/ngwr-input-number.d.ts +11 -4
- package/types/ngwr-input-otp-testing.d.ts +12 -6
- package/types/ngwr-input-otp.d.ts +15 -1
- package/types/ngwr-line-chart.d.ts +20 -3
- package/types/ngwr-markdown.d.ts +11 -0
- package/types/ngwr-mention.d.ts +32 -0
- package/types/ngwr-meter-group-testing.d.ts +12 -2
- package/types/ngwr-overlay.d.ts +1 -0
- package/types/ngwr-pagination-testing.d.ts +4 -4
- package/types/ngwr-pagination.d.ts +11 -0
- package/types/ngwr-pipes.d.ts +1 -1
- package/types/ngwr-popover-testing.d.ts +7 -2
- package/types/ngwr-popover.d.ts +1 -0
- package/types/ngwr-result.d.ts +6 -0
- package/types/ngwr-segmented-testing.d.ts +53 -0
- package/types/ngwr-segmented.d.ts +107 -5
- package/types/ngwr-select.d.ts +68 -6
- package/types/ngwr-shiny-text.d.ts +4 -2
- package/types/ngwr-sidebar.d.ts +14 -5
- package/types/ngwr-slider.d.ts +69 -1
- package/types/ngwr-speed-dial-testing.d.ts +15 -11
- package/types/ngwr-speed-dial.d.ts +22 -3
- package/types/ngwr-split-text.d.ts +9 -0
- package/types/ngwr-stepper-testing.d.ts +5 -5
- package/types/ngwr-stepper.d.ts +8 -0
- package/types/ngwr-storage.d.ts +1 -0
- package/types/ngwr-table.d.ts +104 -11
- package/types/ngwr-tabs-testing.d.ts +11 -10
- package/types/ngwr-tabs.d.ts +2 -0
- package/types/ngwr-theme.d.ts +82 -1
- package/types/ngwr-tour.d.ts +22 -4
- package/types/ngwr-tree.d.ts +5 -4
- package/types/ngwr-typewriter-testing.d.ts +10 -0
- package/types/ngwr-utils.d.ts +5 -2
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +39 -11
- package/typography/styles/_index.scss +1 -1
- package/window/styles/_index.scss +72 -26
- package/fesm2022/ngwr-date-adapter-fns.mjs.map +0 -1
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +0 -1
- package/fesm2022/ngwr-date-adapter.mjs.map +0 -1
|
@@ -41,12 +41,19 @@ class WrDateAdapter {
|
|
|
41
41
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
42
42
|
*/
|
|
43
43
|
/**
|
|
44
|
-
* BCP 47 locale tag
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* `'en-US'` on the server.
|
|
44
|
+
* BCP 47 locale tag the {@link WrDateAdapter} implementations read. Defaults to
|
|
45
|
+
* `navigator.language` in the browser and `'en-US'` on the server; override via
|
|
46
|
+
* {@link provideWrDateAdapter}'s `locale` option.
|
|
48
47
|
*
|
|
49
|
-
*
|
|
48
|
+
* **How far it reaches depends on the adapter, and the difference matters.**
|
|
49
|
+
* The luxon adapter threads it through everything — every `DateTime` is
|
|
50
|
+
* constructed with it, and `format` / `parse` call `setLocale`. The date-fns
|
|
51
|
+
* adapter reads it only for locale-DERIVED defaults (first day of week); its
|
|
52
|
+
* `format` and `parse` pass no locale to date-fns, so they stay on that
|
|
53
|
+
* library's module default. Setting this token and expecting French month names
|
|
54
|
+
* out of `WrDateFnsAdapter` gets English ones, and the parse side of that
|
|
55
|
+
* mismatch is silent rather than loud — see the adapter's own class docs for the
|
|
56
|
+
* lever (`setDefaultOptions`).
|
|
50
57
|
*/
|
|
51
58
|
const WR_DATE_LOCALE = new InjectionToken('WR_DATE_LOCALE', {
|
|
52
59
|
providedIn: 'root',
|
|
@@ -227,7 +234,7 @@ class WrNativeDateAdapter extends WrDateAdapter {
|
|
|
227
234
|
// while still accepting any other string as a raw token pattern.
|
|
228
235
|
format(date, formatKeyOrString) {
|
|
229
236
|
if (isNamedFormat(formatKeyOrString)) {
|
|
230
|
-
return
|
|
237
|
+
return this.intl(formatKeyOrString).format(date);
|
|
231
238
|
}
|
|
232
239
|
return this.formatWithTokens(date, formatKeyOrString);
|
|
233
240
|
}
|
|
@@ -259,6 +266,25 @@ class WrNativeDateAdapter extends WrDateAdapter {
|
|
|
259
266
|
}
|
|
260
267
|
return this.locale.toLowerCase().startsWith('en-us') ? 0 : 1;
|
|
261
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* One `Intl.DateTimeFormat` per named format, built once.
|
|
271
|
+
*
|
|
272
|
+
* Constructing one is the expensive part of `format()`, and this adapter is
|
|
273
|
+
* called per CELL: `wr-event-calendar` builds an `aria-label` for every time
|
|
274
|
+
* slot on every day, so a week view asked for hundreds of identical
|
|
275
|
+
* formatters. `locale` is injected once and never changes for the life of the
|
|
276
|
+
* adapter, so the cache needs no invalidation — that is the whole reason it
|
|
277
|
+
* can be this simple.
|
|
278
|
+
*/
|
|
279
|
+
formatters = new Map();
|
|
280
|
+
intl(key) {
|
|
281
|
+
let found = this.formatters.get(key);
|
|
282
|
+
if (!found) {
|
|
283
|
+
found = new Intl.DateTimeFormat(this.locale, INTL_OPTIONS[key]);
|
|
284
|
+
this.formatters.set(key, found);
|
|
285
|
+
}
|
|
286
|
+
return found;
|
|
287
|
+
}
|
|
262
288
|
getDayOfWeekNames(style) {
|
|
263
289
|
const formatter = new Intl.DateTimeFormat(this.locale, { weekday: style });
|
|
264
290
|
const first = this.getFirstDayOfWeek();
|
|
@@ -424,10 +450,10 @@ class WrNativeDateAdapter extends WrDateAdapter {
|
|
|
424
450
|
return null;
|
|
425
451
|
return out;
|
|
426
452
|
}
|
|
427
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
428
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.
|
|
453
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrNativeDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
454
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.4", ngImport: i0, type: WrNativeDateAdapter });
|
|
429
455
|
}
|
|
430
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrNativeDateAdapter, decorators: [{
|
|
431
457
|
type: Service
|
|
432
458
|
}] });
|
|
433
459
|
|
|
@@ -467,4 +493,4 @@ function provideWrDateAdapter(options = {}) {
|
|
|
467
493
|
*/
|
|
468
494
|
|
|
469
495
|
export { WR_DATE_LOCALE, WrDateAdapter, WrNativeDateAdapter, isNamedFormat, provideWrDateAdapter };
|
|
470
|
-
//# sourceMappingURL=ngwr-date
|
|
496
|
+
//# sourceMappingURL=ngwr-date.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngwr-date.mjs","sources":["../../../projects/lib/date/wr-date-adapter.ts","../../../projects/lib/date/tokens/wr-date-locale.token.ts","../../../projects/lib/date/wr-native-date-adapter.ts","../../../projects/lib/date/provide-wr-date-adapter.ts","../../../projects/lib/date/ngwr-date.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrDateFormat } from './interfaces';\n\n/**\n * Abstraction over a date object so the calendar, date picker and time picker\n * can work with `Date`, `date-fns`, `luxon`, or any other library a consumer\n * prefers — without changing component code.\n *\n * Default implementation: {@link WrNativeDateAdapter} (native `Date`,\n * `Intl.DateTimeFormat`). Register a different adapter via\n * `provideWrDateAdapter({ adapter: MyAdapter })`.\n *\n * Used as both the type and the DI token — `inject(WrDateAdapter)` works\n * directly thanks to Angular's class-as-token resolution.\n *\n * Every \"mutating\" method (`addX`, `setTime`) returns a **new** value;\n * adapters never mutate in place so consumers can pass dates around safely.\n */\nexport abstract class WrDateAdapter<TDate = Date> {\n // Construction & identity\n\n /** Current moment. */\n abstract today(): TDate;\n\n /** Defensive clone — must return an independent value, never the same reference. */\n abstract clone(date: TDate): TDate;\n\n /** Build a date from year / month (0-based) / day. */\n abstract createDate(year: number, month: number, day: number): TDate;\n\n /** `false` for `NaN` / invalid input. */\n abstract isValid(date: TDate): boolean;\n\n // Accessors\n\n abstract getYear(date: TDate): number;\n /** `0` (January) – `11` (December). */\n abstract getMonth(date: TDate): number;\n /** Day of the month, `1`-`31`. */\n abstract getDate(date: TDate): number;\n /** `0` (Sunday) – `6` (Saturday). */\n abstract getDayOfWeek(date: TDate): number;\n abstract getDaysInMonth(date: TDate): number;\n abstract getHours(date: TDate): number;\n abstract getMinutes(date: TDate): number;\n abstract getSeconds(date: TDate): number;\n\n // Immutable math\n\n abstract addYears(date: TDate, amount: number): TDate;\n abstract addMonths(date: TDate, amount: number): TDate;\n abstract addDays(date: TDate, amount: number): TDate;\n /** Returns a new date with the time portion replaced. */\n abstract setTime(date: TDate, hours: number, minutes: number, seconds: number): TDate;\n\n // Comparison\n\n abstract isSameDay(a: TDate, b: TDate): boolean;\n abstract isSameMonth(a: TDate, b: TDate): boolean;\n /** Negative if `a < b`, positive if `a > b`, zero if equal (compared at day precision). */\n abstract compareDate(a: TDate, b: TDate): number;\n\n /**\n * Convenience used by the calendar's range UI. Inclusive on both ends.\n * Implementation can stay on the base class because it delegates to\n * `compareDate`.\n */\n isWithinRange(date: TDate, start: TDate, end: TDate): boolean {\n return this.compareDate(date, start) >= 0 && this.compareDate(date, end) <= 0;\n }\n\n // Formatting / parsing\n\n /**\n * Format a date. Accepts either a named {@link WrDateFormat} key (which the\n * adapter resolves locale-aware) or a raw format string (`'dd.MM.yyyy'`).\n *\n * Supported tokens for raw strings: `yyyy`, `yy`, `MMMM`, `MMM`, `MM`, `M`,\n * `dd`, `d`, `HH`, `H`, `hh`, `h`, `mm`, `ss`, `a` (am / pm).\n */\n abstract format(date: TDate, formatKeyOrString: WrDateFormat | (string & {})): string;\n\n /**\n * Parse a string into a date. Returns `null` when parsing fails. Accepts\n * the same `formatKeyOrString` set as {@link format}.\n */\n abstract parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): TDate | null;\n\n // Locale info\n\n /** `0` Sunday, `1` Monday — locale-dependent. */\n abstract getFirstDayOfWeek(): number;\n\n /** Names ordered from `getFirstDayOfWeek()` onwards. Length 7. */\n abstract getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[];\n\n /** Names from January (index `0`) to December (`11`). Length 12. */\n abstract getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[];\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 { isPlatformBrowser } from '@angular/common';\nimport { InjectionToken, PLATFORM_ID, inject } from '@angular/core';\n\n/**\n * BCP 47 locale tag the {@link WrDateAdapter} implementations read. Defaults to\n * `navigator.language` in the browser and `'en-US'` on the server; override via\n * {@link provideWrDateAdapter}'s `locale` option.\n *\n * **How far it reaches depends on the adapter, and the difference matters.**\n * The luxon adapter threads it through everything — every `DateTime` is\n * constructed with it, and `format` / `parse` call `setLocale`. The date-fns\n * adapter reads it only for locale-DERIVED defaults (first day of week); its\n * `format` and `parse` pass no locale to date-fns, so they stay on that\n * library's module default. Setting this token and expecting French month names\n * out of `WrDateFnsAdapter` gets English ones, and the parse side of that\n * mismatch is silent rather than loud — see the adapter's own class docs for the\n * lever (`setDefaultOptions`).\n */\nexport const WR_DATE_LOCALE = new InjectionToken<string>('WR_DATE_LOCALE', {\n providedIn: 'root',\n factory: () => {\n // Node 21+ also defines `navigator`, and reports the *build machine's*\n // locale — so a `typeof` probe silently bakes that locale into\n // prerendered output (wrong month names, wrong first day of week).\n // Ask the platform instead.\n if (isPlatformBrowser(inject(PLATFORM_ID)) && navigator.language) {\n return navigator.language;\n }\n return 'en-US';\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 { Service, inject } from '@angular/core';\n\nimport type { WrDateFormat } from './interfaces';\nimport { WR_DATE_LOCALE } from './tokens';\nimport { WrDateAdapter } from './wr-date-adapter';\n\nconst NAMED_KEYS = new Set<WrDateFormat>([\n 'shortDate',\n 'mediumDate',\n 'longDate',\n 'time',\n 'shortDateTime',\n 'mediumDateTime',\n]);\n\nconst INTL_OPTIONS: Readonly<Record<WrDateFormat, Intl.DateTimeFormatOptions>> = {\n shortDate: { year: 'numeric', month: 'numeric', day: 'numeric' },\n mediumDate: { year: 'numeric', month: 'short', day: 'numeric' },\n longDate: { year: 'numeric', month: 'long', day: 'numeric' },\n time: { hour: '2-digit', minute: '2-digit' },\n shortDateTime: { year: 'numeric', month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit' },\n mediumDateTime: { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' },\n};\n\n/** Recognised tokens, longest first so `MMMM` matches before `MMM`. */\n/**\n * Every token, with single-quoted runs taken FIRST so they win.\n *\n * Without that, the one-letter tokens match letters inside literal text: `'yyyy [year]'`\n * came out as `2025 [yeamr]`, because the `a` in \"year\" was read as the meridiem token.\n * Quote literals the way `DatePipe` and LDML do — `'at'` — and `''` for a real quote.\n */\nconst PART_RE = /'([^']*)'|yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|H|hh|h|mm|ss|a/g;\n\nfunction pad(n: number, width = 2): string {\n return String(Math.abs(n)).padStart(width, '0');\n}\n\n/** Whether `value` is one of the shared named format keys. */\nfunction isNamedFormat(value: string): value is WrDateFormat {\n return NAMED_KEYS.has(value as WrDateFormat);\n}\n\nfunction tokenToRegex(token: string): string {\n switch (token) {\n case 'yyyy':\n return '(\\\\d{4})';\n case 'yy':\n return '(\\\\d{2})';\n case 'MM':\n case 'dd':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n return '(\\\\d{2})';\n case 'M':\n case 'd':\n case 'H':\n case 'h':\n return '(\\\\d{1,2})';\n case 'a':\n return '(am|pm|AM|PM)';\n default:\n return '(.+)';\n }\n}\n\n/**\n * Reference {@link WrDateAdapter} implementation backed by the native `Date`\n * object and `Intl.DateTimeFormat`. Zero external dependencies. Suitable for\n * most apps — swap to a `date-fns` / `luxon` adapter only when you need\n * timezone-aware math or richer parsing.\n */\n@Service()\nexport class WrNativeDateAdapter extends WrDateAdapter<Date> {\n private readonly locale = inject(WR_DATE_LOCALE);\n\n // Construction & identity\n\n today(): Date {\n return new Date();\n }\n\n clone(date: Date): Date {\n return new Date(date.getTime());\n }\n\n createDate(year: number, month: number, day: number): Date {\n // Native Date constructor with year < 100 maps to 1900 + year unless we explicitly setFullYear.\n const d = new Date(year, month, day);\n if (year >= 0 && year < 100) d.setFullYear(year);\n return d;\n }\n\n isValid(date: Date): boolean {\n return date instanceof Date && !Number.isNaN(date.getTime());\n }\n\n // Accessors\n\n getYear(date: Date): number {\n return date.getFullYear();\n }\n\n getMonth(date: Date): number {\n return date.getMonth();\n }\n\n getDate(date: Date): number {\n return date.getDate();\n }\n\n getDayOfWeek(date: Date): number {\n return date.getDay();\n }\n\n getDaysInMonth(date: Date): number {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n }\n\n getHours(date: Date): number {\n return date.getHours();\n }\n\n getMinutes(date: Date): number {\n return date.getMinutes();\n }\n\n getSeconds(date: Date): number {\n return date.getSeconds();\n }\n\n // Immutable math\n\n addYears(date: Date, amount: number): Date {\n const d = this.clone(date);\n d.setFullYear(d.getFullYear() + amount);\n return d;\n }\n\n addMonths(date: Date, amount: number): Date {\n const d = this.clone(date);\n const desiredDay = d.getDate();\n d.setDate(1);\n d.setMonth(d.getMonth() + amount);\n // Clamp day to the new month's length (Jan 31 + 1 month → Feb 28/29).\n d.setDate(Math.min(desiredDay, this.getDaysInMonth(d)));\n return d;\n }\n\n addDays(date: Date, amount: number): Date {\n // A calendar day, not 86 400 000 ms. Where daylight saving applies a day can be 23 or\n // 25 hours long, so millisecond arithmetic drifts the wall clock and — across an\n // autumn change — lands back on the same calendar date, which makes a month grid\n // repeat a day and lose one. Not observable in a fixed-offset timezone, which is why\n // the reason lives here rather than only in a test.\n const d = this.clone(date);\n d.setDate(d.getDate() + amount);\n return d;\n }\n\n setTime(date: Date, hours: number, minutes: number, seconds: number): Date {\n const d = this.clone(date);\n d.setHours(hours, minutes, seconds, 0);\n return d;\n }\n\n // Comparison\n\n isSameDay(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n }\n\n isSameMonth(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n }\n\n compareDate(a: Date, b: Date): number {\n const ay = a.getFullYear();\n const by = b.getFullYear();\n if (ay !== by) return ay - by;\n const am = a.getMonth();\n const bm = b.getMonth();\n if (am !== bm) return am - bm;\n return a.getDate() - b.getDate();\n }\n\n // Formatting / parsing\n\n // `(string & {})` keeps autocomplete for the WrDateFormat literals\n // while still accepting any other string as a raw token pattern.\n format(date: Date, formatKeyOrString: WrDateFormat | (string & {})): string {\n if (isNamedFormat(formatKeyOrString)) {\n return this.intl(formatKeyOrString).format(date);\n }\n return this.formatWithTokens(date, formatKeyOrString);\n }\n\n parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): Date | null {\n const raw = value?.trim();\n if (!raw) return null;\n\n // Named formats fall back to `new Date()` parsing — best-effort, locale-fragile.\n if (isNamedFormat(formatKeyOrString)) {\n const d = new Date(raw);\n return this.isValid(d) ? d : null;\n }\n\n return this.parseWithTokens(raw, formatKeyOrString);\n }\n\n // Locale info\n\n getFirstDayOfWeek(): number {\n // `Intl.Locale.prototype.getWeekInfo` is Stage 3 — not in TS lib types yet,\n // so we probe at runtime through an unknown cast.\n try {\n const locale = new Intl.Locale(this.locale) as unknown as { getWeekInfo?: () => { firstDay: number } };\n const info = locale.getWeekInfo?.();\n if (info && typeof info.firstDay === 'number') {\n // Intl uses 1 (Mon) – 7 (Sun); we use 0 (Sun) – 6 (Sat).\n return info.firstDay % 7;\n }\n } catch {\n // Browser doesn't support Intl.Locale or getWeekInfo — fall through.\n }\n return this.locale.toLowerCase().startsWith('en-us') ? 0 : 1;\n }\n\n /**\n * One `Intl.DateTimeFormat` per named format, built once.\n *\n * Constructing one is the expensive part of `format()`, and this adapter is\n * called per CELL: `wr-event-calendar` builds an `aria-label` for every time\n * slot on every day, so a week view asked for hundreds of identical\n * formatters. `locale` is injected once and never changes for the life of the\n * adapter, so the cache needs no invalidation — that is the whole reason it\n * can be this simple.\n */\n private readonly formatters = new Map<string, Intl.DateTimeFormat>();\n\n private intl(key: WrDateFormat): Intl.DateTimeFormat {\n let found = this.formatters.get(key);\n if (!found) {\n found = new Intl.DateTimeFormat(this.locale, INTL_OPTIONS[key]);\n this.formatters.set(key, found);\n }\n return found;\n }\n\n getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n const formatter = new Intl.DateTimeFormat(this.locale, { weekday: style });\n const first = this.getFirstDayOfWeek();\n // Pick a reference Sunday and walk seven days.\n const base = new Date(2024, 0, 7); // Sunday 7 Jan 2024\n const out: string[] = [];\n for (let i = 0; i < 7; i++) {\n const d = new Date(base);\n d.setDate(base.getDate() + ((first + i) % 7));\n out.push(formatter.format(d));\n }\n return out;\n }\n\n getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n const formatter = new Intl.DateTimeFormat(this.locale, { month: style });\n const out: string[] = [];\n for (let i = 0; i < 12; i++) {\n out.push(formatter.format(new Date(2024, i, 15)));\n }\n return out;\n }\n\n // Internals: token-based format / parse\n\n private formatWithTokens(date: Date, pattern: string): string {\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n const hours24 = date.getHours();\n const hours12 = hours24 % 12 === 0 ? 12 : hours24 % 12;\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n const monthNames = this.getMonthNames('long');\n const monthShort = this.getMonthNames('short');\n\n return pattern.replace(PART_RE, (part, quoted?: string) => {\n // A quoted run is emitted as-is; `''` is how a single quote is written.\n if (quoted !== undefined) return quoted === '' ? \"'\" : quoted;\n const token = part;\n switch (token) {\n case 'yyyy':\n return pad(year, 4);\n case 'yy':\n return pad(year % 100, 2);\n case 'MMMM':\n return monthNames[month] ?? '';\n case 'MMM':\n return monthShort[month] ?? '';\n case 'MM':\n return pad(month + 1);\n case 'M':\n return String(month + 1);\n case 'dd':\n return pad(day);\n case 'd':\n return String(day);\n case 'HH':\n return pad(hours24);\n case 'H':\n return String(hours24);\n case 'hh':\n return pad(hours12);\n case 'h':\n return String(hours12);\n case 'mm':\n return pad(minutes);\n case 'ss':\n return pad(seconds);\n case 'a':\n return hours24 < 12 ? 'am' : 'pm';\n }\n return token;\n });\n }\n\n private parseWithTokens(value: string, pattern: string): Date | null {\n const tokens: string[] = [];\n const monthLong = this.getMonthNames('long');\n const monthShort = this.getMonthNames('short');\n const escaped = pattern.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regex = escaped.replace(PART_RE, (part, quoted?: string) => {\n if (quoted !== undefined) {\n // Literal text matches itself and captures nothing, so the token indices stay\n // aligned with the groups below.\n return quoted === '' ? \"'\" : quoted;\n }\n tokens.push(part);\n return tokenToRegex(part);\n });\n\n const match = new RegExp(`^${regex}$`).exec(value);\n if (!match) return null;\n\n let year = new Date().getFullYear();\n let month = 0;\n let day = 1;\n let hours = 0;\n let minutes = 0;\n let seconds = 0;\n let isPm = false;\n let hadHour12 = false;\n let hour12 = 0;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const raw = match[i + 1];\n const n = Number(raw);\n switch (token) {\n case 'yyyy':\n year = n;\n break;\n case 'yy':\n year = 2000 + n;\n break;\n case 'MM':\n case 'M':\n month = n - 1;\n break;\n case 'MMM':\n case 'MMMM': {\n const names = token === 'MMM' ? monthShort : monthLong;\n const found = names.findIndex(name => name.toLowerCase() === raw.toLowerCase());\n if (found < 0) return null;\n month = found;\n break;\n }\n case 'dd':\n case 'd':\n day = n;\n break;\n case 'HH':\n case 'H':\n hours = n;\n break;\n case 'hh':\n case 'h':\n hadHour12 = true;\n hour12 = n;\n break;\n case 'mm':\n minutes = n;\n break;\n case 'ss':\n seconds = n;\n break;\n case 'a':\n isPm = raw.toLowerCase() === 'pm';\n break;\n }\n }\n\n if (hadHour12) {\n hours = (hour12 % 12) + (isPm ? 12 : 0);\n }\n\n // `new Date(2025, 12, 45)` does not fail — it rolls forward into the next year — and\n // `isValid` is happy with the result, so a text field turned nonsense into a confident\n // wrong answer. The clock parts are range-checked directly; the month and the day are\n // checked by comparing what came back, which catches every rollover including a month\n // of 12 or -1.\n if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || seconds > 59) return null;\n\n const out = new Date(year, month, day, hours, minutes, seconds);\n if (!this.isValid(out)) return null;\n // The day is range-checked by construction: anything the calendar rolled over comes\n // back as a different month or a different day.\n if (out.getMonth() !== month || out.getDate() !== day) return null;\n return out;\n }\n}\n\nexport { isNamedFormat };\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 EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport type { WrDateAdapterOptions } from './interfaces';\nimport { WR_DATE_LOCALE } from './tokens';\nimport { WrDateAdapter } from './wr-date-adapter';\nimport { WrNativeDateAdapter } from './wr-native-date-adapter';\n\n/**\n * Register the date adapter and locale used by the calendar / date picker /\n * time picker. Call once at bootstrap.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWrDateAdapter(), // native, browser locale\n * // provideWrDateAdapter({ locale: 'ru-RU' }),\n * // provideWrDateAdapter({ adapter: MyDateFnsAdapter, locale: 'fr' }),\n * ],\n * });\n * ```\n */\nexport function provideWrDateAdapter(options: WrDateAdapterOptions = {}): EnvironmentProviders {\n const providers: Parameters<typeof makeEnvironmentProviders>[0] = [\n { provide: WrDateAdapter, useClass: options.adapter ?? WrNativeDateAdapter },\n ];\n\n if (options.locale) {\n providers.push({ provide: WR_DATE_LOCALE, useValue: options.locale });\n }\n\n return makeEnvironmentProviders(providers);\n}\n\nexport type { WrDateAdapterOptions } from './interfaces';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAIH;;;;;;;;;;;;;;AAcG;MACmB,aAAa,CAAA;AA4CjC;;;;AAIG;AACH,IAAA,aAAa,CAAC,IAAW,EAAE,KAAY,EAAE,GAAU,EAAA;QACjD,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;IAC/E;AA6BD;;ACxGD;;;;;AAKG;AAKH;;;;;;;;;;;;;;AAcG;MACU,cAAc,GAAG,IAAI,cAAc,CAAS,gBAAgB,EAAE;AACzE,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;;;;;AAKZ,QAAA,IAAI,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,SAAS,CAAC,QAAQ,EAAE;YAChE,OAAO,SAAS,CAAC,QAAQ;QAC3B;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-398,10 +398,10 @@ class WrDecryptText {
|
|
|
398
398
|
})
|
|
399
399
|
.join('');
|
|
400
400
|
}
|
|
401
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
402
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
401
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDecryptText, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
402
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: WrDecryptText, isStandalone: true, selector: "wr-decrypt-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, maxIterations: { classPropertyName: "maxIterations", publicName: "maxIterations", isSignal: true, isRequired: false, transformFunction: null }, sequential: { classPropertyName: "sequential", publicName: "sequential", isSignal: true, isRequired: false, transformFunction: null }, revealDirection: { classPropertyName: "revealDirection", publicName: "revealDirection", isSignal: true, isRequired: false, transformFunction: null }, useOriginalCharsOnly: { classPropertyName: "useOriginalCharsOnly", publicName: "useOriginalCharsOnly", isSignal: true, isRequired: false, transformFunction: null }, characters: { classPropertyName: "characters", publicName: "characters", isSignal: true, isRequired: false, transformFunction: null }, animateOn: { classPropertyName: "animateOn", publicName: "animateOn", isSignal: true, isRequired: false, transformFunction: null }, clickMode: { classPropertyName: "clickMode", publicName: "clickMode", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "click": "onClick()" }, classAttribute: "wr-decrypt-text" }, ngImport: i0, template: "<span class=\"wr-decrypt-text__sr-only\">{{ text() }}</span>\n<span aria-hidden=\"true\">\n @for (c of chars(); track $index) {\n <span [class]=\"c.revealed ? 'wr-decrypt-text__char' : 'wr-decrypt-text__char wr-decrypt-text__char--encrypted'\">{{\n c.ch\n }}</span>\n }\n</span>\n", styles: [".wr-decrypt-text{display:inline-block;white-space:pre-wrap}.wr-decrypt-text__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.wr-decrypt-text__char{display:inline}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
403
403
|
}
|
|
404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDecryptText, decorators: [{
|
|
405
405
|
type: Component,
|
|
406
406
|
args: [{ selector: 'wr-decrypt-text', encapsulation: ViewEncapsulation.None, host: {
|
|
407
407
|
class: 'wr-decrypt-text',
|
|
@@ -89,10 +89,10 @@ class WrDensity {
|
|
|
89
89
|
return;
|
|
90
90
|
this.storage.set(this.config.storageKey, density);
|
|
91
91
|
}
|
|
92
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
93
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDensity, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
93
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.4", ngImport: i0, type: WrDensity });
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDensity, decorators: [{
|
|
96
96
|
type: Service
|
|
97
97
|
}], ctorParameters: () => [] });
|
|
98
98
|
|
|
@@ -126,10 +126,10 @@ class WrDensityDirective {
|
|
|
126
126
|
this.host.nativeElement.setAttribute(this.config.attribute, this.wrDensity());
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
130
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.
|
|
129
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDensityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
130
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: WrDensityDirective, isStandalone: true, selector: "[wrDensity]", inputs: { wrDensity: { classPropertyName: "wrDensity", publicName: "wrDensity", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
131
131
|
}
|
|
132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDensityDirective, decorators: [{
|
|
133
133
|
type: Directive,
|
|
134
134
|
args: [{
|
|
135
135
|
selector: '[wrDensity]',
|
|
@@ -50,10 +50,10 @@ class WrDescriptions {
|
|
|
50
50
|
return parts.join(' ');
|
|
51
51
|
}, /* @ts-ignore */
|
|
52
52
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
53
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
54
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDescriptions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: WrDescriptions, isStandalone: true, selector: "wr-descriptions", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: "@if (title()) {\n <div class=\"wr-descriptions__title\">{{ title() }}</div>\n}\n<!--\n A plain <div> with ARIA term/definition roles on the item, not a <dl>:\n the rows are their own component, so the real DOM is\n `<dl><wr-description-item><dt>\u2026` \u2014 which the HTML content model forbids and\n which breaks the term/definition association in AT. `role=\"term\"` /\n `role=\"definition\"` carry the same semantics with no required parent, so they\n survive the component boundary (and `display: contents` on the row).\n-->\n<div class=\"wr-descriptions__list\">\n <ng-content />\n</div>\n", encapsulation: i0.ViewEncapsulation.None });
|
|
55
55
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDescriptions, decorators: [{
|
|
57
57
|
type: Component,
|
|
58
58
|
args: [{ selector: 'wr-descriptions', encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()' }, template: "@if (title()) {\n <div class=\"wr-descriptions__title\">{{ title() }}</div>\n}\n<!--\n A plain <div> with ARIA term/definition roles on the item, not a <dl>:\n the rows are their own component, so the real DOM is\n `<dl><wr-description-item><dt>\u2026` \u2014 which the HTML content model forbids and\n which breaks the term/definition association in AT. `role=\"term\"` /\n `role=\"definition\"` carry the same semantics with no required parent, so they\n survive the component boundary (and `display: contents` on the row).\n-->\n<div class=\"wr-descriptions__list\">\n <ng-content />\n</div>\n" }]
|
|
59
59
|
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }] } });
|
|
@@ -71,10 +71,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
71
71
|
class WrDescriptionItem {
|
|
72
72
|
label = input('', /* @ts-ignore */
|
|
73
73
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
74
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
75
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.
|
|
74
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDescriptionItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
75
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: WrDescriptionItem, isStandalone: true, selector: "wr-description-item", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-descriptions__row" }, ngImport: i0, template: "<div class=\"wr-descriptions__label\" role=\"term\">{{ label() }}</div><div class=\"wr-descriptions__value\" role=\"definition\"><ng-content /></div>", isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
76
76
|
}
|
|
77
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDescriptionItem, decorators: [{
|
|
78
78
|
type: Component,
|
|
79
79
|
args: [{
|
|
80
80
|
selector: 'wr-description-item',
|
package/fesm2022/ngwr-dialog.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
|
2
2
|
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
3
3
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
4
|
-
import { isPlatformBrowser } from '@angular/common';
|
|
4
|
+
import { isPlatformBrowser, Location } from '@angular/common';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { InjectionToken, inject, EnvironmentInjector, PLATFORM_ID, Injector,
|
|
6
|
+
import { InjectionToken, inject, EnvironmentInjector, PLATFORM_ID, Injector, afterEveryRender, Service, ElementRef, Directive, input, computed } from '@angular/core';
|
|
7
7
|
import { WrI18n } from 'ngwr/i18n';
|
|
8
8
|
import { WR_OVERLAY, WR_RESPONSIVE_OVERLAYS, wrPresentAsSheet, wrAppendOverlayClose } from 'ngwr/overlay';
|
|
9
9
|
import { ReplaySubject } from 'rxjs';
|
|
10
|
+
import * as i1 from '@angular/cdk/scrolling';
|
|
11
|
+
import { CdkScrollable } from '@angular/cdk/scrolling';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* @license
|
|
@@ -209,6 +211,9 @@ class WrDialog {
|
|
|
209
211
|
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
210
212
|
responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);
|
|
211
213
|
i18n = inject(WrI18n, { optional: true });
|
|
214
|
+
// Resolvable wherever the CDK's own `Overlay` is — it injects the same thing
|
|
215
|
+
// to implement `disposeOnNavigation`.
|
|
216
|
+
location = inject(Location);
|
|
212
217
|
open(component, options = {}) {
|
|
213
218
|
const panelClasses = [DEFAULT_PANEL_CLASS];
|
|
214
219
|
const extra = options.panelClass;
|
|
@@ -266,11 +271,23 @@ class WrDialog {
|
|
|
266
271
|
// Has to wait for a render, not a microtask: attaching the portal only
|
|
267
272
|
// schedules change detection, so under zoneless CD a microtask runs while
|
|
268
273
|
// the content is still an empty view and the title id doesn't exist yet.
|
|
269
|
-
|
|
274
|
+
//
|
|
275
|
+
// And after EVERY render, not just the next one: the title belongs to the
|
|
276
|
+
// caller's component, so an `@if` or a late-arriving heading can replace
|
|
277
|
+
// or remove the element the attribute names. A reference to a node that is
|
|
278
|
+
// no longer there is not a name — the dialog announces as unnamed — so a
|
|
279
|
+
// missing title clears the attribute rather than leaving it dangling.
|
|
280
|
+
const labelSync = afterEveryRender(() => {
|
|
270
281
|
const titleEl = host.querySelector('[wrDialogTitle], [wr-dialog-title]');
|
|
271
282
|
if (titleEl?.id)
|
|
272
283
|
host.setAttribute('aria-labelledby', titleEl.id);
|
|
284
|
+
else
|
|
285
|
+
host.removeAttribute('aria-labelledby');
|
|
273
286
|
}, { injector: this.parentInjector });
|
|
287
|
+
// The hook is bound to the root injector, so it outlives the dialog unless
|
|
288
|
+
// it is torn down with it. `detachments()` fires on dispose, which is the
|
|
289
|
+
// one path every dismissal goes through.
|
|
290
|
+
overlayRef.detachments().subscribe(() => labelSync.destroy());
|
|
274
291
|
// Trap focus inside the dialog and move initial focus in.
|
|
275
292
|
const trap = this.focusTrapFactory.create(host);
|
|
276
293
|
dialogRef.focusTrap = trap;
|
|
@@ -289,8 +306,35 @@ class WrDialog {
|
|
|
289
306
|
}
|
|
290
307
|
});
|
|
291
308
|
}
|
|
309
|
+
if (options.closeOnNavigation !== false) {
|
|
310
|
+
this.watchNavigation(overlayRef, dialogRef);
|
|
311
|
+
}
|
|
292
312
|
return dialogRef;
|
|
293
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* Tie the dialog's lifetime to the URL it was opened on.
|
|
316
|
+
*
|
|
317
|
+
* Nothing else does. The overlay belongs to a root service and is dismissed
|
|
318
|
+
* only by the backdrop, Escape or an explicit `close()`, so pressing Back
|
|
319
|
+
* swapped the routed view underneath and left the modal pane, its backdrop and
|
|
320
|
+
* its focus trap sitting over a page the user never opened them on.
|
|
321
|
+
*
|
|
322
|
+
* `onUrlChange`, not `Location.subscribe()` — which is what CDK's own
|
|
323
|
+
* `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an
|
|
324
|
+
* in-app `router.navigate()` left the dialog standing. And `dialogRef.close()`
|
|
325
|
+
* rather than disposing the overlay behind the ref's back, which would never
|
|
326
|
+
* emit `closed`, never destroy the focus trap, and leave `awaitClose()`
|
|
327
|
+
* pending forever.
|
|
328
|
+
*/
|
|
329
|
+
watchNavigation(overlayRef, dialogRef) {
|
|
330
|
+
const stopWatching = this.location.onUrlChange(() => dialogRef.close());
|
|
331
|
+
// Unhooked a microtask late, because `Location` notifies its listeners with
|
|
332
|
+
// a `forEach` and unregistering splices the array it is iterating: removing
|
|
333
|
+
// ours synchronously from inside the notification would shift the next entry
|
|
334
|
+
// into the slot forEach has already passed, and a SECOND stacked dialog
|
|
335
|
+
// would be skipped and left behind.
|
|
336
|
+
overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));
|
|
337
|
+
}
|
|
294
338
|
/**
|
|
295
339
|
* The dismiss button's accessible name.
|
|
296
340
|
*
|
|
@@ -307,10 +351,10 @@ class WrDialog {
|
|
|
307
351
|
const resolved = this.i18n?.t('dialog.close');
|
|
308
352
|
return !resolved || resolved === 'dialog.close' ? 'Close dialog' : resolved;
|
|
309
353
|
}
|
|
310
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
311
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.
|
|
354
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialog, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
355
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.4", ngImport: i0, type: WrDialog });
|
|
312
356
|
}
|
|
313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialog, decorators: [{
|
|
314
358
|
type: Service
|
|
315
359
|
}] });
|
|
316
360
|
|
|
@@ -336,10 +380,10 @@ class WrDialogTitle {
|
|
|
336
380
|
id = `wr-dialog-title-${++uid}`;
|
|
337
381
|
/** @internal */
|
|
338
382
|
elementRef = inject((ElementRef));
|
|
339
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
340
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.
|
|
383
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
384
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: WrDialogTitle, isStandalone: true, selector: "[wrDialogTitle]", host: { properties: { "attr.id": "id" }, classAttribute: "wr-dialog__title" }, ngImport: i0 });
|
|
341
385
|
}
|
|
342
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogTitle, decorators: [{
|
|
343
387
|
type: Directive,
|
|
344
388
|
args: [{
|
|
345
389
|
selector: '[wrDialogTitle]',
|
|
@@ -356,20 +400,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
356
400
|
/**
|
|
357
401
|
* Styles the scrollable body section of a dialog.
|
|
358
402
|
*
|
|
403
|
+
* `CdkScrollable` is a host directive because this element is a real scroll
|
|
404
|
+
* container (`overflow: auto`) and an anchored overlay opened from inside it has
|
|
405
|
+
* to follow its trigger. CDK's `reposition()` strategy listens to
|
|
406
|
+
* `ScrollDispatcher`, which is fed by registered scrollables plus ONE
|
|
407
|
+
* non-capturing `document` listener — and element `scroll` does not bubble, so
|
|
408
|
+
* without the registration a `<wr-select>` halfway down a long dialog form kept
|
|
409
|
+
* its panel pinned to the viewport while the trigger scrolled away. Angular
|
|
410
|
+
* Material carries the same host directive on `MatDialogContent` for the same
|
|
411
|
+
* reason.
|
|
412
|
+
*
|
|
359
413
|
* @example
|
|
360
414
|
* ```html
|
|
361
415
|
* <div wrDialogContent>…body…</div>
|
|
362
416
|
* ```
|
|
363
417
|
*/
|
|
364
418
|
class WrDialogContent {
|
|
365
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
366
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.
|
|
419
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
420
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: WrDialogContent, isStandalone: true, selector: "[wrDialogContent]", host: { classAttribute: "wr-dialog__content" }, hostDirectives: [{ directive: i1.CdkScrollable }], ngImport: i0 });
|
|
367
421
|
}
|
|
368
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogContent, decorators: [{
|
|
369
423
|
type: Directive,
|
|
370
424
|
args: [{
|
|
371
425
|
selector: '[wrDialogContent]',
|
|
372
426
|
host: { class: 'wr-dialog__content' },
|
|
427
|
+
hostDirectives: [CdkScrollable],
|
|
373
428
|
}]
|
|
374
429
|
}] });
|
|
375
430
|
|
|
@@ -400,10 +455,10 @@ class WrDialogFooter {
|
|
|
400
455
|
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
401
456
|
classes = computed(() => `wr-dialog__footer wr-dialog__footer--${this.align()}`, /* @ts-ignore */
|
|
402
457
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
403
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
404
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.
|
|
458
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
459
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: WrDialogFooter, isStandalone: true, selector: "[wrDialogFooter]", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
|
|
405
460
|
}
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogFooter, decorators: [{
|
|
407
462
|
type: Directive,
|
|
408
463
|
args: [{
|
|
409
464
|
selector: '[wrDialogFooter]',
|
|
@@ -441,10 +496,10 @@ class WrDialogClose {
|
|
|
441
496
|
onClick() {
|
|
442
497
|
this.ref?.close(this.result());
|
|
443
498
|
}
|
|
444
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
445
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.
|
|
499
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogClose, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
500
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: WrDialogClose, isStandalone: true, selector: "[wrDialogClose]", inputs: { result: { classPropertyName: "result", publicName: "wrDialogClose", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
446
501
|
}
|
|
447
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrDialogClose, decorators: [{
|
|
448
503
|
type: Directive,
|
|
449
504
|
args: [{
|
|
450
505
|
selector: '[wrDialogClose]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-dialog.mjs","sources":["../../../projects/lib/dialog/dialog-ref.ts","../../../projects/lib/dialog/tokens/dialog-data.token.ts","../../../projects/lib/dialog/tokens/dialog-ref.token.ts","../../../projects/lib/dialog/dialog.ts","../../../projects/lib/dialog/directives/dialog-title.ts","../../../projects/lib/dialog/directives/dialog-content.ts","../../../projects/lib/dialog/directives/dialog-footer.ts","../../../projects/lib/dialog/directives/dialog-close.ts","../../../projects/lib/dialog/ngwr-dialog.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConfigurableFocusTrap } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\n/**\n * Handle returned by `WrDialog.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the dialog's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDialogClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = dialog.open<ConfirmComponent, boolean>(ConfirmComponent);\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the dialog closes itself.\n * @Component({...})\n * export class ConfirmComponent {\n * private readonly ref = inject(WrDialogRef);\n *\n * save(): void {\n * this.store.save();\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDialogRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: ConfigurableFocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n constructor(private readonly _overlayRef: OverlayRef) {}\n\n /** The instantiated dialog component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDialogRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the dialog, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n\n /** Resolves with the close result when the dialog is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\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 { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDialog.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ConfirmComponent {\n * readonly data = inject<ConfirmData>(WR_DIALOG_DATA);\n * }\n * ```\n */\nexport const WR_DIALOG_DATA = new InjectionToken<unknown>('WR_DIALOG_DATA');\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 { InjectionToken } from '@angular/core';\n\nimport type { WrDialogRef } from '../dialog-ref';\n\n/**\n * Token exposing the open dialog's `WrDialogRef` to components and\n * directives rendered inside it (e.g. `[wrDialogClose]`).\n *\n * **Prefer `inject(WrDialogRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDialogRef, { optional: true })`\n * works for content that also renders outside a dialog, and\n * `inject<WrDialogRef<ConfirmComponent, boolean>>(WrDialogRef)` types the\n * generics without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDialogClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ConfirmComponent {\n * private readonly ref = inject<WrDialogRef<ConfirmComponent, boolean>>(WrDialogRef);\n *\n * confirm(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DIALOG_REF = new InjectionToken<WrDialogRef<unknown, unknown>>('WR_DIALOG_REF');\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 { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Service, Injector, PLATFORM_ID, afterNextRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport { WR_OVERLAY, WR_RESPONSIVE_OVERLAYS, wrAppendOverlayClose, wrPresentAsSheet } from 'ngwr/overlay';\n\nimport { WrDialogRef } from './dialog-ref';\nimport type { WrDialogOptions } from './interfaces';\nimport { WR_DIALOG_DATA, WR_DIALOG_REF } from './tokens';\n\nconst DEFAULT_PANEL_CLASS = 'wr-dialog-panel';\nconst DEFAULT_BACKDROP_CLASS = 'wr-dialog-backdrop';\n\n/**\n * Opens dialog components in an isolated NGWR overlay.\n *\n * Uses `WR_OVERLAY` so it composes cleanly with `provideWrOverlay()`\n * — dialogs render into NGWR's own overlay container and never collide\n * with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * @example\n * ```ts\n * const dialog = inject(WrDialog);\n *\n * const ref = dialog.open(ConfirmComponent, {\n * data: { message: 'Delete this item?' },\n * width: '24rem',\n * });\n *\n * const ok = await ref.awaitClose();\n * if (ok) remove();\n * ```\n *\n * @see https://ngwr.dev/reference/components/dialog\n */\n@Service()\nexport class WrDialog {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);\n private readonly i18n = inject(WrI18n, { optional: true });\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDialogOptions<D> = {}): WrDialogRef<C, R> {\n const panelClasses: string[] = [DEFAULT_PANEL_CLASS];\n const extra = options.panelClass;\n if (typeof extra === 'string') {\n panelClasses.push(extra);\n } else if (extra) {\n for (const cls of extra) panelClasses.push(cls);\n }\n\n // On small viewports (when opted in) present as a slide-up sheet pinned\n // to the bottom edge, full-width, instead of a centred modal.\n const asSheet = wrPresentAsSheet(options.responsive, this.responsiveConfig);\n if (asSheet) panelClasses.push('wr-overlay-sheet');\n\n const position = this.overlay.position().global().centerHorizontally();\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy: asSheet ? position.bottom('0') : position.centerVertically(),\n scrollStrategy: this.scrollStrategies.block(),\n hasBackdrop: true,\n backdropClass: DEFAULT_BACKDROP_CLASS,\n panelClass: panelClasses,\n width: asSheet ? '100%' : options.width,\n maxWidth: asSheet ? '100%' : options.maxWidth,\n });\n\n const dialogRef = new WrDialogRef<C, R>(overlayRef);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n dialogRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DIALOG_DATA, useValue: options.data },\n { provide: WR_DIALOG_REF, useValue: dialogRef },\n // Provided as its own token as well, so dialog content can reach for\n // the familiar `inject(WrDialogRef)` and close itself.\n { provide: WrDialogRef, useValue: dialogRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n dialogRef.componentRef = overlayRef.attach(portal);\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n // Built-in dismiss. Appended after the content portal so it paints above\n // it, and marked on the panel so the title reserves the corner gutter.\n if (options.closable !== false) {\n host.classList.add('wr-dialog-panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-dialog__close', label, () => dialogRef.close());\n }\n // Wire aria-labelledby to wrDialogTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n afterNextRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDialogTitle], [wr-dialog-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n },\n { injector: this.parentInjector }\n );\n // Trap focus inside the dialog and move initial focus in.\n const trap = this.focusTrapFactory.create(host);\n dialogRef.focusTrap = trap;\n void trap.focusInitialElementWhenReady();\n }\n\n // Overlay subscriptions complete when the overlay is disposed, so no\n // explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => dialogRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n dialogRef.close();\n }\n });\n }\n\n return dialogRef;\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Two failure modes, and resolving PER OPEN is what covers both. `t()` hands\n * back the KEY on a miss, and `WrI18n` is root-provided with an empty catalog\n * by default, so an app that never configured i18n named its dismiss button\n * \"dialog.close\" — a name axe cannot fault, because a name is present, and a\n * screen reader reads out verbatim. Resolving once at injection time fixed\n * that but froze the answer: this is a root service, constructed before an\n * async catalog has loaded, so a localized app got the English fallback on\n * every dialog it ever opened.\n */\n private closeLabel(): string {\n const resolved = this.i18n?.t('dialog.close');\n return !resolved || resolved === 'dialog.close' ? 'Close dialog' : resolved;\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 { Directive, ElementRef, inject } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Styles a dialog title row. Use on a heading inside an opened dialog.\n * Auto-assigns an `id` so the dialog panel can reference it via\n * `aria-labelledby`.\n *\n * @example\n * ```html\n * <h2 wrDialogTitle>Confirm delete</h2>\n * ```\n */\n@Directive({\n selector: '[wrDialogTitle]',\n host: { class: 'wr-dialog__title', '[attr.id]': 'id' },\n})\nexport class WrDialogTitle {\n /** Generated id used for `aria-labelledby` wiring. */\n readonly id = `wr-dialog-title-${++uid}`;\n\n /** @internal */\n readonly elementRef = inject(ElementRef<HTMLElement>);\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 { Directive } from '@angular/core';\n\n/**\n * Styles the scrollable body section of a dialog.\n *\n * @example\n * ```html\n * <div wrDialogContent>…body…</div>\n * ```\n */\n@Directive({\n selector: '[wrDialogContent]',\n host: { class: 'wr-dialog__content' },\n})\nexport class WrDialogContent {}\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 { Directive, computed, input } from '@angular/core';\n\n/**\n * Footer row, typically holding action buttons.\n *\n * @example\n * ```html\n * <div wrDialogFooter align=\"end\">\n * <wr-btn wrDialogClose>Cancel</wr-btn>\n * <wr-btn color=\"danger\" (click)=\"confirm()\">Delete</wr-btn>\n * </div>\n * ```\n */\n@Directive({\n selector: '[wrDialogFooter]',\n host: { '[class]': 'classes()' },\n})\nexport class WrDialogFooter {\n /**\n * Horizontal alignment of the children.\n *\n * @default 'end'\n */\n readonly align = input<'start' | 'center' | 'end'>('end');\n\n protected readonly classes = computed(() => `wr-dialog__footer wr-dialog__footer--${this.align()}`);\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 { Directive, inject, input } from '@angular/core';\n\nimport type { WrDialogRef } from '../dialog-ref';\nimport { WR_DIALOG_REF } from '../tokens';\n\n/**\n * Closes the dialog when the host element is clicked.\n *\n * Optionally passes a `[wrDialogClose]` value as the close result.\n *\n * @example\n * ```html\n * <wr-btn wrDialogClose>Cancel</wr-btn>\n * <wr-btn color=\"primary\" [wrDialogClose]=\"true\">Confirm</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDialogClose]',\n host: { '(click)': 'onClick()' },\n})\nexport class WrDialogClose<R = unknown> {\n /**\n * Value to pass to `close()`. When unset — or used as a bare attribute — the\n * dialog closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDialogClose',\n // A bare `wrDialogClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`. Matches `wrDrawerClose`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly ref = inject<WrDialogRef<unknown, R>>(WR_DIALOG_REF, { optional: true });\n\n protected onClick(): void {\n this.ref?.close(this.result());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAQH;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MACU,WAAW,CAAA;AAoBO,IAAA,WAAA;AAnB7B;;;;;;;AAOG;AACM,IAAA,MAAM,GAAG,IAAI,aAAa,CAAgB,CAAC,CAAC;;IAGrD,YAAY,GAA2B,IAAI;;IAG3C,SAAS,GAAiC,IAAI;;IAG9C,iBAAiB,GAAuB,IAAI;AAE5C,IAAA,WAAA,CAA6B,WAAuB,EAAA;QAAvB,IAAA,CAAA,WAAW,GAAX,WAAW;IAAe;;AAGvD,IAAA,IAAI,iBAAiB,GAAA;AACnB,QAAA,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;AACtB,YAAA,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC;QAC5D;AACA,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ;IACnC;IAEQ,QAAQ,GAAG,KAAK;;AAGxB,IAAA,KAAK,CAAC,MAAU,EAAA;QACd,IAAI,IAAI,CAAC,QAAQ;YAAE;AACnB,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;AACpB,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;;;;;AAKtB,QAAA,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,cAAc,CAA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AA,MAAM,GAAG,KAAK,CAAoC,SAAS,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,QAAA,EAAA,8BAAA,EAAA,CAAA,EAClE,KAAK,EAAE,eAAe;;;AAGtB,QAAA,SAAS,EAAE,KAAK,KAAK,KAAK,KAAK,EAAE,GAAG,SAAS,GAAG,KAAK,CAAC,GACtD;IAEe,GAAG,GAAG,MAAM,CAA0B,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAE/E,OAAO,GAAA;QACf,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChC;uGAhBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;AACjC,iBAAA;;;AC1BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-dialog.mjs","sources":["../../../projects/lib/dialog/dialog-ref.ts","../../../projects/lib/dialog/tokens/dialog-data.token.ts","../../../projects/lib/dialog/tokens/dialog-ref.token.ts","../../../projects/lib/dialog/dialog.ts","../../../projects/lib/dialog/directives/dialog-title.ts","../../../projects/lib/dialog/directives/dialog-content.ts","../../../projects/lib/dialog/directives/dialog-footer.ts","../../../projects/lib/dialog/directives/dialog-close.ts","../../../projects/lib/dialog/ngwr-dialog.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { ConfigurableFocusTrap } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\n/**\n * Handle returned by `WrDialog.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the dialog's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDialogClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = dialog.open<ConfirmComponent, boolean>(ConfirmComponent);\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the dialog closes itself.\n * @Component({...})\n * export class ConfirmComponent {\n * private readonly ref = inject(WrDialogRef);\n *\n * save(): void {\n * this.store.save();\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDialogRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: ConfigurableFocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n constructor(private readonly _overlayRef: OverlayRef) {}\n\n /** The instantiated dialog component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDialogRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the dialog, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n\n /** Resolves with the close result when the dialog is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\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 { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDialog.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ConfirmComponent {\n * readonly data = inject<ConfirmData>(WR_DIALOG_DATA);\n * }\n * ```\n */\nexport const WR_DIALOG_DATA = new InjectionToken<unknown>('WR_DIALOG_DATA');\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 { InjectionToken } from '@angular/core';\n\nimport type { WrDialogRef } from '../dialog-ref';\n\n/**\n * Token exposing the open dialog's `WrDialogRef` to components and\n * directives rendered inside it (e.g. `[wrDialogClose]`).\n *\n * **Prefer `inject(WrDialogRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDialogRef, { optional: true })`\n * works for content that also renders outside a dialog, and\n * `inject<WrDialogRef<ConfirmComponent, boolean>>(WrDialogRef)` types the\n * generics without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDialogClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ConfirmComponent {\n * private readonly ref = inject<WrDialogRef<ConfirmComponent, boolean>>(WrDialogRef);\n *\n * confirm(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DIALOG_REF = new InjectionToken<WrDialogRef<unknown, unknown>>('WR_DIALOG_REF');\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 { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { Location, isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Service, Injector, PLATFORM_ID, afterEveryRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport { WR_OVERLAY, WR_RESPONSIVE_OVERLAYS, wrAppendOverlayClose, wrPresentAsSheet } from 'ngwr/overlay';\n\nimport { WrDialogRef } from './dialog-ref';\nimport type { WrDialogOptions } from './interfaces';\nimport { WR_DIALOG_DATA, WR_DIALOG_REF } from './tokens';\n\nconst DEFAULT_PANEL_CLASS = 'wr-dialog-panel';\nconst DEFAULT_BACKDROP_CLASS = 'wr-dialog-backdrop';\n\n/**\n * Opens dialog components in an isolated NGWR overlay.\n *\n * Uses `WR_OVERLAY` so it composes cleanly with `provideWrOverlay()`\n * — dialogs render into NGWR's own overlay container and never collide\n * with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * @example\n * ```ts\n * const dialog = inject(WrDialog);\n *\n * const ref = dialog.open(ConfirmComponent, {\n * data: { message: 'Delete this item?' },\n * width: '24rem',\n * });\n *\n * const ok = await ref.awaitClose();\n * if (ok) remove();\n * ```\n *\n * @see https://ngwr.dev/reference/components/dialog\n */\n@Service()\nexport class WrDialog {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);\n private readonly i18n = inject(WrI18n, { optional: true });\n // Resolvable wherever the CDK's own `Overlay` is — it injects the same thing\n // to implement `disposeOnNavigation`.\n private readonly location = inject(Location);\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDialogOptions<D> = {}): WrDialogRef<C, R> {\n const panelClasses: string[] = [DEFAULT_PANEL_CLASS];\n const extra = options.panelClass;\n if (typeof extra === 'string') {\n panelClasses.push(extra);\n } else if (extra) {\n for (const cls of extra) panelClasses.push(cls);\n }\n\n // On small viewports (when opted in) present as a slide-up sheet pinned\n // to the bottom edge, full-width, instead of a centred modal.\n const asSheet = wrPresentAsSheet(options.responsive, this.responsiveConfig);\n if (asSheet) panelClasses.push('wr-overlay-sheet');\n\n const position = this.overlay.position().global().centerHorizontally();\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy: asSheet ? position.bottom('0') : position.centerVertically(),\n scrollStrategy: this.scrollStrategies.block(),\n hasBackdrop: true,\n backdropClass: DEFAULT_BACKDROP_CLASS,\n panelClass: panelClasses,\n width: asSheet ? '100%' : options.width,\n maxWidth: asSheet ? '100%' : options.maxWidth,\n });\n\n const dialogRef = new WrDialogRef<C, R>(overlayRef);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n dialogRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DIALOG_DATA, useValue: options.data },\n { provide: WR_DIALOG_REF, useValue: dialogRef },\n // Provided as its own token as well, so dialog content can reach for\n // the familiar `inject(WrDialogRef)` and close itself.\n { provide: WrDialogRef, useValue: dialogRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n dialogRef.componentRef = overlayRef.attach(portal);\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n // Built-in dismiss. Appended after the content portal so it paints above\n // it, and marked on the panel so the title reserves the corner gutter.\n if (options.closable !== false) {\n host.classList.add('wr-dialog-panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-dialog__close', label, () => dialogRef.close());\n }\n // Wire aria-labelledby to wrDialogTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n //\n // And after EVERY render, not just the next one: the title belongs to the\n // caller's component, so an `@if` or a late-arriving heading can replace\n // or remove the element the attribute names. A reference to a node that is\n // no longer there is not a name — the dialog announces as unnamed — so a\n // missing title clears the attribute rather than leaving it dangling.\n const labelSync = afterEveryRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDialogTitle], [wr-dialog-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n },\n { injector: this.parentInjector }\n );\n // The hook is bound to the root injector, so it outlives the dialog unless\n // it is torn down with it. `detachments()` fires on dispose, which is the\n // one path every dismissal goes through.\n overlayRef.detachments().subscribe(() => labelSync.destroy());\n // Trap focus inside the dialog and move initial focus in.\n const trap = this.focusTrapFactory.create(host);\n dialogRef.focusTrap = trap;\n void trap.focusInitialElementWhenReady();\n }\n\n // Overlay subscriptions complete when the overlay is disposed, so no\n // explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => dialogRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n dialogRef.close();\n }\n });\n }\n if (options.closeOnNavigation !== false) {\n this.watchNavigation(overlayRef, dialogRef);\n }\n\n return dialogRef;\n }\n\n /**\n * Tie the dialog's lifetime to the URL it was opened on.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape or an explicit `close()`, so pressing Back\n * swapped the routed view underneath and left the modal pane, its backdrop and\n * its focus trap sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an\n * in-app `router.navigate()` left the dialog standing. And `dialogRef.close()`\n * rather than disposing the overlay behind the ref's back, which would never\n * emit `closed`, never destroy the focus trap, and leave `awaitClose()`\n * pending forever.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, dialogRef: WrDialogRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => dialogRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked dialog\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Two failure modes, and resolving PER OPEN is what covers both. `t()` hands\n * back the KEY on a miss, and `WrI18n` is root-provided with an empty catalog\n * by default, so an app that never configured i18n named its dismiss button\n * \"dialog.close\" — a name axe cannot fault, because a name is present, and a\n * screen reader reads out verbatim. Resolving once at injection time fixed\n * that but froze the answer: this is a root service, constructed before an\n * async catalog has loaded, so a localized app got the English fallback on\n * every dialog it ever opened.\n */\n private closeLabel(): string {\n const resolved = this.i18n?.t('dialog.close');\n return !resolved || resolved === 'dialog.close' ? 'Close dialog' : resolved;\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 { Directive, ElementRef, inject } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Styles a dialog title row. Use on a heading inside an opened dialog.\n * Auto-assigns an `id` so the dialog panel can reference it via\n * `aria-labelledby`.\n *\n * @example\n * ```html\n * <h2 wrDialogTitle>Confirm delete</h2>\n * ```\n */\n@Directive({\n selector: '[wrDialogTitle]',\n host: { class: 'wr-dialog__title', '[attr.id]': 'id' },\n})\nexport class WrDialogTitle {\n /** Generated id used for `aria-labelledby` wiring. */\n readonly id = `wr-dialog-title-${++uid}`;\n\n /** @internal */\n readonly elementRef = inject(ElementRef<HTMLElement>);\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 { CdkScrollable } from '@angular/cdk/scrolling';\nimport { Directive } from '@angular/core';\n\n/**\n * Styles the scrollable body section of a dialog.\n *\n * `CdkScrollable` is a host directive because this element is a real scroll\n * container (`overflow: auto`) and an anchored overlay opened from inside it has\n * to follow its trigger. CDK's `reposition()` strategy listens to\n * `ScrollDispatcher`, which is fed by registered scrollables plus ONE\n * non-capturing `document` listener — and element `scroll` does not bubble, so\n * without the registration a `<wr-select>` halfway down a long dialog form kept\n * its panel pinned to the viewport while the trigger scrolled away. Angular\n * Material carries the same host directive on `MatDialogContent` for the same\n * reason.\n *\n * @example\n * ```html\n * <div wrDialogContent>…body…</div>\n * ```\n */\n@Directive({\n selector: '[wrDialogContent]',\n host: { class: 'wr-dialog__content' },\n hostDirectives: [CdkScrollable],\n})\nexport class WrDialogContent {}\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 { Directive, computed, input } from '@angular/core';\n\n/**\n * Footer row, typically holding action buttons.\n *\n * @example\n * ```html\n * <div wrDialogFooter align=\"end\">\n * <wr-btn wrDialogClose>Cancel</wr-btn>\n * <wr-btn color=\"danger\" (click)=\"confirm()\">Delete</wr-btn>\n * </div>\n * ```\n */\n@Directive({\n selector: '[wrDialogFooter]',\n host: { '[class]': 'classes()' },\n})\nexport class WrDialogFooter {\n /**\n * Horizontal alignment of the children.\n *\n * @default 'end'\n */\n readonly align = input<'start' | 'center' | 'end'>('end');\n\n protected readonly classes = computed(() => `wr-dialog__footer wr-dialog__footer--${this.align()}`);\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 { Directive, inject, input } from '@angular/core';\n\nimport type { WrDialogRef } from '../dialog-ref';\nimport { WR_DIALOG_REF } from '../tokens';\n\n/**\n * Closes the dialog when the host element is clicked.\n *\n * Optionally passes a `[wrDialogClose]` value as the close result.\n *\n * @example\n * ```html\n * <wr-btn wrDialogClose>Cancel</wr-btn>\n * <wr-btn color=\"primary\" [wrDialogClose]=\"true\">Confirm</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDialogClose]',\n host: { '(click)': 'onClick()' },\n})\nexport class WrDialogClose<R = unknown> {\n /**\n * Value to pass to `close()`. When unset — or used as a bare attribute — the\n * dialog closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDialogClose',\n // A bare `wrDialogClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`. Matches `wrDrawerClose`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly ref = inject<WrDialogRef<unknown, R>>(WR_DIALOG_REF, { optional: true });\n\n protected onClick(): void {\n this.ref?.close(this.result());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './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