ngwr 16.6.0 → 16.7.1
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/avatar/styles/_index.scss +39 -0
- package/button/styles/_index.scss +45 -2
- package/checkbox/styles/_index.scss +4 -0
- package/copy-value/styles/_index.scss +4 -0
- package/dropdown/styles/_index.scss +17 -0
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +4 -3
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +171 -6
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-breadcrumbs.mjs +9 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +26 -6
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +5 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +9 -9
- package/fesm2022/ngwr-charts-core.mjs +6 -6
- package/fesm2022/ngwr-charts-donut-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-meter-group.mjs +3 -3
- package/fesm2022/ngwr-charts-radar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-scatter-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +6 -6
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +7 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +35 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +103 -53
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +40 -16
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +19 -18
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +181 -18
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-dropdown-testing.mjs +5 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +59 -16
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +6 -5
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +7 -6
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +5 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +68 -13
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +18 -16
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +30 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +100 -11
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +6 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +6 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +6 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +6 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +6 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +6 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +6 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +6 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +6 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +6 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +6 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-kk.mjs +520 -0
- package/fesm2022/ngwr-i18n-kk.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ko.mjs +6 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +6 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +6 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +6 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +6 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +6 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +6 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +6 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +6 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +8 -4
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-otp.mjs +3 -3
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +16 -15
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +9 -9
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination-testing.mjs +3 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +32 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +27 -27
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +7 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +126 -16
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +75 -10
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form.mjs +10 -6
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +255 -7
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select.mjs +28 -19
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +17 -1
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +66 -11
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-sortable-list.mjs +11 -11
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-router.mjs +89 -0
- package/fesm2022/ngwr-table-router.mjs.map +1 -0
- package/fesm2022/ngwr-table-testing.mjs +5 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +282 -43
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +11 -7
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +8 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +60 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +15 -15
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +7 -6
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +30 -2
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +18 -13
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +16 -0
- package/graph/styles/_index.scss +48 -0
- package/i18n/ar.json +4 -2
- package/i18n/cs.json +4 -2
- package/i18n/de.json +4 -2
- package/i18n/en.json +4 -2
- package/i18n/es.json +4 -2
- package/i18n/fr.json +4 -2
- package/i18n/he.json +4 -2
- package/i18n/hi.json +4 -2
- package/i18n/id.json +4 -2
- package/i18n/it.json +4 -2
- package/i18n/ja.json +4 -2
- package/i18n/kk.json +567 -0
- package/i18n/ko.json +4 -2
- package/i18n/nl.json +4 -2
- package/i18n/pl.json +4 -2
- package/i18n/pt.json +4 -2
- package/i18n/ru.json +4 -2
- package/i18n/sv.json +4 -2
- package/i18n/tr.json +4 -2
- package/i18n/uk.json +4 -2
- package/i18n/vi.json +4 -2
- package/i18n/zh-TW.json +4 -2
- package/i18n/zh.json +4 -2
- package/llms-full.txt +29 -18
- package/llms.txt +4 -1
- package/package.json +15 -7
- package/pagination/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +4 -2
- package/progress/styles/_index.scss +64 -0
- package/radio/styles/_index.scss +4 -0
- package/schematics/use/symbol-map.json +5 -0
- package/sidebar/styles/_index.scss +58 -6
- package/skills/ngwr/SKILL.md +7 -6
- package/skills/ngwr/references/catalog.md +6 -4
- package/switch/styles/_index.scss +4 -0
- package/table/styles/_index.scss +128 -32
- package/tabs/styles/_index.scss +9 -0
- package/theme/styles/_focus.scss +3 -1
- package/tour/styles/_index.scss +3 -2
- package/types/ngwr-avatar.d.ts +39 -0
- package/types/ngwr-button.d.ts +12 -0
- package/types/ngwr-date-picker-testing.d.ts +22 -0
- package/types/ngwr-date-picker.d.ts +84 -17
- package/types/ngwr-date.d.ts +51 -0
- package/types/ngwr-directives.d.ts +45 -0
- package/types/ngwr-dropdown-testing.d.ts +8 -1
- package/types/ngwr-dropdown.d.ts +29 -0
- package/types/ngwr-file-upload-testing.d.ts +10 -0
- package/types/ngwr-file-upload.d.ts +55 -1
- package/types/ngwr-form.d.ts +3 -1
- package/types/ngwr-graph-testing.d.ts +28 -1
- package/types/ngwr-graph.d.ts +53 -3
- package/types/ngwr-i18n-kk.d.ts +3 -0
- package/types/ngwr-image-cropper.d.ts +6 -0
- package/types/ngwr-pagination-testing.d.ts +8 -0
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-popover.d.ts +39 -0
- package/types/ngwr-progress.d.ts +63 -1
- package/types/ngwr-scroll.d.ts +95 -0
- package/types/ngwr-select.d.ts +31 -12
- package/types/ngwr-sidebar-testing.d.ts +21 -7
- package/types/ngwr-sidebar.d.ts +66 -4
- package/types/ngwr-table-router.d.ts +49 -0
- package/types/ngwr-table-testing.d.ts +7 -0
- package/types/ngwr-table.d.ts +185 -6
- package/types/ngwr-tabs-router.d.ts +4 -5
- package/types/ngwr-tabs-testing.d.ts +5 -1
- package/types/ngwr-tabs.d.ts +34 -1
- package/types/ngwr-utils.d.ts +13 -0
- package/types/ngwr-version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-dropdown-testing.mjs","names":[],"sources":["../../../projects/lib/dropdown/testing/wr-dropdown-item-harness.ts","../../../projects/lib/dropdown/testing/wr-dropdown-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrDropdownItemHarnessFilters } from './types';\n\n/**\n * Test harness for one `<wr-dropdown-item>` inside a dropdown menu.\n *\n * The selector is the CLASS rather than the element: `.wr-dropdown-item` is what\n * the directive's own keyboard navigation queries, so it is the contract both\n * sides already rely on. Only the class, though — the directive narrows its query\n * to `:not(.wr-dropdown-item--disabled)` because it is looking for focus stops,\n * while a spec still has to be able to see a disabled item and assert that it is\n * one.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrDropdownItemHarness extends ComponentHarness {\n /** The class the item paints on its host, and the one arrow-key navigation looks for. */\n static hostSelector = '.wr-dropdown-item';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrDropdownItemHarnessFilters = {}): HarnessPredicate<WrDropdownItemHarness> {\n return new HarnessPredicate(WrDropdownItemHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The item's label, trimmed. A leading icon is not part of it. */\n async getText(): Promise<string> {\n return (await this.locatorFor('.wr-dropdown-item__label')()).text();\n }\n\n /** The role the item announces — `menuitem`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** Whether the item refuses activation. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the item opens a submenu. `WrDropdownHarness.openSubmenu()` opens it. */\n async hasSubmenu(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-haspopup')) === 'menu';\n }\n\n /** Whether the item shows a leading icon. */\n async hasIcon(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-dropdown-item__icon')()) !== null;\n }\n\n /** The leading icon's registered name, or `null` when the item has no icon. */\n async getIconName(): Promise<string | null> {\n const icon = await this.locatorForOptional('.wr-dropdown-item__icon')();\n // `<wr-icon>` reflects the name it was asked for as `data-icon`, whether or not\n // that name is registered — so this answers what the item MEANT to draw.\n return icon ? icon.getAttribute('data-icon') : null;\n }\n\n /** Whether the item holds the menu's roving focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Click the item. A disabled item throws instead.\n *\n * Refusing is the only honest answer: the item's own `disabled` guards the\n * KEYBOARD path only, and a pointer is stopped by `pointer-events: none` in the\n * stylesheet. jsdom loads no stylesheets, so a click dispatched here would land\n * on the host — exactly where the consumer bound `(click)` — and the spec would\n * record an activation that cannot happen in a browser. Assert `isDisabled()`\n * instead.\n */\n async click(): Promise<void> {\n if (await this.isDisabled()) {\n throw new Error(\n `WrDropdownItemHarness.click(): \"${await this.getText()}\" is disabled, so clicking it would ` +\n 'report behaviour a browser cannot produce — the pointer is stopped by CSS, which jsdom does ' +\n 'not load. Assert isDisabled() instead.'\n );\n }\n\n return (await this.host()).click();\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n type ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrDropdownPosition } from 'ngwr/dropdown';\n\nimport type { WrDropdownHarnessFilters, WrDropdownItemHarnessFilters } from './types';\nimport { WrDropdownItemHarness } from './wr-dropdown-item-harness';\n\n/**\n * Test harness for `[wrDropdown]` — the trigger, and the menu it opens.\n *\n * The harness matches the TRIGGER, because that is the only part of the dropdown\n * in the fixture: `<wr-dropdown-menu>` renders nothing of its own (it hands over\n * an `<ng-template>`), and the menu is portalled into the overlay container, a\n * sibling of the whole app. So every item is read through the document root,\n * scoped by the `aria-controls` id the trigger publishes while it is open — which\n * is what keeps two dropdowns on one page from answering with each other's items.\n *\n * That scoped loader is also this harness's CONTENT loader, so\n * `dropdown.getHarness(…)` resolves inside THIS dropdown's menu: the consumer's\n * own components in the menu are reachable without the spec ever touching the\n * overlay, and so is a nested `[wrDropdown]`. A submenu is reached with\n * `openSubmenu()`, which answers with a harness scoped to that submenu.\n *\n * @example\n * ```ts\n * const dropdown = await loader.getHarness(WrDropdownHarness.with({ text: 'Actions' }));\n *\n * await dropdown.open();\n * expect(await dropdown.getItemTexts()).toEqual(['Copy', 'Delete']);\n *\n * await dropdown.clickItem({ text: 'Copy' });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrDropdownHarness extends ContentContainerComponentHarness {\n /** The directive's host — whatever element the consumer put `[wrDropdown]` on. */\n static hostSelector = '.wr-dropdown-trigger';\n\n /** Build a predicate that narrows the query. */\n static with<T extends WrDropdownHarness>(\n this: ComponentHarnessConstructor<T>,\n options: WrDropdownHarnessFilters = {}\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getTriggerText(), text)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The trigger's visible text. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the menu is showing. */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /**\n * Whether `wrDropdownDisabled` has turned the trigger off — read from\n * `wr-dropdown-trigger--disabled`, the one mark a disabled trigger carries.\n * The HOST's own `disabled` is another question: the directive never sets it,\n * so ask the host's harness (`WrButtonHarness.isDisabled()`).\n */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('wr-dropdown-trigger--disabled');\n }\n\n /** The role the menu announces — `menu`. Throws while the menu is closed. */\n async getMenuRole(): Promise<string | null> {\n return (await this.menu()).getAttribute('role');\n }\n\n /**\n * Where the menu sits relative to the trigger, or `null` when its pane names\n * no placement, as a submenu's does not. Throws while the menu is closed.\n *\n * Read off the pane's public modifier class, since a bound `position` never\n * reaches the DOM. The class names the placement the menu LANDED on, which is\n * the one asked for unless it had no room there and flipped; in jsdom, with no\n * layout to run out of, the two are the same.\n */\n async getPosition(): Promise<WrDropdownPosition | null> {\n const pane = await this.documentRootLocatorFactory().locatorFor(\n `.wr-dropdown-overlay:has(> #${await this.menuId()})`\n )();\n const classes = (await pane.getAttribute('class')) ?? '';\n const modifier = /wr-dropdown-overlay--((?:top|bottom|left|right)(?:-(?:start|end))?)(?![a-z-])/.exec(classes);\n return modifier ? (modifier[1] as WrDropdownPosition) : null;\n }\n\n /**\n * Whether the menu takes its accessible name from this trigger.\n *\n * The menu carries no label of its own, so that reference IS its name — and the\n * id it points at is generated unless the consumer named the trigger\n * themselves, which is why a spec cannot simply hard-code one.\n */\n async isMenuLabelledByTrigger(): Promise<boolean> {\n const labelledBy = await (await this.menu()).getAttribute('aria-labelledby');\n return labelledBy !== null && labelledBy === (await (await this.host()).getAttribute('id'));\n }\n\n /**\n * Open the menu, whichever gesture this dropdown listens for.\n *\n * `trigger` is not reflected in the DOM, so the harness cannot ask which mode it\n * is in: it moves the pointer on first and falls back to a click. Hover leads\n * because a click is an outside pointer event for every OTHER open overlay — so\n * leading with it would shut someone else's menu on the way to opening this one\n * — and a `trigger=\"click\"` dropdown ignores the hover outright.\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n const host = await this.host();\n\n await host.hover();\n if (await this.isOpen()) return;\n\n await host.click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownHarness.open(): the menu did not open — neither hovering the trigger nor clicking it ' +\n 'had any effect. Both gestures were tried, so the `trigger` mode is not the cause; check that this ' +\n 'element is the trigger you meant and that it is not disabled (isDisabled()). openByKeyboard() is ' +\n 'the third route in.'\n );\n }\n\n /**\n * Open the menu from the keyboard — ArrowDown on the trigger, the APG\n * menu-button path (ArrowUp / Enter / Space do the same). Focus stays on the\n * trigger unless the dropdown sets `wrDropdownAutoFocus`.\n *\n * Worth its own method rather than an argument to `open()`: it is the only way\n * to get TWO dropdowns open at once, because clicking a second trigger is an\n * outside pointer event for the first and closes it.\n */\n async openByKeyboard(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).sendKeys(TestKey.DOWN_ARROW);\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownHarness.openByKeyboard(): ArrowDown on the trigger did not open the menu. The component ' +\n 'takes ArrowDown / ArrowUp / Enter / Space in EVERY `trigger` mode, so the mode is not the cause; ' +\n 'check that this element is the trigger you meant and that it is not disabled (isDisabled()).'\n );\n }\n\n /** Close the menu. A closed dropdown is left alone. */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n const host = await this.host();\n\n // Pointer-out leads for the reason `open()` hovers first: it closes a\n // `trigger=\"hover\"` dropdown without a click, and the click a `trigger=\"click\"`\n // one needs would also count as an outside press for every other open overlay.\n await host.mouseAway();\n if (!(await this.isOpen())) return;\n\n await host.click();\n if (!(await this.isOpen())) return;\n\n throw new Error(\n 'WrDropdownHarness.close(): the menu is still open. Moving the pointer away closes a ' +\n '`trigger=\"hover\"` dropdown and a second click closes a `trigger=\"click\"` one; neither worked.'\n );\n }\n\n /** Click the trigger. A `trigger=\"hover\"` dropdown deliberately ignores this. */\n async clickTrigger(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move the pointer onto the trigger. Opens a `trigger=\"hover\"` dropdown. */\n async hoverTrigger(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer off the trigger. Closes a `trigger=\"hover\"` dropdown. */\n async mouseAwayFromTrigger(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /**\n * The items in this dropdown's menu, in DOM order.\n *\n * Throws while the menu is closed: the items do not exist anywhere until the\n * portal is attached, and an empty array reads like a menu that rendered\n * nothing — a failure three lines later instead of here.\n */\n async getItems(filters: WrDropdownItemHarnessFilters = {}): Promise<WrDropdownItemHarness[]> {\n return this.getAllHarnesses(WrDropdownItemHarness.with(filters));\n }\n\n /** The labels of the items in this dropdown's menu, in DOM order. */\n async getItemTexts(): Promise<string[]> {\n const items = await this.getItems();\n return Promise.all(items.map(item => item.getText()));\n }\n\n /**\n * Open the menu if it is closed, then click the first item matching the filters.\n *\n * Picking does NOT close the menu — there is no close-on-select in the item or\n * the menu, so a consumer who wants one calls `close()` themselves.\n */\n async clickItem(filters: WrDropdownItemHarnessFilters): Promise<void> {\n await this.open();\n\n const [item] = await this.getItems(filters);\n if (!item) {\n const offered = await this.getItemTexts();\n throw new Error(\n `WrDropdownHarness.clickItem(): no item matched ${JSON.stringify(filters)}. ` +\n `The menu offers: ${offered.join(', ')}.`\n );\n }\n\n await item.click();\n }\n\n /**\n * Open the menu if it is closed, then open the submenu of the item with this\n * label and answer with its harness: `getItems()`, `clickItem()` and a further\n * `openSubmenu()` all read that submenu and nothing else.\n *\n * A click opens it, since hovering waits out the item's `showDelay`.\n */\n async openSubmenu(text: string | RegExp): Promise<WrDropdownSubmenuHarness> {\n await this.open();\n\n const submenu = await this.getHarnessOrNull(WrDropdownSubmenuHarness.with({ text }));\n if (!submenu) {\n const offered = await this.getAllHarnesses(WrDropdownSubmenuHarness);\n const labels = await Promise.all(offered.map(item => item.getTriggerText()));\n throw new Error(\n `WrDropdownHarness.openSubmenu(): no item labelled ${String(text)} opens a submenu. ` +\n `Items with a submenu here: ${labels.join(', ') || 'none'}.`\n );\n }\n\n await submenu.open();\n return submenu;\n }\n\n /**\n * The label of the item that currently holds focus, or `null` when focus is\n * elsewhere.\n *\n * The menu roves focus rather than moving a visual cursor, so this is the only\n * way to ask where the keyboard is. Opening leaves focus on the trigger unless\n * the dropdown sets `wrDropdownAutoFocus`: send ArrowDown to the host\n * (`(await dropdown.host()).sendKeys(TestKey.DOWN_ARROW)`) to walk in at the\n * first ENABLED item, and the arrow keys walk from there over the enabled\n * items only (a disabled one is not a stop).\n */\n async getFocusedItemText(): Promise<string | null> {\n for (const item of await this.getItems()) {\n if (await item.isFocused()) return item.getText();\n }\n return null;\n }\n\n /**\n * A loader scoped to THIS dropdown's menu — the content loader every\n * `HarnessLoader` method on this class runs through, `getItems()` included.\n *\n * Scoped by the published id rather than by `.wr-dropdown-menu`: the overlay\n * container is shared, so a bare class query would answer with whichever\n * dropdown happened to open first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.menuId()}`);\n }\n\n /** This dropdown's menu element in the overlay. */\n protected async menu(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.menuId()}`)();\n }\n\n /** The id the trigger publishes as `aria-controls`, which its menu carries. */\n private async menuId(): Promise<string> {\n const id = await (await this.host()).getAttribute('aria-controls');\n if (!id) {\n throw new Error(\n 'WrDropdownHarness: the menu is closed, so there is nothing inside it to read — call open() ' +\n 'first. The trigger publishes `aria-controls` only while its menu is open.'\n );\n }\n return id;\n }\n}\n\n/**\n * Test harness for an item carrying `[wrDropdownSubmenu]`, and the submenu it\n * opens. Usually reached through `openSubmenu()` on the level above.\n *\n * It is a `WrDropdownHarness` whose trigger is the item, so everything that\n * reads a menu reads the submenu, scoped the same way, by the id the item\n * publishes. Two things differ. `hoverTrigger()` opens nothing by itself: the\n * item waits out its `showDelay`, which is the spec's own fake timer to\n * advance. And clicking a leaf item closes every submenu, so `clickItem()`\n * leaves this one closed, while the root menu stays open as it always has.\n *\n * Which side the submenu opened on is not readable: jsdom has no layout.\n *\n * @example\n * ```ts\n * const file = await loader.getHarness(WrDropdownHarness.with({ text: 'File' }));\n * const exportAs = await file.openSubmenu('Export');\n *\n * expect(await exportAs.getItemTexts()).toEqual(['CSV', 'PDF', 'Excel']);\n * await exportAs.clickItem({ text: 'CSV' });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrDropdownSubmenuHarness extends WrDropdownHarness {\n /** The class the directive puts on its item. */\n static override hostSelector = '.wr-dropdown-submenu-trigger';\n\n /** Open the submenu with a click on its item. */\n override async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownSubmenuHarness.open(): clicking the item did not open its submenu. A disabled item ' +\n 'opens nothing, and neither does one whose own menu has closed; check isOpen() on the level above.'\n );\n }\n\n /**\n * Open the submenu from the keyboard, with Enter on its item. Enter rather\n * than the arrow because the arrow that opens a submenu depends on the\n * reading direction, and Enter does not.\n */\n override async openByKeyboard(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).sendKeys(TestKey.ENTER);\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownSubmenuHarness.openByKeyboard(): Enter on the item did not open its submenu. Enter ' +\n 'reaches it through `<wr-dropdown-item>`, so check that the directive sits on one and that it is enabled.'\n );\n }\n\n /** Close the submenu with Escape typed inside it, which closes this level only. */\n override async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.menu()).sendKeys(TestKey.ESCAPE);\n if (!(await this.isOpen())) return;\n\n throw new Error('WrDropdownSubmenuHarness.close(): the submenu is still open after Escape was typed in it.');\n }\n}\n"],"mappings":";;;;;;;AAuBA,IAAa,wBAAb,MAAa,8BAA8B,iBAAgB;CAEzD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAwC,CAAA,GAAE;EACpD,OAAO,IAAI,iBAAiB,uBAAuB,OAAO,CAAC,CACxD,UAAU,QAAQ,QAAQ,OAAO,SAAS,SAAS,iBAAiB,cAAc,QAAQ,QAAO,GAAI,IAAI,CAAC,CAAC,CAC3G,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ;CACnH;CAGA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,WAAW,0BAA0B,CAAC,CAAA,EAAA,CAAI,KAAI;CACnE;CAGA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,MAAM;CAChD;CAGA,MAAM,aAAU;EACd,OAAQ,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,eAAe,MAAO;CACvE;CAGA,MAAM,aAAU;EACd,OAAQ,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,eAAe,MAAO;CACvE;CAGA,MAAM,UAAO;EACX,OAAQ,MAAM,KAAK,mBAAmB,yBAAyB,CAAC,CAAA,MAAQ;CAC1E;CAGA,MAAM,cAAW;EACf,MAAM,OAA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,GAAI,CAAC,CAAA;CAChF;CAGQ,MAAM,SAAM;EAClB,MAAM,KAAK,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,eAAe;EACjE,IAAI,CAAC,IACH,MAAM,IAAI,MACR,sKAC6E;EAGjF,OAAO;CACT;;AA2BF,IAAa,2BAAb,cAA8C,kBAAiB;CAE7D,OAAgB,eAAe;CAGtB,MAAM,OAAI;EACjB,IAAI,MAAM,KAAK,OAAM,GAAI;EAEzB,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,MAAK;EAC/B,IAAI,MAAM,KAAK,OAAM,GAAI;EAEzB,MAAM,IAAI,MACR,gMACqG;CAEzG;CAOS,MAAM,iBAAc;EAC3B,IAAI,MAAM,KAAK,OAAM,GAAI;EAEzB,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,SAAS,QAAQ,KAAK;EAChD,IAAI,MAAM,KAAK,OAAM,GAAI;EAEzB,MAAM,IAAI,MACR,uMAC4G;CAEhH;CAGS,MAAM,QAAK;EAClB,IAAI,CAAE,MAAM,KAAK,OAAM,GAAK;EAE5B,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,SAAS,QAAQ,MAAM;EACjD,IAAI,CAAE,MAAM,KAAK,OAAM,GAAK;EAE5B,MAAM,IAAI,MAAM,2FAA2F;CAC7G"}
|
|
1
|
+
{"version":3,"file":"ngwr-dropdown-testing.mjs","names":[],"sources":["../../../projects/lib/dropdown/testing/wr-dropdown-item-harness.ts","../../../projects/lib/dropdown/testing/wr-dropdown-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrDropdownItemHarnessFilters } from './types';\n\n/**\n * Test harness for one `<wr-dropdown-item>` inside a dropdown menu.\n *\n * The selector is the CLASS rather than the element: `.wr-dropdown-item` is what\n * the directive's own keyboard navigation queries, so it is the contract both\n * sides already rely on. Only the class, though — the directive narrows its query\n * to `:not(.wr-dropdown-item--disabled)` because it is looking for focus stops,\n * while a spec still has to be able to see a disabled item and assert that it is\n * one.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrDropdownItemHarness extends ComponentHarness {\n /** The class the item paints on its host, and the one arrow-key navigation looks for. */\n static hostSelector = '.wr-dropdown-item';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrDropdownItemHarnessFilters = {}): HarnessPredicate<WrDropdownItemHarness> {\n return new HarnessPredicate(WrDropdownItemHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) === checked);\n }\n\n /** The item's label, trimmed. A leading icon is not part of it. */\n async getText(): Promise<string> {\n return (await this.locatorFor('.wr-dropdown-item__label')()).text();\n }\n\n /** The role the item announces: `menuitem`, or `menuitemcheckbox` / `menuitemradio` when it has a checked state. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /**\n * The item's checked state: `true` or `false` for a `menuitemcheckbox` /\n * `menuitemradio`, `null` for a plain item that has none.\n */\n async isChecked(): Promise<boolean | null> {\n const value = await (await this.host()).getAttribute('aria-checked');\n return value === null ? null : value === 'true';\n }\n\n /** Whether the item refuses activation. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the item opens a submenu. `WrDropdownHarness.openSubmenu()` opens it. */\n async hasSubmenu(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-haspopup')) === 'menu';\n }\n\n /** Whether the item shows a leading icon. */\n async hasIcon(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-dropdown-item__icon')()) !== null;\n }\n\n /** The leading icon's registered name, or `null` when the item has no icon. */\n async getIconName(): Promise<string | null> {\n const icon = await this.locatorForOptional('.wr-dropdown-item__icon')();\n // `<wr-icon>` reflects the name it was asked for as `data-icon`, whether or not\n // that name is registered — so this answers what the item MEANT to draw.\n return icon ? icon.getAttribute('data-icon') : null;\n }\n\n /** Whether the item holds the menu's roving focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Click the item. A disabled item throws instead.\n *\n * Refusing is the only honest answer: the item's own `disabled` guards the\n * KEYBOARD path only, and a pointer is stopped by `pointer-events: none` in the\n * stylesheet. jsdom loads no stylesheets, so a click dispatched here would land\n * on the host — exactly where the consumer bound `(click)` — and the spec would\n * record an activation that cannot happen in a browser. Assert `isDisabled()`\n * instead.\n */\n async click(): Promise<void> {\n if (await this.isDisabled()) {\n throw new Error(\n `WrDropdownItemHarness.click(): \"${await this.getText()}\" is disabled, so clicking it would ` +\n 'report behaviour a browser cannot produce — the pointer is stopped by CSS, which jsdom does ' +\n 'not load. Assert isDisabled() instead.'\n );\n }\n\n return (await this.host()).click();\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n type ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrDropdownPosition } from 'ngwr/dropdown';\n\nimport type { WrDropdownHarnessFilters, WrDropdownItemHarnessFilters } from './types';\nimport { WrDropdownItemHarness } from './wr-dropdown-item-harness';\n\n/**\n * Test harness for `[wrDropdown]` — the trigger, and the menu it opens.\n *\n * The harness matches the TRIGGER, because that is the only part of the dropdown\n * in the fixture: `<wr-dropdown-menu>` renders nothing of its own (it hands over\n * an `<ng-template>`), and the menu is portalled into the overlay container, a\n * sibling of the whole app. So every item is read through the document root,\n * scoped by the `aria-controls` id the trigger publishes while it is open — which\n * is what keeps two dropdowns on one page from answering with each other's items.\n *\n * That scoped loader is also this harness's CONTENT loader, so\n * `dropdown.getHarness(…)` resolves inside THIS dropdown's menu: the consumer's\n * own components in the menu are reachable without the spec ever touching the\n * overlay, and so is a nested `[wrDropdown]`. A submenu is reached with\n * `openSubmenu()`, which answers with a harness scoped to that submenu.\n *\n * @example\n * ```ts\n * const dropdown = await loader.getHarness(WrDropdownHarness.with({ text: 'Actions' }));\n *\n * await dropdown.open();\n * expect(await dropdown.getItemTexts()).toEqual(['Copy', 'Delete']);\n *\n * await dropdown.clickItem({ text: 'Copy' });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrDropdownHarness extends ContentContainerComponentHarness {\n /** The directive's host — whatever element the consumer put `[wrDropdown]` on. */\n static hostSelector = '.wr-dropdown-trigger';\n\n /** Build a predicate that narrows the query. */\n static with<T extends WrDropdownHarness>(\n this: ComponentHarnessConstructor<T>,\n options: WrDropdownHarnessFilters = {}\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getTriggerText(), text)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The trigger's visible text. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the menu is showing. */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /**\n * Whether `wrDropdownDisabled` has turned the trigger off — read from\n * `wr-dropdown-trigger--disabled`, the one mark a disabled trigger carries.\n * The HOST's own `disabled` is another question: the directive never sets it,\n * so ask the host's harness (`WrButtonHarness.isDisabled()`).\n */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('wr-dropdown-trigger--disabled');\n }\n\n /** The role the menu announces — `menu`. Throws while the menu is closed. */\n async getMenuRole(): Promise<string | null> {\n return (await this.menu()).getAttribute('role');\n }\n\n /**\n * Where the menu sits relative to the trigger, or `null` when its pane names\n * no placement, as a submenu's does not. Throws while the menu is closed.\n *\n * Read off the pane's public modifier class, since a bound `position` never\n * reaches the DOM. The class names the placement the menu LANDED on, which is\n * the one asked for unless it had no room there and flipped; in jsdom, with no\n * layout to run out of, the two are the same.\n */\n async getPosition(): Promise<WrDropdownPosition | null> {\n const pane = await this.documentRootLocatorFactory().locatorFor(\n `.wr-dropdown-overlay:has(> #${await this.menuId()})`\n )();\n const classes = (await pane.getAttribute('class')) ?? '';\n const modifier = /wr-dropdown-overlay--((?:top|bottom|left|right)(?:-(?:start|end))?)(?![a-z-])/.exec(classes);\n return modifier ? (modifier[1] as WrDropdownPosition) : null;\n }\n\n /**\n * Whether the menu takes its accessible name from this trigger.\n *\n * The menu carries no label of its own, so that reference IS its name — and the\n * id it points at is generated unless the consumer named the trigger\n * themselves, which is why a spec cannot simply hard-code one.\n */\n async isMenuLabelledByTrigger(): Promise<boolean> {\n const labelledBy = await (await this.menu()).getAttribute('aria-labelledby');\n return labelledBy !== null && labelledBy === (await (await this.host()).getAttribute('id'));\n }\n\n /**\n * Open the menu, whichever gesture this dropdown listens for.\n *\n * `trigger` is not reflected in the DOM, so the harness cannot ask which mode it\n * is in: it moves the pointer on first and falls back to a click. Hover leads\n * because a click is an outside pointer event for every OTHER open overlay — so\n * leading with it would shut someone else's menu on the way to opening this one\n * — and a `trigger=\"click\"` dropdown ignores the hover outright.\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n const host = await this.host();\n\n await host.hover();\n if (await this.isOpen()) return;\n\n await host.click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownHarness.open(): the menu did not open — neither hovering the trigger nor clicking it ' +\n 'had any effect. Both gestures were tried, so the `trigger` mode is not the cause; check that this ' +\n 'element is the trigger you meant and that it is not disabled (isDisabled()). openByKeyboard() is ' +\n 'the third route in.'\n );\n }\n\n /**\n * Open the menu from the keyboard — ArrowDown on the trigger, the APG\n * menu-button path (ArrowUp / Enter / Space do the same). Focus stays on the\n * trigger unless the dropdown sets `wrDropdownAutoFocus`.\n *\n * Worth its own method rather than an argument to `open()`: it is the only way\n * to get TWO dropdowns open at once, because clicking a second trigger is an\n * outside pointer event for the first and closes it.\n */\n async openByKeyboard(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).sendKeys(TestKey.DOWN_ARROW);\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownHarness.openByKeyboard(): ArrowDown on the trigger did not open the menu. The component ' +\n 'takes ArrowDown / ArrowUp / Enter / Space in EVERY `trigger` mode, so the mode is not the cause; ' +\n 'check that this element is the trigger you meant and that it is not disabled (isDisabled()).'\n );\n }\n\n /** Close the menu. A closed dropdown is left alone. */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n const host = await this.host();\n\n // Pointer-out leads for the reason `open()` hovers first: it closes a\n // `trigger=\"hover\"` dropdown without a click, and the click a `trigger=\"click\"`\n // one needs would also count as an outside press for every other open overlay.\n await host.mouseAway();\n if (!(await this.isOpen())) return;\n\n await host.click();\n if (!(await this.isOpen())) return;\n\n throw new Error(\n 'WrDropdownHarness.close(): the menu is still open. Moving the pointer away closes a ' +\n '`trigger=\"hover\"` dropdown and a second click closes a `trigger=\"click\"` one; neither worked.'\n );\n }\n\n /** Click the trigger. A `trigger=\"hover\"` dropdown deliberately ignores this. */\n async clickTrigger(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move the pointer onto the trigger. Opens a `trigger=\"hover\"` dropdown. */\n async hoverTrigger(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer off the trigger. Closes a `trigger=\"hover\"` dropdown. */\n async mouseAwayFromTrigger(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /**\n * The items in this dropdown's menu, in DOM order.\n *\n * Throws while the menu is closed: the items do not exist anywhere until the\n * portal is attached, and an empty array reads like a menu that rendered\n * nothing — a failure three lines later instead of here.\n */\n async getItems(filters: WrDropdownItemHarnessFilters = {}): Promise<WrDropdownItemHarness[]> {\n return this.getAllHarnesses(WrDropdownItemHarness.with(filters));\n }\n\n /** The labels of the items in this dropdown's menu, in DOM order. */\n async getItemTexts(): Promise<string[]> {\n const items = await this.getItems();\n return Promise.all(items.map(item => item.getText()));\n }\n\n /**\n * Open the menu if it is closed, then click the first item matching the filters.\n *\n * Picking does NOT close the menu — there is no close-on-select in the item or\n * the menu, so a consumer who wants one calls `close()` themselves.\n */\n async clickItem(filters: WrDropdownItemHarnessFilters): Promise<void> {\n await this.open();\n\n const [item] = await this.getItems(filters);\n if (!item) {\n const offered = await this.getItemTexts();\n throw new Error(\n `WrDropdownHarness.clickItem(): no item matched ${JSON.stringify(filters)}. ` +\n `The menu offers: ${offered.join(', ')}.`\n );\n }\n\n await item.click();\n }\n\n /**\n * Open the menu if it is closed, then open the submenu of the item with this\n * label and answer with its harness: `getItems()`, `clickItem()` and a further\n * `openSubmenu()` all read that submenu and nothing else.\n *\n * A click opens it, since hovering waits out the item's `showDelay`.\n */\n async openSubmenu(text: string | RegExp): Promise<WrDropdownSubmenuHarness> {\n await this.open();\n\n const submenu = await this.getHarnessOrNull(WrDropdownSubmenuHarness.with({ text }));\n if (!submenu) {\n const offered = await this.getAllHarnesses(WrDropdownSubmenuHarness);\n const labels = await Promise.all(offered.map(item => item.getTriggerText()));\n throw new Error(\n `WrDropdownHarness.openSubmenu(): no item labelled ${String(text)} opens a submenu. ` +\n `Items with a submenu here: ${labels.join(', ') || 'none'}.`\n );\n }\n\n await submenu.open();\n return submenu;\n }\n\n /**\n * The label of the item that currently holds focus, or `null` when focus is\n * elsewhere.\n *\n * The menu roves focus rather than moving a visual cursor, so this is the only\n * way to ask where the keyboard is. Opening leaves focus on the trigger unless\n * the dropdown sets `wrDropdownAutoFocus`: send ArrowDown to the host\n * (`(await dropdown.host()).sendKeys(TestKey.DOWN_ARROW)`) to walk in at the\n * first ENABLED item, and the arrow keys walk from there over the enabled\n * items only (a disabled one is not a stop).\n */\n async getFocusedItemText(): Promise<string | null> {\n for (const item of await this.getItems()) {\n if (await item.isFocused()) return item.getText();\n }\n return null;\n }\n\n /**\n * A loader scoped to THIS dropdown's menu — the content loader every\n * `HarnessLoader` method on this class runs through, `getItems()` included.\n *\n * Scoped by the published id rather than by `.wr-dropdown-menu`: the overlay\n * container is shared, so a bare class query would answer with whichever\n * dropdown happened to open first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.menuId()}`);\n }\n\n /** This dropdown's menu element in the overlay. */\n protected async menu(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.menuId()}`)();\n }\n\n /** The id the trigger publishes as `aria-controls`, which its menu carries. */\n private async menuId(): Promise<string> {\n const id = await (await this.host()).getAttribute('aria-controls');\n if (!id) {\n throw new Error(\n 'WrDropdownHarness: the menu is closed, so there is nothing inside it to read — call open() ' +\n 'first. The trigger publishes `aria-controls` only while its menu is open.'\n );\n }\n return id;\n }\n}\n\n/**\n * Test harness for an item carrying `[wrDropdownSubmenu]`, and the submenu it\n * opens. Usually reached through `openSubmenu()` on the level above.\n *\n * It is a `WrDropdownHarness` whose trigger is the item, so everything that\n * reads a menu reads the submenu, scoped the same way, by the id the item\n * publishes. Two things differ. `hoverTrigger()` opens nothing by itself: the\n * item waits out its `showDelay`, which is the spec's own fake timer to\n * advance. And clicking a leaf item closes every submenu, so `clickItem()`\n * leaves this one closed, while the root menu stays open as it always has.\n *\n * Which side the submenu opened on is not readable: jsdom has no layout.\n *\n * @example\n * ```ts\n * const file = await loader.getHarness(WrDropdownHarness.with({ text: 'File' }));\n * const exportAs = await file.openSubmenu('Export');\n *\n * expect(await exportAs.getItemTexts()).toEqual(['CSV', 'PDF', 'Excel']);\n * await exportAs.clickItem({ text: 'CSV' });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrDropdownSubmenuHarness extends WrDropdownHarness {\n /** The class the directive puts on its item. */\n static override hostSelector = '.wr-dropdown-submenu-trigger';\n\n /** Open the submenu with a click on its item. */\n override async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownSubmenuHarness.open(): clicking the item did not open its submenu. A disabled item ' +\n 'opens nothing, and neither does one whose own menu has closed; check isOpen() on the level above.'\n );\n }\n\n /**\n * Open the submenu from the keyboard, with Enter on its item. Enter rather\n * than the arrow because the arrow that opens a submenu depends on the\n * reading direction, and Enter does not.\n */\n override async openByKeyboard(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).sendKeys(TestKey.ENTER);\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrDropdownSubmenuHarness.openByKeyboard(): Enter on the item did not open its submenu. Enter ' +\n 'reaches it through `<wr-dropdown-item>`, so check that the directive sits on one and that it is enabled.'\n );\n }\n\n /** Close the submenu with Escape typed inside it, which closes this level only. */\n override async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.menu()).sendKeys(TestKey.ESCAPE);\n if (!(await this.isOpen())) return;\n\n throw new Error('WrDropdownSubmenuHarness.close(): the submenu is still open after Escape was typed in it.');\n }\n}\n"],"mappings":";;;;;;;AAuBA,IAAa,wBAAb,MAAa,8BAA8B,iBAAgB;CAEzD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAwC,CAAA,GAAE;EACpD,OAAO,IAAI,iBAAiB,uBAAuB,OAAO,CAAC,CACxD,UAAU,QAAQ,QAAQ,OAAO,SAAS,SAAS,iBAAiB,cAAc,QAAQ,QAAO,GAAI,IAAI,CAAC,CAAC,CAC3G,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ,CAAC,CAC/G,UAAU,WAAW,QAAQ,SAAS,OAAO,SAAS,YAAa,MAAM,QAAQ,UAAS,MAAQ,OAAO;CAC9G;CAGA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,WAAW,0BAA0B,CAAC,CAAA,EA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,CAAI,SAAS,QAAQ,MAAM;EACjD,IAAI,CAAE,MAAM,KAAK,OAAM,GAAK;EAE5B,MAAM,IAAI,MAAM,2FAA2F;CAC7G"}
|
|
@@ -291,7 +291,7 @@ var WrDropdown = class WrDropdown {
|
|
|
291
291
|
onOverlayMouseLeave = (event) => this.onMenusLeave(event.relatedTarget);
|
|
292
292
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
293
293
|
minVersion: "12.0.0",
|
|
294
|
-
version: "22.
|
|
294
|
+
version: "22.3.0",
|
|
295
295
|
ngImport: i0,
|
|
296
296
|
type: WrDropdown,
|
|
297
297
|
deps: [],
|
|
@@ -299,7 +299,7 @@ var WrDropdown = class WrDropdown {
|
|
|
299
299
|
});
|
|
300
300
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
301
301
|
minVersion: "17.1.0",
|
|
302
|
-
version: "22.
|
|
302
|
+
version: "22.3.0",
|
|
303
303
|
type: WrDropdown,
|
|
304
304
|
isStandalone: true,
|
|
305
305
|
selector: "[wrDropdown]",
|
|
@@ -380,7 +380,7 @@ var WrDropdown = class WrDropdown {
|
|
|
380
380
|
};
|
|
381
381
|
i0.ɵɵngDeclareClassMetadata({
|
|
382
382
|
minVersion: "12.0.0",
|
|
383
|
-
version: "22.
|
|
383
|
+
version: "22.3.0",
|
|
384
384
|
ngImport: i0,
|
|
385
385
|
type: WrDropdown,
|
|
386
386
|
decorators: [{
|
|
@@ -486,7 +486,7 @@ var WrDropdownMenu = class WrDropdownMenu {
|
|
|
486
486
|
triggerId = signal(null, ...ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []);
|
|
487
487
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
488
488
|
minVersion: "12.0.0",
|
|
489
|
-
version: "22.
|
|
489
|
+
version: "22.3.0",
|
|
490
490
|
ngImport: i0,
|
|
491
491
|
type: WrDropdownMenu,
|
|
492
492
|
deps: [],
|
|
@@ -494,7 +494,7 @@ var WrDropdownMenu = class WrDropdownMenu {
|
|
|
494
494
|
});
|
|
495
495
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
496
496
|
minVersion: "17.2.0",
|
|
497
|
-
version: "22.
|
|
497
|
+
version: "22.3.0",
|
|
498
498
|
type: WrDropdownMenu,
|
|
499
499
|
isStandalone: true,
|
|
500
500
|
selector: "wr-dropdown-menu",
|
|
@@ -515,7 +515,7 @@ var WrDropdownMenu = class WrDropdownMenu {
|
|
|
515
515
|
};
|
|
516
516
|
i0.ɵɵngDeclareClassMetadata({
|
|
517
517
|
minVersion: "12.0.0",
|
|
518
|
-
version: "22.
|
|
518
|
+
version: "22.3.0",
|
|
519
519
|
ngImport: i0,
|
|
520
520
|
type: WrDropdownMenu,
|
|
521
521
|
decorators: [{
|
|
@@ -549,8 +549,19 @@ var WrDropdownItem = class WrDropdownItem {
|
|
|
549
549
|
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
550
550
|
transform: coerceBooleanProperty
|
|
551
551
|
});
|
|
552
|
+
checked = input(null, ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
|
|
553
|
+
radio = input(false, {
|
|
554
|
+
...ngDevMode ? { debugName: "radio" } : /* istanbul ignore next */ {},
|
|
555
|
+
transform: coerceBooleanProperty
|
|
556
|
+
});
|
|
557
|
+
role = computed(() => {
|
|
558
|
+
if (this.checked() === null) return "menuitem";
|
|
559
|
+
return this.radio() ? "menuitemradio" : "menuitemcheckbox";
|
|
560
|
+
}, ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
|
|
552
561
|
classes = computed(() => {
|
|
553
562
|
const parts = [];
|
|
563
|
+
if (this.checked() !== null) parts.push("wr-dropdown-item--checkable");
|
|
564
|
+
if (this.checked()) parts.push("wr-dropdown-item--checked");
|
|
554
565
|
if (this.disabled()) parts.push("wr-dropdown-item--disabled");
|
|
555
566
|
return parts.join(" ");
|
|
556
567
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
@@ -562,7 +573,7 @@ var WrDropdownItem = class WrDropdownItem {
|
|
|
562
573
|
}
|
|
563
574
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
564
575
|
minVersion: "12.0.0",
|
|
565
|
-
version: "22.
|
|
576
|
+
version: "22.3.0",
|
|
566
577
|
ngImport: i0,
|
|
567
578
|
type: WrDropdownItem,
|
|
568
579
|
deps: [],
|
|
@@ -570,7 +581,7 @@ var WrDropdownItem = class WrDropdownItem {
|
|
|
570
581
|
});
|
|
571
582
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
572
583
|
minVersion: "17.0.0",
|
|
573
|
-
version: "22.
|
|
584
|
+
version: "22.3.0",
|
|
574
585
|
type: WrDropdownItem,
|
|
575
586
|
isStandalone: true,
|
|
576
587
|
selector: "wr-dropdown-item",
|
|
@@ -588,23 +599,38 @@ var WrDropdownItem = class WrDropdownItem {
|
|
|
588
599
|
isSignal: true,
|
|
589
600
|
isRequired: false,
|
|
590
601
|
transformFunction: null
|
|
602
|
+
},
|
|
603
|
+
checked: {
|
|
604
|
+
classPropertyName: "checked",
|
|
605
|
+
publicName: "checked",
|
|
606
|
+
isSignal: true,
|
|
607
|
+
isRequired: false,
|
|
608
|
+
transformFunction: null
|
|
609
|
+
},
|
|
610
|
+
radio: {
|
|
611
|
+
classPropertyName: "radio",
|
|
612
|
+
publicName: "radio",
|
|
613
|
+
isSignal: true,
|
|
614
|
+
isRequired: false,
|
|
615
|
+
transformFunction: null
|
|
591
616
|
}
|
|
592
617
|
},
|
|
593
618
|
host: {
|
|
594
|
-
attributes: { "role": "menuitem" },
|
|
595
619
|
listeners: {
|
|
596
620
|
"keydown.enter": "activate($event)",
|
|
597
621
|
"keydown.space": "activate($event)"
|
|
598
622
|
},
|
|
599
623
|
properties: {
|
|
624
|
+
"attr.role": "role()",
|
|
600
625
|
"class": "classes()",
|
|
601
626
|
"attr.tabindex": "-1",
|
|
627
|
+
"attr.aria-checked": "checked() === null ? null : checked()",
|
|
602
628
|
"attr.aria-disabled": "disabled() ? true : null"
|
|
603
629
|
},
|
|
604
630
|
classAttribute: "wr-dropdown-item"
|
|
605
631
|
},
|
|
606
632
|
ngImport: i0,
|
|
607
|
-
template: "@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n",
|
|
633
|
+
template: "@if (checked() !== null) {\n <span class=\"wr-dropdown-item__check\" aria-hidden=\"true\">\n @if (checked()) {\n <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <path d=\"m4 8.5 3 3 5-6\" stroke-linejoin=\"round\" />\n </svg>\n }\n </span>\n}\n@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n",
|
|
608
634
|
dependencies: [{
|
|
609
635
|
kind: "component",
|
|
610
636
|
type: WrIcon,
|
|
@@ -616,7 +642,7 @@ var WrDropdownItem = class WrDropdownItem {
|
|
|
616
642
|
};
|
|
617
643
|
i0.ɵɵngDeclareClassMetadata({
|
|
618
644
|
minVersion: "12.0.0",
|
|
619
|
-
version: "22.
|
|
645
|
+
version: "22.3.0",
|
|
620
646
|
ngImport: i0,
|
|
621
647
|
type: WrDropdownItem,
|
|
622
648
|
decorators: [{
|
|
@@ -625,16 +651,17 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
625
651
|
selector: "wr-dropdown-item",
|
|
626
652
|
encapsulation: ViewEncapsulation.None,
|
|
627
653
|
host: {
|
|
628
|
-
role: "
|
|
654
|
+
"[attr.role]": "role()",
|
|
629
655
|
class: "wr-dropdown-item",
|
|
630
656
|
"[class]": "classes()",
|
|
631
657
|
"[attr.tabindex]": "-1",
|
|
658
|
+
"[attr.aria-checked]": "checked() === null ? null : checked()",
|
|
632
659
|
"[attr.aria-disabled]": "disabled() ? true : null",
|
|
633
660
|
"(keydown.enter)": "activate($event)",
|
|
634
661
|
"(keydown.space)": "activate($event)"
|
|
635
662
|
},
|
|
636
663
|
imports: [WrIcon],
|
|
637
|
-
template: "@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n"
|
|
664
|
+
template: "@if (checked() !== null) {\n <span class=\"wr-dropdown-item__check\" aria-hidden=\"true\">\n @if (checked()) {\n <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <path d=\"m4 8.5 3 3 5-6\" stroke-linejoin=\"round\" />\n </svg>\n }\n </span>\n}\n@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n"
|
|
638
665
|
}]
|
|
639
666
|
}],
|
|
640
667
|
ctorParameters: () => [],
|
|
@@ -654,6 +681,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
654
681
|
alias: "disabled",
|
|
655
682
|
required: false
|
|
656
683
|
}]
|
|
684
|
+
}],
|
|
685
|
+
checked: [{
|
|
686
|
+
type: i0.Input,
|
|
687
|
+
args: [{
|
|
688
|
+
isSignal: true,
|
|
689
|
+
alias: "checked",
|
|
690
|
+
required: false
|
|
691
|
+
}]
|
|
692
|
+
}],
|
|
693
|
+
radio: [{
|
|
694
|
+
type: i0.Input,
|
|
695
|
+
args: [{
|
|
696
|
+
isSignal: true,
|
|
697
|
+
alias: "radio",
|
|
698
|
+
required: false
|
|
699
|
+
}]
|
|
657
700
|
}]
|
|
658
701
|
}
|
|
659
702
|
});
|
|
@@ -837,7 +880,7 @@ var WrDropdownSubmenu = class WrDropdownSubmenu {
|
|
|
837
880
|
};
|
|
838
881
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
839
882
|
minVersion: "12.0.0",
|
|
840
|
-
version: "22.
|
|
883
|
+
version: "22.3.0",
|
|
841
884
|
ngImport: i0,
|
|
842
885
|
type: WrDropdownSubmenu,
|
|
843
886
|
deps: [],
|
|
@@ -845,7 +888,7 @@ var WrDropdownSubmenu = class WrDropdownSubmenu {
|
|
|
845
888
|
});
|
|
846
889
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
847
890
|
minVersion: "17.1.0",
|
|
848
|
-
version: "22.
|
|
891
|
+
version: "22.3.0",
|
|
849
892
|
type: WrDropdownSubmenu,
|
|
850
893
|
isStandalone: true,
|
|
851
894
|
selector: "[wrDropdownSubmenu]",
|
|
@@ -893,7 +936,7 @@ var WrDropdownSubmenu = class WrDropdownSubmenu {
|
|
|
893
936
|
};
|
|
894
937
|
i0.ɵɵngDeclareClassMetadata({
|
|
895
938
|
minVersion: "12.0.0",
|
|
896
|
-
version: "22.
|
|
939
|
+
version: "22.3.0",
|
|
897
940
|
ngImport: i0,
|
|
898
941
|
type: WrDropdownSubmenu,
|
|
899
942
|
decorators: [{
|