ngwr 14.11.0 → 14.12.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/card/styles/_rules.scss +1 -1
- package/event-calendar/styles/_index.scss +14 -0
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- 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.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.mjs +3 -3
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-card.mjs +11 -11
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +6 -3
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +28 -9
- 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 +24 -9
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- 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 +27 -21
- 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.mjs +3 -3
- package/fesm2022/ngwr-drag-drop.mjs +6 -6
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-dropdown.mjs +9 -9
- package/fesm2022/ngwr-editor.mjs +3 -3
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar-testing.mjs +3 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +8 -8
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +3 -3
- package/fesm2022/ngwr-file-upload-testing.mjs +6 -1
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +26 -8
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
- 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-graph.mjs +6 -6
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +0 -1
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +0 -1
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +0 -1
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +0 -1
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +0 -1
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +0 -1
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +0 -1
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +0 -1
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +0 -1
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +0 -1
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +0 -1
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +0 -1
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +0 -1
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +0 -1
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +0 -1
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +0 -1
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +0 -1
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +0 -1
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +0 -1
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +0 -1
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +0 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +0 -1
- 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 +19 -4
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +9 -5
- 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.mjs +21 -6
- 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.mjs +3 -3
- package/fesm2022/ngwr-list.mjs +6 -6
- package/fesm2022/ngwr-loading-bar.mjs +8 -8
- 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 +3 -3
- 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 +12 -12
- 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 +12 -7
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +21 -6
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +18 -12
- 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 +6 -3
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +41 -15
- package/fesm2022/ngwr-select.mjs.map +1 -1
- 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 +19 -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 +6 -6
- package/fesm2022/ngwr-star-border.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +22 -7
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +24 -20
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs.mjs +6 -6
- package/fesm2022/ngwr-textarea.mjs +6 -3
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- 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 +9 -9
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-transfer.mjs +6 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +11 -3
- 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/i18n/ar.json +0 -1
- package/i18n/cs.json +0 -1
- package/i18n/de.json +0 -1
- package/i18n/en.json +0 -1
- package/i18n/es.json +0 -1
- package/i18n/fr.json +0 -1
- package/i18n/he.json +0 -1
- package/i18n/hi.json +0 -1
- package/i18n/id.json +0 -1
- package/i18n/it.json +0 -1
- package/i18n/ja.json +0 -1
- package/i18n/ko.json +0 -1
- package/i18n/nl.json +0 -1
- package/i18n/pl.json +0 -1
- package/i18n/pt.json +0 -1
- package/i18n/ru.json +0 -1
- package/i18n/sv.json +0 -1
- package/i18n/tr.json +0 -1
- package/i18n/uk.json +0 -1
- package/i18n/vi.json +0 -1
- package/i18n/zh-TW.json +0 -1
- package/i18n/zh.json +0 -1
- package/llms-full.txt +1 -1
- package/loading-bar/styles/_rules.scss +1 -1
- package/package.json +2 -2
- package/theme/_index.scss +84 -0
- package/theme/styles/_contrast.scss +1 -1
- package/theme/styles/_dark.scss +59 -3
- package/types/ngwr-cascader.d.ts +5 -0
- package/types/ngwr-checkbox.d.ts +14 -0
- package/types/ngwr-color-picker.d.ts +10 -0
- package/types/ngwr-date-picker.d.ts +12 -0
- package/types/ngwr-event-calendar-testing.d.ts +5 -1
- package/types/ngwr-file-upload-testing.d.ts +7 -6
- package/types/ngwr-file-upload.d.ts +24 -7
- package/types/ngwr-input-number.d.ts +7 -0
- package/types/ngwr-input-otp.d.ts +8 -0
- package/types/ngwr-knob.d.ts +9 -0
- package/types/ngwr-radio.d.ts +9 -0
- package/types/ngwr-rating.d.ts +8 -0
- package/types/ngwr-segmented.d.ts +6 -0
- package/types/ngwr-select.d.ts +21 -1
- package/types/ngwr-sidebar.d.ts +1 -1
- package/types/ngwr-slider.d.ts +8 -0
- package/types/ngwr-switch.d.ts +7 -0
- package/types/ngwr-table.d.ts +8 -0
- package/types/ngwr-textarea.d.ts +6 -0
- package/types/ngwr-transfer.d.ts +11 -0
- package/types/ngwr-tree.d.ts +7 -0
- package/types/ngwr-version.d.ts +1 -1
|
@@ -28,7 +28,7 @@ var WrCarouselSlide = class WrCarouselSlide {
|
|
|
28
28
|
}, ...ngDevMode ? [{ debugName: "offScreen" }] : /* istanbul ignore next */ []);
|
|
29
29
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
30
30
|
minVersion: "12.0.0",
|
|
31
|
-
version: "22.2.
|
|
31
|
+
version: "22.2.3",
|
|
32
32
|
ngImport: i0,
|
|
33
33
|
type: WrCarouselSlide,
|
|
34
34
|
deps: [],
|
|
@@ -36,7 +36,7 @@ var WrCarouselSlide = class WrCarouselSlide {
|
|
|
36
36
|
});
|
|
37
37
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
38
38
|
minVersion: "17.1.0",
|
|
39
|
-
version: "22.2.
|
|
39
|
+
version: "22.2.3",
|
|
40
40
|
type: WrCarouselSlide,
|
|
41
41
|
isStandalone: true,
|
|
42
42
|
selector: "wr-carousel-slide",
|
|
@@ -64,7 +64,7 @@ var WrCarouselSlide = class WrCarouselSlide {
|
|
|
64
64
|
};
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({
|
|
66
66
|
minVersion: "12.0.0",
|
|
67
|
-
version: "22.2.
|
|
67
|
+
version: "22.2.3",
|
|
68
68
|
ngImport: i0,
|
|
69
69
|
type: WrCarouselSlide,
|
|
70
70
|
decorators: [{
|
|
@@ -220,7 +220,7 @@ var WrCarousel = class WrCarousel {
|
|
|
220
220
|
}
|
|
221
221
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
222
222
|
minVersion: "12.0.0",
|
|
223
|
-
version: "22.2.
|
|
223
|
+
version: "22.2.3",
|
|
224
224
|
ngImport: i0,
|
|
225
225
|
type: WrCarousel,
|
|
226
226
|
deps: [],
|
|
@@ -228,7 +228,7 @@ var WrCarousel = class WrCarousel {
|
|
|
228
228
|
});
|
|
229
229
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
230
230
|
minVersion: "17.0.0",
|
|
231
|
-
version: "22.2.
|
|
231
|
+
version: "22.2.3",
|
|
232
232
|
type: WrCarousel,
|
|
233
233
|
isStandalone: true,
|
|
234
234
|
selector: "wr-carousel",
|
|
@@ -337,7 +337,7 @@ var WrCarousel = class WrCarousel {
|
|
|
337
337
|
};
|
|
338
338
|
i0.ɵɵngDeclareClassMetadata({
|
|
339
339
|
minVersion: "12.0.0",
|
|
340
|
-
version: "22.2.
|
|
340
|
+
version: "22.2.3",
|
|
341
341
|
ngImport: i0,
|
|
342
342
|
type: WrCarousel,
|
|
343
343
|
decorators: [{
|
|
@@ -123,6 +123,9 @@ var WrCascader = class WrCascader {
|
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
+
focus(options) {
|
|
127
|
+
this.host.nativeElement.querySelector(".wr-cascader__trigger")?.focus(options);
|
|
128
|
+
}
|
|
126
129
|
onTriggerClick() {
|
|
127
130
|
if (this.disabled() || this.readonly()) return;
|
|
128
131
|
if (!this.open()) this.activePath.set(this.path());
|
|
@@ -231,7 +234,7 @@ var WrCascader = class WrCascader {
|
|
|
231
234
|
}
|
|
232
235
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
233
236
|
minVersion: "12.0.0",
|
|
234
|
-
version: "22.2.
|
|
237
|
+
version: "22.2.3",
|
|
235
238
|
ngImport: i0,
|
|
236
239
|
type: WrCascader,
|
|
237
240
|
deps: [],
|
|
@@ -239,7 +242,7 @@ var WrCascader = class WrCascader {
|
|
|
239
242
|
});
|
|
240
243
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
241
244
|
minVersion: "17.0.0",
|
|
242
|
-
version: "22.2.
|
|
245
|
+
version: "22.2.3",
|
|
243
246
|
type: WrCascader,
|
|
244
247
|
isStandalone: true,
|
|
245
248
|
selector: "wr-cascader",
|
|
@@ -350,7 +353,7 @@ var WrCascader = class WrCascader {
|
|
|
350
353
|
};
|
|
351
354
|
i0.ɵɵngDeclareClassMetadata({
|
|
352
355
|
minVersion: "12.0.0",
|
|
353
|
-
version: "22.2.
|
|
356
|
+
version: "22.2.3",
|
|
354
357
|
ngImport: i0,
|
|
355
358
|
type: WrCascader,
|
|
356
359
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-cascader.mjs","names":[],"sources":["../../../projects/lib/cascader/cascader.ts","../../../projects/lib/cascader/cascader.html"],"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 { Directionality } from '@angular/cdk/bidi';\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, wrFollowDirection } from 'ngwr/overlay';\nimport { toClassList, type WrClassInput } from 'ngwr/utils';\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 * Extra CSS classes for the column panel's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\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 /**\n * Ambient reading direction, for the open panel alone — nothing in this\n * component reads it directly. Optional so a bare `TestBed` needs no\n * provider; `Directionality` is root-provided anyway, and a missing one\n * simply reads as `ltr`.\n */\n private readonly dir = inject(Directionality, { optional: true });\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: toClassList('wr-cascader-overlay', this.panelClass()),\n });\n\n // The columns cascade inline-wards, and the CDK captured the direction as a\n // string when this ref was created — so a flip while the panel is open left\n // the whole cascade running the other way from the page around it.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\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=\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../projects/lib/cascader/cascader.html"],"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 { Directionality } from '@angular/cdk/bidi';\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, wrFollowDirection } from 'ngwr/overlay';\nimport { toClassList, type WrClassInput } from 'ngwr/utils';\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 * Extra CSS classes for the column panel's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\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 /**\n * Ambient reading direction, for the open panel alone — nothing in this\n * component reads it directly. Optional so a bare `TestBed` needs no\n * provider; `Directionality` is root-provided anyway, and a missing one\n * simply reads as `ltr`.\n */\n private readonly dir = inject(Directionality, { optional: true });\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 /**\n * Focus the trigger — what Signal Forms calls to focus this control. The\n * panel stays shut: ArrowDown or a click opens it, the way it does after Tab.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement.querySelector<HTMLElement>('.wr-cascader__trigger')?.focus(options);\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: toClassList('wr-cascader-overlay', this.panelClass()),\n });\n\n // The columns cascade inline-wards, and the CDK captured the direction as a\n // string when this ref was created — so a flip while the panel is open left\n // the whole cascade running the other way from the page around it.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\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"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,IAAI,WAAW;AA8Cf,IAAa,aAAb,MAAa,WAAU;CAEZ,aAAa,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAE7B,qBAAqB,YAAY,KAAK,YAAY,yBAAyB,iBAAiB;CAGtG,UAAU,MAAM,SAA0C,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAG1D,cAAc,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAO/B,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE9B,YAAY,YAAY,KAAK,WAAW,gBAAgB,QAAQ;CAC9D,oBAAoB,eAAc;EAEnD,MAAM,WAAW,KAAK,UAAS;EAC/B,IAAI,UAAU,OAAO;EACrB,MAAM,cAAc,KAAK,YAAW;EACpC,OAAO,cAAc,cAAc,KAAK,UAAS;CACnD,GAAE,GAAA,YAA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AAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAU;IAAI,MAAM;IAAa,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { Component, InjectionToken, ViewEncapsulation, computed, forwardRef, inject, input, model, output } from "@angular/core";
|
|
3
|
+
import { Component, ElementRef, InjectionToken, ViewEncapsulation, computed, forwardRef, inject, input, model, output, viewChild } from "@angular/core";
|
|
4
4
|
import { useConfigValue } from "ngwr/config";
|
|
5
5
|
import { useFormFieldAria } from "ngwr/form";
|
|
6
6
|
import { WrIcon } from "ngwr/icon";
|
|
@@ -46,6 +46,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
46
46
|
transform: coerceBooleanProperty
|
|
47
47
|
});
|
|
48
48
|
group = inject(WR_CHECKBOX_GROUP, { optional: true });
|
|
49
|
+
native = viewChild.required("native", ...ngDevMode ? [{ debugName: "native" }] : /* istanbul ignore next */ []);
|
|
49
50
|
isChecked = computed(() => this.group ? this.group.isSelected(this.checkboxValue()) : this.checked(), ...ngDevMode ? [{ debugName: "isChecked" }] : /* istanbul ignore next */ []);
|
|
50
51
|
effectiveDisabled = computed(() => {
|
|
51
52
|
if (this.disabled()) return true;
|
|
@@ -68,6 +69,9 @@ var WrCheckbox = class WrCheckbox {
|
|
|
68
69
|
else if (this.effectiveReadonly()) parts.push("wr-checkbox--readonly");
|
|
69
70
|
return parts.join(" ");
|
|
70
71
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
72
|
+
focus(options) {
|
|
73
|
+
this.native().nativeElement.focus(options);
|
|
74
|
+
}
|
|
71
75
|
onInputClick(event) {
|
|
72
76
|
if (this.effectiveReadonly()) event.preventDefault();
|
|
73
77
|
}
|
|
@@ -90,7 +94,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
90
94
|
}
|
|
91
95
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
92
96
|
minVersion: "12.0.0",
|
|
93
|
-
version: "22.2.
|
|
97
|
+
version: "22.2.3",
|
|
94
98
|
ngImport: i0,
|
|
95
99
|
type: WrCheckbox,
|
|
96
100
|
deps: [],
|
|
@@ -98,7 +102,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
98
102
|
});
|
|
99
103
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
100
104
|
minVersion: "17.0.0",
|
|
101
|
-
version: "22.2.
|
|
105
|
+
version: "22.2.3",
|
|
102
106
|
type: WrCheckbox,
|
|
103
107
|
isStandalone: true,
|
|
104
108
|
selector: "wr-checkbox",
|
|
@@ -176,8 +180,15 @@ var WrCheckbox = class WrCheckbox {
|
|
|
176
180
|
"attr.id": "null",
|
|
177
181
|
"attr.data-checkbox-value": "reflectedValue()"
|
|
178
182
|
} },
|
|
183
|
+
viewQueries: [{
|
|
184
|
+
propertyName: "native",
|
|
185
|
+
first: true,
|
|
186
|
+
predicate: ["native"],
|
|
187
|
+
descendants: true,
|
|
188
|
+
isSignal: true
|
|
189
|
+
}],
|
|
179
190
|
ngImport: i0,
|
|
180
|
-
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",
|
|
191
|
+
template: "<label class=\"wr-checkbox__label\" [for]=\"id()\">\n <input\n #native\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",
|
|
181
192
|
dependencies: [{
|
|
182
193
|
kind: "component",
|
|
183
194
|
type: WrIcon,
|
|
@@ -189,7 +200,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
189
200
|
};
|
|
190
201
|
i0.ɵɵngDeclareClassMetadata({
|
|
191
202
|
minVersion: "12.0.0",
|
|
192
|
-
version: "22.2.
|
|
203
|
+
version: "22.2.3",
|
|
193
204
|
ngImport: i0,
|
|
194
205
|
type: WrCheckbox,
|
|
195
206
|
decorators: [{
|
|
@@ -203,7 +214,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
203
214
|
"[attr.data-checkbox-value]": "reflectedValue()"
|
|
204
215
|
},
|
|
205
216
|
imports: [WrIcon],
|
|
206
|
-
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"
|
|
217
|
+
template: "<label class=\"wr-checkbox__label\" [for]=\"id()\">\n <input\n #native\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"
|
|
207
218
|
}]
|
|
208
219
|
}],
|
|
209
220
|
propDecorators: {
|
|
@@ -285,6 +296,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
285
296
|
alias: "indeterminate",
|
|
286
297
|
required: false
|
|
287
298
|
}]
|
|
299
|
+
}],
|
|
300
|
+
native: [{
|
|
301
|
+
type: i0.ViewChild,
|
|
302
|
+
args: ["native", { isSignal: true }]
|
|
288
303
|
}]
|
|
289
304
|
}
|
|
290
305
|
});
|
|
@@ -312,6 +327,10 @@ var WrCheckboxGroup = class WrCheckboxGroup {
|
|
|
312
327
|
}, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
313
328
|
isDisabled = computed(() => this.disabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
314
329
|
isReadonly = computed(() => this.readonly(), ...ngDevMode ? [{ debugName: "isReadonly" }] : /* istanbul ignore next */ []);
|
|
330
|
+
host = inject(ElementRef);
|
|
331
|
+
focus(options) {
|
|
332
|
+
this.host.nativeElement.querySelector(".wr-checkbox__input:not(:disabled)")?.focus(options);
|
|
333
|
+
}
|
|
315
334
|
isSelected(value) {
|
|
316
335
|
return this.selected().includes(value);
|
|
317
336
|
}
|
|
@@ -327,7 +346,7 @@ var WrCheckboxGroup = class WrCheckboxGroup {
|
|
|
327
346
|
}
|
|
328
347
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
329
348
|
minVersion: "12.0.0",
|
|
330
|
-
version: "22.2.
|
|
349
|
+
version: "22.2.3",
|
|
331
350
|
ngImport: i0,
|
|
332
351
|
type: WrCheckboxGroup,
|
|
333
352
|
deps: [],
|
|
@@ -335,7 +354,7 @@ var WrCheckboxGroup = class WrCheckboxGroup {
|
|
|
335
354
|
});
|
|
336
355
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
337
356
|
minVersion: "17.1.0",
|
|
338
|
-
version: "22.2.
|
|
357
|
+
version: "22.2.3",
|
|
339
358
|
type: WrCheckboxGroup,
|
|
340
359
|
isStandalone: true,
|
|
341
360
|
selector: "wr-checkbox-group",
|
|
@@ -386,7 +405,7 @@ var WrCheckboxGroup = class WrCheckboxGroup {
|
|
|
386
405
|
};
|
|
387
406
|
i0.ɵɵngDeclareClassMetadata({
|
|
388
407
|
minVersion: "12.0.0",
|
|
389
|
-
version: "22.2.
|
|
408
|
+
version: "22.2.3",
|
|
390
409
|
ngImport: i0,
|
|
391
410
|
type: WrCheckboxGroup,
|
|
392
411
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-checkbox.mjs","names":[],"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"],"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 * A click the host does not answer still toggles `checked` underneath, and the\n * dash and the mixed state both stay until the binding turns `false`.\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 const inputEl = event.target as HTMLInputElement;\n // Activating a checkbox clears its own `indeterminate` before `change` fires,\n // and the `[indeterminate]` binding never writes again while the bound value\n // stays `true` — so the box kept painting the dash while the accessibility\n // tree announced \"checked\". The input is controlled: the mixed state holds\n // until the host clears it, and a host that does clears it through the\n // binding on the next change detection.\n inputEl.indeterminate = this.indeterminate();\n\n if (this.effectiveReadonly()) {\n // A synthetic `change` cannot be prevented — put the DOM back instead.\n inputEl.checked = this.isChecked();\n return;\n }\n if (this.group) {\n this.group.toggle(this.checkboxValue());\n return;\n }\n this.checked.set(inputEl.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"],"mappings":";;;;;;;;;;;;;AA0CA,MAAa,oBAAoB,IAAI,eAAuC,mBAAmB;;;;;;;ACsC/F,IAAa,aAAb,MAAa,WAAU;CAOZ,KAAK,MAAc,SAAS,aAAa,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAQ3C,gBAAgB,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAW1B,iBAAiB,eA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AAA;CAAA,CAAA;;AAgBf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAlB3B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,eAAe,kBAAkB;GACjC,MAAM;IACJ,OAAO;IACP,MAAM;IACN,uBAAuB;IACvB,2BAA2B;GAC5B;GACD,WAAW,CACT;IACE,SAAS;IAET,aAAa,iBAAgB,eAAgB;GAC9C,CACF;EACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-checkbox.mjs","names":[],"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"],"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 {\n Component,\n type ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n output,\n viewChild,\n} 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 * A click the host does not answer still toggles `checked` underneath, and the\n * dash and the mixed state both stay until the binding turns `false`.\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 private readonly native = viewChild.required<ElementRef<HTMLInputElement>>('native');\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 /**\n * Focus the checkbox — what Signal Forms calls to focus this control. The\n * native input takes it, since the host has no tab stop of its own; a disabled\n * box refuses, as a disabled input always does.\n */\n focus(options?: FocusOptions): void {\n this.native().nativeElement.focus(options);\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 const inputEl = event.target as HTMLInputElement;\n // Activating a checkbox clears its own `indeterminate` before `change` fires,\n // and the `[indeterminate]` binding never writes again while the bound value\n // stays `true` — so the box kept painting the dash while the accessibility\n // tree announced \"checked\". The input is controlled: the mixed state holds\n // until the host clears it, and a host that does clears it through the\n // binding on the next change detection.\n inputEl.indeterminate = this.indeterminate();\n\n if (this.effectiveReadonly()) {\n // A synthetic `change` cannot be prevented — put the DOM back instead.\n inputEl.checked = this.isChecked();\n return;\n }\n if (this.group) {\n this.group.toggle(this.checkboxValue());\n return;\n }\n this.checked.set(inputEl.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 #native\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 {\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n forwardRef,\n inject,\n input,\n model,\n output,\n} 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 private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Focus the group — what Signal Forms calls to focus this control. The first\n * enabled box takes it, which is where Tab lands: the host is a `role=\"group\"`\n * with no tab stop of its own, and a disabled box has none either.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement.querySelector<HTMLInputElement>('.wr-checkbox__input:not(:disabled)')?.focus(options);\n }\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}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SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAf,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAe,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,OAAA;GAAA,OAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,QAAA;GAAA,YAAA;IAAA,qBAAA;IAAA,yBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,WARf,CACT;GACE,SAAS;GAET,aAAa,iBAAiB,eAAe;EAC9C,CACF;EAAA,UAAA;EAAA,UAdS;EAAgB,UAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAgBf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAlB3B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,eAAe,kBAAkB;GACjC,MAAM;IACJ,OAAO;IACP,MAAM;IACN,uBAAuB;IACvB,2BAA2B;GAC5B;GACD,WAAW,CACT;IACE,SAAS;IAET,aAAa,iBAAgB,eAAgB;GAC9C,CACF;EACF,CAAA"}
|
|
@@ -121,7 +121,7 @@ var WrCircularText = class WrCircularText {
|
|
|
121
121
|
}
|
|
122
122
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
123
123
|
minVersion: "12.0.0",
|
|
124
|
-
version: "22.2.
|
|
124
|
+
version: "22.2.3",
|
|
125
125
|
ngImport: i0,
|
|
126
126
|
type: WrCircularText,
|
|
127
127
|
deps: [],
|
|
@@ -129,7 +129,7 @@ var WrCircularText = class WrCircularText {
|
|
|
129
129
|
});
|
|
130
130
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
131
131
|
minVersion: "17.0.0",
|
|
132
|
-
version: "22.2.
|
|
132
|
+
version: "22.2.3",
|
|
133
133
|
type: WrCircularText,
|
|
134
134
|
isStandalone: true,
|
|
135
135
|
selector: "wr-circular-text",
|
|
@@ -175,7 +175,7 @@ var WrCircularText = class WrCircularText {
|
|
|
175
175
|
};
|
|
176
176
|
i0.ɵɵngDeclareClassMetadata({
|
|
177
177
|
minVersion: "12.0.0",
|
|
178
|
-
version: "22.2.
|
|
178
|
+
version: "22.2.3",
|
|
179
179
|
ngImport: i0,
|
|
180
180
|
type: WrCircularText,
|
|
181
181
|
decorators: [{
|
|
@@ -140,7 +140,7 @@ var WrClickSpark = class WrClickSpark {
|
|
|
140
140
|
}
|
|
141
141
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
142
142
|
minVersion: "12.0.0",
|
|
143
|
-
version: "22.2.
|
|
143
|
+
version: "22.2.3",
|
|
144
144
|
ngImport: i0,
|
|
145
145
|
type: WrClickSpark,
|
|
146
146
|
deps: [],
|
|
@@ -148,7 +148,7 @@ var WrClickSpark = class WrClickSpark {
|
|
|
148
148
|
});
|
|
149
149
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
150
150
|
minVersion: "17.2.0",
|
|
151
|
-
version: "22.2.
|
|
151
|
+
version: "22.2.3",
|
|
152
152
|
type: WrClickSpark,
|
|
153
153
|
isStandalone: true,
|
|
154
154
|
selector: "wr-click-spark",
|
|
@@ -222,7 +222,7 @@ var WrClickSpark = class WrClickSpark {
|
|
|
222
222
|
};
|
|
223
223
|
i0.ɵɵngDeclareClassMetadata({
|
|
224
224
|
minVersion: "12.0.0",
|
|
225
|
-
version: "22.2.
|
|
225
|
+
version: "22.2.3",
|
|
226
226
|
ngImport: i0,
|
|
227
227
|
type: WrClickSpark,
|
|
228
228
|
decorators: [{
|
|
@@ -72,7 +72,7 @@ var WrClipboard = class WrClipboard {
|
|
|
72
72
|
}
|
|
73
73
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
74
74
|
minVersion: "12.0.0",
|
|
75
|
-
version: "22.2.
|
|
75
|
+
version: "22.2.3",
|
|
76
76
|
ngImport: i0,
|
|
77
77
|
type: WrClipboard,
|
|
78
78
|
deps: [],
|
|
@@ -80,14 +80,14 @@ var WrClipboard = class WrClipboard {
|
|
|
80
80
|
});
|
|
81
81
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
82
82
|
minVersion: "22.0.0",
|
|
83
|
-
version: "22.2.
|
|
83
|
+
version: "22.2.3",
|
|
84
84
|
ngImport: i0,
|
|
85
85
|
type: WrClipboard
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
88
|
i0.ɵɵngDeclareClassMetadata({
|
|
89
89
|
minVersion: "12.0.0",
|
|
90
|
-
version: "22.2.
|
|
90
|
+
version: "22.2.3",
|
|
91
91
|
ngImport: i0,
|
|
92
92
|
type: WrClipboard,
|
|
93
93
|
decorators: [{ type: Service }]
|