bfg-common 1.4.884 → 1.4.885

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,172 +1,183 @@
1
- <template>
2
- <div class="overview-filters">
3
- <div class="period-select-wrap">
4
- <label for="period-select" class="label-select"
5
- >{{ localization.inventoryMonitor.period }}:</label
6
- >
7
-
8
- <ui-select
9
- v-if="!props.disabledPeriodOptions"
10
- v-model="selectedPeriod"
11
- :items="props.periodOptions"
12
- test-id="period-select"
13
- width="auto"
14
- />
15
- <span v-else class="single-option">{{
16
- props.periodOptions[0].text
17
- }}</span>
18
- <span v-if="!props.disabledPeriodOptions" class="chart-text">
19
- {{ props.chartTitleDate }}
20
- </span>
21
- <ui-skeleton-item
22
- v-if="!props.disabledPeriodOptions && !props.chartTitleDate"
23
- width="320"
24
- height="16"
25
- />
26
-
27
- <ui-tooltip
28
- v-show="props.isShowCustomIntervalButton"
29
- id="tooltip-interval-modal-button"
30
- test-id="tooltip-interval-modal-button"
31
- size="sm"
32
- position="bottom"
33
- position-by-tooltip="center"
34
- >
35
- <template #target>
36
- <div
37
- id="tooltip-interval-modal-button"
38
- class="popped tooltip inline-block"
39
- >
40
- <ui-icon
41
- name="edit"
42
- width="16"
43
- height="16"
44
- test-id="show-interval-modal-button"
45
- class="interval-modal-button"
46
- @click="onShowIntervalModal"
47
- />
48
- </div>
49
- </template>
50
- <template #content>
51
- <span class="header-tooltip-text">
52
- {{ localization.inventoryMonitor.changeCustomInterval }}
53
- </span>
54
- </template>
55
- </ui-tooltip>
56
- </div>
57
-
58
- <div class="view-select-wrap">
59
- <label for="view-select" class="label-select"
60
- >{{ localization.common.view }}:</label
61
- >
62
- <ui-select
63
- v-model="selectedView"
64
- :items="props.viewOptions"
65
- test-id="view-select"
66
- width="auto"
67
- left
68
- />
69
- </div>
70
- </div>
71
-
72
- <common-monitor-overview-filters-custom-interval-modal
73
- v-if="props.validDateEnd"
74
- v-show="props.isShowIntervalModal"
75
- :selected-periods="props.selectedPeriods"
76
- :format-date="props.formatDate"
77
- :current-lang="props.currentLang"
78
- :valid-date-end="props.validDateEnd"
79
- @hide="onHideIntervalModal"
80
- @submit="onSubmitIntervalModal"
81
- />
82
- </template>
83
-
84
- <script setup lang="ts">
85
- import type { UI_I_Localization } from '~/lib/models/interfaces'
86
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
87
-
88
- const selectedPeriod = defineModel<string>('selected-period')
89
- const selectedView = defineModel<string>('selected-view')
90
-
91
- const props = defineProps<{
92
- disabledPeriodOptions: boolean
93
- periodOptions: UI_I_OptionItem[]
94
- isShowCustomIntervalButton: boolean
95
- chartTitleDate: string
96
- viewOptions: UI_I_OptionItem[]
97
- validDateEnd: number
98
- isShowIntervalModal: boolean
99
- selectedPeriods: number[]
100
- formatDate: string
101
- currentLang: string
102
- }>()
103
- const emits = defineEmits<{
104
- (event: 'submit-interval-modal', value: number[]): void
105
- (event: 'show-interval-modal'): void
106
- (event: 'hide-interval-modal'): void
107
- }>()
108
-
109
- const localization = computed<UI_I_Localization>(() => useLocal())
110
-
111
- const onShowIntervalModal = (): void => {
112
- emits('show-interval-modal')
113
- }
114
- const onHideIntervalModal = (): void => {
115
- emits('hide-interval-modal')
116
- }
117
- const onSubmitIntervalModal = (data: number[]): void => {
118
- emits('submit-interval-modal', data)
119
- }
120
- </script>
121
-
122
- <style>
123
- :root {
124
- --overview-filter-text-color: #4d5d69;
125
- --overview-filter-edit-hover-color: #008fd6;
126
- }
127
- :root.dark-theme {
128
- --overview-filter-text-color: #e9eaec;
129
- --overview-filter-edit-hover-color: #2ba2de;
130
- }
131
- </style>
132
- <style scoped lang="scss">
133
- .overview-filters {
134
- display: flex;
135
- justify-content: space-between;
136
- align-items: center;
137
- padding: 12px 16px 16px 16px;
138
-
139
- .period-select-wrap {
140
- display: flex;
141
- align-items: center;
142
-
143
- .chart-text {
144
- font-size: 13px;
145
- color: var(--overview-filter-text-color);
146
- margin-left: 12px;
147
- }
148
-
149
- .interval-modal-button {
150
- color: var(--overview-filter-text-color);
151
- margin-left: 8px;
152
- cursor: pointer;
153
-
154
- &:hover {
155
- color: var(--overview-filter-edit-hover-color);
156
- }
157
- }
158
- }
159
-
160
- .view-select-wrap {
161
- display: flex;
162
- align-items: center;
163
- }
164
-
165
- .label-select {
166
- font-size: 13px;
167
- font-weight: 500;
168
- color: var(--overview-filter-text-color);
169
- margin-right: 12px;
170
- }
171
- }
172
- </style>
1
+ <template>
2
+ <div class="overview-filters">
3
+ <div class="period-select-wrap">
4
+ <label for="period-select" class="label-select"
5
+ >{{ localization.inventoryMonitor.period }}:</label
6
+ >
7
+
8
+ <ui-select
9
+ v-if="!props.disabledPeriodOptions"
10
+ v-model="selectedPeriod"
11
+ :items="props.periodOptions"
12
+ :margin-between-trigger="4"
13
+ test-id="period-select"
14
+ width="auto"
15
+ />
16
+ <span v-else class="single-option">{{
17
+ props.periodOptions[0].text
18
+ }}</span>
19
+ <span v-if="!props.disabledPeriodOptions" class="chart-text">
20
+ {{ props.chartTitleDate }}
21
+ </span>
22
+ <ui-skeleton-item
23
+ v-if="!props.disabledPeriodOptions && !props.chartTitleDate"
24
+ width="320"
25
+ height="16"
26
+ />
27
+
28
+ <ui-tooltip
29
+ v-show="props.isShowCustomIntervalButton"
30
+ id="tooltip-interval-modal-button"
31
+ test-id="tooltip-interval-modal-button"
32
+ size="sm"
33
+ position="bottom"
34
+ position-by-tooltip="center"
35
+ >
36
+ <template #target>
37
+ <div
38
+ id="tooltip-interval-modal-button"
39
+ class="popped tooltip inline-block"
40
+ >
41
+ <ui-icon
42
+ name="edit"
43
+ width="16"
44
+ height="16"
45
+ test-id="show-interval-modal-button"
46
+ class="interval-modal-button"
47
+ @click="onShowIntervalModal"
48
+ />
49
+ </div>
50
+ </template>
51
+ <template #content>
52
+ <span class="header-tooltip-text">
53
+ {{ localization.inventoryMonitor.changeCustomInterval }}
54
+ </span>
55
+ </template>
56
+ </ui-tooltip>
57
+ </div>
58
+
59
+ <div class="view-select-wrap">
60
+ <label for="view-select" class="label-select"
61
+ >{{ localization.common.view }}:</label
62
+ >
63
+ <ui-select
64
+ v-model="selectedView"
65
+ :items="props.viewOptions"
66
+ :margin-between-trigger="4"
67
+ test-id="view-select"
68
+ width="auto"
69
+ left
70
+ />
71
+ </div>
72
+ </div>
73
+
74
+ <common-monitor-overview-filters-custom-interval-modal
75
+ v-if="props.validDateEnd"
76
+ v-show="props.isShowIntervalModal"
77
+ :selected-periods="props.selectedPeriods"
78
+ :format-date="props.formatDate"
79
+ :current-lang="props.currentLang"
80
+ :valid-date-end="props.validDateEnd"
81
+ :selected-node-name="props.selectedNodeName"
82
+ @hide="onHideIntervalModal"
83
+ @submit="onSubmitIntervalModal"
84
+ />
85
+ </template>
86
+
87
+ <script setup lang="ts">
88
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
89
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
90
+
91
+ const selectedPeriod = defineModel<string>('selected-period')
92
+ const selectedView = defineModel<string>('selected-view')
93
+
94
+ const props = defineProps<{
95
+ disabledPeriodOptions: boolean
96
+ periodOptions: UI_I_OptionItem[]
97
+ isShowCustomIntervalButton: boolean
98
+ chartTitleDate: string
99
+ viewOptions: UI_I_OptionItem[]
100
+ validDateEnd: number
101
+ isShowIntervalModal: boolean
102
+ selectedPeriods: number[]
103
+ formatDate: string
104
+ currentLang: string
105
+ selectedNodeName: string
106
+ }>()
107
+ const emits = defineEmits<{
108
+ (event: 'submit-interval-modal', value: number[]): void
109
+ (event: 'show-interval-modal'): void
110
+ (event: 'hide-interval-modal'): void
111
+ }>()
112
+
113
+ const localization = computed<UI_I_Localization>(() => useLocal())
114
+
115
+ const onShowIntervalModal = (): void => {
116
+ emits('show-interval-modal')
117
+ }
118
+ const onHideIntervalModal = (): void => {
119
+ emits('hide-interval-modal')
120
+ }
121
+ const onSubmitIntervalModal = (data: number[]): void => {
122
+ emits('submit-interval-modal', data)
123
+ }
124
+ </script>
125
+
126
+ <style>
127
+ :root {
128
+ --overview-filter-text-color: #4d5d69;
129
+ --overview-filter-edit-color: #008fd6;
130
+ --overview-filter-edit-hover-color: #0081c1;
131
+ }
132
+ :root.dark-theme {
133
+ --overview-filter-text-color: #e9eaec;
134
+ --overview-filter-edit-color: #2ba2de;
135
+ --overview-filter-edit-hover-color: #008fd6;
136
+ }
137
+ </style>
138
+ <style scoped lang="scss">
139
+ .overview-filters {
140
+ display: flex;
141
+ justify-content: space-between;
142
+ align-items: center;
143
+ flex-wrap: wrap;
144
+ grid-column-gap: 32px;
145
+ grid-row-gap: 16px;
146
+ padding: 12px 16px 16px 6px;
147
+
148
+ .period-select-wrap {
149
+ display: flex;
150
+ align-items: center;
151
+ flex-wrap: wrap;
152
+ grid-row-gap: 12px;
153
+
154
+ .chart-text {
155
+ font-size: 13px;
156
+ color: var(--overview-filter-text-color);
157
+ margin-left: 12px;
158
+ }
159
+
160
+ .interval-modal-button {
161
+ color: var(--overview-filter-edit-color);
162
+ margin-left: 8px;
163
+ cursor: pointer;
164
+
165
+ &:hover {
166
+ color: var(--overview-filter-edit-hover-color);
167
+ }
168
+ }
169
+ }
170
+
171
+ .view-select-wrap {
172
+ display: flex;
173
+ align-items: center;
174
+ }
175
+
176
+ .label-select {
177
+ font-size: 13px;
178
+ font-weight: 500;
179
+ color: var(--overview-filter-text-color);
180
+ margin-right: 12px;
181
+ }
182
+ }
183
+ </style>
@@ -59,6 +59,7 @@
59
59
  :format-date="props.formatDate"
60
60
  :current-lang="props.currentLang"
61
61
  :valid-date-end="props.validDateEnd"
62
+ :selected-node-name="props.selectedNodeName"
62
63
  @hide="onHideIntervalModal"
63
64
  @submit="onSubmitIntervalModal"
64
65
  />
@@ -82,6 +83,7 @@ const props = defineProps<{
82
83
  selectedPeriods: number[]
83
84
  formatDate: string
84
85
  currentLang: string
86
+ selectedNodeName: string
85
87
  }>()
86
88
  const emits = defineEmits<{
87
89
  (event: 'submit-interval-modal', value: number[]): void