bfg-common 1.4.706 → 1.4.708

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.
@@ -2285,6 +2285,7 @@
2285
2285
  "export": "Экспарт",
2286
2286
  "allRowsCount": "Усе радкі ({0})",
2287
2287
  "selectedRowsCount": "Выбраныя радкі ({0})",
2288
+ "viewZone": "View Zone",
2288
2289
  "searchHere": "Шукайце тут...",
2289
2290
  "columns": "Стоўбцы"
2290
2291
  },
@@ -2289,6 +2289,7 @@
2289
2289
  "export": "Export",
2290
2290
  "allRowsCount": "All rows ({0})",
2291
2291
  "selectedRowsCount": "Selected rows ({0})",
2292
+ "viewZone": "View Zone",
2292
2293
  "searchHere": "Search here...",
2293
2294
  "columns": "Columns"
2294
2295
  },
@@ -2289,6 +2289,7 @@
2289
2289
  "export": "Արտահանում",
2290
2290
  "allRowsCount": "Բոլոր տողերը ({0})",
2291
2291
  "selectedRowsCount": "Ընտրված տողերը ({0})",
2292
+ "viewZone": "Դիտել գոտին",
2292
2293
  "searchHere": "Փնտրել այստեղ...",
2293
2294
  "columns": "Սյունակներ"
2294
2295
  },
@@ -2288,6 +2288,7 @@
2288
2288
  "export": "Сыртқа шығару",
2289
2289
  "allRowsCount": "Барлық жолдар ({0})",
2290
2290
  "selectedRowsCount": "Таңдалған жолдар ({0})",
2291
+ "viewZone": "Қарау аймағы",
2291
2292
  "searchHere": "Мұнда іздеңіз...",
2292
2293
  "columns": "Бағандар"
2293
2294
  },
@@ -2290,6 +2290,7 @@
2290
2290
  "export": "Экспорт",
2291
2291
  "allRowsCount": "Все строки ({0})",
2292
2292
  "selectedRowsCount": "Выбранные строки ({0})",
2293
+ "viewZone": "Просмотр зоны",
2293
2294
  "searchHere": "Искать здесь...",
2294
2295
  "columns": "Столбцы"
2295
2296
  },
@@ -2287,6 +2287,7 @@
2287
2287
  "export": "出口",
2288
2288
  "allRowsCount": "所有行({0})",
2289
2289
  "selectedRowsCount": "选定的行({0})",
2290
+ "viewZone": "查看区域",
2290
2291
  "searchHere": "在这里搜索。。。",
2291
2292
  "columns": "列"
2292
2293
  },
@@ -117,6 +117,7 @@ const onKeyDown = (event: KeyboardEvent): void => {
117
117
  nextTabItem()
118
118
  break
119
119
  case 'Enter':
120
+ event.preventDefault()
120
121
  onSelect(selectedTabIndex.value)
121
122
  break
122
123
  case 'Tab':
@@ -35,6 +35,7 @@
35
35
  :data-id="`${props.testId}-page-input`"
36
36
  type="text"
37
37
  class="pagination-current clr-input"
38
+ @keydown.enter="changeCurrentPageManual"
38
39
  @blur="changeCurrentPageManual"
39
40
  />
40
41
  <span class="divider">/</span>
@@ -114,7 +115,7 @@ const changeCurrentPage = (page: number): void => {
114
115
  if (page > props.totalPages || page < 1) return
115
116
  changePageAndLazy(page)
116
117
  }
117
- const changeCurrentPageManual = (e: UI_I_HTMLSelectElement): void => {
118
+ const changeCurrentPageManual = (e: any): void => {
118
119
  const newVal = parseInt(e.target.value)
119
120
 
120
121
  if (typeof newVal !== 'number' || isNaN(newVal)) {
@@ -1,199 +1,210 @@
1
- <template>
2
- <ul class="context-wrap relative">
3
- <template v-if="props.isLoading">
4
- <ui-loader2 class="context-loader" test-id="context-menu" />
5
- </template>
6
- <li
7
- v-for="(item, key) in props.items"
8
- :key="key"
9
- :class="[
10
- 'menu-item',
11
- { disabled: item.disabled || isLoading },
12
- { 'show-children': item.isShowItems },
13
- { 'has-divider': item.hasBorderTop },
14
- ]"
15
- @mouseenter="emits('toggle-items', [item, true, $event])"
16
- @mouseleave="emits('toggle-items', [item, false, $event])"
17
- >
18
- <span
19
- class="context-link"
20
- :style="item.style"
21
- :data-id="`${item.testId}-context-link`"
22
- @mousedown="emits('select-item', item)"
23
- >
24
- <span :class="['context-icon', item.iconClassName]" />
25
- <span class="menu-item-text">{{ item.name }}</span>
26
- <ui-icon v-if="item.items.length" name="arrow" class="arrow-icon" />
27
- <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
28
- </span>
29
-
30
- <div class="context-children">
31
- <common-context-recursion
32
- v-show="item.isShowItems"
33
- :action-loading="props.actionLoading"
34
- :items="item.items"
35
- @select-item="emits('select-item', $event)"
36
- />
37
- </div>
38
- </li>
39
- </ul>
40
- </template>
41
-
42
- <script setup lang="ts">
43
- import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
44
- import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
45
-
46
- const props = defineProps<{
47
- items: UI_I_ContextMenuItem[]
48
- actionLoading: string | null
49
- isLoading: boolean
50
- testId?: string
51
- }>()
52
-
53
- const emits = defineEmits<{
54
- (event: 'select-item', value: UI_I_ContextMenuItem): void
55
- (
56
- event: 'toggle-items',
57
- value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
58
- ): void
59
- }>()
60
- </script>
61
-
62
- <style scoped lang="scss">
63
- .context-wrap {
64
- width: auto;
65
- max-width: 400px;
66
- background: var(--context-menu-bg-color);
67
- border-radius: 8px;
68
- user-select: none;
69
- list-style: none;
70
- max-height: 100vh;
71
- box-shadow: 0 4px 20px 0 #0000001f;
72
- padding: 8px;
73
-
74
- .context-loader {
75
- position: absolute;
76
- width: 40px;
77
- top: calc(50% - 20px);
78
- left: calc(50% - 20px);
79
- }
80
-
81
- .menu-item {
82
- position: relative;
83
- color: var(--context-menu-text-color);
84
- cursor: pointer;
85
- border-radius: 4px;
86
-
87
- &.show-children::after {
88
- content: '';
89
- position: absolute;
90
- top: 0;
91
- left: 100%;
92
- width: 12px;
93
- height: 100%;
94
- }
95
-
96
- &:not(:last-child) {
97
- margin-bottom: 8px;
98
- }
99
-
100
- &:not(.disabled) > .context-link:hover {
101
- background-color: var(--context-menu-item-bg-hover-color);
102
- color: var(--context-menu-text-hover-color);
103
- }
104
- &.disabled {
105
- opacity: 0.5;
106
- user-select: none;
107
- cursor: default;
108
- }
109
- &.left {
110
- &.show-children::after {
111
- left: -12px;
112
- }
113
- :deep(.context-children) {
114
- left: -12px;
115
-
116
- .context-wrap {
117
- transform: translateX(-100%);
118
- left: auto;
119
- }
120
- }
121
- }
122
-
123
- &.has-divider::before {
124
- content: '';
125
- display: block;
126
- height: 0.03rem;
127
- background-color: var(--context-menu-border-color);
128
- margin-bottom: 8px;
129
- }
130
-
131
- .context-link {
132
- position: relative;
133
- overflow: hidden;
134
- text-overflow: ellipsis;
135
- white-space: nowrap;
136
- display: flex;
137
- align-items: center;
138
- user-select: none;
139
- border-radius: 4px;
140
- padding: 6px 8px;
141
-
142
- .menu-item-text {
143
- flex: 1 1 0;
144
- font-size: 13px;
145
- font-weight: 400;
146
- line-height: 15.73px;
147
- }
148
-
149
- .context-icon {
150
- margin-right: 8px;
151
- width: 20px;
152
- height: 20px;
153
- }
154
-
155
- .arrow-icon {
156
- position: absolute;
157
- top: 50%;
158
- margin-top: -8px;
159
- right: 4px;
160
- display: inline-block;
161
- width: 16px;
162
- height: 16px;
163
- overflow: hidden;
164
- transform: rotate(90deg);
165
- }
166
-
167
- .shortcut {
168
- padding-left: 10px;
169
- }
170
- }
171
-
172
- .context-children {
173
- position: absolute;
174
- top: 0;
175
- left: calc(100% + 12px);
176
-
177
- .context-wrap {
178
- position: fixed;
179
- }
180
- }
181
- }
182
- }
183
- </style>
184
- <style>
185
- :root.is-new-view {
186
- --context-menu-bg-color: #ffffff;
187
- --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.4);
188
- --context-menu-text-color: #4d5d69;
189
- --context-menu-text-hover-color: #182531;
190
- --context-menu-border-color: #e9ebed;
191
- }
192
- :root.is-new-view.dark-theme {
193
- --context-menu-bg-color: #334453;
194
- --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.06);
195
- --context-menu-text-color: #e9eaec;
196
- --context-menu-text-hover-color: #ffffff;
197
- --context-menu-border-color: rgba(233, 235, 237, 0.12);
198
- }
199
- </style>
1
+ <template>
2
+ <ul class="context-wrap relative">
3
+ <template v-if="props.isLoading">
4
+ <ui-loader2 class="context-loader" test-id="context-menu" />
5
+ </template>
6
+ <li
7
+ v-for="(item, key) in props.items"
8
+ :key="key"
9
+ :class="[
10
+ 'menu-item',
11
+ { disabled: item.disabled || isLoading },
12
+ { 'show-children': item.isShowItems },
13
+ { 'has-divider': item.hasBorderTop },
14
+ ]"
15
+ @mouseenter="emits('toggle-items', [item, true, $event])"
16
+ @mouseleave="emits('toggle-items', [item, false, $event])"
17
+ >
18
+ <span
19
+ class="context-link"
20
+ :style="item.style"
21
+ :data-id="`${item.testId}-context-link`"
22
+ @mousedown="emits('select-item', item)"
23
+ >
24
+ <span :class="['context-icon', item.iconClassName]" />
25
+ <span class="menu-item-text">{{ item.name }}</span>
26
+ <ui-icon v-if="item.items.length" name="arrow" class="arrow-icon" />
27
+ <span v-if="item.shortcut" class="shortcut">{{ item.shortcut }}</span>
28
+ </span>
29
+
30
+ <div class="context-children">
31
+ <common-context-recursion
32
+ v-show="item.isShowItems"
33
+ :action-loading="props.actionLoading"
34
+ :items="item.items"
35
+ @select-item="emits('select-item', $event)"
36
+ />
37
+ </div>
38
+ </li>
39
+ </ul>
40
+ </template>
41
+
42
+ <script setup lang="ts">
43
+ import type { UI_I_ContextMenuItem } from '~/components/common/context/lib/models/interfaces'
44
+ import type { I_HTMLLiElement } from '~/components/common/context/recursion/lib/models/interfaces'
45
+
46
+ const props = defineProps<{
47
+ items: UI_I_ContextMenuItem[]
48
+ actionLoading: string | null
49
+ isLoading: boolean
50
+ testId?: string
51
+ }>()
52
+
53
+ const emits = defineEmits<{
54
+ (event: 'select-item', value: UI_I_ContextMenuItem): void
55
+ (
56
+ event: 'toggle-items',
57
+ value: [UI_I_ContextMenuItem, boolean, I_HTMLLiElement]
58
+ ): void
59
+ }>()
60
+ </script>
61
+
62
+ <style scoped lang="scss">
63
+ .context-wrap {
64
+ width: auto;
65
+ max-width: 400px;
66
+ background: var(--context-menu-bg-color);
67
+ border-radius: 8px;
68
+ user-select: none;
69
+ list-style: none;
70
+ max-height: 100vh;
71
+ box-shadow: 0 4px 20px 0 #0000001f;
72
+ padding: 8px;
73
+
74
+ .context-loader {
75
+ position: absolute;
76
+ width: 40px;
77
+ top: calc(50% - 20px);
78
+ left: calc(50% - 20px);
79
+ }
80
+
81
+ .menu-item {
82
+ position: relative;
83
+ color: var(--context-menu-text-color);
84
+ cursor: pointer;
85
+ border-radius: 4px;
86
+
87
+ &.show-children::after {
88
+ content: '';
89
+ position: absolute;
90
+ top: 0;
91
+ left: 100%;
92
+ width: 12px;
93
+ height: 100%;
94
+ }
95
+
96
+ &:not(:last-child) {
97
+ margin-bottom: 8px;
98
+ }
99
+
100
+ &:not(.disabled) > .context-link:hover {
101
+ background-color: var(--context-menu-item-bg-hover-color);
102
+ color: var(--context-menu-text-hover-color);
103
+ }
104
+
105
+ &.left {
106
+ &.show-children::after {
107
+ left: -12px;
108
+ }
109
+ :deep(.context-children) {
110
+ left: -12px;
111
+
112
+ .context-wrap {
113
+ transform: translateX(-100%);
114
+ left: auto;
115
+ }
116
+ }
117
+ }
118
+
119
+ &.has-divider::before {
120
+ content: '';
121
+ display: block;
122
+ height: 0.03rem;
123
+ background-color: var(--context-menu-border-color);
124
+ margin-bottom: 8px;
125
+ }
126
+
127
+ .context-link {
128
+ position: relative;
129
+ overflow: hidden;
130
+ text-overflow: ellipsis;
131
+ white-space: nowrap;
132
+ display: flex;
133
+ align-items: center;
134
+ user-select: none;
135
+ border-radius: 4px;
136
+ padding: 6px 8px;
137
+
138
+ .menu-item-text {
139
+ flex: 1 1 0;
140
+ font-size: 13px;
141
+ font-weight: 400;
142
+ line-height: 15.73px;
143
+ }
144
+
145
+ .context-icon {
146
+ margin-right: 8px;
147
+ width: 20px;
148
+ height: 20px;
149
+ }
150
+
151
+ .arrow-icon {
152
+ position: absolute;
153
+ top: 50%;
154
+ margin-top: -8px;
155
+ right: 4px;
156
+ display: inline-block;
157
+ width: 16px;
158
+ height: 16px;
159
+ overflow: hidden;
160
+ transform: rotate(90deg);
161
+ }
162
+
163
+ .shortcut {
164
+ color: #9da6ad;
165
+ padding-left: 10px;
166
+ }
167
+ }
168
+
169
+ &.disabled {
170
+ color: var(--context-menu-text-disabled-color);
171
+ user-select: none;
172
+ cursor: default;
173
+ .context-icon {
174
+ opacity: 0.5;
175
+ }
176
+ .shortcut {
177
+ color: var(--context-menu-text-disabled-color);
178
+ }
179
+ }
180
+
181
+ .context-children {
182
+ position: absolute;
183
+ top: 0;
184
+ left: calc(100% + 12px);
185
+
186
+ .context-wrap {
187
+ position: fixed;
188
+ }
189
+ }
190
+ }
191
+ }
192
+ </style>
193
+ <style>
194
+ :root.is-new-view {
195
+ --context-menu-bg-color: #ffffff;
196
+ --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.4);
197
+ --context-menu-text-color: #4d5d69;
198
+ --context-menu-text-disabled-color: #bdc3c7;
199
+ --context-menu-text-hover-color: #182531;
200
+ --context-menu-border-color: #e9ebed;
201
+ }
202
+ :root.is-new-view.dark-theme {
203
+ --context-menu-bg-color: #334453;
204
+ --context-menu-item-bg-hover-color: rgba(233, 235, 237, 0.06);
205
+ --context-menu-text-color: #e9eaec;
206
+ --context-menu-text-disabled-color: #bdc3c7b8;
207
+ --context-menu-text-hover-color: #ffffff;
208
+ --context-menu-border-color: rgba(233, 235, 237, 0.12);
209
+ }
210
+ </style>
@@ -1,40 +1,16 @@
1
1
  <template>
2
2
  <div class="tasks">
3
- <common-headline
4
- :headline="localization.common.taskConsole"
5
- class="tasks__headline"
6
- />
7
-
8
- <div class="btn-group">
9
- <button
10
- id="task-previous-button"
11
- data-id="task-previous-button"
12
- class="btn btn-sm btn-link nav-link"
13
- :disabled="pagination.page === 1"
14
- @click="onClickButton('previous')"
15
- >
16
- {{ localization.common.previous }}
17
- </button>
18
-
19
- <button
20
- id="task-next-button"
21
- data-id="task-next-button"
22
- class="btn btn-sm btn-link nav-link"
23
- :disabled="pagination.page === tasksList?.total_pages"
24
- @click="onClickButton('next')"
25
- >
26
- {{ localization.common.next }}
27
- </button>
3
+ <div class="tasks__headline">
4
+ {{ localization.mainNavigation.tasks }}
28
5
  </div>
29
6
 
30
- <templates-tasks-table-view
31
- :data-table="tasksList?.items || []"
32
- :total-items="tasksList?.total_items || 0"
7
+ <common-pages-tasks-table
8
+ :table-data="tasksList?.items || []"
33
9
  :total-pages="tasksList?.total_pages || 1"
34
- :pagination="pagination"
10
+ :total-items="tasksList?.total_items || 0"
35
11
  :loading="isLoading"
12
+ :project="props.project"
36
13
  @pagination="onUpdatePagination"
37
- @sort="onSortTable"
38
14
  />
39
15
  </div>
40
16
  </template>
@@ -46,31 +22,28 @@ import type {
46
22
  UI_I_DataTableQuery,
47
23
  } from '~/lib/models/table/interfaces'
48
24
  import type { UI_I_Task } from '~/lib/models/store/tasks/interfaces'
49
-
50
- definePageMeta({
51
- middleware: ['auth'],
52
- })
25
+ import type { UI_T_Project } from '~/lib/models/types'
53
26
 
54
27
  const localization = computed<UI_I_Localization>(() => useLocal())
55
28
  const { $store }: any = useNuxtApp()
56
29
 
30
+ const props = defineProps<{
31
+ project: UI_T_Project
32
+ }>()
33
+
57
34
  const pagination = ref<UI_I_Pagination>({
58
35
  page: 1,
59
36
  pageSize: 100,
60
37
  })
61
38
  const sort = ref<string | null>(null)
62
39
 
63
- const tasksList = computed<UI_I_Task>(() => $store.getters['tasks/getTaskList'])
64
-
65
- const onClickButton = (status: string): void => {
66
- if (status === 'next') {
67
- pagination.value.page += 1
68
- return
69
- }
70
-
71
- pagination.value.page -= 1
40
+ const pauseGlobalRefresh = (): void => {
41
+ const tasksLastRequestType = $store.getters['tasks/getTasksLastRequestType']
42
+ $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', tasksLastRequestType)
72
43
  }
73
44
 
45
+ const tasksList = computed<UI_I_Task>(() => $store.getters['tasks/getTaskList'])
46
+
74
47
  const getTasks = async (): Promise<void> => {
75
48
  pauseGlobalRefresh()
76
49
 
@@ -80,41 +53,43 @@ const getTasks = async (): Promise<void> => {
80
53
  }
81
54
  await $store.dispatch('tasks/A_GET_TASKS', payload)
82
55
  }
56
+ getTasks()
83
57
 
84
58
  const onUpdatePagination = (event: UI_I_Pagination): void => {
85
59
  pagination.value = event
86
60
  getTasks()
87
61
  }
88
62
 
89
- const onSortTable = (event: string): void => {
90
- sort.value = event
91
- getTasks()
92
- }
63
+ // const onSortTable = (event: string): void => {
64
+ // sort.value = event
65
+ // getTasks()
66
+ // }
93
67
 
94
68
  const isLoading = computed<boolean>(() =>
95
69
  $store.getters['tasks/getLoading']('tasks')
96
70
  )
97
- const pauseGlobalRefresh = (): void => {
98
- const tasksLastRequestType = $store.getters['tasks/getTasksLastRequestType']
99
- $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', tasksLastRequestType)
100
- }
71
+
101
72
  onUnmounted(() => {
102
73
  pauseGlobalRefresh()
103
74
  })
104
75
  </script>
105
76
 
106
- <style lang="scss">
107
- @import '~/node_modules/bfg-common/assets/scss/common/mixins';
77
+ <style lang="scss" scoped>
108
78
  .tasks {
109
- @include flex($dir: column);
110
- height: 100%;
111
- padding-left: 10px;
79
+ display: flex; // TODO надо удалить потом (clr style)
80
+ flex-direction: column; // TODO надо удалить потом (clr style)
81
+ height: inherit;
82
+ padding: 10px 16px 30px;
112
83
  &__headline {
113
- padding-left: 10px;
114
- margin-bottom: 0.6rem;
84
+ font-family: Inter, sans-serif;
85
+ font-weight: 400;
86
+ font-size: 22px;
87
+ line-height: 26.63px;
88
+ color: var(--title-form-first-color);
89
+ margin-bottom: 22px;
115
90
  }
116
- .btn {
117
- text-transform: uppercase;
91
+ :deep(.data-table-header) {
92
+ z-index: 1050 !important; // TODO надо удалить потом (clr style)
118
93
  }
119
94
  }
120
95
  </style>