Skip to content

Commit a2c800a

Browse files
authored
Merge pull request #3064 from finos/fix-datagrid-plugin
Fix plugins which inherit from `perspective-viewer-datagrid`
2 parents a2fcb37 + 75ddec3 commit a2c800a

8 files changed

Lines changed: 24 additions & 20 deletions

File tree

packages/perspective-viewer-datagrid/src/js/custom_elements/toolbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class HTMLPerspectiveViewerDatagridToolbarElement extends HTMLElement {
4848
`;
4949

5050
const viewer = this.parentElement;
51-
const plugin = viewer.querySelector("perspective-viewer-datagrid");
51+
const plugin = this.previousElementSibling;
5252
plugin._scroll_lock = this.shadowRoot.querySelector("#scroll_lock");
5353
plugin._scroll_lock.addEventListener("click", () =>
5454
toggle_scroll_lock.call(plugin),

packages/perspective-viewer-datagrid/src/js/style_handlers/editable.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ function isEditable(viewer, allowed = false) {
1818
this._config.split_by.length === 0;
1919
const selectable = viewer.hasAttribute("selectable");
2020
const editable =
21-
allowed ||
22-
viewer.querySelector("perspective-viewer-datagrid").dataset.editMode ===
23-
"EDIT";
21+
allowed || viewer.children[0]?.dataset?.editMode === "EDIT";
2422
return has_pivots && !selectable && editable;
2523
}
2624

packages/perspective-viewer-datagrid/src/less/regular_table.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ perspective-viewer {
121121
:hover th.psp-tree-leaf.psp-row-selected,
122122
:hover th.psp-tree-label.psp-row-selected {
123123
color: white !important;
124-
background-color: #ea7319 !important;
125-
border-color: #ea7319 !important;
124+
background-color: var(--selected-row--background-color, #ea7319) !important;
125+
border-color: var(--selected-row--background-color, #ea7319) !important;
126126
}
127127

128128
.psp-row-selected.psp-tree-label:not(:hover):before {

packages/perspective-workspace/src/less/menu.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
display: block;
8484
position: relative;
8585
top: 4px;
86-
border-top: 1px solid #dddddd;
86+
border-top: 1px solid;
8787
}
8888

8989
.lm-MenuBar-menu {

packages/perspective-workspace/src/less/tabbar.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@
299299
border: var(--workspace-tabbar--border, 1px solid #ddd);
300300
border-width: var(--workspace-tabbar-tab--border-width);
301301
box-shadow: 0 13px 0 -12px var(--inactive--border-color);
302-
border-radius: 6px 6px 0 0;
302+
border-radius: var(--workspace-tabbar--border-radius, 6px)
303+
var(--workspace-tabbar--border-radius, 6px) 0 0;
303304
background-color: var(--workspace-tabbar--background-color, white);
304305
height: 40px !important;
305306
max-height: 40px !important;

packages/perspective-workspace/src/less/widget.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
.lm-DockPanel:not([data-mode="single-document"]) .viewer-container {
1616
border: var(--workspace-tabbar--border, 1px solid var(--inactive--color));
1717
border-width: var(--workspace-tabbar--border-width);
18-
border-radius: var(--workspace-tabbar--border-radius, 0 0 6px 6px);
18+
border-radius: 0 0 var(--workspace-tabbar--border-radius, 6px)
19+
var(--workspace-tabbar--border-radius, 6px);
1920
}
2021

2122
.viewer-container {

packages/perspective-workspace/src/themes/pro-dark.less

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ perspective-workspace {
4949
--workspace-secondary--color: @grey60;
5050
--workspace-tabbar--border: 1px solid var(--inactive--color);
5151
--workspace-tabbar--border-width: 0px 1px 1px 1px;
52-
--workspace-tabbar--border-radius: 0px 0px 6px 6px;
52+
--workspace-tabbar--border-radius: 6px;
5353
--workspace-tabbar--border-color: var(--inactive--color);
5454
--workspace-tabbar-tab--border-width: 1px 1px 0 1px;
5555
}
@@ -59,17 +59,19 @@ perspective-viewer[theme="Pro Dark"].workspace-master-widget {
5959
}
6060

6161
perspective-workspace-menu {
62-
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo",
63-
"Consolas", "Liberation Mono", monospace;
62+
font-family:
63+
"ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
64+
"Liberation Mono", monospace;
6465
font-weight: 300;
6566
background: @grey700 !important;
6667
color: white !important;
6768
border: 1px solid @grey500 !important;
6869
}
6970

7071
@mixin perspective-workspace-pro-base {
71-
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo",
72-
"Consolas", "Liberation Mono", monospace;
72+
font-family:
73+
"ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
74+
"Liberation Mono", monospace;
7375
--open-settings-button--content: "expand_more";
7476
--close-settings-button--content: "expand_less";
7577
--close-button--content: "\2715";
@@ -91,7 +93,7 @@ perspective-workspace-menu {
9193

9294
--workspace-tabbar--border: 1px solid var(--inactive--color);
9395
--workspace-tabbar--border-width: 0px 1px 1px 1px;
94-
--workspace-tabbar--border-radius: 0px 0px 6px 6px;
96+
--workspace-tabbar--border-radius: 6px;
9597
--workspace-tabbar--border-color: var(--inactive--color);
9698
--workspace-tabbar-tab--border-width: 1px 1px 0px 1px;
9799

packages/perspective-workspace/src/themes/pro.less

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ perspective-viewer[theme="Pro Light"].workspace-master-widget {
5050
}
5151

5252
@mixin perspective-workspace-pro-base {
53-
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo",
54-
"Consolas", "Liberation Mono", monospace;
53+
font-family:
54+
"ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
55+
"Liberation Mono", monospace;
5556
--open-settings-button--content: "expand_more";
5657
--close-settings-button--content: "expand_less";
5758
--close-button--content: "\2715";
@@ -74,7 +75,7 @@ perspective-viewer[theme="Pro Light"].workspace-master-widget {
7475

7576
--workspace-tabbar--border: 1px solid var(--inactive--color);
7677
--workspace-tabbar--border-width: 0px 1px 1px 1px;
77-
--workspace-tabbar--border-radius: 0px 0px 6px 6px;
78+
--workspace-tabbar--border-radius: 6px;
7879
--workspace-tabbar--border-color: var(--inactive--color);
7980
--workspace-tabbar-tab--border-width: 1px 1px 0px 1px;
8081

@@ -84,8 +85,9 @@ perspective-viewer[theme="Pro Light"].workspace-master-widget {
8485
}
8586

8687
perspective-workspace-menu {
87-
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo",
88-
"Consolas", "Liberation Mono", monospace;
88+
font-family:
89+
"ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
90+
"Liberation Mono", monospace;
8991
font-weight: 300;
9092
color: #161616;
9193
}

0 commit comments

Comments
 (0)