bfg-common 1.1.101 → 1.1.102

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,423 +1,453 @@
1
- <template>
2
- <div class="charts-view">
3
- <template v-if="oneSettingsLocal && !isMountedLoader">
4
- <div :class="['chart-container', `graph-${oneSettingsLocal.title}`]">
5
- <div v-if="oneSettingsLocal.loader" class="graphic-loader-block">
6
- <div class="spinner"></div>
7
- <p>{{ localization.retrievingData }}...</p>
8
- </div>
9
- <common-graph
10
- v-else-if="oneGraphData"
11
- :data="oneGraphData"
12
- :chart="chartOne"
13
- :update="oneUpdateHelper"
14
- />
15
- <div v-else class="graph-empty-block">
16
- <div class="title">{{ oneSettingsLocal.title }}</div>
17
- <div class="body-block">
18
- {{ localization.emptyGraphText }}
19
- </div>
20
- </div>
21
- </div>
22
- </template>
23
- <template v-if="twoSettingsLocal && !isMountedLoader">
24
- <div :class="['chart-container', `graph-${twoSettingsLocal.title}`]">
25
- <div v-if="twoSettingsLocal.loader" class="graphic-loader-block">
26
- <div class="spinner"></div>
27
- <p>{{ localization.retrievingData }}...</p>
28
- </div>
29
- <common-graph
30
- v-else-if="twoGraphData"
31
- :data="twoGraphData"
32
- :chart="chartTwo"
33
- :update="twoUpdateHelper"
34
- />
35
- <div v-else class="graph-empty-block">
36
- <div class="title">{{ twoSettingsLocal.title }}</div>
37
- <div class="body-block">
38
- {{ localization.emptyGraphText }}
39
- </div>
40
- </div>
41
- </div>
42
- </template>
43
- <template v-if="threeSettingsLocal && !isMountedLoader">
44
- <div :class="['chart-container', `graph-${threeSettingsLocal.title}`]">
45
- <div v-if="threeSettingsLocal.loader" class="graphic-loader-block">
46
- <div class="spinner"></div>
47
- <p>{{ localization.retrievingData }}...</p>
48
- </div>
49
- <common-graph
50
- v-else-if="threeGraphData"
51
- :data="threeGraphData"
52
- :chart="chartThree"
53
- :update="threeUpdateHelper"
54
- />
55
- <div v-else class="graph-empty-block">
56
- <div class="title">{{ threeSettingsLocal.title }}</div>
57
- <div class="body-block">
58
- {{ localization.emptyGraphText }}
59
- </div>
60
- </div>
61
- </div>
62
- </template>
63
- <template v-if="fourSettingsLocal && !isMountedLoader">
64
- <div :class="['chart-container', `graph-${fourSettingsLocal.title}`]">
65
- <div v-if="fourSettingsLocal.loader" class="graphic-loader-block">
66
- <div class="spinner"></div>
67
- <p>{{ localization.retrievingData }}...</p>
68
- </div>
69
- <common-graph
70
- v-else-if="fourGraphData"
71
- :data="fourGraphData"
72
- :chart="chartFour"
73
- :update="fourUpdateHelper"
74
- />
75
- <div v-else class="graph-empty-block">
76
- <div class="title">{{ fourSettingsLocal.title }}</div>
77
- <div class="body-block">
78
- {{ localization.emptyGraphText }}
79
- </div>
80
- </div>
81
- </div>
82
- </template>
83
- <div v-if="isMountedLoader" class="content-global-loading">
84
- {{ localization.loading }}...
85
- </div>
86
- </div>
87
- </template>
88
-
89
- <script setup lang="ts">
90
- import { format } from 'date-fns'
91
- import { UI_I_Localization } from '~/models/interfaces'
92
- import { UI_I_GraphDataSettingItem } from '~/components/common/monitor/models/interfaces'
93
- import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/utils/renderGraph'
94
- import {
95
- I_LineGraph,
96
- I_SeriesLine,
97
- } from 'bfg-nuxt-3-graph/graph/models/interfaces'
98
-
99
- const props = defineProps<{
100
- oneChart?: UI_I_GraphDataSettingItem | null
101
- twoChart?: UI_I_GraphDataSettingItem | null
102
- threeChart?: UI_I_GraphDataSettingItem | null
103
- fourChart?: UI_I_GraphDataSettingItem | null
104
- themeMode?: 'string'
105
- formatDate?: 'string'
106
- formatTime?: 'string'
107
- graphType: 'string'
108
- }>()
109
-
110
- const { $formattedDatetime } = useNuxtApp()
111
-
112
- const localization = computed<UI_I_Localization>(() => useLocal())
113
-
114
- const isFullScreen = ref<boolean>(false)
115
-
116
- const fullScreenCallBack = (newValue: boolean): void => {
117
- newValue && (isFullScreen.value = newValue)
118
- }
119
-
120
- const oneUpdateHelper = ref<number>(0)
121
- const twoUpdateHelper = ref<number>(0)
122
- const threeUpdateHelper = ref<number>(0)
123
- const fourUpdateHelper = ref<number>(0)
124
-
125
- const chartOne = ref<any>(null)
126
- const chartTwo = ref<any>(null)
127
- const chartThree = ref<any>(null)
128
- const chartFour = ref<any>(null)
129
-
130
- const currentChartName = ref<string>('')
131
-
132
- const getCurrentChart = (chart: any): any => {
133
- if (currentChartName.value === 'one') return (chartOne.value = chart)
134
- if (currentChartName.value === 'two') return (chartTwo.value = chart)
135
- if (currentChartName.value === 'three') return (chartThree.value = chart)
136
- if (currentChartName.value === 'four') return (chartFour.value = chart)
137
- }
138
-
139
- const oneSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
140
- const twoSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
141
- const threeSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
142
- const fourSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
143
-
144
- const isMountedLoader = ref<boolean>()
145
-
146
- const oneGraphData = ref<I_LineGraph | null>(null)
147
- const twoGraphData = ref<I_LineGraph | null>(null)
148
- const threeGraphData = ref<I_LineGraph | null>(null)
149
- const fourGraphData = ref<I_LineGraph | null>(null)
150
-
151
- const setCurrentGraphData = (
152
- name: string,
153
- data: I_SeriesLine,
154
- isDarkMode: boolean,
155
- width: number
156
- ): void => {
157
- currentChartName.value = name
158
-
159
- const graphData = graphDataFunc(
160
- data,
161
- isDarkMode,
162
- localization.value,
163
- fullScreenCallBack,
164
- false,
165
- true,
166
- true,
167
- props.graphType,
168
- '',
169
- width,
170
- getCurrentChart,
171
- $formattedDatetime,
172
- format,
173
- props.formatDate,
174
- props.formatTime
175
- )
176
-
177
- if (name === 'one') oneGraphData.value = graphData
178
- if (name === 'two') twoGraphData.value = graphData
179
- if (name === 'three') threeGraphData.value = graphData
180
- if (name === 'four') fourGraphData.value = graphData
181
- }
182
-
183
- const outputSize = (): void => {
184
- setTimeout(() => {
185
- if (oneGraphData.value) oneUpdateHelper.value++
186
- if (twoGraphData.value) twoUpdateHelper.value++
187
- if (threeGraphData.value) threeUpdateHelper.value++
188
- if (fourGraphData.value) fourUpdateHelper.value++
189
-
190
- if (chartOne.value && chartOne.value?.hasLoaded) chartOne.value.reflow()
191
-
192
- if (chartTwo.value && chartTwo.value?.hasLoaded) chartTwo.value.reflow()
193
-
194
- if (chartThree.value && chartThree.value?.hasLoaded)
195
- chartThree.value.reflow()
196
-
197
- if (chartFour.value && chartFour.value?.hasLoaded) chartFour.value.reflow()
198
- }, 1000)
199
- }
200
- const updateGraph = (
201
- graphSetting: UI_I_GraphDataSettingItem | null,
202
- name: string
203
- ): void => {
204
- outputSize()
205
- updateGraphsData(graphSetting, name)
206
- }
207
-
208
- const updateGraphsData = (
209
- data: UI_I_GraphDataSettingItem | null,
210
- name: string
211
- ): void => {
212
- if (!data?.data) {
213
- if (name === 'one') oneGraphData.value = null
214
- if (name === 'two') twoGraphData.value = null
215
- if (name === 'three') threeGraphData.value = null
216
- if (name === 'four') fourGraphData.value = null
217
- return
218
- }
219
-
220
- const themeMode = useLocalStorage('themeMode') || props.themeMode
221
- const isDarkMode = themeMode === 'dark-theme'
222
-
223
- const width =
224
- document
225
- .querySelector(`.graph-${name} .graph-content`)
226
- ?.getBoundingClientRect().width || 700
227
-
228
- setCurrentGraphData(name, data.data, isDarkMode, width)
229
- }
230
-
231
- const checkIsMountedError = (): void => {
232
- if (
233
- oneSettingsLocal.value ||
234
- twoSettingsLocal.value ||
235
- threeSettingsLocal.value ||
236
- fourSettingsLocal.value
237
- )
238
- isMountedLoader.value = false
239
- }
240
-
241
- watch(
242
- () => props.oneChart,
243
- (newValue) => {
244
- if (newValue === undefined) return
245
-
246
- oneSettingsLocal.value = newValue
247
-
248
- if (newValue) updateGraph(oneSettingsLocal.value, newValue.place)
249
-
250
- isMountedLoader.value && checkIsMountedError()
251
- },
252
- { deep: true, immediate: true }
253
- )
254
-
255
- watch(
256
- () => props.twoChart,
257
- (newValue) => {
258
- if (newValue === undefined) return
259
-
260
- twoSettingsLocal.value = newValue
261
-
262
- if (newValue) updateGraph(twoSettingsLocal.value, newValue.place)
263
-
264
- isMountedLoader.value && checkIsMountedError()
265
- },
266
- { deep: true, immediate: true }
267
- )
268
-
269
- watch(
270
- () => props.threeChart,
271
- (newValue) => {
272
- if (newValue === undefined) return
273
-
274
- threeSettingsLocal.value = newValue
275
-
276
- if (newValue) updateGraph(threeSettingsLocal.value, newValue.place)
277
-
278
- isMountedLoader.value && checkIsMountedError()
279
- },
280
- { deep: true, immediate: true }
281
- )
282
-
283
- watch(chartOne, (newValue) => {
284
- if (!newValue) return
285
-
286
- newValue.exportingGroup?.element?.children[0].children[0].remove()
287
- })
288
- watch(chartTwo, (newValue) => {
289
- if (!newValue) return
290
- newValue.exportingGroup?.element?.children[0].children[0].remove()
291
- })
292
- watch(chartFour, (newValue) => {
293
- if (!newValue) return
294
- newValue.exportingGroup?.element?.children[0].children[0].remove()
295
- })
296
- watch(chartThree, (newValue) => {
297
- if (!newValue) return
298
- newValue.exportingGroup?.element?.children[0].children[0].remove()
299
- })
300
-
301
- watch(
302
- () => props.fourChart,
303
- (newValue) => {
304
- if (newValue === undefined) return
305
-
306
- fourSettingsLocal.value = newValue
307
-
308
- if (newValue) updateGraph(fourSettingsLocal.value, newValue.place)
309
-
310
- isMountedLoader.value && checkIsMountedError()
311
- },
312
- { deep: true, immediate: true }
313
- )
314
-
315
- const setResizeObserve = (): void => {
316
- const el = document.getElementById('center-pane')
317
-
318
- if (!el) {
319
- setTimeout(setResizeObserve, 0)
320
- return
321
- }
322
- new ResizeObserver(outputSize).observe(el)
323
- }
324
-
325
- onMounted(() => {
326
- isMountedLoader.value = true
327
- setResizeObserve()
328
- })
329
- </script>
330
-
331
- <style>
332
- :root {
333
- --loader-bg-color: #ffffff;
334
- }
335
- :root.dark-theme {
336
- --loader-bg-color: #22343c;
337
- }
338
- </style>
339
-
340
- <style scoped lang="scss">
341
- .charts-view {
342
- position: relative;
343
- display: flex;
344
- flex-direction: row;
345
- flex-wrap: wrap;
346
- justify-content: space-between;
347
- overflow: auto;
348
- height: 100%;
349
-
350
- .graphic-loader-block {
351
- background-color: var(--loader-bg-color);
352
- height: 100%;
353
- display: flex;
354
- flex-direction: column;
355
- align-items: center;
356
- justify-content: center;
357
- }
358
-
359
- .graph-empty-block {
360
- display: flex;
361
- flex-direction: column;
362
- height: 100%;
363
- background-color: var(--loader-bg-color);
364
-
365
- .title {
366
- text-align: center;
367
- font-size: 18px;
368
- margin-top: 10px;
369
- color: var(--global-font-color);
370
- }
371
-
372
- .body-block {
373
- height: 100%;
374
- display: flex;
375
- justify-content: center;
376
- text-align: center;
377
- align-items: center;
378
- color: var(--global-font-color);
379
- }
380
- }
381
-
382
- .chart-container {
383
- box-sizing: border-box;
384
- flex-grow: 1;
385
- padding: 5px;
386
- min-height: 300px;
387
- height: 100%;
388
- min-width: 300px;
389
- width: 100%;
390
- position: relative;
391
-
392
- &:first-child:last-child {
393
- height: 100%;
394
- width: 100%;
395
- }
396
-
397
- &:first-child:nth-last-child(2),
398
- &:nth-child(2):last-child {
399
- width: 50%;
400
- height: 100%;
401
- }
402
- }
403
-
404
- .content-global-loading {
405
- width: 100%;
406
- height: 100%;
407
- display: flex;
408
- align-items: center;
409
- justify-content: center;
410
- color: var(--global-font-color);
411
- }
412
- }
413
- @media (min-width: 1280px) {
414
- .charts-view .chart-container {
415
- width: 50%;
416
- }
417
- }
418
- @media (min-height: 800px) {
419
- .charts-view .chart-container {
420
- height: 50%;
421
- }
422
- }
423
- </style>
1
+ <template>
2
+ <div class="charts-view">
3
+ <template v-if="oneSettingsLocal && !isMountedLoader">
4
+ <div :class="['chart-container', `graph-${oneSettingsLocal.title}`]">
5
+ <div v-if="oneSettingsLocal.loader" class="graphic-loader-block">
6
+ <div class="spinner"></div>
7
+ <p>{{ localization.retrievingData }}...</p>
8
+ </div>
9
+ <common-graph
10
+ v-else-if="oneGraphData"
11
+ :data="oneGraphData"
12
+ :chart="chartOne"
13
+ :update="oneUpdateHelper"
14
+ />
15
+ <div v-else class="graph-empty-block">
16
+ <div class="title">{{ oneSettingsLocal.title }}</div>
17
+ <div class="body-block">
18
+ {{ localization.emptyGraphText }}
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </template>
23
+ <template v-if="twoSettingsLocal && !isMountedLoader">
24
+ <div :class="['chart-container', `graph-${twoSettingsLocal.title}`]">
25
+ <div v-if="twoSettingsLocal.loader" class="graphic-loader-block">
26
+ <div class="spinner"></div>
27
+ <p>{{ localization.retrievingData }}...</p>
28
+ </div>
29
+ <common-graph
30
+ v-else-if="twoGraphData"
31
+ :data="twoGraphData"
32
+ :chart="chartTwo"
33
+ :update="twoUpdateHelper"
34
+ />
35
+ <div v-else class="graph-empty-block">
36
+ <div class="title">{{ twoSettingsLocal.title }}</div>
37
+ <div class="body-block">
38
+ {{ localization.emptyGraphText }}
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </template>
43
+ <template v-if="threeSettingsLocal && !isMountedLoader">
44
+ <div :class="['chart-container', `graph-${threeSettingsLocal.title}`]">
45
+ <div v-if="threeSettingsLocal.loader" class="graphic-loader-block">
46
+ <div class="spinner"></div>
47
+ <p>{{ localization.retrievingData }}...</p>
48
+ </div>
49
+ <common-graph
50
+ v-else-if="threeGraphData"
51
+ :data="threeGraphData"
52
+ :chart="chartThree"
53
+ :update="threeUpdateHelper"
54
+ />
55
+ <div v-else class="graph-empty-block">
56
+ <div class="title">{{ threeSettingsLocal.title }}</div>
57
+ <div class="body-block">
58
+ {{ localization.emptyGraphText }}
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </template>
63
+ <template v-if="fourSettingsLocal && !isMountedLoader">
64
+ <div :class="['chart-container', `graph-${fourSettingsLocal.title}`]">
65
+ <div v-if="fourSettingsLocal.loader" class="graphic-loader-block">
66
+ <div class="spinner"></div>
67
+ <p>{{ localization.retrievingData }}...</p>
68
+ </div>
69
+ <common-graph
70
+ v-else-if="fourGraphData"
71
+ :data="fourGraphData"
72
+ :chart="chartFour"
73
+ :update="fourUpdateHelper"
74
+ />
75
+ <div v-else class="graph-empty-block">
76
+ <div class="title">{{ fourSettingsLocal.title }}</div>
77
+ <div class="body-block">
78
+ {{ localization.emptyGraphText }}
79
+ </div>
80
+ </div>
81
+ </div>
82
+ </template>
83
+ <div v-if="isMountedLoader" class="content-global-loading">
84
+ {{ localization.loading }}...
85
+ </div>
86
+ </div>
87
+ </template>
88
+
89
+ <script setup lang="ts">
90
+ import { format } from 'date-fns'
91
+ import { UI_I_Localization } from '~/models/interfaces'
92
+ import { UI_I_GraphDataSettingItem } from '~/components/common/monitor/models/interfaces'
93
+ import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/utils/renderGraph'
94
+ import {
95
+ I_LineGraph,
96
+ I_SeriesLine,
97
+ } from 'bfg-nuxt-3-graph/graph/models/interfaces'
98
+
99
+ const props = defineProps<{
100
+ oneChart?: UI_I_GraphDataSettingItem | null
101
+ twoChart?: UI_I_GraphDataSettingItem | null
102
+ threeChart?: UI_I_GraphDataSettingItem | null
103
+ fourChart?: UI_I_GraphDataSettingItem | null
104
+ themeMode?: 'string'
105
+ formatDate?: 'string'
106
+ formatTime?: 'string'
107
+ graphType: 'string'
108
+ }>()
109
+
110
+ const { $formattedDatetime } = useNuxtApp()
111
+
112
+ const localization = computed<UI_I_Localization>(() => useLocal())
113
+
114
+ const isFullScreen = ref<boolean>(false)
115
+
116
+ const fullScreenCallBack = (newValue: boolean): void => {
117
+ newValue && (isFullScreen.value = newValue)
118
+ }
119
+
120
+ const oneUpdateHelper = ref<number>(0)
121
+ const twoUpdateHelper = ref<number>(0)
122
+ const threeUpdateHelper = ref<number>(0)
123
+ const fourUpdateHelper = ref<number>(0)
124
+
125
+ const chartOne = ref<any>(null)
126
+ const chartTwo = ref<any>(null)
127
+ const chartThree = ref<any>(null)
128
+ const chartFour = ref<any>(null)
129
+
130
+ const currentChartName = ref<string>('')
131
+
132
+ const getCurrentChart = (chart: any): any => {
133
+ switch (currentChartName.value) {
134
+ case 'one':
135
+ chartOne.value = chart
136
+ break
137
+ case 'two':
138
+ chartTwo.value = chart
139
+ break
140
+ case 'three':
141
+ chartThree.value = chart
142
+ break
143
+ case 'four':
144
+ chartFour.value = chart
145
+ break
146
+ }
147
+ }
148
+
149
+ const oneSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
150
+ const twoSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
151
+ const threeSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
152
+ const fourSettingsLocal = ref<UI_I_GraphDataSettingItem | null>(null)
153
+
154
+ const isMountedLoader = ref<boolean>()
155
+
156
+ const oneGraphData = ref<I_LineGraph | null>(null)
157
+ const twoGraphData = ref<I_LineGraph | null>(null)
158
+ const threeGraphData = ref<I_LineGraph | null>(null)
159
+ const fourGraphData = ref<I_LineGraph | null>(null)
160
+
161
+ const setCurrentGraphData = (
162
+ name: string,
163
+ data: I_SeriesLine,
164
+ isDarkMode: boolean,
165
+ width: number
166
+ ): void => {
167
+ currentChartName.value = name
168
+
169
+ const graphData = graphDataFunc(
170
+ data,
171
+ isDarkMode,
172
+ localization.value,
173
+ fullScreenCallBack,
174
+ false,
175
+ true,
176
+ true,
177
+ props.graphType,
178
+ '',
179
+ width,
180
+ getCurrentChart,
181
+ $formattedDatetime,
182
+ format,
183
+ props.formatDate,
184
+ props.formatTime
185
+ )
186
+
187
+ switch (name) {
188
+ case 'one':
189
+ oneGraphData.value = graphData
190
+ break
191
+ case 'two':
192
+ twoGraphData.value = graphData
193
+ break
194
+ case 'three':
195
+ threeGraphData.value = graphData
196
+ break
197
+ case 'four':
198
+ fourGraphData.value = graphData
199
+ break
200
+ }
201
+ }
202
+
203
+ const outputSize = (): void => {
204
+ setTimeout(() => {
205
+ if (oneGraphData.value) oneUpdateHelper.value++
206
+ if (twoGraphData.value) twoUpdateHelper.value++
207
+ if (threeGraphData.value) threeUpdateHelper.value++
208
+ if (fourGraphData.value) fourUpdateHelper.value++
209
+
210
+ if (chartOne.value && chartOne.value?.hasLoaded) chartOne.value.reflow()
211
+
212
+ if (chartTwo.value && chartTwo.value?.hasLoaded) chartTwo.value.reflow()
213
+
214
+ if (chartThree.value && chartThree.value?.hasLoaded)
215
+ chartThree.value.reflow()
216
+
217
+ if (chartFour.value && chartFour.value?.hasLoaded) chartFour.value.reflow()
218
+ }, 1000)
219
+ }
220
+ const updateGraph = (
221
+ graphSetting: UI_I_GraphDataSettingItem | null,
222
+ name: string
223
+ ): void => {
224
+ outputSize()
225
+ updateGraphsData(graphSetting, name)
226
+ }
227
+
228
+ const updateGraphsData = (
229
+ data: UI_I_GraphDataSettingItem | null,
230
+ name: string
231
+ ): void => {
232
+ if (!data?.data) {
233
+ switch (name) {
234
+ case 'one':
235
+ oneGraphData.value = null
236
+ break
237
+ case 'two':
238
+ twoGraphData.value = null
239
+ break
240
+ case 'three':
241
+ threeGraphData.value = null
242
+ break
243
+ case 'four':
244
+ fourGraphData.value = null
245
+ break
246
+ }
247
+ return
248
+ }
249
+
250
+ const themeMode = useLocalStorage('themeMode') || props.themeMode
251
+ const isDarkMode = themeMode === 'dark-theme'
252
+
253
+ const width =
254
+ document
255
+ .querySelector(`.graph-${name} .graph-content`)
256
+ ?.getBoundingClientRect().width || 700
257
+
258
+ setCurrentGraphData(name, data.data, isDarkMode, width)
259
+ }
260
+
261
+ const checkIsMountedError = (): void => {
262
+ if (
263
+ oneSettingsLocal.value ||
264
+ twoSettingsLocal.value ||
265
+ threeSettingsLocal.value ||
266
+ fourSettingsLocal.value
267
+ )
268
+ isMountedLoader.value = false
269
+ }
270
+
271
+ watch(
272
+ () => props.oneChart,
273
+ (newValue) => {
274
+ if (newValue === undefined) return
275
+
276
+ oneSettingsLocal.value = newValue
277
+
278
+ if (newValue) updateGraph(oneSettingsLocal.value, newValue.place)
279
+
280
+ isMountedLoader.value && checkIsMountedError()
281
+ },
282
+ { deep: true, immediate: true }
283
+ )
284
+
285
+ watch(
286
+ () => props.twoChart,
287
+ (newValue) => {
288
+ if (newValue === undefined) return
289
+
290
+ twoSettingsLocal.value = newValue
291
+
292
+ if (newValue) updateGraph(twoSettingsLocal.value, newValue.place)
293
+
294
+ isMountedLoader.value && checkIsMountedError()
295
+ },
296
+ { deep: true, immediate: true }
297
+ )
298
+
299
+ watch(
300
+ () => props.threeChart,
301
+ (newValue) => {
302
+ if (newValue === undefined) return
303
+
304
+ threeSettingsLocal.value = newValue
305
+
306
+ if (newValue) updateGraph(threeSettingsLocal.value, newValue.place)
307
+
308
+ isMountedLoader.value && checkIsMountedError()
309
+ },
310
+ { deep: true, immediate: true }
311
+ )
312
+
313
+ watch(chartOne, (newValue) => {
314
+ if (!newValue) return
315
+
316
+ newValue.exportingGroup?.element?.children[0].children[0].remove()
317
+ })
318
+ watch(chartTwo, (newValue) => {
319
+ if (!newValue) return
320
+ newValue.exportingGroup?.element?.children[0].children[0].remove()
321
+ })
322
+ watch(chartFour, (newValue) => {
323
+ if (!newValue) return
324
+ newValue.exportingGroup?.element?.children[0].children[0].remove()
325
+ })
326
+ watch(chartThree, (newValue) => {
327
+ if (!newValue) return
328
+ newValue.exportingGroup?.element?.children[0].children[0].remove()
329
+ })
330
+
331
+ watch(
332
+ () => props.fourChart,
333
+ (newValue) => {
334
+ if (newValue === undefined) return
335
+
336
+ fourSettingsLocal.value = newValue
337
+
338
+ if (newValue) updateGraph(fourSettingsLocal.value, newValue.place)
339
+
340
+ isMountedLoader.value && checkIsMountedError()
341
+ },
342
+ { deep: true, immediate: true }
343
+ )
344
+
345
+ const setResizeObserve = (): void => {
346
+ const el = document.getElementById('center-pane')
347
+
348
+ if (!el) {
349
+ setTimeout(setResizeObserve, 0)
350
+ return
351
+ }
352
+ new ResizeObserver(outputSize).observe(el)
353
+ }
354
+
355
+ onMounted(() => {
356
+ isMountedLoader.value = true
357
+ setResizeObserve()
358
+ })
359
+ </script>
360
+
361
+ <style>
362
+ :root {
363
+ --loader-bg-color: #ffffff;
364
+ }
365
+ :root.dark-theme {
366
+ --loader-bg-color: #22343c;
367
+ }
368
+ </style>
369
+
370
+ <style scoped lang="scss">
371
+ .charts-view {
372
+ position: relative;
373
+ display: flex;
374
+ flex-direction: row;
375
+ flex-wrap: wrap;
376
+ justify-content: space-between;
377
+ overflow: auto;
378
+ height: 100%;
379
+
380
+ .graphic-loader-block {
381
+ background-color: var(--loader-bg-color);
382
+ height: 100%;
383
+ display: flex;
384
+ flex-direction: column;
385
+ align-items: center;
386
+ justify-content: center;
387
+ }
388
+
389
+ .graph-empty-block {
390
+ display: flex;
391
+ flex-direction: column;
392
+ height: 100%;
393
+ background-color: var(--loader-bg-color);
394
+
395
+ .title {
396
+ text-align: center;
397
+ font-size: 18px;
398
+ margin-top: 10px;
399
+ color: var(--global-font-color);
400
+ }
401
+
402
+ .body-block {
403
+ height: 100%;
404
+ display: flex;
405
+ justify-content: center;
406
+ text-align: center;
407
+ align-items: center;
408
+ color: var(--global-font-color);
409
+ }
410
+ }
411
+
412
+ .chart-container {
413
+ box-sizing: border-box;
414
+ flex-grow: 1;
415
+ padding: 5px;
416
+ min-height: 300px;
417
+ height: 100%;
418
+ min-width: 300px;
419
+ width: 100%;
420
+ position: relative;
421
+
422
+ &:first-child:last-child {
423
+ height: 100%;
424
+ width: 100%;
425
+ }
426
+
427
+ &:first-child:nth-last-child(2),
428
+ &:nth-child(2):last-child {
429
+ width: 50%;
430
+ height: 100%;
431
+ }
432
+ }
433
+
434
+ .content-global-loading {
435
+ width: 100%;
436
+ height: 100%;
437
+ display: flex;
438
+ align-items: center;
439
+ justify-content: center;
440
+ color: var(--global-font-color);
441
+ }
442
+ }
443
+ @media (min-width: 1280px) {
444
+ .charts-view .chart-container {
445
+ width: 50%;
446
+ }
447
+ }
448
+ @media (min-height: 800px) {
449
+ .charts-view .chart-container {
450
+ height: 50%;
451
+ }
452
+ }
453
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.1.101",
4
+ "version": "1.1.102",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",