bfg-common 1.4.255 → 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.
@@ -19,12 +19,12 @@
19
19
 
20
20
  <common-pages-scheduled-tasks-modals-common-frequency-start-on
21
21
  v-if="showTimeInterval"
22
- v-model="model.frg_start_on_time"
22
+ v-model="model"
23
23
  />
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>
@@ -56,7 +56,8 @@ const timeIntervalErrorText = computed<string>(() => {
56
56
 
57
57
  return validateField(
58
58
  localization.value,
59
- modelFrequencyLocal.value.frg_interval
59
+ modelFrequencyLocal.value.frg_interval,
60
+ true
60
61
  )
61
62
  })
62
63
  watch(
@@ -4,48 +4,62 @@
4
4
  {{ localization.scheduledTasks.startOn }}
5
5
  </label>
6
6
 
7
- <div class="datepicker__input-inner">
7
+ <label
8
+ for="frequency-start-on-date"
9
+ class="tooltip tooltip-validation tooltip-xs tooltip-top-left"
10
+ :class="schedulerStartOnErrorText && 'invalid'"
11
+ >
8
12
  <input
9
13
  id="frequency-start-on-date"
10
- v-model.lazy="currentDateLocal"
14
+ v-model.lazy="modelFrequencyLocal.frg_start_on_time"
11
15
  data-id="frequency-start-on-date-input"
12
- placeholder="mm.dd.yyyy, --:--"
13
- type="text"
16
+ type="datetime-local"
14
17
  />
15
- <atoms-datepicker
16
- v-model="calendarDefaultDate"
17
- :lang="language"
18
- @update="onUpdateDateTo"
19
- />
20
- </div>
18
+
19
+ <span class="tooltip-content">
20
+ {{ schedulerStartOnErrorText }}
21
+ </span>
22
+ </label>
21
23
  </div>
22
24
  </template>
23
25
 
24
26
  <script lang="ts" setup>
25
27
  import type { UI_I_Localization } from '~/lib/models/interfaces'
28
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
26
29
 
27
- const modelTimeLocal = defineModel<number | null>({ required: true })
30
+ const modelFrequencyLocal = defineModel<UI_I_ScheduleNewTasksForm>({
31
+ required: true,
32
+ })
28
33
 
29
34
  const localization = computed<UI_I_Localization>(() => useLocal())
30
- const { $store, $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
31
-
32
- const calendarDefaultDate = ref<number>(new Date().getTime())
33
- const currentDateLocal = ref<string>('')
35
+ // const { $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
34
36
 
35
- const language = computed<string>(() => $store.getters['main/getInterfaceLang'])
36
- const onUpdateDateTo = (val: number): void => {
37
- if (!val) return
38
-
39
- modelTimeLocal.value = val // milliseconds
40
-
41
- currentDateLocal.value = $formattedDate(new Date(val), 'MM.dd.yyyy, hh:mm')
42
- }
43
-
44
- watch(currentDateLocal, (newValue) => {
45
- $isDate(newValue) &&
46
- (calendarDefaultDate.value = modelTimeLocal.value =
47
- $getUnixByDate(newValue))
37
+ const schedulerStartOnErrorText = computed<string>(() => {
38
+ return !modelFrequencyLocal.value.frg_start_on_time
39
+ ? localization.value.common.fieldRequired
40
+ : ''
48
41
  })
42
+ watch(
43
+ schedulerStartOnErrorText,
44
+ (newValue: string) => {
45
+ modelFrequencyLocal.value.isValid = !!newValue
46
+ },
47
+ { immediate: true }
48
+ )
49
+
50
+ // const onUpdateDateTo = (val: number): void => {
51
+ // if (!val) return
52
+ //
53
+ // modelTimeLocal.value = val // milliseconds
54
+ //
55
+ // currentDateLocal.value = $formattedDate(new Date(val), 'MM.dd.yyyy, hh:mm')
56
+ // }
57
+ //
58
+ // watch(currentDateLocal, (newValue) => {
59
+ // $isDate(newValue) &&
60
+ // (calendarDefaultDate.value = modelTimeLocal.value =
61
+ // $getUnixByDate(newValue))
62
+ // })
49
63
  </script>
50
64
 
51
65
  <style lang="scss" scoped>
@@ -62,10 +76,9 @@ watch(currentDateLocal, (newValue) => {
62
76
  }
63
77
  }
64
78
  }
65
- .datepicker {
66
- &__input-inner {
67
- @include flex($align: center);
68
- margin-left: 15px;
79
+ .tooltip {
80
+ & > .tooltip-content {
81
+ width: 200px;
69
82
  }
70
83
  }
71
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.255",
4
+ "version": "1.4.257",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",