ng-zorro-antd-table.mjs 165 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236
  1. import * as i0 from '@angular/core';
  2. import { EventEmitter, ElementRef, booleanAttribute, ViewChild, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Directive, Injectable, inject, NgZone, ViewChildren, ContentChild, ContentChildren, NgModule } from '@angular/core';
  3. import { __esDecorate, __runInitializers } from 'tslib';
  4. import { takeUntil, map, distinctUntilChanged, debounceTime, skip, filter, switchMap, startWith, delay, mergeMap } from 'rxjs/operators';
  5. import * as i1 from 'ng-zorro-antd/core/config';
  6. import { WithConfig } from 'ng-zorro-antd/core/config';
  7. import * as i2 from 'ng-zorro-antd/core/services';
  8. import { NzDestroyService } from 'ng-zorro-antd/core/services';
  9. import { fromEventOutsideAngular, arraysEqual, isNil, measureScrollbar } from 'ng-zorro-antd/core/util';
  10. import * as i4 from 'ng-zorro-antd/dropdown';
  11. import { NzDropDownModule, NzDropDownDirective } from 'ng-zorro-antd/dropdown';
  12. import { NgTemplateOutlet, AsyncPipe } from '@angular/common';
  13. import * as i6 from '@angular/forms';
  14. import { FormsModule } from '@angular/forms';
  15. import { Subject, ReplaySubject, BehaviorSubject, combineLatest, merge, EMPTY, of } from 'rxjs';
  16. import * as i7 from 'ng-zorro-antd/button';
  17. import { NzButtonModule } from 'ng-zorro-antd/button';
  18. import * as i5 from 'ng-zorro-antd/checkbox';
  19. import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
  20. import * as i2$1 from 'ng-zorro-antd/icon';
  21. import { NzIconModule } from 'ng-zorro-antd/icon';
  22. import { NzRadioComponent } from 'ng-zorro-antd/radio';
  23. import * as i1$1 from 'ng-zorro-antd/i18n';
  24. import * as i3 from 'ng-zorro-antd/menu';
  25. import * as i8 from 'ng-zorro-antd/core/transition-patch';
  26. import * as i9 from 'ng-zorro-antd/core/wave';
  27. import * as i3$1 from '@angular/cdk/scrolling';
  28. import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
  29. import * as i1$3 from 'ng-zorro-antd/empty';
  30. import { NzEmptyModule } from 'ng-zorro-antd/empty';
  31. import * as i1$2 from 'ng-zorro-antd/cdk/resize-observer';
  32. import * as i1$4 from '@angular/cdk/platform';
  33. import * as i6$1 from 'ng-zorro-antd/pagination';
  34. import { NzPaginationModule } from 'ng-zorro-antd/pagination';
  35. import { NzSpinComponent } from 'ng-zorro-antd/spin';
  36. import * as i1$5 from 'ng-zorro-antd/core/outlet';
  37. import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
  38. import * as i5$1 from '@angular/cdk/bidi';
  39. const NZ_CONFIG_MODULE_NAME$2 = 'filterTrigger';
  40. let NzFilterTriggerComponent = (() => {
  41. let _nzBackdrop_decorators;
  42. let _nzBackdrop_initializers = [];
  43. let _nzBackdrop_extraInitializers = [];
  44. return class NzFilterTriggerComponent {
  45. static {
  46. const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
  47. _nzBackdrop_decorators = [WithConfig()];
  48. __esDecorate(null, null, _nzBackdrop_decorators, { kind: "field", name: "nzBackdrop", static: false, private: false, access: { has: obj => "nzBackdrop" in obj, get: obj => obj.nzBackdrop, set: (obj, value) => { obj.nzBackdrop = value; } }, metadata: _metadata }, _nzBackdrop_initializers, _nzBackdrop_extraInitializers);
  49. if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  50. }
  51. nzConfigService;
  52. cdr;
  53. destroy$;
  54. _nzModuleName = NZ_CONFIG_MODULE_NAME$2;
  55. nzActive = false;
  56. nzDropdownMenu;
  57. nzVisible = false;
  58. nzBackdrop = __runInitializers(this, _nzBackdrop_initializers, false);
  59. nzVisibleChange = (__runInitializers(this, _nzBackdrop_extraInitializers), new EventEmitter());
  60. nzDropdown;
  61. onVisibleChange(visible) {
  62. this.nzVisible = visible;
  63. this.nzVisibleChange.next(visible);
  64. }
  65. hide() {
  66. this.nzVisible = false;
  67. this.cdr.markForCheck();
  68. }
  69. show() {
  70. this.nzVisible = true;
  71. this.cdr.markForCheck();
  72. }
  73. constructor(nzConfigService, cdr, destroy$) {
  74. this.nzConfigService = nzConfigService;
  75. this.cdr = cdr;
  76. this.destroy$ = destroy$;
  77. }
  78. ngOnInit() {
  79. fromEventOutsideAngular(this.nzDropdown.nativeElement, 'click')
  80. .pipe(takeUntil(this.destroy$))
  81. .subscribe(event => {
  82. event.stopPropagation();
  83. });
  84. }
  85. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzFilterTriggerComponent, deps: [{ token: i1.NzConfigService }, { token: i0.ChangeDetectorRef }, { token: i2.NzDestroyService }], target: i0.ɵɵFactoryTarget.Component });
  86. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.2", type: NzFilterTriggerComponent, isStandalone: true, selector: "nz-filter-trigger", inputs: { nzActive: "nzActive", nzDropdownMenu: "nzDropdownMenu", nzVisible: "nzVisible", nzBackdrop: ["nzBackdrop", "nzBackdrop", booleanAttribute] }, outputs: { nzVisibleChange: "nzVisibleChange" }, providers: [NzDestroyService], viewQueries: [{ propertyName: "nzDropdown", first: true, predicate: NzDropDownDirective, descendants: true, read: ElementRef, static: true }], exportAs: ["nzFilterTrigger"], ngImport: i0, template: `
  87. <span
  88. nz-dropdown
  89. class="ant-table-filter-trigger"
  90. nzTrigger="click"
  91. nzPlacement="bottomRight"
  92. [nzBackdrop]="nzBackdrop"
  93. [nzClickHide]="false"
  94. [nzDropdownMenu]="nzDropdownMenu"
  95. [class.active]="nzActive"
  96. [class.ant-table-filter-open]="nzVisible"
  97. [nzVisible]="nzVisible"
  98. (nzVisibleChange)="onVisibleChange($event)"
  99. >
  100. <ng-content></ng-content>
  101. </span>
  102. `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i4.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  103. };
  104. })();
  105. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzFilterTriggerComponent, decorators: [{
  106. type: Component,
  107. args: [{
  108. selector: 'nz-filter-trigger',
  109. exportAs: `nzFilterTrigger`,
  110. changeDetection: ChangeDetectionStrategy.OnPush,
  111. preserveWhitespaces: false,
  112. encapsulation: ViewEncapsulation.None,
  113. template: `
  114. <span
  115. nz-dropdown
  116. class="ant-table-filter-trigger"
  117. nzTrigger="click"
  118. nzPlacement="bottomRight"
  119. [nzBackdrop]="nzBackdrop"
  120. [nzClickHide]="false"
  121. [nzDropdownMenu]="nzDropdownMenu"
  122. [class.active]="nzActive"
  123. [class.ant-table-filter-open]="nzVisible"
  124. [nzVisible]="nzVisible"
  125. (nzVisibleChange)="onVisibleChange($event)"
  126. >
  127. <ng-content></ng-content>
  128. </span>
  129. `,
  130. providers: [NzDestroyService],
  131. imports: [NzDropDownModule]
  132. }]
  133. }], ctorParameters: () => [{ type: i1.NzConfigService }, { type: i0.ChangeDetectorRef }, { type: i2.NzDestroyService }], propDecorators: { nzActive: [{
  134. type: Input
  135. }], nzDropdownMenu: [{
  136. type: Input
  137. }], nzVisible: [{
  138. type: Input
  139. }], nzBackdrop: [{
  140. type: Input,
  141. args: [{ transform: booleanAttribute }]
  142. }], nzVisibleChange: [{
  143. type: Output
  144. }], nzDropdown: [{
  145. type: ViewChild,
  146. args: [NzDropDownDirective, { static: true, read: ElementRef }]
  147. }] } });
  148. /**
  149. * Use of this source code is governed by an MIT-style license that can be
  150. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  151. */
  152. class NzTableFilterComponent {
  153. cdr;
  154. i18n;
  155. contentTemplate = null;
  156. customFilter = false;
  157. extraTemplate = null;
  158. filterMultiple = true;
  159. listOfFilter = [];
  160. filterChange = new EventEmitter();
  161. destroy$ = new Subject();
  162. locale;
  163. isChecked = false;
  164. isVisible = false;
  165. listOfParsedFilter = [];
  166. listOfChecked = [];
  167. check(filter) {
  168. if (this.filterMultiple) {
  169. this.listOfParsedFilter = this.listOfParsedFilter.map(item => {
  170. if (item === filter) {
  171. return { ...item, checked: !filter.checked };
  172. }
  173. else {
  174. return item;
  175. }
  176. });
  177. filter.checked = !filter.checked;
  178. }
  179. else {
  180. this.listOfParsedFilter = this.listOfParsedFilter.map(item => ({ ...item, checked: item === filter }));
  181. }
  182. this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);
  183. }
  184. confirm() {
  185. this.isVisible = false;
  186. this.emitFilterData();
  187. }
  188. reset() {
  189. this.isVisible = false;
  190. this.listOfParsedFilter = this.parseListOfFilter(this.listOfFilter, true);
  191. this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);
  192. this.emitFilterData();
  193. }
  194. onVisibleChange(value) {
  195. this.isVisible = value;
  196. if (!value) {
  197. this.emitFilterData();
  198. }
  199. else {
  200. this.listOfChecked = this.listOfParsedFilter.filter(item => item.checked).map(item => item.value);
  201. }
  202. }
  203. emitFilterData() {
  204. const listOfChecked = this.listOfParsedFilter.filter(item => item.checked).map(item => item.value);
  205. if (!arraysEqual(this.listOfChecked, listOfChecked)) {
  206. if (this.filterMultiple) {
  207. this.filterChange.emit(listOfChecked);
  208. }
  209. else {
  210. this.filterChange.emit(listOfChecked.length > 0 ? listOfChecked[0] : null);
  211. }
  212. }
  213. }
  214. parseListOfFilter(listOfFilter, reset) {
  215. return listOfFilter.map(item => {
  216. const checked = reset ? false : !!item.byDefault;
  217. return { text: item.text, value: item.value, checked };
  218. });
  219. }
  220. getCheckedStatus(listOfParsedFilter) {
  221. return listOfParsedFilter.some(item => item.checked);
  222. }
  223. constructor(cdr, i18n) {
  224. this.cdr = cdr;
  225. this.i18n = i18n;
  226. }
  227. ngOnInit() {
  228. this.i18n.localeChange.pipe(takeUntil(this.destroy$)).subscribe(() => {
  229. this.locale = this.i18n.getLocaleData('Table');
  230. this.cdr.markForCheck();
  231. });
  232. }
  233. ngOnChanges(changes) {
  234. const { listOfFilter } = changes;
  235. if (listOfFilter && this.listOfFilter && this.listOfFilter.length) {
  236. this.listOfParsedFilter = this.parseListOfFilter(this.listOfFilter);
  237. this.isChecked = this.getCheckedStatus(this.listOfParsedFilter);
  238. }
  239. }
  240. ngOnDestroy() {
  241. this.destroy$.next(true);
  242. this.destroy$.complete();
  243. }
  244. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableFilterComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.NzI18nService }], target: i0.ɵɵFactoryTarget.Component });
  245. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTableFilterComponent, isStandalone: true, selector: "nz-table-filter", inputs: { contentTemplate: "contentTemplate", customFilter: "customFilter", extraTemplate: "extraTemplate", filterMultiple: "filterMultiple", listOfFilter: "listOfFilter" }, outputs: { filterChange: "filterChange" }, host: { classAttribute: "ant-table-filter-column" }, usesOnChanges: true, ngImport: i0, template: `
  246. <span class="ant-table-column-title">
  247. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  248. </span>
  249. @if (!customFilter) {
  250. <nz-filter-trigger
  251. [nzVisible]="isVisible"
  252. [nzActive]="isChecked"
  253. [nzDropdownMenu]="filterMenu"
  254. (nzVisibleChange)="onVisibleChange($event)"
  255. >
  256. <nz-icon nzType="filter" nzTheme="fill" />
  257. </nz-filter-trigger>
  258. <nz-dropdown-menu #filterMenu="nzDropdownMenu">
  259. <div class="ant-table-filter-dropdown">
  260. <ul nz-menu>
  261. @for (f of listOfParsedFilter; track f.value) {
  262. <li nz-menu-item [nzSelected]="f.checked" (click)="check(f)">
  263. @if (!filterMultiple) {
  264. <label nz-radio [ngModel]="f.checked" (ngModelChange)="check(f)"></label>
  265. } @else {
  266. <label nz-checkbox [ngModel]="f.checked" (ngModelChange)="check(f)"></label>
  267. }
  268. <span>{{ f.text }}</span>
  269. </li>
  270. }
  271. </ul>
  272. <div class="ant-table-filter-dropdown-btns">
  273. <button nz-button nzType="link" nzSize="small" (click)="reset()" [disabled]="!isChecked">
  274. {{ locale.filterReset }}
  275. </button>
  276. <button nz-button nzType="primary" nzSize="small" (click)="confirm()">{{ locale.filterConfirm }}</button>
  277. </div>
  278. </div>
  279. </nz-dropdown-menu>
  280. } @else {
  281. <ng-container [ngTemplateOutlet]="extraTemplate"></ng-container>
  282. }
  283. `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzFilterTriggerComponent, selector: "nz-filter-trigger", inputs: ["nzActive", "nzDropdownMenu", "nzVisible", "nzBackdrop"], outputs: ["nzVisibleChange"], exportAs: ["nzFilterTrigger"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2$1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i3.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i3.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "component", type: i4.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "component", type: NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "component", type: i5.NzCheckboxComponent, selector: "[nz-checkbox]", inputs: ["nzValue", "nzAutoFocus", "nzDisabled", "nzIndeterminate", "nzChecked", "nzId", "nzName"], outputs: ["nzCheckedChange"], exportAs: ["nzCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i7.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i8.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i9.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  284. }
  285. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableFilterComponent, decorators: [{
  286. type: Component,
  287. args: [{
  288. selector: 'nz-table-filter',
  289. preserveWhitespaces: false,
  290. changeDetection: ChangeDetectionStrategy.OnPush,
  291. encapsulation: ViewEncapsulation.None,
  292. template: `
  293. <span class="ant-table-column-title">
  294. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  295. </span>
  296. @if (!customFilter) {
  297. <nz-filter-trigger
  298. [nzVisible]="isVisible"
  299. [nzActive]="isChecked"
  300. [nzDropdownMenu]="filterMenu"
  301. (nzVisibleChange)="onVisibleChange($event)"
  302. >
  303. <nz-icon nzType="filter" nzTheme="fill" />
  304. </nz-filter-trigger>
  305. <nz-dropdown-menu #filterMenu="nzDropdownMenu">
  306. <div class="ant-table-filter-dropdown">
  307. <ul nz-menu>
  308. @for (f of listOfParsedFilter; track f.value) {
  309. <li nz-menu-item [nzSelected]="f.checked" (click)="check(f)">
  310. @if (!filterMultiple) {
  311. <label nz-radio [ngModel]="f.checked" (ngModelChange)="check(f)"></label>
  312. } @else {
  313. <label nz-checkbox [ngModel]="f.checked" (ngModelChange)="check(f)"></label>
  314. }
  315. <span>{{ f.text }}</span>
  316. </li>
  317. }
  318. </ul>
  319. <div class="ant-table-filter-dropdown-btns">
  320. <button nz-button nzType="link" nzSize="small" (click)="reset()" [disabled]="!isChecked">
  321. {{ locale.filterReset }}
  322. </button>
  323. <button nz-button nzType="primary" nzSize="small" (click)="confirm()">{{ locale.filterConfirm }}</button>
  324. </div>
  325. </div>
  326. </nz-dropdown-menu>
  327. } @else {
  328. <ng-container [ngTemplateOutlet]="extraTemplate"></ng-container>
  329. }
  330. `,
  331. host: { class: 'ant-table-filter-column' },
  332. imports: [
  333. NgTemplateOutlet,
  334. NzFilterTriggerComponent,
  335. NzIconModule,
  336. NzDropDownModule,
  337. NzRadioComponent,
  338. NzCheckboxModule,
  339. FormsModule,
  340. NzButtonModule
  341. ]
  342. }]
  343. }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$1.NzI18nService }], propDecorators: { contentTemplate: [{
  344. type: Input
  345. }], customFilter: [{
  346. type: Input
  347. }], extraTemplate: [{
  348. type: Input
  349. }], filterMultiple: [{
  350. type: Input
  351. }], listOfFilter: [{
  352. type: Input
  353. }], filterChange: [{
  354. type: Output
  355. }] } });
  356. /**
  357. * Use of this source code is governed by an MIT-style license that can be
  358. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  359. */
  360. class NzRowExpandButtonDirective {
  361. expand = false;
  362. spaceMode = false;
  363. expandChange = new EventEmitter();
  364. onHostClick() {
  365. if (!this.spaceMode) {
  366. this.expand = !this.expand;
  367. this.expandChange.next(this.expand);
  368. }
  369. }
  370. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzRowExpandButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  371. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzRowExpandButtonDirective, isStandalone: true, selector: "button[nz-row-expand-button]", inputs: { expand: "expand", spaceMode: "spaceMode" }, outputs: { expandChange: "expandChange" }, host: { listeners: { "click": "onHostClick()" }, properties: { "type": "'button'", "class.ant-table-row-expand-icon-expanded": "!spaceMode && expand === true", "class.ant-table-row-expand-icon-collapsed": "!spaceMode && expand === false", "class.ant-table-row-expand-icon-spaced": "spaceMode" }, classAttribute: "ant-table-row-expand-icon" }, ngImport: i0 });
  372. }
  373. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzRowExpandButtonDirective, decorators: [{
  374. type: Directive,
  375. args: [{
  376. selector: 'button[nz-row-expand-button]',
  377. host: {
  378. class: 'ant-table-row-expand-icon',
  379. '[type]': `'button'`,
  380. '[class.ant-table-row-expand-icon-expanded]': `!spaceMode && expand === true`,
  381. '[class.ant-table-row-expand-icon-collapsed]': `!spaceMode && expand === false`,
  382. '[class.ant-table-row-expand-icon-spaced]': 'spaceMode',
  383. '(click)': 'onHostClick()'
  384. }
  385. }]
  386. }], propDecorators: { expand: [{
  387. type: Input
  388. }], spaceMode: [{
  389. type: Input
  390. }], expandChange: [{
  391. type: Output
  392. }] } });
  393. /**
  394. * Use of this source code is governed by an MIT-style license that can be
  395. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  396. */
  397. class NzRowIndentDirective {
  398. indentSize = 0;
  399. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzRowIndentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  400. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzRowIndentDirective, isStandalone: true, selector: "nz-row-indent", inputs: { indentSize: "indentSize" }, host: { properties: { "style.padding-left.px": "indentSize" }, classAttribute: "ant-table-row-indent" }, ngImport: i0 });
  401. }
  402. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzRowIndentDirective, decorators: [{
  403. type: Directive,
  404. args: [{
  405. selector: 'nz-row-indent',
  406. host: {
  407. class: 'ant-table-row-indent',
  408. '[style.padding-left.px]': 'indentSize'
  409. }
  410. }]
  411. }], propDecorators: { indentSize: [{
  412. type: Input
  413. }] } });
  414. /**
  415. * Use of this source code is governed by an MIT-style license that can be
  416. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  417. */
  418. class NzTableSelectionComponent {
  419. listOfSelections = [];
  420. checked = false;
  421. disabled = false;
  422. indeterminate = false;
  423. label = null;
  424. showCheckbox = false;
  425. showRowSelection = false;
  426. checkedChange = new EventEmitter();
  427. onCheckedChange(checked) {
  428. this.checked = checked;
  429. this.checkedChange.emit(checked);
  430. }
  431. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  432. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTableSelectionComponent, isStandalone: true, selector: "nz-table-selection", inputs: { listOfSelections: "listOfSelections", checked: "checked", disabled: "disabled", indeterminate: "indeterminate", label: "label", showCheckbox: "showCheckbox", showRowSelection: "showRowSelection" }, outputs: { checkedChange: "checkedChange" }, host: { classAttribute: "ant-table-selection" }, ngImport: i0, template: `
  433. @if (showCheckbox) {
  434. <label
  435. nz-checkbox
  436. [class.ant-table-selection-select-all-custom]="showRowSelection"
  437. [ngModel]="checked"
  438. [nzDisabled]="disabled"
  439. [nzIndeterminate]="indeterminate"
  440. [attr.aria-label]="label"
  441. (ngModelChange)="onCheckedChange($event)"
  442. ></label>
  443. }
  444. @if (showRowSelection) {
  445. <div class="ant-table-selection-extra">
  446. <span nz-dropdown class="ant-table-selection-down" nzPlacement="bottomLeft" [nzDropdownMenu]="selectionMenu">
  447. <nz-icon nzType="down" />
  448. </span>
  449. <nz-dropdown-menu #selectionMenu="nzDropdownMenu">
  450. <ul nz-menu class="ant-table-selection-menu">
  451. @for (selection of listOfSelections; track selection) {
  452. <li nz-menu-item (click)="selection.onSelect()">
  453. {{ selection.text }}
  454. </li>
  455. }
  456. </ul>
  457. </nz-dropdown-menu>
  458. </div>
  459. }
  460. `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "component", type: i5.NzCheckboxComponent, selector: "[nz-checkbox]", inputs: ["nzValue", "nzAutoFocus", "nzDisabled", "nzIndeterminate", "nzChecked", "nzId", "nzName"], outputs: ["nzCheckedChange"], exportAs: ["nzCheckbox"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i3.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i3.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i4.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i4.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2$1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  461. }
  462. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableSelectionComponent, decorators: [{
  463. type: Component,
  464. args: [{
  465. selector: 'nz-table-selection',
  466. preserveWhitespaces: false,
  467. changeDetection: ChangeDetectionStrategy.OnPush,
  468. encapsulation: ViewEncapsulation.None,
  469. template: `
  470. @if (showCheckbox) {
  471. <label
  472. nz-checkbox
  473. [class.ant-table-selection-select-all-custom]="showRowSelection"
  474. [ngModel]="checked"
  475. [nzDisabled]="disabled"
  476. [nzIndeterminate]="indeterminate"
  477. [attr.aria-label]="label"
  478. (ngModelChange)="onCheckedChange($event)"
  479. ></label>
  480. }
  481. @if (showRowSelection) {
  482. <div class="ant-table-selection-extra">
  483. <span nz-dropdown class="ant-table-selection-down" nzPlacement="bottomLeft" [nzDropdownMenu]="selectionMenu">
  484. <nz-icon nzType="down" />
  485. </span>
  486. <nz-dropdown-menu #selectionMenu="nzDropdownMenu">
  487. <ul nz-menu class="ant-table-selection-menu">
  488. @for (selection of listOfSelections; track selection) {
  489. <li nz-menu-item (click)="selection.onSelect()">
  490. {{ selection.text }}
  491. </li>
  492. }
  493. </ul>
  494. </nz-dropdown-menu>
  495. </div>
  496. }
  497. `,
  498. host: { class: 'ant-table-selection' },
  499. imports: [FormsModule, NzCheckboxModule, NzDropDownModule, NzIconModule]
  500. }]
  501. }], propDecorators: { listOfSelections: [{
  502. type: Input
  503. }], checked: [{
  504. type: Input
  505. }], disabled: [{
  506. type: Input
  507. }], indeterminate: [{
  508. type: Input
  509. }], label: [{
  510. type: Input
  511. }], showCheckbox: [{
  512. type: Input
  513. }], showRowSelection: [{
  514. type: Input
  515. }], checkedChange: [{
  516. type: Output
  517. }] } });
  518. /**
  519. * Use of this source code is governed by an MIT-style license that can be
  520. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  521. */
  522. class NzTableSortersComponent {
  523. sortDirections = ['ascend', 'descend', null];
  524. sortOrder = null;
  525. contentTemplate = null;
  526. isUp = false;
  527. isDown = false;
  528. ngOnChanges(changes) {
  529. const { sortDirections } = changes;
  530. if (sortDirections) {
  531. this.isUp = this.sortDirections.indexOf('ascend') !== -1;
  532. this.isDown = this.sortDirections.indexOf('descend') !== -1;
  533. }
  534. }
  535. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableSortersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  536. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTableSortersComponent, isStandalone: true, selector: "nz-table-sorters", inputs: { sortDirections: "sortDirections", sortOrder: "sortOrder", contentTemplate: "contentTemplate" }, host: { classAttribute: "ant-table-column-sorters" }, usesOnChanges: true, ngImport: i0, template: `
  537. <span class="ant-table-column-title"><ng-template [ngTemplateOutlet]="contentTemplate"></ng-template></span>
  538. <span class="ant-table-column-sorter" [class.ant-table-column-sorter-full]="isDown && isUp">
  539. <span class="ant-table-column-sorter-inner">
  540. @if (isUp) {
  541. <nz-icon nzType="caret-up" class="ant-table-column-sorter-up" [class.active]="sortOrder === 'ascend'" />
  542. }
  543. @if (isDown) {
  544. <nz-icon nzType="caret-down" class="ant-table-column-sorter-down" [class.active]="sortOrder === 'descend'" />
  545. }
  546. </span>
  547. </span>
  548. `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2$1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  549. }
  550. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableSortersComponent, decorators: [{
  551. type: Component,
  552. args: [{
  553. selector: 'nz-table-sorters',
  554. preserveWhitespaces: false,
  555. changeDetection: ChangeDetectionStrategy.OnPush,
  556. encapsulation: ViewEncapsulation.None,
  557. template: `
  558. <span class="ant-table-column-title"><ng-template [ngTemplateOutlet]="contentTemplate"></ng-template></span>
  559. <span class="ant-table-column-sorter" [class.ant-table-column-sorter-full]="isDown && isUp">
  560. <span class="ant-table-column-sorter-inner">
  561. @if (isUp) {
  562. <nz-icon nzType="caret-up" class="ant-table-column-sorter-up" [class.active]="sortOrder === 'ascend'" />
  563. }
  564. @if (isDown) {
  565. <nz-icon nzType="caret-down" class="ant-table-column-sorter-down" [class.active]="sortOrder === 'descend'" />
  566. }
  567. </span>
  568. </span>
  569. `,
  570. host: { class: 'ant-table-column-sorters' },
  571. imports: [NzIconModule, NgTemplateOutlet]
  572. }]
  573. }], propDecorators: { sortDirections: [{
  574. type: Input
  575. }], sortOrder: [{
  576. type: Input
  577. }], contentTemplate: [{
  578. type: Input
  579. }] } });
  580. /**
  581. * Use of this source code is governed by an MIT-style license that can be
  582. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  583. */
  584. class NzCellFixedDirective {
  585. renderer;
  586. elementRef;
  587. nzRight = false;
  588. nzLeft = false;
  589. colspan = null;
  590. colSpan = null;
  591. changes$ = new Subject();
  592. isAutoLeft = false;
  593. isAutoRight = false;
  594. isFixedLeft = false;
  595. isFixedRight = false;
  596. isFixed = false;
  597. setAutoLeftWidth(autoLeft) {
  598. this.renderer.setStyle(this.elementRef.nativeElement, 'left', autoLeft);
  599. }
  600. setAutoRightWidth(autoRight) {
  601. this.renderer.setStyle(this.elementRef.nativeElement, 'right', autoRight);
  602. }
  603. setIsFirstRight(isFirstRight) {
  604. this.setFixClass(isFirstRight, 'ant-table-cell-fix-right-first');
  605. }
  606. setIsLastLeft(isLastLeft) {
  607. this.setFixClass(isLastLeft, 'ant-table-cell-fix-left-last');
  608. }
  609. setFixClass(flag, className) {
  610. // the setFixClass function may call many times, so remove it first.
  611. this.renderer.removeClass(this.elementRef.nativeElement, className);
  612. if (flag) {
  613. this.renderer.addClass(this.elementRef.nativeElement, className);
  614. }
  615. }
  616. constructor(renderer, elementRef) {
  617. this.renderer = renderer;
  618. this.elementRef = elementRef;
  619. }
  620. ngOnChanges() {
  621. this.setIsFirstRight(false);
  622. this.setIsLastLeft(false);
  623. this.isAutoLeft = this.nzLeft === '' || this.nzLeft === true;
  624. this.isAutoRight = this.nzRight === '' || this.nzRight === true;
  625. this.isFixedLeft = this.nzLeft !== false;
  626. this.isFixedRight = this.nzRight !== false;
  627. this.isFixed = this.isFixedLeft || this.isFixedRight;
  628. const validatePx = (value) => {
  629. if (typeof value === 'string' && value !== '') {
  630. return value;
  631. }
  632. else {
  633. return null;
  634. }
  635. };
  636. this.setAutoLeftWidth(validatePx(this.nzLeft));
  637. this.setAutoRightWidth(validatePx(this.nzRight));
  638. this.changes$.next();
  639. }
  640. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellFixedDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
  641. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzCellFixedDirective, isStandalone: true, selector: "td[nzRight],th[nzRight],td[nzLeft],th[nzLeft]", inputs: { nzRight: "nzRight", nzLeft: "nzLeft", colspan: "colspan", colSpan: "colSpan" }, host: { properties: { "class.ant-table-cell-fix-right": "isFixedRight", "class.ant-table-cell-fix-left": "isFixedLeft", "style.position": "isFixed? 'sticky' : null" } }, usesOnChanges: true, ngImport: i0 });
  642. }
  643. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellFixedDirective, decorators: [{
  644. type: Directive,
  645. args: [{
  646. selector: 'td[nzRight],th[nzRight],td[nzLeft],th[nzLeft]',
  647. host: {
  648. '[class.ant-table-cell-fix-right]': `isFixedRight`,
  649. '[class.ant-table-cell-fix-left]': `isFixedLeft`,
  650. '[style.position]': `isFixed? 'sticky' : null`
  651. }
  652. }]
  653. }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { nzRight: [{
  654. type: Input
  655. }], nzLeft: [{
  656. type: Input
  657. }], colspan: [{
  658. type: Input
  659. }], colSpan: [{
  660. type: Input
  661. }] } });
  662. /**
  663. * Use of this source code is governed by an MIT-style license that can be
  664. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  665. */
  666. class NzTableStyleService {
  667. theadTemplate$ = new ReplaySubject(1);
  668. tfootTemplate$ = new ReplaySubject(1);
  669. tfootFixed$ = new ReplaySubject(1);
  670. hasFixLeft$ = new ReplaySubject(1);
  671. hasFixRight$ = new ReplaySubject(1);
  672. hostWidth$ = new ReplaySubject(1);
  673. columnCount$ = new ReplaySubject(1);
  674. showEmpty$ = new ReplaySubject(1);
  675. noResult$ = new ReplaySubject(1);
  676. listOfThWidthConfigPx$ = new BehaviorSubject([]);
  677. tableWidthConfigPx$ = new BehaviorSubject([]);
  678. manualWidthConfigPx$ = combineLatest([this.tableWidthConfigPx$, this.listOfThWidthConfigPx$]).pipe(map(([widthConfig, listOfWidth]) => (widthConfig.length ? widthConfig : listOfWidth)));
  679. listOfAutoWidthPx$ = new ReplaySubject(1);
  680. listOfListOfThWidthPx$ = merge(
  681. /** init with manual width **/
  682. this.manualWidthConfigPx$, combineLatest([this.listOfAutoWidthPx$, this.manualWidthConfigPx$]).pipe(map(([autoWidth, manualWidth]) => {
  683. /** use autoWidth until column length match **/
  684. if (autoWidth.length === manualWidth.length) {
  685. return autoWidth.map((width, index) => {
  686. if (width === '0px') {
  687. return manualWidth[index] || null;
  688. }
  689. else {
  690. return manualWidth[index] || width;
  691. }
  692. });
  693. }
  694. else {
  695. return manualWidth;
  696. }
  697. })));
  698. listOfMeasureColumn$ = new ReplaySubject(1);
  699. listOfListOfThWidth$ = this.listOfAutoWidthPx$.pipe(map(list => list.map(width => parseInt(width, 10))));
  700. enableAutoMeasure$ = new ReplaySubject(1);
  701. setTheadTemplate(template) {
  702. this.theadTemplate$.next(template);
  703. }
  704. setTfootTemplate(template) {
  705. this.tfootTemplate$.next(template);
  706. }
  707. setTfootFixed(fixed) {
  708. this.tfootFixed$.next(fixed);
  709. }
  710. setHasFixLeft(hasFixLeft) {
  711. this.hasFixLeft$.next(hasFixLeft);
  712. }
  713. setHasFixRight(hasFixRight) {
  714. this.hasFixRight$.next(hasFixRight);
  715. }
  716. setTableWidthConfig(widthConfig) {
  717. this.tableWidthConfigPx$.next(widthConfig);
  718. }
  719. setListOfTh(listOfTh) {
  720. let columnCount = 0;
  721. listOfTh.forEach(th => {
  722. columnCount += (th.colspan && +th.colspan) || (th.colSpan && +th.colSpan) || 1;
  723. });
  724. const listOfThPx = listOfTh.map(item => item.nzWidth);
  725. this.columnCount$.next(columnCount);
  726. this.listOfThWidthConfigPx$.next(listOfThPx);
  727. }
  728. setListOfMeasureColumn(listOfTh) {
  729. const listOfKeys = [];
  730. listOfTh.forEach(th => {
  731. const length = (th.colspan && +th.colspan) || (th.colSpan && +th.colSpan) || 1;
  732. for (let i = 0; i < length; i++) {
  733. listOfKeys.push(`measure_key_${i}`);
  734. }
  735. });
  736. this.listOfMeasureColumn$.next(listOfKeys);
  737. }
  738. setListOfAutoWidth(listOfAutoWidth) {
  739. this.listOfAutoWidthPx$.next(listOfAutoWidth.map(width => `${width}px`));
  740. }
  741. setShowEmpty(showEmpty) {
  742. this.showEmpty$.next(showEmpty);
  743. }
  744. setNoResult(noResult) {
  745. this.noResult$.next(noResult);
  746. }
  747. setScroll(scrollX, scrollY) {
  748. const enableAutoMeasure = !!(scrollX || scrollY);
  749. if (!enableAutoMeasure) {
  750. this.setListOfAutoWidth([]);
  751. }
  752. this.enableAutoMeasure$.next(enableAutoMeasure);
  753. }
  754. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableStyleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
  755. static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableStyleService });
  756. }
  757. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableStyleService, decorators: [{
  758. type: Injectable
  759. }] });
  760. /**
  761. * Use of this source code is governed by an MIT-style license that can be
  762. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  763. */
  764. class NzTableCellDirective {
  765. isInsideTable = !!inject(NzTableStyleService, { optional: true });
  766. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  767. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzTableCellDirective, isStandalone: true, selector: "th:not(.nz-disable-th):not([mat-cell]), td:not(.nz-disable-td):not([mat-cell])", host: { properties: { "class.ant-table-cell": "isInsideTable" } }, ngImport: i0 });
  768. }
  769. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableCellDirective, decorators: [{
  770. type: Directive,
  771. args: [{
  772. selector: 'th:not(.nz-disable-th):not([mat-cell]), td:not(.nz-disable-td):not([mat-cell])',
  773. host: {
  774. '[class.ant-table-cell]': 'isInsideTable'
  775. }
  776. }]
  777. }] });
  778. /**
  779. * Use of this source code is governed by an MIT-style license that can be
  780. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  781. */
  782. class NzTableDataService {
  783. destroy$ = new Subject();
  784. pageIndex$ = new BehaviorSubject(1);
  785. frontPagination$ = new BehaviorSubject(true);
  786. pageSize$ = new BehaviorSubject(10);
  787. listOfData$ = new BehaviorSubject([]);
  788. listOfCustomColumn$ = new BehaviorSubject([]);
  789. pageIndexDistinct$ = this.pageIndex$.pipe(distinctUntilChanged());
  790. pageSizeDistinct$ = this.pageSize$.pipe(distinctUntilChanged());
  791. listOfCalcOperator$ = new BehaviorSubject([]);
  792. queryParams$ = combineLatest([
  793. this.pageIndexDistinct$,
  794. this.pageSizeDistinct$,
  795. this.listOfCalcOperator$
  796. ]).pipe(debounceTime(0), skip(1), map(([pageIndex, pageSize, listOfCalc]) => ({
  797. pageIndex,
  798. pageSize,
  799. sort: listOfCalc
  800. .filter(item => item.sortFn)
  801. .map(item => ({
  802. key: item.key,
  803. value: item.sortOrder
  804. })),
  805. filter: listOfCalc
  806. .filter(item => item.filterFn)
  807. .map(item => ({
  808. key: item.key,
  809. value: item.filterValue
  810. }))
  811. })));
  812. listOfDataAfterCalc$ = combineLatest([this.listOfData$, this.listOfCalcOperator$]).pipe(map(([listOfData, listOfCalcOperator]) => {
  813. let listOfDataAfterCalc = [...listOfData];
  814. const listOfFilterOperator = listOfCalcOperator.filter(item => {
  815. const { filterValue, filterFn } = item;
  816. const isReset = filterValue === null ||
  817. filterValue === undefined ||
  818. (Array.isArray(filterValue) && filterValue.length === 0);
  819. return !isReset && typeof filterFn === 'function';
  820. });
  821. for (const item of listOfFilterOperator) {
  822. const { filterFn, filterValue } = item;
  823. listOfDataAfterCalc = listOfDataAfterCalc.filter(data => filterFn(filterValue, data));
  824. }
  825. const listOfSortOperator = listOfCalcOperator
  826. .filter(item => item.sortOrder !== null && typeof item.sortFn === 'function')
  827. .sort((a, b) => +b.sortPriority - +a.sortPriority);
  828. if (listOfCalcOperator.length) {
  829. listOfDataAfterCalc.sort((record1, record2) => {
  830. for (const item of listOfSortOperator) {
  831. const { sortFn, sortOrder } = item;
  832. if (sortFn && sortOrder) {
  833. const compareResult = sortFn(record1, record2, sortOrder);
  834. if (compareResult !== 0) {
  835. return sortOrder === 'ascend' ? compareResult : -compareResult;
  836. }
  837. }
  838. }
  839. return 0;
  840. });
  841. }
  842. return listOfDataAfterCalc;
  843. }));
  844. listOfFrontEndCurrentPageData$ = combineLatest([
  845. this.pageIndexDistinct$,
  846. this.pageSizeDistinct$,
  847. this.listOfDataAfterCalc$
  848. ]).pipe(takeUntil(this.destroy$), filter(value => {
  849. const [pageIndex, pageSize, listOfData] = value;
  850. const maxPageIndex = Math.ceil(listOfData.length / pageSize) || 1;
  851. return pageIndex <= maxPageIndex;
  852. }), map(([pageIndex, pageSize, listOfData]) => listOfData.slice((pageIndex - 1) * pageSize, pageIndex * pageSize)));
  853. listOfCurrentPageData$ = this.frontPagination$.pipe(switchMap(pagination => (pagination ? this.listOfFrontEndCurrentPageData$ : this.listOfDataAfterCalc$)));
  854. total$ = this.frontPagination$.pipe(switchMap(pagination => (pagination ? this.listOfDataAfterCalc$ : this.listOfData$)), map(list => list.length), distinctUntilChanged());
  855. updatePageSize(size) {
  856. this.pageSize$.next(size);
  857. }
  858. updateFrontPagination(pagination) {
  859. this.frontPagination$.next(pagination);
  860. }
  861. updatePageIndex(index) {
  862. this.pageIndex$.next(index);
  863. }
  864. updateListOfData(list) {
  865. this.listOfData$.next(list);
  866. }
  867. updateListOfCustomColumn(list) {
  868. this.listOfCustomColumn$.next(list);
  869. }
  870. ngOnDestroy() {
  871. this.destroy$.next(true);
  872. this.destroy$.complete();
  873. }
  874. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
  875. static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableDataService });
  876. }
  877. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableDataService, decorators: [{
  878. type: Injectable
  879. }] });
  880. /**
  881. * Use of this source code is governed by an MIT-style license that can be
  882. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  883. */
  884. class NzCustomColumnDirective {
  885. el;
  886. renderer;
  887. nzTableDataService;
  888. nzCellControl = null;
  889. destroy$ = new Subject();
  890. constructor(el, renderer, nzTableDataService) {
  891. this.el = el;
  892. this.renderer = renderer;
  893. this.nzTableDataService = nzTableDataService;
  894. }
  895. ngOnInit() {
  896. this.nzTableDataService.listOfCustomColumn$.pipe(takeUntil(this.destroy$)).subscribe(item => {
  897. if (item.length) {
  898. item.forEach((v, i) => {
  899. if (v.value === this.nzCellControl) {
  900. if (!v.default) {
  901. this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
  902. }
  903. else {
  904. this.renderer.setStyle(this.el.nativeElement, 'display', 'block');
  905. }
  906. this.renderer.setStyle(this.el.nativeElement, 'order', i);
  907. if (!v?.fixWidth) {
  908. this.renderer.setStyle(this.el.nativeElement, 'flex', `1 1 ${v.width}px`);
  909. }
  910. else {
  911. this.renderer.setStyle(this.el.nativeElement, 'flex', `1 0 ${v.width}px`);
  912. }
  913. }
  914. });
  915. }
  916. });
  917. }
  918. ngOnDestroy() {
  919. this.destroy$.next();
  920. this.destroy$.complete();
  921. }
  922. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCustomColumnDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: NzTableDataService }], target: i0.ɵɵFactoryTarget.Directive });
  923. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzCustomColumnDirective, isStandalone: true, selector: "td[nzCellControl],th[nzCellControl]", inputs: { nzCellControl: "nzCellControl" }, ngImport: i0 });
  924. }
  925. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCustomColumnDirective, decorators: [{
  926. type: Directive,
  927. args: [{
  928. selector: 'td[nzCellControl],th[nzCellControl]'
  929. }]
  930. }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: NzTableDataService }], propDecorators: { nzCellControl: [{
  931. type: Input
  932. }] } });
  933. /**
  934. * Use of this source code is governed by an MIT-style license that can be
  935. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  936. */
  937. /* eslint-disable @angular-eslint/component-selector */
  938. class NzTdAddOnComponent {
  939. nzChecked = false;
  940. nzDisabled = false;
  941. nzIndeterminate = false;
  942. nzLabel = null;
  943. nzIndentSize = 0;
  944. nzShowExpand = false;
  945. nzShowCheckbox = false;
  946. nzExpand = false;
  947. nzExpandIcon = null;
  948. nzCheckedChange = new EventEmitter();
  949. nzExpandChange = new EventEmitter();
  950. isNzShowExpandChanged = false;
  951. isNzShowCheckboxChanged = false;
  952. onCheckedChange(checked) {
  953. this.nzChecked = checked;
  954. this.nzCheckedChange.emit(checked);
  955. }
  956. onExpandChange(expand) {
  957. this.nzExpand = expand;
  958. this.nzExpandChange.emit(expand);
  959. }
  960. ngOnChanges(changes) {
  961. const isFirstChange = (value) => value && value.firstChange && value.currentValue !== undefined;
  962. const { nzExpand, nzChecked, nzShowExpand, nzShowCheckbox } = changes;
  963. if (nzShowExpand) {
  964. this.isNzShowExpandChanged = true;
  965. }
  966. if (nzShowCheckbox) {
  967. this.isNzShowCheckboxChanged = true;
  968. }
  969. if (isFirstChange(nzExpand) && !this.isNzShowExpandChanged) {
  970. this.nzShowExpand = true;
  971. }
  972. if (isFirstChange(nzChecked) && !this.isNzShowCheckboxChanged) {
  973. this.nzShowCheckbox = true;
  974. }
  975. }
  976. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTdAddOnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  977. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTdAddOnComponent, isStandalone: true, selector: "td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]", inputs: { nzChecked: "nzChecked", nzDisabled: "nzDisabled", nzIndeterminate: "nzIndeterminate", nzLabel: "nzLabel", nzIndentSize: "nzIndentSize", nzShowExpand: ["nzShowExpand", "nzShowExpand", booleanAttribute], nzShowCheckbox: ["nzShowCheckbox", "nzShowCheckbox", booleanAttribute], nzExpand: ["nzExpand", "nzExpand", booleanAttribute], nzExpandIcon: "nzExpandIcon" }, outputs: { nzCheckedChange: "nzCheckedChange", nzExpandChange: "nzExpandChange" }, host: { properties: { "class.ant-table-cell-with-append": "nzShowExpand || nzIndentSize > 0", "class.ant-table-selection-column": "nzShowCheckbox" } }, usesOnChanges: true, ngImport: i0, template: `
  978. @if (nzShowExpand || nzIndentSize > 0) {
  979. <nz-row-indent [indentSize]="nzIndentSize"></nz-row-indent>
  980. @if (nzExpandIcon) {
  981. <ng-template [ngTemplateOutlet]="nzExpandIcon"></ng-template>
  982. } @else {
  983. <button
  984. nz-row-expand-button
  985. [expand]="nzExpand"
  986. (expandChange)="onExpandChange($event)"
  987. [spaceMode]="!nzShowExpand"
  988. ></button>
  989. }
  990. }
  991. @if (nzShowCheckbox) {
  992. <label
  993. nz-checkbox
  994. [nzDisabled]="nzDisabled"
  995. [ngModel]="nzChecked"
  996. [nzIndeterminate]="nzIndeterminate"
  997. [attr.aria-label]="nzLabel"
  998. (ngModelChange)="onCheckedChange($event)"
  999. ></label>
  1000. }
  1001. <ng-content></ng-content>
  1002. `, isInline: true, dependencies: [{ kind: "directive", type: NzRowIndentDirective, selector: "nz-row-indent", inputs: ["indentSize"] }, { kind: "directive", type: NzRowExpandButtonDirective, selector: "button[nz-row-expand-button]", inputs: ["expand", "spaceMode"], outputs: ["expandChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "component", type: i5.NzCheckboxComponent, selector: "[nz-checkbox]", inputs: ["nzValue", "nzAutoFocus", "nzDisabled", "nzIndeterminate", "nzChecked", "nzId", "nzName"], outputs: ["nzCheckedChange"], exportAs: ["nzCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1003. }
  1004. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTdAddOnComponent, decorators: [{
  1005. type: Component,
  1006. args: [{
  1007. selector: 'td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]',
  1008. changeDetection: ChangeDetectionStrategy.OnPush,
  1009. preserveWhitespaces: false,
  1010. encapsulation: ViewEncapsulation.None,
  1011. template: `
  1012. @if (nzShowExpand || nzIndentSize > 0) {
  1013. <nz-row-indent [indentSize]="nzIndentSize"></nz-row-indent>
  1014. @if (nzExpandIcon) {
  1015. <ng-template [ngTemplateOutlet]="nzExpandIcon"></ng-template>
  1016. } @else {
  1017. <button
  1018. nz-row-expand-button
  1019. [expand]="nzExpand"
  1020. (expandChange)="onExpandChange($event)"
  1021. [spaceMode]="!nzShowExpand"
  1022. ></button>
  1023. }
  1024. }
  1025. @if (nzShowCheckbox) {
  1026. <label
  1027. nz-checkbox
  1028. [nzDisabled]="nzDisabled"
  1029. [ngModel]="nzChecked"
  1030. [nzIndeterminate]="nzIndeterminate"
  1031. [attr.aria-label]="nzLabel"
  1032. (ngModelChange)="onCheckedChange($event)"
  1033. ></label>
  1034. }
  1035. <ng-content></ng-content>
  1036. `,
  1037. host: {
  1038. '[class.ant-table-cell-with-append]': `nzShowExpand || nzIndentSize > 0`,
  1039. '[class.ant-table-selection-column]': `nzShowCheckbox`
  1040. },
  1041. imports: [NzRowIndentDirective, NzRowExpandButtonDirective, NgTemplateOutlet, NzCheckboxModule, FormsModule]
  1042. }]
  1043. }], propDecorators: { nzChecked: [{
  1044. type: Input
  1045. }], nzDisabled: [{
  1046. type: Input
  1047. }], nzIndeterminate: [{
  1048. type: Input
  1049. }], nzLabel: [{
  1050. type: Input
  1051. }], nzIndentSize: [{
  1052. type: Input
  1053. }], nzShowExpand: [{
  1054. type: Input,
  1055. args: [{ transform: booleanAttribute }]
  1056. }], nzShowCheckbox: [{
  1057. type: Input,
  1058. args: [{ transform: booleanAttribute }]
  1059. }], nzExpand: [{
  1060. type: Input,
  1061. args: [{ transform: booleanAttribute }]
  1062. }], nzExpandIcon: [{
  1063. type: Input
  1064. }], nzCheckedChange: [{
  1065. type: Output
  1066. }], nzExpandChange: [{
  1067. type: Output
  1068. }] } });
  1069. const NZ_CONFIG_MODULE_NAME$1 = 'table';
  1070. let NzThAddOnComponent = (() => {
  1071. let _nzSortDirections_decorators;
  1072. let _nzSortDirections_initializers = [];
  1073. let _nzSortDirections_extraInitializers = [];
  1074. return class NzThAddOnComponent {
  1075. static {
  1076. const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
  1077. _nzSortDirections_decorators = [WithConfig()];
  1078. __esDecorate(null, null, _nzSortDirections_decorators, { kind: "field", name: "nzSortDirections", static: false, private: false, access: { has: obj => "nzSortDirections" in obj, get: obj => obj.nzSortDirections, set: (obj, value) => { obj.nzSortDirections = value; } }, metadata: _metadata }, _nzSortDirections_initializers, _nzSortDirections_extraInitializers);
  1079. if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  1080. }
  1081. nzConfigService;
  1082. host;
  1083. cdr;
  1084. ngZone;
  1085. destroy$;
  1086. _nzModuleName = NZ_CONFIG_MODULE_NAME$1;
  1087. manualClickOrder$ = new Subject();
  1088. calcOperatorChange$ = new Subject();
  1089. nzFilterValue = null;
  1090. sortOrder = null;
  1091. sortDirections = ['ascend', 'descend', null];
  1092. sortOrderChange$ = new Subject();
  1093. isNzShowSortChanged = false;
  1094. isNzShowFilterChanged = false;
  1095. nzColumnKey;
  1096. nzFilterMultiple = true;
  1097. nzSortOrder = null;
  1098. nzSortPriority = false;
  1099. nzSortDirections = __runInitializers(this, _nzSortDirections_initializers, ['ascend', 'descend', null]);
  1100. nzFilters = (__runInitializers(this, _nzSortDirections_extraInitializers), []);
  1101. nzSortFn = null;
  1102. nzFilterFn = null;
  1103. nzShowSort = false;
  1104. nzShowFilter = false;
  1105. nzCustomFilter = false;
  1106. nzCheckedChange = new EventEmitter();
  1107. nzSortOrderChange = new EventEmitter();
  1108. nzFilterChange = new EventEmitter();
  1109. getNextSortDirection(sortDirections, current) {
  1110. const index = sortDirections.indexOf(current);
  1111. if (index === sortDirections.length - 1) {
  1112. return sortDirections[0];
  1113. }
  1114. else {
  1115. return sortDirections[index + 1];
  1116. }
  1117. }
  1118. setSortOrder(order) {
  1119. this.sortOrderChange$.next(order);
  1120. }
  1121. clearSortOrder() {
  1122. if (this.sortOrder !== null) {
  1123. this.setSortOrder(null);
  1124. }
  1125. }
  1126. onFilterValueChange(value) {
  1127. this.nzFilterChange.emit(value);
  1128. this.nzFilterValue = value;
  1129. this.updateCalcOperator();
  1130. }
  1131. updateCalcOperator() {
  1132. this.calcOperatorChange$.next();
  1133. }
  1134. constructor(nzConfigService, host, cdr, ngZone, destroy$) {
  1135. this.nzConfigService = nzConfigService;
  1136. this.host = host;
  1137. this.cdr = cdr;
  1138. this.ngZone = ngZone;
  1139. this.destroy$ = destroy$;
  1140. }
  1141. ngOnInit() {
  1142. fromEventOutsideAngular(this.host.nativeElement, 'click')
  1143. .pipe(filter(() => this.nzShowSort), takeUntil(this.destroy$))
  1144. .subscribe(() => {
  1145. const nextOrder = this.getNextSortDirection(this.sortDirections, this.sortOrder);
  1146. this.ngZone.run(() => {
  1147. this.setSortOrder(nextOrder);
  1148. this.manualClickOrder$.next(this);
  1149. });
  1150. });
  1151. this.sortOrderChange$.pipe(takeUntil(this.destroy$)).subscribe(order => {
  1152. if (this.sortOrder !== order) {
  1153. this.sortOrder = order;
  1154. this.nzSortOrderChange.emit(order);
  1155. }
  1156. this.updateCalcOperator();
  1157. this.cdr.markForCheck();
  1158. });
  1159. }
  1160. ngOnChanges(changes) {
  1161. const { nzSortDirections, nzFilters, nzSortOrder, nzSortFn, nzFilterFn, nzSortPriority, nzFilterMultiple, nzShowSort, nzShowFilter } = changes;
  1162. if (nzSortDirections) {
  1163. if (this.nzSortDirections && this.nzSortDirections.length) {
  1164. this.sortDirections = this.nzSortDirections;
  1165. }
  1166. }
  1167. if (nzSortOrder) {
  1168. this.sortOrder = this.nzSortOrder;
  1169. this.setSortOrder(this.nzSortOrder);
  1170. }
  1171. if (nzShowSort) {
  1172. this.isNzShowSortChanged = true;
  1173. }
  1174. if (nzShowFilter) {
  1175. this.isNzShowFilterChanged = true;
  1176. }
  1177. const isFirstChange = (value) => value && value.firstChange && value.currentValue !== undefined;
  1178. if ((isFirstChange(nzSortOrder) || isFirstChange(nzSortFn)) && !this.isNzShowSortChanged) {
  1179. this.nzShowSort = true;
  1180. }
  1181. if (isFirstChange(nzFilters) && !this.isNzShowFilterChanged) {
  1182. this.nzShowFilter = true;
  1183. }
  1184. if ((nzFilters || nzFilterMultiple) && this.nzShowFilter) {
  1185. const listOfValue = this.nzFilters.filter(item => item.byDefault).map(item => item.value);
  1186. this.nzFilterValue = this.nzFilterMultiple ? listOfValue : listOfValue[0] || null;
  1187. }
  1188. if (nzSortFn || nzFilterFn || nzSortPriority || nzFilters) {
  1189. this.updateCalcOperator();
  1190. }
  1191. }
  1192. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzThAddOnComponent, deps: [{ token: i1.NzConfigService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i2.NzDestroyService }], target: i0.ɵɵFactoryTarget.Component });
  1193. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzThAddOnComponent, isStandalone: true, selector: "th[nzColumnKey], th[nzSortFn], th[nzSortOrder], th[nzFilters], th[nzShowSort], th[nzShowFilter], th[nzCustomFilter]", inputs: { nzColumnKey: "nzColumnKey", nzFilterMultiple: "nzFilterMultiple", nzSortOrder: "nzSortOrder", nzSortPriority: "nzSortPriority", nzSortDirections: "nzSortDirections", nzFilters: "nzFilters", nzSortFn: "nzSortFn", nzFilterFn: "nzFilterFn", nzShowSort: ["nzShowSort", "nzShowSort", booleanAttribute], nzShowFilter: ["nzShowFilter", "nzShowFilter", booleanAttribute], nzCustomFilter: ["nzCustomFilter", "nzCustomFilter", booleanAttribute] }, outputs: { nzCheckedChange: "nzCheckedChange", nzSortOrderChange: "nzSortOrderChange", nzFilterChange: "nzFilterChange" }, host: { properties: { "class.ant-table-column-has-sorters": "nzShowSort", "class.ant-table-column-sort": "sortOrder === 'descend' || sortOrder === 'ascend'" } }, providers: [NzDestroyService], usesOnChanges: true, ngImport: i0, template: `
  1194. @if (nzShowFilter || nzCustomFilter) {
  1195. <nz-table-filter
  1196. [contentTemplate]="notFilterTemplate"
  1197. [extraTemplate]="extraTemplate"
  1198. [customFilter]="nzCustomFilter"
  1199. [filterMultiple]="nzFilterMultiple"
  1200. [listOfFilter]="nzFilters"
  1201. (filterChange)="onFilterValueChange($event)"
  1202. ></nz-table-filter>
  1203. } @else {
  1204. <ng-container [ngTemplateOutlet]="notFilterTemplate"></ng-container>
  1205. }
  1206. <ng-template #notFilterTemplate>
  1207. <ng-template [ngTemplateOutlet]="nzShowSort ? sortTemplate : contentTemplate"></ng-template>
  1208. </ng-template>
  1209. <ng-template #extraTemplate>
  1210. <ng-content select="[nz-th-extra]"></ng-content>
  1211. <ng-content select="nz-filter-trigger"></ng-content>
  1212. </ng-template>
  1213. <ng-template #sortTemplate>
  1214. <nz-table-sorters
  1215. [sortOrder]="sortOrder"
  1216. [sortDirections]="sortDirections"
  1217. [contentTemplate]="contentTemplate"
  1218. ></nz-table-sorters>
  1219. </ng-template>
  1220. <ng-template #contentTemplate>
  1221. <ng-content></ng-content>
  1222. </ng-template>
  1223. `, isInline: true, dependencies: [{ kind: "component", type: NzTableFilterComponent, selector: "nz-table-filter", inputs: ["contentTemplate", "customFilter", "extraTemplate", "filterMultiple", "listOfFilter"], outputs: ["filterChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzTableSortersComponent, selector: "nz-table-sorters", inputs: ["sortDirections", "sortOrder", "contentTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1224. };
  1225. })();
  1226. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzThAddOnComponent, decorators: [{
  1227. type: Component,
  1228. args: [{
  1229. selector: 'th[nzColumnKey], th[nzSortFn], th[nzSortOrder], th[nzFilters], th[nzShowSort], th[nzShowFilter], th[nzCustomFilter]',
  1230. preserveWhitespaces: false,
  1231. encapsulation: ViewEncapsulation.None,
  1232. changeDetection: ChangeDetectionStrategy.OnPush,
  1233. template: `
  1234. @if (nzShowFilter || nzCustomFilter) {
  1235. <nz-table-filter
  1236. [contentTemplate]="notFilterTemplate"
  1237. [extraTemplate]="extraTemplate"
  1238. [customFilter]="nzCustomFilter"
  1239. [filterMultiple]="nzFilterMultiple"
  1240. [listOfFilter]="nzFilters"
  1241. (filterChange)="onFilterValueChange($event)"
  1242. ></nz-table-filter>
  1243. } @else {
  1244. <ng-container [ngTemplateOutlet]="notFilterTemplate"></ng-container>
  1245. }
  1246. <ng-template #notFilterTemplate>
  1247. <ng-template [ngTemplateOutlet]="nzShowSort ? sortTemplate : contentTemplate"></ng-template>
  1248. </ng-template>
  1249. <ng-template #extraTemplate>
  1250. <ng-content select="[nz-th-extra]"></ng-content>
  1251. <ng-content select="nz-filter-trigger"></ng-content>
  1252. </ng-template>
  1253. <ng-template #sortTemplate>
  1254. <nz-table-sorters
  1255. [sortOrder]="sortOrder"
  1256. [sortDirections]="sortDirections"
  1257. [contentTemplate]="contentTemplate"
  1258. ></nz-table-sorters>
  1259. </ng-template>
  1260. <ng-template #contentTemplate>
  1261. <ng-content></ng-content>
  1262. </ng-template>
  1263. `,
  1264. host: {
  1265. '[class.ant-table-column-has-sorters]': 'nzShowSort',
  1266. '[class.ant-table-column-sort]': `sortOrder === 'descend' || sortOrder === 'ascend'`
  1267. },
  1268. providers: [NzDestroyService],
  1269. imports: [NzTableFilterComponent, NgTemplateOutlet, NzTableSortersComponent]
  1270. }]
  1271. }], ctorParameters: () => [{ type: i1.NzConfigService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i2.NzDestroyService }], propDecorators: { nzColumnKey: [{
  1272. type: Input
  1273. }], nzFilterMultiple: [{
  1274. type: Input
  1275. }], nzSortOrder: [{
  1276. type: Input
  1277. }], nzSortPriority: [{
  1278. type: Input
  1279. }], nzSortDirections: [{
  1280. type: Input
  1281. }], nzFilters: [{
  1282. type: Input
  1283. }], nzSortFn: [{
  1284. type: Input
  1285. }], nzFilterFn: [{
  1286. type: Input
  1287. }], nzShowSort: [{
  1288. type: Input,
  1289. args: [{ transform: booleanAttribute }]
  1290. }], nzShowFilter: [{
  1291. type: Input,
  1292. args: [{ transform: booleanAttribute }]
  1293. }], nzCustomFilter: [{
  1294. type: Input,
  1295. args: [{ transform: booleanAttribute }]
  1296. }], nzCheckedChange: [{
  1297. type: Output
  1298. }], nzSortOrderChange: [{
  1299. type: Output
  1300. }], nzFilterChange: [{
  1301. type: Output
  1302. }] } });
  1303. /**
  1304. * Use of this source code is governed by an MIT-style license that can be
  1305. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1306. */
  1307. class NzThMeasureDirective {
  1308. renderer;
  1309. elementRef;
  1310. changes$ = new Subject();
  1311. nzWidth = null;
  1312. colspan = null;
  1313. colSpan = null;
  1314. rowspan = null;
  1315. rowSpan = null;
  1316. constructor(renderer, elementRef) {
  1317. this.renderer = renderer;
  1318. this.elementRef = elementRef;
  1319. }
  1320. ngOnChanges(changes) {
  1321. const { nzWidth, colspan, rowspan, colSpan, rowSpan } = changes;
  1322. if (colspan || colSpan) {
  1323. const col = this.colspan || this.colSpan;
  1324. if (!isNil(col)) {
  1325. this.renderer.setAttribute(this.elementRef.nativeElement, 'colspan', `${col}`);
  1326. }
  1327. else {
  1328. this.renderer.removeAttribute(this.elementRef.nativeElement, 'colspan');
  1329. }
  1330. }
  1331. if (rowspan || rowSpan) {
  1332. const row = this.rowspan || this.rowSpan;
  1333. if (!isNil(row)) {
  1334. this.renderer.setAttribute(this.elementRef.nativeElement, 'rowspan', `${row}`);
  1335. }
  1336. else {
  1337. this.renderer.removeAttribute(this.elementRef.nativeElement, 'rowspan');
  1338. }
  1339. }
  1340. if (nzWidth || colspan) {
  1341. this.changes$.next();
  1342. }
  1343. }
  1344. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzThMeasureDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
  1345. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzThMeasureDirective, isStandalone: true, selector: "th", inputs: { nzWidth: "nzWidth", colspan: "colspan", colSpan: "colSpan", rowspan: "rowspan", rowSpan: "rowSpan" }, usesOnChanges: true, ngImport: i0 });
  1346. }
  1347. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzThMeasureDirective, decorators: [{
  1348. type: Directive,
  1349. args: [{
  1350. selector: 'th'
  1351. }]
  1352. }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { nzWidth: [{
  1353. type: Input
  1354. }], colspan: [{
  1355. type: Input
  1356. }], colSpan: [{
  1357. type: Input
  1358. }], rowspan: [{
  1359. type: Input
  1360. }], rowSpan: [{
  1361. type: Input
  1362. }] } });
  1363. /**
  1364. * Use of this source code is governed by an MIT-style license that can be
  1365. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1366. */
  1367. /* eslint-disable @angular-eslint/component-selector */
  1368. class NzThSelectionComponent {
  1369. nzSelections = [];
  1370. nzChecked = false;
  1371. nzDisabled = false;
  1372. nzIndeterminate = false;
  1373. nzLabel = null;
  1374. nzShowCheckbox = false;
  1375. nzShowRowSelection = false;
  1376. nzCheckedChange = new EventEmitter();
  1377. isNzShowExpandChanged = false;
  1378. isNzShowCheckboxChanged = false;
  1379. onCheckedChange(checked) {
  1380. this.nzChecked = checked;
  1381. this.nzCheckedChange.emit(checked);
  1382. }
  1383. ngOnChanges(changes) {
  1384. const isFirstChange = (value) => value && value.firstChange && value.currentValue !== undefined;
  1385. const { nzChecked, nzSelections, nzShowExpand, nzShowCheckbox } = changes;
  1386. if (nzShowExpand) {
  1387. this.isNzShowExpandChanged = true;
  1388. }
  1389. if (nzShowCheckbox) {
  1390. this.isNzShowCheckboxChanged = true;
  1391. }
  1392. if (isFirstChange(nzSelections) && !this.isNzShowExpandChanged) {
  1393. this.nzShowRowSelection = true;
  1394. }
  1395. if (isFirstChange(nzChecked) && !this.isNzShowCheckboxChanged) {
  1396. this.nzShowCheckbox = true;
  1397. }
  1398. }
  1399. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzThSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  1400. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.2", type: NzThSelectionComponent, isStandalone: true, selector: "th[nzSelections],th[nzChecked],th[nzShowCheckbox],th[nzShowRowSelection]", inputs: { nzSelections: "nzSelections", nzChecked: ["nzChecked", "nzChecked", booleanAttribute], nzDisabled: ["nzDisabled", "nzDisabled", booleanAttribute], nzIndeterminate: "nzIndeterminate", nzLabel: "nzLabel", nzShowCheckbox: ["nzShowCheckbox", "nzShowCheckbox", booleanAttribute], nzShowRowSelection: ["nzShowRowSelection", "nzShowRowSelection", booleanAttribute] }, outputs: { nzCheckedChange: "nzCheckedChange" }, host: { classAttribute: "ant-table-selection-column" }, usesOnChanges: true, ngImport: i0, template: `
  1401. <nz-table-selection
  1402. [checked]="nzChecked"
  1403. [disabled]="nzDisabled"
  1404. [indeterminate]="nzIndeterminate"
  1405. [label]="nzLabel"
  1406. [listOfSelections]="nzSelections"
  1407. [showCheckbox]="nzShowCheckbox"
  1408. [showRowSelection]="nzShowRowSelection"
  1409. (checkedChange)="onCheckedChange($event)"
  1410. ></nz-table-selection>
  1411. <ng-content></ng-content>
  1412. `, isInline: true, dependencies: [{ kind: "component", type: NzTableSelectionComponent, selector: "nz-table-selection", inputs: ["listOfSelections", "checked", "disabled", "indeterminate", "label", "showCheckbox", "showRowSelection"], outputs: ["checkedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1413. }
  1414. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzThSelectionComponent, decorators: [{
  1415. type: Component,
  1416. args: [{
  1417. selector: 'th[nzSelections],th[nzChecked],th[nzShowCheckbox],th[nzShowRowSelection]',
  1418. preserveWhitespaces: false,
  1419. encapsulation: ViewEncapsulation.None,
  1420. changeDetection: ChangeDetectionStrategy.OnPush,
  1421. template: `
  1422. <nz-table-selection
  1423. [checked]="nzChecked"
  1424. [disabled]="nzDisabled"
  1425. [indeterminate]="nzIndeterminate"
  1426. [label]="nzLabel"
  1427. [listOfSelections]="nzSelections"
  1428. [showCheckbox]="nzShowCheckbox"
  1429. [showRowSelection]="nzShowRowSelection"
  1430. (checkedChange)="onCheckedChange($event)"
  1431. ></nz-table-selection>
  1432. <ng-content></ng-content>
  1433. `,
  1434. host: { class: 'ant-table-selection-column' },
  1435. imports: [NzTableSelectionComponent]
  1436. }]
  1437. }], propDecorators: { nzSelections: [{
  1438. type: Input
  1439. }], nzChecked: [{
  1440. type: Input,
  1441. args: [{ transform: booleanAttribute }]
  1442. }], nzDisabled: [{
  1443. type: Input,
  1444. args: [{ transform: booleanAttribute }]
  1445. }], nzIndeterminate: [{
  1446. type: Input
  1447. }], nzLabel: [{
  1448. type: Input
  1449. }], nzShowCheckbox: [{
  1450. type: Input,
  1451. args: [{ transform: booleanAttribute }]
  1452. }], nzShowRowSelection: [{
  1453. type: Input,
  1454. args: [{ transform: booleanAttribute }]
  1455. }], nzCheckedChange: [{
  1456. type: Output
  1457. }] } });
  1458. /**
  1459. * Use of this source code is governed by an MIT-style license that can be
  1460. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1461. */
  1462. class NzCellAlignDirective {
  1463. nzAlign = null;
  1464. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellAlignDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  1465. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzCellAlignDirective, isStandalone: true, selector: "th[nzAlign],td[nzAlign]", inputs: { nzAlign: "nzAlign" }, host: { properties: { "style.text-align": "nzAlign" } }, ngImport: i0 });
  1466. }
  1467. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellAlignDirective, decorators: [{
  1468. type: Directive,
  1469. args: [{
  1470. selector: 'th[nzAlign],td[nzAlign]',
  1471. host: {
  1472. '[style.text-align]': 'nzAlign'
  1473. }
  1474. }]
  1475. }], propDecorators: { nzAlign: [{
  1476. type: Input
  1477. }] } });
  1478. /**
  1479. * Use of this source code is governed by an MIT-style license that can be
  1480. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1481. */
  1482. class NzCellEllipsisDirective {
  1483. nzEllipsis = true;
  1484. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellEllipsisDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  1485. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.2", type: NzCellEllipsisDirective, isStandalone: true, selector: "th[nzEllipsis],td[nzEllipsis]", inputs: { nzEllipsis: ["nzEllipsis", "nzEllipsis", booleanAttribute] }, host: { properties: { "class.ant-table-cell-ellipsis": "nzEllipsis" } }, ngImport: i0 });
  1486. }
  1487. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellEllipsisDirective, decorators: [{
  1488. type: Directive,
  1489. args: [{
  1490. selector: 'th[nzEllipsis],td[nzEllipsis]',
  1491. host: {
  1492. '[class.ant-table-cell-ellipsis]': 'nzEllipsis'
  1493. }
  1494. }]
  1495. }], propDecorators: { nzEllipsis: [{
  1496. type: Input,
  1497. args: [{ transform: booleanAttribute }]
  1498. }] } });
  1499. /**
  1500. * Use of this source code is governed by an MIT-style license that can be
  1501. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1502. */
  1503. class NzCellBreakWordDirective {
  1504. nzBreakWord = true;
  1505. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellBreakWordDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  1506. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.2", type: NzCellBreakWordDirective, isStandalone: true, selector: "th[nzBreakWord],td[nzBreakWord]", inputs: { nzBreakWord: ["nzBreakWord", "nzBreakWord", booleanAttribute] }, host: { properties: { "style.word-break": "nzBreakWord ? 'break-all' : ''" } }, ngImport: i0 });
  1507. }
  1508. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzCellBreakWordDirective, decorators: [{
  1509. type: Directive,
  1510. args: [{
  1511. selector: 'th[nzBreakWord],td[nzBreakWord]',
  1512. host: {
  1513. '[style.word-break]': `nzBreakWord ? 'break-all' : ''`
  1514. }
  1515. }]
  1516. }], propDecorators: { nzBreakWord: [{
  1517. type: Input,
  1518. args: [{ transform: booleanAttribute }]
  1519. }] } });
  1520. /**
  1521. * Use of this source code is governed by an MIT-style license that can be
  1522. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1523. */
  1524. class NzTableContentComponent {
  1525. tableLayout = 'auto';
  1526. theadTemplate = null;
  1527. contentTemplate = null;
  1528. tfootTemplate = null;
  1529. listOfColWidth = [];
  1530. scrollX = null;
  1531. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  1532. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTableContentComponent, isStandalone: true, selector: "table[nz-table-content]", inputs: { tableLayout: "tableLayout", theadTemplate: "theadTemplate", contentTemplate: "contentTemplate", tfootTemplate: "tfootTemplate", listOfColWidth: "listOfColWidth", scrollX: "scrollX" }, host: { properties: { "style.table-layout": "tableLayout", "class.ant-table-fixed": "scrollX", "style.width": "scrollX", "style.min-width": "scrollX ? '100%' : null" } }, ngImport: i0, template: `
  1533. @if (listOfColWidth.length > 0) {
  1534. <colgroup>
  1535. @for (width of listOfColWidth; track $index) {
  1536. <col [style.width]="width" [style.minWidth]="width" />
  1537. }
  1538. </colgroup>
  1539. }
  1540. @if (theadTemplate) {
  1541. <thead class="ant-table-thead">
  1542. <ng-template [ngTemplateOutlet]="theadTemplate"></ng-template>
  1543. </thead>
  1544. }
  1545. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  1546. <ng-content></ng-content>
  1547. @if (tfootTemplate) {
  1548. <tfoot class="ant-table-summary">
  1549. <ng-template [ngTemplateOutlet]="tfootTemplate"></ng-template>
  1550. </tfoot>
  1551. }
  1552. `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1553. }
  1554. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableContentComponent, decorators: [{
  1555. type: Component,
  1556. args: [{
  1557. selector: 'table[nz-table-content]',
  1558. changeDetection: ChangeDetectionStrategy.OnPush,
  1559. encapsulation: ViewEncapsulation.None,
  1560. template: `
  1561. @if (listOfColWidth.length > 0) {
  1562. <colgroup>
  1563. @for (width of listOfColWidth; track $index) {
  1564. <col [style.width]="width" [style.minWidth]="width" />
  1565. }
  1566. </colgroup>
  1567. }
  1568. @if (theadTemplate) {
  1569. <thead class="ant-table-thead">
  1570. <ng-template [ngTemplateOutlet]="theadTemplate"></ng-template>
  1571. </thead>
  1572. }
  1573. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  1574. <ng-content></ng-content>
  1575. @if (tfootTemplate) {
  1576. <tfoot class="ant-table-summary">
  1577. <ng-template [ngTemplateOutlet]="tfootTemplate"></ng-template>
  1578. </tfoot>
  1579. }
  1580. `,
  1581. host: {
  1582. '[style.table-layout]': 'tableLayout',
  1583. '[class.ant-table-fixed]': 'scrollX',
  1584. '[style.width]': 'scrollX',
  1585. '[style.min-width]': `scrollX ? '100%' : null`
  1586. },
  1587. imports: [NgTemplateOutlet]
  1588. }]
  1589. }], propDecorators: { tableLayout: [{
  1590. type: Input
  1591. }], theadTemplate: [{
  1592. type: Input
  1593. }], contentTemplate: [{
  1594. type: Input
  1595. }], tfootTemplate: [{
  1596. type: Input
  1597. }], listOfColWidth: [{
  1598. type: Input
  1599. }], scrollX: [{
  1600. type: Input
  1601. }] } });
  1602. /**
  1603. * Use of this source code is governed by an MIT-style license that can be
  1604. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1605. */
  1606. class NzTableFixedRowComponent {
  1607. nzTableStyleService;
  1608. renderer;
  1609. tdElement;
  1610. hostWidth$ = new BehaviorSubject(null);
  1611. enableAutoMeasure$ = new BehaviorSubject(false);
  1612. destroy$ = new Subject();
  1613. constructor(nzTableStyleService, renderer) {
  1614. this.nzTableStyleService = nzTableStyleService;
  1615. this.renderer = renderer;
  1616. }
  1617. ngOnInit() {
  1618. if (this.nzTableStyleService) {
  1619. const { enableAutoMeasure$, hostWidth$ } = this.nzTableStyleService;
  1620. enableAutoMeasure$.pipe(takeUntil(this.destroy$)).subscribe(this.enableAutoMeasure$);
  1621. hostWidth$.pipe(takeUntil(this.destroy$)).subscribe(this.hostWidth$);
  1622. }
  1623. }
  1624. ngAfterViewInit() {
  1625. this.nzTableStyleService.columnCount$.pipe(takeUntil(this.destroy$)).subscribe(count => {
  1626. this.renderer.setAttribute(this.tdElement.nativeElement, 'colspan', `${count}`);
  1627. });
  1628. }
  1629. ngOnDestroy() {
  1630. this.destroy$.next(true);
  1631. this.destroy$.complete();
  1632. }
  1633. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableFixedRowComponent, deps: [{ token: NzTableStyleService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
  1634. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTableFixedRowComponent, isStandalone: true, selector: "tr[nz-table-fixed-row], tr[nzExpand]", viewQueries: [{ propertyName: "tdElement", first: true, predicate: ["tdElement"], descendants: true, static: true }], ngImport: i0, template: `
  1635. <td class="nz-disable-td ant-table-cell" #tdElement>
  1636. @if (enableAutoMeasure$ | async) {
  1637. <div
  1638. class="ant-table-expanded-row-fixed"
  1639. style="position: sticky; left: 0; overflow: hidden;"
  1640. [style.width.px]="hostWidth$ | async"
  1641. >
  1642. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  1643. </div>
  1644. } @else {
  1645. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  1646. }
  1647. </td>
  1648. <ng-template #contentTemplate>
  1649. <ng-content></ng-content>
  1650. </ng-template>
  1651. `, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1652. }
  1653. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableFixedRowComponent, decorators: [{
  1654. type: Component,
  1655. args: [{
  1656. selector: 'tr[nz-table-fixed-row], tr[nzExpand]',
  1657. changeDetection: ChangeDetectionStrategy.OnPush,
  1658. encapsulation: ViewEncapsulation.None,
  1659. template: `
  1660. <td class="nz-disable-td ant-table-cell" #tdElement>
  1661. @if (enableAutoMeasure$ | async) {
  1662. <div
  1663. class="ant-table-expanded-row-fixed"
  1664. style="position: sticky; left: 0; overflow: hidden;"
  1665. [style.width.px]="hostWidth$ | async"
  1666. >
  1667. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  1668. </div>
  1669. } @else {
  1670. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  1671. }
  1672. </td>
  1673. <ng-template #contentTemplate>
  1674. <ng-content></ng-content>
  1675. </ng-template>
  1676. `,
  1677. imports: [AsyncPipe, NgTemplateOutlet]
  1678. }]
  1679. }], ctorParameters: () => [{ type: NzTableStyleService }, { type: i0.Renderer2 }], propDecorators: { tdElement: [{
  1680. type: ViewChild,
  1681. args: ['tdElement', { static: true }]
  1682. }] } });
  1683. /**
  1684. * Use of this source code is governed by an MIT-style license that can be
  1685. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1686. */
  1687. class NzTableInnerDefaultComponent {
  1688. tableLayout = 'auto';
  1689. listOfColWidth = [];
  1690. theadTemplate = null;
  1691. contentTemplate = null;
  1692. tfootTemplate = null;
  1693. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableInnerDefaultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  1694. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: NzTableInnerDefaultComponent, isStandalone: true, selector: "nz-table-inner-default", inputs: { tableLayout: "tableLayout", listOfColWidth: "listOfColWidth", theadTemplate: "theadTemplate", contentTemplate: "contentTemplate", tfootTemplate: "tfootTemplate" }, host: { classAttribute: "ant-table-container" }, ngImport: i0, template: `
  1695. <div class="ant-table-content">
  1696. <table
  1697. nz-table-content
  1698. [contentTemplate]="contentTemplate"
  1699. [tableLayout]="tableLayout"
  1700. [listOfColWidth]="listOfColWidth"
  1701. [theadTemplate]="theadTemplate"
  1702. [tfootTemplate]="tfootTemplate"
  1703. ></table>
  1704. </div>
  1705. `, isInline: true, dependencies: [{ kind: "component", type: NzTableContentComponent, selector: "table[nz-table-content]", inputs: ["tableLayout", "theadTemplate", "contentTemplate", "tfootTemplate", "listOfColWidth", "scrollX"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1706. }
  1707. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableInnerDefaultComponent, decorators: [{
  1708. type: Component,
  1709. args: [{
  1710. selector: 'nz-table-inner-default',
  1711. changeDetection: ChangeDetectionStrategy.OnPush,
  1712. encapsulation: ViewEncapsulation.None,
  1713. template: `
  1714. <div class="ant-table-content">
  1715. <table
  1716. nz-table-content
  1717. [contentTemplate]="contentTemplate"
  1718. [tableLayout]="tableLayout"
  1719. [listOfColWidth]="listOfColWidth"
  1720. [theadTemplate]="theadTemplate"
  1721. [tfootTemplate]="tfootTemplate"
  1722. ></table>
  1723. </div>
  1724. `,
  1725. host: { class: 'ant-table-container' },
  1726. imports: [NzTableContentComponent]
  1727. }]
  1728. }], propDecorators: { tableLayout: [{
  1729. type: Input
  1730. }], listOfColWidth: [{
  1731. type: Input
  1732. }], theadTemplate: [{
  1733. type: Input
  1734. }], contentTemplate: [{
  1735. type: Input
  1736. }], tfootTemplate: [{
  1737. type: Input
  1738. }] } });
  1739. /**
  1740. * Use of this source code is governed by an MIT-style license that can be
  1741. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1742. */
  1743. class NzTrMeasureComponent {
  1744. nzResizeObserver;
  1745. ngZone;
  1746. listOfMeasureColumn = [];
  1747. listOfAutoWidth = new EventEmitter();
  1748. listOfTdElement;
  1749. destroy$ = new Subject();
  1750. constructor(nzResizeObserver, ngZone) {
  1751. this.nzResizeObserver = nzResizeObserver;
  1752. this.ngZone = ngZone;
  1753. }
  1754. ngAfterViewInit() {
  1755. this.listOfTdElement.changes
  1756. .pipe(startWith(this.listOfTdElement))
  1757. .pipe(switchMap(list => combineLatest(list.toArray().map((item) => this.nzResizeObserver.observe(item).pipe(map(([entry]) => {
  1758. const { width } = entry.target.getBoundingClientRect();
  1759. return Math.floor(width);
  1760. }))))), debounceTime(16), takeUntil(this.destroy$))
  1761. .subscribe(data => {
  1762. // Caretaker note: we don't have to re-enter the Angular zone each time the stream emits.
  1763. // The below check is necessary to be sure that zone is not nooped through `BootstrapOptions`
  1764. // (`bootstrapModule(AppModule, { ngZone: 'noop' }))`. The `ngZone instanceof NgZone` may return
  1765. // `false` if zone is nooped, since `ngZone` will be an instance of the `NoopNgZone`.
  1766. // The `ResizeObserver` might be also patched through `zone.js/dist/zone-patch-resize-observer`,
  1767. // thus calling `ngZone.run` again will cause another change detection.
  1768. if (this.ngZone instanceof NgZone && NgZone.isInAngularZone()) {
  1769. this.listOfAutoWidth.next(data);
  1770. }
  1771. else {
  1772. this.ngZone.run(() => this.listOfAutoWidth.next(data));
  1773. }
  1774. });
  1775. }
  1776. ngOnDestroy() {
  1777. this.destroy$.next(true);
  1778. this.destroy$.complete();
  1779. }
  1780. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTrMeasureComponent, deps: [{ token: i1$2.NzResizeObserver }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
  1781. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTrMeasureComponent, isStandalone: true, selector: "tr[nz-table-measure-row]", inputs: { listOfMeasureColumn: "listOfMeasureColumn" }, outputs: { listOfAutoWidth: "listOfAutoWidth" }, host: { classAttribute: "ant-table-measure-now" }, viewQueries: [{ propertyName: "listOfTdElement", predicate: ["tdElement"], descendants: true }], ngImport: i0, template: `
  1782. @for (th of listOfMeasureColumn; track $index) {
  1783. <td #tdElement class="nz-disable-td" style="padding: 0; border: 0; height: 0;"></td>
  1784. }
  1785. `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1786. }
  1787. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTrMeasureComponent, decorators: [{
  1788. type: Component,
  1789. args: [{
  1790. selector: 'tr[nz-table-measure-row]',
  1791. preserveWhitespaces: false,
  1792. changeDetection: ChangeDetectionStrategy.OnPush,
  1793. encapsulation: ViewEncapsulation.None,
  1794. template: `
  1795. @for (th of listOfMeasureColumn; track $index) {
  1796. <td #tdElement class="nz-disable-td" style="padding: 0; border: 0; height: 0;"></td>
  1797. }
  1798. `,
  1799. host: { class: 'ant-table-measure-now' }
  1800. }]
  1801. }], ctorParameters: () => [{ type: i1$2.NzResizeObserver }, { type: i0.NgZone }], propDecorators: { listOfMeasureColumn: [{
  1802. type: Input
  1803. }], listOfAutoWidth: [{
  1804. type: Output
  1805. }], listOfTdElement: [{
  1806. type: ViewChildren,
  1807. args: ['tdElement']
  1808. }] } });
  1809. /**
  1810. * Use of this source code is governed by an MIT-style license that can be
  1811. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  1812. */
  1813. /* eslint-disable @angular-eslint/component-selector */
  1814. class NzTbodyComponent {
  1815. isInsideTable = false;
  1816. showEmpty$ = new BehaviorSubject(false);
  1817. noResult$ = new BehaviorSubject(undefined);
  1818. listOfMeasureColumn$ = new BehaviorSubject([]);
  1819. destroy$ = new Subject();
  1820. nzTableStyleService = inject(NzTableStyleService, { optional: true });
  1821. constructor() {
  1822. this.isInsideTable = !!this.nzTableStyleService;
  1823. if (this.nzTableStyleService) {
  1824. const { showEmpty$, noResult$, listOfMeasureColumn$ } = this.nzTableStyleService;
  1825. noResult$.pipe(takeUntil(this.destroy$)).subscribe(this.noResult$);
  1826. listOfMeasureColumn$.pipe(takeUntil(this.destroy$)).subscribe(this.listOfMeasureColumn$);
  1827. showEmpty$.pipe(takeUntil(this.destroy$)).subscribe(this.showEmpty$);
  1828. }
  1829. }
  1830. onListOfAutoWidthChange(listOfAutoWidth) {
  1831. this.nzTableStyleService?.setListOfAutoWidth(listOfAutoWidth);
  1832. }
  1833. ngOnDestroy() {
  1834. this.destroy$.next();
  1835. this.destroy$.complete();
  1836. }
  1837. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTbodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  1838. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTbodyComponent, isStandalone: true, selector: "tbody", host: { properties: { "class.ant-table-tbody": "isInsideTable" } }, ngImport: i0, template: `
  1839. @if (listOfMeasureColumn$ | async; as listOfMeasureColumn) {
  1840. @if (isInsideTable && listOfMeasureColumn.length) {
  1841. <tr
  1842. nz-table-measure-row
  1843. [listOfMeasureColumn]="listOfMeasureColumn"
  1844. (listOfAutoWidth)="onListOfAutoWidthChange($event)"
  1845. ></tr>
  1846. }
  1847. }
  1848. <ng-content></ng-content>
  1849. @if (showEmpty$ | async) {
  1850. <tr class="ant-table-placeholder" nz-table-fixed-row>
  1851. <nz-embed-empty nzComponentName="table" [specificContent]="(noResult$ | async)!"></nz-embed-empty>
  1852. </tr>
  1853. }
  1854. `, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: NzTrMeasureComponent, selector: "tr[nz-table-measure-row]", inputs: ["listOfMeasureColumn"], outputs: ["listOfAutoWidth"] }, { kind: "component", type: NzTableFixedRowComponent, selector: "tr[nz-table-fixed-row], tr[nzExpand]" }, { kind: "ngmodule", type: NzEmptyModule }, { kind: "component", type: i1$3.NzEmbedEmptyComponent, selector: "nz-embed-empty", inputs: ["nzComponentName", "specificContent"], exportAs: ["nzEmbedEmpty"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1855. }
  1856. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTbodyComponent, decorators: [{
  1857. type: Component,
  1858. args: [{
  1859. selector: 'tbody',
  1860. preserveWhitespaces: false,
  1861. changeDetection: ChangeDetectionStrategy.OnPush,
  1862. encapsulation: ViewEncapsulation.None,
  1863. template: `
  1864. @if (listOfMeasureColumn$ | async; as listOfMeasureColumn) {
  1865. @if (isInsideTable && listOfMeasureColumn.length) {
  1866. <tr
  1867. nz-table-measure-row
  1868. [listOfMeasureColumn]="listOfMeasureColumn"
  1869. (listOfAutoWidth)="onListOfAutoWidthChange($event)"
  1870. ></tr>
  1871. }
  1872. }
  1873. <ng-content></ng-content>
  1874. @if (showEmpty$ | async) {
  1875. <tr class="ant-table-placeholder" nz-table-fixed-row>
  1876. <nz-embed-empty nzComponentName="table" [specificContent]="(noResult$ | async)!"></nz-embed-empty>
  1877. </tr>
  1878. }
  1879. `,
  1880. host: {
  1881. '[class.ant-table-tbody]': 'isInsideTable'
  1882. },
  1883. imports: [AsyncPipe, NzTrMeasureComponent, NzTableFixedRowComponent, NzEmptyModule]
  1884. }]
  1885. }], ctorParameters: () => [] });
  1886. class NzTableInnerScrollComponent {
  1887. renderer;
  1888. ngZone;
  1889. platform;
  1890. resizeService;
  1891. data = [];
  1892. scrollX = null;
  1893. scrollY = null;
  1894. contentTemplate = null;
  1895. widthConfig = [];
  1896. listOfColWidth = [];
  1897. theadTemplate = null;
  1898. tfootTemplate = null;
  1899. tfootFixed = null;
  1900. virtualTemplate = null;
  1901. virtualItemSize = 0;
  1902. virtualMaxBufferPx = 200;
  1903. virtualMinBufferPx = 100;
  1904. tableMainElement;
  1905. virtualForTrackBy = index => index;
  1906. tableHeaderElement;
  1907. tableBodyElement;
  1908. tableFootElement;
  1909. cdkVirtualScrollViewport;
  1910. headerStyleMap = {};
  1911. bodyStyleMap = {};
  1912. verticalScrollBarWidth = 0;
  1913. noDataVirtualHeight = '182px';
  1914. data$ = new Subject();
  1915. scroll$ = new Subject();
  1916. destroy$ = new Subject();
  1917. setScrollPositionClassName(clear = false) {
  1918. const { scrollWidth, scrollLeft, clientWidth } = this.tableBodyElement.nativeElement;
  1919. const leftClassName = 'ant-table-ping-left';
  1920. const rightClassName = 'ant-table-ping-right';
  1921. if ((scrollWidth === clientWidth && scrollWidth !== 0) || clear) {
  1922. this.renderer.removeClass(this.tableMainElement, leftClassName);
  1923. this.renderer.removeClass(this.tableMainElement, rightClassName);
  1924. }
  1925. else if (scrollLeft === 0) {
  1926. this.renderer.removeClass(this.tableMainElement, leftClassName);
  1927. this.renderer.addClass(this.tableMainElement, rightClassName);
  1928. }
  1929. else if (scrollWidth === scrollLeft + clientWidth) {
  1930. this.renderer.removeClass(this.tableMainElement, rightClassName);
  1931. this.renderer.addClass(this.tableMainElement, leftClassName);
  1932. }
  1933. else {
  1934. this.renderer.addClass(this.tableMainElement, leftClassName);
  1935. this.renderer.addClass(this.tableMainElement, rightClassName);
  1936. }
  1937. }
  1938. constructor(renderer, ngZone, platform, resizeService) {
  1939. this.renderer = renderer;
  1940. this.ngZone = ngZone;
  1941. this.platform = platform;
  1942. this.resizeService = resizeService;
  1943. }
  1944. ngOnChanges(changes) {
  1945. const { scrollX, scrollY, data } = changes;
  1946. if (scrollX || scrollY) {
  1947. const hasVerticalScrollBar = this.verticalScrollBarWidth !== 0;
  1948. this.headerStyleMap = {
  1949. overflowX: 'hidden',
  1950. overflowY: this.scrollY && hasVerticalScrollBar ? 'scroll' : 'hidden'
  1951. };
  1952. this.bodyStyleMap = {
  1953. overflowY: this.scrollY ? 'scroll' : 'hidden',
  1954. overflowX: this.scrollX ? 'auto' : null,
  1955. maxHeight: this.scrollY
  1956. };
  1957. // Caretaker note: we have to emit the value outside the Angular zone, thus DOM timer (`delay(0)`) and `scroll`
  1958. // event listener will be also added outside the Angular zone.
  1959. this.ngZone.runOutsideAngular(() => this.scroll$.next());
  1960. }
  1961. if (data) {
  1962. // See the comment above.
  1963. this.ngZone.runOutsideAngular(() => this.data$.next());
  1964. }
  1965. }
  1966. ngAfterViewInit() {
  1967. if (this.platform.isBrowser) {
  1968. this.ngZone.runOutsideAngular(() => {
  1969. const scrollEvent$ = this.scroll$.pipe(startWith(null), delay(0), switchMap(() => fromEventOutsideAngular(this.tableBodyElement.nativeElement, 'scroll').pipe(startWith(true))), takeUntil(this.destroy$));
  1970. const resize$ = this.resizeService.subscribe().pipe(takeUntil(this.destroy$));
  1971. const data$ = this.data$.pipe(takeUntil(this.destroy$));
  1972. const setClassName$ = merge(scrollEvent$, resize$, data$, this.scroll$).pipe(startWith(true), delay(0), takeUntil(this.destroy$));
  1973. setClassName$.subscribe(() => this.setScrollPositionClassName());
  1974. scrollEvent$.pipe(filter(() => !!this.scrollY)).subscribe(() => {
  1975. this.tableHeaderElement.nativeElement.scrollLeft = this.tableBodyElement.nativeElement.scrollLeft;
  1976. if (this.tableFootElement) {
  1977. this.tableFootElement.nativeElement.scrollLeft = this.tableBodyElement.nativeElement.scrollLeft;
  1978. }
  1979. });
  1980. });
  1981. }
  1982. }
  1983. ngOnDestroy() {
  1984. this.setScrollPositionClassName(true);
  1985. this.destroy$.next();
  1986. this.destroy$.complete();
  1987. }
  1988. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableInnerScrollComponent, deps: [{ token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1$4.Platform }, { token: i2.NzResizeService }], target: i0.ɵɵFactoryTarget.Component });
  1989. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTableInnerScrollComponent, isStandalone: true, selector: "nz-table-inner-scroll", inputs: { data: "data", scrollX: "scrollX", scrollY: "scrollY", contentTemplate: "contentTemplate", widthConfig: "widthConfig", listOfColWidth: "listOfColWidth", theadTemplate: "theadTemplate", tfootTemplate: "tfootTemplate", tfootFixed: "tfootFixed", virtualTemplate: "virtualTemplate", virtualItemSize: "virtualItemSize", virtualMaxBufferPx: "virtualMaxBufferPx", virtualMinBufferPx: "virtualMinBufferPx", tableMainElement: "tableMainElement", virtualForTrackBy: "virtualForTrackBy", verticalScrollBarWidth: "verticalScrollBarWidth", noDataVirtualHeight: "noDataVirtualHeight" }, host: { classAttribute: "ant-table-container" }, viewQueries: [{ propertyName: "tableHeaderElement", first: true, predicate: ["tableHeaderElement"], descendants: true, read: ElementRef }, { propertyName: "tableBodyElement", first: true, predicate: ["tableBodyElement"], descendants: true, read: ElementRef }, { propertyName: "tableFootElement", first: true, predicate: ["tableFootElement"], descendants: true, read: ElementRef }, { propertyName: "cdkVirtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, read: CdkVirtualScrollViewport }], usesOnChanges: true, ngImport: i0, template: `
  1990. @if (scrollY) {
  1991. <div #tableHeaderElement [style]="headerStyleMap" class="ant-table-header nz-table-hide-scrollbar">
  1992. <table
  1993. nz-table-content
  1994. tableLayout="fixed"
  1995. [scrollX]="scrollX"
  1996. [listOfColWidth]="listOfColWidth"
  1997. [theadTemplate]="theadTemplate"
  1998. [tfootTemplate]="tfootFixed === 'top' ? tfootTemplate : null"
  1999. ></table>
  2000. </div>
  2001. @if (!virtualTemplate) {
  2002. <div #tableBodyElement class="ant-table-body" [style]="bodyStyleMap">
  2003. <table
  2004. nz-table-content
  2005. tableLayout="fixed"
  2006. [scrollX]="scrollX"
  2007. [listOfColWidth]="listOfColWidth"
  2008. [contentTemplate]="contentTemplate"
  2009. ></table>
  2010. </div>
  2011. } @else {
  2012. <cdk-virtual-scroll-viewport
  2013. #tableBodyElement
  2014. [itemSize]="virtualItemSize"
  2015. [maxBufferPx]="virtualMaxBufferPx"
  2016. [minBufferPx]="virtualMinBufferPx"
  2017. [style.height]="data.length ? scrollY : noDataVirtualHeight"
  2018. >
  2019. <table nz-table-content tableLayout="fixed" [scrollX]="scrollX" [listOfColWidth]="listOfColWidth">
  2020. <tbody>
  2021. <ng-container *cdkVirtualFor="let item of data; let i = index; trackBy: virtualForTrackBy">
  2022. <ng-template
  2023. [ngTemplateOutlet]="virtualTemplate"
  2024. [ngTemplateOutletContext]="{ $implicit: item, index: i }"
  2025. ></ng-template>
  2026. </ng-container>
  2027. </tbody>
  2028. </table>
  2029. </cdk-virtual-scroll-viewport>
  2030. }
  2031. @if (tfootFixed === 'bottom') {
  2032. <div #tableFootElement class="ant-table-summary" [style]="headerStyleMap">
  2033. <table
  2034. nz-table-content
  2035. tableLayout="fixed"
  2036. [scrollX]="scrollX"
  2037. [listOfColWidth]="listOfColWidth"
  2038. [tfootTemplate]="tfootTemplate"
  2039. ></table>
  2040. </div>
  2041. }
  2042. } @else {
  2043. <div class="ant-table-content" #tableBodyElement [style]="bodyStyleMap">
  2044. <table
  2045. nz-table-content
  2046. tableLayout="fixed"
  2047. [scrollX]="scrollX"
  2048. [listOfColWidth]="listOfColWidth"
  2049. [theadTemplate]="theadTemplate"
  2050. [contentTemplate]="contentTemplate"
  2051. [tfootTemplate]="tfootTemplate"
  2052. ></table>
  2053. </div>
  2054. }
  2055. `, isInline: true, dependencies: [{ kind: "component", type: NzTableContentComponent, selector: "table[nz-table-content]", inputs: ["tableLayout", "theadTemplate", "contentTemplate", "tfootTemplate", "listOfColWidth", "scrollX"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzTbodyComponent, selector: "tbody" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  2056. }
  2057. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableInnerScrollComponent, decorators: [{
  2058. type: Component,
  2059. args: [{
  2060. selector: 'nz-table-inner-scroll',
  2061. changeDetection: ChangeDetectionStrategy.OnPush,
  2062. encapsulation: ViewEncapsulation.None,
  2063. template: `
  2064. @if (scrollY) {
  2065. <div #tableHeaderElement [style]="headerStyleMap" class="ant-table-header nz-table-hide-scrollbar">
  2066. <table
  2067. nz-table-content
  2068. tableLayout="fixed"
  2069. [scrollX]="scrollX"
  2070. [listOfColWidth]="listOfColWidth"
  2071. [theadTemplate]="theadTemplate"
  2072. [tfootTemplate]="tfootFixed === 'top' ? tfootTemplate : null"
  2073. ></table>
  2074. </div>
  2075. @if (!virtualTemplate) {
  2076. <div #tableBodyElement class="ant-table-body" [style]="bodyStyleMap">
  2077. <table
  2078. nz-table-content
  2079. tableLayout="fixed"
  2080. [scrollX]="scrollX"
  2081. [listOfColWidth]="listOfColWidth"
  2082. [contentTemplate]="contentTemplate"
  2083. ></table>
  2084. </div>
  2085. } @else {
  2086. <cdk-virtual-scroll-viewport
  2087. #tableBodyElement
  2088. [itemSize]="virtualItemSize"
  2089. [maxBufferPx]="virtualMaxBufferPx"
  2090. [minBufferPx]="virtualMinBufferPx"
  2091. [style.height]="data.length ? scrollY : noDataVirtualHeight"
  2092. >
  2093. <table nz-table-content tableLayout="fixed" [scrollX]="scrollX" [listOfColWidth]="listOfColWidth">
  2094. <tbody>
  2095. <ng-container *cdkVirtualFor="let item of data; let i = index; trackBy: virtualForTrackBy">
  2096. <ng-template
  2097. [ngTemplateOutlet]="virtualTemplate"
  2098. [ngTemplateOutletContext]="{ $implicit: item, index: i }"
  2099. ></ng-template>
  2100. </ng-container>
  2101. </tbody>
  2102. </table>
  2103. </cdk-virtual-scroll-viewport>
  2104. }
  2105. @if (tfootFixed === 'bottom') {
  2106. <div #tableFootElement class="ant-table-summary" [style]="headerStyleMap">
  2107. <table
  2108. nz-table-content
  2109. tableLayout="fixed"
  2110. [scrollX]="scrollX"
  2111. [listOfColWidth]="listOfColWidth"
  2112. [tfootTemplate]="tfootTemplate"
  2113. ></table>
  2114. </div>
  2115. }
  2116. } @else {
  2117. <div class="ant-table-content" #tableBodyElement [style]="bodyStyleMap">
  2118. <table
  2119. nz-table-content
  2120. tableLayout="fixed"
  2121. [scrollX]="scrollX"
  2122. [listOfColWidth]="listOfColWidth"
  2123. [theadTemplate]="theadTemplate"
  2124. [contentTemplate]="contentTemplate"
  2125. [tfootTemplate]="tfootTemplate"
  2126. ></table>
  2127. </div>
  2128. }
  2129. `,
  2130. host: { class: 'ant-table-container' },
  2131. imports: [NzTableContentComponent, ScrollingModule, NgTemplateOutlet, NzTbodyComponent]
  2132. }]
  2133. }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.NgZone }, { type: i1$4.Platform }, { type: i2.NzResizeService }], propDecorators: { data: [{
  2134. type: Input
  2135. }], scrollX: [{
  2136. type: Input
  2137. }], scrollY: [{
  2138. type: Input
  2139. }], contentTemplate: [{
  2140. type: Input
  2141. }], widthConfig: [{
  2142. type: Input
  2143. }], listOfColWidth: [{
  2144. type: Input
  2145. }], theadTemplate: [{
  2146. type: Input
  2147. }], tfootTemplate: [{
  2148. type: Input
  2149. }], tfootFixed: [{
  2150. type: Input
  2151. }], virtualTemplate: [{
  2152. type: Input
  2153. }], virtualItemSize: [{
  2154. type: Input
  2155. }], virtualMaxBufferPx: [{
  2156. type: Input
  2157. }], virtualMinBufferPx: [{
  2158. type: Input
  2159. }], tableMainElement: [{
  2160. type: Input
  2161. }], virtualForTrackBy: [{
  2162. type: Input
  2163. }], tableHeaderElement: [{
  2164. type: ViewChild,
  2165. args: ['tableHeaderElement', { read: ElementRef }]
  2166. }], tableBodyElement: [{
  2167. type: ViewChild,
  2168. args: ['tableBodyElement', { read: ElementRef }]
  2169. }], tableFootElement: [{
  2170. type: ViewChild,
  2171. args: ['tableFootElement', { read: ElementRef }]
  2172. }], cdkVirtualScrollViewport: [{
  2173. type: ViewChild,
  2174. args: [CdkVirtualScrollViewport, { read: CdkVirtualScrollViewport }]
  2175. }], verticalScrollBarWidth: [{
  2176. type: Input
  2177. }], noDataVirtualHeight: [{
  2178. type: Input
  2179. }] } });
  2180. /**
  2181. * Use of this source code is governed by an MIT-style license that can be
  2182. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  2183. */
  2184. class NzTableVirtualScrollDirective {
  2185. templateRef;
  2186. constructor(templateRef) {
  2187. this.templateRef = templateRef;
  2188. }
  2189. static ngTemplateContextGuard(_dir, _ctx) {
  2190. return true;
  2191. }
  2192. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableVirtualScrollDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
  2193. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzTableVirtualScrollDirective, isStandalone: true, selector: "[nz-virtual-scroll]", exportAs: ["nzVirtualScroll"], ngImport: i0 });
  2194. }
  2195. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableVirtualScrollDirective, decorators: [{
  2196. type: Directive,
  2197. args: [{
  2198. selector: '[nz-virtual-scroll]',
  2199. exportAs: 'nzVirtualScroll'
  2200. }]
  2201. }], ctorParameters: () => [{ type: i0.TemplateRef }] });
  2202. /**
  2203. * Use of this source code is governed by an MIT-style license that can be
  2204. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  2205. */
  2206. class NzTableTitleFooterComponent {
  2207. title = null;
  2208. footer = null;
  2209. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableTitleFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  2210. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: NzTableTitleFooterComponent, isStandalone: true, selector: "nz-table-title-footer", inputs: { title: "title", footer: "footer" }, host: { properties: { "class.ant-table-title": "title !== null", "class.ant-table-footer": "footer !== null" } }, ngImport: i0, template: `
  2211. <ng-container *nzStringTemplateOutlet="title">{{ title }}</ng-container>
  2212. <ng-container *nzStringTemplateOutlet="footer">{{ footer }}</ng-container>
  2213. `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzOutletModule }, { kind: "directive", type: i1$5.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  2214. }
  2215. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableTitleFooterComponent, decorators: [{
  2216. type: Component,
  2217. args: [{
  2218. selector: 'nz-table-title-footer',
  2219. changeDetection: ChangeDetectionStrategy.OnPush,
  2220. encapsulation: ViewEncapsulation.None,
  2221. template: `
  2222. <ng-container *nzStringTemplateOutlet="title">{{ title }}</ng-container>
  2223. <ng-container *nzStringTemplateOutlet="footer">{{ footer }}</ng-container>
  2224. `,
  2225. host: {
  2226. '[class.ant-table-title]': `title !== null`,
  2227. '[class.ant-table-footer]': `footer !== null`
  2228. },
  2229. imports: [NzOutletModule]
  2230. }]
  2231. }], propDecorators: { title: [{
  2232. type: Input
  2233. }], footer: [{
  2234. type: Input
  2235. }] } });
  2236. const NZ_CONFIG_MODULE_NAME = 'table';
  2237. let NzTableComponent = (() => {
  2238. let _nzLoadingIndicator_decorators;
  2239. let _nzLoadingIndicator_initializers = [];
  2240. let _nzLoadingIndicator_extraInitializers = [];
  2241. let _nzBordered_decorators;
  2242. let _nzBordered_initializers = [];
  2243. let _nzBordered_extraInitializers = [];
  2244. let _nzSize_decorators;
  2245. let _nzSize_initializers = [];
  2246. let _nzSize_extraInitializers = [];
  2247. let _nzShowSizeChanger_decorators;
  2248. let _nzShowSizeChanger_initializers = [];
  2249. let _nzShowSizeChanger_extraInitializers = [];
  2250. let _nzHideOnSinglePage_decorators;
  2251. let _nzHideOnSinglePage_initializers = [];
  2252. let _nzHideOnSinglePage_extraInitializers = [];
  2253. let _nzShowQuickJumper_decorators;
  2254. let _nzShowQuickJumper_initializers = [];
  2255. let _nzShowQuickJumper_extraInitializers = [];
  2256. let _nzSimple_decorators;
  2257. let _nzSimple_initializers = [];
  2258. let _nzSimple_extraInitializers = [];
  2259. return class NzTableComponent {
  2260. static {
  2261. const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
  2262. _nzLoadingIndicator_decorators = [WithConfig()];
  2263. _nzBordered_decorators = [WithConfig()];
  2264. _nzSize_decorators = [WithConfig()];
  2265. _nzShowSizeChanger_decorators = [WithConfig()];
  2266. _nzHideOnSinglePage_decorators = [WithConfig()];
  2267. _nzShowQuickJumper_decorators = [WithConfig()];
  2268. _nzSimple_decorators = [WithConfig()];
  2269. __esDecorate(null, null, _nzLoadingIndicator_decorators, { kind: "field", name: "nzLoadingIndicator", static: false, private: false, access: { has: obj => "nzLoadingIndicator" in obj, get: obj => obj.nzLoadingIndicator, set: (obj, value) => { obj.nzLoadingIndicator = value; } }, metadata: _metadata }, _nzLoadingIndicator_initializers, _nzLoadingIndicator_extraInitializers);
  2270. __esDecorate(null, null, _nzBordered_decorators, { kind: "field", name: "nzBordered", static: false, private: false, access: { has: obj => "nzBordered" in obj, get: obj => obj.nzBordered, set: (obj, value) => { obj.nzBordered = value; } }, metadata: _metadata }, _nzBordered_initializers, _nzBordered_extraInitializers);
  2271. __esDecorate(null, null, _nzSize_decorators, { kind: "field", name: "nzSize", static: false, private: false, access: { has: obj => "nzSize" in obj, get: obj => obj.nzSize, set: (obj, value) => { obj.nzSize = value; } }, metadata: _metadata }, _nzSize_initializers, _nzSize_extraInitializers);
  2272. __esDecorate(null, null, _nzShowSizeChanger_decorators, { kind: "field", name: "nzShowSizeChanger", static: false, private: false, access: { has: obj => "nzShowSizeChanger" in obj, get: obj => obj.nzShowSizeChanger, set: (obj, value) => { obj.nzShowSizeChanger = value; } }, metadata: _metadata }, _nzShowSizeChanger_initializers, _nzShowSizeChanger_extraInitializers);
  2273. __esDecorate(null, null, _nzHideOnSinglePage_decorators, { kind: "field", name: "nzHideOnSinglePage", static: false, private: false, access: { has: obj => "nzHideOnSinglePage" in obj, get: obj => obj.nzHideOnSinglePage, set: (obj, value) => { obj.nzHideOnSinglePage = value; } }, metadata: _metadata }, _nzHideOnSinglePage_initializers, _nzHideOnSinglePage_extraInitializers);
  2274. __esDecorate(null, null, _nzShowQuickJumper_decorators, { kind: "field", name: "nzShowQuickJumper", static: false, private: false, access: { has: obj => "nzShowQuickJumper" in obj, get: obj => obj.nzShowQuickJumper, set: (obj, value) => { obj.nzShowQuickJumper = value; } }, metadata: _metadata }, _nzShowQuickJumper_initializers, _nzShowQuickJumper_extraInitializers);
  2275. __esDecorate(null, null, _nzSimple_decorators, { kind: "field", name: "nzSimple", static: false, private: false, access: { has: obj => "nzSimple" in obj, get: obj => obj.nzSimple, set: (obj, value) => { obj.nzSimple = value; } }, metadata: _metadata }, _nzSimple_initializers, _nzSimple_extraInitializers);
  2276. if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  2277. }
  2278. elementRef;
  2279. nzResizeObserver;
  2280. nzConfigService;
  2281. cdr;
  2282. nzTableStyleService;
  2283. nzTableDataService;
  2284. directionality;
  2285. _nzModuleName = NZ_CONFIG_MODULE_NAME;
  2286. nzTableLayout = 'auto';
  2287. nzShowTotal = null;
  2288. nzItemRender = null;
  2289. nzTitle = null;
  2290. nzFooter = null;
  2291. nzNoResult = undefined;
  2292. nzPageSizeOptions = [10, 20, 30, 40, 50];
  2293. nzVirtualItemSize = 0;
  2294. nzVirtualMaxBufferPx = 200;
  2295. nzVirtualMinBufferPx = 100;
  2296. nzVirtualForTrackBy = index => index;
  2297. nzLoadingDelay = 0;
  2298. nzPageIndex = 1;
  2299. nzPageSize = 10;
  2300. nzTotal = 0;
  2301. nzWidthConfig = [];
  2302. nzData = [];
  2303. nzCustomColumn = [];
  2304. nzPaginationPosition = 'bottom';
  2305. nzScroll = { x: null, y: null };
  2306. noDataVirtualHeight = '182px';
  2307. nzPaginationType = 'default';
  2308. nzFrontPagination = true;
  2309. nzTemplateMode = false;
  2310. nzShowPagination = true;
  2311. nzLoading = false;
  2312. nzOuterBordered = false;
  2313. nzLoadingIndicator = __runInitializers(this, _nzLoadingIndicator_initializers, null);
  2314. nzBordered = (__runInitializers(this, _nzLoadingIndicator_extraInitializers), __runInitializers(this, _nzBordered_initializers, false));
  2315. nzSize = (__runInitializers(this, _nzBordered_extraInitializers), __runInitializers(this, _nzSize_initializers, 'default'));
  2316. nzShowSizeChanger = (__runInitializers(this, _nzSize_extraInitializers), __runInitializers(this, _nzShowSizeChanger_initializers, false));
  2317. nzHideOnSinglePage = (__runInitializers(this, _nzShowSizeChanger_extraInitializers), __runInitializers(this, _nzHideOnSinglePage_initializers, false));
  2318. nzShowQuickJumper = (__runInitializers(this, _nzHideOnSinglePage_extraInitializers), __runInitializers(this, _nzShowQuickJumper_initializers, false));
  2319. nzSimple = (__runInitializers(this, _nzShowQuickJumper_extraInitializers), __runInitializers(this, _nzSimple_initializers, false));
  2320. nzPageSizeChange = (__runInitializers(this, _nzSimple_extraInitializers), new EventEmitter());
  2321. nzPageIndexChange = new EventEmitter();
  2322. nzQueryParams = new EventEmitter();
  2323. nzCurrentPageDataChange = new EventEmitter();
  2324. nzCustomColumnChange = new EventEmitter();
  2325. /** public data for ngFor tr */
  2326. data = [];
  2327. cdkVirtualScrollViewport;
  2328. scrollX = null;
  2329. scrollY = null;
  2330. theadTemplate = null;
  2331. tfootTemplate = null;
  2332. tfootFixed = null;
  2333. listOfAutoColWidth = [];
  2334. listOfManualColWidth = [];
  2335. hasFixLeft = false;
  2336. hasFixRight = false;
  2337. showPagination = true;
  2338. destroy$ = new Subject();
  2339. templateMode$ = new BehaviorSubject(false);
  2340. dir = 'ltr';
  2341. nzVirtualScrollDirective;
  2342. nzTableInnerScrollComponent;
  2343. verticalScrollBarWidth = 0;
  2344. onPageSizeChange(size) {
  2345. this.nzTableDataService.updatePageSize(size);
  2346. }
  2347. onPageIndexChange(index) {
  2348. this.nzTableDataService.updatePageIndex(index);
  2349. }
  2350. constructor(elementRef, nzResizeObserver, nzConfigService, cdr, nzTableStyleService, nzTableDataService, directionality) {
  2351. this.elementRef = elementRef;
  2352. this.nzResizeObserver = nzResizeObserver;
  2353. this.nzConfigService = nzConfigService;
  2354. this.cdr = cdr;
  2355. this.nzTableStyleService = nzTableStyleService;
  2356. this.nzTableDataService = nzTableDataService;
  2357. this.directionality = directionality;
  2358. this.nzConfigService
  2359. .getConfigChangeEventForComponent(NZ_CONFIG_MODULE_NAME)
  2360. .pipe(takeUntil(this.destroy$))
  2361. .subscribe(() => {
  2362. this.cdr.markForCheck();
  2363. });
  2364. }
  2365. ngOnInit() {
  2366. const { pageIndexDistinct$, pageSizeDistinct$, listOfCurrentPageData$, total$, queryParams$, listOfCustomColumn$ } = this.nzTableDataService;
  2367. const { theadTemplate$, tfootTemplate$, tfootFixed$, hasFixLeft$, hasFixRight$ } = this.nzTableStyleService;
  2368. this.dir = this.directionality.value;
  2369. this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction) => {
  2370. this.dir = direction;
  2371. this.cdr.detectChanges();
  2372. });
  2373. queryParams$.pipe(takeUntil(this.destroy$)).subscribe(this.nzQueryParams);
  2374. pageIndexDistinct$.pipe(takeUntil(this.destroy$)).subscribe(pageIndex => {
  2375. if (pageIndex !== this.nzPageIndex) {
  2376. this.nzPageIndex = pageIndex;
  2377. this.nzPageIndexChange.next(pageIndex);
  2378. }
  2379. });
  2380. pageSizeDistinct$.pipe(takeUntil(this.destroy$)).subscribe(pageSize => {
  2381. if (pageSize !== this.nzPageSize) {
  2382. this.nzPageSize = pageSize;
  2383. this.nzPageSizeChange.next(pageSize);
  2384. }
  2385. });
  2386. total$
  2387. .pipe(takeUntil(this.destroy$), filter(() => this.nzFrontPagination))
  2388. .subscribe(total => {
  2389. if (total !== this.nzTotal) {
  2390. this.nzTotal = total;
  2391. this.cdr.markForCheck();
  2392. }
  2393. });
  2394. listOfCurrentPageData$.pipe(takeUntil(this.destroy$)).subscribe(data => {
  2395. this.data = data;
  2396. this.nzCurrentPageDataChange.next(data);
  2397. this.cdr.markForCheck();
  2398. });
  2399. listOfCustomColumn$.pipe(takeUntil(this.destroy$)).subscribe(data => {
  2400. this.nzCustomColumn = data;
  2401. this.nzCustomColumnChange.next(data);
  2402. this.cdr.markForCheck();
  2403. });
  2404. theadTemplate$.pipe(takeUntil(this.destroy$)).subscribe(theadTemplate => {
  2405. this.theadTemplate = theadTemplate;
  2406. this.cdr.markForCheck();
  2407. });
  2408. combineLatest([tfootTemplate$, tfootFixed$])
  2409. .pipe(takeUntil(this.destroy$))
  2410. .subscribe(([tfootTemplate, tfootFixed]) => {
  2411. this.tfootTemplate = tfootTemplate;
  2412. this.tfootFixed = tfootFixed;
  2413. this.cdr.markForCheck();
  2414. });
  2415. hasFixLeft$.pipe(takeUntil(this.destroy$)).subscribe(hasFixLeft => {
  2416. this.hasFixLeft = hasFixLeft;
  2417. this.cdr.markForCheck();
  2418. });
  2419. hasFixRight$.pipe(takeUntil(this.destroy$)).subscribe(hasFixRight => {
  2420. this.hasFixRight = hasFixRight;
  2421. this.cdr.markForCheck();
  2422. });
  2423. combineLatest([total$, this.templateMode$])
  2424. .pipe(map(([total, templateMode]) => total === 0 && !templateMode), takeUntil(this.destroy$))
  2425. .subscribe(empty => {
  2426. this.nzTableStyleService.setShowEmpty(empty);
  2427. });
  2428. this.verticalScrollBarWidth = measureScrollbar('vertical');
  2429. this.nzTableStyleService.listOfListOfThWidthPx$.pipe(takeUntil(this.destroy$)).subscribe(listOfWidth => {
  2430. this.listOfAutoColWidth = listOfWidth;
  2431. this.cdr.markForCheck();
  2432. });
  2433. this.nzTableStyleService.manualWidthConfigPx$.pipe(takeUntil(this.destroy$)).subscribe(listOfWidth => {
  2434. this.listOfManualColWidth = listOfWidth;
  2435. this.cdr.markForCheck();
  2436. });
  2437. }
  2438. ngOnChanges(changes) {
  2439. const { nzScroll, nzPageIndex, nzPageSize, nzFrontPagination, nzData, nzCustomColumn, nzWidthConfig, nzNoResult, nzTemplateMode } = changes;
  2440. if (nzPageIndex) {
  2441. this.nzTableDataService.updatePageIndex(this.nzPageIndex);
  2442. }
  2443. if (nzPageSize) {
  2444. this.nzTableDataService.updatePageSize(this.nzPageSize);
  2445. }
  2446. if (nzData) {
  2447. this.nzData = this.nzData || [];
  2448. this.nzTableDataService.updateListOfData(this.nzData);
  2449. }
  2450. if (nzCustomColumn) {
  2451. this.nzCustomColumn = this.nzCustomColumn || [];
  2452. this.nzTableDataService.updateListOfCustomColumn(this.nzCustomColumn);
  2453. }
  2454. if (nzFrontPagination) {
  2455. this.nzTableDataService.updateFrontPagination(this.nzFrontPagination);
  2456. }
  2457. if (nzScroll) {
  2458. this.setScrollOnChanges();
  2459. }
  2460. if (nzWidthConfig) {
  2461. this.nzTableStyleService.setTableWidthConfig(this.nzWidthConfig);
  2462. }
  2463. if (nzTemplateMode) {
  2464. this.templateMode$.next(this.nzTemplateMode);
  2465. }
  2466. if (nzNoResult) {
  2467. this.nzTableStyleService.setNoResult(this.nzNoResult);
  2468. }
  2469. this.updateShowPagination();
  2470. }
  2471. ngAfterViewInit() {
  2472. this.nzResizeObserver
  2473. .observe(this.elementRef)
  2474. .pipe(map(([entry]) => {
  2475. const { width } = entry.target.getBoundingClientRect();
  2476. const scrollBarWidth = this.scrollY ? this.verticalScrollBarWidth : 0;
  2477. return Math.floor(width - scrollBarWidth);
  2478. }), takeUntil(this.destroy$))
  2479. .subscribe(this.nzTableStyleService.hostWidth$);
  2480. if (this.nzTableInnerScrollComponent && this.nzTableInnerScrollComponent.cdkVirtualScrollViewport) {
  2481. this.cdkVirtualScrollViewport = this.nzTableInnerScrollComponent.cdkVirtualScrollViewport;
  2482. }
  2483. }
  2484. ngOnDestroy() {
  2485. this.destroy$.next();
  2486. this.destroy$.complete();
  2487. }
  2488. setScrollOnChanges() {
  2489. this.scrollX = (this.nzScroll && this.nzScroll.x) || null;
  2490. this.scrollY = (this.nzScroll && this.nzScroll.y) || null;
  2491. this.nzTableStyleService.setScroll(this.scrollX, this.scrollY);
  2492. }
  2493. updateShowPagination() {
  2494. this.showPagination =
  2495. (this.nzHideOnSinglePage && this.nzData.length > this.nzPageSize) ||
  2496. (this.nzData.length > 0 && !this.nzHideOnSinglePage) ||
  2497. (!this.nzFrontPagination && this.nzTotal > this.nzPageSize);
  2498. }
  2499. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableComponent, deps: [{ token: i0.ElementRef }, { token: i1$2.NzResizeObserver }, { token: i1.NzConfigService }, { token: i0.ChangeDetectorRef }, { token: NzTableStyleService }, { token: NzTableDataService }, { token: i5$1.Directionality }], target: i0.ɵɵFactoryTarget.Component });
  2500. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTableComponent, isStandalone: true, selector: "nz-table", inputs: { nzTableLayout: "nzTableLayout", nzShowTotal: "nzShowTotal", nzItemRender: "nzItemRender", nzTitle: "nzTitle", nzFooter: "nzFooter", nzNoResult: "nzNoResult", nzPageSizeOptions: "nzPageSizeOptions", nzVirtualItemSize: "nzVirtualItemSize", nzVirtualMaxBufferPx: "nzVirtualMaxBufferPx", nzVirtualMinBufferPx: "nzVirtualMinBufferPx", nzVirtualForTrackBy: "nzVirtualForTrackBy", nzLoadingDelay: "nzLoadingDelay", nzPageIndex: "nzPageIndex", nzPageSize: "nzPageSize", nzTotal: "nzTotal", nzWidthConfig: "nzWidthConfig", nzData: "nzData", nzCustomColumn: "nzCustomColumn", nzPaginationPosition: "nzPaginationPosition", nzScroll: "nzScroll", noDataVirtualHeight: "noDataVirtualHeight", nzPaginationType: "nzPaginationType", nzFrontPagination: ["nzFrontPagination", "nzFrontPagination", booleanAttribute], nzTemplateMode: ["nzTemplateMode", "nzTemplateMode", booleanAttribute], nzShowPagination: ["nzShowPagination", "nzShowPagination", booleanAttribute], nzLoading: ["nzLoading", "nzLoading", booleanAttribute], nzOuterBordered: ["nzOuterBordered", "nzOuterBordered", booleanAttribute], nzLoadingIndicator: "nzLoadingIndicator", nzBordered: ["nzBordered", "nzBordered", booleanAttribute], nzSize: "nzSize", nzShowSizeChanger: ["nzShowSizeChanger", "nzShowSizeChanger", booleanAttribute], nzHideOnSinglePage: ["nzHideOnSinglePage", "nzHideOnSinglePage", booleanAttribute], nzShowQuickJumper: ["nzShowQuickJumper", "nzShowQuickJumper", booleanAttribute], nzSimple: ["nzSimple", "nzSimple", booleanAttribute] }, outputs: { nzPageSizeChange: "nzPageSizeChange", nzPageIndexChange: "nzPageIndexChange", nzQueryParams: "nzQueryParams", nzCurrentPageDataChange: "nzCurrentPageDataChange", nzCustomColumnChange: "nzCustomColumnChange" }, host: { properties: { "class.ant-table-wrapper-rtl": "dir === \"rtl\"", "class.ant-table-custom-column": "nzCustomColumn.length" }, classAttribute: "ant-table-wrapper" }, providers: [NzTableStyleService, NzTableDataService], queries: [{ propertyName: "nzVirtualScrollDirective", first: true, predicate: NzTableVirtualScrollDirective, descendants: true }], viewQueries: [{ propertyName: "nzTableInnerScrollComponent", first: true, predicate: NzTableInnerScrollComponent, descendants: true }], exportAs: ["nzTable"], usesOnChanges: true, ngImport: i0, template: `
  2501. <nz-spin [nzDelay]="nzLoadingDelay" [nzSpinning]="nzLoading" [nzIndicator]="nzLoadingIndicator">
  2502. @if (nzPaginationPosition === 'both' || nzPaginationPosition === 'top') {
  2503. <ng-template [ngTemplateOutlet]="paginationTemplate"></ng-template>
  2504. }
  2505. <div
  2506. #tableMainElement
  2507. class="ant-table"
  2508. [class.ant-table-rtl]="dir === 'rtl'"
  2509. [class.ant-table-fixed-header]="nzData.length && scrollY"
  2510. [class.ant-table-fixed-column]="scrollX"
  2511. [class.ant-table-has-fix-left]="hasFixLeft"
  2512. [class.ant-table-has-fix-right]="hasFixRight"
  2513. [class.ant-table-bordered]="nzBordered"
  2514. [class.nz-table-out-bordered]="nzOuterBordered && !nzBordered"
  2515. [class.ant-table-middle]="nzSize === 'middle'"
  2516. [class.ant-table-small]="nzSize === 'small'"
  2517. >
  2518. @if (nzTitle) {
  2519. <nz-table-title-footer [title]="nzTitle"></nz-table-title-footer>
  2520. }
  2521. @if (scrollY || scrollX) {
  2522. <nz-table-inner-scroll
  2523. [data]="data"
  2524. [scrollX]="scrollX"
  2525. [scrollY]="scrollY"
  2526. [contentTemplate]="contentTemplate"
  2527. [listOfColWidth]="listOfAutoColWidth"
  2528. [theadTemplate]="theadTemplate"
  2529. [tfootTemplate]="tfootTemplate"
  2530. [tfootFixed]="tfootFixed"
  2531. [verticalScrollBarWidth]="verticalScrollBarWidth"
  2532. [virtualTemplate]="nzVirtualScrollDirective ? nzVirtualScrollDirective.templateRef : null"
  2533. [virtualItemSize]="nzVirtualItemSize"
  2534. [virtualMaxBufferPx]="nzVirtualMaxBufferPx"
  2535. [virtualMinBufferPx]="nzVirtualMinBufferPx"
  2536. [tableMainElement]="tableMainElement"
  2537. [virtualForTrackBy]="nzVirtualForTrackBy"
  2538. [noDataVirtualHeight]="noDataVirtualHeight"
  2539. ></nz-table-inner-scroll>
  2540. } @else {
  2541. <nz-table-inner-default
  2542. [tableLayout]="nzTableLayout"
  2543. [listOfColWidth]="listOfManualColWidth"
  2544. [theadTemplate]="theadTemplate"
  2545. [contentTemplate]="contentTemplate"
  2546. [tfootTemplate]="tfootTemplate"
  2547. ></nz-table-inner-default>
  2548. }
  2549. @if (nzFooter) {
  2550. <nz-table-title-footer [footer]="nzFooter"></nz-table-title-footer>
  2551. }
  2552. </div>
  2553. @if (nzPaginationPosition === 'both' || nzPaginationPosition === 'bottom') {
  2554. <ng-template [ngTemplateOutlet]="paginationTemplate"></ng-template>
  2555. }
  2556. </nz-spin>
  2557. <ng-template #paginationTemplate>
  2558. @if (nzShowPagination && data.length) {
  2559. <nz-pagination
  2560. [hidden]="!showPagination"
  2561. class="ant-table-pagination ant-table-pagination-right"
  2562. [nzShowSizeChanger]="nzShowSizeChanger"
  2563. [nzPageSizeOptions]="nzPageSizeOptions"
  2564. [nzItemRender]="nzItemRender!"
  2565. [nzShowQuickJumper]="nzShowQuickJumper"
  2566. [nzHideOnSinglePage]="nzHideOnSinglePage"
  2567. [nzShowTotal]="nzShowTotal"
  2568. [nzSize]="nzPaginationType === 'small' ? 'small' : nzSize === 'default' ? 'default' : 'small'"
  2569. [nzPageSize]="nzPageSize"
  2570. [nzTotal]="nzTotal"
  2571. [nzSimple]="nzSimple"
  2572. [nzPageIndex]="nzPageIndex"
  2573. (nzPageSizeChange)="onPageSizeChange($event)"
  2574. (nzPageIndexChange)="onPageIndexChange($event)"
  2575. ></nz-pagination>
  2576. }
  2577. </ng-template>
  2578. <ng-template #contentTemplate>
  2579. <ng-content></ng-content>
  2580. </ng-template>
  2581. `, isInline: true, dependencies: [{ kind: "component", type: NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NzTableTitleFooterComponent, selector: "nz-table-title-footer", inputs: ["title", "footer"] }, { kind: "component", type: NzTableInnerScrollComponent, selector: "nz-table-inner-scroll", inputs: ["data", "scrollX", "scrollY", "contentTemplate", "widthConfig", "listOfColWidth", "theadTemplate", "tfootTemplate", "tfootFixed", "virtualTemplate", "virtualItemSize", "virtualMaxBufferPx", "virtualMinBufferPx", "tableMainElement", "virtualForTrackBy", "verticalScrollBarWidth", "noDataVirtualHeight"] }, { kind: "component", type: NzTableInnerDefaultComponent, selector: "nz-table-inner-default", inputs: ["tableLayout", "listOfColWidth", "theadTemplate", "contentTemplate", "tfootTemplate"] }, { kind: "ngmodule", type: NzPaginationModule }, { kind: "component", type: i6$1.NzPaginationComponent, selector: "nz-pagination", inputs: ["nzShowTotal", "nzItemRender", "nzSize", "nzPageSizeOptions", "nzShowSizeChanger", "nzShowQuickJumper", "nzSimple", "nzDisabled", "nzResponsive", "nzHideOnSinglePage", "nzTotal", "nzPageIndex", "nzPageSize"], outputs: ["nzPageSizeChange", "nzPageIndexChange"], exportAs: ["nzPagination"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  2582. };
  2583. })();
  2584. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableComponent, decorators: [{
  2585. type: Component,
  2586. args: [{
  2587. selector: 'nz-table',
  2588. exportAs: 'nzTable',
  2589. providers: [NzTableStyleService, NzTableDataService],
  2590. preserveWhitespaces: false,
  2591. changeDetection: ChangeDetectionStrategy.OnPush,
  2592. encapsulation: ViewEncapsulation.None,
  2593. template: `
  2594. <nz-spin [nzDelay]="nzLoadingDelay" [nzSpinning]="nzLoading" [nzIndicator]="nzLoadingIndicator">
  2595. @if (nzPaginationPosition === 'both' || nzPaginationPosition === 'top') {
  2596. <ng-template [ngTemplateOutlet]="paginationTemplate"></ng-template>
  2597. }
  2598. <div
  2599. #tableMainElement
  2600. class="ant-table"
  2601. [class.ant-table-rtl]="dir === 'rtl'"
  2602. [class.ant-table-fixed-header]="nzData.length && scrollY"
  2603. [class.ant-table-fixed-column]="scrollX"
  2604. [class.ant-table-has-fix-left]="hasFixLeft"
  2605. [class.ant-table-has-fix-right]="hasFixRight"
  2606. [class.ant-table-bordered]="nzBordered"
  2607. [class.nz-table-out-bordered]="nzOuterBordered && !nzBordered"
  2608. [class.ant-table-middle]="nzSize === 'middle'"
  2609. [class.ant-table-small]="nzSize === 'small'"
  2610. >
  2611. @if (nzTitle) {
  2612. <nz-table-title-footer [title]="nzTitle"></nz-table-title-footer>
  2613. }
  2614. @if (scrollY || scrollX) {
  2615. <nz-table-inner-scroll
  2616. [data]="data"
  2617. [scrollX]="scrollX"
  2618. [scrollY]="scrollY"
  2619. [contentTemplate]="contentTemplate"
  2620. [listOfColWidth]="listOfAutoColWidth"
  2621. [theadTemplate]="theadTemplate"
  2622. [tfootTemplate]="tfootTemplate"
  2623. [tfootFixed]="tfootFixed"
  2624. [verticalScrollBarWidth]="verticalScrollBarWidth"
  2625. [virtualTemplate]="nzVirtualScrollDirective ? nzVirtualScrollDirective.templateRef : null"
  2626. [virtualItemSize]="nzVirtualItemSize"
  2627. [virtualMaxBufferPx]="nzVirtualMaxBufferPx"
  2628. [virtualMinBufferPx]="nzVirtualMinBufferPx"
  2629. [tableMainElement]="tableMainElement"
  2630. [virtualForTrackBy]="nzVirtualForTrackBy"
  2631. [noDataVirtualHeight]="noDataVirtualHeight"
  2632. ></nz-table-inner-scroll>
  2633. } @else {
  2634. <nz-table-inner-default
  2635. [tableLayout]="nzTableLayout"
  2636. [listOfColWidth]="listOfManualColWidth"
  2637. [theadTemplate]="theadTemplate"
  2638. [contentTemplate]="contentTemplate"
  2639. [tfootTemplate]="tfootTemplate"
  2640. ></nz-table-inner-default>
  2641. }
  2642. @if (nzFooter) {
  2643. <nz-table-title-footer [footer]="nzFooter"></nz-table-title-footer>
  2644. }
  2645. </div>
  2646. @if (nzPaginationPosition === 'both' || nzPaginationPosition === 'bottom') {
  2647. <ng-template [ngTemplateOutlet]="paginationTemplate"></ng-template>
  2648. }
  2649. </nz-spin>
  2650. <ng-template #paginationTemplate>
  2651. @if (nzShowPagination && data.length) {
  2652. <nz-pagination
  2653. [hidden]="!showPagination"
  2654. class="ant-table-pagination ant-table-pagination-right"
  2655. [nzShowSizeChanger]="nzShowSizeChanger"
  2656. [nzPageSizeOptions]="nzPageSizeOptions"
  2657. [nzItemRender]="nzItemRender!"
  2658. [nzShowQuickJumper]="nzShowQuickJumper"
  2659. [nzHideOnSinglePage]="nzHideOnSinglePage"
  2660. [nzShowTotal]="nzShowTotal"
  2661. [nzSize]="nzPaginationType === 'small' ? 'small' : nzSize === 'default' ? 'default' : 'small'"
  2662. [nzPageSize]="nzPageSize"
  2663. [nzTotal]="nzTotal"
  2664. [nzSimple]="nzSimple"
  2665. [nzPageIndex]="nzPageIndex"
  2666. (nzPageSizeChange)="onPageSizeChange($event)"
  2667. (nzPageIndexChange)="onPageIndexChange($event)"
  2668. ></nz-pagination>
  2669. }
  2670. </ng-template>
  2671. <ng-template #contentTemplate>
  2672. <ng-content></ng-content>
  2673. </ng-template>
  2674. `,
  2675. host: {
  2676. class: 'ant-table-wrapper',
  2677. '[class.ant-table-wrapper-rtl]': 'dir === "rtl"',
  2678. '[class.ant-table-custom-column]': `nzCustomColumn.length`
  2679. },
  2680. imports: [
  2681. NzSpinComponent,
  2682. NgTemplateOutlet,
  2683. NzTableTitleFooterComponent,
  2684. NzTableInnerScrollComponent,
  2685. NzTableInnerDefaultComponent,
  2686. NzPaginationModule
  2687. ]
  2688. }]
  2689. }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$2.NzResizeObserver }, { type: i1.NzConfigService }, { type: i0.ChangeDetectorRef }, { type: NzTableStyleService }, { type: NzTableDataService }, { type: i5$1.Directionality }], propDecorators: { nzTableLayout: [{
  2690. type: Input
  2691. }], nzShowTotal: [{
  2692. type: Input
  2693. }], nzItemRender: [{
  2694. type: Input
  2695. }], nzTitle: [{
  2696. type: Input
  2697. }], nzFooter: [{
  2698. type: Input
  2699. }], nzNoResult: [{
  2700. type: Input
  2701. }], nzPageSizeOptions: [{
  2702. type: Input
  2703. }], nzVirtualItemSize: [{
  2704. type: Input
  2705. }], nzVirtualMaxBufferPx: [{
  2706. type: Input
  2707. }], nzVirtualMinBufferPx: [{
  2708. type: Input
  2709. }], nzVirtualForTrackBy: [{
  2710. type: Input
  2711. }], nzLoadingDelay: [{
  2712. type: Input
  2713. }], nzPageIndex: [{
  2714. type: Input
  2715. }], nzPageSize: [{
  2716. type: Input
  2717. }], nzTotal: [{
  2718. type: Input
  2719. }], nzWidthConfig: [{
  2720. type: Input
  2721. }], nzData: [{
  2722. type: Input
  2723. }], nzCustomColumn: [{
  2724. type: Input
  2725. }], nzPaginationPosition: [{
  2726. type: Input
  2727. }], nzScroll: [{
  2728. type: Input
  2729. }], noDataVirtualHeight: [{
  2730. type: Input
  2731. }], nzPaginationType: [{
  2732. type: Input
  2733. }], nzFrontPagination: [{
  2734. type: Input,
  2735. args: [{ transform: booleanAttribute }]
  2736. }], nzTemplateMode: [{
  2737. type: Input,
  2738. args: [{ transform: booleanAttribute }]
  2739. }], nzShowPagination: [{
  2740. type: Input,
  2741. args: [{ transform: booleanAttribute }]
  2742. }], nzLoading: [{
  2743. type: Input,
  2744. args: [{ transform: booleanAttribute }]
  2745. }], nzOuterBordered: [{
  2746. type: Input,
  2747. args: [{ transform: booleanAttribute }]
  2748. }], nzLoadingIndicator: [{
  2749. type: Input
  2750. }], nzBordered: [{
  2751. type: Input,
  2752. args: [{ transform: booleanAttribute }]
  2753. }], nzSize: [{
  2754. type: Input
  2755. }], nzShowSizeChanger: [{
  2756. type: Input,
  2757. args: [{ transform: booleanAttribute }]
  2758. }], nzHideOnSinglePage: [{
  2759. type: Input,
  2760. args: [{ transform: booleanAttribute }]
  2761. }], nzShowQuickJumper: [{
  2762. type: Input,
  2763. args: [{ transform: booleanAttribute }]
  2764. }], nzSimple: [{
  2765. type: Input,
  2766. args: [{ transform: booleanAttribute }]
  2767. }], nzPageSizeChange: [{
  2768. type: Output
  2769. }], nzPageIndexChange: [{
  2770. type: Output
  2771. }], nzQueryParams: [{
  2772. type: Output
  2773. }], nzCurrentPageDataChange: [{
  2774. type: Output
  2775. }], nzCustomColumnChange: [{
  2776. type: Output
  2777. }], nzVirtualScrollDirective: [{
  2778. type: ContentChild,
  2779. args: [NzTableVirtualScrollDirective, { static: false }]
  2780. }], nzTableInnerScrollComponent: [{
  2781. type: ViewChild,
  2782. args: [NzTableInnerScrollComponent]
  2783. }] } });
  2784. /**
  2785. * Use of this source code is governed by an MIT-style license that can be
  2786. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  2787. */
  2788. function fixedAttribute(value) {
  2789. return value === 'top' || value === 'bottom' ? value : booleanAttribute(value) ? 'bottom' : null;
  2790. }
  2791. /* eslint-disable @angular-eslint/component-selector */
  2792. class NzTfootSummaryComponent {
  2793. nzFixed = null;
  2794. templateRef;
  2795. nzTableStyleService = inject(NzTableStyleService, { optional: true });
  2796. isInsideTable = !!this.nzTableStyleService;
  2797. ngOnInit() {
  2798. this.nzTableStyleService?.setTfootTemplate(this.templateRef);
  2799. }
  2800. ngOnChanges(changes) {
  2801. const { nzFixed } = changes;
  2802. this.nzTableStyleService?.setTfootFixed(nzFixed.currentValue);
  2803. }
  2804. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTfootSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  2805. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTfootSummaryComponent, isStandalone: true, selector: "tfoot[nzSummary]", inputs: { nzFixed: ["nzFixed", "nzFixed", fixedAttribute] }, host: { properties: { "class.ant-table-summary": "!isInsideTable || !nzFixed" } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["contentTemplate"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
  2806. <ng-template #contentTemplate>
  2807. <ng-content></ng-content>
  2808. </ng-template>
  2809. @if (!isInsideTable || !nzFixed) {
  2810. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  2811. }
  2812. `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  2813. }
  2814. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTfootSummaryComponent, decorators: [{
  2815. type: Component,
  2816. args: [{
  2817. selector: 'tfoot[nzSummary]',
  2818. changeDetection: ChangeDetectionStrategy.OnPush,
  2819. encapsulation: ViewEncapsulation.None,
  2820. template: `
  2821. <ng-template #contentTemplate>
  2822. <ng-content></ng-content>
  2823. </ng-template>
  2824. @if (!isInsideTable || !nzFixed) {
  2825. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  2826. }
  2827. `,
  2828. imports: [NgTemplateOutlet],
  2829. host: {
  2830. '[class.ant-table-summary]': '!isInsideTable || !nzFixed'
  2831. }
  2832. }]
  2833. }], propDecorators: { nzFixed: [{
  2834. type: Input,
  2835. args: [{ transform: fixedAttribute }]
  2836. }], templateRef: [{
  2837. type: ViewChild,
  2838. args: ['contentTemplate', { static: true }]
  2839. }] } });
  2840. /**
  2841. * Use of this source code is governed by an MIT-style license that can be
  2842. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  2843. */
  2844. class NzTrDirective {
  2845. listOfNzThDirective;
  2846. listOfCellFixedDirective;
  2847. destroy$ = new Subject();
  2848. listOfFixedColumns$ = new ReplaySubject(1);
  2849. listOfColumns$ = new ReplaySubject(1);
  2850. listOfFixedColumnsChanges$ = this.listOfFixedColumns$.pipe(switchMap(list => merge(...[this.listOfFixedColumns$, ...list.map((c) => c.changes$)]).pipe(mergeMap(() => this.listOfFixedColumns$))), takeUntil(this.destroy$));
  2851. listOfFixedLeftColumnChanges$ = this.listOfFixedColumnsChanges$.pipe(map(list => list.filter(item => item.nzLeft !== false)));
  2852. listOfFixedRightColumnChanges$ = this.listOfFixedColumnsChanges$.pipe(map(list => list.filter(item => item.nzRight !== false)));
  2853. listOfColumnsChanges$ = this.listOfColumns$.pipe(switchMap(list => merge(...[this.listOfColumns$, ...list.map((c) => c.changes$)]).pipe(mergeMap(() => this.listOfColumns$))), takeUntil(this.destroy$));
  2854. nzTableStyleService = inject(NzTableStyleService, { optional: true });
  2855. isInsideTable = !!this.nzTableStyleService;
  2856. ngAfterContentInit() {
  2857. if (this.nzTableStyleService) {
  2858. this.listOfCellFixedDirective.changes
  2859. .pipe(startWith(this.listOfCellFixedDirective), takeUntil(this.destroy$))
  2860. .subscribe(this.listOfFixedColumns$);
  2861. this.listOfNzThDirective.changes
  2862. .pipe(startWith(this.listOfNzThDirective), takeUntil(this.destroy$))
  2863. .subscribe(this.listOfColumns$);
  2864. /** set last left and first right **/
  2865. this.listOfFixedLeftColumnChanges$.subscribe(listOfFixedLeft => {
  2866. listOfFixedLeft.forEach(cell => cell.setIsLastLeft(cell === listOfFixedLeft[listOfFixedLeft.length - 1]));
  2867. });
  2868. this.listOfFixedRightColumnChanges$.subscribe(listOfFixedRight => {
  2869. listOfFixedRight.forEach(cell => cell.setIsFirstRight(cell === listOfFixedRight[0]));
  2870. });
  2871. /** calculate fixed nzLeft and nzRight **/
  2872. combineLatest([this.nzTableStyleService.listOfListOfThWidth$, this.listOfFixedLeftColumnChanges$])
  2873. .pipe(takeUntil(this.destroy$))
  2874. .subscribe(([listOfAutoWidth, listOfLeftCell]) => {
  2875. listOfLeftCell.forEach((cell, index) => {
  2876. if (cell.isAutoLeft) {
  2877. const currentArray = listOfLeftCell.slice(0, index);
  2878. const count = currentArray.reduce((pre, cur) => pre + (cur.colspan || cur.colSpan || 1), 0);
  2879. const width = listOfAutoWidth.slice(0, count).reduce((pre, cur) => pre + cur, 0);
  2880. cell.setAutoLeftWidth(`${width}px`);
  2881. }
  2882. });
  2883. });
  2884. combineLatest([this.nzTableStyleService.listOfListOfThWidth$, this.listOfFixedRightColumnChanges$])
  2885. .pipe(takeUntil(this.destroy$))
  2886. .subscribe(([listOfAutoWidth, listOfRightCell]) => {
  2887. listOfRightCell.forEach((_, index) => {
  2888. const cell = listOfRightCell[listOfRightCell.length - index - 1];
  2889. if (cell.isAutoRight) {
  2890. const currentArray = listOfRightCell.slice(listOfRightCell.length - index, listOfRightCell.length);
  2891. const count = currentArray.reduce((pre, cur) => pre + (cur.colspan || cur.colSpan || 1), 0);
  2892. const width = listOfAutoWidth
  2893. .slice(listOfAutoWidth.length - count, listOfAutoWidth.length)
  2894. .reduce((pre, cur) => pre + cur, 0);
  2895. cell.setAutoRightWidth(`${width}px`);
  2896. }
  2897. });
  2898. });
  2899. }
  2900. }
  2901. ngOnDestroy() {
  2902. this.destroy$.next();
  2903. this.destroy$.complete();
  2904. }
  2905. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTrDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  2906. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzTrDirective, isStandalone: true, selector: "tr:not([mat-row]):not([mat-header-row]):not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])", host: { properties: { "class.ant-table-row": "isInsideTable" } }, queries: [{ propertyName: "listOfNzThDirective", predicate: NzThMeasureDirective }, { propertyName: "listOfCellFixedDirective", predicate: NzCellFixedDirective }], ngImport: i0 });
  2907. }
  2908. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTrDirective, decorators: [{
  2909. type: Directive,
  2910. args: [{
  2911. selector: 'tr:not([mat-row]):not([mat-header-row]):not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])',
  2912. host: {
  2913. '[class.ant-table-row]': 'isInsideTable'
  2914. }
  2915. }]
  2916. }], propDecorators: { listOfNzThDirective: [{
  2917. type: ContentChildren,
  2918. args: [NzThMeasureDirective]
  2919. }], listOfCellFixedDirective: [{
  2920. type: ContentChildren,
  2921. args: [NzCellFixedDirective]
  2922. }] } });
  2923. /**
  2924. * Use of this source code is governed by an MIT-style license that can be
  2925. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  2926. */
  2927. /* eslint-disable @angular-eslint/component-selector */
  2928. class NzTheadComponent {
  2929. elementRef;
  2930. renderer;
  2931. destroy$ = new Subject();
  2932. isInsideTable = false;
  2933. templateRef;
  2934. listOfNzTrDirective;
  2935. listOfNzThAddOnComponent;
  2936. nzSortOrderChange = new EventEmitter();
  2937. nzTableStyleService = inject(NzTableStyleService, { optional: true });
  2938. nzTableDataService = inject(NzTableDataService, { optional: true });
  2939. constructor(elementRef, renderer) {
  2940. this.elementRef = elementRef;
  2941. this.renderer = renderer;
  2942. this.isInsideTable = !!this.nzTableStyleService;
  2943. }
  2944. ngOnInit() {
  2945. if (this.nzTableStyleService) {
  2946. this.nzTableStyleService.setTheadTemplate(this.templateRef);
  2947. }
  2948. }
  2949. ngAfterContentInit() {
  2950. if (this.nzTableStyleService) {
  2951. const firstTableRow$ = this.listOfNzTrDirective.changes.pipe(startWith(this.listOfNzTrDirective), map(item => item && item.first));
  2952. const listOfColumnsChanges$ = firstTableRow$.pipe(switchMap(firstTableRow => (firstTableRow ? firstTableRow.listOfColumnsChanges$ : EMPTY)), takeUntil(this.destroy$));
  2953. listOfColumnsChanges$.subscribe(data => this.nzTableStyleService.setListOfTh(data));
  2954. /** TODO: need reset the measure row when scrollX change **/
  2955. this.nzTableStyleService.enableAutoMeasure$
  2956. .pipe(switchMap(enable => (enable ? listOfColumnsChanges$ : of([]))))
  2957. .pipe(takeUntil(this.destroy$))
  2958. .subscribe(data => this.nzTableStyleService.setListOfMeasureColumn(data));
  2959. const listOfFixedLeftColumnChanges$ = firstTableRow$.pipe(switchMap(firstTr => (firstTr ? firstTr.listOfFixedLeftColumnChanges$ : EMPTY)), takeUntil(this.destroy$));
  2960. const listOfFixedRightColumnChanges$ = firstTableRow$.pipe(switchMap(firstTr => (firstTr ? firstTr.listOfFixedRightColumnChanges$ : EMPTY)), takeUntil(this.destroy$));
  2961. listOfFixedLeftColumnChanges$.subscribe(listOfFixedLeftColumn => {
  2962. this.nzTableStyleService.setHasFixLeft(listOfFixedLeftColumn.length !== 0);
  2963. });
  2964. listOfFixedRightColumnChanges$.subscribe(listOfFixedRightColumn => {
  2965. this.nzTableStyleService.setHasFixRight(listOfFixedRightColumn.length !== 0);
  2966. });
  2967. }
  2968. if (this.nzTableDataService) {
  2969. const listOfColumn$ = this.listOfNzThAddOnComponent.changes.pipe(startWith(this.listOfNzThAddOnComponent));
  2970. const manualSort$ = listOfColumn$.pipe(switchMap(() => merge(...this.listOfNzThAddOnComponent.map(th => th.manualClickOrder$))), takeUntil(this.destroy$));
  2971. manualSort$.subscribe((data) => {
  2972. const emitValue = { key: data.nzColumnKey, value: data.sortOrder };
  2973. this.nzSortOrderChange.emit(emitValue);
  2974. if (data.nzSortFn && data.nzSortPriority === false) {
  2975. this.listOfNzThAddOnComponent.filter(th => th !== data).forEach(th => th.clearSortOrder());
  2976. }
  2977. });
  2978. const listOfCalcOperator$ = listOfColumn$.pipe(switchMap(list => merge(...[listOfColumn$, ...list.map((c) => c.calcOperatorChange$)]).pipe(mergeMap(() => listOfColumn$))), map(list => list
  2979. .filter(item => !!item.nzSortFn || !!item.nzFilterFn)
  2980. .map(item => {
  2981. const { nzSortFn, sortOrder, nzFilterFn, nzFilterValue, nzSortPriority, nzColumnKey } = item;
  2982. return {
  2983. key: nzColumnKey,
  2984. sortFn: nzSortFn,
  2985. sortPriority: nzSortPriority,
  2986. sortOrder: sortOrder,
  2987. filterFn: nzFilterFn,
  2988. filterValue: nzFilterValue
  2989. };
  2990. })),
  2991. // TODO: after checked error here
  2992. delay(0), takeUntil(this.destroy$));
  2993. listOfCalcOperator$.subscribe(list => {
  2994. this.nzTableDataService?.listOfCalcOperator$.next(list);
  2995. });
  2996. }
  2997. }
  2998. ngAfterViewInit() {
  2999. if (this.nzTableStyleService) {
  3000. this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement), this.elementRef.nativeElement);
  3001. }
  3002. }
  3003. ngOnDestroy() {
  3004. this.destroy$.next();
  3005. this.destroy$.complete();
  3006. }
  3007. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTheadComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
  3008. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzTheadComponent, isStandalone: true, selector: "thead:not(.ant-table-thead)", outputs: { nzSortOrderChange: "nzSortOrderChange" }, queries: [{ propertyName: "listOfNzTrDirective", predicate: NzTrDirective, descendants: true }, { propertyName: "listOfNzThAddOnComponent", predicate: NzThAddOnComponent, descendants: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["contentTemplate"], descendants: true, static: true }], ngImport: i0, template: `
  3009. <ng-template #contentTemplate>
  3010. <ng-content></ng-content>
  3011. </ng-template>
  3012. @if (!isInsideTable) {
  3013. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  3014. }
  3015. `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  3016. }
  3017. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTheadComponent, decorators: [{
  3018. type: Component,
  3019. args: [{
  3020. selector: 'thead:not(.ant-table-thead)',
  3021. changeDetection: ChangeDetectionStrategy.OnPush,
  3022. encapsulation: ViewEncapsulation.None,
  3023. template: `
  3024. <ng-template #contentTemplate>
  3025. <ng-content></ng-content>
  3026. </ng-template>
  3027. @if (!isInsideTable) {
  3028. <ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
  3029. }
  3030. `,
  3031. imports: [NgTemplateOutlet]
  3032. }]
  3033. }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { templateRef: [{
  3034. type: ViewChild,
  3035. args: ['contentTemplate', { static: true }]
  3036. }], listOfNzTrDirective: [{
  3037. type: ContentChildren,
  3038. args: [NzTrDirective, { descendants: true }]
  3039. }], listOfNzThAddOnComponent: [{
  3040. type: ContentChildren,
  3041. args: [NzThAddOnComponent, { descendants: true }]
  3042. }], nzSortOrderChange: [{
  3043. type: Output
  3044. }] } });
  3045. /**
  3046. * Use of this source code is governed by an MIT-style license that can be
  3047. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  3048. */
  3049. class NzTrExpandDirective {
  3050. nzExpand = true;
  3051. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTrExpandDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  3052. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: NzTrExpandDirective, isStandalone: true, selector: "tr[nzExpand]", inputs: { nzExpand: "nzExpand" }, host: { properties: { "hidden": "!nzExpand" }, classAttribute: "ant-table-expanded-row" }, ngImport: i0 });
  3053. }
  3054. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTrExpandDirective, decorators: [{
  3055. type: Directive,
  3056. args: [{
  3057. selector: 'tr[nzExpand]',
  3058. host: {
  3059. class: 'ant-table-expanded-row',
  3060. '[hidden]': `!nzExpand`
  3061. }
  3062. }]
  3063. }], propDecorators: { nzExpand: [{
  3064. type: Input
  3065. }] } });
  3066. /**
  3067. * Use of this source code is governed by an MIT-style license that can be
  3068. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  3069. */
  3070. class NzTableModule {
  3071. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  3072. static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: NzTableModule, imports: [NzTableComponent,
  3073. NzThAddOnComponent,
  3074. NzTableCellDirective,
  3075. NzThMeasureDirective,
  3076. NzTdAddOnComponent,
  3077. NzTheadComponent,
  3078. NzTbodyComponent,
  3079. NzTrDirective,
  3080. NzTrExpandDirective,
  3081. NzTfootSummaryComponent,
  3082. NzTableVirtualScrollDirective,
  3083. NzCellFixedDirective,
  3084. NzCustomColumnDirective,
  3085. NzTableContentComponent,
  3086. NzTableTitleFooterComponent,
  3087. NzTableInnerDefaultComponent,
  3088. NzTableInnerScrollComponent,
  3089. NzTrMeasureComponent,
  3090. NzRowIndentDirective,
  3091. NzRowExpandButtonDirective,
  3092. NzCellBreakWordDirective,
  3093. NzCellAlignDirective,
  3094. NzTableSortersComponent,
  3095. NzTableFilterComponent,
  3096. NzTableSelectionComponent,
  3097. NzCellEllipsisDirective,
  3098. NzFilterTriggerComponent,
  3099. NzTableFixedRowComponent,
  3100. NzThSelectionComponent], exports: [NzTableComponent,
  3101. NzThAddOnComponent,
  3102. NzTableCellDirective,
  3103. NzThMeasureDirective,
  3104. NzTdAddOnComponent,
  3105. NzTheadComponent,
  3106. NzTbodyComponent,
  3107. NzTrDirective,
  3108. NzTableVirtualScrollDirective,
  3109. NzCellFixedDirective,
  3110. NzCustomColumnDirective,
  3111. NzFilterTriggerComponent,
  3112. NzTrExpandDirective,
  3113. NzTfootSummaryComponent,
  3114. NzCellBreakWordDirective,
  3115. NzCellAlignDirective,
  3116. NzCellEllipsisDirective,
  3117. NzTableFixedRowComponent,
  3118. NzThSelectionComponent] });
  3119. static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableModule, imports: [NzTableComponent,
  3120. NzThAddOnComponent,
  3121. NzTdAddOnComponent,
  3122. NzTbodyComponent,
  3123. NzTableTitleFooterComponent,
  3124. NzTableInnerScrollComponent,
  3125. NzTableSortersComponent,
  3126. NzTableFilterComponent,
  3127. NzTableSelectionComponent,
  3128. NzFilterTriggerComponent,
  3129. NzThSelectionComponent] });
  3130. }
  3131. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzTableModule, decorators: [{
  3132. type: NgModule,
  3133. args: [{
  3134. imports: [
  3135. NzTableComponent,
  3136. NzThAddOnComponent,
  3137. NzTableCellDirective,
  3138. NzThMeasureDirective,
  3139. NzTdAddOnComponent,
  3140. NzTheadComponent,
  3141. NzTbodyComponent,
  3142. NzTrDirective,
  3143. NzTrExpandDirective,
  3144. NzTfootSummaryComponent,
  3145. NzTableVirtualScrollDirective,
  3146. NzCellFixedDirective,
  3147. NzCustomColumnDirective,
  3148. NzTableContentComponent,
  3149. NzTableTitleFooterComponent,
  3150. NzTableInnerDefaultComponent,
  3151. NzTableInnerScrollComponent,
  3152. NzTrMeasureComponent,
  3153. NzRowIndentDirective,
  3154. NzRowExpandButtonDirective,
  3155. NzCellBreakWordDirective,
  3156. NzCellAlignDirective,
  3157. NzTableSortersComponent,
  3158. NzTableFilterComponent,
  3159. NzTableSelectionComponent,
  3160. NzCellEllipsisDirective,
  3161. NzFilterTriggerComponent,
  3162. NzTableFixedRowComponent,
  3163. NzThSelectionComponent
  3164. ],
  3165. exports: [
  3166. NzTableComponent,
  3167. NzThAddOnComponent,
  3168. NzTableCellDirective,
  3169. NzThMeasureDirective,
  3170. NzTdAddOnComponent,
  3171. NzTheadComponent,
  3172. NzTbodyComponent,
  3173. NzTrDirective,
  3174. NzTableVirtualScrollDirective,
  3175. NzCellFixedDirective,
  3176. NzCustomColumnDirective,
  3177. NzFilterTriggerComponent,
  3178. NzTrExpandDirective,
  3179. NzTfootSummaryComponent,
  3180. NzCellBreakWordDirective,
  3181. NzCellAlignDirective,
  3182. NzCellEllipsisDirective,
  3183. NzTableFixedRowComponent,
  3184. NzThSelectionComponent
  3185. ]
  3186. }]
  3187. }] });
  3188. /**
  3189. * Use of this source code is governed by an MIT-style license that can be
  3190. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  3191. */
  3192. /**
  3193. * Use of this source code is governed by an MIT-style license that can be
  3194. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  3195. */
  3196. /**
  3197. * Generated bundle index. Do not edit.
  3198. */
  3199. export { NzCellAlignDirective, NzCellBreakWordDirective, NzCellEllipsisDirective, NzCellFixedDirective, NzCustomColumnDirective, NzFilterTriggerComponent, NzRowExpandButtonDirective, NzRowIndentDirective, NzTableCellDirective, NzTableComponent, NzTableContentComponent, NzTableDataService, NzTableFilterComponent, NzTableFixedRowComponent, NzTableInnerDefaultComponent, NzTableInnerScrollComponent, NzTableModule, NzTableSelectionComponent, NzTableSortersComponent, NzTableStyleService, NzTableTitleFooterComponent, NzTableVirtualScrollDirective, NzTbodyComponent, NzTdAddOnComponent, NzTfootSummaryComponent, NzThAddOnComponent, NzThMeasureDirective, NzThSelectionComponent, NzTheadComponent, NzTrDirective, NzTrExpandDirective, NzTrMeasureComponent };
  3200. //# sourceMappingURL=ng-zorro-antd-table.mjs.map