ngwr 14.3.1 → 14.4.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 +1 -1
- package/avatar/styles/_index.scss +4 -2
- package/badge/styles/_index.scss +4 -1
- package/badge/styles/_tag.scss +3 -0
- package/cascader/styles/_rules.scss +3 -0
- package/command-palette/styles/_index.scss +23 -0
- package/context-menu/styles/_index.scss +13 -1
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs +17 -4
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +4 -4
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-aurora.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-bar-chart-testing.mjs +18 -2
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs +3 -3
- package/fesm2022/ngwr-border-glow.mjs +3 -3
- package/fesm2022/ngwr-breadcrumbs.mjs +6 -6
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs +12 -9
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +35 -7
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +32 -4
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader-testing.mjs +87 -17
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +63 -4
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs +13 -2
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +42 -7
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +3 -3
- package/fesm2022/ngwr-click-spark.mjs +3 -3
- 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 +16 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-confetti.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
- package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
- package/fesm2022/ngwr-date-picker.mjs +81 -26
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +3 -3
- package/fesm2022/ngwr-decrypt-text.mjs +3 -3
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +15 -15
- package/fesm2022/ngwr-directives.mjs +12 -12
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-donut-chart-testing.mjs +18 -2
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +4 -4
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +6 -6
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-dropdown.mjs +32 -14
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +6 -6
- package/fesm2022/ngwr-falling-text.mjs +3 -3
- package/fesm2022/ngwr-file-upload.mjs +18 -5
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +66 -14
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
- package/fesm2022/ngwr-gauge-testing.mjs +16 -2
- package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +3 -3
- package/fesm2022/ngwr-glitch-text.mjs +3 -3
- package/fesm2022/ngwr-gradient-text.mjs +3 -3
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +2 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +2 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +2 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +14 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +2 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +2 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +2 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +2 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +2 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +2 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +2 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +2 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +2 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +2 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +2 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +2 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +2 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +2 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +2 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +2 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +2 -0
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +2 -0
- 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 +3 -3
- package/fesm2022/ngwr-input-number.mjs +15 -6
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +38 -6
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob-testing.mjs +11 -3
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +19 -4
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +3 -3
- package/fesm2022/ngwr-line-chart-testing.mjs +18 -2
- package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +22 -4
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +6 -6
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-markdown.mjs +6 -6
- package/fesm2022/ngwr-marquee.mjs +3 -3
- package/fesm2022/ngwr-media.mjs +3 -3
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-meter-group.mjs +3 -3
- package/fesm2022/ngwr-overlay.mjs +6 -6
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +33 -6
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +21 -21
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +6 -6
- package/fesm2022/ngwr-popover.mjs +29 -11
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +3 -3
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating-testing.mjs +12 -3
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +19 -4
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +13 -13
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text.mjs +3 -3
- package/fesm2022/ngwr-schema-form.mjs +3 -3
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select.mjs +9 -9
- package/fesm2022/ngwr-shiny-text.mjs +6 -6
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +18 -5
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +3 -3
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splash-cursor.mjs +3 -3
- package/fesm2022/ngwr-split-text.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-spotlight-card.mjs +6 -6
- package/fesm2022/ngwr-squircle.mjs +28 -9
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +20 -13
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- 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.mjs +18 -18
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs.mjs +6 -6
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-tilt-card.mjs +6 -6
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +10 -10
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-transfer.mjs +88 -11
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +24 -0
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +72 -7
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +3 -3
- package/fesm2022/ngwr-typography.mjs +3 -3
- 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-waves.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +12 -12
- package/form/styles/_index.scss +63 -0
- package/i18n/ar.json +4 -2
- package/i18n/cs.json +4 -2
- package/i18n/de.json +4 -2
- package/i18n/en.json +6 -4
- 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/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/input-otp/styles/_index.scss +5 -1
- package/line-chart/styles/_index.scss +5 -3
- package/llms-full.txt +1 -1
- package/markdown/styles/_index.scss +4 -1
- package/mention/styles/_index.scss +22 -1
- package/package.json +1 -1
- package/radio/styles/_index.scss +3 -0
- package/result/styles/_index.scss +12 -0
- package/schematics/migrations/v14/index.js +6 -3
- package/schematics/migrations.json +1 -1
- package/schematics/ng-add/index.js +34 -5
- package/segmented/styles/_index.scss +4 -1
- package/select/styles/_index.scss +20 -1
- package/statistic/styles/_index.scss +4 -0
- package/stepper/styles/_index.scss +36 -0
- package/switch/styles/_index.scss +3 -0
- package/table/styles/_index.scss +12 -0
- package/tabs/styles/_index.scss +4 -1
- package/textarea/styles/_index.scss +6 -1
- package/theme/styles/_colors.scss +11 -0
- package/theme/styles/_contrast.scss +136 -0
- package/theme/styles/_index.scss +1 -0
- package/theme/styles/_mixins.scss +15 -8
- package/timeline/styles/_index.scss +28 -1
- package/toast/styles/_index.scss +11 -0
- package/tree/styles/_index.scss +27 -1
- package/types/ngwr-badge.d.ts +1 -1
- package/types/ngwr-bar-chart-testing.d.ts +11 -1
- package/types/ngwr-button.d.ts +1 -1
- package/types/ngwr-calendar-heatmap-testing.d.ts +10 -5
- package/types/ngwr-calendar-heatmap.d.ts +22 -0
- package/types/ngwr-calendar.d.ts +21 -0
- package/types/ngwr-cascader-testing.d.ts +74 -17
- package/types/ngwr-cascader.d.ts +28 -0
- package/types/ngwr-checkbox-testing.d.ts +12 -1
- package/types/ngwr-checkbox.d.ts +10 -0
- package/types/ngwr-clipboard.d.ts +1 -1
- package/types/ngwr-confetti.d.ts +1 -1
- package/types/ngwr-cookie.d.ts +1 -1
- package/types/ngwr-date-adapters-fns.d.ts +1 -1
- package/types/ngwr-date-adapters-luxon.d.ts +1 -1
- package/types/ngwr-date.d.ts +9 -3
- package/types/ngwr-density.d.ts +1 -1
- package/types/ngwr-dialog.d.ts +1 -1
- package/types/ngwr-donut-chart-testing.d.ts +11 -1
- package/types/ngwr-drawer.d.ts +1 -1
- package/types/ngwr-dropdown.d.ts +16 -0
- package/types/ngwr-file-upload.d.ts +11 -0
- package/types/ngwr-form.d.ts +25 -0
- package/types/ngwr-gauge-testing.d.ts +9 -1
- package/types/ngwr-hotkey.d.ts +1 -1
- package/types/ngwr-i18n.d.ts +1 -1
- package/types/ngwr-input-number.d.ts +12 -2
- package/types/ngwr-input-otp.d.ts +12 -0
- package/types/ngwr-knob-testing.d.ts +11 -3
- package/types/ngwr-knob.d.ts +13 -0
- package/types/ngwr-line-chart-testing.d.ts +11 -1
- package/types/ngwr-line-chart.d.ts +18 -0
- package/types/ngwr-loading-bar.d.ts +1 -1
- package/types/ngwr-markdown.d.ts +1 -1
- package/types/ngwr-media.d.ts +1 -1
- package/types/ngwr-meta.d.ts +1 -1
- package/types/ngwr-overlay.d.ts +2 -2
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-platform.d.ts +3 -3
- package/types/ngwr-popover.d.ts +16 -0
- package/types/ngwr-rating-testing.d.ts +12 -3
- package/types/ngwr-rating.d.ts +13 -0
- package/types/ngwr-scroll.d.ts +1 -1
- package/types/ngwr-squircle.d.ts +22 -3
- package/types/ngwr-statistic.d.ts +0 -1
- package/types/ngwr-storage.d.ts +1 -1
- package/types/ngwr-theme.d.ts +1 -1
- package/types/ngwr-toast.d.ts +1 -1
- package/types/ngwr-tour.d.ts +1 -1
- package/types/ngwr-transfer.d.ts +52 -0
- package/types/ngwr-tree-testing.d.ts +20 -0
- package/types/ngwr-tree.d.ts +41 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +1 -1
- package/typography/styles/_index.scss +26 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-cascader.mjs","sources":["../../../projects/lib/cascader/cascader.ts","../../../projects/lib/cascader/cascader.html","../../../projects/lib/cascader/ngwr-cascader.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick } from 'ngwr/overlay';\n\nimport type { WrCascaderOption } from './interfaces';\n\nlet panelUid = 0;\n\n/**\n * Multi-level select — drills down through hierarchical categories\n * (e.g. country → state → city). Each level renders as a column; clicks\n * advance to the next column. Selecting a leaf (no children) commits\n * the full path.\n *\n * A signal-forms native control: it implements `FormValueControl<unknown>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. The value\n * is the path through the tree (an array from root to leaf).\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-cascader [options]=\"locations\" [formField]=\"form.path\" placeholder=\"Pick a location\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-cascader [options]=\"locations\" [(value)]=\"path\" placeholder=\"Pick a location\" />\n * ```\n *\n * ```ts\n * locations: WrCascaderOption[] = [\n * {\n * value: 'us', label: 'United States', children: [\n * { value: 'ny', label: 'New York', children: [\n * { value: 'nyc', label: 'NYC' },\n * { value: 'buf', label: 'Buffalo' },\n * ] },\n * ],\n * },\n * ];\n * ```\n *\n * @see https://ngwr.dev/reference/components/cascader\n */\nexport type WrCascaderSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-cascader',\n templateUrl: './cascader.html',\n styleUrl: './cascader.scss',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n})\nexport class WrCascader<T = string> implements FormValueControl<unknown> {\n /** Accessible name. Falls back to `select.clearSelection`, then `'Clear selection'`. */\n readonly clearLabel = input<string | null>(null);\n\n protected readonly resolvedClearLabel = useI18nText(this.clearLabel, 'select.clearSelection', 'Clear selection');\n\n /** Root-level options. Each may have `children` for deeper levels. */\n readonly options = input.required<readonly WrCascaderOption<T>[]>();\n\n /** Placeholder shown when no path is selected. @default '' */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name of the trigger. Falls back to the placeholder, then to\n * `select.label` — a `role=\"combobox\"` with nothing selected and no\n * placeholder otherwise has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly labelText = useI18nText(this.ariaLabel, 'select.label', 'Select');\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder must fall through to the catalog string.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.placeholder();\n return placeholder ? placeholder : this.labelText();\n });\n\n /**\n * Disable the cascader. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while the trigger stays focusable and the path still submits.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The panel is where every edit happens, so a read-only cascader simply does\n * not open — there is nothing to browse that is not already on the trigger —\n * and the clear button goes away with it. Mirrored as `aria-readonly`, which\n * role `combobox` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrCascaderSize>('md');\n\n /** Show a clear-all (×) button on the trigger when a path is selected. @default true */\n readonly clearable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Allow selecting non-leaf (parent) nodes. When `false`, only leaves\n * (nodes without children) commit a selection. @default false\n */\n readonly changeOnSelect = input(false, { transform: coerceBooleanProperty });\n\n /** Separator between labels in the trigger display. @default '/' */\n readonly separator = input<string>('/');\n\n /**\n * Committed selection path (full array from root to leaf). Bound by\n * `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<unknown>([]);\n\n /** Emitted on blur / commit so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** Committed selection path (full T[] from root to leaf). @internal */\n protected readonly path = signal<readonly T[]>([]);\n\n /** Currently-expanded column path — drives which columns the panel shows. @internal */\n protected readonly activePath = signal<readonly T[]>([]);\n\n protected readonly open = signal(false);\n\n /** Panel id used by the trigger's `aria-controls`. */\n protected readonly panelId = `wr-cascader-panel-${++panelUid}`;\n\n /**\n * Columns visible in the panel. Each column shows the children of the\n * preceding activePath entry. Column 0 = root options. The last\n * column is whatever the deepest active node's children resolve to —\n * we only render a column when there are children to show.\n */\n protected readonly columns = computed<readonly (readonly WrCascaderOption<T>[])[]>(() => {\n const cols: (readonly WrCascaderOption<T>[])[] = [this.options()];\n const trail = this.activePath();\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of trail) {\n const node = list.find(o => o.value === v);\n if (!node?.children?.length) break;\n cols.push(node.children);\n list = node.children;\n }\n return cols;\n });\n\n /** Label trail joined by `separator()` — what the trigger shows. */\n protected readonly displayLabel = computed(() => {\n const p = this.path();\n if (p.length === 0) return null;\n const labels: string[] = [];\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of p) {\n const node = list.find(o => o.value === v);\n if (!node) return null;\n labels.push(node.label);\n list = node.children ?? [];\n }\n const sep = ` ${this.separator()} `;\n return labels.join(sep);\n });\n\n protected readonly hasSelection = computed(() => this.path().length > 0);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-cascader'];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-cascader--${size}`);\n if (this.open()) parts.push('wr-cascader--open');\n if (this.disabled()) parts.push('wr-cascader--disabled');\n else if (this.readonly()) parts.push('wr-cascader--readonly');\n return parts.join(' ');\n });\n\n protected readonly panelTpl = viewChild.required('panelTpl', { read: TemplateRef });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // Same contract as wr-select / wr-dropdown / wr-lightbox: an overlay lives in\n // the CDK container, not in this component's view, so destroying the\n // component while the panel is open would strand the pane and its scroll\n // strategy.\n this.destroyRef.onDestroy(() => this.closeOverlay());\n\n effect(() => {\n if (this.open()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n\n // Close the panel if the control becomes disabled or read-only while open.\n effect(() => {\n if (this.disabled() || this.readonly()) this.open.set(false);\n });\n\n // Mirror an external `value` write into the internal path/activePath\n // (the old `writeValue`). Skipped when the write merely echoes the\n // committed path, so a live drill-down can never be clobbered.\n effect(() => {\n // Coerce null/undefined/non-array to an empty path — a classic-forms\n // binding can write null, which the old `writeValue(value: unknown)`\n // treated as \"no selection\" too.\n const value = this.value();\n untracked(() => {\n const next: readonly T[] = Array.isArray(value) ? (value as readonly T[]) : [];\n if (this.pathsEqual(this.path(), next)) return;\n this.path.set(next);\n this.activePath.set(next);\n });\n });\n }\n\n // Template handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n if (!this.open()) this.activePath.set(this.path());\n this.open.update(v => !v);\n }\n\n /**\n * ArrowDown / ArrowUp open the panel, Alt+ArrowDown included — the combobox way in,\n * and the shape `wr-dropdown`'s trigger uses. Enter and Space need no branch: the\n * trigger is a real `<button>`, so the browser turns them into the click above.\n *\n * Only while closed. Once the panel is up the caret is inside it, and its options\n * own their own keys.\n */\n protected onTriggerKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.readonly() || this.open()) return;\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n event.preventDefault();\n this.activePath.set(this.path());\n this.open.set(true);\n }\n\n protected onOptionClick(colIndex: number, opt: WrCascaderOption<T>, event: Event): void {\n event.stopPropagation();\n if (opt.disabled || this.disabled() || this.readonly()) return;\n\n const head = this.activePath().slice(0, colIndex);\n const newPath = [...head, opt.value];\n\n const hasChildren = !!opt.children?.length;\n\n // Always update active column for visual feedback / next column.\n this.activePath.set(newPath);\n\n // Commit when we've reached a leaf, or when changeOnSelect is on.\n if (!hasChildren || this.changeOnSelect()) {\n this.path.set(newPath);\n this.value.set(newPath);\n this.touch.emit();\n // Close once we hit a true leaf — parent commits keep the panel open.\n if (!hasChildren) this.open.set(false);\n }\n }\n\n protected clearSelection(event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n this.path.set([]);\n this.activePath.set([]);\n this.value.set([]);\n this.touch.emit();\n }\n\n protected isActiveAt(colIndex: number, value: T): boolean {\n return this.activePath()[colIndex] === value;\n }\n\n private pathsEqual(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n }\n\n // Overlay\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: 'wr-cascader-overlay',\n });\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Move the caret into the panel it just opened. Nothing did, and the pane is\n // appended to `<body>`, so an opened cascader left focus on the trigger and its\n // options were reachable only by tabbing past the whole rest of the page —\n // `wr-tree` and `wr-context-menu` were the same defect. `closeOverlay` below\n // already assumes this is where the caret lives.\n //\n // `afterNextRender`, NOT `queueMicrotask`: under zoneless CD change detection runs\n // in a macrotask, so a microtask queued here fires before the columns are in the\n // DOM — the trap that once left `wr-calendar`'s ring and its real focus on\n // different days.\n afterNextRender(() => this.focusPanelOption(), { injector: this.injector });\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.open.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n\n /**\n * The option the panel opens on: the selected one in the first column when there is\n * a selection, otherwise the first enabled root. A disabled option is skipped — it\n * still carries `tabindex=\"-1\"`, so `focus()` would land on it and answer for a\n * choice nobody can make.\n */\n private focusPanelOption(): void {\n const pane = this.overlayRef?.overlayElement;\n if (!pane) return;\n const option =\n pane.querySelector<HTMLElement>('.wr-cascader__opt--active:not(.wr-cascader__opt--disabled)') ??\n pane.querySelector<HTMLElement>('.wr-cascader__opt:not(.wr-cascader__opt--disabled)');\n option?.focus();\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n // Every enabled option carries `tabindex=\"0\"` and commits on Enter, so on\n // the keyboard the caret is INSIDE the pane by design — and the ordinary\n // way to finish choosing (`onOptionClick` on a leaf) closes it. Disposing\n // without handing focus back dropped it on `<body>` on the SUCCESS path,\n // not merely on dismissal: a keyboard user who had just picked a value then\n // had to Tab from the top of the document to get back to the control.\n // Untouched when focus had already moved elsewhere — that click is usually\n // what closed us, and stealing the caret back would fight the user for it.\n const pane = this.overlayRef.overlayElement;\n const focusWasInside = pane.contains(this.host.nativeElement.ownerDocument.activeElement);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (focusWasInside) this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus();\n }\n}\n\nexport type { WrCascaderOption } from './interfaces';\n","<button\n type=\"button\"\n class=\"wr-cascader__trigger\"\n role=\"combobox\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [disabled]=\"disabled()\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (blur)=\"touch.emit()\"\n>\n @if (displayLabel(); as label) {\n <span class=\"wr-cascader__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-cascader__placeholder\">{{ placeholder() }}</span>\n }\n\n @if (clearable() && hasSelection() && !disabled() && !readonly()) {\n <span\n class=\"wr-cascader__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClearLabel()\"\n tabindex=\"-1\"\n (click)=\"clearSelection($event)\"\n (keydown.enter)=\"clearSelection($event)\"\n (keydown.space)=\"clearSelection($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-cascader__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n</button>\n\n<ng-template #panelTpl>\n <div\n class=\"wr-cascader-panel\"\n [class.wr-cascader-panel--sm]=\"size() === 'sm'\"\n [class.wr-cascader-panel--lg]=\"size() === 'lg'\"\n role=\"menu\"\n [attr.id]=\"panelId\"\n >\n @for (col of columns(); track $index; let colIndex = $index) {\n <ul class=\"wr-cascader__col\" role=\"menu\">\n @for (opt of col; track opt.value) {\n <li\n class=\"wr-cascader__opt\"\n role=\"menuitem\"\n [class.wr-cascader__opt--active]=\"isActiveAt(colIndex, opt.value)\"\n [class.wr-cascader__opt--disabled]=\"opt.disabled\"\n [attr.tabindex]=\"opt.disabled ? -1 : 0\"\n [attr.aria-disabled]=\"opt.disabled ? true : null\"\n (click)=\"onOptionClick(colIndex, opt, $event)\"\n (keydown.enter)=\"onOptionClick(colIndex, opt, $event)\"\n (keydown.space)=\"onOptionClick(colIndex, opt, $event)\"\n >\n <span class=\"wr-cascader__opt-label\">{{ opt.label }}</span>\n @if (opt.children?.length) {\n <svg\n class=\"wr-icon__svg wr-cascader__opt-arrow\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n }\n </li>\n }\n </ul>\n }\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAiCH,IAAI,QAAQ,GAAG,CAAC;MA8CH,UAAU,CAAA;;IAEZ,UAAU,GAAG,KAAK,CAAgB,IAAI;mFAAC;IAE7B,kBAAkB,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;;IAGvG,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAkC;;IAG1D,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;AAExC;;;;AAIG;IACM,SAAS,GAAG,KAAK,CAAgB,IAAI;kFAAC;IAE9B,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC;AAC/D,IAAA,iBAAiB,GAAG,QAAQ,CAAC,MAAK;;AAEnD,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE;AACjC,QAAA,IAAI,QAAQ;AAAE,YAAA,OAAO,QAAQ;AAC7B,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE;AACtC,QAAA,OAAO,WAAW,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE;IACrD,CAAC;0FA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KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,UAAU,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3NpF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-cascader.mjs","sources":["../../../projects/lib/cascader/cascader.ts","../../../projects/lib/cascader/cascader.html","../../../projects/lib/cascader/ngwr-cascader.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick } from 'ngwr/overlay';\n\nimport type { WrCascaderOption } from './interfaces';\n\nlet panelUid = 0;\n\n/**\n * Multi-level select — drills down through hierarchical categories\n * (e.g. country → state → city). Each level renders as a column; clicks\n * advance to the next column. Selecting a leaf (no children) commits\n * the full path.\n *\n * A signal-forms native control: it implements `FormValueControl<unknown>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. The value\n * is the path through the tree (an array from root to leaf).\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-cascader [options]=\"locations\" [formField]=\"form.path\" placeholder=\"Pick a location\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-cascader [options]=\"locations\" [(value)]=\"path\" placeholder=\"Pick a location\" />\n * ```\n *\n * ```ts\n * locations: WrCascaderOption[] = [\n * {\n * value: 'us', label: 'United States', children: [\n * { value: 'ny', label: 'New York', children: [\n * { value: 'nyc', label: 'NYC' },\n * { value: 'buf', label: 'Buffalo' },\n * ] },\n * ],\n * },\n * ];\n * ```\n *\n * @see https://ngwr.dev/reference/components/cascader\n */\nexport type WrCascaderSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-cascader',\n templateUrl: './cascader.html',\n styleUrl: './cascader.scss',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n})\nexport class WrCascader<T = string> implements FormValueControl<unknown> {\n /** Accessible name. Falls back to `select.clearSelection`, then `'Clear selection'`. */\n readonly clearLabel = input<string | null>(null);\n\n protected readonly resolvedClearLabel = useI18nText(this.clearLabel, 'select.clearSelection', 'Clear selection');\n\n /** Root-level options. Each may have `children` for deeper levels. */\n readonly options = input.required<readonly WrCascaderOption<T>[]>();\n\n /** Placeholder shown when no path is selected. @default '' */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name of the trigger. Falls back to the placeholder, then to\n * `select.label` — a `role=\"combobox\"` with nothing selected and no\n * placeholder otherwise has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly labelText = useI18nText(this.ariaLabel, 'select.label', 'Select');\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder must fall through to the catalog string.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.placeholder();\n return placeholder ? placeholder : this.labelText();\n });\n\n /**\n * Disable the cascader. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes while the trigger stays focusable and the path still submits.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The panel is where every edit happens, so a read-only cascader simply does\n * not open — there is nothing to browse that is not already on the trigger —\n * and the clear button goes away with it. Mirrored as `aria-readonly`, which\n * role `combobox` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrCascaderSize>('md');\n\n /** Show a clear-all (×) button on the trigger when a path is selected. @default true */\n readonly clearable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Allow selecting non-leaf (parent) nodes. When `false`, only leaves\n * (nodes without children) commit a selection. @default false\n */\n readonly changeOnSelect = input(false, { transform: coerceBooleanProperty });\n\n /** Separator between labels in the trigger display. @default '/' */\n readonly separator = input<string>('/');\n\n /**\n * Committed selection path (full array from root to leaf). Bound by\n * `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<unknown>([]);\n\n /** Emitted on blur / commit so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** Committed selection path (full T[] from root to leaf). @internal */\n protected readonly path = signal<readonly T[]>([]);\n\n /** Currently-expanded column path — drives which columns the panel shows. @internal */\n protected readonly activePath = signal<readonly T[]>([]);\n\n protected readonly open = signal(false);\n\n /** Panel id used by the trigger's `aria-controls`. */\n protected readonly panelId = `wr-cascader-panel-${++panelUid}`;\n\n /**\n * Columns visible in the panel. Each column shows the children of the\n * preceding activePath entry. Column 0 = root options. The last\n * column is whatever the deepest active node's children resolve to —\n * we only render a column when there are children to show.\n */\n protected readonly columns = computed<readonly (readonly WrCascaderOption<T>[])[]>(() => {\n const cols: (readonly WrCascaderOption<T>[])[] = [this.options()];\n const trail = this.activePath();\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of trail) {\n const node = list.find(o => o.value === v);\n if (!node?.children?.length) break;\n cols.push(node.children);\n list = node.children;\n }\n return cols;\n });\n\n /** Label trail joined by `separator()` — what the trigger shows. */\n protected readonly displayLabel = computed(() => {\n const p = this.path();\n if (p.length === 0) return null;\n const labels: string[] = [];\n let list: readonly WrCascaderOption<T>[] = this.options();\n for (const v of p) {\n const node = list.find(o => o.value === v);\n if (!node) return null;\n labels.push(node.label);\n list = node.children ?? [];\n }\n const sep = ` ${this.separator()} `;\n return labels.join(sep);\n });\n\n protected readonly hasSelection = computed(() => this.path().length > 0);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-cascader'];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-cascader--${size}`);\n if (this.open()) parts.push('wr-cascader--open');\n if (this.disabled()) parts.push('wr-cascader--disabled');\n else if (this.readonly()) parts.push('wr-cascader--readonly');\n return parts.join(' ');\n });\n\n protected readonly panelTpl = viewChild.required('panelTpl', { read: TemplateRef });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // Same contract as wr-select / wr-dropdown / wr-lightbox: an overlay lives in\n // the CDK container, not in this component's view, so destroying the\n // component while the panel is open would strand the pane and its scroll\n // strategy.\n this.destroyRef.onDestroy(() => this.closeOverlay());\n\n effect(() => {\n if (this.open()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n\n // Close the panel if the control becomes disabled or read-only while open.\n effect(() => {\n if (this.disabled() || this.readonly()) this.open.set(false);\n });\n\n // Mirror an external `value` write into the internal path/activePath\n // (the old `writeValue`). Skipped when the write merely echoes the\n // committed path, so a live drill-down can never be clobbered.\n effect(() => {\n // Coerce null/undefined/non-array to an empty path — a classic-forms\n // binding can write null, which the old `writeValue(value: unknown)`\n // treated as \"no selection\" too.\n const value = this.value();\n untracked(() => {\n const next: readonly T[] = Array.isArray(value) ? (value as readonly T[]) : [];\n if (this.pathsEqual(this.path(), next)) return;\n this.path.set(next);\n this.activePath.set(next);\n });\n });\n }\n\n // Template handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n if (!this.open()) this.activePath.set(this.path());\n this.open.update(v => !v);\n }\n\n /**\n * ArrowDown / ArrowUp open the panel, Alt+ArrowDown included — the combobox way in,\n * and the shape `wr-dropdown`'s trigger uses. Enter and Space need no branch: the\n * trigger is a real `<button>`, so the browser turns them into the click above.\n *\n * Only while closed. Once the panel is up the caret is inside it, and its options\n * own their own keys.\n */\n protected onTriggerKeydown(event: KeyboardEvent): void {\n if (this.disabled() || this.readonly() || this.open()) return;\n\n // Backspace is the × from the keyboard, and it has to be: the × is a\n // `tabindex=\"-1\"` span INSIDE this button, and a keydown goes to the focused\n // element, so the `(keydown.enter)` / `(keydown.space)` it used to carry could\n // never fire. Clearing was reachable by pointer alone — a WCAG 2.1.1 failure,\n // not a missing convenience. The span stays unfocusable, because a focusable\n // child of a button is `nested-interactive`. Same key, same gating as\n // `wr-select`: `clearable()` IS the clear control, so a consumer who turned\n // the × off did not ask for a keyboard twin of it.\n if (event.key === 'Backspace') {\n if (!this.clearable() || !this.hasSelection()) return;\n event.preventDefault();\n this.clearSelection(event);\n return;\n }\n\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n event.preventDefault();\n this.activePath.set(this.path());\n this.open.set(true);\n }\n\n protected onOptionClick(colIndex: number, opt: WrCascaderOption<T>, event: Event): void {\n event.stopPropagation();\n if (opt.disabled || this.disabled() || this.readonly()) return;\n\n const head = this.activePath().slice(0, colIndex);\n const newPath = [...head, opt.value];\n\n const hasChildren = !!opt.children?.length;\n\n // Always update active column for visual feedback / next column.\n this.activePath.set(newPath);\n\n // Commit when we've reached a leaf, or when changeOnSelect is on.\n if (!hasChildren || this.changeOnSelect()) {\n this.path.set(newPath);\n this.value.set(newPath);\n this.touch.emit();\n // Close once we hit a true leaf — parent commits keep the panel open.\n if (!hasChildren) this.open.set(false);\n }\n }\n\n protected clearSelection(event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n this.path.set([]);\n this.activePath.set([]);\n this.value.set([]);\n this.touch.emit();\n }\n\n protected isActiveAt(colIndex: number, value: T): boolean {\n return this.activePath()[colIndex] === value;\n }\n\n /**\n * Whether this option is the committed choice — `null` when it is not a\n * choice at all.\n *\n * Two questions the panel has to keep apart, and `--active` answers only the\n * first: `activePath()` is where the user has NAVIGATED to, `path()` is what\n * they have COMMITTED. They agree once a leaf is picked and diverge for the\n * whole walk down.\n *\n * `null` — the attribute absent — on a branch while `changeOnSelect` is off,\n * because such a branch genuinely cannot be chosen; ARIA reads a missing\n * `aria-selected` as \"not selectable\", which is exactly true here. That makes\n * this binding the first expression the `changeOnSelect` contract has ever had\n * in ARIA, in both directions.\n */\n protected isSelectedAt(colIndex: number, opt: WrCascaderOption<T>): boolean | null {\n const committable = !opt.children?.length || this.changeOnSelect();\n if (!committable) return null;\n const path = this.path();\n return colIndex === path.length - 1 && path[colIndex] === opt.value;\n }\n\n /** Stable id for one option — what a column's `aria-labelledby` points at. */\n protected optionId(colIndex: number, optIndex: number): string {\n return `${this.panelId}-opt-${colIndex}-${optIndex}`;\n }\n\n /** Stable id for one column — what an expanded branch's `aria-controls` points at. */\n protected columnId(colIndex: number): string {\n return `${this.panelId}-col-${colIndex}`;\n }\n\n /**\n * The option whose children a column holds, by id — its accessible name.\n *\n * The columns are DOM SIBLINGS, so nothing in the markup says the second one\n * belongs to \"Europe\". Column 0 has no parent and stays unnamed; the tree\n * itself already carries the control's name.\n */\n protected parentOptionId(colIndex: number): string | null {\n if (colIndex === 0) return null;\n const parent = this.columns()[colIndex - 1] ?? [];\n const index = parent.findIndex(o => this.isActiveAt(colIndex - 1, o.value));\n return index < 0 ? null : this.optionId(colIndex - 1, index);\n }\n\n private pathsEqual(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n }\n\n // Overlay\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: 'wr-cascader-overlay',\n });\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Move the caret into the panel it just opened. Nothing did, and the pane is\n // appended to `<body>`, so an opened cascader left focus on the trigger and its\n // options were reachable only by tabbing past the whole rest of the page —\n // `wr-tree` and `wr-context-menu` were the same defect. `closeOverlay` below\n // already assumes this is where the caret lives.\n //\n // `afterNextRender`, NOT `queueMicrotask`: under zoneless CD change detection runs\n // in a macrotask, so a microtask queued here fires before the columns are in the\n // DOM — the trap that once left `wr-calendar`'s ring and its real focus on\n // different days.\n afterNextRender(() => this.focusPanelOption(), { injector: this.injector });\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.open.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n\n /**\n * The option the panel opens on: the selected one in the first column when there is\n * a selection, otherwise the first enabled root. A disabled option is skipped — it\n * still carries `tabindex=\"-1\"`, so `focus()` would land on it and answer for a\n * choice nobody can make.\n */\n private focusPanelOption(): void {\n const pane = this.overlayRef?.overlayElement;\n if (!pane) return;\n const option =\n pane.querySelector<HTMLElement>('.wr-cascader__opt--active:not(.wr-cascader__opt--disabled)') ??\n pane.querySelector<HTMLElement>('.wr-cascader__opt:not(.wr-cascader__opt--disabled)');\n option?.focus();\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n // Every enabled option carries `tabindex=\"0\"` and commits on Enter, so on\n // the keyboard the caret is INSIDE the pane by design — and the ordinary\n // way to finish choosing (`onOptionClick` on a leaf) closes it. Disposing\n // without handing focus back dropped it on `<body>` on the SUCCESS path,\n // not merely on dismissal: a keyboard user who had just picked a value then\n // had to Tab from the top of the document to get back to the control.\n // Untouched when focus had already moved elsewhere — that click is usually\n // what closed us, and stealing the caret back would fight the user for it.\n const pane = this.overlayRef.overlayElement;\n const focusWasInside = pane.contains(this.host.nativeElement.ownerDocument.activeElement);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (focusWasInside) this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus();\n }\n}\n\nexport type { WrCascaderOption } from './interfaces';\n","<button\n type=\"button\"\n class=\"wr-cascader__trigger\"\n role=\"combobox\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [disabled]=\"disabled()\"\n [attr.aria-haspopup]=\"'tree'\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKeydown($event)\"\n (blur)=\"touch.emit()\"\n>\n @if (displayLabel(); as label) {\n <span class=\"wr-cascader__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-cascader__placeholder\">{{ placeholder() }}</span>\n }\n\n @if (clearable() && hasSelection() && !disabled() && !readonly()) {\n <span\n class=\"wr-cascader__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClearLabel()\"\n tabindex=\"-1\"\n (click)=\"clearSelection($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-cascader__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n</button>\n\n<ng-template #panelTpl>\n <div\n class=\"wr-cascader-panel\"\n [class.wr-cascader-panel--sm]=\"size() === 'sm'\"\n [class.wr-cascader-panel--lg]=\"size() === 'lg'\"\n role=\"tree\"\n [attr.id]=\"panelId\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <!--\n tree / group / treeitem, and NOT menu. A combobox's popup may be a listbox,\n a tree, a grid or a dialog and nothing else, so `aria-haspopup=\"menu\"` on\n the trigger was an author error — and a `menu` may own menuitems and\n groups, never other menus, so the columns were a second one. Neither is\n visible to axe: `menu` is a valid token for the global `aria-haspopup`, and\n `aria-required-children` passes a menu-inside-menu (measured against this\n exact fragment). A tree is what this control has always been — the value is\n a PATH, and only `treeitem` supports aria-expanded, aria-level,\n aria-setsize, aria-posinset and aria-selected at once.\n\n The columns stay `group` rather than collapsing to `role=\"presentation\"`,\n which is also axe-clean: the DOM is column-MAJOR, so a flat tree would\n leave level plus document order as the only structure, and \"Germany\"\n (level 2) would read as a child of \"Antarctica\" (level 1, the item\n immediately before it in source order).\n -->\n @for (col of columns(); track $index; let colIndex = $index) {\n <ul\n class=\"wr-cascader__col\"\n role=\"group\"\n [attr.id]=\"columnId(colIndex)\"\n [attr.aria-labelledby]=\"parentOptionId(colIndex)\"\n >\n @for (opt of col; track opt.value; let optIndex = $index) {\n <!--\n `aria-expanded` is exactly `isActiveAt`: `columns()` renders the next\n column for the active option and only when it has children, so the\n state can never claim a column that is not on screen — and\n `aria-controls` rides that same invariant, which is what makes\n \"expanded\" refer to something when the expanded content is a SIBLING\n rather than a descendant. It is emitted only while expanded: a\n reference to an absent id is a violation with `aria-expanded=\"true\"`\n and clean while collapsed.\n\n `aria-level` is load-bearing rather than decorative. The columns are\n siblings, so the DOM ancestry represents no level at all and every\n option would read as level 1. `aria-setsize` / `aria-posinset` are\n not strictly required — each column IS a complete sibling set — and\n are written anyway, because a tree that owns sibling groups is the\n uncommon shape where browser/AT pairs are known to miscompute both.\n\n `aria-selected` is written on every option that can be COMMITTED,\n `false` included, matching `wr-tree`. The alternative a reviewer may\n prefer: only the selected node, leaning on treeitem's implicit false,\n which is quieter in a long column and loses the \"this row is\n selectable\" signal that presence carries.\n -->\n <li\n class=\"wr-cascader__opt\"\n role=\"treeitem\"\n [attr.id]=\"optionId(colIndex, optIndex)\"\n [class.wr-cascader__opt--active]=\"isActiveAt(colIndex, opt.value)\"\n [class.wr-cascader__opt--disabled]=\"opt.disabled\"\n [attr.tabindex]=\"opt.disabled ? -1 : 0\"\n [attr.aria-disabled]=\"opt.disabled ? true : null\"\n [attr.aria-level]=\"colIndex + 1\"\n [attr.aria-setsize]=\"$count\"\n [attr.aria-posinset]=\"optIndex + 1\"\n [attr.aria-selected]=\"isSelectedAt(colIndex, opt)\"\n [attr.aria-expanded]=\"opt.children?.length ? isActiveAt(colIndex, opt.value) : null\"\n [attr.aria-controls]=\"\n opt.children?.length && isActiveAt(colIndex, opt.value) ? columnId(colIndex + 1) : null\n \"\n (click)=\"onOptionClick(colIndex, opt, $event)\"\n (keydown.enter)=\"onOptionClick(colIndex, opt, $event)\"\n (keydown.space)=\"onOptionClick(colIndex, opt, $event)\"\n >\n <span class=\"wr-cascader__opt-label\">{{ opt.label }}</span>\n @if (opt.children?.length) {\n <svg\n class=\"wr-icon__svg wr-cascader__opt-arrow\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n }\n </li>\n }\n </ul>\n }\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAiCH,IAAI,QAAQ,GAAG,CAAC;MA8CH,UAAU,CAAA;;IAEZ,UAAU,GAAG,KAAK,CAAgB,IAAI;mFAAC;IAE7B,kBAAkB,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;;IAGvG,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAkC;;IAG1D,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;AAExC;;;;AAIG;IACM,SAAS,GAAG,KAAK,CAAgB,IAAI;kFAAC;IAE9B,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC;AAC/D,IAAA,iBAAiB,GAAG,QAAQ,CAAC,MAAK;;AAEnD,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE;AACjC,QAAA,IAAI,QAAQ;AAAE,YAAA,OAAO,QAAQ;AAC7B,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE;AACtC,QAAA,OAAO,WAAW,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE;IACrD,CAAC;0FAAC;AAEF;;;;;AAKG;IACM,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEtE;;;;;;;;;;;AAWG;IACM,QAAQ,GAAG,KAAK,CAAC,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AA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,UAAU,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3NpF;;AAEG;;;;"}
|
|
@@ -56,9 +56,20 @@ class WrCheckboxHarness extends ComponentHarness {
|
|
|
56
56
|
async isDisabled() {
|
|
57
57
|
return (await this.input()).getProperty('disabled');
|
|
58
58
|
}
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* The group identity — `checkboxValue`, not the form value.
|
|
61
|
+
*
|
|
62
|
+
* Read off the host's `data-checkbox-value`, which the component reflects for
|
|
63
|
+
* exactly this. It used to read `value` from the inner `<input>`, an attribute
|
|
64
|
+
* nothing writes, so it answered `null` for every checkbox whatever its
|
|
65
|
+
* identity — the shape these harnesses are not allowed to have.
|
|
66
|
+
*
|
|
67
|
+
* `null` still means one honest thing: no identity, or an identity that is not
|
|
68
|
+
* a primitive. An object or an array has no attribute form, and a harness
|
|
69
|
+
* cannot reach a TypeScript value the DOM never carried.
|
|
70
|
+
*/
|
|
60
71
|
async getCheckboxValue() {
|
|
61
|
-
return (await this.
|
|
72
|
+
return (await this.host()).getAttribute('data-checkbox-value');
|
|
62
73
|
}
|
|
63
74
|
/** Flip the box. A disabled checkbox does not move; assert rather than assume. */
|
|
64
75
|
async toggle() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-checkbox-testing.mjs","sources":["../../../projects/lib/checkbox/testing/wr-checkbox-harness.ts","../../../projects/lib/checkbox/testing/ngwr-checkbox-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrCheckboxHarnessFilters } from './interfaces';\n\n/**\n * Test harness for `<wr-checkbox>`.\n *\n * The visible box is a `<span>` the stylesheet paints; the state lives on a real\n * `<input type=\"checkbox\">` inside the label, and that is what this harness reads\n * and clicks. Toggling through the input rather than the painted box is what makes\n * `check()` behave the way a user does — the label is what a click lands on.\n *\n * Note `checkboxValue` versus `value`: a checkbox's group identity is\n * `checkboxValue`, because `FormCheckboxControl` reserves `value` for the form\n * value. {@link getCheckboxValue} reads the identity.\n *\n * @example\n * ```ts\n * const terms = await loader.getHarness(WrCheckboxHarness.with({ label: 'I agree' }));\n * await terms.check();\n * expect(await terms.isChecked()).toBe(true);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCheckboxHarness extends ComponentHarness {\n static hostSelector = 'wr-checkbox';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCheckboxHarnessFilters = {}): HarnessPredicate<WrCheckboxHarness> {\n return new HarnessPredicate(WrCheckboxHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) === checked)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly input = this.locatorFor('input.wr-checkbox__input');\n\n /** The projected label text, trimmed. */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-checkbox__label')()).text();\n }\n\n async isChecked(): Promise<boolean> {\n return (await this.input()).getProperty<boolean>('checked');\n }\n\n /**\n * Whether the box is in its third state.\n *\n * `indeterminate` is a DOM PROPERTY, not an attribute — reading the attribute\n * would report `null` for a box that is visibly dashed.\n */\n async isIndeterminate(): Promise<boolean> {\n return (await this.input()).getProperty<boolean>('indeterminate');\n }\n\n async isDisabled(): Promise<boolean> {\n return (await this.input()).getProperty<boolean>('disabled');\n }\n\n
|
|
1
|
+
{"version":3,"file":"ngwr-checkbox-testing.mjs","sources":["../../../projects/lib/checkbox/testing/wr-checkbox-harness.ts","../../../projects/lib/checkbox/testing/ngwr-checkbox-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrCheckboxHarnessFilters } from './interfaces';\n\n/**\n * Test harness for `<wr-checkbox>`.\n *\n * The visible box is a `<span>` the stylesheet paints; the state lives on a real\n * `<input type=\"checkbox\">` inside the label, and that is what this harness reads\n * and clicks. Toggling through the input rather than the painted box is what makes\n * `check()` behave the way a user does — the label is what a click lands on.\n *\n * Note `checkboxValue` versus `value`: a checkbox's group identity is\n * `checkboxValue`, because `FormCheckboxControl` reserves `value` for the form\n * value. {@link getCheckboxValue} reads the identity.\n *\n * @example\n * ```ts\n * const terms = await loader.getHarness(WrCheckboxHarness.with({ label: 'I agree' }));\n * await terms.check();\n * expect(await terms.isChecked()).toBe(true);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCheckboxHarness extends ComponentHarness {\n static hostSelector = 'wr-checkbox';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCheckboxHarnessFilters = {}): HarnessPredicate<WrCheckboxHarness> {\n return new HarnessPredicate(WrCheckboxHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) === checked)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly input = this.locatorFor('input.wr-checkbox__input');\n\n /** The projected label text, trimmed. */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-checkbox__label')()).text();\n }\n\n async isChecked(): Promise<boolean> {\n return (await this.input()).getProperty<boolean>('checked');\n }\n\n /**\n * Whether the box is in its third state.\n *\n * `indeterminate` is a DOM PROPERTY, not an attribute — reading the attribute\n * would report `null` for a box that is visibly dashed.\n */\n async isIndeterminate(): Promise<boolean> {\n return (await this.input()).getProperty<boolean>('indeterminate');\n }\n\n async isDisabled(): Promise<boolean> {\n return (await this.input()).getProperty<boolean>('disabled');\n }\n\n /**\n * The group identity — `checkboxValue`, not the form value.\n *\n * Read off the host's `data-checkbox-value`, which the component reflects for\n * exactly this. It used to read `value` from the inner `<input>`, an attribute\n * nothing writes, so it answered `null` for every checkbox whatever its\n * identity — the shape these harnesses are not allowed to have.\n *\n * `null` still means one honest thing: no identity, or an identity that is not\n * a primitive. An object or an array has no attribute form, and a harness\n * cannot reach a TypeScript value the DOM never carried.\n */\n async getCheckboxValue(): Promise<string | null> {\n return (await this.host()).getAttribute('data-checkbox-value');\n }\n\n /** Flip the box. A disabled checkbox does not move; assert rather than assume. */\n async toggle(): Promise<void> {\n return (await this.input()).click();\n }\n\n /** Tick the box if it is not already ticked. */\n async check(): Promise<void> {\n if (!(await this.isChecked())) await this.toggle();\n }\n\n /** Untick the box if it is ticked. */\n async uncheck(): Promise<void> {\n if (await this.isChecked()) await this.toggle();\n }\n\n async focus(): Promise<void> {\n return (await this.input()).focus();\n }\n\n async isFocused(): Promise<boolean> {\n return (await this.input()).isFocused();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,MAAO,iBAAkB,SAAQ,gBAAgB,CAAA;AACrD,IAAA,OAAO,YAAY,GAAG,aAAa;;AAGnC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAoC,EAAE,EAAA;AAChD,QAAA,OAAO,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,OAAO;aACnD,SAAS,CAAC,OAAO,EAAE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AGA,IAAA,MAAM,KAAK,GAAA;AACT,QAAA,IAAI,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;AAAE,YAAA,MAAM,IAAI,CAAC,MAAM,EAAE;IACpD;;AAGA,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,IAAI,MAAM,IAAI,CAAC,SAAS,EAAE;AAAE,YAAA,MAAM,IAAI,CAAC,MAAM,EAAE;IACjD;AAEA,IAAA,MAAM,KAAK,GAAA;QACT,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;IACrC;AAEA,IAAA,MAAM,SAAS,GAAA;QACb,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE;IACzC;;;ACzGF;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, input, model, output, inject,
|
|
3
|
+
import { InjectionToken, input, computed, model, output, inject, ViewEncapsulation, Component, forwardRef } from '@angular/core';
|
|
4
4
|
import { useConfigValue } from 'ngwr/config';
|
|
5
5
|
import { useFormFieldAria } from 'ngwr/form';
|
|
6
6
|
import { WrIcon } from 'ngwr/icon';
|
|
@@ -43,6 +43,27 @@ class WrCheckbox {
|
|
|
43
43
|
*/
|
|
44
44
|
checkboxValue = input(null, /* @ts-ignore */
|
|
45
45
|
...(ngDevMode ? [{ debugName: "checkboxValue" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/**
|
|
47
|
+
* `checkboxValue` as an attribute, when it can be one.
|
|
48
|
+
*
|
|
49
|
+
* A primitive round-trips through the DOM and is what a group identity is in
|
|
50
|
+
* practice. Anything else — an object, an array — has no honest attribute
|
|
51
|
+
* form, so the attribute is ABSENT rather than `[object Object]`: a harness
|
|
52
|
+
* reading it then gets `null`, which is true, instead of a string that looks
|
|
53
|
+
* like data and identifies nothing.
|
|
54
|
+
*/
|
|
55
|
+
reflectedValue = computed(() => {
|
|
56
|
+
const value = this.checkboxValue();
|
|
57
|
+
// Narrowed inline rather than through a `typeof` held in a variable, which
|
|
58
|
+
// TypeScript does not follow — and the linter is right to refuse it: the
|
|
59
|
+
// point of this guard is that `String()` never sees an object.
|
|
60
|
+
if (typeof value === 'string')
|
|
61
|
+
return value;
|
|
62
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
63
|
+
return String(value);
|
|
64
|
+
return null;
|
|
65
|
+
}, /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "reflectedValue" }] : /* istanbul ignore next */ []));
|
|
46
67
|
/**
|
|
47
68
|
* Accessible name for a checkbox used WITHOUT projected text — a selection
|
|
48
69
|
* cell in a table, say. The wrapping `<label>` names the control whenever
|
|
@@ -177,10 +198,10 @@ class WrCheckbox {
|
|
|
177
198
|
this.group.blurred();
|
|
178
199
|
this.touch.emit();
|
|
179
200
|
}
|
|
180
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
181
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
201
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrCheckbox, isStandalone: true, selector: "wr-checkbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, checkboxValue: { classPropertyName: "checkboxValue", publicName: "checkboxValue", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touch: "touch" }, host: { properties: { "class": "classes()", "attr.id": "null", "attr.data-checkbox-value": "reflectedValue()" } }, ngImport: i0, template: "<label class=\"wr-checkbox__label\" [for]=\"id()\">\n <input\n class=\"wr-checkbox__input\"\n type=\"checkbox\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [checked]=\"isChecked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"effectiveDisabled()\"\n [attr.aria-readonly]=\"effectiveReadonly() || null\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur()\"\n />\n\n <span class=\"wr-checkbox__box\" aria-hidden=\"true\">\n @if (indeterminate()) {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__dash\">\n <line x1=\"3.5\" y1=\"8\" x2=\"12.5\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n } @else if (icon(); as iconName) {\n <wr-icon class=\"wr-checkbox__icon\" [name]=\"iconName\" />\n } @else {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__mark\">\n <polyline\n points=\"3.5 8.5 6.5 11.5 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n </span>\n\n <span class=\"wr-checkbox__text\">\n <ng-content />\n </span>\n</label>\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
182
203
|
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCheckbox, decorators: [{
|
|
184
205
|
type: Component,
|
|
185
206
|
args: [{ selector: 'wr-checkbox', encapsulation: ViewEncapsulation.None, host: {
|
|
186
207
|
'[class]': 'classes()',
|
|
@@ -191,6 +212,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
191
212
|
// `getElementById` to the host — not a labelable element, so `input.labels`
|
|
192
213
|
// went from 1 to 0 and `document.getElementById(id)` returned the wrong node.
|
|
193
214
|
'[attr.id]': 'null',
|
|
215
|
+
// The group identity, reflected so a HARNESS can read it. It is the only
|
|
216
|
+
// way: `checkboxValue` is an `unknown`-typed TypeScript value that reaches
|
|
217
|
+
// no attribute otherwise, and `WrCheckboxHarness.getCheckboxValue()` read
|
|
218
|
+
// `value` off the inner `<input>` — which nothing writes, so it answered
|
|
219
|
+
// `null` for every checkbox in every state. A harness method that answers
|
|
220
|
+
// the same for a working component and a broken one is the one thing the
|
|
221
|
+
// harness rules forbid outright.
|
|
222
|
+
//
|
|
223
|
+
// `data-`, deliberately, and NOT `value`: a leftover static `value="x"` from
|
|
224
|
+
// before v9 still lands on this host as a plain attribute, so reading
|
|
225
|
+
// `value` here would report the identity a consumer THOUGHT they set while
|
|
226
|
+
// the component used `null`. That is the exact confusion migration-v9
|
|
227
|
+
// exists to end.
|
|
228
|
+
'[attr.data-checkbox-value]': 'reflectedValue()',
|
|
194
229
|
}, imports: [WrIcon], template: "<label class=\"wr-checkbox__label\" [for]=\"id()\">\n <input\n class=\"wr-checkbox__input\"\n type=\"checkbox\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [checked]=\"isChecked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"effectiveDisabled()\"\n [attr.aria-readonly]=\"effectiveReadonly() || null\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur()\"\n />\n\n <span class=\"wr-checkbox__box\" aria-hidden=\"true\">\n @if (indeterminate()) {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__dash\">\n <line x1=\"3.5\" y1=\"8\" x2=\"12.5\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n } @else if (icon(); as iconName) {\n <wr-icon class=\"wr-checkbox__icon\" [name]=\"iconName\" />\n } @else {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__mark\">\n <polyline\n points=\"3.5 8.5 6.5 11.5 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n </span>\n\n <span class=\"wr-checkbox__text\">\n <ng-content />\n </span>\n</label>\n" }]
|
|
195
230
|
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], checkboxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxValue", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], touch: [{ type: i0.Output, args: ["touch"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }] } });
|
|
196
231
|
|
|
@@ -274,8 +309,8 @@ class WrCheckboxGroup {
|
|
|
274
309
|
blurred() {
|
|
275
310
|
this.touch.emit();
|
|
276
311
|
}
|
|
277
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
278
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.
|
|
312
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCheckboxGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
313
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: WrCheckboxGroup, isStandalone: true, selector: "wr-checkbox-group", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-invalid": "fieldAria.ariaInvalid()", "attr.aria-describedby": "fieldAria.describedBy()" }, classAttribute: "wr-checkbox-group" }, providers: [
|
|
279
314
|
{
|
|
280
315
|
provide: WR_CHECKBOX_GROUP,
|
|
281
316
|
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
@@ -283,7 +318,7 @@ class WrCheckboxGroup {
|
|
|
283
318
|
},
|
|
284
319
|
], ngImport: i0, template: '<ng-content />', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
285
320
|
}
|
|
286
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCheckboxGroup, decorators: [{
|
|
287
322
|
type: Component,
|
|
288
323
|
args: [{
|
|
289
324
|
selector: 'wr-checkbox-group',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-checkbox.mjs","sources":["../../../projects/lib/checkbox/tokens/checkbox-group.token.ts","../../../projects/lib/checkbox/checkbox.ts","../../../projects/lib/checkbox/checkbox.html","../../../projects/lib/checkbox/checkbox-group.ts","../../../projects/lib/checkbox/ngwr-checkbox.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 { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Contract a checkbox uses to talk to its parent `<wr-checkbox-group>`.\n *\n * @internal\n */\nexport interface WrCheckboxGroupContext {\n /** Is the given value currently selected? */\n isSelected(value: unknown): boolean;\n /** Toggle the given value in the group. */\n toggle(value: unknown): void;\n /**\n * A child lost focus.\n *\n * The group is the control a form binds to, so it is the group that has to\n * report touched — and a child's own `touch` output goes nowhere, since the\n * group never listens to it. Without this channel the only way to mark a\n * group touched was to CHANGE it: tabbing through every box and picking none\n * left the field pristine, so a `required` group showed no error until the\n * user toggled something, which is the one thing they had decided not to do.\n */\n blurred(): void;\n /** Whether the entire group is disabled. */\n readonly isDisabled: Signal<boolean>;\n /** Whether the entire group refuses edits while staying focusable. */\n readonly isReadonly: Signal<boolean>;\n}\n\n/**\n * Token a `<wr-checkbox>` injects to read selection state from — and\n * toggle values in — its parent `<wr-checkbox-group>` (when present).\n *\n * @internal\n */\nexport const WR_CHECKBOX_GROUP = new InjectionToken<WrCheckboxGroupContext>('WR_CHECKBOX_GROUP');\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, inject, input, model, output } from '@angular/core';\nimport type { FormCheckboxControl } from '@angular/forms/signals';\n\nimport { useConfigValue } from 'ngwr/config';\nimport { useFormFieldAria } from 'ngwr/form';\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\nimport { randomId } from 'ngwr/utils';\n\nimport { WR_CHECKBOX_GROUP } from './tokens';\n\n/**\n * Two-state checkbox.\n *\n * A signal-forms native control: it implements `FormCheckboxControl`, so\n * `[formField]` binds straight to its `checked` model — no\n * `ControlValueAccessor` in between. `[(checked)]` works standalone, and\n * classic `[(ngModel)]` / reactive forms keep working through Angular's bridge.\n *\n * @example\n * ```html\n * <wr-checkbox [(checked)]=\"agree\">I agree</wr-checkbox>\n * <wr-checkbox [formField]=\"form.agree\">I agree</wr-checkbox>\n * ```\n *\n * **Inside `<wr-checkbox-group>`** — the checkbox's `checkboxValue` is added to\n * or removed from the group's array, and the group is the native form control.\n * (The identity input is `checkboxValue`, not `value`, because\n * `FormCheckboxControl` reserves `value` — its form state is the boolean\n * `checked`.)\n *\n * @example\n * ```html\n * <wr-checkbox-group [formField]=\"form.features\">\n * <wr-checkbox checkboxValue=\"autosave\">Autosave</wr-checkbox>\n * <wr-checkbox checkboxValue=\"notifications\">Notifications</wr-checkbox>\n * </wr-checkbox-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/checkbox\n */\nexport type WrCheckboxSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-checkbox',\n templateUrl: './checkbox.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n // The `id` input belongs to the native input, not to this element. A static\n // `id=\"x\"` in a consumer's template is written to the host as a plain\n // attribute AS WELL as fed to the input, which put two elements with the\n // same id in the document and made `<label for>` resolve through\n // `getElementById` to the host — not a labelable element, so `input.labels`\n // went from 1 to 0 and `document.getElementById(id)` returned the wrong node.\n '[attr.id]': 'null',\n },\n imports: [WrIcon],\n})\nexport class WrCheckbox implements FormCheckboxControl {\n /**\n * Stable id used to associate the native input with its label. Lands on the\n * inner `<input>`; the host never keeps it.\n *\n * @default Randomly generated\n */\n readonly id = input<string>(randomId('wr-checkbox'));\n\n /**\n * This checkbox's identity when inside a `<wr-checkbox-group>` — the value\n * added to / removed from the group's array. Ignored in standalone mode.\n * (Named `checkboxValue`, not `value`, because `FormCheckboxControl` reserves\n * `value`.)\n */\n readonly checkboxValue = input<unknown>(null);\n\n /**\n * Accessible name for a checkbox used WITHOUT projected text — a selection\n * cell in a table, say. The wrapping `<label>` names the control whenever\n * content is projected; with none, the native input has no name, and an\n * `aria-label` put on the host lands on a `<wr-checkbox>` element that no\n * screen reader ever announces.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Checked state — the form value. Bound by `[formField]`, two-way via\n * `[(checked)]`, or `[(ngModel)]`. Ignored inside a `<wr-checkbox-group>`,\n * where the group's array is the source of truth.\n */\n readonly checked = model<boolean>(false);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /**\n * Disable the checkbox. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits while staying focusable and submittable. Bound automatically\n * from the field's readonly state when used with `[formField]`.\n *\n * A native `<input type=\"checkbox\">` ignores the `readonly` attribute, so this\n * cancels the click's activation behaviour instead — which covers Space too,\n * since a checkbox turns Space into a click — and mirrors the state as\n * `aria-readonly`, which role `checkbox` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Control size — shares the `--wr-control-*` contract. Unset falls back to the\n * `checkbox.size` app default from `provideWrConfig()`. @default 'md'\n */\n readonly size = input<WrCheckboxSize | null>(null);\n\n /** `size`, then the app config, then `md`. @internal */\n protected readonly resolvedSize = useConfigValue(this.size, c => c.checkbox?.size, 'md');\n\n /**\n * Optional icon name rendered inside the box when checked, in place of the\n * default checkmark. Use any registered NGWR icon.\n */\n readonly icon = input<WrIconName | null>(null);\n\n /**\n * Show the indeterminate (\"mixed\") state — a dash instead of a check. Visual\n * only and controlled: set it yourself for a parent \"select all\" whose\n * children are partly checked, and clear it on the next toggle. Takes visual\n * precedence over `checked`; the native input reports `aria-checked=\"mixed\"`.\n *\n * @default false\n */\n readonly indeterminate = input(false, { transform: coerceBooleanProperty });\n\n private readonly group = inject(WR_CHECKBOX_GROUP, { optional: true });\n\n /** Rendered \"is checked\" — reads the group when grouped, else the `checked` model. */\n protected readonly isChecked = computed(() =>\n this.group ? this.group.isSelected(this.checkboxValue()) : this.checked()\n );\n\n /** Effective disabled — the `disabled` input wins, then the group. */\n protected readonly effectiveDisabled = computed(() => {\n if (this.disabled()) return true;\n return this.group ? this.group.isDisabled() : false;\n });\n\n /** Effective readonly — this box's own `readonly` input, or the group's. */\n protected readonly effectiveReadonly = computed(() => {\n if (this.readonly()) return true;\n return this.group ? this.group.isReadonly() : false;\n });\n\n /**\n * The surrounding `<wr-form-field>`'s error state, mirrored onto the native\n * input. Inside a `<wr-checkbox-group>` the GROUP is the bound control and\n * carries the state, so a grouped box shields itself and stays silent — nine\n * boxes each announcing the group's one error is noise, not information.\n */\n private readonly fieldAria = useFormFieldAria();\n protected readonly ariaInvalid = computed(() => (this.group ? null : this.fieldAria.ariaInvalid()));\n protected readonly describedBy = computed(() => (this.group ? null : this.fieldAria.describedBy()));\n\n protected readonly classes = computed(() => {\n const parts = ['wr-checkbox'];\n const size = this.resolvedSize();\n if (size !== 'md') parts.push(`wr-checkbox--${size}`);\n if (this.indeterminate()) parts.push('wr-checkbox--indeterminate');\n else if (this.isChecked()) parts.push('wr-checkbox--checked');\n if (this.effectiveDisabled()) parts.push('wr-checkbox--disabled');\n else if (this.effectiveReadonly()) parts.push('wr-checkbox--readonly');\n return parts.join(' ');\n });\n\n // Template handlers\n\n /**\n * Cancel the toggle while readonly. `change` never fires for a click whose\n * default was prevented, so this is the only guard the pointer and Space\n * paths need; `onInputChange` keeps its own for a synthetic `change`.\n */\n protected onInputClick(event: Event): void {\n if (this.effectiveReadonly()) event.preventDefault();\n }\n\n protected onInputChange(event: Event): void {\n if (this.effectiveReadonly()) {\n // A synthetic `change` cannot be prevented — put the DOM back instead.\n (event.target as HTMLInputElement).checked = this.isChecked();\n return;\n }\n if (this.group) {\n this.group.toggle(this.checkboxValue());\n return;\n }\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n\n protected onInputBlur(): void {\n // Inside a group the GROUP is the bound control, and its own `touch` is\n // what a form listens to; the child's output is wired to nothing there.\n if (this.group) this.group.blurred();\n this.touch.emit();\n }\n}\n","<label class=\"wr-checkbox__label\" [for]=\"id()\">\n <input\n class=\"wr-checkbox__input\"\n type=\"checkbox\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [checked]=\"isChecked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"effectiveDisabled()\"\n [attr.aria-readonly]=\"effectiveReadonly() || null\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur()\"\n />\n\n <span class=\"wr-checkbox__box\" aria-hidden=\"true\">\n @if (indeterminate()) {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__dash\">\n <line x1=\"3.5\" y1=\"8\" x2=\"12.5\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n } @else if (icon(); as iconName) {\n <wr-icon class=\"wr-checkbox__icon\" [name]=\"iconName\" />\n } @else {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__mark\">\n <polyline\n points=\"3.5 8.5 6.5 11.5 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n </span>\n\n <span class=\"wr-checkbox__text\">\n <ng-content />\n </span>\n</label>\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, forwardRef, input, model, output } from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\n\nimport { WR_CHECKBOX_GROUP, type WrCheckboxGroupContext } from './tokens';\n\n/**\n * Manages a group of `<wr-checkbox>` children as a single form value\n * (an array of the checked items' `value` inputs).\n *\n * A signal-forms native control: it implements `FormValueControl<unknown[]>`,\n * so `[formField]` binds to its `value` model. `[(value)]` works standalone,\n * and classic `[(ngModel)]` / reactive forms keep working through the bridge.\n *\n * @example\n * ```html\n * <wr-checkbox-group [formField]=\"form.features\">\n * <wr-checkbox checkboxValue=\"autosave\">Autosave</wr-checkbox>\n * <wr-checkbox checkboxValue=\"notifications\">Notifications</wr-checkbox>\n * <wr-checkbox checkboxValue=\"darkmode\">Dark mode</wr-checkbox>\n * </wr-checkbox-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/checkbox\n */\n@Component({\n selector: 'wr-checkbox-group',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-checkbox-group',\n role: 'group',\n '[attr.aria-invalid]': 'fieldAria.ariaInvalid()',\n '[attr.aria-describedby]': 'fieldAria.describedBy()',\n },\n providers: [\n {\n provide: WR_CHECKBOX_GROUP,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrCheckboxGroup),\n },\n ],\n})\nexport class WrCheckboxGroup implements FormValueControl<unknown[]>, WrCheckboxGroupContext {\n /**\n * Disable every child checkbox. Bound automatically from the field's\n * disabled state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits on every child while they stay focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * No `aria-readonly` on the host: role `group` does not support it (the state\n * is not global), so each child box mirrors its own instead.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** The checked items' values. Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<unknown[]>([]);\n\n /** Emitted when a child toggles so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n // The current selection as a guaranteed array — a classic-forms binding can\n // write null even though the type is `unknown[]`, so normalise every read.\n private readonly selected = computed<readonly unknown[]>(() => {\n const v = this.value();\n return Array.isArray(v) ? v : [];\n });\n\n /** Effective disabled state (WrCheckboxGroupContext). */\n readonly isDisabled = computed(() => this.disabled());\n\n /** Effective readonly state (WrCheckboxGroupContext). */\n readonly isReadonly = computed(() => this.readonly());\n\n // WrCheckboxGroupContext\n\n isSelected(value: unknown): boolean {\n return this.selected().includes(value);\n }\n\n toggle(value: unknown): void {\n if (this.isDisabled() || this.isReadonly()) return;\n const current = this.selected();\n const next = current.includes(value) ? current.filter(v => v !== value) : [...current, value];\n this.value.set(next);\n this.touch.emit();\n }\n\n /** @internal A child checkbox lost focus — see {@link WrCheckboxGroupContext.blurred}. */\n blurred(): void {\n this.touch.emit();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AA+BH;;;;;AAKG;MACU,iBAAiB,GAAG,IAAI,cAAc,CAAyB,mBAAmB;;AC1C/F;;;;;AAKG;MA6DU,UAAU,CAAA;AACrB;;;;;AAKG;AACM,IAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,aAAa,CAAC;2EAAC;AAEpD;;;;;AAKG;IACM,aAAa,GAAG,KAAK,CAAU,IAAI;sFAAC;AAE7C;;;;;;AAMG;IACM,SAAS,GAAG,KAAK,CAAgB,IAAI;kFAAC;AAE/C;;;;AAIG;IACM,OAAO,GAAG,KAAK,CAAU,KAAK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,EAAA,EAAA,mBAAA,EAAA,yBAAA,EAAA,uBAAA,EAAA,yBAAA,EAAA,EAAA,cAAA,EAAA,mBAAA,EAAA,EAAA,SAAA,EARf;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,iBAAiB;;AAE1B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,eAAe,CAAC;AAC/C,aAAA;AACF,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAdS,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAgBf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAlB3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,mBAAmB;AAC1B,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,qBAAqB,EAAE,yBAAyB;AAChD,wBAAA,yBAAyB,EAAE,yBAAyB;AACrD,qBAAA;AACD,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;;AAE1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC/C,yBAAA;AACF,qBAAA;AACF,iBAAA;;;ACnDD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-checkbox.mjs","sources":["../../../projects/lib/checkbox/tokens/checkbox-group.token.ts","../../../projects/lib/checkbox/checkbox.ts","../../../projects/lib/checkbox/checkbox.html","../../../projects/lib/checkbox/checkbox-group.ts","../../../projects/lib/checkbox/ngwr-checkbox.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 { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Contract a checkbox uses to talk to its parent `<wr-checkbox-group>`.\n *\n * @internal\n */\nexport interface WrCheckboxGroupContext {\n /** Is the given value currently selected? */\n isSelected(value: unknown): boolean;\n /** Toggle the given value in the group. */\n toggle(value: unknown): void;\n /**\n * A child lost focus.\n *\n * The group is the control a form binds to, so it is the group that has to\n * report touched — and a child's own `touch` output goes nowhere, since the\n * group never listens to it. Without this channel the only way to mark a\n * group touched was to CHANGE it: tabbing through every box and picking none\n * left the field pristine, so a `required` group showed no error until the\n * user toggled something, which is the one thing they had decided not to do.\n */\n blurred(): void;\n /** Whether the entire group is disabled. */\n readonly isDisabled: Signal<boolean>;\n /** Whether the entire group refuses edits while staying focusable. */\n readonly isReadonly: Signal<boolean>;\n}\n\n/**\n * Token a `<wr-checkbox>` injects to read selection state from — and\n * toggle values in — its parent `<wr-checkbox-group>` (when present).\n *\n * @internal\n */\nexport const WR_CHECKBOX_GROUP = new InjectionToken<WrCheckboxGroupContext>('WR_CHECKBOX_GROUP');\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, inject, input, model, output } from '@angular/core';\nimport type { FormCheckboxControl } from '@angular/forms/signals';\n\nimport { useConfigValue } from 'ngwr/config';\nimport { useFormFieldAria } from 'ngwr/form';\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\nimport { randomId } from 'ngwr/utils';\n\nimport { WR_CHECKBOX_GROUP } from './tokens';\n\n/**\n * Two-state checkbox.\n *\n * A signal-forms native control: it implements `FormCheckboxControl`, so\n * `[formField]` binds straight to its `checked` model — no\n * `ControlValueAccessor` in between. `[(checked)]` works standalone, and\n * classic `[(ngModel)]` / reactive forms keep working through Angular's bridge.\n *\n * @example\n * ```html\n * <wr-checkbox [(checked)]=\"agree\">I agree</wr-checkbox>\n * <wr-checkbox [formField]=\"form.agree\">I agree</wr-checkbox>\n * ```\n *\n * **Inside `<wr-checkbox-group>`** — the checkbox's `checkboxValue` is added to\n * or removed from the group's array, and the group is the native form control.\n * (The identity input is `checkboxValue`, not `value`, because\n * `FormCheckboxControl` reserves `value` — its form state is the boolean\n * `checked`.)\n *\n * @example\n * ```html\n * <wr-checkbox-group [formField]=\"form.features\">\n * <wr-checkbox checkboxValue=\"autosave\">Autosave</wr-checkbox>\n * <wr-checkbox checkboxValue=\"notifications\">Notifications</wr-checkbox>\n * </wr-checkbox-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/checkbox\n */\nexport type WrCheckboxSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-checkbox',\n templateUrl: './checkbox.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n // The `id` input belongs to the native input, not to this element. A static\n // `id=\"x\"` in a consumer's template is written to the host as a plain\n // attribute AS WELL as fed to the input, which put two elements with the\n // same id in the document and made `<label for>` resolve through\n // `getElementById` to the host — not a labelable element, so `input.labels`\n // went from 1 to 0 and `document.getElementById(id)` returned the wrong node.\n '[attr.id]': 'null',\n // The group identity, reflected so a HARNESS can read it. It is the only\n // way: `checkboxValue` is an `unknown`-typed TypeScript value that reaches\n // no attribute otherwise, and `WrCheckboxHarness.getCheckboxValue()` read\n // `value` off the inner `<input>` — which nothing writes, so it answered\n // `null` for every checkbox in every state. A harness method that answers\n // the same for a working component and a broken one is the one thing the\n // harness rules forbid outright.\n //\n // `data-`, deliberately, and NOT `value`: a leftover static `value=\"x\"` from\n // before v9 still lands on this host as a plain attribute, so reading\n // `value` here would report the identity a consumer THOUGHT they set while\n // the component used `null`. That is the exact confusion migration-v9\n // exists to end.\n '[attr.data-checkbox-value]': 'reflectedValue()',\n },\n imports: [WrIcon],\n})\nexport class WrCheckbox implements FormCheckboxControl {\n /**\n * Stable id used to associate the native input with its label. Lands on the\n * inner `<input>`; the host never keeps it.\n *\n * @default Randomly generated\n */\n readonly id = input<string>(randomId('wr-checkbox'));\n\n /**\n * This checkbox's identity when inside a `<wr-checkbox-group>` — the value\n * added to / removed from the group's array. Ignored in standalone mode.\n * (Named `checkboxValue`, not `value`, because `FormCheckboxControl` reserves\n * `value`.)\n */\n readonly checkboxValue = input<unknown>(null);\n\n /**\n * `checkboxValue` as an attribute, when it can be one.\n *\n * A primitive round-trips through the DOM and is what a group identity is in\n * practice. Anything else — an object, an array — has no honest attribute\n * form, so the attribute is ABSENT rather than `[object Object]`: a harness\n * reading it then gets `null`, which is true, instead of a string that looks\n * like data and identifies nothing.\n */\n protected readonly reflectedValue = computed(() => {\n const value = this.checkboxValue();\n // Narrowed inline rather than through a `typeof` held in a variable, which\n // TypeScript does not follow — and the linter is right to refuse it: the\n // point of this guard is that `String()` never sees an object.\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean') return String(value);\n return null;\n });\n\n /**\n * Accessible name for a checkbox used WITHOUT projected text — a selection\n * cell in a table, say. The wrapping `<label>` names the control whenever\n * content is projected; with none, the native input has no name, and an\n * `aria-label` put on the host lands on a `<wr-checkbox>` element that no\n * screen reader ever announces.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Checked state — the form value. Bound by `[formField]`, two-way via\n * `[(checked)]`, or `[(ngModel)]`. Ignored inside a `<wr-checkbox-group>`,\n * where the group's array is the source of truth.\n */\n readonly checked = model<boolean>(false);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /**\n * Disable the checkbox. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits while staying focusable and submittable. Bound automatically\n * from the field's readonly state when used with `[formField]`.\n *\n * A native `<input type=\"checkbox\">` ignores the `readonly` attribute, so this\n * cancels the click's activation behaviour instead — which covers Space too,\n * since a checkbox turns Space into a click — and mirrors the state as\n * `aria-readonly`, which role `checkbox` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Control size — shares the `--wr-control-*` contract. Unset falls back to the\n * `checkbox.size` app default from `provideWrConfig()`. @default 'md'\n */\n readonly size = input<WrCheckboxSize | null>(null);\n\n /** `size`, then the app config, then `md`. @internal */\n protected readonly resolvedSize = useConfigValue(this.size, c => c.checkbox?.size, 'md');\n\n /**\n * Optional icon name rendered inside the box when checked, in place of the\n * default checkmark. Use any registered NGWR icon.\n */\n readonly icon = input<WrIconName | null>(null);\n\n /**\n * Show the indeterminate (\"mixed\") state — a dash instead of a check. Visual\n * only and controlled: set it yourself for a parent \"select all\" whose\n * children are partly checked, and clear it on the next toggle. Takes visual\n * precedence over `checked`; the native input reports `aria-checked=\"mixed\"`.\n *\n * @default false\n */\n readonly indeterminate = input(false, { transform: coerceBooleanProperty });\n\n private readonly group = inject(WR_CHECKBOX_GROUP, { optional: true });\n\n /** Rendered \"is checked\" — reads the group when grouped, else the `checked` model. */\n protected readonly isChecked = computed(() =>\n this.group ? this.group.isSelected(this.checkboxValue()) : this.checked()\n );\n\n /** Effective disabled — the `disabled` input wins, then the group. */\n protected readonly effectiveDisabled = computed(() => {\n if (this.disabled()) return true;\n return this.group ? this.group.isDisabled() : false;\n });\n\n /** Effective readonly — this box's own `readonly` input, or the group's. */\n protected readonly effectiveReadonly = computed(() => {\n if (this.readonly()) return true;\n return this.group ? this.group.isReadonly() : false;\n });\n\n /**\n * The surrounding `<wr-form-field>`'s error state, mirrored onto the native\n * input. Inside a `<wr-checkbox-group>` the GROUP is the bound control and\n * carries the state, so a grouped box shields itself and stays silent — nine\n * boxes each announcing the group's one error is noise, not information.\n */\n private readonly fieldAria = useFormFieldAria();\n protected readonly ariaInvalid = computed(() => (this.group ? null : this.fieldAria.ariaInvalid()));\n protected readonly describedBy = computed(() => (this.group ? null : this.fieldAria.describedBy()));\n\n protected readonly classes = computed(() => {\n const parts = ['wr-checkbox'];\n const size = this.resolvedSize();\n if (size !== 'md') parts.push(`wr-checkbox--${size}`);\n if (this.indeterminate()) parts.push('wr-checkbox--indeterminate');\n else if (this.isChecked()) parts.push('wr-checkbox--checked');\n if (this.effectiveDisabled()) parts.push('wr-checkbox--disabled');\n else if (this.effectiveReadonly()) parts.push('wr-checkbox--readonly');\n return parts.join(' ');\n });\n\n // Template handlers\n\n /**\n * Cancel the toggle while readonly. `change` never fires for a click whose\n * default was prevented, so this is the only guard the pointer and Space\n * paths need; `onInputChange` keeps its own for a synthetic `change`.\n */\n protected onInputClick(event: Event): void {\n if (this.effectiveReadonly()) event.preventDefault();\n }\n\n protected onInputChange(event: Event): void {\n if (this.effectiveReadonly()) {\n // A synthetic `change` cannot be prevented — put the DOM back instead.\n (event.target as HTMLInputElement).checked = this.isChecked();\n return;\n }\n if (this.group) {\n this.group.toggle(this.checkboxValue());\n return;\n }\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n\n protected onInputBlur(): void {\n // Inside a group the GROUP is the bound control, and its own `touch` is\n // what a form listens to; the child's output is wired to nothing there.\n if (this.group) this.group.blurred();\n this.touch.emit();\n }\n}\n","<label class=\"wr-checkbox__label\" [for]=\"id()\">\n <input\n class=\"wr-checkbox__input\"\n type=\"checkbox\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [checked]=\"isChecked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"effectiveDisabled()\"\n [attr.aria-readonly]=\"effectiveReadonly() || null\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur()\"\n />\n\n <span class=\"wr-checkbox__box\" aria-hidden=\"true\">\n @if (indeterminate()) {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__dash\">\n <line x1=\"3.5\" y1=\"8\" x2=\"12.5\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n } @else if (icon(); as iconName) {\n <wr-icon class=\"wr-checkbox__icon\" [name]=\"iconName\" />\n } @else {\n <svg viewBox=\"0 0 16 16\" class=\"wr-checkbox__mark\">\n <polyline\n points=\"3.5 8.5 6.5 11.5 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n </span>\n\n <span class=\"wr-checkbox__text\">\n <ng-content />\n </span>\n</label>\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, forwardRef, input, model, output } from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\n\nimport { WR_CHECKBOX_GROUP, type WrCheckboxGroupContext } from './tokens';\n\n/**\n * Manages a group of `<wr-checkbox>` children as a single form value\n * (an array of the checked items' `value` inputs).\n *\n * A signal-forms native control: it implements `FormValueControl<unknown[]>`,\n * so `[formField]` binds to its `value` model. `[(value)]` works standalone,\n * and classic `[(ngModel)]` / reactive forms keep working through the bridge.\n *\n * @example\n * ```html\n * <wr-checkbox-group [formField]=\"form.features\">\n * <wr-checkbox checkboxValue=\"autosave\">Autosave</wr-checkbox>\n * <wr-checkbox checkboxValue=\"notifications\">Notifications</wr-checkbox>\n * <wr-checkbox checkboxValue=\"darkmode\">Dark mode</wr-checkbox>\n * </wr-checkbox-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/checkbox\n */\n@Component({\n selector: 'wr-checkbox-group',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-checkbox-group',\n role: 'group',\n '[attr.aria-invalid]': 'fieldAria.ariaInvalid()',\n '[attr.aria-describedby]': 'fieldAria.describedBy()',\n },\n providers: [\n {\n provide: WR_CHECKBOX_GROUP,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrCheckboxGroup),\n },\n ],\n})\nexport class WrCheckboxGroup implements FormValueControl<unknown[]>, WrCheckboxGroupContext {\n /**\n * Disable every child checkbox. Bound automatically from the field's\n * disabled state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits on every child while they stay focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * No `aria-readonly` on the host: role `group` does not support it (the state\n * is not global), so each child box mirrors its own instead.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** The checked items' values. Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<unknown[]>([]);\n\n /** Emitted when a child toggles so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n // The current selection as a guaranteed array — a classic-forms binding can\n // write null even though the type is `unknown[]`, so normalise every read.\n private readonly selected = computed<readonly unknown[]>(() => {\n const v = this.value();\n return Array.isArray(v) ? v : [];\n });\n\n /** Effective disabled state (WrCheckboxGroupContext). */\n readonly isDisabled = computed(() => this.disabled());\n\n /** Effective readonly state (WrCheckboxGroupContext). */\n readonly isReadonly = computed(() => this.readonly());\n\n // WrCheckboxGroupContext\n\n isSelected(value: unknown): boolean {\n return this.selected().includes(value);\n }\n\n toggle(value: unknown): void {\n if (this.isDisabled() || this.isReadonly()) return;\n const current = this.selected();\n const next = current.includes(value) ? current.filter(v => v !== value) : [...current, value];\n this.value.set(next);\n this.touch.emit();\n }\n\n /** @internal A child checkbox lost focus — see {@link WrCheckboxGroupContext.blurred}. */\n blurred(): void {\n this.touch.emit();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AA+BH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;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,mBAAmB;AAC1B,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,qBAAqB,EAAE,yBAAyB;AAChD,wBAAA,yBAAyB,EAAE,yBAAyB;AACrD,qBAAA;AACD,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;;AAE1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC/C,yBAAA;AACF,qBAAA;AACF,iBAAA;;;ACnDD;;AAEG;;;;"}
|
|
@@ -169,10 +169,10 @@ class WrCircularText {
|
|
|
169
169
|
this.rotation = this.spinEl().nativeElement.animate([{ transform: 'rotate(0deg)' }, { transform: 'rotate(360deg)' }], { duration: newDurMs, iterations: Infinity, easing: 'linear' });
|
|
170
170
|
this.rotation.currentTime = ratio * newDurMs;
|
|
171
171
|
}
|
|
172
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
173
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
172
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCircularText, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
173
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrCircularText, isStandalone: true, selector: "wr-circular-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, spinDuration: { classPropertyName: "spinDuration", publicName: "spinDuration", isSignal: true, isRequired: false, transformFunction: null }, onHover: { classPropertyName: "onHover", publicName: "onHover", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-circular-text--bonkers": "onHover() === 'goBonkers'" }, classAttribute: "wr-circular-text" }, viewQueries: [{ propertyName: "spinEl", first: true, predicate: ["spin"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n The readable text, once: the ring below is per-character spans, which a screen\n reader may read out one letter at a time. Same shape as `wr-blur-text` and\n `wr-decrypt-text` \u2014 the string is carried here and the pieces are taken out of\n the tree with one `aria-hidden` on the wrapper rather than N on the chars, so\n the attribute stays off the nodes the rotation touches. It sits OUTSIDE\n `__spin`, or it would be hidden with the chars and would spin with them.\n-->\n<span class=\"wr-circular-text__sr-only\">{{ text() }}</span>\n<span class=\"wr-circular-text__spin\" aria-hidden=\"true\" #spin>\n @for (c of chars(); track $index) {\n <span class=\"wr-circular-text__char\" [style.transform]=\"c.transform\">{{ c.ch }}</span>\n }\n</span>\n", styles: [".wr-circular-text{--wr-circular-text-size: 12rem;--wr-circular-text-radius: calc(var(--wr-circular-text-size) / 2);position:relative;display:inline-block;width:var(--wr-circular-text-size);height:var(--wr-circular-text-size);border-radius:50%;font-weight:700;text-align:center;-webkit-user-select:none;user-select:none;transition:transform .6s var(--wr-ease-spring)}.wr-circular-text__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.wr-circular-text__spin{position:absolute;inset:0;will-change:transform}.wr-circular-text__char{position:absolute;top:50%;left:50%;display:inline-block;margin-left:-.5em;margin-top:-.5em;line-height:1}.wr-circular-text--bonkers:hover{transform:scale(.8)}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
174
174
|
}
|
|
175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrCircularText, decorators: [{
|
|
176
176
|
type: Component,
|
|
177
177
|
args: [{ selector: 'wr-circular-text', encapsulation: ViewEncapsulation.None, host: {
|
|
178
178
|
class: 'wr-circular-text',
|
|
@@ -184,10 +184,10 @@ class WrClickSpark {
|
|
|
184
184
|
this.raf = requestAnimationFrame(draw);
|
|
185
185
|
this.destroyRef.onDestroy(() => cancelAnimationFrame(this.raf));
|
|
186
186
|
}
|
|
187
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
188
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.
|
|
187
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrClickSpark, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
188
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: WrClickSpark, isStandalone: true, selector: "wr-click-spark", inputs: { sparkColor: { classPropertyName: "sparkColor", publicName: "sparkColor", isSignal: true, isRequired: false, transformFunction: null }, sparkSize: { classPropertyName: "sparkSize", publicName: "sparkSize", isSignal: true, isRequired: false, transformFunction: null }, sparkRadius: { classPropertyName: "sparkRadius", publicName: "sparkRadius", isSignal: true, isRequired: false, transformFunction: null }, sparkCount: { classPropertyName: "sparkCount", publicName: "sparkCount", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, easing: { classPropertyName: "easing", publicName: "easing", isSignal: true, isRequired: false, transformFunction: null }, extraScale: { classPropertyName: "extraScale", publicName: "extraScale", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, classAttribute: "wr-click-spark" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Decoration over the projected content \u2014 the same treatment `WrConfetti`\n gives its own canvas. -->\n<canvas #canvas class=\"wr-click-spark__canvas\" aria-hidden=\"true\"></canvas>\n<ng-content />\n", styles: [".wr-click-spark{position:relative;display:block}.wr-click-spark__canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:1}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
189
189
|
}
|
|
190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrClickSpark, decorators: [{
|
|
191
191
|
type: Component,
|
|
192
192
|
args: [{ selector: 'wr-click-spark', encapsulation: ViewEncapsulation.None, host: {
|
|
193
193
|
class: 'wr-click-spark',
|
|
@@ -150,10 +150,10 @@ class WrClipboard {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
154
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.
|
|
153
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrClipboard, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
154
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.6", ngImport: i0, type: WrClipboard });
|
|
155
155
|
}
|
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrClipboard, decorators: [{
|
|
157
157
|
type: Service
|
|
158
158
|
}] });
|
|
159
159
|
|