bfg-common 1.4.256 → 1.4.258

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.
@@ -24,7 +24,7 @@
24
24
 
25
25
  <common-pages-scheduled-tasks-modals-common-frequency-end
26
26
  v-if="showTimeInterval"
27
- v-model="model.frg_end_time"
27
+ v-model="model"
28
28
  />
29
29
  </div>
30
30
  </template>
@@ -9,23 +9,23 @@
9
9
  :class="selectedFrequencyEndMode === 'on' && 'enabled'"
10
10
  >
11
11
  <template #options>
12
- <div
12
+ <label
13
13
  v-if="selectedFrequencyEndMode === 'on'"
14
- class="datepicker__input-inner"
14
+ for="frequency-end-date"
15
+ class="tooltip tooltip-validation tooltip-xs tooltip-top-left frequency-end-date"
16
+ :class="schedulerEndDateErrorText && 'invalid'"
15
17
  >
16
18
  <input
17
- id="current-date-to-input"
18
- v-model.lazy="currentDateLocal"
19
- data-id="current-date-to-input"
20
- placeholder="mm.dd.yyyy, --:--"
21
- type="text"
19
+ id="frequency-end-date"
20
+ v-model.lazy="modelFrequencyLocal.frg_end_time"
21
+ data-id="frequency-end-date-input"
22
+ type="datetime-local"
22
23
  />
23
- <atoms-datepicker
24
- v-model="calendarDefaultDate"
25
- :lang="language"
26
- @update="onUpdateDateTo"
27
- />
28
- </div>
24
+
25
+ <span class="tooltip-content">
26
+ {{ schedulerEndDateErrorText }}
27
+ </span>
28
+ </label>
29
29
  </template>
30
30
  </common-select-input>
31
31
  </div>
@@ -34,12 +34,15 @@
34
34
  <script lang="ts" setup>
35
35
  import type { UI_I_Localization } from '~/lib/models/interfaces'
36
36
  import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
37
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
37
38
  import { frequencyEndTimeFunc } from '~/components/common/pages/scheduledTasks/modals/common/frequency/end/lib/config/endOptions'
38
39
 
39
- const modelTimeLocal = defineModel<number | null>({ required: true })
40
+ const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
41
+ required: true,
42
+ })
40
43
 
41
44
  const localization = computed<UI_I_Localization>(() => useLocal())
42
- const { $store, $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
45
+ // const { $store, $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
43
46
 
44
47
  const frequencyEndTimeOptions = computed<UI_I_SelectInputItem[]>(() =>
45
48
  frequencyEndTimeFunc(localization.value)
@@ -47,26 +50,18 @@ const frequencyEndTimeOptions = computed<UI_I_SelectInputItem[]>(() =>
47
50
 
48
51
  const selectedFrequencyEndMode = ref<'never' | 'on'>('never')
49
52
 
50
- const calendarDefaultDate = ref<number>(new Date().getTime())
51
- const currentDateLocal = ref<string>('')
52
-
53
- const language = computed<string>(() => $store.getters['main/getInterfaceLang'])
54
- const onUpdateDateTo = (milliseconds: number): void => {
55
- if (!milliseconds) return
56
-
57
- modelTimeLocal.value = milliseconds
58
-
59
- currentDateLocal.value = $formattedDate(
60
- new Date(milliseconds),
61
- 'MM.dd.yyyy, hh:mm'
62
- )
63
- }
64
-
65
- watch(currentDateLocal, (newValue) => {
66
- $isDate(newValue) &&
67
- (calendarDefaultDate.value = modelTimeLocal.value =
68
- $getUnixByDate(newValue))
53
+ const schedulerEndDateErrorText = computed<string>(() => {
54
+ return !modelFrequencyLocal.value.frg_end_time
55
+ ? localization.value.common.fieldRequired
56
+ : ''
69
57
  })
58
+ watch(
59
+ schedulerEndDateErrorText,
60
+ (newValue: string) => {
61
+ modelFrequencyLocal.value.isValid = !!newValue
62
+ },
63
+ { immediate: true }
64
+ )
70
65
  </script>
71
66
 
72
67
  <style lang="scss" scoped>
@@ -92,11 +87,13 @@ watch(currentDateLocal, (newValue) => {
92
87
  max-width: 80px !important;
93
88
  }
94
89
  }
95
- }
96
- .datepicker {
97
- &__input-inner {
98
- @include flex($align: center);
90
+ .frequency-end-date {
99
91
  margin-left: 15px;
100
92
  }
101
93
  }
94
+ .tooltip {
95
+ & > .tooltip-content {
96
+ width: 200px;
97
+ }
98
+ }
102
99
  </style>
@@ -27,7 +27,7 @@
27
27
  <label
28
28
  for="monthly-by-day-field"
29
29
  class="tooltip tooltip-validation tooltip-xs tooltip-top-left"
30
- :class="timeIntervalErrorText && 'invalid'"
30
+ :class="schedulerOnDayErrorText && 'invalid'"
31
31
  >
32
32
  <input
33
33
  id="monthly-by-day-field"
@@ -41,7 +41,7 @@
41
41
  />
42
42
 
43
43
  <span class="tooltip-content">
44
- {{ timeIntervalErrorText }}
44
+ {{ schedulerOnDayErrorText }}
45
45
  </span>
46
46
  </label>
47
47
  </div>
@@ -129,12 +129,19 @@ const isInitTimeIntervalValidation = ref<boolean>(false)
129
129
  const onInitTimeIntervalValidation = (): void => {
130
130
  isInitTimeIntervalValidation.value = true
131
131
  }
132
- const timeIntervalErrorText = computed<string>(() => {
132
+ const schedulerOnDayErrorText = computed<string>(() => {
133
133
  if (!isInitTimeIntervalValidation.value || isDisabledMonthlyDayField.value)
134
134
  return ''
135
135
 
136
- return validateField(localization.value, model.value.frg_monthly_day)
136
+ return validateField(localization.value, model.value.frg_monthly_day, true)
137
137
  })
138
+ watch(
139
+ schedulerOnDayErrorText,
140
+ (newValue: string) => {
141
+ model.value.isValid = !!newValue
142
+ },
143
+ { immediate: true }
144
+ )
138
145
 
139
146
  const schedulerAtOnceErrorText = computed<string>(() => {
140
147
  return !model.value.frg_on_time ? localization.value.common.fieldRequired : ''
@@ -76,4 +76,9 @@ watch(
76
76
  }
77
77
  }
78
78
  }
79
+ .tooltip {
80
+ & > .tooltip-content {
81
+ width: 200px;
82
+ }
83
+ }
79
84
  </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.256",
4
+ "version": "1.4.258",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",