bfg-common 1.4.884 → 1.4.886

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.
@@ -1,186 +1,209 @@
1
- <template>
2
- <ui-modal
3
- show
4
- :title="titleLocal"
5
- :subtitle="props.selectedItemName"
6
- :texts="modalTexts"
7
- test-id="overview-custom-interval-modal"
8
- @hide="onHide"
9
- @submit="onSubmit"
10
- >
11
- <template #content>
12
- <div class="time-range">
13
- <ui-alert
14
- v-show="alertShow"
15
- status="alert-danger"
16
- :messages="props.alertItems"
17
- class="overview-alert"
18
- test-id="overview-alert"
19
- @remove="alertShow = false"
20
- />
21
-
22
- <p class="date-time-format-description">
23
- {{ localization.inventoryMonitor.dateTimeIsoFormat }}
24
- </p>
25
-
26
- <div class="filed-wrap from">
27
- <lable for="date-from" class="filed-lable">{{
28
- localization.common.from
29
- }}</lable>
30
- <ui-input-with-datepicker
31
- id="date-from"
32
- v-model="currentDateFromLocal"
33
- :format="datepickerFormat"
34
- test-id="date-from"
35
- time-format="12"
36
- />
37
- </div>
38
-
39
- <div class="filed-wrap">
40
- <lable for="date-to" class="filed-lable">{{
41
- localization.common.to
42
- }}</lable>
43
- <ui-input-with-datepicker
44
- id="date-to"
45
- v-model="currentDateToLocal"
46
- :format="datepickerFormat"
47
- test-id="date-to"
48
- time-format="12"
49
- />
50
- </div>
51
- </div>
52
- </template>
53
-
54
- <template #footerLeftContent><span></span></template>
55
- </ui-modal>
56
- </template>
57
-
58
- <script setup lang="ts">
59
- import type { UI_I_ModalTexts } from 'bfg-uikit/components/ui/modal/models/interfaces'
60
- import type { UI_I_Localization } from '~/lib/models/interfaces'
61
- import { getUiDatepickerFormatByLanguage } from '~/lib/utils/date'
62
-
63
- const alertShow = defineModel<boolean>('alert-show')
64
- const currentDateFrom = defineModel<string>('current-date-from')
65
- // const dateFrom = defineModel<string>('date-from')
66
- const currentTimeFrom = defineModel<string>('current-time-from')
67
- const currentDateTo = defineModel<string>('current-date-to')
68
- // const dateTo = defineModel<string>('date-to')
69
- const currentTimeTo = defineModel<string>('current-time-to')
70
-
71
- const props = defineProps<{
72
- titleIntervalModal: string
73
- selectedItemName: string
74
- currentLang: string
75
- alertItems: any[]
76
- formatDate: string
77
- }>()
78
-
79
- const emits = defineEmits<{
80
- (event: 'hide'): void
81
- (event: 'submit'): void
82
- (event: 'update-date-from', value: any): void
83
- (event: 'update-date-to', value: any): void
84
- }>()
85
-
86
- const { $isDate, $getUnixByDate, $formattedDate, $formattedTime } = useNuxtApp()
87
-
88
- const localization = computed<UI_I_Localization>(() => useLocal())
89
-
90
- const datepickerFormat = computed<string>(() =>
91
- getUiDatepickerFormatByLanguage(props.currentLang)
92
- )
93
-
94
- const titleLocal = computed<string>(() =>
95
- props.titleIntervalModal.replace(':', '')
96
- )
97
- const modalTexts = computed<UI_I_ModalTexts>(() => ({
98
- button1: localization.value.common.cancel,
99
- button2: localization.value.common.save,
100
- }))
101
-
102
- const currentDateFromLocal = computed<number>({
103
- get() {
104
- // console.log(currentDateFrom.value, 11111, currentTimeFrom.value)
105
- // TODO fix PM
106
- return $isDate(currentDateFrom.value)
107
- ? $getUnixByDate(currentDateFrom.value + ' ' + currentTimeFrom.value)
108
- : 0
109
- },
110
- set(newValue) {
111
- // console.log($formattedDate(new Date(newValue), props.formatDate), 22222)
112
- // console.log($formattedTime(newValue, '', true), 33333)
113
- currentDateFrom.value = $formattedDate(new Date(newValue), props.formatDate)
114
- currentTimeFrom.value = $formattedTime(newValue, '', true)
115
- },
116
- })
117
- const currentDateToLocal = computed<number>({
118
- get() {
119
- // TODO fix PM
120
- return $isDate(currentDateTo.value)
121
- ? $getUnixByDate(currentDateTo.value + ' ' + currentTimeTo.value)
122
- : 0
123
- },
124
- set(newValue) {
125
- currentDateTo.value = $formattedDate(new Date(newValue), props.formatDate)
126
- currentTimeTo.value = $formattedTime(newValue, '', true)
127
- },
128
- })
129
-
130
- // const onUpdateDateFrom = (event: any): void => {
131
- // emits('update-date-from', event)
132
- // }
133
- // const onUpdateDateTo = (event: any): void => {
134
- // emits('update-date-to', event)
135
- // }
136
-
137
- const onSubmit = (): void => {
138
- emits('submit')
139
- }
140
- const onHide = (): void => {
141
- emits('hide')
142
- }
143
- </script>
144
-
145
- <style>
146
- :root {
147
- --overview-time-range-lable-color: #4d5d69;
148
- --overview-time-range-border-color: #e9ebed;
149
- }
150
- :root.dark-theme {
151
- --overview-time-range-lable-color: #e9eaec;
152
- --overview-time-range-border-color: #e9ebed1f;
153
- }
154
- </style>
155
- <style scoped lang="scss">
156
- .time-range {
157
- padding: 0 32px;
158
-
159
- .overview-alert {
160
- margin-bottom: 16px;
161
- }
162
-
163
- .date-time-format-description {
164
- font-size: 12px;
165
- color: #9da6ad;
166
- padding-bottom: 12px;
167
- border-bottom: 1px solid var(--overview-time-range-border-color);
168
- }
169
-
170
- .filed-wrap {
171
- margin-bottom: 16px;
172
-
173
- &.from {
174
- margin-bottom: 24px;
175
- }
176
- .filed-lable {
177
- display: block;
178
- font-size: 16px;
179
- font-weight: 500;
180
- color: var(--overview-time-range-lable-color);
181
- margin: 16px 0;
182
- text-transform: capitalize;
183
- }
184
- }
185
- }
186
- </style>
1
+ <template>
2
+ <ui-modal
3
+ show
4
+ :title="titleLocal"
5
+ :subtitle="props.selectedNodeName"
6
+ :texts="modalTexts"
7
+ width="560px"
8
+ test-id="overview-custom-interval-modal"
9
+ @hide="onHide"
10
+ @submit="onSubmit"
11
+ >
12
+ <template #content>
13
+ <div class="time-range">
14
+ <ui-alert
15
+ v-show="alertShow"
16
+ status="alert-danger"
17
+ :messages="props.alertItems"
18
+ class="overview-alert"
19
+ test-id="overview-alert"
20
+ size="md"
21
+ hide-close-button
22
+ @remove="alertShow = false"
23
+ />
24
+
25
+ <p class="date-time-format-description">
26
+ {{ localization.inventoryMonitor.dateTimeIsoFormat }}
27
+ </p>
28
+
29
+ <div class="filed-wrap from">
30
+ <lable for="date-from" class="filed-lable">{{
31
+ localization.inventoryMonitor.from
32
+ }}</lable>
33
+ <ui-input-with-datepicker
34
+ id="date-from"
35
+ v-model="currentDateFromLocal"
36
+ :format="datepickerFormat"
37
+ :local="props.currentLang"
38
+ :datepicker-texts="datepickerTexts"
39
+ :placeholder="datepickerTexts.ddMmYyyy"
40
+ test-id="date-from"
41
+ time-format="12"
42
+ />
43
+ </div>
44
+
45
+ <div class="filed-wrap">
46
+ <lable for="date-to" class="filed-lable">{{
47
+ localization.common.on2
48
+ }}</lable>
49
+ <ui-input-with-datepicker
50
+ id="date-to"
51
+ v-model="currentDateToLocal"
52
+ :format="datepickerFormat"
53
+ :local="props.currentLang"
54
+ :datepicker-texts="datepickerTexts"
55
+ :placeholder="datepickerTexts.ddMmYyyy"
56
+ :max="maxDateTo"
57
+ test-id="date-to"
58
+ time-format="12"
59
+ />
60
+ </div>
61
+ </div>
62
+ </template>
63
+
64
+ <template #footerLeftContent><span></span></template>
65
+ </ui-modal>
66
+ </template>
67
+
68
+ <script setup lang="ts">
69
+ import type { UI_I_ModalTexts } from 'bfg-uikit/components/ui/modal/models/interfaces'
70
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
71
+ import { getUiDatepickerFormatByLanguage } from '~/lib/utils/date'
72
+
73
+ const alertShow = defineModel<boolean>('alert-show')
74
+ const currentDateFrom = defineModel<string>('current-date-from')
75
+ // const dateFrom = defineModel<string>('date-from')
76
+ const currentTimeFrom = defineModel<string>('current-time-from')
77
+ const currentDateTo = defineModel<string>('current-date-to')
78
+ // const dateTo = defineModel<string>('date-to')
79
+ const currentTimeTo = defineModel<string>('current-time-to')
80
+
81
+ const props = defineProps<{
82
+ titleIntervalModal: string
83
+ selectedNodeName: string
84
+ currentLang: string
85
+ alertItems: any[]
86
+ formatDate: string
87
+ }>()
88
+
89
+ const emits = defineEmits<{
90
+ (event: 'hide'): void
91
+ (event: 'submit'): void
92
+ (event: 'update-date-from', value: any): void
93
+ (event: 'update-date-to', value: any): void
94
+ }>()
95
+
96
+ const { $isDate, $getUnixByDate, $formattedDate, $formattedTime } = useNuxtApp()
97
+
98
+ const localization = computed<UI_I_Localization>(() => useLocal())
99
+
100
+ const datepickerTexts = computed<UI_I_DatepickerTexts>(() => {
101
+ return {
102
+ thisYear: localization.value.common.thisYear,
103
+ thisMonth: localization.value.common.thisMonth,
104
+ today: localization.value.common.today,
105
+ now: localization.value.common.now,
106
+ hhMmSs: localization.value.common.hhMmSs,
107
+ ddMmYyyy: localization.value.common.ddMmYyyy,
108
+ }
109
+ })
110
+
111
+ const datepickerFormat = computed<string>(() =>
112
+ getUiDatepickerFormatByLanguage(props.currentLang)
113
+ )
114
+
115
+ const titleLocal = computed<string>(() =>
116
+ props.titleIntervalModal.replace(':', '')
117
+ )
118
+ const modalTexts = computed<UI_I_ModalTexts>(() => ({
119
+ button1: localization.value.common.cancel,
120
+ button2: localization.value.common.save,
121
+ }))
122
+
123
+ const currentDateFromLocal = computed<number>({
124
+ get() {
125
+ // console.log(currentDateFrom.value, 11111, currentTimeFrom.value)
126
+ // TODO fix PM
127
+ return $isDate(currentDateFrom.value)
128
+ ? $getUnixByDate(currentDateFrom.value + ' ' + currentTimeFrom.value)
129
+ : 0
130
+ },
131
+ set(newValue) {
132
+ // console.log($formattedDate(new Date(newValue), props.formatDate), 22222)
133
+ // console.log($formattedTime(newValue, '', true), 33333)
134
+ currentDateFrom.value = $formattedDate(new Date(newValue), props.formatDate)
135
+ currentTimeFrom.value = $formattedTime(newValue, '', true)
136
+ },
137
+ })
138
+ const currentDateToLocal = computed<number>({
139
+ get() {
140
+ // TODO fix PM
141
+ return $isDate(currentDateTo.value)
142
+ ? $getUnixByDate(currentDateTo.value + ' ' + currentTimeTo.value)
143
+ : 0
144
+ },
145
+ set(newValue) {
146
+ currentDateTo.value = $formattedDate(new Date(newValue), props.formatDate)
147
+ currentTimeTo.value = $formattedTime(newValue, '', true)
148
+ },
149
+ })
150
+
151
+ const maxDateTo = ref<number>(new Date().getTime())
152
+
153
+ // const onUpdateDateFrom = (event: any): void => {
154
+ // emits('update-date-from', event)
155
+ // }
156
+ // const onUpdateDateTo = (event: any): void => {
157
+ // emits('update-date-to', event)
158
+ // }
159
+
160
+ const onSubmit = (): void => {
161
+ emits('submit')
162
+ }
163
+ const onHide = (): void => {
164
+ emits('hide')
165
+ }
166
+ </script>
167
+
168
+ <style>
169
+ :root {
170
+ --overview-time-range-lable-color: #4d5d69;
171
+ --overview-time-range-border-color: rgba(233, 235, 237, 0.64);
172
+ }
173
+ :root.dark-theme {
174
+ --overview-time-range-lable-color: #e9eaec;
175
+ --overview-time-range-border-color: #e9ebed1f;
176
+ }
177
+ </style>
178
+ <style scoped lang="scss">
179
+ .time-range {
180
+ padding: 16px 32px 0;
181
+
182
+ .overview-alert {
183
+ margin-bottom: 16px;
184
+ }
185
+
186
+ .date-time-format-description {
187
+ font-size: 12px;
188
+ color: #9da6ad;
189
+ padding-bottom: 12px;
190
+ border-bottom: 1px solid var(--overview-time-range-border-color);
191
+ }
192
+
193
+ .filed-wrap {
194
+ margin-bottom: 16px;
195
+
196
+ &.from {
197
+ margin-bottom: 24px;
198
+ }
199
+ .filed-lable {
200
+ display: block;
201
+ font-size: 16px;
202
+ font-weight: 500;
203
+ color: var(--overview-time-range-lable-color);
204
+ margin: 16px 0;
205
+ text-transform: capitalize;
206
+ }
207
+ }
208
+ }
209
+ </style>
@@ -3,7 +3,7 @@
3
3
  show
4
4
  width="580px"
5
5
  :title="props.titleIntervalModal"
6
- :second-title="props.selectedItemName"
6
+ :second-title="props.selectedNodeName"
7
7
  test-id="overview-custom-interval-modal"
8
8
  @hide="onHide"
9
9
  @submit="onSubmit"
@@ -116,7 +116,7 @@ const currentTimeTo = defineModel<boolean>('current-time-to')
116
116
 
117
117
  const props = defineProps<{
118
118
  titleIntervalModal: string
119
- selectedItemName: string
119
+ selectedNodeName: string
120
120
  currentLang: string
121
121
  alertItems: any[]
122
122
  }>()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.884",
4
+ "version": "1.4.886",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "1.0.21",
38
- "bfg-uikit": "1.0.366",
38
+ "bfg-uikit": "1.0.369",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }