ngwr 16.6.0 → 16.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/avatar/styles/_index.scss +39 -0
- package/button/styles/_index.scss +45 -2
- package/checkbox/styles/_index.scss +4 -0
- package/copy-value/styles/_index.scss +4 -0
- package/dropdown/styles/_index.scss +17 -0
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +4 -3
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +171 -6
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-breadcrumbs.mjs +9 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +26 -6
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +5 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +9 -9
- package/fesm2022/ngwr-charts-core.mjs +6 -6
- package/fesm2022/ngwr-charts-donut-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-meter-group.mjs +3 -3
- package/fesm2022/ngwr-charts-radar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-scatter-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +6 -6
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +7 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +35 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +103 -53
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +40 -16
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +19 -18
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +181 -18
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-dropdown-testing.mjs +5 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +59 -16
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +6 -5
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +7 -6
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +5 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +68 -13
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +18 -16
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +30 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +100 -11
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +6 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +6 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +6 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +6 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +6 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +6 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +6 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +6 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +6 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +6 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +6 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-kk.mjs +520 -0
- package/fesm2022/ngwr-i18n-kk.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ko.mjs +6 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +6 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +6 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +6 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +6 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +6 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +6 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +6 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +6 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +6 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +8 -4
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-otp.mjs +3 -3
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +16 -15
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +9 -9
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination-testing.mjs +3 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +32 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +27 -27
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +7 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +126 -16
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +75 -10
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form.mjs +10 -6
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +255 -7
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select.mjs +28 -19
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +17 -1
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +66 -11
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-sortable-list.mjs +11 -11
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-router.mjs +89 -0
- package/fesm2022/ngwr-table-router.mjs.map +1 -0
- package/fesm2022/ngwr-table-testing.mjs +5 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +282 -43
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +11 -7
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +8 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +60 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +15 -15
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +7 -6
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +30 -2
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +18 -13
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +16 -0
- package/graph/styles/_index.scss +48 -0
- package/i18n/ar.json +4 -2
- package/i18n/cs.json +4 -2
- package/i18n/de.json +4 -2
- package/i18n/en.json +4 -2
- package/i18n/es.json +4 -2
- package/i18n/fr.json +4 -2
- package/i18n/he.json +4 -2
- package/i18n/hi.json +4 -2
- package/i18n/id.json +4 -2
- package/i18n/it.json +4 -2
- package/i18n/ja.json +4 -2
- package/i18n/kk.json +567 -0
- package/i18n/ko.json +4 -2
- package/i18n/nl.json +4 -2
- package/i18n/pl.json +4 -2
- package/i18n/pt.json +4 -2
- package/i18n/ru.json +4 -2
- package/i18n/sv.json +4 -2
- package/i18n/tr.json +4 -2
- package/i18n/uk.json +4 -2
- package/i18n/vi.json +4 -2
- package/i18n/zh-TW.json +4 -2
- package/i18n/zh.json +4 -2
- package/llms-full.txt +29 -18
- package/llms.txt +4 -1
- package/package.json +15 -7
- package/pagination/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +4 -2
- package/progress/styles/_index.scss +64 -0
- package/radio/styles/_index.scss +4 -0
- package/schematics/use/symbol-map.json +5 -0
- package/sidebar/styles/_index.scss +58 -6
- package/skills/ngwr/SKILL.md +7 -6
- package/skills/ngwr/references/catalog.md +6 -4
- package/switch/styles/_index.scss +4 -0
- package/table/styles/_index.scss +128 -32
- package/tabs/styles/_index.scss +9 -0
- package/theme/styles/_focus.scss +3 -1
- package/tour/styles/_index.scss +3 -2
- package/types/ngwr-avatar.d.ts +39 -0
- package/types/ngwr-button.d.ts +12 -0
- package/types/ngwr-date-picker-testing.d.ts +22 -0
- package/types/ngwr-date-picker.d.ts +84 -17
- package/types/ngwr-date.d.ts +51 -0
- package/types/ngwr-directives.d.ts +45 -0
- package/types/ngwr-dropdown-testing.d.ts +8 -1
- package/types/ngwr-dropdown.d.ts +29 -0
- package/types/ngwr-file-upload-testing.d.ts +10 -0
- package/types/ngwr-file-upload.d.ts +55 -1
- package/types/ngwr-form.d.ts +3 -1
- package/types/ngwr-graph-testing.d.ts +28 -1
- package/types/ngwr-graph.d.ts +53 -3
- package/types/ngwr-i18n-kk.d.ts +3 -0
- package/types/ngwr-image-cropper.d.ts +6 -0
- package/types/ngwr-pagination-testing.d.ts +8 -0
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-popover.d.ts +39 -0
- package/types/ngwr-progress.d.ts +63 -1
- package/types/ngwr-scroll.d.ts +95 -0
- package/types/ngwr-select.d.ts +31 -12
- package/types/ngwr-sidebar-testing.d.ts +21 -7
- package/types/ngwr-sidebar.d.ts +66 -4
- package/types/ngwr-table-router.d.ts +49 -0
- package/types/ngwr-table-testing.d.ts +7 -0
- package/types/ngwr-table.d.ts +185 -6
- package/types/ngwr-tabs-router.d.ts +4 -5
- package/types/ngwr-tabs-testing.d.ts +5 -1
- package/types/ngwr-tabs.d.ts +34 -1
- package/types/ngwr-utils.d.ts +13 -0
- package/types/ngwr-version.d.ts +1 -1
package/fesm2022/ngwr-table.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, DestroyRef, Directive, ElementRef, Injector, PLATFORM_ID, TemplateRef, ViewEncapsulation, afterNextRender, computed, contentChild, contentChildren, effect, inject, input, isDevMode, linkedSignal, model, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, Directive, ElementRef, InjectionToken, Injector, PLATFORM_ID, TemplateRef, ViewEncapsulation, afterNextRender, computed, contentChild, contentChildren, effect, inject, input, isDevMode, linkedSignal, model, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
3
3
|
import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
|
|
4
4
|
import { DOCUMENT as DOCUMENT$1, NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
5
5
|
import { WR_KEYS, wrCheckStyles, wrDecimal, wrDecimalAdd, wrDecimalCompare, wrDecimalDivide, wrDownloadBlob, wrIsComposing, wrIsPrintableKey, wrToClassList, wrWatchDragCancel } from "ngwr/utils";
|
|
@@ -31,7 +31,7 @@ var WrTableCell = class WrTableCell {
|
|
|
31
31
|
}
|
|
32
32
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
33
33
|
minVersion: "12.0.0",
|
|
34
|
-
version: "22.
|
|
34
|
+
version: "22.3.0",
|
|
35
35
|
ngImport: i0,
|
|
36
36
|
type: WrTableCell,
|
|
37
37
|
deps: [],
|
|
@@ -39,7 +39,7 @@ var WrTableCell = class WrTableCell {
|
|
|
39
39
|
});
|
|
40
40
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
41
41
|
minVersion: "17.1.0",
|
|
42
|
-
version: "22.
|
|
42
|
+
version: "22.3.0",
|
|
43
43
|
type: WrTableCell,
|
|
44
44
|
isStandalone: true,
|
|
45
45
|
selector: "[wrTableCell]",
|
|
@@ -64,7 +64,7 @@ var WrTableCell = class WrTableCell {
|
|
|
64
64
|
};
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({
|
|
66
66
|
minVersion: "12.0.0",
|
|
67
|
-
version: "22.
|
|
67
|
+
version: "22.3.0",
|
|
68
68
|
ngImport: i0,
|
|
69
69
|
type: WrTableCell,
|
|
70
70
|
decorators: [{
|
|
@@ -120,7 +120,7 @@ var WrTableColumnChooser = class WrTableColumnChooser {
|
|
|
120
120
|
}
|
|
121
121
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
122
122
|
minVersion: "12.0.0",
|
|
123
|
-
version: "22.
|
|
123
|
+
version: "22.3.0",
|
|
124
124
|
ngImport: i0,
|
|
125
125
|
type: WrTableColumnChooser,
|
|
126
126
|
deps: [],
|
|
@@ -128,7 +128,7 @@ var WrTableColumnChooser = class WrTableColumnChooser {
|
|
|
128
128
|
});
|
|
129
129
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
130
130
|
minVersion: "17.0.0",
|
|
131
|
-
version: "22.
|
|
131
|
+
version: "22.3.0",
|
|
132
132
|
type: WrTableColumnChooser,
|
|
133
133
|
isStandalone: true,
|
|
134
134
|
selector: "wr-table-column-chooser",
|
|
@@ -185,7 +185,7 @@ var WrTableColumnChooser = class WrTableColumnChooser {
|
|
|
185
185
|
};
|
|
186
186
|
i0.ɵɵngDeclareClassMetadata({
|
|
187
187
|
minVersion: "12.0.0",
|
|
188
|
-
version: "22.
|
|
188
|
+
version: "22.3.0",
|
|
189
189
|
ngImport: i0,
|
|
190
190
|
type: WrTableColumnChooser,
|
|
191
191
|
decorators: [{
|
|
@@ -248,7 +248,7 @@ var WrTableEditCell = class WrTableEditCell {
|
|
|
248
248
|
}
|
|
249
249
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
250
250
|
minVersion: "12.0.0",
|
|
251
|
-
version: "22.
|
|
251
|
+
version: "22.3.0",
|
|
252
252
|
ngImport: i0,
|
|
253
253
|
type: WrTableEditCell,
|
|
254
254
|
deps: [],
|
|
@@ -256,7 +256,7 @@ var WrTableEditCell = class WrTableEditCell {
|
|
|
256
256
|
});
|
|
257
257
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
258
258
|
minVersion: "17.1.0",
|
|
259
|
-
version: "22.
|
|
259
|
+
version: "22.3.0",
|
|
260
260
|
type: WrTableEditCell,
|
|
261
261
|
isStandalone: true,
|
|
262
262
|
selector: "[wrTableEditCell]",
|
|
@@ -281,7 +281,7 @@ var WrTableEditCell = class WrTableEditCell {
|
|
|
281
281
|
};
|
|
282
282
|
i0.ɵɵngDeclareClassMetadata({
|
|
283
283
|
minVersion: "12.0.0",
|
|
284
|
-
version: "22.
|
|
284
|
+
version: "22.3.0",
|
|
285
285
|
ngImport: i0,
|
|
286
286
|
type: WrTableEditCell,
|
|
287
287
|
decorators: [{
|
|
@@ -317,7 +317,7 @@ var WrTableExpand = class WrTableExpand {
|
|
|
317
317
|
template = inject(TemplateRef);
|
|
318
318
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
319
319
|
minVersion: "12.0.0",
|
|
320
|
-
version: "22.
|
|
320
|
+
version: "22.3.0",
|
|
321
321
|
ngImport: i0,
|
|
322
322
|
type: WrTableExpand,
|
|
323
323
|
deps: [],
|
|
@@ -325,7 +325,7 @@ var WrTableExpand = class WrTableExpand {
|
|
|
325
325
|
});
|
|
326
326
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
327
327
|
minVersion: "14.0.0",
|
|
328
|
-
version: "22.
|
|
328
|
+
version: "22.3.0",
|
|
329
329
|
type: WrTableExpand,
|
|
330
330
|
isStandalone: true,
|
|
331
331
|
selector: "ng-template[wrTableExpand]",
|
|
@@ -334,7 +334,7 @@ var WrTableExpand = class WrTableExpand {
|
|
|
334
334
|
};
|
|
335
335
|
i0.ɵɵngDeclareClassMetadata({
|
|
336
336
|
minVersion: "12.0.0",
|
|
337
|
-
version: "22.
|
|
337
|
+
version: "22.3.0",
|
|
338
338
|
ngImport: i0,
|
|
339
339
|
type: WrTableExpand,
|
|
340
340
|
decorators: [{
|
|
@@ -409,7 +409,7 @@ var WrTableFilter = class WrTableFilter {
|
|
|
409
409
|
}
|
|
410
410
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
411
411
|
minVersion: "12.0.0",
|
|
412
|
-
version: "22.
|
|
412
|
+
version: "22.3.0",
|
|
413
413
|
ngImport: i0,
|
|
414
414
|
type: WrTableFilter,
|
|
415
415
|
deps: [],
|
|
@@ -417,7 +417,7 @@ var WrTableFilter = class WrTableFilter {
|
|
|
417
417
|
});
|
|
418
418
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
419
419
|
minVersion: "17.0.0",
|
|
420
|
-
version: "22.
|
|
420
|
+
version: "22.3.0",
|
|
421
421
|
type: WrTableFilter,
|
|
422
422
|
isStandalone: true,
|
|
423
423
|
selector: "wr-table-filter",
|
|
@@ -498,7 +498,7 @@ var WrTableFilter = class WrTableFilter {
|
|
|
498
498
|
};
|
|
499
499
|
i0.ɵɵngDeclareClassMetadata({
|
|
500
500
|
minVersion: "12.0.0",
|
|
501
|
-
version: "22.
|
|
501
|
+
version: "22.3.0",
|
|
502
502
|
ngImport: i0,
|
|
503
503
|
type: WrTableFilter,
|
|
504
504
|
decorators: [{
|
|
@@ -580,7 +580,7 @@ var WrTableGroupHeader = class WrTableGroupHeader {
|
|
|
580
580
|
template = inject(TemplateRef);
|
|
581
581
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
582
582
|
minVersion: "12.0.0",
|
|
583
|
-
version: "22.
|
|
583
|
+
version: "22.3.0",
|
|
584
584
|
ngImport: i0,
|
|
585
585
|
type: WrTableGroupHeader,
|
|
586
586
|
deps: [],
|
|
@@ -588,7 +588,7 @@ var WrTableGroupHeader = class WrTableGroupHeader {
|
|
|
588
588
|
});
|
|
589
589
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
590
590
|
minVersion: "14.0.0",
|
|
591
|
-
version: "22.
|
|
591
|
+
version: "22.3.0",
|
|
592
592
|
type: WrTableGroupHeader,
|
|
593
593
|
isStandalone: true,
|
|
594
594
|
selector: "ng-template[wrTableGroupHeader]",
|
|
@@ -597,7 +597,7 @@ var WrTableGroupHeader = class WrTableGroupHeader {
|
|
|
597
597
|
};
|
|
598
598
|
i0.ɵɵngDeclareClassMetadata({
|
|
599
599
|
minVersion: "12.0.0",
|
|
600
|
-
version: "22.
|
|
600
|
+
version: "22.3.0",
|
|
601
601
|
ngImport: i0,
|
|
602
602
|
type: WrTableGroupHeader,
|
|
603
603
|
decorators: [{
|
|
@@ -611,6 +611,18 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
611
611
|
* Use of this source code is governed by an MIT-style license that can be
|
|
612
612
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
613
613
|
*/
|
|
614
|
+
function foldSearchText(text) {
|
|
615
|
+
return text.normalize("NFD").replace(/\p{M}/gu, "").toLocaleLowerCase();
|
|
616
|
+
}
|
|
617
|
+
function plainSearchText(value) {
|
|
618
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint" ? String(value) : "";
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* @license
|
|
622
|
+
*
|
|
623
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
624
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
625
|
+
*/
|
|
614
626
|
var WrTableSelectionBar = class WrTableSelectionBar {
|
|
615
627
|
wrTableSelectionBarOf = input(void 0, ...ngDevMode ? [{ debugName: "wrTableSelectionBarOf" }] : /* istanbul ignore next */ []);
|
|
616
628
|
template = inject(TemplateRef);
|
|
@@ -619,7 +631,7 @@ var WrTableSelectionBar = class WrTableSelectionBar {
|
|
|
619
631
|
}
|
|
620
632
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
621
633
|
minVersion: "12.0.0",
|
|
622
|
-
version: "22.
|
|
634
|
+
version: "22.3.0",
|
|
623
635
|
ngImport: i0,
|
|
624
636
|
type: WrTableSelectionBar,
|
|
625
637
|
deps: [],
|
|
@@ -627,7 +639,7 @@ var WrTableSelectionBar = class WrTableSelectionBar {
|
|
|
627
639
|
});
|
|
628
640
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
629
641
|
minVersion: "17.1.0",
|
|
630
|
-
version: "22.
|
|
642
|
+
version: "22.3.0",
|
|
631
643
|
type: WrTableSelectionBar,
|
|
632
644
|
isStandalone: true,
|
|
633
645
|
selector: "ng-template[wrTableSelectionBar]",
|
|
@@ -643,7 +655,7 @@ var WrTableSelectionBar = class WrTableSelectionBar {
|
|
|
643
655
|
};
|
|
644
656
|
i0.ɵɵngDeclareClassMetadata({
|
|
645
657
|
minVersion: "12.0.0",
|
|
646
|
-
version: "22.
|
|
658
|
+
version: "22.3.0",
|
|
647
659
|
ngImport: i0,
|
|
648
660
|
type: WrTableSelectionBar,
|
|
649
661
|
decorators: [{
|
|
@@ -678,7 +690,7 @@ var WrTableSort = class WrTableSort {
|
|
|
678
690
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
679
691
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
680
692
|
minVersion: "12.0.0",
|
|
681
|
-
version: "22.
|
|
693
|
+
version: "22.3.0",
|
|
682
694
|
ngImport: i0,
|
|
683
695
|
type: WrTableSort,
|
|
684
696
|
deps: [],
|
|
@@ -686,7 +698,7 @@ var WrTableSort = class WrTableSort {
|
|
|
686
698
|
});
|
|
687
699
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
688
700
|
minVersion: "17.0.0",
|
|
689
|
-
version: "22.
|
|
701
|
+
version: "22.3.0",
|
|
690
702
|
type: WrTableSort,
|
|
691
703
|
isStandalone: true,
|
|
692
704
|
selector: "wr-table-sort",
|
|
@@ -709,7 +721,7 @@ var WrTableSort = class WrTableSort {
|
|
|
709
721
|
};
|
|
710
722
|
i0.ɵɵngDeclareClassMetadata({
|
|
711
723
|
minVersion: "12.0.0",
|
|
712
|
-
version: "22.
|
|
724
|
+
version: "22.3.0",
|
|
713
725
|
ngImport: i0,
|
|
714
726
|
type: WrTableSort,
|
|
715
727
|
decorators: [{
|
|
@@ -740,6 +752,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
740
752
|
* Use of this source code is governed by an MIT-style license that can be
|
|
741
753
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
742
754
|
*/
|
|
755
|
+
const WR_TABLE_ROUTING = new InjectionToken("WR_TABLE_ROUTING");
|
|
756
|
+
/**
|
|
757
|
+
* @license
|
|
758
|
+
*
|
|
759
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
760
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
761
|
+
*/
|
|
743
762
|
const WR_TABLE_UNGROUPED = Symbol("wr-table-ungrouped");
|
|
744
763
|
var CellContext = class {
|
|
745
764
|
item;
|
|
@@ -763,6 +782,17 @@ const EDITOR_FOCUSABLE = [
|
|
|
763
782
|
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
764
783
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
765
784
|
].join(", ");
|
|
785
|
+
const HEADER_CLICK_IGNORE = [
|
|
786
|
+
"button",
|
|
787
|
+
"a[href]",
|
|
788
|
+
"input",
|
|
789
|
+
"select",
|
|
790
|
+
"textarea",
|
|
791
|
+
"[role=button]",
|
|
792
|
+
"label",
|
|
793
|
+
".wr-table-filter",
|
|
794
|
+
".wr-table__resize-handle"
|
|
795
|
+
].join(", ");
|
|
766
796
|
let tableUid = 0;
|
|
767
797
|
const WR_TABLE_TOTAL_SCOPE = {
|
|
768
798
|
scope: "total",
|
|
@@ -783,6 +813,7 @@ const ROW_CLICK_IGNORE = [
|
|
|
783
813
|
".wr-table__td--select",
|
|
784
814
|
".wr-table__td--expand"
|
|
785
815
|
].join(", ");
|
|
816
|
+
const EXTERNAL_URL = /^(?:[a-z][a-z\d+.-]*:|\/\/)/i;
|
|
786
817
|
function sameList(a, b) {
|
|
787
818
|
return a.length === b.length && a.every((value, i) => Object.is(value, b[i]));
|
|
788
819
|
}
|
|
@@ -832,7 +863,60 @@ function flatRow(row, id, posinset, setsize) {
|
|
|
832
863
|
var WrTable = class WrTable {
|
|
833
864
|
columns = input.required(...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
834
865
|
items = input(null, ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
835
|
-
|
|
866
|
+
source = computed(() => this.items(), ...ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []);
|
|
867
|
+
search = input("", ...ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []);
|
|
868
|
+
searchColumns = computed(() => {
|
|
869
|
+
this.source();
|
|
870
|
+
return {
|
|
871
|
+
cols: this.displayColumns().filter((c) => !c.column.actions && c.column.searchable !== false),
|
|
872
|
+
folded: /* @__PURE__ */ new WeakMap()
|
|
873
|
+
};
|
|
874
|
+
}, ...ngDevMode ? [{ debugName: "searchColumns" }] : /* istanbul ignore next */ []);
|
|
875
|
+
searched = computed(() => {
|
|
876
|
+
const source = this.source();
|
|
877
|
+
const query = foldSearchText((this.search() ?? "").trim());
|
|
878
|
+
if (!source || !query || this.total() !== null) return {
|
|
879
|
+
rows: source,
|
|
880
|
+
kids: null
|
|
881
|
+
};
|
|
882
|
+
const { cols, folded } = this.searchColumns();
|
|
883
|
+
const matches = (row) => {
|
|
884
|
+
let texts = folded.get(row);
|
|
885
|
+
if (!texts) folded.set(row, texts = []);
|
|
886
|
+
return cols.some((c, i) => {
|
|
887
|
+
const value = row[c.key];
|
|
888
|
+
if (noValue(value)) return false;
|
|
889
|
+
const cached = texts[i];
|
|
890
|
+
if (cached !== void 0) return cached.includes(query);
|
|
891
|
+
const text = foldSearchText(c.column.format ? c.column.format(value, row) : plainSearchText(value));
|
|
892
|
+
texts[i] = text;
|
|
893
|
+
return text.includes(query);
|
|
894
|
+
});
|
|
895
|
+
};
|
|
896
|
+
if (!this.treeMode()) return {
|
|
897
|
+
rows: source.filter(matches),
|
|
898
|
+
kids: null
|
|
899
|
+
};
|
|
900
|
+
const kids = /* @__PURE__ */ new Map();
|
|
901
|
+
const prune = (rows, seen) => {
|
|
902
|
+
const kept = [];
|
|
903
|
+
for (const row of rows) {
|
|
904
|
+
const key = this.rowKeyOf(row);
|
|
905
|
+
if (seen.has(key)) continue;
|
|
906
|
+
const children = prune(this.childrenOf(row, false), new Set(seen).add(key));
|
|
907
|
+
if (children.length > 0 || matches(row)) {
|
|
908
|
+
kids.set(row, children);
|
|
909
|
+
kept.push(row);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
return kept;
|
|
913
|
+
};
|
|
914
|
+
return {
|
|
915
|
+
rows: prune(source, /* @__PURE__ */ new Set()),
|
|
916
|
+
kids
|
|
917
|
+
};
|
|
918
|
+
}, ...ngDevMode ? [{ debugName: "searched" }] : /* istanbul ignore next */ []);
|
|
919
|
+
rows = computed(() => this.searched().rows, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
836
920
|
loading = input(false, {
|
|
837
921
|
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
838
922
|
transform: coerceBooleanProperty
|
|
@@ -974,15 +1058,65 @@ var WrTable = class WrTable {
|
|
|
974
1058
|
}
|
|
975
1059
|
}
|
|
976
1060
|
rowClick = output();
|
|
1061
|
+
rowClickBound() {
|
|
1062
|
+
return !!this.rowClick.listeners?.length;
|
|
1063
|
+
}
|
|
1064
|
+
rowLink = input(null, ...ngDevMode ? [{ debugName: "rowLink" }] : /* istanbul ignore next */ []);
|
|
1065
|
+
routing = inject(WR_TABLE_ROUTING, { optional: true });
|
|
1066
|
+
warnedNoRouting = false;
|
|
1067
|
+
rowLinks = computed(() => {
|
|
1068
|
+
const links = /* @__PURE__ */ new Map();
|
|
1069
|
+
const rowLink = this.rowLink();
|
|
1070
|
+
if (!rowLink) return links;
|
|
1071
|
+
const routing = this.routing;
|
|
1072
|
+
for (const { row } of this.dataRows()) {
|
|
1073
|
+
const link = rowLink(row);
|
|
1074
|
+
if (link == null || link === "") continue;
|
|
1075
|
+
if (typeof link === "string" && (!routing || EXTERNAL_URL.test(link))) links.set(row, {
|
|
1076
|
+
href: link,
|
|
1077
|
+
routed: null
|
|
1078
|
+
});
|
|
1079
|
+
else if (routing) links.set(row, {
|
|
1080
|
+
href: routing.href(link),
|
|
1081
|
+
routed: link
|
|
1082
|
+
});
|
|
1083
|
+
else if (!this.warnedNoRouting && (typeof ngDevMode === "undefined" || ngDevMode)) {
|
|
1084
|
+
this.warnedNoRouting = true;
|
|
1085
|
+
console.error("[NGWR] <wr-table>: `rowLink` returned router commands, but no routing adapter is provided. Add `WrTableRouting` from `ngwr/table/router` to the table, or return an href string.");
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
return links;
|
|
1089
|
+
}, ...ngDevMode ? [{ debugName: "rowLinks" }] : /* istanbul ignore next */ []);
|
|
1090
|
+
linkColumnKey = computed(() => {
|
|
1091
|
+
if (!this.rowLink()) return null;
|
|
1092
|
+
return this.displayColumns().find((c) => !c.column.pin)?.key ?? this.labelColumnKey();
|
|
1093
|
+
}, ...ngDevMode ? [{ debugName: "linkColumnKey" }] : /* istanbul ignore next */ []);
|
|
977
1094
|
onBodyClick(event) {
|
|
978
1095
|
const target = event.target;
|
|
979
1096
|
const index = this.rowEls().findIndex((el) => el.nativeElement.contains(target));
|
|
980
1097
|
if (index < 0) return;
|
|
981
1098
|
const tr = this.rowEls()[index].nativeElement;
|
|
1099
|
+
const row = this.dataRows()[index];
|
|
1100
|
+
if (!row) return;
|
|
1101
|
+
const link = this.rowLinks().get(row.row);
|
|
1102
|
+
if (link && target.closest(".wr-table__row-link")?.closest("tr") === tr) {
|
|
1103
|
+
if (link.routed !== null) this.routing?.navigate(link.routed, event);
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
982
1106
|
const control = target.closest(ROW_CLICK_IGNORE);
|
|
983
1107
|
if (control && control !== tr && tr.contains(control)) return;
|
|
984
|
-
|
|
985
|
-
|
|
1108
|
+
if (link && target.closest(".wr-table__td--truncate")?.parentElement === tr) {
|
|
1109
|
+
const { ctrlKey, shiftKey, altKey, metaKey } = event;
|
|
1110
|
+
tr.querySelector(":scope > td > .wr-table__row-link")?.dispatchEvent(new MouseEvent("click", {
|
|
1111
|
+
bubbles: true,
|
|
1112
|
+
cancelable: true,
|
|
1113
|
+
ctrlKey,
|
|
1114
|
+
shiftKey,
|
|
1115
|
+
altKey,
|
|
1116
|
+
metaKey
|
|
1117
|
+
}));
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
986
1120
|
const item = row.row;
|
|
987
1121
|
this.rowClick.emit({
|
|
988
1122
|
row: item,
|
|
@@ -1235,6 +1369,19 @@ var WrTable = class WrTable {
|
|
|
1235
1369
|
console.warn("[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).");
|
|
1236
1370
|
});
|
|
1237
1371
|
}
|
|
1372
|
+
let lastSearch = null;
|
|
1373
|
+
effect(() => {
|
|
1374
|
+
const query = (this.search() ?? "").trim();
|
|
1375
|
+
if (lastSearch === null) {
|
|
1376
|
+
lastSearch = query;
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
if (query === lastSearch) return;
|
|
1380
|
+
lastSearch = query;
|
|
1381
|
+
untracked(() => {
|
|
1382
|
+
if (this.total() === null && this.page() !== 1) this.page.set(1);
|
|
1383
|
+
});
|
|
1384
|
+
});
|
|
1238
1385
|
effect(() => {
|
|
1239
1386
|
const shown = this.shownPage();
|
|
1240
1387
|
if (shown === this.page() || !this.rows()?.length) return;
|
|
@@ -1321,6 +1468,23 @@ var WrTable = class WrTable {
|
|
|
1321
1468
|
}
|
|
1322
1469
|
});
|
|
1323
1470
|
});
|
|
1471
|
+
let measuredFor;
|
|
1472
|
+
effect(() => {
|
|
1473
|
+
const key = `${this.size()}|${this.rowHeight() === 0}|${(this.rows()?.length ?? 0) > 0}`;
|
|
1474
|
+
if (measuredFor === void 0 || measuredFor === key) {
|
|
1475
|
+
measuredFor = key;
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
measuredFor = key;
|
|
1479
|
+
if (!isPlatformBrowser(this.platformId)) return;
|
|
1480
|
+
if (!untracked(() => this.virtualized()) || untracked(() => this.rowHeight()) !== 0) return;
|
|
1481
|
+
this.remeasuring.set(true);
|
|
1482
|
+
afterNextRender(() => {
|
|
1483
|
+
const h = (this.scrollEl()?.nativeElement.querySelector(".wr-table__tr"))?.offsetHeight ?? 0;
|
|
1484
|
+
if (h > 0) this.measuredRowPx.set(h);
|
|
1485
|
+
this.remeasuring.set(false);
|
|
1486
|
+
}, { injector: this.injector });
|
|
1487
|
+
});
|
|
1324
1488
|
effect((onCleanup) => {
|
|
1325
1489
|
const el = this.scrollEl()?.nativeElement;
|
|
1326
1490
|
if (!el || !this.virtualized() || !isPlatformBrowser(this.platformId)) return;
|
|
@@ -1441,10 +1605,11 @@ var WrTable = class WrTable {
|
|
|
1441
1605
|
const editors = this.editMap();
|
|
1442
1606
|
const tableTruncate = this.truncate();
|
|
1443
1607
|
const labelKey = this.labelColumnKey();
|
|
1608
|
+
const linkKey = this.linkColumnKey();
|
|
1444
1609
|
const treeKey = this.treeColumnKey();
|
|
1445
1610
|
return this.displayColumns().map(({ key, column }) => {
|
|
1446
1611
|
const { align, pin } = column;
|
|
1447
|
-
const truncates = (column.truncate === void 0 ? tableTruncate : column.truncate) === "tooltip";
|
|
1612
|
+
const truncates = (column.truncate === void 0 ? column.actions ? null : tableTruncate : column.truncate) === "tooltip";
|
|
1448
1613
|
const tdClass = cellClasses("wr-table__td", column);
|
|
1449
1614
|
return {
|
|
1450
1615
|
key,
|
|
@@ -1463,6 +1628,7 @@ var WrTable = class WrTable {
|
|
|
1463
1628
|
maxWidth: truncates ? column.width ?? null : null,
|
|
1464
1629
|
actions: !!column.actions,
|
|
1465
1630
|
label: key === labelKey,
|
|
1631
|
+
link: key === linkKey,
|
|
1466
1632
|
tree: key === treeKey,
|
|
1467
1633
|
template: templates.get(key),
|
|
1468
1634
|
editTemplate: column.editable === false ? void 0 : editors.get(key),
|
|
@@ -1477,6 +1643,7 @@ var WrTable = class WrTable {
|
|
|
1477
1643
|
}, ...ngDevMode ? [{ debugName: "overflow" }] : /* istanbul ignore next */ []);
|
|
1478
1644
|
truncate = input(null, ...ngDevMode ? [{ debugName: "truncate" }] : /* istanbul ignore next */ []);
|
|
1479
1645
|
layout = input("auto", ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
1646
|
+
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
1480
1647
|
headerName(column) {
|
|
1481
1648
|
const { title, headerHint } = column;
|
|
1482
1649
|
if (!headerHint) return title;
|
|
@@ -1503,9 +1670,12 @@ var WrTable = class WrTable {
|
|
|
1503
1670
|
text
|
|
1504
1671
|
});
|
|
1505
1672
|
}
|
|
1506
|
-
rowClasses(row, index) {
|
|
1673
|
+
rowClasses(row, index, linked) {
|
|
1507
1674
|
const extra = this.rowClass()?.(row, index);
|
|
1508
|
-
|
|
1675
|
+
let own = "wr-table__tr";
|
|
1676
|
+
if (linked) own += " wr-table__tr--link";
|
|
1677
|
+
if (this.rowClickBound()) own += " wr-table__tr--clickable";
|
|
1678
|
+
return extra ? wrToClassList(own, extra).join(" ") : own;
|
|
1509
1679
|
}
|
|
1510
1680
|
resizeWidths = signal(/* @__PURE__ */ new Map(), ...ngDevMode ? [{ debugName: "resizeWidths" }] : /* istanbul ignore next */ []);
|
|
1511
1681
|
resizeKey = null;
|
|
@@ -1571,6 +1741,8 @@ var WrTable = class WrTable {
|
|
|
1571
1741
|
scrollTop = signal(0, ...ngDevMode ? [{ debugName: "scrollTop" }] : /* istanbul ignore next */ []);
|
|
1572
1742
|
viewportPx = signal(0, ...ngDevMode ? [{ debugName: "viewportPx" }] : /* istanbul ignore next */ []);
|
|
1573
1743
|
measuredRowPx = signal(0, ...ngDevMode ? [{ debugName: "measuredRowPx" }] : /* istanbul ignore next */ []);
|
|
1744
|
+
remeasuring = signal(false, ...ngDevMode ? [{ debugName: "remeasuring" }] : /* istanbul ignore next */ []);
|
|
1745
|
+
rowHeightVar = computed(() => this.virtualized() && !this.remeasuring() && (this.rowHeight() > 0 || this.measuredRowPx() > 0) ? this.effRowH() : null, ...ngDevMode ? [{ debugName: "rowHeightVar" }] : /* istanbul ignore next */ []);
|
|
1574
1746
|
virtualFixed = signal(false, ...ngDevMode ? [{ debugName: "virtualFixed" }] : /* istanbul ignore next */ []);
|
|
1575
1747
|
virtualized = computed(() => this.virtualScroll() && this.groupBy() === null && !this.treeMode() && !this.expandable() && !this.responsive() && this.currentPageSize() === 0 && this.total() === null && !!this.visibleItems(), ...ngDevMode ? [{ debugName: "virtualized" }] : /* istanbul ignore next */ []);
|
|
1576
1748
|
effRowH = computed(() => this.rowHeight() > 0 ? this.rowHeight() : this.measuredRowPx() || WrTable.FALLBACK_ROW_PX, ...ngDevMode ? [{ debugName: "effRowH" }] : /* istanbul ignore next */ []);
|
|
@@ -1791,7 +1963,9 @@ var WrTable = class WrTable {
|
|
|
1791
1963
|
const named = this.treeColumn();
|
|
1792
1964
|
return named !== null && shown.some((c) => c.key === named) ? named : shown[0]?.key ?? null;
|
|
1793
1965
|
}, ...ngDevMode ? [{ debugName: "treeColumnKey" }] : /* istanbul ignore next */ []);
|
|
1794
|
-
childrenOf(row) {
|
|
1966
|
+
childrenOf(row, searched = true) {
|
|
1967
|
+
const kept = searched ? this.searched().kids : null;
|
|
1968
|
+
if (kept) return kept.get(row) ?? [];
|
|
1795
1969
|
const ck = this.childrenKey();
|
|
1796
1970
|
if (ck === null) return [];
|
|
1797
1971
|
const raw = typeof ck === "function" ? ck(row) : row[ck];
|
|
@@ -1823,18 +1997,18 @@ var WrTable = class WrTable {
|
|
|
1823
1997
|
walk(roots, 0, "", /* @__PURE__ */ new Set());
|
|
1824
1998
|
return out;
|
|
1825
1999
|
}
|
|
1826
|
-
allTreeRows() {
|
|
2000
|
+
allTreeRows(searched = true) {
|
|
1827
2001
|
const out = [];
|
|
1828
2002
|
const walk = (rows, seen) => {
|
|
1829
2003
|
for (const row of rows) {
|
|
1830
2004
|
const key = this.rowKeyOf(row);
|
|
1831
2005
|
if (seen.has(key)) continue;
|
|
1832
2006
|
out.push(row);
|
|
1833
|
-
const children = this.childrenOf(row);
|
|
2007
|
+
const children = this.childrenOf(row, searched);
|
|
1834
2008
|
if (children.length > 0) walk(children, new Set(seen).add(key));
|
|
1835
2009
|
}
|
|
1836
2010
|
};
|
|
1837
|
-
walk(this.rows() ?? [], /* @__PURE__ */ new Set());
|
|
2011
|
+
walk((searched ? this.rows() : this.source()) ?? [], /* @__PURE__ */ new Set());
|
|
1838
2012
|
return out;
|
|
1839
2013
|
}
|
|
1840
2014
|
toggleTreeRow(row) {
|
|
@@ -1905,7 +2079,16 @@ var WrTable = class WrTable {
|
|
|
1905
2079
|
break;
|
|
1906
2080
|
}
|
|
1907
2081
|
break;
|
|
1908
|
-
case WR_KEYS.ENTER:
|
|
2082
|
+
case WR_KEYS.ENTER: {
|
|
2083
|
+
const anchor = this.rowLinks().has(entry.row) ? els[index].nativeElement.querySelector(":scope > td > .wr-table__row-link") : null;
|
|
2084
|
+
if (anchor) {
|
|
2085
|
+
anchor.click();
|
|
2086
|
+
break;
|
|
2087
|
+
}
|
|
2088
|
+
if (!this.rowSelection()) return;
|
|
2089
|
+
this.toggleRow(entry.row, !this.isRowSelected(entry.row));
|
|
2090
|
+
break;
|
|
2091
|
+
}
|
|
1909
2092
|
case WR_KEYS.SPACE:
|
|
1910
2093
|
if (!this.rowSelection()) return;
|
|
1911
2094
|
this.toggleRow(entry.row, !this.isRowSelected(entry.row));
|
|
@@ -2300,7 +2483,7 @@ var WrTable = class WrTable {
|
|
|
2300
2483
|
}
|
|
2301
2484
|
selectedRows() {
|
|
2302
2485
|
const keys = new Set(this.selection());
|
|
2303
|
-
return this.
|
|
2486
|
+
return (this.treeMode() ? this.allTreeRows(false) : this.source() ?? []).filter((row) => keys.has(this.rowKeyOf(row)));
|
|
2304
2487
|
}
|
|
2305
2488
|
computeSummary(kind, rows, key, context) {
|
|
2306
2489
|
if (typeof kind === "function") return kind(rows, context);
|
|
@@ -2334,6 +2517,13 @@ var WrTable = class WrTable {
|
|
|
2334
2517
|
const at = keys.indexOf(key);
|
|
2335
2518
|
return at < 0 ? null : at + 1;
|
|
2336
2519
|
}
|
|
2520
|
+
onHeaderClick(event, key, sortable) {
|
|
2521
|
+
if (!sortable) return;
|
|
2522
|
+
const th = event.currentTarget;
|
|
2523
|
+
const control = event.target.closest(HEADER_CLICK_IGNORE);
|
|
2524
|
+
if (control && control !== th && th.contains(control)) return;
|
|
2525
|
+
this.cycleSort(key);
|
|
2526
|
+
}
|
|
2337
2527
|
cycleSort(key) {
|
|
2338
2528
|
const current = this.directionFor(key);
|
|
2339
2529
|
const next = current === null ? "asc" : current === "asc" ? "desc" : null;
|
|
@@ -2373,7 +2563,7 @@ var WrTable = class WrTable {
|
|
|
2373
2563
|
}
|
|
2374
2564
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2375
2565
|
minVersion: "12.0.0",
|
|
2376
|
-
version: "22.
|
|
2566
|
+
version: "22.3.0",
|
|
2377
2567
|
ngImport: i0,
|
|
2378
2568
|
type: WrTable,
|
|
2379
2569
|
deps: [],
|
|
@@ -2381,7 +2571,7 @@ var WrTable = class WrTable {
|
|
|
2381
2571
|
});
|
|
2382
2572
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2383
2573
|
minVersion: "17.0.0",
|
|
2384
|
-
version: "22.
|
|
2574
|
+
version: "22.3.0",
|
|
2385
2575
|
type: WrTable,
|
|
2386
2576
|
isStandalone: true,
|
|
2387
2577
|
selector: "wr-table",
|
|
@@ -2400,6 +2590,13 @@ var WrTable = class WrTable {
|
|
|
2400
2590
|
isRequired: false,
|
|
2401
2591
|
transformFunction: null
|
|
2402
2592
|
},
|
|
2593
|
+
search: {
|
|
2594
|
+
classPropertyName: "search",
|
|
2595
|
+
publicName: "search",
|
|
2596
|
+
isSignal: true,
|
|
2597
|
+
isRequired: false,
|
|
2598
|
+
transformFunction: null
|
|
2599
|
+
},
|
|
2403
2600
|
loading: {
|
|
2404
2601
|
classPropertyName: "loading",
|
|
2405
2602
|
publicName: "loading",
|
|
@@ -2631,6 +2828,13 @@ var WrTable = class WrTable {
|
|
|
2631
2828
|
isRequired: false,
|
|
2632
2829
|
transformFunction: null
|
|
2633
2830
|
},
|
|
2831
|
+
rowLink: {
|
|
2832
|
+
classPropertyName: "rowLink",
|
|
2833
|
+
publicName: "rowLink",
|
|
2834
|
+
isSignal: true,
|
|
2835
|
+
isRequired: false,
|
|
2836
|
+
transformFunction: null
|
|
2837
|
+
},
|
|
2634
2838
|
pageSize: {
|
|
2635
2839
|
classPropertyName: "pageSize",
|
|
2636
2840
|
publicName: "pageSize",
|
|
@@ -2715,6 +2919,13 @@ var WrTable = class WrTable {
|
|
|
2715
2919
|
isRequired: false,
|
|
2716
2920
|
transformFunction: null
|
|
2717
2921
|
},
|
|
2922
|
+
size: {
|
|
2923
|
+
classPropertyName: "size",
|
|
2924
|
+
publicName: "size",
|
|
2925
|
+
isSignal: true,
|
|
2926
|
+
isRequired: false,
|
|
2927
|
+
transformFunction: null
|
|
2928
|
+
},
|
|
2718
2929
|
editable: {
|
|
2719
2930
|
classPropertyName: "editable",
|
|
2720
2931
|
publicName: "editable",
|
|
@@ -2743,6 +2954,7 @@ var WrTable = class WrTable {
|
|
|
2743
2954
|
"focusin": "onTreeFocusin($event)"
|
|
2744
2955
|
},
|
|
2745
2956
|
properties: {
|
|
2957
|
+
"class.wr-table--sm": "size() === 'sm'",
|
|
2746
2958
|
"class.wr-table--responsive": "responsive()",
|
|
2747
2959
|
"class.wr-table--virtual": "virtualized()",
|
|
2748
2960
|
"class.wr-table--sticky-head": "scrollable()",
|
|
@@ -2835,7 +3047,7 @@ var WrTable = class WrTable {
|
|
|
2835
3047
|
}
|
|
2836
3048
|
],
|
|
2837
3049
|
ngImport: i0,
|
|
2838
|
-
template: "@switch (loadingForm()) {\n @case ('overlay') {\n <div class=\"wr-table__loading\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n <wr-spinner size=\"lg\" />\n </div>\n }\n @case ('bar') {\n <div class=\"wr-table__loading-bar\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n </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]=\"clippedLayout()\"\n [class.wr-table__table--layout-fixed]=\"layout() === 'fixed'\"\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 @if (col.actions) {\n <div class=\"wr-table__actions\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"cellContext(entry.row, col)\"\n />\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"cellContext(entry.row, col)\" />\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 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",
|
|
3050
|
+
template: "@switch (loadingForm()) {\n @case ('overlay') {\n <div class=\"wr-table__loading\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n <wr-spinner size=\"lg\" />\n </div>\n }\n @case ('bar') {\n <div class=\"wr-table__loading-bar\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n </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]=\"clippedLayout()\"\n [class.wr-table__table--layout-fixed]=\"layout() === 'fixed'\"\n [style.--wr-table-row-h.px]=\"rowHeightVar()\"\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 <!-- The click is a pointer shortcut for the sort button, which stays\n the one control and the keyboard path. -->\n <th\n #thCell\n (click)=\"onHeaderClick($event, col.key, col.column.sortable)\"\n cdkDrag\n [cdkDragPreviewClass]=\"size() === 'sm' ? 'wr-table__th--preview-sm' : ''\"\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--sortable]=\"col.column.sortable\"\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, or the row's own link under `rowLink`. The\n other three serve inline editing and return at once in a table with\n 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 @let links = rowLinks();\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 @let link = links.get(entry.row) ?? null;\n <tr\n #rowEl\n [class]=\"rowClasses(entry.row, i, link !== null)\"\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 <!-- Empty, and laid under the whole row by the stylesheet: the\n cell's content is the consumer's and may hold controls,\n which an anchor cannot wrap. Gone while its cell is edited,\n where the editor is sized as the cell's only child. -->\n @if (link && col.link && !cellEdit) {\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content -->\n <a\n class=\"wr-table__row-link\"\n [attr.href]=\"link.href\"\n [attr.tabindex]=\"treeMode() ? -1 : null\"\n [attr.aria-labelledby]=\"rowLabelId(entry.id)\"\n ></a>\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 @if (col.actions) {\n <div class=\"wr-table__actions\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"cellContext(entry.row, col)\"\n />\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"cellContext(entry.row, col)\" />\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 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",
|
|
2839
3051
|
dependencies: [
|
|
2840
3052
|
{
|
|
2841
3053
|
kind: "directive",
|
|
@@ -2914,6 +3126,7 @@ var WrTable = class WrTable {
|
|
|
2914
3126
|
"iconPosition",
|
|
2915
3127
|
"disabled",
|
|
2916
3128
|
"outlined",
|
|
3129
|
+
"ghost",
|
|
2917
3130
|
"block",
|
|
2918
3131
|
"loading",
|
|
2919
3132
|
"disabledWhenLoading"
|
|
@@ -2953,6 +3166,7 @@ var WrTable = class WrTable {
|
|
|
2953
3166
|
"shape",
|
|
2954
3167
|
"disabled",
|
|
2955
3168
|
"responsive",
|
|
3169
|
+
"hideOnSinglePage",
|
|
2956
3170
|
"prevLabel",
|
|
2957
3171
|
"nextLabel",
|
|
2958
3172
|
"itemsPerPageLabel",
|
|
@@ -3022,7 +3236,7 @@ var WrTable = class WrTable {
|
|
|
3022
3236
|
};
|
|
3023
3237
|
i0.ɵɵngDeclareClassMetadata({
|
|
3024
3238
|
minVersion: "12.0.0",
|
|
3025
|
-
version: "22.
|
|
3239
|
+
version: "22.3.0",
|
|
3026
3240
|
ngImport: i0,
|
|
3027
3241
|
type: WrTable,
|
|
3028
3242
|
decorators: [{
|
|
@@ -3032,6 +3246,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3032
3246
|
encapsulation: ViewEncapsulation.None,
|
|
3033
3247
|
host: {
|
|
3034
3248
|
class: "wr-table",
|
|
3249
|
+
"[class.wr-table--sm]": "size() === 'sm'",
|
|
3035
3250
|
"[class.wr-table--responsive]": "responsive()",
|
|
3036
3251
|
"[class.wr-table--virtual]": "virtualized()",
|
|
3037
3252
|
"[class.wr-table--sticky-head]": "scrollable()",
|
|
@@ -3056,7 +3271,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3056
3271
|
WrTableSort,
|
|
3057
3272
|
WrTableFilter
|
|
3058
3273
|
],
|
|
3059
|
-
template: "@switch (loadingForm()) {\n @case ('overlay') {\n <div class=\"wr-table__loading\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n <wr-spinner size=\"lg\" />\n </div>\n }\n @case ('bar') {\n <div class=\"wr-table__loading-bar\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n </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]=\"clippedLayout()\"\n [class.wr-table__table--layout-fixed]=\"layout() === 'fixed'\"\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 @if (col.actions) {\n <div class=\"wr-table__actions\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"cellContext(entry.row, col)\"\n />\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"cellContext(entry.row, col)\" />\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 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"
|
|
3274
|
+
template: "@switch (loadingForm()) {\n @case ('overlay') {\n <div class=\"wr-table__loading\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n <wr-spinner size=\"lg\" />\n </div>\n }\n @case ('bar') {\n <div class=\"wr-table__loading-bar\" role=\"status\">\n <span class=\"wr-table__sr-only\">{{ resolvedLoadingLabel() }}</span>\n </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]=\"clippedLayout()\"\n [class.wr-table__table--layout-fixed]=\"layout() === 'fixed'\"\n [style.--wr-table-row-h.px]=\"rowHeightVar()\"\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 <!-- The click is a pointer shortcut for the sort button, which stays\n the one control and the keyboard path. -->\n <th\n #thCell\n (click)=\"onHeaderClick($event, col.key, col.column.sortable)\"\n cdkDrag\n [cdkDragPreviewClass]=\"size() === 'sm' ? 'wr-table__th--preview-sm' : ''\"\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--sortable]=\"col.column.sortable\"\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, or the row's own link under `rowLink`. The\n other three serve inline editing and return at once in a table with\n 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 @let links = rowLinks();\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 @let link = links.get(entry.row) ?? null;\n <tr\n #rowEl\n [class]=\"rowClasses(entry.row, i, link !== null)\"\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 <!-- Empty, and laid under the whole row by the stylesheet: the\n cell's content is the consumer's and may hold controls,\n which an anchor cannot wrap. Gone while its cell is edited,\n where the editor is sized as the cell's only child. -->\n @if (link && col.link && !cellEdit) {\n <!-- eslint-disable-next-line @angular-eslint/template/elements-content -->\n <a\n class=\"wr-table__row-link\"\n [attr.href]=\"link.href\"\n [attr.tabindex]=\"treeMode() ? -1 : null\"\n [attr.aria-labelledby]=\"rowLabelId(entry.id)\"\n ></a>\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 @if (col.actions) {\n <div class=\"wr-table__actions\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"cellContext(entry.row, col)\"\n />\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"cellContext(entry.row, col)\" />\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 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"
|
|
3060
3275
|
}]
|
|
3061
3276
|
}],
|
|
3062
3277
|
ctorParameters: () => [],
|
|
@@ -3077,6 +3292,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3077
3292
|
required: false
|
|
3078
3293
|
}]
|
|
3079
3294
|
}],
|
|
3295
|
+
search: [{
|
|
3296
|
+
type: i0.Input,
|
|
3297
|
+
args: [{
|
|
3298
|
+
isSignal: true,
|
|
3299
|
+
alias: "search",
|
|
3300
|
+
required: false
|
|
3301
|
+
}]
|
|
3302
|
+
}],
|
|
3080
3303
|
loading: [{
|
|
3081
3304
|
type: i0.Input,
|
|
3082
3305
|
args: [{
|
|
@@ -3371,6 +3594,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3371
3594
|
type: i0.Output,
|
|
3372
3595
|
args: ["rowClick"]
|
|
3373
3596
|
}],
|
|
3597
|
+
rowLink: [{
|
|
3598
|
+
type: i0.Input,
|
|
3599
|
+
args: [{
|
|
3600
|
+
isSignal: true,
|
|
3601
|
+
alias: "rowLink",
|
|
3602
|
+
required: false
|
|
3603
|
+
}]
|
|
3604
|
+
}],
|
|
3374
3605
|
pageSize: [{
|
|
3375
3606
|
type: i0.Input,
|
|
3376
3607
|
args: [{
|
|
@@ -3490,6 +3721,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3490
3721
|
required: false
|
|
3491
3722
|
}]
|
|
3492
3723
|
}],
|
|
3724
|
+
size: [{
|
|
3725
|
+
type: i0.Input,
|
|
3726
|
+
args: [{
|
|
3727
|
+
isSignal: true,
|
|
3728
|
+
alias: "size",
|
|
3729
|
+
required: false
|
|
3730
|
+
}]
|
|
3731
|
+
}],
|
|
3493
3732
|
scrollEl: [{
|
|
3494
3733
|
type: i0.ViewChild,
|
|
3495
3734
|
args: ["scroll", { isSignal: true }]
|
|
@@ -3580,6 +3819,6 @@ function wrSortRows(rows, sort, accessor = wrReadField) {
|
|
|
3580
3819
|
return 0;
|
|
3581
3820
|
});
|
|
3582
3821
|
}
|
|
3583
|
-
export { WrTable, WrTableCell, WrTableColumnChooser, WrTableEditCell, WrTableExpand, WrTableFilter, WrTableGroupHeader, WrTableSelectionBar, WrTableSort, wrReadField, wrSortRows };
|
|
3822
|
+
export { WR_TABLE_ROUTING, WrTable, WrTableCell, WrTableColumnChooser, WrTableEditCell, WrTableExpand, WrTableFilter, WrTableGroupHeader, WrTableSelectionBar, WrTableSort, wrReadField, wrSortRows };
|
|
3584
3823
|
|
|
3585
3824
|
//# sourceMappingURL=ngwr-table.mjs.map
|