@ngstarter-ui/components 22.2.4 → 22.2.6
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/ai/component-registry.json +89 -13
- package/content-editor/BLOCK_FORMAT.md +38 -0
- package/data-view/API.md +262 -0
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +67 -44
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs → ngstarter-ui-components-content-editor-attachment-block-Dvrxn-PJ.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs.map → ngstarter-ui-components-content-editor-attachment-block-Dvrxn-PJ.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs → ngstarter-ui-components-content-editor-callout-block-hBA6Xogj.mjs} +3 -3
- package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs.map → ngstarter-ui-components-content-editor-callout-block-hBA6Xogj.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs → ngstarter-ui-components-content-editor-code-block.component-BaaymubZ.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs.map → ngstarter-ui-components-content-editor-code-block.component-BaaymubZ.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs → ngstarter-ui-components-content-editor-embed-block-BWAtix_P.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs.map → ngstarter-ui-components-content-editor-embed-block-BWAtix_P.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs → ngstarter-ui-components-content-editor-gallery-block-C8mgrc2q.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs.map → ngstarter-ui-components-content-editor-gallery-block-C8mgrc2q.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs → ngstarter-ui-components-content-editor-grid-block-B0AfTFLQ.mjs} +6 -6
- package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs.map → ngstarter-ui-components-content-editor-grid-block-B0AfTFLQ.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs → ngstarter-ui-components-content-editor-heading-block.component-B0ZuUcQn.mjs} +8 -5
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-B0ZuUcQn.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs → ngstarter-ui-components-content-editor-image-block.component-ZCS4hvUg.mjs} +4 -4
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-ZCS4hvUg.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs → ngstarter-ui-components-content-editor-list-block.component-Ct-ARQ12.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs.map → ngstarter-ui-components-content-editor-list-block.component-Ct-ARQ12.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs → ngstarter-ui-components-content-editor-nested-blocks-B22kRf9a.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs.map → ngstarter-ui-components-content-editor-nested-blocks-B22kRf9a.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-B_6Olt0R.mjs} +93 -41
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-B_6Olt0R.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-BiBe4KAy.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs.map → ngstarter-ui-components-content-editor-paragraph-block.component-BiBe4KAy.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs → ngstarter-ui-components-content-editor-quote-block.component-BuCyqiE2.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-BuCyqiE2.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs → ngstarter-ui-components-content-editor-table-block.component-Ck5GsDJM.mjs} +4 -4
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs.map → ngstarter-ui-components-content-editor-table-block.component-Ck5GsDJM.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs → ngstarter-ui-components-content-editor-toggle-block-_hXAyzUb.mjs} +3 -3
- package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs.map → ngstarter-ui-components-content-editor-toggle-block-_hXAyzUb.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs → ngstarter-ui-components-content-editor-video-block.component-bDo8XvID.mjs} +2 -2
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs.map → ngstarter-ui-components-content-editor-video-block.component-bDo8XvID.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +114 -3
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +5 -17
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +6 -18
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +1011 -90
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +3 -4
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +45 -19
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs +5 -5
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +244 -29
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-option.mjs +36 -31
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +2 -2
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +157 -105
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sort.mjs +9 -2
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +10 -0
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +6 -13
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_common.scss +2 -1
- package/styles/_tokens.scss +32 -1
- package/styles/themes/default.scss +1 -1
- package/types/ngstarter-ui-components-autocomplete.d.ts +6 -1
- package/types/ngstarter-ui-components-content-editor.d.ts +6 -1
- package/types/ngstarter-ui-components-core.d.ts +24 -3
- package/types/ngstarter-ui-components-country-select.d.ts +0 -2
- package/types/ngstarter-ui-components-currency-select.d.ts +0 -2
- package/types/ngstarter-ui-components-data-view.d.ts +204 -11
- package/types/ngstarter-ui-components-datepicker.d.ts +3 -1
- package/types/ngstarter-ui-components-menu.d.ts +44 -5
- package/types/ngstarter-ui-components-option.d.ts +11 -3
- package/types/ngstarter-ui-components-select.d.ts +12 -7
- package/types/ngstarter-ui-components-sort.d.ts +1 -0
- package/types/ngstarter-ui-components-table.d.ts +2 -0
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs.map +0 -1
|
@@ -1,24 +1,346 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, TemplateRef, Directive, input, numberAttribute, booleanAttribute,
|
|
2
|
+
import { InjectionToken, inject, signal, computed, ChangeDetectionStrategy, Component, TemplateRef, Directive, input, numberAttribute, booleanAttribute, makeEnvironmentProviders, output, ChangeDetectorRef, DestroyRef, PLATFORM_ID, NgZone, ElementRef, model, contentChild, viewChild, effect, untracked, Injector, forwardRef } from '@angular/core';
|
|
3
3
|
import { TableDataSource } from '@ngstarter-ui/components/table';
|
|
4
4
|
import { EmptyState, EmptyStateIcon, EmptyStateContent } from '@ngstarter-ui/components/empty-state';
|
|
5
5
|
import { Icon } from '@ngstarter-ui/components/icon';
|
|
6
|
-
import {
|
|
6
|
+
import { Alert } from '@ngstarter-ui/components/alert';
|
|
7
|
+
import * as i1 from '@angular/forms';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
import { DIALOG_DATA, DialogRef, DialogTitle, DialogContent, DialogActions, Dialog } from '@ngstarter-ui/components/dialog';
|
|
10
|
+
import { Button } from '@ngstarter-ui/components/button';
|
|
11
|
+
import { FormField, Label, IconButtonSuffix } from '@ngstarter-ui/components/form-field';
|
|
12
|
+
import { Input } from '@ngstarter-ui/components/input';
|
|
13
|
+
import { Select, Option } from '@ngstarter-ui/components/select';
|
|
14
|
+
import { NumberInput } from '@ngstarter-ui/components/number-input';
|
|
15
|
+
import { DateAdapter, DateRange, DateRangeInput, DateRangePicker, StartDate, EndDate, DatepickerToggle, provideNativeDateAdapter } from '@ngstarter-ui/components/datepicker';
|
|
16
|
+
import { Chip, ChipSet, ChipRemove } from '@ngstarter-ui/components/chips';
|
|
17
|
+
import { Toolbar, ToolbarItem, ToolbarSpacer } from '@ngstarter-ui/components/toolbar';
|
|
7
18
|
import { Paginator } from '@ngstarter-ui/components/paginator';
|
|
8
19
|
import { SortDirective, SortHeader } from '@ngstarter-ui/components/sort';
|
|
9
20
|
import { DOCUMENT, isPlatformBrowser, NgComponentOutlet, NgTemplateOutlet, NgStyle } from '@angular/common';
|
|
10
21
|
import { Checkbox } from '@ngstarter-ui/components/checkbox';
|
|
11
22
|
import { ScrollbarArea } from '@ngstarter-ui/components/scrollbar-area';
|
|
12
23
|
import { BlockLoader, BlockLoaderContainerDirective } from '@ngstarter-ui/components/block-loader';
|
|
13
|
-
import { Button } from '@ngstarter-ui/components/button';
|
|
14
24
|
import { Menu, MenuTrigger, MenuContent, MenuItem, MenuDivider } from '@ngstarter-ui/components/menu';
|
|
15
|
-
import
|
|
16
|
-
import * as i1 from '@angular/cdk/drag-drop';
|
|
25
|
+
import * as i1$1 from '@angular/cdk/drag-drop';
|
|
17
26
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
18
27
|
import { fromEvent, Subject, takeUntil, timer, take, merge } from 'rxjs';
|
|
19
28
|
|
|
20
29
|
const DATA_VIEW = new InjectionToken('DATA_VIEW');
|
|
21
30
|
|
|
31
|
+
/** Selection retains IDs across immutable reloads and can represent unloaded server records. */
|
|
32
|
+
class DataViewSelection {
|
|
33
|
+
key;
|
|
34
|
+
records = new Map();
|
|
35
|
+
excluded = new Set();
|
|
36
|
+
allMatching = false;
|
|
37
|
+
constructor(key) {
|
|
38
|
+
this.key = key;
|
|
39
|
+
}
|
|
40
|
+
get selected() { return [...this.records.values()]; }
|
|
41
|
+
get keys() { return [...this.records.keys()]; }
|
|
42
|
+
hasValue() { return this.allMatching || this.records.size > 0; }
|
|
43
|
+
isSelected(row) {
|
|
44
|
+
const key = this.key(row);
|
|
45
|
+
return this.allMatching ? !this.excluded.has(key) : this.records.has(key);
|
|
46
|
+
}
|
|
47
|
+
select(...rows) {
|
|
48
|
+
this.selectRows(rows);
|
|
49
|
+
}
|
|
50
|
+
selectRows(rows) {
|
|
51
|
+
for (const row of rows) {
|
|
52
|
+
const key = this.key(row);
|
|
53
|
+
this.excluded.delete(key);
|
|
54
|
+
this.records.set(key, row);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
deselect(...rows) {
|
|
58
|
+
for (const row of rows) {
|
|
59
|
+
const key = this.key(row);
|
|
60
|
+
this.records.delete(key);
|
|
61
|
+
if (this.allMatching)
|
|
62
|
+
this.excluded.add(key);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
clear() { this.records.clear(); this.excluded.clear(); this.allMatching = false; }
|
|
66
|
+
selectMatching(rows) { this.clear(); this.allMatching = true; this.selectRows(rows); }
|
|
67
|
+
reconcile(rows, dropMissing) {
|
|
68
|
+
const before = this.selected;
|
|
69
|
+
const available = new Map(rows.map(row => [this.key(row), row]));
|
|
70
|
+
if (dropMissing)
|
|
71
|
+
for (const key of this.records.keys())
|
|
72
|
+
if (!available.has(key))
|
|
73
|
+
this.records.delete(key);
|
|
74
|
+
for (const row of rows)
|
|
75
|
+
if (this.isSelected(row))
|
|
76
|
+
this.records.set(this.key(row), row);
|
|
77
|
+
const after = this.selected;
|
|
78
|
+
return before.length !== after.length || before.some((row, index) => row !== after[index]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function dataViewDateKey(value) {
|
|
83
|
+
if (value instanceof Date) {
|
|
84
|
+
if (!Number.isFinite(value.getTime()))
|
|
85
|
+
return undefined;
|
|
86
|
+
return `${value.getFullYear().toString().padStart(4, '0')}-${String(value.getMonth() + 1).padStart(2, '0')}-${String(value.getDate()).padStart(2, '0')}`;
|
|
87
|
+
}
|
|
88
|
+
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}(?:$|T)/.test(value))
|
|
89
|
+
return undefined;
|
|
90
|
+
const day = value.slice(0, 10);
|
|
91
|
+
const date = new Date(`${day}T00:00:00Z`);
|
|
92
|
+
return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === day ? day : undefined;
|
|
93
|
+
}
|
|
94
|
+
/** Empty filters are removed; malformed values are rejected before reaching a datasource. */
|
|
95
|
+
function normalizeDataViewFilter(filter) {
|
|
96
|
+
if (!filter || typeof filter !== 'object')
|
|
97
|
+
throw new Error('Invalid column filter');
|
|
98
|
+
switch (filter.type) {
|
|
99
|
+
case 'text':
|
|
100
|
+
if (!['contains', 'equals', 'startsWith', 'endsWith', 'notContains'].includes(filter.operator) || typeof filter.value !== 'string')
|
|
101
|
+
throw new Error('Invalid text filter');
|
|
102
|
+
return filter.value.trim() ? { type: 'text', operator: filter.operator, value: filter.value.trim() } : null;
|
|
103
|
+
case 'number': {
|
|
104
|
+
if (!['equals', 'notEquals', 'greaterThan', 'lessThan', 'between'].includes(filter.operator))
|
|
105
|
+
throw new Error('Invalid number operator');
|
|
106
|
+
if ((filter.value !== undefined && !Number.isFinite(filter.value)) || (filter.to !== undefined && !Number.isFinite(filter.to)))
|
|
107
|
+
throw new Error('Enter a finite number');
|
|
108
|
+
if (filter.operator !== 'between')
|
|
109
|
+
return filter.value === undefined ? null : { type: 'number', operator: filter.operator, value: filter.value };
|
|
110
|
+
if (filter.value === undefined && filter.to === undefined)
|
|
111
|
+
return null;
|
|
112
|
+
if (filter.value !== undefined && filter.to !== undefined && filter.value > filter.to)
|
|
113
|
+
throw new Error('Minimum must not exceed maximum');
|
|
114
|
+
return { type: 'number', operator: filter.operator, value: filter.value, to: filter.to };
|
|
115
|
+
}
|
|
116
|
+
case 'date':
|
|
117
|
+
if ((filter.from && dataViewDateKey(filter.from) !== filter.from) || (filter.to && dataViewDateKey(filter.to) !== filter.to))
|
|
118
|
+
throw new Error('Invalid calendar date');
|
|
119
|
+
if (filter.from && filter.to && filter.from > filter.to)
|
|
120
|
+
throw new Error('Start date must not exceed end date');
|
|
121
|
+
return filter.from || filter.to ? { type: 'date', from: filter.from, to: filter.to } : null;
|
|
122
|
+
case 'enum':
|
|
123
|
+
if (!Array.isArray(filter.values) || filter.values.some(v => typeof v !== 'string' && (typeof v !== 'number' || !Number.isFinite(v))))
|
|
124
|
+
throw new Error('Invalid enum values');
|
|
125
|
+
return filter.values.length ? { type: 'enum', values: [...new Set(filter.values)] } : null;
|
|
126
|
+
case 'boolean':
|
|
127
|
+
if (typeof filter.value !== 'boolean')
|
|
128
|
+
throw new Error('Invalid boolean filter');
|
|
129
|
+
return { type: 'boolean', value: filter.value };
|
|
130
|
+
default: throw new Error('Unknown filter type');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function matchesDataViewFilter(value, filter) {
|
|
134
|
+
switch (filter.type) {
|
|
135
|
+
case 'text': {
|
|
136
|
+
const text = String(value ?? '').toLocaleLowerCase();
|
|
137
|
+
const term = filter.value.toLocaleLowerCase();
|
|
138
|
+
switch (filter.operator) {
|
|
139
|
+
case 'equals': return text === term;
|
|
140
|
+
case 'startsWith': return text.startsWith(term);
|
|
141
|
+
case 'endsWith': return text.endsWith(term);
|
|
142
|
+
case 'notContains': return !text.includes(term);
|
|
143
|
+
default: return text.includes(term);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
case 'number': {
|
|
147
|
+
if (value === null || value === undefined || value === '' || typeof value === 'boolean')
|
|
148
|
+
return false;
|
|
149
|
+
const n = Number(value);
|
|
150
|
+
if (!Number.isFinite(n))
|
|
151
|
+
return false;
|
|
152
|
+
switch (filter.operator) {
|
|
153
|
+
case 'equals': return n === filter.value;
|
|
154
|
+
case 'notEquals': return n !== filter.value;
|
|
155
|
+
case 'greaterThan': return n > filter.value;
|
|
156
|
+
case 'lessThan': return n < filter.value;
|
|
157
|
+
default: return (filter.value === undefined || n >= filter.value) && (filter.to === undefined || n <= filter.to);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
case 'date': {
|
|
161
|
+
const day = dataViewDateKey(value);
|
|
162
|
+
return !!day && (!filter.from || day >= filter.from) && (!filter.to || day <= filter.to);
|
|
163
|
+
}
|
|
164
|
+
case 'enum': return filter.values.some(item => item === value);
|
|
165
|
+
case 'boolean': return value === filter.value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function normalizeDataViewFilters(filters) {
|
|
169
|
+
const result = {};
|
|
170
|
+
for (const [field, filter] of Object.entries(filters ?? {}).sort(([a], [b]) => a.localeCompare(b))) {
|
|
171
|
+
const normalized = normalizeDataViewFilter(filter);
|
|
172
|
+
if (normalized)
|
|
173
|
+
Object.defineProperty(result, field, { value: normalized, enumerable: true, configurable: true, writable: true });
|
|
174
|
+
}
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
function dataViewFilterLabel(filter) {
|
|
178
|
+
const labels = { contains: 'Contains', equals: 'Equals', startsWith: 'Starts with', endsWith: 'Ends with', notContains: 'Does not contain', notEquals: 'Does not equal', greaterThan: 'Greater than', lessThan: 'Less than' };
|
|
179
|
+
switch (filter.type) {
|
|
180
|
+
case 'text': return `${labels[filter.operator]}: ${filter.value}`;
|
|
181
|
+
case 'number': return filter.operator === 'between' ? `${filter.value ?? '…'} – ${filter.to ?? '…'}` : `${labels[filter.operator]}: ${filter.value}`;
|
|
182
|
+
case 'date': return `${filter.from ?? '…'} – ${filter.to ?? '…'}`;
|
|
183
|
+
case 'enum': return filter.values.join(', ');
|
|
184
|
+
case 'boolean': return filter.value ? 'Yes' : 'No';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
class DataViewColumnFilterDialog {
|
|
189
|
+
data = inject(DIALOG_DATA);
|
|
190
|
+
dialog = inject(DialogRef);
|
|
191
|
+
column = this.data.column;
|
|
192
|
+
type = this.column.filter.type;
|
|
193
|
+
options = this.column.filter?.options ?? [];
|
|
194
|
+
error = signal(null, /* @ts-ignore */
|
|
195
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
196
|
+
operator = signal(this.data.filter && 'operator' in this.data.filter ? this.data.filter.operator : this.type === 'text' ? 'contains' : 'equals', /* @ts-ignore */
|
|
197
|
+
...(ngDevMode ? [{ debugName: "operator" }] : /* istanbul ignore next */ []));
|
|
198
|
+
text = signal(this.data.filter?.type === 'text' ? this.data.filter.value : '', /* @ts-ignore */
|
|
199
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
200
|
+
value = signal(this.data.filter?.type === 'number' ? this.data.filter.value ?? null : null, /* @ts-ignore */
|
|
201
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
202
|
+
to = signal(this.data.filter?.type === 'number' ? this.data.filter.to ?? null : null, /* @ts-ignore */
|
|
203
|
+
...(ngDevMode ? [{ debugName: "to" }] : /* istanbul ignore next */ []));
|
|
204
|
+
enumValues = signal(this.data.filter?.type === 'enum' ? this.data.filter.values : [], /* @ts-ignore */
|
|
205
|
+
...(ngDevMode ? [{ debugName: "enumValues" }] : /* istanbul ignore next */ []));
|
|
206
|
+
booleanValue = signal(this.data.filter?.type === 'boolean' ? this.data.filter.value : null, /* @ts-ignore */
|
|
207
|
+
...(ngDevMode ? [{ debugName: "booleanValue" }] : /* istanbul ignore next */ []));
|
|
208
|
+
dateAdapter = inject(DateAdapter);
|
|
209
|
+
dateRange = signal(this.data.filter?.type === 'date' ? new DateRange(this.data.filter.from ? new Date(`${this.data.filter.from}T00:00:00`) : null, this.data.filter.to ? new Date(`${this.data.filter.to}T00:00:00`) : null) : null, /* @ts-ignore */
|
|
210
|
+
...(ngDevMode ? [{ debugName: "dateRange" }] : /* istanbul ignore next */ []));
|
|
211
|
+
invalidDate = computed(() => [this.dateRange()?.start, this.dateRange()?.end].some(date => date && !this.dateAdapter.isValid(date)), /* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [{ debugName: "invalidDate" }] : /* istanbul ignore next */ []));
|
|
213
|
+
textOperators = [{ value: 'contains', label: 'Contains' }, { value: 'equals', label: 'Equals' }, { value: 'startsWith', label: 'Starts with' }, { value: 'endsWith', label: 'Ends with' }, { value: 'notContains', label: 'Does not contain' }];
|
|
214
|
+
numberOperators = [{ value: 'equals', label: 'Equals' }, { value: 'notEquals', label: 'Does not equal' }, { value: 'greaterThan', label: 'Greater than' }, { value: 'lessThan', label: 'Less than' }, { value: 'between', label: 'Between' }];
|
|
215
|
+
apply() {
|
|
216
|
+
try {
|
|
217
|
+
if (this.invalidDate()) {
|
|
218
|
+
this.error.set('Enter a valid calendar date');
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
let filter;
|
|
222
|
+
switch (this.type) {
|
|
223
|
+
case 'text':
|
|
224
|
+
filter = { type: 'text', operator: this.operator(), value: this.text() };
|
|
225
|
+
break;
|
|
226
|
+
case 'number':
|
|
227
|
+
filter = { type: 'number', operator: this.operator(), value: this.value() ?? undefined, to: this.to() ?? undefined };
|
|
228
|
+
break;
|
|
229
|
+
case 'date':
|
|
230
|
+
filter = { type: 'date', from: dataViewDateKey(this.dateRange()?.start), to: dataViewDateKey(this.dateRange()?.end) };
|
|
231
|
+
break;
|
|
232
|
+
case 'enum':
|
|
233
|
+
filter = { type: 'enum', values: this.enumValues() };
|
|
234
|
+
break;
|
|
235
|
+
case 'boolean':
|
|
236
|
+
filter = this.booleanValue() === null ? null : { type: 'boolean', value: this.booleanValue() };
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
this.dialog.close({ filter: filter ? normalizeDataViewFilter(filter) : null });
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
this.error.set(error instanceof Error ? error.message : 'Invalid filter');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
clear() { this.dialog.close({ filter: null }); }
|
|
246
|
+
cancel() { this.dialog.close(); }
|
|
247
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataViewColumnFilterDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
248
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: DataViewColumnFilterDialog, isStandalone: true, selector: "ngs-data-view-column-filter-dialog", providers: [provideNativeDateAdapter()], ngImport: i0, template: "<h3 ngsDialogTitle>Filter {{ column.name }}</h3>\n<form ngsDialogContent #filterForm=\"ngForm\" (ngSubmit)=\"apply()\" class=\"flex flex-col gap-4\">\n @if (error()) { <ngs-alert variant=\"negative\" role=\"alert\">{{ error() }}</ngs-alert> }\n @if (invalidDate()) { <ngs-alert variant=\"negative\" role=\"alert\">Enter a valid calendar date.</ngs-alert> }\n @switch (type) {\n @case ('text') {\n <ngs-form-field><ngs-label>Condition</ngs-label><ngs-select name=\"condition\" [(ngModel)]=\"operator\">\n @for (item of textOperators; track item) { <ngs-option [value]=\"item.value\">{{ item.label }}</ngs-option> }\n </ngs-select></ngs-form-field>\n <ngs-form-field><ngs-label>Text</ngs-label><input ngsInput name=\"text\" [(ngModel)]=\"text\"></ngs-form-field>\n }\n @case ('number') {\n <ngs-form-field><ngs-label>Condition</ngs-label><ngs-select name=\"condition\" [(ngModel)]=\"operator\">\n @for (item of numberOperators; track item) { <ngs-option [value]=\"item.value\">{{ item.label }}</ngs-option> }\n </ngs-select></ngs-form-field>\n <ngs-form-field><ngs-label>{{ operator() === 'between' ? 'Minimum' : 'Value' }}</ngs-label><ngs-number-input name=\"value\" [(ngModel)]=\"value\"/></ngs-form-field>\n @if (operator() === 'between') { <ngs-form-field><ngs-label>Maximum</ngs-label><ngs-number-input name=\"to\" [(ngModel)]=\"to\"/></ngs-form-field> }\n }\n @case ('date') {\n <ngs-form-field>\n <ngs-label>Date range</ngs-label>\n <ngs-date-range-input [rangePicker]=\"picker\" [(range)]=\"dateRange\">\n <input ngsStartDate placeholder=\"Start date\" aria-label=\"Start date\">\n <input ngsEndDate placeholder=\"End date\" aria-label=\"End date\">\n </ngs-date-range-input>\n <ngs-datepicker-toggle ngsIconButtonSuffix [for]=\"picker\"/>\n <ngs-date-range-picker #picker/>\n </ngs-form-field>\n }\n @case ('enum') {\n <ngs-form-field><ngs-label>Values</ngs-label><ngs-select multiple name=\"enumValues\" [(ngModel)]=\"enumValues\">\n @for (option of options; track option.value) { <ngs-option [value]=\"option.value\">{{ option.label }}</ngs-option> }\n </ngs-select></ngs-form-field>\n }\n @case ('boolean') {\n <ngs-form-field><ngs-label>Value</ngs-label><ngs-select name=\"booleanValue\" [(ngModel)]=\"booleanValue\">\n <ngs-option [value]=\"null\">Any</ngs-option><ngs-option [value]=\"true\">Yes</ngs-option><ngs-option [value]=\"false\">No</ngs-option>\n </ngs-select></ngs-form-field>\n }\n }\n</form>\n<div ngsDialogActions align=\"end\">\n <button ngsButton type=\"button\" (click)=\"clear()\">Clear</button>\n <button ngsButton type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button ngsButton=\"filled\" type=\"button\" [disabled]=\"!!filterForm.invalid || invalidDate()\" (click)=\"apply()\">Apply filter</button>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DialogTitle, selector: "ngs-dialog-title, [ngs-dialog-title], [ngsDialogTitle]", inputs: ["id"], exportAs: ["ngsDialogTitle"] }, { kind: "component", type: DialogContent, selector: "ngs-dialog-content,[ngs-dialog-content],[ngsDialogContent]" }, { kind: "component", type: DialogActions, selector: "ngs-dialog-actions, [ngs-dialog-actions], [ngsDialogActions]", inputs: ["align"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }, { kind: "component", type: Select, selector: "ngs-select", inputs: ["id", "placeholder", "disabled", "required", "multiple", "hideCheckIcon", "clearable", "dataSource", "pageSize", "searchable", "searchDebounce", "minSearchLength", "loadOnOpen", "aria-label", "tabIndex", "aria-describedby", "value"], outputs: ["selectionChange", "opened", "closed", "valueChange"], exportAs: ["ngsSelect"] }, { kind: "component", type: Option, selector: "ngs-option", inputs: ["id", "value", "data", "disabled", "selected"], outputs: ["onSelectionChange"], exportAs: ["ngsOption"] }, { kind: "component", type: NumberInput, selector: "ngs-number-input", inputs: ["min", "max", "step", "readonly", "disabled", "required", "placeholder"], outputs: ["valueChange"], exportAs: ["ngsNumberInput"] }, { kind: "component", type: DateRangeInput, selector: "ngs-date-range-input", inputs: ["rangePicker", "separator", "range"], outputs: ["rangeChange"], exportAs: ["ngsDateRangeInput"] }, { kind: "component", type: DateRangePicker, selector: "ngs-date-range-picker", inputs: ["startAt", "calendarHeaderComponent", "quickPresets", "showQuickPresets", "calendarCount", "extended"], exportAs: ["ngsDateRangePicker"] }, { kind: "directive", type: StartDate, selector: "input[ngsStartDate]" }, { kind: "directive", type: EndDate, selector: "input[ngsEndDate]" }, { kind: "component", type: DatepickerToggle, selector: "ngs-datepicker-toggle", inputs: ["for"], exportAs: ["ngsDatepickerToggle"] }, { kind: "directive", type: IconButtonSuffix, selector: "[ngsIconButtonSuffix]" }, { kind: "component", type: Alert, selector: "ngs-alert", inputs: ["autoClose", "bordered", "variant"], outputs: ["closed"], exportAs: ["ngsAlert"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
249
|
+
}
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataViewColumnFilterDialog, decorators: [{
|
|
251
|
+
type: Component,
|
|
252
|
+
args: [{ selector: 'ngs-data-view-column-filter-dialog', imports: [FormsModule, DialogTitle, DialogContent, DialogActions, Button, FormField, Label,
|
|
253
|
+
Input, Select, Option, NumberInput, DateRangeInput, DateRangePicker, StartDate, EndDate,
|
|
254
|
+
DatepickerToggle, IconButtonSuffix, Alert], providers: [provideNativeDateAdapter()], changeDetection: ChangeDetectionStrategy.OnPush, template: "<h3 ngsDialogTitle>Filter {{ column.name }}</h3>\n<form ngsDialogContent #filterForm=\"ngForm\" (ngSubmit)=\"apply()\" class=\"flex flex-col gap-4\">\n @if (error()) { <ngs-alert variant=\"negative\" role=\"alert\">{{ error() }}</ngs-alert> }\n @if (invalidDate()) { <ngs-alert variant=\"negative\" role=\"alert\">Enter a valid calendar date.</ngs-alert> }\n @switch (type) {\n @case ('text') {\n <ngs-form-field><ngs-label>Condition</ngs-label><ngs-select name=\"condition\" [(ngModel)]=\"operator\">\n @for (item of textOperators; track item) { <ngs-option [value]=\"item.value\">{{ item.label }}</ngs-option> }\n </ngs-select></ngs-form-field>\n <ngs-form-field><ngs-label>Text</ngs-label><input ngsInput name=\"text\" [(ngModel)]=\"text\"></ngs-form-field>\n }\n @case ('number') {\n <ngs-form-field><ngs-label>Condition</ngs-label><ngs-select name=\"condition\" [(ngModel)]=\"operator\">\n @for (item of numberOperators; track item) { <ngs-option [value]=\"item.value\">{{ item.label }}</ngs-option> }\n </ngs-select></ngs-form-field>\n <ngs-form-field><ngs-label>{{ operator() === 'between' ? 'Minimum' : 'Value' }}</ngs-label><ngs-number-input name=\"value\" [(ngModel)]=\"value\"/></ngs-form-field>\n @if (operator() === 'between') { <ngs-form-field><ngs-label>Maximum</ngs-label><ngs-number-input name=\"to\" [(ngModel)]=\"to\"/></ngs-form-field> }\n }\n @case ('date') {\n <ngs-form-field>\n <ngs-label>Date range</ngs-label>\n <ngs-date-range-input [rangePicker]=\"picker\" [(range)]=\"dateRange\">\n <input ngsStartDate placeholder=\"Start date\" aria-label=\"Start date\">\n <input ngsEndDate placeholder=\"End date\" aria-label=\"End date\">\n </ngs-date-range-input>\n <ngs-datepicker-toggle ngsIconButtonSuffix [for]=\"picker\"/>\n <ngs-date-range-picker #picker/>\n </ngs-form-field>\n }\n @case ('enum') {\n <ngs-form-field><ngs-label>Values</ngs-label><ngs-select multiple name=\"enumValues\" [(ngModel)]=\"enumValues\">\n @for (option of options; track option.value) { <ngs-option [value]=\"option.value\">{{ option.label }}</ngs-option> }\n </ngs-select></ngs-form-field>\n }\n @case ('boolean') {\n <ngs-form-field><ngs-label>Value</ngs-label><ngs-select name=\"booleanValue\" [(ngModel)]=\"booleanValue\">\n <ngs-option [value]=\"null\">Any</ngs-option><ngs-option [value]=\"true\">Yes</ngs-option><ngs-option [value]=\"false\">No</ngs-option>\n </ngs-select></ngs-form-field>\n }\n }\n</form>\n<div ngsDialogActions align=\"end\">\n <button ngsButton type=\"button\" (click)=\"clear()\">Clear</button>\n <button ngsButton type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button ngsButton=\"filled\" type=\"button\" [disabled]=\"!!filterForm.invalid || invalidDate()\" (click)=\"apply()\">Apply filter</button>\n</div>\n" }]
|
|
255
|
+
}] });
|
|
256
|
+
|
|
257
|
+
/** Validates persisted state, removes stale fields and appends newly added columns. */
|
|
258
|
+
function normalizeDataViewState(value, columns) {
|
|
259
|
+
const state = value;
|
|
260
|
+
if (!state || state.version !== 1 || !Array.isArray(state.columns) || typeof state.search !== 'string'
|
|
261
|
+
|| !Number.isInteger(state.pageSize) || state.pageSize < 1 || !state.sort
|
|
262
|
+
|| typeof state.sort.active !== 'string' || !['asc', 'desc', ''].includes(state.sort.direction)
|
|
263
|
+
|| !state.columnFilters || typeof state.columnFilters !== 'object' || Array.isArray(state.columnFilters))
|
|
264
|
+
throw new Error('Invalid DataView state');
|
|
265
|
+
const known = new Map(columns.map(c => [c.field, c]));
|
|
266
|
+
const seen = new Set();
|
|
267
|
+
const result = [];
|
|
268
|
+
for (const item of state.columns) {
|
|
269
|
+
if (!item || typeof item.field !== 'string' || seen.has(item.field))
|
|
270
|
+
throw new Error('Invalid or duplicate state column');
|
|
271
|
+
seen.add(item.field);
|
|
272
|
+
if (!known.has(item.field))
|
|
273
|
+
continue;
|
|
274
|
+
if ((item.width !== undefined && (typeof item.width !== 'number' && typeof item.width !== 'string'))
|
|
275
|
+
|| (typeof item.width === 'number' && (!Number.isFinite(item.width) || item.width <= 0))
|
|
276
|
+
|| (item.visible !== undefined && typeof item.visible !== 'boolean')
|
|
277
|
+
|| (item.pinned !== undefined && typeof item.pinned !== 'boolean')
|
|
278
|
+
|| (item.pinAlign !== undefined && item.pinAlign !== 'start' && item.pinAlign !== 'end'))
|
|
279
|
+
throw new Error('Invalid column state');
|
|
280
|
+
const width = typeof item.width === 'number' || (typeof item.width === 'string' && /^\d+$/.test(item.width)) ? `${item.width}px` : item.width;
|
|
281
|
+
result.push({ field: item.field, width, visible: item.visible ?? true, pinned: !!item.pinned, pinAlign: item.pinned ? item.pinAlign ?? 'start' : undefined });
|
|
282
|
+
}
|
|
283
|
+
for (const column of columns)
|
|
284
|
+
if (!seen.has(column.field))
|
|
285
|
+
result.push({ field: column.field,
|
|
286
|
+
width: typeof column.width === 'number' ? `${column.width}px` : column.width, visible: column.visible ?? true, pinned: !!column.pinned, pinAlign: column.pinned ? column.pinAlign ?? 'start' : undefined });
|
|
287
|
+
if (result.length && !result.some(c => c.visible))
|
|
288
|
+
throw new Error('Keep at least one column visible');
|
|
289
|
+
const filters = normalizeDataViewFilters(state.columnFilters);
|
|
290
|
+
for (const field of Object.keys(filters)) {
|
|
291
|
+
const column = known.get(field);
|
|
292
|
+
if (!column)
|
|
293
|
+
delete filters[field];
|
|
294
|
+
else if (column.filter && column.filter.type !== filters[field].type)
|
|
295
|
+
throw new Error(`Invalid filter type for ${field}`);
|
|
296
|
+
}
|
|
297
|
+
return { version: 1, columns: result, sort: known.has(state.sort.active) ? { active: state.sort.active, direction: state.sort.direction } : { active: '', direction: '' },
|
|
298
|
+
search: state.search, columnFilters: filters, pageSize: state.pageSize };
|
|
299
|
+
}
|
|
300
|
+
function normalizeDataViewSavedViews(value, columns) {
|
|
301
|
+
if (!Array.isArray(value))
|
|
302
|
+
throw new Error('Invalid saved views');
|
|
303
|
+
const ids = new Set();
|
|
304
|
+
const names = new Set();
|
|
305
|
+
return value.map(view => {
|
|
306
|
+
if (!view || typeof view.id !== 'string' || !view.id.trim() || ids.has(view.id) || typeof view.name !== 'string'
|
|
307
|
+
|| !view.name.trim() || view.name.trim().length > 100 || names.has(view.name.trim().toLocaleLowerCase()))
|
|
308
|
+
throw new Error('Invalid saved view');
|
|
309
|
+
ids.add(view.id);
|
|
310
|
+
names.add(view.name.trim().toLocaleLowerCase());
|
|
311
|
+
return { id: view.id, name: view.name.trim(), state: normalizeDataViewState(view.state, columns) };
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
class DataViewSavedViewDialog {
|
|
316
|
+
data = inject(DIALOG_DATA);
|
|
317
|
+
dialog = inject(DialogRef);
|
|
318
|
+
name = signal(this.data.name ?? '', /* @ts-ignore */
|
|
319
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
320
|
+
error = signal(null, /* @ts-ignore */
|
|
321
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
322
|
+
title = this.data.name ? 'Rename view' : 'Save view';
|
|
323
|
+
save() {
|
|
324
|
+
const name = this.name().trim();
|
|
325
|
+
if (!name) {
|
|
326
|
+
this.error.set('Enter a view name');
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (this.data.existingNames.some(item => item.toLocaleLowerCase() === name.toLocaleLowerCase())) {
|
|
330
|
+
this.error.set('A view with this name already exists');
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
this.dialog.close(name);
|
|
334
|
+
}
|
|
335
|
+
cancel() { this.dialog.close(); }
|
|
336
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataViewSavedViewDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: DataViewSavedViewDialog, isStandalone: true, selector: "ngs-data-view-saved-view-dialog", ngImport: i0, template: "<h3 ngsDialogTitle>{{ title }}</h3>\n<form ngsDialogContent (ngSubmit)=\"save()\" class=\"flex flex-col gap-4\">\n @if (error()) { <ngs-alert variant=\"negative\" role=\"alert\">{{ error() }}</ngs-alert> }\n <ngs-form-field><ngs-label>View name</ngs-label><input ngsInput name=\"viewName\" [(ngModel)]=\"name\" required maxlength=\"100\" autocomplete=\"off\"></ngs-form-field>\n</form>\n<div ngsDialogActions align=\"end\">\n <button ngsButton type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button ngsButton=\"filled\" type=\"button\" (click)=\"save()\">Save</button>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DialogTitle, selector: "ngs-dialog-title, [ngs-dialog-title], [ngsDialogTitle]", inputs: ["id"], exportAs: ["ngsDialogTitle"] }, { kind: "component", type: DialogContent, selector: "ngs-dialog-content,[ngs-dialog-content],[ngsDialogContent]" }, { kind: "component", type: DialogActions, selector: "ngs-dialog-actions, [ngs-dialog-actions], [ngsDialogActions]", inputs: ["align"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Alert, selector: "ngs-alert", inputs: ["autoClose", "bordered", "variant"], outputs: ["closed"], exportAs: ["ngsAlert"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
338
|
+
}
|
|
339
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataViewSavedViewDialog, decorators: [{
|
|
340
|
+
type: Component,
|
|
341
|
+
args: [{ selector: 'ngs-data-view-saved-view-dialog', imports: [FormsModule, DialogTitle, DialogContent, DialogActions, FormField, Label, Input, Button, Alert], changeDetection: ChangeDetectionStrategy.OnPush, template: "<h3 ngsDialogTitle>{{ title }}</h3>\n<form ngsDialogContent (ngSubmit)=\"save()\" class=\"flex flex-col gap-4\">\n @if (error()) { <ngs-alert variant=\"negative\" role=\"alert\">{{ error() }}</ngs-alert> }\n <ngs-form-field><ngs-label>View name</ngs-label><input ngsInput name=\"viewName\" [(ngModel)]=\"name\" required maxlength=\"100\" autocomplete=\"off\"></ngs-form-field>\n</form>\n<div ngsDialogActions align=\"end\">\n <button ngsButton type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button ngsButton=\"filled\" type=\"button\" (click)=\"save()\">Save</button>\n</div>\n" }]
|
|
342
|
+
}] });
|
|
343
|
+
|
|
22
344
|
class DataViewEmptyDataDirective {
|
|
23
345
|
templateRef = inject(TemplateRef);
|
|
24
346
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataViewEmptyDataDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -94,6 +416,17 @@ class DataViewColumnSettingsDialog {
|
|
|
94
416
|
.filter(c => c.withColumnSettings !== false)
|
|
95
417
|
.map(c => ({ ...c })), /* @ts-ignore */
|
|
96
418
|
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
419
|
+
canApply = computed(() => this.columns().some(c => c.visible !== false)
|
|
420
|
+
|| this._data.columns.some(c => c.withColumnSettings === false && c.visible !== false), /* @ts-ignore */
|
|
421
|
+
...(ngDevMode ? [{ debugName: "canApply" }] : /* istanbul ignore next */ []));
|
|
422
|
+
move(index, offset) {
|
|
423
|
+
const updated = [...this.columns()];
|
|
424
|
+
const next = index + offset;
|
|
425
|
+
if (next < 0 || next >= updated.length)
|
|
426
|
+
return;
|
|
427
|
+
moveItemInArray(updated, index, next);
|
|
428
|
+
this.columns.set(updated);
|
|
429
|
+
}
|
|
97
430
|
drop(event) {
|
|
98
431
|
const updated = [...this.columns()];
|
|
99
432
|
moveItemInArray(updated, event.previousIndex, event.currentIndex);
|
|
@@ -115,13 +448,15 @@ class DataViewColumnSettingsDialog {
|
|
|
115
448
|
this.columns.set(updated);
|
|
116
449
|
}
|
|
117
450
|
apply() {
|
|
451
|
+
if (!this.canApply())
|
|
452
|
+
return;
|
|
118
453
|
this._dialogRef.close({ columns: this.columns() });
|
|
119
454
|
}
|
|
120
455
|
cancel() {
|
|
121
456
|
this._dialogRef.close();
|
|
122
457
|
}
|
|
123
458
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataViewColumnSettingsDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
124
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: DataViewColumnSettingsDialog, isStandalone: true, selector: "ngs-data-view-column-settings-dialog", ngImport: i0, template: "<h3 ngsDialogTitle>Choose Columns</h3>\n<div ngsDialogContent>\n <div class=\"columns flex flex-col gap-2 min-w-[300px]\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n @for (col of columns(); track col.field; let i = $index) {\n <div class=\"flex items-center gap-1 px-1 py-2 bg-surface-container rounded-lg cursor-default\"\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragBoundary=\"columns\">\n <div class=\"cursor-move text-[var(--ngs-text-secondary)] flex items-center\" cdkDragHandle>\n <ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/>\n </div>\n <ngs-checkbox [checked]=\"col.visible !== false\"\n (change)=\"toggleVisibility(i, $event.checked)\">\n {{ col.name }}\n </ngs-checkbox>\n <div class=\"grow\"></div>\n <button ngsIconButton\n class=\"shrink-0\"\n [ngsMenuTriggerFor]=\"pinMenu\"\n [ngsMenuTriggerData]=\"{ col: col, index: i }\">\n <ngs-icon [name]=\"col.pinned ? (col.pinAlign === 'end' ? 'fluent:pin-off-24-filled' : 'fluent:pin-24-filled') : 'fluent:pin-24-regular'\"\n size=\"20\"/>\n </button>\n </div>\n }\n </div>\n</div>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(
|
|
459
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: DataViewColumnSettingsDialog, isStandalone: true, selector: "ngs-data-view-column-settings-dialog", ngImport: i0, template: "<h3 ngsDialogTitle>Choose Columns</h3>\n<div ngsDialogContent>\n <div class=\"columns flex flex-col gap-2 min-w-[300px]\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n @for (col of columns(); track col.field; let i = $index) {\n <div class=\"flex items-center gap-1 px-1 py-2 bg-surface-container rounded-lg cursor-default\"\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragBoundary=\".columns\">\n <div class=\"cursor-move text-[var(--ngs-text-secondary)] flex items-center\" cdkDragHandle>\n <ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/>\n </div>\n <ngs-checkbox [checked]=\"col.visible !== false\"\n (change)=\"toggleVisibility(i, $event.checked)\">\n {{ col.name }}\n </ngs-checkbox>\n <div class=\"grow\"></div>\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Move ' + col.name + ' up'\" [disabled]=\"i === 0\" (click)=\"move(i, -1)\"><ngs-icon name=\"fluent:arrow-up-20-regular\"/></button>\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Move ' + col.name + ' down'\" [disabled]=\"i === columns().length - 1\" (click)=\"move(i, 1)\"><ngs-icon name=\"fluent:arrow-down-20-regular\"/></button>\n <button ngsIconButton\n class=\"shrink-0\"\n [attr.aria-label]=\"'Pin ' + col.name\"\n [ngsMenuTriggerFor]=\"pinMenu\"\n [ngsMenuTriggerData]=\"{ col: col, index: i }\">\n <ngs-icon [name]=\"col.pinned ? (col.pinAlign === 'end' ? 'fluent:pin-off-24-filled' : 'fluent:pin-24-filled') : 'fluent:pin-24-regular'\"\n size=\"20\"/>\n </button>\n </div>\n }\n </div>\n</div>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\" let-index=\"index\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(index, null)\">\n No Pin\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'start'\"\n (click)=\"pinColumn(index, 'start')\">\n Pin Left\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'end'\"\n (click)=\"pinColumn(index, 'end')\">\n Pin Right\n </button>\n </ng-template>\n</ngs-menu>\n@if (!canApply()) { <p class=\"px-6 text-sm text-error\" role=\"alert\">Keep at least one column visible.</p> }\n<div ngsDialogActions align=\"end\">\n <button ngsButton (click)=\"cancel()\">Cancel</button>\n <button ngsButton=\"filled\" [disabled]=\"!canApply()\" (click)=\"apply()\">Apply</button>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: DialogTitle, selector: "ngs-dialog-title, [ngs-dialog-title], [ngsDialogTitle]", inputs: ["id"], exportAs: ["ngsDialogTitle"] }, { kind: "component", type: DialogContent, selector: "ngs-dialog-content,[ngs-dialog-content],[ngsDialogContent]" }, { kind: "component", type: DialogActions, selector: "ngs-dialog-actions, [ngs-dialog-actions], [ngsDialogActions]", inputs: ["align"] }, { kind: "component", type: Checkbox, selector: "ngs-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["checkedChange", "disabledChange", "change", "indeterminateChange"], exportAs: ["ngsCheckbox"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Menu, selector: "ngs-menu", inputs: ["themeSource", "role", "classList", "xPosition", "yPosition", "pushIntoViewport"], outputs: ["closed"], exportAs: ["ngsMenu"] }, { kind: "directive", type: MenuTrigger, selector: "[ngsMenuTriggerFor]", inputs: ["ngsMenuTriggerFor", "ngsMenuTriggerData", "ngsMenuDisabled", "xPosition", "yPosition", "ngsMenuTriggerRestoreFocus"], outputs: ["menuOpened", "menuClosed"], exportAs: ["ngsMenuTrigger"] }, { kind: "directive", type: MenuContent, selector: "[ngsMenuContent]" }, { kind: "component", type: MenuItem, selector: "ngs-menu-item, [ngs-menu-item]", inputs: ["disabled", "role", "selected"], outputs: ["_triggered"], exportAs: ["ngsMenuItem"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
125
460
|
}
|
|
126
461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataViewColumnSettingsDialog, decorators: [{
|
|
127
462
|
type: Component,
|
|
@@ -137,7 +472,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
137
472
|
MenuContent,
|
|
138
473
|
MenuItem,
|
|
139
474
|
DragDropModule
|
|
140
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<h3 ngsDialogTitle>Choose Columns</h3>\n<div ngsDialogContent>\n <div class=\"columns flex flex-col gap-2 min-w-[300px]\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n @for (col of columns(); track col.field; let i = $index) {\n <div class=\"flex items-center gap-1 px-1 py-2 bg-surface-container rounded-lg cursor-default\"\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragBoundary=\"columns\">\n <div class=\"cursor-move text-[var(--ngs-text-secondary)] flex items-center\" cdkDragHandle>\n <ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/>\n </div>\n <ngs-checkbox [checked]=\"col.visible !== false\"\n (change)=\"toggleVisibility(i, $event.checked)\">\n {{ col.name }}\n </ngs-checkbox>\n <div class=\"grow\"></div>\n <button ngsIconButton\n class=\"shrink-0\"\n [ngsMenuTriggerFor]=\"pinMenu\"\n [ngsMenuTriggerData]=\"{ col: col, index: i }\">\n <ngs-icon [name]=\"col.pinned ? (col.pinAlign === 'end' ? 'fluent:pin-off-24-filled' : 'fluent:pin-24-filled') : 'fluent:pin-24-regular'\"\n size=\"20\"/>\n </button>\n </div>\n }\n </div>\n</div>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(
|
|
475
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<h3 ngsDialogTitle>Choose Columns</h3>\n<div ngsDialogContent>\n <div class=\"columns flex flex-col gap-2 min-w-[300px]\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n @for (col of columns(); track col.field; let i = $index) {\n <div class=\"flex items-center gap-1 px-1 py-2 bg-surface-container rounded-lg cursor-default\"\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragBoundary=\".columns\">\n <div class=\"cursor-move text-[var(--ngs-text-secondary)] flex items-center\" cdkDragHandle>\n <ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/>\n </div>\n <ngs-checkbox [checked]=\"col.visible !== false\"\n (change)=\"toggleVisibility(i, $event.checked)\">\n {{ col.name }}\n </ngs-checkbox>\n <div class=\"grow\"></div>\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Move ' + col.name + ' up'\" [disabled]=\"i === 0\" (click)=\"move(i, -1)\"><ngs-icon name=\"fluent:arrow-up-20-regular\"/></button>\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Move ' + col.name + ' down'\" [disabled]=\"i === columns().length - 1\" (click)=\"move(i, 1)\"><ngs-icon name=\"fluent:arrow-down-20-regular\"/></button>\n <button ngsIconButton\n class=\"shrink-0\"\n [attr.aria-label]=\"'Pin ' + col.name\"\n [ngsMenuTriggerFor]=\"pinMenu\"\n [ngsMenuTriggerData]=\"{ col: col, index: i }\">\n <ngs-icon [name]=\"col.pinned ? (col.pinAlign === 'end' ? 'fluent:pin-off-24-filled' : 'fluent:pin-24-filled') : 'fluent:pin-24-regular'\"\n size=\"20\"/>\n </button>\n </div>\n }\n </div>\n</div>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\" let-index=\"index\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(index, null)\">\n No Pin\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'start'\"\n (click)=\"pinColumn(index, 'start')\">\n Pin Left\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'end'\"\n (click)=\"pinColumn(index, 'end')\">\n Pin Right\n </button>\n </ng-template>\n</ngs-menu>\n@if (!canApply()) { <p class=\"px-6 text-sm text-error\" role=\"alert\">Keep at least one column visible.</p> }\n<div ngsDialogActions align=\"end\">\n <button ngsButton (click)=\"cancel()\">Cancel</button>\n <button ngsButton=\"filled\" [disabled]=\"!canApply()\" (click)=\"apply()\">Apply</button>\n</div>\n" }]
|
|
141
476
|
}] });
|
|
142
477
|
|
|
143
478
|
const DATA_VIEW_CONFIG = new InjectionToken('DATA_VIEW_CONFIG');
|
|
@@ -147,7 +482,30 @@ function provideDataView(config) {
|
|
|
147
482
|
]);
|
|
148
483
|
}
|
|
149
484
|
|
|
485
|
+
let nextDataViewId = 0;
|
|
150
486
|
class DataView {
|
|
487
|
+
gridId = `ngs-data-view-${nextDataViewId++}`;
|
|
488
|
+
ariaLabel = input('Data table', /* @ts-ignore */
|
|
489
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
490
|
+
rowActivated = output();
|
|
491
|
+
activeCell = signal({ row: 0, column: 0 }, /* @ts-ignore */
|
|
492
|
+
...(ngDevMode ? [{ debugName: "activeCell" }] : /* istanbul ignore next */ []));
|
|
493
|
+
_selectionAnchor = 0;
|
|
494
|
+
logicalColumns = computed(() => [
|
|
495
|
+
...(this.withSelection() ? ['__selection'] : []), ...this.pinnedLeftColumns().map(c => c.field),
|
|
496
|
+
...this.centerColumns().map(c => c.field), ...this.pinnedRightColumns().map(c => c.field),
|
|
497
|
+
...(this.actionBarTemplateRef ? ['__actions'] : [])
|
|
498
|
+
], /* @ts-ignore */
|
|
499
|
+
...(ngDevMode ? [{ debugName: "logicalColumns" }] : /* istanbul ignore next */ []));
|
|
500
|
+
activeCellId = computed(() => {
|
|
501
|
+
const active = this.activeCell();
|
|
502
|
+
const field = this.logicalColumns()[active.column];
|
|
503
|
+
return field && this.visibleRows().some(row => row.index === active.row) ? this.cellId(active.row, field) : null;
|
|
504
|
+
}, /* @ts-ignore */
|
|
505
|
+
...(ngDevMode ? [{ debugName: "activeCellId" }] : /* istanbul ignore next */ []));
|
|
506
|
+
ariaRowCount = computed(() => this.rowModelType() === 'serverSide'
|
|
507
|
+
? this._serverCountKnown() ? this._serverSideRowCount() + 1 : -1 : this.effectivePaginatorLength() + 1, /* @ts-ignore */
|
|
508
|
+
...(ngDevMode ? [{ debugName: "ariaRowCount" }] : /* istanbul ignore next */ []));
|
|
151
509
|
_cdr = inject(ChangeDetectorRef);
|
|
152
510
|
_destroyRef = inject(DestroyRef);
|
|
153
511
|
_platformId = inject(PLATFORM_ID);
|
|
@@ -159,10 +517,15 @@ class DataView {
|
|
|
159
517
|
_isDestroyed = false;
|
|
160
518
|
_requestId = 0;
|
|
161
519
|
_lastRequestKey = null;
|
|
520
|
+
_lastDatasource = null;
|
|
521
|
+
_lastRowModelType = null;
|
|
522
|
+
_pendingRequestCleanup = null;
|
|
162
523
|
_refreshTrigger = signal(0, /* @ts-ignore */
|
|
163
524
|
...(ngDevMode ? [{ debugName: "_refreshTrigger" }] : /* istanbul ignore next */ []));
|
|
164
525
|
_serverSideRowCount = signal(0, /* @ts-ignore */
|
|
165
526
|
...(ngDevMode ? [{ debugName: "_serverSideRowCount" }] : /* istanbul ignore next */ []));
|
|
527
|
+
_serverCountKnown = signal(false, /* @ts-ignore */
|
|
528
|
+
...(ngDevMode ? [{ debugName: "_serverCountKnown" }] : /* istanbul ignore next */ []));
|
|
166
529
|
_manualOrder = signal(null, /* @ts-ignore */
|
|
167
530
|
...(ngDevMode ? [{ debugName: "_manualOrder" }] : /* istanbul ignore next */ []));
|
|
168
531
|
_manualVisibility = signal({}, /* @ts-ignore */
|
|
@@ -171,6 +534,60 @@ class DataView {
|
|
|
171
534
|
...(ngDevMode ? [{ debugName: "_hasDataOnServer" }] : /* istanbul ignore next */ []));
|
|
172
535
|
_internalLoading = signal(false, /* @ts-ignore */
|
|
173
536
|
...(ngDevMode ? [{ debugName: "_internalLoading" }] : /* istanbul ignore next */ []));
|
|
537
|
+
error = signal(null, /* @ts-ignore */
|
|
538
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
539
|
+
refreshing = computed(() => this._internalLoading() && this.loaded(), /* @ts-ignore */
|
|
540
|
+
...(ngDevMode ? [{ debugName: "refreshing" }] : /* istanbul ignore next */ []));
|
|
541
|
+
loadStatus = computed(() => this.error() ? 'error' : this._internalLoading()
|
|
542
|
+
? (this.loaded() ? 'refreshing' : 'loading') : this.loaded() ? 'ready' : 'idle', /* @ts-ignore */
|
|
543
|
+
...(ngDevMode ? [{ debugName: "loadStatus" }] : /* istanbul ignore next */ []));
|
|
544
|
+
loadError = output();
|
|
545
|
+
blockingLoading = computed(() => this.loading() || (this._internalLoading() && !this.loaded()), /* @ts-ignore */
|
|
546
|
+
...(ngDevMode ? [{ debugName: "blockingLoading" }] : /* istanbul ignore next */ []));
|
|
547
|
+
sortState = model({ active: '', direction: '' }, /* @ts-ignore */
|
|
548
|
+
...(ngDevMode ? [{ debugName: "sortState" }] : /* istanbul ignore next */ []));
|
|
549
|
+
columnFilters = model({}, /* @ts-ignore */
|
|
550
|
+
...(ngDevMode ? [{ debugName: "columnFilters" }] : /* istanbul ignore next */ []));
|
|
551
|
+
withSavedViews = input(this._config?.withSavedViews ?? false, { ...(ngDevMode ? { debugName: "withSavedViews" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
552
|
+
savedViews = model([], /* @ts-ignore */
|
|
553
|
+
...(ngDevMode ? [{ debugName: "savedViews" }] : /* istanbul ignore next */ []));
|
|
554
|
+
viewStorageKey = input(null, /* @ts-ignore */
|
|
555
|
+
...(ngDevMode ? [{ debugName: "viewStorageKey" }] : /* istanbul ignore next */ []));
|
|
556
|
+
_activeViewId = signal(null, /* @ts-ignore */
|
|
557
|
+
...(ngDevMode ? [{ debugName: "_activeViewId" }] : /* istanbul ignore next */ []));
|
|
558
|
+
activeViewId = this._activeViewId.asReadonly();
|
|
559
|
+
viewStorageError = signal(null, /* @ts-ignore */
|
|
560
|
+
...(ngDevMode ? [{ debugName: "viewStorageError" }] : /* istanbul ignore next */ []));
|
|
561
|
+
stateChanged = output();
|
|
562
|
+
viewApplied = output();
|
|
563
|
+
_initialFullState = null;
|
|
564
|
+
_storageReady = signal(false, /* @ts-ignore */
|
|
565
|
+
...(ngDevMode ? [{ debugName: "_storageReady" }] : /* istanbul ignore next */ []));
|
|
566
|
+
dirtyView = computed(() => {
|
|
567
|
+
const view = this.savedViews().find(v => v.id === this.activeViewId());
|
|
568
|
+
return !!view && JSON.stringify(normalizeDataViewState(view.state, this.normalizedColumns()))
|
|
569
|
+
!== JSON.stringify(normalizeDataViewState(this.getState(), this.normalizedColumns()));
|
|
570
|
+
}, /* @ts-ignore */
|
|
571
|
+
...(ngDevMode ? [{ debugName: "dirtyView" }] : /* istanbul ignore next */ []));
|
|
572
|
+
normalizedFilters = computed(() => {
|
|
573
|
+
const filters = normalizeDataViewFilters(this.columnFilters());
|
|
574
|
+
const columns = new Map(this.columnDefs().map(column => [column.field, { ...this.defaultColDef(), ...column }]));
|
|
575
|
+
for (const field of Object.keys(filters)) {
|
|
576
|
+
const column = columns.get(field);
|
|
577
|
+
if (!column)
|
|
578
|
+
delete filters[field];
|
|
579
|
+
else if (column.filter && column.filter.type !== filters[field].type)
|
|
580
|
+
throw new Error(`Filter type must be ${column.filter.type}`);
|
|
581
|
+
}
|
|
582
|
+
return filters;
|
|
583
|
+
}, /* @ts-ignore */
|
|
584
|
+
...(ngDevMode ? [{ debugName: "normalizedFilters" }] : /* istanbul ignore next */ []));
|
|
585
|
+
activeFilters = computed(() => Object.entries(this.normalizedFilters()).map(([field, filter]) => {
|
|
586
|
+
const column = this.normalizedColumns().find(c => c.field === field);
|
|
587
|
+
const detail = filter.type === 'enum' ? filter.values.map(value => column?.filter?.options?.find(o => o.value === value)?.label ?? value).join(', ') : dataViewFilterLabel(filter);
|
|
588
|
+
return { field, label: `${column?.name ?? field}: ${detail}` };
|
|
589
|
+
}), /* @ts-ignore */
|
|
590
|
+
...(ngDevMode ? [{ debugName: "activeFilters" }] : /* istanbul ignore next */ []));
|
|
174
591
|
_isFiltering = signal(false, /* @ts-ignore */
|
|
175
592
|
...(ngDevMode ? [{ debugName: "_isFiltering" }] : /* istanbul ignore next */ []));
|
|
176
593
|
_isSorting = signal(false, /* @ts-ignore */
|
|
@@ -234,6 +651,10 @@ class DataView {
|
|
|
234
651
|
embedded = input(this._config?.embedded ?? false, { ...(ngDevMode ? { debugName: "embedded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
235
652
|
rowSelection = input(this._config?.rowSelection ?? 'multiple', /* @ts-ignore */
|
|
236
653
|
...(ngDevMode ? [{ debugName: "rowSelection" }] : /* istanbul ignore next */ []));
|
|
654
|
+
getRowId = input(null, /* @ts-ignore */
|
|
655
|
+
...(ngDevMode ? [{ debugName: "getRowId" }] : /* istanbul ignore next */ []));
|
|
656
|
+
selectionScope = input('filtered', /* @ts-ignore */
|
|
657
|
+
...(ngDevMode ? [{ debugName: "selectionScope" }] : /* istanbul ignore next */ []));
|
|
237
658
|
allowSingleRowSelectionByClick = input(this._config?.allowSingleRowSelectionByClick ?? false, { ...(ngDevMode ? { debugName: "allowSingleRowSelectionByClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
238
659
|
selectionWidth = input(this._config?.selectionWidth ?? 52, { ...(ngDevMode ? { debugName: "selectionWidth" } : /* istanbul ignore next */ {}), transform: (v) => parseInt(v, 10) || this._config?.selectionWidth || 52 });
|
|
239
660
|
minColumnWidth = input(this._config?.minColumnWidth ?? 50, { ...(ngDevMode ? { debugName: "minColumnWidth" } : /* istanbul ignore next */ {}), transform: (v) => parseInt(v, 10) || this._config?.minColumnWidth || 40 });
|
|
@@ -678,6 +1099,7 @@ class DataView {
|
|
|
678
1099
|
}
|
|
679
1100
|
return data.slice(start, end).map((item, index) => ({
|
|
680
1101
|
item,
|
|
1102
|
+
key: this.getRowId()?.(item) ?? item,
|
|
681
1103
|
index: start + index,
|
|
682
1104
|
top: (start + index) * this.rowHeight(),
|
|
683
1105
|
isLast: (start + index) === data.length - 1
|
|
@@ -716,13 +1138,15 @@ class DataView {
|
|
|
716
1138
|
_syncEffect = effect(() => {
|
|
717
1139
|
const data = this.data();
|
|
718
1140
|
const search = this.search().trim().toLowerCase();
|
|
1141
|
+
const filters = this.normalizedFilters();
|
|
719
1142
|
const rowModelType = this.rowModelType();
|
|
720
1143
|
const refreshTriggerValue = this._refreshTrigger();
|
|
1144
|
+
untracked(() => this.beginRowModel(rowModelType));
|
|
721
1145
|
if (rowModelType === 'serverSide') {
|
|
722
1146
|
return;
|
|
723
1147
|
}
|
|
724
1148
|
untracked(() => {
|
|
725
|
-
this._dataSource.data = data;
|
|
1149
|
+
this._dataSource.data = data.filter(row => Object.entries(filters).every(([field, filter]) => matchesDataViewFilter(this.getNestedValue(row, field), filter)));
|
|
726
1150
|
if (rowModelType === 'clientSide') {
|
|
727
1151
|
this._dataSource.filter = search;
|
|
728
1152
|
}
|
|
@@ -738,30 +1162,48 @@ class DataView {
|
|
|
738
1162
|
_loadDataEffect = effect(() => {
|
|
739
1163
|
const datasource = this.datasource();
|
|
740
1164
|
if (!datasource || this.rowModelType() !== 'serverSide' || this._isDestroyed) {
|
|
1165
|
+
untracked(() => { this.cancelPendingRequest(); this._internalLoading.set(false); this._lastRequestKey = null; });
|
|
741
1166
|
return;
|
|
742
1167
|
}
|
|
1168
|
+
if (datasource !== this._lastDatasource) {
|
|
1169
|
+
this._lastDatasource = datasource;
|
|
1170
|
+
this._lastRequestKey = null;
|
|
1171
|
+
}
|
|
743
1172
|
const pIndex = this.pageIndex();
|
|
744
1173
|
const pSize = this.pageSize();
|
|
745
1174
|
const search = this._debouncedSearch()?.trim() || '';
|
|
1175
|
+
const columnFilters = this.normalizedFilters();
|
|
746
1176
|
// Capture sort params outside untracked but avoid triggering when sort is null due to @if toggling
|
|
747
|
-
const sort = this.
|
|
748
|
-
const sortActive = sort
|
|
749
|
-
const sortDirection = sort
|
|
1177
|
+
const sort = this.sortState();
|
|
1178
|
+
const sortActive = sort.active;
|
|
1179
|
+
const sortDirection = sort.direction;
|
|
750
1180
|
const sortModel = sortActive ? [{ colId: sortActive, sort: sortDirection || '' }] : [];
|
|
751
1181
|
const refreshTriggerValue = this._refreshTrigger();
|
|
752
1182
|
// Build a stable request key to avoid refetch loops when the view toggles (e.g. empty state removes ngsSort)
|
|
753
|
-
const requestKey =
|
|
1183
|
+
const requestKey = JSON.stringify([pIndex, pSize, sortModel, search, columnFilters, refreshTriggerValue]);
|
|
754
1184
|
if (this._lastRequestKey === requestKey) {
|
|
755
1185
|
return; // no meaningful params change — skip triggering a new request
|
|
756
1186
|
}
|
|
757
1187
|
// Special case: if sort was active and now is undefined because component was removed from DOM,
|
|
758
1188
|
// but we ARE loading or in a state where we expect it to come back, we might want to wait.
|
|
759
1189
|
// However, the requestKey should handle it. If sortActive becomes undefined, requestKey changes.
|
|
760
|
-
const
|
|
761
|
-
const
|
|
1190
|
+
const previousQuery = this._lastRequestKey ? JSON.parse(this._lastRequestKey) : null;
|
|
1191
|
+
const isFilterRequest = previousQuery && (previousQuery[3] !== search || JSON.stringify(previousQuery[4]) !== JSON.stringify(columnFilters));
|
|
1192
|
+
const isSortRequest = previousQuery && JSON.stringify(previousQuery[2]) !== JSON.stringify(sortModel);
|
|
762
1193
|
this._lastRequestKey = requestKey;
|
|
763
1194
|
untracked(() => {
|
|
1195
|
+
this.cancelPendingRequest();
|
|
764
1196
|
const currentRequestId = ++this._requestId;
|
|
1197
|
+
const controller = new AbortController();
|
|
1198
|
+
let settled = false;
|
|
1199
|
+
let dispose;
|
|
1200
|
+
this._pendingRequestCleanup = () => {
|
|
1201
|
+
controller.abort();
|
|
1202
|
+
if (typeof dispose === 'function')
|
|
1203
|
+
dispose();
|
|
1204
|
+
else if (dispose && typeof dispose.unsubscribe === 'function')
|
|
1205
|
+
dispose.unsubscribe();
|
|
1206
|
+
};
|
|
765
1207
|
if (isFilterRequest) {
|
|
766
1208
|
this._isFiltering.set(true);
|
|
767
1209
|
}
|
|
@@ -769,7 +1211,10 @@ class DataView {
|
|
|
769
1211
|
this._isSorting.set(true);
|
|
770
1212
|
}
|
|
771
1213
|
this._internalLoading.set(true);
|
|
1214
|
+
this.error.set(null);
|
|
772
1215
|
const params = {
|
|
1216
|
+
signal: controller.signal,
|
|
1217
|
+
columnFilters,
|
|
773
1218
|
startRow: pIndex * pSize,
|
|
774
1219
|
endRow: (pIndex + 1) * pSize,
|
|
775
1220
|
page: pIndex,
|
|
@@ -778,16 +1223,24 @@ class DataView {
|
|
|
778
1223
|
filterModel: search,
|
|
779
1224
|
successCallback: (rows, lastRow) => {
|
|
780
1225
|
this._ngZone.run(() => {
|
|
781
|
-
if (this._isDestroyed || currentRequestId !== this._requestId)
|
|
1226
|
+
if (settled || controller.signal.aborted || this._isDestroyed || currentRequestId !== this._requestId)
|
|
782
1227
|
return;
|
|
1228
|
+
settled = true;
|
|
783
1229
|
this._dataSource.data = rows;
|
|
784
1230
|
if (lastRow !== undefined) {
|
|
785
|
-
this.
|
|
1231
|
+
this._serverCountKnown.set(true);
|
|
1232
|
+
const total = Math.max(0, lastRow);
|
|
1233
|
+
this._serverSideRowCount.set(total);
|
|
1234
|
+
const lastPage = Math.max(0, Math.ceil(total / Math.max(1, pSize)) - 1);
|
|
1235
|
+
if (pIndex > lastPage) {
|
|
1236
|
+
this.pageIndex.set(lastPage);
|
|
1237
|
+
this.resetScroll();
|
|
1238
|
+
}
|
|
786
1239
|
// Update _hasDataOnServer if we have any rows OR if we are doing a clean request (no filters)
|
|
787
1240
|
if (lastRow > 0) {
|
|
788
1241
|
this._hasDataOnServer.set(true);
|
|
789
1242
|
}
|
|
790
|
-
else if (!search && !
|
|
1243
|
+
else if (!search && !Object.keys(columnFilters).length) {
|
|
791
1244
|
this._hasDataOnServer.set(false);
|
|
792
1245
|
}
|
|
793
1246
|
}
|
|
@@ -796,7 +1249,7 @@ class DataView {
|
|
|
796
1249
|
if (rows.length > 0) {
|
|
797
1250
|
this._hasDataOnServer.set(true);
|
|
798
1251
|
}
|
|
799
|
-
else if (!search && !
|
|
1252
|
+
else if (!search && !Object.keys(columnFilters).length) {
|
|
800
1253
|
this._hasDataOnServer.set(false);
|
|
801
1254
|
}
|
|
802
1255
|
}
|
|
@@ -813,10 +1266,13 @@ class DataView {
|
|
|
813
1266
|
this._cdr.markForCheck();
|
|
814
1267
|
});
|
|
815
1268
|
},
|
|
816
|
-
failCallback: () => {
|
|
1269
|
+
failCallback: (error) => {
|
|
817
1270
|
this._ngZone.run(() => {
|
|
818
|
-
if (this._isDestroyed || currentRequestId !== this._requestId)
|
|
1271
|
+
if (settled || controller.signal.aborted || this._isDestroyed || currentRequestId !== this._requestId)
|
|
819
1272
|
return;
|
|
1273
|
+
settled = true;
|
|
1274
|
+
this.error.set(error instanceof Error ? error.message : typeof error === 'string' ? error : 'Could not load records. Please try again.');
|
|
1275
|
+
this.loadError.emit(error);
|
|
820
1276
|
this.loaded.set(true);
|
|
821
1277
|
this._internalLoading.set(false);
|
|
822
1278
|
this._isFiltering.set(false);
|
|
@@ -832,7 +1288,12 @@ class DataView {
|
|
|
832
1288
|
}
|
|
833
1289
|
};
|
|
834
1290
|
this._ngZone.runOutsideAngular(() => {
|
|
835
|
-
|
|
1291
|
+
try {
|
|
1292
|
+
dispose = datasource.getItems(params);
|
|
1293
|
+
}
|
|
1294
|
+
catch (error) {
|
|
1295
|
+
params.failCallback(error);
|
|
1296
|
+
}
|
|
836
1297
|
});
|
|
837
1298
|
});
|
|
838
1299
|
}, /* @ts-ignore */
|
|
@@ -853,7 +1314,7 @@ class DataView {
|
|
|
853
1314
|
...(ngDevMode ? [{ debugName: "cellRenderers" }] : /* istanbul ignore next */ []));
|
|
854
1315
|
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
855
1316
|
hoverRows = input(false, { ...(ngDevMode ? { debugName: "hoverRows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
856
|
-
search =
|
|
1317
|
+
search = model('', /* @ts-ignore */
|
|
857
1318
|
...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
|
|
858
1319
|
_debouncedSearch = signal('', /* @ts-ignore */
|
|
859
1320
|
...(ngDevMode ? [{ debugName: "_debouncedSearch" }] : /* istanbul ignore next */ []));
|
|
@@ -890,12 +1351,18 @@ class DataView {
|
|
|
890
1351
|
shouldRenderGrid = computed(() => this.loaded() || this._isLoading(), /* @ts-ignore */
|
|
891
1352
|
...(ngDevMode ? [{ debugName: "shouldRenderGrid" }] : /* istanbul ignore next */ []));
|
|
892
1353
|
injector = inject(Injector);
|
|
893
|
-
selection = new
|
|
1354
|
+
selection = new DataViewSelection(row => this.getRowId()?.(row) ?? row);
|
|
1355
|
+
_selectionTick = signal(0, /* @ts-ignore */
|
|
1356
|
+
...(ngDevMode ? [{ debugName: "_selectionTick" }] : /* istanbul ignore next */ []));
|
|
1357
|
+
_selectedScope = 'filtered';
|
|
1358
|
+
_selectedSearch = '';
|
|
1359
|
+
_selectedFilters = {};
|
|
894
1360
|
cellRenderersMap = new Map();
|
|
895
1361
|
loadingCellRenderers = signal(false, /* @ts-ignore */
|
|
896
1362
|
...(ngDevMode ? [{ debugName: "loadingCellRenderers" }] : /* istanbul ignore next */ []));
|
|
897
1363
|
rowSelectionChanged = output();
|
|
898
1364
|
selectionChanged = output();
|
|
1365
|
+
selectionStateChanged = output();
|
|
899
1366
|
allRowsSelectionChanged = output();
|
|
900
1367
|
sortChange = output();
|
|
901
1368
|
loadEnd = output();
|
|
@@ -903,10 +1370,10 @@ class DataView {
|
|
|
903
1370
|
get api() {
|
|
904
1371
|
return {
|
|
905
1372
|
search: (value) => {
|
|
906
|
-
this.
|
|
1373
|
+
this.search.set(value);
|
|
907
1374
|
},
|
|
908
|
-
selectAll: () => {
|
|
909
|
-
this.selectAll();
|
|
1375
|
+
selectAll: (scope) => {
|
|
1376
|
+
this.selectAll(scope);
|
|
910
1377
|
},
|
|
911
1378
|
unselectAll: () => {
|
|
912
1379
|
this.unselectAll();
|
|
@@ -925,7 +1392,13 @@ class DataView {
|
|
|
925
1392
|
},
|
|
926
1393
|
getSnapshot: () => {
|
|
927
1394
|
return this.getSnapshot();
|
|
928
|
-
}
|
|
1395
|
+
},
|
|
1396
|
+
getSelection: () => this.getSelection(),
|
|
1397
|
+
setColumnFilter: (field, filter) => this.setColumnFilter(field, filter),
|
|
1398
|
+
clearFilters: () => this.clearFilters(),
|
|
1399
|
+
getState: () => this.getState(), setState: state => this.setState(state),
|
|
1400
|
+
saveView: (name, id) => this.saveView(name, id), applyView: id => this.applyView(id),
|
|
1401
|
+
renameView: (id, name) => this.renameView(id, name), deleteView: id => this.deleteView(id)
|
|
929
1402
|
};
|
|
930
1403
|
}
|
|
931
1404
|
refresh() {
|
|
@@ -964,6 +1437,8 @@ class DataView {
|
|
|
964
1437
|
return this.isNoData || this.isNoResults;
|
|
965
1438
|
}
|
|
966
1439
|
get isNoResults() {
|
|
1440
|
+
if (this.error())
|
|
1441
|
+
return false;
|
|
967
1442
|
const dataSource = this.dataSource();
|
|
968
1443
|
const isClientSide = this.rowModelType() === 'clientSide';
|
|
969
1444
|
const rawDataLength = isClientSide ? this.data().length : (dataSource.data?.length ?? 0);
|
|
@@ -983,6 +1458,8 @@ class DataView {
|
|
|
983
1458
|
return false;
|
|
984
1459
|
}
|
|
985
1460
|
get isNoData() {
|
|
1461
|
+
if (this.error())
|
|
1462
|
+
return false;
|
|
986
1463
|
const dataSource = this.dataSource();
|
|
987
1464
|
const isClientSide = this.rowModelType() === 'clientSide';
|
|
988
1465
|
const rawDataLength = isClientSide ? this.data().length : (dataSource.data?.length ?? 0);
|
|
@@ -1012,7 +1489,7 @@ class DataView {
|
|
|
1012
1489
|
return this._emptyFilterResults()?.templateRef;
|
|
1013
1490
|
}
|
|
1014
1491
|
get hasFilterValue() {
|
|
1015
|
-
return !!this.search().trim();
|
|
1492
|
+
return !!this.search().trim() || Object.keys(this.normalizedFilters()).length > 0;
|
|
1016
1493
|
}
|
|
1017
1494
|
getNestedValue(item, path) {
|
|
1018
1495
|
if (!item || !path) {
|
|
@@ -1025,14 +1502,124 @@ class DataView {
|
|
|
1025
1502
|
}
|
|
1026
1503
|
constructor() {
|
|
1027
1504
|
effect(() => {
|
|
1505
|
+
const length = this.effectiveDataLength();
|
|
1506
|
+
const columns = this.logicalColumns().length;
|
|
1507
|
+
untracked(() => {
|
|
1508
|
+
const active = this.activeCell();
|
|
1509
|
+
const row = Math.max(0, Math.min(active.row, length - 1));
|
|
1510
|
+
const column = Math.max(0, Math.min(active.column, columns - 1));
|
|
1511
|
+
if (row !== active.row || column !== active.column)
|
|
1512
|
+
this.activeCell.set({ row, column });
|
|
1513
|
+
});
|
|
1514
|
+
});
|
|
1515
|
+
let lastState = '';
|
|
1516
|
+
effect(() => {
|
|
1517
|
+
const state = this.getState();
|
|
1518
|
+
const key = JSON.stringify(state);
|
|
1519
|
+
if (key !== lastState) {
|
|
1520
|
+
lastState = key;
|
|
1521
|
+
untracked(() => this.stateChanged.emit(state));
|
|
1522
|
+
}
|
|
1523
|
+
});
|
|
1524
|
+
let loadedStorageKey = null;
|
|
1525
|
+
effect(() => {
|
|
1526
|
+
const key = this.viewStorageKey();
|
|
1527
|
+
const browser = this.isBrowser();
|
|
1528
|
+
if (!browser || key === loadedStorageKey)
|
|
1529
|
+
return;
|
|
1530
|
+
loadedStorageKey = key;
|
|
1531
|
+
untracked(() => {
|
|
1532
|
+
this._storageReady.set(false);
|
|
1533
|
+
this.viewStorageError.set(null);
|
|
1534
|
+
if (!key)
|
|
1535
|
+
return;
|
|
1536
|
+
try {
|
|
1537
|
+
const raw = this.viewStorage()?.getItem(key);
|
|
1538
|
+
if (raw) {
|
|
1539
|
+
const payload = JSON.parse(raw);
|
|
1540
|
+
if (payload.version !== 1)
|
|
1541
|
+
throw new Error('Unsupported saved view format');
|
|
1542
|
+
this.savedViews.set(normalizeDataViewSavedViews(payload.views, this.normalizedColumns()));
|
|
1543
|
+
if (typeof payload.activeViewId === 'string' && this.savedViews().some(v => v.id === payload.activeViewId))
|
|
1544
|
+
this.applyView(payload.activeViewId);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
catch (error) {
|
|
1548
|
+
this.viewStorageError.set(error instanceof Error ? error.message : 'Could not restore saved views');
|
|
1549
|
+
}
|
|
1550
|
+
this._storageReady.set(true);
|
|
1551
|
+
});
|
|
1552
|
+
});
|
|
1553
|
+
effect(() => {
|
|
1554
|
+
const key = this.viewStorageKey();
|
|
1555
|
+
const ready = this._storageReady();
|
|
1556
|
+
const views = this.savedViews();
|
|
1557
|
+
const activeViewId = this.activeViewId();
|
|
1558
|
+
if (!key || !ready)
|
|
1559
|
+
return;
|
|
1560
|
+
untracked(() => {
|
|
1561
|
+
try {
|
|
1562
|
+
this.viewStorage()?.setItem(key, JSON.stringify({ version: 1, views, activeViewId }));
|
|
1563
|
+
}
|
|
1564
|
+
catch (error) {
|
|
1565
|
+
this.viewStorageError.set(error instanceof Error ? error.message : 'Could not save views');
|
|
1566
|
+
}
|
|
1567
|
+
});
|
|
1568
|
+
});
|
|
1569
|
+
let previousSearch;
|
|
1570
|
+
effect(() => {
|
|
1571
|
+
const search = JSON.stringify([this.search().trim(), this.normalizedFilters()]);
|
|
1572
|
+
if (previousSearch !== undefined && previousSearch !== search) {
|
|
1573
|
+
untracked(() => {
|
|
1574
|
+
this.pageIndex.set(0);
|
|
1575
|
+
this.resetScroll();
|
|
1576
|
+
if (this.selection.allMatching && this._selectedScope === 'filtered')
|
|
1577
|
+
this.unselectAll();
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1580
|
+
previousSearch = search;
|
|
1581
|
+
});
|
|
1582
|
+
effect(() => {
|
|
1583
|
+
this._dsRenderTick();
|
|
1584
|
+
const length = this.effectivePaginatorLength();
|
|
1585
|
+
const size = Math.max(1, this.pageSize());
|
|
1586
|
+
const index = this.pageIndex();
|
|
1587
|
+
if (this.rowModelType() === 'clientSide' && this.withPagination()) {
|
|
1588
|
+
const lastPage = Math.max(0, Math.ceil(length / size) - 1);
|
|
1589
|
+
if (index > lastPage || index < 0)
|
|
1590
|
+
untracked(() => {
|
|
1591
|
+
this.pageIndex.set(Math.max(0, Math.min(index, lastPage)));
|
|
1592
|
+
this.resetScroll();
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
let previousRowId = this.getRowId();
|
|
1597
|
+
effect(() => {
|
|
1598
|
+
const key = this.getRowId();
|
|
1028
1599
|
const mode = this.rowSelection();
|
|
1600
|
+
this._dsRenderTick();
|
|
1601
|
+
const rows = this.rowModelType() === 'clientSide' ? this.data() : this.dataSource().data;
|
|
1029
1602
|
untracked(() => {
|
|
1030
|
-
|
|
1031
|
-
|
|
1603
|
+
let changed = false;
|
|
1604
|
+
if (key !== previousRowId) {
|
|
1605
|
+
this.selection.clear();
|
|
1606
|
+
changed = true;
|
|
1607
|
+
previousRowId = key;
|
|
1608
|
+
}
|
|
1609
|
+
if (mode === 'single' && (this.selection.allMatching || this.selection.selected.length > 1)) {
|
|
1610
|
+
const first = this.selection.selected[0];
|
|
1611
|
+
this.selection.clear();
|
|
1612
|
+
if (first)
|
|
1613
|
+
this.selection.select(first);
|
|
1614
|
+
changed = true;
|
|
1615
|
+
}
|
|
1616
|
+
if (this.selection.reconcile(rows, this.rowModelType() === 'clientSide') || changed)
|
|
1617
|
+
this.emitSelection();
|
|
1032
1618
|
});
|
|
1033
1619
|
});
|
|
1034
1620
|
this._destroyRef.onDestroy(() => {
|
|
1035
1621
|
this._isDestroyed = true;
|
|
1622
|
+
this.cancelPendingRequest();
|
|
1036
1623
|
});
|
|
1037
1624
|
// Reactively bind scroll-sync and ResizeObserver to the current ScrollbarArea,
|
|
1038
1625
|
// to work correctly with conditional rendering (empty state / table)
|
|
@@ -1100,26 +1687,27 @@ class DataView {
|
|
|
1100
1687
|
});
|
|
1101
1688
|
effect(() => {
|
|
1102
1689
|
const sort = this._ngsSort();
|
|
1690
|
+
const state = this.sortState();
|
|
1103
1691
|
const dataSource = this.dataSource();
|
|
1104
1692
|
if (sort && dataSource && !this._isDestroyed && this.rowModelType() !== 'serverSide') {
|
|
1105
|
-
|
|
1106
|
-
|
|
1693
|
+
untracked(() => {
|
|
1694
|
+
sort.active.set(state.active);
|
|
1695
|
+
sort.direction.set(state.direction);
|
|
1696
|
+
dataSource.sort = sort;
|
|
1697
|
+
});
|
|
1107
1698
|
}
|
|
1108
1699
|
});
|
|
1109
1700
|
effect(() => {
|
|
1110
|
-
const active = this.paginator()
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
dataSource.paginator = null;
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1701
|
+
const active = this.paginator();
|
|
1702
|
+
const length = this.effectivePaginatorLength();
|
|
1703
|
+
const index = this.pageIndex();
|
|
1704
|
+
const size = this.pageSize();
|
|
1705
|
+
if (active && this.withPagination())
|
|
1706
|
+
untracked(() => {
|
|
1707
|
+
active.length = length;
|
|
1708
|
+
active.pageIndex = index;
|
|
1709
|
+
active.pageSize = size;
|
|
1710
|
+
});
|
|
1123
1711
|
});
|
|
1124
1712
|
// Sync external paginator page events with internal page state when provided
|
|
1125
1713
|
effect((onCleanup) => {
|
|
@@ -1162,14 +1750,17 @@ class DataView {
|
|
|
1162
1750
|
}
|
|
1163
1751
|
ngOnDestroy() {
|
|
1164
1752
|
this._isDestroyed = true;
|
|
1753
|
+
this.cancelPendingRequest();
|
|
1754
|
+
this._dataSource.disconnect();
|
|
1165
1755
|
}
|
|
1166
1756
|
ngOnInit() {
|
|
1757
|
+
this._initialFullState = this.getState();
|
|
1167
1758
|
this._initialViewState.set(this.columnDefs().map(col => ({
|
|
1168
1759
|
field: col.field,
|
|
1169
1760
|
visible: col.visible ?? true,
|
|
1170
1761
|
width: col.width,
|
|
1171
|
-
pinned: col.pinned,
|
|
1172
|
-
pinAlign: col.pinAlign
|
|
1762
|
+
pinned: !!col.pinned,
|
|
1763
|
+
pinAlign: col.pinned ? col.pinAlign : undefined
|
|
1173
1764
|
})));
|
|
1174
1765
|
const snapshot = this.snapshot();
|
|
1175
1766
|
if (snapshot) {
|
|
@@ -1275,8 +1866,20 @@ class DataView {
|
|
|
1275
1866
|
return this.cellRenderersMap.get(cellRenderer);
|
|
1276
1867
|
}
|
|
1277
1868
|
isAllSelected() {
|
|
1278
|
-
|
|
1279
|
-
|
|
1869
|
+
this._selectionTick();
|
|
1870
|
+
if (this.rowModelType() === 'serverSide' && this.selectionScope() !== 'page' && this.getRowId()) {
|
|
1871
|
+
return this.selection.allMatching && this.selection.excluded.size === 0;
|
|
1872
|
+
}
|
|
1873
|
+
const data = this.selectionRows(this.selectionScope());
|
|
1874
|
+
return data.length > 0 && data.every(row => this.selection.isSelected(row));
|
|
1875
|
+
}
|
|
1876
|
+
isPartiallySelected() {
|
|
1877
|
+
this._selectionTick();
|
|
1878
|
+
if (this.rowModelType() === 'serverSide' && this.selectionScope() !== 'page' && this.getRowId())
|
|
1879
|
+
return this.hasSelected() && !this.isAllSelected();
|
|
1880
|
+
const rows = this.selectionRows(this.selectionScope());
|
|
1881
|
+
const selected = rows.filter(row => this.selection.isSelected(row)).length;
|
|
1882
|
+
return selected > 0 && selected < rows.length;
|
|
1280
1883
|
}
|
|
1281
1884
|
toggleAllRows() {
|
|
1282
1885
|
if (this.isAllSelected()) {
|
|
@@ -1288,6 +1891,8 @@ class DataView {
|
|
|
1288
1891
|
}
|
|
1289
1892
|
rowSelectionToggle(event, row) {
|
|
1290
1893
|
if (event.checked) {
|
|
1894
|
+
if (this.rowSelection() === 'single')
|
|
1895
|
+
this.selection.clear();
|
|
1291
1896
|
this.selection.select(row);
|
|
1292
1897
|
}
|
|
1293
1898
|
else {
|
|
@@ -1299,7 +1904,7 @@ class DataView {
|
|
|
1299
1904
|
row,
|
|
1300
1905
|
checked: event.checked
|
|
1301
1906
|
});
|
|
1302
|
-
this.
|
|
1907
|
+
this.emitSelection();
|
|
1303
1908
|
}
|
|
1304
1909
|
selectRowByClick(event, row) {
|
|
1305
1910
|
if (!this.allowSingleRowSelectionByClick() || this._isInteractiveRowClick(event)) {
|
|
@@ -1333,14 +1938,44 @@ class DataView {
|
|
|
1333
1938
|
onPageChange(event) {
|
|
1334
1939
|
this.pageIndex.set(event.pageIndex);
|
|
1335
1940
|
this.pageSize.set(event.pageSize);
|
|
1941
|
+
this.resetScroll();
|
|
1942
|
+
}
|
|
1943
|
+
resetScroll() {
|
|
1944
|
+
const scroller = this._scrollbarArea()?.scrollableContentRef().nativeElement;
|
|
1945
|
+
if (scroller)
|
|
1946
|
+
scroller.scrollTop = 0;
|
|
1947
|
+
this._scrollTop.set(0);
|
|
1948
|
+
this._lastScrollTop = 0;
|
|
1949
|
+
this._syncTransforms();
|
|
1950
|
+
this.activeCell.update(cell => ({ ...cell, row: 0 }));
|
|
1951
|
+
this._selectionAnchor = 0;
|
|
1952
|
+
}
|
|
1953
|
+
cancelPendingRequest() {
|
|
1954
|
+
const cleanup = this._pendingRequestCleanup;
|
|
1955
|
+
this._pendingRequestCleanup = null;
|
|
1956
|
+
cleanup?.();
|
|
1957
|
+
}
|
|
1958
|
+
beginRowModel(mode) {
|
|
1959
|
+
if (mode === this._lastRowModelType)
|
|
1960
|
+
return;
|
|
1961
|
+
this._lastRowModelType = mode;
|
|
1962
|
+
this._lastRequestKey = null;
|
|
1963
|
+
this._requestId++;
|
|
1964
|
+
this.cancelPendingRequest();
|
|
1965
|
+
this._hasDataOnServer.set(undefined);
|
|
1966
|
+
this._serverCountKnown.set(false);
|
|
1967
|
+
this._serverSideRowCount.set(0);
|
|
1968
|
+
this.error.set(null);
|
|
1969
|
+
this._isFiltering.set(false);
|
|
1970
|
+
this._isSorting.set(false);
|
|
1971
|
+
this.loaded.set(mode === 'clientSide');
|
|
1972
|
+
this._internalLoading.set(mode === 'serverSide');
|
|
1973
|
+
this._dataSource.sort = null;
|
|
1974
|
+
this._dataSource.filter = '';
|
|
1975
|
+
this._dataSource.data = [];
|
|
1976
|
+
this.resetScroll();
|
|
1336
1977
|
}
|
|
1337
1978
|
sortColumn(col, direction) {
|
|
1338
|
-
const sort = this.ngsSort;
|
|
1339
|
-
if (sort) {
|
|
1340
|
-
sort.active.set(col.field);
|
|
1341
|
-
sort.direction.set(direction);
|
|
1342
|
-
sort.sortChange.emit({ active: col.field, direction });
|
|
1343
|
-
}
|
|
1344
1979
|
this.onSortChange({ active: col.field, direction });
|
|
1345
1980
|
}
|
|
1346
1981
|
getSnapshot() {
|
|
@@ -1348,18 +1983,20 @@ class DataView {
|
|
|
1348
1983
|
field: col.field,
|
|
1349
1984
|
visible: col.visible ?? true,
|
|
1350
1985
|
width: col.width,
|
|
1351
|
-
pinned: col.pinned,
|
|
1352
|
-
pinAlign: col.pinAlign
|
|
1986
|
+
pinned: !!col.pinned,
|
|
1987
|
+
pinAlign: col.pinned ? col.pinAlign : undefined
|
|
1353
1988
|
}));
|
|
1354
1989
|
}
|
|
1355
1990
|
applyState(state) {
|
|
1356
1991
|
if (!state || state.length === 0)
|
|
1357
1992
|
return;
|
|
1358
|
-
const pinOverrides = {
|
|
1359
|
-
const widthOverrides = {
|
|
1993
|
+
const pinOverrides = {};
|
|
1994
|
+
const widthOverrides = {};
|
|
1995
|
+
const visibility = {};
|
|
1360
1996
|
this.columnDefs().forEach(col => {
|
|
1361
1997
|
const colState = state.find(s => s.field === col.field);
|
|
1362
1998
|
if (colState) {
|
|
1999
|
+
visibility[col.field] = colState.visible !== false;
|
|
1363
2000
|
if (colState.width !== undefined) {
|
|
1364
2001
|
widthOverrides[col.field] = colState.width;
|
|
1365
2002
|
}
|
|
@@ -1371,6 +2008,8 @@ class DataView {
|
|
|
1371
2008
|
});
|
|
1372
2009
|
this._manualPinned.set(pinOverrides);
|
|
1373
2010
|
this._manualWidths.set(widthOverrides);
|
|
2011
|
+
this._manualVisibility.set(visibility);
|
|
2012
|
+
this._manualOrder.set(state.map(c => c.field));
|
|
1374
2013
|
this._cdr.markForCheck();
|
|
1375
2014
|
}
|
|
1376
2015
|
pinColumn(col, align) {
|
|
@@ -1426,24 +2065,11 @@ class DataView {
|
|
|
1426
2065
|
+ 32 // padding-left/right
|
|
1427
2066
|
+ 32; // extra space for sort icon and menu button
|
|
1428
2067
|
let maxContentWidth = headerWidth;
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
rowsToMeasure.forEach(row => {
|
|
1435
|
-
const cells = Array.from(row.querySelectorAll('.cell'));
|
|
1436
|
-
const cell = cells[colIndex];
|
|
1437
|
-
if (cell) {
|
|
1438
|
-
const content = cell.firstElementChild;
|
|
1439
|
-
if (content) {
|
|
1440
|
-
const width = content.scrollWidth + 32; // + padding
|
|
1441
|
-
if (width > maxContentWidth) {
|
|
1442
|
-
maxContentWidth = width;
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
});
|
|
2068
|
+
const cells = Array.from(gridRoot.querySelectorAll('.cell')).filter(cell => cell.dataset['columnField'] === col.field).slice(0, 50);
|
|
2069
|
+
for (const cell of cells) {
|
|
2070
|
+
const content = cell.firstElementChild;
|
|
2071
|
+
if (content)
|
|
2072
|
+
maxContentWidth = Math.max(maxContentWidth, content.scrollWidth + 32);
|
|
1447
2073
|
}
|
|
1448
2074
|
return Math.min(Math.max(maxContentWidth, 60), 500);
|
|
1449
2075
|
}
|
|
@@ -1494,20 +2120,44 @@ class DataView {
|
|
|
1494
2120
|
});
|
|
1495
2121
|
}
|
|
1496
2122
|
onSortChange(event) {
|
|
2123
|
+
this.sortState.set(event);
|
|
2124
|
+
this.pageIndex.set(0);
|
|
2125
|
+
this.resetScroll();
|
|
1497
2126
|
if (this.rowModelType() !== 'serverSide') {
|
|
1498
2127
|
this.dataSource().sort = this.ngsSort || null;
|
|
1499
2128
|
}
|
|
1500
2129
|
this.sortChange.emit(event);
|
|
1501
2130
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
this.
|
|
1505
|
-
|
|
2131
|
+
selectionRows(scope) {
|
|
2132
|
+
this._dsRenderTick();
|
|
2133
|
+
if (this.rowModelType() === 'serverSide')
|
|
2134
|
+
return this.dataSource().data;
|
|
2135
|
+
const rows = scope === 'all' ? this.data() : this.dataSource().sortedData;
|
|
2136
|
+
return scope === 'page' && this.withPagination()
|
|
2137
|
+
? rows.slice(this.pageIndex() * this.pageSize(), (this.pageIndex() + 1) * this.pageSize()) : rows;
|
|
2138
|
+
}
|
|
2139
|
+
selectAll(scope = this.selectionScope()) {
|
|
2140
|
+
const data = this.selectionRows(scope);
|
|
2141
|
+
this._selectedScope = this.rowModelType() === 'serverSide' && !this.getRowId() ? 'page' : scope;
|
|
2142
|
+
this._selectedSearch = scope === 'all' ? '' : this.search().trim();
|
|
2143
|
+
this._selectedFilters = scope === 'all' ? {} : normalizeDataViewFilters(this.normalizedFilters());
|
|
2144
|
+
if (this.rowSelection() === 'single') {
|
|
2145
|
+
this.selection.clear();
|
|
2146
|
+
if (data[0])
|
|
2147
|
+
this.selection.select(data[0]);
|
|
2148
|
+
}
|
|
2149
|
+
else if (this.rowModelType() === 'serverSide' && scope !== 'page' && this.getRowId()) {
|
|
2150
|
+
this.selection.selectMatching(data);
|
|
2151
|
+
}
|
|
2152
|
+
else {
|
|
2153
|
+
this.selection.selectRows(data);
|
|
2154
|
+
}
|
|
2155
|
+
this.emitSelection();
|
|
1506
2156
|
this.allRowsSelectionChanged.emit(true);
|
|
1507
2157
|
}
|
|
1508
2158
|
unselectAll() {
|
|
1509
2159
|
this.selection.clear();
|
|
1510
|
-
this.
|
|
2160
|
+
this.emitSelection();
|
|
1511
2161
|
this.allRowsSelectionChanged.emit(false);
|
|
1512
2162
|
}
|
|
1513
2163
|
selectOne(row) {
|
|
@@ -1521,21 +2171,289 @@ class DataView {
|
|
|
1521
2171
|
row,
|
|
1522
2172
|
checked: true
|
|
1523
2173
|
});
|
|
1524
|
-
this.
|
|
2174
|
+
this.emitSelection();
|
|
1525
2175
|
}
|
|
1526
2176
|
isSelected(row) {
|
|
2177
|
+
this._selectionTick();
|
|
1527
2178
|
return this.selection.isSelected(row);
|
|
1528
2179
|
}
|
|
1529
2180
|
hasSelected() {
|
|
2181
|
+
this._selectionTick();
|
|
1530
2182
|
return this.selection.hasValue();
|
|
1531
2183
|
}
|
|
2184
|
+
getSelection() {
|
|
2185
|
+
const isId = (value) => typeof value === 'string' || typeof value === 'number';
|
|
2186
|
+
return { scope: this._selectedScope, allMatching: this.selection.allMatching,
|
|
2187
|
+
rowIds: this.selection.keys.filter(isId), excludedRowIds: [...this.selection.excluded].filter(isId),
|
|
2188
|
+
rows: this.selection.selected, search: this._selectedSearch, columnFilters: normalizeDataViewFilters(this._selectedFilters) };
|
|
2189
|
+
}
|
|
2190
|
+
emitSelection() {
|
|
2191
|
+
this._selectionTick.update(value => value + 1);
|
|
2192
|
+
this.selectionChanged.emit(this.selection.selected);
|
|
2193
|
+
this.selectionStateChanged.emit(this.getSelection());
|
|
2194
|
+
this._cdr.markForCheck();
|
|
2195
|
+
}
|
|
2196
|
+
getState() {
|
|
2197
|
+
return { version: 1, columns: this.getSnapshot(), sort: { ...this.sortState() },
|
|
2198
|
+
search: this.search(), columnFilters: normalizeDataViewFilters(this.normalizedFilters()), pageSize: this.pageSize() };
|
|
2199
|
+
}
|
|
2200
|
+
setState(value) {
|
|
2201
|
+
const state = normalizeDataViewState(value, this.normalizedColumns());
|
|
2202
|
+
this.applyState(state.columns);
|
|
2203
|
+
this.sortState.set(state.sort);
|
|
2204
|
+
this.search.set(state.search);
|
|
2205
|
+
this.columnFilters.set(state.columnFilters);
|
|
2206
|
+
this.pageSize.set(state.pageSize);
|
|
2207
|
+
this.pageIndex.set(0);
|
|
2208
|
+
this.resetScroll();
|
|
2209
|
+
}
|
|
2210
|
+
validateViewName(name, id) {
|
|
2211
|
+
const trimmed = name.trim();
|
|
2212
|
+
if (!trimmed || trimmed.length > 100)
|
|
2213
|
+
throw new Error('View name must contain 1–100 characters');
|
|
2214
|
+
if (this.savedViews().some(view => view.id !== id && view.name.toLocaleLowerCase() === trimmed.toLocaleLowerCase()))
|
|
2215
|
+
throw new Error('A view with this name already exists');
|
|
2216
|
+
return trimmed;
|
|
2217
|
+
}
|
|
2218
|
+
saveView(name, id) {
|
|
2219
|
+
if (id && !this.savedViews().some(view => view.id === id))
|
|
2220
|
+
throw new Error(`Unknown saved view: ${id}`);
|
|
2221
|
+
const view = { id: id ?? crypto.randomUUID(), name: this.validateViewName(name, id), state: this.getState() };
|
|
2222
|
+
this.savedViews.update(views => id ? views.map(item => item.id === id ? view : item) : [...views, view]);
|
|
2223
|
+
this._activeViewId.set(view.id);
|
|
2224
|
+
return view;
|
|
2225
|
+
}
|
|
2226
|
+
applyView(id) {
|
|
2227
|
+
if (!id) {
|
|
2228
|
+
if (this._initialFullState)
|
|
2229
|
+
this.setState(this._initialFullState);
|
|
2230
|
+
this._activeViewId.set(null);
|
|
2231
|
+
this.viewApplied.emit(null);
|
|
2232
|
+
return;
|
|
2233
|
+
}
|
|
2234
|
+
const view = this.savedViews().find(item => item.id === id);
|
|
2235
|
+
if (!view)
|
|
2236
|
+
throw new Error(`Unknown saved view: ${id}`);
|
|
2237
|
+
this.setState(view.state);
|
|
2238
|
+
this._activeViewId.set(id);
|
|
2239
|
+
this.viewApplied.emit(view);
|
|
2240
|
+
}
|
|
2241
|
+
renameView(id, name) {
|
|
2242
|
+
if (!this.savedViews().some(view => view.id === id))
|
|
2243
|
+
throw new Error(`Unknown saved view: ${id}`);
|
|
2244
|
+
const trimmed = this.validateViewName(name, id);
|
|
2245
|
+
this.savedViews.update(views => views.map(view => view.id === id ? { ...view, name: trimmed } : view));
|
|
2246
|
+
}
|
|
2247
|
+
deleteView(id) {
|
|
2248
|
+
this.savedViews.update(views => views.filter(view => view.id !== id));
|
|
2249
|
+
if (this.activeViewId() === id)
|
|
2250
|
+
this.applyView(null);
|
|
2251
|
+
}
|
|
2252
|
+
updateCurrentView() {
|
|
2253
|
+
const view = this.savedViews().find(v => v.id === this.activeViewId());
|
|
2254
|
+
if (view)
|
|
2255
|
+
this.saveView(view.name, view.id);
|
|
2256
|
+
}
|
|
2257
|
+
openSavedViewDialog(rename = false) {
|
|
2258
|
+
const current = rename ? this.savedViews().find(v => v.id === this.activeViewId()) : undefined;
|
|
2259
|
+
this._dialog.open(DataViewSavedViewDialog, {
|
|
2260
|
+
width: '420px', maxWidth: 'calc(100vw - 32px)', showCloseButton: true,
|
|
2261
|
+
data: { name: current?.name, existingNames: this.savedViews().filter(v => v.id !== current?.id).map(v => v.name) }
|
|
2262
|
+
}).afterClosed().subscribe(name => { if (name) {
|
|
2263
|
+
if (current)
|
|
2264
|
+
this.renameView(current.id, name);
|
|
2265
|
+
else
|
|
2266
|
+
this.saveView(name);
|
|
2267
|
+
} });
|
|
2268
|
+
}
|
|
2269
|
+
viewStorage() {
|
|
2270
|
+
return this._config?.viewStorage ?? this._doc.defaultView?.localStorage;
|
|
2271
|
+
}
|
|
2272
|
+
headerId(field) { return `${this.gridId}-header-${this.columnIndex(field)}`; }
|
|
2273
|
+
cellId(row, field) { return `${this.gridId}-row-${row}-cell-${this.columnIndex(field)}`; }
|
|
2274
|
+
columnIndex(field) { return this.logicalColumns().indexOf(field) + 1; }
|
|
2275
|
+
rowOwnedCells(row) { return this.logicalColumns().map(field => this.cellId(row, field)).join(' '); }
|
|
2276
|
+
headerOwnedCells() { return this.logicalColumns().map(field => this.headerId(field)).join(' '); }
|
|
2277
|
+
globalRowIndex(row) { return row + (this.withPagination() || this.rowModelType() === 'serverSide' ? this.pageIndex() * this.pageSize() : 0); }
|
|
2278
|
+
isActiveCell(row, field) {
|
|
2279
|
+
return this.activeCell().row === row && this.activeCell().column === this.columnIndex(field) - 1;
|
|
2280
|
+
}
|
|
2281
|
+
activateCell(event, row, field) {
|
|
2282
|
+
this.activeCell.set({ row, column: this.columnIndex(field) - 1 });
|
|
2283
|
+
if (!this._isInteractiveRowClick(event))
|
|
2284
|
+
this._elRef.nativeElement.querySelector('[role="grid"]')?.focus({ preventScroll: true });
|
|
2285
|
+
}
|
|
2286
|
+
onGridKeydown(event) {
|
|
2287
|
+
const target = event.target;
|
|
2288
|
+
if (target.closest('button, input, select, textarea, [contenteditable="true"], [role="combobox"], [role="separator"], [role="button"]'))
|
|
2289
|
+
return;
|
|
2290
|
+
const active = this.activeCell();
|
|
2291
|
+
let { row, column } = active;
|
|
2292
|
+
const length = this.effectiveDataLength();
|
|
2293
|
+
if (!length)
|
|
2294
|
+
return;
|
|
2295
|
+
const maxCol = this.logicalColumns().length - 1;
|
|
2296
|
+
const page = Math.max(1, Math.floor(this._viewportHeight() / this.rowHeight()));
|
|
2297
|
+
const rtl = this._doc.defaultView?.getComputedStyle(this._elRef.nativeElement).direction === 'rtl';
|
|
2298
|
+
switch (event.key) {
|
|
2299
|
+
case 'ArrowDown':
|
|
2300
|
+
row++;
|
|
2301
|
+
break;
|
|
2302
|
+
case 'ArrowUp':
|
|
2303
|
+
row--;
|
|
2304
|
+
break;
|
|
2305
|
+
case 'ArrowRight':
|
|
2306
|
+
column += rtl ? -1 : 1;
|
|
2307
|
+
break;
|
|
2308
|
+
case 'ArrowLeft':
|
|
2309
|
+
column += rtl ? 1 : -1;
|
|
2310
|
+
break;
|
|
2311
|
+
case 'Home':
|
|
2312
|
+
column = 0;
|
|
2313
|
+
if (event.ctrlKey || event.metaKey)
|
|
2314
|
+
row = 0;
|
|
2315
|
+
break;
|
|
2316
|
+
case 'End':
|
|
2317
|
+
column = maxCol;
|
|
2318
|
+
if (event.ctrlKey || event.metaKey)
|
|
2319
|
+
row = length - 1;
|
|
2320
|
+
break;
|
|
2321
|
+
case 'PageDown':
|
|
2322
|
+
row += page;
|
|
2323
|
+
break;
|
|
2324
|
+
case 'PageUp':
|
|
2325
|
+
row -= page;
|
|
2326
|
+
break;
|
|
2327
|
+
case ' ':
|
|
2328
|
+
if (this.withSelection()) {
|
|
2329
|
+
this.selectKeyboardRange(row, event.shiftKey);
|
|
2330
|
+
event.preventDefault();
|
|
2331
|
+
}
|
|
2332
|
+
return;
|
|
2333
|
+
case 'a':
|
|
2334
|
+
if ((event.ctrlKey || event.metaKey) && this.withSelection()) {
|
|
2335
|
+
this.selectAll();
|
|
2336
|
+
event.preventDefault();
|
|
2337
|
+
}
|
|
2338
|
+
return;
|
|
2339
|
+
case 'Escape':
|
|
2340
|
+
if (this.withSelection())
|
|
2341
|
+
this.unselectAll();
|
|
2342
|
+
return;
|
|
2343
|
+
case 'Enter': {
|
|
2344
|
+
const record = this.pageRows()[row];
|
|
2345
|
+
if (record)
|
|
2346
|
+
this.rowActivated.emit(record);
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
default: return;
|
|
2350
|
+
}
|
|
2351
|
+
event.preventDefault();
|
|
2352
|
+
row = Math.max(0, Math.min(row, length - 1));
|
|
2353
|
+
column = Math.max(0, Math.min(column, maxCol));
|
|
2354
|
+
this.activeCell.set({ row, column });
|
|
2355
|
+
this.revealActiveCell();
|
|
2356
|
+
if (event.shiftKey && this.withSelection() && (event.key === 'ArrowDown' || event.key === 'ArrowUp'))
|
|
2357
|
+
this.selectKeyboardRange(row, true);
|
|
2358
|
+
}
|
|
2359
|
+
pageRows() {
|
|
2360
|
+
if (this.rowModelType() === 'serverSide')
|
|
2361
|
+
return this.dataSource().data;
|
|
2362
|
+
const data = this.dataSource().sortedData;
|
|
2363
|
+
return this.withPagination() ? data.slice(this.pageIndex() * this.pageSize(), (this.pageIndex() + 1) * this.pageSize()) : data;
|
|
2364
|
+
}
|
|
2365
|
+
selectKeyboardRange(index, extend) {
|
|
2366
|
+
const rows = this.pageRows();
|
|
2367
|
+
const record = rows[index];
|
|
2368
|
+
if (!record)
|
|
2369
|
+
return;
|
|
2370
|
+
if (this.rowSelection() === 'single') {
|
|
2371
|
+
this.selection.clear();
|
|
2372
|
+
this.selection.select(record);
|
|
2373
|
+
}
|
|
2374
|
+
else if (extend)
|
|
2375
|
+
this.selection.selectRows(rows.slice(Math.min(this._selectionAnchor, index), Math.max(this._selectionAnchor, index) + 1));
|
|
2376
|
+
else {
|
|
2377
|
+
this._selectionAnchor = index;
|
|
2378
|
+
if (this.selection.isSelected(record))
|
|
2379
|
+
this.selection.deselect(record);
|
|
2380
|
+
else
|
|
2381
|
+
this.selection.select(record);
|
|
2382
|
+
}
|
|
2383
|
+
this.rowSelectionChanged.emit({ source: 'keyboard', row: record, checked: this.selection.isSelected(record) });
|
|
2384
|
+
this.emitSelection();
|
|
2385
|
+
}
|
|
2386
|
+
revealActiveCell() {
|
|
2387
|
+
const scroller = this._scrollbarArea()?.scrollableContentRef().nativeElement;
|
|
2388
|
+
if (!scroller)
|
|
2389
|
+
return;
|
|
2390
|
+
const active = this.activeCell();
|
|
2391
|
+
const top = active.row * this.rowHeight();
|
|
2392
|
+
const next = top < scroller.scrollTop ? top : top + this.rowHeight() > scroller.scrollTop + scroller.clientHeight ? top + this.rowHeight() - scroller.clientHeight : scroller.scrollTop;
|
|
2393
|
+
scroller.scrollTop = Math.max(0, next);
|
|
2394
|
+
this._scrollTop.set(scroller.scrollTop);
|
|
2395
|
+
this._lastScrollTop = scroller.scrollTop;
|
|
2396
|
+
const field = this.logicalColumns()[active.column];
|
|
2397
|
+
if (this.centerColumns().some(c => c.field === field)) {
|
|
2398
|
+
const header = this._doc.getElementById(this.headerId(field));
|
|
2399
|
+
const viewport = this._headerCenter()?.nativeElement;
|
|
2400
|
+
if (header && viewport) {
|
|
2401
|
+
const cellRect = header.getBoundingClientRect();
|
|
2402
|
+
const viewportRect = viewport.getBoundingClientRect();
|
|
2403
|
+
if (cellRect.left < viewportRect.left)
|
|
2404
|
+
scroller.scrollLeft -= viewportRect.left - cellRect.left;
|
|
2405
|
+
else if (cellRect.right > viewportRect.right)
|
|
2406
|
+
scroller.scrollLeft += cellRect.right - viewportRect.right;
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
this._lastScrollLeft = scroller.scrollLeft;
|
|
2410
|
+
this._syncTransforms();
|
|
2411
|
+
}
|
|
2412
|
+
columnPixelWidth(col) {
|
|
2413
|
+
const header = this._doc.getElementById(this.headerId(col.field));
|
|
2414
|
+
return Math.round(header?.getBoundingClientRect().width || parseFloat(String(col.width ?? this.minColumnWidth())));
|
|
2415
|
+
}
|
|
2416
|
+
columnMinWidth(col) { return parseFloat(String(col.minWidth ?? this.minColumnWidth())); }
|
|
2417
|
+
columnMaxWidth(col) { return parseFloat(String(col.maxWidth ?? 2000)); }
|
|
2418
|
+
resizeColumnWithKeyboard(event, col) {
|
|
2419
|
+
if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
|
|
2420
|
+
return;
|
|
2421
|
+
event.preventDefault();
|
|
2422
|
+
event.stopPropagation();
|
|
2423
|
+
const min = parseFloat(String(col.minWidth ?? this.minColumnWidth()));
|
|
2424
|
+
const max = parseFloat(String(col.maxWidth ?? 2000));
|
|
2425
|
+
const width = event.key === 'Home' ? min : event.key === 'End' ? max : this.columnPixelWidth(col) + (event.key === 'ArrowRight' ? 1 : -1) * (event.shiftKey ? 1 : 10);
|
|
2426
|
+
this._manualWidths.update(widths => ({ ...widths, [col.field]: `${Math.max(min, Math.min(max, width))}px` }));
|
|
2427
|
+
}
|
|
2428
|
+
setColumnFilter(field, filter) {
|
|
2429
|
+
const column = this.normalizedColumns().find(c => c.field === field);
|
|
2430
|
+
if (!column)
|
|
2431
|
+
throw new Error(`Unknown column: ${field}`);
|
|
2432
|
+
if (filter && column.filter && filter.type !== column.filter.type)
|
|
2433
|
+
throw new Error(`Filter type must be ${column.filter.type}`);
|
|
2434
|
+
const updated = { ...this.normalizedFilters() };
|
|
2435
|
+
const normalized = filter ? normalizeDataViewFilter(filter) : null;
|
|
2436
|
+
if (normalized)
|
|
2437
|
+
Object.defineProperty(updated, field, { value: normalized, enumerable: true, writable: true, configurable: true });
|
|
2438
|
+
else
|
|
2439
|
+
delete updated[field];
|
|
2440
|
+
this.columnFilters.set(updated);
|
|
2441
|
+
}
|
|
2442
|
+
clearFilters() { this.search.set(''); this.columnFilters.set({}); }
|
|
2443
|
+
openColumnFilter(column) {
|
|
2444
|
+
this._dialog.open(DataViewColumnFilterDialog, {
|
|
2445
|
+
width: '420px', maxWidth: 'calc(100vw - 32px)', showCloseButton: true,
|
|
2446
|
+
data: { column, filter: this.normalizedFilters()[column.field] }
|
|
2447
|
+
}).afterClosed().subscribe(result => { if (result)
|
|
2448
|
+
this.setColumnFilter(column.field, result.filter); });
|
|
2449
|
+
}
|
|
1532
2450
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1533
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: DataView, isStandalone: true, selector: "ngs-data-view", inputs: { paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, columnDefs: { classPropertyName: "columnDefs", publicName: "columnDefs", isSignal: true, isRequired: false, transformFunction: null }, defaultColDef: { classPropertyName: "defaultColDef", publicName: "defaultColDef", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, datasource: { classPropertyName: "datasource", publicName: "datasource", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null }, headerHeight: { classPropertyName: "headerHeight", publicName: "headerHeight", isSignal: true, isRequired: false, transformFunction: null }, bufferRows: { classPropertyName: "bufferRows", publicName: "bufferRows", isSignal: true, isRequired: false, transformFunction: null }, withSelection: { classPropertyName: "withSelection", publicName: "withSelection", isSignal: true, isRequired: false, transformFunction: null }, highlightHeader: { classPropertyName: "highlightHeader", publicName: "highlightHeader", isSignal: true, isRequired: false, transformFunction: null }, rowModelType: { classPropertyName: "rowModelType", publicName: "rowModelType", isSignal: true, isRequired: false, transformFunction: null }, autoHeight: { classPropertyName: "autoHeight", publicName: "autoHeight", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, withPagination: { classPropertyName: "withPagination", publicName: "withPagination", isSignal: true, isRequired: false, transformFunction: null }, bodyScroll: { classPropertyName: "bodyScroll", publicName: "bodyScroll", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, paginatorAriaLabel: { classPropertyName: "paginatorAriaLabel", publicName: "paginatorAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null }, snapshot: { classPropertyName: "snapshot", publicName: "snapshot", isSignal: true, isRequired: false, transformFunction: null }, withColumnSettings: { classPropertyName: "withColumnSettings", publicName: "withColumnSettings", isSignal: true, isRequired: false, transformFunction: null }, embedded: { classPropertyName: "embedded", publicName: "embedded", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, allowSingleRowSelectionByClick: { classPropertyName: "allowSingleRowSelectionByClick", publicName: "allowSingleRowSelectionByClick", isSignal: true, isRequired: false, transformFunction: null }, selectionWidth: { classPropertyName: "selectionWidth", publicName: "selectionWidth", isSignal: true, isRequired: false, transformFunction: null }, minColumnWidth: { classPropertyName: "minColumnWidth", publicName: "minColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, cellRenderers: { classPropertyName: "cellRenderers", publicName: "cellRenderers", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, hoverRows: { classPropertyName: "hoverRows", publicName: "hoverRows", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, emptyIcon: { classPropertyName: "emptyIcon", publicName: "emptyIcon", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterResultsIcon: { classPropertyName: "emptyFilterResultsIcon", publicName: "emptyFilterResultsIcon", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterResultsText: { classPropertyName: "emptyFilterResultsText", publicName: "emptyFilterResultsText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageSize: "pageSizeChange", pageIndex: "pageIndexChange", rowSelectionChanged: "rowSelectionChanged", selectionChanged: "selectionChanged", allRowsSelectionChanged: "allRowsSelectionChanged", sortChange: "sortChange", loadEnd: "loadEnd", refreshEnd: "refreshEnd" }, host: { properties: { "class.highlight-header": "highlightHeader()", "class.pinned-header": "stickyHeader()", "class.hover-rows": "hoverRows()", "class.is-loading": "
|
|
2451
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: DataView, isStandalone: true, selector: "ngs-data-view", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, withSavedViews: { classPropertyName: "withSavedViews", publicName: "withSavedViews", isSignal: true, isRequired: false, transformFunction: null }, savedViews: { classPropertyName: "savedViews", publicName: "savedViews", isSignal: true, isRequired: false, transformFunction: null }, viewStorageKey: { classPropertyName: "viewStorageKey", publicName: "viewStorageKey", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, columnDefs: { classPropertyName: "columnDefs", publicName: "columnDefs", isSignal: true, isRequired: false, transformFunction: null }, defaultColDef: { classPropertyName: "defaultColDef", publicName: "defaultColDef", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, datasource: { classPropertyName: "datasource", publicName: "datasource", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null }, headerHeight: { classPropertyName: "headerHeight", publicName: "headerHeight", isSignal: true, isRequired: false, transformFunction: null }, bufferRows: { classPropertyName: "bufferRows", publicName: "bufferRows", isSignal: true, isRequired: false, transformFunction: null }, withSelection: { classPropertyName: "withSelection", publicName: "withSelection", isSignal: true, isRequired: false, transformFunction: null }, highlightHeader: { classPropertyName: "highlightHeader", publicName: "highlightHeader", isSignal: true, isRequired: false, transformFunction: null }, rowModelType: { classPropertyName: "rowModelType", publicName: "rowModelType", isSignal: true, isRequired: false, transformFunction: null }, autoHeight: { classPropertyName: "autoHeight", publicName: "autoHeight", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, withPagination: { classPropertyName: "withPagination", publicName: "withPagination", isSignal: true, isRequired: false, transformFunction: null }, bodyScroll: { classPropertyName: "bodyScroll", publicName: "bodyScroll", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, paginatorAriaLabel: { classPropertyName: "paginatorAriaLabel", publicName: "paginatorAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null }, snapshot: { classPropertyName: "snapshot", publicName: "snapshot", isSignal: true, isRequired: false, transformFunction: null }, withColumnSettings: { classPropertyName: "withColumnSettings", publicName: "withColumnSettings", isSignal: true, isRequired: false, transformFunction: null }, embedded: { classPropertyName: "embedded", publicName: "embedded", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, getRowId: { classPropertyName: "getRowId", publicName: "getRowId", isSignal: true, isRequired: false, transformFunction: null }, selectionScope: { classPropertyName: "selectionScope", publicName: "selectionScope", isSignal: true, isRequired: false, transformFunction: null }, allowSingleRowSelectionByClick: { classPropertyName: "allowSingleRowSelectionByClick", publicName: "allowSingleRowSelectionByClick", isSignal: true, isRequired: false, transformFunction: null }, selectionWidth: { classPropertyName: "selectionWidth", publicName: "selectionWidth", isSignal: true, isRequired: false, transformFunction: null }, minColumnWidth: { classPropertyName: "minColumnWidth", publicName: "minColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, cellRenderers: { classPropertyName: "cellRenderers", publicName: "cellRenderers", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, hoverRows: { classPropertyName: "hoverRows", publicName: "hoverRows", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, emptyIcon: { classPropertyName: "emptyIcon", publicName: "emptyIcon", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterResultsIcon: { classPropertyName: "emptyFilterResultsIcon", publicName: "emptyFilterResultsIcon", isSignal: true, isRequired: false, transformFunction: null }, emptyFilterResultsText: { classPropertyName: "emptyFilterResultsText", publicName: "emptyFilterResultsText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowActivated: "rowActivated", loadError: "loadError", sortState: "sortStateChange", columnFilters: "columnFiltersChange", savedViews: "savedViewsChange", stateChanged: "stateChanged", viewApplied: "viewApplied", pageSize: "pageSizeChange", pageIndex: "pageIndexChange", search: "searchChange", rowSelectionChanged: "rowSelectionChanged", selectionChanged: "selectionChanged", selectionStateChanged: "selectionStateChanged", allRowsSelectionChanged: "allRowsSelectionChanged", sortChange: "sortChange", loadEnd: "loadEnd", refreshEnd: "refreshEnd" }, host: { properties: { "class.highlight-header": "highlightHeader()", "class.pinned-header": "stickyHeader()", "class.hover-rows": "hoverRows()", "class.is-loading": "blockingLoading()", "class.embedded": "embedded()", "class.has-horizontal-scroll": "hasHorizontalScroll()", "class.is-browser": "isBrowser()", "class.allow-row-click-selection": "allowSingleRowSelectionByClick()", "style.--ngs-data-view-header-height.px": "headerHeight()", "style.--ngs-data-view-selection-column-width.px": "selectionWidth()", "class.is-auto-height": "autoHeight()" }, classAttribute: "ngs-data-view" }, providers: [
|
|
1534
2452
|
{
|
|
1535
2453
|
provide: DATA_VIEW,
|
|
1536
2454
|
useExisting: forwardRef(() => DataView),
|
|
1537
2455
|
},
|
|
1538
|
-
], queries: [{ propertyName: "_emptyDataRef", first: true, predicate: DataViewEmptyDataDirective, descendants: true, isSignal: true }, { propertyName: "_emptyFilterResults", first: true, predicate: DataViewEmptyFilterResultsDirective, descendants: true, isSignal: true }, { propertyName: "_actionBarRef", first: true, predicate: DataViewActionBarDirective, descendants: true, isSignal: true }, { propertyName: "_actionBarComp", first: true, predicate: DataViewActionBarDirective, descendants: true, read: DataViewActionBar, isSignal: true }], viewQueries: [{ propertyName: "_table", first: true, predicate: ["table"], descendants: true, isSignal: true }, { propertyName: "_ngsSort", first: true, predicate: SortDirective, descendants: true, isSignal: true }, { propertyName: "_internalPaginator", first: true, predicate: Paginator, descendants: true, isSignal: true }, { propertyName: "_headerCenter", first: true, predicate: ["headerCenter"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_headerCenterInner", first: true, predicate: ["headerCenterInner"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_bodyLeftContent", first: true, predicate: ["bodyLeftContent"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_scrollbarArea", first: true, predicate: ScrollbarArea, descendants: true, isSignal: true }, { propertyName: "_bodyCenterContent", first: true, predicate: ["bodyCenterContent"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_bodyRightContent", first: true, predicate: ["bodyRightContent"], descendants: true, read: ElementRef, isSignal: true }], exportAs: ["ngsDataView"], ngImport: i0, template: "<div class=\"flex flex-col h-full overflow-hidden relative\"\n ngsBlockLoaderContainer>\n <ngs-block-loader [loading]=\"_isLoading()\"/>\n @if (shouldRenderGrid()) {\n @if (!noFilteredResults) {\n <div class=\"grid-root flex flex-col grow overflow-hidden relative\">\n @if (isResizing()) {\n <div class=\"ngs-data-view-resize-line\" [style.left.px]=\"resizeLineLeft()\"></div>\n }\n\n <!-- GRID HEADER -->\n <div class=\"grid-header pinned top-0 z-20 flex overflow-hidden shrink-0 font-medium\"\n ngsSort\n [style.height.px]=\"headerHeight()\"\n [ngsSortDisabled]=\"!isSortingEnabled() || _isLoading() || _isFiltering()\"\n (ngsSortChange)=\"onSortChange($event)\">\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div class=\"grid-header-left shrink-0 flex z-30\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"leftPinnedWidth()\">\n @if (withSelection()) {\n <div class=\"header-cell cell-selection flex items-center justify-center shrink-0\">\n @if (rowSelection() === 'multiple') {\n <ngs-checkbox (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\" />\n }\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\">{{ col.name }}</span>\n </div>\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div #headerCenter class=\"grid-header-center grow flex overflow-hidden\">\n <div #headerCenterInner class=\"flex header-inner\" [style.width.px]=\"centerWidth()\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\">{{ col.name }}</span>\n </div>\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div class=\"grid-header-right shrink-0 flex z-30\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"rightPinnedWidth()\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\">{{ col.name }}</span>\n </div>\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"header-cell flex items-center shrink-0\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n \n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <div class=\"grid-body grow flex relative\">\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div #bodyLeft class=\"grid-body-left pinned-viewport shrink-0 overflow-hidden z-10 pinned left-0\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div #bodyLeftCanvas class=\"pinned-canvas\">\n <div #bodyLeftContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.index) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"selection.isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @if (withSelection()) {\n <div class=\"cell cell-selection flex items-center justify-center shrink-0\">\n <ngs-checkbox (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? rowSelectionToggle($event, row.item) : null\"\n [checked]=\"selection.isSelected(row.item)\" />\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col }\"></ng-container>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n\n <div #bodyCenter class=\"grid-body-center grow overflow-hidden relative\">\n <ngs-scrollbar-area>\n <div #bodyCenterContent class=\"rows-container\">\n @for (row of visibleRows(); track row.index) {\n <div class=\"grid-row flex absolute left-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [style.width.px]=\"centerWidth()\"\n [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"selection.isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col }\"/>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"virtual-spacer relative\" [style.height.px]=\"totalHeight()\" [style.width.px]=\"centerWidth()\"></div>\n </ngs-scrollbar-area>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div #bodyRight class=\"grid-body-right pinned-viewport shrink-0 overflow-hidden z-10 pinned right-0\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div #bodyRightCanvas class=\"pinned-canvas\">\n <div #bodyRightContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.index) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"selection.isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col }\"></ng-container>\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"cell flex items-center shrink-0\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n <ng-container [ngTemplateOutlet]=\"actionBarTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row.item }\"/>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (withPagination() && !paginator()) {\n <ngs-paginator [pageSizeOptions]=\"pageSizeOptions()\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [pageSize]=\"pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [length]=\"effectivePaginatorLength()\"\n [disabled]=\"_isLoading() || _isFiltering()\"\n (page)=\"onPageChange($event)\"/>\n }\n </div>\n } @else {\n @if (isNoResults) {\n @if (emptyFilterResultsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyFilterResultsTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyFilterResultsIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ interpolatedEmptyFilterResultsText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n } @else {\n @if (emptyTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ emptyText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n }\n }\n }\n</div>\n\n<ng-template #cellContent let-row=\"row\" let-col=\"col\">\n <div class=\"overflow-hidden w-full\">\n @if (col.cellRenderer && hasCellRenderer(col.cellRenderer)) {\n <ng-container [ngComponentOutlet]=\"getCellRenderer(col.cellRenderer)\"\n [ngComponentOutletInputs]=\"{ element: row, columnDef: col, fieldData: getNestedValue(row, col.field) }\"\n [ngComponentOutletInjector]=\"injector\"/>\n } @else {\n {{ getNestedValue(row, col.field) }}\n }\n </div>\n</ng-template>\n\n<ngs-menu #columnMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n @if (col.sortable) {\n <button ngs-menu-item (click)=\"sortColumn(col, 'asc')\">\n <ngs-icon name=\"fluent:arrow-sort-up-24-regular\" size=\"20\"/>\n Sort Ascending\n </button>\n <button ngs-menu-item (click)=\"sortColumn(col, 'desc')\">\n <ngs-icon name=\"fluent:arrow-sort-down-24-regular\" size=\"20\"/>\n Sort Descending\n </button>\n <ngs-menu-divider/>\n }\n <button ngs-menu-item [ngsMenuTriggerFor]=\"pinMenu\" [ngsMenuTriggerData]=\"{ col: col }\">\n <ngs-icon name=\"fluent:pin-24-regular\" size=\"20\"/>\n Pin Column\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"autosizeColumn(col)\">\n Autosize This Column\n </button>\n <button ngs-menu-item (click)=\"autosizeAllColumns()\">\n Autosize All Columns\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"openColumnSettingsDialog()\">\n Choose Columns\n </button>\n <button ngs-menu-item (click)=\"resetColumns()\">\n Reset Columns\n </button>\n </ng-template>\n</ngs-menu>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(col, null)\">\n No Pin\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'start'\"\n (click)=\"pinColumn(col, 'start')\">\n Pin Left\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'end'\"\n (click)=\"pinColumn(col, 'end')\">\n Pin Right\n </button>\n </ng-template>\n</ngs-menu>\n", styles: [":host{--ngs-data-view-header-height: 48px;--ngs-data-view-selection-column-width: 48px;--ngs-data-view-header-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-body-bg: var(--ngs-color-background);--ngs-data-view-row-bg: var(--ngs-color-background);--ngs-data-view-row-hover-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-hl-header-row-bg: var(--ngs-color-surface-container);--ngs-data-view-border-color: var(--ngs-color-border);--ngs-data-view-bg: transparent;--ngs-data-view-min-height: 300px;--ngs-table-row-item-outline-width: 0;--ngs-table-background: var(--ngs-data-view-bg);--ngs-table-header-cell-background: var(--ngs-data-view-header-bg);--ngs-data-view-radius: var(--ngs-radius-xl);--ngs-data-view-root-border: 1px solid var(--ngs-data-view-border-color);--ngs-data-view-cell-padding: 0 calc(var(--spacing, .25rem) * 4)}:host.allow-row-click-selection .grid-row{cursor:pointer}:host .ngs-data-view-resize-line{position:absolute;top:0;bottom:0;width:1px;background-color:var(--ngs-color-primary);z-index:1000;pointer-events:none;margin-left:-1px;transform:translate(0);will-change:transform}:host.embedded{--ngs-data-view-radius: 0;--ngs-data-view-root-border: none}:host.highlight-header{--ngs-data-view-header-bg: var(--ngs-data-view-hl-header-row-bg)}:host{display:flex;flex-direction:column;min-height:var(--ngs-data-view-min-height)}:host:not(.is-auto-height){height:var(--ngs-data-view-min-height)}:host>div:first-child{flex:1 1 auto}:host.is-loading{pointer-events:none;-webkit-user-select:none;user-select:none}:host .grid-root{background-color:var(--ngs-data-view-body-bg);border:var(--ngs-data-view-root-border);border-radius:var(--ngs-data-view-radius);min-height:inherit;flex:1 1 auto}:host .grid-header,:host .grid-body,:host ngs-paginator{transition:opacity .3s ease-in-out;opacity:1}:host .grid-header-center,:host .grid-body-center{flex:1 1 0;min-width:0}:host .grid-header .header-cell .ngs-data-view-column-settings-btn{z-index:10;margin-inline-end:calc(calc(var(--spacing, .25rem) * 2.5) * -1);display:none;transition:opacity .2s,color .2s}:host .grid-header .header-cell .ngs-data-view-column-settings-btn:not(:hover) ngs-icon{color:var(--ngs-color-neutral-500)}:host .grid-header .header-cell:hover .ngs-data-view-column-settings-btn{display:inline-flex}:host .grid-header .header-cell .ngs-data-view-column-settings-btn.is-menu-open{display:inline-flex}:host ::ng-deep .header-cell,:host ::ng-deep .cell{box-sizing:border-box;padding:var(--ngs-data-view-cell-padding);border-right:1px solid transparent;overflow:hidden;min-width:40px}:host ::ng-deep .header-cell.cell-selection,:host ::ng-deep .cell.cell-selection{padding:0 calc(var(--spacing, .25rem) * 2);width:var(--ngs-data-view-selection-column-width);min-width:var(--ngs-data-view-selection-column-width)}:host ::ng-deep .header-cell{background-color:var(--ngs-data-view-header-bg)}:host ::ng-deep .cell{background-color:transparent}:host ::ng-deep .ngs-header-cell,:host ::ng-deep .ngs-cell{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host .grid-header{-webkit-user-select:text;user-select:text;background-color:var(--ngs-data-view-header-bg);color:var(--ngs-color-on-background);font-size:.875rem;position:sticky;top:0;z-index:20;border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-header .header-cell{height:var(--ngs-data-view-header-height);position:relative}:host .grid-header .header-cell .col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;z-index:10;border-right:1px solid var(--ngs-color-border);transition:border-color .2s}:host .grid-header .header-cell .col-resize-handle:hover{border-right-color:var(--ngs-color-primary)}:host .grid-header .grid-header-left{box-sizing:border-box;position:relative}:host .grid-header .grid-header-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-header .grid-header-right{box-sizing:border-box;position:relative}:host .grid-header .grid-header-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body{font-size:.875rem;overflow:hidden;flex:1 1 auto;min-height:100px}:host .grid-body .grid-body-left,:host .grid-body .grid-body-center,:host .grid-body .grid-body-right{background-color:var(--ngs-data-view-body-bg, var(--ngs-color-background))}:host .grid-body .grid-row{background-color:var(--ngs-data-view-row-bg);box-sizing:border-box;color:var(--ngs-color-on-background);border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-body .grid-row.is-last{border-bottom:none}:host .grid-body .grid-row.is-selected{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected{background-color:color-mix(in srgb,var(--ngs-color-primary) 10%,transparent)}}:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:color-mix(in srgb,var(--ngs-color-primary) 20%,transparent)}}:host .grid-body .grid-row:hover,:host .grid-body .grid-row.is-hovered{background-color:var(--ngs-data-view-row-hover-bg)}:host .grid-body .grid-body-left,:host .grid-body .grid-body-right{scrollbar-width:none}:host .grid-body .grid-body-left::-webkit-scrollbar,:host .grid-body .grid-body-right::-webkit-scrollbar{display:none}:host .grid-body .grid-body-left.grid-body-left,:host .grid-body .grid-body-right.grid-body-left{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-left:after,:host .grid-body .grid-body-right.grid-body-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.grid-body-right,:host .grid-body .grid-body-right.grid-body-right{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-right:after,:host .grid-body .grid-body-right.grid-body-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.pinned-viewport,:host .grid-body .grid-body-right.pinned-viewport{overflow:hidden;position:sticky;top:0;z-index:10;contain:layout paint}:host .grid-body .grid-body-left .pinned-canvas,:host .grid-body .grid-body-right .pinned-canvas{will-change:transform;height:100%;width:100%;contain:layout paint}:host .grid-body .grid-body-left .pinned-content,:host .grid-body .grid-body-right .pinned-content{position:relative}:host .grid-body .grid-body-center{contain:layout paint}:host .grid-body .grid-body-center .rows-container{position:sticky;top:0;left:0;will-change:transform;width:100%;z-index:1}:host .grid-header-center{scrollbar-width:none}:host .grid-header-center::-webkit-scrollbar{display:none}:host .grid-header-center{contain:layout paint}:host .grid-header-center .header-inner{will-change:transform;contain:layout paint}:host:not(.has-horizontal-scroll) .grid-header-left:after,:host:not(.has-horizontal-scroll) .grid-body-left:after,:host:not(.has-horizontal-scroll) .grid-header-right:after,:host:not(.has-horizontal-scroll) .grid-body-right:after{display:none}:host ngs-paginator{padding:calc(var(--spacing, .25rem) * 2.5) 0;border-top:1px solid var(--ngs-data-view-border-color)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Checkbox, selector: "ngs-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["checkedChange", "disabledChange", "change", "indeterminateChange"], exportAs: ["ngsCheckbox"] }, { kind: "component", type: SortHeader, selector: "[ngs-sort-header]", inputs: ["ngs-sort-header", "sortActionDescription", "disabled"], exportAs: ["ngsSortHeader"] }, { kind: "directive", type: SortDirective, selector: "[ngsSort]", inputs: ["ngsSortActive", "ngsSortStart", "ngsSortDirection", "ngsSortDisableClear", "ngsSortDisabled"], outputs: ["ngsSortActiveChange", "ngsSortDirectionChange", "ngsSortChange"], exportAs: ["ngsSort"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Paginator, selector: "ngs-paginator", inputs: ["pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "disabled"], outputs: ["page"], exportAs: ["ngsPaginator"] }, { kind: "component", type: ScrollbarArea, selector: "ngs-scrollbar-area", inputs: ["scrollbarWidth", "autoHide", "absolute"], outputs: ["scrolled"], exportAs: ["ngsScrollbarArea"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: EmptyState, selector: "ngs-empty-state", exportAs: ["ngsEmptyState"] }, { kind: "component", type: EmptyStateIcon, selector: "ngs-empty-state-icon", exportAs: ["ngsEmptyStateIcon"] }, { kind: "component", type: EmptyStateContent, selector: "ngs-empty-state-content", exportAs: ["ngsEmptyStateContent"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: BlockLoader, selector: "ngs-block-loader", inputs: ["loading", "spinnerDiameter", "spinnerStrokeWidth"], exportAs: ["ngsBlockLoader"] }, { kind: "directive", type: BlockLoaderContainerDirective, selector: "[ngsBlockLoaderContainer]" }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Menu, selector: "ngs-menu", inputs: ["role", "classList", "xPosition", "yPosition", "pushIntoViewport"], outputs: ["closed"], exportAs: ["ngsMenu"] }, { kind: "component", type: MenuItem, selector: "ngs-menu-item, [ngs-menu-item]", inputs: ["disabled", "role", "selected"], outputs: ["_triggered"], exportAs: ["ngsMenuItem"] }, { kind: "directive", type: MenuTrigger, selector: "[ngsMenuTriggerFor]", inputs: ["ngsMenuTriggerFor", "ngsMenuTriggerData", "ngsMenuDisabled", "xPosition", "yPosition", "ngsMenuTriggerRestoreFocus"], outputs: ["menuOpened", "menuClosed"], exportAs: ["ngsMenuTrigger"] }, { kind: "component", type: MenuDivider, selector: "ngs-menu-divider" }, { kind: "directive", type: MenuContent, selector: "[ngsMenuContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2456
|
+
], queries: [{ propertyName: "_emptyDataRef", first: true, predicate: DataViewEmptyDataDirective, descendants: true, isSignal: true }, { propertyName: "_emptyFilterResults", first: true, predicate: DataViewEmptyFilterResultsDirective, descendants: true, isSignal: true }, { propertyName: "_actionBarRef", first: true, predicate: DataViewActionBarDirective, descendants: true, isSignal: true }, { propertyName: "_actionBarComp", first: true, predicate: DataViewActionBarDirective, descendants: true, read: DataViewActionBar, isSignal: true }], viewQueries: [{ propertyName: "_table", first: true, predicate: ["table"], descendants: true, isSignal: true }, { propertyName: "_ngsSort", first: true, predicate: SortDirective, descendants: true, isSignal: true }, { propertyName: "_internalPaginator", first: true, predicate: Paginator, descendants: true, isSignal: true }, { propertyName: "_headerCenter", first: true, predicate: ["headerCenter"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_headerCenterInner", first: true, predicate: ["headerCenterInner"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_bodyLeftContent", first: true, predicate: ["bodyLeftContent"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_scrollbarArea", first: true, predicate: ScrollbarArea, descendants: true, isSignal: true }, { propertyName: "_bodyCenterContent", first: true, predicate: ["bodyCenterContent"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_bodyRightContent", first: true, predicate: ["bodyRightContent"], descendants: true, read: ElementRef, isSignal: true }], exportAs: ["ngsDataView"], ngImport: i0, template: "<div class=\"flex flex-col h-full overflow-hidden relative\"\n ngsBlockLoaderContainer>\n @if (withSavedViews()) {\n <ngs-toolbar class=\"shrink-0\" aria-label=\"Table views\">\n <ngs-toolbar-item>\n <ngs-form-field class=\"view-selector\" aria-label=\"Saved view\">\n <ngs-select placeholder=\"Default view\" aria-label=\"Saved view\" [ngModel]=\"activeViewId()\" (ngModelChange)=\"applyView($event)\">\n <ngs-option [value]=\"null\">Default view</ngs-option>\n @for (view of savedViews(); track view.id) { <ngs-option [value]=\"view.id\">{{ view.name }}</ngs-option> }\n </ngs-select>\n </ngs-form-field>\n </ngs-toolbar-item>\n @if (dirtyView()) { <ngs-toolbar-item><span class=\"text-sm text-on-surface-variant\" role=\"status\">Unsaved changes</span></ngs-toolbar-item> }\n <ngs-toolbar-spacer/>\n <ngs-toolbar-item><button ngsButton type=\"button\" [ngsMenuTriggerFor]=\"viewsMenu\">View actions</button></ngs-toolbar-item>\n </ngs-toolbar>\n @if (viewStorageError()) { <ngs-alert variant=\"negative\" role=\"alert\">{{ viewStorageError() }}</ngs-alert> }\n }\n <ngs-block-loader [loading]=\"blockingLoading()\"/>\n @if (error()) {\n <ngs-alert variant=\"negative\" class=\"mb-3\" role=\"alert\">\n {{ error() }}\n <button ngsButton type=\"button\" (click)=\"refresh()\">Retry</button>\n </ngs-alert>\n }\n @if (refreshing()) { <div class=\"px-4 py-2 text-sm text-on-surface-variant\" role=\"status\" aria-live=\"polite\">Updating records\u2026</div> }\n @if (activeFilters().length || search().trim()) {\n <div class=\"flex items-center gap-2 flex-wrap px-3 py-2 shrink-0\" aria-label=\"Active filters\">\n <ngs-chip-set>\n @if (search().trim()) {\n <ngs-chip (removed)=\"search.set('')\">Search: {{ search() }}<button ngsChipRemove type=\"button\" aria-label=\"Remove search filter\"><ngs-icon name=\"fluent:dismiss-16-regular\"/></button></ngs-chip>\n }\n @for (filter of activeFilters(); track filter.field) {\n <ngs-chip (removed)=\"setColumnFilter(filter.field, null)\">{{ filter.label }}<button ngsChipRemove type=\"button\" [attr.aria-label]=\"'Remove filter ' + filter.label\"><ngs-icon name=\"fluent:dismiss-16-regular\"/></button></ngs-chip>\n }\n </ngs-chip-set>\n <button ngsButton type=\"button\" (click)=\"clearFilters()\">Clear all</button>\n </div>\n }\n @if (shouldRenderGrid()) {\n <div class=\"grid-root flex flex-col grow overflow-hidden relative\" role=\"grid\" tabindex=\"0\"\n [attr.aria-label]=\"ariaLabel()\" [attr.aria-rowcount]=\"ariaRowCount()\" [attr.aria-colcount]=\"logicalColumns().length\"\n [attr.aria-busy]=\"_isLoading()\" [attr.aria-multiselectable]=\"withSelection() && rowSelection() === 'multiple'\"\n [attr.aria-activedescendant]=\"activeCellId()\" [attr.aria-describedby]=\"noFilteredResults ? gridId + '-empty' : null\" (keydown)=\"onGridKeydown($event)\">\n @if (isResizing()) {\n <div class=\"ngs-data-view-resize-line\" [style.left.px]=\"resizeLineLeft()\"></div>\n }\n\n <!-- GRID HEADER -->\n <div class=\"grid-header pinned top-0 z-20 flex overflow-hidden shrink-0 font-medium\"\n role=\"row\" aria-rowindex=\"1\" [attr.aria-owns]=\"headerOwnedCells()\"\n ngsSort\n [ngsSortActive]=\"sortState().active\"\n [ngsSortDirection]=\"sortState().direction\"\n [style.height.px]=\"headerHeight()\"\n [ngsSortDisabled]=\"!isSortingEnabled() || blockingLoading()\"\n (ngsSortChange)=\"onSortChange($event)\">\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div class=\"grid-header-left shrink-0 flex z-30\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"leftPinnedWidth()\">\n @if (withSelection()) {\n <div class=\"header-cell cell-selection flex items-center justify-center shrink-0\" role=\"columnheader\"\n [attr.id]=\"headerId('__selection')\" aria-colindex=\"1\" aria-label=\"Row selection\">\n @if (rowSelection() === 'multiple') {\n <ngs-checkbox aria-label=\"Select rows in current selection scope\" (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"hasSelected() && isAllSelected()\"\n [indeterminate]=\"isPartiallySelected()\" />\n }\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [attr.id]=\"headerId(col.field)\" role=\"columnheader\" [attr.aria-labelledby]=\"headerId(col.field) + '-label'\" [attr.aria-colindex]=\"columnIndex(col.field)\"\n [attr.aria-sort]=\"sortState().active === col.field && sortState().direction ? (sortState().direction === 'asc' ? 'ascending' : 'descending') : 'none'\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\" [sortActionDescription]=\"'Sort by ' + col.name\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\" [attr.id]=\"headerId(col.field) + '-label'\">{{ col.name }}</span>\n </div>\n @if (col.filter) {\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Filter ' + col.name\"\n [class.is-filter-active]=\"!!normalizedFilters()[col.field]\" (click)=\"openColumnFilter(col)\">\n <ngs-icon name=\"fluent:filter-20-regular\"/>\n </button>\n }\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\" [attr.aria-label]=\"col.name + ' column actions'\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.name\" [attr.aria-valuenow]=\"columnPixelWidth(col)\"\n [attr.aria-valuemin]=\"columnMinWidth(col)\" [attr.aria-valuemax]=\"columnMaxWidth(col)\"\n (keydown)=\"resizeColumnWithKeyboard($event, col)\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div #headerCenter class=\"grid-header-center grow flex overflow-hidden\">\n <div #headerCenterInner class=\"flex header-inner\" [style.width.px]=\"centerWidth()\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [attr.id]=\"headerId(col.field)\" role=\"columnheader\" [attr.aria-labelledby]=\"headerId(col.field) + '-label'\" [attr.aria-colindex]=\"columnIndex(col.field)\"\n [attr.aria-sort]=\"sortState().active === col.field && sortState().direction ? (sortState().direction === 'asc' ? 'ascending' : 'descending') : 'none'\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\" [sortActionDescription]=\"'Sort by ' + col.name\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\" [attr.id]=\"headerId(col.field) + '-label'\">{{ col.name }}</span>\n </div>\n @if (col.filter) {\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Filter ' + col.name\"\n [class.is-filter-active]=\"!!normalizedFilters()[col.field]\" (click)=\"openColumnFilter(col)\">\n <ngs-icon name=\"fluent:filter-20-regular\"/>\n </button>\n }\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\" [attr.aria-label]=\"col.name + ' column actions'\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.name\" [attr.aria-valuenow]=\"columnPixelWidth(col)\"\n [attr.aria-valuemin]=\"columnMinWidth(col)\" [attr.aria-valuemax]=\"columnMaxWidth(col)\"\n (keydown)=\"resizeColumnWithKeyboard($event, col)\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div class=\"grid-header-right shrink-0 flex z-30\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"rightPinnedWidth()\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [attr.id]=\"headerId(col.field)\" role=\"columnheader\" [attr.aria-labelledby]=\"headerId(col.field) + '-label'\" [attr.aria-colindex]=\"columnIndex(col.field)\"\n [attr.aria-sort]=\"sortState().active === col.field && sortState().direction ? (sortState().direction === 'asc' ? 'ascending' : 'descending') : 'none'\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\" [sortActionDescription]=\"'Sort by ' + col.name\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\" [attr.id]=\"headerId(col.field) + '-label'\">{{ col.name }}</span>\n </div>\n @if (col.filter) {\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Filter ' + col.name\"\n [class.is-filter-active]=\"!!normalizedFilters()[col.field]\" (click)=\"openColumnFilter(col)\">\n <ngs-icon name=\"fluent:filter-20-regular\"/>\n </button>\n }\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\" [attr.aria-label]=\"col.name + ' column actions'\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.name\" [attr.aria-valuenow]=\"columnPixelWidth(col)\"\n [attr.aria-valuemin]=\"columnMinWidth(col)\" [attr.aria-valuemax]=\"columnMaxWidth(col)\"\n (keydown)=\"resizeColumnWithKeyboard($event, col)\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"header-cell flex items-center shrink-0\" role=\"columnheader\" [attr.id]=\"headerId('__actions')\" [attr.aria-colindex]=\"columnIndex('__actions')\" aria-label=\"Row actions\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n \n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <div class=\"grid-body grow flex relative\">\n @if (noFilteredResults) {\n <div class=\"grow flex items-center justify-center p-6\" role=\"status\" [attr.id]=\"gridId + '-empty'\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"/>\n </div>\n } @else {\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div #bodyLeft class=\"grid-body-left pinned-viewport shrink-0 overflow-hidden z-10 pinned left-0\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div #bodyLeftCanvas class=\"pinned-canvas\">\n <div #bodyLeftContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.key) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n role=\"presentation\" [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @if (withSelection()) {\n <div class=\"cell cell-selection flex items-center justify-center shrink-0\" role=\"gridcell\"\n [attr.id]=\"cellId(row.index, '__selection')\" aria-colindex=\"1\" [class.is-active]=\"isActiveCell(row.index, '__selection')\"\n (click)=\"activateCell($event, row.index, '__selection')\">\n <ngs-checkbox [aria-label]=\"'Select row ' + (globalRowIndex(row.index) + 1)\" (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? rowSelectionToggle($event, row.item) : null\"\n [checked]=\"isSelected(row.item)\" />\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\" role=\"gridcell\" [attr.id]=\"cellId(row.index, col.field)\"\n [attr.aria-colindex]=\"columnIndex(col.field)\" [attr.aria-labelledby]=\"headerId(col.field) + '-label ' + cellId(row.index, col.field) + '-value'\"\n [attr.data-column-field]=\"col.field\" [class.is-active]=\"isActiveCell(row.index, col.field)\"\n (click)=\"activateCell($event, row.index, col.field)\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col, index: row.index }\"></ng-container>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n\n <div #bodyCenter class=\"grid-body-center grow overflow-hidden relative\">\n <ngs-scrollbar-area>\n <div #bodyCenterContent class=\"rows-container\">\n @for (row of visibleRows(); track row.key) {\n <div class=\"grid-row flex absolute left-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [style.width.px]=\"centerWidth()\"\n role=\"row\" [attr.aria-rowindex]=\"globalRowIndex(row.index) + 2\" [attr.aria-selected]=\"withSelection() ? isSelected(row.item) : null\"\n [attr.aria-owns]=\"rowOwnedCells(row.index)\" [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\" role=\"gridcell\" [attr.id]=\"cellId(row.index, col.field)\"\n [attr.aria-colindex]=\"columnIndex(col.field)\" [attr.aria-labelledby]=\"headerId(col.field) + '-label ' + cellId(row.index, col.field) + '-value'\"\n [attr.data-column-field]=\"col.field\" [class.is-active]=\"isActiveCell(row.index, col.field)\"\n (click)=\"activateCell($event, row.index, col.field)\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col, index: row.index }\"/>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"virtual-spacer relative\" [style.height.px]=\"totalHeight()\" [style.width.px]=\"centerWidth()\"></div>\n </ngs-scrollbar-area>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div #bodyRight class=\"grid-body-right pinned-viewport shrink-0 overflow-hidden z-10 pinned right-0\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div #bodyRightCanvas class=\"pinned-canvas\">\n <div #bodyRightContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.key) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n role=\"presentation\" [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\" role=\"gridcell\" [attr.id]=\"cellId(row.index, col.field)\"\n [attr.aria-colindex]=\"columnIndex(col.field)\" [attr.aria-labelledby]=\"headerId(col.field) + '-label ' + cellId(row.index, col.field) + '-value'\"\n [attr.data-column-field]=\"col.field\" [class.is-active]=\"isActiveCell(row.index, col.field)\"\n (click)=\"activateCell($event, row.index, col.field)\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col, index: row.index }\"></ng-container>\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"cell flex items-center shrink-0\" role=\"gridcell\" [attr.id]=\"cellId(row.index, '__actions')\"\n [attr.aria-colindex]=\"columnIndex('__actions')\" [class.is-active]=\"isActiveCell(row.index, '__actions')\"\n (click)=\"activateCell($event, row.index, '__actions')\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n <ng-container [ngTemplateOutlet]=\"actionBarTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row.item }\"/>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n }\n </div>\n\n </div>\n @if (withPagination() && !paginator()) {\n <ngs-paginator [pageSizeOptions]=\"pageSizeOptions()\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [pageSize]=\"pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [length]=\"effectivePaginatorLength()\"\n [disabled]=\"blockingLoading()\"\n (page)=\"onPageChange($event)\"/>\n }\n\n }\n</div>\n\n<ng-template #cellContent let-row=\"row\" let-col=\"col\" let-index=\"index\">\n <div class=\"overflow-hidden w-full\" [attr.id]=\"cellId(index, col.field) + '-value'\">\n @if (col.cellRenderer && hasCellRenderer(col.cellRenderer)) {\n <ng-container [ngComponentOutlet]=\"getCellRenderer(col.cellRenderer)\"\n [ngComponentOutletInputs]=\"{ element: row, columnDef: col, fieldData: getNestedValue(row, col.field) }\"\n [ngComponentOutletInjector]=\"injector\"/>\n } @else {\n {{ getNestedValue(row, col.field) }}\n }\n </div>\n</ng-template>\n\n<ngs-menu #columnMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n @if (col.sortable) {\n <button ngs-menu-item (click)=\"sortColumn(col, 'asc')\">\n <ngs-icon name=\"fluent:arrow-sort-up-24-regular\" size=\"20\"/>\n Sort Ascending\n </button>\n <button ngs-menu-item (click)=\"sortColumn(col, 'desc')\">\n <ngs-icon name=\"fluent:arrow-sort-down-24-regular\" size=\"20\"/>\n Sort Descending\n </button>\n <ngs-menu-divider/>\n }\n <button ngs-menu-item [ngsMenuTriggerFor]=\"pinMenu\" [ngsMenuTriggerData]=\"{ col: col }\">\n <ngs-icon name=\"fluent:pin-24-regular\" size=\"20\"/>\n Pin Column\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"autosizeColumn(col)\">\n Autosize This Column\n </button>\n <button ngs-menu-item (click)=\"autosizeAllColumns()\">\n Autosize All Columns\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"openColumnSettingsDialog()\">\n Choose Columns\n </button>\n <button ngs-menu-item (click)=\"resetColumns()\">\n Reset Columns\n </button>\n </ng-template>\n</ngs-menu>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(col, null)\">\n No Pin\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'start'\"\n (click)=\"pinColumn(col, 'start')\">\n Pin Left\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'end'\"\n (click)=\"pinColumn(col, 'end')\">\n Pin Right\n </button>\n </ng-template>\n</ngs-menu>\n\n<ngs-menu #viewsMenu=\"ngsMenu\">\n <button ngs-menu-item (click)=\"openSavedViewDialog()\">Save current view</button>\n <button ngs-menu-item [disabled]=\"!activeViewId()\" (click)=\"updateCurrentView()\">Update current view</button>\n <button ngs-menu-item [disabled]=\"!activeViewId()\" (click)=\"openSavedViewDialog(true)\">Rename view</button>\n <button ngs-menu-item [disabled]=\"!activeViewId()\" (click)=\"deleteView(activeViewId()!)\">Delete view</button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"applyView(null)\">Reset to default view</button>\n</ngs-menu>\n\n<ng-template #emptyContent>\n @if (isNoResults) {\n @if (emptyFilterResultsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyFilterResultsTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyFilterResultsIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ interpolatedEmptyFilterResultsText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n } @else {\n @if (emptyTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ emptyText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n }\n</ng-template>\n", styles: [":host{--ngs-data-view-header-height: 48px;--ngs-data-view-selection-column-width: 48px;--ngs-data-view-header-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-body-bg: var(--ngs-color-background);--ngs-data-view-row-bg: var(--ngs-color-background);--ngs-data-view-row-hover-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-hl-header-row-bg: var(--ngs-color-surface-container);--ngs-data-view-border-color: var(--ngs-color-border);--ngs-data-view-bg: transparent;--ngs-data-view-min-height: 300px;--ngs-table-row-item-outline-width: 0;--ngs-table-background: var(--ngs-data-view-bg);--ngs-table-header-cell-background: var(--ngs-data-view-header-bg);--ngs-data-view-radius: var(--ngs-radius-xl);--ngs-data-view-root-border: 1px solid var(--ngs-data-view-border-color);--ngs-data-view-cell-padding: 0 calc(var(--spacing, .25rem) * 4)}:host.allow-row-click-selection .grid-row{cursor:pointer}:host .ngs-data-view-resize-line{position:absolute;top:0;bottom:0;width:1px;background-color:var(--ngs-color-primary);z-index:1000;pointer-events:none;margin-left:-1px;transform:translate(0);will-change:transform}:host.embedded{--ngs-data-view-radius: 0;--ngs-data-view-root-border: none}:host.highlight-header{--ngs-data-view-header-bg: var(--ngs-data-view-hl-header-row-bg)}:host{display:flex;flex-direction:column;min-height:var(--ngs-data-view-min-height)}:host:not(.is-auto-height){height:var(--ngs-data-view-min-height)}:host>div:first-child{flex:1 1 auto}:host.is-loading{pointer-events:none;-webkit-user-select:none;user-select:none}:host .grid-root:focus-visible{outline:2px solid var(--ngs-color-primary);outline-offset:-2px}:host .grid-root:focus-within .ngs-data-view-column-settings-btn{visibility:visible;opacity:1;pointer-events:auto}:host .grid-root:focus-within .cell.is-active{outline:2px solid var(--ngs-color-primary);outline-offset:-2px}:host .grid-root{background-color:var(--ngs-data-view-body-bg);border:var(--ngs-data-view-root-border);border-radius:var(--ngs-data-view-radius);min-height:inherit;flex:1 1 auto}:host .grid-header,:host .grid-body,:host ngs-paginator{transition:opacity .3s ease-in-out;opacity:1}:host .grid-header-center,:host .grid-body-center{flex:1 1 0;min-width:0}:host .grid-header .header-cell .ngs-data-view-column-settings-btn{z-index:10;margin-inline-end:calc(calc(var(--spacing, .25rem) * 2.5) * -1);display:inline-flex;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .2s,color .2s}:host .grid-header .header-cell .ngs-data-view-column-settings-btn:not(:hover) ngs-icon{color:var(--ngs-color-neutral-500)}:host .grid-header .header-cell:hover .ngs-data-view-column-settings-btn{visibility:visible;opacity:1;pointer-events:auto}:host .grid-header .header-cell:focus-within .ngs-data-view-column-settings-btn{visibility:visible;opacity:1;pointer-events:auto}:host .grid-header .header-cell .ngs-data-view-column-settings-btn.is-menu-open{visibility:visible;opacity:1;pointer-events:auto}:host ngs-form-field.view-selector{--ngs-form-field-width: calc(var(--spacing, .25rem) * 52)}:host ::ng-deep .header-cell,:host ::ng-deep .cell{box-sizing:border-box;padding:var(--ngs-data-view-cell-padding);border-right:1px solid transparent;overflow:hidden;min-width:40px}:host ::ng-deep .header-cell.cell-selection,:host ::ng-deep .cell.cell-selection{padding:0 calc(var(--spacing, .25rem) * 2);width:var(--ngs-data-view-selection-column-width);min-width:var(--ngs-data-view-selection-column-width)}:host ::ng-deep .header-cell{background-color:var(--ngs-data-view-header-bg)}:host ::ng-deep .cell{background-color:transparent}:host ::ng-deep .ngs-header-cell,:host ::ng-deep .ngs-cell{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host .grid-header{-webkit-user-select:text;user-select:text;background-color:var(--ngs-data-view-header-bg);color:var(--ngs-color-on-background);font-size:.875rem;position:sticky;top:0;z-index:20;border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-header .header-cell{height:var(--ngs-data-view-header-height);position:relative}:host .grid-header .header-cell .col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;z-index:10;border-right:1px solid var(--ngs-color-border);transition:border-color .2s}:host .grid-header .header-cell .col-resize-handle:hover{border-right-color:var(--ngs-color-primary)}:host .grid-header .grid-header-left{box-sizing:border-box;position:relative}:host .grid-header .grid-header-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-header .grid-header-right{box-sizing:border-box;position:relative}:host .grid-header .grid-header-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body{font-size:.875rem;overflow:hidden;flex:1 1 auto;min-height:100px}:host .grid-body .grid-body-left,:host .grid-body .grid-body-center,:host .grid-body .grid-body-right{background-color:var(--ngs-data-view-body-bg, var(--ngs-color-background))}:host .grid-body .grid-row{background-color:var(--ngs-data-view-row-bg);box-sizing:border-box;color:var(--ngs-color-on-background);border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-body .grid-row.is-last{border-bottom:none}:host .grid-body .grid-row.is-selected{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected{background-color:color-mix(in srgb,var(--ngs-color-primary) 10%,transparent)}}:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:color-mix(in srgb,var(--ngs-color-primary) 20%,transparent)}}:host .grid-body .grid-row:hover,:host .grid-body .grid-row.is-hovered{background-color:var(--ngs-data-view-row-hover-bg)}:host .grid-body .grid-body-left,:host .grid-body .grid-body-right{scrollbar-width:none}:host .grid-body .grid-body-left::-webkit-scrollbar,:host .grid-body .grid-body-right::-webkit-scrollbar{display:none}:host .grid-body .grid-body-left.grid-body-left,:host .grid-body .grid-body-right.grid-body-left{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-left:after,:host .grid-body .grid-body-right.grid-body-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.grid-body-right,:host .grid-body .grid-body-right.grid-body-right{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-right:after,:host .grid-body .grid-body-right.grid-body-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.pinned-viewport,:host .grid-body .grid-body-right.pinned-viewport{overflow:hidden;position:sticky;top:0;z-index:10;contain:layout paint}:host .grid-body .grid-body-left .pinned-canvas,:host .grid-body .grid-body-right .pinned-canvas{will-change:transform;height:100%;width:100%;contain:layout paint}:host .grid-body .grid-body-left .pinned-content,:host .grid-body .grid-body-right .pinned-content{position:relative}:host .grid-body .grid-body-center{contain:layout paint}:host .grid-body .grid-body-center .rows-container{position:sticky;top:0;left:0;will-change:transform;width:100%;z-index:1}:host .grid-header-center{scrollbar-width:none}:host .grid-header-center::-webkit-scrollbar{display:none}:host .grid-header-center{contain:layout paint}:host .grid-header-center .header-inner{will-change:transform;contain:layout paint}:host:not(.has-horizontal-scroll) .grid-header-left:after,:host:not(.has-horizontal-scroll) .grid-body-left:after,:host:not(.has-horizontal-scroll) .grid-header-right:after,:host:not(.has-horizontal-scroll) .grid-body-right:after{display:none}:host ngs-paginator{padding:calc(var(--spacing, .25rem) * 2.5) 0;border-top:1px solid var(--ngs-data-view-border-color)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Checkbox, selector: "ngs-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["checkedChange", "disabledChange", "change", "indeterminateChange"], exportAs: ["ngsCheckbox"] }, { kind: "component", type: SortHeader, selector: "[ngs-sort-header]", inputs: ["ngs-sort-header", "sortActionDescription", "disabled"], exportAs: ["ngsSortHeader"] }, { kind: "directive", type: SortDirective, selector: "[ngsSort]", inputs: ["ngsSortActive", "ngsSortStart", "ngsSortDirection", "ngsSortDisableClear", "ngsSortDisabled"], outputs: ["ngsSortActiveChange", "ngsSortDirectionChange", "ngsSortChange"], exportAs: ["ngsSort"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Paginator, selector: "ngs-paginator", inputs: ["pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "disabled"], outputs: ["page"], exportAs: ["ngsPaginator"] }, { kind: "component", type: ScrollbarArea, selector: "ngs-scrollbar-area", inputs: ["scrollbarWidth", "autoHide", "absolute"], outputs: ["scrolled"], exportAs: ["ngsScrollbarArea"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: EmptyState, selector: "ngs-empty-state", exportAs: ["ngsEmptyState"] }, { kind: "component", type: EmptyStateIcon, selector: "ngs-empty-state-icon", exportAs: ["ngsEmptyStateIcon"] }, { kind: "component", type: EmptyStateContent, selector: "ngs-empty-state-content", exportAs: ["ngsEmptyStateContent"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Alert, selector: "ngs-alert", inputs: ["autoClose", "bordered", "variant"], outputs: ["closed"], exportAs: ["ngsAlert"] }, { kind: "component", type: Chip, selector: "ngs-chip", inputs: ["appearance", "disabled", "value"], outputs: ["destroyed", "removed"], exportAs: ["ngsChip"] }, { kind: "component", type: ChipSet, selector: "ngs-chip-set", exportAs: ["ngsChipSet"] }, { kind: "directive", type: ChipRemove, selector: "ngs-chip-remove, [ngsChipRemove]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Select, selector: "ngs-select", inputs: ["id", "placeholder", "disabled", "required", "multiple", "hideCheckIcon", "clearable", "dataSource", "pageSize", "searchable", "searchDebounce", "minSearchLength", "loadOnOpen", "aria-label", "tabIndex", "aria-describedby", "value"], outputs: ["selectionChange", "opened", "closed", "valueChange"], exportAs: ["ngsSelect"] }, { kind: "component", type: Option, selector: "ngs-option", inputs: ["id", "value", "data", "disabled", "selected"], outputs: ["onSelectionChange"], exportAs: ["ngsOption"] }, { kind: "component", type: Toolbar, selector: "ngs-toolbar", exportAs: ["ngsToolbar"] }, { kind: "component", type: ToolbarItem, selector: "ngs-toolbar-item", inputs: ["hidden"], outputs: ["hiddenChange"] }, { kind: "component", type: ToolbarSpacer, selector: "ngs-toolbar-spacer" }, { kind: "component", type: BlockLoader, selector: "ngs-block-loader", inputs: ["loading", "spinnerDiameter", "spinnerStrokeWidth"], exportAs: ["ngsBlockLoader"] }, { kind: "directive", type: BlockLoaderContainerDirective, selector: "[ngsBlockLoaderContainer]" }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Menu, selector: "ngs-menu", inputs: ["themeSource", "role", "classList", "xPosition", "yPosition", "pushIntoViewport"], outputs: ["closed"], exportAs: ["ngsMenu"] }, { kind: "component", type: MenuItem, selector: "ngs-menu-item, [ngs-menu-item]", inputs: ["disabled", "role", "selected"], outputs: ["_triggered"], exportAs: ["ngsMenuItem"] }, { kind: "directive", type: MenuTrigger, selector: "[ngsMenuTriggerFor]", inputs: ["ngsMenuTriggerFor", "ngsMenuTriggerData", "ngsMenuDisabled", "xPosition", "yPosition", "ngsMenuTriggerRestoreFocus"], outputs: ["menuOpened", "menuClosed"], exportAs: ["ngsMenuTrigger"] }, { kind: "component", type: MenuDivider, selector: "ngs-menu-divider" }, { kind: "directive", type: MenuContent, selector: "[ngsMenuContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1539
2457
|
}
|
|
1540
2458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DataView, decorators: [{
|
|
1541
2459
|
type: Component,
|
|
@@ -1552,6 +2470,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
1552
2470
|
EmptyStateIcon,
|
|
1553
2471
|
EmptyStateContent,
|
|
1554
2472
|
Icon,
|
|
2473
|
+
Alert,
|
|
2474
|
+
Chip, ChipSet, ChipRemove,
|
|
2475
|
+
FormsModule, FormField, Select, Option, Toolbar, ToolbarItem, ToolbarSpacer,
|
|
1555
2476
|
BlockLoader,
|
|
1556
2477
|
BlockLoaderContainerDirective,
|
|
1557
2478
|
Button,
|
|
@@ -1570,7 +2491,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
1570
2491
|
'[class.highlight-header]': 'highlightHeader()',
|
|
1571
2492
|
'[class.pinned-header]': 'stickyHeader()',
|
|
1572
2493
|
'[class.hover-rows]': 'hoverRows()',
|
|
1573
|
-
'[class.is-loading]': '
|
|
2494
|
+
'[class.is-loading]': 'blockingLoading()',
|
|
1574
2495
|
'[class.embedded]': 'embedded()',
|
|
1575
2496
|
'[class.has-horizontal-scroll]': 'hasHorizontalScroll()',
|
|
1576
2497
|
'[class.is-browser]': 'isBrowser()',
|
|
@@ -1578,8 +2499,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
1578
2499
|
'[style.--ngs-data-view-header-height.px]': 'headerHeight()',
|
|
1579
2500
|
'[style.--ngs-data-view-selection-column-width.px]': 'selectionWidth()',
|
|
1580
2501
|
'[class.is-auto-height]': 'autoHeight()',
|
|
1581
|
-
}, template: "<div class=\"flex flex-col h-full overflow-hidden relative\"\n ngsBlockLoaderContainer>\n <ngs-block-loader [loading]=\"_isLoading()\"/>\n @if (shouldRenderGrid()) {\n @if (!noFilteredResults) {\n <div class=\"grid-root flex flex-col grow overflow-hidden relative\">\n @if (isResizing()) {\n <div class=\"ngs-data-view-resize-line\" [style.left.px]=\"resizeLineLeft()\"></div>\n }\n\n <!-- GRID HEADER -->\n <div class=\"grid-header pinned top-0 z-20 flex overflow-hidden shrink-0 font-medium\"\n ngsSort\n [style.height.px]=\"headerHeight()\"\n [ngsSortDisabled]=\"!isSortingEnabled() || _isLoading() || _isFiltering()\"\n (ngsSortChange)=\"onSortChange($event)\">\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div class=\"grid-header-left shrink-0 flex z-30\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"leftPinnedWidth()\">\n @if (withSelection()) {\n <div class=\"header-cell cell-selection flex items-center justify-center shrink-0\">\n @if (rowSelection() === 'multiple') {\n <ngs-checkbox (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\" />\n }\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\">{{ col.name }}</span>\n </div>\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div #headerCenter class=\"grid-header-center grow flex overflow-hidden\">\n <div #headerCenterInner class=\"flex header-inner\" [style.width.px]=\"centerWidth()\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\">{{ col.name }}</span>\n </div>\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div class=\"grid-header-right shrink-0 flex z-30\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"rightPinnedWidth()\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\">{{ col.name }}</span>\n </div>\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"header-cell flex items-center shrink-0\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n \n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <div class=\"grid-body grow flex relative\">\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div #bodyLeft class=\"grid-body-left pinned-viewport shrink-0 overflow-hidden z-10 pinned left-0\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div #bodyLeftCanvas class=\"pinned-canvas\">\n <div #bodyLeftContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.index) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"selection.isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @if (withSelection()) {\n <div class=\"cell cell-selection flex items-center justify-center shrink-0\">\n <ngs-checkbox (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? rowSelectionToggle($event, row.item) : null\"\n [checked]=\"selection.isSelected(row.item)\" />\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col }\"></ng-container>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n\n <div #bodyCenter class=\"grid-body-center grow overflow-hidden relative\">\n <ngs-scrollbar-area>\n <div #bodyCenterContent class=\"rows-container\">\n @for (row of visibleRows(); track row.index) {\n <div class=\"grid-row flex absolute left-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [style.width.px]=\"centerWidth()\"\n [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"selection.isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col }\"/>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"virtual-spacer relative\" [style.height.px]=\"totalHeight()\" [style.width.px]=\"centerWidth()\"></div>\n </ngs-scrollbar-area>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div #bodyRight class=\"grid-body-right pinned-viewport shrink-0 overflow-hidden z-10 pinned right-0\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div #bodyRightCanvas class=\"pinned-canvas\">\n <div #bodyRightContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.index) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"selection.isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col }\"></ng-container>\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"cell flex items-center shrink-0\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n <ng-container [ngTemplateOutlet]=\"actionBarTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row.item }\"/>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (withPagination() && !paginator()) {\n <ngs-paginator [pageSizeOptions]=\"pageSizeOptions()\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [pageSize]=\"pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [length]=\"effectivePaginatorLength()\"\n [disabled]=\"_isLoading() || _isFiltering()\"\n (page)=\"onPageChange($event)\"/>\n }\n </div>\n } @else {\n @if (isNoResults) {\n @if (emptyFilterResultsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyFilterResultsTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyFilterResultsIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ interpolatedEmptyFilterResultsText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n } @else {\n @if (emptyTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ emptyText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n }\n }\n }\n</div>\n\n<ng-template #cellContent let-row=\"row\" let-col=\"col\">\n <div class=\"overflow-hidden w-full\">\n @if (col.cellRenderer && hasCellRenderer(col.cellRenderer)) {\n <ng-container [ngComponentOutlet]=\"getCellRenderer(col.cellRenderer)\"\n [ngComponentOutletInputs]=\"{ element: row, columnDef: col, fieldData: getNestedValue(row, col.field) }\"\n [ngComponentOutletInjector]=\"injector\"/>\n } @else {\n {{ getNestedValue(row, col.field) }}\n }\n </div>\n</ng-template>\n\n<ngs-menu #columnMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n @if (col.sortable) {\n <button ngs-menu-item (click)=\"sortColumn(col, 'asc')\">\n <ngs-icon name=\"fluent:arrow-sort-up-24-regular\" size=\"20\"/>\n Sort Ascending\n </button>\n <button ngs-menu-item (click)=\"sortColumn(col, 'desc')\">\n <ngs-icon name=\"fluent:arrow-sort-down-24-regular\" size=\"20\"/>\n Sort Descending\n </button>\n <ngs-menu-divider/>\n }\n <button ngs-menu-item [ngsMenuTriggerFor]=\"pinMenu\" [ngsMenuTriggerData]=\"{ col: col }\">\n <ngs-icon name=\"fluent:pin-24-regular\" size=\"20\"/>\n Pin Column\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"autosizeColumn(col)\">\n Autosize This Column\n </button>\n <button ngs-menu-item (click)=\"autosizeAllColumns()\">\n Autosize All Columns\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"openColumnSettingsDialog()\">\n Choose Columns\n </button>\n <button ngs-menu-item (click)=\"resetColumns()\">\n Reset Columns\n </button>\n </ng-template>\n</ngs-menu>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(col, null)\">\n No Pin\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'start'\"\n (click)=\"pinColumn(col, 'start')\">\n Pin Left\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'end'\"\n (click)=\"pinColumn(col, 'end')\">\n Pin Right\n </button>\n </ng-template>\n</ngs-menu>\n", styles: [":host{--ngs-data-view-header-height: 48px;--ngs-data-view-selection-column-width: 48px;--ngs-data-view-header-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-body-bg: var(--ngs-color-background);--ngs-data-view-row-bg: var(--ngs-color-background);--ngs-data-view-row-hover-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-hl-header-row-bg: var(--ngs-color-surface-container);--ngs-data-view-border-color: var(--ngs-color-border);--ngs-data-view-bg: transparent;--ngs-data-view-min-height: 300px;--ngs-table-row-item-outline-width: 0;--ngs-table-background: var(--ngs-data-view-bg);--ngs-table-header-cell-background: var(--ngs-data-view-header-bg);--ngs-data-view-radius: var(--ngs-radius-xl);--ngs-data-view-root-border: 1px solid var(--ngs-data-view-border-color);--ngs-data-view-cell-padding: 0 calc(var(--spacing, .25rem) * 4)}:host.allow-row-click-selection .grid-row{cursor:pointer}:host .ngs-data-view-resize-line{position:absolute;top:0;bottom:0;width:1px;background-color:var(--ngs-color-primary);z-index:1000;pointer-events:none;margin-left:-1px;transform:translate(0);will-change:transform}:host.embedded{--ngs-data-view-radius: 0;--ngs-data-view-root-border: none}:host.highlight-header{--ngs-data-view-header-bg: var(--ngs-data-view-hl-header-row-bg)}:host{display:flex;flex-direction:column;min-height:var(--ngs-data-view-min-height)}:host:not(.is-auto-height){height:var(--ngs-data-view-min-height)}:host>div:first-child{flex:1 1 auto}:host.is-loading{pointer-events:none;-webkit-user-select:none;user-select:none}:host .grid-root{background-color:var(--ngs-data-view-body-bg);border:var(--ngs-data-view-root-border);border-radius:var(--ngs-data-view-radius);min-height:inherit;flex:1 1 auto}:host .grid-header,:host .grid-body,:host ngs-paginator{transition:opacity .3s ease-in-out;opacity:1}:host .grid-header-center,:host .grid-body-center{flex:1 1 0;min-width:0}:host .grid-header .header-cell .ngs-data-view-column-settings-btn{z-index:10;margin-inline-end:calc(calc(var(--spacing, .25rem) * 2.5) * -1);display:none;transition:opacity .2s,color .2s}:host .grid-header .header-cell .ngs-data-view-column-settings-btn:not(:hover) ngs-icon{color:var(--ngs-color-neutral-500)}:host .grid-header .header-cell:hover .ngs-data-view-column-settings-btn{display:inline-flex}:host .grid-header .header-cell .ngs-data-view-column-settings-btn.is-menu-open{display:inline-flex}:host ::ng-deep .header-cell,:host ::ng-deep .cell{box-sizing:border-box;padding:var(--ngs-data-view-cell-padding);border-right:1px solid transparent;overflow:hidden;min-width:40px}:host ::ng-deep .header-cell.cell-selection,:host ::ng-deep .cell.cell-selection{padding:0 calc(var(--spacing, .25rem) * 2);width:var(--ngs-data-view-selection-column-width);min-width:var(--ngs-data-view-selection-column-width)}:host ::ng-deep .header-cell{background-color:var(--ngs-data-view-header-bg)}:host ::ng-deep .cell{background-color:transparent}:host ::ng-deep .ngs-header-cell,:host ::ng-deep .ngs-cell{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host .grid-header{-webkit-user-select:text;user-select:text;background-color:var(--ngs-data-view-header-bg);color:var(--ngs-color-on-background);font-size:.875rem;position:sticky;top:0;z-index:20;border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-header .header-cell{height:var(--ngs-data-view-header-height);position:relative}:host .grid-header .header-cell .col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;z-index:10;border-right:1px solid var(--ngs-color-border);transition:border-color .2s}:host .grid-header .header-cell .col-resize-handle:hover{border-right-color:var(--ngs-color-primary)}:host .grid-header .grid-header-left{box-sizing:border-box;position:relative}:host .grid-header .grid-header-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-header .grid-header-right{box-sizing:border-box;position:relative}:host .grid-header .grid-header-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body{font-size:.875rem;overflow:hidden;flex:1 1 auto;min-height:100px}:host .grid-body .grid-body-left,:host .grid-body .grid-body-center,:host .grid-body .grid-body-right{background-color:var(--ngs-data-view-body-bg, var(--ngs-color-background))}:host .grid-body .grid-row{background-color:var(--ngs-data-view-row-bg);box-sizing:border-box;color:var(--ngs-color-on-background);border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-body .grid-row.is-last{border-bottom:none}:host .grid-body .grid-row.is-selected{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected{background-color:color-mix(in srgb,var(--ngs-color-primary) 10%,transparent)}}:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:color-mix(in srgb,var(--ngs-color-primary) 20%,transparent)}}:host .grid-body .grid-row:hover,:host .grid-body .grid-row.is-hovered{background-color:var(--ngs-data-view-row-hover-bg)}:host .grid-body .grid-body-left,:host .grid-body .grid-body-right{scrollbar-width:none}:host .grid-body .grid-body-left::-webkit-scrollbar,:host .grid-body .grid-body-right::-webkit-scrollbar{display:none}:host .grid-body .grid-body-left.grid-body-left,:host .grid-body .grid-body-right.grid-body-left{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-left:after,:host .grid-body .grid-body-right.grid-body-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.grid-body-right,:host .grid-body .grid-body-right.grid-body-right{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-right:after,:host .grid-body .grid-body-right.grid-body-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.pinned-viewport,:host .grid-body .grid-body-right.pinned-viewport{overflow:hidden;position:sticky;top:0;z-index:10;contain:layout paint}:host .grid-body .grid-body-left .pinned-canvas,:host .grid-body .grid-body-right .pinned-canvas{will-change:transform;height:100%;width:100%;contain:layout paint}:host .grid-body .grid-body-left .pinned-content,:host .grid-body .grid-body-right .pinned-content{position:relative}:host .grid-body .grid-body-center{contain:layout paint}:host .grid-body .grid-body-center .rows-container{position:sticky;top:0;left:0;will-change:transform;width:100%;z-index:1}:host .grid-header-center{scrollbar-width:none}:host .grid-header-center::-webkit-scrollbar{display:none}:host .grid-header-center{contain:layout paint}:host .grid-header-center .header-inner{will-change:transform;contain:layout paint}:host:not(.has-horizontal-scroll) .grid-header-left:after,:host:not(.has-horizontal-scroll) .grid-body-left:after,:host:not(.has-horizontal-scroll) .grid-header-right:after,:host:not(.has-horizontal-scroll) .grid-body-right:after{display:none}:host ngs-paginator{padding:calc(var(--spacing, .25rem) * 2.5) 0;border-top:1px solid var(--ngs-data-view-border-color)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1582
|
-
}], ctorParameters: () => [], propDecorators: { _emptyDataRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewEmptyDataDirective), { isSignal: true }] }], _emptyFilterResults: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewEmptyFilterResultsDirective), { isSignal: true }] }], _actionBarRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewActionBarDirective), { isSignal: true }] }], _actionBarComp: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewActionBarDirective), { ...{ read: DataViewActionBar }, isSignal: true }] }], _table: [{ type: i0.ViewChild, args: ['table', { isSignal: true }] }], _ngsSort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SortDirective), { isSignal: true }] }], _internalPaginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Paginator), { isSignal: true }] }], paginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginator", required: false }] }], _headerCenter: [{ type: i0.ViewChild, args: ['headerCenter', { ...{ read: (ElementRef) }, isSignal: true }] }], _headerCenterInner: [{ type: i0.ViewChild, args: ['headerCenterInner', { ...{ read: (ElementRef) }, isSignal: true }] }], _bodyLeftContent: [{ type: i0.ViewChild, args: ['bodyLeftContent', { ...{ read: (ElementRef) }, isSignal: true }] }], _scrollbarArea: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ScrollbarArea), { isSignal: true }] }], _bodyCenterContent: [{ type: i0.ViewChild, args: ['bodyCenterContent', { ...{ read: (ElementRef) }, isSignal: true }] }], _bodyRightContent: [{ type: i0.ViewChild, args: ['bodyRightContent', { ...{ read: (ElementRef) }, isSignal: true }] }], columnDefs: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnDefs", required: false }] }], defaultColDef: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultColDef", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], datasource: [{ type: i0.Input, args: [{ isSignal: true, alias: "datasource", required: false }] }], rowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHeight", required: false }] }], headerHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerHeight", required: false }] }], bufferRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "bufferRows", required: false }] }], withSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "withSelection", required: false }] }], highlightHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightHeader", required: false }] }], rowModelType: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowModelType", required: false }] }], autoHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHeight", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], withPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "withPagination", required: false }] }], bodyScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "bodyScroll", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showFirstLastButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLastButtons", required: false }] }], paginatorAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorAriaLabel", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], pageIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageIndex", required: false }] }, { type: i0.Output, args: ["pageIndexChange"] }], snapshot: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapshot", required: false }] }], withColumnSettings: [{ type: i0.Input, args: [{ isSignal: true, alias: "withColumnSettings", required: false }] }], embedded: [{ type: i0.Input, args: [{ isSignal: true, alias: "embedded", required: false }] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }], allowSingleRowSelectionByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowSingleRowSelectionByClick", required: false }] }], selectionWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionWidth", required: false }] }], minColumnWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minColumnWidth", required: false }] }], cellRenderers: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellRenderers", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], hoverRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverRows", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], emptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyIcon", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], emptyFilterResultsIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterResultsIcon", required: false }] }], emptyFilterResultsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterResultsText", required: false }] }], rowSelectionChanged: [{ type: i0.Output, args: ["rowSelectionChanged"] }], selectionChanged: [{ type: i0.Output, args: ["selectionChanged"] }], allRowsSelectionChanged: [{ type: i0.Output, args: ["allRowsSelectionChanged"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], loadEnd: [{ type: i0.Output, args: ["loadEnd"] }], refreshEnd: [{ type: i0.Output, args: ["refreshEnd"] }] } });
|
|
2502
|
+
}, template: "<div class=\"flex flex-col h-full overflow-hidden relative\"\n ngsBlockLoaderContainer>\n @if (withSavedViews()) {\n <ngs-toolbar class=\"shrink-0\" aria-label=\"Table views\">\n <ngs-toolbar-item>\n <ngs-form-field class=\"view-selector\" aria-label=\"Saved view\">\n <ngs-select placeholder=\"Default view\" aria-label=\"Saved view\" [ngModel]=\"activeViewId()\" (ngModelChange)=\"applyView($event)\">\n <ngs-option [value]=\"null\">Default view</ngs-option>\n @for (view of savedViews(); track view.id) { <ngs-option [value]=\"view.id\">{{ view.name }}</ngs-option> }\n </ngs-select>\n </ngs-form-field>\n </ngs-toolbar-item>\n @if (dirtyView()) { <ngs-toolbar-item><span class=\"text-sm text-on-surface-variant\" role=\"status\">Unsaved changes</span></ngs-toolbar-item> }\n <ngs-toolbar-spacer/>\n <ngs-toolbar-item><button ngsButton type=\"button\" [ngsMenuTriggerFor]=\"viewsMenu\">View actions</button></ngs-toolbar-item>\n </ngs-toolbar>\n @if (viewStorageError()) { <ngs-alert variant=\"negative\" role=\"alert\">{{ viewStorageError() }}</ngs-alert> }\n }\n <ngs-block-loader [loading]=\"blockingLoading()\"/>\n @if (error()) {\n <ngs-alert variant=\"negative\" class=\"mb-3\" role=\"alert\">\n {{ error() }}\n <button ngsButton type=\"button\" (click)=\"refresh()\">Retry</button>\n </ngs-alert>\n }\n @if (refreshing()) { <div class=\"px-4 py-2 text-sm text-on-surface-variant\" role=\"status\" aria-live=\"polite\">Updating records\u2026</div> }\n @if (activeFilters().length || search().trim()) {\n <div class=\"flex items-center gap-2 flex-wrap px-3 py-2 shrink-0\" aria-label=\"Active filters\">\n <ngs-chip-set>\n @if (search().trim()) {\n <ngs-chip (removed)=\"search.set('')\">Search: {{ search() }}<button ngsChipRemove type=\"button\" aria-label=\"Remove search filter\"><ngs-icon name=\"fluent:dismiss-16-regular\"/></button></ngs-chip>\n }\n @for (filter of activeFilters(); track filter.field) {\n <ngs-chip (removed)=\"setColumnFilter(filter.field, null)\">{{ filter.label }}<button ngsChipRemove type=\"button\" [attr.aria-label]=\"'Remove filter ' + filter.label\"><ngs-icon name=\"fluent:dismiss-16-regular\"/></button></ngs-chip>\n }\n </ngs-chip-set>\n <button ngsButton type=\"button\" (click)=\"clearFilters()\">Clear all</button>\n </div>\n }\n @if (shouldRenderGrid()) {\n <div class=\"grid-root flex flex-col grow overflow-hidden relative\" role=\"grid\" tabindex=\"0\"\n [attr.aria-label]=\"ariaLabel()\" [attr.aria-rowcount]=\"ariaRowCount()\" [attr.aria-colcount]=\"logicalColumns().length\"\n [attr.aria-busy]=\"_isLoading()\" [attr.aria-multiselectable]=\"withSelection() && rowSelection() === 'multiple'\"\n [attr.aria-activedescendant]=\"activeCellId()\" [attr.aria-describedby]=\"noFilteredResults ? gridId + '-empty' : null\" (keydown)=\"onGridKeydown($event)\">\n @if (isResizing()) {\n <div class=\"ngs-data-view-resize-line\" [style.left.px]=\"resizeLineLeft()\"></div>\n }\n\n <!-- GRID HEADER -->\n <div class=\"grid-header pinned top-0 z-20 flex overflow-hidden shrink-0 font-medium\"\n role=\"row\" aria-rowindex=\"1\" [attr.aria-owns]=\"headerOwnedCells()\"\n ngsSort\n [ngsSortActive]=\"sortState().active\"\n [ngsSortDirection]=\"sortState().direction\"\n [style.height.px]=\"headerHeight()\"\n [ngsSortDisabled]=\"!isSortingEnabled() || blockingLoading()\"\n (ngsSortChange)=\"onSortChange($event)\">\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div class=\"grid-header-left shrink-0 flex z-30\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"leftPinnedWidth()\">\n @if (withSelection()) {\n <div class=\"header-cell cell-selection flex items-center justify-center shrink-0\" role=\"columnheader\"\n [attr.id]=\"headerId('__selection')\" aria-colindex=\"1\" aria-label=\"Row selection\">\n @if (rowSelection() === 'multiple') {\n <ngs-checkbox aria-label=\"Select rows in current selection scope\" (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"hasSelected() && isAllSelected()\"\n [indeterminate]=\"isPartiallySelected()\" />\n }\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [attr.id]=\"headerId(col.field)\" role=\"columnheader\" [attr.aria-labelledby]=\"headerId(col.field) + '-label'\" [attr.aria-colindex]=\"columnIndex(col.field)\"\n [attr.aria-sort]=\"sortState().active === col.field && sortState().direction ? (sortState().direction === 'asc' ? 'ascending' : 'descending') : 'none'\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\" [sortActionDescription]=\"'Sort by ' + col.name\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\" [attr.id]=\"headerId(col.field) + '-label'\">{{ col.name }}</span>\n </div>\n @if (col.filter) {\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Filter ' + col.name\"\n [class.is-filter-active]=\"!!normalizedFilters()[col.field]\" (click)=\"openColumnFilter(col)\">\n <ngs-icon name=\"fluent:filter-20-regular\"/>\n </button>\n }\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\" [attr.aria-label]=\"col.name + ' column actions'\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.name\" [attr.aria-valuenow]=\"columnPixelWidth(col)\"\n [attr.aria-valuemin]=\"columnMinWidth(col)\" [attr.aria-valuemax]=\"columnMaxWidth(col)\"\n (keydown)=\"resizeColumnWithKeyboard($event, col)\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n }\n\n <div #headerCenter class=\"grid-header-center grow flex overflow-hidden\">\n <div #headerCenterInner class=\"flex header-inner\" [style.width.px]=\"centerWidth()\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [attr.id]=\"headerId(col.field)\" role=\"columnheader\" [attr.aria-labelledby]=\"headerId(col.field) + '-label'\" [attr.aria-colindex]=\"columnIndex(col.field)\"\n [attr.aria-sort]=\"sortState().active === col.field && sortState().direction ? (sortState().direction === 'asc' ? 'ascending' : 'descending') : 'none'\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\" [sortActionDescription]=\"'Sort by ' + col.name\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\" [attr.id]=\"headerId(col.field) + '-label'\">{{ col.name }}</span>\n </div>\n @if (col.filter) {\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Filter ' + col.name\"\n [class.is-filter-active]=\"!!normalizedFilters()[col.field]\" (click)=\"openColumnFilter(col)\">\n <ngs-icon name=\"fluent:filter-20-regular\"/>\n </button>\n }\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\" [attr.aria-label]=\"col.name + ' column actions'\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.name\" [attr.aria-valuenow]=\"columnPixelWidth(col)\"\n [attr.aria-valuemin]=\"columnMinWidth(col)\" [attr.aria-valuemax]=\"columnMaxWidth(col)\"\n (keydown)=\"resizeColumnWithKeyboard($event, col)\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n </div>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div class=\"grid-header-right shrink-0 flex z-30\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div class=\"header-inner flex\" [style.width.px]=\"rightPinnedWidth()\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"header-cell flex items-center truncate relative\"\n [attr.id]=\"headerId(col.field)\" role=\"columnheader\" [attr.aria-labelledby]=\"headerId(col.field) + '-label'\" [attr.aria-colindex]=\"columnIndex(col.field)\"\n [attr.aria-sort]=\"sortState().active === col.field && sortState().direction ? (sortState().direction === 'asc' ? 'ascending' : 'descending') : 'none'\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <div class=\"flex items-center grow truncate\"\n [ngs-sort-header]=\"col.field\" [sortActionDescription]=\"'Sort by ' + col.name\"\n [disabled]=\"!col.sortable\">\n <span class=\"truncate\" [attr.id]=\"headerId(col.field) + '-label'\">{{ col.name }}</span>\n </div>\n @if (col.filter) {\n <button ngsIconButton type=\"button\" [attr.aria-label]=\"'Filter ' + col.name\"\n [class.is-filter-active]=\"!!normalizedFilters()[col.field]\" (click)=\"openColumnFilter(col)\">\n <ngs-icon name=\"fluent:filter-20-regular\"/>\n </button>\n }\n @if (col.withColumnSettings !== false && withColumnSettings()) {\n <button ngsIconButton\n #menuTrigger=\"ngsMenuTrigger\"\n [ngsMenuTriggerFor]=\"columnMenu\"\n [ngsMenuTriggerData]=\"{ col: col }\"\n class=\"ngs-data-view-column-settings-btn shrink-0\" [attr.aria-label]=\"col.name + ' column actions'\"\n [class.is-menu-open]=\"menuTrigger.menuOpen()\">\n <ngs-icon name=\"fluent:more-vertical-24-regular\" size=\"20\"/>\n </button>\n }\n @if (col.resizable) {\n <div class=\"col-resize-handle\" role=\"separator\" tabindex=\"0\" aria-orientation=\"vertical\"\n [attr.aria-label]=\"'Resize ' + col.name\" [attr.aria-valuenow]=\"columnPixelWidth(col)\"\n [attr.aria-valuemin]=\"columnMinWidth(col)\" [attr.aria-valuemax]=\"columnMaxWidth(col)\"\n (keydown)=\"resizeColumnWithKeyboard($event, col)\" (mousedown)=\"onColumnResizeStart($event, col)\"></div>\n }\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"header-cell flex items-center shrink-0\" role=\"columnheader\" [attr.id]=\"headerId('__actions')\" [attr.aria-colindex]=\"columnIndex('__actions')\" aria-label=\"Row actions\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n \n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <div class=\"grid-body grow flex relative\">\n @if (noFilteredResults) {\n <div class=\"grow flex items-center justify-center p-6\" role=\"status\" [attr.id]=\"gridId + '-empty'\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"/>\n </div>\n } @else {\n @if (pinnedLeftColumns().length > 0 || withSelection()) {\n <div #bodyLeft class=\"grid-body-left pinned-viewport shrink-0 overflow-hidden z-10 pinned left-0\"\n [ngStyle]=\"leftPinnedWidthStyles()\">\n <div #bodyLeftCanvas class=\"pinned-canvas\">\n <div #bodyLeftContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.key) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n role=\"presentation\" [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @if (withSelection()) {\n <div class=\"cell cell-selection flex items-center justify-center shrink-0\" role=\"gridcell\"\n [attr.id]=\"cellId(row.index, '__selection')\" aria-colindex=\"1\" [class.is-active]=\"isActiveCell(row.index, '__selection')\"\n (click)=\"activateCell($event, row.index, '__selection')\">\n <ngs-checkbox [aria-label]=\"'Select row ' + (globalRowIndex(row.index) + 1)\" (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? rowSelectionToggle($event, row.item) : null\"\n [checked]=\"isSelected(row.item)\" />\n </div>\n }\n @for (col of pinnedLeftColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\" role=\"gridcell\" [attr.id]=\"cellId(row.index, col.field)\"\n [attr.aria-colindex]=\"columnIndex(col.field)\" [attr.aria-labelledby]=\"headerId(col.field) + '-label ' + cellId(row.index, col.field) + '-value'\"\n [attr.data-column-field]=\"col.field\" [class.is-active]=\"isActiveCell(row.index, col.field)\"\n (click)=\"activateCell($event, row.index, col.field)\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col, index: row.index }\"></ng-container>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n\n <div #bodyCenter class=\"grid-body-center grow overflow-hidden relative\">\n <ngs-scrollbar-area>\n <div #bodyCenterContent class=\"rows-container\">\n @for (row of visibleRows(); track row.key) {\n <div class=\"grid-row flex absolute left-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n [style.width.px]=\"centerWidth()\"\n role=\"row\" [attr.aria-rowindex]=\"globalRowIndex(row.index) + 2\" [attr.aria-selected]=\"withSelection() ? isSelected(row.item) : null\"\n [attr.aria-owns]=\"rowOwnedCells(row.index)\" [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of centerColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\" role=\"gridcell\" [attr.id]=\"cellId(row.index, col.field)\"\n [attr.aria-colindex]=\"columnIndex(col.field)\" [attr.aria-labelledby]=\"headerId(col.field) + '-label ' + cellId(row.index, col.field) + '-value'\"\n [attr.data-column-field]=\"col.field\" [class.is-active]=\"isActiveCell(row.index, col.field)\"\n (click)=\"activateCell($event, row.index, col.field)\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col, index: row.index }\"/>\n </div>\n }\n </div>\n }\n </div>\n <div class=\"virtual-spacer relative\" [style.height.px]=\"totalHeight()\" [style.width.px]=\"centerWidth()\"></div>\n </ngs-scrollbar-area>\n </div>\n\n @if (pinnedRightColumns().length > 0 || actionBarTemplateRef) {\n <div #bodyRight class=\"grid-body-right pinned-viewport shrink-0 overflow-hidden z-10 pinned right-0\"\n [ngStyle]=\"rightPinnedWidthStyles()\">\n <div #bodyRightCanvas class=\"pinned-canvas\">\n <div #bodyRightContent class=\"pinned-content relative\" [style.height.px]=\"totalHeight()\">\n @for (row of visibleRows(); track row.key) {\n <div class=\"grid-row flex absolute left-0 right-0 hover:bg-[var(--ngs-data-view-row-hover-bg)]\"\n [style.top.px]=\"row.top\"\n [style.height.px]=\"rowHeight()\"\n role=\"presentation\" [attr.data-row-index]=\"row.index\"\n [class.is-selected]=\"isSelected(row.item)\"\n [class.is-hovered]=\"hoveredRowIndex() === row.index\"\n [class.is-last]=\"row.isLast\"\n (mouseenter)=\"hoveredRowIndex.set(row.index)\"\n (mouseleave)=\"hoveredRowIndex.set(null)\"\n (click)=\"selectRowByClick($event, row.item)\">\n @for (col of pinnedRightColumns(); track col.field) {\n <div class=\"cell flex items-center truncate\" role=\"gridcell\" [attr.id]=\"cellId(row.index, col.field)\"\n [attr.aria-colindex]=\"columnIndex(col.field)\" [attr.aria-labelledby]=\"headerId(col.field) + '-label ' + cellId(row.index, col.field) + '-value'\"\n [attr.data-column-field]=\"col.field\" [class.is-active]=\"isActiveCell(row.index, col.field)\"\n (click)=\"activateCell($event, row.index, col.field)\"\n [class.shrink-0]=\"!col.flex\"\n [style.flex]=\"col.flex\"\n [style.width]=\"col.width\"\n [style.min-width]=\"col.width\"\n [style.max-width]=\"col.width\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { row: row.item, col: col, index: row.index }\"></ng-container>\n </div>\n }\n @if (actionBarTemplateRef) {\n <div class=\"cell flex items-center shrink-0\" role=\"gridcell\" [attr.id]=\"cellId(row.index, '__actions')\"\n [attr.aria-colindex]=\"columnIndex('__actions')\" [class.is-active]=\"isActiveCell(row.index, '__actions')\"\n (click)=\"activateCell($event, row.index, '__actions')\"\n [style.width.px]=\"actionBarWidth()\"\n [style.min-width.px]=\"actionBarWidth()\"\n [style.max-width.px]=\"actionBarWidth()\">\n <ng-container [ngTemplateOutlet]=\"actionBarTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row.item }\"/>\n </div>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n }\n </div>\n\n </div>\n @if (withPagination() && !paginator()) {\n <ngs-paginator [pageSizeOptions]=\"pageSizeOptions()\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [pageSize]=\"pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [length]=\"effectivePaginatorLength()\"\n [disabled]=\"blockingLoading()\"\n (page)=\"onPageChange($event)\"/>\n }\n\n }\n</div>\n\n<ng-template #cellContent let-row=\"row\" let-col=\"col\" let-index=\"index\">\n <div class=\"overflow-hidden w-full\" [attr.id]=\"cellId(index, col.field) + '-value'\">\n @if (col.cellRenderer && hasCellRenderer(col.cellRenderer)) {\n <ng-container [ngComponentOutlet]=\"getCellRenderer(col.cellRenderer)\"\n [ngComponentOutletInputs]=\"{ element: row, columnDef: col, fieldData: getNestedValue(row, col.field) }\"\n [ngComponentOutletInjector]=\"injector\"/>\n } @else {\n {{ getNestedValue(row, col.field) }}\n }\n </div>\n</ng-template>\n\n<ngs-menu #columnMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n @if (col.sortable) {\n <button ngs-menu-item (click)=\"sortColumn(col, 'asc')\">\n <ngs-icon name=\"fluent:arrow-sort-up-24-regular\" size=\"20\"/>\n Sort Ascending\n </button>\n <button ngs-menu-item (click)=\"sortColumn(col, 'desc')\">\n <ngs-icon name=\"fluent:arrow-sort-down-24-regular\" size=\"20\"/>\n Sort Descending\n </button>\n <ngs-menu-divider/>\n }\n <button ngs-menu-item [ngsMenuTriggerFor]=\"pinMenu\" [ngsMenuTriggerData]=\"{ col: col }\">\n <ngs-icon name=\"fluent:pin-24-regular\" size=\"20\"/>\n Pin Column\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"autosizeColumn(col)\">\n Autosize This Column\n </button>\n <button ngs-menu-item (click)=\"autosizeAllColumns()\">\n Autosize All Columns\n </button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"openColumnSettingsDialog()\">\n Choose Columns\n </button>\n <button ngs-menu-item (click)=\"resetColumns()\">\n Reset Columns\n </button>\n </ng-template>\n</ngs-menu>\n\n<ngs-menu #pinMenu=\"ngsMenu\">\n <ng-template ngsMenuContent let-col=\"col\">\n <button ngs-menu-item\n [selected]=\"!col.pinned\"\n (click)=\"pinColumn(col, null)\">\n No Pin\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'start'\"\n (click)=\"pinColumn(col, 'start')\">\n Pin Left\n </button>\n <button ngs-menu-item\n [selected]=\"col.pinned && col.pinAlign === 'end'\"\n (click)=\"pinColumn(col, 'end')\">\n Pin Right\n </button>\n </ng-template>\n</ngs-menu>\n\n<ngs-menu #viewsMenu=\"ngsMenu\">\n <button ngs-menu-item (click)=\"openSavedViewDialog()\">Save current view</button>\n <button ngs-menu-item [disabled]=\"!activeViewId()\" (click)=\"updateCurrentView()\">Update current view</button>\n <button ngs-menu-item [disabled]=\"!activeViewId()\" (click)=\"openSavedViewDialog(true)\">Rename view</button>\n <button ngs-menu-item [disabled]=\"!activeViewId()\" (click)=\"deleteView(activeViewId()!)\">Delete view</button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"applyView(null)\">Reset to default view</button>\n</ngs-menu>\n\n<ng-template #emptyContent>\n @if (isNoResults) {\n @if (emptyFilterResultsTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyFilterResultsTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyFilterResultsIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ interpolatedEmptyFilterResultsText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n } @else {\n @if (emptyTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"emptyTemplateRef\"/>\n } @else {\n <ngs-empty-state>\n <ngs-empty-state-icon>\n <ngs-icon [name]=\"emptyIcon()\"/>\n </ngs-empty-state-icon>\n <ngs-empty-state-content>{{ emptyText() }}</ngs-empty-state-content>\n </ngs-empty-state>\n }\n }\n</ng-template>\n", styles: [":host{--ngs-data-view-header-height: 48px;--ngs-data-view-selection-column-width: 48px;--ngs-data-view-header-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-body-bg: var(--ngs-color-background);--ngs-data-view-row-bg: var(--ngs-color-background);--ngs-data-view-row-hover-bg: var(--ngs-color-surface-container-low, #f8fafc);--ngs-data-view-hl-header-row-bg: var(--ngs-color-surface-container);--ngs-data-view-border-color: var(--ngs-color-border);--ngs-data-view-bg: transparent;--ngs-data-view-min-height: 300px;--ngs-table-row-item-outline-width: 0;--ngs-table-background: var(--ngs-data-view-bg);--ngs-table-header-cell-background: var(--ngs-data-view-header-bg);--ngs-data-view-radius: var(--ngs-radius-xl);--ngs-data-view-root-border: 1px solid var(--ngs-data-view-border-color);--ngs-data-view-cell-padding: 0 calc(var(--spacing, .25rem) * 4)}:host.allow-row-click-selection .grid-row{cursor:pointer}:host .ngs-data-view-resize-line{position:absolute;top:0;bottom:0;width:1px;background-color:var(--ngs-color-primary);z-index:1000;pointer-events:none;margin-left:-1px;transform:translate(0);will-change:transform}:host.embedded{--ngs-data-view-radius: 0;--ngs-data-view-root-border: none}:host.highlight-header{--ngs-data-view-header-bg: var(--ngs-data-view-hl-header-row-bg)}:host{display:flex;flex-direction:column;min-height:var(--ngs-data-view-min-height)}:host:not(.is-auto-height){height:var(--ngs-data-view-min-height)}:host>div:first-child{flex:1 1 auto}:host.is-loading{pointer-events:none;-webkit-user-select:none;user-select:none}:host .grid-root:focus-visible{outline:2px solid var(--ngs-color-primary);outline-offset:-2px}:host .grid-root:focus-within .ngs-data-view-column-settings-btn{visibility:visible;opacity:1;pointer-events:auto}:host .grid-root:focus-within .cell.is-active{outline:2px solid var(--ngs-color-primary);outline-offset:-2px}:host .grid-root{background-color:var(--ngs-data-view-body-bg);border:var(--ngs-data-view-root-border);border-radius:var(--ngs-data-view-radius);min-height:inherit;flex:1 1 auto}:host .grid-header,:host .grid-body,:host ngs-paginator{transition:opacity .3s ease-in-out;opacity:1}:host .grid-header-center,:host .grid-body-center{flex:1 1 0;min-width:0}:host .grid-header .header-cell .ngs-data-view-column-settings-btn{z-index:10;margin-inline-end:calc(calc(var(--spacing, .25rem) * 2.5) * -1);display:inline-flex;visibility:hidden;opacity:0;pointer-events:none;transition:opacity .2s,color .2s}:host .grid-header .header-cell .ngs-data-view-column-settings-btn:not(:hover) ngs-icon{color:var(--ngs-color-neutral-500)}:host .grid-header .header-cell:hover .ngs-data-view-column-settings-btn{visibility:visible;opacity:1;pointer-events:auto}:host .grid-header .header-cell:focus-within .ngs-data-view-column-settings-btn{visibility:visible;opacity:1;pointer-events:auto}:host .grid-header .header-cell .ngs-data-view-column-settings-btn.is-menu-open{visibility:visible;opacity:1;pointer-events:auto}:host ngs-form-field.view-selector{--ngs-form-field-width: calc(var(--spacing, .25rem) * 52)}:host ::ng-deep .header-cell,:host ::ng-deep .cell{box-sizing:border-box;padding:var(--ngs-data-view-cell-padding);border-right:1px solid transparent;overflow:hidden;min-width:40px}:host ::ng-deep .header-cell.cell-selection,:host ::ng-deep .cell.cell-selection{padding:0 calc(var(--spacing, .25rem) * 2);width:var(--ngs-data-view-selection-column-width);min-width:var(--ngs-data-view-selection-column-width)}:host ::ng-deep .header-cell{background-color:var(--ngs-data-view-header-bg)}:host ::ng-deep .cell{background-color:transparent}:host ::ng-deep .ngs-header-cell,:host ::ng-deep .ngs-cell{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host .grid-header{-webkit-user-select:text;user-select:text;background-color:var(--ngs-data-view-header-bg);color:var(--ngs-color-on-background);font-size:.875rem;position:sticky;top:0;z-index:20;border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-header .header-cell{height:var(--ngs-data-view-header-height);position:relative}:host .grid-header .header-cell .col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;z-index:10;border-right:1px solid var(--ngs-color-border);transition:border-color .2s}:host .grid-header .header-cell .col-resize-handle:hover{border-right-color:var(--ngs-color-primary)}:host .grid-header .grid-header-left{box-sizing:border-box;position:relative}:host .grid-header .grid-header-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-header .grid-header-right{box-sizing:border-box;position:relative}:host .grid-header .grid-header-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body{font-size:.875rem;overflow:hidden;flex:1 1 auto;min-height:100px}:host .grid-body .grid-body-left,:host .grid-body .grid-body-center,:host .grid-body .grid-body-right{background-color:var(--ngs-data-view-body-bg, var(--ngs-color-background))}:host .grid-body .grid-row{background-color:var(--ngs-data-view-row-bg);box-sizing:border-box;color:var(--ngs-color-on-background);border-bottom:1px solid var(--ngs-data-view-border-color)}:host .grid-body .grid-row.is-last{border-bottom:none}:host .grid-body .grid-row.is-selected{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected{background-color:color-mix(in srgb,var(--ngs-color-primary) 10%,transparent)}}:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:var(--ngs-color-primary)}@supports (color: color-mix(in lab,red,red)){:host .grid-body .grid-row.is-selected:hover,:host .grid-body .grid-row.is-selected.is-hovered{background-color:color-mix(in srgb,var(--ngs-color-primary) 20%,transparent)}}:host .grid-body .grid-row:hover,:host .grid-body .grid-row.is-hovered{background-color:var(--ngs-data-view-row-hover-bg)}:host .grid-body .grid-body-left,:host .grid-body .grid-body-right{scrollbar-width:none}:host .grid-body .grid-body-left::-webkit-scrollbar,:host .grid-body .grid-body-right::-webkit-scrollbar{display:none}:host .grid-body .grid-body-left.grid-body-left,:host .grid-body .grid-body-right.grid-body-left{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-left:after,:host .grid-body .grid-body-right.grid-body-left:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.grid-body-right,:host .grid-body .grid-body-right.grid-body-right{box-sizing:border-box;position:relative}:host .grid-body .grid-body-left.grid-body-right:after,:host .grid-body .grid-body-right.grid-body-right:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:1px;background-color:var(--ngs-data-view-border-color);z-index:100;pointer-events:none}:host .grid-body .grid-body-left.pinned-viewport,:host .grid-body .grid-body-right.pinned-viewport{overflow:hidden;position:sticky;top:0;z-index:10;contain:layout paint}:host .grid-body .grid-body-left .pinned-canvas,:host .grid-body .grid-body-right .pinned-canvas{will-change:transform;height:100%;width:100%;contain:layout paint}:host .grid-body .grid-body-left .pinned-content,:host .grid-body .grid-body-right .pinned-content{position:relative}:host .grid-body .grid-body-center{contain:layout paint}:host .grid-body .grid-body-center .rows-container{position:sticky;top:0;left:0;will-change:transform;width:100%;z-index:1}:host .grid-header-center{scrollbar-width:none}:host .grid-header-center::-webkit-scrollbar{display:none}:host .grid-header-center{contain:layout paint}:host .grid-header-center .header-inner{will-change:transform;contain:layout paint}:host:not(.has-horizontal-scroll) .grid-header-left:after,:host:not(.has-horizontal-scroll) .grid-body-left:after,:host:not(.has-horizontal-scroll) .grid-header-right:after,:host:not(.has-horizontal-scroll) .grid-body-right:after{display:none}:host ngs-paginator{padding:calc(var(--spacing, .25rem) * 2.5) 0;border-top:1px solid var(--ngs-data-view-border-color)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
2503
|
+
}], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], rowActivated: [{ type: i0.Output, args: ["rowActivated"] }], loadError: [{ type: i0.Output, args: ["loadError"] }], sortState: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortState", required: false }] }, { type: i0.Output, args: ["sortStateChange"] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], withSavedViews: [{ type: i0.Input, args: [{ isSignal: true, alias: "withSavedViews", required: false }] }], savedViews: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedViews", required: false }] }, { type: i0.Output, args: ["savedViewsChange"] }], viewStorageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewStorageKey", required: false }] }], stateChanged: [{ type: i0.Output, args: ["stateChanged"] }], viewApplied: [{ type: i0.Output, args: ["viewApplied"] }], _emptyDataRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewEmptyDataDirective), { isSignal: true }] }], _emptyFilterResults: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewEmptyFilterResultsDirective), { isSignal: true }] }], _actionBarRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewActionBarDirective), { isSignal: true }] }], _actionBarComp: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DataViewActionBarDirective), { ...{ read: DataViewActionBar }, isSignal: true }] }], _table: [{ type: i0.ViewChild, args: ['table', { isSignal: true }] }], _ngsSort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SortDirective), { isSignal: true }] }], _internalPaginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => Paginator), { isSignal: true }] }], paginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginator", required: false }] }], _headerCenter: [{ type: i0.ViewChild, args: ['headerCenter', { ...{ read: (ElementRef) }, isSignal: true }] }], _headerCenterInner: [{ type: i0.ViewChild, args: ['headerCenterInner', { ...{ read: (ElementRef) }, isSignal: true }] }], _bodyLeftContent: [{ type: i0.ViewChild, args: ['bodyLeftContent', { ...{ read: (ElementRef) }, isSignal: true }] }], _scrollbarArea: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ScrollbarArea), { isSignal: true }] }], _bodyCenterContent: [{ type: i0.ViewChild, args: ['bodyCenterContent', { ...{ read: (ElementRef) }, isSignal: true }] }], _bodyRightContent: [{ type: i0.ViewChild, args: ['bodyRightContent', { ...{ read: (ElementRef) }, isSignal: true }] }], columnDefs: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnDefs", required: false }] }], defaultColDef: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultColDef", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], datasource: [{ type: i0.Input, args: [{ isSignal: true, alias: "datasource", required: false }] }], rowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHeight", required: false }] }], headerHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerHeight", required: false }] }], bufferRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "bufferRows", required: false }] }], withSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "withSelection", required: false }] }], highlightHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightHeader", required: false }] }], rowModelType: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowModelType", required: false }] }], autoHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHeight", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], withPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "withPagination", required: false }] }], bodyScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "bodyScroll", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showFirstLastButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLastButtons", required: false }] }], paginatorAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorAriaLabel", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], pageIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageIndex", required: false }] }, { type: i0.Output, args: ["pageIndexChange"] }], snapshot: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapshot", required: false }] }], withColumnSettings: [{ type: i0.Input, args: [{ isSignal: true, alias: "withColumnSettings", required: false }] }], embedded: [{ type: i0.Input, args: [{ isSignal: true, alias: "embedded", required: false }] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }], getRowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "getRowId", required: false }] }], selectionScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionScope", required: false }] }], allowSingleRowSelectionByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowSingleRowSelectionByClick", required: false }] }], selectionWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionWidth", required: false }] }], minColumnWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minColumnWidth", required: false }] }], cellRenderers: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellRenderers", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], hoverRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverRows", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }, { type: i0.Output, args: ["searchChange"] }], emptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyIcon", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], emptyFilterResultsIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterResultsIcon", required: false }] }], emptyFilterResultsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyFilterResultsText", required: false }] }], rowSelectionChanged: [{ type: i0.Output, args: ["rowSelectionChanged"] }], selectionChanged: [{ type: i0.Output, args: ["selectionChanged"] }], selectionStateChanged: [{ type: i0.Output, args: ["selectionStateChanged"] }], allRowsSelectionChanged: [{ type: i0.Output, args: ["allRowsSelectionChanged"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], loadEnd: [{ type: i0.Output, args: ["loadEnd"] }], refreshEnd: [{ type: i0.Output, args: ["refreshEnd"] }] } });
|
|
1583
2504
|
|
|
1584
2505
|
function cellRenderer(cellRenderer, component) {
|
|
1585
2506
|
return {
|
|
@@ -1592,5 +2513,5 @@ function cellRenderer(cellRenderer, component) {
|
|
|
1592
2513
|
* Generated bundle index. Do not edit.
|
|
1593
2514
|
*/
|
|
1594
2515
|
|
|
1595
|
-
export { DATA_VIEW, DATA_VIEW_CONFIG, DataView, DataViewActionBar, DataViewActionBarDirective, DataViewEmptyDataDirective, DataViewEmptyFilterResultsDirective, cellRenderer, provideDataView };
|
|
2516
|
+
export { DATA_VIEW, DATA_VIEW_CONFIG, DataView, DataViewActionBar, DataViewActionBarDirective, DataViewEmptyDataDirective, DataViewEmptyFilterResultsDirective, cellRenderer, dataViewDateKey, dataViewFilterLabel, matchesDataViewFilter, normalizeDataViewFilter, normalizeDataViewFilters, normalizeDataViewSavedViews, normalizeDataViewState, provideDataView };
|
|
1596
2517
|
//# sourceMappingURL=ngstarter-ui-components-data-view.mjs.map
|