adata-ui 0.1.68 → 0.1.71
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/dist/adata-ui.common.js +575 -59
- package/dist/adata-ui.common.js.map +1 -1
- package/dist/adata-ui.css +1 -1
- package/dist/adata-ui.umd.js +575 -59
- package/dist/adata-ui.umd.js.map +1 -1
- package/dist/adata-ui.umd.min.js +2 -2
- package/dist/adata-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/App.vue +2 -1
- package/src/assets/_text_field.scss +18 -1
- package/src/components/MailTo/MailTo.vue +133 -83
- package/src/components/TextArea/TextArea.stories.js +17 -0
- package/src/components/TextArea/TextArea.vue +122 -0
- package/src/components/TextField/TextField.vue +5 -1
- package/src/components/index.js +2 -0
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
&__input {
|
|
65
|
+
&__input, &__textarea {
|
|
66
66
|
background: #ffffff;
|
|
67
67
|
border: 0.5px solid #c4c4c4;
|
|
68
68
|
box-sizing: border-box;
|
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
top: 12px;
|
|
87
87
|
font-size: 10px;
|
|
88
88
|
color: #71757A;
|
|
89
|
+
text-overflow: inherit;
|
|
90
|
+
width: 100%;
|
|
89
91
|
@media(max-width: 1025px) {
|
|
90
92
|
font-size: 8px;
|
|
91
93
|
}
|
|
@@ -128,6 +130,21 @@
|
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
|
|
133
|
+
&__textarea {
|
|
134
|
+
min-height: 120px;
|
|
135
|
+
resize: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&__textarea + label {
|
|
139
|
+
top: 20px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&--ellipsis {
|
|
143
|
+
width: calc(100% - 56px);
|
|
144
|
+
text-overflow: ellipsis;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
|
147
|
+
|
|
131
148
|
&__icon {
|
|
132
149
|
position: absolute;
|
|
133
150
|
right: 16px;
|
|
@@ -1,111 +1,149 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="mail">
|
|
3
|
-
<h2 class="mail__title">Интересует больше данных?</h2>
|
|
4
|
-
<p class="mail__subtitle">
|
|
5
|
-
Отправьте ваш запрос на
|
|
6
|
-
<a class="mail__link" href="mailto:info@adata.kz">info@adata.kz</a>
|
|
7
|
-
</p>
|
|
8
3
|
<div class="mail__img-wrapper">
|
|
9
|
-
<svg
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<path
|
|
19
|
-
d="M103.97 17.2671L5.64253 38.4363C2.12229 39.1942 -0.117059 42.6623 0.640828 46.1825L13.8374 107.478C14.5953 110.998 18.0634 113.238 21.5837 112.48L119.911 91.3105C123.431 90.5526 125.67 87.0845 124.912 83.5643L111.716 22.2687C110.958 18.7485 107.49 16.5092 103.97 17.2671Z"
|
|
20
|
-
fill="white"
|
|
21
|
-
stroke="#9DA3AC"
|
|
22
|
-
stroke-linecap="round"
|
|
23
|
-
stroke-linejoin="round"
|
|
24
|
-
/>
|
|
25
|
-
<path
|
|
26
|
-
opacity="0.6"
|
|
27
|
-
d="M61.5601 77.2102C56.4501 78.3102 52.2901 72.8102 43.4901 67.3502C25.6601 56.3002 9.6001 45.6602 9.6001 45.6602L11.9101 56.6602L49.0601 80.2402C55.0601 83.3502 65.0601 81.7402 70.3101 75.0202C69.1401 74.7002 67.7001 75.8902 61.5601 77.2102Z"
|
|
28
|
-
fill="#BDC7CE"
|
|
29
|
-
fill-opacity="0.4"
|
|
30
|
-
/>
|
|
31
|
-
<path
|
|
32
|
-
opacity="0.6"
|
|
33
|
-
d="M28.77 97.0891C27.7509 97.3094 26.6984 97.3266 25.6726 97.1397C24.6468 96.9528 23.6679 96.5654 22.792 95.9998C21.9161 95.4341 21.1604 94.7013 20.568 93.8432C19.9757 92.9851 19.5584 92.0186 19.34 90.9991L9.41003 44.8891L3.28002 41.5391C2.42002 41.7291 0.0200244 43.2791 0.940024 47.5391L13.55 106.069C13.7685 107.088 14.1854 108.053 14.7771 108.91C15.3688 109.768 16.1236 110.5 16.9984 111.066C17.8732 111.631 18.8508 112.019 19.8754 112.206C20.9001 112.394 21.9516 112.378 22.97 112.159L118.53 91.5891C120.58 91.1313 122.367 89.8858 123.507 88.1215C124.646 86.3572 125.046 84.2157 124.62 82.1591L123.44 76.6891L28.77 97.0891Z"
|
|
34
|
-
fill="#BDC7CE"
|
|
35
|
-
fill-opacity="0.4"
|
|
36
|
-
/>
|
|
37
|
-
<path
|
|
38
|
-
d="M2.46973 40.9509L55.2897 75.1109C56.7268 76.0398 58.3331 76.6758 60.0164 76.9825C61.6998 77.2892 63.4272 77.2606 65.0995 76.8983C66.7718 76.536 68.3561 75.8471 69.7616 74.8711C71.1671 73.8951 72.366 72.6513 73.2897 71.2109L107.19 18.2109"
|
|
39
|
-
stroke="#9DA3AC"
|
|
40
|
-
stroke-linecap="round"
|
|
41
|
-
stroke-linejoin="round"
|
|
42
|
-
/>
|
|
43
|
-
<path
|
|
44
|
-
d="M82.5601 56.9102L122.68 88.5802"
|
|
45
|
-
stroke="#9DA3AC"
|
|
46
|
-
stroke-linecap="round"
|
|
47
|
-
stroke-linejoin="round"
|
|
48
|
-
/>
|
|
49
|
-
<path
|
|
50
|
-
d="M39.2497 65.2207L17.4297 111.241"
|
|
51
|
-
stroke="#9DA3AC"
|
|
52
|
-
stroke-linecap="round"
|
|
53
|
-
stroke-linejoin="round"
|
|
54
|
-
/>
|
|
55
|
-
<path
|
|
56
|
-
d="M107.69 30.8C114.538 30.8 120.09 25.2483 120.09 18.4C120.09 11.5517 114.538 6 107.69 6C100.842 6 95.29 11.5517 95.29 18.4C95.29 25.2483 100.842 30.8 107.69 30.8Z"
|
|
57
|
-
fill="#E83949"
|
|
58
|
-
/>
|
|
59
|
-
<path
|
|
60
|
-
d="M110.67 24.1891L108.6 24.6391L106.82 16.3391C106.6 15.3391 106.46 14.5591 106.38 13.9691C106.27 14.1391 106.14 14.3291 105.98 14.5391C105.82 14.7491 105.28 15.4391 104.36 16.5391L103.04 15.4491L106.18 11.6691L107.9 11.2891L110.67 24.1891Z"
|
|
61
|
-
fill="white"
|
|
62
|
-
/>
|
|
4
|
+
<svg class="mail__img" width="100" height="85" viewBox="0 0 100 85" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<g clip-path="url(#clip0_518_22722)">
|
|
6
|
+
<path d="M82.8046 8.94045L4.49388 25.7383C1.69026 26.3397 -0.0932329 29.0916 0.510373 31.8849L11.0206 80.5231C11.6242 83.3164 14.3863 85.0933 17.1899 84.4919L95.5007 67.6941C98.3043 67.0927 100.088 64.3408 99.4842 61.5475L88.974 12.9093C88.3704 10.116 85.6083 8.33906 82.8046 8.94045Z" fill="white" stroke="#9DA3AC" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
<path opacity="0.6" d="M49.0286 56.5055C44.9588 57.3783 41.6457 53.0141 34.6371 48.6815C20.4367 39.9133 7.646 31.4705 7.646 31.4705L9.48575 40.199L39.0732 58.9098C43.8518 61.3776 51.8161 60.1 55.9974 54.7677C55.0656 54.5138 53.9187 55.458 49.0286 56.5055Z" fill="#BDC7CE" fill-opacity="0.4"/>
|
|
8
|
+
<path opacity="0.6" d="M22.9133 72.2794C22.1016 72.4542 21.2633 72.4679 20.4463 72.3196C19.6294 72.1713 18.8498 71.8639 18.1522 71.415C17.4546 70.9662 16.8527 70.3847 16.3809 69.7038C15.9092 69.0229 15.5768 68.256 15.4029 67.447L7.49433 30.8586L2.6122 28.2003C1.92726 28.3511 0.0158305 29.581 0.748548 32.9613L10.7916 79.405C10.9655 80.2132 11.2976 80.9794 11.7689 81.6596C12.2401 82.3399 12.8412 82.9211 13.5379 83.3698C14.2346 83.8186 15.0132 84.1262 15.8293 84.275C16.6454 84.4239 17.4828 84.4112 18.2939 84.2375L94.401 67.9151C96.0335 67.5519 97.4571 66.5636 98.3645 65.1636C99.272 63.7637 99.5905 62.0643 99.2513 60.4324L98.3115 56.0919L22.9133 72.2794Z" fill="#BDC7CE" fill-opacity="0.4"/>
|
|
9
|
+
<path d="M1.9668 27.7336L44.0343 54.8397C45.1788 55.5767 46.4581 56.0814 47.7988 56.3248C49.1396 56.5682 50.5153 56.5455 51.8471 56.258C53.179 55.9704 54.4408 55.4238 55.5602 54.6494C56.6796 53.8749 57.6344 52.888 58.3701 51.745L85.3692 9.68939" stroke="#9DA3AC" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
|
+
<path d="M65.7535 40.3973L97.7063 65.5276" stroke="#9DA3AC" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
+
<path d="M31.2595 46.9918L13.8813 83.5087" stroke="#9DA3AC" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
|
+
<path d="M85.7678 19.6789C91.222 19.6789 95.6435 15.2736 95.6435 9.83943C95.6435 4.40526 91.222 0 85.7678 0C80.3135 0 75.892 4.40526 75.892 9.83943C75.892 15.2736 80.3135 19.6789 85.7678 19.6789Z" fill="#E83949"/>
|
|
13
|
+
<path d="M88.1413 14.433L86.4927 14.7901L85.075 8.20403C84.8998 7.41053 84.7883 6.7916 84.7246 6.32343C84.637 6.45833 84.5335 6.60909 84.406 6.77572C84.2786 6.94236 83.8485 7.48987 83.1158 8.36273L82.0645 7.49781L84.5653 4.49837L85.9352 4.19684L88.1413 14.433Z" fill="white"/>
|
|
63
14
|
</g>
|
|
64
15
|
<defs>
|
|
65
|
-
<clipPath id="
|
|
66
|
-
<rect
|
|
67
|
-
width="125.56"
|
|
68
|
-
height="107.12"
|
|
69
|
-
fill="white"
|
|
70
|
-
transform="translate(0 6)"
|
|
71
|
-
/>
|
|
16
|
+
<clipPath id="clip0_518_22722">
|
|
17
|
+
<rect width="100" height="85" fill="white"/>
|
|
72
18
|
</clipPath>
|
|
73
19
|
</defs>
|
|
74
20
|
</svg>
|
|
75
21
|
</div>
|
|
22
|
+
<h2 class="mail__title">Интересует больше данных?</h2>
|
|
76
23
|
<p class="mail__text">
|
|
77
|
-
|
|
78
|
-
в кратчайшие сроки.
|
|
24
|
+
Оставьте комментарий мы обязательно ответим Вам в кратчайшие сроки
|
|
79
25
|
</p>
|
|
26
|
+
<form class="mail__form" novalidate>
|
|
27
|
+
<a-text-field
|
|
28
|
+
class="mail__form-input"
|
|
29
|
+
label="Введите email"
|
|
30
|
+
:error-text="emailError"
|
|
31
|
+
:value="userEmail ? userEmail : email"
|
|
32
|
+
@input="setEmail"
|
|
33
|
+
required
|
|
34
|
+
/>
|
|
35
|
+
<a-text-field
|
|
36
|
+
class="mail__form-input"
|
|
37
|
+
label="Введите номер телефона"
|
|
38
|
+
v-mask="'8 (###) ###-##-##'"
|
|
39
|
+
v-model="phoneNumber"
|
|
40
|
+
/>
|
|
41
|
+
<a-text-area
|
|
42
|
+
class="mail__form-input"
|
|
43
|
+
label="Ваш комментарий"
|
|
44
|
+
:error-text="messageError"
|
|
45
|
+
v-model="message"
|
|
46
|
+
required
|
|
47
|
+
/>
|
|
48
|
+
<a-button
|
|
49
|
+
class="mail__form-btn"
|
|
50
|
+
@click.prevent="onSubmitForm"
|
|
51
|
+
>
|
|
52
|
+
Отправить
|
|
53
|
+
</a-button>
|
|
54
|
+
</form>
|
|
80
55
|
</div>
|
|
81
56
|
</template>
|
|
82
57
|
|
|
83
58
|
<script>
|
|
84
59
|
export default {
|
|
85
|
-
name: "
|
|
60
|
+
name: "MailToTemplate",
|
|
61
|
+
props: {
|
|
62
|
+
userEmail: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: ''
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
data() {
|
|
68
|
+
return {
|
|
69
|
+
email: '',
|
|
70
|
+
phoneNumber: '',
|
|
71
|
+
message: '',
|
|
72
|
+
emailError: '',
|
|
73
|
+
messageError: ''
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
setEmail(data) {
|
|
78
|
+
this.email = data;
|
|
79
|
+
},
|
|
80
|
+
onSubmitForm() {
|
|
81
|
+
const regex = new RegExp('^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$')
|
|
82
|
+
this.email = this.userEmail
|
|
83
|
+
if(!this.email.length || !regex.test(this.email)) {
|
|
84
|
+
this.emailError = 'Введите валидыный email';
|
|
85
|
+
return;
|
|
86
|
+
} else {
|
|
87
|
+
this.emailError = '';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if(this.message.length < 20) {
|
|
91
|
+
this.messageError = 'Введите больше чем 20 символов';
|
|
92
|
+
return;
|
|
93
|
+
} else {
|
|
94
|
+
this.messageError = '';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this.requestSupport()
|
|
98
|
+
},
|
|
99
|
+
async requestSupport() {
|
|
100
|
+
const requestBody = {
|
|
101
|
+
sender_name: this.email,
|
|
102
|
+
email: this.email,
|
|
103
|
+
phone_number: this.phoneNumber ? this.phoneNumber : this.email,
|
|
104
|
+
message: this.message
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const response = await fetch('https://users.adata.kz/api/v1/message/regards', {
|
|
109
|
+
method: "POST",
|
|
110
|
+
headers: {
|
|
111
|
+
'Content-Type': 'application/json'
|
|
112
|
+
},
|
|
113
|
+
body: JSON.stringify(requestBody)
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const result = await response.json()
|
|
117
|
+
|
|
118
|
+
if(result.success) {
|
|
119
|
+
this.$emit('success', result);
|
|
120
|
+
}
|
|
121
|
+
} catch (e) {
|
|
122
|
+
this.$emit('error', e);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
}
|
|
86
127
|
};
|
|
87
128
|
</script>
|
|
88
129
|
|
|
89
130
|
<style lang="scss" scoped>
|
|
90
131
|
.mail {
|
|
91
|
-
padding:
|
|
132
|
+
padding: 50px 0px;
|
|
133
|
+
@media (max-width: 560px){
|
|
134
|
+
padding: 32px 0;
|
|
135
|
+
}
|
|
92
136
|
&__title {
|
|
93
|
-
font-size:
|
|
94
|
-
line-height:
|
|
137
|
+
font-size: 24px;
|
|
138
|
+
line-height: 33px;
|
|
95
139
|
color: #2c3e50;
|
|
96
140
|
font-weight: 700;
|
|
97
141
|
text-align: center;
|
|
98
142
|
margin-bottom: 16px;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
text-align: center;
|
|
104
|
-
color: #2c3e50;
|
|
105
|
-
}
|
|
106
|
-
&__link {
|
|
107
|
-
color: #007aff;
|
|
108
|
-
text-decoration: underline;
|
|
143
|
+
@media (max-width: 560px){
|
|
144
|
+
font-size: 16px;
|
|
145
|
+
line-height: 22px;
|
|
146
|
+
}
|
|
109
147
|
}
|
|
110
148
|
&__img-wrapper {
|
|
111
149
|
padding: 24px;
|
|
@@ -118,10 +156,22 @@ export default {
|
|
|
118
156
|
object-fit: contain;
|
|
119
157
|
}
|
|
120
158
|
&__text {
|
|
121
|
-
font-size:
|
|
159
|
+
font-size: 16px;
|
|
122
160
|
line-height: 22px;
|
|
123
161
|
text-align: center;
|
|
124
162
|
color: #2c3e50;
|
|
163
|
+
margin-bottom: 16px;
|
|
164
|
+
}
|
|
165
|
+
&__form {
|
|
166
|
+
max-width: 370px;
|
|
167
|
+
margin: 0 auto;
|
|
168
|
+
&-input {
|
|
169
|
+
margin-bottom: 16px;
|
|
170
|
+
}
|
|
171
|
+
&-btn {
|
|
172
|
+
margin: 0 auto;
|
|
173
|
+
display: block;
|
|
174
|
+
}
|
|
125
175
|
}
|
|
126
176
|
}
|
|
127
177
|
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ATextArea from "./TextArea.vue";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'TextArea',
|
|
5
|
+
component: ATextArea,
|
|
6
|
+
data: () => ({ value: "" }),
|
|
7
|
+
template: "<a-text-area @input='(val) => {this.value = val}' label='Example'></a-text-area>>"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Template = (args, { argTypes }) => ({
|
|
11
|
+
components: { ATextArea },
|
|
12
|
+
props: Object.keys(argTypes),
|
|
13
|
+
template: '<a-text-area v-bind="$props"></a-text-area>'
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export const Clearable = Template.bind({});
|
|
17
|
+
Clearable.args = {label: 'Clearable', clearable: true}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="adt-text-block">
|
|
3
|
+
<div :class="['adt-text-block__field', { error: !!errorText }]">
|
|
4
|
+
<textarea
|
|
5
|
+
ref="textarea"
|
|
6
|
+
:type="type"
|
|
7
|
+
:value="value"
|
|
8
|
+
:placeholder="placeholder"
|
|
9
|
+
required
|
|
10
|
+
@input="$emit('input', $event.target.value)"
|
|
11
|
+
@keyup.enter="enterPressed"
|
|
12
|
+
class="adt-text-block__textarea"
|
|
13
|
+
:class="{ error: !!errorText }"
|
|
14
|
+
/>
|
|
15
|
+
<label class="adt-text-block__label" :class="{ 'adt-text-block--ellipsis': isEllipsis }">
|
|
16
|
+
{{ label }}
|
|
17
|
+
<span v-if="required" class="adt-text-block__required">*</span>
|
|
18
|
+
</label>
|
|
19
|
+
<div
|
|
20
|
+
class="adt-text-block__icon desktop"
|
|
21
|
+
v-if="clearable && value && value.length > 0"
|
|
22
|
+
@click="$emit('input', '')"
|
|
23
|
+
>
|
|
24
|
+
<svg
|
|
25
|
+
width="12"
|
|
26
|
+
height="12"
|
|
27
|
+
fill="none"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
viewBox="0 0 16 16"
|
|
30
|
+
id="clearIcon"
|
|
31
|
+
>
|
|
32
|
+
<path
|
|
33
|
+
d="M2 2l12 12m0-12L2 14"
|
|
34
|
+
stroke="#2C3E50"
|
|
35
|
+
stroke-linecap="round"
|
|
36
|
+
stroke-linejoin="round"
|
|
37
|
+
></path>
|
|
38
|
+
</svg>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="adt-text-block__error" v-if="!!errorText">
|
|
42
|
+
<svg
|
|
43
|
+
width="14"
|
|
44
|
+
height="14"
|
|
45
|
+
viewBox="0 0 16 16"
|
|
46
|
+
fill="none"
|
|
47
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
48
|
+
id="icon__attention"
|
|
49
|
+
>
|
|
50
|
+
<path
|
|
51
|
+
d="M8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4H8.5ZM7.5 9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9H7.5ZM7.5 4V9H8.5V4H7.5Z"
|
|
52
|
+
fill="#FF2E43"
|
|
53
|
+
/>
|
|
54
|
+
<path
|
|
55
|
+
d="M8.5 11C8.5 10.7239 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.7239 7.5 11H8.5ZM7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5H7.5ZM7.5 11V11.5H8.5V11H7.5Z"
|
|
56
|
+
fill="#FF2E43"
|
|
57
|
+
/>
|
|
58
|
+
<circle cx="8" cy="8" r="7" stroke="#FF2E43" />
|
|
59
|
+
</svg>
|
|
60
|
+
{{ errorText }}
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
<script>
|
|
65
|
+
import "../../assets/style.scss";
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
name: "TextArea",
|
|
69
|
+
props: {
|
|
70
|
+
errorText: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: "",
|
|
73
|
+
},
|
|
74
|
+
label: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: true,
|
|
77
|
+
},
|
|
78
|
+
type: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "text",
|
|
81
|
+
},
|
|
82
|
+
value: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "",
|
|
85
|
+
},
|
|
86
|
+
placeholder: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: "",
|
|
89
|
+
},
|
|
90
|
+
clearable: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false,
|
|
93
|
+
},
|
|
94
|
+
required: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false,
|
|
97
|
+
},
|
|
98
|
+
isEllipsis: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false,
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
data() {
|
|
104
|
+
return {
|
|
105
|
+
showPlaceholder: false,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
computed: {
|
|
109
|
+
inputPlaceholder() {
|
|
110
|
+
return this.showPlaceholder ? this.placeholder : "";
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
methods: {
|
|
114
|
+
enterPressed() {
|
|
115
|
+
this.$emit("enterPressed", this.value);
|
|
116
|
+
},
|
|
117
|
+
inputHandler(e) {
|
|
118
|
+
this.$emit("input", e.target.value);
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
</script>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
class="adt-text-block__input"
|
|
13
13
|
:class="{ error: !!errorText }"
|
|
14
14
|
/>
|
|
15
|
-
<label class="adt-text-block__label">
|
|
15
|
+
<label class="adt-text-block__label" :class="{ 'adt-text-block--ellipsis': isEllipsis }">
|
|
16
16
|
{{ label }}
|
|
17
17
|
<span v-if="required" class="adt-text-block__required">*</span>
|
|
18
18
|
</label>
|
|
@@ -95,6 +95,10 @@ export default {
|
|
|
95
95
|
type: Boolean,
|
|
96
96
|
default: false,
|
|
97
97
|
},
|
|
98
|
+
isEllipsis: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false,
|
|
101
|
+
}
|
|
98
102
|
},
|
|
99
103
|
data() {
|
|
100
104
|
return {
|
package/src/components/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import ACheckbox from "./Checkbox/ACheckbox";
|
|
|
3
3
|
import ACheckboxMenu from "./CheckboxMenu/CheckboxMenu";
|
|
4
4
|
import AButton from "./Button/AButton";
|
|
5
5
|
import ATextField from "./TextField/TextField";
|
|
6
|
+
import ATextArea from "./TextArea/TextArea";
|
|
6
7
|
import APasswordField from "./PasswordField/PasswordField";
|
|
7
8
|
import AAlert from "./Alert/Alert";
|
|
8
9
|
import AHeader from "./Header/Header";
|
|
@@ -15,6 +16,7 @@ const Components = {
|
|
|
15
16
|
ACheckbox,
|
|
16
17
|
AButton,
|
|
17
18
|
ATextField,
|
|
19
|
+
ATextArea,
|
|
18
20
|
APasswordField,
|
|
19
21
|
AAlert,
|
|
20
22
|
AHeader,
|