Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature:When the entire row and column are selected, right-click the … #630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions src/core/data_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,33 @@ export default class DataProxy {
const {
left, top, width, height,
} = this.getSelectedRect();

const { cols, rows } = this;
const [rowSize, colSize] = this.selector.size();

const y1 = y - this.rows.height
const x1 = x - this.cols.indexWidth;
const y1 = y - this.rows.height;
// console.log('x:', x, ',y:', y, 'left:', left, 'top:', top);
return x1 > left && x1 < (left + width)
&& y1 > top && y1 < (top + height);

// select whole column || select whole row

let xyInSelected = false;
if (cols.len === colSize) {
if ((x < this.cols.indexWidth || x > left + width) && ((y1 > top && y1 < top + height))) {
xyInSelected = true;
}
}

if (rows.len === rowSize) {
if ((y < this.rows.height || y > top + height) && ((x1 > left && x1 < width + left))) {
xyInSelected = true;
}
}

if (xyInSelected) {
return true;
}

return x1 > left && x1 < (left + width) && y1 > top && y1 < (top + height);
}

getSelectedRect() {
Expand Down