forked from simonwep/ocular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): synchronize both locale and currency with vue-i18n
add new state version to store both the locale and currency add separate buttons to change the locale / currency add li18nt to lint localization files reformat localization files simonwep#1
- Loading branch information
Showing
34 changed files
with
658 additions
and
412 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"quiet": true, | ||
"rules": { | ||
"prettified": [ | ||
"error", | ||
{ | ||
"indent": 2 | ||
} | ||
], | ||
"conflicts": "error", | ||
"naming": "error", | ||
"duplicates": "off" | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
82 changes: 82 additions & 0 deletions
82
src/app/components/base/context-menu/ContextMenuButton.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,82 @@ | ||
<template> | ||
<li :class="$style.item"> | ||
<button :class="classes" @click="emit('click', $event)"> | ||
<Icon v-if="icon" :icon="icon" :class="$style.icon"></Icon> | ||
<span>{{ text }}</span> | ||
</button> | ||
</li> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, useCssModule } from 'vue'; | ||
import { ClassNames } from '@utils'; | ||
import Icon from '@components/base/icon/Icon.vue'; | ||
import { AppIcon } from '@components/base/icon/Icon.types'; | ||
const emit = defineEmits<{ | ||
(e: 'click', evt: MouseEvent): void; | ||
}>(); | ||
const props = withDefaults( | ||
defineProps<{ | ||
class?: ClassNames; | ||
text: string | number; | ||
icon?: AppIcon; | ||
padIcon?: boolean; | ||
highlight?: boolean; | ||
}>(), | ||
{ | ||
highlight: false, | ||
padIcon: false | ||
} | ||
); | ||
const styles = useCssModule(); | ||
const classes = computed(() => [ | ||
props.class, | ||
styles.btn, | ||
{ | ||
[styles.highlight]: props.highlight, | ||
[styles.padIcon]: props.padIcon && !props.icon | ||
} | ||
]); | ||
</script> | ||
|
||
<style lang="scss" module> | ||
.item { | ||
display: flex; | ||
width: 100%; | ||
} | ||
.btn { | ||
all: unset; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
cursor: pointer; | ||
font-size: var(--font-size-xs); | ||
padding: 6px 12px; | ||
transition: color var(--transition-s), background var(--transition-s); | ||
color: var(--context-menu-item-color); | ||
position: relative; | ||
.icon { | ||
width: 12px; | ||
height: 12px; | ||
margin-right: 8px; | ||
} | ||
&.padIcon { | ||
margin-left: 20px; | ||
} | ||
&:hover, | ||
&.highlight { | ||
color: var(--context-menu-item-color-hover); | ||
} | ||
&:hover { | ||
background: var(--context-menu-item-background-hover); | ||
} | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
export type ContextMenuOptionId = number; | ||
import { AppIcon } from '@components/base/icon/Icon.types'; | ||
|
||
export type ContextMenuOptionId = number | string; | ||
|
||
export interface ContextMenuOption { | ||
id: ContextMenuOptionId; | ||
icon?: AppIcon; | ||
label?: string; | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.