@it-enterprise/forcebpm-ui-kit 1.0.2-beta.27 → 1.0.2-beta.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -26,6 +26,7 @@ export { default as FDatePicker } from './src/f-date-picker/FDatePicker.vue'
26
26
  export { default as FMenuDatePicker } from './src/f-date-picker/FMenuDatePicker.vue'
27
27
  export { default as FTextFieldDate } from './src/f-date-picker/FTextFieldDate.vue'
28
28
  export { default as FUserGroupPicker } from './src/FUserGroupPicker.vue'
29
+ export { default as FLangSwitcher } from './src/FLangSwitcher.vue'
29
30
 
30
31
  // Utils
31
32
  export { hexToRGBA, createRadialGradient } from './src/utils/color.js'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@it-enterprise/forcebpm-ui-kit",
4
- "version": "1.0.2-beta.27",
4
+ "version": "1.0.2-beta.28",
5
5
  "description": "FBPM UI Kit",
6
6
  "author": "it-enterprise",
7
7
  "license": "MIT",
@@ -0,0 +1,47 @@
1
+ <script setup>
2
+ // FLangSwitcher
3
+ import { computed } from 'vue'
4
+ import { useI18n } from 'vue-i18n'
5
+
6
+ defineProps({
7
+ background: {
8
+ type: String,
9
+ default: 'transparent'
10
+ },
11
+ color: {
12
+ type: String,
13
+ default: 'text'
14
+ }
15
+ })
16
+
17
+ const emit = defineEmits(['change'])
18
+
19
+ const { locale } = useI18n()
20
+
21
+ const locales = [
22
+ { code: 'uk', name: 'Українська', flag: 'UA' },
23
+ { code: 'ru', name: 'Русский', flag: 'RU' },
24
+ { code: 'en', name: 'English', flag: 'EN' }
25
+ ]
26
+
27
+ const lang = computed(() => {
28
+ return locales.find(i => i.code === locale.value) || locales[0]
29
+ })
30
+ </script>
31
+
32
+ <template>
33
+ <v-menu offset="0, -6" location="bottom right" content-class="f-lang-switcher-content">
34
+ <template #activator="{ props }">
35
+ <v-btn v-bind="props" variant="text" height="32px" width="54px" class="pa-0 f-lang-switcher-btn" :class="`bg-${background}`" :color="color">
36
+ {{ lang.flag }}
37
+ <FIcon icon="chevron-down" :color="color" size="0.9em" />
38
+ </v-btn>
39
+ </template>
40
+
41
+ <v-list>
42
+ <v-list-item v-for="item in locales" :key="item.code" @click="emit('change', item.code)">
43
+ <v-list-item-title :class="item.code === lang.code ? 'text-primary' : `text-${color}`"> {{ item.flag }} ({{ item.name }}) </v-list-item-title>
44
+ </v-list-item>
45
+ </v-list>
46
+ </v-menu>
47
+ </template>