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-table.mjs","names":[],"sources":["../../../projects/lib/table/table-cell.ts","../../../projects/lib/table/table-expand.ts","../../../projects/lib/table/table-filter.ts","../../../projects/lib/table/table-filter.html","../../../projects/lib/table/table-group-header.ts","../../../projects/lib/table/table-sort.ts","../../../projects/lib/table/table.ts","../../../projects/lib/table/table.html","../../../projects/lib/table/sort-rows.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 { Directive, TemplateRef, inject, input } from '@angular/core';\n\nimport type { WrSafeAny } from 'ngwr/utils';\n\nimport type { WrTableCellContext, WrTableRow } from './types';\n\n/**\n * Provide a custom template for a specific column's cells.\n *\n * Name the rows through `[wrTableCellOf]` and the template's variables arrive\n * typed: `let-row=\"item\"` is the row and `let-value` is the row's property\n * under the column key. The input is read by the type checker only, the way\n * `*ngFor`'s `of` types its loop variable: the table hands every template the\n * same context whether or not it is set.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"users\">\n * <ng-template wrTableCell=\"role\" [wrTableCellOf]=\"users\" let-value let-row=\"item\">\n * <wr-tag [color]=\"value === 'admin' ? 'danger' : null\">{{ row.name }}</wr-tag>\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({\n selector: '[wrTableCell]',\n})\nexport class WrTableCell<T extends WrTableRow = WrSafeAny, K extends string = string> {\n /** Column key the template applies to. */\n readonly columnKey = input.required<K>({ alias: 'wrTableCell' });\n\n /**\n * The rows the template draws, for the type checker: nothing reads it at\n * runtime. Bind the same array as the table's `[items]`.\n */\n readonly wrTableCellOf = input<readonly T[] | null | undefined>(undefined);\n\n readonly template = inject<TemplateRef<WrTableCellContext<T, K>>>(TemplateRef);\n\n /**\n * Types the template's `let-` variables under `strictTemplates`.\n *\n * `T` defaults to `WrSafeAny` for the reason `WrOptionLeading` gives: a\n * template without `[wrTableCellOf]` has nothing to infer the row from, and\n * narrowed to `unknown` every `row.email` would stop compiling. With the\n * input bound, `K` is the key the attribute names, so `let-value` is that\n * property's type and a key the row does not have reads `unknown`.\n */\n /* eslint-disable @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read */\n static ngTemplateContextGuard<T extends WrTableRow, K extends string>(\n _dir: WrTableCell<T, K>,\n _ctx: unknown\n ): _ctx is WrTableCellContext<T, K> {\n return true;\n }\n /* eslint-enable @typescript-eslint/no-unused-vars */\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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrTableExpandContext } from './types';\n\n/**\n * Provide the detail template revealed when a row is expanded. Adding it turns\n * on the leading expand column; the row object is the template's implicit\n * context.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"items\" [(expanded)]=\"expanded\" rowKey=\"id\">\n * <ng-template wrTableExpand let-row>\n * <p>{{ row.bio }}</p>\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrTableExpand]',\n})\nexport class WrTableExpand {\n readonly template = inject<TemplateRef<WrTableExpandContext>>(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 { Component, ViewEncapsulation, computed, input, output, signal } from '@angular/core';\n\nimport { WrDropdown, WrDropdownMenu } from 'ngwr/dropdown';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrIsComposing, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTableFilterItem } from './types';\n\n/**\n * Bumped on every selection change, by EVERY filter.\n *\n * `items` belongs to the CONSUMER — the column definition hands the same array\n * back on every render — and a filter flips `selected` on those objects in\n * place. No signal sees a property mutation, so anything derived from it has to\n * be told. One counter for all instances rather than one each, because a column\n * definition is routinely shared: two tables over one `columns` object hold the\n * same objects, and a per-instance counter left the table that was not clicked\n * showing no badge over a panel with a ticked box.\n */\nconst selectionVersion = signal(0);\n\n/**\n * Filter dropdown rendered in a filterable column's header.\n *\n * @internal — used internally by `<wr-table>`.\n */\n@Component({\n selector: 'wr-table-filter',\n templateUrl: './table-filter.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-table-filter', '[class]': 'classes()' },\n imports: [WrDropdown, WrDropdownMenu],\n})\nexport class WrTableFilter {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('table');\n }\n\n /** Available filter options. */\n /** Accessible name of the filter trigger. Falls back to `table.filter`. */\n readonly filterLabel = input<string | null>(null);\n\n /**\n * The column this filter belongs to, for the trigger's accessible name.\n *\n * Without it every filter trigger in a header row announced the same\n * \"Filter column\", so a screen-reader user tabbing the row heard the same\n * button three times and could not tell which column each one narrowed. The\n * caret and the funnel sit beside the column title, so sighted readers had\n * the context all along; an `aria-label` REPLACES content, so nobody else did.\n */\n readonly column = input<string>('');\n\n /** Text shown when the search finds nothing. Falls back to `table.noMatches`. */\n readonly noMatchesLabel = input<string | null>(null);\n\n /**\n * Placeholder AND accessible name of the search box. Falls back to `table.search`.\n *\n * One string for both because the box has no visible label: the placeholder was\n * its only name, so a hard-coded literal left the control unnamed in every other\n * language rather than merely untranslated.\n */\n readonly searchLabel = input<string | null>(null);\n\n /** Label of the clear-selection button. Falls back to `table.reset`. */\n readonly resetLabel = input<string | null>(null);\n\n private readonly filterText = useI18nFormatter('table.filter', 'Filter {{column}}');\n\n // Trimmed: a filter used on its own has no column, and \"Filter \" with the\n // placeholder's trailing space is what a reader would otherwise hear.\n protected readonly resolvedFilterLabel = computed(\n () => this.filterLabel() ?? this.filterText({ column: this.column() }).trim()\n );\n protected readonly resolvedNoMatchesLabel = useI18nText(this.noMatchesLabel, 'table.noMatches', 'No matches');\n protected readonly resolvedSearchLabel = useI18nText(this.searchLabel, 'table.search', 'Search');\n protected readonly resolvedResetLabel = useI18nText(this.resetLabel, 'table.reset', 'Reset');\n\n /**\n * The values the column can be filtered by. Shown as a checkbox list, so pass\n * the distinct values rather than one entry per row.\n */\n readonly items = input.required<readonly WrTableFilterItem[]>();\n\n /** Fires whenever the selection changes. */\n readonly selectionChange = output<readonly WrTableFilterItem[]>();\n\n protected readonly query = signal('');\n\n /** Filtered + selection-tracked view of items. */\n protected readonly visible = computed<WrTableFilterItem[]>(() => {\n const q = this.query().trim().toLowerCase();\n const all = this.items();\n if (!q) return [...all];\n return all.filter(i => i.title.toLowerCase().includes(q));\n });\n\n protected readonly selectedCount = computed(() => {\n selectionVersion();\n return this.items().filter(i => i.selected).length;\n });\n\n /**\n * The trigger's name: the filter label, plus the count it shows once something\n * is selected. The count is visible text on the button, so leaving it out of\n * the name breaks WCAG 2.5.3 (Label in Name) for a speech-input user. Joined\n * with a comma, not wrapped in parentheses: axe reads `(1)` as a token that\n * does not contain `1`, measured in Chromium against axe-core 4.14.\n */\n protected readonly triggerName = computed(() => {\n const count = this.selectedCount();\n return count > 0 ? `${this.resolvedFilterLabel()}, ${count}` : this.resolvedFilterLabel();\n });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.selectedCount() > 0) parts.push('wr-table-filter--active');\n return parts.join(' ');\n });\n\n protected onSearchInput(event: Event): void {\n this.query.set((event.target as HTMLInputElement).value);\n }\n\n /**\n * Hands every key back to the input method while a conversion is open.\n *\n * The dropdown this panel lives in closes on Escape, and it hears the key from\n * CDK's overlay keyboard dispatcher — one listener on `<body>`, in the bubble\n * phase. So not acting is not enough: the event has to be stopped here, at the\n * field that owns the composition, or Escape cancels the reading AND takes the\n * whole filter panel with it. Nothing else in this component reads a key, so\n * stopping all of them during a conversion costs nothing.\n */\n protected onSearchKeydown(event: KeyboardEvent): void {\n if (wrIsComposing(event)) event.stopPropagation();\n }\n\n protected onToggle(item: WrTableFilterItem): void {\n item.selected = !item.selected;\n selectionVersion.update(v => v + 1);\n this.emitSelected();\n }\n\n protected onReset(): void {\n for (const item of this.items()) item.selected = false;\n selectionVersion.update(v => v + 1);\n this.selectionChange.emit([]);\n }\n\n private emitSelected(): void {\n this.selectionChange.emit(this.items().filter(i => i.selected));\n }\n}\n","<button type=\"button\" class=\"wr-table-filter__trigger\" [wrDropdown]=\"menu\" [attr.aria-label]=\"triggerName()\">\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\n d=\"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\"\n />\n </svg>\n @if (selectedCount() > 0) {\n <span class=\"wr-table-filter__count\">{{ selectedCount() }}</span>\n }\n</button>\n\n<wr-dropdown-menu #menu>\n <div class=\"wr-table-filter__panel\">\n <input\n class=\"wr-table-filter__search\"\n type=\"search\"\n [placeholder]=\"resolvedSearchLabel()\"\n [attr.aria-label]=\"resolvedSearchLabel()\"\n [value]=\"query()\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n\n <div class=\"wr-table-filter__list\">\n @for (item of visible(); track item.value) {\n <button\n type=\"button\"\n class=\"wr-table-filter__item\"\n [class.wr-table-filter__item--selected]=\"item.selected\"\n [attr.aria-pressed]=\"!!item.selected\"\n (click)=\"onToggle(item)\"\n >\n <span class=\"wr-table-filter__check\">\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=\"M20 6 9 17l-5-5\" />\n </svg>\n </span>\n <span class=\"wr-table-filter__title\">{{ item.title }}</span>\n </button>\n } @empty {\n <div class=\"wr-table-filter__empty\">{{ resolvedNoMatchesLabel() }}</div>\n }\n </div>\n\n @if (selectedCount() > 0) {\n <button type=\"button\" class=\"wr-table-filter__reset\" (click)=\"onReset()\">{{ resolvedResetLabel() }}</button>\n }\n </div>\n</wr-dropdown-menu>\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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrTableGroupContext } from './types';\n\n/**\n * Provide a custom template for a group band's label area. The collapse chevron\n * and the optional group checkbox are still rendered by the table around it, so\n * the template may safely contain its own interactive content. Projecting it\n * does NOT enable grouping — set `[groupBy]` for that.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"rows\" groupBy=\"department\">\n * <ng-template wrTableGroupHeader let-value let-count=\"count\" let-toggle=\"toggle\">\n * <wr-tag color=\"primary\" (click)=\"toggle()\">{{ value }}</wr-tag>\n * <small>{{ count }} people</small>\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({ selector: 'ng-template[wrTableGroupHeader]' })\nexport class WrTableGroupHeader {\n readonly template = inject<TemplateRef<WrTableGroupContext>>(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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTableSortDirection } from './types';\n\n/**\n * Sort indicator rendered in a sortable column's header.\n *\n * Draws an ARROW for a sorted column — up for `asc`, the same arrow turned by\n * the stylesheet for `desc` — and a flat LINE for a column that sorts but is\n * not sorted. A different shape rather than a fainter arrow, on purpose: a\n * dimmed up-arrow reads as \"sorted ascending\", which is the one thing an\n * unsorted column must not say, and a state told apart by opacity and colour\n * alone is lost to anyone who cannot see that difference. A line also has no\n * direction to mirror under RTL.\n *\n * @internal — used internally by `<wr-table>`. Parent listens for clicks\n * on the indicator to cycle direction.\n */\n@Component({\n selector: 'wr-table-sort',\n template:\n '<svg class=\"wr-icon__svg wr-table-sort__icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">@if (direction()) {<path d=\"m5 12 7-7 7 7\"/><path d=\"M12 19V5\"/>} @else {<path d=\"M6 12h12\"/>}</svg>',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-table-sort', '[class]': 'classes()' },\n})\nexport class WrTableSort {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('table');\n }\n\n /**\n * Which way the column is currently sorted, or `null` for unsorted — the three\n * states the indicator cycles through. Drive it from the table's `sort` state.\n */\n readonly direction = input<WrTableSortDirection>(null);\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const dir = this.direction();\n if (dir) parts.push(`wr-table-sort--${dir}`);\n return parts.join(' ');\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InputModalityDetector } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { CdkDrag, type CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n ElementRef,\n Injector,\n afterNextRender,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n computed,\n contentChild,\n contentChildren,\n effect,\n inject,\n input,\n isDevMode,\n linkedSignal,\n model,\n output,\n signal,\n untracked,\n viewChild,\n viewChildren,\n} from '@angular/core';\n\nimport { WrCheckbox } from 'ngwr/checkbox';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrPagination, type WrPaginationSize } from 'ngwr/pagination';\nimport { WrPopover } from 'ngwr/popover';\nimport { WrSpinner } from 'ngwr/spinner';\nimport {\n WR_KEYS,\n wrToClassList,\n wrCheckStyles,\n wrDecimal,\n wrDecimalAdd,\n wrDecimalCompare,\n wrDecimalDivide,\n wrDownloadBlob,\n} from 'ngwr/utils';\n\nimport { WrTableCell } from './table-cell';\nimport { WrTableExpand } from './table-expand';\nimport { WrTableFilter } from './table-filter';\nimport { WrTableGroupHeader } from './table-group-header';\nimport { WrTableSort } from './table-sort';\nimport type {\n WrTableCellContext,\n WrTableColumn,\n WrTableColumns,\n WrTableCsvOptions,\n WrTableExpandContext,\n WrTableFilterChange,\n WrTableFilterItem,\n WrTableGroupContext,\n WrTableLoadingMode,\n WrTableRow,\n WrTableRowClass,\n WrTableRowClick,\n WrTableSortState,\n WrTableSortDirection,\n WrTableSummary,\n WrTableSummaryContext,\n WrTableTruncate,\n} from './types';\n\n/** Sentinel value for the single synthetic bucket used when grouping is off. */\nconst WR_TABLE_UNGROUPED = Symbol('wr-table-ungrouped');\n\n/** One `<tbody>` row descriptor. Not exported — same precedent as the tree's flat node. */\ntype RenderRow =\n | { readonly kind: 'group'; readonly id: string; readonly group: WrTableGroupContext }\n | {\n readonly kind: 'row';\n readonly id: string;\n readonly row: Record<string, unknown>;\n /** 0 for a flat table and for every root; +1 per level in tree mode. */\n readonly depth: number;\n /** Whether this row owns a child array — drives the toggle vs the spacer. */\n readonly parent: boolean;\n /** Open state, `null` for a leaf (so `aria-expanded` is omitted entirely). */\n readonly open: boolean | null;\n /** 1-based position among its siblings, for `aria-posinset`. */\n readonly posinset: number;\n /** Sibling count, for `aria-setsize`. */\n readonly setsize: number;\n }\n | { readonly kind: 'group-foot'; readonly id: string; readonly summaries: ReadonlyMap<string, unknown> };\n\n/**\n * Instance counter for the ids the row controls are named through. Counted, not\n * `wrRandomId()`, so the prerendered `aria-labelledby` is the one the browser\n * renders again — the same reason `wr-tabs` and `wr-mention` count.\n */\nlet tableUid = 0;\n\n/** The grand-total context every `<tfoot>` summary is computed with. */\nconst WR_TABLE_TOTAL_SCOPE: WrTableSummaryContext = { scope: 'total', group: null };\n\n/** A formatted figure such as `-1,234.50`, which no spreadsheet evaluates as a formula. */\nconst CSV_FIGURE = /^[+-]?[\\d\\s.,]+%?$/;\n\n/**\n * What a click inside a row belongs to instead of the row. `label` is here\n * because a click on one is replayed on its control.\n */\nconst ROW_CLICK_IGNORE = [\n 'button',\n 'a[href]',\n 'input',\n 'select',\n 'textarea',\n '[role=button]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'label',\n '[wrTableIgnoreRowClick]',\n // A near miss around the row's own checkbox or toggle is not a row click.\n '.wr-table__td--select',\n '.wr-table__td--expand',\n].join(', ');\n\n/** A missing cell value: `null`, `undefined` or `''`. `0` and `false` are values. */\nfunction noValue(value: unknown): value is null | undefined | '' {\n return value == null || value === '';\n}\n\n/**\n * A built-in summary over a column that holds decimal STRINGS, exact through\n * `wrDecimal`. A cell it cannot read is left out, the way the number path\n * leaves out a non-finite one; the average divides at the widest scale among\n * the values and never fewer than two places, half away from zero.\n */\nfunction decimalSummary(kind: 'sum' | 'avg' | 'min' | 'max', values: readonly unknown[]): string {\n const decimals: string[] = [];\n let scale = 2;\n for (const value of values) {\n const decimal = wrDecimal(value);\n if (decimal === null) continue;\n decimals.push(decimal);\n const point = decimal.indexOf('.');\n if (point >= 0) scale = Math.max(scale, decimal.length - point - 1);\n }\n if (decimals.length === 0) return '';\n if (kind === 'min' || kind === 'max') {\n const keep = kind === 'min' ? -1 : 1;\n return decimals.reduce((a, b) => (wrDecimalCompare(b, a) === keep ? b : a));\n }\n let sum = '0';\n for (const decimal of decimals) sum = wrDecimalAdd(sum, decimal) ?? sum;\n return kind === 'sum' ? sum : (wrDecimalDivide(sum, decimals.length, scale) ?? '');\n}\n\n/**\n * A header or body cell's classes: the base, the `align` modifier and the\n * column's own `class`, in that order.\n */\n/**\n * Whether a projected template is an `<ng-template>` element rather than an\n * `@if` / `@for` / `@switch` block, which a `TemplateRef` query matches too.\n * Angular offers no public way to tell them apart. The compiler gives an\n * `<ng-template>` that tag name and never gives it to a block, so this reads\n * it off the template's declaration node. Dev-mode only: where that field is\n * missing, every template counts.\n */\nfunction isNgTemplateElement(tpl: TemplateRef<unknown>): boolean {\n const tag = (tpl as unknown as { _declarationTContainer?: { value?: unknown } })._declarationTContainer?.value;\n return tag === undefined || tag === 'ng-template';\n}\n\nfunction cellClasses(base: 'wr-table__th' | 'wr-table__td', column: Pick<WrTableColumn, 'align' | 'class'>): string {\n const own = column.align ? `${base} ${base}--align-${column.align}` : base;\n return column.class ? wrToClassList(own, column.class).join(' ') : own;\n}\n\n/** A flat row descriptor with the tree fields at their flat-table defaults. */\nfunction flatRow(row: Record<string, unknown>, id: string, posinset: number, setsize: number): RenderRow {\n return { kind: 'row', id, row, depth: 0, parent: false, open: null, posinset, setsize };\n}\n\n/**\n * Data table with sortable / filterable headers and custom cell templates.\n *\n * Columns are defined via the `columns` input (a `Record<key, column>`).\n * Rows are objects whose property names match the column keys. Cells can\n * be customised by projecting an `[wrTableCell]=\"key\"` template.\n *\n * @example\n * ```html\n * <wr-table\n * [columns]=\"columns\"\n * [items]=\"rows\"\n * [(sort)]=\"sort\"\n * (filterChange)=\"onFilter($event)\"\n * >\n * <ng-template wrTableCell=\"role\" let-value>\n * <wr-tag [color]=\"value === 'admin' ? 'danger' : null\">{{ value }}</wr-tag>\n * </ng-template>\n * </wr-table>\n * ```\n *\n * @see https://ngwr.dev/reference/components/table\n */\n@Component({\n selector: 'wr-table',\n templateUrl: './table.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-table',\n '[class.wr-table--responsive]': 'responsive()',\n '[class.wr-table--virtual]': 'virtualized()',\n '[class.wr-table--sticky-head]': 'scrollable()',\n '[class.wr-table--fill]': 'fillsParent()',\n '[class.wr-table--overflow-start]': 'overflow().start',\n '[class.wr-table--overflow-end]': 'overflow().end',\n // The rows under the veil are stale while a load is in flight, and nothing\n // said so: the veil marked itself, not the table it covers. Same pairing as\n // `wr-card` — mark busy, don't block (the veil is `pointer-events: none`).\n '[attr.aria-busy]': 'loading() ? true : null',\n // The treegrid's row keyboard, delegated: one listener pair for the whole\n // table rather than one per row, and both return at once outside tree mode.\n '(keydown)': 'onTreeKeydown($event)',\n '(focusin)': 'onTreeFocusin($event)',\n },\n imports: [\n NgTemplateOutlet,\n CdkDropList,\n CdkDrag,\n WrCheckbox,\n WrPagination,\n WrPopover,\n WrSpinner,\n WrTableSort,\n WrTableFilter,\n ],\n})\nexport class WrTable<T extends WrTableRow = WrTableRow> {\n /**\n * Column definitions, keyed by row property name. Typed against the row\n * `[items]` carries, so a column's `format` sees it: `WrTableColumns<User>`\n * binds to `[items]=\"users\"` and to nothing else, while a bare\n * `WrTableColumns` still binds anywhere.\n */\n readonly columns = input.required<WrTableColumns<T>>();\n\n /**\n * Row items. `null`/`undefined` renders the empty state; use `[loading]` for\n * the spinner.\n *\n * `T` is inferred from here, and it is constrained to `WrTableRow`\n * (= `object`) rather than `Record<string, unknown>`, so an array of an\n * `interface` binds as readily as an array of a `type` — see\n * {@link WrTableRow} for why those two are not the same to TypeScript.\n */\n readonly items = input<readonly T[] | null | undefined>(null);\n\n /**\n * The rows as records, for everything downstream that reads a cell by key.\n *\n * One cast at the boundary: the INPUT is wide so any object shape binds, while\n * the body keeps indexing rows the way it always has.\n */\n private readonly rows = computed<readonly Record<string, unknown>[] | null | undefined>(\n () => this.items() as unknown as readonly Record<string, unknown>[] | null | undefined\n );\n\n /** Mark the table as loading; `loadingMode` picks how it shows. @default false */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * How `loading` shows. `'overlay'` veils the table under a spinner. `'bar'`\n * runs a thin progress bar along the top edge and leaves the rows as they\n * are, for a table that refreshes while it is being read. `'auto'` is the\n * overlay while no row is shown and the bar once rows are. The host carries\n * `aria-busy` in every form.\n * @default 'auto'\n */\n readonly loadingMode = input<WrTableLoadingMode>('auto');\n\n /** The form `loading` takes right now, `null` while nothing loads. */\n protected readonly loadingForm = computed<'overlay' | 'bar' | null>(() => {\n if (!this.loading()) return null;\n const mode = this.loadingMode();\n if (mode !== 'auto') return mode;\n return this.renderRows().length ? 'bar' : 'overlay';\n });\n\n /**\n * Collapse each row to a labelled card when the table's own box is too narrow\n * for columns (a container query on its own width, not the viewport). Every\n * cell shows its column title as a label. @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Enable drag-to-reorder on the column headers. @default false */\n readonly reorderable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Two-way bindable column order — an array of column keys. Reflects and drives\n * the header order: the table falls back to declaration order for any key not\n * listed, and updates this on drag. Bind it to persist a user's arrangement.\n */\n readonly columnOrder = model<readonly string[]>([]);\n\n /**\n * Row selection with a leading checkbox column — `'multiple'` adds a\n * select-all header; `'single'` keeps one row selected. @default null (off)\n */\n readonly rowSelection = input<'single' | 'multiple' | null>(null);\n\n /**\n * What the header select-all covers. `'page'` is the rows on screen: the\n * current page, less a collapsed group's rows and a closed parent's children.\n * `'all'` is the same rule over every page of `items`, so the box reads\n * checked only when all of them are selected, mixed when some are, and one\n * click selects or clears them all. Either way a selected key that is not in\n * the scope stays selected.\n *\n * The table filters nothing itself: `items` is already what the filters left,\n * so `'all'` never reaches a row a filter removed. Group band checkboxes keep\n * their page scope, since grouping runs after pagination.\n *\n * In server mode (`total` set) the table holds one page and cannot name the\n * rows of the others, so `'all'` behaves as `'page'` there.\n * @default 'page'\n */\n readonly selectAllScope = input<'page' | 'all'>('page');\n\n /**\n * Extra CSS classes per body row, from the row and its drawn index.\n *\n * The `<tr>` is ngwr's own element and there is no template slot that renders\n * as one, so this is the only way to mark a row — overdue, unsaved, over\n * budget — without a rule that has to re-derive the condition in CSS.\n *\n * It does NOT touch the detail row an expanded row opens, the group header or\n * the summary row: each of those is a sibling `<tr>` with its own meaning, and\n * a row predicate that painted them too would stripe a table's totals.\n */\n readonly rowClass = input<WrTableRowClass | null>(null);\n\n /**\n * How to identify a row for selection — a property name or a function.\n * Unset uses the row object itself (fine for a stable row array).\n */\n readonly rowKey = input<string | ((row: Record<string, unknown>) => unknown) | null>(null);\n\n /** Two-way bindable selected row keys. */\n readonly selection = model<readonly unknown[]>([]);\n\n /** Two-way bindable expanded row keys (needs a `[wrTableExpand]` template). */\n readonly expanded = model<readonly unknown[]>([]);\n\n /**\n * Group rows under collapsible band headers — a row property name, or a\n * function returning the group value. `null` (default) renders the table\n * exactly as before.\n *\n * Grouping runs AFTER pagination: it buckets the rows on the current page in\n * first-appearance order (it never re-sorts your data — same contract as\n * `[(sort)]`), so a group straddling a page boundary shows a band on both\n * pages, and per-group counts / subtotals are page-scoped. Sort `items` by the\n * same key upstream to keep groups whole, or pair with `pageSize = 0`.\n *\n * Group values are compared by identity (`Map`/`Set`, SameValueZero) — return\n * a primitive, exactly as for `rowKey`. Objects / `Date`s bucket by reference.\n *\n * @default null\n */\n readonly groupBy = input<string | ((row: Record<string, unknown>) => unknown) | null>(null);\n\n /**\n * Render the rows as a hierarchy: names the property (or computes the array)\n * holding each row's children. `items` then means the ROOTS, and the forest is\n * flattened depth-first into the same `<tbody>` — child rows are ordinary\n * `<tr>`s going through the same cell loop, so column pin / resize /\n * drag-reorder and `[wrTableCell]` templates keep working at every depth.\n *\n * Open state reuses the `expanded` model and row identity reuses `rowKey`, so\n * a tree needs no second key space. Everything collapsed is the default.\n *\n * **Mutually exclusive with `groupBy`** — a forest has no flat list to bucket,\n * so grouping wins and the hierarchy is ignored while it is set. Also\n * mutually exclusive with `[wrTableExpand]` detail rows: both own the row's\n * disclosure affordance.\n *\n * `pageSize` pages the ROOTS; a root brings its open descendants with it.\n *\n * The function form RETURNS `WrTableRow`s, matching `[items]`: a return is\n * covariant, so an array of `interface`-typed children satisfies it. Declared\n * as records it did not, and a forest that bound to `[items]` could not hand\n * its children back out. The PARAMETER stays `Record<string, unknown>` — that\n * side is contravariant, and widening it would reject the callbacks that\n * compile today while leaving `row['reports']` unindexable. See\n * {@link WrTableRow}.\n *\n * @example\n * ```html\n * <wr-table\n * rowKey=\"id\"\n * childrenKey=\"reports\"\n * treeColumn=\"name\"\n * [columns]=\"columns\"\n * [items]=\"org\"\n * [(expanded)]=\"open\"\n * />\n * ```\n */\n readonly childrenKey = input<\n string | ((row: Record<string, unknown>) => readonly WrTableRow[] | null | undefined) | null\n >(null);\n\n /**\n * Which column carries the indent and the expand toggle. Keyed, not\n * positional, so it survives a `columnOrder` drag. Defaults to whichever\n * column renders first.\n */\n readonly treeColumn = input<string | null>(null);\n\n /**\n * The action word that names a parent row's expand toggle. The row's own label\n * cell is joined to it, so the toggle reads \"Toggle child rows Engineering\"\n * rather than one name shared by every row. Falls back to `table.toggleRow`.\n */\n readonly toggleRowLabel = input<string | null>(null);\n\n /**\n * Two-way bindable collapsed group values (the values `groupBy` returns).\n * Keyed by value, so a collapsed group stays collapsed across page changes and\n * re-sorts. Empty (the default) shows every group expanded.\n */\n readonly collapsedGroups = model<readonly unknown[]>([]);\n\n /**\n * Render an aggregate row under each group using the same `column.summary`\n * definitions as the grand footer, computed over that group's rows on the\n * current page. No-op unless at least one column defines a `summary`. The grand\n * `<tfoot>` is unaffected and still aggregates the whole client dataset — with\n * client-side pagination the two describe different scopes, so pair grouping\n * with `pageSize = 0` when you need them to reconcile. A summary FUNCTION tells\n * the two apart by its second argument, `{ scope: 'group' | 'total' }` — see\n * `WrTableSummaryContext`. @default false\n */\n readonly groupSummary = input(false, { transform: coerceBooleanProperty });\n\n /** Show the page-scoped row-count badge in each group band. @default true */\n readonly showGroupCount = input(true, { transform: coerceBooleanProperty });\n\n /** Two-way bindable sort array. Order in array = application order. */\n readonly sort = model<readonly WrTableSortState[]>([]);\n\n /** Text shown when there are no rows. Falls back to `table.empty`. */\n readonly emptyLabel = input<string | null>(null);\n\n /** Accessible name of a column's sort button. Falls back to `table.sort`. */\n readonly sortLabel = input<string | null>(null);\n\n /** Accessible name of the select-all checkbox. Falls back to `table.selectAll`. */\n readonly selectAllLabel = input<string | null>(null);\n\n /**\n * The action word that names a row's select checkbox. The row's label cell is\n * joined to it through `aria-labelledby` — \"Select row Ada\" — since one name\n * repeated down every row tells a screen reader nothing about which row a box\n * belongs to. Falls back to `table.selectRow`.\n */\n readonly selectRowLabel = input<string | null>(null);\n\n /**\n * The action word that names a row's detail toggle, joined to the row's label\n * cell like `selectRowLabel`. Falls back to `table.expandRow`.\n */\n readonly expandRowLabel = input<string | null>(null);\n\n /**\n * The action word that names a group band's select checkbox. The group's label\n * is joined to it — \"Select group EMEA\". Falls back to `table.selectGroup`.\n */\n readonly selectGroupLabel = input<string | null>(null);\n\n /**\n * The action word that names a group band's collapse toggle, joined to the\n * group's label like `selectGroupLabel`. Falls back to `table.toggleGroup`.\n */\n readonly toggleGroupLabel = input<string | null>(null);\n\n /** Accessible name of the loading overlay or bar. Falls back to `table.loading`. */\n readonly loadingLabel = input<string | null>(null);\n\n protected readonly resolvedEmptyLabel = useI18nText(this.emptyLabel, 'table.empty', 'No data');\n /**\n * The loading overlay was a bare spinner in a `<div>` — a busy state with no\n * accessible name, which a screen reader reports as nothing at all while the\n * table sits empty. `table.loading` shipped in both catalogs for it and was\n * never read.\n */\n protected readonly resolvedLoadingLabel = useI18nText(this.loadingLabel, 'table.loading', 'Loading…');\n private readonly sortText = useI18nFormatter('table.sort', 'Sort {{column}}');\n\n /**\n * The sort button's accessible name, with the COLUMN in it.\n *\n * It used to be one static string on every sortable header, so a header row\n * with three of them offered a screen reader three buttons called \"Sort\n * column\". An `aria-label` replaces content, so the title sitting next to\n * the caret reached a sighted reader and nobody else. A consumer's own\n * `sortLabel` still wins whole, unformatted — it is their string.\n */\n protected sortLabelFor(column: string): string {\n return this.sortLabel() ?? this.sortText({ column });\n }\n protected readonly resolvedSelectAllLabel = useI18nText(this.selectAllLabel, 'table.selectAll', 'Select all rows');\n protected readonly resolvedSelectRowLabel = useI18nText(this.selectRowLabel, 'table.selectRow', 'Select row');\n protected readonly resolvedExpandRowLabel = useI18nText(this.expandRowLabel, 'table.expandRow', 'Toggle row details');\n protected readonly resolvedToggleRowLabel = useI18nText(this.toggleRowLabel, 'table.toggleRow', 'Toggle child rows');\n protected readonly resolvedSelectGroupLabel = useI18nText(this.selectGroupLabel, 'table.selectGroup', 'Select group');\n protected readonly resolvedToggleGroupLabel = useI18nText(this.toggleGroupLabel, 'table.toggleGroup', 'Toggle group');\n\n // --- Control names ----------------------------------------------------------\n //\n // Every row control used to share one generic name: ten checkboxes called\n // \"Select row\" and ten chevrons called \"Toggle child rows\", so a screen reader\n // moving down the selection column heard the same word ten times and never the\n // row. Each control now points `aria-labelledby` at TWO ids — an action word,\n // rendered once per table as hidden text, and the row's own label cell — which\n // is the one ARIA mechanism that joins two elements into a name.\n\n /** Prefix of every id this table renders. Counted, so SSR and the client agree. */\n private readonly uid = `wr-table-${tableUid++}`;\n\n /** Id of the hidden action word one kind of row control is named with. */\n protected actionId(action: 'select-row' | 'expand-row' | 'toggle-row' | 'select-group' | 'toggle-group'): string {\n return `${this.uid}-${action}`;\n }\n\n /**\n * Id of a row's label cell, from the row descriptor's id — which is its place\n * in the flattened body (`r3`, `g1r0`, `r0-r2`), deterministic per render.\n */\n protected rowLabelId(rowId: string): string {\n return `${this.uid}-${rowId}-label`;\n }\n\n /** Id of a group band's label — the visible one, or a hidden copy beside a custom header. */\n protected groupLabelId(groupId: string): string {\n return `${this.uid}-${groupId}-label`;\n }\n\n /** Id of a group band's row-count badge, which the built-in toggle's name ends with. */\n protected groupCountId(groupId: string): string {\n return `${this.uid}-${groupId}-count`;\n }\n\n /**\n * The column whose cell names its row: the tree column in tree mode — the one\n * carrying the hierarchy, and the first rendered column unless `treeColumn`\n * says otherwise — and the first rendered column everywhere else.\n *\n * Keyed rather than positional, like `treeColumn`, so it follows a\n * `columnOrder` drag.\n */\n protected readonly labelColumnKey = computed<string | null>(\n () => this.treeColumnKey() ?? this.displayColumns()[0]?.key ?? null\n );\n\n /**\n * `aria-labelledby` of the built-in group toggle: the action word, the group's\n * label, and its row count while the badge shows — the count the toggle's own\n * text used to carry, which `aria-labelledby` would otherwise replace.\n */\n protected groupToggleLabelledby(groupId: string): string {\n const parts = [this.actionId('toggle-group'), this.groupLabelId(groupId)];\n if (this.showGroupCount()) parts.push(this.groupCountId(groupId));\n return parts.join(' ');\n }\n\n /** `aria-labelledby` of a row control: its action word, then the row's label cell. */\n protected rowControlLabelledby(action: 'select-row' | 'expand-row' | 'toggle-row', rowId: string): string {\n return `${this.actionId(action)} ${this.rowLabelId(rowId)}`;\n }\n\n /** `aria-labelledby` of a group band's checkbox, or of the toggle beside a custom header. */\n protected groupControlLabelledby(action: 'select-group' | 'toggle-group', groupId: string): string {\n return `${this.actionId(action)} ${this.groupLabelId(groupId)}`;\n }\n\n /** Fires whenever a column's filter selection changes. */\n readonly filterChange = output<WrTableFilterChange>();\n\n /**\n * Fires when a body row is clicked, with the row, its index in `items` and the\n * click. Group bands, summary rows and detail rows do not fire it.\n *\n * A click on an interactive element inside the row is that element's own and\n * does not fire: a button, a link, a form field, a label, `[role=button]`,\n * editable content, the table's own toggles and its selection and expand\n * cells. Mark anything else with the `wrTableIgnoreRowClick` attribute,\n * which needs no import: `<app-menu wrTableIgnoreRowClick />`.\n *\n * Pointer only: a row takes no focus and no key for it, so give the same\n * action a control of its own in the row (a link or a button in a cell) for\n * keyboard and screen reader users. The table adds no cursor either: style\n * `.wr-table__tr` when the rows are clickable.\n */\n readonly rowClick = output<WrTableRowClick<T>>();\n\n protected onBodyClick(event: MouseEvent): void {\n const target = event.target as Element;\n const index = this.rowEls().findIndex(el => el.nativeElement.contains(target));\n if (index < 0) return;\n const tr = this.rowEls()[index].nativeElement;\n const control = target.closest(ROW_CLICK_IGNORE);\n if (control && control !== tr && tr.contains(control)) return;\n const row = this.windowRows().filter(entry => entry.kind === 'row')[index];\n if (row?.kind !== 'row') return;\n const item = row.row;\n this.rowClick.emit({ row: item as unknown as T, index: this.rows()?.indexOf(item) ?? -1, event });\n }\n\n /**\n * Rows per page. Set to `0` (default) to disable client-side pagination\n * and render every row at once.\n */\n readonly pageSize = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Sizes the pager offers in a size menu. Empty (default) shows no menu. A size\n * the reader picks pages the rows at once and fires `pageSizeChange`, so\n * `[(pageSize)]` keeps it on the host; the page moves to keep the first visible\n * row on screen.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"rows\" [(pageSize)]=\"size\" [pageSizeOptions]=\"[10, 25, 50]\" />\n * ```\n */\n readonly pageSizeOptions = input<readonly number[]>([]);\n\n /** Size of the pager under the table: its cells and its size menu. @default 'sm' */\n readonly paginationSize = input<WrPaginationSize>('sm');\n\n /** Fires with the size the reader picks in the pager's size menu. */\n readonly pageSizeChange = output<number>();\n\n /** The size in force: the bound `pageSize`, until the reader picks another. */\n protected readonly currentPageSize = linkedSignal(() => this.pageSize());\n\n /** Two-way bindable 1-based current page. */\n readonly page = model<number>(1);\n\n /**\n * Total row count for server-side pagination — when set, the table\n * shows the pager but does NOT slice `items` (you provide the current\n * page's slice yourself and react to `(page)` changes).\n *\n * Spelled `total` / `page` to match `<wr-pagination>`, which is the control\n * this input renders. The two used to disagree about both words — `totalItems`\n * / `page` here against `total` / `currentPage` there — which is a real cost\n * for two components designed to sit on one screen. `null` rather than `0` is\n * the difference that remains, and it carries meaning: it is the OFF switch\n * for server mode, where the pager's own `total` is a count and `0` means an\n * empty list.\n */\n readonly total = input<number | null>(null);\n\n /**\n * Window the `<tbody>` so a table of thousands of rows keeps only ~one\n * viewport of `<tr>`s in the DOM. Opt-in and OFF by default — a table\n * without it renders byte-identically to today.\n *\n * Engages ONLY on the flat, fixed-height tier: it silently falls back to the\n * full render whenever a variable-height layout is active — `groupBy`, tree\n * rows (`childrenKey`), a `[wrTableExpand]` template, `responsive` card mode,\n * or a visible pager (`pageSize > 0` / `total`). While on, it forces fixed layout for\n * stable column widths and assumes a uniform row height (see `rowHeight`).\n *\n * Intended as static config. Give columns an explicit `width` so the frozen\n * layout is exact (a virtualized table always renders fixed-layout); toggling\n * it off at runtime leaves the frozen widths in place as column minimums.\n * @default false\n */\n readonly virtualScroll = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Uniform body-row height in px used to map scroll offset to row index. `0`\n * (default) measures the first rendered row once — matching the density at\n * that point — and reuses it; pass an explicit value to remove the\n * post-hydration measure and make SSR pixel-exact (recommended if the density\n * can change at runtime). Read only when `virtualScroll` is on. Keep\n * virtualized cells single-line and no taller than this — a taller custom\n * `[wrTableCell]` template drifts the window. @default 0\n */\n readonly rowHeight = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Gives the table its own vertical scroll area, with the header row stuck to\n * its top and the summary footer to its bottom, in every mode: plain, paged,\n * grouped, tree, with pinned columns or selection. The pager stays below the\n * scroll area. `viewportHeight` sizes it. A virtualized table already\n * scrolls this way, so the input adds nothing there.\n * @default false\n */\n readonly stickyHeader = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Height of the scroll area when `virtualScroll` or `stickyHeader` is on — a\n * number (px), any CSS length (`'70vh'`) or `'fill'`. A length is applied as\n * `max-height` on `.wr-table__scroll` through `--wr-table-scroll-height` (a\n * short table shrinks to fit; a long one caps and scrolls). `'fill'` takes\n * the height the parent has left instead: the parent must be a flex column\n * with a definite height (every flex ancestor up the chain needs\n * `min-height: 0`), or a block with a definite height. The table then never\n * shrinks below `--wr-table-scroll-min-height`. A numeric px value lets the\n * server prerender the exact first window of a virtualized table.\n * @default 480\n */\n readonly viewportHeight = input<number | string>(480);\n\n /** Extra rows kept rendered above and below the viewport as scroll headroom. @default 6 */\n readonly overscan = input(6, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 6)) });\n\n /** Total row count derived for the pager (server-mode wins). */\n protected readonly resolvedTotal = computed<number>(() => {\n const server = this.total();\n if (server !== null) return server;\n return this.rows()?.length ?? 0;\n });\n\n /** Items visible on the current page (client mode slices; server mode passes through). */\n protected readonly visibleItems = computed<readonly Record<string, unknown>[] | null | undefined>(() => {\n const items = this.rows();\n if (!items) return items;\n const size = this.currentPageSize();\n if (size <= 0 || this.total() !== null) return items;\n // Clamped at BOTH ends, because `page` is a model the host owns (a `model()`\n // takes no transform) and the data can shrink under it — a filter or a delete\n // used to leave the table showing an empty slice with no way back except\n // paging by hand. The pager clamps its own number downwards only, and it is\n // not even rendered once the data drops below one page. Below 1 the offset\n // goes negative, and `Array.slice` reads a negative start from the END: page\n // 0 emptied the table and page -1 rendered a window counted from the back,\n // with the pager highlighting nothing. `|| 1` folds `0` and `NaN` in.\n const lastPage = Math.max(1, Math.ceil(items.length / size));\n const page = Math.min(Math.max(1, this.page() || 1), lastPage);\n const start = (page - 1) * size;\n return items.slice(start, start + size);\n });\n\n /** Show the pager footer only when paging is enabled and rows overflow. */\n protected readonly showPager = computed<boolean>(() => {\n const size = this.currentPageSize();\n if (size <= 0) return false;\n // With a size menu the pager stays while any size on offer would page the\n // rows, so a reader who picked the largest one can still pick a smaller one.\n const options = this.pageSizeOptions();\n return this.resolvedTotal() > (options.length > 0 ? Math.min(size, ...options) : size);\n });\n\n protected onPageSizeChange(size: number): void {\n const previous = this.currentPageSize();\n if (size === previous) return;\n const firstRow = (Math.max(1, this.page() || 1) - 1) * previous;\n this.currentPageSize.set(size);\n this.page.set(Math.floor(firstRow / size) + 1);\n this.pageSizeChange.emit(size);\n }\n\n /**\n * Typed at the context's own default: the directive's `T` is whatever each\n * template declared, and the table hands every one the same record.\n */\n private readonly cellTemplates = contentChildren<WrTableCell<Record<string, unknown>>>(WrTableCell);\n\n /** Map of column key → custom template (if provided via `[wrTableCell]`). */\n protected readonly cellMap = computed(() => {\n const map = new Map<string, TemplateRef<WrTableCellContext>>();\n for (const cell of this.cellTemplates()) map.set(cell.columnKey(), cell.template);\n return map;\n });\n\n // --- Column pinning -------------------------------------------------------\n\n private readonly platformId = inject(PLATFORM_ID);\n private readonly headerCells = viewChildren<ElementRef<HTMLElement>>('thCell');\n\n /**\n * Ambient reading direction, for the two header gestures that travel the\n * inline axis: the resize drag and the CDK's drop-slot index.\n *\n * Optional so a bare `TestBed` — or a consumer who never set a direction —\n * needs no provider; `Directionality` is root-provided anyway, and a missing\n * one reads as `ltr`. Read per gesture rather than cached, so a runtime `dir`\n * flip needs no subscription to `change`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n\n /**\n * Columns in render order — declaration order, overridden by `columnOrder`\n * once reordered; new keys append, removed keys drop out. Pin and resize\n * measurement key off this, so it must equal the rendered order.\n */\n protected readonly displayColumns = computed<readonly { key: string; column: WrTableColumn<T> }[]>(() => {\n const cols = this.columns();\n const seen = new Set<string>();\n const result: { key: string; column: WrTableColumn<T> }[] = [];\n for (const key of this.columnOrder()) {\n if (Object.hasOwn(cols, key) && !seen.has(key)) {\n result.push({ key, column: cols[key] });\n seen.add(key);\n }\n }\n for (const key of Object.keys(cols)) {\n if (!seen.has(key)) {\n result.push({ key, column: cols[key] });\n seen.add(key);\n }\n }\n return result;\n });\n\n /**\n * Sticky offsets for pinned columns, measured from the header cells so any\n * number of columns can stack per side. Also names the inner-edge column on\n * each side (where the separating shadow sits). Empty until measured in the\n * browser; on the server the pins stay at offset 0, corrected on hydration.\n */\n private readonly pins = signal<{\n left: ReadonlyMap<string, number>;\n right: ReadonlyMap<string, number>;\n leftEdge: string | null;\n rightEdge: string | null;\n }>({ left: new Map(), right: new Map(), leftEdge: null, rightEdge: null });\n\n /**\n * Every template the content declares, registered or not. An unknown\n * `[wrTableCell]` on an `<ng-template>` compiles under `strictTemplates`: a\n * binding on a template is an input for whichever directive claims it, and\n * the compiler reports nothing when none does. The column then shows the raw\n * value and nothing says why, so the dev-mode check below looks for a\n * projected `<ng-template>` no table directive picked up.\n *\n * The query sees more than those. `@if` / `@for` / `@switch` blocks are\n * templates too, and it also reaches into every view made from a projected\n * template, so each rendered cell adds the blocks inside it.\n */\n private readonly projectedTemplates = contentChildren(TemplateRef);\n\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('table');\n // Native and delegated: a template listener would run change detection on\n // every `mouseover` inside the table, and one per cell is what this avoids.\n effect(onCleanup => {\n if (!this.hasTips() || !isPlatformBrowser(this.platformId)) return;\n const host = this.hostEl.nativeElement;\n const listener = (event: Event): void => this.onTipTarget(event);\n host.addEventListener('mouseover', listener);\n host.addEventListener('focusin', listener);\n onCleanup(() => {\n host.removeEventListener('mouseover', listener);\n host.removeEventListener('focusin', listener);\n });\n });\n // A cell removed under the pointer fires no `mouseleave` to close its tooltip.\n effect(() => {\n const tip = this.tip();\n if (!tip) return;\n this.windowRows();\n this.displayColumns();\n afterNextRender(\n () => {\n if (!tip.el.isConnected && untracked(this.tip) === tip) this.tip.set(null);\n },\n { injector: this.injector }\n );\n });\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n afterNextRender(() => {\n const claimed = new Set<unknown>(\n [...this.cellTemplates(), this.expandTpl(), this.groupTpl()].map(\n (dir): unknown => dir?.template.elementRef.nativeElement\n )\n );\n // The content is never projected, so its anchors stay out of the DOM.\n // An anchor inside the host belongs to a view the table rendered.\n const host = this.hostEl.nativeElement;\n const declared = this.projectedTemplates().filter(\n tpl => isNgTemplateElement(tpl) && !host.contains(tpl.elementRef.nativeElement as Node)\n );\n const stray = declared.filter(tpl => !claimed.has(tpl.elementRef.nativeElement)).length;\n if (stray === 0) return;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-table>: ${stray} of ${declared.length} projected <ng-template>(s) registered with no table directive and will be ignored. ` +\n 'Import `WrTableCell` (or `WrTableExpand` / `WrTableGroupHeader`) beside `WrTable` in the component that declares the template.'\n );\n });\n }\n // A refused pair says so. Tree rows lose to `groupBy` and win over detail\n // rows and windowing, each a documented exclusion — and on screen each one\n // is only a mode that silently is not there.\n if (isDevMode()) {\n const warned = new Set<string>();\n effect(() => {\n if (this.childrenKey() === null) return;\n const refused = [\n this.groupBy() !== null ? '`groupBy` (grouping wins and the hierarchy is ignored)' : null,\n this.expandTpl() ? 'a `[wrTableExpand]` template (tree rows win and no detail row renders)' : null,\n this.virtualScroll() ? '`virtualScroll` (tree rows win and the body renders in full)' : null,\n ].filter((pair): pair is string => pair !== null);\n for (const pair of refused) {\n if (warned.has(pair)) continue;\n warned.add(pair);\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(`[NGWR] <wr-table>: \\`childrenKey\\` cannot be combined with ${pair}.`);\n }\n });\n let scopeWarned = false;\n effect(() => {\n if (scopeWarned || this.selectAllScope() !== 'all' || this.total() === null) return;\n scopeWarned = true;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n '[NGWR] <wr-table>: `selectAllScope=\"all\"` cannot be combined with `total` (the table holds one page in server mode, so the select-all covers that page).'\n );\n });\n }\n\n // Re-measure whenever the columns or their rendered widths change. Tables\n // with no pinned column skip the observer entirely.\n effect(onCleanup => {\n const cells = this.headerCells();\n const cols = this.displayColumns();\n if (!cols.some(c => c.column.pin)) {\n this.pins.set({ left: new Map(), right: new Map(), leftEdge: null, rightEdge: null });\n return;\n }\n if (!isPlatformBrowser(this.platformId) || typeof ResizeObserver === 'undefined') {\n this.measurePins(cols, cells);\n return;\n }\n const observer = new ResizeObserver(() => this.measurePins(cols, cells));\n for (const cell of cells) observer.observe(cell.nativeElement);\n this.measurePins(cols, cells);\n onCleanup(() => observer.disconnect());\n });\n\n // Reset resize state when the column KEY SET changes (added/removed/renamed)\n // so a stale frozen width can't collapse a new column under the latched\n // fixed layout. Keyed on sorted keys, not object identity (which churns).\n // Also drops the virtual freeze so activation effect (A), registered after\n // this, re-establishes it from the fresh natural widths.\n effect(() => {\n const keys = Object.keys(this.columns()).sort().join('\\n');\n if (keys === this.lastColumnKeys) return;\n this.lastColumnKeys = keys;\n this.resizeWidths.set(new Map());\n this.fixedLayout.set(false);\n this.virtualFixed.set(false);\n });\n\n // (A) Virtual activation: freeze the natural column widths BEFORE fixed\n // layout applies (so there's no jump), then switch to fixed and measure the\n // row height. Tracks columns so a structural change re-freshes the widths —\n // registered AFTER the key-set reset above, so this freeze wins the tie.\n effect(() => {\n const active = this.virtualized();\n this.displayColumns(); // re-run on a structural column change\n // Both view queries are read TRACKED, and that is the whole point: a\n // constructor effect's first run happens before the view's first update\n // pass, so reading them inside `untracked` meant this ran once against an\n // empty DOM — no header cells to freeze, no row to measure — and never\n // again on a statically-configured table. The row height then silently\n // stayed on the 40px fallback and the column widths were never captured.\n const cells = this.headerCells();\n const scroll = this.scrollEl();\n if (!active) {\n this.virtualFixed.set(false);\n return;\n }\n if (!isPlatformBrowser(this.platformId)) return;\n if (cells.length === 0 || !scroll) return; // the view is not up yet; this re-runs when it is\n untracked(() => {\n this.freezeColumnWidths(); // captured while still auto-layout = natural widths\n this.virtualFixed.set(true); // now fixed, with those exact widths (no jump)\n if (this.rowHeight() === 0) {\n const row = scroll.nativeElement.querySelector<HTMLElement>('.wr-table__tr');\n const h = row?.offsetHeight ?? 0;\n if (h > 0) this.measuredRowPx.set(h);\n }\n });\n });\n\n // (B) Scroll + viewport observer — attached ONLY when virtual + browser, so\n // a non-virtual table gets no scroll listener / no per-scroll change detection.\n effect(onCleanup => {\n const el = this.scrollEl()?.nativeElement;\n if (!el || !this.virtualized() || !isPlatformBrowser(this.platformId)) return;\n let raf = 0;\n const onScroll = (): void => {\n if (raf) return;\n raf = requestAnimationFrame(() => {\n raf = 0;\n this.scrollTop.set(el.scrollTop);\n });\n };\n el.addEventListener('scroll', onScroll, { passive: true });\n this.viewportPx.set(el.clientHeight);\n const ro =\n typeof ResizeObserver !== 'undefined' ? new ResizeObserver(() => this.viewportPx.set(el.clientHeight)) : null;\n ro?.observe(el);\n onCleanup(() => {\n el.removeEventListener('scroll', onScroll);\n if (raf) cancelAnimationFrame(raf);\n ro?.disconnect();\n });\n });\n\n // (C) The sticky header and footer cover the edges of the scroll area, so\n // their heights become its scroll padding.\n effect(onCleanup => {\n const head = this.headEl()?.nativeElement;\n const foot = this.footEl()?.nativeElement;\n const setEdges = (next: { head: number | null; foot: number | null }): void => {\n const prev = untracked(this.stickyEdges);\n if (prev.head !== next.head || prev.foot !== next.foot) this.stickyEdges.set(next);\n };\n if (!head || !this.scrollable() || !isPlatformBrowser(this.platformId) || typeof ResizeObserver === 'undefined') {\n setEdges({ head: null, foot: null });\n return;\n }\n // A header hidden by card mode measures 0, which is no height to pad by.\n const px = (el: HTMLElement | undefined): number | null => (el && el.offsetHeight > 0 ? el.offsetHeight : null);\n const measure = (): void => setEdges({ head: px(head), foot: px(foot) });\n const observer = new ResizeObserver(measure);\n observer.observe(head);\n if (foot) observer.observe(foot);\n measure();\n onCleanup(() => observer.disconnect());\n });\n\n // (D) A pinned edge casts its shadow only over content hidden behind it, so\n // the scroll area reports which inline sides it overflows on.\n effect(onCleanup => {\n const el = this.scrollEl()?.nativeElement;\n const table = el?.firstElementChild;\n if (\n !el ||\n !table ||\n !this.hasPins() ||\n !isPlatformBrowser(this.platformId) ||\n typeof ResizeObserver === 'undefined'\n ) {\n this.setOverflow(false, false);\n return;\n }\n let raf = 0;\n const measure = (): void => {\n // `scrollLeft` runs from 0 down to a negative end under RTL, so its\n // magnitude is the distance from the start in either direction. One\n // pixel of slack absorbs the rounding of fractional column widths.\n const offset = Math.abs(el.scrollLeft);\n this.setOverflow(offset > 1, el.scrollWidth - el.clientWidth - offset > 1);\n };\n const onScroll = (): void => {\n if (raf) return;\n raf = requestAnimationFrame(() => {\n raf = 0;\n measure();\n });\n };\n const observer = new ResizeObserver(measure);\n observer.observe(el);\n observer.observe(table);\n el.addEventListener('scroll', onScroll, { passive: true });\n measure();\n onCleanup(() => {\n observer.disconnect();\n el.removeEventListener('scroll', onScroll);\n if (raf) cancelAnimationFrame(raf);\n });\n });\n }\n\n private setOverflow(start: boolean, end: boolean): void {\n const prev = untracked(this.overflow);\n if (prev.start !== start || prev.end !== end) this.overflow.set({ start, end });\n }\n\n private measurePins(\n cols: readonly { key: string; column: WrTableColumn<T> }[],\n cells: readonly ElementRef<HTMLElement>[]\n ): void {\n const left = new Map<string, number>();\n const right = new Map<string, number>();\n let leftEdge: string | null = null;\n let rightEdge: string | null = null;\n\n let acc = 0;\n for (let i = 0; i < cols.length; i++) {\n if (cols[i].column.pin === 'left') {\n left.set(cols[i].key, acc);\n acc += cells[i]?.nativeElement.offsetWidth ?? 0;\n leftEdge = cols[i].key;\n }\n }\n acc = 0;\n for (let i = cols.length - 1; i >= 0; i--) {\n if (cols[i].column.pin === 'right') {\n right.set(cols[i].key, acc);\n acc += cells[i]?.nativeElement.offsetWidth ?? 0;\n rightEdge = cols[i].key;\n }\n }\n this.pins.set({ left, right, leftEdge, rightEdge });\n }\n\n /**\n * Sticky `inset-inline-start` offset (px) for a `pin: 'left'` column, else `null`.\n *\n * The input keeps its physical name — it is public API — but the offset it\n * produces is LOGICAL. `measurePins()` accumulates in DOM order, which is\n * start-to-end semantics, and under `dir=\"rtl\"` the column order mirrors: a\n * `pin: 'left'` column then sits at the physical right, where a `left: 0`\n * sticky inset can never catch it and the column just scrolls away.\n */\n protected leftPin(key: string): number | null {\n return this.pins().left.get(key) ?? null;\n }\n\n /** Sticky `inset-inline-end` offset (px) for a `pin: 'right'` column, else `null`. See {@link leftPin}. */\n protected rightPin(key: string): number | null {\n return this.pins().right.get(key) ?? null;\n }\n\n private readonly hasPins = computed<boolean>(() => this.displayColumns().some(c => c.column.pin));\n\n /**\n * Whether columns are hidden past the start and the end of the scroll area,\n * the host's `wr-table--overflow-start` / `--overflow-end`. Only a table with\n * a pinned column measures it.\n */\n protected readonly overflow = signal<{ start: boolean; end: boolean }>({ start: false, end: false });\n\n /** Whether `key` is the inner-edge pinned column on `side` (carries the shadow). */\n protected isPinEdge(key: string, side: 'left' | 'right'): boolean {\n return (side === 'left' ? this.pins().leftEdge : this.pins().rightEdge) === key;\n }\n\n /**\n * The BEM class and the consumer's own, merged into one string.\n *\n * One binding rather than a static `class` beside a `[class]` — Angular does\n * merge the two, but `no-duplicate-attributes` refuses the shape, and a reader\n * should not have to know the merge rules to know what a cell ends up with.\n * Each returns the shared constant untouched when the column sets neither\n * `align` nor `class`, so a table without these hooks allocates nothing per\n * cell.\n */\n protected thClasses(column: WrTableColumn<T>): string {\n return cellClasses('wr-table__th', column);\n }\n\n /** Body-cell half of {@link thClasses}, with the `truncate` modifier. */\n protected tdClasses(column: WrTableColumn<T>): string {\n const own = cellClasses('wr-table__td', column);\n return this.truncates(column) ? `${own} wr-table__td--truncate` : own;\n }\n\n // --- Header hints and truncated cells --------------------------------------\n\n /**\n * `'tooltip'` cuts every body cell to one line with an ellipsis and shows a\n * cut cell's full text in a tooltip on hover and focus; a cell that fits\n * shows none. A column's own `truncate` wins, and `null` there turns it off\n * for that column. A cell is cut only where its column cannot grow: give the\n * column a `width`, or the table a fixed layout (a resized or virtualized\n * one has it).\n * @default null\n */\n readonly truncate = input<WrTableTruncate | null>(null);\n\n /** Whether a column's cells are cut to one line. */\n protected truncates(column: WrTableColumn<T>): boolean {\n return (column.truncate === undefined ? this.truncate() : column.truncate) === 'tooltip';\n }\n\n /**\n * A column's name for its controls: the title, the hint after it, or the hint\n * alone under an empty title.\n */\n protected headerName(column: WrTableColumn<T>): string {\n const { title, headerHint } = column;\n if (!headerHint) return title;\n return title ? `${title}, ${headerHint}` : headerHint;\n }\n\n /** Whether any column has something a tooltip could show. */\n private readonly hasTips = computed<boolean>(\n () =>\n this.truncate() === 'tooltip' ||\n this.displayColumns().some(c => !!c.column.headerHint || c.column.truncate === 'tooltip')\n );\n\n /**\n * The element the table's one tooltip is for, and its text. One `WrPopover`\n * for the whole table, created on the first hint or cut cell the pointer or\n * the focus reaches: a table of thousands of cells holds none before that.\n */\n protected readonly tip = signal<{ readonly el: HTMLElement; readonly text: string } | null>(null);\n\n private readonly modality = inject(InputModalityDetector);\n\n private onTipTarget(event: Event): void {\n // A focus the keyboard did not move (a click, a script handing it back)\n // shows no tooltip, as on any `wrPopover` tooltip.\n if (event.type === 'focusin' && this.modality.mostRecentModality !== 'keyboard') return;\n const host = this.hostEl.nativeElement;\n const cell = (event.target as Element).closest<HTMLElement>('.wr-table__th, .wr-table__td--truncate');\n // A table nested in a cell answers for its own cells.\n if (cell?.closest('.wr-table') !== host) return;\n let text = '';\n if (cell.classList.contains('wr-table__th')) {\n const index = this.headerCells().findIndex(th => th.nativeElement === cell);\n text = this.displayColumns()[index]?.column.headerHint ?? '';\n } else if (cell.scrollWidth > cell.clientWidth) {\n text = cell.textContent.trim();\n }\n const current = this.tip();\n if (!text) {\n if (current?.el === cell) this.tip.set(null);\n } else if (current?.el !== cell || current.text !== text) {\n this.tip.set({ el: cell, text });\n }\n }\n\n /**\n * Summary and group-footer half of {@link thClasses}: `align` only, on the\n * body cell's modifier, the way those cells already wear `__td--pin-*`.\n * `column.class` stays off them, as its docs say.\n */\n protected footClasses(column: WrTableColumn<T>): string {\n return column.align ? `wr-table__foot-cell wr-table__td--align-${column.align}` : 'wr-table__foot-cell';\n }\n\n /** Row half of {@link thClasses}, resolved through the `rowClass` predicate. */\n protected rowClasses(row: Record<string, unknown>, index: number): string {\n const extra = this.rowClass()?.(row, index);\n return extra ? wrToClassList('wr-table__tr', extra).join(' ') : 'wr-table__tr';\n }\n\n // --- Column resizing ------------------------------------------------------\n\n private readonly resizeWidths = signal<ReadonlyMap<string, number>>(new Map());\n private resizeKey: string | null = null;\n private resizeStartX = 0;\n private resizeStartWidth = 0;\n private lastColumnKeys = '';\n\n /**\n * Once a column has been dragged, the table switches to fixed layout so the\n * `<col>` widths are honoured exactly (auto layout treats them as minimums).\n */\n protected readonly fixedLayout = signal(false);\n\n /** Current width (px) for a column, or `null` for auto — a live resize wins. */\n protected colWidth(key: string): number | null {\n return this.resizeWidths().get(key) ?? this.columns()[key]?.width ?? null;\n }\n\n /** Freeze every column at its current rendered header width (skips frozen keys). */\n private freezeColumnWidths(): void {\n const cols = this.displayColumns();\n const cells = this.headerCells();\n const frozen = new Map(this.resizeWidths());\n for (let i = 0; i < cols.length; i++) {\n if (!frozen.has(cols[i].key)) {\n const width = cells[i]?.nativeElement.offsetWidth;\n if (width) frozen.set(cols[i].key, width);\n }\n }\n this.resizeWidths.set(frozen);\n }\n\n protected onResizeStart(event: PointerEvent, key: string, th: HTMLElement): void {\n event.preventDefault();\n event.stopPropagation();\n // Freeze every column at its current rendered width, then switch to fixed\n // layout — the drag then resizes precisely (both directions) without the\n // content-sized columns jumping.\n if (!this.fixedLayout()) {\n this.freezeColumnWidths();\n this.fixedLayout.set(true);\n }\n this.resizeKey = key;\n this.resizeStartX = event.clientX;\n this.resizeStartWidth = th.offsetWidth;\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n /**\n * Pointer travel along the INLINE axis since the drag started, in px.\n *\n * The grip sits on each column's inline-END edge, so a column grows as the\n * pointer moves away from that column's start: rightward in LTR, leftward in\n * RTL. Signed here once rather than sprinkled through the width maths — and\n * this sign is the pair of `inset-inline-end` on `.wr-table__resize-handle`,\n * so the two must move together.\n */\n private resizeDelta(clientX: number): number {\n return this.isRtl() ? this.resizeStartX - clientX : clientX - this.resizeStartX;\n }\n\n protected onResizeMove(event: PointerEvent): void {\n if (this.resizeKey === null) return;\n const width = Math.max(48, this.resizeStartWidth + this.resizeDelta(event.clientX));\n this.resizeWidths.set(new Map(this.resizeWidths()).set(this.resizeKey, width));\n }\n\n protected onResizeEnd(event: PointerEvent): void {\n if (this.resizeKey === null) return;\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture?.(event.pointerId)) target.releasePointerCapture(event.pointerId);\n this.resizeKey = null;\n }\n\n // --- Virtual scroll -------------------------------------------------------\n\n /** md-density fallback row height (px), used before measuring / on the server. */\n private static readonly FALLBACK_ROW_PX = 40;\n private static readonly FALLBACK_VIEWPORT_PX = 480;\n\n /** The `.wr-table__scroll` div (always in the template; only read when virtual). */\n private readonly scrollEl = viewChild<ElementRef<HTMLElement>>('scroll');\n private readonly headEl = viewChild<ElementRef<HTMLElement>>('head');\n private readonly footEl = viewChild<ElementRef<HTMLElement>>('foot');\n /** Live vertical scroll offset (px); 0 on the server / before first scroll. */\n private readonly scrollTop = signal(0);\n /** Measured viewport clientHeight (px); 0 until the browser observer fires. */\n private readonly viewportPx = signal(0);\n /** Measured first-row height (px) when `rowHeight` is auto; 0 until measured. */\n private readonly measuredRowPx = signal(0);\n /** Fixed layout forced ON by virtualization (distinct from the resize latch). */\n private readonly virtualFixed = signal(false);\n\n /** `virtualScroll` requested AND the data shape is safe to window. SSR-deterministic. */\n protected readonly virtualized = computed<boolean>(\n () =>\n this.virtualScroll() &&\n this.groupBy() === null && // group bands / subtotals are variable height\n !this.treeMode() && // expanding re-anchors the window; needs scroll anchoring first\n !this.expandable() && // an injected detail <tr> desyncs uniform offsets\n !this.responsive() && // card mode has no uniform row height\n this.currentPageSize() === 0 && // a visible pager owns chunking — the pager wins\n this.total() === null &&\n !!this.visibleItems()\n );\n\n /** Effective uniform row height (px). */\n protected readonly effRowH = computed<number>(() =>\n this.rowHeight() > 0 ? this.rowHeight() : this.measuredRowPx() || WrTable.FALLBACK_ROW_PX\n );\n\n /** Deterministic viewport px for SSR + first paint (numeric height, else fallback). */\n private readonly fallbackViewportPx = computed<number>(() => {\n const h = this.viewportHeight();\n return typeof h === 'number' ? h : WrTable.FALLBACK_VIEWPORT_PX;\n });\n\n /** The table scrolls vertically inside `.wr-table__scroll`, under a sticky header. */\n protected readonly scrollable = computed<boolean>(() => this.virtualized() || this.stickyHeader());\n\n protected readonly fillsParent = computed<boolean>(() => this.scrollable() && this.viewportHeight() === 'fill');\n\n /** `viewportHeight` as the value of `--wr-table-scroll-height`; `null` leaves the hook to the stylesheet. */\n protected readonly scrollHeight = computed<string | null>(() => {\n if (!this.scrollable() || this.fillsParent()) return null;\n const h = this.viewportHeight();\n return typeof h === 'number' ? `${h}px` : h;\n });\n\n /** Measured heights (px) of the sticky header and footer, which `scroll-padding` keeps clear; `null` until measured. */\n protected readonly stickyEdges = signal<{ head: number | null; foot: number | null }>({ head: null, foot: null });\n\n /** Rendered window [start,end) + spacer pads (px). Pure math, O(1) per scroll frame. */\n protected readonly virtualWindow = computed<{ start: number; end: number; padTop: number; padBottom: number }>(() => {\n const total = this.renderRows().length;\n if (!this.virtualized() || total === 0) return { start: 0, end: total, padTop: 0, padBottom: 0 };\n const h = this.effRowH();\n const vp = this.viewportPx() || this.fallbackViewportPx();\n const over = this.overscan();\n // Clamp `first` to the last row: the window is a pure function of a pixel\n // offset, so if the row list shrinks while the user is scrolled deep — a\n // consumer filtering `items`, or a future hierarchy collapsing — `start`\n // overshoots `end` and `slice` returns nothing, leaving a blank body under a\n // spacer the old length's worth of pixels tall.\n const first = Math.min(Math.floor(this.scrollTop() / h), total - 1);\n // `+ 1` covers the partial row at the viewport's bottom edge: at overscan 0\n // with the scroll resting mid-row, `ceil(vp / h)` alone stops one row short.\n const count = Math.ceil(vp / h) + 1;\n const start = Math.max(0, first - over);\n const end = Math.min(total, first + count + over);\n return { start, end, padTop: start * h, padBottom: (total - end) * h };\n });\n\n /** Flat index of the first rendered window row (for `aria-rowindex`). */\n protected readonly windowStart = computed<number>(() => this.virtualWindow().start);\n\n /** Rows placed in `<tbody>`. SAME array instance as `renderRows()` when off → byte-identical DOM. */\n protected readonly windowRows = computed<readonly RenderRow[]>(() => {\n if (!this.virtualized()) return this.renderRows();\n const { start, end } = this.virtualWindow();\n return this.renderRows().slice(start, end);\n });\n\n /** Fixed layout is on when a resize drag latched it OR virtualization forces it. */\n protected readonly fixedLayoutActive = computed<boolean>(() => this.fixedLayout() || this.virtualFixed());\n\n /** Scroll a flat row index to the top of the virtual viewport. No-op on the server / when not virtual. */\n scrollToRow(index: number, behavior: ScrollBehavior = 'auto'): void {\n if (!isPlatformBrowser(this.platformId) || !this.virtualized()) return;\n this.scrollEl()?.nativeElement.scrollTo({ top: Math.max(0, index) * this.effRowH(), behavior });\n }\n\n protected onColumnDrop(event: CdkDragDrop<unknown>): void {\n if (event.previousIndex === event.currentIndex) return;\n const order = this.displayColumns().map(c => c.key);\n moveItemInArray(order, event.previousIndex, event.currentIndex);\n this.columnOrder.set(order);\n }\n\n /**\n * Keep pinned columns anchored — a drop can't land on a pinned column's slot,\n * so a scrollable column can't be dragged into the frozen region at either edge.\n *\n * The index the CDK hands over is a slot in the pointer sweep it does along\n * the header, and that sweep is always left-to-right (`SingleAxisSortStrategy`\n * caches item rects sorted by `clientRect.left`). `displayColumns()` is DOM\n * order, which under `dir=\"rtl\"` runs the other way — so without the mirror\n * the guard is asked about the column at the opposite end of the header, and\n * a drop lands on the pinned one it was meant to protect.\n *\n * The drop event itself needs no such mapping: `previousIndex` /\n * `currentIndex` come from `getItemIndex`, which the CDK already un-mirrors\n * back to DOM order.\n */\n protected readonly sortPredicate = (index: number): boolean => {\n const cols = this.displayColumns();\n const slot = this.isRtl() ? cols.length - 1 - index : index;\n return !cols[slot]?.column.pin;\n };\n\n // --- Row selection --------------------------------------------------------\n\n private rowKeyOf(row: Record<string, unknown>): unknown {\n const rk = this.rowKey();\n if (typeof rk === 'function') return rk(row);\n if (typeof rk === 'string') return row[rk];\n return row;\n }\n\n /** Keys of the rows on the current page — the select-all scope. */\n /**\n * Scope of the header select-all: the rows currently ON SCREEN. In tree mode\n * that is every VISIBLE node — a collapsed subtree is not on screen and is not\n * swept in, which keeps the checkbox honest about what it just did.\n */\n protected readonly pageRowKeys = computed<readonly unknown[]>(() =>\n // `renderRows()` in EVERY mode, not only tree: it is the list that reaches the\n // screen. Reading `visibleItems()` outside tree mode swept in the rows of a\n // COLLAPSED group — invisible rows, silently selected, which is exactly what\n // the paragraph above promises does not happen.\n this.renderRows()\n .filter((entry): entry is Extract<RenderRow, { kind: 'row' }> => entry.kind === 'row')\n .map(entry => this.rowKeyOf(entry.row))\n );\n\n /**\n * The header select-all's keys: {@link pageRowKeys}, or under\n * `selectAllScope=\"all\"` the keys every page would put on screen.\n */\n protected readonly selectAllKeys = computed<ReadonlySet<unknown>>(() => {\n const rows = this.rows();\n if (this.selectAllScope() !== 'all' || this.total() !== null || !rows) return new Set(this.pageRowKeys());\n if (this.treeMode()) {\n return new Set(\n this.flattenForest(rows).flatMap(entry => (entry.kind === 'row' ? [this.rowKeyOf(entry.row)] : []))\n );\n }\n const by = this.groupBy();\n if (by === null) return new Set(rows.map(row => this.rowKeyOf(row)));\n const collapsed = new Set(this.collapsedGroups());\n return new Set(\n rows.filter(row => !collapsed.has(typeof by === 'function' ? by(row) : row[by])).map(row => this.rowKeyOf(row))\n );\n });\n\n protected isRowSelected(row: Record<string, unknown>): boolean {\n return this.selectionSet().has(this.rowKeyOf(row));\n }\n\n /** Every row in the select-all scope selected (drives the header checkbox). */\n protected readonly allSelected = computed<boolean>(() => {\n const keys = this.selectAllKeys();\n if (keys.size === 0) return false;\n const sel = this.selectionSet();\n for (const key of keys) if (!sel.has(key)) return false;\n return true;\n });\n\n /** Some but not all selected (drives the header indeterminate). */\n protected readonly someSelected = computed<boolean>(() => {\n if (this.allSelected()) return false;\n const sel = this.selectionSet();\n for (const key of this.selectAllKeys()) if (sel.has(key)) return true;\n return false;\n });\n\n protected toggleRow(row: Record<string, unknown>, checked: boolean): void {\n const key = this.rowKeyOf(row);\n if (this.rowSelection() === 'single') {\n this.selection.set(checked ? [key] : []);\n return;\n }\n const sel = this.selection();\n this.selection.set(checked ? [...sel, key] : sel.filter(k => k !== key));\n }\n\n /** Add (or remove) a set of row keys from the selection in one update. */\n private applySelection(keys: Iterable<unknown>, checked: boolean): void {\n const sel = this.selection();\n if (checked) {\n const merged = new Set(sel);\n for (const key of keys) merged.add(key);\n this.selection.set([...merged]);\n } else {\n const drop = new Set(keys);\n this.selection.set(sel.filter(k => !drop.has(k)));\n }\n }\n\n protected toggleAll(checked: boolean): void {\n this.applySelection(this.selectAllKeys(), checked);\n }\n\n // --- Row expansion --------------------------------------------------------\n\n private readonly expandTpl = contentChild(WrTableExpand);\n\n /** Whether the expand column shows (a `[wrTableExpand]` template was projected). */\n /**\n * Tree mode is on when `childrenKey` is set AND grouping is not. Grouping wins\n * deliberately: `groupBy` buckets a flat list and a forest has none, so rather\n * than half-support the pair the hierarchy is ignored while a group is set.\n */\n protected readonly treeMode = computed<boolean>(() => this.childrenKey() !== null && this.groupBy() === null);\n\n /** Detail rows and tree rows both own the row's disclosure — tree mode wins. */\n protected readonly expandable = computed<boolean>(() => !this.treeMode() && !!this.expandTpl());\n\n /** The column that carries the indent + toggle — named, else whichever renders first. */\n protected readonly treeColumnKey = computed<string | null>(() =>\n this.treeMode() ? (this.treeColumn() ?? this.displayColumns()[0]?.key ?? null) : null\n );\n\n /** This row's children, whatever shape `childrenKey` names. */\n private childrenOf(row: Record<string, unknown>): readonly Record<string, unknown>[] {\n const ck = this.childrenKey();\n if (ck === null) return [];\n const raw = typeof ck === 'function' ? ck(row) : row[ck];\n return Array.isArray(raw) ? (raw as readonly Record<string, unknown>[]) : [];\n }\n\n /**\n * Depth-first flatten of the forest, descending only into open parents.\n * `seen` is path-scoped rather than global: the same row legitimately appearing\n * under two parents is fine, a row appearing under itself is a cycle and would\n * otherwise hang the walk.\n */\n private flattenForest(roots: readonly Record<string, unknown>[]): readonly RenderRow[] {\n const open = this.expandedSet();\n const out: RenderRow[] = [];\n\n const walk = (\n rows: readonly Record<string, unknown>[],\n depth: number,\n prefix: string,\n seen: ReadonlySet<unknown>\n ): void => {\n rows.forEach((row, i) => {\n const key = this.rowKeyOf(row);\n if (seen.has(key)) return;\n const children = this.childrenOf(row);\n const parent = children.length > 0;\n const isOpen = parent && open.has(key);\n out.push({\n kind: 'row',\n id: `${prefix}r${i}`,\n row,\n depth,\n parent,\n open: parent ? isOpen : null,\n posinset: i + 1,\n setsize: rows.length,\n });\n if (isOpen) walk(children, depth + 1, `${prefix}r${i}-`, new Set(seen).add(key));\n });\n };\n\n walk(roots, 0, '', new Set());\n return out;\n }\n\n /** Every node in the forest, depth-first — what selection and CSV must see. */\n private allTreeRows(): readonly Record<string, unknown>[] {\n const out: Record<string, unknown>[] = [];\n const walk = (rows: readonly Record<string, unknown>[], seen: ReadonlySet<unknown>): void => {\n for (const row of rows) {\n const key = this.rowKeyOf(row);\n if (seen.has(key)) continue;\n out.push(row);\n const children = this.childrenOf(row);\n if (children.length > 0) walk(children, new Set(seen).add(key));\n }\n };\n walk(this.rows() ?? [], new Set());\n return out;\n }\n\n /** Open / close one parent row. */\n protected toggleTreeRow(row: Record<string, unknown>): void {\n const key = this.rowKeyOf(row);\n const open = this.expanded();\n this.expanded.set(open.includes(key) ? open.filter(k => k !== key) : [...open, key]);\n }\n\n /** Open every parent in the forest. */\n expandAllRows(): void {\n this.expanded.set(\n this.allTreeRows()\n .filter(row => this.childrenOf(row).length > 0)\n .map(row => this.rowKeyOf(row))\n );\n }\n\n /** Close every parent. */\n collapseAllRows(): void {\n this.expanded.set([]);\n }\n\n // --- Treegrid keyboard (row focus) -----------------------------------------\n //\n // The APG treegrid's row-focus model: the ROWS are the items. One row holds the\n // tab stop (roving `tabindex`), the arrows move between visible rows and open or\n // close branches, and the controls inside a row — its checkbox, its toggle, a\n // cell template's buttons — keep their own tab stops, so Tab walks from the row\n // into them. A `treegrid` promises this; announcing the role without it left a\n // keyboard user on a structure only the mouse could travel.\n //\n // A flat table has none of it on purpose: it announces the native `table` role,\n // which promises no keyboard model of its own.\n\n /** Every body `<tr>` holding data, in DOM order — 1:1 with {@link treeRows} in tree mode. */\n private readonly rowEls = viewChildren<ElementRef<HTMLTableRowElement>>('rowEl');\n\n /**\n * The row the keyboard last stood on, by `rowKey` — so the tab stop stays on\n * the same row through a sort or a refetch, where a position would not.\n * Wrapped, because a row's key may itself be `null` or `undefined`.\n */\n private readonly activeRow = signal<{ readonly key: unknown } | null>(null);\n\n /** The rendered tree rows, in the order the arrows travel. Empty outside tree mode. */\n private readonly treeRows = computed<readonly Extract<RenderRow, { kind: 'row' }>[]>(() =>\n this.treeMode()\n ? this.renderRows().filter((entry): entry is Extract<RenderRow, { kind: 'row' }> => entry.kind === 'row')\n : []\n );\n\n /**\n * Id of the row holding the tab stop: the active row while it is on screen,\n * else the first row. Collapsing a branch around the active row, or a refetch\n * that drops it, must not leave the grid with no tab stop at all — that is a\n * widget the keyboard can no longer enter.\n */\n protected readonly tabStopRowId = computed<string | null>(() => {\n const rows = this.treeRows();\n const active = this.activeRow();\n if (active) {\n const hit = rows.find(entry => this.rowKeyOf(entry.row) === active.key);\n if (hit) return hit.id;\n }\n return rows[0]?.id ?? null;\n });\n\n /**\n * Focus entering a row from anywhere — a click, Tab into one of its controls —\n * makes that row the tab stop, so Shift+Tab out of a row's checkbox lands on\n * its own row rather than skipping past it to the previous row's controls.\n */\n protected onTreeFocusin(event: FocusEvent): void {\n if (!this.treeMode()) return;\n const target = event.target as Node | null;\n const index = this.rowEls().findIndex(el => target !== null && el.nativeElement.contains(target));\n const entry = this.treeRows()[index];\n if (entry) this.activeRow.set({ key: this.rowKeyOf(entry.row) });\n }\n\n /**\n * The row-focus keys. Acts only when the ROW itself has focus: an arrow pressed\n * inside a cell's own control — a text field, a select — belongs to that\n * control, and stealing it would break the control.\n */\n protected onTreeKeydown(event: KeyboardEvent): void {\n if (!this.treeMode() || event.altKey || event.metaKey || event.shiftKey) return;\n const rows = this.treeRows();\n const els = this.rowEls();\n // The two lists disagree only between a branch opening or closing and the\n // render that draws it — a few milliseconds in which a position in one is not\n // the same row in the other. A key that lands there waits for the next one\n // rather than moving to the wrong row.\n if (els.length !== rows.length) return;\n const index = els.findIndex(el => el.nativeElement === event.target);\n const entry = rows[index];\n if (!entry) return;\n\n const key = this.inlineKey(event.key);\n // Ctrl is only meaningful with Home / End (the APG's \"first row\" chord);\n // with anything else it is someone else's shortcut.\n if (event.ctrlKey && key !== WR_KEYS.HOME && key !== WR_KEYS.END) return;\n\n switch (key) {\n case WR_KEYS.ARROW_DOWN:\n this.focusTreeRow(Math.min(index + 1, rows.length - 1));\n break;\n case WR_KEYS.ARROW_UP:\n this.focusTreeRow(Math.max(index - 1, 0));\n break;\n case WR_KEYS.HOME:\n this.focusTreeRow(0);\n break;\n case WR_KEYS.END:\n this.focusTreeRow(rows.length - 1);\n break;\n case WR_KEYS.ARROW_RIGHT:\n // Closed: open it, and stay. Open: step down into the first child, which\n // the depth-first flatten always puts on the very next row.\n if (!entry.parent) break;\n if (!entry.open) this.toggleTreeRow(entry.row);\n else if (rows[index + 1]?.depth === entry.depth + 1) this.focusTreeRow(index + 1);\n break;\n case WR_KEYS.ARROW_LEFT:\n // Open: close it, and stay. Closed or a leaf: climb to the parent, which\n // is the nearest row above that sits one level up.\n if (entry.open) {\n this.toggleTreeRow(entry.row);\n break;\n }\n for (let i = index - 1; i >= 0; i--) {\n if (rows[i].depth === entry.depth - 1) {\n this.focusTreeRow(i);\n break;\n }\n }\n break;\n case WR_KEYS.ENTER:\n case WR_KEYS.SPACE:\n // Selection is the row's own action when the table offers one. Without\n // it the keys do nothing, rather than guessing at a default.\n if (!this.rowSelection()) return;\n this.toggleRow(entry.row, !this.isRowSelected(entry.row));\n break;\n default:\n return;\n }\n event.preventDefault();\n }\n\n /**\n * The APG gives ArrowRight the job of opening a branch and ArrowLeft of closing\n * it, because the children indent rightward. Under `dir=\"rtl\"` they indent\n * leftward and the two swap, the way `wr-tree` swaps them.\n */\n private inlineKey(key: string): string {\n if (!this.isRtl()) return key;\n if (key === WR_KEYS.ARROW_RIGHT) return WR_KEYS.ARROW_LEFT;\n if (key === WR_KEYS.ARROW_LEFT) return WR_KEYS.ARROW_RIGHT;\n return key;\n }\n\n /**\n * Move the tab stop to a tree row, and focus it in the same keystroke.\n *\n * Synchronous on purpose, and safe to be: every row these keys pick — a\n * sibling, the first child of an OPEN row, the parent — is already rendered,\n * and a `tabindex=\"-1\"` row takes focus from script. The render that follows\n * only moves the `tabindex=\"0\"`. Deferring the focus to `afterNextRender`\n * cost one change-detection pass per key — about 25ms on the docs page in a\n * dev build — and a held arrow key outran it, each repeat acting on the row\n * focus had not yet left.\n */\n private focusTreeRow(index: number): void {\n const entry = this.treeRows()[index];\n if (!entry) return;\n this.activeRow.set({ key: this.rowKeyOf(entry.row) });\n this.rowEls()[index]?.nativeElement.focus();\n }\n\n /** Leading control columns — selection + expand. */\n protected readonly leadingCols = computed<number>(() => (this.rowSelection() ? 1 : 0) + (this.expandable() ? 1 : 0));\n\n /** Total rendered columns (data + leading), for detail-row / empty colspans. */\n protected readonly totalCols = computed<number>(() => this.displayColumns().length + this.leadingCols());\n\n protected expandTemplate(): TemplateRef<WrTableExpandContext> | undefined {\n return this.expandTpl()?.template;\n }\n\n private readonly expandedSet = computed(() => new Set(this.expanded()));\n\n protected isExpanded(row: Record<string, unknown>): boolean {\n return this.expandedSet().has(this.rowKeyOf(row));\n }\n\n protected toggleExpand(row: Record<string, unknown>): void {\n const key = this.rowKeyOf(row);\n const set = this.expanded();\n this.expanded.set(set.includes(key) ? set.filter(k => k !== key) : [...set, key]);\n }\n\n protected expandContext(row: Record<string, unknown>): WrTableExpandContext {\n return { $implicit: row, row };\n }\n\n // --- Summary row ----------------------------------------------------------\n\n /** Whether any column defines a `summary` (so the footer row shows). */\n protected readonly hasSummary = computed<boolean>(() =>\n Object.values(this.columns()).some(col => col.summary !== undefined)\n );\n\n /** Per-column footer values, computed over `items` (the current page in server mode). */\n private readonly summaries = computed<ReadonlyMap<string, unknown>>(() => {\n // Every node in tree mode, not just the roots — a headcount that ignored\n // children would be wrong in the obvious way.\n const rows = this.datasetRows();\n const map = new Map<string, unknown>();\n for (const [key, col] of Object.entries(this.columns())) {\n if (col.summary !== undefined) map.set(key, this.computeSummary(col.summary, rows, key, WR_TABLE_TOTAL_SCOPE));\n }\n return map;\n });\n\n protected summaryFor(key: string): unknown {\n return this.summaries().get(key) ?? '';\n }\n\n // --- Row grouping ---------------------------------------------------------\n\n private readonly groupTpl = contentChild(WrTableGroupHeader);\n\n protected groupTemplate(): TemplateRef<WrTableGroupContext> | undefined {\n return this.groupTpl()?.template;\n }\n\n /**\n * Rows on the current page bucketed by `groupBy`, in first-appearance order.\n * Depends only on `visibleItems()` + `groupBy` (not on collapse / summary), so\n * a collapse toggle never re-buckets. The ungrouped path returns one synthetic\n * bucket holding the same array instance `visibleItems()` returned.\n */\n private readonly groupBuckets = computed<readonly { value: unknown; rows: readonly Record<string, unknown>[] }[]>(\n () => {\n const rows = this.visibleItems() ?? [];\n const by = this.groupBy();\n if (by === null) return [{ value: WR_TABLE_UNGROUPED, rows }];\n const buckets = new Map<unknown, Record<string, unknown>[]>();\n for (const row of rows) {\n const value = typeof by === 'function' ? by(row) : row[by];\n const bucket = buckets.get(value);\n if (bucket) bucket.push(row);\n else buckets.set(value, [row]);\n }\n return Array.from(buckets, ([value, groupRows]) => ({ value, rows: groupRows }));\n }\n );\n\n /**\n * The flat `<tbody>` render list. Ungrouped it is exactly today's rows in\n * order (the rendered elements are unchanged; only the `@for` track identity\n * moves to a stable id). Returns `[]` for nullish rows, and reads nothing about\n * `loading()` — suppressing the \"no data\" row under the spinner is the\n * template's job, not this one's.\n */\n protected readonly renderRows = computed<readonly RenderRow[]>(() => {\n const rows = this.visibleItems();\n if (!rows) return [];\n const buckets = this.groupBuckets();\n\n if (this.groupBy() === null) {\n const roots = buckets[0].rows;\n if (this.treeMode()) return this.flattenForest(roots);\n return roots.map((row, i) => flatRow(row, `r${i}`, i + 1, roots.length));\n }\n\n const collapsed = new Set(this.collapsedGroups());\n const summaryCols =\n this.groupSummary() && this.hasSummary()\n ? Object.entries(this.columns()).filter(([, c]) => c.summary !== undefined)\n : [];\n\n const out: RenderRow[] = [];\n buckets.forEach((bucket, gi) => {\n const isCollapsed = collapsed.has(bucket.value);\n const label = this.groupLabelOf(bucket.value);\n const group: WrTableGroupContext = {\n $implicit: bucket.value,\n value: bucket.value,\n label,\n rows: bucket.rows,\n count: bucket.rows.length,\n collapsed: isCollapsed,\n index: gi,\n toggle: () => this.toggleGroupCollapse(bucket.value),\n };\n out.push({ kind: 'group', id: `g${gi}`, group });\n if (isCollapsed) return;\n bucket.rows.forEach((row, ri) => out.push(flatRow(row, `g${gi}r${ri}`, ri + 1, bucket.rows.length)));\n if (summaryCols.length) {\n const summaries = new Map<string, unknown>();\n const context: WrTableSummaryContext = { scope: 'group', group };\n for (const [key, col] of summaryCols) {\n summaries.set(key, this.computeSummary(col.summary!, bucket.rows, key, context));\n }\n out.push({ kind: 'group-foot', id: `g${gi}f`, summaries });\n }\n });\n return out;\n });\n\n /** Default band label — the primitive as text, `'—'` for empty, JSON for objects. */\n private groupLabelOf(value: unknown): string {\n if (value == null || value === '') return '—';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'bigint' || typeof value === 'boolean') return String(value);\n // Objects / symbols / functions aren't the documented contract (groupBy\n // should return a primitive, like rowKey); format gracefully anyway.\n try {\n return JSON.stringify(value) ?? '—';\n } catch {\n return '—';\n }\n }\n\n protected toggleGroupCollapse(value: unknown): void {\n const set = this.collapsedGroups();\n this.collapsedGroups.set(set.includes(value) ? set.filter(v => v !== value) : [...set, value]);\n }\n\n /** Collapse every group on the current page. No-op when `groupBy` is unset. */\n collapseAllGroups(): void {\n if (this.groupBy() === null) return;\n this.collapsedGroups.set(this.groupBuckets().map(b => b.value));\n }\n\n /** Expand every group. */\n expandAllGroups(): void {\n this.collapsedGroups.set([]);\n }\n\n // --- Group selection (memoized Set; reuses the row-selection primitive) ----\n\n /** Memoized selection as a Set — O(1) membership for row + group + select-all checks. */\n private readonly selectionSet = computed<ReadonlySet<unknown>>(() => new Set(this.selection()));\n\n protected groupChecked(rows: readonly Record<string, unknown>[]): boolean {\n if (rows.length === 0) return false;\n const sel = this.selectionSet();\n return rows.every(r => sel.has(this.rowKeyOf(r)));\n }\n\n protected groupIndeterminate(rows: readonly Record<string, unknown>[]): boolean {\n const sel = this.selectionSet();\n return rows.some(r => sel.has(this.rowKeyOf(r))) && !this.groupChecked(rows);\n }\n\n protected toggleGroupSelection(rows: readonly Record<string, unknown>[], checked: boolean): void {\n this.applySelection(\n rows.map(r => this.rowKeyOf(r)),\n checked\n );\n }\n\n // --- CSV export -----------------------------------------------------------\n\n /**\n * Build the table as an RFC-4180 CSV string — a header row from the column\n * titles, then one row per item in the current column order. A cell is what\n * the plain cell shows: the column's `empty` for a missing value, its\n * `format` over the value, else the raw value. A `[wrTableCell]` template is\n * not run, so a column drawn by one exports its `format` or its data.\n *\n * Covers the current `items`, so in server-side mode (`total` set) it\n * exports the current page, while client-side pagination exports every page.\n *\n * Returns the string; use `exportCsv()` when you want it downloaded as a file.\n *\n * @example\n * ```ts\n * const csv = this.table().toCsv({ delimiter: ';' });\n * ```\n */\n toCsv(options: WrTableCsvOptions = {}): string {\n const delimiter = options.delimiter ?? ',';\n const escapeFormulas = options.escapeFormulas ?? true;\n const cols = this.displayColumns();\n const rows = options.selectedOnly ? this.selectedRows() : this.datasetRows();\n const text = (value: unknown): string => {\n if (value == null) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint') return String(value);\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? '' : value.toISOString();\n try {\n return JSON.stringify(value) ?? '';\n } catch {\n // Circular structures and nested bigints throw — never fail the export over one cell.\n return '';\n }\n };\n // Spreadsheets evaluate a cell starting with these, so a string that can\n // hold row data is neutralized into text. A number or an `empty` placeholder\n // of `-` is left alone.\n const field = (s: string, data: boolean): string => {\n if (data && escapeFormulas && /^[=+\\-@\\t\\r]/.test(s)) s = `'${s}`;\n return s.includes(delimiter) || /[\"\\r\\n]/.test(s) ? `\"${s.replace(/\"/g, '\"\"')}\"` : s;\n };\n const lines = [cols.map(col => field(col.column.title, true)).join(delimiter)];\n for (const row of rows) {\n lines.push(\n cols\n .map(col => {\n const value = row[col.key];\n if (noValue(value)) return field(col.column.empty ?? '', false);\n const { format } = col.column;\n if (!format) return field(text(value), typeof value === 'string' && !CSV_FIGURE.test(value));\n // `format` can read anything on the row, whatever type the value is.\n const shown = format(value, row as T);\n return field(shown, !CSV_FIGURE.test(shown));\n })\n .join(delimiter)\n );\n }\n return lines.join('\\r\\n');\n }\n\n /** Download the table as a CSV file. No-op on the server. */\n exportCsv(options: WrTableCsvOptions = {}): void {\n if (!isPlatformBrowser(this.platformId)) return;\n // Lead with a BOM so Excel reads the file as UTF-8.\n const blob = new Blob([`\\uFEFF${this.toCsv(options)}`], { type: 'text/csv;charset=utf-8;' });\n wrDownloadBlob(blob, options.filename ?? 'table.csv');\n }\n\n /**\n * Every row of the dataset. Flat that is `items`; in tree mode it is the whole\n * forest depth-first, so selection, CSV and the grand summary count children\n * instead of silently reporting roots only.\n */\n private datasetRows(): readonly Record<string, unknown>[] {\n return this.treeMode() ? this.allTreeRows() : (this.rows() ?? []);\n }\n\n private selectedRows(): readonly Record<string, unknown>[] {\n const keys = new Set(this.selection());\n return this.datasetRows().filter(row => keys.has(this.rowKeyOf(row)));\n }\n\n private computeSummary(\n kind: WrTableSummary,\n rows: readonly Record<string, unknown>[],\n key: string,\n context: WrTableSummaryContext\n ): unknown {\n // The context is the only thing that tells a subtotal from the grand total:\n // with one group on screen both are handed the same rows.\n if (typeof kind === 'function') return kind(rows, context);\n // Drop empty/nullish cells first — `Number('')`/`Number(null)` are 0 and\n // would otherwise skew the aggregate.\n const values = rows.map(row => row[key]).filter(v => v != null && v !== '');\n if (kind === 'count') return values.length;\n // A column of decimal strings is summed as digits, never as doubles:\n // `'0.1' + '0.2'` is `'0.3'`. One string in the column is enough, so a\n // number mixed in is read exactly too; an all-number column keeps the\n // engine's arithmetic and its output.\n if (values.some(v => typeof v === 'string')) return decimalSummary(kind, values);\n const nums = values.map(Number).filter(Number.isFinite);\n if (nums.length === 0) return '';\n const sum = nums.reduce((a, b) => a + b, 0);\n switch (kind) {\n case 'sum':\n return sum;\n case 'avg':\n return Math.round((sum / nums.length) * 100) / 100;\n // Reduced rather than spread: a summary aggregates the WHOLE dataset (or a\n // whole group bucket), not the page, and `Math.min(...nums)` throws\n // `RangeError: Maximum call stack size exceeded` past ~125k arguments — out\n // of a `computed()` during change detection, which stops the table\n // rendering. `nums` is non-empty and finite by here, so a seedless reduce is\n // safe, and it agrees with `Math.min`/`Math.max` on everything a summary\n // renders (they differ only on the sign of a zero tie).\n case 'min':\n return nums.reduce((a, b) => (b < a ? b : a));\n case 'max':\n return nums.reduce((a, b) => (b > a ? b : a));\n default:\n return '';\n }\n }\n\n protected directionFor(key: string): WrTableSortDirection {\n return this.sort().find(s => s.key === key)?.direction ?? null;\n }\n\n /** The keys that actually sort, in application order — an entry with no direction does not. */\n private readonly activeSortKeys = computed<readonly string[]>(() =>\n this.sort()\n .filter(s => s.direction)\n .map(s => s.key)\n );\n\n /**\n * `aria-sort` for a column header, per the WAI-ARIA table pattern. Only a\n * sortable column gets the attribute at all: on a plain column it would claim\n * the header is sortable when it is not.\n *\n * Only the PRIMARY key announces a direction. ARIA asks for `aria-sort` on one\n * header at a time, and a screen reader that hears \"ascending\" on two columns\n * has no way to learn which one orders the rows — the secondary key only\n * breaks ties inside the first. So every other sortable column, a secondary\n * key included, says `none`, and its place in the order is drawn instead (see\n * {@link sortOrderFor}).\n */\n protected ariaSortFor(key: string, sortable: boolean | undefined): 'ascending' | 'descending' | 'none' | null {\n if (!sortable) return null;\n if (this.activeSortKeys()[0] !== key) return 'none';\n const dir = this.directionFor(key);\n return dir === 'asc' ? 'ascending' : dir === 'desc' ? 'descending' : 'none';\n }\n\n /**\n * A sorted column's 1-based place in a MULTI-column sort, drawn beside its\n * indicator — `null` while one column or none sorts, where a lone \"1\" would\n * say nothing the arrow does not.\n */\n protected sortOrderFor(key: string): number | null {\n const keys = this.activeSortKeys();\n if (keys.length < 2) return null;\n const at = keys.indexOf(key);\n return at < 0 ? null : at + 1;\n }\n\n protected cycleSort(key: string): void {\n const current = this.directionFor(key);\n const next: WrTableSortDirection = current === null ? 'asc' : current === 'asc' ? 'desc' : null;\n\n // A flip keeps the column's place in the order: the first entry is the\n // primary key, and reversing it is not a new sort. A new column joins at\n // the end; one cycled back to unsorted leaves.\n const list = this.sort().slice();\n const at = list.findIndex(s => s.key === key);\n if (next === null) list.splice(at, 1);\n else if (at === -1) list.push({ key, direction: next });\n else list[at] = { key, direction: next };\n this.sort.set(list);\n }\n\n protected onFilter(key: string, items: readonly WrTableFilterItem[]): void {\n this.filterChange.emit({ key, items });\n }\n\n protected cellContext(item: Record<string, unknown>, key: string, column: unknown): WrTableCellContext {\n return { $implicit: item[key], item, column: column as WrTableCellContext['column'] };\n }\n\n /**\n * What a plain cell shows: the column's `empty` for a missing value, its\n * `format` over the value, else the value itself. A cell template takes\n * this path's place entirely (see table.html).\n */\n protected cellText(item: Record<string, unknown>, key: string, column: WrTableColumn<T>): unknown {\n const value = item[key];\n if (noValue(value)) return column.empty ?? '';\n return column.format ? column.format(value, item as T) : value;\n }\n\n protected templateFor(key: unknown): TemplateRef<WrTableCellContext> | undefined {\n return this.cellMap().get(String(key));\n }\n}\n","@switch (loadingForm()) {\n @case ('overlay') {\n <div class=\"wr-table__loading\" role=\"status\" [attr.aria-label]=\"resolvedLoadingLabel()\">\n <wr-spinner size=\"lg\" />\n </div>\n }\n @case ('bar') {\n <div class=\"wr-table__loading-bar\" role=\"status\" [attr.aria-label]=\"resolvedLoadingLabel()\"></div>\n }\n}\n\n<div\n class=\"wr-table__scroll\"\n #scroll\n [style.--wr-table-scroll-height]=\"scrollHeight()\"\n [style.--wr-table-head-height.px]=\"stickyEdges().head\"\n [style.--wr-table-foot-height.px]=\"stickyEdges().foot\"\n [attr.tabindex]=\"scrollable() ? 0 : null\"\n>\n <table\n class=\"wr-table__table\"\n [class.wr-table__table--fixed]=\"fixedLayoutActive()\"\n [style.--wr-table-row-h.px]=\"virtualized() ? effRowH() : null\"\n [attr.aria-rowcount]=\"virtualized() ? renderRows().length + 1 + (hasSummary() && items()?.length ? 1 : 0) : null\"\n [attr.role]=\"treeMode() ? 'treegrid' : null\"\n [attr.aria-multiselectable]=\"treeMode() && rowSelection() === 'multiple' ? true : null\"\n >\n <colgroup>\n @if (rowSelection()) {\n <col class=\"wr-table__col--lead\" />\n }\n @if (expandable()) {\n <col class=\"wr-table__col--lead\" />\n }\n @for (col of displayColumns(); track col.key) {\n <col [style.width.px]=\"colWidth(col.key)\" />\n }\n </colgroup>\n <thead #head>\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListSortPredicate]=\"sortPredicate\"\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n >\n @if (rowSelection()) {\n <th class=\"wr-table__th wr-table__th--select\">\n @if (rowSelection() === 'multiple') {\n <!-- Disabled with nothing to sweep, the way `wr-transfer` guards its\n own select-all. `[checked]` is a one-way binding over a checkbox\n that owns its state, and on zero rows `allSelected()` answers\n `false` before and after the click — an unchanged input is never\n written back, so the box latched CHECKED over an empty table and\n stayed that way when rows returned. -->\n <wr-checkbox\n size=\"sm\"\n [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n [disabled]=\"selectAllKeys().size === 0\"\n (checkedChange)=\"toggleAll($event)\"\n [ariaLabel]=\"resolvedSelectAllLabel()\"\n />\n }\n </th>\n }\n @if (expandable()) {\n <th class=\"wr-table__th wr-table__th--expand\"></th>\n }\n @for (col of displayColumns(); track col.key) {\n <th\n #thCell\n cdkDrag\n [cdkDragDisabled]=\"!reorderable() || !!col.column.pin\"\n [class]=\"thClasses(col.column)\"\n [attr.aria-sort]=\"ariaSortFor(col.key, col.column.sortable)\"\n [attr.aria-label]=\"col.column.title ? null : (col.column.headerHint ?? null)\"\n [class.wr-table__th--draggable]=\"reorderable() && !col.column.pin\"\n [class.wr-table__th--pin-left]=\"col.column.pin === 'left'\"\n [class.wr-table__th--pin-right]=\"col.column.pin === 'right'\"\n [class.wr-table__th--pin-edge-left]=\"isPinEdge(col.key, 'left')\"\n [class.wr-table__th--pin-edge-right]=\"isPinEdge(col.key, 'right')\"\n [style.inset-inline-start.px]=\"leftPin(col.key)\"\n [style.inset-inline-end.px]=\"rightPin(col.key)\"\n >\n <div class=\"wr-table__th-inner\">\n <span class=\"wr-table__title\">{{ col.column.title }}</span>\n\n @if (col.column.sortable) {\n <button\n type=\"button\"\n class=\"wr-table__sort-btn\"\n [attr.aria-label]=\"sortLabelFor(headerName(col.column))\"\n (click)=\"cycleSort(col.key)\"\n >\n <wr-table-sort [direction]=\"directionFor(col.key)\" />\n </button>\n <!-- A column's place in a multi-column sort. Drawn, because only the\n primary key announces `aria-sort` (see ariaSortFor). Beside the\n button rather than in it: inside, the digit is visible text the\n button's name (\"Sort Role\") does not contain, which is a WCAG\n 2.5.3 label-in-name failure. Hidden, so the column header's own\n name stays its title. -->\n @if (sortOrderFor(col.key); as order) {\n <span class=\"wr-table__sort-order\" aria-hidden=\"true\">{{ order }}</span>\n }\n }\n\n @if (col.column.filterItems; as filterItems) {\n @if (filterItems.length) {\n <wr-table-filter\n [items]=\"filterItems\"\n [column]=\"headerName(col.column)\"\n (selectionChange)=\"onFilter(col.key, $event)\"\n />\n }\n }\n </div>\n\n @if (col.column.resizable) {\n <span\n class=\"wr-table__resize-handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onResizeStart($event, col.key, thCell)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeEnd($event)\"\n (pointercancel)=\"onResizeEnd($event)\"\n (mousedown)=\"$event.stopPropagation()\"\n (touchstart)=\"$event.stopPropagation()\"\n ></span>\n }\n </th>\n }\n </tr>\n </thead>\n\n <!-- One delegated listener for `rowClick`, which is pointer only by contract:\n the body is no control, and a row's keyboard path is the consumer's own\n button or link in a cell. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <tbody (click)=\"onBodyClick($event)\">\n @if (visibleItems()) {\n @if (virtualized() && virtualWindow().padTop > 0) {\n <tr class=\"wr-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"totalCols()\" [style.height.px]=\"virtualWindow().padTop\"></td>\n </tr>\n }\n @for (entry of windowRows(); track entry.id; let i = $index) {\n @if (entry.kind === 'group') {\n <tr class=\"wr-table__group-row\" [class.wr-table__group-row--collapsed]=\"entry.group.collapsed\">\n <td class=\"wr-table__group-cell\" [attr.colspan]=\"totalCols()\">\n <!-- The cell spans the full table width; this inner box is what sticks. -->\n <div class=\"wr-table__group-inner\">\n @if (rowSelection() === 'multiple') {\n <wr-checkbox\n class=\"wr-table__group-select\"\n size=\"sm\"\n [checked]=\"groupChecked(entry.group.rows)\"\n [indeterminate]=\"groupIndeterminate(entry.group.rows)\"\n (checkedChange)=\"toggleGroupSelection(entry.group.rows, $event)\"\n [ariaLabelledby]=\"groupControlLabelledby('select-group', entry.id)\"\n />\n }\n @if (groupTemplate(); as tpl) {\n <button\n type=\"button\"\n class=\"wr-table__group-toggle wr-table__group-toggle--icon\"\n [attr.aria-expanded]=\"!entry.group.collapsed\"\n [attr.aria-labelledby]=\"groupControlLabelledby('toggle-group', entry.id)\"\n (click)=\"toggleGroupCollapse(entry.group.value)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__group-icon\"\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 <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"entry.group\" />\n <!-- The group's name for the two controls above. A custom header\n is the consumer's markup, with nothing in it to point at. -->\n <span hidden [id]=\"groupLabelId(entry.id)\">{{ entry.group.label }}</span>\n } @else {\n <button\n type=\"button\"\n class=\"wr-table__group-toggle\"\n [attr.aria-expanded]=\"!entry.group.collapsed\"\n [attr.aria-labelledby]=\"groupToggleLabelledby(entry.id)\"\n (click)=\"toggleGroupCollapse(entry.group.value)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__group-icon\"\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 <span class=\"wr-table__group-label\" [id]=\"groupLabelId(entry.id)\">{{ entry.group.label }}</span>\n @if (showGroupCount()) {\n <!-- A real space between the label and the count. Whitespace\n alone draws nothing in a flex row, and without it the\n button's text reads \"admin2\" — which the name\n \"Toggle group admin 2\" does not contain, a label-in-name\n mismatch for any tool that compares the two. -->\n &ngsp;<span class=\"wr-table__group-count\" [id]=\"groupCountId(entry.id)\">{{\n entry.group.count\n }}</span>\n }\n </button>\n }\n </div>\n </td>\n </tr>\n } @else if (entry.kind === 'group-foot') {\n <tr class=\"wr-table__group-foot-row\">\n @if (rowSelection()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @if (expandable()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @for (col of displayColumns(); track col.key) {\n <td\n [class]=\"footClasses(col.column)\"\n [class.wr-table__td--pin-left]=\"col.column.pin === 'left'\"\n [class.wr-table__td--pin-right]=\"col.column.pin === 'right'\"\n [class.wr-table__td--pin-edge-left]=\"isPinEdge(col.key, 'left')\"\n [class.wr-table__td--pin-edge-right]=\"isPinEdge(col.key, 'right')\"\n [style.inset-inline-start.px]=\"leftPin(col.key)\"\n [style.inset-inline-end.px]=\"rightPin(col.key)\"\n >\n {{ entry.summaries.get(col.key) ?? '' }}\n </td>\n }\n </tr>\n } @else {\n <tr\n #rowEl\n [class]=\"rowClasses(entry.row, i)\"\n [class.wr-table__tr--selected]=\"rowSelection() && isRowSelected(entry.row)\"\n [class.wr-table__tr--child]=\"entry.depth > 0\"\n [attr.aria-rowindex]=\"virtualized() ? windowStart() + i + 2 : null\"\n [attr.aria-level]=\"treeMode() ? entry.depth + 1 : null\"\n [attr.aria-posinset]=\"treeMode() ? entry.posinset : null\"\n [attr.aria-setsize]=\"treeMode() ? entry.setsize : null\"\n [attr.aria-expanded]=\"entry.open\"\n [attr.aria-selected]=\"treeMode() && rowSelection() ? isRowSelected(entry.row) : null\"\n [attr.tabindex]=\"treeMode() ? (entry.id === tabStopRowId() ? 0 : -1) : null\"\n [style.--wr-table-depth]=\"treeMode() ? entry.depth : null\"\n >\n @if (rowSelection()) {\n <td class=\"wr-table__td wr-table__td--select\">\n <wr-checkbox\n size=\"sm\"\n [checked]=\"isRowSelected(entry.row)\"\n (checkedChange)=\"toggleRow(entry.row, $event)\"\n [ariaLabelledby]=\"rowControlLabelledby('select-row', entry.id)\"\n />\n </td>\n }\n @if (expandable()) {\n <td class=\"wr-table__td wr-table__td--expand\">\n <button\n type=\"button\"\n class=\"wr-table__expand-btn\"\n [class.wr-table__expand-btn--open]=\"isExpanded(entry.row)\"\n [attr.aria-expanded]=\"isExpanded(entry.row)\"\n [attr.aria-labelledby]=\"rowControlLabelledby('expand-row', entry.id)\"\n (click)=\"toggleExpand(entry.row)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__expand-icon\"\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 </td>\n }\n @for (col of displayColumns(); track col.key) {\n <td\n [class]=\"tdClasses(col.column)\"\n [class.wr-table__td--pin-left]=\"col.column.pin === 'left'\"\n [class.wr-table__td--pin-right]=\"col.column.pin === 'right'\"\n [class.wr-table__td--pin-edge-left]=\"isPinEdge(col.key, 'left')\"\n [class.wr-table__td--pin-edge-right]=\"isPinEdge(col.key, 'right')\"\n [style.inset-inline-start.px]=\"leftPin(col.key)\"\n [style.inset-inline-end.px]=\"rightPin(col.key)\"\n [style.max-width.px]=\"truncates(col.column) ? (col.column.width ?? null) : null\"\n [attr.data-label]=\"col.column.title\"\n [attr.id]=\"col.key === labelColumnKey() ? rowLabelId(entry.id) : null\"\n >\n @if (treeMode() && col.key === treeColumnKey()) {\n <span class=\"wr-table__tree-lead\">\n @if (entry.parent) {\n <button\n type=\"button\"\n class=\"wr-table__tree-toggle\"\n [class.wr-table__tree-toggle--open]=\"entry.open\"\n [attr.aria-expanded]=\"entry.open\"\n [attr.aria-labelledby]=\"rowControlLabelledby('toggle-row', entry.id)\"\n (click)=\"toggleTreeRow(entry.row)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__tree-icon\"\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 } @else {\n <span class=\"wr-table__tree-toggle wr-table__tree-toggle--leaf\" aria-hidden=\"true\"></span>\n }\n </span>\n }\n @if (templateFor(col.key); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"cellContext(entry.row, col.key, col.column)\"\n />\n } @else {\n {{ cellText(entry.row, col.key, col.column) }}\n }\n </td>\n }\n </tr>\n @if (expandable() && isExpanded(entry.row)) {\n <tr class=\"wr-table__detail-row\">\n <td class=\"wr-table__detail\" [attr.colspan]=\"totalCols()\">\n <ng-container\n [ngTemplateOutlet]=\"expandTemplate() ?? null\"\n [ngTemplateOutletContext]=\"expandContext(entry.row)\"\n />\n </td>\n </tr>\n }\n }\n }\n @if (virtualized() && virtualWindow().padBottom > 0) {\n <tr class=\"wr-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"totalCols()\" [style.height.px]=\"virtualWindow().padBottom\"></td>\n </tr>\n }\n }\n <!-- Sibling of the row loop rather than its `@empty` branch, and gated on\n `loading()`. As the `@empty` branch it lived INSIDE `@if (visibleItems())`,\n which passes a nullish `[items]` straight through — so the input's own\n default rendered a header over a blank body with no \"No data\" anywhere,\n the opposite of what `items`'s docs promise. And the veil is translucent,\n so on the documented `[items]=\"[]\" [loading]=\"true\"` pair the row read\n \"No data\" through the spinner. -->\n @if (!loading() && !renderRows().length) {\n <tr>\n <td class=\"wr-table__empty\" [attr.colspan]=\"totalCols()\">{{ resolvedEmptyLabel() }}</td>\n </tr>\n }\n </tbody>\n\n @if (hasSummary() && items()?.length) {\n <tfoot #foot>\n <tr class=\"wr-table__foot-row\">\n @if (rowSelection()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @if (expandable()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @for (col of displayColumns(); track col.key) {\n <td\n [class]=\"footClasses(col.column)\"\n [class.wr-table__td--pin-left]=\"col.column.pin === 'left'\"\n [class.wr-table__td--pin-right]=\"col.column.pin === 'right'\"\n [class.wr-table__td--pin-edge-left]=\"isPinEdge(col.key, 'left')\"\n [class.wr-table__td--pin-edge-right]=\"isPinEdge(col.key, 'right')\"\n [style.inset-inline-start.px]=\"leftPin(col.key)\"\n [style.inset-inline-end.px]=\"rightPin(col.key)\"\n >\n {{ summaryFor(col.key) }}\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n</div>\n\n@if (showPager()) {\n <div class=\"wr-table__pager\">\n <wr-pagination\n [(page)]=\"page\"\n [pageSize]=\"currentPageSize()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [total]=\"resolvedTotal()\"\n [size]=\"paginationSize()\"\n [showSizeChanger]=\"pageSizeOptions().length > 0\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n />\n </div>\n}\n\n<!-- The table's one tooltip, for a header hint or a cut cell (see `tip`). -->\n@if (tip(); as shown) {\n <span hidden [wrPopover]=\"shown.text\" mode=\"tooltip\" [wrPopoverOrigin]=\"shown.el\"></span>\n}\n\n<!-- The action words the row and group controls are named with, once per table.\n `aria-labelledby` reads a hidden element it points at, so each control joins\n one of these to its own row's (or group's) label. Only the words a control\n in this table uses are rendered. -->\n@if (rowSelection() || expandable() || treeMode() || groupBy() !== null) {\n <div hidden>\n @if (rowSelection()) {\n <span [id]=\"actionId('select-row')\">{{ resolvedSelectRowLabel() }}</span>\n }\n @if (expandable()) {\n <span [id]=\"actionId('expand-row')\">{{ resolvedExpandRowLabel() }}</span>\n }\n @if (treeMode()) {\n <span [id]=\"actionId('toggle-row')\">{{ resolvedToggleRowLabel() }}</span>\n }\n @if (groupBy() !== null) {\n @if (rowSelection() === 'multiple') {\n <span [id]=\"actionId('select-group')\">{{ resolvedSelectGroupLabel() }}</span>\n }\n <span [id]=\"actionId('toggle-group')\">{{ resolvedToggleGroupLabel() }}</span>\n }\n </div>\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 type { WrTableSortAccessor, WrTableSortState } from './types';\n\n// `>` between a number and a string coerces and is false both ways, which is\n// not an order. Ranking the kind first keeps a mixed column totally ordered.\nfunction compareValues(left: string | number, right: string | number): number {\n const rank = kindOf(left) - kindOf(right);\n\n if (rank !== 0) {\n return rank;\n }\n\n return left > right ? 1 : left < right ? -1 : 0;\n}\n\nfunction kindOf(value: string | number): number {\n if (value === '' || Number.isNaN(value)) {\n return 0;\n }\n\n return typeof value === 'number' ? 1 : 2;\n}\n\n/**\n * Reads the column `key` off a row as the value `wrSortRows` compares.\n *\n * - `null`, `undefined`, `''` and an invalid `Date` read as `''`.\n * - A number stays a number, and a bigint reads as one.\n * - A string that is a finite number reads as that number, so `'10'` sorts\n * after `'9'`. A blank string stays a string: it is not `0`.\n * - A boolean reads as `0` or `1`, so `false` sorts before `true`.\n * - A `Date` reads as its timestamp.\n * - Anything else reads as `String(value)`.\n *\n * @example\n * ```ts\n * wrReadField({ qty: '10' }, 'qty'); // 10\n * wrReadField({ qty: null }, 'qty'); // ''\n * ```\n *\n * @param item The row.\n * @param key The column key, a property of the row.\n */\nexport function wrReadField<T>(item: T, key: string): string | number {\n const value = (item as Record<string, unknown> | null | undefined)?.[key];\n\n if (value === null || value === undefined || value === '') {\n return '';\n }\n\n switch (typeof value) {\n case 'number':\n return value;\n case 'boolean':\n case 'bigint':\n return Number(value);\n case 'string': {\n const asNumber = value.trim() === '' ? NaN : Number(value);\n return Number.isFinite(asNumber) ? asNumber : value;\n }\n }\n\n if (value instanceof Date) {\n const time = value.getTime();\n return Number.isNaN(time) ? '' : time;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- an object answers with its own toString\n return String(value);\n}\n\n/**\n * Sorts rows by the sort state `<wr-table>` holds. The table draws the arrows\n * and never reorders `items`, so the host sorts them.\n *\n * Entries apply in array order: the first decides, later ones break ties. An\n * entry with a `null` direction is skipped. Within a column, empty values come\n * first, then numbers, then text in code-unit order; `desc` reverses all of\n * it. Rows equal on every key keep their input order.\n *\n * Returns `rows` itself when there is nothing to sort, and a sorted copy\n * otherwise: the input is never mutated.\n *\n * @example\n * ```ts\n * protected readonly sort = signal<readonly WrTableSortState[]>([]);\n * protected readonly rows = computed(() => wrSortRows(this.source(), this.sort()));\n * ```\n *\n * @param rows The rows to sort.\n * @param sort The table's `sort` state.\n * @param accessor Reads the value of a key; defaults to `wrReadField`.\n */\nexport function wrSortRows<T>(\n rows: readonly T[],\n sort: readonly WrTableSortState[],\n accessor: WrTableSortAccessor<T> = wrReadField\n): readonly T[] {\n const active = (sort ?? []).filter(state => !!state.direction);\n\n if (!active.length || !rows?.length) {\n return rows;\n }\n\n return [...rows].sort((a, b) => {\n for (const { key, direction } of active) {\n const result = compareValues(accessor(a, key), accessor(b, key));\n\n if (result !== 0) {\n return direction === 'desc' ? -result : result;\n }\n }\n\n return 0;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,cAAb,MAAa,YAAW;CAEb,YAAY,MAAM,SAAQ;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAM,OAAO;CAAa,CAAA;CAMpD,gBAAgB,MAAuC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAEjE,WAAW,OAA8C,WAAW;CAY7E,OAAO,uBACL,MACA,MAAa;EAEb,OAAO;CACT;CA3BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAW,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAX,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAW,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,WAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,eAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAX,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAW,YAAA,CAAA;EAHvB,MAAA;EAAU,MAAA,CAAA,EACT,UAAU,gBACX,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLD,IAAa,gB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ACnC;CAGA,OAAO,OAAO,KAAK;AACrB;AAwBA,SAAgB,WACd,MACA,MACA,WAAmC,aAAW;CAE9C,MAAM,UAAU,QAAQ,CAAA,EAAA,CAAI,QAAO,UAAS,CAAC,CAAC,MAAM,SAAS;CAE7D,IAAI,CAAC,OAAO,UAAU,CAAC,MAAM,QAC3B,OAAO;CAGT,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,GAAG,MAAK;EAC7B,KAAK,MAAM,EAAE,KAAK,eAAe,QAAQ;GACvC,MAAM,SAAS,cAAc,SAAS,GAAG,GAAG,GAAG,SAAS,GAAG,GAAG,CAAC;GAE/D,IAAI,WAAW,GACb,OAAO,cAAc,SAAS,CAAC,SAAS;EAE5C;EAEA,OAAO;CACT,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"ngwr-table.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/table/table-cell.ts","../../../projects/lib/table/table-column-chooser.ts","../../../projects/lib/table/table-column-chooser.html","../../../projects/lib/table/table-edit-cell.ts","../../../projects/lib/table/table-expand.ts","../../../projects/lib/table/table-filter.ts","../../../projects/lib/table/table-filter.html","../../../projects/lib/table/table-group-header.ts","../../../projects/lib/table/table-selection-bar.ts","../../../projects/lib/table/table-sort.ts","../../../projects/lib/table/table.ts","../../../projects/lib/table/table.html","../../../projects/lib/table/sort-rows.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 { Directive, TemplateRef, inject, input } from '@angular/core';\n\nimport type { WrSafeAny } from 'ngwr/utils';\n\nimport type { WrTableCellContext, WrTableRow } from './types';\n\n/**\n * Provide a custom template for a specific column's cells.\n *\n * Name the rows through `[wrTableCellOf]` and the template's variables arrive\n * typed: `let-row=\"item\"` is the row and `let-value` is the row's property\n * under the column key. The input is read by the type checker only, the way\n * `*ngFor`'s `of` types its loop variable: the table hands every template the\n * same context whether or not it is set.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"users\">\n * <ng-template wrTableCell=\"role\" [wrTableCellOf]=\"users\" let-value let-row=\"item\">\n * <wr-tag [color]=\"value === 'admin' ? 'danger' : null\">{{ row.name }}</wr-tag>\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({\n selector: '[wrTableCell]',\n})\nexport class WrTableCell<T extends WrTableRow = WrSafeAny, K extends string = string> {\n /** Column key the template applies to. */\n readonly columnKey = input.required<K>({ alias: 'wrTableCell' });\n\n /**\n * The rows the template draws, for the type checker: nothing reads it at\n * runtime. Bind the same array as the table's `[items]`.\n */\n readonly wrTableCellOf = input<readonly T[] | null | undefined>(undefined);\n\n readonly template = inject<TemplateRef<WrTableCellContext<T, K>>>(TemplateRef);\n\n /**\n * Types the template's `let-` variables under `strictTemplates`.\n *\n * `T` defaults to `WrSafeAny` for the reason `WrOptionLeading` gives: a\n * template without `[wrTableCellOf]` has nothing to infer the row from, and\n * narrowed to `unknown` every `row.email` would stop compiling. With the\n * input bound, `K` is the key the attribute names, so `let-value` is that\n * property's type and a key the row does not have reads `unknown`.\n */\n /* eslint-disable @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read */\n static ngTemplateContextGuard<T extends WrTableRow, K extends string>(\n _dir: WrTableCell<T, K>,\n _ctx: unknown\n ): _ctx is WrTableCellContext<T, K> {\n return true;\n }\n /* eslint-enable @typescript-eslint/no-unused-vars */\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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { WrCheckbox } from 'ngwr/checkbox';\nimport { useI18nText } from 'ngwr/i18n';\nimport { type WrSafeAny, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTable } from './table';\n\n/**\n * The column list of a `<wr-table>`, for a menu of your own: one checkbox per\n * column, in column order, under a \"Show all\" row. Place it in a popover, a\n * dropdown or a drawer and hand it the table. Every toggle writes the table's\n * `hiddenColumns`, so `hiddenColumnsChange` and `stateChange` fire as they do\n * from the built-in `columnChooser`, which renders this same list.\n *\n * A `hideable: false` column and the last visible one stay checked and\n * disabled. \"Show all\" shows every column; pressed while all are shown, it\n * hides every column that can be hidden, less the first when none is\n * `hideable: false`.\n *\n * @example\n * ```html\n * <button wr-btn type=\"button\" [wrPopover]=\"menu\">Columns</button>\n * <ng-template #menu>\n * <wr-table-column-chooser [table]=\"table\" />\n * </ng-template>\n *\n * <wr-table #table [columns]=\"columns\" [items]=\"rows\" [(hiddenColumns)]=\"hidden\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/table\n */\n@Component({\n selector: 'wr-table-column-chooser',\n templateUrl: './table-column-chooser.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-table-column-chooser',\n role: 'group',\n '[attr.aria-label]': 'resolvedLabel()',\n },\n imports: [WrCheckbox],\n})\nexport class WrTableColumnChooser {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('table');\n }\n\n /** The table whose columns the list shows and hides. */\n readonly table = input.required<WrTable<WrSafeAny>>();\n\n /** Text of the \"Show all\" row. Falls back to `table.showAllColumns`. */\n readonly showAllLabel = input<string | null>(null);\n\n /** Accessible name of the list. Falls back to `table.columns`. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedShowAll = useI18nText(this.showAllLabel, 'table.showAllColumns', 'Show all');\n protected readonly resolvedLabel = useI18nText(this.ariaLabel, 'table.columns', 'Columns');\n\n protected readonly columns = computed(() => this.table().chooserColumns());\n\n /** How many of the hideable columns are shown: every one, some, or none. */\n protected readonly showAllState = computed<'all' | 'some' | 'none'>(() => {\n const hideable = this.columns().filter(c => c.hideable);\n const hidden = hideable.filter(c => c.hidden).length;\n if (hidden === 0) return 'all';\n return hidden === hideable.length ? 'none' : 'some';\n });\n\n /** No column can be shown or hidden, so the row has nothing to do. */\n protected readonly showAllDisabled = computed(() => this.columns().every(c => c.locked));\n\n /**\n * Shows every column while one is hidden. Once all are shown it hides every\n * hideable one, and the table keeps its first column when that would leave none.\n */\n protected toggleShowAll(): void {\n const table = this.table();\n if (this.showAllState() !== 'all') return table.setHiddenColumns([]);\n table.setHiddenColumns(\n this.columns()\n .filter(c => c.hideable)\n .map(c => c.key)\n );\n }\n}\n","@if (columns().length > 0) {\n <wr-checkbox\n class=\"wr-table-column-chooser__all\"\n size=\"sm\"\n [checked]=\"showAllState() === 'all'\"\n [indeterminate]=\"showAllState() === 'some'\"\n [disabled]=\"showAllDisabled()\"\n (checkedChange)=\"toggleShowAll()\"\n >{{ resolvedShowAll() }}</wr-checkbox\n >\n}\n@for (entry of columns(); track entry.key) {\n <wr-checkbox\n class=\"wr-table-column-chooser__item wr-table__columns-item\"\n size=\"sm\"\n [checked]=\"!entry.hidden\"\n [disabled]=\"entry.locked\"\n (checkedChange)=\"table().toggleColumn(entry.key)\"\n >{{ entry.title }}</wr-checkbox\n >\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, TemplateRef, inject, input } from '@angular/core';\n\nimport type { WrSafeAny } from 'ngwr/utils';\n\nimport type { WrTableEditCellContext, WrTableRow } from './types';\n\n/**\n * Provide the editor for a column's cells, and with it make the column\n * editable: a double click, Enter, F2 or a typed character on a cell swaps its\n * content for this template, and the table emits `cellEdit` when the edit\n * commits. A column whose definition says `editable: false` stays read-only.\n *\n * `set` keeps a value while the reader types and `commit` ends the edit with\n * one. Enter, Tab and a click outside commit the value last kept; Escape and\n * `cancel` drop it. `[wrTableEditCellOf]` types the variables, the way\n * `[wrTableCellOf]` does.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"products\" (cellEdit)=\"save($event)\">\n * <ng-template wrTableEditCell=\"price\" [wrTableEditCellOf]=\"products\" let-value let-set=\"set\">\n * <wr-input-number aria-label=\"Price\" [value]=\"value\" (valueChange)=\"set($event)\" />\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({\n selector: '[wrTableEditCell]',\n})\nexport class WrTableEditCell<T extends WrTableRow = WrSafeAny, K extends string = string> {\n /** Column key the editor applies to. */\n readonly columnKey = input.required<K>({ alias: 'wrTableEditCell' });\n\n /**\n * The rows the table draws, for the type checker: nothing reads it at\n * runtime. Bind the same array as the table's `[items]`.\n */\n readonly wrTableEditCellOf = input<readonly T[] | null | undefined>(undefined);\n\n readonly template = inject<TemplateRef<WrTableEditCellContext<T, K>>>(TemplateRef);\n\n /** Types the template's `let-` variables under `strictTemplates`, as `WrTableCell` does. */\n /* eslint-disable @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read */\n static ngTemplateContextGuard<T extends WrTableRow, K extends string>(\n _dir: WrTableEditCell<T, K>,\n _ctx: unknown\n ): _ctx is WrTableEditCellContext<T, K> {\n return true;\n }\n /* eslint-enable @typescript-eslint/no-unused-vars */\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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrTableExpandContext } from './types';\n\n/**\n * Provide the detail template revealed when a row is expanded. Adding it turns\n * on the leading expand column; the row object is the template's implicit\n * context.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"items\" [(expanded)]=\"expanded\" rowKey=\"id\">\n * <ng-template wrTableExpand let-row>\n * <p>{{ row.bio }}</p>\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrTableExpand]',\n})\nexport class WrTableExpand {\n readonly template = inject<TemplateRef<WrTableExpandContext>>(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 { Component, ViewEncapsulation, computed, input, output, signal } from '@angular/core';\n\nimport { WrDropdown, WrDropdownMenu } from 'ngwr/dropdown';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrIsComposing, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTableFilterItem } from './types';\n\n/**\n * Bumped on every selection change, by EVERY filter.\n *\n * `items` belongs to the CONSUMER — the column definition hands the same array\n * back on every render — and a filter flips `selected` on those objects in\n * place. No signal sees a property mutation, so anything derived from it has to\n * be told. One counter for all instances rather than one each, because a column\n * definition is routinely shared: two tables over one `columns` object hold the\n * same objects, and a per-instance counter left the table that was not clicked\n * showing no badge over a panel with a ticked box.\n */\nconst selectionVersion = signal(0);\n\n/** Tells every filter that `selected` was written on its items from outside, by the table's `state`. */\nexport function markFilterSelectionChanged(): void {\n selectionVersion.update(v => v + 1);\n}\n\n/**\n * Filter dropdown rendered in a filterable column's header.\n *\n * @internal — used internally by `<wr-table>`.\n */\n@Component({\n selector: 'wr-table-filter',\n templateUrl: './table-filter.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-table-filter', '[class]': 'classes()' },\n imports: [WrDropdown, WrDropdownMenu],\n})\nexport class WrTableFilter {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('table');\n }\n\n /** Available filter options. */\n /** Accessible name of the filter trigger. Falls back to `table.filter`. */\n readonly filterLabel = input<string | null>(null);\n\n /**\n * The column this filter belongs to, for the trigger's accessible name.\n *\n * Without it every filter trigger in a header row announced the same\n * \"Filter column\", so a screen-reader user tabbing the row heard the same\n * button three times and could not tell which column each one narrowed. The\n * caret and the funnel sit beside the column title, so sighted readers had\n * the context all along; an `aria-label` REPLACES content, so nobody else did.\n */\n readonly column = input<string>('');\n\n /** Text shown when the search finds nothing. Falls back to `table.noMatches`. */\n readonly noMatchesLabel = input<string | null>(null);\n\n /**\n * Placeholder AND accessible name of the search box. Falls back to `table.search`.\n *\n * One string for both because the box has no visible label: the placeholder was\n * its only name, so a hard-coded literal left the control unnamed in every other\n * language rather than merely untranslated.\n */\n readonly searchLabel = input<string | null>(null);\n\n /** Label of the clear-selection button. Falls back to `table.reset`. */\n readonly resetLabel = input<string | null>(null);\n\n private readonly filterText = useI18nFormatter('table.filter', 'Filter {{column}}');\n\n // Trimmed: a filter used on its own has no column, and \"Filter \" with the\n // placeholder's trailing space is what a reader would otherwise hear.\n protected readonly resolvedFilterLabel = computed(\n () => this.filterLabel() ?? this.filterText({ column: this.column() }).trim()\n );\n protected readonly resolvedNoMatchesLabel = useI18nText(this.noMatchesLabel, 'table.noMatches', 'No matches');\n protected readonly resolvedSearchLabel = useI18nText(this.searchLabel, 'table.search', 'Search');\n protected readonly resolvedResetLabel = useI18nText(this.resetLabel, 'table.reset', 'Reset');\n\n /**\n * The values the column can be filtered by. Shown as a checkbox list, so pass\n * the distinct values rather than one entry per row.\n */\n readonly items = input.required<readonly WrTableFilterItem[]>();\n\n /** Fires whenever the selection changes. */\n readonly selectionChange = output<readonly WrTableFilterItem[]>();\n\n protected readonly query = signal('');\n\n /** Filtered + selection-tracked view of items. */\n protected readonly visible = computed<WrTableFilterItem[]>(() => {\n const q = this.query().trim().toLowerCase();\n const all = this.items();\n if (!q) return [...all];\n return all.filter(i => i.title.toLowerCase().includes(q));\n });\n\n protected readonly selectedCount = computed(() => {\n selectionVersion();\n return this.items().filter(i => i.selected).length;\n });\n\n /**\n * The trigger's name: the filter label, plus the count it shows once something\n * is selected. The count is visible text on the button, so leaving it out of\n * the name breaks WCAG 2.5.3 (Label in Name) for a speech-input user. Joined\n * with a comma, not wrapped in parentheses: axe reads `(1)` as a token that\n * does not contain `1`, measured in Chromium against axe-core 4.14.\n */\n protected readonly triggerName = computed(() => {\n const count = this.selectedCount();\n return count > 0 ? `${this.resolvedFilterLabel()}, ${count}` : this.resolvedFilterLabel();\n });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.selectedCount() > 0) parts.push('wr-table-filter--active');\n return parts.join(' ');\n });\n\n protected onSearchInput(event: Event): void {\n this.query.set((event.target as HTMLInputElement).value);\n }\n\n /**\n * Hands every key back to the input method while a conversion is open.\n *\n * The dropdown this panel lives in closes on Escape, and it hears the key from\n * CDK's overlay keyboard dispatcher — one listener on `<body>`, in the bubble\n * phase. So not acting is not enough: the event has to be stopped here, at the\n * field that owns the composition, or Escape cancels the reading AND takes the\n * whole filter panel with it. Nothing else in this component reads a key, so\n * stopping all of them during a conversion costs nothing.\n */\n protected onSearchKeydown(event: KeyboardEvent): void {\n if (wrIsComposing(event)) event.stopPropagation();\n }\n\n protected onToggle(item: WrTableFilterItem): void {\n item.selected = !item.selected;\n selectionVersion.update(v => v + 1);\n this.emitSelected();\n }\n\n protected onReset(): void {\n for (const item of this.items()) item.selected = false;\n selectionVersion.update(v => v + 1);\n this.selectionChange.emit([]);\n }\n\n private emitSelected(): void {\n this.selectionChange.emit(this.items().filter(i => i.selected));\n }\n}\n","<button type=\"button\" class=\"wr-table-filter__trigger\" [wrDropdown]=\"menu\" [attr.aria-label]=\"triggerName()\">\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\n d=\"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\"\n />\n </svg>\n @if (selectedCount() > 0) {\n <span class=\"wr-table-filter__count\">{{ selectedCount() }}</span>\n }\n</button>\n\n<wr-dropdown-menu #menu>\n <div class=\"wr-table-filter__panel\">\n <input\n class=\"wr-table-filter__search\"\n type=\"search\"\n [placeholder]=\"resolvedSearchLabel()\"\n [attr.aria-label]=\"resolvedSearchLabel()\"\n [value]=\"query()\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n\n <div class=\"wr-table-filter__list\">\n @for (item of visible(); track item.value) {\n <button\n type=\"button\"\n class=\"wr-table-filter__item\"\n [class.wr-table-filter__item--selected]=\"item.selected\"\n [attr.aria-pressed]=\"!!item.selected\"\n (click)=\"onToggle(item)\"\n >\n <span class=\"wr-table-filter__check\">\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=\"M20 6 9 17l-5-5\" />\n </svg>\n </span>\n <span class=\"wr-table-filter__title\">{{ item.title }}</span>\n </button>\n } @empty {\n <div class=\"wr-table-filter__empty\">{{ resolvedNoMatchesLabel() }}</div>\n }\n </div>\n\n @if (selectedCount() > 0) {\n <button type=\"button\" class=\"wr-table-filter__reset\" (click)=\"onReset()\">{{ resolvedResetLabel() }}</button>\n }\n </div>\n</wr-dropdown-menu>\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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrTableGroupContext } from './types';\n\n/**\n * Provide a custom template for a group band's label area. The collapse chevron\n * and the optional group checkbox are still rendered by the table around it, so\n * the template may safely contain its own interactive content. Projecting it\n * does NOT enable grouping — set `[groupBy]` for that.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"rows\" groupBy=\"department\">\n * <ng-template wrTableGroupHeader let-value let-count=\"count\" let-toggle=\"toggle\">\n * <wr-tag color=\"primary\" (click)=\"toggle()\">{{ value }}</wr-tag>\n * <small>{{ count }} people</small>\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({ selector: 'ng-template[wrTableGroupHeader]' })\nexport class WrTableGroupHeader {\n readonly template = inject<TemplateRef<WrTableGroupContext>>(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 { Directive, TemplateRef, inject, input } from '@angular/core';\n\nimport type { WrSafeAny } from 'ngwr/utils';\n\nimport type { WrTableRow, WrTableSelectionContext } from './types';\n\n/**\n * Provide the actions of the selection bar. With it, the table draws a bar\n * over its header while `selection` is not empty: the count, a clear button\n * and this template between them. The selected rows are the template's\n * implicit context, beside `count`, `clear` and `scope`.\n *\n * Name the rows through `[wrTableSelectionBarOf]` and `let-rows` arrives\n * typed, the way `[wrTableCellOf]` types a cell template.\n *\n * @example\n * ```html\n * <wr-table rowKey=\"id\" rowSelection=\"multiple\" [columns]=\"columns\" [items]=\"users\" [(selection)]=\"selected\">\n * <ng-template wrTableSelectionBar [wrTableSelectionBarOf]=\"users\" let-rows>\n * <button wr-btn type=\"button\" size=\"sm\" color=\"danger\" (click)=\"remove(rows)\">Delete</button>\n * </ng-template>\n * </wr-table>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrTableSelectionBar]',\n})\nexport class WrTableSelectionBar<T extends WrTableRow = WrSafeAny> {\n /**\n * The rows the template receives, for the type checker: nothing reads it at\n * runtime. Bind the same array as the table's `[items]`.\n */\n readonly wrTableSelectionBarOf = input<readonly T[] | null | undefined>(undefined);\n\n readonly template = inject<TemplateRef<WrTableSelectionContext<T>>>(TemplateRef);\n\n /* eslint-disable @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read */\n static ngTemplateContextGuard<T extends WrTableRow>(\n _dir: WrTableSelectionBar<T>,\n _ctx: unknown\n ): _ctx is WrTableSelectionContext<T> {\n return true;\n }\n /* eslint-enable @typescript-eslint/no-unused-vars */\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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTableSortDirection } from './types';\n\n/**\n * Sort indicator rendered in a sortable column's header.\n *\n * Draws an ARROW for a sorted column — up for `asc`, the same arrow turned by\n * the stylesheet for `desc` — and a flat LINE for a column that sorts but is\n * not sorted. A different shape rather than a fainter arrow, on purpose: a\n * dimmed up-arrow reads as \"sorted ascending\", which is the one thing an\n * unsorted column must not say, and a state told apart by opacity and colour\n * alone is lost to anyone who cannot see that difference. A line also has no\n * direction to mirror under RTL.\n *\n * @internal — used internally by `<wr-table>`. Parent listens for clicks\n * on the indicator to cycle direction.\n */\n@Component({\n selector: 'wr-table-sort',\n template:\n '<svg class=\"wr-icon__svg wr-table-sort__icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">@if (direction()) {<path d=\"m5 12 7-7 7 7\"/><path d=\"M12 19V5\"/>} @else {<path d=\"M6 12h12\"/>}</svg>',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-table-sort', '[class]': 'classes()' },\n})\nexport class WrTableSort {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('table');\n }\n\n /**\n * Which way the column is currently sorted, or `null` for unsorted — the three\n * states the indicator cycles through. Drive it from the table's `sort` state.\n */\n readonly direction = input<WrTableSortDirection>(null);\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const dir = this.direction();\n if (dir) parts.push(`wr-table-sort--${dir}`);\n return parts.join(' ');\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InputModalityDetector } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n CdkDrag,\n type CdkDragDrop,\n type CdkDragMove,\n type CdkDragSortEvent,\n type CdkDragStart,\n CdkDropList,\n moveItemInArray,\n} from '@angular/cdk/drag-drop';\nimport { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n afterNextRender,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n type WritableSignal,\n computed,\n contentChild,\n contentChildren,\n effect,\n inject,\n input,\n isDevMode,\n linkedSignal,\n model,\n output,\n signal,\n untracked,\n viewChild,\n viewChildren,\n} from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { WrCheckbox } from 'ngwr/checkbox';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrPagination, type WrPaginationSize } from 'ngwr/pagination';\nimport { WrPopover } from 'ngwr/popover';\nimport { WrSpinner } from 'ngwr/spinner';\nimport {\n WR_KEYS,\n wrToClassList,\n wrCheckStyles,\n wrDecimal,\n wrDecimalAdd,\n wrDecimalCompare,\n wrDecimalDivide,\n wrDownloadBlob,\n wrIsComposing,\n wrIsPrintableKey,\n wrWatchDragCancel,\n} from 'ngwr/utils';\n\nimport { WrTableCell } from './table-cell';\nimport { WrTableColumnChooser } from './table-column-chooser';\nimport { WrTableEditCell } from './table-edit-cell';\nimport { WrTableExpand } from './table-expand';\nimport { WrTableFilter, markFilterSelectionChanged } from './table-filter';\nimport { WrTableGroupHeader } from './table-group-header';\nimport { WrTableSelectionBar } from './table-selection-bar';\nimport { WrTableSort } from './table-sort';\nimport type {\n WrTableCellContext,\n WrTableCellEdit,\n WrTableChooserColumn,\n WrTableColumn,\n WrTableColumns,\n WrTableCsvOptions,\n WrTableEditCellContext,\n WrTableEditable,\n WrTableExpandContext,\n WrTableFilterChange,\n WrTableFilterItem,\n WrTableGroupContext,\n WrTableLoadingMode,\n WrTableRow,\n WrTableRowClass,\n WrTableRowClick,\n WrTableSelectionContext,\n WrTableSortState,\n WrTableSortDirection,\n WrTableState,\n WrTableSummary,\n WrTableSummaryContext,\n WrTableTruncate,\n} from './types';\n\n/** Sentinel value for the single synthetic bucket used when grouping is off. */\nconst WR_TABLE_UNGROUPED = Symbol('wr-table-ungrouped');\n\n/** One `<tbody>` row descriptor. Not exported — same precedent as the tree's flat node. */\ntype RenderRow =\n | { readonly kind: 'group'; readonly id: string; readonly group: WrTableGroupContext }\n | {\n readonly kind: 'row';\n readonly id: string;\n readonly row: Record<string, unknown>;\n /** 0 for a flat table and for every root; +1 per level in tree mode. */\n readonly depth: number;\n /** Whether this row owns a child array — drives the toggle vs the spacer. */\n readonly parent: boolean;\n /** Open state, `null` for a leaf (so `aria-expanded` is omitted entirely). */\n readonly open: boolean | null;\n /** 1-based position among its siblings, for `aria-posinset`. */\n readonly posinset: number;\n /** Sibling count, for `aria-setsize`. */\n readonly setsize: number;\n }\n | { readonly kind: 'group-foot'; readonly id: string; readonly summaries: ReadonlyMap<string, unknown> };\n\n/**\n * A display column with everything its cells draw from the column alone, so a\n * cell binding reads a property instead of calling a method on every pass.\n */\ninterface CellColumn<T extends WrTableRow> {\n readonly key: string;\n readonly column: WrTableColumn<T>;\n readonly thClass: string;\n readonly tdClass: string;\n readonly footClass: string;\n readonly pinned: boolean;\n readonly pinLeft: boolean;\n readonly pinRight: boolean;\n /** The inner-edge pinned column of its side, which carries the shadow. */\n readonly edgeLeft: boolean;\n readonly edgeRight: boolean;\n /** Sticky `inset-inline-start` / `-end` offsets in px, `null` off the pinned set. */\n readonly start: number | null;\n readonly end: number | null;\n /** The `<col>` width in px, `null` for auto. A live resize wins. */\n readonly width: number | null;\n /** The `width` a truncated column's cells are capped at. */\n readonly maxWidth: number | null;\n /** Whether its cell names the row (see `labelColumnKey`). */\n readonly label: boolean;\n /** Whether its cell carries the tree indent and toggle. */\n readonly tree: boolean;\n readonly template: TemplateRef<WrTableCellContext> | undefined;\n /** The column's editor, `undefined` without one and under `editable: false`. */\n readonly editTemplate: TemplateRef<WrTableEditCellContext> | undefined;\n /** The context each row's cell template gets, kept so a pass hands the outlet the same object. */\n readonly contexts: WeakMap<Record<string, unknown>, WrTableCellContext>;\n}\n\n/** `$implicit` is read through, so a row edited in place still shows its current value. */\nclass CellContext implements WrTableCellContext {\n readonly item: Record<string, unknown>;\n readonly column: WrTableCellContext['column'];\n private readonly key: string;\n\n constructor(item: Record<string, unknown>, column: WrTableCellContext['column'], key: string) {\n this.item = item;\n this.column = column;\n this.key = key;\n }\n\n get $implicit(): unknown {\n return this.item[this.key];\n }\n}\n\n/** One cell edit in flight. */\ninterface CellEdit {\n readonly row: Record<string, unknown>;\n readonly key: string;\n readonly td: HTMLElement;\n readonly previous: unknown;\n readonly pending: WritableSignal<unknown>;\n readonly context: WrTableEditCellContext;\n}\n\n/**\n * What an editor's first focus lands on. Not `wrGetFocusableElements`: that one\n * drops an element with no box, and the editor may not be laid out yet.\n */\nconst EDITOR_FOCUSABLE = [\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\n/**\n * Instance counter for the ids the row controls are named through. Counted, not\n * `wrRandomId()`, so the prerendered `aria-labelledby` is the one the browser\n * renders again — the same reason `wr-tabs` and `wr-mention` count.\n */\nlet tableUid = 0;\n\n/** The grand-total context every `<tfoot>` summary is computed with. */\nconst WR_TABLE_TOTAL_SCOPE: WrTableSummaryContext = { scope: 'total', group: null };\n\n/** A formatted figure such as `-1,234.50`, which no spreadsheet evaluates as a formula. */\nconst CSV_FIGURE = /^[+-]?[\\d\\s.,]+%?$/;\n\n/**\n * What a click inside a row belongs to instead of the row. `label` is here\n * because a click on one is replayed on its control.\n */\nconst ROW_CLICK_IGNORE = [\n 'button',\n 'a[href]',\n 'input',\n 'select',\n 'textarea',\n '[role=button]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'label',\n '[wrTableIgnoreRowClick]',\n '.wr-table__td--editing',\n // A near miss around the row's own checkbox or toggle is not a row click.\n '.wr-table__td--select',\n '.wr-table__td--expand',\n].join(', ');\n\nfunction sameList(a: readonly unknown[], b: readonly unknown[]): boolean {\n return a.length === b.length && a.every((value, i) => Object.is(value, b[i]));\n}\n\n/** A missing cell value: `null`, `undefined` or `''`. `0` and `false` are values. */\nfunction noValue(value: unknown): value is null | undefined | '' {\n return value == null || value === '';\n}\n\n/**\n * A built-in summary over a column that holds decimal STRINGS, exact through\n * `wrDecimal`. A cell it cannot read is left out, the way the number path\n * leaves out a non-finite one; the average divides at the widest scale among\n * the values and never fewer than two places, half away from zero.\n */\nfunction decimalSummary(kind: 'sum' | 'avg' | 'min' | 'max', values: readonly unknown[]): string {\n const decimals: string[] = [];\n let scale = 2;\n for (const value of values) {\n const decimal = wrDecimal(value);\n if (decimal === null) continue;\n decimals.push(decimal);\n const point = decimal.indexOf('.');\n if (point >= 0) scale = Math.max(scale, decimal.length - point - 1);\n }\n if (decimals.length === 0) return '';\n if (kind === 'min' || kind === 'max') {\n const keep = kind === 'min' ? -1 : 1;\n return decimals.reduce((a, b) => (wrDecimalCompare(b, a) === keep ? b : a));\n }\n let sum = '0';\n for (const decimal of decimals) sum = wrDecimalAdd(sum, decimal) ?? sum;\n return kind === 'sum' ? sum : (wrDecimalDivide(sum, decimals.length, scale) ?? '');\n}\n\n/**\n * A header or body cell's classes: the base, the `align` modifier and the\n * column's own `class`, in that order.\n */\n/**\n * Whether a projected template is an `<ng-template>` element rather than an\n * `@if` / `@for` / `@switch` block, which a `TemplateRef` query matches too.\n * Angular offers no public way to tell them apart. The compiler gives an\n * `<ng-template>` that tag name and never gives it to a block, so this reads\n * it off the template's declaration node. Dev-mode only: where that field is\n * missing, every template counts.\n */\nfunction isNgTemplateElement(tpl: TemplateRef<unknown>): boolean {\n const tag = (tpl as unknown as { _declarationTContainer?: { value?: unknown } })._declarationTContainer?.value;\n return tag === undefined || tag === 'ng-template';\n}\n\nfunction cellClasses(base: 'wr-table__th' | 'wr-table__td', column: Pick<WrTableColumn, 'align' | 'class'>): string {\n const own = column.align ? `${base} ${base}--align-${column.align}` : base;\n return column.class ? wrToClassList(own, column.class).join(' ') : own;\n}\n\n/** A flat row descriptor with the tree fields at their flat-table defaults. */\nfunction flatRow(row: Record<string, unknown>, id: string, posinset: number, setsize: number): RenderRow {\n return { kind: 'row', id, row, depth: 0, parent: false, open: null, posinset, setsize };\n}\n\n/**\n * Data table with sortable / filterable headers and custom cell templates.\n *\n * Columns are defined via the `columns` input (a `Record<key, column>`).\n * Rows are objects whose property names match the column keys. Cells can\n * be customised by projecting an `[wrTableCell]=\"key\"` template.\n *\n * @example\n * ```html\n * <wr-table\n * [columns]=\"columns\"\n * [items]=\"rows\"\n * [(sort)]=\"sort\"\n * (filterChange)=\"onFilter($event)\"\n * >\n * <ng-template wrTableCell=\"role\" let-value>\n * <wr-tag [color]=\"value === 'admin' ? 'danger' : null\">{{ value }}</wr-tag>\n * </ng-template>\n * </wr-table>\n * ```\n *\n * @see https://ngwr.dev/reference/components/table\n */\n@Component({\n selector: 'wr-table',\n templateUrl: './table.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-table',\n '[class.wr-table--responsive]': 'responsive()',\n '[class.wr-table--virtual]': 'virtualized()',\n '[class.wr-table--sticky-head]': 'scrollable()',\n '[class.wr-table--fill]': 'fillsParent()',\n '[class.wr-table--overflow-start]': 'overflow().start',\n '[class.wr-table--overflow-end]': 'overflow().end',\n '[class.wr-table--selection-bar]': 'selectionBar() !== null',\n // The rows under the veil are stale while a load is in flight, and nothing\n // said so: the veil marked itself, not the table it covers. Same pairing as\n // `wr-card` — mark busy, don't block (the veil is `pointer-events: none`).\n '[attr.aria-busy]': 'loading() ? true : null',\n // The treegrid's row keyboard, delegated: one listener pair for the whole\n // table rather than one per row, and both return at once outside tree mode.\n '(keydown)': 'onTreeKeydown($event)',\n '(focusin)': 'onTreeFocusin($event)',\n },\n imports: [\n NgTemplateOutlet,\n CdkDropList,\n CdkDrag,\n WrButton,\n WrCheckbox,\n WrPagination,\n WrTableColumnChooser,\n WrPopover,\n WrSpinner,\n WrTableSort,\n WrTableFilter,\n ],\n})\nexport class WrTable<T extends WrTableRow = WrTableRow> {\n /**\n * Column definitions, keyed by row property name. Typed against the row\n * `[items]` carries, so a column's `format` sees it: `WrTableColumns<User>`\n * binds to `[items]=\"users\"` and to nothing else, while a bare\n * `WrTableColumns` still binds anywhere.\n */\n readonly columns = input.required<WrTableColumns<T>>();\n\n /**\n * Row items. `null`/`undefined` renders the empty state; use `[loading]` for\n * the spinner.\n *\n * `T` is inferred from here, and it is constrained to `WrTableRow`\n * (= `object`) rather than `Record<string, unknown>`, so an array of an\n * `interface` binds as readily as an array of a `type` — see\n * {@link WrTableRow} for why those two are not the same to TypeScript.\n */\n readonly items = input<readonly T[] | null | undefined>(null);\n\n /**\n * The rows as records, for everything downstream that reads a cell by key.\n *\n * One cast at the boundary: the INPUT is wide so any object shape binds, while\n * the body keeps indexing rows the way it always has.\n */\n private readonly rows = computed<readonly Record<string, unknown>[] | null | undefined>(\n () => this.items() as unknown as readonly Record<string, unknown>[] | null | undefined\n );\n\n /** Mark the table as loading; `loadingMode` picks how it shows. @default false */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * How `loading` shows. `'overlay'` veils the table under a spinner. `'bar'`\n * runs a thin progress bar along the top edge and leaves the rows as they\n * are, for a table that refreshes while it is being read. `'auto'` is the\n * overlay while no row is shown and the bar once rows are. The host carries\n * `aria-busy` in every form.\n * @default 'auto'\n */\n readonly loadingMode = input<WrTableLoadingMode>('auto');\n\n /** The form `loading` takes right now, `null` while nothing loads. */\n protected readonly loadingForm = computed<'overlay' | 'bar' | null>(() => {\n if (!this.loading()) return null;\n const mode = this.loadingMode();\n if (mode !== 'auto') return mode;\n return this.renderRows().length ? 'bar' : 'overlay';\n });\n\n /**\n * Collapse each row to a labelled card when the table's own box is too narrow\n * for columns (a container query on its own width, not the viewport). Every\n * cell shows its column title as a label. @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Enable drag-to-reorder on the column headers. @default false */\n readonly reorderable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Two-way bindable column order — an array of column keys. Reflects and drives\n * the header order: the table falls back to declaration order for any key not\n * listed, and updates this on drag. Bind it to persist a user's arrangement.\n */\n readonly columnOrder = model<readonly string[]>([]);\n\n /**\n * Two-way bindable hidden columns, an array of column keys. A hidden column\n * renders nothing: no header, no cell, no summary, no `<col>`. Its sort and\n * its filter selection stay as they are, and `toCsv()` leaves it out. A\n * column with `hideable: false` is shown whatever this lists, and so is the\n * first column when the list would leave none. Bind it beside `columnOrder`\n * to persist a user's arrangement.\n */\n readonly hiddenColumns = model<readonly string[]>([]);\n\n /**\n * Show a toolbar above the table with a button that opens the column\n * chooser: one checkbox per column, in column order, named by the column's\n * title. A `hideable: false` column and the last visible one cannot be\n * unchecked. Each toggle writes `hiddenColumns`. @default false\n */\n readonly columnChooser = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Row selection with a leading checkbox column — `'multiple'` adds a\n * select-all header; `'single'` keeps one row selected. @default null (off)\n */\n readonly rowSelection = input<'single' | 'multiple' | null>(null);\n\n /**\n * What the header select-all covers. `'page'` is the rows on screen: the\n * current page, less a collapsed group's rows and a closed parent's children.\n * `'all'` is the same rule over every page of `items`, so the box reads\n * checked only when all of them are selected, mixed when some are, and one\n * click selects or clears them all. Either way a selected key that is not in\n * the scope stays selected.\n *\n * The table filters nothing itself: `items` is already what the filters left,\n * so `'all'` never reaches a row a filter removed. Group band checkboxes keep\n * their page scope, since grouping runs after pagination.\n *\n * In server mode (`total` set) the table holds one page and cannot name the\n * rows of the others, so `'all'` behaves as `'page'` there.\n * @default 'page'\n */\n readonly selectAllScope = input<'page' | 'all'>('page');\n\n /**\n * Extra CSS classes per body row, from the row and its drawn index.\n *\n * The `<tr>` is ngwr's own element and there is no template slot that renders\n * as one, so this is the only way to mark a row — overdue, unsaved, over\n * budget — without a rule that has to re-derive the condition in CSS.\n *\n * It does NOT touch the detail row an expanded row opens, the group header or\n * the summary row: each of those is a sibling `<tr>` with its own meaning, and\n * a row predicate that painted them too would stripe a table's totals.\n */\n readonly rowClass = input<WrTableRowClass | null>(null);\n\n /**\n * How to identify a row for selection — a property name or a function.\n * Unset uses the row object itself (fine for a stable row array).\n */\n readonly rowKey = input<string | ((row: Record<string, unknown>) => unknown) | null>(null);\n\n /** Two-way bindable selected row keys. */\n readonly selection = model<readonly unknown[]>([]);\n\n /** Two-way bindable expanded row keys (needs a `[wrTableExpand]` template). */\n readonly expanded = model<readonly unknown[]>([]);\n\n /**\n * Group rows under collapsible band headers — a row property name, or a\n * function returning the group value. `null` (default) renders the table\n * exactly as before.\n *\n * Grouping runs AFTER pagination: it buckets the rows on the current page in\n * first-appearance order (it never re-sorts your data — same contract as\n * `[(sort)]`), so a group straddling a page boundary shows a band on both\n * pages, and per-group counts / subtotals are page-scoped. Sort `items` by the\n * same key upstream to keep groups whole, or pair with `pageSize = 0`.\n *\n * Group values are compared by identity (`Map`/`Set`, SameValueZero) — return\n * a primitive, exactly as for `rowKey`. Objects / `Date`s bucket by reference.\n *\n * @default null\n */\n readonly groupBy = input<string | ((row: Record<string, unknown>) => unknown) | null>(null);\n\n /**\n * Render the rows as a hierarchy: names the property (or computes the array)\n * holding each row's children. `items` then means the ROOTS, and the forest is\n * flattened depth-first into the same `<tbody>` — child rows are ordinary\n * `<tr>`s going through the same cell loop, so column pin / resize /\n * drag-reorder and `[wrTableCell]` templates keep working at every depth.\n *\n * Open state reuses the `expanded` model and row identity reuses `rowKey`, so\n * a tree needs no second key space. Everything collapsed is the default.\n *\n * **Mutually exclusive with `groupBy`** — a forest has no flat list to bucket,\n * so grouping wins and the hierarchy is ignored while it is set. Also\n * mutually exclusive with `[wrTableExpand]` detail rows: both own the row's\n * disclosure affordance.\n *\n * `pageSize` pages the ROOTS; a root brings its open descendants with it.\n *\n * The function form RETURNS `WrTableRow`s, matching `[items]`: a return is\n * covariant, so an array of `interface`-typed children satisfies it. Declared\n * as records it did not, and a forest that bound to `[items]` could not hand\n * its children back out. The PARAMETER stays `Record<string, unknown>` — that\n * side is contravariant, and widening it would reject the callbacks that\n * compile today while leaving `row['reports']` unindexable. See\n * {@link WrTableRow}.\n *\n * @example\n * ```html\n * <wr-table\n * rowKey=\"id\"\n * childrenKey=\"reports\"\n * treeColumn=\"name\"\n * [columns]=\"columns\"\n * [items]=\"org\"\n * [(expanded)]=\"open\"\n * />\n * ```\n */\n readonly childrenKey = input<\n string | ((row: Record<string, unknown>) => readonly WrTableRow[] | null | undefined) | null\n >(null);\n\n /**\n * Which column carries the indent and the expand toggle. Keyed, not\n * positional, so it survives a `columnOrder` drag. Defaults to whichever\n * column renders first.\n */\n readonly treeColumn = input<string | null>(null);\n\n /**\n * The action word that names a parent row's expand toggle. The row's own label\n * cell is joined to it, so the toggle reads \"Toggle child rows Engineering\"\n * rather than one name shared by every row. Falls back to `table.toggleRow`.\n */\n readonly toggleRowLabel = input<string | null>(null);\n\n /**\n * Two-way bindable collapsed group values (the values `groupBy` returns).\n * Keyed by value, so a collapsed group stays collapsed across page changes and\n * re-sorts. Empty (the default) shows every group expanded.\n */\n readonly collapsedGroups = model<readonly unknown[]>([]);\n\n /**\n * Render an aggregate row under each group using the same `column.summary`\n * definitions as the grand footer, computed over that group's rows on the\n * current page. No-op unless at least one column defines a `summary`. The grand\n * `<tfoot>` is unaffected and still aggregates the whole client dataset — with\n * client-side pagination the two describe different scopes, so pair grouping\n * with `pageSize = 0` when you need them to reconcile. A summary FUNCTION tells\n * the two apart by its second argument, `{ scope: 'group' | 'total' }` — see\n * `WrTableSummaryContext`. @default false\n */\n readonly groupSummary = input(false, { transform: coerceBooleanProperty });\n\n /** Show the page-scoped row-count badge in each group band. @default true */\n readonly showGroupCount = input(true, { transform: coerceBooleanProperty });\n\n /** Two-way bindable sort array. Order in array = application order. */\n readonly sort = model<readonly WrTableSortState[]>([]);\n\n /** Text shown when there are no rows. Falls back to `table.empty`. */\n readonly emptyLabel = input<string | null>(null);\n\n /** Accessible name of a column's sort button. Falls back to `table.sort`. */\n readonly sortLabel = input<string | null>(null);\n\n /** Accessible name of the select-all checkbox. Falls back to `table.selectAll`. */\n readonly selectAllLabel = input<string | null>(null);\n\n /**\n * The action word that names a row's select checkbox. The row's label cell is\n * joined to it through `aria-labelledby` — \"Select row Ada\" — since one name\n * repeated down every row tells a screen reader nothing about which row a box\n * belongs to. Falls back to `table.selectRow`.\n */\n readonly selectRowLabel = input<string | null>(null);\n\n /**\n * The action word that names a row's detail toggle, joined to the row's label\n * cell like `selectRowLabel`. Falls back to `table.expandRow`.\n */\n readonly expandRowLabel = input<string | null>(null);\n\n /**\n * The action word that names a group band's select checkbox. The group's label\n * is joined to it — \"Select group EMEA\". Falls back to `table.selectGroup`.\n */\n readonly selectGroupLabel = input<string | null>(null);\n\n /**\n * The action word that names a group band's collapse toggle, joined to the\n * group's label like `selectGroupLabel`. Falls back to `table.toggleGroup`.\n */\n readonly toggleGroupLabel = input<string | null>(null);\n\n /** Accessible name of the loading overlay or bar. Falls back to `table.loading`. */\n readonly loadingLabel = input<string | null>(null);\n\n /**\n * Text of the selection bar's count, with `{{count}}` where the number goes.\n * Falls back to `table.selected`.\n */\n readonly selectedLabel = input<string | null>(null);\n\n /** Text of the selection bar's clear button. Falls back to `table.clearSelection`. */\n readonly clearSelectionLabel = input<string | null>(null);\n\n /** Text of the column chooser's button and name of its panel. Falls back to `table.columns`. */\n readonly columnsLabel = input<string | null>(null);\n\n protected readonly resolvedEmptyLabel = useI18nText(this.emptyLabel, 'table.empty', 'No data');\n /**\n * The loading overlay was a bare spinner in a `<div>` — a busy state with no\n * accessible name, which a screen reader reports as nothing at all while the\n * table sits empty. `table.loading` shipped in both catalogs for it and was\n * never read.\n */\n protected readonly resolvedLoadingLabel = useI18nText(this.loadingLabel, 'table.loading', 'Loading…');\n protected readonly resolvedColumnsLabel = useI18nText(this.columnsLabel, 'table.columns', 'Columns');\n protected readonly resolvedClearSelectionLabel = useI18nText(\n this.clearSelectionLabel,\n 'table.clearSelection',\n 'Clear selection'\n );\n private readonly selectedText = useI18nFormatter('table.selected', '{{count}} selected');\n private readonly sortText = useI18nFormatter('table.sort', 'Sort {{column}}');\n\n /**\n * The sort button's accessible name, with the COLUMN in it.\n *\n * It used to be one static string on every sortable header, so a header row\n * with three of them offered a screen reader three buttons called \"Sort\n * column\". An `aria-label` replaces content, so the title sitting next to\n * the caret reached a sighted reader and nobody else. A consumer's own\n * `sortLabel` still wins whole, unformatted — it is their string.\n */\n protected sortLabelFor(column: string): string {\n return this.sortLabel() ?? this.sortText({ column });\n }\n protected readonly resolvedSelectAllLabel = useI18nText(this.selectAllLabel, 'table.selectAll', 'Select all rows');\n protected readonly resolvedSelectRowLabel = useI18nText(this.selectRowLabel, 'table.selectRow', 'Select row');\n protected readonly resolvedExpandRowLabel = useI18nText(this.expandRowLabel, 'table.expandRow', 'Toggle row details');\n protected readonly resolvedToggleRowLabel = useI18nText(this.toggleRowLabel, 'table.toggleRow', 'Toggle child rows');\n protected readonly resolvedSelectGroupLabel = useI18nText(this.selectGroupLabel, 'table.selectGroup', 'Select group');\n protected readonly resolvedToggleGroupLabel = useI18nText(this.toggleGroupLabel, 'table.toggleGroup', 'Toggle group');\n\n // --- Control names ----------------------------------------------------------\n //\n // Every row control used to share one generic name: ten checkboxes called\n // \"Select row\" and ten chevrons called \"Toggle child rows\", so a screen reader\n // moving down the selection column heard the same word ten times and never the\n // row. Each control now points `aria-labelledby` at TWO ids — an action word,\n // rendered once per table as hidden text, and the row's own label cell — which\n // is the one ARIA mechanism that joins two elements into a name.\n\n /** Prefix of every id this table renders. Counted, so SSR and the client agree. */\n private readonly uid = `wr-table-${tableUid++}`;\n\n /** Id of the hidden action word one kind of row control is named with. */\n protected actionId(action: 'select-row' | 'expand-row' | 'toggle-row' | 'select-group' | 'toggle-group'): string {\n return `${this.uid}-${action}`;\n }\n\n /**\n * Id of a row's label cell, from the row descriptor's id — which is its place\n * in the flattened body (`r3`, `g1r0`, `r0-r2`), deterministic per render.\n */\n protected rowLabelId(rowId: string): string {\n return `${this.uid}-${rowId}-label`;\n }\n\n /** Id of a group band's label — the visible one, or a hidden copy beside a custom header. */\n protected groupLabelId(groupId: string): string {\n return `${this.uid}-${groupId}-label`;\n }\n\n /** Id of a group band's row-count badge, which the built-in toggle's name ends with. */\n protected groupCountId(groupId: string): string {\n return `${this.uid}-${groupId}-count`;\n }\n\n /**\n * The column whose cell names its row: the tree column in tree mode — the one\n * carrying the hierarchy, and the first rendered column unless `treeColumn`\n * says otherwise — and the first rendered column everywhere else.\n *\n * Keyed rather than positional, like `treeColumn`, so it follows a\n * `columnOrder` drag.\n */\n protected readonly labelColumnKey = computed<string | null>(\n () => this.treeColumnKey() ?? this.displayColumns()[0]?.key ?? null\n );\n\n /**\n * `aria-labelledby` of the built-in group toggle: the action word, the group's\n * label, and its row count while the badge shows — the count the toggle's own\n * text used to carry, which `aria-labelledby` would otherwise replace.\n */\n protected groupToggleLabelledby(groupId: string): string {\n const parts = [this.actionId('toggle-group'), this.groupLabelId(groupId)];\n if (this.showGroupCount()) parts.push(this.groupCountId(groupId));\n return parts.join(' ');\n }\n\n /** `aria-labelledby` of a row control: its action word, then the row's label cell. */\n protected rowControlLabelledby(action: 'select-row' | 'expand-row' | 'toggle-row', rowId: string): string {\n return `${this.actionId(action)} ${this.rowLabelId(rowId)}`;\n }\n\n /** `aria-labelledby` of a group band's checkbox, or of the toggle beside a custom header. */\n protected groupControlLabelledby(action: 'select-group' | 'toggle-group', groupId: string): string {\n return `${this.actionId(action)} ${this.groupLabelId(groupId)}`;\n }\n\n /** Fires whenever a column's filter selection changes. */\n readonly filterChange = output<WrTableFilterChange>();\n\n /**\n * Restores the table in one write: the sort, each column's filter selection,\n * the page, the page size, the column order and the hidden columns. A saved\n * view binds here. It is applied when the bound object changes, so hand it a\n * new object to restore the same view a second time; a key left out keeps\n * what the table has. The models it writes fire their own `*Change`, and\n * `pageSizeChange` fires for a new size; `filterChange` and `stateChange` do\n * not, since the host already holds what it restored. Pairs with\n * `stateChange` as `[(state)]`.\n * @default null\n */\n readonly state = input<Partial<WrTableState> | null>(null);\n\n /**\n * Fires with the whole state after a change the reader makes: a sort, a\n * filter, a page, a page size, a column drag, a column shown or hidden. One\n * action is one event, so a new page size that also moves the page fires\n * once. A write from the host, through `state` or a model, does not fire.\n */\n readonly stateChange = output<WrTableState>();\n\n /** Bumped by every reader action `stateChange` reports. */\n private readonly readerChanges = signal(0);\n\n /** The last state emitted, which comes straight back under `[(state)]`. */\n private emittedState: WrTableState | null = null;\n\n private currentState(): WrTableState {\n const filters: Record<string, readonly unknown[]> = {};\n for (const [key, column] of Object.entries(this.columns())) {\n const selected = column.filterItems?.filter(item => item.selected).map(item => item.value);\n if (selected?.length) filters[key] = selected;\n }\n return {\n sort: this.sort(),\n filters,\n page: this.page(),\n pageSize: this.currentPageSize(),\n columnOrder: this.columnOrder(),\n hiddenColumns: this.hiddenColumns(),\n };\n }\n\n private restoreState(state: Partial<WrTableState>): void {\n const { sort, filters, page, pageSize, columnOrder, hiddenColumns } = state;\n if (\n sort &&\n !(\n sort.length === this.sort().length &&\n sort.every((entry, i) => entry.key === this.sort()[i].key && entry.direction === this.sort()[i].direction)\n )\n ) {\n this.sort.set(sort);\n }\n if (columnOrder && !sameList(columnOrder, this.columnOrder())) this.columnOrder.set(columnOrder);\n if (hiddenColumns && !sameList(hiddenColumns, this.hiddenColumns())) this.hiddenColumns.set(hiddenColumns);\n if (pageSize !== undefined && pageSize !== this.currentPageSize()) {\n this.currentPageSize.set(pageSize);\n this.pageSizeChange.emit(pageSize);\n }\n if (page !== undefined && page !== this.page()) this.page.set(page);\n if (filters) {\n let changed = false;\n for (const [key, column] of Object.entries(this.columns())) {\n const wanted = new Set(filters[key] ?? []);\n for (const item of column.filterItems ?? []) {\n const selected = wanted.has(item.value);\n if (!!item.selected === selected) continue;\n item.selected = selected;\n changed = true;\n }\n }\n if (changed) markFilterSelectionChanged();\n }\n }\n\n /**\n * Fires when a body row is clicked, with the row, its index in `items` and the\n * click. Group bands, summary rows and detail rows do not fire it.\n *\n * A click on an interactive element inside the row is that element's own and\n * does not fire: a button, a link, a form field, a label, `[role=button]`,\n * editable content, the table's own toggles and its selection and expand\n * cells. Mark anything else with the `wrTableIgnoreRowClick` attribute,\n * which needs no import: `<app-menu wrTableIgnoreRowClick />`.\n *\n * Pointer only: a row takes no focus and no key for it, so give the same\n * action a control of its own in the row (a link or a button in a cell) for\n * keyboard and screen reader users. The table adds no cursor either: style\n * `.wr-table__tr` when the rows are clickable.\n */\n readonly rowClick = output<WrTableRowClick<T>>();\n\n protected onBodyClick(event: MouseEvent): void {\n const target = event.target as Element;\n const index = this.rowEls().findIndex(el => el.nativeElement.contains(target));\n if (index < 0) return;\n const tr = this.rowEls()[index].nativeElement;\n const control = target.closest(ROW_CLICK_IGNORE);\n if (control && control !== tr && tr.contains(control)) return;\n const row = this.windowRows().filter(entry => entry.kind === 'row')[index];\n if (row?.kind !== 'row') return;\n const item = row.row;\n this.rowClick.emit({ row: item as unknown as T, index: this.rows()?.indexOf(item) ?? -1, event });\n }\n\n /**\n * Rows per page. Set to `0` (default) to disable client-side pagination\n * and render every row at once.\n */\n readonly pageSize = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Sizes the pager offers in a size menu. Empty (default) shows no menu. A size\n * the reader picks pages the rows at once and fires `pageSizeChange`, so\n * `[(pageSize)]` keeps it on the host; the page moves to keep the first visible\n * row on screen.\n *\n * @example\n * ```html\n * <wr-table [columns]=\"columns\" [items]=\"rows\" [(pageSize)]=\"size\" [pageSizeOptions]=\"[10, 25, 50]\" />\n * ```\n */\n readonly pageSizeOptions = input<readonly number[]>([]);\n\n /** Size of the pager under the table: its cells and its size menu. @default 'sm' */\n readonly paginationSize = input<WrPaginationSize>('sm');\n\n /** Fires with the size the reader picks in the pager's size menu. */\n readonly pageSizeChange = output<number>();\n\n /** The size in force: the bound `pageSize`, until the reader picks another. */\n protected readonly currentPageSize = linkedSignal(() => this.pageSize());\n\n /** Two-way bindable 1-based current page. */\n readonly page = model<number>(1);\n\n /**\n * Total row count for server-side pagination — when set, the table\n * shows the pager but does NOT slice `items` (you provide the current\n * page's slice yourself and react to `(page)` changes).\n *\n * Spelled `total` / `page` to match `<wr-pagination>`, which is the control\n * this input renders. The two used to disagree about both words — `totalItems`\n * / `page` here against `total` / `currentPage` there — which is a real cost\n * for two components designed to sit on one screen. `null` rather than `0` is\n * the difference that remains, and it carries meaning: it is the OFF switch\n * for server mode, where the pager's own `total` is a count and `0` means an\n * empty list.\n */\n readonly total = input<number | null>(null);\n\n /**\n * Window the `<tbody>` so a table of thousands of rows keeps only ~one\n * viewport of `<tr>`s in the DOM. Opt-in and OFF by default — a table\n * without it renders byte-identically to today.\n *\n * Engages ONLY on the flat, fixed-height tier: it silently falls back to the\n * full render whenever a variable-height layout is active — `groupBy`, tree\n * rows (`childrenKey`), a `[wrTableExpand]` template, `responsive` card mode,\n * or a visible pager (`pageSize > 0` / `total`). While on, it forces fixed layout for\n * stable column widths and assumes a uniform row height (see `rowHeight`).\n *\n * Intended as static config. Give columns an explicit `width` so the frozen\n * layout is exact (a virtualized table always renders fixed-layout); toggling\n * it off at runtime leaves the frozen widths in place as column minimums.\n * @default false\n */\n readonly virtualScroll = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Uniform body-row height in px used to map scroll offset to row index. `0`\n * (default) measures the first rendered row once — matching the density at\n * that point — and reuses it; pass an explicit value to remove the\n * post-hydration measure and make SSR pixel-exact (recommended if the density\n * can change at runtime). Read only when `virtualScroll` is on. Keep\n * virtualized cells single-line and no taller than this — a taller custom\n * `[wrTableCell]` template drifts the window. @default 0\n */\n readonly rowHeight = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Gives the table its own vertical scroll area, with the header row stuck to\n * its top and the summary footer to its bottom, in every mode: plain, paged,\n * grouped, tree, with pinned columns or selection. The pager stays below the\n * scroll area. `viewportHeight` sizes it. A virtualized table already\n * scrolls this way, so the input adds nothing there.\n * @default false\n */\n readonly stickyHeader = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Height of the scroll area when `virtualScroll` or `stickyHeader` is on — a\n * number (px), any CSS length (`'70vh'`) or `'fill'`. A length is applied as\n * `max-height` on `.wr-table__scroll` through `--wr-table-scroll-height` (a\n * short table shrinks to fit; a long one caps and scrolls). `'fill'` takes\n * the height the parent has left instead: the parent must be a flex column\n * with a definite height (every flex ancestor up the chain needs\n * `min-height: 0`), or a block with a definite height. The table then never\n * shrinks below `--wr-table-scroll-min-height`. A numeric px value lets the\n * server prerender the exact first window of a virtualized table.\n * @default 480\n */\n readonly viewportHeight = input<number | string>(480);\n\n /** Extra rows kept rendered above and below the viewport as scroll headroom. @default 6 */\n readonly overscan = input(6, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 6)) });\n\n /** Total row count derived for the pager (server-mode wins). */\n protected readonly resolvedTotal = computed<number>(() => {\n const server = this.total();\n if (server !== null) return server;\n return this.rows()?.length ?? 0;\n });\n\n /** Items visible on the current page (client mode slices; server mode passes through). */\n protected readonly visibleItems = computed<readonly Record<string, unknown>[] | null | undefined>(() => {\n const items = this.rows();\n if (!items) return items;\n const size = this.currentPageSize();\n if (size <= 0 || this.total() !== null) return items;\n // Clamped at BOTH ends, because `page` is a model the host owns (a `model()`\n // takes no transform) and the data can shrink under it — a filter or a delete\n // used to leave the table showing an empty slice with no way back except\n // paging by hand. The pager clamps its own number downwards only, and it is\n // not even rendered once the data drops below one page. Below 1 the offset\n // goes negative, and `Array.slice` reads a negative start from the END: page\n // 0 emptied the table and page -1 rendered a window counted from the back,\n // with the pager highlighting nothing. `|| 1` folds `0` and `NaN` in.\n const lastPage = Math.max(1, Math.ceil(items.length / size));\n const page = Math.min(Math.max(1, this.page() || 1), lastPage);\n const start = (page - 1) * size;\n return items.slice(start, start + size);\n });\n\n /** Show the pager footer only when paging is enabled and rows overflow. */\n protected readonly showPager = computed<boolean>(() => {\n const size = this.currentPageSize();\n if (size <= 0) return false;\n // With a size menu the pager stays while any size on offer would page the\n // rows, so a reader who picked the largest one can still pick a smaller one.\n const options = this.pageSizeOptions();\n return this.resolvedTotal() > (options.length > 0 ? Math.min(size, ...options) : size);\n });\n\n protected onPageSizeChange(size: number): void {\n const previous = this.currentPageSize();\n if (size === previous) return;\n const firstRow = (Math.max(1, this.page() || 1) - 1) * previous;\n this.currentPageSize.set(size);\n this.page.set(Math.floor(firstRow / size) + 1);\n this.pageSizeChange.emit(size);\n this.readerChanges.update(n => n + 1);\n }\n\n protected onPagerPage(page: number): void {\n this.page.set(page);\n this.readerChanges.update(n => n + 1);\n }\n\n /**\n * Typed at the context's own default: the directive's `T` is whatever each\n * template declared, and the table hands every one the same record.\n */\n private readonly cellTemplates = contentChildren<WrTableCell<Record<string, unknown>>>(WrTableCell);\n\n /** Map of column key → custom template (if provided via `[wrTableCell]`). */\n protected readonly cellMap = computed(() => {\n const map = new Map<string, TemplateRef<WrTableCellContext>>();\n for (const cell of this.cellTemplates()) map.set(cell.columnKey(), cell.template);\n return map;\n });\n\n private readonly editTemplates = contentChildren<WrTableEditCell<Record<string, unknown>>>(WrTableEditCell);\n\n /** Map of column key → editor template (if provided via `[wrTableEditCell]`). */\n private readonly editMap = computed(() => {\n const map = new Map<string, TemplateRef<WrTableEditCellContext>>();\n for (const cell of this.editTemplates()) map.set(cell.columnKey(), cell.template);\n return map;\n });\n\n // --- Column pinning -------------------------------------------------------\n\n private readonly platformId = inject(PLATFORM_ID);\n private readonly headerCells = viewChildren<ElementRef<HTMLElement>>('thCell');\n\n /**\n * Ambient reading direction, for the two header gestures that travel the\n * inline axis: the resize drag and the CDK's drop-slot index.\n *\n * Optional so a bare `TestBed` — or a consumer who never set a direction —\n * needs no provider; `Directionality` is root-provided anyway, and a missing\n * one reads as `ltr`. Read per gesture rather than cached, so a runtime `dir`\n * flip needs no subscription to `change`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n\n /**\n * Every column in order, hidden ones included — declaration order, overridden\n * by `columnOrder` once reordered; new keys append, removed keys drop out.\n */\n private readonly orderedColumns = computed<readonly { key: string; column: WrTableColumn<T> }[]>(() => {\n const cols = this.columns();\n const seen = new Set<string>();\n const result: { key: string; column: WrTableColumn<T> }[] = [];\n for (const key of this.columnOrder()) {\n if (Object.hasOwn(cols, key) && !seen.has(key)) {\n result.push({ key, column: cols[key] });\n seen.add(key);\n }\n }\n for (const key of Object.keys(cols)) {\n if (!seen.has(key)) {\n result.push({ key, column: cols[key] });\n seen.add(key);\n }\n }\n return result;\n });\n\n /**\n * Columns in render order: {@link orderedColumns} less `hiddenColumns`. Pin\n * and resize measurement key off this, so it must equal the rendered order.\n * The same array as `orderedColumns()` while nothing is hidden.\n */\n protected readonly displayColumns = computed<readonly { key: string; column: WrTableColumn<T> }[]>(() => {\n const ordered = this.orderedColumns();\n const hidden = new Set(this.hiddenColumns());\n if (hidden.size === 0) return ordered;\n const shown = ordered.filter(c => c.column.hideable === false || !hidden.has(c.key));\n if (shown.length === ordered.length) return ordered;\n // A table with columns always draws one.\n return shown.length > 0 ? shown : ordered.slice(0, 1);\n });\n\n /**\n * One entry per column in column order, hidden ones included: what a column\n * chooser lists. `<wr-table-column-chooser>` reads it, and so can a menu of\n * your own.\n */\n readonly chooserColumns = computed<readonly WrTableChooserColumn[]>(() => {\n const shown = new Set(this.displayColumns().map(c => c.key));\n return this.orderedColumns().map(({ key, column }) => {\n const hidden = !shown.has(key);\n return {\n key,\n title: column.title || (column.headerHint ?? key),\n hidden,\n hideable: column.hideable !== false,\n locked: column.hideable === false || (!hidden && shown.size === 1),\n };\n });\n });\n\n /**\n * Hide a shown column or show a hidden one, as its checkbox in the column\n * chooser does: it writes `hiddenColumns` and reports a `stateChange`. A\n * locked column (`hideable: false`, or the last one shown) stays as it is.\n */\n toggleColumn(key: string): void {\n const entry = this.chooserColumns().find(c => c.key === key);\n if (!entry || entry.locked) return;\n const hidden = this.hiddenColumns().filter(k => k !== key);\n this.hiddenColumns.set(entry.hidden ? hidden : [...hidden, key]);\n this.readerChanges.update(n => n + 1);\n }\n\n /**\n * Write `hiddenColumns` as a reader action, so `stateChange` reports it. A\n * `hideable: false` column is left out of the list, and so is the first\n * column when the list would hide every one.\n */\n setHiddenColumns(keys: readonly string[]): void {\n const asked = new Set(keys);\n const ordered = this.orderedColumns();\n const hideable = ordered.filter(c => c.column.hideable !== false);\n const next = hideable.filter(c => asked.has(c.key)).map(c => c.key);\n if (ordered.length > 0 && next.length === ordered.length) next.shift();\n if (sameList(next, this.hiddenColumns())) return;\n this.hiddenColumns.set(next);\n this.readerChanges.update(n => n + 1);\n }\n\n /**\n * Sticky offsets for pinned columns, measured from the header cells so any\n * number of columns can stack per side. Also names the inner-edge column on\n * each side (where the separating shadow sits). Empty until measured in the\n * browser; on the server the pins stay at offset 0, corrected on hydration.\n */\n private readonly pins = signal<{\n left: ReadonlyMap<string, number>;\n right: ReadonlyMap<string, number>;\n leftEdge: string | null;\n rightEdge: string | null;\n }>({ left: new Map(), right: new Map(), leftEdge: null, rightEdge: null });\n\n /**\n * Every template the content declares, registered or not. An unknown\n * `[wrTableCell]` on an `<ng-template>` compiles under `strictTemplates`: a\n * binding on a template is an input for whichever directive claims it, and\n * the compiler reports nothing when none does. The column then shows the raw\n * value and nothing says why, so the dev-mode check below looks for a\n * projected `<ng-template>` no table directive picked up.\n *\n * The query sees more than those. `@if` / `@for` / `@switch` blocks are\n * templates too, and it also reaches into every view made from a projected\n * template, so each rendered cell adds the blocks inside it.\n */\n private readonly projectedTemplates = contentChildren(TemplateRef);\n\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('table');\n // Native and delegated: a template listener would run change detection on\n // every `mouseover` inside the table, and one per cell is what this avoids.\n effect(onCleanup => {\n if (!this.hasTips() || !isPlatformBrowser(this.platformId)) return;\n const host = this.hostEl.nativeElement;\n const listener = (event: Event): void => this.onTipTarget(event);\n host.addEventListener('mouseover', listener);\n host.addEventListener('focusin', listener);\n onCleanup(() => {\n host.removeEventListener('mouseover', listener);\n host.removeEventListener('focusin', listener);\n });\n });\n // A cell removed under the pointer fires no `mouseleave` to close its tooltip.\n effect(() => {\n const tip = this.tip();\n if (!tip) return;\n this.windowRows();\n this.displayColumns();\n afterNextRender(\n () => {\n if (!tip.el.isConnected && untracked(this.tip) === tip) this.tip.set(null);\n },\n { injector: this.injector }\n );\n });\n // An edit whose cell left the screen ends. A row the virtual window\n // dropped still commits, like any other way of leaving the cell; a row or\n // a column that is gone has nothing to commit to.\n effect(() => {\n const edit = this.editing();\n if (!edit) return;\n const column = this.cellColumns().some(c => c.key === edit.key && c.editTemplate);\n if (column && this.dataRows().some(entry => entry.row === edit.row)) return;\n const windowed = column && this.renderRows().some(entry => entry.kind === 'row' && entry.row === edit.row);\n untracked(() => this.endEdit(windowed, 'inside'));\n });\n effect(() => {\n this.sort();\n untracked(() => this.endEdit(false, 'inside'));\n });\n // Capture-phase and on the document: the click that leaves the cell may\n // land on something that stops it.\n effect(onCleanup => {\n const edit = this.editing();\n if (!edit || !isPlatformBrowser(this.platformId)) return;\n const doc = this.hostEl.nativeElement.ownerDocument;\n const inside = (target: EventTarget | null): boolean =>\n target instanceof Node &&\n (edit.td.contains(target) || (target instanceof Element && !!target.closest('.cdk-overlay-container')));\n // A press that started in the editor and ended outside (a text\n // selection dragged past the cell) is not a click outside.\n let pressedInside: boolean | null = null;\n const onPress = (event: Event): void => {\n pressedInside = inside(event.target);\n };\n const onClick = (event: Event): void => {\n const within = pressedInside ?? inside(event.target);\n pressedInside = null;\n if (!within) this.endEdit(true, false);\n };\n doc.addEventListener('pointerdown', onPress, true);\n doc.addEventListener('click', onClick, true);\n onCleanup(() => {\n doc.removeEventListener('pointerdown', onPress, true);\n doc.removeEventListener('click', onClick, true);\n });\n });\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n afterNextRender(() => {\n const claimed = new Set<unknown>(\n [\n ...this.cellTemplates(),\n ...this.editTemplates(),\n this.expandTpl(),\n this.groupTpl(),\n this.selectionBarTpl(),\n ].map((dir): unknown => dir?.template.elementRef.nativeElement)\n );\n // The content is never projected, so its anchors stay out of the DOM.\n // An anchor inside the host belongs to a view the table rendered.\n const host = this.hostEl.nativeElement;\n const declared = this.projectedTemplates().filter(\n tpl => isNgTemplateElement(tpl) && !host.contains(tpl.elementRef.nativeElement as Node)\n );\n const stray = declared.filter(tpl => !claimed.has(tpl.elementRef.nativeElement)).length;\n if (stray === 0) return;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-table>: ${stray} of ${declared.length} projected <ng-template>(s) registered with no table directive and will be ignored. ` +\n 'Import `WrTableCell` (or `WrTableEditCell` / `WrTableExpand` / `WrTableGroupHeader` / `WrTableSelectionBar`) beside `WrTable` in the component that declares the template.'\n );\n });\n }\n // A refused pair says so. Tree rows lose to `groupBy` and win over detail\n // rows and windowing, each a documented exclusion — and on screen each one\n // is only a mode that silently is not there.\n if (isDevMode()) {\n const warned = new Set<string>();\n effect(() => {\n if (this.childrenKey() === null) return;\n const refused = [\n this.groupBy() !== null ? '`groupBy` (grouping wins and the hierarchy is ignored)' : null,\n this.expandTpl() ? 'a `[wrTableExpand]` template (tree rows win and no detail row renders)' : null,\n this.virtualScroll() ? '`virtualScroll` (tree rows win and the body renders in full)' : null,\n ].filter((pair): pair is string => pair !== null);\n for (const pair of refused) {\n if (warned.has(pair)) continue;\n warned.add(pair);\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(`[NGWR] <wr-table>: \\`childrenKey\\` cannot be combined with ${pair}.`);\n }\n });\n let scopeWarned = false;\n effect(() => {\n if (scopeWarned || this.selectAllScope() !== 'all' || this.total() === null) return;\n scopeWarned = true;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n '[NGWR] <wr-table>: `selectAllScope=\"all\"` cannot be combined with `total` (the table holds one page in server mode, so the select-all covers that page).'\n );\n });\n }\n\n // One `stateChange` per pass, however many parts one action wrote.\n effect(() => {\n if (this.readerChanges() === 0) return;\n untracked(() => {\n this.emittedState = this.currentState();\n this.stateChange.emit(this.emittedState);\n });\n });\n effect(() => {\n const state = this.state();\n if (!state || state === this.emittedState) return;\n untracked(() => this.restoreState(state));\n });\n\n // The bar takes the header's height, which only the browser knows.\n effect(onCleanup => {\n const head = this.headEl()?.nativeElement;\n if (\n !head ||\n this.selectionBar() === null ||\n !isPlatformBrowser(this.platformId) ||\n typeof ResizeObserver === 'undefined'\n ) {\n this.selectionBarHeight.set(null);\n return;\n }\n // A header hidden by card mode measures 0, and the bar keeps its own height.\n const measure = (): void => this.selectionBarHeight.set(head.offsetHeight > 0 ? head.offsetHeight : null);\n const observer = new ResizeObserver(measure);\n observer.observe(head);\n measure();\n onCleanup(() => observer.disconnect());\n });\n\n // The bar leaves with the last selected row. Focus that was in it would fall\n // to the document, so it goes to the table instead. This runs before the\n // view drops the bar, while the bar still holds the focus.\n effect(() => {\n if (this.selectionBar() !== null || !isPlatformBrowser(this.platformId)) return;\n const bar = untracked(this.selectionBarEl)?.nativeElement;\n if (!bar?.contains(bar.ownerDocument.activeElement)) return;\n afterNextRender(() => this.focusTable(), { injector: this.injector });\n });\n\n // Re-measure whenever the columns or their rendered widths change. Tables\n // with no pinned column skip the observer entirely.\n effect(onCleanup => {\n const cells = this.headerCells();\n const cols = this.displayColumns();\n if (!cols.some(c => c.column.pin)) {\n this.pins.set({ left: new Map(), right: new Map(), leftEdge: null, rightEdge: null });\n return;\n }\n if (!isPlatformBrowser(this.platformId) || typeof ResizeObserver === 'undefined') {\n this.measurePins(cols, cells);\n return;\n }\n const observer = new ResizeObserver(() => this.measurePins(cols, cells));\n for (const cell of cells) observer.observe(cell.nativeElement);\n this.measurePins(cols, cells);\n onCleanup(() => observer.disconnect());\n });\n\n // Reset resize state when the column KEY SET changes (added/removed/renamed)\n // so a stale frozen width can't collapse a new column under the latched\n // fixed layout. Keyed on sorted keys, not object identity (which churns).\n // Also drops the virtual freeze so activation effect (A), registered after\n // this, re-establishes it from the fresh natural widths.\n effect(() => {\n const keys = Object.keys(this.columns()).sort().join('\\n');\n if (keys === this.lastColumnKeys) return;\n this.lastColumnKeys = keys;\n this.resizeWidths.set(new Map());\n this.fixedLayout.set(false);\n this.virtualFixed.set(false);\n this.editHold = null;\n this.editHeld.set(false);\n });\n\n // (A) Virtual activation: freeze the natural column widths BEFORE fixed\n // layout applies (so there's no jump), then switch to fixed and measure the\n // row height. Tracks columns so a structural change re-freshes the widths —\n // registered AFTER the key-set reset above, so this freeze wins the tie.\n effect(() => {\n const active = this.virtualized();\n this.displayColumns(); // re-run on a structural column change\n // Both view queries are read TRACKED, and that is the whole point: a\n // constructor effect's first run happens before the view's first update\n // pass, so reading them inside `untracked` meant this ran once against an\n // empty DOM — no header cells to freeze, no row to measure — and never\n // again on a statically-configured table. The row height then silently\n // stayed on the 40px fallback and the column widths were never captured.\n const cells = this.headerCells();\n const scroll = this.scrollEl();\n if (!active) {\n this.virtualFixed.set(false);\n return;\n }\n if (!isPlatformBrowser(this.platformId)) return;\n if (cells.length === 0 || !scroll) return; // the view is not up yet; this re-runs when it is\n untracked(() => {\n this.freezeColumnWidths(); // captured while still auto-layout = natural widths\n this.virtualFixed.set(true); // now fixed, with those exact widths (no jump)\n if (this.rowHeight() === 0) {\n const row = scroll.nativeElement.querySelector<HTMLElement>('.wr-table__tr');\n const h = row?.offsetHeight ?? 0;\n if (h > 0) this.measuredRowPx.set(h);\n }\n });\n });\n\n // (B) Scroll + viewport observer — attached ONLY when virtual + browser, so\n // a non-virtual table gets no scroll listener / no per-scroll change detection.\n effect(onCleanup => {\n const el = this.scrollEl()?.nativeElement;\n if (!el || !this.virtualized() || !isPlatformBrowser(this.platformId)) return;\n let raf = 0;\n const onScroll = (): void => {\n if (raf) return;\n raf = requestAnimationFrame(() => {\n raf = 0;\n this.scrollTop.set(el.scrollTop);\n });\n };\n el.addEventListener('scroll', onScroll, { passive: true });\n this.viewportPx.set(el.clientHeight);\n const ro =\n typeof ResizeObserver !== 'undefined' ? new ResizeObserver(() => this.viewportPx.set(el.clientHeight)) : null;\n ro?.observe(el);\n onCleanup(() => {\n el.removeEventListener('scroll', onScroll);\n if (raf) cancelAnimationFrame(raf);\n ro?.disconnect();\n });\n });\n\n // (C) The sticky header and footer cover the edges of the scroll area, so\n // their heights become its scroll padding.\n effect(onCleanup => {\n const head = this.headEl()?.nativeElement;\n const foot = this.footEl()?.nativeElement;\n const setEdges = (next: { head: number | null; foot: number | null }): void => {\n const prev = untracked(this.stickyEdges);\n if (prev.head !== next.head || prev.foot !== next.foot) this.stickyEdges.set(next);\n };\n if (!head || !this.scrollable() || !isPlatformBrowser(this.platformId) || typeof ResizeObserver === 'undefined') {\n setEdges({ head: null, foot: null });\n return;\n }\n // A header hidden by card mode measures 0, which is no height to pad by.\n const px = (el: HTMLElement | undefined): number | null => (el && el.offsetHeight > 0 ? el.offsetHeight : null);\n const measure = (): void => setEdges({ head: px(head), foot: px(foot) });\n const observer = new ResizeObserver(measure);\n observer.observe(head);\n if (foot) observer.observe(foot);\n measure();\n onCleanup(() => observer.disconnect());\n });\n\n // (D) A pinned edge casts its shadow only over content hidden behind it, so\n // the scroll area reports which inline sides it overflows on.\n effect(onCleanup => {\n const el = this.scrollEl()?.nativeElement;\n const table = el?.firstElementChild;\n if (\n !el ||\n !table ||\n !this.hasPins() ||\n !isPlatformBrowser(this.platformId) ||\n typeof ResizeObserver === 'undefined'\n ) {\n this.setOverflow(false, false);\n return;\n }\n let raf = 0;\n const measure = (): void => {\n // `scrollLeft` runs from 0 down to a negative end under RTL, so its\n // magnitude is the distance from the start in either direction. One\n // pixel of slack absorbs the rounding of fractional column widths.\n const offset = Math.abs(el.scrollLeft);\n this.setOverflow(offset > 1, el.scrollWidth - el.clientWidth - offset > 1);\n };\n const onScroll = (): void => {\n if (raf) return;\n raf = requestAnimationFrame(() => {\n raf = 0;\n measure();\n });\n };\n const observer = new ResizeObserver(measure);\n observer.observe(el);\n observer.observe(table);\n el.addEventListener('scroll', onScroll, { passive: true });\n measure();\n onCleanup(() => {\n observer.disconnect();\n el.removeEventListener('scroll', onScroll);\n if (raf) cancelAnimationFrame(raf);\n });\n });\n }\n\n private setOverflow(start: boolean, end: boolean): void {\n const prev = untracked(this.overflow);\n if (prev.start !== start || prev.end !== end) this.overflow.set({ start, end });\n }\n\n private measurePins(\n cols: readonly { key: string; column: WrTableColumn<T> }[],\n cells: readonly ElementRef<HTMLElement>[]\n ): void {\n const left = new Map<string, number>();\n const right = new Map<string, number>();\n let leftEdge: string | null = null;\n let rightEdge: string | null = null;\n\n let acc = 0;\n for (let i = 0; i < cols.length; i++) {\n if (cols[i].column.pin === 'left') {\n left.set(cols[i].key, acc);\n acc += cells[i]?.nativeElement.offsetWidth ?? 0;\n leftEdge = cols[i].key;\n }\n }\n acc = 0;\n for (let i = cols.length - 1; i >= 0; i--) {\n if (cols[i].column.pin === 'right') {\n right.set(cols[i].key, acc);\n acc += cells[i]?.nativeElement.offsetWidth ?? 0;\n rightEdge = cols[i].key;\n }\n }\n this.pins.set({ left, right, leftEdge, rightEdge });\n }\n\n /** Per column key. Rebuilt with the columns and the cell templates, never on a pin measurement, a resize or a hidden column. */\n private readonly cellContexts = computed(() => {\n this.cellMap();\n return new Map(\n this.orderedColumns().map(c => [c.key, new WeakMap<Record<string, unknown>, WrTableCellContext>()] as const)\n );\n });\n\n /**\n * {@link displayColumns} with the per-column half of every cell resolved\n * once. Apart from `displayColumns` because the pin effect reads that one\n * and writes `pins`, which this reads.\n *\n * `pin` keeps its physical name — it is public API — but the offsets are\n * LOGICAL. `measurePins()` accumulates in DOM order, which is start-to-end\n * semantics, and under `dir=\"rtl\"` the column order mirrors: a `pin: 'left'`\n * column then sits at the physical right, where a `left: 0` sticky inset can\n * never catch it and the column just scrolls away.\n *\n * The class strings are the BEM class and the consumer's own, merged. One\n * binding rather than a static `class` beside a `[class]` — Angular does\n * merge the two, but `no-duplicate-attributes` refuses the shape, and a\n * reader should not have to know the merge rules to know what a cell ends up\n * with. The summary and group-footer cells take `align` only, on the body\n * cell's modifier, the way they already wear `__td--pin-*`: `column.class`\n * stays off them, as its docs say.\n */\n protected readonly cellColumns = computed<readonly CellColumn<T>[]>(() => {\n const contexts = this.cellContexts();\n const pins = this.pins();\n const resized = this.resizeWidths();\n const templates = this.cellMap();\n const editors = this.editMap();\n const tableTruncate = this.truncate();\n const labelKey = this.labelColumnKey();\n const treeKey = this.treeColumnKey();\n return this.displayColumns().map(({ key, column }) => {\n const { align, pin } = column;\n const truncates = (column.truncate === undefined ? tableTruncate : column.truncate) === 'tooltip';\n const tdClass = cellClasses('wr-table__td', column);\n return {\n key,\n column,\n thClass: cellClasses('wr-table__th', column),\n tdClass: truncates ? `${tdClass} wr-table__td--truncate` : tdClass,\n footClass: align ? `wr-table__foot-cell wr-table__td--align-${align}` : 'wr-table__foot-cell',\n pinned: !!pin,\n pinLeft: pin === 'left',\n pinRight: pin === 'right',\n edgeLeft: pins.leftEdge === key,\n edgeRight: pins.rightEdge === key,\n start: pins.left.get(key) ?? null,\n end: pins.right.get(key) ?? null,\n width: resized.get(key) ?? column.width ?? null,\n maxWidth: truncates ? (column.width ?? null) : null,\n label: key === labelKey,\n tree: key === treeKey,\n template: templates.get(key),\n editTemplate: column.editable === false ? undefined : editors.get(key),\n contexts: contexts.get(key)!,\n };\n });\n });\n\n private readonly hasPins = computed<boolean>(() => this.displayColumns().some(c => c.column.pin));\n\n /**\n * Whether columns are hidden past the start and the end of the scroll area,\n * the host's `wr-table--overflow-start` / `--overflow-end`. Only a table with\n * a pinned column measures it.\n */\n protected readonly overflow = signal<{ start: boolean; end: boolean }>({ start: false, end: false });\n\n // --- Header hints and truncated cells --------------------------------------\n\n /**\n * `'tooltip'` cuts every body cell to one line with an ellipsis and shows a\n * cut cell's full text in a tooltip on hover and focus; a cell that fits\n * shows none. A column's own `truncate` wins, and `null` there turns it off\n * for that column. A cell is cut only where its column cannot grow: give the\n * column a `width`, or the table a fixed layout (a resized or virtualized\n * one has it).\n * @default null\n */\n readonly truncate = input<WrTableTruncate | null>(null);\n\n /**\n * A column's name for its controls: the title, the hint after it, or the hint\n * alone under an empty title.\n */\n protected headerName(column: WrTableColumn<T>): string {\n const { title, headerHint } = column;\n if (!headerHint) return title;\n return title ? `${title}, ${headerHint}` : headerHint;\n }\n\n /** Whether any column has something a tooltip could show. */\n private readonly hasTips = computed<boolean>(\n () =>\n this.truncate() === 'tooltip' ||\n this.displayColumns().some(c => !!c.column.headerHint || c.column.truncate === 'tooltip')\n );\n\n /**\n * The element the table's one tooltip is for, and its text. One `WrPopover`\n * for the whole table, created on the first hint or cut cell the pointer or\n * the focus reaches: a table of thousands of cells holds none before that.\n */\n protected readonly tip = signal<{ readonly el: HTMLElement; readonly text: string } | null>(null);\n\n private readonly modality = inject(InputModalityDetector);\n\n private onTipTarget(event: Event): void {\n // A focus the keyboard did not move (a click, a script handing it back)\n // shows no tooltip, as on any `wrPopover` tooltip.\n if (event.type === 'focusin' && this.modality.mostRecentModality !== 'keyboard') return;\n const host = this.hostEl.nativeElement;\n const cell = (event.target as Element).closest<HTMLElement>('.wr-table__th, .wr-table__td--truncate');\n // A table nested in a cell answers for its own cells.\n if (cell?.closest('.wr-table') !== host) return;\n let text = '';\n if (cell.classList.contains('wr-table__th')) {\n const index = this.headerCells().findIndex(th => th.nativeElement === cell);\n text = this.displayColumns()[index]?.column.headerHint ?? '';\n } else if (cell.scrollWidth > cell.clientWidth) {\n text = cell.textContent.trim();\n }\n const current = this.tip();\n if (!text) {\n if (current?.el === cell) this.tip.set(null);\n } else if (current?.el !== cell || current.text !== text) {\n this.tip.set({ el: cell, text });\n }\n }\n\n /** The row's class with the consumer's own, resolved through the `rowClass` predicate. */\n protected rowClasses(row: Record<string, unknown>, index: number): string {\n const extra = this.rowClass()?.(row, index);\n return extra ? wrToClassList('wr-table__tr', extra).join(' ') : 'wr-table__tr';\n }\n\n // --- Column resizing ------------------------------------------------------\n\n private readonly resizeWidths = signal<ReadonlyMap<string, number>>(new Map());\n private resizeKey: string | null = null;\n private resizeStartX = 0;\n private resizeStartWidth = 0;\n private lastColumnKeys = '';\n\n /**\n * Once a column has been dragged, the table switches to fixed layout so the\n * `<col>` widths are honoured exactly (auto layout treats them as minimums).\n */\n protected readonly fixedLayout = signal(false);\n\n /**\n * Fixed layout held only while a cell edits, so an editor of another width\n * cannot move the columns. `editHold` keeps the widths in force before it, to\n * put back when the edit ends.\n */\n protected readonly editHeld = signal(false);\n private editHold: ReadonlyMap<string, number> | null = null;\n\n private holdWidthsForEdit(): void {\n if (this.fixedLayoutActive() || !isPlatformBrowser(this.platformId)) return;\n this.editHold = this.resizeWidths();\n this.freezeColumnWidths();\n this.editHeld.set(true);\n }\n\n private releaseEditHold(): void {\n if (!this.editHeld()) return;\n this.editHeld.set(false);\n // A resize that began during the edit made the layout fixed for good: its widths stay.\n if (this.editHold && !this.fixedLayout()) this.resizeWidths.set(this.editHold);\n this.editHold = null;\n }\n\n /** Freeze every column at its current rendered header width (skips frozen keys). */\n private freezeColumnWidths(): void {\n const cols = this.displayColumns();\n const cells = this.headerCells();\n const frozen = new Map(this.resizeWidths());\n for (let i = 0; i < cols.length; i++) {\n if (!frozen.has(cols[i].key)) {\n const width = cells[i]?.nativeElement.offsetWidth;\n if (width) frozen.set(cols[i].key, width);\n }\n }\n this.resizeWidths.set(frozen);\n }\n\n protected onResizeStart(event: PointerEvent, key: string, th: HTMLElement): void {\n event.preventDefault();\n event.stopPropagation();\n // Freeze every column at its current rendered width, then switch to fixed\n // layout — the drag then resizes precisely (both directions) without the\n // content-sized columns jumping.\n if (!this.fixedLayout()) {\n this.freezeColumnWidths();\n this.fixedLayout.set(true);\n }\n this.resizeKey = key;\n this.resizeStartX = event.clientX;\n this.resizeStartWidth = th.offsetWidth;\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n /**\n * Pointer travel along the INLINE axis since the drag started, in px.\n *\n * The grip sits on each column's inline-END edge, so a column grows as the\n * pointer moves away from that column's start: rightward in LTR, leftward in\n * RTL. Signed here once rather than sprinkled through the width maths — and\n * this sign is the pair of `inset-inline-end` on `.wr-table__resize-handle`,\n * so the two must move together.\n */\n private resizeDelta(clientX: number): number {\n return this.isRtl() ? this.resizeStartX - clientX : clientX - this.resizeStartX;\n }\n\n protected onResizeMove(event: PointerEvent): void {\n if (this.resizeKey === null) return;\n const width = Math.max(48, this.resizeStartWidth + this.resizeDelta(event.clientX));\n this.resizeWidths.set(new Map(this.resizeWidths()).set(this.resizeKey, width));\n }\n\n protected onResizeEnd(event: PointerEvent): void {\n if (this.resizeKey === null) return;\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture?.(event.pointerId)) target.releasePointerCapture(event.pointerId);\n this.resizeKey = null;\n }\n\n // --- Virtual scroll -------------------------------------------------------\n\n /** md-density fallback row height (px), used before measuring / on the server. */\n private static readonly FALLBACK_ROW_PX = 40;\n private static readonly FALLBACK_VIEWPORT_PX = 480;\n\n /** The `.wr-table__scroll` div (always in the template; only read when virtual). */\n private readonly scrollEl = viewChild<ElementRef<HTMLElement>>('scroll');\n private readonly headEl = viewChild<ElementRef<HTMLElement>>('head');\n private readonly footEl = viewChild<ElementRef<HTMLElement>>('foot');\n /** Live vertical scroll offset (px); 0 on the server / before first scroll. */\n private readonly scrollTop = signal(0);\n /** Measured viewport clientHeight (px); 0 until the browser observer fires. */\n private readonly viewportPx = signal(0);\n /** Measured first-row height (px) when `rowHeight` is auto; 0 until measured. */\n private readonly measuredRowPx = signal(0);\n /** Fixed layout forced ON by virtualization (distinct from the resize latch). */\n private readonly virtualFixed = signal(false);\n\n /** `virtualScroll` requested AND the data shape is safe to window. SSR-deterministic. */\n protected readonly virtualized = computed<boolean>(\n () =>\n this.virtualScroll() &&\n this.groupBy() === null && // group bands / subtotals are variable height\n !this.treeMode() && // expanding re-anchors the window; needs scroll anchoring first\n !this.expandable() && // an injected detail <tr> desyncs uniform offsets\n !this.responsive() && // card mode has no uniform row height\n this.currentPageSize() === 0 && // a visible pager owns chunking — the pager wins\n this.total() === null &&\n !!this.visibleItems()\n );\n\n /** Effective uniform row height (px). */\n protected readonly effRowH = computed<number>(() =>\n this.rowHeight() > 0 ? this.rowHeight() : this.measuredRowPx() || WrTable.FALLBACK_ROW_PX\n );\n\n /** Deterministic viewport px for SSR + first paint (numeric height, else fallback). */\n private readonly fallbackViewportPx = computed<number>(() => {\n const h = this.viewportHeight();\n return typeof h === 'number' ? h : WrTable.FALLBACK_VIEWPORT_PX;\n });\n\n /** The table scrolls vertically inside `.wr-table__scroll`, under a sticky header. */\n protected readonly scrollable = computed<boolean>(() => this.virtualized() || this.stickyHeader());\n\n protected readonly fillsParent = computed<boolean>(() => this.scrollable() && this.viewportHeight() === 'fill');\n\n /** `viewportHeight` as the value of `--wr-table-scroll-height`; `null` leaves the hook to the stylesheet. */\n protected readonly scrollHeight = computed<string | null>(() => {\n if (!this.scrollable() || this.fillsParent()) return null;\n const h = this.viewportHeight();\n return typeof h === 'number' ? `${h}px` : h;\n });\n\n /** Measured heights (px) of the sticky header and footer, which `scroll-padding` keeps clear; `null` until measured. */\n protected readonly stickyEdges = signal<{ head: number | null; foot: number | null }>({ head: null, foot: null });\n\n /** Rendered window [start,end) + spacer pads (px). Pure math, O(1) per scroll frame. */\n protected readonly virtualWindow = computed<{ start: number; end: number; padTop: number; padBottom: number }>(() => {\n const total = this.renderRows().length;\n if (!this.virtualized() || total === 0) return { start: 0, end: total, padTop: 0, padBottom: 0 };\n const h = this.effRowH();\n const vp = this.viewportPx() || this.fallbackViewportPx();\n const over = this.overscan();\n // Clamp `first` to the last row: the window is a pure function of a pixel\n // offset, so if the row list shrinks while the user is scrolled deep — a\n // consumer filtering `items`, or a future hierarchy collapsing — `start`\n // overshoots `end` and `slice` returns nothing, leaving a blank body under a\n // spacer the old length's worth of pixels tall.\n const first = Math.min(Math.floor(this.scrollTop() / h), total - 1);\n // `+ 1` covers the partial row at the viewport's bottom edge: at overscan 0\n // with the scroll resting mid-row, `ceil(vp / h)` alone stops one row short.\n const count = Math.ceil(vp / h) + 1;\n const start = Math.max(0, first - over);\n const end = Math.min(total, first + count + over);\n return { start, end, padTop: start * h, padBottom: (total - end) * h };\n });\n\n /** Flat index of the first rendered window row (for `aria-rowindex`). */\n protected readonly windowStart = computed<number>(() => this.virtualWindow().start);\n\n /** Rows placed in `<tbody>`. SAME array instance as `renderRows()` when off → byte-identical DOM. */\n protected readonly windowRows = computed<readonly RenderRow[]>(() => {\n if (!this.virtualized()) return this.renderRows();\n const { start, end } = this.virtualWindow();\n return this.renderRows().slice(start, end);\n });\n\n /** Fixed layout is on when a resize drag latched it OR virtualization forces it. */\n protected readonly fixedLayoutActive = computed<boolean>(\n () => this.fixedLayout() || this.virtualFixed() || this.editHeld()\n );\n\n /** Scroll a flat row index to the top of the virtual viewport. No-op on the server / when not virtual. */\n scrollToRow(index: number, behavior: ScrollBehavior = 'auto'): void {\n if (!isPlatformBrowser(this.platformId) || !this.virtualized()) return;\n this.scrollEl()?.nativeElement.scrollTo({ top: Math.max(0, index) * this.effRowH(), behavior });\n }\n\n protected onColumnDrop(event: CdkDragDrop<unknown>): void {\n // An Escape-cancelled drag still ends in a drop, which must change nothing.\n if (this.dragCancelled) {\n this.dragCancelled = false;\n return;\n }\n if (event.previousIndex === event.currentIndex) return;\n const shown = this.displayColumns().map(c => c.key);\n const slots = new Set(shown);\n moveItemInArray(shown, event.previousIndex, event.currentIndex);\n // A hidden column keeps its place: the visible ones are dealt back into\n // the slots they held.\n let next = 0;\n this.columnOrder.set(this.orderedColumns().map(c => (slots.has(c.key) ? shown[next++] : c.key)));\n this.readerChanges.update(n => n + 1);\n }\n\n /**\n * Keep pinned columns anchored — a drop can't land on a pinned column's slot,\n * so a scrollable column can't be dragged into the frozen region at either edge.\n *\n * The index the CDK hands over is a slot in the pointer sweep it does along\n * the header, and that sweep is always left-to-right (`SingleAxisSortStrategy`\n * caches item rects sorted by `clientRect.left`). `displayColumns()` is DOM\n * order, which under `dir=\"rtl\"` runs the other way — so without the mirror\n * the guard is asked about the column at the opposite end of the header, and\n * a drop lands on the pinned one it was meant to protect.\n *\n * The drop event itself needs no such mapping: `previousIndex` /\n * `currentIndex` come from `getItemIndex`, which the CDK already un-mirrors\n * back to DOM order.\n */\n protected readonly sortPredicate = (index: number): boolean => this.slotOpen(index);\n\n /**\n * The one rule for a header slot, in the CDK's left-to-right sweep order: it\n * is open unless a pinned column holds it. The drop guard and the drag cursor\n * both ask it, so they cannot disagree.\n */\n private slotOpen(index: number): boolean {\n const cols = this.displayColumns();\n const slot = this.isRtl() ? cols.length - 1 - index : index;\n return !cols[slot]?.column.pin;\n }\n\n // --- Column drag cursor ---------------------------------------------------\n\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n /** Sweep-order `[left, right]` of each header slot, measured when a drag starts. */\n private dragSlots: readonly (readonly [number, number])[] = [];\n private dragInList = false;\n private dragActive = false;\n private dragCancelled = false;\n private stopDragCancel: (() => void) | null = null;\n /** The dragged column's current slot in DOM order, kept by the CDK's `sorted` event. */\n private dragOwn = -1;\n // A table destroyed mid-drag never gets its `cdkDragEnded`.\n private readonly clearDragCursor = this.destroyRef.onDestroy(() => {\n this.stopDragCancel?.();\n if (this.dragActive) this.setDragCursor(null);\n });\n\n /**\n * The pointer cursor of a column drag lives on `<html>`: the CDK preview has\n * `pointer-events: none`, so the cursor is whatever sits under it, and a class\n * on the root is the only place that covers the whole page, margins included\n * (`<body>` ends where its content does).\n */\n private setDragCursor(state: 'allowed' | 'blocked' | null): void {\n const list = this.doc.documentElement.classList;\n list.toggle('wr-table-dragging', state !== null);\n list.toggle('wr-table-dragging--allowed', state === 'allowed');\n list.toggle('wr-table-dragging--blocked', state === 'blocked');\n }\n\n protected onColumnDragStart(event: CdkDragStart): void {\n if (!isPlatformBrowser(this.platformId) || !this.reorderable()) return;\n const source = event.source.element.nativeElement;\n // The CDK hides the source and leaves a placeholder where it stood.\n const rects = this.headerCells().map(ref => {\n const el = ref.nativeElement === source ? event.source.getPlaceholderElement() : ref.nativeElement;\n const { left, right } = el.getBoundingClientRect();\n return [left, right] as const;\n });\n this.dragSlots = rects.sort((a, b) => a[0] - b[0]);\n this.dragOwn = this.headerCells().findIndex(ref => ref.nativeElement === source);\n this.dragInList = true;\n this.dragActive = true;\n this.dragCancelled = false;\n this.setDragCursor('blocked');\n this.stopDragCancel?.();\n this.stopDragCancel = wrWatchDragCancel(this.doc, event.event, () => {\n this.dragCancelled = true;\n this.onColumnDragEnd();\n });\n }\n\n protected onColumnDragMoved(event: CdkDragMove): void {\n if (!this.dragActive || !this.dragInList) return;\n const x = event.pointerPosition.x;\n const slot = this.dragSlots.findIndex(([left, right]) => x >= left && x < right);\n const own = this.isRtl() ? this.dragSlots.length - 1 - this.dragOwn : this.dragOwn;\n this.setDragCursor(slot >= 0 && slot !== own && this.slotOpen(slot) ? 'allowed' : 'blocked');\n }\n\n protected onColumnListSorted(event: CdkDragSortEvent): void {\n this.dragOwn = event.currentIndex;\n }\n\n protected onColumnListEntered(): void {\n this.dragInList = true;\n }\n\n protected onColumnListExited(): void {\n if (!this.dragActive) return;\n this.dragInList = false;\n this.setDragCursor('blocked');\n }\n\n protected onColumnDragEnd(): void {\n this.stopDragCancel?.();\n this.stopDragCancel = null;\n this.dragActive = false;\n this.setDragCursor(null);\n }\n\n // --- Row selection --------------------------------------------------------\n\n private rowKeyOf(row: Record<string, unknown>): unknown {\n const rk = this.rowKey();\n if (typeof rk === 'function') return rk(row);\n if (typeof rk === 'string') return row[rk];\n return row;\n }\n\n /** Keys of the rows on the current page — the select-all scope. */\n /**\n * Scope of the header select-all: the rows currently ON SCREEN. In tree mode\n * that is every VISIBLE node — a collapsed subtree is not on screen and is not\n * swept in, which keeps the checkbox honest about what it just did.\n */\n protected readonly pageRowKeys = computed<readonly unknown[]>(() =>\n // `renderRows()` in EVERY mode, not only tree: it is the list that reaches the\n // screen. Reading `visibleItems()` outside tree mode swept in the rows of a\n // COLLAPSED group — invisible rows, silently selected, which is exactly what\n // the paragraph above promises does not happen.\n this.renderRows()\n .filter((entry): entry is Extract<RenderRow, { kind: 'row' }> => entry.kind === 'row')\n .map(entry => this.rowKeyOf(entry.row))\n );\n\n /**\n * The header select-all's keys: {@link pageRowKeys}, or under\n * `selectAllScope=\"all\"` the keys every page would put on screen.\n */\n protected readonly selectAllKeys = computed<ReadonlySet<unknown>>(() => {\n const rows = this.rows();\n if (this.selectAllScope() !== 'all' || this.total() !== null || !rows) return new Set(this.pageRowKeys());\n if (this.treeMode()) {\n return new Set(\n this.flattenForest(rows).flatMap(entry => (entry.kind === 'row' ? [this.rowKeyOf(entry.row)] : []))\n );\n }\n const by = this.groupBy();\n if (by === null) return new Set(rows.map(row => this.rowKeyOf(row)));\n const collapsed = new Set(this.collapsedGroups());\n return new Set(\n rows.filter(row => !collapsed.has(typeof by === 'function' ? by(row) : row[by])).map(row => this.rowKeyOf(row))\n );\n });\n\n protected isRowSelected(row: Record<string, unknown>): boolean {\n return this.selectionSet().has(this.rowKeyOf(row));\n }\n\n /** Every row in the select-all scope selected (drives the header checkbox). */\n protected readonly allSelected = computed<boolean>(() => {\n const keys = this.selectAllKeys();\n if (keys.size === 0) return false;\n const sel = this.selectionSet();\n for (const key of keys) if (!sel.has(key)) return false;\n return true;\n });\n\n /** Some but not all selected (drives the header indeterminate). */\n protected readonly someSelected = computed<boolean>(() => {\n if (this.allSelected()) return false;\n const sel = this.selectionSet();\n for (const key of this.selectAllKeys()) if (sel.has(key)) return true;\n return false;\n });\n\n protected toggleRow(row: Record<string, unknown>, checked: boolean): void {\n const key = this.rowKeyOf(row);\n if (this.rowSelection() === 'single') {\n this.selection.set(checked ? [key] : []);\n return;\n }\n const sel = this.selection();\n this.selection.set(checked ? [...sel, key] : sel.filter(k => k !== key));\n }\n\n /** Add (or remove) a set of row keys from the selection in one update. */\n private applySelection(keys: Iterable<unknown>, checked: boolean): void {\n const sel = this.selection();\n if (checked) {\n const merged = new Set(sel);\n for (const key of keys) merged.add(key);\n this.selection.set([...merged]);\n } else {\n const drop = new Set(keys);\n this.selection.set(sel.filter(k => !drop.has(k)));\n }\n }\n\n protected toggleAll(checked: boolean): void {\n this.applySelection(this.selectAllKeys(), checked);\n }\n\n // --- Selection bar ---------------------------------------------------------\n\n private readonly selectionBarTpl = contentChild(WrTableSelectionBar);\n private readonly selectionBarEl = viewChild<ElementRef<HTMLElement>>('selectionBarEl');\n\n /** Whether a `[wrTableSelectionBar]` template was projected. */\n protected readonly hasSelectionBar = computed<boolean>(() => !!this.selectionBarTpl());\n\n /** The bar's template while rows are selected, `null` while the bar is away. */\n protected readonly selectionBar = computed<TemplateRef<WrTableSelectionContext> | null>(() =>\n this.selection().length > 0 ? (this.selectionBarTpl()?.template ?? null) : null\n );\n\n /** The header's measured height in px for the bar to match; `null` until measured. */\n protected readonly selectionBarHeight = signal<number | null>(null);\n\n protected readonly selectionCountText = computed<string>(() => {\n const count = this.selection().length;\n const own = this.selectedLabel();\n return own === null ? this.selectedText({ count }) : own.replace(/\\{\\{\\s*count\\s*\\}\\}/g, String(count));\n });\n\n protected readonly selectionContext = computed<WrTableSelectionContext>(() => ({\n $implicit: this.selectedRows(),\n count: this.selection().length,\n clear: () => this.clearSelection(),\n scope: this.selectAllScope() === 'all' && this.total() === null ? 'all' : 'page',\n }));\n\n /**\n * Empty the selection. When the focus is in the selection bar, which leaves\n * with the last selected row, it moves to the table.\n */\n clearSelection(): void {\n this.selection.set([]);\n }\n\n /** Focus the first control of the table: a selection checkbox, else the scroll area. */\n private focusTable(): void {\n const host = this.hostEl.nativeElement;\n const target =\n host.querySelector<HTMLElement>(\n '.wr-table__th--select input:not(:disabled), .wr-table__td--select input:not(:disabled)'\n ) ?? this.scrollEl()?.nativeElement;\n target?.focus();\n }\n\n // --- Row expansion --------------------------------------------------------\n\n private readonly expandTpl = contentChild(WrTableExpand);\n\n /** Whether the expand column shows (a `[wrTableExpand]` template was projected). */\n /**\n * Tree mode is on when `childrenKey` is set AND grouping is not. Grouping wins\n * deliberately: `groupBy` buckets a flat list and a forest has none, so rather\n * than half-support the pair the hierarchy is ignored while a group is set.\n */\n protected readonly treeMode = computed<boolean>(() => this.childrenKey() !== null && this.groupBy() === null);\n\n /** Detail rows and tree rows both own the row's disclosure — tree mode wins. */\n protected readonly expandable = computed<boolean>(() => !this.treeMode() && !!this.expandTpl());\n\n /** The column that carries the indent + toggle — named, else whichever renders first. */\n protected readonly treeColumnKey = computed<string | null>(() => {\n if (!this.treeMode()) return null;\n const shown = this.displayColumns();\n const named = this.treeColumn();\n // A hidden tree column hands the toggle to the first one drawn.\n return named !== null && shown.some(c => c.key === named) ? named : (shown[0]?.key ?? null);\n });\n\n /** This row's children, whatever shape `childrenKey` names. */\n private childrenOf(row: Record<string, unknown>): readonly Record<string, unknown>[] {\n const ck = this.childrenKey();\n if (ck === null) return [];\n const raw = typeof ck === 'function' ? ck(row) : row[ck];\n return Array.isArray(raw) ? (raw as readonly Record<string, unknown>[]) : [];\n }\n\n /**\n * Depth-first flatten of the forest, descending only into open parents.\n * `seen` is path-scoped rather than global: the same row legitimately appearing\n * under two parents is fine, a row appearing under itself is a cycle and would\n * otherwise hang the walk.\n */\n private flattenForest(roots: readonly Record<string, unknown>[]): readonly RenderRow[] {\n const open = this.expandedSet();\n const out: RenderRow[] = [];\n\n const walk = (\n rows: readonly Record<string, unknown>[],\n depth: number,\n prefix: string,\n seen: ReadonlySet<unknown>\n ): void => {\n rows.forEach((row, i) => {\n const key = this.rowKeyOf(row);\n if (seen.has(key)) return;\n const children = this.childrenOf(row);\n const parent = children.length > 0;\n const isOpen = parent && open.has(key);\n out.push({\n kind: 'row',\n id: `${prefix}r${i}`,\n row,\n depth,\n parent,\n open: parent ? isOpen : null,\n posinset: i + 1,\n setsize: rows.length,\n });\n if (isOpen) walk(children, depth + 1, `${prefix}r${i}-`, new Set(seen).add(key));\n });\n };\n\n walk(roots, 0, '', new Set());\n return out;\n }\n\n /** Every node in the forest, depth-first — what selection and CSV must see. */\n private allTreeRows(): readonly Record<string, unknown>[] {\n const out: Record<string, unknown>[] = [];\n const walk = (rows: readonly Record<string, unknown>[], seen: ReadonlySet<unknown>): void => {\n for (const row of rows) {\n const key = this.rowKeyOf(row);\n if (seen.has(key)) continue;\n out.push(row);\n const children = this.childrenOf(row);\n if (children.length > 0) walk(children, new Set(seen).add(key));\n }\n };\n walk(this.rows() ?? [], new Set());\n return out;\n }\n\n /** Open / close one parent row. */\n protected toggleTreeRow(row: Record<string, unknown>): void {\n const key = this.rowKeyOf(row);\n const open = this.expanded();\n this.expanded.set(open.includes(key) ? open.filter(k => k !== key) : [...open, key]);\n }\n\n /** Open every parent in the forest. */\n expandAllRows(): void {\n this.expanded.set(\n this.allTreeRows()\n .filter(row => this.childrenOf(row).length > 0)\n .map(row => this.rowKeyOf(row))\n );\n }\n\n /** Close every parent. */\n collapseAllRows(): void {\n this.expanded.set([]);\n }\n\n // --- Treegrid keyboard (row focus) -----------------------------------------\n //\n // The APG treegrid's row-focus model: the ROWS are the items. One row holds the\n // tab stop (roving `tabindex`), the arrows move between visible rows and open or\n // close branches, and the controls inside a row — its checkbox, its toggle, a\n // cell template's buttons — keep their own tab stops, so Tab walks from the row\n // into them. A `treegrid` promises this; announcing the role without it left a\n // keyboard user on a structure only the mouse could travel.\n //\n // A flat table has none of it on purpose: it announces the native `table` role,\n // which promises no keyboard model of its own.\n\n /** Every body `<tr>` holding data, in DOM order — 1:1 with {@link treeRows} in tree mode. */\n private readonly rowEls = viewChildren<ElementRef<HTMLTableRowElement>>('rowEl');\n\n /**\n * The row the keyboard last stood on, by `rowKey` — so the tab stop stays on\n * the same row through a sort or a refetch, where a position would not.\n * Wrapped, because a row's key may itself be `null` or `undefined`.\n */\n private readonly activeRow = signal<{ readonly key: unknown } | null>(null);\n\n /** The rendered tree rows, in the order the arrows travel. Empty outside tree mode. */\n private readonly treeRows = computed<readonly Extract<RenderRow, { kind: 'row' }>[]>(() =>\n this.treeMode()\n ? this.renderRows().filter((entry): entry is Extract<RenderRow, { kind: 'row' }> => entry.kind === 'row')\n : []\n );\n\n /**\n * Id of the row holding the tab stop: the active row while it is on screen,\n * else the first row. Collapsing a branch around the active row, or a refetch\n * that drops it, must not leave the grid with no tab stop at all — that is a\n * widget the keyboard can no longer enter.\n */\n protected readonly tabStopRowId = computed<string | null>(() => {\n const rows = this.treeRows();\n const active = this.activeRow();\n if (active) {\n const hit = rows.find(entry => this.rowKeyOf(entry.row) === active.key);\n if (hit) return hit.id;\n }\n return rows[0]?.id ?? null;\n });\n\n /**\n * Focus entering a row from anywhere — a click, Tab into one of its controls —\n * makes that row the tab stop, so Shift+Tab out of a row's checkbox lands on\n * its own row rather than skipping past it to the previous row's controls.\n */\n protected onTreeFocusin(event: FocusEvent): void {\n if (!this.treeMode()) return;\n const target = event.target as Node | null;\n const index = this.rowEls().findIndex(el => target !== null && el.nativeElement.contains(target));\n const entry = this.treeRows()[index];\n if (entry) this.activeRow.set({ key: this.rowKeyOf(entry.row) });\n }\n\n /**\n * The row-focus keys. Acts only when the ROW itself has focus: an arrow pressed\n * inside a cell's own control — a text field, a select — belongs to that\n * control, and stealing it would break the control.\n */\n protected onTreeKeydown(event: KeyboardEvent): void {\n if (!this.treeMode() || event.altKey || event.metaKey || event.shiftKey) return;\n const rows = this.treeRows();\n const els = this.rowEls();\n // The two lists disagree only between a branch opening or closing and the\n // render that draws it — a few milliseconds in which a position in one is not\n // the same row in the other. A key that lands there waits for the next one\n // rather than moving to the wrong row.\n if (els.length !== rows.length) return;\n const index = els.findIndex(el => el.nativeElement === event.target);\n const entry = rows[index];\n if (!entry) return;\n\n const key = this.inlineKey(event.key);\n // Ctrl is only meaningful with Home / End (the APG's \"first row\" chord);\n // with anything else it is someone else's shortcut.\n if (event.ctrlKey && key !== WR_KEYS.HOME && key !== WR_KEYS.END) return;\n\n switch (key) {\n case WR_KEYS.ARROW_DOWN:\n this.focusTreeRow(Math.min(index + 1, rows.length - 1));\n break;\n case WR_KEYS.ARROW_UP:\n this.focusTreeRow(Math.max(index - 1, 0));\n break;\n case WR_KEYS.HOME:\n this.focusTreeRow(0);\n break;\n case WR_KEYS.END:\n this.focusTreeRow(rows.length - 1);\n break;\n case WR_KEYS.ARROW_RIGHT:\n // Closed: open it, and stay. Open: step down into the first child, which\n // the depth-first flatten always puts on the very next row.\n if (!entry.parent) break;\n if (!entry.open) this.toggleTreeRow(entry.row);\n else if (rows[index + 1]?.depth === entry.depth + 1) this.focusTreeRow(index + 1);\n break;\n case WR_KEYS.ARROW_LEFT:\n // Open: close it, and stay. Closed or a leaf: climb to the parent, which\n // is the nearest row above that sits one level up.\n if (entry.open) {\n this.toggleTreeRow(entry.row);\n break;\n }\n for (let i = index - 1; i >= 0; i--) {\n if (rows[i].depth === entry.depth - 1) {\n this.focusTreeRow(i);\n break;\n }\n }\n break;\n case WR_KEYS.ENTER:\n case WR_KEYS.SPACE:\n // Selection is the row's own action when the table offers one. Without\n // it the keys do nothing, rather than guessing at a default.\n if (!this.rowSelection()) return;\n this.toggleRow(entry.row, !this.isRowSelected(entry.row));\n break;\n default:\n return;\n }\n event.preventDefault();\n }\n\n /**\n * The APG gives ArrowRight the job of opening a branch and ArrowLeft of closing\n * it, because the children indent rightward. Under `dir=\"rtl\"` they indent\n * leftward and the two swap, the way `wr-tree` swaps them.\n */\n private inlineKey(key: string): string {\n if (!this.isRtl()) return key;\n if (key === WR_KEYS.ARROW_RIGHT) return WR_KEYS.ARROW_LEFT;\n if (key === WR_KEYS.ARROW_LEFT) return WR_KEYS.ARROW_RIGHT;\n return key;\n }\n\n /**\n * Move the tab stop to a tree row, and focus it in the same keystroke.\n *\n * Synchronous on purpose, and safe to be: every row these keys pick — a\n * sibling, the first child of an OPEN row, the parent — is already rendered,\n * and a `tabindex=\"-1\"` row takes focus from script. The render that follows\n * only moves the `tabindex=\"0\"`. Deferring the focus to `afterNextRender`\n * cost one change-detection pass per key — about 25ms on the docs page in a\n * dev build — and a held arrow key outran it, each repeat acting on the row\n * focus had not yet left.\n */\n private focusTreeRow(index: number): void {\n const entry = this.treeRows()[index];\n if (!entry) return;\n this.activeRow.set({ key: this.rowKeyOf(entry.row) });\n this.rowEls()[index]?.nativeElement.focus();\n }\n\n // --- Inline editing ---------------------------------------------------------\n //\n // An edit template turns the table into a `grid` (a tree stays a `treegrid`):\n // one data cell holds the tab stop, the arrows, Home and End move between the\n // rendered data cells, and Enter, F2, a double click or a typed character put\n // an editable cell's editor in its place. The header, the selection boxes and\n // a cell template's own controls keep their tab stops, as the tree rows do.\n\n /**\n * Vetoes the edit of single cells: called with the row and the column key,\n * `false` keeps that cell read-only. Asked only for a column that has a\n * `[wrTableEditCell]` template and does not say `editable: false`.\n */\n readonly editable = input<WrTableEditable<T> | null>(null);\n\n /**\n * Emits when a cell edit commits with a value other than the cell's own. The\n * table does not write it: update the data behind `items` in the handler.\n */\n readonly cellEdit = output<WrTableCellEdit<T>>();\n\n /** The edit in flight. One cell edits at a time. */\n protected readonly editing = signal<CellEdit | null>(null);\n\n /** Whether any column has an editor: the table is then a grid of focusable cells. */\n protected readonly editGrid = computed<boolean>(() => {\n const editors = this.editMap();\n return editors.size > 0 && this.orderedColumns().some(c => c.column.editable !== false && editors.has(c.key));\n });\n\n /** The rendered data rows, 1:1 with {@link rowEls}. */\n private readonly dataRows = computed<readonly Extract<RenderRow, { kind: 'row' }>[]>(() =>\n this.windowRows().filter((entry): entry is Extract<RenderRow, { kind: 'row' }> => entry.kind === 'row')\n );\n\n /** The cell the keyboard last stood on, by `rowKey` and column key. */\n private readonly activeCell = signal<{ readonly row: unknown; readonly key: string } | null>(null);\n\n /**\n * The grid's one tab stop: the active cell while it is on screen, else the\n * first data cell. `null` in a tree, where the row holds the tab stop.\n */\n private readonly tabStopCell = computed<{ readonly id: string; readonly key: string } | null>(() => {\n if (!this.editGrid() || this.treeMode()) return null;\n const rows = this.dataRows();\n const columns = this.cellColumns();\n const active = this.activeCell();\n if (active && columns.some(c => c.key === active.key)) {\n const hit = rows.find(entry => this.rowKeyOf(entry.row) === active.row);\n if (hit) return { id: hit.id, key: active.key };\n }\n return rows.length && columns.length ? { id: rows[0].id, key: columns[0].key } : null;\n });\n\n protected cellEditable(row: Record<string, unknown>, col: CellColumn<T>): boolean {\n return !!col.editTemplate && (this.editable()?.(row as T, col.key) ?? true);\n }\n\n /**\n * A data cell's `tabindex` in an editable table. In a tree the tab-stop\n * row's editable cells are tab stops, so Tab walks from the row into them.\n */\n protected cellTabindex(entry: Extract<RenderRow, { kind: 'row' }>, col: CellColumn<T>): 0 | -1 {\n if (this.treeMode()) return entry.id === this.tabStopRowId() && this.cellEditable(entry.row, col) ? 0 : -1;\n const stop = this.tabStopCell();\n return stop?.id === entry.id && stop.key === col.key ? 0 : -1;\n }\n\n /** The data cell an event came from, with its row and column. */\n private cellAt(\n target: EventTarget | null\n ): { td: HTMLTableCellElement; row: Record<string, unknown>; col: CellColumn<T> } | null {\n const td = target instanceof Element ? target.closest<HTMLTableCellElement>('.wr-table__td') : null;\n // A table nested in a cell answers for its own cells.\n if (td?.closest('.wr-table') !== this.hostEl.nativeElement) return null;\n const index = this.rowEls().findIndex(el => el.nativeElement === td.parentElement);\n const entry = this.dataRows()[index];\n const col = this.cellColumns()[td.cellIndex - this.leadingCols()];\n return entry && col ? { td, row: entry.row, col } : null;\n }\n\n protected onCellFocusin(event: FocusEvent): void {\n if (!this.editGrid()) return;\n const cell = this.cellAt(event.target);\n if (cell) this.activeCell.set({ row: this.rowKeyOf(cell.row), key: cell.col.key });\n }\n\n protected onCellDblclick(event: MouseEvent): void {\n if (!this.editGrid()) return;\n const cell = this.cellAt(event.target);\n if (cell) this.startEdit(cell.row, cell.col, cell.td);\n }\n\n protected onCellKeydown(event: KeyboardEvent): void {\n if (!this.editGrid() || event.defaultPrevented || wrIsComposing(event)) return;\n const edit = this.editing();\n if (edit) {\n if (edit.td.contains(event.target as Node)) this.onEditorKeydown(event, edit);\n return;\n }\n // Only a key pressed on the cell itself: one pressed in a control a cell\n // template drew belongs to that control.\n const cell = (event.target as Element).classList.contains('wr-table__td') ? this.cellAt(event.target) : null;\n if (!cell || event.altKey || event.metaKey) return;\n const key = this.inlineKey(event.key);\n const plain = !event.ctrlKey && !event.shiftKey;\n if (plain && (key === WR_KEYS.ENTER || key === 'F2')) {\n if (!this.startEdit(cell.row, cell.col, cell.td)) return;\n } else if (key !== WR_KEYS.SPACE && wrIsPrintableKey(event)) {\n if (!this.startEdit(cell.row, cell.col, cell.td, event.key)) return;\n } else if (event.shiftKey || !this.moveCellFocus(cell.td, key, event.ctrlKey)) {\n return;\n }\n event.preventDefault();\n }\n\n /** Arrow, Home and End on a focused cell. Ctrl is the first or last row's chord. */\n private moveCellFocus(td: HTMLTableCellElement, key: string, ctrl: boolean): boolean {\n if (ctrl && key !== WR_KEYS.HOME && key !== WR_KEYS.END) return false;\n const rows = this.rowEls().map(el => el.nativeElement);\n const tr = td.parentElement as HTMLTableRowElement;\n const row = rows.indexOf(tr);\n const first = this.leadingCols();\n const last = tr.cells.length - 1;\n let target: HTMLElement | undefined;\n switch (key) {\n case WR_KEYS.ARROW_RIGHT:\n target = tr.cells[Math.min(td.cellIndex + 1, last)];\n break;\n case WR_KEYS.ARROW_LEFT:\n target = tr.cells[Math.max(td.cellIndex - 1, first)];\n break;\n case WR_KEYS.ARROW_DOWN:\n target = rows[row + 1]?.cells[td.cellIndex];\n break;\n case WR_KEYS.ARROW_UP:\n target = rows[row - 1]?.cells[td.cellIndex];\n break;\n case WR_KEYS.HOME:\n target = (ctrl ? rows[0] : tr).cells[first];\n break;\n case WR_KEYS.END:\n target = (ctrl ? rows[rows.length - 1] : tr).cells[last];\n break;\n default:\n return false;\n }\n target?.focus();\n return true;\n }\n\n private onEditorKeydown(event: KeyboardEvent, edit: CellEdit): void {\n if (event.altKey || event.metaKey || event.ctrlKey) return;\n const target = event.target as HTMLElement;\n // Escape and Enter go to the editor's open popup first (a select's panel).\n const popup = event.key !== WR_KEYS.TAB && !!target.closest('[aria-expanded=\"true\"]');\n if (popup) return;\n if (event.key === WR_KEYS.ESCAPE) {\n this.endEdit(false, true);\n } else if (event.key === WR_KEYS.ENTER) {\n // Enter is a line break in a multi-line editor.\n if (event.shiftKey || target.tagName === 'TEXTAREA' || target.isContentEditable) return;\n this.endEdit(true, true);\n } else if (event.key === WR_KEYS.TAB) {\n this.endEdit(true, true);\n this.editableSibling(edit, event.shiftKey ? -1 : 1)?.focus();\n } else {\n return;\n }\n event.preventDefault();\n // An Escape that ended the edit must not also close the dialog around the table.\n event.stopPropagation();\n }\n\n /** The next or previous editable cell of the edited row. */\n private editableSibling(edit: CellEdit, step: 1 | -1): HTMLElement | undefined {\n const columns = this.cellColumns();\n const tr = edit.td.parentElement as HTMLTableRowElement;\n let index = columns.findIndex(c => c.key === edit.key) + step;\n while (columns[index] && !this.cellEditable(edit.row, columns[index])) index += step;\n return columns[index] ? tr.cells[index + this.leadingCols()] : undefined;\n }\n\n /**\n * Put a cell's editor in its place and move focus into it. `typed` is the\n * character that started the edit: it replaces the content of a text field.\n */\n private startEdit(row: Record<string, unknown>, col: CellColumn<T>, td: HTMLElement, typed?: string): boolean {\n if (!this.cellEditable(row, col)) return false;\n const current = untracked(this.editing);\n if (current?.row === row && current.key === col.key) return true;\n this.endEdit(true, false);\n this.holdWidthsForEdit();\n const previous = row[col.key];\n const pending = signal(previous);\n const live = (): boolean => untracked(this.editing) === edit;\n const edit: CellEdit = {\n row,\n key: col.key,\n td,\n previous,\n pending,\n context: {\n get $implicit(): unknown {\n return pending();\n },\n row,\n column: col.column as WrTableEditCellContext['column'],\n set: value => pending.set(value),\n commit: value => {\n if (!live()) return;\n pending.set(value);\n this.endEdit(true, true, false);\n },\n cancel: () => {\n if (live()) this.endEdit(false, true);\n },\n },\n };\n this.editing.set(edit);\n afterNextRender(\n () => {\n if (!live()) return;\n const field = td.querySelector<HTMLElement>(EDITOR_FOCUSABLE);\n field?.focus();\n if (typed === undefined) return;\n if (field instanceof HTMLInputElement || field instanceof HTMLTextAreaElement) {\n field.value = typed;\n field.dispatchEvent(new Event('input', { bubbles: true }));\n }\n },\n { injector: this.injector }\n );\n return true;\n }\n\n /**\n * End the edit in flight. `commit` emits `cellEdit` when the pending value\n * differs from the cell's. `focus` hands focus back to the cell: always, or\n * (`'inside'`) only when the editor held it. Either way a field that held\n * focus is blurred first when `flush` is set, for a control that publishes\n * its value on blur.\n */\n private endEdit(commit: boolean, focus: boolean | 'inside', flush = commit): void {\n const edit = untracked(this.editing);\n if (!edit) return;\n const active = edit.td.ownerDocument.activeElement;\n const held = active instanceof HTMLElement && active !== edit.td && edit.td.contains(active);\n if (flush && held) active.blur();\n // The blur may have ended it from the template.\n if (untracked(this.editing) !== edit) return;\n this.editing.set(null);\n this.releaseEditHold();\n if (focus === 'inside' ? held && edit.td.isConnected : focus) edit.td.focus();\n const value = untracked(edit.pending);\n if (commit && !Object.is(value, edit.previous)) {\n this.cellEdit.emit({ row: edit.row as T, key: edit.key, value, previous: edit.previous });\n }\n }\n\n /** Leading control columns — selection + expand. */\n protected readonly leadingCols = computed<number>(() => (this.rowSelection() ? 1 : 0) + (this.expandable() ? 1 : 0));\n\n /** Total rendered columns (data + leading), for detail-row / empty colspans. */\n protected readonly totalCols = computed<number>(() => this.displayColumns().length + this.leadingCols());\n\n protected expandTemplate(): TemplateRef<WrTableExpandContext> | undefined {\n return this.expandTpl()?.template;\n }\n\n private readonly expandedSet = computed(() => new Set(this.expanded()));\n\n protected isExpanded(row: Record<string, unknown>): boolean {\n return this.expandedSet().has(this.rowKeyOf(row));\n }\n\n protected toggleExpand(row: Record<string, unknown>): void {\n const key = this.rowKeyOf(row);\n const set = this.expanded();\n this.expanded.set(set.includes(key) ? set.filter(k => k !== key) : [...set, key]);\n }\n\n private readonly expandContexts = new WeakMap<Record<string, unknown>, WrTableExpandContext>();\n\n protected expandContext(row: Record<string, unknown>): WrTableExpandContext {\n let context = this.expandContexts.get(row);\n if (!context) {\n context = { $implicit: row, row };\n this.expandContexts.set(row, context);\n }\n return context;\n }\n\n // --- Summary row ----------------------------------------------------------\n\n /** Whether any column defines a `summary` (so the footer row shows). */\n protected readonly hasSummary = computed<boolean>(() =>\n this.displayColumns().some(c => c.column.summary !== undefined)\n );\n\n /** Per-column footer values, computed over `items` (the current page in server mode). */\n private readonly summaries = computed<ReadonlyMap<string, unknown>>(() => {\n // Every node in tree mode, not just the roots — a headcount that ignored\n // children would be wrong in the obvious way.\n const rows = this.datasetRows();\n const map = new Map<string, unknown>();\n for (const [key, col] of Object.entries(this.columns())) {\n if (col.summary !== undefined) map.set(key, this.computeSummary(col.summary, rows, key, WR_TABLE_TOTAL_SCOPE));\n }\n return map;\n });\n\n protected summaryFor(key: string): unknown {\n return this.summaries().get(key) ?? '';\n }\n\n // --- Row grouping ---------------------------------------------------------\n\n private readonly groupTpl = contentChild(WrTableGroupHeader);\n\n protected groupTemplate(): TemplateRef<WrTableGroupContext> | undefined {\n return this.groupTpl()?.template;\n }\n\n /**\n * Rows on the current page bucketed by `groupBy`, in first-appearance order.\n * Depends only on `visibleItems()` + `groupBy` (not on collapse / summary), so\n * a collapse toggle never re-buckets. The ungrouped path returns one synthetic\n * bucket holding the same array instance `visibleItems()` returned.\n */\n private readonly groupBuckets = computed<readonly { value: unknown; rows: readonly Record<string, unknown>[] }[]>(\n () => {\n const rows = this.visibleItems() ?? [];\n const by = this.groupBy();\n if (by === null) return [{ value: WR_TABLE_UNGROUPED, rows }];\n const buckets = new Map<unknown, Record<string, unknown>[]>();\n for (const row of rows) {\n const value = typeof by === 'function' ? by(row) : row[by];\n const bucket = buckets.get(value);\n if (bucket) bucket.push(row);\n else buckets.set(value, [row]);\n }\n return Array.from(buckets, ([value, groupRows]) => ({ value, rows: groupRows }));\n }\n );\n\n /**\n * The flat `<tbody>` render list. Ungrouped it is exactly today's rows in\n * order (the rendered elements are unchanged; only the `@for` track identity\n * moves to a stable id). Returns `[]` for nullish rows, and reads nothing about\n * `loading()` — suppressing the \"no data\" row under the spinner is the\n * template's job, not this one's.\n */\n protected readonly renderRows = computed<readonly RenderRow[]>(() => {\n const rows = this.visibleItems();\n if (!rows) return [];\n const buckets = this.groupBuckets();\n\n if (this.groupBy() === null) {\n const roots = buckets[0].rows;\n if (this.treeMode()) return this.flattenForest(roots);\n return roots.map((row, i) => flatRow(row, `r${i}`, i + 1, roots.length));\n }\n\n const collapsed = new Set(this.collapsedGroups());\n const summaryCols =\n this.groupSummary() && this.hasSummary()\n ? Object.entries(this.columns()).filter(([, c]) => c.summary !== undefined)\n : [];\n\n const out: RenderRow[] = [];\n buckets.forEach((bucket, gi) => {\n const isCollapsed = collapsed.has(bucket.value);\n const label = this.groupLabelOf(bucket.value);\n const group: WrTableGroupContext = {\n $implicit: bucket.value,\n value: bucket.value,\n label,\n rows: bucket.rows,\n count: bucket.rows.length,\n collapsed: isCollapsed,\n index: gi,\n toggle: () => this.toggleGroupCollapse(bucket.value),\n };\n out.push({ kind: 'group', id: `g${gi}`, group });\n if (isCollapsed) return;\n bucket.rows.forEach((row, ri) => out.push(flatRow(row, `g${gi}r${ri}`, ri + 1, bucket.rows.length)));\n if (summaryCols.length) {\n const summaries = new Map<string, unknown>();\n const context: WrTableSummaryContext = { scope: 'group', group };\n for (const [key, col] of summaryCols) {\n summaries.set(key, this.computeSummary(col.summary!, bucket.rows, key, context));\n }\n out.push({ kind: 'group-foot', id: `g${gi}f`, summaries });\n }\n });\n return out;\n });\n\n /** Default band label — the primitive as text, `'—'` for empty, JSON for objects. */\n private groupLabelOf(value: unknown): string {\n if (value == null || value === '') return '—';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'bigint' || typeof value === 'boolean') return String(value);\n // Objects / symbols / functions aren't the documented contract (groupBy\n // should return a primitive, like rowKey); format gracefully anyway.\n try {\n return JSON.stringify(value) ?? '—';\n } catch {\n return '—';\n }\n }\n\n protected toggleGroupCollapse(value: unknown): void {\n const set = this.collapsedGroups();\n this.collapsedGroups.set(set.includes(value) ? set.filter(v => v !== value) : [...set, value]);\n }\n\n /** Collapse every group on the current page. No-op when `groupBy` is unset. */\n collapseAllGroups(): void {\n if (this.groupBy() === null) return;\n this.collapsedGroups.set(this.groupBuckets().map(b => b.value));\n }\n\n /** Expand every group. */\n expandAllGroups(): void {\n this.collapsedGroups.set([]);\n }\n\n // --- Group selection (memoized Set; reuses the row-selection primitive) ----\n\n /** Memoized selection as a Set — O(1) membership for row + group + select-all checks. */\n private readonly selectionSet = computed<ReadonlySet<unknown>>(() => new Set(this.selection()));\n\n protected groupChecked(rows: readonly Record<string, unknown>[]): boolean {\n if (rows.length === 0) return false;\n const sel = this.selectionSet();\n return rows.every(r => sel.has(this.rowKeyOf(r)));\n }\n\n protected groupIndeterminate(rows: readonly Record<string, unknown>[]): boolean {\n const sel = this.selectionSet();\n return rows.some(r => sel.has(this.rowKeyOf(r))) && !this.groupChecked(rows);\n }\n\n protected toggleGroupSelection(rows: readonly Record<string, unknown>[], checked: boolean): void {\n this.applySelection(\n rows.map(r => this.rowKeyOf(r)),\n checked\n );\n }\n\n // --- CSV export -----------------------------------------------------------\n\n /**\n * Build the table as an RFC-4180 CSV string — a header row from the column\n * titles, then one row per item in the current column order. A cell is what\n * the plain cell shows: the column's `empty` for a missing value, its\n * `format` over the value, else the raw value. A `[wrTableCell]` template is\n * not run, so a column drawn by one exports its `format` or its data.\n *\n * Covers the current `items`, so in server-side mode (`total` set) it\n * exports the current page, while client-side pagination exports every page.\n *\n * Returns the string; use `exportCsv()` when you want it downloaded as a file.\n *\n * @example\n * ```ts\n * const csv = this.table().toCsv({ delimiter: ';' });\n * ```\n */\n toCsv(options: WrTableCsvOptions = {}): string {\n const delimiter = options.delimiter ?? ',';\n const escapeFormulas = options.escapeFormulas ?? true;\n const cols = this.displayColumns();\n const rows = options.selectedOnly ? this.selectedRows() : this.datasetRows();\n const text = (value: unknown): string => {\n if (value == null) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint') return String(value);\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? '' : value.toISOString();\n try {\n return JSON.stringify(value) ?? '';\n } catch {\n // Circular structures and nested bigints throw — never fail the export over one cell.\n return '';\n }\n };\n // Spreadsheets evaluate a cell starting with these, so a string that can\n // hold row data is neutralized into text. A number or an `empty` placeholder\n // of `-` is left alone.\n const field = (s: string, data: boolean): string => {\n if (data && escapeFormulas && /^[=+\\-@\\t\\r]/.test(s)) s = `'${s}`;\n return s.includes(delimiter) || /[\"\\r\\n]/.test(s) ? `\"${s.replace(/\"/g, '\"\"')}\"` : s;\n };\n const lines = [cols.map(col => field(col.column.title, true)).join(delimiter)];\n for (const row of rows) {\n lines.push(\n cols\n .map(col => {\n const value = row[col.key];\n if (noValue(value)) return field(col.column.empty ?? '', false);\n const { format } = col.column;\n if (!format) return field(text(value), typeof value === 'string' && !CSV_FIGURE.test(value));\n // `format` can read anything on the row, whatever type the value is.\n const shown = format(value, row as T);\n return field(shown, !CSV_FIGURE.test(shown));\n })\n .join(delimiter)\n );\n }\n return lines.join('\\r\\n');\n }\n\n /** Download the table as a CSV file. No-op on the server. */\n exportCsv(options: WrTableCsvOptions = {}): void {\n if (!isPlatformBrowser(this.platformId)) return;\n // Lead with a BOM so Excel reads the file as UTF-8.\n const blob = new Blob([`\\uFEFF${this.toCsv(options)}`], { type: 'text/csv;charset=utf-8;' });\n wrDownloadBlob(blob, options.filename ?? 'table.csv');\n }\n\n /**\n * Every row of the dataset. Flat that is `items`; in tree mode it is the whole\n * forest depth-first, so selection, CSV and the grand summary count children\n * instead of silently reporting roots only.\n */\n private datasetRows(): readonly Record<string, unknown>[] {\n return this.treeMode() ? this.allTreeRows() : (this.rows() ?? []);\n }\n\n private selectedRows(): readonly Record<string, unknown>[] {\n const keys = new Set(this.selection());\n return this.datasetRows().filter(row => keys.has(this.rowKeyOf(row)));\n }\n\n private computeSummary(\n kind: WrTableSummary,\n rows: readonly Record<string, unknown>[],\n key: string,\n context: WrTableSummaryContext\n ): unknown {\n // The context is the only thing that tells a subtotal from the grand total:\n // with one group on screen both are handed the same rows.\n if (typeof kind === 'function') return kind(rows, context);\n // Drop empty/nullish cells first — `Number('')`/`Number(null)` are 0 and\n // would otherwise skew the aggregate.\n const values = rows.map(row => row[key]).filter(v => v != null && v !== '');\n if (kind === 'count') return values.length;\n // A column of decimal strings is summed as digits, never as doubles:\n // `'0.1' + '0.2'` is `'0.3'`. One string in the column is enough, so a\n // number mixed in is read exactly too; an all-number column keeps the\n // engine's arithmetic and its output.\n if (values.some(v => typeof v === 'string')) return decimalSummary(kind, values);\n const nums = values.map(Number).filter(Number.isFinite);\n if (nums.length === 0) return '';\n const sum = nums.reduce((a, b) => a + b, 0);\n switch (kind) {\n case 'sum':\n return sum;\n case 'avg':\n return Math.round((sum / nums.length) * 100) / 100;\n // Reduced rather than spread: a summary aggregates the WHOLE dataset (or a\n // whole group bucket), not the page, and `Math.min(...nums)` throws\n // `RangeError: Maximum call stack size exceeded` past ~125k arguments — out\n // of a `computed()` during change detection, which stops the table\n // rendering. `nums` is non-empty and finite by here, so a seedless reduce is\n // safe, and it agrees with `Math.min`/`Math.max` on everything a summary\n // renders (they differ only on the sign of a zero tie).\n case 'min':\n return nums.reduce((a, b) => (b < a ? b : a));\n case 'max':\n return nums.reduce((a, b) => (b > a ? b : a));\n default:\n return '';\n }\n }\n\n protected directionFor(key: string): WrTableSortDirection {\n return this.sort().find(s => s.key === key)?.direction ?? null;\n }\n\n /** The keys that actually sort, in application order — an entry with no direction does not. */\n private readonly activeSortKeys = computed<readonly string[]>(() =>\n this.sort()\n .filter(s => s.direction)\n .map(s => s.key)\n );\n\n /**\n * `aria-sort` for a column header, per the WAI-ARIA table pattern. Only a\n * sortable column gets the attribute at all: on a plain column it would claim\n * the header is sortable when it is not.\n *\n * Only the PRIMARY key announces a direction. ARIA asks for `aria-sort` on one\n * header at a time, and a screen reader that hears \"ascending\" on two columns\n * has no way to learn which one orders the rows — the secondary key only\n * breaks ties inside the first. So every other sortable column, a secondary\n * key included, says `none`, and its place in the order is drawn instead (see\n * {@link sortOrderFor}).\n */\n protected ariaSortFor(key: string, sortable: boolean | undefined): 'ascending' | 'descending' | 'none' | null {\n if (!sortable) return null;\n if (this.activeSortKeys()[0] !== key) return 'none';\n const dir = this.directionFor(key);\n return dir === 'asc' ? 'ascending' : dir === 'desc' ? 'descending' : 'none';\n }\n\n /**\n * A sorted column's 1-based place in a MULTI-column sort, drawn beside its\n * indicator — `null` while one column or none sorts, where a lone \"1\" would\n * say nothing the arrow does not.\n */\n protected sortOrderFor(key: string): number | null {\n const keys = this.activeSortKeys();\n if (keys.length < 2) return null;\n const at = keys.indexOf(key);\n return at < 0 ? null : at + 1;\n }\n\n protected cycleSort(key: string): void {\n const current = this.directionFor(key);\n const next: WrTableSortDirection = current === null ? 'asc' : current === 'asc' ? 'desc' : null;\n\n // A flip keeps the column's place in the order: the first entry is the\n // primary key, and reversing it is not a new sort. A new column joins at\n // the end; one cycled back to unsorted leaves.\n const list = this.sort().slice();\n const at = list.findIndex(s => s.key === key);\n if (next === null) list.splice(at, 1);\n else if (at === -1) list.push({ key, direction: next });\n else list[at] = { key, direction: next };\n this.sort.set(list);\n this.readerChanges.update(n => n + 1);\n }\n\n protected onFilter(key: string, items: readonly WrTableFilterItem[]): void {\n this.filterChange.emit({ key, items });\n this.readerChanges.update(n => n + 1);\n }\n\n protected cellContext(item: Record<string, unknown>, col: CellColumn<T>): WrTableCellContext {\n let context = col.contexts.get(item);\n if (!context) {\n context = new CellContext(item, col.column as WrTableCellContext['column'], col.key);\n col.contexts.set(item, context);\n }\n return context;\n }\n\n /**\n * What a plain cell shows: the column's `empty` for a missing value, its\n * `format` over the value, else the value itself. A cell template takes\n * this path's place entirely (see table.html).\n */\n protected cellText(item: Record<string, unknown>, key: string, column: WrTableColumn<T>): unknown {\n const value = item[key];\n if (noValue(value)) return column.empty ?? '';\n return column.format ? column.format(value, item as T) : value;\n }\n}\n","@switch (loadingForm()) {\n @case ('overlay') {\n <div class=\"wr-table__loading\" role=\"status\" [attr.aria-label]=\"resolvedLoadingLabel()\">\n <wr-spinner size=\"lg\" />\n </div>\n }\n @case ('bar') {\n <div class=\"wr-table__loading-bar\" role=\"status\" [attr.aria-label]=\"resolvedLoadingLabel()\"></div>\n }\n}\n\n@if (columnChooser()) {\n <div class=\"wr-table__toolbar\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-table__columns-btn\"\n position=\"bottom-end\"\n [wrPopover]=\"chooser\"\n [ariaLabel]=\"resolvedColumnsLabel()\"\n >\n {{ resolvedColumnsLabel() }}\n </button>\n <ng-template #chooser>\n <div class=\"wr-table__columns\">\n <wr-table-column-chooser [table]=\"this\" [ariaLabel]=\"resolvedColumnsLabel()\" />\n </div>\n </ng-template>\n </div>\n}\n\n<!-- The selection bar lies over the header: a box of no height in front of\n the scroll area, so the bar stays put while the columns scroll under it.\n The count is announced from a region that is in the DOM before it has\n anything to say, and the drawn copy is hidden from it. -->\n@if (hasSelectionBar()) {\n <div class=\"wr-table__selection\">\n <span class=\"wr-table__selection-status\" role=\"status\">{{ selectionBar() ? selectionCountText() : '' }}</span>\n @if (selectionBar(); as tpl) {\n <div\n #selectionBarEl\n class=\"wr-table__selection-bar\"\n [class.wr-table__selection-bar--inset]=\"rowSelection() === 'multiple'\"\n [style.--wr-table-selection-bar-height.px]=\"selectionBarHeight()\"\n >\n <span class=\"wr-table__selection-count\" aria-hidden=\"true\">{{ selectionCountText() }}</span>\n <button wr-btn type=\"button\" size=\"sm\" class=\"wr-table__selection-clear\" (click)=\"clearSelection()\">\n {{ resolvedClearSelectionLabel() }}\n </button>\n <div class=\"wr-table__selection-actions\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"selectionContext()\" />\n </div>\n </div>\n }\n </div>\n}\n\n<!-- With a selection bar the scroll area takes focus from script, for the bar\n to hand it to when it leaves a table that has no checkbox to take it. -->\n<div\n class=\"wr-table__scroll\"\n #scroll\n [style.--wr-table-scroll-height]=\"scrollHeight()\"\n [style.--wr-table-head-height.px]=\"stickyEdges().head\"\n [style.--wr-table-foot-height.px]=\"stickyEdges().foot\"\n [attr.tabindex]=\"scrollable() ? 0 : hasSelectionBar() ? -1 : null\"\n>\n <table\n class=\"wr-table__table\"\n [class.wr-table__table--fixed]=\"fixedLayoutActive()\"\n [style.--wr-table-row-h.px]=\"virtualized() ? effRowH() : null\"\n [attr.aria-rowcount]=\"virtualized() ? renderRows().length + 1 + (hasSummary() && items()?.length ? 1 : 0) : null\"\n [attr.role]=\"treeMode() ? 'treegrid' : editGrid() ? 'grid' : null\"\n [attr.aria-multiselectable]=\"treeMode() && rowSelection() === 'multiple' ? true : null\"\n >\n <colgroup>\n @if (rowSelection()) {\n <col class=\"wr-table__col--lead\" />\n }\n @if (expandable()) {\n <col class=\"wr-table__col--lead\" />\n }\n @for (col of cellColumns(); track col.key) {\n <col [style.width.px]=\"col.width\" />\n }\n </colgroup>\n <thead #head>\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [cdkDropListSortPredicate]=\"sortPredicate\"\n (cdkDropListDropped)=\"onColumnDrop($event)\"\n (cdkDropListSorted)=\"onColumnListSorted($event)\"\n (cdkDropListEntered)=\"onColumnListEntered()\"\n (cdkDropListExited)=\"onColumnListExited()\"\n >\n @if (rowSelection()) {\n <th class=\"wr-table__th wr-table__th--select\">\n @if (rowSelection() === 'multiple') {\n <!-- Disabled with nothing to sweep, the way `wr-transfer` guards its\n own select-all. `[checked]` is a one-way binding over a checkbox\n that owns its state, and on zero rows `allSelected()` answers\n `false` before and after the click — an unchanged input is never\n written back, so the box latched CHECKED over an empty table and\n stayed that way when rows returned. -->\n <wr-checkbox\n size=\"sm\"\n [checked]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n [disabled]=\"selectAllKeys().size === 0\"\n (checkedChange)=\"toggleAll($event)\"\n [ariaLabel]=\"resolvedSelectAllLabel()\"\n />\n }\n </th>\n }\n @if (expandable()) {\n <th class=\"wr-table__th wr-table__th--expand\"></th>\n }\n <!-- `inert` under the selection bar: a control the bar covers takes no\n focus and no click. The select-all cell stays out from under it. -->\n @for (col of cellColumns(); track col.key) {\n <th\n #thCell\n cdkDrag\n [attr.inert]=\"selectionBar() ? '' : null\"\n [cdkDragDisabled]=\"!reorderable() || col.pinned\"\n (cdkDragStarted)=\"onColumnDragStart($event)\"\n (cdkDragMoved)=\"onColumnDragMoved($event)\"\n (cdkDragEnded)=\"onColumnDragEnd()\"\n [class]=\"col.thClass\"\n [attr.aria-sort]=\"ariaSortFor(col.key, col.column.sortable)\"\n [attr.aria-label]=\"col.column.title ? null : (col.column.headerHint ?? null)\"\n [class.wr-table__th--draggable]=\"reorderable() && !col.pinned\"\n [class.wr-table__th--pin-left]=\"col.pinLeft\"\n [class.wr-table__th--pin-right]=\"col.pinRight\"\n [class.wr-table__th--pin-edge-left]=\"col.edgeLeft\"\n [class.wr-table__th--pin-edge-right]=\"col.edgeRight\"\n [style.inset-inline-start.px]=\"col.start\"\n [style.inset-inline-end.px]=\"col.end\"\n >\n <div class=\"wr-table__th-inner\">\n <span class=\"wr-table__title\">{{ col.column.title }}</span>\n\n @if (col.column.sortable) {\n <button\n type=\"button\"\n class=\"wr-table__sort-btn\"\n [attr.aria-label]=\"sortLabelFor(headerName(col.column))\"\n (click)=\"cycleSort(col.key)\"\n >\n <wr-table-sort [direction]=\"directionFor(col.key)\" />\n </button>\n <!-- A column's place in a multi-column sort. Drawn, because only the\n primary key announces `aria-sort` (see ariaSortFor). Beside the\n button rather than in it: inside, the digit is visible text the\n button's name (\"Sort Role\") does not contain, which is a WCAG\n 2.5.3 label-in-name failure. Hidden, so the column header's own\n name stays its title. -->\n @if (sortOrderFor(col.key); as order) {\n <span class=\"wr-table__sort-order\" aria-hidden=\"true\">{{ order }}</span>\n }\n }\n\n @if (col.column.filterItems; as filterItems) {\n @if (filterItems.length) {\n <wr-table-filter\n [items]=\"filterItems\"\n [column]=\"headerName(col.column)\"\n (selectionChange)=\"onFilter(col.key, $event)\"\n />\n }\n }\n </div>\n\n @if (col.column.resizable) {\n <span\n class=\"wr-table__resize-handle\"\n aria-hidden=\"true\"\n (pointerdown)=\"onResizeStart($event, col.key, thCell)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeEnd($event)\"\n (pointercancel)=\"onResizeEnd($event)\"\n (mousedown)=\"$event.stopPropagation()\"\n (touchstart)=\"$event.stopPropagation()\"\n ></span>\n }\n </th>\n }\n </tr>\n </thead>\n\n <!-- One delegated listener for `rowClick`, which is pointer only by contract:\n the body is no control, and a row's keyboard path is the consumer's own\n button or link in a cell. The other three serve inline editing and\n return at once in a table with no edit template. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <tbody\n (click)=\"onBodyClick($event)\"\n (dblclick)=\"onCellDblclick($event)\"\n (keydown)=\"onCellKeydown($event)\"\n (focusin)=\"onCellFocusin($event)\"\n >\n @if (visibleItems()) {\n @if (virtualized() && virtualWindow().padTop > 0) {\n <tr class=\"wr-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"totalCols()\" [style.height.px]=\"virtualWindow().padTop\"></td>\n </tr>\n }\n @let edit = editing();\n @for (entry of windowRows(); track entry.id; let i = $index) {\n @if (entry.kind === 'group') {\n <tr class=\"wr-table__group-row\" [class.wr-table__group-row--collapsed]=\"entry.group.collapsed\">\n <td class=\"wr-table__group-cell\" [attr.colspan]=\"totalCols()\">\n <!-- The cell spans the full table width; this inner box is what sticks. -->\n <div class=\"wr-table__group-inner\">\n @if (rowSelection() === 'multiple') {\n <wr-checkbox\n class=\"wr-table__group-select\"\n size=\"sm\"\n [checked]=\"groupChecked(entry.group.rows)\"\n [indeterminate]=\"groupIndeterminate(entry.group.rows)\"\n (checkedChange)=\"toggleGroupSelection(entry.group.rows, $event)\"\n [ariaLabelledby]=\"groupControlLabelledby('select-group', entry.id)\"\n />\n }\n @if (groupTemplate(); as tpl) {\n <button\n type=\"button\"\n class=\"wr-table__group-toggle wr-table__group-toggle--icon\"\n [attr.aria-expanded]=\"!entry.group.collapsed\"\n [attr.aria-labelledby]=\"groupControlLabelledby('toggle-group', entry.id)\"\n (click)=\"toggleGroupCollapse(entry.group.value)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__group-icon\"\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 <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"entry.group\" />\n <!-- The group's name for the two controls above. A custom header\n is the consumer's markup, with nothing in it to point at. -->\n <span hidden [id]=\"groupLabelId(entry.id)\">{{ entry.group.label }}</span>\n } @else {\n <button\n type=\"button\"\n class=\"wr-table__group-toggle\"\n [attr.aria-expanded]=\"!entry.group.collapsed\"\n [attr.aria-labelledby]=\"groupToggleLabelledby(entry.id)\"\n (click)=\"toggleGroupCollapse(entry.group.value)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__group-icon\"\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 <span class=\"wr-table__group-label\" [id]=\"groupLabelId(entry.id)\">{{ entry.group.label }}</span>\n @if (showGroupCount()) {\n <!-- A real space between the label and the count. Whitespace\n alone draws nothing in a flex row, and without it the\n button's text reads \"admin2\" — which the name\n \"Toggle group admin 2\" does not contain, a label-in-name\n mismatch for any tool that compares the two. -->\n &ngsp;<span class=\"wr-table__group-count\" [id]=\"groupCountId(entry.id)\">{{\n entry.group.count\n }}</span>\n }\n </button>\n }\n </div>\n </td>\n </tr>\n } @else if (entry.kind === 'group-foot') {\n <tr class=\"wr-table__group-foot-row\">\n @if (rowSelection()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @if (expandable()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @for (col of cellColumns(); track col.key) {\n <td\n [class]=\"col.footClass\"\n [class.wr-table__td--pin-left]=\"col.pinLeft\"\n [class.wr-table__td--pin-right]=\"col.pinRight\"\n [class.wr-table__td--pin-edge-left]=\"col.edgeLeft\"\n [class.wr-table__td--pin-edge-right]=\"col.edgeRight\"\n [style.inset-inline-start.px]=\"col.start\"\n [style.inset-inline-end.px]=\"col.end\"\n >\n {{ entry.summaries.get(col.key) ?? '' }}\n </td>\n }\n </tr>\n } @else {\n <tr\n #rowEl\n [class]=\"rowClasses(entry.row, i)\"\n [class.wr-table__tr--selected]=\"rowSelection() && isRowSelected(entry.row)\"\n [class.wr-table__tr--child]=\"entry.depth > 0\"\n [attr.aria-rowindex]=\"virtualized() ? windowStart() + i + 2 : null\"\n [attr.aria-level]=\"treeMode() ? entry.depth + 1 : null\"\n [attr.aria-posinset]=\"treeMode() ? entry.posinset : null\"\n [attr.aria-setsize]=\"treeMode() ? entry.setsize : null\"\n [attr.aria-expanded]=\"entry.open\"\n [attr.aria-selected]=\"treeMode() && rowSelection() ? isRowSelected(entry.row) : null\"\n [attr.tabindex]=\"treeMode() ? (entry.id === tabStopRowId() ? 0 : -1) : null\"\n [style.--wr-table-depth]=\"treeMode() ? entry.depth : null\"\n >\n @if (rowSelection()) {\n <td class=\"wr-table__td wr-table__td--select\">\n <wr-checkbox\n size=\"sm\"\n [checked]=\"isRowSelected(entry.row)\"\n (checkedChange)=\"toggleRow(entry.row, $event)\"\n [ariaLabelledby]=\"rowControlLabelledby('select-row', entry.id)\"\n />\n </td>\n }\n @if (expandable()) {\n <td class=\"wr-table__td wr-table__td--expand\">\n <button\n type=\"button\"\n class=\"wr-table__expand-btn\"\n [class.wr-table__expand-btn--open]=\"isExpanded(entry.row)\"\n [attr.aria-expanded]=\"isExpanded(entry.row)\"\n [attr.aria-labelledby]=\"rowControlLabelledby('expand-row', entry.id)\"\n (click)=\"toggleExpand(entry.row)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__expand-icon\"\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 </td>\n }\n @for (col of cellColumns(); track col.key) {\n @let cellEdit = edit !== null && edit.row === entry.row && edit.key === col.key ? edit : null;\n <td\n [class]=\"col.tdClass\"\n [class.wr-table__td--pin-left]=\"col.pinLeft\"\n [class.wr-table__td--pin-right]=\"col.pinRight\"\n [class.wr-table__td--pin-edge-left]=\"col.edgeLeft\"\n [class.wr-table__td--pin-edge-right]=\"col.edgeRight\"\n [style.inset-inline-start.px]=\"col.start\"\n [style.inset-inline-end.px]=\"col.end\"\n [style.max-width.px]=\"col.maxWidth\"\n [attr.data-label]=\"col.column.title\"\n [attr.id]=\"col.label ? rowLabelId(entry.id) : null\"\n [attr.tabindex]=\"editGrid() ? cellTabindex(entry, col) : null\"\n [class.wr-table__td--editable]=\"col.editTemplate ? cellEditable(entry.row, col) : false\"\n [class.wr-table__td--editing]=\"cellEdit !== null\"\n >\n @if (col.tree) {\n <span class=\"wr-table__tree-lead\">\n @if (entry.parent) {\n <button\n type=\"button\"\n class=\"wr-table__tree-toggle\"\n [class.wr-table__tree-toggle--open]=\"entry.open\"\n [attr.aria-expanded]=\"entry.open\"\n [attr.aria-labelledby]=\"rowControlLabelledby('toggle-row', entry.id)\"\n (click)=\"toggleTreeRow(entry.row)\"\n >\n <svg\n class=\"wr-icon__svg wr-table__tree-icon\"\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 } @else {\n <span class=\"wr-table__tree-toggle wr-table__tree-toggle--leaf\" aria-hidden=\"true\"></span>\n }\n </span>\n }\n @if (cellEdit) {\n <ng-container\n [ngTemplateOutlet]=\"col.editTemplate ?? null\"\n [ngTemplateOutletContext]=\"cellEdit.context\"\n />\n } @else if (col.template; as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"cellContext(entry.row, col)\" />\n } @else {\n {{ cellText(entry.row, col.key, col.column) }}\n }\n </td>\n }\n </tr>\n @if (expandable() && isExpanded(entry.row)) {\n <tr class=\"wr-table__detail-row\">\n <td class=\"wr-table__detail\" [attr.colspan]=\"totalCols()\">\n <ng-container\n [ngTemplateOutlet]=\"expandTemplate() ?? null\"\n [ngTemplateOutletContext]=\"expandContext(entry.row)\"\n />\n </td>\n </tr>\n }\n }\n }\n @if (virtualized() && virtualWindow().padBottom > 0) {\n <tr class=\"wr-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"totalCols()\" [style.height.px]=\"virtualWindow().padBottom\"></td>\n </tr>\n }\n }\n <!-- Sibling of the row loop rather than its `@empty` branch, and gated on\n `loading()`. As the `@empty` branch it lived INSIDE `@if (visibleItems())`,\n which passes a nullish `[items]` straight through — so the input's own\n default rendered a header over a blank body with no \"No data\" anywhere,\n the opposite of what `items`'s docs promise. And the veil is translucent,\n so on the documented `[items]=\"[]\" [loading]=\"true\"` pair the row read\n \"No data\" through the spinner. -->\n @if (!loading() && !renderRows().length) {\n <tr>\n <td class=\"wr-table__empty\" [attr.colspan]=\"totalCols()\">{{ resolvedEmptyLabel() }}</td>\n </tr>\n }\n </tbody>\n\n @if (hasSummary() && items()?.length) {\n <tfoot #foot>\n <tr class=\"wr-table__foot-row\">\n @if (rowSelection()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @if (expandable()) {\n <td class=\"wr-table__foot-cell wr-table__foot-cell--lead\"></td>\n }\n @for (col of cellColumns(); track col.key) {\n <td\n [class]=\"col.footClass\"\n [class.wr-table__td--pin-left]=\"col.pinLeft\"\n [class.wr-table__td--pin-right]=\"col.pinRight\"\n [class.wr-table__td--pin-edge-left]=\"col.edgeLeft\"\n [class.wr-table__td--pin-edge-right]=\"col.edgeRight\"\n [style.inset-inline-start.px]=\"col.start\"\n [style.inset-inline-end.px]=\"col.end\"\n >\n {{ summaryFor(col.key) }}\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n</div>\n\n@if (showPager()) {\n <div class=\"wr-table__pager\">\n <wr-pagination\n [page]=\"page()\"\n (pageChange)=\"onPagerPage($event)\"\n [pageSize]=\"currentPageSize()\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [total]=\"resolvedTotal()\"\n [size]=\"paginationSize()\"\n [showSizeChanger]=\"pageSizeOptions().length > 0\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n />\n </div>\n}\n\n<!-- The table's one tooltip, for a header hint or a cut cell (see `tip`). -->\n@if (tip(); as shown) {\n <span hidden [wrPopover]=\"shown.text\" mode=\"tooltip\" [wrPopoverOrigin]=\"shown.el\"></span>\n}\n\n<!-- The action words the row and group controls are named with, once per table.\n `aria-labelledby` reads a hidden element it points at, so each control joins\n one of these to its own row's (or group's) label. Only the words a control\n in this table uses are rendered. -->\n@if (rowSelection() || expandable() || treeMode() || groupBy() !== null) {\n <div hidden>\n @if (rowSelection()) {\n <span [id]=\"actionId('select-row')\">{{ resolvedSelectRowLabel() }}</span>\n }\n @if (expandable()) {\n <span [id]=\"actionId('expand-row')\">{{ resolvedExpandRowLabel() }}</span>\n }\n @if (treeMode()) {\n <span [id]=\"actionId('toggle-row')\">{{ resolvedToggleRowLabel() }}</span>\n }\n @if (groupBy() !== null) {\n @if (rowSelection() === 'multiple') {\n <span [id]=\"actionId('select-group')\">{{ resolvedSelectGroupLabel() }}</span>\n }\n <span [id]=\"actionId('toggle-group')\">{{ resolvedToggleGroupLabel() }}</span>\n }\n </div>\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 type { WrTableSortAccessor, WrTableSortState } from './types';\n\n// `>` between a number and a string coerces and is false both ways, which is\n// not an order. Ranking the kind first keeps a mixed column totally ordered.\nfunction compareValues(left: string | number, right: string | number): number {\n const rank = kindOf(left) - kindOf(right);\n\n if (rank !== 0) {\n return rank;\n }\n\n return left > right ? 1 : left < right ? -1 : 0;\n}\n\nfunction kindOf(value: string | number): number {\n if (value === '' || Number.isNaN(value)) {\n return 0;\n }\n\n return typeof value === 'number' ? 1 : 2;\n}\n\n/**\n * Reads the column `key` off a row as the value `wrSortRows` compares.\n *\n * - `null`, `undefined`, `''` and an invalid `Date` read as `''`.\n * - A number stays a number, and a bigint reads as one.\n * - A string that is a finite number reads as that number, so `'10'` sorts\n * after `'9'`. A blank string stays a string: it is not `0`.\n * - A boolean reads as `0` or `1`, so `false` sorts before `true`.\n * - A `Date` reads as its timestamp.\n * - Anything else reads as `String(value)`.\n *\n * @example\n * ```ts\n * wrReadField({ qty: '10' }, 'qty'); // 10\n * wrReadField({ qty: null }, 'qty'); // ''\n * ```\n *\n * @param item The row.\n * @param key The column key, a property of the row.\n */\nexport function wrReadField<T>(item: T, key: string): string | number {\n const value = (item as Record<string, unknown> | null | undefined)?.[key];\n\n if (value === null || value === undefined || value === '') {\n return '';\n }\n\n switch (typeof value) {\n case 'number':\n return value;\n case 'boolean':\n case 'bigint':\n return Number(value);\n case 'string': {\n const asNumber = value.trim() === '' ? NaN : Number(value);\n return Number.isFinite(asNumber) ? asNumber : value;\n }\n }\n\n if (value instanceof Date) {\n const time = value.getTime();\n return Number.isNaN(time) ? '' : time;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- an object answers with its own toString\n return String(value);\n}\n\n/**\n * Sorts rows by the sort state `<wr-table>` holds. The table draws the arrows\n * and never reorders `items`, so the host sorts them.\n *\n * Entries apply in array order: the first decides, later ones break ties. An\n * entry with a `null` direction is skipped. Within a column, empty values come\n * first, then numbers, then text in code-unit order; `desc` reverses all of\n * it. Rows equal on every key keep their input order.\n *\n * Returns `rows` itself when there is nothing to sort, and a sorted copy\n * otherwise: the input is never mutated.\n *\n * @example\n * ```ts\n * protected readonly sort = signal<readonly WrTableSortState[]>([]);\n * protected readonly rows = computed(() => wrSortRows(this.source(), this.sort()));\n * ```\n *\n * @param rows The rows to sort.\n * @param sort The table's `sort` state.\n * @param accessor Reads the value of a key; defaults to `wrReadField`.\n */\nexport function wrSortRows<T>(\n rows: readonly T[],\n sort: readonly WrTableSortState[],\n accessor: WrTableSortAccessor<T> = wrReadField\n): readonly T[] {\n const active = (sort ?? []).filter(state => !!state.direction);\n\n if (!active.length || !rows?.length) {\n return rows;\n }\n\n return [...rows].sort((a, b) => {\n for (const { key, direction } of active) {\n const result = compareValues(accessor(a, key), accessor(b, key));\n\n if (result !== 0) {\n return direction === 'desc' ? -result : result;\n }\n }\n\n return 0;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,cAAb,MAAa,YAAW;CAEb,YAAY,MAAM,SAAQ;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAM,OAAO;CAAa,CAAA;CAMpD,gBAAgB,MAAuC,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAEjE,WAAW,OAA8C,WAAW;CAY7E,OAAO,uBACL,MACA,MAAa;EAEb,OAAO;CACT;CA3BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YA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