@taiga-ui/addon-table 3.58.0 → 3.59.0-canary.1c24449

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