Skip to content

Commit

Permalink
Update regular-table to 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Apr 13, 2021
1 parent deffb22 commit 54503af
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/perspective-viewer-datagrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"dependencies": {
"@finos/perspective": "^0.6.2",
"@finos/perspective-viewer": "^0.6.2",
"regular-table": "=0.2.1"
"regular-table": "=0.3.1"
},
"devDependencies": {
"@finos/perspective-test": "^0.6.2"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ function get_psp_type(metadata) {
}
}

async function sortHandler(regularTable, event) {
const meta = regularTable.getMeta(event.target);
async function sortHandler(regularTable, event, target) {
const meta = regularTable.getMeta(target);
const column_name = meta.column_header[meta.column_header.length - 1];
const sort_method = event.shiftKey ? append_sort : override_sort;
const sort = sort_method.call(this, column_name);
Expand Down Expand Up @@ -149,11 +149,23 @@ async function expandCollapseHandler(regularTable, event) {
}

function mousedownListener(regularTable, event) {
if (event.target.classList.contains("psp-tree-label") && event.offsetX < 26) {
if (event.which !== 1) {
return;
}

let target = event.target;
while (target.tagName !== "TD" && target.tagName !== "TH") {
target = target.parentElement;
if (!regularTable.contains(target)) {
return;
}
}

if (target.classList.contains("psp-tree-label") && event.offsetX < 26) {
expandCollapseHandler.call(this, regularTable, event);
event.handled = true;
} else if (event.target.classList.contains("psp-header-leaf") && !event.target.classList.contains("psp-header-corner")) {
sortHandler.call(this, regularTable, event);
} else if (target.classList.contains("psp-header-leaf") && !target.classList.contains("psp-header-corner")) {
sortHandler.call(this, regularTable, event, target);
event.handled = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// Row Selection

.psp-row-selected, :hover .psp-row-selected, :hover th.psp-tree-leaf.psp-row-selected, :hover th.psp-tree-label.psp-row-selected {
color: black !important;
color: white !important;
background-color: #EA7319;
}

.psp-row-selected.psp-tree-label:not(:hover):before {
color: black;
color: white;
}

.psp-row-subselected, :hover .psp-row-subselected, :hover th.psp-tree-leaf.psp-row-subselected, :hover th.psp-tree-label.psp-row-subselected {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14617,10 +14617,10 @@ regjsparser@^0.6.4:
dependencies:
jsesc "~0.5.0"

regular-table@=0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/regular-table/-/regular-table-0.2.1.tgz#af3d1efeeebe7d8071eda4e0dda689b4683ae156"
integrity sha512-24cKRtO/Gkj1p16mvqvkqWCTJSngAtFhYea7bax9XzNjTOy2DAF/507bQE+5zjq/qydfFXOUpTjnAjyIC1E5ug==
regular-table@=0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/regular-table/-/regular-table-0.3.1.tgz#68bb61a8c70c735bd223d2dbac0a1000620068af"
integrity sha512-wsJF/Jyk5ltpyRiwzbXTomiVso2xIggbB1ZH4gUW4VWIL2zdg21yIp3B0TdKyzyFSYMyayL4lF5f6Sqsa/vn8w==

[email protected], relateurl@^0.2.7:
version "0.2.7"
Expand Down

0 comments on commit 54503af

Please sign in to comment.