bfg-common 1.5.200 → 1.5.202

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,178 +1,145 @@
1
- <template>
2
- <div ref="chartsView">
3
- <common-monitor-advanced-graph-view-new
4
- v-if="isNewView"
5
- :loading="props.loading"
6
- :is-loading="isLoading"
7
- :chart-data="chartData"
8
- :chart="chart"
9
- :chart-helper="chartHelper"
10
- :export-type="props.export"
11
- :selected-row="props.selectedRow"
12
- />
13
- <common-monitor-advanced-graph-view-old
14
- v-else
15
- :loading="props.loading"
16
- :is-loading="isLoading"
17
- :chart-data="chartData"
18
- :chart="chart"
19
- :chart-helper="chartHelper"
20
- :export-type="props.export"
21
- :selected-row="props.selectedRow"
22
- />
23
- </div>
24
- </template>
25
-
26
- <script setup lang="ts">
27
- import type {
28
- I_LineGraph,
29
- I_SeriesLine,
30
- } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
31
- import { useDebounceFn, useElementSize } from '@vueuse/core'
32
- import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
33
- import { format } from 'date-fns'
34
- import type { UI_I_Localization } from '~/lib/models/interfaces'
35
-
36
- const props = defineProps<{
37
- loading: boolean
38
- data: I_SeriesLine | null
39
- export: string
40
- selectedRow: number[]
41
- darkMode: boolean
42
- language: string
43
- selectedChartType: string
44
- }>()
45
- const emits = defineEmits<{
46
- (event: 'open-advanced-page'): void
47
- }>()
48
-
49
- const { $store, $formattedDatetime, $getDateFormat }: any = useNuxtApp()
50
-
51
- const localization = computed<UI_I_Localization>(() => useLocal())
52
-
53
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
54
-
55
- const isLoading = ref<boolean>(true)
56
-
57
- const chartData = ref<I_LineGraph | null>(null)
58
-
59
- const isFullScreen = ref<boolean>(false)
60
- const chart = ref<any>(null)
61
- const chartHelper = ref<number>(0)
62
-
63
- const fullScreenCallBack = (newValue: boolean): void => {
64
- isFullScreen.value = newValue
65
- }
66
-
67
- const chartCallback = (newValue: any): void => {
68
- newValue && (chart.value = newValue)
69
- }
70
-
71
- const newTabCallback = (newValue: boolean): void => {
72
- newValue && emits('open-advanced-page')
73
- }
74
-
75
- watch(
76
- chart,
77
- (newValue) => {
78
- isLoading.value = !newValue?.hasLoaded
79
- },
80
- { immediate: true, deep: true }
81
- )
82
-
83
- let dateFormat = ''
84
-
85
- const chartsView = ref(null)
86
- const { width } = useElementSize(chartsView)
87
-
88
- const startChart = useDebounceFn(() => {
89
- if (!props.data || !width.value) return
90
-
91
- chartData.value = graphDataFunc({
92
- fullScreenCallBack,
93
- format,
94
- graphData: props.data,
95
- isDarkMode: props.darkMode,
96
- localization: localization.value,
97
- disabledTitle: isNewView.value,
98
- disabledExportButton: !isNewView.value,
99
- disabledLegends: false,
100
- graphType: props.selectedChartType,
101
- width: Math.floor(width.value),
102
- chartCallBack: chartCallback,
103
- formattedDatetime: $formattedDatetime,
104
- formatDate: dateFormat,
105
- isNewView: isNewView.value,
106
- isShowLinkNewWindow: true,
107
- newTabCallBack: newTabCallback,
108
- })
109
-
110
- chartHelper.value++
111
- }, 1000)
112
-
113
- watch(
114
- () => props.data,
115
- (newValue) => {
116
- if (!newValue) {
117
- isLoading.value = true
118
- return
119
- }
120
-
121
- startChart()
122
- },
123
- { immediate: true }
124
- )
125
-
126
- watch(
127
- () => props.darkMode,
128
- () => {
129
- startChart()
130
- }
131
- )
132
-
133
- watch(
134
- () => props.language,
135
- () => {
136
- dateFormat = $getDateFormat(props.language)
137
- startChart()
138
- }
139
- )
140
-
141
- watch(
142
- () => props.selectedChartType,
143
- () => {
144
- startChart()
145
- },
146
- { immediate: true }
147
- )
148
-
149
- watch(width, (newValue) => {
150
- if (newValue) startChart()
151
-
152
- if (!chart.value?.isResizing) return
153
-
154
- chart.value.setSize(1, chart.chartHeight)
155
-
156
- if (isFullScreen.value) {
157
- chart.value.setSize(window.innerWidth, chart.chartHeight)
158
- return
159
- }
160
-
161
- setTimeout(() => {
162
- chart.value.setSize(newValue, chart.chartHeight)
163
- }, 1000)
164
- })
165
-
166
- const exportType = ref<string>('')
167
- watch(
168
- () => props.export,
169
- (newValue) => {
170
- if (!newValue) return
171
-
172
- exportType.value = newValue
173
- },
174
- { immediate: true }
175
- )
176
- </script>
177
-
178
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <div ref="chartsView">
3
+ <common-monitor-advanced-graph-view-new
4
+ v-if="isNewView"
5
+ :loading="props.loading"
6
+ :is-loading="isLoading"
7
+ :chart-data="chartData"
8
+ :chart="chart"
9
+ :chart-helper="chartHelper"
10
+ :export-type="props.export"
11
+ :selected-row="props.selectedRow"
12
+ />
13
+ <common-monitor-advanced-graph-view-old
14
+ v-else
15
+ :loading="props.loading"
16
+ :is-loading="isLoading"
17
+ :chart-data="chartData"
18
+ :chart="chart"
19
+ :chart-helper="chartHelper"
20
+ :export-type="props.export"
21
+ :selected-row="props.selectedRow"
22
+ />
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import type {
28
+ I_LineGraph,
29
+ I_SeriesLine,
30
+ } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
31
+ import { useDebounceFn, useElementSize } from '@vueuse/core'
32
+ import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
33
+ import { format } from 'date-fns'
34
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
35
+
36
+ const props = defineProps<{
37
+ loading: boolean
38
+ data: I_SeriesLine | null
39
+ export: string
40
+ selectedRow: number[]
41
+ darkMode: boolean
42
+ language: string
43
+ selectedChartType: string
44
+ }>()
45
+ const emits = defineEmits<{
46
+ (event: 'open-advanced-page'): void
47
+ }>()
48
+
49
+ const { $store, $formattedDatetime, $getDateFormat }: any = useNuxtApp()
50
+
51
+ const localization = computed<UI_I_Localization>(() => useLocal())
52
+
53
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
54
+
55
+ const isLoading = ref<boolean>(true)
56
+
57
+ const chartData = ref<I_LineGraph | null>(null)
58
+
59
+ const chart = ref<any>(null)
60
+ const chartHelper = ref<number>(0)
61
+
62
+ const chartCallback = (newValue: any): void => {
63
+ newValue && (chart.value = newValue)
64
+ }
65
+
66
+ const newTabCallback = (newValue: boolean): void => {
67
+ newValue && emits('open-advanced-page')
68
+ }
69
+
70
+ watch(
71
+ chart,
72
+ (newValue) => {
73
+ newValue?.hasLoaded && (isLoading.value = false)
74
+ },
75
+ { immediate: true, deep: true }
76
+ )
77
+
78
+ let dateFormat = ''
79
+
80
+ const chartsView = ref(null)
81
+ const { width } = useElementSize(chartsView)
82
+
83
+ const startChart = useDebounceFn(() => {
84
+ if (!props.data || !width.value) return
85
+
86
+ chartData.value = graphDataFunc({
87
+ fullScreenCallBack: () => ({}),
88
+ format,
89
+ graphData: props.data,
90
+ isDarkMode: props.darkMode,
91
+ localization: localization.value,
92
+ disabledTitle: isNewView.value,
93
+ disabledExportButton: !isNewView.value,
94
+ disabledLegends: false,
95
+ graphType: props.selectedChartType,
96
+ width: Math.floor(width.value),
97
+ chartCallBack: chartCallback,
98
+ formattedDatetime: $formattedDatetime,
99
+ formatDate: dateFormat,
100
+ isNewView: isNewView.value,
101
+ isShowLinkNewWindow: true,
102
+ newTabCallBack: newTabCallback,
103
+ })
104
+
105
+ chartHelper.value++
106
+ }, 1000)
107
+
108
+ watch(
109
+ () => props.data,
110
+ (newValue) => {
111
+ if (!newValue) {
112
+ isLoading.value = true
113
+ return
114
+ }
115
+
116
+ startChart()
117
+ },
118
+ { immediate: true }
119
+ )
120
+
121
+ watch(
122
+ () => props.darkMode,
123
+ () => {
124
+ startChart()
125
+ }
126
+ )
127
+
128
+ watch(
129
+ () => props.language,
130
+ () => {
131
+ dateFormat = $getDateFormat(props.language)
132
+ startChart()
133
+ }
134
+ )
135
+
136
+ watch(
137
+ () => props.selectedChartType,
138
+ () => {
139
+ startChart()
140
+ },
141
+ { immediate: true }
142
+ )
143
+ </script>
144
+
145
+ <style scoped lang="scss"></style>
@@ -1,56 +1,56 @@
1
- <template>
2
- <div class="advanced-graph-container">
3
- <div v-if="props.isLoading" class="graphic-loader-block">
4
- <div class="spinner"></div>
5
- <p>{{ localization.inventoryMonitor.retrievingData }}...</p>
6
- </div>
7
- <template v-if="!props.loading && props.chartData">
8
- <common-graph
9
- :chart="props.chart"
10
- :data="props.chartData"
11
- :update="props.chartHelper"
12
- :export-type="props.exportType"
13
- :selected-row="props.selectedRow"
14
- />
15
- </template>
16
- </div>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- import type { I_LineGraph } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
21
- import type { UI_I_Localization } from '~/lib/models/interfaces'
22
-
23
- const localization = computed<UI_I_Localization>(() => useLocal())
24
-
25
- const props = defineProps<{
26
- loading: boolean
27
- isLoading: boolean
28
- chartData: I_LineGraph | null
29
- chart: any
30
- chartHelper: number
31
- exportType: string
32
- selectedRow: number[]
33
- }>()
34
- </script>
35
-
36
- <style scoped lang="scss">
37
- .advanced-graph-container {
38
- position: relative;
39
- min-height: 400px;
40
-
41
- .graphic-loader-block {
42
- background-color: var(--loader-bg-color);
43
- height: 100%;
44
- display: flex;
45
- flex-direction: column;
46
- align-items: center;
47
- justify-content: center;
48
- position: absolute;
49
- top: 0;
50
- left: 0;
51
- right: 0;
52
- bottom: 0;
53
- z-index: var(--z-fixed);
54
- }
55
- }
56
- </style>
1
+ <template>
2
+ <div class="advanced-graph-container">
3
+ <div v-if="props.isLoading" class="graphic-loader-block">
4
+ <div class="spinner"></div>
5
+ <p>{{ localization.inventoryMonitor.retrievingData }}...</p>
6
+ </div>
7
+ <template v-if="!props.loading && props.chartData">
8
+ <common-graph
9
+ :chart="props.chart"
10
+ :data="props.chartData"
11
+ :update="props.chartHelper"
12
+ :export-type="props.exportType"
13
+ :selected-row="props.selectedRow"
14
+ />
15
+ </template>
16
+ </div>
17
+ </template>
18
+
19
+ <script setup lang="ts">
20
+ import type { I_LineGraph } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+
23
+ const localization = computed<UI_I_Localization>(() => useLocal())
24
+
25
+ const props = defineProps<{
26
+ loading: boolean
27
+ isLoading: boolean
28
+ chartData: I_LineGraph | null
29
+ chart: any
30
+ chartHelper: number
31
+ exportType: string
32
+ selectedRow: number[]
33
+ }>()
34
+ </script>
35
+
36
+ <style scoped lang="scss">
37
+ .advanced-graph-container {
38
+ position: relative;
39
+ min-height: 400px;
40
+
41
+ .graphic-loader-block {
42
+ background-color: var(--loader-bg-color);
43
+ height: 100%;
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: center;
47
+ justify-content: center;
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
51
+ right: 0;
52
+ bottom: 0;
53
+ z-index: var(--z-fixed);
54
+ }
55
+ }
56
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.200",
4
+ "version": "1.5.202",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -16,6 +16,7 @@
16
16
  "@vueuse/core": "10.1.2",
17
17
  "@vueuse/nuxt": "10.1.2",
18
18
  "eslint-config-prettier": "^8.5.0",
19
+ "eslint-plugin-myrules": "file:./eslint",
19
20
  "nuxt": "3.11.2",
20
21
  "prettier": "2.7.1",
21
22
  "sass": "^1.54.9",
@@ -27,15 +28,15 @@
27
28
  "xterm-addon-fit": "^0.7.0",
28
29
  "xterm-addon-serialize": "^0.9.0",
29
30
  "xterm-addon-unicode11": "^0.5.0",
30
- "xterm-addon-web-links": "^0.8.0",
31
- "eslint-plugin-myrules": "file:./eslint"
31
+ "xterm-addon-web-links": "^0.8.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "@nuxtjs/eslint-config-typescript": "^12.0.0",
35
35
  "@vueuse/components": "^10.1.2",
36
- "date-fns": "^2.29.3",
37
36
  "bfg-nuxt-3-graph": "1.0.26",
38
37
  "bfg-uikit": "1.0.430",
38
+ "date-fns": "^2.29.3",
39
+ "highcharts": "^12.2.0",
39
40
  "html2canvas": "^1.4.1",
40
41
  "prettier-eslint": "^15.0.1"
41
42
  }