bfg-common 1.4.785 → 1.4.786

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.
@@ -1202,7 +1202,7 @@
1202
1202
  "relatedObjects": "Связанные Объекты",
1203
1203
  "releaseDate": "Дата выпуска",
1204
1204
  "remoteConsole": "Удаленная консоль {0}",
1205
- "remoteConsoleDescription": "Используйте {trademark} Remote Console (VMRC) для подключения к клиентским устройствам и доступа к расширенным функциям клавиатуры.\nЕсли у вас уже установлена {trademark} Remote Console, она запустится автоматически, когда вы нажмете кнопку Launch Remote Console. Если нет, вы можете использовать ссылку ниже, чтобы загрузить его.",
1205
+ "remoteConsoleDescription": "Используйте {trademark} Remote Console (VMRC) для подключения к клиентским устройствам и доступа к расширенным функциям клавиатуры.\nЕсли у Вас уже установлена {trademark} Remote Console, она запустится автоматически, когда Вы нажмете кнопку Launch Remote Console. Если нет, Вы можете использовать ссылку ниже, чтобы загрузить его.",
1206
1206
  "remoteConsoleOptions": "Параметры удаленной консоли",
1207
1207
  "remoteConsoleType": "Тип удаленной консоли",
1208
1208
  "remoteConsoleVmrc": "Удаленная консоль {trademark} (VMRC)",
@@ -17,16 +17,32 @@
17
17
  name="search"
18
18
  />
19
19
  </div>
20
- <input
21
- :id="`${props.testId}-search-input`"
22
- v-model.trim="search"
23
- :data-id="`${props.testId}-search-input`"
24
- type="text"
25
- class="search-input"
26
- autocomplete="off"
27
- :placeholder="props.placeholder"
28
- @input="onSearch"
29
- />
20
+
21
+ <div class="clr-error">
22
+ <div class="form-group__input">
23
+ <input
24
+ :id="`${props.testId}-search-input`"
25
+ v-model.trim="search"
26
+ :data-id="`${props.testId}-search-input`"
27
+ type="text"
28
+ class="search-input"
29
+ :class="fieldErrorText && 'clr-input'"
30
+ autocomplete="off"
31
+ :placeholder="props.placeholder"
32
+ @blur="onInitValidation"
33
+ @input="onSearch"
34
+ />
35
+ <div v-show="fieldErrorText" class="form-validate">
36
+ <atoms-the-icon class="is-error tooltip-trigger" name="info" />
37
+ </div>
38
+ </div>
39
+ <div
40
+ v-show="fieldErrorText"
41
+ class="form-group__input-error clr-subtext"
42
+ >
43
+ {{ fieldErrorText }}
44
+ </div>
45
+ </div>
30
46
  </div>
31
47
  <div
32
48
  v-show="isShow"
@@ -50,6 +66,8 @@
50
66
  </template>
51
67
 
52
68
  <script setup lang="ts">
69
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
70
+
53
71
  const props = withDefaults(
54
72
  defineProps<{
55
73
  placeholder: string
@@ -57,23 +75,27 @@ const props = withDefaults(
57
75
  loading?: boolean
58
76
  testId?: string
59
77
  ms?: number
78
+ showValidation?: boolean
60
79
  }>(),
61
80
  {
62
81
  testId: 'ui-autocomplete',
63
82
  ms: 500,
64
83
  loading: false,
84
+ showValidation: false,
65
85
  }
66
86
  )
67
-
68
87
  const emits = defineEmits<{
69
88
  (event: 'search', value: string): void
70
89
  (event: 'select', value: string): void
71
90
  }>()
72
91
 
92
+ const localization = computed<UI_I_Localization>(() => useLocal())
93
+
73
94
  const search = ref<string>('')
74
95
 
75
96
  let timer: NodeJS.Timeout
76
97
  const onSearch = (): void => {
98
+ onInitValidation()
77
99
  clearTimeout(timer)
78
100
  timer = setTimeout(
79
101
  (value) => {
@@ -83,7 +105,16 @@ const onSearch = (): void => {
83
105
  search.value
84
106
  )
85
107
  }
108
+ const isInitFieldValidation = ref<boolean>(false)
109
+ const onInitValidation = (): void => {
110
+ isInitFieldValidation.value = true
111
+ }
112
+ const fieldErrorText = computed<string>(() => {
113
+ if (!isInitFieldValidation.value) return ''
86
114
 
115
+ if (!search.value && props.showValidation)
116
+ return localization.value.common.fieldRequired
117
+ })
87
118
  const items = computed<any[]>(() => {
88
119
  return [...props.items].map((text) => {
89
120
  const term = search.value.toLowerCase()
@@ -155,6 +186,13 @@ watch(isHide, (newValue) => {
155
186
  window.removeEventListener('keydown', onKeyDown, true)
156
187
  }
157
188
  })
189
+ watch(
190
+ () => props.showValidation,
191
+ (newValue: boolean) => {
192
+ isInitFieldValidation.value = newValue
193
+ },
194
+ { immediate: true }
195
+ )
158
196
  </script>
159
197
 
160
198
  <style scoped lang="scss">
@@ -239,5 +277,22 @@ watch(isHide, (newValue) => {
239
277
  }
240
278
  }
241
279
  }
280
+ .form-group {
281
+ &__input {
282
+ display: flex;
283
+ .form-validate {
284
+ svg {
285
+ width: 24px;
286
+ height: 24px;
287
+ }
288
+ }
289
+ input {
290
+ width: 100%;
291
+ }
292
+ &-error {
293
+ margin-top: 0;
294
+ }
295
+ }
296
+ }
242
297
  }
243
298
  </style>
@@ -25,6 +25,7 @@ import type {
25
25
  } from '~/lib/models/table/interfaces'
26
26
  import type { UI_I_Task } from '~/lib/models/store/tasks/interfaces'
27
27
  import type { UI_T_Project } from '~/lib/models/types'
28
+ import { useOnline } from '@vueuse/core'
28
29
 
29
30
  const localization = computed<UI_I_Localization>(() => useLocal())
30
31
  const { $store }: any = useNuxtApp()
@@ -74,6 +75,13 @@ const isLoading = computed<boolean>(() =>
74
75
  $store.getters['tasks/getLoading']('tasks')
75
76
  )
76
77
 
78
+ const isOnline = useOnline()
79
+ watch(isOnline, (newValue: boolean) => {
80
+ if (newValue) {
81
+ getTasks()
82
+ }
83
+ })
84
+
77
85
  onUnmounted(() => {
78
86
  pauseGlobalRefresh()
79
87
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.785",
4
+ "version": "1.4.786",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",