@anguless/angulux 22.6.7 → 22.6.9
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/README.md +12 -9
- package/fesm2022/anguless-angulux-autofocus.mjs +2 -2
- package/fesm2022/anguless-angulux-autofocus.mjs.map +1 -1
- package/fesm2022/anguless-angulux-dialog.mjs +2 -2
- package/fesm2022/anguless-angulux-dialog.mjs.map +1 -1
- package/fesm2022/anguless-angulux-dom.mjs +240 -155
- package/fesm2022/anguless-angulux-dom.mjs.map +1 -1
- package/fesm2022/anguless-angulux-multiselect.mjs +4 -4
- package/fesm2022/anguless-angulux-multiselect.mjs.map +1 -1
- package/fesm2022/anguless-angulux-overlay.mjs +5 -5
- package/fesm2022/anguless-angulux-overlay.mjs.map +1 -1
- package/fesm2022/anguless-angulux-password.mjs +2 -2
- package/fesm2022/anguless-angulux-password.mjs.map +1 -1
- package/fesm2022/anguless-angulux-table.mjs +116 -126
- package/fesm2022/anguless-angulux-table.mjs.map +1 -1
- package/fesm2022/anguless-angulux-treetable.mjs +5 -7
- package/fesm2022/anguless-angulux-treetable.mjs.map +1 -1
- package/fesm2022/anguless-angulux-utils.mjs +176 -120
- package/fesm2022/anguless-angulux-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/types/anguless-angulux-dom.d.ts +36 -2
- package/types/anguless-angulux-table.d.ts +21 -23
- package/types/anguless-angulux-treetable.d.ts +1 -1
- package/types/anguless-angulux-utils.d.ts +12 -2
|
@@ -20,12 +20,11 @@ import * as i8 from '@anguless/angulux/checkbox';
|
|
|
20
20
|
import { CheckboxModule } from '@anguless/angulux/checkbox';
|
|
21
21
|
import * as i13 from '@anguless/angulux/datepicker';
|
|
22
22
|
import { DatePickerModule } from '@anguless/angulux/datepicker';
|
|
23
|
-
import {
|
|
23
|
+
import { ɵclearSelection as _clearSelection, ɵfind as _find, ɵremoveClass as _removeClass, ɵgetOffset as _getOffset, ɵaddClass as _addClass, ɵfindSingle as _findSingle, ɵgetOuterWidth as _getOuterWidth, ɵgetHiddenElementOuterWidth as _getHiddenElementOuterWidth, ɵgetHiddenElementOuterHeight as _getHiddenElementOuterHeight, ɵindexWithinGroup as _indexWithinGroup, ɵindex as _index, ɵgetOuterHeight as _getOuterHeight, ɵsetAttribute as _setAttribute, ɵsiblings as _siblings, ɵgetAttribute as _getAttribute, ɵfocus as _focus, ɵinvokeElementMethod as _invokeElementMethod, ɵgetFocusableElements as _getFocusableElements, ɵgetFirstFocusableElement as _getFirstFocusableElement, ɵisTouchDevice as _isTouchDevice, ConnectedOverlayScrollHandler } from '@anguless/angulux/dom';
|
|
24
24
|
import { ArrowDownIcon } from '@anguless/angulux/icons/arrowdown';
|
|
25
25
|
import { ArrowUpIcon } from '@anguless/angulux/icons/arrowup';
|
|
26
26
|
import { FilterIcon } from '@anguless/angulux/icons/filter';
|
|
27
27
|
import { FilterFillIcon } from '@anguless/angulux/icons/filterfill';
|
|
28
|
-
import { FilterSlashIcon } from '@anguless/angulux/icons/filterslash';
|
|
29
28
|
import { PlusIcon } from '@anguless/angulux/icons/plus';
|
|
30
29
|
import { SortAltIcon } from '@anguless/angulux/icons/sortalt';
|
|
31
30
|
import { SortAmountDownIcon } from '@anguless/angulux/icons/sortamountdown';
|
|
@@ -46,8 +45,7 @@ import * as i4 from '@anguless/angulux/scroller';
|
|
|
46
45
|
import { ScrollerModule } from '@anguless/angulux/scroller';
|
|
47
46
|
import * as i9 from '@anguless/angulux/select';
|
|
48
47
|
import { SelectModule } from '@anguless/angulux/select';
|
|
49
|
-
import {
|
|
50
|
-
import { UniqueComponentId, ObjectUtils, ZIndexUtils } from '@anguless/angulux/utils';
|
|
48
|
+
import { UniqueComponentId, ɵresolveFieldData as _resolveFieldData, ɵcompare as _compare, ɵsort as _sort, ɵequals as _equals, ɵreorderArray as _reorderArray, ɵisNotEmpty as _isNotEmpty, ɵfindIndexInList as _findIndexInList, ZIndexUtils } from '@anguless/angulux/utils';
|
|
51
49
|
import { Subject } from 'rxjs';
|
|
52
50
|
|
|
53
51
|
/**
|
|
@@ -1506,11 +1504,11 @@ class Table extends BaseComponent {
|
|
|
1506
1504
|
this.selectionKeys = {};
|
|
1507
1505
|
if (Array.isArray(this._selection)) {
|
|
1508
1506
|
for (let data of this._selection) {
|
|
1509
|
-
this.selectionKeys[String(
|
|
1507
|
+
this.selectionKeys[String(_resolveFieldData(data, this.dataKey))] = 1;
|
|
1510
1508
|
}
|
|
1511
1509
|
}
|
|
1512
1510
|
else {
|
|
1513
|
-
this.selectionKeys[String(
|
|
1511
|
+
this.selectionKeys[String(_resolveFieldData(this._selection, this.dataKey))] = 1;
|
|
1514
1512
|
}
|
|
1515
1513
|
}
|
|
1516
1514
|
}
|
|
@@ -1618,8 +1616,8 @@ class Table extends BaseComponent {
|
|
|
1618
1616
|
}
|
|
1619
1617
|
else {
|
|
1620
1618
|
this.value.sort((data1, data2) => {
|
|
1621
|
-
let value1 =
|
|
1622
|
-
let value2 =
|
|
1619
|
+
let value1 = _resolveFieldData(data1, field);
|
|
1620
|
+
let value2 = _resolveFieldData(data2, field);
|
|
1623
1621
|
let result = null;
|
|
1624
1622
|
if (value1 == null && value2 != null)
|
|
1625
1623
|
result = -1;
|
|
@@ -1683,15 +1681,15 @@ class Table extends BaseComponent {
|
|
|
1683
1681
|
}
|
|
1684
1682
|
}
|
|
1685
1683
|
multisortField(data1, data2, multiSortMeta, index) {
|
|
1686
|
-
const value1 =
|
|
1687
|
-
const value2 =
|
|
1688
|
-
if (
|
|
1684
|
+
const value1 = _resolveFieldData(data1, multiSortMeta[index].field);
|
|
1685
|
+
const value2 = _resolveFieldData(data2, multiSortMeta[index].field);
|
|
1686
|
+
if (_compare(value1, value2, this.filterLocale) === 0) {
|
|
1689
1687
|
return multiSortMeta.length - 1 > index ? this.multisortField(data1, data2, multiSortMeta, index + 1) : 0;
|
|
1690
1688
|
}
|
|
1691
1689
|
return this.compareValuesOnSort(value1, value2, multiSortMeta[index].order);
|
|
1692
1690
|
}
|
|
1693
1691
|
compareValuesOnSort(value1, value2, order) {
|
|
1694
|
-
return
|
|
1692
|
+
return _sort(value1, value2, order, this.filterLocale, this.sortOrder);
|
|
1695
1693
|
}
|
|
1696
1694
|
getSortMeta(field) {
|
|
1697
1695
|
if (this.multiSortMeta && this.multiSortMeta.length) {
|
|
@@ -1732,7 +1730,7 @@ class Table extends BaseComponent {
|
|
|
1732
1730
|
let rowIndex = event.rowIndex;
|
|
1733
1731
|
this.preventSelectionSetterPropagation = true;
|
|
1734
1732
|
if (this.isMultipleSelectionMode() && event.originalEvent.shiftKey && this.anchorRowIndex != null) {
|
|
1735
|
-
|
|
1733
|
+
_clearSelection();
|
|
1736
1734
|
if (this.rangeRowIndex != null) {
|
|
1737
1735
|
this.clearSelectionRange(event.originalEvent);
|
|
1738
1736
|
}
|
|
@@ -1745,7 +1743,7 @@ class Table extends BaseComponent {
|
|
|
1745
1743
|
return;
|
|
1746
1744
|
}
|
|
1747
1745
|
let metaSelection = this.rowTouched ? false : this.metaKeySelection;
|
|
1748
|
-
let dataKeyValue = this.dataKey ? String(
|
|
1746
|
+
let dataKeyValue = this.dataKey ? String(_resolveFieldData(rowData, this.dataKey)) : null;
|
|
1749
1747
|
this.anchorRowIndex = rowIndex;
|
|
1750
1748
|
this.rangeRowIndex = rowIndex;
|
|
1751
1749
|
if (metaSelection) {
|
|
@@ -1896,7 +1894,7 @@ class Table extends BaseComponent {
|
|
|
1896
1894
|
else if (this.contextMenuSelectionMode === 'joint') {
|
|
1897
1895
|
this.preventSelectionSetterPropagation = true;
|
|
1898
1896
|
let selected = this.isSelected(rowData);
|
|
1899
|
-
let dataKeyValue = this.dataKey ? String(
|
|
1897
|
+
let dataKeyValue = this.dataKey ? String(_resolveFieldData(rowData, this.dataKey)) : null;
|
|
1900
1898
|
if (!selected) {
|
|
1901
1899
|
if (!this.isRowSelectable(rowData, rowIndex)) {
|
|
1902
1900
|
return;
|
|
@@ -1958,7 +1956,7 @@ class Table extends BaseComponent {
|
|
|
1958
1956
|
}
|
|
1959
1957
|
rangeRowsData.push(rangeRowData);
|
|
1960
1958
|
this._selection = [...this.selection, rangeRowData];
|
|
1961
|
-
let dataKeyValue = this.dataKey ? String(
|
|
1959
|
+
let dataKeyValue = this.dataKey ? String(_resolveFieldData(rangeRowData, this.dataKey)) : null;
|
|
1962
1960
|
if (dataKeyValue) {
|
|
1963
1961
|
this.selectionKeys[dataKeyValue] = 1;
|
|
1964
1962
|
}
|
|
@@ -1991,7 +1989,7 @@ class Table extends BaseComponent {
|
|
|
1991
1989
|
let rangeRowData = this.value[i];
|
|
1992
1990
|
let selectionIndex = this.findIndexInSelection(rangeRowData);
|
|
1993
1991
|
this._selection = this.selection.filter((val, i) => i != selectionIndex);
|
|
1994
|
-
let dataKeyValue = this.dataKey ? String(
|
|
1992
|
+
let dataKeyValue = this.dataKey ? String(_resolveFieldData(rangeRowData, this.dataKey)) : null;
|
|
1995
1993
|
if (dataKeyValue) {
|
|
1996
1994
|
delete this.selectionKeys[dataKeyValue];
|
|
1997
1995
|
}
|
|
@@ -2005,7 +2003,7 @@ class Table extends BaseComponent {
|
|
|
2005
2003
|
isSelected(rowData) {
|
|
2006
2004
|
if (rowData && this.selection) {
|
|
2007
2005
|
if (this.dataKey) {
|
|
2008
|
-
return this.selectionKeys[
|
|
2006
|
+
return this.selectionKeys[_resolveFieldData(rowData, this.dataKey)] !== undefined;
|
|
2009
2007
|
}
|
|
2010
2008
|
else {
|
|
2011
2009
|
if (Array.isArray(this.selection))
|
|
@@ -2050,7 +2048,7 @@ class Table extends BaseComponent {
|
|
|
2050
2048
|
});
|
|
2051
2049
|
if (this.dataKey) {
|
|
2052
2050
|
this.selectionKeys = {};
|
|
2053
|
-
this.selectionKeys[String(
|
|
2051
|
+
this.selectionKeys[String(_resolveFieldData(rowData, this.dataKey))] = 1;
|
|
2054
2052
|
}
|
|
2055
2053
|
}
|
|
2056
2054
|
else {
|
|
@@ -2071,7 +2069,7 @@ class Table extends BaseComponent {
|
|
|
2071
2069
|
toggleRowWithCheckbox(event, rowData) {
|
|
2072
2070
|
this.selection = this.selection || [];
|
|
2073
2071
|
let selected = this.isSelected(rowData);
|
|
2074
|
-
let dataKeyValue = this.dataKey ? String(
|
|
2072
|
+
let dataKeyValue = this.dataKey ? String(_resolveFieldData(rowData, this.dataKey)) : null;
|
|
2075
2073
|
this.preventSelectionSetterPropagation = true;
|
|
2076
2074
|
if (selected) {
|
|
2077
2075
|
let selectionIndex = this.findIndexInSelection(rowData);
|
|
@@ -2134,7 +2132,7 @@ class Table extends BaseComponent {
|
|
|
2134
2132
|
}
|
|
2135
2133
|
}
|
|
2136
2134
|
equals(data1, data2) {
|
|
2137
|
-
return this.compareSelectionBy === 'equals' ? data1 === data2 :
|
|
2135
|
+
return this.compareSelectionBy === 'equals' ? data1 === data2 : _equals(data1, data2, this.dataKey);
|
|
2138
2136
|
}
|
|
2139
2137
|
/* Legacy Filtering for custom elements */
|
|
2140
2138
|
filter(value, field, matchMode) {
|
|
@@ -2237,7 +2235,7 @@ class Table extends BaseComponent {
|
|
|
2237
2235
|
if (this.filters['global'] && !globalMatch && globalFilterFieldsArray) {
|
|
2238
2236
|
for (let j = 0; j < globalFilterFieldsArray.length; j++) {
|
|
2239
2237
|
let globalFilterField = globalFilterFieldsArray[j].field || globalFilterFieldsArray[j];
|
|
2240
|
-
globalMatch = this.filterService.filters[this.filters['global'].matchMode](
|
|
2238
|
+
globalMatch = this.filterService.filters[this.filters['global'].matchMode](_resolveFieldData(this.value[i], globalFilterField), this.filters['global'].value, this.filterLocale);
|
|
2241
2239
|
if (globalMatch) {
|
|
2242
2240
|
break;
|
|
2243
2241
|
}
|
|
@@ -2281,7 +2279,7 @@ class Table extends BaseComponent {
|
|
|
2281
2279
|
executeLocalFilter(field, rowData, filterMeta) {
|
|
2282
2280
|
let filterValue = filterMeta.value;
|
|
2283
2281
|
let filterMatchMode = filterMeta.matchMode || FilterMatchMode.STARTS_WITH;
|
|
2284
|
-
let dataFieldValue =
|
|
2282
|
+
let dataFieldValue = _resolveFieldData(rowData, field);
|
|
2285
2283
|
let filterConstraint = this.filterService.filters[filterMatchMode];
|
|
2286
2284
|
return filterConstraint(dataFieldValue, filterValue, this.filterLocale);
|
|
2287
2285
|
}
|
|
@@ -2388,7 +2386,7 @@ class Table extends BaseComponent {
|
|
|
2388
2386
|
const body = data
|
|
2389
2387
|
.map((record) => exportableColumns
|
|
2390
2388
|
.map((column) => {
|
|
2391
|
-
let cellData =
|
|
2389
|
+
let cellData = _resolveFieldData(record, column.field);
|
|
2392
2390
|
if (cellData != null && this.exportFunction) {
|
|
2393
2391
|
cellData = this.exportFunction({
|
|
2394
2392
|
data: cellData,
|
|
@@ -2473,13 +2471,13 @@ class Table extends BaseComponent {
|
|
|
2473
2471
|
this.bindDocumentEditListener();
|
|
2474
2472
|
}
|
|
2475
2473
|
isEditingCellValid() {
|
|
2476
|
-
return this.editingCell &&
|
|
2474
|
+
return this.editingCell && _find(this.editingCell, '.ng-invalid.ng-dirty').length === 0;
|
|
2477
2475
|
}
|
|
2478
2476
|
bindDocumentEditListener() {
|
|
2479
2477
|
if (!this.documentEditListener) {
|
|
2480
2478
|
this.documentEditListener = this.renderer.listen(this.document, 'click', (event) => {
|
|
2481
2479
|
if (this.editingCell && !this.selfClick && this.isEditingCellValid()) {
|
|
2482
|
-
!this.$unstyled() &&
|
|
2480
|
+
!this.$unstyled() && _removeClass(this.editingCell, 'p-cell-editing');
|
|
2483
2481
|
setAttribute(this.editingCell, 'data-p-cell-editing', 'false');
|
|
2484
2482
|
this.editingCell = null;
|
|
2485
2483
|
this.onEditComplete.emit({
|
|
@@ -2508,24 +2506,24 @@ class Table extends BaseComponent {
|
|
|
2508
2506
|
}
|
|
2509
2507
|
}
|
|
2510
2508
|
initRowEdit(rowData) {
|
|
2511
|
-
let dataKeyValue = String(
|
|
2509
|
+
let dataKeyValue = String(_resolveFieldData(rowData, this.dataKey));
|
|
2512
2510
|
this.editingRowKeys[dataKeyValue] = true;
|
|
2513
2511
|
}
|
|
2514
2512
|
saveRowEdit(rowData, rowElement) {
|
|
2515
|
-
if (
|
|
2516
|
-
let dataKeyValue = String(
|
|
2513
|
+
if (_find(rowElement, '.ng-invalid.ng-dirty').length === 0) {
|
|
2514
|
+
let dataKeyValue = String(_resolveFieldData(rowData, this.dataKey));
|
|
2517
2515
|
delete this.editingRowKeys[dataKeyValue];
|
|
2518
2516
|
}
|
|
2519
2517
|
}
|
|
2520
2518
|
cancelRowEdit(rowData) {
|
|
2521
|
-
let dataKeyValue = String(
|
|
2519
|
+
let dataKeyValue = String(_resolveFieldData(rowData, this.dataKey));
|
|
2522
2520
|
delete this.editingRowKeys[dataKeyValue];
|
|
2523
2521
|
}
|
|
2524
2522
|
toggleRow(rowData, event) {
|
|
2525
2523
|
if (!this.dataKey && !this.groupRowsBy) {
|
|
2526
2524
|
throw new Error('dataKey or groupRowsBy must be defined to use row expansion');
|
|
2527
2525
|
}
|
|
2528
|
-
let dataKeyValue = this.groupRowsBy ? String(
|
|
2526
|
+
let dataKeyValue = this.groupRowsBy ? String(_resolveFieldData(rowData, this.groupRowsBy)) : String(_resolveFieldData(rowData, this.dataKey));
|
|
2529
2527
|
if (this.expandedRowKeys[dataKeyValue] != null) {
|
|
2530
2528
|
delete this.expandedRowKeys[dataKeyValue];
|
|
2531
2529
|
this.onRowCollapse.emit({
|
|
@@ -2551,10 +2549,10 @@ class Table extends BaseComponent {
|
|
|
2551
2549
|
}
|
|
2552
2550
|
}
|
|
2553
2551
|
isRowExpanded(rowData) {
|
|
2554
|
-
return this.groupRowsBy ? this.expandedRowKeys[String(
|
|
2552
|
+
return this.groupRowsBy ? this.expandedRowKeys[String(_resolveFieldData(rowData, this.groupRowsBy))] === true : this.expandedRowKeys[String(_resolveFieldData(rowData, this.dataKey))] === true;
|
|
2555
2553
|
}
|
|
2556
2554
|
isRowEditing(rowData) {
|
|
2557
|
-
return this.editingRowKeys[String(
|
|
2555
|
+
return this.editingRowKeys[String(_resolveFieldData(rowData, this.dataKey))] === true;
|
|
2558
2556
|
}
|
|
2559
2557
|
isSingleSelectionMode() {
|
|
2560
2558
|
return this.selectionMode === 'single';
|
|
@@ -2563,7 +2561,7 @@ class Table extends BaseComponent {
|
|
|
2563
2561
|
return this.selectionMode === 'multiple';
|
|
2564
2562
|
}
|
|
2565
2563
|
onColumnResizeBegin(event) {
|
|
2566
|
-
let containerLeft =
|
|
2564
|
+
let containerLeft = _getOffset(this.el?.nativeElement).left;
|
|
2567
2565
|
this.resizeColumnElement = event.target.closest('th');
|
|
2568
2566
|
this.columnResizing = true;
|
|
2569
2567
|
if (event.type == 'touchstart') {
|
|
@@ -2576,8 +2574,8 @@ class Table extends BaseComponent {
|
|
|
2576
2574
|
event.preventDefault();
|
|
2577
2575
|
}
|
|
2578
2576
|
onColumnResize(event) {
|
|
2579
|
-
let containerLeft =
|
|
2580
|
-
!this.$unstyled() &&
|
|
2577
|
+
let containerLeft = _getOffset(this.el?.nativeElement).left;
|
|
2578
|
+
!this.$unstyled() && _addClass(this.el?.nativeElement, 'p-unselectable-text');
|
|
2581
2579
|
this.resizeHelperViewChild.nativeElement.style.height = this.el?.nativeElement.offsetHeight + 'px';
|
|
2582
2580
|
this.resizeHelperViewChild.nativeElement.style.top = 0 + 'px';
|
|
2583
2581
|
if (event.type == 'touchmove') {
|
|
@@ -2619,29 +2617,27 @@ class Table extends BaseComponent {
|
|
|
2619
2617
|
}
|
|
2620
2618
|
}
|
|
2621
2619
|
this.resizeHelperViewChild.nativeElement.style.display = 'none';
|
|
2622
|
-
|
|
2620
|
+
_removeClass(this.el?.nativeElement, 'p-unselectable-text');
|
|
2623
2621
|
}
|
|
2624
2622
|
_totalTableWidth() {
|
|
2625
2623
|
let widths = [];
|
|
2626
|
-
const tableHead =
|
|
2627
|
-
let headers =
|
|
2628
|
-
headers.forEach((header) => widths.push(
|
|
2624
|
+
const tableHead = _findSingle(this.el.nativeElement, '[data-pc-section="thead"]');
|
|
2625
|
+
let headers = _find(tableHead, 'tr > th');
|
|
2626
|
+
headers.forEach((header) => widths.push(_getOuterWidth(header)));
|
|
2629
2627
|
return widths;
|
|
2630
2628
|
}
|
|
2631
2629
|
onColumnDragStart(event, columnElement) {
|
|
2632
|
-
this.reorderIconWidth =
|
|
2633
|
-
this.reorderIconHeight =
|
|
2630
|
+
this.reorderIconWidth = _getHiddenElementOuterWidth(this.reorderIndicatorUpViewChild?.nativeElement);
|
|
2631
|
+
this.reorderIconHeight = _getHiddenElementOuterHeight(this.reorderIndicatorDownViewChild?.nativeElement);
|
|
2634
2632
|
this.draggedColumn = columnElement;
|
|
2635
2633
|
event.dataTransfer.setData('text', 'b'); // For firefox
|
|
2636
2634
|
}
|
|
2637
2635
|
onColumnDragEnter(event, dropHeader) {
|
|
2638
2636
|
if (this.reorderableColumns && this.draggedColumn && dropHeader) {
|
|
2639
2637
|
event.preventDefault();
|
|
2640
|
-
let containerOffset =
|
|
2641
|
-
let dropHeaderOffset =
|
|
2638
|
+
let containerOffset = _getOffset(this.el?.nativeElement);
|
|
2639
|
+
let dropHeaderOffset = _getOffset(dropHeader);
|
|
2642
2640
|
if (this.draggedColumn != dropHeader) {
|
|
2643
|
-
let dragIndex = DomHandler.indexWithinGroup(this.draggedColumn, 'preorderablecolumn');
|
|
2644
|
-
let dropIndex = DomHandler.indexWithinGroup(dropHeader, 'preorderablecolumn');
|
|
2645
2641
|
let targetLeft = dropHeaderOffset.left - containerOffset.left;
|
|
2646
2642
|
let targetTop = containerOffset.top - dropHeaderOffset.top;
|
|
2647
2643
|
let columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2;
|
|
@@ -2673,8 +2669,8 @@ class Table extends BaseComponent {
|
|
|
2673
2669
|
onColumnDrop(event, dropColumn) {
|
|
2674
2670
|
event.preventDefault();
|
|
2675
2671
|
if (this.draggedColumn) {
|
|
2676
|
-
let dragIndex =
|
|
2677
|
-
let dropIndex =
|
|
2672
|
+
let dragIndex = _indexWithinGroup(this.draggedColumn, 'preorderablecolumn');
|
|
2673
|
+
let dropIndex = _indexWithinGroup(dropColumn, 'preorderablecolumn');
|
|
2678
2674
|
let allowDrop = dragIndex != dropIndex;
|
|
2679
2675
|
if (allowDrop && ((dropIndex - dragIndex == 1 && this.dropPosition === -1) || (dragIndex - dropIndex == 1 && this.dropPosition === 1))) {
|
|
2680
2676
|
allowDrop = false;
|
|
@@ -2686,7 +2682,7 @@ class Table extends BaseComponent {
|
|
|
2686
2682
|
dropIndex = dropIndex - 1;
|
|
2687
2683
|
}
|
|
2688
2684
|
if (allowDrop) {
|
|
2689
|
-
|
|
2685
|
+
_reorderArray(this.columns, dragIndex, dropIndex);
|
|
2690
2686
|
this.onColReorder.emit({
|
|
2691
2687
|
dragIndex: dragIndex,
|
|
2692
2688
|
dropIndex: dropIndex,
|
|
@@ -2702,7 +2698,7 @@ class Table extends BaseComponent {
|
|
|
2702
2698
|
}
|
|
2703
2699
|
if (this.resizableColumns && this.resizeColumnElement) {
|
|
2704
2700
|
let width = this.columnResizeMode === 'expand' ? this._initialColWidths : this._totalTableWidth();
|
|
2705
|
-
|
|
2701
|
+
_reorderArray(width, dragIndex + 1, dropIndex + 1);
|
|
2706
2702
|
this.updateStyleElement(width, dragIndex, 0, 0);
|
|
2707
2703
|
}
|
|
2708
2704
|
this.reorderIndicatorUpViewChild.nativeElement.style.display = 'none';
|
|
@@ -2713,7 +2709,7 @@ class Table extends BaseComponent {
|
|
|
2713
2709
|
}
|
|
2714
2710
|
}
|
|
2715
2711
|
resizeTableCells(newColumnWidth, nextColumnWidth) {
|
|
2716
|
-
let colIndex =
|
|
2712
|
+
let colIndex = _index(this.resizeColumnElement);
|
|
2717
2713
|
let width = this.columnResizeMode === 'expand' ? this._initialColWidths : this._totalTableWidth();
|
|
2718
2714
|
this.updateStyleElement(width, colIndex, newColumnWidth, nextColumnWidth);
|
|
2719
2715
|
}
|
|
@@ -2741,35 +2737,35 @@ class Table extends BaseComponent {
|
|
|
2741
2737
|
}
|
|
2742
2738
|
onRowDragOver(event, index, rowElement) {
|
|
2743
2739
|
if (this.rowDragging && this.draggedRowIndex !== index) {
|
|
2744
|
-
let rowY =
|
|
2740
|
+
let rowY = _getOffset(rowElement).top;
|
|
2745
2741
|
let pageY = event.pageY;
|
|
2746
|
-
let rowMidY = rowY +
|
|
2742
|
+
let rowMidY = rowY + _getOuterHeight(rowElement) / 2;
|
|
2747
2743
|
let prevRowElement = rowElement.previousElementSibling;
|
|
2748
2744
|
if (pageY < rowMidY) {
|
|
2749
|
-
|
|
2745
|
+
_removeClass(rowElement, 'p-datatable-dragpoint-bottom');
|
|
2750
2746
|
this.droppedRowIndex = index;
|
|
2751
2747
|
if (prevRowElement && !this.$unstyled())
|
|
2752
|
-
|
|
2748
|
+
_addClass(prevRowElement, 'p-datatable-dragpoint-bottom');
|
|
2753
2749
|
else
|
|
2754
|
-
!this.$unstyled() &&
|
|
2750
|
+
!this.$unstyled() && _addClass(rowElement, 'p-datatable-dragpoint-top');
|
|
2755
2751
|
}
|
|
2756
2752
|
else {
|
|
2757
2753
|
if (prevRowElement && !this.$unstyled())
|
|
2758
|
-
|
|
2754
|
+
_removeClass(prevRowElement, 'p-datatable-dragpoint-bottom');
|
|
2759
2755
|
else
|
|
2760
|
-
!this.$unstyled() &&
|
|
2756
|
+
!this.$unstyled() && _addClass(rowElement, 'p-datatable-dragpoint-top');
|
|
2761
2757
|
this.droppedRowIndex = index + 1;
|
|
2762
|
-
!this.$unstyled() &&
|
|
2758
|
+
!this.$unstyled() && _addClass(rowElement, 'p-datatable-dragpoint-bottom');
|
|
2763
2759
|
}
|
|
2764
2760
|
}
|
|
2765
2761
|
}
|
|
2766
2762
|
onRowDragLeave(event, rowElement) {
|
|
2767
2763
|
let prevRowElement = rowElement.previousElementSibling;
|
|
2768
2764
|
if (prevRowElement) {
|
|
2769
|
-
!this.$unstyled() &&
|
|
2765
|
+
!this.$unstyled() && _removeClass(prevRowElement, 'p-datatable-dragpoint-bottom');
|
|
2770
2766
|
}
|
|
2771
|
-
!this.$unstyled() &&
|
|
2772
|
-
!this.$unstyled() &&
|
|
2767
|
+
!this.$unstyled() && _removeClass(rowElement, 'p-datatable-dragpoint-bottom');
|
|
2768
|
+
!this.$unstyled() && _removeClass(rowElement, 'p-datatable-dragpoint-top');
|
|
2773
2769
|
}
|
|
2774
2770
|
onRowDragEnd(event) {
|
|
2775
2771
|
this.rowDragging = false;
|
|
@@ -2779,7 +2775,7 @@ class Table extends BaseComponent {
|
|
|
2779
2775
|
onRowDrop(event, rowElement) {
|
|
2780
2776
|
if (this.droppedRowIndex != null) {
|
|
2781
2777
|
let dropIndex = this.draggedRowIndex > this.droppedRowIndex ? this.droppedRowIndex : this.droppedRowIndex === 0 ? 0 : this.droppedRowIndex - 1;
|
|
2782
|
-
|
|
2778
|
+
_reorderArray(this.value, this.draggedRowIndex, dropIndex);
|
|
2783
2779
|
if (this.virtualScroll) {
|
|
2784
2780
|
// TODO: Check
|
|
2785
2781
|
this._value = [...this._value];
|
|
@@ -2913,12 +2909,12 @@ class Table extends BaseComponent {
|
|
|
2913
2909
|
let headers = [];
|
|
2914
2910
|
const container = this.el?.nativeElement;
|
|
2915
2911
|
if (container) {
|
|
2916
|
-
headers =
|
|
2912
|
+
headers = _find(container, '[data-pc-section="thead"] > tr > th');
|
|
2917
2913
|
}
|
|
2918
|
-
headers.forEach((header) => widths.push(
|
|
2914
|
+
headers.forEach((header) => widths.push(_getOuterWidth(header)));
|
|
2919
2915
|
state.columnWidths = widths.join(',');
|
|
2920
2916
|
if (this.columnResizeMode === 'expand' && this.tableViewChild) {
|
|
2921
|
-
state.tableWidth =
|
|
2917
|
+
state.tableWidth = _getOuterWidth(this.tableViewChild.nativeElement);
|
|
2922
2918
|
}
|
|
2923
2919
|
}
|
|
2924
2920
|
setResizeTableWidth(width) {
|
|
@@ -2931,7 +2927,7 @@ class Table extends BaseComponent {
|
|
|
2931
2927
|
if (this.columnResizeMode === 'expand' && this.tableWidthState) {
|
|
2932
2928
|
this.setResizeTableWidth(this.tableWidthState + 'px');
|
|
2933
2929
|
}
|
|
2934
|
-
if (
|
|
2930
|
+
if (_isNotEmpty(widths)) {
|
|
2935
2931
|
this.createStyleElement();
|
|
2936
2932
|
let innerHTML = '';
|
|
2937
2933
|
widths.forEach((width, index) => {
|
|
@@ -2992,9 +2988,9 @@ class Table extends BaseComponent {
|
|
|
2992
2988
|
createStyleElement() {
|
|
2993
2989
|
this.styleElement = this.renderer.createElement('style');
|
|
2994
2990
|
this.styleElement.type = 'text/css';
|
|
2995
|
-
|
|
2991
|
+
_setAttribute(this.styleElement, 'nonce', this.config?.csp()?.nonce);
|
|
2996
2992
|
this.renderer.appendChild(this.document.head, this.styleElement);
|
|
2997
|
-
|
|
2993
|
+
_setAttribute(this.styleElement, 'nonce', this.config?.csp()?.nonce);
|
|
2998
2994
|
}
|
|
2999
2995
|
getGroupRowsMeta() {
|
|
3000
2996
|
return { field: this.groupRowsBy, order: this.groupRowsByOrder };
|
|
@@ -3004,7 +3000,7 @@ class Table extends BaseComponent {
|
|
|
3004
3000
|
if (!this.responsiveStyleElement) {
|
|
3005
3001
|
this.responsiveStyleElement = this.renderer.createElement('style');
|
|
3006
3002
|
this.responsiveStyleElement.type = 'text/css';
|
|
3007
|
-
|
|
3003
|
+
_setAttribute(this.responsiveStyleElement, 'nonce', this.config?.csp()?.nonce);
|
|
3008
3004
|
this.renderer.appendChild(this.document.head, this.responsiveStyleElement);
|
|
3009
3005
|
let innerHTML = `
|
|
3010
3006
|
@media screen and (max-width: ${this.breakpoint}) {
|
|
@@ -3036,7 +3032,7 @@ class Table extends BaseComponent {
|
|
|
3036
3032
|
}
|
|
3037
3033
|
`;
|
|
3038
3034
|
this.renderer.setProperty(this.responsiveStyleElement, 'innerHTML', innerHTML);
|
|
3039
|
-
|
|
3035
|
+
_setAttribute(this.responsiveStyleElement, 'nonce', this.config?.csp()?.nonce);
|
|
3040
3036
|
}
|
|
3041
3037
|
}
|
|
3042
3038
|
}
|
|
@@ -3854,10 +3850,10 @@ class TableBody extends BaseComponent {
|
|
|
3854
3850
|
});
|
|
3855
3851
|
}
|
|
3856
3852
|
shouldRenderRowGroupHeader(value, rowData, i) {
|
|
3857
|
-
let currentRowFieldData =
|
|
3853
|
+
let currentRowFieldData = _resolveFieldData(rowData, this.dataTable?.groupRowsBy || '');
|
|
3858
3854
|
let prevRowData = value[i - (this.dataTable?._first || 0) - 1];
|
|
3859
3855
|
if (prevRowData) {
|
|
3860
|
-
let previousRowFieldData =
|
|
3856
|
+
let previousRowFieldData = _resolveFieldData(prevRowData, this.dataTable?.groupRowsBy || '');
|
|
3861
3857
|
return currentRowFieldData !== previousRowFieldData;
|
|
3862
3858
|
}
|
|
3863
3859
|
else {
|
|
@@ -3865,10 +3861,10 @@ class TableBody extends BaseComponent {
|
|
|
3865
3861
|
}
|
|
3866
3862
|
}
|
|
3867
3863
|
shouldRenderRowGroupFooter(value, rowData, i) {
|
|
3868
|
-
let currentRowFieldData =
|
|
3864
|
+
let currentRowFieldData = _resolveFieldData(rowData, this.dataTable?.groupRowsBy || '');
|
|
3869
3865
|
let nextRowData = value[i - (this.dataTable?._first || 0) + 1];
|
|
3870
3866
|
if (nextRowData) {
|
|
3871
|
-
let nextRowFieldData =
|
|
3867
|
+
let nextRowFieldData = _resolveFieldData(nextRowData, this.dataTable?.groupRowsBy || '');
|
|
3872
3868
|
return currentRowFieldData !== nextRowFieldData;
|
|
3873
3869
|
}
|
|
3874
3870
|
else {
|
|
@@ -3876,10 +3872,10 @@ class TableBody extends BaseComponent {
|
|
|
3876
3872
|
}
|
|
3877
3873
|
}
|
|
3878
3874
|
shouldRenderRowspan(value, rowData, i) {
|
|
3879
|
-
let currentRowFieldData =
|
|
3875
|
+
let currentRowFieldData = _resolveFieldData(rowData, this.dataTable?.groupRowsBy);
|
|
3880
3876
|
let prevRowData = value[i - 1];
|
|
3881
3877
|
if (prevRowData) {
|
|
3882
|
-
let previousRowFieldData =
|
|
3878
|
+
let previousRowFieldData = _resolveFieldData(prevRowData, this.dataTable?.groupRowsBy || '');
|
|
3883
3879
|
return currentRowFieldData !== previousRowFieldData;
|
|
3884
3880
|
}
|
|
3885
3881
|
else {
|
|
@@ -3887,14 +3883,14 @@ class TableBody extends BaseComponent {
|
|
|
3887
3883
|
}
|
|
3888
3884
|
}
|
|
3889
3885
|
calculateRowGroupSize(value, rowData, index) {
|
|
3890
|
-
let currentRowFieldData =
|
|
3886
|
+
let currentRowFieldData = _resolveFieldData(rowData, this.dataTable?.groupRowsBy);
|
|
3891
3887
|
let nextRowFieldData = currentRowFieldData;
|
|
3892
3888
|
let groupRowSpan = 0;
|
|
3893
3889
|
while (currentRowFieldData === nextRowFieldData) {
|
|
3894
3890
|
groupRowSpan++;
|
|
3895
3891
|
let nextRowData = value[++index];
|
|
3896
3892
|
if (nextRowData) {
|
|
3897
|
-
nextRowFieldData =
|
|
3893
|
+
nextRowFieldData = _resolveFieldData(nextRowData, this.dataTable?.groupRowsBy || '');
|
|
3898
3894
|
}
|
|
3899
3895
|
else {
|
|
3900
3896
|
break;
|
|
@@ -3908,11 +3904,11 @@ class TableBody extends BaseComponent {
|
|
|
3908
3904
|
}
|
|
3909
3905
|
}
|
|
3910
3906
|
updateFrozenRowStickyPosition() {
|
|
3911
|
-
this.el.nativeElement.style.top =
|
|
3907
|
+
this.el.nativeElement.style.top = _getOuterHeight(this.el.nativeElement.previousElementSibling) + 'px';
|
|
3912
3908
|
}
|
|
3913
3909
|
updateFrozenRowGroupHeaderStickyPosition() {
|
|
3914
3910
|
if (this.el.nativeElement.previousElementSibling) {
|
|
3915
|
-
let tableHeaderHeight =
|
|
3911
|
+
let tableHeaderHeight = _getOuterHeight(this.el.nativeElement.previousElementSibling);
|
|
3916
3912
|
this.dataTable.rowGroupHeaderStyleObject.top = tableHeaderHeight + 'px';
|
|
3917
3913
|
}
|
|
3918
3914
|
}
|
|
@@ -4384,8 +4380,8 @@ class FrozenColumn extends BaseComponent {
|
|
|
4384
4380
|
}
|
|
4385
4381
|
}
|
|
4386
4382
|
recalculateColumns() {
|
|
4387
|
-
const siblings =
|
|
4388
|
-
const index =
|
|
4383
|
+
const siblings = _siblings(this.el.nativeElement);
|
|
4384
|
+
const index = _index(this.el.nativeElement);
|
|
4389
4385
|
const time = (siblings.length - index + 1) * 50;
|
|
4390
4386
|
setTimeout(() => {
|
|
4391
4387
|
this.updateStickyPosition();
|
|
@@ -4398,7 +4394,7 @@ class FrozenColumn extends BaseComponent {
|
|
|
4398
4394
|
let right = 0;
|
|
4399
4395
|
let sibling = this.el.nativeElement.nextElementSibling;
|
|
4400
4396
|
while (sibling) {
|
|
4401
|
-
right +=
|
|
4397
|
+
right += _getOuterWidth(sibling);
|
|
4402
4398
|
sibling = sibling.nextElementSibling;
|
|
4403
4399
|
}
|
|
4404
4400
|
this.el.nativeElement.style.right = right + 'px';
|
|
@@ -4407,14 +4403,14 @@ class FrozenColumn extends BaseComponent {
|
|
|
4407
4403
|
let left = 0;
|
|
4408
4404
|
let sibling = this.el.nativeElement.previousElementSibling;
|
|
4409
4405
|
while (sibling) {
|
|
4410
|
-
left +=
|
|
4406
|
+
left += _getOuterWidth(sibling);
|
|
4411
4407
|
sibling = sibling.previousElementSibling;
|
|
4412
4408
|
}
|
|
4413
4409
|
this.el.nativeElement.style.left = left + 'px';
|
|
4414
4410
|
}
|
|
4415
4411
|
const filterRow = this.el.nativeElement?.parentElement?.nextElementSibling;
|
|
4416
4412
|
if (filterRow) {
|
|
4417
|
-
let index =
|
|
4413
|
+
let index = _index(this.el.nativeElement);
|
|
4418
4414
|
if (filterRow.children && filterRow.children[index]) {
|
|
4419
4415
|
filterRow.children[index].style.left = this.el.nativeElement.style.left;
|
|
4420
4416
|
filterRow.children[index].style.right = this.el.nativeElement.style.right;
|
|
@@ -4491,7 +4487,7 @@ class SortableColumn extends BaseComponent {
|
|
|
4491
4487
|
originalEvent: event,
|
|
4492
4488
|
field: this.field
|
|
4493
4489
|
});
|
|
4494
|
-
|
|
4490
|
+
_clearSelection();
|
|
4495
4491
|
}
|
|
4496
4492
|
}
|
|
4497
4493
|
onEnterKey(event) {
|
|
@@ -4747,7 +4743,7 @@ class SelectableRow extends BaseComponent {
|
|
|
4747
4743
|
lastRow && this.focusRowChange(this.el.nativeElement, lastRow);
|
|
4748
4744
|
if (event.ctrlKey && event.shiftKey) {
|
|
4749
4745
|
const data = this.dataTable.dataToRender(this.dataTable.rows);
|
|
4750
|
-
const lastSelectableRowIndex =
|
|
4746
|
+
const lastSelectableRowIndex = _getAttribute(lastRow, 'index');
|
|
4751
4747
|
this.dataTable.anchorRowIndex = lastSelectableRowIndex;
|
|
4752
4748
|
this.dataTable.selection = data.slice(this.index || 0, data.length);
|
|
4753
4749
|
this.dataTable.selectRange(event, this.index || 0);
|
|
@@ -4759,7 +4755,7 @@ class SelectableRow extends BaseComponent {
|
|
|
4759
4755
|
firstRow && this.focusRowChange(this.el.nativeElement, firstRow);
|
|
4760
4756
|
if (event.ctrlKey && event.shiftKey) {
|
|
4761
4757
|
const data = this.dataTable.dataToRender(this.dataTable.rows);
|
|
4762
|
-
const firstSelectableRowIndex =
|
|
4758
|
+
const firstSelectableRowIndex = _getAttribute(firstRow, 'index');
|
|
4763
4759
|
this.dataTable.anchorRowIndex = this.dataTable.anchorRowIndex || firstSelectableRowIndex || 0;
|
|
4764
4760
|
this.dataTable.selection = data.slice(0, (this.index || 0) + 1);
|
|
4765
4761
|
this.dataTable.selectRange(event, this.index || 0);
|
|
@@ -4776,14 +4772,14 @@ class SelectableRow extends BaseComponent {
|
|
|
4776
4772
|
if (event.shiftKey && this.dataTable.selection !== null) {
|
|
4777
4773
|
const data = this.dataTable.dataToRender(this.dataTable.rows);
|
|
4778
4774
|
let index;
|
|
4779
|
-
if (
|
|
4775
|
+
if (_isNotEmpty(this.dataTable.selection) && this.dataTable.selection.length > 0) {
|
|
4780
4776
|
let firstSelectedRowIndex, lastSelectedRowIndex;
|
|
4781
|
-
firstSelectedRowIndex =
|
|
4782
|
-
lastSelectedRowIndex =
|
|
4777
|
+
firstSelectedRowIndex = _findIndexInList(this.dataTable.selection[0], data);
|
|
4778
|
+
lastSelectedRowIndex = _findIndexInList(this.dataTable.selection[this.dataTable.selection.length - 1], data);
|
|
4783
4779
|
index = (this.index || 0) <= firstSelectedRowIndex ? lastSelectedRowIndex : firstSelectedRowIndex;
|
|
4784
4780
|
}
|
|
4785
4781
|
else {
|
|
4786
|
-
index =
|
|
4782
|
+
index = _findIndexInList(this.dataTable.selection, data);
|
|
4787
4783
|
}
|
|
4788
4784
|
this.dataTable.anchorRowIndex = index || 0;
|
|
4789
4785
|
this.dataTable.selection = index !== this.index ? data.slice(Math.min(index || 0, this.index || 0), Math.max(index || 0, this.index || 0) + 1) : [this.data];
|
|
@@ -4795,14 +4791,14 @@ class SelectableRow extends BaseComponent {
|
|
|
4795
4791
|
focusRowChange(firstFocusableRow, currentFocusedRow) {
|
|
4796
4792
|
firstFocusableRow.tabIndex = '-1';
|
|
4797
4793
|
currentFocusedRow.tabIndex = '0';
|
|
4798
|
-
|
|
4794
|
+
_focus(currentFocusedRow);
|
|
4799
4795
|
}
|
|
4800
4796
|
findLastSelectableRow() {
|
|
4801
|
-
const rows =
|
|
4797
|
+
const rows = _find(this.dataTable.el.nativeElement, '[data-p-selectable-row="true"]');
|
|
4802
4798
|
return rows ? rows[rows.length - 1] : null;
|
|
4803
4799
|
}
|
|
4804
4800
|
findFirstSelectableRow() {
|
|
4805
|
-
const firstRow =
|
|
4801
|
+
const firstRow = _findSingle(this.dataTable.el.nativeElement, '[data-p-selectable-row="true"]');
|
|
4806
4802
|
return firstRow;
|
|
4807
4803
|
}
|
|
4808
4804
|
findNextSelectableRow(row) {
|
|
@@ -5270,7 +5266,7 @@ class EditableColumn extends BaseComponent {
|
|
|
5270
5266
|
}
|
|
5271
5267
|
onAfterViewInit() {
|
|
5272
5268
|
if (this.isEnabled()) {
|
|
5273
|
-
!this.$unstyled() &&
|
|
5269
|
+
!this.$unstyled() && _addClass(this.el.nativeElement, 'p-editable-column');
|
|
5274
5270
|
}
|
|
5275
5271
|
}
|
|
5276
5272
|
onClick(event) {
|
|
@@ -5292,7 +5288,7 @@ class EditableColumn extends BaseComponent {
|
|
|
5292
5288
|
}
|
|
5293
5289
|
openCell() {
|
|
5294
5290
|
this.dataTable.updateEditingCell(this.el.nativeElement, this.data, this.field, this.rowIndex);
|
|
5295
|
-
!this.$unstyled() &&
|
|
5291
|
+
!this.$unstyled() && _addClass(this.el.nativeElement, 'p-cell-editing');
|
|
5296
5292
|
setAttribute(this.el.nativeElement, 'data-p-cell-editing', 'true');
|
|
5297
5293
|
this.dataTable.onEditInit.emit({
|
|
5298
5294
|
field: this.field,
|
|
@@ -5302,7 +5298,7 @@ class EditableColumn extends BaseComponent {
|
|
|
5302
5298
|
this.zone.runOutsideAngular(() => {
|
|
5303
5299
|
setTimeout(() => {
|
|
5304
5300
|
let focusCellSelector = this.aglFocusCellSelector || 'input, textarea, select';
|
|
5305
|
-
let focusableElement =
|
|
5301
|
+
let focusableElement = _findSingle(this.el.nativeElement, focusCellSelector);
|
|
5306
5302
|
if (focusableElement) {
|
|
5307
5303
|
focusableElement.focus();
|
|
5308
5304
|
}
|
|
@@ -5333,7 +5329,7 @@ class EditableColumn extends BaseComponent {
|
|
|
5333
5329
|
}
|
|
5334
5330
|
});
|
|
5335
5331
|
}
|
|
5336
|
-
!this.$unstyled() &&
|
|
5332
|
+
!this.$unstyled() && _removeClass(this.dataTable.editingCell, 'p-cell-editing');
|
|
5337
5333
|
setAttribute(this.el.nativeElement, 'data-p-cell-editing', 'false');
|
|
5338
5334
|
this.dataTable.editingCell = null;
|
|
5339
5335
|
this.dataTable.editingCellData = null;
|
|
@@ -5380,14 +5376,14 @@ class EditableColumn extends BaseComponent {
|
|
|
5380
5376
|
if (this.isEnabled()) {
|
|
5381
5377
|
let currentCell = this.findCell(event.target);
|
|
5382
5378
|
if (currentCell) {
|
|
5383
|
-
let cellIndex =
|
|
5379
|
+
let cellIndex = _index(currentCell);
|
|
5384
5380
|
let targetCell = this.findNextEditableColumnByIndex(currentCell, cellIndex);
|
|
5385
5381
|
if (targetCell) {
|
|
5386
5382
|
if (this.dataTable.isEditingCellValid()) {
|
|
5387
5383
|
this.closeEditingCell(true, event);
|
|
5388
5384
|
}
|
|
5389
|
-
|
|
5390
|
-
|
|
5385
|
+
_invokeElementMethod(event.target, 'blur');
|
|
5386
|
+
_invokeElementMethod(targetCell, 'click');
|
|
5391
5387
|
}
|
|
5392
5388
|
event.preventDefault();
|
|
5393
5389
|
}
|
|
@@ -5397,14 +5393,14 @@ class EditableColumn extends BaseComponent {
|
|
|
5397
5393
|
if (this.isEnabled()) {
|
|
5398
5394
|
let currentCell = this.findCell(event.target);
|
|
5399
5395
|
if (currentCell) {
|
|
5400
|
-
let cellIndex =
|
|
5396
|
+
let cellIndex = _index(currentCell);
|
|
5401
5397
|
let targetCell = this.findPrevEditableColumnByIndex(currentCell, cellIndex);
|
|
5402
5398
|
if (targetCell) {
|
|
5403
5399
|
if (this.dataTable.isEditingCellValid()) {
|
|
5404
5400
|
this.closeEditingCell(true, event);
|
|
5405
5401
|
}
|
|
5406
|
-
|
|
5407
|
-
|
|
5402
|
+
_invokeElementMethod(event.target, 'blur');
|
|
5403
|
+
_invokeElementMethod(targetCell, 'click');
|
|
5408
5404
|
}
|
|
5409
5405
|
event.preventDefault();
|
|
5410
5406
|
}
|
|
@@ -5440,8 +5436,8 @@ class EditableColumn extends BaseComponent {
|
|
|
5440
5436
|
if (this.dataTable.isEditingCellValid()) {
|
|
5441
5437
|
this.closeEditingCell(true, event);
|
|
5442
5438
|
}
|
|
5443
|
-
|
|
5444
|
-
|
|
5439
|
+
_invokeElementMethod(event.target, 'blur');
|
|
5440
|
+
_invokeElementMethod(targetCell, 'click');
|
|
5445
5441
|
event.preventDefault();
|
|
5446
5442
|
}
|
|
5447
5443
|
}
|
|
@@ -5454,8 +5450,8 @@ class EditableColumn extends BaseComponent {
|
|
|
5454
5450
|
if (this.dataTable.isEditingCellValid()) {
|
|
5455
5451
|
this.closeEditingCell(true, event);
|
|
5456
5452
|
}
|
|
5457
|
-
|
|
5458
|
-
|
|
5453
|
+
_invokeElementMethod(event.target, 'blur');
|
|
5454
|
+
_invokeElementMethod(targetCell, 'click');
|
|
5459
5455
|
event.preventDefault();
|
|
5460
5456
|
}
|
|
5461
5457
|
else {
|
|
@@ -5786,7 +5782,7 @@ class TableRadioButton extends BaseComponent {
|
|
|
5786
5782
|
}, this.value);
|
|
5787
5783
|
this.inputViewChild?.inputViewChild.nativeElement?.focus();
|
|
5788
5784
|
}
|
|
5789
|
-
|
|
5785
|
+
_clearSelection();
|
|
5790
5786
|
}
|
|
5791
5787
|
onDestroy() {
|
|
5792
5788
|
if (this.subscription) {
|
|
@@ -5847,7 +5843,7 @@ class TableCheckbox extends BaseComponent {
|
|
|
5847
5843
|
rowIndex: this.index() || 0
|
|
5848
5844
|
}, this.value);
|
|
5849
5845
|
}
|
|
5850
|
-
|
|
5846
|
+
_clearSelection();
|
|
5851
5847
|
}
|
|
5852
5848
|
onDestroy() {
|
|
5853
5849
|
if (this.subscription) {
|
|
@@ -5925,7 +5921,7 @@ class TableHeaderCheckbox extends BaseComponent {
|
|
|
5925
5921
|
this.dataTable.toggleRowsWithCheckbox(event, this.checked || false);
|
|
5926
5922
|
}
|
|
5927
5923
|
}
|
|
5928
|
-
|
|
5924
|
+
_clearSelection();
|
|
5929
5925
|
}
|
|
5930
5926
|
isDisabled() {
|
|
5931
5927
|
return this.disabled() || !this.dataTable.value || !this.dataTable.value.length;
|
|
@@ -5947,7 +5943,7 @@ class TableHeaderCheckbox extends BaseComponent {
|
|
|
5947
5943
|
const data = this.dataTable.selectionPageOnly ? this.dataTable.dataToRender(this.dataTable.processedData) : this.dataTable.processedData;
|
|
5948
5944
|
const val = this.dataTable.frozenValue ? [...this.dataTable.frozenValue, ...data] : data;
|
|
5949
5945
|
const selectableVal = this.dataTable.rowSelectable ? val.filter((data, index) => this.dataTable.rowSelectable({ data, index })) : val;
|
|
5950
|
-
return
|
|
5946
|
+
return _isNotEmpty(selectableVal) && _isNotEmpty(this.dataTable.selection) && selectableVal.every((v) => this.dataTable.selection.some((s) => this.dataTable.equals(v, s)));
|
|
5951
5947
|
}
|
|
5952
5948
|
}
|
|
5953
5949
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: TableHeaderCheckbox, deps: [{ token: Table }, { token: TableService }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -5995,7 +5991,7 @@ class ReorderableRowHandle extends BaseComponent {
|
|
|
5995
5991
|
this.el = el;
|
|
5996
5992
|
}
|
|
5997
5993
|
onAfterViewInit() {
|
|
5998
|
-
//
|
|
5994
|
+
// ɵaddClass(this.el.nativeElement, 'p-datatable-reorderable-row-handle');
|
|
5999
5995
|
}
|
|
6000
5996
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.2", ngImport: i0, type: ReorderableRowHandle, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6001
5997
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.2.2", type: ReorderableRowHandle, isStandalone: false, selector: "[aglReorderableRowHandle]", host: { properties: { "class": "cx('reorderableRowHandle')" } }, providers: [TableStyle], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0 });
|
|
@@ -6526,14 +6522,14 @@ class ColumnFilter extends BaseComponent {
|
|
|
6526
6522
|
matchMode: this.getDefaultMatchMode(),
|
|
6527
6523
|
operator: this.getDefaultOperator()
|
|
6528
6524
|
});
|
|
6529
|
-
|
|
6525
|
+
_focus(this.clearButtonViewChild?.nativeElement);
|
|
6530
6526
|
}
|
|
6531
6527
|
removeConstraint(filterMeta) {
|
|
6532
6528
|
this.dataTable.filters[this.field] = this.dataTable.filters[this.field].filter((meta) => meta !== filterMeta);
|
|
6533
6529
|
if (!this.showApplyButton) {
|
|
6534
6530
|
this.dataTable._filter();
|
|
6535
6531
|
}
|
|
6536
|
-
|
|
6532
|
+
_focus(this.clearButtonViewChild?.nativeElement);
|
|
6537
6533
|
}
|
|
6538
6534
|
onOperatorChange(value) {
|
|
6539
6535
|
this.dataTable.filters[this.field].forEach((filterMeta) => {
|
|
@@ -6557,7 +6553,7 @@ class ColumnFilter extends BaseComponent {
|
|
|
6557
6553
|
break;
|
|
6558
6554
|
case 'ArrowDown':
|
|
6559
6555
|
if (this.overlayVisible) {
|
|
6560
|
-
let focusable =
|
|
6556
|
+
let focusable = _getFocusableElements(this.overlay);
|
|
6561
6557
|
if (focusable) {
|
|
6562
6558
|
focusable[0].focus();
|
|
6563
6559
|
}
|
|
@@ -6633,7 +6629,7 @@ class ColumnFilter extends BaseComponent {
|
|
|
6633
6629
|
}
|
|
6634
6630
|
focusOnFirstElement() {
|
|
6635
6631
|
if (this.overlay) {
|
|
6636
|
-
|
|
6632
|
+
_focus(_getFirstFocusableElement(this.overlay, ''));
|
|
6637
6633
|
}
|
|
6638
6634
|
}
|
|
6639
6635
|
getDefaultMatchMode() {
|
|
@@ -6702,7 +6698,7 @@ class ColumnFilter extends BaseComponent {
|
|
|
6702
6698
|
bindDocumentResizeListener() {
|
|
6703
6699
|
if (!this.documentResizeListener) {
|
|
6704
6700
|
this.documentResizeListener = this.renderer.listen(this.document.defaultView, 'resize', (event) => {
|
|
6705
|
-
if (this.overlayVisible && !
|
|
6701
|
+
if (this.overlayVisible && !_isTouchDevice()) {
|
|
6706
6702
|
this.hide();
|
|
6707
6703
|
}
|
|
6708
6704
|
});
|
|
@@ -7512,7 +7508,6 @@ class TableModule {
|
|
|
7512
7508
|
SelectModule,
|
|
7513
7509
|
FormsModule,
|
|
7514
7510
|
ButtonModule,
|
|
7515
|
-
SelectButtonModule,
|
|
7516
7511
|
DatePickerModule,
|
|
7517
7512
|
InputNumberModule,
|
|
7518
7513
|
BadgeModule,
|
|
@@ -7526,7 +7521,6 @@ class TableModule {
|
|
|
7526
7521
|
SortAmountDownIcon,
|
|
7527
7522
|
FilterIcon,
|
|
7528
7523
|
FilterFillIcon,
|
|
7529
|
-
FilterSlashIcon,
|
|
7530
7524
|
PlusIcon,
|
|
7531
7525
|
TrashIcon,
|
|
7532
7526
|
RadioButtonModule,
|
|
@@ -7538,7 +7532,6 @@ class TableModule {
|
|
|
7538
7532
|
SelectModule,
|
|
7539
7533
|
FormsModule,
|
|
7540
7534
|
ButtonModule,
|
|
7541
|
-
SelectButtonModule,
|
|
7542
7535
|
DatePickerModule,
|
|
7543
7536
|
InputNumberModule,
|
|
7544
7537
|
BadgeModule,
|
|
@@ -7552,7 +7545,6 @@ class TableModule {
|
|
|
7552
7545
|
SortAmountDownIcon,
|
|
7553
7546
|
FilterIcon,
|
|
7554
7547
|
FilterFillIcon,
|
|
7555
|
-
FilterSlashIcon,
|
|
7556
7548
|
PlusIcon,
|
|
7557
7549
|
TrashIcon,
|
|
7558
7550
|
RadioButtonModule,
|
|
@@ -7570,7 +7562,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
|
|
|
7570
7562
|
SelectModule,
|
|
7571
7563
|
FormsModule,
|
|
7572
7564
|
ButtonModule,
|
|
7573
|
-
SelectButtonModule,
|
|
7574
7565
|
DatePickerModule,
|
|
7575
7566
|
InputNumberModule,
|
|
7576
7567
|
BadgeModule,
|
|
@@ -7584,7 +7575,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
|
|
|
7584
7575
|
SortAmountDownIcon,
|
|
7585
7576
|
FilterIcon,
|
|
7586
7577
|
FilterFillIcon,
|
|
7587
|
-
FilterSlashIcon,
|
|
7588
7578
|
PlusIcon,
|
|
7589
7579
|
TrashIcon,
|
|
7590
7580
|
RadioButtonModule,
|