Skip to content

Commit 8a70956

Browse files
committed
KDS-547: Tokenization of Python scripting – Temporary Values Panel
1 parent 6be6e8f commit 8a70956

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

org.knime.python3.scripting.nodes/js-src/src/components/PythonWorkspace.vue

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { type Ref, onMounted, onUnmounted, ref } from "vue";
33
import { useDebounceFn, useResizeObserver } from "@vueuse/core";
44
5-
import { Button } from "@knime/components";
5+
import { KdsButton } from "@knime/kds-components";
66
77
import {
88
getPythonInitialData,
@@ -18,11 +18,12 @@ import PythonWorkspaceHeader, {
1818
const resizeContainer = ref<HTMLElement | null>(null);
1919
const totalWidth: Ref<number> = ref(0);
2020
const headerWidths = ref<ColumnSizes>([100, 100, 100]);
21+
const paddingAroundTable = 8;
2122
2223
const useTotalWidth = () => {
2324
const rootResizeCallback = useDebounceFn((entries) => {
2425
const rect = entries[0].contentRect;
25-
totalWidth.value = rect.width;
26+
totalWidth.value = rect.width - paddingAroundTable * 2;
2627
});
2728
const resizeObserver = useResizeObserver(resizeContainer, rootResizeCallback);
2829
@@ -75,15 +76,16 @@ onMounted(() => {
7576
</table>
7677
</div>
7778
<div class="controls">
78-
<Button
79+
<KdsButton
7980
class="reset-button"
80-
:with-border="false"
81-
compact
81+
label="Reset Values"
82+
leading-icon="reset-all"
83+
variant="transparent"
8284
:disabled="!resetButtonEnabled"
8385
@click="resetWorkspace"
8486
>
8587
Reset values
86-
</Button>
88+
</KdsButton>
8789
</div>
8890
</div>
8991
</template>
@@ -94,19 +96,20 @@ onMounted(() => {
9496
flex-direction: column;
9597
justify-content: space-between;
9698
height: 100%;
97-
background-color: var(--knime-gray-ultra-light);
9899
}
99100
100101
.workspace {
101102
--controls-height: 40px;
102103
103104
position: relative;
104105
min-width: 120px;
106+
padding: var(--kds-spacing-container-0-5x) var(--kds-spacing-container-0-5x) 0 var(--kds-spacing-container-0-5x);
105107
margin-top: 0;
106108
overflow: hidden auto;
107109
108110
& table {
109111
flex: 1;
112+
max-width: 100%;
110113
height: calc(100% - var(--controls-height));
111114
font-family: "Roboto Mono", sans-serif;
112115
font-size: 13px;
@@ -121,17 +124,12 @@ onMounted(() => {
121124
display: flex;
122125
flex-direction: row-reverse;
123126
place-content: center space-between;
124-
min-height: var(--controls-height);
125-
max-height: var(--controls-height);
127+
align-items: center;
128+
height: var(--kds-dimension-component-height-2-25x);
129+
padding-right: var(--kds-spacing-container-0-25x);
130+
padding-left: var(--kds-spacing-container-0-25x);
126131
overflow: hidden;
127-
border-top: 1px solid var(--knime-silver-sand);
128-
}
129-
130-
.reset-button {
131-
height: 30px;
132-
margin-top: 5px;
133-
margin-right: 10px;
134-
margin-bottom: 5px;
132+
border-top: var(--kds-border-base-subtle);
135133
}
136134
</style>
137135
@/python-initial-data-service

org.knime.python3.scripting.nodes/js-src/src/components/PythonWorkspaceBody.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ tbody {
5252
& tr {
5353
display: flex;
5454
color: var(--knime-dove-gray);
55-
border-bottom: 1px solid var(--knime-porcelain);
5655
5756
&:hover {
5857
color: var(--knime-masala);
5958
cursor: pointer;
59+
background-color: var(--kds-color-background-neutral-hover);
60+
border-radius: var(--kds-border-radius-container-0-25x);
6061
}
6162
6263
& td {
64+
height: var(--kds-dimension-component-height-1-5x);
65+
padding-right: var(--kds-spacing-container-0-25x);
66+
padding-left: var(--kds-spacing-container-0-25x);
6367
overflow: hidden;
6468
text-overflow: ellipsis;
6569
white-space: nowrap;
@@ -69,6 +73,8 @@ tbody {
6973
margin: 6px;
7074
overflow: hidden;
7175
text-overflow: ellipsis;
76+
font: var(--kds-font-base-interactive-small);
77+
color: var(--kds-color-text-and-icon-neutral);
7278
}
7379
}
7480
}

org.knime.python3.scripting.nodes/js-src/src/components/PythonWorkspaceHeader.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,20 @@ const onPointerMove = (event: { clientX: number }) => {
204204

205205
<style lang="postcss" scoped>
206206
thead {
207-
position: sticky;
208-
top: 0;
209-
width: calc(100% - 15px);
207+
display: contents;
210208
font-weight: 500;
211209
line-height: 15px;
212210
text-align: left;
213211
letter-spacing: 0;
214-
table-layout: fixed;
215-
background-color: var(--knime-porcelain);
212+
border-bottom: var(--kds-border-base-subtle);
216213
217214
& tr {
215+
position: sticky;
216+
top: 0;
218217
display: flex;
218+
height: var(--kds-spacing-container-1-5x);
219+
padding-right: var(--kds-spacing-container-0-25x);
220+
padding-left: var(--kds-spacing-container-0-25x);
219221
220222
& th {
221223
display: flex;
@@ -229,6 +231,8 @@ thead {
229231
margin: 0 5px;
230232
overflow: hidden;
231233
text-overflow: ellipsis;
234+
font: var(--kds-font-base-interactive-small-strong);
235+
color: var(--kds-color-text-and-icon-neutral);
232236
}
233237
234238
& .drag-handle {

0 commit comments

Comments
 (0)