@it-enterprise/forcebpm-ui-kit 1.0.2-beta.26 → 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.26",
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>
@@ -432,10 +432,6 @@ const selectMenuItem = id => {
432
432
  selectedMenuId.value = selectedMenuId.value === id ? null : id
433
433
  }
434
434
 
435
- const open = () => {
436
- state.value = true
437
- }
438
-
439
435
  const close = () => {
440
436
  state.value = false
441
437
  search.value = ''
@@ -443,10 +439,19 @@ const close = () => {
443
439
  }
444
440
 
445
441
  const selectHandler = () => {
446
- if (props.returnObject) {
447
- modelValue.value = selectedItems.value
442
+ if (props.multiple) {
443
+ if (props.returnObject) {
444
+ modelValue.value = selectedItems.value
445
+ } else {
446
+ modelValue.value = selectedItems.value.map(item => item[props.itemValue])
447
+ }
448
448
  } else {
449
- modelValue.value = selectedItems.value.map(item => item[props.itemValue])
449
+ const selectedItem = selectedItems.value[0]
450
+ if (props.returnObject) {
451
+ modelValue.value = selectedItem
452
+ } else {
453
+ modelValue.value = selectedItem[props.itemValue]
454
+ }
450
455
  }
451
456
 
452
457
  state.value = false
@@ -459,11 +464,11 @@ watch(tab, () => {
459
464
 
460
465
  // Sync with external modelValue changes
461
466
  watch(state, newState => {
462
- if (newState && modelValue.value) {
463
- // Reset
464
- selectedIds.value = new Set()
465
- selectedGroupIds.value = new Set()
467
+ // Reset
468
+ selectedIds.value = new Set()
469
+ selectedGroupIds.value = new Set()
466
470
 
471
+ if (newState && modelValue.value) {
467
472
  // Populate from modelValue
468
473
  const values = Array.isArray(modelValue.value) ? modelValue.value : [modelValue.value]
469
474
  for (const val of values) {
@@ -508,7 +513,6 @@ watch(state, newState => {
508
513
  no-space
509
514
  is-search
510
515
  :title="$t('user.executors')"
511
- @open="open"
512
516
  @close="close"
513
517
  >
514
518
  <div class="user-group-picker">
@@ -46,6 +46,10 @@
46
46
  .v-label {
47
47
  opacity: 1;
48
48
  color: rgb(var(--v-theme-text));
49
+ font-size: 0.95rem;
50
+ &.v-field-label--floating {
51
+ font-size: 0.7rem;
52
+ }
49
53
  }
50
54
 
51
55
  &.v-field--variant-outlined {
@@ -73,7 +77,7 @@
73
77
  padding-top: 16px;
74
78
  padding-bottom: 10px;
75
79
  padding-inline: 12px 12px;
76
- min-height: auto;
80
+ min-height: 20px;
77
81
  font-size: 0.95em;
78
82
  line-height: 1em;
79
83
  color: rgb(var(--v-theme-subTitle));
@@ -84,6 +88,15 @@
84
88
  border-radius: 5.8px !important;
85
89
  }
86
90
  }
91
+ input {
92
+ min-height: 20px;
93
+ &:is(:-webkit-autofill, :autofill) {
94
+ -webkit-text-fill-color: rgb(var(--v-theme-subTitle)) !important;
95
+ -webkit-box-shadow: 0 0 0 1000px rgb(var(--v-theme-background)) inset !important;
96
+ background-color: rgb(var(--v-theme-background)) !important;
97
+ border-radius: 5.8px !important;
98
+ }
99
+ }
87
100
  input::placeholder {
88
101
  font-size: 0.9em;
89
102
  opacity: 0.9;
@@ -185,8 +198,9 @@
185
198
  }
186
199
  }
187
200
  .v-autocomplete__selection {
201
+ height: 20px;
188
202
  .f-chip.v-chip {
189
- --v-chip-height: 22px;
203
+ --v-chip-height: 20px;
190
204
  padding: 0;
191
205
  border-radius: 16.8px;
192
206
  font-size: 0.75em;