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

fix(notebook-cell): add a slot for drag handle #2233

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions libs/components/src/notebook-cell/notebook-cell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ cv-code-editor {
width: 50px;
}

cv-icon-button {
.dragHandle {
color: var(--cv-theme-on-surface-variant);
cursor: grab;
padding: 0.5rem;
visibility: hidden;
transition: visibility 0.3s ease;

Expand All @@ -91,7 +90,7 @@ cv-code-editor {
}

&:hover {
cv-icon-button {
.dragHandle {
visibility: visible;
}
}
Expand Down
1 change: 1 addition & 0 deletions libs/components/src/notebook-cell/notebook-cell.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const Template = ({
<cv-typography scale="body1">Tables are created and populated using SQL</cv-typography>
</div>`
}
<cv-icon-button slot="drag-handle" icon="drag_indicator" style="padding: 0.5rem"></cv-icon-button>
<div slot="context-menu" style="background-color: white;">
<cv-list activatable>
<cv-list-item>Cut</cv-list-item>
Expand Down
2 changes: 1 addition & 1 deletion libs/components/src/notebook-cell/notebook-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class CovalentNotebookCell extends LitElement {

<div class="timesExecutedWrapper">
<div class="timesExecuted">
<cv-icon-button icon="drag_indicator"></cv-icon-button>
<slot class="dragHandle" name="drag-handle"></slot>
<div class="executionCount">${this.renderExecutionCount()}</div>
</div>
</div>
Expand Down
Loading