adata-ui 0.1.52 → 0.1.53

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,7 +1,7 @@
1
1
  <template>
2
2
  <div class="info">
3
3
  <transition name="fade">
4
- <div class="info-notification" v-if="showNotification">
4
+ <div class="info-notification" v-if="isOpenNotification">
5
5
  <div class="container">
6
6
  <div class="info-notification__wrapper">
7
7
  <div class="info-notification__content">
@@ -21,87 +21,38 @@
21
21
  </div>
22
22
  </div>
23
23
  </transition>
24
- <div class="info-header" v-if="!showNotification">
24
+ <div class="info-header" v-if="!isOpenNotification">
25
25
  <div class="container">
26
26
  <div class="info-header__list">
27
27
  <div class="info-header__item">
28
- <div class="info-header__item-elem first-elem">
29
- <svg id="rate" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
30
- <rect x="2" y="4" width="12" height="7.50184" stroke="#2C3E50" stroke-linejoin="round"/>
31
- <path d="M7 5.99902H9" stroke="#2C3E50" stroke-linecap="round" stroke-linejoin="round"/>
32
- <path d="M7 7.50586H9" stroke="#2C3E50" stroke-linecap="round" stroke-linejoin="round"/>
33
- <path d="M8 9.99902L8 7.50563" stroke="#2C3E50" stroke-linecap="round" stroke-linejoin="round"/>
34
- </svg>
35
- <p>Курс валют</p>
36
- </div>
37
- <div class="info-header__item-elem">
38
- <div class="info-header__inner-item">
39
- <svg id="dollar" width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
40
- <path d="M5.59863 9.40234C5.59863 9.01497 5.47559 8.69596 5.22949 8.44531C4.9834 8.1901 4.57324 7.96224 3.99902 7.76172C3.4248 7.55664 2.97819 7.36751 2.65918 7.19434C1.59733 6.62467 1.06641 5.78158 1.06641 4.66504C1.06641 3.90853 1.29655 3.28646 1.75684 2.79883C2.21712 2.3112 2.84147 2.02181 3.62988 1.93066V0.44043H4.72363V1.94434C5.5166 2.05827 6.12956 2.39551 6.5625 2.95605C6.99544 3.51204 7.21191 4.23665 7.21191 5.12988H5.55762C5.55762 4.55566 5.42773 4.10449 5.16797 3.77637C4.91276 3.44368 4.56413 3.27734 4.12207 3.27734C3.68457 3.27734 3.34277 3.39583 3.09668 3.63281C2.85059 3.86979 2.72754 4.20931 2.72754 4.65137C2.72754 5.04785 2.84831 5.36686 3.08984 5.6084C3.33594 5.84538 3.75065 6.07096 4.33398 6.28516C4.91732 6.49935 5.37533 6.69759 5.70801 6.87988C6.04069 7.06217 6.32096 7.27181 6.54883 7.50879C6.77669 7.74121 6.95215 8.01009 7.0752 8.31543C7.19824 8.62077 7.25977 8.97852 7.25977 9.38867C7.25977 10.1589 7.02279 10.7832 6.54883 11.2617C6.07943 11.7402 5.42318 12.0228 4.58008 12.1094V13.4424H3.49316V12.1162C2.59082 12.016 1.89583 11.6924 1.4082 11.1455C0.92513 10.5986 0.683594 9.87402 0.683594 8.97168H2.34473C2.34473 9.5459 2.48828 9.99023 2.77539 10.3047C3.06706 10.6191 3.47721 10.7764 4.00586 10.7764C4.52539 10.7764 4.9196 10.651 5.18848 10.4004C5.46191 10.1497 5.59863 9.81706 5.59863 9.40234Z" fill="#2C3E50"/>
41
- </svg>
42
- <p v-if="currency">{{ currency.sell }}</p>
43
- <!-- <svg id="arrow-up" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">-->
44
- <!-- <path d="M3 9.5L8 6L13 9.5" stroke="#00B92D" stroke-linecap="round" stroke-linejoin="round"/>-->
45
- <!-- </svg>-->
46
- </div>
47
- <div class="info-header__inner-item">
48
- <svg id="dollar" width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
49
- <path d="M5.59863 9.40234C5.59863 9.01497 5.47559 8.69596 5.22949 8.44531C4.9834 8.1901 4.57324 7.96224 3.99902 7.76172C3.4248 7.55664 2.97819 7.36751 2.65918 7.19434C1.59733 6.62467 1.06641 5.78158 1.06641 4.66504C1.06641 3.90853 1.29655 3.28646 1.75684 2.79883C2.21712 2.3112 2.84147 2.02181 3.62988 1.93066V0.44043H4.72363V1.94434C5.5166 2.05827 6.12956 2.39551 6.5625 2.95605C6.99544 3.51204 7.21191 4.23665 7.21191 5.12988H5.55762C5.55762 4.55566 5.42773 4.10449 5.16797 3.77637C4.91276 3.44368 4.56413 3.27734 4.12207 3.27734C3.68457 3.27734 3.34277 3.39583 3.09668 3.63281C2.85059 3.86979 2.72754 4.20931 2.72754 4.65137C2.72754 5.04785 2.84831 5.36686 3.08984 5.6084C3.33594 5.84538 3.75065 6.07096 4.33398 6.28516C4.91732 6.49935 5.37533 6.69759 5.70801 6.87988C6.04069 7.06217 6.32096 7.27181 6.54883 7.50879C6.77669 7.74121 6.95215 8.01009 7.0752 8.31543C7.19824 8.62077 7.25977 8.97852 7.25977 9.38867C7.25977 10.1589 7.02279 10.7832 6.54883 11.2617C6.07943 11.7402 5.42318 12.0228 4.58008 12.1094V13.4424H3.49316V12.1162C2.59082 12.016 1.89583 11.6924 1.4082 11.1455C0.92513 10.5986 0.683594 9.87402 0.683594 8.97168H2.34473C2.34473 9.5459 2.48828 9.99023 2.77539 10.3047C3.06706 10.6191 3.47721 10.7764 4.00586 10.7764C4.52539 10.7764 4.9196 10.651 5.18848 10.4004C5.46191 10.1497 5.59863 9.81706 5.59863 9.40234Z" fill="#2C3E50"/>
50
- </svg>
51
- <p v-if="currency">{{ currency.buy }}</p>
28
+ <template v-if="currencies" >
29
+ <div v-for="(currency, index) in currencies" :key="index" class="info-header__item-elem">
30
+ <img v-if="currency.currency === 'USD'" src="@/assets/icons/dollor.svg" alt=""/>
31
+ <img v-if="currency.currency === 'EUR'" src="@/assets/icons/euro.svg" alt=""/>
32
+ <img v-if="currency.currency === 'RUB'" src="@/assets/icons/ruble.svg" alt=""/>
33
+ <div class="info-header__inner-item">
34
+ <span class="info-header__result">{{ currency.sell }}</span>
35
+ <img v-if="currency.sell_state === 'DOWN'" src="@/assets/icons/arrow-down.svg" alt=""/>
36
+ <img v-else src="@/assets/icons/arrow-up.svg" alt=""/>
37
+ </div>
38
+ <div class="info-header__inner-item">
39
+ <span class="info-header__result">{{ currency.buy }}</span>
40
+ <img v-if="currency.buy_state === 'DOWN'" src="@/assets/icons/arrow-down.svg" alt=""/>
41
+ <img v-else src="@/assets/icons/arrow-up.svg" alt=""/>
42
+ </div>
52
43
  </div>
53
- <!-- <div class="info-header&#45;&#45;inner-item">-->
54
- <!-- <svg id="ruble" width="10" height="14" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">-->
55
- <!-- <path d="M5.49869 7.85079H3.66439V9.16671H2.22884V7.85079H1.06104V6.69437H2.22884V6.08484H1.06104V4.92842H2.22884V0.872437H5.40185C6.31711 0.872437 7.04818 1.11169 7.59505 1.59021C8.14193 2.06492 8.41536 2.69725 8.41536 3.48718C8.41536 4.29231 8.15522 4.92463 7.63493 5.38416C7.11464 5.83988 6.39117 6.07345 5.46452 6.08484H3.66439V6.69437H5.49869V7.85079ZM3.66439 4.92842H5.37907C5.89556 4.92842 6.29053 4.8088 6.56396 4.56954C6.8374 4.33028 6.97412 3.97329 6.97412 3.49857C6.97412 3.07323 6.8393 2.72573 6.56966 2.4561C6.30382 2.18646 5.93544 2.04594 5.46452 2.03455H3.66439V4.92842Z" fill="#2C3E50"/>-->
56
- <!-- </svg>-->
57
- <!-- <p>5.92</p>-->
58
- <!-- <svg id="arrow-down" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">-->
59
- <!-- <path d="M3 6.5L8 10L13 6.5" stroke="#FF2E43" stroke-linecap="round" stroke-linejoin="round"/>-->
60
- <!-- </svg>-->
61
- <!-- </div>-->
62
- </div>
44
+ </template>
63
45
  </div>
64
- <!-- <div class="info-header__item">-->
65
- <!-- <div class="info-header__item-elem first-elem">-->
66
- <!-- <svg id="sun" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">-->
67
- <!-- <path d="M8.99995 12.7777C11.0864 12.7777 12.7777 11.0864 12.7777 8.99995C12.7777 6.91354 11.0864 5.22217 8.99995 5.22217C6.91354 5.22217 5.22217 6.91354 5.22217 8.99995C5.22217 11.0864 6.91354 12.7777 8.99995 12.7777Z" stroke="#2C3E50" stroke-miterlimit="10"/>-->
68
- <!-- <path d="M9 1V3.22222" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
69
- <!-- <path d="M9 14.7778V17.0001" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
70
- <!-- <path d="M17.0001 9H14.7778" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
71
- <!-- <path d="M3.22222 9H1" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
72
- <!-- <path d="M14.6669 3.33337L13.1113 4.88893" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
73
- <!-- <path d="M4.88905 13.1111L3.3335 14.6666" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
74
- <!-- <path d="M14.6669 14.6666L13.1113 13.1111" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
75
- <!-- <path d="M4.88905 4.88893L3.3335 3.33337" stroke="#2C3E50" stroke-miterlimit="10" stroke-linecap="round"/>-->
76
- <!-- </svg>-->
77
- <!-- <p>Погода</p>-->
78
- <!-- </div>-->
79
- <!-- <div class="info-header__item-elem">-->
80
- <!-- <div class="info-header&#45;&#45;inner-item weather">-->
81
- <!-- <span>Алматы </span>-->
82
- <!-- <p>+29 С</p>-->
83
- <!-- </div>-->
84
- <!-- <div class="info-header&#45;&#45;inner-item weather">-->
85
- <!-- <span>Нур-Султан </span>-->
86
- <!-- <p>+29 С</p>-->
87
- <!-- </div>-->
88
- <!-- </div>-->
89
- <!-- </div>-->
90
- <div v-if="isAuthenticated" class="info-header__item last-header-item">
46
+ <div v-if="isAuthenticated" class="info-header__item">
91
47
  <div class="info-header__item-elem">
92
- <svg id="clock" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
93
- <path d="M6.93821 13.2567C10.4279 13.2567 13.2568 10.4277 13.2568 6.93809C13.2568 3.44843 10.4279 0.619507 6.93821 0.619507C3.44855 0.619507 0.619629 3.44843 0.619629 6.93809C0.619629 10.4277 3.44855 13.2567 6.93821 13.2567Z" stroke="#2C3E50" stroke-miterlimit="100"/>
94
- <path d="M6.93799 3.46899V6.93802L11.1504 9.292" stroke="#2C3E50" stroke-miterlimit="100" stroke-linecap="round"/>
95
- </svg>
96
48
  <div class="info-header__inner-item">
97
- <p>Cуточный лимит запросов:
98
- <span>{{ requestCount }}</span>
99
- </p>
49
+ <span class="info-header__title">Cуточный лимит запросов:</span>
50
+ <span class="info-header__result info-header__result_circled">{{ requestCount }}</span>
100
51
  </div>
52
+ <div class="divider"></div>
101
53
  <div class="info-header__inner-item">
102
- <p>остаток дней:
103
- <span>{{ daysRemaining }}</span>
104
- </p>
54
+ <span class="info-header__title">остаток дней:</span>
55
+ <span class="info-header__result info-header__result_circled">{{ daysRemaining }}</span>
105
56
  </div>
106
57
  </div>
107
58
  </div>
@@ -128,80 +79,36 @@ export default {
128
79
  type: Boolean,
129
80
  default: false
130
81
  },
131
- },
132
- data() {
133
- return {
134
- showNotification: false,
135
- systemMessage: null,
136
- currency: null,
137
- timer: null,
138
- }
139
- },
140
- created() {
141
- this.fetchCurrency();
142
- },
143
- mounted() {
144
- this.timer = setTimeout(this.fetchNotification, 3000);
145
- },
146
- watch: {
147
- showNotification() {
148
- if(!this.showNotification) {
149
- clearTimeout(this.timer);
150
- }
151
- }
152
- },
153
- methods: {
154
- async fetchNotification() {
155
- try {
156
- const response = await fetch('https://users.adtdev.kz/api/v1/system-messages/active-list/?module_name=counterparty');
157
- const { data } = await response.json();
158
-
159
- if (data.details.length) {
160
- this.systemMessage = data.details[0].message;
161
- this.showNotification = true;
162
- }
163
-
164
- } catch(e) {
165
- console.log(e.message)
166
- }
82
+ isOpenNotification: {
83
+ type: Boolean,
84
+ default: false
167
85
  },
168
- async fetchCurrency() {
169
- try {
170
- const response = await fetch('https://users.adtdev.kz/api/v1/information/currency');
171
- const { data } = await response.json();
172
-
173
- if(data.USD) {
174
- this.currency = data.USD;
175
- }
176
-
177
- } catch(e) {
178
- console.log(e.message)
179
- }
86
+ weather: {
87
+ type: Array,
88
+ default: () => []
180
89
  },
181
- async fetchWeather() {
182
- try {
183
- const response = await fetch('https://users.adtdev.kz/api/v1/information/weather');
184
- const result = await response.json();
185
-
186
- if(result) {
187
- console.log(result);
188
- }
189
-
190
- } catch(e) {
191
- console.log(e.message)
192
- }
90
+ currencies: {
91
+ type: Array,
92
+ default: () => []
193
93
  },
194
- closeNotification() {
195
- this.showNotification = !this.showNotification
94
+ systemMessage:{
95
+ type: String,
96
+ default: ''
196
97
  },
197
98
  },
99
+ methods: {
100
+ closeNotification() {
101
+ this.$emit("closeNotification", this.isOpenNotification)
102
+ }
103
+ }
104
+
198
105
  }
199
106
  </script>
200
107
 
201
108
  <style scoped lang="scss">
202
109
  .info {
203
110
  position: relative;
204
- @media (min-width: 850px) {
111
+ @media (min-width: 1025px) {
205
112
  height: 30px;
206
113
  }
207
114
  &-notification {
@@ -213,7 +120,7 @@ export default {
213
120
  background: #007AFF;
214
121
  padding: 7px 0;
215
122
  font-size: 14px;
216
- @media(max-width: 850px) {
123
+ @media(max-width: 1025px) {
217
124
  position: relative;
218
125
  height: 30px;
219
126
  }
@@ -237,9 +144,27 @@ export default {
237
144
  background: #FFFFFF;
238
145
  padding: 7px 0;
239
146
  border-bottom: 0.5px solid rgba(189, 199, 206, 0.5);
240
- @media (max-width: 850px) {
147
+ @media (max-width: 1025px) {
241
148
  display: none;
242
149
  }
150
+ &__title {
151
+ font-weight: 500;
152
+ font-size: 12px;
153
+ line-height: 14px;
154
+ color: #2C3E50;
155
+ }
156
+ &__result {
157
+ font-weight: 400;
158
+ font-size: 12px;
159
+ line-height: 14px;
160
+ color: #2C3E50;
161
+ &_circled {
162
+ color: #ffffff;
163
+ padding: 4px 12px;
164
+ background: #007AFF;
165
+ border-radius: 100px;
166
+ }
167
+ }
243
168
  &__list {
244
169
  display: flex;
245
170
  justify-content: space-between;
@@ -248,50 +173,33 @@ export default {
248
173
  &__item {
249
174
  display: flex;
250
175
  align-items: center;
251
- gap: 15px;
176
+ gap: 20px;
252
177
  &-elem {
253
178
  display: flex;
254
179
  align-items: center;
255
- }
256
- .first-elem {
257
- font-weight: 700;
258
- font-size: 10px;
259
- gap: 5px;
180
+ gap: 7px;
260
181
  }
261
182
  }
262
183
  &__inner-item {
263
184
  display: flex;
264
185
  align-items: center;
186
+ gap: 8px;
265
187
  font-size: 12px;
266
- &:after {
267
- content: "";
268
- background: #2C3E50;
269
- width: 1px;
270
- height: 10px;
271
- margin: 0 10px;
272
- transform: rotate(20deg);
273
- }
274
- &:last-child:after {
275
- content: none;
276
- }
277
- &.weather {
278
- span {
279
- font-weight: 600;
280
- font-size: 10px;
281
- padding-right: 3px;
282
- }
283
- }
284
188
  }
285
189
  .last-header-item {
286
190
  .info-header__inner-item:nth-child(2) {
287
191
  margin-left: 5px;
288
192
  }
289
- span {
290
- font-weight: 700;
291
- color: #2c3e50;
292
- }
293
193
  }
294
194
  }
195
+
196
+ .divider {
197
+ background: #2C3E50;
198
+ width: 1px;
199
+ height: 10px;
200
+ margin: 0 10px;
201
+ transform: rotate(20deg);
202
+ }
295
203
  }
296
204
 
297
205
  .fade-enter-active,
@@ -0,0 +1,117 @@
1
+ <template>
2
+ <table class="a-table">
3
+ <thead>
4
+ <tr>
5
+ <th v-for="(col, i) in cols" :key="i">{{ col.name }}</th>
6
+ </tr>
7
+ </thead>
8
+ <tbody v-for="(row, i) in rows" :key="i">
9
+ <tr>
10
+ <td v-for="col in cols" :key="col.key" :data-label="`${col.name}`">
11
+ <slot :name="'key-' + col.key" :row="row">
12
+ {{ row[col.key] || defaultEmpty }}
13
+ </slot>
14
+ </td>
15
+ </tr>
16
+ </tbody>
17
+ </table>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ props: {
23
+ cols: {
24
+ type: Array,
25
+ default: () => [],
26
+ },
27
+ rows: {
28
+ type: Array,
29
+ default: () => [],
30
+ },
31
+ defaultEmpty: {
32
+ type: [String, Number],
33
+ default: "Нет данных",
34
+ },
35
+ },
36
+ };
37
+ </script>
38
+
39
+ <style lang="scss" scoped>
40
+ .a-table {
41
+ display: flex;
42
+ flex-direction: column;
43
+ background: #fff;
44
+
45
+ @media screen and (max-width: 850px) {
46
+ border: 0;
47
+ }
48
+
49
+ thead {
50
+ background: rgba(189, 199, 206, 0.3);
51
+
52
+ @media screen and (max-width: 850px) {
53
+ display: none;
54
+ }
55
+
56
+ tr {
57
+ display: flex;
58
+
59
+ th {
60
+ display: flex;
61
+ justify-content: center;
62
+ flex: 1;
63
+ padding: 20px 16px;
64
+ font-size: 12px;
65
+ font-weight: normal;
66
+ word-break: break-word;
67
+
68
+ @media screen and (max-width: 850px) {
69
+ justify-content: flex-start;
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ tbody {
76
+ tr {
77
+ display: flex;
78
+ border-bottom: 1px solid #ccc;
79
+
80
+ @media screen and (max-width: 850px) {
81
+ flex-direction: column;
82
+ margin: 10px;
83
+ padding: 10px 0;
84
+ border: 0;
85
+ background: rgba(189, 199, 206, 0.3);
86
+ }
87
+
88
+ td {
89
+ display: flex;
90
+ justify-content: center;
91
+ flex: 1;
92
+ padding: 20px 16px;
93
+ word-break: break-word;
94
+ font-size: 12px;
95
+ font-weight: normal;
96
+ text-align: left;
97
+
98
+ @media screen and (max-width: 850px) {
99
+ flex-direction: column;
100
+ row-gap: 4px;
101
+ justify-content: flex-start;
102
+ padding: 8px 16px;
103
+ }
104
+
105
+ &:before {
106
+ @media screen and (max-width: 850px) {
107
+ content: attr(data-label);
108
+ display: flex;
109
+ align-items: left;
110
+ font-weight: bold;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ </style>
@@ -0,0 +1,15 @@
1
+ import ATable from "./ATable.vue";
2
+
3
+ export default {
4
+ title: "Table",
5
+ component: ATable,
6
+ template: "<a-table></a-table>",
7
+ };
8
+
9
+ const Template = (args, { argTypes }) => ({
10
+ components: { ATable },
11
+ props: Object.keys(argTypes),
12
+ template: "<a-table v-bind='$props'></a-header>",
13
+ });
14
+
15
+ export const BaseTable = Template.bind({});
@@ -1,4 +1,5 @@
1
1
  import Vue from "vue";
2
+ import ACheckbox from "./Checkbox/ACheckbox";
2
3
  import AButton from "./Button/AButton";
3
4
  import ATextField from "./TextField/TextField";
4
5
  import APasswordField from "./PasswordField/PasswordField";
@@ -7,8 +8,10 @@ import AHeader from "./Header/Header";
7
8
  import AFooter from "./Footer/Footer";
8
9
  import ASearchTextField from "./SearchTextField/SearchTextField";
9
10
  import AMailTo from "./MailTo/MailTo";
11
+ import ATable from "./Table/ATable";
10
12
 
11
13
  const Components = {
14
+ ACheckbox,
12
15
  AButton,
13
16
  ATextField,
14
17
  APasswordField,
@@ -17,6 +20,7 @@ const Components = {
17
20
  AFooter,
18
21
  ASearchTextField,
19
22
  AMailTo,
23
+ ATable,
20
24
  };
21
25
 
22
26
  Object.keys(Components).forEach((name) => {
@@ -54,6 +54,13 @@ export const profileDropDown = [
54
54
  dev: "https://pk.adtdev.kz/profile/browsing-history",
55
55
  staging: "https://pk.adada.kz/profile/browsing-history",
56
56
  prod: "https://pk.adata.kz/profile/browsing-history"
57
+ },
58
+ {
59
+ id: 10,
60
+ name: "Мои отчеты",
61
+ dev: "https://pk.adtdev.kz/profile/my-reports",
62
+ staging: "https://pk.adada.kz/profile/my-reports",
63
+ prod: "https://pk.adata.kz/profile/my-reports"
57
64
  }
58
65
  ],
59
66
  disabled: false