bfg-common 1.4.253 → 1.4.255

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.
@@ -2208,6 +2208,7 @@
2208
2208
  "to2": "К",
2209
2209
  "resetToDefault": "Скінуць да стандартных",
2210
2210
  "theValueTooLarge": "Значэнне можа быць занадта вялікім",
2211
+ "theValueTooSmall": "Значэнне можа быць занадта малым",
2211
2212
  "closed": "Закрыты"
2212
2213
  },
2213
2214
  "auth": {
@@ -2212,6 +2212,7 @@
2212
2212
  "to2": "To",
2213
2213
  "resetToDefault": "Reset To Default",
2214
2214
  "theValueTooLarge": "The value may be too large",
2215
+ "theValueTooSmall": "The value may be too small",
2215
2216
  "closed": "Closed"
2216
2217
  },
2217
2218
  "auth": {
@@ -2212,6 +2212,7 @@
2212
2212
  "to2": "Դեպի",
2213
2213
  "resetToDefault": "Վերականգնել լռելյայնին",
2214
2214
  "theValueTooLarge": "Արժեքը կարող է չափազանց մեծ լինել",
2215
+ "theValueTooSmall": "Արժեքը կարող է չափազանց փոքր լինել",
2215
2216
  "closed": "Փակված է"
2216
2217
  },
2217
2218
  "auth": {
@@ -2211,6 +2211,7 @@
2211
2211
  "to2": "К",
2212
2212
  "resetToDefault": "Әдепкіге қайта орнату",
2213
2213
  "theValueTooLarge": "Мән тым үлкен болуы мүмкін",
2214
+ "theValueTooSmall": "Мән тым аз болуы мүмкін",
2214
2215
  "closed": "Жабық"
2215
2216
  },
2216
2217
  "auth": {
@@ -2214,6 +2214,7 @@
2214
2214
  "to2": "До",
2215
2215
  "resetToDefault": "Сбросить настройки по умолчанию",
2216
2216
  "theValueTooLarge": "Значение может быть слишком большим",
2217
+ "theValueTooSmall": "Значение может быть слишком маленьким",
2217
2218
  "closed": "Закрыто"
2218
2219
  },
2219
2220
  "auth": {
@@ -2210,6 +2210,7 @@
2210
2210
  "to2": "到",
2211
2211
  "resetToDefault": "重置为默认值",
2212
2212
  "theValueTooLarge": "该值可能太大",
2213
+ "theValueTooSmall": "该值可能太小",
2213
2214
  "closed": "关闭"
2214
2215
  },
2215
2216
  "auth": {
@@ -7,7 +7,7 @@
7
7
 
8
8
  <common-pages-scheduled-tasks-modals-common-frequency-interval
9
9
  v-if="showTimeInterval"
10
- v-model="model.frg_interval"
10
+ v-model="model"
11
11
  :type="props.type"
12
12
  />
13
13
 
@@ -11,7 +11,7 @@
11
11
  >
12
12
  <input
13
13
  id="frequency-time-interval"
14
- v-model="modelIntervalLocal"
14
+ v-model="modelFrequencyLocal.frg_interval"
15
15
  data-id="frequency-time-interval-input"
16
16
  type="text"
17
17
  @input="onInitTimeIntervalValidation"
@@ -31,6 +31,7 @@
31
31
 
32
32
  <script lang="ts" setup>
33
33
  import type { UI_I_Localization } from '~/lib/models/interfaces'
34
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
34
35
  import {
35
36
  defineIntervalSuffixLabelFunc,
36
37
  validateField,
@@ -39,7 +40,9 @@ import {
39
40
  const props = defineProps<{
40
41
  type: string
41
42
  }>()
42
- const modelIntervalLocal = defineModel<string>({ required: true })
43
+ const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
44
+ required: true,
45
+ })
43
46
 
44
47
  const localization = computed<UI_I_Localization>(() => useLocal())
45
48
 
@@ -51,8 +54,18 @@ const onInitTimeIntervalValidation = (): void => {
51
54
  const timeIntervalErrorText = computed<string>(() => {
52
55
  if (!isInitTimeIntervalValidation.value) return ''
53
56
 
54
- return validateField(localization.value, modelIntervalLocal.value)
57
+ return validateField(
58
+ localization.value,
59
+ modelFrequencyLocal.value.frg_interval
60
+ )
55
61
  })
62
+ watch(
63
+ timeIntervalErrorText,
64
+ (newValue: string) => {
65
+ modelFrequencyLocal.value.isValid = !!newValue
66
+ },
67
+ { immediate: true }
68
+ )
56
69
 
57
70
  const intervalSuffixLabel = computed(() => {
58
71
  const lang = useLocalStorage('lang')
@@ -60,7 +73,7 @@ const intervalSuffixLabel = computed(() => {
60
73
  return defineIntervalSuffixLabelFunc(
61
74
  localization.value,
62
75
  props.type,
63
- modelIntervalLocal.value,
76
+ modelFrequencyLocal.value.frg_interval,
64
77
  lang
65
78
  )
66
79
  })
@@ -60,13 +60,19 @@ const getCorrectRuForm = (value: number | string, type: string): string => {
60
60
 
61
61
  export const validateField = (
62
62
  localization: UI_I_Localization,
63
- value: string
63
+ value: string,
64
+ checkZero: boolean = false
64
65
  ): string => {
65
66
  // Если поле пустое
66
67
  if (!value) {
67
68
  return localization.common.fieldRequired
68
69
  }
69
70
  // Если значение больше 2 символов
71
+
72
+ if (checkZero && value === '0') {
73
+ return localization.common.theValueTooSmall
74
+ }
75
+
70
76
  if (value.length > 3) {
71
77
  return localization.common.theValueTooLarge
72
78
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.253",
4
+ "version": "1.4.255",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",