ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 202 kB
Source Map (JSON)
{"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/table-data.service.ts","../../components/table/src/cell/custom-column.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/title-footer.component.ts","../../components/table/src/table/table.component.ts","../../components/table/src/table/tfoot-summary.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/src/table.types.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 OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute\n} from '@angular/core';\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 { fromEventOutsideAngular } from 'ng-zorro-antd/core/util';\nimport { NzDropDownDirective, NzDropDownModule, 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 imports: [NzDropDownModule]\n})\nexport class NzFilterTriggerComponent implements OnInit {\n readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;\n\n @Input() nzActive = false;\n @Input() nzDropdownMenu!: NzDropdownMenuComponent;\n @Input() nzVisible = false;\n\n @Input({ transform: booleanAttribute }) @WithConfig() 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 cdr: ChangeDetectorRef,\n private destroy$: NzDestroyService\n ) {}\n\n ngOnInit(): void {\n fromEventOutsideAngular(this.nzDropdown.nativeElement, 'click')\n .pipe(takeUntil(this.destroy$))\n .subscribe(event => {\n event.stopPropagation();\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 { NgTemplateOutlet } from '@angular/common';\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 { FormsModule } from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzButtonModule } from 'ng-zorro-antd/button';\nimport { NzCheckboxModule } from 'ng-zorro-antd/checkbox';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { arraysEqual } from 'ng-zorro-antd/core/util';\nimport { NzDropDownModule } from 'ng-zorro-antd/dropdown';\nimport { NzI18nService, NzTableI18nInterface } from 'ng-zorro-antd/i18n';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzRadioComponent } from 'ng-zorro-antd/radio';\n\nimport { NzTableFilterList } from '../table.types';\nimport { NzFilterTriggerComponent } from './filter-trigger.component';\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 @if (!customFilter) {\n <nz-filter-trigger\n [nzVisible]=\"isVisible\"\n [nzActive]=\"isChecked\"\n [nzDropdownMenu]=\"filterMenu\"\n (nzVisibleChange)=\"onVisibleChange($event)\"\n >\n <nz-icon nzType=\"filter\" nzTheme=\"fill\" />\n </nz-filter-trigger>\n <nz-dropdown-menu #filterMenu=\"nzDropdownMenu\">\n <div class=\"ant-table-filter-dropdown\">\n <ul nz-menu>\n @for (f of listOfParsedFilter; track f.value) {\n <li nz-menu-item [nzSelected]=\"f.checked\" (click)=\"check(f)\">\n @if (!filterMultiple) {\n <label nz-radio [ngModel]=\"f.checked\" (ngModelChange)=\"check(f)\"></label>\n } @else {\n <label nz-checkbox [ngModel]=\"f.checked\" (ngModelChange)=\"check(f)\"></label>\n }\n <span>{{ f.text }}</span>\n </li>\n }\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 } @else {\n <ng-container [ngTemplateOutlet]=\"extraTemplate\"></ng-container>\n }\n `,\n host: { class: 'ant-table-filter-column' },\n imports: [\n NgTemplateOutlet,\n NzFilterTriggerComponent,\n NzIconModule,\n NzDropDownModule,\n NzRadioComponent,\n NzCheckboxModule,\n FormsModule,\n NzButtonModule\n ]\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<boolean>();\n locale!: NzTableI18nInterface;\n isChecked = false;\n isVisible = false;\n listOfParsedFilter: NzThItemInterface[] = [];\n listOfChecked: NzSafeAny[] = [];\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(\n private cdr: ChangeDetectorRef,\n private i18n: NzI18nService\n ) {}\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(true);\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 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","/**\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';\nimport { FormsModule } from '@angular/forms';\n\nimport { NzCheckboxModule } from 'ng-zorro-antd/checkbox';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { NzDropDownModule } from 'ng-zorro-antd/dropdown';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\n@Component({\n selector: 'nz-table-selection',\n preserveWhitespaces: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `\n @if (showCheckbox) {\n <label\n nz-checkbox\n [class.ant-table-selection-select-all-custom]=\"showRowSelection\"\n [ngModel]=\"checked\"\n [nzDisabled]=\"disabled\"\n [nzIndeterminate]=\"indeterminate\"\n [attr.aria-label]=\"label\"\n (ngModelChange)=\"onCheckedChange($event)\"\n ></label>\n }\n @if (showRowSelection) {\n <div class=\"ant-table-selection-extra\">\n <span nz-dropdown class=\"ant-table-selection-down\" nzPlacement=\"bottomLeft\" [nzDropdownMenu]=\"selectionMenu\">\n <nz-icon nzType=\"down\" />\n </span>\n <nz-dropdown-menu #selectionMenu=\"nzDropdownMenu\">\n <ul nz-menu class=\"ant-table-selection-menu\">\n @for (selection of listOfSelections; track selection) {\n <li nz-menu-item (click)=\"selection.onSelect()\">\n {{ selection.text }}\n </li>\n }\n </ul>\n </nz-dropdown-menu>\n </div>\n }\n `,\n host: { class: 'ant-table-selection' },\n imports: [FormsModule, NzCheckboxModule, NzDropDownModule, NzIconModule]\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() label: string | null = null;\n @Input() showCheckbox = false;\n @Input() showRowSelection = false;\n @Output() readonly checkedChange = new EventEmitter<boolean>();\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 { NgTemplateOutlet } from '@angular/common';\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';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\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 @if (isUp) {\n <nz-icon nzType=\"caret-up\" class=\"ant-table-column-sorter-up\" [class.active]=\"sortOrder === 'ascend'\" />\n }\n @if (isDown) {\n <nz-icon nzType=\"caret-down\" class=\"ant-table-column-sorter-down\" [class.active]=\"sortOrder === 'descend'\" />\n }\n </span>\n </span>\n `,\n host: { class: 'ant-table-column-sorters' },\n imports: [NzIconModule, NgTemplateOutlet]\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 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(\n private renderer: Renderer2,\n private elementRef: ElementRef\n ) {}\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';\nimport { NzTableSummaryFixedType } from './table.types';\n\n@Injectable()\nexport class NzTableStyleService {\n theadTemplate$ = new ReplaySubject<TemplateRef<NzSafeAny>>(1);\n tfootTemplate$ = new ReplaySubject<TemplateRef<NzSafeAny>>(1);\n tfootFixed$ = new ReplaySubject<NzTableSummaryFixedType | null>(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 setTfootTemplate(template: TemplateRef<NzSafeAny>): void {\n this.tfootTemplate$.next(template);\n }\n\n setTfootFixed(fixed: NzTableSummaryFixedType | null): void {\n this.tfootFixed$.next(fixed);\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","/**\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, inject } 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 = !!inject(NzTableStyleService, { optional: 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 { Injectable, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject, combineLatest } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, filter, map, skip, switchMap, takeUntil } from 'rxjs/operators';\n\nimport {\n NzCustomColumn,\n NzTableFilterFn,\n NzTableFilterValue,\n NzTableQueryParams,\n NzTableSortFn,\n NzTableSortOrder\n} from './table.types';\n\n@Injectable()\nexport class NzTableDataService<T> implements OnDestroy {\n private destroy$ = new Subject<boolean>();\n private pageIndex$ = new BehaviorSubject<number>(1);\n private frontPagination$ = new BehaviorSubject<boolean>(true);\n private pageSize$ = new BehaviorSubject<number>(10);\n private listOfData$ = new BehaviorSubject<readonly T[]>([]);\n listOfCustomColumn$ = new BehaviorSubject<NzCustomColumn[]>([]);\n pageIndexDistinct$ = this.pageIndex$.pipe(distinctUntilChanged());\n pageSizeDistinct$ = this.pageSize$.pipe(distinctUntilChanged());\n listOfCalcOperator$ = new BehaviorSubject<\n Array<{\n key?: string;\n sortFn: NzTableSortFn<T> | null | boolean;\n sortOrder: NzTableSortOrder;\n filterFn: NzTableFilterFn<T> | null | boolean;\n filterValue: NzTableFilterValue;\n sortPriority: number | boolean;\n }>\n >([]);\n queryParams$: Observable<NzTableQueryParams> = combineLatest([\n this.pageIndexDistinct$,\n this.pageSizeDistinct$,\n this.listOfCalcOperator$\n ]).pipe(\n debounceTime(0),\n skip(1),\n map(([pageIndex, pageSize, listOfCalc]) => ({\n pageIndex,\n pageSize,\n sort: listOfCalc\n .filter(item => item.sortFn)\n .map(item => ({\n key: item.key!,\n value: item.sortOrder\n })),\n filter: listOfCalc\n .filter(item => item.filterFn)\n .map(item => ({\n key: item.key!,\n value: item.filterValue\n }))\n }))\n );\n private listOfDataAfterCalc$ = combineLatest([this.listOfData$, this.listOfCalcOperator$]).pipe(\n map(([listOfData, listOfCalcOperator]) => {\n let listOfDataAfterCalc = [...listOfData];\n const listOfFilterOperator = listOfCalcOperator.filter(item => {\n const { filterValue, filterFn } = item;\n const isReset =\n filterValue === null ||\n filterValue === undefined ||\n (Array.isArray(filterValue) && filterValue!.length === 0);\n return !isReset && typeof filterFn === 'function';\n });\n for (const item of listOfFilterOperator) {\n const { filterFn, filterValue } = item;\n listOfDataAfterCalc = listOfDataAfterCalc.filter(data => (filterFn as NzTableFilterFn<T>)(filterValue, data));\n }\n const listOfSortOperator = listOfCalcOperator\n .filter(item => item.sortOrder !== null && typeof item.sortFn === 'function')\n .sort((a, b) => +b.sortPriority - +a.sortPriority);\n if (listOfCalcOperator.length) {\n listOfDataAfterCalc.sort((record1, record2) => {\n for (const item of listOfSortOperator) {\n const { sortFn, sortOrder } = item;\n if (sortFn && sortOrder) {\n const compareResult = (sortFn as NzTableSortFn<T>)(record1, record2, sortOrder);\n if (compareResult !== 0) {\n return sortOrder === 'ascend' ? compareResult : -compareResult;\n }\n }\n }\n return 0;\n });\n }\n return listOfDataAfterCalc;\n })\n );\n private listOfFrontEndCurrentPageData$ = combineLatest([\n this.pageIndexDistinct$,\n this.pageSizeDistinct$,\n this.listOfDataAfterCalc$\n ]).pipe(\n takeUntil(this.destroy$),\n filter(value => {\n const [pageIndex, pageSize, listOfData] = value;\n const maxPageIndex = Math.ceil(listOfData.length / pageSize) || 1;\n return pageIndex <= maxPageIndex;\n }),\n map(([pageIndex, pageSize, listOfData]) => listOfData.slice((pageIndex - 1) * pageSize, pageIndex * pageSize))\n );\n listOfCurrentPageData$ = this.frontPagination$.pipe(\n switchMap(pagination => (pagination ? this.listOfFrontEndCurrentPageData$ : this.listOfDataAfterCalc$))\n );\n total$ = this.frontPagination$.pipe(\n switchMap(pagination => (pagination ? this.listOfDataAfterCalc$ : this.listOfData$)),\n map(list => list.length),\n distinctUntilChanged()\n );\n\n updatePageSize(size: number): void {\n this.pageSize$.next(size);\n }\n updateFrontPagination(pagination: boolean): void {\n this.frontPagination$.next(pagination);\n }\n updatePageIndex(index: number): void {\n this.pageIndex$.next(index);\n }\n updateListOfData(list: readonly T[]): void {\n this.listOfData$.next(list);\n }\n updateListOfCustomColumn(list: NzCustomColumn[]): void {\n this.listOfCustomColumn$.next(list);\n }\n ngOnDestroy(): void {\n this.destroy$.next(true);\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, ElementRef, Input, OnDestroy, OnInit, Renderer2 } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzTableDataService } from '../table-data.service';\n\n@Directive({\n selector: 'td[nzCellControl],th[nzCellControl]'\n})\nexport class NzCustomColumnDirective<T> implements OnInit, OnDestroy {\n @Input() nzCellControl: string | null = null;\n\n private destroy$ = new Subject<void>();\n\n constructor(\n private el: ElementRef,\n private renderer: Renderer2,\n private nzTableDataService: NzTableDataService<T>\n ) {}\n\n ngOnInit(): void {\n this.nzTableDataService.listOfCustomColumn$.pipe(takeUntil(this.destroy$)).subscribe(item => {\n if (item.length) {\n item.forEach((v, i) => {\n if (v.value === this.nzCellControl) {\n if (!v.default) {\n this.renderer.setStyle(this.el.nativeElement, 'display', 'none');\n } else {\n this.renderer.setStyle(this.el.nativeElement, 'display', 'block');\n }\n this.renderer.setStyle(this.el.nativeElement, 'order', i);\n if (!v?.fixWidth) {\n this.renderer.setStyle(this.el.nativeElement, 'flex', `1 1 ${v.width}px`);\n } else {\n this.renderer.setStyle(this.el.nativeElement, 'flex', `1 0 ${v.width}px`);\n }\n }\n });\n }\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 */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChange,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { NzCheckboxModule } from 'ng-zorro-antd/checkbox';\n\nimport { NzRowExpandButtonDirective } from '../addon/row-expand-button.directive';\nimport { NzRowIndentDirective } from '../addon/row-indent.directive';\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 @if (nzShowExpand || nzIndentSize > 0) {\n <nz-row-indent [indentSize]=\"nzIndentSize\"></nz-row-indent>\n @if (nzExpandIcon) {\n <ng-template [ngTemplateOutlet]=\"nzExpandIcon\"></ng-template>\n } @else {\n <button\n nz-row-expand-button\n [expand]=\"nzExpand\"\n (expandChange)=\"onExpandChange($event)\"\n [spaceMode]=\"!nzShowExpand\"\n ></button>\n }\n }\n @if (nzShowCheckbox) {\n <label\n nz-checkbox\n [nzDisabled]=\"nzDisabled\"\n [ngModel]=\"nzChecked\"\n [nzIndeterminate]=\"nzIndeterminate\"\n [attr.aria-label]=\"nzLabel\"\n (ngModelChange)=\"onCheckedChange($event)\"\n ></label>\n }\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 imports: [NzRowIndentDirective, NzRowExpandButtonDirective, NgTemplateOutlet, NzCheckboxModule, FormsModule]\n})\nexport class NzTdAddOnComponent implements OnChanges {\n @Input() nzChecked = false;\n @Input() nzDisabled = false;\n @Input() nzIndeterminate = false;\n @Input() nzLabel: string | null = null;\n @Input() nzIndentSize = 0;\n @Input({ transform: booleanAttribute }) nzShowExpand = false;\n @Input({ transform: booleanAttribute }) nzShowCheckbox = false;\n @Input({ transform: booleanAttribute }) nzExpand = false;\n @Input() nzExpandIcon: TemplateRef<void> | null = null;\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 { NgTemplateOutlet } from '@angular/common';\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 booleanAttribute\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';\nimport { NzDestroyService } from 'ng-zorro-antd/core/services';\nimport { fromEventOutsideAngular } from 'ng-zorro-antd/core/util';\n\nimport { NzTableFilterComponent } from '../addon/filter.component';\nimport { NzTableSortersComponent } from '../addon/sorters.component';\nimport {\n NzTableFilterFn,\n NzTableFilterList,\n NzTableFilterValue,\n NzTableSortFn,\n NzTableSortOrder\n} from '../table.types';\n\nconst NZ_CONFIG_MODULE_NAME: NzConfigKey = 'table';\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 @if (nzShowFilter || nzCustomFilter) {\n <nz-table-filter\n [contentTemplate]=\"notFilterTemplate\"\n [extraTemplate]=\"extraTemplate\"\n [customFilter]=\"nzCustomFilter\"\n [filterMultiple]=\"nzFilterMultiple\"\n [listOfFilter]=\"nzFilters\"\n (filterChange)=\"onFilterValueChange($event)\"\n ></nz-table-filter>\n } @else {\n <ng-container [ngTemplateOutlet]=\"notFilterTemplate\"></ng-container>\n }\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 imports: [NzTableFilterComponent, NgTemplateOutlet, NzTableSortersComponent]\n})\nexport class NzThAddOnComponent<T> implements OnChanges, OnInit {\n readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;\n\n manualClickOrder$ = new Subject<NzThAddOnComponent<T>>();\n calcOperatorChange$ = new Subject<void>();\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() @WithConfig() 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({ transform: booleanAttribute }) nzShowSort = false;\n @Input({ transform: booleanAttribute }) nzShowFilter = false;\n @Input({ transform: booleanAttribute }) 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 public nzConfigService: NzConfigService,\n private host: ElementRef<HTMLElement>,\n private cdr: ChangeDetectorRef,\n private ngZone: NgZone,\n private destroy$: NzDestroyService\n ) {}\n\n ngOnInit(): void {\n fromEventOutsideAngular(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 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<void>();\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(\n private renderer: Renderer2,\n private elementRef: ElementRef\n ) {}\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 booleanAttribute\n} from '@angular/core';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzTableSelectionComponent } from '../addon/selection.component';\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 [label]=\"nzLabel\"\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 imports: [NzTableSelectionComponent]\n})\nexport class NzThSelectionComponent implements OnChanges {\n @Input() nzSelections: Array<{ text: string; onSelect(...args: NzSafeAny[]): NzSafeAny }> = [];\n @Input({ transform: booleanAttribute }) nzChecked = false;\n @Input({ transform: booleanAttribute }) nzDisabled = false;\n @Input() nzIndeterminate = false;\n @Input() nzLabel: string | null = null;\n @Input({ transform: booleanAttribute }) nzShowCheckbox = false;\n @Input({ transform: booleanAttribute }) nzShowRowSelection = false;\n @Output() readonly nzCheckedChange = new EventEmitter<boolean>();\n\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 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, booleanAttribute } from '@angular/core';\n\n@Directive({\n selector: 'th[nzEllipsis],td[nzEllipsis]',\n host: {\n '[class.ant-table-cell-ellipsis]': 'nzEllipsis'\n }\n})\nexport class NzCellEllipsisDirective {\n @Input({ transform: booleanAttribute }) 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, booleanAttribute } from '@angular/core';\n\n@Directive({\n selector: 'th[nzBreakWord],td[nzBreakWord]',\n host: {\n '[style.word-break]': `nzBreakWord ? 'break-all' : ''`\n }\n})\nexport class NzCellBreakWordDirective {\n @Input({ transform: booleanAttribute }) 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 { NgTemplateOutlet } from '@angular/common';\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 @if (listOfColWidth.length > 0) {\n <colgroup>\n @for (width of listOfColWidth; track $index) {\n <col [style.width]=\"width\" [style.minWidth]=\"width\" />\n }\n </colgroup>\n }\n @if (theadTemplate) {\n <thead class=\"ant-table-thead\">\n <ng-template [ngTemplateOutlet]=\"theadTemplate\"></ng-template>\n <