@ng-nest/ui 15.0.12 → 15.0.13

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.
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { EventEmitter, Component, Input, Output, Directive, Inject, ViewEncapsulation, ViewChild, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
3
  import { __decorate } from 'tslib';
4
4
  import * as i1 from '@ng-nest/ui/core';
5
- import { XWithConfig, XInputNumber, XInputBoolean, XProperty, XIsChange, removeNgTag, XIsEmpty, XIsFunction, XResize, stripTags, XIsUndefined } from '@ng-nest/ui/core';
5
+ import { XWithConfig, XInputNumber, XInputBoolean, XProperty, XIsChange, removeNgTag, XIsEmpty, XIsFunction, XResize, stripTags, XParentPath, XIsUndefined } from '@ng-nest/ui/core';
6
6
  import * as i3$1 from '@ng-nest/ui/pagination';
7
7
  import { XPaginationProperty, XPaginationModule } from '@ng-nest/ui/pagination';
8
8
  import { takeUntil } from 'rxjs/operators';
@@ -76,6 +76,11 @@ class XTableProperty extends XPaginationProperty {
76
76
  * @en_US head checkbox event
77
77
  */
78
78
  this.headCheckboxChange = new EventEmitter();
79
+ /**
80
+ * @zh_CN body checkbox 事件
81
+ * @en_US head checkbox event
82
+ */
83
+ this.bodyCheckboxChange = new EventEmitter();
79
84
  /**
80
85
  * @zh_CN 超出可视窗口缓冲区的最小值,对应 cdk scroll 中的参数
81
86
  * @en_US Exceed the minimum value of the visible window buffer, corresponding to the parameters in cdk scroll
@@ -149,7 +154,7 @@ class XTableProperty extends XPaginationProperty {
149
154
  }
150
155
  }
151
156
  /** @nocollapse */ XTableProperty.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTableProperty, deps: null, target: i0.ɵɵFactoryTarget.Component });
152
- /** @nocollapse */ XTableProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTableProperty, selector: "ng-component", inputs: { data: "data", columns: "columns", rowHeight: "rowHeight", loading: "loading", bordered: "bordered", showHeader: "showHeader", headerPosition: "headerPosition", activatedRow: "activatedRow", headColumnTpl: "headColumnTpl", bodyColumnTpl: "bodyColumnTpl", bodyTdTpl: "bodyTdTpl", rowClass: "rowClass", headSearchTpl: "headSearchTpl", allowSelectRow: "allowSelectRow", allowCheckRow: "allowCheckRow", virtualScroll: "virtualScroll", bodyHeight: "bodyHeight", itemSize: "itemSize", minBufferPx: "minBufferPx", maxBufferPx: "maxBufferPx", adaptionHeight: "adaptionHeight", docPercent: "docPercent", checkedRow: "checkedRow", manual: "manual", scroll: "scroll", header: "header", footer: "footer", cellConfig: "cellConfig", rowSize: "rowSize", paginationPosition: "paginationPosition", hiddenWrapBorder: "hiddenWrapBorder", hiddenPaginationBorder: "hiddenPaginationBorder", showPagination: "showPagination", treeTable: "treeTable", expandedAll: "expandedAll", expandedLevel: "expandedLevel", expanded: "expanded", expandTpl: "expandTpl" }, outputs: { activatedRowChange: "activatedRowChange", sortChange: "sortChange", headCheckboxChange: "headCheckboxChange", manualChange: "manualChange", columnDragStarted: "columnDragStarted", columnDragEnded: "columnDragEnded", columnDropListDropped: "columnDropListDropped", columnDragWidthStarted: "columnDragWidthStarted", columnDragWidthMoved: "columnDragWidthMoved", columnDragWidthEnded: "columnDragWidthEnded" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
157
+ /** @nocollapse */ XTableProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTableProperty, selector: "ng-component", inputs: { data: "data", columns: "columns", rowHeight: "rowHeight", loading: "loading", bordered: "bordered", showHeader: "showHeader", headerPosition: "headerPosition", activatedRow: "activatedRow", headColumnTpl: "headColumnTpl", bodyColumnTpl: "bodyColumnTpl", bodyTdTpl: "bodyTdTpl", rowClass: "rowClass", headSearchTpl: "headSearchTpl", allowSelectRow: "allowSelectRow", allowCheckRow: "allowCheckRow", virtualScroll: "virtualScroll", bodyHeight: "bodyHeight", itemSize: "itemSize", minBufferPx: "minBufferPx", maxBufferPx: "maxBufferPx", adaptionHeight: "adaptionHeight", docPercent: "docPercent", checkedRow: "checkedRow", manual: "manual", scroll: "scroll", header: "header", footer: "footer", cellConfig: "cellConfig", rowSize: "rowSize", paginationPosition: "paginationPosition", hiddenWrapBorder: "hiddenWrapBorder", hiddenPaginationBorder: "hiddenPaginationBorder", showPagination: "showPagination", treeTable: "treeTable", expandedAll: "expandedAll", expandedLevel: "expandedLevel", expanded: "expanded", expandTpl: "expandTpl" }, outputs: { activatedRowChange: "activatedRowChange", sortChange: "sortChange", headCheckboxChange: "headCheckboxChange", bodyCheckboxChange: "bodyCheckboxChange", manualChange: "manualChange", columnDragStarted: "columnDragStarted", columnDragEnded: "columnDragEnded", columnDropListDropped: "columnDropListDropped", columnDragWidthStarted: "columnDragWidthStarted", columnDragWidthMoved: "columnDragWidthMoved", columnDragWidthEnded: "columnDragWidthEnded" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
153
158
  __decorate([
154
159
  XWithConfig(X_CONFIG_NAME, 42),
155
160
  XInputNumber()
@@ -259,6 +264,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
259
264
  type: Output
260
265
  }], headCheckboxChange: [{
261
266
  type: Output
267
+ }], bodyCheckboxChange: [{
268
+ type: Output
262
269
  }], allowSelectRow: [{
263
270
  type: Input
264
271
  }], allowCheckRow: [{
@@ -958,9 +965,9 @@ class XTableBodyComponent extends XTableBodyProperty {
958
965
  return;
959
966
  this.activatedRow = row;
960
967
  if (this.table.allowCheckRow && this.table.rowChecked) {
961
- if (!Array.from(event.path).find((x) => x.localName == 'x-checkbox')) {
968
+ if (!XParentPath(event.target).includes('x-checkbox')) {
962
969
  row[this.table.rowChecked.id] = !row[this.table.rowChecked.id];
963
- this.table.bodyChecked(row[this.table.rowChecked.id], this.table.rowChecked);
970
+ this.table.bodyChecked(row[this.table.rowChecked.id], this.table.rowChecked, row);
964
971
  }
965
972
  }
966
973
  this.activatedRowChange.emit(row);
@@ -975,10 +982,10 @@ class XTableBodyComponent extends XTableBodyProperty {
975
982
  }
976
983
  }
977
984
  /** @nocollapse */ XTableBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTableBodyComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }, { token: i1.XConfigService }], target: i0.ɵɵFactoryTarget.Component });
978
- /** @nocollapse */ XTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTableBodyComponent, selector: "x-table-body", inputs: { table: "table" }, viewQueries: [{ propertyName: "tbody", first: true, predicate: ["tbody"], descendants: true }, { propertyName: "virtualBody", first: true, predicate: ["virtualBody"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<tbody #tbody>\r\n <ng-container *ngIf=\"cellConfig; else virtualScrollTpl\">\r\n <tr *ngFor=\"let row of data; index as i; trackBy: trackByItem\" [style.gridTemplateColumns]=\"cellConfig.gridTemplateColumns\">\r\n <td\r\n *ngFor=\"let column of cellConfig.cells; index as j\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [style.grid-area]=\"column.gridArea\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <x-empty *ngIf=\"isEmpty && level === 0\"></x-empty>\r\n</tbody>\r\n\r\n<ng-template #virtualScrollTpl>\r\n <cdk-virtual-scroll-viewport\r\n #virtualBody\r\n *ngIf=\"virtualScroll; else bodyTpl\"\r\n [itemSize]=\"getItemSize\"\r\n [minBufferPx]=\"minBufferPx\"\r\n [maxBufferPx]=\"maxBufferPx\"\r\n [style.height.px]=\"bodyHeight\"\r\n >\r\n <tr\r\n *cdkVirtualFor=\"let row of data; let index = index; trackBy: trackByItem\"\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <!-- rowHeight \u4E3A 0 \u7684\u65F6\u5019\uFF0Cindex \u4E0B\u6807\u83B7\u53D6\u4E0D\u5230 -->\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: getIndex(index, row) }\"></ng-container>\r\n </tr>\r\n </cdk-virtual-scroll-viewport>\r\n</ng-template>\r\n\r\n<ng-template #bodyTpl>\r\n <ng-container *ngFor=\"let row of data; index as i; trackBy: trackByItem\">\r\n <tr\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: i }\"></ng-container>\r\n </tr>\r\n <div class=\"x-table-children\" [class.x-table-expandTpl]=\"expandTpl\" *ngIf=\"table.treeTable && row.children && row.expanded\">\r\n <x-table-body\r\n [data]=\"row.children\"\r\n [columns]=\"table.columns\"\r\n [itemSize]=\"table.itemSize\"\r\n [rowHeight]=\"table.rowHeight\"\r\n [columnTpl]=\"table.bodyColumnTpl\"\r\n [allowSelectRow]=\"table.allowSelectRow\"\r\n [rowClass]=\"table.rowClass\"\r\n [cellConfig]=\"table.cellConfig?.tbody\"\r\n [(activatedRow)]=\"table.activatedRow\"\r\n [expandedAll]=\"expandedAll\"\r\n [expandTpl]=\"expandTpl\"\r\n (activatedRowChange)=\"table.activatedRowChange.emit($event)\"\r\n [level]=\"row.level! + 1\"\r\n [table]=\"table\"\r\n ></x-table-body>\r\n </div>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowTpl let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngIf=\"level > 0 && expandTpl\">\r\n <ng-container *xOutlet=\"expandTpl; context: { $row: row, $index: i, $level: level }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"level === 0 || !expandTpl\">\r\n <ng-container *xOutlet=\"rowDefault; context: { row: row, i: i, level: level }\"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowDefault let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngFor=\"let column of columns; index as j; trackBy: trackByItem\">\r\n <td\r\n [style.width.px]=\"column.width\"\r\n [style.flex]=\"getFlex(column)\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-dragging]=\"column.dragging\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [ngClass]=\"!rowClass ? {} : rowClass(row, i)\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-template>\r\n </td>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #cellTpl let-column=\"column\" let-row=\"row\" let-i=\"i\">\r\n <ng-container [ngSwitch]=\"column.type\">\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <x-checkbox\r\n [data]=\"[{ id: true, label: '' }]\"\r\n [(ngModel)]=\"row[column.id]\"\r\n [disabled]=\"row.disabled\"\r\n (ngModelChange)=\"table.bodyChecked($event, column)\"\r\n ></x-checkbox>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'index'\">\r\n <div>{{ table.getIndex(i) }}</div>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <ng-container *ngIf=\"table.isExpandColumn(column)\">\r\n <x-button\r\n [class.is-leaf]=\"!row.leaf\"\r\n [class.is-expanded]=\"row.expanded\"\r\n (click)=\"onExpanded($event, row)\"\r\n icon=\"fto-chevron-right\"\r\n size=\"mini\"\r\n onlyIcon\r\n class=\"x-table-expand\"\r\n [style.margin-left.rem]=\"row.level - 0.5\"\r\n ></x-button>\r\n </ng-container>\r\n <ng-container *xOutlet=\"columnTpl[column.id]; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <ng-container *xOutlet=\"table.bodyTdTpl; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <div [innerHTML]=\"row[column.id]\" [style.text-align]=\"column.textAlign\"></div>\r\n {{ table.rowExpandNext && table.rowExpandNext.id === column.id ? 'x-table-body-level-' + row.level : '' }}\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { kind: "component", type: i5.XCheckboxComponent, selector: "x-checkbox" }, { kind: "component", type: i6$1.XButtonComponent, selector: "x-button" }, { kind: "directive", type: i7$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i7$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i7$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: i8.XEmptyComponent, selector: "x-empty" }, { kind: "component", type: XTableBodyComponent, selector: "x-table-body", inputs: ["table"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
985
+ /** @nocollapse */ XTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", type: XTableBodyComponent, selector: "x-table-body", inputs: { table: "table" }, viewQueries: [{ propertyName: "tbody", first: true, predicate: ["tbody"], descendants: true }, { propertyName: "virtualBody", first: true, predicate: ["virtualBody"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<tbody #tbody>\r\n <ng-container *ngIf=\"cellConfig; else virtualScrollTpl\">\r\n <tr *ngFor=\"let row of data; index as i; trackBy: trackByItem\" [style.gridTemplateColumns]=\"cellConfig.gridTemplateColumns\">\r\n <td\r\n *ngFor=\"let column of cellConfig.cells; index as j\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [style.grid-area]=\"column.gridArea\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <x-empty *ngIf=\"isEmpty && level === 0\"></x-empty>\r\n</tbody>\r\n\r\n<ng-template #virtualScrollTpl>\r\n <cdk-virtual-scroll-viewport\r\n #virtualBody\r\n *ngIf=\"virtualScroll; else bodyTpl\"\r\n [itemSize]=\"getItemSize\"\r\n [minBufferPx]=\"minBufferPx\"\r\n [maxBufferPx]=\"maxBufferPx\"\r\n [style.height.px]=\"bodyHeight\"\r\n >\r\n <tr\r\n *cdkVirtualFor=\"let row of data; let index = index; trackBy: trackByItem\"\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <!-- rowHeight \u4E3A 0 \u7684\u65F6\u5019\uFF0Cindex \u4E0B\u6807\u83B7\u53D6\u4E0D\u5230 -->\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: getIndex(index, row) }\"></ng-container>\r\n </tr>\r\n </cdk-virtual-scroll-viewport>\r\n</ng-template>\r\n\r\n<ng-template #bodyTpl>\r\n <ng-container *ngFor=\"let row of data; index as i; trackBy: trackByItem\">\r\n <tr\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: i }\"></ng-container>\r\n </tr>\r\n <div class=\"x-table-children\" [class.x-table-expandTpl]=\"expandTpl\" *ngIf=\"table.treeTable && row.children && row.expanded\">\r\n <x-table-body\r\n [data]=\"row.children\"\r\n [columns]=\"table.columns\"\r\n [itemSize]=\"table.itemSize\"\r\n [rowHeight]=\"table.rowHeight\"\r\n [columnTpl]=\"table.bodyColumnTpl\"\r\n [allowSelectRow]=\"table.allowSelectRow\"\r\n [rowClass]=\"table.rowClass\"\r\n [cellConfig]=\"table.cellConfig?.tbody\"\r\n [(activatedRow)]=\"table.activatedRow\"\r\n [expandedAll]=\"expandedAll\"\r\n [expandTpl]=\"expandTpl\"\r\n (activatedRowChange)=\"table.activatedRowChange.emit($event)\"\r\n [level]=\"row.level! + 1\"\r\n [table]=\"table\"\r\n ></x-table-body>\r\n </div>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowTpl let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngIf=\"level > 0 && expandTpl\">\r\n <ng-container *xOutlet=\"expandTpl; context: { $row: row, $index: i, $level: level }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"level === 0 || !expandTpl\">\r\n <ng-container *xOutlet=\"rowDefault; context: { row: row, i: i, level: level }\"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowDefault let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngFor=\"let column of columns; index as j; trackBy: trackByItem\">\r\n <td\r\n [style.width.px]=\"column.width\"\r\n [style.flex]=\"getFlex(column)\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-dragging]=\"column.dragging\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [ngClass]=\"!rowClass ? {} : rowClass(row, i)\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-template>\r\n </td>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #cellTpl let-column=\"column\" let-row=\"row\" let-i=\"i\">\r\n <ng-container [ngSwitch]=\"column.type\">\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <x-checkbox\r\n [data]=\"[{ id: true, label: '' }]\"\r\n [(ngModel)]=\"row[column.id]\"\r\n [disabled]=\"row.disabled\"\r\n (ngModelChange)=\"table.bodyChecked($event, column, row)\"\r\n ></x-checkbox>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'index'\">\r\n <div>{{ table.getIndex(i) }}</div>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <ng-container *ngIf=\"table.isExpandColumn(column)\">\r\n <x-button\r\n [class.is-leaf]=\"!row.leaf\"\r\n [class.is-expanded]=\"row.expanded\"\r\n (click)=\"onExpanded($event, row)\"\r\n icon=\"fto-chevron-right\"\r\n size=\"mini\"\r\n onlyIcon\r\n class=\"x-table-expand\"\r\n [style.margin-left.rem]=\"row.level - 0.5\"\r\n ></x-button>\r\n </ng-container>\r\n <ng-container *xOutlet=\"columnTpl[column.id]; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <ng-container *xOutlet=\"table.bodyTdTpl; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <div [innerHTML]=\"row[column.id]\" [style.text-align]=\"column.textAlign\"></div>\r\n {{ table.rowExpandNext && table.rowExpandNext.id === column.id ? 'x-table-body-level-' + row.level : '' }}\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { kind: "component", type: i5.XCheckboxComponent, selector: "x-checkbox" }, { kind: "component", type: i6$1.XButtonComponent, selector: "x-button" }, { kind: "directive", type: i7$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i7$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i7$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: i8.XEmptyComponent, selector: "x-empty" }, { kind: "component", type: XTableBodyComponent, selector: "x-table-body", inputs: ["table"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
979
986
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: XTableBodyComponent, decorators: [{
980
987
  type: Component,
981
- args: [{ selector: `${XTableBodyPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<tbody #tbody>\r\n <ng-container *ngIf=\"cellConfig; else virtualScrollTpl\">\r\n <tr *ngFor=\"let row of data; index as i; trackBy: trackByItem\" [style.gridTemplateColumns]=\"cellConfig.gridTemplateColumns\">\r\n <td\r\n *ngFor=\"let column of cellConfig.cells; index as j\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [style.grid-area]=\"column.gridArea\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <x-empty *ngIf=\"isEmpty && level === 0\"></x-empty>\r\n</tbody>\r\n\r\n<ng-template #virtualScrollTpl>\r\n <cdk-virtual-scroll-viewport\r\n #virtualBody\r\n *ngIf=\"virtualScroll; else bodyTpl\"\r\n [itemSize]=\"getItemSize\"\r\n [minBufferPx]=\"minBufferPx\"\r\n [maxBufferPx]=\"maxBufferPx\"\r\n [style.height.px]=\"bodyHeight\"\r\n >\r\n <tr\r\n *cdkVirtualFor=\"let row of data; let index = index; trackBy: trackByItem\"\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <!-- rowHeight \u4E3A 0 \u7684\u65F6\u5019\uFF0Cindex \u4E0B\u6807\u83B7\u53D6\u4E0D\u5230 -->\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: getIndex(index, row) }\"></ng-container>\r\n </tr>\r\n </cdk-virtual-scroll-viewport>\r\n</ng-template>\r\n\r\n<ng-template #bodyTpl>\r\n <ng-container *ngFor=\"let row of data; index as i; trackBy: trackByItem\">\r\n <tr\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: i }\"></ng-container>\r\n </tr>\r\n <div class=\"x-table-children\" [class.x-table-expandTpl]=\"expandTpl\" *ngIf=\"table.treeTable && row.children && row.expanded\">\r\n <x-table-body\r\n [data]=\"row.children\"\r\n [columns]=\"table.columns\"\r\n [itemSize]=\"table.itemSize\"\r\n [rowHeight]=\"table.rowHeight\"\r\n [columnTpl]=\"table.bodyColumnTpl\"\r\n [allowSelectRow]=\"table.allowSelectRow\"\r\n [rowClass]=\"table.rowClass\"\r\n [cellConfig]=\"table.cellConfig?.tbody\"\r\n [(activatedRow)]=\"table.activatedRow\"\r\n [expandedAll]=\"expandedAll\"\r\n [expandTpl]=\"expandTpl\"\r\n (activatedRowChange)=\"table.activatedRowChange.emit($event)\"\r\n [level]=\"row.level! + 1\"\r\n [table]=\"table\"\r\n ></x-table-body>\r\n </div>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowTpl let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngIf=\"level > 0 && expandTpl\">\r\n <ng-container *xOutlet=\"expandTpl; context: { $row: row, $index: i, $level: level }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"level === 0 || !expandTpl\">\r\n <ng-container *xOutlet=\"rowDefault; context: { row: row, i: i, level: level }\"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowDefault let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngFor=\"let column of columns; index as j; trackBy: trackByItem\">\r\n <td\r\n [style.width.px]=\"column.width\"\r\n [style.flex]=\"getFlex(column)\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-dragging]=\"column.dragging\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [ngClass]=\"!rowClass ? {} : rowClass(row, i)\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-template>\r\n </td>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #cellTpl let-column=\"column\" let-row=\"row\" let-i=\"i\">\r\n <ng-container [ngSwitch]=\"column.type\">\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <x-checkbox\r\n [data]=\"[{ id: true, label: '' }]\"\r\n [(ngModel)]=\"row[column.id]\"\r\n [disabled]=\"row.disabled\"\r\n (ngModelChange)=\"table.bodyChecked($event, column)\"\r\n ></x-checkbox>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'index'\">\r\n <div>{{ table.getIndex(i) }}</div>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <ng-container *ngIf=\"table.isExpandColumn(column)\">\r\n <x-button\r\n [class.is-leaf]=\"!row.leaf\"\r\n [class.is-expanded]=\"row.expanded\"\r\n (click)=\"onExpanded($event, row)\"\r\n icon=\"fto-chevron-right\"\r\n size=\"mini\"\r\n onlyIcon\r\n class=\"x-table-expand\"\r\n [style.margin-left.rem]=\"row.level - 0.5\"\r\n ></x-button>\r\n </ng-container>\r\n <ng-container *xOutlet=\"columnTpl[column.id]; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <ng-container *xOutlet=\"table.bodyTdTpl; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <div [innerHTML]=\"row[column.id]\" [style.text-align]=\"column.textAlign\"></div>\r\n {{ table.rowExpandNext && table.rowExpandNext.id === column.id ? 'x-table-body-level-' + row.level : '' }}\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n" }]
988
+ args: [{ selector: `${XTableBodyPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<tbody #tbody>\r\n <ng-container *ngIf=\"cellConfig; else virtualScrollTpl\">\r\n <tr *ngFor=\"let row of data; index as i; trackBy: trackByItem\" [style.gridTemplateColumns]=\"cellConfig.gridTemplateColumns\">\r\n <td\r\n *ngFor=\"let column of cellConfig.cells; index as j\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [style.grid-area]=\"column.gridArea\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <x-empty *ngIf=\"isEmpty && level === 0\"></x-empty>\r\n</tbody>\r\n\r\n<ng-template #virtualScrollTpl>\r\n <cdk-virtual-scroll-viewport\r\n #virtualBody\r\n *ngIf=\"virtualScroll; else bodyTpl\"\r\n [itemSize]=\"getItemSize\"\r\n [minBufferPx]=\"minBufferPx\"\r\n [maxBufferPx]=\"maxBufferPx\"\r\n [style.height.px]=\"bodyHeight\"\r\n >\r\n <tr\r\n *cdkVirtualFor=\"let row of data; let index = index; trackBy: trackByItem\"\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <!-- rowHeight \u4E3A 0 \u7684\u65F6\u5019\uFF0Cindex \u4E0B\u6807\u83B7\u53D6\u4E0D\u5230 -->\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: getIndex(index, row) }\"></ng-container>\r\n </tr>\r\n </cdk-virtual-scroll-viewport>\r\n</ng-template>\r\n\r\n<ng-template #bodyTpl>\r\n <ng-container *ngFor=\"let row of data; index as i; trackBy: trackByItem\">\r\n <tr\r\n [class.x-table-activated]=\"allowSelectRow && activatedRow?.id === row.id\"\r\n [style.height.px]=\"getRowHeight\"\r\n [style.min-height.px]=\"getRowHeight\"\r\n (click)=\"rowClick($event, row)\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"rowTpl; context: { row: row, i: i }\"></ng-container>\r\n </tr>\r\n <div class=\"x-table-children\" [class.x-table-expandTpl]=\"expandTpl\" *ngIf=\"table.treeTable && row.children && row.expanded\">\r\n <x-table-body\r\n [data]=\"row.children\"\r\n [columns]=\"table.columns\"\r\n [itemSize]=\"table.itemSize\"\r\n [rowHeight]=\"table.rowHeight\"\r\n [columnTpl]=\"table.bodyColumnTpl\"\r\n [allowSelectRow]=\"table.allowSelectRow\"\r\n [rowClass]=\"table.rowClass\"\r\n [cellConfig]=\"table.cellConfig?.tbody\"\r\n [(activatedRow)]=\"table.activatedRow\"\r\n [expandedAll]=\"expandedAll\"\r\n [expandTpl]=\"expandTpl\"\r\n (activatedRowChange)=\"table.activatedRowChange.emit($event)\"\r\n [level]=\"row.level! + 1\"\r\n [table]=\"table\"\r\n ></x-table-body>\r\n </div>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowTpl let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngIf=\"level > 0 && expandTpl\">\r\n <ng-container *xOutlet=\"expandTpl; context: { $row: row, $index: i, $level: level }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"level === 0 || !expandTpl\">\r\n <ng-container *xOutlet=\"rowDefault; context: { row: row, i: i, level: level }\"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #rowDefault let-row=\"row\" let-i=\"i\">\r\n <ng-container *ngFor=\"let column of columns; index as j; trackBy: trackByItem\">\r\n <td\r\n [style.width.px]=\"column.width\"\r\n [style.flex]=\"getFlex(column)\"\r\n [title]=\"getTitle(row, column)\"\r\n [class.x-table-dragging]=\"column.dragging\"\r\n [class.x-table-sticky]=\"table.getStickyLeft(column) || table.getStickyRight(column)\"\r\n [class.x-table-sticky-left]=\"table.getStickyLeft(column)\"\r\n [class.x-table-sticky-right]=\"table.getStickyRight(column)\"\r\n [class.x-table-sticky-left-last]=\"table.getStickyLeftLast(column)\"\r\n [class.x-table-sticky-right-first]=\"table.getStickyRightFirst(column)\"\r\n [style.left.px]=\"column.left\"\r\n [style.right.px]=\"column.right\"\r\n [ngClass]=\"!rowClass ? {} : rowClass(row, i)\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"cellTpl; context: { column: column, row: row, i: i }\"></ng-template>\r\n </td>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #cellTpl let-column=\"column\" let-row=\"row\" let-i=\"i\">\r\n <ng-container [ngSwitch]=\"column.type\">\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <x-checkbox\r\n [data]=\"[{ id: true, label: '' }]\"\r\n [(ngModel)]=\"row[column.id]\"\r\n [disabled]=\"row.disabled\"\r\n (ngModelChange)=\"table.bodyChecked($event, column, row)\"\r\n ></x-checkbox>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'index'\">\r\n <div>{{ table.getIndex(i) }}</div>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <ng-container *ngIf=\"table.isExpandColumn(column)\">\r\n <x-button\r\n [class.is-leaf]=\"!row.leaf\"\r\n [class.is-expanded]=\"row.expanded\"\r\n (click)=\"onExpanded($event, row)\"\r\n icon=\"fto-chevron-right\"\r\n size=\"mini\"\r\n onlyIcon\r\n class=\"x-table-expand\"\r\n [style.margin-left.rem]=\"row.level - 0.5\"\r\n ></x-button>\r\n </ng-container>\r\n <ng-container *xOutlet=\"columnTpl[column.id]; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <ng-container *xOutlet=\"table.bodyTdTpl; context: { $column: column, $row: row, $index: table.getIndex(i) }\">\r\n <div [innerHTML]=\"row[column.id]\" [style.text-align]=\"column.textAlign\"></div>\r\n {{ table.rowExpandNext && table.rowExpandNext.id === column.id ? 'x-table-body-level-' + row.level : '' }}\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n" }]
982
989
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
983
990
  type: Inject,
984
991
  args: [DOCUMENT]
@@ -1322,11 +1329,12 @@ class XTableComponent extends XTableProperty {
1322
1329
  }
1323
1330
  });
1324
1331
  this.setCheckedValues(column);
1325
- this.headCheckboxChange.emit(this.checkedValues);
1332
+ this.headCheckboxChange.emit({ rows: this.tableData, checkbox: this.checkedValues });
1326
1333
  this.detectChanges();
1327
1334
  }
1328
- bodyChecked(_checked, column) {
1335
+ bodyChecked(_checked, column, row) {
1329
1336
  this.setCheckedValues(column);
1337
+ this.bodyCheckboxChange.emit(row);
1330
1338
  this.detectChanges();
1331
1339
  }
1332
1340
  setCheckedValues(column) {
@@ -1441,4 +1449,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
1441
1449
 
1442
1450
  export { XDragDirective, XTableBodyComponent, XTableBodyPrefix, XTableBodyProperty, XTableComponent, XTableFootComponent, XTableFootPrefix, XTableFootProperty, XTableHeadComponent, XTableHeadPrefix, XTableHeadProperty, XTableModule, XTablePrefix, XTableProperty };
1443
1451
  //# sourceMappingURL=ng-nest-ui-table.mjs.map
1444
- //# sourceMappingURL=ng-nest-ui-table.mjs.map