primeng 15.4.10-lts → 15.4.12-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.
Files changed (48) hide show
  1. package/esm2020/api/licensemanager.mjs +2 -2
  2. package/esm2020/dialog/dialog.mjs +18 -15
  3. package/esm2020/fileupload/fileupload.mjs +3 -3
  4. package/esm2020/inputtextarea/inputtextarea.mjs +4 -1
  5. package/esm2020/multiselect/multiselect.mjs +3 -3
  6. package/esm2020/overlay/overlay.mjs +6 -4
  7. package/esm2020/password/password.mjs +3 -3
  8. package/esm2020/table/table.mjs +51 -33
  9. package/fesm2015/primeng-api.mjs +1 -1
  10. package/fesm2015/primeng-api.mjs.map +1 -1
  11. package/fesm2015/primeng-dialog.mjs +17 -14
  12. package/fesm2015/primeng-dialog.mjs.map +1 -1
  13. package/fesm2015/primeng-fileupload.mjs +2 -2
  14. package/fesm2015/primeng-fileupload.mjs.map +1 -1
  15. package/fesm2015/primeng-inputtextarea.mjs +3 -0
  16. package/fesm2015/primeng-inputtextarea.mjs.map +1 -1
  17. package/fesm2015/primeng-multiselect.mjs +2 -2
  18. package/fesm2015/primeng-multiselect.mjs.map +1 -1
  19. package/fesm2015/primeng-overlay.mjs +5 -3
  20. package/fesm2015/primeng-overlay.mjs.map +1 -1
  21. package/fesm2015/primeng-password.mjs +2 -2
  22. package/fesm2015/primeng-password.mjs.map +1 -1
  23. package/fesm2015/primeng-table.mjs +53 -32
  24. package/fesm2015/primeng-table.mjs.map +1 -1
  25. package/fesm2020/primeng-api.mjs +1 -1
  26. package/fesm2020/primeng-api.mjs.map +1 -1
  27. package/fesm2020/primeng-dialog.mjs +17 -14
  28. package/fesm2020/primeng-dialog.mjs.map +1 -1
  29. package/fesm2020/primeng-fileupload.mjs +2 -2
  30. package/fesm2020/primeng-fileupload.mjs.map +1 -1
  31. package/fesm2020/primeng-inputtextarea.mjs +3 -0
  32. package/fesm2020/primeng-inputtextarea.mjs.map +1 -1
  33. package/fesm2020/primeng-multiselect.mjs +2 -2
  34. package/fesm2020/primeng-multiselect.mjs.map +1 -1
  35. package/fesm2020/primeng-overlay.mjs +5 -3
  36. package/fesm2020/primeng-overlay.mjs.map +1 -1
  37. package/fesm2020/primeng-password.mjs +2 -2
  38. package/fesm2020/primeng-password.mjs.map +1 -1
  39. package/fesm2020/primeng-table.mjs +50 -32
  40. package/fesm2020/primeng-table.mjs.map +1 -1
  41. package/inputtextarea/inputtextarea.d.ts +3 -2
  42. package/overlay/overlay.d.ts +3 -2
  43. package/package.json +1 -1
  44. package/resources/components/multiselect/multiselect.css +8 -0
  45. package/resources/components/password/password.css +4 -0
  46. package/resources/primeng.css +4 -0
  47. package/resources/primeng.min.css +1 -1
  48. package/table/table.d.ts +6 -2
@@ -1372,23 +1372,26 @@ class Table {
1372
1372
  return this.selectionMode === 'multiple';
1373
1373
  }
1374
1374
  onColumnResizeBegin(event) {
1375
- let containerLeft = DomHandler.getOffset(this.containerViewChild.nativeElement).left;
1375
+ var _a, _b;
1376
+ let containerLeft = DomHandler.getOffset((_a = this.containerViewChild) === null || _a === void 0 ? void 0 : _a.nativeElement).left;
1376
1377
  this.resizeColumnElement = event.target.parentElement;
1377
1378
  this.columnResizing = true;
1378
- this.lastResizerHelperX = event.pageX - containerLeft + this.containerViewChild.nativeElement.scrollLeft;
1379
+ this.lastResizerHelperX = event.pageX - containerLeft + ((_b = this.containerViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement.scrollLeft);
1379
1380
  this.onColumnResize(event);
1380
1381
  event.preventDefault();
1381
1382
  }
1382
1383
  onColumnResize(event) {
1383
- let containerLeft = DomHandler.getOffset(this.containerViewChild.nativeElement).left;
1384
- DomHandler.addClass(this.containerViewChild.nativeElement, 'p-unselectable-text');
1385
- this.resizeHelperViewChild.nativeElement.style.height = this.containerViewChild.nativeElement.offsetHeight + 'px';
1384
+ var _a, _b, _c, _d;
1385
+ let containerLeft = DomHandler.getOffset((_a = this.containerViewChild) === null || _a === void 0 ? void 0 : _a.nativeElement).left;
1386
+ DomHandler.addClass((_b = this.containerViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement, 'p-unselectable-text');
1387
+ this.resizeHelperViewChild.nativeElement.style.height = ((_c = this.containerViewChild) === null || _c === void 0 ? void 0 : _c.nativeElement.offsetHeight) + 'px';
1386
1388
  this.resizeHelperViewChild.nativeElement.style.top = 0 + 'px';
1387
- this.resizeHelperViewChild.nativeElement.style.left = event.pageX - containerLeft + this.containerViewChild.nativeElement.scrollLeft + 'px';
1389
+ this.resizeHelperViewChild.nativeElement.style.left = event.pageX - containerLeft + ((_d = this.containerViewChild) === null || _d === void 0 ? void 0 : _d.nativeElement.scrollLeft) + 'px';
1388
1390
  this.resizeHelperViewChild.nativeElement.style.display = 'block';
1389
1391
  }
1390
1392
  onColumnResizeEnd() {
1391
- let delta = this.resizeHelperViewChild.nativeElement.offsetLeft - this.lastResizerHelperX;
1393
+ var _a, _b, _c;
1394
+ let delta = ((_a = this.resizeHelperViewChild) === null || _a === void 0 ? void 0 : _a.nativeElement.offsetLeft) - this.lastResizerHelperX;
1392
1395
  let columnWidth = this.resizeColumnElement.offsetWidth;
1393
1396
  let newColumnWidth = columnWidth + delta;
1394
1397
  let minWidth = this.resizeColumnElement.style.minWidth.replace(/[^\d.]/g, '') || 15;
@@ -1401,7 +1404,8 @@ class Table {
1401
1404
  }
1402
1405
  }
1403
1406
  else if (this.columnResizeMode === 'expand') {
1404
- let tableWidth = this.tableViewChild.nativeElement.offsetWidth + delta;
1407
+ this._initialColWidths = this._totalTableWidth();
1408
+ let tableWidth = ((_b = this.tableViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement.offsetWidth) + delta;
1405
1409
  this.setResizeTableWidth(tableWidth + 'px');
1406
1410
  this.resizeTableCells(newColumnWidth, null);
1407
1411
  }
@@ -1414,29 +1418,7 @@ class Table {
1414
1418
  }
1415
1419
  }
1416
1420
  this.resizeHelperViewChild.nativeElement.style.display = 'none';
1417
- DomHandler.removeClass(this.containerViewChild.nativeElement, 'p-unselectable-text');
1418
- }
1419
- resizeTableCells(newColumnWidth, nextColumnWidth) {
1420
- let colIndex = DomHandler.index(this.resizeColumnElement);
1421
- let widths = [];
1422
- const tableHead = DomHandler.findSingle(this.containerViewChild.nativeElement, '.p-datatable-thead');
1423
- let headers = DomHandler.find(tableHead, 'tr > th');
1424
- headers.forEach((header) => widths.push(DomHandler.getOuterWidth(header)));
1425
- this.destroyStyleElement();
1426
- this.createStyleElement();
1427
- let innerHTML = '';
1428
- widths.forEach((width, index) => {
1429
- let colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;
1430
- let style = `width: ${colWidth}px !important; max-width: ${colWidth}px !important;`;
1431
- innerHTML += `
1432
- #${this.id}-table > .p-datatable-thead > tr > th:nth-child(${index + 1}),
1433
- #${this.id}-table > .p-datatable-tbody > tr > td:nth-child(${index + 1}),
1434
- #${this.id}-table > .p-datatable-tfoot > tr > td:nth-child(${index + 1}) {
1435
- ${style}
1436
- }
1437
- `;
1438
- });
1439
- this.renderer.setProperty(this.styleElement, 'innerHTML', innerHTML);
1421
+ DomHandler.removeClass((_c = this.containerViewChild) === null || _c === void 0 ? void 0 : _c.nativeElement, 'p-unselectable-text');
1440
1422
  }
1441
1423
  onColumnDragStart(event, columnElement) {
1442
1424
  this.reorderIconWidth = DomHandler.getHiddenElementOuterWidth(this.reorderIndicatorUpViewChild.nativeElement);
@@ -1510,6 +1492,11 @@ class Table {
1510
1492
  });
1511
1493
  }
1512
1494
  }
1495
+ if (this.resizableColumns && this.resizeColumnElement && this.resizeColumnElement.isSameNode(this.draggedColumn)) {
1496
+ let width = this.columnResizeMode === 'expand' ? this._initialColWidths : this._totalTableWidth();
1497
+ ObjectUtils.reorderArray(width, dragIndex + 1, dropIndex + 1);
1498
+ this.updateStyleElement(width, dragIndex, null, null);
1499
+ }
1513
1500
  this.reorderIndicatorUpViewChild.nativeElement.style.display = 'none';
1514
1501
  this.reorderIndicatorDownViewChild.nativeElement.style.display = 'none';
1515
1502
  this.draggedColumn.draggable = false;
@@ -1517,6 +1504,35 @@ class Table {
1517
1504
  this.dropPosition = null;
1518
1505
  }
1519
1506
  }
1507
+ _totalTableWidth() {
1508
+ let widths = [];
1509
+ const tableHead = DomHandler.findSingle(this.containerViewChild.nativeElement, '.p-datatable-thead');
1510
+ let headers = DomHandler.find(tableHead, 'tr > th');
1511
+ headers.forEach((header) => widths.push(DomHandler.getOuterWidth(header)));
1512
+ return widths;
1513
+ }
1514
+ resizeTableCells(newColumnWidth, nextColumnWidth) {
1515
+ let colIndex = DomHandler.index(this.resizeColumnElement);
1516
+ let width = this.columnResizeMode === 'expand' ? this._initialColWidths : this._totalTableWidth();
1517
+ this.updateStyleElement(width, colIndex, newColumnWidth, nextColumnWidth);
1518
+ }
1519
+ updateStyleElement(width, colIndex, newColumnWidth, nextColumnWidth) {
1520
+ this.destroyStyleElement();
1521
+ this.createStyleElement();
1522
+ let innerHTML = '';
1523
+ width.forEach((width, index) => {
1524
+ let colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;
1525
+ let style = `width: ${colWidth}px !important; max-width: ${colWidth}px !important;`;
1526
+ innerHTML += `
1527
+ #${this.id}-table > .p-datatable-thead > tr > th:nth-child(${index + 1}),
1528
+ #${this.id}-table > .p-datatable-tbody > tr > td:nth-child(${index + 1}),
1529
+ #${this.id}-table > .p-datatable-tfoot > tr > td:nth-child(${index + 1}) {
1530
+ ${style}
1531
+ }
1532
+ `;
1533
+ });
1534
+ this.renderer.setProperty(this.styleElement, 'innerHTML', innerHTML);
1535
+ }
1520
1536
  onRowDragStart(event, index) {
1521
1537
  this.rowDragging = true;
1522
1538
  this.draggedRowIndex = index;
@@ -3480,6 +3496,11 @@ class EditableColumn {
3480
3496
  this.el = el;
3481
3497
  this.zone = zone;
3482
3498
  }
3499
+ ngOnChanges({ data }) {
3500
+ if (this.el.nativeElement && !data.firstChange) {
3501
+ this.dt.updateEditingCell(this.el.nativeElement, this.data, this.field, this.rowIndex);
3502
+ }
3503
+ }
3483
3504
  ngAfterViewInit() {
3484
3505
  if (this.isEnabled()) {
3485
3506
  DomHandler.addClass(this.el.nativeElement, 'p-editable-column');
@@ -3733,7 +3754,7 @@ class EditableColumn {
3733
3754
  }
3734
3755
  }
3735
3756
  EditableColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EditableColumn, deps: [{ token: Table }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
3736
- EditableColumn.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: EditableColumn, selector: "[pEditableColumn]", inputs: { data: ["pEditableColumn", "data"], field: ["pEditableColumnField", "field"], rowIndex: ["pEditableColumnRowIndex", "rowIndex"], pEditableColumnDisabled: "pEditableColumnDisabled", pFocusCellSelector: "pFocusCellSelector" }, host: { listeners: { "click": "onClick($event)", "keydown.enter": "onEnterKeyDown($event)", "keydown.tab": "onShiftKeyDown($event)", "keydown.escape": "onEscapeKeyDown($event)", "keydown.shift.tab": "onShiftKeyDown($event)", "keydown.meta.tab": "onShiftKeyDown($event)", "keydown.arrowdown": "onArrowDown($event)", "keydown.arrowup": "onArrowUp($event)", "keydown.arrowleft": "onArrowLeft($event)", "keydown.arrowright": "onArrowRight($event)" }, classAttribute: "p-element" }, ngImport: i0 });
3757
+ EditableColumn.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: EditableColumn, selector: "[pEditableColumn]", inputs: { data: ["pEditableColumn", "data"], field: ["pEditableColumnField", "field"], rowIndex: ["pEditableColumnRowIndex", "rowIndex"], pEditableColumnDisabled: "pEditableColumnDisabled", pFocusCellSelector: "pFocusCellSelector" }, host: { listeners: { "click": "onClick($event)", "keydown.enter": "onEnterKeyDown($event)", "keydown.tab": "onShiftKeyDown($event)", "keydown.escape": "onEscapeKeyDown($event)", "keydown.shift.tab": "onShiftKeyDown($event)", "keydown.meta.tab": "onShiftKeyDown($event)", "keydown.arrowdown": "onArrowDown($event)", "keydown.arrowup": "onArrowUp($event)", "keydown.arrowleft": "onArrowLeft($event)", "keydown.arrowright": "onArrowRight($event)" }, classAttribute: "p-element" }, usesOnChanges: true, ngImport: i0 });
3737
3758
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EditableColumn, decorators: [{
3738
3759
  type: Directive,
3739
3760
  args: [{