@taiga-ui/addon-table 4.52.0-canary.abf3e8c → 4.52.0-canary.ae38a1e
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/components/table/directives/sort-by.directive.d.ts +5 -14
- package/components/table/directives/sortable.directive.d.ts +2 -2
- package/components/table/directives/table.directive.d.ts +8 -26
- package/components/table/index.d.ts +0 -2
- package/components/table/pipes/table-sort.pipe.d.ts +6 -5
- package/components/table/table-expand/table-expand.component.d.ts +1 -1
- package/components/table/table.d.ts +1 -2
- package/components/table/table.options.d.ts +0 -16
- package/components/table/th/th.component.d.ts +2 -2
- package/components/table/tr/tr.component.d.ts +3 -9
- package/components/table-pagination/table-pagination.component.d.ts +5 -8
- package/directives/table-filters/abstract-table-filter.d.ts +2 -1
- package/directives/table-filters/generic-filter.directive.d.ts +2 -3
- package/fesm2022/taiga-ui-addon-table-components-reorder.mjs +7 -6
- package/fesm2022/taiga-ui-addon-table-components-reorder.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-table-components-table-pagination.mjs +13 -21
- package/fesm2022/taiga-ui-addon-table-components-table-pagination.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-table-components-table.mjs +151 -251
- package/fesm2022/taiga-ui-addon-table-components-table.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-table-directives-table-control.mjs +11 -10
- package/fesm2022/taiga-ui-addon-table-directives-table-control.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-table-directives-table-filters.mjs +16 -15
- package/fesm2022/taiga-ui-addon-table-directives-table-filters.mjs.map +1 -1
- package/package.json +1 -1
- package/components/table/directives/direction-order.directive.d.ts +0 -13
- package/components/table/providers/table.provider.d.ts +0 -5
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, ViewEncapsulation, Component, input, inject, TemplateRef, Directive,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { ChangeDetectionStrategy, ViewEncapsulation, Component, input, inject, TemplateRef, Directive, computed, effect, model, output, signal, forwardRef, untracked, contentChildren, Pipe, viewChild, PLATFORM_ID, contentChild } from '@angular/core';
|
|
3
|
+
import { DOCUMENT, NgTemplateOutlet, isPlatformServer } from '@angular/common';
|
|
4
|
+
import { outputFromObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
+
import { EMPTY_CLIENT_RECT } from '@taiga-ui/cdk/constants';
|
|
6
|
+
import { tuiTypedFromEvent, tuiPreventDefault, tuiWatch } from '@taiga-ui/cdk/observables';
|
|
7
|
+
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
8
|
+
import { switchMap, distinctUntilChanged, map, takeUntil, catchError, EMPTY, Subject, timer, of } from 'rxjs';
|
|
9
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
10
|
+
import { tuiWithStyles, tuiDefaultSort } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
11
|
+
import { TuiIcon } from '@taiga-ui/core/components/icon';
|
|
7
12
|
import { IntersectionObserverService, WA_INTERSECTION_THRESHOLD, WA_INTERSECTION_ROOT_MARGIN } from '@ng-web-apis/intersection-observer';
|
|
13
|
+
import { tuiCreateOptions, tuiProvide } from '@taiga-ui/cdk/utils/di';
|
|
8
14
|
import { tuiButtonOptionsProvider } from '@taiga-ui/core/components/button';
|
|
9
15
|
import { TUI_TEXTFIELD_OPTIONS, TuiTextfieldComponent } from '@taiga-ui/core/components/textfield';
|
|
10
16
|
import { tuiBadgeOptionsProvider } from '@taiga-ui/kit/components/badge';
|
|
11
17
|
import { tuiChipOptionsProvider } from '@taiga-ui/kit/components/chip';
|
|
12
18
|
import { tuiProgressOptionsProvider } from '@taiga-ui/kit/components/progress';
|
|
13
|
-
import { tuiWatch, tuiTypedFromEvent, tuiPreventDefault, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
|
|
14
|
-
import { DOCUMENT, AsyncPipe, NgTemplateOutlet, isPlatformServer } from '@angular/common';
|
|
15
|
-
import { EMPTY_CLIENT_RECT } from '@taiga-ui/cdk/constants';
|
|
16
|
-
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
17
|
-
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
18
|
-
import { TuiIcon } from '@taiga-ui/core/components/icon';
|
|
19
|
-
import { __decorate } from 'tslib';
|
|
20
19
|
import * as i1 from '@taiga-ui/kit/directives/present';
|
|
21
20
|
import { TuiPresent } from '@taiga-ui/kit/directives/present';
|
|
22
21
|
import { TuiChevron } from '@taiga-ui/kit/directives/chevron';
|
|
23
22
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
24
|
-
import { ResizeObserverService } from '@ng-web-apis/resize-observer';
|
|
25
23
|
import { TuiControl } from '@taiga-ui/cdk/classes';
|
|
26
24
|
|
|
27
25
|
class TuiTableCaption {
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
26
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableCaption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
27
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TuiTableCaption, isStandalone: true, selector: "caption[tuiCaption]", ngImport: i0, template: '<ng-content/>', isInline: true, styles: ["caption[tuiCaption]{caption-side:bottom;text-align:start;padding:.75rem 0;color:var(--tui-text-secondary)}caption[tuiCaption]>*{vertical-align:middle}caption[tuiCaption]>*:not(:first-child){margin-inline-start:.5rem}caption[tuiCaption] tui-pagination:not(:first-child),caption[tuiCaption] tui-pager:not(:first-child){display:inline-flex;vertical-align:middle}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
30
28
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableCaption, decorators: [{
|
|
32
30
|
type: Component,
|
|
33
|
-
args: [{ selector: 'caption[tuiCaption]', template: '<ng-content/>', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["caption[tuiCaption]{caption-side:bottom;text-align:start;padding:.75rem 0;color:var(--tui-text-secondary)}caption[tuiCaption]>*:not(:first-child){margin-inline-start:.5rem}caption[tuiCaption] tui-pagination:not(:first-child),caption[tuiCaption] tui-pager:not(:first-child){display:inline-flex;vertical-align:middle}\n"] }]
|
|
31
|
+
args: [{ selector: 'caption[tuiCaption]', template: '<ng-content/>', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["caption[tuiCaption]{caption-side:bottom;text-align:start;padding:.75rem 0;color:var(--tui-text-secondary)}caption[tuiCaption]>*{vertical-align:middle}caption[tuiCaption]>*:not(:first-child){margin-inline-start:.5rem}caption[tuiCaption] tui-pagination:not(:first-child),caption[tuiCaption] tui-pager:not(:first-child){display:inline-flex;vertical-align:middle}\n"] }]
|
|
34
32
|
}] });
|
|
35
33
|
|
|
36
34
|
class TuiTableCell {
|
|
@@ -38,16 +36,51 @@ class TuiTableCell {
|
|
|
38
36
|
this.tuiCell = input('');
|
|
39
37
|
this.template = inject((TemplateRef));
|
|
40
38
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
42
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableCell, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
40
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTableCell, isStandalone: true, selector: "ng-template[tuiCell]", inputs: { tuiCell: { classPropertyName: "tuiCell", publicName: "tuiCell", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
43
41
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableCell, decorators: [{
|
|
45
43
|
type: Directive,
|
|
46
44
|
args: [{
|
|
47
45
|
selector: 'ng-template[tuiCell]',
|
|
48
46
|
}]
|
|
49
47
|
}] });
|
|
50
48
|
|
|
49
|
+
class TuiTableHead {
|
|
50
|
+
constructor() {
|
|
51
|
+
this.tuiHead = input.required();
|
|
52
|
+
this.template = inject((TemplateRef));
|
|
53
|
+
}
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableHead, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
55
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTableHead, isStandalone: true, selector: "[tuiHead]", inputs: { tuiHead: { classPropertyName: "tuiHead", publicName: "tuiHead", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableHead, decorators: [{
|
|
58
|
+
type: Directive,
|
|
59
|
+
args: [{
|
|
60
|
+
selector: '[tuiHead]',
|
|
61
|
+
}]
|
|
62
|
+
}] });
|
|
63
|
+
|
|
64
|
+
class TuiTableResized {
|
|
65
|
+
constructor() {
|
|
66
|
+
this.doc = inject(DOCUMENT);
|
|
67
|
+
this.el = tuiInjectElement();
|
|
68
|
+
this.tuiResized$ = tuiTypedFromEvent(this.el, 'mousedown').pipe(tuiPreventDefault(), switchMap(() => {
|
|
69
|
+
const { width, right } = this.el.closest('th')?.getBoundingClientRect() || EMPTY_CLIENT_RECT;
|
|
70
|
+
return tuiTypedFromEvent(this.doc, 'mousemove').pipe(distinctUntilChanged(), map(({ clientX }) => width + clientX - right), takeUntil(tuiTypedFromEvent(this.doc, 'mouseup')));
|
|
71
|
+
}));
|
|
72
|
+
this.tuiResized = outputFromObservable(this.tuiResized$);
|
|
73
|
+
}
|
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableResized, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
75
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiTableResized, isStandalone: true, selector: "[tuiResized]", outputs: { tuiResized: "tuiResized" }, ngImport: i0 }); }
|
|
76
|
+
}
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableResized, decorators: [{
|
|
78
|
+
type: Directive,
|
|
79
|
+
args: [{
|
|
80
|
+
selector: '[tuiResized]',
|
|
81
|
+
}]
|
|
82
|
+
}] });
|
|
83
|
+
|
|
51
84
|
const TuiSortDirection = {
|
|
52
85
|
Asc: 1,
|
|
53
86
|
Desc: -1,
|
|
@@ -72,8 +105,8 @@ class TuiStuck {
|
|
|
72
105
|
constructor() {
|
|
73
106
|
this.stuck = toSignal(inject(IntersectionObserverService).pipe(map((entries) => (entries[entries.length - 1]?.intersectionRatio ?? 0) < 1), distinctUntilChanged(), tuiWatch(), catchError(() => EMPTY)));
|
|
74
107
|
}
|
|
75
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
76
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiStuck, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
109
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiStuck, isStandalone: true, selector: "tui-stuck:never", host: { properties: { "class._stuck": "stuck()" } }, providers: [
|
|
77
110
|
IntersectionObserverService,
|
|
78
111
|
{
|
|
79
112
|
provide: WA_INTERSECTION_THRESHOLD,
|
|
@@ -81,7 +114,7 @@ class TuiStuck {
|
|
|
81
114
|
},
|
|
82
115
|
], ngImport: i0 }); }
|
|
83
116
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiStuck, decorators: [{
|
|
85
118
|
type: Directive,
|
|
86
119
|
args: [{
|
|
87
120
|
selector: 'tui-stuck:never',
|
|
@@ -98,53 +131,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
98
131
|
|
|
99
132
|
const EMPTY_COMPARATOR = () => 0;
|
|
100
133
|
class Styles {
|
|
101
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
102
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
135
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-table" }, ngImport: i0, template: '', isInline: true, styles: ["table[tuiTable]{border-collapse:separate;border-spacing:0;isolation:isolate}table[tuiTable] [tuiCell]{padding:0}table[tuiTable] [tuiTitle]{white-space:nowrap}table[tuiTable] [tuiTitle] tui-icon{font-size:1rem}table[tuiTable] [tuiSubtitle]{color:var(--tui-text-secondary)}table[tuiTable] [tuiTh] [tuiCell],table[tuiTable] [tuiTh] [tuiTitle]{font:inherit;color:inherit}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
103
136
|
}
|
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, decorators: [{
|
|
105
138
|
type: Component,
|
|
106
|
-
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-table' }, styles: ["table[tuiTable]{border-collapse:separate;border-spacing:0}table[tuiTable] [tuiCell]{padding:0}table[tuiTable] [tuiTitle]{white-space:nowrap}table[tuiTable] [tuiTitle] tui-icon{font-size:1rem}table[tuiTable] [tuiSubtitle]{color:var(--tui-text-secondary)}table[tuiTable] [tuiTh] [tuiCell],table[tuiTable] [tuiTh] [tuiTitle]{font:inherit;color:inherit}\n"] }]
|
|
139
|
+
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-table' }, styles: ["table[tuiTable]{border-collapse:separate;border-spacing:0;isolation:isolate}table[tuiTable] [tuiCell]{padding:0}table[tuiTable] [tuiTitle]{white-space:nowrap}table[tuiTable] [tuiTitle] tui-icon{font-size:1rem}table[tuiTable] [tuiSubtitle]{color:var(--tui-text-secondary)}table[tuiTable] [tuiTh] [tuiCell],table[tuiTable] [tuiTh] [tuiTitle]{font:inherit;color:inherit}\n"] }]
|
|
107
140
|
}] });
|
|
108
141
|
class TuiTableDirective {
|
|
109
142
|
constructor() {
|
|
110
143
|
this.options = inject(TUI_TABLE_OPTIONS);
|
|
111
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
112
144
|
this.nothing = tuiWithStyles(Styles);
|
|
145
|
+
this.computedSortChange = computed(() => ({
|
|
146
|
+
sortComparator: this.sorter(),
|
|
147
|
+
sortDirection: this.direction(),
|
|
148
|
+
}));
|
|
149
|
+
this.sortChangeOutput = effect(() => this.sortChange.emit(this.computedSortChange()));
|
|
113
150
|
this.columns = input([]);
|
|
114
|
-
this.direction = input(this.options.direction);
|
|
115
|
-
this.sorter = EMPTY_COMPARATOR;
|
|
116
|
-
/**
|
|
117
|
-
* @deprecated: use sortChange
|
|
118
|
-
*/
|
|
119
|
-
this.directionChange = output();
|
|
120
|
-
/**
|
|
121
|
-
* @deprecated: use sortChange
|
|
122
|
-
*/
|
|
123
|
-
this.directionChange$ = outputToObservable(this.directionChange);
|
|
124
|
-
/**
|
|
125
|
-
* @deprecated: use sortChange
|
|
126
|
-
*/
|
|
127
|
-
this.sorterChange = output();
|
|
128
|
-
this.sorterChange$ = outputToObservable(this.sorterChange);
|
|
129
|
-
this.sortChange$ = combineLatest([
|
|
130
|
-
this.sorterChange$,
|
|
131
|
-
this.directionChange$,
|
|
132
|
-
]).pipe(debounceTime(0), map(([sortComparator, sortDirection]) => ({
|
|
133
|
-
sortBy: sortComparator,
|
|
134
|
-
orderBy: sortDirection,
|
|
135
|
-
sortComparator,
|
|
136
|
-
sortDirection,
|
|
137
|
-
})));
|
|
138
|
-
this.sortChange = outputFromObservable(this.sortChange$);
|
|
139
|
-
this.appearance = signal('table');
|
|
140
151
|
this.size = input(this.options.size);
|
|
152
|
+
this.direction = model(this.options.direction);
|
|
153
|
+
this.sorter = model(EMPTY_COMPARATOR);
|
|
154
|
+
this.sortChange = output();
|
|
155
|
+
this.appearance = signal('table');
|
|
141
156
|
this.cleaner = signal(false);
|
|
142
|
-
// TODO: refactor to signal inputs after Angular update
|
|
143
|
-
this.change$ = new Subject();
|
|
144
157
|
}
|
|
145
158
|
updateSorterAndDirection(sorter) {
|
|
146
|
-
if (this.sorter === sorter) {
|
|
147
|
-
this.updateSorter(this.sorter, this.direction() === TuiSortDirection.Asc
|
|
159
|
+
if (this.sorter() === sorter) {
|
|
160
|
+
this.updateSorter(this.sorter(), this.direction() === TuiSortDirection.Asc
|
|
148
161
|
? TuiSortDirection.Desc
|
|
149
162
|
: TuiSortDirection.Asc);
|
|
150
163
|
}
|
|
@@ -152,21 +165,12 @@ class TuiTableDirective {
|
|
|
152
165
|
this.updateSorter(sorter);
|
|
153
166
|
}
|
|
154
167
|
}
|
|
155
|
-
ngOnChanges() {
|
|
156
|
-
this.change$.next();
|
|
157
|
-
}
|
|
158
|
-
ngAfterViewInit() {
|
|
159
|
-
this.cdr.detectChanges();
|
|
160
|
-
}
|
|
161
168
|
updateSorter(sorter, direction = TuiSortDirection.Asc) {
|
|
162
|
-
this.sorter
|
|
163
|
-
|
|
164
|
-
this.sorterChange.emit(sorter);
|
|
165
|
-
this.directionChange.emit(this.direction());
|
|
166
|
-
this.change$.next();
|
|
169
|
+
this.sorter.set(sorter || EMPTY_COMPARATOR.bind({}));
|
|
170
|
+
this.direction.set(direction);
|
|
167
171
|
}
|
|
168
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
169
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
172
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
173
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTableDirective, isStandalone: true, selector: "table[tuiTable]", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, sorter: { classPropertyName: "sorter", publicName: "sorter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { direction: "directionChange", sorter: "sorterChange", sortChange: "sortChange" }, host: { attributes: { "tuiTable": "" }, properties: { "attr.data-size": "size()" } }, providers: [
|
|
170
174
|
{
|
|
171
175
|
provide: WA_INTERSECTION_ROOT_MARGIN,
|
|
172
176
|
useValue: '10000px 10000px 10000px 0px',
|
|
@@ -176,9 +180,9 @@ class TuiTableDirective {
|
|
|
176
180
|
tuiBadgeOptionsProvider({ size: 'm', appearance: 'neutral' }),
|
|
177
181
|
tuiChipOptionsProvider({ size: 'xxs', appearance: 'neutral' }),
|
|
178
182
|
tuiProgressOptionsProvider({ size: 's', color: 'var(--tui-text-action)' }),
|
|
179
|
-
],
|
|
183
|
+
], hostDirectives: [{ directive: TuiStuck }], ngImport: i0 }); }
|
|
180
184
|
}
|
|
181
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableDirective, decorators: [{
|
|
182
186
|
type: Directive,
|
|
183
187
|
args: [{
|
|
184
188
|
selector: 'table[tuiTable]',
|
|
@@ -199,66 +203,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
199
203
|
'[attr.data-size]': 'size()',
|
|
200
204
|
},
|
|
201
205
|
}]
|
|
202
|
-
}], propDecorators: { sorter: [{
|
|
203
|
-
type: Input
|
|
204
|
-
}] } });
|
|
205
|
-
|
|
206
|
-
class TuiTableDirectionOrder {
|
|
207
|
-
constructor() {
|
|
208
|
-
this.table = inject((TuiTableDirective));
|
|
209
|
-
this.directionOrderChange$ = this.table.directionChange$.pipe(map((dir) => (dir === 1 ? 'asc' : 'desc')));
|
|
210
|
-
/**
|
|
211
|
-
* @deprecated: use tuiSortChange
|
|
212
|
-
*/
|
|
213
|
-
this.directionOrderChange = outputFromObservable(this.directionOrderChange$);
|
|
214
|
-
this.directionOrder = input();
|
|
215
|
-
this.setTableDirection = effect((_, order = this.directionOrder()) => {
|
|
216
|
-
tuiSetSignal(this.table.direction, order === 'asc' ? TuiSortDirection.Asc : TuiSortDirection.Desc);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableDirectionOrder, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
220
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.16", type: TuiTableDirectionOrder, isStandalone: true, selector: "table[tuiTable][tuiDirectionOrder]", inputs: { directionOrder: { classPropertyName: "directionOrder", publicName: "directionOrder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { directionOrderChange: "directionOrderChange" }, ngImport: i0 }); }
|
|
221
|
-
}
|
|
222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableDirectionOrder, decorators: [{
|
|
223
|
-
type: Directive,
|
|
224
|
-
args: [{
|
|
225
|
-
selector: 'table[tuiTable][tuiDirectionOrder]',
|
|
226
|
-
}]
|
|
227
|
-
}] });
|
|
228
|
-
|
|
229
|
-
class TuiTableHead {
|
|
230
|
-
constructor() {
|
|
231
|
-
this.tuiHead = input.required();
|
|
232
|
-
this.template = inject((TemplateRef));
|
|
233
|
-
}
|
|
234
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableHead, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
235
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.16", type: TuiTableHead, isStandalone: true, selector: "[tuiHead]", inputs: { tuiHead: { classPropertyName: "tuiHead", publicName: "tuiHead", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
236
|
-
}
|
|
237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableHead, decorators: [{
|
|
238
|
-
type: Directive,
|
|
239
|
-
args: [{
|
|
240
|
-
selector: '[tuiHead]',
|
|
241
|
-
}]
|
|
242
|
-
}] });
|
|
243
|
-
|
|
244
|
-
class TuiTableResized {
|
|
245
|
-
constructor() {
|
|
246
|
-
this.doc = inject(DOCUMENT);
|
|
247
|
-
this.el = tuiInjectElement();
|
|
248
|
-
this.tuiResized$ = tuiTypedFromEvent(this.el, 'mousedown').pipe(tuiPreventDefault(), switchMap(() => {
|
|
249
|
-
const { width, right } = this.el.closest('th')?.getBoundingClientRect() || EMPTY_CLIENT_RECT;
|
|
250
|
-
return tuiTypedFromEvent(this.doc, 'mousemove').pipe(distinctUntilChanged(), map(({ clientX }) => width + clientX - right), takeUntil(tuiTypedFromEvent(this.doc, 'mouseup')));
|
|
251
|
-
}));
|
|
252
|
-
this.tuiResized = outputFromObservable(this.tuiResized$);
|
|
253
|
-
}
|
|
254
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableResized, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
255
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.16", type: TuiTableResized, isStandalone: true, selector: "[tuiResized]", outputs: { tuiResized: "tuiResized" }, ngImport: i0 }); }
|
|
256
|
-
}
|
|
257
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableResized, decorators: [{
|
|
258
|
-
type: Directive,
|
|
259
|
-
args: [{
|
|
260
|
-
selector: '[tuiResized]',
|
|
261
|
-
}]
|
|
262
206
|
}] });
|
|
263
207
|
|
|
264
208
|
/// <reference types="@taiga-ui/tsconfig/ng-dev-mode" />
|
|
@@ -272,9 +216,7 @@ class TuiTableTh {
|
|
|
272
216
|
this.table = inject(forwardRef(() => TuiTableDirective), { optional: true });
|
|
273
217
|
this.minWidth = input(-Infinity);
|
|
274
218
|
this.maxWidth = input(Infinity);
|
|
275
|
-
this.sorter = this.head
|
|
276
|
-
? (a, b) => tuiDefaultSort(a[this.key], b[this.key])
|
|
277
|
-
: null;
|
|
219
|
+
this.sorter = model(this.head ? (a, b) => tuiDefaultSort(a[this.key], b[this.key]) : null);
|
|
278
220
|
this.resizable = input(this.options.resizable);
|
|
279
221
|
this.sticky = input(this.options.sticky);
|
|
280
222
|
this.requiredSort = input(this.options.requiredSort);
|
|
@@ -286,7 +228,7 @@ class TuiTableTh {
|
|
|
286
228
|
return this.head.tuiHead();
|
|
287
229
|
}
|
|
288
230
|
get isCurrent() {
|
|
289
|
-
return !!this.sorter && !!this.table && this.sorter === this.table.sorter;
|
|
231
|
+
return !!this.sorter && !!this.table && this.sorter() === this.table.sorter();
|
|
290
232
|
}
|
|
291
233
|
get icon() {
|
|
292
234
|
if (this.isCurrent) {
|
|
@@ -297,30 +239,28 @@ class TuiTableTh {
|
|
|
297
239
|
return this.options.sortIcons.off;
|
|
298
240
|
}
|
|
299
241
|
updateSorterAndDirection() {
|
|
300
|
-
const sorter = this.requiredSort() ? this.sorter : null;
|
|
301
|
-
this.table?.updateSorterAndDirection(this.isCurrentAndDescDirection ? sorter : this.sorter);
|
|
242
|
+
const sorter = this.requiredSort() ? this.sorter() : null;
|
|
243
|
+
this.table?.updateSorterAndDirection(this.isCurrentAndDescDirection ? sorter : this.sorter());
|
|
302
244
|
}
|
|
303
245
|
onResized(width) {
|
|
304
246
|
this.width.set(Math.min(Math.max(width, this.minWidth()), this.maxWidth()));
|
|
305
247
|
}
|
|
306
248
|
get isCurrentAndDescDirection() {
|
|
307
|
-
return (this.sorter === this.table?.sorter &&
|
|
249
|
+
return (this.sorter() === this.table?.sorter() &&
|
|
308
250
|
this.table?.direction() === TuiSortDirection.Desc);
|
|
309
251
|
}
|
|
310
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
311
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
252
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTh, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
253
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTableTh, isStandalone: true, selector: "th[tuiTh]", inputs: { minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, sorter: { classPropertyName: "sorter", publicName: "sorter", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, requiredSort: { classPropertyName: "requiredSort", publicName: "requiredSort", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sorter: "sorterChange" }, host: { properties: { "style.min-width.px": "width() || minWidth()", "style.width.px": "width() || minWidth()", "style.max-width.px": "width() || maxWidth()", "class._sticky": "sticky()" } }, ngImport: i0, template: "@if (sorter() && table) {\n <button\n type=\"button\"\n class=\"t-sort\"\n [class.t-sort_sorted]=\"isCurrent\"\n (click)=\"updateSorterAndDirection()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n <tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n />\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"content\" />\n}\n<ng-template #content>\n <ng-content />\n</ng-template>\n@if (resizable()) {\n <div\n class=\"t-bar\"\n (tuiResized)=\"onResized($event)\"\n ></div>\n}\n", styles: [":host{transition-property:box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;top:0;block-size:var(--tui-height-m);font:var(--tui-font-body-s);text-align:start;font-weight:700;color:var(--tui-text-secondary);background:var(--tui-background-base);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-border-normal);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-inline-start:none}:host._sticky,:host-context(._stuck) :host._sticky{position:sticky;z-index:3000}:host._sticky:first-child,:host-context(._stuck) :host._sticky:first-child{left:0}:host._sticky:after,:host-context(._stuck) :host._sticky:after{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:0;left:100%;bottom:0;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host-context(._stuck) :host{z-index:2000}:host-context(tr:not(:first-child)){border-block-start:none}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-body-m);font-weight:700;padding:0 1rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-body-s);font-weight:700;padding:0 .5rem}:host-context(thead[tuiThead]){position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context([tuiTheme=\"dark\"])._sticky:after{background:#3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck):first-child{box-shadow:.0625rem .3125rem #3c3c3ce6}:host-context(table[data-size=\"l\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-l)}:host-context(table[data-size=\"m\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-m)}:host-context(table[data-size=\"s\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-s)}.t-sort{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;display:inline-flex;vertical-align:top;flex-direction:inherit;align-items:center;outline:none;font:inherit;text-transform:inherit;color:inherit;cursor:pointer}.t-sort_sorted{color:var(--tui-text-primary)}.t-sort:focus-visible{background:var(--tui-service-selection-background)}.t-sort:hover{color:var(--tui-text-primary)}.t-bar{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;top:0;bottom:0;right:-1px;inline-size:.1875rem;justify-self:flex-end;border-inline-start:2px solid transparent;background:var(--tui-status-warning);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}.t-icon:before{font-size:1rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiTableResized, selector: "[tuiResized]", outputs: ["tuiResized"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
312
254
|
}
|
|
313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTh, decorators: [{
|
|
314
256
|
type: Component,
|
|
315
|
-
args: [{ selector: 'th[tuiTh]', imports: [
|
|
257
|
+
args: [{ selector: 'th[tuiTh]', imports: [NgTemplateOutlet, TuiIcon, TuiTableResized], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
316
258
|
'[style.min-width.px]': 'width() || minWidth()',
|
|
317
259
|
'[style.width.px]': 'width() || minWidth()',
|
|
318
260
|
'[style.max-width.px]': 'width() || maxWidth()',
|
|
319
261
|
'[class._sticky]': 'sticky()',
|
|
320
|
-
}, template: "@if (sorter && table) {\n <button\n type=\"button\"\n class=\"t-sort\"\n [class.t-sort_sorted]=\"isCurrent\"\n (click)=\"updateSorterAndDirection()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n
|
|
321
|
-
}]
|
|
322
|
-
type: Input
|
|
323
|
-
}] } });
|
|
262
|
+
}, template: "@if (sorter() && table) {\n <button\n type=\"button\"\n class=\"t-sort\"\n [class.t-sort_sorted]=\"isCurrent\"\n (click)=\"updateSorterAndDirection()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n <tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n />\n </button>\n} @else {\n <ng-container [ngTemplateOutlet]=\"content\" />\n}\n<ng-template #content>\n <ng-content />\n</ng-template>\n@if (resizable()) {\n <div\n class=\"t-bar\"\n (tuiResized)=\"onResized($event)\"\n ></div>\n}\n", styles: [":host{transition-property:box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;top:0;block-size:var(--tui-height-m);font:var(--tui-font-body-s);text-align:start;font-weight:700;color:var(--tui-text-secondary);background:var(--tui-background-base);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-border-normal);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-inline-start:none}:host._sticky,:host-context(._stuck) :host._sticky{position:sticky;z-index:3000}:host._sticky:first-child,:host-context(._stuck) :host._sticky:first-child{left:0}:host._sticky:after,:host-context(._stuck) :host._sticky:after{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:0;left:100%;bottom:0;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host-context(._stuck) :host{z-index:2000}:host-context(tr:not(:first-child)){border-block-start:none}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-body-m);font-weight:700;padding:0 1rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-body-s);font-weight:700;padding:0 .5rem}:host-context(thead[tuiThead]){position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context([tuiTheme=\"dark\"])._sticky:after{background:#3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck):first-child{box-shadow:.0625rem .3125rem #3c3c3ce6}:host-context(table[data-size=\"l\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-l)}:host-context(table[data-size=\"m\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-m)}:host-context(table[data-size=\"s\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-s)}.t-sort{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;line-height:inherit;text-decoration:none;display:inline-flex;vertical-align:top;flex-direction:inherit;align-items:center;outline:none;font:inherit;text-transform:inherit;color:inherit;cursor:pointer}.t-sort_sorted{color:var(--tui-text-primary)}.t-sort:focus-visible{background:var(--tui-service-selection-background)}.t-sort:hover{color:var(--tui-text-primary)}.t-bar{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;top:0;bottom:0;right:-1px;inline-size:.1875rem;justify-self:flex-end;border-inline-start:2px solid transparent;background:var(--tui-status-warning);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}.t-icon:before{font-size:1rem}\n"] }]
|
|
263
|
+
}] });
|
|
324
264
|
class TuiTableSortKeyException extends Error {
|
|
325
265
|
constructor() {
|
|
326
266
|
super(ngDevMode ? 'Trying to sort with no key' : '');
|
|
@@ -336,28 +276,28 @@ class TuiTableSortable {
|
|
|
336
276
|
alias: 'tuiSortable',
|
|
337
277
|
transform: coerceBooleanProperty,
|
|
338
278
|
});
|
|
339
|
-
this.
|
|
340
|
-
this.th.sorter
|
|
279
|
+
this.setThSorter = effect(() => {
|
|
280
|
+
this.th.sorter.set(this.sortable() ? this.sorter() : null);
|
|
341
281
|
});
|
|
342
|
-
this.
|
|
343
|
-
|
|
282
|
+
this.setTableSorter = effect(() => {
|
|
283
|
+
if (this.match && untracked(this.table.sorter) !== this.sorter()) {
|
|
284
|
+
this.table.updateSorter(this.sorter());
|
|
285
|
+
}
|
|
344
286
|
});
|
|
287
|
+
this.sorter = computed(() => this.sortable() && untracked(() => this.match)
|
|
288
|
+
? untracked(this.table.sorter)
|
|
289
|
+
: () => 0);
|
|
345
290
|
}
|
|
346
291
|
get key() {
|
|
347
292
|
return this.th.key;
|
|
348
293
|
}
|
|
349
|
-
check() {
|
|
350
|
-
if (this.match && this.table.sorter !== this.sorter()) {
|
|
351
|
-
this.table.updateSorter(this.sorter());
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
294
|
get match() {
|
|
355
|
-
return
|
|
295
|
+
return this.sortBy.tuiSortBy() === this.key;
|
|
356
296
|
}
|
|
357
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
358
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableSortable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
298
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTableSortable, isStandalone: true, selector: "th[tuiTh][tuiSortable]", inputs: { sortable: { classPropertyName: "sortable", publicName: "tuiSortable", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
359
299
|
}
|
|
360
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableSortable, decorators: [{
|
|
361
301
|
type: Directive,
|
|
362
302
|
args: [{
|
|
363
303
|
selector: 'th[tuiTh][tuiSortable]',
|
|
@@ -366,40 +306,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
366
306
|
|
|
367
307
|
class TuiTableSortBy {
|
|
368
308
|
constructor() {
|
|
309
|
+
this.table = inject((TuiTableDirective));
|
|
369
310
|
this.sortables = contentChildren(TuiTableSortable, {
|
|
370
311
|
descendants: true,
|
|
371
312
|
});
|
|
372
|
-
this.
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
this.
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
this.tuiSortByChange = outputFromObservable(this.tuiSortByChange$);
|
|
383
|
-
this.tuiSortChange$ = combineLatest([
|
|
384
|
-
this.tuiSortByChange$,
|
|
385
|
-
this.table.directionChange$,
|
|
386
|
-
]).pipe(debounceTime(0), map(([sortKey, sortDirection]) => ({
|
|
387
|
-
sortBy: sortKey,
|
|
388
|
-
orderBy: sortDirection,
|
|
389
|
-
sortKey,
|
|
390
|
-
sortDirection,
|
|
391
|
-
})));
|
|
392
|
-
this.tuiSortChange = outputFromObservable(this.tuiSortChange$);
|
|
313
|
+
this.sortChange = computed(() => ({
|
|
314
|
+
sortKey: this.sortables().length ? this.getKey(this.table.sorter()) : null,
|
|
315
|
+
sortDirection: this.table.direction(),
|
|
316
|
+
}));
|
|
317
|
+
this.sortOutput = effect(() => {
|
|
318
|
+
if (this.sortables().length) {
|
|
319
|
+
this.tuiSortChange.emit(this.sortChange());
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
this.tuiSortChange = output();
|
|
393
323
|
this.tuiSortBy = input(null);
|
|
394
|
-
this.checkSortables = effect((_, __ = this.tuiSortBy()) => untracked(this.sortables).forEach((s) => s.check()));
|
|
395
324
|
}
|
|
396
325
|
getKey(sorter) {
|
|
397
326
|
return this.sortables().find((s) => s.sorter() === sorter)?.key || null;
|
|
398
327
|
}
|
|
399
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
400
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.
|
|
328
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableSortBy, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
329
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.17", type: TuiTableSortBy, isStandalone: true, selector: "table[tuiTable][tuiSortBy]", inputs: { tuiSortBy: { classPropertyName: "tuiSortBy", publicName: "tuiSortBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tuiSortChange: "tuiSortChange" }, queries: [{ propertyName: "sortables", predicate: TuiTableSortable, descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
401
330
|
}
|
|
402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableSortBy, decorators: [{
|
|
403
332
|
type: Directive,
|
|
404
333
|
args: [{
|
|
405
334
|
selector: 'table[tuiTable][tuiSortBy]',
|
|
@@ -407,15 +336,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
407
336
|
}] });
|
|
408
337
|
|
|
409
338
|
class TuiTableThead {
|
|
410
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
411
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
339
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableThead, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
340
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiTableThead, isStandalone: true, selector: "thead[tuiThead]", providers: [
|
|
412
341
|
{
|
|
413
342
|
provide: WA_INTERSECTION_ROOT_MARGIN,
|
|
414
343
|
useValue: '0px 10000px 10000px 10000px',
|
|
415
344
|
},
|
|
416
345
|
], hostDirectives: [{ directive: TuiStuck }], ngImport: i0 }); }
|
|
417
346
|
}
|
|
418
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableThead, decorators: [{
|
|
419
348
|
type: Directive,
|
|
420
349
|
args: [{
|
|
421
350
|
selector: 'thead[tuiThead]',
|
|
@@ -432,40 +361,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImpo
|
|
|
432
361
|
class TuiTableSortPipe {
|
|
433
362
|
constructor() {
|
|
434
363
|
this.table = inject((TuiTableDirective));
|
|
364
|
+
this.data = signal([]);
|
|
365
|
+
this.sorted = computed((direction = this.table.direction(), sorter = this.table.sorter()) => [...this.data()].sort((a, b) => direction * sorter(a, b)));
|
|
435
366
|
}
|
|
436
367
|
transform(data) {
|
|
437
|
-
|
|
368
|
+
untracked(() => this.data.set(data ?? []));
|
|
369
|
+
return this.sorted();
|
|
438
370
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableSortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
443
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.16", ngImport: i0, type: TuiTableSortPipe, isStandalone: true, name: "tuiTableSort", pure: false }); }
|
|
371
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableSortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
372
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: TuiTableSortPipe, isStandalone: true, name: "tuiTableSort", pure: false }); }
|
|
444
373
|
}
|
|
445
|
-
|
|
446
|
-
tuiPure
|
|
447
|
-
], TuiTableSortPipe.prototype, "sort", null);
|
|
448
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: TuiTableSortPipe, decorators: [{
|
|
374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableSortPipe, decorators: [{
|
|
449
375
|
type: Pipe,
|
|
450
376
|
args: [{
|
|
451
377
|
name: 'tuiTableSort',
|
|
452
378
|
pure: false,
|
|
453
379
|
}]
|
|
454
|
-
}]
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* @deprecated TODO: drop after Angular update and signal inputs
|
|
458
|
-
*/
|
|
459
|
-
const TUI_TABLE_PROVIDER = [
|
|
460
|
-
{
|
|
461
|
-
provide: TuiTableDirective,
|
|
462
|
-
deps: [[new SkipSelf(), TuiTableDirective]],
|
|
463
|
-
useFactory: (controller) => {
|
|
464
|
-
controller.change$.pipe(tuiWatch(), takeUntilDestroyed()).subscribe();
|
|
465
|
-
return controller;
|
|
466
|
-
},
|
|
467
|
-
},
|
|
468
|
-
];
|
|
380
|
+
}] });
|
|
469
381
|
|
|
470
382
|
class TuiTableExpand {
|
|
471
383
|
constructor() {
|
|
@@ -494,19 +406,19 @@ class TuiTableExpand {
|
|
|
494
406
|
el.style.removeProperty('display');
|
|
495
407
|
return height;
|
|
496
408
|
}
|
|
497
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
498
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.
|
|
409
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableExpand, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
410
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.17", type: TuiTableExpand, isStandalone: true, selector: "tui-table-expand", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, host: { attributes: { "ngSkipHydration": "true" }, listeners: { "tuiPresent": "visible$.next($event)" } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.TuiPresent, outputs: ["tuiPresent", "tuiPresent"] }], ngImport: i0, template: "<div\n #content\n class=\"t-content\"\n [class.t-content_open]=\"expanded() && !transitioning()\"\n>\n <ng-content />\n</div>\n\n<div\n class=\"t-filler\"\n [class.t-filler_open]=\"expanded()\"\n [style.--t-height.px]=\"contentHeight()\"\n (animationcancel)=\"transitioning.set(false)\"\n (animationend)=\"transitioning.set(false)\"\n (animationstart)=\"transitioning.set(true)\"\n></div>\n", styles: ["@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes open{0%{block-size:0}to{block-size:var(--t-height)}}@keyframes close{0%{block-size:var(--t-height)}to{block-size:0}}:host{display:contents}:host:not(._visible){--tui-duration: 0ms}.t-content{display:none}.t-content_open{display:contents}.t-content_open ::ng-deep tr{animation:fade-in var(--tui-duration)}.t-filler{animation:close calc(var(--tui-duration) + 1ms)}.t-filler_open{animation:open calc(var(--tui-duration) + 1ms)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
499
411
|
}
|
|
500
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableExpand, decorators: [{
|
|
501
413
|
type: Component,
|
|
502
414
|
args: [{ selector: 'tui-table-expand', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
|
|
503
415
|
{
|
|
504
416
|
directive: TuiPresent,
|
|
505
|
-
outputs: ['
|
|
417
|
+
outputs: ['tuiPresent'],
|
|
506
418
|
},
|
|
507
419
|
], host: {
|
|
508
420
|
ngSkipHydration: 'true',
|
|
509
|
-
'(
|
|
421
|
+
'(tuiPresent)': 'visible$.next($event)',
|
|
510
422
|
}, template: "<div\n #content\n class=\"t-content\"\n [class.t-content_open]=\"expanded() && !transitioning()\"\n>\n <ng-content />\n</div>\n\n<div\n class=\"t-filler\"\n [class.t-filler_open]=\"expanded()\"\n [style.--t-height.px]=\"contentHeight()\"\n (animationcancel)=\"transitioning.set(false)\"\n (animationend)=\"transitioning.set(false)\"\n (animationstart)=\"transitioning.set(true)\"\n></div>\n", styles: ["@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes open{0%{block-size:0}to{block-size:var(--t-height)}}@keyframes close{0%{block-size:var(--t-height)}to{block-size:0}}:host{display:contents}:host:not(._visible){--tui-duration: 0ms}.t-content{display:none}.t-content_open{display:contents}.t-content_open ::ng-deep tr{animation:fade-in var(--tui-duration)}.t-filler{animation:close calc(var(--tui-duration) + 1ms)}.t-filler_open{animation:open calc(var(--tui-duration) + 1ms)}\n"] }]
|
|
511
423
|
}] });
|
|
512
424
|
|
|
@@ -515,39 +427,30 @@ class TuiTableTd {
|
|
|
515
427
|
this.control = contentChild((TuiControl));
|
|
516
428
|
this.textfield = contentChild((TuiTextfieldComponent));
|
|
517
429
|
}
|
|
518
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
519
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.
|
|
430
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTd, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
431
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.17", type: TuiTableTd, isStandalone: true, selector: "th[tuiTd], td[tuiTd]", host: { properties: { "class._editable": "control() || textfield()" } }, queries: [{ propertyName: "control", first: true, predicate: (TuiControl), descendants: true, isSignal: true }, { propertyName: "textfield", first: true, predicate: (TuiTextfieldComponent), descendants: true, isSignal: true }], ngImport: i0, template: '<ng-content />', isInline: true, styles: [":host{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;text-align:start;background:var(--tui-background-base);border:1px solid var(--tui-border-normal);border-block-start:none;box-sizing:border-box;filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:first-child{left:0}:host:not(:first-child){border-inline-start:none}:host._editable{padding:0!important;vertical-align:top}:host(th){position:sticky;z-index:100}:host(th):after{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:0;bottom:0;left:100%;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host(th):focus-within:not(:disabled){z-index:1100}:host-context([tuiTheme=\"dark\"]):after{background:#3c3c3ce6}:host-context(table._stuck){z-index:1000}:host-context(table._stuck):last-of-type:after{opacity:1}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-body-m);padding:calc(1rem - 1px) 1rem 1rem}:host-context(table[data-size=\"m\"]){block-size:var(--tui-height-m);font:var(--tui-font-body-s);padding:calc(.75rem - 1px) .75rem .75rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-body-s);padding:calc(.25rem - 1px) .5rem .25rem}:host(td):focus-within{z-index:100!important}:host(td):not(:focus-within){z-index:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
520
432
|
}
|
|
521
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
433
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTd, decorators: [{
|
|
522
434
|
type: Component,
|
|
523
435
|
args: [{ selector: 'th[tuiTd], td[tuiTd]', template: '<ng-content />', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
524
436
|
'[class._editable]': 'control() || textfield()',
|
|
525
|
-
}, styles: [":host{position:relative;text-align:start;background:var(--tui-background-base);border:1px solid var(--tui-border-normal);border-block-start:none;box-sizing:border-box;filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:first-child{left:0}:host:not(:first-child){border-inline-start:none}:host._editable
|
|
437
|
+
}, styles: [":host{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;text-align:start;background:var(--tui-background-base);border:1px solid var(--tui-border-normal);border-block-start:none;box-sizing:border-box;filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:first-child{left:0}:host:not(:first-child){border-inline-start:none}:host._editable{padding:0!important;vertical-align:top}:host(th){position:sticky;z-index:100}:host(th):after{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:0;bottom:0;left:100%;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host(th):focus-within:not(:disabled){z-index:1100}:host-context([tuiTheme=\"dark\"]):after{background:#3c3c3ce6}:host-context(table._stuck){z-index:1000}:host-context(table._stuck):last-of-type:after{opacity:1}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-body-m);padding:calc(1rem - 1px) 1rem 1rem}:host-context(table[data-size=\"m\"]){block-size:var(--tui-height-m);font:var(--tui-font-body-s);padding:calc(.75rem - 1px) .75rem .75rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-body-s);padding:calc(.25rem - 1px) .5rem .25rem}:host(td):focus-within{z-index:100!important}:host(td):not(:focus-within){z-index:0}\n"] }]
|
|
526
438
|
}] });
|
|
527
439
|
|
|
528
440
|
class TuiTableTr {
|
|
529
441
|
constructor() {
|
|
530
442
|
this.cells = contentChildren(forwardRef(() => TuiTableCell));
|
|
531
443
|
this.body = inject(forwardRef(() => TuiTableTbody));
|
|
532
|
-
this.contentReady$ = new ReplaySubject(1);
|
|
533
|
-
this.rows$ = toObservable(this.body.rows);
|
|
534
|
-
this.contentCells$ = toObservable(this.cells);
|
|
535
444
|
this.table = inject(forwardRef(() => TuiTableDirective));
|
|
536
|
-
this.
|
|
537
|
-
this.
|
|
538
|
-
this.item$ = this.contentReady$.pipe(switchMap(() => this.rows$), map((rows) => this.body.data()[rows.findIndex((row) => row === this)]));
|
|
539
|
-
}
|
|
540
|
-
ngAfterContentInit() {
|
|
541
|
-
Promise.resolve().then(() => this.contentReady$.next(true));
|
|
445
|
+
this.items = computed(() => this.cells().reduce((record, item) => ({ ...record, [item.tuiCell()]: item }), {}));
|
|
446
|
+
this.item = computed(() => this.body.data()[this.body.rows().findIndex((row) => row === this)]);
|
|
542
447
|
}
|
|
543
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
544
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
448
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTr, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
449
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTableTr, isStandalone: true, selector: "tr[tuiTr]", queries: [{ propertyName: "cells", predicate: i0.forwardRef(() => TuiTableCell), isSignal: true }], ngImport: i0, template: "@if (items(); as items) {\n @for (key of table.columns(); track key) {\n <ng-container [ngTemplateOutlet]=\"(items[key] && items[key].template) || plain\">\n <ng-template #plain>\n <td tuiTd>\n {{ item()[key] }}\n </td>\n </ng-template>\n </ng-container>\n }\n} @else {\n <td></td>\n}\n<ng-content />\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiTableTd, selector: "th[tuiTd], td[tuiTd]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
545
450
|
}
|
|
546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
451
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTr, decorators: [{
|
|
547
452
|
type: Component,
|
|
548
|
-
args: [{ selector: 'tr[tuiTr]', imports: [
|
|
549
|
-
'[style.--t-row-height.px]': 'height()',
|
|
550
|
-
}, template: "@if (cells$ | async; as items) {\n @for (key of table.columns(); track key) {\n <ng-container [ngTemplateOutlet]=\"(items[key] && items[key].template) || plain\">\n <ng-template #plain>\n @if (item$ | async; as item) {\n <td tuiTd>\n {{ item[key] }}\n </td>\n }\n </ng-template>\n </ng-container>\n }\n} @else {\n <td></td>\n}\n<ng-content />\n" }]
|
|
453
|
+
args: [{ selector: 'tr[tuiTr]', imports: [NgTemplateOutlet, TuiTableTd], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (items(); as items) {\n @for (key of table.columns(); track key) {\n <ng-container [ngTemplateOutlet]=\"(items[key] && items[key].template) || plain\">\n <ng-template #plain>\n <td tuiTd>\n {{ item()[key] }}\n </td>\n </ng-template>\n </ng-container>\n }\n} @else {\n <td></td>\n}\n<ng-content />\n" }]
|
|
551
454
|
}] });
|
|
552
455
|
|
|
553
456
|
class TuiTableTbody {
|
|
@@ -565,29 +468,27 @@ class TuiTableTbody {
|
|
|
565
468
|
this.open.set(!this.open());
|
|
566
469
|
};
|
|
567
470
|
}
|
|
568
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
569
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTbody, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
472
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTableTbody, isStandalone: true, selector: "tbody[tuiTbody]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, queries: [{ propertyName: "rows", predicate: i0.forwardRef(() => TuiTableTr), isSignal: true }], ngImport: i0, template: "@if (heading()) {\n <tr>\n <th\n class=\"t-heading\"\n [colSpan]=\"table.columns().length\"\n >\n <button\n type=\"button\"\n class=\"t-expand\"\n (click)=\"onClick()\"\n >\n <span class=\"t-name\">\n <ng-container *polymorpheusOutlet=\"heading() as text\">\n {{ text }}\n </ng-container>\n </span>\n <tui-icon\n class=\"t-chevron\"\n [tuiChevron]=\"open()\"\n />\n </button>\n </th>\n </tr>\n}\n@if (open()) {\n <ng-content />\n}\n", styles: [":host{border-color:var(--tui-border-normal)}:host tr{border-color:inherit}.t-expand{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;display:flex;inline-size:100%;block-size:100%;align-items:center;box-sizing:border-box;outline:none;font-weight:700;cursor:pointer;border-color:inherit}.t-expand:focus-visible .t-name{background:var(--tui-service-selection-background)}.t-expand:before,.t-expand:after{content:\"\";position:sticky;block-size:100%;border-inline-start:1px solid;border-color:inherit}.t-expand:before{left:0}.t-expand:after{right:0}.t-heading{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;block-size:var(--tui-height-m);font:var(--tui-font-body-s);padding:0;background:var(--tui-background-neutral-1);border-block-end:1px solid var(--tui-border-normal);border-color:inherit}.t-heading:hover{background:var(--tui-background-neutral-1-hover)}:host-context(table[data-size=\"l\"]) .t-heading{font:var(--tui-font-body-m);block-size:var(--tui-height-l)}.t-name{position:sticky;left:.75rem;display:inline-block}:host-context(table[data-size=\"l\"]) .t-name{left:1rem}.t-chevron{position:sticky;right:.75rem;margin:0 .6875rem 0 auto}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
570
473
|
}
|
|
571
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableTbody, decorators: [{
|
|
572
475
|
type: Component,
|
|
573
|
-
args: [{ selector: 'tbody[tuiTbody]', imports: [PolymorpheusOutlet, TuiChevron, TuiIcon], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
476
|
+
args: [{ selector: 'tbody[tuiTbody]', imports: [PolymorpheusOutlet, TuiChevron, TuiIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (heading()) {\n <tr>\n <th\n class=\"t-heading\"\n [colSpan]=\"table.columns().length\"\n >\n <button\n type=\"button\"\n class=\"t-expand\"\n (click)=\"onClick()\"\n >\n <span class=\"t-name\">\n <ng-container *polymorpheusOutlet=\"heading() as text\">\n {{ text }}\n </ng-container>\n </span>\n <tui-icon\n class=\"t-chevron\"\n [tuiChevron]=\"open()\"\n />\n </button>\n </th>\n </tr>\n}\n@if (open()) {\n <ng-content />\n}\n", styles: [":host{border-color:var(--tui-border-normal)}:host tr{border-color:inherit}.t-expand{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;display:flex;inline-size:100%;block-size:100%;align-items:center;box-sizing:border-box;outline:none;font-weight:700;cursor:pointer;border-color:inherit}.t-expand:focus-visible .t-name{background:var(--tui-service-selection-background)}.t-expand:before,.t-expand:after{content:\"\";position:sticky;block-size:100%;border-inline-start:1px solid;border-color:inherit}.t-expand:before{left:0}.t-expand:after{right:0}.t-heading{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;block-size:var(--tui-height-m);font:var(--tui-font-body-s);padding:0;background:var(--tui-background-neutral-1);border-block-end:1px solid var(--tui-border-normal);border-color:inherit}.t-heading:hover{background:var(--tui-background-neutral-1-hover)}:host-context(table[data-size=\"l\"]) .t-heading{font:var(--tui-font-body-m);block-size:var(--tui-height-l)}.t-name{position:sticky;left:.75rem;display:inline-block}:host-context(table[data-size=\"l\"]) .t-name{left:1rem}.t-chevron{position:sticky;right:.75rem;margin:0 .6875rem 0 auto}\n"] }]
|
|
574
477
|
}] });
|
|
575
478
|
|
|
576
479
|
class TuiTableThGroup {
|
|
577
480
|
constructor() {
|
|
578
481
|
this.th = contentChild(forwardRef(() => TuiTableTh));
|
|
579
482
|
this.heads = contentChildren(forwardRef(() => TuiTableHead));
|
|
580
|
-
this.computedHeads = computed(() => {
|
|
581
|
-
return this.heads().reduce((record, item) => ({ ...record, [item.tuiHead()]: item }), {});
|
|
582
|
-
});
|
|
483
|
+
this.computedHeads = computed(() => this.heads().reduce((record, item) => ({ ...record, [item.tuiHead()]: item }), {}));
|
|
583
484
|
this.table = inject(forwardRef(() => TuiTableDirective));
|
|
584
485
|
}
|
|
585
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
586
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableThGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
487
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTableThGroup, isStandalone: true, selector: "tr[tuiThGroup]", queries: [{ propertyName: "th", first: true, predicate: i0.forwardRef(() => TuiTableTh), descendants: true, isSignal: true }, { propertyName: "heads", predicate: i0.forwardRef(() => TuiTableHead), isSignal: true }], ngImport: i0, template: "<ng-content />\n@if (computedHeads(); as headings) {\n @for (key of table.columns(); track key) {\n <ng-container\n [ngTemplateOutlet]=\"headings?.[key]?.template || plain\"\n [ngTemplateOutletContext]=\"{$implicit: key}\"\n />\n }\n <ng-template\n #plain\n let-key\n >\n @if (!th() && !heads().length) {\n <th tuiTh>\n {{ key.toString() }}\n </th>\n }\n </ng-template>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiTableTh, selector: "th[tuiTh]", inputs: ["minWidth", "maxWidth", "sorter", "resizable", "sticky", "requiredSort"], outputs: ["sorterChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
587
488
|
}
|
|
588
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTableThGroup, decorators: [{
|
|
589
490
|
type: Component,
|
|
590
|
-
args: [{ selector: 'tr[tuiThGroup]', imports: [NgTemplateOutlet, TuiTableTh], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
491
|
+
args: [{ selector: 'tr[tuiThGroup]', imports: [NgTemplateOutlet, TuiTableTh], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n@if (computedHeads(); as headings) {\n @for (key of table.columns(); track key) {\n <ng-container\n [ngTemplateOutlet]=\"headings?.[key]?.template || plain\"\n [ngTemplateOutletContext]=\"{$implicit: key}\"\n />\n }\n <ng-template\n #plain\n let-key\n >\n @if (!th() && !heads().length) {\n <th tuiTh>\n {{ key.toString() }}\n </th>\n }\n </ng-template>\n}\n" }]
|
|
591
492
|
}] });
|
|
592
493
|
|
|
593
494
|
const TuiTable = [
|
|
@@ -605,7 +506,6 @@ const TuiTable = [
|
|
|
605
506
|
TuiTableThead,
|
|
606
507
|
TuiTableResized,
|
|
607
508
|
TuiTableSortPipe,
|
|
608
|
-
TuiTableDirectionOrder,
|
|
609
509
|
TuiTableExpand,
|
|
610
510
|
];
|
|
611
511
|
|
|
@@ -613,5 +513,5 @@ const TuiTable = [
|
|
|
613
513
|
* Generated bundle index. Do not edit.
|
|
614
514
|
*/
|
|
615
515
|
|
|
616
|
-
export { TUI_TABLE_DEFAULT_OPTIONS, TUI_TABLE_OPTIONS,
|
|
516
|
+
export { TUI_TABLE_DEFAULT_OPTIONS, TUI_TABLE_OPTIONS, TuiSortDirection, TuiStuck, TuiTable, TuiTableCaption, TuiTableCell, TuiTableDirective, TuiTableExpand, TuiTableHead, TuiTableResized, TuiTableSortBy, TuiTableSortKeyException, TuiTableSortPipe, TuiTableSortable, TuiTableTbody, TuiTableTd, TuiTableTh, TuiTableThGroup, TuiTableThead, TuiTableTr, tuiTableOptionsProvider };
|
|
617
517
|
//# sourceMappingURL=taiga-ui-addon-table-components-table.mjs.map
|