ngwr 10.2.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -19
- package/anchor/styles/_index.scss +4 -4
- package/back-top/styles/_index.scss +6 -1
- package/blur-text/styles/_index.scss +13 -0
- package/button/styles/_index.scss +11 -6
- package/carousel/styles/_index.scss +13 -2
- package/cascader/styles/_index.scss +2 -2
- package/circular-text/styles/_index.scss +2 -0
- package/collapse/styles/_index.scss +1 -1
- package/color-picker/styles/_index.scss +6 -1
- package/compare/styles/_index.scss +1 -2
- package/context-menu/styles/_index.scss +6 -1
- package/descriptions/styles/_index.scss +2 -2
- package/dialog/styles/_index.scss +7 -0
- package/drawer/styles/_index.scss +20 -1
- package/dropdown/styles/_index.scss +19 -5
- package/empty/styles/_index.scss +10 -0
- package/fesm2022/ngwr-action-sheet.mjs +13 -3
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-affix.mjs +40 -13
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +18 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-aurora.mjs +2 -2
- package/fesm2022/ngwr-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +31 -7
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +6 -2
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +1 -1
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +30 -9
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +2 -2
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +2 -2
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +9 -4
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button-testing.mjs +96 -0
- package/fesm2022/ngwr-button-testing.mjs.map +1 -0
- package/fesm2022/ngwr-button.mjs +31 -14
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +40 -8
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +20 -1
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +2 -2
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +377 -0
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
- package/fesm2022/ngwr-carousel.mjs +67 -13
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs +534 -0
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
- package/fesm2022/ngwr-cascader.mjs +2 -2
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
- package/fesm2022/ngwr-checkbox.mjs +9 -3
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +2 -2
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +2 -2
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-collapse-testing.mjs +368 -0
- package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
- package/fesm2022/ngwr-color-picker.mjs +134 -14
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
- package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
- package/fesm2022/ngwr-command-palette.mjs +58 -8
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +103 -13
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs +106 -0
- package/fesm2022/ngwr-config.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu.mjs +94 -8
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +5 -1
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +11 -3
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter-luxon.mjs +52 -4
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter.mjs +54 -8
- package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker.mjs +73 -3
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +27 -9
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +89 -0
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
- package/fesm2022/ngwr-directives.mjs +36 -12
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +22 -5
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer-testing.mjs +250 -0
- package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown.mjs +10 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +24 -7
- package/fesm2022/ngwr-empty.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +57 -10
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +2 -2
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form-testing.mjs +451 -0
- package/fesm2022/ngwr-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form.mjs +19 -3
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +9 -2
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +19 -5
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +2 -2
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +2 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +50 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +48 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +23 -0
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs +306 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-number.mjs +35 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-otp.mjs +36 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +102 -0
- package/fesm2022/ngwr-input-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input.mjs +47 -10
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +44 -8
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +21 -5
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +33 -6
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +17 -4
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown-testing.mjs +516 -0
- package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-markdown.mjs +1492 -0
- package/fesm2022/ngwr-markdown.mjs.map +1 -0
- package/fesm2022/ngwr-marquee.mjs +17 -6
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-mention-testing.mjs +513 -0
- package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
- package/fesm2022/ngwr-mention.mjs +10 -1
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +22 -7
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +19 -5
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +41 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +389 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pagination.mjs +14 -2
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popconfirm.mjs +95 -17
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +316 -0
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popover.mjs +21 -3
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +17 -2
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +13 -3
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio-testing.mjs +392 -0
- package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
- package/fesm2022/ngwr-radio.mjs +10 -3
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating-testing.mjs +384 -0
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
- package/fesm2022/ngwr-rating.mjs +37 -2
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-segmented-testing.mjs +512 -0
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select-testing.mjs +268 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select.mjs +87 -16
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +2 -2
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +65 -12
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +478 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
- package/fesm2022/ngwr-slider.mjs +57 -13
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +26 -6
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +37 -4
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +12 -3
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +2 -2
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-split-text.mjs +2 -2
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +70 -9
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +2 -2
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +2 -2
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +24 -7
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs +477 -0
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch-testing.mjs +77 -0
- package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch.mjs +9 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +580 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -0
- package/fesm2022/ngwr-table.mjs +87 -14
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +617 -0
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tabs.mjs +38 -6
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +238 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
- package/fesm2022/ngwr-textarea.mjs +32 -4
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +2 -2
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +101 -0
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
- package/fesm2022/ngwr-toast.mjs +2 -2
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +61 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs +538 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-transfer.mjs +45 -14
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +734 -0
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +73 -7
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +5 -3
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +31 -5
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +3 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +8 -0
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/gauge/styles/_index.scss +1 -1
- package/glitch-text/styles/_index.scss +4 -0
- package/i18n/en.json +48 -0
- package/i18n/ru.json +48 -0
- package/image-cropper/styles/_index.scss +13 -1
- package/input/styles/_index.scss +2 -2
- package/input-number/styles/_index.scss +7 -2
- package/knob/styles/_index.scss +8 -1
- package/layout/styles/_index.scss +3 -3
- package/lightbox/styles/_index.scss +10 -2
- package/line-chart/styles/_index.scss +6 -0
- package/llms-full.txt +151 -4
- package/llms.txt +57 -8
- package/loading-bar/styles/_index.scss +1 -2
- package/markdown/styles/_index.scss +296 -0
- package/marquee/styles/_index.scss +12 -0
- package/mcp/api.js +512 -0
- package/mcp/catalog.js +157 -0
- package/mcp/server.js +273 -0
- package/mcp/tools.js +366 -0
- package/meter-group/styles/_index.scss +1 -1
- package/package.json +186 -35
- package/pagination/styles/_index.scss +6 -6
- package/popover/styles/_index.scss +37 -5
- package/rating/styles/_index.scss +10 -0
- package/schematics/use/symbol-map.json +2 -0
- package/segmented/styles/_index.scss +7 -0
- package/select/styles/_index.scss +29 -9
- package/sidebar/styles/_index.scss +30 -5
- package/slider/styles/_index.scss +15 -0
- package/speed-dial/styles/_index.scss +20 -0
- package/split-text/styles/_index.scss +13 -0
- package/star-border/styles/_index.scss +2 -0
- package/stepper/styles/_index.scss +1 -1
- package/styles/_grid.scss +4 -4
- package/styles.scss +1 -0
- package/switch/styles/_index.scss +5 -3
- package/table/styles/_index.scss +22 -11
- package/tabs/styles/_index.scss +11 -1
- package/textarea/styles/_index.scss +5 -0
- package/theme/styles/_colors.scss +29 -13
- package/theme/styles/_dark.scss +11 -3
- package/theme/styles/_mixins.scss +3 -0
- package/timeline/styles/_index.scss +2 -2
- package/toast/styles/_index.scss +17 -8
- package/toolbar/styles/_index.scss +3 -3
- package/tour/styles/_index.scss +7 -1
- package/tree/styles/_index.scss +5 -3
- package/types/ngwr-action-sheet.d.ts +9 -1
- package/types/ngwr-affix.d.ts +7 -1
- package/types/ngwr-anchor.d.ts +8 -1
- package/types/ngwr-avatar.d.ts +13 -3
- package/types/ngwr-bar-chart.d.ts +16 -0
- package/types/ngwr-burger.d.ts +6 -2
- package/types/ngwr-button-testing.d.ts +85 -0
- package/types/ngwr-button.d.ts +26 -10
- package/types/ngwr-calendar-heatmap.d.ts +16 -2
- package/types/ngwr-calendar.d.ts +10 -0
- package/types/ngwr-carousel-testing.d.ts +257 -0
- package/types/ngwr-carousel.d.ts +20 -4
- package/types/ngwr-cascader-testing.d.ts +392 -0
- package/types/ngwr-checkbox-testing.d.ts +77 -0
- package/types/ngwr-checkbox.d.ts +7 -2
- package/types/ngwr-collapse-testing.d.ts +290 -0
- package/types/ngwr-color-picker.d.ts +20 -11
- package/types/ngwr-command-palette-testing.d.ts +437 -0
- package/types/ngwr-command-palette.d.ts +25 -2
- package/types/ngwr-compare.d.ts +50 -2
- package/types/ngwr-config.d.ts +176 -0
- package/types/ngwr-context-menu-testing.d.ts +401 -0
- package/types/ngwr-context-menu.d.ts +65 -17
- package/types/ngwr-counter.d.ts +6 -1
- package/types/ngwr-date-adapter-luxon.d.ts +26 -0
- package/types/ngwr-date-picker-testing.d.ts +518 -0
- package/types/ngwr-date-picker.d.ts +4 -0
- package/types/ngwr-dialog-testing.d.ts +79 -0
- package/types/ngwr-directives.d.ts +10 -1
- package/types/ngwr-donut-chart.d.ts +8 -1
- package/types/ngwr-drawer-testing.d.ts +196 -0
- package/types/ngwr-dropdown-testing.d.ts +202 -0
- package/types/ngwr-dropdown.d.ts +7 -1
- package/types/ngwr-empty.d.ts +19 -4
- package/types/ngwr-event-calendar.d.ts +26 -1
- package/types/ngwr-file-upload-testing.d.ts +194 -0
- package/types/ngwr-form-testing.d.ts +379 -0
- package/types/ngwr-form.d.ts +17 -0
- package/types/ngwr-gauge.d.ts +13 -1
- package/types/ngwr-image-cropper.d.ts +10 -0
- package/types/ngwr-input-number-testing.d.ts +226 -0
- package/types/ngwr-input-number.d.ts +29 -1
- package/types/ngwr-input-otp-testing.d.ts +299 -0
- package/types/ngwr-input-otp.d.ts +23 -2
- package/types/ngwr-input-testing.d.ts +84 -0
- package/types/ngwr-input.d.ts +20 -6
- package/types/ngwr-knob.d.ts +18 -0
- package/types/ngwr-layout.d.ts +1 -0
- package/types/ngwr-lightbox.d.ts +17 -3
- package/types/ngwr-line-chart.d.ts +9 -2
- package/types/ngwr-markdown-testing.d.ts +462 -0
- package/types/ngwr-markdown.d.ts +534 -0
- package/types/ngwr-marquee.d.ts +12 -2
- package/types/ngwr-mention-testing.d.ts +359 -0
- package/types/ngwr-meta.d.ts +4 -2
- package/types/ngwr-meter-group.d.ts +11 -1
- package/types/ngwr-overlay.d.ts +33 -2
- package/types/ngwr-pagination-testing.d.ts +291 -0
- package/types/ngwr-pagination.d.ts +1 -0
- package/types/ngwr-popconfirm-testing.d.ts +235 -0
- package/types/ngwr-popconfirm.d.ts +31 -21
- package/types/ngwr-popover-testing.d.ts +221 -0
- package/types/ngwr-popover.d.ts +9 -0
- package/types/ngwr-pull-to-refresh.d.ts +7 -0
- package/types/ngwr-qr.d.ts +9 -1
- package/types/ngwr-radio-testing.d.ts +296 -0
- package/types/ngwr-radio.d.ts +8 -2
- package/types/ngwr-rating-testing.d.ts +291 -0
- package/types/ngwr-rating.d.ts +23 -0
- package/types/ngwr-segmented-testing.d.ts +401 -0
- package/types/ngwr-select-testing.d.ts +175 -0
- package/types/ngwr-select.d.ts +45 -4
- package/types/ngwr-sidebar.d.ts +17 -2
- package/types/ngwr-slider-testing.d.ts +329 -0
- package/types/ngwr-slider.d.ts +35 -1
- package/types/ngwr-sparkline.d.ts +12 -2
- package/types/ngwr-speed-dial.d.ts +17 -18
- package/types/ngwr-spinner.d.ts +8 -1
- package/types/ngwr-splitter.d.ts +24 -1
- package/types/ngwr-statistic.d.ts +12 -2
- package/types/ngwr-stepper-testing.d.ts +346 -0
- package/types/ngwr-switch-testing.d.ts +66 -0
- package/types/ngwr-switch.d.ts +7 -2
- package/types/ngwr-table-testing.d.ts +423 -0
- package/types/ngwr-table.d.ts +42 -0
- package/types/ngwr-tabs-testing.d.ts +470 -0
- package/types/ngwr-tabs.d.ts +9 -0
- package/types/ngwr-textarea-testing.d.ts +184 -0
- package/types/ngwr-textarea.d.ts +7 -2
- package/types/ngwr-toast-testing.d.ts +80 -0
- package/types/ngwr-tour.d.ts +27 -0
- package/types/ngwr-transfer-testing.d.ts +444 -0
- package/types/ngwr-transfer.d.ts +16 -1
- package/types/ngwr-tree-testing.d.ts +501 -0
- package/types/ngwr-tree.d.ts +33 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-virtual-scroll.d.ts +13 -1
- package/typewriter/styles/_index.scss +1 -1
- package/typography/styles/_index.scss +1 -1
- package/window/styles/_index.scss +32 -9
|
@@ -49,6 +49,18 @@ function computeOrder(len, dir) {
|
|
|
49
49
|
}
|
|
50
50
|
return order.slice(0, len);
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* How many characters the animation walks — CODE POINTS, not UTF-16 units.
|
|
54
|
+
*
|
|
55
|
+
* Every index in this component (`revealedIndices`, the sequential order, the
|
|
56
|
+
* per-character render) counts the same way `[...txt]` does. Using `txt.length`
|
|
57
|
+
* for the total counted an emoji twice, so a sequential reveal spent extra ticks
|
|
58
|
+
* on indices past the end of the text and the "everything revealed" test never
|
|
59
|
+
* lined up with what was on screen.
|
|
60
|
+
*/
|
|
61
|
+
function charCount(txt) {
|
|
62
|
+
return [...txt].length;
|
|
63
|
+
}
|
|
52
64
|
function fillAllIndices(len) {
|
|
53
65
|
const s = new Set();
|
|
54
66
|
for (let i = 0; i < len; i++)
|
|
@@ -240,10 +252,10 @@ class WrDecryptText {
|
|
|
240
252
|
triggerReverse() {
|
|
241
253
|
const txt = this.text();
|
|
242
254
|
if (this.sequential()) {
|
|
243
|
-
this.reverseOrder = computeOrder(txt
|
|
255
|
+
this.reverseOrder = computeOrder(charCount(txt), this.revealDirection()).slice().reverse();
|
|
244
256
|
this.reversePointer = 0;
|
|
245
257
|
}
|
|
246
|
-
const all = fillAllIndices(txt
|
|
258
|
+
const all = fillAllIndices(charCount(txt));
|
|
247
259
|
this.revealedIndices.set(all);
|
|
248
260
|
this.displayText.set(this.shuffle(txt, all));
|
|
249
261
|
this.direction.set('reverse');
|
|
@@ -280,8 +292,8 @@ class WrDecryptText {
|
|
|
280
292
|
const max = this.maxIterations();
|
|
281
293
|
const revealed = this.revealedIndices();
|
|
282
294
|
if (seq && dir === 'forward') {
|
|
283
|
-
if (revealed.size < txt
|
|
284
|
-
const nextIdx = this.nextSequentialIndex(revealed, txt
|
|
295
|
+
if (revealed.size < charCount(txt)) {
|
|
296
|
+
const nextIdx = this.nextSequentialIndex(revealed, charCount(txt));
|
|
285
297
|
const next = new Set(revealed);
|
|
286
298
|
next.add(nextIdx);
|
|
287
299
|
this.revealedIndices.set(next);
|
|
@@ -325,8 +337,8 @@ class WrDecryptText {
|
|
|
325
337
|
if (!seq && dir === 'reverse') {
|
|
326
338
|
let current = revealed;
|
|
327
339
|
if (current.size === 0)
|
|
328
|
-
current = fillAllIndices(txt
|
|
329
|
-
const removeCount = Math.max(1, Math.ceil(txt
|
|
340
|
+
current = fillAllIndices(charCount(txt));
|
|
341
|
+
const removeCount = Math.max(1, Math.ceil(charCount(txt) / Math.max(1, max)));
|
|
330
342
|
const next = removeRandomIndices(current, removeCount);
|
|
331
343
|
this.revealedIndices.set(next);
|
|
332
344
|
this.displayText.set(this.shuffle(txt, next));
|
|
@@ -360,9 +372,15 @@ class WrDecryptText {
|
|
|
360
372
|
}
|
|
361
373
|
}
|
|
362
374
|
shuffle(txt, revealed) {
|
|
375
|
+
// Every index here counts CODE POINTS, because that is what `[...txt]`
|
|
376
|
+
// produces and what `revealed` was built against. `split('')` counts UTF-16
|
|
377
|
+
// units instead, so an emoji in the text (or in a custom alphabet) put half a
|
|
378
|
+
// surrogate pair in the pool; and reading the revealed character back as
|
|
379
|
+
// `txt[i]` mixed the two index spaces, so every character after the first
|
|
380
|
+
// astral one revealed as the WRONG one.
|
|
363
381
|
const pool = this.useOriginalCharsOnly()
|
|
364
|
-
? Array.from(new Set(txt
|
|
365
|
-
: this.characters()
|
|
382
|
+
? Array.from(new Set([...txt])).filter(ch => ch !== ' ')
|
|
383
|
+
: [...this.characters()];
|
|
366
384
|
if (pool.length === 0)
|
|
367
385
|
return txt;
|
|
368
386
|
return [...txt]
|
|
@@ -370,7 +388,7 @@ class WrDecryptText {
|
|
|
370
388
|
if (ch === ' ')
|
|
371
389
|
return ' ';
|
|
372
390
|
if (revealed.has(i))
|
|
373
|
-
return
|
|
391
|
+
return ch;
|
|
374
392
|
return pool[Math.floor(Math.random() * pool.length)];
|
|
375
393
|
})
|
|
376
394
|
.join('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-decrypt-text.mjs","sources":["../../../projects/lib/decrypt-text/decrypt-text.ts","../../../projects/lib/decrypt-text/decrypt-text.html","../../../projects/lib/decrypt-text/ngwr-decrypt-text.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 * Angular adaptation of the DecryptedText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/decrypted-text\n *\n * The reactbits version uses `motion/react` for the wrapper. This port\n * is dependency-free — vanilla signals + `setInterval` for the tick loop.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrDecryptTextAnimateOn, WrDecryptTextRevealDirection, WrDecryptTextClickMode } from './interfaces';\n\nconst DEFAULT_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+';\n\nfunction computeOrder(len: number, dir: WrDecryptTextRevealDirection): readonly number[] {\n const order: number[] = [];\n if (len <= 0) return order;\n if (dir === 'start') {\n for (let i = 0; i < len; i++) order.push(i);\n return order;\n }\n if (dir === 'end') {\n for (let i = len - 1; i >= 0; i--) order.push(i);\n return order;\n }\n const middle = Math.floor(len / 2);\n let off = 0;\n while (order.length < len) {\n if (off % 2 === 0) {\n const idx = middle + off / 2;\n if (idx >= 0 && idx < len) order.push(idx);\n } else {\n const idx = middle - Math.ceil(off / 2);\n if (idx >= 0 && idx < len) order.push(idx);\n }\n off++;\n }\n return order.slice(0, len);\n}\n\nfunction fillAllIndices(len: number): Set<number> {\n const s = new Set<number>();\n for (let i = 0; i < len; i++) s.add(i);\n return s;\n}\n\nfunction removeRandomIndices(set: ReadonlySet<number>, count: number): Set<number> {\n const arr = Array.from(set);\n for (let i = 0; i < count && arr.length > 0; i++) {\n arr.splice(Math.floor(Math.random() * arr.length), 1);\n }\n return new Set(arr);\n}\n\n/**\n * Reveals a string by scrambling characters and progressively replacing\n * scramble glyphs with the originals. Supports sequential reveal in\n * three directions, or non-sequential \"settle\" after N iterations, and\n * four trigger modes (hover, click, view, in-view + hover).\n *\n * @example\n * ```html\n * <wr-decrypt-text text=\"Hello, ngwr!\" animateOn=\"hover\" />\n * <wr-decrypt-text\n * text=\"Reveal from the center\"\n * [sequential]=\"true\"\n * revealDirection=\"center\"\n * animateOn=\"view\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/decrypted-text\n */\n@Component({\n selector: 'wr-decrypt-text',\n templateUrl: './decrypt-text.html',\n styleUrl: './decrypt-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-decrypt-text',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '(click)': 'onClick()',\n },\n})\nexport class WrDecryptText {\n /** Text to reveal. Required. */\n readonly text = input.required<string>();\n\n /** Tick interval in ms. @default 50 */\n readonly speed = input(50, { transform: numAttr(50) });\n\n /** Non-sequential mode only — total scramble ticks before snapping to plain. @default 10 */\n readonly maxIterations = input(10, { transform: numAttr(10) });\n\n /** Reveal one char per tick instead of scrambling all of them. @default false */\n readonly sequential = input(false, { transform: coerceBooleanProperty });\n\n /** Order in which chars are revealed in sequential mode. @default 'start' */\n readonly revealDirection = input<WrDecryptTextRevealDirection>('start');\n\n /** Scramble using only the glyphs present in `text` (minus spaces). @default false */\n readonly useOriginalCharsOnly = input(false, { transform: coerceBooleanProperty });\n\n /** Pool of glyphs to scramble through (used when `useOriginalCharsOnly` is false). */\n readonly characters = input(DEFAULT_CHARS);\n\n /** When to start the animation. @default 'hover' */\n readonly animateOn = input<WrDecryptTextAnimateOn>('hover');\n\n /** Click behaviour. `'once'` decrypts then stops; `'toggle'` flips state on each click. @default 'once' */\n readonly clickMode = input<WrDecryptTextClickMode>('once');\n\n private readonly displayText = signal('');\n private readonly revealedIndices = signal<ReadonlySet<number>>(new Set());\n private readonly isAnimating = signal(false);\n private readonly isDecrypted = signal(true);\n private readonly direction = signal<'forward' | 'reverse'>('forward');\n\n /** Per-char render data. */\n protected readonly chars = computed(() => {\n const display = this.displayText();\n const revealed = this.revealedIndices();\n const decrypted = this.isDecrypted();\n const animating = this.isAnimating();\n return [...display].map((ch, i) => ({\n ch,\n revealed: revealed.has(i) || (!animating && decrypted),\n }));\n });\n\n /** Sequential reverse order — captured when reverse starts. */\n private reverseOrder: readonly number[] = [];\n private reversePointer = 0;\n private iterationCount = 0;\n private intervalId: ReturnType<typeof setInterval> | undefined;\n private hasAnimatedOnce = false;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n constructor() {\n if (!this.isBrowser) {\n // SSR: render plain text.\n effect(() => this.displayText.set(this.text()));\n return;\n }\n\n // Reset state whenever `text` or `animateOn` changes.\n effect(() => {\n const txt = this.text();\n const mode = this.animateOn();\n this.stopInterval();\n if (mode === 'click') {\n this.encryptInstantly(txt);\n } else {\n this.displayText.set(txt);\n this.isDecrypted.set(true);\n }\n this.revealedIndices.set(new Set());\n this.direction.set('forward');\n this.hasAnimatedOnce = false;\n });\n\n afterNextRender(() => {\n const mode = this.animateOn();\n if (mode === 'view' || mode === 'inViewHover') this.setupIntersectionObserver();\n });\n\n this.destroyRef.onDestroy(() => this.stopInterval());\n }\n\n // Trigger handlers\n\n protected onMouseEnter(): void {\n const mode = this.animateOn();\n if (mode !== 'hover' && mode !== 'inViewHover') return;\n this.triggerHoverDecrypt();\n }\n\n protected onMouseLeave(): void {\n const mode = this.animateOn();\n if (mode !== 'hover' && mode !== 'inViewHover') return;\n this.resetToPlain();\n }\n\n protected onClick(): void {\n if (this.animateOn() !== 'click') return;\n if (this.clickMode() === 'once') {\n if (this.isDecrypted()) return;\n this.direction.set('forward');\n this.triggerDecrypt();\n return;\n }\n if (this.isDecrypted()) this.triggerReverse();\n else {\n this.direction.set('forward');\n this.triggerDecrypt();\n }\n }\n\n // Internals\n\n private setupIntersectionObserver(): void {\n const io = new IntersectionObserver(\n (entries, obs) => {\n for (const e of entries) {\n if (e.isIntersecting && !this.hasAnimatedOnce) {\n obs.disconnect();\n this.hasAnimatedOnce = true;\n this.triggerDecrypt();\n break;\n }\n }\n },\n { threshold: 0.1, rootMargin: '0px' }\n );\n io.observe(this.host.nativeElement);\n this.destroyRef.onDestroy(() => io.disconnect());\n }\n\n private triggerHoverDecrypt(): void {\n if (this.isAnimating()) return;\n this.revealedIndices.set(new Set());\n this.isDecrypted.set(false);\n this.displayText.set(this.text());\n this.direction.set('forward');\n this.startInterval();\n }\n\n private resetToPlain(): void {\n this.stopInterval();\n this.revealedIndices.set(new Set());\n this.displayText.set(this.text());\n this.isDecrypted.set(true);\n this.direction.set('forward');\n }\n\n private triggerDecrypt(): void {\n if (this.sequential()) {\n this.revealedIndices.set(new Set());\n } else {\n this.revealedIndices.set(new Set());\n }\n this.direction.set('forward');\n this.startInterval();\n }\n\n private triggerReverse(): void {\n const txt = this.text();\n if (this.sequential()) {\n this.reverseOrder = computeOrder(txt.length, this.revealDirection()).slice().reverse();\n this.reversePointer = 0;\n }\n const all = fillAllIndices(txt.length);\n this.revealedIndices.set(all);\n this.displayText.set(this.shuffle(txt, all));\n this.direction.set('reverse');\n this.startInterval();\n }\n\n private encryptInstantly(txt: string): void {\n this.revealedIndices.set(new Set());\n this.displayText.set(this.shuffle(txt, new Set()));\n this.isDecrypted.set(false);\n }\n\n private startInterval(): void {\n // Reduced motion: every trigger funnels through here — skip the\n // scramble loop and jump straight to the plain, decrypted text.\n if (this.platform.prefersReducedMotion()) {\n this.resetToPlain();\n return;\n }\n\n this.stopInterval();\n this.isAnimating.set(true);\n this.iterationCount = 0;\n this.intervalId = setInterval(() => this.tick(), this.speed());\n }\n\n private stopInterval(): void {\n if (this.intervalId !== undefined) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n this.isAnimating.set(false);\n }\n\n private tick(): void {\n const txt = this.text();\n const seq = this.sequential();\n const dir = this.direction();\n const max = this.maxIterations();\n const revealed = this.revealedIndices();\n\n if (seq && dir === 'forward') {\n if (revealed.size < txt.length) {\n const nextIdx = this.nextSequentialIndex(revealed, txt.length);\n const next = new Set(revealed);\n next.add(nextIdx);\n this.revealedIndices.set(next);\n this.displayText.set(this.shuffle(txt, next));\n } else {\n this.stopInterval();\n this.isDecrypted.set(true);\n this.displayText.set(txt);\n }\n return;\n }\n\n if (seq && dir === 'reverse') {\n if (this.reversePointer < this.reverseOrder.length) {\n const idx = this.reverseOrder[this.reversePointer++];\n const next = new Set(revealed);\n next.delete(idx);\n this.revealedIndices.set(next);\n this.displayText.set(this.shuffle(txt, next));\n if (next.size === 0) {\n this.stopInterval();\n this.isDecrypted.set(false);\n }\n } else {\n this.stopInterval();\n this.isDecrypted.set(false);\n }\n return;\n }\n\n if (!seq && dir === 'forward') {\n this.displayText.set(this.shuffle(txt, revealed));\n this.iterationCount++;\n if (this.iterationCount >= max) {\n this.stopInterval();\n this.displayText.set(txt);\n this.isDecrypted.set(true);\n }\n return;\n }\n\n if (!seq && dir === 'reverse') {\n let current = revealed;\n if (current.size === 0) current = fillAllIndices(txt.length);\n const removeCount = Math.max(1, Math.ceil(txt.length / Math.max(1, max)));\n const next = removeRandomIndices(current, removeCount);\n this.revealedIndices.set(next);\n this.displayText.set(this.shuffle(txt, next));\n this.iterationCount++;\n if (next.size === 0 || this.iterationCount >= max) {\n this.stopInterval();\n this.isDecrypted.set(false);\n this.displayText.set(this.shuffle(txt, new Set()));\n this.revealedIndices.set(new Set());\n }\n }\n }\n\n private nextSequentialIndex(revealed: ReadonlySet<number>, len: number): number {\n switch (this.revealDirection()) {\n case 'end':\n return len - 1 - revealed.size;\n case 'center': {\n const middle = Math.floor(len / 2);\n const offset = Math.floor(revealed.size / 2);\n const candidate = revealed.size % 2 === 0 ? middle + offset : middle - offset - 1;\n if (candidate >= 0 && candidate < len && !revealed.has(candidate)) return candidate;\n for (let i = 0; i < len; i++) if (!revealed.has(i)) return i;\n return 0;\n }\n case 'start':\n default:\n return revealed.size;\n }\n }\n\n private shuffle(txt: string, revealed: ReadonlySet<number>): string {\n const pool = this.useOriginalCharsOnly()\n ? Array.from(new Set(txt.split(''))).filter(ch => ch !== ' ')\n : this.characters().split('');\n if (pool.length === 0) return txt;\n return [...txt]\n .map((ch, i) => {\n if (ch === ' ') return ' ';\n if (revealed.has(i)) return txt[i];\n return pool[Math.floor(Math.random() * pool.length)];\n })\n .join('');\n }\n}\n\nexport type { WrDecryptTextAnimateOn, WrDecryptTextRevealDirection, WrDecryptTextClickMode } from './interfaces';\n","<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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;AAWG;AAuBH,MAAM,aAAa,GAAG,kEAAkE;AAExF,SAAS,YAAY,CAAC,GAAW,EAAE,GAAiC,EAAA;IAClE,MAAM,KAAK,GAAa,EAAE;IAC1B,IA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EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAa,s7CC3G1B,uSAQA,EAAA,MAAA,EAAA,CAAA,wOAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDmGa,aAAa,EAAA,UAAA,EAAA,CAAA;kBAZzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,aAAA,EAGZ,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,cAAc,EAAE,gBAAgB;AAChC,wBAAA,cAAc,EAAE,gBAAgB;AAChC,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA,EAAA,QAAA,EAAA,uSAAA,EAAA,MAAA,EAAA,CAAA,wOAAA,CAAA,EAAA;;;AEzGH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-decrypt-text.mjs","sources":["../../../projects/lib/decrypt-text/decrypt-text.ts","../../../projects/lib/decrypt-text/decrypt-text.html","../../../projects/lib/decrypt-text/ngwr-decrypt-text.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 * Angular adaptation of the DecryptedText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/decrypted-text\n *\n * The reactbits version uses `motion/react` for the wrapper. This port\n * is dependency-free — vanilla signals + `setInterval` for the tick loop.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrDecryptTextAnimateOn, WrDecryptTextRevealDirection, WrDecryptTextClickMode } from './interfaces';\n\nconst DEFAULT_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+';\n\nfunction computeOrder(len: number, dir: WrDecryptTextRevealDirection): readonly number[] {\n const order: number[] = [];\n if (len <= 0) return order;\n if (dir === 'start') {\n for (let i = 0; i < len; i++) order.push(i);\n return order;\n }\n if (dir === 'end') {\n for (let i = len - 1; i >= 0; i--) order.push(i);\n return order;\n }\n const middle = Math.floor(len / 2);\n let off = 0;\n while (order.length < len) {\n if (off % 2 === 0) {\n const idx = middle + off / 2;\n if (idx >= 0 && idx < len) order.push(idx);\n } else {\n const idx = middle - Math.ceil(off / 2);\n if (idx >= 0 && idx < len) order.push(idx);\n }\n off++;\n }\n return order.slice(0, len);\n}\n\n/**\n * How many characters the animation walks — CODE POINTS, not UTF-16 units.\n *\n * Every index in this component (`revealedIndices`, the sequential order, the\n * per-character render) counts the same way `[...txt]` does. Using `txt.length`\n * for the total counted an emoji twice, so a sequential reveal spent extra ticks\n * on indices past the end of the text and the \"everything revealed\" test never\n * lined up with what was on screen.\n */\nfunction charCount(txt: string): number {\n return [...txt].length;\n}\n\nfunction fillAllIndices(len: number): Set<number> {\n const s = new Set<number>();\n for (let i = 0; i < len; i++) s.add(i);\n return s;\n}\n\nfunction removeRandomIndices(set: ReadonlySet<number>, count: number): Set<number> {\n const arr = Array.from(set);\n for (let i = 0; i < count && arr.length > 0; i++) {\n arr.splice(Math.floor(Math.random() * arr.length), 1);\n }\n return new Set(arr);\n}\n\n/**\n * Reveals a string by scrambling characters and progressively replacing\n * scramble glyphs with the originals. Supports sequential reveal in\n * three directions, or non-sequential \"settle\" after N iterations, and\n * four trigger modes (hover, click, view, in-view + hover).\n *\n * @example\n * ```html\n * <wr-decrypt-text text=\"Hello, ngwr!\" animateOn=\"hover\" />\n * <wr-decrypt-text\n * text=\"Reveal from the center\"\n * [sequential]=\"true\"\n * revealDirection=\"center\"\n * animateOn=\"view\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/decrypted-text\n */\n@Component({\n selector: 'wr-decrypt-text',\n templateUrl: './decrypt-text.html',\n styleUrl: './decrypt-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-decrypt-text',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '(click)': 'onClick()',\n },\n})\nexport class WrDecryptText {\n /** Text to reveal. Required. */\n readonly text = input.required<string>();\n\n /** Tick interval in ms. @default 50 */\n readonly speed = input(50, { transform: numAttr(50) });\n\n /** Non-sequential mode only — total scramble ticks before snapping to plain. @default 10 */\n readonly maxIterations = input(10, { transform: numAttr(10) });\n\n /** Reveal one char per tick instead of scrambling all of them. @default false */\n readonly sequential = input(false, { transform: coerceBooleanProperty });\n\n /** Order in which chars are revealed in sequential mode. @default 'start' */\n readonly revealDirection = input<WrDecryptTextRevealDirection>('start');\n\n /** Scramble using only the glyphs present in `text` (minus spaces). @default false */\n readonly useOriginalCharsOnly = input(false, { transform: coerceBooleanProperty });\n\n /** Pool of glyphs to scramble through (used when `useOriginalCharsOnly` is false). */\n readonly characters = input(DEFAULT_CHARS);\n\n /** When to start the animation. @default 'hover' */\n readonly animateOn = input<WrDecryptTextAnimateOn>('hover');\n\n /** Click behaviour. `'once'` decrypts then stops; `'toggle'` flips state on each click. @default 'once' */\n readonly clickMode = input<WrDecryptTextClickMode>('once');\n\n private readonly displayText = signal('');\n private readonly revealedIndices = signal<ReadonlySet<number>>(new Set());\n private readonly isAnimating = signal(false);\n private readonly isDecrypted = signal(true);\n private readonly direction = signal<'forward' | 'reverse'>('forward');\n\n /** Per-char render data. */\n protected readonly chars = computed(() => {\n const display = this.displayText();\n const revealed = this.revealedIndices();\n const decrypted = this.isDecrypted();\n const animating = this.isAnimating();\n return [...display].map((ch, i) => ({\n ch,\n revealed: revealed.has(i) || (!animating && decrypted),\n }));\n });\n\n /** Sequential reverse order — captured when reverse starts. */\n private reverseOrder: readonly number[] = [];\n private reversePointer = 0;\n private iterationCount = 0;\n private intervalId: ReturnType<typeof setInterval> | undefined;\n private hasAnimatedOnce = false;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n constructor() {\n if (!this.isBrowser) {\n // SSR: render plain text.\n effect(() => this.displayText.set(this.text()));\n return;\n }\n\n // Reset state whenever `text` or `animateOn` changes.\n effect(() => {\n const txt = this.text();\n const mode = this.animateOn();\n this.stopInterval();\n if (mode === 'click') {\n this.encryptInstantly(txt);\n } else {\n this.displayText.set(txt);\n this.isDecrypted.set(true);\n }\n this.revealedIndices.set(new Set());\n this.direction.set('forward');\n this.hasAnimatedOnce = false;\n });\n\n afterNextRender(() => {\n const mode = this.animateOn();\n if (mode === 'view' || mode === 'inViewHover') this.setupIntersectionObserver();\n });\n\n this.destroyRef.onDestroy(() => this.stopInterval());\n }\n\n // Trigger handlers\n\n protected onMouseEnter(): void {\n const mode = this.animateOn();\n if (mode !== 'hover' && mode !== 'inViewHover') return;\n this.triggerHoverDecrypt();\n }\n\n protected onMouseLeave(): void {\n const mode = this.animateOn();\n if (mode !== 'hover' && mode !== 'inViewHover') return;\n this.resetToPlain();\n }\n\n protected onClick(): void {\n if (this.animateOn() !== 'click') return;\n if (this.clickMode() === 'once') {\n if (this.isDecrypted()) return;\n this.direction.set('forward');\n this.triggerDecrypt();\n return;\n }\n if (this.isDecrypted()) this.triggerReverse();\n else {\n this.direction.set('forward');\n this.triggerDecrypt();\n }\n }\n\n // Internals\n\n private setupIntersectionObserver(): void {\n const io = new IntersectionObserver(\n (entries, obs) => {\n for (const e of entries) {\n if (e.isIntersecting && !this.hasAnimatedOnce) {\n obs.disconnect();\n this.hasAnimatedOnce = true;\n this.triggerDecrypt();\n break;\n }\n }\n },\n { threshold: 0.1, rootMargin: '0px' }\n );\n io.observe(this.host.nativeElement);\n this.destroyRef.onDestroy(() => io.disconnect());\n }\n\n private triggerHoverDecrypt(): void {\n if (this.isAnimating()) return;\n this.revealedIndices.set(new Set());\n this.isDecrypted.set(false);\n this.displayText.set(this.text());\n this.direction.set('forward');\n this.startInterval();\n }\n\n private resetToPlain(): void {\n this.stopInterval();\n this.revealedIndices.set(new Set());\n this.displayText.set(this.text());\n this.isDecrypted.set(true);\n this.direction.set('forward');\n }\n\n private triggerDecrypt(): void {\n if (this.sequential()) {\n this.revealedIndices.set(new Set());\n } else {\n this.revealedIndices.set(new Set());\n }\n this.direction.set('forward');\n this.startInterval();\n }\n\n private triggerReverse(): void {\n const txt = this.text();\n if (this.sequential()) {\n this.reverseOrder = computeOrder(charCount(txt), this.revealDirection()).slice().reverse();\n this.reversePointer = 0;\n }\n const all = fillAllIndices(charCount(txt));\n this.revealedIndices.set(all);\n this.displayText.set(this.shuffle(txt, all));\n this.direction.set('reverse');\n this.startInterval();\n }\n\n private encryptInstantly(txt: string): void {\n this.revealedIndices.set(new Set());\n this.displayText.set(this.shuffle(txt, new Set()));\n this.isDecrypted.set(false);\n }\n\n private startInterval(): void {\n // Reduced motion: every trigger funnels through here — skip the\n // scramble loop and jump straight to the plain, decrypted text.\n if (this.platform.prefersReducedMotion()) {\n this.resetToPlain();\n return;\n }\n\n this.stopInterval();\n this.isAnimating.set(true);\n this.iterationCount = 0;\n this.intervalId = setInterval(() => this.tick(), this.speed());\n }\n\n private stopInterval(): void {\n if (this.intervalId !== undefined) {\n clearInterval(this.intervalId);\n this.intervalId = undefined;\n }\n this.isAnimating.set(false);\n }\n\n private tick(): void {\n const txt = this.text();\n const seq = this.sequential();\n const dir = this.direction();\n const max = this.maxIterations();\n const revealed = this.revealedIndices();\n\n if (seq && dir === 'forward') {\n if (revealed.size < charCount(txt)) {\n const nextIdx = this.nextSequentialIndex(revealed, charCount(txt));\n const next = new Set(revealed);\n next.add(nextIdx);\n this.revealedIndices.set(next);\n this.displayText.set(this.shuffle(txt, next));\n } else {\n this.stopInterval();\n this.isDecrypted.set(true);\n this.displayText.set(txt);\n }\n return;\n }\n\n if (seq && dir === 'reverse') {\n if (this.reversePointer < this.reverseOrder.length) {\n const idx = this.reverseOrder[this.reversePointer++];\n const next = new Set(revealed);\n next.delete(idx);\n this.revealedIndices.set(next);\n this.displayText.set(this.shuffle(txt, next));\n if (next.size === 0) {\n this.stopInterval();\n this.isDecrypted.set(false);\n }\n } else {\n this.stopInterval();\n this.isDecrypted.set(false);\n }\n return;\n }\n\n if (!seq && dir === 'forward') {\n this.displayText.set(this.shuffle(txt, revealed));\n this.iterationCount++;\n if (this.iterationCount >= max) {\n this.stopInterval();\n this.displayText.set(txt);\n this.isDecrypted.set(true);\n }\n return;\n }\n\n if (!seq && dir === 'reverse') {\n let current = revealed;\n if (current.size === 0) current = fillAllIndices(charCount(txt));\n const removeCount = Math.max(1, Math.ceil(charCount(txt) / Math.max(1, max)));\n const next = removeRandomIndices(current, removeCount);\n this.revealedIndices.set(next);\n this.displayText.set(this.shuffle(txt, next));\n this.iterationCount++;\n if (next.size === 0 || this.iterationCount >= max) {\n this.stopInterval();\n this.isDecrypted.set(false);\n this.displayText.set(this.shuffle(txt, new Set()));\n this.revealedIndices.set(new Set());\n }\n }\n }\n\n private nextSequentialIndex(revealed: ReadonlySet<number>, len: number): number {\n switch (this.revealDirection()) {\n case 'end':\n return len - 1 - revealed.size;\n case 'center': {\n const middle = Math.floor(len / 2);\n const offset = Math.floor(revealed.size / 2);\n const candidate = revealed.size % 2 === 0 ? middle + offset : middle - offset - 1;\n if (candidate >= 0 && candidate < len && !revealed.has(candidate)) return candidate;\n for (let i = 0; i < len; i++) if (!revealed.has(i)) return i;\n return 0;\n }\n case 'start':\n default:\n return revealed.size;\n }\n }\n\n private shuffle(txt: string, revealed: ReadonlySet<number>): string {\n // Every index here counts CODE POINTS, because that is what `[...txt]`\n // produces and what `revealed` was built against. `split('')` counts UTF-16\n // units instead, so an emoji in the text (or in a custom alphabet) put half a\n // surrogate pair in the pool; and reading the revealed character back as\n // `txt[i]` mixed the two index spaces, so every character after the first\n // astral one revealed as the WRONG one.\n const pool = this.useOriginalCharsOnly()\n ? Array.from(new Set([...txt])).filter(ch => ch !== ' ')\n : [...this.characters()];\n if (pool.length === 0) return txt;\n return [...txt]\n .map((ch, i) => {\n if (ch === ' ') return ' ';\n if (revealed.has(i)) return ch;\n return pool[Math.floor(Math.random() * pool.length)];\n })\n .join('');\n }\n}\n\nexport type { WrDecryptTextAnimateOn, WrDecryptTextRevealDirection, WrDecryptTextClickMode } from './interfaces';\n","<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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;AAWG;AAuBH,MAAM,aAAa,GAAG,kEAAkE;AAExF,SAAS,YAAY,CAAC,GAAW,EAAE,GAAiC,EAAA;IAClE,MAAM,KAAK,GAAa,EAAE;IAC1B,IAAI,GAAG,IAAI,CAAC;AAAE,QAAA,OAAO,KAAK;AAC1B,IAAA,IAAI,GAAG,KAAK,OAAO,EAAE;QACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3C,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,GAAG,KAAK,KAAK,EAAE;AACjB,QAAA,KAAK,I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,s7CCxH1B,uSAQA,EAAA,MAAA,EAAA,CAAA,wOAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDgHa,aAAa,EAAA,UAAA,EAAA,CAAA;kBAZzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,aAAA,EAGZ,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,cAAc,EAAE,gBAAgB;AAChC,wBAAA,cAAc,EAAE,gBAAgB;AAChC,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA,EAAA,QAAA,EAAA,uSAAA,EAAA,MAAA,EAAA,CAAA,wOAAA,CAAA,EAAA;;;AEtHH;;AAEG;;;;"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ContentContainerComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Test harness for a dialog opened with `WrDialog.open()`.
|
|
11
|
+
*
|
|
12
|
+
* A dialog is never inside the fixture — `WrDialog` attaches it to the overlay
|
|
13
|
+
* container — so load this from `TestbedHarnessEnvironment.documentRootLoader()`
|
|
14
|
+
* rather than from `loader()`. The harness is a CONTENT CONTAINER, which is what
|
|
15
|
+
* makes the interesting assertions possible: the buttons and fields it holds are
|
|
16
|
+
* the consumer's own components, so `dialog.getHarness(WrButtonHarness…)` reads
|
|
17
|
+
* them without the spec ever touching the overlay.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);
|
|
22
|
+
* const dialog = await rootLoader.getHarness(WrDialogHarness);
|
|
23
|
+
*
|
|
24
|
+
* expect(await dialog.getTitleText()).toBe('Delete this item?');
|
|
25
|
+
* await (await dialog.getHarness(WrButtonHarness.with({ text: 'Delete' }))).click();
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @see https://ngwr.dev/guides/testing
|
|
29
|
+
*/
|
|
30
|
+
class WrDialogHarness extends ContentContainerComponentHarness {
|
|
31
|
+
/** The overlay panel `WrDialog` creates. */
|
|
32
|
+
static hostSelector = '.wr-dialog-panel';
|
|
33
|
+
/** Build a predicate that narrows the query — useful when two dialogs are stacked. */
|
|
34
|
+
static with(options = {}) {
|
|
35
|
+
return new HarnessPredicate(WrDialogHarness, options).addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitleText(), title));
|
|
36
|
+
}
|
|
37
|
+
/** The `[wrDialogTitle]` text, or `null` when the dialog has no title. */
|
|
38
|
+
async getTitleText() {
|
|
39
|
+
const title = await this.locatorForOptional('.wr-dialog__title')();
|
|
40
|
+
return title ? title.text() : null;
|
|
41
|
+
}
|
|
42
|
+
/** The `[wrDialogContent]` text, or `null` when the dialog projects no content region. */
|
|
43
|
+
async getContentText() {
|
|
44
|
+
const content = await this.locatorForOptional('.wr-dialog__content')();
|
|
45
|
+
return content ? content.text() : null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The role and modality the dialog announces.
|
|
49
|
+
*
|
|
50
|
+
* Worth asserting rather than assuming: `WrDialog` sets these on the OVERLAY
|
|
51
|
+
* element, not on the component it renders, so a consumer looking for them on
|
|
52
|
+
* their own host would not find them.
|
|
53
|
+
*/
|
|
54
|
+
async getRole() {
|
|
55
|
+
return (await this.host()).getAttribute('role');
|
|
56
|
+
}
|
|
57
|
+
/** Whether the dialog is marked `aria-modal`. */
|
|
58
|
+
async isModal() {
|
|
59
|
+
return (await (await this.host()).getAttribute('aria-modal')) === 'true';
|
|
60
|
+
}
|
|
61
|
+
/** Whether the built-in dismiss button is present (`closable`, the default). */
|
|
62
|
+
async isClosable() {
|
|
63
|
+
return (await this.locatorForOptional('.wr-dialog__close')()) !== null;
|
|
64
|
+
}
|
|
65
|
+
/** The dismiss button's accessible name — the string a screen reader reads out. */
|
|
66
|
+
async getCloseLabel() {
|
|
67
|
+
const close = await this.locatorForOptional('.wr-dialog__close')();
|
|
68
|
+
return close ? close.getAttribute('aria-label') : null;
|
|
69
|
+
}
|
|
70
|
+
/** Click the built-in dismiss button. Throws when the dialog was opened `closable: false`. */
|
|
71
|
+
async close() {
|
|
72
|
+
await (await this.locatorFor('.wr-dialog__close')()).click();
|
|
73
|
+
}
|
|
74
|
+
/** Press Escape. A dialog opened `closeOnEscape: false` ignores it — assert, do not assume. */
|
|
75
|
+
async sendEscape() {
|
|
76
|
+
await (await this.host()).sendKeys(TestKey.ESCAPE);
|
|
77
|
+
}
|
|
78
|
+
/** Whether focus is currently somewhere inside the dialog, where the trap should keep it. */
|
|
79
|
+
async isFocusTrapped() {
|
|
80
|
+
return (await this.host()).matchesSelector(':focus-within');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Generated bundle index. Do not edit.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export { WrDialogHarness };
|
|
89
|
+
//# sourceMappingURL=ngwr-dialog-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngwr-dialog-testing.mjs","sources":["../../../projects/lib/dialog/testing/wr-dialog-harness.ts","../../../projects/lib/dialog/testing/ngwr-dialog-testing.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 { ContentContainerComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrDialogHarnessFilters } from './interfaces';\n\n/**\n * Test harness for a dialog opened with `WrDialog.open()`.\n *\n * A dialog is never inside the fixture — `WrDialog` attaches it to the overlay\n * container — so load this from `TestbedHarnessEnvironment.documentRootLoader()`\n * rather than from `loader()`. The harness is a CONTENT CONTAINER, which is what\n * makes the interesting assertions possible: the buttons and fields it holds are\n * the consumer's own components, so `dialog.getHarness(WrButtonHarness…)` reads\n * them without the spec ever touching the overlay.\n *\n * @example\n * ```ts\n * const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n * const dialog = await rootLoader.getHarness(WrDialogHarness);\n *\n * expect(await dialog.getTitleText()).toBe('Delete this item?');\n * await (await dialog.getHarness(WrButtonHarness.with({ text: 'Delete' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrDialogHarness extends ContentContainerComponentHarness {\n /** The overlay panel `WrDialog` creates. */\n static hostSelector = '.wr-dialog-panel';\n\n /** Build a predicate that narrows the query — useful when two dialogs are stacked. */\n static with(options: WrDialogHarnessFilters = {}): HarnessPredicate<WrDialogHarness> {\n return new HarnessPredicate(WrDialogHarness, options).addOption('title', options.title, (harness, title) =>\n HarnessPredicate.stringMatches(harness.getTitleText(), title)\n );\n }\n\n /** The `[wrDialogTitle]` text, or `null` when the dialog has no title. */\n async getTitleText(): Promise<string | null> {\n const title = await this.locatorForOptional('.wr-dialog__title')();\n return title ? title.text() : null;\n }\n\n /** The `[wrDialogContent]` text, or `null` when the dialog projects no content region. */\n async getContentText(): Promise<string | null> {\n const content = await this.locatorForOptional('.wr-dialog__content')();\n return content ? content.text() : null;\n }\n\n /**\n * The role and modality the dialog announces.\n *\n * Worth asserting rather than assuming: `WrDialog` sets these on the OVERLAY\n * element, not on the component it renders, so a consumer looking for them on\n * their own host would not find them.\n */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** Whether the dialog is marked `aria-modal`. */\n async isModal(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-modal')) === 'true';\n }\n\n /** Whether the built-in dismiss button is present (`closable`, the default). */\n async isClosable(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-dialog__close')()) !== null;\n }\n\n /** The dismiss button's accessible name — the string a screen reader reads out. */\n async getCloseLabel(): Promise<string | null> {\n const close = await this.locatorForOptional('.wr-dialog__close')();\n return close ? close.getAttribute('aria-label') : null;\n }\n\n /** Click the built-in dismiss button. Throws when the dialog was opened `closable: false`. */\n async close(): Promise<void> {\n await (await this.locatorFor('.wr-dialog__close')()).click();\n }\n\n /** Press Escape. A dialog opened `closeOnEscape: false` ignores it — assert, do not assume. */\n async sendEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n\n /** Whether focus is currently somewhere inside the dialog, where the trap should keep it. */\n async isFocusTrapped(): Promise<boolean> {\n return (await this.host()).matchesSelector(':focus-within');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,MAAO,eAAgB,SAAQ,gCAAgC,CAAA;;AAEnE,IAAA,OAAO,YAAY,GAAG,kBAAkB;;AAGxC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAkC,EAAE,EAAA;AAC9C,QAAA,OAAO,IAAI,gBAAgB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KACrG,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,KAAK,CAAC,CAC9D;IACH;;AAGA,IAAA,MAAM,YAAY,GAAA;QAChB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,EAAE;AAClE,QAAA,OAAO,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,IAAI;IACpC;;AAGA,IAAA,MAAM,cAAc,GAAA;QAClB,MAAM,OAAO,GAAG,MAA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wrCopyToClipboard();
|
|
198
|
+
const async = this.doc.defaultView?.navigator?.clipboard;
|
|
198
199
|
try {
|
|
199
|
-
if (
|
|
200
|
-
|
|
200
|
+
if (async) {
|
|
201
|
+
try {
|
|
202
|
+
await async.writeText(text);
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// The legacy path is a RECOVERY from the async one, so it only runs
|
|
206
|
+
// when there was an async attempt to recover from. Reached from the
|
|
207
|
+
// fallback's own failure it just repeated the same refused write —
|
|
208
|
+
// two selections and two focus jumps for one press.
|
|
209
|
+
this.fallback(text);
|
|
210
|
+
}
|
|
201
211
|
}
|
|
202
212
|
else {
|
|
203
213
|
this.fallback(text);
|
|
204
214
|
}
|
|
205
|
-
this.copied.emit(text);
|
|
206
215
|
}
|
|
207
216
|
catch (error) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this.copied.emit(text);
|
|
211
|
-
}
|
|
212
|
-
catch (fallbackError) {
|
|
213
|
-
this.copyFailed.emit(fallbackError ?? error);
|
|
214
|
-
}
|
|
217
|
+
this.copyFailed.emit(error);
|
|
218
|
+
return;
|
|
215
219
|
}
|
|
220
|
+
// Outside the try because the try's job is the WRITE. The shape this
|
|
221
|
+
// replaced emitted inside it and recovered by calling `fallback` again, so
|
|
222
|
+
// one refused write became two selections, two focus jumps and two `copied`
|
|
223
|
+
// emissions. (A consumer's own `(copied)` handler cannot reach this frame
|
|
224
|
+
// either way: `OutputEmitterRef.emit` catches what a listener throws and
|
|
225
|
+
// hands it to the `ErrorHandler`.)
|
|
226
|
+
this.copied.emit(text);
|
|
216
227
|
}
|
|
217
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Legacy clipboard write — hidden textarea + `execCommand('copy')`.
|
|
230
|
+
*
|
|
231
|
+
* Two things this has to get right beyond writing the text. `execCommand`
|
|
232
|
+
* REPORTS refusal rather than throwing it: a document without focus hands back
|
|
233
|
+
* `false` and copies nothing, so ignoring the return value shows a "Copied!"
|
|
234
|
+
* toast over an unchanged clipboard. And selecting the textarea moves focus
|
|
235
|
+
* into it, so removing the node afterwards drops focus on `<body>` — the user's
|
|
236
|
+
* next Tab restarts from the top of the page, on every copy.
|
|
237
|
+
*/
|
|
218
238
|
fallback(text) {
|
|
219
239
|
const node = this.doc.createElement('textarea');
|
|
220
240
|
node.value = text;
|
|
@@ -224,13 +244,17 @@ class WrCopyToClipboard {
|
|
|
224
244
|
node.style.left = '0';
|
|
225
245
|
node.style.opacity = '0';
|
|
226
246
|
node.style.pointerEvents = 'none';
|
|
247
|
+
const previous = this.doc.activeElement;
|
|
227
248
|
this.doc.body.appendChild(node);
|
|
228
249
|
node.select();
|
|
229
250
|
try {
|
|
230
|
-
this.doc.execCommand('copy')
|
|
251
|
+
if (!this.doc.execCommand('copy'))
|
|
252
|
+
throw new Error('The copy command was refused.');
|
|
231
253
|
}
|
|
232
254
|
finally {
|
|
233
255
|
this.doc.body.removeChild(node);
|
|
256
|
+
if (previous instanceof HTMLElement)
|
|
257
|
+
previous.focus();
|
|
234
258
|
}
|
|
235
259
|
}
|
|
236
260
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrCopyToClipboard, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-directives.mjs","sources":["../../../projects/lib/directives/autofocus.ts","../../../projects/lib/directives/autosize.ts","../../../projects/lib/directives/click-outside.ts","../../../projects/lib/directives/copy-to-clipboard.ts","../../../projects/lib/directives/ngwr-directives.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Focus the host element after the first render — or whenever the bound\n * expression transitions to truthy.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /** Truthy = focus. Defaults to `true` so bare `wrAutofocus` works. */\n readonly wrAutofocus = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n afterNextRender(() => {\n if (this.wrAutofocus()) this.el.nativeElement.focus();\n });\n effect(() => {\n if (this.wrAutofocus()) {\n // Microtask defer so view updates that flip the expression land first.\n queueMicrotask(() => this.el.nativeElement.focus());\n }\n });\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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, PLATFORM_ID, afterEveryRender, effect, inject, input } from '@angular/core';\n\n/**\n * Auto-grow a `<textarea>` to fit its content. Optional `minRows` /\n * `maxRows` bounds the height in rendered rows.\n *\n * @example\n * ```html\n * <textarea wrAutosize minRows=\"2\" maxRows=\"8\" [(ngModel)]=\"text\"></textarea>\n * ```\n */\n@Directive({\n selector: 'textarea[wrAutosize]',\n host: { style: 'overflow: hidden; resize: none;', '(input)': 'onInput()' },\n})\nexport class WrAutosize {\n readonly minRows = input(1, { transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 1)) });\n readonly maxRows = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private lastValue: string | null = null;\n\n constructor() {\n // Typing fires `input`, but `[(ngModel)]` / `setValue` write the value\n // without one — a cheap per-render value check catches both, including\n // the initial write that lands after the first render.\n afterEveryRender(() => {\n const value = this.el.nativeElement.value;\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.resize();\n }\n });\n // Resize when `minRows` / `maxRows` change. Read the inputs before the\n // platform check so the effect still tracks them; the measurement itself\n // needs a real layout, which the server has none of (`afterEveryRender`\n // above is browser-only already, so it needs no guard).\n effect(() => {\n this.minRows();\n this.maxRows();\n if (!this.isBrowser) return;\n this.resize();\n });\n }\n\n /** @internal */\n protected onInput(): void {\n this.lastValue = this.el.nativeElement.value;\n this.resize();\n }\n\n /** Recompute height from `scrollHeight`, clamped to min/max rows. */\n private resize(): void {\n const node = this.el.nativeElement;\n const styles = getComputedStyle(node);\n // `line-height: normal` computes to the literal string — derive the\n // row height from the font size instead of guessing a fixed 20px.\n const lineHeight = parseFloat(styles.lineHeight) || parseFloat(styles.fontSize) * 1.25 || 20;\n const paddingY = parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n const border = (parseFloat(styles.borderTopWidth) || 0) + (parseFloat(styles.borderBottomWidth) || 0);\n\n // Reset to a single row first so `scrollHeight` shrinks as well as grows.\n node.style.height = 'auto';\n const min = this.minRows() * lineHeight + paddingY + border;\n const max = this.maxRows() > 0 ? this.maxRows() * lineHeight + paddingY + border : Infinity;\n const next = Math.min(Math.max(node.scrollHeight + border, min), max);\n node.style.height = `${next}px`;\n node.style.overflowY = node.scrollHeight + border > max ? 'auto' : 'hidden';\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 { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\n\n/**\n * Fires `(wrClickOutside)` when a pointer event lands outside the host\n * element. Useful for closing custom poppers / menus.\n *\n * @example\n * ```html\n * <div class=\"popup\" (wrClickOutside)=\"close()\"> … </div>\n * ```\n */\n@Directive({ selector: '[wrClickOutside]' })\nexport class WrClickOutside {\n readonly wrClickOutside = output<MouseEvent>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n // Listen outside Angular to avoid CD on every page click; re-enter\n // only when the event lands outside the host.\n this.zone.runOutsideAngular(() => {\n const handler = (event: MouseEvent): void => {\n const target = event.target as Node | null;\n if (target && !this.host.nativeElement.contains(target)) {\n this.zone.run(() => this.wrClickOutside.emit(event));\n }\n };\n this.doc.addEventListener('mousedown', handler, true);\n this.destroyRef.onDestroy(() => {\n this.doc.removeEventListener('mousedown', handler, true);\n });\n });\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 { DOCUMENT } from '@angular/common';\nimport { Directive, inject, input, output } from '@angular/core';\n\n/**\n * Copy `wrCopyToClipboard` to the system clipboard on host click.\n *\n * Uses `navigator.clipboard.writeText` when available, with a hidden\n * `<textarea>` + `document.execCommand('copy')` fallback for older browsers\n * and non-secure contexts.\n *\n * @example\n * ```html\n * <button [wrCopyToClipboard]=\"value\" (copied)=\"toast('Copied!')\">Copy</button>\n * ```\n */\n@Directive({ selector: '[wrCopyToClipboard]', host: { '(click)': 'onClick()' } })\nexport class WrCopyToClipboard {\n /** The text to copy. */\n readonly wrCopyToClipboard = input.required<string>();\n\n /** Emitted with the copied text once the write succeeds. */\n readonly copied = output<string>();\n\n /** Emitted if the copy fails (denied permission, no clipboard, …). */\n readonly copyFailed = output<unknown>();\n\n private readonly doc = inject(DOCUMENT);\n\n /** @internal */\n protected async onClick(): Promise<void> {\n const text = this.wrCopyToClipboard();\n try {\n if (this.doc.defaultView?.navigator?.clipboard) {\n await this.doc.defaultView.navigator.clipboard.writeText(text);\n } else {\n this.fallback(text);\n }\n this.copied.emit(text);\n } catch (error) {\n try {\n this.fallback(text);\n this.copied.emit(text);\n } catch (fallbackError) {\n this.copyFailed.emit(fallbackError ?? error);\n }\n }\n }\n\n /** Legacy clipboard write — hidden textarea + execCommand('copy'). */\n private fallback(text: string): void {\n const node = this.doc.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.position = 'fixed';\n node.style.top = '0';\n node.style.left = '0';\n node.style.opacity = '0';\n node.style.pointerEvents = 'none';\n this.doc.body.appendChild(node);\n node.select();\n try {\n this.doc.execCommand('copy');\n } finally {\n this.doc.body.removeChild(node);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;AASG;MAEU,WAAW,CAAA;;IAEb,WAAW,GAAG,KAAK,CAAC,IAAI,mFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEvD,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEjE,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAK;YACnB,IAAI,IAAI,CAAC,WAAW,EAAE;AAAE,gBAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE;AACvD,QAAA,CAAC,CAAC;QACF,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;;AAEtB,gBAAA,cAAc,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;YACrD;AACF,QAAA,CAAC,CAAC;IACJ;uGAhBW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,C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AACb,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;QAC9B;gBAAU;YACR,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QACjC;IACF;uGAjDW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,UAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,SAAS;mBAAC,EAAE,QAAQ,EAAE,qBAAqB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE;;;ACtBhF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-directives.mjs","sources":["../../../projects/lib/directives/autofocus.ts","../../../projects/lib/directives/autosize.ts","../../../projects/lib/directives/click-outside.ts","../../../projects/lib/directives/copy-to-clipboard.ts","../../../projects/lib/directives/ngwr-directives.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Focus the host element after the first render — or whenever the bound\n * expression transitions to truthy.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /** Truthy = focus. Defaults to `true` so bare `wrAutofocus` works. */\n readonly wrAutofocus = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n afterNextRender(() => {\n if (this.wrAutofocus()) this.el.nativeElement.focus();\n });\n effect(() => {\n if (this.wrAutofocus()) {\n // Microtask defer so view updates that flip the expression land first.\n queueMicrotask(() => this.el.nativeElement.focus());\n }\n });\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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, PLATFORM_ID, afterEveryRender, effect, inject, input } from '@angular/core';\n\n/**\n * Auto-grow a `<textarea>` to fit its content. Optional `minRows` /\n * `maxRows` bounds the height in rendered rows.\n *\n * @example\n * ```html\n * <textarea wrAutosize minRows=\"2\" maxRows=\"8\" [(ngModel)]=\"text\"></textarea>\n * ```\n */\n@Directive({\n selector: 'textarea[wrAutosize]',\n host: { style: 'overflow: hidden; resize: none;', '(input)': 'onInput()' },\n})\nexport class WrAutosize {\n readonly minRows = input(1, { transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 1)) });\n readonly maxRows = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private lastValue: string | null = null;\n\n constructor() {\n // Typing fires `input`, but `[(ngModel)]` / `setValue` write the value\n // without one — a cheap per-render value check catches both, including\n // the initial write that lands after the first render.\n afterEveryRender(() => {\n const value = this.el.nativeElement.value;\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.resize();\n }\n });\n // Resize when `minRows` / `maxRows` change. Read the inputs before the\n // platform check so the effect still tracks them; the measurement itself\n // needs a real layout, which the server has none of (`afterEveryRender`\n // above is browser-only already, so it needs no guard).\n effect(() => {\n this.minRows();\n this.maxRows();\n if (!this.isBrowser) return;\n this.resize();\n });\n }\n\n /** @internal */\n protected onInput(): void {\n this.lastValue = this.el.nativeElement.value;\n this.resize();\n }\n\n /** Recompute height from `scrollHeight`, clamped to min/max rows. */\n private resize(): void {\n const node = this.el.nativeElement;\n const styles = getComputedStyle(node);\n // `line-height: normal` computes to the literal string — derive the\n // row height from the font size instead of guessing a fixed 20px.\n const lineHeight = parseFloat(styles.lineHeight) || parseFloat(styles.fontSize) * 1.25 || 20;\n const paddingY = parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n const border = (parseFloat(styles.borderTopWidth) || 0) + (parseFloat(styles.borderBottomWidth) || 0);\n\n // Reset to a single row first so `scrollHeight` shrinks as well as grows.\n node.style.height = 'auto';\n const min = this.minRows() * lineHeight + paddingY + border;\n const max = this.maxRows() > 0 ? this.maxRows() * lineHeight + paddingY + border : Infinity;\n const next = Math.min(Math.max(node.scrollHeight + border, min), max);\n node.style.height = `${next}px`;\n node.style.overflowY = node.scrollHeight + border > max ? 'auto' : 'hidden';\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 { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\n\n/**\n * Fires `(wrClickOutside)` when a pointer event lands outside the host\n * element. Useful for closing custom poppers / menus.\n *\n * @example\n * ```html\n * <div class=\"popup\" (wrClickOutside)=\"close()\"> … </div>\n * ```\n */\n@Directive({ selector: '[wrClickOutside]' })\nexport class WrClickOutside {\n readonly wrClickOutside = output<MouseEvent>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n // Listen outside Angular to avoid CD on every page click; re-enter\n // only when the event lands outside the host.\n this.zone.runOutsideAngular(() => {\n const handler = (event: MouseEvent): void => {\n const target = event.target as Node | null;\n if (target && !this.host.nativeElement.contains(target)) {\n this.zone.run(() => this.wrClickOutside.emit(event));\n }\n };\n this.doc.addEventListener('mousedown', handler, true);\n this.destroyRef.onDestroy(() => {\n this.doc.removeEventListener('mousedown', handler, true);\n });\n });\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 { DOCUMENT } from '@angular/common';\nimport { Directive, inject, input, output } from '@angular/core';\n\n/**\n * Copy `wrCopyToClipboard` to the system clipboard on host click.\n *\n * Uses `navigator.clipboard.writeText` when available, with a hidden\n * `<textarea>` + `document.execCommand('copy')` fallback for older browsers\n * and non-secure contexts.\n *\n * @example\n * ```html\n * <button [wrCopyToClipboard]=\"value\" (copied)=\"toast('Copied!')\">Copy</button>\n * ```\n */\n@Directive({ selector: '[wrCopyToClipboard]', host: { '(click)': 'onClick()' } })\nexport class WrCopyToClipboard {\n /** The text to copy. */\n readonly wrCopyToClipboard = input.required<string>();\n\n /** Emitted with the copied text once the write succeeds. */\n readonly copied = output<string>();\n\n /** Emitted if the copy fails (denied permission, no clipboard, …). */\n readonly copyFailed = output<unknown>();\n\n private readonly doc = inject(DOCUMENT);\n\n /** @internal */\n protected async onClick(): Promise<void> {\n const text = this.wrCopyToClipboard();\n const async = this.doc.defaultView?.navigator?.clipboard;\n\n try {\n if (async) {\n try {\n await async.writeText(text);\n } catch {\n // The legacy path is a RECOVERY from the async one, so it only runs\n // when there was an async attempt to recover from. Reached from the\n // fallback's own failure it just repeated the same refused write —\n // two selections and two focus jumps for one press.\n this.fallback(text);\n }\n } else {\n this.fallback(text);\n }\n } catch (error) {\n this.copyFailed.emit(error);\n return;\n }\n\n // Outside the try because the try's job is the WRITE. The shape this\n // replaced emitted inside it and recovered by calling `fallback` again, so\n // one refused write became two selections, two focus jumps and two `copied`\n // emissions. (A consumer's own `(copied)` handler cannot reach this frame\n // either way: `OutputEmitterRef.emit` catches what a listener throws and\n // hands it to the `ErrorHandler`.)\n this.copied.emit(text);\n }\n\n /**\n * Legacy clipboard write — hidden textarea + `execCommand('copy')`.\n *\n * Two things this has to get right beyond writing the text. `execCommand`\n * REPORTS refusal rather than throwing it: a document without focus hands back\n * `false` and copies nothing, so ignoring the return value shows a \"Copied!\"\n * toast over an unchanged clipboard. And selecting the textarea moves focus\n * into it, so removing the node afterwards drops focus on `<body>` — the user's\n * next Tab restarts from the top of the page, on every copy.\n */\n private fallback(text: string): void {\n const node = this.doc.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.position = 'fixed';\n node.style.top = '0';\n node.style.left = '0';\n node.style.opacity = '0';\n node.style.pointerEvents = 'none';\n\n const previous = this.doc.activeElement;\n this.doc.body.appendChild(node);\n node.select();\n\n try {\n if (!this.doc.execCommand('copy')) throw new Error('The copy command was refused.');\n } finally {\n this.doc.body.removeChild(node);\n if (previous instanceof HTMLElement) previous.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAKH;;;;;;;;;AASG;MAEU,WAAW,CAAA;;IAEb,WAAW,GAAG,KAAK,CAAC,IAAI,mFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEvD,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAEjE,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAK;YACnB,IAAI,IAAI,CAAC,WAAW,EAAE;AAAE,gBAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,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AA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,SAAS;mBAAC,EAAE,QAAQ,EAAE,qBAAqB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE;;;ACtBhF;;AAEG;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { input, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
4
|
+
import { useI18nText } from 'ngwr/i18n';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @license
|
|
@@ -8,6 +9,14 @@ import { input, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
|
8
9
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
10
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
10
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* A segment's contribution to the ring. `Math.max(0, NaN)` is NaN, and the running total
|
|
14
|
+
* carries it forward — so one non-finite datum used to take out its own arc AND every arc
|
|
15
|
+
* after it, writing the literal text `NaN` into the path `d`.
|
|
16
|
+
*/
|
|
17
|
+
function weight(value) {
|
|
18
|
+
return Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
19
|
+
}
|
|
11
20
|
const FALLBACK_COLORS = [
|
|
12
21
|
'var(--wr-color-primary)',
|
|
13
22
|
'var(--wr-color-secondary)',
|
|
@@ -33,6 +42,14 @@ const FALLBACK_COLORS = [
|
|
|
33
42
|
class WrDonutChart {
|
|
34
43
|
segments = input([], /* @ts-ignore */
|
|
35
44
|
...(ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/**
|
|
46
|
+
* Accessible name of the chart. The ring is `aria-hidden` and the legend is optional,
|
|
47
|
+
* so with `showLegend: false` this is the only thing a screen reader gets. Falls back
|
|
48
|
+
* to `donutChart.label`.
|
|
49
|
+
*/
|
|
50
|
+
ariaLabel = input(null, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
52
|
+
resolvedAriaLabel = useI18nText(this.ariaLabel, 'donutChart.label', 'Donut chart');
|
|
36
53
|
/** Diameter in CSS pixels. @default 200 */
|
|
37
54
|
size = input(200, { ...(ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {}), transform: (v) => Math.max(48, coerceNumberProperty(v, 200)) });
|
|
38
55
|
/** Inner-ring thickness as a percent of radius (0–100). `0` = solid pie. @default 30 */
|
|
@@ -56,7 +73,7 @@ class WrDonutChart {
|
|
|
56
73
|
}, /* @ts-ignore */
|
|
57
74
|
...(ngDevMode ? [{ debugName: "innerR" }] : /* istanbul ignore next */ []));
|
|
58
75
|
total = computed(() => {
|
|
59
|
-
const sum = this.segments().reduce((acc, s) => acc +
|
|
76
|
+
const sum = this.segments().reduce((acc, s) => acc + weight(s.value), 0);
|
|
60
77
|
return sum > 0 ? sum : 1;
|
|
61
78
|
}, /* @ts-ignore */
|
|
62
79
|
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
@@ -65,7 +82,7 @@ class WrDonutChart {
|
|
|
65
82
|
const total = this.total();
|
|
66
83
|
let cumulative = 0;
|
|
67
84
|
return this.segments().map((s, i) => {
|
|
68
|
-
const value =
|
|
85
|
+
const value = weight(s.value);
|
|
69
86
|
const startAngle = (cumulative / total) * Math.PI * 2;
|
|
70
87
|
cumulative += value;
|
|
71
88
|
const endAngle = (cumulative / total) * Math.PI * 2;
|
|
@@ -122,12 +139,12 @@ class WrDonutChart {
|
|
|
122
139
|
].join(' ');
|
|
123
140
|
}
|
|
124
141
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrDonutChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrDonutChart, isStandalone: true, selector: "wr-donut-chart", inputs: { segments: { classPropertyName: "segments", publicName: "segments", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, centerValue: { classPropertyName: "centerValue", publicName: "centerValue", isSignal: true, isRequired: false, transformFunction: null }, centerLabel: { classPropertyName: "centerLabel", publicName: "centerLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-donut-chart" }, ngImport: i0, template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <svg viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n @for (slice of slices(); track $index) {\n <path [attr.d]=\"slice.path\" [attr.fill]=\"slice.color\" />\n }\n </svg>\n @if (centerValue() || centerLabel()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend()) {\n <ul class=\"wr-donut-chart__legend\">\n @for (slice of slices(); track $index) {\n <li class=\"wr-donut-chart__legend-item\">\n <span class=\"wr-donut-chart__swatch\" [style.background]=\"slice.color\"></span>\n <span class=\"wr-donut-chart__legend-label\">{{ slice.label }}</span>\n <span class=\"wr-donut-chart__legend-value\">{{ slice.value }}</span>\n </li>\n }\n </ul>\n}\n", encapsulation: i0.ViewEncapsulation.None });
|
|
142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrDonutChart, isStandalone: true, selector: "wr-donut-chart", inputs: { segments: { classPropertyName: "segments", publicName: "segments", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, centerValue: { classPropertyName: "centerValue", publicName: "centerValue", isSignal: true, isRequired: false, transformFunction: null }, centerLabel: { classPropertyName: "centerLabel", publicName: "centerLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-donut-chart" }, ngImport: i0, template: "<div class=\"wr-donut-chart__surface\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.width.px]=\"size()\">\n <svg viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n @for (slice of slices(); track $index) {\n <path [attr.d]=\"slice.path\" [attr.fill]=\"slice.color\" />\n }\n </svg>\n @if (centerValue() || centerLabel()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <ul class=\"wr-donut-chart__legend\">\n @for (slice of slices(); track $index) {\n <li class=\"wr-donut-chart__legend-item\">\n <span class=\"wr-donut-chart__swatch\" [style.background]=\"slice.color\"></span>\n <span class=\"wr-donut-chart__legend-label\">{{ slice.label }}</span>\n <span class=\"wr-donut-chart__legend-value\">{{ slice.value }}</span>\n </li>\n }\n </ul>\n}\n", encapsulation: i0.ViewEncapsulation.None });
|
|
126
143
|
}
|
|
127
144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrDonutChart, decorators: [{
|
|
128
145
|
type: Component,
|
|
129
|
-
args: [{ selector: 'wr-donut-chart', encapsulation: ViewEncapsulation.None, host: { class: 'wr-donut-chart' }, template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <svg viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n @for (slice of slices(); track $index) {\n <path [attr.d]=\"slice.path\" [attr.fill]=\"slice.color\" />\n }\n </svg>\n @if (centerValue() || centerLabel()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend()) {\n <ul class=\"wr-donut-chart__legend\">\n @for (slice of slices(); track $index) {\n <li class=\"wr-donut-chart__legend-item\">\n <span class=\"wr-donut-chart__swatch\" [style.background]=\"slice.color\"></span>\n <span class=\"wr-donut-chart__legend-label\">{{ slice.label }}</span>\n <span class=\"wr-donut-chart__legend-value\">{{ slice.value }}</span>\n </li>\n }\n </ul>\n}\n" }]
|
|
130
|
-
}], propDecorators: { segments: [{ type: i0.Input, args: [{ isSignal: true, alias: "segments", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], thickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "thickness", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], centerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerValue", required: false }] }], centerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerLabel", required: false }] }] } });
|
|
146
|
+
args: [{ selector: 'wr-donut-chart', encapsulation: ViewEncapsulation.None, host: { class: 'wr-donut-chart' }, template: "<div class=\"wr-donut-chart__surface\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.width.px]=\"size()\">\n <svg viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n @for (slice of slices(); track $index) {\n <path [attr.d]=\"slice.path\" [attr.fill]=\"slice.color\" />\n }\n </svg>\n @if (centerValue() || centerLabel()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <ul class=\"wr-donut-chart__legend\">\n @for (slice of slices(); track $index) {\n <li class=\"wr-donut-chart__legend-item\">\n <span class=\"wr-donut-chart__swatch\" [style.background]=\"slice.color\"></span>\n <span class=\"wr-donut-chart__legend-label\">{{ slice.label }}</span>\n <span class=\"wr-donut-chart__legend-value\">{{ slice.value }}</span>\n </li>\n }\n </ul>\n}\n" }]
|
|
147
|
+
}], propDecorators: { segments: [{ type: i0.Input, args: [{ isSignal: true, alias: "segments", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], thickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "thickness", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], centerValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerValue", required: false }] }], centerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "centerLabel", required: false }] }] } });
|
|
131
148
|
|
|
132
149
|
/**
|
|
133
150
|
* Generated bundle index. Do not edit.
|