adata-ui 0.2.9 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "0.2.9",
3
+ "version": "0.3.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -13,9 +13,14 @@
13
13
  <div class="header" :class="{ bordered: isBordered }">
14
14
  <div class="container">
15
15
  <div class="header__left">
16
- <a class="logo" :href="main[mode]">
16
+ <a
17
+ class="logo"
18
+ :href="main[mode]"
19
+ onclick="return false;"
20
+ @click="goToAnotherModule(main[mode])"
21
+ >
17
22
  <svg
18
- class="adata-logo"
23
+ class="adata-logo desktop"
19
24
  xmlns="http://www.w3.org/2000/svg"
20
25
  viewBox="0 0 166 48"
21
26
  >
@@ -26,6 +31,10 @@
26
31
  d="M44.905 0H4.99a5.091 5.091 0 00-3.528 1.406A4.71 4.71 0 000 4.8v38.4a4.71 4.71 0 001.461 3.394A5.091 5.091 0 004.99 48h39.916a5.091 5.091 0 003.528-1.406 4.71 4.71 0 001.462-3.394V4.8a4.71 4.71 0 00-1.462-3.394A5.091 5.091 0 0044.905 0zM31.737 38.26l-2.079-6.232H19.305l-2.05 6.232h-7.097l10.598-28h7.776l10.353 28h-7.148z"
27
32
  ></path>
28
33
  </svg>
34
+ <svg class="adata-logo mobile" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">
35
+ <path d="M11.3883 7.06335H11.3145C11.2829 7.43668 11.2054 7.80519 11.0836 8.16135L9.64099 12.44H13.0335L11.6098 8.20455C11.4947 7.83247 11.4204 7.45002 11.3883 7.06335Z" fill="#2C3E50"/>
36
+ <path d="M20.6552 0.200012H2.48111C1.8786 0.200012 1.30077 0.427581 0.874734 0.83266C0.448697 1.23774 0.209351 1.78714 0.209351 2.36001V19.64C0.209351 20.2129 0.448697 20.7623 0.874734 21.1674C1.30077 21.5724 1.8786 21.8 2.48111 21.8H20.6552C21.2577 21.8 21.8355 21.5724 22.2616 21.1674C22.6876 20.7623 22.9269 20.2129 22.9269 19.64V2.36001C22.9269 1.78714 22.6876 1.23774 22.2616 0.83266C21.8355 0.427581 21.2577 0.200012 20.6552 0.200012ZM14.6596 17.417L13.7131 14.6126H8.99916L8.06585 17.417H4.83427L9.65987 4.81702H13.2L17.9139 17.417H14.6596Z" fill="#2C3E50"/>
37
+ </svg>
29
38
  </a>
30
39
  <div class="menu" v-show="headerItems.length > 0">
31
40
  <a
@@ -34,11 +43,28 @@
34
43
  class="menu__wrapper menu__items"
35
44
  :class="{ active: item.key === activeTabKey }"
36
45
  :href="item[mode]"
46
+ @click="goToAnotherModule(item[mode])"
47
+ onclick="return false;"
37
48
  >
38
49
  {{ item.name }}
39
50
  </a>
40
51
  </div>
41
- <slot name="mobileSearch"></slot>
52
+ <div v-show="hasSearchField" class="mobile-search">
53
+ <div @click="$emit('search')" class="search-input">
54
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
55
+ <path d="M14 13.9995L10.5967 10.596" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
56
+ <circle cx="7" cy="7" r="5" stroke="#2C3E50" stroke-linecap="round" stroke-linejoin="round"/>
57
+ </svg>
58
+ Найти
59
+ </div>
60
+ <a v-show="hasFavourites" :href="favouriteUrl" target="_blank">
61
+ <div @click="$emit('')" class="favorite-btn">
62
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
63
+ <path d="M3 2.5V14.0057C3 14.4167 3.46826 14.6521 3.79816 14.4071L7.70184 11.5072C7.87886 11.3757 8.12114 11.3757 8.29816 11.5072L12.2018 14.4071C12.5317 14.6521 13 14.4167 13 14.0057V2.5C13 2.22386 12.7761 2 12.5 2H3.5C3.22386 2 3 2.22386 3 2.5Z" stroke="#2C3E50" stroke-linecap="round" stroke-linejoin="round"/>
64
+ </svg>
65
+ </div>
66
+ </a>
67
+ </div>
42
68
  </div>
43
69
  <div class="header__right" v-show="!noAuth">
44
70
  <Profile
@@ -423,16 +449,6 @@
423
449
  <span>Выход</span>
424
450
  </button>
425
451
  </div>
426
- <!-- <div class="menu-mobile__info-footer">-->
427
- <!-- <div class="menu-mobile__info-footer-item" v-show="requestCount === 0 || requestCount">-->
428
- <!-- <span class="menu-mobile__info-footer-title">Суточный лимит запросов:</span>-->
429
- <!-- <span class="menu-mobile__info-footer-circle">{{ requestCount }}</span>-->
430
- <!-- </div>-->
431
- <!-- <div class="menu-mobile__info-footer-item" v-show="daysRemaining === 0 || daysRemaining">-->
432
- <!-- <span class="menu-mobile__info-footer-title">Остаток дней:</span>-->
433
- <!-- <span class="menu-mobile__info-footer-circle">{{ daysRemaining }}</span>-->
434
- <!-- </div>-->
435
- <!-- </div>-->
436
452
  </div>
437
453
  </div>
438
454
  </div>
@@ -521,12 +537,21 @@ export default {
521
537
  },
522
538
  balance: {
523
539
  type: Number,
524
- default: 0,
540
+ default: 0
525
541
  },
542
+ hasFavourites: {
543
+ type: Boolean,
544
+ default: false
545
+ },
546
+ hasSearchField: {
547
+ type: Boolean,
548
+ default: false
549
+ }
526
550
  },
527
551
  data() {
528
552
  return {
529
553
  isActiveMenu: false,
554
+ favouriteUrl: "/profile/favorites",
530
555
  main: {
531
556
  dev: "https://adtdev.kz",
532
557
  prod: "https://adata.kz",
@@ -589,6 +614,12 @@ export default {
589
614
  this.notificationShow()
590
615
  },
591
616
  methods: {
617
+ goToAnotherModule(url) {
618
+ if(!location.href.includes(url)) {
619
+ this.$emit("changeModule");
620
+ }
621
+ window.open(url, "_self");
622
+ },
592
623
  goAuth() {
593
624
  const fullPath = encodeURIComponent(window.location.toString());
594
625
  if (window) {
@@ -711,6 +742,9 @@ export default {
711
742
  display: flex;
712
743
  justify-content: space-between;
713
744
  align-items: center;
745
+ @media (max-width: 1025px) {
746
+ gap: 12px;
747
+ }
714
748
  }
715
749
 
716
750
  &__right {
@@ -721,6 +755,9 @@ export default {
721
755
  &__left {
722
756
  display: flex;
723
757
  align-items: center;
758
+ @media (max-width: 1025px) {
759
+ width: 100%;
760
+ }
724
761
 
725
762
  .menu {
726
763
  display: flex;
@@ -771,6 +808,9 @@ export default {
771
808
  .logo {
772
809
  display: block;
773
810
  margin-right: 20px;
811
+ @media (max-width: 1025px) {
812
+ margin-right: 10px;
813
+ }
774
814
 
775
815
  svg {
776
816
  width: 90px;
@@ -785,6 +825,18 @@ export default {
785
825
  &:hover {
786
826
  fill: #71757a;
787
827
  }
828
+ &.desktop {
829
+ @media (max-width: 1025px) {
830
+ display: none;
831
+ }
832
+ }
833
+ &.mobile {
834
+ display: none;
835
+ @media (max-width: 1025px) {
836
+ display: block;
837
+ width: auto;
838
+ }
839
+ }
788
840
  }
789
841
  }
790
842
  }
@@ -1064,4 +1116,43 @@ export default {
1064
1116
  }
1065
1117
  }
1066
1118
 
1119
+ .mobile-search {
1120
+ display: none;
1121
+ height: 32px;
1122
+ max-height: 32px;
1123
+ @media (max-width: 1025px) {
1124
+ display: flex;
1125
+ align-items: center;
1126
+ gap: 8px;
1127
+ width: 100%;
1128
+ }
1129
+ .search-input {
1130
+ display: flex;
1131
+ align-items: center;
1132
+ gap: 8px;
1133
+ background: rgba(189, 199, 206, 0.2);
1134
+ height: 100%;
1135
+ border-radius: 2px;
1136
+ width: 100%;
1137
+ padding: 0 14px;
1138
+ font-weight: 500;
1139
+ font-size: 12px;
1140
+ line-height: 20px;
1141
+ cursor: pointer;
1142
+ }
1143
+ .favorite-btn {
1144
+ background: rgba(189, 199, 206, 0.2);
1145
+ display: flex;
1146
+ justify-content: center;
1147
+ align-items: center;
1148
+ padding: 10px;
1149
+ height: 100%;
1150
+ border-radius: 2px;
1151
+ cursor: pointer;
1152
+ svg {
1153
+ width: 16px;
1154
+ height: 16px;
1155
+ }
1156
+ }
1157
+ }
1067
1158
  </style>
@@ -256,7 +256,7 @@ export default {
256
256
  },
257
257
  handleClick(url, name) {
258
258
  if (!name.includes("Текущий")) {
259
- window.open(url, "_self");
259
+ window.open(url, name === 'Избранные' ? '_blank' : '_self');
260
260
  }
261
261
  },
262
262
  rotateItem(index) {
@@ -55,7 +55,13 @@
55
55
  </div>
56
56
  <SlideToggle>
57
57
  <div v-show="item.opened" class="mobile-table-item__children">
58
- <a v-for="(elem, id) in item.children" :key="'elem' + id" :href="elem[mode]">{{ elem.name }}</a>
58
+ <a
59
+ v-for="(elem, id) in item.children" :key="'elem' + id"
60
+ :href="elem[mode]"
61
+ :target="elem.name === 'Избранные' ? '_blank' : '_self'"
62
+ >
63
+ {{ elem.name }}
64
+ </a>
59
65
  </div>
60
66
  </SlideToggle>
61
67
  </div>
@@ -1,4 +1,3 @@
1
- import Vue from "vue";
2
1
  import ACheckbox from "./Checkbox/ACheckbox";
3
2
  import ACheckboxMenu from "./CheckboxMenu/CheckboxMenu";
4
3
  import AButton from "./Button/AButton";
@@ -18,7 +17,7 @@ import AInternalServerError from "./ErrorPages/InternalServerError";
18
17
  import ANotFound from "./ErrorPages/NotFound";
19
18
  import AUnavailable from "./ErrorPages/Unavailable";
20
19
 
21
- const Components = {
20
+ export default {
22
21
  ACheckbox,
23
22
  AButton,
24
23
  ATextField,
@@ -39,8 +38,5 @@ const Components = {
39
38
  AUnavailable,
40
39
  };
41
40
 
42
- Object.keys(Components).forEach((name) => {
43
- Vue.component(name, Components[name]);
44
- });
45
41
 
46
- export default Components;
42
+