UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

1 lines 154 kB
{"version":3,"file":"ng-zorro-antd-table.mjs","sources":["../../components/table/src/addon/filter-trigger.component.ts","../../components/table/src/addon/filter.component.ts","../../components/table/src/addon/row-expand-button.directive.ts","../../components/table/src/addon/row-indent.directive.ts","../../components/table/src/addon/selection.component.ts","../../components/table/src/addon/sorters.component.ts","../../components/table/src/cell/cell-fixed.directive.ts","../../components/table/src/table-style.service.ts","../../components/table/src/cell/cell.directive.ts","../../components/table/src/cell/td-addon.component.ts","../../components/table/src/cell/th-addon.component.ts","../../components/table/src/cell/th-measure.directive.ts","../../components/table/src/cell/th-selection.component.ts","../../components/table/src/styled/align.directive.ts","../../components/table/src/styled/ellipsis.directive.ts","../../components/table/src/styled/word-break.directive.ts","../../components/table/src/table/table-content.component.ts","../../components/table/src/table/table-fixed-row.component.ts","../../components/table/src/table/table-inner-default.component.ts","../../components/table/src/table/tr-measure.component.ts","../../components/table/src/table/tbody.component.ts","../../components/table/src/table/table-inner-scroll.component.ts","../../components/table/src/table/table-virtual-scroll.directive.ts","../../components/table/src/table-data.service.ts","../../components/table/src/table/title-footer.component.ts","../../components/table/src/table/table.component.ts","../../components/table/src/table/tr.directive.ts","../../components/table/src/table/thead.component.ts","../../components/table/src/table/tr-expand.directive.ts","../../components/table/src/table.module.ts","../../components/table/public-api.ts","../../components/table/ng-zorro-antd-table.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';\nimport { NzDestroyService } from 'ng-zorro-antd/core/services';\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\nimport { NzDropDownDirective, NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';\n\nconst NZ_CONFIG_MODULE_NAME: NzConfigKey = 'filterTrigger';\n\n@Component({\n selector: 'nz-filter-trigger',\n exportAs: `nzFilterTrigger`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n encapsulation: ViewEncapsulation.None,\n template: `\n <span\n nz-dropdown\n class=\"ant-table-filter-trigger\"\n nzTrigger=\"click\"\n nzPlacement=\"bottomRight\"\n [nzBackdrop]=\"nzBackdrop\"\n [nzClickHide]=\"false\"\n [nzDropdownMenu]=\"nzDropdownMenu\"\n [class.active]=\"nzActive\"\n [class.ant-table-filter-open]=\"nzVisible\"\n [nzVisible]=\"nzVisible\"\n (nzVisibleChange)=\"onVisibleChange($event)\"\n >\n <ng-content></ng-content>\n </span>\n `,\n providers: [NzDestroyService]\n})\nexport class NzFilterTriggerComponent implements OnInit {\n readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;\n\n static ngAcceptInputType_nzBackdrop: BooleanInput;\n\n @Input() nzActive = false;\n @Input() nzDropdownMenu!: NzDropdownMenuComponent;\n @Input() nzVisible = false;\n\n @Input() @WithConfig<boolean>() @InputBoolean() nzBackdrop = false;\n\n @Output() readonly nzVisibleChange = new EventEmitter<boolean>();\n\n @ViewChild(NzDropDownDirective, { static: true, read: ElementRef }) nzDropdown!: ElementRef<HTMLElement>;\n\n onVisibleChange(visible: boolean): void {\n this.nzVisible = visible;\n this.nzVisibleChange.next(visible);\n }\n\n hide(): void {\n this.nzVisible = false;\n this.cdr.markForCheck();\n }\n\n show(): void {\n this.nzVisible = true;\n this.cdr.markForCheck();\n }\n\n constructor(\n public readonly nzConfigService: NzConfigService,\n private ngZone: NgZone,\n private cdr: ChangeDetectorRef,\n private destroy$: NzDestroyService\n ) {}\n\n ngOnInit(): void {\n this.ngZone.runOutsideAngular(() => {\n fromEvent(this.nzDropdown.nativeElement, 'click')\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => {\n event.stopPropagation();\n });\n });\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { arraysEqual } from 'ng-zorro-antd/core/util';\nimport { NzI18nService, NzTableI18nInterface } from 'ng-zorro-antd/i18n';\n\nimport { NzTableFilterList } from '../table.types';\n\ninterface NzThItemInterface {\n text: string;\n value: NzSafeAny;\n checked: boolean;\n}\n\n@Component({\n selector: 'nz-table-filter',\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <span class=\"ant-table-column-title\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template>\n </span>\n <ng-container *ngIf=\"!customFilter; else extraTemplate\">\n <nz-filter-trigger\n [nzVisible]=\"isVisible\"\n [nzActive]=\"isChecked\"\n [nzDropdownMenu]=\"filterMenu\"\n (nzVisibleChange)=\"onVisibleChange($event)\"\n >\n <i nz-icon nzType=\"filter\" nzTheme=\"fill\"></i>\n </nz-filter-trigger>\n <nz-dropdown-menu #filterMenu=\"nzDropdownMenu\">\n <div class=\"ant-table-filter-dropdown\">\n <ul nz-menu>\n <li\n nz-menu-item\n [nzSelected]=\"f.checked\"\n *ngFor=\"let f of listOfParsedFilter; trackBy: trackByValue\"\n (click)=\"check(f)\"\n >\n <label nz-radio *ngIf=\"!filterMultiple\" [ngModel]=\"f.checked\" (ngModelChange)=\"check(f)\"></label>\n <label nz-checkbox *ngIf=\"filterMultiple\" [ngModel]=\"f.checked\" (ngModelChange)=\"check(f)\"></label>\n <span>{{ f.text }}</span>\n </li>\n </ul>\n <div class=\"ant-table-filter-dropdown-btns\">\n <button nz-button nzType=\"link\" nzSize=\"small\" (click)=\"reset()\" [disabled]=\"!isChecked\">\n {{ locale.filterReset }}\n </button>\n <button nz-button nzType=\"primary\" nzSize=\"small\" (click)=\"confirm()\">{{ locale.filterConfirm }}</button>\n </div>\n </div>\n </nz-dropdown-menu>\n </ng-container>\n `,\n host: { class: 'ant-table-filter-column' }\n})\nexport class NzTableFilterComponent implements OnChanges, OnDestroy, OnInit {\n @Input() contentTemplate: TemplateRef<NzSafeAny> | null = null;\n @Input() customFilter = false;\n @Input() extraTemplate: TemplateRef<NzSafeAny> | null = null;\n @Input() filterMultiple = true;\n @Input() listOfFilter: NzTableFilterList = [];\n @Output() readonly filterChange = new EventEmitter<NzSafeAny[] | NzSafeAny>();\n private destroy$ = new Subject();\n locale!: NzTableI18nInterface;\n isChecked = false;\n isVisible = false;\n listOfParsedFilter: NzThItemInterface[] = [];\n listOfChecked: NzSafeAny[] = [];\n\n trackByValue(_: number, item: NzThItemInterface): NzSafeAny {\n return item.value;\n }\n\n check(filter: NzThItemInterface): void {\n if (this.filterMultiple) {\n this.listOfParsedFilter = this.listOfParsedFilter.map(item => {\n if (item === filter) {\n return { ...item, checked: !filter.checked };\n } else {\n return item;\n }\n });\n filter.checked = !filter.checked;\n } else {\n this.listOfParsedFilter = this.listOfParsedFilter.map(item => ({ ...item, checked: item === filter }));\n }\n this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);\n }\n\n confirm(): void {\n this.isVisible = false;\n this.emitFilterData();\n }\n\n reset(): void {\n this.isVisible = false;\n this.listOfParsedFilter = this.parseListOfFilter(this.listOfFilter, true);\n this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);\n this.emitFilterData();\n }\n\n onVisibleChange(value: boolean): void {\n this.isVisible = value;\n if (!value) {\n this.emitFilterData();\n } else {\n this.listOfChecked = this.listOfParsedFilter.filter(item => item.checked).map(item => item.value);\n }\n }\n\n emitFilterData(): void {\n const listOfChecked = this.listOfParsedFilter.filter(item => item.checked).map(item => item.value);\n if (!arraysEqual(this.listOfChecked, listOfChecked)) {\n if (this.filterMultiple) {\n this.filterChange.emit(listOfChecked);\n } else {\n this.filterChange.emit(listOfChecked.length > 0 ? listOfChecked[0] : null);\n }\n }\n }\n\n parseListOfFilter(listOfFilter: NzTableFilterList, reset?: boolean): NzThItemInterface[] {\n return listOfFilter.map(item => {\n const checked = reset ? false : !!item.byDefault;\n return { text: item.text, value: item.value, checked };\n });\n }\n\n getCheckedStatus(listOfParsedFilter: NzThItemInterface[]): boolean {\n return listOfParsedFilter.some(item => item.checked);\n }\n\n constructor(private cdr: ChangeDetectorRef, private i18n: NzI18nService) {}\n\n ngOnInit(): void {\n this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.locale = this.i18n.getLocaleData('Table');\n this.cdr.markForCheck();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { listOfFilter } = changes;\n if (listOfFilter && this.listOfFilter && this.listOfFilter.length) {\n this.listOfParsedFilter = this.parseListOfFilter(this.listOfFilter);\n this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);\n }\n }\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, EventEmitter, Input, Output } from '@angular/core';\n\n@Directive({\n selector: 'button[nz-row-expand-button]',\n host: {\n class: 'ant-table-row-expand-icon',\n '[type]': `'button'`,\n '[class.ant-table-row-expand-icon-expanded]': `!spaceMode && expand === true`,\n '[class.ant-table-row-expand-icon-collapsed]': `!spaceMode && expand === false`,\n '[class.ant-table-row-expand-icon-spaced]': 'spaceMode',\n '(click)': 'onHostClick()'\n }\n})\nexport class NzRowExpandButtonDirective {\n @Input() expand = false;\n @Input() spaceMode = false;\n @Output() readonly expandChange = new EventEmitter();\n\n constructor() {}\n\n onHostClick(): void {\n if (!this.spaceMode) {\n this.expand = !this.expand;\n this.expandChange.next(this.expand);\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, Input } from '@angular/core';\n\n@Directive({\n selector: 'nz-row-indent',\n host: {\n class: 'ant-table-row-indent',\n '[style.padding-left.px]': 'indentSize'\n }\n})\nexport class NzRowIndentDirective {\n @Input() indentSize = 0;\n\n constructor() {}\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n@Component({\n selector: 'nz-table-selection',\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <label\n *ngIf=\"showCheckbox\"\n nz-checkbox\n [class.ant-table-selection-select-all-custom]=\"showRowSelection\"\n [ngModel]=\"checked\"\n [nzDisabled]=\"disabled\"\n [nzIndeterminate]=\"indeterminate\"\n (ngModelChange)=\"onCheckedChange($event)\"\n ></label>\n <div class=\"ant-table-selection-extra\" *ngIf=\"showRowSelection\">\n <span nz-dropdown class=\"ant-table-selection-down\" nzPlacement=\"bottomLeft\" [nzDropdownMenu]=\"selectionMenu\">\n <i nz-icon nzType=\"down\"></i>\n </span>\n <nz-dropdown-menu #selectionMenu=\"nzDropdownMenu\">\n <ul nz-menu class=\"ant-table-selection-menu\">\n <li nz-menu-item *ngFor=\"let selection of listOfSelections\" (click)=\"selection.onSelect()\">\n {{ selection.text }}\n </li>\n </ul>\n </nz-dropdown-menu>\n </div>\n `,\n host: { class: 'ant-table-selection' }\n})\nexport class NzTableSelectionComponent {\n @Input() listOfSelections: Array<{ text: string; onSelect(...args: NzSafeAny[]): NzSafeAny }> = [];\n @Input() checked = false;\n @Input() disabled = false;\n @Input() indeterminate = false;\n @Input() showCheckbox = false;\n @Input() showRowSelection = false;\n @Output() readonly checkedChange = new EventEmitter<boolean>();\n\n constructor() {}\n\n onCheckedChange(checked: boolean): void {\n this.checked = checked;\n this.checkedChange.emit(checked);\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnChanges,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzTableSortOrder } from '../table.types';\n\n@Component({\n selector: 'nz-table-sorters',\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <span class=\"ant-table-column-title\"><ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template></span>\n <span class=\"ant-table-column-sorter\" [class.ant-table-column-sorter-full]=\"isDown && isUp\">\n <span class=\"ant-table-column-sorter-inner\">\n <i\n nz-icon\n nzType=\"caret-up\"\n *ngIf=\"isUp\"\n class=\"ant-table-column-sorter-up\"\n [class.active]=\"sortOrder === 'ascend'\"\n ></i>\n <i\n nz-icon\n nzType=\"caret-down\"\n *ngIf=\"isDown\"\n class=\"ant-table-column-sorter-down\"\n [class.active]=\"sortOrder === 'descend'\"\n ></i>\n </span>\n </span>\n `,\n host: { class: 'ant-table-column-sorters' }\n})\nexport class NzTableSortersComponent implements OnChanges {\n @Input() sortDirections: NzTableSortOrder[] = ['ascend', 'descend', null];\n @Input() sortOrder: NzTableSortOrder = null;\n @Input() contentTemplate: TemplateRef<NzSafeAny> | null = null;\n isUp = false;\n isDown = false;\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n const { sortDirections } = changes;\n if (sortDirections) {\n this.isUp = this.sortDirections.indexOf('ascend') !== -1;\n this.isDown = this.sortDirections.indexOf('descend') !== -1;\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, ElementRef, Input, OnChanges, Renderer2 } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Directive({\n selector: 'td[nzRight],th[nzRight],td[nzLeft],th[nzLeft]',\n host: {\n '[class.ant-table-cell-fix-right]': `isFixedRight`,\n '[class.ant-table-cell-fix-left]': `isFixedLeft`,\n '[style.position]': `isFixed? 'sticky' : null`\n }\n})\nexport class NzCellFixedDirective implements OnChanges {\n @Input() nzRight: string | boolean = false;\n @Input() nzLeft: string | boolean = false;\n @Input() colspan: number | null = null;\n @Input() colSpan: number | null = null;\n changes$ = new Subject<void>();\n isAutoLeft = false;\n isAutoRight = false;\n isFixedLeft = false;\n isFixedRight = false;\n isFixed = false;\n\n setAutoLeftWidth(autoLeft: string | null): void {\n this.renderer.setStyle(this.elementRef.nativeElement, 'left', autoLeft);\n }\n\n setAutoRightWidth(autoRight: string | null): void {\n this.renderer.setStyle(this.elementRef.nativeElement, 'right', autoRight);\n }\n\n setIsFirstRight(isFirstRight: boolean): void {\n this.setFixClass(isFirstRight, 'ant-table-cell-fix-right-first');\n }\n\n setIsLastLeft(isLastLeft: boolean): void {\n this.setFixClass(isLastLeft, 'ant-table-cell-fix-left-last');\n }\n\n private setFixClass(flag: boolean, className: string): void {\n // the setFixClass function may call many times, so remove it first.\n this.renderer.removeClass(this.elementRef.nativeElement, className);\n\n if (flag) {\n this.renderer.addClass(this.elementRef.nativeElement, className);\n }\n }\n\n constructor(private renderer: Renderer2, private elementRef: ElementRef) {}\n\n ngOnChanges(): void {\n this.setIsFirstRight(false);\n this.setIsLastLeft(false);\n this.isAutoLeft = this.nzLeft === '' || this.nzLeft === true;\n this.isAutoRight = this.nzRight === '' || this.nzRight === true;\n this.isFixedLeft = this.nzLeft !== false;\n this.isFixedRight = this.nzRight !== false;\n this.isFixed = this.isFixedLeft || this.isFixedRight;\n const validatePx = (value: string | boolean): string | null => {\n if (typeof value === 'string' && value !== '') {\n return value;\n } else {\n return null;\n }\n };\n this.setAutoLeftWidth(validatePx(this.nzLeft));\n this.setAutoRightWidth(validatePx(this.nzRight));\n this.changes$.next();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Injectable, TemplateRef } from '@angular/core';\nimport { BehaviorSubject, combineLatest, merge, ReplaySubject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzThMeasureDirective } from './cell/th-measure.directive';\n\n@Injectable()\nexport class NzTableStyleService {\n theadTemplate$ = new ReplaySubject<TemplateRef<NzSafeAny>>(1);\n hasFixLeft$ = new ReplaySubject<boolean>(1);\n hasFixRight$ = new ReplaySubject<boolean>(1);\n hostWidth$ = new ReplaySubject<number>(1);\n columnCount$ = new ReplaySubject<number>(1);\n showEmpty$ = new ReplaySubject<boolean>(1);\n noResult$ = new ReplaySubject<string | TemplateRef<NzSafeAny> | undefined>(1);\n private listOfThWidthConfigPx$ = new BehaviorSubject<ReadonlyArray<string | null>>([]);\n private tableWidthConfigPx$ = new BehaviorSubject<ReadonlyArray<string | null>>([]);\n manualWidthConfigPx$ = combineLatest([this.tableWidthConfigPx$, this.listOfThWidthConfigPx$]).pipe(\n map(([widthConfig, listOfWidth]) => (widthConfig.length ? widthConfig : listOfWidth))\n );\n private listOfAutoWidthPx$ = new ReplaySubject<readonly string[]>(1);\n listOfListOfThWidthPx$ = merge(\n /** init with manual width **/\n this.manualWidthConfigPx$,\n combineLatest([this.listOfAutoWidthPx$, this.manualWidthConfigPx$]).pipe(\n map(([autoWidth, manualWidth]) => {\n /** use autoWidth until column length match **/\n if (autoWidth.length === manualWidth.length) {\n return autoWidth.map((width, index) => {\n if (width === '0px') {\n return manualWidth[index] || null;\n } else {\n return manualWidth[index] || width;\n }\n });\n } else {\n return manualWidth;\n }\n })\n )\n );\n listOfMeasureColumn$ = new ReplaySubject<readonly string[]>(1);\n listOfListOfThWidth$ = this.listOfAutoWidthPx$.pipe(map(list => list.map(width => parseInt(width, 10))));\n enableAutoMeasure$ = new ReplaySubject<boolean>(1);\n\n setTheadTemplate(template: TemplateRef<NzSafeAny>): void {\n this.theadTemplate$.next(template);\n }\n\n setHasFixLeft(hasFixLeft: boolean): void {\n this.hasFixLeft$.next(hasFixLeft);\n }\n\n setHasFixRight(hasFixRight: boolean): void {\n this.hasFixRight$.next(hasFixRight);\n }\n\n setTableWidthConfig(widthConfig: ReadonlyArray<string | null>): void {\n this.tableWidthConfigPx$.next(widthConfig);\n }\n\n setListOfTh(listOfTh: readonly NzThMeasureDirective[]): void {\n let columnCount = 0;\n listOfTh.forEach(th => {\n columnCount += (th.colspan && +th.colspan) || (th.colSpan && +th.colSpan) || 1;\n });\n const listOfThPx = listOfTh.map(item => item.nzWidth);\n this.columnCount$.next(columnCount);\n this.listOfThWidthConfigPx$.next(listOfThPx);\n }\n\n setListOfMeasureColumn(listOfTh: readonly NzThMeasureDirective[]): void {\n const listOfKeys: string[] = [];\n listOfTh.forEach(th => {\n const length = (th.colspan && +th.colspan) || (th.colSpan && +th.colSpan) || 1;\n for (let i = 0; i < length; i++) {\n listOfKeys.push(`measure_key_${i}`);\n }\n });\n this.listOfMeasureColumn$.next(listOfKeys);\n }\n\n setListOfAutoWidth(listOfAutoWidth: number[]): void {\n this.listOfAutoWidthPx$.next(listOfAutoWidth.map(width => `${width}px`));\n }\n\n setShowEmpty(showEmpty: boolean): void {\n this.showEmpty$.next(showEmpty);\n }\n\n setNoResult(noResult: string | TemplateRef<NzSafeAny> | undefined): void {\n this.noResult$.next(noResult);\n }\n\n setScroll(scrollX: string | null, scrollY: string | null): void {\n const enableAutoMeasure = !!(scrollX || scrollY);\n if (!enableAutoMeasure) {\n this.setListOfAutoWidth([]);\n }\n this.enableAutoMeasure$.next(enableAutoMeasure);\n }\n\n constructor() {}\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, Optional } from '@angular/core';\n\nimport { NzTableStyleService } from '../table-style.service';\n\n@Directive({\n selector: 'th:not(.nz-disable-th):not([mat-cell]), td:not(.nz-disable-td):not([mat-cell])',\n host: {\n '[class.ant-table-cell]': 'isInsideTable'\n }\n})\nexport class NzTableCellDirective {\n isInsideTable = false;\n constructor(@Optional() nzTableStyleService: NzTableStyleService) {\n this.isInsideTable = !!nzTableStyleService;\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/* eslint-disable @angular-eslint/component-selector */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChange,\n SimpleChanges,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\n@Component({\n selector:\n 'td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n encapsulation: ViewEncapsulation.None,\n template: `\n <ng-container *ngIf=\"nzShowExpand || nzIndentSize > 0\">\n <nz-row-indent [indentSize]=\"nzIndentSize\"></nz-row-indent>\n <button\n nz-row-expand-button\n [expand]=\"nzExpand\"\n (expandChange)=\"onExpandChange($event)\"\n [spaceMode]=\"!nzShowExpand\"\n ></button>\n </ng-container>\n <label\n nz-checkbox\n *ngIf=\"nzShowCheckbox\"\n [nzDisabled]=\"nzDisabled\"\n [ngModel]=\"nzChecked\"\n [nzIndeterminate]=\"nzIndeterminate\"\n (ngModelChange)=\"onCheckedChange($event)\"\n ></label>\n <ng-content></ng-content>\n `,\n host: {\n '[class.ant-table-cell-with-append]': `nzShowExpand || nzIndentSize > 0`,\n '[class.ant-table-selection-column]': `nzShowCheckbox`\n }\n})\nexport class NzTdAddOnComponent implements OnChanges {\n static ngAcceptInputType_nzShowExpand: BooleanInput;\n static ngAcceptInputType_nzShowCheckbox: BooleanInput;\n static ngAcceptInputType_nzExpand: BooleanInput;\n\n @Input() nzChecked = false;\n @Input() nzDisabled = false;\n @Input() nzIndeterminate = false;\n @Input() nzIndentSize = 0;\n @Input() @InputBoolean() nzShowExpand = false;\n @Input() @InputBoolean() nzShowCheckbox = false;\n @Input() @InputBoolean() nzExpand = false;\n @Output() readonly nzCheckedChange = new EventEmitter<boolean>();\n @Output() readonly nzExpandChange = new EventEmitter<boolean>();\n private isNzShowExpandChanged = false;\n private isNzShowCheckboxChanged = false;\n\n onCheckedChange(checked: boolean): void {\n this.nzChecked = checked;\n this.nzCheckedChange.emit(checked);\n }\n\n onExpandChange(expand: boolean): void {\n this.nzExpand = expand;\n this.nzExpandChange.emit(expand);\n }\n ngOnChanges(changes: SimpleChanges): void {\n const isFirstChange = (value: SimpleChange): boolean =>\n value && value.firstChange && value.currentValue !== undefined;\n const { nzExpand, nzChecked, nzShowExpand, nzShowCheckbox } = changes;\n if (nzShowExpand) {\n this.isNzShowExpandChanged = true;\n }\n if (nzShowCheckbox) {\n this.isNzShowCheckboxChanged = true;\n }\n if (isFirstChange(nzExpand) && !this.isNzShowExpandChanged) {\n this.nzShowExpand = true;\n }\n if (isFirstChange(nzChecked) && !this.isNzShowCheckboxChanged) {\n this.nzShowCheckbox = true;\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/* eslint-disable @angular-eslint/component-selector */\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n OnInit,\n Output,\n SimpleChange,\n SimpleChanges,\n ViewEncapsulation\n} from '@angular/core';\nimport { fromEvent, Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport { NzDestroyService } from 'ng-zorro-antd/core/services';\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\nimport {\n NzTableFilterFn,\n NzTableFilterList,\n NzTableFilterValue,\n NzTableSortFn,\n NzTableSortOrder\n} from '../table.types';\n\n@Component({\n selector:\n 'th[nzColumnKey], th[nzSortFn], th[nzSortOrder], th[nzFilters], th[nzShowSort], th[nzShowFilter], th[nzCustomFilter]',\n preserveWhitespaces: false,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <nz-table-filter\n *ngIf=\"nzShowFilter || nzCustomFilter; else notFilterTemplate\"\n [contentTemplate]=\"notFilterTemplate\"\n [extraTemplate]=\"extraTemplate\"\n [customFilter]=\"nzCustomFilter\"\n [filterMultiple]=\"nzFilterMultiple\"\n [listOfFilter]=\"nzFilters\"\n (filterChange)=\"onFilterValueChange($event)\"\n ></nz-table-filter>\n <ng-template #notFilterTemplate>\n <ng-template [ngTemplateOutlet]=\"nzShowSort ? sortTemplate : contentTemplate\"></ng-template>\n </ng-template>\n <ng-template #extraTemplate>\n <ng-content select=\"[nz-th-extra]\"></ng-content>\n <ng-content select=\"nz-filter-trigger\"></ng-content>\n </ng-template>\n <ng-template #sortTemplate>\n <nz-table-sorters\n [sortOrder]=\"sortOrder\"\n [sortDirections]=\"sortDirections\"\n [contentTemplate]=\"contentTemplate\"\n ></nz-table-sorters>\n </ng-template>\n <ng-template #contentTemplate>\n <ng-content></ng-content>\n </ng-template>\n `,\n host: {\n '[class.ant-table-column-has-sorters]': 'nzShowSort',\n '[class.ant-table-column-sort]': `sortOrder === 'descend' || sortOrder === 'ascend'`\n },\n providers: [NzDestroyService]\n})\nexport class NzThAddOnComponent<T> implements OnChanges, OnInit {\n static ngAcceptInputType_nzShowSort: BooleanInput;\n static ngAcceptInputType_nzShowFilter: BooleanInput;\n static ngAcceptInputType_nzCustomFilter: BooleanInput;\n\n manualClickOrder$ = new Subject<NzThAddOnComponent<T>>();\n calcOperatorChange$ = new Subject();\n nzFilterValue: NzTableFilterValue = null;\n sortOrder: NzTableSortOrder = null;\n sortDirections: NzTableSortOrder[] = ['ascend', 'descend', null];\n private sortOrderChange$ = new Subject<NzTableSortOrder>();\n private isNzShowSortChanged = false;\n private isNzShowFilterChanged = false;\n @Input() nzColumnKey?: string;\n @Input() nzFilterMultiple = true;\n @Input() nzSortOrder: NzTableSortOrder = null;\n @Input() nzSortPriority: number | boolean = false;\n @Input() nzSortDirections: NzTableSortOrder[] = ['ascend', 'descend', null];\n @Input() nzFilters: NzTableFilterList = [];\n @Input() nzSortFn: NzTableSortFn<T> | boolean | null = null;\n @Input() nzFilterFn: NzTableFilterFn<T> | boolean | null = null;\n @Input() @InputBoolean() nzShowSort = false;\n @Input() @InputBoolean() nzShowFilter = false;\n @Input() @InputBoolean() nzCustomFilter = false;\n @Output() readonly nzCheckedChange = new EventEmitter<boolean>();\n @Output() readonly nzSortOrderChange = new EventEmitter<string | null>();\n @Output() readonly nzFilterChange = new EventEmitter<NzTableFilterValue>();\n\n getNextSortDirection(sortDirections: NzTableSortOrder[], current: NzTableSortOrder): NzTableSortOrder {\n const index = sortDirections.indexOf(current);\n if (index === sortDirections.length - 1) {\n return sortDirections[0];\n } else {\n return sortDirections[index + 1];\n }\n }\n\n setSortOrder(order: NzTableSortOrder): void {\n this.sortOrderChange$.next(order);\n }\n\n clearSortOrder(): void {\n if (this.sortOrder !== null) {\n this.setSortOrder(null);\n }\n }\n\n onFilterValueChange(value: NzTableFilterValue): void {\n this.nzFilterChange.emit(value);\n this.nzFilterValue = value;\n this.updateCalcOperator();\n }\n\n updateCalcOperator(): void {\n this.calcOperatorChange$.next();\n }\n\n constructor(\n private host: ElementRef<HTMLElement>,\n private cdr: ChangeDetectorRef,\n private ngZone: NgZone,\n private destroy$: NzDestroyService\n ) {}\n\n ngOnInit(): void {\n this.ngZone.runOutsideAngular(() =>\n fromEvent(this.host.nativeElement, 'click')\n .pipe(\n filter(() => this.nzShowSort),\n takeUntil(this.destroy$)\n )\n .subscribe(() => {\n const nextOrder = this.getNextSortDirection(this.sortDirections, this.sortOrder!);\n this.ngZone.run(() => {\n this.setSortOrder(nextOrder);\n this.manualClickOrder$.next(this);\n });\n })\n );\n\n this.sortOrderChange$.pipe(takeUntil(this.destroy$)).subscribe(order => {\n if (this.sortOrder !== order) {\n this.sortOrder = order;\n this.nzSortOrderChange.emit(order);\n }\n this.updateCalcOperator();\n this.cdr.markForCheck();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const {\n nzSortDirections,\n nzFilters,\n nzSortOrder,\n nzSortFn,\n nzFilterFn,\n nzSortPriority,\n nzFilterMultiple,\n nzShowSort,\n nzShowFilter\n } = changes;\n if (nzSortDirections) {\n if (this.nzSortDirections && this.nzSortDirections.length) {\n this.sortDirections = this.nzSortDirections;\n }\n }\n if (nzSortOrder) {\n this.sortOrder = this.nzSortOrder;\n this.setSortOrder(this.nzSortOrder);\n }\n if (nzShowSort) {\n this.isNzShowSortChanged = true;\n }\n if (nzShowFilter) {\n this.isNzShowFilterChanged = true;\n }\n const isFirstChange = (value: SimpleChange): boolean =>\n value && value.firstChange && value.currentValue !== undefined;\n if ((isFirstChange(nzSortOrder) || isFirstChange(nzSortFn)) && !this.isNzShowSortChanged) {\n this.nzShowSort = true;\n }\n if (isFirstChange(nzFilters) && !this.isNzShowFilterChanged) {\n this.nzShowFilter = true;\n }\n if ((nzFilters || nzFilterMultiple) && this.nzShowFilter) {\n const listOfValue = this.nzFilters.filter(item => item.byDefault).map(item => item.value);\n this.nzFilterValue = this.nzFilterMultiple ? listOfValue : listOfValue[0] || null;\n }\n if (nzSortFn || nzFilterFn || nzSortPriority || nzFilters) {\n this.updateCalcOperator();\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, ElementRef, Input, OnChanges, Renderer2, SimpleChanges } from '@angular/core';\nimport { Subject } from 'rxjs';\n\nimport { isNil } from 'ng-zorro-antd/core/util';\n\n@Directive({\n selector: 'th'\n})\nexport class NzThMeasureDirective implements OnChanges {\n changes$ = new Subject();\n @Input() nzWidth: string | null = null;\n @Input() colspan: string | number | null = null;\n @Input() colSpan: string | number | null = null;\n @Input() rowspan: string | number | null = null;\n @Input() rowSpan: string | number | null = null;\n constructor(private renderer: Renderer2, private elementRef: ElementRef) {}\n ngOnChanges(changes: SimpleChanges): void {\n const { nzWidth, colspan, rowspan, colSpan, rowSpan } = changes;\n if (colspan || colSpan) {\n const col = this.colspan || this.colSpan;\n if (!isNil(col)) {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'colspan', `${col}`);\n } else {\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'colspan');\n }\n }\n if (rowspan || rowSpan) {\n const row = this.rowspan || this.rowSpan;\n if (!isNil(row)) {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'rowspan', `${row}`);\n } else {\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'rowspan');\n }\n }\n if (nzWidth || colspan) {\n this.changes$.next();\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/* eslint-disable @angular-eslint/component-selector */\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChange,\n SimpleChanges,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { BooleanInput, NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\n@Component({\n selector: 'th[nzSelections],th[nzChecked],th[nzShowCheckbox],th[nzShowRowSelection]',\n preserveWhitespaces: false,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <nz-table-selection\n [checked]=\"nzChecked\"\n [disabled]=\"nzDisabled\"\n [indeterminate]=\"nzIndeterminate\"\n [listOfSelections]=\"nzSelections\"\n [showCheckbox]=\"nzShowCheckbox\"\n [showRowSelection]=\"nzShowRowSelection\"\n (checkedChange)=\"onCheckedChange($event)\"\n ></nz-table-selection>\n <ng-content></ng-content>\n `,\n host: { class: 'ant-table-selection-column' }\n})\nexport class NzThSelectionComponent implements OnChanges {\n static ngAcceptInputType_nzShowCheckbox: BooleanInput;\n static ngAcceptInputType_nzShowRowSelection: BooleanInput;\n\n @Input() nzSelections: Array<{ text: string; onSelect(...args: NzSafeAny[]): NzSafeAny }> = [];\n @Input() nzChecked = false;\n @Input() nzDisabled = false;\n @Input() nzIndeterminate = false;\n @Input() @InputBoolean() nzShowCheckbox = false;\n @Input() @InputBoolean() nzShowRowSelection = false;\n @Output() readonly nzCheckedChange = new EventEmitter<boolean>();\n\n private isNzShowExpandChanged = false;\n private isNzShowCheckboxChanged = false;\n\n constructor() {}\n\n onCheckedChange(checked: boolean): void {\n this.nzChecked = checked;\n this.nzCheckedChange.emit(checked);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const isFirstChange = (value: SimpleChange): boolean =>\n value && value.firstChange && value.currentValue !== undefined;\n const { nzChecked, nzSelections, nzShowExpand, nzShowCheckbox } = changes;\n if (nzShowExpand) {\n this.isNzShowExpandChanged = true;\n }\n if (nzShowCheckbox) {\n this.isNzShowCheckboxChanged = true;\n }\n if (isFirstChange(nzSelections) && !this.isNzShowExpandChanged) {\n this.nzShowRowSelection = true;\n }\n if (isFirstChange(nzChecked) && !this.isNzShowCheckboxChanged) {\n this.nzShowCheckbox = true;\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, Input } from '@angular/core';\n\n@Directive({\n selector: 'th[nzAlign],td[nzAlign]',\n host: {\n '[style.text-align]': 'nzAlign'\n }\n})\nexport class NzCellAlignDirective {\n @Input() nzAlign: 'left' | 'right' | 'center' | null = null;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, Input } from '@angular/core';\n\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\n@Directive({\n selector: 'th[nzEllipsis],td[nzEllipsis]',\n host: {\n '[class.ant-table-cell-ellipsis]': 'nzEllipsis'\n }\n})\nexport class NzCellEllipsisDirective {\n static ngAcceptInputType_nzEllipsis: BooleanInput;\n\n @Input() @InputBoolean() nzEllipsis = true;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, Input } from '@angular/core';\n\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\n@Directive({\n selector: 'th[nzBreakWord],td[nzBreakWord]',\n host: {\n '[style.word-break]': `nzBreakWord ? 'break-all' : ''`\n }\n})\nexport class NzCellBreakWordDirective {\n static ngAcceptInputType_nzBreakWord: BooleanInput;\n\n @Input() @InputBoolean() nzBreakWord = true;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation } from '@angular/core';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzTableLayout } from '../table.types';\n\n@Component({\n selector: 'table[nz-table-content]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <col [style.width]=\"width\" [style.minWidth]=\"width\" *ngFor=\"let width of listOfColWidth\" />\n <thead class=\"ant-table-thead\" *ngIf=\"theadTemplate\">\n <ng-template [ngTemplateOutlet]=\"theadTemplate\"></ng-template>\n </thead>\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template>\n <ng-content></ng-content>\n `,\n host: {\n '[style.table-layout]': 'tableLayout',\n '[class.ant-table-fixed]': 'scrollX',\n '[style.width]': 'scrollX',\n '[style.min-width]': `scrollX ? '100%': null`\n }\n})\nexport class NzTableContentComponent {\n @Input() tableLayout: NzTableLayout = 'auto';\n @Input() theadTemplate: TemplateRef<NzSafeAny> | null = null;\n @Input() contentTemplate: TemplateRef<NzSafeAny> | null = null;\n @Input() listOfColWidth: ReadonlyArray<string | null> = [];\n @Input() scrollX: string | null = null;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzTableStyleService } from '../table-style.service';\n\n@Component({\n selector: 'tr[nz-table-fixed-row], tr[nzExpand]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <td class=\"nz-disable-td ant-table-cell\" #tdElement>\n <div\n class=\"ant-table-expanded-row-fixed\"\n *ngIf=\"enableAutoMeasure$ | async; else contentTemplate\"\n style=\"position: sticky; left: 0px; overflow: hidden;\"\n [style.width.px]=\"hostWidth$ | async\"\n >\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template>\n </div>\n </td>\n <ng-template #contentTemplate><ng-content></ng-content></ng-template>\n `\n})\nexport class NzTableFixedRowComponent implements OnInit, OnDestroy, AfterViewInit {\n @ViewChild('tdElement', { static: true }) tdElement!: ElementRef;\n hostWidth$ = new BehaviorSubject<number | null>(null);\n enableAutoMeasure$ = new BehaviorSubject<boolean>(false);\n private destroy$ = new Subject();\n constructor(private nzTableStyleService: NzTableStyleService, private renderer: Renderer2) {}\n ngOnInit(): void {\n if (this.nzTableStyleService) {\n const { enableAutoMeasure$, hostWidth$ } = this.nzTableStyleService;\n enableAutoMeasure$.pipe(takeUntil(this.destroy$)).subscribe(this.enableAutoMeasure$);\n hostWidth$.pipe(takeUntil(this.destroy$)).subscribe(this.hostWidth$);\n }\n }\n ngAfterViewInit(): void {\n this.nzTableStyleService.columnCount$.pipe(takeUntil(this.destroy$)).subscribe(count => {\n this.renderer.setAttribute(this.tdElement.nativeElement, 'colspan', `${count}`);\n });\n }\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation } from '@angular/core';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzTableLayout } from '../table.types';\n\n@Component({\n selector: 'nz-table-inner-default',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <div class=\"ant-table-content\">\n <table\n nz-table-content\n [contentTemplate]=\"contentTemplate\"\n [tableLayout]=\"tableLayout\"\n [listOfColWidth]=\"listOfColWidth\"\n [theadTemplate]=\"theadTemplate\"\n ></table>\n </div>\n `,\n host: { class: 'ant-table-container' }\n})\nexport class NzTableInnerDefaultComponent {\n @Input() tableLayout: NzTableLayout = 'auto';\n @Input() listOfColWidth: ReadonlyArray<string | null> = [];\n @Input() theadTemplate: TemplateRef<NzSafeAny> | null = null;\n @Input() contentTemplate: TemplateRef<NzSafeAny> | null = null;\n\n constructor() {}\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/* eslint-disable @angular-eslint/component-selector */\n\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnDestroy,\n Output,\n QueryList,\n ViewChildren,\n ViewEncapsulation\n} from '@angular/core';\nimport { combineLatest, Observable, Subject } from 'rxjs';\nimport { debounceTime, map, startWith, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { NzResizeObserver } from 'ng-zorro-antd/cdk/resize-observer';\n\n@Component({\n selector: 'tr[nz-table-measure-row]',\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <td\n #tdElement\n class=\"nz-disable-td\"\n style=\"padding: 0px; border: 0px; height: 0px;\"\n *ngFor=\"let th of listOfMeasureColumn; trackBy: trackByFunc\"\n ></td>\n `,\n host: { class: 'ant-table-measure-now' }\n})\nexport class NzTrMeasureComponent implements AfterViewInit, OnDestroy {\n @Input() listOfMeasureColumn: readonly string[] = [];\n @Output() readonly listOfAutoWidth = new EventEmitter<number[]>();\n @ViewChildren('tdElement') listOfTdElement!: QueryList<ElementRef>;\n private destroy$ = new Subject();\n constructor(private nzResizeObserver: NzResizeObserver, private ngZone: NgZone) {}\n trackByFunc(_: number, key: string): string {\n return key;\n }\n ngAfterViewInit(): void {\n this.listOfTdElement.changes\n .pipe(startWith(this.listOfTdElement))\n .pipe(\n switchMap(\n list =>\n combineLatest(\n list.toArray().map((item: ElementRef) =>\n this.nzResizeObserver.observe(item).pipe(\n map(([entry]) => {\n const { width } = entry.target.getBoundingClientRect();\n return Math.floor(width);\n })\n )\n )\n ) as Observable<number[]>\n ),\n debounceTime(16),\n takeUntil(this.destroy$)\n )\n .subscribe(data => {\n // Caretaker note: we don't have to re-enter the Angular zone each time the stream emits.\n // The below check is necessary to be sure that zone is not nooped through `BootstrapOptions`\n // (`bootstrapModule(AppModule, { ngZone: 'noop' }))`. The `ngZone instanceof NgZone` may return\n // `false` if zone is nooped, since `ngZone` will be an instance of the `NoopNgZone`.\n // The `ResizeObserver` might be also patched through `zone.js/dist/zone-patch-resize-observer`,\n // thus calling `ngZone.run` again will cause another change detection.\n if (this.ngZone instanceof NgZone && NgZone.isInAngularZone()) {\n this.listOfAutoWidth.next(data);\n } else {\n this.ngZone.run(() => this.listOfAutoWidth.next(data));\n }\n });\n }\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/* eslint-disable @angular-eslint/component-selector */\n\nimport { ChangeDetectionStrategy, Component, OnDestroy, Optional, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzTableStyleService } from '../table-style.service';\n\n@Component({\n selector: 'tbody',\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n <ng-container *ngIf=\"listOfMeasureColumn$ | async as listOfMeasureColumn\">\n <tr\n nz-table-measure-row\n *ngIf=\"isInsideTable && listOfMeasureColumn.length\"\n [listOfMeasureColumn]=\"listOfMeasureColumn\"\n (listOfAutoWidth)=\"onListOfAutoWidthChange($event)\"\n ></tr>\n </ng-container>\n <ng-content></ng-content>\n <tr class=\"ant-table-placeholder\" nz-table-fixed-row *ngIf=\"showEmpty$ | async\">\n <nz-embed-empty nzComponentName=\"table\" [specificContent]=\"(noResult$ | async)!\"></nz-embed-empty>\n </tr>\n `,\n host: {\n '[class.ant-table-tbody]': 'isInsideTable'\n }\n})\nexport class NzTbodyComponent implements OnDestroy {\n isInsideTable = false;\n showEmpty$ = new BehaviorSubject<boolean>(false);\n noResult$ = new BehaviorSubject<string | TemplateRef<NzSafeAny> | undefined>(undefined);\n listOfMeasureColumn$ = new BehaviorSubject<readonly string[]>([]);\n private destroy$ = new Subject<void>();\n\n constructor(@Optional() private nzTableStyleService: NzTableStyleService) {\n this.isInsideTable = !!this.nzTab