bfg-common 1.4.256 → 1.4.257

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"
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>
@@ -93,10 +88,9 @@ watch(currentDateLocal, (newValue) => {
93
88
  }
94
89
  }
95
90
  }
96
- .datepicker {
97
- &__input-inner {
98
- @include flex($align: center);
99
- margin-left: 15px;
91
+ .tooltip {
92
+ & > .tooltip-content {
93
+ width: 200px;
100
94
  }
101
95
  }
102
96
  </style>
@@ -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.257",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",