bfg-common 1.5.92 → 1.5.94
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.
- package/assets/scss/common/normalize.scss +347 -347
- package/components/atoms/alert/Notification.vue +169 -169
- package/components/atoms/autocomplete/Autocomplete.vue +361 -362
- package/components/atoms/collapse/CollapseNav.vue +169 -169
- package/components/atoms/comboDropdownMenu/ComboDropdownMenu.vue +357 -357
- package/components/atoms/combobox/Combobox.vue +154 -154
- package/components/atoms/datepicker/Datepicker.vue +639 -639
- package/components/atoms/dropdown/Portlet.vue +113 -113
- package/components/atoms/dropdown/dropdown/Dropdown.vue +168 -168
- package/components/atoms/dropdown/tree/Tree.vue +137 -137
- package/components/atoms/list/SelectList.vue +63 -63
- package/components/atoms/list/dragDropList/DragDropList.vue +148 -148
- package/components/atoms/modal/Modal.vue +250 -250
- package/components/atoms/modal/bySteps/BySteps.vue +253 -253
- package/components/atoms/notificationBar/NotificationBar.vue +178 -178
- package/components/atoms/popover/Popover.vue +58 -58
- package/components/atoms/popover/lib/models/interfaces.ts +4 -4
- package/components/atoms/select/TheSelect.vue +187 -187
- package/components/atoms/stack/StackBlock.vue +185 -185
- package/components/atoms/stack/StackContent.vue +63 -63
- package/components/atoms/step/lib/models/verticalStepItem.ts +5 -5
- package/components/atoms/switch/Switch.vue +111 -111
- package/components/atoms/table/compact/Compact.vue +529 -529
- package/components/atoms/table/dataGrid/DataGrid.vue +1716 -1713
- package/components/atoms/table/dataGrid/DataGridPage.vue +195 -195
- package/components/atoms/table/info/Info.vue +2 -2
- package/components/atoms/table/simpleEvent/SimpleEvent.vue +98 -98
- package/components/atoms/table/simpleInfo/SimpleInfo.vue +73 -73
- package/components/atoms/tabs/Tabs.vue +217 -217
- package/components/atoms/wizard/Wizard.vue +341 -341
- package/components/common/accordion/Recursion.vue +222 -222
- package/components/common/adapterManager/AddAdapterModal.vue +561 -561
- package/components/common/adapterManager/ui/actions/AddAdapterButton.vue +30 -30
- package/components/common/adapterManager/ui/table/Table.vue +162 -162
- package/components/common/browse/BrowseNew.vue +237 -237
- package/components/common/browse/BrowseOld.vue +217 -217
- package/components/common/browse/blocks/TitleNew.vue +145 -145
- package/components/common/browse/blocks/TitleOld.vue +91 -91
- package/components/common/browse/blocks/contents/FilesOld.vue +72 -72
- package/components/common/chartOptionsModal/counters/timespan/form/FormNew.vue +262 -262
- package/components/common/context/Context.vue +111 -111
- package/components/common/context/recursion/RecursionOld.vue +228 -228
- package/components/common/details/DetailsItem.vue +109 -109
- package/components/common/feedback/Buttons.vue +229 -229
- package/components/common/feedback/Feedback.vue +270 -270
- package/components/common/feedback/Message.vue +519 -519
- package/components/common/graph/graphNew/GraphNew.vue +194 -194
- package/components/common/graph/lib/utils/renderGraph.ts +389 -389
- package/components/common/layout/theHeader/feedback/new/New.vue +227 -227
- package/components/common/layout/theHeader/feedback/new/additionalDetails/AdditionalDetails.vue +606 -606
- package/components/common/layout/theHeader/feedback/new/additionalDetails/Headline.vue +98 -98
- package/components/common/layout/theHeader/feedback/new/description/Description.vue +59 -59
- package/components/common/layout/theHeader/feedback/new/email/Email.vue +43 -43
- package/components/common/layout/theHeader/feedback/new/subtitle/Subtitle.vue +103 -103
- package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +112 -112
- package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +80 -80
- package/components/common/layout/theHeader/helpMenu/helpMenuOld/HelpMenuOld.vue +1 -1
- package/components/common/layout/theHeader/modals/Reconnect.vue +2 -2
- package/components/common/layout/theHeader/modals/RedirectLogin.vue +3 -3
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePassword.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePasswordNew.vue +8 -8
- package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePasswordOld.vue +3 -3
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesNew.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/PreferencesOld.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguageNew.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguageOld.vue +2 -5
- package/components/common/layout/theHeader/userMenu/modals/preferences/defaultConsole/DefaultConsoleOld.vue +1 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/inventory/InventoryNew.vue +1 -1
- package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +2 -2
- package/components/common/layout/theHeader/userMenu/userMenuNew/lib/config/dropMenu.ts +1 -1
- package/components/common/layout/theHeader/userMenu/userMenuOld/UserMenuOld.vue +1 -1
- package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +2 -2
- package/components/common/modals/Rename.vue +2 -2
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +2 -3
- package/components/common/modals/confirmByInput/ConfirmByInputOld.vue +3 -3
- package/components/common/modals/confirmation/ConfirmationOld.vue +1 -1
- package/components/common/modals/unsavedChanges/UnsavedChanges.vue +1 -1
- package/components/common/monitor/advanced/Advanced.vue +1 -1
- package/components/common/monitor/advanced/AdvancedNew.vue +1 -1
- package/components/common/monitor/advanced/AdvancedOld.vue +1 -1
- package/components/common/monitor/advanced/graphView/GraphViewNew.vue +1 -1
- package/components/common/monitor/advanced/graphView/GraphViewOld.vue +1 -1
- package/components/common/monitor/advanced/table/Table.vue +1 -1
- package/components/common/monitor/advanced/table/tableNew/TableNew.vue +2 -2
- package/components/common/monitor/advanced/table/tableOld/lib/config/performanceDatatable.ts +2 -2
- package/components/common/monitor/advanced/tools/ToolsOld.vue +2 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModalOld.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/NotificationOld.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsOld.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/saveOptionsModal/SaveOptionsModal.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/CountersNew.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableOld/lib/config/tableConfig.ts +2 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/config/objectTable.ts +10 -3
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/ObjectNew.vue +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectOld/ObjectOld.vue +2 -2
- package/components/common/monitor/advanced/tools/lib/utils/countCores.ts +1 -1
- package/components/common/monitor/lib/models/interfaces.ts +1 -1
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalOld.vue +3 -3
- package/components/common/monitor/overview/filters/customIntervalModal/customIntervalModalNew/CustomIntervalModalNew.vue +4 -3
- package/components/common/monitor/resourceAllocation/lib/models/interfaces.ts +8 -8
- package/components/common/monitor/resourceAllocation/resourceAllocation.vue +2 -2
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +1 -1
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/Notification.vue +1 -1
- package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/actions/SaveOptionsModal.vue +1 -1
- package/components/common/pages/hardwareHealth/tableView/lib/config/alertWarningTable.ts +1 -1
- package/components/common/pages/hardwareHealth/tableView/lib/config/historyTestimonyTable.ts +5 -5
- package/components/common/wizards/vm/migrate/Migrate.vue +39 -2
- package/components/common/wizards/vm/migrate/vmOrigin/VmOrigin.vue +92 -0
- package/components/common/wizards/vm/migrate/vmOrigin/lib/models/interfaces.ts +19 -0
- package/components/common/wizards/vm/migrate/vmOrigin/lib/utils/constructItems.ts +62 -0
- package/package.json +1 -1
|
@@ -1,362 +1,361 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="autocomplete" @click.stop>
|
|
3
|
-
<div class="content-search">
|
|
4
|
-
<div v-show="props.loading" class="loader">
|
|
5
|
-
<atoms-loader-pre-loader
|
|
6
|
-
|
|
7
|
-
:test-id="`${props.testId}-pre-loader`"
|
|
8
|
-
|
|
9
|
-
class="content-area__loading"
|
|
10
|
-
/>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="search-icon">
|
|
13
|
-
<atoms-the-icon
|
|
14
|
-
stroke-width="10"
|
|
15
|
-
class="alert-icon search-icon"
|
|
16
|
-
name="search"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div class="clr-error">
|
|
21
|
-
<div class="form-group__input">
|
|
22
|
-
<input
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
:data-id="`${props.testId}-search-input`"
|
|
26
|
-
:class="fieldErrorText && 'clr-input'"
|
|
27
|
-
:placeholder="props.placeholder"
|
|
28
|
-
type="text"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
:
|
|
54
|
-
:
|
|
55
|
-
|
|
56
|
-
@
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<span v-
|
|
61
|
-
|
|
62
|
-
</
|
|
63
|
-
<!--
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (!
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
// const
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
// // const
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
// const
|
|
160
|
-
// const
|
|
161
|
-
// const
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
() =>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
() =>
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
min-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
&:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="autocomplete" @click.stop>
|
|
3
|
+
<div class="content-search">
|
|
4
|
+
<div v-show="props.loading" class="loader">
|
|
5
|
+
<atoms-loader-pre-loader
|
|
6
|
+
id="loader"
|
|
7
|
+
:test-id="`${props.testId}-pre-loader`"
|
|
8
|
+
:show="true"
|
|
9
|
+
class="content-area__loading"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="search-icon">
|
|
13
|
+
<atoms-the-icon
|
|
14
|
+
stroke-width="10"
|
|
15
|
+
class="alert-icon search-icon"
|
|
16
|
+
name="search"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="clr-error">
|
|
21
|
+
<div class="form-group__input">
|
|
22
|
+
<input
|
|
23
|
+
:id="`${props.testId}-search-input`"
|
|
24
|
+
v-model.trim="searchLocal"
|
|
25
|
+
:data-id="`${props.testId}-search-input`"
|
|
26
|
+
:class="['search-input', fieldErrorText && 'clr-input']"
|
|
27
|
+
:placeholder="props.placeholder"
|
|
28
|
+
type="text"
|
|
29
|
+
autocomplete="off"
|
|
30
|
+
@blur="onInitValidation"
|
|
31
|
+
@input="onSearch"
|
|
32
|
+
/>
|
|
33
|
+
<div v-show="fieldErrorText" class="form-validate">
|
|
34
|
+
<atoms-the-icon class="is-error tooltip-trigger" name="info" />
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div
|
|
38
|
+
v-show="fieldErrorText"
|
|
39
|
+
class="form-group__input-error clr-subtext"
|
|
40
|
+
>
|
|
41
|
+
{{ fieldErrorText }}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
v-show="isShow"
|
|
47
|
+
:class="['content-filtered', { active: items.length }]"
|
|
48
|
+
>
|
|
49
|
+
<ul class="dropdown-menu filtered-items">
|
|
50
|
+
<li
|
|
51
|
+
v-for="(item, key) in itemsLocal"
|
|
52
|
+
:key="`${item}_${key}`"
|
|
53
|
+
:class="['item', { active: key === selectedTabIndex }]"
|
|
54
|
+
:data-id="item.testId"
|
|
55
|
+
@mouseenter="selectedTabIndex = key"
|
|
56
|
+
@click="onSelect(key)"
|
|
57
|
+
>
|
|
58
|
+
<template v-for="(part, i) in item.parts" :key="i">
|
|
59
|
+
<span v-if="part.highlight" class="highlight">{{ part.text }}</span>
|
|
60
|
+
<span v-else>{{ part.text }}</span>
|
|
61
|
+
</template>
|
|
62
|
+
<!-- {{ item.firstText }}<b>{{ item.secondText }}</b-->
|
|
63
|
+
<!-- >{{ item.thirdText }}-->
|
|
64
|
+
</li>
|
|
65
|
+
</ul>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script setup lang="ts">
|
|
71
|
+
// import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
72
|
+
|
|
73
|
+
const props = withDefaults(
|
|
74
|
+
defineProps<{
|
|
75
|
+
placeholder: string
|
|
76
|
+
items: string[]
|
|
77
|
+
loading?: boolean
|
|
78
|
+
testId?: string
|
|
79
|
+
ms?: number
|
|
80
|
+
showValidation?: boolean
|
|
81
|
+
errorText?: string
|
|
82
|
+
}>(),
|
|
83
|
+
{
|
|
84
|
+
testId: 'ui-autocomplete',
|
|
85
|
+
ms: 500,
|
|
86
|
+
loading: false,
|
|
87
|
+
showValidation: false,
|
|
88
|
+
errorText: '',
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
const emits = defineEmits<{
|
|
92
|
+
// (event: 'search', value: string): void
|
|
93
|
+
(event: 'select', value: string): void
|
|
94
|
+
}>()
|
|
95
|
+
|
|
96
|
+
// const localization = computed<UI_I_Localization>(() => useLocal())
|
|
97
|
+
|
|
98
|
+
const searchLocal = defineModel<string>()
|
|
99
|
+
|
|
100
|
+
// let timer: NodeJS.Timeout
|
|
101
|
+
const onSearch = (): void => {
|
|
102
|
+
// onInitValidation()
|
|
103
|
+
// clearTimeout(timer)
|
|
104
|
+
// timer = setTimeout(
|
|
105
|
+
// (value) => {
|
|
106
|
+
// emits('search', value)
|
|
107
|
+
// },
|
|
108
|
+
// props.ms,
|
|
109
|
+
// )
|
|
110
|
+
selectedTabIndex.value = 0
|
|
111
|
+
}
|
|
112
|
+
const isInitFieldValidation = ref<boolean>(false)
|
|
113
|
+
const onInitValidation = (): void => {
|
|
114
|
+
isInitFieldValidation.value = true
|
|
115
|
+
}
|
|
116
|
+
const fieldErrorText = computed<string>(() => {
|
|
117
|
+
if (!isInitFieldValidation.value) return ''
|
|
118
|
+
// if (!searchLocal.value) return localization.value.common.fieldRequired
|
|
119
|
+
else if (props.showValidation) return props.errorText
|
|
120
|
+
})
|
|
121
|
+
const itemsLocal = computed<any[]>(() => {
|
|
122
|
+
const search = searchLocal.value
|
|
123
|
+
const regex = new RegExp(search, 'gi')
|
|
124
|
+
|
|
125
|
+
return [...props.items].map((text) => {
|
|
126
|
+
const parts: { text: string; highlight: boolean }[] = []
|
|
127
|
+
|
|
128
|
+
let lastIndex = 0
|
|
129
|
+
for (const match of text.matchAll(regex)) {
|
|
130
|
+
const index = match.index!
|
|
131
|
+
if (index > lastIndex) {
|
|
132
|
+
parts.push({ text: text.slice(lastIndex, index), highlight: false })
|
|
133
|
+
}
|
|
134
|
+
parts.push({ text: match[0], highlight: true })
|
|
135
|
+
lastIndex = index + match[0].length
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Остаток строки
|
|
139
|
+
if (lastIndex < text.length) {
|
|
140
|
+
parts.push({ text: text.slice(lastIndex), highlight: false })
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
parts,
|
|
145
|
+
testId: `${search}-filtered-item`,
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
// const itemsLocal = computed<any[]>(() => {
|
|
151
|
+
// return [...props.items].map((text) => {
|
|
152
|
+
// const termMatch = text.match(new RegExp(searchLocal.value, 'i'))
|
|
153
|
+
// const term = termMatch?.[0]
|
|
154
|
+
//
|
|
155
|
+
// // const term = text.match(new RegExp(searchLocal.value, 'i'))?.[0]
|
|
156
|
+
// // const texts = term ? text.split(term) : text
|
|
157
|
+
//
|
|
158
|
+
// const index = text.toLowerCase().indexOf(term.toLowerCase())
|
|
159
|
+
// const firstText = text.slice(0, index)
|
|
160
|
+
// const secondText = text.slice(index, index + term.length)
|
|
161
|
+
// const thirdText = text.slice(index + term.length)
|
|
162
|
+
//
|
|
163
|
+
// // console.log(texts, 'Mаrilyne.Sipes87@locаl')
|
|
164
|
+
//
|
|
165
|
+
// return {
|
|
166
|
+
// firstText,
|
|
167
|
+
// secondText,
|
|
168
|
+
// thirdText,
|
|
169
|
+
// testId: `${term}-filtered-item`,
|
|
170
|
+
// }
|
|
171
|
+
// })
|
|
172
|
+
// })
|
|
173
|
+
|
|
174
|
+
const selectedTabIndex = ref<number>(0)
|
|
175
|
+
const onSelect = (key: number): void => {
|
|
176
|
+
// searchLocal.value = props.items[key]
|
|
177
|
+
emits('select', props.items[key])
|
|
178
|
+
isHide.value = true
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const isHide = ref<boolean>(false)
|
|
182
|
+
const isShow = computed<boolean>(() => !isHide.value)
|
|
183
|
+
|
|
184
|
+
const onKeyDown = (event: KeyboardEvent): void => {
|
|
185
|
+
switch (event.code) {
|
|
186
|
+
case 'ArrowUp':
|
|
187
|
+
prevTabItem()
|
|
188
|
+
break
|
|
189
|
+
case 'ArrowDown':
|
|
190
|
+
nextTabItem()
|
|
191
|
+
break
|
|
192
|
+
case 'Enter':
|
|
193
|
+
event.preventDefault()
|
|
194
|
+
onSelect(selectedTabIndex.value)
|
|
195
|
+
break
|
|
196
|
+
case 'Tab':
|
|
197
|
+
isHide.value = true
|
|
198
|
+
break
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const nextTabItem = (): void => {
|
|
203
|
+
if (selectedTabIndex.value === itemsLocal.value.length - 1)
|
|
204
|
+
selectedTabIndex.value = 0
|
|
205
|
+
else selectedTabIndex.value++
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const prevTabItem = (): void => {
|
|
209
|
+
if (selectedTabIndex.value === 0)
|
|
210
|
+
selectedTabIndex.value = itemsLocal.value.length - 1
|
|
211
|
+
else selectedTabIndex.value--
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
watch(
|
|
215
|
+
() => props.items,
|
|
216
|
+
(newValue) => {
|
|
217
|
+
if (newValue.length > 1) {
|
|
218
|
+
isHide.value = false
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
window.addEventListener('keydown', onKeyDown, true)
|
|
223
|
+
watch(isHide, (newValue) => {
|
|
224
|
+
if (!newValue) {
|
|
225
|
+
window.addEventListener('keydown', onKeyDown, true)
|
|
226
|
+
} else {
|
|
227
|
+
window.removeEventListener('keydown', onKeyDown, true)
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
watch(
|
|
231
|
+
() => props.showValidation,
|
|
232
|
+
(newValue: boolean) => {
|
|
233
|
+
isInitFieldValidation.value = newValue
|
|
234
|
+
},
|
|
235
|
+
{ immediate: true }
|
|
236
|
+
)
|
|
237
|
+
</script>
|
|
238
|
+
|
|
239
|
+
<style scoped lang="scss">
|
|
240
|
+
.autocomplete {
|
|
241
|
+
max-width: 180px;
|
|
242
|
+
position: relative;
|
|
243
|
+
|
|
244
|
+
.content-search {
|
|
245
|
+
.loader {
|
|
246
|
+
position: absolute;
|
|
247
|
+
top: 3px;
|
|
248
|
+
left: -6px;
|
|
249
|
+
z-index: var(--z-dropdown);
|
|
250
|
+
height: 16px;
|
|
251
|
+
width: 16px;
|
|
252
|
+
|
|
253
|
+
#loader {
|
|
254
|
+
height: 100%;
|
|
255
|
+
width: 100%;
|
|
256
|
+
|
|
257
|
+
:deep(.spinner-inverse) {
|
|
258
|
+
min-width: auto;
|
|
259
|
+
min-height: auto;
|
|
260
|
+
width: 100%;
|
|
261
|
+
height: 100%;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
.search-icon {
|
|
266
|
+
position: absolute;
|
|
267
|
+
width: 17px;
|
|
268
|
+
height: 17px;
|
|
269
|
+
top: 5px;
|
|
270
|
+
bottom: 0;
|
|
271
|
+
|
|
272
|
+
.alert-icon.search-icon {
|
|
273
|
+
fill: #666;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
.search-input {
|
|
277
|
+
background-color: var(--modal-bg-color);
|
|
278
|
+
padding: 0 6px 0 20px;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.content-filtered {
|
|
283
|
+
position: absolute;
|
|
284
|
+
display: block;
|
|
285
|
+
overflow-y: visible;
|
|
286
|
+
height: auto;
|
|
287
|
+
visibility: visible;
|
|
288
|
+
will-change: transform;
|
|
289
|
+
top: 0;
|
|
290
|
+
left: 0;
|
|
291
|
+
transform: translate3d(0px, 25px, 0px);
|
|
292
|
+
width: 250px;
|
|
293
|
+
z-index: var(--z-dropdown);
|
|
294
|
+
|
|
295
|
+
&.active .filtered-items {
|
|
296
|
+
max-height: 110px;
|
|
297
|
+
visibility: visible;
|
|
298
|
+
position: absolute;
|
|
299
|
+
top: 100%;
|
|
300
|
+
left: 0;
|
|
301
|
+
min-width: 96px;
|
|
302
|
+
max-width: 288px;
|
|
303
|
+
border: 0.8px solid #ccc;
|
|
304
|
+
padding: 9.6px 0;
|
|
305
|
+
z-index: calc(var(--z-dropdown) + 1);
|
|
306
|
+
overflow: auto;
|
|
307
|
+
width: 100%;
|
|
308
|
+
margin: 1px 0 0;
|
|
309
|
+
background: var(--modal-bg-color);
|
|
310
|
+
|
|
311
|
+
.item {
|
|
312
|
+
line-height: 20px;
|
|
313
|
+
padding: 5px 0 0 5px;
|
|
314
|
+
color: #333;
|
|
315
|
+
cursor: pointer;
|
|
316
|
+
outline: unset;
|
|
317
|
+
|
|
318
|
+
&.active,
|
|
319
|
+
&:focus,
|
|
320
|
+
&:hover {
|
|
321
|
+
background-color: #2b5480;
|
|
322
|
+
color: #fff;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.highlight {
|
|
326
|
+
font-weight: bold;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
.form-group {
|
|
332
|
+
&__input {
|
|
333
|
+
display: flex;
|
|
334
|
+
.form-validate {
|
|
335
|
+
svg {
|
|
336
|
+
width: 24px;
|
|
337
|
+
height: 24px;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
input {
|
|
341
|
+
width: 100%;
|
|
342
|
+
}
|
|
343
|
+
&-error {
|
|
344
|
+
margin-top: 0;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
:root.dark-theme {
|
|
350
|
+
.autocomplete .content-search .search-icon .alert-icon.search-icon {
|
|
351
|
+
fill: #adbbc4;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.autocomplete .content-filtered.active .filtered-items {
|
|
355
|
+
border: 0.8px solid #666;
|
|
356
|
+
.item {
|
|
357
|
+
color: #aaa;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
</style>
|