ngx-axis-appforge 0.0.41 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/axis-components/edit-table/index.d.ts +11 -39
  2. package/axis-components/table/index.d.ts +16 -70
  3. package/axis-components/table-helper/index.d.ts +185 -0
  4. package/axis-components/transfer/index.d.ts +17 -19
  5. package/fesm2022/ngx-axis-appforge-axis-components-edit-table-design.mjs +0 -1
  6. package/fesm2022/ngx-axis-appforge-axis-components-edit-table-design.mjs.map +1 -1
  7. package/fesm2022/ngx-axis-appforge-axis-components-edit-table.mjs +43 -146
  8. package/fesm2022/ngx-axis-appforge-axis-components-edit-table.mjs.map +1 -1
  9. package/fesm2022/ngx-axis-appforge-axis-components-select.mjs +9 -0
  10. package/fesm2022/ngx-axis-appforge-axis-components-select.mjs.map +1 -1
  11. package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs +17 -15
  12. package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs.map +1 -1
  13. package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs +444 -0
  14. package/fesm2022/ngx-axis-appforge-axis-components-table-helper.mjs.map +1 -0
  15. package/fesm2022/ngx-axis-appforge-axis-components-table.mjs +35 -214
  16. package/fesm2022/ngx-axis-appforge-axis-components-table.mjs.map +1 -1
  17. package/fesm2022/ngx-axis-appforge-axis-components-transfer-design.mjs +0 -1
  18. package/fesm2022/ngx-axis-appforge-axis-components-transfer-design.mjs.map +1 -1
  19. package/fesm2022/ngx-axis-appforge-axis-components-transfer.mjs +51 -78
  20. package/fesm2022/ngx-axis-appforge-axis-components-transfer.mjs.map +1 -1
  21. package/fesm2022/ngx-axis-appforge-axis-components.mjs +0 -1
  22. package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +1 -1
  23. package/package.json +103 -99
@@ -1,10 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, effect, input, output, model, ChangeDetectionStrategy, Component, ViewChild } from '@angular/core';
2
+ import { signal, effect, input, output, model, ChangeDetectionStrategy, Component, computed, ViewChild } from '@angular/core';
3
3
  import { DataOptions, Base, ScopeDirective, DynamicDirective } from 'ngx-axis-appforge/core';
4
- import * as i1$1 from 'ng-zorro-antd/table';
4
+ import * as i2$1 from 'ng-zorro-antd/table';
5
5
  import { NzTableModule } from 'ng-zorro-antd/table';
6
6
  import { FormsModule } from '@angular/forms';
7
- import { CommonModule } from '@angular/common';
8
7
  import * as i2 from 'ng-zorro-antd/button';
9
8
  import { NzButtonModule } from 'ng-zorro-antd/button';
10
9
  import * as i5 from 'ng-zorro-antd/grid';
@@ -16,10 +15,13 @@ import { NzModalModule } from 'ng-zorro-antd/modal';
16
15
  import { moveItemInArray, transferArrayItem, CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
17
16
  import { debounceTime, Subject } from 'rxjs';
18
17
  import * as i3 from 'ng-zorro-antd/core/transition-patch';
19
- import * as i2$1 from 'ng-zorro-antd/resizable';
18
+ import * as i3$1 from 'ng-zorro-antd/resizable';
20
19
  import { NzResizableModule } from 'ng-zorro-antd/resizable';
21
- import * as i3$1 from 'ng-zorro-antd/flex';
20
+ import * as i4$1 from 'ng-zorro-antd/flex';
22
21
  import { NzFlexModule } from 'ng-zorro-antd/flex';
22
+ import { DatePipe, DecimalPipe, PercentPipe } from '@angular/common';
23
+ import * as i1$1 from 'ngx-axis-appforge/axis-components/table-helper';
24
+ import { TableFieldDisplayService, TableService, SelectService, ExpandService, StatisticService } from 'ngx-axis-appforge/axis-components/table-helper';
23
25
 
24
26
  class TableOptions extends DataOptions {
25
27
  keyField = signal("", ...(ngDevMode ? [{ debugName: "keyField" }] : []));
@@ -42,8 +44,8 @@ class TableOptions extends DataOptions {
42
44
  disableCheckboxFn = signal(undefined, ...(ngDevMode ? [{ debugName: "disableCheckboxFn" }] : []));
43
45
  enableRowClick = signal(false, ...(ngDevMode ? [{ debugName: "enableRowClick" }] : []));
44
46
  defaultSelectFirstRow = signal(false, ...(ngDevMode ? [{ debugName: "defaultSelectFirstRow" }] : []));
45
- showTotal = signal(false, ...(ngDevMode ? [{ debugName: "showTotal" }] : []));
46
- totalTitle = signal("合计", ...(ngDevMode ? [{ debugName: "totalTitle" }] : []));
47
+ showStatistic = signal(false, ...(ngDevMode ? [{ debugName: "showStatistic" }] : []));
48
+ statisticTitle = signal("合计", ...(ngDevMode ? [{ debugName: "statisticTitle" }] : []));
47
49
  showSubTotal = signal(false, ...(ngDevMode ? [{ debugName: "showSubTotal" }] : []));
48
50
  subTotalTitle = signal("小计", ...(ngDevMode ? [{ debugName: "subTotalTitle" }] : []));
49
51
  subTotalGroupLevel = signal(1, ...(ngDevMode ? [{ debugName: "subTotalGroupLevel" }] : []));
@@ -82,141 +84,17 @@ class TableFieldOptions {
82
84
  sortPriority = signal(null, ...(ngDevMode ? [{ debugName: "sortPriority" }] : []));
83
85
  filterAble = signal(false, ...(ngDevMode ? [{ debugName: "filterAble" }] : []));
84
86
  filterMultiple = signal(false, ...(ngDevMode ? [{ debugName: "filterMultiple" }] : []));
85
- filterDisplayFn = signal("", ...(ngDevMode ? [{ debugName: "filterDisplayFn" }] : []));
86
87
  width = signal(null, ...(ngDevMode ? [{ debugName: "width" }] : []));
87
88
  align = signal("left", ...(ngDevMode ? [{ debugName: "align" }] : []));
88
89
  freezeMode = signal("none", ...(ngDevMode ? [{ debugName: "freezeMode" }] : []));
89
90
  groupLevel = signal(null, ...(ngDevMode ? [{ debugName: "groupLevel" }] : []));
90
- totalAble = signal(false, ...(ngDevMode ? [{ debugName: "totalAble" }] : []));
91
- totalFn = signal(undefined, ...(ngDevMode ? [{ debugName: "totalFn" }] : []));
91
+ statisticAble = signal(false, ...(ngDevMode ? [{ debugName: "statisticAble" }] : []));
92
+ statisticType = signal("sum", ...(ngDevMode ? [{ debugName: "statisticType" }] : []));
93
+ statisticFn = signal(undefined, ...(ngDevMode ? [{ debugName: "statisticFn" }] : []));
92
94
  titleGroup = signal(undefined, ...(ngDevMode ? [{ debugName: "titleGroup" }] : []));
93
95
  child = signal(undefined, ...(ngDevMode ? [{ debugName: "child" }] : []));
94
96
  }
95
97
 
96
- class Select {
97
- options;
98
- displayData;
99
- scope;
100
- onSelectedChange;
101
- constructor(options, displayData, scope, onSelectedChange) {
102
- this.options = options;
103
- this.displayData = displayData;
104
- this.scope = scope;
105
- this.onSelectedChange = onSelectedChange;
106
- }
107
- headerChecked = signal("none", ...(ngDevMode ? [{ debugName: "headerChecked" }] : []));
108
- setOfCheckedId = new Set();
109
- setOfIndeterminateId = new Set();
110
- setOfDisabledId = computed(() => this.buildDisabledId(), ...(ngDevMode ? [{ debugName: "setOfDisabledId" }] : []));
111
- buildDisabledId() {
112
- if (this.options.disableCheckboxFn()) {
113
- const args = this.scope?.snapshotAll() ?? {};
114
- return new Set(this.displayData()?.filter(row => this.scope?.runFnWithSnapshot(this.options.disableCheckboxFn(), Object.assign({}, args, { row })))
115
- .map(row => row[this.options.keyField()]));
116
- }
117
- return new Set();
118
- }
119
- onAllChecked(checked) {
120
- this.displayData()?.filter(row => !this.setOfDisabledId().has(row[this.options.keyField()]))?.forEach(row => this.updateCheckedSet(row, checked));
121
- this.refreshCheckedStatus();
122
- }
123
- toggleChecked(row) {
124
- if (this.options.showCheckbox() && !this.setOfDisabledId().has(row[this.options.keyField()])) {
125
- this.onItemChecked(row, !this.setOfCheckedId.has(row[this.options.keyField()]));
126
- }
127
- }
128
- onItemChecked(row, checked) {
129
- this.updateCheckedSet(row, checked);
130
- this.refreshCheckedStatus();
131
- }
132
- updateCheckedSet(row, checked) {
133
- const key = row[this.options.keyField()];
134
- if (checked && !this.setOfCheckedId.has(key)) {
135
- if (this.options.singleCheck()) {
136
- this.setOfCheckedId.clear();
137
- }
138
- this.setOfCheckedId.add(key);
139
- }
140
- else if (!checked && this.setOfCheckedId.has(key)) {
141
- this.setOfCheckedId.delete(key);
142
- }
143
- }
144
- refreshCheckedStatus() {
145
- const listOfEnabledData = this.displayData()?.filter(row => !this.setOfDisabledId().has(row[this.options.keyField()])) ?? [];
146
- const checked = listOfEnabledData.length > 0 && listOfEnabledData.every(row => this.setOfCheckedId.has(row[this.options.keyField()]) && !this.setOfIndeterminateId.has(row[this.options.keyField()]));
147
- if (checked) {
148
- this.headerChecked.set("checked");
149
- }
150
- else {
151
- const indeterminate = listOfEnabledData.some(row => this.setOfCheckedId.has(row[this.options.keyField()]) || this.setOfIndeterminateId.has(row[this.options.keyField()])) && !checked;
152
- this.headerChecked.set(indeterminate ? "indeterminate" : "none");
153
- }
154
- this.onSelectedChange?.();
155
- }
156
- getSelectedData() {
157
- return this.displayData()?.filter(row => this.setOfCheckedId.has(row[this.options.keyField()]));
158
- }
159
- }
160
-
161
- class Expand {
162
- options;
163
- scope;
164
- constructor(options, scope) {
165
- this.options = options;
166
- this.scope = scope;
167
- }
168
- expandedSet = new Set();
169
- nodeMap = computed(() => this.buildNodeMap(), ...(ngDevMode ? [{ debugName: "nodeMap" }] : []));
170
- buildNodeMap() {
171
- const nodeMap = new Map();
172
- if (this.options.showExpand() && this.options.expandMode() == "tree") {
173
- this.options.data()?.forEach((row) => {
174
- this.buildNodeMapForRow(row, nodeMap);
175
- });
176
- }
177
- return nodeMap;
178
- }
179
- onExpandChange(key, checked) {
180
- if (checked) {
181
- this.expandedSet.add(key);
182
- }
183
- else {
184
- this.expandedSet.delete(key);
185
- }
186
- }
187
- buildNodeMapForRow(row, nodeMap, parentLevel = 0) {
188
- const node = {
189
- level: parentLevel + 1,
190
- node: row,
191
- children: []
192
- };
193
- nodeMap.set(row[this.options.keyField()], node);
194
- if (this.options.showExpand() && this.options.expandMode() == "tree") {
195
- let children;
196
- if (this.options.treeChildrenFun()) {
197
- children = this.scope?.runFnWithSnapshot(this.options.treeChildrenFun(), { row });
198
- }
199
- else {
200
- children = row.children;
201
- }
202
- if (children?.length) {
203
- node.children = children;
204
- children.forEach(child => {
205
- this.buildNodeMapForRow(child, nodeMap, node.level);
206
- });
207
- }
208
- }
209
- }
210
- getListForExpanded(row) {
211
- const key = row[this.options.keyField()];
212
- let res = [row];
213
- if (this.options.showExpand() && this.options.expandMode() == "tree" && this.nodeMap().get(key)?.children?.length && this.expandedSet.has(key)) {
214
- res = res.concat(this.nodeMap().get(key).children);
215
- }
216
- return res;
217
- }
218
- }
219
-
220
98
  class TableSetter {
221
99
  constructor() {
222
100
  effect(() => this.buildFixAndNotFixColumn());
@@ -318,9 +196,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
318
196
 
319
197
  class Table extends Base {
320
198
  elementRef;
321
- constructor(elementRef) {
199
+ tableSvc;
200
+ select;
201
+ expand;
202
+ statistic;
203
+ constructor(elementRef, tableSvc, select, expand, statistic) {
322
204
  super();
323
205
  this.elementRef = elementRef;
206
+ this.tableSvc = tableSvc;
207
+ this.select = select;
208
+ this.expand = expand;
209
+ this.statistic = statistic;
210
+ effect(() => {
211
+ this.tableSvc.init({ data: this.options.data, options: this.options, fields: this.fields });
212
+ this.select.init({ options: this.options, keyField: this.options.keyField(), data: this.options.data, onSelectedChange: () => this.onSelectedChange() });
213
+ this.expand.init({ options: this.options, keyField: this.options.keyField(), data: this.options.data });
214
+ this.statistic.init({ options: this.options, data: this.options.data, fields: this.fields });
215
+ });
324
216
  effect(() => {
325
217
  this.fields().forEach((f, i) => {
326
218
  this.bindWithConfig(this.options.fields()[i], { options: f, tag: `bindField.${i}` });
@@ -337,19 +229,11 @@ class Table extends Base {
337
229
  });
338
230
  }
339
231
  options = new TableOptions();
340
- displayData = computed(() => this.buildDisplayData(), ...(ngDevMode ? [{ debugName: "displayData" }] : []));
341
- select = new Select(this.options, this.displayData, this.getScope(), () => this.onSelectedChange());
342
- expand = new Expand(this.options, this.getScope());
343
- pageSizeOptions = computed(() => this.options.pageSizeOptions().split(",").map(size => +size), ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
344
232
  scroll = signal({ x: "", y: "" }, ...(ngDevMode ? [{ debugName: "scroll" }] : []));
345
233
  fields = computed(() => this.buildFields(), ...(ngDevMode ? [{ debugName: "fields" }] : []));
346
- displayFields = computed(() => this.buildDisplayFields(), ...(ngDevMode ? [{ debugName: "displayFields" }] : []));
347
234
  rowtotal = signal(0, ...(ngDevMode ? [{ debugName: "rowtotal" }] : []));
348
235
  pageIndex = model(1, ...(ngDevMode ? [{ debugName: "pageIndex" }] : []));
349
- fieldsControlsMap = computed(() => this.buildFieldControls(), ...(ngDevMode ? [{ debugName: "fieldsControlsMap" }] : []));
350
- filedsFilterItemsCache = new Map();
351
236
  rowActions = computed(() => this.actionsFieldWidth() > 0 ? this.options.rowActions() : [], ...(ngDevMode ? [{ debugName: "rowActions" }] : []));
352
- leaderFieldWidth = computed(() => this.buildLeaderFieldWidth(), ...(ngDevMode ? [{ debugName: "leaderFieldWidth" }] : []));
353
237
  actionsFieldWidth = computed(() => this.buildActionsFieldWidth(), ...(ngDevMode ? [{ debugName: "actionsFieldWidth" }] : []));
354
238
  fixFields = signal([], ...(ngDevMode ? [{ debugName: "fixFields" }] : []));
355
239
  timer;
@@ -369,67 +253,9 @@ class Table extends Base {
369
253
  trackByKeyField = (i, data) => {
370
254
  return data[this.options.keyField()];
371
255
  };
372
- buildDisplayData() {
373
- return this.options.data();
374
- }
375
256
  buildFields() {
376
257
  return this.options.fields().map(opt => new TableFieldOptions());
377
258
  }
378
- buildDisplayFields() {
379
- return (this.options.showTableTitleSet() ? this.fixFields() : this.fields()).filter(f => f.inuse());
380
- }
381
- buildFieldControls() {
382
- const res = {};
383
- for (const field of this.displayFields()) {
384
- res[field.field()] = {};
385
- if (field.filterAble()) {
386
- if (!this.filedsFilterItemsCache.has(field.field())) {
387
- this.filedsFilterItemsCache.set(field.field(), new Map());
388
- }
389
- const filterItemsCache = this.filedsFilterItemsCache.get(field.field());
390
- for (const row of this.displayData() ?? []) {
391
- const value = row[field.field()];
392
- if (!filterItemsCache.has(value)) {
393
- let text = value + "";
394
- if (field.filterDisplayFn()) {
395
- text = this.getScope()?.runFnWithSnapshot(field.filterDisplayFn(), { value: value, row: row });
396
- }
397
- filterItemsCache.set(value, { value, text });
398
- }
399
- }
400
- res[field.field()].filterItems = Array.from(filterItemsCache.values());
401
- res[field.field()].filterFn = (fd, row) => {
402
- if (fd instanceof Array) {
403
- return fd.includes(row[field.field()]);
404
- }
405
- else {
406
- return fd == row[field.field()];
407
- }
408
- };
409
- }
410
- if (field.sortAble()) {
411
- if (this.options.data()?.some((r) => r[field.field()] != undefined && typeof (r[field.field()]) == "number")) {
412
- res[field.field()].sortFn = (a, b) => a[field.field()] - b[field.field()];
413
- }
414
- else {
415
- res[field.field()].sortFn = (a, b) => {
416
- return ((a[field.field()] || "") + "").localeCompare(b[field.field()]);
417
- };
418
- }
419
- }
420
- }
421
- return res;
422
- }
423
- buildLeaderFieldWidth() {
424
- switch (this.options.size()) {
425
- case "small":
426
- return 45;
427
- case "middle":
428
- return 50;
429
- default:
430
- return 65;
431
- }
432
- }
433
259
  buildActionsFieldWidth() {
434
260
  if (this.options.actionsFieldWidth() == 0 || this.options.rowActions().length == 0) {
435
261
  return 0;
@@ -440,15 +266,15 @@ class Table extends Base {
440
266
  let x = this.options.width() ?? 0;
441
267
  if (this.options.width() == undefined) {
442
268
  if (this.options.showCheckbox()) {
443
- x += this.leaderFieldWidth();
269
+ x += this.tableSvc.leaderFieldWidth();
444
270
  }
445
271
  if (this.options.showExpand()) {
446
- x += this.leaderFieldWidth();
272
+ x += this.tableSvc.leaderFieldWidth();
447
273
  }
448
274
  if (this.options.showOrder()) {
449
- x += this.leaderFieldWidth();
275
+ x += this.tableSvc.leaderFieldWidth();
450
276
  }
451
- this.displayFields().forEach(f => {
277
+ this.tableSvc.displayFields().forEach(f => {
452
278
  if (f.width()) {
453
279
  x += f.width();
454
280
  }
@@ -476,11 +302,6 @@ class Table extends Base {
476
302
  currentPageDataChange() { }
477
303
  onPageChange() {
478
304
  }
479
- filterChange(field, value) {
480
- for (const item of this.filedsFilterItemsCache.get(field).values()) {
481
- item.byDefault = value != null && (Array.isArray(value) ? value.includes(item.value) : item.value == value);
482
- }
483
- }
484
305
  sortChange(field, event) {
485
306
  }
486
307
  rowspan(field, index) {
@@ -495,13 +316,13 @@ class Table extends Base {
495
316
  super.ngOnDestroy();
496
317
  clearInterval(this.timer);
497
318
  }
498
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Table, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
499
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Table, isStandalone: true, selector: "axis-table", inputs: { pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageIndex: "pageIndexChange" }, viewQueries: [{ propertyName: "tableSetter", first: true, predicate: TableSetter, descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (options.showTableTitleSet()) {\n<axis-table-setter [fields]=\"fields()\" [cacheKey]=\"options.tableSetCacheKey()\"\n (onChange)=\"fixFields.set($event)\"></axis-table-setter>\n}\n<nz-table #table [nzSize]=\"options.size()\" [nzData]=\"displayData()??[]\" [nzLoading]=\"!displayData()\"\n [nzBordered]=\"options.bordered()\" [nzOuterBordered]=\"options.outerBordered()\"\n [nzShowPagination]=\"options.showPagination()\"\n [nzFrontPagination]=\"options.showPagination() && !options.useBackEndPaging()\" [nzTotal]=\"rowtotal()\"\n [nzPageSize]=\"options.pageSize()\" [nzShowSizeChanger]=\"options.showSizeChanger()\"\n [nzPageSizeOptions]=\"pageSizeOptions()\" [nzShowTotal]=\"options.showDataSize()?totalRange:null\" [nzScroll]=\"scroll()\"\n (nzCurrentPageDataChange)=\"currentPageDataChange()\" (nzPageIndexChange)=\"onPageChange()\"\n (nzPageSizeChange)=\"onPageChange()\" [(nzPageIndex)]=\"pageIndex\" [nzVirtualItemSize]=\"options.virtualItemSize()\"\n [nzVirtualForTrackBy]=\"trackByKeyField\">\n <thead>\n <tr>\n @if (options.showCheckbox()) {\n @if (!options.checkboxLinkageForExpand() && !options.singleCheck()) {\n <th nzLeft [nzChecked]=\"select.headerChecked()!='none'\"\n [nzIndeterminate]=\"select.headerChecked()=='indeterminate'\"\n (nzCheckedChange)=\"select.onAllChecked($event)\" nzAlign=\"center\" [nzWidth]=\"leaderFieldWidth()-10+'px'\">\n </th>\n }@else {\n <th nzLeft [nzWidth]=\"leaderFieldWidth()-10+'px'\"></th>\n }\n }\n @if (options.showExpand()) {\n <th nzLeft nzAlign=\"center\" [nzWidth]=\"leaderFieldWidth()-15+'px'\"></th>\n }\n @if (options.showOrder()) {\n <th nzAlign=\"center\" [nzWidth]=\"leaderFieldWidth()+'px'\">\u5E8F\u53F7</th>\n }\n @for (f of displayFields(); track f.field()) {\n <th [attr.data-field]=\"f.field()\" nz-resizable nzBounds=\"window\"\n [nzDisabled]=\"!options.showTableTitleSet() || !f.width()\"\n [nzWidth]=\"f.width() == null ?null:f.width()+'px'\" (nzResize)=\"tableSetter?.onResize(f,$event)\"\n [nzShowSort]=\"f.sortAble()\" [nzSortFn]=\"fieldsControlsMap()[f.field()]?.sortFn\"\n [nzSortOrder]=\"f.sortOrder()\" [nzSortPriority]=\"f.sortPriority()??false\"\n [nzShowFilter]=\"f.filterAble() && !options.useBackEndPaging()\"\n [nzFilters]=\"fieldsControlsMap()[f.field()]?.filterItems ?? []\"\n [nzFilterFn]=\"fieldsControlsMap()[f.field()]?.filterFn\"\n (nzFilterChange)=\"filterChange(f.field(),$event)\" [nzFilterMultiple]=\"f.filterMultiple()\"\n [nzAlign]=\"f.align()\" [nzLeft]=\"f.freezeMode()=='left'\" [nzRight]=\"f.freezeMode()=='right'\"\n (nzSortOrderChange)=\"sortChange(f.field(),$event)\">\n <span>\n {{f.title()}}\n @if(options.showTableTitleSet()){\n <nz-resize-handle [style.transform]=\"`translateX(${resizeHandleOffsetX(f)}px)`\" nzDirection=\"right\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"resize-trigger\"></div>\n </nz-resize-handle>\n }\n </span>\n </th>\n }\n @if (rowActions().length)\n {\n <th nzRight nzAlign=\"center\" [nzWidth]=\"actionsFieldWidth()+'px'\" data-rowactions>\u64CD\u4F5C</th>\n }\n </tr>\n </thead>\n <tbody>\n @if (!options.showPagination() && options.virtualScroll()) {\n <ng-template nz-virtual-scroll let-data let-i=\"index\">\n </ng-template>\n }@else {\n @for (trow of table.data; track $index;let i=$index) {\n @for (data of expand.getListForExpanded(trow); track $index) {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:data}]\">\n @if (options.showCheckbox()) {\n <td nzLeft [nzChecked]=\"select.setOfCheckedId.has(data[options.keyField()])\"\n [nzIndeterminate]=\"select.setOfIndeterminateId.has(data[options.keyField()])\"\n [nzDisabled]=\"select.setOfDisabledId().has(data[options.keyField()])\"\n (nzCheckedChange)=\"select.onItemChecked(data, $event)\" nzAlign=\"center\"></td>\n }\n @if (options.showExpand()) {\n @if(options.expandMode() == \"tree\" && !expand.nodeMap().get(data[options.keyField()])?.children?.length){\n <td nzLeft></td>\n }@else{\n <td nzLeft [nzExpand]=\"expand.expandedSet.has(data[options.keyField()])\"\n (nzExpandChange)=\"expand.onExpandChange(data[options.keyField()],$event)\"></td>\n }\n }\n @if (options.showOrder()) {\n <td nzAlign=\"center\">{{(table.nzPageIndex-1) * table.nzPageSize + i+1}}</td>\n }\n @for (f of displayFields(); track f.field()) {\n @if (rowspan(f.field(),i)) {\n <td [attr.rowspan]=\"rowspan(f.field(),i)\" [nzLeft]=\"f.freezeMode()=='left'\" [attr.data-field]=\"f.field()\"\n [nzRight]=\"f.freezeMode()=='right'\" [nzAlign]=\"f.align()\">\n @if (f.child()) {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else {\n {{data[f.field()]}}\n }\n </td>\n }\n }\n @if (rowActions().length) {\n <td nzRight>\n <div nz-flex nzJustify=\"space-evenly\" data-rowactions>\n @for (a of rowActions(); track a.id) {\n <ng-container [axisDynamic]=\"a\"></ng-container>\n }\n </div>\n </td>\n }\n </tr>\n }\n @if (options.showExpand() && options.expandMode() == \"custom\") {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:trow}]\"\n [nzExpand]=\"expand.expandedSet.has(trow[options.keyField()])\" data-expandrow>\n <ng-container [axisDynamic]=\"options.expandRow()\"></ng-container>\n </tr>\n }\n <!-- @if (showSubTotal() && subTotalGroupField() && subTotalMap[i]) {\n <tr>\n @if (options.showCheckbox()) {\n <td nzLeft></td>\n }\n @if (options.showExpand()) {\n <td nzLeft></td>\n }\n @if (options.showOrder()) {\n <td></td>\n }\n @for (f of displayFields(); track f.field()) {\n @if (f.groupLevel && f.groupLevel! == subTotalGroupField.groupLevel!) {\n <td nzAlign=\"right\" [nzLeft]=\"f.freezeMode=='left'\" [nzRight]=\"f.freezeMode=='right'\">\n <b>{{options.subTotalTitle() || \"\u5C0F\u8BA1\"}}</b>\n </td>\n }\n @if(!f.groupLevel || f.groupLevel! > subTotalGroupField.groupLevel!) {\n <td [nzLeft]=\"f.freezeMode=='left'\" [nzRight]=\"f.freezeMode=='right'\">\n @if (f.totalAble) {\n <div [class]=\"'td-box-'+(f.align || 'center')\">\n <b>\n @if (f.child()) {\n @if (f.injectBy() == \"data\") {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else{\n <ng-container [axisDynamic]=\"f.child()\" [ngModel]=\"subTotalMap[i][f.field]\"></ng-container>\n }\n }@else {\n {{subTotalMap[i][f.field]}}\n }\n </b>\n </div>\n }\n </td>\n }\n }\n <td *ngIf=\"rowActions?.length\" nzRight></td>\n </tr>\n } -->\n }\n }\n <!-- @if (showTotal && displayData?.length) {\n <tr class=\"total-row\">\n @if (options.showCheckbox()) {\n <td nzLeft></td>\n }\n @if (options.showExpand()) {\n <td nzLeft></td>\n }\n <td nzAlign=\"right\" [nzLeft]=\"!options.showOrder() && displayFields[0].freezeMode=='left'\"\n [nzRight]=\"!options.showOrder() && displayFields[0].freezeMode=='right'\"><b>{{options.totalTitle() ||\n \"\u5408\u8BA1\"}}</b></td>\n @for (f of displayFields()|slice:(options.showOrder()?0:1); track f.field()) {\n <td [nzLeft]=\"f.freezeMode=='left'\" [nzRight]=\"f.freezeMode=='right'\">\n @if (f.totalAble()) {\n <div [class]=\"'td-box-'+(f.align || 'center')\">\n <b>\n @if (f.child()) {\n @if (f.injectBy() == \"data\") {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else{\n <ng-container [axisDynamic]=\"f.child()\" [ngModel]=\"totalMap[f.field]\"></ng-container>\n }\n }@else {\n {{totalMap[f.field]}}\n }\n </b>\n </div>\n }\n </td>\n }\n @if (rowActions()?.length) {\n <td nzRight></td>\n }\n </tr>\n } -->\n </tbody>\n <ng-template #totalRange let-range=\"range\" let-total>\n \u5171{{ total }}\u6761\u6570\u636E\uFF0C\u7B2C{{ range[0] }}-{{ range[1] }}\u6761\n </ng-template>\n</nz-table>", styles: [":host{display:block;width:100%;overflow:hidden}:host ::ng-deep .ant-table-placeholder .ant-table-expanded-row-fixed{margin:-8px -10px}\n"], dependencies: [{ kind: "ngmodule", type: NzTableModule }, { kind: "component", type: i1$1.NzTableComponent, selector: "nz-table", inputs: ["nzTableLayout", "nzShowTotal", "nzItemRender", "nzTitle", "nzFooter", "nzNoResult", "nzPageSizeOptions", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualForTrackBy", "nzLoadingDelay", "nzPageIndex", "nzPageSize", "nzTotal", "nzWidthConfig", "nzData", "nzCustomColumn", "nzPaginationPosition", "nzScroll", "noDataVirtualHeight", "nzPaginationType", "nzFrontPagination", "nzTemplateMode", "nzShowPagination", "nzLoading", "nzOuterBordered", "nzLoadingIndicator", "nzBordered", "nzSize", "nzShowSizeChanger", "nzHideOnSinglePage", "nzShowQuickJumper", "nzSimple"], outputs: ["nzPageSizeChange", "nzPageIndexChange", "nzQueryParams", "nzCurrentPageDataChange", "nzCustomColumnChange"], exportAs: ["nzTable"] }, { kind: "component", type: i1$1.NzThAddOnComponent, selector: "th[nzColumnKey], th[nzSortFn], th[nzSortOrder], th[nzFilters], th[nzShowSort], th[nzShowFilter], th[nzCustomFilter]", inputs: ["nzColumnKey", "nzFilterMultiple", "nzSortOrder", "nzSortPriority", "nzSortDirections", "nzFilters", "nzSortFn", "nzFilterFn", "nzShowSort", "nzShowFilter", "nzCustomFilter"], outputs: ["nzCheckedChange", "nzSortOrderChange", "nzFilterChange"] }, { kind: "directive", type: i1$1.NzTableCellDirective, selector: "th:not(.nz-disable-th), td:not(.nz-disable-td)" }, { kind: "directive", type: i1$1.NzThMeasureDirective, selector: "th", inputs: ["nzWidth", "colspan", "colSpan", "rowspan", "rowSpan"] }, { kind: "component", type: i1$1.NzTdAddOnComponent, selector: "td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]", inputs: ["nzChecked", "nzDisabled", "nzIndeterminate", "nzLabel", "nzIndentSize", "nzShowExpand", "nzShowCheckbox", "nzExpand", "nzExpandIcon"], outputs: ["nzCheckedChange", "nzExpandChange"] }, { kind: "component", type: i1$1.NzTheadComponent, selector: "thead:not(.ant-table-thead)", outputs: ["nzSortOrderChange"] }, { kind: "component", type: i1$1.NzTbodyComponent, selector: "tbody" }, { kind: "directive", type: i1$1.NzTrDirective, selector: "tr:not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])" }, { kind: "directive", type: i1$1.NzTableVirtualScrollDirective, selector: "[nz-virtual-scroll]", exportAs: ["nzVirtualScroll"] }, { kind: "directive", type: i1$1.NzCellFixedDirective, selector: "td[nzRight],th[nzRight],td[nzLeft],th[nzLeft]", inputs: ["nzRight", "nzLeft", "colspan", "colSpan"] }, { kind: "directive", type: i1$1.NzTrExpandDirective, selector: "tr[nzExpand]", inputs: ["nzExpand"] }, { kind: "directive", type: i1$1.NzCellAlignDirective, selector: "th[nzAlign],td[nzAlign]", inputs: ["nzAlign"] }, { kind: "component", type: i1$1.NzTableFixedRowComponent, selector: "tr[nz-table-fixed-row], tr[nzExpand]" }, { kind: "component", type: i1$1.NzThSelectionComponent, selector: "th[nzSelections],th[nzChecked],th[nzShowCheckbox],th[nzShowRowSelection]", inputs: ["nzSelections", "nzChecked", "nzDisabled", "nzIndeterminate", "nzLabel", "nzShowCheckbox", "nzShowRowSelection"], outputs: ["nzCheckedChange"] }, { kind: "directive", type: ScopeDirective, selector: "[axisScope]", inputs: ["axisScope", "scopeName", "isRoot", "dataSources"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: TableSetter, selector: "axis-table-setter", inputs: ["fields", "cacheKey", "modalVisible"], outputs: ["onChange", "modalVisibleChange"] }, { kind: "ngmodule", type: NzResizableModule }, { kind: "directive", type: i2$1.NzResizableDirective, selector: "[nz-resizable]", inputs: ["nzBounds", "nzMaxHeight", "nzMaxWidth", "nzMinHeight", "nzMinWidth", "nzGridColumnCount", "nzMaxColumn", "nzMinColumn", "nzLockAspectRatio", "nzPreview", "nzDisabled"], outputs: ["nzResize", "nzResizeEnd", "nzResizeStart"], exportAs: ["nzResizable"] }, { kind: "component", type: i2$1.NzResizeHandleComponent, selector: "nz-resize-handle, [nz-resize-handle]", inputs: ["nzDirection", "nzCursorType"], outputs: ["nzMouseDown"], exportAs: ["nzResizeHandle"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
319
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Table, deps: [{ token: i0.ElementRef }, { token: i1$1.TableService }, { token: i1$1.SelectService }, { token: i1$1.ExpandService }, { token: i1$1.StatisticService }], target: i0.ɵɵFactoryTarget.Component });
320
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Table, isStandalone: true, selector: "axis-table", inputs: { pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageIndex: "pageIndexChange" }, providers: [DatePipe, DecimalPipe, PercentPipe, TableFieldDisplayService, TableService, SelectService, ExpandService, StatisticService], viewQueries: [{ propertyName: "tableSetter", first: true, predicate: TableSetter, descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (options.showTableTitleSet()) {\n<axis-table-setter [fields]=\"fields()\" [cacheKey]=\"options.tableSetCacheKey()\"\n (onChange)=\"fixFields.set($event)\"></axis-table-setter>\n}\n<nz-table #table [nzSize]=\"options.size()\" [nzData]=\"options.data()??[]\" [nzLoading]=\"!options.data()\"\n [nzBordered]=\"options.bordered()\" [nzOuterBordered]=\"options.outerBordered()\"\n [nzShowPagination]=\"options.showPagination()\"\n [nzFrontPagination]=\"options.showPagination() && !options.useBackEndPaging()\" [nzTotal]=\"rowtotal()\"\n [nzPageSize]=\"options.pageSize()\" [nzShowSizeChanger]=\"options.showSizeChanger()\"\n [nzPageSizeOptions]=\"tableSvc.pageSizeOptions()\" [nzShowTotal]=\"options.showDataSize()?totalRange:null\"\n [nzScroll]=\"scroll()\" (nzCurrentPageDataChange)=\"currentPageDataChange()\" (nzPageIndexChange)=\"onPageChange()\"\n (nzPageSizeChange)=\"onPageChange()\" [(nzPageIndex)]=\"pageIndex\" [nzVirtualItemSize]=\"options.virtualItemSize()\"\n [nzVirtualForTrackBy]=\"trackByKeyField\">\n <thead>\n <tr>\n @if (options.showCheckbox()) {\n @if (!options.checkboxLinkageForExpand() && !options.singleCheck()) {\n <th nzLeft [nzChecked]=\"select.headerChecked()!='none'\"\n [nzIndeterminate]=\"select.headerChecked()=='indeterminate'\"\n (nzCheckedChange)=\"select.onAllChecked($event)\" nzAlign=\"center\"\n [nzWidth]=\"tableSvc.leaderFieldWidth()-10+'px'\">\n </th>\n }@else {\n <th nzLeft [nzWidth]=\"tableSvc.leaderFieldWidth()-10+'px'\"></th>\n }\n }\n @if (options.showExpand()) {\n <th nzLeft nzAlign=\"center\" [nzWidth]=\"tableSvc.leaderFieldWidth()-15+'px'\"></th>\n }\n @if (options.showOrder()) {\n <th nzAlign=\"center\" [nzWidth]=\"tableSvc.leaderFieldWidth()+'px'\">\u5E8F\u53F7</th>\n }\n @for (f of tableSvc.displayFields(); track f.field()) {\n <th [attr.data-field]=\"f.field()\" nz-resizable nzBounds=\"window\"\n [nzDisabled]=\"!options.showTableTitleSet() || !f.width()\"\n [nzWidth]=\"f.width() == null ?null:f.width()+'px'\" (nzResize)=\"tableSetter?.onResize(f,$event)\"\n [nzShowSort]=\"f.sortAble()\" [nzSortFn]=\"tableSvc.fieldsControlsMap()[f.field()]?.sortFn\"\n [nzSortOrder]=\"f.sortOrder()\" [nzSortPriority]=\"f.sortPriority()??false\"\n [nzShowFilter]=\"f.filterAble() && !options.useBackEndPaging()\"\n [nzFilters]=\"tableSvc.fieldsControlsMap()[f.field()]?.filterItems ?? []\"\n [nzFilterFn]=\"tableSvc.fieldsControlsMap()[f.field()]?.filterFn\"\n (nzFilterChange)=\"tableSvc.filterChange(f.field(),$event)\" [nzFilterMultiple]=\"f.filterMultiple()\"\n [nzAlign]=\"f.align()\" [nzLeft]=\"f.freezeMode()=='left'\" [nzRight]=\"f.freezeMode()=='right'\"\n (nzSortOrderChange)=\"sortChange(f.field(),$event)\">\n <span>\n {{f.title()}}\n @if(options.showTableTitleSet()){\n <nz-resize-handle [style.transform]=\"`translateX(${resizeHandleOffsetX(f)}px)`\" nzDirection=\"right\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"resize-trigger\"></div>\n </nz-resize-handle>\n }\n </span>\n </th>\n }\n @if (rowActions().length)\n {\n <th nzRight nzAlign=\"center\" [nzWidth]=\"actionsFieldWidth()+'px'\" data-rowactions>\u64CD\u4F5C</th>\n }\n </tr>\n </thead>\n <tbody>\n @if (!options.showPagination() && options.virtualScroll()) {\n <ng-template nz-virtual-scroll let-data let-i=\"index\">\n </ng-template>\n }@else {\n @for (trow of table.data; track $index;let i=$index) {\n @for (data of expand.getListForExpanded(trow); track $index) {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:data}]\">\n @if (options.showCheckbox()) {\n <td nzLeft [nzChecked]=\"select.setOfCheckedId.has(data[options.keyField()])\"\n [nzIndeterminate]=\"select.setOfIndeterminateId.has(data[options.keyField()])\"\n [nzDisabled]=\"select.setOfDisabledId().has(data[options.keyField()])\"\n (nzCheckedChange)=\"select.onItemChecked(data, $event)\" nzAlign=\"center\"></td>\n }\n @if (options.showExpand()) {\n @if(options.expandMode() == \"tree\" && !expand.nodeMap().get(data[options.keyField()])?.children?.length){\n <td nzLeft></td>\n }@else{\n <td nzLeft [nzExpand]=\"expand.expandedSet.has(data[options.keyField()])\"\n (nzExpandChange)=\"expand.onExpandChange(data[options.keyField()],$event)\"></td>\n }\n }\n @if (options.showOrder()) {\n <td nzAlign=\"center\">{{(table.nzPageIndex-1) * table.nzPageSize + i+1}}</td>\n }\n @for (f of tableSvc.displayFields(); track f.field()) {\n @if (rowspan(f.field(),i)) {\n <td [attr.rowspan]=\"rowspan(f.field(),i)\" [nzLeft]=\"f.freezeMode()=='left'\" [attr.data-field]=\"f.field()\"\n [nzRight]=\"f.freezeMode()=='right'\" [nzAlign]=\"f.align()\">\n @if (f.child()) {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else {\n {{data[f.field()]}}\n }\n </td>\n }\n }\n @if (rowActions().length) {\n <td nzRight>\n <div nz-flex nzJustify=\"space-evenly\" data-rowactions>\n @for (a of rowActions(); track a.id) {\n <ng-container [axisDynamic]=\"a\"></ng-container>\n }\n </div>\n </td>\n }\n </tr>\n }\n @if (options.showExpand() && options.expandMode() == \"custom\") {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:trow}]\"\n [nzExpand]=\"expand.expandedSet.has(trow[options.keyField()])\" data-expandrow>\n <ng-container [axisDynamic]=\"options.expandRow()\"></ng-container>\n </tr>\n }\n }\n }\n </tbody>\n <tfoot nzSummary>\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\"\n [dataSources]=\"[{name:'row',type:'local',data:statistic.statisticMap()}]\">\n @if (options.showCheckbox()) {\n <td nzLeft></td>\n }\n @if (options.showExpand()) {\n <td nzLeft></td>\n }\n <td nzAlign=\"right\" [nzLeft]=\"!options.showOrder() && tableSvc.displayFields()[0].freezeMode() == 'left'\"\n [nzRight]=\"!options.showOrder()&& tableSvc.displayFields()[0].freezeMode() == 'right'\">\n <b>{{options.statisticTitle()}}</b>\n </td>\n @for (f of tableSvc.displayFields(); track f.field()) {\n <td [nzLeft]=\"f.freezeMode()=='left'\" [nzRight]=\"f.freezeMode()=='right'\" [nzAlign]=\"f.align()\">\n @if (f.statisticAble()) {\n <b>\n @if (f.child()) {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else {\n {{statistic.statisticMap()[f.field()]}}\n }\n </b>\n }\n </td>\n }\n @if (rowActions().length) {\n <td nzRight></td>\n }\n </tr>\n </tfoot>\n <ng-template #totalRange let-range=\"range\" let-total>\n \u5171{{ total }}\u6761\u6570\u636E\uFF0C\u7B2C{{ range[0] }}-{{ range[1] }}\u6761\n </ng-template>\n</nz-table>", styles: [":host{display:block;width:100%;overflow:hidden}:host ::ng-deep .ant-table-placeholder .ant-table-expanded-row-fixed{margin:-8px -10px}\n"], dependencies: [{ kind: "ngmodule", type: NzTableModule }, { kind: "component", type: i2$1.NzTableComponent, selector: "nz-table", inputs: ["nzTableLayout", "nzShowTotal", "nzItemRender", "nzTitle", "nzFooter", "nzNoResult", "nzPageSizeOptions", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualForTrackBy", "nzLoadingDelay", "nzPageIndex", "nzPageSize", "nzTotal", "nzWidthConfig", "nzData", "nzCustomColumn", "nzPaginationPosition", "nzScroll", "noDataVirtualHeight", "nzPaginationType", "nzFrontPagination", "nzTemplateMode", "nzShowPagination", "nzLoading", "nzOuterBordered", "nzLoadingIndicator", "nzBordered", "nzSize", "nzShowSizeChanger", "nzHideOnSinglePage", "nzShowQuickJumper", "nzSimple"], outputs: ["nzPageSizeChange", "nzPageIndexChange", "nzQueryParams", "nzCurrentPageDataChange", "nzCustomColumnChange"], exportAs: ["nzTable"] }, { kind: "component", type: i2$1.NzThAddOnComponent, selector: "th[nzColumnKey], th[nzSortFn], th[nzSortOrder], th[nzFilters], th[nzShowSort], th[nzShowFilter], th[nzCustomFilter]", inputs: ["nzColumnKey", "nzFilterMultiple", "nzSortOrder", "nzSortPriority", "nzSortDirections", "nzFilters", "nzSortFn", "nzFilterFn", "nzShowSort", "nzShowFilter", "nzCustomFilter"], outputs: ["nzCheckedChange", "nzSortOrderChange", "nzFilterChange"] }, { kind: "directive", type: i2$1.NzTableCellDirective, selector: "th:not(.nz-disable-th), td:not(.nz-disable-td)" }, { kind: "directive", type: i2$1.NzThMeasureDirective, selector: "th", inputs: ["nzWidth", "colspan", "colSpan", "rowspan", "rowSpan"] }, { kind: "component", type: i2$1.NzTdAddOnComponent, selector: "td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]", inputs: ["nzChecked", "nzDisabled", "nzIndeterminate", "nzLabel", "nzIndentSize", "nzShowExpand", "nzShowCheckbox", "nzExpand", "nzExpandIcon"], outputs: ["nzCheckedChange", "nzExpandChange"] }, { kind: "component", type: i2$1.NzTheadComponent, selector: "thead:not(.ant-table-thead)", outputs: ["nzSortOrderChange"] }, { kind: "component", type: i2$1.NzTbodyComponent, selector: "tbody" }, { kind: "directive", type: i2$1.NzTrDirective, selector: "tr:not([nz-table-measure-row]):not([nzExpand]):not([nz-table-fixed-row])" }, { kind: "directive", type: i2$1.NzTableVirtualScrollDirective, selector: "[nz-virtual-scroll]", exportAs: ["nzVirtualScroll"] }, { kind: "directive", type: i2$1.NzCellFixedDirective, selector: "td[nzRight],th[nzRight],td[nzLeft],th[nzLeft]", inputs: ["nzRight", "nzLeft", "colspan", "colSpan"] }, { kind: "directive", type: i2$1.NzTrExpandDirective, selector: "tr[nzExpand]", inputs: ["nzExpand"] }, { kind: "component", type: i2$1.NzTfootSummaryComponent, selector: "tfoot[nzSummary]", inputs: ["nzFixed"] }, { kind: "directive", type: i2$1.NzCellAlignDirective, selector: "th[nzAlign],td[nzAlign]", inputs: ["nzAlign"] }, { kind: "component", type: i2$1.NzTableFixedRowComponent, selector: "tr[nz-table-fixed-row], tr[nzExpand]" }, { kind: "component", type: i2$1.NzThSelectionComponent, selector: "th[nzSelections],th[nzChecked],th[nzShowCheckbox],th[nzShowRowSelection]", inputs: ["nzSelections", "nzChecked", "nzDisabled", "nzIndeterminate", "nzLabel", "nzShowCheckbox", "nzShowRowSelection"], outputs: ["nzCheckedChange"] }, { kind: "directive", type: ScopeDirective, selector: "[axisScope]", inputs: ["axisScope", "scopeName", "isRoot", "dataSources"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: TableSetter, selector: "axis-table-setter", inputs: ["fields", "cacheKey", "modalVisible"], outputs: ["onChange", "modalVisibleChange"] }, { kind: "ngmodule", type: NzResizableModule }, { kind: "directive", type: i3$1.NzResizableDirective, selector: "[nz-resizable]", inputs: ["nzBounds", "nzMaxHeight", "nzMaxWidth", "nzMinHeight", "nzMinWidth", "nzGridColumnCount", "nzMaxColumn", "nzMinColumn", "nzLockAspectRatio", "nzPreview", "nzDisabled"], outputs: ["nzResize", "nzResizeEnd", "nzResizeStart"], exportAs: ["nzResizable"] }, { kind: "component", type: i3$1.NzResizeHandleComponent, selector: "nz-resize-handle, [nz-resize-handle]", inputs: ["nzDirection", "nzCursorType"], outputs: ["nzMouseDown"], exportAs: ["nzResizeHandle"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i4$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
500
321
  }
501
322
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Table, decorators: [{
502
323
  type: Component,
503
- args: [{ selector: 'axis-table', imports: [NzTableModule, ScopeDirective, DynamicDirective, FormsModule, CommonModule, TableSetter, NzResizableModule, NzFlexModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (options.showTableTitleSet()) {\n<axis-table-setter [fields]=\"fields()\" [cacheKey]=\"options.tableSetCacheKey()\"\n (onChange)=\"fixFields.set($event)\"></axis-table-setter>\n}\n<nz-table #table [nzSize]=\"options.size()\" [nzData]=\"displayData()??[]\" [nzLoading]=\"!displayData()\"\n [nzBordered]=\"options.bordered()\" [nzOuterBordered]=\"options.outerBordered()\"\n [nzShowPagination]=\"options.showPagination()\"\n [nzFrontPagination]=\"options.showPagination() && !options.useBackEndPaging()\" [nzTotal]=\"rowtotal()\"\n [nzPageSize]=\"options.pageSize()\" [nzShowSizeChanger]=\"options.showSizeChanger()\"\n [nzPageSizeOptions]=\"pageSizeOptions()\" [nzShowTotal]=\"options.showDataSize()?totalRange:null\" [nzScroll]=\"scroll()\"\n (nzCurrentPageDataChange)=\"currentPageDataChange()\" (nzPageIndexChange)=\"onPageChange()\"\n (nzPageSizeChange)=\"onPageChange()\" [(nzPageIndex)]=\"pageIndex\" [nzVirtualItemSize]=\"options.virtualItemSize()\"\n [nzVirtualForTrackBy]=\"trackByKeyField\">\n <thead>\n <tr>\n @if (options.showCheckbox()) {\n @if (!options.checkboxLinkageForExpand() && !options.singleCheck()) {\n <th nzLeft [nzChecked]=\"select.headerChecked()!='none'\"\n [nzIndeterminate]=\"select.headerChecked()=='indeterminate'\"\n (nzCheckedChange)=\"select.onAllChecked($event)\" nzAlign=\"center\" [nzWidth]=\"leaderFieldWidth()-10+'px'\">\n </th>\n }@else {\n <th nzLeft [nzWidth]=\"leaderFieldWidth()-10+'px'\"></th>\n }\n }\n @if (options.showExpand()) {\n <th nzLeft nzAlign=\"center\" [nzWidth]=\"leaderFieldWidth()-15+'px'\"></th>\n }\n @if (options.showOrder()) {\n <th nzAlign=\"center\" [nzWidth]=\"leaderFieldWidth()+'px'\">\u5E8F\u53F7</th>\n }\n @for (f of displayFields(); track f.field()) {\n <th [attr.data-field]=\"f.field()\" nz-resizable nzBounds=\"window\"\n [nzDisabled]=\"!options.showTableTitleSet() || !f.width()\"\n [nzWidth]=\"f.width() == null ?null:f.width()+'px'\" (nzResize)=\"tableSetter?.onResize(f,$event)\"\n [nzShowSort]=\"f.sortAble()\" [nzSortFn]=\"fieldsControlsMap()[f.field()]?.sortFn\"\n [nzSortOrder]=\"f.sortOrder()\" [nzSortPriority]=\"f.sortPriority()??false\"\n [nzShowFilter]=\"f.filterAble() && !options.useBackEndPaging()\"\n [nzFilters]=\"fieldsControlsMap()[f.field()]?.filterItems ?? []\"\n [nzFilterFn]=\"fieldsControlsMap()[f.field()]?.filterFn\"\n (nzFilterChange)=\"filterChange(f.field(),$event)\" [nzFilterMultiple]=\"f.filterMultiple()\"\n [nzAlign]=\"f.align()\" [nzLeft]=\"f.freezeMode()=='left'\" [nzRight]=\"f.freezeMode()=='right'\"\n (nzSortOrderChange)=\"sortChange(f.field(),$event)\">\n <span>\n {{f.title()}}\n @if(options.showTableTitleSet()){\n <nz-resize-handle [style.transform]=\"`translateX(${resizeHandleOffsetX(f)}px)`\" nzDirection=\"right\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"resize-trigger\"></div>\n </nz-resize-handle>\n }\n </span>\n </th>\n }\n @if (rowActions().length)\n {\n <th nzRight nzAlign=\"center\" [nzWidth]=\"actionsFieldWidth()+'px'\" data-rowactions>\u64CD\u4F5C</th>\n }\n </tr>\n </thead>\n <tbody>\n @if (!options.showPagination() && options.virtualScroll()) {\n <ng-template nz-virtual-scroll let-data let-i=\"index\">\n </ng-template>\n }@else {\n @for (trow of table.data; track $index;let i=$index) {\n @for (data of expand.getListForExpanded(trow); track $index) {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:data}]\">\n @if (options.showCheckbox()) {\n <td nzLeft [nzChecked]=\"select.setOfCheckedId.has(data[options.keyField()])\"\n [nzIndeterminate]=\"select.setOfIndeterminateId.has(data[options.keyField()])\"\n [nzDisabled]=\"select.setOfDisabledId().has(data[options.keyField()])\"\n (nzCheckedChange)=\"select.onItemChecked(data, $event)\" nzAlign=\"center\"></td>\n }\n @if (options.showExpand()) {\n @if(options.expandMode() == \"tree\" && !expand.nodeMap().get(data[options.keyField()])?.children?.length){\n <td nzLeft></td>\n }@else{\n <td nzLeft [nzExpand]=\"expand.expandedSet.has(data[options.keyField()])\"\n (nzExpandChange)=\"expand.onExpandChange(data[options.keyField()],$event)\"></td>\n }\n }\n @if (options.showOrder()) {\n <td nzAlign=\"center\">{{(table.nzPageIndex-1) * table.nzPageSize + i+1}}</td>\n }\n @for (f of displayFields(); track f.field()) {\n @if (rowspan(f.field(),i)) {\n <td [attr.rowspan]=\"rowspan(f.field(),i)\" [nzLeft]=\"f.freezeMode()=='left'\" [attr.data-field]=\"f.field()\"\n [nzRight]=\"f.freezeMode()=='right'\" [nzAlign]=\"f.align()\">\n @if (f.child()) {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else {\n {{data[f.field()]}}\n }\n </td>\n }\n }\n @if (rowActions().length) {\n <td nzRight>\n <div nz-flex nzJustify=\"space-evenly\" data-rowactions>\n @for (a of rowActions(); track a.id) {\n <ng-container [axisDynamic]=\"a\"></ng-container>\n }\n </div>\n </td>\n }\n </tr>\n }\n @if (options.showExpand() && options.expandMode() == \"custom\") {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:trow}]\"\n [nzExpand]=\"expand.expandedSet.has(trow[options.keyField()])\" data-expandrow>\n <ng-container [axisDynamic]=\"options.expandRow()\"></ng-container>\n </tr>\n }\n <!-- @if (showSubTotal() && subTotalGroupField() && subTotalMap[i]) {\n <tr>\n @if (options.showCheckbox()) {\n <td nzLeft></td>\n }\n @if (options.showExpand()) {\n <td nzLeft></td>\n }\n @if (options.showOrder()) {\n <td></td>\n }\n @for (f of displayFields(); track f.field()) {\n @if (f.groupLevel && f.groupLevel! == subTotalGroupField.groupLevel!) {\n <td nzAlign=\"right\" [nzLeft]=\"f.freezeMode=='left'\" [nzRight]=\"f.freezeMode=='right'\">\n <b>{{options.subTotalTitle() || \"\u5C0F\u8BA1\"}}</b>\n </td>\n }\n @if(!f.groupLevel || f.groupLevel! > subTotalGroupField.groupLevel!) {\n <td [nzLeft]=\"f.freezeMode=='left'\" [nzRight]=\"f.freezeMode=='right'\">\n @if (f.totalAble) {\n <div [class]=\"'td-box-'+(f.align || 'center')\">\n <b>\n @if (f.child()) {\n @if (f.injectBy() == \"data\") {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else{\n <ng-container [axisDynamic]=\"f.child()\" [ngModel]=\"subTotalMap[i][f.field]\"></ng-container>\n }\n }@else {\n {{subTotalMap[i][f.field]}}\n }\n </b>\n </div>\n }\n </td>\n }\n }\n <td *ngIf=\"rowActions?.length\" nzRight></td>\n </tr>\n } -->\n }\n }\n <!-- @if (showTotal && displayData?.length) {\n <tr class=\"total-row\">\n @if (options.showCheckbox()) {\n <td nzLeft></td>\n }\n @if (options.showExpand()) {\n <td nzLeft></td>\n }\n <td nzAlign=\"right\" [nzLeft]=\"!options.showOrder() && displayFields[0].freezeMode=='left'\"\n [nzRight]=\"!options.showOrder() && displayFields[0].freezeMode=='right'\"><b>{{options.totalTitle() ||\n \"\u5408\u8BA1\"}}</b></td>\n @for (f of displayFields()|slice:(options.showOrder()?0:1); track f.field()) {\n <td [nzLeft]=\"f.freezeMode=='left'\" [nzRight]=\"f.freezeMode=='right'\">\n @if (f.totalAble()) {\n <div [class]=\"'td-box-'+(f.align || 'center')\">\n <b>\n @if (f.child()) {\n @if (f.injectBy() == \"data\") {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else{\n <ng-container [axisDynamic]=\"f.child()\" [ngModel]=\"totalMap[f.field]\"></ng-container>\n }\n }@else {\n {{totalMap[f.field]}}\n }\n </b>\n </div>\n }\n </td>\n }\n @if (rowActions()?.length) {\n <td nzRight></td>\n }\n </tr>\n } -->\n </tbody>\n <ng-template #totalRange let-range=\"range\" let-total>\n \u5171{{ total }}\u6761\u6570\u636E\uFF0C\u7B2C{{ range[0] }}-{{ range[1] }}\u6761\n </ng-template>\n</nz-table>", styles: [":host{display:block;width:100%;overflow:hidden}:host ::ng-deep .ant-table-placeholder .ant-table-expanded-row-fixed{margin:-8px -10px}\n"] }]
504
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { tableSetter: [{
324
+ args: [{ selector: 'axis-table', imports: [NzTableModule, ScopeDirective, DynamicDirective, FormsModule, TableSetter, NzResizableModule, NzFlexModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [DatePipe, DecimalPipe, PercentPipe, TableFieldDisplayService, TableService, SelectService, ExpandService, StatisticService], template: "@if (options.showTableTitleSet()) {\n<axis-table-setter [fields]=\"fields()\" [cacheKey]=\"options.tableSetCacheKey()\"\n (onChange)=\"fixFields.set($event)\"></axis-table-setter>\n}\n<nz-table #table [nzSize]=\"options.size()\" [nzData]=\"options.data()??[]\" [nzLoading]=\"!options.data()\"\n [nzBordered]=\"options.bordered()\" [nzOuterBordered]=\"options.outerBordered()\"\n [nzShowPagination]=\"options.showPagination()\"\n [nzFrontPagination]=\"options.showPagination() && !options.useBackEndPaging()\" [nzTotal]=\"rowtotal()\"\n [nzPageSize]=\"options.pageSize()\" [nzShowSizeChanger]=\"options.showSizeChanger()\"\n [nzPageSizeOptions]=\"tableSvc.pageSizeOptions()\" [nzShowTotal]=\"options.showDataSize()?totalRange:null\"\n [nzScroll]=\"scroll()\" (nzCurrentPageDataChange)=\"currentPageDataChange()\" (nzPageIndexChange)=\"onPageChange()\"\n (nzPageSizeChange)=\"onPageChange()\" [(nzPageIndex)]=\"pageIndex\" [nzVirtualItemSize]=\"options.virtualItemSize()\"\n [nzVirtualForTrackBy]=\"trackByKeyField\">\n <thead>\n <tr>\n @if (options.showCheckbox()) {\n @if (!options.checkboxLinkageForExpand() && !options.singleCheck()) {\n <th nzLeft [nzChecked]=\"select.headerChecked()!='none'\"\n [nzIndeterminate]=\"select.headerChecked()=='indeterminate'\"\n (nzCheckedChange)=\"select.onAllChecked($event)\" nzAlign=\"center\"\n [nzWidth]=\"tableSvc.leaderFieldWidth()-10+'px'\">\n </th>\n }@else {\n <th nzLeft [nzWidth]=\"tableSvc.leaderFieldWidth()-10+'px'\"></th>\n }\n }\n @if (options.showExpand()) {\n <th nzLeft nzAlign=\"center\" [nzWidth]=\"tableSvc.leaderFieldWidth()-15+'px'\"></th>\n }\n @if (options.showOrder()) {\n <th nzAlign=\"center\" [nzWidth]=\"tableSvc.leaderFieldWidth()+'px'\">\u5E8F\u53F7</th>\n }\n @for (f of tableSvc.displayFields(); track f.field()) {\n <th [attr.data-field]=\"f.field()\" nz-resizable nzBounds=\"window\"\n [nzDisabled]=\"!options.showTableTitleSet() || !f.width()\"\n [nzWidth]=\"f.width() == null ?null:f.width()+'px'\" (nzResize)=\"tableSetter?.onResize(f,$event)\"\n [nzShowSort]=\"f.sortAble()\" [nzSortFn]=\"tableSvc.fieldsControlsMap()[f.field()]?.sortFn\"\n [nzSortOrder]=\"f.sortOrder()\" [nzSortPriority]=\"f.sortPriority()??false\"\n [nzShowFilter]=\"f.filterAble() && !options.useBackEndPaging()\"\n [nzFilters]=\"tableSvc.fieldsControlsMap()[f.field()]?.filterItems ?? []\"\n [nzFilterFn]=\"tableSvc.fieldsControlsMap()[f.field()]?.filterFn\"\n (nzFilterChange)=\"tableSvc.filterChange(f.field(),$event)\" [nzFilterMultiple]=\"f.filterMultiple()\"\n [nzAlign]=\"f.align()\" [nzLeft]=\"f.freezeMode()=='left'\" [nzRight]=\"f.freezeMode()=='right'\"\n (nzSortOrderChange)=\"sortChange(f.field(),$event)\">\n <span>\n {{f.title()}}\n @if(options.showTableTitleSet()){\n <nz-resize-handle [style.transform]=\"`translateX(${resizeHandleOffsetX(f)}px)`\" nzDirection=\"right\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"resize-trigger\"></div>\n </nz-resize-handle>\n }\n </span>\n </th>\n }\n @if (rowActions().length)\n {\n <th nzRight nzAlign=\"center\" [nzWidth]=\"actionsFieldWidth()+'px'\" data-rowactions>\u64CD\u4F5C</th>\n }\n </tr>\n </thead>\n <tbody>\n @if (!options.showPagination() && options.virtualScroll()) {\n <ng-template nz-virtual-scroll let-data let-i=\"index\">\n </ng-template>\n }@else {\n @for (trow of table.data; track $index;let i=$index) {\n @for (data of expand.getListForExpanded(trow); track $index) {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:data}]\">\n @if (options.showCheckbox()) {\n <td nzLeft [nzChecked]=\"select.setOfCheckedId.has(data[options.keyField()])\"\n [nzIndeterminate]=\"select.setOfIndeterminateId.has(data[options.keyField()])\"\n [nzDisabled]=\"select.setOfDisabledId().has(data[options.keyField()])\"\n (nzCheckedChange)=\"select.onItemChecked(data, $event)\" nzAlign=\"center\"></td>\n }\n @if (options.showExpand()) {\n @if(options.expandMode() == \"tree\" && !expand.nodeMap().get(data[options.keyField()])?.children?.length){\n <td nzLeft></td>\n }@else{\n <td nzLeft [nzExpand]=\"expand.expandedSet.has(data[options.keyField()])\"\n (nzExpandChange)=\"expand.onExpandChange(data[options.keyField()],$event)\"></td>\n }\n }\n @if (options.showOrder()) {\n <td nzAlign=\"center\">{{(table.nzPageIndex-1) * table.nzPageSize + i+1}}</td>\n }\n @for (f of tableSvc.displayFields(); track f.field()) {\n @if (rowspan(f.field(),i)) {\n <td [attr.rowspan]=\"rowspan(f.field(),i)\" [nzLeft]=\"f.freezeMode()=='left'\" [attr.data-field]=\"f.field()\"\n [nzRight]=\"f.freezeMode()=='right'\" [nzAlign]=\"f.align()\">\n @if (f.child()) {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else {\n {{data[f.field()]}}\n }\n </td>\n }\n }\n @if (rowActions().length) {\n <td nzRight>\n <div nz-flex nzJustify=\"space-evenly\" data-rowactions>\n @for (a of rowActions(); track a.id) {\n <ng-container [axisDynamic]=\"a\"></ng-container>\n }\n </div>\n </td>\n }\n </tr>\n }\n @if (options.showExpand() && options.expandMode() == \"custom\") {\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\" [dataSources]=\"[{name:'row',type:'local',data:trow}]\"\n [nzExpand]=\"expand.expandedSet.has(trow[options.keyField()])\" data-expandrow>\n <ng-container [axisDynamic]=\"options.expandRow()\"></ng-container>\n </tr>\n }\n }\n }\n </tbody>\n <tfoot nzSummary>\n <tr [axisScope]=\"options.id+'.row'\" scopeName=\"\u8868\u683C\u884C\"\n [dataSources]=\"[{name:'row',type:'local',data:statistic.statisticMap()}]\">\n @if (options.showCheckbox()) {\n <td nzLeft></td>\n }\n @if (options.showExpand()) {\n <td nzLeft></td>\n }\n <td nzAlign=\"right\" [nzLeft]=\"!options.showOrder() && tableSvc.displayFields()[0].freezeMode() == 'left'\"\n [nzRight]=\"!options.showOrder()&& tableSvc.displayFields()[0].freezeMode() == 'right'\">\n <b>{{options.statisticTitle()}}</b>\n </td>\n @for (f of tableSvc.displayFields(); track f.field()) {\n <td [nzLeft]=\"f.freezeMode()=='left'\" [nzRight]=\"f.freezeMode()=='right'\" [nzAlign]=\"f.align()\">\n @if (f.statisticAble()) {\n <b>\n @if (f.child()) {\n <ng-container [axisDynamic]=\"f.child()\"></ng-container>\n }@else {\n {{statistic.statisticMap()[f.field()]}}\n }\n </b>\n }\n </td>\n }\n @if (rowActions().length) {\n <td nzRight></td>\n }\n </tr>\n </tfoot>\n <ng-template #totalRange let-range=\"range\" let-total>\n \u5171{{ total }}\u6761\u6570\u636E\uFF0C\u7B2C{{ range[0] }}-{{ range[1] }}\u6761\n </ng-template>\n</nz-table>", styles: [":host{display:block;width:100%;overflow:hidden}:host ::ng-deep .ant-table-placeholder .ant-table-expanded-row-fixed{margin:-8px -10px}\n"] }]
325
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.TableService }, { type: i1$1.SelectService }, { type: i1$1.ExpandService }, { type: i1$1.StatisticService }], propDecorators: { tableSetter: [{
505
326
  type: ViewChild,
506
327
  args: [TableSetter]
507
328
  }] } });