-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wip/mk/whitespace chars monospace font table viz (#10563)
- closes #10247 Partial (default) setting: <img width="885" alt="image" src="https://github.com/user-attachments/assets/18dd7304-a7d6-47cf-8606-11025fa3b7a7"> Full: <img width="892" alt="image" src="https://github.com/user-attachments/assets/e059ea6b-6cc0-47b7-b784-7a5f926eb000"> Off: <img width="944" alt="image" src="https://github.com/user-attachments/assets/5f51c642-9adb-4b92-808f-c98a03a1a69c"> Dropdown: ![10247-dropdown](https://github.com/user-attachments/assets/76a6ebec-8a9c-4d7e-8421-997afed2bf52)
- Loading branch information
1 parent
c6251ad
commit 8af3fd4
Showing
4 changed files
with
243 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<script setup lang="ts"> | ||
import DropdownMenu from '@/components/DropdownMenu.vue' | ||
import MenuButton from '@/components/MenuButton.vue' | ||
import SvgButton from '@/components/SvgButton.vue' | ||
import SvgIcon from '@/components/SvgIcon.vue' | ||
import { ref, watch } from 'vue' | ||
import { TextFormatOptions } from './visualizations/TableVisualization.vue' | ||
const emit = defineEmits<{ | ||
changeFormat: [formatValue: TextFormatOptions] | ||
}>() | ||
const textFormatterSelected = ref(TextFormatOptions.Partial) | ||
watch(textFormatterSelected, (selected) => emit('changeFormat', selected)) | ||
const open = ref(false) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenu v-model:open="open" class="TextFormattingSelector"> | ||
<template #button><SvgIcon name="paragraph" title="Text Display Options" /> </template> | ||
|
||
<template #entries> | ||
<MenuButton | ||
class="full-format" | ||
:title="`Text displayed in monospace font and all whitespace characters displayed as symbols`" | ||
@click="() => emit('changeFormat', TextFormatOptions.On)" | ||
> | ||
<SvgIcon name="paragraph" /> | ||
<div class="title">Full whitespace rendering</div> | ||
</MenuButton> | ||
|
||
<MenuButton | ||
class="partial" | ||
:title="`Text displayed in monospace font, only multiple spaces displayed with ·`" | ||
@click="() => emit('changeFormat', TextFormatOptions.Partial)" | ||
> | ||
<SvgIcon name="paragraph" /> | ||
<div class="title">Partial whitespace rendering</div> | ||
</MenuButton> | ||
|
||
<MenuButton | ||
class="off" | ||
@click="() => emit('changeFormat', TextFormatOptions.Off)" | ||
title="`No formatting applied to text`" | ||
> | ||
<div class="strikethrough"> | ||
<SvgIcon name="paragraph" /> | ||
</div> | ||
<div class="title">No whitespace rendering</div> | ||
</MenuButton> | ||
</template> | ||
</DropdownMenu> | ||
</template> | ||
|
||
<style scoped> | ||
.TextFormattingSelector { | ||
background: var(--color-frame-bg); | ||
border-radius: 16px; | ||
} | ||
:deep(.DropdownMenuContent) { | ||
margin-top: 10px; | ||
padding: 4px; | ||
> * { | ||
display: flex; | ||
padding-left: 8px; | ||
padding-right: 8px; | ||
} | ||
} | ||
.strikethrough { | ||
position: relative; | ||
margin-right: 4px; | ||
} | ||
.strikethrough:before { | ||
position: absolute; | ||
content: ''; | ||
left: 0; | ||
top: 50%; | ||
right: 0; | ||
border-top: 1px solid; | ||
border-color: black; | ||
-webkit-transform: rotate(-20deg); | ||
-moz-transform: rotate(-20deg); | ||
-ms-transform: rotate(-20deg); | ||
-o-transform: rotate(-20deg); | ||
transform: rotate(-20deg); | ||
} | ||
.partial { | ||
stroke: grey; | ||
fill: #808080; | ||
} | ||
.off { | ||
justify-content: flex-start; | ||
} | ||
.full-format { | ||
stroke: black; | ||
fill: #000000; | ||
justify-content: flex-start; | ||
} | ||
.title { | ||
padding-left: 2px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters