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
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import { ContentContainerComponentHarness, HarnessPredicate, ComponentHarness, 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 one tab of a `<wr-tabs>` strip — the header, and the panel it
|
|
11
|
+
* controls.
|
|
12
|
+
*
|
|
13
|
+
* Its host is the RENDERED HEADER, not the `<wr-tab>` element. A `<wr-tab>` is
|
|
14
|
+
* `display:none` and holds nothing but a `<ng-template>`: the label, the selection
|
|
15
|
+
* state, the tab stop and the click target all live on the element the parent
|
|
16
|
+
* renders for it, which is a `<button role="tab">` in content mode and an
|
|
17
|
+
* `<a role="tab">` in router mode. A harness hosted on `wr-tab` would answer every
|
|
18
|
+
* question with nothing.
|
|
19
|
+
*
|
|
20
|
+
* Also a CONTENT CONTAINER, scoped to the panel this tab controls, so
|
|
21
|
+
* `tab.getHarness(WrButtonHarness…)` reaches the consumer's own components inside
|
|
22
|
+
* the tab's content. The panel is not a descendant of the header — it is a sibling
|
|
23
|
+
* of the whole strip — so it is resolved through the `aria-controls` id, which is
|
|
24
|
+
* also the pairing {@link isPanelBound} checks. Only the SELECTED tab has a panel
|
|
25
|
+
* to reach: `<wr-tabs>` renders one panel and destroys it on every switch.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const tabs = await loader.getHarness(WrTabsHarness);
|
|
30
|
+
* const [first] = await tabs.getTabs();
|
|
31
|
+
*
|
|
32
|
+
* expect(await first.isSelected()).toBe(true);
|
|
33
|
+
* expect(await first.isPanelBound()).toBe(true);
|
|
34
|
+
* await (await first.getHarness(WrButtonHarness.with({ text: 'Save' }))).click();
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @see https://ngwr.dev/guides/testing
|
|
38
|
+
*/
|
|
39
|
+
class WrTabHarness extends ContentContainerComponentHarness {
|
|
40
|
+
/** The header the strip renders for a `<wr-tab>` — a `<button>`, or an `<a>` in router mode. */
|
|
41
|
+
static hostSelector = '.wr-tabs__tab';
|
|
42
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
43
|
+
static with(options = {}) {
|
|
44
|
+
return new HarnessPredicate(WrTabHarness, options)
|
|
45
|
+
.addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))
|
|
46
|
+
.addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)
|
|
47
|
+
.addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);
|
|
48
|
+
}
|
|
49
|
+
/** The tab's visible label, trimmed — the `<wr-tab>`'s `title`. */
|
|
50
|
+
async getLabel() {
|
|
51
|
+
return (await this.host()).text();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The header's own id, which is what the panel points back at with
|
|
55
|
+
* `aria-labelledby` — the tab is the panel's accessible name.
|
|
56
|
+
*
|
|
57
|
+
* Generated from the tab's `key`, so two strips on one page whose tabs share keys
|
|
58
|
+
* publish the same ids and each panel then names whichever header came first.
|
|
59
|
+
*/
|
|
60
|
+
async getId() {
|
|
61
|
+
return (await this.host()).getAttribute('id');
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Whether this is the strip's selected tab.
|
|
65
|
+
*
|
|
66
|
+
* `aria-selected` first, because that is the state a screen reader acts on and
|
|
67
|
+
* the `--active` class is only what it looks like. A ROUTER tab carries no
|
|
68
|
+
* `aria-selected` at all — the router paints the class through
|
|
69
|
+
* `routerLinkActive` and nothing announces the selection — so the class is the
|
|
70
|
+
* fallback rather than the first choice, and the two branches are not
|
|
71
|
+
* interchangeable: reading the class first would report a content tab as selected
|
|
72
|
+
* while `aria-selected="false"` told assistive tech otherwise.
|
|
73
|
+
*/
|
|
74
|
+
async isSelected() {
|
|
75
|
+
const host = await this.host();
|
|
76
|
+
const selected = await host.getAttribute('aria-selected');
|
|
77
|
+
if (selected !== null)
|
|
78
|
+
return selected === 'true';
|
|
79
|
+
return host.hasClass('wr-tabs__tab--active');
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether the tab refuses activation.
|
|
83
|
+
*
|
|
84
|
+
* The two shapes say it differently and both are read: a content tab is a real
|
|
85
|
+
* `<button>` and carries the native `disabled`, a router tab is an `<a>` — which
|
|
86
|
+
* cannot be disabled natively — and carries `aria-disabled` with `tabindex="-1"`.
|
|
87
|
+
* The `--disabled` class is on both and is deliberately not the source: a class
|
|
88
|
+
* says how the tab looks, these two say what it refuses.
|
|
89
|
+
*/
|
|
90
|
+
async isDisabled() {
|
|
91
|
+
const host = await this.host();
|
|
92
|
+
if ((await host.getAttribute('aria-disabled')) === 'true')
|
|
93
|
+
return true;
|
|
94
|
+
return (await host.getProperty('disabled')) === true;
|
|
95
|
+
}
|
|
96
|
+
/** Whether this tab is a link — the router shape, where selection follows the route. */
|
|
97
|
+
async isLink() {
|
|
98
|
+
return (await this.host()).matchesSelector('a');
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The resolved href of a router tab, or `null` for a content tab.
|
|
102
|
+
*
|
|
103
|
+
* `null` is the answer for a `<button>` rather than a gap — a content tab
|
|
104
|
+
* navigates nowhere, it swaps a panel.
|
|
105
|
+
*/
|
|
106
|
+
async getHref() {
|
|
107
|
+
return (await this.host()).getAttribute('href');
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Whether a Tab press can land on this header.
|
|
111
|
+
*
|
|
112
|
+
* A content strip is ONE tab stop and hands it to the selected tab; a router
|
|
113
|
+
* strip makes every enabled tab a stop of its own. See
|
|
114
|
+
* `WrTabsHarness.getTabStopLabels()` — the difference is a mode difference, not
|
|
115
|
+
* a rounding error.
|
|
116
|
+
*
|
|
117
|
+
* A non-negative `tabindex` is not enough on its own, which is why `disabled` is
|
|
118
|
+
* read too: `<wr-tabs>` gives the roving `tabindex="0"` to whatever `active`
|
|
119
|
+
* names without checking whether that tab is disabled, so a host binding `active`
|
|
120
|
+
* to a disabled tab's key renders a `<button disabled tabindex="0">` — which no
|
|
121
|
+
* Tab press reaches. jsdom will focus such a button anyway, so this is the only
|
|
122
|
+
* place a unit test can tell the difference.
|
|
123
|
+
*/
|
|
124
|
+
async isTabStop() {
|
|
125
|
+
if (await this.isDisabled())
|
|
126
|
+
return false;
|
|
127
|
+
const tabIndex = await (await this.host()).getAttribute('tabindex');
|
|
128
|
+
return Number.parseInt(tabIndex ?? '-1', 10) >= 0;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The id of the panel this tab controls, or `null` when it controls none.
|
|
132
|
+
*
|
|
133
|
+
* `null` for a router tab — the strip renders no panel in that mode, the consumer
|
|
134
|
+
* drops a `<router-outlet>` after it — and that missing `aria-controls` is the
|
|
135
|
+
* honest report: there is nothing for the header to point at.
|
|
136
|
+
*/
|
|
137
|
+
async getPanelId() {
|
|
138
|
+
return (await this.host()).getAttribute('aria-controls');
|
|
139
|
+
}
|
|
140
|
+
/** Whether this tab's panel is in the DOM right now — true only for the selected tab. */
|
|
141
|
+
async hasPanel() {
|
|
142
|
+
return (await this.panelOrNull()) !== null;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Whether the panel and this header really name each other.
|
|
146
|
+
*
|
|
147
|
+
* Both halves, because each covers a different failure: the header's
|
|
148
|
+
* `aria-controls` has to reach the panel that is showing, and the panel's
|
|
149
|
+
* `aria-labelledby` has to come back to THIS header. A panel wired to the wrong
|
|
150
|
+
* tab looks perfect on screen — the right content is under the right header — and
|
|
151
|
+
* announces the wrong name, which is the whole of a tabbed interface for anyone
|
|
152
|
+
* not looking at it. It also has to be a `tabpanel`: the reference resolving to
|
|
153
|
+
* some other element is a broken pairing, not a styling detail.
|
|
154
|
+
*
|
|
155
|
+
* Throws when there is no panel at all, which is a different fact from a broken
|
|
156
|
+
* pairing — see {@link getPanelText}.
|
|
157
|
+
*/
|
|
158
|
+
async isPanelBound() {
|
|
159
|
+
const panel = await this.panelOrThrow('isPanelBound');
|
|
160
|
+
if ((await panel.getAttribute('role')) !== 'tabpanel')
|
|
161
|
+
return false;
|
|
162
|
+
return (await panel.getAttribute('aria-labelledby')) === (await this.getId());
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The text of this tab's panel, trimmed.
|
|
166
|
+
*
|
|
167
|
+
* Throws rather than answering `''` for a tab whose panel is not rendered, and
|
|
168
|
+
* the message says which of the two reasons it is: `<wr-tabs>` keeps only the
|
|
169
|
+
* selected tab's panel in the DOM (the content of every other tab sits in an
|
|
170
|
+
* unrendered `<ng-template>`, so switching tabs destroys a panel and builds the
|
|
171
|
+
* next one), and a router strip renders no panel at all.
|
|
172
|
+
*/
|
|
173
|
+
async getPanelText() {
|
|
174
|
+
return (await this.panelOrThrow('getPanelText')).text();
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Activate this tab the way a pointer does.
|
|
178
|
+
*
|
|
179
|
+
* A disabled CONTENT tab is left alone: it is a real `<button disabled>`, which
|
|
180
|
+
* fires no click at all. A disabled ROUTER tab is NOT — the anchor carries
|
|
181
|
+
* `aria-disabled="true"` and `tabindex="-1"`, and nothing cancels its
|
|
182
|
+
* `routerLink`, so a click on it still navigates. That is a gap in the component
|
|
183
|
+
* rather than in this harness, and it is why a router strip's expectations belong
|
|
184
|
+
* on the resolved route rather than on the click.
|
|
185
|
+
*/
|
|
186
|
+
async click() {
|
|
187
|
+
return (await this.host()).click();
|
|
188
|
+
}
|
|
189
|
+
/** Move keyboard focus onto this header. */
|
|
190
|
+
async focus() {
|
|
191
|
+
return (await this.host()).focus();
|
|
192
|
+
}
|
|
193
|
+
/** Take focus off this header. */
|
|
194
|
+
async blur() {
|
|
195
|
+
return (await this.host()).blur();
|
|
196
|
+
}
|
|
197
|
+
/** Whether this header holds keyboard focus — the roving cursor, not the selection. */
|
|
198
|
+
async isFocused() {
|
|
199
|
+
return (await this.host()).isFocused();
|
|
200
|
+
}
|
|
201
|
+
/** `getHarness(…)` searches this tab's PANEL, which is where its content is. */
|
|
202
|
+
async getRootHarnessLoader() {
|
|
203
|
+
// Both checks, in this order, so the failure names the reason — no panel in this
|
|
204
|
+
// mode, or a panel that is not the one showing — instead of the CDK's generic
|
|
205
|
+
// "no element matching selector".
|
|
206
|
+
const id = await this.panelIdOrThrow('getHarness');
|
|
207
|
+
await this.panelOrThrow('getHarness');
|
|
208
|
+
return this.documentRootLocatorFactory().harnessLoaderFor(WrTabHarness.byId(id));
|
|
209
|
+
}
|
|
210
|
+
/** The panel element, or `null` when this tab has none rendered. */
|
|
211
|
+
async panelOrNull() {
|
|
212
|
+
const id = await this.getPanelId();
|
|
213
|
+
if (id === null)
|
|
214
|
+
return null;
|
|
215
|
+
// From the document root: the panel is a sibling of the strip, not a descendant
|
|
216
|
+
// of the header this harness is hosted on.
|
|
217
|
+
return this.documentRootLocatorFactory().locatorForOptional(WrTabHarness.byId(id))();
|
|
218
|
+
}
|
|
219
|
+
/** The panel element, or a failure naming which of the two reasons there isn't one. */
|
|
220
|
+
async panelOrThrow(method) {
|
|
221
|
+
await this.panelIdOrThrow(method);
|
|
222
|
+
const panel = await this.panelOrNull();
|
|
223
|
+
if (!panel) {
|
|
224
|
+
throw new Error(`WrTabHarness.${method}(): the panel for "${await this.getLabel()}" is not rendered. <wr-tabs> keeps ` +
|
|
225
|
+
'only the SELECTED panel in the DOM — the content of every other tab waits in an unrendered ' +
|
|
226
|
+
'<ng-template> — so select the tab first.');
|
|
227
|
+
}
|
|
228
|
+
return panel;
|
|
229
|
+
}
|
|
230
|
+
/** This tab's `aria-controls`, or a failure saying a router strip has no panels. */
|
|
231
|
+
async panelIdOrThrow(method) {
|
|
232
|
+
const id = await this.getPanelId();
|
|
233
|
+
if (id === null) {
|
|
234
|
+
throw new Error(`WrTabHarness.${method}(): "${await this.getLabel()}" controls no panel. A router strip renders none ` +
|
|
235
|
+
'— its tabs navigate and the consumer drops a <router-outlet> after the strip — so assert the ' +
|
|
236
|
+
'routed content instead.');
|
|
237
|
+
}
|
|
238
|
+
return id;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* An id selector that survives the id it is given.
|
|
242
|
+
*
|
|
243
|
+
* `[id="…"]` rather than `#…`: the ids here are built from the consumer's `key`,
|
|
244
|
+
* and a key holding a dot, a colon or a leading digit turns `#id` into a selector
|
|
245
|
+
* that either throws or matches something else entirely.
|
|
246
|
+
*/
|
|
247
|
+
static byId(id) {
|
|
248
|
+
return `[id="${id}"]`;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @license
|
|
254
|
+
*
|
|
255
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
256
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
257
|
+
*/
|
|
258
|
+
/**
|
|
259
|
+
* Test harness for `<wr-tabs>`, with {@link WrTabHarness} for one tab and the panel
|
|
260
|
+
* it controls.
|
|
261
|
+
*
|
|
262
|
+
* The component has two modes and they answer "which tab is active" differently,
|
|
263
|
+
* which is most of what this harness exists to keep straight:
|
|
264
|
+
*
|
|
265
|
+
* - **Content** — the tabs are `<button role="tab">`s, the strip is ONE tab stop
|
|
266
|
+
* (the roving `tabindex` sits on the selected tab), and the arrow keys ACTIVATE
|
|
267
|
+
* the tab they move to, the APG's automatic-activation pattern. `<wr-tabs>`
|
|
268
|
+
* renders exactly one panel: the selected tab's.
|
|
269
|
+
* - **Router** — one `routerLink` on any child switches the whole strip over. The
|
|
270
|
+
* tabs become `<a role="tab">`s, they announce no `aria-selected` at all (the
|
|
271
|
+
* router paints `--active` and nothing else), the strip renders NO panel, and it
|
|
272
|
+
* stops being one tab stop — every enabled tab is a Tab stop of its own. The
|
|
273
|
+
* arrow keys still move focus, but they select nothing: the route does that.
|
|
274
|
+
*
|
|
275
|
+
* So {@link getSelectedLabel} and {@link getFocusedLabel} are two different
|
|
276
|
+
* questions, and {@link getTabStopLabels} is a third. They coincide in content mode
|
|
277
|
+
* and come apart in router mode; a spec that asserts one and means another passes
|
|
278
|
+
* through the bug.
|
|
279
|
+
*
|
|
280
|
+
* Everything here is driven from the KEYBOARD rather than by clicking a coordinate:
|
|
281
|
+
* a unit test has no layout, so a hit test would answer with nothing, and the
|
|
282
|
+
* keyboard is the accessible path anyway. {@link select} is the exception — a
|
|
283
|
+
* no-arg click needs no coordinate.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* const tabs = await loader.getHarness(WrTabsHarness);
|
|
288
|
+
*
|
|
289
|
+
* expect(await tabs.getTabLabels()).toEqual(['One', 'Two', 'Three']);
|
|
290
|
+
* await tabs.select({ label: 'Two' });
|
|
291
|
+
* expect(await tabs.getPanelText()).toContain('Second panel');
|
|
292
|
+
* ```
|
|
293
|
+
*
|
|
294
|
+
* @see https://ngwr.dev/reference/components/tabs
|
|
295
|
+
* @see https://ngwr.dev/guides/testing
|
|
296
|
+
*/
|
|
297
|
+
class WrTabsHarness extends ComponentHarness {
|
|
298
|
+
static hostSelector = 'wr-tabs';
|
|
299
|
+
/** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
|
|
300
|
+
static with(options = {}) {
|
|
301
|
+
return new HarnessPredicate(WrTabsHarness, options)
|
|
302
|
+
.addOption('tabLabel', options.tabLabel, async (harness, label) => {
|
|
303
|
+
for (const tab of await harness.getTabLabels()) {
|
|
304
|
+
if (await HarnessPredicate.stringMatches(tab, label))
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
return false;
|
|
308
|
+
})
|
|
309
|
+
.addOption('selectedLabel', options.selectedLabel, async (harness, label) => {
|
|
310
|
+
const selected = await harness.getSelectedLabel();
|
|
311
|
+
return selected === null ? false : HarnessPredicate.stringMatches(selected, label);
|
|
312
|
+
})
|
|
313
|
+
.addOption('size', options.size, async (harness, size) => (await harness.getSize()) === size)
|
|
314
|
+
.addOption('router', options.router, async (harness, router) => (await harness.isRouterMode()) === router);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* The role the strip announces — `tablist`.
|
|
318
|
+
*
|
|
319
|
+
* Read off the strip, not the host: `<wr-tabs>` carries the `wr-tabs` class and no
|
|
320
|
+
* role of its own, and the `tablist` is the scrolling `.wr-tabs__strip` inside it.
|
|
321
|
+
* Without that role the headers are a row of buttons: nothing tells a screen
|
|
322
|
+
* reader how many tabs there are or which one of them is showing.
|
|
323
|
+
*/
|
|
324
|
+
async getRole() {
|
|
325
|
+
return (await this.strip()).getAttribute('role');
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* The axis the strip announces, which decides which arrow keys a screen-reader
|
|
329
|
+
* user is told to press.
|
|
330
|
+
*
|
|
331
|
+
* `<wr-tabs>` ships one orientation — the strip is a horizontal scroller and hard
|
|
332
|
+
* codes `aria-orientation="horizontal"` — so today this always answers
|
|
333
|
+
* `'horizontal'`. It is read from the DOM and normalized the way ARIA reads it:
|
|
334
|
+
* anything that is not `vertical`, a missing attribute included, is `'horizontal'`,
|
|
335
|
+
* the default for a `tablist`.
|
|
336
|
+
*
|
|
337
|
+
* Which means an assertion here catches a strip that starts ANNOUNCING `vertical`
|
|
338
|
+
* while its arrow keys still walk the horizontal axis — and cannot catch the
|
|
339
|
+
* mirror image, a vertical mode that forgets to update the attribute: that one
|
|
340
|
+
* answers `'horizontal'` and looks unchanged. One attribute is all this reads.
|
|
341
|
+
*/
|
|
342
|
+
async getOrientation() {
|
|
343
|
+
return (await (await this.strip()).getAttribute('aria-orientation')) === 'vertical' ? 'vertical' : 'horizontal';
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* The size the strip renders at, from the host modifier.
|
|
347
|
+
*
|
|
348
|
+
* `md` is the default and paints no modifier of its own, so its absence is the
|
|
349
|
+
* answer rather than a missing one.
|
|
350
|
+
*/
|
|
351
|
+
async getSize() {
|
|
352
|
+
const host = await this.host();
|
|
353
|
+
if (await host.hasClass('wr-tabs--sm'))
|
|
354
|
+
return 'sm';
|
|
355
|
+
if (await host.hasClass('wr-tabs--lg'))
|
|
356
|
+
return 'lg';
|
|
357
|
+
return 'md';
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Whether this strip navigates instead of swapping panels.
|
|
361
|
+
*
|
|
362
|
+
* Derived from what got RENDERED — a router tab is an `<a>` — rather than from the
|
|
363
|
+
* `routerLink` inputs, because the switch is all-or-nothing: one `routerLink`
|
|
364
|
+
* anywhere in the strip turns every tab into a link and drops the panel. A strip
|
|
365
|
+
* with no tabs at all is content mode, which is what the component does with it.
|
|
366
|
+
*/
|
|
367
|
+
async isRouterMode() {
|
|
368
|
+
const tabs = await this.getTabs();
|
|
369
|
+
for (const tab of tabs) {
|
|
370
|
+
if (await tab.isLink())
|
|
371
|
+
return true;
|
|
372
|
+
}
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* This strip's tabs, in render order.
|
|
377
|
+
*
|
|
378
|
+
* Scoped to this strip rather than to the host, which is what keeps a `<wr-tabs>`
|
|
379
|
+
* NESTED in a panel from answering for its parent: the inner strip is a descendant
|
|
380
|
+
* of the outer host, so a host-wide query would hand back both sets of tabs as one
|
|
381
|
+
* flat list.
|
|
382
|
+
*/
|
|
383
|
+
async getTabs(filters = {}) {
|
|
384
|
+
return (await this.stripLoader()).getAllHarnesses(WrTabHarness.with(filters));
|
|
385
|
+
}
|
|
386
|
+
/** The label of every tab, in render order. */
|
|
387
|
+
async getTabLabels() {
|
|
388
|
+
const tabs = await this.getTabs();
|
|
389
|
+
return Promise.all(tabs.map(tab => tab.getLabel()));
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* The selected tab, or `null` when none is.
|
|
393
|
+
*
|
|
394
|
+
* A content strip always has one — it falls back to the first tab when `active`
|
|
395
|
+
* matches nothing — so `null` means a router strip whose current route matches no
|
|
396
|
+
* tab, or a strip with no tabs.
|
|
397
|
+
*/
|
|
398
|
+
async getSelectedTab() {
|
|
399
|
+
const [selected] = await this.getTabs({ selected: true });
|
|
400
|
+
return selected ?? null;
|
|
401
|
+
}
|
|
402
|
+
/** The label of the selected tab, or `null` when none is selected. */
|
|
403
|
+
async getSelectedLabel() {
|
|
404
|
+
const selected = await this.getSelectedTab();
|
|
405
|
+
return selected ? selected.getLabel() : null;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Select the first tab matching the filters, the way a pointer does.
|
|
409
|
+
*
|
|
410
|
+
* Throws when nothing matches, naming the tabs that do exist, and throws again
|
|
411
|
+
* when the tab is still unselected afterwards — with both causes named, because a
|
|
412
|
+
* click that quietly did nothing surfaces as an unrelated assertion three lines
|
|
413
|
+
* later. Those causes are a disabled CONTENT tab (a `<button disabled>` never sees
|
|
414
|
+
* the click at all) and a router strip whose navigation did not land on this tab.
|
|
415
|
+
*
|
|
416
|
+
* A router strip is otherwise fine here: the click starts a route change, the
|
|
417
|
+
* harness stabilizes the pending navigation before it re-reads the strip, and
|
|
418
|
+
* `routerLinkActive` has painted the selection by then — so this resolves. It is a
|
|
419
|
+
* guard, a redirect or an unmatched path that leaves the tab unselected. Note that
|
|
420
|
+
* `disabled` does not stop a router tab at all; see {@link WrTabHarness.click}.
|
|
421
|
+
*/
|
|
422
|
+
async select(filters) {
|
|
423
|
+
const [tab] = await this.getTabs(filters);
|
|
424
|
+
if (!tab) {
|
|
425
|
+
const labels = await this.getTabLabels();
|
|
426
|
+
const offered = labels.length > 0 ? `This strip offers: ${labels.join(', ')}.` : 'This strip renders no tabs at all.';
|
|
427
|
+
throw new Error(`WrTabsHarness.select(): no tab matched ${JSON.stringify(filters)}. ${offered}`);
|
|
428
|
+
}
|
|
429
|
+
await this.activate(tab, 'select');
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Select the tab at this position in render order, counting from 0.
|
|
433
|
+
*
|
|
434
|
+
* Throws on an index the strip does not have, naming its length: a silent no-op
|
|
435
|
+
* there reads as "the tab did not react" when the tab was never addressed.
|
|
436
|
+
*/
|
|
437
|
+
async selectByIndex(index) {
|
|
438
|
+
const tabs = await this.getTabs();
|
|
439
|
+
const tab = tabs[index];
|
|
440
|
+
if (!tab) {
|
|
441
|
+
throw new Error(`WrTabsHarness.selectByIndex(): this strip has ${tabs.length} tab(s), so index ${index} is out of ` +
|
|
442
|
+
'range — they are numbered from 0 in render order.');
|
|
443
|
+
}
|
|
444
|
+
await this.activate(tab, 'selectByIndex');
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* The labels of every tab a Tab press can land on, in render order.
|
|
448
|
+
*
|
|
449
|
+
* A LIST rather than one label, because the count is the mode: a content strip
|
|
450
|
+
* roves a single `tabindex="0"` and answers with exactly one label — the selected
|
|
451
|
+
* tab — while a router strip makes every enabled tab its own stop and answers with
|
|
452
|
+
* all of them. Either way a disabled tab is never in here.
|
|
453
|
+
*/
|
|
454
|
+
async getTabStopLabels() {
|
|
455
|
+
const labels = [];
|
|
456
|
+
for (const tab of await this.getTabs()) {
|
|
457
|
+
if (await tab.isTabStop())
|
|
458
|
+
labels.push(await tab.getLabel());
|
|
459
|
+
}
|
|
460
|
+
return labels;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Whether the strip is a single tab stop — the roving-`tabindex` pattern the APG
|
|
464
|
+
* asks a `tablist` for.
|
|
465
|
+
*
|
|
466
|
+
* True for a content strip, false for a router one, which puts every enabled tab
|
|
467
|
+
* in the page tab order. A strip whose every tab is disabled has no stop at all
|
|
468
|
+
* and answers `true`: nothing to rove, and Tab skips it.
|
|
469
|
+
*/
|
|
470
|
+
async isRoving() {
|
|
471
|
+
return (await this.getTabStopLabels()).length <= 1;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* The label of the tab holding keyboard focus, or `null` when focus is elsewhere.
|
|
475
|
+
*
|
|
476
|
+
* The other answer to "which tab is active", and not the same as
|
|
477
|
+
* {@link getSelectedLabel}: the arrow keys move this. In content mode they also
|
|
478
|
+
* select what they land on, so the two stay together; in router mode focus walks
|
|
479
|
+
* the strip while the selection stays on whatever the route resolved to.
|
|
480
|
+
*/
|
|
481
|
+
async getFocusedLabel() {
|
|
482
|
+
for (const tab of await this.getTabs()) {
|
|
483
|
+
if (await tab.isFocused())
|
|
484
|
+
return tab.getLabel();
|
|
485
|
+
}
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Put focus where a Tab press would put it — the first tab stop in render order.
|
|
490
|
+
*
|
|
491
|
+
* That is the selected tab in content mode, and the first enabled tab in a router
|
|
492
|
+
* strip. Throws when the strip has no stop at all, because Tab then skips past it
|
|
493
|
+
* rather than entering it — a content strip whose selected tab is disabled has
|
|
494
|
+
* none, and neither has one whose every tab is disabled, or one with no tabs.
|
|
495
|
+
*/
|
|
496
|
+
async focusTabStop() {
|
|
497
|
+
for (const tab of await this.getTabs()) {
|
|
498
|
+
if (await tab.isTabStop()) {
|
|
499
|
+
await tab.focus();
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
throw new Error('WrTabsHarness.focusTabStop(): this strip has no tab stop — its selected tab is disabled, every tab ' +
|
|
504
|
+
'is disabled, or it renders no tabs — so Tab skips it rather than entering it.');
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* ArrowRight on the strip — one tab toward the visual RIGHT, wrapping at the end
|
|
508
|
+
* and skipping disabled tabs.
|
|
509
|
+
*
|
|
510
|
+
* The physical key, because that is what a keyboard has. The component follows
|
|
511
|
+
* visual order per the APG, so under `dir="rtl"` this moves to the PREVIOUS tab —
|
|
512
|
+
* a spec exercising a mirrored strip swaps this and {@link pressArrowLeft}.
|
|
513
|
+
*
|
|
514
|
+
* In content mode the tab it lands on is also SELECTED (automatic activation); in
|
|
515
|
+
* router mode only focus moves.
|
|
516
|
+
*/
|
|
517
|
+
async pressArrowRight() {
|
|
518
|
+
await this.press(TestKey.RIGHT_ARROW);
|
|
519
|
+
}
|
|
520
|
+
/** ArrowLeft on the strip — one tab toward the visual LEFT, mirrored under `dir="rtl"`. */
|
|
521
|
+
async pressArrowLeft() {
|
|
522
|
+
await this.press(TestKey.LEFT_ARROW);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Home on the strip — the FIRST enabled tab.
|
|
526
|
+
*
|
|
527
|
+
* Home and End name a position in the tab list rather than an edge of the strip,
|
|
528
|
+
* so unlike the arrows they read the same in both reading directions.
|
|
529
|
+
*/
|
|
530
|
+
async pressHome() {
|
|
531
|
+
await this.press(TestKey.HOME);
|
|
532
|
+
}
|
|
533
|
+
/** End on the strip — the LAST enabled tab, in both reading directions. */
|
|
534
|
+
async pressEnd() {
|
|
535
|
+
await this.press(TestKey.END);
|
|
536
|
+
}
|
|
537
|
+
/** Whether this strip is showing a panel at all — false for a router strip. */
|
|
538
|
+
async hasPanel() {
|
|
539
|
+
const selected = await this.getSelectedTab();
|
|
540
|
+
return selected === null ? false : selected.hasPanel();
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* The text of the panel that is showing, trimmed — the selected tab's content, and
|
|
544
|
+
* the only tab content in the DOM.
|
|
545
|
+
*
|
|
546
|
+
* Throws when nothing is selected. Delegates to the selected tab, so the panel it
|
|
547
|
+
* reads is the one that tab's `aria-controls` points at rather than "the first
|
|
548
|
+
* `.wr-tabs__panel` around" — the two are only the same page when the wiring is
|
|
549
|
+
* right, and {@link WrTabHarness.isPanelBound} is what says whether it is.
|
|
550
|
+
*/
|
|
551
|
+
async getPanelText() {
|
|
552
|
+
const selected = await this.getSelectedTab();
|
|
553
|
+
if (!selected) {
|
|
554
|
+
throw new Error('WrTabsHarness.getPanelText(): no tab is selected, so no panel is rendered. A router strip whose ' +
|
|
555
|
+
'route matches none of its tabs looks like this, as does a strip with no tabs.');
|
|
556
|
+
}
|
|
557
|
+
return selected.getPanelText();
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Which edges of the strip are faded out, from the public `--fade-start` /
|
|
561
|
+
* `--fade-end` host modifiers — the cue that there are more tabs than fit, on the
|
|
562
|
+
* side they are on.
|
|
563
|
+
*
|
|
564
|
+
* The component computes these from the strip's scroll metrics, so in a unit test
|
|
565
|
+
* both are always `false`: jsdom lays nothing out, every element measures 0x0, and
|
|
566
|
+
* a strip that never overflows never fades. Assert this in a real browser, or
|
|
567
|
+
* declare the metrics and dispatch a `scroll` the way the component's own spec
|
|
568
|
+
* does.
|
|
569
|
+
*/
|
|
570
|
+
async getFades() {
|
|
571
|
+
const host = await this.host();
|
|
572
|
+
return {
|
|
573
|
+
start: await host.hasClass('wr-tabs--fade-start'),
|
|
574
|
+
end: await host.hasClass('wr-tabs--fade-end'),
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
/** Click a tab and check it took, or say which of the two reasons it did not. */
|
|
578
|
+
async activate(tab, method) {
|
|
579
|
+
await tab.click();
|
|
580
|
+
if (await tab.isSelected())
|
|
581
|
+
return;
|
|
582
|
+
throw new Error(`WrTabsHarness.${method}(): "${await tab.getLabel()}" is still unselected after being clicked — ` +
|
|
583
|
+
'either it is a content tab carrying `disabled`, which fires no click at all, or this is a router ' +
|
|
584
|
+
'strip whose navigation did not land on this tab: a guard, a redirect or an unmatched path leaves ' +
|
|
585
|
+
'`routerLinkActive` painting some other one.');
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Send a key to the `role="tablist"` strip.
|
|
589
|
+
*
|
|
590
|
+
* The strip owns the keydown handler, and a real user's keypress on the focused
|
|
591
|
+
* header bubbles to exactly here — so this is the honest target, and the one that
|
|
592
|
+
* still works when jsdom has left real focus on `<body>`. It is also the target
|
|
593
|
+
* that leaves the headers alone: the CDK types into whatever element it is handed,
|
|
594
|
+
* which on a `<button>` means writing a `value` attribute onto a tab.
|
|
595
|
+
*/
|
|
596
|
+
async press(key) {
|
|
597
|
+
await (await this.strip()).sendKeys(key);
|
|
598
|
+
}
|
|
599
|
+
/** This strip's own `role="tablist"` element — the first one under the host. */
|
|
600
|
+
async strip() {
|
|
601
|
+
return this.locatorFor('.wr-tabs__strip')();
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* A loader rooted at this strip, so tab queries cannot reach a nested strip's tabs:
|
|
605
|
+
* a nested `<wr-tabs>` lives in the PANEL, which is outside this element.
|
|
606
|
+
*/
|
|
607
|
+
async stripLoader() {
|
|
608
|
+
return this.locatorFactory.harnessLoaderFor('.wr-tabs__strip');
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Generated bundle index. Do not edit.
|
|
614
|
+
*/
|
|
615
|
+
|
|
616
|
+
export { WrTabHarness, WrTabsHarness };
|
|
617
|
+
//# sourceMappingURL=ngwr-tabs-testing.mjs.map
|