Skip to content

Commit b70d5a8

Browse files
authored
Merge pull request #2862 from finos/workspaces-fixes
Remove `workspace-layout-update` event debounce
2 parents 13b8a63 + fbd3e06 commit b70d5a8

24 files changed

Lines changed: 312 additions & 141 deletions

File tree

examples/blocks/src/superstore/index.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@
66
<link rel="stylesheet" crossorigin="anonymous" href="/node_modules/@finos/perspective-viewer/dist/css/pro.css" />
77
<link rel="stylesheet" crossorigin="anonymous" href="/node_modules/@finos/perspective-workspace/dist/css/pro.css" />
88
<style>
9-
body {
10-
display: flex;
11-
flex-direction: column;
9+
perspective-workspace {
1210
position: absolute;
1311
top: 0;
12+
bottom: 0;
1413
left: 0;
1514
right: 0;
16-
bottom: 0;
17-
margin: 0;
18-
padding: 0;
19-
overflow: hidden;
2015
}
2116
</style>
2217
</head>

packages/perspective-viewer-datagrid/src/less/row-hover.less

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@ regular-table {
2020
tr:hover:after {
2121
border-color: var(--rt-hover--border-color, #c5c9d080) !important;
2222
background-color: transparent;
23-
box-shadow: 0px 1px 0px var(--rt-hover--border-color, #c5c9d080),
24-
0px 3px 0px rgba(0, 0, 0, 0.05), 0px 5px 0px rgba(0, 0, 0, 0.01);
23+
box-shadow: 0px 1px 0px var(--rt-hover--border-color, #c5c9d080);
2524

2625
&.psp-menu-open {
2726
box-shadow: inset -2px 0px 0px var(--icon--color),
2827
inset 2px 0px 0px var(--icon--color),
29-
0px 1px 0px var(--rt-hover--border-color, #c5c9d080),
30-
0px 3px 0px rgba(0, 0, 0, 0.05),
31-
0px 5px 0px rgba(0, 0, 0, 0.01);
28+
0px 1px 0px var(--rt-hover--border-color, #c5c9d080);
3229
}
3330
}
3431

@@ -37,8 +34,7 @@ regular-table {
3734
box-shadow: inset -2px 0px 0px var(--icon--color),
3835
inset 2px 0px 0px var(--icon--color),
3936
inset 0px -2px 0px var(--icon--color),
40-
0px 1px 0px var(--rt-hover--border-color, #c5c9d080),
41-
0px 3px 0px rgba(0, 0, 0, 0.05), 0px 5px 0px rgba(0, 0, 0, 0.01);
37+
0px 1px 0px var(--rt-hover--border-color, #c5c9d080);
4238
}
4339

4440
tr:hover

packages/perspective-workspace/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ async function build_all() {
143143
pro_dark.compile().get("output.css")
144144
);
145145

146+
await Promise.all(BUILD.map(build)).catch(() => process.exit(1));
147+
146148
try {
147149
await $`npx tsc --project ./tsconfig.json`.stdio(
148150
"inherit",
@@ -152,8 +154,6 @@ async function build_all() {
152154
} catch (e) {
153155
process.exit(1);
154156
}
155-
156-
await Promise.all(BUILD.map(build)).catch(() => process.exit(1));
157157
}
158158

159159
build_all();

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
@import "@lumino/widgets/style/menu.css";
1414

15+
:host {
16+
position: absolute;
17+
}
18+
1519
.lm-Menu {
1620
font-size: 12px;
1721
padding: 8px;

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
}
6565
}
6666

67-
perspective-viewer {
67+
::slotted(perspective-viewer) {
6868
flex: 1;
6969
position: relative;
7070
display: block;
@@ -76,10 +76,11 @@ perspective-viewer {
7676
overflow: visible !important;
7777
}
7878

79-
.lm-mod-override-cursor {
79+
:host-context(.lm-mod-override-cursor) {
8080
cursor: grabbing !important;
8181
}
8282

83-
.lm-mod-override-cursor perspective-viewer > * {
84-
pointer-events: none;
83+
:host-context(.lm-mod-override-cursor) ::slotted(perspective-viewer),
84+
.context-menu ::slotted(perspective-viewer) {
85+
--override-content-pointer-events: none;
8586
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@
2121
@import "@lumino/widgets/style/tabbar.css";
2222
@import "@lumino/widgets/style/tabpanel.css";
2323

24+
@import "./injected.less";
25+
2426
:host {
2527
@import "./tabbar.less";
2628
@import "./dockpanel.less";
2729
@import "./widget.less";
2830

2931
background-color: hsl(210deg 18% 90%);
3032

31-
width: 100%;
32-
height: 100%;
33+
// width: 100%;
34+
// height: 100%;
3335

3436
.workspace {
3537
width: 100%;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ perspective-indicator[theme="Pro Dark"] {
2222
--theme-name: "Pro Dark";
2323
}
2424

25-
.lm-Menu {
25+
perspective-workspace-menu {
2626
@include perspective-viewer-pro-dark--colors;
2727
}
2828

@@ -62,7 +62,7 @@ perspective-viewer[theme="Pro Dark"].workspace-master-widget {
6262
--plugin--background: @grey800;
6363
}
6464

65-
.lm-Menu {
65+
perspective-workspace-menu {
6666
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo",
6767
"Consolas", "Liberation Mono", monospace;
6868
font-weight: 300;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ perspective-workspace {
2424
background-color: #dadada;
2525
}
2626

27-
.lm-Menu {
27+
perspective-workspace-menu {
2828
@include perspective-viewer-pro--colors;
2929
background-color: #ffffff;
3030
}
@@ -84,7 +84,7 @@ perspective-viewer[theme="Pro Light"].workspace-master-widget {
8484
--workspace-tabbar-tab--border-width: 1px 1px 0px 1px;
8585
}
8686

87-
.lm-Menu {
87+
perspective-workspace-menu {
8888
font-family: "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo",
8989
"Consolas", "Liberation Mono", monospace;
9090
font-weight: 300;

packages/perspective-workspace/src/ts/perspective-workspace.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
import { bindTemplate, CustomElementProto } from "./utils/custom_elements";
2828
import style from "../../build/css/workspace.css";
2929
import template from "../html/workspace.html";
30-
import injectedStyles from "../../build/css/injected.css";
3130

3231
/**
3332
* A Custom Element for coordinating a set of `<perspective-viewer>` light DOM
@@ -52,13 +51,10 @@ import injectedStyles from "../../build/css/injected.css";
5251
* name="View One"
5352
* table="superstore">
5453
* </perspective-viewer>
55-
*
5654
* <perspective-viewer
57-
* row-pivots='["State"]'
5855
* name="View Two"
5956
* table="superstore">
6057
* </perspective-viewer>
61-
*
6258
* </perspective-workspace>
6359
* ```
6460
*
@@ -295,11 +291,6 @@ export class HTMLPerspectiveWorkspaceElement extends HTMLElement {
295291
}
296292
}
297293

298-
const _injectStyle = document.createElement("style");
299-
_injectStyle.toggleAttribute("injected", true);
300-
_injectStyle.innerHTML = injectedStyles;
301-
document.head.appendChild(_injectStyle);
302-
303294
bindTemplate(
304295
template,
305296
style

packages/perspective-workspace/src/ts/utils/custom_elements.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,9 @@ export function registerElement(
5151
`<style>${styleString.toString()}</style>` + template.innerHTML;
5252
}
5353

54-
template.innerHTML =
55-
`<style id="psp_styles" scope="${template.getAttribute(
56-
"id"
57-
)}">test{}</style>` + template.innerHTML;
58-
5954
const _perspective_element = class extends proto {
60-
_initialized: boolean;
61-
_initializing: boolean;
55+
private _initialized: boolean;
56+
private _initializing: boolean;
6257

6358
constructor() {
6459
super();

0 commit comments

Comments
 (0)