bfg-common 1.3.612 → 1.3.614

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,212 +1,212 @@
1
- <template>
2
- <ul class="context-wrap">
3
- <span v-if="props.isLoading">
4
- <atoms-loader-pre-loader
5
- id="loader"
6
- class="absolute-center context-menu__loading"
7
- :show="true"
8
- />
9
- </span>
10
- <li
11
- v-for="(item, key) in props.items"
12
- :key="key"
13
- :class="[
14
- 'menu-item',
15
- { disabled: item.disabled || isLoading },
16
- { 'item-header': item.isHeader },
17
- { 'has-border-top': item.hasBorderTop },
18
- ]"
19
- @mouseenter="emits('toggle-items', [item, true, $event])"
20
- @mouseleave="emits('toggle-items', [item, false, $event])"
21
- >
22
- <span
23
- class="context-link"
24
- :data-id="`${item.testId}-context-link`"
25
- @mousedown="emits('select-item', item)"
26
- >
27
- <span :class="['context-icon', item.iconClassName]" />
28
- <span class="menu-item-text">{{ item.name }}</span>
29
- <span v-if="item.items.length" class="arrow-icon" />
30
- <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
31
- </span>
32
-
33
- <div class="context-children">
34
- <common-context-recursion
35
- v-show="item.isShowItems"
36
- :action-loading="props.actionLoading"
37
- :class="[{ 'child-show': item.isShowItems }]"
38
- :items="item.items"
39
- @select-item="emits('select-item', $event)"
40
- />
41
- </div>
42
- </li>
43
- </ul>
44
- </template>
45
-
46
- <script setup lang="ts">
47
- import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
48
- import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
49
-
50
- const props = defineProps<{
51
- items: UI_I_ContextMenuItem[]
52
- actionLoading: string | null
53
- isLoading: boolean
54
- testId?: string
55
- }>()
56
-
57
- const emits = defineEmits<{
58
- (event: 'select-item', value: UI_I_ContextMenuItem): void
59
- (
60
- event: 'toggle-items',
61
- value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
62
- ): void
63
- }>()
64
- </script>
65
-
66
- <style scoped lang="scss">
67
- .loader-wrapper {
68
- width: 100%;
69
- height: 100%;
70
- z-index: 100;
71
- }
72
-
73
- .context-menu__loading {
74
- :deep(.spinner) {
75
- width: 45px;
76
- height: 45px;
77
- min-width: 45px;
78
- min-height: 45px;
79
- z-index: 1000;
80
- }
81
- }
82
- .context-wrap {
83
- width: auto;
84
- max-width: 400px;
85
- background: var(--global-bg-color);
86
- border-radius: 0;
87
- color: #333;
88
- border: 1px solid var(--context-menu-border-color);
89
- user-select: none;
90
- list-style: none;
91
- max-height: 100vh;
92
- overflow-y: auto;
93
-
94
- .menu-item {
95
- position: relative;
96
- color: #565656;
97
- border-bottom: 1px solid transparent;
98
- cursor: pointer;
99
- padding: 5px 0 3px;
100
-
101
- &.has-border-top {
102
- border-top: 1px solid var(--context-menu-inset-border-color);
103
- }
104
-
105
- &.item-header {
106
- font-size: 11px;
107
- background-color: var(--context-menu-item-header-color);
108
- cursor: default;
109
- }
110
- &:not(.item-header):not(.disabled):hover {
111
- background-color: var(--context-menu-hover-bg-color);
112
- color: #454545;
113
- border-bottom: 1px solid var(--context-menu-hover-border-color);
114
- }
115
- &.disabled {
116
- opacity: 0.5;
117
- user-select: none;
118
- cursor: default;
119
- }
120
- &.left {
121
- :deep(.context-children) {
122
- left: 0;
123
- background: red;
124
-
125
- .context-wrap {
126
- transform: translateX(-100%);
127
- left: auto;
128
- }
129
- }
130
- }
131
-
132
- .context-link {
133
- position: relative;
134
- overflow: hidden;
135
- text-overflow: ellipsis;
136
- white-space: nowrap;
137
- display: flex;
138
- align-items: center;
139
- user-select: none;
140
- padding: 3px 20px 4px 10px;
141
-
142
- .menu-item-text {
143
- flex: 1 1 0;
144
- }
145
-
146
- .context-icon {
147
- display: inline-block;
148
- margin: -2px 4px 0 0;
149
- vertical-align: middle;
150
- width: 18px;
151
- height: 18px;
152
- }
153
-
154
- .arrow-icon {
155
- position: absolute;
156
- top: 50%;
157
- margin-top: -8px;
158
- right: 4px;
159
- background-image: url('assets/img/icons/sprite.png');
160
- display: inline-block;
161
- width: 16px;
162
- height: 16px;
163
- overflow: hidden;
164
- background-repeat: no-repeat;
165
- font-size: 0;
166
- line-height: 0;
167
- text-align: center;
168
- transform: rotate(90deg);
169
- }
170
-
171
- .shortcut {
172
- padding-left: 10px;
173
- }
174
- }
175
-
176
- .context-children {
177
- position: absolute;
178
- top: 0;
179
- left: 100%;
180
-
181
- .context-wrap {
182
- position: fixed;
183
- }
184
- }
185
- }
186
- }
187
- .context-menu__loading {
188
- :deep(.spinner) {
189
- width: 45px;
190
- height: 45px;
191
- min-width: 45px;
192
- min-height: 45px;
193
- z-index: 1000;
194
- }
195
- }
196
- </style>
197
- <style>
198
- :root {
199
- --context-menu-hover-bg-color: #e8e8e8;
200
- --context-menu-border-color: #949494;
201
- --context-menu-inset-border-color: #d4d5d6;
202
- --context-menu-item-header-color: #eceff2;
203
- --context-menu-hover-border-color: #666;
204
- }
205
- :root.dark-theme {
206
- --context-menu-hover-bg-color: #324f61;
207
- --context-menu-border-color: #495865;
208
- --context-menu-inset-border-color: #485764;
209
- --context-menu-item-header-color: #29414e;
210
- --context-menu-hover-border-color: #fff;
211
- }
212
- </style>
1
+ <template>
2
+ <ul class="context-wrap">
3
+ <span v-if="props.isLoading">
4
+ <atoms-loader-pre-loader
5
+ id="loader"
6
+ class="absolute-center context-menu__loading"
7
+ :show="true"
8
+ />
9
+ </span>
10
+ <li
11
+ v-for="(item, key) in props.items"
12
+ :key="key"
13
+ :class="[
14
+ 'menu-item',
15
+ { disabled: item.disabled || isLoading },
16
+ { 'item-header': item.isHeader },
17
+ { 'has-border-top': item.hasBorderTop },
18
+ ]"
19
+ @mouseenter="emits('toggle-items', [item, true, $event])"
20
+ @mouseleave="emits('toggle-items', [item, false, $event])"
21
+ >
22
+ <span
23
+ class="context-link"
24
+ :data-id="`${item.testId}-context-link`"
25
+ @mousedown="emits('select-item', item)"
26
+ >
27
+ <span :class="['context-icon', item.iconClassName]" />
28
+ <span class="menu-item-text">{{ item.name }}</span>
29
+ <span v-if="item.items.length" class="arrow-icon" />
30
+ <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
31
+ </span>
32
+
33
+ <div class="context-children">
34
+ <common-context-recursion
35
+ v-show="item.isShowItems"
36
+ :action-loading="props.actionLoading"
37
+ :class="[{ 'child-show': item.isShowItems }]"
38
+ :items="item.items"
39
+ @select-item="emits('select-item', $event)"
40
+ />
41
+ </div>
42
+ </li>
43
+ </ul>
44
+ </template>
45
+
46
+ <script setup lang="ts">
47
+ import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
48
+ import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
49
+
50
+ const props = defineProps<{
51
+ items: UI_I_ContextMenuItem[]
52
+ actionLoading: string | null
53
+ isLoading: boolean
54
+ testId?: string
55
+ }>()
56
+
57
+ const emits = defineEmits<{
58
+ (event: 'select-item', value: UI_I_ContextMenuItem): void
59
+ (
60
+ event: 'toggle-items',
61
+ value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
62
+ ): void
63
+ }>()
64
+ </script>
65
+
66
+ <style scoped lang="scss">
67
+ .loader-wrapper {
68
+ width: 100%;
69
+ height: 100%;
70
+ z-index: 100;
71
+ }
72
+
73
+ .context-menu__loading {
74
+ :deep(.spinner) {
75
+ width: 45px;
76
+ height: 45px;
77
+ min-width: 45px;
78
+ min-height: 45px;
79
+ z-index: 1000;
80
+ }
81
+ }
82
+ .context-wrap {
83
+ width: auto;
84
+ max-width: 400px;
85
+ background: var(--global-bg-color);
86
+ border-radius: 0;
87
+ color: #333;
88
+ border: 1px solid var(--context-menu-border-color);
89
+ user-select: none;
90
+ list-style: none;
91
+ max-height: 100vh;
92
+ overflow-y: auto;
93
+
94
+ .menu-item {
95
+ position: relative;
96
+ color: #565656;
97
+ border-bottom: 1px solid transparent;
98
+ cursor: pointer;
99
+ padding: 5px 0 3px;
100
+
101
+ &.has-border-top {
102
+ border-top: 1px solid var(--context-menu-inset-border-color);
103
+ }
104
+
105
+ &.item-header {
106
+ font-size: 11px;
107
+ background-color: var(--context-menu-item-header-color);
108
+ cursor: default;
109
+ }
110
+ &:not(.item-header):not(.disabled):hover {
111
+ background-color: var(--context-menu-hover-bg-color);
112
+ color: #454545;
113
+ border-bottom: 1px solid var(--context-menu-hover-border-color);
114
+ }
115
+ &.disabled {
116
+ opacity: 0.5;
117
+ user-select: none;
118
+ cursor: default;
119
+ }
120
+ &.left {
121
+ :deep(.context-children) {
122
+ left: 0;
123
+ background: red;
124
+
125
+ .context-wrap {
126
+ transform: translateX(-100%);
127
+ left: auto;
128
+ }
129
+ }
130
+ }
131
+
132
+ .context-link {
133
+ position: relative;
134
+ overflow: hidden;
135
+ text-overflow: ellipsis;
136
+ white-space: nowrap;
137
+ display: flex;
138
+ align-items: center;
139
+ user-select: none;
140
+ padding: 3px 20px 4px 10px;
141
+
142
+ .menu-item-text {
143
+ flex: 1 1 0;
144
+ }
145
+
146
+ .context-icon {
147
+ display: inline-block;
148
+ margin: -2px 4px 0 0;
149
+ vertical-align: middle;
150
+ width: 18px;
151
+ height: 18px;
152
+ }
153
+
154
+ .arrow-icon {
155
+ position: absolute;
156
+ top: 50%;
157
+ margin-top: -8px;
158
+ right: 4px;
159
+ background-image: url('assets/img/icons/sprite.png');
160
+ display: inline-block;
161
+ width: 16px;
162
+ height: 16px;
163
+ overflow: hidden;
164
+ background-repeat: no-repeat;
165
+ font-size: 0;
166
+ line-height: 0;
167
+ text-align: center;
168
+ transform: rotate(90deg);
169
+ }
170
+
171
+ .shortcut {
172
+ padding-left: 10px;
173
+ }
174
+ }
175
+
176
+ .context-children {
177
+ position: absolute;
178
+ top: 0;
179
+ left: 100%;
180
+
181
+ .context-wrap {
182
+ position: fixed;
183
+ }
184
+ }
185
+ }
186
+ }
187
+ .context-menu__loading {
188
+ :deep(.spinner) {
189
+ width: 45px;
190
+ height: 45px;
191
+ min-width: 45px;
192
+ min-height: 45px;
193
+ z-index: 1000;
194
+ }
195
+ }
196
+ </style>
197
+ <style>
198
+ :root {
199
+ --context-menu-hover-bg-color: #e8e8e8;
200
+ --context-menu-border-color: #949494;
201
+ --context-menu-inset-border-color: #d4d5d6;
202
+ --context-menu-item-header-color: #eceff2;
203
+ --context-menu-hover-border-color: #666;
204
+ }
205
+ :root.dark-theme {
206
+ --context-menu-hover-bg-color: #324f61;
207
+ --context-menu-border-color: #495865;
208
+ --context-menu-inset-border-color: #485764;
209
+ --context-menu-item-header-color: #29414e;
210
+ --context-menu-hover-border-color: #fff;
211
+ }
212
+ </style>
@@ -1,114 +1,114 @@
1
- <template>
2
- <div class="most-alert">
3
- <atoms-table-data-grid
4
- v-model:selected-row="selectedRow"
5
- v-model:page-size="pageSize"
6
- v-model:page="page"
7
- class="data-table"
8
- test-id="alerts-table"
9
- :head-items="headItems"
10
- :body-items="bodyItems"
11
- :total-items="bodyItems.length"
12
- :total-pages="1"
13
- off-select-by-row
14
- hide-page-size
15
- show-page-info
16
- server-off
17
- >
18
- <template #th="{ item }">
19
- <atoms-the-icon
20
- width="20px"
21
- height="20px"
22
- :name="item.iconName"
23
- class="title-icon"
24
- />
25
- <span class="title-column"> {{ item.text }} </span>
26
- </template>
27
- <template #icon="{ item }">
28
- <span :class="['datagrid-cell-icon', item.data.iconClassName]" />
29
- <a
30
- v-if="item.data.isLink"
31
- href="javascript:void(0)"
32
- class="text-ellipsis"
33
- :title="item.text"
34
- data-id="select-node-of-tree"
35
- @click="selectNodeOfTree(item.data)"
36
- >{{ item.text }}</a
37
- >
38
- <span v-else class="text-ellipsis">
39
- {{ item.text }}
40
- </span>
41
- </template>
42
- </atoms-table-data-grid>
43
- </div>
44
- </template>
45
-
46
- <script setup lang="ts">
47
- import type {
48
- UI_I_HeadItem,
49
- UI_I_BodyItem,
50
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
51
- import type { UI_I_Localization } from '~/lib/models/interfaces'
52
- import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
53
- import type { UI_I_Alert } from '~/components/common/home/lib/models/interfaces'
54
- import type { UI_I_AlertData } from '~/components/common/home/alertsTable/lib/models/interfaces'
55
- import * as table from '~/components/common/home/alertsTable/lib/config/config'
56
-
57
- const props = defineProps<{
58
- dataTable: UI_I_Alert[]
59
- }>()
60
-
61
- const emits = defineEmits<{
62
- (event: 'select-node-of-tree', value: UI_I_AlertData): void
63
- }>()
64
-
65
- const localization = computed<UI_I_Localization>(() => useLocal())
66
-
67
- const selectedRow = ref<UI_T_SelectedRow>(null)
68
- const headItems = computed<UI_I_HeadItem[]>(() =>
69
- table.headItems(localization.value)
70
- )
71
- const bodyItems = ref<UI_I_BodyItem[][]>([])
72
- watch(
73
- () => props.dataTable,
74
- (newValue) => {
75
- if (!newValue?.length) {
76
- bodyItems.value = []
77
- return
78
- }
79
-
80
- bodyItems.value = table.bodyItems(newValue)
81
- },
82
- { deep: true, immediate: true }
83
- )
84
- const page = ref<number>(1)
85
- const pageSize = ref<number>(1)
86
-
87
- const selectNodeOfTree = (item: UI_I_AlertData): void => {
88
- emits('select-node-of-tree', item)
89
- }
90
- </script>
91
-
92
- <style lang="scss" scoped>
93
- .most-alert {
94
- margin: 0;
95
- border: none;
96
-
97
- :deep(.datagrid-outer-wrapper) {
98
- padding: 0;
99
-
100
- .datagrid {
101
- margin: 0;
102
- border: unset;
103
- min-height: 200px;
104
- }
105
- }
106
-
107
- .title-column {
108
- font-size: 11px;
109
- font-weight: 700;
110
- overflow: hidden;
111
- text-overflow: ellipsis;
112
- }
113
- }
114
- </style>
1
+ <template>
2
+ <div class="most-alert">
3
+ <atoms-table-data-grid
4
+ v-model:selected-row="selectedRow"
5
+ v-model:page-size="pageSize"
6
+ v-model:page="page"
7
+ class="data-table"
8
+ test-id="alerts-table"
9
+ :head-items="headItems"
10
+ :body-items="bodyItems"
11
+ :total-items="bodyItems.length"
12
+ :total-pages="1"
13
+ off-select-by-row
14
+ hide-page-size
15
+ show-page-info
16
+ server-off
17
+ >
18
+ <template #th="{ item }">
19
+ <atoms-the-icon
20
+ width="20px"
21
+ height="20px"
22
+ :name="item.iconName"
23
+ class="title-icon"
24
+ />
25
+ <span class="title-column"> {{ item.text }} </span>
26
+ </template>
27
+ <template #icon="{ item }">
28
+ <span :class="['datagrid-cell-icon', item.data.iconClassName]" />
29
+ <a
30
+ v-if="item.data.isLink"
31
+ href="javascript:void(0)"
32
+ class="text-ellipsis"
33
+ :title="item.text"
34
+ data-id="select-node-of-tree"
35
+ @click="selectNodeOfTree(item.data)"
36
+ >{{ item.text }}</a
37
+ >
38
+ <span v-else class="text-ellipsis">
39
+ {{ item.text }}
40
+ </span>
41
+ </template>
42
+ </atoms-table-data-grid>
43
+ </div>
44
+ </template>
45
+
46
+ <script setup lang="ts">
47
+ import type {
48
+ UI_I_HeadItem,
49
+ UI_I_BodyItem,
50
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
51
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
52
+ import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
53
+ import type { UI_I_Alert } from '~/components/common/home/lib/models/interfaces'
54
+ import type { UI_I_AlertData } from '~/components/common/home/alertsTable/lib/models/interfaces'
55
+ import * as table from '~/components/common/home/alertsTable/lib/config/config'
56
+
57
+ const props = defineProps<{
58
+ dataTable: UI_I_Alert[]
59
+ }>()
60
+
61
+ const emits = defineEmits<{
62
+ (event: 'select-node-of-tree', value: UI_I_AlertData): void
63
+ }>()
64
+
65
+ const localization = computed<UI_I_Localization>(() => useLocal())
66
+
67
+ const selectedRow = ref<UI_T_SelectedRow>(null)
68
+ const headItems = computed<UI_I_HeadItem[]>(() =>
69
+ table.headItems(localization.value)
70
+ )
71
+ const bodyItems = ref<UI_I_BodyItem[][]>([])
72
+ watch(
73
+ () => props.dataTable,
74
+ (newValue) => {
75
+ if (!newValue?.length) {
76
+ bodyItems.value = []
77
+ return
78
+ }
79
+
80
+ bodyItems.value = table.bodyItems(newValue)
81
+ },
82
+ { deep: true, immediate: true }
83
+ )
84
+ const page = ref<number>(1)
85
+ const pageSize = ref<number>(1)
86
+
87
+ const selectNodeOfTree = (item: UI_I_AlertData): void => {
88
+ emits('select-node-of-tree', item)
89
+ }
90
+ </script>
91
+
92
+ <style lang="scss" scoped>
93
+ .most-alert {
94
+ margin: 0;
95
+ border: none;
96
+
97
+ :deep(.datagrid-outer-wrapper) {
98
+ padding: 0;
99
+
100
+ .datagrid {
101
+ margin: 0;
102
+ border: unset;
103
+ min-height: 200px;
104
+ }
105
+ }
106
+
107
+ .title-column {
108
+ font-size: 11px;
109
+ font-weight: 700;
110
+ overflow: hidden;
111
+ text-overflow: ellipsis;
112
+ }
113
+ }
114
+ </style>