adata-ui 0.3.73 → 0.3.74

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.
Files changed (96) hide show
  1. package/README.md +7 -7
  2. package/babel.config.js +5 -5
  3. package/package.json +76 -76
  4. package/public/index.html +17 -17
  5. package/public/logo.svg +4 -4
  6. package/src/App.vue +25 -25
  7. package/src/assets/_text_field.scss +224 -224
  8. package/src/assets/facebook.svg +4 -4
  9. package/src/assets/instagram.svg +6 -6
  10. package/src/assets/logo-desktop-main.svg +8 -8
  11. package/src/assets/logo-desktop.svg +9 -9
  12. package/src/assets/logo-mobile-main.svg +4 -4
  13. package/src/assets/logo-mobile.svg +9 -9
  14. package/src/assets/logo-white-desktop.svg +8 -8
  15. package/src/assets/style.scss +1 -1
  16. package/src/assets/telegram.svg +4 -4
  17. package/src/assets/tiktok.svg +4 -4
  18. package/src/assets/up-down.svg +3 -3
  19. package/src/assets/youtube.svg +5 -5
  20. package/src/components/Alert/Alert.stories.js +17 -17
  21. package/src/components/Alert/Alert.vue +63 -63
  22. package/src/components/BottomNavigationBar/ABottomNavigationBar.vue +160 -160
  23. package/src/components/BottomNavigationBar/BottomNavigationBar.stories.js +24 -24
  24. package/src/components/Button/AButton.vue +231 -231
  25. package/src/components/Button/Button.stories.js +23 -23
  26. package/src/components/Checkbox/ACheckbox.vue +114 -114
  27. package/src/components/Checkbox/Checkbox.stories.js +15 -15
  28. package/src/components/CheckboxMenu/CheckboxMenu.stories.js +23 -23
  29. package/src/components/CheckboxMenu/CheckboxMenu.vue +108 -108
  30. package/src/components/ErrorPages/BadGateway.vue +224 -224
  31. package/src/components/ErrorPages/Forbidden.vue +468 -468
  32. package/src/components/ErrorPages/InternalServerError.vue +275 -275
  33. package/src/components/ErrorPages/NotFound.vue +995 -995
  34. package/src/components/ErrorPages/Unavailable.vue +3705 -3705
  35. package/src/components/Footer/Footer.stories.js +20 -20
  36. package/src/components/Footer/Footer.vue +292 -292
  37. package/src/components/Header/ChildLinks.vue +141 -122
  38. package/src/components/Header/Header.stories.js +56 -56
  39. package/src/components/Header/Header.vue +1289 -1289
  40. package/src/components/Header/InfoHeader.vue +319 -319
  41. package/src/components/Header/Profile.vue +670 -670
  42. package/src/components/Header/ProfileMenu.vue +291 -276
  43. package/src/components/Header/ProfileMobile.vue +308 -308
  44. package/src/components/Header/ProfileOld.vue +781 -781
  45. package/src/components/InternalServerError/InternalServerError.stories.js +16 -16
  46. package/src/components/InternalServerError/InternalServerError.vue +262 -262
  47. package/src/components/Introduction.stories.mdx +7 -7
  48. package/src/components/Loader/Loader.stories.js +24 -24
  49. package/src/components/Loader/Loader.vue +325 -325
  50. package/src/components/MailTo/MailTo.stories.js +14 -14
  51. package/src/components/MailTo/MailTo.vue +258 -258
  52. package/src/components/NavIcon/ANavIcon.vue +49 -49
  53. package/src/components/NavIcon/NavIcon.stories.js +14 -14
  54. package/src/components/PasswordField/PasswordField.stories.js +16 -16
  55. package/src/components/PasswordField/PasswordField.vue +77 -77
  56. package/src/components/SearchTextField/SearchTextField.stories.js +77 -77
  57. package/src/components/SearchTextField/SearchTextField.vue +230 -230
  58. package/src/components/ServiceSlider/AServiceSlider.vue +782 -782
  59. package/src/components/ServiceSlider/ServiceSlider.stories.js +20 -20
  60. package/src/components/Table/ATable.vue +117 -117
  61. package/src/components/Table/Table.stories.js +15 -15
  62. package/src/components/TextArea/TextArea.stories.js +17 -17
  63. package/src/components/TextArea/TextArea.vue +116 -116
  64. package/src/components/TextError/TextError.stories.js +15 -15
  65. package/src/components/TextError/TextError.vue +57 -57
  66. package/src/components/TextField/TextField.stories.js +17 -17
  67. package/src/components/TextField/TextField.vue +107 -107
  68. package/src/components/index.js +54 -54
  69. package/src/components/newComponents/FooterNew/FooterBottom.vue +153 -153
  70. package/src/components/newComponents/FooterNew/FooterItem.vue +113 -113
  71. package/src/components/newComponents/FooterNew/FooterNew.stories.js +20 -20
  72. package/src/components/newComponents/FooterNew/FooterNew.vue +39 -39
  73. package/src/components/newComponents/FooterNew/FooterTop.vue +321 -321
  74. package/src/components/transitions/SlideToggle.vue +55 -55
  75. package/src/components/transitions/VerticalMobileToggle.vue +75 -75
  76. package/src/configs/icons.js +112 -112
  77. package/src/configs/profileDropDown.js +134 -134
  78. package/src/main.js +12 -12
  79. package/dist/adata-ui.common.js +0 -12969
  80. package/dist/adata-ui.common.js.map +0 -1
  81. package/dist/adata-ui.css +0 -1
  82. package/dist/adata-ui.umd.js +0 -12979
  83. package/dist/adata-ui.umd.js.map +0 -1
  84. package/dist/adata-ui.umd.min.js +0 -7
  85. package/dist/adata-ui.umd.min.js.map +0 -1
  86. package/dist/demo.html +0 -10
  87. package/dist/img/facebook.797d820f.svg +0 -4
  88. package/dist/img/instagram.8a77381c.svg +0 -6
  89. package/dist/img/logo-desktop-main.4d169395.svg +0 -8
  90. package/dist/img/logo-mobile-main.397bce24.svg +0 -4
  91. package/dist/img/logo-white-desktop.7d0e3481.svg +0 -8
  92. package/dist/img/telegram.be0d1008.svg +0 -4
  93. package/dist/img/tiktok.eaeb39cb.svg +0 -4
  94. package/dist/img/up-down.e2b28f72.svg +0 -3
  95. package/dist/img/youtube.125aace6.svg +0 -5
  96. package/package-lock.json +0 -26218
@@ -1,781 +1,781 @@
1
- <template>
2
- <div class="profile" :class="{ active: active }">
3
- <div v-click-outside="() => { active = false; }">
4
- <div class="profile__inner">
5
- <div class="profile__item" @click="active = !active">
6
- <div v-show="isAuthenticated" class="profile__item-link">
7
- <span class="desktop">{{ email }}</span>
8
- <svg
9
- width="18"
10
- height="18"
11
- fill="#25476AFF"
12
- class="desktop arrow-svg"
13
- :class="{ rotate: active }"
14
- xmlns="http://www.w3.org/2000/svg"
15
- viewBox="0 0 16 16"
16
- >
17
- <path fill="none" d="M0 0h16v16H0z"></path>
18
- <path
19
- fill="none"
20
- d="M3 6.5L8 10l5-3.5"
21
- stroke="#2C3E50"
22
- stroke-linecap="round"
23
- stroke-linejoin="round"
24
- ></path>
25
- </svg>
26
- </div>
27
- <button
28
- @click.prevent="goAuth"
29
- class="sign"
30
- v-show="!isAuthenticated"
31
- >
32
- <svg
33
- width="18"
34
- height="18"
35
- fill="#25476AFF"
36
- xmlns="http://www.w3.org/2000/svg"
37
- viewBox="0 0 16 16"
38
- class="desktop"
39
- >
40
- <path fill="#fff" d="M0 0h16v16H0z" stroke="none"></path>
41
- <path
42
- d="M8 10l2-2.054L8.077 6"
43
- stroke-miterlimit="10"
44
- stroke-linecap="round"
45
- stroke-linejoin="round"
46
- ></path>
47
- <path
48
- d="M6 4.1V2h8v12H6v-1.65M9 8H2"
49
- stroke-miterlimit="10"
50
- stroke-linecap="round"
51
- stroke-linejoin="round"
52
- ></path>
53
- </svg>
54
- <span class="sign_text">Вход</span>
55
- </button>
56
- </div>
57
- </div>
58
- <SlideToggle v-slot="{ animationClass }">
59
- <div
60
- class="profile-menu"
61
- v-show="active"
62
- :class="animationClass"
63
- >
64
- <div class="profile-menu__inner">
65
- <div class="profile-menu__items">
66
- <div v-for="(elem, index) in profileDropDown" :key="index">
67
- <a
68
- :href="elem[mode]"
69
- :class="
70
- elem.link
71
- ? 'profile-menu__balance-link'
72
- : 'profile-menu__links'
73
- "
74
- class="gray-text"
75
- v-if="elem[mode]"
76
- @click="preventLink(elem.disabled, $event)"
77
- onclick="`return false`"
78
- >
79
- <div :class="{'rate-item': index === 0}">
80
- <span v-show="index === 0" class="rate">
81
- Тариф {{ rate }}
82
- </span> {{ elem.name }} <span v-show="index === 1" class="balance">{{ balance || 0 }} ₸</span>
83
- </div>
84
- <span
85
- v-show="elem.link"
86
- @click="showModal(elem[mode], elem.name)"
87
- class="profile-menu__balance"
88
- >
89
- {{ elem.link }}
90
- </span>
91
- </a>
92
- <div
93
- v-if="elem.children"
94
- @click="rotateItem(index)"
95
- class="gray-text profile-menu__item"
96
- >
97
- <div :class="{ active: elem.opened }" class="profile-menu__item__children">
98
- {{ elem.name }}
99
- <span v-if="elem.children.length > 0">
100
- <svg
101
- width="12"
102
- height="8"
103
- viewBox="0 0 12 8"
104
- fill="none"
105
- xmlns="http://www.w3.org/2000/svg"
106
- :class="{ rotated: elem.opened }"
107
- >
108
- <path
109
- d="M1 1.5L6 6.5L11 1.5"
110
- stroke="#69797D"
111
- stroke-width="2"
112
- stroke-linecap="round"
113
- stroke-linejoin="round"
114
- />
115
- </svg>
116
- </span>
117
- </div>
118
- <SlideToggle
119
- v-slot="{ animationClass }"
120
- :class="animationClass"
121
- >
122
- <div v-if="elem.opened">
123
- <template v-for="(child, idx) in elem.children">
124
- <div
125
- class="profile-menu__item__child"
126
- :key="idx + 'link'"
127
- v-if="child[mode]"
128
- @click="handleClick(child[mode], child.name)"
129
- >
130
- <span>
131
- {{ child.name }}
132
- </span>
133
- </div>
134
- </template>
135
- </div>
136
- </SlideToggle>
137
- </div>
138
- </div>
139
- </div>
140
-
141
- </div>
142
- </div>
143
- </SlideToggle>
144
- </div>
145
- </div>
146
- </template>
147
-
148
- <script>
149
- import { profileDropDown } from "../../configs/profileDropDown";
150
- import SlideToggle from "../transitions/SlideToggle";
151
- import vClickOutside from "v-click-outside";
152
-
153
- export default {
154
- directives: {
155
- clickOutside: vClickOutside.directive,
156
- },
157
- props: {
158
- mode: {
159
- type: String,
160
- required: true,
161
- validator: function (value) {
162
- return ["prod", "dev", "staging"].indexOf(value) !== -1;
163
- },
164
- },
165
- isAuthenticated: {
166
- type: Boolean,
167
- default: false,
168
- },
169
- email: {
170
- type: String,
171
- default: "",
172
- },
173
- loginUrl: {
174
- type: String,
175
- default: "",
176
- required: true,
177
- },
178
- activeTabKey: {
179
- type: String,
180
- default: "",
181
- required: true,
182
- },
183
- rate: {
184
- type: String,
185
- default: ""
186
- },
187
- balance: {
188
- type: [Number, String],
189
- default: 0
190
- }
191
- },
192
- components: {
193
- SlideToggle,
194
- },
195
- data() {
196
- return {
197
- profileDropDown,
198
- active: false,
199
- chosenElem: {
200
- children: [],
201
- },
202
- };
203
- },
204
- mounted() {
205
- const item = this.activeTabKey ? this.profileDropDown.find(el => el.key && el.key.includes(this.activeTabKey)) : null;
206
- if(item && window && window.innerWidth > 850) {
207
- this.chosenElem = item;
208
- this.chosenElem.opened = true;
209
- }
210
- },
211
- computed: {
212
- someMobileOpened() {
213
- return this.profileDropDown.filter(
214
- (el) => el.opened && el.children.length > 0
215
- );
216
- },
217
- },
218
- methods: {
219
- setShowModal(bool) {
220
- this.$emit("setShowModal", bool);
221
- },
222
- logout() {
223
- this.$emit("logout");
224
- },
225
- preventLink(disabled, e) {
226
- if (disabled) {
227
- e.preventDefault();
228
- }
229
- },
230
- async showModal(url, name) {
231
- if (name.includes("Текущий")) {
232
- if (window.location.href.includes(url)) {
233
- this.$emit("setIsReplenishModal", true);
234
- this.setShowModal(true);
235
- } else {
236
- await window.open(url + "&modal=show", "_self");
237
- }
238
- }
239
- },
240
- handleClick(url, name) {
241
- if (!name.includes("Текущий")) {
242
- window.open(url, name === 'Избранные' ? '_blank' : '_self');
243
- }
244
- },
245
- rotateItem(index) {
246
- this.chosenElem = this.profileDropDown[index];
247
- const array = this.profileDropDown;
248
- array.forEach((el, idx) => {
249
- if (index === idx) {
250
- this.$set(el, 'opened', !el.opened);
251
- } else this.$set(el, 'opened', false)
252
- });
253
- },
254
- goAuth() {
255
- const fullPath = encodeURIComponent(window.location.toString());
256
- if (window) {
257
- window.location.href = `${this.loginUrl}?url=${fullPath}`;
258
- }
259
- },
260
- },
261
- };
262
- </script>
263
-
264
- <style lang="scss">
265
- a {
266
- text-decoration: none;
267
- background-color: transparent;
268
- }
269
-
270
- svg {
271
- transition: all 0.3s linear;
272
- }
273
-
274
- svg.rotated {
275
- transform: rotate(180deg);
276
- }
277
-
278
- .gray-text {
279
- font-size: 12px;
280
- line-height: 14px;
281
- font-weight: 400;
282
- color: #2c3e50;
283
- padding: 10px 16px;
284
- cursor: pointer;
285
- }
286
-
287
- .profile {
288
- position: relative;
289
-
290
- &__inner {
291
- padding: 0;
292
- display: flex;
293
- align-items: center;
294
- }
295
-
296
- &__item {
297
- font-size: 14px;
298
- font-weight: 600;
299
- margin: 0;
300
- padding: 8px 0;
301
- white-space: nowrap;
302
- cursor: pointer;
303
-
304
- &-link {
305
- display: flex;
306
- align-items: center;
307
- font-size: 14px;
308
-
309
- &:first-child {
310
- @media (max-width: 1025px) {
311
- display: none;
312
- }
313
- }
314
-
315
- &:nth-child(2) {
316
- display: none;
317
- @media (max-width: 1025px) {
318
- display: flex;
319
- }
320
- }
321
- }
322
-
323
- span {
324
- white-space: nowrap;
325
- margin: 0 7px;
326
- }
327
-
328
- .arrow-svg {
329
- transition: all 0.3s;
330
- vertical-align: middle;
331
- width: 16px;
332
- height: 16px;
333
- transform: rotate(0deg);
334
-
335
- &.rotate {
336
- transform: rotate(180deg);
337
- }
338
- }
339
- }
340
-
341
- .profile-menu {
342
- width: 368px;
343
- height: 100%;
344
- position: absolute;
345
- right: 0;
346
- top: 100%;
347
- background-color: #fff;
348
- box-shadow: 0px 3px 6px #959cb140;
349
- border-radius: 2px;
350
- z-index: 10000;
351
- @media (max-width: 1025px) {
352
- display: none;
353
- }
354
-
355
- &__items {
356
- font-size: 12px;
357
- line-height: 14px;
358
- font-weight: 400;
359
- color: #2c3e50;
360
- cursor: pointer;
361
-
362
- span.balance {
363
- padding: 2px 8px;
364
- color: #698096;
365
- background: #ECEFF1;
366
- border-radius: 100px;
367
- }
368
-
369
- .rate-item {
370
- display: flex;
371
- justify-content: space-between;
372
- align-items: center;
373
- width: 100%;
374
- color: #007aff;
375
- font-size: 14px;
376
- font-weight: 600;
377
- span.rate {
378
- color: #2C3E50;
379
- font-size: 12px;
380
- }
381
- }
382
-
383
- div:not(:last-child) > a > .gray-text {
384
- border-bottom: 0.5px solid #bdc7ce;
385
- }
386
-
387
- div:not(:last-child) > .gray-text {
388
- border-bottom: 0.5px solid #bdc7ce;
389
-
390
- & + div {
391
- padding: 10px 16px;
392
- }
393
- }
394
-
395
- div
396
- > .gray-text:not(.profile-menu__balance-link):not(.profile-menu__links) {
397
- padding: 0;
398
-
399
- a {
400
- color: #2c3e50;
401
-
402
- &:visited {
403
- color: #2c3e50;
404
- }
405
- }
406
- }
407
- }
408
-
409
- &__item__child {
410
- padding: 0 16px 0 32px;
411
- height: 40px;
412
- display: flex;
413
- border-top: 0.5px solid #bdc7ce;
414
- align-items: center;
415
-
416
- &:hover {
417
- background: #2c3e500c;
418
- }
419
-
420
- span {
421
- display: flex;
422
- align-items: center;
423
-
424
- svg {
425
- margin-right: 5px;
426
-
427
- path {
428
- fill: #2c3e500c !important;
429
- }
430
- }
431
- }
432
- }
433
-
434
- &__item__children {
435
- padding: 0 16px;
436
- display: flex;
437
- justify-content: space-between;
438
- align-items: center;
439
- height: 40px;
440
-
441
- &:hover {
442
- background: #2c3e500c;
443
- }
444
-
445
- &.active {
446
- background: #ECEFF1;
447
- border-left: 3px solid #007aff;
448
- }
449
- }
450
-
451
- &__balance-link {
452
- display: flex;
453
- align-items: center;
454
- justify-content: space-between;
455
- height: 40px;
456
- padding: 0 16px;
457
-
458
- &:hover {
459
- background: #2c3e500d;
460
- }
461
-
462
- &:not(:last-child) {
463
- border-bottom: 1px solid #eef0f5;
464
- }
465
- }
466
-
467
- &__balance {
468
- font-size: 14px;
469
- font-weight: 600;
470
- color: #007aff;
471
- white-space: nowrap;
472
- }
473
-
474
- &__links {
475
- display: flex;
476
- align-items: center;
477
- align-content: center;
478
- height: 40px;
479
- padding: 0 16px;
480
-
481
- &:hover {
482
- background: linear-gradient(0deg, rgba(236, 239, 241, 0.5), rgba(236, 239, 241, 0.5)), #FFFFFF;
483
- }
484
-
485
- &:not(:last-child) {
486
- border-bottom: 1px solid #eef0f5;
487
- }
488
- }
489
- }
490
- }
491
-
492
- .exit {
493
- background: #007AFF;
494
- height: 40px;
495
- border-radius: 0 0 2px 2px;
496
- display: flex;
497
- align-items: center;
498
- justify-content: center;
499
- cursor: pointer;
500
-
501
- &:hover {
502
- background: #9da3ac;
503
- color: #fff;
504
- }
505
-
506
- &:hover svg {
507
- stroke: #fff;
508
- background: #9da3ac;
509
- }
510
-
511
- svg {
512
- margin-right: 8px;
513
- background: #007AFF;
514
- fill: none !important;
515
- stroke: #fff;
516
- transition: all 0s;
517
- }
518
-
519
- &:active {
520
- background: #0055bb;
521
- color: #fff;
522
- }
523
-
524
- &:active svg {
525
- stroke: #fff;
526
- background: #0055bb;
527
- }
528
-
529
- font-weight: 600;
530
- font-size: 14px;
531
- line-height: 16px;
532
- color: #fff;
533
- }
534
-
535
- .sign {
536
- height: 40px;
537
- background: transparent;
538
- border: none;
539
- border-radius: 0 0 2px 2px;
540
- display: flex;
541
- align-items: center;
542
- justify-content: center;
543
- cursor: pointer;
544
-
545
- &:hover {
546
- svg {
547
- stroke: #71757a !important;
548
- }
549
-
550
- span {
551
- color: #71757a;
552
- }
553
- }
554
-
555
- &:active {
556
- svg {
557
- stroke: #9da3ac !important;
558
- }
559
-
560
- span {
561
- color: #9da3ac;
562
- }
563
- }
564
-
565
- svg {
566
- margin-right: 8px;
567
- fill: none !important;
568
- stroke: #2c3e50 !important;
569
- @media (max-width: 1025px) {
570
- stroke: none !important;
571
- margin-right: 24px;
572
- }
573
- }
574
-
575
- span {
576
- font-weight: 600;
577
- font-size: 14px;
578
- line-height: 16px;
579
- color: #2c3e50;
580
- margin: 0 0;
581
- }
582
- }
583
-
584
- .requests {
585
- &__link {
586
- font-size: 12px;
587
- line-height: 16px;
588
- font-weight: 400;
589
- padding: 12px;
590
- color: var(--newColor);
591
- white-space: nowrap;
592
- margin: 0 6px 0 0;
593
- @media (max-width: 1025px) {
594
- display: none;
595
- }
596
-
597
- svg {
598
- vertical-align: middle;
599
- width: 20px;
600
- height: 20px;
601
- margin-right: 4px;
602
- margin-bottom: 2px;
603
- }
604
-
605
- span {
606
- color: #2c3e50;
607
- font-weight: 600;
608
- }
609
- }
610
- }
611
-
612
- .user {
613
- display: none;
614
- @media (max-width: 1025px) {
615
- width: 24px;
616
- height: 24px;
617
- margin-right: 24px;
618
- display: flex;
619
- }
620
- }
621
-
622
- .exit-mobile {
623
- display: none;
624
- @media (max-width: 1025px) {
625
- display: block;
626
- width: 24px;
627
- height: 24px;
628
- margin-right: 12px;
629
- }
630
- }
631
-
632
- .mobile-table {
633
- display: none;
634
- @media (max-width: 1025px) {
635
- display: block;
636
- }
637
-
638
- &-head {
639
- padding: 0 16px;
640
- background: #f4f4f4;
641
- display: flex;
642
- align-items: center;
643
- justify-content: space-between;
644
- width: 100%;
645
- height: 40px;
646
-
647
- p {
648
- font-weight: 600;
649
- font-size: 17px;
650
- line-height: 19px;
651
- color: #2c3e50;
652
- }
653
-
654
- svg {
655
- width: 18px;
656
- height: 18px;
657
- @media (max-width: 1025px) {
658
- width: 24px;
659
- height: 24px;
660
- }
661
- }
662
-
663
- &-chosen {
664
- position: relative;
665
-
666
- & > div {
667
- position: absolute;
668
- }
669
-
670
- p {
671
- text-align: center;
672
- width: 100%;
673
- }
674
- }
675
- }
676
- }
677
-
678
- .profile-menu-mobile {
679
- height: 100%;
680
-
681
- .bb > a,
682
- .bb > a:visited {
683
- color: #000;
684
- }
685
-
686
- &__inner {
687
- display: flex;
688
- flex-direction: column;
689
- height: 72%;
690
- }
691
-
692
- &__links,
693
- &__item {
694
- padding: 0 16px;
695
- height: 52px;
696
- border: 1px solid #9da3ac;
697
- border-bottom: none;
698
- font-size: 14px;
699
- display: flex;
700
- align-items: center;
701
- }
702
-
703
- &__balance-link {
704
- padding: 0 16px;
705
- height: 52px;
706
- border: 1px solid #9da3ac;
707
- border-bottom: none;
708
- font-size: 14px;
709
- display: flex;
710
- justify-content: space-between;
711
- }
712
-
713
- &__balance {
714
- color: #1e88e5;
715
- font-size: 16px;
716
- white-space: nowrap;
717
- display: flex;
718
- align-items: center;
719
-
720
- &-items {
721
- display: flex;
722
- flex-direction: column;
723
- justify-content: center;
724
-
725
- &__upper-text {
726
- font-weight: normal;
727
- font-size: 10px;
728
- line-height: 14px;
729
- color: #69797d;
730
- margin-bottom: 4px;
731
- }
732
-
733
- &__bot-text {
734
- font-weight: 600;
735
- font-size: 12px;
736
- line-height: 16px;
737
- color: #2c3e50;
738
- }
739
- }
740
- }
741
- }
742
-
743
- .exit-mob {
744
- background: #ffcd33;
745
- border-radius: 2px;
746
- height: 40px;
747
- display: flex;
748
- align-items: center;
749
- justify-content: center;
750
- cursor: pointer;
751
- font-weight: normal;
752
- font-size: 16px;
753
- line-height: 16px;
754
- color: #2c3e50;
755
- margin: 16px 16px 0;
756
-
757
- svg {
758
- margin-right: 8px;
759
- fill: none !important;
760
- }
761
- }
762
-
763
- .bb {
764
- &:last-child {
765
- border-bottom: 1px solid #9da3ac;
766
- }
767
- }
768
-
769
- .button-inner {
770
- display: flex;
771
- align-items: center;
772
- justify-content: space-between;
773
- width: 100%;
774
- }
775
-
776
- .sign_text {
777
- @media (max-width: 1025px) {
778
- display: none;
779
- }
780
- }
781
- </style>
1
+ <template>
2
+ <div class="profile" :class="{ active: active }">
3
+ <div v-click-outside="() => { active = false; }">
4
+ <div class="profile__inner">
5
+ <div class="profile__item" @click="active = !active">
6
+ <div v-show="isAuthenticated" class="profile__item-link">
7
+ <span class="desktop">{{ email }}</span>
8
+ <svg
9
+ width="18"
10
+ height="18"
11
+ fill="#25476AFF"
12
+ class="desktop arrow-svg"
13
+ :class="{ rotate: active }"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ viewBox="0 0 16 16"
16
+ >
17
+ <path fill="none" d="M0 0h16v16H0z"></path>
18
+ <path
19
+ fill="none"
20
+ d="M3 6.5L8 10l5-3.5"
21
+ stroke="#2C3E50"
22
+ stroke-linecap="round"
23
+ stroke-linejoin="round"
24
+ ></path>
25
+ </svg>
26
+ </div>
27
+ <button
28
+ @click.prevent="goAuth"
29
+ class="sign"
30
+ v-show="!isAuthenticated"
31
+ >
32
+ <svg
33
+ width="18"
34
+ height="18"
35
+ fill="#25476AFF"
36
+ xmlns="http://www.w3.org/2000/svg"
37
+ viewBox="0 0 16 16"
38
+ class="desktop"
39
+ >
40
+ <path fill="#fff" d="M0 0h16v16H0z" stroke="none"></path>
41
+ <path
42
+ d="M8 10l2-2.054L8.077 6"
43
+ stroke-miterlimit="10"
44
+ stroke-linecap="round"
45
+ stroke-linejoin="round"
46
+ ></path>
47
+ <path
48
+ d="M6 4.1V2h8v12H6v-1.65M9 8H2"
49
+ stroke-miterlimit="10"
50
+ stroke-linecap="round"
51
+ stroke-linejoin="round"
52
+ ></path>
53
+ </svg>
54
+ <span class="sign_text">Вход</span>
55
+ </button>
56
+ </div>
57
+ </div>
58
+ <SlideToggle v-slot="{ animationClass }">
59
+ <div
60
+ class="profile-menu"
61
+ v-show="active"
62
+ :class="animationClass"
63
+ >
64
+ <div class="profile-menu__inner">
65
+ <div class="profile-menu__items">
66
+ <div v-for="(elem, index) in profileDropDown" :key="index">
67
+ <a
68
+ :href="elem[mode]"
69
+ :class="
70
+ elem.link
71
+ ? 'profile-menu__balance-link'
72
+ : 'profile-menu__links'
73
+ "
74
+ class="gray-text"
75
+ v-if="elem[mode]"
76
+ @click="preventLink(elem.disabled, $event)"
77
+ onclick="`return false`"
78
+ >
79
+ <div :class="{'rate-item': index === 0}">
80
+ <span v-show="index === 0" class="rate">
81
+ Тариф {{ rate }}
82
+ </span> {{ elem.name }} <span v-show="index === 1" class="balance">{{ balance || 0 }} ₸</span>
83
+ </div>
84
+ <span
85
+ v-show="elem.link"
86
+ @click="showModal(elem[mode], elem.name)"
87
+ class="profile-menu__balance"
88
+ >
89
+ {{ elem.link }}
90
+ </span>
91
+ </a>
92
+ <div
93
+ v-if="elem.children"
94
+ @click="rotateItem(index)"
95
+ class="gray-text profile-menu__item"
96
+ >
97
+ <div :class="{ active: elem.opened }" class="profile-menu__item__children">
98
+ {{ elem.name }}
99
+ <span v-if="elem.children.length > 0">
100
+ <svg
101
+ width="12"
102
+ height="8"
103
+ viewBox="0 0 12 8"
104
+ fill="none"
105
+ xmlns="http://www.w3.org/2000/svg"
106
+ :class="{ rotated: elem.opened }"
107
+ >
108
+ <path
109
+ d="M1 1.5L6 6.5L11 1.5"
110
+ stroke="#69797D"
111
+ stroke-width="2"
112
+ stroke-linecap="round"
113
+ stroke-linejoin="round"
114
+ />
115
+ </svg>
116
+ </span>
117
+ </div>
118
+ <SlideToggle
119
+ v-slot="{ animationClass }"
120
+ :class="animationClass"
121
+ >
122
+ <div v-if="elem.opened">
123
+ <template v-for="(child, idx) in elem.children">
124
+ <div
125
+ class="profile-menu__item__child"
126
+ :key="idx + 'link'"
127
+ v-if="child[mode]"
128
+ @click="handleClick(child[mode], child.name)"
129
+ >
130
+ <span>
131
+ {{ child.name }}
132
+ </span>
133
+ </div>
134
+ </template>
135
+ </div>
136
+ </SlideToggle>
137
+ </div>
138
+ </div>
139
+ </div>
140
+
141
+ </div>
142
+ </div>
143
+ </SlideToggle>
144
+ </div>
145
+ </div>
146
+ </template>
147
+
148
+ <script>
149
+ import { profileDropDown } from "../../configs/profileDropDown";
150
+ import SlideToggle from "../transitions/SlideToggle";
151
+ import vClickOutside from "v-click-outside";
152
+
153
+ export default {
154
+ directives: {
155
+ clickOutside: vClickOutside.directive,
156
+ },
157
+ props: {
158
+ mode: {
159
+ type: String,
160
+ required: true,
161
+ validator: function (value) {
162
+ return ["prod", "dev", "staging"].indexOf(value) !== -1;
163
+ },
164
+ },
165
+ isAuthenticated: {
166
+ type: Boolean,
167
+ default: false,
168
+ },
169
+ email: {
170
+ type: String,
171
+ default: "",
172
+ },
173
+ loginUrl: {
174
+ type: String,
175
+ default: "",
176
+ required: true,
177
+ },
178
+ activeTabKey: {
179
+ type: String,
180
+ default: "",
181
+ required: true,
182
+ },
183
+ rate: {
184
+ type: String,
185
+ default: ""
186
+ },
187
+ balance: {
188
+ type: [Number, String],
189
+ default: 0
190
+ }
191
+ },
192
+ components: {
193
+ SlideToggle,
194
+ },
195
+ data() {
196
+ return {
197
+ profileDropDown,
198
+ active: false,
199
+ chosenElem: {
200
+ children: [],
201
+ },
202
+ };
203
+ },
204
+ mounted() {
205
+ const item = this.activeTabKey ? this.profileDropDown.find(el => el.key && el.key.includes(this.activeTabKey)) : null;
206
+ if(item && window && window.innerWidth > 850) {
207
+ this.chosenElem = item;
208
+ this.chosenElem.opened = true;
209
+ }
210
+ },
211
+ computed: {
212
+ someMobileOpened() {
213
+ return this.profileDropDown.filter(
214
+ (el) => el.opened && el.children.length > 0
215
+ );
216
+ },
217
+ },
218
+ methods: {
219
+ setShowModal(bool) {
220
+ this.$emit("setShowModal", bool);
221
+ },
222
+ logout() {
223
+ this.$emit("logout");
224
+ },
225
+ preventLink(disabled, e) {
226
+ if (disabled) {
227
+ e.preventDefault();
228
+ }
229
+ },
230
+ async showModal(url, name) {
231
+ if (name.includes("Текущий")) {
232
+ if (window.location.href.includes(url)) {
233
+ this.$emit("setIsReplenishModal", true);
234
+ this.setShowModal(true);
235
+ } else {
236
+ await window.open(url + "&modal=show", "_self");
237
+ }
238
+ }
239
+ },
240
+ handleClick(url, name) {
241
+ if (!name.includes("Текущий")) {
242
+ window.open(url, name === 'Избранные' ? '_blank' : '_self');
243
+ }
244
+ },
245
+ rotateItem(index) {
246
+ this.chosenElem = this.profileDropDown[index];
247
+ const array = this.profileDropDown;
248
+ array.forEach((el, idx) => {
249
+ if (index === idx) {
250
+ this.$set(el, 'opened', !el.opened);
251
+ } else this.$set(el, 'opened', false)
252
+ });
253
+ },
254
+ goAuth() {
255
+ const fullPath = encodeURIComponent(window.location.toString());
256
+ if (window) {
257
+ window.location.href = `${this.loginUrl}?url=${fullPath}`;
258
+ }
259
+ },
260
+ },
261
+ };
262
+ </script>
263
+
264
+ <style lang="scss">
265
+ a {
266
+ text-decoration: none;
267
+ background-color: transparent;
268
+ }
269
+
270
+ svg {
271
+ transition: all 0.3s linear;
272
+ }
273
+
274
+ svg.rotated {
275
+ transform: rotate(180deg);
276
+ }
277
+
278
+ .gray-text {
279
+ font-size: 12px;
280
+ line-height: 14px;
281
+ font-weight: 400;
282
+ color: #2c3e50;
283
+ padding: 10px 16px;
284
+ cursor: pointer;
285
+ }
286
+
287
+ .profile {
288
+ position: relative;
289
+
290
+ &__inner {
291
+ padding: 0;
292
+ display: flex;
293
+ align-items: center;
294
+ }
295
+
296
+ &__item {
297
+ font-size: 14px;
298
+ font-weight: 600;
299
+ margin: 0;
300
+ padding: 8px 0;
301
+ white-space: nowrap;
302
+ cursor: pointer;
303
+
304
+ &-link {
305
+ display: flex;
306
+ align-items: center;
307
+ font-size: 14px;
308
+
309
+ &:first-child {
310
+ @media (max-width: 1025px) {
311
+ display: none;
312
+ }
313
+ }
314
+
315
+ &:nth-child(2) {
316
+ display: none;
317
+ @media (max-width: 1025px) {
318
+ display: flex;
319
+ }
320
+ }
321
+ }
322
+
323
+ span {
324
+ white-space: nowrap;
325
+ margin: 0 7px;
326
+ }
327
+
328
+ .arrow-svg {
329
+ transition: all 0.3s;
330
+ vertical-align: middle;
331
+ width: 16px;
332
+ height: 16px;
333
+ transform: rotate(0deg);
334
+
335
+ &.rotate {
336
+ transform: rotate(180deg);
337
+ }
338
+ }
339
+ }
340
+
341
+ .profile-menu {
342
+ width: 368px;
343
+ height: 100%;
344
+ position: absolute;
345
+ right: 0;
346
+ top: 100%;
347
+ background-color: #fff;
348
+ box-shadow: 0px 3px 6px #959cb140;
349
+ border-radius: 2px;
350
+ z-index: 10000;
351
+ @media (max-width: 1025px) {
352
+ display: none;
353
+ }
354
+
355
+ &__items {
356
+ font-size: 12px;
357
+ line-height: 14px;
358
+ font-weight: 400;
359
+ color: #2c3e50;
360
+ cursor: pointer;
361
+
362
+ span.balance {
363
+ padding: 2px 8px;
364
+ color: #698096;
365
+ background: #ECEFF1;
366
+ border-radius: 100px;
367
+ }
368
+
369
+ .rate-item {
370
+ display: flex;
371
+ justify-content: space-between;
372
+ align-items: center;
373
+ width: 100%;
374
+ color: #007aff;
375
+ font-size: 14px;
376
+ font-weight: 600;
377
+ span.rate {
378
+ color: #2C3E50;
379
+ font-size: 12px;
380
+ }
381
+ }
382
+
383
+ div:not(:last-child) > a > .gray-text {
384
+ border-bottom: 0.5px solid #bdc7ce;
385
+ }
386
+
387
+ div:not(:last-child) > .gray-text {
388
+ border-bottom: 0.5px solid #bdc7ce;
389
+
390
+ & + div {
391
+ padding: 10px 16px;
392
+ }
393
+ }
394
+
395
+ div
396
+ > .gray-text:not(.profile-menu__balance-link):not(.profile-menu__links) {
397
+ padding: 0;
398
+
399
+ a {
400
+ color: #2c3e50;
401
+
402
+ &:visited {
403
+ color: #2c3e50;
404
+ }
405
+ }
406
+ }
407
+ }
408
+
409
+ &__item__child {
410
+ padding: 0 16px 0 32px;
411
+ height: 40px;
412
+ display: flex;
413
+ border-top: 0.5px solid #bdc7ce;
414
+ align-items: center;
415
+
416
+ &:hover {
417
+ background: #2c3e500c;
418
+ }
419
+
420
+ span {
421
+ display: flex;
422
+ align-items: center;
423
+
424
+ svg {
425
+ margin-right: 5px;
426
+
427
+ path {
428
+ fill: #2c3e500c !important;
429
+ }
430
+ }
431
+ }
432
+ }
433
+
434
+ &__item__children {
435
+ padding: 0 16px;
436
+ display: flex;
437
+ justify-content: space-between;
438
+ align-items: center;
439
+ height: 40px;
440
+
441
+ &:hover {
442
+ background: #2c3e500c;
443
+ }
444
+
445
+ &.active {
446
+ background: #ECEFF1;
447
+ border-left: 3px solid #007aff;
448
+ }
449
+ }
450
+
451
+ &__balance-link {
452
+ display: flex;
453
+ align-items: center;
454
+ justify-content: space-between;
455
+ height: 40px;
456
+ padding: 0 16px;
457
+
458
+ &:hover {
459
+ background: #2c3e500d;
460
+ }
461
+
462
+ &:not(:last-child) {
463
+ border-bottom: 1px solid #eef0f5;
464
+ }
465
+ }
466
+
467
+ &__balance {
468
+ font-size: 14px;
469
+ font-weight: 600;
470
+ color: #007aff;
471
+ white-space: nowrap;
472
+ }
473
+
474
+ &__links {
475
+ display: flex;
476
+ align-items: center;
477
+ align-content: center;
478
+ height: 40px;
479
+ padding: 0 16px;
480
+
481
+ &:hover {
482
+ background: linear-gradient(0deg, rgba(236, 239, 241, 0.5), rgba(236, 239, 241, 0.5)), #FFFFFF;
483
+ }
484
+
485
+ &:not(:last-child) {
486
+ border-bottom: 1px solid #eef0f5;
487
+ }
488
+ }
489
+ }
490
+ }
491
+
492
+ .exit {
493
+ background: #007AFF;
494
+ height: 40px;
495
+ border-radius: 0 0 2px 2px;
496
+ display: flex;
497
+ align-items: center;
498
+ justify-content: center;
499
+ cursor: pointer;
500
+
501
+ &:hover {
502
+ background: #9da3ac;
503
+ color: #fff;
504
+ }
505
+
506
+ &:hover svg {
507
+ stroke: #fff;
508
+ background: #9da3ac;
509
+ }
510
+
511
+ svg {
512
+ margin-right: 8px;
513
+ background: #007AFF;
514
+ fill: none !important;
515
+ stroke: #fff;
516
+ transition: all 0s;
517
+ }
518
+
519
+ &:active {
520
+ background: #0055bb;
521
+ color: #fff;
522
+ }
523
+
524
+ &:active svg {
525
+ stroke: #fff;
526
+ background: #0055bb;
527
+ }
528
+
529
+ font-weight: 600;
530
+ font-size: 14px;
531
+ line-height: 16px;
532
+ color: #fff;
533
+ }
534
+
535
+ .sign {
536
+ height: 40px;
537
+ background: transparent;
538
+ border: none;
539
+ border-radius: 0 0 2px 2px;
540
+ display: flex;
541
+ align-items: center;
542
+ justify-content: center;
543
+ cursor: pointer;
544
+
545
+ &:hover {
546
+ svg {
547
+ stroke: #71757a !important;
548
+ }
549
+
550
+ span {
551
+ color: #71757a;
552
+ }
553
+ }
554
+
555
+ &:active {
556
+ svg {
557
+ stroke: #9da3ac !important;
558
+ }
559
+
560
+ span {
561
+ color: #9da3ac;
562
+ }
563
+ }
564
+
565
+ svg {
566
+ margin-right: 8px;
567
+ fill: none !important;
568
+ stroke: #2c3e50 !important;
569
+ @media (max-width: 1025px) {
570
+ stroke: none !important;
571
+ margin-right: 24px;
572
+ }
573
+ }
574
+
575
+ span {
576
+ font-weight: 600;
577
+ font-size: 14px;
578
+ line-height: 16px;
579
+ color: #2c3e50;
580
+ margin: 0 0;
581
+ }
582
+ }
583
+
584
+ .requests {
585
+ &__link {
586
+ font-size: 12px;
587
+ line-height: 16px;
588
+ font-weight: 400;
589
+ padding: 12px;
590
+ color: var(--newColor);
591
+ white-space: nowrap;
592
+ margin: 0 6px 0 0;
593
+ @media (max-width: 1025px) {
594
+ display: none;
595
+ }
596
+
597
+ svg {
598
+ vertical-align: middle;
599
+ width: 20px;
600
+ height: 20px;
601
+ margin-right: 4px;
602
+ margin-bottom: 2px;
603
+ }
604
+
605
+ span {
606
+ color: #2c3e50;
607
+ font-weight: 600;
608
+ }
609
+ }
610
+ }
611
+
612
+ .user {
613
+ display: none;
614
+ @media (max-width: 1025px) {
615
+ width: 24px;
616
+ height: 24px;
617
+ margin-right: 24px;
618
+ display: flex;
619
+ }
620
+ }
621
+
622
+ .exit-mobile {
623
+ display: none;
624
+ @media (max-width: 1025px) {
625
+ display: block;
626
+ width: 24px;
627
+ height: 24px;
628
+ margin-right: 12px;
629
+ }
630
+ }
631
+
632
+ .mobile-table {
633
+ display: none;
634
+ @media (max-width: 1025px) {
635
+ display: block;
636
+ }
637
+
638
+ &-head {
639
+ padding: 0 16px;
640
+ background: #f4f4f4;
641
+ display: flex;
642
+ align-items: center;
643
+ justify-content: space-between;
644
+ width: 100%;
645
+ height: 40px;
646
+
647
+ p {
648
+ font-weight: 600;
649
+ font-size: 17px;
650
+ line-height: 19px;
651
+ color: #2c3e50;
652
+ }
653
+
654
+ svg {
655
+ width: 18px;
656
+ height: 18px;
657
+ @media (max-width: 1025px) {
658
+ width: 24px;
659
+ height: 24px;
660
+ }
661
+ }
662
+
663
+ &-chosen {
664
+ position: relative;
665
+
666
+ & > div {
667
+ position: absolute;
668
+ }
669
+
670
+ p {
671
+ text-align: center;
672
+ width: 100%;
673
+ }
674
+ }
675
+ }
676
+ }
677
+
678
+ .profile-menu-mobile {
679
+ height: 100%;
680
+
681
+ .bb > a,
682
+ .bb > a:visited {
683
+ color: #000;
684
+ }
685
+
686
+ &__inner {
687
+ display: flex;
688
+ flex-direction: column;
689
+ height: 72%;
690
+ }
691
+
692
+ &__links,
693
+ &__item {
694
+ padding: 0 16px;
695
+ height: 52px;
696
+ border: 1px solid #9da3ac;
697
+ border-bottom: none;
698
+ font-size: 14px;
699
+ display: flex;
700
+ align-items: center;
701
+ }
702
+
703
+ &__balance-link {
704
+ padding: 0 16px;
705
+ height: 52px;
706
+ border: 1px solid #9da3ac;
707
+ border-bottom: none;
708
+ font-size: 14px;
709
+ display: flex;
710
+ justify-content: space-between;
711
+ }
712
+
713
+ &__balance {
714
+ color: #1e88e5;
715
+ font-size: 16px;
716
+ white-space: nowrap;
717
+ display: flex;
718
+ align-items: center;
719
+
720
+ &-items {
721
+ display: flex;
722
+ flex-direction: column;
723
+ justify-content: center;
724
+
725
+ &__upper-text {
726
+ font-weight: normal;
727
+ font-size: 10px;
728
+ line-height: 14px;
729
+ color: #69797d;
730
+ margin-bottom: 4px;
731
+ }
732
+
733
+ &__bot-text {
734
+ font-weight: 600;
735
+ font-size: 12px;
736
+ line-height: 16px;
737
+ color: #2c3e50;
738
+ }
739
+ }
740
+ }
741
+ }
742
+
743
+ .exit-mob {
744
+ background: #ffcd33;
745
+ border-radius: 2px;
746
+ height: 40px;
747
+ display: flex;
748
+ align-items: center;
749
+ justify-content: center;
750
+ cursor: pointer;
751
+ font-weight: normal;
752
+ font-size: 16px;
753
+ line-height: 16px;
754
+ color: #2c3e50;
755
+ margin: 16px 16px 0;
756
+
757
+ svg {
758
+ margin-right: 8px;
759
+ fill: none !important;
760
+ }
761
+ }
762
+
763
+ .bb {
764
+ &:last-child {
765
+ border-bottom: 1px solid #9da3ac;
766
+ }
767
+ }
768
+
769
+ .button-inner {
770
+ display: flex;
771
+ align-items: center;
772
+ justify-content: space-between;
773
+ width: 100%;
774
+ }
775
+
776
+ .sign_text {
777
+ @media (max-width: 1025px) {
778
+ display: none;
779
+ }
780
+ }
781
+ </style>