primeng 16.9.16-lts → 16.9.17-lts
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.
- package/esm2022/calendar/calendar.mjs +7 -6
- package/esm2022/contextmenu/contextmenu.mjs +5 -11
- package/esm2022/dock/dock.mjs +1 -5
- package/esm2022/megamenu/megamenu.mjs +13 -17
- package/esm2022/messages/messages.mjs +6 -6
- package/esm2022/multiselect/multiselect.mjs +2 -1
- package/esm2022/organizationchart/organizationchart.mjs +3 -3
- package/esm2022/sidebar/sidebar.mjs +2 -2
- package/esm2022/splitter/splitter.mjs +2 -2
- package/esm2022/table/table.mjs +33 -8
- package/esm2022/tree/tree.mjs +15 -3
- package/fesm2022/primeng-calendar.mjs +6 -5
- package/fesm2022/primeng-calendar.mjs.map +1 -1
- package/fesm2022/primeng-contextmenu.mjs +4 -10
- package/fesm2022/primeng-contextmenu.mjs.map +1 -1
- package/fesm2022/primeng-dock.mjs +0 -4
- package/fesm2022/primeng-dock.mjs.map +1 -1
- package/fesm2022/primeng-megamenu.mjs +12 -16
- package/fesm2022/primeng-megamenu.mjs.map +1 -1
- package/fesm2022/primeng-messages.mjs +5 -5
- package/fesm2022/primeng-messages.mjs.map +1 -1
- package/fesm2022/primeng-multiselect.mjs +1 -0
- package/fesm2022/primeng-multiselect.mjs.map +1 -1
- package/fesm2022/primeng-organizationchart.mjs +2 -2
- package/fesm2022/primeng-organizationchart.mjs.map +1 -1
- package/fesm2022/primeng-sidebar.mjs +1 -1
- package/fesm2022/primeng-sidebar.mjs.map +1 -1
- package/fesm2022/primeng-splitter.mjs +1 -1
- package/fesm2022/primeng-splitter.mjs.map +1 -1
- package/fesm2022/primeng-table.mjs +32 -7
- package/fesm2022/primeng-table.mjs.map +1 -1
- package/fesm2022/primeng-tree.mjs +14 -2
- package/fesm2022/primeng-tree.mjs.map +1 -1
- package/messages/messages.d.ts +2 -1
- package/package.json +127 -127
- package/table/table.d.ts +7 -1
- package/tree/tree.d.ts +1 -0
@@ -45,7 +45,9 @@ class TableService {
|
|
45
45
|
valueSource = new Subject();
|
46
46
|
totalRecordsSource = new Subject();
|
47
47
|
columnsSource = new Subject();
|
48
|
+
isHeaderCheckboxSelection = new Subject();
|
48
49
|
sortSource$ = this.sortSource.asObservable();
|
50
|
+
isHeaderCheckboxSelection$ = this.isHeaderCheckboxSelection.asObservable();
|
49
51
|
selectionSource$ = this.selectionSource.asObservable();
|
50
52
|
contextMenuSource$ = this.contextMenuSource.asObservable();
|
51
53
|
valueSource$ = this.valueSource.asObservable();
|
@@ -69,6 +71,9 @@ class TableService {
|
|
69
71
|
onColumnsChange(columns) {
|
70
72
|
this.columnsSource.next(columns);
|
71
73
|
}
|
74
|
+
onHeaderCheckboxSelection(value) {
|
75
|
+
this.isHeaderCheckboxSelection.next(value);
|
76
|
+
}
|
72
77
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: TableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
73
78
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: TableService });
|
74
79
|
}
|
@@ -2318,7 +2323,11 @@ class Table {
|
|
2318
2323
|
}
|
2319
2324
|
saveColumnWidths(state) {
|
2320
2325
|
let widths = [];
|
2321
|
-
let headers =
|
2326
|
+
let headers = [];
|
2327
|
+
const container = this.containerViewChild?.nativeElement;
|
2328
|
+
if (container) {
|
2329
|
+
headers = DomHandler.find(container, '.p-datatable-thead > tr > th');
|
2330
|
+
}
|
2322
2331
|
headers.forEach((header) => widths.push(DomHandler.getOuterWidth(header)));
|
2323
2332
|
state.columnWidths = widths.join(',');
|
2324
2333
|
if (this.columnResizeMode === 'expand') {
|
@@ -3224,7 +3233,7 @@ class TableBody {
|
|
3224
3233
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.0", type: TableBody, selector: "[pTableBody]", inputs: { columns: ["pTableBody", "columns"], template: ["pTableBodyTemplate", "template"], value: "value", frozen: "frozen", frozenRows: "frozenRows", scrollerOptions: "scrollerOptions" }, host: { classAttribute: "p-element" }, ngImport: i0, template: `
|
3225
3234
|
<ng-container *ngIf="!dt.expandedRowTemplate">
|
3226
3235
|
<ng-template ngFor let-rowData let-rowIndex="index" [ngForOf]="value" [ngForTrackBy]="dt.rowTrackBy">
|
3227
|
-
<ng-container *ngIf="dt.groupHeaderTemplate && !dt.virtualScroll && dt.rowGroupMode === 'subheader' && shouldRenderRowGroupHeader(value, rowData, rowIndex)" role="row">
|
3236
|
+
<ng-container *ngIf="dt.groupHeaderTemplate && !dt.virtualScroll && dt.rowGroupMode === 'subheader' && shouldRenderRowGroupHeader(value, rowData, getRowIndex(rowIndex))" role="row">
|
3228
3237
|
<ng-container
|
3229
3238
|
*ngTemplateOutlet="dt.groupHeaderTemplate; context: { $implicit: rowData, rowIndex: getRowIndex(rowIndex), columns: columns, editing: dt.editMode === 'row' && dt.isRowEditing(rowData), frozen: frozen }"
|
3230
3239
|
></ng-container>
|
@@ -3310,7 +3319,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImpor
|
|
3310
3319
|
template: `
|
3311
3320
|
<ng-container *ngIf="!dt.expandedRowTemplate">
|
3312
3321
|
<ng-template ngFor let-rowData let-rowIndex="index" [ngForOf]="value" [ngForTrackBy]="dt.rowTrackBy">
|
3313
|
-
<ng-container *ngIf="dt.groupHeaderTemplate && !dt.virtualScroll && dt.rowGroupMode === 'subheader' && shouldRenderRowGroupHeader(value, rowData, rowIndex)" role="row">
|
3322
|
+
<ng-container *ngIf="dt.groupHeaderTemplate && !dt.virtualScroll && dt.rowGroupMode === 'subheader' && shouldRenderRowGroupHeader(value, rowData, getRowIndex(rowIndex))" role="row">
|
3314
3323
|
<ng-container
|
3315
3324
|
*ngTemplateOutlet="dt.groupHeaderTemplate; context: { $implicit: rowData, rowIndex: getRowIndex(rowIndex), columns: columns, editing: dt.editMode === 'row' && dt.isRowEditing(rowData), frozen: frozen }"
|
3316
3325
|
></ng-container>
|
@@ -4277,8 +4286,11 @@ class EditableColumn {
|
|
4277
4286
|
this.el = el;
|
4278
4287
|
this.zone = zone;
|
4279
4288
|
}
|
4280
|
-
ngOnChanges(
|
4281
|
-
if (this.el.nativeElement
|
4289
|
+
ngOnChanges(changes) {
|
4290
|
+
if (changes.pEditableColumnDisabled?.currentValue === true && DomHandler.hasClass(this.el.nativeElement, 'p-cell-editing')) {
|
4291
|
+
this.closeEditingCell(false, new Event('cancel'));
|
4292
|
+
}
|
4293
|
+
else if (changes.data?.firstChange === false && this.el.nativeElement) {
|
4282
4294
|
this.dt.updateEditingCell(this.el.nativeElement, this.data, this.field, this.rowIndex);
|
4283
4295
|
}
|
4284
4296
|
}
|
@@ -4866,14 +4878,21 @@ class TableCheckbox {
|
|
4866
4878
|
checked;
|
4867
4879
|
focused;
|
4868
4880
|
subscription;
|
4881
|
+
tableHeaderCheckboxSubscription;
|
4882
|
+
isTableHeaderCheckboxSelection = false;
|
4869
4883
|
constructor(dt, tableService, cd) {
|
4870
4884
|
this.dt = dt;
|
4871
4885
|
this.tableService = tableService;
|
4872
4886
|
this.cd = cd;
|
4873
4887
|
this.subscription = this.dt.tableService.selectionSource$.subscribe(() => {
|
4874
|
-
|
4888
|
+
setTimeout(() => {
|
4889
|
+
this.checked = this.isTableHeaderCheckboxSelection ? this.dt.isSelected(this.value) && !this.disabled : this.dt.isSelected(this.value);
|
4890
|
+
this.cd.markForCheck();
|
4891
|
+
});
|
4875
4892
|
this.ariaLabel = this.ariaLabel || this.dt.config.translation.aria ? (this.checked ? this.dt.config.translation.aria.selectRow : this.dt.config.translation.aria.unselectRow) : undefined;
|
4876
|
-
|
4893
|
+
});
|
4894
|
+
this.tableHeaderCheckboxSubscription = this.dt.tableService.isHeaderCheckboxSelection$.subscribe((val) => {
|
4895
|
+
this.isTableHeaderCheckboxSelection = val;
|
4877
4896
|
});
|
4878
4897
|
}
|
4879
4898
|
ngOnInit() {
|
@@ -4885,6 +4904,7 @@ class TableCheckbox {
|
|
4885
4904
|
originalEvent: event,
|
4886
4905
|
rowIndex: this.index
|
4887
4906
|
}, this.value);
|
4907
|
+
this.tableService.onHeaderCheckboxSelection(false);
|
4888
4908
|
}
|
4889
4909
|
DomHandler.clearSelection();
|
4890
4910
|
}
|
@@ -4898,6 +4918,9 @@ class TableCheckbox {
|
|
4898
4918
|
if (this.subscription) {
|
4899
4919
|
this.subscription.unsubscribe();
|
4900
4920
|
}
|
4921
|
+
if (this.tableHeaderCheckboxSubscription) {
|
4922
|
+
this.tableHeaderCheckboxSubscription.unsubscribe();
|
4923
|
+
}
|
4901
4924
|
}
|
4902
4925
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: TableCheckbox, deps: [{ token: Table }, { token: TableService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
4903
4926
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.0", type: TableCheckbox, selector: "p-tableCheckbox", inputs: { disabled: "disabled", value: "value", index: "index", inputId: "inputId", name: "name", required: "required", ariaLabel: "ariaLabel" }, host: { classAttribute: "p-element" }, ngImport: i0, template: `
|
@@ -4990,6 +5013,7 @@ class TableHeaderCheckbox {
|
|
4990
5013
|
focused;
|
4991
5014
|
selectionChangeSubscription;
|
4992
5015
|
valueChangeSubscription;
|
5016
|
+
tableHeaderCheckboxSubscription;
|
4993
5017
|
constructor(dt, tableService, cd) {
|
4994
5018
|
this.dt = dt;
|
4995
5019
|
this.tableService = tableService;
|
@@ -5008,6 +5032,7 @@ class TableHeaderCheckbox {
|
|
5008
5032
|
onClick(event) {
|
5009
5033
|
if (!this.disabled) {
|
5010
5034
|
if (this.dt.value && this.dt.value.length > 0) {
|
5035
|
+
this.tableService.onHeaderCheckboxSelection(true);
|
5011
5036
|
this.dt.toggleRowsWithCheckbox(event, !this.checked);
|
5012
5037
|
}
|
5013
5038
|
}
|