-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PB-1297: make position of text labels configurable
- Loading branch information
Showing
7 changed files
with
188 additions
and
9 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
48 changes: 48 additions & 0 deletions
48
src/modules/infobox/components/styling/DrawingStylePositionSelector.vue
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,48 @@ | ||
<template> | ||
<div> | ||
<label class="form-label" for="drawing-style-text-placement-selector"> | ||
{{ i18n.t('modify_text_placement_label') }} | ||
</label> | ||
<DropdownButton | ||
id="drawing-style-text-placement-selector" | ||
data-cy="drawing-style-placement-selector" | ||
:current-value="currentPlacement" | ||
:title="placementLabel" | ||
:items="dropdownItems" | ||
@select:item="onPlacementSelect" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed, toRefs } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import DropdownButton, { DropdownItem } from '@/utils/components/DropdownButton.vue' | ||
import { allStylingTextPlacements } from '@/utils/featureStyleUtils' | ||
const props = defineProps({ | ||
currentPlacement: { | ||
type: String, | ||
required: true, | ||
}, | ||
}) | ||
const { currentPlacement } = toRefs(props) | ||
const emit = defineEmits(['change']) | ||
const i18n = useI18n() | ||
const placements = allStylingTextPlacements | ||
const placementLabel = computed(() => i18n.t(currentPlacement.value) ?? null) | ||
const dropdownItems = computed(() => | ||
placements.map((placement) => new DropdownItem(placement, i18n.t(placement), placement)) | ||
) | ||
const onPlacementSelect = (dropdownItem) => { | ||
emit('change', dropdownItem.value) | ||
} | ||
</script> |
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
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