@revolist/revogrid 4.23.0 → 4.23.2
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/dist/cjs/{cell-renderer-DWJ9Px9f.js → cell-renderer-Dcz022q7.js} +1 -1
- package/dist/cjs/{column.drag.plugin-CaEBDG-Q.js → column.drag.plugin-DJueWxN_.js} +2 -2
- package/dist/cjs/{column.service-f612L4ql.js → column.service-C1Qvcf5l.js} +9 -0
- package/dist/cjs/{header-cell-renderer-4yq9_WbM.js → header-cell-renderer-QrcXXSkF.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/revo-grid.cjs.entry.js +92 -6
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +55 -20
- package/dist/collection/components/header/revogr-header.js +49 -16
- package/dist/collection/components/revoGrid/revo-grid.js +63 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +4 -2
- package/dist/collection/plugins/groupingRow/grouping.service.js +9 -0
- package/dist/collection/services/selection.store.connector.js +26 -3
- package/dist/esm/{cell-renderer-8UiGd-s7.js → cell-renderer-BtN-NGCk.js} +1 -1
- package/dist/esm/{column.drag.plugin-BsfhsfmB.js → column.drag.plugin-DCZW62Uc.js} +2 -2
- package/dist/esm/{column.service-DbpulTog.js → column.service-CC_SD8W3.js} +9 -0
- package/dist/esm/{header-cell-renderer-DGI2FAD8.js → header-cell-renderer-BsvUQ8GS.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/revo-grid.entry.js +92 -6
- package/dist/esm/revogr-attribution_7.entry.js +1 -1
- package/dist/esm/revogr-data_4.entry.js +55 -20
- package/dist/revo-grid/{cell-renderer-8UiGd-s7.js → cell-renderer-BtN-NGCk.js} +1 -1
- package/dist/revo-grid/{column.drag.plugin-BsfhsfmB.js → column.drag.plugin-DCZW62Uc.js} +2 -2
- package/dist/revo-grid/{column.service-DbpulTog.js → column.service-CC_SD8W3.js} +9 -0
- package/dist/revo-grid/{header-cell-renderer-DGI2FAD8.js → header-cell-renderer-BsvUQ8GS.js} +1 -1
- package/dist/revo-grid/index.esm.js +5 -5
- package/dist/revo-grid/revo-grid.entry.js +92 -6
- package/dist/revo-grid/revogr-attribution_7.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +55 -20
- package/dist/types/components/header/header-group-renderer.d.ts +1 -0
- package/dist/types/components/header/revogr-header.d.ts +2 -0
- package/dist/types/components/revoGrid/revo-grid.d.ts +12 -0
- package/dist/types/services/selection.store.connector.d.ts +6 -0
- package/dist/types/types/selection.d.ts +13 -0
- package/hydrate/index.js +150 -20
- package/hydrate/index.mjs +150 -20
- package/package.json +1 -1
- package/standalone/column.service.js +1 -1
- package/standalone/revo-grid.js +1 -1
- package/standalone/revogr-header2.js +1 -1
- package/standalone/revogr-viewport-scroll2.js +1 -1
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Built by Revolist OU ❤️
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, e as Host, g as getElement } from './index-Chp_81rd.js';
|
|
5
|
-
import { M as ColumnService, u as isGrouping } from './column.service-
|
|
5
|
+
import { M as ColumnService, u as isGrouping } from './column.service-CC_SD8W3.js';
|
|
6
6
|
import { B as ROW_FOCUSED_CLASS, b as getSourceItem, n as DATA_ROW, m as DATA_COL, M as MIN_COL_SIZE, r as HEADER_SORTABLE_CLASS, H as HEADER_CLASS, F as FOCUS_CLASS, k as getItemByIndex, u as HEADER_ROW_CLASS, v as HEADER_ACTUAL_ROW_CLASS } from './dimension.helpers-CGKwSvw6.js';
|
|
7
|
-
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-
|
|
7
|
+
import { G as GroupingRowRenderer, C as CellRenderer, R as RowRenderer, P as PADDING_DEPTH, S as SortingSign } from './cell-renderer-BtN-NGCk.js';
|
|
8
8
|
import { c as FilterButton } from './filter.button-C8XTWPU2.js';
|
|
9
|
-
import { H as HeaderCellRenderer } from './header-cell-renderer-
|
|
9
|
+
import { H as HeaderCellRenderer } from './header-cell-renderer-BsvUQ8GS.js';
|
|
10
10
|
import { t as throttle, L as LocalScrollTimer, a as LocalScrollService, g as getContentSize } from './throttle-CaUDyxyU.js';
|
|
11
11
|
import { H as HEADER_SLOT, C as CONTENT_SLOT, F as FOOTER_SLOT } from './viewport.helpers-CoCAvmZs.js';
|
|
12
12
|
import './debounce-PCRWZliA.js';
|
|
@@ -434,22 +434,13 @@ const RevogrHeaderComponent = class {
|
|
|
434
434
|
];
|
|
435
435
|
}
|
|
436
436
|
renderGroupColumn(group, level, visibleGroupRange) {
|
|
437
|
-
|
|
438
|
-
const
|
|
439
|
-
if (groupStartIndex < 0) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
const groupEndIndex = groupStartIndex + group.indexes.length - 1;
|
|
443
|
-
if (!visibleGroupRange ||
|
|
444
|
-
!isGroupInVisibleRange(groupStartIndex, groupEndIndex, visibleGroupRange)) {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
const groupStart = getItemByIndex(this.dimensionCol.state, groupStartIndex).start;
|
|
448
|
-
const groupEnd = getItemByIndex(this.dimensionCol.state, groupEndIndex).end;
|
|
437
|
+
const groupRange = this.getGroupIndexRange(group);
|
|
438
|
+
const groupBounds = this.getGroupBounds(groupRange);
|
|
449
439
|
const props = {
|
|
440
|
+
level,
|
|
450
441
|
providers: this.providers,
|
|
451
|
-
start:
|
|
452
|
-
end:
|
|
442
|
+
start: groupBounds.start,
|
|
443
|
+
end: groupBounds.end,
|
|
453
444
|
group,
|
|
454
445
|
renderOffset: this.viewportCol.get('renderOffset') || 0,
|
|
455
446
|
active: this.resizeHandler,
|
|
@@ -457,15 +448,57 @@ const RevogrHeaderComponent = class {
|
|
|
457
448
|
additionalData: this.additionalData,
|
|
458
449
|
onResize: e => {
|
|
459
450
|
var _a;
|
|
460
|
-
return
|
|
451
|
+
return groupRange
|
|
452
|
+
? this.onResizeGroup((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, groupRange.startIndex, groupRange.endIndex)
|
|
453
|
+
: undefined;
|
|
461
454
|
},
|
|
462
455
|
};
|
|
463
456
|
const event = this.beforeGroupHeaderRender.emit(props);
|
|
464
457
|
if (event.defaultPrevented) {
|
|
465
458
|
return;
|
|
466
459
|
}
|
|
460
|
+
const renderRange = this.getGroupIndexRange(event.detail.group);
|
|
461
|
+
if (!renderRange ||
|
|
462
|
+
!visibleGroupRange ||
|
|
463
|
+
!isGroupInVisibleRange(renderRange.startIndex, renderRange.endIndex, visibleGroupRange)) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
if (event.detail.onResize === props.onResize) {
|
|
467
|
+
event.detail.onResize = e => {
|
|
468
|
+
var _a;
|
|
469
|
+
return this.onResizeGroup((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, renderRange.startIndex, renderRange.endIndex);
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
const renderBounds = this.getGroupBounds(renderRange);
|
|
473
|
+
if (event.detail.start === props.start) {
|
|
474
|
+
event.detail.start = renderBounds.start;
|
|
475
|
+
}
|
|
476
|
+
if (event.detail.end === props.end) {
|
|
477
|
+
event.detail.end = renderBounds.end;
|
|
478
|
+
}
|
|
467
479
|
return h(HeaderGroupRenderer, Object.assign({ key: this.getGroupHeaderCellKey(event.detail.group, level) }, event.detail));
|
|
468
480
|
}
|
|
481
|
+
getGroupIndexRange(group) {
|
|
482
|
+
var _a;
|
|
483
|
+
const startIndex = (_a = group.indexes[0]) !== null && _a !== void 0 ? _a : -1;
|
|
484
|
+
if (startIndex < 0) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
const endIndex = group.indexes[group.indexes.length - 1];
|
|
488
|
+
return {
|
|
489
|
+
startIndex,
|
|
490
|
+
endIndex,
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
getGroupBounds(range) {
|
|
494
|
+
if (!range) {
|
|
495
|
+
return { start: 0, end: 0 };
|
|
496
|
+
}
|
|
497
|
+
return {
|
|
498
|
+
start: getItemByIndex(this.dimensionCol.state, range.startIndex).start,
|
|
499
|
+
end: getItemByIndex(this.dimensionCol.state, range.endIndex).end,
|
|
500
|
+
};
|
|
501
|
+
}
|
|
469
502
|
getVisibleGroupRange() {
|
|
470
503
|
const visibleColumns = this.viewportCol.get('items');
|
|
471
504
|
if (!visibleColumns.length) {
|
|
@@ -782,8 +815,10 @@ const RevogrViewportScroll = class {
|
|
|
782
815
|
render() {
|
|
783
816
|
var _a, _b, _c, _d;
|
|
784
817
|
const physicalContentHeight = getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
|
|
785
|
-
const physicalContentWidth =
|
|
786
|
-
|
|
818
|
+
const physicalContentWidth = this.colType === 'colPinStart' || this.colType === 'colPinEnd'
|
|
819
|
+
? this.contentWidth
|
|
820
|
+
: getContentSize(this.contentWidth, (_d = (_c = this.horizontalScroll) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
821
|
+
return (h(Host, { key: '9b23f5c3c18924a25ecd3e1ee0909ebd03b25048', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: '144f5c79d0a99e6423c1ca448917aedf514f0ae3', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, h("div", { key: '10db0971f2db6acf8510cf21d736c82f0d0e5632', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '77e0cd002ccda4a9e420de50648b711cde412a34', name: HEADER_SLOT })), h("div", { key: 'a78167dc52a24005a35dd94c5a9a43eb7dd289dd', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'c277d9d1ffc54452b584eb55b1a29d2a10672fb6', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, h("slot", { key: '01fb5630a3d40e231a3aead9ad1c07aa06e69004', name: CONTENT_SLOT }))), h("div", { key: 'ff7389e77b500b97ea1fc38228da9fc3d6514e30', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '3aa725e0a8f38ef5d4bc4dce53037ff55a6c25b3', name: FOOTER_SLOT })))));
|
|
787
822
|
}
|
|
788
823
|
/**
|
|
789
824
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|
|
@@ -3,6 +3,7 @@ import { Group } from "../../store/index";
|
|
|
3
3
|
import type { ProvidersColumns } from "../../types/index";
|
|
4
4
|
import { ResizeEvent, ResizeProps } from './resizable.directive';
|
|
5
5
|
export type HeaderGroupRendererProps = {
|
|
6
|
+
level: number;
|
|
6
7
|
start: number;
|
|
7
8
|
end: number;
|
|
8
9
|
group: Group;
|
|
@@ -88,6 +88,8 @@ export declare class RevogrHeaderComponent {
|
|
|
88
88
|
private renderGroupingColumns;
|
|
89
89
|
private renderGroupRow;
|
|
90
90
|
private renderGroupColumn;
|
|
91
|
+
private getGroupIndexRange;
|
|
92
|
+
private getGroupBounds;
|
|
91
93
|
private getVisibleGroupRange;
|
|
92
94
|
private getHeaderCellKey;
|
|
93
95
|
private getDuplicateHeaderProps;
|
|
@@ -626,8 +626,20 @@ export declare class RevoGridComponent {
|
|
|
626
626
|
orderService: OrdererService;
|
|
627
627
|
selectionStoreConnector?: SelectionStoreConnector;
|
|
628
628
|
scrollingService: GridScrollingService;
|
|
629
|
+
private pendingColumnFocusRestore?;
|
|
629
630
|
columnTypesChanged(): void;
|
|
630
631
|
columnChanged(newVal?: (ColumnGrouping | ColumnRegular)[], _prevVal?: (ColumnGrouping | ColumnRegular)[] | undefined, __watchName?: string, init?: boolean): void;
|
|
632
|
+
/**
|
|
633
|
+
* Capture logical focus before columns are repartitioned by pin state.
|
|
634
|
+
* Regression case: selecting a regular cell, then pinning that column left,
|
|
635
|
+
* used to let the new pinned viewport reuse the old rgCol selection store.
|
|
636
|
+
*/
|
|
637
|
+
private getColumnFocusRestore;
|
|
638
|
+
/**
|
|
639
|
+
* Reapply focus by column prop after render, once pinning has moved the
|
|
640
|
+
* column to its new viewport and virtual index.
|
|
641
|
+
*/
|
|
642
|
+
private restoreColumnFocusAfterRender;
|
|
631
643
|
disableVirtualXChanged(newVal?: boolean, prevVal?: boolean): void;
|
|
632
644
|
rowSizeChanged(s: number): void;
|
|
633
645
|
themeChanged(t: Theme, _?: Theme, __?: string, init?: boolean): void;
|
|
@@ -70,5 +70,11 @@ export declare class SelectionStoreConnector {
|
|
|
70
70
|
selectAll(): void;
|
|
71
71
|
private getXStores;
|
|
72
72
|
private getYStores;
|
|
73
|
+
/**
|
|
74
|
+
* Keep column viewport positions and types in sync across pin/unpin rerenders.
|
|
75
|
+
* Regression case: when a selected rgCol cell was pinned left, colPinStart
|
|
76
|
+
* could take over x=0 and render the stale rgCol focus store in the pinned area.
|
|
77
|
+
*/
|
|
78
|
+
private updateColumnTypeMapping;
|
|
73
79
|
}
|
|
74
80
|
export {};
|
|
@@ -65,6 +65,19 @@ export type ChangedRange = {
|
|
|
65
65
|
[newRowIndex: number]: DataType;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* Logical focus marker captured before column viewport ownership changes.
|
|
70
|
+
* Used when a selected column is pinned/unpinned so focus can be restored by
|
|
71
|
+
* column prop after the column moves between rgCol, colPinStart, or colPinEnd.
|
|
72
|
+
*/
|
|
73
|
+
export type PendingColumnFocusRestore = {
|
|
74
|
+
prop: ColumnProp;
|
|
75
|
+
colType: DimensionCols;
|
|
76
|
+
colIndex: ColIndex;
|
|
77
|
+
prevStoreX: ColIndex;
|
|
78
|
+
rowType: DimensionRows;
|
|
79
|
+
rowIndex: RowIndex;
|
|
80
|
+
};
|
|
68
81
|
/**
|
|
69
82
|
* Cell coordinates
|
|
70
83
|
*/
|
package/hydrate/index.js
CHANGED
|
@@ -12645,6 +12645,9 @@ const GROUPING_ROW_TYPE = 'rgRow';
|
|
|
12645
12645
|
function getGroupValueDefault(item, prop) {
|
|
12646
12646
|
return item[prop] || null;
|
|
12647
12647
|
}
|
|
12648
|
+
function isDataRow(item) {
|
|
12649
|
+
return item != null;
|
|
12650
|
+
}
|
|
12648
12651
|
// get source based on proxy item collection to preserve rgRow order
|
|
12649
12652
|
function getSource(source, items, withoutGrouping = false) {
|
|
12650
12653
|
let index = 0;
|
|
@@ -12666,6 +12669,9 @@ function getSource(source, items, withoutGrouping = false) {
|
|
|
12666
12669
|
result.prevExpanded[model[PSEUDO_GROUP_ITEM_VALUE]] = true;
|
|
12667
12670
|
}
|
|
12668
12671
|
}
|
|
12672
|
+
else if (!isDataRow(model)) {
|
|
12673
|
+
return;
|
|
12674
|
+
}
|
|
12669
12675
|
else {
|
|
12670
12676
|
result.source.push(model);
|
|
12671
12677
|
result.oldNewIndexes[i] = index;
|
|
@@ -12746,6 +12752,9 @@ function flattenGroupMaps({ groupedValues, parentIds, isExpanded, itemIndex, exp
|
|
|
12746
12752
|
function gatherGrouping(array, columnProps, { prevExpanded = {}, expandedAll = false, getGroupValue = getGroupValueDefault, }) {
|
|
12747
12753
|
const groupedItems = new Map();
|
|
12748
12754
|
array.forEach((item, originalIndex) => {
|
|
12755
|
+
if (!isDataRow(item)) {
|
|
12756
|
+
return;
|
|
12757
|
+
}
|
|
12749
12758
|
const groupLevelValues = columnProps.map(groupId => getGroupValue(item, groupId));
|
|
12750
12759
|
const lastLevelValue = groupLevelValues.pop();
|
|
12751
12760
|
let currentGroupLevel = groupedItems;
|
|
@@ -17654,13 +17663,11 @@ class SelectionStoreConnector {
|
|
|
17654
17663
|
return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('range');
|
|
17655
17664
|
}
|
|
17656
17665
|
registerColumn(x, type) {
|
|
17666
|
+
this.updateColumnTypeMapping(x, type);
|
|
17657
17667
|
if (this.columnStores[x]) {
|
|
17658
17668
|
return this.columnStores[x];
|
|
17659
17669
|
}
|
|
17660
17670
|
this.columnStores[x] = new SelectionStore();
|
|
17661
|
-
// build cross-linking type to position
|
|
17662
|
-
this.storesByType[type] = x;
|
|
17663
|
-
this.storesXToType[x] = type;
|
|
17664
17671
|
return this.columnStores[x];
|
|
17665
17672
|
}
|
|
17666
17673
|
registerRow(y, type) {
|
|
@@ -17881,6 +17888,31 @@ class SelectionStoreConnector {
|
|
|
17881
17888
|
}
|
|
17882
17889
|
return stores;
|
|
17883
17890
|
}
|
|
17891
|
+
/**
|
|
17892
|
+
* Keep column viewport positions and types in sync across pin/unpin rerenders.
|
|
17893
|
+
* Regression case: when a selected rgCol cell was pinned left, colPinStart
|
|
17894
|
+
* could take over x=0 and render the stale rgCol focus store in the pinned area.
|
|
17895
|
+
*/
|
|
17896
|
+
updateColumnTypeMapping(x, type) {
|
|
17897
|
+
const previousType = this.storesXToType[x];
|
|
17898
|
+
const previousX = this.storesByType[type];
|
|
17899
|
+
let shouldClearFocus = false;
|
|
17900
|
+
this.storesByType[type] = x;
|
|
17901
|
+
this.storesXToType[x] = type;
|
|
17902
|
+
if (previousType && previousType !== type) {
|
|
17903
|
+
shouldClearFocus = true;
|
|
17904
|
+
if (this.storesByType[previousType] === x) {
|
|
17905
|
+
delete this.storesByType[previousType];
|
|
17906
|
+
}
|
|
17907
|
+
}
|
|
17908
|
+
if (typeof previousX === 'number' && previousX !== x && this.storesXToType[previousX] === type) {
|
|
17909
|
+
delete this.storesXToType[previousX];
|
|
17910
|
+
shouldClearFocus = true;
|
|
17911
|
+
}
|
|
17912
|
+
if (shouldClearFocus) {
|
|
17913
|
+
this.clearAll();
|
|
17914
|
+
}
|
|
17915
|
+
}
|
|
17884
17916
|
}
|
|
17885
17917
|
|
|
17886
17918
|
/**
|
|
@@ -19477,6 +19509,7 @@ class RevoGridComponent {
|
|
|
19477
19509
|
if (!this.dimensionProvider || !this.columnProvider) {
|
|
19478
19510
|
return;
|
|
19479
19511
|
}
|
|
19512
|
+
const focusToRestore = init ? undefined : this.getColumnFocusRestore();
|
|
19480
19513
|
const beforeGatherEvent = this.beforecolumnsgather.emit({
|
|
19481
19514
|
columns: [...newVal],
|
|
19482
19515
|
});
|
|
@@ -19494,6 +19527,9 @@ class RevoGridComponent {
|
|
|
19494
19527
|
return;
|
|
19495
19528
|
}
|
|
19496
19529
|
const columns = this.columnProvider.setColumns(beforeApplyEvent.detail);
|
|
19530
|
+
if (focusToRestore) {
|
|
19531
|
+
this.pendingColumnFocusRestore = focusToRestore;
|
|
19532
|
+
}
|
|
19497
19533
|
const order = {};
|
|
19498
19534
|
for (const prop of Object.keys(beforeApplyEvent.detail.sort)) {
|
|
19499
19535
|
order[prop] = beforeApplyEvent.detail.sort[prop].order;
|
|
@@ -19503,6 +19539,64 @@ class RevoGridComponent {
|
|
|
19503
19539
|
order,
|
|
19504
19540
|
});
|
|
19505
19541
|
}
|
|
19542
|
+
/**
|
|
19543
|
+
* Capture logical focus before columns are repartitioned by pin state.
|
|
19544
|
+
* Regression case: selecting a regular cell, then pinning that column left,
|
|
19545
|
+
* used to let the new pinned viewport reuse the old rgCol selection store.
|
|
19546
|
+
*/
|
|
19547
|
+
getColumnFocusRestore() {
|
|
19548
|
+
var _a, _b, _c, _d;
|
|
19549
|
+
const focused = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused();
|
|
19550
|
+
const prevStoreX = (_c = (_b = this.selectionStoreConnector) === null || _b === void 0 ? void 0 : _b.focusedStore) === null || _c === void 0 ? void 0 : _c.position.x;
|
|
19551
|
+
const prop = (_d = focused === null || focused === void 0 ? void 0 : focused.column) === null || _d === void 0 ? void 0 : _d.prop;
|
|
19552
|
+
if (!focused || prop === undefined || prevStoreX === undefined) {
|
|
19553
|
+
return;
|
|
19554
|
+
}
|
|
19555
|
+
return {
|
|
19556
|
+
prop,
|
|
19557
|
+
colType: focused.colType,
|
|
19558
|
+
colIndex: focused.cell.x,
|
|
19559
|
+
prevStoreX,
|
|
19560
|
+
rowType: focused.rowType,
|
|
19561
|
+
rowIndex: focused.cell.y,
|
|
19562
|
+
};
|
|
19563
|
+
}
|
|
19564
|
+
/**
|
|
19565
|
+
* Reapply focus by column prop after render, once pinning has moved the
|
|
19566
|
+
* column to its new viewport and virtual index.
|
|
19567
|
+
*/
|
|
19568
|
+
restoreColumnFocusAfterRender() {
|
|
19569
|
+
var _a, _b, _c, _d;
|
|
19570
|
+
const pending = this.pendingColumnFocusRestore;
|
|
19571
|
+
if (!pending) {
|
|
19572
|
+
return;
|
|
19573
|
+
}
|
|
19574
|
+
this.pendingColumnFocusRestore = undefined;
|
|
19575
|
+
if (!this.viewport || !this.columnProvider) {
|
|
19576
|
+
return;
|
|
19577
|
+
}
|
|
19578
|
+
const column = (_b = (_a = this.columnProvider.getColumnByProp(pending.prop)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : getColumnByProp(this.columns, pending.prop);
|
|
19579
|
+
if (!column) {
|
|
19580
|
+
return;
|
|
19581
|
+
}
|
|
19582
|
+
const colType = column.pin || 'rgCol';
|
|
19583
|
+
const columnIndex = this.columnProvider.getColumnIndexByProp(pending.prop, colType);
|
|
19584
|
+
if (columnIndex < 0) {
|
|
19585
|
+
return;
|
|
19586
|
+
}
|
|
19587
|
+
// Header-only column refreshes should not collapse an existing range.
|
|
19588
|
+
// Replay focus only when pin/unpin or repartitioning moved the logical column.
|
|
19589
|
+
if (colType === pending.colType &&
|
|
19590
|
+
columnIndex === pending.colIndex &&
|
|
19591
|
+
pending.prevStoreX === ((_d = (_c = this.selectionStoreConnector) === null || _c === void 0 ? void 0 : _c.focusedStore) === null || _d === void 0 ? void 0 : _d.position.x)) {
|
|
19592
|
+
return;
|
|
19593
|
+
}
|
|
19594
|
+
const cell = {
|
|
19595
|
+
x: columnIndex,
|
|
19596
|
+
y: pending.rowIndex,
|
|
19597
|
+
};
|
|
19598
|
+
this.viewport.setFocus(colType, pending.rowType, cell, cell);
|
|
19599
|
+
}
|
|
19506
19600
|
disableVirtualXChanged(newVal = false, prevVal = false) {
|
|
19507
19601
|
if (newVal === prevVal) {
|
|
19508
19602
|
return;
|
|
@@ -19815,6 +19909,7 @@ class RevoGridComponent {
|
|
|
19815
19909
|
return Promise.all(this.jobsBeforeRender);
|
|
19816
19910
|
}
|
|
19817
19911
|
componentDidRender() {
|
|
19912
|
+
this.restoreColumnFocusAfterRender();
|
|
19818
19913
|
this.aftergridrender.emit();
|
|
19819
19914
|
}
|
|
19820
19915
|
render() {
|
|
@@ -20836,22 +20931,13 @@ class RevogrHeaderComponent {
|
|
|
20836
20931
|
];
|
|
20837
20932
|
}
|
|
20838
20933
|
renderGroupColumn(group, level, visibleGroupRange) {
|
|
20839
|
-
|
|
20840
|
-
const
|
|
20841
|
-
if (groupStartIndex < 0) {
|
|
20842
|
-
return;
|
|
20843
|
-
}
|
|
20844
|
-
const groupEndIndex = groupStartIndex + group.indexes.length - 1;
|
|
20845
|
-
if (!visibleGroupRange ||
|
|
20846
|
-
!isGroupInVisibleRange(groupStartIndex, groupEndIndex, visibleGroupRange)) {
|
|
20847
|
-
return;
|
|
20848
|
-
}
|
|
20849
|
-
const groupStart = getItemByIndex(this.dimensionCol.state, groupStartIndex).start;
|
|
20850
|
-
const groupEnd = getItemByIndex(this.dimensionCol.state, groupEndIndex).end;
|
|
20934
|
+
const groupRange = this.getGroupIndexRange(group);
|
|
20935
|
+
const groupBounds = this.getGroupBounds(groupRange);
|
|
20851
20936
|
const props = {
|
|
20937
|
+
level,
|
|
20852
20938
|
providers: this.providers,
|
|
20853
|
-
start:
|
|
20854
|
-
end:
|
|
20939
|
+
start: groupBounds.start,
|
|
20940
|
+
end: groupBounds.end,
|
|
20855
20941
|
group,
|
|
20856
20942
|
renderOffset: this.viewportCol.get('renderOffset') || 0,
|
|
20857
20943
|
active: this.resizeHandler,
|
|
@@ -20859,15 +20945,57 @@ class RevogrHeaderComponent {
|
|
|
20859
20945
|
additionalData: this.additionalData,
|
|
20860
20946
|
onResize: e => {
|
|
20861
20947
|
var _a;
|
|
20862
|
-
return
|
|
20948
|
+
return groupRange
|
|
20949
|
+
? this.onResizeGroup((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, groupRange.startIndex, groupRange.endIndex)
|
|
20950
|
+
: undefined;
|
|
20863
20951
|
},
|
|
20864
20952
|
};
|
|
20865
20953
|
const event = this.beforeGroupHeaderRender.emit(props);
|
|
20866
20954
|
if (event.defaultPrevented) {
|
|
20867
20955
|
return;
|
|
20868
20956
|
}
|
|
20957
|
+
const renderRange = this.getGroupIndexRange(event.detail.group);
|
|
20958
|
+
if (!renderRange ||
|
|
20959
|
+
!visibleGroupRange ||
|
|
20960
|
+
!isGroupInVisibleRange(renderRange.startIndex, renderRange.endIndex, visibleGroupRange)) {
|
|
20961
|
+
return;
|
|
20962
|
+
}
|
|
20963
|
+
if (event.detail.onResize === props.onResize) {
|
|
20964
|
+
event.detail.onResize = e => {
|
|
20965
|
+
var _a;
|
|
20966
|
+
return this.onResizeGroup((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, renderRange.startIndex, renderRange.endIndex);
|
|
20967
|
+
};
|
|
20968
|
+
}
|
|
20969
|
+
const renderBounds = this.getGroupBounds(renderRange);
|
|
20970
|
+
if (event.detail.start === props.start) {
|
|
20971
|
+
event.detail.start = renderBounds.start;
|
|
20972
|
+
}
|
|
20973
|
+
if (event.detail.end === props.end) {
|
|
20974
|
+
event.detail.end = renderBounds.end;
|
|
20975
|
+
}
|
|
20869
20976
|
return hAsync(HeaderGroupRenderer, Object.assign({ key: this.getGroupHeaderCellKey(event.detail.group, level) }, event.detail));
|
|
20870
20977
|
}
|
|
20978
|
+
getGroupIndexRange(group) {
|
|
20979
|
+
var _a;
|
|
20980
|
+
const startIndex = (_a = group.indexes[0]) !== null && _a !== void 0 ? _a : -1;
|
|
20981
|
+
if (startIndex < 0) {
|
|
20982
|
+
return;
|
|
20983
|
+
}
|
|
20984
|
+
const endIndex = group.indexes[group.indexes.length - 1];
|
|
20985
|
+
return {
|
|
20986
|
+
startIndex,
|
|
20987
|
+
endIndex,
|
|
20988
|
+
};
|
|
20989
|
+
}
|
|
20990
|
+
getGroupBounds(range) {
|
|
20991
|
+
if (!range) {
|
|
20992
|
+
return { start: 0, end: 0 };
|
|
20993
|
+
}
|
|
20994
|
+
return {
|
|
20995
|
+
start: getItemByIndex(this.dimensionCol.state, range.startIndex).start,
|
|
20996
|
+
end: getItemByIndex(this.dimensionCol.state, range.endIndex).end,
|
|
20997
|
+
};
|
|
20998
|
+
}
|
|
20871
20999
|
getVisibleGroupRange() {
|
|
20872
21000
|
const visibleColumns = this.viewportCol.get('items');
|
|
20873
21001
|
if (!visibleColumns.length) {
|
|
@@ -21691,8 +21819,10 @@ class RevogrViewportScroll {
|
|
|
21691
21819
|
render() {
|
|
21692
21820
|
var _a, _b, _c, _d;
|
|
21693
21821
|
const physicalContentHeight = getContentSize(this.contentHeight, (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0);
|
|
21694
|
-
const physicalContentWidth =
|
|
21695
|
-
|
|
21822
|
+
const physicalContentWidth = this.colType === 'colPinStart' || this.colType === 'colPinEnd'
|
|
21823
|
+
? this.contentWidth
|
|
21824
|
+
: getContentSize(this.contentWidth, (_d = (_c = this.horizontalScroll) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
21825
|
+
return (hAsync(Host, { key: '9b23f5c3c18924a25ecd3e1ee0909ebd03b25048', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: '144f5c79d0a99e6423c1ca448917aedf514f0ae3', class: "inner-content-table", style: { width: `${physicalContentWidth}px` } }, hAsync("div", { key: '10db0971f2db6acf8510cf21d736c82f0d0e5632', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: '77e0cd002ccda4a9e420de50648b711cde412a34', name: HEADER_SLOT })), hAsync("div", { key: 'a78167dc52a24005a35dd94c5a9a43eb7dd289dd', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: 'c277d9d1ffc54452b584eb55b1a29d2a10672fb6', class: "content-wrapper", style: { height: `${physicalContentHeight}px` } }, hAsync("slot", { key: '01fb5630a3d40e231a3aead9ad1c07aa06e69004', name: CONTENT_SLOT }))), hAsync("div", { key: 'ff7389e77b500b97ea1fc38228da9fc3d6514e30', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: '3aa725e0a8f38ef5d4bc4dce53037ff55a6c25b3', name: FOOTER_SLOT })))));
|
|
21696
21826
|
}
|
|
21697
21827
|
/**
|
|
21698
21828
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|