ngwr 16.2.0 → 16.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/styles/_tag.scss +73 -1
- package/calendar/styles/_index.scss +22 -0
- package/carousel/styles/_index.scss +53 -1
- package/cascader/styles/_rules.scss +7 -0
- package/color-picker/styles/_index.scss +21 -0
- package/date-picker/styles/_index.scss +19 -0
- package/dropdown/styles/_index.scss +13 -19
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert-testing.mjs +70 -0
- package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +17 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +3 -3
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +129 -11
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
- package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger-testing.mjs +45 -0
- package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-testing.mjs +18 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +500 -73
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel-testing.mjs +24 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +73 -10
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +45 -37
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +3 -3
- package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +153 -37
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +10 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare-testing.mjs +84 -0
- package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +28 -13
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +30 -4
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +342 -69
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +59 -8
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +18 -18
- package/fesm2022/ngwr-directives.mjs +15 -15
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +51 -29
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +11 -3
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +70 -99
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +4 -3
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +186 -33
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +279 -16
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +30 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +664 -43
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +27 -8
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +27 -8
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +27 -8
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +27 -8
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +27 -8
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +27 -8
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +27 -8
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +27 -8
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +27 -8
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +27 -8
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +27 -8
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +27 -8
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +27 -8
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +27 -8
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +27 -8
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +27 -8
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +27 -8
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +27 -8
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +27 -8
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +27 -8
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +27 -8
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +27 -8
- 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-testing.mjs +11 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +68 -7
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +23 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +24 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +152 -36
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +15 -15
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +175 -13
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +6 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +31 -29
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +44 -63
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +7 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +58 -156
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +50 -9
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable-testing.mjs +113 -0
- package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
- package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-schema-form.mjs +416 -19
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select-testing.mjs +19 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +361 -84
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider-testing.mjs +6 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +21 -3
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +29 -12
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +42 -11
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-testing.mjs +157 -3
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +1051 -74
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-testing.mjs +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +15 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +11 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +128 -16
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +40 -19
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour-testing.mjs +13 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +19 -15
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs +6 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +24 -5
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +62 -2
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +978 -79
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +97 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +33 -22
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +156 -0
- package/graph/styles/_index.scss +87 -0
- package/i18n/ar.json +29 -8
- package/i18n/cs.json +29 -8
- package/i18n/de.json +29 -8
- package/i18n/en.json +29 -8
- package/i18n/es.json +29 -8
- package/i18n/fr.json +29 -8
- package/i18n/he.json +29 -8
- package/i18n/hi.json +29 -8
- package/i18n/id.json +29 -8
- package/i18n/it.json +29 -8
- package/i18n/ja.json +29 -8
- package/i18n/ko.json +29 -8
- package/i18n/nl.json +29 -8
- package/i18n/pl.json +29 -8
- package/i18n/pt.json +29 -8
- package/i18n/ru.json +29 -8
- package/i18n/sv.json +29 -8
- package/i18n/tr.json +29 -8
- package/i18n/uk.json +29 -8
- package/i18n/vi.json +29 -8
- package/i18n/zh-TW.json +29 -8
- package/i18n/zh.json +29 -8
- package/input/styles/_index.scss +68 -1
- package/input-otp/styles/_index.scss +14 -0
- package/llms-full.txt +53 -21
- package/llms.txt +57 -24
- package/overlay/styles/_arrow.scss +4 -4
- package/package.json +33 -1
- package/popconfirm/styles/_index.scss +3 -11
- package/progress/styles/_index.scss +32 -0
- package/schema-form/styles/_index.scss +78 -0
- package/schematics/collection.json +5 -0
- package/schematics/eject/index.js +158 -0
- package/schematics/eject/schema.js +8 -0
- package/schematics/eject/schema.json +24 -0
- package/schematics/eject/source.js +295 -0
- package/schematics/use/rule.js +2 -0
- package/schematics/use/symbol-map.json +5 -0
- package/select/styles/_index.scss +127 -22
- package/skills/ngwr/SKILL.md +31 -4
- package/skills/ngwr/references/catalog.md +9 -1
- package/slider/styles/_index.scss +22 -0
- package/table/styles/_index.scss +191 -3
- package/textarea/styles/_index.scss +80 -0
- package/theme/styles/_focus.scss +16 -1
- package/theme/styles/_motion.scss +5 -0
- package/transfer/styles/_index.scss +84 -0
- package/tree/styles/_index.scss +138 -5
- package/types/ngwr-alert-testing.d.ts +88 -0
- package/types/ngwr-badge.d.ts +72 -2
- package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
- package/types/ngwr-burger-testing.d.ts +51 -0
- package/types/ngwr-calendar-testing.d.ts +18 -6
- package/types/ngwr-calendar.d.ts +272 -22
- package/types/ngwr-carousel-testing.d.ts +27 -6
- package/types/ngwr-carousel.d.ts +42 -6
- package/types/ngwr-cascader.d.ts +13 -6
- package/types/ngwr-charts-chart-legend.d.ts +9 -4
- package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
- package/types/ngwr-charts-line-chart.d.ts +7 -4
- package/types/ngwr-color-picker-testing.d.ts +15 -4
- package/types/ngwr-color-picker.d.ts +76 -6
- package/types/ngwr-compare-testing.d.ts +72 -0
- package/types/ngwr-context-menu.d.ts +2 -0
- package/types/ngwr-date-picker-testing.d.ts +23 -8
- package/types/ngwr-date-picker.d.ts +100 -9
- package/types/ngwr-date.d.ts +71 -1
- package/types/ngwr-drawer.d.ts +9 -0
- package/types/ngwr-dropdown-testing.d.ts +20 -0
- package/types/ngwr-dropdown.d.ts +26 -6
- package/types/ngwr-event-calendar.d.ts +66 -8
- package/types/ngwr-file-upload-testing.d.ts +31 -2
- package/types/ngwr-file-upload.d.ts +156 -3
- package/types/ngwr-form.d.ts +47 -3
- package/types/ngwr-graph-testing.d.ts +36 -3
- package/types/ngwr-graph.d.ts +309 -13
- package/types/ngwr-input-number-testing.d.ts +10 -0
- package/types/ngwr-input-number.d.ts +30 -1
- package/types/ngwr-input-otp.d.ts +10 -0
- package/types/ngwr-input-testing.d.ts +30 -0
- package/types/ngwr-input.d.ts +54 -3
- package/types/ngwr-overlay.d.ts +84 -5
- package/types/ngwr-pipes.d.ts +2 -1
- package/types/ngwr-popconfirm-testing.d.ts +12 -3
- package/types/ngwr-popconfirm.d.ts +28 -3
- package/types/ngwr-popover-testing.d.ts +19 -2
- package/types/ngwr-popover.d.ts +22 -2
- package/types/ngwr-progress.d.ts +29 -1
- package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
- package/types/ngwr-resizable-testing.d.ts +116 -0
- package/types/ngwr-schema-form-testing.d.ts +260 -0
- package/types/ngwr-schema-form.d.ts +76 -6
- package/types/ngwr-select-testing.d.ts +20 -0
- package/types/ngwr-select.d.ts +149 -11
- package/types/ngwr-sidebar-testing.d.ts +176 -0
- package/types/ngwr-slider-testing.d.ts +3 -1
- package/types/ngwr-slider.d.ts +21 -1
- package/types/ngwr-sortable-list.d.ts +6 -0
- package/types/ngwr-stepper.d.ts +20 -11
- package/types/ngwr-table-testing.d.ts +122 -7
- package/types/ngwr-table.d.ts +572 -50
- package/types/ngwr-tabs-testing.d.ts +14 -17
- package/types/ngwr-tabs.d.ts +6 -0
- package/types/ngwr-textarea-testing.d.ts +10 -0
- package/types/ngwr-textarea.d.ts +48 -2
- package/types/ngwr-toast.d.ts +8 -1
- package/types/ngwr-tour-testing.d.ts +10 -0
- package/types/ngwr-tour.d.ts +11 -2
- package/types/ngwr-transfer-testing.d.ts +3 -0
- package/types/ngwr-transfer.d.ts +24 -1
- package/types/ngwr-tree-testing.d.ts +65 -1
- package/types/ngwr-tree.d.ts +335 -12
- package/types/ngwr-utils.d.ts +107 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-event-calendar.mjs","names":[],"sources":["../../../projects/lib/event-calendar/event-calendar-event-template.ts","../../../projects/lib/event-calendar/event-calendar.ts","../../../projects/lib/event-calendar/event-calendar.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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrCalendarEventContext } from './types';\n\n/**\n * Replace the chip's contents. The event is the implicit context; the chip\n * itself — its button, its position and its drag handling — stays with the\n * calendar, so a custom template cannot break the geometry.\n *\n * @example\n * ```html\n * <wr-event-calendar [events]=\"events\">\n * <ng-template wrCalendarEvent let-event>\n * <strong>{{ event.title }}</strong> — {{ event.data.room }}\n * </ng-template>\n * </wr-event-calendar>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrCalendarEvent]',\n})\nexport class WrCalendarEventTemplate {\n readonly template = inject<TemplateRef<WrCalendarEventContext>>(TemplateRef);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport type { TemplateRef } from '@angular/core';\nimport {\n Component,\n DOCUMENT,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n contentChild,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrButton, WrButtonGroup } from 'ngwr/button';\nimport { WrDateAdapter } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrCalendarEventTemplate } from './event-calendar-event-template';\nimport type {\n WrCalendarEvent,\n WrCalendarEventChange,\n WrCalendarEventContext,\n WrCalendarSlot,\n WrCalendarView,\n} from './types';\n\n/**\n * Stands in for the consumer input `useI18nText` expects — the header strings take no\n * label inputs of their own.\n */\nconst NO_OVERRIDE = signal<string | null>(null).asReadonly();\n\nconst MINUTES_PER_DAY = 24 * 60;\nconst DAYS_PER_WEEK = 7;\nconst MONTH_ROWS = 6;\n\n/**\n * A chip that spans whole days — every month-view event, and the all-day band\n * of the time views. It lives in the cell where its segment STARTS and reaches\n * right with a `calc()` width, so it stays inside one `role=\"gridcell\"` however\n * far it spans.\n */\ninterface BandChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Index of the day it starts on, within the row it was laid out against. */\n readonly column: number;\n readonly span: number;\n readonly lane: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\n/**\n * A chip positioned against the time grid. Same rule — it belongs to the cell\n * holding its start — but sized in percentages OF THAT CELL, which works only\n * because every slot row is the same height.\n */\ninterface TimeChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Offset into the start cell, 0–100. */\n readonly top: number;\n /** Height as a multiple of the cell, ×100. */\n readonly height: number;\n /**\n * Lane offset from the column's inline START, 0–100 — not from its physical\n * left. Concurrent events are laid out in reading order, so under `dir=\"rtl\"`\n * lane 0 belongs at the right; a physical `left` would read the cluster\n * back-to-front, which is the one thing in this component that was not logical.\n */\n readonly inlineStart: number;\n /** Lane width as a share of the column, 0–100. */\n readonly width: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\ninterface DayCell {\n readonly date: Date;\n readonly key: string;\n readonly day: string;\n readonly label: string;\n readonly inMonth: boolean;\n readonly isToday: boolean;\n readonly bands: readonly BandChip[];\n readonly hidden: number;\n}\n\ninterface MonthWeek {\n readonly key: string;\n readonly days: readonly DayCell[];\n /**\n * How many lanes the row's chips fill. The chips are absolutely positioned,\n * so this is the only way the row's height can know about them.\n */\n readonly lanes: number;\n}\n\ninterface TimeCell {\n readonly key: string;\n readonly date: Date;\n readonly label: string;\n readonly chips: readonly TimeChip[];\n}\n\ninterface TimeRow {\n readonly key: string;\n readonly label: string;\n /** Minutes from midnight — also what the drag target reads off the cell. */\n readonly minutes: number;\n readonly major: boolean;\n readonly cells: readonly TimeCell[];\n}\n\ninterface ColumnHeader {\n readonly key: string;\n readonly date: Date;\n readonly weekday: string;\n readonly day: string;\n readonly label: string;\n readonly isToday: boolean;\n}\n\n/** Live drag state. `null` whenever the pointer is not down on a chip. */\ninterface DragState {\n readonly event: WrCalendarEvent;\n readonly kind: 'move' | 'resize';\n readonly originDate: Date;\n readonly originMinutes: number;\n readonly pointerId: number;\n}\n\n/**\n * Month / week / day event calendar with drag to move and resize.\n *\n * `events` is an INPUT, never mutated: a drag emits `eventChange` describing\n * where the event would land and stops there. Apply it to your own state and\n * the calendar re-renders — so an unhandled output is a cancelled drag, an\n * optimistic update is one `set`, and a rejected server write needs no rollback\n * path inside the component.\n *\n * Every chip lives inside the `role=\"gridcell\"` where it starts and reaches out\n * with `calc()` widths or percentage heights. That is what keeps the ARIA grid\n * valid — an events layer floating over the grid would leave rows owning\n * something other than cells — and it means no pixel measurement anywhere.\n *\n * **Keyboard.** The grid is one tab stop with a roving cursor: arrows move by\n * day (left / right) and by week or slot (up / down), `Home` / `End` jump to\n * the ends of the row, `Enter` on an empty cell emits `slotClick`, and `Enter`\n * on a cell holding events focuses the first chip (`Escape` returns). On a\n * focused chip, `Alt` + arrows move the event — the keyboard equivalent of the\n * drag, emitting the same `eventChange`.\n *\n * Date math and formatting go through {@link WrDateAdapter} — the native one\n * unless `provideWr(withDates(...))` registers another.\n *\n * @example\n * ```html\n * <wr-event-calendar\n * editable\n * [events]=\"events()\"\n * [(view)]=\"view\"\n * [(date)]=\"anchor\"\n * (eventChange)=\"apply($event)\"\n * (slotClick)=\"compose($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/event-calendar\n */\n@Component({\n selector: 'wr-event-calendar',\n templateUrl: './event-calendar.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-event-calendar',\n '[class]': 'classes()',\n // A drag has to end wherever the pointer is released, including outside the\n // chip it started on — so the host owns the release, not the chip.\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'drag.set(null)',\n },\n imports: [NgTemplateOutlet, WrButton, WrButtonGroup],\n})\nexport class WrEventCalendar {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('event-calendar');\n }\n\n /** Everything to render. Never mutated — see `eventChange`. */\n readonly events = input<readonly WrCalendarEvent[]>([]);\n\n /** Which span is shown. Two-way bindable. @default 'month' */\n readonly view = model<WrCalendarView>('month');\n\n /** Any date inside the shown span. Two-way bindable. */\n readonly date = model<Date>(new Date());\n\n /** Which buttons the view switcher offers. Empty hides it. */\n readonly views = input<readonly WrCalendarView[]>(['month', 'week', 'day']);\n\n /** Allow dragging chips to move and resize them. @default false */\n readonly editable = input(false, { transform: coerceBooleanProperty });\n\n /** Minutes per row in the time views — also the drag snap. @default 30 */\n readonly slotMinutes = input(30, { transform: wrNumAttr(30) });\n\n /** First hour the time views show. @default 0 */\n readonly dayStartHour = input(0, { transform: wrNumAttr(0) });\n\n /** First hour they do NOT show, exclusive. @default 24 */\n readonly dayEndHour = input(24, { transform: wrNumAttr(24) });\n\n /** Lanes a month cell shows before collapsing the rest into “+N more”. @default 3 */\n readonly maxLanes = input(3, { transform: wrNumAttr(3) });\n\n /** Hide the built-in header — supply your own navigation instead. @default false */\n readonly hideHeader = input(false, { transform: coerceBooleanProperty });\n\n /** A chip was activated. */\n readonly eventClick = output<WrCalendarEvent>();\n\n /** Empty space was activated — the slot the user pointed at. */\n readonly slotClick = output<WrCalendarSlot>();\n\n /** A drag or an `Alt` + arrow finished. Apply it yourself; nothing moves until you do. */\n readonly eventChange = output<WrCalendarEventChange>();\n\n private readonly adapter = inject<WrDateAdapter<Date>>(WrDateAdapter);\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly chipTpl = contentChild(WrCalendarEventTemplate);\n\n // Reactive: a calendar is as long-lived as the page it sits on, so a catalog that\n // finishes loading after construction — or a locale switch — has to reach these.\n // Resolved once, as they were, they froze the English defaults in place.\n protected readonly todayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.today', 'Today');\n protected readonly previousLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.previous', 'Previous');\n protected readonly nextLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.next', 'Next');\n protected readonly allDayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.allDay', 'All day');\n protected readonly timeLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.time', 'Time');\n protected readonly moreLabel = useI18nFormatter('eventCalendar.more', '+{{count}} more');\n // The five composed strings. Each was a template literal, which localises the\n // words inside it and freezes the word ORDER and the punctuation between them\n // — `wr-calendar` learned the same thing one component over and its\n // `calendar.header` / `.yearRange` / `.dayLabel` are the shape copied here.\n private readonly headerText = useI18nFormatter('eventCalendar.header', '{{month}} {{year}}');\n private readonly rangeText = useI18nFormatter('eventCalendar.range', '{{from}} – {{to}}');\n private readonly chipLabelText = useI18nFormatter('eventCalendar.chipLabel', '{{title}}, {{time}}');\n private readonly slotLabelText = useI18nFormatter('eventCalendar.slotLabel', '{{time}} — {{date}}');\n private readonly allDayCellText = useI18nFormatter('eventCalendar.allDayCellLabel', '{{label}} — {{date}}');\n private readonly monthLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.month', 'Month');\n private readonly weekLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.week', 'Week');\n private readonly dayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.day', 'Day');\n\n protected readonly viewLabels = computed<Record<WrCalendarView, string>>(() => ({\n month: this.monthLabel(),\n week: this.weekLabel(),\n day: this.dayLabel(),\n }));\n\n /** Accessible name of the grid; overridable for a page with several. */\n readonly ariaLabel = input<string | null>(null);\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'eventCalendar.label', 'Calendar');\n\n /**\n * `[day, minutes]` of the roving cursor — `minutes === -1` means a month cell\n * or the all-day band. Raw, so it survives a view switch; read\n * {@link cursorCell}, which clamps it to what the current view actually has.\n */\n private readonly cursor = signal<readonly [number, number]>([0, -1]);\n\n /**\n * The cursor as the current view can honour it. Exactly one cell may carry\n * `tabindex=\"0\"`, so a stale coordinate — the 09:30 row after switching to\n * month, day 34 after switching to week — must fall back to a real cell\n * rather than leave the grid with no tab stop at all.\n */\n protected readonly cursorCell = computed<readonly [number, number]>(() => {\n const [day, minutes] = this.cursor();\n const columns = Math.max(1, this.days().length);\n const clamped = Math.min(columns - 1, Math.max(0, day));\n\n if (this.view() === 'month') return [clamped, -1];\n if (minutes === -1 && this.hasAllDay()) return [clamped, -1];\n\n const rows = this.rows();\n const known = rows.some(row => row.minutes === minutes);\n return [clamped, known ? minutes : (rows[0]?.minutes ?? 0)];\n });\n\n /** Non-null only while a pointer is down on a chip. @internal */\n protected readonly drag = signal<DragState | null>(null);\n\n protected readonly dragging = computed(() => this.drag()?.event.id ?? null);\n\n protected readonly chipTemplate = computed<TemplateRef<WrCalendarEventContext> | null>(\n () => this.chipTpl()?.template ?? null\n );\n\n protected readonly classes = computed(() => {\n const parts = [`wr-event-calendar--${this.view()}`];\n if (this.editable()) parts.push('wr-event-calendar--editable');\n if (this.drag()) parts.push('wr-event-calendar--dragging');\n return parts.join(' ');\n });\n\n // ---------------------------------------------------------------- ranges\n\n /** Inclusive-exclusive window the current view covers. */\n private readonly range = computed<readonly [Date, Date]>(() => {\n const anchor = this.startOfDay(this.date());\n switch (this.view()) {\n case 'day':\n return [anchor, this.adapter.addDays(anchor, 1)];\n case 'week': {\n const start = this.startOfWeek(anchor);\n return [start, this.adapter.addDays(start, DAYS_PER_WEEK)];\n }\n default: {\n const first = this.adapter.createDate(this.adapter.getYear(anchor), this.adapter.getMonth(anchor), 1);\n const start = this.startOfWeek(first);\n return [start, this.adapter.addDays(start, MONTH_ROWS * DAYS_PER_WEEK)];\n }\n }\n });\n\n /** Every day the view shows, left to right. */\n private readonly days = computed<readonly Date[]>(() => {\n const [start, end] = this.range();\n const count = Math.round((end.getTime() - start.getTime()) / (MINUTES_PER_DAY * 60_000));\n return Array.from({ length: count }, (_, i) => this.adapter.addDays(start, i));\n });\n\n /** Only what overlaps the window — everything downstream works off this. */\n private readonly visible = computed<readonly WrCalendarEvent[]>(() => {\n const [start, end] = this.range();\n return [...this.events()]\n .filter(e => e.end.getTime() > start.getTime() && e.start.getTime() < end.getTime())\n .sort((a, b) => {\n const byStart = a.start.getTime() - b.start.getTime();\n // Ties go to the longer event, so a week-long band claims its lane\n // before the one-day events sitting alongside it.\n return byStart !== 0 ? byStart : b.end.getTime() - a.end.getTime();\n });\n });\n\n protected readonly title = computed(() => {\n const anchor = this.date();\n const months = this.adapter.getMonthNames('long');\n switch (this.view()) {\n case 'day':\n return this.adapter.format(anchor, 'longDate');\n case 'week': {\n const [start] = this.range();\n const last = this.adapter.addDays(start, DAYS_PER_WEEK - 1);\n return this.rangeText({\n from: this.adapter.format(start, 'mediumDate'),\n to: this.adapter.format(last, 'mediumDate'),\n });\n }\n default:\n return this.headerText({ month: months[this.adapter.getMonth(anchor)], year: this.adapter.getYear(anchor) });\n }\n });\n\n /**\n * The adapter contract is \"names ordered from `getFirstDayOfWeek()` onwards\",\n * so the list is ALREADY rotated. Rotating it again here put every column one\n * day out for every locale whose week does not start on Sunday — invisible in\n * en-US, wrong everywhere else. `wr-calendar` consumes the same call directly.\n */\n protected readonly weekdayNames = computed(() => this.adapter.getDayOfWeekNames('short'));\n\n protected readonly switcher = computed(() => this.views().map(view => ({ view, label: this.viewLabels()[view] })));\n\n // ----------------------------------------------------------- month model\n\n protected readonly weeks = computed<readonly MonthWeek[]>(() => {\n const days = this.days();\n const events = this.visible();\n const weeks: MonthWeek[] = [];\n const month = this.adapter.getMonth(this.date());\n\n for (let w = 0; w * DAYS_PER_WEEK < days.length; w++) {\n const row = days.slice(w * DAYS_PER_WEEK, (w + 1) * DAYS_PER_WEEK);\n const { chips, hidden } = this.bandLayout(events, row, this.maxLanes());\n\n weeks.push({\n key: this.iso(row[0]),\n lanes: this.laneCount(chips),\n days: row.map((date, col) => ({\n date,\n key: this.iso(date),\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n inMonth: this.adapter.getMonth(date) === month,\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n bands: chips.filter(chip => chip.column === col),\n hidden: hidden[col],\n })),\n });\n }\n\n return weeks;\n });\n\n // ------------------------------------------------------------ time model\n\n protected readonly columns = computed<readonly ColumnHeader[]>(() => {\n const weekdays = this.adapter.getDayOfWeekNames('short');\n const first = this.adapter.getFirstDayOfWeek();\n return this.days().map(date => ({\n key: this.iso(date),\n date,\n // `weekdays` is indexed from the week's first day; `getDayOfWeek` is\n // absolute (0 = Sunday). Mixing the two spaces named Monday \"Tue\".\n weekday: weekdays[(this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK],\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n }));\n });\n\n /** The all-day band above the time grid — same layout as a month week. */\n protected readonly allDayBands = computed<readonly BandChip[]>(() => {\n const days = this.days();\n const events = this.visible().filter(e => e.allDay === true || this.spansWholeDay(e));\n return this.bandLayout(events, days, Number.POSITIVE_INFINITY).chips;\n });\n\n protected readonly allDayCells = computed<\n readonly { key: string; date: Date; label: string; bands: readonly BandChip[] }[]\n >(() => {\n const days = this.days();\n const chips = this.allDayBands();\n return days.map((date, col) => ({\n key: this.iso(date),\n date,\n label: this.allDayCellText({ label: this.allDayLabel(), date: this.adapter.format(date, 'longDate') }),\n bands: chips.filter(chip => chip.column === col),\n }));\n });\n\n protected readonly hasAllDay = computed(() => this.allDayBands().length > 0);\n\n /** Lanes the all-day band fills — it has no `maxLanes` cap, so its row has to grow instead. */\n protected readonly allDayLanes = computed(() => this.laneCount(this.allDayBands()));\n\n protected readonly rows = computed<readonly TimeRow[]>(() => {\n const slot = Math.max(5, this.slotMinutes());\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const days = this.days();\n const placed = this.timeLayout(days, slot);\n const rows: TimeRow[] = [];\n\n // Each half of a cell's name is invariant along one axis: the day reads the\n // same down a column, the clock the same across a row. Formatting per CELL\n // asked the adapter for 336 of each on a default week (48 slots × 7 days)\n // where 48 clocks and 7 dates say the same thing, and\n // `WrNativeDateAdapter.format` builds a fresh `Intl.DateTimeFormat` per call.\n const dayLabels = days.map(date => this.adapter.format(date, 'longDate'));\n\n for (let minutes = from; minutes < to; minutes += slot) {\n const clock = this.clock(minutes);\n rows.push({\n key: String(minutes),\n minutes,\n major: minutes % 60 === 0,\n label: minutes % 60 === 0 ? clock : '',\n cells: days.map((date, col) => ({\n key: `${this.iso(date)}:${minutes}`,\n date,\n label: this.slotLabelText({ time: clock, date: dayLabels[col] }),\n chips: placed[col].filter(chip => chip.slotMinutes === minutes).map(chip => chip.chip),\n })),\n });\n }\n\n return rows;\n });\n\n // ------------------------------------------------------------------ nav\n\n protected step(direction: -1 | 1): void {\n const anchor = this.date();\n switch (this.view()) {\n case 'day':\n this.date.set(this.adapter.addDays(anchor, direction));\n break;\n case 'week':\n this.date.set(this.adapter.addDays(anchor, direction * DAYS_PER_WEEK));\n break;\n default:\n this.date.set(this.adapter.addMonths(anchor, direction));\n }\n }\n\n protected goToday(): void {\n this.date.set(this.adapter.today());\n }\n\n protected setView(view: WrCalendarView): void {\n this.view.set(view);\n }\n\n /** “+N more” opens that day — the overflow is only ever a month-view problem. */\n protected openDay(date: Date): void {\n this.date.set(date);\n this.view.set('day');\n }\n\n // -------------------------------------------------------------- pointer\n\n protected onChipPointerDown(event: PointerEvent, chipEvent: WrCalendarEvent, kind: 'move' | 'resize'): void {\n if (!this.canDrag(chipEvent) || event.button !== 0) return;\n\n // The cell is found by geometry, not through the chip: `cellUnder` skips\n // every chip in the hit-test stack, so neither this one nor a neighbour\n // overlapping it can stand in for the cell under the pointer.\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n try {\n (event.target as HTMLElement).setPointerCapture?.(event.pointerId);\n } catch {\n // Capture is an optimisation — it keeps the release on this element even\n // when the pointer leaves it. A pointer that is already gone throws here,\n // and losing capture is not a reason to lose the drag.\n }\n event.preventDefault();\n event.stopPropagation();\n\n this.drag.set({\n event: chipEvent,\n kind,\n originDate: cell.date,\n originMinutes: cell.minutes,\n pointerId: event.pointerId,\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n const state = this.drag();\n this.drag.set(null);\n if (state?.pointerId !== event.pointerId) return;\n\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n const dayDelta = this.daysBetween(state.originDate, cell.date);\n const minuteDelta = cell.minutes < 0 || state.originMinutes < 0 ? 0 : cell.minutes - state.originMinutes;\n if (dayDelta === 0 && minuteDelta === 0) return;\n\n const { event: source, kind } = state;\n if (kind === 'resize') {\n const end = this.shift(source.end, dayDelta, minuteDelta);\n // A resize that would end at or before the start is a no-op, not an\n // inverted event.\n if (end.getTime() <= source.start.getTime()) return;\n this.eventChange.emit({ event: source, start: source.start, end, kind });\n return;\n }\n\n this.eventChange.emit({\n event: source,\n start: this.shift(source.start, dayDelta, minuteDelta),\n end: this.shift(source.end, dayDelta, minuteDelta),\n kind,\n });\n }\n\n protected onChipClick(event: WrCalendarEvent): void {\n this.eventClick.emit(event);\n }\n\n protected onCellClick(date: Date, minutes: number): void {\n this.slotClick.emit(this.slotAt(date, minutes));\n }\n\n // ------------------------------------------------------------- keyboard\n\n protected onChipKeyDown(event: KeyboardEvent, chipEvent: WrCalendarEvent): void {\n if (event.key === 'Escape') {\n this.focusCell(event);\n return;\n }\n\n if (!event.altKey || !this.canDrag(chipEvent)) return;\n\n const slot = Math.max(5, this.slotMinutes());\n const inTime = this.view() !== 'month';\n let days = 0;\n let minutes = 0;\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n days = -1;\n break;\n case 'ArrowRight':\n days = 1;\n break;\n case 'ArrowUp':\n if (inTime) minutes = -slot;\n else days = -DAYS_PER_WEEK;\n break;\n case 'ArrowDown':\n if (inTime) minutes = slot;\n else days = DAYS_PER_WEEK;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n\n // `Shift` turns the same gesture into a resize, moving the END alone. Without it\n // the keyboard could move an event and never re-length one — and the resize grab\n // area is `aria-hidden` and unfocusable precisely BECAUSE this exists, so its\n // absence left the operation on the mouse only.\n if (event.shiftKey) {\n const end = this.shift(chipEvent.end, days, minutes);\n // Same rule as the pointer path: a resize that would end at or before the\n // start is a no-op rather than an inverted event.\n if (end.getTime() <= chipEvent.start.getTime()) return;\n this.eventChange.emit({ event: chipEvent, start: chipEvent.start, end, kind: 'resize' });\n this.refocusChip(chipEvent.id);\n return;\n }\n\n this.eventChange.emit({\n event: chipEvent,\n start: this.shift(chipEvent.start, days, minutes),\n end: this.shift(chipEvent.end, days, minutes),\n kind: 'move',\n });\n this.refocusChip(chipEvent.id);\n }\n\n /**\n * Put focus back on the chip a keyboard move re-rendered.\n *\n * A host that applies the change re-renders the event in another cell, under\n * another track key, so the focused button is destroyed and focus falls to\n * `<body>` — every `Alt` + arrow then had to start again from the top of the\n * page. Only a LOST focus is taken back: a host that refused the change, or\n * moved focus somewhere on purpose, is left alone. `afterNextRender`, never a\n * microtask: zoneless change detection runs in a macrotask, so a microtask\n * would look before the new chip exists.\n */\n private refocusChip(id: WrCalendarEvent['id']): void {\n afterNextRender(\n () => {\n const active = this.document.activeElement;\n if (active && active !== this.document.body && active.isConnected) return;\n const chip = [...this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-event-calendar__chip')].find(\n el => el.dataset['eventId'] === String(id)\n );\n chip?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected onGridKeyDown(event: KeyboardEvent): void {\n // Handled per cell, not on the grid: the element carrying the keyboard\n // should be the one that actually holds focus. Chips sit inside cells and\n // own their keys, so let anything originating in one bubble straight past.\n if (event.target !== event.currentTarget) return;\n\n const [day, minutes] = this.cursorCell();\n const columns = this.days().length;\n const rows = this.rows();\n const inTime = this.view() !== 'month';\n let next: readonly [number, number];\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n next = [Math.max(0, day - 1), minutes];\n break;\n case 'ArrowRight':\n next = [Math.min(columns - 1, day + 1), minutes];\n break;\n case 'ArrowUp':\n // Hold position at the top row, the way ArrowDown does at the bottom. A\n // `Math.max(0, …)` clamp reads as the same thing and is not: from the\n // Wednesday of the first week it lands on 0, so the cursor jumps\n // SIDEWAYS to Sunday instead of staying put.\n next = inTime\n ? [day, this.stepRow(minutes, -1, rows)]\n : [day - DAYS_PER_WEEK >= 0 ? day - DAYS_PER_WEEK : day, minutes];\n break;\n case 'ArrowDown':\n next = inTime\n ? [day, this.stepRow(minutes, 1, rows)]\n : [day + DAYS_PER_WEEK < columns ? day + DAYS_PER_WEEK : day, minutes];\n break;\n case 'Home':\n next = [day - (day % DAYS_PER_WEEK), minutes];\n break;\n case 'End':\n next = [Math.min(columns - 1, day - (day % DAYS_PER_WEEK) + DAYS_PER_WEEK - 1), minutes];\n break;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const cell = event.target as HTMLElement;\n const chip = cell.querySelector<HTMLElement>('.wr-event-calendar__chip');\n if (chip) chip.focus();\n else this.onCellClick(this.days()[day], minutes);\n return;\n }\n default:\n return;\n }\n\n event.preventDefault();\n this.cursor.set(next);\n this.focusCursor(event.currentTarget as HTMLElement);\n }\n\n /**\n * Keep the roving cursor on the cell that actually has focus.\n *\n * The cursor was only ever written by an arrow key, while focus moves for three\n * other reasons — a click, a Tab onto a chip, Escape out of one — so the next\n * arrow read a coordinate nobody was standing on and threw focus back to it,\n * usually the top-left of the grid.\n */\n protected onCellFocus(day: number, minutes: number): void {\n const [d, m] = this.cursor();\n if (d !== day || m !== minutes) this.cursor.set([day, minutes]);\n }\n\n protected isCursor(day: number, minutes: number): boolean {\n const [d, m] = this.cursorCell();\n return d === day && m === minutes;\n }\n\n // --------------------------------------------------------------- layout\n\n /**\n * Greedy lane packing for day-spanning chips. Sorted by start then by length,\n * each segment takes the first lane its columns are free in — the classic\n * interval-graph colouring, and the reason a long event keeps one lane across\n * the whole week instead of stair-stepping.\n *\n * `limit` caps the visible lanes; anything past it is reported per column so\n * the cell can say how much it is hiding.\n */\n private bandLayout(\n events: readonly WrCalendarEvent[],\n days: readonly Date[],\n limit: number\n ): { chips: readonly BandChip[]; hidden: readonly number[] } {\n const first = days[0];\n const last = this.adapter.addDays(days[days.length - 1], 1);\n const lanes: number[][] = [];\n const chips: BandChip[] = [];\n const hidden = days.map(() => 0);\n\n for (const event of events) {\n if (event.end.getTime() <= first.getTime() || event.start.getTime() >= last.getTime()) continue;\n\n const from = Math.max(0, this.daysBetween(first, this.startOfDay(event.start)));\n // An exclusive end landing exactly on midnight belongs to the previous\n // day — otherwise every all-day event paints one column too wide.\n const endDay = this.startOfDay(new Date(event.end.getTime() - 1));\n const to = Math.min(days.length - 1, this.daysBetween(first, endDay));\n if (to < from) continue;\n\n let lane = lanes.findIndex(taken => taken.every(col => col < from || col > to));\n if (lane === -1) {\n lane = lanes.length;\n lanes.push([]);\n }\n for (let col = from; col <= to; col++) lanes[lane].push(col);\n\n if (lane >= limit) {\n for (let col = from; col <= to; col++) hidden[col]++;\n continue;\n }\n\n chips.push({\n key: `${String(event.id)}:${from}`,\n event,\n column: from,\n span: to - from + 1,\n lane,\n continuesBefore: event.start.getTime() < first.getTime(),\n continuesAfter: event.end.getTime() > last.getTime(),\n });\n }\n\n return { chips, hidden };\n }\n\n private laneCount(chips: readonly BandChip[]): number {\n return chips.reduce((count, chip) => Math.max(count, chip.lane + 1), 0);\n }\n\n /**\n * Column layout inside one day: events that overlap in time share the width.\n * Clusters are built by a running high-water mark — a new cluster starts the\n * moment an event begins after everything before it has ended.\n */\n private timeLayout(days: readonly Date[], slot: number): readonly { chip: TimeChip; slotMinutes: number }[][] {\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const timed = this.visible().filter(e => !e.allDay && !this.spansWholeDay(e));\n\n return days.map(day => {\n const dayStart = this.startOfDay(day);\n const windowStart = dayStart.getTime() + from * 60_000;\n const windowEnd = dayStart.getTime() + to * 60_000;\n\n const onDay = timed\n .filter(e => e.end.getTime() > windowStart && e.start.getTime() < windowEnd)\n .map(event => ({\n event,\n from: Math.max(windowStart, event.start.getTime()),\n to: Math.min(windowEnd, event.end.getTime()),\n }))\n .sort((a, b) => {\n const byStart = a.from - b.from;\n return byStart !== 0 ? byStart : b.to - a.to;\n });\n\n const out: { chip: TimeChip; slotMinutes: number }[] = [];\n let cluster: typeof onDay = [];\n let highWater = -1;\n\n const flush = (): void => {\n for (const [index, item] of cluster.entries()) {\n const minutes = Math.floor((item.from - dayStart.getTime()) / 60_000);\n const slotStart = from + Math.floor((minutes - from) / slot) * slot;\n const length = (item.to - item.from) / 60_000;\n\n out.push({\n slotMinutes: slotStart,\n chip: {\n key: `${String(item.event.id)}:${minutes}`,\n event: item.event,\n top: ((minutes - slotStart) / slot) * 100,\n height: (length / slot) * 100,\n inlineStart: (index / cluster.length) * 100,\n width: (1 / cluster.length) * 100,\n continuesBefore: item.event.start.getTime() < windowStart,\n continuesAfter: item.event.end.getTime() > windowEnd,\n },\n });\n }\n cluster = [];\n };\n\n for (const item of onDay) {\n if (cluster.length > 0 && item.from >= highWater) flush();\n cluster.push(item);\n highWater = Math.max(highWater, item.to);\n }\n flush();\n\n return out;\n });\n }\n\n // --------------------------------------------------------------- chrome\n\n protected chipLabel(event: WrCalendarEvent): string {\n const time = event.allDay ? this.allDayLabel() : this.adapter.format(event.start, 'time');\n return this.chipLabelText({ title: event.title, time });\n }\n\n protected chipTime(event: WrCalendarEvent): string {\n return event.allDay ? this.allDayLabel() : this.adapter.format(event.start, 'time');\n }\n\n protected canDrag(event: WrCalendarEvent): boolean {\n return this.editable() && event.editable !== false;\n }\n\n // --------------------------------------------------------------- helpers\n\n private slotAt(date: Date, minutes: number): WrCalendarSlot {\n if (minutes < 0) {\n const start = this.startOfDay(date);\n return { start, end: this.adapter.addDays(start, 1), allDay: true };\n }\n const start = new Date(this.startOfDay(date).getTime() + minutes * 60_000);\n return { start, end: new Date(start.getTime() + Math.max(5, this.slotMinutes()) * 60_000), allDay: false };\n }\n\n /**\n * The `[data-cell-date]` under the pointer, or `null` outside the grid.\n *\n * Walks the whole hit-test stack rather than climbing from the topmost\n * element. A chip lives in the cell it STARTS in and reaches past it, so\n * `elementFromPoint(…).closest()` over any chip — a neighbour covering the\n * drop slot, a multi-day band covering the drop day — answered with that\n * chip's start cell, and the event landed there instead of under the\n * pointer. The stack lists the cell itself, below the chips; something that\n * is not part of this calendar coming first means the pointer is over\n * another layer, which is not a drop.\n */\n private cellUnder(x: number, y: number): { date: Date; minutes: number } | null {\n const host = this.host.nativeElement;\n for (const el of this.document.elementsFromPoint?.(x, y) ?? []) {\n if (!host.contains(el)) return null;\n if (!(el instanceof HTMLElement) || !el.matches('[data-cell-date]')) continue;\n // Epoch millis rather than a formatted date: `new Date('2026-08-08')` is\n // parsed as UTC and lands on the previous day west of Greenwich.\n const stamp = Number(el.dataset['cellDate']);\n if (!Number.isFinite(stamp)) return null;\n return { date: new Date(stamp), minutes: Number(el.dataset['cellMinutes'] ?? -1) };\n }\n return null;\n }\n\n /** Value of a cell's `data-cell-date`. @internal */\n protected stamp(date: Date): number {\n return this.startOfDay(date).getTime();\n }\n\n private focusCursor(from: HTMLElement): void {\n const [day, minutes] = this.cursorCell();\n from.closest('[role=\"grid\"]')?.querySelector<HTMLElement>(`[data-cell-index=\"${day}:${minutes}\"]`)?.focus();\n }\n\n private focusCell(event: KeyboardEvent): void {\n event.preventDefault();\n (event.target as HTMLElement).closest<HTMLElement>('[data-cell-date]')?.focus();\n }\n\n /**\n * Move one time row, treating the all-day band as the row above the first —\n * otherwise the band is mouse-only, which is the kind of gap that makes a\n * keyboard user give up on the whole grid.\n */\n private stepRow(minutes: number, direction: -1 | 1, rows: readonly TimeRow[]): number {\n if (minutes === -1) return direction === 1 ? (rows[0]?.minutes ?? -1) : -1;\n\n const index = rows.findIndex(row => row.minutes === minutes);\n if (index === -1) return rows[0]?.minutes ?? -1;\n if (index === 0 && direction === -1) return this.hasAllDay() ? -1 : minutes;\n\n return rows[Math.min(rows.length - 1, index + direction)].minutes;\n }\n\n private shift(date: Date, days: number, minutes: number): Date {\n return new Date(this.adapter.addDays(date, days).getTime() + minutes * 60_000);\n }\n\n private startOfDay(date: Date): Date {\n return this.adapter.setTime(date, 0, 0, 0);\n }\n\n private startOfWeek(date: Date): Date {\n const first = this.adapter.getFirstDayOfWeek();\n const offset = (this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK;\n return this.startOfDay(this.adapter.addDays(date, -offset));\n }\n\n /** Whole days apart — computed on the day floor, so DST cannot round it off. */\n private daysBetween(from: Date, to: Date): number {\n const a = this.startOfDay(from);\n const b = this.startOfDay(to);\n return Math.round((b.getTime() - a.getTime()) / (MINUTES_PER_DAY * 60_000));\n }\n\n private spansWholeDay(event: WrCalendarEvent): boolean {\n return event.end.getTime() - event.start.getTime() >= MINUTES_PER_DAY * 60_000;\n }\n\n private clock(minutes: number): string {\n const date = this.adapter.setTime(this.adapter.today(), Math.floor(minutes / 60), minutes % 60, 0);\n return this.adapter.format(date, 'time');\n }\n\n private iso(date: Date): string {\n return `${this.adapter.getYear(date)}-${this.adapter.getMonth(date) + 1}-${this.adapter.getDate(date)}`;\n }\n\n /**\n * The key as the grid SEES it.\n *\n * A day step follows visual order, so under `dir=\"rtl\"` ArrowRight goes back a\n * day. Up/Down move by week or by row and never flip; Home/End are semantic.\n * Both key handlers route through here — the grid nav and the `Alt`+arrow drag,\n * which moves an event and would otherwise reschedule it the wrong way.\n */\n private inlineKey(key: string): string {\n if (this.dir?.value !== 'rtl') return key;\n if (key === 'ArrowRight') return 'ArrowLeft';\n if (key === 'ArrowLeft') return 'ArrowRight';\n return key;\n }\n}\n","<!--\n Two grids, one rule: a chip always lives inside the `role=\"gridcell\"` where it\n STARTS, and reaches out from there — `calc()` widths for day-spanning bands,\n percentage heights for timed chips. A floating events layer would read better\n in the template and would leave `role=\"row\"` owning something other than\n cells, which is exactly what the axe gate rejects.\n-->\n@if (!hideHeader()) {\n <div class=\"wr-event-calendar__header\">\n <div class=\"wr-event-calendar__nav\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--prev\"\n [attr.aria-label]=\"previousLabel()\"\n (click)=\"step(-1)\"\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=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button wr-btn type=\"button\" size=\"sm\" outlined class=\"wr-event-calendar__today\" (click)=\"goToday()\">\n {{ todayLabel() }}\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--next\"\n [attr.aria-label]=\"nextLabel()\"\n (click)=\"step(1)\"\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=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <h2 class=\"wr-event-calendar__title\">{{ title() }}</h2>\n\n @if (switcher().length > 1) {\n <wr-btn-group>\n @for (item of switcher(); track item.view) {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-event-calendar__view\"\n [outlined]=\"view() !== item.view\"\n [color]=\"view() === item.view ? 'primary' : null\"\n [attr.aria-pressed]=\"view() === item.view\"\n (click)=\"setView(item.view)\"\n >\n {{ item.label }}\n </button>\n }\n </wr-btn-group>\n }\n </div>\n}\n\n@if (view() === 'month') {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--month\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (name of weekdayNames(); track $index) {\n <div role=\"columnheader\" class=\"wr-event-calendar__weekday\">{{ name }}</div>\n }\n </div>\n\n @for (week of weeks(); track week.key; let w = $index) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [style.--wr-event-calendar-lanes]=\"week.lanes\">\n @for (cell of week.days; track cell.key; let c = $index) {\n @let index = w * 7 + c;\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--day\"\n [class.wr-event-calendar__cell--muted]=\"!cell.inMonth\"\n [class.wr-event-calendar__cell--today]=\"cell.isToday\"\n [attr.tabindex]=\"isCursor(index, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${index}:-1`\"\n (focusin)=\"onCellFocus(index, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n <span class=\"wr-event-calendar__daynum\" aria-hidden=\"true\">{{ cell.day }}</span>\n\n @for (chip of cell.bands; track chip.key) {\n <ng-container\n [ngTemplateOutlet]=\"band\"\n [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '1.75rem' }\"\n />\n }\n\n @if (cell.hidden > 0) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__more\"\n [style.--wr-event-calendar-lane]=\"maxLanes()\"\n (click)=\"openDay(cell.date); $event.stopPropagation()\"\n >\n {{ moreLabel({ count: cell.hidden }) }}\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--time\"\n [style.--wr-event-calendar-cols]=\"columns().length\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n <div role=\"columnheader\" class=\"wr-event-calendar__gutter\" [attr.aria-label]=\"timeLabel()\"></div>\n @for (column of columns(); track column.key) {\n <div\n role=\"columnheader\"\n class=\"wr-event-calendar__colhead\"\n [class.wr-event-calendar__colhead--today]=\"column.isToday\"\n >\n <span class=\"wr-event-calendar__colhead-weekday\">{{ column.weekday }}</span>\n <span class=\"wr-event-calendar__colhead-day\">{{ column.day }}</span>\n </div>\n }\n </div>\n\n @if (hasAllDay()) {\n <div\n role=\"row\"\n class=\"wr-event-calendar__row wr-event-calendar__row--allday\"\n [style.--wr-event-calendar-lanes]=\"allDayLanes()\"\n >\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ allDayLabel() }}</div>\n @for (cell of allDayCells(); track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--allday\"\n [attr.tabindex]=\"isCursor(c, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${c}:-1`\"\n (focusin)=\"onCellFocus(c, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.bands; track chip.key) {\n <ng-container [ngTemplateOutlet]=\"band\" [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '0rem' }\" />\n }\n </div>\n }\n </div>\n }\n\n @for (row of rows(); track row.key) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [class.wr-event-calendar__row--major]=\"row.major\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ row.label }}</div>\n @for (cell of row.cells; track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--slot\"\n [class.wr-event-calendar__cell--major]=\"row.major\"\n [attr.tabindex]=\"isCursor(c, row.minutes) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"row.minutes\"\n [attr.data-cell-index]=\"`${c}:${row.minutes}`\"\n (focusin)=\"onCellFocus(c, row.minutes)\"\n (click)=\"onCellClick(cell.date, row.minutes)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.chips; track chip.key) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--time\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.top.%]=\"chip.top\"\n [style.--wr-event-calendar-block-size.%]=\"chip.height\"\n [style.--wr-event-calendar-inline-start.%]=\"chip.inlineStart\"\n [style.--wr-event-calendar-inline-size.%]=\"chip.width\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n <span class=\"wr-event-calendar__chip-time\" aria-hidden=\"true\">{{ chipTime(chip.event) }}</span>\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n\n @if (canDrag(chip.event) && !chip.continuesAfter) {\n <!--\n A grab area, not a control: the same resize is on the keyboard as\n `Alt` + `Shift` + arrows on the chip itself, so exposing a second\n focusable thing here would add a tab stop that leads nowhere.\n -->\n <span\n class=\"wr-event-calendar__resize\"\n aria-hidden=\"true\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'resize')\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n\n<!-- One chip shape for both day-spanning cases: month cells and the all-day band. -->\n<ng-template #band let-chip let-offset=\"offset\">\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--band\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.--wr-event-calendar-span]=\"chip.span\"\n [style.--wr-event-calendar-lane]=\"chip.lane\"\n [style.--wr-event-calendar-offset]=\"offset\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n </button>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,IAAa,0BAAb,MAAa,wBAAuB;CACzB,WAAW,OAA4C,WAAW;CADhE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAuB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAvB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAuB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAvB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EAHnC,MAAA;EAAU,MAAA,CAAA,EACT,UAAU,+BACX,CAAA;;;;;;;;;ACkBD,MAAM,cAAc,OAAsB,IAAI,CAAC,CAAC,WAAU;AAE1D,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;AAwJtB,IAAa,kBAAb,MAAa,gBAAe;CAC1B,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,gBAAgB;CACnF;CAGS,SAAS,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAG9C,OAAO,MAAsB,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGrC,OAAO,sBAAY,IAAI,KAAI,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAG9B,QAAQ,MAA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AA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,uBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-event-calendar.mjs","names":[],"sources":["../../../projects/lib/event-calendar/event-calendar-event-template.ts","../../../projects/lib/event-calendar/event-calendar.ts","../../../projects/lib/event-calendar/event-calendar.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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrCalendarEventContext } from './types';\n\n/**\n * Replace the chip's contents. The event is the implicit context; the chip\n * itself — its button, its position and its drag handling — stays with the\n * calendar, so a custom template cannot break the geometry.\n *\n * @example\n * ```html\n * <wr-event-calendar [events]=\"events\">\n * <ng-template wrCalendarEvent let-event>\n * <strong>{{ event.title }}</strong> — {{ event.data.room }}\n * </ng-template>\n * </wr-event-calendar>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrCalendarEvent]',\n})\nexport class WrCalendarEventTemplate {\n readonly template = inject<TemplateRef<WrCalendarEventContext>>(TemplateRef);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport type { TemplateRef } from '@angular/core';\nimport {\n Component,\n DOCUMENT,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n contentChild,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrButton, WrButtonGroup } from 'ngwr/button';\nimport { WrDateAdapter } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrCalendarEventTemplate } from './event-calendar-event-template';\nimport type {\n WrCalendarEvent,\n WrCalendarEventChange,\n WrCalendarEventContext,\n WrCalendarSlot,\n WrCalendarView,\n} from './types';\n\n/**\n * Stands in for the consumer input `useI18nText` expects — the header strings take no\n * label inputs of their own.\n */\n\nconst MINUTES_PER_DAY = 24 * 60;\nconst DAYS_PER_WEEK = 7;\nconst MONTH_ROWS = 6;\n\n/**\n * A chip that spans whole days — every month-view event, and the all-day band\n * of the time views. It lives in the cell where its segment STARTS and reaches\n * right with a `calc()` width, so it stays inside one `role=\"gridcell\"` however\n * far it spans.\n */\ninterface BandChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Index of the day it starts on, within the row it was laid out against. */\n readonly column: number;\n readonly span: number;\n readonly lane: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\n/**\n * A chip positioned against the time grid. Same rule — it belongs to the cell\n * holding its start — but sized in percentages OF THAT CELL, which works only\n * because every slot row is the same height.\n */\ninterface TimeChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Offset into the start cell, 0–100. */\n readonly top: number;\n /** Height as a multiple of the cell, ×100. */\n readonly height: number;\n /**\n * Lane offset from the column's inline START, 0–100 — not from its physical\n * left. Concurrent events are laid out in reading order, so under `dir=\"rtl\"`\n * lane 0 belongs at the right; a physical `left` would read the cluster\n * back-to-front, which is the one thing in this component that was not logical.\n */\n readonly inlineStart: number;\n /** Lane width as a share of the column, 0–100. */\n readonly width: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\ninterface DayCell {\n readonly date: Date;\n readonly key: string;\n readonly day: string;\n readonly label: string;\n readonly inMonth: boolean;\n readonly isToday: boolean;\n readonly bands: readonly BandChip[];\n readonly hidden: number;\n}\n\ninterface MonthWeek {\n readonly key: string;\n readonly days: readonly DayCell[];\n /**\n * How many lanes the row's chips fill. The chips are absolutely positioned,\n * so this is the only way the row's height can know about them.\n */\n readonly lanes: number;\n}\n\ninterface TimeCell {\n readonly key: string;\n readonly date: Date;\n readonly label: string;\n readonly chips: readonly TimeChip[];\n}\n\ninterface TimeRow {\n readonly key: string;\n readonly label: string;\n /** Minutes from midnight — also what the drag target reads off the cell. */\n readonly minutes: number;\n readonly major: boolean;\n readonly cells: readonly TimeCell[];\n}\n\ninterface ColumnHeader {\n readonly key: string;\n readonly date: Date;\n readonly weekday: string;\n readonly day: string;\n readonly label: string;\n readonly isToday: boolean;\n}\n\n/** Live drag state. `null` whenever the pointer is not down on a chip. */\ninterface DragState {\n readonly event: WrCalendarEvent;\n readonly kind: 'move' | 'resize';\n readonly originDate: Date;\n readonly originMinutes: number;\n readonly pointerId: number;\n}\n\n/**\n * Month / week / day event calendar with drag to move and resize.\n *\n * `events` is an INPUT, never mutated: a drag emits `eventChange` describing\n * where the event would land and stops there. Apply it to your own state and\n * the calendar re-renders — so an unhandled output is a cancelled drag, an\n * optimistic update is one `set`, and a rejected server write needs no rollback\n * path inside the component.\n *\n * Every chip lives inside the `role=\"gridcell\"` where it starts and reaches out\n * with `calc()` widths or percentage heights. That is what keeps the ARIA grid\n * valid — an events layer floating over the grid would leave rows owning\n * something other than cells — and it means no pixel measurement anywhere.\n *\n * **Keyboard.** The grid is one tab stop with a roving cursor: arrows move by\n * day (left / right) and by week or slot (up / down), `Home` / `End` jump to\n * the ends of the row, `Enter` on an empty cell emits `slotClick`, and `Enter`\n * on a cell holding events focuses the first chip (`Escape` returns). On a\n * focused chip, `Alt` + arrows move the event — the keyboard equivalent of the\n * drag, emitting the same `eventChange`.\n *\n * Date math and formatting go through {@link WrDateAdapter} — the native one\n * unless `provideWr(withDates(...))` registers another.\n *\n * @example\n * ```html\n * <wr-event-calendar\n * editable\n * [events]=\"events()\"\n * [(view)]=\"view\"\n * [(date)]=\"anchor\"\n * (eventChange)=\"apply($event)\"\n * (slotClick)=\"compose($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/event-calendar\n */\n@Component({\n selector: 'wr-event-calendar',\n templateUrl: './event-calendar.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-event-calendar',\n '[class]': 'classes()',\n // A drag has to end wherever the pointer is released, including outside the\n // chip it started on — so the host owns the release, not the chip.\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'drag.set(null)',\n },\n imports: [NgTemplateOutlet, WrButton, WrButtonGroup],\n})\nexport class WrEventCalendar {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('event-calendar');\n }\n\n /** Everything to render. Never mutated — see `eventChange`. */\n readonly events = input<readonly WrCalendarEvent[]>([]);\n\n /** Which span is shown. Two-way bindable. @default 'month' */\n readonly view = model<WrCalendarView>('month');\n\n /** Any date inside the shown span. Two-way bindable. */\n readonly date = model<Date>(new Date());\n\n /** Which buttons the view switcher offers. Empty hides it. */\n readonly views = input<readonly WrCalendarView[]>(['month', 'week', 'day']);\n\n /** Allow dragging chips to move and resize them. @default false */\n readonly editable = input(false, { transform: coerceBooleanProperty });\n\n /** Minutes per row in the time views — also the drag snap. @default 30 */\n readonly slotMinutes = input(30, { transform: wrNumAttr(30) });\n\n /** First hour the time views show. @default 0 */\n readonly dayStartHour = input(0, { transform: wrNumAttr(0) });\n\n /** First hour they do NOT show, exclusive. @default 24 */\n readonly dayEndHour = input(24, { transform: wrNumAttr(24) });\n\n /** Lanes a month cell shows before collapsing the rest into “+N more”. @default 3 */\n readonly maxLanes = input(3, { transform: wrNumAttr(3) });\n\n /** Hide the built-in header — supply your own navigation instead. @default false */\n readonly hideHeader = input(false, { transform: coerceBooleanProperty });\n\n /** A chip was activated. */\n readonly eventClick = output<WrCalendarEvent>();\n\n /** Empty space was activated — the slot the user pointed at. */\n readonly slotClick = output<WrCalendarSlot>();\n\n /** A drag or an `Alt` + arrow finished. Apply it yourself; nothing moves until you do. */\n readonly eventChange = output<WrCalendarEventChange>();\n\n private readonly adapter = inject<WrDateAdapter<Date>>(WrDateAdapter);\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly chipTpl = contentChild(WrCalendarEventTemplate);\n\n /** Text of the button that jumps to today. Falls back to `eventCalendar.today`, then `'Today'`. */\n readonly todayLabel = input<string | null>(null);\n\n /** Accessible name of the back arrow. Falls back to `eventCalendar.previous`, then `'Previous'`. */\n readonly previousLabel = input<string | null>(null);\n\n /** Accessible name of the forward arrow. Falls back to `eventCalendar.next`, then `'Next'`. */\n readonly nextLabel = input<string | null>(null);\n\n /** Text of the all-day band, also read as the time of an all-day event. Falls back to `eventCalendar.allDay`, then `'All day'`. */\n readonly allDayLabel = input<string | null>(null);\n\n /** Accessible name of the time gutter column. Falls back to `eventCalendar.time`, then `'Time'`. */\n readonly timeLabel = input<string | null>(null);\n\n /** Text of the month option in the view switcher. Falls back to `eventCalendar.month`, then `'Month'`. */\n readonly monthLabel = input<string | null>(null);\n\n /** Text of the week option in the view switcher. Falls back to `eventCalendar.week`, then `'Week'`. */\n readonly weekLabel = input<string | null>(null);\n\n /** Text of the day option in the view switcher. Falls back to `eventCalendar.day`, then `'Day'`. */\n readonly dayLabel = input<string | null>(null);\n\n // Reactive: a calendar is as long-lived as the page it sits on, so a catalog that\n // finishes loading after construction — or a locale switch — has to reach these.\n // Resolved once, as they were, they froze the English defaults in place.\n protected readonly resolvedTodayLabel = useI18nText(this.todayLabel, 'eventCalendar.today', 'Today');\n protected readonly resolvedPreviousLabel = useI18nText(this.previousLabel, 'eventCalendar.previous', 'Previous');\n protected readonly resolvedNextLabel = useI18nText(this.nextLabel, 'eventCalendar.next', 'Next');\n protected readonly resolvedAllDayLabel = useI18nText(this.allDayLabel, 'eventCalendar.allDay', 'All day');\n protected readonly resolvedTimeLabel = useI18nText(this.timeLabel, 'eventCalendar.time', 'Time');\n protected readonly moreLabel = useI18nFormatter('eventCalendar.more', '+{{count}} more');\n // The five composed strings. Each was a template literal, which localises the\n // words inside it and freezes the word ORDER and the punctuation between them\n // — `wr-calendar` learned the same thing one component over and its\n // `calendar.header` / `.yearRange` / `.dayLabel` are the shape copied here.\n private readonly headerText = useI18nFormatter('eventCalendar.header', '{{month}} {{year}}');\n private readonly rangeText = useI18nFormatter('eventCalendar.range', '{{from}} – {{to}}');\n private readonly chipLabelText = useI18nFormatter('eventCalendar.chipLabel', '{{title}}, {{time}}');\n private readonly slotLabelText = useI18nFormatter('eventCalendar.slotLabel', '{{time}} — {{date}}');\n private readonly allDayCellText = useI18nFormatter('eventCalendar.allDayCellLabel', '{{label}} — {{date}}');\n protected readonly resolvedMonthLabel = useI18nText(this.monthLabel, 'eventCalendar.month', 'Month');\n protected readonly resolvedWeekLabel = useI18nText(this.weekLabel, 'eventCalendar.week', 'Week');\n protected readonly resolvedDayLabel = useI18nText(this.dayLabel, 'eventCalendar.day', 'Day');\n\n protected readonly viewLabels = computed<Record<WrCalendarView, string>>(() => ({\n month: this.resolvedMonthLabel(),\n week: this.resolvedWeekLabel(),\n day: this.resolvedDayLabel(),\n }));\n\n /** Accessible name of the grid; overridable for a page with several. */\n readonly ariaLabel = input<string | null>(null);\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'eventCalendar.label', 'Calendar');\n\n /**\n * `[day, minutes]` of the roving cursor — `minutes === -1` means a month cell\n * or the all-day band. Raw, so it survives a view switch; read\n * {@link cursorCell}, which clamps it to what the current view actually has.\n */\n private readonly cursor = signal<readonly [number, number]>([0, -1]);\n\n /**\n * The cursor as the current view can honour it. Exactly one cell may carry\n * `tabindex=\"0\"`, so a stale coordinate — the 09:30 row after switching to\n * month, day 34 after switching to week — must fall back to a real cell\n * rather than leave the grid with no tab stop at all.\n */\n protected readonly cursorCell = computed<readonly [number, number]>(() => {\n const [day, minutes] = this.cursor();\n const columns = Math.max(1, this.days().length);\n const clamped = Math.min(columns - 1, Math.max(0, day));\n\n if (this.view() === 'month') return [clamped, -1];\n if (minutes === -1 && this.hasAllDay()) return [clamped, -1];\n\n const rows = this.rows();\n const known = rows.some(row => row.minutes === minutes);\n return [clamped, known ? minutes : (rows[0]?.minutes ?? 0)];\n });\n\n /** Non-null only while a pointer is down on a chip. @internal */\n protected readonly drag = signal<DragState | null>(null);\n\n protected readonly dragging = computed(() => this.drag()?.event.id ?? null);\n\n protected readonly chipTemplate = computed<TemplateRef<WrCalendarEventContext> | null>(\n () => this.chipTpl()?.template ?? null\n );\n\n protected readonly classes = computed(() => {\n const parts = [`wr-event-calendar--${this.view()}`];\n if (this.editable()) parts.push('wr-event-calendar--editable');\n if (this.drag()) parts.push('wr-event-calendar--dragging');\n return parts.join(' ');\n });\n\n // ---------------------------------------------------------------- ranges\n\n /** Inclusive-exclusive window the current view covers. */\n private readonly range = computed<readonly [Date, Date]>(() => {\n const anchor = this.startOfDay(this.date());\n switch (this.view()) {\n case 'day':\n return [anchor, this.adapter.addDays(anchor, 1)];\n case 'week': {\n const start = this.startOfWeek(anchor);\n return [start, this.adapter.addDays(start, DAYS_PER_WEEK)];\n }\n default: {\n const first = this.adapter.createDate(this.adapter.getYear(anchor), this.adapter.getMonth(anchor), 1);\n const start = this.startOfWeek(first);\n return [start, this.adapter.addDays(start, MONTH_ROWS * DAYS_PER_WEEK)];\n }\n }\n });\n\n /** Every day the view shows, left to right. */\n private readonly days = computed<readonly Date[]>(() => {\n const [start, end] = this.range();\n const count = Math.round((end.getTime() - start.getTime()) / (MINUTES_PER_DAY * 60_000));\n return Array.from({ length: count }, (_, i) => this.adapter.addDays(start, i));\n });\n\n /** Only what overlaps the window — everything downstream works off this. */\n private readonly visible = computed<readonly WrCalendarEvent[]>(() => {\n const [start, end] = this.range();\n return this.events()\n .filter(e => e.end.getTime() > start.getTime() && e.start.getTime() < end.getTime())\n .sort((a, b) => {\n const byStart = a.start.getTime() - b.start.getTime();\n // Ties go to the longer event, so a week-long band claims its lane\n // before the one-day events sitting alongside it.\n return byStart !== 0 ? byStart : b.end.getTime() - a.end.getTime();\n });\n });\n\n protected readonly title = computed(() => {\n const anchor = this.date();\n const months = this.adapter.getMonthNames('long');\n switch (this.view()) {\n case 'day':\n return this.adapter.format(anchor, 'longDate');\n case 'week': {\n const [start] = this.range();\n const last = this.adapter.addDays(start, DAYS_PER_WEEK - 1);\n return this.rangeText({\n from: this.adapter.format(start, 'mediumDate'),\n to: this.adapter.format(last, 'mediumDate'),\n });\n }\n default:\n return this.headerText({ month: months[this.adapter.getMonth(anchor)], year: this.adapter.getYear(anchor) });\n }\n });\n\n /**\n * The adapter contract is \"names ordered from `getFirstDayOfWeek()` onwards\",\n * so the list is ALREADY rotated. Rotating it again here put every column one\n * day out for every locale whose week does not start on Sunday — invisible in\n * en-US, wrong everywhere else. `wr-calendar` consumes the same call directly.\n */\n protected readonly weekdayNames = computed(() => this.adapter.getDayOfWeekNames('short'));\n\n protected readonly switcher = computed(() => this.views().map(view => ({ view, label: this.viewLabels()[view] })));\n\n // ----------------------------------------------------------- month model\n\n protected readonly weeks = computed<readonly MonthWeek[]>(() => {\n const days = this.days();\n const events = this.visible();\n const weeks: MonthWeek[] = [];\n const month = this.adapter.getMonth(this.date());\n\n for (let w = 0; w * DAYS_PER_WEEK < days.length; w++) {\n const row = days.slice(w * DAYS_PER_WEEK, (w + 1) * DAYS_PER_WEEK);\n const { chips, hidden } = this.bandLayout(events, row, this.maxLanes());\n const bands = this.byColumn(chips, row.length);\n\n weeks.push({\n key: this.iso(row[0]),\n lanes: this.laneCount(chips),\n days: row.map((date, col) => ({\n date,\n key: this.iso(date),\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n inMonth: this.adapter.getMonth(date) === month,\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n bands: bands[col],\n hidden: hidden[col],\n })),\n });\n }\n\n return weeks;\n });\n\n // ------------------------------------------------------------ time model\n\n protected readonly columns = computed<readonly ColumnHeader[]>(() => {\n const weekdays = this.adapter.getDayOfWeekNames('short');\n const first = this.adapter.getFirstDayOfWeek();\n return this.days().map(date => ({\n key: this.iso(date),\n date,\n // `weekdays` is indexed from the week's first day; `getDayOfWeek` is\n // absolute (0 = Sunday). Mixing the two spaces named Monday \"Tue\".\n weekday: weekdays[(this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK],\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n }));\n });\n\n /** The all-day band above the time grid — same layout as a month week. */\n protected readonly allDayBands = computed<readonly BandChip[]>(() => {\n const days = this.days();\n const events = this.visible().filter(e => e.allDay === true || this.spansWholeDay(e));\n return this.bandLayout(events, days, Number.POSITIVE_INFINITY).chips;\n });\n\n protected readonly allDayCells = computed<\n readonly { key: string; date: Date; label: string; bands: readonly BandChip[] }[]\n >(() => {\n const days = this.days();\n const bands = this.byColumn(this.allDayBands(), days.length);\n return days.map((date, col) => ({\n key: this.iso(date),\n date,\n label: this.allDayCellText({ label: this.resolvedAllDayLabel(), date: this.adapter.format(date, 'longDate') }),\n bands: bands[col],\n }));\n });\n\n protected readonly hasAllDay = computed(() => this.allDayBands().length > 0);\n\n /** Lanes the all-day band fills — it has no `maxLanes` cap, so its row has to grow instead. */\n protected readonly allDayLanes = computed(() => this.laneCount(this.allDayBands()));\n\n protected readonly rows = computed<readonly TimeRow[]>(() => {\n const slot = Math.max(5, this.slotMinutes());\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const days = this.days();\n const placed = this.timeLayout(days, slot).map(column => {\n const bySlot = new Map<number, TimeChip[]>();\n for (const { chip, slotMinutes } of column) {\n const chips = bySlot.get(slotMinutes);\n if (chips) chips.push(chip);\n else bySlot.set(slotMinutes, [chip]);\n }\n return bySlot;\n });\n const rows: TimeRow[] = [];\n\n // Each half of a cell's name is invariant along one axis: the day reads the\n // same down a column, the clock the same across a row. Formatting per CELL\n // asked the adapter for 336 of each on a default week (48 slots × 7 days)\n // where 48 clocks and 7 dates say the same thing, and\n // `WrNativeDateAdapter.format` builds a fresh `Intl.DateTimeFormat` per call.\n const dayLabels = days.map(date => this.adapter.format(date, 'longDate'));\n\n for (let minutes = from; minutes < to; minutes += slot) {\n const clock = this.clock(minutes);\n rows.push({\n key: String(minutes),\n minutes,\n major: minutes % 60 === 0,\n label: minutes % 60 === 0 ? clock : '',\n cells: days.map((date, col) => ({\n key: `${this.iso(date)}:${minutes}`,\n date,\n label: this.slotLabelText({ time: clock, date: dayLabels[col] }),\n chips: placed[col].get(minutes) ?? [],\n })),\n });\n }\n\n return rows;\n });\n\n // ------------------------------------------------------------------ nav\n\n protected step(direction: -1 | 1): void {\n const anchor = this.date();\n switch (this.view()) {\n case 'day':\n this.date.set(this.adapter.addDays(anchor, direction));\n break;\n case 'week':\n this.date.set(this.adapter.addDays(anchor, direction * DAYS_PER_WEEK));\n break;\n default:\n this.date.set(this.adapter.addMonths(anchor, direction));\n }\n }\n\n protected goToday(): void {\n this.date.set(this.adapter.today());\n }\n\n protected setView(view: WrCalendarView): void {\n this.view.set(view);\n }\n\n /** “+N more” opens that day — the overflow is only ever a month-view problem. */\n protected openDay(date: Date): void {\n this.date.set(date);\n this.view.set('day');\n }\n\n // -------------------------------------------------------------- pointer\n\n protected onChipPointerDown(event: PointerEvent, chipEvent: WrCalendarEvent, kind: 'move' | 'resize'): void {\n if (!this.canDrag(chipEvent) || event.button !== 0) return;\n\n // The cell is found by geometry, not through the chip: `cellUnder` skips\n // every chip in the hit-test stack, so neither this one nor a neighbour\n // overlapping it can stand in for the cell under the pointer.\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n try {\n (event.target as HTMLElement).setPointerCapture?.(event.pointerId);\n } catch {\n // Capture is an optimisation — it keeps the release on this element even\n // when the pointer leaves it. A pointer that is already gone throws here,\n // and losing capture is not a reason to lose the drag.\n }\n event.preventDefault();\n event.stopPropagation();\n\n this.drag.set({\n event: chipEvent,\n kind,\n originDate: cell.date,\n originMinutes: cell.minutes,\n pointerId: event.pointerId,\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n const state = this.drag();\n this.drag.set(null);\n if (state?.pointerId !== event.pointerId) return;\n\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n const dayDelta = this.daysBetween(state.originDate, cell.date);\n const minuteDelta = cell.minutes < 0 || state.originMinutes < 0 ? 0 : cell.minutes - state.originMinutes;\n if (dayDelta === 0 && minuteDelta === 0) return;\n\n const { event: source, kind } = state;\n if (kind === 'resize') {\n const end = this.shift(source.end, dayDelta, minuteDelta);\n // A resize that would end at or before the start is a no-op, not an\n // inverted event.\n if (end.getTime() <= source.start.getTime()) return;\n this.eventChange.emit({ event: source, start: source.start, end, kind });\n return;\n }\n\n this.eventChange.emit({\n event: source,\n start: this.shift(source.start, dayDelta, minuteDelta),\n end: this.shift(source.end, dayDelta, minuteDelta),\n kind,\n });\n }\n\n protected onChipClick(event: WrCalendarEvent): void {\n this.eventClick.emit(event);\n }\n\n protected onCellClick(date: Date, minutes: number): void {\n this.slotClick.emit(this.slotAt(date, minutes));\n }\n\n // ------------------------------------------------------------- keyboard\n\n protected onChipKeyDown(event: KeyboardEvent, chipEvent: WrCalendarEvent): void {\n if (event.key === 'Escape') {\n this.focusCell(event);\n return;\n }\n\n if (!event.altKey || !this.canDrag(chipEvent)) return;\n\n const slot = Math.max(5, this.slotMinutes());\n const inTime = this.view() !== 'month';\n let days = 0;\n let minutes = 0;\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n days = -1;\n break;\n case 'ArrowRight':\n days = 1;\n break;\n case 'ArrowUp':\n if (inTime) minutes = -slot;\n else days = -DAYS_PER_WEEK;\n break;\n case 'ArrowDown':\n if (inTime) minutes = slot;\n else days = DAYS_PER_WEEK;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n\n // `Shift` turns the same gesture into a resize, moving the END alone. Without it\n // the keyboard could move an event and never re-length one — and the resize grab\n // area is `aria-hidden` and unfocusable precisely BECAUSE this exists, so its\n // absence left the operation on the mouse only.\n if (event.shiftKey) {\n const end = this.shift(chipEvent.end, days, minutes);\n // Same rule as the pointer path: a resize that would end at or before the\n // start is a no-op rather than an inverted event.\n if (end.getTime() <= chipEvent.start.getTime()) return;\n this.eventChange.emit({ event: chipEvent, start: chipEvent.start, end, kind: 'resize' });\n this.refocusChip(chipEvent.id);\n return;\n }\n\n this.eventChange.emit({\n event: chipEvent,\n start: this.shift(chipEvent.start, days, minutes),\n end: this.shift(chipEvent.end, days, minutes),\n kind: 'move',\n });\n this.refocusChip(chipEvent.id);\n }\n\n /**\n * Put focus back on the chip a keyboard move re-rendered.\n *\n * A host that applies the change re-renders the event in another cell, under\n * another track key, so the focused button is destroyed and focus falls to\n * `<body>` — every `Alt` + arrow then had to start again from the top of the\n * page. Only a LOST focus is taken back: a host that refused the change, or\n * moved focus somewhere on purpose, is left alone. `afterNextRender`, never a\n * microtask: zoneless change detection runs in a macrotask, so a microtask\n * would look before the new chip exists.\n */\n private refocusChip(id: WrCalendarEvent['id']): void {\n afterNextRender(\n () => {\n const active = this.document.activeElement;\n if (active && active !== this.document.body && active.isConnected) return;\n const chip = [...this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-event-calendar__chip')].find(\n el => el.dataset['eventId'] === String(id)\n );\n chip?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected onGridKeyDown(event: KeyboardEvent): void {\n // Handled per cell, not on the grid: the element carrying the keyboard\n // should be the one that actually holds focus. Chips sit inside cells and\n // own their keys, so let anything originating in one bubble straight past.\n if (event.target !== event.currentTarget) return;\n\n const [day, minutes] = this.cursorCell();\n const columns = this.days().length;\n const rows = this.rows();\n const inTime = this.view() !== 'month';\n let next: readonly [number, number];\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n next = [Math.max(0, day - 1), minutes];\n break;\n case 'ArrowRight':\n next = [Math.min(columns - 1, day + 1), minutes];\n break;\n case 'ArrowUp':\n // Hold position at the top row, the way ArrowDown does at the bottom. A\n // `Math.max(0, …)` clamp reads as the same thing and is not: from the\n // Wednesday of the first week it lands on 0, so the cursor jumps\n // SIDEWAYS to Sunday instead of staying put.\n next = inTime\n ? [day, this.stepRow(minutes, -1, rows)]\n : [day - DAYS_PER_WEEK >= 0 ? day - DAYS_PER_WEEK : day, minutes];\n break;\n case 'ArrowDown':\n next = inTime\n ? [day, this.stepRow(minutes, 1, rows)]\n : [day + DAYS_PER_WEEK < columns ? day + DAYS_PER_WEEK : day, minutes];\n break;\n case 'Home':\n next = [day - (day % DAYS_PER_WEEK), minutes];\n break;\n case 'End':\n next = [Math.min(columns - 1, day - (day % DAYS_PER_WEEK) + DAYS_PER_WEEK - 1), minutes];\n break;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const cell = event.target as HTMLElement;\n const chip = cell.querySelector<HTMLElement>('.wr-event-calendar__chip');\n if (chip) chip.focus();\n else this.onCellClick(this.days()[day], minutes);\n return;\n }\n default:\n return;\n }\n\n event.preventDefault();\n this.cursor.set(next);\n this.focusCursor(event.currentTarget as HTMLElement);\n }\n\n /**\n * Keep the roving cursor on the cell that actually has focus.\n *\n * The cursor was only ever written by an arrow key, while focus moves for three\n * other reasons — a click, a Tab onto a chip, Escape out of one — so the next\n * arrow read a coordinate nobody was standing on and threw focus back to it,\n * usually the top-left of the grid.\n */\n protected onCellFocus(day: number, minutes: number): void {\n const [d, m] = this.cursor();\n if (d !== day || m !== minutes) this.cursor.set([day, minutes]);\n }\n\n protected isCursor(day: number, minutes: number): boolean {\n const [d, m] = this.cursorCell();\n return d === day && m === minutes;\n }\n\n // --------------------------------------------------------------- layout\n\n /**\n * Greedy lane packing for day-spanning chips. Sorted by start then by length,\n * each segment takes the first lane its columns are free in — the classic\n * interval-graph colouring, and the reason a long event keeps one lane across\n * the whole week instead of stair-stepping.\n *\n * `limit` caps the visible lanes; anything past it is reported per column so\n * the cell can say how much it is hiding.\n */\n private bandLayout(\n events: readonly WrCalendarEvent[],\n days: readonly Date[],\n limit: number\n ): { chips: readonly BandChip[]; hidden: readonly number[] } {\n const first = days[0];\n const last = this.adapter.addDays(days[days.length - 1], 1);\n const lanes: number[][] = [];\n const chips: BandChip[] = [];\n const hidden = days.map(() => 0);\n\n for (const event of events) {\n if (event.end.getTime() <= first.getTime() || event.start.getTime() >= last.getTime()) continue;\n\n const from = Math.max(0, this.daysBetween(first, this.startOfDay(event.start)));\n // An exclusive end landing exactly on midnight belongs to the previous\n // day — otherwise every all-day event paints one column too wide.\n const endDay = this.startOfDay(new Date(event.end.getTime() - 1));\n const to = Math.min(days.length - 1, this.daysBetween(first, endDay));\n if (to < from) continue;\n\n let lane = lanes.findIndex(taken => taken.every(col => col < from || col > to));\n if (lane === -1) {\n lane = lanes.length;\n lanes.push([]);\n }\n for (let col = from; col <= to; col++) lanes[lane].push(col);\n\n if (lane >= limit) {\n for (let col = from; col <= to; col++) hidden[col]++;\n continue;\n }\n\n chips.push({\n key: `${String(event.id)}:${from}`,\n event,\n column: from,\n span: to - from + 1,\n lane,\n continuesBefore: event.start.getTime() < first.getTime(),\n continuesAfter: event.end.getTime() > last.getTime(),\n });\n }\n\n return { chips, hidden };\n }\n\n /** The chips that start in each column, in the order they were laid out. */\n private byColumn(chips: readonly BandChip[], columns: number): readonly BandChip[][] {\n const out = Array.from({ length: columns }, (): BandChip[] => []);\n for (const chip of chips) out[chip.column].push(chip);\n return out;\n }\n\n private laneCount(chips: readonly BandChip[]): number {\n return chips.reduce((count, chip) => Math.max(count, chip.lane + 1), 0);\n }\n\n /**\n * Column layout inside one day: events that overlap in time share the width.\n * Clusters are built by a running high-water mark — a new cluster starts the\n * moment an event begins after everything before it has ended.\n */\n private timeLayout(days: readonly Date[], slot: number): readonly { chip: TimeChip; slotMinutes: number }[][] {\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const timed = this.visible().filter(e => !e.allDay && !this.spansWholeDay(e));\n\n const windows = days.map(day => {\n const dayStart = this.startOfDay(day);\n return { dayStart, windowStart: dayStart.getTime() + from * 60_000, windowEnd: dayStart.getTime() + to * 60_000 };\n });\n // The events come sorted by start and the windows run in order, so the first day an\n // event can touch only moves forward: one pass fills every day, in the events' order.\n const perDay = windows.map((): WrCalendarEvent[] => []);\n let first = 0;\n for (const event of timed) {\n const end = event.end.getTime();\n while (first < windows.length && windows[first].windowEnd <= event.start.getTime()) first++;\n for (let d = first; d < windows.length && windows[d].windowStart < end; d++) perDay[d].push(event);\n }\n\n return windows.map(({ dayStart, windowStart, windowEnd }, d) => {\n const onDay = perDay[d]\n .map(event => ({\n event,\n from: Math.max(windowStart, event.start.getTime()),\n to: Math.min(windowEnd, event.end.getTime()),\n }))\n .sort((a, b) => {\n const byStart = a.from - b.from;\n return byStart !== 0 ? byStart : b.to - a.to;\n });\n\n const out: { chip: TimeChip; slotMinutes: number }[] = [];\n let cluster: typeof onDay = [];\n let highWater = -1;\n\n const flush = (): void => {\n for (const [index, item] of cluster.entries()) {\n const minutes = Math.floor((item.from - dayStart.getTime()) / 60_000);\n const slotStart = from + Math.floor((minutes - from) / slot) * slot;\n const length = (item.to - item.from) / 60_000;\n\n out.push({\n slotMinutes: slotStart,\n chip: {\n key: `${String(item.event.id)}:${minutes}`,\n event: item.event,\n top: ((minutes - slotStart) / slot) * 100,\n height: (length / slot) * 100,\n inlineStart: (index / cluster.length) * 100,\n width: (1 / cluster.length) * 100,\n continuesBefore: item.event.start.getTime() < windowStart,\n continuesAfter: item.event.end.getTime() > windowEnd,\n },\n });\n }\n cluster = [];\n };\n\n for (const item of onDay) {\n if (cluster.length > 0 && item.from >= highWater) flush();\n cluster.push(item);\n highWater = Math.max(highWater, item.to);\n }\n flush();\n\n return out;\n });\n }\n\n // --------------------------------------------------------------- chrome\n\n protected chipLabel(event: WrCalendarEvent): string {\n const time = event.allDay ? this.resolvedAllDayLabel() : this.adapter.format(event.start, 'time');\n return this.chipLabelText({ title: event.title, time });\n }\n\n protected chipTime(event: WrCalendarEvent): string {\n return event.allDay ? this.resolvedAllDayLabel() : this.adapter.format(event.start, 'time');\n }\n\n protected canDrag(event: WrCalendarEvent): boolean {\n return this.editable() && event.editable !== false;\n }\n\n // --------------------------------------------------------------- helpers\n\n private slotAt(date: Date, minutes: number): WrCalendarSlot {\n if (minutes < 0) {\n const start = this.startOfDay(date);\n return { start, end: this.adapter.addDays(start, 1), allDay: true };\n }\n const start = new Date(this.startOfDay(date).getTime() + minutes * 60_000);\n return { start, end: new Date(start.getTime() + Math.max(5, this.slotMinutes()) * 60_000), allDay: false };\n }\n\n /**\n * The `[data-cell-date]` under the pointer, or `null` outside the grid.\n *\n * Walks the whole hit-test stack rather than climbing from the topmost\n * element. A chip lives in the cell it STARTS in and reaches past it, so\n * `elementFromPoint(…).closest()` over any chip — a neighbour covering the\n * drop slot, a multi-day band covering the drop day — answered with that\n * chip's start cell, and the event landed there instead of under the\n * pointer. The stack lists the cell itself, below the chips; something that\n * is not part of this calendar coming first means the pointer is over\n * another layer, which is not a drop.\n */\n private cellUnder(x: number, y: number): { date: Date; minutes: number } | null {\n const host = this.host.nativeElement;\n for (const el of this.document.elementsFromPoint?.(x, y) ?? []) {\n if (!host.contains(el)) return null;\n if (!(el instanceof HTMLElement) || !el.matches('[data-cell-date]')) continue;\n // Epoch millis rather than a formatted date: `new Date('2026-08-08')` is\n // parsed as UTC and lands on the previous day west of Greenwich.\n const stamp = Number(el.dataset['cellDate']);\n if (!Number.isFinite(stamp)) return null;\n return { date: new Date(stamp), minutes: Number(el.dataset['cellMinutes'] ?? -1) };\n }\n return null;\n }\n\n /** Value of a cell's `data-cell-date`. @internal */\n protected stamp(date: Date): number {\n return this.startOfDay(date).getTime();\n }\n\n private focusCursor(from: HTMLElement): void {\n const [day, minutes] = this.cursorCell();\n from.closest('[role=\"grid\"]')?.querySelector<HTMLElement>(`[data-cell-index=\"${day}:${minutes}\"]`)?.focus();\n }\n\n private focusCell(event: KeyboardEvent): void {\n event.preventDefault();\n (event.target as HTMLElement).closest<HTMLElement>('[data-cell-date]')?.focus();\n }\n\n /**\n * Move one time row, treating the all-day band as the row above the first —\n * otherwise the band is mouse-only, which is the kind of gap that makes a\n * keyboard user give up on the whole grid.\n */\n private stepRow(minutes: number, direction: -1 | 1, rows: readonly TimeRow[]): number {\n if (minutes === -1) return direction === 1 ? (rows[0]?.minutes ?? -1) : -1;\n\n const index = rows.findIndex(row => row.minutes === minutes);\n if (index === -1) return rows[0]?.minutes ?? -1;\n if (index === 0 && direction === -1) return this.hasAllDay() ? -1 : minutes;\n\n return rows[Math.min(rows.length - 1, index + direction)].minutes;\n }\n\n private shift(date: Date, days: number, minutes: number): Date {\n return new Date(this.adapter.addDays(date, days).getTime() + minutes * 60_000);\n }\n\n private startOfDay(date: Date): Date {\n return this.adapter.setTime(date, 0, 0, 0);\n }\n\n private startOfWeek(date: Date): Date {\n const first = this.adapter.getFirstDayOfWeek();\n const offset = (this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK;\n return this.startOfDay(this.adapter.addDays(date, -offset));\n }\n\n /** Whole days apart — computed on the day floor, so DST cannot round it off. */\n private daysBetween(from: Date, to: Date): number {\n const a = this.startOfDay(from);\n const b = this.startOfDay(to);\n return Math.round((b.getTime() - a.getTime()) / (MINUTES_PER_DAY * 60_000));\n }\n\n private spansWholeDay(event: WrCalendarEvent): boolean {\n return event.end.getTime() - event.start.getTime() >= MINUTES_PER_DAY * 60_000;\n }\n\n private clock(minutes: number): string {\n const date = this.adapter.setTime(this.adapter.today(), Math.floor(minutes / 60), minutes % 60, 0);\n return this.adapter.format(date, 'time');\n }\n\n private iso(date: Date): string {\n return `${this.adapter.getYear(date)}-${this.adapter.getMonth(date) + 1}-${this.adapter.getDate(date)}`;\n }\n\n /**\n * The key as the grid SEES it.\n *\n * A day step follows visual order, so under `dir=\"rtl\"` ArrowRight goes back a\n * day. Up/Down move by week or by row and never flip; Home/End are semantic.\n * Both key handlers route through here — the grid nav and the `Alt`+arrow drag,\n * which moves an event and would otherwise reschedule it the wrong way.\n */\n private inlineKey(key: string): string {\n if (this.dir?.value !== 'rtl') return key;\n if (key === 'ArrowRight') return 'ArrowLeft';\n if (key === 'ArrowLeft') return 'ArrowRight';\n return key;\n }\n}\n","<!--\n Two grids, one rule: a chip always lives inside the `role=\"gridcell\"` where it\n STARTS, and reaches out from there — `calc()` widths for day-spanning bands,\n percentage heights for timed chips. A floating events layer would read better\n in the template and would leave `role=\"row\"` owning something other than\n cells, which is exactly what the axe gate rejects.\n-->\n@if (!hideHeader()) {\n <div class=\"wr-event-calendar__header\">\n <div class=\"wr-event-calendar__nav\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--prev\"\n [attr.aria-label]=\"resolvedPreviousLabel()\"\n (click)=\"step(-1)\"\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=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button wr-btn type=\"button\" size=\"sm\" outlined class=\"wr-event-calendar__today\" (click)=\"goToday()\">\n {{ resolvedTodayLabel() }}\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--next\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n (click)=\"step(1)\"\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=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <h2 class=\"wr-event-calendar__title\">{{ title() }}</h2>\n\n @if (switcher().length > 1) {\n <wr-btn-group>\n @for (item of switcher(); track item.view) {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-event-calendar__view\"\n [outlined]=\"view() !== item.view\"\n [color]=\"view() === item.view ? 'primary' : null\"\n [attr.aria-pressed]=\"view() === item.view\"\n (click)=\"setView(item.view)\"\n >\n {{ item.label }}\n </button>\n }\n </wr-btn-group>\n }\n </div>\n}\n\n@if (view() === 'month') {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--month\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (name of weekdayNames(); track $index) {\n <div role=\"columnheader\" class=\"wr-event-calendar__weekday\">{{ name }}</div>\n }\n </div>\n\n @for (week of weeks(); track week.key; let w = $index) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [style.--wr-event-calendar-lanes]=\"week.lanes\">\n @for (cell of week.days; track cell.key; let c = $index) {\n @let index = w * 7 + c;\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--day\"\n [class.wr-event-calendar__cell--muted]=\"!cell.inMonth\"\n [class.wr-event-calendar__cell--today]=\"cell.isToday\"\n [attr.tabindex]=\"isCursor(index, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${index}:-1`\"\n (focusin)=\"onCellFocus(index, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n <span class=\"wr-event-calendar__daynum\" aria-hidden=\"true\">{{ cell.day }}</span>\n\n @for (chip of cell.bands; track chip.key) {\n <ng-container\n [ngTemplateOutlet]=\"band\"\n [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '1.75rem' }\"\n />\n }\n\n @if (cell.hidden > 0) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__more\"\n [style.--wr-event-calendar-lane]=\"maxLanes()\"\n (click)=\"openDay(cell.date); $event.stopPropagation()\"\n >\n {{ moreLabel({ count: cell.hidden }) }}\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--time\"\n [style.--wr-event-calendar-cols]=\"columns().length\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n <div role=\"columnheader\" class=\"wr-event-calendar__gutter\" [attr.aria-label]=\"resolvedTimeLabel()\"></div>\n @for (column of columns(); track column.key) {\n <div\n role=\"columnheader\"\n class=\"wr-event-calendar__colhead\"\n [class.wr-event-calendar__colhead--today]=\"column.isToday\"\n >\n <span class=\"wr-event-calendar__colhead-weekday\">{{ column.weekday }}</span>\n <span class=\"wr-event-calendar__colhead-day\">{{ column.day }}</span>\n </div>\n }\n </div>\n\n @if (hasAllDay()) {\n <div\n role=\"row\"\n class=\"wr-event-calendar__row wr-event-calendar__row--allday\"\n [style.--wr-event-calendar-lanes]=\"allDayLanes()\"\n >\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ resolvedAllDayLabel() }}</div>\n @for (cell of allDayCells(); track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--allday\"\n [attr.tabindex]=\"isCursor(c, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${c}:-1`\"\n (focusin)=\"onCellFocus(c, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.bands; track chip.key) {\n <ng-container [ngTemplateOutlet]=\"band\" [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '0rem' }\" />\n }\n </div>\n }\n </div>\n }\n\n @for (row of rows(); track row.key) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [class.wr-event-calendar__row--major]=\"row.major\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ row.label }}</div>\n @for (cell of row.cells; track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--slot\"\n [class.wr-event-calendar__cell--major]=\"row.major\"\n [attr.tabindex]=\"isCursor(c, row.minutes) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"row.minutes\"\n [attr.data-cell-index]=\"`${c}:${row.minutes}`\"\n (focusin)=\"onCellFocus(c, row.minutes)\"\n (click)=\"onCellClick(cell.date, row.minutes)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.chips; track chip.key) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--time\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.top.%]=\"chip.top\"\n [style.--wr-event-calendar-block-size.%]=\"chip.height\"\n [style.--wr-event-calendar-inline-start.%]=\"chip.inlineStart\"\n [style.--wr-event-calendar-inline-size.%]=\"chip.width\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n <span class=\"wr-event-calendar__chip-time\" aria-hidden=\"true\">{{ chipTime(chip.event) }}</span>\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n\n @if (canDrag(chip.event) && !chip.continuesAfter) {\n <!--\n A grab area, not a control: the same resize is on the keyboard as\n `Alt` + `Shift` + arrows on the chip itself, so exposing a second\n focusable thing here would add a tab stop that leads nowhere.\n -->\n <span\n class=\"wr-event-calendar__resize\"\n aria-hidden=\"true\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'resize')\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n\n<!-- One chip shape for both day-spanning cases: month cells and the all-day band. -->\n<ng-template #band let-chip let-offset=\"offset\">\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--band\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.--wr-event-calendar-span]=\"chip.span\"\n [style.--wr-event-calendar-lane]=\"chip.lane\"\n [style.--wr-event-calendar-offset]=\"offset\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n </button>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,IAAa,0BAAb,MAAa,wBAAuB;CACzB,WAAW,OAA4C,WAAW;CADhE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAuB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAvB,OAAA,OAAA,GAAA,qBAAA;EA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arness {
|
|
|
82
82
|
async isMultiple() {
|
|
83
83
|
return (await this.picker()).getProperty("multiple");
|
|
84
84
|
}
|
|
85
|
+
async getSize() {
|
|
86
|
+
const host = await this.host();
|
|
87
|
+
if (await host.hasClass("wr-file-upload--sm")) return "sm";
|
|
88
|
+
if (await host.hasClass("wr-file-upload--lg")) return "lg";
|
|
89
|
+
return "md";
|
|
90
|
+
}
|
|
85
91
|
async isDisabled() {
|
|
86
92
|
return await (await this.zone()).getAttribute("aria-disabled") === "true";
|
|
87
93
|
}
|
|
@@ -130,13 +136,39 @@ var WrFileUploadHarness = class WrFileUploadHarness extends ComponentHarness {
|
|
|
130
136
|
await buttons[index].click();
|
|
131
137
|
}
|
|
132
138
|
async removeFileNamed(name) {
|
|
139
|
+
await this.removeFile(await this.indexNamed("removeFileNamed", name));
|
|
140
|
+
}
|
|
141
|
+
async getFileStatus(name) {
|
|
142
|
+
const row = await this.rowNamed("getFileStatus", name);
|
|
143
|
+
for (const state of [
|
|
144
|
+
"pending",
|
|
145
|
+
"uploading",
|
|
146
|
+
"done",
|
|
147
|
+
"error"
|
|
148
|
+
]) if (await row.hasClass(`wr-file-upload__item--${state}`)) return state;
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
async retry(name) {
|
|
152
|
+
const index = await this.indexNamed("retry", name);
|
|
153
|
+
const button = await this.locatorForOptional(`.wr-file-upload__item:nth-child(${index + 1}) .wr-file-upload__retry`)();
|
|
154
|
+
if (button === null) throw new Error(`WrFileUploadHarness.retry(${JSON.stringify(name)}): the row has no retry button. Only a file whose status is 'error' has one; this one is ${JSON.stringify(await this.getFileStatus(name))}.`);
|
|
155
|
+
await button.click();
|
|
156
|
+
}
|
|
157
|
+
async hasPreview(name) {
|
|
158
|
+
const index = await this.indexNamed("hasPreview", name);
|
|
159
|
+
return await this.locatorForOptional(`.wr-file-upload__item:nth-child(${index + 1}) img.wr-file-upload__preview`)() !== null;
|
|
160
|
+
}
|
|
161
|
+
async indexNamed(method, name) {
|
|
133
162
|
const names = await this.getFileNames();
|
|
134
163
|
const index = names.indexOf(name);
|
|
135
164
|
if (index === -1) {
|
|
136
165
|
const holding = names.length > 0 ? names.map((n) => JSON.stringify(n)).join(", ") : "no files";
|
|
137
|
-
throw new Error(`WrFileUploadHarness
|
|
166
|
+
throw new Error(`WrFileUploadHarness.${method}(${JSON.stringify(name)}): the rendered list holds ${holding}.`);
|
|
138
167
|
}
|
|
139
|
-
|
|
168
|
+
return index;
|
|
169
|
+
}
|
|
170
|
+
async rowNamed(method, name) {
|
|
171
|
+
return (await this.items())[await this.indexNamed(method, name)];
|
|
140
172
|
}
|
|
141
173
|
async focus() {
|
|
142
174
|
return (await this.zone()).focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-file-upload-testing.mjs","names":[],"sources":["../../../projects/lib/file-upload/testing/wr-file-upload-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, type EventData, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrFileUploadHarnessFilters } from './types';\n\n/**\n * A `DataTransfer` carrying `files`.\n *\n * `FileList` has no constructor anywhere — a browser mints one only as a side\n * effect of `new DataTransfer()`, and jsdom ships neither (`new FileList()` is an\n * illegal constructor there, and the `files` IDL setter refuses anything that is\n * not the genuine article). So: the real thing where it can be had, and an\n * array-like stand-in otherwise, which is all the component ever reads — it does\n * `Array.from(files)` and nothing else.\n */\nfunction dataTransferFor(files: readonly File[]): DataTransfer {\n const Transfer = (globalThis as { DataTransfer?: new () => DataTransfer }).DataTransfer;\n\n if (Transfer) {\n try {\n const transfer = new Transfer();\n for (const file of files) transfer.items.add(file);\n return transfer;\n } catch {\n // A DataTransfer that cannot take items is no use — fall through.\n }\n }\n\n const list: Record<PropertyKey, unknown> = { ...files };\n list['length'] = files.length;\n list['item'] = (index: number): File | null => files[index] ?? null;\n list[Symbol.iterator] = function* (): Generator<File> {\n yield* files;\n };\n\n return {\n dropEffect: 'none',\n effectAllowed: 'all',\n files: list,\n items: [],\n types: files.length > 0 ? ['Files'] : [],\n } as unknown as DataTransfer;\n}\n\n/**\n * The payload `TestElement.dispatchEvent` merges onto the event it fires.\n *\n * One transfer is shared by every event of a drag, the way a real one is: the\n * component writes `dropEffect` on it during `dragover` and reads `files` back\n * out on `drop`.\n */\nfunction dragPayload(transfer: DataTransfer): Record<string, EventData> {\n return { dataTransfer: transfer } as unknown as Record<string, EventData>;\n}\n\n/** The native element behind a `TestElement`, or `null` when there is no DOM to reach. */\nfunction nativeElement(element: TestElement): Element | null {\n const candidate = (element as Partial<{ element: unknown }>).element;\n return typeof Element !== 'undefined' && candidate instanceof Element ? candidate : null;\n}\n\nfunction isFileInput(element: Element | null): element is HTMLInputElement {\n return element !== null && element.tagName === 'INPUT' && (element as HTMLInputElement).type === 'file';\n}\n\n/** Put `files` on the picker, whichever way this environment allows. */\nfunction setPickerFiles(input: HTMLInputElement, files: readonly File[]): void {\n const list = dataTransferFor(files).files;\n\n try {\n input.files = list;\n if (input.files?.length === files.length) return;\n } catch {\n // jsdom's IDL setter refuses a stand-in FileList. Shadow the accessor instead.\n }\n\n // An own data property wins over the prototype accessor, so the component still\n // reads its files off the REAL input — which matters, because the alternative\n // (forging `event.target`) would let a harness pass on a component that never\n // touches the element the user operated.\n Object.defineProperty(input, 'files', { configurable: true, value: list });\n}\n\n/**\n * Test harness for `<wr-file-upload>`.\n *\n * The control a user operates is the `.wr-file-upload__zone` — a `role=\"button\"`\n * div that is the single tab stop; the `<input type=\"file\">` behind it is\n * `aria-hidden` and `tabindex=\"-1\"`, and exists only so a click can be forwarded\n * to it. So focus, drag and disabled state are all read off the zone, plus the\n * `wr-file-upload--*` host modifiers and the rendered file list. The picker is\n * touched only where it is the one that carries the state — `accept` and\n * `multiple` land on it, and {@link selectFiles} has to hand it the files.\n *\n * What this component does NOT have, so this harness does not either:\n * - **no per-file progress or status.** `<wr-file-upload>` picks files; uploading\n * them is the app's job, and there is no bar or state to read.\n * - **no rendered error.** A file refused for its type, its size or the file count\n * leaves NOTHING in the DOM — no `aria-invalid`, no message, and a list that\n * simply did not grow. The `(rejected)` output is the only channel, so a spec\n * asserts on the host's handler. See {@link selectFiles}.\n * - **no `maxSize` / `maxFiles` readback.** Neither reaches the DOM (unlike\n * `accept` and `multiple`, which land on the picker), so they can only be\n * observed by offering a file that breaks them.\n *\n * Two traps worth knowing before writing assertions. The bound value's SHAPE\n * follows `multiple` — a bare `File` (or `null`) in single mode, a `File[]` in\n * multi — and `[showList]=\"false\"` renders no list at all, so {@link getFileNames}\n * answers `[]` for a component that is holding files. Assert the bound value in\n * that case.\n *\n * @example\n * ```ts\n * const upload = await loader.getHarness(WrFileUploadHarness.with({ label: 'Avatar' }));\n * await upload.selectFiles(new File(['…'], 'me.png', { type: 'image/png' }));\n *\n * expect(await upload.getFileNames()).toEqual(['me.png']);\n * await upload.removeFileNamed('me.png');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrFileUploadHarness extends ComponentHarness {\n static hostSelector = 'wr-file-upload';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrFileUploadHarnessFilters = {}): HarnessPredicate<WrFileUploadHarness> {\n return new HarnessPredicate(WrFileUploadHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('multiple', options.multiple, async (harness, multiple) => (await harness.isMultiple()) === multiple)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly zone = this.locatorFor('.wr-file-upload__zone');\n private readonly picker = this.locatorFor('input.wr-file-upload__picker');\n private readonly items = this.locatorForAll('.wr-file-upload__item');\n private readonly names = this.locatorForAll('.wr-file-upload__name');\n private readonly sizes = this.locatorForAll('.wr-file-upload__size');\n private readonly removeButtons = this.locatorForAll('.wr-file-upload__remove');\n\n /**\n * The accessible name of the trigger — what a screen-reader user is told this\n * control is.\n *\n * The `dropZoneLabel` override when one is set, read off `aria-label`. Otherwise\n * the text of what `aria-labelledby` points at, in order: the field's label\n * inside a `<wr-form-field>`, then the zone's visible copy. Resolved through the\n * ids rather than read off the zone's own text, because the field's label sits\n * outside the zone.\n */\n async getLabel(): Promise<string> {\n const zone = await this.zone();\n const override = await zone.getAttribute('aria-label');\n if (override) return override;\n\n const ids = ((await zone.getAttribute('aria-labelledby')) ?? '').split(/\\s+/).filter(Boolean);\n const root = this.documentRootLocatorFactory();\n const parts = await Promise.all(ids.map(async id => (await root.locatorForOptional(`[id=\"${id}\"]`)())?.text()));\n return parts\n .filter((part): part is string => !!part)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n }\n\n /** The visible call-to-action line — the `pickLabel` input. */\n async getPickText(): Promise<string> {\n return (await this.locatorFor('.wr-file-upload__hint strong')()).text();\n }\n\n /** The visible instruction below the CTA — the `dropLabel` input. */\n async getDropText(): Promise<string> {\n return (await this.locatorFor('.wr-file-upload__hint span')()).text();\n }\n\n /** The optional `helperText` line, or `null` when the component was given none. */\n async getHelperText(): Promise<string | null> {\n const helper = await this.locatorForOptional('.wr-file-upload__hint small')();\n return helper === null ? null : helper.text();\n }\n\n /** The `accept` list the picker advertises, or `null` when it accepts anything. */\n async getAccept(): Promise<string | null> {\n return (await this.picker()).getAttribute('accept');\n }\n\n /**\n * Whether more than one file can be held.\n *\n * Read as the DOM PROPERTY: the template writes the attribute as an empty string\n * (`[attr.multiple]=\"multiple() ? '' : null\"`), and `''` is falsy — an attribute\n * read would report a multi-file upload as single.\n */\n async isMultiple(): Promise<boolean> {\n return (await this.picker()).getProperty<boolean>('multiple');\n }\n\n /**\n * Whether the control refuses interaction.\n *\n * Read from the zone's `aria-disabled`. The host also carries\n * `wr-file-upload--disabled` and the picker its own `disabled`, but the zone is\n * a `role=\"button\"` div — `aria-disabled` is the only one of the three that\n * tells a screen-reader user the trigger is inert.\n */\n async isDisabled(): Promise<boolean> {\n return (await (await this.zone()).getAttribute('aria-disabled')) === 'true';\n }\n\n /**\n * Whether the zone is armed for a drop.\n *\n * The `wr-file-upload--dragging` host modifier is the whole signal — a drop\n * target has no ARIA state, so there is nothing better to read here.\n */\n async isDragging(): Promise<boolean> {\n return (await this.host()).hasClass('wr-file-upload--dragging');\n }\n\n /** How many files the list is RENDERING. Zero with `[showList]=\"false\"`, always. */\n async getFileCount(): Promise<number> {\n return (await this.items()).length;\n }\n\n /** The file names in the rendered list, in order. */\n async getFileNames(): Promise<string[]> {\n const names = await this.names();\n return Promise.all(names.map(name => name.text()));\n }\n\n /**\n * The file sizes in the rendered list, as SHOWN — `'4.9 KB'`, not `5000`.\n *\n * The component formats bytes for display and the byte count never reaches the\n * DOM, so this is the string a user reads. Assert the `File` itself if the exact\n * size matters.\n */\n async getFileSizes(): Promise<string[]> {\n const sizes = await this.sizes();\n return Promise.all(sizes.map(size => size.text()));\n }\n\n /**\n * Hand files to the picker, the way choosing them in the browser dialog does.\n *\n * This is the one method that reaches past `TestElement` to the native\n * `<input type=\"file\">`, and it has to: `TestElement` has no file API, and it\n * cannot grow one portably, because a `FileList` is not constructible and a\n * remote WebDriver session cannot be handed a `File` object at all. Everything\n * else on this harness is environment-agnostic; this needs a DOM behind it\n * (`TestbedHarnessEnvironment`), and says so with an error when it does not have\n * one. The input is found through this harness's own locator rather than a\n * `document` query, so it is still THIS component's picker that gets the files.\n *\n * Rejected files are silent: nothing appears in the DOM, so pair this with the\n * host's `(rejected)` handler when a file is meant to be refused. In single mode\n * the LAST accepted file wins, which is also how a drop of several files onto a\n * single-file zone behaves.\n *\n * @throws if called with no files, on a disabled upload, or outside a DOM\n * environment.\n */\n async selectFiles(...files: File[]): Promise<void> {\n if (files.length === 0) {\n throw new Error(\n 'WrFileUploadHarness.selectFiles(): pass at least one file. Cancelling the browser dialog fires no ' +\n '`change` at all, so \"picked nothing\" is not a state a user can put the component in.'\n );\n }\n\n if (await this.isDisabled()) {\n // The component guards its drop handler but not its `change` handler — it\n // does not need to, since a disabled `<input type=\"file\">` cannot be\n // operated. Forcing the event through anyway would smuggle a file past the\n // disabled state and leave a consumer's spec proving something no user can do.\n throw new Error(\n 'WrFileUploadHarness.selectFiles(): the upload is disabled, and a disabled picker cannot be opened. ' +\n 'Enable it first, or use dropFiles() to assert that a disabled zone refuses what is dropped on it.'\n );\n }\n\n const picker = await this.picker();\n const input = nativeElement(picker);\n\n if (!isFileInput(input)) {\n throw new Error(\n 'WrFileUploadHarness.selectFiles(): no DOM element behind the harness. Files can only be handed to a ' +\n 'real <input type=\"file\">, so this method needs TestbedHarnessEnvironment; a remote WebDriver ' +\n 'environment cannot carry a File across. Every other method on this harness works in both.'\n );\n }\n\n setPickerFiles(input, files);\n await picker.dispatchEvent('change');\n }\n\n /**\n * Drag files over the zone and drop them.\n *\n * Driven by dispatching the drag sequence AT the zone rather than by coordinates:\n * nothing has layout in a unit test — `getBoundingClientRect` is all zeros — so a\n * pointer-driven drag would land nowhere. From the component's side it is the\n * same event either way; it reads `dataTransfer.files` and never a position.\n *\n * A disabled upload refuses the drop itself, so this stays a no-op there rather\n * than throwing the way {@link selectFiles} does — that refusal is the\n * component's own, and worth asserting.\n */\n async dropFiles(...files: File[]): Promise<void> {\n const zone = await this.zone();\n const payload = dragPayload(dataTransferFor(files));\n\n await zone.dispatchEvent('dragenter', payload);\n await zone.dispatchEvent('dragover', payload);\n await zone.dispatchEvent('drop', payload);\n }\n\n /** Drag over the zone without letting go — arms {@link isDragging}. */\n async dragOver(): Promise<void> {\n const zone = await this.zone();\n const payload = dragPayload(dataTransferFor([]));\n\n await zone.dispatchEvent('dragenter', payload);\n await zone.dispatchEvent('dragover', payload);\n }\n\n /**\n * Drag back out of the zone, disarming {@link isDragging}.\n *\n * Dispatched at the zone itself on purpose: the component ignores a `dragleave`\n * whose target is one of the zone's children, because crossing the icon or the\n * hint text is not leaving the zone.\n */\n async dragLeave(): Promise<void> {\n await (await this.zone()).dispatchEvent('dragleave');\n }\n\n /**\n * Remove the file at `index` from the rendered list.\n *\n * On a disabled upload the remove buttons are disabled too, so this is a no-op\n * there — assert the result rather than assuming it.\n */\n async removeFile(index: number): Promise<void> {\n const buttons = await this.removeButtons();\n\n if (index < 0 || index >= buttons.length) {\n throw new Error(\n `WrFileUploadHarness.removeFile(${index}): the rendered list holds ${buttons.length} file(s). ` +\n 'With [showList]=\"false\" it holds none no matter what is selected.'\n );\n }\n\n await buttons[index].click();\n }\n\n /** Remove the file with this name. Names come from {@link getFileNames}. */\n async removeFileNamed(name: string): Promise<void> {\n const names = await this.getFileNames();\n const index = names.indexOf(name);\n\n if (index === -1) {\n const holding = names.length > 0 ? names.map(n => JSON.stringify(n)).join(', ') : 'no files';\n throw new Error(\n `WrFileUploadHarness.removeFileNamed(${JSON.stringify(name)}): the rendered list holds ${holding}.`\n );\n }\n\n await this.removeFile(index);\n }\n\n /** Move keyboard focus to the zone — the control's only tab stop. */\n async focus(): Promise<void> {\n return (await this.zone()).focus();\n }\n\n /** Whether the zone has focus. */\n async isFocused(): Promise<boolean> {\n return (await this.zone()).isFocused();\n }\n}\n"],"mappings":";;;;;;;AAqBA,SAAS,gBAAgB,OAAsB;CAC7C,MAAM,WAAY,WAAyD;CAE3E,IAAI,UACF,IAAI;EACF,MAAM,WAAW,IAAI,SAAQ;EAC7B,KAAK,MAAM,QAAQ,OAAO,SAAS,MAAM,IAAI,IAAI;EACjD,OAAO;CACT,QAAQ,CAER;CAGF,MAAM,OAAqC,EAAE,GAAG,MAAK;CACrD,KAAK,YAAY,MAAM;CACvB,KAAK,WAAW,UAA+B,MAAM,UAAU;CAC/D,KAAK,OAAO,YAAY,aAAS;EAC/B,OAAO;CACT;CAEA,OAAO;EACL,YAAY;EACZ,eAAe;EACf,OAAO;EACP,OAAO,CAAA;EACP,OAAO,MAAM,SAAS,IAAI,CAAC,OAAO,IAAI,CAAA;CACZ;AAC9B;AASA,SAAS,YAAY,U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,MAAM,KAAK,aAAY;EACrC,MAAM,QAAQ,MAAM,QAAQ,IAAI;EAEhC,IAAI,UAAU,IAAI;GAChB,MAAM,UAAU,MAAM,SAAS,IAAI,MAAM,KAAI,MAAK,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI;GAClF,MAAM,IAAI,MACR,uCAAuC,KAAK,UAAU,IAAI,EAAC,6BAA8B,QAAO,EAAG;EAEvG;EAEA,MAAM,KAAK,WAAW,KAAK;CAC7B;CAGA,MAAM,QAAK;EACT,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,MAAK;CAClC;CAGA,MAAM,YAAS;EACb,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,UAAS;CACtC"}
|
|
1
|
+
{"version":3,"file":"ngwr-file-upload-testing.mjs","names":[],"sources":["../../../projects/lib/file-upload/testing/wr-file-upload-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, type EventData, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrFileUploadSize, WrFileUploadState } from 'ngwr/file-upload';\n\nimport type { WrFileUploadHarnessFilters } from './types';\n\n/**\n * A `DataTransfer` carrying `files`.\n *\n * `FileList` has no constructor anywhere — a browser mints one only as a side\n * effect of `new DataTransfer()`, and jsdom ships neither (`new FileList()` is an\n * illegal constructor there, and the `files` IDL setter refuses anything that is\n * not the genuine article). So: the real thing where it can be had, and an\n * array-like stand-in otherwise, which is all the component ever reads — it does\n * `Array.from(files)` and nothing else.\n */\nfunction dataTransferFor(files: readonly File[]): DataTransfer {\n const Transfer = (globalThis as { DataTransfer?: new () => DataTransfer }).DataTransfer;\n\n if (Transfer) {\n try {\n const transfer = new Transfer();\n for (const file of files) transfer.items.add(file);\n return transfer;\n } catch {\n // A DataTransfer that cannot take items is no use — fall through.\n }\n }\n\n const list: Record<PropertyKey, unknown> = { ...files };\n list['length'] = files.length;\n list['item'] = (index: number): File | null => files[index] ?? null;\n list[Symbol.iterator] = function* (): Generator<File> {\n yield* files;\n };\n\n return {\n dropEffect: 'none',\n effectAllowed: 'all',\n files: list,\n items: [],\n types: files.length > 0 ? ['Files'] : [],\n } as unknown as DataTransfer;\n}\n\n/**\n * The payload `TestElement.dispatchEvent` merges onto the event it fires.\n *\n * One transfer is shared by every event of a drag, the way a real one is: the\n * component writes `dropEffect` on it during `dragover` and reads `files` back\n * out on `drop`.\n */\nfunction dragPayload(transfer: DataTransfer): Record<string, EventData> {\n return { dataTransfer: transfer } as unknown as Record<string, EventData>;\n}\n\n/** The native element behind a `TestElement`, or `null` when there is no DOM to reach. */\nfunction nativeElement(element: TestElement): Element | null {\n const candidate = (element as Partial<{ element: unknown }>).element;\n return typeof Element !== 'undefined' && candidate instanceof Element ? candidate : null;\n}\n\nfunction isFileInput(element: Element | null): element is HTMLInputElement {\n return element !== null && element.tagName === 'INPUT' && (element as HTMLInputElement).type === 'file';\n}\n\n/** Put `files` on the picker, whichever way this environment allows. */\nfunction setPickerFiles(input: HTMLInputElement, files: readonly File[]): void {\n const list = dataTransferFor(files).files;\n\n try {\n input.files = list;\n if (input.files?.length === files.length) return;\n } catch {\n // jsdom's IDL setter refuses a stand-in FileList. Shadow the accessor instead.\n }\n\n // An own data property wins over the prototype accessor, so the component still\n // reads its files off the REAL input — which matters, because the alternative\n // (forging `event.target`) would let a harness pass on a component that never\n // touches the element the user operated.\n Object.defineProperty(input, 'files', { configurable: true, value: list });\n}\n\n/**\n * Test harness for `<wr-file-upload>`.\n *\n * The control a user operates is the `.wr-file-upload__zone` — a `role=\"button\"`\n * div that is the single tab stop; the `<input type=\"file\">` behind it is\n * `aria-hidden` and `tabindex=\"-1\"`, and exists only so a click can be forwarded\n * to it. So focus, drag and disabled state are all read off the zone, plus the\n * `wr-file-upload--*` host modifiers and the rendered file list. The picker is\n * touched only where it is the one that carries the state — `accept` and\n * `multiple` land on it, and {@link selectFiles} has to hand it the files.\n *\n * What this component does NOT have, so this harness does not either:\n * - **no upload.** `<wr-file-upload>` picks files and uploading them is the app's\n * job. What the app says through `[status]` is readable, per file, with\n * {@link getFileStatus}; the percent is on the row's `wr-progress`.\n * - **no thumbnail pixels.** {@link hasPreview} says a thumbnail is in the row.\n * jsdom decodes no image, so whether it shows the file cannot be read.\n * - **no rendered error.** A file refused for its type, its size or the file count\n * leaves NOTHING in the DOM — no `aria-invalid`, no message, and a list that\n * simply did not grow. The `(rejected)` output is the only channel, so a spec\n * asserts on the host's handler. See {@link selectFiles}.\n * - **no `maxSize` / `maxFiles` readback.** Neither reaches the DOM (unlike\n * `accept` and `multiple`, which land on the picker), so they can only be\n * observed by offering a file that breaks them.\n *\n * Two traps worth knowing before writing assertions. The bound value's SHAPE\n * follows `multiple` — a bare `File` (or `null`) in single mode, a `File[]` in\n * multi — and `[showList]=\"false\"` renders no list at all, so {@link getFileNames}\n * answers `[]` for a component that is holding files. Assert the bound value in\n * that case.\n *\n * @example\n * ```ts\n * const upload = await loader.getHarness(WrFileUploadHarness.with({ label: 'Avatar' }));\n * await upload.selectFiles(new File(['…'], 'me.png', { type: 'image/png' }));\n *\n * expect(await upload.getFileNames()).toEqual(['me.png']);\n * await upload.removeFileNamed('me.png');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrFileUploadHarness extends ComponentHarness {\n static hostSelector = 'wr-file-upload';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrFileUploadHarnessFilters = {}): HarnessPredicate<WrFileUploadHarness> {\n return new HarnessPredicate(WrFileUploadHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('multiple', options.multiple, async (harness, multiple) => (await harness.isMultiple()) === multiple)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly zone = this.locatorFor('.wr-file-upload__zone');\n private readonly picker = this.locatorFor('input.wr-file-upload__picker');\n private readonly items = this.locatorForAll('.wr-file-upload__item');\n private readonly names = this.locatorForAll('.wr-file-upload__name');\n private readonly sizes = this.locatorForAll('.wr-file-upload__size');\n private readonly removeButtons = this.locatorForAll('.wr-file-upload__remove');\n\n /**\n * The accessible name of the trigger — what a screen-reader user is told this\n * control is.\n *\n * The `dropZoneLabel` override when one is set, read off `aria-label`. Otherwise\n * the text of what `aria-labelledby` points at, in order: the field's label\n * inside a `<wr-form-field>`, then the zone's visible copy. Resolved through the\n * ids rather than read off the zone's own text, because the field's label sits\n * outside the zone.\n */\n async getLabel(): Promise<string> {\n const zone = await this.zone();\n const override = await zone.getAttribute('aria-label');\n if (override) return override;\n\n const ids = ((await zone.getAttribute('aria-labelledby')) ?? '').split(/\\s+/).filter(Boolean);\n const root = this.documentRootLocatorFactory();\n const parts = await Promise.all(ids.map(async id => (await root.locatorForOptional(`[id=\"${id}\"]`)())?.text()));\n return parts\n .filter((part): part is string => !!part)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n }\n\n /** The visible call-to-action line — the `pickLabel` input. */\n async getPickText(): Promise<string> {\n return (await this.locatorFor('.wr-file-upload__hint strong')()).text();\n }\n\n /** The visible instruction below the CTA — the `dropLabel` input. */\n async getDropText(): Promise<string> {\n return (await this.locatorFor('.wr-file-upload__hint span')()).text();\n }\n\n /** The optional `helperText` line, or `null` when the component was given none. */\n async getHelperText(): Promise<string | null> {\n const helper = await this.locatorForOptional('.wr-file-upload__hint small')();\n return helper === null ? null : helper.text();\n }\n\n /** The `accept` list the picker advertises, or `null` when it accepts anything. */\n async getAccept(): Promise<string | null> {\n return (await this.picker()).getAttribute('accept');\n }\n\n /**\n * Whether more than one file can be held.\n *\n * Read as the DOM PROPERTY: the template writes the attribute as an empty string\n * (`[attr.multiple]=\"multiple() ? '' : null\"`), and `''` is falsy — an attribute\n * read would report a multi-file upload as single.\n */\n async isMultiple(): Promise<boolean> {\n return (await this.picker()).getProperty<boolean>('multiple');\n }\n\n /** The control size. `'md'` is the default and paints no modifier of its own. */\n async getSize(): Promise<WrFileUploadSize> {\n const host = await this.host();\n if (await host.hasClass('wr-file-upload--sm')) return 'sm';\n if (await host.hasClass('wr-file-upload--lg')) return 'lg';\n return 'md';\n }\n\n /**\n * Whether the control refuses interaction.\n *\n * Read from the zone's `aria-disabled`. The host also carries\n * `wr-file-upload--disabled` and the picker its own `disabled`, but the zone is\n * a `role=\"button\"` div — `aria-disabled` is the only one of the three that\n * tells a screen-reader user the trigger is inert.\n */\n async isDisabled(): Promise<boolean> {\n return (await (await this.zone()).getAttribute('aria-disabled')) === 'true';\n }\n\n /**\n * Whether the zone is armed for a drop.\n *\n * The `wr-file-upload--dragging` host modifier is the whole signal — a drop\n * target has no ARIA state, so there is nothing better to read here.\n */\n async isDragging(): Promise<boolean> {\n return (await this.host()).hasClass('wr-file-upload--dragging');\n }\n\n /** How many files the list is RENDERING. Zero with `[showList]=\"false\"`, always. */\n async getFileCount(): Promise<number> {\n return (await this.items()).length;\n }\n\n /** The file names in the rendered list, in order. */\n async getFileNames(): Promise<string[]> {\n const names = await this.names();\n return Promise.all(names.map(name => name.text()));\n }\n\n /**\n * The file sizes in the rendered list, as SHOWN — `'4.9 KB'`, not `5000`.\n *\n * The component formats bytes for display and the byte count never reaches the\n * DOM, so this is the string a user reads. Assert the `File` itself if the exact\n * size matters.\n */\n async getFileSizes(): Promise<string[]> {\n const sizes = await this.sizes();\n return Promise.all(sizes.map(size => size.text()));\n }\n\n /**\n * Hand files to the picker, the way choosing them in the browser dialog does.\n *\n * This is the one method that reaches past `TestElement` to the native\n * `<input type=\"file\">`, and it has to: `TestElement` has no file API, and it\n * cannot grow one portably, because a `FileList` is not constructible and a\n * remote WebDriver session cannot be handed a `File` object at all. Everything\n * else on this harness is environment-agnostic; this needs a DOM behind it\n * (`TestbedHarnessEnvironment`), and says so with an error when it does not have\n * one. The input is found through this harness's own locator rather than a\n * `document` query, so it is still THIS component's picker that gets the files.\n *\n * Rejected files are silent: nothing appears in the DOM, so pair this with the\n * host's `(rejected)` handler when a file is meant to be refused. In single mode\n * the LAST accepted file wins, which is also how a drop of several files onto a\n * single-file zone behaves.\n *\n * @throws if called with no files, on a disabled upload, or outside a DOM\n * environment.\n */\n async selectFiles(...files: File[]): Promise<void> {\n if (files.length === 0) {\n throw new Error(\n 'WrFileUploadHarness.selectFiles(): pass at least one file. Cancelling the browser dialog fires no ' +\n '`change` at all, so \"picked nothing\" is not a state a user can put the component in.'\n );\n }\n\n if (await this.isDisabled()) {\n // The component guards its drop handler but not its `change` handler — it\n // does not need to, since a disabled `<input type=\"file\">` cannot be\n // operated. Forcing the event through anyway would smuggle a file past the\n // disabled state and leave a consumer's spec proving something no user can do.\n throw new Error(\n 'WrFileUploadHarness.selectFiles(): the upload is disabled, and a disabled picker cannot be opened. ' +\n 'Enable it first, or use dropFiles() to assert that a disabled zone refuses what is dropped on it.'\n );\n }\n\n const picker = await this.picker();\n const input = nativeElement(picker);\n\n if (!isFileInput(input)) {\n throw new Error(\n 'WrFileUploadHarness.selectFiles(): no DOM element behind the harness. Files can only be handed to a ' +\n 'real <input type=\"file\">, so this method needs TestbedHarnessEnvironment; a remote WebDriver ' +\n 'environment cannot carry a File across. Every other method on this harness works in both.'\n );\n }\n\n setPickerFiles(input, files);\n await picker.dispatchEvent('change');\n }\n\n /**\n * Drag files over the zone and drop them.\n *\n * Driven by dispatching the drag sequence AT the zone rather than by coordinates:\n * nothing has layout in a unit test — `getBoundingClientRect` is all zeros — so a\n * pointer-driven drag would land nowhere. From the component's side it is the\n * same event either way; it reads `dataTransfer.files` and never a position.\n *\n * A disabled upload refuses the drop itself, so this stays a no-op there rather\n * than throwing the way {@link selectFiles} does — that refusal is the\n * component's own, and worth asserting.\n */\n async dropFiles(...files: File[]): Promise<void> {\n const zone = await this.zone();\n const payload = dragPayload(dataTransferFor(files));\n\n await zone.dispatchEvent('dragenter', payload);\n await zone.dispatchEvent('dragover', payload);\n await zone.dispatchEvent('drop', payload);\n }\n\n /** Drag over the zone without letting go — arms {@link isDragging}. */\n async dragOver(): Promise<void> {\n const zone = await this.zone();\n const payload = dragPayload(dataTransferFor([]));\n\n await zone.dispatchEvent('dragenter', payload);\n await zone.dispatchEvent('dragover', payload);\n }\n\n /**\n * Drag back out of the zone, disarming {@link isDragging}.\n *\n * Dispatched at the zone itself on purpose: the component ignores a `dragleave`\n * whose target is one of the zone's children, because crossing the icon or the\n * hint text is not leaving the zone.\n */\n async dragLeave(): Promise<void> {\n await (await this.zone()).dispatchEvent('dragleave');\n }\n\n /**\n * Remove the file at `index` from the rendered list.\n *\n * On a disabled upload the remove buttons are disabled too, so this is a no-op\n * there — assert the result rather than assuming it.\n */\n async removeFile(index: number): Promise<void> {\n const buttons = await this.removeButtons();\n\n if (index < 0 || index >= buttons.length) {\n throw new Error(\n `WrFileUploadHarness.removeFile(${index}): the rendered list holds ${buttons.length} file(s). ` +\n 'With [showList]=\"false\" it holds none no matter what is selected.'\n );\n }\n\n await buttons[index].click();\n }\n\n /** Remove the file with this name. Names come from {@link getFileNames}. */\n async removeFileNamed(name: string): Promise<void> {\n await this.removeFile(await this.indexNamed('removeFileNamed', name));\n }\n\n /**\n * The upload state the app set for this file through `[status]`: `'pending'`,\n * `'uploading'`, `'done'` or `'error'`, or `null` for a file with no entry.\n *\n * Read off the row's `wr-file-upload__item--<state>` modifier, the one place\n * every state leaves a mark: `pending` draws no part of its own.\n */\n async getFileStatus(name: string): Promise<WrFileUploadState | null> {\n const row = await this.rowNamed('getFileStatus', name);\n for (const state of ['pending', 'uploading', 'done', 'error'] as const) {\n if (await row.hasClass(`wr-file-upload__item--${state}`)) return state;\n }\n return null;\n }\n\n /**\n * Press the retry button of this file's row, which emits `(retry)` with the file.\n *\n * @throws if the file is not in the `error` state: only a failed row has the button.\n */\n async retry(name: string): Promise<void> {\n const index = await this.indexNamed('retry', name);\n const button = await this.locatorForOptional(\n `.wr-file-upload__item:nth-child(${index + 1}) .wr-file-upload__retry`\n )();\n\n if (button === null) {\n throw new Error(\n `WrFileUploadHarness.retry(${JSON.stringify(name)}): the row has no retry button. Only a file whose ` +\n `status is 'error' has one; this one is ${JSON.stringify(await this.getFileStatus(name))}.`\n );\n }\n\n await button.click();\n }\n\n /**\n * Whether this file's row shows a thumbnail: `[previews]` is on and the file\n * is an image. jsdom has no `URL.createObjectURL`, so a spec that expects\n * `true` has to stub it.\n */\n async hasPreview(name: string): Promise<boolean> {\n const index = await this.indexNamed('hasPreview', name);\n const image = await this.locatorForOptional(\n `.wr-file-upload__item:nth-child(${index + 1}) img.wr-file-upload__preview`\n )();\n return image !== null;\n }\n\n /** Index of the row with this name, or a throw that says what the list holds. */\n private async indexNamed(method: string, name: string): Promise<number> {\n const names = await this.getFileNames();\n const index = names.indexOf(name);\n\n if (index === -1) {\n const holding = names.length > 0 ? names.map(n => JSON.stringify(n)).join(', ') : 'no files';\n throw new Error(`WrFileUploadHarness.${method}(${JSON.stringify(name)}): the rendered list holds ${holding}.`);\n }\n\n return index;\n }\n\n private async rowNamed(method: string, name: string): Promise<TestElement> {\n return (await this.items())[await this.indexNamed(method, name)];\n }\n\n /** Move keyboard focus to the zone — the control's only tab stop. */\n async focus(): Promise<void> {\n return (await this.zone()).focus();\n }\n\n /** Whether the zone has focus. */\n async isFocused(): Promise<boolean> {\n return (await this.zone()).isFocused();\n }\n}\n"],"mappings":";;;;;;;AAuBA,SAAS,gBAAgB,OAAsB;CAC7C,MAAM,WAAY,WAAyD;CAE3E,IAAI,UACF,IAAI;EACF,MAAM,WAAW,IAAI,SAAQ;EAC7B,KAAK,MAAM,QAAQ,OAAO,SAAS,MAAM,IAAI,IAAI;EACjD,OAAO;CACT,QAAQ,CAER;CAGF,MAAM,OAAqC,EAAE,GAAG,MAAK;CACrD,KAAK,YAAY,MAAM;CACvB,KAAK,WAAW,UAA+B,MAAM,UAAU;CAC/D,KAAK,OAAO,YAAY,aAAS;EAC/B,OAAO;CACT;CAEA,OAAO;EACL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