ngwr 10.2.1 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -19
- package/action-sheet/styles/_index.scss +4 -1
- package/anchor/styles/_index.scss +6 -5
- package/back-top/styles/_index.scss +6 -1
- package/blur-text/styles/_index.scss +13 -0
- package/button/styles/_index.scss +11 -6
- package/calendar/styles/_index.scss +11 -2
- package/carousel/styles/_index.scss +13 -2
- package/cascader/styles/_index.scss +5 -3
- package/circular-text/styles/_index.scss +2 -0
- package/collapse/styles/_index.scss +1 -1
- package/color-picker/styles/_index.scss +6 -1
- package/command-palette/styles/_index.scss +2 -1
- package/compare/styles/_index.scss +1 -2
- package/context-menu/styles/_index.scss +8 -2
- package/descriptions/styles/_index.scss +2 -2
- package/dialog/styles/_index.scss +7 -0
- package/drawer/styles/_index.scss +20 -1
- package/dropdown/styles/_index.scss +19 -5
- package/empty/styles/_index.scss +10 -0
- package/falling-text/styles/_index.scss +2 -1
- package/fesm2022/ngwr-action-sheet.mjs +13 -3
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-affix.mjs +40 -13
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +18 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-aurora.mjs +2 -2
- package/fesm2022/ngwr-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +31 -7
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +6 -2
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +1 -1
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +30 -9
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +2 -2
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +2 -2
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +9 -4
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button-testing.mjs +96 -0
- package/fesm2022/ngwr-button-testing.mjs.map +1 -0
- package/fesm2022/ngwr-button.mjs +31 -14
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +40 -8
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +20 -1
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +2 -2
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +377 -0
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
- package/fesm2022/ngwr-carousel.mjs +67 -13
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs +534 -0
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
- package/fesm2022/ngwr-cascader.mjs +2 -2
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
- package/fesm2022/ngwr-checkbox.mjs +9 -3
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +2 -2
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +2 -2
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-collapse-testing.mjs +368 -0
- package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
- package/fesm2022/ngwr-color-picker.mjs +134 -14
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
- package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
- package/fesm2022/ngwr-command-palette.mjs +58 -8
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +103 -13
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs +106 -0
- package/fesm2022/ngwr-config.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu.mjs +94 -8
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +5 -1
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +11 -3
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter-luxon.mjs +52 -4
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapter.mjs +54 -8
- package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker.mjs +73 -3
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +27 -9
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +89 -0
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
- package/fesm2022/ngwr-directives.mjs +36 -12
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +22 -5
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer-testing.mjs +250 -0
- package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown.mjs +10 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +24 -7
- package/fesm2022/ngwr-empty.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +57 -10
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +2 -2
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form-testing.mjs +451 -0
- package/fesm2022/ngwr-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-form.mjs +19 -3
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +9 -2
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +19 -5
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +2 -2
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +2 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +50 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +48 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +23 -0
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs +306 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-number.mjs +35 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input-otp.mjs +36 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +102 -0
- package/fesm2022/ngwr-input-testing.mjs.map +1 -0
- package/fesm2022/ngwr-input.mjs +47 -10
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +44 -8
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +21 -5
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +33 -6
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +17 -4
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown-testing.mjs +516 -0
- package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
- package/fesm2022/ngwr-markdown.mjs +1492 -0
- package/fesm2022/ngwr-markdown.mjs.map +1 -0
- package/fesm2022/ngwr-marquee.mjs +17 -6
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-mention-testing.mjs +513 -0
- package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
- package/fesm2022/ngwr-mention.mjs +10 -1
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +22 -7
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +19 -5
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +41 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +389 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pagination.mjs +14 -2
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popconfirm.mjs +95 -17
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +316 -0
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
- package/fesm2022/ngwr-popover.mjs +21 -3
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +17 -2
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +13 -3
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio-testing.mjs +392 -0
- package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
- package/fesm2022/ngwr-radio.mjs +10 -3
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating-testing.mjs +384 -0
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
- package/fesm2022/ngwr-rating.mjs +37 -2
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-segmented-testing.mjs +512 -0
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select-testing.mjs +268 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -0
- package/fesm2022/ngwr-select.mjs +87 -16
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +2 -2
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +65 -12
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +478 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
- package/fesm2022/ngwr-slider.mjs +57 -13
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +26 -6
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +37 -4
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +12 -3
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +2 -2
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-split-text.mjs +2 -2
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +70 -9
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +2 -2
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +2 -2
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +24 -7
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs +477 -0
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch-testing.mjs +77 -0
- package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
- package/fesm2022/ngwr-switch.mjs +9 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +580 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -0
- package/fesm2022/ngwr-table.mjs +87 -14
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +617 -0
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tabs.mjs +38 -6
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +238 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
- package/fesm2022/ngwr-textarea.mjs +32 -4
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +2 -2
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +101 -0
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
- package/fesm2022/ngwr-toast.mjs +2 -2
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +61 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs +538 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
- package/fesm2022/ngwr-transfer.mjs +45 -14
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +734 -0
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +73 -7
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +5 -3
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +31 -5
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +3 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +8 -0
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +7 -2
- package/gauge/styles/_index.scss +1 -1
- package/glitch-text/styles/_index.scss +4 -0
- package/i18n/en.json +48 -0
- package/i18n/ru.json +48 -0
- package/image-cropper/styles/_index.scss +13 -1
- package/input/styles/_index.scss +2 -2
- package/input-number/styles/_index.scss +7 -2
- package/knob/styles/_index.scss +8 -1
- package/layout/styles/_index.scss +3 -3
- package/lightbox/styles/_index.scss +10 -2
- package/line-chart/styles/_index.scss +6 -0
- package/llms-full.txt +151 -4
- package/llms.txt +57 -8
- package/loading-bar/styles/_index.scss +1 -2
- package/markdown/styles/_index.scss +296 -0
- package/marquee/styles/_index.scss +12 -0
- package/mcp/api.js +512 -0
- package/mcp/catalog.js +157 -0
- package/mcp/server.js +273 -0
- package/mcp/tools.js +366 -0
- package/meter-group/styles/_index.scss +1 -1
- package/package.json +186 -35
- package/pagination/styles/_index.scss +6 -6
- package/popover/styles/_index.scss +37 -5
- package/rating/styles/_index.scss +10 -0
- package/result/styles/_index.scss +3 -1
- package/schematics/use/symbol-map.json +2 -0
- package/segmented/styles/_index.scss +12 -1
- package/select/styles/_index.scss +32 -10
- package/sidebar/styles/_index.scss +30 -5
- package/slider/styles/_index.scss +15 -0
- package/speed-dial/styles/_index.scss +20 -0
- package/split-text/styles/_index.scss +13 -0
- package/star-border/styles/_index.scss +2 -0
- package/stepper/styles/_index.scss +19 -3
- package/styles/_grid.scss +4 -4
- package/styles.scss +1 -0
- package/switch/styles/_index.scss +5 -3
- package/table/styles/_index.scss +25 -12
- package/tabs/styles/_index.scss +11 -1
- package/textarea/styles/_index.scss +5 -0
- package/theme/styles/_colors.scss +44 -15
- package/theme/styles/_dark.scss +35 -15
- package/theme/styles/_mixins.scss +3 -0
- package/timeline/styles/_index.scss +2 -2
- package/toast/styles/_index.scss +17 -8
- package/toolbar/styles/_index.scss +3 -3
- package/tour/styles/_index.scss +7 -1
- package/tree/styles/_index.scss +9 -5
- package/types/ngwr-action-sheet.d.ts +9 -1
- package/types/ngwr-affix.d.ts +7 -1
- package/types/ngwr-anchor.d.ts +8 -1
- package/types/ngwr-avatar.d.ts +13 -3
- package/types/ngwr-bar-chart.d.ts +16 -0
- package/types/ngwr-burger.d.ts +6 -2
- package/types/ngwr-button-testing.d.ts +85 -0
- package/types/ngwr-button.d.ts +26 -10
- package/types/ngwr-calendar-heatmap.d.ts +16 -2
- package/types/ngwr-calendar.d.ts +10 -0
- package/types/ngwr-carousel-testing.d.ts +257 -0
- package/types/ngwr-carousel.d.ts +20 -4
- package/types/ngwr-cascader-testing.d.ts +392 -0
- package/types/ngwr-checkbox-testing.d.ts +77 -0
- package/types/ngwr-checkbox.d.ts +7 -2
- package/types/ngwr-collapse-testing.d.ts +290 -0
- package/types/ngwr-color-picker.d.ts +20 -11
- package/types/ngwr-command-palette-testing.d.ts +437 -0
- package/types/ngwr-command-palette.d.ts +25 -2
- package/types/ngwr-compare.d.ts +50 -2
- package/types/ngwr-config.d.ts +176 -0
- package/types/ngwr-context-menu-testing.d.ts +401 -0
- package/types/ngwr-context-menu.d.ts +65 -17
- package/types/ngwr-counter.d.ts +6 -1
- package/types/ngwr-date-adapter-luxon.d.ts +26 -0
- package/types/ngwr-date-picker-testing.d.ts +518 -0
- package/types/ngwr-date-picker.d.ts +4 -0
- package/types/ngwr-dialog-testing.d.ts +79 -0
- package/types/ngwr-directives.d.ts +10 -1
- package/types/ngwr-donut-chart.d.ts +8 -1
- package/types/ngwr-drawer-testing.d.ts +196 -0
- package/types/ngwr-dropdown-testing.d.ts +202 -0
- package/types/ngwr-dropdown.d.ts +7 -1
- package/types/ngwr-empty.d.ts +19 -4
- package/types/ngwr-event-calendar.d.ts +26 -1
- package/types/ngwr-file-upload-testing.d.ts +194 -0
- package/types/ngwr-form-testing.d.ts +379 -0
- package/types/ngwr-form.d.ts +17 -0
- package/types/ngwr-gauge.d.ts +13 -1
- package/types/ngwr-image-cropper.d.ts +10 -0
- package/types/ngwr-input-number-testing.d.ts +226 -0
- package/types/ngwr-input-number.d.ts +29 -1
- package/types/ngwr-input-otp-testing.d.ts +299 -0
- package/types/ngwr-input-otp.d.ts +23 -2
- package/types/ngwr-input-testing.d.ts +84 -0
- package/types/ngwr-input.d.ts +20 -6
- package/types/ngwr-knob.d.ts +18 -0
- package/types/ngwr-layout.d.ts +1 -0
- package/types/ngwr-lightbox.d.ts +17 -3
- package/types/ngwr-line-chart.d.ts +9 -2
- package/types/ngwr-markdown-testing.d.ts +462 -0
- package/types/ngwr-markdown.d.ts +534 -0
- package/types/ngwr-marquee.d.ts +12 -2
- package/types/ngwr-mention-testing.d.ts +359 -0
- package/types/ngwr-meta.d.ts +4 -2
- package/types/ngwr-meter-group.d.ts +11 -1
- package/types/ngwr-overlay.d.ts +33 -2
- package/types/ngwr-pagination-testing.d.ts +291 -0
- package/types/ngwr-pagination.d.ts +1 -0
- package/types/ngwr-popconfirm-testing.d.ts +235 -0
- package/types/ngwr-popconfirm.d.ts +31 -21
- package/types/ngwr-popover-testing.d.ts +221 -0
- package/types/ngwr-popover.d.ts +9 -0
- package/types/ngwr-pull-to-refresh.d.ts +7 -0
- package/types/ngwr-qr.d.ts +9 -1
- package/types/ngwr-radio-testing.d.ts +296 -0
- package/types/ngwr-radio.d.ts +8 -2
- package/types/ngwr-rating-testing.d.ts +291 -0
- package/types/ngwr-rating.d.ts +23 -0
- package/types/ngwr-segmented-testing.d.ts +401 -0
- package/types/ngwr-select-testing.d.ts +175 -0
- package/types/ngwr-select.d.ts +45 -4
- package/types/ngwr-sidebar.d.ts +17 -2
- package/types/ngwr-slider-testing.d.ts +329 -0
- package/types/ngwr-slider.d.ts +35 -1
- package/types/ngwr-sparkline.d.ts +12 -2
- package/types/ngwr-speed-dial.d.ts +17 -18
- package/types/ngwr-spinner.d.ts +8 -1
- package/types/ngwr-splitter.d.ts +24 -1
- package/types/ngwr-statistic.d.ts +12 -2
- package/types/ngwr-stepper-testing.d.ts +346 -0
- package/types/ngwr-switch-testing.d.ts +66 -0
- package/types/ngwr-switch.d.ts +7 -2
- package/types/ngwr-table-testing.d.ts +423 -0
- package/types/ngwr-table.d.ts +42 -0
- package/types/ngwr-tabs-testing.d.ts +470 -0
- package/types/ngwr-tabs.d.ts +9 -0
- package/types/ngwr-textarea-testing.d.ts +184 -0
- package/types/ngwr-textarea.d.ts +7 -2
- package/types/ngwr-toast-testing.d.ts +80 -0
- package/types/ngwr-tour.d.ts +27 -0
- package/types/ngwr-transfer-testing.d.ts +444 -0
- package/types/ngwr-transfer.d.ts +16 -1
- package/types/ngwr-tree-testing.d.ts +501 -0
- package/types/ngwr-tree.d.ts +33 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-virtual-scroll.d.ts +13 -1
- package/typewriter/styles/_index.scss +1 -1
- package/typography/styles/_index.scss +1 -1
- package/window/styles/_index.scss +32 -9
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { EnvironmentProviders, Signal, InjectionToken } from '@angular/core';
|
|
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
|
+
* The size scale every control shares.
|
|
11
|
+
*
|
|
12
|
+
* Declared here rather than imported from a component, and that is deliberate:
|
|
13
|
+
* `ngwr/config` must not depend on the entry points that depend on IT, or
|
|
14
|
+
* ng-packagr refuses the build. Nothing drifts silently as a result — a component
|
|
15
|
+
* reads its default through {@link useConfigValue}, whose generic is the
|
|
16
|
+
* component's OWN size type, so narrowing `WrButtonSize` would stop that call
|
|
17
|
+
* compiling. The type checker is the parity guard.
|
|
18
|
+
*/
|
|
19
|
+
type WrControlSize = 'sm' | 'md' | 'lg';
|
|
20
|
+
/** Defaults every control-shaped component understands. */
|
|
21
|
+
interface WrControlDefaults {
|
|
22
|
+
/** `sm` / `md` / `lg`. */
|
|
23
|
+
readonly size?: WrControlSize;
|
|
24
|
+
/** Pill-shaped rather than the standard radius. */
|
|
25
|
+
readonly rounded?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* App-wide component defaults.
|
|
29
|
+
*
|
|
30
|
+
* Every field is a DEFAULT, never an override: a value bound on the element
|
|
31
|
+
* always wins, so a config is what a component falls back to rather than
|
|
32
|
+
* something a template has to fight. That ordering is the whole design — the
|
|
33
|
+
* lesson from NG-ZORRO's `NzConfigService`, where a global set could not be
|
|
34
|
+
* turned off locally and consumers ended up re-stating every input to escape it.
|
|
35
|
+
*
|
|
36
|
+
* Empty by default. A component with no config behaves exactly as it does today.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* provideWrConfig({
|
|
41
|
+
* button: { size: 'sm' },
|
|
42
|
+
* input: { size: 'sm' },
|
|
43
|
+
* select: { size: 'sm', rounded: true },
|
|
44
|
+
* })
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Two keys are deliberately absent, and it is worth knowing why before adding
|
|
48
|
+
* them back.
|
|
49
|
+
*
|
|
50
|
+
* **No `color`.** The library's own chrome binds `[color]="isCurrent ? 'primary' :
|
|
51
|
+
* null"` — `pagination`, the `event-calendar` view switcher — where `null` means
|
|
52
|
+
* "neutral". {@link useConfigValue} reads `null` as "the template said nothing", so
|
|
53
|
+
* a configured intent would repaint every one of those buttons. There is no value
|
|
54
|
+
* in `WrColor` that means "no intent", so a colour default cannot be made safe
|
|
55
|
+
* without inventing a sentinel, and a sentinel is a worse API than no key.
|
|
56
|
+
*
|
|
57
|
+
* **No `button.shape`.** A button's corner treatment is three-valued
|
|
58
|
+
* (`rounded` / `pill` / `squircle`) and its type lives in `ngwr/button`, which
|
|
59
|
+
* imports THIS entry point — naming it here would be a circular dependency
|
|
60
|
+
* ng-packagr refuses. A boolean `rounded` was tried and rejected: it cannot express
|
|
61
|
+
* `squircle`, and its polarity inverts the component's own vocabulary, where
|
|
62
|
+
* `rounded` is the value a `false` would produce.
|
|
63
|
+
*/
|
|
64
|
+
interface WrConfig {
|
|
65
|
+
readonly button?: Pick<WrControlDefaults, 'size'>;
|
|
66
|
+
readonly checkbox?: Pick<WrControlDefaults, 'size'>;
|
|
67
|
+
readonly input?: WrControlDefaults;
|
|
68
|
+
readonly inputNumber?: WrControlDefaults;
|
|
69
|
+
readonly inputOtp?: Pick<WrControlDefaults, 'size'>;
|
|
70
|
+
/**
|
|
71
|
+
* Defaults for `<wr-markdown>`.
|
|
72
|
+
*
|
|
73
|
+
* Both keys are app-wide policy rather than per-instance taste, which is the
|
|
74
|
+
* test a config key has to pass: whether links in rendered markdown open in a
|
|
75
|
+
* new tab, and whether code blocks carry a copy button, are decisions an app
|
|
76
|
+
* makes once. `linkTarget` is spelled as a literal union rather than imported
|
|
77
|
+
* from `ngwr/markdown` for the reason `button.shape` is absent — that entry
|
|
78
|
+
* point imports this one, and ng-packagr refuses the cycle.
|
|
79
|
+
*/
|
|
80
|
+
readonly markdown?: {
|
|
81
|
+
readonly linkTarget?: '_blank' | '_self';
|
|
82
|
+
readonly copyable?: boolean;
|
|
83
|
+
};
|
|
84
|
+
readonly radio?: Pick<WrControlDefaults, 'size'>;
|
|
85
|
+
readonly select?: WrControlDefaults;
|
|
86
|
+
readonly switch?: Pick<WrControlDefaults, 'size'>;
|
|
87
|
+
readonly textarea?: Pick<WrControlDefaults, 'size'>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @license
|
|
92
|
+
*
|
|
93
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
94
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Set app-wide component defaults.
|
|
99
|
+
*
|
|
100
|
+
* Nothing is activated by this and no service is constructed — unlike
|
|
101
|
+
* `provideWrDensity()`, which has to instantiate its service to write an
|
|
102
|
+
* attribute onto `<html>`. A config is read on demand by whichever component
|
|
103
|
+
* wants a default, so providing it costs one token.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* bootstrapApplication(App, {
|
|
108
|
+
* providers: [provideWrConfig({ button: { size: 'sm' }, select: { rounded: true } })],
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* Scoped use works the same way: put it in a route's `providers` and only that
|
|
113
|
+
* branch of the tree sees it, because the components resolve the token through
|
|
114
|
+
* their own injector.
|
|
115
|
+
*
|
|
116
|
+
* @see https://ngwr.dev/start/configuration
|
|
117
|
+
*/
|
|
118
|
+
declare function provideWrConfig(config: WrConfig): EnvironmentProviders;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @license
|
|
122
|
+
*
|
|
123
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
124
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Resolve an input against the app's {@link WrConfig}, then a built-in fallback.
|
|
129
|
+
*
|
|
130
|
+
* The same shape as `useI18nText` from `ngwr/i18n`, and for the same reason: a
|
|
131
|
+
* component's default has three possible sources and exactly one precedence
|
|
132
|
+
* order, so it is worth writing once.
|
|
133
|
+
*
|
|
134
|
+
* 1. What the template bound, if it bound anything.
|
|
135
|
+
* 2. What `provideWrConfig()` set for this component.
|
|
136
|
+
* 3. The component's own fallback.
|
|
137
|
+
*
|
|
138
|
+
* A bound value always wins. That is what keeps a global config from becoming
|
|
139
|
+
* something templates have to escape — the mistake NG-ZORRO's `NzConfigService`
|
|
140
|
+
* is remembered for.
|
|
141
|
+
*
|
|
142
|
+
* Call it from a field initializer (it injects), and give the input `null` as its
|
|
143
|
+
* own default so "not set" is expressible:
|
|
144
|
+
*
|
|
145
|
+
* ```ts
|
|
146
|
+
* readonly size = input<WrButtonSize | null>(null);
|
|
147
|
+
* protected readonly resolvedSize = useConfigValue(this.size, c => c.button?.size, 'md');
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* The generic is the COMPONENT's type, not the config's, so a component whose
|
|
151
|
+
* size scale is narrower than {@link WrControlSize} stops compiling here rather
|
|
152
|
+
* than accepting a value it cannot render — the type checker doing the work a
|
|
153
|
+
* parity script would otherwise have to.
|
|
154
|
+
*/
|
|
155
|
+
declare function useConfigValue<T>(binding: Signal<T | null | undefined>, pick: (config: WrConfig) => T | undefined, fallback: T): Signal<T>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @license
|
|
159
|
+
*
|
|
160
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
161
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* App-wide component defaults, or `{}` when the app never called
|
|
166
|
+
* `provideWrConfig()`.
|
|
167
|
+
*
|
|
168
|
+
* A factory default rather than an optional inject at every call site: a
|
|
169
|
+
* component asking for its own default should not have to care whether anyone
|
|
170
|
+
* configured anything, and `{}` reads the same as absent through
|
|
171
|
+
* {@link useConfigValue}.
|
|
172
|
+
*/
|
|
173
|
+
declare const WR_CONFIG: InjectionToken<WrConfig>;
|
|
174
|
+
|
|
175
|
+
export { WR_CONFIG, provideWrConfig, useConfigValue };
|
|
176
|
+
export type { WrConfig, WrControlDefaults, WrControlSize };
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { BaseHarnessFilters, ComponentHarness, HarnessPredicate, ContentContainerComponentHarness, HarnessLoader } 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
|
+
/** Narrows which `[wrContextMenu]` target a harness query matches. */
|
|
11
|
+
interface WrContextMenuHarnessFilters extends BaseHarnessFilters {
|
|
12
|
+
/**
|
|
13
|
+
* Match the target's visible text — the content of whatever element the
|
|
14
|
+
* consumer put `[wrContextMenu]` on, which is usually the thing being
|
|
15
|
+
* right-clicked rather than a label. A string is an exact match, a RegExp is
|
|
16
|
+
* tested.
|
|
17
|
+
*/
|
|
18
|
+
readonly text?: string | RegExp;
|
|
19
|
+
/** Match only targets whose menu is showing (`true`) or shut (`false`). */
|
|
20
|
+
readonly open?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Narrows which item inside a context menu a harness query matches. */
|
|
23
|
+
interface WrContextMenuItemHarnessFilters extends BaseHarnessFilters {
|
|
24
|
+
/** Match the item's label — a string is an exact match, a RegExp is tested. */
|
|
25
|
+
readonly text?: string | RegExp;
|
|
26
|
+
/** Match only enabled (`false`) or only disabled (`true`) items. */
|
|
27
|
+
readonly disabled?: boolean;
|
|
28
|
+
/** Match only items that own a nested submenu (`true`), or only leaves (`false`). */
|
|
29
|
+
readonly hasSubmenu?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @license
|
|
34
|
+
*
|
|
35
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
36
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Test harness for one `<wr-context-menu-item>` inside a context menu.
|
|
41
|
+
*
|
|
42
|
+
* The selector is the CLASS rather than the element, matching
|
|
43
|
+
* `.wr-dropdown-item`: it is public API, and it is on the host whichever way the
|
|
44
|
+
* item was written. A `<wr-context-menu-divider>` is deliberately not one of
|
|
45
|
+
* these — it announces `role="separator"` rather than `menuitem`, so it is not
|
|
46
|
+
* something a user can land on and not a member of the item list
|
|
47
|
+
* (`WrContextMenuHarness.getDividerCount()` counts those).
|
|
48
|
+
*
|
|
49
|
+
* An item that owns a `[submenu]` is also the way INTO it: the submenu is a
|
|
50
|
+
* second overlay pane, a sibling of the root menu rather than a child of the
|
|
51
|
+
* item, and it is reached through the id the item publishes as `aria-controls`
|
|
52
|
+
* while it is open. `getSubmenuItems()` answers with these same harnesses, so a
|
|
53
|
+
* chain of any depth is walked by repeating the call.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const [cut, copy, more] = await menu.getItems();
|
|
58
|
+
*
|
|
59
|
+
* expect(await copy.isDisabled()).toBe(true);
|
|
60
|
+
* await more.openSubmenu();
|
|
61
|
+
* await more.clickSubmenuItem({ text: 'Duplicate' });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @see https://ngwr.dev/guides/testing
|
|
65
|
+
*/
|
|
66
|
+
declare class WrContextMenuItemHarness extends ComponentHarness {
|
|
67
|
+
/** The class the item paints on its host. */
|
|
68
|
+
static hostSelector: string;
|
|
69
|
+
/** Build a predicate that narrows the query. */
|
|
70
|
+
static with(options?: WrContextMenuItemHarnessFilters): HarnessPredicate<WrContextMenuItemHarness>;
|
|
71
|
+
/**
|
|
72
|
+
* The item's label, trimmed.
|
|
73
|
+
*
|
|
74
|
+
* Read from the label span, not from the host: a registered icon is written in
|
|
75
|
+
* with `innerHTML`, so an icon carrying a `<title>` would otherwise become
|
|
76
|
+
* part of the answer.
|
|
77
|
+
*/
|
|
78
|
+
getText(): Promise<string>;
|
|
79
|
+
/** The role the item announces — `menuitem`. */
|
|
80
|
+
getRole(): Promise<string | null>;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the item refuses activation.
|
|
83
|
+
*
|
|
84
|
+
* `aria-disabled`, not the `--disabled` modifier class: both are there, and
|
|
85
|
+
* this is the one a screen reader is told.
|
|
86
|
+
*/
|
|
87
|
+
isDisabled(): Promise<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the item owns a nested submenu.
|
|
90
|
+
*
|
|
91
|
+
* Read from `aria-haspopup`, not from the `--has-submenu` class or the
|
|
92
|
+
* `[submenu]` input: the input is always BOUND (it takes a
|
|
93
|
+
* `<wr-context-menu>` reference), so it never reaches the DOM, and the ARIA
|
|
94
|
+
* property is what announces the item as a drill-down.
|
|
95
|
+
*/
|
|
96
|
+
hasSubmenu(): Promise<boolean>;
|
|
97
|
+
/** Whether this item's submenu is showing, per `aria-expanded`. */
|
|
98
|
+
isSubmenuOpen(): Promise<boolean>;
|
|
99
|
+
/** Whether the item shows a leading icon. */
|
|
100
|
+
hasIcon(): Promise<boolean>;
|
|
101
|
+
/** The leading icon's registered name, or `null` when the item has no icon. */
|
|
102
|
+
getIconName(): Promise<string | null>;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the item holds focus.
|
|
105
|
+
*
|
|
106
|
+
* Worth asking, because nothing in this component ever puts it there: unlike
|
|
107
|
+
* `<wr-dropdown-menu>`, a context menu does not focus its first item on open
|
|
108
|
+
* and has no arrow-key cursor between items. Focus lands on an item when
|
|
109
|
+
* something sends it a key — which every keyboard method here does, since the
|
|
110
|
+
* CDK focuses an element before typing into it.
|
|
111
|
+
*/
|
|
112
|
+
isFocused(): Promise<boolean>;
|
|
113
|
+
/**
|
|
114
|
+
* Click the item. A disabled item throws instead.
|
|
115
|
+
*
|
|
116
|
+
* Refusing is the only honest answer. A browser never delivers the click at all:
|
|
117
|
+
* `pointer-events: none` on the `--disabled` modifier takes the row out of the
|
|
118
|
+
* hit test. jsdom loads no stylesheets, so a click dispatched here DOES land on
|
|
119
|
+
* the host, and while the component's own handler refuses it (a disabled item
|
|
120
|
+
* dismisses nothing), the consumer's `(click)` on that same host is a separate
|
|
121
|
+
* listener and runs — so the spec would record an activation that cannot happen
|
|
122
|
+
* in a browser. Assert `isDisabled()` instead.
|
|
123
|
+
*
|
|
124
|
+
* Activating a LEAF item dismisses the whole chain, root menu included. An item
|
|
125
|
+
* that owns a submenu is not a leaf: clicking it does nothing at all (hover or
|
|
126
|
+
* `openSubmenu()` is how it opens).
|
|
127
|
+
*/
|
|
128
|
+
click(): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Press Enter on the item — the keyboard equivalent of a click, and the route
|
|
131
|
+
* a spec should prefer, since it needs no hit test.
|
|
132
|
+
*
|
|
133
|
+
* Deliberately does NOT refuse a disabled item the way `click()` does: the
|
|
134
|
+
* component guards the keyboard path itself, so the key can be sent honestly
|
|
135
|
+
* and a spec can assert that nothing happened. On an item that owns a submenu
|
|
136
|
+
* this OPENS the submenu rather than activating the row, which is the APG
|
|
137
|
+
* behaviour — activating it would close the menu and leave the submenu
|
|
138
|
+
* unreachable from the keyboard.
|
|
139
|
+
*/
|
|
140
|
+
activateByKeyboard(): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Open this item's submenu with the right arrow and wait until it says so.
|
|
143
|
+
*
|
|
144
|
+
* The keyboard, not the pointer: it opens with no delay (hover waits out
|
|
145
|
+
* 120ms — `openSubmenuByHover()` covers that path) and needs no coordinates,
|
|
146
|
+
* which jsdom could not supply anyway. Sending the key focuses the item first,
|
|
147
|
+
* exactly as a roving cursor would have.
|
|
148
|
+
*/
|
|
149
|
+
openSubmenu(timeout?: number): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Open this item's submenu by resting the pointer on it, the gesture a mouse
|
|
152
|
+
* user actually makes, and wait out the hover delay.
|
|
153
|
+
*/
|
|
154
|
+
openSubmenuByHover(timeout?: number): Promise<void>;
|
|
155
|
+
/** Close this item's submenu with the left arrow. An item without one open is left alone. */
|
|
156
|
+
closeSubmenu(timeout?: number): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* The items in THIS item's submenu, in DOM order.
|
|
159
|
+
*
|
|
160
|
+
* Throws while the submenu is shut, and while the item owns none: both would
|
|
161
|
+
* otherwise answer with an empty array, which reads like a submenu that
|
|
162
|
+
* rendered nothing and fails somewhere else entirely.
|
|
163
|
+
*/
|
|
164
|
+
getSubmenuItems(filters?: WrContextMenuItemHarnessFilters): Promise<WrContextMenuItemHarness[]>;
|
|
165
|
+
/** The labels of the items in this item's submenu, in DOM order. */
|
|
166
|
+
getSubmenuItemTexts(): Promise<string[]>;
|
|
167
|
+
/**
|
|
168
|
+
* Open the submenu if it is shut, then click the first item in it matching the
|
|
169
|
+
* filters.
|
|
170
|
+
*
|
|
171
|
+
* Picking a leaf dismisses the whole chain — this item's submenu and the root
|
|
172
|
+
* menu with it.
|
|
173
|
+
*/
|
|
174
|
+
clickSubmenuItem(filters: WrContextMenuItemHarnessFilters): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* A loader scoped to THIS item's submenu pane.
|
|
177
|
+
*
|
|
178
|
+
* Scoped by the published id rather than by `.wr-context-menu`: every pane in
|
|
179
|
+
* the chain — the root menu and each open submenu — carries that class in one
|
|
180
|
+
* shared overlay container, so a class query would answer with whichever
|
|
181
|
+
* opened first.
|
|
182
|
+
*/
|
|
183
|
+
private submenuLoader;
|
|
184
|
+
/** The id this item publishes as `aria-controls`, which its open submenu carries. */
|
|
185
|
+
private submenuId;
|
|
186
|
+
/** Fail early, and by name, when the item is not a drill-down at all. */
|
|
187
|
+
private assertHasSubmenu;
|
|
188
|
+
/** Poll until `isSubmenuOpen()` reports `open`, and say whether it did. */
|
|
189
|
+
private settled;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @license
|
|
194
|
+
*
|
|
195
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
196
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
197
|
+
*/
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Test harness for `[wrContextMenu]` — the right-click target, and the menu it
|
|
201
|
+
* opens.
|
|
202
|
+
*
|
|
203
|
+
* The harness matches the TARGET, because that is the only part of a context
|
|
204
|
+
* menu in the fixture: `<wr-context-menu>` renders nothing of its own (it hands
|
|
205
|
+
* over an `<ng-template>` and hides its host), and the menu is portalled into the
|
|
206
|
+
* overlay container, a sibling of the whole app. So every item is read through
|
|
207
|
+
* the document root, scoped by the `aria-controls` id the target publishes while
|
|
208
|
+
* its menu is up — which is what keeps two menus on one page from answering with
|
|
209
|
+
* each other's items, and what keeps a re-opened menu from answering with the one
|
|
210
|
+
* still playing its exit animation.
|
|
211
|
+
*
|
|
212
|
+
* That scoped loader is also this harness's CONTENT loader, so
|
|
213
|
+
* `menu.getHarness(…)` resolves inside THIS menu: a component the consumer
|
|
214
|
+
* projected into the menu is reachable without the spec ever touching the
|
|
215
|
+
* overlay.
|
|
216
|
+
*
|
|
217
|
+
* **How it differs from `WrDropdownHarness`, its closest sibling.**
|
|
218
|
+
*
|
|
219
|
+
* - The gesture is a real `contextmenu` event, not a click — `open()` sends one,
|
|
220
|
+
* and `openByLongPress()` covers the touch path. There is no toggle: a second
|
|
221
|
+
* right-click re-opens the menu at the new pointer position.
|
|
222
|
+
* - Activating an item DISMISSES the menu (a dropdown's stays up), so
|
|
223
|
+
* `clickItem()` leaves it closed.
|
|
224
|
+
* - Submenus are a first-class input here rather than a nested trigger, so they
|
|
225
|
+
* are driven from {@link WrContextMenuItemHarness}.
|
|
226
|
+
* - The menu never takes focus: nothing focuses the first item and there is no
|
|
227
|
+
* arrow-key cursor between items, so there is no `getFocusedItemText()` to ask
|
|
228
|
+
* — see `WrContextMenuItemHarness.isFocused()`.
|
|
229
|
+
*
|
|
230
|
+
* **Timing.** The waits are real: a 500ms `setTimeout` for the long-press hold and
|
|
231
|
+
* another 220ms one for the exit animation the pane is held alive through, plus the
|
|
232
|
+
* outside-press window above — that one is a `performance.now()` comparison against
|
|
233
|
+
* the moment the menu opened rather than a timer, so only wall-clock time gets past
|
|
234
|
+
* it. The methods that must sit out real time say so; a spec on fake timers should
|
|
235
|
+
* drive the clock itself and read `isOpen()`.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```ts
|
|
239
|
+
* const menu = await loader.getHarness(WrContextMenuHarness.with({ text: 'Right-click me' }));
|
|
240
|
+
*
|
|
241
|
+
* await menu.open();
|
|
242
|
+
* expect(await menu.getItemTexts()).toEqual(['Cut', 'Copy', 'More']);
|
|
243
|
+
*
|
|
244
|
+
* await menu.clickItem({ text: 'Cut' });
|
|
245
|
+
* expect(await menu.isOpen()).toBe(false);
|
|
246
|
+
* ```
|
|
247
|
+
*
|
|
248
|
+
* @see https://ngwr.dev/guides/testing
|
|
249
|
+
*/
|
|
250
|
+
declare class WrContextMenuHarness extends ContentContainerComponentHarness {
|
|
251
|
+
/** The directive's host — whatever element the consumer put `[wrContextMenu]` on. */
|
|
252
|
+
static hostSelector: string;
|
|
253
|
+
/** Build a predicate that narrows the query. */
|
|
254
|
+
static with(options?: WrContextMenuHarnessFilters): HarnessPredicate<WrContextMenuHarness>;
|
|
255
|
+
/** The target's own visible text — the content that gets right-clicked. */
|
|
256
|
+
getTargetText(): Promise<string>;
|
|
257
|
+
/**
|
|
258
|
+
* Whether this target's menu is showing.
|
|
259
|
+
*
|
|
260
|
+
* Read from the target rather than from the overlay, and that is the whole
|
|
261
|
+
* point: a closed menu's pane stays in the DOM for its exit animation, while
|
|
262
|
+
* the reference is dropped the instant the close begins. Asking the DOM
|
|
263
|
+
* "is a menu present" would answer `true` for a quarter of a second after every
|
|
264
|
+
* dismissal.
|
|
265
|
+
*
|
|
266
|
+
* So the answer is only as good as the directive's claim on `aria-controls`:
|
|
267
|
+
* put `[wrContextMenu]` on an element that publishes one of its own and the two
|
|
268
|
+
* fight over a single attribute.
|
|
269
|
+
*/
|
|
270
|
+
isOpen(): Promise<boolean>;
|
|
271
|
+
/** The role the menu announces — `menu`. Throws while no menu is open. */
|
|
272
|
+
getMenuRole(): Promise<string | null>;
|
|
273
|
+
/**
|
|
274
|
+
* Everything the open menu renders as text, runs of whitespace collapsed.
|
|
275
|
+
*
|
|
276
|
+
* Wider than `getItemTexts()` on purpose: `<wr-context-menu>` projects whatever
|
|
277
|
+
* it is given, so a section heading or any other markup a consumer put between
|
|
278
|
+
* the items shows up here and in no item harness. Dividers contribute nothing —
|
|
279
|
+
* they render no text.
|
|
280
|
+
*
|
|
281
|
+
* Expect to match a FRAGMENT of this rather than the whole of it: Angular
|
|
282
|
+
* strips the whitespace between elements at compile time, so the labels run
|
|
283
|
+
* together (`'Pick oneAppleBanana'`). The collapsing here only tidies newlines
|
|
284
|
+
* inside a single block of projected text.
|
|
285
|
+
*/
|
|
286
|
+
getMenuText(): Promise<string>;
|
|
287
|
+
/**
|
|
288
|
+
* Open the menu by right-clicking the target, the gesture the directive
|
|
289
|
+
* actually listens for (`contextmenu`, which is also what Shift+F10 sends).
|
|
290
|
+
*
|
|
291
|
+
* An already-open menu is left alone — `rightClick()` is the raw gesture if
|
|
292
|
+
* what you want is the re-open.
|
|
293
|
+
*
|
|
294
|
+
* Note for a spec with two targets: a `contextmenu` event anywhere is an
|
|
295
|
+
* outside pointer event for every OTHER open menu, so this dismisses them on
|
|
296
|
+
* the way in. `openByLongPress()` is the route that does not.
|
|
297
|
+
*/
|
|
298
|
+
open(): Promise<void>;
|
|
299
|
+
/**
|
|
300
|
+
* Send a `contextmenu` to the target whatever state the menu is in.
|
|
301
|
+
*
|
|
302
|
+
* On an open menu this re-opens it at the new pointer position — the previous
|
|
303
|
+
* pane is dismissed and a fresh one takes its place, which is why the harness
|
|
304
|
+
* scopes by a per-open id rather than by class: for the length of the exit
|
|
305
|
+
* animation both are in the container, the dying one first.
|
|
306
|
+
*
|
|
307
|
+
* The coordinates the CDK requires are all zeros, and meaningless: jsdom has no
|
|
308
|
+
* layout. Nothing here needs them — the event is dispatched on the element
|
|
309
|
+
* itself, no hit test involved.
|
|
310
|
+
*/
|
|
311
|
+
rightClick(): Promise<void>;
|
|
312
|
+
/**
|
|
313
|
+
* Open the menu with a touch long-press — hold a non-mouse pointer on the
|
|
314
|
+
* target for 500ms — and wait until it is up.
|
|
315
|
+
*
|
|
316
|
+
* Worth its own method rather than an argument to `open()`, for the reason the
|
|
317
|
+
* dropdown has `openByKeyboard()`: it is the only way to get TWO context menus
|
|
318
|
+
* open at once. The press emits no `click` / `auxclick` / `contextmenu`, so it
|
|
319
|
+
* is not an outside press for anyone else's menu, while a right-click is.
|
|
320
|
+
*
|
|
321
|
+
* The pointer fields the directive reads are assigned onto a synthetic event:
|
|
322
|
+
* what matters is a primary pointer that is not a mouse. Movement beyond 10px,
|
|
323
|
+
* a scroll, or an early lift cancels the hold in the component — none of which
|
|
324
|
+
* this does.
|
|
325
|
+
*/
|
|
326
|
+
openByLongPress(timeout?: number): Promise<void>;
|
|
327
|
+
/**
|
|
328
|
+
* Dismiss the menu with Escape and wait until its pane has left the DOM.
|
|
329
|
+
*
|
|
330
|
+
* Escape is delivered by the CDK's keyboard dispatcher to the TOP-MOST overlay,
|
|
331
|
+
* so with a later menu (or any other overlay) open on top, this one keeps
|
|
332
|
+
* waiting its turn — that is what the throw below is about. The wait covers the
|
|
333
|
+
* 220ms exit animation, so a spec can assert afterwards that nothing lingers.
|
|
334
|
+
*/
|
|
335
|
+
close(timeout?: number): Promise<void>;
|
|
336
|
+
/**
|
|
337
|
+
* Dismiss the menu by pressing outside it, the way a user gets rid of one, and
|
|
338
|
+
* wait until its pane has left the DOM.
|
|
339
|
+
*
|
|
340
|
+
* Sits out real time first: the directive ignores outside events for 200ms after
|
|
341
|
+
* opening, so the right-click that opened the menu cannot immediately close it
|
|
342
|
+
* again with its own trailing `auxclick`. The press then lands on the TARGET,
|
|
343
|
+
* which is outside the pane and therefore counts — the page background is not
|
|
344
|
+
* something a harness has a handle on. A target that carries a `(click)` of its
|
|
345
|
+
* own will see it fire, so assert on the dismissal rather than on that handler.
|
|
346
|
+
*/
|
|
347
|
+
closeByOutsidePress(timeout?: number): Promise<void>;
|
|
348
|
+
/**
|
|
349
|
+
* The items in this menu, in DOM order.
|
|
350
|
+
*
|
|
351
|
+
* Only this menu's own: an open submenu is a separate pane, so its items are
|
|
352
|
+
* `WrContextMenuItemHarness.getSubmenuItems()`, not part of this list. Dividers
|
|
353
|
+
* are not items either.
|
|
354
|
+
*
|
|
355
|
+
* Throws while the menu is shut — the items do not exist anywhere until the
|
|
356
|
+
* portal is attached, and an empty array reads like a menu that rendered
|
|
357
|
+
* nothing.
|
|
358
|
+
*/
|
|
359
|
+
getItems(filters?: WrContextMenuItemHarnessFilters): Promise<WrContextMenuItemHarness[]>;
|
|
360
|
+
/** The labels of this menu's items, in DOM order. */
|
|
361
|
+
getItemTexts(): Promise<string[]>;
|
|
362
|
+
/**
|
|
363
|
+
* How many separators this menu shows.
|
|
364
|
+
*
|
|
365
|
+
* Counted by `role="separator"` rather than by `.wr-context-menu-divider`, so a
|
|
366
|
+
* separator the consumer wrote themselves counts too — the role is what tells a
|
|
367
|
+
* screen reader where one group of items ends. A separator is never a member of
|
|
368
|
+
* `getItems()`.
|
|
369
|
+
*/
|
|
370
|
+
getDividerCount(): Promise<number>;
|
|
371
|
+
/**
|
|
372
|
+
* Open the menu if it is shut, then click the first item matching the filters.
|
|
373
|
+
*
|
|
374
|
+
* Picking a leaf DISMISSES the menu — unlike a dropdown, which stays up. The
|
|
375
|
+
* dismissal is reported at once (the target drops its reference synchronously),
|
|
376
|
+
* while the pane plays its exit animation for another 220ms.
|
|
377
|
+
*/
|
|
378
|
+
clickItem(filters: WrContextMenuItemHarnessFilters): Promise<void>;
|
|
379
|
+
/**
|
|
380
|
+
* A loader scoped to THIS target's menu — the content loader every
|
|
381
|
+
* `HarnessLoader` method on this class runs through, `getItems()` included.
|
|
382
|
+
*
|
|
383
|
+
* Scoped by the published id rather than by `.wr-context-menu`: the overlay
|
|
384
|
+
* container is shared by every pane on the page, so a bare class query would
|
|
385
|
+
* answer with whichever menu opened first.
|
|
386
|
+
*/
|
|
387
|
+
protected getRootHarnessLoader(): Promise<HarnessLoader>;
|
|
388
|
+
/** This target's menu element in the overlay. */
|
|
389
|
+
private menu;
|
|
390
|
+
/** Every element inside THIS menu matching the selector. */
|
|
391
|
+
private inMenuAll;
|
|
392
|
+
/** The id the target publishes as `aria-controls`, which its open menu carries. */
|
|
393
|
+
private menuId;
|
|
394
|
+
/** Poll until the pane with this id has been disposed. */
|
|
395
|
+
private waitUntilGone;
|
|
396
|
+
/** Poll until `isOpen()` reports `open`, and say whether it did. */
|
|
397
|
+
private settled;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export { WrContextMenuHarness, WrContextMenuItemHarness };
|
|
401
|
+
export type { WrContextMenuHarnessFilters, WrContextMenuItemHarnessFilters };
|