@taiga-ui/addon-table 2.55.0 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/taiga-ui-addon-table-components-reorder.umd.js +423 -298
- package/bundles/taiga-ui-addon-table-components-reorder.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-components-table-pagination.umd.js +445 -313
- package/bundles/taiga-ui-addon-table-components-table-pagination.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-components-table.umd.js +859 -646
- package/bundles/taiga-ui-addon-table-components-table.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-components.umd.js +11 -25
- package/bundles/taiga-ui-addon-table-components.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-directives-table-filters.umd.js +453 -320
- package/bundles/taiga-ui-addon-table-directives-table-filters.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-directives.umd.js +5 -7
- package/bundles/taiga-ui-addon-table-directives.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-interfaces.umd.js +2 -2
- package/bundles/taiga-ui-addon-table-interfaces.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-tokens.umd.js +10 -6
- package/bundles/taiga-ui-addon-table-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-types.umd.js +2 -2
- package/bundles/taiga-ui-addon-table-types.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table-utils.umd.js +8 -4
- package/bundles/taiga-ui-addon-table-utils.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-table.umd.js +19 -21
- package/bundles/taiga-ui-addon-table.umd.js.map +1 -1
- package/components/index.d.ts +0 -1
- package/components/package.json +2 -5
- package/components/reorder/package.json +2 -5
- package/components/reorder/reorder.component.d.ts +3 -0
- package/components/reorder/reorder.module.d.ts +9 -0
- package/components/reorder/taiga-ui-addon-table-components-reorder.d.ts +1 -0
- package/components/table/directives/cell.directive.d.ts +3 -0
- package/components/table/directives/head.directive.d.ts +3 -0
- package/components/table/directives/resized.directive.d.ts +3 -0
- package/components/table/directives/row.directive.d.ts +3 -0
- package/components/table/directives/sort-by.directive.d.ts +3 -0
- package/components/table/directives/sortable.directive.d.ts +3 -0
- package/components/table/directives/table.directive.d.ts +5 -2
- package/components/table/directives/thead.directive.d.ts +3 -0
- package/components/table/package.json +2 -5
- package/components/table/pipes/table-sort.pipe.d.ts +3 -0
- package/components/table/providers/table.provider.d.ts +0 -2
- package/components/table/providers/table.providers.d.ts +0 -4
- package/components/table/table.module.d.ts +22 -0
- package/components/table/taiga-ui-addon-table-components-table.d.ts +1 -0
- package/components/table/tbody/tbody.component.d.ts +3 -0
- package/components/table/td/td.component.d.ts +3 -0
- package/components/table/th/th.component.d.ts +3 -0
- package/components/table/th-group/th-group.component.d.ts +3 -0
- package/components/table/tr/tr.component.d.ts +3 -0
- package/components/table-pagination/package.json +2 -5
- package/components/table-pagination/table-pagination.component.d.ts +3 -0
- package/components/table-pagination/table-pagination.module.d.ts +8 -0
- package/components/table-pagination/taiga-ui-addon-table-components-table-pagination.d.ts +1 -0
- package/components/taiga-ui-addon-table-components.d.ts +1 -0
- package/directives/package.json +2 -5
- package/directives/table-filters/generic-filter.directive.d.ts +3 -0
- package/directives/table-filters/package.json +2 -5
- package/directives/table-filters/table-filter.directive.d.ts +3 -0
- package/directives/table-filters/table-filters.directive.d.ts +3 -0
- package/directives/table-filters/table-filters.module.d.ts +8 -0
- package/directives/table-filters/table-filters.pipe.d.ts +3 -0
- package/directives/table-filters/taiga-ui-addon-table-directives-table-filters.d.ts +1 -0
- package/directives/taiga-ui-addon-table-directives.d.ts +1 -0
- package/esm2015/components/index.js +1 -2
- package/esm2015/components/reorder/index.js +1 -1
- package/esm2015/components/reorder/reorder.component.js +35 -29
- package/esm2015/components/reorder/reorder.module.js +26 -13
- package/esm2015/components/reorder/taiga-ui-addon-table-components-reorder.js +1 -1
- package/esm2015/components/table/directives/cell.directive.js +19 -16
- package/esm2015/components/table/directives/head.directive.js +17 -17
- package/esm2015/components/table/directives/resized.directive.js +25 -23
- package/esm2015/components/table/directives/row.directive.js +18 -15
- package/esm2015/components/table/directives/sort-by.directive.js +26 -23
- package/esm2015/components/table/directives/sortable.directive.js +24 -18
- package/esm2015/components/table/directives/table.directive.js +49 -40
- package/esm2015/components/table/directives/thead.directive.js +33 -25
- package/esm2015/components/table/index.js +1 -1
- package/esm2015/components/table/pipes/table-sort.pipe.js +18 -15
- package/esm2015/components/table/providers/stuck.provider.js +3 -3
- package/esm2015/components/table/providers/table.provider.js +3 -5
- package/esm2015/components/table/providers/table.providers.js +7 -11
- package/esm2015/components/table/table.module.js +69 -41
- package/esm2015/components/table/taiga-ui-addon-table-components-table.js +1 -1
- package/esm2015/components/table/tbody/tbody.component.js +44 -33
- package/esm2015/components/table/td/td.component.js +25 -17
- package/esm2015/components/table/th/th.component.js +55 -35
- package/esm2015/components/table/th-group/th-group.component.js +27 -23
- package/esm2015/components/table/tr/tr.component.js +28 -22
- package/esm2015/components/table-pagination/index.js +1 -1
- package/esm2015/components/table-pagination/table-pagination-options.js +2 -2
- package/esm2015/components/table-pagination/table-pagination.component.js +40 -31
- package/esm2015/components/table-pagination/table-pagination.module.js +30 -13
- package/esm2015/components/table-pagination/taiga-ui-addon-table-components-table-pagination.js +1 -1
- package/esm2015/components/taiga-ui-addon-table-components.js +1 -1
- package/esm2015/directives/index.js +1 -1
- package/esm2015/directives/table-filters/abstract-table-filter.js +1 -1
- package/esm2015/directives/table-filters/generic-filter.directive.js +25 -20
- package/esm2015/directives/table-filters/index.js +2 -1
- package/esm2015/directives/table-filters/table-filter.directive.js +32 -24
- package/esm2015/directives/table-filters/table-filter.js +2 -1
- package/esm2015/directives/table-filters/table-filters.directive.js +12 -10
- package/esm2015/directives/table-filters/table-filters.module.js +30 -21
- package/esm2015/directives/table-filters/table-filters.pipe.js +16 -14
- package/esm2015/directives/table-filters/taiga-ui-addon-table-directives-table-filters.js +1 -1
- package/esm2015/directives/taiga-ui-addon-table-directives.js +1 -1
- package/esm2015/index.js +2 -1
- package/esm2015/interfaces/index.js +2 -1
- package/esm2015/interfaces/row-context.js +2 -1
- package/esm2015/interfaces/taiga-ui-addon-table-interfaces.js +2 -1
- package/esm2015/taiga-ui-addon-table.js +1 -1
- package/esm2015/tokens/i18n.js +5 -5
- package/esm2015/tokens/index.js +1 -1
- package/esm2015/tokens/taiga-ui-addon-table-tokens.js +1 -1
- package/esm2015/types/comparator.js +2 -1
- package/esm2015/types/index.js +2 -1
- package/esm2015/types/taiga-ui-addon-table-types.js +2 -1
- package/esm2015/utils/default-sort.js +3 -3
- package/esm2015/utils/index.js +1 -1
- package/esm2015/utils/taiga-ui-addon-table-utils.js +1 -1
- package/fesm2015/taiga-ui-addon-table-components-reorder.js +60 -39
- package/fesm2015/taiga-ui-addon-table-components-reorder.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-components-table-pagination.js +69 -41
- package/fesm2015/taiga-ui-addon-table-components-table-pagination.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-components-table.js +435 -337
- package/fesm2015/taiga-ui-addon-table-components-table.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-components.js +0 -1
- package/fesm2015/taiga-ui-addon-table-components.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-directives-table-filters.js +104 -76
- package/fesm2015/taiga-ui-addon-table-directives-table-filters.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-directives.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-interfaces.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-tokens.js +4 -4
- package/fesm2015/taiga-ui-addon-table-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-types.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table-utils.js +2 -2
- package/fesm2015/taiga-ui-addon-table-utils.js.map +1 -1
- package/fesm2015/taiga-ui-addon-table.js +1 -0
- package/fesm2015/taiga-ui-addon-table.js.map +1 -1
- package/interfaces/package.json +2 -5
- package/interfaces/taiga-ui-addon-table-interfaces.d.ts +1 -0
- package/package.json +12 -15
- package/taiga-ui-addon-table.d.ts +1 -0
- package/tokens/package.json +2 -5
- package/tokens/taiga-ui-addon-table-tokens.d.ts +1 -0
- package/types/package.json +2 -5
- package/types/taiga-ui-addon-table-types.d.ts +1 -0
- package/utils/package.json +2 -5
- package/utils/taiga-ui-addon-table-utils.d.ts +1 -0
- package/bundles/taiga-ui-addon-table-components-reorder.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-components-reorder.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components-resizable-column.umd.js +0 -338
- package/bundles/taiga-ui-addon-table-components-resizable-column.umd.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components-resizable-column.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-components-resizable-column.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components-table-pagination.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-components-table-pagination.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components-table.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-components-table.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-components.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-components.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-directives-table-filters.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-directives-table-filters.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-directives.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-directives.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-interfaces.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-interfaces.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-tokens.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-tokens.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-types.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-types.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table-utils.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table-utils.umd.min.js.map +0 -1
- package/bundles/taiga-ui-addon-table.umd.min.js +0 -2
- package/bundles/taiga-ui-addon-table.umd.min.js.map +0 -1
- package/components/reorder/taiga-ui-addon-table-components-reorder.metadata.json +0 -1
- package/components/resizable-column/index.d.ts +0 -3
- package/components/resizable-column/package.json +0 -13
- package/components/resizable-column/resizable-column.component.d.ts +0 -5
- package/components/resizable-column/resizable-column.directive.d.ts +0 -9
- package/components/resizable-column/resizable-column.module.d.ts +0 -3
- package/components/resizable-column/taiga-ui-addon-table-components-resizable-column.d.ts +0 -4
- package/components/resizable-column/taiga-ui-addon-table-components-resizable-column.metadata.json +0 -1
- package/components/table/taiga-ui-addon-table-components-table.metadata.json +0 -1
- package/components/table-pagination/taiga-ui-addon-table-components-table-pagination.metadata.json +0 -1
- package/components/taiga-ui-addon-table-components.metadata.json +0 -1
- package/directives/table-filters/taiga-ui-addon-table-directives-table-filters.metadata.json +0 -1
- package/directives/taiga-ui-addon-table-directives.metadata.json +0 -1
- package/esm2015/components/resizable-column/index.js +0 -4
- package/esm2015/components/resizable-column/resizable-column.component.js +0 -30
- package/esm2015/components/resizable-column/resizable-column.directive.js +0 -37
- package/esm2015/components/resizable-column/resizable-column.module.js +0 -15
- package/esm2015/components/resizable-column/taiga-ui-addon-table-components-resizable-column.js +0 -5
- package/esm5/components/index.js +0 -5
- package/esm5/components/reorder/index.js +0 -3
- package/esm5/components/reorder/reorder.component.js +0 -72
- package/esm5/components/reorder/reorder.module.js +0 -27
- package/esm5/components/reorder/taiga-ui-addon-table-components-reorder.js +0 -5
- package/esm5/components/resizable-column/index.js +0 -4
- package/esm5/components/resizable-column/resizable-column.component.js +0 -31
- package/esm5/components/resizable-column/resizable-column.directive.js +0 -42
- package/esm5/components/resizable-column/resizable-column.module.js +0 -18
- package/esm5/components/resizable-column/taiga-ui-addon-table-components-resizable-column.js +0 -5
- package/esm5/components/table/directives/cell.directive.js +0 -25
- package/esm5/components/table/directives/head.directive.js +0 -22
- package/esm5/components/table/directives/resized.directive.js +0 -41
- package/esm5/components/table/directives/row.directive.js +0 -28
- package/esm5/components/table/directives/sort-by.directive.js +0 -41
- package/esm5/components/table/directives/sortable.directive.js +0 -52
- package/esm5/components/table/directives/table.directive.js +0 -88
- package/esm5/components/table/directives/thead.directive.js +0 -33
- package/esm5/components/table/index.js +0 -19
- package/esm5/components/table/pipes/table-sort.pipe.js +0 -31
- package/esm5/components/table/providers/stuck.provider.js +0 -21
- package/esm5/components/table/providers/table.provider.js +0 -17
- package/esm5/components/table/providers/table.providers.js +0 -48
- package/esm5/components/table/table.module.js +0 -63
- package/esm5/components/table/taiga-ui-addon-table-components-table.js +0 -5
- package/esm5/components/table/tbody/tbody.component.js +0 -70
- package/esm5/components/table/td/td.component.js +0 -22
- package/esm5/components/table/th/th.component.js +0 -88
- package/esm5/components/table/th-group/th-group.component.js +0 -42
- package/esm5/components/table/tr/tr.component.js +0 -45
- package/esm5/components/table-pagination/index.js +0 -4
- package/esm5/components/table-pagination/table-pagination-options.js +0 -17
- package/esm5/components/table-pagination/table-pagination.component.js +0 -113
- package/esm5/components/table-pagination/table-pagination.module.js +0 -28
- package/esm5/components/table-pagination/taiga-ui-addon-table-components-table-pagination.js +0 -5
- package/esm5/components/taiga-ui-addon-table-components.js +0 -5
- package/esm5/directives/index.js +0 -2
- package/esm5/directives/table-filters/abstract-table-filter.js +0 -7
- package/esm5/directives/table-filters/generic-filter.directive.js +0 -34
- package/esm5/directives/table-filters/index.js +0 -7
- package/esm5/directives/table-filters/table-filter.directive.js +0 -59
- package/esm5/directives/table-filters/table-filter.js +0 -1
- package/esm5/directives/table-filters/table-filters.directive.js +0 -39
- package/esm5/directives/table-filters/table-filters.module.js +0 -29
- package/esm5/directives/table-filters/table-filters.pipe.js +0 -23
- package/esm5/directives/table-filters/taiga-ui-addon-table-directives-table-filters.js +0 -5
- package/esm5/directives/taiga-ui-addon-table-directives.js +0 -5
- package/esm5/index.js +0 -5
- package/esm5/interfaces/index.js +0 -1
- package/esm5/interfaces/row-context.js +0 -1
- package/esm5/interfaces/taiga-ui-addon-table-interfaces.js +0 -4
- package/esm5/taiga-ui-addon-table.js +0 -5
- package/esm5/tokens/i18n.js +0 -9
- package/esm5/tokens/index.js +0 -2
- package/esm5/tokens/taiga-ui-addon-table-tokens.js +0 -5
- package/esm5/types/comparator.js +0 -1
- package/esm5/types/index.js +0 -1
- package/esm5/types/taiga-ui-addon-table-types.js +0 -4
- package/esm5/utils/default-sort.js +0 -18
- package/esm5/utils/index.js +0 -2
- package/esm5/utils/taiga-ui-addon-table-utils.js +0 -5
- package/fesm2015/taiga-ui-addon-table-components-resizable-column.js +0 -79
- package/fesm2015/taiga-ui-addon-table-components-resizable-column.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-components-reorder.js +0 -99
- package/fesm5/taiga-ui-addon-table-components-reorder.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-components-resizable-column.js +0 -88
- package/fesm5/taiga-ui-addon-table-components-resizable-column.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-components-table-pagination.js +0 -156
- package/fesm5/taiga-ui-addon-table-components-table-pagination.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-components-table.js +0 -669
- package/fesm5/taiga-ui-addon-table-components-table.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-components.js +0 -9
- package/fesm5/taiga-ui-addon-table-components.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-directives-table-filters.js +0 -174
- package/fesm5/taiga-ui-addon-table-directives-table-filters.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-directives.js +0 -6
- package/fesm5/taiga-ui-addon-table-directives.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-interfaces.js +0 -4
- package/fesm5/taiga-ui-addon-table-interfaces.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-tokens.js +0 -16
- package/fesm5/taiga-ui-addon-table-tokens.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-types.js +0 -4
- package/fesm5/taiga-ui-addon-table-types.js.map +0 -1
- package/fesm5/taiga-ui-addon-table-utils.js +0 -25
- package/fesm5/taiga-ui-addon-table-utils.js.map +0 -1
- package/fesm5/taiga-ui-addon-table.js +0 -9
- package/fesm5/taiga-ui-addon-table.js.map +0 -1
- package/interfaces/taiga-ui-addon-table-interfaces.metadata.json +0 -1
- package/taiga-ui-addon-table.metadata.json +0 -1
- package/tokens/taiga-ui-addon-table-tokens.metadata.json +0 -1
- package/types/taiga-ui-addon-table-types.metadata.json +0 -1
- package/utils/taiga-ui-addon-table-utils.metadata.json +0 -1
|
@@ -1,669 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __read, __assign, __extends, __spread } from 'tslib';
|
|
2
|
-
import { TemplateRef, Inject, Input, Directive, ElementRef, Output, InjectionToken, SkipSelf, forwardRef, EventEmitter, ChangeDetectorRef, HostBinding, Optional, Component, ChangeDetectionStrategy, ContentChildren, Pipe, ContentChild, NgModule } from '@angular/core';
|
|
3
|
-
import { tuiDefaultProp, typedFromEvent, preventDefault, TuiController, TuiTableSortKeyException, EMPTY_QUERY, tuiPure, TuiDestroyService, TuiMapperPipeModule } from '@taiga-ui/cdk';
|
|
4
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
|
-
import { TUI_ELEMENT_REF, TUI_TEXTFIELD_APPEARANCE, TUI_TEXTFIELD_LABEL_OUTSIDE, TUI_TEXTFIELD_SIZE, MODE_PROVIDER, TUI_MODE, watchedControllerFactory, TuiSvgModule } from '@taiga-ui/core';
|
|
6
|
-
import { switchMap, distinctUntilChanged, map, takeUntil, filter, startWith } from 'rxjs/operators';
|
|
7
|
-
import { defaultSort } from '@taiga-ui/addon-table/utils';
|
|
8
|
-
import { IntersectionObserverService, INTERSECTION_ROOT_MARGIN, INTERSECTION_THRESHOLD } from '@ng-web-apis/intersection-observer';
|
|
9
|
-
import { Observable } from 'rxjs';
|
|
10
|
-
import { TUI_INPUT_COUNT_OPTIONS } from '@taiga-ui/kit';
|
|
11
|
-
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
12
|
-
import { NgControl } from '@angular/forms';
|
|
13
|
-
|
|
14
|
-
var TuiCellDirective = /** @class */ (function () {
|
|
15
|
-
function TuiCellDirective(template) {
|
|
16
|
-
this.template = template;
|
|
17
|
-
this.tuiCell = '';
|
|
18
|
-
}
|
|
19
|
-
TuiCellDirective.ctorParameters = function () { return [
|
|
20
|
-
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
21
|
-
]; };
|
|
22
|
-
__decorate([
|
|
23
|
-
Input(),
|
|
24
|
-
tuiDefaultProp()
|
|
25
|
-
], TuiCellDirective.prototype, "tuiCell", void 0);
|
|
26
|
-
TuiCellDirective = __decorate([
|
|
27
|
-
Directive({
|
|
28
|
-
selector: '[tuiCell]',
|
|
29
|
-
}),
|
|
30
|
-
__param(0, Inject(TemplateRef))
|
|
31
|
-
], TuiCellDirective);
|
|
32
|
-
return TuiCellDirective;
|
|
33
|
-
}());
|
|
34
|
-
|
|
35
|
-
var TuiHeadDirective = /** @class */ (function () {
|
|
36
|
-
function TuiHeadDirective(template) {
|
|
37
|
-
this.template = template;
|
|
38
|
-
}
|
|
39
|
-
TuiHeadDirective.ctorParameters = function () { return [
|
|
40
|
-
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
41
|
-
]; };
|
|
42
|
-
__decorate([
|
|
43
|
-
Input()
|
|
44
|
-
], TuiHeadDirective.prototype, "tuiHead", void 0);
|
|
45
|
-
TuiHeadDirective = __decorate([
|
|
46
|
-
Directive({
|
|
47
|
-
selector: '[tuiHead]',
|
|
48
|
-
}),
|
|
49
|
-
__param(0, Inject(TemplateRef))
|
|
50
|
-
], TuiHeadDirective);
|
|
51
|
-
return TuiHeadDirective;
|
|
52
|
-
}());
|
|
53
|
-
|
|
54
|
-
// @dynamic
|
|
55
|
-
var TuiResizedDirective = /** @class */ (function () {
|
|
56
|
-
function TuiResizedDirective(documentRef, elementRef, parentRef) {
|
|
57
|
-
var _this = this;
|
|
58
|
-
this.documentRef = documentRef;
|
|
59
|
-
this.elementRef = elementRef;
|
|
60
|
-
this.parentRef = parentRef;
|
|
61
|
-
this.tuiResized = typedFromEvent(this.elementRef.nativeElement, 'mousedown').pipe(preventDefault(), switchMap(function () {
|
|
62
|
-
var _a = _this.parentRef.nativeElement.getBoundingClientRect(), width = _a.width, right = _a.right;
|
|
63
|
-
return typedFromEvent(_this.documentRef, 'mousemove').pipe(distinctUntilChanged(), map(function (_a) {
|
|
64
|
-
var clientX = _a.clientX;
|
|
65
|
-
return width + clientX - right;
|
|
66
|
-
}), takeUntil(typedFromEvent(_this.documentRef, 'mouseup')));
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
TuiResizedDirective.ctorParameters = function () { return [
|
|
70
|
-
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
71
|
-
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
72
|
-
{ type: ElementRef, decorators: [{ type: Inject, args: [TUI_ELEMENT_REF,] }] }
|
|
73
|
-
]; };
|
|
74
|
-
__decorate([
|
|
75
|
-
Output()
|
|
76
|
-
], TuiResizedDirective.prototype, "tuiResized", void 0);
|
|
77
|
-
TuiResizedDirective = __decorate([
|
|
78
|
-
Directive({
|
|
79
|
-
selector: '[tuiResized]',
|
|
80
|
-
}),
|
|
81
|
-
__param(0, Inject(DOCUMENT)),
|
|
82
|
-
__param(1, Inject(ElementRef)),
|
|
83
|
-
__param(2, Inject(TUI_ELEMENT_REF))
|
|
84
|
-
], TuiResizedDirective);
|
|
85
|
-
return TuiResizedDirective;
|
|
86
|
-
}());
|
|
87
|
-
|
|
88
|
-
var TuiRowDirective = /** @class */ (function () {
|
|
89
|
-
function TuiRowDirective(template) {
|
|
90
|
-
this.template = template;
|
|
91
|
-
this.tuiRowOf = [];
|
|
92
|
-
}
|
|
93
|
-
TuiRowDirective.ngTemplateContextGuard = function (_dir, _ctx) {
|
|
94
|
-
return true;
|
|
95
|
-
};
|
|
96
|
-
TuiRowDirective.ctorParameters = function () { return [
|
|
97
|
-
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] }
|
|
98
|
-
]; };
|
|
99
|
-
__decorate([
|
|
100
|
-
Input(),
|
|
101
|
-
tuiDefaultProp()
|
|
102
|
-
], TuiRowDirective.prototype, "tuiRowOf", void 0);
|
|
103
|
-
TuiRowDirective = __decorate([
|
|
104
|
-
Directive({
|
|
105
|
-
selector: 'ng-template[tuiRow]',
|
|
106
|
-
}),
|
|
107
|
-
__param(0, Inject(TemplateRef))
|
|
108
|
-
], TuiRowDirective);
|
|
109
|
-
return TuiRowDirective;
|
|
110
|
-
}());
|
|
111
|
-
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
113
|
-
function stuckFactory(_a, entries$) {
|
|
114
|
-
var nativeElement = _a.nativeElement;
|
|
115
|
-
var stream$ = entries$.pipe(map(function (_a) {
|
|
116
|
-
var _b = __read(_a, 1), intersectionRatio = _b[0].intersectionRatio;
|
|
117
|
-
return intersectionRatio < 1;
|
|
118
|
-
}));
|
|
119
|
-
nativeElement['$.class._stuck'] = stream$;
|
|
120
|
-
return stream$;
|
|
121
|
-
}
|
|
122
|
-
var TUI_STUCK = new InjectionToken('Stream of sticky stuck events');
|
|
123
|
-
var TUI_STUCK_PROVIDER = {
|
|
124
|
-
provide: TUI_STUCK,
|
|
125
|
-
deps: [ElementRef, IntersectionObserverService],
|
|
126
|
-
useFactory: stuckFactory,
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// TODO: 3.0 remove in ivy compilation
|
|
130
|
-
var TABLE_THRESHOLD = [0, 1];
|
|
131
|
-
var TABLE_LABEL = {
|
|
132
|
-
labelOutside: true,
|
|
133
|
-
};
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
135
|
-
function inputCountOptionsFactory(options) {
|
|
136
|
-
return __assign(__assign({}, options), { hideButtons: true });
|
|
137
|
-
}
|
|
138
|
-
var TUI_TABLE_PROVIDERS = [
|
|
139
|
-
{
|
|
140
|
-
provide: INTERSECTION_ROOT_MARGIN,
|
|
141
|
-
useValue: '10000px 10000px 10000px 0px',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
provide: INTERSECTION_THRESHOLD,
|
|
145
|
-
useValue: TABLE_THRESHOLD,
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
provide: TUI_TEXTFIELD_APPEARANCE,
|
|
149
|
-
// TODO: 3.0 remove in ivy compilation
|
|
150
|
-
useValue: 'table',
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
provide: TUI_TEXTFIELD_LABEL_OUTSIDE,
|
|
154
|
-
useValue: TABLE_LABEL,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
provide: TUI_INPUT_COUNT_OPTIONS,
|
|
158
|
-
deps: [[new SkipSelf(), TUI_INPUT_COUNT_OPTIONS]],
|
|
159
|
-
useFactory: inputCountOptionsFactory,
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
provide: TUI_TEXTFIELD_SIZE,
|
|
163
|
-
useExisting: forwardRef(function () { return TuiTableDirective; }),
|
|
164
|
-
},
|
|
165
|
-
IntersectionObserverService,
|
|
166
|
-
MODE_PROVIDER,
|
|
167
|
-
TUI_STUCK_PROVIDER,
|
|
168
|
-
];
|
|
169
|
-
|
|
170
|
-
var TuiTableDirective = /** @class */ (function (_super) {
|
|
171
|
-
__extends(TuiTableDirective, _super);
|
|
172
|
-
function TuiTableDirective(entries$, mode$, stuck$, changeDetectorRef) {
|
|
173
|
-
var _this = _super.call(this) || this;
|
|
174
|
-
_this.entries$ = entries$;
|
|
175
|
-
_this.mode$ = mode$;
|
|
176
|
-
_this.stuck$ = stuck$;
|
|
177
|
-
_this.changeDetectorRef = changeDetectorRef;
|
|
178
|
-
_this.columns = [];
|
|
179
|
-
_this.size = 'm';
|
|
180
|
-
_this.direction = 1;
|
|
181
|
-
_this.directionChange = new EventEmitter();
|
|
182
|
-
_this.sorterChange = new EventEmitter();
|
|
183
|
-
_this.sorter = function () { return 0; };
|
|
184
|
-
return _this;
|
|
185
|
-
}
|
|
186
|
-
TuiTableDirective.prototype.updateSorter = function (sorter) {
|
|
187
|
-
if (this.sorter === sorter) {
|
|
188
|
-
this.direction = this.direction === 1 ? -1 : 1;
|
|
189
|
-
this.directionChange.emit(this.direction);
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
this.sorter = sorter || (function () { return 0; });
|
|
193
|
-
this.sorterChange.emit(this.sorter);
|
|
194
|
-
this.direction = 1;
|
|
195
|
-
this.directionChange.emit(1);
|
|
196
|
-
}
|
|
197
|
-
this.change$.next();
|
|
198
|
-
};
|
|
199
|
-
TuiTableDirective.prototype.ngAfterViewInit = function () {
|
|
200
|
-
this.changeDetectorRef.detectChanges();
|
|
201
|
-
};
|
|
202
|
-
TuiTableDirective.ctorParameters = function () { return [
|
|
203
|
-
{ type: Observable, decorators: [{ type: Inject, args: [IntersectionObserverService,] }] },
|
|
204
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_MODE,] }] },
|
|
205
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_STUCK,] }] },
|
|
206
|
-
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
|
|
207
|
-
]; };
|
|
208
|
-
__decorate([
|
|
209
|
-
Input(),
|
|
210
|
-
tuiDefaultProp()
|
|
211
|
-
], TuiTableDirective.prototype, "columns", void 0);
|
|
212
|
-
__decorate([
|
|
213
|
-
Input(),
|
|
214
|
-
HostBinding('attr.data-size'),
|
|
215
|
-
tuiDefaultProp()
|
|
216
|
-
], TuiTableDirective.prototype, "size", void 0);
|
|
217
|
-
__decorate([
|
|
218
|
-
Input(),
|
|
219
|
-
tuiDefaultProp()
|
|
220
|
-
], TuiTableDirective.prototype, "direction", void 0);
|
|
221
|
-
__decorate([
|
|
222
|
-
Output()
|
|
223
|
-
], TuiTableDirective.prototype, "directionChange", void 0);
|
|
224
|
-
__decorate([
|
|
225
|
-
Output()
|
|
226
|
-
], TuiTableDirective.prototype, "sorterChange", void 0);
|
|
227
|
-
__decorate([
|
|
228
|
-
Input(),
|
|
229
|
-
tuiDefaultProp()
|
|
230
|
-
], TuiTableDirective.prototype, "sorter", void 0);
|
|
231
|
-
TuiTableDirective = __decorate([
|
|
232
|
-
Directive({
|
|
233
|
-
selector: 'table[tuiTable]',
|
|
234
|
-
providers: TUI_TABLE_PROVIDERS,
|
|
235
|
-
host: {
|
|
236
|
-
'($.data-mode.attr)': 'mode$',
|
|
237
|
-
'($.class._stuck)': 'stuck$',
|
|
238
|
-
style: 'border-collapse: separate',
|
|
239
|
-
},
|
|
240
|
-
}),
|
|
241
|
-
__param(0, Inject(IntersectionObserverService)),
|
|
242
|
-
__param(1, Inject(TUI_MODE)),
|
|
243
|
-
__param(2, Inject(TUI_STUCK)),
|
|
244
|
-
__param(3, Inject(ChangeDetectorRef))
|
|
245
|
-
], TuiTableDirective);
|
|
246
|
-
return TuiTableDirective;
|
|
247
|
-
}(TuiController));
|
|
248
|
-
|
|
249
|
-
var TuiThComponent = /** @class */ (function () {
|
|
250
|
-
function TuiThComponent(head, table) {
|
|
251
|
-
var _this = this;
|
|
252
|
-
this.head = head;
|
|
253
|
-
this.table = table;
|
|
254
|
-
this.sorter = this.head
|
|
255
|
-
? function (a, b) { return defaultSort(a[_this.key], b[_this.key]); }
|
|
256
|
-
: null;
|
|
257
|
-
this.resizable = false;
|
|
258
|
-
this.sticky = false;
|
|
259
|
-
this.width = null;
|
|
260
|
-
}
|
|
261
|
-
Object.defineProperty(TuiThComponent.prototype, "key", {
|
|
262
|
-
get: function () {
|
|
263
|
-
if (!this.head) {
|
|
264
|
-
throw new TuiTableSortKeyException();
|
|
265
|
-
}
|
|
266
|
-
return this.head.tuiHead;
|
|
267
|
-
},
|
|
268
|
-
enumerable: true,
|
|
269
|
-
configurable: true
|
|
270
|
-
});
|
|
271
|
-
Object.defineProperty(TuiThComponent.prototype, "isCurrent", {
|
|
272
|
-
get: function () {
|
|
273
|
-
return !!this.sorter && !!this.table && this.sorter === this.table.sorter;
|
|
274
|
-
},
|
|
275
|
-
enumerable: true,
|
|
276
|
-
configurable: true
|
|
277
|
-
});
|
|
278
|
-
Object.defineProperty(TuiThComponent.prototype, "icon", {
|
|
279
|
-
get: function () {
|
|
280
|
-
return this.isCurrent ? 'tuiIconSortDown' : 'tuiIconSortOff';
|
|
281
|
-
},
|
|
282
|
-
enumerable: true,
|
|
283
|
-
configurable: true
|
|
284
|
-
});
|
|
285
|
-
TuiThComponent.prototype.onResized = function (width) {
|
|
286
|
-
this.width = width;
|
|
287
|
-
};
|
|
288
|
-
TuiThComponent.ctorParameters = function () { return [
|
|
289
|
-
{ type: TuiHeadDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiHeadDirective,] }] },
|
|
290
|
-
{ type: TuiTableDirective, decorators: [{ type: Optional }, { type: Inject, args: [forwardRef(function () { return TuiTableDirective; }),] }] }
|
|
291
|
-
]; };
|
|
292
|
-
__decorate([
|
|
293
|
-
Input(),
|
|
294
|
-
tuiDefaultProp()
|
|
295
|
-
], TuiThComponent.prototype, "sorter", void 0);
|
|
296
|
-
__decorate([
|
|
297
|
-
Input(),
|
|
298
|
-
tuiDefaultProp()
|
|
299
|
-
], TuiThComponent.prototype, "resizable", void 0);
|
|
300
|
-
__decorate([
|
|
301
|
-
Input(),
|
|
302
|
-
HostBinding('class._sticky'),
|
|
303
|
-
tuiDefaultProp()
|
|
304
|
-
], TuiThComponent.prototype, "sticky", void 0);
|
|
305
|
-
__decorate([
|
|
306
|
-
HostBinding('style.width.px')
|
|
307
|
-
], TuiThComponent.prototype, "width", void 0);
|
|
308
|
-
TuiThComponent = __decorate([
|
|
309
|
-
Component({
|
|
310
|
-
selector: 'th[tuiTh]',
|
|
311
|
-
template: "<button\n *ngIf=\"sorter && table; else content\"\n type=\"button\"\n class=\"t-sort\"\n [class.t-sort_sorted]=\"isCurrent\"\n (click)=\"table.updateSorter(sorter)\"\n>\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n {{ table.change$ | async }}\n <tui-svg\n class=\"t-sort-icon\"\n [src]=\"icon\"\n [class.t-sort-icon_rotated]=\"isCurrent && table.direction === -1\"\n ></tui-svg>\n</button>\n<ng-template #content><ng-content></ng-content></ng-template>\n<div\n *ngIf=\"resizable\"\n class=\"t-bar\"\n (tuiResized)=\"onResized($event)\"\n></div>\n",
|
|
312
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
313
|
-
providers: [
|
|
314
|
-
{
|
|
315
|
-
provide: TUI_ELEMENT_REF,
|
|
316
|
-
useExisting: ElementRef,
|
|
317
|
-
},
|
|
318
|
-
],
|
|
319
|
-
styles: [":host{transition-property:box-shadow;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:relative;top:0;z-index:20;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 rgba(237,237,237,0);border:1px solid var(--tui-base-04)}:host:not(:first-child){border-left:none}:host._sticky{position:-webkit-sticky;position:sticky;z-index:30}:host._sticky:first-child{left:0}:host._sticky:after{transition-property:opacity;transition-duration:var(--tui-duration,300ms);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(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 rgba(237,237,237,.7)}: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 rgba(60,60,60,.9)}:host-context(table[data-mode=onDark]thead[tuiThead]._stuck):first-child{box-shadow:.0625rem .3125rem rgba(60,60,60,.9)}: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,300ms);transition-timing-function:ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;display:inline-flex;flex-direction:inherit;align-items:center;outline:0;font-weight:700;cursor:pointer}.t-sort_sorted{color:var(--tui-text-01)}.t-sort_sorted .t-sort-icon_rotated{transform:scaleY(-1)}.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,300ms);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:active,.t-bar:hover{opacity:1}"]
|
|
320
|
-
}),
|
|
321
|
-
__param(0, Optional()),
|
|
322
|
-
__param(0, Inject(TuiHeadDirective)),
|
|
323
|
-
__param(1, Optional()),
|
|
324
|
-
__param(1, Inject(forwardRef(function () { return TuiTableDirective; })))
|
|
325
|
-
], TuiThComponent);
|
|
326
|
-
return TuiThComponent;
|
|
327
|
-
}());
|
|
328
|
-
|
|
329
|
-
var TuiSortableDirective = /** @class */ (function () {
|
|
330
|
-
function TuiSortableDirective(sortBy, table, th) {
|
|
331
|
-
this.sortBy = sortBy;
|
|
332
|
-
this.table = table;
|
|
333
|
-
this.th = th;
|
|
334
|
-
this.sorter = function () { return 0; };
|
|
335
|
-
}
|
|
336
|
-
Object.defineProperty(TuiSortableDirective.prototype, "key", {
|
|
337
|
-
get: function () {
|
|
338
|
-
return this.th.key;
|
|
339
|
-
},
|
|
340
|
-
enumerable: true,
|
|
341
|
-
configurable: true
|
|
342
|
-
});
|
|
343
|
-
TuiSortableDirective.prototype.ngOnInit = function () {
|
|
344
|
-
this.sorter = this.match ? this.table.sorter : this.sorter;
|
|
345
|
-
this.th.sorter = this.sorter;
|
|
346
|
-
};
|
|
347
|
-
TuiSortableDirective.prototype.ngDoCheck = function () {
|
|
348
|
-
if (this.match && this.table.sorter !== this.sorter) {
|
|
349
|
-
this.table.updateSorter(this.sorter);
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
Object.defineProperty(TuiSortableDirective.prototype, "match", {
|
|
353
|
-
get: function () {
|
|
354
|
-
return this.sortBy.tuiSortBy === this.key;
|
|
355
|
-
},
|
|
356
|
-
enumerable: true,
|
|
357
|
-
configurable: true
|
|
358
|
-
});
|
|
359
|
-
TuiSortableDirective.ctorParameters = function () { return [
|
|
360
|
-
{ type: TuiSortByDirective, decorators: [{ type: Inject, args: [forwardRef(function () { return TuiSortByDirective; }),] }] },
|
|
361
|
-
{ type: TuiTableDirective, decorators: [{ type: Inject, args: [TuiTableDirective,] }] },
|
|
362
|
-
{ type: TuiThComponent, decorators: [{ type: Inject, args: [TuiThComponent,] }] }
|
|
363
|
-
]; };
|
|
364
|
-
TuiSortableDirective = __decorate([
|
|
365
|
-
Directive({
|
|
366
|
-
selector: 'th[tuiTh][tuiSortable]',
|
|
367
|
-
}),
|
|
368
|
-
__param(0, Inject(forwardRef(function () { return TuiSortByDirective; }))),
|
|
369
|
-
__param(1, Inject(TuiTableDirective)),
|
|
370
|
-
__param(2, Inject(TuiThComponent))
|
|
371
|
-
], TuiSortableDirective);
|
|
372
|
-
return TuiSortableDirective;
|
|
373
|
-
}());
|
|
374
|
-
|
|
375
|
-
var TuiSortByDirective = /** @class */ (function () {
|
|
376
|
-
function TuiSortByDirective(table) {
|
|
377
|
-
var _this = this;
|
|
378
|
-
this.table = table;
|
|
379
|
-
this.sortables = EMPTY_QUERY;
|
|
380
|
-
this.tuiSortBy = null;
|
|
381
|
-
this.tuiSortByChange = this.table.sorterChange.pipe(filter(function () { return !!_this.sortables.length; }), map(function (sorter) { return _this.getKey(sorter); }));
|
|
382
|
-
}
|
|
383
|
-
TuiSortByDirective.prototype.getKey = function (sorter) {
|
|
384
|
-
var _a, _b;
|
|
385
|
-
return (_b = (_a = this.sortables.find(function (s) { return s.sorter === sorter; })) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : null;
|
|
386
|
-
};
|
|
387
|
-
TuiSortByDirective.ctorParameters = function () { return [
|
|
388
|
-
{ type: TuiTableDirective, decorators: [{ type: Inject, args: [TuiTableDirective,] }] }
|
|
389
|
-
]; };
|
|
390
|
-
__decorate([
|
|
391
|
-
ContentChildren(TuiSortableDirective, { descendants: true })
|
|
392
|
-
], TuiSortByDirective.prototype, "sortables", void 0);
|
|
393
|
-
__decorate([
|
|
394
|
-
Input(),
|
|
395
|
-
tuiDefaultProp()
|
|
396
|
-
], TuiSortByDirective.prototype, "tuiSortBy", void 0);
|
|
397
|
-
__decorate([
|
|
398
|
-
Output()
|
|
399
|
-
], TuiSortByDirective.prototype, "tuiSortByChange", void 0);
|
|
400
|
-
TuiSortByDirective = __decorate([
|
|
401
|
-
Directive({
|
|
402
|
-
selector: 'table[tuiTable][tuiSortBy]',
|
|
403
|
-
}),
|
|
404
|
-
__param(0, Inject(TuiTableDirective))
|
|
405
|
-
], TuiSortByDirective);
|
|
406
|
-
return TuiSortByDirective;
|
|
407
|
-
}());
|
|
408
|
-
|
|
409
|
-
var TuiTheadDirective = /** @class */ (function () {
|
|
410
|
-
function TuiTheadDirective(stuck$) {
|
|
411
|
-
this.stuck$ = stuck$;
|
|
412
|
-
}
|
|
413
|
-
TuiTheadDirective.ctorParameters = function () { return [
|
|
414
|
-
{ type: Observable, decorators: [{ type: Inject, args: [TUI_STUCK,] }] }
|
|
415
|
-
]; };
|
|
416
|
-
TuiTheadDirective = __decorate([
|
|
417
|
-
Directive({
|
|
418
|
-
selector: 'thead[tuiThead]',
|
|
419
|
-
providers: [
|
|
420
|
-
TUI_STUCK_PROVIDER,
|
|
421
|
-
IntersectionObserverService,
|
|
422
|
-
{
|
|
423
|
-
provide: INTERSECTION_ROOT_MARGIN,
|
|
424
|
-
useValue: '0px 10000px 10000px 10000px',
|
|
425
|
-
},
|
|
426
|
-
],
|
|
427
|
-
host: {
|
|
428
|
-
'($.class._stuck)': 'stuck$',
|
|
429
|
-
},
|
|
430
|
-
}),
|
|
431
|
-
__param(0, Inject(TUI_STUCK))
|
|
432
|
-
], TuiTheadDirective);
|
|
433
|
-
return TuiTheadDirective;
|
|
434
|
-
}());
|
|
435
|
-
|
|
436
|
-
var TuiTableSortPipe = /** @class */ (function () {
|
|
437
|
-
function TuiTableSortPipe(table) {
|
|
438
|
-
this.table = table;
|
|
439
|
-
}
|
|
440
|
-
TuiTableSortPipe.prototype.transform = function (data) {
|
|
441
|
-
return this.sort(data, this.table.sorter, this.table.direction);
|
|
442
|
-
};
|
|
443
|
-
TuiTableSortPipe.prototype.sort = function (data, sorter, direction) {
|
|
444
|
-
return __spread(data).sort(function (a, b) { return direction * sorter(a, b); });
|
|
445
|
-
};
|
|
446
|
-
TuiTableSortPipe.ctorParameters = function () { return [
|
|
447
|
-
{ type: TuiTableDirective, decorators: [{ type: Inject, args: [TuiTableDirective,] }] }
|
|
448
|
-
]; };
|
|
449
|
-
__decorate([
|
|
450
|
-
tuiPure
|
|
451
|
-
], TuiTableSortPipe.prototype, "sort", null);
|
|
452
|
-
TuiTableSortPipe = __decorate([
|
|
453
|
-
Pipe({
|
|
454
|
-
name: 'tuiTableSort',
|
|
455
|
-
pure: false,
|
|
456
|
-
}),
|
|
457
|
-
__param(0, Inject(TuiTableDirective))
|
|
458
|
-
], TuiTableSortPipe);
|
|
459
|
-
return TuiTableSortPipe;
|
|
460
|
-
}());
|
|
461
|
-
|
|
462
|
-
// TODO: 3.0 remove in ivy compilation
|
|
463
|
-
var TABLE_FACTORY = watchedControllerFactory;
|
|
464
|
-
var TUI_TABLE_PROVIDER = [
|
|
465
|
-
TuiDestroyService,
|
|
466
|
-
TuiTableSortPipe,
|
|
467
|
-
{
|
|
468
|
-
provide: TuiTableDirective,
|
|
469
|
-
deps: [[new SkipSelf(), TuiTableDirective], ChangeDetectorRef, TuiDestroyService],
|
|
470
|
-
useFactory: TABLE_FACTORY,
|
|
471
|
-
},
|
|
472
|
-
];
|
|
473
|
-
|
|
474
|
-
var TuiTrComponent = /** @class */ (function () {
|
|
475
|
-
function TuiTrComponent(table, body) {
|
|
476
|
-
var _this = this;
|
|
477
|
-
this.table = table;
|
|
478
|
-
this.body = body;
|
|
479
|
-
this.cells = EMPTY_QUERY;
|
|
480
|
-
this.cells$ = this.cells.changes.pipe(startWith(null), map(function () {
|
|
481
|
-
return _this.cells.reduce(function (record, item) {
|
|
482
|
-
var _a;
|
|
483
|
-
return (__assign(__assign({}, record), (_a = {}, _a[item.tuiCell] = item, _a)));
|
|
484
|
-
}, {});
|
|
485
|
-
}));
|
|
486
|
-
this.item$ = this.body.rows.changes.pipe(startWith(null), map(function () {
|
|
487
|
-
return _this.body.sorted[_this.body.rows.toArray().findIndex(function (row) { return row === _this; })];
|
|
488
|
-
}));
|
|
489
|
-
}
|
|
490
|
-
TuiTrComponent.ctorParameters = function () { return [
|
|
491
|
-
{ type: TuiTableDirective, decorators: [{ type: Inject, args: [forwardRef(function () { return TuiTableDirective; }),] }] },
|
|
492
|
-
{ type: TuiTbodyComponent, decorators: [{ type: Inject, args: [forwardRef(function () { return TuiTbodyComponent; }),] }] }
|
|
493
|
-
]; };
|
|
494
|
-
__decorate([
|
|
495
|
-
ContentChildren(forwardRef(function () { return TuiCellDirective; }))
|
|
496
|
-
], TuiTrComponent.prototype, "cells", void 0);
|
|
497
|
-
TuiTrComponent = __decorate([
|
|
498
|
-
Component({
|
|
499
|
-
selector: 'tr[tuiTr]',
|
|
500
|
-
template: "<ng-container *ngIf=\"cells$ | async as items\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"items[key.toString()]?.template || plain\"\n >\n <ng-template #plain>\n <td\n *ngIf=\"item$ | async as item\"\n tuiTd\n >\n {{ item[key.toString()] }}\n </td>\n </ng-template>\n </ng-container>\n</ng-container>\n",
|
|
501
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
502
|
-
providers: [TUI_TABLE_PROVIDER]
|
|
503
|
-
}),
|
|
504
|
-
__param(0, Inject(forwardRef(function () { return TuiTableDirective; }))),
|
|
505
|
-
__param(1, Inject(forwardRef(function () { return TuiTbodyComponent; })))
|
|
506
|
-
], TuiTrComponent);
|
|
507
|
-
return TuiTrComponent;
|
|
508
|
-
}());
|
|
509
|
-
|
|
510
|
-
var TuiTbodyComponent = /** @class */ (function () {
|
|
511
|
-
function TuiTbodyComponent(pipe, table) {
|
|
512
|
-
this.pipe = pipe;
|
|
513
|
-
this.table = table;
|
|
514
|
-
this.data = [];
|
|
515
|
-
this.heading = '';
|
|
516
|
-
this.open = true;
|
|
517
|
-
this.openChange = new EventEmitter();
|
|
518
|
-
this.rows = EMPTY_QUERY;
|
|
519
|
-
this.toContext = function ($implicit, index) { return ({ $implicit: $implicit, index: index }); };
|
|
520
|
-
}
|
|
521
|
-
Object.defineProperty(TuiTbodyComponent.prototype, "sorted", {
|
|
522
|
-
get: function () {
|
|
523
|
-
return this.pipe.transform(this.data);
|
|
524
|
-
},
|
|
525
|
-
enumerable: true,
|
|
526
|
-
configurable: true
|
|
527
|
-
});
|
|
528
|
-
TuiTbodyComponent.prototype.onClick = function () {
|
|
529
|
-
this.open = !this.open;
|
|
530
|
-
this.openChange.emit(this.open);
|
|
531
|
-
};
|
|
532
|
-
TuiTbodyComponent.ctorParameters = function () { return [
|
|
533
|
-
{ type: TuiTableSortPipe, decorators: [{ type: Inject, args: [TuiTableSortPipe,] }] },
|
|
534
|
-
{ type: TuiTableDirective, decorators: [{ type: Inject, args: [forwardRef(function () { return TuiTableDirective; }),] }] }
|
|
535
|
-
]; };
|
|
536
|
-
__decorate([
|
|
537
|
-
Input(),
|
|
538
|
-
tuiDefaultProp()
|
|
539
|
-
], TuiTbodyComponent.prototype, "data", void 0);
|
|
540
|
-
__decorate([
|
|
541
|
-
Input(),
|
|
542
|
-
tuiDefaultProp()
|
|
543
|
-
], TuiTbodyComponent.prototype, "heading", void 0);
|
|
544
|
-
__decorate([
|
|
545
|
-
Input(),
|
|
546
|
-
tuiDefaultProp()
|
|
547
|
-
], TuiTbodyComponent.prototype, "open", void 0);
|
|
548
|
-
__decorate([
|
|
549
|
-
Output()
|
|
550
|
-
], TuiTbodyComponent.prototype, "openChange", void 0);
|
|
551
|
-
__decorate([
|
|
552
|
-
ContentChild(forwardRef(function () { return TuiRowDirective; }))
|
|
553
|
-
], TuiTbodyComponent.prototype, "row", void 0);
|
|
554
|
-
__decorate([
|
|
555
|
-
ContentChildren(forwardRef(function () { return TuiTrComponent; }))
|
|
556
|
-
], TuiTbodyComponent.prototype, "rows", void 0);
|
|
557
|
-
TuiTbodyComponent = __decorate([
|
|
558
|
-
Component({
|
|
559
|
-
selector: 'tbody[tuiTbody]',
|
|
560
|
-
template: "<ng-content></ng-content>\n<tr *ngIf=\"heading\">\n <th\n class=\"heading\"\n [colSpan]=\"table.columns.length\"\n >\n <button\n type=\"button\"\n class=\"expand\"\n (click)=\"onClick()\"\n >\n <span\n polymorpheus-outlet\n class=\"name\"\n [content]=\"heading\"\n ></span>\n <tui-svg\n src=\"tuiIconChevronDownLarge\"\n class=\"chevron\"\n [class.chevron_rotated]=\"open\"\n ></tui-svg>\n </button>\n </th>\n</tr>\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",
|
|
561
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
562
|
-
providers: TUI_TABLE_PROVIDER,
|
|
563
|
-
styles: [":host{border-color:var(--tui-base-04)}:host tr{border-color:inherit}.expand{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;display:flex;width:100%;height:100%;align-items:center;box-sizing:border-box;outline:0;font-weight:700;cursor:pointer;border-color:inherit}.expand:focus-visible .name{background:var(--tui-selection)}.expand:after,.expand:before{content:'';position:-webkit-sticky;position:sticky;height:100%;border-left:1px solid;border-color:inherit}.expand:before{left:0}.expand:after{right:0}.heading{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}:host-context(table[data-size='l']) .heading{font:var(--tui-font-text-m);height:var(--tui-height-l)}.name{position:-webkit-sticky;position:sticky;left:.75rem;display:inline-block}:host-context(table[data-size='l']) .name{left:1rem}.chevron{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:-webkit-sticky;position:sticky;right:.75rem;margin:0 .6875rem 0 auto}.chevron_rotated{transform:rotate(180deg)}"]
|
|
564
|
-
}),
|
|
565
|
-
__param(0, Inject(TuiTableSortPipe)),
|
|
566
|
-
__param(1, Inject(forwardRef(function () { return TuiTableDirective; })))
|
|
567
|
-
], TuiTbodyComponent);
|
|
568
|
-
return TuiTbodyComponent;
|
|
569
|
-
}());
|
|
570
|
-
|
|
571
|
-
var TuiTdComponent = /** @class */ (function () {
|
|
572
|
-
function TuiTdComponent() {
|
|
573
|
-
}
|
|
574
|
-
__decorate([
|
|
575
|
-
HostBinding('class._editable'),
|
|
576
|
-
ContentChild(NgControl)
|
|
577
|
-
], TuiTdComponent.prototype, "control", void 0);
|
|
578
|
-
TuiTdComponent = __decorate([
|
|
579
|
-
Component({
|
|
580
|
-
selector: 'th[tuiTd], td[tuiTd]',
|
|
581
|
-
template: '<ng-content></ng-content>',
|
|
582
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
583
|
-
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;transform:translate3d(0,0,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,300ms);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}"]
|
|
584
|
-
})
|
|
585
|
-
], TuiTdComponent);
|
|
586
|
-
return TuiTdComponent;
|
|
587
|
-
}());
|
|
588
|
-
|
|
589
|
-
var TuiThGroupComponent = /** @class */ (function () {
|
|
590
|
-
function TuiThGroupComponent(table) {
|
|
591
|
-
var _this = this;
|
|
592
|
-
this.table = table;
|
|
593
|
-
this.heads = EMPTY_QUERY;
|
|
594
|
-
this.heads$ = this.heads.changes.pipe(startWith(null), map(function () {
|
|
595
|
-
return _this.heads.reduce(function (record, item) {
|
|
596
|
-
var _a;
|
|
597
|
-
return (__assign(__assign({}, record), (_a = {}, _a[item.tuiHead] = item, _a)));
|
|
598
|
-
}, {});
|
|
599
|
-
}));
|
|
600
|
-
}
|
|
601
|
-
TuiThGroupComponent.ctorParameters = function () { return [
|
|
602
|
-
{ type: TuiTableDirective, decorators: [{ type: Inject, args: [forwardRef(function () { return TuiTableDirective; }),] }] }
|
|
603
|
-
]; };
|
|
604
|
-
__decorate([
|
|
605
|
-
ContentChild(forwardRef(function () { return TuiThComponent; }))
|
|
606
|
-
], TuiThGroupComponent.prototype, "th", void 0);
|
|
607
|
-
__decorate([
|
|
608
|
-
ContentChildren(forwardRef(function () { return TuiHeadDirective; }))
|
|
609
|
-
], TuiThGroupComponent.prototype, "heads", void 0);
|
|
610
|
-
TuiThGroupComponent = __decorate([
|
|
611
|
-
Component({
|
|
612
|
-
selector: 'tr[tuiThGroup]',
|
|
613
|
-
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",
|
|
614
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
615
|
-
providers: [TUI_TABLE_PROVIDER]
|
|
616
|
-
}),
|
|
617
|
-
__param(0, Inject(forwardRef(function () { return TuiTableDirective; })))
|
|
618
|
-
], TuiThGroupComponent);
|
|
619
|
-
return TuiThGroupComponent;
|
|
620
|
-
}());
|
|
621
|
-
|
|
622
|
-
var TuiTableModule = /** @class */ (function () {
|
|
623
|
-
function TuiTableModule() {
|
|
624
|
-
}
|
|
625
|
-
TuiTableModule = __decorate([
|
|
626
|
-
NgModule({
|
|
627
|
-
imports: [CommonModule, PolymorpheusModule, TuiMapperPipeModule, TuiSvgModule],
|
|
628
|
-
declarations: [
|
|
629
|
-
TuiTableDirective,
|
|
630
|
-
TuiTbodyComponent,
|
|
631
|
-
TuiThGroupComponent,
|
|
632
|
-
TuiThComponent,
|
|
633
|
-
TuiTdComponent,
|
|
634
|
-
TuiTrComponent,
|
|
635
|
-
TuiCellDirective,
|
|
636
|
-
TuiHeadDirective,
|
|
637
|
-
TuiRowDirective,
|
|
638
|
-
TuiSortByDirective,
|
|
639
|
-
TuiSortableDirective,
|
|
640
|
-
TuiTheadDirective,
|
|
641
|
-
TuiResizedDirective,
|
|
642
|
-
TuiTableSortPipe,
|
|
643
|
-
],
|
|
644
|
-
exports: [
|
|
645
|
-
TuiTableDirective,
|
|
646
|
-
TuiTbodyComponent,
|
|
647
|
-
TuiThGroupComponent,
|
|
648
|
-
TuiThComponent,
|
|
649
|
-
TuiTdComponent,
|
|
650
|
-
TuiTrComponent,
|
|
651
|
-
TuiCellDirective,
|
|
652
|
-
TuiHeadDirective,
|
|
653
|
-
TuiRowDirective,
|
|
654
|
-
TuiSortByDirective,
|
|
655
|
-
TuiSortableDirective,
|
|
656
|
-
TuiTheadDirective,
|
|
657
|
-
TuiTableSortPipe,
|
|
658
|
-
],
|
|
659
|
-
})
|
|
660
|
-
], TuiTableModule);
|
|
661
|
-
return TuiTableModule;
|
|
662
|
-
}());
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Generated bundle index. Do not edit.
|
|
666
|
-
*/
|
|
667
|
-
|
|
668
|
-
export { TABLE_FACTORY, TABLE_LABEL, TABLE_THRESHOLD, TUI_STUCK, TUI_STUCK_PROVIDER, TUI_TABLE_PROVIDER, TUI_TABLE_PROVIDERS, TuiCellDirective, TuiHeadDirective, TuiResizedDirective, TuiRowDirective, TuiSortByDirective, TuiSortableDirective, TuiTableDirective, TuiTableModule, TuiTableSortPipe, TuiTbodyComponent, TuiTdComponent, TuiThComponent, TuiThGroupComponent, TuiTheadDirective, TuiTrComponent, inputCountOptionsFactory, stuckFactory };
|
|
669
|
-
//# sourceMappingURL=taiga-ui-addon-table-components-table.js.map
|