@taiga-ui/addon-table 3.58.0 → 3.59.0-canary.10da730
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/reorder/reorder.component.d.ts +1 -1
- package/components/table/directives/cell.directive.d.ts +1 -1
- package/components/table/directives/direction-order.directive.d.ts +1 -1
- package/components/table/directives/head.directive.d.ts +1 -1
- package/components/table/directives/resized.directive.d.ts +1 -1
- package/components/table/directives/row.directive.d.ts +1 -1
- package/components/table/directives/sort-by.directive.d.ts +1 -1
- package/components/table/directives/sortable.directive.d.ts +1 -1
- package/components/table/directives/table.directive.d.ts +1 -1
- package/components/table/directives/thead.directive.d.ts +1 -1
- package/components/table/pipes/table-sort.pipe.d.ts +1 -1
- package/components/table/tbody/tbody.component.d.ts +1 -1
- package/components/table/td/td.component.d.ts +1 -1
- package/components/table/th/th.component.d.ts +1 -1
- package/components/table/th-group/th-group.component.d.ts +1 -1
- package/components/table/tr/tr.component.d.ts +1 -1
- package/components/table-pagination/table-pagination.component.d.ts +1 -1
- package/directives/table-filters/generic-filter.directive.d.ts +1 -1
- package/directives/table-filters/table-filter.directive.d.ts +1 -1
- package/directives/table-filters/table-filters.directive.d.ts +1 -1
- package/directives/table-filters/table-filters.pipe.d.ts +1 -1
- package/esm2020/components/reorder/reorder.component.mjs +108 -0
- package/{esm2015/components/reorder/reorder.module.js → esm2020/components/reorder/reorder.module.mjs} +5 -5
- package/{esm2015/components/table/directives/cell.directive.js → esm2020/components/table/directives/cell.directive.mjs} +3 -3
- package/esm2020/components/table/directives/direction-order.directive.mjs +30 -0
- package/{esm2015/components/table/directives/head.directive.js → esm2020/components/table/directives/head.directive.mjs} +3 -3
- package/esm2020/components/table/directives/resized.directive.mjs +37 -0
- package/{esm2015/components/table/directives/row.directive.js → esm2020/components/table/directives/row.directive.mjs} +3 -3
- package/esm2020/components/table/directives/sort-by.directive.mjs +47 -0
- package/{esm2015/components/table/directives/sortable.directive.js → esm2020/components/table/directives/sortable.directive.mjs} +3 -3
- package/{esm2015/components/table/directives/table.directive.js → esm2020/components/table/directives/table.directive.mjs} +3 -3
- package/{esm2015/components/table/directives/thead.directive.js → esm2020/components/table/directives/thead.directive.mjs} +3 -3
- package/{esm2015/components/table/pipes/table-sort.pipe.js → esm2020/components/table/pipes/table-sort.pipe.mjs} +3 -3
- package/esm2020/components/table/providers/stuck.provider.mjs +17 -0
- package/{esm2015/components/table/providers/table.providers.js → esm2020/components/table/providers/table.providers.mjs} +5 -2
- package/{esm2015/components/table/table.module.js → esm2020/components/table/table.module.mjs} +5 -5
- package/esm2020/components/table/tbody/tbody.component.mjs +69 -0
- package/esm2020/components/table/td/td.component.mjs +22 -0
- package/{esm2015/components/table/th/th.component.js → esm2020/components/table/th/th.component.mjs} +12 -21
- package/esm2020/components/table/th-group/th-group.component.mjs +37 -0
- package/esm2020/components/table/tr/tr.component.mjs +46 -0
- package/esm2020/components/table-pagination/table-pagination.component.mjs +110 -0
- package/{esm2015/components/table-pagination/table-pagination.module.js → esm2020/components/table-pagination/table-pagination.module.mjs} +11 -13
- package/{esm2015/directives/table-filters/generic-filter.directive.js → esm2020/directives/table-filters/generic-filter.directive.mjs} +3 -3
- package/esm2020/directives/table-filters/table-filter.directive.mjs +58 -0
- package/esm2020/directives/table-filters/table-filters.directive.mjs +35 -0
- package/{esm2015/directives/table-filters/table-filters.module.js → esm2020/directives/table-filters/table-filters.module.mjs} +4 -4
- package/{esm2015/directives/table-filters/table-filters.pipe.js → esm2020/directives/table-filters/table-filters.pipe.mjs} +3 -3
- package/fesm2015/taiga-ui-addon-table-components-reorder.mjs +148 -0
- package/fesm2015/taiga-ui-addon-table-components-reorder.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-table-components-table-pagination.mjs +172 -0
- package/fesm2015/taiga-ui-addon-table-components-table-pagination.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-table-components-table.mjs +770 -0
- package/fesm2015/taiga-ui-addon-table-components-table.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-table-components.js → taiga-ui-addon-table-components.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-table-components.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-table-directives-table-filters.mjs +180 -0
- package/fesm2015/taiga-ui-addon-table-directives-table-filters.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-table-directives.js → taiga-ui-addon-table-directives.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-table-directives.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-table-interfaces.mjs +4 -0
- package/fesm2015/taiga-ui-addon-table-interfaces.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-table-tokens.js → taiga-ui-addon-table-tokens.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-table-tokens.mjs.map +1 -0
- package/fesm2015/taiga-ui-addon-table-types.mjs +4 -0
- package/fesm2015/taiga-ui-addon-table-types.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-table-utils.js → taiga-ui-addon-table-utils.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-table-utils.mjs.map +1 -0
- package/fesm2015/{taiga-ui-addon-table.js → taiga-ui-addon-table.mjs} +1 -1
- package/fesm2015/taiga-ui-addon-table.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-table-components-reorder.js → fesm2020/taiga-ui-addon-table-components-reorder.mjs} +21 -28
- package/fesm2020/taiga-ui-addon-table-components-reorder.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-table-components-table-pagination.js → fesm2020/taiga-ui-addon-table-components-table-pagination.mjs} +17 -24
- package/fesm2020/taiga-ui-addon-table-components-table-pagination.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-table-components-table.js → fesm2020/taiga-ui-addon-table-components-table.mjs} +85 -116
- package/fesm2020/taiga-ui-addon-table-components-table.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-table-components.mjs +8 -0
- package/fesm2020/taiga-ui-addon-table-components.mjs.map +1 -0
- package/{fesm2015/taiga-ui-addon-table-directives-table-filters.js → fesm2020/taiga-ui-addon-table-directives-table-filters.mjs} +20 -25
- package/fesm2020/taiga-ui-addon-table-directives-table-filters.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-table-directives.mjs +6 -0
- package/fesm2020/taiga-ui-addon-table-directives.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-table-interfaces.mjs +4 -0
- package/fesm2020/taiga-ui-addon-table-interfaces.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-table-tokens.mjs +18 -0
- package/fesm2020/taiga-ui-addon-table-tokens.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-table-types.mjs +4 -0
- package/fesm2020/taiga-ui-addon-table-types.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-table-utils.mjs +14 -0
- package/fesm2020/taiga-ui-addon-table-utils.mjs.map +1 -0
- package/fesm2020/taiga-ui-addon-table.mjs +10 -0
- package/fesm2020/taiga-ui-addon-table.mjs.map +1 -0
- package/package.json +127 -34
- package/types/comparator.d.ts +1 -1
- package/bundles/taiga-ui-addon-table-components-reorder.umd.js +0 -190
- package/bundles/taiga-ui-addon-table-components-reorder.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components-table-pagination.umd.js +0 -234
- package/bundles/taiga-ui-addon-table-components-table-pagination.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components-table.umd.js +0 -1235
- package/bundles/taiga-ui-addon-table-components-table.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components.umd.js +0 -33
- package/bundles/taiga-ui-addon-table-components.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-directives-table-filters.umd.js +0 -550
- package/bundles/taiga-ui-addon-table-directives-table-filters.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-directives.umd.js +0 -21
- package/bundles/taiga-ui-addon-table-directives.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-interfaces.umd.js +0 -11
- package/bundles/taiga-ui-addon-table-interfaces.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-tokens.umd.js +0 -26
- package/bundles/taiga-ui-addon-table-tokens.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-types.umd.js +0 -11
- package/bundles/taiga-ui-addon-table-types.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-utils.umd.js +0 -22
- package/bundles/taiga-ui-addon-table-utils.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table.umd.js +0 -45
- package/bundles/taiga-ui-addon-table.umd.js.map +0 -1
- package/components/package.json +0 -10
- package/components/reorder/package.json +0 -10
- package/components/reorder/taiga-ui-addon-table-components-reorder.d.ts +0 -5
- package/components/table/package.json +0 -10
- package/components/table/taiga-ui-addon-table-components-table.d.ts +0 -5
- package/components/table-pagination/package.json +0 -10
- package/components/table-pagination/taiga-ui-addon-table-components-table-pagination.d.ts +0 -5
- package/components/taiga-ui-addon-table-components.d.ts +0 -5
- package/directives/package.json +0 -10
- package/directives/table-filters/package.json +0 -10
- package/directives/table-filters/taiga-ui-addon-table-directives-table-filters.d.ts +0 -5
- package/directives/taiga-ui-addon-table-directives.d.ts +0 -5
- package/esm2015/components/reorder/reorder.component.js +0 -115
- package/esm2015/components/table/directives/direction-order.directive.js +0 -30
- package/esm2015/components/table/directives/resized.directive.js +0 -37
- package/esm2015/components/table/directives/sort-by.directive.js +0 -48
- package/esm2015/components/table/providers/stuck.provider.js +0 -17
- package/esm2015/components/table/tbody/tbody.component.js +0 -75
- package/esm2015/components/table/td/td.component.js +0 -27
- package/esm2015/components/table/th-group/th-group.component.js +0 -42
- package/esm2015/components/table/tr/tr.component.js +0 -55
- package/esm2015/components/table-pagination/table-pagination.component.js +0 -115
- package/esm2015/directives/table-filters/table-filter.directive.js +0 -63
- package/esm2015/directives/table-filters/table-filters.directive.js +0 -36
- package/fesm2015/taiga-ui-addon-table-components-reorder.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-components-table-pagination.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-components-table.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-components.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-directives-table-filters.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-directives.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-interfaces.js +0 -4
- package/fesm2015/taiga-ui-addon-table-interfaces.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-tokens.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-types.js +0 -4
- package/fesm2015/taiga-ui-addon-table-types.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table-utils.js.map +0 -1
- package/fesm2015/taiga-ui-addon-table.js.map +0 -1
- package/interfaces/package.json +0 -10
- package/interfaces/taiga-ui-addon-table-interfaces.d.ts +0 -5
- package/taiga-ui-addon-table.d.ts +0 -5
- package/tokens/package.json +0 -10
- package/tokens/taiga-ui-addon-table-tokens.d.ts +0 -5
- package/types/package.json +0 -10
- package/types/taiga-ui-addon-table-types.d.ts +0 -5
- package/utils/package.json +0 -10
- package/utils/taiga-ui-addon-table-utils.d.ts +0 -5
- /package/{esm2015/components/index.js → esm2020/components/index.mjs} +0 -0
- /package/{esm2015/components/reorder/index.js → esm2020/components/reorder/index.mjs} +0 -0
- /package/{esm2015/components/reorder/reorder.options.js → esm2020/components/reorder/reorder.options.mjs} +0 -0
- /package/{esm2015/components/reorder/taiga-ui-addon-table-components-reorder.js → esm2020/components/reorder/taiga-ui-addon-table-components-reorder.mjs} +0 -0
- /package/{esm2015/components/table/index.js → esm2020/components/table/index.mjs} +0 -0
- /package/{esm2015/components/table/providers/table.provider.js → esm2020/components/table/providers/table.provider.mjs} +0 -0
- /package/{esm2015/components/table/table.options.js → esm2020/components/table/table.options.mjs} +0 -0
- /package/{esm2015/components/table/taiga-ui-addon-table-components-table.js → esm2020/components/table/taiga-ui-addon-table-components-table.mjs} +0 -0
- /package/{esm2015/components/table-pagination/index.js → esm2020/components/table-pagination/index.mjs} +0 -0
- /package/{esm2015/components/table-pagination/table-pagination.options.js → esm2020/components/table-pagination/table-pagination.options.mjs} +0 -0
- /package/{esm2015/components/table-pagination/taiga-ui-addon-table-components-table-pagination.js → esm2020/components/table-pagination/taiga-ui-addon-table-components-table-pagination.mjs} +0 -0
- /package/{esm2015/components/taiga-ui-addon-table-components.js → esm2020/components/taiga-ui-addon-table-components.mjs} +0 -0
- /package/{esm2015/directives/index.js → esm2020/directives/index.mjs} +0 -0
- /package/{esm2015/directives/table-filters/abstract-table-filter.js → esm2020/directives/table-filters/abstract-table-filter.mjs} +0 -0
- /package/{esm2015/directives/table-filters/index.js → esm2020/directives/table-filters/index.mjs} +0 -0
- /package/{esm2015/directives/table-filters/table-filter.js → esm2020/directives/table-filters/table-filter.mjs} +0 -0
- /package/{esm2015/directives/table-filters/taiga-ui-addon-table-directives-table-filters.js → esm2020/directives/table-filters/taiga-ui-addon-table-directives-table-filters.mjs} +0 -0
- /package/{esm2015/directives/taiga-ui-addon-table-directives.js → esm2020/directives/taiga-ui-addon-table-directives.mjs} +0 -0
- /package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- /package/{esm2015/interfaces/index.js → esm2020/interfaces/index.mjs} +0 -0
- /package/{esm2015/interfaces/row-context.js → esm2020/interfaces/row-context.mjs} +0 -0
- /package/{esm2015/interfaces/taiga-ui-addon-table-interfaces.js → esm2020/interfaces/taiga-ui-addon-table-interfaces.mjs} +0 -0
- /package/{esm2015/taiga-ui-addon-table.js → esm2020/taiga-ui-addon-table.mjs} +0 -0
- /package/{esm2015/tokens/i18n.js → esm2020/tokens/i18n.mjs} +0 -0
- /package/{esm2015/tokens/index.js → esm2020/tokens/index.mjs} +0 -0
- /package/{esm2015/tokens/taiga-ui-addon-table-tokens.js → esm2020/tokens/taiga-ui-addon-table-tokens.mjs} +0 -0
- /package/{esm2015/types/comparator.js → esm2020/types/comparator.mjs} +0 -0
- /package/{esm2015/types/index.js → esm2020/types/index.mjs} +0 -0
- /package/{esm2015/types/taiga-ui-addon-table-types.js → esm2020/types/taiga-ui-addon-table-types.mjs} +0 -0
- /package/{esm2015/utils/default-sort.js → esm2020/utils/default-sort.mjs} +0 -0
- /package/{esm2015/utils/index.js → esm2020/utils/index.mjs} +0 -0
- /package/{esm2015/utils/taiga-ui-addon-table-utils.js → esm2020/utils/taiga-ui-addon-table-utils.mjs} +0 -0
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { TemplateRef, Directive, Inject, Input, InjectionToken, ElementRef, SkipSelf, forwardRef, EventEmitter, ChangeDetectorRef, HostBinding, Output, Component, ChangeDetectionStrategy, Optional, ContentChildren, Pipe, ContentChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from 'rxjs';
|
|
4
|
+
import { map, switchMap, distinctUntilChanged, takeUntil, delay, filter, ReplaySubject, startWith } from 'rxjs';
|
|
5
|
+
import { IntersectionObserverService, INTERSECTION_ROOT_MARGIN, INTERSECTION_THRESHOLD } from '@ng-web-apis/intersection-observer';
|
|
6
|
+
import * as i4 from '@taiga-ui/cdk';
|
|
7
|
+
import { tuiCreateToken, tuiProvideOptions, AbstractTuiController, tuiTypedFromEvent, tuiPreventDefault, tuiDefaultSort, TuiTableSortKeyException, EMPTY_QUERY, tuiPure, TuiDestroyService, tuiQueryListChanges, TuiMapperPipeModule } from '@taiga-ui/cdk';
|
|
8
|
+
import * as i2 from '@taiga-ui/core';
|
|
9
|
+
import { TUI_TEXTFIELD_APPEARANCE_DIRECTIVE, TuiTextfieldAppearanceDirective, TuiAppearance, TUI_TEXTFIELD_LABEL_OUTSIDE, TUI_TEXTFIELD_SIZE, MODE_PROVIDER, TUI_MODE, TUI_ELEMENT_REF, tuiWatchedControllerFactory, TuiSvgModule } from '@taiga-ui/core';
|
|
10
|
+
import { TUI_INPUT_COUNT_OPTIONS, TUI_ARROW_OPTIONS } from '@taiga-ui/kit';
|
|
11
|
+
import * as i1$1 from '@angular/common';
|
|
12
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
13
|
+
import { __decorate, __awaiter } from 'tslib';
|
|
14
|
+
import * as i2$1 from '@tinkoff/ng-polymorpheus';
|
|
15
|
+
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
16
|
+
import { NgControl } from '@angular/forms';
|
|
17
|
+
|
|
18
|
+
class TuiCellDirective {
|
|
19
|
+
constructor(template) {
|
|
20
|
+
this.template = template;
|
|
21
|
+
this.tuiCell = '';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
TuiCellDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiCellDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
25
|
+
TuiCellDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiCellDirective, selector: "[tuiCell]", inputs: { tuiCell: "tuiCell" }, ngImport: i0 });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiCellDirective, decorators: [{
|
|
27
|
+
type: Directive,
|
|
28
|
+
args: [{
|
|
29
|
+
selector: '[tuiCell]',
|
|
30
|
+
}]
|
|
31
|
+
}], ctorParameters: function () {
|
|
32
|
+
return [{ type: i0.TemplateRef, decorators: [{
|
|
33
|
+
type: Inject,
|
|
34
|
+
args: [TemplateRef]
|
|
35
|
+
}] }];
|
|
36
|
+
}, propDecorators: { tuiCell: [{
|
|
37
|
+
type: Input
|
|
38
|
+
}] } });
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Stream of sticky stuck events
|
|
42
|
+
*/
|
|
43
|
+
const TUI_STUCK = new InjectionToken(`[TUI_STUCK]`);
|
|
44
|
+
const TUI_STUCK_PROVIDER = {
|
|
45
|
+
provide: TUI_STUCK,
|
|
46
|
+
deps: [ElementRef, IntersectionObserverService],
|
|
47
|
+
useFactory: ({ nativeElement }, entries$) => {
|
|
48
|
+
const stream$ = entries$.pipe(map(([{ intersectionRatio }]) => intersectionRatio < 1));
|
|
49
|
+
nativeElement[`$.class._stuck`] = stream$;
|
|
50
|
+
return stream$;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const TUI_TABLE_PROVIDERS = [
|
|
55
|
+
{
|
|
56
|
+
provide: INTERSECTION_ROOT_MARGIN,
|
|
57
|
+
useValue: `10000px 10000px 10000px 0px`,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
provide: INTERSECTION_THRESHOLD,
|
|
61
|
+
useValue: [0, 1],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
provide: TUI_TEXTFIELD_APPEARANCE_DIRECTIVE,
|
|
65
|
+
useFactory: () => {
|
|
66
|
+
const directive = new TuiTextfieldAppearanceDirective();
|
|
67
|
+
directive.appearance = TuiAppearance.Table;
|
|
68
|
+
return directive;
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
provide: TUI_TEXTFIELD_LABEL_OUTSIDE,
|
|
73
|
+
useValue: {
|
|
74
|
+
labelOutside: true,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
provide: TUI_INPUT_COUNT_OPTIONS,
|
|
79
|
+
deps: [[new SkipSelf(), TUI_INPUT_COUNT_OPTIONS]],
|
|
80
|
+
useFactory: (options) => (Object.assign(Object.assign({}, options), { hideButtons: true })),
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
provide: TUI_TEXTFIELD_SIZE,
|
|
84
|
+
useExisting: forwardRef(() => TuiTableDirective),
|
|
85
|
+
},
|
|
86
|
+
IntersectionObserverService,
|
|
87
|
+
MODE_PROVIDER,
|
|
88
|
+
TUI_STUCK_PROVIDER,
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
const TUI_TABLE_DEFAULT_OPTIONS = {
|
|
92
|
+
sticky: false,
|
|
93
|
+
resizable: false,
|
|
94
|
+
open: true,
|
|
95
|
+
size: `m`,
|
|
96
|
+
direction: 1,
|
|
97
|
+
sortIcons: {
|
|
98
|
+
asc: `tuiIconSortAscending`,
|
|
99
|
+
desc: `tuiIconSortDescending`,
|
|
100
|
+
off: `tuiIconSortOff`,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
const TUI_TABLE_OPTIONS = tuiCreateToken(TUI_TABLE_DEFAULT_OPTIONS);
|
|
104
|
+
function tuiTableOptionsProvider(options) {
|
|
105
|
+
return tuiProvideOptions(TUI_TABLE_OPTIONS, options, TUI_TABLE_DEFAULT_OPTIONS);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
class TuiTableDirective extends AbstractTuiController {
|
|
109
|
+
constructor(entries$, mode$, stuck$, options, cdr) {
|
|
110
|
+
super();
|
|
111
|
+
this.entries$ = entries$;
|
|
112
|
+
this.mode$ = mode$;
|
|
113
|
+
this.stuck$ = stuck$;
|
|
114
|
+
this.options = options;
|
|
115
|
+
this.cdr = cdr;
|
|
116
|
+
this.columns = [];
|
|
117
|
+
this.size = this.options.size;
|
|
118
|
+
this.direction = this.options.direction;
|
|
119
|
+
this.directionChange = new EventEmitter();
|
|
120
|
+
this.sorterChange = new EventEmitter();
|
|
121
|
+
this.sorter = () => 0;
|
|
122
|
+
}
|
|
123
|
+
updateSorterAndDirection(sorter) {
|
|
124
|
+
if (this.sorter === sorter) {
|
|
125
|
+
this.updateDirection(this.direction === 1 ? -1 : 1);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.updateSorter(sorter);
|
|
129
|
+
this.updateDirection(1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
ngAfterViewInit() {
|
|
133
|
+
this.cdr.detectChanges();
|
|
134
|
+
}
|
|
135
|
+
updateSorter(sorter) {
|
|
136
|
+
this.sorter = sorter || (() => 0);
|
|
137
|
+
this.sorterChange.emit(this.sorter);
|
|
138
|
+
this.change$.next();
|
|
139
|
+
}
|
|
140
|
+
updateDirection(direction) {
|
|
141
|
+
this.direction = direction;
|
|
142
|
+
this.directionChange.emit(this.direction);
|
|
143
|
+
this.change$.next();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
TuiTableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTableDirective, deps: [{ token: IntersectionObserverService }, { token: TUI_MODE }, { token: TUI_STUCK }, { token: TUI_TABLE_OPTIONS }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
147
|
+
TuiTableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiTableDirective, selector: "table[tuiTable]", inputs: { columns: "columns", size: "size", direction: "direction", sorter: "sorter" }, outputs: { directionChange: "directionChange", sorterChange: "sorterChange" }, host: { listeners: { "$.data-mode.attr": "mode$", "$.class._stuck": "stuck$" }, properties: { "attr.data-size": "this.size" }, styleAttribute: "border-collapse: separate" }, providers: TUI_TABLE_PROVIDERS, usesInheritance: true, ngImport: i0 });
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTableDirective, decorators: [{
|
|
149
|
+
type: Directive,
|
|
150
|
+
args: [{
|
|
151
|
+
selector: 'table[tuiTable]',
|
|
152
|
+
providers: TUI_TABLE_PROVIDERS,
|
|
153
|
+
host: {
|
|
154
|
+
'($.data-mode.attr)': 'mode$',
|
|
155
|
+
'($.class._stuck)': 'stuck$',
|
|
156
|
+
style: 'border-collapse: separate',
|
|
157
|
+
},
|
|
158
|
+
}]
|
|
159
|
+
}], ctorParameters: function () {
|
|
160
|
+
return [{ type: i1.Observable, decorators: [{
|
|
161
|
+
type: Inject,
|
|
162
|
+
args: [IntersectionObserverService]
|
|
163
|
+
}] }, { type: i1.Observable, decorators: [{
|
|
164
|
+
type: Inject,
|
|
165
|
+
args: [TUI_MODE]
|
|
166
|
+
}] }, { type: i1.Observable, decorators: [{
|
|
167
|
+
type: Inject,
|
|
168
|
+
args: [TUI_STUCK]
|
|
169
|
+
}] }, { type: undefined, decorators: [{
|
|
170
|
+
type: Inject,
|
|
171
|
+
args: [TUI_TABLE_OPTIONS]
|
|
172
|
+
}] }, { type: i0.ChangeDetectorRef, decorators: [{
|
|
173
|
+
type: Inject,
|
|
174
|
+
args: [ChangeDetectorRef]
|
|
175
|
+
}] }];
|
|
176
|
+
}, propDecorators: { columns: [{
|
|
177
|
+
type: Input
|
|
178
|
+
}], size: [{
|
|
179
|
+
type: Input
|
|
180
|
+
}, {
|
|
181
|
+
type: HostBinding,
|
|
182
|
+
args: ['attr.data-size']
|
|
183
|
+
}], direction: [{
|
|
184
|
+
type: Input
|
|
185
|
+
}], directionChange: [{
|
|
186
|
+
type: Output
|
|
187
|
+
}], sorterChange: [{
|
|
188
|
+
type: Output
|
|
189
|
+
}], sorter: [{
|
|
190
|
+
type: Input
|
|
191
|
+
}] } });
|
|
192
|
+
|
|
193
|
+
class TuiDirectionOrderDirective {
|
|
194
|
+
set directionOrder(order) {
|
|
195
|
+
this.table.direction = order === 'asc' ? 1 : -1;
|
|
196
|
+
}
|
|
197
|
+
constructor(table) {
|
|
198
|
+
this.table = table;
|
|
199
|
+
this.directionOrderChange = this.table.directionChange.pipe(map(dir => (dir === 1 ? 'asc' : 'desc')));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
TuiDirectionOrderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiDirectionOrderDirective, deps: [{ token: TuiTableDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
203
|
+
TuiDirectionOrderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiDirectionOrderDirective, selector: "table[tuiTable][tuiDirectionOrder]", inputs: { directionOrder: "directionOrder" }, outputs: { directionOrderChange: "directionOrderChange" }, ngImport: i0 });
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiDirectionOrderDirective, decorators: [{
|
|
205
|
+
type: Directive,
|
|
206
|
+
args: [{
|
|
207
|
+
selector: 'table[tuiTable][tuiDirectionOrder]',
|
|
208
|
+
}]
|
|
209
|
+
}], ctorParameters: function () {
|
|
210
|
+
return [{ type: TuiTableDirective, decorators: [{
|
|
211
|
+
type: Inject,
|
|
212
|
+
args: [TuiTableDirective]
|
|
213
|
+
}] }];
|
|
214
|
+
}, propDecorators: { directionOrder: [{
|
|
215
|
+
type: Input
|
|
216
|
+
}], directionOrderChange: [{
|
|
217
|
+
type: Output
|
|
218
|
+
}] } });
|
|
219
|
+
|
|
220
|
+
class TuiHeadDirective {
|
|
221
|
+
constructor(template) {
|
|
222
|
+
this.template = template;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
TuiHeadDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiHeadDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
226
|
+
TuiHeadDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiHeadDirective, selector: "[tuiHead]", inputs: { tuiHead: "tuiHead" }, ngImport: i0 });
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiHeadDirective, decorators: [{
|
|
228
|
+
type: Directive,
|
|
229
|
+
args: [{
|
|
230
|
+
selector: '[tuiHead]',
|
|
231
|
+
}]
|
|
232
|
+
}], ctorParameters: function () {
|
|
233
|
+
return [{ type: i0.TemplateRef, decorators: [{
|
|
234
|
+
type: Inject,
|
|
235
|
+
args: [TemplateRef]
|
|
236
|
+
}] }];
|
|
237
|
+
}, propDecorators: { tuiHead: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}] } });
|
|
240
|
+
|
|
241
|
+
class TuiResizedDirective {
|
|
242
|
+
constructor(doc, el, parentRef) {
|
|
243
|
+
this.doc = doc;
|
|
244
|
+
this.el = el;
|
|
245
|
+
this.parentRef = parentRef;
|
|
246
|
+
this.tuiResized = tuiTypedFromEvent(this.el.nativeElement, 'mousedown').pipe(tuiPreventDefault(), switchMap(() => {
|
|
247
|
+
const { width, right } = this.parentRef.nativeElement.getBoundingClientRect();
|
|
248
|
+
return tuiTypedFromEvent(this.doc, 'mousemove').pipe(distinctUntilChanged(), map(({ clientX }) => width + clientX - right), takeUntil(tuiTypedFromEvent(this.doc, 'mouseup')));
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
TuiResizedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiResizedDirective, deps: [{ token: DOCUMENT }, { token: ElementRef }, { token: TUI_ELEMENT_REF }], target: i0.ɵɵFactoryTarget.Directive });
|
|
253
|
+
TuiResizedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiResizedDirective, selector: "[tuiResized]", outputs: { tuiResized: "tuiResized" }, ngImport: i0 });
|
|
254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiResizedDirective, decorators: [{
|
|
255
|
+
type: Directive,
|
|
256
|
+
args: [{
|
|
257
|
+
selector: '[tuiResized]',
|
|
258
|
+
}]
|
|
259
|
+
}], ctorParameters: function () {
|
|
260
|
+
return [{ type: Document, decorators: [{
|
|
261
|
+
type: Inject,
|
|
262
|
+
args: [DOCUMENT]
|
|
263
|
+
}] }, { type: i0.ElementRef, decorators: [{
|
|
264
|
+
type: Inject,
|
|
265
|
+
args: [ElementRef]
|
|
266
|
+
}] }, { type: i0.ElementRef, decorators: [{
|
|
267
|
+
type: Inject,
|
|
268
|
+
args: [TUI_ELEMENT_REF]
|
|
269
|
+
}] }];
|
|
270
|
+
}, propDecorators: { tuiResized: [{
|
|
271
|
+
type: Output
|
|
272
|
+
}] } });
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @deprecated use `*ngFor` + `tuiTableSort`-pipe instead.
|
|
276
|
+
* See example {@link https://taiga-ui.dev/components/table/Setup}
|
|
277
|
+
* ___
|
|
278
|
+
* TODO v4.0 delete it.
|
|
279
|
+
*/
|
|
280
|
+
class TuiRowDirective {
|
|
281
|
+
constructor(template) {
|
|
282
|
+
this.template = template;
|
|
283
|
+
this.tuiRowOf = [];
|
|
284
|
+
}
|
|
285
|
+
static ngTemplateContextGuard(_dir, _ctx) {
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
TuiRowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiRowDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
290
|
+
TuiRowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiRowDirective, selector: "ng-template[tuiRow]", inputs: { tuiRowOf: "tuiRowOf" }, ngImport: i0 });
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiRowDirective, decorators: [{
|
|
292
|
+
type: Directive,
|
|
293
|
+
args: [{
|
|
294
|
+
selector: 'ng-template[tuiRow]',
|
|
295
|
+
}]
|
|
296
|
+
}], ctorParameters: function () {
|
|
297
|
+
return [{ type: i0.TemplateRef, decorators: [{
|
|
298
|
+
type: Inject,
|
|
299
|
+
args: [TemplateRef]
|
|
300
|
+
}] }];
|
|
301
|
+
}, propDecorators: { tuiRowOf: [{
|
|
302
|
+
type: Input
|
|
303
|
+
}] } });
|
|
304
|
+
|
|
305
|
+
class TuiThComponent {
|
|
306
|
+
constructor(options, head, table) {
|
|
307
|
+
this.options = options;
|
|
308
|
+
this.head = head;
|
|
309
|
+
this.table = table;
|
|
310
|
+
this.sorter = this.head
|
|
311
|
+
? (a, b) => tuiDefaultSort(a[this.key], b[this.key])
|
|
312
|
+
: null;
|
|
313
|
+
this.resizable = this.options.resizable;
|
|
314
|
+
this.sticky = this.options.sticky;
|
|
315
|
+
this.width = null;
|
|
316
|
+
}
|
|
317
|
+
get key() {
|
|
318
|
+
if (!this.head) {
|
|
319
|
+
throw new TuiTableSortKeyException();
|
|
320
|
+
}
|
|
321
|
+
return this.head.tuiHead;
|
|
322
|
+
}
|
|
323
|
+
get isCurrent() {
|
|
324
|
+
return !!this.sorter && !!this.table && this.sorter === this.table.sorter;
|
|
325
|
+
}
|
|
326
|
+
get icon() {
|
|
327
|
+
var _a;
|
|
328
|
+
if (this.isCurrent) {
|
|
329
|
+
return ((_a = this.table) === null || _a === void 0 ? void 0 : _a.direction) === 1
|
|
330
|
+
? this.options.sortIcons.desc
|
|
331
|
+
: this.options.sortIcons.asc;
|
|
332
|
+
}
|
|
333
|
+
return this.options.sortIcons.off;
|
|
334
|
+
}
|
|
335
|
+
updateSorterAndDirection() {
|
|
336
|
+
var _a;
|
|
337
|
+
(_a = this.table) === null || _a === void 0 ? void 0 : _a.updateSorterAndDirection(this.isCurrentAndAscDirection ? null : this.sorter);
|
|
338
|
+
}
|
|
339
|
+
onResized(width) {
|
|
340
|
+
this.width = width;
|
|
341
|
+
}
|
|
342
|
+
get isCurrentAndAscDirection() {
|
|
343
|
+
var _a, _b;
|
|
344
|
+
return this.sorter === ((_a = this.table) === null || _a === void 0 ? void 0 : _a.sorter) && ((_b = this.table) === null || _b === void 0 ? void 0 : _b.direction) === -1;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
TuiThComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiThComponent, deps: [{ token: TUI_TABLE_OPTIONS }, { token: TuiHeadDirective, optional: true }, { token: forwardRef(() => TuiTableDirective), optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
348
|
+
TuiThComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TuiThComponent, selector: "th[tuiTh]", inputs: { sorter: "sorter", resizable: "resizable", sticky: "sticky" }, host: { properties: { "class._sticky": "this.sticky", "style.width.px": "this.width" } }, providers: [
|
|
349
|
+
{
|
|
350
|
+
provide: TUI_ELEMENT_REF,
|
|
351
|
+
useExisting: ElementRef,
|
|
352
|
+
},
|
|
353
|
+
], ngImport: i0, template: "<button\n *ngIf=\"sorter && table; else content\"\n type=\"button\"\n class=\"t-sort\"\n [class.t-sort_sorted]=\"isCurrent\"\n (click)=\"updateSorterAndDirection()\"\n>\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n {{ table.change$ | async }}\n <tui-svg\n class=\"t-sort-icon\"\n [src]=\"icon\"\n ></tui-svg>\n</button>\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n<div\n *ngIf=\"resizable\"\n class=\"t-bar\"\n (tuiResized)=\"onResized($event)\"\n></div>\n", styles: [":host{transition-property:box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;top:0;height:var(--tui-height-m);font:var(--tui-font-text-s);text-align:left;font-weight:700;color:var(--tui-text-02);background:var(--tui-base-01);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-base-04);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-left:none}:host._sticky,:host-context(._stuck) :host._sticky{position:-webkit-sticky;position:sticky;z-index:30}: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;width:.3125rem;pointer-events:none;background:rgba(237,237,237,.7);opacity:0}:host-context(._stuck) :host{z-index:20}:host-context(tr:not(:first-child)){border-top:none}:host-context(table[data-size=\"l\"]){height:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:700;padding:0 1rem}:host-context(thead[tuiThead]){position:-webkit-sticky;position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context(table[data-mode=\"onDark\"]):after{background:rgba(60,60,60,.9)}:host-context(table[data-mode=\"onDark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context(table[data-mode=\"onDark\"] 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;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;display:inline-flex;flex-direction:inherit;align-items:center;outline:none;font-weight:700;cursor:pointer}.t-sort_sorted{color:var(--tui-text-01)}.t-sort:focus-visible{background:var(--tui-selection)}.t-sort:hover{color:var(--tui-text-01)}.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;width:3px;justify-self:flex-end;border-left:2px solid transparent;background:var(--tui-support-12);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "directive", type: TuiResizedDirective, selector: "[tuiResized]", outputs: ["tuiResized"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiThComponent, decorators: [{
|
|
355
|
+
type: Component,
|
|
356
|
+
args: [{ selector: 'th[tuiTh]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
357
|
+
{
|
|
358
|
+
provide: TUI_ELEMENT_REF,
|
|
359
|
+
useExisting: ElementRef,
|
|
360
|
+
},
|
|
361
|
+
], template: "<button\n *ngIf=\"sorter && table; else content\"\n type=\"button\"\n class=\"t-sort\"\n [class.t-sort_sorted]=\"isCurrent\"\n (click)=\"updateSorterAndDirection()\"\n>\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n {{ table.change$ | async }}\n <tui-svg\n class=\"t-sort-icon\"\n [src]=\"icon\"\n ></tui-svg>\n</button>\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n<div\n *ngIf=\"resizable\"\n class=\"t-bar\"\n (tuiResized)=\"onResized($event)\"\n></div>\n", styles: [":host{transition-property:box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;top:0;height:var(--tui-height-m);font:var(--tui-font-text-s);text-align:left;font-weight:700;color:var(--tui-text-02);background:var(--tui-base-01);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-base-04);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-left:none}:host._sticky,:host-context(._stuck) :host._sticky{position:-webkit-sticky;position:sticky;z-index:30}: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;width:.3125rem;pointer-events:none;background:rgba(237,237,237,.7);opacity:0}:host-context(._stuck) :host{z-index:20}:host-context(tr:not(:first-child)){border-top:none}:host-context(table[data-size=\"l\"]){height:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:700;padding:0 1rem}:host-context(thead[tuiThead]){position:-webkit-sticky;position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context(table[data-mode=\"onDark\"]):after{background:rgba(60,60,60,.9)}:host-context(table[data-mode=\"onDark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context(table[data-mode=\"onDark\"] 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;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;display:inline-flex;flex-direction:inherit;align-items:center;outline:none;font-weight:700;cursor:pointer}.t-sort_sorted{color:var(--tui-text-01)}.t-sort:focus-visible{background:var(--tui-selection)}.t-sort:hover{color:var(--tui-text-01)}.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;width:3px;justify-self:flex-end;border-left:2px solid transparent;background:var(--tui-support-12);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}\n"] }]
|
|
362
|
+
}], ctorParameters: function () {
|
|
363
|
+
return [{ type: undefined, decorators: [{
|
|
364
|
+
type: Inject,
|
|
365
|
+
args: [TUI_TABLE_OPTIONS]
|
|
366
|
+
}] }, { type: TuiHeadDirective, decorators: [{
|
|
367
|
+
type: Optional
|
|
368
|
+
}, {
|
|
369
|
+
type: Inject,
|
|
370
|
+
args: [TuiHeadDirective]
|
|
371
|
+
}] }, { type: TuiTableDirective, decorators: [{
|
|
372
|
+
type: Optional
|
|
373
|
+
}, {
|
|
374
|
+
type: Inject,
|
|
375
|
+
args: [forwardRef(() => TuiTableDirective)]
|
|
376
|
+
}] }];
|
|
377
|
+
}, propDecorators: { sorter: [{
|
|
378
|
+
type: Input
|
|
379
|
+
}], resizable: [{
|
|
380
|
+
type: Input
|
|
381
|
+
}], sticky: [{
|
|
382
|
+
type: Input
|
|
383
|
+
}, {
|
|
384
|
+
type: HostBinding,
|
|
385
|
+
args: ['class._sticky']
|
|
386
|
+
}], width: [{
|
|
387
|
+
type: HostBinding,
|
|
388
|
+
args: ['style.width.px']
|
|
389
|
+
}] } });
|
|
390
|
+
|
|
391
|
+
class TuiSortableDirective {
|
|
392
|
+
constructor(sortBy, table, th) {
|
|
393
|
+
this.sortBy = sortBy;
|
|
394
|
+
this.table = table;
|
|
395
|
+
this.th = th;
|
|
396
|
+
this.sorter = () => 0;
|
|
397
|
+
}
|
|
398
|
+
get key() {
|
|
399
|
+
return this.th.key;
|
|
400
|
+
}
|
|
401
|
+
ngOnInit() {
|
|
402
|
+
this.sorter = this.match ? this.table.sorter : this.sorter;
|
|
403
|
+
this.th.sorter = this.sorter;
|
|
404
|
+
}
|
|
405
|
+
check() {
|
|
406
|
+
if (this.match && this.table.sorter !== this.sorter) {
|
|
407
|
+
this.table.updateSorter(this.sorter);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
get match() {
|
|
411
|
+
return this.sortBy.tuiSortBy === this.key;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
TuiSortableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiSortableDirective, deps: [{ token: forwardRef(() => TuiSortByDirective) }, { token: TuiTableDirective }, { token: TuiThComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
415
|
+
TuiSortableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiSortableDirective, selector: "th[tuiTh][tuiSortable]", ngImport: i0 });
|
|
416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiSortableDirective, decorators: [{
|
|
417
|
+
type: Directive,
|
|
418
|
+
args: [{
|
|
419
|
+
selector: 'th[tuiTh][tuiSortable]',
|
|
420
|
+
}]
|
|
421
|
+
}], ctorParameters: function () {
|
|
422
|
+
return [{ type: TuiSortByDirective, decorators: [{
|
|
423
|
+
type: Inject,
|
|
424
|
+
args: [forwardRef(() => TuiSortByDirective)]
|
|
425
|
+
}] }, { type: TuiTableDirective, decorators: [{
|
|
426
|
+
type: Inject,
|
|
427
|
+
args: [TuiTableDirective]
|
|
428
|
+
}] }, { type: TuiThComponent, decorators: [{
|
|
429
|
+
type: Inject,
|
|
430
|
+
args: [TuiThComponent]
|
|
431
|
+
}] }];
|
|
432
|
+
} });
|
|
433
|
+
|
|
434
|
+
class TuiSortByDirective {
|
|
435
|
+
set sortBy(sortBy) {
|
|
436
|
+
this.tuiSortBy = sortBy;
|
|
437
|
+
this.checkSortables();
|
|
438
|
+
}
|
|
439
|
+
constructor(table) {
|
|
440
|
+
this.table = table;
|
|
441
|
+
this.sortables = EMPTY_QUERY;
|
|
442
|
+
this.tuiSortByChange = this.table.sorterChange.pipe(
|
|
443
|
+
// delay is for getting actual ContentChildren (sortables) https://github.com/angular/angular/issues/38976
|
|
444
|
+
delay(0), filter(() => !!this.sortables.length), map(sorter => this.getKey(sorter)));
|
|
445
|
+
this.tuiSortBy = null;
|
|
446
|
+
}
|
|
447
|
+
checkSortables() {
|
|
448
|
+
this.sortables.forEach(s => s.check());
|
|
449
|
+
}
|
|
450
|
+
getKey(sorter) {
|
|
451
|
+
var _a;
|
|
452
|
+
return ((_a = this.sortables.find(s => s.sorter === sorter)) === null || _a === void 0 ? void 0 : _a.key) || null;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
TuiSortByDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiSortByDirective, deps: [{ token: TuiTableDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
456
|
+
TuiSortByDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiSortByDirective, selector: "table[tuiTable][tuiSortBy]", inputs: { sortBy: ["tuiSortBy", "sortBy"] }, outputs: { tuiSortByChange: "tuiSortByChange" }, queries: [{ propertyName: "sortables", predicate: TuiSortableDirective, descendants: true }], ngImport: i0 });
|
|
457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiSortByDirective, decorators: [{
|
|
458
|
+
type: Directive,
|
|
459
|
+
args: [{
|
|
460
|
+
selector: 'table[tuiTable][tuiSortBy]',
|
|
461
|
+
}]
|
|
462
|
+
}], ctorParameters: function () {
|
|
463
|
+
return [{ type: TuiTableDirective, decorators: [{
|
|
464
|
+
type: Inject,
|
|
465
|
+
args: [TuiTableDirective]
|
|
466
|
+
}] }];
|
|
467
|
+
}, propDecorators: { sortables: [{
|
|
468
|
+
type: ContentChildren,
|
|
469
|
+
args: [TuiSortableDirective, { descendants: true }]
|
|
470
|
+
}], sortBy: [{
|
|
471
|
+
type: Input,
|
|
472
|
+
args: ['tuiSortBy']
|
|
473
|
+
}], tuiSortByChange: [{
|
|
474
|
+
type: Output
|
|
475
|
+
}] } });
|
|
476
|
+
|
|
477
|
+
class TuiTheadDirective {
|
|
478
|
+
constructor(stuck$) {
|
|
479
|
+
this.stuck$ = stuck$;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
TuiTheadDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTheadDirective, deps: [{ token: TUI_STUCK }], target: i0.ɵɵFactoryTarget.Directive });
|
|
483
|
+
TuiTheadDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TuiTheadDirective, selector: "thead[tuiThead]", host: { listeners: { "$.class._stuck": "stuck$" } }, providers: [
|
|
484
|
+
TUI_STUCK_PROVIDER,
|
|
485
|
+
IntersectionObserverService,
|
|
486
|
+
{
|
|
487
|
+
provide: INTERSECTION_ROOT_MARGIN,
|
|
488
|
+
useValue: '0px 10000px 10000px 10000px',
|
|
489
|
+
},
|
|
490
|
+
], ngImport: i0 });
|
|
491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTheadDirective, decorators: [{
|
|
492
|
+
type: Directive,
|
|
493
|
+
args: [{
|
|
494
|
+
selector: 'thead[tuiThead]',
|
|
495
|
+
providers: [
|
|
496
|
+
TUI_STUCK_PROVIDER,
|
|
497
|
+
IntersectionObserverService,
|
|
498
|
+
{
|
|
499
|
+
provide: INTERSECTION_ROOT_MARGIN,
|
|
500
|
+
useValue: '0px 10000px 10000px 10000px',
|
|
501
|
+
},
|
|
502
|
+
],
|
|
503
|
+
host: {
|
|
504
|
+
'($.class._stuck)': 'stuck$',
|
|
505
|
+
},
|
|
506
|
+
}]
|
|
507
|
+
}], ctorParameters: function () {
|
|
508
|
+
return [{ type: i1.Observable, decorators: [{
|
|
509
|
+
type: Inject,
|
|
510
|
+
args: [TUI_STUCK]
|
|
511
|
+
}] }];
|
|
512
|
+
} });
|
|
513
|
+
|
|
514
|
+
class TuiTableSortPipe {
|
|
515
|
+
constructor(table) {
|
|
516
|
+
this.table = table;
|
|
517
|
+
}
|
|
518
|
+
transform(data) {
|
|
519
|
+
return this.sort(data, this.table.sorter, this.table.direction);
|
|
520
|
+
}
|
|
521
|
+
sort(data, sorter, direction) {
|
|
522
|
+
return [...data].sort((a, b) => direction * sorter(a, b));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
TuiTableSortPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTableSortPipe, deps: [{ token: TuiTableDirective }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
526
|
+
TuiTableSortPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TuiTableSortPipe, name: "tuiTableSort", pure: false });
|
|
527
|
+
__decorate([
|
|
528
|
+
tuiPure
|
|
529
|
+
], TuiTableSortPipe.prototype, "sort", null);
|
|
530
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTableSortPipe, decorators: [{
|
|
531
|
+
type: Pipe,
|
|
532
|
+
args: [{
|
|
533
|
+
name: `tuiTableSort`,
|
|
534
|
+
pure: false,
|
|
535
|
+
}]
|
|
536
|
+
}], ctorParameters: function () {
|
|
537
|
+
return [{ type: TuiTableDirective, decorators: [{
|
|
538
|
+
type: Inject,
|
|
539
|
+
args: [TuiTableDirective]
|
|
540
|
+
}] }];
|
|
541
|
+
}, propDecorators: { sort: [] } });
|
|
542
|
+
|
|
543
|
+
const TUI_TABLE_PROVIDER = [
|
|
544
|
+
TuiDestroyService,
|
|
545
|
+
TuiTableSortPipe,
|
|
546
|
+
{
|
|
547
|
+
provide: TuiTableDirective,
|
|
548
|
+
deps: [[new SkipSelf(), TuiTableDirective], ChangeDetectorRef, TuiDestroyService],
|
|
549
|
+
useFactory: tuiWatchedControllerFactory,
|
|
550
|
+
},
|
|
551
|
+
];
|
|
552
|
+
|
|
553
|
+
class TuiTdComponent {
|
|
554
|
+
}
|
|
555
|
+
TuiTdComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTdComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
556
|
+
TuiTdComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TuiTdComponent, selector: "th[tuiTd], td[tuiTd]", host: { properties: { "class._editable": "this.control" } }, queries: [{ propertyName: "control", first: true, predicate: NgControl, descendants: true }], ngImport: i0, template: `
|
|
557
|
+
<ng-content></ng-content>
|
|
558
|
+
`, isInline: true, styles: [":host{position:relative;height:var(--tui-height-m);font:var(--tui-font-text-s);text-align:left;padding:0 .75rem;background:var(--tui-base-01);border:1px solid var(--tui-base-04);border-top: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-left:none}:host._editable:focus-within{z-index:1}:host._editable{padding:0;vertical-align:top}:host(th){position:-webkit-sticky;position:sticky;z-index:1}: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%;width:.3125rem;pointer-events:none;background:rgba(237,237,237,.7);opacity:0}:host(th):focus-within:not(:disabled){z-index:11}:host-context(table[data-mode=\"onDark\"]):after{background:rgba(60,60,60,.9)}:host-context(table._stuck){z-index:10}:host-context(table._stuck):last-of-type:after{opacity:1}:host-context(table[data-size=\"l\"]){font:var(--tui-font-text-m);height:var(--tui-height-l);padding-left:1rem;padding-right:1rem}:host-context(table[data-size=\"l\"])._editable{padding:0}:host(td):focus-within{z-index:1}:host(td):not(:focus-within){z-index:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTdComponent, decorators: [{
|
|
560
|
+
type: Component,
|
|
561
|
+
args: [{ selector: 'th[tuiTd], td[tuiTd]', template: `
|
|
562
|
+
<ng-content></ng-content>
|
|
563
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{position:relative;height:var(--tui-height-m);font:var(--tui-font-text-s);text-align:left;padding:0 .75rem;background:var(--tui-base-01);border:1px solid var(--tui-base-04);border-top: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-left:none}:host._editable:focus-within{z-index:1}:host._editable{padding:0;vertical-align:top}:host(th){position:-webkit-sticky;position:sticky;z-index:1}: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%;width:.3125rem;pointer-events:none;background:rgba(237,237,237,.7);opacity:0}:host(th):focus-within:not(:disabled){z-index:11}:host-context(table[data-mode=\"onDark\"]):after{background:rgba(60,60,60,.9)}:host-context(table._stuck){z-index:10}:host-context(table._stuck):last-of-type:after{opacity:1}:host-context(table[data-size=\"l\"]){font:var(--tui-font-text-m);height:var(--tui-height-l);padding-left:1rem;padding-right:1rem}:host-context(table[data-size=\"l\"])._editable{padding:0}:host(td):focus-within{z-index:1}:host(td):not(:focus-within){z-index:0}\n"] }]
|
|
564
|
+
}], propDecorators: { control: [{
|
|
565
|
+
type: HostBinding,
|
|
566
|
+
args: ['class._editable']
|
|
567
|
+
}, {
|
|
568
|
+
type: ContentChild,
|
|
569
|
+
args: [NgControl]
|
|
570
|
+
}] } });
|
|
571
|
+
|
|
572
|
+
class TuiTrComponent {
|
|
573
|
+
constructor(table, body) {
|
|
574
|
+
this.table = table;
|
|
575
|
+
this.body = body;
|
|
576
|
+
this.cells = EMPTY_QUERY;
|
|
577
|
+
this.contentReady$ = new ReplaySubject(1);
|
|
578
|
+
this.cells$ = this.contentReady$.pipe(switchMap(() => tuiQueryListChanges(this.cells)), map(cells => cells.reduce((record, item) => (Object.assign(Object.assign({}, record), { [item.tuiCell]: item })), {})));
|
|
579
|
+
this.item$ = this.contentReady$.pipe(switchMap(() => tuiQueryListChanges(this.body.rows)), map(rows =>
|
|
580
|
+
/**
|
|
581
|
+
* TODO v4.0 replace `this.body.sorted` with `this.body.data` (don't forget to drop `sorted`-getter).
|
|
582
|
+
*/
|
|
583
|
+
this.body.sorted[rows.findIndex(row => row === this)]));
|
|
584
|
+
}
|
|
585
|
+
ngAfterContentInit() {
|
|
586
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
587
|
+
yield Promise.resolve();
|
|
588
|
+
this.contentReady$.next(true);
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
TuiTrComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTrComponent, deps: [{ token: forwardRef(() => TuiTableDirective) }, { token: forwardRef(() => TuiTbodyComponent) }], target: i0.ɵɵFactoryTarget.Component });
|
|
593
|
+
TuiTrComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TuiTrComponent, selector: "tr[tuiTr]", providers: [TUI_TABLE_PROVIDER], queries: [{ propertyName: "cells", predicate: i0.forwardRef(function () { return TuiCellDirective; }) }], ngImport: i0, template: "<ng-container *ngIf=\"cells$ | async as items\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"items[key]?.template || plain\"\n >\n <ng-template #plain>\n <td\n *ngIf=\"item$ | async as item\"\n tuiTd\n >\n {{ item[key] }}\n </td>\n </ng-template>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiTdComponent, selector: "th[tuiTd], td[tuiTd]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
594
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTrComponent, decorators: [{
|
|
595
|
+
type: Component,
|
|
596
|
+
args: [{ selector: 'tr[tuiTr]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TUI_TABLE_PROVIDER], template: "<ng-container *ngIf=\"cells$ | async as items\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"items[key]?.template || plain\"\n >\n <ng-template #plain>\n <td\n *ngIf=\"item$ | async as item\"\n tuiTd\n >\n {{ item[key] }}\n </td>\n </ng-template>\n </ng-container>\n</ng-container>\n" }]
|
|
597
|
+
}], ctorParameters: function () {
|
|
598
|
+
return [{ type: TuiTableDirective, decorators: [{
|
|
599
|
+
type: Inject,
|
|
600
|
+
args: [forwardRef(() => TuiTableDirective)]
|
|
601
|
+
}] }, { type: TuiTbodyComponent, decorators: [{
|
|
602
|
+
type: Inject,
|
|
603
|
+
args: [forwardRef(() => TuiTbodyComponent)]
|
|
604
|
+
}] }];
|
|
605
|
+
}, propDecorators: { cells: [{
|
|
606
|
+
type: ContentChildren,
|
|
607
|
+
args: [forwardRef(() => TuiCellDirective)]
|
|
608
|
+
}] } });
|
|
609
|
+
|
|
610
|
+
class TuiTbodyComponent {
|
|
611
|
+
constructor(pipe, options, arrowOptions, table) {
|
|
612
|
+
this.pipe = pipe;
|
|
613
|
+
this.options = options;
|
|
614
|
+
this.arrowOptions = arrowOptions;
|
|
615
|
+
this.table = table;
|
|
616
|
+
this.data = [];
|
|
617
|
+
this.open = this.options.open;
|
|
618
|
+
this.openChange = new EventEmitter();
|
|
619
|
+
this.rows = EMPTY_QUERY;
|
|
620
|
+
this.toContext = ($implicit, index) => ({ $implicit, index });
|
|
621
|
+
}
|
|
622
|
+
get sorted() {
|
|
623
|
+
return this.pipe.transform(this.data);
|
|
624
|
+
}
|
|
625
|
+
onClick() {
|
|
626
|
+
this.open = !this.open;
|
|
627
|
+
this.openChange.emit(this.open);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
TuiTbodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTbodyComponent, deps: [{ token: TuiTableSortPipe }, { token: TUI_TABLE_OPTIONS }, { token: TUI_ARROW_OPTIONS }, { token: forwardRef(() => TuiTableDirective) }], target: i0.ɵɵFactoryTarget.Component });
|
|
631
|
+
TuiTbodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TuiTbodyComponent, selector: "tbody[tuiTbody]", inputs: { data: "data", heading: "heading", open: "open" }, outputs: { openChange: "openChange" }, providers: TUI_TABLE_PROVIDER, queries: [{ propertyName: "row", first: true, predicate: i0.forwardRef(function () { return TuiRowDirective; }), descendants: true }, { propertyName: "rows", predicate: i0.forwardRef(function () { return TuiTrComponent; }) }], ngImport: i0, template: "<tr *ngIf=\"heading\">\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-svg\n class=\"t-chevron\"\n [class.t-chevron_rotated]=\"open\"\n [src]=\"arrowOptions.iconLarge\"\n ></tui-svg>\n </button>\n </th>\n</tr>\n<ng-container *ngIf=\"open\">\n <ng-content></ng-content>\n</ng-container>\n<ng-container *ngIf=\"open && row\">\n <ng-container\n *ngFor=\"let item of sorted; let index = index\"\n [ngTemplateOutlet]=\"row.template\"\n [ngTemplateOutletContext]=\"item | tuiMapper: toContext : index\"\n ></ng-container>\n</ng-container>\n", styles: [":host{border-color:var(--tui-base-04)}:host tr{border-color:inherit}.t-expand{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;display:flex;width:100%;height: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-selection)}.t-expand:before,.t-expand:after{content:\"\";position:-webkit-sticky;position:sticky;height:100%;border-left: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;height:var(--tui-height-m);font:var(--tui-font-text-s);padding:0;background:var(--tui-base-02);border-bottom:1px solid var(--tui-base-04);border-color:inherit}.t-heading:hover{background:var(--tui-base-03)}:host-context(table[data-size=\"l\"]) .t-heading{font:var(--tui-font-text-m);height:var(--tui-height-l)}.t-name{position:-webkit-sticky;position:sticky;left:.75rem;display:inline-block}:host-context(table[data-size=\"l\"]) .t-name{left:1rem}.t-chevron{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:-webkit-sticky;position:sticky;right:.75rem;margin:0 .6875rem 0 auto}.t-chevron_rotated{transform:rotate(180deg)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$1.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: i2.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "pipe", type: i4.TuiMapperPipe, name: "tuiMapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
632
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTbodyComponent, decorators: [{
|
|
633
|
+
type: Component,
|
|
634
|
+
args: [{ selector: 'tbody[tuiTbody]', changeDetection: ChangeDetectionStrategy.OnPush, providers: TUI_TABLE_PROVIDER, template: "<tr *ngIf=\"heading\">\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-svg\n class=\"t-chevron\"\n [class.t-chevron_rotated]=\"open\"\n [src]=\"arrowOptions.iconLarge\"\n ></tui-svg>\n </button>\n </th>\n</tr>\n<ng-container *ngIf=\"open\">\n <ng-content></ng-content>\n</ng-container>\n<ng-container *ngIf=\"open && row\">\n <ng-container\n *ngFor=\"let item of sorted; let index = index\"\n [ngTemplateOutlet]=\"row.template\"\n [ngTemplateOutletContext]=\"item | tuiMapper: toContext : index\"\n ></ng-container>\n</ng-container>\n", styles: [":host{border-color:var(--tui-base-04)}:host tr{border-color:inherit}.t-expand{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;display:flex;width:100%;height: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-selection)}.t-expand:before,.t-expand:after{content:\"\";position:-webkit-sticky;position:sticky;height:100%;border-left: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;height:var(--tui-height-m);font:var(--tui-font-text-s);padding:0;background:var(--tui-base-02);border-bottom:1px solid var(--tui-base-04);border-color:inherit}.t-heading:hover{background:var(--tui-base-03)}:host-context(table[data-size=\"l\"]) .t-heading{font:var(--tui-font-text-m);height:var(--tui-height-l)}.t-name{position:-webkit-sticky;position:sticky;left:.75rem;display:inline-block}:host-context(table[data-size=\"l\"]) .t-name{left:1rem}.t-chevron{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:-webkit-sticky;position:sticky;right:.75rem;margin:0 .6875rem 0 auto}.t-chevron_rotated{transform:rotate(180deg)}\n"] }]
|
|
635
|
+
}], ctorParameters: function () {
|
|
636
|
+
return [{ type: TuiTableSortPipe, decorators: [{
|
|
637
|
+
type: Inject,
|
|
638
|
+
args: [TuiTableSortPipe]
|
|
639
|
+
}] }, { type: undefined, decorators: [{
|
|
640
|
+
type: Inject,
|
|
641
|
+
args: [TUI_TABLE_OPTIONS]
|
|
642
|
+
}] }, { type: undefined, decorators: [{
|
|
643
|
+
type: Inject,
|
|
644
|
+
args: [TUI_ARROW_OPTIONS]
|
|
645
|
+
}] }, { type: TuiTableDirective, decorators: [{
|
|
646
|
+
type: Inject,
|
|
647
|
+
args: [forwardRef(() => TuiTableDirective)]
|
|
648
|
+
}] }];
|
|
649
|
+
}, propDecorators: { data: [{
|
|
650
|
+
type: Input
|
|
651
|
+
}], heading: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], open: [{
|
|
654
|
+
type: Input
|
|
655
|
+
}], openChange: [{
|
|
656
|
+
type: Output
|
|
657
|
+
}], row: [{
|
|
658
|
+
type: ContentChild,
|
|
659
|
+
args: [forwardRef(() => TuiRowDirective)]
|
|
660
|
+
}], rows: [{
|
|
661
|
+
type: ContentChildren,
|
|
662
|
+
args: [forwardRef(() => TuiTrComponent)]
|
|
663
|
+
}] } });
|
|
664
|
+
|
|
665
|
+
class TuiThGroupComponent {
|
|
666
|
+
constructor(table) {
|
|
667
|
+
this.table = table;
|
|
668
|
+
this.heads = EMPTY_QUERY;
|
|
669
|
+
this.heads$ = null;
|
|
670
|
+
}
|
|
671
|
+
ngAfterContentInit() {
|
|
672
|
+
this.heads$ = this.heads.changes.pipe(startWith(null), map(() => this.heads.reduce((record, item) => (Object.assign(Object.assign({}, record), { [item.tuiHead]: item })), {})));
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
TuiThGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiThGroupComponent, deps: [{ token: forwardRef(() => TuiTableDirective) }], target: i0.ɵɵFactoryTarget.Component });
|
|
676
|
+
TuiThGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TuiThGroupComponent, selector: "tr[tuiThGroup]", providers: [TUI_TABLE_PROVIDER], queries: [{ propertyName: "th", first: true, predicate: i0.forwardRef(function () { return TuiThComponent; }), descendants: true }, { propertyName: "heads", predicate: i0.forwardRef(function () { return TuiHeadDirective; }) }], ngImport: i0, template: "<ng-content></ng-content>\n<ng-container *ngIf=\"heads$ | async as headings\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"headings[key.toString()]?.template || plain\"\n >\n <ng-template #plain>\n <th\n *ngIf=\"!th && !heads.length\"\n tuiTh\n >\n {{ key.toString() }}\n </th>\n </ng-template>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiThComponent, selector: "th[tuiTh]", inputs: ["sorter", "resizable", "sticky"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiThGroupComponent, decorators: [{
|
|
678
|
+
type: Component,
|
|
679
|
+
args: [{ selector: 'tr[tuiThGroup]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TUI_TABLE_PROVIDER], template: "<ng-content></ng-content>\n<ng-container *ngIf=\"heads$ | async as headings\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"headings[key.toString()]?.template || plain\"\n >\n <ng-template #plain>\n <th\n *ngIf=\"!th && !heads.length\"\n tuiTh\n >\n {{ key.toString() }}\n </th>\n </ng-template>\n </ng-container>\n</ng-container>\n" }]
|
|
680
|
+
}], ctorParameters: function () {
|
|
681
|
+
return [{ type: TuiTableDirective, decorators: [{
|
|
682
|
+
type: Inject,
|
|
683
|
+
args: [forwardRef(() => TuiTableDirective)]
|
|
684
|
+
}] }];
|
|
685
|
+
}, propDecorators: { th: [{
|
|
686
|
+
type: ContentChild,
|
|
687
|
+
args: [forwardRef(() => TuiThComponent)]
|
|
688
|
+
}], heads: [{
|
|
689
|
+
type: ContentChildren,
|
|
690
|
+
args: [forwardRef(() => TuiHeadDirective)]
|
|
691
|
+
}] } });
|
|
692
|
+
|
|
693
|
+
class TuiTableModule {
|
|
694
|
+
}
|
|
695
|
+
TuiTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
696
|
+
TuiTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TuiTableModule, declarations: [TuiTableDirective,
|
|
697
|
+
TuiTbodyComponent,
|
|
698
|
+
TuiThGroupComponent,
|
|
699
|
+
TuiThComponent,
|
|
700
|
+
TuiTdComponent,
|
|
701
|
+
TuiTrComponent,
|
|
702
|
+
TuiCellDirective,
|
|
703
|
+
TuiHeadDirective,
|
|
704
|
+
TuiRowDirective,
|
|
705
|
+
TuiSortByDirective,
|
|
706
|
+
TuiSortableDirective,
|
|
707
|
+
TuiTheadDirective,
|
|
708
|
+
TuiResizedDirective,
|
|
709
|
+
TuiTableSortPipe,
|
|
710
|
+
TuiDirectionOrderDirective], imports: [CommonModule, PolymorpheusModule, TuiMapperPipeModule, TuiSvgModule], exports: [TuiTableDirective,
|
|
711
|
+
TuiTbodyComponent,
|
|
712
|
+
TuiThGroupComponent,
|
|
713
|
+
TuiThComponent,
|
|
714
|
+
TuiTdComponent,
|
|
715
|
+
TuiTrComponent,
|
|
716
|
+
TuiCellDirective,
|
|
717
|
+
TuiHeadDirective,
|
|
718
|
+
TuiRowDirective,
|
|
719
|
+
TuiSortByDirective,
|
|
720
|
+
TuiSortableDirective,
|
|
721
|
+
TuiTheadDirective,
|
|
722
|
+
TuiTableSortPipe,
|
|
723
|
+
TuiDirectionOrderDirective] });
|
|
724
|
+
TuiTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTableModule, imports: [CommonModule, PolymorpheusModule, TuiMapperPipeModule, TuiSvgModule] });
|
|
725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TuiTableModule, decorators: [{
|
|
726
|
+
type: NgModule,
|
|
727
|
+
args: [{
|
|
728
|
+
imports: [CommonModule, PolymorpheusModule, TuiMapperPipeModule, TuiSvgModule],
|
|
729
|
+
declarations: [
|
|
730
|
+
TuiTableDirective,
|
|
731
|
+
TuiTbodyComponent,
|
|
732
|
+
TuiThGroupComponent,
|
|
733
|
+
TuiThComponent,
|
|
734
|
+
TuiTdComponent,
|
|
735
|
+
TuiTrComponent,
|
|
736
|
+
TuiCellDirective,
|
|
737
|
+
TuiHeadDirective,
|
|
738
|
+
TuiRowDirective,
|
|
739
|
+
TuiSortByDirective,
|
|
740
|
+
TuiSortableDirective,
|
|
741
|
+
TuiTheadDirective,
|
|
742
|
+
TuiResizedDirective,
|
|
743
|
+
TuiTableSortPipe,
|
|
744
|
+
TuiDirectionOrderDirective,
|
|
745
|
+
],
|
|
746
|
+
exports: [
|
|
747
|
+
TuiTableDirective,
|
|
748
|
+
TuiTbodyComponent,
|
|
749
|
+
TuiThGroupComponent,
|
|
750
|
+
TuiThComponent,
|
|
751
|
+
TuiTdComponent,
|
|
752
|
+
TuiTrComponent,
|
|
753
|
+
TuiCellDirective,
|
|
754
|
+
TuiHeadDirective,
|
|
755
|
+
TuiRowDirective,
|
|
756
|
+
TuiSortByDirective,
|
|
757
|
+
TuiSortableDirective,
|
|
758
|
+
TuiTheadDirective,
|
|
759
|
+
TuiTableSortPipe,
|
|
760
|
+
TuiDirectionOrderDirective,
|
|
761
|
+
],
|
|
762
|
+
}]
|
|
763
|
+
}] });
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Generated bundle index. Do not edit.
|
|
767
|
+
*/
|
|
768
|
+
|
|
769
|
+
export { TUI_STUCK, TUI_STUCK_PROVIDER, TUI_TABLE_DEFAULT_OPTIONS, TUI_TABLE_OPTIONS, TUI_TABLE_PROVIDER, TUI_TABLE_PROVIDERS, TuiCellDirective, TuiDirectionOrderDirective, TuiHeadDirective, TuiResizedDirective, TuiRowDirective, TuiSortByDirective, TuiSortableDirective, TuiTableDirective, TuiTableModule, TuiTableSortPipe, TuiTbodyComponent, TuiTdComponent, TuiThComponent, TuiThGroupComponent, TuiTheadDirective, TuiTrComponent, tuiTableOptionsProvider };
|
|
770
|
+
//# sourceMappingURL=taiga-ui-addon-table-components-table.mjs.map
|