Skip to content

Commit

Permalink
fix: #701
Browse files Browse the repository at this point in the history
  • Loading branch information
maks authored and maks committed Mar 3, 2025
1 parent 5ec5ee6 commit 7d40967
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export namespace Components {
/**
* Get the currently selected Range.
*/
"getSelectedRange": () => Promise<RangeArea | null>;
"getSelectedRange": () => Promise<(RangeArea & AllDimensionType) | null>;
/**
* Get data from source
*/
Expand Down
3 changes: 2 additions & 1 deletion src/components/overlay/revogr-overlay-selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import type {
ChangedRange,
BeforeRangeSaveDataDetails,
SaveDataDetails,
EditCellStore,
} from '@type';

/**
Expand Down Expand Up @@ -896,7 +897,7 @@ export class OverlaySelection {
return focus && !this.columnService?.isReadOnly(focus.y, focus.x);
}

get edited() {
get edited(): EditCellStore | null {
return this.selectionStore.get('edit');
}

Expand Down
37 changes: 32 additions & 5 deletions src/components/revoGrid/viewport.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@
* Collects data for pinned columns in the required @ViewportProps format.
*/

import { DimensionRows, MultiDimensionType, SlotType, Cell, ViewportColumn } from '@type';

import type {
DimensionRows,
MultiDimensionType,
SlotType,
Cell,
ViewportColumn,
ColumnRegular,
DimensionCols,
ViewportState,
DimensionSettingsState,
DataType,
} from '@type';
import type { Observable } from '../../utils';
import type { DSourceState } from '../../store';
/**
* Represents the slot names for the viewport slots.
*/
Expand Down Expand Up @@ -34,13 +46,30 @@ export function getLastCell(
};
}

/**
* Represents the partition of viewport data.
*/
export type VPPartition = {
colData: Observable<DSourceState<ColumnRegular, DimensionCols>>;
viewportCol: Observable<ViewportState>;
viewportRow: Observable<ViewportState>;
lastCell: Cell;
slot: SlotType;
type: DimensionRows;
canDrag: boolean;
position: Cell;
dataStore: Observable<DSourceState<DataType, DimensionRows>>;
dimensionCol: Observable<DimensionSettingsState>;
dimensionRow: Observable<DimensionSettingsState>;
style?: { height: string };
};

export function viewportDataPartition(
data: ViewportColumn,
type: DimensionRows,
slot: SlotType,
fixed?: boolean,
) {
): VPPartition {
return {
colData: data.colStore,
viewportCol: data.viewports[data.colType].store,
Expand All @@ -59,5 +88,3 @@ export function viewportDataPartition(
: undefined,
};
}

export type VPPartition = ReturnType<typeof viewportDataPartition>;
2 changes: 1 addition & 1 deletion src/store/vp/viewport.helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
DimensionSettingsState,
PositionItem,
ViewSettingSizeProp,
Expand Down

0 comments on commit 7d40967

Please sign in to comment.