@taiga-ui/addon-table 4.8.1 → 4.10.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.
@@ -91,7 +91,7 @@ class TuiReorder {
91
91
  this.enabledChange.emit(enabled);
92
92
  }
93
93
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiReorder, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
94
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiReorder, isStandalone: true, selector: "tui-reorder", inputs: { enabled: "enabled", items: "items", content: "content" }, outputs: { itemsChange: "itemsChange", enabledChange: "enabledChange" }, host: { listeners: { "focusout.stop": "(0)", "pointerdown.silent": "onDrag()", "document:pointerup.silent": "onDrop()" } }, ngImport: i0, template: "<tui-tiles\n class=\"t-wrapper\"\n [(order)]=\"order\"\n>\n <tui-tile\n *ngFor=\"let item of unsortedItems; let index = index\"\n [style.order]=\"order.get(index)\"\n >\n <div\n class=\"t-item\"\n [class.t-item_disabled]=\"!isEnabled(item)\"\n >\n <div\n tuiTileHandle\n class=\"t-draggable\"\n >\n <tui-icon\n class=\"t-icon\"\n [icon]=\"options.icons.drag\"\n />\n <ng-container *polymorpheusOutlet=\"content as template; context: {$implicit: item, index: index}\">\n {{ template }}\n </ng-container>\n </div>\n <button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [iconStart]=\"getIcon(item)\"\n (click)=\"toggle(item)\"\n (keydown.arrowDown.prevent)=\"move(index, 1)\"\n (keydown.arrowUp.prevent)=\"move(index, -1)\"\n >\n {{ showHideText$ | async }}\n </button>\n </div>\n </tui-tile>\n</tui-tiles>\n", styles: [":host{display:block;font:var(--tui-font-text-s);padding:.5rem 0;-webkit-user-select:none;user-select:none}.t-wrapper{grid-auto-rows:2rem}.t-draggable{cursor:ns-resize;flex:1 1 auto}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:flex;block-size:2rem;align-items:center;padding:0 .75rem;background:var(--tui-background-base)}.t-item_disabled{opacity:var(--tui-disabled-opacity)}.t-item_disabled .t-button{color:var(--tui-text-primary);opacity:1}.t-item:hover{background:var(--tui-background-base-alt)}.t-item:hover .t-button{opacity:1}.t-icon{margin-right:.5rem;color:var(--tui-text-tertiary);border:.25rem solid transparent}.t-button{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-left:auto;opacity:0}.t-button:focus{opacity:1}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "component", type: i1.TuiTilesComponent, selector: "tui-tiles", inputs: ["debounce", "order"], outputs: ["orderChange"] }, { kind: "component", type: i1.TuiTile, selector: "tui-tile", inputs: ["width", "height"] }, { kind: "directive", type: i1.TuiTileHandle, selector: "[tuiTileHandle]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
94
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiReorder, isStandalone: true, selector: "tui-reorder", inputs: { enabled: "enabled", items: "items", content: "content" }, outputs: { itemsChange: "itemsChange", enabledChange: "enabledChange" }, host: { listeners: { "focusout.stop": "(0)", "pointerdown.silent": "onDrag()", "document:pointerup.silent": "onDrop()" } }, ngImport: i0, template: "<tui-tiles\n class=\"t-wrapper\"\n [(order)]=\"order\"\n>\n <tui-tile\n *ngFor=\"let item of unsortedItems; let index = index\"\n [style.order]=\"order.get(index)\"\n >\n <div\n class=\"t-item\"\n [class.t-item_disabled]=\"!isEnabled(item)\"\n >\n <div\n tuiTileHandle\n class=\"t-draggable\"\n >\n <tui-icon\n class=\"t-icon\"\n [icon]=\"options.icons.drag\"\n />\n <ng-container *polymorpheusOutlet=\"content as template; context: {$implicit: item, index: index}\">\n {{ template }}\n </ng-container>\n </div>\n <button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [iconStart]=\"getIcon(item)\"\n (click)=\"toggle(item)\"\n (keydown.arrowDown.prevent)=\"move(index, 1)\"\n (keydown.arrowUp.prevent)=\"move(index, -1)\"\n >\n {{ showHideText$ | async }}\n </button>\n </div>\n </tui-tile>\n</tui-tiles>\n", styles: [":host{display:block;font:var(--tui-font-text-s);padding:.5rem 0;-webkit-user-select:none;user-select:none}.t-wrapper{grid-auto-rows:2rem}.t-draggable{cursor:ns-resize;flex:1 1 auto}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:flex;block-size:2rem;align-items:center;padding:0 .75rem;background:var(--tui-background-base)}.t-item_disabled{opacity:var(--tui-disabled-opacity)}.t-item_disabled .t-button{color:var(--tui-text-primary);opacity:1}.t-item:hover{background:var(--tui-background-base-alt)}.t-item:hover .t-button{opacity:1}.t-icon{margin-right:.5rem;color:var(--tui-text-tertiary);border-width:.25rem}.t-button{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-left:auto;opacity:0}.t-button:focus{opacity:1}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "component", type: i1.TuiTilesComponent, selector: "tui-tiles", inputs: ["debounce", "order"], outputs: ["orderChange"] }, { kind: "component", type: i1.TuiTile, selector: "tui-tile", inputs: ["width", "height"] }, { kind: "directive", type: i1.TuiTileHandle, selector: "[tuiTileHandle]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
95
95
  }
96
96
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiReorder, decorators: [{
97
97
  type: Component,
@@ -107,7 +107,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
107
107
  '(focusout.stop)': '(0)',
108
108
  '(pointerdown.silent)': 'onDrag()',
109
109
  '(document:pointerup.silent)': 'onDrop()',
110
- }, template: "<tui-tiles\n class=\"t-wrapper\"\n [(order)]=\"order\"\n>\n <tui-tile\n *ngFor=\"let item of unsortedItems; let index = index\"\n [style.order]=\"order.get(index)\"\n >\n <div\n class=\"t-item\"\n [class.t-item_disabled]=\"!isEnabled(item)\"\n >\n <div\n tuiTileHandle\n class=\"t-draggable\"\n >\n <tui-icon\n class=\"t-icon\"\n [icon]=\"options.icons.drag\"\n />\n <ng-container *polymorpheusOutlet=\"content as template; context: {$implicit: item, index: index}\">\n {{ template }}\n </ng-container>\n </div>\n <button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [iconStart]=\"getIcon(item)\"\n (click)=\"toggle(item)\"\n (keydown.arrowDown.prevent)=\"move(index, 1)\"\n (keydown.arrowUp.prevent)=\"move(index, -1)\"\n >\n {{ showHideText$ | async }}\n </button>\n </div>\n </tui-tile>\n</tui-tiles>\n", styles: [":host{display:block;font:var(--tui-font-text-s);padding:.5rem 0;-webkit-user-select:none;user-select:none}.t-wrapper{grid-auto-rows:2rem}.t-draggable{cursor:ns-resize;flex:1 1 auto}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:flex;block-size:2rem;align-items:center;padding:0 .75rem;background:var(--tui-background-base)}.t-item_disabled{opacity:var(--tui-disabled-opacity)}.t-item_disabled .t-button{color:var(--tui-text-primary);opacity:1}.t-item:hover{background:var(--tui-background-base-alt)}.t-item:hover .t-button{opacity:1}.t-icon{margin-right:.5rem;color:var(--tui-text-tertiary);border:.25rem solid transparent}.t-button{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-left:auto;opacity:0}.t-button:focus{opacity:1}\n"] }]
110
+ }, template: "<tui-tiles\n class=\"t-wrapper\"\n [(order)]=\"order\"\n>\n <tui-tile\n *ngFor=\"let item of unsortedItems; let index = index\"\n [style.order]=\"order.get(index)\"\n >\n <div\n class=\"t-item\"\n [class.t-item_disabled]=\"!isEnabled(item)\"\n >\n <div\n tuiTileHandle\n class=\"t-draggable\"\n >\n <tui-icon\n class=\"t-icon\"\n [icon]=\"options.icons.drag\"\n />\n <ng-container *polymorpheusOutlet=\"content as template; context: {$implicit: item, index: index}\">\n {{ template }}\n </ng-container>\n </div>\n <button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [iconStart]=\"getIcon(item)\"\n (click)=\"toggle(item)\"\n (keydown.arrowDown.prevent)=\"move(index, 1)\"\n (keydown.arrowUp.prevent)=\"move(index, -1)\"\n >\n {{ showHideText$ | async }}\n </button>\n </div>\n </tui-tile>\n</tui-tiles>\n", styles: [":host{display:block;font:var(--tui-font-text-s);padding:.5rem 0;-webkit-user-select:none;user-select:none}.t-wrapper{grid-auto-rows:2rem}.t-draggable{cursor:ns-resize;flex:1 1 auto}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:flex;block-size:2rem;align-items:center;padding:0 .75rem;background:var(--tui-background-base)}.t-item_disabled{opacity:var(--tui-disabled-opacity)}.t-item_disabled .t-button{color:var(--tui-text-primary);opacity:1}.t-item:hover{background:var(--tui-background-base-alt)}.t-item:hover .t-button{opacity:1}.t-icon{margin-right:.5rem;color:var(--tui-text-tertiary);border-width:.25rem}.t-button{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-left:auto;opacity:0}.t-button:focus{opacity:1}\n"] }]
111
111
  }], propDecorators: { enabled: [{
112
112
  type: Input
113
113
  }], itemsChange: [{
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-table-components-reorder.mjs","sources":["../../../projects/addon-table/components/reorder/reorder.options.ts","../../../projects/addon-table/components/reorder/reorder.component.ts","../../../projects/addon-table/components/reorder/reorder.template.html","../../../projects/addon-table/components/reorder/taiga-ui-addon-table-components-reorder.ts"],"sourcesContent":["import type {Provider} from '@angular/core';\nimport {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport interface TuiReorderOptions {\n readonly icons: {\n readonly drag: string;\n readonly hide: string;\n readonly show: string;\n };\n}\n\nexport const TUI_REORDER_DEFAULT_OPTIONS: TuiReorderOptions = {\n icons: {\n hide: '@tui.eye-off',\n show: '@tui.eye',\n drag: '@tui.grip-vertical',\n },\n};\n\nexport const TUI_REORDER_OPTIONS = tuiCreateToken(TUI_REORDER_DEFAULT_OPTIONS);\n\nexport function tuiReorderOptionsProvider(options: Partial<TuiReorderOptions>): Provider {\n return tuiProvideOptions(TUI_REORDER_OPTIONS, options, TUI_REORDER_DEFAULT_OPTIONS);\n}\n","import {AsyncPipe, NgForOf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n} from '@angular/core';\nimport {TUI_TABLE_SHOW_HIDE_MESSAGE} from '@taiga-ui/addon-table/tokens';\nimport type {TuiContext} from '@taiga-ui/cdk/types';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TuiTiles} from '@taiga-ui/kit/components/tiles';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';\n\nimport {TUI_REORDER_OPTIONS} from './reorder.options';\n\n@Component({\n standalone: true,\n selector: 'tui-reorder',\n imports: [\n AsyncPipe,\n NgForOf,\n PolymorpheusOutlet,\n PolymorpheusTemplate,\n TuiButton,\n TuiIcon,\n TuiTiles,\n ],\n templateUrl: './reorder.template.html',\n styleUrls: ['./reorder.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(focusout.stop)': '(0)',\n '(pointerdown.silent)': 'onDrag()',\n '(document:pointerup.silent)': 'onDrop()',\n },\n})\nexport class TuiReorder<T> {\n private dragging = false;\n\n protected order = new Map<number, number>();\n protected unsortedItems: readonly T[] = [];\n protected readonly options = inject(TUI_REORDER_OPTIONS);\n protected readonly showHideText$ = inject(TUI_TABLE_SHOW_HIDE_MESSAGE);\n\n @Input()\n public enabled: readonly T[] = [];\n\n @Output()\n public readonly itemsChange = new EventEmitter<T[]>();\n\n @Output()\n public readonly enabledChange = new EventEmitter<T[]>();\n\n @Input()\n public set items(items: readonly T[]) {\n if (\n items.length !== this.unsortedItems.length ||\n !items.every((item) => this.unsortedItems.includes(item))\n ) {\n this.unsortedItems = items;\n }\n }\n\n @Input()\n public content: PolymorpheusContent<TuiContext<T> & {index: number}> = ({\n $implicit,\n }) => String($implicit);\n\n protected onDrag(): void {\n this.dragging = true;\n }\n\n protected onDrop(): void {\n if (!this.dragging) {\n return;\n }\n\n this.dragging = false;\n this.updateItems();\n }\n\n protected isEnabled(item: T): boolean {\n return this.enabled.includes(item);\n }\n\n protected getIcon(item: T): string {\n return this.isEnabled(item) ? this.options.icons.hide : this.options.icons.show;\n }\n\n protected toggle(toggled: T): void {\n this.enabled = this.isEnabled(toggled)\n ? this.enabled.filter((item) => item !== toggled)\n : this.enabled.concat(toggled);\n\n this.updateEnabled();\n }\n\n protected move(index: number, direction: number): void {\n const oldIndex = this.order.get(index) ?? index;\n\n if (\n (!oldIndex && direction < 0) ||\n (oldIndex === this.unsortedItems.length - 1 && direction > 0)\n ) {\n return;\n }\n\n const newIndex = oldIndex + direction;\n const oldItem = Array.from(this.order.values()).findIndex(\n (item) => item === newIndex,\n );\n\n this.order.set(index, newIndex);\n this.order.set(oldItem, oldIndex);\n this.order = new Map(this.order);\n\n this.updateItems();\n }\n\n private getSortedItems(): T[] {\n const items = new Array(this.unsortedItems.length);\n\n this.unsortedItems.forEach((item, index) => {\n items[this.order.get(index) ?? index] = item;\n });\n\n return items;\n }\n\n private updateItems(): void {\n this.itemsChange.emit(this.getSortedItems());\n this.updateEnabled();\n }\n\n private updateEnabled(): void {\n const enabled = this.getSortedItems().filter((item) => this.isEnabled(item));\n\n this.enabled = enabled;\n this.enabledChange.emit(enabled);\n }\n}\n","<tui-tiles\n class=\"t-wrapper\"\n [(order)]=\"order\"\n>\n <tui-tile\n *ngFor=\"let item of unsortedItems; let index = index\"\n [style.order]=\"order.get(index)\"\n >\n <div\n class=\"t-item\"\n [class.t-item_disabled]=\"!isEnabled(item)\"\n >\n <div\n tuiTileHandle\n class=\"t-draggable\"\n >\n <tui-icon\n class=\"t-icon\"\n [icon]=\"options.icons.drag\"\n />\n <ng-container *polymorpheusOutlet=\"content as template; context: {$implicit: item, index: index}\">\n {{ template }}\n </ng-container>\n </div>\n <button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [iconStart]=\"getIcon(item)\"\n (click)=\"toggle(item)\"\n (keydown.arrowDown.prevent)=\"move(index, 1)\"\n (keydown.arrowUp.prevent)=\"move(index, -1)\"\n >\n {{ showHideText$ | async }}\n </button>\n </div>\n </tui-tile>\n</tui-tiles>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAWa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A,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;4FAYF,UAAU,EAAA,UAAA,EAAA,CAAA;kBArBtB,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,aAAa,EACd,OAAA,EAAA;wBACL,SAAS;wBACT,OAAO;wBACP,kBAAkB;wBAClB,oBAAoB;wBACpB,SAAS;wBACT,OAAO;wBACP,QAAQ;qBACX,EAGgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,iBAAiB,EAAE,KAAK;AACxB,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,6BAA6B,EAAE,UAAU;AAC5C,qBAAA,EAAA,QAAA,EAAA,0wCAAA,EAAA,MAAA,EAAA,CAAA,s3BAAA,CAAA,EAAA,CAAA;8BAWM,OAAO,EAAA,CAAA;sBADb,KAAK;gBAIU,WAAW,EAAA,CAAA;sBAD1B,MAAM;gBAIS,aAAa,EAAA,CAAA;sBAD5B,MAAM;gBAII,KAAK,EAAA,CAAA;sBADf,KAAK;gBAWC,OAAO,EAAA,CAAA;sBADb,KAAK;;;AEnEV;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-table-components-reorder.mjs","sources":["../../../projects/addon-table/components/reorder/reorder.options.ts","../../../projects/addon-table/components/reorder/reorder.component.ts","../../../projects/addon-table/components/reorder/reorder.template.html","../../../projects/addon-table/components/reorder/taiga-ui-addon-table-components-reorder.ts"],"sourcesContent":["import type {Provider} from '@angular/core';\nimport {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport interface TuiReorderOptions {\n readonly icons: {\n readonly drag: string;\n readonly hide: string;\n readonly show: string;\n };\n}\n\nexport const TUI_REORDER_DEFAULT_OPTIONS: TuiReorderOptions = {\n icons: {\n hide: '@tui.eye-off',\n show: '@tui.eye',\n drag: '@tui.grip-vertical',\n },\n};\n\nexport const TUI_REORDER_OPTIONS = tuiCreateToken(TUI_REORDER_DEFAULT_OPTIONS);\n\nexport function tuiReorderOptionsProvider(options: Partial<TuiReorderOptions>): Provider {\n return tuiProvideOptions(TUI_REORDER_OPTIONS, options, TUI_REORDER_DEFAULT_OPTIONS);\n}\n","import {AsyncPipe, NgForOf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n inject,\n Input,\n Output,\n} from '@angular/core';\nimport {TUI_TABLE_SHOW_HIDE_MESSAGE} from '@taiga-ui/addon-table/tokens';\nimport type {TuiContext} from '@taiga-ui/cdk/types';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TuiTiles} from '@taiga-ui/kit/components/tiles';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';\n\nimport {TUI_REORDER_OPTIONS} from './reorder.options';\n\n@Component({\n standalone: true,\n selector: 'tui-reorder',\n imports: [\n AsyncPipe,\n NgForOf,\n PolymorpheusOutlet,\n PolymorpheusTemplate,\n TuiButton,\n TuiIcon,\n TuiTiles,\n ],\n templateUrl: './reorder.template.html',\n styleUrls: ['./reorder.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(focusout.stop)': '(0)',\n '(pointerdown.silent)': 'onDrag()',\n '(document:pointerup.silent)': 'onDrop()',\n },\n})\nexport class TuiReorder<T> {\n private dragging = false;\n\n protected order = new Map<number, number>();\n protected unsortedItems: readonly T[] = [];\n protected readonly options = inject(TUI_REORDER_OPTIONS);\n protected readonly showHideText$ = inject(TUI_TABLE_SHOW_HIDE_MESSAGE);\n\n @Input()\n public enabled: readonly T[] = [];\n\n @Output()\n public readonly itemsChange = new EventEmitter<T[]>();\n\n @Output()\n public readonly enabledChange = new EventEmitter<T[]>();\n\n @Input()\n public set items(items: readonly T[]) {\n if (\n items.length !== this.unsortedItems.length ||\n !items.every((item) => this.unsortedItems.includes(item))\n ) {\n this.unsortedItems = items;\n }\n }\n\n @Input()\n public content: PolymorpheusContent<TuiContext<T> & {index: number}> = ({\n $implicit,\n }) => String($implicit);\n\n protected onDrag(): void {\n this.dragging = true;\n }\n\n protected onDrop(): void {\n if (!this.dragging) {\n return;\n }\n\n this.dragging = false;\n this.updateItems();\n }\n\n protected isEnabled(item: T): boolean {\n return this.enabled.includes(item);\n }\n\n protected getIcon(item: T): string {\n return this.isEnabled(item) ? this.options.icons.hide : this.options.icons.show;\n }\n\n protected toggle(toggled: T): void {\n this.enabled = this.isEnabled(toggled)\n ? this.enabled.filter((item) => item !== toggled)\n : this.enabled.concat(toggled);\n\n this.updateEnabled();\n }\n\n protected move(index: number, direction: number): void {\n const oldIndex = this.order.get(index) ?? index;\n\n if (\n (!oldIndex && direction < 0) ||\n (oldIndex === this.unsortedItems.length - 1 && direction > 0)\n ) {\n return;\n }\n\n const newIndex = oldIndex + direction;\n const oldItem = Array.from(this.order.values()).findIndex(\n (item) => item === newIndex,\n );\n\n this.order.set(index, newIndex);\n this.order.set(oldItem, oldIndex);\n this.order = new Map(this.order);\n\n this.updateItems();\n }\n\n private getSortedItems(): T[] {\n const items = new Array(this.unsortedItems.length);\n\n this.unsortedItems.forEach((item, index) => {\n items[this.order.get(index) ?? index] = item;\n });\n\n return items;\n }\n\n private updateItems(): void {\n this.itemsChange.emit(this.getSortedItems());\n this.updateEnabled();\n }\n\n private updateEnabled(): void {\n const enabled = this.getSortedItems().filter((item) => this.isEnabled(item));\n\n this.enabled = enabled;\n this.enabledChange.emit(enabled);\n }\n}\n","<tui-tiles\n class=\"t-wrapper\"\n [(order)]=\"order\"\n>\n <tui-tile\n *ngFor=\"let item of unsortedItems; let index = index\"\n [style.order]=\"order.get(index)\"\n >\n <div\n class=\"t-item\"\n [class.t-item_disabled]=\"!isEnabled(item)\"\n >\n <div\n tuiTileHandle\n class=\"t-draggable\"\n >\n <tui-icon\n class=\"t-icon\"\n [icon]=\"options.icons.drag\"\n />\n <ng-container *polymorpheusOutlet=\"content as template; context: {$implicit: item, index: index}\">\n {{ template }}\n </ng-container>\n </div>\n <button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [iconStart]=\"getIcon(item)\"\n (click)=\"toggle(item)\"\n (keydown.arrowDown.prevent)=\"move(index, 1)\"\n (keydown.arrowUp.prevent)=\"move(index, -1)\"\n >\n {{ showHideText$ | async }}\n </button>\n </div>\n </tui-tile>\n</tui-tiles>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAWa,MAAA,2BAA2B,GAAsB;AAC1D,IAAA,KAAK,EAAE;AACH,QAAA,IAAI,EAAE,cAAc;AACpB,QAAA,IAAI,EAAE,UAAU;AAChB,QAAA,IAAI,EAAE,oBAAoB;AAC7B,KAAA;EACH;MAEW,mBAAmB,GAAG,cAAc,CAAC,2BAA2B,EAAE;AAEzE,SAAU,yBAAyB,CAAC,OAAmC,EAAA;IACzE,OAAO,iBAAiB,CAAC,mBAAmB,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC;AACxF;;ACJA,MAqBa,UAAU,CAAA;AArBvB,IAAA,WAAA,GAAA;QAsBY,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAEf,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;QAClC,I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QAAA,EACN,aAAa,EACd,OAAA,EAAA;wBACL,SAAS;wBACT,OAAO;wBACP,kBAAkB;wBAClB,oBAAoB;wBACpB,SAAS;wBACT,OAAO;wBACP,QAAQ;qBACX,EAGgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,iBAAiB,EAAE,KAAK;AACxB,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,6BAA6B,EAAE,UAAU;AAC5C,qBAAA,EAAA,QAAA,EAAA,0wCAAA,EAAA,MAAA,EAAA,CAAA,02BAAA,CAAA,EAAA,CAAA;8BAWM,OAAO,EAAA,CAAA;sBADb,KAAK;gBAIU,WAAW,EAAA,CAAA;sBAD1B,MAAM;gBAIS,aAAa,EAAA,CAAA;sBAD5B,MAAM;gBAII,KAAK,EAAA,CAAA;sBADf,KAAK;gBAWC,OAAO,EAAA,CAAA;sBADb,KAAK;;;AEnEV;;AAEG;;;;"}
@@ -13,13 +13,13 @@ import { tuiWatch, tuiTypedFromEvent, tuiPreventDefault, tuiQueryListChanges } f
13
13
  import { DOCUMENT, AsyncPipe, NgIf, NgTemplateOutlet, NgForOf } from '@angular/common';
14
14
  import { EMPTY_CLIENT_RECT, EMPTY_QUERY } from '@taiga-ui/cdk/constants';
15
15
  import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
16
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
16
17
  import { TuiIcon } from '@taiga-ui/core/components/icon';
17
18
  import { __decorate } from 'tslib';
18
19
  import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
19
20
  import { TuiChevron } from '@taiga-ui/kit/directives/chevron';
20
21
  import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
21
22
  import { TuiControl } from '@taiga-ui/cdk/classes';
22
- import { AbstractTuiControl } from '@taiga-ui/legacy/classes';
23
23
 
24
24
  class TuiTableCaption {
25
25
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableCaption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
@@ -54,6 +54,7 @@ const TUI_TABLE_DEFAULT_OPTIONS = {
54
54
  open: true,
55
55
  size: 'm',
56
56
  direction: 1,
57
+ requiredSort: false,
57
58
  sortIcons: {
58
59
  asc: '@tui.chevron-up',
59
60
  desc: '@tui.chevron-down',
@@ -277,6 +278,7 @@ class TuiTableTh {
277
278
  : null;
278
279
  this.resizable = this.options.resizable;
279
280
  this.sticky = this.options.sticky;
281
+ this.requiredSort = this.options.requiredSort;
280
282
  }
281
283
  get key() {
282
284
  if (!this.head) {
@@ -296,7 +298,8 @@ class TuiTableTh {
296
298
  return this.options.sortIcons.off;
297
299
  }
298
300
  updateSorterAndDirection() {
299
- this.table?.updateSorterAndDirection(this.isCurrentAndAscDirection ? null : this.sorter);
301
+ const sorter = this.requiredSort ? this.sorter : null;
302
+ this.table?.updateSorterAndDirection(this.isCurrentAndAscDirection ? sorter : this.sorter);
300
303
  }
301
304
  onResized(width) {
302
305
  this.width = width;
@@ -305,20 +308,23 @@ class TuiTableTh {
305
308
  return this.sorter === this.table?.sorter && this.table?.direction === -1;
306
309
  }
307
310
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableTh, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
308
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableTh, isStandalone: true, selector: "th[tuiTh]", inputs: { sorter: "sorter", resizable: "resizable", sticky: "sticky" }, host: { properties: { "style.width.px": "width", "class._sticky": "sticky" } }, 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\" />\n {{ table && table.change$ | async }}\n <tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n />\n</button>\n<ng-template #content>\n <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;block-size:var(--tui-height-m);font:var(--tui-font-text-s);text-align:start;font-weight:700;color:var(--tui-text-secondary);background:var(--tui-background-base);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-border-normal);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-inline-start:none}:host._sticky,:host-context(._stuck) :host._sticky{position:sticky;z-index: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;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host-context(._stuck) :host{z-index:20}:host-context(tr:not(:first-child)){border-block-start:none}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:700;padding:0 1rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-text-s);font-weight:700;padding:0 .5rem}:host-context(thead[tuiThead]){position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context([tuiTheme=\"dark\"])._sticky:after{background:#3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck):first-child{box-shadow:.0625rem .3125rem #3c3c3ce6}:host-context(table[data-size=\"l\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-l)}:host-context(table[data-size=\"m\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-m)}:host-context(table[data-size=\"s\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-s)}.t-sort{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;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-primary)}.t-sort:focus-visible{background:var(--tui-service-selection-background)}.t-sort:hover{color:var(--tui-text-primary)}.t-bar{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;top:0;bottom:0;right:-1px;inline-size:3px;justify-self:flex-end;border-inline-start:2px solid transparent;background:var(--tui-status-warning);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}.t-icon{border:.25rem solid transparent}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "directive", type: TuiTableResized, selector: "[tuiResized]", outputs: ["tuiResized"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
311
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableTh, isStandalone: true, selector: "th[tuiTh]", inputs: { sorter: "sorter", resizable: "resizable", sticky: "sticky", requiredSort: "requiredSort" }, host: { properties: { "style.width.px": "width", "class._sticky": "sticky", "attr.requiredSort": "requiredSort" } }, 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\" />\n {{ table && table.change$ | async }}\n <tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n />\n</button>\n<ng-template #content>\n <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;block-size:var(--tui-height-m);font:var(--tui-font-text-s);text-align:start;font-weight:700;color:var(--tui-text-secondary);background:var(--tui-background-base);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-border-normal);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-inline-start:none}:host._sticky,:host-context(._stuck) :host._sticky{position:sticky;z-index: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;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host-context(._stuck) :host{z-index:20}:host-context(tr:not(:first-child)){border-block-start:none}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:700;padding:0 1rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-text-s);font-weight:700;padding:0 .5rem}:host-context(thead[tuiThead]){position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context([tuiTheme=\"dark\"])._sticky:after{background:#3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck):first-child{box-shadow:.0625rem .3125rem #3c3c3ce6}:host-context(table[data-size=\"l\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-l)}:host-context(table[data-size=\"m\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-m)}:host-context(table[data-size=\"s\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-s)}.t-sort{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;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-primary)}.t-sort:focus-visible{background:var(--tui-service-selection-background)}.t-sort:hover{color:var(--tui-text-primary)}.t-bar{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;top:0;bottom:0;right:-1px;inline-size:3px;justify-self:flex-end;border-inline-start:2px solid transparent;background:var(--tui-status-warning);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}.t-icon{border-width:.25rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "directive", type: TuiTableResized, selector: "[tuiResized]", outputs: ["tuiResized"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
309
312
  }
310
313
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableTh, decorators: [{
311
314
  type: Component,
312
315
  args: [{ standalone: true, selector: 'th[tuiTh]', imports: [AsyncPipe, NgIf, NgTemplateOutlet, TuiIcon, TuiTableResized], changeDetection: ChangeDetectionStrategy.OnPush, host: {
313
316
  '[style.width.px]': 'width',
314
317
  '[class._sticky]': 'sticky',
315
- }, 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\" />\n {{ table && table.change$ | async }}\n <tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n />\n</button>\n<ng-template #content>\n <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;block-size:var(--tui-height-m);font:var(--tui-font-text-s);text-align:start;font-weight:700;color:var(--tui-text-secondary);background:var(--tui-background-base);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-border-normal);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-inline-start:none}:host._sticky,:host-context(._stuck) :host._sticky{position:sticky;z-index: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;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host-context(._stuck) :host{z-index:20}:host-context(tr:not(:first-child)){border-block-start:none}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:700;padding:0 1rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-text-s);font-weight:700;padding:0 .5rem}:host-context(thead[tuiThead]){position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context([tuiTheme=\"dark\"])._sticky:after{background:#3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck):first-child{box-shadow:.0625rem .3125rem #3c3c3ce6}:host-context(table[data-size=\"l\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-l)}:host-context(table[data-size=\"m\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-m)}:host-context(table[data-size=\"s\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-s)}.t-sort{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;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-primary)}.t-sort:focus-visible{background:var(--tui-service-selection-background)}.t-sort:hover{color:var(--tui-text-primary)}.t-bar{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;top:0;bottom:0;right:-1px;inline-size:3px;justify-self:flex-end;border-inline-start:2px solid transparent;background:var(--tui-status-warning);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}.t-icon{border:.25rem solid transparent}\n"] }]
318
+ '[attr.requiredSort]': 'requiredSort',
319
+ }, 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\" />\n {{ table && table.change$ | async }}\n <tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n />\n</button>\n<ng-template #content>\n <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;block-size:var(--tui-height-m);font:var(--tui-font-text-s);text-align:start;font-weight:700;color:var(--tui-text-secondary);background:var(--tui-background-base);cursor:default;padding:0 .75rem;box-sizing:border-box;box-shadow:0 .3125rem #ededed00;border:1px solid var(--tui-border-normal);filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:not(:first-child){border-inline-start:none}:host._sticky,:host-context(._stuck) :host._sticky{position:sticky;z-index: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;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host-context(._stuck) :host{z-index:20}:host-context(tr:not(:first-child)){border-block-start:none}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:700;padding:0 1rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-text-s);font-weight:700;padding:0 .5rem}:host-context(thead[tuiThead]){position:sticky}:host-context(table._stuck)._sticky:after{opacity:1}:host-context(thead[tuiThead]._stuck){box-shadow:0 .3125rem #edededb3}:host-context([tuiTheme=\"dark\"])._sticky:after{background:#3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck){box-shadow:0 .3125rem #3c3c3ce6}:host-context([tuiTheme=\"dark\"] thead[tuiThead]._stuck):first-child{box-shadow:.0625rem .3125rem #3c3c3ce6}:host-context(table[data-size=\"l\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-l)}:host-context(table[data-size=\"m\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-m)}:host-context(table[data-size=\"s\"] thead[tuiThead] tr:nth-child(2)){top:var(--tui-height-s)}.t-sort{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;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-primary)}.t-sort:focus-visible{background:var(--tui-service-selection-background)}.t-sort:hover{color:var(--tui-text-primary)}.t-bar{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;top:0;bottom:0;right:-1px;inline-size:3px;justify-self:flex-end;border-inline-start:2px solid transparent;background:var(--tui-status-warning);background-clip:content-box;cursor:ew-resize;opacity:0}.t-bar:hover,.t-bar:active{opacity:1}.t-icon{border-width:.25rem}\n"] }]
316
320
  }], propDecorators: { sorter: [{
317
321
  type: Input
318
322
  }], resizable: [{
319
323
  type: Input
320
324
  }], sticky: [{
321
325
  type: Input
326
+ }], requiredSort: [{
327
+ type: Input
322
328
  }] } });
323
329
  class TuiTableSortKeyException extends Error {
324
330
  constructor() {
@@ -336,9 +342,14 @@ class TuiTableSortable {
336
342
  get key() {
337
343
  return this.th.key;
338
344
  }
339
- ngOnInit() {
340
- this.sorter = this.match ? this.table.sorter : this.sorter;
341
- this.th.sorter = this.sorter;
345
+ ngOnChanges() {
346
+ if (this.sortable) {
347
+ this.sorter = this.match ? this.table.sorter : this.sorter;
348
+ this.th.sorter = this.sorter;
349
+ }
350
+ else {
351
+ this.th.sorter = null;
352
+ }
342
353
  }
343
354
  check() {
344
355
  if (this.match && this.table.sorter !== this.sorter) {
@@ -349,7 +360,7 @@ class TuiTableSortable {
349
360
  return this.sortBy.tuiSortBy === this.key;
350
361
  }
351
362
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableSortable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
352
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableSortable, isStandalone: true, selector: "th[tuiTh][tuiSortable]", ngImport: i0 }); }
363
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "16.2.12", type: TuiTableSortable, isStandalone: true, selector: "th[tuiTh][tuiSortable]", inputs: { sortable: ["tuiSortable", "sortable", coerceBooleanProperty] }, usesOnChanges: true, ngImport: i0 }); }
353
364
  }
354
365
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableSortable, decorators: [{
355
366
  type: Directive,
@@ -357,7 +368,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
357
368
  standalone: true,
358
369
  selector: 'th[tuiTh][tuiSortable]',
359
370
  }]
360
- }] });
371
+ }], propDecorators: { sortable: [{
372
+ type: Input,
373
+ args: [{
374
+ alias: 'tuiSortable',
375
+ transform: coerceBooleanProperty,
376
+ }]
377
+ }] } });
361
378
 
362
379
  class TuiTableSortBy {
363
380
  constructor() {
@@ -462,19 +479,16 @@ const TUI_TABLE_PROVIDER = [
462
479
 
463
480
  class TuiTableTd {
464
481
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableTd, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
465
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableTd, isStandalone: true, selector: "th[tuiTd], td[tuiTd]", host: { properties: { "class._editable": "current || legacy" } }, queries: [{ propertyName: "current", first: true, predicate: TuiControl, descendants: true }, { propertyName: "legacy", first: true, predicate: AbstractTuiControl, descendants: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{position:relative;text-align:start;background:var(--tui-background-base);border:1px solid var(--tui-border-normal);border-block-start:none;box-sizing:border-box;filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:first-child{left:0}:host:not(:first-child){border-inline-start:none}:host._editable:focus-within{z-index:1}:host._editable{padding:0!important;vertical-align:top}:host(th){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%;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host(th):focus-within:not(:disabled){z-index:11}:host-context([tuiTheme=\"dark\"]):after{background:#3c3c3ce6}:host-context(table._stuck){z-index:10}:host-context(table._stuck):last-of-type:after{opacity:1}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-text-m);padding:1rem}:host-context(table[data-size=\"m\"]){block-size:var(--tui-height-m);font:var(--tui-font-text-s);padding:.75rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-text-s);padding:.25rem .5rem}:host(td):focus-within{z-index:1}:host(td):not(:focus-within){z-index:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
482
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableTd, isStandalone: true, selector: "th[tuiTd], td[tuiTd]", host: { properties: { "class._editable": "control" } }, queries: [{ propertyName: "control", first: true, predicate: TuiControl, descendants: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{position:relative;text-align:start;background:var(--tui-background-base);border:1px solid var(--tui-border-normal);border-block-start:none;box-sizing:border-box;filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:first-child{left:0}:host:not(:first-child){border-inline-start:none}:host._editable:focus-within{z-index:1}:host._editable{padding:0!important;vertical-align:top}:host(th){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%;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host(th):focus-within:not(:disabled){z-index:11}:host-context([tuiTheme=\"dark\"]):after{background:#3c3c3ce6}:host-context(table._stuck){z-index:10}:host-context(table._stuck):last-of-type:after{opacity:1}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-text-m);padding:1rem}:host-context(table[data-size=\"m\"]){block-size:var(--tui-height-m);font:var(--tui-font-text-s);padding:.75rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-text-s);padding:.25rem .5rem}:host(td):focus-within{z-index:1}:host(td):not(:focus-within){z-index:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
466
483
  }
467
484
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableTd, decorators: [{
468
485
  type: Component,
469
486
  args: [{ standalone: true, selector: 'th[tuiTd], td[tuiTd]', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, host: {
470
- '[class._editable]': 'current || legacy',
487
+ '[class._editable]': 'control',
471
488
  }, styles: [":host{position:relative;text-align:start;background:var(--tui-background-base);border:1px solid var(--tui-border-normal);border-block-start:none;box-sizing:border-box;filter:opacity(1)}@supports (-webkit-hyphens: none){:host{transform:translateZ(0)}}:host:first-child{left:0}:host:not(:first-child){border-inline-start:none}:host._editable:focus-within{z-index:1}:host._editable{padding:0!important;vertical-align:top}:host(th){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%;inline-size:.3125rem;pointer-events:none;background:#edededb3;opacity:0}:host(th):focus-within:not(:disabled){z-index:11}:host-context([tuiTheme=\"dark\"]):after{background:#3c3c3ce6}:host-context(table._stuck){z-index:10}:host-context(table._stuck):last-of-type:after{opacity:1}:host-context(table[data-size=\"l\"]){block-size:var(--tui-height-l);font:var(--tui-font-text-m);padding:1rem}:host-context(table[data-size=\"m\"]){block-size:var(--tui-height-m);font:var(--tui-font-text-s);padding:.75rem}:host-context(table[data-size=\"s\"]){block-size:var(--tui-height-s);font:var(--tui-font-text-s);padding:.25rem .5rem}:host(td):focus-within{z-index:1}:host(td):not(:focus-within){z-index:0}\n"] }]
472
- }], propDecorators: { current: [{
489
+ }], propDecorators: { control: [{
473
490
  type: ContentChild,
474
491
  args: [TuiControl]
475
- }], legacy: [{
476
- type: ContentChild,
477
- args: [AbstractTuiControl]
478
492
  }] } });
479
493
 
480
494
  class TuiTableTr {
@@ -491,11 +505,20 @@ class TuiTableTr {
491
505
  this.contentReady$.next(true);
492
506
  }
493
507
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableTr, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
494
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableTr, isStandalone: true, selector: "tr[tuiTr]", providers: [TUI_TABLE_PROVIDER], queries: [{ propertyName: "cells", predicate: i0.forwardRef(function () { return TuiTableCell; }) }], ngImport: i0, template: "<ng-container *ngIf=\"cells$ | async as items\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"(items[key] && 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: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiTableTd, selector: "th[tuiTd], td[tuiTd]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
508
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableTr, isStandalone: true, selector: "tr[tuiTr]", host: { attributes: { "ngSkipHydration": "true" } }, providers: [TUI_TABLE_PROVIDER], queries: [{ propertyName: "cells", predicate: i0.forwardRef(function () { return TuiTableCell; }) }], ngImport: i0, template: "<ng-container *ngIf=\"cells$ | async as items\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"(items[key] && 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: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiTableTd, selector: "th[tuiTd], td[tuiTd]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
495
509
  }
496
510
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableTr, decorators: [{
497
511
  type: Component,
498
- args: [{ standalone: true, selector: 'tr[tuiTr]', imports: [AsyncPipe, NgForOf, NgIf, NgTemplateOutlet, TuiTableTd], 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] && 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" }]
512
+ args: [{ standalone: true, selector: 'tr[tuiTr]', imports: [AsyncPipe, NgForOf, NgIf, NgTemplateOutlet, TuiTableTd], changeDetection: ChangeDetectionStrategy.OnPush, providers: [TUI_TABLE_PROVIDER], host: {
513
+ /**
514
+ * TODO: fix later
515
+ * Be careful and thoughtful about using this attribute.
516
+ * It is intended as a last resort workaround.
517
+ * Components that break hydration should be
518
+ * considered bugs that need to be fixed.
519
+ */
520
+ ngSkipHydration: 'true',
521
+ }, template: "<ng-container *ngIf=\"cells$ | async as items\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"(items[key] && 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" }]
499
522
  }], propDecorators: { cells: [{
500
523
  type: ContentChildren,
501
524
  args: [forwardRef(() => TuiTableCell)]
@@ -543,11 +566,20 @@ class TuiTableThGroup {
543
566
  this.heads$ = this.heads.changes.pipe(startWith(null), map(() => this.heads.reduce((record, item) => ({ ...record, [item.tuiHead]: item }), {})));
544
567
  }
545
568
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableThGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
546
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableThGroup, isStandalone: true, selector: "tr[tuiThGroup]", providers: [TUI_TABLE_PROVIDER], queries: [{ propertyName: "th", first: true, predicate: i0.forwardRef(function () { return TuiTableTh; }), descendants: true }, { propertyName: "heads", predicate: i0.forwardRef(function () { return TuiTableHead; }) }], ngImport: i0, template: "<ng-content />\n<ng-container *ngIf=\"heads$ | async as headings\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"(headings[key] && headings[key].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: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiTableTh, selector: "th[tuiTh]", inputs: ["sorter", "resizable", "sticky"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
569
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTableThGroup, isStandalone: true, selector: "tr[tuiThGroup]", host: { attributes: { "ngSkipHydration": "true" } }, providers: [TUI_TABLE_PROVIDER], queries: [{ propertyName: "th", first: true, predicate: i0.forwardRef(function () { return TuiTableTh; }), descendants: true }, { propertyName: "heads", predicate: i0.forwardRef(function () { return TuiTableHead; }) }], ngImport: i0, template: "<ng-content />\n<ng-container *ngIf=\"heads$ | async as headings\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"(headings[key] && headings[key].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: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TuiTableTh, selector: "th[tuiTh]", inputs: ["sorter", "resizable", "sticky", "requiredSort"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
547
570
  }
548
571
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTableThGroup, decorators: [{
549
572
  type: Component,
550
- args: [{ standalone: true, selector: 'tr[tuiThGroup]', imports: [AsyncPipe, NgForOf, NgIf, NgTemplateOutlet, TuiTableTh], changeDetection: ChangeDetectionStrategy.OnPush, providers: [TUI_TABLE_PROVIDER], template: "<ng-content />\n<ng-container *ngIf=\"heads$ | async as headings\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"(headings[key] && headings[key].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" }]
573
+ args: [{ standalone: true, selector: 'tr[tuiThGroup]', imports: [AsyncPipe, NgForOf, NgIf, NgTemplateOutlet, TuiTableTh], changeDetection: ChangeDetectionStrategy.OnPush, providers: [TUI_TABLE_PROVIDER], host: {
574
+ /**
575
+ * TODO: fix later
576
+ * Be careful and thoughtful about using this attribute.
577
+ * It is intended as a last resort workaround.
578
+ * Components that break hydration should be
579
+ * considered bugs that need to be fixed.
580
+ */
581
+ ngSkipHydration: 'true',
582
+ }, template: "<ng-content />\n<ng-container *ngIf=\"heads$ | async as headings\">\n <ng-container\n *ngFor=\"let key of table.columns\"\n [ngTemplateOutlet]=\"(headings[key] && headings[key].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" }]
551
583
  }], propDecorators: { th: [{
552
584
  type: ContentChild,
553
585
  args: [forwardRef(() => TuiTableTh)]