bfg-common 1.4.255 → 1.4.256

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,7 +19,7 @@
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
@@ -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>('')
34
-
35
- const language = computed<string>(() => $store.getters['main/getInterfaceLang'])
36
- const onUpdateDateTo = (val: number): void => {
37
- if (!val) return
35
+ // const { $formattedDate, $isDate, $getUnixByDate }: any = useNuxtApp()
38
36
 
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,4 @@ watch(currentDateLocal, (newValue) => {
62
76
  }
63
77
  }
64
78
  }
65
- .datepicker {
66
- &__input-inner {
67
- @include flex($align: center);
68
- margin-left: 15px;
69
- }
70
- }
71
79
  </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.256",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",